aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authornobody <>1998-12-21 20:06:34 +0000
committernobody <>1998-12-21 20:06:34 +0000
commit94228bd3ca403b6bad17f96e32db7b8cf2e870c6 (patch)
treec5c2deb54b366a5a36d119a4132689b3a939fd51 /gdb
parentbe9485d5f52e873f1a66f55f34a70fda754fce1f (diff)
downloadbinutils-94228bd3ca403b6bad17f96e32db7b8cf2e870c6.zip
binutils-94228bd3ca403b6bad17f96e32db7b8cf2e870c6.tar.gz
binutils-94228bd3ca403b6bad17f96e32db7b8cf2e870c6.tar.bz2
This commit was manufactured by cvs2svn to create branch 'FSF'.
Sprout from master 1991-11-19 05:16:47 UTC Stu Grossman <grossman@cygnus> 'Initial revision' Cherrypick from master 1998-12-21 20:06:33 UTC Elena Zannoni <ezannoni@kwikemart.cygnus.com> 'Initial revision': readline/INSTALL readline/bind.c readline/config.h.in readline/doc/Makefile.in readline/examples/histexamp.c readline/isearch.c readline/parens.c readline/search.c readline/shell.c readline/support/install.sh readline/support/mkdirs readline/tilde.c readline/tilde.h readline/xmalloc.c Cherrypick from master 1991-05-21 19:55:06 UTC K. Richard Pixley <rich@cygnus> 'Initial revision': readline/Makefile.in readline/configure readline/readline.c Cherrypick from master 1994-01-16 03:39:57 UTC Per Bothner <per@bothner.com> ' Merge in changes from bash-1.13. The most obvious one is': readline/complete.c readline/display.c readline/rldefs.h Delete: .Sanitize DOC.Sanitize DOC.configure INSTALL Makefile.in README.configure SUPPORTED bfd/.Sanitize bfd/COPYING bfd/ChangeLog bfd/Makefile bfd/Makefile.in bfd/TODO bfd/VERSION bfd/aout-encap.c bfd/aout.c bfd/aout32.c bfd/aout64.c bfd/aoutf1.h bfd/aoutx.c bfd/aoutx.h bfd/archive.c bfd/archures.c bfd/archures.h bfd/awkscan bfd/awkscan-ip bfd/awkscan-p bfd/bfd-in.h bfd/bfd.c bfd/bfd.doc bfd/bfd.doc.ps bfd/bfd.texinfo bfd/blins-p bfd/bout.c bfd/cache.c bfd/coff-a29k.c bfd/coff-code.h bfd/coff-i386.c bfd/coff-i960.c bfd/coff-m68k.c bfd/coff-m88k.c bfd/coff-mips.c bfd/coff-rs6000.c bfd/coffcode.h bfd/coffish.h bfd/coffswap.c bfd/config.sub bfd/configure bfd/configure.in bfd/core.c bfd/cplus-dem.c bfd/cpu-a29k.c bfd/cpu-h8300.c bfd/cpu-i386.c bfd/cpu-i960.c bfd/cpu-m88k.c bfd/cpu-rs6000.c bfd/cpu-vax.c bfd/ctor.c bfd/demo64.c bfd/doc/.Sanitize bfd/doc/Makefile bfd/doc/Makefile.in bfd/doc/awkscan bfd/doc/awkscan-ip bfd/doc/awkscan-p bfd/doc/bfd.info bfd/doc/bfd.texinfo bfd/doc/bfdinfo bfd/doc/blins-p bfd/doc/configure.in bfd/doc/exfil1-p bfd/doc/exfil3-p bfd/doc/exfilter bfd/doc/exfilter-p bfd/doc/exfiltst bfd/doc/exmerge bfd/doc/intobfd bfd/doc/mergecom-p bfd/doc/movecom-p bfd/doc/scanit bfd/doc/scanph bfd/doc/sedscript bfd/doc/sedscript-p bfd/doc/startcom-p bfd/doc/tolibbfd bfd/doc/tolibcoff bfd/doc/unPROTO bfd/elf.c bfd/exfilter bfd/exmerge bfd/filemode.c bfd/format.c bfd/host-aout.c bfd/hosts/.Sanitize bfd/hosts/amix.h bfd/hosts/decstation.h bfd/hosts/delta88.h bfd/hosts/dgux.h bfd/hosts/dose.h bfd/hosts/h-m68kv.h bfd/hosts/harris.h bfd/hosts/hp9000.h bfd/hosts/i386mach.h bfd/hosts/i386v.h bfd/hosts/irix3.h bfd/hosts/rs6000.h bfd/hosts/rtbsd.h bfd/hosts/sparc-ll.h bfd/hosts/sparc.h bfd/hosts/sun3.h bfd/hosts/tahoe.h bfd/hosts/ultra3.h bfd/hosts/vaxbsd.h bfd/hosts/vaxult.h bfd/howto.c bfd/i386aout.c bfd/ieee.c bfd/init.c bfd/intobfd bfd/libaout.h bfd/libbfd-in.h bfd/libbfd.c bfd/libbfd.h bfd/libcoff.h bfd/libieee.h bfd/liboasys.h bfd/mergecom-p bfd/misc.c bfd/misc.h bfd/movecom-p bfd/newsos3.c bfd/oasys.c bfd/obstack.c bfd/obstack.h bfd/opncls.c bfd/reloc.c bfd/scanit bfd/scanph bfd/section.c bfd/sedscript bfd/sedscript-p bfd/srec.c bfd/startcom-p bfd/sunos.c bfd/syms.c bfd/targets.c bfd/tolibbfd bfd/tolibcoff bfd/trad-core.c bfd/trad-core.h bfd/unPROTO binutils/.Sanitize binutils/ChangeLog binutils/Makefile.in binutils/README binutils/TODO binutils/alloca.c binutils/am29k-pinsn.c binutils/ar.1 binutils/ar.c binutils/binutils.texi binutils/binutils.texinfo binutils/bucomm.c binutils/config.sub binutils/configure binutils/configure.in binutils/copy.c binutils/cplus-dem.c binutils/filemode.c binutils/gmalloc.c binutils/i960-pinsn.c binutils/is-ranlib.c binutils/is-strip.c binutils/m68k-pinsn.c binutils/maybe-ranlib.c binutils/maybe-strip.c binutils/nm.1 binutils/nm.c binutils/not-ranlib.c binutils/not-strip.c binutils/objdump.1 binutils/objdump.c binutils/ostrip.c binutils/ranlib.1 binutils/ranlib.sh binutils/size.1 binutils/size.c binutils/sparc-pinsn.c binutils/strip.1 binutils/strip.c binutils/version.c config.sub config/.Sanitize config/mh-delta88 config/mh-dgux config/mh-sco config/mh-svr4 config/mh-sysv config/mt-a29k config/mt-ebmon29k configure configure.in gas/.Sanitize gas/.gdbinit gas/COPYING gas/ChangeLog gas/GNUmakefile-host gas/Makefile-intel gas/Makefile.generic gas/Makefile.in gas/Makefile.loic gas/Makefile.old gas/NOTES gas/NOTES.config gas/README gas/README-vms-dbg gas/README.coff gas/README.rich gas/VERSION gas/a.out.gnu.h gas/app.c gas/as.c gas/as.h gas/atof-generic.c gas/bignum-copy.c gas/bignum.h gas/cond.c gas/config.sub gas/config/.Sanitize gas/config/a.out.h gas/config/atof-ieee.c gas/config/atof-vax.c gas/config/coff.gnu.h gas/config/cplus-dem.c gas/config/ebmon29k.mt gas/config/h8300.mt gas/config/h8300hds.mt gas/config/ho-a29k.h gas/config/ho-ansi.h gas/config/ho-cygnus.h gas/config/ho-decstation.h gas/config/ho-generic.h gas/config/ho-hpux.h gas/config/ho-i386.h gas/config/ho-rs6000.h gas/config/ho-sun3.h gas/config/ho-sun386.h gas/config/ho-sun4.h gas/config/ho-sunos.h gas/config/ho-sysv.h gas/config/ho-vax.h gas/config/m68k.mt gas/config/mh-a29k gas/config/mh-cygnus gas/config/mh-i386 gas/config/mips.mt gas/config/obj-aout.c gas/config/obj-aout.h gas/config/obj-bfd-sunos.c gas/config/obj-bfd-sunos.h gas/config/obj-bout.c gas/config/obj-bout.h gas/config/obj-coff.c gas/config/obj-coff.h gas/config/obj-generic.c gas/config/obj-generic.h gas/config/obj-ieee.c gas/config/obj-ieee.h gas/config/ranlib.h gas/config/rs6000.mt gas/config/signame.h gas/config/stab.h gas/config/tc-a29k.c gas/config/tc-a29k.h gas/config/tc-generic.c gas/config/tc-generic.h gas/config/tc-h8300.c gas/config/tc-i386.c gas/config/tc-i386.h gas/config/tc-i860.c gas/config/tc-i860.h gas/config/tc-i960.c gas/config/tc-i960.h gas/config/tc-m68851.h gas/config/tc-m68k.c gas/config/tc-m68k.h gas/config/tc-ns32k.c gas/config/tc-ns32k.h gas/config/tc-rs6000.c gas/config/tc-rs6000.h gas/config/tc-sparc.c gas/config/tc-sparc.h gas/config/tc-vax.c gas/config/tc-vax.h gas/config/te-dpx2.h gas/config/te-generic.h gas/config/te-ic960.h gas/config/te-motor.h gas/config/te-sco386.h gas/config/te-sparc.h gas/config/te-sun3.h gas/config/te-sysv32.h gas/config/te-unisoft.h gas/config/tmake-sun3 gas/config/vax-inst.h gas/config/vms/.Sanitize gas/config/vms/objrecdef.h gas/config/vms/vms-dbg.c gas/config/vms/vms.c gas/configure gas/configure.in gas/configure.was gas/debug.c gas/doc/Makefile gas/doc/a29k-coff.m4 gas/doc/a29k.m4 gas/doc/all.m4 gas/doc/as.texinfo gas/doc/gen.m4 gas/doc/i80386.m4 gas/doc/i960.m4 gas/doc/m680x0.m4 gas/doc/none.m4 gas/doc/pretex.m4 gas/doc/sparc.m4 gas/doc/vax.m4 gas/doc/vintage.m4 gas/expr.c gas/expr.h gas/flonum-const.c gas/flonum-copy.c gas/flonum-mult.c gas/flonum.h gas/frags.c gas/frags.h gas/hash.c gas/hash.h gas/hex-value.c gas/input-file.c gas/input-file.h gas/input-scrub.c gas/link.cmd gas/make-gas.com gas/messages.c gas/obj.h gas/objdump.c gas/obsolete/gdb-blocks.c gas/obsolete/gdb-file.c gas/obsolete/gdb-lines.c gas/obsolete/gdb-symbols.c gas/obsolete/gdb.c gas/output-file.c gas/output-file.h gas/read.c gas/read.h gas/strstr.c gas/struc-symbol.h gas/subsegs.c gas/subsegs.h gas/symbols.c gas/symbols.h gas/tc.h gas/testscripts/doboth gas/testscripts/doobjcmp gas/testscripts/dostriptest gas/testscripts/dotest gas/testscripts/dounsortreloc gas/testscripts/dounsortsymbols gas/ver960.c gas/version.c gas/write.c gas/write.h gas/xmalloc.c gas/xrealloc.c gdb/.Sanitize gdb/.gdbinit gdb/Attic/Makefile.in gdb/COPYING gdb/ChangeLog gdb/ChangeLog-3.x gdb/Convex.notes gdb/Makefile gdb/Makefile.dist gdb/Makefile.in gdb/Makefile.sdir gdb/Makefile.srcdir gdb/Projects gdb/README gdb/TODO gdb/WHATS.NEW gdb/alldeps.mak gdb/alloca.c gdb/altos-xdep.c gdb/am29k-opcode.h gdb/am29k-pinsn.c gdb/am29k-tdep.c gdb/ansidecl.h gdb/arm-convert.s gdb/arm-opcode.h gdb/arm-pinsn.c gdb/arm-tdep.c gdb/arm-xdep.c gdb/blockframe.c gdb/breakpoint.c gdb/breakpoint.h gdb/buildsym.c gdb/buildsym.h gdb/c-exp.y gdb/coffread.c gdb/command.c gdb/command.h gdb/config.gdb gdb/config.status gdb/config.sub gdb/config/.Sanitize gdb/config/3b1.mh gdb/config/3b1.mt gdb/config/a29k-kern.mt gdb/config/a29k.mt gdb/config/altos.mh gdb/config/altos.mt gdb/config/altosgas.mh gdb/config/altosgas.mt gdb/config/am29k gdb/config/amix.mh gdb/config/amix.mt gdb/config/arm.mh gdb/config/arm.mt gdb/config/bigmips.mh gdb/config/bigmips.mt gdb/config/convex.mh gdb/config/convex.mt gdb/config/decstation.mh gdb/config/decstation.mt gdb/config/delta88.mh gdb/config/delta88.mt gdb/config/hp300bsd.mh gdb/config/hp300bsd.mt gdb/config/hp300hpux.mh gdb/config/hp300hpux.mt gdb/config/i386aout.mt gdb/config/i386mach.mh gdb/config/i386sco.mh gdb/config/i386sco.mt gdb/config/i386v-g.mh gdb/config/i386v-g.mt gdb/config/i386v.mh gdb/config/i386v.mt gdb/config/i386v32-g.mh gdb/config/i386v32-g.mt gdb/config/i386v32.mh gdb/config/i386v32.mt gdb/config/i960.mt gdb/config/irix3.mh gdb/config/irix3.mt gdb/config/isi.mh gdb/config/isi.mt gdb/config/littlemips.mh gdb/config/littlemips.mt gdb/config/m88k.mh gdb/config/m88k.mt gdb/config/merlin.mh gdb/config/merlin.mt gdb/config/mh-vax gdb/config/news.mh gdb/config/news.mt gdb/config/news1000.mh gdb/config/news1000.mt gdb/config/nindy960.mt gdb/config/none.mh gdb/config/none.mt gdb/config/np1.mh gdb/config/np1.mt gdb/config/pn.mh gdb/config/pn.mt gdb/config/pyramid.mh gdb/config/pyramid.mt gdb/config/rs6000.mh gdb/config/rs6000.mt gdb/config/rtbsd.mh gdb/config/sun2os3.mh gdb/config/sun2os3.mt gdb/config/sun2os4.mh gdb/config/sun2os4.mt gdb/config/sun3.mh gdb/config/sun3.mt gdb/config/sun386.mh gdb/config/sun386.mt gdb/config/sun3os3.mh gdb/config/sun3os3.mt gdb/config/sun3os4.mh gdb/config/sun3os4.mt gdb/config/sun4.mh gdb/config/sun4.mt gdb/config/sun4os3.mh gdb/config/sun4os3.mt gdb/config/sun4os4.mh gdb/config/sun4os4.mt gdb/config/symmetry.mh gdb/config/symmetry.mt gdb/config/tahoe.mh gdb/config/tahoe.mt gdb/config/ultra3.mh gdb/config/ultra3.mt gdb/config/umax.mh gdb/config/umax.mt gdb/config/vax.mt gdb/config/vxworks68.mt gdb/config/vxworks960.mt gdb/configure gdb/configure.in gdb/convex-opcode.h gdb/convex-pinsn.c gdb/convex-tdep.c gdb/convex-xdep.c gdb/convx-opcode.h gdb/copying.awk gdb/copying.c gdb/core.c gdb/coredep.c gdb/cplus-dem.c gdb/createtags gdb/dbxread.c gdb/defs.h gdb/depend gdb/doc/.Sanitize gdb/doc/Makefile gdb/doc/Makefile.in gdb/doc/all.m4 gdb/doc/amd29k.m4 gdb/doc/configure.in gdb/doc/gdb.alter-m4 gdb/doc/gdb.bugs-m4 gdb/doc/gdb.canned-m4 gdb/doc/gdb.cmds-m4 gdb/doc/gdb.ctl-m4 gdb/doc/gdb.data-m4 gdb/doc/gdb.emacs-m4 gdb/doc/gdb.files-m4 gdb/doc/gdb.gpl-m4 gdb/doc/gdb.install-m4 gdb/doc/gdb.invoc-m4 gdb/doc/gdb.rdln-m4 gdb/doc/gdb.rename-m4 gdb/doc/gdb.run-m4 gdb/doc/gdb.sample-m4 gdb/doc/gdb.src-m4 gdb/doc/gdb.stack-m4 gdb/doc/gdb.stop-m4 gdb/doc/gdb.symb-m4 gdb/doc/gdb.texinfo gdb/doc/gdb.tgts-m4 gdb/doc/gdb.top-m4 gdb/doc/gdbint.texinfo gdb/doc/gdbinv-m.m4 gdb/doc/gdbinv-m.m4.in gdb/doc/gdbinv-s.m4 gdb/doc/gdbinv-s.m4.in gdb/doc/gen.m4 gdb/doc/i80386.m4 gdb/doc/i960.m4 gdb/doc/interim-gdb.texinfo gdb/doc/interim-gdbinv-m.m4 gdb/doc/interim-gdbinv-s.m4 gdb/doc/m680x0.m4 gdb/doc/none.m4 gdb/doc/pretex.m4 gdb/doc/rc-cm.tex gdb/doc/rc-ps.tex gdb/doc/rc-pslong.tex gdb/doc/rdl-apps.texi gdb/doc/refcard.tex gdb/doc/sparc.m4 gdb/doc/threecol.tex gdb/doc/vax.m4 gdb/dwarfread.c gdb/elfread.c gdb/environ.c gdb/environ.h gdb/eval.c gdb/exec.c gdb/expprint.c gdb/expread.tab.c gdb/expread.y gdb/expression.h gdb/findvar.c gdb/frame.h gdb/gdb-int.texinfo gdb/gdbcmd.h gdb/gdbcore.h gdb/getpagesize.h gdb/gmalloc.c gdb/gmalloc.h gdb/gould-pinsn.c gdb/gould-xdep.c gdb/hp300hpux-xdep.c gdb/hp300ux-xdep.c gdb/i386-pinsn.c gdb/i386-tdep.c gdb/i386-xdep.c gdb/i387-tdep.c gdb/i960-pinsn.c gdb/i960-tdep.c gdb/ieee-float.c gdb/ieee-float.h gdb/infcmd.c gdb/inferior.h gdb/inflow.c gdb/infptrace.c gdb/infrun.c gdb/infrun.hacked.c gdb/inftarg.c gdb/kdb-start.c gdb/language.c gdb/language.h gdb/m2-exp.y gdb/m68k-opcode.h gdb/m68k-pinsn.c gdb/m68k-stub.c gdb/m68k-tdep.c gdb/m88k-opcode.h gdb/m88k-pinsn.c gdb/m88k-tdep.c gdb/m88k-xdep.c gdb/mach386-xdep.c gdb/main.c gdb/mcheck.c gdb/mem-break.c gdb/minimon.h gdb/mips-opcode.h gdb/mips-pinsn.c gdb/mips-tdep.c gdb/mips-xdep.c gdb/mipsread.c gdb/mtrace.awk gdb/mtrace.c gdb/munch gdb/news-xdep.c gdb/nindy-tdep.c gdb/np1-opcode.h gdb/ns32k-opcode.h gdb/ns32k-pinsn.c gdb/obstack.c gdb/obstack.h gdb/param-no-tm.h gdb/param.h gdb/parse.c gdb/parser-defs.h gdb/pn-opcode.h gdb/printcmd.c gdb/procfs.c gdb/putenv.c gdb/pyr-opcode.h gdb/pyr-pinsn.c gdb/pyr-tdep.c gdb/pyr-xdep.c gdb/regex.c gdb/regex.h gdb/rem-m68k.shar gdb/rem-multi.shar gdb/remote-adapt.c gdb/remote-eb.c gdb/remote-mm.c gdb/remote-multi.shar gdb/remote-nindy.c gdb/remote-sa.m68k.shar gdb/remote-sa.sparc.c gdb/remote-vx.68.c gdb/remote-vx.c gdb/remote.c gdb/rs6000-pinsn.c gdb/rs6000-tdep.c gdb/rs6000-xdep.c gdb/rs6k-opcode.def gdb/rs6k-opcode.h gdb/saber.suppress gdb/signals.h gdb/signame.c gdb/signame.h gdb/solib.c gdb/source.c gdb/sparc-opcode.h gdb/sparc-pinsn.c gdb/sparc-tdep.c gdb/sparc-xdep.c gdb/stab.def gdb/stack.c gdb/standalone.c gdb/stddef.h gdb/stdlib.h gdb/stuff.c gdb/sun3-xdep.c gdb/sun386-xdep.c gdb/symfile.c gdb/symfile.h gdb/symm-tdep.c gdb/symm-xdep.c gdb/symmetry-tdep.c gdb/symmetry-xdep.c gdb/symmisc.c gdb/symtab.c gdb/symtab.h gdb/tahoe-opcode.h gdb/tahoe-pinsn.c gdb/target.c gdb/target.h gdb/tdesc.c gdb/tdesc.h gdb/terminal.h gdb/tm-29k.h gdb/tm-3b1.h gdb/tm-68k.h gdb/tm-altos.h gdb/tm-altosgas.h gdb/tm-amix.h gdb/tm-arm.h gdb/tm-bigmips.h gdb/tm-convex.h gdb/tm-delta88.h gdb/tm-hp300bsd.h gdb/tm-hp300hpux.h gdb/tm-i386v-g.h gdb/tm-i386v.h gdb/tm-i960.h gdb/tm-irix3.h gdb/tm-isi.h gdb/tm-m88k.h gdb/tm-merlin.h gdb/tm-mips.h gdb/tm-news.h gdb/tm-nindy960.h gdb/tm-np1.h gdb/tm-pn.h gdb/tm-pyr.h gdb/tm-rs6000.h gdb/tm-sparc.h gdb/tm-sun2.h gdb/tm-sun2os4.h gdb/tm-sun3.h gdb/tm-sun386.h gdb/tm-sun3os4.h gdb/tm-sun4os4.h gdb/tm-sunos.h gdb/tm-svr4.h gdb/tm-symmetry.h gdb/tm-tahoe.h gdb/tm-ultra3.h gdb/tm-umax.h gdb/tm-vax.h gdb/tm-vx68.h gdb/tm-vx960.h gdb/tm-vxworks68.h gdb/tm-vxworks960.h gdb/ultra3-xdep.c gdb/umax-xdep.c gdb/utils.c gdb/valarith.c gdb/valops.c gdb/valprint.c gdb/value.h gdb/values.c gdb/vax-opcode.h gdb/vax-pinsn.c gdb/vx-share/.Sanitize gdb/vx-share/dbgRpcLib.h gdb/vx-share/ptrace.h gdb/vx-share/reg.h gdb/vx-share/vxTypes.h gdb/vx-share/vxWorks.h gdb/vx-share/wait.h gdb/vx-share/xdr_ld.c gdb/vx-share/xdr_ld.h gdb/vx-share/xdr_ptrace.c gdb/vx-share/xdr_ptrace.h gdb/vx-share/xdr_rdb.c gdb/vx-share/xdr_rdb.h gdb/vx-share/xdr_regs.c gdb/vx-share/xdr_regs.h gdb/xcoffexec.c gdb/xcoffread.c gdb/xm-3b1.h gdb/xm-altos.h gdb/xm-amix.h gdb/xm-arm.h gdb/xm-bigmips.h gdb/xm-convex.h gdb/xm-delta88.h gdb/xm-hp300bsd.h gdb/xm-hp300hpux.h gdb/xm-i386mach.h gdb/xm-i386sco.h gdb/xm-i386v.h gdb/xm-i386v32.h gdb/xm-irix3.h gdb/xm-isi.h gdb/xm-m68k.h gdb/xm-m88k.h gdb/xm-merlin.h gdb/xm-mips.h gdb/xm-news.h gdb/xm-news1000.h gdb/xm-np1.h gdb/xm-pn.h gdb/xm-pyr.h gdb/xm-rs6000.h gdb/xm-rtbsd.h gdb/xm-sparc.h gdb/xm-sun2.h gdb/xm-sun3.h gdb/xm-sun386.h gdb/xm-sun3os4.h gdb/xm-sun4os4.h gdb/xm-svr4.h gdb/xm-symmetry.h gdb/xm-tahoe.h gdb/xm-ultra3.h gdb/xm-umax.h gdb/xm-vax.h gprof/Makefile gprof/Makefile.in gprof/arcs.c gprof/config/mt-i386 gprof/config/mt-sparc gprof/config/tmake-i386 gprof/config/tmake-sparc gprof/configure gprof/configure.in gprof/dfn.c gprof/gmon.h gprof/gprof.1 gprof/gprof.c gprof/gprof.callg gprof/gprof.flat gprof/gprof.h gprof/hertz.c gprof/i386.c gprof/i386.h gprof/lookup.c gprof/pathnames.h gprof/printgprof.c gprof/printlist.c gprof/sparc.c gprof/sparc.h gprof/t.c gprof/tahoe.c gprof/tahoe.h gprof/vax.c gprof/vax.h include/.Sanitize include/COPYING include/ChangeLog include/a.out.encap.h include/a.out.host.h include/a.out.hp.h include/a.out.sun4.h include/a.out.vax.h include/a29k-opcode.h include/aout64.h include/ar.h include/arm-opcode.h include/bcs88kcoff.h include/bfd.h include/bout.h include/coff-a29k.h include/coff-i386.h include/coff-i960.h include/coff-m68k.h include/coff-m88k.h include/coff-mips.h include/coff-rs6000.h include/convx-opcode.h include/dwarf.h include/elf-common.h include/elf-external.h include/elf-internal.h include/gdbm.h include/getopt.h include/h8300-opcode.h include/i386-opcode.h include/i860-opcode.h include/i960-opcode.h include/ieee.h include/internalcoff.h include/m68k-opcode.h include/m88k-opcode.h include/mips-opcode.h include/np1-opcode.h include/ns32k-opcode.h include/oasys.h include/obstack.h include/pn-opcode.h include/pyr-opcode.h include/ranlib.h include/reloc.h include/sparc-opcode.h include/stab.def include/stab.gnu.h include/sysdep.h include/tahoe-opcode.h include/vax-opcode.h include/wait.h install.texinfo ld/.Sanitize ld/ChangeLog ld/Makefile ld/Makefile.in ld/README ld/config.h ld/config.sub ld/config/.Sanitize ld/config/coff-a29k.mt ld/config/decstation.mh ld/config/delta88.mh ld/config/dgux.mh ld/config/ebmon29k.mt ld/config/h-i386v ld/config/h-m68kv ld/config/hmake-dec3100 ld/config/hmake-dgux ld/config/hmake-rtbsd ld/config/hmake-sun3 ld/config/hmake-sun4 ld/config/hmake-sun4-64 ld/config/i386-aout.mt ld/config/i386v.mt ld/config/m68k.mt ld/config/m68kv.mt ld/config/m88k-bcs.mt ld/config/news.mh ld/config/news.mt ld/config/rtbsd.mh ld/config/sparc-ll.mh ld/config/sparc.mh ld/config/sun3.mh ld/config/sun4.mt ld/config/tmake-coff-a29k ld/config/tmake-m88k-bcs ld/config/tmake-sun4 ld/configure ld/configure.in ld/ebmon29k.sc ld/gld.1 ld/h8300hds.c ld/h8300hds.sc ld/i386aout.c ld/i386aout.sc ld/ld-emul.c ld/ld-gld-Ur.script ld/ld-gld-r.script ld/ld-gld.c ld/ld-gld.script ld/ld-gld68k-Ur.script ld/ld-gld68k-r.script ld/ld-gld68k.c ld/ld-gld68k.script ld/ld-gld960.c ld/ld-gld960.script ld/ld-gldm88kbcs-Ur.script ld/ld-gldm88kbcs-r.script ld/ld-gldm88kbcs.c ld/ld-gldm88kbcs.script ld/ld-lnk960-r.script ld/ld-lnk960.c ld/ld-lnk960.script ld/ld-vanilla.c ld/ld.h ld/ld.tex ld/ld.texinfo ld/ldemul.c ld/ldexp.c ld/ldexp.h ld/ldfile.c ld/ldfile.h ld/ldgld.c ld/ldgld.sc ld/ldgld.script ld/ldgld68k.c ld/ldgld68k.sc ld/ldgld68k.script ld/ldgld68kUr.sc ld/ldgld68kUr.script ld/ldgld68kr.sc ld/ldgld68kr.script ld/ldgld960.c ld/ldgld960.sc ld/ldgld960.script ld/ldgldUr.sc ld/ldgldUr.script ld/ldglda29k.c ld/ldglda29k.sc ld/ldglda29k.script ld/ldglda29kUr.sc ld/ldglda29kUr.script ld/ldglda29kr.sc ld/ldglda29kr.script ld/ldgldi386v.c ld/ldgldi386v.sc ld/ldgldi386vUr.sc ld/ldgldi386vr.sc ld/ldgldm68kv.c ld/ldgldm68kv.sc ld/ldgldm68kvUr.sc ld/ldgldm68kvr.sc ld/ldgldm88kbcs.c ld/ldgldm88kbcs.sc ld/ldgldm88kbcs.script ld/ldgldm88kbcsUr.sc ld/ldgldm88kbcsUr.script ld/ldgldm88kbcsr.sc ld/ldgldm88kbcsr.script ld/ldgldr.sc ld/ldgldr.script ld/ldgram.y ld/ldindr.c ld/ldindr.h ld/ldlang.c ld/ldlang.h ld/ldlex.h ld/ldlex.l ld/ldlnk960.c ld/ldlnk960.sc ld/ldlnk960.script ld/ldlnk960r.sc ld/ldlnk960r.script ld/ldm88k.c ld/ldm88k.sc ld/ldm88kUr.sc ld/ldm88kr.sc ld/ldmain.c ld/ldmain.h ld/ldmisc.c ld/ldmisc.h ld/ldsym.c ld/ldsym.h ld/ldtemplate ld/ldvanilla.c ld/ldver.c ld/ldver.h ld/ldwarn.c ld/ldwarn.h ld/ldwrite.c ld/ldwrite.h ld/mkscript.c ld/news.sc readline/.Sanitize readline/ChangeLog readline/config.sub readline/configure.in readline/doc/Makefile readline/doc/texindex.c readline/examples/Makefile readline/history.texi readline/history.texinfo readline/inc-hist.texi readline/inc-history.texinfo readline/inc-read.texi readline/inc-readline.texinfo readline/readline.texi readline/readline.texinfo readline/sysdep-aix.h readline/sysdep-norm.h
Diffstat (limited to 'gdb')
-rw-r--r--gdb/.Sanitize281
-rw-r--r--gdb/.gdbinit13
-rwxr-xr-xgdb/Attic/Makefile.in0
-rw-r--r--gdb/COPYING339
-rw-r--r--gdb/ChangeLog7659
-rw-r--r--gdb/ChangeLog-3.x4846
-rw-r--r--gdb/Convex.notes163
-rwxr-xr-xgdb/Makefile963
-rwxr-xr-xgdb/Makefile.dist575
-rw-r--r--gdb/Makefile.in732
-rwxr-xr-xgdb/Makefile.sdir1
-rwxr-xr-xgdb/Makefile.srcdir1
-rw-r--r--gdb/Projects94
-rw-r--r--gdb/README591
-rw-r--r--gdb/TODO309
-rwxr-xr-xgdb/WHATS.NEW284
-rw-r--r--gdb/alldeps.mak221
-rw-r--r--gdb/alloca.c191
-rw-r--r--gdb/altos-xdep.c166
-rw-r--r--gdb/am29k-opcode.h271
-rw-r--r--gdb/am29k-pinsn.c302
-rw-r--r--gdb/am29k-tdep.c698
-rwxr-xr-xgdb/ansidecl.h93
-rw-r--r--gdb/arm-convert.s16
-rwxr-xr-xgdb/arm-opcode.h294
-rw-r--r--gdb/arm-pinsn.c271
-rw-r--r--gdb/arm-tdep.c406
-rw-r--r--gdb/arm-xdep.c274
-rw-r--r--gdb/blockframe.c745
-rw-r--r--gdb/breakpoint.c2448
-rw-r--r--gdb/breakpoint.h129
-rw-r--r--gdb/buildsym.c3097
-rw-r--r--gdb/buildsym.h296
-rw-r--r--gdb/c-exp.y1583
-rw-r--r--gdb/coffread.c2067
-rw-r--r--gdb/command.c1213
-rw-r--r--gdb/command.h151
-rwxr-xr-xgdb/config.gdb180
-rwxr-xr-xgdb/config.status1
-rwxr-xr-xgdb/config.sub446
-rw-r--r--gdb/config/.Sanitize83
-rw-r--r--gdb/config/3b1.mh12
-rw-r--r--gdb/config/3b1.mt3
-rw-r--r--gdb/config/a29k-kern.mt10
-rw-r--r--gdb/config/a29k.mt10
-rw-r--r--gdb/config/altos.mh6
-rw-r--r--gdb/config/altos.mt3
-rw-r--r--gdb/config/altosgas.mh9
-rw-r--r--gdb/config/altosgas.mt7
-rwxr-xr-xgdb/config/am29k5
-rw-r--r--gdb/config/amix.mh6
-rw-r--r--gdb/config/amix.mt3
-rw-r--r--gdb/config/arm.mh3
-rw-r--r--gdb/config/arm.mt3
-rw-r--r--gdb/config/bigmips.mh3
-rw-r--r--gdb/config/bigmips.mt3
-rw-r--r--gdb/config/convex.mh3
-rw-r--r--gdb/config/convex.mt3
-rw-r--r--gdb/config/decstation.mh3
-rw-r--r--gdb/config/decstation.mt3
-rw-r--r--gdb/config/delta88.mh10
-rw-r--r--gdb/config/delta88.mt3
-rw-r--r--gdb/config/hp300bsd.mh3
-rw-r--r--gdb/config/hp300bsd.mt3
-rw-r--r--gdb/config/hp300hpux.mh15
-rw-r--r--gdb/config/hp300hpux.mt11
-rw-r--r--gdb/config/i386aout.mt4
-rw-r--r--gdb/config/i386mach.mh4
-rw-r--r--gdb/config/i386sco.mh7
-rw-r--r--gdb/config/i386sco.mt3
-rw-r--r--gdb/config/i386v-g.mh7
-rw-r--r--gdb/config/i386v-g.mt7
-rw-r--r--gdb/config/i386v.mh7
-rw-r--r--gdb/config/i386v.mt3
-rw-r--r--gdb/config/i386v32-g.mh7
-rw-r--r--gdb/config/i386v32-g.mt7
-rw-r--r--gdb/config/i386v32.mh7
-rw-r--r--gdb/config/i386v32.mt3
-rw-r--r--gdb/config/i960.mt5
-rw-r--r--gdb/config/irix3.mh6
-rw-r--r--gdb/config/irix3.mt3
-rw-r--r--gdb/config/isi.mh3
-rw-r--r--gdb/config/isi.mt3
-rw-r--r--gdb/config/littlemips.mh3
-rw-r--r--gdb/config/littlemips.mt3
-rw-r--r--gdb/config/m88k.mh3
-rw-r--r--gdb/config/m88k.mt3
-rw-r--r--gdb/config/merlin.mh6
-rw-r--r--gdb/config/merlin.mt3
-rwxr-xr-xgdb/config/mh-vax10
-rw-r--r--gdb/config/news.mh3
-rw-r--r--gdb/config/news.mt3
-rw-r--r--gdb/config/news1000.mh3
-rw-r--r--gdb/config/news1000.mt3
-rw-r--r--gdb/config/nindy960.mt4
-rw-r--r--gdb/config/none.mh3
-rw-r--r--gdb/config/none.mt3
-rw-r--r--gdb/config/np1.mh3
-rw-r--r--gdb/config/np1.mt3
-rw-r--r--gdb/config/pn.mh3
-rw-r--r--gdb/config/pn.mt3
-rw-r--r--gdb/config/pyramid.mh8
-rw-r--r--gdb/config/pyramid.mt7
-rw-r--r--gdb/config/rs6000.mh22
-rw-r--r--gdb/config/rs6000.mt22
-rw-r--r--gdb/config/rtbsd.mh8
-rw-r--r--gdb/config/sun2os3.mh3
-rw-r--r--gdb/config/sun2os3.mt8
-rw-r--r--gdb/config/sun2os4.mh3
-rw-r--r--gdb/config/sun2os4.mt3
-rw-r--r--gdb/config/sun3.mh3
-rw-r--r--gdb/config/sun3.mt8
-rw-r--r--gdb/config/sun386.mh3
-rw-r--r--gdb/config/sun386.mt3
-rw-r--r--gdb/config/sun3os3.mh3
-rw-r--r--gdb/config/sun3os3.mt8
-rw-r--r--gdb/config/sun3os4.mh3
-rw-r--r--gdb/config/sun3os4.mt3
-rw-r--r--gdb/config/sun4.mh3
-rw-r--r--gdb/config/sun4.mt3
-rw-r--r--gdb/config/sun4os3.mh3
-rw-r--r--gdb/config/sun4os3.mt8
-rw-r--r--gdb/config/sun4os4.mh3
-rw-r--r--gdb/config/sun4os4.mt3
-rw-r--r--gdb/config/symmetry.mh3
-rw-r--r--gdb/config/symmetry.mt3
-rw-r--r--gdb/config/tahoe.mh5
-rw-r--r--gdb/config/tahoe.mt3
-rw-r--r--gdb/config/ultra3.mh7
-rw-r--r--gdb/config/ultra3.mt5
-rw-r--r--gdb/config/umax.mh3
-rw-r--r--gdb/config/umax.mt3
-rw-r--r--gdb/config/vax.mt3
-rw-r--r--gdb/config/vxworks68.mt3
-rw-r--r--gdb/config/vxworks960.mt5
-rwxr-xr-xgdb/configure882
-rw-r--r--gdb/configure.in319
-rwxr-xr-xgdb/convex-opcode.h1677
-rw-r--r--gdb/convex-pinsn.c314
-rw-r--r--gdb/convex-tdep.c931
-rw-r--r--gdb/convex-xdep.c983
-rw-r--r--gdb/convx-opcode.h1677
-rw-r--r--gdb/copying.awk55
-rw-r--r--gdb/copying.c220
-rw-r--r--gdb/core.c464
-rw-r--r--gdb/coredep.c113
-rw-r--r--gdb/cplus-dem.c1369
-rwxr-xr-xgdb/createtags20
-rw-r--r--gdb/dbxread.c2847
-rw-r--r--gdb/defs.h296
-rwxr-xr-xgdb/depend12
-rw-r--r--gdb/doc/.Sanitize85
-rwxr-xr-xgdb/doc/Makefile111
-rw-r--r--gdb/doc/Makefile.in202
-rw-r--r--gdb/doc/all.m418
-rw-r--r--gdb/doc/amd29k.m45
-rw-r--r--gdb/doc/configure.in8
-rwxr-xr-xgdb/doc/gdb.alter-m4205
-rwxr-xr-xgdb/doc/gdb.bugs-m4221
-rwxr-xr-xgdb/doc/gdb.canned-m4178
-rwxr-xr-xgdb/doc/gdb.cmds-m4160
-rwxr-xr-xgdb/doc/gdb.ctl-m4306
-rwxr-xr-xgdb/doc/gdb.data-m4926
-rwxr-xr-xgdb/doc/gdb.emacs-m4166
-rwxr-xr-xgdb/doc/gdb.files-m4300
-rwxr-xr-xgdb/doc/gdb.gpl-m4308
-rwxr-xr-xgdb/doc/gdb.install-m457
-rwxr-xr-xgdb/doc/gdb.invoc-m4207
-rwxr-xr-xgdb/doc/gdb.rdln-m47
-rwxr-xr-xgdb/doc/gdb.rename-m4112
-rwxr-xr-xgdb/doc/gdb.run-m4390
-rwxr-xr-xgdb/doc/gdb.sample-m4263
-rwxr-xr-xgdb/doc/gdb.src-m4288
-rwxr-xr-xgdb/doc/gdb.stack-m4279
-rwxr-xr-xgdb/doc/gdb.stop-m4920
-rwxr-xr-xgdb/doc/gdb.symb-m4132
-rw-r--r--gdb/doc/gdb.texinfo7934
-rwxr-xr-xgdb/doc/gdb.tgts-m4192
-rwxr-xr-xgdb/doc/gdb.top-m4451
-rw-r--r--gdb/doc/gdbint.texinfo802
-rwxr-xr-xgdb/doc/gdbinv-m.m413
-rw-r--r--gdb/doc/gdbinv-m.m4.in13
-rwxr-xr-xgdb/doc/gdbinv-s.m4427
-rw-r--r--gdb/doc/gdbinv-s.m4.in427
-rw-r--r--gdb/doc/gen.m413
-rw-r--r--gdb/doc/i80386.m45
-rw-r--r--gdb/doc/i960.m412
-rwxr-xr-xgdb/doc/interim-gdb.texinfo7901
-rwxr-xr-xgdb/doc/interim-gdbinv-m.m413
-rwxr-xr-xgdb/doc/interim-gdbinv-s.m4427
-rw-r--r--gdb/doc/m680x0.m45
-rw-r--r--gdb/doc/none.m449
-rw-r--r--gdb/doc/pretex.m4268
-rwxr-xr-xgdb/doc/rc-cm.tex22
-rwxr-xr-xgdb/doc/rc-ps.tex30
-rwxr-xr-xgdb/doc/rc-pslong.tex30
-rwxr-xr-xgdb/doc/rdl-apps.texi2
-rw-r--r--gdb/doc/refcard.tex465
-rw-r--r--gdb/doc/sparc.m45
-rwxr-xr-xgdb/doc/threecol.tex28
-rw-r--r--gdb/doc/vax.m45
-rw-r--r--gdb/dwarfread.c3545
-rw-r--r--gdb/elfread.c293
-rw-r--r--gdb/environ.c188
-rw-r--r--gdb/environ.h39
-rw-r--r--gdb/eval.c1054
-rw-r--r--gdb/exec.c427
-rw-r--r--gdb/expprint.c332
-rwxr-xr-xgdb/expread.tab.c2948
-rwxr-xr-xgdb/expread.y1989
-rw-r--r--gdb/expression.h200
-rw-r--r--gdb/findvar.c700
-rw-r--r--gdb/frame.h128
-rwxr-xr-xgdb/gdb-int.texinfo242
-rw-r--r--gdb/gdbcmd.h63
-rw-r--r--gdb/gdbcore.h88
-rwxr-xr-xgdb/getpagesize.h25
-rwxr-xr-xgdb/gmalloc.c1152
-rwxr-xr-xgdb/gmalloc.h161
-rw-r--r--gdb/gould-pinsn.c294
-rw-r--r--gdb/gould-xdep.c132
-rwxr-xr-xgdb/hp300hpux-xdep.c230
-rw-r--r--gdb/hp300ux-xdep.c230
-rw-r--r--gdb/i386-pinsn.c1831
-rw-r--r--gdb/i386-tdep.c490
-rw-r--r--gdb/i386-xdep.c251
-rw-r--r--gdb/i387-tdep.c127
-rw-r--r--gdb/i960-pinsn.c863
-rw-r--r--gdb/i960-tdep.c646
-rw-r--r--gdb/ieee-float.c150
-rw-r--r--gdb/ieee-float.h66
-rw-r--r--gdb/infcmd.c1116
-rw-r--r--gdb/inferior.h211
-rw-r--r--gdb/inflow.c499
-rw-r--r--gdb/infptrace.c396
-rw-r--r--gdb/infrun.c1803
-rw-r--r--gdb/infrun.hacked.c1707
-rw-r--r--gdb/inftarg.c195
-rw-r--r--gdb/kdb-start.c40
-rw-r--r--gdb/language.c1106
-rw-r--r--gdb/language.h170
-rw-r--r--gdb/m2-exp.y1226
-rwxr-xr-xgdb/m68k-opcode.h1679
-rw-r--r--gdb/m68k-pinsn.c776
-rw-r--r--gdb/m68k-stub.c980
-rw-r--r--gdb/m68k-tdep.c337
-rwxr-xr-xgdb/m88k-opcode.h585
-rw-r--r--gdb/m88k-pinsn.c343
-rw-r--r--gdb/m88k-tdep.c858
-rw-r--r--gdb/m88k-xdep.c330
-rw-r--r--gdb/mach386-xdep.c154
-rw-r--r--gdb/main.c2196
-rwxr-xr-xgdb/mcheck.c124
-rw-r--r--gdb/mem-break.c178
-rw-r--r--gdb/minimon.h562
-rwxr-xr-xgdb/mips-opcode.h363
-rw-r--r--gdb/mips-pinsn.c149
-rw-r--r--gdb/mips-tdep.c692
-rw-r--r--gdb/mips-xdep.c181
-rw-r--r--gdb/mipsread.c2809
-rwxr-xr-xgdb/mtrace.awk36
-rwxr-xr-xgdb/mtrace.c146
-rwxr-xr-xgdb/munch35
-rw-r--r--gdb/news-xdep.c65
-rw-r--r--gdb/nindy-tdep.c75
-rwxr-xr-xgdb/np1-opcode.h422
-rw-r--r--gdb/ns32k-opcode.h328
-rw-r--r--gdb/ns32k-pinsn.c522
-rwxr-xr-xgdb/obstack.c333
-rwxr-xr-xgdb/obstack.h416
-rwxr-xr-xgdb/param-no-tm.h82
-rwxr-xr-xgdb/param.h32
-rw-r--r--gdb/parse.c628
-rw-r--r--gdb/parser-defs.h162
-rwxr-xr-xgdb/pn-opcode.h282
-rw-r--r--gdb/printcmd.c2003
-rw-r--r--gdb/procfs.c1049
-rw-r--r--gdb/putenv.c117
-rwxr-xr-xgdb/pyr-opcode.h287
-rw-r--r--gdb/pyr-pinsn.c347
-rw-r--r--gdb/pyr-tdep.c134
-rw-r--r--gdb/pyr-xdep.c366
-rw-r--r--gdb/regex.c1732
-rw-r--r--gdb/regex.h179
-rwxr-xr-xgdb/rem-m68k.shar893
-rw-r--r--gdb/rem-multi.shar1301
-rw-r--r--gdb/remote-adapt.c1448
-rw-r--r--gdb/remote-eb.c942
-rw-r--r--gdb/remote-mm.c1706
-rwxr-xr-xgdb/remote-multi.shar1313
-rw-r--r--gdb/remote-nindy.c969
-rwxr-xr-xgdb/remote-sa.m68k.shar893
-rw-r--r--gdb/remote-sa.sparc.c1146
-rw-r--r--gdb/remote-vx.68.c1542
-rw-r--r--gdb/remote-vx.c1487
-rw-r--r--gdb/remote.c854
-rw-r--r--gdb/rs6000-pinsn.c377
-rw-r--r--gdb/rs6000-tdep.c975
-rw-r--r--gdb/rs6000-xdep.c364
-rwxr-xr-xgdb/rs6k-opcode.def224
-rwxr-xr-xgdb/rs6k-opcode.h19
-rw-r--r--gdb/saber.suppress435
-rw-r--r--gdb/signals.h34
-rwxr-xr-xgdb/signame.c257
-rwxr-xr-xgdb/signame.h41
-rw-r--r--gdb/solib.c461
-rw-r--r--gdb/source.c1212
-rwxr-xr-xgdb/sparc-opcode.h643
-rw-r--r--gdb/sparc-pinsn.c465
-rw-r--r--gdb/sparc-tdep.c644
-rw-r--r--gdb/sparc-xdep.c305
-rwxr-xr-xgdb/stab.def182
-rw-r--r--gdb/stack.c1178
-rw-r--r--gdb/standalone.c594
-rwxr-xr-xgdb/stddef.h26
-rwxr-xr-xgdb/stdlib.h10
-rw-r--r--gdb/stuff.c174
-rw-r--r--gdb/sun3-xdep.c160
-rw-r--r--gdb/sun386-xdep.c279
-rw-r--r--gdb/symfile.c1077
-rw-r--r--gdb/symfile.h160
-rw-r--r--gdb/symm-tdep.c494
-rw-r--r--gdb/symm-xdep.c448
-rwxr-xr-xgdb/symmetry-tdep.c494
-rwxr-xr-xgdb/symmetry-xdep.c557
-rw-r--r--gdb/symmisc.c493
-rw-r--r--gdb/symtab.c3020
-rw-r--r--gdb/symtab.h922
-rwxr-xr-xgdb/tahoe-opcode.h213
-rw-r--r--gdb/tahoe-pinsn.c223
-rw-r--r--gdb/target.c532
-rw-r--r--gdb/target.h415
-rwxr-xr-xgdb/tdesc.c1650
-rwxr-xr-xgdb/tdesc.h329
-rw-r--r--gdb/terminal.h50
-rw-r--r--gdb/tm-29k.h666
-rw-r--r--gdb/tm-3b1.h38
-rw-r--r--gdb/tm-68k.h538
-rw-r--r--gdb/tm-altos.h63
-rw-r--r--gdb/tm-altosgas.h24
-rw-r--r--gdb/tm-amix.h47
-rw-r--r--gdb/tm-arm.h405
-rw-r--r--gdb/tm-bigmips.h21
-rw-r--r--gdb/tm-convex.h557
-rw-r--r--gdb/tm-delta88.h27
-rw-r--r--gdb/tm-hp300bsd.h55
-rw-r--r--gdb/tm-hp300hpux.h36
-rw-r--r--gdb/tm-i386v-g.h32
-rw-r--r--gdb/tm-i386v.h299
-rw-r--r--gdb/tm-i960.h394
-rw-r--r--gdb/tm-irix3.h325
-rw-r--r--gdb/tm-isi.h161
-rw-r--r--gdb/tm-m88k.h400
-rw-r--r--gdb/tm-merlin.h354
-rw-r--r--gdb/tm-mips.h346
-rw-r--r--gdb/tm-news.h90
-rw-r--r--gdb/tm-nindy960.h100
-rw-r--r--gdb/tm-np1.h506
-rw-r--r--gdb/tm-pn.h426
-rw-r--r--gdb/tm-pyr.h520
-rw-r--r--gdb/tm-rs6000.h455
-rw-r--r--gdb/tm-sparc.h588
-rw-r--r--gdb/tm-sun2.h32
-rw-r--r--gdb/tm-sun2os4.h20
-rw-r--r--gdb/tm-sun3.h39
-rw-r--r--gdb/tm-sun386.h294
-rw-r--r--gdb/tm-sun3os4.h20
-rw-r--r--gdb/tm-sun4os4.h24
-rw-r--r--gdb/tm-sunos.h33
-rwxr-xr-xgdb/tm-svr4.h21
-rw-r--r--gdb/tm-symmetry.h379
-rw-r--r--gdb/tm-tahoe.h325
-rw-r--r--gdb/tm-ultra3.h226
-rw-r--r--gdb/tm-umax.h395
-rw-r--r--gdb/tm-vax.h367
-rw-r--r--gdb/tm-vx68.h48
-rw-r--r--gdb/tm-vx960.h37
-rwxr-xr-xgdb/tm-vxworks68.h48
-rwxr-xr-xgdb/tm-vxworks960.h48
-rw-r--r--gdb/ultra3-xdep.c393
-rw-r--r--gdb/umax-xdep.c139
-rw-r--r--gdb/utils.c1269
-rw-r--r--gdb/valarith.c694
-rw-r--r--gdb/valops.c1498
-rw-r--r--gdb/valprint.c2053
-rw-r--r--gdb/value.h291
-rw-r--r--gdb/values.c1586
-rwxr-xr-xgdb/vax-opcode.h382
-rw-r--r--gdb/vax-pinsn.c240
-rw-r--r--gdb/vx-share/.Sanitize58
-rw-r--r--gdb/vx-share/dbgRpcLib.h28
-rw-r--r--gdb/vx-share/ptrace.h44
-rw-r--r--gdb/vx-share/reg.h209
-rw-r--r--gdb/vx-share/vxTypes.h70
-rw-r--r--gdb/vx-share/vxWorks.h177
-rw-r--r--gdb/vx-share/wait.h42
-rw-r--r--gdb/vx-share/xdr_ld.c82
-rw-r--r--gdb/vx-share/xdr_ld.h41
-rw-r--r--gdb/vx-share/xdr_ptrace.c171
-rw-r--r--gdb/vx-share/xdr_ptrace.h68
-rw-r--r--gdb/vx-share/xdr_rdb.c207
-rw-r--r--gdb/vx-share/xdr_rdb.h132
-rw-r--r--gdb/vx-share/xdr_regs.c216
-rw-r--r--gdb/vx-share/xdr_regs.h16
-rw-r--r--gdb/xcoffexec.c932
-rw-r--r--gdb/xcoffread.c1506
-rw-r--r--gdb/xm-3b1.h87
-rw-r--r--gdb/xm-altos.h208
-rw-r--r--gdb/xm-amix.h28
-rw-r--r--gdb/xm-arm.h88
-rw-r--r--gdb/xm-bigmips.h21
-rw-r--r--gdb/xm-convex.h51
-rw-r--r--gdb/xm-delta88.h57
-rw-r--r--gdb/xm-hp300bsd.h120
-rw-r--r--gdb/xm-hp300hpux.h173
-rw-r--r--gdb/xm-i386mach.h44
-rw-r--r--gdb/xm-i386sco.h39
-rw-r--r--gdb/xm-i386v.h101
-rw-r--r--gdb/xm-i386v32.h28
-rw-r--r--gdb/xm-irix3.h36
-rw-r--r--gdb/xm-isi.h95
-rw-r--r--gdb/xm-m68k.h22
-rw-r--r--gdb/xm-m88k.h66
-rw-r--r--gdb/xm-merlin.h120
-rw-r--r--gdb/xm-mips.h42
-rw-r--r--gdb/xm-news.h143
-rw-r--r--gdb/xm-news1000.h26
-rw-r--r--gdb/xm-np1.h99
-rw-r--r--gdb/xm-pn.h92
-rw-r--r--gdb/xm-pyr.h105
-rw-r--r--gdb/xm-rs6000.h67
-rw-r--r--gdb/xm-rtbsd.h46
-rw-r--r--gdb/xm-sparc.h60
-rw-r--r--gdb/xm-sun2.h96
-rw-r--r--gdb/xm-sun3.h93
-rw-r--r--gdb/xm-sun386.h41
-rw-r--r--gdb/xm-sun3os4.h28
-rw-r--r--gdb/xm-sun4os4.h28
-rwxr-xr-xgdb/xm-svr4.h56
-rw-r--r--gdb/xm-symmetry.h249
-rw-r--r--gdb/xm-tahoe.h129
-rw-r--r--gdb/xm-ultra3.h74
-rw-r--r--gdb/xm-umax.h64
-rw-r--r--gdb/xm-vax.h93
444 files changed, 0 insertions, 180988 deletions
diff --git a/gdb/.Sanitize b/gdb/.Sanitize
deleted file mode 100644
index c3c6345..0000000
--- a/gdb/.Sanitize
+++ /dev/null
@@ -1,281 +0,0 @@
-# .Sanitize for devo/gdb.
-# $Id$
-#
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-echo Sanitizing `pwd`...
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-.gdbinit
-gdb.1
-COPYING
-ChangeLog
-ChangeLog-3.x
-Convex.notes
-Makefile.in
-Projects
-README
-TODO
-WHATS.NEW
-alldeps.mak
-alloca.c
-altos-xdep.c
-am29k-opcode.h
-am29k-pinsn.c
-am29k-tdep.c
-ansidecl.h
-arm-convert.s
-arm-opcode.h
-arm-pinsn.c
-arm-tdep.c
-arm-xdep.c
-blockframe.c
-breakpoint.c
-breakpoint.h
-buildsym.c
-buildsym.h
-c-exp.y
-coffread.c
-command.c
-command.h
-configure.in
-convex-pinsn.c
-convex-tdep.c
-convex-xdep.c
-convx-opcode.h
-copying.awk
-copying.c
-core.c
-coredep.c
-cplus-dem.c
-createtags
-dbxread.c
-defs.h
-depend
-doc
-dwarfread.c
-elfread.c
-environ.c
-environ.h
-eval.c
-exec.c
-expprint.c
-expression.h
-findvar.c
-frame.h
-gdbcmd.h
-gdbcore.h
-getpagesize.h
-gmalloc.c
-gmalloc.h
-gould-pinsn.c
-gould-xdep.c
-hp300ux-xdep.c
-i386-pinsn.c
-i386-stub.c
-i386-tdep.c
-i386-xdep.c
-i387-tdep.c
-i960-pinsn.c
-i960-tdep.c
-ieee-float.c
-ieee-float.h
-infcmd.c
-inferior.h
-inflow.c
-infptrace.c
-infrun.c
-inftarg.c
-kdb-start.c
-language.c
-language.h
-m2-exp.y
-m68k-opcode.h
-m68k-pinsn.c
-m68k-stub.c
-m68k-tdep.c
-m88k-opcode.h
-m88k-pinsn.c
-m88k-tdep.c
-m88k-xdep.c
-mach386-xdep.c
-main.c
-mcheck.c
-mem-break.c
-minimon.h
-mips-opcode.h
-mips-pinsn.c
-mips-tdep.c
-mips-xdep.c
-mipsread.c
-mtrace.awk
-mtrace.c
-munch
-news-xdep.c
-nindy-share
-nindy-tdep.c
-np1-opcode.h
-ns32k-opcode.h
-ns32k-pinsn.c
-param-no-tm.h
-param.h
-parse.c
-parser-defs.h
-pn-opcode.h
-printcmd.c
-procfs.c
-putenv.c
-pyr-opcode.h
-pyr-pinsn.c
-pyr-tdep.c
-pyr-xdep.c
-regex.c
-regex.h
-rem-multi.shar
-remote-adapt.c
-remote-eb.c
-remote-mm.c
-remote-nindy.c
-remote-vx.c
-remote.c
-saber.suppress
-signals.h
-signame.c
-signame.h
-solib.c
-source.c
-sparc-opcode.h
-sparc-pinsn.c
-sparc-tdep.c
-sparc-xdep.c
-stack.c
-standalone.c
-stuff.c
-sun3-xdep.c
-sun386-xdep.c
-symfile.c
-symfile.h
-symm-tdep.c
-symm-xdep.c
-symmisc.c
-symtab.c
-symtab.h
-tahoe-opcode.h
-tahoe-pinsn.c
-target.c
-target.h
-tconfig
-terminal.h
-tm-29k.h
-tm-3b1.h
-tm-68k.h
-tm-m88k.h
-tm-altos.h
-tm-altosgas.h
-tm-amix.h
-tm-arm.h
-tm-bigmips.h
-tm-convex.h
-tm-hp300bsd.h
-tm-hp300hpux.h
-tm-i386v-g.h
-tm-i386v.h
-tm-i960.h
-tm-irix3.h
-tm-isi.h
-tm-merlin.h
-tm-mips.h
-tm-news.h
-tm-nindy960.h
-tm-np1.h
-tm-pn.h
-tm-pyr.h
-tm-sparc.h
-tm-sun2.h
-tm-sun2os4.h
-tm-sun3.h
-tm-sun386.h
-tm-sun3os4.h
-tm-sun4os4.h
-tm-sunos.h
-tm-svr4.h
-tm-symmetry.h
-tm-tahoe.h
-tm-ultra3.h
-tm-umax.h
-tm-vax.h
-tm-vx68.h
-tm-vx960.h
-ultra3-xdep.c
-umax-xdep.c
-utils.c
-valarith.c
-valops.c
-valprint.c
-value.h
-values.c
-vax-opcode.h
-vax-pinsn.c
-vx-share
-xconfig
-xm-3b1.h
-xm-m88k.h
-xm-altos.h
-xm-amix.h
-xm-arm.h
-xm-bigmips.h
-xm-convex.h
-xm-hp300bsd.h
-xm-hp300hpux.h
-xm-i386mach.h
-xm-i386sco.h
-xm-i386v.h
-xm-i386v32.h
-xm-irix3.h
-xm-isi.h
-xm-m68k.h
-xm-merlin.h
-xm-mips.h
-xm-news.h
-xm-news1000.h
-xm-np1.h
-xm-pn.h
-xm-pyr.h
-xm-rtbsd.h
-xm-sparc.h
-xm-sun2.h
-xm-sun3.h
-xm-sun386.h
-xm-sun3os4.h
-xm-sun4os4.h
-xm-svr4.h
-xm-symmetry.h
-xm-tahoe.h
-xm-ultra3.h
-xm-umax.h
-xm-vax.h
-
-Do-last:
-
-# End of file.
diff --git a/gdb/.gdbinit b/gdb/.gdbinit
deleted file mode 100644
index 3adc483..0000000
--- a/gdb/.gdbinit
+++ /dev/null
@@ -1,13 +0,0 @@
-echo Setting up the environment for debugging gdb.\n
-
-set complaints 1
-
-b fatal
-
-b info_command
-commands
- silent
- return
-end
-
-set prompt (top-gdb)
diff --git a/gdb/Attic/Makefile.in b/gdb/Attic/Makefile.in
deleted file mode 100755
index e69de29..0000000
--- a/gdb/Attic/Makefile.in
+++ /dev/null
diff --git a/gdb/COPYING b/gdb/COPYING
deleted file mode 100644
index a43ea21..0000000
--- a/gdb/COPYING
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
deleted file mode 100644
index 5395ac9..0000000
--- a/gdb/ChangeLog
+++ /dev/null
@@ -1,7659 +0,0 @@
-Mon Nov 18 17:45:18 1991 Fred Fish (fnf at cygnus.com)
-
- * m68k-tdep.c (m68k_skip_prologue): Add generic m68k support for
- skipping function prologues, ala the other cpu families (i386,
- mips, m88k, etc). Add the ability to skip movm and fmovm
- instructions in the prologues. Still needs support for profile
- (-p compiled) prologue sequences (FIXME).
-
- * tm-68k.h: Change SKIP_PROLOGUE macro to use the new generic
- m68k prologue skipping function by default.
-
- * tm-altos.h, tm-isi.h: Continue to use the old definition of
- SKIP_PROLOGUE.
-
-Mon Nov 18 15:12:45 1991 John Gilmore (gnu at cygnus.com)
-
- * blockframe.c: Remove tdesc-related code. Default
- FRAME_CHAIN_COMBINE if not defined.
- * infrun.c: Remove tdesc-related code.
- * m88k-tdep.c (frame_chain_combine, init_frame_pc): Remove copies
- of defaultable things.
- * tm-m88k.h: New file, common to all Moto 88k target configs.
- Derived from tm-delta88.h.
- * tm-delta88.h: Use it.
- * xm-m88k.h: Common file for 88K hosts. Remove obsolete stuff.
- * xm-delta88.h: Use it.
- * tm-*.h: Remove FRAME_CHAIN_COMBINE macros, since all are
- default.
- * coffread.c: Remove tdesc stuff.
- * tconfig/delta88, tconfig/m88k: Remove tdesc stuff.
- * xconfig/m88k: Rename tm-88k.h to tm-m88k.h.
-
-Mon Nov 18 13:51:37 1991 Per Bothner (bothner at cygnus.com)
-
- * source.c (open_source_file): If openp fails, try again
- using just the base (non-directory) part of the filename.
- This solves various annoying problems, such as when the
- source was compiled with an absolute pathname - and the
- source files have moved. Or if the source was compiled
- using a relative pathname, it can be more convenient
- to just specific the source directory to the dir command.
-
-Mon Nov 18 00:04:41 1991 Fred Fish (fnf at cygnus.com)
-
- * cplus-dem.c (munge_function_name): Add missing third arg to
- instance of call to do_type().
-
- * dwarfread.c: Changes to match new dwarf.h. Remove
- AT_deriv_list, AT_loclist, AT_incomplete, AT_const_data,
- and AT_is_external.
-
-Sun Nov 17 16:20:53 1991 Michael Tiemann (tiemann at rtl.cygnus.com)
-
- * symtab.h (struct type): Moved C++-specific fields into new type
- `struct cplus_struct_type'. Now takes 10% less memory. Many
- macros changed.
- * symtab.c (init_type): Don't set fields belonging to
- TYPE_CPLUS_SPECIFIC unless TYPE is TYPE_CODE_STRUCT.
- * buildsym.c (read_type): Allocate TYPE_CPLUS_SPECIFIC for
- TYPE_CODE_STRUCT.
- (read_struct_type): Ditto. Also, add comments about how we can
- deduce TYPE_VPTR_FIELDNO from inheritance info and fieldname info.
- * coffread.c (decode_base_type): Allocate TYPE_CPLUS_SPECIFIC for
- TYPE_CODE_STRUCT.
- (read_struct_type): Ditto.
- * dwarfread.c (struct_type): Ditto.
-
- * symtab.c (read_range_type): Don't set TYPE_MAIN_VARIANT.
- (lookup_pointer_type): Don't use or set TYPE_MAIN_VARIANT.
- (lookup_reference_type): Ditto.
-
- * cplus-dem.c: Many changes made to handle decoding of
- ANSI-mangled names.
- * symtab.c (gdb_mangle_name): Mangle/demangle ANSI-mangled names
- as well.
-
-Fri Nov 15 17:57:59 1991 Stu Grossman (grossman at cygnus.com)
-
- * mipsread.c (parse_partial_symbols): patch to keep DEC C
- compiler from making gdb bomb out. Thanks to Ed Santiago!
-
-Thu Nov 14 19:27:30 1991 Fred Fish (fnf at cygnus.com)
-
- * symfile.c: Add function compact_misc_function_vector() to
- remove duplicate misc function vector entries. See comments
- in source for why this is necessary/desirable.
-
- * dwarfread.c: Add misc function type parameter to internal
- record_misc_function(). Remove calls to init_misc_bunches()
- and condense_misc_bunches(), these are now done in elfread.c.
-
- * elfread.c: Add support for reading bfd canonical symbol tables
- and generating misc function vector entries for global and
- absolute symbols. Do calls to init_misc_bunches() and
- condense_misc_bunches() where they will enclose all calls to
- record_misc_function(), including those in dwarfread.c.
-
-Thu Nov 14 17:02:11 1991 Roland H. Pesch (pesch at cygnus.com)
-
- * doc/Makefile.in: new targets gdb.me, gdb.ms, gdb.mm
- (roffable documentation).
- * doc/gdb.texinfo: embedded hints (as comments) for better
- texi2roff conversion.
-
-Thu Nov 14 13:18:25 1991 John Gilmore (gnu at cygnus.com)
-
- * m88k-tdep.c (examine_prologue): Deal with OR instructions
- that shuffle parameters into other regs.
- * symtab.c (decode_line_1): Fix bug introduced in Per's change
- of Nov 12th.
-
-Wed Nov 13 19:51:11 1991 Steve Chamberlain (sac at cygnus.com)
-
- * Makefile.in, xconfig/delta88 made it install a sysV manual page;
- gdb.z into the right place.
-
-Wed Nov 13 16:45:13 1991 John Gilmore (gnu at cygnus.com)
-
- Motorola 88000 port without tears, I mean without tdescs.
-
- * m88k-tdep.c: Blow away all tdesc stuff.
- Provide functions for all the frame-related macros in
- tm-delta88.h. Adopt i960-style EXTRA_FRAME_INFO.
- (examine_prologue, frame_find_saved_regs, skip_prologue): borrow
- from i960-tdep.c and adapt to the function prologues on the 88k.
- (read_next_frame_reg): Borrow from mips-tdep.c.
- FIXME: frame_locals_address should go away.
-
- * tm-delta88.h: Dump all the tdesc stuff.
- Macros for all frame-related stuff call fns of same name.
- Remove duplicated definitions. FP_REGNUM becomes same as
- SP_REGNUM.
-
- * xm-88k.h: Eliminate lots of library dependencies, now handled
- in libiberty. Eliminate KDB nonsupport.
-
- * doc/gdbint.texinfo: Add rudiments on frames. FIXME, add more.
-
-
- * stack.c (frame_info): Mark frameless functions.
- Print locals address (FIXME, remove if same).
- * blockframe.c: Comment changes, FIXME after.
- * coffread.c: Even without TDESC, need to zap "@" symbols.
- Don't register for wierd format names; change the names in BFD.
-
- * alloca.c, language.c, tdesc.c: Lint.
- * tdesc.c, tdesc-lib: FIXME: remove these.
-
-Tue Nov 12 19:30:22 1991 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: Add tdesc library support. Fixups to lint,
- copying.c rules.
-
-Tue Nov 12 13:43:26 1991 Per Bothner (bothner at cygnus.com)
-
- * symtab.c (decode_line_1): Remove spurious call to operator_chars.
-
- Allow setting breakpoints on C++ destructors.
- * valops.c (destructor_name_p): Don't check TYPE_HAS_DESTRUCTOR,
- since it lies. Rely on callers to catch missing destructors.
- * symtab.c (decode_line_1): For example (see above), here.
- * buildsym.c, symtab.h: Remove TYPE_FLAGS_HAS{CON,DE}STRUCTOR
- flags since they are no longer used.
-
- Fixes to support C++ methods with functional parameters.
- * c-exp.y (func_mod rule): Allow (and ignore) list of parameter
- types in a function type.
- * eval.c (parse_and_eval_type), value.h: New function,
- parse_and_eval_type, is based on old code from check_stub_method.
- But don't actually evaluate the cast, since that calls
- value_cast(), whcih may fail. Just extract the type
- from the parsed expression.
- * values.c (check_stub_method): While looping through the
- arguments, adjust depth *after* parameter has been handled.
- Replace call and setup of parse_and_eval with new function
- parse_and_eval_type.
-
-Tue Nov 12 09:40:07 1991 Fred Fish (fnf at cygnus.com)
-
- * utils.c, rem-multi.shar: Remove fixed arg count version of
- concat().
-
- * altos-xdep.c, arm-xdep.c, coffread.c, command.c, convex-xdep.c,
- core.c, dwarfread.c, gould-xdep.c, infcmd.c, language.c,
- m88k-xdep.c, main.c, printcmd.c, pyr-xdep.c, source.c,
- sun386-xdep.c, symm-xdep.c, umax-xdep.c, values.c, xcoffread.c:
- Change all instances of use of fixed args concat() to variable
- args concat() now located in libiberty.
-
-Tue Nov 12 07:23:46 1991 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: Add xcoffread.c, xcoffexec.c.
- * xcoffread.c: New file for handling AIX mangled-coff files.
- * xconfig/rs6000, tconfig/rs6000: New files.
- * buildsym.c: Add hooks for xcoffread.c.
- * rs6000-pinsn.c, rs6000-tdep.c, rs6000-xdep.c, tm-rs6000.h,
- xm-rs6000.h, rs6k-opcode.def, rs6k-opcode.h: New files.
- * xcoffexec.c: New file for handling AIX shared libraries.
-
-Mon Nov 11 19:14:31 1991 Fred Fish (fnf at cygnus.com)
-
- * core.c: Minor rewording of message to user containing name of
- (and possibly arguments to) the program that generated a core
- file.
-
- * elfread.c: Remove the register_addr() stub now that it is no
- longer needed.
-
- * procfs.c: Move misplaced #endif for ATTACH_DETACH. Add new
- fetch_core_registers() function for core file support.
-
-Sat Nov 9 13:37:57 1991 Fred Fish (fnf at cygnus.com)
-
- * dwarfread.c (dwarf_psymtab_to_symtab): Remove leftover call
- to do_cleanups() which resulted from a previous change.
-
- * elfread.c: Re-enable compilation of register_addr() stub
- whenever it is not supplied by coredep.c
-
-Sat Nov 9 00:40:32 1991 John Gilmore (gnu at cygnus.com)
-
- Add tracking of object files (that contain symbols) to gdb.
- This includes a "struct objfile" that owns symtabs and psymtabs
- that were read in from that binary file.
-
- * symfile.h: Add struct objfile. Add pointer to the objfile
- into the struct sym_fns.
- Replace global `symfile' and `symfile_mtime' with
- `symfile_objfile'. Add global object_files chain.
-
- * symfile.c: Move param.h above symtab.h.
- (sort_misc_function_vector): Add.
- (syms_from_objfile): Was syms_from_bfd.
- (symfile_open): Now returns objfile.
- (allocate_objfile): New.
- (free_objfile): New, replacing free_all_.*symtabs.
- (symfile_init): Takes objfile arg, puts it in sym_fns result.
- (reread_symbols): Searches whole chain of objfiles.
- (allocate_symtab): Takes objfile as new parameter, chains them.
- Handle INIT_EXTRA_SYMTAB_INFO.
- (free_all_psymtabs, free_all_symtabs): Move here from symmisc.c.
-
- * dbxread.c: Make more errors into complaints.
- (push_subfile, pop_subfile): Move to buildsym.c.
- (dbx_symfile_read, dbx_symfile_init, fill_symbuf, read_dbx_symtab,
- start_psymtab, psymtab_to_symtab_1, read_ofile_symtab,
- dbx_psymtab_to_symtab, ): Use bfd ops, don't use file descriptor.
- Pass objfile. Change callers.
- (fill_symbuf, SWAP_SYMBOL): Take bfd as arg.
- (read_dbx_symtab): Just wipe out new symbols, not all, on error.
- (end_psymtab): Blow away psymtab if empty.
- (process_symbol_pair): Swallow into read_ofile_symtab.
- (process_one_symbol): Use push_context and pop_context.
- (virtual_context): Delete #if 0'd obsolete stuff.
-
- * buildsym.c (end_symtab): Pass objfile.
- (dbx_lookup_type): Handle null typevector.
- (dbx_alloc_type): Check file number, not sym number, for -1.
- (find_symbol_in_list): Add for xcoffread.
- (start_symtab): Default typevector is empty. Keep reusing same
- context_stack.
- (end_symtab): Take objfile argument and pass it to
- allocate_symtab. Don't make a symtab if no blocks or symbols.
- Handle empty typevector.
- (push_context): New function for context stack nesting.
- (read_type): Mark FIXME where we need to reintroduce type smashing.
-
- * buildsym.h (pop_context): Macro, paired with push_context.
- (subfile_stack): Move here from dbxread.c.
-
- * coffread.c (end_symtab, read_coff_symtab): Take and use objfile arg.
- (read_coff_symtab): Cleanup by freeing objfile, not all symtabs.
-
- * mipsread.c (read_mips_symtab, parse_partial_symbols, parse_fdr,
- new_psymtab, new_symtab): Take and use objfile arg.
-
- * dwarfread.c (scan_compilation_units, start_psymtab,
- process_dies, end_symtab, dwarf_build_psymtabs,
- read_lexical_block_scope, read_func_scope, read_file_scope): Take
- and use objfile argument.
- (psymtab_to_symtab_1, read_ofile_symtab): Don't take or use file
- descriptor. Use BFD internal functions instead.
- (end_symtab): Call global allocate_symtab.
-
- * elfread.c, target.c: Minor changes to accommodate objfiles.
- * symtab.h: partial_symbol_table has no symfile_name member now.
- (fn_fieldlists voffset): avoid non-int bitfield.
- (struct symtab): Add objfile * and objfile_chain * of symtabs.
- (struct partial_symtab): Add objfile * and objfile_chain * of
- psymtabs. Remove symfile_name.
-
- * symmisc.c: Lose free_all_symtabs, free_all_psymtabs.
- (printsyms_command): Rename from print_symtabs. Add selective
- listing if 2nd argument given. Print objfile info.
- (printpsyms_command): Rename from print_partial_symtabs. Ditto all.
- (printobjfiles_command): New; prints objfiles lists, and checks
- for consistency of symtab, psymtab, and objfile lists.
-
- * symfile.h, symfile.c, symtab.h: Lint
-
-Fri Nov 8 23:38:48 1991 John Gilmore (gnu at cygnus.com)
-
- * command.c: Include param.h.
- * defs.h (warning_setup, warning): Declare.
- * expprint.c (print_subexp, UNOP_MEMVAL case): Lint.
- * inflow.c (new_tty): Use USE_O_NOCTTY #define.
- * language.c, printcmd.c (print_scalar_formatted), signame.c,
- stack.c: lint.
-
-Thu Nov 7 18:26:15 1991 Steve Chamberlain (sac at rtl.cygnus.com)
-
- * Makefile.in: link with libiberty after libreadline, since
- readline might want something in libiberty.
- * m88k-xdep.c: Fixed the register offsets in the ptrace_user
- struct for BCS 88k machines.
- * xm-m88k.h: don't define USIZE if already defined.
- * configure.in: Added delta88 target.
-
-Thu Nov 7 04:51:19 1991 John Gilmore (gnu at cygnus.com)
-
- * am29k-pinsn.c, am29k-opcode.h: Fix decoding of mtacc, dmac, fmac.
-
- * tm-*.h: Remove READ_DBX_FORMAT, COFF_FORMAT, and
- READ_MIPS_FORMAT, which have been unused since BFD. Still
- remaining is COFF_NO_LONG_FILE_NAMES.
- * tm-sun3.h, tm-altos.h: Remove detritus accidentally left from
- function calling code moved to m68k-tdep.c.
-
-Wed Nov 6 17:21:59 1991 John Gilmore (gnu at cygnus.com)
-
- * coffread.c: Eliminate c_nsyms in favor of c_naux.
- Complain if no auxents on .bf and .ef FCN symbols, and assume
- lots of line numbers.
- (init_linenos, enter_linenos): Use a sentinel at the end of the
- read-in linenos, to make for a fast, safe loop-end test.
-
-Wed Nov 6 02:54:08 1991 Steve Chamberlain (sac at cygnus.com)
-
- * coffread.c (read_coff_symtab): coffread used to rely on the
- x_sym.x_misc.x_lnsz.x_lnno field giving the # of linnos in a
- function. Two of the formats I'm using (29k and 88k) don't seem to
- set it. Ths patch to fcn_last_line and (enter_linenos) is an
- attempt to use the actual size of the linno table in the file to set
- the number of linenos to process.
-
-Tue Nov 5 22:47:46 1991 Steve Chamberlain (sac at cygnus.com)
-
- * Makefile.in: put a - infront of the mv y.tab.c c-exp.tab.c and
- mv y.tab.c m2-exp.tab.c, so that if bison is used, and the files
- are created in place, so the mv fails, then the make continues.
-
-Tue Nov 5 16:47:47 1991 Per Bothner (bothner at cygnus.com)
-
- Add C++ as a separate language.
- * defs.h (enum language): Add language_cplus.
- * dwarfread.c (end_symtab): Support language_cplus.
- * c-exp.y: Add new struct language_defn cplus_language_defn.
- Don't set c to be the default language (see main.c).
- * c-exp.y (yylex): Only look for field of this if
- language is C++. (First difference from C!)
- * language.c: Add case branches for C++ (currently, all
- the same as C). Also, add c++ to "usage" note for "set lang".
- * valprint.c (typedef_print). Add case branches for C++.
- * main.c (main): New way to set initial language: Look at
- file extension of psymtab containing main(). (Same as we
- do for symtabs, but avoid loading the symtab yet.)
- * symtab.c: New routine find_main_psymtab(), used by main()
- to set initial language.
- * symfile.c (allocate_symtab): Move code for mapping file
- extensions-> languages to new deduce_language_from_filename().
-
- Fix a C++ problem when looking for methods in super-classes.
- There was confusion between base and derived types.
- * valops.c (value_fn_field): Change function interface.
- * values.c: Use new value_fn_field interface.
-
-Mon Nov 4 10:49:33 1991 Per Bothner (bothner at cygnus.com)
-
- * infrun.c: Fixed typo in comment.
- * utils.c: All the v*fprintf emulation is now in libiberty,
- so we can get rid of some junk.
- * xm-sun3os4.h, xm-sun4os4.h, xconfig/decstation, xconfig/i386sco,
- xconfig/sun3os4, xconfig/sun4os4: Don`t need HAVE_STRSTR any more.
- * m68k-pinsn.c (print_insn_arg): Support BB/BW/BL
- type operands, as used by branch instructions.
- * gmalloc.c: Fix prototype of memcpy.
- * elfread.c: Comment out register_addr, since it conflicts
- with the one in coredep.c.
- * buildsym.h: Remove extern declarations of two functions
- that are really static in buildsym.c.
- * tm-mips.h: Add symbolic names for more registers.
- * mips-xdep.c (store_inferior_registers): Use new register names.
- * xm-mips.h: Simplify REGISTER_U_ADDR, since it is now
- only used for core files, not ptrace. Therefore,
- the KERNEL_U_ADDR hack is no longer needed.
- The mapping to ptrace number is now in in mips-xdep.c.
- * mips-xdep.c: Define REGISTER_PTRACE_ADDR (using the
- mapping from the old REGISTER_U_ADDR), and use it
- in {fetch,store}_inferior_registers.
- * mipsread.c: Rename #include ecoff.h to new name coff-mips.h.
- * mips-tdep.c (mips_push_dummy_frame, mips_pop_frame):
- Save/restore FP regs correctly (?).
- * dbxread.c: Remove duplicate define_symbol and type_synonym_name
- (these had been previously moved to buildsym.c).
- Hence, define_symbol becomes extern instead of static.
- * buildsym.c (read_struct_type): Comment out bogus handling
- of C++ operator methods. Minor hacking of reading of class
- contexts. Make define_symbol non-static, so dbxread.c can call it.
-
-Fri Nov 1 11:05:47 1991 John Gilmore (gnu at cygnus.com)
-
- * mipsread.c (read_mips_symtab, read_the_mips_symtab): Use real
- filename with error messages.
- * stack.c (frame_select_command): Rename to select_frame_command
- to avoid "fr" and "fra" having nonunique completions.
- * symfile.c (sort_symtab_syms): Ignore sort of zero symtab *.
- (symfile_init): Print file format name when unable to handle it.
- (free_named_symtabs): Use BLOCKVECTOR rather than obsolete BLOCKLIST.
- * symmisc.c (free_symtab): Only free linetable if nonzero.
- * symtab.h: Remove obsolete BLOCKLIST macros.
-
-Thu Oct 31 18:12:43 1991 Stu Grossman (grossman at cygnus.com)
-
- * infrun.c (wait_for_inferior): another stepi/nexti fix. Ensure
- that stop_step is 1 at bottom of main loop. I don't know why this
- needs to be done, but it helps me sleep better at night.
-
-Sun Oct 27 18:18:39 1991 Stu Grossman (grossman at cygnus.com)
-
- * main.c (initialize_history): Read history after reading all
- init files.
-
-Sun Oct 27 14:09:25 1991 John Gilmore (gnu at cygnus.com)
-
- * buildsym.c: Break out initial malloc sizes.
- (record_line): Record directly in a subfile. Alloc on demand.
- (compare_line_numbers): Add from xcoffread.c.
- (end_symtab): New params say whether to sort pendings and
- linetable. Patch block stabs if defined. Shrink linetable before
- allocating the symtab.
- * buildsym.h: Delete line_vector* and prev_line_number. Add
- global_stabs and file_stabs for xcoffread.
- * dbxread.c (start_subfile): Move to buildsym. Change above calls.
- * symtab.h: LINETABLE(symtab) can now be null. Zap LINELIST.
- * symmisc.c, symtab.c: Cope with null LINETABLEs.
-
- * blockframe.c: Pass fromleaf to INIT_EXTRA_FRAME_INFO.
- * tm-29k.h, tm-88k.h, tm-i960.h, tm-irix3.h, tm-mips.h, tm-pyr.h,
- tm-sparc.h: Accept fromleaf parameter.
- * c-exp.y (yyerror): Pass error message if given.
- * configure.in: Add rs6000 host and target.
- * inflow.c (new_tty): O_NOCTTY kludge for RS/6000.
- * symfile.h (entry_point): Add.
-
-Sat Oct 26 00:16:32 1991 John Gilmore (gnu at cygus.com)
-
- * buildsym.c: New file. Breaks out symbol-table-building routines
- from dbxread.c, so they can be shared with xcoffread.c.
- * buildsym.h: New file. Declarations for buildsym.c users.
- * dbxread.c: Remove large chunks into buildsym.c.
- * Makefile.in: Add buildsym.c and buildsym.h.
-
- * symfile.c (syms_from_bfd): New routine.
- (add_symbol_file): Call it to do the real work.
- (syms_from_bfd): Initialize entry_point before calling symfile_init.
- * symtab.h, symfile.c, coffread.c, mipsread.c, dwarfread.c:
- Avoid declaring or setting entry_point (symfile.h & symfile.c cope).
-
-Fri Oct 25 10:58:16 1991 Mark Eichin (eichin at cygnus.com)
-
- * cplus-dem.c (cplus-demangle): added support for templates, static
- data, and the new (correct) mangling for destructors.
-
- * dwarfread.c: (dwarfwarn): created a varargs version of
- dwarfwarn, for non __STDC__ compilers.
-
- * c-exp.y: (yylex): added match for "template" token.
- (typebase): added TEMPLATE name '<' type '>' clause, for explicit
- specification of template types.
-
- * symtab.c: (lookup_template_type): new function for finding
- templates in symbol table.
- (type_name_no_tag): changed to explicitly check for s/u/e at the
- beginning of the symbol - if it is a template, none of these will
- be there (but the name will still contain spaces.)
-
-Fri Oct 25 18:59:32 1991 Per Bothner (bothner at cygnus.com)
-
- Various fixes to improve g++ debugging.
- * symtab.h: Add is_const and is_volatile flags for each method.
- These are bit fields - take their space from voffset,
- which shrinks to 30 bits. Since voffset is now a bitfield,
- make it unsigned for portability. This changes its interpretation
- slightly: Static methods now have voffset 1 instead of -1,
- and virtual offsets start at 2, not 1.
- * symtab.c: Renamed gdb_mangle_typename to gdb_mangle_name,
- since it now returns an entire magled method name, not just
- the type part. This avoids some duplication.
- It also allows us to correctly mangle const and volatile
- methods (using the new is_const and is_volatile bit fields
- mentioned above).
- * valprint.c (type_print_base), values.c (check_stub_method):
- Simplify by using new gdb_mangle_name.
- * values.c (value_headof): Fix to correctly handle single
- inheritance (actually two fixes, either of which suffices).
- * dbxread.c (read_struct_type): Handle const and volatile
- method specifiers.
- * dbxread.c (read_struct_type): Yet one more place where
- we must handle '\\' continuations.
- * valprint.c (vtbl_ptr_name): Add final '\0'.
-
-Fri Oct 25 16:06:38 1991 Stu Grossman (grossman at cygnus.com)
-
- * tm-sparc.h, tm-68k.h (EXTRACT_RETURN_VALUE): fix output of
- short return values for sparc and 68k. Patch from Paul Eggert.
-
- * coffread.c, coredep.c, i386-xdep.c: install patches for
- SysV/386 3.2 from Mauro DePalma.
-
-Fri Oct 25 02:02:13 1991 John Gilmore (gnu at cygnus.com)
-
- * core.c (core_file_info), exec.c (exec_file_info): Print file
- type. Use printf_filtered.
-
- * valops.c (value_fetch_lazy): Avoid 0-length fetches.
-
-Thu Oct 24 23:06:40 1991 Fred Fish (fnf at cygnus.com)
-
- * dwarfread.c: Add casts to remove compiler warnings.
-
- * tm-3b1.h, tm-68k.h, tm-altos.h, tm-amix.h, tm-hp300bsd.h,
- tm-hp300hpux.h, tm-isi.h, tm-news.h, tm-pn.h, tm-sun2.h,
- tm-sun3.h: Remove locally duplicated code for calling functions
- in the inferior. The only differences were in the specific trap
- vectors used and whether or not an fpu was present. These are
- now handled by appropriate definitions of BPT_VECTOR and
- HAVE_68881 respectively. Other minor obvious cleanups.
-
- * valops.c: Correct a minor misspelling.
-
- * utils.c: Remove local BSD/USG hacks that are now in libiberty.
-
- * dwarfread.c: Remove prototype for dwarfwarn. Does not work
- with <varargs.h>.
-
-Thu Oct 24 09:33:44 1991 John Gilmore (gnu at cygnus.com)
-
- * stack.c (frame_command): Always print. Use new
- frame_select_command to select a frame without printing.
-
- * dwarfread.c: Use <varargs.h>, since <stdarg.h> is not portable.
-
-Thu Oct 24 01:32:51 1991 Fred Fish (fnf at cygnus.com)
-
- * dwarfread.c: New file for DWARF debugging format support.
-
- * elfread.c: New file for ELF object file format support.
-
- * procfs.c: New file for SVR4 /proc (process file system) support.
-
- * tm-amix.h, xm-amix.h, tconfig/amix, xconfig/amix: New files for
- Amiga UNIX support.
-
- * xm-svr4.h, tm-svr4.h: New files for SVR4 support.
-
- * xm-m68k.h: New file for host machines with m68k cpu.
-
- * Makefile.in: Add elfread.c and dwarfread.c to SFILES_MAINDIR.
- Add elfread.o and dwarfread.o to OBS.
-
- * symfile.h: Add "elf" to list of supported formats in comment.
-
- * c-exp.y, defs.h, symtab.h, valprint.c: Add three new builtin
- types to gdb, builtin_type_long_double, builtin_type_complex, and
- builtin_type_double_complex. Add and use new TARGET_SHORT_BIT,
- TARGET_INT_BIT, TARGET_LONG_BIT, TARGET_FLOAT_BIT,
- TARGET_DOUBLE_BIT, TARGET_LONG_DOUBLE_BIT, TARGET_COMPLEX_BIT, and
- TARGET_DOUBLE_COMPLEX_BIT, as the sizes in bits of the indicated
- types on the target machine (ala the existing TARGET_LONG_LONG_BIT).
-
- * infrun.c: When using SVR4 /proc interface instead of ptrace(),
- call proc_set_exec_trap() to setup child to stop at first instruction.
-
- * inftarg.c: When using SVR4 /proc interface, call proc_wait()
- rather than wait().
-
- * m68k-tdep.c: Add new routines supply_gregset(), fill_gregset(),
- supply_fpregset(), and fill_fpregset(), which are machine
- dependent support routines for SVR4 /proc interface.
-
- * utils.c: Add warning_setup() and warning(). Warning() behaves
- the same as error() except that it returns normally rather than
- jumping back to command level. Modules that don't want to call
- warning() for some reason, but want to produce their own warnings,
- can call warning_setup() to ensure compatibility with the way
- warning() and error() deal with the terminal.
-
- * symtab.c: Make internal errors produce more useful messages.
-
- * tm-68k.h: Move code that is duplicated in almost every single
- m68k based machine's configuration files to this common file.
- Duplications in the configuration files still need to be removed
- (FIXME).
-
- * infrun.c (child_create_inferior): System V versions must call
- setpgrp() with no arguments, to comply with prototyping typically
- in <unistd.h>.
-
- * munch: Add support for SVR4 style nm output.
-
- * dbxread.c, mipsread.c symmisc.c, symtab.c: Remove the object
- file specific fields from the partial symbol table structure and
- replace them with a pointer to private data for each different
- flavor of object file reader to initialize appropriately.
-
-Wed Oct 23 09:38:20 1991 John Gilmore (gnu at cygnus.com)
-
- * xconfig/sun[34]os4: Add note about strstr botch on sunos4.0.3c
- and previous.
-
- * mipsread.c (fixup_undef_type): New function. If a struct /
- union / enum is defined in a header file but nowhere else used,
- (by typedefing, pointer referencing or declaration) the mipsread code
- builds the complete tree for the structure but leaves its code as
- TYPE_CODE_UNDEF as it doesn't know what kind of aggregate it is.
- Guess its type based on the details of the members.
-
-Tue Oct 22 18:04:32 1991 Stu Grossman (grossman at cygnus.com)
-
- * infrun.c (wait_for_inferior): Check return value from
- find_pc_line.
-
-Mon Oct 21 17:47:03 1991 Stu Grossman (grossman at cygnus.com)
-
- * infrun.c (wait_for_inferior): fix stepi/nexti that was broken
- by my last edit to this routine.
-
-Mon Oct 21 14:27:43 1991 John Gilmore (gnu at cygnus.com)
-
- * tm-sun3.h (FIX_CALL_DUMMY): problem with cross debugging.
- FIX_CALL_DUMMY does unaligned accesses and/or forgets to byte swap
- the values before putting them into the dummy code. (From Peter
- Schauer)
-
-Mon Oct 21 10:04:39 1991 Steve Chamberlain (steve at rtl.cygnus.com)
-
- * configure.in: added ebmon target.
-
-Wed Oct 16 22:49:58 1991 John Gilmore (gnu at cygnus.com)
-
- GDB-4.2 release!
-
- * Makefile.in: Roll VERSION to 4.2.
- * README, TODO, WHATS.NEW: Update.
-
- * core.c (core_open): Improve error message for bad file.
- Pass .reg virtual memory address to fetch_core_registers to help
- it find the registers in the core-file header.
- * coredep.c (fetch_core_registers): Take new argument, use it,
- and pass it to register_addr to locate the block of registers.
- * xm-mips.h: Update KERNEL_U_ADDR for new scheme. Cleanup a bit.
-
- * dbxread.c (read_dbx_symtab, process_one_symbol): Handle
- Sequent N_FN_SEQ like everybody else's N_FN.
-
- * main.c: Circumvent SCO cc bug with #if !!defined(USG).
- * tm-i386v.h: #endif guck.
- * xconfig/i386*: Remove -Dgetpagesize()=4096 kludge.
- * xconfig/i386sco: Add HAVE_STRSTR to avoid ANSI bdeath.
- * xconfig/tahoe: Add REGEX, which seems to be missing.
-
- * coredep.c: Add <sys/types.h> for SCOnix.
- * dbxread.c (read_dbx_symntab): Avoid coredump on malformed file.
- * printcmd.c (print_formatted): Flush output before disassembly.
-
-Tue Oct 15 20:12:32 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
-
- * doc/refcard.tex (sec "Working Files"): consistent metavars and
- other improvements, due to comments by François Pinard
- (pinard@iro.umontreal.ca)
-
- * doc/gdb.texinfo (appendix "Installing GDB"): changes in
- configure, and improvenets related to Pinard's refcard comments
-
-Tue Oct 15 08:45:12 1991 John Gilmore (gnu at cygnus.com)
-
- Changes from Fred Fish:
- * tm-68k.h (FPI_REGNUM): Add.
- * infrun.c (child_create_inferior): flush stdout and stderr
- before forking.
- * configure.in: Handle amigados, amix hosts and targets.
- * inflow.c: Handle TIOCGLTC_BROKEN for Amiga.
-
- From Andreas Schwab:
- * values.c (show_convenience): Use printf_filtered.
- * main.c (define_command): Check result of lookup_command for
- exact match.
- (echo_command): Use printf_filtered, and force output out.
-
- * dbxread.c (read_enum_type): Avoid Modula-2 kludge that breaks C
- programs.
- * i387-tdep.c (double_to_i387): Fix typo for double_to_ieee_extended.
- * utils.c (_initialize_utils): If !ISATTY, don't paginate.
- * configure.in, tconfig/decstation, xconfig/decstation: Rename
- dec3100 to decstation.
-
-Mon Oct 14 13:37:50 1991 Roland H. Pesch (pesch at cygnus.com)
-
- * doc/gdb.texinfo: Catch up to changes recorded here in ChangeLog
- (nodes Continuing and Stepping; Memory; Targets) clarifications
- due to Larry Breed
-
-Fri Oct 11 23:27:06 1991 John Gilmore (gnu at cygnus.com)
-
- * tm-{irix3,mips,nindy960,pn,symmetry,vx960}.h: Move
- REGISTER_U_ADDR to corresponding xm- file. Sugg. by Peter Schauer.
-
- * symmisc.c (print_partial_symtabs): Add printpsyms debug cmd.
-
- * m68k-tdep.c (m68k_push_dummy_frame, m68k_pop_frame): Add
- generic routines for calling inferior functions.
-
- * blockframe.c (inside_main_scope, inside_entry_scope): New.
-
- * copying.awk: Filter formfeeds out of copying & warrantee.
- Make them available as `show copying' and `show warrantee' also.
- * main.c (print_gnu_advertisement): Advt `show' commands.
-
-Thu Oct 10 17:25:47 1991 John Gilmore (gnu at cygnus.com)
-
- * mach386-xdep.c: Even when cross-compiling, leave in the
- core-file reading code.
- * core.c (get_core_registers): Avoid coredump if no .reg section.
-
-Wed Oct 9 17:03:34 1991 John Gilmore (gnu at cygnus.com)
-
- * mipsread.c, coffread.c: initialise TYPE_VPTR_FIELDNO to -1.
- This avoids coredumps under `set print object on' in value_headof
- (called erroneously by value_from_vtable_info) for `p &struct'
- or `p *struct'. From Peter Schauer.
-
-Mon Oct 7 00:06:52 1991 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: Roll version to 4.1.2.
- * dbxread.c: Use aout64.h, not a.out.gnu.h. Get external symbol entry
- size from BFD (but, FIXME, we don't yet read external nlists's and
- convert them to internal nlists's before handling them -- we still
- assume they have the same size and alignment.) Use SET_NAMESTRING
- everywhere useful.
- * exec.c (exec_file_command): Move dead coff-encapsulation code
- to BFD.
- * m88k-tdep.c, m88k-xdep.c: Remove encap test and #inc <a.out.h>.
-
-Fri Oct 4 22:30:06 1991 John Gilmore (gnu at cygnus.com)
-
- * configure.in, tm-i386v.h, xm-i386v.h: Intel 386 Mach host port.
- * xm-i386mach.h, mach386-xdep.c, xconfig/i386mach: New files.
-
-Fri Oct 4 17:04:31 1991 Per Bothner (bothner at cygnus.com)
-
- More patches from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
- * mips-xdep.c (store_inferior_registers): Don't try to
- write the (pseudo) FP.
- * mipsread.c (parse_partial_symbols): Improved algorithm for
- setting pst->texthigh.
-
-Fri Oct 4 16:47:32 1991 Roland H. Pesch (pesch at cygnus.com)
-
- * doc/Makefile: make TEXINPUTS include . everywhere
-
-Fri Oct 4 00:35:56 1991 John Gilmore (gnu at cygnus.com)
-
- * coffread.c, dbxread.c, symfile.c, symmisc.c, symtab.h: Remove
- vestiges of typevectors, which were for symsegs and are no longer
- used. (From a question by Eliot Dresselhaus
- <dresselh@RFT30.nas.nasa.gov>).
-
-Thu Oct 3 09:33:26 1991 John Gilmore (gnu at cygnus.com)
-
- * dbxread.c, coffread.c: static-ize functions that were
- gratuitiously external. (From Fred Fish.)
-
- * c-exp.y: sym->class to SYMBOL_CLASS (sym).
-
- * dbxread.c (dbx_lookup_type): Keep doubling size of typevector
- until it is large enough.
-
- * dbxread.c (read_type): Handle error case slightly better.
- Make complaint message not C++-specific.
-
-Wed Oct 2 17:21:07 1991 Stu Grossman (grossman at cygnus.com)
-
- * infrun.c (wait_for_inferior): Fix step/next so that you only
- stop at the beginning of a new line. This fixes various problems
- with for loops, nested if-else's and switch statements.
-
-Tue Oct 1 06:33:55 1991 John Gilmore (gnu at cygnus.com)
-
- * symtab.c (lookup_symtab_1, lookup_symbol): "fatal" errors
- between symtabs and psymtabs become ordinary error()s.
-
- * dbxread.c (read_dbx_symtab): Relocate end_of_text_addr
- properly, making "end pc" correct in shared lib psymtabs.
- (From Guy Harris <guy@auspex.com>.)
-
-Mon Sep 30 13:15:31 1991 John Gilmore (gnu at cygnus.com)
-
- * dbxread.c: Enable, but soften, const_vol_complaint.
- (read_dbx_symtab): N_STSYM and N_LCSYM define static vars.
- Ditto Gould N_NBSTS and N_NBLCS. Also, all types in the psymtab
- should be file-scope, not global.
- (read_struct_type): Remove ancient multiple-inheritance warning.
- (read_range_type): Check base type, complain & patch if undefined.
- * stack.c (frame_info): Demangle the function name in `info stack'.
- (From Peter Schauer)
-
-Sat Sep 28 10:02:33 1991 John Gilmore (gnu at cygnus.com)
-
- * eval.c (evaluate_subexp_for_address): Don't use
- TYPE_POINTER_TYPE directly (it might be zero if this type has
- never had a pointer created before); use lookup_pointer_type.
- * symtab.c (lookup_method_type): Arguments were swapped in all
- callers, so fix it here. I'm amazed this worked at all!
-
-Fri Sep 27 18:09:31 1991 John Gilmore (gnu at cygnus.com)
-
- * c-exp.y, m2-exp.y: Define more yysymbols that happen to be
- "bss" rather than "data" symbols, but which still conflict.
- * m2-exp.y: Lint.
-
- * coffread.c (coff_symfile_read): Use xmalloc, not malloc.
- * core.c (core_files_info): Shorten output.
- * exec.c (exec_files_info): Ditto.
- (build_section_table): Ignore zero-length sections.
- * language.c, printcmd.c: Lint.
- * language.h (get_frame_language): Declare.
- * saber.suppress: update.
- * stack.c (find_relative_frame): Remove complex code that was
- #if 0'd, stick with simple code. Lint.
- * saber.suppress: Update a bit.
- * symfile.c (add_symbol_file_command): Add "?" to question.
- * utils.c (parse_escape): Avoid \a due to bdead compilers.
- * value.h: Declare typedef_print.
-
- * valprint.c (val_print, type_print_base): TYPE_CODE_RANGE less
- kludgey.
-
- * nindy-tdep.c (nindy_frame_chain_valid): Use lookup_misc_func.
- (Reported by Mark Peek <mark@imagen.com>.)
-
- * solib.c (solib_map_sections): Relocate all sections, even
- though only the text section's size is tracked. Mark ld_text
- for eventual elimination as we generalize to N sections.
-
- * infrun.c (wait_for_inferior): Don't check if the PC is in a
- call_dummy if we were stopped by a random signal that is being
- passed to the program. This produced wierd results when calling
- functions in the inferior and signals (e.g. SIGALRM) were in use.
-
-Tue Sep 24 18:05:30 1991 John Gilmore (gnu at cygnus.com)
-
- * infrun.c (IN_SIGTRAMP): Not parenthesized properly.
- Bugfix from Paul Eggert <eggert@twinsun.com>.
- * tm-ultra3.h (IN_SIGTRAMP): Ditto.
- * valprint.c (print_floating): Print 9 digits for IEEE floats.
- From Paul Eggert.
-
-Mon Sep 23 15:50:07 1991 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: Roll VERSION to 4.1.1.
- * source.c (line_info): Peter Schauer fixes a bug I introduced in
- hex conversion.
-
-Fri Sep 20 16:10:52 1991 John Gilmore (gnu at cygnus.com)
-
- GDB-4.1 release!
-
- * Makefile.in (VERSION): Set to 4.1.
- * language.c (set_language_command): Print useful help message,
- and restore the language string after giving help.
- * valprint.c (typedef_print): Print typedef in C or M2.
- * symtab.c (list_symbols): Use it.
- * main.c (main): Avoid any output before (gdb) prompt when -q.
- * language.c (set_language_command): Handle errors by restoring
- the language string to its current state (fix from A. Beers).
- * doc/gdbint.texinfo: Roll in information from README. Rearrange
- "how to install" and "how to print the doc" stuff so it drops
- easier into README.
- * configure.in: Rename rtpc CPU to romp to match config.sub.
- * README, WHATS.NEW, TODO: Update for gdb-4.1.
-
-Fri Sep 20 17:39:14 1991 Roland H. Pesch (pesch at cygnus.com)
-
- * doc/gdb.texinfo: Updates from ChangeLog. set/show write,
- autoloading shared libs, copyright etc on GDB startup, clean up $_
- and $__ index refs, set/show listsize and related updates to list
- cmd. New host/target configs.
-
-Fri Sep 20 15:46:00 1991 Roland H. Pesch (pesch at cygnus.com)
-
- * doc/Makefile: generate aux version-no file doc/gdbVN.m4
- from main Makefile.in version definition
- doc/gdb.texinfo: use version recorded in doc/gdbVN.m4 for current
- GDB version no refs
- Makefile.in (setup-to-dist): generate doc/gdbVN.m4
-
- * doc/gdb.texinfo: merge new language-switching and lang-specific
- doc by Andrew Beers
-
-Fri Sep 20 15:00:57 1991 Per Bothner (bothner at cygnus.com)
-
- * mcheck.c: Add __ONEFILE kludge to allow compilation by non-ANSI
- compilers (which may lack stddef.h).
-
-Fri Sep 20 13:29:42 1991 John Gilmore (gnu at cygnus.com)
-
- * dbxread.c (read_dbx_symtab, process_one_symbol): N_FN and
- N_WARNING are the same except for the N_EXT bit, so just use their
- values alone, rather than OR-ing them with N_EXT.
-
-Fri Sep 20 12:27:55 1991 Stu Grossman (grossman at cygnus.com)
-
- * mipsread.c (parse_lines): Deal with negative extended line
- offsets correctly.
-
- * c-exp.y, m2-exp.y: #define yyerrflag and yynerrs to avoid
- global symbol conflicts.
-
-Fri Sep 20 02:28:15 1991 John Gilmore (gnu at cygnus.com)
-
- * .gdbinit: Move 'set complaints' to top, so it runs even in
- case we aren't debugging GDB.
- * language.c (_initialize_language): Fix type check and range
- check documentation strings.
- * utils.c (!HAVE_VPRINTF): Define vfprintf as a function, so
- language.c can use it. (Though language.c should really not be
- handling warnings/errors the way it does, FIXME.)
- * symtab.c (lookup_primitive_type): const lint.
-
- Bugfix from Peter Schauer:
- * source.c (lines_to_list): Make signed, to avoid comparison
- going unsigned and complaining that -3 is too high for 21 lines.
- * stack.c (lines_to_list): Ditto.
-
-Thu Sep 19 23:33:41 1991 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in (HFILES): Add minimon.h.
- (VERSION): Roll version number to 4.0.95.
- (gdb.tar.Z, make-proto-gdb.dir, setup-to-dist, gdb-XXX.tar.Z):
- New rules for building distributions. Normal distribution
- is built by doing `make -f Makefile.in gdb.tar.Z' in the directory
- one level up from here; it calls make-proto-gdb.dir to build a
- directory `proto-gdb' which is an image of the release. The old
- `gdb.tar.Z' rule still works too.
- * config.sub, configure: Roll in latest from ..
-
-Thu Sep 19 17:41:24 1991 Roland H. Pesch (pesch at cygnus.com)
-
- * doc/gdbint.texinfo: Reorder contents; reorganize new-host,
- new-target, and new-config chapters; fix minor typos; come closer
- to usual GNU markup conventions for @file @samp @code @var.
-
-Thu Sep 19 17:04:12 1991 Per Bothner (bothner at cygnus.com)
-
- Patches from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
- * mipsread.c (parse_partial_symbols): Enter the name of all
- structs/unions... into the psymtab so we can access them if the
- symtab is not read in.
- * mips-tdep.c: Remove some unneeded #includes.
- * xconfig/dec3100: Add HAVE_STRSTR.
-
-Thu Sep 19 15:14:23 1991 John Gilmore (gnu at cygnus.com)
-
- * Makefile.in: Circumvent Sun Make bug on *-exp.tab.o.
- * c-exp.y, m2-exp.y: Lint.
- * m2-exp.y: Avoid using yytname[] which is a Bison-ism.
- * valprint.c (val_print_fields): Check for stub type.
- * mipsread.c (_initialize_mipsread): Avoid using
- builtin_type_void at initialize time.
- (mipscoff_symfile_read): use it now.
-
-Wed Sep 18 15:55:51 1991 John Gilmore (gnu at cygnus.com)
-
- Merge multiple-language support, and partial Modula-2 support,
- from Andrew Beers <beers@cs.buffalo.edu>.
-
- * i387-tdep.c: New file, consolidates most 80387 support,
- and eliminates host dependency on double<->extended conversions.
- * i386-xdep.c, symm-xdep.c: Remove most 387 support.
- * xconfig/i386{sco,v,v-g,v32,v32-g}: Now need i387-tdep.o.
-
- * symfile.c (allocate_symtab): New fn, consolidates the work
- of allocating and initializing a new struct symtab. Set the
- language of the symtab based on its filename extension.
- * symfile.h: Declare it.
- * mipsread.c (new_symtab): Use it. Minor formatting changes.
- * dbxread.c (end_symtab): Use it.
-
- * mipsread.c (parse_symbol, case stParam and stProc): Add #if 0'd
- code for saving types of parameters with each function definition.
- * dbxread.c (define_symbol, function and parameter cases): Ditto.
- (read_dbx_symtab, case N_DEFD): Ignore.
- (read_enum_type): Recognize FALSE/TRUE enum as Modula-2 BOOLEAN.
- (read_range_type): Rename MAX_OF_TYPE to MAX_OF_C_TYPE, etc.
- #if 0 out its uses, though, since they set a dead value.
- * coffread.c (end_symtab): Use allocate_symtab.
- (process_coff_symbol): #if 0'd for functions and params as above.
- (read_enum_type): Recognize Modula-2 BOOLEAN.
- * symtab.c (add_param_to_type): #if 0'd function to add a
- parameter type to a function type's field list.
-
- * defs.h (local_hex_format, local_hex_string, *_custom): Add.
- * i386-xdep.c, pyr-tdep.c, pyr-xdep.c, remote-vx.c, solib.c,
- source.c, symfile.c, dbxread.c, breakpoint.c, core.c, exec.c,
- i387-tdep.c, infcmd.c, mips-tdep.c, stack.c, printcmd.c: Output
- hex with local_hex_string for Modula-2 support.
-
- * breakpoint.c (breakpoint_cond_eval): Use new value_true to test
- breakpoint condition language-independently.
-
- * parse.c: New file with the common code remains of expread.y.
- * parser-defs.h: New file with common declarations from expread.y.
- * c-exp.y: New file with the C parser from expread.y, and other
- language-specific information.
- * m2-exp.y: New file with the Modula-2 parser and etc.
- * expread.y, expread.tab.c: Remove.
- * breakpoint.c, eval.c, printcmd.c, expression.h: Use
- parse_expression and parse_exp_1 rather than parse_c_expression
- and parse_c_1.
-
- * symtab.h (enum languages): Move to defs.h.
- (enum type_code): Add TYPE_CODE_CHAR and TYPE_CODE_BOOL.
- Declare Modula-2 builtin types.
- Add MAX_OF_TYPE and MIN_OF_TYPE macros.
-
- * symtab.c (_initialize_symtab): Remove builtin type
- definition and initialization to *-exp.y.
- (lookup_primitive_typename): Use language-dependent vector.
- (lookup_typename): Fix bug, make it work if primitive typename.
- (lookup_unsigned_typename): Call above.
- (create_array_type): Set up range type for array index.
- (list_symbols): Call typedef_print to print typedefs.
-
- * values.c (unpack_long, value_from_longest): Handle
- TYPE_CODE_BOOL and TYPE_CODE_CHAR.
-
- * expression.h (enum exp_opcode): Add Modula-2 specific opcodes.
- * expprint.c: Look up expression opcodes in language-specific
- table, based on expression's language. Handle some Modula-2
- specific opcodes.
-
- * stack.c (frame_info): Print language of stack frame.
- (select_frame): Also select language, if in auto-mode.
- (get_frame_language): New subroutine.
- * main.c (execute_command): Warn as language changes automatically.
-
- * printcmd.c (ptype_command): Parse types using the language
- parser, both for language-independence, and so that scopes can
- be specified.
-
- * language.h, language.c: New files for language-specific macros,
- declarations, and definitions.
-
- Misc fixes:
-
- * main.c (main): If error() is called during early
- initialization, print its message and then exit(1) from GDB.
-
- * valprint.c (type_print_base): Avoid printing garbage for ints
- of unusual sizes.
- (_initialize_valprint): Warn about host/target size assumption;
- improve long long support slightly.
-
- * convex-tdep.c (comm_registers_info): Avoid parsing decimal and
- hex -- let parse_and_eval_address do it.
-
- * doc/gdbint.texinfo (Languages): Doc how to add a language.
-
- * Makefile.in: Cope with new files and removed files.
-
-Tue Sep 17 08:37:41 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Add Andrew Beers' changes for Modula-2 support. His ChangeLog
- entries are enclosed herein. Not all of these changes
- have been merged into the master GDB sources -- check the
- ChangeLog above here for the merge log.
-
-Mon Jun 3 17:05:45 EDT 1991
-
- m2-exp.y Created. Tested outside of GDB for a few days. Proper
- operators were added, C specific operators and tokens
- removed. yylex() revamped to some extent. Still things
- missing from the grammar, such as sets.
- Tested for two weeks in GDB v3.5.
-
-Tue Jun 11 17:23:48 EDT 1991
-
- m2-exp.y Added boolean constants TRUE and FALSE to the grammar
- so they are built-in. Sort of a hack.
-
-Fri Jun 14 12:53:51 EDT 1991
-
- m2-exp.y Added range checking for numeric constants. Any numeric
- constant is assumed to be of builtin type INTEGER unless:
- (1) it is octal or hexadecimal, in which case it is a
- CARDINAL; (2) it is too big to fit into an INTEGER, in
- which case it is a CARDINAL.
- eval.c Added simple range checking for +, -, and * on integers.
- Doesn't work very well for *, since 6 * 1,000,000,000 =
- 1,705,032,704, which fails the simple test of result >=
- first_operand, no matter in what order the operands are.
-
-Tue Jun 18 14:11:30 EDT 1991
-
- Broke the parser into parts, one containing the C grammar and the other
- containing code to be shared by all of the grammars.
-
- The following files no longer exist:
-
- expread.y
- expread.tab.c
-
- The following files were added:
-
- c-exp.y (The C grammar)
- m2-exp.y (The Modula-2 grammar)
- parser-code.c (Code that is shared by the above grammar)
- parser-code.h
- parser-defs.h
-
- Makefile.dist Changed to reflect the above dependencies. NOTE: It is
- now necessary to use the Bison compiler compiler, since it
- will generate function/variable prefixes other than yy.
-
-Tue Jun 18 16:47:49 EDT 1991
-
- symtab.[ch] Added the external variable working_lang, than holds the
- value of the current working language.
- Added the ennumerated type language_mode, with the values
- language_auto and language_manual, the former meaning that
- GDB sets working_lang as needed, and the latter meaning
- that the value of working_lang is totally under user
- control.
- symtab.[ch] Added the Modula-2 pervasive types INTEGER, CARDINAL,
- REAL, BOOLEAN and CHAR. Also added the type codes
- TYPE_CODE_BOOL and TYPE_CODE_CHAR.
- utils.c Added set_language_command and show_language_command to
- implement the GDB support commands "set language" and
- "show language".
- expression.h A number of identifiers were added to the type exp_opcode
- to facilitate Modula-2 builtin functions, integer
- division, and array indexing.
-
-Wed Jun 19 13:25:58 EDT 1991
-
- language.h Added the macro STRICT_TYPE, which evaluates to non-zero
- if the language specified by working_lang requires the use
- of strict typing of expressions. Eventually, even this
- will be able to be changed by the user.
- Added the macro RANGE_CHECK, which evaluates to non-zero
- if the language specified by working_lang requires the
- checking of a value against the domain of its type.
- Eventually, even this will be able to be changed by the
- user.
- language.[ch] Predicates involving types (simple_type, ordered_type,
- same_type, integral_type, numeric_type, character_type,
- boolean_type, float_type) are added. These predicates are
- based on the current value of working_lang, and are handy
- in type-checking.
-
-Wed Jun 19 15:39:34 EDT 1991
-
- eval.c Added the function type_array_rank which computes the rank
- of an array type.
- valarith.c Added the funtion value_bool, which when given a integer
- value.h value (ie. struct value *) as an argument, it returns a
- boolean value (ie. struct value *) true if that integer
- is non-zero, and a boolean value false otherwise.
- valprint.c Added cases for TYPE_CODE_BOOL, so Modula-2 BOOLEAN values
- will print out properly.
-
-Wed Jun 19 16:36:34 EDT 1991
-
- valops.c Added the function value_capitalize, which returns it
- value.h argument capitalized if its argument is a lowercase
- letter, or the argument unchanged if its argument is not a
- letter.
- valarith.c Added the function range_check_p, which returns non-zero
- value.h if its value argument is between the integral bounds upper
- and lower.
- Added the function range_check_enum_p, which makes sure
- that its value argument is a valid member of the domain of
- its type argument.
- Added the function range_check_range_p, which makes sure
- its value argument lies between the upper and lower bounds
- of its type argument, which must be a ranged type.
- Added the function check_array_index, which range and type
- checks an index of an array.
- Added the function value_multi_subscript, which computes
- array[idx1,idx2...idxN], given a value array and an array
- of values representing indicies.
- values.c Changed value_from_long to work with TYPE_CODE_CHAR and
- unpack_long to work with TYPE_CODE_BOOL and
- TYPE_CODE_CHAR.
-
-Wed Jun 19 18:04:08 EDT 1991
-
- symtab.c Stored pervasive types in a structure and make
- lookup_pervasive_type() a lookup function that was based
- on working_lang. If lookup_pervasive_type() returned
- non-zero, then that value was returned (a fix, since
- before it simply wouldn't return the pervasive type.)
- language.h Added the macro CAST_IS_CONVERSION, which evaluates to
- non-zero if the language specified by working_lang means
- "conversion" when it says "cast".
- valops.c Added the function value_real_cast(), which performs a
- value.h *cast*, not a *conversion*, which is what value_cast()
- does when it can. In particular,
- value_cast(<float_type>,4) = 4.0, while
- value_real_cast(<float_type>,4) = some mess.
- eval.c Modula-2 builtin functions implemented: ABS, CAP, CHR,
- parser-code.c FLOAT, HIGH, MAX, MIN, ODD, ORD, TRUNC, and VAL.
- expression.h Added macros MAX_OF_TYPE and MIN_OF_TYPE to work with MAX
- and MIN on integral types. *NOTE*: These are currently
- hardcoded to work only if there are 8 bits per storage
- unit. FIXME.
- eval.c Made logical functions call value_bool to return a
- properly typed boolean value, based on working_lang.
-
-Thu Jun 20 11:55:27 EDT 1991
-
- valprint.c Types now print out in a Modula-2 fashion. This works for
- the cases when the type is printed out step-by-step, that
- is, it doesn't work when the name of a structured type
- (which includes the keyword "struct", etc.) is simply
- displayed.
- FIXME: Perhaps this is bad. Parts of it seem to kludgey,
- since type specifications in C and Modula-2 are very
- different. The C printing of a type is very recursive,
- whereas in Modula-2 it is generally very simple. C has
- type prefixes and suffixes, which have no real analogue in
- Modula-2. Maybe type_print() should call a language
- specific type printer. This is also advantageous if we
- compile GDB to exclude some of the languages. We'll just
- leave those functions out.
-
-Thu Jun 20 16:57:10 EDT 1991
-
- dbxread.c When reading the complete symbol table in (via
- psymtab_to_symtab()), the number and types of function
- arguments are added to a function type. define_symbol()
- calls add_param_to_type() to accomplish this.
- Assumption: when we come across a function definition
- (N_FUN symbol with an 'f' or 'F' in the name), its
- arguments will appear before another function definition.
- When a function is found, a pointer to its type is placed
- in the global in_function_type. Changes that
- add_param_to_type() makes are to this global.
- valprint.c The type of a function now includes (for Modula-2) the
- types of its parameters.
- eval.c Type checking and a check for the proper number of
- arguments is now done for function calls. Not sure of the
- impact this has on C++ member function yet.
-
-Thu Jun 20 19:58:48 EDT 1991
-
- valprint.c Rewrote the type printer. Broke it into two language
- specific parts, adding the functions type_print_m2() and
- type_print_m2_1().
- An unfortunate consequence is this: if you debugging a C
- program in Modula-2 mode (why?), info types does not work
- well with regular expressions, since the types are printed
- out in Modula-2 terminology, but stored in C terminology.
- language.[ch] Added the functions new_type_last(), type_keyword(), and
- type_sep() to aid in the printing of typedefs.
- symtab.c Made the printing of typedefs as language independent as
- possible through calls to new_type_last(), type_keyword(),
- and type_sep().
-
-Fri Jun 21 11:50:26 EDT 1991
-
- dbxread.c Check all incoming ennumerated types. If it looks like
- Modula-2's BOOLEAN type, then change the type_code of the
- type to TYPE_CODE_BOOL so we can process it as a boolean
- variable.
- valprint.c Replaced some of the 0x%x with calls to sprintf and
- hexformat() in val_print().
- language.[ch] Added the function hex_to_string(), which converts its
- integral argument to a hexadecimal number (format is
- language based) and returns the result as a string.
-
-Mon Jun 24 12:25:07 EDT 1991
-
- valprint.c Some functions call type_print_1() directly, instead of
- value.h using type_print(), so they can specify where (column) to
- print things. Since type_print() takes care of language
- dependence, that needs to be called first. Added a
- parameter depth to type_print() (so it is now like
- type_print_1). Changed type_print to type_print_at, and
- made type_print a macro that passes a depth argument of
- zero.
- symmisc.c Changed all calls to type_print_1 to calls to
- type_print_at.
- Makefile.dist Made it possible to build GDB for a specific set of
- depend languages. Do this by passing a definition for the macro
- LANGS to make. LANGS should be a string containing a
- space-separated list of language names (ie. LANGS="c m2").
- The default is to build all languages. Note that grammar
- files must follow the naming convention of <lang>-exp.y.
- gdb.lang This holds the current value of the LANGS macro. It is
- examined every time make is called, and is updated if
- necessary.
- eval.c Added #ifdef _LANG_<lang> to these files.
- expread.c Still need to add them to dbxread.c and coffread.c.
- main.c
- source.c
- symtab.c
- utils.c
- valarith.c
- valprint.c
-
-Mon Jun 24 16:33:11 EDT 1991
-
- language.[ch] Added the functions hexformat_pre() and
- hex_to_string_pre(), which take a prefix argument to
- include in the format string. Thus, hexformat_pre("08") will
- return "0x08x" (if the working language is language_c).
- Made hexformat() and hex_to_string() calls to the above
- with "" as the prefix argument.
-
- am29k-pinsn.c, arm-pinsn.c, breakpoint.c, convex-tdep.c, exec.c, core.c,
- dbxread.c, i386-pinsn.c, i386-stub.c, i386-xdep.c, i960-pinsn.c,
- infcmd.c, inflow.c, m68k-pinsn.c, m68k-stub.c, m88k-pinsn.c,
- mips-pinsn.c, mips-tdep.c, ns32k-pinsn.c, printcmd.c, pyr-pinsn.c,
- pyr-tdep.c, pyr-xdep.c, remote-vx.c, remote.c, solib.c, source.c,
- stack.c, sun386-xdep.c, symfile.c, symm-xdep.c, symmisc.c, tahoe-pinsn.c,
- valprint.c, vax-pinsn.c
-
- Changed all occurences of 0x%[0-9]*l*x in printf format strings to
- calls to hexformat() and hex_to_string(). Format strings without
- the leading "0x" were ignored.
-
- depend Updated to take the above into account.
-
-
-Tue Jun 25 15:27:18 EDT 1991
-
- symtab.h Added the types range_mode_t, range_check_t, type_mode_t,
- and type_check_t to keep track of the current state of
- range and type checking.
- main.c Added the variables range_mode, range_check, type_mode,
- and type_check to record the current state of range and
- type checking. Added initialization code to main().
- language.h Changed the macros STRICT_TYPE and RANGE_CHECK to examine
- the above variables.
-
-
-Tue Jun 25 17:57:08 EDT 1991
-
- dbxread.c process_one_symbol() updates the variable (enum language)
- source_lang based on the extension of the filename
- contained in the N_SO sybmol that started this symtab.
- When end_symtab() is called, the value of source_lang is
- put into the language field.
- stack.c select_frame() sets working_lang (and possibly type_check
- and range_check) to the language field of the symtab
- associated with the frame that is selected if working_mode
- is language_auto. If working_mode is language_manual, a
- warning is printed and working_lang is not set.
- language.c Added the function set_type_range(), which sets the value of
- type_check and range_check (if their modes call for
- automatic setting) based on the current value of
- working_lang. A non-zero argument will cause the current
- settings to be output.
-
-
-Wed Jun 26 14:51:40 EDT 1991
-
- eval.c Added range checks on assignment.
- m2-exp.y Added the grammar for sets to the language. Currently,
- these do not do anything except print an error message.
-
-Wed Jun 26 17:01:04 EDT 1991
-
- m2-exp.y Added the ability for parse_number() to parse negative
- numbers. A global flag is set upon encountering a unary
- minus. This was done to make, for example, 1 parse as a
- CARDINAL, and not as an integer, per Wirth's examples in
- Programming in Modula-2 ed.4.
- valprint.c Added support for "set radix 2" by then setting
- output_format to 't'.
- eval.c Implemented range checking on subrange types. Added calls
- to range_check_range_p for BINOP_ASSIGN and BINOP_VAL.
- Implemented MIN and MAX for ennumerated types. The
- minimum value of an ennumerated type is defined by Wirth
- as the first identifier, and the maximum as the last.
- m2-exp.y Made octal numbers ending with "B" be characters and those
- ending with "C" be numbers, per Wirth's book. (p. 34)
-
-Thu Jun 27 14:11:52 EDT 1991
-
- stack.c select_frame() now only sets working_lang, it does not
- notify the user. If working_mode is language_manual, then
- a warning is issued once.
- main.c At the end of each call to execute_command(), working_lang
- is checked against the local static (enum language)
- current. If they differ and working_mode is
- language_auto, the new settings of language, type and
- range checking are printed out.
- stack.c Modified frame_info() to include the language of the
- current frame in the output of "info frame".
- language.[ch] Added the function language_str() which returns the name
- of the current language.
-
-Fri Jun 28 15:33:14 EDT 1991
-
- m2-exp.y Added the built-in procedures INC, INCL, DEC, and DECL to
- the language. INCL and DECL currently cause an error,
- since sets are not implemented yet. INC and DEC are
- implemented as PREINCREMENT/PREDECREMENT with one
- argument, and as ASSIGN_MODIFY with two arguments.
- eval.c Added type checking to the above cases.
- value.h Added not_lval_constant to the lval_type ennumerated type.
- not_lval_constant means that the value is a constant
- value; that is 3 or 'a' or TRUE, not as in a constant
- identifier. This is used to help coerce numbers such as 3
- to either signed or unsigned numbers.
- valops.c Added the function value_coerce_constants() which coerces
- constant integers as following: if one is a constant and
- the other is not, the constant's type is set to the type
- of the other argument. If both are constants and one is
- signed, the other is converted to a signed constant.
-
-Sat Jun 29 17:26:29 EDT 1991
-
- valarith.c Added a better range checker. It now checks range
- (successfully) on integral operations [+-] (signed and
- unsigned) for any C sized type. Still does not work well
- for multiplication.)
- int_in_size() returns an integer that is coerced to fit into
- specified number of bytes.
-
-Mon Jul 1 13:04:14 EDT 1991
-
- language.[ch] Added the function binop_result_type(), which returns the
- builtin (struct type *) type that would be the result of a
- binop on the two values V1 and V2.
-
-Wed Jul 3 19:22:53 EDT 1991
-
- source.c Extended source_info() to include the source language in
- the output from "info source".
-
-Fri Jul 5 13:48:52 EDT 1991
-
- utils.c Moved the support functions for the GDB set/show commands
- dealing with language into language.c.
- language.c Added the function language_info(), which displays info
- about the current working language, type and range check
- settings. Called via the GDB command "info language".
- Added an initialization routine _initialize_language(),
- that sets defaults for the language, type and range
- variables and sets up the new GDB commands.
- main.c Language setup moved to language.c.
- depend Rebuilt.
-
-Mon Jul 8 10:10:22 EDT 1991
-
- valarith.c Debugged the range checker for arithmetic. Still does not
- work for multiplication very well.
-
-Mon Jul 8 12:40:37 EDT 1991
-
- language.[ch] Added the function value_true() which returns non-zero if
- its argument represents a boolean true value.
- breakpoint.c Changed breakpoint_cond_eval() to call value_true() to
- check the truth of an expression.
-
-Thu Jul 11 12:51:34 EDT 1991
-
- language.[ch] Added the predicate structured_type(), which returns
- non-zero if the argument is a structured type.
- Added the predicate pointer_type(), which returns non-zero
- if the argument is a pointer type.
- eval.c Added the ability to do addition and substraction on
- pointers and integers. This case simply bypasses the
- type checker.
-
-Thu Jul 11 14:41:42 EDT 1991
-
- include/stab.def
- Added the symbol N_DEFD (0x4a) which is a definition
- module dependency that is used by the GNU Modula-2
- compiler and the linker. It is not important to GDB,
- except that [dbx|coff|mips]read.c should ignore these
- symbols.
-
-Fri Jul 12 16:07:00 EDT 1991
-
- valprint.c Changed the TYPE_LENGTH(type) >= 0 to TYPE_LENGTH(type) >
- 0 in val_print(). Also added statements to the else part
- to coerce type (argument to val_print) to a pointer type
- if it is an "array of unspecified length".
- valops.c Added the function value_m2_string(), which returns a
- (value) value which is a constant string, whose type is
- (ARRAY [0..n] OF CHAR). The length field of the type
- structure is set to zero, so it will be interpreted as an
- "array of unspecified length".
- stack.c Moved the language/frame mismatch check to
- main.c:execute_command().
- main.c The working language is recorded each time
- execute_command() is executed. If working lang has
- changed during its execution, then the new
- language/type/range info is printed out for the user. If
- the working language does not match the language of the
- frame, a warning is issued.
-
-Sat Jul 13 16:16:39 EDT 1991
-
- eval.c Moved all the type-checking stuff for operators to
- language.[ch] language.c. This is so we can keep language-specific
- stuff (like for what type operators are defined) in
- language.c.
- language.[ch] Added the function binop_type_check(), which checks to see
- if its two (value) arguments are type-compatible with its
- opcode argument. The opcode should represent an operation
- involving an operator. Also added the macro function
- unop_type_check, which calls binop_type_check with a
- NULL second argument.
- expprint.c Added Modula-2 operators to the op_print_tab, so info
- expression.h break works correctly. Also added "op_string", which
- returns the string corresponding to the (enum exp_opcode)
- opcode that is its argument.
-
-
-Sat Jul 13 18:26:18 EDT 1991
-
- coffread.c Added code to record the type of function arguments with
- each paricular function. Code is very similar to that
- added to dbxread.c.
- dbxread.c Moved add_param_to_type() to symtab.c
- symtab.[ch] Added function add_param_to_type() from dbxread.c
-
- *** NOTE: The above additions have not been tested.
-
-Mon Jul 15 12:50:47 EDT 1991
-
- langauge.[ch] Added the functions type_error and range_error, which work
- like error() except if the type/range mode is set to
- *_mode_warn, then they do not do a return_to_top_level(),
- but merely print a warning.
- Also changed [set|show]_[type|range]_command() to support
- the new "warn" feature.
-
-Thu Jul 18 17:50:54 EDT 1991
-
- mipsread.c Added code to record the type of function arguments with
- each particular function. Code is very similar to that
- added to dbxread.c.
-
- *** NOTE: The above additions have not been tested.
-
-Fri Jul 19 11:19:10 EDT 1991
-
- defs.h Added macros MAX_OF_SIZE, MIN_OF_SIZE, UMAX_OF_SIZE, and
- UMIN_OF_SIZE, which when given a size of a numeric type,
- return the maximum and minimum value it can hold. UMAX...
- and UMIN... return the result for unsigned types.
- symtab.h Added the macros MAX_OF_TYPE and MIN_OF_TYPE to operate on
- struct types. They call above macros.
- dbxread.c Renamed the MAX and MIN_OF_TYPE macros to ..._OF_CTYPE to
- avoid a name conlict with the above.
- c-exp.y Added range checking on numeric constants in
- parse_number() for completeness.
- valarith.c Made binop_user_defined_p() and unop_user_defined_p()
- return 0 if working_lang is not language_c.
-
-Thu Aug 8 14:17:22 EDT 1991
-
- main.c
- printcmd.c
- breakpoint.c Documentation strings of some commands changed to
- eliminate the references to the C language where
- appropriate.
-
-Tue Aug 13 15:48:03 EDT 1991
-
- m2-exp.y Added qualified identifiers to the grammar. The semantics
- are slightly different from those of the GDB operator ::
- c-exp.y
- m2-exp.y Added a rule to each grammar of the form: start ::= exp |
- type_exp, where type_exp is any valid type expression.
- expression.h
- eval.c Added the opcode OP_TYPE, and an error case in eval.c.
- printcmd.c Modified ptype_command() so it actually parses the input
- (necessary for type expressions with scope qualifiers).
- Added the function ptype_eval() which expects an
- expression composed of one OP_TYPE element.
- *.[ch] Replaced all occurences of parse_c_expression with
- parse_expression
- *.[ch] Replaced all occurences of parse_c_1 with parse_exp_1
-
-[End of ChangeLog entries from Andrew Beers for Modula-2 support.]
-
-Mon Sep 16 17:19:46 1991 John Gilmore (gnu at cygnus.com)
-
- Small fixes from Peter Schauer:
-
- * infrun.c (child_attach): Lint.
- * solib.c (find_solib): Handle shared libs version 2.
-
- Small fixes from David Wood:
-
- * xm-ultra3.h (SYS_SIGLIST_MISSING): Typo.
-
- Small fixes:
-
- * remote-vx.c: Move <stdio.h> to top, for FILE. Fix from
- John S <basrai%kanga.dnet@c3po.sm-alc.af.mil>.
-
- * utils.c (wrap_here): Avoid wrap action of fputs_filtered if
- chars_per_line is at maximum (user typed `set width 0'). Fix
- from Andreas Schwab <schwab@ls5.informatik.uni-dortmund.de>.
-
-Tue Sep 17 17:31:04 1991 Stu Grossman (grossman at cygnus.com)
-
- * coredep.c: include ptrace.h where necessary.
- * mipsread.c(parse_lines): fix unsigned char problem that was
- messing up line numbers on SGI's and possibly other MIPS based
- platforms.
- * infrun.c (child_create_inferior): use better test to check
- return val from setpgrp().
- * tm-irix3.h, xm-irix3.h, tconfig/irix3, xconfig/irix3: add these
- for sgi/irix support.
-
-Wed Sep 18 04:33:31 1991 Per Bothner (bothner at cygnus.com)
-
- * mipsread.c (parse_symbol): Put non-static procedures
- in the global block.
-
-Fri Sep 13 00:14:52 1991 John Gilmore (gnu at cygnus.com)
-
- Patch together `text_start' and `text_end' for 29K port.
-
- * exec.c (exec_command): If NEED_TEXT_START_END, define the
- variables and set them based on the exec file.
- * am29k-tdep.c: declare text_start.
- * valops.c (call_function_by_hand): declare text_end.
-
- * inferior.h: Eliminate CANNOT_EXECUTE_STACK in favor of
- defining CALL_DUMMY_LOCATION as BEFORE_TEXT_END. This is
- because machines that do this will also have to know to
- set NEED_TEXT_START_END. Besides, it was a redundant way to
- say the same thing.
- * tm-29k.h, tm-convex.h, tm-np1.h: Eliminate
- CANNOT_EXECUTE_STACK, define CALL_DUMMY_LOCATION and
- NEED_TEXT_START_END.
-
-Thu Sep 12 00:22:24 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- AMD 29000 changes from David Wood <wood@david.ultra.nyu.edu>:
-
- * Makefile.in (CLIBS): Put XM_CLIBS and TM_CLIBS at end.
- Pass MUNCH_DEFINE to munch whenever we run it.
- * am29k-pinsn.c (print_insn): Handle NOP specially. Avoid %#x
- format string; use 0x%x instead.
- * am29k-tdep.c: Use DUMMY_SAVE_GREGS and RETURN_REGNUM.
- * ultra-xdep.c, xm-ultra.h: New files for Ultracomputer host system.
- * xm-rtbsd.h: New host support for RT/PC running BSD Unix.
- * inflow.c: Handle `short' process group IDs.
- * infptrace.c (fetch_register): Support CANNOT_FETCH_REGISTER,
- and check for ptrace errors.
- * coffread.c (SDB_REG_TO_REGNUM): Define if not already.
- (coff_symfile_init): Initialize text_bfd_scnum.
- (read_coff_symtab): Use it to find the text [and absolute?] sections.
- * ../config.sub: Add vendor nyu and os "sym[1-9]*".
- * configure.in: Add hosts rtpc-*-* and a29k-*-*.
- Merge target arm case with other "easy" cases. Add target
- cases a29k-*-none (rehack of am29k), a29k-*-kern (remote to
- Ultracomputer kernel), and a29k-*-sym1 (ultracomputer OS's user
- process).
- * minimon.h, remote-adapt.c, remote-mm.c: Add.
- * munch: Cope with RT/PC putting fns in data segment.
- Restore ability to override `nm' by specifying MUNCH_NM.
- * xconfig/rtbsd, xconfig/ultra3: New host systems.
- * tconfig/a29k: Rename from tconfig/am29k. Add remote-mm
- and remote-adapt. Remove encapsulated coff #define's (the
- support should go in BFD, and gdb shouldn't know or care).
- * tconfig/a29k-kern: Same, but for remote kernel debugging.
- * tconfig/ultra3: For debugging user processes on Ultra3/Sym1.
- * tm-29k.h: Update BADMAG (though it should go away).
- Allow the register definitions to be overridden in another
- tm-file. Fix SR_REGNUM. Add a mess of _REGNUM's. Separate
- RETURN_REGNUM from GR96_REGNUM and DUMMY_SAVE_GREGS from
- DUMMY_SAVE_GR96, for handling kernel calling conventions
- that use GR64+ rather than GR96+.
- * tm-ultra3.h: New file, for use on Ultra3 Unix as well as for
- remote debugging of Ultra3 kernel. Includes tm-29k.h and
- overrides various things.
-
- * remote-mm.c (mm_attach, mm_wait): Handle attach like
- child_attach does, making a clean stop in the newly attached
- program.
- * remote-eb.c: Lint.
-
- * coffread.c: Make coffread independent of any particular
- variant of COFF. Avoid #include-ing any particular one except
- internalcoff.h. BFD now passes key values for symbol reading
- as part of its coff_data structure (LINESZ, SYMESZ, AUXESZ,
- and the symbol masks and shifts); use them.
- Remove obsolete end_of_text_addr.
-
- * exec.c: Remove unused include files.
-
-Wed Sep 11 19:38:44 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * Makefile.in (documentation targets): Pass $(M4).
- Bugfix from eggert@twinsun.com (Paul Eggert).
-
- * stack.c (down_silently_command): Check for stack existence.
-
-Tue Sep 10 23:08:29 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * Makefile.in (VERSION): Update to 4.0.3.
-
-Tue Sep 10 09:19:29 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * core.c (core_file_command): Print frame at coredump with
- its level number, by calling print_stack_frame.
- * frame.h: Add selected_frame_level, print_stack_frame.
- * frame.h, stack.c: Remove print_sel_frame, print_selected_frame.
- * convex-tdep.c, convex-xdep.c, infcmd.c, inflow.c, infrun.c:
- Change print_sel_frame and print_selected_frame callers to
- print_stack_frame.
-
- * dbxread.c (read_ofile_symtab): Avoid empty else clause.
- * symfile.c (free_named_symtabs): Ditto.
- * main.c (main): wrap_here needs an arg.
- * solib.c (find_solib): Avoid memory access if _DYNAMIC is zero.
- (solib_add): Avoid noise.
- (solib_create_inferior_hook): Lint.
- (sharedlibrary_command): Move dont_repeat to here.
- * utils.c (error): Call wrap_here to force buffered output.
-
- Small patches from Peter Schauer:
-
- * coffread.c (start_symtab): Free any existing line_vector before
- malloc-ing new one.
- (read_coff_symtab): Ditto for type_vector.
-
- * source.c (lines_to_list): New variable, replacing function.
- (all uses): Use as variable.
- (_initialize_source): Add 'set listsize' and 'show listsize'.
- * utils.c (lines_to_list): Remove function.
- * stack.c (print_frame_info): Use as variable.
- * defs.h (lines_to_list): Remove declaration.
-
-Mon Sep 9 13:45:57 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * breakpoint.c (insert_breakpoints): Restore warning about
- the program might be running in another process, but only for
- systems with this brain death (#ifdef ONE_PROCESS_WRITETEXT).
- * xm-hp300bsd.h, xm-mips.h, xm-vax.h: Define it.
-
- * utils.c (error): if error_pre_print is set, print the string
- first.
- * main.c (main, print_gnu_advertisement, print_gdb_version):
- Reformat legalese so it always prints, but acts as an "I'm here"
- message while symbols are being read. If any errors occur,
- print a few newlines to set off the message and start it at the
- left margin. Remove mention of "help" command, and don't yak
- about symbol reading.
- (catch_errors): Error string is now printed first in case of
- error, not last.
- * command.c (undef_cmd_error, lookup_cmd): On undefined command,
- suggest the "help" command.
-
- * Makefile.in (VERSION): Set to 4.0.2.
-
-Thu Sep 5 23:49:48 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * .gdbinit: Remove useless "rr" command. Set complaints
- to 1 for people debugging gdb.
-
- * breakpoint.c, remote-vx.c: Reword strings printed by
- catch_errors callers.
-
-Wed Sep 4 11:07:50 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * WHATS.NEW: "history write -> history save". Doc "write on/off".
- (Fix from kenc@viewlogic.com.)
-
- Fix some infrastructure to be able to cope with host and target
- machines with different sized basic types (ints, ptrs, etc).
- (Idea from pierre@la.tce.com (Pierre Willard).)
-
- * values.c (value_from_longest): Rename from value_from_long.
- Handle pointer types as well as integers, so that targets with
- different pointer sizes from the host can be accomodated.
- * breakpoint.c, convex-tdep.c, eval.c, expprint.c, printcmd.c,
- valarith.c, valops.c, valprint.c, value.h, values.c: Rename
- uses of value_from_long to value_from_longest.
- * eval.c, findvar.c, printcmd.c, valarith.c, valops.c: Pass
- the correct pointer type to value_from_long{est}.
-
- * doc/gdb.texinfo ($_, $__): Describe types of these variables.
-
- * remote-vx.c: Remove obsolete code for calling functions via
- vxworks kludge interface (it referenced value_from_long).
-
- * valops.c (value_string): Find malloc with lookup_misc_func, not
- raw search.
-
-Tue Sep 3 18:37:46 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Make writing to files work properly. (Fixes to BFD are also needed.)
-
- * core.c (core_open): Open file ourselves, read or r/w, depending on
- write_files. Use bfd_fdopenr.
- * gdbcore.h (write_files): New variable.
- * exec.c (write_files): Define variable, add set&show for it.
- (exec_file_command): Use write_files to open for read or r/write.
-
- Make shared library reading happen automatically. These changes
- are mostly from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.
-
- * inferior.h (stop_soon_quietly): Add to exported variables.
- * infrun.c (child_create_inferior): call solib hook, if defined.
- (child_attach): call solib hook, if defined.
- * solib.c: Include inferior.h. Add from_tty to so_list as kludge.
- (find_solib): Use lookup_misc_func rather than hand-rolled.
- (symbol_add_stub): New stub for catch_errors.
- (solib_add): Avoid output if !from_tty. Catch errors rather
- than just calling symbol_file_add and bombing.
- (solib_create_inferior_hook): Interface with the target process
- to let it read and alloc shared libs, then figure out what it did.
-
- * core.c (validate_files): Fix typo, soften warning.
- (Fix from Hiroto Kagotani <kagotani@cs.titech.ac.jp>.)
-
- * utils.c (fputs_demangled): Avoid duplicate printing if
- demangling is off. (Fix from J.T. Conklin <jtc@cayenne.com>.)
-
- * infrun.c (proceed): Cast -1 to (CORE_ADDR) before comparing.
- (Fix from pierre@la.tce.com (Pierre Willard).)
-
- * main.c (catch_errors): Change argument to a char * from an int,
- since a char * can point to a struct full of glop, but an int
- is not guaranteed to be able to hold a pointer.
- * breakpoint.c (breakpoint_cond_eval, bpstat_stop_status,
- breakpoint_re_set_one, breakpoint_re_set): Adapt.
- * core.c (core_open, solib_add_stub): Adapt.
- * remote-vx.c (symbol_stub, add_symbol_stub, callers): Adapt.
-
-Wed Aug 28 18:18:05 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * Makefile.in: Update VERSION to 4.0.1. Evade GNU Make bug
- by adding .NOEXPORT target.
-
-Fri Aug 23 17:14:25 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * GDB-4.0 release!
- * Update README.
- * Makefile.in (VERSION): Roll to 4.0.
- (gdb.tar.Z): Make refcard.ps as well, for shipment.
-
-Fri Aug 23 14:07:09 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
-
- * doc/gdb.texinfo: minor rewordings, crossref to ptype from print,
- more on printsyms.
-
- * doc/Makefile, Makefile.in: generate "gdb-all.texi" rather than
- "gdb-all.texinfo"
-
- * doc/rdl-apps.texi: renamed from rdl-apps.texinfo
-
- * Makefile.in, doc/Makefile, doc/.Sanitize, doc/gdb.texinfo:
- reflect above name change
-
- * WHATS.NEW: correct pointer to refcard.
-
- * doc/gdb.texinfo: update New Features, Installing
-
- * doc/gdbint.texinfo: add short description of configure +template
-
-Fri Aug 23 11:46:08 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
-
- * doc/gdb.texinfo: update, fix bugs in "Installing" appendix
-
-Fri Aug 23 01:02:00 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * Makefile.in: Add config.sub, make doc/rdl-apps.texinfo for
- tar file, add dependencies for referenced doc files.
-
-Thu Aug 22 22:17:06 1991 Stu Grossman (grossman at cygint.cygnus.com)
-
- * coffread.c, symfile.c, stack.c: saberized.
-
-Thu Aug 22 16:20:27 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
-
- * doc/refcard.tex: permuted Essential Commands sec
-
- * doc/gdb.texinfo: new C++ chapter; revised installation appendix;
- new doc for
- set/show symbol-reloading
- default set complaints 0
- info all-registers
- RET-repeat disabled after prompted long displays
- processID (attach) interpretation of 2nd GDB cmdline arg
-
-Thu Aug 22 14:05:47 1991 Stu Grossman (grossman at cygint.cygnus.com)
-
- * expread.y, coffread.c, dbxread.c, target.c, mem-break.c,
- cplus-dem.c, values.c, valprint.c, symfile.c, remote.c,
- breakpoint.c, main.c: lint.
-
-Thu Aug 22 02:02:26 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Install new configuration scheme for GDB and friends.
-
- * config.sub: Translate ordinary names to three-part names.
- * configure: Use three-part names internally.
- * configure.in: Translate three-part names to filenames.
-
- * README, WHATS.NEW: Update for gdb-4.0.
- * Makefile.in: Roll VERSION to 3.99.
-
-Wed Aug 21 18:21:09 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * infptrace.c (KERNEL_U_ADDR_BSD): Include a.out.gnu.h.
- * i960-tdep.c, m68k-tdep.c, sparc-tdep.c, tm-i960.h,
- tm-m68k.h, remote-nindy.c: Change ext_format_XXX structs
- to single structures rather than arrays; when passing
- their address, use &. This avoids trouble with bdead compilers.
- * mcheck.c: Don't include <stdlib.h>; just declare "void abort();"
- instead. This avoids portability headaches.
- * mips-tdep.c (mips_do_registers_info): Only print FP regs if
- asked to.
- * source.c (open_source_file): Avoid ANSI const bdeath by
- skipping declaration and then casting result value.
- * tm-hp300bsd.h: Clarify comment.
- * utils.c (strstr): Result is const char *; ANSI bdeath.
- * xm-hp300bsd.h: Define HOST_BYTE_ORDER. Redefine INT_MIN,
- since system include file defines it differently from "defs.h",
- though the two are equivalent for our purposes.
- * tconfig/hp300bsd: Add m68k-tdep.o.
-
-Tue Aug 20 16:01:11 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * tconfig/sun*4: Remove warnings about system assembler.
-
-Mon Aug 19 13:44:46 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * mcheck.c: Avoid warning about undeclared abort fn.
- * tm-sparc.h (PC_ADJUST): Avoid calling error() from this;
- it causes recursive calls to error() when used in cleanups.
- To do so requires that we make it a function, so we do.
- * sparc-tdep.c (sparc_pc_adjust): New implem of PC_ADJUST.
- * utils.c (do_cleanups): Remove the current cleanup from the
- chain *before* calling it, in case error() is called from it.
- The result won't be pretty, but won't be an infinite loop either.
-
-Mon Aug 19 00:41:04 1991 Michael Tiemann (tiemann at cygint.cygnus.com)
-
- * dbxread.c (read_struct_type): Grok anon structs for C++.
- (vb_name, vptr_name): Null terminate these strings.
-
-Fri Aug 16 08:31:03 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Minor bug fixes from BSD Net2 gdb:
-
- * blockframe.c (get_prev_frame_info): If FRAME_CHAIN_COMBINE
- returns 0, there is no previous frame.
- * breakpoint.c (commands_command): If !from_tty, don't call
- input_from_terminal_p().
- * dbxread.c (record_misc_function): Speed up slightly.
- (compare_psymbols): Ditto.
- * infcmd.c (do_registers_info): Take a second argument to
- determine whether to print float registers. "info registers"
- does not do so anymore. "info all-registers" does, now.
- * mips-tdep.c, pyr-tdep.c (xxx_do_registers_info): Take second
- arg and ignore it.
- * tm-mips.h, tm-pyr.h (DO_REGISTERS_INFO): Pass second arg.
- * inflow.c (initialize_inflow): Set tflags_ours correctly.
-
- Other fixes:
-
- * breakpoint.c (bpstat_do_actions): Use a cleanup to restore
- executing_breakpoint_commands if we are interrupted by error.
- * coffread.c (init_lineno): Avoid problem with zero-sized linetab
- versus malloc/free. From: john@labtam.labtam.oz.au (John Carey).
- * core.c (solib_add_stub, core_open): Call SOLIB_ADD inside a
- catch_errors() so we can setup the frame regardless of whether
- the shared libs work.
- * ieee-float.c (double_to_ieee_extended): Get exponent from
- right place in little-endian systems. From John Carey.
-
-Thu Aug 15 18:43:57 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * main.c: Remove unused terminating_signals and catch_termination().
- (long_options): Terminate with a zero element.
- [Bugfix from Atsuo Kawaguchi <atsuo@hark86.harl.hitachi.co.jp>.]
- (gdb_readline): Make call-compatible with readline.
- (init_signals): Improve comments re vfork vs. signal.
-
- * utils.c (prompt_for_continue): Use new gdb_readline().
- If we prompt for continuation, we don't let CR repeat the previous
- command, once we get back to a prompt. It's too easy to keep
- hitting CR, expecting "--more--" prompts, and have some long
- command start repeating on you.
-
-Tue Aug 13 16:17:56 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * blockframe.c (frameless_look_for_prologue): Speed up by
- calling SKIP_PROLOGUE_FRAMELESS_P if it's defined.
- * tm-sparc.h (SKIP_PROLOGUE, SKIP_PROLOGUE_FRAMELESS_P):
- Define two variants, one faster.
- * sparc-tdep.c (sparc_frame_chain): Use target_read_memory
- and return zero, rather than giving an error.
- (setup_arbitrary_frame): Initialize the PC in the new frame.
- (skip_prologue): Add a second arg saying whether we're just
- checking for a frameless function or not.
-
- * core.c (core_open, core_close, core_xfer_memory): Move
- section table pointers and bfd* into the target_ops.
- (core_open): Allow errors in shared lib reading, etc.
- (core_files_info): Describe shared library sections.
-
- * exec.c (exec_open, exec_close, exec_xfer_memory, xfer_memory,
- exec_files_info, set_section_command): Move section table
- pointers and bfd* into the target_ops.
- (add_to_section_table): Add BFD to section table.
-
- * target.c (target_xfer_memory, target_info): Pass target to
- xfer_memory and target_info functions.
- * target.h: ''
-
- * gdbcore.h: Move struct section_table.
- * target.h: New home of struct section_table.
-
- * solib.c (solib_add): New argument is the target_ops whose
- section list is to be added to, if any. Reallocate the
- sections in that target to add any that come from shared libs.
- (throughout) so_sections renamed to sections.
- (solib_xfer_memory): Deleted.
- * tm-sunos.h (SOLIB_ADD): Add target argument.
- (SOLIB_XFER_MEMORY): Delete.
-
- * core.c, exec.c, inftarg.c, remote-eb.c, remote-nindy.c,
- remote-vx.c, remote.c, target.c, target.h: Remove add_syms vector
- from target_ops. It's the same on all targets. Add two section
- pointers to target_ops.
-
- * stack.c (find_relative_frame): Dump ancient algorithm for
- "down", just use handy "next" pointers.
- (frame_command): Don't error if there is no stack; let user
- set one.
-
- * inflow.c (new_tty_prefork, new_tty): New prefork routine
- modifies static state in the parent process; new_tty itself
- runs in the child and modifies the child's file descriptors
- to match the saved static state.
- * infrun.c (child_create_inferior): Call new_tty_prefork,
- fork, then new_tty.
-
- * infptrace.c (child_xfer_memory): Add ignored target arg.
- * remote-eb.c (eb_xfer_inferior_memory): ''
- * remote-nindy.c (nindy_xfer_inferior_memory): ''
- * remote-vx.c (vx_xfer_memory): ''
- * remote.c (remote_xfer_memory): ''. Rename from
- remote_xfer_inferior_memory.
-
- * main.c (main): Only try to attach "corefile" argument if
- it starts with a digit.
-
- * symfile.c (symbol_reloading): New "set/show" variable.
- (symbol_file_add): Shorten message about symbol reading.
- (add_symbol_file_command): Merge with add_syms_addr_command,
- since this should work on all targets now.
- (stop_whining): Default to zero, to shut up complaints
- about bad symbol tables on many systems.
- (free_named_symtabs): Just exit unless symbol_reloading.
-
- * xm-sun3os4.h, xm-sun4os4.h: Define BROKEN_LARGE_ALLOCA,
- and add comment explaining shared library screw.
-
- * source.c: #if defined => #ifdef.
-
-Thu Aug 8 12:23:19 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * doc/gdbint.texinfo: Improve doc on porting to new OS's.
-
-Tue Aug 6 17:16:15 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
-
- * doc/rdl-apps.texinfo: provide default readline-appendix finder
- (doc/Makefile knows how to make one for local config)
-
- * Makefile.in: use doc/Makefile for doc targets
-
- * doc/Makefile: GDB documentation now has its own Makefile
- doc/refcard.tex: renamed from "gdbrc.tex"
- doc/.Sanitize: add Makefile; recognize renamed refcard.tex
- doc/gdbint.texinfo: add markup in "Cleanups" chapter
-
-
-Fri Aug 2 00:13:06 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * values.c (baseclass_addr): When reading target memory, use the
- length of the basetype, not the upper type. We've only malloc'd
- enough space for the basetype, leading to errors in free().
-
- * expprint.c (print_subexp): Print UNOP_MEMVAL of an OP_LONG that
- ends up as a function specially, since we know the actual type of
- the pointed-to address. This (somewhat) fixes display of
- expressions that include misc_function_vector names. Try `cond 1
- !strcmp("a","b")' then `i b'.
-
- * infrun.c: Move DO_DEFERRED_STORES from proceed() to resume().
- The child can be proceeded from inside wait_for_inferior in
- evaluating breakpoint conditions, and DO_DEFERRED_STORES was
- getting skipped in that case.
-
- * expprint.c (print_subexp): Use filtered output, since the
- subroutines we call use it, otherwise the output is horribly
- mangled, since output of wrappable stuff comes out late.
-
- * Makefile.in: Bump VERSION to 3.98.1
-
- * infrun.c (child_create_process): Use execlp to find the
- shell to exec our target program. This requires some fiddling
- with `environ' since there is no execlpe().
-
-Thu Aug 1 15:35:17 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
-
- * Makefile.in, doc/gdbrc.tex, doc/rc-* (new files):
- Minor rearrangement of refcard permits two new make targets--
- gdbrc.dvi DVI output for refcard, using CM fonts
- gdbrc.ps PostScript refcard, using PS fonts
-
-Wed Jul 31 16:46:21 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * GDB-3.98 release.
-
- * TODO, Projects, WHATS.NEW, README: Update for gdb-3.98.
- * Makefile.in (gdb-all.texinfo): Avoid touching file if M4 dies.
-
-Wed Jul 31 16:35:58 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
-
- * doc/gdb.texinfo: last changes for release.
- Minor typo and formatting fixes; incorporated most fixes remaining from
- filed mail commenting on earlier drafts.
-
- Added warnings: pipes don't work in run command;
- conditions are converse of assertions;
- step over fn without debug info goes to next fn;
- vars may have "wrong" values near fn entrance, exit
-
- Added example from Kingston on printing repeated nonadjacent values
-
- Added explicit mention that in Emacs gdb mode C-c and C-z are like
- shell mode for signals
-
- Renamed "Stepping and Continuing" to "Continuing and Stepping" so it
- doesn't sound so much like its parent "Stopping and Continuing"; also
- moved entries on continue to top of section, so they don't get lost.
-
- Improved installation directions in appendix, added manual formatting
- instructions
-
-Tue Jul 30 17:26:39 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * configure.in: Remove xm.h and tm.h even if we aren't linking
- new ones, so "./configure sun4; ./configure none" does the right
- thing. Assume that alldeps.mak and depend are already built in
- srcdir, and avoid running "make" (particularly "make depend",
- which involves "gcc") from inside configure. Build Makefile
- directly rather than building Makefile.conf first.
- * configure: Regenerate with above changes.
- * Makefile.in: Use $(BISON) to find bison. Roll VERSION
- to 3.98. Revise gdb.tar.Z procedure to produce a file
- called gdb-$(VERSION).tar.Z but which unpacks into a
- directory called "gdb". Move non-source files out of
- $(SFILES_SUBDIR). Pretty up alldeps.mak with comments.
- (depend): Don't try to do "gcc expread.y".
- (expread.o): Update dependencies by hand.
-
-Mon Jul 29 15:21:09 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
-
- * doc/gdb.texinfo:
- Fixed a variety of small typos that prevented info from formatting
- cleanly; altered too-long heading for GPL Appendix, as discussed
- w/RMS; Changed date on cover to July 91.
-
-Fri Jul 26 13:20:02 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
-
- * doc/gdb.texinfo:
- (1) Applied some fixes due to comments from Larry Breed (easier ones
- through chapsec 5.2)
- (2) Eliminated use of @footnote---had my doubts about it anyways, and
- it's broken in latest texinfo
- (3) Introduced *some* use of [] for optional arguments, where
- explanation is not simpler by listing cmd w arg and cmd w/out arg
- separately. Still not using @deffn.
- (4) Dropped in GPL-2. NOTE: one of GPL-2 or texinfo is broken; a
- couple of headings are too long. Need patches to texinfo or revision
- to GPL-2.
-
- * Partial update to README (which still needs work for this
- release!): (1) use of configure corrected for new script,
- (2) "make gdb.dvi" and "make gdb.info" mentioned.
-
-Wed Jul 24 06:44:02 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * symtab.c (lookup_symbol): Don't complain right off about
- no debug symbols; use the misc function vector first.
- (list_symbols): Use misc function vector to find symbols
- that don't have debug info, and print them.
- (find_pc_symtab): Temporarily avoid fatal() when psymtab
- PC range doesn't match symtab PC range, as it does on the
- MIPS because our symtab reading isn't perfect.
-
- * dbxread.c (dbx_symfile_read): Make warning about
- "no debug symbols" slightly nicer.
-
- * source.c (select_source_symtab): If "main" symbol exists,
- but decode_line_spec can't find line info, don't just return
- a zero; try other source symtabs or give an error.
-
- * mipsread.c (parse_partial_symbols): Sort the psymtabs by
- their low addresses first, then rip through fixing high addrs.
-
- * ns32k-opcode.h (sfsr): Bugfix from Rune Nerg}rd,
- <runene@ifi.uio.no>.
- (NS32K_SVC_IMMED_OPERANDS): Reverse the #ifndef.
-
-Tue Jul 23 18:52:43 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
-
- * Minor, mostly mechanical, cleanup of doc subdir for clean
- makeinfo'ing and TeXing; also ensured gdb-all.texinfo (post-m4)
- and gdb.info (post- texinfo2 makeinfo) generated for distribution.
-
-Sun Jul 21 03:54:52 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Mostly MIPS and general symbol-reading fixups.
-
- * doc/gdbint.texinfo: Add documentation on symbol-reading
- interface.
-
- * mipsread.c: Remove kludges around #include "ecoff.h".
- Remove redefinitions of a_magic, etc, no longer used.
- (parse_symbol, ): Convert "Internal:" printfs to complain()ts.
- Fix global overview comments to match symfile.c protocol.
- (mipscoff_new_init): Eliminate cur_hdr if we have one.
- (mipscoff_symfile_read): Eliminate unused code. Avoid
- sorting all the symtabs, when all we have read here is psymtabs.
- The symtabs are sorted as they are created anyway. Tell
- condense_misc_bunches whether we're mainline.
- (psymtab_to_symtab_1): Pass filename when recursing, to make
- stack trace more informative.
- (parse_partial_symbols): Assume cur_hdr as argument.
- (read_mips_symtab): Don't clobber cur_hdr, so it can be freed.
- Pass cur_hdr implicitly to parse_partial_symbols. Avoid checking
- the TYPE_NAME of char *, since that's done in symfile.c.
- (free_numargs, parse_symbol, add_symbol, add_block,
- shrink_linetable): Declare these fns void.
- (upgrade_type): Convert tree of if's to switch. Clean up
- bogus "off == 0" handling with a complaint. Avoid setting
- field bitpos and bitsize of array with lower and upper bounds.
- Check specified bitsize of elements against their actual type's
- bitsize, and complain if different. Complain about unknown
- type qualifiers.
- (parse_fdr): Don't assume sizeof(char *) == sizeof (struct *).
- (psymtab_to_symtab_1): Print names of subsidiary files that
- are being read in. FIXME, we read far too many files. This code
- is not the problem, the problem is in parse_fdr where the psymtabs
- are set up.
- (cross_ref): Result should indicate that we used one aux entry
- normally, or two if we encountered a "next" entry. This used
- to leave the caller pointing at the wrong aux entry.
- (add_symbol): If overflowed cur_block, reallocate it larger,
- chase all pointers to it, and complain(), rather than clobber memory.
- (shrink_block): Use xrealloc rather than xmalloc-and-copy.
- (new_field): Only allocate one field initially, not two.
- Pull ++ out of macro argument. Simplify.
- (_initialize_mipsread): Avoid initialization of importd
- global_psymbols and static_psymbols.
-
- * symfile.c (psymtab_to_symtab): Depend on XXX_psymtab_to_symtab
- to properly set pst->symtab; avoid searching for it.
- (symfile_fns): Improve comments, add a FIXME.
- * dbxread.c: Update comments to reflect symfile protocol.
- (read_ofile_symtab, end_symtab): Return the symtab.
- (psymtab_to_symtab_1): Set pst->symtab.
-
- * coffread.c (coff_symfile_read): tell condense_misc_bunches
- whether we're mainline.
-
- * symfile.h (sym_fns): Remove unused sym_discard member.
- * coffread.c, mipsread.c, dbxread.c: Remove XXX_symfile_discard.
-
- * mtrace.c (mtrace): Take effect if mallwatch is set, even if
- the environment variable is not.
- * infcmd.c (finish_command): Use filtered printfs.
- * cplus-dem.c: Add struct tags to a few unnamed structs.
- * valops.c (value_coerce_array): Improve comments.
- * valprint.c (type_print_varspec_suffix): Print array size only
- if greater than zero.
- * m88k-tdep.c: Shift some lines left by one space, that had
- apparently been trashed at some point.
- * TODO: More things to do, a few got done.
-
-Thu Jul 18 22:46:05 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * symtab.h (LOC_EXTERNAL): Eliminate in favor of LOC_STATIC.
- (ldsymoff, ldsymlen, globals_offset, statics_offset): Improve
- comments.
- * dbxread.c (read_dbx_symtab): LOC_EXTERNAL -> LOC_STATIC.
- * expread.y, findvar.c, symmisc.c: Ditto.
- * printcmd.c (address_info): Update printed forms of LOC_
- symbols. Elim LOC_EXTERNAL.
- (print_frame_args): Keep track of param stack offsets before
- re-looking up to find the local register param is kept in.
-
- * mipsread.c: Use <symconst.h> and <sym.h> rather than <syms.h>.
- Further integration of mipsread into gdb. Eliminate unused
- routines, duplicate declarations. Handle static symbols in
- psymtabs as well as external symbols. When reading symtabs,
- insert symbols into the correct block (global, static, or a local
- block).
- (read_mips_symtab, parse_partial_symbols): Don't pass useless
- "incremental" arg.
- (mipscoff_symfile_read): Don't call select_source_symtab.
- (parse_symbol): Use SYMBOL_VALUE_ADDRESS where appropriate,
- rather than SYMBOL_VALUE.
- (parse_external): Comment clobbering of top_stack.
- (parse_partial_symbols): Update comments. Allocate and parse
- static symbols as well as external symbols. FIXME, enum values
- are not handled in this pass, but should be. Inline new_psymbol.
- Use SYMBOL_VALUE_ADDRESS.
- (psymtab_to_symtab_1): Read symbols into global static block
- by default (until enter some function's local block context).
- (sort_blocks): Clean up STATIC_BLOCK as well as GLOBAL_BLOCK.
- (destroy_all_symtabs, new_psymbol): Eliminate, unused.
-
- * source.c (select_source_symtab): Select a source symtab
- from either the symtabs or, failing that, the psymtabs.
- (list_command): Update error message.
- (forward_search_command, reverse_search_command): Use getc, not
- fgetc, for speed. FIXME, add comment about buffers that die if
- overrun by long line.
-
- * values.c (unpack_field_as_long, modify_field): Avoid shifting
- by an entire word, which is not portable, if we have a 32-bit
- field. (Code in dbxread.c already turns such bitfields, if
- aligned, into ordinary ints, but fixing this will help for other
- symbol formats and for future changes.)
- * core.c (core_open): Handle ANSI const brain death.
- * utils.c (vprintf): Fix varargs typo.
-
-Sun Jul 14 00:42:53 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * findvar.c (find_var_value): Handle &function better.
- * TODO: Document work needed on &fn and &array.
- * printcmd.c (print_address_symbolic): New arg is the prefix
- to print if a name is printed.
- (print_address_demangle): Honor "set print address" now.
- Use new arg above to improve spacing of output.
- * valprint.c (val_print): When printing function pointers,
- print symbolic form too.
- * breakpoint.c (breakpoint_1): Use new print_address_symbolic.
-
-Mon Jul 8 19:02:46 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * core.c (memory_error): Reword error msg to mislead less.
-
- * mips-pinsn.c (print_insn_arg 'd'): Print $ with reg name.
-
- * mipsread.c (read_mips_symtab, read_the_mips_symtab,
- parse_partial_symbols): Use newer BFD internals (external_filehdr
- and external_aouthdr), byte-swap the fields that we care about
- before using them, and make the file header data local to
- read_the_mips_symtab rather than global.
-
-Sat Jul 6 01:34:15 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * ns32k-opcode.h (movmw, movmd): Fix opcodes. Bug fix
- from Rune Nerg}rd <runene@ifi.uio.no> on 5 Jul 1991.
-
- * main.c (command_line_input): Flush stdout and stderr
- before every call to readline. This reportedly fixes a bug
- that comes up in Sys V running emacs-gdb and/or xxgdb,
- when stdin/out are pipes or sockets.
-
-Thu Jul 4 14:47:06 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * configure.in, Makefile.in: Avoid rebuilding "depend" as much.
- Avoid declaring Makefile dependencies, because GNU Make stupidly
- tries to update it if we do.
-
- * coffread.c: Revise for minor changes to bfd internal coff
- indexes.
-
- * configure: If -template= is given a relative path, make it
- absolute before recurring in subdirectories.
-
- * configure, configure.in, Makefile.in: Install "configure" script
- as replacement for config.gdb.
- * config.gdb, Makefile.dist, Makefile.sdir: Remove
- * README: Update for configure, mostly. FIXME.
-
- * Add dec3100 as equivalent to littlemips. Indicate in all host &
- target config files that they are for the host. When the lines
- get copied into the Makefile, this makes it more obvious what's
- up.
-
-Mon Jun 24 23:49:07 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * sparc-opcode.h (trap opcodes): Avoid leading spaces or
- tabs, which end up in the disassembler output inadvertently.
-
-Wed May 29 23:01:03 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Make it compile cleanly in an ANSI GCC2 environment.
-
- * blockframe.c: <stdio.h>
- * cplus-dem.c: free takes a void *, ifdef __STDC__
- * dbxread.c (read_huge_number): avoid gcc2 bug hoisting calc of
- LONG_MAX/radix.
- * defs.h (alloca): Avoid doing anything if alloca already def'd.
- * stddef.h, stdlib.h: Remove these files.
- * symtab.c: Avoid declaring qsort, close.
- * symfile.c: Avoid declaring close.
- * utils.c (vprintf): Declare "ap" arg as proper va_alist.
- * sparc-tdep.c: Avoid including lots of Sun-host-specific files.
-
- Assorted other changes.
- * dbxread.c: include "libaout.h", not "liba.out.h".
- * printcmd.c (print_frame_args): Set recurse properly for
- indentation of struct and array parameters.
- * valops.c (value_cast): Allow cast to void.
- * infrun.c (resume): If NO_SINGLE_STEP, call machine dependent
- single_step() in a target-independent fashion.
- * sparc-tdep.c (single_step): Don't call ptrace ourselves, just
- set up to be ready to continue. This makes us target independent.
- * infptrace.c (child_resume): Remove call to single_step; now
- can single step a SPARC target of any kind.
-
-Wed May 22 18:18:24 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
-
- * Makefile.dist, doc/gdb.texinfo, doc/*-m4.texinfo: split up GDB
- docn into separate sections---basically chapters, plus two loose
- pieces that can be configured to go in different places. This
- allows GNU m4 to preprocess the manual without coredumping.
-
- * Makefile.dist: tell TeX where to find texinfo.
-
-Mon May 20 12:15:04 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
-
- * Makefile.dist, doc/gdb.texinfo: respectively create, and use,
- the new target "rdl-apps.texinfo" which captures the Makefile
- variable that records where to find the Readline libraries.
-
-Sun May 19 05:36:59 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * tahoe-pinsn.c: #include "tahoe-opcode.h", not "opcode.h".
- * tm-tahoe.h (FIX_CALL_DUMMY): Ignore more parameters.
- * defs.h (const, volatile): Only define if not already defined.
- * Makefile.dist (gdb.tar.Z): Create doc subdir w/out CVS/RCS crud.
-
- * README: Update for release 3.95.
- * config.gdb: Don't create readline dir in subdir builds.
- * main.c: Include with "..." form for non-system include files,
- so "gcc -MM" for "make depend" works.
- Include readline files with "...h" rather than <readline/...h>.
- * mipsread.c: Include "ecoff.h" rather than "intel-coff.h".
-
- * coffread.c: Undo minor damage done by Rich Pixley. Use
- different internal and external representations of COFF
- data structures. Use new BFD routines for swapping them in and
- out.
- * symfile.c (free_named_symtabs): Avoid freeing file names that
- are null or empty. Old i960 tools seem to produce files that
- claim to have empty names, causing each successive file read
- to blow away the previous one.
- * sparc-xdep.c (deferred_stores): Repair minor damage by Rich.
- Move deferred_stores to top of file, but don't separate its
- #define's from its variable. Add commentary.
- * Makefile.dist: Fix Rich damage; undo "configure" changes in
- favor of keeping the (working) config.gdb. Move readline
- library up a notch.
-
-Fri May 17 12:49:56 1991 Per Bothner (via gnu at cygint.cygnus.com)
-
- * dbxread.c (read_struct_type): Try to handle g++ version 1 MI
- debug info.
- * infptrace.c (fetch_registers): no result, since now void.
- * tconfig/news: target depends on m68k-tdep too.
-
-Fri May 17 14:40:14 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
-
- * Makefile.dist: added readline/inc-*.texinfo to dependencies for
- gdb.dvi target
-
- * readline/inc-history.texinfo, readline/inc-readline.texinfo:
- applied various small fixes due to or inspired by RMS comments
-
- * doc/gdb.texinfo: finished using all RMS comments, save those for
- appendices on readline and cmd history (which are in other source
- files)
-
-Thu May 16 18:06:05 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
-
- * doc/gdb.texinfo: (1) Updated w/ref to RMS comments through
- chapter 9; (2) documented 'break' command's menu mode for
- overloaded names, in response to hgs problem report C++ p-31
-
-Wed May 15 11:02:48 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
-
- * doc/gdb.texinfo: (1) better introductory example; (2) more
- consistent use of @code, @samp, @file, @kbd throughout; small
- cleanups to first three nodes; (3) new "Contributors" node;
- (4) Appendix, Renamed Commands; (5) divert specialized startup
- instructions to "Targets" chapter for generic manuals, while
- leaving them up front for manuals specific to specialized
- environments; (6) apply fixes from RMS comments through chapter 4.
-
- * pretex.m4: modify explanatory text slightly (and redefine
- "regexp") to keep GNU m4 from complaining. (It still crashes
- later, but one step at a time...)
-
-Wed May 15 10:32:12 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * readline/readline.c (update_line): Avoid dereferencing a pointer
- before comparing it to its bounds. Saber caught this.
- (init_terminal_io): Don't set BC from the "pc=" termcap variable,
- and only set PC if tgetstr returned non-null. Saber caught this.
-
-Tue May 14 16:29:53 PDT 1991 Roland Pesch (pesch at cygint.cygnus.com)
-
- * Makefile.dist: put gdb.dvi stuff (updated to use M4 preprocessor
- stuff for config manual) here where it counts; updated
- to use new subdir structure (gdb/doc/).
-
- * Makefile: generated from above via
- config.gdb none
- before checkin
-
- * gdbint.texinfo: added instructions on generating gdb.info* files
- locally for release. These are ordinary info
- files, formatted from gdb.texinfo (via gdb-all.texinfo, see
- Makefile)---but due to use of texinfo 2, can't count on makeinfo
- to generate these, so we distribute them already formatted.
-
- * gdb.texinfo: included full Info node and menu crud (as generated
- by C-u M-x texinfo-master-menu using the texinfo-2 elisp code).
-
- * Makefile: updated "gdb.dvi" target to use M4 preprocessor;
- put in comments-for-future gdb.info target (one day makeinfo will
- work again).
-
-Tue May 14 13:51:36 PDT 1991 Roland Pesch (pesch at cygint.cygnus.com)
-
- * gdb.texinfo: Updated to include new or old undocumented
- commands, at least the following (perhaps some others I forgot to
- record): info f, info float, info path, info program, info s, info
- set, info source, info terminal, info types, info user, set/show
- print object.
- Also covered all recent GDB command renames for v4.
-
-Mon May 13 14:57:46 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * mipsread.c: Rather than keeping count of how many symtabs
- and psymtabs we have, for sorting purposes, count them when
- we need to sort. This fixes bug in rereading of symbol tables.
-
-Fri May 10 15:43:33 PDT 1991 Roland Pesch (pesch at cygint.cygnus.com)
-
- * infcmd.c: renamed "info path" to "show paths"
- * gdbrc.tex: documented above.
-
-Wed May 8 04:51:11 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * remote.c: Fix comments.
- * utils.c (error): Force out any pending wrap output.
-
-Sat May 4 11:11:07 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * Makefile.dist: Roll VERSION to 3.95.
- Fix up "saber_gdb" to work again.
- * saber.suppress: Update.
-
- * coffread.c, exec.c, infptrace.c, inftarg.c, remote.c, solib.c,
- symtab.h, target.c, target.h: Lint.
- * core.c: setup and select frame after reading shared libs,
- else reading shared libs will clobber them. Lint.
- * utils.c (error): Force out any buffered wrap text.
-
-Fri May 3 22:01:56 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * remote.c: Remove decls of memory_insert_breakpoint
- and memory_remove_breakpoint, no longer used. (Suggestion of
- Jan Norden).
-
- * Makefile.dist: use ${subdir} in paths of BFD and LIBIBERTY,
- to make it easier to interface to "configure"'d libraries.
-
-Fri May 3 13:10:01 PDT 1991 Roland Pesch (pesch at fowanton.cygnus.com)
-
- * valprint.c: introduce "set p", "set pr", "show p" and "show pr" as
- aliases for set/show print.
-
-Thu May 2 11:22:02 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * coffread.c (coff_sym_fns) [TDESC]: Make the type be m88kbcs.
-
- * m88k-tdep.c (IEEE_isNAN): New function.
-
- * infrun.c, m88k-tdep.c, m88k-xdep.c: Change
- initialize_{tdesc,dcontext} to init_{tdesc,dcontext}.
-
- * infrun.c [TDESC]: Add a bunch of crud.
-
- * xm-88k.h [__GNUC__]: Don't define memset.
-
- * m88k-xdep.c: #if 0 out push_breakpoint.
-
- * tm-88k.h: Define GET_SAVED_REGISTER.
-
- * tm-88k.h: Define DGUX.
-
- * m88k-opcode.h (UEXT, SEXT, MAKE): Put parentheses around arguments.
-
- * m88k-pinsn.c (sprint_address): Declare at top of file.
-
- * m88k-xdep.c: #if 0 out core_file_command.
-
- * values.c ({unpack_,value_as_}pointer): Just call
- {unpack_,value_as_}long (for now anyway).
-
- * m88k-tdep.c (get_saved_register): Make get_reg a dc_word_t (*)().
- (psr_register): Change return type to dc_word_t.
-
- * m88k-tdep.c (tdesc_read_function): Comment out call to ptrace.
-
- * m88k-tdep.c (get_saved_register): Add lvalp parameter.
-
- * gdbcore.h (write_memory): Don't prototype it.
-
- * tm-88k.h, m88k-tdep.c: Make stack_error, stack_jmp global.
- m88k-xdep.c: Don't mention stack_error.
-
- * {x,t}config/m88k ({X,T}DEPFILES): Add missing files.
-
- * mtrace.c: Don't typedef things like size_t, just #define them.
-
- * coffread.c [TDESC]: #if 0 out references to coffsyn.
-
- * symtab.h (struct symtab): Include EXTRA_SYMTAB_INFO.
- tm-88k.h: Define EXTRA_SYMTAB_INFO.
-
- * coffread.c [TDESC]: Include "tdesc.h" and make tdesc_handle
- dc_dcontext_t not int.
-
- * coffread.c [TDESC]: Use system include files not <intel-coff.h>.
-
- * coffread.c [TDESC]: Move setting of debug_info from
- coff_symfile_read to find_linenos and make it work with BFD.
-
- * cplus-dem.c [__STDC__]: Make x{m,re}alloc return void*.
-
- * signame.c: Cast const char* to char* when assigning to sys_siglist.
-
- * utils.c (strsave): Make arg const char* not char*.
-
- * infrun.c (wait_for_inferior) [SHIFT_INSN_REGS]: Use
- bpstat_explains_signal (stop_bpstat) not stop_breakpoint.
-
- * tm-88k.h (START_INFERIOR_HOOK): Make tdesc_handle a dc_handle_t.
-
- * tm-88k.h (EXTRACT_RETURN_VALUE): Use char * not void *.
-
- * findvar.c (read_var_value, case LOC_CONST_BYTES): Put the address
- in a char *, not a CORE_ADDR. Use SYMBOL_VALUE_BYTES.
-
- * tm-88k.h (INIT_EXTRA_FRAME_INFO): Use fci not prev (fci is
- prev except from create_new_frame). Make next_frame a
- local variable.
- Declare get_prev_context.
- {x,t}m-88k.h: Enclose USG and BCS defines in #if !defined.
- m88k-{opcode.h,pinsn.c,xdep.c,tdep.c}: New files (same contents as
- before; they had just been left out of the distribution for a long
- time).
-
-Thu May 2 17:53:56 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Mips bringup and general cleanup
-
- * cplus-dem.c: Move CPLUS_MARKER define to after defs.h.
- * infptrace.c (PT_WRITE_D, PT_READ_D): Use correct values.
- (This still doesn't seem to make MIPS bkpts work.)
- * mipsread.c: Remove dup "Reading symbol data..." msg.
- (symbol_file_command, add_file_command): Remove, obsol.
- * printcmd.c (ptype_command): Say "an enum" rather than "a enum".
- Wrap output appropriately.
- * stack.c (locals_info, catch_info, args_info): Check
- selected_frame rather than target_has_stack or coredumping.
- * valprint.c (type_print_varspec_suffix): Wrap "ptype" output of
- enums appropriately.
-
-Wed May 1 14:10:22 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * signame.c: Include defs.h and param.h.
-
- * cplus-dem.c: Include defs.h and param.h.
- Makefile.dist: Don't hack in the "param.h".
- param.h: Don't include defs.h.
-
- * expread.y: Use a union to deal with the fact that type_stack
- can have both ints and enum type_pieces in it.
- ({push,pop}_type_int): New functions.
-
-Tue Apr 30 13:18:58 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * cplus-dem.c (cplus_mangle_opname): Don't call error.
- values.c (check_stub_method): Call error if NULL return from
- cplus_mangle_opname.
-
- * blockframe.c, breakpoint.c, core.c, command.c, findvar.c,
- eval.c, expprint.c, infcmd.c, infrun.c, main.c, printcmd.c,
- remote.c, source.c, stack.c, dbxread.c, coffread.c, symfile.h,
- symfile.c, utils.c, valarith.c, values.c, valops.c, tm-68k.h,
- target.c, inftarg.c, ieee-float.c, environ.c, defs.h,
- command.h, inferior.h, gdbcore.h, symtab.h, expression.h,
- symtab.c, cplus-dem.c, value.h, expread.y, valprint.c,
- copying.awk, solib.c, inflow.c, symmisc.c
- : Lint. Use read_memory not read_memory_integer on CORE_ADDR's.
- Use {value_as,unpack}_pointer (added to values.c)
- not {value_as,unpack}_long on CORE_ADDR's.
- Use longest_to_int (added to defs.h) instead of cast to int.
- Remove from_tty arg to mod_path.
- Put symfile_bfd in {coff,dbx}read.c not symfile.h.
- Use OP_NULL instead of 0 where dummy enum exp_opcode needed.
-
- * tm-sparc.h: Remove GET_RWINDOW_REG.
- (FRAME_CHAIN): Call sparc_frame_chain.
- sparc-tdep.c (sparc_frame_chain): New function.
- tm-sparc.h (EXTRACT_STRUCT_VALUE_ADDRESS): call
- sparc_extract_struct_value_address (added to sparc-tdep.c).
-
- * xm-sun386.h: Don't define SET_STACK_LIMIT_HUGE.
-
-Tue Apr 30 13:13:33 1991 Michael Tiemann (tiemann at cygint.cygnus.com)
-
- * valprint.c (type_print_base): If the type being printed is a
- struct containing undefined types, print "<undefine type>"
- as the type instead of crashing.
- * values.c (value_headof): Get the vtable pointer taking
- TYPE_VPTR_BASETYPE into account.
- * symtab.c, symtab.h, dbxread.c: Fix various whitespace splotches.
-
-Mon Apr 29 13:22:51 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * Move BROKEN_LARGE_ALLOCA from tm-sun386.h to xm-sun386.h.
-
- * sun386-xdep.c [!GDB_TARGET_IS_SUN386]: Just provide empty
- functions which don't do anything.
- tm-sun386.h: Define GDB_TARGET_IS_SUN386.
-
- * Makefile.dist: Add comment about tm-sun3os4.h: tm-sun3.h, etc.
-
- * sun3-xdep.c, tm-sun3.h, tm-68k.h: Change TARGET_SUN3 to
- GDB_TARGET_IS_SUN3.
-
- * infrun.c: Don't include sys/user.h and friends (wrong for
- cross-debugging and not necessary anymore (see IN_SIGTRAMP in
- xm-vax.h)).
- [SET_STACK_LIMIT_HUGE]: Include <sys/{resource,time}.h>.
- xm-tahoe.h: Don't define _DIRENT_.
-
- * xm-tahoe.h: Remove USE_OLD_TTY (not needed now that terminal.h
- includes sgtty.h before sys/ioctl.h).
-
-Sun Apr 28 22:04:47 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * param-no-tm.h: Make BITS_BIG_ENDIAN defined to 0/1, not defined
- or not defined. Don't define it based on TARGET_BYTE_ORDER if
- it's already defined (in the tm.h file).
- mips-opcode.h (BIT_FIELDS_*),
- values.c (modify_field, unpack_field_as_long):
- Use #if BITS_BIG_ENDIAN not #ifdef BITS_BIG_ENDIAN.
- {x,t}m-tahoe.h, tahoe-pinsn.c, tahoe-opcode.h: New files.
-
-Fri Apr 26 12:02:06 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * tm-sparc.h: Add comments about gcc version 2 and structure passing.
-
- * xconfig/i386v{,32}{,-g}: Add XM_CFLAGS=-Dgetpagesize()=4096.
- gmalloc.c: #if 0 out !HAVE_GETPAGESIZE code.
-
- * expread.y (abs_decl): Accept '&' and '&' abs_decl.
-
- * symtab.c, symtab.h: Have a builtin_type_{,unsigned_}long_long
- regardless of LONG_LONG.
- defs.h (TARGET_LONG_LONG_BIT): New macro.
- expread.y (typebase): Add {unsigned,} long long {,int}.
-
-Thu Apr 25 12:31:22 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * valops.c (typecmp): If t2 == 0, return 1.
-
-Wed Apr 24 09:45:17 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
- Changes from Tiemann:
- * cplus-dem.c (optable): Add "nw", "dl", "compound".
- (cplus_mangle_opname): New function.
- (do_type): Add case 'Q'.
- * values.c (check_stub_method): Do lookup_method_type and stuff
- rather than smash_to_method_type.
- symtab.c, symtab.h (allocate_stub_method): New function.
- dbxread.c (read_type): If we get "##", don't lookup_function_type
- and start clobbering it; allocate_stub_method instead.
- * printcmd.c (x_command): Dereference references.
- * valprint.c (type_print_varspec_prefix, case TYPE_CODE_METHOD):
- Don't print " " type_print_base (...) "::" if !passed_a_ptr.
- * dbxread.c (read_struct_type): Put "op$" instead of "operator"
- in the symbol table.
- * values.c (check_stub_method): Deal with operator names.
- * valprint.c (cplus_val_print): Check for error in baseclass_addr.
- * values.c: Move declaration of cplus_demangle to top of file.
- * values.c (baseclass_addr): If can't read memory, set *ERRP
- rather than calling error().
- * value.h: Remove redundant declaration of value_static_field.
- * values.c (value_static_field): Recursively check all baseclasses.
- Return NULL if not found.
- * values.c, value.h: New functions value_{headof,from_vtable_info}.
- * valprint.c (val_print): Print out first element of vtbl
- specially.
- * valprint.c: Move print controls to top and add objectprint.
- Add command "set print object on/off".
- * valprint.c (value_print, is_vtbl_member): Put things in local
- variables rather than continually doing VALUE_TYPE (val), etc.
- * valops.c (value_struct_elt_for_address): Call check_stub_method.
- * valops.c (value_struct_elt): Remove found, arg1_as_ptr.
- * valops.c (search_struct_method): Give error if j > 0 && args == 0.
- * valops.c (search_struct_field): New argument looking_for_baseclass.
- Give error if value_static_field or value_primitive_field
- return NULL.
- valops.c (various): Call search_struct_field with extra parameter.
- * symtab.c (decode_line_1): Deal with operators specified as
- "operator" <optional whitespace> <symbols for operator>.
- (operator_chars): Help do it.
- * symtab.c (lookup_struct_elt_type): Call check_stub_type.
- Take additional argument noerr.
- Don't dump core if TYPE_FIELD_NAME is NULL.
- Check the baseclasses recursively.
- * symfile.c (fill_in_vptr_fieldno): Don't call check_stub_type.
- Return void not int. (also declarations in symfile.h and value.h).
- Deal with multiple inheritance.
- * printcmd.c (print_command_1): Add if (objectprint) code.
- * expread.y (variable): Allow for destructor with foo::~name.
- * eval.c (evaluate_subexp, case UNOP_LOGNOT): If following opcode
- is OP_SCOPE, give an error.
- * eval.c (evaluate_subexp): Pass third arg to lookup_struct_elt_type.
- * eval.c (evaluate_subexp), values.c (value_virtual_fn_field):
- Don't bother to do anything with
- return value from fill_in_vptr_fieldno.
- * eval.c (evaluate_subexp): If value_static_field returns NULL,
- give an error.
- * dbxread.c (read_struct_type): Set fcontext to 0 for normal member
- function.
- * dbxread.c (read_struct_type): Initialize name to 0.
- * dbxread.c (read_ofile_symtab, N_CATCH): Add offset to bufp->n_value.
- * dbxread.c (dbx_create_type): Zero TYPE_VPTR_BASETYPE.
- (read_struct_type): Don't bother to set TYPE_VTPR_{BASETYPE,FIELDNO}
- if it's just going to be {0,1}.
-
- * dbxread.c (virtual_context): Use TYPE_BASECLASS starting at 0
- (yes, it's #if 0, but just in case...).
-
- * vax-opcode.h, expread.y, expprint.c, cplus-dem.c: Declare some
- things "const".
-
- * i386-stub.c: New file.
-
- * WHATS.NEW: Remove mention of readline and more paging (in 3.5).
- Try to keep command names up to date with renaming.
-
- * gmalloc.c [!HAVE_GETPAGESIZE]: Try to figure out the pagesize.
-
- * infun.c (resume, resume_cleanups): New functions.
- (wait_for_inferior, proceed, child_create_inferior): Use resume
- not target_resume.
-
- * remote.c (getpkt): Don't set immediate_quit.
-
- * blockframe.c, frame.h (reinit_frame_cache): New function.
- solib.c (solib_add), symfile.c ({,add_}symbol_file_command):
- Use it.
-
-Tue Apr 23 10:38:41 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * symtab.c (lookup_symbol): Add 3 more of those loops through
- the symtabs which we all know and love: (1) Look in the
- STATIC_BLOCK for mangled symbols right after we check the blocks,
- (2, 3) Look in the STATIC_BLOCK for all the symtabs and psymtabs
- at the end.
-
- * main.c (cd_command): Call dont_repeat.
-
- * dbxread.c (read_struct_type): If const/volatile character is
- missing, don't complain, just continue.
-
- * dbxread.c (read_struct_type): Only try to read the fcontext if
- it is there. Also change "error_type " to "return error_type ".
- values.c (value_virtual_fn_field): If there is no fcontext,
- then do things the way GDB 3.x did.
- valops.c (search_struct_method): Add type to value_virtual_fn_field
- arguments.
-
- * dbxread.c (read_struct_type): Fix typo: *pp != '\0' -> **pp != '\0'.
-
-Mon Apr 22 00:02:43 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * printcmd.c (print_scalar_formatted): Add 't' for binary.
-
- * dbxread.c (end_psymtab): Initialize pst->symtab.
-
- * core.c (core_open): Call ADD_SOLIB.
-
- * tm-sparc.h: Include <sun4/reg.h> not <machine/reg.h>.
- sparc-tdep.c: Don't include <machine/reg.h>.
-
- * sun3-xdep.c [!TARGET_SUN3]: Just provide empty functions which
- don't do anything.
-
- * core.c (core_open): Add make_cleanup (unpush_target, &core_ops).
-
- * Shared library/corefile changes from Peter Schauer:
- core.c (core_close): Call CLEAR_SOLIB.
- (core_open): Remove comment about "should deal with shared lib".
- (core_xfer_memory): If we can't xfer the usual way, try the
- shared libraries.
- solib.c (so_list): New fields so_bfd and so_sections{,_end}.
- (find_solib): Use solib_map_sections to get ld_text.
- (solib_map_sections, solib_xfer_memory): New functions.
- (clear_solib): Free so_sections and close so_bfd.
- tm-sunos.h: Add solib_xfer_memory, solib_add.
-
- * sparc-tdep.c (skip_prologue): Don't skip anything unless there
- is a "save" instruction in there somewhere.
-
- * symfile.c (symbol_file_add): Add comment.
- solib.c (solib_add): Don't malloc name passed to symbol_file_add.
-
- * exec.c (build_section_table): If *start isn't NULL, free it.
-
- * stack.c (parse_frame_specification): Error if NULL selected_frame.
- infcmd.c (finish_command): Error if NULL selected_frame.
- inflow.c (kill_command): Deal with NULL selected_frame.
- stack.c (record_selected_frame): Set *FRAMEP to NULL if there
- is no selected frame.
- infrun.c (restore_inferior_status): Add comment.
- findvar.c (read_var_value): Check for NULL frame where we need
- a frame.
- breakpoint.c (get_catch_sals): Check for NULL selected_frame.
-
- * breakpoint.c (bpstat_print): Try all elements on the bpstat
- chain before giving up with an internal error.
-
-Sun Apr 21 21:43:10 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * value.h, values.c (value_{,free_to_}mark): New functions.
- breakpoint.c (bpstat_stop_status): Use them.
-
- * tm-i386v{,-g}.h: Remove N_SET_MAGIC define.
-
-Sat Apr 20 21:42:47 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * i386-tdep.c: Remove unnecessary #includes.
-
- * symtab.c (various): Change error return of find_line_common to -1.
-
- * coffread.c (find_linenos): Use LINESZ not sizeof (struct lineno).
-
- * coffread.c (end_symtab): Initialize language, dirname, and
- fullname fields.
-
-Fri Apr 19 18:18:31 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * mips-tdep.c (mips_frame_chain): Don't chain if saved_pc == 0.
-
- * stddef.h (size_t): Let either _SIZE_T or _SIZE_T_ guard it.
-
- * mipsread.c (parse_symbol): Set startup_file_{start,end} if
- entry_point is in current file.
-
- * findvar.c (read_register_gen): Add "target byte-order" comment.
-
-Wed Apr 17 17:09:48 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * i386-tdep.c (i386_get_frame_setup): Use SWAP_TARGET_AND_HOST
- before returning locals or slocals.
-
- * i386-tdep.c (i386_follow_jump): Do not add data16 to pos in
- call to codestream_seek; add one to pos if (and only if)
- we are dealing with a jump with data16 == 1 (i.e. 0x66, 0xe9).
-
-Mon Apr 15 12:04:32 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * valops.c (call_function_by_hand): Put dummy1 in target order
- before FIX_CALL_DUMMY.
-
- * tm-i386v.h (FIX_CALL_DUMMY): Don't depend on host byte order.
-
-Sun Apr 14 11:55:19 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * valops.c (push_word): Add SWAP_TARGET_AND_HOST.
-
- * remote.c (remote_open): Send '+' before calling putpkt().
-
- * tm-i386v.h (REGISTER_VIRTUAL_TYPE): Return pointer to void,
- not int, for pc, fp, and sp.
-
- * remote.c (remote_open): Call start_remote after putpkt("?");
- infrun.c (start_remote): Also call wait_for_inferior & normal_stop.
-
-Sat Apr 13 22:11:42 1991 Jim Kingdon (kingdon at spiff.cygnus.com)
-
- * exec.c: Include <ctype.h>.
-
- * sun3-xdep.c (fetch_core_registers): Add #ifdef FP0_REGNUM.
-
-Fri Apr 19 09:36:50 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * tm-68k.h (NUM_REGS): Conditionalize on TARGET_SUN3 not sun.
- tm-sun3.h: Define TARGET_SUN3.
-
- * utils.c: Use CPLUS_MARKER not '$'.
-
- * cplus-dem.c: Use CPLUS_MARKER not '$'. If CPLUS_MARKER isn't
- defined, define it to '$'.
-
- * arm-opcode.h: New file (same contents as before; it had
- just been left out of the distribution for a long time).
-
- * tm-68k.h: Put declaration of ext_format_68881 outside the macros.
-
- * main.c: New HAVE_SIGSETMASK #ifdefs.
-
- * coffread.c (read_coff_symtab): Check for "LF%" with all the
- other L*% things.
-
- * coffread.c (SDB_TYPE): New macro.
- various: Use it instead of checking against T_NULL.
-
- * Makefile.dist (cplus-dem.o): Hack in an #include "param.h"
- before we compile it.
- defs.h: Protect against multiple inclusion.
- param.h: Include defs.h.
- signame.c: Change #ifdef SYS_SIGLIST_MISSING to #if.
- param-no-tm.h: Define SYS_SIGLIST_MISSING from USG.
-
-Thu Apr 18 19:49:10 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * i386-pinsn.c (OP_E): Change %d to 0x%x for consistency.
-
- * putenv.c: New file
- Makefile.dist: Add it to $(OBS).
-
- * mipsread.c [!CMUCS]: #include <syms.h>.
-
- * mips-xdep.c (fetch_core_registers): #if 0 out the whole function.
-
- * Move read_memory_nobpt from mem-break.c to breakpoint.c.
-
-Mon Apr 15 21:45:35 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * utils.c (_initialize_utils): Rename "set demangle" to
- "set print demangle", "set asm-demangle" to "set print
- asm-demangle" and "set sevenbit-strings" to "set print
- sevenbit-strings".
-
- * main.c (initialize_main): Rename "set history write" to
- "set history save".
-
- * main.c (initialize_main): Rename "set caution" to
- "set confirm".
-
- * values.c (_initialize_values): Remove "info history" alias
- for (what is now) "show values".
-
- * infcmd.c, gdbcmd.h: Add unsetlist.
- infcmd.c: Add unset_command.
- (_initialize_infcmd): Add "unset" and use it for "unset env".
-
- * breakpoint.c (_initialize_breakpoint): Remove "unset".
-
- * valprint.c: Add "set/show print", {set,show}_print.
- Rename "set addressprint" to "set print address".
- Rename "set arrayprint" to "set print array".
- Rename "set array-max" to "set print elements".
- Rename "set prettyprint" to "set print pretty".
- Rename "set unionprint" to "set print union".
- Rename "set vtblprint" to "set print vtbl".
-
- * main.c: Rename version_info to show_version.
- (_initialize_main): Rename "info version" to "show version".
-
- * values.c: Rename value_history_info to show_values.
- (_initialize_values): Rename "info values" to "show values".
-
-Sun Apr 14 23:08:34 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * inftarg.c (child_open), remote-vx{,.68}.c (vx_proc_open):
- New function to give correct error message.
-
-Thu Apr 11 17:19:41 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * target.h: Add to_doc and target_preopen.
- target.c: Add target_preopen and target_command.
- Remove target_info.
- (add_target): Call add_cmd and mess with targetlist->doc.
- core.c, exec.c, remote-eb.c, remote-nindy.c, remote-vx.c,
- remote-vx.68.c, inftarg.c, remote.c: Add doc field to target struct.
- Call target_preopen from open routine.
-
- * main.c: Rename editing_info to show_commands.
- (_initialize_main): Rename "info editing" to "show commands".
-
- * source.c: Rename directories_info to show_directories.
- (_initialize_values): Rename "info directories" to "show directories".
-
- * values.c: Rename convenience_info to show_convenience.
- (_initialize_values): Rename "info convenience" to "show convenience".
-
- * copying.awk (_initialize_copying): Rename "info copying" to
- "show copying" and "info warranty" to "show warranty".
- Rename {copying,warranty}_info to show_{copying,warranty}.
-
- * symfile.c: Rename add_syms_command to add_symbol_file_command.
- (_initialize_symfile, add_syms_addr_command):
- Rename add-syms to add-symbol-file.
-
-Thu Apr 18 18:08:30 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * symfile.h (free_named_symtabs): Rename from free_named_symtab.
- * symfile.c (clear_symtab_users_once, cashier_psymtab,
- free_named_symtabs): Move these routines from symmisc.c.
- * symmisc.c (same): same.
- (free_symtab): Make non-static.
- * symtab.h (free_symtab): Declare as exported void fn now.
- * dbxread.c (end_symtab, end_psymtab): Change comments.
- (initialize_dbxread): Call dbx_new_init() in case the first
- command is add-symbols.
- * target.c (dummy_target): Permit add_syms_addr_command.
-
-Sat Apr 13 14:46:07 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Permit symbols to be superseded when new symbol files have
- been read in, particularly for VxWorks.
-
- * dbxread.c (read_dbx_symtab): Allow N_SOL to cleanly take us back
- to the main file, as well as to include files. Also, put global
- functions into the global psymtab, to make "i fun" work.
- (end_psymtab): Free named symtabs and psymtabs for a file, once a
- new psymtab for it has been read.
- * coffread.c (end_psymtab): Free named symtabs and psymtabs for
- a file, once a new symtab has been read for it.
- * mipsread.c: FIXME. We need to do the same for MIPS, but it
- looks harder to determine the top-level block before it's been
- queued to the psymtab list.
-
- * symfile.c (symbol_file_add): Use filtered printing and wrap it.
- If we have wiped out any old symbol tables, clean up at end of
- symbol reading.
- (symbol_file_command): Don't reference symfile_fns if it's zero.
-
- * symtab.h (GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK): New
- defines for the blocks of a blockvector that contain global and
- file-static symbols and the first of the smaller scope contours.
- * symtab.c (lookup_symbol, find_pc_symtab, find_pc_line,
- decode_line_1, make_symbol_completion_list): Use the above.
- * coffread.c (end_symtab, patch_opaque_types): Ditto.
- * dbxread.c (end_symtab): Ditto.
- * expread.y (block): Ditto.
- * mipsread.c (throughout): Ditto.
- * symmisc.c (free_named_symtabs): Ditto.
-
- * symtab.c (list_symbols): Process the first symbol of the
- static psymbols list.
- (types_info): Restore this function from its untimely #if 0.
- It's not perfect, but it is better than nothing.
- (_initialize_symtab): Restore "info types".
-
-Thu Apr 11 05:23:19 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * m68k-stub.c: Remote stub for 680x0's, created from
- rem-m68k.shar (which is removed).
- * nindy-share/{Makefile,Onindy.c,blout.h,env.h,nindy.c,ttyflush.c}:
- Remove RCS log stuff now that we use CVS and it blows our diffs.
-
-Wed Apr 10 14:18:06 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * symmisc.c (free_named_symtab): Make it work, in its current
- kludgy fashion. Change result to indicate if we blew away bkpts.
- * dbxread.c (end_symtab): Accumulate result from
- free_named_symtab and print warning if we blew user's state.
- * symfile.h: free_named_symtab now returns an int.
-
-Mon Apr 8 23:57:43 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * dbxread.c (dbx_symfile_read): Initialize psymbol list if this
- is the first symbol read, even if not mainline.
- (dbx_psymtab_to_symtab): symfile might be zero, cope.
- * exec.c (exec_ops): Add_syms_addr is valid in our tvec.
- (set_section_command): New command ("section xxx yyy" -- should
- be renamed to "set section xxx yyy" FIXME) which sets the
- base address of a section of the exec file, overriding the
- virtual address that BFD reports.
-
-Fri Apr 5 17:14:39 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * exec.c: Add add_syms_addr_command to exec_ops, so you can
- load symbols at any address while examining an exec file.
-
-Thu Apr 4 10:09:35 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * tm-i386v.h (FLOAT_INFO): Don't define it, since the code
- for printing the float info is host-dependent, not
- target-dependent. FIXME.
- * i386-pinsn.c: Move #includes to top, remove useless ones.
- * i386-tdep.c: Don't bother including <.../reg.h> since we
- don't use it (and it doesn't exist on host systems).
-
- * ieee-float.c (ieee_extended_to_double): Convert NaN to Inf.
- Convert negative numbers properly.
- (ieee_test): Make numbers really random; fix format arg.
-
- * infcmd.c (attach_command, detach_command): Don't repeat on CR.
- * core.c (core_detach): Unpush core_ops, which might not be on
- top. We used to just pop the top, which broke things. Don't
- need dont_repeat() any more.
- (core_file_command): Psst! Don't repeat it.
- * remote-nindy.c (nindy_detach): Don't need dont_repeat() now.
- * expprint.c (print_subexp): Avoid switch fallthru on
- BINOP_ASSIGN_MODIFY, so we can print += and such.
- * frame.h: Fix typo.
- * inflow.c (kill_command): After killing inferior, print our
- current frame in the core file, if we have one.
- (generic_mourn_inferior): When inferior dies, either select
- the current frame (in the new target, e.g. core file), or
- set both the current and selected frames to NULL.
-
- Changes from Peter Schauer.
-
- * infptrace.c: Avoid <sys/ptrace.h> on USG.
-
- * Make all file names fit in 14 characters (sigh and damn!):
- mv hp300hpux-xdep.c hp300ux-xdep.c
- mv symmetry-xdep.c symm-xdep.c
- mv symmetry-tdep.c symm-tdep.c
- mv convex-opcode.h convx-opcode.h
- mv tm-vxworks960.h tm-vx960.h
- mv tm-vxworks68.h tm-vx68.h
- mv Makefile.srcdir Makefile.sdir
- mv gdb-int.texinfo gdbint.texinfo
- mv remote-sa.m68k.shar rem-m68k.shar
- mv remote-multi.shar rem-multi.shar
- * Makefile.dist, README, config.gdb, convex-pinsn.c,
- tconfig/symmetry, tconfig/vxworks960, tconfig/vxworks68,
- xconfig/hp300hpux, xconfig/symmetry: Change names to shorter
- names.
-
- * command.c (user_info_1, user_info): New command for listing
- the user-defined commands.
-
-Wed Apr 3 15:00:26 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * dbxread.c (really_free_pendings): Clear file_symbols
- and global_symbols after freeing them; otherwise, running
- this function twice (if it appears twice on the cleanup
- chain), we try to free things twice.
-
- * dbxread.c (read_dbx_symtab): Calculate end_of_text_addr
- based on text_addr (the address of text in core), not on addr (the
- offset between text in the .o file and in core). This change
- is from Peter Schauer.
-
- * main.c: Define ALL_CLEANUPS as a cast of zero.
- (return_to_top_level): Use it.
- (main): Do all cleanups after each command run as part
- of the gdb startup sequence. Also do all cleanups before
- entering the command loop, and every time we exit the command
- loop and reenter. Before, the cleanups from the startup sequence
- were being left undone until the first error!
- (command_loop): Rename do_nothing cleanup to command_loop_marker
- so we can see it easily when examining the cleanup chain.
- (init_signals): Add another do_nothing for signal handling.
- (quit_command): Only try to kill target if it has execution.
- Problems in the target stack got us into a state where
- inferior_pid was nonzero but none of the targets had execution.
- In this state you couldn't exit gdb.
-
- * dbxread.c: Two changes from Peter Schauer.
- (echo_command): Fflush output after an echo command.
- (show_history): Pass all args to cmd_show_list.
-
- * utils.c (init_malloc): Call mtrace to turn on tracing
- if the environment variable MALLOC_TRACE is set to a file name.
- * mtrace.c: Add source file which provides a log of every malloc,
- free, and realloc to a trace file.
- * mtrace.awk: Add source file which analyzes the trace file.
- * Makefile.dist (GNU_MALLOC, MALLOCSRC): Add mtrace.{c,o,awk}.
- (VERSION): Roll to 3.94.3.
-
- * breakpoint.c (breakpoint_1): Add a space to "i watch" output.
- (check_duplicates): Don't bother with watchpoints.
- (set_raw_breakpoint): Comment about danger of this routine.
- (watch_command): Parse and eval all args before calling
- set_raw_breakpoint.
-
- * solib.c (find_solib): Avoid error in referencing memory to
- see if any more shared libraries have been added. This is
- particularly useful if the target has terminated. Bug reported
- by Peter Schauer.
-
- Changes from Peter Schauer <pesrem@regent.e-technik.tu-muenchen.de>
- in bringing up 3.94.2 on the Sun-3.
-
- * Makefile.dist: Include CFLAGS in rule for cplus-dem.o.
- * breakpoint.c (enable_breakpoint): Check for valid watchpoint
- expression (in scope) before reenabling watchpoint.
- * signame.c (init_sigs): Add missing declaration of i, fix
- sys_siglist declaration.
- * source.c (list_command): Fixed range computation to use
- lines_to_list ().
- * stack.c (backtrace_command): Do not allow command if target has
- no stack, print informative error message.
- * target.c (target_command): Do not write into command line
- because this fails if the target command is used in a user defined
- command. [This change was enhanced by gnu to support any-
- unique-prefix matching on target names.]
- * valops.c (value_struct_elt): Avoid infinite loop on an
- erroneous attempt to print the member of function (try p main.p).
-
-Mon Apr 1 17:05:45 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * expread.y (name_no_typename): Avoid reduce/reduce errors
- caused by ambiguity in handling NAME_OR_INT and NAME_OR_UINT.
- Since the GDB parser really doesn't use name_no_typename in a
- name-only context, the parser can't tell the diff between
- names and numbers here. Avoid allowing a name_no_typename
- to be a NAME_OR_*INT to resolve the conflict.
-
-Sun Mar 31 20:12:07 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Bugfixes from Mark Fox (markf@wrs.com) (test=testField.c):
-
- * valprint.c (val_print_fields): bitfield printing didn't handle
- byte order. Indirect through a few more fns to cope.
-
- * values.c (modify_field): also cope with byte order.
-
-Sat Mar 23 10:02:21 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Cleanup for release 3.94.2:
-
- * Makefile.dist: Pull REMOTE_OBS. Fix saber includes for BFD
- include files. Roll version to 3.94.2.
-
- * coffread.c (init_stringtab): Read length into unsigned char
- array before swapping; don't assume 32-bit longs.
-
- * target.c (target_info): Don't bother with get_sym_file, just use
- the symfile global variable.
- * symtab.h, symfile.c (get_sym_file): Delete it.
-
- * dbxread.c (dbx_symfile_init): Don't depend on long == 4 bytes.
- (define_symbol): Set symbol line number to 0 if not gcc-compiled.
- (read_type): Replace one more error() with complain().
-
- * mipsread.c (parse_partial_symbols): Replace printf with complain.
-
- * i960-tdep.c: Fix copyright attribution.
-
- * config.gdb: Quote all backquotes in doublequotes. You can
- quote me on that. BSD 4.4 shell found this one.
-
- * infptrace.c (throughout): The third argument to ptrace is an
- int *, not an int.
-
- * infrun.c (wait_for_inferior): When program has terminated, we
- have to call target_terminal_ours before we pop that target off
- the stack (e.g. before a call to target_kill or
- target_mourn_inferior). This fixes problem where a program
- terminates, then GDB stops for (tty output) and you have to type
- "fg" to the shell to resume it. FIXME: This code for what to
- do after termination really should be in normal_stop instead.
-
- * gdbcore.h (read_memory_check): Change declaration; it changed
- names months ago.
-
- * terminal.h: Include <sgtty.h> before <sys/ioctl.h>, since in BSD
- 4.4 prereleases, this avoids a bug in their sgtty compatability
- support.
- * remote.c: Use terminal.h rather than hand-rolling the same.
-
- * signame.c, signame.h (psignal): Arg is unsigned, not int.
- * utils.c (strsave, strstr): Fix arg types.
- * valprint.c (val_print): lint
-
- MIPS symbol table support from Per Bothner:
-
- * symfile.c (symtab_fns): Remove initializer table that needs to
- be hacked for each new symbol file format supported.
- (add_symtab_fns): New function, chains symbol table
- handlers into the global list.
- (symfile_init): Search this list.
- * symfile.h: Add next pointer, declare add_symtab_fns.
- * coffread.c (_initialize_coffread): Call add_symtab_fns.
- * dbxread.c (_initialize_dbxread): Call add_symtab_fns.
-
- * mipsread.c (psymtab_to_symtab_1): return void instead of (struct
- symbol *). Thus, we no longer need the hack to trash
- pst->filename. Good, since that hack confused code in symfile.c!
-
- (reorder_symtabs, destroy_all_symtabs): Removed static
- all_symtabs, which was used to qsort symtabs in reorder_symtabs.
- Instead, the latter now uses a temporary array (stack-allocated
- from an obstack, and then freed).
-
- (parse_symbol): Added a hack to fix up BLOCK_{START,END} if they
- haven't been set in the outermost stBlock of a procedure. This was
- a problem with f77 binaries on Ultrix 4.?.
-
- (new_symtab, new_symbol, new_type): Continue changing code to use
- obstacks more and otherwise conform to dbxread internal style.
- Made the free_code of symtabs be free_linetable (as in dbxread)
- instead of free_contents. This implies memory leaks when reading
- a new symbol table, until the conversion is finished. Did change
- (struct symbol) and (struct type) to be allocated on the
- symbol_obstack. Blocks and blockvectors are among the things
- still "leaking."
-
- * mipsread.c (parse_partial_symbols, parse_fdr): It hasn't been
- tested much, but it solved one problem (reported by Meissner), and
- cleans up some other things. The problem happened when an
- included file contains actual code (functions) and not just
- definitions. The mips coff is a little inconvenient there, since
- it may cause a procedure to be mapped to the wrong psymtab.
-
- * mips-tdep.c (heuristic_proc_desc): Minor cleanup.
- * mips-xdep.c (fetch_core_registers): Minor cleanup. FIXME,
- this will need work for the new core paradigm.
-
- Opcode patches from the net:
-
- * mips-opcode.h: fix incorrect disassembly of the mfc1, cfc1, and
- ctc1 instructions. Also, the cvt.d.w and cvt.s.w instructions were
- missing altogether - they are added here. From Bruce Bauman.
- * mips-opcode.h: The low mask for C0 instructions was too small.
- From Garrett Lau. I modified the fix to check the entire 32-bit
- opcode.
-
- * ns32k-opcode.h: Fix opcodes for deiw and deid. From Bruce
- Bauman.
-
-Thu Mar 21 12:56:46 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Roll in changes from Per Bothner (Tue, 25 Sep 90 11:11:04):
-
- * dbxread.c (read_type): Pointer subtraction (value_sub in
- valarith.c) sometimes failed because the types of the
- pointers being subtracted were not identical.
- These differed because dbxread.c was allocating pointer types
- using dbx_alloc_type+smash_to_pointer_type instead of
- lookup_pointer_type. I failed to find a justification for the
- former, so I changed it to use the latter. Similarly, I
- replaced smash_to_function_type by lookup_function_type,
- and smash_to_reference_type by lookup_reference_type.
-
- * mipsread.c (parse_symbol, upgrade_type, parse_procedure,
- _initialize_mipsread): corresponding changes.
-
- * symtab.c (smash_to_{pointer,reference,function}_type): eliminate.
-
- * source.c (mod_path): Do tilde_expand on each component of the path,
- rather than on the (list of) paths as a whole.
- (print_source_lines): Set first_line_listed in addition to
- current_source_symtab and current_source_line. If the source was
- not findable, after a "dir" command to fix the problem,
- a "list" would get the wrong lines.
-
- While I was there... (gnu):
-
- * dbxread.c (read_type): Change error to complaint.
-
-Thu Mar 21 12:56:46 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- First attempt at detailed understanding of symbol table memory alloc.
-
- * dbxread.c (dbx_symfile_read): Free our string table if we
- aren't the mainline. Free the "info" struct since we're done with
- it.
- (init_psymbol_list): Free any previously allocated psymbol lists.
- (): FIXME: Should realloc-down the psymbol lists when done reading
- the main symbol file?
-
- * symmisc.c (free_symtab): Free fullname field too.
-
- * xm-hp300hpux.h (USG): #undef then #define so Makefile can -D.
- (REGISTER_ADDR): Make result type unsigned int.
-
- * xconfig/{i386*,hp300hpux,altosgas,altos}: All config files that
- define REGEX must also define REGEX1 (its dependency).
-
-Tue Mar 19 21:28:57 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * tconfig/i960: No longer works, points you at vxworks960 or
- nindy960.
-
- * xgdb.c, XGDB-README: Remove file. Users can get the much
- better xxgdb.
- * Makefile.dist: Remove all trace of xgdb.
-
- * breakpoint.c (breakpoint_1): Pass demangle arg to
- print_address_symbolic.
- (clear_breakpoints): Remove unused function.
- (breakpoint_re_set_one): Guts of breakpoint_re_set.
- (breakpoint_re_set): Use catch_errors to do them all anyway.
-
- * gdb-int.texinfo (Host versus Target): Add section on what is
- a "host" feature versus what is a "target" feature.
-
- * infcmd.c (path_command, path_info): Handle the PATH variable
- (object search path) as conveniently as the source search path.
- * environ.c (set_in_environ): Set some vars in GDB's environment,
- in addition to the child's. PATH, G960BASE, G960BIN for starters.
- * source.c (mod_path): New function, from guts of
- directory_command, modifies a path. Used by path_command.
- (directory_command): Call it.
- * defs.h (strsave): Declare.
-
- * utils.c (sevenbit_strings): Add new printing option.
- (printchar): Use it.
- (strsave): Provide this handy helper routine.
- (set_width_command): Rename set_screen_width_command.
- (_initialize_utils): "set screen-width" => "set width";
- "set screen-height" => "set height"; add sevenbit-strings.
-
- * infcmd.c (do_registers_info): Print floating point registers
- in raw hex as well as float format, regardless of whether it is
- a "virtual" convertible register.
- * tm-sparc.h (PRINT_REGISTER_HOOK): Print every pair of float
- regs as a double, just in case it's being used that way.
- * values.c (unpack_long): Comment on array/function coercion.
- (unpack_double): Argument is in target byte order now. For
- integer arguments, just call unpack_long and float the result.
- * m68k-tdep.c: include defs.h for "const" handling.
- * remote-nindy.c: Use ieee-float stuff.
- (nindy_fetch_registers): Unpack double regs to host double, then
- to extended.
- (nindy_store_registers): Pack extendeds to host double, flip
- around by misusing unpack_double, send as target double.
-
- * tm-vxworks68.h (FRAME_CHAIN): Handle current frame pointer of
- zero, as when stopped at the first instruction of a process.
-
- * blockframe.c: Fix filename in comment (param.h => tm.h).
- * sparc-tdep.c (skip_prologue): More explicit nudging comments.
- * tm-68k.h: Fix typos.
-
-Fri Mar 15 01:09:34 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Changes from a bringup on the DEC Vax under Ultrix 4.0.
-
- * coredep.c (fetch_core_registers): Pass end-address of register
- section to register_addr as expected. Don't call supply_register
- if we'd just pass it garbage.
-
- * dbxread.c (read_dbx_symtab): Skip N_NSYMS on Ultrix.
-
- * exec.c (xfer_memory): Use boolean xfer_fn result, not int.
-
- * target.c (push_target, target_info): Cast enums to int for < or
- > comparison.
-
- * stack.c (print_frame_info): Identify source file & line
- even if we can't print it.
-
- * xm-vax.h (MISSING_VPRINTF): No longer missing in Ultrix V4.0.
-
-Sat Mar 9 10:08:20 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Clean up IEEE floating point support.
-
- * ieee-float.h: New file.
- * ieee-float.c: Write real routines to convert between host
- doubles and various target IEEE extendeds.
- * m68k-xdep.c: Eliminate assembler code for extended floats.
- * xconfig/{3b1,altos,altosgas,hp300bsd,isi,news,news1000,sun2os3,
- sun2os4,sun3,sun3os3,sun3os4}: Eliminate use of m68k-xdep.o.
- * tm-i960.h, tm-68k.h (REGISTER_CONVERT_TO_VIRTUAL,
- REGISTER_CONVERT_TO_RAW): Use ieee_extended_to_double and
- double_to_ieee_extended.
- * i960-tdep.c: Define ext_format_i960.
- * m68k-tdep.c: Define ext_format_68881.
- * sparc-tdep.c: Define ext_format_sparc, though unused.
- * Makefile.dist (HFILES): Add ieee-float.h.
- * inftarg.c: #include "ieee-float.h" for the REGISTER_CONVERT
- macros.
-
- Obsolete the "coffstrip" program in favor of using BFD's strip.
-
- * nindy-share/coffstrip.c: Remove file.
- * nindy-share/nindy.c (coffstrip): Routine to run bfd_strip.
- * Makefile.dist: Remove references to nindy-share/coffstrip.c.
- * tconfig/nindy960: Remove reference to coffstrip.o.
-
- * Makefile.dist: Roll version number to 3.94.1 (not yet final).
-
-Wed Mar 6 09:56:45 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * symfile.h: Add symfile_bfd, common between dbxread and coffread.
- * dbxread.c: Remove static symfile_bfd.
- * infcmd.c (do_registers_info): Add PRINT_REGISTER_HOOK, though
- it is not used yet.
- * inftarg.c (child_detach): Pop the child_ops vector if the
- detach is successful.
- * remote-nindy.c (nindy_create_inferior): Don't push a new
- nindy_ops since nindy uses the same one for execution and memory
- examination anyway.
- * core.c (core_ops): Use child_attach and child_create_inferior
- rather than default attach and create_inferior functions.
-
- Handle floating point registers in core files.
-
- * sparc-xdep.c (fetch_core_registers): Rewrite for float support.
- * sun3-xdep.c (fetch_core_registers): Rewrite for float support.
- This version untested since BFD doesn't yet support sun3 core
- files.
- * hp300hpux-xdep.c: Rewrite fetch_core_registers to new calling
- conventions. Fix comments and style. This version has not
- been compiled yet, since we have no HP inhouse.
- * core.c (get_core_registers): Look for two sections, ".reg"
- and ".reg2", and pass both to fetch_core_registers sequentially.
-
- Revise directory path yet again.
-
- * source.c (forget_cached_source_info): Not static any more.
- (init_source_path): New default source path is "$cdir:$cwd".
- (dir_command): Handle variable arguments ($cdir, $cwd).
- (source_info): Print "Compilation directory" rather than
- "Originally compiled in" to remind people of $cdir.
- (openp): If the path contains $cwd, use current directory.
- (open_source_file): If compilation directory is known, replace
- first $cdir in path with the compilation directory.
- (print_source_lines): Even if we can't print the lines, set the
- current symtab and line for future commands like "info source" or
- "breakpoint". Also, error message now contains the file name,
- line number, and file access error message.
- (_initialize_source): Fix help text to describe changes.
- * main.c (cd_command): Forget cached source info when we chdir.
- * utils.c (strstr): Add simple implementation.
-
-Tue Mar 5 01:41:40 1991 John Gilmore (gnu at fowanton.cygnus.com)
-
- * coffread.c (read_one_sym, init_linetable, init_stringtab):
- Byte-swap COFF symbol tables if necessary when reading them in.
- Use complain() to replace error message in one spot. Needs
- corresponding change in bfd/coff-code.h to make some symbol
- swapping routines non-static.
-
-Mon Mar 4 00:53:40 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Merge changes from Eirik Fuller, for UTek.
-
- * defs.h (errno): Add declaration.
- * altos-xdep.c, arm-xdep.c, convex-xdep.c, gould-xdep.c,
- hp300hpux-xdep.c, infrun.c, inflow.c, infptrace.c, i386-tdep.c,
- i386-xdep.c, pyr-xdep.c, mips-xdep.c, remote-eb.c, remote-nindy.c,
- remote-vx.c, source.c, standalone.c, stuff.c, sun386-xdep.c,
- symmetry-tdep.c, symmetry-xdep.c, umax-xdep.c, utils.c: Eliminate
- declarations of errno.
-
- * remote-eb.c: Define B19200 and B38400 as EXTA and EXTB.
-
- * remote-vx.c: Include <sys/time.h> for UTek; Sun gets it via
- <rpc/rpc.h> and <rpc/types.h>.
-
-Sat Mar 2 15:47:55 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * i960-tdep.c (examine_prologue): Add new argument limit,
- which stops the scan at the end of the prologue, or at the PC.
- This fixes a problem where it walks down into the code for the
- user's statements if that code looks like function prologues.
- Mark Fox and I have been bouncing this code back and forth, making
- small changes to it. Callers changed to match.
-
-Tue Feb 26 01:47:07 1991 Cygnus John Gilmore (cygnus at yuba)
-
- Cleanup for gdb-3.94 release final:
-
- * Makefile.dist: Remove remote-vx.c, remote-nindy.c, and all
- the .c files from vx-share and nindy-share, from the various
- macros, since they are not found via ALLDEPFILES.
- (SFILES): Add tm-i960.h.
- (alldeps.mak rule): Break out ALLDEPFILES_MAINDIR and
- ALLDEPFILES_SUBDIR. List all the nindy and vxworks subdir files
- in the SUBDIR list.
- (TAGFILES_MAINDIR): Change ALLDEPFILES to ALLDEPFILES_MAINDIR.
- (gdb.tar.Z): Use ALLDEPFILES_SUBDIR as well as SFILES_SUBDIR.
-
-Mon Feb 25 16:02:35 1991 Cygnus John Gilmore (cygnus at oldman)
-
- * am29k-tdep.c: Add contribution line.
- (examine_prologue): Cache information about function prologues in
- the misc-function-vector to avoid lots of references over the
- serial line while examining instructions.
-
- * core.c (core_close): New function made from cleanup_core.
-
- * core.c, exec.c, inftarg.c, remote-eb.c, remote-nindy.c,
- remote-vx.c, remote.c, target.c, target.h,
- Update target_ops vector to add attach, close, and load entries.
- Use add_syms_addr_command, not add_file_addr_command, for
- add_file. Break out close routine from existing code.
-
- * dbxread.c (really_free_pendings): Don't free pending_blocks;
- they are in an obstack.
- (read_dbx_symtab): Relocate end_of_text_addr in the psymtab.
- Lint.
- (define_symbol): Add symbol type parameter; change callers;
- pass type parameter to DBX_PARM_SYMBOL_CLASS macro to allow
- it to influence the symbol class on the i960.
- (define_symbol): Swap LOC_CONST's into target byte order.
-
- * exec.c (exec_close): New function.
- (exec_file_command): Call it.
-
- * findvar.c (read_relative_register_raw_bytes): Doc byte order,
- Fix byte order of frame pointer.
- (read_var_value): Result of 0 if var's value can't be found,
- e.g. missing FRAME_ARGS_ADDRESS. Byte-swap LOC_CONST and
- LOC_LABEL values to target order. Add LOC_LOCAL_ARG.
- (locate_var_value): Use read_var_value and use its lazy address
- as the location of the var's value. Lint.
-
- * i960-pinsn.c (next_insn): Add routine from vxgdb for scanning
- instructions.
-
- * i960-tdep.c (arg_address, i960_frame_find_saved_regs): Remove
- obsolete Intel versions in favor of vxgdb versions.
- (check_host, byteswap, byteswap_val, reorder_val): Eliminate
- code dealing with byte order of values, which Intel did in host byte
- order rather than gdb-4's target byte order.
- (i960_frame_chain_valid): Move to nindy-tdep.c.
- (examine_prologue, skip_prologue, frame_find_saved_regs,
- frame_args_address, leafproc_return, saved_pc_after_call,
- pop_frame): Add vxgdb versions from Mark Fox.
- (examine_prologue, frame_struct_result_address): Add code
- to deal with the saved value of G13 (struct return address
- pointer).
- (frame_args_address): Modify Mark's version to prefer the
- saved value over the current value in the topmost frame.
- Cache result in the frame info to avoid performance hair in
- callers.
- (print_fault): Add gdb960 code for printing faults.
- (_initialize_i960): Actually call check_host.
-
- * ieee-float.c (ieee_extended_to_double, ieee_double_to_extended):
- add stub routines. FIXME, these currently just return zero!
-
- * infcmd.c (program_info): Use PRINT_RANDOM_SIGNAL.
- (attach_command): Call target_attach, not target_open, now.
-
- * infrun.c (normal_stop): Make global, not static, for vx_attach.
- (child_attach): Rename from child_open.
- (wait_for_inferior): Use PRINT_RANDOM_SIGNAL. If stop_pc is zero,
- don't confuse it with a zero step_resume_break_address.
-
- * inftarg.c (child_detach): Eliminate inferior_pid test.
- (child_files_info): Clean up message a bit.
- (child_ops): Use child_attach, not child_open, to attach.
-
- * mem-break.c: #ifdef out the whole file if BREAKPOINT is not
- set (e.g. on VxWorks or NINDY). Move read_memory_nobpt from
- findvar.c to here, since it depends on the contents of the
- shadow_contents of breakpoints, but keep if #if 0 since it is
- never called.
-
- * nindy-tdep.c: New file, contains nindy_frame_chain_valid, moved
- from i960-tdep.c.
-
- * printcmd.c (address_info): Handle LOC_LOCAL_ARG. Lint.
- (ptype_command, display_command): Eliminate have_inferior_p and
- have_core_file_p in favor of target_has_stack or
- target_has_execution.
- (print_frame_args): Handle LOC_LOCAL_ARG. Eliminate duplicate
- code for actually finding the values of arguments, though we still
- keep track of the maximum stack offset for use in printing unnamed
- arguments. Handle missing FRAME_ARGS_ADDRESS.
-
- * remote-nindy.c (i960_print_fault): Move to i960-tdep.c.
- (struct nindy_regs): Define registers passed to/from nindy.
- (nindy_fetch_registers, nindy_store-registers): Translate between
- nindy and GDB formats for the registers.
- (dcache_init): Statically allocate the cache, since it was being
- allocated by a malloc that was never freed anyway.
- (nindy_create_inferior): Error, not core dump, if no exec file.
- (nindy_before_main_loop): Use target_load, not target_add_file.
-
- * remote-vx.c (net_load): Specify large timeout for load
- requests. Allow user to break out with INTERRUPT.
- (net_break): Remove useless code, clean up. Change callers.
- (parse-args, skip_white_space, find_white_space): Clean up arg
- parsing to cope with quoted strings.
- (net_wait, net_quit): Never call error, just return status.
- (vx_read_register, vx_write_register): Cleanup status checking.
- #ifdef the code based on which CPU we are using (960 or 68k),
- FIXME, this should be completely general but it isn't yet.
- (vx_xfer_memory, vx_resume): Cleanup status checking.
- (vx_run_files_info): Improve message.
- (vx_load_command): Renamed from vx_add_file_command. Allow load
- to be interrupted.
- (net_ptrace): Remove unused routine.
- (vx_wait): Adopt code from vxgdb960 to cope with broken
- connections to target machine and prompt to disconnect. Remove
- debug printouts. Map some EVENT_'s to SIGnals.
- (add_symbol_stub, vx_open): Print names of object files we found,
- and "ok" if we read their symbols OK. Clarify output in general.
- (vx_attach, vx_detach, vx_kill): Add these commands.
- (vx_convert_from_virtual, vx_convert_to_virtual): Simplify.
- (vx_run_ops): Turn off all_mem, to avoid spurious msg in the
- "info files" output, and create_inferior, since we already have
- an inferior.
-
- * stack.c (frame_info): Replace Frame_unknown with 0.
- (print_frame_arg_vars): Handle LOC_LOCAL_ARG.
- (return_command): Pop until the PC matches as well as the FP,
- so it works even if the FP is shared with another function,
- as in "frameless" or "leaf" procedures.
-
- * symfile.c (load_command): renamed from add_file_target_command.
- (add_syms_addr_command): renamed from add_file_addr_command.
- (add_syms_command): Stub to call target_add_syms.
- (_initialize_symfile): Change command names and descriptions,
- add-file => add-syms, and load from alias to its own command.
-
- * target.c (kill_or_be_killed, maybe_kill_then_attach,
- maybe_kill_then_create_inferior): Default for attempts to start
- a process, if one is already running, is to ask about killing
- it and retry if yes.
- (upstack_create_inferior): #if-0 it, strata obsolete it.
- (push_target, unpush_target, pop_target): to_close() a target
- before unstacking it.
- (target_info): Renamed from target_files_info.
- (_initialize_targets): Rename "i files" as "i target", accessible
- under both names.
-
- * target.h: Improve comments about the target_ vectored routines.
-
- * tm-i960.h: Remove NINDY-specific stuff to tm-nindy960.h.
- Convert commenting style to standard GNU style.
- (DBX_PARM_SYMBOL_CLASS): allow LOC_LOCAL_ARG's to be recognized.
- (SKIP_PROLOGUE): No longer a no-op.
- (SAVED_PC_AFTER_CALL): Now handles leaf procedures.
- (*_REGNUM): Sort register numbers.
- (REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE,
- MAX_REGISTER_RAW_SIZE, REGISTER_CONVERTIBLE,
- REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Float regs
- are now 10 byte extendeds, not 8 byte doubles.
- (FRAME_CHAIN_VALID): Make this config-dependent, since it differs
- for nindy versus vxworks targets. FIXME, this should possibly go
- in the target vector.
- (EXTRA_FRAME_INFO, INIT_EXTRA_FRAME_INFO): Cache both
- frame_saved_regs and arg pointer with each frame.
- (FRAMELESS_FUNCTION_INVOCATION): New leafproc support.
- (FRAME_ARGS_ADDRESS): Use cached result.
- (FRAME_ARGS_ADDRESS_CORRECT): New, avoids g14 guessing.
- (FRAME_FIND_SAVED_REGS): Change arg to subsidiary fn.
- (PRINT_RAMDON_SIGNAL): Call print_fault.
- (POP_FRAME): Now works.
-
- * tm-nindy960.h: Break this off tm-i960.h. NINDY-specific
- option parsing and startup; STACK_END_ADDR, FRAME_CHAIN_VALID,
- BREAKPOINT, and DECR_PC_AFTER_BREAK are here.
- (ADDITIONAL_OPTION_HANDLER): use target_load, not
- target_add_file.
-
- * tm-vxworks960.h: Break this off tm-i960.h. VxGDB specific
- startup; DECR_PC_AFTER_BREAK, and FRAME_CHAIN_VALID are here.
-
- * valarith.c (value_subscripted_rvalue): Avoid handling
- floats and doubles specially; it gave alignment errors. Lint.
-
- * valops.c (value_of_variable, value_of_this): Error if unknown
- value.
-
- * valprint.c (print_floating): Bcopy rather than pointer-deref,
- to avoid alignment problems.
- (value_print): Handle unknown value address.
- (cplus_val_print): Two args are ignored; remove them. Change caller.
- (val_print): Use unpack_long rather than pointer-deref.
-
- * values.c: Lint.
- (unpack_long, unpack_double): Use bcopy rather than pointer-deref
- to avoid alignment problems.
- (value_being_returned): Error if return value unknown.
- (set_return_value): Add bogosity warning, FIXME. *
-
- * TODO: A woman's work is never done.
-
- * Makefile.dist: Distribute REMOTE_OBS into tconfig files.
- Separate INCLUDE_CFLAGS for use with lint. Add LINTFILES.
- Add ieee-float.o to OBS.
- * tconfig/{nindy960,vxworks68,vxworks960}: Include the desired
- REMOTE_OBS remote-interface files in the TDEPFILES and TM_FILE.
- * tconfig/i960: FIXME. Half-merge, produce warning if config'd.
-
- Changes to generalize the VxWorks RPC protocol slightly, to handle
- i960 as well as 68000.
-
- * vx-share/dbgRpcLib.h (VX_SOURCE_STEP): Add.
- * vx-share/reg.h: Produce i960 regs #ifdef I80960
- * vx-share/xdr_ptrace.c: Skip FPA registers if 960.
- * vx-share/xdr_rdb.h: Add SOURCE_STEP struct and xdr decl.
- * vx-share/xdr_rdb.c: Add xdr_SOURCE_STEP routine.
- * vx-share/xdr_regs.c: Add xdr_regs, xdr_fp_status, xdr_ext_fp
- for i960. Change xdr_vectors to xdr_opaques for 68k registers,
- so they will move in target byte order rather than network
- byte order (happens to be the same).
-
-Mon Feb 25 03:41:44 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * tm-convex.h (END_OF_TEXT_DEFAULT): Remove #if 0'd block.
-
-Sun Feb 24 00:55:53 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * am29k-pinsn.c,
- Add contribution lines to various files, showing where they
- came from.
-
- * breakpoint.c (break_insn, check_break_insn_size,
- read_memory_nobpt): Remove to mem-break.c.
-
- * xm-*.h, param-no-tm.h, tm-29k.h, valprint.c: Change BYTE_ORDER to
- HOST_BYTE_ORDER.
-
- * tm-29k.h (STAB_REG_TO_REGNUM): Warn user if symbol table
- entry has bad register number. This change is not
- tested in this release, FIXME.
-
- * frame.h: Eliminate Frame_unknown in favor of a simple zero.
- tm-vax.h: Ditto.
-
- * value.h: Force value's contents field to be aligned to hold
- at least a double or a long long (if supported). This avoids
- doing bcopy's in and out of the contents field.
-
- (step_1): Avoid coredump under obscure circumstances when we
- have no frame.
-
- * symtab.h (misc_info): Add field to misc function vector for
- any kind of cached information the target code desires. AMD
- 29000 uses this to avoid repeating examine_function_prologue's.
-
- * coffread.c: Lint. Remove static symfile, read_section_header.
- core.c (have_core_file_p): Lint: remove.
- expprint.c (print_subexp): Lint.
- infptrace.c, valops.c, valprint.c: lint.
-
- Roll in changes from vxgdb-5.0.1:
-
- * symtab.h: Comment byte order of each address class. Add
- LOC_LOCAL_ARG for frame-relative args (960).
- expread.y: Use LOC_LOCAL_ARG where LOC_ARG is used.
- symtab.c, symmisc.c: ditto.
-
- * infrun.c (init_wait_for_inferior): Clear stop_signal.
-
- * remote.c (remote_resume): Error if resume with a signal.
-
- * symfile.c (prim_record_misc_function): Clear misc_info.
- (fill_in_vptr_fieldno): Check stub type of arg.
-
- * valops.c (value_cast): Avoid looking up names of types whose
- name we don't know, to prevent coredump. Sun CC produces typedef
- rtx and the name of *rtx is zero...
-
-Mon Feb 18 21:16:25 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Roll in changes from final AMD 29000 port (Tiemann).
-
- tconfig/am29k: Add COFF_ENCAPSULATE and TARGET=TARGET_AM29K
- for ../include/a.out.encap.h. This might not work now that BFD
- is separately compiled. Instead, BFD support for encap will have
- to translate machine type 29k into the right COFF_MAGIC.
-
- * infcmd.c: Remove references to inferior_pid that aren't used
- in actual ptrace calls; use target_has_execution, etc.
- (have_inferior_p): Remove function.
- (program_info): Print target info rather than "process number";
- avoid gratuitous messages unless from_tty.
- (run_stack_dummy, finish_command): Set proceed_to_finish.
- infrun.c: Remove inferior_pid refs. Decl & init proceed_to_finish.
- main.c: Lint. Lose have_inferior_p().
- inferior.h (have_inferior_p): Remove, lint.
- (proceed_to_finish): Add flag to ask that all regs be saved
- by normal_stop, for the few commands that need it, speeding up
- serial I/O. Add comments to stop_registers.
-
- * remote-eb.c: Remove newline from breakpoint message we grep
- for. Never time out when running the user program.
-
-
-
-Wed Feb 13 15:34:40 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Roll in changes from vxgdb-5.0.1:
-
- * dbxread.c (read_dbx_symtab): If we encounter a "FORTRAN COMMON"
- symbol in its raw form, we are processing an unlinked ".o" file.
- See if the target environment has assigned it an address, using
- target_lookup_symbol (VxWorks does), and enter it into the symtab
- that way.
-
- * tm-vxworks.h (FRAME_CHAIN, FRAME_CHAIN_VALID): Override usual
- 68k versions for a simpler version that assumes zero FP at bottom.
- Fixes bug of truncated stack reports.
-
- * target.h (target_lookup_symbol): Define this routine's args
- and result, finally.
-
- * target.c (nosymbol): Default routine for target_lookup_symbol.
- (target_default): Default lookup_symbol and call_function too.
- (files_info): Only print has_all_memory warning if a non-dummy
- target follows.
-
- * remote-vx.c (vx_read_register, vx_convert_to_virtual,
- vx_convert_from_virtual): If target does not have floating point,
- zero register "values", and avoid doing cross-net conversions.
- (vx_lookup_symbol): Rename net_lookup_symbol, add to vectors.
- (vx_open): Rearrange code that attaches to target and reads
- symbols for all loaded modules, to work if some of the modules
- are not accessible. Add symbol_stub() and add_symbol_stub()
- as callbacks from catch_errors(). Allow connect attempt to be
- interrupted painlessly with ^C (FIXME, there are still some bugs
- if the interrupt happens during symbol reading.). Print
- final message with puts_filtered, since symbol messages are
- now filtered too.
-
- Misc cleanup:
-
- * main.c (catch_errors): Only print errstring if non-null.
- (command_loop): Avoid an ioctl per command to test ISATTY.
-
- * remote-vx.c (net_load): make static; avoid sophomoric msg.
- (vx_xfer_memory): Return correct result!
- (vx_files_info): Indicate whether target has float or not.
- (vx_lookup_symbol): Complain, not error, if target gone.
- (vx_open): Print "Connected" msg before disabling immediate-quit.
- [FIXME: lookup_symbol and vx_open changes need testing.]
-
- target.c, remote-eb.c, inftarg.c, am29k-opcode.h, target.h,
- tm-29k.h, tmm-vxworks68.h, symfile.c, gdb-int.texinfo: Add
- contributor lines and update copyrights to 1991.
-
- Changes from an attempted H-PUX host port:
-
- * infptrace.c (PT_ATTACH, PT_DETACH): Handle HP/UX, which
- defines PT_ATTACH and PT_DETACH but not PT_KILL.
- * remote-eb.c (eb_open): Misplaced endif kills sysv H/PUX.
- * remote-vx.c: include <sys/time.h> for HPUX.
- * hp300hpux-xdep.c (fetch_core_registers): Rewrite old
- "core_file_command" routine to BFD regime. May not work yet.
-
- Attempted port of "gdb-3.4 Van Jacobson xgdb" to modern gdb.
-
- * xgdb.c: Replace X10 version with some VJ version.
- (FIXME: Its copyright assignment is not on record.)
- * xgdb.c: Update include files to X11R4 (Xaw crud).
- (xgdb_display_source, create_text_widget): fix call to
- get_filename_and_charpos. Rewack source window stuff for X11R4
- (gleaned from include files, and "nm's" of binary libraries, since
- I had no doc available).
- (append_selection, append_selection_word): Disable with FIXME
- since R4 changed interface here.
- (create_buttons): Add back the old set of buttons.
- (xgdb_create_window): Fix call to XtInitialize (&argc not argc).
-
- * Makefile.dist (xgdb, xgdb-init.c): Update for X11R4 on Suns.
- Roll VERSION to 3.94 (not yet final though).
-
-Sat Feb 9 09:46:25 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * obstack.h (obstack_ptr_grow, obstack_ptr_grow_fast,
- obstack_int_grow, obstack_int_grow_fast): Eliminate
- cast on left of assignment, which gives MIPS cc fits and is
- not Standard C.
-
- * sparc-pinsn.c (print_insn): Eliminate 'set' test, subsumed by
- F_ALIAS. Use printf, not fprintf, when not passing a file
- pointer...
- (compare_opcodes): Check that identical instructions have
- identical opcodes, complain otherwise.
-
- * sparc-opcode.h (st %fsr): Fix opcode "lose" mask. This
- was reported by Roland McGrath.
- (unimp): Only match if exactly zero instruction. (Roland)
- (branches and traps): Generate all variations of these
- instructions with macros, based on a single call that defines
- each condition name and its binary representation.
- (set): Turn on alias bit, to avoid test in sparc-pinsn.c.
-
- * valprint.c (val_print_fields): Take, and use, format parameter.
- This means that "p/x struct" again prints the elements in the
- desired format. Changed callers.
-
- * stack.c (frame_info): Use filtered output, and indicate wrap
- points. Remove kludgy formatting designed to avoid line wrap.
-
- * utils.c (wrap_here): If the line is already full (because
- we had printed a long indent or long wrapped string), do an
- immediate newline-and-indent.
-
- * m68k-pinsn.c (print_insn_arg): Bugfix from
- ntmtv!thompson@ames.arc.nasa.gov (Mike Thompson): 'bkpt #0'
- instruction is incorrectly disassembled as bkpt #8.
-
- * dbxread.c (end_psymtab): Bugfix from Peter Schauer
- <pesrem@regent.e-technik.tu-muenchen.de>: If you want to set a
- breakpoint in a *.y file gdb will say Reading in symbols for *.y...
- and then will dump core (sometimes). I traced it back to an
- uninitialized symfile_name in psymtab_to_symtab.
- (const_vol_complaint): Add quotes to message.
- (define_symbol): Only believe line number if gcc_compiled.
- Avoid allocating symbol if we will not return it.
-
- Add target strata support so that newly established targets go
- into their right place in the target stack (e.g. a new exec file
- doesn't wipe out the ability to access the running process).
-
- * target.h, core.c, exec.c, inftarg.c, remote-eb.c,
- remote-nindy.c, remote-vx.c, remote.c, target.c: Add to_stratum
- and initialize it properly in all the targets.
-
- * target.h: Document strata. Change return type of push_target.
-
- * target.c (nomemory): new function for dummy memory access.
- (tcomplain): Rename complain, now also used in symfile.c.
- (push_target): Push targets within strata. New return value shows
- whether new target is on top of stack or not. Always keep dummy
- target on stack.
- (target_files_info): Ignore dummy target.
-
- * core.c (core_open): Warn user, and skip accessing file, if the
- core target is not the topmost target in the stack.
- * remote-nindy.c (nindy_create_inferior): Avoid unpush_target, now
- already handled.
-
- * remote-vx.c: Remove vx_prepare_to_store from vxworks memory
- target_ops, it doesn't belong there since we have no regs there.
- Change name of target from machine => memory to clarify.
-
-Thu Feb 7 16:32:09 1991 John Gilmore (gnu at spiff.cygnus.com)
-
- * Freeze version 3.93 for release.
-
- * Makefile.dist: Handle vx-share and nindy-share subdirs
- properly when building gdb.tar.Z.
-
- * symtab.c: lint; add no_symtab_msg to consolidate the messages
- printed in various places, so I could change just one copy.
-
- * dbxread.c, coffread.c: Change references to bfd->iostream
- to cast to FILE *, now that BFD avoids needing types defined
- in other header files.
-
-Tue Feb 5 21:39:35 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * command.c, dbxread.c, expprint.c, infcmd.c, infptrace.c,
- infrun.c, printcmd.c, remote-nindy.c, source.c, sparc-tdep.c,
- sparc-xdep.c, symfile.h, symmisc.c, utils.c, valprint.c: Lint
- (actually gcc -Wall).
-
- * dbxread.c: Remove first_global_sym, last_global_sym, since
- they are never referenced.
-
- * defs.h (baud_rate): Declare.
- main.c: Define it, and add the -b option to set it.
-
- * gdb-int.texinfo: Add text on how to define a new host or target
- architecture, prompted by Per Bothner's questions about MIPS
- support.
-
- * gdb.texinfo: Document "complaints". Change doc of -q since
- gdb no longer prints the copyright and blurb if you specify a file
- name to be debugged (just like Emacs). Add doc for Nindy-specific
- command line flags for specifying target serial port and such.
- Update copyright to 1991.
-
- * gdbcore.h: Remove a large mass of now-useless crud, since BFD
- has taken over for us the job of ripping up executable files. The
- crud caused Per Bothner's port to not compile.
-
- * infrun.c (normal_stop): Avoid printing "Program exited
- normally" if we are in batch mode. This allows a GDB which
- executes a program on a target system, to behave like a Unix
- command (input from stdin, output to stdout, no extraneous
- output).
-
- * main.c (main): Allow additional machine-dependent command line
- options to be specified with the ADDITIONAL_OPTIONS,
- ADDITIONAL_OPTION_CASES, ADDITIONAL_OPTION_HELP, and
- ADDITIONAL_OPTION_HANDLER macros. Also allow machine-dependent
- processing to occur just before the main loop with
- BEFORE_MAIN_LOOP_HOOK.
- (main): If a "core file" argument is specified, and it is not a
- core file, try it as a process ID to attach.
- (symbol_completion_function): Attempt to cope with
- "show screen-" TAB, not very successfully. This needs more work,
- FIXME.
- (batch_file): New function, returns whether we are reading
- commands from an interactive tty on stdin, or from somewhere else.
- Called by normal_stop since it doesn't get from_tty passed down
- to it like many commands do.
-
- * remote-nindy.c: Handle command line options for nindy
- connection.
- (nindy_before_main_loop): Prompt user for tty name if they
- don't specify it before getting to the interactive command loop.
-
- * tm-i960.c: Add ADDITIONAL_OPTIONS, etc, to handle -O, -brk,
- and -r command line options. Also add hook before main loop
- to make it easy to specify a tty.
-
- * TODO: More things to do, one done.
-
-Mon Feb 4 23:57:39 1991 John Gilmore and Mike Tiemann (at cygint.cygnus.com)
-
- * dbxread.c: Make complaint() calls pass pointer, not struct.
- Add complaints about badly formatted C++ type information
- (const/volatile indicator, and parse errors resulting in
- error_type). Fix C++ virtual member fn comment.
- (read_struct_type): Avoid bumping pointer if we got a parse
- error; this prevents our walking beyond the end of a string.
- Terminate loop on null char as well as semicolon.
- (process_one_symbol): Fix the LBRAC fix so that it uses the
- last previous SLINE, FUN, or SO record's PC address. C++ debug
- symbols did not have SLINE records in a useful order compared
- to the LBRAC records.
- (define_symbol): Handle "catch" records.
-
- * symtab.c (check_stub_type): Added new complain
- `stub_noname_complain' and added a consistency check to
- keep the debugger from crashing when finishing from an
- exception frame. A real fix will be needed later.
-
-Sat Feb 2 10:43:05 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * infcmd.c (attach_command): Make global.
-
- * Makefile.dist (REMOTE_OBS): Make these compile by default,
- but make them easy to comment out. Perhaps later they should
- be enabled by what CPU you configure for? FIXME.
- (VERSION): Roll to 3.93.
- (pinsn.o): Remove rule for obsolete file.
- (dbxread.o,coffread.o,mipsread.o): Use ${srcdir} explicitly.
-
- Run down a problem that manifested by printing the wrong function
- name in stack traces of read_ofile_symtab. Turned out that the
- problem was the SunOS 4.1.1 (and previous) C compiler outputs
- the LBRAC symbol with an address in the *data* segment, which
- blew our binary search through the blocks.
-
- * dbxread.c: Use the complain() facility consistently to bitch
- about problems in the symbol file we are reading.
- (finish_block): Add code to check the nesting of the blocks;
- complain and Procrust them to fit if wrong.
- (make_blockvector): Check the order of the blocks, complain
- [but don't cope] if wrong.
- (process_one_symbol): ifndef SUN_FIXED_LBRAC_BUG, check LBRAC
- symbols to be sure their PC value is greater than the last SLINE
- (line number) symbol we've seen, complaining and adopting the
- SLINE PC value if wrong.
-
- * symfile.h (struct complaint, complaint_root, complain,
- clear_complaints): Add.
- * symfile.c (complain, complaint_root, clear_complaints): Add
- facility to deal with non-fatal complaints and to regularize their
- suppression.
- (symbol_file_add): Clear complaint counters to allow new complaints.
- (initialize_symfile): Add 'set complaints' and 'show complaints'.
-
- * dbxread.c (dbx_symfile_read): Remember the address and size
- of the string table for the main symbol file, so we won't read it
- more than once.
- (dbx_psymtab_to_symtab): Fix the check for main symbol file,
- to avoid reading the string table yet again. Lint.
- (throughout): Improve filtered output, including word wrap.
- (read_range_type): Improve Bothner's fix to handle other types too.
-
- * utils.c: Improve line wrap implementation. Handle unlimited
- width by making chars_per_line unsigned.
- (puts_filtered): New, easy, function.
-
- * defs.h (puts_filtered): add.
-
- * mipsread.c (compare_symbols, sort_symtab): Remove these fns,
- call the identical sort_symtab_syms() in symfile.c instead.
-
- * expread.y: Suggest the `file' command rather than `symbol-file'.
-
- * command.h (enum var_types): Add zinteger for seroable
- unsigned integer.
- * command.c (do_setshow_command): Handle var_zinteger. Restructure
- nested if's into a switch.
-
- * breakpoint.c (bpstat_print): If bpstat "print" flag is not set,
- we did not stop because of a breakpoint (it must have been for
- some other reason, like a "stepi"), so don't print anything.
-
- * symtab.c: Include <sys/types.h> all the time. Now that BFD
- doesn't include <sys/types.h>, old SunOS's require it for
- <sys/stat.h>.
-
-Sat Feb 2 10:39:15 1991 Per Bothner (bothner@cs.wisc.edu)
-
- A test port of gdb-3.92.6 to the Sony NEWS.
-
- * Makefile.dist
- Don't normally link in remote- or vx stuff.
- Some of it doesn't compile, and it wastes space for 99% of the users.
- Remove reference to no-longer-used HAVE_VPRINTF.
- Fixed BFD_DEP typo to BFD_DIR.
- * dbxread.c
- Fix cast in arg to bfd_h_getlong.
- Make char *prefix be const.
- Fix how certain range types are mapped into builtin unsigned int types.
- * infrun.c
- Remove 2 #includes. They cause errors (on Sony, at least),
- and aren't needed (they wern't in earlier versions).
- * printcmd.c
- print_address_symbolic should never demangle labels
- (since it prints *assembler-level* labels).
-
- [This was superseded by the change to printcmd below.]
-
- * utils.c
- Add some "volatile" return types to avoid warnings.
- If MISSING_VPRINTF add vprintf function and not just macro
- (since vprintf is used in printcmd.c).
- * valprint.c
- Unless __GNUC__, use obstack_grow instead of obstack_ptr_grow.
- (The latter isn't grokked by some PCC-based compilers.)
-
- [This change is in abeyance, we prefer to fix obstack_ptr_grow.]
-
- Make chunk size of dont_print_obstack 32*4 instead of default 4096.
- * nindy-share/coffstrip.c
- Added some forward declarations (otherwise, gcc complains
- about implicit extern redefined as static).
-
-Sun Jan 20 02:38:19 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Changes inspired by Per Bothner:
- * printcmd.c (print_address_symbolic): Take additional parameter
- specifying whether to demangle.
- (print_address): Pass in asm_demangle to control demangling.
- (print_address_demangle): New fn, takes explicit arg to control
- demangling.
- * utils.c: Add new vars demangle and asm_demangle, and let them
- be set and shown.
- (fputs_demangled): If !demangle, just print the argument.
- (fprint_symbol): If !demangle, just print raw symbol.
- * valprint.c (val_print): Call print_address_demangle rather than
- print_address, to cause demangling to depend on the global
- rather than assembler-level demangling setting.
- * WHATS.NEW, gdb.texinfo: Document.
-
- * main.c (show_command): Show all settings if no arg.
- (initialize_main): Make "info set" the same as naked "show".
- * command.c (cmd_show_list): Handle prefix commands in the
- list, and print the name of the setting as well as its English
- description and value.
-
- Allow gdb functions to specify where a line should wrap if it
- exceeds the size of a terminal line. Use it to make the output
- prettier.
- * utils.c (set_screen_width_command): New fn, mallocs a buffer
- of the right size when screen width changes.
- (set_screensize_command, screensize_info): Remove #if 0'd fns.
- (wrap_here): New fn, indicates a point in the output where we
- should wrap the line rather than just letting it overflow at a
- random place.
- (fputs_filtered): Implement wrapping.
- (n_spaces): New fn, returns a pointer to N spaces.
- (print_spaces_filtered): Use n_spaces.
- * defs.h (n_spaces): Declare.
- * stack.c (print_frame_info): Wrap with 4-space indent after
- fn name and before filename and line number.
- * printcmd.c (print_frame_args): Wrap with 4-space indent
- before each argument name is printed.
- * valprint.c (value_print): Wrap with no indentation before
- each repetition.
- (val_print_fields): Wrap with indentation relative to nesting
- level before each field name.
- (val_print): Wrap with nesting indentation before array elements.
- * command.c (do_setshow_command): Avoid extra newlines,
- wrap with 4-space indent around values printed, end with period.
- * WHATS.NEW, gdb.texinfo, gdb-int.texinfo: Document.
-
- * breakpoint.c (breakpoint_1): Implement addressprint for
- "info breakpoints" display. Change file name and line number
- format to " at file:nnn" rather than " (file line nnn)".
- * gdb.texinfo: Document.
-
-
-Fri Jan 18 07:21:25 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- Frozen for gdb-3.92.6 release.
-
- README, WHATS.NEW: Update for 3.92.6 release.
-
- tconfig/{altos, i386v, i386v32, m88k, umax}: Eliminate
- coffread.o from configs since it is now built by default.
- tconfig/{3b1, altosgas, arm, convex, hp300bsd, hp300hpux,
- i386v-g, i386v32-g, isi, merlin, news, news1000, np1, pn,
- pyramid, symmetry, vax, vxworks68}: Eliminate dbxread.o
- from configs since it is now built by default.
-
- Makefile.dist: Update for release 3.92.6. Handle files that
- have been moved to ../include, ../getopt, or ../bfd. Add
- saber.suppress and tests directory. Add config.status to
- the release (it will say "none").
-
- coredep.c: Minor formatting fixes.
-
- These changes were made in early December but only checked in now:
- * nindy-share/Onindy.c, nindy-share/coffstrip.c,
- nindy-share/nindy.c: lint
- * nindy-share/nindy.c (ninStopWhy): Don't byteswap the
- register values coming back from the target; we store values
- in target byte order everywhere.
-
-Wed Jan 16 19:01:37 1991 John Gilmore (gnu at cygint.cygnus.com)
-
- * am29k-opcode.h, am29k-pinsn.c: Add 29050 opcodes.
-
- * valprint.c (cplus_val_print, val_print_fields): New functions,
- which print C++ objects. They conspire to avoid printing a
- virtual base class more than once, following all the twists and
- turns of C++ virtual base rules.
- (val_print): Call the above rather than do it by hand.
-
- * symfile.c (symbol_file_add): Only reset symfile_mtime for main
- symbol file, not for added files like shared libs. This really
- needs to be generalized to a timestamp per file.
-
- * core.c (cleanup_core): Avoid coredump if no core file.
-
- * config.gdb: Accept -host or -target in place of +host or
- +target.
-
- * coffread.c (find_linenos): Avoid desupported BFD interface
- to line numbers. We still read them manually rather than using
- BFD's "generic" features.
-
- * gdbrc.tex, threecol.tex: Add GDB reference card and its
- formatting code.
- Makefile.dist: Add refcard to OTHERS list for creating tar files.
-
- * Makefile.dist: Eliminate use of $< in explicit targets.
-
- * readline/Makefile: Use $< rather than $*.c, which does not
- include the VPATH in GNU Make.
-
- * tconfig/i960-bout, tconfig/i960-coff: These are identical
- copies of tconfig/i960, added for global configuration
- compatability. All i960 versions can read both coff and b.out.
-
- * tm-88k.h: Fix multiline macro that lacked \'s. Remove
- COFF_FORMAT and COFF_CHECK_X_ZEROES since these are now handled
- automaticaly.
-
- * TODO: Think of more things to do.
-
-Wed Jan 2 19:09:29 1991 John Gilmore (gnu at spiff.cygnus.com)
-
- tconfig/{am29k,i960,sun2*,sun3*,sun4*}: Eliminate config
- of sdb versus dbx debug symbols. Add kludge for 68881 80-bit to
- 64-bit float conversion.
-
- tconfig/sun4, tconfig/sun3, xconfig/sun4, xconfig/sun3: Make
- equivalent to sun?os4 so global config works.
-
-Wed Jan 2 18:20:51 1991 John Gilmore (gnu at spiff.cygnus.com)
-
- Fix from Eberhard Mattes <mattes@azu.informatik.uni-stuttgart.de>
-
- * main.c: Only declare linesize once; declare pagesize not at
- all, since it is never used.
- (main): Clear newly allocated line before it is used.
-
-Fri Dec 28 00:13:42 1990 John Gilmore (gnu at cygint)
-
- Further stabilization for the Intel 960.
-
- * Makefile.dist: Parameterize the location of the "include"
- and "bfd" directories, as well as "getopt". Add symfile.c.
- Link in both dbxread and coffread. Fix up "make depend" to
- rewack the locations of include, bfd, and getopt in its output.
-
- * README: Document moving include files, improve some of
- the other doc.
-
- * coffread.c: Move common code out to symfile.c. Change
- symbol_file_command style interface to use new *_symfile_init
- and *_symfile_read interface under BFD. Use BFD internal
- info to locate line table, symbols, etc.
-
- * core.c (core_fetch_registers): Rename to get_core_registers
- to avoid confusion with fetch_core_registers.
- (register_addr): Move to coredep.c, which is already machine
- dependent. This leaves core.c pretty clean of dependencies.
-
- * coredep.c (register_addr): Accept this routine from core.c.
-
- * dbxread.c: Move common code (with coffread.c, etc) into new
- symfile.c. Each psymtab now contains a pointer to the
- format-dependent function that knows how to read it in. Make
- some things static.
- (dbx_psymtab_to_symtab): Renamed from psymtab_to_symtab_2.
- (process_one_symbol): Add code to complain about a "compiler bug
- we muzzle here", if we actually see it.
-
- * eval.c (evaluate_subexp): Insert missing "break" statements
- in code that determines whether a variable is an lvalue in
- memory, register, or whatever. I detected this via a compiler
- bug in which it *almost* mashed out the whole switch statement.
-
- * gdb-int.texinfo: Add minor sections on configuring gdb for
- release, and about the README file.
-
- * infcmd.c (registers_info): Fix formatting somewhat. Still
- not as pretty as before, but it handles byte swapping.
-
- * remote-nindy.c: If data cache routines are interrupted while
- waiting for the remote end, be sure that any uninitialized cache
- blocks are on the free list, not on the valid list!
-
- * symfile.h: Flesh out this header file with all the various
- routines and variables that have been merged in from dbxread.c
- coffread.c, and symtab.c to symfile.c.
-
- * symfile.c: New file, containing code common to dbxread.c,
- coffread.c, and some code from symtab.c. All generic code for
- reading symbol files should be in here now.
- (unrecord_misc_function): Remove unused function.
-
- * symtab.h: Remove file-reading things to symfile.h.
-
- * symtab.c: Remove file-reading things to symfile.c.
-
- * tm-i960.h: Fix FRAME_CHAIN types; define PRINT_RANDOM_SIGNAL
- to decode i960 fault types.
-
- * target.h, remote.c, remote-eb.c, remote-vx.c, remote-nindy.c,
- target.c: Change type of the "resume" function from int to void,
- since its result was never used.
-
-Sat Dec 22 02:51:40 1990 John Gilmore (gnu at cygint)
-
- * main.c: Replace "stupid" with "caution"; you now "set caution
- on or off".
-
- * printcmd.c (print_scalar_formatted): Fix typo in 'g' format
-
- * infcmd.c (do_registers_info): Call val_print to deal with the
- byte order of the registers being printed. FIXME, this makes
- the formatting of the output uglier.
-
- * infcmd.c (wait_for_inferior): If PRINT_RANDOM_SIGNAL is
- defined, call it for signals the debugger doesn't itself use.
- The i960 uses this for more detailed fault information.
-
- * remote.c (remote_open): If arg is null, print help rather than
- dumping core.
-
- * sparc-xdep.c (register_valid): Avoid declaring size, since
- various modules will think of various sizes depending on the
- architecture of their tm-file. FIXME, we need protection against
- actually entering one of those modules, which would clobber
- storage if not for the target architecture compiled into gdb.
-
- * stack.c (up_command, down_command): Always print the frame
- you arrive at.
- (up_silently_command, down_silently_command): New commands
- for use in scripts.
-
- * i960-pinsn.c (reg), i960-tdep.c: Lint.
-
- * i960-tdep.c (i960_frame_chain_valid): Lookup_symbol now takes
- more parameters than it used to.
-
- * findvar.c (registers): Increase slop to 256 bytes, which should
- protect us against even most RISC machines with large register
- sets.
- (locate_var_value): Move declaration inside related ifdef.
-
- * remote-nindy.c (): Use TIOCSETN rather than TIOCSETP
- throughout, to avoid throwing away buffered input from the board.
- (nindy_wait): Supply_register takes addr_of_value, not value.
- (i960_print_fault): Renamed from i80960_fault.
- (nindy_fetch_registers): Avoid have_regs stuff, just get them.
- (nindy_store_registers): Avoid regs_changed stuff, just stuff
- them.
- (nindy_create_inferior): Don't bother to write PC_REGNUM since
- we can set the PC in the call to proceed(). Unpush nindy_ops
- before pushing it on top, to avoid message to user. Eliminate
- commentary from Unix machines that just misleads here.
- (reset_command): Fix error message to suggest target command.
-
-Wed Dec 19 11:03:56 1990 John Gilmore (gnu at cygint)
-
- Release 3.92.5 as frozen.
-
- Stabilize the merged release...with help from lint, Saber C,
- gcc -W, etc.
-
- Everywhere: Add include files needed to declare return types
- of functions called.
-
- * gdb.texinfo: Roland Pesch is documenting gdb, glory be!
-
- * breakpoint.h: Add undeclared breakpoint functions, and some
- functions for display handling since I couldn't think of a better
- .h to put them in.
-
- * breakpoint.c (insert_breakpoints): Make code for disabling
- shared library bkpts more likely to work. It's used when we
- rerun a program and stop before the shared library has been
- mapped in.
- (breakpoint_cond_eval, bpstat_stop_status): Pass arg as int,
- cast from pointer, so it squeezes through catch_errors.
- (bpstat_stop_status): Fix logic broken some time ago. We now
- always create a bpstat if the stop address matches a breakpoint,
- even if we don't stop there -- just like the old code used to do
- before I got my fingers into it (sigh).
- (breakpoint_1): Print "ignore count" after "stop only if"
- condition, since that's how it actually works.
- (mention): Handle watchpoints as well as breakpoints.
- (watch_command): use set_raw_breakpoint and mention to do most
- of the work (and initialize all the fields!). Only pass one
- arg to parse_c_expression, since that's all it takes.
-
- * command.c (not_just_help_class_command): Rename arg to args
- since we ignore "unused argument" warnings on vars named "args".
- inflow.c (child_terminal_info): ditto.
- infptrace.c (kill_inferior): ditto
- main.c (catch_errors, version_info, quit_command, pwd_command,
- source_command, dump_me_command, editing_info,
- set_history_size_command, set_history, show_history,
- set_verbose): ditto
- stack.c (locals_info): ditto
- target.c (target_files_info): ditto
- valprint.c (set_input_radix, set_output_radix): ditto
-
- * core.c: Remove old variables for handling core and exec file
- sections (data_start, data_end, stack_start, stack_end,
- reg_stack_start, reg_stack_end, reg_stack_offset, text_start,
- text_end, exec_data_start, exec_data_end, text_offset,
- exec_data_offset, data_offset, stack_offset). They're
- superseded the more general build_section_table and
- xfer_memory.
- (get_exec_file): Mention the `file' command.
- (read_memory_check): Rename to memory_error, and only call it
- in the case of an actual error.
- (read_memory, write_memory): call memory_error.
- (core_fetch_registers): Register section name is ".reg".
-
- coredep.c: Remove a bunch of crud now that all this file does
- is pull the registers out of a core file.
- (fetch_core_registers): Rewrite to actually work, I hope.
-
- dbxread.c: Use a.out.gnu.h, not system a.out, now.
- Replace index() with strchr(). Remove all the pre-BFD macro
- definitions for accessing the symbol file.
- (struct dbx_symfile_info): Encapsulate the information that
- dbx_symfile_init needs to pass to dbx_symfile_read in this
- struct.
-
- (dbx_new_init, dbx_symfile_init, dbx_symfile_read,
- dbx_symfile_discard): Rearrange symbol file reading to divide
- the format-specific part from the format-independent part,
- leaving the format-independent part such as file name expansion
- and opening in symtab.c. This replaces
- partial_symbol_file_open and partial_symbol_file_read.
- Symbol_file_read, add_file, add_file_target_command,
- add_file_addr_command move to symtab.c. Pass an explicit
- "mainline" flag for when reading the main symbol table, rather
- than relying on the offset address to be zero or nonzero.
-
- (dbx_symfile_read): Don't allow void *'s to be printed as
- typedefs.
- (SWAP_SYMBOL): Use bfd routines to byte-swap the symbols.
- (ADD_PSYMBOL_TO_LIST): Make the "function call rather than
- macro" debug version really work.
- (read_dbx_symtab): Remove unref'd parameter inclink.
- Avoid swapping N_SLINE symbols, for speed.
- Merge N_TEXT!N_EXT case with the other external symbol
- definitions' case. Add comments.
- (start_psymtab): Allocate the symfile name in the psymtab on
- the psymbol_obstack, rather than using the caller's storage.
- (end_psymtab): Only allocate a dependencies list if there are
- more than zero.
- (psymtab_to_symtab_2): Use BFD when reopening file to read
- its symbols for real.
- (read_struct_type): Add FIXME comments where it needs work
- for C++ bogosity.
- (read_huge_number): Add FIXME about overflows.
- (read_range_type): Add FIXME about comparing a long to 1<<32.
-
- * coffread.c: Minor changes to move things closer to the new
- regime with symtab.c and dbxread.c Major work is still needed
- here.
-
- * exec.c (exec_file_command): Remove old variables (see core.c
- above).
- (xfer_memory): If memory transfer is right at the end of a
- section, don't lose.
-
- * findvar.c (get_saved_register): If value is in a real
- register, LVAL is lval_register, not lval_memory.
-
- frame.h: Declare print_sel_frame and record_selected_frame.
-
- gdb-int.texinfo: New file, for GDB internals documentation.
- Very simple, unformatted doc of cleanups is there for now.
-
- gdbcore.h: Remove obsolete variables that described a.out
- section addresses and offsets. (See core.c above.)
- Declare fetch_core_registers and registers_fetched.
-
- getopt.c: Declare char *alloca(); even on SPARC.
-
- infcmd.c (run_command): Call target_kill rather than
- kill_inferior.
- (step_command, next_command, stepi_command, nexti_command):
- Declare from_tty parameter even though we don't use it.
- (run_stack_dummy): argument BUFFER is a char array, not
- a pointer to REGISTER_TYPE.
- (finish_command): using_struct_return needed a value *,
- not a struct symbol *.
-
- * infptrace.c (child_xfer_memory): To avoid dependency on
- where sections are in memory, try PT_WRITE_D and if that fails,
- try PT_WRITE_I. Most Unixes don't care which you use.
-
- * infrun.c (step_resume_break_shadow): Change to array to
- match other breakpoint shadow storage.
- (clear_proceed_status): Pass address of bpstat to
- bpstat_clear, not the bpstat itself.
- (child_create_inferior): FIXME comment about if the child
- exits.
- (start_inferior): Remove old function.
- (child_open): Use target_kill rather than kill_inferior.
- (wait_for_inferior): Ditto.
- (insert_step_breakpoint, remote_step_breakpoint): Use
- new step_resume_break_shadow.
-
- * inftarg.c (child_wait): If all child processes die,
- pretend that the one being waited for exited with signal 42.
-
- * main.c (command_line_input): When scanning for comments,
- don't coredump on unclosed quotes.
- (quit_command): Use target_kill rther than kill_inferior.
- (_initialize_main): Rename class_user from "user" to
- "user-defined".
-
- * printcmd.c (print_command_1): Initialize "fmt" if no format
- is specified by the user.
- (print_frame_args): Only add to args_printed if we are
- actually fetching args from the stack (avoiding undefined
- arg_size).
- (_initialize_printcmd): Remove bogus \{ from string.
-
- * remote-eb.c (eb_open): Avoid coredump on no argument.
-
- * remote-nindy.c: Bring out of Intel environment into new
- target environment. Remove all conditional compilation on
- I80960. Massive hacking throughout.
- (nindy_xfer_inferior_memory): New routine stolen from
- infptrace.c.
- (nindy_create_inferior): New routine pieced together, probably
- not quite working yet.
- (nindy_ops): New target_ops struct for nindy.
-
- * remote-vx.c: Use write_memory rather than target_write_memory
- to get error checking.
- (vx_add_file_command, vx_open): Use symbol_file_add rather than
- add_file.
- (vx_create_inferior): Use target_terminal_ours...
-
- * signame.c (_initialize_signame): Always initialize, since
- we need the table for things other than psignal.
-
- * solib.c (solib_add): Use symbol_file_add, not add_file.
- (solib_address): Return boolean result rather than struct
- pointer which nobody else knows the type of.
-
- * sparc-tdep.c, valops.c: Use write_memory rather than
- target_write_memory, to get error checking.
-
- * stack.c (locals_info, catch_info, args_info,
- get_selected_block, frame_command, up_command): Use
- target_has_stack, rather than have_inferior_p or
- have_core_file_p.
-
- * sun3-xdep.c (fetch_core_registers): Rewrite for new BFD regime.
-
- * symfile.h: New file, defining the interface between the
- generic and object-file-specific symbol reading code.
-
- * symtab.c: Move generic symbol-reading interface to symtab.c,
- from dbxread.c, coffread.c, mipsread.c, etc. Add symtab_fns
- table to map BFD targets to symbol-reading modules in GDB.
- Change index to strchr.
- (lookup_struct_elt_type): Use error() rather than hand-made
- simulations thereof.
- (lookup_partial_symbol): Speedup slightly when length == 0.
- (symbol_file_add): New function.
- (symbol_file_command): Call it.
- (symfile_open, symfile_init): New function.
- (add_file_target_command, add_file_addr_command): moved from
- dbxread.c.
-
- * target.c (target_command): use target_kill.
-
- * target.h (target_files_info): Don't declare, never called
- from outside.
-
- * tm-sun2.h, tm-sun3.h (STACK_END_ADDR): Use system include
- files to determine stack end address.
-
- * valarith.c (value_x_binop, value_x_unop): Change error message
- to be more useful. Pass proper argument to value_struct_elt.
-
- * valops.c (value_assign): FIXME comment that long long
- bitfields will break here.
-
- * Makefile.dist: Add symfile.h, remote-nindy.c, remote-eb.c.
- Update `make saber_gdb' to work better.
-
- * TODO: A woman's work is never done.
-
- * cplus-dem.c, environ.c, inferior.h, infrun.c, inftarg.c,
- main.c, obstack.c, printcmd.c, remote-eb.c, remote-nindy.c,
- remote-vx.c, remote.c, solib.c, source.c, sparc-pinsn.c,
- sparc-tdep.c, sparc-xdep.c, symmisc.c, symtab.c, symtab.h
- target.c, terminal.h, tm-sparc.h, tm-sunos.h, utils.c,
- valops.c, valprint.c, exec.c: Lint.
-
-
-Wed Dec 12 23:44:15 1990 John Gilmore (gnu at cygnus.com)
-
- Continuing Intel 960 port merge of GDB.
-
- * Makefile.dist: Merge i960 "nindy-share" files. Rename
- malloc.h to gmalloc.h to avoid name conflicts in /usr/include.
- Don't ship gdb.dvi in tar file. Link gdb with init.o, not init.c.
- Wack over "make depend" so it handles files in subdirectories
- vx-share, nindy-share, bfd, and in the current directory.
-
- * blockframe.c (get_prev_frame_info): Remove fatal error
- if stack not defined.
-
- * core.c (core_open, core_detach): New functions that handle
- the old "core-file" command as "target core" and "detach" instead.
- (core_file_command): Call them.
- (core_xfer_memory): Use common routine xfer_memory.
-
- * dbxread.c: Include a.out.gnu.h, not system a.out.h.
- dbxread now uses bfd for everything but symbol reading itself.
- BFD internals are used to drag out the relevant file offsets.
- (partial_symbol_file_open): Change args all around for BFD.
-
- * symtab.c: Rename "value" to "val" everywhere, so we can
- #include "value.h".
- (symbol_file_command): New command, moved from dbxread.c
- and coffread.c. It uses BFD to read the file, then vectors
- based on its type, to dbx or coff symbol readers.
- * symtab.h: Extern a few vars for symbol_file_command.
-
- * target.h: Breakpoint takes a char * save area, not a char **.
-
- * valprint.c (val_print): When unpacking bitfields, offset
- the address in gdb of the value, if it is declared with a shorter
- type. Remove the last "runtime kludge test" of host byte order.
-
- * utils.c: Remove old my_bfd_read routine.
-
- * stack.c (frame_info): Use target_has_stack. Print program counter
- register's actual name rather than "pc", since it's called the
- "ip" (instruction pointer) on the i960 (sigh).
-
- * target.c (target_command): Add command for selecting a target
- type and calling its open routine. This is used for initiating
- communication with a particular target, in a generic way.
-
- * tm-i960.h: Update for modern gdb. Remove semicolons from
- various macros. Handle reading struct return convention, and
- error-out attempts to return structs with the "return" command.
- Be sure gdb doesn't think we know how to call functions in the
- inferior.
-
- * i960-tdep.c: Rename FRAME_CHAIN_VALID and FRAME_FIND_SAVED_REGS
- to i960_xxx in lower case.
- (arg_address): Circumvent errors due to LOC_ARG_BLOCK
- not being defined yet.
-
- * remote.c (remote_open): Call start_remote to initialize
- wait_for_inferior during open.
- (remote_xfer_inferior_memory): Return length written rather
- than errno value.
-
- * remote-vx.c (target_command -> vx_open): Use new generic
- target command.
- * remote-eb.c, inftarg.c, exec.c: ditto.
-
- * infrun.c: Fix comments.
- (attach_program -> child_open): Use new generic target command.
- (wait_for_inferior): Clear saved register values before target_wait,
- so target_wait can set some of them if convenient.
-
- * infptrace.c (fetch_inferior_registers, store_inferior_registers):
- Return success indicator, not void.
- (child_xfer_memory): Avoid fetching initial word if we'll
- overwrite it anyway.
-
- * infcmd.c (attach_command): Use new generic target open routine.
- (_initialize_infcmd): Update doc on attach and detach commands.
- (do_registers_info): Merge in a byte-order problem as a FIXME
- comment.
-
- * findvar.c (find_saved_register): Avoid problem in current frame.
- (read_relative_register): Ditto.
- (write_register): Convert byte order on the way out.
-
- * exec.c (file_command): Add.
- (add_to_section_table, exec_command): Use new bfd_map_over_sections.
- (xfer_memory): Common function between core_xfer_memory and
- exec_xfer_memory.
- (exec_xfer_memory): Use it.
-
- * pn-opcode.h: Document that a "PN" is a Gould PowerNode.
-
- * breakpoint.c, breakpoint.h, symtab.h, value.h, frame.h, utils.c,
- valops.c, stack.c, target.c, sparc-xdep.c, source.c, printcmd.c,
- infcmd.c, i960-pinsn.c, eval.c, defs.h: lint and gcc -Wall.
-
-Sun Dec 2 16:45:06 1990 John Gilmore (gnu at cygnus.com)
-
- Merge Intel 960 port of gdb, continuing...
-
- * dbxread.c (partial_symbol_file_open, partial_symbol_file_read,
- symbol_file_command): Pass from_tty arg to hush 'em up.
-
- * coffread.c (symbol_file_command): Avoid output if from_tty != 1.
- Add magic numbers for 960 COFF format.
-
-Fri Nov 30 09:18:20 1990 John Gilmore (gnu at cygnus.com)
-
- Merge Intel 960 port of gdb, from Intel "1.2" release.
-
- CHANGE_LOG entries from their port, which was based on
- gdb+-2.8.0:
-
- Thu Sep 6 11:02:22 PDT 1990
- Remove temp file if download is interrupted.
-
- Wed Aug 1 09:08:33 PDT 1990
- Now uses binary protocol to talk to NINDY.
- Old hex protocol (NINDY 2.13 and older) supported with -O switch.
- Times out after 5 seconds when trying to talk to NINDY.
-
- Tue May 29 12:54:49 PDT 1990
- Added variable baud rate (-b switch).
- Source code reorganization.
-
- Thu Apr 26 11:09:55 PDT 1990
- More cleanup of batch mode; specifically, execute "-s", "-e", and
- "-se" switches as soon as they are encountered on the invocation line.
-
- Fri Apr 20 13:47:15 PDT 1990
- Add -brk switch.
-
- Thu Apr 19 09:54:28 PDT 1990
- Add 'reset' command.
-
- Wed Apr 18 09:48:07 PDT 1990
- After opening remote tty, wait for 1 second to go by without input
- from it before trying to talk to NINDY (fixes problems with the
- Heurikon HK80/V960E).
-
- Mon Apr 4 16:33:05 PDT 1990
- Some output was not being suppressed in 'batch' mode.
-
- Thu Mar 22 15:31:11 PST 1990
- Ask user if old symbol table should be deleted when new file is
- downloaded.
-
- Allow user to run a program downloaded before gdb960 was brought up.
-
- Correct "exec-file" help message for i80960 context.
-
- Correct bug in calculating user space address: could occasionally
- corrupt user program.
-
- Make sure to zero low-order bits in rip's because of bug in 960CA
- A-step part: could cause operation faults when "next"ing across
- a function call.
-
- Correct bug that made it impossible to get source line numbers for
- code loaded at addresses higher than 0x7fffffff.
-
- Wed Jan 10 12:43:22 PST 1990
- Open remote tty for exclusive use.
-
- Fri Jan 5 12:14:42 PST 1990
- Correct disassembly (CA manual was right after all):
- opcode for sysctl is 0x659
-
- Mon Oct 23 12:03:04 PDT 1989
- Use G960BASE and G960BIN environment variables to find 'sx' utility.
-
- Mon Oct 16 14:15:09 PDT 1989
- "sfr0"-"sfr31" should have been named "sf0"-"sf31"
-
- Mon Oct 2 15:56:31 PDT 1989
-
- Added 960CA disassembly support.
-
- To simplify maintenance:
- - eliminated use of symblic links on pinsn.c: use i960-pinsn.c
- directly instead.
- - eliminated opcode.h: incorporates tables into i960-pinsn.c
- - moved 960-specific routines from i960-pinsn.c to i960-md.c
- - made disassembly interface identical to that in gdmp960.
-
-
-
-Wed Nov 28 21:32:48 1990 John Gilmore (gnu at cygint)
-
- * target.h: Allow targets to stack. Add target_has_memory,
- _registers, etc. Restructure memory access and "info files"
- to walk the target stack.
- * exec.c, core.c, inftarg.c, remote.c, remote-vx.c, remote-eb.c,
- target.c: Change tables to match target.h.
- * inflow.c (child_mourn_inferior): pop child_ops.
- (generic_mourn_inferior): Use new has_stack flag.
- * infptrace.c (child_xfer_memory): New memory regime.
- * inftarg.c (child_files_info): New "info files" regime.
- * remote-eb.c: New memory regime, new info files.
- * remote-vx.c: New memory regime, new info files. Now use
- separate targets for VxWorks attachment to machine, and
- actually running a process under VxWorks, since one has
- stack & execution & regs and the other doesn't.
- * remote.c: New memory regime, new info files.
- * sparc-xdep.c (fetch_core-registers): New memory regime.
- * target.c: New routines and support for stacked targets,
- new memory regime, new info files regime.
-
-
- Generalize section handling for an arbitrary number of sections,
- including use of the new BFD (binary file) library.
- * gdbcore.h: Add struct section_table.
- * exec.c (build_section_table): Iterate all sections and
- record what gdb needs to know about them.
- (exec_command): Use it.
- (exec_xfer_memory): Use the table.
- (exec_files_info): Print the table.
- * core.c (core_file_command, core_xfer_memory, core_files_info):
- Likewise.
- * source.c (find_source_lines): Use bfd_get_mtime.
- * dbxread.c: Quick changes to make it compile with new BFD.
- * utils.c (error): Avoid using bfd_error in generic routines.
-
- * core.c (core_fetch_registers): Get from the ".regs" section of
- the BFD core file.
- * sparc-xdep.c (fetch_core_registers): Use the .regs info.
-
- * inferior.h (attach_flag): Export.
- * infcmd.c (run_command): use new target_create_inferior.
- * infrun.c (child_create_inferior): Don't return result.
- * Makefile.dist (VERSION): 3.91.4.
-
-Fri Nov 23 28:15:38 1990 John Gilmore (gnu at cygint)
-
- * breakpoint.c (bpstat_num): Handle breakpoints which have
- since been deleted, such as temporary breakpoints.
- infcmd.c (program_info): ditto.
-
- * core.c (core_file_command): Display the frame where the core
- dump occurred.
-
- * main.c: lint.
-
- * remote-vx.c (target_command): Merge in target command from
- targ-vx.c. A few other cleanups.
-
- * TODO, Projects: Lots more stuff to do...
-
-Fri Nov 23 18:15:38 1990 John Gilmore (gnu at cygint)
-
- Massive changes to wall off the remote-debugging interface
- behind a function vector. The port to handle VxWorks targets
- is also part of this.
-
- All files: Replace references to renamed functions,
- remove references to remote_debugging, remove references to
- have_include_file, have_core_file in favor of target_has_stack,
- target_has_memory, etc.
-
- * Modularize the breakpoint interface.
- breakpoint.h (BREAKPOINT_MAX): New define sets max length of
- a breakpoint instruction.
- breakpoint.c: struct breakpoint's shadow_contents now sized as
- BREAKPOINT_MAX.
- (insert_breakpoints): Vector to target to install breakpoints.
- (remove_breakpoints): Vector to target here too.
- Remove REMOTE_SA_SPARC kludges and other remote_debugging.
- sparc-tdep.c (single_step): Use new breakpoint interface for
- the single-step breakpoints.
- mem-break.c (memory_insert_breakpoint, memory_remove_breakpoint):
- New file, contains routines to insert and remove breakpoints by
- reading out the old contents and later replacing them. This is
- how ptrace breakpoints work, and many remote systems as well.
-
- * tm-vxworks68.h: New config file, overrides a few things for
- Wind River's preferences.
-
- * target.h: New file, for transfer vector used to talk to the
- inferior (child, attached, core, exec, remote, etc). All accesses
- to the thing being debugged should come through these vectors.
- target.c: New file, routines to handle transfer vector.
- (various files): Add transfer vectors XXX_ops for the various
- targets and pseudo-targets (core files, etc) we support.
-
- * breakpoint.c (bpstat_stop_status): Further explorations of
- watchpoints and why things don't work all the time.
- (bpstat_alloc): New fn to allocate a bpstat and chain it.
-
- * config.gdb: Only add "source ${srcdir}/.gdbinit" to
- the local gdbinit if it doesn't already have it.
-
- * core.c (core_ops): add and install.
- Allow core debugging without exec file.
-
- * dbxread.c (free_and_init_header_files): Merge two fns.
- (end_symtab): Free named symbol table when a new version comes in.
- (read_dbx_symtab): Relocate all kinds of symbols with base
- address. First step toward handling different text, data, bss
- reloc.
- (add_file_addr_command): Renamed add_file_command.
- (add_file_command): Vector to remote handler.
- Add "load" as an alias for "add-file" command.
-
- * defs.h: Allow "volatile" to be used in non-ANSI; use it for
- non-returning functions.
-
- * exec.c: Add exec_ops, and push it as a target when an exec
- file is specified.
-
- * infcmd.c (run_command): Pass executable file name and arg list
- separately when starting an inferior. Permit "run" when no exec
- file is specified, for VxWorks.
- (detach_command): Move to child_detach in inftarg.c.
-
- * inftarg.c: New file. Unix-child-specific routines, and the
- child_ops structure.
-
- * inferior.h (registers): Export "registers" as the way for
- target dependent register handlers to find gdb's local copy of
- the registers. Rename "stop_after_attach" to "stop_soon_quietly"
- since it is now used by places that want wait_for_inferior to
- handle the grunge but want to see every trap from the inferior.
-
- * inflow.c (create_inferior): Pull out, and merge into infrun.c.
- Eliminate remote_debugging hooks in terminal handling.
-
- * infrun.c: Replace start_inferior with child_create_inferior.
- Move all the hair of Unix shells and ptrace idiosyncracies into
- child_create_inferior, so remote handlers don't have to deal.
- Remove running_in_shell. Rename stop_after_attach to
- stop_soon_quietly, and use it in a few other places where we want
- to just call wait_for_inferior and get control back on the first
- trap. trap_expected now never takes a value > 1.
- (init_wait_for_inferior): Initialize static vars when a new
- process is created.
-
- main.c (gdbinit): Add new hook for .gdbinit file name, let
- it be overridden by config files as GDBINIT_FILENAME.
- (DEFAULT_PROMPT): Add new hook for overriding (gdb) prompt.
- Both of these are used for VxWorks gdb.
-
- mcheck.c: rename include file "gmalloc.c" to avoid problems
- with system include file "malloc.c".
-
- param-no-tm.h: New include file, same as param.h but does not
- include the default "tm.h" file. This is used in files where
- the target is known, e.g. remote-eb.c or sparc-xdep.c.
-
- param.h: Now just a shell that includes tm.h and param-no-tm.h.
-
- remote-vx.c: New file, VxWorks remote debugging support. Uses
- RPC routines that are shared with the target system, in directory
- ${srcdir}/vx-share.
-
- remote.c: Vectorize remote interface.
-
- source.c: Globalize source_path, and make an alias "l" for "list"
- since we now have the "load" command.
-
- sparc-xdep.c: Use new param-no-tm.h.
-
- symmisc.c (free_named_symtab): Add new function from Wind River.
- However, ifdef it out for now while we think about what it should
- really be doing.
-
- tm-sun3.h, xm-sparc.h, xm-sun3.h, xm-symmetry.h: Move
- PREPARE_TO_STORE to
- the xm- file, and change its name to CHILD_PREPARE_TO_STORE, since
- non-Unix-children handle this with their own code in the target
- transfer vector.
-
- Makefile.dist: Roll version to 3.92.3. Add vx-share stuff to
- source and target lists. Add vx-share to default list of include
- directories. Add new files to src and target lists: mem-break,
- target, inftarg, remote-eb, remote-vx, targ-vx. Be sure the
- ${srcdir} versions of munch and createtags are used.
-
- * valops.c (find_function_addr): Split out of call_function.
- (call_function_by_hand): Rename call_function; this function
- calls functions in the target by laboriously patching the target
- word-by-word with the right stack, args, regs, etc.
-
-
-Mon Nov 5 17:29:10 1990 John Gilmore (gnu at cygint)
-
- Handle AMD 29000 a bit better.
-
- * remote-eb.c (readchar): Mask received char log to make it readable.
- (remote_start): Pass arguments down to executing program.
- Make startaddr unsigned.
- infrun.c (start_inferior): Accept args, pass them to
- remote_start.
- infcmd.c (run_command): Pass args down to start_inferior.
-
- * tconfig/am29k-aout, tconfig/am29k-coff: New files specifying
- the target object file format.
- tm-29k.h: Pay heed to COFF_ENCAPSULATE.
-
- * am29k-pinsn.c (print_insn): Print 0x on hex numbers in disassembly.
- am29k-tdep.c (examine_prologue): Better checking of function prefixes.
-
-Sun Oct 7 18:20:45 1990 John Gilmore (gnu at cygint)
-
- * Makefile.dist (VERSION): Roll version to 3.91.9 and freeze.
- * TODO: We did a few things, we have more to do though.
-
- * xm-sparc.h (CLEAR_DEFERRED_STORES): Define.
- * inflow.c (inferior_died): Clear deferred stores.
-
- * Debug problems with dummy frames and calls to the inferior.
- * tm-sparc.h (PUSH_DUMMY_FRAME, POP_FRAME): Move to sparc-tdep.c.
- * sparc-tdep.c (do_restore_insn): Simplify.
- (sparc_frame_find_saved_regs): Simplify and fix what we find.
- (sparc_push_dummy_frame): Simplify and fix what we push.
- (sparc_pop_frame): Slightly more hair here, deciding whether
- we are restoring a saved PC or returning to a return address in %i7.
- * sparc-xdep.c (read_inferior_registers): Debug if valid reg is read.
-
- * utils.c (xmalloc, xrealloc): Return type depends on __STDC__.
- * symtab.h (xmalloc): ditto, for obstack_chunk_alloc.
- * obstack.h (chunkfun): ditto.
- * defs.h (xmalloc, xrealloc): ditto
-
- * utils.c (quit): Grab the terminal from the child if necessary.
-
- * inflow.c (term_status_command): Rename to term_info, change
- to "info terminal".
-
- * sparc-pinsn.c (print_insn): Disassembly prefers real instructions.
- (is_delayed_branch): Speed up.
- * sparc-opcode.h: Add ALIAS bit to aliases. Fix up opcode tables.
- Still missing some float ops, and needs testing.
-
- * Support for input and output radixes other than base 10
- * defs.h (input_radix, output_radix): Declare.
- * expread.y (yyparse, parse_number): Handle changes of input
- radix, and ambiguous names-or-numbers in radixes >10.
- * printcmd.c (print_scalar_formatted): Print formatted hex
- numbers in varying column widths.
- * valprint.c (val_print): Use output_format to print scalar ints.
- (set_input_radix, set_output_radix, set_radix): Create.
- (set_output_radix): Set output_format from output_radix.
- (_initialize_valprint): add `set radix' but leave the others off.
-
- * main.c (execute_command): Let stupid questions be turned off.
- (_initialize_main): Handle "set stupidity", etc.
-
- * main.c, inflow.c, inferior.h, frame.h, command.c, defs.h,
- sparc-pinsn.c, sparc-xdep.c, value.h, valops.c, values.c: Lint.
-
-Tue Oct 2 11:20:02 1990 John Gilmore (gnu at cygint)
-
- * TODO, Makefile.dist, ChangeLog: Freeze for 3.91.8 release.
- bfd stuff is still screwed up, but with some manual work, it
- compiles.
-
- * breakpoint.c (bpstat_do_actions): Start over if a command
- proceeds the inferior, since the inferior will have stopped and
- will need to have its new stop-actions taken care of.
-
- * dbxread.c (read_struct_type): Expression gives Sun3 4.0.3
- compiler fits, simplify it.
-
- * gdb.texinfo (directory command): Doc new dir command.
- source.c (directory_command): "dir" now puts things on the front
- of the path, moves dups up front, and handles multiple names
- on the command line, inserting each one in order. It also
- blows away cached line and full_filename info.
-
- * stack.c (backtrace_command): Skip "more stack frames follow"
- unless interactive.
-
- * Change #ifndef HAVE_VPRINTF to #define MISSING_VPRINTF in
- xm-convex.h, xm-hp300bsd.h, xm-isi.h, xm-merlin.h, xm-news.h,
- xm-np1.h, xm-pn.h, xm-pyr.h, xm-symmetry.h, xm-umax.h, xm-vax.h.
- The only odd one was Gould NP1, which had defined vprintf to
- "printf"!!!
-
- * Merge Ted Goldstein <tedg@Eng.sun.com>'s changes for epoch.
- printcmd.c (print_command_1): Pass 'inspect' flag down as a global
- variable, inspect_it.
- valprint.c (print_string, val_print): Use the global inspect_it
- to indicate whether to print in Epoch style or normal style.
-
-Mon Oct 1 23:55:26 1990 John Gilmore (gnu at cygint)
-
- * printcmd.c (call_command): add an alias for the "print" command
- which runs expressions and doesn't print the result if void.
- (print_command_1): implement it.
-
- * command.c: Remove #if 0'd code. Initialize all the fields
- in add_cmd (). Rename do_nothing_command to
- not_just_help_class_command, and make it externally visible.
- command.h: add user_commands to struct.
- * main.c (define_command): Don't overload c->function with a char
- string as well as a function pointer.
-
- * eval.c (evaluate_subexp): Reinstall tiemann changes to
- calling convention of value_struct_elt () that got dropped in
- merge.
-
- * tm-sparc.h (FRAME_FIND_SAVED_REGS): move to sparc-xdep.c.
- sparc-tdep.c (sparc_frame_find_saved_regs): ditto.
-
- * tm-sparc.h (POP_FRAME): replace some constants with defines.
-
- * sparc-xdep.c (store_inferior_registers): defer stores to regs
- until a good time (e.g. when we are about to run the child),
- saving ptrace calls.
- * infrun.c (proceed): handle DO_DEFERRED_STORES.
- * tm-sparc.h: define DO_DEFERRED_STORES.
-
- * sparc-xdep.c (store_inferior_registers): when storing float
- registers, don't store stack regs too. When storing the SP,
- however, DO store the stack regs too. This fixes a bug in which
- the dummy frame is not recognized when a call_function finishes,
- because its frame pointer (in the stack regs) was never
- initialized.
- (read_inferior_registers): Mark WIM and TBR and FPS and CPS valid
- even though we don't know how to read them from an inferior.
- valops.c (call_function): Comment about storing SP.
-
- * infrun.c (save_inferior_status): Save away the original bpstat
- chain so it can be restored later. Install the copied version for
- use by whoever saved the status. It will be blow away by
- restore_inferior_status, and the original chain restored. This is
- important for people who have pointers into the original.
-
- * breakpoint.c, command.h, copying.awk, dbxread.c, defs.h,
- findvar.c, frame.h, obstack.h, obstack.c, inflow.c, value.h,
- main.c, printcmd.c, sparc-tdep.c, symtab.c, valprint.c: lint
-
-
-Fri Sep 28 20:32:46 1990 John Gilmore (gnu at cygnus.com)
-
- * Makefile.dist: Roll version to 3.91.8. Add bfd.h and bfdconfig.h
- temporarily to the makefile. Add am29k-opcode.h and WHATS.NEW.
- Add stuff.c and kdb-start.c to the OTHERS list for tar files.
-
-Fri Sep 28 19:12:12 1990 John Gilmore (gnu at cygint)
-
- * Merge Mike Tiemann's multiple inheritance changes from Sun.
- Store the baseclasses in a type struct starting from array element
- 0 rather than from the unusual array element 1.
-
- dbxread.c: the above.
- (virtual_context): Add
- Read new debug information about which virtual function table
- a virtual function is from, and store it in fn_field.fcontext.
-
- symtab.h: Add fcontextt. Fix baseclass indices. Typo in
- TYPE_FN_FIELD_STATIC_P.
-
- symtab.c: the above.
- valops.c: the above. Handle pointer casts of object *'s.
- (search_struct_method): Add.
- (value_struct_elt): First arg is now a pointer to a value, and is
- modified on return.
-
- valprint.c: the above.
- values.c (value_virtual_fn_field): Add type arg. Handle
- offsetting to the proper object when calling virtual fns.
- The above.
- (baseclass_addr): Add valuep arg.
-
- * README: Document the current state of BFD config (missing).
- * TODO, ChangeLog, Makefile.dist: Roll version.
- * WHATS.NEW: Add summary of changes since 3.5.
-
-Thu Sep 27 16:23:12 1990 John Gilmore (gnu at cygint)
-
- * dbxread.c (read_struct_type): Clear bit vectors whenever
- we allocate one.
- symtab.c (B_CLRALL): define.
-
- * tm-sparc.h (STORE_RETURN_VALUE): Avoid clobbering types by
- using == rather than =. Huh... This fixes the dreaded problem
- wherein builtin_type_int becomes TYPE_CODE_FLT.
-
- * core.c (info_files): Show the inferior pid.
-
- * config.gdb: Avoid putting "dir" command into .gdbinit. GDB
- already knows how to look in the source directory.
-
- * Remove psymtab hair from many places. Remove duplicated code
- for searching symbol tables. Hide psymtabs from most places.
- Make it fast to get from a psymtab to its symtab.
-
- blockframe.c (blockvector_for_pc): Remove psymtab hair.
- coffread.c (psymtab_to_symtab): Rename to psymtab_to_symtab2.
- mipsread.c (psymtab_to_symtab): Rename to psymtab_to_symtab2.
- dbxread.c: export psymtab_to_symtab, make it work if called N times.
- (psymtab_to_symtab): Rename to psymtab_to_symtab2. Initialize
- new symtab completely. New psymtabs get symtab pointer
- initialized to zero. Remove MI warning printf.
- symtab.h: Comments. Add psymtab to symtab pointer.
- (PSYMTAB_TO_SYMTAB): New macro.
- symtab.c: use PSYMTAB_TO_SYMTAB. Add psymtab_to_symtab and export it.
- source.c: use PSYMTAB_TO_SYMTAB. Remove symtab version and
- compilation fields.
- stack.c (backtrace_command): Avoid pre-pass to read symbols, if
- verbose is not set.
- (print_frame_info): Avoid special-casing symbols that have not yet
- been read in.
-
- * source.c (open_source_file): Quick path if we have already
- located the source file by its full name.
-
- * symtab.c (lookup_symbol): Use find_pc_symtab rather than
- find_pc_psymtab. When a name is found in the misc function
- vector, search the symbol table for its mangled name, not the
- name that the user typed.
-
- * bfd.h: Fix missing comment terminators, make #endifs match.
-
- * valarith.c (value_less): Handle unsigned int comparisons.
- Add FIXME about pointer compares, which assume host and target
- pointers are the same.
-
- * command.c (do_nothing_command): lint
- dbxread.c: lint. Remove sort_syms. Document C++ visibility info,
- fix comments on debug symbol format for visibility. Actually set
- visibility of symbols.
- main.c (echo_command): lint; use <readline/history.h>.
- tm-sparc.h (FRAME_FIND_SAVED_REGS): lint
- obstack.h (_obstack_blank): Rearrange pointer math to avoid
- pointing past end of allocated memory; saber complains.
- obstack.h: Declare the external functions that we use.
- valarith.h: use <string.h>
- solib.c (solib_add): lint.
-
-Fri Sep 21 17:05:19 1990 John Gilmore (gnu at cygint)
-
- * main.c (initialize_main): Default info_verbose to off, now that
- symbol reading is fast.
- (quit_command): Avoid clobbering exec_bfd while quitting.
-
- * Initial BFD (binary file diddling library) merger:
- coffread.c: Change AOUTHDR to struct exe_hdr.
- dbxread.c: ditto.
- core.c: initialize initialized data at compile time.
- (core_file_command): Move from coredep.c, convert to bfd.
- (xfer_core_file): Convert to bfd.
- exec.c (exec_file_command): use bfd routines.
- gdbcore.h: BFD.
- mips-tdep.c: Remove exec_file_command and friends.
- source.c: bfd.
-
- * coredep.c: (fetch_core_registers) Convert core_file_command to
- fetch_core_registers.
- mips-xdep.c, sparc-xdep.c, sun3-xdep.c: ditto.
-
- * utils.c: (error): Bogus crap, FIXME, to print bfd errors.
- (my_bfd_read): More bogosity, which I don't think we call.
- (program_name): Remove this atrocity asap!
-
-Wed Sep 19 13:36:41 1990 John Gilmore (gnu at cygint)
-
- * From Per Bothner:
- values.c: allocate_repeat_value was not clearing the
- optimized_out field.
- (value_static_field): minor stylistic fix (wrong macro was used).
- valops.c (value_struct_elt_for_address): didn't work for C++
- static fields.
-
- * signame.c (_initialize_signame): Initialize signal names once.
-
- * breakpoint.h, command.c, copying.awk, defs.h, environ.c,
- exec.c, frame.h, infcmd.c, inferior.h, main.c, munch, sun3-xdep.c,
- symtab.h, tm-29k.h, valprint.c, value.h, values.c: Lint.
-
- * remote-eb.c: Support user-settable baud rates on the serial port.
-
- * tm-sun3.h (PREPARE_TO_STORE): fix typo.
-
-Fri Sep 14 13:28:29 1990 John Gilmore (gnu at cygint)
-
- * tconfig/sun3os4: Remove warning about native assembler,
- since it also occurs in the xconfig file.
-
- * findvar.c (registers): Allocate some slop after `registers'
- to prevent stray accesses from trashing the next variable.
-
- * tm-68k.h (REGISTER_BYTES): Allocate the right number of bytes
- on the sun-3, by changing the #ifdef from `sun3' (which is not
- defined by cc) to `sun'. Symptom was trashed builtin_type_XXX
- vars, which happened to follow `registers' in the executable.
-
- * readline/history.c (history_search): Heed gcc-2's advice
- and parenthesize && inside ||).
-
- * am29k-opcode.h, am29k-pinsn.c, am29k-tdep.c, remote-eb.c,
- tm-29k.c: Insert FSF copyright headers.
-
- * remote-eb.c: Better comments.
-
- * Makefile.dist: Update to 3.91.6.
- * TODO: note PREPARE_TO_STORE problem.
-
-Thu Sep 13 09:52:33 1990 Jim Kingdon (kingdon at cygint)
-
- * stack.c (frame_info): Only use FRAME_FIND_SAVED_REGS if defined.
-
- * remote.c: Wrap the whole file in #if !defined (SPECIAL_REMOTE).
-
- * infrun.c (wait_for_inferior, at end): Don't set up
- prev_* if the inferior no longer exists.
-
- * inferior.h (CALL_DUMMY_LOCATION): New macro, to replace
- CANNOT_EXECUTE_STACK.
- valops.c (call_function): Use it.
-
- * tm-convex.h: Add CALL_DUMMY_LENGTH for use by PC_IN_CALL_DUMMY.
-
- * inferior.h (PC_IN_CALL_DUMMY): New macro.
- infrun.c (wait_for_inferior, 2 places): Use it.
-
- * values.c (value_being_returned): Only use
- EXTRACT_STRUCT_VALUE_ADDRESS if defined.
-
- * Move PREPARE_TO_STORE from xm-sun3.h to tm-sun3.h to do the
- right thing for remote-eb.c.
-
- * sun3-xdep.c: Remove extraneous call to remote_store_registers.
- * sun386-xdep.c, hp300hpux-xdep.c, sparc-xdep.c: Ditto.
-
- * blockframe.c: Put get_frame_saved_regs inside #if !defined
- (FRAME_FIND_SAVED_REGS).
-
- * findvar.c ({fetch,store}_registers): Check for
- REMOTE_{FETCH_STORE}_REGISTER macro.
-
- * findvar.c (get_saved_register): Add argument lval and
- change meaning of argument addr.
- findvar.c: Change calls to get_saved_register to reflect
- new calling convention.
- valops.c (value_assign): Use get_saved_register instead of
- find_saved_register.
-
-Sun Sep 2 12:40:20 1990 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * coffread.c (read_one_sym): Make temp_aux an AUXENT, not
- an (uninitialized) pointer to one. Use "&" when passing it
- to fread.
-
-Fri Aug 31 22:57:54 1990 Jim Kingdon (kingdon at cygint.cygnus.com)
-
- * coffread.c (getfilename): Use DGUX x_offset and x_name if
- defined.
-
- * coffread.c (symbol_file_command): Put semicolon after
- "int from_tty".
- Put safe_to_init_tdesc_context in #if defined (TDESC).
- Put #ifdef TDESCs in 1st column for non-ANSI cpp's.
- coffread.c: #include <sys/stat.h>.
- (read_coff_symtab): Typo: in_source_files -> in_source_file.
- Add missing ')' in check for "lc%" and friends. Remove
- extraneous '}'.
- Declare read_one_sym() at top of file.
- (read_file_hdr): Put in extra #ifdefs so MC68MAGIC and
- MC68WRMAGIC can have the same value without causing a duplicate
- case.
-
-Thu Sep 13 15:55:36 1990 John Gilmore (gnu at cygint)
-
- * Allow a Makefile to be built without building the
- tm and xm file links that screw up builds in subdirectories.
- This is done with `config.gdb none', then you can do things
- like `make gdb.tar.Z'.
- * tconfig/none: Config file for no target system
- * xconfig/none: Config file for no host system
- * config.gdb: If no TM or XM files are called out by the
- host or target file, don't make links for them.
-
- * cplus-dem.c: Add documentation.
-
- * dbxread.c (read_ofile_symtab): Turn a fatal error into a
- simple error, so the user's gdb doesn't crash due to some object
- file problem (e.g. somebody is rebuilding the file out from under
- gdb).
-
- * printcmd.c (print_address_symbolic): demangle the symbol.
-
- * Makefile.dist (OTHERS): Remove tdesc-lib because it has
- Motorola copyrights in it. Make "make gdb.tar.Z" work.
- (alldeps.mak): sort and uniq all results from this; duplicates
- hose gdb.tar.Z link building. Remove RCS files from
- tconfig and xconfig. Add config files for sun386. Add
- a few odd files to OTHERS and HFILES.
-
-Mon Sep 10 21:20:24 1990 John Gilmore (gnu at cygint)
-
- * Makefile.dist: Pull solib.c to tconfig/sun?os4.
- Roll version number to 3.91.5. Make lint work in bindir.
-
- * README: Document cross-debugging and new file structure.
-
- * blockframe.c: Lint. Include "value.h" to declare read_register.
- (find_pc_partial_function): remove duplicate line.
-
- * command.h: Lint. Declare error_no_arg and dont_repeat.
-
- * tm-news.h: Remove inadvertently duplicated stuff.
-
- * mipsread.c: Remove cache_pc_function stuff, now done cleanly.
- Clean up usage of misc_function_type. Declare some CORE_ADDRs.
-
- * config.gdb: Allow `config.gdb host target' form. Clean
- up previous change that printed bogus messages when you just said
- `config.gdb'.
-
- * core.c: #include "command.h" for lint.
- * dbxread.c: lint
- * eval.c: lint
- * main.c: Remove some casts of enums. Lint.
- * source.c: lint
- * symtab.c: lint
- * symtab.h: lint
- * expread.y: lint
- * valarith.c: lint
-
- * printcmd.c (initialize_printcmd): Fix thinko in inspect cmd.
-
- * sparc-tdep.c (isannulled): Take instruction as parameter, don't
- read it from memory. This will allow us to save ptrace calls
- eventually. Changed caller single_step too.
-
- * sparc-xdep.c (fetch_inferior_registers): Avoid reading regs
- that we aren't going to use, saving many ptrace calls, especially
- when watchpointing or single stepping. Use some #define's for
- constants.
- (store_inferior_registers): Ditto.
- (core_file_command): Use some #define's for constants.
-
- * tm-sparc.h: Add #define's for some register numbers, so we
- can eliminate the use of random constants in sparc-xdep.c.
-
- * stack.c (frame_command, print_frame_info, up_command,
- down_command) Remove frame_changed, since it
- causes a bug and doesn't seem to do anything useful. In some
- places it was used as a flag, in others as a stack level (?).
-
- * utils.c: Use MISSING_VPRINTF rather than HAVE_VPRINTF, so the
- default is to use the portable (vprintf) version rather than the
- kludge version.
- * xm-news.h (MISSING_VPRINTF): Add.
-
- * valprint.c (val_print): Demangle fancy vtbl printouts. Lint.
-
-Sat Sep 8 00:24:12 1990 John Gilmore (gnu at cygint)
-
- * Remove stuff that forces -Bstatic linking of gdb, and warnings
- about linking debugged programs -Bstatic in the sun?os4 config
- files in tconfig and xconfig subdirectories.
-
- * main.c (main): Remove unreached exit(0) now that we exit
- via quit_command().
-
- * Create TODO file for online bug list. There are too many
- "little" bugs to keep track of on paper.
-
- * Change Projects file to refer to bug-gdb@cygnus.com
- rather than kingdon@ai.
-
-Fri Sep 7 23:35:15 1990 John Gilmore (gnu at cygint)
-
- * Makefile.dist (VERSION): 3.91.4 now.
-
- * symtab.c (init_misc_bunches): Rename from init_misc_functions.
- (condense_misc_bunches): Add sanity check that misc_count is
- the same as the number of symbols in the bunch.
-
- * coffread.c: rename init_misc_bunches. Pass an argument
- to condense_misc_bunches (a zero).
-
- * dbxread.c (partial_symbol_file_read): Call init_misc_bunches
- every time we are called; don't rely on our caller to do it.
- (add_file): Remove call to init_misc_bunches.
-
- * mipsread.c: Only warn, don't error, if unknown symbol types.
- This keeps an old gdb from falling on its face if it sees newly
- extended symbol info. Rename init_misc_bunches.
-
-Fri Sep 7 22:58:15 1990 John Gilmore (gnu at cygint)
-
- * Merge in changes from Per Bothner for DECstations and other
- MIPS stuff. The rest is Bothner speaking:
-
- The next message is a merger of Alessando Forin's mips port with
- mine. I've tried to use my good if biased judgment to get
- the best of both. It *does* need testing.
-
- Some of the changes are general, *not* mips-specific.
-
- param.h:
- Didn't believe in little-endian bit order.
- There are still inconsistencies about whether flags
- like BITS_BIG_ENDIAN are integer (#if ...) or
- boolean (#ifdef ...). I tried to paper over them.
-
- dbxread.c,coffread.c,mipsread.c,symtab.c,symtab.h:
- Moved some misc_function code that was common to
- {dbx,coff,mips}read.c to symtab.c.
- In the process, I think I cleaned things up a bit.
- At the same time, moved obsavestring and obconcat to symtab.c.
-
- dbxread.c:
- Removed obsolete condense_addl_misc_bunches (use
- condense_misc_bunches(1) instead).
-
- exec.c:
- Needed to include <sys/dir>, at least on DECstations.
-
- valops.c, mips-tdep.c, tm-mips.h:
- Added PUSH_ARGUMENTS macro to support funny argument-pushing
- conventions (when STACK_ALIGN is insufficient).
- Needed on mips, where doubles need 8-byte alignment,
- but ints only need 4.
-
- mips-opcode.h:
- Removed cruft that was not being used.
- Merged in many fixes (most from Frank Yellin, fy@lucid.com).
-
- mips-pinsn.c:
- Print $ before register-names (I think that makes things a little
- more consistent).
- Never print two instructions, even if one delays.
- Removed hex-disassemble set_cmd. (This is not mips-specific,
- so I think the argument is whether it is generally worthwhile or not.
- I'm inclined to think not, given how easy it is to
- convert between radixes in gdb.)
-
- mipsread.c:
- This is basically Alessando's code.
- It doesn't use obstacks; I changed it to use obstacks
- in a few minor places where using malloc causes a
- memory leak. (Probably, more places could/should be changed.)
- I added record_misc_function where it was missing.
- In symbol_file_command and add_file_command, I tried
- to make the code consistent with more recent versions.
- Minor sylistic changes in parse_procedure.
- Make a .gdbinfo. psuedo-symbol point back to the real
- procedure symbol (using the isym field).
-
- mips-tdep.c:
- This is basically from my port, but with a lot of details
- and a number of routines merged in from Alessando's version.
- I basically used my code "raw" backtrace (use heuristics
- from the actual code, rather than symbol table info) - though
- the idea is Alessandro's. I feel my code is a little cleaner
- here, particularly in being a little more flexible, such as being
- able to handle gcc-produced code (which it now can).
- It also doesn't do frame caching (which is not useful
- more recent gdb versions).
- I also used my code for push_/pop_dummy, more or less.
- I tried to incorporate AF's code for testing sigtramp
- while backtracing; I probably got it wrong.
- Added mips_print_register, which tries to scrunch as much
- information as possible on a screen...
- Removed the skip-prologue set_cmd. As with hex-disassemble (see
- under mips-pinsn.c), I don't see anything mips-specific here,
- and I don't see it being all that useful anyway.
-
- tm-mips.h:
- Added a $fp psuedo-reg distinct from $fp (nice for gcc).
- Use more register names (rather than hard-cases numbers).
-
-Thu Sep 6 18:33:15 1990 John Gilmore (gnu at cygint)
-
- * Hack up 3.90.11 changes:
-
- * Makefile.dist (depend): parameterize $(GCC).
- Add solib.c and solib.o.
- (readline): Fix vpath for both absolute or relative SRCDIR.
-
- * blockframe.c: Fix from Schaefer@asc.slb.com for shared libs.
- Also, let the part I didn't understand at least compile so
- I can test the rest. FIXME.
-
- * dbxread.c: Fix thinko using strcmp.
- (init_psymbol_list): declare static.
- (partial_symbol_file_open): Comment cleanups better, avoid
- cleaning up the string table since the caller will do that.
- Move the stat for mod time into symbol_file_command, temporarily.
- (There should be a mod time for each symbol file, eventually,
- to control its rereading. FIXME.)
-
- * infptrace.c (PT_WRITE_D): use same value as PT_WRITE_I for
- SunOS, which gives error for shared libs otherwise. (From
- Schaefer, probably FIXME needs work for portability.)
-
- * solib.c: Move #include "param.h" to work.
- Lowercase all the Uppercase Letters In the Messages.
- (find_solib): Clean up inferior_so_name for debug printouts.
- Allow no argument, to mean all shared libraries.
-
- * symmisc.c: include param.h to get CLEAR_SOLIB.
-
-Wed Sep 5 18:00:08 1990 John Gilmore (gnu at cygint)
-
- * Merge in Kingdon's changes from FSF: the diffs from 3.90.9
- to 3.90.11. ChangeLog entries below are from this.
-
-Wed Jun 13 09:17:39 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * Version 3.90.11.
-
- * Makefile.dist (HFILES): Add tm-sunos.h.
-
-Tue Jun 12 16:15:26 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Version 3.90.10.
-
- * Makefile.dist (gdb.tar.Z): Change linking of config so it works.
-
-Thu Jun 7 16:22:27 EDT 1990 Jay Fenlason (hack@ai.mit.edu)
-
- * sparc-opcode.h Added single-operand version of rett.
-
-Mon Jun 4 18:12:31 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * m-sparc.h (REG_STRUCT_HAS_ADDR, STRUCT_ARG_SYM_GARBAGE):
- Put parens around gcc_p in expansion.
-
-Thu May 24 15:44:51 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * utils.c (lines_to_list): Return 10 if lines_per_page == 0.
-
-Wed May 23 16:36:04 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Changes for Sun shared libraries:
- blockframe.c (find_pc_partial_function): If a non-text symbol
- is found, set *address = pc - FUNCTION_START_OFFSET.
- breakpoint.c (insert_breakpoints) [DISABLE_UNSETTABLE_BREAK]:
- Disable breakpoints instead of giving an error.
- source.c (select_source_symtab): Initialize cs_pst.
- symmisc.c: Call CLEAR_SOLIB if defined.
- symtab.h: Make text{low,high} CORE_ADDR not int.
- (psymtab): New field addr.
- solib.c: New file.
- dbxread.c: Move DECLARE_FILE_HEADERS outside functions.
- (record_misc_function): Give correct type for N_DATA symbols.
- (condense_misc_bunches): do "misc_function_count = j" regardless
- of inclink.
- Take code which is shared between symbol_file_command and
- add_file_command and put it into partial_symbol_file_{open,read}.
- Split add_file_command into add_file_command and add_file.
- Make psymtab_to_symtab read in the string table if the file
- is not symfile.
- Two new parameters to read_dbx_symtab and start_psymtab.
- tm-sunos.h: New file.
-
-Tue May 22 17:43:03 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * infcmd.c: Change cont_command to continue_command and "cont"
- to "continue".
-
-Mon May 21 14:41:41 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * breakpoint.c (enable_breakpoint): Get value of watchpoint.
-
- * defs.h [sparc]: Use <alloca.h> regardless of __GNUC__.
-
- * values.c (USE_STRUCT_CONVENTION): Check for structures of
- size 1,2,4,8 rather than size < 8.
-
- * dbxread.c (dbx_lookup_type): Do f->length *= 2 as many times
- as necessary, not just once.
-
- * sparc-opcode.h: Add a bunch of new opcodes which Sun as supports.
-
-Thu May 17 15:04:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * {t,x}m-sun386.h, sun386-xdep.c, {x,t}config/sun386
-
- * tm-news.h: Add CALL_DUMMY_*.
-
- * tm-68k.h: Remove duplicate comment at FRAME_FIND_SAVED_REGS.
-
- * config.gdb: In list_host, list_target, use ${i}, not $i.
-
-Tue May 15 21:27:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * source.c (find_source_lines) [BROKEN_LARGE_ALLOCA]: Use xmalloc.
-
- * sparc-opcode.h: Change all store floating-point state register
- instructions to have the right match & lose fields.
-
-Sat May 5 12:39:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Makefile.dist: Move -I${srcdir} to GLOBAL_CFLAGS and pass
- VPATH to readline.
- config.gdb: If srcdir != ., create readline directory and
- copy a makefile into it.
-
- * wait.h, infrun.c: Change WRETCODE to WEXITSTATUS for
- consistency with POSIX.
-
- * breakpoint.c (bpstat_stop_status): Disable watchpoint
- when we exit its exp_valid_block.
-
-Tue Sep 4 11:46:46 1990 John Gilmore (gnu at cygint)
-
- * Makefile.dist: Bump version to 3.91.3.
-
- * Clean up handling of breakpoint commands (somewhat).
- Prompted by Tiemann bug report "cont 10" doesn't work any more.
-
- inferior.h: Add breakpoint_proceeded to inferior status struct
- and globals; save it and restore it.
- (clear_breakpoint_commands): Cleanup, remove old #define.
-
- infrun.c (clear_proceed_status): Set breakpoint_proceeded.
- (save_inferior_status, restore_inferior_status): handle it also.
- (proceed): Remove earlier code that set breakpoint_proceeded.
- It is now set only in clear_proceed_status.
- (clear_proceed_status): Cleanup, use bpstat_clear rather
- than clear_breakpoint_commands. No callers need the stop_bpstat
- between clear_proceed_status and proceed.
-
- infcmd.c: Add breakpoint_proceeded definition and comment.
- (cont_command, jump_command, signal_command): Move call to
- clear_proceed_status right next to call to proceed.
-
- breakpoint.c (bpstat_do_actions): Avoid clobbering our
- caller's argument while running down the chain of breakpoints.
- Use new variable "breakpoint_proceeded" to determine when
- a command that it executes moves the inferior past the
- breakpoint.
- (bpstat_clear): Handle NULL argument.
- (bpstat_clear_actions): Avoid useless call to
- breakpoint_auto_delete.
- (delete_breakpoint): Clean up bpstat's that are pointing to
- the deleted breakpoint from the stop_bpstat chain.
- (breakpoint_auto_delete): Simplify.
-
- * Clean up handling of EOF, error on stdin, etc. This was
- prompted by a network problem that caused gdb to go into an
- infinite loop filling up its malloc'd memory.
-
- main.c (return_to_top_level): Cleanup: call bpstat_clear_actions,
- not clear_breakpoints_commands, which is now gone.
- (main): If command_loop returns (e.g. from EOF on stdin), do
- a quit_command (looping back to command_loop if quit_command
- doesn't really quit).
- (command_loop): check result from command_line_input and
- exit if it returns NULL, rather than passing the NULL to
- execute_command.
- (gdb_readline): Free malloc'd result space before returning
- NULL for EOF.
-
- * utils.c (query): Handle C-d to mean "yes", just as if the
- input was not a terminal. Also avoid infinite loop if EOF
- occurs in mid-input-line before newline. This allows
- query to be used at EOF on stdin with reasonable results.
-
- * infrun.c (proceed): Set breakpoint_proceeded.
-
- * values.c (value_as_long): Avoid infinite recursion for enums.
- (_initialize_values): Fix typo in help msg (kingdon).
-
- * Makefile.dist (RL_LIB): Use RL_LIB_DEP for dependencies,
- RL_LIB for linking. This allows -lreadline for linking
- and nothing for dependencies, once readline is a real library.
-
- * config.gdb: Jim Kingdon: give useful error message if the
- host or target type is not recognized.
-
- * defs.h (alloca): SPARC <alloca.h> does not declare alloca,
- it just defines it. Dumb, but deal with it.
-
- * Jim Kingdon suggests:
- in xconfig/sun3os4, CFLAGS should be XM_CFLAGS.
-
-Wed Aug 29 18:03:27 1990 John Gilmore (gnu at cygint)
-
- * Makefile.dist (VERSION): Bump version # to 3.91.2.
-
- * Clean up Bothner's changes.
-
- * blockframe.c (clear_pc_function_cache): New function.
- * blockframe.c: remake cache_pc_function_* static.
- * dbxread.c (symbol_file_command): remove references to
- cache_pc_function_* variables.
- * dbxread.c (read_struct_type): Use VOFFSET_STATIC.
- * printcmd.c: Avoid kludging a global variable (addressprint)
- to avoid printing the address of a string twice. Instead,
- pass the format letter 's' down low enough that it can be seen
- to avoid this problem.
- (print_formatted): Pass format arg to value_print.
- (restore_addressprint): Remove function.
- (do_examine): Avoid hacking addressprint, cleanups and such.
- (print_frame_args): Add a comment to a Bothner change.
- * symtab.h: define VOFFSET_STATIC and use it instead of "-1".
- * symmisc.c (free_all_symtabs): Call clear_pc_function_cache
- to wipe out the values cached in blockframe.c.
- * symtab.c (find_method): Add comment saying how big you must
- allocate to be "big enough". Per being terse again.
- * valprint.c (val_print): Handle format letter "s" to print
- strings without addresses. Add comment to vtbl printing code
- which casts with wild abandon. Rearrange reference-printing
- code so it prints:
- @0xaddr: value (print w/addressprint)
- value (print w/~addressprint)
- @0xaddr (parameter lists w/addressprint)
- or nothing (parameter lists w/o addressprint)
-
-Tue Aug 28 10:47:18 1990 John Gilmore (gnu at cygint)
-
- * Merge more changes from Per Bothner:
-
-Gdb's handling of TYPE_CODE_REF was so counter-C++ (and otherwise
-annoying) that I tried to improve it. Here are my suggestions.
-
- These patches all attempt to handle TYPE_CODE_REF (as in C++) better.
-
- findvar.c:
- Do automatic de-reference when taking the address of a reference.
- printcmd.c:
- Don't deref_ref when printing parameter lists.
- valops.c:
- More attempts at treating refernences properly.
- valprint.c:
- In val_print, if deref_ref==0, don't print dangling " = ".
- value.h:
- Add COERCE_REF macro, which de-references an REF.
-
- * Merge changes from Per Bothner:
-
-* Fixed (Sony news)-specific configuration problems.
-* Fixed other problems with using vanilla pcc and libc (enum problems;
-assumption that vsprintf exists).
-* Some major speed-ups (finc_pc_partial_function now caches a match;
-parsing avoids duplicate symbol_lookup calls).
-* Changed handling of baseclasses (no longer use baseclasses field
-of struct type, use the first n_baseclasses fields instead).
-* Various minor changes/fixes, most C++-related.
-
-blockframe.c:
-Cache the most previous match from find_pc_partial_function.
-(Save both low and high ends of matching function's pc range.)
-This speeds up the loop of infrun.c:wait_for_inferior quite
-a bit, and makes step/next commands much zippier.
-command.c:
-Added an enum->int cast (otherwise, some compilers barf).
-dbxread.c:
-No longer set baseclass offset to 0, since multiple
-inheritance now mostly works.
-Added a number of casts, to shut up compiler warnings
-(after stabs where made enums, not ints).
-When discarding a symbol table (in symbol_file_command),
-must clear the cache introduced in blockframe.c.
-Don't convert $vtbl_ptr_type to vtbl any more.
-Get rid of TYPE_BASECLASEES and baseclass_vec (see also symtab.h).
-Mask off sign bit emitted by g++ for virtual table offset.
-Set voffset to -1 (not 1) for static member functions.
-expread.y:
-Changed parsing/lexing of names to avoid doing symbol lookup twice
-(once when lexing to determine symbol class, once for real).
-Now only call symbol_lookup once. Fields of 'this' win especially big.
-printcmd.c:
-Subpress printing addr twice in the case of 'x/s addr'.
-symtab.c:
-lookup_basetype_type is no longer used.
-Add find_methods as recursive helper function to decode_line_1.
-This allows multiple inheritance to work.
-Also, once one or more matches has been found, do not look in
-base-classes. (Baseclass methods would be overridden, anyway.)
-symtab.h:
-Removed baseclasses array in struct type.
-Instead of using baseclasses[i], use fields[i-1].
-Added virtual_field_bits[i] to indicate if the i'th baseclass is virtual.
-Changed sign convention of voffset (previous was inconsistent).
-tm-news.h:
-Some macros (CALL_DUMMY and relatives) were missing. Put them back.
-utils.c:
-Used to assume existence of vsprintf. Re-written to not need it
-if HAVE_VPRINTF is undefined.
-valops.c:
-typecmp was too pessimistic. Made it less so.
-valprint.c:
-Don't print space after address.
-If vtable points to a misc symbol (with 0 offset), print it,
-since that indicates the actual class of the object.
-Changed ype_print_derivation_info to use new inheritance
-scheme (without baseclasses vector).
-values.c:
-In value_primitive_field, fixed some bugs left over from previous set of fixes.
-Also, changes needed because TYPE_BASECLASSES were removed.
-xm-news.h:
-REGISTER_U_ADDR didn't work for PC. Rewrote to use an array.
-
-Tue Aug 21 20:08:54 1990 John Gilmore (gnu at cygint)
-
- * source.c:
- If there is no path set, and the symbols don't indicate what directory
- a file was compiled in, look in the current directory. But either
- a path or a known compilation directory will prevent this.
-
- * dbxread.c:
- Three independent bug fixes:
- * Remove the #if 0 block that breaks some stuff.
- * SunOS 4.1 fixed the promoted-parameter-wrong-addr bug in Sun C;
- adapt gdb to either SunOS 4.0.* or 4.1.
- * MAX_OF_TYPE and MIN_OF_TYPE thinko. By tedg@sun, I think.
-
- * symtab.c:
- Instantiate the class T when looking for methods in it. (Tiemann@sun)
-
- * valprint.c:
- (type_print) Demangle the name being printed.
- (type_print_base) Handle botched demangling without coredump (tiemann).
-
- * values.c:
- (check_stub_method): Document routine.
- (tiemann) fix bug for no-arg functions
- Avoid clobbering beyond end of malloc'd storage.
- Terminate the argument list properly.
-
-Sat Aug 18 01:29:59 1990 Per Bothner (bothner@cs.wisc.edu)
-
- * Changes merged by John Gilmore:
-
-breakpoint.c:
- In breakpoint_1, use new print_address_symbolic instead
- of find_pc_partial_function. (This forces use of assembler-level
- addresses, and avoids misleading non-mangled source-level names.)
-cplus-dem.c:
- Generalize ansi argument such that -1 means skip arglist totally.
- Removed global variable print_ansi_qualifiers (which made
- code non-reentrant), in favor of extra explicit arguments
- to internal routines.
-printcmd.c:
- Add new helper function print_address_symbolic.
- Use find_pc_misc_function instead of find_pc_partial_function
- (since we want assembler-level symbols here).
-stack.c:
- Print unknown function as just "f (...)", not "f (...) (...)".
- Use new fputs_demangled explicitly.
-symtab.c:
- Fixed a typing violation (problem: value.h cannot be imported
- without renaming many variable in this file).
- lookup_symbol: If no matching misc_func, look for a C++-mangled name.
- decode_line_1: Moved forward some never-reached code.
- Made decode_line_2 skip function prologues correctly.
-utils.c:
- fputs_filtered should not demangle by default.
- Add new fputs_demangled to demangle on demand..
-valops.c:
- Change value_struct_elt to use value_primitive_field (using recursive
- utility function search_struct_field). This allows foo.bar to work
- for multiple inheritance (so far only for data fields).
- Change check_field in the same way (recursive helper function
- to support multiple inheritance).
- (Note: there are more of these problems that I haven't fixed.
- Any code that says TYPE_BASECLASS (t, 1) is probably wrong.)
- value_of_this: 'this' symbol name is now just "this", note "$this".
-valprint.c:
- Don't print static members.
- Avoid printing "members of <type>" if there are none.
- Simplified type_print_derivation_info by merging duplicate code.
- Remove useless blank lines in type_print_base (ptype command).
-value.h:
- Added declaration of new routine value_primitive_field.
-values.c:
- Added value_primitive_field which is generalized version of
- value_field that can handle multiple inheritance (non-zero offsets etc).
- Re-implemented value_field to call value_primitive_field.
-
-Fri Aug 17 23:33:44 1990 John Gilmore (gnu at cygint)
-
- * infcmd.c -- insert else to avoid 'delete env' coredump when you
- delete the whole environment. Karl Berry reported the bug.
- * source.c - fix openp to avoid //'s in filenames, which
- trigger an Emacs bug causing it to not be able to find files
- when running gdb in a window.
- * dbxread.c - zap the #if 0 that botches the add-file code.
- It seems to work a lot better without all the code commented out.
-
-Fri Jul 20 16:58:46 1990 John Gilmore (gnu at cygnus.com)
-
- * Merge Tiemann's and Ted Goldstein's changes, detailed below,
- into gdb-3.90.9.
-
-Tue Jul 17 19:34:33 1990 Ted Goldstein (tedg at golem)
-
- * Makefile - added a ${CFLAGS} to a couple of entries,
- added remote-sa.sparc.c
- * added remote.sa-sparc.c, a modification of remote.c
- which conducts a dialog directly with the SparcStation prom.
- * breakpoint.c, infrun.c, sparcdep.c added
- remote_insert_breakpoint(), and remote_remove_breakpoint()
- to breakpoint.c instead of directly writing breakpoint instructions.
- * sparcdep.c on remote_debugging,there is no need
- to remove signle step breakpoint instructions.
- * main.c added "-epoch" flag and "int epoch_interface" to main.c
- global variable
- * printcmd.c - epoch interface sends lisp expressions to open up
- epoch windows on inspection.
- * valprint.c - added arrayprint, and addressprint and made adding
- format controls easier
- * wait.h added a couple of undef's because we were getting
- complaints about WSTOPSIG and WTERMSIG begin redefined.
-
-
-Wed Jul 4 05:27:51 1990 Michael Tiemann (tiemann at masham)
-
- * symtab.c (decode_line_1): Add support for handling method stubs
- in the type information.
-
-Tue Jul 3 09:39:18 1990 Michael Tiemann (tiemann at masham)
-
- * values.c (baseclass_addr): Run loop from INDEX+1 to
- N_BASECLASSES; otherwise, we can still get into a loop.
- @@ This should be restructured to use a cleaner search strategy.
-
-Sun Jul 1 12:28:51 1990 Michael Tiemann (tiemann at masham)
-
- * dbxread.c (define_symbol,read_type): Grok GNU C++'s new
- abbreviation "Tt" for tags which have the same name as their
- typedecls.
-
-Fri Jun 29 01:03:46 1990 Michael Tiemann (tiemann at masham)
-
- * symtab.c (list_symbols): add ability to set breakpoints on all
- the functions which match a particular regular expression.
-
-Tue Jun 26 04:26:29 1990 Michael Tiemann (tiemann at masham)
-
- * cplus-dem.c (cplus_demangle): New parameter ANSI says whether we
- should print ANSI qualifiers (such as `const' and `volatile').
- All callers changed to call with ANSI == 1, except from
- `check_method_stub', which uses old-style syntax.
-
- * symseg.h (struct fn_field): Remove unneccessary `args' field.
- * symtab.h (TYPE_FN_FIELD_ARGS): Redefined.
-
- * values.c (check_stub_method): New function.
-
- * cplus-dem.c (do_type): Handle "long long" (encoded as 'x').
-
- * dbxread.c (read_type): Handle new GNU C++ method type stubs.
- * valprint (type_print_base): Ditto.
-
- * symtab.c (gdb_mangle_typename): New function.
-
-Tue Jun 5 00:18:43 1990 Michael Tiemann (tiemann at gzilla)
-
- * breakpoint.c (catch_command): New function. Provides a
- mechanism to set breakpoints based on catch clauses.
- (disable_catch): Similar, but disables breakpoints on catch
- clauses.
- (delete_catch): Similar, but deleted breakpoints on catch clauses.
-
-Sun Jun 3 22:54:08 1990 Michael Tiemann (tiemann at gzilla)
-
- * blockframe.c (blockvector_for_pc): New function.
- * blockframe.c (block_for_pc): Changed to call
- `blockvector_for_pc' and get the block itself.
-
- * stack.c (catch_info): New function. Prints info about
- exceptions which can be caught in the current frame.
- * stack.c (print_frame_label_vars): New function. Similar to
- `print_frame_local_vars'.
- * stack.c (print_block_frame_labels): Prints out labels that are
- defined in this frame. These labels are exceptions that can be
- caught.
-
- * dbxread.c: Updated to handle N_CATCH symtab types.
-
-Thu May 3 22:10:00 1990 Michael Tiemann (tiemann at teacake)
-
- * valprint.c (everywhere): TYPE_NAME (TYPE) no longer comes in the
- form "struct ..." for GNU C++. Don't flush any part of TYPE_NAME
- when printing the type.
-
-Wed May 2 22:43:04 1990 Michael Tiemann (tiemann at teacake)
-
- * valprint.c (val_print): Use `baseclass_addr' to access the
- baseclasses pointed to via the derived class object at VALADDR.
-
- * values.c (baseclass_addr): New function. Casts derived pointers
- to baseclass pointers taking virtual baseclasses and multiple
- inheritance into account.
-
-Sat May 5 12:39:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Version 3.90.9.
-
-Fri May 4 12:12:55 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * breakpoint.c (watch_command, bpstat_stop_status): Deal with
- exp_valid_block field correctly.
-
- * infrun.c (wait_for_inferior): When checking "don't even think
- about breakpoints" if stop_signal == SIGTRAP && trap_expected,
- also check step_resume_breakpoint.
- Insert breakpoints and continue (not step) if
- step_resume_break_address != NULL, even if another_trap.
- If trap_expected and we enter sigtramp, then set up a
- step_resume_break.
- If trap_expected is set when we hit the step_resume_break,
- set another_trap.
- When calling resume and trap_expected says tell resume to step
- (2 places), also check step_resume_break_address.
-
- * infrun.c (wait_for_inferior): Don't set
- prev_{pc,sp,func_{start,name}} before calling wait ().
- Do set them after exiting loop.
- Move their declarations outside functions.
- (start_inferior): Initialize them.
-
-Thu May 3 00:15:11 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * infrun.c (wait_for_inferior, after check for trap_expected > 1):
- Restore old code which distinguishes between trap_expected and
- running_in_shell, just make the latter take any non-TRAP signal,
- not just SEGV.
-
- * values.c (allocate_value): Zero VALUE_OPTIMIZED_OUT flag.
-
- * Makefile.dist (pinsn.o): Use PINSN_CC to compile.
- xconfig/3b1 (CC,PINSN_CC): Define.
-
- * xconfig/altos, altos-dep.c: Rename altos-dep.c to altos-xdep.c.
-
- * Version 3.90.8
-
- * breakpoint.c (bpstat_stop_status),
- infrun.c (wait_for_inferior) [SHIFT_INST_REGS]: New code.
-
- * param.h, tm-88k.h: Define ADDR_BITS_*.
- infcmd.c (jump_command, read_pc), infrun.c (wait_for_inferior),
- printcmd.c (do_one_display): Use them.
-
- * utils.c: Split #ifdef USG into a USG_UTILS and a QUEUE_MISSING.
- xm-88k.h: Define USG_UTILS.
-
-Wed May 2 00:05:33 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * printcmd.c (printf_command) [__INT_VARARGS_H]: New code.
- (printf_command): Add from_tty parameter.
-
- * valprint.c (value_print): Check VALUE_OPTIMIZED_OUT flag.
-
- * value.h: Add optimized_out field and change lazy field to
- char. Add macro VALUE_OPTIMIZED_OUT.
-
- * i386-pinsn.c: Change from Eirik Fuller to write to stream directly
- instead of stuffing things in buffers (oappend, etc).
-
- * breakpoint.c (bpstat_do_actions): If *BSP is set to NULL by
- execute_command, exit both loops.
-
- * Makefile.dist: Don't set TARGET_ARCH. Add .c.o rule.
-
-Tue May 1 17:07:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Makefile.dist (RAPP_OBS, rapp),
- rgdb.c, rserial.c, rudp.c, serial.c, udp.c, xdep.h,
- remote.h: Added.
- m68k-xdep.c, coredep.c: Wrap in #if !defined (RDB).
-
- * valops.c (value_struct_elt), values.c (value_static_field):
- Change error messages to remove references to `info methods'.
-
-Tue Apr 24 10:25:10 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * More 88k changes:
- infrun.c (start_inferior): Add START_INFERIOR_HOOK.
- infcmd.c [SHIFT_INST_REGS]: New code.
- findvar.c (read_relative_register_raw_bytes): Return a value.
- infcmd.c (do_registers_info): Check value from
- read_relative_register_raw_bytes.
-
- * command.c (delete_cmd): Free the struct cmd_list_element(s)
- we are removing.
-
-Mon Apr 23 10:42:21 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * More 88k changes:
- findvar.c (get_saved_register): New function.
- findvar.c: Rewrite code which called find_saved_register to
- call get_saved_register instead.
-
-Sun Apr 22 14:47:51 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * valprint.c (val_print): Change error message printed when
- the type has TYPE_FLAG_STUB set.
-
- * valprint.c (val_print): Check for TYPE_CODE_UNDEF.
-
- * findvar.c (write_register): Set register_valid (regno).
-
- * valops.c (call_function): Check for NULL return from block_for_pc.
-
-Fri Apr 20 11:31:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * findvar.c (write_register): Add PREPARE_TO_STORE.
- {sun3,sparc,symmetry}-xdep.c (PREPARE_TO_STORE): Add.
- infptrace.c, {mips,pyr,symmetry,sun3,arm,hp300hpux}-xdep.c
- (store_inferior_registers): Don't call read_register_bytes.
- symmetry-xdep.c (store_inferior_registers):
- #if 0 out code to fetch registers.
-
- * values.c (value_as_long): Call COERCE_ARRAY.
-
- * tm-sun3.h: Include tm-68k.h not m-68k.h
-
- * sparc-tdep.c (single_step): Set next_pc, npc4 within
- if (!one_stepped), not outside it.
-
- * Changes from Data General for 88k:
- * coffread.c (read_file_hdr): Add *88*MAGIC.
- * coffread.c (have_symbol_file_p): New function.
- * coffread.c [COFF_CHECK_X_ZEROES] [TDESC]: New code.
- * coffread.c (read_one_sym): If there is more than one
- aux entry, don't give an error message, just ignore the
- extra ones.
- * coffread.c (process_coff_symbol): Replace clipper with
- BELIEVE_PCC_PROMOTION in #ifdef's.
- * coffread.c: Define L_LNNO32 if not defined.
- (enter_linenos): Use it.
- * blockframe.c: Add INIT_FRAME_PC hook and use it in
- get_prev_frame_info.
- m-m88k.h: Use INIT_{FRAME_PC,EXTRA_FRAME_INFO} to do tdesc stuff.
- Use dummy versions of FRAME_CHAIN_*.
- * Makefile.dist, xconfig/i386*: Rename M_CLIBS to XM_CLIBS and add
- TM_CLIBS and CDEPS.
- tdesc/libdc.o: New target.
- tdesc.{c,h}, tdesc/*, {t,x}config/m88k: New files.
-
-Thu Apr 12 15:47:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * m68k-opcode.h (bras, bsrs): Use "Bw" not "Bg".
-
-Tue Apr 10 20:50:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Version 3.90.7.
-
- * xm-mips.h (BYTE_ORDER): If not defined, make it LITTLE_ENDIAN.
-
- * mips-xdep.c ({fetch,store}_inferior_registers): Remove variable
- offset and just use register_addr (regno, 1).
- (core_file_command): Remove variable reg_offset and just use
- register_addr (regno, 0).
-
- * gdbcore.h [COFF_FORMAT]: #undef a_magic before redefining it.
-
- * infrun.c ("if (trap_expected && stop_signal != SIGTRAP)", near end
- of wait_for_inferior): Always pass 0 as first arg to resume.
- #if 0 out "SIGSEGV in shell" test right above it (now redundant).
-
- * i386-pinsn.c (oappend_address): New function.
- (oappend): Make it "static void" and declare at top of file.
- (OP_J, OP_DIR): Use oappend_address.
-
-Mon Apr 9 15:22:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * mips-xdep.c: Include <mips/inst.h> not "mips/inst.h".
-
- * wait.h [HAVE_WAIT_STRUCT]: Put #defines in #if !defined so that
- it's OK if they are defined in <sys/wait.h>.
-
- * findvar.c (fetch_registers): Pass "registers", not "&registers",
- to remote_fetch_registers.
-
- * mips-tdep.c (_initialize_mipsdep): Remove hex_disassembler
- and re-write skip_prologue to use add_set_cmd.
-
- * Makefile.dist (alldeps.mak): Don't put \ after the last
- filename in each list.
-
-Sun Apr 8 01:59:19 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Version 3.90.6.
-
- * Makefile.dist (alldeps.mak): "XM_FILE" -> "XM_FILE=".
-
- * valarith.c (value_x_{un,bin}op): use "operator" not "operator "
- to match dbxread.c change of 16 Mar 90.
-
- * valarith.c (value_x_unop): Pass &static_memfuncp,
- not static_memfuncp.
-
- * breakpoint.c: Add watchpoint stuff.
- breakpoint.h: Add bpstat_should_step.
- infrun.c (proceed, wait_for_inferior): Use it.
- breakpoint.h: Add bpstat_print (and rename old bpstat_print
- to bpstat_should_print).
- infrun.c (normal_stop): Use it.
-
- * value.h: Add value_free. Declare a few functions.
-
-Sat Apr 7 21:43:43 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab): Remove PROFILE_TYPES code and
- insert comment suggesting easy shell script equivalents.
-
- * values.c (unpack_long): Give better error messages for
- unrecognized sizes of ints and floats.
-
-Fri Apr 6 00:32:21 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * dbxread.c, gdbcore.h (IS_OBJECT_FILE): Check for a_drsize
- nonzero as well as a_trsize.
-
- * More places: Use SWAP_TARGET_AND_HOST.
-
- * valops.c (destructor_name_p): Only skip "struct " if present.
-
- * main.c (gdb_readline): Return NULL on end of file.
-
- * sparc-opcode.h: Add jmp 1+2, jmp 1+i, jmp i+1.
-
- * Makefile.dist: Make expread.tab.c unambiguously be in srcdir.
-
- * main.c: Split source_command into source_command and
- read_command_file.
- (main): Accept "-" as arg to +command for stdin.
-
- * dbxread.c (psymtab_to_symtab): Don't read string table.
- (symbol_file_command): Save string table size.
-
- * Version 3.90.5
-
- * symtab.c: Remove declaration of lookup_misc_func.
-
- * mips-pinsn.c: Add use_hex_p stuff (re-worked from Forin stuff).
-
- * mips-opcode.h: Add bdelay field.
- mips-pinsn.c: Various changes from Forin, I think to make it look
- like the MIPS assembler format.
- mips-tdep.c, mips-xdep.c, mipsread.c: Various changes from Forin.
-
- * gdbcore.h: Declare register_addr.
-
- * gdbcore.h: Include <a.out.h>, before trying to redefine N_TXTADDR
- and friends.
- various: Don't include both a.out.h and gdbcore.h.
-
- * Makefile.dist (HFILES): Add param.h
-
- * utils.c (init_malloc): Moved here from mcheck.c and modified
- to use the standard mcheck.c
- Makefile.dist: Modify to reflect new mcheck.
-
-Thu Apr 5 16:38:28 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * valprint.c (val_print, print_hex_chars): Print integers
- larger than LONGEST.
-
- * valarith.c (value_sub): Give error message if attempt to
- subtract something of the wrong type from a pointer.
-
- * breakpoint.c (bpstat_stop_status): Initialize retval to NULL.
-
- * i386-tdep.c (i386_pop_frame): Change addr to adr.
-
-Wed Apr 4 05:21:50 1990 Jim Kingdon (kingdon at teenage-mutant)
-
- * main.c (command_line_input): return NULL on end of file.
- (execute_command): If p is NULL, return almost right away.
- (read_command_lines): Treat end of file like "end".
-
- * printcmd.c (print_frame_args): Change it so num is number
- of ints of args, not number of args.
-
- * xm-*.h: Make sure BYTE_ORDER is defined.
- Also fix various #includes of old names of things.
-
- * main.c (command_line_input): Fix comment code of 2 Apr.
-
- * values.c (value_from_long, unpack_long): SWAP_TARGET_AND_HOST.
- various: Replace {BYTES,WORDS}_BIG_ENDIAN with TARGET_BYTE_ORDER.
- valarith.c various: SWAP_TARGET_AND_HOST.
- dbxread.c (READ_FILE_HEADERS): SWAP_TARGET_AND_HOST.
- (SWAP_SYMBOL): New macro. Use it wherever symbuf_idx is incremented.
- exec.c (exec_file_command): SWAP_TARGET_AND_HOST.
-
- * valarith.c (value_subscripted_rvalue): Just bcopy() the
- appropriate bytes rather than playing strange games with
- value_from_long.
-
- * param.h (SWAP_TARGET_AND_HOST): New macro.
-
- * tm-np1.h (V7_REGNUM): Change from 27 to 26.
- (REGISTER_VIRTUAL_TYPE): Return correct result for vector regs.
- gould-tdep.c: New file.
-
- * Move reading of register before store from
- findvar.c (write_register) to
- infptrace.c, *-xdep.c (store_inferior_register).
-
- * findvar.c (fetch_registers, store_registers): New functions.
- write_register{,_bytes}: Use store_registers regardless of
- have_inferior_p.
- registers_valid: New variable.
- (supply_register, read_register, etc.): Use it.
- (read_register_gen): New variable.
- various: Use read_register_gen rather than read_register_bytes
- where appropriate.
- *-xdep.c (fetch_inferior_registers): Remove remote_debugging check.
- infrun.c (wait_for_inferior, start_inferior): Call registers_changed
- not fetch_inferior_registers.
- *-xdep.c (fetch_inferior_registers): Call registers_fetched if
- not setting registers via supply_register, and if fetching
- all registers.
- infptrace.c, *-xdep.c (fetch_inferior_registers): Add param,
- # of register to fetch (-1 for all).
- infptrace.c, hp300hpux-xdep.c (fetch_inferior_registers):
- Actually fetch only those registers needed.
- value.h: Declare all the extern register functions from findvar.c.
-
- * coffread.c (read_coff_symtab): Test for specific kinds of GCC
- labels (LI%.*, LPB%.*, etc), not just ??%.*.
-
- * coffread.c (record_misc_function): Use mf_text not mf_unknown.
-
- * utils.c,defs.h (lines_to_list): New function.
- source.c (select_source_symtab, list_command, forward_search_command,
- reverse_search_command), stack.c (print_frame_info):
- Use it instead of 10.
-
- * munch: If MUNCH_NM variable exists, use it.
-
- * main.c (initialize_main): Set rl_readline_name.
- main.c: #include readline.h and #undef savestring.
- Remove declarations of things declared in readline.h.
-
- * main.c (gdb_readline): If instream == 0, read from stdin.
-
- * main.c (main): Only call clearerr if ISATTY. Exit loop if
- feof (instream).
-
- * infcmd.c (detach_command): Set inferior_pid to 0 after
- calling remote_close.
-
- * main.c (main): If exec and sym files are the same, and there
- is an error reading execfile, don't try to read sym file.
-
- * infcmd.c (detach_command) [ATTACH_DETACH]: Don't try to detach
- from inferior when remote debugging.
-
- * source.c (reverse_search_command): Change while test from 1 to
- line > 1.
-
-Tue Apr 3 18:14:14 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Version 3.90.4.
-
- * Makefile.dist (gdb.tar.Z): Use -z option to tar rather than
- creating gdb.tar and calling compress separately.
-
- * breakpoint.c (read_memory_nobpt): Do not treat bcopy as if it
- returned an "errno" value.
-
- * various: Make sure gdbcore.h is not included before a.out.h.
-
- * Makefile.dist (OPCODES): Add mips-opcode.h.
-
- * config.gdb: Print lists of {hosts,targets} after finding srcdir.
- When parsing +{host,target}=, strip off +{host,target}=, not +{x,t}m=.
-
- * Makefile.dist (gdb.tar): Do {t,x}config not just config.
-
-Mon Apr 2 02:42:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * sparc-opcode.h (inc): Fix incorrect lose field.
-
- * valarith.c (value_subscripted_rvalue): Use TARGET_BYTE_ORDER,
- rather than checking endianness at runtime.
-
- * main.c (comand_line_input): Accept comments anywhere, not
- just at starts of lines.
-
-Sat Mar 31 21:59:35 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * symtab.c (check_stub_type): Call lookup_symbol with 5 args.
-
-Fri Mar 30 15:23:52 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * frame.h: #include param.h.
- param.h: Protect against multiple inclusion.
-
- * i386-tdep.c (i386_get_frame_setup): Fix comment about what
- opcode 0x55 is.
- If 0x81 or 0x83 is followed by something besides 0xec,
- put codestream back where it was and return 0.
- [USE_MACHINE_REG_H]: Include <machine/reg.h> not <sys/reg.h>
- Move include of a.out.h above <sys/user.h>.
- (i386_frame_find_saved_regs): Make locals signed.
- (i386_frame_find_saved_regs, i386_push_dummy_frame, i386_pop_frame):
- Use REGISTER_BYTES, REGISTER_RAW_SIZE, etc. to deal with floating
- point registers.
-
-Wed Mar 28 18:33:40 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * Makefile.dist (OTHERS): Add gdb.dvi.
- (gdb.dvi): New rule.
-
- * breakpoint.c (_initialize_breakpoint): Clean up docstrings so
- as not to mention subcommands (e.g. auto-display).
- Call add_cmd not add_abbrev_cmd for "disable breakpoint" and
- put it in class_alias.
-
- * breakpoint.c (set_breakpoint_count): New function.
- (set_breakpoint, break_command_1): Use it.
-
- * breakpoint.c (get_number): New function.
- (*_command, map_breakpoint_numbers): Use it.
-
- * infptrace.c (write_inferior_memory): Remove remote_debugging
- stuff (is handled in core.c).
- (read_inferior_memory): Remove #if 0'd out remote_debugging code.
-
-Tue Mar 27 16:51:27 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * inferior.h: Include frame.h.
-
- * findvar.c (write_register): Replace sun4 #ifdef with
- check of CANNOT_STORE_REGISTER.
- xm-sparc.h: Define CANNOT_STORE_REGISTER.
-
- * sparc-tdep.c: Remove superfluous declaration of
- get_breakpoint_commands.
-
- * breakpoint.{c,h}: Add bpstat stuff.
- bpstat_do_action: Re-work do_breakpoint_commands into this.
- main.c (command_loop): Call bpstat_do_action not
- do_breakpoint_commands.
- inferior.h, infrun.c, breakpoint.c, infcmd.c:
- Rework breakpoint_commands and stop_breakpoint
- stuff to use bpstat instead.
-
- * infcmd.c (program_info): "info reg"->"info registers".
-
- * np1-opcode.h: Renamed from npl-opcode.h.
- gould-pinsn.c: Include np1-opcode.h.
- Makefile.dist (OPCODES): Change npl-opcode.h to np1-opcode.h
-
- * coffread.c (read_enum_type): Stop reading when we hit .eos.
-
-Mon Mar 26 15:52:35 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Version 3.90.3.
-
- * breakpoint.c (read_memory_nobpt): New function.
- gdbcore.h: Declare read_memory_{nobpt,check}.
- mips-tdep.c: Use read_memory_nobpt not breakpoint_shadow_val.
-
-Fri Mar 23 14:26:38 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * inflow.c (terminal_inferior): Reenable commented out
- inferior_thisrun_terminal check.
- (terminal_ours_1): If inferior_thisrun_terminal is nonzero,
- return immediately.
-
- * Makefile.dist: Rewrite DEPFILES, M_FILE, etc. stuff to deal
- with host & target separation.
-
- * config/*: Split into xconfig/* and tconfig/*.
- *-dep.c: Split into *-xdep.c and *-tdep.c.
-
- * main.c (main): Always pass two args to xrealloc.
-
-Thu Mar 22 20:29:25 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * Makefile.dist ({,dist}clean): rm {x,t}m.h not param.h
- xgdb.o: Remove obsolete dependency (now in depend).
-
- * arm-pinsn.c: Include arm-opcode.h not opcode.h.
-
- * mips-pinsn.c, mips-opcode.h: New files from Bothner (from
- release of 24 Jan 90 with mips-opcode.h patch from 1 Feb 90).
-
- * utils.c (xmalloc): Return NULL on request for 0 bytes.
-
-Wed Mar 21 13:30:08 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * config.gdb: Re-write machine stuff to deal with host & target.
-
- * xm-altos.h: Don't define HAVE_WAIT_STRUCT.
-
- * m-*.h: Split into xm-*.h and tm-*.h.
-
- * infrun.c (wait_for_inferior): Put #ifdef sony_news code
- in regardless of machine.
-
- * symtab.c (decode_line_1): Add quotes and capitalize error
- message "no class, struct, or union named".
-
- * Makefile.dist (cplus-dem.o): Compile with -Dnounderscore.
-
- * stack.c (print_frame_info): Use print_symbol to print function name.
-
- * symtab.c (output_source_filename): Don't print a comma if
- we are skipping a filename already printed.
-
-Tue Mar 20 10:48:54 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * symtab.c (output_source_filename): Don't print a filename
- more than once.
-
- * utils.c (fprint_symbol): New function.
- defs.h: Decalare it.
- various: Use fprint_symbol to print symbol names.
- Makefile.dist (SFILES, OBS): Add cplus-dem.{c,o}.
-
-Mon Mar 19 17:11:03 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * coffread.c (read_file_hdr): Add MC68K??MAGIC.
-
- * coffread.c (read_coff_symtab): Ignore swbeg and string label
- symbols.
-
- * coffread.c (read_coff_symtab): Increment num_object_files
- in case C_STAT not C_FILE.
- New variable in_source_file. Set it in case C_FILE.
- Check it in case C_STAT.
-
- * coffread.c [FUNCTION_EPILOGUE_SIZE]: New code.
- m-umax.h (FUNCTION_EPILOGUE_SIZE): Define.
-
- * config/3b1: New file.
-
- * config/sun*: Print message warning people to use GAS with GCC.
-
-Sun Mar 18 02:56:40 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * infcmd.c (run_stack_dummy): Change error message.
-
- * m-68k.h (REGISTER_VIRTUAL_TYPE): Make pc, fp, sp char *.
-
- * m-mips.h (LONGEST, BUILTIN_TYPE_LONGEST): Remove.
-
-Sat Mar 17 21:27:49 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * mips-dep.c: Remove infptrace.c stuff.
-
- * m-bigmips.h: New file.
- m-mips.h [MIPSEB]: Remove *_BIG_ENDIAN stuff.
-
- * m-sparc.h (FIX_CALL_DUMMY): Do not insert unimp instruction
- if function was compiled with gcc.
-
- * m-mips.h: Remove FIX_CALL_DUMMY_ALIGNED and make FIX_CALL_DUMMY
- use new args.
-
- * valops.c (call_function): New args to FIX_CALL_DUMMY.
- m-*.h (FIX_CALL_DUMMY): Take new args.
-
- * values.c (using_struct_return): New parameter gcc_p.
- valops.c (call_function): New variable using_gcc.
- valops.c (call_function) [REG_STRUCT_HAS_ADDR]: New code.
-
- * m-mips.h, mips-dep.c: New files from Forin.
- m-mips.h: Replace RETURN_STRUCT_BY_REF with USE_STRUCT_CONVENTION.
-
-Fri Mar 16 13:17:19 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Makefile.dist: Add some dependencies of m-*.h files.
- (HFILES): Add m-68k.h.
-
- * dbxread.c (read_struct_type): Put "operator+" not "operator +"
- in symtab.
-
- * core.c: Split read_memory into read_memory_check and read_memory.
- breakpoint.c (insert_breakpoints): If can't read memory,
- tell user that error was due to seting breakpoints.
-
-Thu Mar 15 11:47:19 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * infrun.c [COFF_ENCAPSULATE]: Include a.out.encap.h.
-
- * blockframe.c (FRAMELESS_LOOK_FOR_PROLOGUE): Make it a function.
- various m-*.h: Call function not macro.
- frame.h: Declare the function.
-
-Wed Mar 14 02:44:51 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * sparc-dep.c: Include signame.h.
-
- * sparc-pinsn.c (print_insn): When looking for sethi before
- delayed branch, call read_memory_noerr not read_memory.
-
- * m-isi.h, m-sun3.h, m-news.h, m-hp300bsd.h, m-altos.h,
- m-hp300hpux.h, m-sun2.h: Merge machine stuff except inferior
- function call stuff into new file m-68k.h. Create m-3b1.h.
-
-Tue Mar 13 21:34:33 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * inflow.c (new_tty): If can't open tty, print error message
- before exiting.
-
- * blockframe.c: Remove declaration of psymtab_to_symtab.
- symtab.h: Declare psymtab_to_symtab.
- blockframe.c: Remove declarations of block_for_pc and
- find_pc_function_start.
- frame.h: Add declarations of block_for_pc and find_pc_function_start.
- Remove declaration of nonexistent function find_pc_function.
- values.c: include frame.h instead of declaring block_for_pc.
-
- * Version 3.90.2.
-
-Mon Mar 12 14:20:06 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * main.c (main): Delete superfluous "e" from long_options.
-
-Sat Mar 10 15:47:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * valprint.c (val_print): Print <%d bit integer> not just
- <large integer>.
-
- * dbxread.c (error_type): Fix loop that finds '\0' so that on
- exit, *pp points to the '\0', not the character after.
- (read_type): Make sure that places which call read_type and then
- try to read more input stop immediately with another error
- upon encountering '\0'.
-
- * dbxread.c (read_range_type): Fix check for large signed
- integral type to match comment and reality. Set TYPE_LENGTH based
- on n2bits for signed, n3bits for unsigned.
-
- * infcmd.c (cont_command): Print warning message if we
- decide to ignore the argument.
-
- * gdb.texinfo (attach): @xref{Attach} -> @xref{Remote}.
-
-Fri Mar 9 16:26:47 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * symtab.h (address_class): Reinstate LOC_EXTERNAL with rewritten
- comment.
-
- * expread.y (yyerror, parse_c_1): Make yyerror take a char * arg.
-
- * main.c (symbol_completion_function): Don't call error() on
- "info jkldskf".
-
- * m-npl.h (USE_STRUCT_CONVENTION): Change >= to >.
-
-Thu Mar 8 00:19:01 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * symseg.h: Nuke more symseg references including LOC_EXTERNAL.
- Put contents of symseg.h into symtab.h and remove symseg.h.
-
-Wed Mar 7 18:02:15 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * symtab.h (SYMBOL_LINE): New macro.
- symtab.c (decode_line_1): Accept variable as well as function.
- Lookup variable/function in selected block if no file specified.
- printcmd.c: #if 0 out whereis_command.
-
- * command.c (do_setshow_command): Call function with additional
- argument C.
- main.c (set_history_size_command): Take argument C.
- (set_verbose): New function to set docstring.
- (initialize_main): Put set_verbose in command list.
- command.c (lookup_cmd_1): Accept result_list NULL.
-
- * valprint.c (_initialize_valprint): Change docstring for
- "set unionprint" to normal set/show form.
-
- * command.c (add_show_from_set): Check that docstring starts with
- "Set " before assuming it does.
-
- * main.c (show_history): Call cmd_show_list.
- command.{c,h} (cmd_show_list): New function.
- command.h: Declare do_setshow_command.
-
- * command.h (cmd_list_element): New field completer.
- main.c (symbol_completion_function): Use it.
- symtab.h: Declare make_symbol_completion_list.
- command.c (add_cmd): Set completer.
- main.c, gdbcmd.h (noop_completer): New function.
- infcmd.c: Set completer for environment functions.
-
- * symtab.c (types_info, _initialize_symtab): #if 0 out.
- various: Use fputs_filtered, not fprintf_filtered(%s).
-
- * valprint.c (type_print_base): Check for integers larger than
- LONGEST.
-
- * sun3-dep.c: Include "signame.h" instead of directly declaring
- sys_siglist.
-
-Tue Mar 6 14:59:34 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * infrun.c (signals_info): Allow argument to be a signal name
- as well as an expression.
- (handle_command): Check for error from sig_number.
-
- * main.c (float_handler): Change error message.
-
- * inflow.c (create_inferior): If getenv ("SHELL") exists, use it
- instead of /bin/sh.
-
- * dbxread.c (read_dbx_symtab, case N_SO): New variable first_symnum.
- Pass it to {start,end}_psymtab.
-
- * dbxread.c (read_ofile_symtab): Increment symbuf_idx and symnum
- when calling process_symbol_pair.
-
- * symtab.c (sources_info, output_source_filename):
- Re-write so output_source_filename takes a first parameter
- instead of a next one.
-
- * dbxread.c (read_dbx_symtab, case N_SO): When incrementing
- symbuf_idx, increment symnum also.
-
- * values.c (set_internalvar_component): Use VALUE_CONTENTS,
- not VALUE_CONTENTS_RAW.
-
- * symmisc.c (free_symtab): Don't free filename (now in symbol_obstack).
-
- * environ.c (init_environ): Copy entire string, including
- terminating '\0'.
-
- * value.h, values.c: Rename value_lazy to value_fetch_lazy.
- values.c (value_of_internalvar): Call value_fetch_lazy.
-
- * dbxread.c (read_huge_number): Return an error on encountering
- a large decimal number.
-
- * dbxread.c (read_huge_number): Reverse sense of overflow test.
-
- * valprint.c (val_print, case TYPE_CODE_INT): Check for integers
- larger than LONGEST.
-
- * dbxread.c (read_ofile_symtab): When calling process_one_symbol,
- call it with desc and value rather than with bufp->n_{desc,value}.
-
- * defs.h (LONG_MAX): Define.
-
- * sun3-dep.c: Declare sys_siglist.
-
- * infptrace.c: Move include of gdbcore.h after a.out.h
-
- * Makefile.dist (expread.o, mcheck.o): Remove leading "./" not
- leading ".".
-
- * m-hp300hpux.h [!HPUX_VERSION_5]: Define KERNEL_U_ADDR_HPUX.
- infptrace.c [KERNEL_U_ADDR_HPUX] [KERNEL_U_ADDR_BSD]:
- Set kernel_u_addr using nlist().
- m-hp300bsd.h: Define KERNEL_U_ADDR_BSD.
-
-Mon Mar 5 16:52:41 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab): If value of .o symbol is crazy,
- don't end psymtab.
-
- * dbxread.c (read_dbx_symtab): Ignore first of a pair of N_SO
- when both appear.
- (start_subfile, start_symtab): Extra parameter dirname.
- (start_subfile): Use obsavestring, not savestring, for name.
- various: Call start_{subfile,symtab} with extra argument.
- (end_symtab): Set dirname field in symtab.
- (read_ofile_symtab): Call process_symbol_pair on pair of N_SO.
- (process_symbol_pair): New function.
- symtab.h (symtab): New field dirname.
- source.c (open_source_file): New function.
- source.c: Use open_source_file instead of openp where appropriate.
-
- * defs.h (TARGET_CHAR_BIT): Define.
-
-Sun Mar 4 13:11:48 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * dbxread.c (fill_symbuf): Print error messages nicely.
-
- * Makefile.dist (SFILES): Put standalone.c at end.
-
- * Makefile.dist (alldeps.mak): Put out backslash after arm-convert.s.
-
- * symtab.{c,h} (builtin_type_error): New type.
- symseg.h (type_code): Add TYPE_CODE_ERROR.
- valprint.c (val_print, type_print_base),
- values.c (using_struct_return, set_return_value):
- Check for and deal with TYPE_CODE_ERROR.
- dbxread.c (error_type): New function
- (read_type and subroutines): Call error_type instead of error.
-
- * dbxread.c (read_huge_number): New function.
- (read_range_type): Use read_huge_number and check results
- to see if it is a large integral type.
-
- * symmisc.c: Remove symseg stuff.
-
- * Gould NP1 changes from (or inspired by) chpmjd@gdr.bath.ac.uk
- dbxread.c (read_dbx_symtab) [N_NBSTS]:
- Treat this and N_NBLCS like N_LCSYM, etc.
- (process_one_symbol) [BLOCK_ADDRESS_ABSOLUTE]: New code.
- m-npl.h (USE_STRUCT_CONVENTION): Add.
- (IGNORE_SYMBOL): Add 0xa4.
- (END_OF_TEXT_DEFAULT): Remove.
- (STRING_TABLE_OFFSET): don't add sizeof(int).
- [!HAVE_VPRINTF]: Define vprintf to be doprnt, not printf.
- (BLOCK_ADDRESS_ABSOLUTE): Define.
- (BREAKPOINT): Pad to size of machine word.
- (SAVED_PC_AFTER_CALL): Remove ` at start of line (!).
- (R2_REGNUM): Define.
- (SP_REGNUM, FP_REGNUM): Switch definitions.
- (REGISTER_U_ADDR): Use FP_REGNUM in place of SP_REGNUM.
- (STORE_STRUCT_RETURN, EXTACT_RETURN_VALUE, STORE_RETURN_VALUE,
- call function stuff):
- Replace bogus definitions with correct ones for NP1.
- (CANNOT_EXECUTE_STACK): Define.
- (FRAME_LOCALS_ADDRESS): Don't add 80.
- (FRAME_FIND_SAVED_REGS): Also get SP.
- gould-pinsn.c (findframe): Move framechain declaration outside #if 0.
- infptrace.c (write_inferior_memory): Check addr against text_end
- and use PT_WRITE_I or PT_WRITE_D as appropriate.
- (store_inferior_registers): Don't try to write registers in
- CANNOT_STORE_REGISTER.
- m-npl.h (CANNOT_STORE_REGISTER): Define.
- npl-opcode.h (lil): 0xf8080000 -> 0xf80b0000.
-
- * munch: Distinguish between BSD and System V nm by actually
- seeing what output from nm looks like.
-
-Fri Mar 2 13:43:36 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * printcmd.c (print_frame_args): Change highest_offset to point
- to next unprinted arg.
-
- * main.c (main): Print "type help for list of commands" along
- with the version. Follow it with a blank line.
-
-Thu Mar 1 14:49:26 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * valprint.c: Move print_address for function from value_print
- to val_print.
-
-Wed Feb 28 15:06:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Makefile.dist (m-sun4os4.h): Depend on m-sparc.h
-
- * Makefile.dist (version.c): Depend on Makefile.dist, not Makefile.
-
- * Makefile.dist: Change MAKEFILES to Makefiles.
-
- * symtab.h: Declare get_sym_file.
- core.c: Include symtab.h.
-
- * Move signal name stuff from utils.c to signame.c
- Move signal name stuff from defs.h to signame.h.
- Makefile.dist (SFILES, HFILES, OBS): Add signame.{c,h,o}.
-
-Mon Feb 26 12:03:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * command.c (add_cmd): Don't call savestring on name.
-
-Sun Feb 25 15:52:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * printcmd.c (print_frame_args): Make highest_offset an int.
- New variable args_printed.
- (print_frame_nameless_args): Remove parameter end and add num
- and first.
- (print_frame_args): Change call to print_frame_nameless_args.
-
-Fri Feb 23 21:40:15 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * stack.c (up_command, down_command):
- Only print stack frame if from_tty.
-
-Thu Feb 22 12:01:36 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * expread.y: Inlcude value.h and don't cast return value from
- lookup_internalvar.
-
- * infrun.c: Remove code in #ifdef UMAX_PTRACE.
-
- * values.c (convenience_info): Print in form "$foo = 5".
- Don't print "Debugger convenience variables:" before first one.
-
- * Makefile.dist: Remove ADD_FILES from CLIBS.
- (gdb, kdb, xgdb): Put in ADD_FILES as well as CLIBS.
-
- * m-pyr.h: #if 0 out call dummy stuff.
- Put in POP_FRAME which just calls error().
- valops.c: If CALL_DUMMY is not defined, put in dummy call_function
- which just prints an error message.
-
-Tue Feb 20 22:11:40 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * breakpoint.c (commands_command): Add arg from_tty.
-
- * main.c (main): Put if (!setjmp (to_top_level)) around calls
- to *_command made in response to command line arguments.
-
-Mon Feb 19 13:58:28 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * main.c (main): Use getopt_long_only. Move one-character options
- to long_options. Remove entries which are just unambiguous
- abbreviations of other options.
-
- * command.h: Add types cmd_types and var_types.
- Add fields type, var_type, and var to struct cmd_list_element.
- command.c (add_set_cmd, add_set_from_show): New functions.
- (add_cmd): Set c->var_type.
- (add_abbrev_cmd): Call add_cmd instead of duplicating code.
- main.c: Add showlist.
- Move parse_binary_operation from main.c to command.c.
- command.c (do_setshow_command): New function.
- gdbcmd.h: New file.
- Makefile.dist: Add gdbcmd.h.
- many files: Include gdbcmd.h, use add_set_cmd and add_show_from_set.
- Replace info * with show * where appropriate.
- utils.c (fputs_filtered): Use UINT_MAX in lines_per_page to mean
- no paging.
- defs.h: Define UINT_MAX.
- infcmd.c (run_command): Use execute_command, not set_args_command.
- main.c (execute_command): Call do_setshow_command if necessary.
- main.c (show_command, show_history): New functions.
- main.c (initialize_main): Call add_prefix_cmd
- for show and show history.
-
- * coffread.c (enter_linenos): Print error if
- file_offset < linetab_offset.
-
-Sun Feb 18 15:37:05 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * convex-dep.c (comm_registers_info): Fix typo. ("argc"->"arg").
-
-Wed Feb 14 20:45:14 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * config.gdb: Create Makefile with make.
-
- * Makefile.dist, config.gdb: Move "srcdir=" line from Makefile.dist
- to new file Makefile.srcdir.
-
- * valprint.c: Include <errno.h>.
-
- * value.h: Declare value_coerce_function.
-
- * findvar.c: Add missing " after #include "gdbcore.h
-
- * main.c (main): Re-write command parsing to use getopt.
- On "gdb +help" print options with '+' not '-'.
- Makefile.dist: Add getopt.
-
-Tue Feb 13 00:08:27 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Makefile.dist: Add "srcdir=."
- config.gdb: Edit srcdir= rather than adding it to the beginning.
-
- * pyr-dep.c: Make global_reg_offset, last_frame_offset not static.
- Move definition of reg_stack_offset to core.c [REG_STACK_SEGMENT].
-
- * config/pyramid: Print message about alloca.
-
- * breakpoint.c (clear_command): When printing "no breakpoint"
- error, only use arg if non-NULL.
-
- * core.c (read_memory): Rename to read_memory_noerr.
- (read_memory): New function which calls read_memory and checks for err.
- gdbcore.h: Declare all extern core.c functions.
- move myread from core.c to utils.c.
- declare it in defs.h.
- (read_memory_integer): move from infcmd.c to core.c.
- gdbcore.h: Declare it.
- Many places: Remove error checking on read_memory, or call
- read_memory_noerr instead. Include "gdbcore.h" if calling either.
-
- * value.h (COERCE_ARRAY): Coerce functions to function pointers.
- valops.c (value_coerce_function): New function.
-
- * core.c, convex-dep.c, arm-dep.c (xfer_core_file): Return EIO
- if address out of bounds.
-
- * m-arm.h, arm-dep.c arm-pinsn.c arm-opcode.h: New files.
- dbxread.c, m-convex.h (VARIABLES_INSIDE_BLOCK): Add gcc_p parameter.
- Makefile.dist (alldeps.mak): Special case for arm-convert.s.
- dbxread.c (define_symbol): Check for local based on it not
- being any one of the known deftypes.
- values.c (using_struct_return): Use new macro USE_STRUCT_CONVENTION.
-
- * Makefile.dist, config.gdb: Put in srcdir stuff.
-
-Mon Feb 12 22:46:16 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * breakpoint.c: Add addr_string and cond_string fields to
- struct breakpoint.
- (break_command_1): Set them. Use mention ().
- (mention): Create with code from break_command_1.
- (breakpoint_re_set): New function.
- (breakpoint_clear): Remove.
- (condition_command): Set cond_string.
- (breakpoint_delete): Free cond_string and addr_string.
- Declare parse_c_1's type and remove casts to struct expression *.
- symmisc.c (free_all_symtabs): Don't call breakpoint_clear.
- dbxread.c, coffread.c (reread_symbols): Call breakpoint_re_set,
- Include breakpoint.h.
- breakpoint.h: New file.
- dbxread.c: Move declaration of symmisc.c functions to symtab.h.
-
-Sun Feb 11 17:29:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * symtab.c: Make lookup_block_symtab extern.
- symtab.h: Declare it.
- valops.c (value_of_this): Use it.
-
-Fri Feb 9 08:59:37 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * config/hp300hpux: Print message telling people to use gcc.
-
- * value.h: Declare print_floating.
- printcmd.c (print_scalar_formatted, case 'f'): Use print_floating.
- valprint.c (val_print, case TYPE_CODE_FLT): Use print_floating.
- valprint.c (print_floating): Make this function out of is_nan
- and the code which was in val_print.
- Put parentheses around high & 0xfffff.
- Print sign and fraction for NaN's.
- Print 17 digits not 16 for doubles.
- (is_nan): Remove.
- m-news.h, m-sun3.h: Define IEEE_FLOAT.
-
- * Rename gld-pinsn.c to gould-pinsn.c.
- config/{pn,npl}: Change name of gld-pinsn.c
-
-Tue Feb 6 00:25:36 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * infptrace.c: Define PT_ATTACH if not defined.
- m-hp300hpux.h: Define ATTACH_DETACH.
-
- * main.c (initialize_main): Change alias class to aliases.
-
- * dbxread.c: Search and destroy references to symsegs.
- Also remove some #if 0'd code.
-
- * core.c: Remove reread_exec.
- dbxread.c (reread_symbols): New function.
- dbxread.c (symbol_file_command): Set symfile_mtime.
- coffread.c: Same.
- infcmd.c (run_command): Call reread_symbols not reread_exec.
-
- * valprint.c (val_print): When printing string after char *, print
- it for "" just like any other string.
-
- * core.c (reread_exec): New procedure.
- infcmd.c (run_command): Call reread_exec.
-
- * coffread.c (symbol_file_command): Add from_tty.
-
- * dbxread.c (symbol_file_command): Only ask about loading new
- symbol table if from_tty.
-
-Mon Feb 5 02:25:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * inflow.c (inferior_died): Call breakpoint_clear_ignore_counts.
-
- * Makefile.dist (OBS): Remove dbxread.o and coffread.o.
-
- * config.gdb: Ignore files ending in '#' in config.
-
- * stack.c (backtrace_command): Add QUIT to get_prev_frame loops.
-
-Sat Feb 3 22:25:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * Makefile.dist (YACC): Don't use -v.
-
-Fri Feb 2 19:26:50 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * createtags: Only change .o to .c at end of name.
-
- * Makefile.dist (alldeps.mak): new target.
- (Makefile): add alldeps.mak.
- (SOURCES): remove PINSNS.
- (TAGFILES: use ALLPARAM.
- (gdb.tar): add config/.
-
- * config.gdb: Check for M_FILE= not #param.h
- config/*: Make sure M_FILE= exists with space after M_FILE=.
- Makefile.dist (TAGS): Pass M_FILE and DEPFILES.
- createtags: Change .o to .c. Remove special tests for dep.c etc.
-
- * dbxread.c, coffread.c: Don't check COFF_FORMAT and READ_DBX_FORMAT.
- Makefile.dist: Move {dbx,coff}read.c from SFILES to ALLDEPFILES.
- config/*: add dbxread.o or coffread.o to depfiles.
-
- * Makefile.dist (depend): Depend on $(SOURCES), not force.
-
-Thu Feb 1 17:43:54 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * symmisc.c (print_symbol): Print newline after label.
-
-Wed Jan 31 22:35:38 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * dbxread.c (read_addl_syms): Remove code that checks for
- _etext.
- Move end_of_text_addr into read_dbx_symtab.
- (read_dbx_symtab): #if 0 out code which checks for _etext.
-
-Tue Jan 30 15:40:19 1990 Jim Kingdon (kingdon at albert.ai.mit.edu)
-
- * Makefile.dist (gdb.tar): Use readline's "make readline.tar"
- instead of having a list of readline files.
-
- * infrun.c (normal_stop): #if 0 out "you have found a bug in sh".
-
- * munch (-DSYSV): Check for .text at end of name.
- Optionally allow extra underscore before initialize.
- Remove space between #! and /bin/sh.
-
- * m-merlin.h: Put in clarifying comments about SHELL_FILE.
- Makefile.dist (install): Execute M_INSTALL.
- config/merlin: Define M_INSTALL.
-
-Mon Jan 29 04:32:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * inflow.c: Change all references to signal handlers from
- int (*)() to void (*)().
-
- * main.c: Declare init_signals before use & make it void.
- Declare initialize_all_files.
-
- * Makefile.dist (config.status): New target.
-
-Sat Jan 27 00:19:50 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * defs.h (enum command_class): Remove comma after last element.
-
- * Makefile.dist (gdb.tar.Z): Use compress <foo >bar rather
- than deleting gdb.tar.Z before starting.
-
- * dbxread.c (process_one_symbol): Compare context_stack_depth
- with !VARIABLES_INSIDE_BLOCK, not VARIABLES_INSIDE_BLOCK.
-
- * mcheck.c: Put whole file in #if defined MALLOC_RANGE_CHECK.
-
- * mcheck.c (checkhdr): Call fatal_dump_core not abort.
-
- * mcheck.c: Copy from malloc distribution.
-
- * main.c (main): Call init_malloc ().
-
- * main.c (initialize_signals): Rename to init_signals.
-
-Fri Jan 26 00:53:23 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * *dep.c: Make core_file_command return void.
-
- * gdbcore.h [!KERNEL_U_ADDR]: Declare kernel_u_addr.
- infptrace.c [!KERNEL_U_ADDR]: Make it extern.
-
- * altos-dep.c (NBPG, UPAGES): Wrap #define in #if !defined.
-
- * m-pn.h (GOULD_PN): Define.
- *-pinsn.c: Include actual opcode table not just opcode.h
-
- * main.c [ALIGN_STACK_ON_STARTUP]: New code.
- m-i386.h: Define ALIGN_STACK_ON_STARTUP.
-
- * m-merlin.h (NO_SIGINTERRUPT, SHELL_FILE): Define.
-
- * Move code from infptrace [USE_PTRACE_GETREGS] to sun3-dep.c.
- m-sun{2,3}.h, m-sparc.h: Define FETCH_INFERIOR_REGISTERS.
-
- * Makefile.dist, config.gdb, config/*:
- Re-write to use machine-dependent makefiles instead of cpp.
-
- * m-hp300hpux.h: Define FETCH_INFERIOR_REGISTERS.
- infptrace.c: Put {fetch,store}_inferior_registers inside
- #if !defined FETCH_INFERIOR_REGISTERS.
-
- * Split execcore.c into exec.c and coredep.c.
- Move a bunch of stuff from coredep.c and *dep.c to gdbcore.h.
-
- * infptrace.c ({fetch,store}_inferior_registers):
- Use U_REGS_OFFSET to set offset.
- m-umax.h: Define U_REGS_OFFSET.
-
- * m-umax.h: Define PTRACE_{ATTACH,DETACH}.
-
- * m-i386.h (N_SET_MAGIC): Define.
- m-i386gas.h: add #undef N_SET_MAGIC.
-
-Thu Jan 25 18:39:45 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * m-hp300bsd.h: Remove KERNEL_U_ADDR.
-
- * infptrace.c [!KERNEL_U_ADDR]: Get address of kernel u area
- at runtime.
-
- * infptrace.c: Replace numbers with PT_KILL, etc.
- (store_inferior_registers): Loop for as many words are in the register.
-
- * infptrace.c [NO_SINGLE_STEP]: Call single_step().
-
- * kill_inferior{,_fast}: Declare as returning void.
-
- * m-sun3.h (USE_PTRACE_GETREGS): Define.
-
- * execcore.c: Add IS_OBJECT_FILE & related stuff.
-
- * infptrace.c: Include <sys/ptrace.h>.
- [ATTACH_DETACH] [USE_PTRACE_GETREGS]: New code.
-
- * Split default-dep.c into infptrace.c and execcore.c.
-
- * valprint.c [IEEE_FLOAT]: Change void * to char *.
-
- * breakpoint.c: Change printf_filtered(%s) to fputs_filtered.
-
-Wed Jan 24 00:35:52 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * dbxread.c (symbol_file_command): When freeing everything, free
- the string table too.
-
- * Makefile.dist (gdb1): add "rm -f gdb1".
-
- * printcmd.c (print_scalar_formatted): If size is 0, use 'b'
- 'h', 'w', or 'g' depending on the type.
-
- * stack.c (backtrace_command): Read in symbols for frames we'll
- print before printing them.
-
- * valops.c (value_at): Don't print "I/O error" on EIO from
- ptrace. Don't print "out of bounds" for any ptrace error
- except EIO.
-
- * valprint.c (type_print_base, case TYPE_CODE_ENUM):
- Print "FOO = 5" not "FOO : 5".
-
- * symtab.{c,h}: Make lookup_misc_func extern.
-
- * Makefile.dist: Define VERSION in makefile, and generate
- version.c automatically.
- (gdb.tar): Use gdb-$(VERSION), not dist-gdb.
-
- * expread.y (yylex): Use lookup_primitive_typename to
- cut down on calls to lookup_symbol.
- symtab.{c,h} (lookup_primitive_typename): New function.
- (lookup_typename): Use it.
-
- * symtab.{c,h} (check_stub_type): New function.
- valprint.c (type_print_base, val_print, type_print_derivation_info),
- values.c (allocate_value): Call it.
-
- * printcmd.c (whereis_command): New function.
- symtab.c (lookup_symbol): Add symtab parameter.
- various: Pass additional argument to lookup_symbol.
- symseg.h (struct symbol): Add line field.
- dbxread.c (define_symbol): Set sym->line.
-
- * dbxread.c (symbol_file_command): Read string table into
- malloc'd memory (symfile_string_table) and leave it there.
- (psymtab_to_symtab): Use symfile_string_table.
-
- * utils.c (sig_abbrev): Return NULL if not found.
- infrun.c (sig_print_{header,info}): Consolidate duplicated
- code from handle_command, signals_info.
- (sig_print_info): Just print number if no name from sig_abbrev.
-
- * Makefile.dist (OTHERS): Add ChangeLog-3.x
-
- * infrun.c (restore_inferior_status): #if 0 out
- "Unable to restore previously selected frame" error message.
-
- * infrun.c (signals_info, handle_command): Print signal
- abbrevs along with numbers.
-
- * infrun.c (handle_command): Accept symbol signal names.
-
- * utils.c (sig_{number,abbrev}, init_sig): New functions.
- _initialize_utils: Call init_sig for each signal.
- defs.h: Declare them.
-
- * default-dep.c (read_inferior_memory): Check quit_flag in
- fetch loop.
-
- * Changes for lazy fetching (speeds things up for big objects):
- value.h (struct value): New field lazy.
- VALUE_CONTENTS_RAW, VALUE_LAZY, value_at_lazy: New.
- findvar.c (read_var_value): Set lazy instead of fetching.
- various: Copy into VALUE_CONTENTS_RAW, not VALUE_CONTENTS.
- valops.c: Add value_at_lazy, value_lazy.
- various: Call value_at_lazy instead of value_at.
-
- * symtab.h (LONGEST): Define.
-
- * m-*.h (LONGEST, BUILTIN_TYPE_LONGEST): Delete (in symtab.h).
-
- * infrun.c (wait_for_inferior): #if 0 out stop if ABOUT_TO_RETURN
-
- * version.c: Change version number to 4.0development
-
-For older changes see ChangeLog-3.x
-
-Local Variables:
-mode: indented-text
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/gdb/ChangeLog-3.x b/gdb/ChangeLog-3.x
deleted file mode 100644
index e8dbcd8..0000000
--- a/gdb/ChangeLog-3.x
+++ /dev/null
@@ -1,4846 +0,0 @@
-Tue Jan 23 15:49:47 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * dbxread.c (define_symbol): Deal with deftype 'X'.
-
- * convex-dep.c (wait): Make it pid_t.
-
- * convex-dep.c (comm_registers_info): accept decimal comm register
- specification, as "i comm 32768".
-
- * dbxread.c (process_one_symbol): Make VARIABLES_INSIDE_BLOCK
- macro say by itself where variables are. Pass it desc.
- m-convex.h (VARIABLES_INSIDE_BLOCK): Nonzero for native compiler.
-
- * m-convex.h (SET_STACK_LIMIT_HUGE): Define.
- (IGNORE_SYMBOL): Take out #ifdef N_MONPT and put in 0xc4.
-
-Fri Jan 19 20:04:15 1990 Jim Kingdon (kingdon at albert.ai.mit.edu)
-
- * printcmd.c (print_frame_args): Always set highest_offset to
- current_offset when former is -1.
-
- * dbxread.c (read_struct_type): Print nice error message
- when encountering multiple inheritance.
-
-Thu Jan 18 13:43:30 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab): Always treat N_FN as a potential
- source for a x.o or -lx symbol, ignoring OFILE_FN_FLAGGED.
-
- * printcmd.c (print_frame_args): Cast -1 to (CORE_ADDR).
-
- * hp300bsd-dep.c (_initialize_hp300_dep): Get kernel_u_addr.
- m-hp300bsd.h (KERNEL_U_ADDR): Use kernel_u_addr.
-
- * infcmd.c (run_command): #if 0 out call to
- breakpoint_clear_ignore_counts.
-
-Thu Jan 11 12:58:12 1990 Jim Kingdon (kingdon at mole)
-
- * printcmd.c (print_frame_args) [STRUCT_ARG_SYM_GARBAGE]:
- Try looking up name of var before giving up & printing '?'.
-
-Wed Jan 10 14:00:14 1990 Jim Kingdon (kingdon at pogo)
-
- * many files: Move stdio.h before param.h.
-
- * sun3-dep.c (store_inferior_registers): Only try to write FP
- regs #ifdef FP0_REGNUM.
-
-Mon Jan 8 17:56:15 1990 Jim Kingdon (kingdon at pogo)
-
- * symtab.c: #if 0 out "info methods" code.
-
-Sat Jan 6 12:33:04 1990 Jim Kingdon (kingdon at pogo)
-
- * dbxread.c (read_struct_type): Set TYPE_NFN_FIELDS_TOTAL
- from all baseclasses; remove vestigial variable baseclass.
-
- * findvar.c (read_var_value): Check REG_STRUCT_HAS_ADDR.
- printcmd.c (print_frame_args): Check STRUCT_ARG_SYM_GARBAGE.
- m-sparc.h: Define REG_STRUCT_HAS_ADDR and STRUCT_ARG_SYM_GARBAGE.
-
- * blockframe.c (get_frame_block): Subtract one from pc if not
- innermost frame.
-
-Fri Dec 29 15:26:33 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * printcmd.c (print_frame_args): check highest_offset != -1, not i.
-
-Thu Dec 28 16:21:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * valops.c (value_struct_elt): Clean up error msg.
-
- * breakpoint.c (describe_other_breakpoints):
- Delete extra space before "also set at" and add period at end.
-
-Tue Dec 19 10:28:42 1989 Jim Kingdon (kingdon at pogo)
-
- * source.c (print_source_lines): Tell user which line number
- was out of range when printing error message.
-
-Sun Dec 17 14:14:09 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * blockframe.c (find_pc_partial_function): Use
- BLOCK_START (SYMBOL_BLOCK_VALUE (f)) instead of
- SYMBOL_VALUE (f) to get start of function.
-
- * dbxread.c: Make xxmalloc just a #define for xmalloc.
-
-Thu Dec 14 16:13:16 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * m68k-opcode.h (fseq & following fp instructions):
- Change @ to $.
-
-Fri Dec 8 19:06:44 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * breakpoint.c (breakpoint_clear_ignore_counts): New function.
- infcmd.c (run_command): Call it.
-
-Wed Dec 6 15:03:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * valprint.c: Change it so "array-max 0" means there is
- no limit.
-
- * expread.y (yylex): Change error message "invalid token in
- expression" to "invalid character '%c' in expression".
-
-Mon Dec 4 16:12:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * blockframe.c (find_pc_partial_function): Always return 1
- for success, 0 for failure, and set *NAME and *ADDRESS to
- match the return value.
-
- * dbxread.c (symbol_file_command): Use perror_with_name on
- error from stat.
- (psymtab_to_symtab, add_file_command),
- core.c (validate_files), source.c (find_source_lines),
- default-dep.c (exec_file_command): Check for errors from stat,
- fstat, and myread.
-
-Fri Dec 1 05:16:42 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * valops.c (check_field): When following pointers, just get
- their types; don't call value_ind.
-
-Thu Nov 30 14:45:29 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * config.gdb (pyr): New machine.
- core.c [REG_STACK_SEGMENT]: New code.
- dbxread.c (process_one_symbol): Cast return from copy_pending
- to long before casting to enum namespace.
- infrun.c: Split registers_info into DO_REGISTERS_INFO
- and registers_info.
- m-pyr.h, pyr-{dep.c,opcode.h,pinsn.c}: New files.
-
- * hp300bsd-dep.c: Stay in sync with default-dep.c.
-
- * m-hp300bsd.h (IN_SIGTRAMP): Define.
-
-Mon Nov 27 23:48:21 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * m-sparc.h (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE):
- Return floating point values in %f0.
-
-Tue Nov 21 00:34:46 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * dbxread.c (read_type): #if 0 out code which skips to
- comma following x-ref.
-
-Sat Nov 18 20:10:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * valprint.c (val_print): Undo changes of Nov 11 & 16.
- (print_string): Add parameter force_ellipses.
- (val_print): Pass force_ellipses true when we stop fetching string
- before we get to the end, else pass false.
-
-Thu Nov 16 11:59:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * infrun.c (restore_inferior_status): Don't try to restore
- selected frame if the inferior no longer exists.
-
- * valprint.c (val_print): Rewrite string printing code not to
- call print_string.
-
- * Makefile.dist (clean): Remove xgdb and xgdb.o.
-
-Tue Nov 14 12:41:47 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * Makefile.dist (XGDB, bindir, xbindir, install, all): New stuff.
-
-Sat Nov 11 15:29:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * valprint.c (val_print): chars_to_get: New variable.
-
-Thu Nov 9 12:31:47 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * main.c (main): Process "-help" as a switch that doesn't
- take an argument.
-
-Wed Nov 8 13:07:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * Makefile.dist (gdb.tar.Z): Add "else true".
-
-Tue Nov 7 12:25:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * infrun.c (restore_inferior_status): Don't dereference fid if NULL.
-
- * config.gdb (sun3, sun4): Accept "sun3" and "sun4".
-
-Mon Nov 6 09:49:23 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * Makefile.dist (Makefile): Move comments after commands.
-
- * *-dep.c [READ_COFF_SYMTAB]: Pass optional header size to
- read_section_hdr().
-
- * inflow.c: Include <fcntl.h> regardless of USG.
-
- * coffread.c (read_section_hdr): Add optional_header_size.
- (symbol_file_command): Pass optional header size to
- read_section_hdr().
- (read_coff_symtab): Initialize filestring.
-
- * version.c: Change version to 3.4.xxx.
-
- * GDB 3.4 released.
-
-Sun Nov 5 11:39:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * version.c: Change version to 3.4.
-
- * symtab.c (decode_line_1): Only skip past "struct" if it
- is there.
-
- * valops.c (value_ind), eval.c (evaluate_subexp, case UNOP_IND):
- Have "*" <int-valued-exp> return an int, not a LONGEST.
-
- * utils.c (fprintf_filtered): Pass arg{4,5,6} to sprintf.
-
- * printcmd.c (x_command): Use variable itself rather
- than treating it as a pointer only if it is a function.
- (See comment "this makes x/i main work").
-
- * coffread.c (symbol_file_command): Use error for
- "%s does not have a symbol-table.\n".
-
-Wed Nov 1 19:56:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * dbxread.c [BELIEVE_PCC_PROMOTION_TYPE]: New code.
- m-sparc.h: Define BELIEVE_PCC_PROMOTION_TYPE.
-
-Thu Oct 26 12:45:00 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * infrun.c: Include <sys/dir.h>.
-
- * dbxread.c (read_dbx_symtab, case N_LSYM, case 'T'):
- Check for enum types and put constants in psymtab.
-
-Mon Oct 23 15:02:25 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * dbxread.c (define_symbol, read_dbx_symtab): Handle enum
- constants (e.g. "b:c=e6,0").
-
-Thu Oct 19 14:57:26 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * stack.c (frame_info): Use FRAME_ARGS_ADDRESS_CORRECT
- m-vax.h (FRAME_ARGS_ADDRESS_CORRECT): New macro.
- (FRAME_ARGS_ADDRESS): Restore old meaning.
-
- * frame.h (Frame_unknown): New macro.
- stack.c (frame_info): Check for Frame_unknown return from
- FRAME_ARGS_ADDRESS.
- m-vax.h (FRAME_ARGS_ADDRESS): Sometimes return Frame_unknown.
-
- * utils.c (fatal_dump_core): Add "internal error" to message.
-
- * infrun.c (IN_SIGTRAMP): New macro.
- (wait_for_inferior): Use IN_SIGTRAMP.
- m-vax.h (IN_SIGTRAMP): New macro.
-
-Wed Oct 18 15:09:22 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * config.gdb, Makefile.dist: Shorten m-i386-sv32.h.
-
- * coffread.c (symbol_file_command): Pass 0 to select_source_symtab.
-
-Tue Oct 17 12:24:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * i386-dep.c (i386_frame_num_args): Take function from m-i386.h
- file. Check for pfi null.
- m-i386.h (FRAME_NUM_ARGS): Use i386_frame_num_args.
-
- * infrun.c (wait_for_inferior): set stop_func_name to 0
- before calling find_pc_partial_function.
-
-Thu Oct 12 01:08:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * breakpoint.c (_initialize_breakpoint): Add "disa".
-
- * Makefile.dist: Add GLOBAL_CFLAGS and pass to readline.
-
- * config.gdb (various): "$machine =" -> "machine =".
-
-Wed Oct 11 11:54:31 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * inflow.c (try_writing_regs): #if 0 out this function.
-
- * main.c (main): Add "-help" option.
-
- * dbxread.c (read_dbx_symtab): Merge code for N_FUN with
- N_STSYM, etc.
-
-Mon Oct 9 14:21:55 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * inflow.c (try_writing_regs_command): Don't write past end
- of struct user.
-
- * dbxread.c (read_struct_type): #if 0 out code which checks for
- bitpos and bitsize 0.
-
- * config.gdb: Accept sequent-i386 (not seq386).
- (symmetry): Set depfile and paramfile.
-
- * m-convex.h (IGNORE_SYMBOL): Check for N_MONPT if defined.
-
-Thu Oct 5 10:14:26 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * default-dep.c (read_inferior_memory): Put #if 0'd out comment
- within /* */.
-
-Wed Oct 4 18:44:41 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * config.gdb: Change /dev/null to m-i386.h for various
- 386 machine "opcodefile" entries.
-
- * config.gdb: Accept seq386 for sequent symmetry.
-
-Mon Oct 2 09:59:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * hp300bsd-dep.c: Fix copyright notice.
-
-Sun Oct 1 16:25:30 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * Makefile.dist (DEPFILES): Add isi-dep.c.
-
- * default-dep.c (read_inferior_memory): Move #endif after else.
-
-Sat Sep 30 12:50:16 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * version.c: Change version number to 3.3.xxx.
-
- * GDB 3.3 released.
-
- * version.c: Change version number to 3.3.
-
- * Makefile.dist (READLINE): Add vi_mode.c
-
- * config.gdb (i386): Change /dev/null to m-i386.h
-
- * config.gdb: Add ';;' before 'esac'.
-
- * Makefile.dist (gdb.tar.Z): Move comment above dependency.
-
- * dbxread.c (read_ofile_symtab): Check symbol before start
- of source file for GCC_COMPILED_FLAG_SYMBOL.
- (start_symtab): Don't clear processing_gcc_compilation.
-
-Thu Sep 28 22:30:23 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
-
- * valprint.c (print_string): If LENGTH is zero, print "".
-
-Wed Sep 27 10:15:10 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * config.gdb: "rm tmp.c" -> "rm -f tmp.c".
-
-Tue Sep 26 13:02:10 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * utils.c (_initialize_utils): Use termcap to set lines_per_page
- and chars_per_line.
-
-Mon Sep 25 10:06:43 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab, N_SOL): Do not add the same file
- more than once.
-
-Thu Sep 21 12:43:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * infcmd.c (unset_environment_command): Delete all variables
- if called with no arg.
-
- * remote.c, inferior.h (remote_{read,write}_inferior_memory):
- New functions.
- core.c ({read,write}_memory): Use remote_{read,write}_inferior_memory.
-
- * valops.c (call_function): When reserving stack space for
- arguments, call value_arg_coerce.
-
- * m-hp9k320.h: define BROKEN_LARGE_ALLOCA.
-
- * breakpoint.c (delete_command): Ask for confirmation only
- when there are breakpoints.
-
- * dbxread.c (read_struct_type): If lookup_basetype_type has
- copied a stub type, call add_undefined_type.
-
- * sparc_pinsn.c (compare_opcodes): Check for "1+i" anywhere
- in args.
-
- * val_print.c (type_print_base): Print stub types as
- "<incomplete type>".
-
-Wed Sep 20 07:32:00 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * sparc-opcode.h (swapa): Remove i bit from match.
- (all alternate space instructions): Delete surplus "foo rs1+0"
- patterns.
-
- * Makefile.dist (LDFLAGS): Set to $(CFLAGS).
-
- * remote-multi.shar (remote_utils.c, putpkt): Change csum to unsigned.
-
-Tue Sep 19 14:15:16 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * sparc-opcode.h: Set i bit in lose for many instructions which
- aren't immediate.
-
- * stack.c (print_frame_info): add "func = 0".
-
-Mon Sep 18 16:19:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * sparc-opcode.h (mov): Add mov to/from %tbr, %psr, %wim.
-
- * sparc-opcode.h (rett): Fix notation to use suggested assembler
- syntax from architecture manual.
-
- * symmetry-dep.c (I386_REGNO_TO_SYMMETRY): New macro.
- (i386_frame_find_saved_regs): Use I386_REGNO_TO_SYMMETRY.
-
-Sat Sep 16 22:21:17 1989 Jim Kingdon (kingdon at spiff)
-
- * remote.c (remote_close): Set remote_desc to -1.
-
- * gdb.texinfo (Output): Fix description of echo to match
- reality and ANSI C.
-
-Fri Sep 15 14:28:59 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * symtab.c (lookup_symbol): Add comment about "asm".
-
- * sparc-pinsn.c: Use NUMOPCODES.
-
- * sparc-opcode.h (NUMOPCODES): Use sparc_opcodes[0] not *sparc_opcodes.
-
-Thu Sep 14 15:25:20 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (xxmalloc): Print error message before calling abort().
-
- * infrun.c (wait_for_inferior): Check for {stop,prev}_func_name
- null before passing to strcmp.
-
-Wed Sep 13 12:34:15 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * sparc-opcode.h: New field delayed.
- sparc-pinsn.c (is_delayed_branch): New function.
- (print_insn): Check for delayed branches.
-
- * stack.c (print_frame_info): Use misc_function_vector in
- case where ar truncates file names.
-
-Tue Sep 12 00:16:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * convex-dep.c (psw_info): Move "struct pswbit *p" with declarations.
-
-Mon Sep 11 14:59:57 1989 Jim Kingdon (kingdon at spiff)
-
- * convex-dep.c (core_file_command): Delete redundant printing
- of "Program %s".
-
- * m-convex.h (ENTRY_POINT): New macro.
-
- * m-convex.h (FRAME_CHAIN_VALID): Change outside_first_object_file
- to outside_startup_file
-
- * main.c: #if 0 out catch_termination and related code.
-
- * command.c (lookup_cmd_1): Consider underscores part of
- command names.
-
-Sun Sep 10 09:20:12 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * printcmd.c: Change asdump_command to disassemble_command
- (_initialize_printcmd): Change asdump to diassemble.
-
- * main.c (main): Exit with code 0 if we hit the end of a batch
- file.
-
- * Makefile.dist (libreadline.a): Fix syntax of "CC=${CC}".
-
-Sat Sep 9 01:07:18 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * values.c (history_info): Renamed to value_history_info.
- Command renamed to "info value" (with "info history" still
- accepted).
-
- * sparc-pinsn.c (print_insn): Extend symbolic address printing
- to cover "sethi" following by an insn which uses 1+i.
-
-Fri Sep 8 14:24:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * m-hp9k320.h, m-hp300bsd.h, m-altos.h, m-sparc.h, m-sun3.h
- (READ_GDB_SYMSEGS): Remove.
- dbxread.c [READ_GDB_SYMSEGS]: Remove code to read symsegs.
-
- * sparc-pinsn.c (print_insn): Detect "sethi-or" pairs and
- print symbolic address.
-
- * sparc-opcode.h (sethi, set): Change lose from 0xc0000000 to
- 0xc0c00000000.
-
- * remote.c (remote_desc): Initialize to -1.
-
- * Makefile.dist (libreadline.a): Pass CC='${CC}' to readline makefile.
-
-Thu Sep 7 00:07:17 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (read_struct_type): Check for static member functions.
- values.c, eval.c, valarith.c, valprint.c, valops.c: Merge changes
- from Tiemann for static member functions.
-
- * sparc-opcode.h (tst): Fix all 3 patterns.
-
- * Makefile.dist (gdb1): New rule.
-
- * sparc-opcode.h: Change comment about what the disassembler
- does with the order of the opcodes.
-
- * sparc-pinsn.c (compare_opcodes): Put 1+i before i+1.
- Also fix mistaken comment about preserving order of original table.
-
- * sparc-opcode.h (clr, mov): Fix incorrect lose entries.
-
- * m-symmetry.h (FRAME_NUM_ARGS): Add check to deal with code that
- GCC sometimes generates.
-
- * config.gdb: Change all occurances of "skip" to "/dev/null".
-
- * README (about languages other than C): Update comments about
- Pascal and FORTRAN.
-
- * sparc-opcode.h (nop): Change lose from 0xae3fffff to 0xfe3fffff.
-
- * values.c (value_virtual_fn_field): #if 0-out assignment to
- VALUE_TYPE(vtbl).
-
-Wed Sep 6 12:19:22 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * utils.c (fatal_dump_core): New function.
- Makefile.dist (MALLOC_FLAGS): use -Dbotch=fatal_dump_core
-
-Tue Sep 5 15:47:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * breakpoint.c (enable_command): With no arg, enable all bkpts.
-
- * Makefile.dist (Makefile): Remove \"'s around $(MD).
-
- * Makefile.dist: In "cd readline; make . . ." change first
- SYSV_DEFINE to SYSV.
-
- * m68k-pinsn.c (_initialize_pinsn): Use alternate assembler
- syntax #ifdef HPUX_ASM
-
-Sat Sep 2 23:24:43 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * values.c (history_info): Don't check num_exp[0] if num_exp
- is nil (just like recent editing_info change).
-
-Fri Sep 1 19:19:01 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * gdb.texinfo (inc-history, inc-readline): Copy in the inc-* files
- because people might not have makeinfo.
-
- * README (xgdb): Strengthen nasty comments.
-
- * gdb.texinfo: Change @setfilename to "gdb.info".
-
-Thu Aug 31 17:23:50 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * main.c (editing_info): Don't check arg[0] if arg is null.
-
- * m-vax.h: Add comment about known sigtramp bug.
-
- * sun3-dep.c, sparc-dep.c (IS_OBJECT_FILE, exec_file_command):
- Get right text & data addresses for .o files.
-
-Wed Aug 30 13:54:19 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * utils.c (tilde_expand): Remove function (it's in readline).
-
- * sparc-opcode.h (call): Change "8" to "9" in first two
- patterns (%g7->%o7).
-
-Tue Aug 29 16:44:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * printcmd.c (whatis_command): Change 4th arg to type_print
- from 1 to -1.
-
-Mon Aug 28 12:22:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * dbxread.c (psymtab_to_symtab_1): In "and %s ..." change
- pst->filename to pst->dependencies[i]->filename.
-
- * blockframe.c (FRAMELESS_LOOK_FOR_PROLOGUE): New macro
- made from FRAMELESS_FUNCTION_INVOCATION from m-sun3.h except
- that it checks for zero return from get_pc_function_start.
- m-hp9k320.h, m-hp300bsd.h, m-i386.h, m-isi.h, m-altos.h,
- m-news.h, m-sparc.h, m-sun2.h, m-sun3.h, m-symmetry.h
- (FRAMELESS_FUNCTION_INVOCATION): Use FRAMELESS_LOOK_FOR_PROLOGUE.
-
- * dbxread.c (read_struct_type): Give warning and ignore field
- if bitpos and bitsize are zero.
-
-Sun Aug 27 04:55:20 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (psymtab_to_symtab{,_1}): Print message about
- reading in symbols before reading stringtab, not after.
-
-Sat Aug 26 02:01:53 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * dbxread.c (IS_OBJECT_FILE, ADDR_OF_TEXT_SEGMENT): New macros.
- (read_dbx_symtab): Use text_addr & text_size to set end_of_text_addr.
- (symbol_file_command): pass text_addr & text_size to read_dbx_symtab.
-
-Fri Aug 25 23:08:13 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * valprint.c (value_print): Try to give the name of function
- pointed to when printing a function pointer.
-
-Thu Aug 24 23:18:40 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * core.c (xfer_core_file): In cases where MEMADDR is above the
- largest address that makes sense, set i to len.
-
-Thu Aug 24 16:04:17 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
-
- * valprint.c (print_string): New function to print a character
- string, doing array-max limiting and repeat count processing.
- (val_print, value_print): Use print_string.
- (REPEAT_COUNT_THRESHOLD): New #define, the max number of elts to print
- without using a repeat count. Set to ten.
- (value_print, val_print): Use REPEAT_COUNT_THRESHOLD.
-
- * utils.c (printchar): Use {fputs,fprintf}_filtered.
-
- * valprint.c (val_print): Pass the repeat count arg to the
- fprintf_filtered call for "<repeats N times>" messages.
-
-Wed Aug 23 22:53:47 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
-
- * utils.c: Include <pwd.h>.
-
- * main.c: Declare free.
-
-Wed Aug 23 05:05:59 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * utils.c, defs.h: Add tilde_expand.
- source.c (directory_command),
- main.c (cd_command),
- main.c (set_history_filename),
- dbxread.c (symbol_file_command),
- coffread.c (symbol_file_command),
- dbxread.c (add_file_command),
- symmisc.c (print_symtabs),
- *-dep.c (exec_file_command, core_file_command),
- main.c (source_command): Use tilde_expand.
-
- * dbxread.c (read_type): When we get a cross-reference, resolve
- it immediately if possible, only calling add_undefined_type if
- necessary.
-
- * gdb.texinfo: Uncomment @includes and put comment at start
- of file telling people to use makeinfo.
-
- * valprint.c (type_print_base): Print the right thing for
- bitfields.
-
- * config.gdb (sun3os3): Set paramfile and depfile.
-
-Tue Aug 22 05:38:36 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * dbxread.c (symbol_file_command): Pass string table size to
- read_dbx_symtab().
- (read_dbx_symtab): Before indexing into string table, check
- string table index for reasonableness.
- (psymtab_to_symtab{,_1}, read_ofile_symtab): Same.
-
-Tue Aug 22 04:04:39 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
-
- * m68k-pinsn.c: Replaced many calls to fprintf and fputs with
- calls to fprintf_filtered and fputs_filtered.
- (print_insn_arg): Use normal MIT 68k syntax for postincrement,
- predecrement, and register indirect addressing modes.
-
-Mon Aug 21 10:08:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * main.c (initialize_signals): Set signal handler for SIGQUIT
- and SIGHUP to do_nothing.
-
- * ns32k-opcode.h (ord): Change 1D1D to 1D2D.
-
- * ns32k-pinsn.c (print_insn_arg, print_insn): Handle index
- bytes correctly.
-
- * ns32k-opcode.h: Add comments.
-
- * dbxread.c (read_type): Put enum fields in type.fields in order
- that they were found in the debugging symbols (not reverse order).
-
-Sun Aug 20 21:17:13 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * main.c (source_command): Read .gdbinit if run without argument.
-
- * source.c (directory_command): Only print "foo already in path"
- if from_tty.
-
- * version.c: Change version number to 3.2.xxx
-
-Sat Aug 19 00:24:08 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * m-news.h: Define HAVE_WAIT_STRUCT.
-
- * m-isi.h, isi-dep.c: Replace with new version from Adam de Boor.
- config.gdb: Remove isibsd43.
-
- * main.c (catch_termination): Don't say we have written
- .gdb_history until after we really have.
-
- * convex-dep.c (attach): Add "sleep (1)".
- (write_vector_register): Use "LL" with long long constant.
- (wait): Close comment.
- (wait): Change "unix 7.1 bug" to "unix 7.1 feature" & related
- changes in comment.
- (scan_stack): And fp with 0x80000000 in while loop test.
- (core_file_command): Move code to set COREFILE.
- (many places): Change printf to printf_filtered.
- (psw_info): Allow argument giving value to print as a psw.
- (_initialize_convex_dep): Update docstrings.
-
- * m-convex.h (WORDS_BIG_ENDIAN): Correct typo ("WRODS")
- define NO_SIGINTERRUPT.
- define SET_STACK_LIMIT_HUGE.
- add "undef BUILTIN_TYPE_LONGEST" before defining it.
- Use "LL" after constants in CALL_DUMMY.
-
- * dbxread.c: In the 3 places it says error "ridiculous string
- table size"... delete extra parameter to error.
-
- * dbxread.c (scan_file_globals): Check for FORTRAN common block.
- Allow multiple references for the sake of common blocks.
-
- * main.c (initialize_main): Set history_filename to include
- current directory.
-
- * valprint.c (decode_format): Don't return a defaulted size
- field if osize is zero.
-
- * gdb.texinfo (Compilation): Update information on -gg symbols.
- Document problem with ar.
-
-Fri Aug 18 19:45:20 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * valprint.c (val_print, value_print): Add "<repeats %d times>" code.
- Also put "..." outside quotes for strings.
-
- * main.c (initialize_main): Add comment about history output file
- being different from history input file.
-
- * m-newsos3.h: Undefine NO_SIGINTERRUPT. Rearrange a few comments.
-
- * m-newsos3.h (REGISTER_U_ADDR): Use new version from Hikichi.
-
- * sparc-opcode.h: Add comment clarifying meaning of the order of
- the entries in sparc_opcodes.
-
- * eval.c (evaluate_subexp, case UNOP_IND): Deal with deferencing
- things that are not pointers.
-
- * valops.c (value_ind): Make dereferencing an int give a LONGEST.
-
- * expprint.c (print_subexp): Add (int) cast in OP_LAST case.
-
- * dbxread.c (read_array_type): Set lower and upper if adjustable.
-
- * symtab.c (lookup_symbol): Don't abort if symbol found in psymtab
- but not in symtab.
-
-Thu Aug 17 15:51:20 1989 Randy Smith (randy at hobbes.ai.mit.edu)
-
- * config.gdb: Changed "Makefile.c" to "Makefile.dist".
-
-Thu Aug 17 01:58:04 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
-
- * sparc-opcode.h (or): Removed incorrect lose bit 0x08000000.
- [many]: Changed many `lose' entries to have the 0x10 bit set, so
- they don't think %l0 is %g0.
-
-Wed Aug 16 00:30:44 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * m-symmetry.h (STORE_STRUCT_RETURN): Also write reg 0.
- (EXTRACT_RETURN_VALUE): Call symmetry_extract_return_value.
- symmetry-dep.c (symmetry_extract_return_value): New fn.
-
- * main.c (symbol_completion_function): Deal with changed
- result_list from lookup_cmd_1 for ambiguous return.
- command.c (lookup_cmd): Same.
-
- * inflow.c [TIOCGETC]: Move #include "param.h" back before
- system #includes. Change all #ifdef TIOCGETC to
- #if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN)
- m-i386-sysv3.2.h, m-i386gas-sysv3.2.h: Remove "#undef TIOCGETC"
- and add "#define TIOCGETC_BROKEN".
-
- * command.c (lookup_cmd_1): Give the correct result_list in the
- case of an ambiguous return where there is a partial match
- (e.g. "info a"). Add comment clarifying what is the correct
- result_list.
-
- * gdb.texinfo (GDB History): Document the two changes below.
-
- * main.c (command_line_input): Make history expansion not
- just occur at the beginning of a line.
-
- * main.c (initialize_main): Make history expansion off by default.
-
- * inflow.c: Move #include "param.h" after system #includes.
-
- * i386-dep.c (i386_float_info): Use U_FPSTATE macro.
-
- * m-i386-sysv3.2.h, m-i386gas-sysv3.2.h: New files.
- Makefile.dist, config.gdb: Know about these new files.
-
-Tue Aug 15 21:36:11 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * symtab.c (lookup_struct_elt_type): Use type_print rather
- than assuming type has a name.
-
-Tue Aug 15 02:25:43 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
-
- * sparc-opcode.h (mov): Removed bogus "or i,0,d" pattern.
-
- * sparc-opcode.h (mov, or): Fixed incorrect `lose' members.
-
- * sparc-dep.c: Don't include "sparc-opcode.h".
- (skip_prologue, isanulled): Declare special types to recognize
- instructions, and use them.
-
- * sparc-pinsn.c (print_insn): Sign-extend 13-bit immediate args.
- If they are less than +9, print them in signed decimal instead
- of unsigned hex.
-
- * sparc-opcode.h, sparc-pinsn.c: Completely rewritten to share an
- opcode table with gas, and thus produce disassembly that looks
- like what the assembler accepts.
-
-Tue Aug 15 16:20:52 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * symtab.c (find_pc_psymbol): Move best_pc=psymtab->textlow-1
- after test for psymtab null.
-
- * main.c (editing_info): Remove variable retval.
-
- * config.gdb (sun3, isi): Comment out obsolete message about telling
- it whether you have an FPU (now that it detects it).
-
- * config.gdb (sun3): Accept sun3os3.
-
- * m68k-insn.h: Include <signal.h>.
-
- * m68k-pinsn.h (convert_{to,from}_68881): Add have_fpu code
-
- * m-newsos3.h: Undefine USE_PCB. That code didn't seem to work.
-
- * sparc-dep.c: Put in insn_fmt and other stuff from the old
- sparc-opcode.h.
-
- * sparc-opcode.h, sparc-pinsn.c: Correct copyright notice.
-
- * sparc-opcode.h, sparc-pinsn.c: Replace the old ones with the new
- ones by roland.
-
-Tue Aug 15 02:25:43 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu)
-
- * Makefile.dist: Don't define CC at all.
-
- * Makefile.dist (Makefile): Remove tmp.c after preprocessing.
- Use $(MD) instead of M_MAKEDEFINE in the cc command.
-
- * Makefile.dist: Don't define RL_LIB as
- "${READLINE}/libreadline.a", since READLINE is a list of files.
-
-Mon Aug 14 23:49:29 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * main.c (print_version): Change 1988 to 1989.
-
- * main.c (copying_info, initialize_main): Remove #if 0'd code.
-
-Tue Aug 1 14:44:56 1989 Hikichi (hikichi at sran203)
-
- * m-newsos3.h
- (NO_SIGINTERRUPT): have SIGINTERRUPT on NEWS os 3.
-
- * m-news.h(FRAME_FIND_SAVED_REGS): use the sun3's instead of old
- one.
-
-Mon Aug 14 15:27:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * m-news.h, m-newsos3.h, news-dep.c: Merge additional changes
- by Hikichi (ChangeLog entries above).
-
- * Makefile.dist (READLINE): List readline files individually
- so we don't accidently get random files from the readline
- directory.
-
- * m-news.h (STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE):
- Expect floating point returns to be in fp0.
-
- * gdb.texinfo (Format options): New node.
-
- * gdb.texinfo: Comment out "@include"s until bfox fixes the
- readline & history docs.
-
- * dbxread.c (read_addl_syms): Set startup_file_* if necessary at
- the end (as well as when we hit ".o").
-
- * printcmd.c (decode_format): Set val.format & val.size to '?' at
- start and set defaults at end.
-
- * symtab.c (decode_line_1): Check for class_name null.
-
- * valops.c: Each place where it compares against field names,
- check for null field names. (new t_field_name variables).
-
- * utils.c (fputs_filtered): Check for linebuffer null before
- checking whether to call fputs. Remove later check for linebuffer
- null.
-
-Sun Aug 13 15:56:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * m-isi.h, m-sun3.h ({PUSH,POP}_FP_REGS): New macros.
- m-sun3.h (NUM_REGS): Conditionalize on FPU.
- config.gdb (sun3, isi): Add message about support for machines
- without FPU.
-
- * main.c (catch_termination, initialize_signals): new functions.
-
- * main.c (editing_info): Add "info editing n" and "info editing +".
- Rewrite much of this function.
- gdb.texinfo (GDB Readline): Document it.
-
- * values.c (history_info): Add "info history +". Also add code to
- do "info history +" when command is repeated.
- gdb.texinfo (Value History): Document "info history +".
-
- * expprint.c (print_subexp): Add OP_THIS to case stmt.
-
- * config.gdb (sun4os4): Put quotes around make define.
-
- * config.gdb: Canonicalize machine name at beginning.
-
-Sat Aug 12 00:50:59 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * config.gdb: define M_MAKEDEFINE
- Makefile (Makefile, MD): Be able to re-make Makefile.
-
- * main.c (command_line_input): Add comments to
- the command history.
-
- * Makefile.dist (Makefile): Add /bin/false.
-
-Fri Aug 11 14:35:33 1989 Jim Kingdon (kingdon at spiff)
-
- * Makefile.dist: Comment out .c.o rule and add TARGET_ARCH.
-
- * m-altos.h: Include sys/page.h & sys/net.h
-
- * m-altos.h (FRAME_CHAIN{,_VALID}): Use outside_startup_file.
-
- * config.gdb (altos, altosgas): Add M_SYSV & M_BSD_NM and remove
- M_ALLOCA=alloca.o from makedefine.
-
- * coffread.c (complete_symtab): Change a_entry to entry.
-
- * m-altosgas.h: New file.
-
- * m-symmetry (REGISTER_BYTE): Fix dumb mistake.
-
-Fri Aug 11 06:39:49 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
-
- * utils.c (set_screensize_command): Check for ARG being nil, since
- that's what execute_command will pass if there's no argument.
-
- * expread.y (yylex): Recognize "0x" or "0X" as the beginning of a
- number.
-
-Thu Aug 10 15:43:12 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * config.gdb, Makefile.dist: Rename Makefile.c to Makefile.dist.
-
- * m-altos.h: Add comment about porting to USGR2.
-
- * config.gdb (sparc): Add -Usparc.
-
-Wed Aug 9 14:20:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * m-sun3os4.h: Define BROKEN_LARGE_ALLOCA.
-
- * values.c (modify_field): Check for value too large to fit in
- bitfield.
-
- * utils.c (fputs_filtered): Allow LINEBUFFER to be NULL.
-
- * breakpoint.c (condition_command): Check for attempt to specify
- non-numeric breakpoint number.
-
- * config.gdb, Makefile, m-altos.h, altos-dep.c: Merge Altos
- port.
-
- * README: Change message about editing Makefile.
-
- * config.gdb: Edit Makefile.
- Copied Makefile to Makefile.c and changed to let config.gdb
- run us through the C preprocessor.
-
- * expread.y (yylex): Test correctly for definition of number.
-
-Wed Aug 9 11:56:05 1989 Randy Smith (randy at hobbes.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab): Put bracketing of entry point in
- test case for .o symbols so that it will be correct even without
- debugging symbols.
- (end_psymtab): Took bracketing out.
-
- * blockframe.c (outside_startup_file): Reverse the sense of the
- return value to make the functionality implied by the name
- correct.
-
-Tue Aug 8 11:48:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * coffread.c (symbol_file_command): Do not assume presence of a.out
- header.
-
- * blockframe.c: Replace first_object_file_end with
- startup_file_{start,end}
- (outside_startup_file): New function.
- dbxread.c (read_addl_syms, read_dbx_symtab, end_psymbol): set
- startup_file_*. Delete first_object_file_end code.
- Add entry_point and ENTRY_POINT
- coffread.c (complete_symtab): Set startup_file_*.
- (first_object_file_end): Add as static.
- m-*.h (FRAME_CHAIN, FRAME_CHAIN_VALID): Call outside_startup_file
- instead of comparing with first_object_file_end.
-
- * breakpoint.c (breakpoint_1): Change -1 to (CORE_ADDR)-1.
-
- * config.gdb (i386, i386gas): Add missing quotes at end of "echo"
-
- * source.c (directory_command): Add dont_repeat ();
-
-Mon Aug 7 18:03:51 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * dbxread.c (read_addl_syms): Change strcmp to strncmp and put 3rd
- arg back.
-
- * command.h (struct cmd_list_element): Add comment clarifying
- purpose of abbrev_flag.
-
-Mon Aug 7 12:51:03 1989 Randy Smith (randy at hobbes.ai.mit.edu)
-
- * printcmd.c (_initialize_printcmd): Changed "undisplay" not to
- have abbrev flag set; it isn't an abbreviation of "delete
- display", it's an alias.
-
-Mon Aug 7 00:25:15 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * symtab.c (lookup_symtab_1): Remove filematch (never used).
-
- * expread.y [type]: Add second argument to 2 calls to
- lookup_member_type which were missing them.
-
- * dbxread.c (symbol_file_command): Add from_tty arg.
- Check it before calling query.
-
- * infcmd.c (tty_command): Add from_tty arg.
-
- * eval.c (evaluate_subexp): Remove 3rd argument from
- calls to value_x_unop.
-
- * dbxread.c (read_addl_syms): Remove 3rd argument from
- call to strcmp.
-
- * gdb.texinfo (Command editing): @include inc-readline.texinfo
- and inc-history.texinfo and reorganize GDB-specific stuff.
-
- * Makefile: Add line MAKE=make.
-
- * README (second paragraph): Fix trivial errors.
-
- * dbxread.c (read_struct_type): Make sure p is initialized.
-
- * main.c (symbol_completion_function): Complete correctly
- on the empty string.
-
-Sun Aug 6 21:01:59 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * symmetry-dep.c: Remove "long" from definition of i386_follow_jump.
-
- * gdb.texinfo (Backtrace): Document "where" and "info stack".
-
- * dbxread.c (cleanup_undefined_types): Strip off "struct "
- or "union " from type names before doing comparison
-
-Sat Aug 5 02:05:36 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * config.gdb (i386, i386gas): Improve makefile editing instructions.
-
- * Makefile: Fix typo in CLIBS for SYSV.
-
- * dbxread.c (read_dbx_symtab): Deal with N_GSYM typedefs.
-
- * dbxread.c (add_file_command): Do not free name. We didn't
- allocate it; it just points into arg_string.
-
- * Makefile, m-*.h: Change LACK_VPRINTF to HAVE_VPRINTF.
-
-Fri Jul 28 00:07:48 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * valprint.c (val_print): Made sure that all returns returned a
- value (usually 0, indicating no memory printed).
-
- * core.c (read_memory): Changed "return" to "return 0".
-
- * expread.y (parse_number): Handle scientific notation when the
- string does not contain a '.'.
-
-Thu Jul 27 15:14:03 1989 Randy Smith (randy at hobbes.ai.mit.edu)
-
- * infrun.c (signals_info): Error if signal number passed is out of
- bounds.
-
- * defs.h: Define alloca to be __builtin_alloca if compiling with
- gcc and localized inclusion of alloca.h on the sparc with the
- other alloca stuff.
- * command.c: Doesn't need to include alloca.h on the sparc; defs.h
- does it for you.
-
- * printcmd.c (print_frame_args): Changed test for call to
- print_frame_nameless_args to check i to tell if any args had been
- printed.
-
-Thu Jul 27 04:40:56 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
-
- * blockframe.c (find_pc_partial_function): Always check that NAME
- and/or ADDRESS are not nil before storing into them.
-
-Wed Jul 26 23:41:21 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
-
- * m-newsos3.h: Define BROKEN_LARGE_ALLOCA.
- * dbxread.c (symbol_file_command, psymtab_to_symtab):
- Use xmalloc #ifdef BROKEN_LARGE_ALLOCA.
-
-Tue Jul 25 16:28:18 1989 Jay Fenlason (hack at apple-gunkies.ai.mit.edu)
-
- * m68k-opcode.h: moved some of the fmovem entries so they're
- all consecutive. This way the assembler doesn't bomb.
-
-Mon Jul 24 22:45:54 1989 Randy Smith (randy at hobbes.ai.mit.edu)
-
- * symtab.c (lookup_symbol): Changed error to an informational (if
- not very comforting) message about internal problems. This will
- get a null symbol returned to decode_line_1, which should force
- things to be looked up in the misc function vector.
-
-Wed Jul 19 13:47:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * symtab.c (lookup_symbol): Changed "fatal" to "error" in
- external symbol not found in symtab in which it was supposed to be
- found. This can be reached because of a bug in ar.
-
-Tue Jul 18 22:57:43 1989 Randy Smith (roland at hobbes.ai.mit.edu)
-
- * m-news.h [REGISTER_U_ADDR]: Decreased the assumed offset of fp0
- by 4 to bring it into (apparently) appropriate alignment with
- reality.
-
-Tue Jul 18 18:14:42 1989 Randy Smith (randy at hobbes.ai.mit.edu)
-
- * Makefile: pinsn.o should depend on opcode.h
-
- * m68k-opcode.h: Moved fmovemx with register lists to before other
- fmovemx.
-
-Tue Jul 18 11:21:42 1989 Jim Kingdon (kingdon at susie)
-
- * Makefile, m*.h: Only #define vprintf (to _doprnt or printf,
- depends on the system) if the library lacks it (controlled by
- LACK_VPRINTF_DEFINE in makefile). Unpleasant, but necessary to
- make this work with the GNU C library.
-
-Mon Jul 17 15:17:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * breakpoint.c (breakpoint_1): Change addr-b->address to
- b->address-addr.
-
-Sun Jul 16 16:23:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * eval.c (evaluate_subexp): Change error message printed when
- right operand of '@' is not an integer to English.
-
- * infcmd.c (registers_info): Fix call to print_spaces_filtered
- to specify right # of arguments.
-
- * gdb.texinfo (Command Editing): Document info editing command.
-
- * coffread.c (read_file_hdr): Add MC68MAGIC.
-
- * source.c (select_source_symtab): Change MAX to max.
-
-Fri Jul 14 21:19:11 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * infcmd.c (registers_info): Clean up display to look good with long
- register names, to say "register" instead of "reg", and to put the
- "relative to selected stack frame" bit at the top.
-
-Fri Jul 14 18:23:09 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (record_misc_function): Put parens around | to force
- correct evaluation.
-
-Wed Jul 12 12:25:53 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * m-newsos3, m-news, infrun.c, Makefile, config.gdb, news-dep.c:
- Merge in Hikichi's changes for Sony/News-OS 3 support.
-
-Tue Jul 11 21:41:32 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * utils.c (fputs_filtered): Don't do any filtering if output is
- not to stdout, or if stdout is not a tty.
- (fprintf_filtered): Rely on fputs_filtered's check for whether to
- do filtering.
-
-Tue Jul 11 00:33:58 1989 Randy Smith (randy at hobbes.ai.mit.edu)
-
- * GDB 3.2 Released.
-
- * valprint.h: Deleted.
-
- * utils.c (fputs_filtered): Don't do any filtering if filtering is
- disabled (lines_per_page == 0).
-
-Mon Jul 10 22:27:53 1989 Randy Smith (roland at hobbes.ai.mit.edu)
-
- * expread.y [typebase]: Added "unsigned long int" and "unsigned
- short int" to specs.
-
-Mon Jul 10 21:44:55 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * main.c (main): Make -cd use cd_command to avoid
- current_directory with non-absolute pathname.
-
-Mon Jul 10 00:34:29 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (symbol_file_command): Catch errors from stat (even
- though they should never happen).
-
- * source.c (openp): If the path is null, use the current
- directory.
-
- * dbxread.c (read_dbx_symtab): Put N_SETV symbols into the misc
- function vector ...
- (record_misc_function): ... as data symbols.
-
- * utils.c (fprintf_filtered): Return after printing if we aren't
- going to do filtering.
-
- * Makefile: Added several things for make clean to take care of.
-
- * expread.y: Lowered "@" in precedence below +,-,*,/,%.
-
- * eval.c (evaluate_subexp): Return an error if the rhs of "@"
- isn't integral.
-
- * Makefile: Added removal of core and gdb[0-9] files to clean
- target.
-
- * Makefile: Made a new target "distclean", which cleans things up
- correctly for making a distribution.
-
-Sun Jul 9 23:21:27 1989 Randy Smith (randy at hobbes.ai.mit.edu)
-
- * dbxread.c: Surrounded define of gnu symbols with an #ifndef
- NO_GNU_STABS in case you don't want them on some machines.
- * m-npl.h, m-pn.h: Defined NO_GNU_STABS.
-
-Sun Jul 9 19:25:22 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * utils.c (fputs_filtered): New function.
- (fprintf_filtered): Use fputs_filtered.
- utils.c (print_spaces_filtered),
- command.c (help_cmd,help_cmd_list),
- printcmd.c (print_frame_args),
- stack.c (print_block_frame_locals, print_frame_arg_vars),
- valprint.c (many functions): Use fputs_filtered instead of
- fprintf_filtered to avoid arbitrary limit.
-
- * utils.c (fprintf_filtered): Fix incorrect comment.
-
-Sat Jul 8 18:12:01 1989 Randy Smith (randy at hobbes.ai.mit.edu)
-
- * valprint.c (val_print): Changed assignment of pretty to use
- prettyprint as a conditional rather than rely on values of the
- enum.
-
- * Projects: Cleaned up a little for release.
-
- * main.c (initialize_main): Initialize
- rl_completion_entry_function instead of completion_entry_function.
-
- * Makefile: Modified to use the new readline library setup.
-
- * breakpoint.c (break_command_1, delete_breakpoint,
- enable_breakpoint, disable_breakpoint): Put in new printouts for
- xgdb usage triggered off of xgdb_verbose.
- * main.c (main): Added check for flag to set xgdb_verbose.
- * stack.c (frame_command): Set frame_changed when frame command
- used.
-
-Fri Jul 7 16:20:58 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * Remove valprint.h and move contents to value.h (more logical).
-
-Fri Jul 7 02:28:06 1989 Randall Smith (randy at rice-chex)
-
- * m68k-pinsn.c (print_insn): Included a check for register list;
- if there is one, make sure to start p after it.
-
- * breakpoint.c (break_command_1, delete_breakpoint,
- enable_breakpoint, disable_breakpoint): #ifdef'd out changes
- below; they produce unwanted output in gdb mode in gnu-emacs.
-
- * gdb.texinfo: Spelled. Also removed index references from
- command editing section; the relevance/volume ratio was too low.
- Removed all references to the function index.
-
- * ns32k-opcode.h, ns32k-pinsn.c: Backed out changes of June 24th;
- haven't yet received legal papers.
-
- * .gdbinit: Included message telling the user what it is doing.
-
- * symmetry-dep.c: Added static decls for i386_get_frame_setup,
- i386_follow_jump.
- * values.c (unpack_double): Added a return (double)0 at the end to
- silence a compiler warning.
-
- * printcmd.c (containing_function_bounds, asdump_command): Created
- to dump the assembly code of a function (support for xgdb and a
- useful hack).
- (_initialize_printcmd): Added this to command list.
- * gdb.texinfo [Memory]: Added documentation for the asdump
- command.
- * breakpoint.c (break_command_1, delete_breakpoint,
- enable_breakpoint, disable_breakpoint): Added extra verbosity for
- xgdb conditionalized on the new external frame_full_file_name.
- * source.c (identify_source_line): Increase verbosity of fullname
- prointout to include pc value.
- * stack.c: Added a new variable; "frame_changed" to indicate when
- a frame has been changed so that gdb can print out a frame change
- message when the frame only changes implicitly.
- (print_frame_info): Check the new variable in determining when to
- print out a new message and set it to zero when done.
- (up_command): Increment it.
- (down_command): Decrement it.
-
- * m68k-pinsn.c (print_insn_arg [lL]): Modified cases for register
- lists to reset the point to point to after the word from which the
- list is grabbed *if* that would cause point to point farther than
- it currently is.
-
-Thu Jul 6 14:28:11 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * valprint.c (val_print, value_print): Add parameter to control
- prettyprinting.
- valprint.h: New file containing constants used for passing
- prettyprinting parameter to val{,ue}_print.
- expprint.c, infcmd.c, printcmd.c, valprint.c, values.c:
- Change all calls to val{,ue}_print to use new parameter.
-
-Mon Jul 3 22:38:11 1989 Randy Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (,process_one_symbol): Moved extern declaration for
- index out of function to beginning of file.
-
-Mon Jul 3 18:40:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
-
- * gdb.texinfo (Registers): Add "ps" to list of standard registers.
-
-Sun Jul 2 23:13:03 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * printcmd.c (enable_display): Change d->next to d = d->next so
- that "enable display" without args works.
-
-Fri Jun 30 23:42:04 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * source.c (list_command): Made error message given when no
- symtab is loaded clearer.
-
- * valops.c (value_assign): Make it so that when assigning to an
- internal variable, the type of the assignment exp is the type of
- the value being assigned.
-
-Fri Jun 30 12:12:43 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * main.c (verbose_info): Created.
- (initialize_main): Put "info verbose" into command list.
-
- * utils.c (screensize_info): Created.
- (_initialize_utils): Defined "info screensize" as a normal command.
-
- * valprint.c (format_info): Added information about maximum number
- of array elements to function.
-
- * blockframe.c (find_pc_partial_function): Again.
-
- * blockframe.c (find_pc_partial_function): Replaced a "shouldn't
- happen" (which does) with a zero return.
-
- * main.c (dont_repeat): Moved ahead of first use.
-
-Thu Jun 29 19:15:08 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * vax-opcode.h: Made minor modifications (moved an instruction and
- removed a typo) to bring this into accord with gas' table; also
- changed copyright to reflect it being part of both gdb and gas.
-
- * m68k-opcode.h: Added whole scads and bunches of new stuff for
- the m68851 and changed the coptyrightto recognize that the file
- was shared between gdb and gas.
-
- * main.c (stop_sig): Use "dont_repeat ()" instead of *line = 0;
-
- * core.c (read_memory): Don't do anything if length is 0.
-
- * Makefile: Added readline.c to the list of files screwed by
- having the ansi ioctl.h compilation with gcc.
-
- * config.gdb: Added sun4os3 & sun4-os3 as availible options.
-
-Wed Jun 28 02:01:26 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
-
- * command.c (lookup_cmd): Add ignore_help_classes argument.
- (lookup_cmd_1): Add ignore_help_classes argument.
- command.c, main.c: Change callers of lookup_cmd{,_1} to supply
- value for ignore_help_classes.
-
-Tue Jun 27 18:01:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * utils.c (print_spaces_filtered): Made more efficient.
- * defs.h: Declaration.
- * valprint.c (val_print): Used in a couple of new places.
-
-Mon Jun 26 18:27:28 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * m68k-pinsn.c (print_insn_arg ['#', '^']): Combined them into one
- case which always gets the argument from the word immediately
- following the instruction.
- (print_insn_arg ["[lL]w"]): Make sure to always get the register
- mask from the word immediately following the instruction.
-
-Sun Jun 25 19:14:56 1989 Randall Smith (randy at galapas.ai.mit.edu)
-
- * Makefile: Added hp-include back in as something to distribute.
-
- * stack.c (print_block_frame_locals): Return value changed from
- void to int; return 1 if values printed. Use _filtered.
- (print_frame_local_vars): Use return value from
- print_block_frame_locals to mention if nothing printed; mention
- lack of symbol table, use _filtered.
- (print_frame_arg_vars): Tell the user if no symbol table
- or no values printed. Use fprintf_filtered instead of fprintf.
- * blockframe.c (get_prev_frame_info): Check for no inferior or
- core file before crashing.
-
- * inflow.c (inferior_died): Set current frame to zero to keep from
- looking like we're in start.
-
-Sat Jun 24 15:50:53 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * stack.c (frame_command): Added a check to make sure that there
- was an inferior or a core file.
-
- * expread.y (yylex): Allow floating point numbers of the form ".5"
- to be parsed.
-
- Changes by David Taylor at TMC:
- * ns32k-pinsn.c: Added define for ?floating point coprocessor? and
- tables for register names to be used for each of the possibilities.
- (list_search): Created; searches a list of options for a specific
- value.
- (print_insn_arg): Added 'Q', 'b', 'M', 'P', 'g', and 'G' options
- to the value location switch.
- * ns32k-opcode.h: Added several new location flags.
- [addr, enter, exit, ext[bwd], exts[bwd], lmr, lpr[bwd], restore,
- rett, spr[bwd], smr]: Improved insn format output.
-
- * symtab.c (list_symbols): Rearrange printing to produce readable
- output for "info types".
-
- * eval.c (evaluate_subexp_for_address): Fixed typo.
-
- * dbxread.c (read_type): Don't output an error message when
- there isn't a ',' after a cross-reference.
-
- * dbxread.c (read_dbx_symtab): #if'd out N_FN case in
- read_dbx_symtab if it has the EXT bit set (otherwise multiple
- cases with the same value).
-
-Fri Jun 23 13:12:08 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * symmisc.c: Changed decl of print_spaces from static to extern
- (since it's defined in utils.c).
-
- * remote.c (remote_open): Close remote_desc if it's already been
- opened.
-
- * Remote_Makefile, remote_gutils.c, remote_inflow.c,
- remote_server.c, remote_utils.c: Combined into remote-multi.shar.
- * remote-multi.shar: Created (Vikram Koka's remote stub).
- * remote-sa.m68k.shar: Created (Glenn Engel's remcom.c).
- * README: Updated to reflect new organization of remote stubs.
-
- * dbxread.c (read_dbx_symtab): Put an N_FN in with N_FN | N_EXT to
- account for those machines which don't use the external bit here.
- Sigh.
-
- * m-symmetry.h: Defined NO_SIGINTERRUPT.
-
-Thu Jun 22 12:51:37 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * printcmd.c (decode_format): Make sure characters are printed
- using a byte size.
-
- * utils.c (error): Added a terminal_ours here.
-
- * stack.c (locals_info): Added check for selected frame.
-
- * dbxread.c (read_type): Checked to make sure that a "," was
- actually found in the symbol to end a cross reference.
-
-Wed Jun 21 10:30:01 1989 Randy Smith (randy at tartarus.uchicago.edu)
-
- * expread.y (parse_number, [exp]): Allowed for the return of a
- number marked as unsigned; this will allow inclusion of unsigned
- constants.
-
- * symtab.h: Put in default definitions for BUILTIN_TYPE_LONGEST
- and BUILTIN_TYPE_UNSIGNED_LONGEST.
-
- * expread.y (parse_number): Will now accept integers suffixed with
- a 'u' (though does nothing special with it).
-
- * valarith.c (value_binop): Added cases to deal with unsigned
- arithmetic correctly.
-
-Tue Jun 20 14:25:54 1989 Randy Smith (randy at tartarus.uchicago.edu)
-
- * dbxread.c (psymtab_to_symtab_1): Changed reading in info message
- to go through printf_filtered.
-
- * symtab.c (list_symbols): Placed header message after all calls
- to psymtab_to_symtab.
-
- * symtab.c (smash_to_{function, reference, pointer}_type): Carried
- attribute of permanence for the type being smashed over the bzero
- and allowed any type to point at this one if it is permanent.
-
- * symtab.c (smash_to_{function, reference, pointer}_type): Fix
- typo: check flags of to_type instead of type.
-
- * m-hp9k320.h: Changed check on __GNU__ predefine to __GNUC__.
-
- * Makefile: Made MUNCH_DEFINE seperate and based on SYSV_DEFINE;
- they aren't the same on hp's.
-
-Mon Jun 19 17:10:16 1989 Randy Smith (randy at tartarus.uchicago.edu)
-
- * Makefile: Fixed typo.
-
- * valops.c (call_function): Error if the inferior has not been
- started.
-
- * ns32k-opcode.h [check[wc], cmpm[bwd], movm[bwd], skpsb]: Fixed
- typos.
-
-Fri Jun 9 16:23:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-news.h [NO_SIGINTERRUPT]: Defined.
-
- * dbxread.c (read_type): Start copy of undefined structure name
- past [sue] defining type of cross ref.
-
- * dbxread.c (process_one_symbol): Changed strchr to index.
-
- * ns32k-opcode.h, ns32k-pinsn.c: More changes to number of
- operands, addition of all of the set condition opcodes, addition
- of several flag letters, all patterned after the gas code.
-
- * ns32k-opcode.h [mov{su,us}[bwd], or[bwd]]: Changed number of
- operands from 1 to 2.
-
-Wed Jun 7 15:04:24 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * symseg.h [TYPE_FLAG_STUB]: Created.
- * dbxread.c (read_type): Set flag bit if type is stub.
- (cleanup_undefined_types): Don't mark it as a stub if it's been
- defined since we first learned about it.
- * valprint.c (val_print): Print out a message to that effect if
- this type is encountered.
-
- * symseg.h, symtab.h: Moved the definition of TYPE_FLAG_PERM over
- to symseg.h so that all such definitions would be in the same place.
-
- * valprint.c (val_print): Print out <No data fields> for a
- structure if there aren't any.
-
- * dbxread.c (read_type): Set type name of a cross reference type
- to "struct whatever" or something.
-
-Tue Jun 6 19:40:52 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * breakpoint.c (breakpoint_1): Print out symbolic location of
- breakpoints for which there are no debugging symbols.
-
-Mon Jun 5 15:14:51 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * command.c (help_cmd_list): Made line_size static.
-
-Sat Jun 3 17:33:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * Makefile: Don't include the binutils hp-include directory in the
- distribution anymore; refer the users to the binutils distribution.
-
-Thu Jun 1 16:33:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * printcmd.c (disable_display_command): Fixed loop iteration for
- no arg case.
-
- * printcmd.c (disable_display_command): Added from_tty parameter
- to function.
-
- * valops.c (value_of_variable): Call read_var_value with 0 cast to
- FRAME instead of CORE_ADDR.
-
- * eval.c (evaluate_subexp): Corrected number of args passed to
- value_subscript (to 2).
-
- * infrun.c (wait_for_inferior), symtab.c (decode_line_1),
- m-convex.h: Changed name of FIRSTLINE_DEBUG_BROKEN to
- PROLOGUE_FIRSTLINE_OVERLAP.
-
- * m-merlin.h: Fixed typo.
- * ns32k-opcode.h: Added ns32381 opcodes and "cinv" insn, and fixed
- errors in movm[wd], rett, and sfsr.
-
- * eval.c (evaluate_subexp, evaluate_subexp_for_address), valops.c
- (value_zero): Change value_zero over to taking two arguments
- instead of three.
-
- * eval.c (evaluate_subexp)
- [OP_VAR_VALUE]: Get correct lval type for AVOID_SIDE_EFFECTS for
- all types of symbols.
- [BINOP_DIV]: Don't divide if avoiding side effects; just return
- an object of the correct type.
- [BINOP_REPEAT]: Don't call value_repeat, just allocate a
- repeated value.
- (evaluete_subexp_for_address) [OP_VAR_VALUE]: Just return a thing
- of the right type (after checking to make sure that we are allowed
- to take the address of whatever variable has been passed).
-
-Mon May 29 11:01:02 1989 Randall Smith (randy at galapas.ai.mit.edu)
-
- * breakpoint.c (until_break_command): Set the breakpoint with a
- frame specification so that it won't trip in inferior calls to the
- function. Also set things up so that it works based on selected
- frame, not current one.
-
-Sun May 28 15:05:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * eval.c (evalue_subexp): Change subscript case to use value_zero
- in EVAL_AVOID_SIDE_EFFECTS case.
-
-Fri May 26 12:03:56 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (read_addl_syms, psymtab_to_symtab): Removed
- cleanup_undefined_types; this needs to be done on a symtab basis.
- (end_symtab): Called cleanup_undefined_types from here.
- (cleanup_undefined_types): No longer uses lookup_symbol (brain
- dead idea; oh, well), now it searches through file_symbols.
-
-Wed May 24 15:52:43 1989 Randall Smith (randy at galapas)
-
- * source.c (select_source_symtab): Only run through
- partial_symtab_list if it exists.
-
- * coffread.c (read_coff_symtab): Don't unrecord a misc function
- when a function symbol is seen for it.
-
- * expread.y [variable]: Make sure to write a type for memvals if
- you don't get a mft you recognize.
-
-Tue May 23 12:15:57 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * dbxread.c (read_ofile_symtab, psymtab_to_symtab): Moved cleanup
- of undefined types to psymtab_to_symtab. That way it will be
- called once for all readins (which will, among other things,
- help reduce infinite loops).
-
- * symtab.h [misc_function_type]: Forced mf_unknown to 0.
- * dbxread.c (record_misc_function): Cast enum to unsigned char (to
- fit).
- * expread.y [variable]: Cast unsigned char back to enum to test.
-
-Mon May 22 13:08:25 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- Patches by John Gilmore for dealing well with floating point:
- * findvar.c (value_from_register, locate_var_value): Used
- BYTES_BIG_ENDIAN instead of an inline test.
- * m-sparc.h [IEEE_FLOAT]: Created to indicate that the sparc is
- IEEE compatible.
- * printcmd.c (print_scalar_formatted): Use BYTES_BIG_ENDIAN and
- the stream argument for printing; also modify default type for
- 'f'. Change handling of invalid floats; changed call syntax for
- is_nan.
- (print_command): Don't print out anything indicating that
- something was recorded on the history list if it wasn't.
- * valprint.c (val_print): Fixed to deal properley with new format
- of is_nan and unpacking doubles without errors occuring.
- (is_nan): Changed argument list and how it figures big endianness
- (uses macros).
- * values.c (record_latest_value): Return -1 and don't record if
- it's an invalid float.
- (value_as_double): Changed to use new unpack_double calling
- convention.
- (unpack_double): Changed not to call error if the float was
- invalid; simply to set invp and return. Changed calling syntax.
- (unpack_field_as_long, modify_field): Changed to use
- BITS_BIG_ENDIAN to determine correct action.
-
- * m-hp9k320.h [HP_OS_BUG]: Created; deals with problem where a
- trap happens after a continue.
- * infrun.c (wait_for_inferior): Used.
-
- * m-convex.h [FIRSTLINE_DEBUG_BROKEN]: Defined a flag to indicate
- that the debugging symbols output by the compiler for the first
- line of a function were broken.
- * infrun.c (wait_for_inferior), symtab.c (decode_line_1): Used.
-
- * gdb.texinfo [Data, Memory]: Minor cleanups of phrasing.
-
-Fri May 19 00:16:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (add_undefined_type, cleanup_undefined_types): Created
- to keep a list of cross references to as yet undefined types.
- (read_type): Call add_undefined_type when we run into such a case.
- (read_addl_syms, read_ofile_symtab): Call cleanup_undefined_types
- when we're done.
-
- * dbxread.c (psymtab_to_symtab, psymtab_to_symtab_1): Broke
- psymtab_to_symtab out into two routines; made sure the string
- table was only readin once and the globals were only scanned once,
- for any number of dependencies.
-
-Thu May 18 19:59:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-*.h: Defined (or not, as appropriate per machine)
- BITS_BIG_ENDIAN, BYTES_BIG_ENDIAN, and WORDS_BIG_ENDIAN.
-
-Wed May 17 13:37:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * main.c (symbol_completion_function): Always complete on result
- command list, even if exact match found. If it's really an exact
- match, it'll find it again; if there's something longer than it,
- it'll get the right result.
-
- * symtab.c (make_symbol_completion_function): Fixed typo; strcmp
- ==> strncmp.
-
- * dbxread.c (read_dbx_symtab): Change 'G' case to mark symbols as
- LOC_EXTERNAL.
-
- * expread.y [variables]: Changed default type of text symbols to
- function returning int so that one can use, eg. strcmp.
-
- * infrun.c (wait_for_inferior): Include a special flag indicating
- that one shouldn't insert the breakpoints on the next step for
- returning from a sigtramp and forcing at least one move forward.
-
- * infrun.c (wait_for_inferior): Change test for nexting into a
- function to check for current stack pointer inner than previous
- stack pointer.
-
- * infrun.c (wait_for_inferior): Check for step resume break
- address before dealing with normal breakpoints.
-
- * infrun.c (wait_for_inferior): Added a case to deal with taking
- and passing along a signal when single stepping past breakpoints
- before inserting breakpoints.
-
- * infrun.c (wait_for_inferior): Inserted special case to keep
- going after taking a signal we are supposed to be taking.
-
-Tue May 16 12:49:55 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * inflow.c (terminal_ours_1): Cast result of signal to (int
- (*)()).
-
- * gdb.texinfo: Made sure that references to the program were in
- upper case. Modify description of the "set prompt" command.
- [Running]: Cleaned up introduction.
- [Attach]: Cleaned up.
- [Stepping]: Change "Proceed" to "Continue running" or "Execute".
- Minor cleanup.
- [Source Path]: Cleaned up intro. Cleared up distinction between
- the executable search path and the source path. Restated effect
- of the "directory" command with no arguments.
- [Data]: Fixed typos and trivial details.
- [Stepping]: Fixed up explanation of "until".
-
- * source.c (print_source_lines): Print through filter.
-
- * printcmd.c (x_command): If the format with which to print is
- "i", use the address of anything that isn't a pointer instead of
- the value. This is for, eg. "x/10i main".
-
- * gdb.texinfo: Updated last modification date on manual.
-
-Mon May 15 12:11:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * symtab.c (lookup_symtab): Fixed typo (name ==> copy) in call to
- lookup_symtab_1.
-
- * gdb.texinfo: Added documentation for "break [+-]n" and for new
- actions of "directory" command (taking multiple directory names at
- the same time).
-
- * m68k-opcode.h: Replaced the version in gdb with an up-to-date
- version from the assembler directory.
- * m68k-pinsn.c (print_insn_arg): Added cases 'l' & 'L' to switch
- to print register lists for movem instructions.
-
- * dbxread.c, m-convex.h: Moved convex dependent include files over
- from dbxread.c to m-convex.h.
-
- * printcmd.c (disable_display, disable_display_command): Changed
- name of first to second, and created first which takes an int as
- arg rather than a char pointer. Changed second to use first.
- (_initialize_printcmd): Changed to use second as command to call.
- (delete_current_display, disable_current_display): Changed name of
- first to second, and changed functionality to match.
- * infrun.c (normal_stop), main.c (return_to_top_level): Changed to
- call disable_current_display.
-
- * dbxread.c (process_one_symbol, read_dbx_symtab): Changed N_FN to
- be N_FN | N_EXT to deal with new Berkeley define; this works with
- either the old or the new.
-
- * Remote_Makefile, remote_gutils.c, remote_inflow.c,
- remote_server.c, remote_utils.c: Created.
- * Makefile: Included in tag and tar files.
- * README: Included a note about them.
-
- * printcmd.c (print_address): Use find_pc_partial_function to
- remove need to readin symtabs for symbolic addresses.
-
- * source.c (directory_command): Replaced function with new one
- that can accept lists of directories seperated by spaces or :'s.
-
- * inflow.c (new_tty): Replaced calls to dup2 with calls to dup.
-
-Sun May 14 12:33:16 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * stack.c (args_info): Make sure that you have an inferior or core
- file before taking action.
-
- * ns32k-opcode.h [deiw, deid]: Fixed machine code values for these
- opcodes.
-
- * dbxread.c (scan_file_globals): Modified to use misc function
- vector instead of file itself. Killed all arguments to the
- funciton; no longer needed.
- (psymtab_to_symtab): Changed call for above to reflect new (void)
- argument list.
-
- * dbxread.c (read_dbx_symtab, ): Moved HASH_OFFSET define out of
- read_dbx_symtab.
-
- * expread.y [variable]: Changed default type of misc function in
- text space to be (void ()).
-
- * Makefile: Modified for proper number of s/r conflicts (order is
- confusing; the mod that necessitated this change was on May 12th,
- not today).
-
- * expread.y (yylex): Added SIGNED, LONG, SHORT, and INT keywords.
- [typename]: Created.
- [typebase]: Added rules for LONG, LONG INT, SHORT, SHORT INT,
- SIGNED name, and UNSIGNED name (a good approximation of ansi
- standard).
-
- * Makefile: Included .c.o rule to avoid sun's make from throwing
- any curves at us.
-
- * blockframe.c: Included <obstack.h>
-
- * command.c (lookup_cmd): Clear out trailing whitespace.
-
- * command.c (lookup_cmd_1): Changed malloc to alloca.
-
-Fri May 12 12:13:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * printcmd.c (print_frame_args): Only print nameless args when you
- know how many args there are supposed to be and when you've
- printed fewer than them. Don't print nameless args between
- printed args.
-
- * symtab.c (make_symbol_completion_function): Fixed typo (= ==>
- ==).
-
- * remote.c (remote_open): ifdef'd out siginterrupt call by #ifndef
- NO_SIGINTERRUPT.
- * m-umax.h: Defined NO_SIGINTERRUPT.
-
- * expread.y [ptype, array_mod, func_mod, direct_abs_decl,
- abs_decl]: Added rules for parsing and creating arbitrarily
- strange types for casts and sizeofs.
-
- * symtab.c, symtab.h (create_array_type): Created. Some minor
- misfeatures; see comments for details (main one being that you
- might end up creating two arrays when you only needed one).
-
-Thu May 11 13:11:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * valops.c (value_zero): Add an argument for type of lval.
- * eval.c (evaluate_subexp_for_address): Take address properly in
- the avoid side affects case (ie. keep track of whether we have an
- lval in memory and we can take the address).
- (evaluate_subexp): Set the lval type of expressions created with
- value_zero properley.
-
- * valops.c, value.h (value_zero): Created--will return a value of
- any type with contents filled with zero.
- * symtab.c, symtab.h (lookup_struct_elt_type): Created.
- * eval.c (evaluate_subexp): Modified to not read memory when
- called with EVAL_AVOID_SIDE_EFFECTS.
-
- * Makefile: Moved dbxread.c ahead of coffread.c in the list of
- source files.
-
-Wed May 10 11:29:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * munch: Make sure that sysv version substitutes for the whole
- line.
-
- * symtab.h: Created an enum misc_function_type to hold the type of
- the misc function being recorded.
- * dbxread.c (record_misc_function): Branched on dbx symbols to
- decide which type to assign to a misc function.
- * coffread.c (record_misc_function): Always assign type unknown.
- * expread.y [variable]: Now tests based on new values.
-
-Tue May 9 13:03:54 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * symtab.c: Changed inclusion of <strings.h> (doesn't work on
- SYSV) to declaration of index.
-
- * Makefile: Changed last couple of READLINE_FLAGS SYSV_DEFINE
-
- * source.c ({forward, reverse}_search_command): Made a default
- search file similar to for the list command.
-
-Mon May 8 18:07:51 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * printcmd.c (print_frame_args): If we don't know how many
- arguments there are to this function, don't print the nameless
- arguments. We don't know enough to find them.
-
- * printcmd.c (print_frame_args): Call print_frame_nameless_args
- with proper arguments (start & end as offsets from addr).
-
- * dbxread.c (read_addl_syms): Removed cases to deal with global
- symbols; this should all be done in scan_global_symbols.
-
-Sun May 7 11:36:23 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * Makefile: Added copying.awk to ${OTHERS}.
-
-Fri May 5 16:49:01 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * valprint.c (type_print_varspec_prefix): Don't pass
- passed_a_pointer onto children.
-
- * valprint.c (type_print_varspec_suffix): Print "array of" with
- whatever the "of" is after tha array brackets.
-
- * valprint.c (type_print_varspec_{prefix,suffix}): Arrange to
- parenthesisze pointers to arrays as well as pointers to other
- objects.
-
- * valprint.c (type_print_varspec_suffix): Make sure to print
- subscripts of multi-dimensional arrays in the right order.
-
- * infcmd.c (run_command): Fixed improper usages of variables
- within remote debugging branch.
-
- * Makefile: Added Convex.notes to the list of extra files to carry
- around.
-
- * dbxread.c (symbol_file_command): Made use of alloca or malloc
- dependent on macro define.
-
-Thu May 4 15:47:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * Makefile: Changed READLINE_FLAGS to SYSV_DEFINE and called munch
- with it also.
- * munch: Check first argument for -DSYSV and be looser about
- picking up init routines if you find it.
-
- * coffread.c: Made fclose be of type int.
-
- * breakpoint.c (_initialize_breakpoint): Put "unset" into class
- alias.
-
-Wed May 3 14:09:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-sparc.h [STACK_END_ADDR]: Parameterized off of
- machine/vmparam.h (as per John Gilmore's suggestion).
-
- * blockframe.c (get_prev_frame_info): Changed this function back
- to checking frameless invocation first before checking frame
- chain. This means that a backtrace up from start will produce the
- wrong value, but that a backtrace from a frameless function called
- in main will show up correctly.
-
- * breakpoint.c (_initialize_breakpoint): Added entry in help for
- delete that indicates that unset is an alias for it.
-
- * main.c (symbol_completion_function): Modified recognition of
- being within a single command.
-
-Tue May 2 15:13:45 1989 Randy Smith (randy at gnu)
-
- * expread.y [variable]: Add some parens to get checking of the
- misc function vector right.
-
-Mon May 1 13:07:03 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * default-dep.c (core_file_command): Made reg_offset unsigned.
-
- * default-dep.c (core_file_command): Improved error messages for
- reading in registers.
-
- * expread.y: Allowed a BLOCKNAME to be ok for a variable name (as
- per C syntax).
-
- * dbxread.c (psymtab_to_symtab): Flushed stdout after printing
- starting message about reading in symbols.
-
- * printcmd.c (print_frame_args): Switched starting place for
- printing of frameless args to be sizeof int above last real arg
- printed.
-
- * printcmd.c (print_frame_args): Modified final call to
- print_nameless_args to not use frame slots used array if none had
- been used.
-
- * infrun.c (wait_for_inferior): Take FUNCTION_START_OFFSET into
- account when dealing with comparison of pc values to function
- addresses.
-
- * Makefile: Added note about compiling gdb on a Vax running 4.3.
-
-Sun Apr 30 12:59:46 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * command.c (lookup_cmd): Got correct error message on bad
- command.
-
- * m-sun3.h [ABOUT_TO_RETURN]: Modified to allow any of the return
- instructions, including trapv and return from interupt.
-
- * command.c (lookup_cmd): If a command is found, use it's values
- for error reporting and determination of needed subcommands.
-
- * command.c (lookup_cmd): Use null string for error if cmdtype is
- null; pass *line to error instead of **.
-
- * command.c (lookup_cmd_1): End of command marked by anything but
- alpha numeric or '-'. Included ctype.h.
-
-Fri Apr 28 18:30:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * source.c (select_source_symtab): Kept line number from ever
- being less than 1 in main decode.
-
-Wed Apr 26 13:03:20 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * default-dep.c (core_file_command): Fixed typo.
-
- * utils.c (fprintf_filtered): Don't use return value from
- numchars.
-
- * main.c, command.c (complete_on_cmdlist): Moved function to
- command.c.
-
- * command.c (lookup_cmd): Modified to use my new routine. Old
- version is still there, ifdef'd out.
-
- * command.c, command.h (lookup_cmd_1): Added a routine to do all
- of the work of lookup_cmd with no error reporting and full return
- of information garnered in search.
-
-Tue Apr 25 12:37:54 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * breakpoint.c (_initialize_breakpoint): Change "delete
- breakpionts" to be in class alias and not have the abbrev flag
- set.
-
- * main.c (symbol_completion_function): Fix to correctly complete
- things that correspond to multiword aliases.
-
- * main.c (complete_on_cmdlist): Don't complete on something if it
- isn't a command or prefix (ie. if it's just a help topic).
-
- * main.c (symbol_completion_function): Set list index to be 0 if
- creating a list with just one element.
-
- * main.c (complete_on_cmdlist): Don't allow things with
- abbrev_flag set to be completion values.
- (symbol_completion_function): Don't accept an exact match if the
- abbrev flag is set.
-
- * dbxread.c (read_type): Fixed typo in comparision to check if
- type number existed.
-
- * dbxread.c (read_type): Made sure to only call dbx_lookup_type on
- typenums if typenums were not -1.
-
-Mon Apr 24 17:52:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * symtab.c: Added strings.h as an include file.
-
-Fri Apr 21 15:28:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * symtab.c (lookup_partial_symtab): Changed to only return a match
- if the name match is exact (which is what I want in all cases in
- which this is currently used.
-
-Thu Apr 20 11:12:34 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * m-isi.h [REGISTER_U_ADDR]: Installed new version from net.
- * default-dep.c: Deleted inclusion of fcntl.h; apparently not
- necessary.
- * Makefile: Added comment about compiling on isi under 4.3.
-
- * breakpoint.c (break_command_1): Only give decode_line_1 the
- default_breakpoint_defaults if there's nothing better (ie. make
- the default be off of the current_source notes if at all
- possible).
-
- * blockframe.c (get_prev_frame_info): Clean up comments and
- delete code ifdefed out around FRAMELESS_FUNCTION_INVOCATION test.
-
- * remote.c: Added a "?" message to protocol.
- (remote_open): Used at startup.
- (putpkt): Read whatever garbage comes over the line until we see a
- '+' (ie. don't treat garbage as a timeout).
-
- * valops.c (call_function): Eliminated no longer appropriate
- comment.
-
- * infrun.c (wait_for_inferior): Changed several convex conditional
- compilations to be conditional on CANNOT_EXECUTE_STACK.
-
-Wed Apr 19 10:18:17 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * printcmd.c (print_frame_args): Added code to attempt to deal
- with arguments that are bigger than an int.
-
- Continuation of Convex/Fortran changes:
- * printcmd.c (print_scalar_formatted): Added leading zeros to
- printing of large integers.
- (address_info, print_frame_args): Added code to deal with
- LOC_REF_ARG.
- (print_nameless_args): Allow param file to specify a routine with
- which to print typeless integers.
- (printf_command): Deal with long long values well.
- * stack.c (print_frame_arg_vars): Change to deal with LOC_REF_ARG.
- * symmisc.c (print_symbol): Change to deal with LOC_REF_ARG.
- * symseg.h: Added LOC_REF_ARG to enum address_class.
- * symtab.c (lookup_block_symbol): Changed to deal with
- LOC_REF_ARG.
- * valarith.c (value_subscripted_rvalue): Created.
- (value_subscript): Used above when app.
- (value_less, value_equal): Change to cast to (char *) before doing
- comparison, for machines where that casting does something.
- * valops.c (call_function): Setup to deal with machines where you
- cannot execute code on the stack segment.
- * valprint.c (val_print): Make sure that array element size isn't
- zero before printing. Set address of default array to address of
- first element. Put in a couple of int cast. Removed some convex
- specific code. Added check for endianness of machine in case of a
- packed structure. Added code for printing typeless integers and
- for LONG LONG's.
- (set_maximum_command): Change to use parse_and_eval_address to get
- argument (so can use expressions there).
- * values.c (value_of_internalvar, set_internalvar_component,
- set_internalvar, convenience_info): Add in hooks for trapped
- internal vars.
- (unpack_long): Deal with LONG_LONG.
- (value_field): Remove LONGEST cast.
- (using_struct_return): Fixed typo ENUM ==> UNION.
- * xgdb.c (_initialize_xgdb): Make sure that specify_exec_file_hook
- is not called unless we are setting up a windowing environ.
-
-Tue Apr 18 13:43:37 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- Various changes involved in 1) getting gdb to work on the convex,
- and 2) Getting gdb to work with fortran (due to convex!csmith):
- * convex-dep.c, convex-opcode.h, m-convex.h, convex-pinsn.c:
- Created (or replaced with new files).
- * Makefile: Add convex dependent files. Changed default flags to
- gnu malloc to be CFLAGS.
- * config.gdb: Added convex to list of machines.
- * core.c (files_info): Added a FILES_INFO_HOOK to be used if
- defined.
- (xfer_core_file): Conditionalized compilation of xfer_core_file on
- the macro XFER_CORE_FILE.
- * coffread.c (record_misc_function): Made sure it zerod type field
- (which is now being used; see next).
- * dbxread.c: Included some convex dependent include files.
- (copy_pending, fix_common_blocks): Created.
- [STAB_REG_REGNUM, BELIEVE_PCC_PROMOTION]: Created default values;
- may be overridden in m-*.h.
- Included data structures for keeping track of common blocks.
- (dbx_alloc_type): Modified; if called with negative 1's will
- create a type without putting it into the type vector.
- (read_dbx_symtab, read_addl_syms): Modified calls to
- record_misc_function to include the new information.
- (symbol_file_command, psymtab_to_symtab, add_file_command):
- Modified reading in of string table to adapt to machines which
- *don't* store the size of the string table in the first four bytes
- of the string table.
- (read_dbx_symtab, scan_file_globals, read_ofile_symtab,
- read_addl_syms): Modified assignment of namestring to accept null
- index into symtab as ok.
- (read_addl_syms): Modified readin of a new object file to fiddle
- with common blocks correctly.
- (process_one_symbol): Fixed incorrect comment about convex. Get
- symbols local to a lexical context from correct spot on a per
- machine basis. Catch a bug in pcc which occaisionally puts an SO
- where there should be an SOL. Seperate sections for N_BCOMM &
- N_ECOMM.
- (define_symbol): Ignore symbols with no ":". Use
- STAB_REG_TO_REGNUM. Added support for function args calling by
- reference.
- (read_type): Only read type number if one is there. Remove old
- (#if 0'd out) array code.
- (read_array_type): Added code for dealing with adjustable (by
- parameter) arrays half-heartedly.
- (read_enum_type): Allow a ',' to end a list of values.
- (read_range_type): Added code to check for long long.
- * expread.y: Modified to use LONGEST instead of long where
- necessary. Modified to use a default type of int for objects that
- weren't in text space.
- * findvar.c (locate_var_value, read_var_value): Modified to deal
- with args passed by reference.
- * inflow.c (create_inferior): Used CREATE_INFERIOR_HOOK if it
- exists.
- * infrun.c (attach_program): Run terminal inferior when attaching.
- (wait_for_inferior): Removed several convex dependencies.
- * main.c (float_handler): Created.
- Made whatever signal indicates a stop configurable (via macro
- STOP_SIGNAL).
- (main): Setup use of above as a signal handler. Added check for
- "-nw" in args already processed.
- (command_line_input): SIGTSTP ==>STOP_SIGNAL.
-
- * expread.y: Added token BLOCKNAME to remove reduce/reduce
- conflict.
- * Makefile: Change message to reflect new grammar.
-
-Mon Apr 17 13:24:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * printcmd.c (compare_ints): Created.
- (print_frame_args): Modified to always print arguments in the
- order in which they were found in the symbol table. Figure out
- what apots are missing on the fly.
-
- * stack.c (up_command): Error if no inferior or core file.
-
- * m-i386.h, m-symmetry.h [FRAMELESS_FUNCTION_INVOCATION]: Created;
- same as m68k.
-
- * dbxread.c (define_symbol): Changed "desc==0" test to
- "processing_gcc_compilation", which is the correct way to do it.
-
-Sat Apr 15 17:18:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * expread.y: Added precedence rules for arglists, ?:, and sizeof
- to eliminate some shift-reduce conflicts.
- * Makefile: Modified "Expect" message to conform to new results.
-
-Thu Apr 13 12:29:26 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * inflow.c (terminal_init_inferior): Fixed typo in recent diff
- installation; TIOGETC ==> TIOCGETC.
-
- * m-vax.h, m-sun2.h, m-sun3.h, m-sparc.h, m-hp*.h, m-isi.h,
- m-news.h [FRAMELESS_FUNCTION_INVOCATION]: Created macro with
- appropriate definition.
-
-Wed Apr 12 15:30:29 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * blockframe.c (get_prev_frame_info): Added in a macro to specify
- when a "frame" is called without a frame pointer being setup.
-
- * Makefile [clean]: Made sure to delete gnu malloc if it was being
- used.
-
-Mon Apr 10 12:43:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (process_one_symbol): Reset within_function to 0 after
- last RBRAC of a function.
-
- * dbxread.c (read_struct_type): Changed check for filling in of
- TYPE_MAIN_VARIANT of type.
-
- * inflow.c (create_inferior): Conditionalized fork so that it
- would be used if USG was defined and HAVE_VFORK was not defined.
-
- * defs.h: Added comment about enum command_class element
- class_alias.
-
- * dbxread.c (process_one_symbol): Fixed a typo with interesting
- implications for associative processing in the brain (':' ==> 'c').
-
- * sparc-dep.c (isabranch): Changed name to isannulled, modified to
- deal with coprocessor branches, and improved comment.
- (single_step): Changed to trap at npc + 4 instead of pc +8 on
- annulled branches. Changed name in call to isabranch as above.
-
- * m-sun4os4.h (STACK_END_ADDRESS): Changed it to 0xf8000000 under
- os 4.0.
-
-Sat Apr 8 17:04:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (process_one_symbol): In the case N_FUN or N_FNAME the
- value being refered to is sometimes just a text segment variable.
- Catch this case.
-
- * infrun.c (wait_for_inferior), breakpoint.c
- (breakpoint_stop_status): Move the selection of the frame to
- inside breakpoint_stop_status so that the frame only gets selected
- (and the symbols potentially read in) if the symbols are needed.
-
- * symtab.c (find_pc_psymbol): Fixed minor misthough (pc >=
- fucntion start, not >).
-
- * breakpoint.c (_initialize_breakpoint): Change "delete" internal
- help entry to simply refer to it being a prefix command (since the
- list of subcommands is right there on a "help delete").
-
-Fri Apr 7 15:22:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * blockframe.c (find_pc_partial_function): Created; figures out
- what function pc is in (name and address) without reading in any
- new symbols.
- * symtab.h: Added decl for above.
- * infrun.c (wait_for_inferior): Used instead of
- find_pc_function_start.
- * stack.c (print_frame_info): Used instead of hand coding for same
- thing.
-
- * dbxread.c (psymtab_to_symtab): No longer patch readin pst's out
- of the partial_symtab_list; need them there for some checks.
- * blockframe.c (block_for_pc), source.c (select_source_symtab),
- symtab.c (lookup_symbol, find_pc_symtab, list_symbols): Made extra
- sure not to call psymtab_to_symtab with ->readin == 1, since these
- psymtab now stay on the list.
- * symtab.c (sources_info): Now distinguishes between psymtabs with
- readin set and those with it not set.
-
- * symtab.c (lookup_symtab): Added check through partial symtabs
- for name with .c appended.
-
- * source.c (select_source_symtab): Changed semantics a little so
- that the argument means something.
- * source.c (list_command), symtab.c (decode_line_1): Changed call
- to select_source_symtab to match new conventions.
-
- * dbxread.c (add_file_command): This command no longer selects a
- symbol table to list from.
-
- * infrun.c (wait_for_inferior): Only call find_pc_function (to
- find out if we have debugging symbols for a function and hence if
- we should step over or into it) if we are doing a "step".
-
-Thu Apr 6 12:42:28 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * main.c (command_line_input): Added a local buffer and only
- copied information into the global main.c buffer when it is
- appropriate for it to be saved (and repeated).
- (dont_repeat): Only nail line when we are reading from stdin
- (otherwise null lines won't repeat and what's in line needs to be
- saved).
- (read_command_lines): Fixed typo; you don't what to repeat when
- reading command lines from the input stream unless it's standard
- input.
-
- John Gilmore's (gnu@toad.com) mods for USG gdb:
- * inflow.c: Removed inclusion of sys/user.h; no longer necessary.
- (, terminal_init_inferior, terminal_inferior, terminal_ours_1,
- term_status_command, _initialize_inflow) Seperated out declaration
- and usage of terminal mode structures based on the existence of
- the individual ioctls.
- * utils.c (request_quit): Restore signal handler under USG. If
- running under USG initialize sys_siglist at run time (too much
- variation between systems).
-
-Wed Apr 5 13:47:24 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- John Gilmore's (gnu@toad.com) mods for USG gdb:
- * default-dep.c: Moved include of sys/user.h to after include of
- a.out.h.
- (store_inferior_registers): Fixed error message.
- (core_file_command): Improved error messages from reading in of
- u area in core file. Changed calculation of offset of registers
- to account for some machines putting it in as an offset rather
- than an absolute address. Changed error messages for reading of
- registers from core file.
-
- * coffread.c (read_file_hdr): Added final check for BADMAG macro
- to use if couldn't recognize magic number.
- * Makefile: Added explicit directions for alloca addition.
- Included alloca.c in list of possible library files. Cleaned up
- possible library usage. Included additional information on gcc
- and include files.
-
- * source.c, remote.c, inflow.c, dbxread.c, core.c, coffread.c:
- Changed include of sys/fcntl.h to an include of fcntl.h (as per
- posix; presumably this will break fewer machines. I hopw).
- * README: Added a pointer to comments at top of Makefile.
- * Makefile: Added a comment about machines which need fcntl.h in
- sys.
-
-Tue Apr 4 11:29:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * valprint.c (set_prettyprint_command, set_unionprint_command,
- format_info): Created.
- (_initialize_valprint): Added to lists of commands.
-
- * gdb.texinfo [Backtrace]: Added a section describing the format
- if symbols have not yet been read in.
-
- * valprint.c (val_print): Added code to prettyprint structures if
- "prettyprint" is set and only to print unions below the top level
- if "unionprint" is set.
-
- * infcmd.c (registers_info), valprint.c (value_print, val_print):
- Added argument to call to val_print indicating deptch of recursion.
-
- * symtab.[ch] (find_pc_psymbol): Created; finds static function
- psymbol with value nearest to but under value passed.
- * stack.c (print_frame_info): Used above to make sure I have best
- fit to pc value.
-
- * symseg.h (struct partial_symbol): Added value field.
- * dbxread.c (read_dbx_symtab): Set value field for partial symbols
- saved (so that we can lookup static symbols).
-
- * symtab.[ch] (find_pc_symtab): Changed to external.
- * stack.c (select_frame): Call above to make sure that symbols for
- a selected frame is readin.
-
-Mon Apr 3 12:48:16 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * stack.c (print_frame_info): Modified to only print out full
- stack frame info on symbols whose tables have been read in.
- * symtab.c, symtab.h (find_pc_psymtab): Made function external;
- above needed it.
-
- * main.c (,set_verbose_command, initialize_main): Created a
- variable "info_verbose" which says to talk it up in various and
- sundry places. Added command to set this variable.
- * gdb.texinfo (GDB Output): Added documentation on "set verbose"
- and changed the name of the "Screen Output" section to "GDB
- Output".
- * dbxread.c (psymtab_to_symtab): Added information message about
- symbol readin. Conditionalized on above.
-
- * dbxread.c (define_symbol): Made an "i" constant be of class
- LOC_CONST and an "r" constant be of class LOC_CONST_BYTES.
-
- * README: Made a note about modifications which may be necessary
- to the manual for this version of gdb.
-
- * blockframe.c (get_prev_frame_info): Now we get saved address and
- check for validity before we check for leafism. This means that
- we will catch the fact that we are in start, but we will miss any
- fns that start calls without an fp. This should be fine.
-
- * m-*.h (FRAME_CHAIN): Modified to return 0 if we are in start.
- This is usually a test for within the first object file.
- * m-sparc.h (FRAME_CHAIN): The test here is simply if the fp saved
- off the the start sp is 0.
-
- * blockframe.c (get_prev_frame_info): Removed check to see if we
- were in start. Screws up sparc.
-
- * m-sparc.h (FRAME_FIND_SAVED_REGISTERS): Changed test for dummy
- frame to not need frame to be innermost.
-
- * gdb.texinfo: Added section on frameless invocations of functions
- and when gdb can and can't deal with this.
-
- * stack.c (frame_info): Disallowed call if no inferior or core
- file; fails gracefully if truely bad stack specfication has been
- given (ie. parse_frame_specification returns 0).
-
-Fri Mar 31 13:59:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * infrun.c (normal_stop): Changed references to "unset-env" to
- "delete env".
-
- * infcmd.c (_initialize_infcmd): Change reference to set-args in
- help run to "set args".
-
- * remote.c (getpkt): Allow immediate quit when reading from
- device; it could be hung.
-
- * coffread.c (process_coff_symbol): Modify handling of REG
- parameter symbols.
-
-Thu Mar 30 15:27:23 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (symbol_file_command): Use malloc to allocate the
- space for the string table in symbol_file_command (and setup a
- cleanup for this). This allows a more graceful error failure if
- there isn't any memory availible (and probably allows more memory
- to be avail, depending on the machine).
-
- Additional mods for handling GNU C++ (from Tiemann):
- * dbxread.c (read_type): Added case for '#' type (method type, I
- believe).
- (read_struct_type): If type code is undefined, make the main
- variant for the type be itself. Allow recognition of bad format
- in reading of structure fields.
- * eval.c (evaluate_subexp): Modify evaluation of a member of a
- structure and pointer to same to make sure that the syntax is
- being used correctly and that the member is being accessed correctly.
- * symseg.h: Added TYPE_CODE_METHOD to enum type_code. Add a
- pointer to an array of argument types to the type structure.
- * symtab.c (lookout_method_type, smash_to_method_type): Created.
- * symtab.h (TYPE_ARG_TYPES): Created.
- * valops.c (call_function): Modified handling of methods to be the
- same as handling of functions; no longer check for members.
- * valprint.c (val_print, type_print_varspec_{prefix,suffix},
- type_print_base): Added code to print method args correctly.
- * values.c (value_virtual_fn_field): Modify access to virtual
- function table.
-
-Wed Mar 29 13:19:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * findvar.c: Special cases for REGISTER_WINDOWS: 1) Return 0 if we
- are the innermost frame, and 2) return the next frame in's value
- if the SP is being looked for.
-
- * blockframe.c (get_next_frame): Created; returns the next (inner)
- frame of the called frame.
- * frame.h: Extern delcaration for above.
-
- * main.c (command_line_input): Stick null at end before doing
- history expansion.
-
-Tue Mar 28 17:35:50 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab): Added namestring assignment to
- N_DATA/BSS/ABS case. Sigh.
-
-Sat Mar 25 17:49:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * expread.y: Defined YYDEBUG.
-
-Fri Mar 24 20:46:55 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * symtab.c (make_symbol_completion_list): Completely rewrote to
- never call psymtab_to_symtab, to do a correct search (no
- duplicates) through the visible symbols, and to include structure
- and union fields in the things that it can match.
-
-Thu Mar 23 15:27:44 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (dbx_create_type): Created; allocates and inits space
- for a type without putting it on the type vector lists.
- (dbx_alloc_type): Uses above.
-
- * Makefile: xgdb.o now produced by default rules for .o.c.
-
-Fri Mar 17 14:27:50 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * infrun.c: Fixed up inclusion of aouthdr.h on UMAX_PTRACE.
-
- * Makefile, config.gdb: Added hp300bsd to potential
- configurations.
- * hp300bsd-dep.c, m-hp300bsd.h: Created.
-
- * infrun.c (wait_for_inferior): Rewrote to do no access to
- inferior until we make sure it's still there.
-
- * inflow.c (inferior_died): Added a select to force the selected
- frame to null when inferior dies.
-
- * dbxread.c (symbol_file_command): free and zero symfile when
- discarding symbols.
-
- * core.c (xfer_core_file): Extended and cleaned up logic in
- interpeting memory address.
-
- * core.c (xfer_core_file): Extended opening comment.
-
-Thu Mar 16 15:39:42 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * coffread.c (symbol_file_command): Free symfile name when freeing
- contents.
-
- * blockframe.c (get_prev_frame_info): Added to fatal error message
- to indicate that it should never happen.
-
- * stack.c (frame_info): Printed out value of "saved" sp seperately
- to call attention to the fact that it isn't stored in memory
- anywhere; the actual previous frames address is printed.
-
- * m-sparc.h (FRAME_FIND_SAVED_REGS): Set address of sp saved in
- frame to value of fp (rather than value of sp in current frame).
-
- * expread.y: Allow "unsigned" as a type itself, as well as a type
- modifier.
-
- * coffread.c: Added declaration for fclose
-
-Fri Mar 10 17:22:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * main.c (command_line_input): Checked for -1 return from
- readline; indicates EOF.
-
-Fri Mar 3 00:31:27 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * remote.c (remote_open): Cast return from signal to (void (*)) to
- avoid problems on machines where the return type of signal is (int
- (*)).
-
- * Makefile: Removed deletion of version control from it (users
- will need it for their changes).
-
-Thu Mar 2 15:32:21 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * symmetry-dep.c (print_1167_regs): Print out effective doubles on
- even number regs.
- (fetch_inferior_registers): Get the floating point regs also.
-
- * xgdb.c (do_command): Copied command before calling execute
- command (so that execute_command wouldn't write into text space).
-
- * copying.awk: Created (will produce copying.c as output when
- given COPYING as input).
- * Makefile: Used above to create copying.c.
- * main.c: Took out info_warranty and info_copying.
-
- * *.*: Changed copyright notice to use new GNU General Public
- License (includes necessary changes to manual).
-
- * xgdb.c (create_text_widget): Created text_widget before I create
- the source and sink.
- (print_prompt): Added fflush (stdout).
-
- * Makefile: Added -lXmu to the compilation line for xgdb. Left
- the old one there incase people still had R2.
-
- * README: Added note about -gg format.
-
- * remote.c (getpkt): Fixed typo; && ==> &.
-
- * Makefile: Added new variable READLINE_FLAGS so that I could
- force compilation of readline.c and history.c with -DSYSV on
- system V machines. Mentioned in Makefile comments at top.
-
-Wed Mar 1 17:01:01 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * hp9k320-dep.c (store_inferior_registers): Fixed typo.
-
-Fri Feb 24 14:58:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * hp9k320-dep.c (store_inferior_registers,
- fetch_inferior_registers): Added support for remote debugging.
-
- * remote.c (remote_timer): Created.
- (remote_open, readchar): Setup to timeout reads if they take
- longer than "timeout". This allows one to debug how long such
- things take.
- (putpkt): Modified to print a debugging message (if such things
- are enabled) each time it resends a packet.
- (getpkt): Modified to make the variable CSUM unsigned and read it
- CSUM with an & 0xff (presumably to deal with poor sign extension
- on some machines). Also made c1 and c2 unsigned.
- (remote_wait): Changed buffer to unsigned status.
- (remote_store_registers, remote_write_bytes): Puts a null byte at
- the end of the control string.
-
- * infcmd.c (attach_command, detach_command, _initialize_infcmd):
- Made attach_command and detach_command always availible, but
- modified them to only allow device file attaches if ATTACH_DETACH
- is not defined.
-
- * gdb.texinfo: Added cross reference from attach command to remote
- debugging.
-
-Thu Feb 23 12:37:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * remote.c (remote_close): Created to close the remote connection
- and set the remote_debugging flag to 0.
- * infcmd.c (detach_command): Now calls the above when appropriate.
-
- * gdb.texinfo: Removed references to the ``Distribution'' section
- in the copyright.
-
- * main.c, utils.c (ISATTY): Created default defintions of this
- macro which use isatty and fileno.
- * utils.c (fprintf_filtered, print_spaces_filtered), main.c
- (command_loop, command_line_input): Used this macro.
- * m-news.h: Created a definition to override this one.
-
- * utils.c (fprintf_filtered): Made line_size static (clueless).
-
- * utils.c (fprintf_filtered): Changed max length of line printed
- to be 255 chars or twice the format length.
-
- * symmetry-dep.c, m-symmetry: Fixed typo (^L ==> ).
-
- * printcmd.c (do_examine): Fixed typo (\n ==> \t).
-
-Wed Feb 22 16:00:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- Contributed by Jay Vosburgh (jay@mentor.cc.purdue.edu)
- * m-symmetry.h, symmetry-dep.c: Created.
- * Makefile: Added above in appropriate lists.
- * config.gdb: Added "symmetry" target.
-
- * utils.c (prompt_for_continue): Zero'd chars_printed also.
-
- * utils.c (fprintf_filtered): Call prompt for continue instead of
- doing it yourself.
-
- * dbxread.c (read_dbx_symtab): Added code to conditionalize what
- symbol type holds to "x.o" or "-lx" symbol that indicates the
- beginning of a new file.
-
-Tue Feb 21 16:22:13 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * gdb.texinfo: Deleted @ignore block at end of file.
-
- * findvar.c, stack.c: Changed comments that refered to "frame
- address" to "frame id".
-
- * findvar.c (locate_var_value): Modified so that taking the
- address of an array generates an object whose type is a pointer to
- the elements of the array.
-
-Sat Feb 18 16:35:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * gdb.texinfo: Removed reference to "!" as a shell escape
- character. Added a section on controling screen output
- (pagination); changing "Input" section to "User Interface"
- section. Changed many inappropriate subsubsection nodes into
- subsections nodes (in the readline and history expansion
- sections).
-
-Fri Feb 17 11:10:54 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * utils.c (set_screensize_command): Created.
- (_initialize_utils): Added above to setlist.
-
- * main.c (main): Added check to see if ~/.gdbinit and .gdbinit
- were the same file; only one gets read if so. Had to include
- sys/stat.h for this.
-
- * valprint.c (type_print_base): Changed calls to print_spaces to
- print_spaces_filtered.
-
- * main.c (command_line_input): Chaned test for command line
- editing to check for stdin and isatty.
-
- * main.c (command_loop): Call reinitialize_more_filter before each
- command (if reading from stdin and it's a tty).
- utils.c (initialize_more_filter): Changed name to
- reinitialize_more_filter; killed arguments.
- utils.c (_initialize_utils): Created; initialized lines_per_page
- and chars_per_line here.
-
- * utils.c (fprintf_filtered): Removed printing of "\\\n" after
- printing linesize - 1 chars; assume that the screen display will
- take care of that. Still watching that overflow.
-
- * main.c: Created the global variables linesize and pagesize to
- describe the number of chars per line and lines per page.
-
-Thu Feb 16 17:27:43 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * printcmd.c (do_examine, print_scalar_formatted, print_address,
- whatis_command, do_one_display, ptype_command), valprint.c
- (value_print, val_print, type_print_method_args, type_print_1,
- type_print_derivation_info, type_print_varspec_suffix,
- type_print_base), breakpoint.c (breakpoints_info, breakpoint_1),
- values.c (history_info), main.c (editing_info, warranty_info,
- copying_info), infcmd.c (registers_info), inflow.c
- (term_status_command), infrun.c (signals_info), stack.c
- (backtrace_command, print_frame_info), symtab.c (list_symbols,
- output_source_filename), command.c (help_cmd, help_list,
- help_command_list): Replaced calls to printf, fprintf, and putc
- with calls to [f]printf_filtered to handle more processing.
- Killed local more emulations where I noticed them.
-
-Wed Feb 15 15:27:36 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * defs.h, utils.c (initialize_more_filter, fprintf_filtered,
- printf_filtered): Created a printf that will also act as a more
- filter, prompting the user for a <return> whenever the page length
- is overflowed.
-
- * symtab.c (list_symbols): Elminated some code inside of an #if 0.
-
-Tue Feb 14 11:11:24 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * Makefile: Turned off backup versions for this file; it changes
- too often.
-
- * command.c (lookup_cmd, _initialize_command): Changed '!' so that
- it was no longer a shell escape. "sh" must be used.
-
- * main.c (command_line_input, set_history_expansion,
- initialize_main): Turned history expansion on, made it the
- default, and only execute it if the first character in the line is
- a '!'.
-
- * version.c, gdb.texinfo: Moved version to 3.2 (as usual, jumping
- the gun some time before release).
-
- * gdb.texinfo: Added sections (adapted from Brian's notes) on
- command line editing and history expansion.
-
- * main.c (set_command_editing, initialize_main): Modified name to
- set_editing and modified command to "set editing".
-
- * Makefile: Put in dependencies for READLINEOBJS.
-
- * main.c (history_info, command_info): Combined into new command
- info; deleted history_info.
- (initialize_main): Deleted "info history" command; it was
- interfering with the value history.
-
- * coffread.c (enter_linenos): Modified to do bit copy instead of
- pointer dereference, since the clipper machine can't handle having
- longs on short boundaries.
- (read_file_hdr): Added code to get number of syms for clipper.
-
- * stack.c (return_command): Fixed method for checking when all of
- the necessary frames had been popped.
-
- * dbxread.c (read_dbx_symtab (ADD_PSYMBOL_TO_LIST)): Fixed typo in
- allocation length.
-
-Mon Feb 13 10:03:27 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab): Split assignment to namestring into
- several different assignments (so that it wouldn't be done except
- when it had to be). Shortened switches and duplicated code to
- produce the lowest possible execution time. Commented (at top of
- switch) which code I duplicated.
-
- * dbxread.c (read_dbx_symtab): Modified which variables were
- register and deleted several variables which weren't used. Also
- eliminated 'F' choice from subswitch, broke out strcmp's, reversed
- compare on line 1986, and elminated test for !namestring[0]; it is
- caught by following test for null index of ':'.
-
-Sun Feb 12 12:57:56 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * main.c (gdb_completer_word_break_characters): Turned \~ into ~.
-
-Sat Feb 11 15:39:06 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * symtab.c (find_pc_psymtab): Created; checks all psymtab's till
- it finds pc.
- (find_pc_symtab): Used; fatal error if psymtab found is readin
- (should have been caught in symtab loop).
- (lookup_symbol): Added check before scan through partial symtab
- list for symbol name to be on the misc function vector (only if in
- VAR_NAMESPACE). Also made sure that psymtab's weren't fooled with
- if they had already been read in.
- (list_symbols): Checked through misc_function_vector for matching
- names if we were looking for functions.
- (make_symbol_completion_list): Checked through
- misc_function_vector for matching names.
- * dbxread.c (read_dbx_symtab): Don't bother to do processing on
- global function types; this will be taken care of by the
- misc_function hack.
-
- * symtab.h: Modified comment on misc_function structure.
-
-Fri Feb 10 18:09:33 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * symseg.h, dbxread.c (read_dbx_symtab, init_psymbol_list,
- start_psymtab, end_psymtab), coffread.c (_initialize_coff),
- symtab.c (lookup_partial_symbol, list_symbols,
- make_symbol_completion_list): Changed separate variables for
- description of partial symbol allocation into a specific kind of
- structure.
-
- (read_dbx_symtab, process_symbol_for_psymtab): Moved most of
- process_symbol_for_psymtab up into read_dbx_symtab, moved a couple
- of symbol types down to the ingore section, streamlined (I hope)
- code some, modularized access to psymbol lists.
-
-Thu Feb 9 13:21:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * main.c (command_line_input): Made sure that it could recognize
- newlines as indications to repeat the last line.
-
- * symtab.c (_initialize_symtab): Changed size of builtin_type_void
- to be 1 for compatibility with gcc.
-
- * main.c (initialize_main): Made history_expansion the default
- when gdb is compiled with HISTORY_EXPANSION.
-
- * readline.c, readline.h, history.c, history.h, general.h,
- emacs_keymap.c, vi_keymap.c, keymaps.c, funmap.c: Made all of
- these links to /gp/gnu/bash/* to keep them updated.
- * main.c (initialize_main): Made default be command editing on.
-
-Wed Feb 8 13:32:04 1989 & Smith (randy at hobbes)
-
- * dbxread.c (read_dbx_symtab): Ignore N_BSLINE on first
- readthrough.
-
- * Makefile: Removed convex-dep.c from list of distribution files.
-
-Tue Feb 7 14:06:25 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * main.c: Added command lists sethistlist and unsethistlist to
- accesible command lists.
- (parse_binary_operation): Created to parse a on/1/yes vs. off/0/no
- spec.
- (set_command_edit, set_history, set_history_expansion,
- set_history_write, set_history_size, set_history_filename,
- command_info, history_info): Created to allow users to control
- various aspects of command line editing.
-
- * main.c (symbol_creation_function): Created.
- (command_line_input, initialize_main): Added rest of stuff
- necessary for calling bfox' command editing routines under
- run-time control.
- * Makefile: Included readline and history source files for command
- editing; also made arrangements to make sure that the termcap
- library was available.
- * symtab.c (make_symbol_completion_list): Created.
-
-Mon Feb 6 16:25:25 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * main.c: Invented variables to control command editing.
- command_editing_p, history_expansion_p, history_size,
- write_history_p, history_filename. Initialized them to default
- values in initialize_main.
-
- * infcmd.c (registers_info), infrun.c (signals_info),
- * main.c (gdb_read_line): Changed name to command_line_input.
- (readline): Changed name to gdb_readline; added second argument
- indicating that the read value shouldn't be saved (via malloc).
- * infcmd.c (registers_info), infrun.c (signals_info), main.c
- (copying_info), symtab.c (output_source_filename, MORE,
- list_symbols): Converted to use gdb_readline in place of
- gdb_read_line.
-
-
-Sun Feb 5 17:34:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * blockframe.c (get_frame_saved_regs): Removed macro expansion
- that had accidentally been left in the code.
-
-Sat Feb 4 17:54:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * main.c (gdb_read_line, readline): Added function readline and
- converted gdb_read_line to use it. This was a conversion to the
- line at a time style of input, in preparation for full command
- editing.
-
-Fri Feb 3 12:39:03 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab): Call end_psymtab at the end of
- read_dbx_symtab if any psymtab still needs to be completed.
-
- * config.gdb, sun3-dep.c: Brought these into accord with the
- actual sun2 status (no floating point period; sun3-dep.c unless
- has os > 3.0).
- * m-sun2os2.h: Deleted; not needed.
-
- * config.gdb: Added a couple of aliases for machines in the
- script.
-
- * infrun.c: Added inclusion of aouthdr.h inside of #ifdef UMAX
- because ptrace needs to know about the a.out header.
-
- * Makefile: Made dep.o depend on dep.c and config.status only.
-
- * expread.y: Added declarations of all of the new write_exp_elt
- functions at the include section in the top.
-
- * Makefile: Added a YACC definition so that people can use bison
- if they wish.
-
- * Makefile: Added rms' XGDB-README to the distribution.
-
- * Makefile: Added removal of init.o on a "make clean".
-
-Thu Feb 2 16:27:06 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * *-dep.c: Deleted definition of COFF_FORMAT if AOUTHDR was
- defined since 1) We *may* (recent mail message) want to define
- AOUTHDR under a basically BSD system, and 2) AOUTHDR is sometimes
- a typedef in coff encapsulation setups. Also removed #define's of
- AOUTHDR if AOUTHDR is already defined (inside of coff format).
- * core.c, dbxread.c: Removed #define's of AOUTHDR if AOUTHDR is
- already defined (inside of coff format).
-
-Tue Jan 31 12:56:01 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * GDB 3.1 released.
-
- * values.c (modify_field): Changed test for endianness to assign
- to integer and reference character (so that all bits would be
- defined).
-
-Mon Jan 30 11:41:21 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * news-dep.c: Deleted inclusion of fcntl.h; just duplicates stuff
- found in sys/file.h.
-
- * i386-dep.c: Included default definition of N_SET_MAGIC for
- COFF_FORMAT.
-
- * config.gdb: Added checks for several different operating
- systems.
-
- * coffread.c (read_struct_type): Put in a flag variable so that
- one could tell when you got to the end of a structure.
-
- * sun3-dep.c (core_file_command): Changed #ifdef based on SUNOS4
- to ifdef based on FPU.
-
- * infrun.c (restore_inferior_status): Changed error message to
- "unable to restore previously selected frame".
-
- * dbxread.c (read_dbx_symtab): Used intermediate variable in error
- message reporting a bad symbol type. (scan_file_globals,
- read_ofile_symtab, read_addl_syms): Data type of "type" changed to
- unsigned char (which is what it is).
- * i386-dep.c: Removed define of COFF_FORMAT if AOUTHDR is defined.
- Removed define of a_magic to magic (taken care of by N_MAGIC).
- (core_file_command): Zero'd core_aouthdr instead of setting magic
- to zero.
- * i386-pinsn.c: Changed jcxz == jCcxz in jump table.
- (putop): Added a case for 'C'.
- (OP_J): Added code to handle possible masking of PC value on
- certain kinds of data.
- m-i386gas.h: Moved COFF_ENCAPSULATE to before inclusion of
- m-i386.h and defined NAMES_HAVE_UNDERSCORE.
-
- * coffread.c (unrecrod_misc_function, read_coff_symtab): Added
- symbol number on which error occured to error output.
-
-Fri Jan 27 11:55:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * Makefile: Removed init.c in make clean. Removed it without -f
- and with leading - in make ?gdb.
-
-Thu Jan 26 15:08:03 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- Changes to get it to work on gould NP1.
- * dbxread.c (read_dbx_symtab): Included cases for N_NBDATA and
- N_NBBSS.
- (psymtab_to_symtab): Changed declaration of hdr to
- DECLARE_FILE_HEADERS. Changed access to use STRING_TABLE_SIZE and
- SYMBOL_TABLE_SIZE.
- * gld-pinsn.c (findframe): Added declaration of framechain() as
- FRAME_ADDR.
-
- * coffread.c (read_coff_symtab): Avoided treating typedefs as
- external symbol definitions.
-
-Wed Jan 25 14:45:43 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * Makefile: Removed reference to alloca.c. If they need it, they
- can pull alloca.o from the gnu-emacs directory.
-
- * version.c, gdb.texinfo: Updated version to 3.1 (jumping the gun
- a bit so that I won't forget when I release).
-
- * m-sun2.h, m-sun2os2.h, m-sun3os4.h, config.gdb: Modified code so
- that default includes new sun core, ptrace, and attach-detach.
- Added defaults for sun 2 os 2.
-
- Modifications to reset stack limit back to what it used to be just
- before exec. All mods inside of #ifdef SET_STACK_LIMIT_HUGE.
- * main.c: Added global variable original_stack_limit.
- (main): Set original_stack_limit to original stack limit.
- * inflow.c: Added inclusion of necessary files and external
- reference to original_stack_limit.
- (create_inferior): Reset stack limit to original_stack_limit.
-
- * dbxread.c (read_dbx_symtab): Killed PROFILE_SYMBOLS ifdef.
-
- * sparc-dep.c (isabranch): Multiplied offset by 4 before adding it
- to addr to get target.
-
- * Makefile: Added definition of SHELL to Makefile.
-
- * m-sun2os4.h: Added code to define NEW_SUN_PTRACE, NEW_SUN_CORE,
- and ATTACH_DETACH.
- * sun3-dep.c: Added code to avoid fp regs if we are on a sun2.
-
-Tue Jan 24 17:59:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (read_array_type): Added function.
- (read_type): Added call to above instead of inline code.
-
- * Makefile: Added ${GNU_MALLOC} to the list of dependencies for
- the executables.
-
-Mon Jan 23 15:08:51 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * gdb.texinfo: Added paragraph to summary describing languages
- with which gdb can be run. Also added descriptions of the
- "info-methods" and "add-file" commands.
-
- * symseg.h: Commented a range type as having TYPE_TARGET_TYPE
- pointing at the containing type for the range (often int).
- * dbxread.c (read_range_type): Added code to do actual range types
- if they are defined. Assumed that the length of a range type is
- the length of the target type; this is a lie, but will do until
- somebody gets back to me as to what these silly dbx symbols mean.
-
- * dbxread.c (read_range_type): Added code to be more picky about
- recognizing builtins as range types, to treat types defined as
- subranges of themselves to be subranges of int, and to recognize
- the char type idiom from dbx as a special case.
-
-Sun Jan 22 01:00:13 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-vax.h: Removed definition of FUNCTION_HAS_FRAME_POINTER.
- * blockframe.c (get_prev_frame_info): Removed default definition
- and use of above. Instead conditionalized checking for leaf nodes
- on FUNCTION_START_OFFSET (see comment in code).
-
-Sat Jan 21 16:59:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (read_range_type): Fixed assumption that integer was
- always type 1.
-
- * gdb.texinfo: Fixed spelling mistake and added a note in the
- running section making it clear that users may invoke subroutines
- directly from gdb.
-
- * blockframe.c: Setup a default definition for the macro
- FUNCTION_HAS_FRAME_POINTER.
- (get_prev_frame_info): Used this macro instead of checking
- SKIP_PROLOGUE directly.
- * m-vax.h: Overroad definition; all functions on the vax have
- frame pointers.
-
-Fri Jan 20 12:25:35 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * core.c: Added default definition of N_MAGIC for COFF_FORMAT.
-
- * xgdb.c: Installed a fix to keep the thing from dying when there
- isn't any frame selected.
-
- * core.c: Made a change for the UMAX system; needs a different
- file included if using that core format.
-
- * Makefile: Deleted duplicate obstack.h in dbxread.c dependency.
-
- * munch: Modified (much simpler) to cover (I hope) all cases.
-
- * utils.c (save_cleanups, restore_cleanups): Added functions to
- allow you to push and pop the chain of cleanups to be done.
- * defs.h: Declared the new functions.
- * main.c (catch_errors): Made sure that the only cleanups which
- would be done were the ones put on the chain *after* the current
- location.
-
- * m-*.h (FRAME_CHAIN_VALID): Removed check on pc in the current
- frame being valid.
- * blockframe.c (get_prev_frame_info): Made the assumption that if
- a frame's pc value was within the first object file (presumed to
- be /lib/crt0.o), that we shouldn't go any higher.
-
- * infrun.c (wait_for_inferior): Do *not* execute check for stop pc
- at step_resume_break if we are proceeding over a breakpoint (ie.
- if trap_expected != 0).
-
- * Makefile: Added -g to LDFLAGS.
-
- * m-news.h (POP_FRAME) Fixed typo.
-
- * printcmd.c (print_frame_args): Modified to print out register
- params in order by .stabs entry, not by register number.
-
- * sparc-opcode.h: Changed declaration of (struct
- arith_imm_fmt).simm to be signed (as per architecture manual).
- * sparc-pinsn.c (fprint_addr1, print_insn): Forced a cast to an
- int, so that we really would get signed behaivior (default for sun
- cc is unsigned).
-
- * i386-dep.c (i386_get_frame_setup): Replace function with new
- function provided by pace to fix bug in recognizing prologue.
-
-Thu Jan 19 11:01:22 1989 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * infcmd.c (run_command): Changed error message to "Program not
- restarted."
-
- * value.h: Changed "frame" field in value structure to be a
- FRAME_ADDR (actually CORE_ADDR) so that it could survive across
- calls.
-
- * m-sun.h (FRAME_FIND_SAVED_REGS): Fixed a typo.
-
- * value.h: Added lval: "lval_reg_frame_relative" to indicate a
- register that must be interpeted relative to a frame. Added
- single entry to value structure: "frame", used to indicate which
- frame a relative regnum is relative to.
- * findvar.c (value_from_register): Modified to correctly setup
- these fields when needed. Deleted section to fiddle with last
- register copied on little endian machine; multi register
- structures will always occupy an integral number of registers.
- (find_saved_register): Made extern.
- * values.c (allocate_value, allocate_repeat_value): Zero frame
- field on creation.
- * valops.c (value_assign): Added case for lval_reg_frame_relative;
- copy value out, modify it, and copy it back. Desclared
- find_saved_register as being external.
- * value.h: Removed addition of kludgy structure; thoroughly
- commented file.
- * values.c (free_value, free_all_values, clear_value_history,
- set_internalvar, clear_internavars): Killed free_value.
-
-Wed Jan 18 20:09:39 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * value.h: Deleted struct partial_storage; left over from
- yesterday.
-
- * findvar.c (value_from_register): Added code to create a value of
- type lval_reg_partsaved if a value is in seperate registers and
- saved in different places.
-
-Tue Jan 17 13:50:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * value.h: Added lval_reg_partsaved to enum lval_type and
- commented enum lval_type. Commented value structure.
- Added "struct partial_register_saved" to value struct; added
- macros to deal with structure to value.h.
- * values.c (free_value): Created; special cases lval_reg_partsaved
- (which has a pointer to an array which also needs to be free).
- (free_all_values, clear_value_history, set_internalvar,
- clear_internalvars): Modified to use free_values.
-
- * m-sunos4.h: Changed name to sun3os4.h.
- * m-sun2os4.h, m-sun4os4.h: Created.
- * config.gdb: Added configuration entries for each of the above.
- * Makefile: Added into correct lists.
-
- * Makefile: Added dependencies on a.out.encap.h. Made
- a.out.encap.h dependent on a.out.gnu.h and dbxread.c dependent on
- stab.gnu.h.
-
- * infrun.c, remote.c: Removed inclusion of any a.out.h files in
- these files; they aren't needed.
-
- * README: Added comment about bug reporting and comment about
- xgdb.
-
- * Makefile: Added note to HPUX dependent section warning about
- problems if compiled with gcc and mentioning the need to add
- -Ihp-include to CFLAGS if you compile on those systems. Added a
- note about needing the GNU nm with compilers *of gdb* that use the
- coff encapsulate feature also. * hp-include: Made symbolic link
- over to /gp/gnu/binutils.
-
- * Makefile: Added TSOBS NTSOBS OBSTACK and REGEX to list of things
- to delete in "make clean". Also changed "squeakyclean" target as
- "realclean".
-
- * findvar.c (value_from_register): Added assignment of VALUE_LVAL
- to be lval_memory when that is appropriate (original code didn't
- bother because it assumed that it was working with a pre lval
- memoried value).
-
- * expread.y (yylex): Changed to only return type THIS if the
- symbol "$this" is defined in some block superior or equal to the
- current expression context block.
-
-Mon Jan 16 13:56:44 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-*.h (FRAME_CHAIN_VALID): On machines which check the relation
- of FRAME_SAVED_PC (thisframe) to first_object_file_end (all except
- gould), make sure that the pc of the current frame also passes (in
- case someone stops in _start).
-
- * findvar.c (value_of_register): Changed error message in case of
- no inferior or core file.
-
- * infcmd.c (registers_info): Added a check for inferior or core
- file; error message if not.
-
- * main.c (gdb_read_line): Modified to take prompt as argument and
- output it to stdout.
- * infcmd.c (registers_info, signals_info), main.c (command_loop,
- read_command_lines, copying_info), symtab.c (decode_line_2,
- output_source_filename, MORE, list_symbols): Changed calling
- convention used to call gdb_read_line.
-
- * infcmd.c, infrun.c, main.c, symtab.c: Changed the name of the
- function "read_line" to "gdb_read_line".
- * breakpoint.c: Deleted external referenced to function
- "read_line" (not needed by code).
-
-Fri Jan 13 12:22:05 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * i386-dep.c: Include a.out.encap.h if COFF_ENCAPSULATE.
- (N_SET_MAGIC): Defined if not defined by include file.
- (core_file_command): Used N_SET_MAGIC instead of assignment to
- a_magic.
- (exec_file_command): Stuck in a HEADER_SEEK_FD.
-
- * config.gdb: Added i386-dep.c as depfile for i386gas choice.
-
- * munch: Added -I. to cc to pick up things included by the param
- file.
-
- * stab.gnu.def: Changed name to stab.def (stab.gnu.h needs this name).
- * Makefile: Changed name here also.
- * dbxread.c: Changed name of gnu-stab.h to stab.gnu.h.
-
- * gnu-stab.h: Changed name to stab.gnu.h.
- * stab.gnu.def: Added as link to binutils.
- * Makefile: Put both in in the distribution.
-
-Thu Jan 12 11:33:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c: Made which stab.h is included dependent on
- COFF_ENCAPSULATE; either <stab.h> or "gnu-stab.h".
- * Makefile: Included gnu-stab.h in the list of files to include in
- the distribution.
- * gnu-stab.h: Made a link to /gp/gnu/binutils/stab.h
-
- * Makefile: Included a.out.gnu.h and m-i386gas.h in list of
- distribution files.
- * m-i386gas.h: Changed to include m-i386.h and fiddle with it
- instead of being a whole new file.
- * a.out.gnu.h: Made a link to /gp/gnu/binutils/a.out.gnu.h.
-
- Chris Hanson's changes to gdb for hp Unix.
- * Makefile: Modified comments on hpux.
- * hp9k320-dep.c: #define'd WOPR & moved inclusion of signal.h
- * inflow.c: Moved around declaratiosn of <sys/fcntl.h> and
- <sys/ioctl.h> inside of USG depends and deleted all SYSV ifdef's
- (use USG instead).
- * munch: Modified to accept any number of spaces between the T and
- the symbol name.
-
- Pace's changes to gdb to work with COFF_ENCAPSULATE (robotussin):
- * config.gdb: Added i386gas to targets.
- * default-dep.c: Include a.out.encap.h if COFF_ENCAPSULATE.
- (N_SET_MAGIC): Defined if not defined by include file.
- (core_file_command): Used N_SET_MAGIC instead of assignment to a_magic.
- (exec_file_command): Stuck in a HEADER_SEEK_FD.
- * infrun.c, remote.c: Added an include of a.out.encap.h if
- COFF_ENCAPSULATE defined. This is commented out in these two
- files, I presume because the definitions aren't used.
- * m-i386gas.h: Created.
- * dbxread.c: Included defintions for USG.
- (READ_FILE_HEADERS): Now uses HEADER_SEEK_FD if it exists.
- (symbol_file_command): Deleted use of HEADER_SEEK_FD.
- * core.c: Deleted extra definition of COFF_FORMAT.
- (N_MAGIC): Defined to be a_magic if not already defined.
- (validate_files): USed N_MAGIC instead of reading a_magic.
-
-Wed Jan 11 12:51:00 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * remote.c: Upped PBUFSIZ.
- (getpkt): Added zeroing of c inside loop in case of error retry.
-
- * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Removed
- code to not put stuff with debugging symbols in the misc function
- list. Had been ifdef'd out.
-
- * gdb.texinfo: Added the fact that the return value for a function
- is printed if you use return.
-
- * infrun.c (wait_for_inferior): Removed test in "Have we hit
- step_resume_breakpoint" for sp values in proper orientation. Was
- in there for recursive calls in functions without frame pointers
- and it was screwing up calls to alloca.
-
- * dbxread.c: Added #ifdef COFF_ENCAPSULATE to include
- a.out.encap.h.
- (symbol_file_command): Do HEADER_SEEK_FD when defined.
- * dbxread.c, core.c: Deleted #ifdef ROBOTUSSIN stuff.
- * robotussin.h: Deleted local copy (was symlink).
- * a.out.encap.h: Created symlink to
- /gp/gnu/binutils/a.out.encap.h.
- * Makefile: Removed robotussin.h and included a.out.encap.h in
- list of files.
-
- * valprint.c (val_print, print_scalar_formatted): Changed default
- precision of printing float value; now 6 for a float and 16 for a
- double.
-
- * findvar.c (value_from_register): Added code to deal with the
- case where a value is spread over several registers. Still don't
- deal with the case when some registers are saved in memory and
- some aren't.
-
-Tue Jan 10 17:04:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * xgdb.c (xgdb_create_window): Removed third arg (XtDepth) to
- frameArgs.
-
- * infrun.c (handle_command): Error if signal number is less or
- equal to 0 or greater or equal to NSIG or a signal number is not
- provided.
-
- * command.c (lookup_cmd): Modified to not convert command section
- of command line to lower case in place (in case it isn't a
- subcommand, but an argument to a command).
-
-Fri Jan 6 17:57:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c: Changed "text area" to "data area" in comments on
- N_SETV.
-
-Wed Jan 4 12:29:54 1989 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * dbxread.c: Added definitions of gnu symbol types after inclusion
- of a.out.h and stab.h.
-
-Mon Jan 2 20:38:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * eval.c (evaluate_subexp): Binary logical operations needed to
- know type to determine whether second value should be evaluated.
- Modified to discover type before binup_user_defined_p branch.
- Also commented "enum noside".
-
- * Makefile: Changed invocations of munch to be "./munch".
-
- * gdb.texinfo: Updated to refer to current version of gdb with
- January 1989 last update.
-
- * coffread.c (end_symtab): Zero context stack when finishing
- lexical contexts.
- (read_coff_symtab): error if context stack 0 in ".ef" else case.
-
- * m-*.h (FRAME_SAVED_PC): Changed name of argument from "frame" to
- "FRAME" to avoid problems with replacement of "->frame" part of
- macro.
-
- * i386-dep.c (i386_get_frame_setup): Added codestream_get() to
- move codestream pointer up to the correct location in "subl $X,
- %esp" case.
-
-Sun Jan 1 14:24:35 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * valprint.c (val_print): Rewrote routine to print string pointed
- to by char pointer; was producing incorrect results when print_max
- was 0.
-
-Fri Dec 30 12:13:35 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Put
- everything on the misc function list.
-
- * Checkpointed distribution.
-
- * Makefile: Added expread.tab.c to the list of things slated for
- distribution.
-
-Thu Dec 29 10:06:41 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * stack.c (set_backtrace_limit_command, backtrace_limit_info,
- bactrace_command, _initialize_stack): Removed modifications for
- limit on backtrace. Piping the backtrace through an interuptable
- "more" emulation is a better way to do it.
-
-Wed Dec 28 11:43:09 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * stack.c
- (set_backtrace_limit_command): Added command to set a limit to the
- number of frames for a backtrace to print by default.
- (backtrace_limit_info): To print the current limit.
- (backtrace_command): To use the limit.
- (_initialize_stack): To initialize the limit to its default value
- (30), and add the set and info commands onto the appropriate
- command lists.
-
- * gdb.texinfo: Documented changes to "backtrace" and "commands"
- commands.
-
- * stack.c (backtrace_command): Altered so that a negative argument
- would show the last few frames on the stack instead of the first
- few.
- (_initialize_stack): Modified help documentation.
-
- * breakpoint.c (commands_command): Altered so that "commands" with
- no argument would refer to the last breakpoint set.
- (_initialize_breakpoint): Modified help documentation.
-
- * infrun.c (wait_for_inferior): Removed ifdef on Sun4; now you can
- single step through compiler generated sub calls and will die if
- you next off of the end of a function.
-
- * sparc-dep.c (single_step): Fixed typo; "break_insn" ==> "sizeof
- break_insn".
-
- * m-sparc.h (INIT_EXTRA_FRAME_INFO): Set the bottom of a stack
- frame to be the bottom of the stack frame inner from this, if that
- inner one is a leaf node.
-
- * dbxread.c (read_dbx_symtab): Check to make sure we don't add a
- psymtab to it's own dependency list.
-
- * dbxread.c (read_dbx_symtab): Modified check for duplicate
- dependencies to catch them correctly.
-
-Tue Dec 27 17:02:09 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-*.h (FRAME_SAVED_PC): Modified macro to take frame info
- pointer as argument.
- * stack.c (frame_info), blockframe.c (get_prev_frame_info),
- gld-pinsn.c (findframe), m-*.h (SAVED_PC_AFTER_CALL,
- FRAME_CHAIN_VALID, FRAME_NUM_ARGS): Changed usage of macros to
- conform to above.
- * m-sparc.h (FRAME_SAVED_PC), sparc-dep.c (frame_saved_pc):
- Changed frame_saved_pc to have a frame info pointer as an
- argument.
-
- * m-vax.h, m-umax.h, m-npl.h, infrun.c (wait_for_inferior),
- blockframe.c (get_prev_frame_info): Modified SAVED_PC_AFTER_CALL
- to take a frame info pointer as an argument.
-
- * blockframe.c (get_prev_frame_info): Altered the use of the
- macros FRAME_CHAIN, FRAME_CHAIN_VALID, and FRAME_CHAIN_COMBINE to
- use frame info pointers as arguments instead of frame addresses.
- * m-vax.h, m-umax.h, m-sun3.h, m-sun3.h, m-sparc.h, m-pn.h,
- m-npl.h, m-news.h, m-merlin.h, m-isi.h, m-hp9k320.h, m-i386.h:
- Modified definitions of the above macros to suit.
- * m-pn.h, m-npl.h, gould-dep.c (findframe): Modified findframe to
- use a frame info argument; also fixed internals (wouldn't work
- before).
-
- * m-sparc.h: Cosmetic changes; reordered some macros and made sure
- that nothing went over 80 lines.
-
-Thu Dec 22 11:49:15 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * Version 3.0 released.
-
- * README: Deleted note about changing -lobstack to obstack.o.
-
-Wed Dec 21 11:12:47 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-vax.h (SKIP_PROLOGUE): Now recognizes gcc prologue also.
-
- * blockframe.c (get_prev_frame_info): Added FUNCTION_START_OFFSET
- to result of get_pc_function_start.
- * infrun.c (wait_for_inferior): Same.
-
- * gdb.texinfo: Documented new "step" and "next" behavior in
- functions without line number information.
-
-Tue Dec 20 18:00:45 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * infcmd.c (step_1): Changed behavior of "step" or "next" in a
- function witout line number information. It now sets the step
- range around the function (to single step out of it) using the
- misc function vector, warns the user, and continues.
-
- * symtab.c (find_pc_line): Zero "end" subsection of returned
- symtab_and_line if no symtab found.
-
-Mon Dec 19 17:44:35 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * i386-pinsn.c (OP_REG): Added code from pace to streamline
- disassembly and corrected types.
- * i386-dep.c
- (i386_follow_jump): Code added to follow byte and word offset
- branches.
- (i386_get_frame_setup): Expanded to deal with more wide ranging
- function prologue.
- (i386_frame_find_saved_regs, i386_skip_prologue): Changed to use
- i386_get_frame_setup.
-
-
-Sun Dec 18 11:15:03 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-sparc.h: Deleted definition of SUN4_COMPILER_BUG; was designed
- to avoid something that I consider a bug in our code, not theirs,
- and which I fixed earlier. Also deleted definition of
- CANNOT_USE_ARBITRARY_FRAME; no longer used anywhere.
- FRAME_SPECIFICATION_DYADIC used instead.
-
- * infrun.c (wait_for_inferior): On the sun 4, if a function
- doesn't have a prologue, a next over it single steps into it.
- This gets around the problem of a "call .stret4" at the end of
- functions returning structures.
- * m-sparc.h: Defined SUN4_COMPILER_FEATURE.
-
- * main.c (copying_info): Seperated the last printf into two
- printfs. The 386 compiler will now handle it.
-
- * i386-pinsn.c, i386-dep.c: Moved print_387_control_word,
- print_387_status_word, print_387_status, and i386_float_info to
- dep.c Also included reg.h in dep.c.
-
-Sat Dec 17 15:31:38 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * main.c (source_command): Don't close instream if it's null
- (indicating execution of a user-defined command).
- (execute_command): Set instream to null before executing
- commands and setup clean stuff to put it back on error.
-
- * inflow.c (terminal_inferior): Went back to not checking the
- ioctl returns; there are some systems when this will simply fail.
- It seems that, on most of these systems, nothing bad will happen
- by that failure.
-
- * values.c (value_static_field): Fixed dereferencing of null
- pointer.
-
- * i386-dep.c (i386_follow_jump): Modified to deal with
- unconditional byte offsets also.
-
- * dbxread.c (read_type): Fixed typo in function type case of switch.
-
- * infcmd.c (run_command): Does not prompt to restart if command is
- not from a tty.
-
-Fri Dec 16 15:21:58 1988 Randy Smith (randy at calvin)
-
- * gdb.texinfo: Added a third option under the "Cannot Insert
- Breakpoints" workarounds.
-
- * printcmd.c (display_command): Don't do the display unless there
- is an active inferior; only set it.
-
- * findvar.c (value_of_register): Added an error check for calling
- this when the inferior isn't active and a core file isn't being
- read.
-
- * config.gdb: Added reminder about modifying REGEX in the
- makefile for the 386.
-
- * i386-pinsn.c, i386-dep.c: Moved m-i386.h helper functions over
- to i386-dep.c.b
-
-Thu Dec 15 14:04:25 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * README: Added a couple of notes about compiling gdb with itself.
-
- * breakpoint.c (set_momentary_breakpoint): Only takes FRAME_FP of
- frame if frame is non-zero.
-
- * printcmd.c (print_scalar_formatted): Implemented /g size for
- hexadecimal format on machines without an 8 byte integer type. It
- seems to be non-trivial to implement /g for other formats.
- (decode_format): Allowed hexadecimal format to make it through /g
- fileter.
-
-Wed Dec 14 13:27:04 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * expread.y: Converted all calls to write_exp_elt from the parser
- to calls to one of write_exp_elt_{opcode, sym, longcst, dblcst,
- char, type, intern}. Created all of these routines. This gets
- around possible problems in passing one of these things in one ear
- and getting something different out the other. Eliminated
- SUN4_COMPILER_BUG ifdef's; they are now superfluous.
-
- * symmisc.c (free_all_psymtabs): Reinited partial_symtab_list to 0.
- (_initialize_symmisc): Initialized both symtab_list and
- partial_symtab_list.
-
- * dbxread.c (start_psymtab): Didn't allocate anything on
- dependency list.
- (end_psymtab): Allocate dependency list on psymbol obstack from
- local list.
- (add_psymtab_dependency): Deleted.
- (read_dbx_symtab): Put dependency on local list if it isn't on it
- already.
-
- * symtab.c: Added definition of psymbol_obstack.
- * symtab.h: Added declaration of psymbol_obstack.
- * symmisc.c (free_all_psymtabs): Added freeing and
- reinitionaliztion of psymbol_obstack.
- * dbxread.c (free_all_psymbols): Deleted.
- (start_psymtab, end_psymtab,
- process_symbol_for_psymtab): Changed most allocation
- of partial symbol stuff to be off of psymbol_obstack.
-
- * symmisc.c (free_psymtab, free_all_psymtabs): Deleted
- free_psymtab subroutine.
-
- * symtab.h: Removed num_includes and includes from partial_symtab
- structure; no longer needed now that all include files have their
- own psymtab.
- * dbxread.c (start_psymtab): Eliminated initialization of above.
- (end_psymtab): Eliminated finalization of above; get
- includes from seperate list.
- (read_dbx_symtab): Moved includes from psymtab list to
- their own list; included in call to end_psymtab.
- * symmisc.c (free_psymtab): Don't free includes.
-
-Tue Dec 13 14:48:14 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * i386-pinsn.c: Reformatted entire file to correspond to gnu
- software indentation conventions.
-
- * sparc-dep.c (skip_prologue): Added capability of recognizign
- stores of input register parameters into stack slots.
-
- * sparc-dep.c: Added an include of sparc-opcode.h.
- * sparc-pinsn.c, sparc-opcode.h: Moved insn_fmt structures and
- unions from pinsn.c to opcode.h.
- * sparc-pinsn.c, sparc-dep.c (isabranch, skip_prologue): Moved
- this function from pinsn.c to dep.c.
-
- * Makefile: Put in warnings about compiling with gcc (non-ansi
- include files) and compiling with shared libs on Sunos 4.0 (can't
- debug something that's been compiled that way).
-
- * sparc-pinsn.c: Put in a completely new file (provided by
- Tiemann) to handle floating point disassembly, load and store
- instructions, and etc. better. Made the modifications this file
- (ChangeLog) list for sparc-pinsn.c again.
-
- * symtab.c (output_source_filename): Included "more" emulation hack.
-
- * symtab.c (output_source_filename): Initialized COLUMN to 0.
- (sources_info): Modified to not print out a line for
- all of the include files within a partial symtab (since
- they have pst's of their own now). Also modified to
- make a distinction between those pst's read in and
- those not.
-
- * infrun.c: Included void declaration of single_step() if it's
- going to be used.
- * sparc-dep.c (single_step): Moved function previous to use of it.
-
- * Makefile: Took removal of expread.tab.c out of make clean entry
- and put it into a new "squeakyclean" entry.
-
-Mon Dec 12 13:21:02 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * sparc-pinsn.c (skip_prologue): Changed a struct insn_fmt to a
- union insn_fmt.
-
- * inflow.c (terminal_inferior): Checked *all* return codes from
- ioctl's and fcntl's in routine.
-
- * inflow.c (terminal_inferior): Added check for sucess of
- TIOCSPGRP ioctl call. Just notifies if bad.
-
- * dbxread.c (symbol_file_command): Close was getting called twice;
- once directly and once through cleanup. Killed the direct call.
-
-Sun Dec 11 19:40:40 1988 & Smith (randy at hobbes.ai.mit.edu)
-
- * valprint.c (val_print): Deleted spurious printing of "=" from
- TYPE_CODE_REF case.
-
-Sat Dec 10 16:41:07 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * dbxread.c: Changed allocation of psymbols from using malloc and
- realloc to using obstacks. This means they aren't realloc'd out
- from under the pointers to them.
-
-Fri Dec 9 10:33:24 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * sparc-dep.c inflow.c core.c expread.y command.c infrun.c
- infcmd.c dbxread.c symmisc.c symtab.c printcmd.c valprint.c
- values.c source.c stack.c findvar.c breakpoint.c blockframe.c
- main.c: Various cleanups inspired by "gcc -Wall" (without checking
- for implicit declarations).
-
- * Makefile: Cleaned up some more.
-
- * valops.c, m-*.h (FIX_CALL_DUMMY): Modified to take 5 arguments
- as per what sparc needs (programming for a superset of needed
- args).
-
- * dbxread.c (process_symbol_for_psymtab): Modified to be slightly
- more picky about what it puts on the list of things *not* to be
- put on the misc function list. When/if I shift everything over to
- being placed on the misc_function_list, this will go away.
-
- * inferior.h, infrun.c: Added fields to save in inferior_status
- structure.
-
- * maketarfile: Deleted; functionality is in Makefile now.
-
- * infrun.c (wait_for_inferior): Modified algorithm for determining
- whether or not a single-step was through a subroutine call. See
- comments at top of file.
-
- * dbxread.c (read_dbx_symtab): Made sure that the IGNORE_SYMBOL
- macro would be checked during initial readin.
-
- * dbxread.c (read_ofile_symtab): Added macro GCC_COMPILED_FLAG_SYMBOL
- into dbxread.c to indicate what string in a local text symbol will
- indicate a file compiled with gcc. Defaults to "gcc_compiled.".
-
-Thu Dec 8 11:46:22 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-sparc.h (FRAME_FIND_SAVED_REGS): Cleaned up a little to take
- advantage of the new frame cache system.
-
- * inferior.h, infrun.c, valops.c, valops.c, infcmd.c: Changed
- mechanism to save inferior status over calls to inferior (eg.
- call_function); implemented save_inferior_info and
- restore_inferior_info.
-
- * blockframe.c (get_prev_frame): Simplified this by a direct call
- to get_prev_frame_info.
-
- * frame.h, stack.c, printcmd.c, m-sparc.h, sparc-dep.c: Removed
- all uses of frame_id_from_addr. There are short routines like it
- still in frame_saved_pc (m-sparc.h) and parse_frame_spec
- (stack.c). Eventually the one in frame_saved_pc will go away.
-
- * infcmd.c, sparc-dep.c: Implemented a new mechanism for
- re-selecting the selected frame on return from a call.
-
- * blockframe.c, stack.c, findvar.c, printcmd.c, m-*.h: Changed
- all routines and macros that took a "struct frame_info" as an
- argument to take a "struct frame_info *". Routines: findarg,
- framechain, print_frame_args, FRAME_ARGS_ADDRESS,
- FRAME_STRUCT_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS,
- FRAME_FIND_SAVED_REGS.
-
- * frame.h, stack.c, printcmd.c, infcmd.c, findvar.c, breakpoint.c,
- blockframe.c, xgdb.c, i386-pinsn.c, gld-pinsn.c, m-umax.h,
- m-sun2.h, m-sun3.h, m-sparc.h, m-pn.h, m-npl.h, m-news.h,
- m-merlin.h, m-isi.h, m-i386.h, m-hp9k320.h: Changed routines to
- use "struct frame_info *" internally.
-
-Wed Dec 7 12:07:54 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * frame.h, blockframe.c, m-sparc.h, sparc-dep.c: Changed all calls
- to get_[prev_]frame_cache_item to get_[prev_]frame_info.
-
- * blockframe.c: Elminated get_frame_cache_item and
- get_prev_frame_cache_item; functionality now taken care of by
- get_frame_info and get_prev_frame_info.
-
- * blockframe.c: Put allocation on an obstack and eliminated fancy
- reallocation routines, several variables, and various nasty
- things.
-
- * frame.h, stack.c, infrun.c, blockframe.c, sparc-dep.c: Changed
- type FRAME to be a typedef to "struct frame_info *". Had to also
- change routines that returned frame id's to return the pointer
- instead of the cache index.
-
- * infcmd.c (finish_command): Used proper method of getting from
- function symbol to start of function. Was treating a symbol as a
- value.
-
- * blockframe.c, breakpoint.c, findvar.c, infcmd.c, stack.c,
- xgdb.c, i386-pinsn.c, frame.h, m-hp9k320.h, m-i386.h, m-isi.h,
- m-merlin.h, m-news.h, m-npl.h, m-pn.h, m-sparc.h, m-sun2.h,
- m-sun3.h, m-umax.h: Changed get_frame_info and get_prev_frame_info
- to return pointers instead of structures.
-
- * blockframe.c (get_pc_function_start): Modified to go to misc
- function table instead of bombing if pc was in a block without a
- containing function.
-
- * coffread.c: Dup'd descriptor passed to read_coff_symtab and
- fdopen'd it so that there wouldn't be multiple closes on the same
- fd. Also put (fclose, stream) on the cleanup list.
-
- * printcmd.c, stack.c: Changed print_frame_args to take a
- frame_info struct as argument instead of the address of the args
- to the frame.
-
- * m-i386.h (STORE_STRUCT_RETURN): Decremented sp by sizeof object
- to store (an address) rather than 1.
-
- * dbxread.c (read_dbx_symtab): Set first_object_file_end in
- read_dbx_symtab (oops).
-
- * coffread.c (fill_in_vptr_fieldno): Rewrote TYPE_BASECLASS as
- necessary.
-
-Tue Dec 6 13:03:43 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * coffread.c: Added fake support for partial_symtabs to allow
- compilation and execution without there use.
- * inflow.c: Added a couple of minor USG mods.
- * munch: Put in appropriate conditionals so that it would work on
- USG systems.
- * Makefile: Made regex.* handled same as obstack.*; made sure tar
- file included everything I wanted it to include (including
- malloc.c).
-
- * dbxread.c (end_psymtab): Create an entry in the
- partial_symtab_list for each subfile of the .o file just read in.
- This allows a "list expread.y:10" to work when we haven't read in
- expread.o's symbol stuff yet.
-
- * symtab.h, dbxread.c (psymtab_to_symtab): Recognize pst->ldsymlen
- == 0 as indicating a dummy psymtab, only in existence to cause the
- dependency list to be read in.
-
- * dbxread.c (sort_symtab_syms): Elminated reversal of symbols to
- make sure that register debug symbol decls always come before
- parameter symbols. After mod below, this is not needed.
-
- * symtab.c (lookup_block_symbol): Take parameter type symbols
- (LOC_ARG or LOC_REGPARM) after any other symbols which match.
-
- * dbxread.c (read_type): When defining a type in terms of some
- other type and the other type is supposed to have a pointer back
- to this specific kind of type (pointer, reference, or function),
- check to see if *that* type has been created yet. If it has, use
- it and fill in the appropriate slot with a pointer to it.
-
-Mon Dec 5 11:25:04 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * symmisc.c: Eliminated existence of free_inclink_symtabs and
- init_free_inclink_symtabs; they aren't called from anywhere, and
- if they were they could disrupt gdb's data structure badly
- (elimination of struct type's which values that stick around past
- elimination of inclink symtabs).
-
- * dbxread.c (symbol_file_command): Fixed a return pathway out of
- the routine to do_cleanups before it left.
-
- * infcmd.c (set_environment_command), gdb.texinfo: Added
- capability to set environmental variable values to null.
-
- * gdb.texinfo: Modified doc on "break" without args slightly.
-
-Sun Dec 4 17:03:16 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * dbxread.c (symbol_file_command): Added check; if there weren't
- any debugging symbols in the file just read, the user is warned.
-
- * infcmd.c: Commented set_environment_command (a little).
-
- * createtags: Cleaned up and commented.
-
- * Makefile: Updated depen_memory and write_inferior_memory in that errno is
- checked after each ptrace and returned to the caller. Used in
- value_at to detect references to addresses which are out of
- bounds. Also core.c (xfer_core_file): return 1 if invalid
- address, 0 otherwise.
-
- * inflow.c, <machine>-infdep.c: removed all calls to ptrace from
- inflo, m-sun3.h: Cleaned up dealings with
- functions returning structu0 19:19:36 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * symmisc.c: (read_symsegs) Accept only format number 2. Since
- the size of the type structure changed when C++ support was added,
- format 1 can no longer be used.
-
- * core.c, m-sunos4.h: (core_file_command) support for SunOS 4.0.
- Slight change in the core structure. #ifdef SUNOS4. New file
- m-sunos4.h. May want to change config.gdb also.
-
-Fri Jul 8 19:59:49 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * breakpoint.c: (break_command_1) Allow `break if condition'
- rather than parsing `if' as a function name and returning an
- error.
-
-Thu Jul 7 22:22:47 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * C++: valops.c, valprint.c, value.h, values.c: merged code to deal
- with C++ expressions.
-
-Wed Jul 6 03:28:18 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * C++: dbxread.c: (read_dbx_symtab, condense_misc_bunches,
- add_file_command) Merged code to read symbol information from
- an incrementally linked file. symmisc.c:
- (init_free_inclink_symtabs, free_inclink_symtabs) Cleanup
- routines.
-
-Tue Jul 5 02:50:41 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * C++: symtab.c, breakpoint.c, source.c: Merged code to deal with
- ambiguous line specifications. In C++ one can have overloaded
- function names, so that `list classname::overloadedfuncname'
- refers to several different lines, possibly sure currently configured machine
- dependent files come first in e at corn-chex.ai.mit.edu)
-
- * C++: symtab.c: replaced lookup_symtab_1 and lookup_symtab_2 with
- a modified lookup_symbol which checks for fields of the current
- implied argument `this'. printcmd.c, source.c, symtab.c,
- valops.c: Need to change callers once callers are
- installed.
-
-Wed Jun 29 01:26:56 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu)
-
- * C++: eval.c, expprint.c, expread.y, expression.h, valarith.c,
- Merged code to deal with evaluation of user-defined operators,
- member functions, and virtual functions.
- binop_must_be_user_defined tests for user-defined binops,
- value_x_binop calls the appropriate operator function.
-
-Tue Jun 28 02:56:42 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu)
-
- * C++: Makefile: changed the echo: expect 101 shift/reduce conflicts
- and 1 reduce/reduce conflict.
-
-
-Local Variables:
-mode: indented-text
-eval: (auto-fill-mode 1)
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
-
- constructors, and flags being defined via public and via
- virtual paths. Added fields NEXT_VARIANT, N_BASECLASSES,
- and BASECLASSES to this type (tr: Changed types from
- having to be derived from a single baseclass to a multiple
- base class).
- * symtab.h: Added macros to access new fields defined in symseg.h.
- Added decl for lookup_basetype_type.
- * dbxread.c
- (condense_addl_misc_bunches): Function added to condense the misc
- function bunches added by reading in a new .o file.
- (read_addl_syms): Function added to read in symbols
- from a new .o file (incremental linking).
- (add_file_command): Command interface function to indicate
- incrmental linking of a new .o file; this now calls
- read_addl_syms and condense_addl_misc_bunches.
- (define_symbol): Modified code to handle types defined from base
- types which were not known when the derived class was
- output.
- (read_struct_type): Modified to better handle description of
- struct types as derived types. Possibly derived from
- several different base classes. Also added new code to
- mark definitions via virtual paths or via public paths.
- Killed seperate code to handle classes with destructors
- but without constructors and improved marking of classes
- as having destructors and constructors.
- * infcmd.c: Modified call to val_print (one more argument).
- * symtab.c (lookup_member_type): Modified to deal with new
- structure in symseg.h.
- (lookup_basetype_type): Function added to find or construct a type
- ?derived? from the given type.
- (decode_line_1): Modified to deal with new type data structures.
- Modified to deal with new number of args for
- decode_line_2.
- (decode_line_2): Changed number of args (?why?).
- (init_type): Added inits for new C++ fields from
- symseg.h.
- *valarith.c
- (value_x_binop, value_binop): Added cases for BINOP_MIN &
- BINOP_MAX.
- * valops.c
- (value_struct_elt, check_field, value_struct_elt_for_address):
- Changed to deal with multiple possible baseclasses.
- (value_of_this): Made SELECTED_FRAME an extern variable.
- * valprint.c
- (val_print): Added an argument DEREF_REF to dereference references
- automatically, instead of printing them like pointers.
- Changed number of arguments in recursive calls to itself.
- Changed to deal with varibale numbers of base classes.
- (value_print): Changed number of arguments to val_print. Print
- type of value also if value is a reference.
- (type_print_derivation_info): Added function to print out
- derivation info a a type.
- (type_print_base): Modified to use type_print_derivation_info and
- to handle multiple baseclasses.
-
-Mon Nov 21 10:32:07 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * inflow.c (term_status_command): Add trailing newline to output.
-
- * sparc-dep.c (do_save_insn, do_restore_insn): Saved
- "stop_registers" over the call for the sake of normal_stop and
- run_stack_dummy.
-
- * m-sparc.h (EXTRACT_RETURN_VALUE): Put in parenthesis to force
- addition of 8 to the int pointer, not the char pointer.
-
- * sparc-pinsn.c (print_addr1): Believe that I have gotten the
- syntax right for loads and stores as adb does it.
-
- * symtab.c (list_symbols): Turned search for match on rexegp into
- a single loop.
-
- * dbxread.c (psymtab_to_symtab): Don't read it in if it's already
- been read in.
-
- * dbxread.c (psymtab_to_symtab): Changed error to fatal in
- psymtab_to_symtab.
-
- * expread.y (parse_number): Fixed bug which treated 'l' at end of
- number as '0'.
-
-Fri Nov 18 13:57:33 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Was
- being foolish and using pointers into an array I could realloc.
- Converted these pointers into integers.
-
-Wed Nov 16 11:43:10 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-sparc.h (POP_FRAME): Made the new frame be PC_ADJUST of the
- old frame.
-
- * i386-pinsn.c, m-hp9k320.h, m-isi.h, m-merlin.h, m-news.h,
- m-npl.h, m-pn.h, m-sparc.h, m-sun2.h, m-sun3.h, m-umax.h, m-vax.h:
- Modified POP_FRAME to use the current frame instead of
- read_register (FP_REGNUM) and to flush_cached_frames before
- setting the current frame. Also added a call to set the current
- frame in those POP_FRAMEs that didn't have it.
-
- * infrun.c (wait_for_inferior): Moved call to set_current_frame up
- to guarrantee that the current frame will always be set when a
- POP_FRAME is done.
-
- * infrun.c (normal_stop): Added something to reset the pc of the
- current frame (was incorrect because of DECR_PC_AFTER_BREAK).
-
- * valprint.c (val_print): Changed to check to see if a string was
- out of bounds when being printed and to indicate this if so.
-
- * convex-dep.c (read_inferior_memory): Changed to return the value
- of errno if the call failed (which will be 0 if the call
- suceeded).
-
-Tue Nov 15 10:17:15 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * infrun.c (wait_for_inferior): Two changes: 1) Added code to
- not trigger the step breakpoint on recursive calls to functions
- without frame info, and 2) Added calls to distinguish recursive
- calls within a function without a frame (which next/nexti might
- wish to step over) from jumps to the beginning of a function
- (which it generally doesn't).
-
- * m-sparc.h (INIT_EXTRA_FRAME_INFO): Bottom set correctly for leaf
- parents.
-
- * blockframe.c (get_prev_frame_cache_item): Put in mod to check
- for a leaf node (by presence or lack of function prologue). If
- there is a leaf node, it is assumed that SAVED_PC_AFTER_CALL is
- valid. Otherwise, FRAME_SAVED_PC or read_pc is used.
-
- * blockframe.c, frame.h: Did final deletion of unused routines and
- commented problems with getting a pointer into the frame cache in
- the frame_info structure comment.
-
- * blockframe.c, frame.h, stack.c: Killed use of
- frame_id_from_frame_info; used frame_id_from_addr instead.
-
- * blockframe.c, frame.h, stack.c, others (oops): Combined stack
- cache and frame info structures.
-
- * blockframe.c, sparc-dep.c, stack.c: Created the function
- create_new_frame and used it in place of bad calls to
- frame_id_from_addr.
-
- * blockframe.c, inflow.c, infrun.c, i386-pinsn.c, m-hp9k320.h,
- m-npl.h, m-pn.h, m-sparc.h, m-sun3.h, m-vax.h, default-dep.c,
- convex-dep.c, gould-dep.c, hp9k320-dep.c, news-dep.c, sparc-dep.c,
- sun3-dep.c, umax-dep.c: Killed use of
- set_current_Frame_by_address. Used set_current_frame
- (create_new_frame...) instead.
-
- * frame.h: Killed use of FRAME_FP_ID.
-
- * infrun.c, blockframe.c: Killed select_frame_by_address. Used
- select_frame (get_current_frame (), 0) (which was correct in all
- cases that we need to worry about.
-
-Mon Nov 14 14:19:32 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * frame.h, blockframe.c, stack.c, m-sparc.h, sparc-dep.c: Added
- mechanisms to deal with possible specification of frames
- dyadically.
-
-Sun Nov 13 16:03:32 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
-
- * ns32k-opcode.h: Add insns acbw, acbd.
-
-Sun Nov 13 15:09:58 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * breakpoint.c: Changed breakpoint structure to use the address of
- a given frame (constant across inferior runs) as the criteria for
- stopping instead of the frame ident (which varies across inferior
- calls).
-
-Fri Nov 11 13:00:22 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * gld-pinsn.c (findframe): Modified to work with the new frame
- id's. Actually, it looks as if this routine should be called with
- an address anyway.
-
- * findvar.c (find_saved_register): Altered bactrace loop to work
- off of frames and not frame infos.
-
- * frame.h, blockframe.c, stack.c, sparc-dep.c, m-sparc.h: Changed
- FRAME from being the address of the frame to being a simple ident
- which is an index into the frame_cache_item list.
- * convex-dep.c, default-dep.c, gould-dep.c, hp9k320-dep.c,
- i386-pinsn.c, inflow.c, infrun.c, news-dep.c, sparc-dep.c,
- sun3-dep.c, umax-dep.c, m-hp9k320.h, m-npl.h, m-pn.h, m-sparc.h,
- m-sun3.h, m-vax.h: Changed calls of the form set_current_frame
- (read_register (FP_REGNUM)) to set_current_frame_by_address (...).
-
-Thu Nov 10 16:57:57 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * frame.h, blockframe.c, gld-pinsn.c, sparc-dep.c, stack.c,
- infrun.c, findvar.c, m-sparc.h: Changed the FRAME type to be
- purely an identifier, using FRAME_FP and FRAME_FP_ID to convert
- back and forth between the two. The identifier is *currently*
- still the frame pointer value for that frame.
-
-Wed Nov 9 17:28:14 1988 Chris Hanson (cph at kleph)
-
- * m-hp9k320.h (FP_REGISTER_ADDR): Redefine this to return
- difference between address of given FP register, and beginning of
- `struct user' that it occurs in.
-
- * hp9k320-dep.c (core_file_command): Fix sign error in size
- argument to myread. Change buffer argument to pointer; was
- copying entire structure.
- (fetch_inferior_registers, store_inferior_registers): Replace
- occurrences of `FP_REGISTER_ADDR_DIFF' with `FP_REGISTER_ADDR'.
- Flush former definition.
-
-Wed Nov 9 12:11:37 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * xgdb.c: Killed include of initialize.h.
-
- * Pulled in xgdb.c from the net.
-
- * Checkpointed distribution (to provide to 3b2 guy).
-
- * coffread.c, dbxread.c, symmisc.c, symtab.c, symseg.h: Changed
- format of table of line number--pc mapping information. Can
- handle negative pc's now.
-
- * command.c: Deleted local copy of savestring; code in utils.c is
- identical.
-
-Tue Nov 8 11:12:16 1988 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * gdb.texinfo: Added documentation for shell escape.
-
-Mon Nov 7 12:27:16 1988 Randall Smith (randy at sugar-bombs.ai.mit.edu)
-
- * command.c: Added commands for shell escape.
-
- * core.c, dbxread.c: Added ROBOTUSSIN mods.
-
- * Checkpointed distribution.
-
- * printcmd.c (x_command): Yanked error if there is no memory to
- examine (could be looking at executable straight).
-
- * sparc-pinsn.c (print_insn): Amount to leftshift sethi imm by is
- now 10 (matches adb in output).
-
- * printcmd.c (x_command): Don't attempt to set $_ & $__ if there
- is no last_examine_value (can happen if you did an x/0).
-
-Fri Nov 4 13:44:49 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * printcmd.c (x_command): Error if there is no memory to examine.
-
- * gdb.texinfo: Added "cont" to the command index.
-
- * sparc-dep.c (do_save_insn): Fixed typo in shift amount.
-
- * m68k-opcode.h: Fixed opcodes for 68881.
-
- * breakpoint.c, infcmd.c, source.c: Changed defaults in several
- places for decode_line_1 to work off of the default_breakpoint_*
- values instead of current_source_* values (the current_source_*
- values are off by 5 or so because of listing defaults).
-
- * stack.c (frame_info): ifdef'd out FRAME_SPECIFCATION_DYADIC in
- the stack.c module. If I can't do this right, I don't want to do
- it at all. Read the comment there for more info.
-
-Mon Oct 31 16:23:06 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * gdb.texinfo: Added documentation on the "until" command.
-
-Sat Oct 29 17:47:10 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * breakpoint.c, infcmd.c: Added UNTIL_COMMAND and subroutines of
- it.
-
- * breakpoint.c, infcmd.c, infrun.c: Added new field to breakpoint
- structure (silent, indicating a silent breakpoint), and modified
- breakpoint_stop_status and things that read it's return value to
- understand it.
-
-Fri Oct 28 17:45:33 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * dbxread.c, symmisc.c: Assorted speedups for readin, including
- special casing most common symbols, and doing buffering instead of
- calling malloc.
-
-Thu Oct 27 11:11:15 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * stack.c, sparc-dep.c, m-sparc.h: Modified to allow "info frame"
- to take two arguments on the sparc and do the right thing with
- them.
-
- * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Put
- stuff to put only symbols that didn't have debugging info on the
- misc functions list back in.
-
-Wed Oct 26 10:10:32 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * valprint.c (type_print_varspec_suffix): Added check for
- TYPE_LENGTH(TYPE_TARGET_TYPE(type)) > 0 to prevent divide by 0.
-
- * printcmd.c (print_formatted): Added check for VALUE_REPEATED;
- value_print needs to be called for that.
-
- * infrun.c (wait_for_inferior): Added break when you decide to
- stop on a null function prologue rather than continue stepping.
-
- * m-sun3.h: Added explanatory comment to REGISTER_RAW_SIZE.
-
- * expread.y (parse_c_1): Initialized paren_depth for each parse.
-
-Tue Oct 25 14:19:38 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * valprint.c, coffread.c, dbxread.c: Enum constant values in enum
- type now accessed through TYPE_FIELD_BITPOS.
-
- * dbxread.c (process_symbol_for_psymtab): Added code to deal with
- possible lack of a ":" in a debugging symbol (do nothing).
-
- * symtab.c (decode_line_1): Added check in case of all numbers for
- complete lack of symbols.
-
- * source.c (select_source_symtab): Made sure that this wouldn't
- bomb on complete lack of symbols.
-
-Mon Oct 24 12:28:29 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-sparc.h, findvar.c: Ditched REGISTER_SAVED_UNIQUELY and based
- code on REGISTER_IN_WINDOW_P and HAVE_REGISTER_WINDOWS. This will
- break when we find a register window machine which saves the
- window registers within the context of an inferior frame.
-
- * sparc-dep.c (frame_saved_pc): Put PC_ADJUST return back in for
- frame_saved_pc. Seems correct.
-
- * findvar.c, m-sparc.h: Created the macro REGISTER_SAVED_UNIQUELY
- to handle register window issues (ie. that find_saved_register
- wasn't checking the selected frame itself for shit).
-
- * sparc-dep.c (core_file_command): Offset target of o & g register
- bcopy by 1 to hit correct registers.
-
- * m-sparc.h: Changed STACK_END_ADDR.
-
-Sun Oct 23 19:41:51 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * sparc-dep.c (core_file_command): Added in code to get the i & l
- registers from the stack in the corefile, and blew away some wrong
- code to get i & l from inferior.
-
-Fri Oct 21 15:09:19 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu)
-
- * m-sparc.h (PUSH_DUMMY_FRAME): Saved the value of the RP register
- in the location reserved for i7 (in the created frame); this way
- the rp value won't get lost. The pc (what we put into the rp in
- this routine) gets saved seperately, so we loose no information.
-
- * sparc-dep.c (do_save_insn & do_restore_insn): Added a wrapper to
- preserve the proceed status state variables around each call to
- proceed (the current frame was getting munged because this wasn't
- being done).
-
- * m-sparc.h (FRAME_FIND_SAVED_REGS): Fix bug: saved registers
- addresses were being computed using absolute registers number,
- rather than numbers relative to each group of regs.
-
- * m-sparc.h (POP_FRAME): Fixed a bug (I hope) in the context
- within which saved reg numbers were being interpetted. The
- values to be restored were being gotten in the inferior frame, and
- the restoring was done in the superior frame. This means that i
- registers must be restored into o registers.
-
- * sparc-dep.c (do_restore_insn): Modified to take a pc as an
- argument, instead of a raw_buffer. This matches (at least it
- appears to match) usage from POP_FRAME, which is the only place
- from which do_restore_insn is called.
-
- * sparc-dep.c (do_save_insn and do_restore_insn): Added comments.
-
- * m-sparc.h (FRAME_FIND_SAVED_REGS): Modified my code to find the
- save addresses of out registers to use the in regs off the stack
- pointer when the current frame is 1 from the innermost.
-
-Thu Oct 20 13:56:15 1988 & Smith (randy at hobbes.ai.mit.edu)
-
- * blockframe.c, m-sparc.h: Removed code associated with
- GET_PREV_FRAME_FROM_CACHE_ITEM. This code was not needed for the
- sparc; you can always find the previous frames fp from the fp of
- the current frame (which is the sp of the previous). It's getting
- the information associated with a given frame (ie. saved
- registers) that's a bitch, because that stuff is saved relative to
- the stack pointer rather than the frame pointer.
-
- * m-sparc.h (GET_PREV_FRAME_FROM_CACHE_ITEM): Modified to return
- the frame pointer of the previous frame instead of the stack
- pointer of same.
-
- * blockframe.c (flush_cached_frames): Modified call to
- obstack_free to free back to frame_cache instead of back to zero.
- This leaves the obstack control structure in finite state (and
- still frees the entry allocated at frame_cache).
-
-Sat Oct 15 16:30:47 1988 & Smith (randy at tartarus.uchicago.edu)
-
- * valops.c (call_function): Suicide material here. Fixed a typo;
- CALL_DUMMY_STACK_ADJUST was spelled CAll_DUMMY_STACK_ADJUST on
- line 530 of the file. This cost me three days. I'm giving up
- typing for lent.
-
-Fri Oct 14 15:10:43 1988 & Smith (randy at tartarus.uchicago.edu)
-
- * m-sparc.h: Corrected a minor mistake in the dummy frame code
- that was getting the 5th argument and the first argument from the
- same place.
-
-Tue Oct 11 11:49:33 1988 & Smith (randy at tartarus.uchicago.edu)
-
- * infrun.c: Made stop_after_trap and stop_after_attach extern
- instead of static so that code which used proceed from machine
- dependent files could fiddle with them.
-
- * blockframe.c, frame.h, sparc-dep.c, m-sparc.h: Changed sense of
- ->prev and ->next in struct frame_cache_item to fit usage in rest
- of gdb (oops).
-
-Mon Oct 10 15:32:42 1988 Randy Smith (randy at gargoyle.uchicago.edu)
-
- * m-sparc.h, sparc-dep.c, blockframe.c, frame.h: Wrote
- get_frame_cache_item. Modified FRAME_SAVED_PC and frame_saved_pc
- to take only one argument and do the correct thing with it. Added
- the two macros I recently defined in blockframe.c to m-sparc.h.
- Have yet to compile this thing on a sparc, but I've now merged in
- everything that I received from tiemann, either exactly, or simply
- effectively.
-
- * source.c: Added code to allocated space to sals.sals in the case
- where no line was specified.
-
- * blockframe.c, infrun.c: Modified to cache stack frames requested
- to minimize accesses to subprocess.
-
-Tue Oct 4 15:10:39 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu)
-
- * config.gdb: Added sparc.
-
-Mon Oct 3 23:01:22 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu)
-
- * Makefile, blockframe.c, command.c, core.c, dbxread.c, defs.h,
- expread.y, findvar.c, infcmd.c, inflow.c, infrun.c, sparc-pinsn.c,
- m-sparc.h, sparc-def.c, printcmd.c, stack.c, symmisc.c, symseg.h,
- valops.c, values.c: Did initial merge of sparc port. This will
- not compile; have to do stack frame caching and finish port.
-
- * inflow.c, gdb.texinfo: `tty' now resets the controling terminal.
-
-Fri Sep 30 11:31:16 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * inferior.h, infcmd.c, infrun.c: Changed the variable
- stop_random_signal to stopped_by_random signal to fit in better
- with name conventions (variable is not a direction to the
- proceed/resume set; it is information from it).
-
-Thu Sep 29 13:30:46 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu)
-
- * infcmd.c (finish_command): Value type of return value is now
- whatever the function returns, not the type of the function (fixed
- a bug in printing said value).
-
- * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab):
- Put *all* global symbols into misc_functions. This is what was
- happening anyway, and we need it for find_pc_misc_function.
-
- ** This was eventually taken out, but I didn't mark it in the
- ChangeLog. Oops.
-
- * dbxread.c (process_symbol_for_psymtab): Put every debugger
- symbol which survives the top case except for constants on the
- symchain. This means that all of these *won't* show up in misc
- functions (this will be fixed once I make sure it's broken the way
- it's supposed to be).
-
- * dbxread.c: Modified placement of debugger globals onto the hash
- list; now we exclude the stuff after the colon and don't skip the
- first character (debugger symbols don't have underscores).
-
- * dbxread.c: Killed debuginfo stuff with ifdef's.
-
-Wed Sep 28 14:31:51 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu)
-
- * symtab.h, dbxread.c: Modified to deal with BINCL, EINCL, and
- EXCL symbols produced by the sun loader by adding a list of
- pre-requisite partial_symtabs that each partial symtab needs.
-
- * symtab.h, dbxread.c, symtab.c, symmisc.c: Modified to avoid
- doing a qsort on the local (static) psymbols for each file to
- speed startup. This feature is not completely debugged, but it's
- inclusion has forced the inclusion of another feature (dealing
- with EINCL's, BINCL's and EXCL's) and so I'm going to go in and
- deal with them.
-
- * dbxread.c (process_symbol_for_psymtab): Made sure that the class
- of the symbol made it into the partial_symbol entry.
-
-Tue Sep 27 15:10:26 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * dbxread.c: Fixed bug; init_psymbol_list was not being called
- with the right number of arguments (1).
-
- * dbxread.c: Put ifdef's around N_MAIN, N_M2C, and N_SCOPE to
- allow compilation on a microvax.
-
- * config.gdb: Modified so that "config.gdb vax" would work.
-
- * dbxread.c, symtab.h, symmisc.h, symtab.c, source.c: Put in many
- and varied hacks to speed up gdb startup including: A complete
- rewrite of read_dbx_symtab, a modification of the partial_symtab
- data type, deletion of select_source_symtab from
- symbol_file_command, and optimiztion of the call to strcmp in
- compare_psymbols.
-
-Thu Sep 22 11:08:54 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * dbxread.c (psymtab_to_symtab): Removed call to
- init_misc_functions.
-
- * dbxread.c: Fixed enumeration type clash (used enum instead of
- integer constant).
-
- * breakpoint.c: Fixed typo; lack of \ at end of line in middle of
- string constant.
-
- * symseg.h: Fixed typo; lack of semicolon after structure
- definition.
-
- * command.c, breakpoint.c, printcmd.c: Added cmdlist editing
- functions to add commands with the abbrev flag set. Changed
- help_cmd_list to recognize this flag and modified unset,
- undisplay, and enable, disable, and delete breakpoints to have
- this flag set.
-
-Wed Sep 21 13:34:19 1988 Randall Smith (randy at plantaris.ai.mit.edu)
-
- * breakpoint.c, infcmd.c, gdb.texinfo: Created "unset" as an alias
- for delete, and changed "unset-environment" to be the
- "environment" subcommand of "delete".
-
- * gdb.texinfo, valprint.c: Added documentation in the manual for
- breaking the set-* commands into subcommands of set. Changed "set
- maximum" to "set array-max".
-
- * main.c, printcmd.c, breakpoint.c: Moved the declaration of
- command lists into main and setup a function in main initializing
- them to guarrantee that they would be initialized before calling
- any of the individual files initialize routines.
-
- * command.c (lookup_cmd): A null string subcommand is treated as
- an unknown subcommand rather than an ambiguous one (eg. "set $x =
- 1" will now work).
-
- * infrun.c (wait_for_inferior): Put in ifdef for Sony News in
- check for trap by INNER_THAN macro.
-
- * eval.c (evaluate_subexp): Put in catch to keep the user from
- attempting to call a non function as a function.
-
-Tue Sep 20 10:35:53 1988 Randall Smith (randy at oatmeal.ai.mit.edu)
-
- * dbxread.c (read_dbx_symtab): Installed code to keep track of
- which global symbols did not have debugger symbols refering to
- them, and recording these via record_misc_function.
-
- * dbxread.c: Killed code to check for extra global symbols in the
- debugger symbol table.
-
- * printcmd.c, breakpoint.c: Modified help entries for several
- commands to make sure that abbreviations were clearly marked and
- that the right commands showed up in the help listings.
-
- * main.c, command.c, breakpoint.c, infcmd.c, printcmd.c,
- valprint.c, defs.h: Modified help system to allow help on a class
- name to show subcommands as well as commands and help on a command
- to show *all* subcommands of that command.
-
-Fri Sep 16 16:51:19 1988 Randall Smith (randy at gluteus.ai.mit.edu)
-
- * breakpoint.c (_initialize_breakpoint): Made "breakpoints"
- subcommands of enable, disable, and delete use class 0 (ie. they
- show up when you do a help xxx now).
-
- * infcmd.c,printcmd,c,main.c,valprint.c: Changed the set-*
- commands into subcommands of set. Created "set variable" for use
- with variables whose names might conflict with other subcommands.
-
- * blockframe.c, dbxread.c, coffread.c, expread.y, source.c:
- Fixed mostly minor (and one major one in block_for_pc) bugs
- involving checking the partial_symtab_list when a scan through the
- symtab_list fails.
-
-Wed Sep 14 12:02:05 1988 Randall Smith (randy at sugar-smacks.ai.mit.edu)
-
- * breakpoint.c, gdb.texinfo: Added enable breakpoints, disable
- breakpoints and delete breakpoints as synonyms for enable,
- disable, and delete. This seemed reasonable because of the
- immeninent arrival of watchpoints & etc.
-
- * gdb.texinfo: Added enable display, disable display, and delete
- display to manual.
-
-Tue Sep 13 16:53:56 1988 Randall Smith (randy at sugar-smacks.ai.mit.edu)
-
- * inferior.h, infrun.c, infcmd.c: Added variable
- stop_random_signal to indicate when a proceed had been stopped by
- an unexpected signal. Used this to determine (in normal_stop)
- whether the current display point should be deleted.
-
- * valops.c: Fix to value_ind to check for reference before doing a
- COERCE_ARRAY.
-
-Sun Jul 31 11:42:36 1988 Richard Stallman (rms at frosted-flakes.ai.mit.edu)
-
- * breakpoint.c (_initialize_breakpoint): Clean up doc for commands
- that can now apply also to auto-displays.
-
- * coffread.c (record_line): Corrected a spazz in editing.
- Also removed the two lines that assume line-numbers appear
- only in increasing order.
-
-Tue Jul 26 22:19:06 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * expression.h, eval.c, expprint.c, printcmd.c, valarith.c,
- valops.c, valprint.c, values.c, m-*.h: Changes for evaluating and
- displaying 64-bit `long long' integers. Each machine must define
- a LONGEST type, and a BUILTIN_TYPE_LONGEST.
-
- * symmisc.c: (print_symtab) check the status of the fopen and call
- perror_with_name if needed.
-
-Thu Jul 21 00:56:11 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * Convex: core.c: changes required by Convex's SOFF format were
- isolated in convex-dep.c.
-
-Wed Jul 20 21:26:10 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * coffread.c, core.c, expread.y, i386-pinsn.c, infcmd.c, inflow.c,
- infrun.c, m-i386.h, main.c, remote.c, source.c, valops.c:
- Improvements for the handling of the i386 and other machines
- running USG. (Several of these files just needed extra header files
- such as types.h.) utils.c: added bcopy, bcmp, bzero, getwd, list
- of signals, and queue routines for USG systems. Added vfork macro
- to i386
-
- * printcmd.c, breakpoint.c: New commands to enable/disable
- auto-displays. Also `delete display displaynumber' works like
- `undisplay displaynumber'.
-
-Tue Jul 19 02:17:18 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * coffread.c: (coff_lookup_type) Wrong portion of type_vector was
- being bzero'd after type_vector was reallocated.
-
- * printcmd.c: (delete_display) Check for a display chain before
- attempting to delete a display.
-
- * core.c, *-dep.c (*-infdep moved to *-dep): machine-dependent
- parts of core.c (core_file_command, exec_file_command) moved to
- *-dep.c.
-
-Mon Jul 18 19:45:51 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * dbxread.c: typo in read_struct_type (missing '=') was causing a
- C struct to be parsed as a C++ struct, resulting in a `invalid
- character' message.
-
-Sun Jul 17 22:27:32 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * printcmd.c, symtab.c, valops.c, expread.y: When an expression is
- read, the innermost block required to evaluate the expression is
- saved in the global variable `innermost_block'. This information
- is saved in the `block' field of an auto-display so that
- expressions with inactive variables can be skipped. `info display'
- tells the user which displays are active and which are not. New
- fn `contained_in' returns nonzero if one block is contained within
- another.
-
-Fri Jul 15 01:53:14 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * infrun.c, m-i386.h: Use macro TRAPS_EXPECTED to set number of
- traps to skip when sh execs the program. Default is 2, m-i386.h
- overrides this and sets to 4.
-
- * coffread.c, infrun.c: minor changes for the i386. May be able
- to eliminate them with more general code.
-
- * default-infdep.c: #ifdef SYSTEMV, include header file types.h.
- Also switched the order of signal.h and user.h, since System 5
- requires signal.h to come first.
-
- * core.c main.c, remote,c, source.c, inflow.c: #ifdef SYSTEMV,
- include various header files. Usually types.h and fcntl.h.
-
- * utils.c: added queue routines needed by the i386 (and other sys
- 5 machines).
-
- * sys5.c, regex.c, regex.h: new files for sys 5 systems. (The
- regex files are simply links to /gp/gnu/lib.)
-
-Thu Jul 14 01:47:14 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * config.gdb, README: Provide a list of known machines when user
- enters an invalid machine. New second arg is operating system,
- currently only used with `sunos4' or `os4'. Entry for i386 added.
-
- * news-infdep.c: new file.
-
- * m-news.h: new version which deals with new bugs in news800's OS.
-
-Tue Jul 12 19:52:16 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * Makefile, *.c, munch, config.gdb, README: New initialization
- scheme uses nm to find functions whose names begin with
- `_initialize_'. Files `initialize.h', `firstfile.c',
- `lastfile.c', `m-*init.h' no longer needed.
-
- * eval.c, symtab.c, valarith.c, valops.c, value.h, values.c: Bug
- fixes from gdb+ 2.5.4. evaluate_subexp takes a new arg, type
- expected. New fn value_virtual_fn_field.
-
-Mon Jul 11 00:48:49 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * core.c (read_memory): xfer_core_file was being called with an
- extra argument (0) by read_memory.
-
- * core.c (read_memory), *-infdep.c (read_inferior_memory),
- valops.c (value_at): read_memory and read_inferior_memory now work
- like write_memory and write_inferior_memory in that errno is
- checked after each ptrace and returned to the caller. Used in
- value_at to detect references to addresses which are out of
- bounds. Also core.c (xfer_core_file): return 1 if invalid
- address, 0 otherwise.
-
- * inflow.c, <machine>-infdep.c: removed all calls to ptrace from
- inflow.c and put them in machine-dependent files *-infdep.c.
-
-Sun Jul 10 19:19:36 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * symmisc.c: (read_symsegs) Accept only format number 2. Since
- the size of the type structure changed when C++ support was added,
- format 1 can no longer be used.
-
- * core.c, m-sunos4.h: (core_file_command) support for SunOS 4.0.
- Slight change in the core structure. #ifdef SUNOS4. New file
- m-sunos4.h. May want to change config.gdb also.
-
-Fri Jul 8 19:59:49 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * breakpoint.c: (break_command_1) Allow `break if condition'
- rather than parsing `if' as a function name and returning an
- error.
-
-Thu Jul 7 22:22:47 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * C++: valops.c, valprint.c, value.h, values.c: merged code to deal
- with C++ expressions.
-
-Wed Jul 6 03:28:18 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * C++: dbxread.c: (read_dbx_symtab, condense_misc_bunches,
- add_file_command) Merged code to read symbol information from
- an incrementally linked file. symmisc.c:
- (init_free_inclink_symtabs, free_inclink_symtabs) Cleanup
- routines.
-
-Tue Jul 5 02:50:41 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * C++: symtab.c, breakpoint.c, source.c: Merged code to deal with
- ambiguous line specifications. In C++ one can have overloaded
- function names, so that `list classname::overloadedfuncname'
- refers to several different lines, possibly in different files.
-
-Fri Jul 1 02:44:20 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu)
-
- * C++: symtab.c: replaced lookup_symtab_1 and lookup_symtab_2 with
- a modified lookup_symbol which checks for fields of the current
- implied argument `this'. printcmd.c, source.c, symtab.c,
- valops.c: Need to change callers once callers are
- installed.
-
-Wed Jun 29 01:26:56 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu)
-
- * C++: eval.c, expprint.c, expread.y, expression.h, valarith.c,
- Merged code to deal with evaluation of user-defined operators,
- member functions, and virtual functions.
- binop_must_be_user_defined tests for user-defined binops,
- value_x_binop calls the appropriate operator function.
-
-Tue Jun 28 02:56:42 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu)
-
- * C++: Makefile: changed the echo: expect 101 shift/reduce conflicts
- and 1 reduce/reduce conflict.
-
-Local Variables:
-mode: indented-text
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/gdb/Convex.notes b/gdb/Convex.notes
deleted file mode 100644
index 28d336b..0000000
--- a/gdb/Convex.notes
+++ /dev/null
@@ -1,163 +0,0 @@
-
-@node Convex,,, Top
-@appendix Convex-specific info
-@cindex Convex notes
-
-Scalar registers are 64 bits long, which is a pain since
-left half of an S register frequently contains noise.
-Therefore there are two ways to obtain the value of an S register.
-
-@table @kbd
-@item $s0
-returns the low half of the register as an int
-
-@item $S0
-returns the whole register as a long long
-@end table
-
-You can print the value in floating point by using @samp{p/f $s0} or @samp{p/f $S0}
-to print a single or double precision value.
-
-@cindex vector registers
-Vector registers are handled similarly, with @samp{$V0} denoting the whole
-64-bit register and @kbd{$v0} denoting the 32-bit low half; @samp{p/f $v0}
-or @samp{p/f $V0} can be used to examine the register in floating point.
-The length of the vector registers is taken from @samp{$vl}.
-
-Individual elements of a vector register are denoted in the obvious way;
-@samp{print $v3[9]} prints the tenth element of register @kbd{v3}, and
-@samp{set $v3[9] = 1234} alters it.
-
-@kbd{$vl} and @kbd{$vs} are int, and @kbd{$vm} is an int vector.
-Elements of @kbd{$vm} can't be assigned to.
-
-@cindex communication registers
-@kindex info comm-registers
-Communication registers have names @kbd{$C0 .. $C63}, with @kbd{$c0 .. $c63}
-denoting the low-order halves. @samp{info comm-registers} will print them
-all out, and tell which are locked. (A communication register is
-locked when a value is sent to it, and unlocked when the value is
-received.) Communication registers are, of course, global to all
-threads, so it does not matter what the currently selected thread is.
-@samp{info comm-reg @var{name}} prints just that one communication
-register; @samp{name} may also be a communication register number
-@samp{nn} or @samp{0xnn}.
-@samp{info comm-reg @var{address}} prints the contents of the resource
-structure at that address.
-
-@kindex info psw
-The command @samp{info psw} prints the processor status word @kbd{$ps}
-bit by bit.
-
-@kindex set base
-GDB normally prints all integers in base 10, but the leading
-@kbd{0x80000000} of pointers is intolerable in decimal, so the default
-output radix has been changed to try to print addresses appropriately.
-The @samp{set base} command can be used to change this.
-
-@table @code
-@item set base 10
-Integer values always print in decimal.
-
-@item set base 16
-Integer values always print in hex.
-
-@item set base
-Go back to the initial state, which prints integer values in hex if they
-look like pointers (specifically, if they start with 0x8 or 0xf in the
-stack), otherwise in decimal.
-@end table
-
-@kindex set pipeline
-When an exception such as a bus error or overflow happens, usually the PC
-is several instructions ahead by the time the exception is detected.
-The @samp{set pipe} command will disable this.
-
-@table @code
-@item set pipeline off
-Forces serial execution of instructions; no vector chaining and no
-scalar instruction overlap. With this, exceptions are detected with
-the PC pointing to the instruction after the one in error.
-
-@item set pipeline on
-Returns to normal, fast, execution. This is the default.
-@end table
-
-@cindex parallel
-In a parallel program, multiple threads may be executing, each
-with its own registers, stack, and local memory. When one of them
-hits a breakpoint, that thread is selected. Other threads do
-not run while the thread is in the breakpoint.
-
-@kindex 1cont
-The selected thread can be single-stepped, given signals, and so
-on. Any other threads remain stopped. When a @samp{cont} command is given,
-all threads are resumed. To resume just the selected thread, use
-the command @samp{1cont}.
-
-@kindex thread
-The @samp{thread} command will show the active threads and the
-instruction they are about to execute. The selected thread is marked
-with an asterisk. The command @samp{thread @var{n}} will select thread @var{n},
-shifting the debugger's attention to it for single-stepping,
-registers, local memory, and so on.
-
-@kindex info threads
-The @samp{info threads} command will show what threads, if any, have
-invisibly hit breakpoints or signals and are waiting to be noticed.
-
-@kindex set parallel
-The @samp{set parallel} command controls how many threads can be active.
-
-@table @code
-@item set parallel off
-One thread. Requests by the program that other threads join in
-(spawn and pfork instructions) do not cause other threads to start up.
-This does the same thing as the @samp{limit concurrency 1} command.
-
-@item set parallel fixed
-All CPUs are assigned to your program whenever it runs. When it
-executes a pfork or spawn instruction, it begins parallel execution
-immediately. This does the same thing as the @samp{mpa -f} command.
-
-@item set parallel on
-One or more threads. Spawn and pfork cause CPUs to join in when and if
-they are free. This is the default. It is very good for system
-throughput, but not very good for finding bugs in parallel code. If you
-suspect a bug in parallel code, you probably want @samp{set parallel fixed.}
-@end table
-
-@subsection Limitations
-
-WARNING: Convex GDB evaluates expressions in long long, because S
-registers are 64 bits long. However, GDB expression semantics are not
-exactly C semantics. This is a bug, strictly speaking, but it's not one I
-know how to fix. If @samp{x} is a program variable of type int, then it
-is also type int to GDB, but @samp{x + 1} is long long, as is @samp{x + y}
-or any other expression requiring computation. So is the expression
-@samp{1}, or any other constant. You only really have to watch out for
-calls. The innocuous expression @samp{list_node (0x80001234)} has an
-argument of type long long. You must explicitly cast it to int.
-
-It is not possible to continue after an uncaught fatal signal by using
-@samp{signal 0}, @samp{return}, @samp{jump}, or anything else. The difficulty is with
-Unix, not GDB.
-
-I have made no big effort to make such things as single-stepping a
-@kbd{join} instruction do something reasonable. If the program seems to
-hang when doing this, type @kbd{ctrl-c} and @samp{cont}, or use
-@samp{thread} to shift to a live thread. Single-stepping a @kbd{spawn}
-instruction apparently causes new threads to be born with their T bit set;
-this is not handled gracefully. When a thread has hit a breakpoint, other
-threads may have invisibly hit the breakpoint in the background; if you
-clear the breakpoint gdb will be surprised when threads seem to continue
-to stop at it. All of these situations produce spurious signal 5 traps;
-if this happens, just type @samp{cont}. If it becomes a nuisance, use
-@samp{handle 5 nostop}. (It will ask if you are sure. You are.)
-
-There is no way in GDB to store a float in a register, as with
-@kbd{set $s0 = 3.1416}. The identifier @kbd{$s0} denotes an integer,
-and like any C expression which assigns to an integer variable, the
-right-hand side is casted to type int. If you should need to do
-something like this, you can assign the value to @kbd{@{float@} ($sp-4)}
-and then do @kbd{set $s0 = $sp[-4]}. Same deal with @kbd{set $v0[69] = 6.9}.
diff --git a/gdb/Makefile b/gdb/Makefile
deleted file mode 100755
index 1bec69d..0000000
--- a/gdb/Makefile
+++ /dev/null
@@ -1,963 +0,0 @@
-M_MAKEFILE=./tconfig/none ./xconfig/none
-srcdir=.
-# "no target".
-# This can be used to build you a Makefile that only runs administrative
-# commands like 'clean', 'gdb.tar.Z', etc.
-# Target config file for "no target". This can be used to build you
-# a Makefile that only runs administrative commands like 'clean',
-# 'gdb.tar.Z', etc.
-#
-# Copyright (C) 1990 Free Software Foundation, Inc.
-
-# This file is part of GDB.
-
-# GDB 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 1, or (at your option)
-# any later version.
-
-# GDB 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 GDB; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-ALLDEPFILES = $(ALLDEPFILES_MAINDIR) $(ALLDEPFILES_SUBDIR)
-ALLDEPFILES_MAINDIR=\
-altos-xdep.c\
-am29k-pinsn.c\
-am29k-tdep.c\
-arm-convert.s\
-arm-pinsn.c\
-arm-tdep.c\
-arm-xdep.c\
-convex-pinsn.c\
-convex-tdep.c\
-convex-xdep.c\
-coredep.c\
-exec.c\
-gould-pinsn.c\
-gould-xdep.c\
-hp300ux-xdep.c\
-i386-pinsn.c\
-i386-tdep.c\
-i386-xdep.c\
-i960-pinsn.c\
-i960-tdep.c\
-infptrace.c\
-m68k-pinsn.c\
-m68k-tdep.c\
-m88k-pinsn.c\
-m88k-tdep.c\
-m88k-xdep.c\
-mips-pinsn.c\
-mips-tdep.c\
-mips-xdep.c\
-mipsread.c\
-news-xdep.c\
-nindy-tdep.c\
-ns32k-pinsn.c\
-pyr-pinsn.c\
-pyr-tdep.c\
-pyr-xdep.c\
-remote-eb.c\
-remote-nindy.c\
-remote-vx.c\
-solib.c\
-sparc-pinsn.c\
-sparc-tdep.c\
-sparc-xdep.c\
-sun3-xdep.c\
-sun386-xdep.c\
-symm-tdep.c\
-symm-xdep.c\
-tdesc.c\
-umax-xdep.c\
-vax-pinsn.c
-
-ALLDEPFILES_SUBDIR=\
-nindy-share/Onindy.c\
-nindy-share/nindy.c\
-nindy-share/ttybreak.c\
-nindy-share/ttyflush.c\
-vx-share/xdr_ld.c\
-vx-share/xdr_ptrace.c\
-vx-share/xdr_rdb.c\
-vx-share/xdr_regs.c
-
-ALLPARAM=\
-tm-29k.h\
-tm-3b1.h\
-tm-88k.h\
-tm-altos.h\
-tm-altosgas.h\
-tm-arm.h\
-tm-bigmips.h\
-tm-convex.h\
-tm-hp300bsd.h\
-tm-hp300hpux.h\
-tm-i386v-g.h\
-tm-i386v.h\
-tm-isi.h\
-tm-merlin.h\
-tm-mips.h\
-tm-news.h\
-tm-nindy960.h\
-tm-np1.h\
-tm-pn.h\
-tm-pyr.h\
-tm-sparc.h\
-tm-sun2.h\
-tm-sun2os4.h\
-tm-sun3.h\
-tm-sun386.h\
-tm-sun3os4.h\
-tm-sun4os4.h\
-tm-symmetry.h\
-tm-umax.h\
-tm-vax.h\
-tm-vx68.h\
-tm-vx960.h\
-xm-3b1.h\
-xm-88k.h\
-xm-altos.h\
-xm-arm.h\
-xm-bigmips.h\
-xm-convex.h\
-xm-hp300bsd.h\
-xm-hp300hpux.h\
-xm-i386v.h\
-xm-i386v32.h\
-xm-isi.h\
-xm-merlin.h\
-xm-mips.h\
-xm-news.h\
-xm-news1000.h\
-xm-np1.h\
-xm-pn.h\
-xm-pyr.h\
-xm-sparc.h\
-xm-sun2.h\
-xm-sun3.h\
-xm-sun386.h\
-xm-sun3os4.h\
-xm-sun4os4.h\
-xm-symmetry.h\
-xm-umax.h\
-xm-vax.h
-
-ALLCONFIG=\
-./tconfig/3b1\
-./tconfig/CVS.adm\
-./tconfig/altos\
-./tconfig/altosgas\
-./tconfig/am29k\
-./tconfig/arm\
-./tconfig/bigmips\
-./tconfig/convex\
-./tconfig/hp300bsd\
-./tconfig/hp300hpux\
-./tconfig/i386v\
-./tconfig/i386v-g\
-./tconfig/i386v32\
-./tconfig/i386v32-g\
-./tconfig/i960\
-./tconfig/isi\
-./tconfig/littlemips\
-./tconfig/m88k\
-./tconfig/m88k.orig\
-./tconfig/merlin\
-./tconfig/news\
-./tconfig/news1000\
-./tconfig/nindy960\
-./tconfig/none\
-./tconfig/np1\
-./tconfig/pn\
-./tconfig/pyramid\
-./tconfig/sun2os3\
-./tconfig/sun2os4\
-./tconfig/sun3\
-./tconfig/sun386\
-./tconfig/sun3os3\
-./tconfig/sun3os4\
-./tconfig/sun4\
-./tconfig/sun4os3\
-./tconfig/sun4os4\
-./tconfig/symmetry\
-./tconfig/umax\
-./tconfig/vax\
-./tconfig/vxworks68\
-./tconfig/vxworks960\
-./xconfig/3b1\
-./xconfig/CVS.adm\
-./xconfig/altos\
-./xconfig/altosgas\
-./xconfig/arm\
-./xconfig/bigmips\
-./xconfig/convex\
-./xconfig/hp300bsd\
-./xconfig/hp300hpux\
-./xconfig/i386v\
-./xconfig/i386v-g\
-./xconfig/i386v32\
-./xconfig/i386v32-g\
-./xconfig/isi\
-./xconfig/littlemips\
-./xconfig/m88k\
-./xconfig/m88k.orig\
-./xconfig/merlin\
-./xconfig/news\
-./xconfig/news1000\
-./xconfig/none\
-./xconfig/np1\
-./xconfig/pn\
-./xconfig/pyramid\
-./xconfig/sun2os3\
-./xconfig/sun2os4\
-./xconfig/sun3\
-./xconfig/sun386\
-./xconfig/sun3os3\
-./xconfig/sun3os4\
-./xconfig/sun4\
-./xconfig/sun4os3\
-./xconfig/sun4os4\
-./xconfig/symmetry\
-./xconfig/umax\
-./xconfig/vax
-
-##Copyright (C) 1989-1991 Free Software Foundation, Inc.
-
-# This file is part of GDB.
-
-# GDB 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 1, or (at your option)
-# any later version.
-
-# GDB 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 GDB; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Place to install binaries.
-bindir=/usr/local/bin
-
-# System V: If you compile gdb with a compiler which uses the coff
-# encapsulation feature (this is a function of the compiler used, NOT
-# of the m-?.h file selected by config.gdb), you must make sure that
-# the GNU nm is the one that is used by munch.
-
-# If you are compiling with GCC, make sure that either 1) You use the
-# -traditional flag, or 2) You have the fixed include files where GCC
-# can reach them. Otherwise the ioctl calls in inflow.c and readline.c
-# will be incorrectly compiled. The "fixincludes" script in the gcc
-# distribution will fix your include files up.
-#CC=cc
-#CC=gcc -traditional
-GCC=gcc
-
-VPATH=$(srcdir)
-
-# It is also possible that you will need to add -I/usr/include/sys to the
-# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
-# is where it should be according to Posix).
-
-YACC=bison -y
-# YACC=yacc
-SHELL=/bin/sh
-MAKE=make
-# We need either GNU m4 or SysV m4; Berkeley/Sun don't have quite enough.
-#M4=gm4
-M4=/usr/5bin/m4
-
-# Set this up with gcc if you have gnu ld and the loader will print out
-# line numbers for undefinded refs.
-#CC-LD=gcc -static
-CC-LD=${CC}
-
-# define this to be "gmalloc.o" if you want to use the gnu malloc routine
-# (useful for debugging memory allocation problems in gdb). To use your
-# system malloc, uncomment the following two lines.
-#GNU_MALLOC =
-#MALLOC_CFLAGS = -DNO_MALLOC_CHECK
-GNU_MALLOC = gmalloc.o mcheck.o mtrace.o
-MALLOC_CFLAGS =
-
-# Where is the "include" directory? Traditionally ../include or ./include
-INCLUDE_DIR = ${srcdir}/../include
-INCLUDE_DEP = $$(INCLUDE_DIR)
-
-# Where is the source dir for the BFD library? Traditionally ../bfd or ./bfd
-# (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.)
-BFD_DIR = ${srcdir}/../bfd
-BFD_DEP = $$(BFD_DIR)
-
-# All the includes used for CFLAGS and for lint.
-# -I. for config files.
-# -I${srcdir} possibly for regex.h also.
-INCLUDE_CFLAGS = -I. -I${srcdir} -I$(INCLUDE_DIR) -I${srcdir}/vx-share
-
-# {X,T}M_CFLAGS, if defined, has system-dependent CFLAGS.
-# CFLAGS for both GDB and readline.
-GLOBAL_CFLAGS = -g ${TM_CFLAGS} ${XM_CFLAGS}
-#PROFILE_CFLAGS = -pg
-
-CFLAGS = ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MALLOC_CFLAGS} ${INCLUDE_CFLAGS}
-# None of the things in CFLAGS will do any harm, and on some systems
-# (e.g. SunOS4) it is important to use the M_CFLAGS.
-LDFLAGS = $(CFLAGS)
-
-# Where is the "-liberty" library, containing getopt and obstack?
-LIBIBERTY_DIR = ${srcdir}/../libiberty
-LIBIBERTY = ${LIBIBERTY_DIR}${subdir}/libiberty.a
-
-# Flags that describe where you can find the termcap library.
-# You may need to make other arrangements for USG.
-TERMCAP = -ltermcap
-
-# You must define REGEX and REGEX1 on USG machines.
-# If your sysyem is missing alloca(), or, more likely, it's there but
-# it doesn't work, define ALLOCA & ALLOCA1
-
-# {X,T}M_CLIBS, if defined, has system-dependent libs
-# For example, -lPW for System V to get alloca().
-# FIXME STOPGAP FOR BFD LIBRARY: BFD stuff
-CLIBS = ${TERMCAP} $(XM_CLIBS) ${TM_CLIBS} ${BFD_DIR}${subdir}/libbfd.a \
- ${LIBIBERTY}
-CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_DIR}/libbfd.a \
- ${LIBIBERTY}
-
-ADD_FILES = ${REGEX} ${ALLOCA} ${GNU_MALLOC}
-ADD_DEPS = ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
-
-VERSION = 3.95
-DIST=gdb-$(VERSION)
-
-LINT=/usr/5bin/lint
-LINTFLAGS=
-
-# Source files in the main directory.
-# Files which are included via a tconfig/* or xconfig/* file
-# should *not* be specified here; they're in "ALLDEPFILES".
-SFILES_MAINDIR = \
- blockframe.c breakpoint.c command.c core.c \
- environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
- main.c printcmd.c \
- remote.c source.c stack.c symmisc.c symtab.c symfile.c \
- utils.c valarith.c valops.c valprint.c values.c expread.y \
- signame.c cplus-dem.c mem-break.c target.c inftarg.c \
- dbxread.c coffread.c \
- ieee-float.c
-
-# Source files in subdirectories (which will be handled separately by
-# 'make gdb.tar.Z').
-# Files which are included via a tconfig/* or xconfig/* file
-# should *not* be specified here; they're in "ALLDEPFILES".
-SFILES_SUBDIR = \
- ${srcdir}/vx-share/dbgRpcLib.h \
- ${srcdir}/vx-share/ptrace.h \
- ${srcdir}/vx-share/reg.h \
- ${srcdir}/vx-share/vxTypes.h \
- ${srcdir}/vx-share/vxWorks.h \
- ${srcdir}/vx-share/wait.h \
- ${srcdir}/vx-share/xdr_ld.h \
- ${srcdir}/vx-share/xdr_ptrace.h \
- ${srcdir}/vx-share/xdr_rdb.h \
- ${srcdir}/vx-share/xdr_regs.h \
- ${srcdir}/nindy-share/Makefile \
- ${srcdir}/nindy-share/VERSION \
- ${srcdir}/nindy-share/b.out.h \
- ${srcdir}/nindy-share/block_io.h \
- ${srcdir}/nindy-share/coff.h \
- ${srcdir}/nindy-share/demux.h \
- ${srcdir}/nindy-share/env.h \
- ${srcdir}/nindy-share/stop.h \
- ${srcdir}/nindy-share/ttycntl.h
-
-# All source files that go into linking GDB, except config-specified files.
-SFILES = $(SFILES_MAINDIR) $(SFILES_SUBDIR)
-
-# All source files that lint should look at
-LINTFILES = $(SFILES) expread.tab.c init.c
-
-# Any additional files specified on these lines should also be added to
-# the OTHERS = definition below, so they go in the tar files.
-SFILES_STAND = $(SFILES) standalone.c
-SFILES_KGDB = $(SFILES) stuff.c kdb-start.c
-
-# Header files that are not named in tconfig/* or xconfig/* go here.
-HFILES= breakpoint.h command.h defs.h environ.h \
- expression.h frame.h gdbcmd.h gdbcore.h \
- getpagesize.h ieee-float.h inferior.h param-no-tm.h param.h \
- signals.h signame.h symfile.h symtab.h \
- target.h tdesc.h terminal.h tm-68k.h tm-i960.h tm-sunos.h \
- value.h
-
-OPCODES = pn-opcode.h np1-opcode.h sparc-opcode.h vax-opcode.h m68k-opcode.h \
- ns32k-opcode.h convx-opcode.h pyr-opcode.h mips-opcode.h \
- am29k-opcode.h
-
-REMOTE_EXAMPLES = rem-m68k.shar rem-multi.shar
-
-MALLOCSRC = gmalloc.c mcheck.c mtrace.c mtrace.awk \
- ansidecl.h stdlib.h gmalloc.h stddef.h
-
-POSSLIBS_MAINDIR = regex.c regex.h alloca.c $(MALLOCSRC)
-POSSLIBS = $(POSSLIBS_MAINDIR)
-
-TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
-
-# tdesc-lib cannot be named simply tdesc, because if if it were GNU make
-# would try to make it from tdesc.c.
-# tdesc-lib removed from the list due to Motorola copyrights...gnu@cygnus.com
-OTHERS = Makefile.dist depend alldeps.mak Makefile.sdir \
- createtags munch config.gdb config.status \
- ChangeLog ChangeLog-3.x \
- README TODO TAGS WHATS.NEW \
- doc \
- .gdbinit COPYING expread.tab.c stab.def \
- copying.c Projects Convex.notes copying.awk \
- saber.suppress standalone.c stuff.c kdb-start.c \
- hp-include # tests
-
-DEPFILES= ${TDEPFILES} ${XDEPFILES}
-
-SOURCES=$(SFILES) $(ALLDEPFILES)
-TAGFILES = $(SOURCES) ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS}
-TAGFILES_MAINDIR = $(SFILES_MAINDIR) $(ALLDEPFILES_MAINDIR) \
- ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS_MAINDIR}
-TARFILES = ${TAGFILES_MAINDIR} ${OTHERS} ${REMOTE_EXAMPLES}
-
-OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
- values.o eval.o valops.o valarith.o valprint.o printcmd.o \
- symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \
- command.o utils.o expread.o expprint.o environ.o version.o \
- copying.o $(DEPFILES) signame.o cplus-dem.o mem-break.o target.o \
- inftarg.o ieee-float.o putenv.o \
- dbxread.o coffread.o # mipsread.o
-
-RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
-
-TSOBS = core.o inflow.o
-
-NTSOBS = standalone.o
-
-TSSTART = /lib/crt0.o
-
-NTSSTART = kdb-start.o
-
-RL_LIB = readline/libreadline.a
-RL_LIB_DEP = $(RL_LIB)
-
-# Prevent Sun make from putting in the machine type. Setting
-# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
-.c.o:
- ${CC} -c ${CFLAGS} $<
-
-all: gdb
-
-install: gdb
- cp gdb $(bindir)/gdb.new
- mv $(bindir)/gdb.new $(bindir)/gdb
- $(M_INSTALL)
-
-init.c: $(srcdir)/munch $(MUNCH_DEFINE) $(OBS) $(TSOBS)
- $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
-
-gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB_DEP} ${CDEPS} init.o
- ${CC-LD} $(LDFLAGS) -o gdb init.o $(OBS) $(TSOBS) $(ADD_FILES) \
- ${RL_LIB} $(CLIBS)
-
-saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
- #setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS
- #load ./init.c $(SFILES)
- #unload ${srcdir}/expread.y ${srcdir}/vx-share/*.h
- #unload ${srcdir}/nindy-share/[A-Z]*
- #load ${srcdir}/expread.tab.c readline/libreadline.a
- #load copying.c version.c
- #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
- #load ${LIBIBERTY_DIR}/*.c
- #load ${BFD_DIR}/*.c
- #load -ltermcap
- ##void mcheck(a) void (*a)(); { }
- ##void mtrace() { }
-
-
-
-# This is useful when debugging GDB, because some Unix's don't let you run GDB
-# on itself without copying the executable. So "make gdb1" will make
-# gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
-# Removing gdb1 before the copy is the right thing if gdb1 is open
-# in another process.
-gdb1: gdb
- rm -f gdb1
- cp gdb gdb1
-
-# This is a remote stub which runs under unix and starts up an
-# inferior process. This is at least useful for debugging GDB's
-# remote support.
-rapp: $(RAPP_OBS)
- rm -f rapp_init.c
- ${srcdir}/munch ${RAPP_OBS} > rapp_init.c
- ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS)
-
-Makefiles= Makefile.sdir $(M_MAKEFILE) \
- ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
-
-MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \
- cat - ${Makefiles} ${srcdir}/depend >Makefile
-
-Makefile: $(Makefiles)
- $(MAKE_MAKEFILE)
-
-alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
- rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp
- for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \
- ${srcdir}/xconfig/*[0-9A-Za-z] | grep -v RCS` ; do \
- echo $$i >>allconfig.tmp; \
- awk <$$i ' \
- $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" { \
- for (i = 2; i <= NF; i++) \
- print $$i >> "alldeps.tmp" ; \
- } \
- $$1 == "TM_FILE=" || $$1 == "XM_FILE=" { \
- print $$2 >> "allparam.tmp" }' ; \
- done
- sort <alldeps.tmp | uniq | \
- sed -e 's/arm-convert.o/arm-convert.s/' \
- -e 's!^Onindy.o!nindy-share/Onindy.c!' \
- -e 's!^nindy.o!nindy-share/nindy.c!' \
- -e 's!ttybreak.o!nindy-share/ttybreak.c!' \
- -e 's!ttyflush.o!nindy-share/ttyflush.c!' \
- -e 's!xdr_ld.o!vx-share/xdr_ld.c!' \
- -e 's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \
- -e 's!xdr_rdb.o!vx-share/xdr_rdb.c!' \
- -e 's!xdr_regs.o!vx-share/xdr_regs.c!' \
- -e 's/\.o/.c/' \
- >alldeps2.tmp
- echo 'ALLDEPFILES = $$(ALLDEPFILES_MAINDIR) $$(ALLDEPFILES_SUBDIR)' \
- >>alldeps.mak;
- grep -v / alldeps2.tmp | \
- awk 'BEGIN {printf "ALLDEPFILES_MAINDIR="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- grep / alldeps2.tmp | \
- awk 'BEGIN {printf "ALLDEPFILES_SUBDIR="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- sort <allparam.tmp | uniq | awk 'BEGIN {printf "ALLPARAM="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- sort <allconfig.tmp | uniq | awk 'BEGIN {printf "ALLCONFIG="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp
-
-# The sed script makes everything which depends on {x,t}m.h depend on
-# config.status as well, in case someone reconfigures gdb out from
-# under an already compiled gdb.
-depend: $(SOURCES) Makefile.dist
- @echo Ignore errors about non-existent system-supplied include files
- @echo for systems other than the one you are using.
- @echo "If xm.h and tm.h don't exist, the error messages saying so"
- @echo can safely be ignored.
- @echo Also ignore parse errors in valops.c, and any errors in
- @echo arm-convert.s.
- -$(GCC) -MM $(CFLAGS) -I$(BFD_DIR) \
- `ls $(SOURCES) | sort -u` >depend.tmp
- <depend.tmp sed -e 's/ [xt]m.h/& config.status/g' \
- -e 's; vx-share/; $${srcdir}/vx-share/;g' \
- -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \
- -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
- -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
- -e 's; \./; $${srcdir}/;g' \
- >depend
- $(MAKE_MAKEFILE)
- rm depend.tmp
-
-config.status:
- @echo "You must configure gdb. Look at the README file for details."
- @false
-
-# These are not generated by "make depend" because they only are there
-# for some machines.
-# But these rules don't do what we want; we want to hack the foo.o: tm.h
-# dependency to do the right thing.
-tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h : tm-68k.h
-tm-hp300hpux.h tm-sun2.h tm-3b1.h : tm-68k.h
-xm-news1000.h : xm-news.h
-xm-i386-sv32.h : xm-i386.h
-tm-i386gas.h: tm-i386.h
-xm-sun4os4.h : xm-sparc.h
-tm-sun4os4.h : tm-sparc.h
-
-kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB_DEP}
- rm -f init.c
- $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
- $(CC) $(LDFLAGS) -c init.c $(CLIBS)
- ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \
- ${RL_LIB} -lc $(CLIBS)
-
-# Put the proper machine-specific files first.
-# createtags will edit the .o in DEPFILES into .c
-TAGS: ${TAGFILES}
- $(srcdir)/createtags $(TM_FILE) ${XM_FILE} $(DEPFILES) ${TAGFILES}
-tags: TAGS
-
-# FIXME: Get alldeps.mak up to date, config.gdb none, THEN make gdb.tar.Z!
-gdb.tar.Z: ${TARFILES}
- rm -f gdb.tar; rm -rf $(DIST)
- cd readline ; make readline.tar
- mkdir $(DIST)
- cd $(DIST) ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
- mkdir $(DIST)/readline
- cd $(DIST)/readline ; tar xf ../../readline/readline.tar
- mkdir $(DIST)/xconfig ${DIST}/tconfig
- cd $(DIST)/tconfig ; \
- for i in $(ALLCONFIG) ; do ln -s ../../$$i ../$$i ; done
- mkdir $(DIST)/vx-share $(DIST)/nindy-share
- cd $(DIST)/tconfig ; \
- for i in $(SFILES_SUBDIR) $(ALLDEPFILES_SUBDIR); \
- do ln -s ../../$$i ../$$i ; done
- tar chf - $(DIST) | compress >gdb.tar.Z
- rm -rf $(DIST)
-
-clean:
- rm -f ${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES}
- rm -f init.c init.o version.c
- rm -f gdb core gdb.tar gdb.tar.Z make.log
- rm -f gdb[0-9]
- rm -f gdb.dvi gdb-all*
- cd readline ; make clean
-
-distclean: clean expread.tab.c TAGS
- rm -f tm.h xm.h config.status
- rm -f y.output yacc.acts yacc.tmp
- rm -f ${TESTS} Makefile
-
-realclean: clean
- rm -f expread.tab.c TAGS
- rm -f tm.h xm.h config.status
- rm -f Makefile
-
-gdb-all.texinfo: ${srcdir}/doc/gdb.texinfo
- ${M4} $(srcdir)/doc/pretex.m4 $(srcdir)/doc/none.m4 $(srcdir)/doc/all.m4 $(srcdir)/doc/gdb.texinfo >gdb-all.texinfo
-
-gdb.dvi : gdb-all.texinfo
- tex gdb-all.texinfo
- texindex gdb-all.??
- tex gdb-all.texinfo
- mv gdb-all.dvi gdb.dvi
- rm -f gdb-all.?? gdb-all.???
-
-# This should work eventually, but we're using texinfo2, and many makeinfo's
-# can't cope with all the markup. In the meantime, we distribute the info
-# files as formatted by the elisp texinfo2 code.
-#gdb.info: gdb-all.texinfo
-# makeinfo gdb-all.texinfo
-
-# Make copying.c from COPYING
-copying.c : COPYING copying.awk
- awk -f copying.awk < COPYING > copying.c
-
-version.c : Makefile.dist
- echo 'char *version = "$(VERSION)";' >version.c
-
-${srcdir}/expread.tab.c : $(srcdir)/expread.y
- @echo 'Expect 4 shift/reduce conflict.'
- ${YACC} $(srcdir)/expread.y
- mv y.tab.c ${srcdir}/expread.tab.c
-
-expread.o : ${srcdir}/expread.tab.c defs.h param.h symtab.h \
- frame.h expression.h
- $(CC) -c ${CFLAGS} `echo ${srcdir}/expread.tab.c | sed 's,^\./,,'`
- mv expread.tab.o expread.o
-
-# dbxread, coffread, mipsread have dependencies on BFD header files.
-dbxread.o: ${srcdir}/dbxread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/dbxread.c
-
-coffread.o: ${srcdir}/coffread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/coffread.c
-
-mipsread.o: ${srcdir}/mipsread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/mipsread.c
-
-# Drag in the files that are in another directory.
-
-xdr_ld.o: ${srcdir}/vx-share/xdr_ld.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ld.c
-
-xdr_ptrace.o: ${srcdir}/vx-share/xdr_ptrace.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ptrace.c
-
-xdr_rdb.o: ${srcdir}/vx-share/xdr_rdb.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_rdb.c
-
-xdr_regs.o: ${srcdir}/vx-share/xdr_regs.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_regs.c
-
-nindy.o: ${srcdir}/nindy-share/nindy.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/nindy.c
-
-Onindy.o: ${srcdir}/nindy-share/Onindy.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/Onindy.c
-
-ttybreak.o: ${srcdir}/nindy-share/ttybreak.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttybreak.c
-
-ttyflush.o: ${srcdir}/nindy-share/ttyflush.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttyflush.c
-
-tdesc-lib/libdc.o : force_update
- cd tdesc-lib ; ${MAKE} "SYSV_DEFINE=${SYSV_DEFINE}"
-
-# In LOCAL_INCLUDES, -I${srcdir} is right if srcdir is an absolute path,
-# and -I../${srcdir} is right if it is relative (e.g. ".."), so search both.
-readline/libreadline.a : force_update
- cd readline ; ${MAKE} "SYSV=${SYSV_DEFINE}"\
- "VPATH=${srcdir}/readline:../${srcdir}/readline"\
- "LOCAL_INCLUDES=-I../ -I${srcdir}/ -I../${srcdir}/"\
- "DEBUG_FLAGS=${GLOBAL_CFLAGS}" "CC=${CC}" libreadline.a
-
-lint: $(LINTFILES)
- $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES)
-
-gdb.cxref: $(SFILES)
- cxref -I. $(SFILES) >gdb.cxref
-
-force_update :
-
-# When used with GDB, the demangler should never look for leading
-# underscores because GDB strips them off during symbol read-in. Thus
-# -Dnounderscore.
-
-cplus-dem.o : cplus-dem.c
- ${CC} -c ${CFLAGS} -Dnounderscore \
- `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'`
-altos-xdep.o : altos-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-am29k-pinsn.o : am29k-pinsn.c defs.h target.h am29k-opcode.h
-am29k-tdep.o : am29k-tdep.c defs.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h $(INCLUDE_DIR)/obstack.h frame.h param.h tm.h config.status \
- param-no-tm.h xm.h config.status value.h symtab.h inferior.h breakpoint.h
-arm-pinsn.o : arm-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- arm-opcode.h
-arm-tdep.o : arm-tdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h arm-opcode.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h
-arm-xdep.o : arm-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h arm-opcode.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h
-blockframe.o : blockframe.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- frame.h gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h value.h \
- target.h
-breakpoint.o : breakpoint.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- frame.h breakpoint.h value.h expression.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h gdbcmd.h command.h inferior.h target.h
-coffread.o : coffread.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- breakpoint.h value.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h symfile.h \
- $(BFD_DIR)/libcoff.h
-command.o : command.c defs.h command.h symtab.h value.h
-convex-pinsn.o : convex-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- symtab.h convx-opcode.h
-convex-tdep.o : convex-tdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- command.h symtab.h value.h frame.h inferior.h breakpoint.h \
- $(INCLUDE_DIR)/wait.h gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h \
- gdbcmd.h
-convex-xdep.o : convex-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- command.h symtab.h value.h frame.h inferior.h breakpoint.h \
- $(INCLUDE_DIR)/wait.h gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h \
- gdbcmd.h
-core.o : core.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h inferior.h \
- breakpoint.h value.h symtab.h command.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h target.h gdbcore.h
-coredep.o : coredep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h $(INCLUDE_DIR)/obstack.h
-cplus-dem.o : cplus-dem.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status
-dbxread.o : dbxread.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- $(INCLUDE_DIR)/a.out.gnu.h $(INCLUDE_DIR)/reloc.h $(INCLUDE_DIR)/stab.gnu.h \
- $(INCLUDE_DIR)/stab.def symtab.h breakpoint.h value.h command.h target.h \
- gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h $(BFD_DIR)/liba.out.h \
- symfile.h
-environ.o : environ.c environ.h defs.h
-eval.o : eval.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h value.h \
- expression.h target.h frame.h
-exec.o : exec.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h inferior.h \
- breakpoint.h value.h symtab.h target.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-expprint.o : expprint.c defs.h symtab.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- expression.h value.h
-findvar.o : findvar.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- frame.h value.h gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h \
- inferior.h breakpoint.h target.h
-gould-pinsn.o : gould-pinsn.c gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h $(INCLUDE_DIR)/obstack.h defs.h param.h tm.h config.status \
- param-no-tm.h xm.h config.status symtab.h frame.h np1-opcode.h
-gould-xdep.o : gould-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-hp300ux-xdep.o : hp300ux-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- frame.h inferior.h breakpoint.h value.h symtab.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h
-i386-pinsn.o : i386-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h $(INCLUDE_DIR)/obstack.h
-i386-tdep.o : i386-tdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-i386-xdep.o : i386-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-i960-pinsn.o : i960-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h
-i960-tdep.o : i960-tdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- value.h frame.h signame.h ieee-float.h
-ieee-float.o : ieee-float.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- ieee-float.h
-infcmd.o : infcmd.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h frame.h \
- inferior.h breakpoint.h value.h environ.h gdbcmd.h command.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h target.h
-inflow.o : inflow.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h command.h signals.h terminal.h \
- target.h
-infptrace.o : infptrace.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h target.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h
-infrun.o : infrun.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h frame.h \
- inferior.h breakpoint.h value.h $(INCLUDE_DIR)/wait.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h signame.h command.h terminal.h \
- target.h
-inftarg.o : inftarg.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h target.h $(INCLUDE_DIR)/wait.h \
- gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h ieee-float.h
-m68k-pinsn.o : m68k-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- m68k-opcode.h gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h
-m68k-tdep.o : m68k-tdep.c defs.h ieee-float.h
-main.o : main.c defs.h gdbcmd.h command.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- symtab.h inferior.h breakpoint.h value.h frame.h signals.h target.h
-mem-break.o : mem-break.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status
-mips-pinsn.o : mips-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- mips-opcode.h
-mips-tdep.o : mips-tdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcmd.h command.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h
-mips-xdep.o : mips-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-mipsread.o : mipsread.c param.h tm.h config.status param-no-tm.h xm.h config.status \
- $(INCLUDE_DIR)/obstack.h defs.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h symfile.h $(INCLUDE_DIR)/intel-coff.h
-news-xdep.o : news-xdep.c
-Onindy.o : ${srcdir}/nindy-share/Onindy.c ${srcdir}/nindy-share/ttycntl.h \
- ${srcdir}/nindy-share/block_io.h $(INCLUDE_DIR)/wait.h ${srcdir}/nindy-share/env.h \
- /usr/include/string.h
-nindy.o : ${srcdir}/nindy-share/nindy.c ${srcdir}/nindy-share/ttycntl.h ${srcdir}/nindy-share/block_io.h \
- $(INCLUDE_DIR)/wait.h ${srcdir}/nindy-share/env.h /usr/include/string.h
-ttybreak.o : ${srcdir}/nindy-share/ttybreak.c ${srcdir}/nindy-share/ttycntl.h
-ttyflush.o : ${srcdir}/nindy-share/ttyflush.c ${srcdir}/nindy-share/ttycntl.h
-nindy-tdep.o : nindy-tdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- frame.h
-ns32k-pinsn.o : ns32k-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- symtab.h ns32k-opcode.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-printcmd.o : printcmd.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- symtab.h value.h expression.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h gdbcmd.h command.h target.h
-pyr-pinsn.o : pyr-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- pyr-opcode.h gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h
-pyr-tdep.o : pyr-tdep.c
-pyr-xdep.o : pyr-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-remote-eb.o : remote-eb.c defs.h tm-29k.h param-no-tm.h xm.h config.status inferior.h \
- breakpoint.h value.h symtab.h frame.h param.h $(INCLUDE_DIR)/wait.h \
- terminal.h target.h
-remote-nindy.o : remote-nindy.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- frame.h inferior.h breakpoint.h value.h symtab.h target.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h command.h ieee-float.h \
- $(INCLUDE_DIR)/wait.h ${srcdir}/nindy-share/ttycntl.h ${srcdir}/nindy-share/demux.h \
- ${srcdir}/nindy-share/env.h ${srcdir}/nindy-share/stop.h
-remote-vx.o : remote-vx.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h $(INCLUDE_DIR)/wait.h target.h \
- gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h command.h symfile.h \
- ${srcdir}/vx-share/xdr_ptrace.h ${srcdir}/vx-share/xdr_regs.h ${srcdir}/vx-share/reg.h \
- ${srcdir}/vx-share/xdr_ld.h ${srcdir}/vx-share/xdr_rdb.h ${srcdir}/vx-share/dbgRpcLib.h
-remote.o : remote.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h target.h $(INCLUDE_DIR)/wait.h \
- terminal.h
-signame.o : signame.c signame.h defs.h param.h tm.h config.status param-no-tm.h xm.h config.status
-solib.o : solib.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h command.h target.h frame.h
-source.o : source.c defs.h symtab.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- command.h gdbcmd.h frame.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h regex.h
-sparc-pinsn.o : sparc-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- symtab.h sparc-opcode.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h /usr/include/string.h target.h
-sparc-tdep.o : sparc-tdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h signame.h target.h ieee-float.h \
- gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h
-sparc-xdep.o : sparc-xdep.c defs.h tm-sparc.h param-no-tm.h xm.h config.status inferior.h \
- breakpoint.h value.h symtab.h frame.h param.h target.h gdbcore.h \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h
-stack.o : stack.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h frame.h \
- gdbcmd.h command.h value.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h target.h breakpoint.h
-sun3-xdep.o : sun3-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status inferior.h \
- breakpoint.h value.h symtab.h frame.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-sun386-xdep.o : sun386-xdep.c
-symfile.o : symfile.c defs.h symtab.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h frame.h target.h \
- value.h symfile.h gdbcmd.h command.h breakpoint.h
-symm-tdep.o : symm-tdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-symm-xdep.o : symm-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-symmisc.o : symmisc.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- breakpoint.h value.h command.h
-symtab.o : symtab.c defs.h symtab.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h frame.h target.h \
- value.h symfile.h gdbcmd.h command.h
-target.o : target.c defs.h target.h gdbcmd.h command.h symtab.h inferior.h \
- breakpoint.h value.h frame.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h symfile.h
-tdesc.o : tdesc.c
-umax-xdep.o : umax-xdep.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status frame.h \
- inferior.h breakpoint.h value.h symtab.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h
-utils.o : utils.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status signals.h gdbcmd.h \
- command.h terminal.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h \
- $(INCLUDE_DIR)/obstack.h target.h
-valarith.o : valarith.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status value.h \
- symtab.h expression.h target.h
-valops.o : valops.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h value.h \
- frame.h inferior.h breakpoint.h gdbcore.h $(INCLUDE_DIR)/bfd.h \
- $(INCLUDE_DIR)/ansidecl.h target.h
-valprint.o : valprint.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- value.h gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h gdbcmd.h \
- command.h target.h
-values.o : values.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h value.h \
- gdbcore.h $(INCLUDE_DIR)/bfd.h $(INCLUDE_DIR)/ansidecl.h frame.h command.h \
- gdbcmd.h
-vax-pinsn.o : vax-pinsn.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- vax-opcode.h
-xdr_ld.o : ${srcdir}/vx-share/xdr_ld.c ${srcdir}/vx-share/vxWorks.h ${srcdir}/vx-share/vxTypes.h \
- /usr/include/rpc/rpc.h ${srcdir}/vx-share/xdr_ld.h
-xdr_ptrace.o : ${srcdir}/vx-share/xdr_ptrace.c
-xdr_rdb.o : ${srcdir}/vx-share/xdr_rdb.c ${srcdir}/vx-share/vxWorks.h ${srcdir}/vx-share/vxTypes.h \
- ${srcdir}/vx-share/xdr_rdb.h
-xdr_regs.o : ${srcdir}/vx-share/xdr_regs.c
diff --git a/gdb/Makefile.dist b/gdb/Makefile.dist
deleted file mode 100755
index 94040a5..0000000
--- a/gdb/Makefile.dist
+++ /dev/null
@@ -1,575 +0,0 @@
-##Copyright (C) 1989-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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Destination directory of the software tree build
-destdir = /usr/local
-
-# Place to install binaries in the destination tree.
-bindir=$(destdir)/bin
-
-# System V: If you compile gdb with a compiler which uses the coff
-# encapsulation feature (this is a function of the compiler used, NOT
-# of the m-?.h file selected by config.gdb), you must make sure that
-# the GNU nm is the one that is used by munch.
-
-# If you are compiling with GCC, make sure that either 1) You use the
-# -traditional flag, or 2) You have the fixed include files where GCC
-# can reach them. Otherwise the ioctl calls in inflow.c
-# will be incorrectly compiled. The "fixincludes" script in the gcc
-# distribution will fix your include files up.
-#CC=cc
-#CC=gcc -traditional
-GCC=gcc
-
-VPATH=$(srcdir)
-
-# It is also possible that you will need to add -I/usr/include/sys to the
-# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
-# is where it should be according to Posix).
-
-YACC=bison -y
-# YACC=yacc
-SHELL=/bin/sh
-MAKE=make
-
-# Documentation (gdb.dvi) needs either GNU m4 or SysV m4;
-# Berkeley/Sun don't have quite enough.
-#M4=/usr/5bin/m4
-M4=gm4
-# where to find texinfo; if you have PostScript fonts you may want to try
-# the Cygnus mods (which also have different header/footer layout)
-#TEXIDIR=${srcdir}/../texinfo/cygnus
-TEXIDIR=${srcdir}/../texinfo/fsf
-
-# Set this up with gcc if you have gnu ld and the loader will print out
-# line numbers for undefinded refs.
-#CC-LD=gcc -static
-CC-LD=${CC}
-
-# define this to be "gmalloc.o" if you want to use the gnu malloc routine
-# (useful for debugging memory allocation problems in gdb). To use your
-# system malloc, uncomment the following two lines.
-#GNU_MALLOC =
-#MALLOC_CFLAGS = -DNO_MALLOC_CHECK
-GNU_MALLOC = gmalloc.o mcheck.o mtrace.o
-MALLOC_CFLAGS =
-
-# Where is the "include" directory? Traditionally ../include or ./include
-INCLUDE_DIR = ${srcdir}/../include
-INCLUDE_DEP = $$(INCLUDE_DIR)
-
-# Where is the source dir for the BFD library? Traditionally ../bfd or ./bfd
-# (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.)
-BFD_DIR = ${srcdir}/../bfd
-BFD_DEP = $$(BFD_DIR)
-BFD_LIB = $(BFD_DIR)${subdir}/libbfd.a
-
-# Where is the source dir for the READLINE library? Traditionally in .. or .
-# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
-READLINE_DIR = ${srcdir}/../readline
-READLINE_DEP = $$(READLINE_DIR)
-RL_LIB = $(READLINE_DIR)${subdir}/libreadline.a
-
-# All the includes used for CFLAGS and for lint.
-# -I. for config files.
-# -I${srcdir} possibly for regex.h also.
-INCLUDE_CFLAGS = -I. -I${srcdir} -I$(INCLUDE_DIR) -I$(READLINE_DIR) -I${srcdir}/vx-share
-
-# {X,T}M_CFLAGS, if defined, has system-dependent CFLAGS.
-# CFLAGS for GDB
-GLOBAL_CFLAGS = -g ${TM_CFLAGS} ${XM_CFLAGS}
-#PROFILE_CFLAGS = -pg
-
-CFLAGS = ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MALLOC_CFLAGS} ${INCLUDE_CFLAGS}
-# None of the things in CFLAGS will do any harm, and on some systems
-# (e.g. SunOS4) it is important to use the M_CFLAGS.
-LDFLAGS = $(CFLAGS)
-
-# Where is the "-liberty" library, containing getopt and obstack?
-LIBIBERTY_DIR = ${srcdir}/../libiberty
-LIBIBERTY = ${LIBIBERTY_DIR}${subdir}/libiberty.a
-
-# Flags that describe where you can find the termcap library.
-# You may need to make other arrangements for USG.
-TERMCAP = -ltermcap
-
-# The xconfig file must define REGEX and REGEX1 on USG machines.
-# If your sysyem is missing alloca(), or, more likely, it's there but
-# it doesn't work, define ALLOCA & ALLOCA1 too.
-# If your system is missing putenv(), add putenv.c to XM_ADD_FILES.
-
-# Libraries and corresponding dependencies for compiling gdb.
-# {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
-# TERMCAP comes last, since readline depends on it.
-CLIBS = $(XM_CLIBS) ${TM_CLIBS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB} ${TERMCAP}
-CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB}
-
-ADD_FILES = ${REGEX} ${ALLOCA} ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES}
-ADD_DEPS = ${REGEX1} ${ALLOCA1} ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES}
-
-VERSION = 3.96
-DIST=gdb-$(VERSION)
-
-LINT=/usr/5bin/lint
-LINTFLAGS=
-
-# Source files in the main directory.
-# Files which are included via a tconfig/* or xconfig/* file
-# should *not* be specified here; they're in "ALLDEPFILES".
-SFILES_MAINDIR = \
- blockframe.c breakpoint.c command.c core.c \
- environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
- main.c printcmd.c \
- remote.c source.c stack.c symmisc.c symtab.c symfile.c \
- utils.c valarith.c valops.c valprint.c values.c expread.y \
- signame.c cplus-dem.c mem-break.c target.c inftarg.c \
- dbxread.c coffread.c \
- ieee-float.c
-
-# Source files in subdirectories (which will be handled separately by
-# 'make gdb.tar.Z').
-# Files which are included via a tconfig/* or xconfig/* file
-# should *not* be specified here; they're in "ALLDEPFILES".
-SFILES_SUBDIR = \
- ${srcdir}/vx-share/dbgRpcLib.h \
- ${srcdir}/vx-share/ptrace.h \
- ${srcdir}/vx-share/reg.h \
- ${srcdir}/vx-share/vxTypes.h \
- ${srcdir}/vx-share/vxWorks.h \
- ${srcdir}/vx-share/wait.h \
- ${srcdir}/vx-share/xdr_ld.h \
- ${srcdir}/vx-share/xdr_ptrace.h \
- ${srcdir}/vx-share/xdr_rdb.h \
- ${srcdir}/vx-share/xdr_regs.h \
- ${srcdir}/nindy-share/Makefile \
- ${srcdir}/nindy-share/VERSION \
- ${srcdir}/nindy-share/b.out.h \
- ${srcdir}/nindy-share/block_io.h \
- ${srcdir}/nindy-share/coff.h \
- ${srcdir}/nindy-share/demux.h \
- ${srcdir}/nindy-share/env.h \
- ${srcdir}/nindy-share/stop.h \
- ${srcdir}/nindy-share/ttycntl.h
-
-# All source files that go into linking GDB, except config-specified files.
-SFILES = $(SFILES_MAINDIR) $(SFILES_SUBDIR)
-
-# All source files that lint should look at
-LINTFILES = $(SFILES) expread.tab.c init.c
-
-# Documentation source files
-SFILES_DOCDIR = \
- ${srcdir}/doc/gdb.texinfo \
- ${srcdir}/doc/pretex.m4 \
- ${srcdir}/doc/none.m4 \
- ${srcdir}/doc/all.m4 \
- ${srcdir}/doc/gdb.alter-m4 \
- ${srcdir}/doc/gdb.bugs-m4 \
- ${srcdir}/doc/gdb.canned-m4 \
- ${srcdir}/doc/gdb.cmds-m4 \
- ${srcdir}/doc/gdb.ctl-m4 \
- ${srcdir}/doc/gdb.data-m4 \
- ${srcdir}/doc/gdb.emacs-m4 \
- ${srcdir}/doc/gdb.files-m4 \
- ${srcdir}/doc/gdb.gpl-m4 \
- ${srcdir}/doc/gdb.install-m4 \
- ${srcdir}/doc/gdb.inv.m-m4 \
- ${srcdir}/doc/gdb.inv.s-m4 \
- ${srcdir}/doc/gdb.invoc-m4 \
- ${srcdir}/doc/gdb.rdln-m4 \
- ${srcdir}/doc/gdb.rename-m4 \
- ${srcdir}/doc/gdb.run-m4 \
- ${srcdir}/doc/gdb.sample-m4 \
- ${srcdir}/doc/gdb.src-m4 \
- ${srcdir}/doc/gdb.stack-m4 \
- ${srcdir}/doc/gdb.stop-m4 \
- ${srcdir}/doc/gdb.symb-m4 \
- ${srcdir}/doc/gdb.tgts-m4 \
- ${srcdir}/doc/gdb.top-m4
-
-# Any additional files specified on these lines should also be added to
-# the OTHERS = definition below, so they go in the tar files.
-SFILES_STAND = $(SFILES) standalone.c
-SFILES_KGDB = $(SFILES) stuff.c kdb-start.c
-
-# Header files that are not named in tconfig/* or xconfig/* go here.
-HFILES= breakpoint.h command.h defs.h environ.h \
- expression.h frame.h gdbcmd.h gdbcore.h \
- getpagesize.h ieee-float.h inferior.h param-no-tm.h param.h \
- signals.h signame.h symfile.h symtab.h \
- target.h tdesc.h terminal.h tm-68k.h tm-i960.h tm-sunos.h \
- value.h
-
-# Header files for machine opcode tables.
-# when OPCODE_DIR changes to ../include, remove the whole $(OPCODES)
-# business, since they will be included in the separate includes tar file
-# rather than in the gdb tar file.
-OPCODE_DIR =
-OPCODES = $(OPCODE_DIR)pn-opcode.h $(OPCODE_DIR)np1-opcode.h \
- $(OPCODE_DIR)sparc-opcode.h $(OPCODE_DIR)vax-opcode.h \
- $(OPCODE_DIR)m68k-opcode.h $(OPCODE_DIR)ns32k-opcode.h \
- $(OPCODE_DIR)convx-opcode.h $(OPCODE_DIR)pyr-opcode.h \
- $(OPCODE_DIR)mips-opcode.h $(OPCODE_DIR)am29k-opcode.h \
- $(OPCODE_DIR)arm-opcode.h $(OPCODE_DIR)m88k-opcode.h \
- $(OPCODE_DIR)tahoe-opcode.h
-
-REMOTE_EXAMPLES = m68k-stub.c i386-stub.c rem-multi.shar
-
-MALLOCSRC = gmalloc.c mcheck.c mtrace.c mtrace.awk \
- ansidecl.h gmalloc.h
-
-POSSLIBS_MAINDIR = regex.c regex.h alloca.c $(MALLOCSRC)
-POSSLIBS = $(POSSLIBS_MAINDIR)
-
-TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
-
-# tdesc-lib cannot be named simply tdesc, because if it were, GNU make
-# would try to make it from tdesc.c.
-# tdesc-lib removed from the list due to Motorola copyrights...gnu@cygnus.com
-OTHERS = Makefile Makefile.dist depend alldeps.mak Makefile.sdir \
- createtags munch config.gdb config.status \
- ChangeLog ChangeLog-3.x \
- README TODO TAGS WHATS.NEW Projects \
- .gdbinit COPYING expread.tab.c \
- copying.c Convex.notes copying.awk \
- saber.suppress standalone.c stuff.c kdb-start.c \
- putenv.c
-
-# Subdirectories of gdb, which should be included in their entirety in
-# gdb-xxx.tar.Z:
-TARDIRS = doc hp-include # tests
-
-DEPFILES= ${TDEPFILES} ${XDEPFILES}
-
-SOURCES=$(SFILES) $(ALLDEPFILES)
-TAGFILES = $(SOURCES) ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS}
-TAGFILES_MAINDIR = $(SFILES_MAINDIR) $(ALLDEPFILES_MAINDIR) \
- ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS_MAINDIR}
-TARFILES = ${TAGFILES_MAINDIR} ${OTHERS} ${REMOTE_EXAMPLES}
-
-OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
- values.o eval.o valops.o valarith.o valprint.o printcmd.o \
- symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \
- command.o utils.o expread.o expprint.o environ.o version.o \
- copying.o $(DEPFILES) signame.o cplus-dem.o mem-break.o target.o \
- inftarg.o ieee-float.o putenv.o \
- dbxread.o coffread.o # mipsread.o
-
-RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
-
-TSOBS = core.o inflow.o
-
-NTSOBS = standalone.o
-
-TSSTART = /lib/crt0.o
-
-NTSSTART = kdb-start.o
-
-# Prevent Sun make from putting in the machine type. Setting
-# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
-.c.o:
- ${CC} -c ${CFLAGS} $<
-
-all: gdb
-
-install: gdb
- cp gdb $(bindir)/gdb.new
- mv $(bindir)/gdb.new $(bindir)/gdb
- $(M_INSTALL)
-
-init.c: $(srcdir)/munch $(MUNCH_DEFINE) $(OBS) $(TSOBS)
- $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
-
-gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o
- ${CC-LD} $(LDFLAGS) -o gdb init.o $(OBS) $(TSOBS) $(ADD_FILES) \
- $(CLIBS)
-
-saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
- #setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS
- #load ./init.c $(SFILES)
- #unload ${srcdir}/expread.y ${srcdir}/vx-share/*.h
- #unload ${srcdir}/nindy-share/[A-Z]*
- #load ${srcdir}/expread.tab.c
- #load copying.c version.c
- #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
- #load ${LIBIBERTY_DIR}/*.c
- #load ${BFD_DIR}/*.c
- #load ${READLINE_DIR}/*.c
- #load -ltermcap
- ##void mcheck(a) void (*a)(); { }
- ##void mtrace() { }
-
-
-
-# This is useful when debugging GDB, because some Unix's don't let you run GDB
-# on itself without copying the executable. So "make gdb1" will make
-# gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
-# Removing gdb1 before the copy is the right thing if gdb1 is open
-# in another process.
-gdb1: gdb
- rm -f gdb1
- cp gdb gdb1
-
-# This is a remote stub which runs under unix and starts up an
-# inferior process. This is at least useful for debugging GDB's
-# remote support.
-rapp: $(RAPP_OBS)
- rm -f rapp_init.c
- ${srcdir}/munch ${RAPP_OBS} > rapp_init.c
- ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS)
-
-# Support for building Makefile out of configured pieces, automatically
-# generated dependencies, etc.
-Makefiles= Makefile.sdir $(M_MAKEFILE) \
- ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist
-
-MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \
- cat - ${Makefiles} ${srcdir}/depend > Makefile
-
-Makefile: $(Makefiles)
- $(MAKE_MAKEFILE)
-
-alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
- rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp
- for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \
- ${srcdir}/xconfig/*[0-9A-Za-z] | \
- grep -v RCS | grep -v CVS.adm | grep -v SCCS` ; do \
- echo $$i >>allconfig.tmp; \
- awk <$$i ' \
- $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" { \
- for (i = 2; i <= NF; i++) \
- print $$i >> "alldeps.tmp" ; \
- } \
- $$1 == "TM_FILE=" || $$1 == "XM_FILE=" { \
- print $$2 >> "allparam.tmp" }' ; \
- done
- sort <alldeps.tmp | uniq | \
- sed -e 's/arm-convert.o/arm-convert.s/' \
- -e 's!^Onindy.o!nindy-share/Onindy.c!' \
- -e 's!^nindy.o!nindy-share/nindy.c!' \
- -e 's!ttybreak.o!nindy-share/ttybreak.c!' \
- -e 's!ttyflush.o!nindy-share/ttyflush.c!' \
- -e 's!xdr_ld.o!vx-share/xdr_ld.c!' \
- -e 's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \
- -e 's!xdr_rdb.o!vx-share/xdr_rdb.c!' \
- -e 's!xdr_regs.o!vx-share/xdr_regs.c!' \
- -e 's/\.o/.c/' \
- >alldeps2.tmp
- echo 'ALLDEPFILES = $$(ALLDEPFILES_MAINDIR) $$(ALLDEPFILES_SUBDIR)' \
- >>alldeps.mak;
- grep -v / alldeps2.tmp | \
- awk 'BEGIN {printf "ALLDEPFILES_MAINDIR="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- grep / alldeps2.tmp | \
- awk 'BEGIN {printf "ALLDEPFILES_SUBDIR="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- sort <allparam.tmp | uniq | awk 'BEGIN {printf "ALLPARAM="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- sort <allconfig.tmp | uniq | awk 'BEGIN {printf "ALLCONFIG="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp
-
-# The sed script makes everything which depends on {x,t}m.h depend on
-# config.status as well, in case someone reconfigures gdb out from
-# under an already compiled gdb.
-depend: $(SOURCES) Makefile.dist
- @echo Ignore errors about non-existent system-supplied include files
- @echo for systems other than the one you are using.
- @echo "If xm.h and tm.h don't exist, the error messages saying so"
- @echo can safely be ignored.
- @echo Also ignore parse errors in valops.c, and any errors in
- @echo arm-convert.s.
- -$(GCC) -MM $(CFLAGS) -I$(BFD_DIR) \
- `ls $(SOURCES) | grep -v \.h$$ |sort -u` >depend.tmp
- <depend.tmp sed -e 's/ [xt]m.h/& config.status/g' \
- -e 's; vx-share/; $${srcdir}/vx-share/;g' \
- -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \
- -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
- -e 's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \
- -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
- -e 's; \./; $${srcdir}/;g' \
- >depend
- $(MAKE_MAKEFILE)
- rm depend.tmp
-
-config.status:
- @echo "You must configure gdb. Look at the README file for details."
- @false
-
-# These are not generated by "make depend" because they only are there
-# for some machines.
-# But these rules don't do what we want; we want to hack the foo.o: tm.h
-# dependency to do the right thing.
-tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h : tm-68k.h
-tm-hp300hpux.h tm-sun2.h tm-3b1.h : tm-68k.h
-xm-news1000.h : xm-news.h
-xm-i386-sv32.h : xm-i386.h
-tm-i386gas.h: tm-i386.h
-xm-sun4os4.h : xm-sparc.h
-tm-sun4os4.h : tm-sparc.h
-
-kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${CDEPS}
- rm -f init.c
- $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
- $(CC) $(LDFLAGS) -c init.c $(CLIBS)
- ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \
- -lc $(CLIBS)
-
-# Put the proper machine-specific files first.
-# createtags will edit the .o in DEPFILES into .c
-TAGS: ${TAGFILES}
- $(srcdir)/createtags $(TM_FILE) ${XM_FILE} $(DEPFILES) ${TAGFILES}
-tags: TAGS
-
-# FIXME: Get alldeps.mak up to date, config.gdb none, THEN make gdb.tar.Z!
-gdb.tar.Z: ${TARFILES} ${TARDIRS}
- rm -f gdb.tar; rm -rf $(DIST)
- mkdir $(DIST)
- cd $(DIST) ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
- cd $(DIST); for i in ${TARDIRS}; do \
- (mkdir $$i; cd $$i; \
- ln -s ../../$$i/* .; \
- rm -rf SCCS CVS.adm RCS); done
- mkdir $(DIST)/xconfig ${DIST}/tconfig
- cd $(DIST)/tconfig ; \
- for i in $(ALLCONFIG) ; do ln -s ../../$$i ../$$i ; done
- mkdir $(DIST)/vx-share $(DIST)/nindy-share
- cd $(DIST)/tconfig ; \
- for i in $(SFILES_SUBDIR) $(ALLDEPFILES_SUBDIR); \
- do ln -s ../../$$i ../$$i ; done
- tar chf - $(DIST) | compress >gdb.tar.Z
- rm -rf $(DIST)
-
-clean:
- rm -f ${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES}
- rm -f init.c init.o version.c
- rm -f gdb core gdb.tar gdb.tar.Z make.log
- rm -f gdb[0-9]
- rm -f gdb.dvi rdl-apps.texinfo gdb-all*
-
-distclean: clean expread.tab.c TAGS
- rm -f tm.h xm.h config.status
- rm -f y.output yacc.acts yacc.tmp
- rm -f ${TESTS} Makefile
-
-realclean: clean
- rm -f expread.tab.c TAGS
- rm -f tm.h xm.h config.status
- rm -f Makefile
-
-rdl-apps.texinfo: ${READLINE_DIR}/inc-readline.texinfo \
- ${READLINE_DIR}/inc-history.texinfo
- echo "@include ${READLINE_DIR}/inc-readline.texinfo" >rdl-apps.texinfo
- echo "@include ${READLINE_DIR}/inc-history.texinfo" >>rdl-apps.texinfo
-
-gdb-all.texinfo: ${SFILES_DOCDIR}
- ( cd $(srcdir)/doc; \
- ${M4} pretex.m4 none.m4 all.m4 gdb.texinfo ) >gdb-all.texinfo
-
-gdb.dvi : gdb-all.texinfo rdl-apps.texinfo
- TEXINPUTS=${TEXIDIR}:$$TEXINPUTS tex gdb-all.texinfo
- texindex gdb-all.??
- TEXINPUTS=${TEXIDIR}:$$TEXINPUTS tex gdb-all.texinfo
- mv gdb-all.dvi gdb.dvi
- rm -f gdb-all.?? gdb-all.???
-
-# This should work eventually, but we're using texinfo2, and many makeinfo's
-# can't cope with all the markup. In the meantime, we distribute the info
-# files as formatted by the elisp texinfo2 code.
-#gdb.info: gdb-all.texinfo
-# makeinfo gdb-all.texinfo
-
-# Make copying.c from COPYING
-copying.c : COPYING copying.awk
- awk -f copying.awk < COPYING > copying.c
-
-version.c : Makefile.dist
- echo 'char *version = "$(VERSION)";' >version.c
-
-${srcdir}/expread.tab.c : $(srcdir)/expread.y
- @echo 'Expect 4 shift/reduce conflict.'
- ${YACC} $(srcdir)/expread.y
- mv y.tab.c ${srcdir}/expread.tab.c
-
-expread.o : ${srcdir}/expread.tab.c defs.h param.h symtab.h \
- frame.h expression.h
- $(CC) -c ${CFLAGS} `echo ${srcdir}/expread.tab.c | sed 's,^\./,,'`
- mv expread.tab.o expread.o
-
-# dbxread, coffread, mipsread have dependencies on BFD header files.
-dbxread.o: ${srcdir}/dbxread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/dbxread.c
-
-coffread.o: ${srcdir}/coffread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/coffread.c
-
-mipsread.o: ${srcdir}/mipsread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/mipsread.c
-
-# Drag in the files that are in another directory.
-
-xdr_ld.o: ${srcdir}/vx-share/xdr_ld.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ld.c
-
-xdr_ptrace.o: ${srcdir}/vx-share/xdr_ptrace.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ptrace.c
-
-xdr_rdb.o: ${srcdir}/vx-share/xdr_rdb.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_rdb.c
-
-xdr_regs.o: ${srcdir}/vx-share/xdr_regs.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_regs.c
-
-nindy.o: ${srcdir}/nindy-share/nindy.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/nindy.c
-
-Onindy.o: ${srcdir}/nindy-share/Onindy.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/Onindy.c
-
-ttybreak.o: ${srcdir}/nindy-share/ttybreak.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttybreak.c
-
-ttyflush.o: ${srcdir}/nindy-share/ttyflush.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttyflush.c
-
-tdesc-lib/libdc.o : force_update
- cd tdesc-lib ; ${MAKE} "SYSV_DEFINE=${SYSV_DEFINE}"
-
-lint: $(LINTFILES)
- $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES)
-
-gdb.cxref: $(SFILES)
- cxref -I. $(SFILES) >gdb.cxref
-
-force_update :
-
-# When used with GDB, the demangler should never look for leading
-# underscores because GDB strips them off during symbol read-in. Thus
-# -Dnounderscore.
-
-cplus-dem.o : cplus-dem.c
- ${CC} -c ${CFLAGS} -Dnounderscore \
- `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'`
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
deleted file mode 100644
index 11f577b..0000000
--- a/gdb/Makefile.in
+++ /dev/null
@@ -1,732 +0,0 @@
-##Copyright (C) 1989-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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Host and target-dependent makefile fragments come in here.
-####
-# End of host and target-dependent makefile fragments
-
-# Destination directory of the software tree build
-ddestdir = /usr/local
-
-# Place to install binaries in the destination tree.
-bindir=$(ddestdir)/bin
-
-# System V: If you compile gdb with a compiler which uses the coff
-# encapsulation feature (this is a function of the compiler used, NOT
-# of the m-?.h file selected by config.gdb), you must make sure that
-# the GNU nm is the one that is used by munch.
-
-# If you are compiling with GCC, make sure that either 1) You use the
-# -traditional flag, or 2) You have the fixed include files where GCC
-# can reach them. Otherwise the ioctl calls in inflow.c
-# will be incorrectly compiled. The "fixincludes" script in the gcc
-# distribution will fix your include files up.
-#CC=cc
-#CC=gcc -traditional
-GCC=gcc
-
-# Directory containing source files. Don't clean up the spacing,
-# this exact string is matched for by the "configure" script.
-srcdir = .
-
-# It is also possible that you will need to add -I/usr/include/sys to the
-# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
-# is where it should be according to Posix).
-
-BISON=bison -y
-BISONFLAGS=
-YACC=$(BISON) $(BISONFLAGS)
-# YACC=yacc
-SHELL=/bin/sh
-MAKE=make
-
-# Documentation (gdb.dvi) needs either GNU m4 or SysV m4;
-# Berkeley/Sun don't have quite enough.
-#M4=/usr/5bin/m4
-M4=gm4
-
-# where to find texinfo; GDB dist should include a recent one
-TEXIDIR=${srcdir}/../texinfo/fsf
-
-# where to find makeinfo, preferably one designed for texinfo-2
-MAKEINFO=makeinfo
-
-# Set this up with gcc if you have gnu ld and the loader will print out
-# line numbers for undefinded refs.
-#CC-LD=gcc -static
-CC-LD=${CC}
-
-# define this to be "gmalloc.o" if you want to use the gnu malloc routine
-# (useful for debugging memory allocation problems in gdb). To use your
-# system malloc, uncomment the following two lines.
-#GNU_MALLOC =
-#MALLOC_CFLAGS = -DNO_MALLOC_CHECK
-GNU_MALLOC = gmalloc.o mcheck.o mtrace.o
-MALLOC_CFLAGS =
-
-# Where is the "include" directory? Traditionally ../include or ./include
-INCLUDE_DIR = ${srcdir}/../include
-INCLUDE_DEP = $$(INCLUDE_DIR)
-
-# Where is the source dir for the BFD library? Traditionally ../bfd or ./bfd
-# (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.)
-BFD_DIR = ${srcdir}/../bfd
-BFD_DEP = $$(BFD_DIR)
-BFD_LIB = $(unsubdir)/../bfd${subdir}/libbfd.a
-
-# Where is the source dir for the READLINE library? Traditionally in .. or .
-# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
-READLINE_DIR = ${srcdir}/../readline
-READLINE_DEP = $$(READLINE_DIR)
-RL_LIB = $(unsubdir)/../readline${subdir}/libreadline.a
-
-# All the includes used for CFLAGS and for lint.
-# -I. for config files.
-# -I${srcdir} possibly for regex.h also.
-INCLUDE_CFLAGS = -I. -I${srcdir} -I$(INCLUDE_DIR) -I$(READLINE_DIR) -I${srcdir}/vx-share
-
-# {X,T}M_CFLAGS, if defined, has system-dependent CFLAGS.
-# CFLAGS for GDB
-MINUS_G=-g
-GLOBAL_CFLAGS = $(MINUS_G) ${TM_CFLAGS} ${XM_CFLAGS}
-#PROFILE_CFLAGS = -pg
-
-CFLAGS = ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MALLOC_CFLAGS} ${INCLUDE_CFLAGS}
-# None of the things in CFLAGS will do any harm, and on some systems
-# (e.g. SunOS4) it is important to use the M_CFLAGS.
-LDFLAGS = $(CFLAGS)
-
-# Where is the "-liberty" library, containing getopt and obstack?
-LIBIBERTY_DIR = ${srcdir}/../libiberty
-LIBIBERTY = $(unsubdir)/../libiberty${subdir}/libiberty.a
-
-# Flags that describe where you can find the termcap library.
-# You may need to make other arrangements for USG.
-TERMCAP = -ltermcap
-
-# The xconfig file must define REGEX and REGEX1 on USG machines.
-# If your sysyem is missing alloca(), or, more likely, it's there but
-# it doesn't work, define ALLOCA & ALLOCA1 too.
-# If your system is missing putenv(), add putenv.c to XM_ADD_FILES.
-
-# Libraries and corresponding dependencies for compiling gdb.
-# {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
-# TERMCAP comes after readline, since readline depends on it.
-CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${LIBIBERTY} ${XM_CLIBS} ${TM_CLIBS}
-CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB}
-
-ADD_FILES = ${REGEX} ${ALLOCA} ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES}
-ADD_DEPS = ${REGEX1} ${ALLOCA1} ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES}
-
-VERSION = 4.2.3
-DIST=gdb
-
-LINT=/usr/5bin/lint
-LINTFLAGS= -I${BFD_DIR}
-
-# Source files in the main directory.
-# Files which are included via a tconfig/* or xconfig/* file
-# should *not* be specified here; they're in "ALLDEPFILES".
-SFILES_MAINDIR = \
- blockframe.c breakpoint.c command.c core.c \
- environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
- main.c printcmd.c \
- remote.c source.c stack.c symmisc.c symtab.c symfile.c \
- utils.c valarith.c valops.c valprint.c values.c c-exp.y m2-exp.y \
- signame.c cplus-dem.c mem-break.c target.c inftarg.c \
- dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
- ieee-float.c language.c parse.c buildsym.c
-
-# Source files in subdirectories (which will be handled separately by
-# 'make gdb.tar.Z').
-# Files which are included via a tconfig/* or xconfig/* file
-# should *not* be specified here; they're in "ALLDEPFILES".
-SFILES_SUBDIR = \
- ${srcdir}/vx-share/dbgRpcLib.h \
- ${srcdir}/vx-share/ptrace.h \
- ${srcdir}/vx-share/reg.h \
- ${srcdir}/vx-share/vxTypes.h \
- ${srcdir}/vx-share/vxWorks.h \
- ${srcdir}/vx-share/wait.h \
- ${srcdir}/vx-share/xdr_ld.h \
- ${srcdir}/vx-share/xdr_ptrace.h \
- ${srcdir}/vx-share/xdr_rdb.h \
- ${srcdir}/vx-share/xdr_regs.h \
- ${srcdir}/nindy-share/b.out.h \
- ${srcdir}/nindy-share/block_io.h \
- ${srcdir}/nindy-share/coff.h \
- ${srcdir}/nindy-share/demux.h \
- ${srcdir}/nindy-share/env.h \
- ${srcdir}/nindy-share/stop.h \
- ${srcdir}/nindy-share/ttycntl.h
-
-# Non-source files in subdirs, that should go into gdb.tar.Z.
-NONSRC_SUBDIR = \
- ${srcdir}/nindy-share/Makefile \
- ${srcdir}/nindy-share/VERSION
-
-# All source files that go into linking GDB, except config-specified files.
-SFILES = $(SFILES_MAINDIR) $(SFILES_SUBDIR)
-
-# All source files that lint should look at
-LINTFILES = $(SFILES) $(YYFILES) init.c
-
-# Any additional files specified on these lines should also be added to
-# the OTHERS = definition below, so they go in the tar files.
-SFILES_STAND = $(SFILES) standalone.c
-SFILES_KGDB = $(SFILES) stuff.c kdb-start.c
-
-# Header files that are not named in tconfig/* or xconfig/* go here.
-HFILES= breakpoint.h command.h defs.h environ.h \
- expression.h frame.h gdbcmd.h gdbcore.h getpagesize.h \
- ieee-float.h inferior.h minimon.h param-no-tm.h param.h \
- signals.h signame.h symfile.h symtab.h \
- target.h tdesc.h terminal.h tm-68k.h tm-i960.h tm-sunos.h \
- language.h parser-defs.h value.h
-
-# Header files for machine opcode tables.
-# when OPCODE_DIR changes to ../include, remove the whole $(OPCODES)
-# business, since they will be included in the separate includes tar file
-# rather than in the gdb tar file.
-OPCODE_DIR =
-OPCODES = $(OPCODE_DIR)pn-opcode.h $(OPCODE_DIR)np1-opcode.h \
- $(OPCODE_DIR)sparc-opcode.h $(OPCODE_DIR)vax-opcode.h \
- $(OPCODE_DIR)m68k-opcode.h $(OPCODE_DIR)ns32k-opcode.h \
- $(OPCODE_DIR)convx-opcode.h $(OPCODE_DIR)pyr-opcode.h \
- $(OPCODE_DIR)mips-opcode.h $(OPCODE_DIR)am29k-opcode.h \
- $(OPCODE_DIR)arm-opcode.h $(OPCODE_DIR)m88k-opcode.h \
- $(OPCODE_DIR)tahoe-opcode.h
-
-REMOTE_EXAMPLES = m68k-stub.c i386-stub.c rem-multi.shar
-
-MALLOCSRC = gmalloc.c mcheck.c mtrace.c mtrace.awk \
- ansidecl.h gmalloc.h
-
-POSSLIBS_MAINDIR = regex.c regex.h alloca.c $(MALLOCSRC)
-POSSLIBS = $(POSSLIBS_MAINDIR)
-
-TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
-
-# tdesc-lib cannot be named simply tdesc, because if it were, GNU make
-# would try to make it from tdesc.c.
-OTHERS = Makefile.in depend alldeps.mak createtags munch configure.in \
- ChangeLog ChangeLog-3.x refcard.ps \
- README TODO TAGS WHATS.NEW Projects \
- .gdbinit COPYING $(YYFILES) \
- copying.c Convex.notes copying.awk \
- saber.suppress standalone.c stuff.c tdesc-lib kdb-start.c \
- putenv.c
-
-# Subdirectories of gdb, which should be included in their entirety in
-# gdb-xxx.tar.Z:
-TARDIRS = doc # tests
-
-# GDB "info" files, which should be included in their entirety
-INFOFILES = gdb.info*
-
-DEPFILES= ${TDEPFILES} ${XDEPFILES}
-
-SOURCES=$(SFILES) $(ALLDEPFILES) $(YYFILES)
-TAGFILES = $(SOURCES) ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS}
-TAGFILES_MAINDIR = $(SFILES_MAINDIR) $(ALLDEPFILES_MAINDIR) \
- ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS_MAINDIR}
-TARFILES = ${TAGFILES_MAINDIR} ${OTHERS} ${REMOTE_EXAMPLES}
-
-OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
- values.o eval.o valops.o valarith.o valprint.o printcmd.o \
- symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \
- command.o utils.o expprint.o environ.o version.o \
- copying.o $(DEPFILES) signame.o cplus-dem.o mem-break.o target.o \
- inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
- buildsym.o \
- dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o # mipsread.o
-
-RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
-
-TSOBS = core.o inflow.o
-
-NTSOBS = standalone.o
-
-TSSTART = /lib/crt0.o
-
-NTSSTART = kdb-start.o
-
-SUBDIRS = doc
-
-# For now, shortcut the "configure GDB for fewer languages" stuff.
-YYFILES = c-exp.tab.c m2-exp.tab.c
-YYOBJ = c-exp.tab.o m2-exp.tab.o
-
-# Prevent Sun make from putting in the machine type. Setting
-# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
-.c.o:
- ${CC} -c ${CFLAGS} $<
-
-all: gdb
- $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)"
-all-info: force
- $(MAKE) subdir_do DO=all-info "DODIRS=$(SUBDIRS)"
-install-info: force
- $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)"
-
-gdb.z:gdb.1
- nroff -man gdb.1 | col -b > gdb.t
- pack gdb.t ; rm -f gdb.t
- mv gdb.t.z gdb.z
-
-install: gdb gdb.z
- cp gdb $(bindir)/gdb.new
- mv $(bindir)/gdb.new $(bindir)/gdb
- $(M_INSTALL)
- $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)"
-
-init.c: $(srcdir)/munch $(OBS) $(TSOBS)
- $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
-
-gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o
- ${CC-LD} $(LDFLAGS) -o gdb init.o $(OBS) $(TSOBS) $(ADD_FILES) \
- $(CLIBS) $(LOADLIBES)
-
-saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
- #setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS
- #load ./init.c $(SFILES)
- #unload ${srcdir}/c-exp.y ${srcdir}/m2-exp.y ${srcdir}/vx-share/*.h
- #unload ${srcdir}/nindy-share/[A-Z]*
- #load c-exp.tab.c m2-exp.tab.c
- #load copying.c version.c
- #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
- #load ${LIBIBERTY_DIR}/*.c
- #load ${BFD_DIR}/*.c
- #load ${READLINE_DIR}/*.c
- #load -ltermcap
- ##void mcheck(a) void (*a)(); { }
- ##void mtrace() { }
-
-
-
-# This is useful when debugging GDB, because some Unix's don't let you run GDB
-# on itself without copying the executable. So "make gdb1" will make
-# gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
-# Removing gdb1 before the copy is the right thing if gdb1 is open
-# in another process.
-gdb1: gdb
- rm -f gdb1
- cp gdb gdb1
-
-# This is a remote stub which runs under unix and starts up an
-# inferior process. This is at least useful for debugging GDB's
-# remote support.
-rapp: $(RAPP_OBS)
- rm -f rapp_init.c
- ${srcdir}/munch ${MUNCH_DEFINE} ${RAPP_OBS} > rapp_init.c
- ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS)
-
-# Support for building Makefile out of configured pieces, automatically
-# generated dependencies, etc. alldeps.mak is a file that contains
-# "make" variable definitions for all ALLDEPFILES, ALLDEPFILES_MAINDIR,
-# ALLDEPFILES_SUBDIR, ALLPARAM, and ALLCONFIG, all cadged from the current
-# contents of the xconfig and tconfig subdirectories.
-
-alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
- rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp
- for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \
- ${srcdir}/xconfig/*[0-9A-Za-z] | \
- grep -v RCS | grep -v CVS.adm | grep -v SCCS` ; do \
- echo $$i >>allconfig.tmp; \
- awk <$$i ' \
- $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" { \
- for (i = 2; i <= NF; i++) \
- print $$i >> "alldeps.tmp" ; \
- } \
- $$1 == "TM_FILE=" || $$1 == "XM_FILE=" { \
- print $$2 >> "allparam.tmp" }' ; \
- done
- sort <alldeps.tmp | uniq | \
- sed -e 's/arm-convert.o/arm-convert.s/' \
- -e 's!^Onindy.o!nindy-share/Onindy.c!' \
- -e 's!^nindy.o!nindy-share/nindy.c!' \
- -e 's!ttybreak.o!nindy-share/ttybreak.c!' \
- -e 's!ttyflush.o!nindy-share/ttyflush.c!' \
- -e 's!xdr_ld.o!vx-share/xdr_ld.c!' \
- -e 's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \
- -e 's!xdr_rdb.o!vx-share/xdr_rdb.c!' \
- -e 's!xdr_regs.o!vx-share/xdr_regs.c!' \
- -e 's/\.o/.c/' \
- >alldeps2.tmp
- echo '# Start of "alldeps.mak" definitions' \
- >>alldeps.mak;
- echo 'ALLDEPFILES = $$(ALLDEPFILES_MAINDIR) $$(ALLDEPFILES_SUBDIR)' \
- >>alldeps.mak;
- grep -v / alldeps2.tmp | \
- awk 'BEGIN {printf "ALLDEPFILES_MAINDIR="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- grep / alldeps2.tmp | \
- awk 'BEGIN {printf "ALLDEPFILES_SUBDIR="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- sort <allparam.tmp | uniq | awk 'BEGIN {printf "ALLPARAM="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- sort <allconfig.tmp | uniq | awk 'BEGIN {printf "ALLCONFIG="} \
- NR == 0 {printf $$0;} \
- NR != 0 {printf "\\\n" $$0} \
- END {printf "\n\n"}' >>alldeps.mak;
- echo '# End of "alldeps.mak" definitions' \
- >>alldeps.mak;
- rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp
-
-# The sed script makes everything which depends on {x,t}m.h depend on
-# config.status as well, in case someone reconfigures gdb out from
-# under an already compiled gdb.
-depend: $(SOURCES) Makefile.in
- @echo Ignore errors about non-existent system-supplied include files
- @echo for systems other than the one you are using.
- @echo "If xm.h and tm.h don't exist, the error messages saying so"
- @echo can safely be ignored.
- @echo Also ignore parse errors in valops.c, and any errors in
- @echo arm-convert.s.
- -$(GCC) -MM $(CFLAGS) -I$(BFD_DIR) \
- `ls $(SOURCES) | grep -v '\.[hy]$$' |sort -u` >depend.tmp
-# If running in srcdir, translate "./foo.c" into "$srcdir/foo.c" except
-# for xm.h and tm.h. This allows the same "depend" file to be used
-# by the various subdirectories.
- if [ "${srcdir}" = "." ] ; then \
- <depend.tmp sed \
- -e 's; ./xm.h; xm.h;g' \
- -e 's; ./tm.h; tm.h;g' \
- -e 's; \./; $${srcdir}/;g' \
- -e 's; vx-share/; $${srcdir}/vx-share/;g' \
- -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \
- >depend.tm2; \
- rm depend.tmp; \
- mv depend.tm2 depend.tmp; \
- fi
- <depend.tmp sed \
- -e 's; [xt]m.h;& config.status;g' \
- -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
- -e 's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \
- -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
- -e 's; ./xm.h; xm.h config.status;g' \
- -e 's; ./tm.h; tm.h config.status;g' \
- >depend
- rm depend.tmp
-
-config.status:
- @echo "You must configure gdb. Look at the README file for details."
- @false
-
-# These are not generated by "make depend" because they only are there
-# for some machines.
-# But these rules don't do what we want; we want to hack the foo.o: tm.h
-# dependency to do the right thing.
-tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h : tm-68k.h
-tm-hp300hpux.h tm-sun2.h tm-3b1.h : tm-68k.h
-xm-news1000.h : xm-news.h
-xm-i386-sv32.h : xm-i386.h
-tm-i386gas.h: tm-i386.h
-xm-sun4os4.h : xm-sparc.h
-tm-sun4os4.h : tm-sparc.h
-
-kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${CDEPS}
- rm -f init.c
- $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
- $(CC) $(LDFLAGS) -c init.c $(CLIBS)
- ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \
- -lc $(CLIBS)
-
-# Put the proper machine-specific files first.
-# createtags will edit the .o in DEPFILES into .c
-TAGS: ${TAGFILES}
- $(srcdir)/createtags $(TM_FILE) ${XM_FILE} $(DEPFILES) ${TAGFILES}
-tags: TAGS
-
-# Making distributions of GDB and friends.
-
-# Make a directory `proto-gdb.dir' that contains an image of the GDB
-# directory of the distribution, built up with symlinks.
-make-proto-gdb.dir: force_update
- $(MAKE) $(MFLAGS) -f Makefile.in setup-to-dist
- $(MAKE) $(MFLAGS) -f Makefile make-proto-gdb-1
-
-# Make a tar file containing the GDB directory of the distribution.
-gdb.tar.Z: force_update
- $(MAKE) $(MFLAGS) -f Makefile.in setup-to-dist
- $(MAKE) $(MFLAGS) -f Makefile.in gdb-$(VERSION).tar.Z
-
-# Set up the GDB directory for distribution, by building all files that
-# are products of other files.
-setup-to-dist: force_update
- ../configure none
- rm -f alldeps.mak
- $(MAKE) $(MFLAGS) alldeps.mak
- ../configure none
- rm -f depend
- $(MAKE) $(MFLAGS) depend
- ../configure none
- (cd doc; $(MAKE) $(MFLAGS) rdl-apps.texi gdbVN.m4)
- $(MAKE) $(MFLAGS) gdb.info
- $(MAKE) $(MFLAGS) refcard.ps
-
-# Build a tar file from a proto-gdb.dir.
-gdb-$(VERSION).tar.Z: force_update
- rm -f gdb.tar gdb-$(VERSION).tar.Z
- $(MAKE) $(MFLAGS) -f Makefile make-proto-gdb-1
- ln -s proto-gdb.dir $(DIST)
- tar chf - $(DIST) | compress >gdb-$(VERSION).tar.Z
- rm -rf $(DIST) proto-gdb.dir
-
-# Build a proto-gdb.dir after GDB has been set up for distribution.
-# This stuff must be run in `Makefile', not `Makefile.in`; we use the makefile
-# built in the setup-to-dist process, since it defines things like ALLCONFIG
-# and ALLDEPFILES, that we need.
-make-proto-gdb-1: ${TARFILES} ${TARDIRS} gdb.info
- rm -rf proto-gdb.dir
- mkdir proto-gdb.dir
- cd proto-gdb.dir ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
- cd proto-gdb.dir ; ln -s ../${INFOFILES} .
- cd proto-gdb.dir ; for i in ${TARDIRS}; do \
- (mkdir $$i; cd $$i; \
- ln -s ../../$$i/* .; \
- rm -rf SCCS CVS.adm RCS); done
- mkdir proto-gdb.dir/xconfig proto-gdb.dir/tconfig
- cd proto-gdb.dir/tconfig ; \
- for i in $(ALLCONFIG) ; do ln -s ../../$$i ../$$i ; done
- mkdir proto-gdb.dir/vx-share proto-gdb.dir/nindy-share
- cd proto-gdb.dir/tconfig ; \
- for i in $(SFILES_SUBDIR) $(NONSRC_SUBDIR) $(ALLDEPFILES_SUBDIR); \
- do ln -s ../../$$i ../$$i ; done
- chmod og=u `find . -print`
-
-clean:
- rm -f ${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES}
- rm -f init.c init.o version.c
- rm -f gdb core gdb.tar gdb.tar.Z make.log
- rm -f gdb[0-9]
- $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)"
-
-distclean: clean c-exp.tab.c m2-exp.tab.c TAGS
- rm -f tm.h xm.h config.status
- rm -f y.output yacc.acts yacc.tmp
- rm -f ${TESTS} Makefile depend
- $(MAKE) subdir_do DO=distclean "DODIRS=$(SUBDIRS)"
-
-realclean: clean
- rm -f c-exp.tab.c m2-exp.tab.c TAGS
- rm -f tm.h xm.h config.status
- rm -f Makefile depend
- $(MAKE) subdir_do DO=realclean "DODIRS=$(SUBDIRS)"
-
-STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
-
-subdir_do: force
- for i in $(DODIRS); do \
- if [ -d $(unsubdir)/$$i ] ; then \
- if (cd $(unsubdir)/$$i$(subdir); \
- $(MAKE) \
- "against=$(against)" \
- "AR=$(AR)" \
- "CC=$(CC)" \
- "AR_FLAGS=$(AR_FLAGS)" \
- "RANLIB=$(RANLIB)" \
- "BISON=$(BISON)" $(DO)) ; then true ; \
- else exit 1 ; fi ; \
- else true ; fi ; \
- done
-
-# Copy the object files from a particular stage into a subdirectory.
-stage1: force
- -mkdir stage1
- -mv -f $(STAGESTUFF) stage1
- $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
-
-stage2: force
- -mkdir stage2
- -mv -f $(STAGESTUFF) stage2
- $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
-
-stage3: force
- -mkdir stage3
- -mv -f $(STAGESTUFF) stage3
- $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
-
-against=stage2
-
-comparison: force
- for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
- $(MAKE) subdir_do DO=comparison "DODIRS=$(SUBDIRS)"
-
-de-stage1: force
- - (cd stage1 ; mv -f * ..)
- - rmdir stage1
- $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
-
-de-stage2: force
- - (cd stage2 ; mv -f * ..)
- - rmdir stage2
- $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
-
-de-stage3: force
- - (cd stage3 ; mv -f * ..)
- - rmdir stage3
- $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
-
-Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
- $(SHELL) ./config.status
-
-force:
-
-# Documentation!
-# GDB QUICK REFERENCE (TeX dvi file, CM fonts)
-refcard.dvi : $(srcdir)/doc/refcard.tex
- ( cd $(srcdir)/doc; $(MAKE) refcard.dvi )
- mv $(srcdir)/doc/refcard.dvi .
-
-# GDB QUICK REFERENCE (PostScript output, common PS fonts)
-refcard.ps : $(srcdir)/doc/refcard.tex
- ( cd $(srcdir)/doc; $(MAKE) refcard.ps )
- mv $(srcdir)/doc/refcard.ps .
-
-# GDB MANUAL: TeX dvi file
-gdb.dvi : $(srcdir)/doc/gdb-all.texi $(srcdir)/doc/rdl-apps.texi
- ( cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb.dvi )
- mv $(srcdir)/doc/gdb.dvi .
-
-# GDB MANUAL: info file
-gdb.info: $(srcdir)/doc/gdb-all.texi
- ( cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb.info )
- mv $(srcdir)/doc/gdb.info* .
-
-$(srcdir)/doc/gdb-all.texi:
- (cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb-all.texi)
-$(srcdir)/doc/rdl-apps.texi:
- (cd $(srcdir)/doc; $(MAKE) rdl-apps.texi)
-
-# Make copying.c from COPYING
-copying.c: ${srcdir}/COPYING ${srcdir}/copying.awk
- awk -f ${srcdir}/copying.awk < ${srcdir}/COPYING > copying.c
-
-version.c : Makefile.in
- echo 'char *version = "$(VERSION)";' >version.c
-
-# c-exp.tab.c is generated in target dir from c-exp.y if it doesn't exist
-# in srcdir, then compiled in target dir to c-exp.tab.o.
-c-exp.tab.o: c-exp.tab.c
-c-exp.tab.c: $(srcdir)/c-exp.y
- @echo 'Expect 4 shift/reduce conflicts.'
- ${YACC} $(srcdir)/c-exp.y
- - mv y.tab.c c-exp.tab.c
-
-# m2-exp.tab.c is generated in target dir from m2-exp.y if it doesn't exist
-# in srcdir, then compiled in target dir to m2-exp.tab.o.
-m2-exp.tab.o: m2-exp.tab.c
-m2-exp.tab.c: $(srcdir)/m2-exp.y
- ${YACC} $(srcdir)/m2-exp.y
- - mv y.tab.c m2-exp.tab.c
-
-# The symbol-file readers have dependencies on BFD header files.
-dbxread.o: ${srcdir}/dbxread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/dbxread.c
-
-coffread.o: ${srcdir}/coffread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/coffread.c
-
-mipsread.o: ${srcdir}/mipsread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/mipsread.c
-
-elfread.o: ${srcdir}/elfread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/elfread.c
-
-xcoffread.o: ${srcdir}/xcoffread.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/xcoffread.c
-
-xcoffexec.o: ${srcdir}/xcoffexec.c
- ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/xcoffexec.c
-
-# Drag in the files that are in another directory.
-
-xdr_ld.o: ${srcdir}/vx-share/xdr_ld.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ld.c
-
-xdr_ptrace.o: ${srcdir}/vx-share/xdr_ptrace.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ptrace.c
-
-xdr_rdb.o: ${srcdir}/vx-share/xdr_rdb.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_rdb.c
-
-xdr_regs.o: ${srcdir}/vx-share/xdr_regs.c
- ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_regs.c
-
-nindy.o: ${srcdir}/nindy-share/nindy.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/nindy.c
-
-Onindy.o: ${srcdir}/nindy-share/Onindy.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/Onindy.c
-
-ttybreak.o: ${srcdir}/nindy-share/ttybreak.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttybreak.c
-
-ttyflush.o: ${srcdir}/nindy-share/ttyflush.c
- ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttyflush.c
-
-disasm.o: $(srcdir)/tdesc-lib/disasm.c
- $(CC) -c $(CFLAGS) $(srcdir)/tdesc-lib/disasm.c
-
-classify.o: $(srcdir)/tdesc-lib/classify.c
- $(CC) -c $(CFLAGS) $(srcdir)/tdesc-lib/classify.c
-
-fcns.o: $(srcdir)/tdesc-lib/fcns.c
- $(CC) -c $(CFLAGS) $(srcdir)/tdesc-lib/fcns.c
-
-table.o: $(TABHDRS) $(srcdir)/tdesc-lib/table.c
- $(CC) -c $(CFLAGS) $(srcdir)/tdesc-lib/table.c
-
-lint: $(LINTFILES)
- $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
- `echo ${DEPFILES} | sed 's/\.o /\.c /g'
-
-gdb.cxref: $(SFILES)
- cxref -I. $(SFILES) >gdb.cxref
-
-force_update :
-
-# When used with GDB, the demangler should never look for leading
-# underscores because GDB strips them off during symbol read-in. Thus
-# -Dnounderscore.
-
-cplus-dem.o : cplus-dem.c
- ${CC} -c ${CFLAGS} -Dnounderscore \
- `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'`
-
-# GNU Make has an annoying habit of putting *all* the Makefile variables
-# into the environment, unless you include this target as a circumvention.
-# Rumor is that this will be fixed (and this target can be removed)
-# in GNU Make 4.0.
-.NOEXPORT:
-
-# This is the end of "Makefile.in". When built into "Makefile"
-# by the configure script, two things are added below this point:
-# alldeps.mak -- defintions of all files that are used in
-# host- or target-dependent configurations
-# depend -- what .o files depend on what .c and .h files,
-# for all configurations.
-
-
diff --git a/gdb/Makefile.sdir b/gdb/Makefile.sdir
deleted file mode 100755
index b5fb6b3..0000000
--- a/gdb/Makefile.sdir
+++ /dev/null
@@ -1 +0,0 @@
-srcdir=.
diff --git a/gdb/Makefile.srcdir b/gdb/Makefile.srcdir
deleted file mode 100755
index b5fb6b3..0000000
--- a/gdb/Makefile.srcdir
+++ /dev/null
@@ -1 +0,0 @@
-srcdir=.
diff --git a/gdb/Projects b/gdb/Projects
deleted file mode 100644
index 2c215df..0000000
--- a/gdb/Projects
+++ /dev/null
@@ -1,94 +0,0 @@
-
- Suggested projects for aspiring or current GDB hackers
- ======================================================
-
- (You should probably chat with bug-gdb@cygnus.com to make sure that
- no one else is doing the project you chose).
-
-Rewrite proceed, wait_for_inferior, and normal_stop to clean them up.
-Suggestions:
-
- 1) Make each test in wait_for_inferior a seperate subroutine
- call.
- 2) Combine wait_for_inferior and normal_stop to clean up
- communication via global variables.
- 3) See if you can find some way to clean up the global
- variables that are used; possibly group them by data flow
- and information content?
-
-Work out some kind of way to allow running the inferior to be done as
-a sub-execution of, eg. breakpoint command lists. Currently running
-the inferior interupts any command list execution. This would require
-some rewriting of wait_for_inferior & friends, and hence should
-probably be done in concert with the above.
-
-Add function arguments to gdb user defined functions.
-
-Add convenience variables that refer to exec file, symbol file,
-selected frame source file, selected frame function, selected frame
-line number, etc.
-
-Add a "suspend" subcommand of the "continue" command to suspend gdb
-while continuing execution of the subprocess. Useful when you are
-debugging servers and you want to dodge out and initiate a connection
-to a server running under gdb.
-
-Work out and implement a reasonably general mechanism for multi-threaded
-processies. There are parts of one implemented in convex-dep.c, if
-you want an example.
-
-Add stab information to allow reasonable debugging of inline functions
-(possibly they should show up on a stack backtrace? With a note
-indicating that they weren't "real"?).
-
-Implement support for specifying arbitrary locations of stack frames
-(in practice, this usually requires specification of both the top and
-bottom of the stack frame (fp and sp), since you *must* retrieve the
-pc that was saved in the innermost frame).
-
-Modify the naked "until" command to step until past the current source
-line, rather than past the current pc value. This is tricky simply
-because the low level routines have no way of specifying a multi-line
-step range, and there is no way of saying "don't print stuff when we
-stop" from above (otherwise could just call step many times).
-
-Modify the handling of symbols grouped through BINCL/EINCL stabs to
-allocate a partial symtab for each BINCL/EINCL grouping. This will
-seriously decrease the size of inter-psymtab dependencies and hence
-lessen the amount that needs to be read in when a new source file is
-accessed.
-
-Do an "x/i $pc" after each stepi or nexti.
-
-Modify all of the disassemblers to use printf_filtered to get correct
-more filtering.
-
-Modify gdb to work correctly with Pascal.
-
-Rewrite macros that handle frame chaining and frameless functions.
-They should be able to tell the difference between start, main, and a
-frameless function called from main.
-
-Work out what information would need to be included in an executable
-by the compiler to allow gdb to debug functions which do not have a
-frame pointer. Modify gdb and gcc to do this.
-
-When `attached' to a program (via either OS support or remote
-debugging), gdb should arrange to catch signals which the terminal
-might send, as it is unlikely that the program will be able to notice
-them. SIGINT and SIGTSTP are obvious examples.
-
-Enhance the gdb manual with extra examples where needed.
-
-Arrange for list_command not to use decode_line_1 and thus not require
-symbols to be read in simply to read a source file.
-
-Allow patching of executables, a la "adb -w".
-
-Add a command for searching memory, a la adb. It specifies size,
-mask, value, start address. ADB searches until it finds it or hits
-an error (or is interrupted).
-
-# Local Variables:
-# mode: text
-# End:
diff --git a/gdb/README b/gdb/README
deleted file mode 100644
index a6e18eb..0000000
--- a/gdb/README
+++ /dev/null
@@ -1,591 +0,0 @@
- README for gdb-4.0 release
- John Gilmore 23 Aug 91
-
-This is GDB, the GNU source-level debugger, presently running under un*x.
-A summary of features new since gdb-3.5 is in the file `WHATS.NEW'.
-
-
-Unpacking and Installation -- quick overview
-==========================
-
-This release moves the generic GNU include files, the BFD ("binary file
-description") library, the getopt routines, obstacks, and the readline
-library into the parent directory of the gdb source files. The idea is
-that a variety of GNU tools can share a common copy of these things.
-
-These generic files are packaged together with the directory containing
-the source code for GDB, for now. When you unpack the gdb-4.0.tar.Z
-file, you'll get a directory called `gdb-4.0', which contains:
-
- Makefile.in bfd/ configure.in libiberty/
- README config.sub* gdb/ readline/
- README.configure configure* include/ texinfo/
-
-To build GDB, you can just do:
-
- cd gdb-4.0
- ./configure HOSTNAME
- make
- cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
-
-This will configure and build all the libraries as well as GDB.
-If you get compiler warnings during this stage, see the `Reporting Bugs'
-section below; there are a few known problems.
-
-GDB can be used as a cross-debugger, running on a machine of one type
-while debugging a program running on a machine of another type. See below.
-
-
-More Documentation
-==================
-
- The GDB 4.0 release includes an already-formatted reference card, ready
-for printing on a PostScript printer, as `gdb-4.0/gdb/refcard.ps'. It
-uses the most common PostScript fonts: the Times family, Courier,
-and Symbol. If you have a PostScript printer you can print the
-reference card by just sending `refcard.ps' to the printer.
-
- The release also includes the online Info version of the manual
-already formatted: the main Info file is `gdb-4.0/gdb/gdb.info', and
-it refers to subordinate files matching `gdb.info*' in the same
-directory.
-
- If you want to make these Info files yourself from the GDB
-manual's source, you need the GNU `makeinfo' program. Once you have
-it, you can type
-
- cd gdb-4.0/gdb
- make gdb.info
-
-to make the Info file.
-
- If you want to format and print copies of this manual, you need
-several things:
-
- * TeX, the public domain typesetting program written by Donald
- Knuth, must be installed on your system and available through
- your execution path.
-
- * `gdb-4.0/texinfo': TeX macros defining the GNU Documentation
- Format.
-
- * *A DVI output program.* TeX doesn't actually make marks on
- paper; it produces output files called DVI files. If your
- system has TeX installed, chances are it has a program for
- printing out these files; one popular example is `dvips', which
- can print DVI files on PostScript printers.
-
-Once you have these things, you can type
-
- cd gdb-4.0/gdb
- make gdb.dvi
-
-to format the text of this manual, and print it with the usual output
-method for TeX DVI files at your site.
-
- If you want to print the reference card, but don't have a PostScript
-printer, or want to print using Computer Modern fonts instead, you can
-still print it if you have TeX. Format the reference card by typing
-
- cd gdb-4.0/gdb
- make refcard.dvi
-
-The GDB reference card is designed to print in landscape mode on US
-"letter" size paper; that is, on a sheet 11 inches wide by 8.5
-inches high. You will need to specify this form of printing as an
-option to your DVI output program.
-
-
-Installing GDB
-==============
-
- GDB comes with a `configure' script that automates the process of
-preparing GDB for installation; you can then use `make' to build the
-`gdb' program.
-
- The gdb distribution includes all the source code you need for gdb
-in a single directory `gdb-4.0'. That directory in turn contains:
-
-`gdb-4.0/configure'
- Overall script for configuring GDB and all its supporting
- libraries.
-
-`gdb-4.0/gdb'
- the source specific to GDB itself
-
-`gdb-4.0/bfd'
- source for the Binary File Descriptor Library
-
-`gdb-4.0/include'
- GNU include files
-
-`gdb-4.0/libiberty'
- source for the `-liberty' free software library
-
-`gdb-4.0/readline'
- source for the GNU command-line interface
-
-Each of these directories has its own `configure' script, which are
-used by the overall `configure' script in `gdb-4.0'.
-
- It is most convenient to run `configure' from the `gdb-4.0'
-directory. The simplest way to configure and build GDB is the
-following:
-
- cd gdb-4.0
- ./configure HOST
- make
-
-where HOST is something like `sun4' or `decstation', that identifies
-the platform where GDB will run. This builds the three libraries
-`bfd', `readline', and `libiberty', then `gdb' itself. The
-configured source files, and the binaries, are left in the
-corresponding source directories.
-
- You can install `gdb' anywhere; it has no hardwired paths.
-However, you should make sure that the shell on your path (named by
-the `SHELL' environment variable) is publicly readable; some systems
-refuse to let GDB debug child processes whose programs are not
-readable, and GDB uses the shell to start your program.
-
-Configuration Subdirectories
-============================
-
- If you want to run GDB versions for several host or target
-machines, you'll need a different gdb compiled for each combination
-of host and target. `configure' is designed to make this easy by
-allowing you to generate each configuration in a separate
-subdirectory. If your `make' program handles the `VPATH' feature
-(GNU `make' does), running `make' in each of these directories then
-builds the gdb program specified there.
-
- `configure' creates these subdirectories for you when you
-simultaneously specify several configurations; but it's a good habit
-even for a single configuration. You can specify the use of
-subdirectories using the `+subdirs' option (abbreviated `+sub').
-For example, you can build GDB on a Sun 4 as follows:
-
- cd gdb-4.0
- ./configure +sub sun4
- cd Host-sparc-sun-sunos4/Target-sparc-sun-sunos4
- make
-
- When `configure' uses subdirectories to build programs or
-libraries, it creates nested directories `Host-HOST/Target-TARGET'.
-(As you see in the example, the names used for HOST and TARGET may
-be expanded from your `configure' argument; *note Config Names::.).
-`configure' uses these two directory levels because GDB can be
-configured for cross-compiling: GDB can run on one machine (the
-host) while debugging programs that run on another machine (the
-target). You specify cross-debugging targets by giving the
-`+target=TARGET' option to `configure'. Specifying only hosts still
-gives you two levels of subdirectory for each host, with the same
-configuration suffix on both; that is, if you give any number of
-hosts but no targets, GDB will be configured for native debugging on
-each host. On the other hand, whenever you specify both hosts and
-targets on the same command line, `configure' creates all
-combinations of the hosts and targets you list.
-
- When you run `make' to build a program or library, you must run it
-in a configured directory. If you made a single configuration,
-without subdirectories, run `make' in the source directory. If you
-have `Host-HOST/Target-TARGET' subdirectories, run `make' in those
-subdirectories.
-
- Each `configure' and `Makefile' under each source directory runs
-recursively, so that typing `make' in `gdb-4.0' (or in a
-`gdb-4.0/Host-HOST/Target-TARGET' subdirectory) builds all the
-required libraries, then GDB.
-
- If you run `configure' from a directory (such as `gdb-4.0') that
-contains source directories for multiple libraries or programs,
-`configure' creates the `Host-HOST/Target-TARGET' subdirectories in
-each library or program's source directory. For example, typing:
-
- cd gdb-4.0
- configure sun4 +target=vxworks960
-
-creates the following directories:
-
- gdb-4.0/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
- gdb-4.0/bfd/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
- gdb-4.0/gdb/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
- gdb-4.0/libiberty/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
- gdb-4.0/readline/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-
-The `Makefile' in
-
- gdb-4.0/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-
-will `cd' to the appropriate lower-level directories, for example:
-
- gdb-4.0/bfd/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-
-building each in turn.
-
- When you have multiple hosts or targets configured, you can run
-`make' on them in parallel (for example, if they are NFS-mounted on
-each of the hosts); they will not interfere with each other.
-
-Specifying Names for Hosts and Targets
-======================================
-
- The specifications used for hosts and targets in the `configure'
-script are based on a three-part naming scheme, but some short
-predefined aliases are also supported. The full naming scheme
-encodes three pieces of information in the following pattern:
-
- ARCHITECTURE-VENDOR-OS
-
- For example, you can use the alias `sun4' as a HOST argument or in
-a `+target='TARGET option, but the full name of that configuration
-specifies that the architecture is `sparc', the vendor is `sun', and
-the operating system is `sunos4'.
-
- The following table shows all the architectures, hosts, and OS
-prefixes that `configure' recognizes in GDB 4.0. Entries in the "OS
-prefix"
-column ending in a `*' may be followed by a release number.
-
-
- ARCHITECTURE VENDOR OS prefix
- ------------+-------------+-------------
- | |
- a29k | altos | aix*
- alliant | aout | aout
- arm | apollo | bout
- c1 | att | bsd*
- c2 | bout | coff
- i386 | coff | ctix*
- i860 | convergent | dynix*
- i960 | convex | esix*
- m68000 | dec | hpux*
- m68k | encore | isc*
- m88k | gould | mach*
- mips | hp | newsos*
- ns32k | ibm | nindy*
- pyramid | intel | none
- rs6000 | isi | osf*
- rtpc | little | sco*
- sparc | mips | sunos*
- tahoe | motorola | sysv*
- tron | ncr | ultrix*
- vax | next | unos*
- | none | v88r*
- | sco | vms*
- | sequent | vxworks*
- | sgi |
- | sony |
- | sun |
- | unicom |
- | utek |
- | wrs |
-
- *Warning:* Many combinations of architecture, vendor, and OS are
- untested.
-
- The `configure' script accompanying GDB 4.0 does not provide any
-query facility to list all supported host and target names or
-aliases. `configure' calls the Bourne shell script `config.sub' to
-map abbreviations to full names; you can read the script, if you
-wish, or you can use it to test your guesses on abbreviations--for
-example:
-
- % sh config.sub sun4
- sparc-sun-sunos4
- % sh config.sub sun3
- m68k-sun-sunos4
- % sh config.sub decstation
- mips-dec-ultrix
- % sh config.sub hp300bsd
- m68k-hp-bsd
- % sh config.sub i386v
- i386-none-sysv
- % sh config.sub i486v
- *** No vendor: configuration `i486v' not recognized
-
-`configure' Options
-===================
-
- Here is a summary of all the `configure' options and arguments
-that you might use for building GDB:
-
- configure [+destdir=DIR] [+subdirs] [+norecur] [+rm]
- [+target=TARGET...] HOST...
-
-You may introduce options with the character `-' rather than `+' if
-you prefer; but you may abbreviate option names if you use `+'.
-
-`+destdir=DIR'
- DIR is an installation directory *path prefix*. After you
- configure with this option, `make install' will install GDB as
- `DIR/bin/gdb', and the libraries in `DIR/lib'. If you specify
- `+destdir=/usr/local', for example, `make install' creates
- `/usr/local/bin/gdb'.
-
-`+subdirs'
- Write configuration specific files in subdirectories of the form
-
- Host-HOST/Target-TARGET
-
- (and configure the `Makefile' to write binaries there too).
- Without this option, if you specify only one configuration for
- GDB, `configure' will use the same directory for source,
- configured files, and binaries. This option is used
- automatically if you specify more than one HOST or more than
- one
- `+target=TARGET' option on the `configure' command line.
-
-`+norecur'
- Configure only the directory where `configure' is executed; do
- not propagate configuration to subdirectories.
-
-`+rm'
- Remove the configuration that the other arguments specify.
-
-`+target=TARGET ...'
- Configure GDB for cross-debugging programs running on each
- specified TARGET. You may specify as many `+target' options as
- you wish. Without this option, GDB is configured to debug
- programs that run on the same machine (HOST) as GDB itself.
-
- There is no convenient way to generate a list of all available
- targets.
-
-`HOST ...'
- Configure GDB to run on each specified HOST. You may specify as
- many host names as you wish.
-
- There is no convenient way to generate a list of all available
- hosts.
-
-`configure' accepts other options, for compatibility with configuring
-other GNU tools recursively; but these are the only options that
-affect GDB or its supporting libraries.
-
-
- Languages other than C
-
-C++ support has been integrated into gdb. GDB should work with FORTRAN
-programs. (If you have problems, please send a bug report; you may
-have to refer to some FORTRAN variables with a trailing underscore).
-Andrew Beers has produced a GDB that works with Modula-2, which will
-appear in gdb-4.1. I am not aware of anyone who is working on getting
-gdb to use the syntax of any other language. Pascal programs which use
-sets, subranges, file variables, or nested functions will not currently
-work.
-
-
- Kernel debugging
-
-I have't done this myself so I can't really offer any advice.
-Remote debugging over serial lines works fine, but the kernel debugging
-code in here has not been tested in years. Van Jacobson claims to have
-better kernel debugging, but won't release it for ordinary mortals.
-
-
- Remote debugging
-
-The files m68k-stub.c and i386-stub.c contain two examples of remote
-stubs to be used with remote.c. They are designeded to run standalone
-on a 68k or 386 cpu and communicate properly with the remote.c stub
-over a serial line.
-
-The file rem-multi.shar contains a general stub that can probably
-run on various different flavors of unix to allow debugging over a
-serial line from one machine to another.
-
-The files remote-eb.c and remote-nindy.c are two examples of remote
-interfaces for talking to existing ROM monitors (for the AMD 29000 and the
-Intel 960 repsectively).
-
-Remote-vx.c and the vx-share subdirectory contain a remote interface for the
-VxWorks realtime kernel, which communicates over TCP using the Sun
-RPC library. This would be a useful starting point for other remote-
-via-ethernet back ends.
-
-[This section seems to be out of date, I have never seen the "rapp"
-program, though I would like to. FIXME.]
-`rapp' runs under unix and acts as a remote stub (like rem-multi.shar
-distributed with GDB version 3). Currently it just works over UDP
-(network), not over a serial line. To get it running
-* Compile GDB on the host machine as usual
-* Compile rapp on the target machine, giving for both host and target
- the type of the target machine
-* Install "gdb" in /etc/services on both machines.
-
-
- Reporting Bugs
-
-The correct address for reporting bugs found in gdb is
-"bug-gdb@prep.ai.mit.edu". Please email all bugs to that address.
-
-GDB can produce warnings about symbols that it does not understand. By
-default, these warnings are disabled. You can enable them by executing
-`set complaint 10' (which you can put in your ~/.gdbinit if you like).
-I recommend doing this if you are working on a compiler, assembler,
-linker, or gdb, since it will point out problems that you may be able
-to fix. Warnings produced during symbol reading indicate some mismatch
-between the object file and GDB's symbol reading code (in many cases,
-it's a mismatch between the specs for the object file format, and what
-the compiler actually outputs or the debugger actually understands).
-
-If you port gdb to a new machine, please send the required changes
-to bug-gdb@prep.ai.mit.edu. If your changes are more than a few
-lines, obtain and send in a copyright assignment from gnu@prep.ai.mit.edu, as
-described in the section `Writing Code for GDB'.
-
-
- X Windows versus GDB
-
-xgdb is obsolete. We are not doing any development or support of it.
-
-There is an "xxgdb", which shows more promise, which was posted to
-comp.sources.x.
-
-For those intersted in auto display of source and the availability of
-an editor while debugging I suggest trying gdb-mode in gnu-emacs
-(Try typing M-x gdb RETURN). Comments on this mode are welcome.
-
-
- About the machine-dependent files
-
-tconfig/<machine>
-This contains Makefile stuff for when the target system is <machine>.
-It also specifies the name of the tm-XXX.h file for this machine.
-
-xconfig/<machine>
-This contains Makefile stuff for when the host system is <machine>.
-It also specifies the name of the xm-XXX.h file for this machine.
-
-tm-XXX.h (tm.h is a link to this file, created by configure).
-This file contains macro definitions about the target machine's
-registers, stack frame format and instructions.
-
-xm-XXX.h (xm.h is a link to this file, created by configure).
-This contains macro definitions describing the host system environment,
-such as byte order, host C compiler and library, ptrace support,
-and core file structure.
-
-<machine>-opcode.h
-<machine>-pinsn.c
-These files contain the information necessary to print instructions
-for your cpu type. <machine>-opcode.h includes some large initialized
-data structures, which is strange for a ".h" file, but it's OK since
-it is only included in one place. <machine>-opcode.h is shared
-between the debugger and the assembler (if the GNU assembler has been
-ported to that machine), whereas <machine>-pinsn.c is specific to GDB.
-
-<machine>-tdep.c
-This file contains any miscellaneous code required for this machine
-as a target. On some machines it doesn't exist at all. Its existence
-is specified in the tconfig/XXX file.
-
-<machine>-xdep.c
-This file contains any miscellaneous code required for this machine
-as a host. On some machines it doesn't exist at all. Its existence
-is specified in the xconfig/XXX file.
-
-infptrace.c
-This is the low level interface to inferior processes for systems
-using the Unix ptrace call in a vanilla way. Some systems have their
-own routines in <machine>-xdep.c. Whether or not it is used
-is specified in the xconfig/XXX file.
-
-coredep.c
-Machine and system-dependent aspects of reading core files. Some
-machines use coredep.c; some have the routines in <machine>-xdep.c.
-Whether or not it is used is specified in the xconfig/XXX file.
-Now that BFD is used to read core files, virtually all machines should
-use coredep.c and should just provide fetch_core_registers in
-<machine>-xdep.c.
-
-exec.c
-Machine and system-dependent aspects of reading executable files.
-Some machines use exec.c; some have the routines in <machine>-tdep.c
-Since BFD, virtually all machines should use exec.c.
-
-
- Writing Code for GDB
-
-We appreciate having users contribute code that is of general use, but
-for it to be included in future GDB releases it must be cleanly
-written. We do not want to include changes that will needlessly make
-future maintainance difficult. It is not much harder to do things
-right, and in the long term it is worth it to the GNU project, and
-probably to you individually as well.
-
-Please code according to the GNU coding standards. If you do not have
-a copy, you can request one by sending mail to gnu@prep.ai.mit.edu.
-
-If you make substantial changes, you'll have to file a copyright
-assignment with the Free Software Foundation before we can produce a
-release that includes your changes. Send mail requesting the copyright
-assignment to gnu@prep.ai.mit.edu. Do this early, like before the
-changes actually work, or even before you start them, because a manager
-or lawyer on your end will probably make this a slow process.
-
-Please try to avoid making machine-specific changes to
-machine-independent files. If this is unavoidable, put a hook in the
-machine-independent file which calls a (possibly) machine-dependent
-macro (for example, the IGNORE_SYMBOL macro can be used for any
-symbols which need to be ignored on a specific machine. Calling
-IGNORE_SYMBOL in dbxread.c is a lot cleaner than a maze of #if
-defined's). The machine-independent code should do whatever "most"
-machines want if the macro is not defined in param.h. Using #if
-defined can sometimes be OK (e.g. SET_STACK_LIMIT_HUGE) but should be
-conditionalized on a specific feature of an operating system (set in
-tm.h or xm.h) rather than something like #if defined(vax) or #if
-defined(SYSV). If you use an #ifdef on some symbol that is defined
-in a header file (e.g. #ifdef TIOCSETP), *please* make sure that you
-have #include'd the relevant header file in that module!
-
-It is better to replace entire routines which may be system-specific,
-rather than put in a whole bunch of hooks which are probably not going
-to be helpful for any purpose other than your changes. For example,
-if you want to modify dbxread.c to deal with DBX debugging symbols
-which are in COFF files rather than BSD a.out files, do something
-along the lines of a macro GET_NEXT_SYMBOL, which could have
-different definitions for COFF and a.out, rather than trying to put
-the necessary changes throughout all the code in dbxread.c that
-currently assumes BSD format.
-
-Please avoid duplicating code. For example, in GDB 3.x all the stuff
-in infptrace.c was duplicated in *-dep.c, and so changing something
-was very painful. In GDB 4.x, these have all been consolidated
-into infptrace.c. infptrace.c can deal with variations between
-systems the same way any system-independent file would (hooks, #if
-defined, etc.), and machines which are radically different don't need
-to use infptrace.c at all. The same was true of core_file_command
-and exec_file_command.
-
-
- Debugging gdb with itself
-
-If gdb is limping on your machine, this is the preferred way to get it
-fully functional. Be warned that in some ancient Unix systems, like
-Ultrix 4.0, a program can't be running in one process while it is being
-debugged in another. Rather than doing "./gdb ./gdb", which works on
-Suns and such, you can copy gdb to gdb2 and then do "./gdb ./gdb2".
-
-When you run gdb in this directory, it will read a ".gdbinit" file that
-sets up some simple things to make debugging gdb easier. The "info"
-command, when executed without a subcommand in a gdb being debugged by
-gdb, will pop you back up to the top level gdb. See .gdbinit for details.
-
-I strongly recommend printing out the reference card and using it.
-Send reference-card suggestions to bug-gdb@prep.ai.mit.edu, just like bugs.
-
-If you use emacs, you will probably want to do a "make TAGS" after you
-configure your distribution; this will put the machine dependent
-routines for your local machine where they will be accessed first by a
-M-period.
-
-Also, make sure that you've compiled gdb with your local cc or taken
-appropriate precautions regarding ansification of include files. See
-the Makefile for more information.
-
-(this is for editing this file with GNU emacs)
-Local Variables:
-mode: text
-End:
diff --git a/gdb/TODO b/gdb/TODO
deleted file mode 100644
index b67f093..0000000
--- a/gdb/TODO
+++ /dev/null
@@ -1,309 +0,0 @@
-
- gdb bug list
- John Gilmore, gnu@cygnus.com
-
-This bug list is probably not up to date or accurate, but it reflects
-some known bugs in gdb, if you are into bug-hunting.
-
-
-It should be possible to use symbols from shared libraries before we know
-exactly where the libraries will be loaded. E.g. "b perror" before running
-the program. This could maybe be done as an extension of the "breakpoint
-re-evaluation" after new symbols are loaded.
-
-Make single_step() insert and remove breakpoints in one operation.
-
-Speed up single stepping by avoiding extraneous ptrace calls.
-
-Speed up single stepping by not inserting and removing breakpoints
-each time the inferior starts and stops.
-
-Breakpoints should not be inserted and deleted all the time. Only the
-one(s) there should be removed when we have to step over one. Support
-breakpoints that don't have to be removed to step over them.
-
-Speed up watchpoints by not single-stepping them, but do something
-faster like single-line execution. Speed them up tremendously on
-machines that have watchpoint registers.
-
-Update gdbint.texinfo to include doc on the directory structure and
-the various tricks of building gdb.
-
-Do a tutorial in gdb.texinfo on how to do simple things in gdb.
-E.g. how to set a breakpoint that just prints something and continues.
-How to break on aborts. Etc.
-
-Provide "voodoo" debugging of core files. This creates a zombie
-process as a child of the debugger, and loads it up with the data,
-stack, and regs of the core file. This allows you to call functions
-in the executable, to manipulate the data in the core file.
-
-GDB reopens the source file on every line, as you "next" through it.
-
-Referencing the vtbl member of a struct doesn't work. It prints OK
-if you print the struct, but it gets 0 if you try to deref it.
-
-Persistent command history: A feature where you could save off a list
-of the commands you did, so you can edit it into something that will bring
-the target to the same place every time you source it.
-This would also be useful for automated fast watchpointing; if you go
-past the place where it watchpoints, you just start it over again and
-do it more carefully.
-
-Deal with the SunOS 4.0 and 4.1.1 ptrace bug that loses the registers if
-the stack is paged out.
-
-Finish the C++ exception handling stub routines. Lint points them out
-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.
-E.g. MIPS (mips-xdep.c).
-
-unpack_double() does not handle IEEE float on the target unless the host
-is also IEEE. Death on a vax.
-
-Test cross-debugging Unix-to-Unix.
-
-Check the RAPP remote protocol. What is it? It's in Makefile.in
-and one ChangeLog entry.
-
-Set up interface between GDB and INFO so that you can hop into interactive
-INFO and back out again. When running under Emacs, should use Emacs
-info, else fork the info program. Installation of GDB should install
-its texinfo files into the info tree automagically, including the readline
-texinfo files.
-
-"help address" ought to find the "help set print address" entry.
-
-Remove the VTBL internal guts from printouts of C++ structs, unless
-vtblprint is set.
-
-Remove "at 0xnnnn" from the "b foo" response, if `print address off' and if
-it matches the source line indicated.
-
-The prompt at end of screen should accept space as well as CR.
-
-"List" should put you into a pseudo-"more" where you can hit space
-to get more, forever to eof.
-
-Check STORE_RETURN_VALUE on all architectures. Check near it in tm-sparc.h
-for other bogosities.
-
-Check for storage leaks in GDB, I'm sure there are a lot!
-
-vtblprint of a vtbl should demangle the names it's printing.
-
-Backtrace should point out what the currently selected frame is, in its
-display, perhaps showing "@3 foo (bar, ...)" rather than "#3 foo (bar, ...)".
-
-"i program" should work for core files, and display more info, like what
-actually caused it to die.
-
-Hitting ^Z to an inferior doesn't work right, it takes several continues
-to make it actually go.
-
-"x/10i" should shorten the long name, if any, on subsequent lines.
-
-Check through the code for FIXME comments and fix them. dbxread.c,
-blockframe.c, and plenty more.
-
-"next" over a function that longjumps, never stops until next time you happen
-to get to that spot by accident. E.g. "n" over execute_command which has
-an error.
-
-Watchpoints seem not entirely reliable, though they haven't failed me recently.
-
-"set zeroprint off", don't bother printing members of structs which are entirely
-zero. Useful for those big structs with few useful members.
-
-GDB does four ioctl's for every command, probably switching terminal modes
-to/from inferior or for readline or something.
-
-terminal_ours versus terminal_inferior: cache state. Switch should be a noop
-if the state is the same, too.
-
-ptype $i6 = void??!
-
-Clean up invalid_float handling so gdb doesn't coredump when it tries to
-access a NaN. While this might work on SPARC, other machines are not
-configured right.
-
-"b value_at ; commands ; continue ; end" stops EVERY OTHER TIME!
-Then once you enter a command, it does the command, runs two more
-times, and then stops again! Bizarre... (This behaviour has been
-modified, but it is not yet 100% predictable when e.g. the commands
-call functions in the child, and while there, the child is interrupted
-with a signal, or hits a breakpoint.)
-
-Symbol completion with TAB does not unmangle names!
-
-help completion, help history should work.
-
-Symbol completion doesn't handle e.g. W::f. (symtab.c,
-make_symbol_completion_list).
-
-Check that we can handle stack trace through varargs AND alloca in same
-function, on 29K.
-
-wait_for_inferior loops forever if wait() gives it an error.
-
-"i frame" shows wrong "arglist at" location, doesn't show where the args
-should be found, only their actual values.
-
-Symbolic display of addrs, (& disassembly prefixes), don't show static
-fns, e.g. enable_command in gdb.
-
-'ptype yylval' ==> "union YYSTYPE { ..... }". However, it is not a
-union YYSTYPE, but is simply a YYSTYPE, which is a typedef for an
-unnamed union.
-
-There should be a way for "set" commands to validate the new setting
-before it takes effect.
-
-The "display" command should become the "always" command, e.g.
- "always print XXX"
- "always p/xxx XXX"
- "always echo foo"
- "always call XXX"
- "always x/i $pc", etc.
-
-A mess of floating point opcodes are missing from sparc-opcode.h.
-Also, a little program should test the table for bits that are
-overspecified or underspecified. E.g. if the must-be-ones bits
-and the must-be-zeroes bits leave some fields unexamined, and the format
-string leaves them unprinted, then point this out. If multiple
-non-alias patterns match, point this out too. Finally, there should
-be a sparc-optest.s file that tries each pattern out. This file
-should end up coming back the same (modulo transformation comments)
-if fed to "gas" then the .o is fed to gdb for disassembly.
-
-Merge the xxx-opcode.h files with gas again...
-
-Eliminate all the core_file_command's in all the xdep files.
-Eliminate separate declarations of registers[] everywhere.
-
-"ena d" is ambiguous, why? "ena delete" seems to think it is a command!
-
-Line numbers are off in some spots. In proceed() at 1st "oneproc = 1",
-it seems to run that statement, but it doesn't actually.
-
-Perhaps move the tdep and xdep files, and the tm and xm files, into a config
-subdirectory. If not, at least straighten out their names so that
-they all start with the machine name.
-
-inferior_status should include stop_print_frame. It won't need to be
-reset in wait_for_inferior after bpstat_stop_status call, then.
-
-i line VAR produces "Line number not known for symbol ``var''.". I
-thought we were stashing that info now!
-
-Make sure we can handle executables with no symbol info, e.g. /bin/csh.
-
-We should be able to write to random files at hex offsets like adb.
-
-Make "target xxx" command interruptible.
-
-Handle add_file with separate text, data, and bss addresses. Maybe
-handle separate addresses for each segment in the object file?
-
-Handle free_named_symtab to cope with multiply-loaded object files
-in a dynamic linking environment. Should remember the last copy loaded,
-but not get too snowed if it finds references to the older copy.
-
-The original BFD core dump reading routine would itself coredump when fed
-a garbage file as a core file. Does the current one?
-
-Generalize and Standardize the RPC interface to a target program,
-improve it beyond the "ptrace" interface, and see if it can become a
-standard for remote debugging.
-
-Remove all references to:
- text_offset
- data_offset
- text_data_start
- text_end
- exec_data_offset
- ...
-now that we have BFD. All remaining are in machine dependent files.
-
-When quitting with a running program, if a core file was previously
-examined, you get "Couldn't read float regs from core file"...if
-indeed it can't. generic_mourn_inferior...
-
-Check signal argument to remote proceed's and error if set.
-
-Sort help and info output.
-
-Re-organize help categories into things that tend to fit on a screen
-and hang together.
-
-renote-nindy.c handles interrupts poorly; it error()s out of badly
-chosen places, e.g. leaving current_frame zero, which causes core dumps
-on the next command.
-
-Add in commands like ADB's for searching for patterns, etc. We should
-be able to examine and patch raw unsymboled binaries as well in gdb as
-we can in adb. (E.g. increase the timeout in /bin/login without source).
-
-Those xdep files that call register_addr without defining it are
-probably simply broken. When reconfiguring this part of gdb, I could
-only make guesses about how to redo some of those files, and I
-probably guessed wrong, or left them "for later" when I have a
-machine that can attempt to build them.
-
-Use the complain() mechanism for handling all the error() calls in dbxread.c,
-and in similar situations in coffread.c and mipsread.c.
-
-When doing "step" or "next", if a few lines of source are skipped between
-the previous line and the current one, print those lines, not just the
-last line of a multiline statement.
-
-When searching for C++ superclasses in value_cast in valops.c, we must
-not search the "fields", only the "superclasses". There might be a
-struct with a field name that matches the superclass name. This can
-happen when the struct was defined before the superclass (before the
-name became a typedef).
-
-Handling of "&" address-of operator needs some serious overhaul
-for ANSI C and consistency on arrays and functions.
- For "float point[15];":
-ptype &point[4] ==> Attempt to take address of non-lvalue.
- For "char *malloc();":
-ptype malloc ==> "char *()"; should be same as
-ptype &malloc ==> "char *(*)()"
-call printf ("%x\n", malloc) ==> wierd value, should be same as
-call printf ("%x\n", &malloc) ==> correct value
-
-Fix dbxread.c symbol reading in the presence of interrupts. It currently
-leaves a cleanup to blow away the entire symbol table when a QUIT occurs.
-
-Mipsread.c reads include files depth-first, because the dependencies
-in the psymtabs are way too inclusive (it seems to me). Figure out what
-really depends on what, to avoid recursing 20 or 30 times while reading
-real symtabs.
-
-value_add() should be subtracting the lower bound of arrays, if known,
-and possibly checking against the upper bound for error reporting.
-
-mipsread.c symbol table allocation and deallocation should be checked.
-My suspicion is that it's full of memory leaks.
-
-SunOS should have a target_lookup_symbol() for common'd things allocated
-by the shared library linker ld.so.
-
-When listing source lines, check for a preceding \n, to verify that
-the file hasn't changed out from under us.
-
-When listing source lines, eat leading whitespace corresponding to the
-line-number prefix we print. This avoids long lines wrapping.
-
-mipsread.c needs to check for old symtabs and psymtabs for the same
-files, the way it happens for dbxread.c and coffread.c, for VxWorks
-incremental symbol table reloading.
-
-When attached to a non-child process, ^C or other signals are not
-propagated to the child. Do this in the GDB signal handler, using
-target_kill(). AMD version: ^C should do ^Ak to stop ebmon.
-
diff --git a/gdb/WHATS.NEW b/gdb/WHATS.NEW
deleted file mode 100755
index 71ba79d..0000000
--- a/gdb/WHATS.NEW
+++ /dev/null
@@ -1,284 +0,0 @@
- What has changed since GDB-3.5?
- (Organized release by release)
-
-*** Changes in GDB-4.2:
-
- * Improved configuration
-
-Only one copy of `configure' exists now, and it is not self-modifying.
-Porting BFD is simpler.
-
- * Stepping improved
-
-The `step' and `next' commands now only stop at the first instruction
-of a source line. This prevents the multiple stops that used to occur
-in switch statements, for-loops, etc. `Step' continues to stop if a
-function that has debugging information is called within the line.
-
- * Bug fixing
-
-Lots of small bugs fixed. More remain.
-
- * New host supported (not target)
-
-Intel 386 PC clone running Mach i386-none-mach
-
-
-*** Changes in GDB-4.1:
-
- * Multiple source language support
-
-GDB now has internal scaffolding to handle several source languages.
-It determines the type of each source file from its filename extension,
-and will switch expression parsing and number formatting to match the
-language of the function in the currently selected stack frame.
-You can also specifically set the language to be used, with
-`set language c' or `set language modula-2'.
-
- * GDB and Modula-2
-
-GDB now has preliminary support for the GNU Modula-2 compiler,
-currently under development at the State University of New York at
-Buffalo. Development of both GDB and the GNU Modula-2 compiler will
-continue through the fall of 1991 and into 1992.
-
-Other Modula-2 compilers are currently not supported, and attempting to
-debug programs compiled with them will likely result in an error as the
-symbol table is read. Feel free to work on it, though!
-
-There are hooks in GDB for strict type checking and range checking,
-in the `Modula-2 philosophy', but they do not currently work.
-
- * set write on/off
-
-GDB can now write to executable and core files (e.g. patch
-a variable's value). You must turn this switch on, specify
-the file ("exec foo" or "core foo"), *then* modify it, e.g.
-by assigning a new value to a variable. Modifications take
-effect immediately.
-
- * Automatic SunOS shared library reading
-
-When you run your program, GDB automatically determines where its
-shared libraries (if any) have been loaded, and reads their symbols.
-The `share' command is no longer needed. This also works when
-examining core files.
-
- * set listsize
-
-You can specify the number of lines that the `list' command shows.
-The default is 10.
-
- * New machines supported (host and target)
-
-SGI Iris (MIPS) running Irix V3: mips-sgi-irix or iris
-Sony NEWS (68K) running NEWSOS 3.x: m68k-sony-sysv or news
-Ultracomputer (29K) running Sym1: a29k-nyu-sym1 or ultra3
-
- * New hosts supported (not targets)
-
-IBM RT/PC: romp-ibm-aix or rtpc
-
- * New targets supported (not hosts)
-
-AMD 29000 embedded with COFF a29k-none-coff
-AMD 29000 embedded with a.out a29k-none-aout
-Ultracomputer remote kernel debug a29k-nyu-kern
-
- * New remote interfaces
-
-AMD 29000 Adapt
-AMD 29000 Minimon
-
-
-*** Changes in GDB-4.0:
-
- * New Facilities
-
-Wide output is wrapped at good places to make the output more readable.
-
-Gdb now supports cross-debugging from a host machine of one type to a
-target machine of another type. Communication with the target system
-is over serial lines. The ``target'' command handles connecting to the
-remote system; the ``load'' command will download a program into the
-remote system. Serial stubs for the m68k and i386 are provided. Gdb
-also supports debugging of realtime processes running under VxWorks,
-using SunRPC Remote Procedure Calls over TCP/IP to talk to a debugger
-stub on the target system.
-
-New CPUs supported include the AMD 29000 and Intel 960.
-
-GDB now reads object files and symbol tables via a ``binary file''
-library, which allows a single copy of GDB to debug programs of multiple
-object file types such as a.out and coff.
-
-There is now a GDB reference card in "doc/refcard.tex". (Make targets
-refcard.dvi and refcard.ps are available to format it).
-
-
- * Control-Variable user interface simplified
-
-All variables that control the operation of the debugger can be set
-by the ``set'' command, and displayed by the ``show'' command.
-
-For example, ``set prompt new-gdb=>'' will change your prompt to new-gdb=>.
-``Show prompt'' produces the response:
-Gdb's prompt is new-gdb=>.
-
-What follows are the NEW set commands. The command ``help set'' will
-print a complete list of old and new set commands. ``help set FOO''
-will give a longer description of the variable FOO. ``show'' will show
-all of the variable descriptions and their current settings.
-
-confirm on/off: Enables warning questions for operations that are
- hard to recover from, e.g. rerunning the program while
- it is already running. Default is ON.
-
-editing on/off: Enables EMACS style command line editing
- of input. Previous lines can be recalled with
- control-P, the current line can be edited with control-B,
- you can search for commands with control-R, etc.
- Default is ON.
-
-history filename NAME: NAME is where the gdb command history
- will be stored. The default is .gdb_history,
- or the value of the environment variable
- GDBHISTFILE.
-
-history size N: The size, in commands, of the command history. The
- default is 256, or the value of the environment variable
- HISTSIZE.
-
-history save on/off: If this value is set to ON, the history file will
- be saved after exiting gdb. If set to OFF, the
- file will not be saved. The default is OFF.
-
-history expansion on/off: If this value is set to ON, then csh-like
- history expansion will be performed on
- command line input. The default is OFF.
-
-radix N: Sets the default radix for input and output. It can be set
- to 8, 10, or 16. Note that the argument to "radix" is interpreted
- in the current radix, so "set radix 10" is always a no-op.
-
-height N: This integer value is the number of lines on a page. Default
- is 24, the current `stty rows'' setting, or the ``li#''
- setting from the termcap entry matching the environment
- variable TERM.
-
-width N: This integer value is the number of characters on a line.
- Default is 80, the current `stty cols'' setting, or the ``co#''
- setting from the termcap entry matching the environment
- variable TERM.
-
-Note: ``set screensize'' is obsolete. Use ``set height'' and
-``set width'' instead.
-
-print address on/off: Print memory addresses in various command displays,
- such as stack traces and structure values. Gdb looks
- more ``symbolic'' if you turn this off; it looks more
- ``machine level'' with it on. Default is ON.
-
-print array on/off: Prettyprint arrays. New convenient format! Default
- is OFF.
-
-print demangle on/off: Print C++ symbols in "source" form if on,
- "raw" form if off.
-
-print asm-demangle on/off: Same, for assembler level printouts
- like instructions.
-
-print vtbl on/off: Prettyprint C++ virtual function tables. Default is OFF.
-
-
- * Support for Epoch Environment.
-
-The epoch environment is a version of Emacs v18 with windowing. One
-new command, ``inspect'', is identical to ``print'', except that if you
-are running in the epoch environment, the value is printed in its own
-window.
-
-
- * Support for Shared Libraries
-
-GDB can now debug programs and core files that use SunOS shared libraries.
-Symbols from a shared library cannot be referenced
-before the shared library has been linked with the program (this
-happens after you type ``run'' and before the function main() is entered).
-At any time after this linking (including when examining core files
-from dynamically linked programs), gdb reads the symbols from each
-shared library when you type the ``sharedlibrary'' command.
-It can be abbreviated ``share''.
-
-sharedlibrary REGEXP: Load shared object library symbols for files
- matching a unix regular expression. No argument
- indicates to load symbols for all shared libraries.
-
-info sharedlibrary: Status of loaded shared libraries.
-
-
- * Watchpoints
-
-A watchpoint stops execution of a program whenever the value of an
-expression changes. Checking for this slows down execution
-tremendously whenever you are in the scope of the expression, but is
-quite useful for catching tough ``bit-spreader'' or pointer misuse
-problems. Some machines such as the 386 have hardware for doing this
-more quickly, and future versions of gdb will use this hardware.
-
-watch EXP: Set a watchpoint (breakpoint) for an expression.
-
-info watchpoints: Information about your watchpoints.
-
-delete N: Deletes watchpoint number N (same as breakpoints).
-disable N: Temporarily turns off watchpoint number N (same as breakpoints).
-enable N: Re-enables watchpoint number N (same as breakpoints).
-
-
- * C++ multiple inheritance
-
-When used with a GCC version 2 compiler, GDB supports multiple inheritance
-for C++ programs.
-
- * C++ exception handling
-
-Gdb now supports limited C++ exception handling. Besides the existing
-ability to breakpoint on an exception handler, gdb can breakpoint on
-the raising of an exception (before the stack is peeled back to the
-handler's context).
-
-catch FOO: If there is a FOO exception handler in the dynamic scope,
- set a breakpoint to catch exceptions which may be raised there.
- Multiple exceptions (``catch foo bar baz'') may be caught.
-
-info catch: Lists all exceptions which may be caught in the
- current stack frame.
-
-
- * Minor command changes
-
-The command ``call func (arg, arg, ...)'' now acts like the print
-command, except it does not print or save a value if the function's result
-is void. This is similar to dbx usage.
-
-The ``up'' and ``down'' commands now always print the frame they end up
-at; ``up-silently'' and `down-silently'' can be used in scripts to change
-frames without printing.
-
- * New directory command
-
-'dir' now adds directories to the FRONT of the source search path.
-The path starts off empty. Source files that contain debug information
-about the directory in which they were compiled can be found even
-with an empty path; Sun CC and GCC include this information. If GDB can't
-find your source file in the current directory, type "dir .".
-
- * Configuring GDB for compilation
-
-For normal use, type ``./configure host''. See README or gdb.texinfo
-for more details.
-
-GDB now handles cross debugging. If you are remotely debugging between
-two different machines, type ``./configure host -target=targ''.
-Host is the machine where gdb will run; targ is the machine
-where the program that you are debugging will run.
diff --git a/gdb/alldeps.mak b/gdb/alldeps.mak
deleted file mode 100644
index 5563107..0000000
--- a/gdb/alldeps.mak
+++ /dev/null
@@ -1,221 +0,0 @@
-# Start of "alldeps.mak" definitions
-ALLDEPFILES = $(ALLDEPFILES_MAINDIR) $(ALLDEPFILES_SUBDIR)
-ALLDEPFILES_MAINDIR=\
-altos-xdep.c\
-am29k-pinsn.c\
-am29k-tdep.c\
-arm-convert.s\
-arm-pinsn.c\
-arm-tdep.c\
-arm-xdep.c\
-convex-pinsn.c\
-convex-tdep.c\
-convex-xdep.c\
-coredep.c\
-exec.c\
-gould-pinsn.c\
-gould-xdep.c\
-hp300ux-xdep.c\
-i386-pinsn.c\
-i386-tdep.c\
-i386-xdep.c\
-i960-pinsn.c\
-i960-tdep.c\
-infptrace.c\
-m68k-pinsn.c\
-m68k-tdep.c\
-m88k-pinsn.c\
-m88k-tdep.c\
-m88k-xdep.c\
-mips-pinsn.c\
-mips-tdep.c\
-mips-xdep.c\
-mipsread.c\
-news-xdep.c\
-nindy-tdep.c\
-ns32k-pinsn.c\
-pyr-pinsn.c\
-pyr-tdep.c\
-pyr-xdep.c\
-remote-adapt.c\
-remote-eb.c\
-remote-mm.c\
-remote-nindy.c\
-remote-vx.c\
-solib.c\
-sparc-pinsn.c\
-sparc-tdep.c\
-sparc-xdep.c\
-sun3-xdep.c\
-sun386-xdep.c\
-symm-tdep.c\
-symm-xdep.c\
-tahoe-pinsn.c\
-tdesc.c\
-ultra3-xdep.c\
-umax-xdep.c\
-vax-pinsn.c
-
-ALLDEPFILES_SUBDIR=\
-nindy-share/Onindy.c\
-nindy-share/nindy.c\
-nindy-share/ttybreak.c\
-nindy-share/ttyflush.c\
-vx-share/xdr_ld.c\
-vx-share/xdr_ptrace.c\
-vx-share/xdr_rdb.c\
-vx-share/xdr_regs.c
-
-ALLPARAM=\
-tm-29k.h\
-tm-3b1.h\
-tm-88k.h\
-tm-altos.h\
-tm-altosgas.h\
-tm-arm.h\
-tm-bigmips.h\
-tm-convex.h\
-tm-hp300bsd.h\
-tm-hp300hpux.h\
-tm-i386v-g.h\
-tm-i386v.h\
-tm-isi.h\
-tm-merlin.h\
-tm-mips.h\
-tm-news.h\
-tm-nindy960.h\
-tm-np1.h\
-tm-pn.h\
-tm-pyr.h\
-tm-sparc.h\
-tm-sun2.h\
-tm-sun2os4.h\
-tm-sun3.h\
-tm-sun386.h\
-tm-sun3os4.h\
-tm-sun4os4.h\
-tm-symmetry.h\
-tm-tahoe.h\
-tm-ultra3.h\
-tm-umax.h\
-tm-vax.h\
-tm-vx68.h\
-tm-vx960.h\
-xm-3b1.h\
-xm-88k.h\
-xm-altos.h\
-xm-arm.h\
-xm-bigmips.h\
-xm-convex.h\
-xm-hp300bsd.h\
-xm-hp300hpux.h\
-xm-i386sco.h\
-xm-i386v.h\
-xm-i386v32.h\
-xm-isi.h\
-xm-merlin.h\
-xm-mips.h\
-xm-news.h\
-xm-news1000.h\
-xm-np1.h\
-xm-pn.h\
-xm-pyr.h\
-xm-rtbsd.h\
-xm-sparc.h\
-xm-sun2.h\
-xm-sun3.h\
-xm-sun386.h\
-xm-sun3os4.h\
-xm-sun4os4.h\
-xm-symmetry.h\
-xm-tahoe.h\
-xm-ultra3.h\
-xm-umax.h\
-xm-vax.h
-
-ALLCONFIG=\
-./tconfig/3b1\
-./tconfig/a29k\
-./tconfig/a29k-kern\
-./tconfig/altos\
-./tconfig/altosgas\
-./tconfig/arm\
-./tconfig/bigmips\
-./tconfig/convex\
-./tconfig/dec3100\
-./tconfig/hp300bsd\
-./tconfig/hp300hpux\
-./tconfig/i386sco\
-./tconfig/i386v\
-./tconfig/i386v-g\
-./tconfig/i386v32\
-./tconfig/i386v32-g\
-./tconfig/i960\
-./tconfig/isi\
-./tconfig/littlemips\
-./tconfig/m88k\
-./tconfig/merlin\
-./tconfig/news\
-./tconfig/news1000\
-./tconfig/nindy960\
-./tconfig/none\
-./tconfig/np1\
-./tconfig/pn\
-./tconfig/pyramid\
-./tconfig/sun2os3\
-./tconfig/sun2os4\
-./tconfig/sun3\
-./tconfig/sun386\
-./tconfig/sun3os3\
-./tconfig/sun3os4\
-./tconfig/sun4\
-./tconfig/sun4os3\
-./tconfig/sun4os4\
-./tconfig/symmetry\
-./tconfig/tahoe\
-./tconfig/ultra3\
-./tconfig/umax\
-./tconfig/vax\
-./tconfig/vxworks68\
-./tconfig/vxworks960\
-./xconfig/3b1\
-./xconfig/altos\
-./xconfig/altosgas\
-./xconfig/arm\
-./xconfig/bigmips\
-./xconfig/convex\
-./xconfig/dec3100\
-./xconfig/hp300bsd\
-./xconfig/hp300hpux\
-./xconfig/i386sco\
-./xconfig/i386v\
-./xconfig/i386v-g\
-./xconfig/i386v32\
-./xconfig/i386v32-g\
-./xconfig/isi\
-./xconfig/littlemips\
-./xconfig/m88k\
-./xconfig/merlin\
-./xconfig/news\
-./xconfig/news1000\
-./xconfig/none\
-./xconfig/np1\
-./xconfig/pn\
-./xconfig/pyramid\
-./xconfig/rtbsd\
-./xconfig/sun2os3\
-./xconfig/sun2os4\
-./xconfig/sun3\
-./xconfig/sun386\
-./xconfig/sun3os3\
-./xconfig/sun3os4\
-./xconfig/sun4\
-./xconfig/sun4os3\
-./xconfig/sun4os4\
-./xconfig/symmetry\
-./xconfig/tahoe\
-./xconfig/ultra3\
-./xconfig/umax\
-./xconfig/vax
-
-# End of "alldeps.mak" definitions
diff --git a/gdb/alloca.c b/gdb/alloca.c
deleted file mode 100644
index 60f86e0..0000000
--- a/gdb/alloca.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- alloca -- (mostly) portable public-domain implementation -- D A Gwyn
-
- last edit: 86/05/30 rms
- include config.h, since on VMS it renames some symbols.
- Use xmalloc instead of malloc.
-
- This implementation of the PWB library alloca() function,
- which is used to allocate space off the run-time stack so
- that it is automatically reclaimed upon procedure exit,
- was inspired by discussions with J. Q. Johnson of Cornell.
-
- It should work under any C implementation that uses an
- actual procedure stack (as opposed to a linked list of
- frames). There are some preprocessor constants that can
- be defined when compiling for your specific system, for
- improved efficiency; however, the defaults should be okay.
-
- The general concept of this implementation is to keep
- track of all alloca()-allocated blocks, and reclaim any
- that are found to be deeper in the stack than the current
- invocation. This heuristic does not reclaim storage as
- soon as it becomes invalid, but it will do so eventually.
-
- As a special case, alloca(0) reclaims storage without
- allocating any. It is a good idea to use alloca(0) in
- your main control loop, etc. to force garbage collection.
-*/
-#ifndef lint
-static char SCCSid[] = "@(#)alloca.c 1.1"; /* for the "what" utility */
-#endif
-
-#ifdef emacs
-#include "config.h"
-#ifdef static
-/* actually, only want this if static is defined as ""
- -- this is for usg, in which emacs must undefine static
- in order to make unexec workable
- */
-#ifndef STACK_DIRECTION
-you
-lose
--- must know STACK_DIRECTION at compile-time
-#endif /* STACK_DIRECTION undefined */
-#endif /* static */
-#endif /* emacs */
-
-#ifdef __STDC__
-typedef void *pointer; /* generic pointer type */
-#else
-typedef char *pointer; /* generic pointer type */
-#endif
-
-#define NULL 0 /* null pointer constant */
-
-extern void free();
-extern pointer xmalloc();
-
-/*
- Define STACK_DIRECTION if you know the direction of stack
- growth for your system; otherwise it will be automatically
- deduced at run-time.
-
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
-*/
-
-#ifndef STACK_DIRECTION
-#define STACK_DIRECTION 0 /* direction unknown */
-#endif
-
-#if STACK_DIRECTION != 0
-
-#define STACK_DIR STACK_DIRECTION /* known at compile-time */
-
-#else /* STACK_DIRECTION == 0; need run-time code */
-
-static int stack_dir; /* 1 or -1 once known */
-#define STACK_DIR stack_dir
-
-static void
-find_stack_direction (/* void */)
-{
- static char *addr = NULL; /* address of first
- `dummy', once known */
- auto char dummy; /* to get stack address */
-
- if (addr == NULL)
- { /* initial entry */
- addr = &dummy;
-
- find_stack_direction (); /* recurse once */
- }
- else /* second entry */
- if (&dummy > addr)
- stack_dir = 1; /* stack grew upward */
- else
- stack_dir = -1; /* stack grew downward */
-}
-
-#endif /* STACK_DIRECTION == 0 */
-
-/*
- An "alloca header" is used to:
- (a) chain together all alloca()ed blocks;
- (b) keep track of stack depth.
-
- It is very important that sizeof(header) agree with malloc()
- alignment chunk size. The following default should work okay.
-*/
-
-#ifndef ALIGN_SIZE
-#define ALIGN_SIZE sizeof(double)
-#endif
-
-typedef union hdr
-{
- char align[ALIGN_SIZE]; /* to force sizeof(header) */
- struct
- {
- union hdr *next; /* for chaining headers */
- char *deep; /* for stack depth measure */
- } h;
-} header;
-
-/*
- alloca( size ) returns a pointer to at least `size' bytes of
- storage which will be automatically reclaimed upon exit from
- the procedure that called alloca(). Originally, this space
- was supposed to be taken from the current stack frame of the
- caller, but that method cannot be made to work for some
- implementations of C, for example under Gould's UTX/32.
-*/
-
-static header *last_alloca_header = NULL; /* -> last alloca header */
-
-pointer
-alloca (size) /* returns pointer to storage */
- unsigned size; /* # bytes to allocate */
-{
- auto char probe; /* probes stack depth: */
- register char *depth = &probe;
-
-#if STACK_DIRECTION == 0
- if (STACK_DIR == 0) /* unknown growth direction */
- find_stack_direction ();
-#endif
-
- /* Reclaim garbage, defined as all alloca()ed storage that
- was allocated from deeper in the stack than currently. */
-
- {
- register header *hp; /* traverses linked list */
-
- for (hp = last_alloca_header; hp != NULL;)
- if ( (STACK_DIR > 0 && hp->h.deep > depth)
- || (STACK_DIR < 0 && hp->h.deep < depth) )
- {
- register header *np = hp->h.next;
-
- free ((pointer) hp); /* collect garbage */
-
- hp = np; /* -> next header */
- }
- else
- break; /* rest are not deeper */
-
- last_alloca_header = hp; /* -> last valid storage */
- }
-
- if (size == 0)
- return NULL; /* no allocation required */
-
- /* Allocate combined header + user data storage. */
-
- {
- register pointer new = xmalloc (sizeof (header) + size);
- /* address of header */
-
- ((header *)new)->h.next = last_alloca_header;
- ((header *)new)->h.deep = depth;
-
- last_alloca_header = (header *)new;
-
- /* User storage begins just after header. */
-
- return (pointer)((char *)new + sizeof(header));
- }
-}
-
diff --git a/gdb/altos-xdep.c b/gdb/altos-xdep.c
deleted file mode 100644
index 8cbdfc9..0000000
--- a/gdb/altos-xdep.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* Low level interface to ptrace, for GDB when running under m68k SVR2 Unix
- on Altos 3068. Report bugs to Jyrki Kuoppala <jkp@cs.hut.fi>
- Copyright (C) 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#ifdef USG
-#include <sys/page.h>
-#ifdef ALTOS
-#include <sys/net.h>
-#include <errno.h>
-#endif
-#endif
-
-#include "gdbcore.h"
-#include <sys/user.h> /* After a.out.h */
-#include <sys/file.h>
-#include <sys/stat.h>
-
-/* Work with core dump and executable files, for GDB.
- This code would be in core.c if it weren't machine-dependent. */
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- extern char registers[];
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
- /* 4.2-style (and perhaps also sysV-style) core dump file. */
- {
- struct user u;
-
- unsigned int reg_offset;
-
- val = myread (corechan, &u, sizeof u);
- if (val < 0)
- perror_with_name ("Not a core file: reading upage");
- if (val != sizeof u)
- error ("Not a core file: could only read %d bytes", val);
- data_start = exec_data_start;
-
-#if !defined (NBPG)
-#define NBPG NBPP
-#endif
-#if !defined (UPAGES)
-#define UPAGES USIZE
-#endif
-
- data_end = data_start + NBPG * u.u_dsize;
- stack_start = stack_end - NBPG * u.u_ssize;
- data_offset = NBPG * UPAGES + exec_data_start % NBPG /* Not sure about this //jkp */;
- stack_offset = NBPG * (UPAGES + u.u_dsize);
-
- /* Some machines put an absolute address in here and some put
- the offset in the upage of the regs. */
- reg_offset = (int) u.u_state;
- if (reg_offset > NBPG * UPAGES)
- reg_offset -= KERNEL_U_ADDR;
-
- bcopy (&u.u_exdata, &core_aouthdr, sizeof (AOUTHDR));
- printf ("Core file is from \"%s\".\n", u.u_comm);
-
- /* I don't know where to find this info.
- So, for now, mark it as not available. */
- N_SET_MAGIC (core_aouthdr, 0);
-
- /* Read the register values out of the core file and store
- them where `read_register' will find them. */
-
- {
- register int regno;
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- char buf[MAX_REGISTER_RAW_SIZE];
-
- val = lseek (corechan, register_addr (regno, reg_offset), 0);
- if (val < 0
- || (val = myread (corechan, buf, sizeof buf)) < 0)
- {
- char * buffer = (char *) alloca (strlen (reg_names[regno])
- + 30);
- strcpy (buffer, "Reading register ");
- strcat (buffer, reg_names[regno]);
-
- perror_with_name (buffer);
- }
-
- supply_register (regno, buf);
- }
- }
- }
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- {
- corefile = concat (current_directory, "/", filename, NULL);
- }
-
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- select_frame (get_current_frame (), 0);
- validate_files ();
- }
- else if (from_tty)
- printf ("No core file now.\n");
-}
diff --git a/gdb/am29k-opcode.h b/gdb/am29k-opcode.h
deleted file mode 100644
index 3a32e23..0000000
--- a/gdb/am29k-opcode.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/* Table of opcodes for the AMD 29000
- Copyright (C) 1990, 1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support. Written by Jim Kingdon.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-struct am29k_opcode {
- /* Name of the instruction. */
- char *name;
-
- /* Opcode (i.e. most significant byte of the word). */
- unsigned char opcode;
-
- /* A string of characters which describe the operands.
- Valid characters are:
- , Itself. The character appears in the assembly code.
- a RA. The register number is in bits 8-15 of the instruction.
- b RB. The register number is in bits 0-7 of the instruction.
- c RC. The register number is in bits 16-23 of the instruction.
- i An immediate operand is in bits 0-7 of the instruction.
- x Bits 0-7 and 16-23 of the instruction are bits 0-7 and 8-15
- (respectively) of the immediate operand.
- h Same as x but the instruction contains bits 16-31 of the
- immediate operand.
- X Same as x but bits 16-31 of the signed immediate operand
- are set to 1 (thus the operand is always negative).
- P,A Bits 0-7 and 16-23 of the instruction are bits 2-9 and 10-17
- (respectively) of the immediate operand.
- P=PC-relative, sign-extended to 32 bits.
- A=Absolute, zero-extended to 32 bits.
- e CE bit (bit 23) for a load/store instruction.
- n Control field (bits 16-22) for a load/store instruction.
- v Immediate operand in bits 16-23 of the instruction.
- (used for trap numbers).
- s SA. Special-purpose register number in bits 8-15
- of the instruction.
- u UI--bit 7 of the instruction.
- r RND--bits 4-6 of the instruction.
- d FD--bits 2-3 of the instruction.
- f FS--bits 0-1 of the instruction. */
- char *args;
-};
-
-static struct am29k_opcode am29k_opcodes[] =
-{
-
-{ "add", 0x14, "c,a,b" },
-{ "add", 0x15, "c,a,i" },
-{ "addc", 0x1c, "c,a,b" },
-{ "addc", 0x1d, "c,a,i" },
-{ "addcs", 0x18, "c,a,b" },
-{ "addcs", 0x19, "c,a,i" },
-{ "addcu", 0x1a, "c,a,b" },
-{ "addcu", 0x1b, "c,a,i" },
-{ "adds", 0x10, "c,a,b" },
-{ "adds", 0x11, "c,a,i" },
-{ "addu", 0x12, "c,a,b" },
-{ "addu", 0x13, "c,a,i" },
-{ "and", 0x90, "c,a,b" },
-{ "and", 0x91, "c,a,i" },
-{ "andn", 0x9c, "c,a,b" },
-{ "andn", 0x9d, "c,a,i" },
-{ "aseq", 0x70, "v,a,b" },
-{ "aseq", 0x71, "v,a,i" },
-{ "asge", 0x5c, "v,a,b" },
-{ "asge", 0x5d, "v,a,i" },
-{ "asgeu", 0x5e, "v,a,b" },
-{ "asgeu", 0x5f, "v,a,i" },
-{ "asgt", 0x58, "v,a,b" },
-{ "asgt", 0x59, "v,a,i" },
-{ "asgtu", 0x5a, "v,a,b" },
-{ "asgtu", 0x5b, "v,a,i" },
-{ "asle", 0x54, "v,a,b" },
-{ "asle", 0x55, "v,a,i" },
-{ "asleu", 0x56, "v,a,b" },
-{ "asleu", 0x57, "v,a,i" },
-{ "aslt", 0x50, "v,a,b" },
-{ "aslt", 0x51, "v,a,i" },
-{ "asltu", 0x52, "v,a,b" },
-{ "asltu", 0x53, "v,a,i" },
-{ "asneq", 0x72, "v,a,b" },
-{ "asneq", 0x73, "v,a,i" },
-{ "call", 0xa8, "a,P" },
-{ "call", 0xa9, "a,A" },
-{ "calli", 0xc8, "a,b" },
-{ "class", 0xe6, "c,a,f" },
-{ "clz", 0x08, "c,b" },
-{ "clz", 0x09, "c,i" },
-{ "const", 0x03, "a,x" },
-{ "consth", 0x02, "a,h" },
-{ "consthz", 0x05, "a,h" },
-{ "constn", 0x01, "a,X" },
-{ "convert", 0xe4, "c,a,u,r,d,f" },
-{ "cpbyte", 0x2e, "c,a,b" },
-{ "cpbyte", 0x2f, "c,a,i" },
-{ "cpeq", 0x60, "c,a,b" },
-{ "cpeq", 0x61, "c,a,i" },
-{ "cpge", 0x4c, "c,a,b" },
-{ "cpge", 0x4d, "c,a,i" },
-{ "cpgeu", 0x4e, "c,a,b" },
-{ "cpgeu", 0x4f, "c,a,i" },
-{ "cpgt", 0x48, "c,a,b" },
-{ "cpgt", 0x49, "c,a,i" },
-{ "cpgtu", 0x4a, "c,a,b" },
-{ "cpgtu", 0x4b, "c,a,i" },
-{ "cple", 0x44, "c,a,b" },
-{ "cple", 0x45, "c,a,i" },
-{ "cpleu", 0x46, "c,a,b" },
-{ "cpleu", 0x47, "c,a,i" },
-{ "cplt", 0x40, "c,a,b" },
-{ "cplt", 0x41, "c,a,i" },
-{ "cpltu", 0x42, "c,a,b" },
-{ "cpltu", 0x43, "c,a,i" },
-{ "cpneq", 0x62, "c,a,b" },
-{ "cpneq", 0x63, "c,a,i" },
-{ "dadd", 0xf1, "c,a,b" },
-{ "ddiv", 0xf7, "c,a,b" },
-{ "deq", 0xeb, "c,a,b" },
-{ "dge", 0xef, "c,a,b" },
-{ "dgt", 0xed, "c,a,b" },
-{ "div", 0x6a, "c,a,b" },
-{ "div", 0x6b, "c,a,i" },
-{ "div0", 0x68, "c,b" },
-{ "div0", 0x69, "c,i" },
-{ "divide", 0xe1, "c,a,b" },
-{ "dividu", 0xe3, "c,a,b" },
-{ "divl", 0x6c, "c,a,b" },
-{ "divl", 0x6d, "c,a,i" },
-{ "divrem", 0x6e, "c,a,b" },
-{ "divrem", 0x6f, "c,a,i" },
-{ "dmac", 0xd9, "F,C,a,b" },
-{ "dmsm", 0xdb, "c,a,b" },
-{ "dmul", 0xf5, "c,a,b" },
-{ "dsub", 0xf3, "c,a,b" },
-{ "emulate", 0xd7, "v,a,b" },
-{ "exbyte", 0x0a, "c,a,b" },
-{ "exbyte", 0x0b, "c,a,i" },
-{ "exhw", 0x7c, "c,a,b" },
-{ "exhw", 0x7d, "c,a,i" },
-{ "exhws", 0x7e, "c,a" },
-{ "extract", 0x7a, "c,a,b" },
-{ "extract", 0x7b, "c,a,i" },
-{ "fadd", 0xf0, "c,a,b" },
-{ "fdiv", 0xf6, "c,a,b" },
-{ "fdmul", 0xf9, "c,a,b" },
-{ "feq", 0xea, "c,a,b" },
-{ "fge", 0xee, "c,a,b" },
-{ "fgt", 0xec, "c,a,b" },
-{ "fmac", 0xd8, "F,C,a,b" },
-{ "fmsm", 0xda, "c,a,b" },
-{ "fmul", 0xf4, "c,a,b" },
-{ "fsub", 0xf2, "c,a,b" },
-{ "halt", 0x89, "" },
-{ "inbyte", 0x0c, "c,a,b" },
-{ "inbyte", 0x0d, "c,a,i" },
-{ "inhw", 0x78, "c,a,b" },
-{ "inhw", 0x79, "c,a,i" },
-{ "inv", 0x9f, "" },
-{ "iret", 0x88, "" },
-{ "iretinv", 0x8c, "" },
-{ "jmp", 0xa0, "P" },
-{ "jmp", 0xa1, "A" },
-{ "jmpf", 0xa4, "a,P" },
-{ "jmpf", 0xa5, "a,A" },
-{ "jmpfdec", 0xb4, "a,P" },
-{ "jmpfdec", 0xb5, "a,A" },
-{ "jmpfi", 0xc4, "a,b" },
-{ "jmpi", 0xc0, "b" },
-{ "jmpt", 0xac, "a,P" },
-{ "jmpt", 0xad, "a,A" },
-{ "jmpti", 0xcc, "a,b" },
-{ "load", 0x16, "e,n,a,b" },
-{ "load", 0x17, "e,n,a,i" },
-{ "loadl", 0x06, "e,n,a,b" },
-{ "loadl", 0x07, "e,n,a,i" },
-{ "loadm", 0x36, "e,n,a,b" },
-{ "loadm", 0x37, "e,n,a,i" },
-{ "loadset", 0x26, "e,n,a,b" },
-{ "loadset", 0x27, "e,n,a,i" },
-{ "mfacc", 0xe9, "c,d,f" },
-{ "mfsr", 0xc6, "c,s" },
-{ "mftlb", 0xb6, "c,a" },
-{ "mtacc", 0xe8, "a,d,f" },
-{ "mtsr", 0xce, "s,b" },
-{ "mtsrim", 0x04, "s,x" },
-{ "mttlb", 0xbe, "a,b" },
-{ "mul", 0x64, "c,a,b" },
-{ "mul", 0x65, "c,a,i" },
-{ "mull", 0x66, "c,a,b" },
-{ "mull", 0x67, "c,a,i" },
-{ "multiplu", 0xe2, "c,a,b" },
-{ "multiply", 0xe0, "c,a,b" },
-{ "multm", 0xde, "c,a,b" },
-{ "multmu", 0xdf, "c,a,b" },
-{ "mulu", 0x74, "c,a,b" },
-{ "mulu", 0x75, "c,a,i" },
-{ "nand", 0x9a, "c,a,b" },
-{ "nand", 0x9b, "c,a,i" },
-{ "nor", 0x98, "c,a,b" },
-{ "nor", 0x99, "c,a,i" },
-{ "or", 0x92, "c,a,b" },
-{ "or", 0x93, "c,a,i" },
-{ "orn", 0xaa, "c,a,b" },
-{ "orn", 0xab, "c,a,i" },
-
-/* The description of "setip" in Chapter 8 ("instruction set") of the user's
- manual claims that these are absolute register numbers. But section
- 7.2.1 explains that they are not. The latter is correct, so print
- these normally ("lr0", "lr5", etc.). */
-{ "setip", 0x9e, "c,a,b" },
-
-{ "sll", 0x80, "c,a,b" },
-{ "sll", 0x81, "c,a,i" },
-{ "sqrt", 0xe5, "c,a,f" },
-{ "sra", 0x86, "c,a,b" },
-{ "sra", 0x87, "c,a,i" },
-{ "srl", 0x82, "c,a,b" },
-{ "srl", 0x83, "c,a,i" },
-{ "store", 0x1e, "e,n,a,b" },
-{ "store", 0x1f, "e,n,a,i" },
-{ "storel", 0x0e, "e,n,a,b" },
-{ "storel", 0x0f, "e,n,a,i" },
-{ "storem", 0x3e, "e,n,a,b" },
-{ "storem", 0x3f, "e,n,a,i" },
-{ "sub", 0x24, "c,a,b" },
-{ "sub", 0x25, "c,a,i" },
-{ "subc", 0x2c, "c,a,b" },
-{ "subc", 0x2d, "c,a,i" },
-{ "subcs", 0x28, "c,a,b" },
-{ "subcs", 0x29, "c,a,i" },
-{ "subcu", 0x2a, "c,a,b" },
-{ "subcu", 0x2b, "c,a,i" },
-{ "subr", 0x34, "c,a,b" },
-{ "subr", 0x35, "c,a,i" },
-{ "subrc", 0x3c, "c,a,b" },
-{ "subrc", 0x3d, "c,a,i" },
-{ "subrcs", 0x38, "c,a,b" },
-{ "subrcs", 0x39, "c,a,i" },
-{ "subrcu", 0x3a, "c,a,b" },
-{ "subrcu", 0x3b, "c,a,i" },
-{ "subrs", 0x30, "c,a,b" },
-{ "subrs", 0x31, "c,a,i" },
-{ "subru", 0x32, "c,a,b" },
-{ "subru", 0x33, "c,a,i" },
-{ "subs", 0x20, "c,a,b" },
-{ "subs", 0x21, "c,a,i" },
-{ "subu", 0x22, "c,a,b" },
-{ "subu", 0x23, "c,a,i" },
-{ "xnor", 0x96, "c,a,b" },
-{ "xnor", 0x97, "c,a,i" },
-{ "xor", 0x94, "c,a,b" },
-{ "xor", 0x95, "c,a,i" }
-
-};
-
-#define NUM_OPCODES ((sizeof am29k_opcodes) / (sizeof am29k_opcodes[0]))
-
diff --git a/gdb/am29k-pinsn.c b/gdb/am29k-pinsn.c
deleted file mode 100644
index d0e18fc..0000000
--- a/gdb/am29k-pinsn.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* Instruction printing code for the AMD 29000
- Copyright (C) 1990 Free Software Foundation, Inc.
- Contributed by Cygnus Support. Written by Jim Kingdon.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "target.h"
-#include "am29k-opcode.h"
-
-/* Print a symbolic representation of a general-purpose
- register number NUM on STREAM.
- NUM is a number as found in the instruction, not as found in
- debugging symbols; it must be in the range 0-255. */
-static void
-print_general (num, stream)
- int num;
- FILE *stream;
-{
- if (num < 128)
- fprintf_filtered (stream, "gr%d", num);
- else
- fprintf_filtered (stream, "lr%d", num - 128);
-}
-
-/* Like print_general but a special-purpose register.
-
- The mnemonics used by the AMD assembler are not quite the same
- as the ones in the User's Manual. We use the ones that the
- assembler uses. */
-static void
-print_special (num, stream)
- int num;
- FILE *stream;
-{
- /* Register names of registers 0-SPEC0_NUM-1. */
- static char *spec0_names[] = {
- "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr",
- "pc0", "pc1", "pc2", "mmu", "lru"
- };
-#define SPEC0_NUM ((sizeof spec0_names) / (sizeof spec0_names[0]))
-
- /* Register names of registers 128-128+SPEC128_NUM-1. */
- static char *spec128_names[] = {
- "ipc", "ipa", "ipb", "q", "alu", "bp", "fc", "cr"
- };
-#define SPEC128_NUM ((sizeof spec128_names) / (sizeof spec128_names[0]))
-
- /* Register names of registers 160-160+SPEC160_NUM-1. */
- static char *spec160_names[] = {
- "fpe", "inte", "fps", "sr163", "exop"
- };
-#define SPEC160_NUM ((sizeof spec160_names) / (sizeof spec160_names[0]))
-
- if (num < SPEC0_NUM)
- fprintf_filtered (stream, spec0_names[num]);
- else if (num >= 128 && num < 128 + SPEC128_NUM)
- fprintf_filtered (stream, spec128_names[num-128]);
- else if (num >= 160 && num < 160 + SPEC160_NUM)
- fprintf_filtered (stream, spec160_names[num-160]);
- else
- fprintf_filtered (stream, "sr%d", num);
-}
-
-/* Is an instruction with OPCODE a delayed branch? */
-static int
-is_delayed_branch (opcode)
- int opcode;
-{
- return (opcode == 0xa8 || opcode == 0xa9 || opcode == 0xa0 || opcode == 0xa1
- || opcode == 0xa4 || opcode == 0xa5
- || opcode == 0xb4 || opcode == 0xb5
- || opcode == 0xc4 || opcode == 0xc0
- || opcode == 0xac || opcode == 0xad
- || opcode == 0xcc);
-}
-
-/* Now find the four bytes of INSN and put them in *INSN{0,8,16,24}.
- Note that the amd can be set up as either
- big or little-endian (the tm file says which) and we can't assume
- the host machine is the same. */
-static void
-find_bytes (insn, insn0, insn8, insn16, insn24)
- char *insn;
- unsigned char *insn0;
- unsigned char *insn8;
- unsigned char *insn16;
- unsigned char *insn24;
-{
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
- *insn24 = insn[0];
- *insn16 = insn[1];
- *insn8 = insn[2];
- *insn0 = insn[3];
-#else /* Little-endian. */
- *insn24 = insn[3];
- *insn16 = insn[2];
- *insn8 = insn[1];
- *insn0 = insn[0];
-#endif /* Little-endian. */
-}
-
-/* Print one instruction from MEMADDR on STREAM.
- Return the size of the instruction (always 4 on am29k). */
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- /* The raw instruction. */
- char insn[4];
-
- /* The four bytes of the instruction. */
- unsigned char insn24, insn16, insn8, insn0;
-
- struct am29k_opcode *opcode;
-
- read_memory (memaddr, &insn[0], 4);
-
- find_bytes (insn, &insn0, &insn8, &insn16, &insn24);
-
- /* Handle the nop (aseq 0x40,gr1,gr1) specially */
- if ((insn24==0x70) && (insn16==0x40) && (insn8==0x01) && (insn0==0x01)) {
- fprintf_filtered (stream,"nop");
- return 4;
- }
-
- /* The opcode is always in insn24. */
- for (opcode = &am29k_opcodes[0];
- opcode < &am29k_opcodes[NUM_OPCODES];
- ++opcode)
- {
- if (insn24 == opcode->opcode)
- {
- char *s;
-
- fprintf_filtered (stream, "%s ", opcode->name);
- for (s = opcode->args; *s != '\0'; ++s)
- {
- switch (*s)
- {
- case 'a':
- print_general (insn8, stream);
- break;
-
- case 'b':
- print_general (insn0, stream);
- break;
-
- case 'c':
- print_general (insn16, stream);
- break;
-
- case 'i':
- fprintf_filtered (stream, "%d", insn0);
- break;
-
- case 'x':
- fprintf_filtered (stream, "%d", (insn16 << 8) + insn0);
- break;
-
- case 'h':
- fprintf_filtered (stream, "0x%x",
- (insn16 << 24) + (insn0 << 16));
- break;
-
- case 'X':
- fprintf_filtered (stream, "%d",
- ((insn16 << 8) + insn0) | 0xffff0000);
- break;
-
- case 'P':
- /* This output looks just like absolute addressing, but
- maybe that's OK (it's what the GDB 68k and EBMON
- 29k disassemblers do). */
- /* All the shifting is to sign-extend it. p*/
- print_address
- (memaddr +
- (((int)((insn16 << 10) + (insn0 << 2)) << 14) >> 14),
- stream);
- break;
-
- case 'A':
- print_address ((insn16 << 10) + (insn0 << 2), stream);
- break;
-
- case 'e':
- fprintf_filtered (stream, "%d", insn16 >> 7);
- break;
-
- case 'n':
- fprintf_filtered (stream, "0x%x", insn16 & 0x7f);
- break;
-
- case 'v':
- fprintf_filtered (stream, "0x%x", insn16);
- break;
-
- case 's':
- print_special (insn8, stream);
- break;
-
- case 'u':
- fprintf_filtered (stream, "%d", insn0 >> 7);
- break;
-
- case 'r':
- fprintf_filtered (stream, "%d", (insn0 >> 4) & 7);
- break;
-
- case 'd':
- fprintf_filtered (stream, "%d", (insn0 >> 2) & 3);
- break;
-
- case 'f':
- fprintf_filtered (stream, "%d", insn0 & 3);
- break;
-
- case 'F':
- fprintf_filtered (stream, "%d", (insn16 >> 2) & 15);
- break;
-
- case 'C':
- fprintf_filtered (stream, "%d", insn16 & 3);
- break;
-
- default:
- fprintf_filtered (stream, "%c", *s);
- }
- }
-
- /* Now we look for a const,consth pair of instructions,
- in which case we try to print the symbolic address. */
- if (insn24 == 2) /* consth */
- {
- int errcode;
- char prev_insn[4];
- unsigned char prev_insn0, prev_insn8, prev_insn16, prev_insn24;
-
- errcode = target_read_memory (memaddr - 4,
- &prev_insn[0],
- 4);
- if (errcode == 0)
- {
- /* If it is a delayed branch, we need to look at the
- instruction before the delayed brach to handle
- things like
-
- const _foo
- call _printf
- consth _foo
- */
- find_bytes (prev_insn, &prev_insn0, &prev_insn8,
- &prev_insn16, &prev_insn24);
- if (is_delayed_branch (prev_insn24))
- {
- errcode = target_read_memory
- (memaddr - 8, &prev_insn[0], 4);
- find_bytes (prev_insn, &prev_insn0, &prev_insn8,
- &prev_insn16, &prev_insn24);
- }
- }
-
- /* If there was a problem reading memory, then assume
- the previous instruction was not const. */
- if (errcode == 0)
- {
- /* Is it const to the same register? */
- if (prev_insn24 == 3
- && prev_insn8 == insn8)
- {
- fprintf_filtered (stream, "\t; ");
- print_address (((insn16 << 24) + (insn0 << 16)
- + (prev_insn16 << 8) + (prev_insn0)),
- stream);
- }
- }
- }
-
- return 4;
- }
- }
- fprintf_filtered (stream, ".word 0x%8x",
- (insn24 << 24) + (insn16 << 16) + (insn8 << 8) + insn0);
- return 4;
-}
diff --git a/gdb/am29k-tdep.c b/gdb/am29k-tdep.c
deleted file mode 100644
index ce1fa85..0000000
--- a/gdb/am29k-tdep.c
+++ /dev/null
@@ -1,698 +0,0 @@
-/* Target-machine dependent code for the AMD 29000
- Copyright (C) 1990 Free Software Foundation, Inc.
- Contributed by Cygnus Support. Written by Jim Kingdon.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "gdbcore.h"
-#include <stdio.h>
-#include "frame.h"
-#include "value.h"
-#include "param.h"
-#include "symtab.h"
-#include "inferior.h"
-
-extern CORE_ADDR text_start; /* FIXME, kludge... */
-
-/* Structure to hold cached info about function prologues. */
-struct prologue_info
-{
- CORE_ADDR pc; /* First addr after fn prologue */
- unsigned rsize, msize; /* register stack frame size, mem stack ditto */
- unsigned mfp_used : 1; /* memory frame pointer used */
- unsigned rsize_valid : 1; /* Validity bits for the above */
- unsigned msize_valid : 1;
- unsigned mfp_valid : 1;
-};
-
-/* Examine the prologue of a function which starts at PC. Return
- the first addess past the prologue. If MSIZE is non-NULL, then
- set *MSIZE to the memory stack frame size. If RSIZE is non-NULL,
- then set *RSIZE to the register stack frame size (not including
- incoming arguments and the return address & frame pointer stored
- with them). If no prologue is found, *RSIZE is set to zero.
- If no prologue is found, or a prologue which doesn't involve
- allocating a memory stack frame, then set *MSIZE to zero.
-
- Note that both msize and rsize are in bytes. This is not consistent
- with the _User's Manual_ with respect to rsize, but it is much more
- convenient.
-
- If MFP_USED is non-NULL, *MFP_USED is set to nonzero if a memory
- frame pointer is being used. */
-CORE_ADDR
-examine_prologue (pc, rsize, msize, mfp_used)
- CORE_ADDR pc;
- unsigned *msize;
- unsigned *rsize;
- int *mfp_used;
-{
- long insn;
- CORE_ADDR p = pc;
- int misc_index = find_pc_misc_function (pc);
- struct prologue_info *mi = 0;
-
- if (misc_index >= 0)
- mi = (struct prologue_info *)misc_function_vector[misc_index].misc_info;
-
- if (mi != 0)
- {
- int valid = 1;
- if (rsize != NULL)
- {
- *rsize = mi->rsize;
- valid &= mi->rsize_valid;
- }
- if (msize != NULL)
- {
- *msize = mi->msize;
- valid &= mi->msize_valid;
- }
- if (mfp_used != NULL)
- {
- *mfp_used = mi->mfp_used;
- valid &= mi->mfp_valid;
- }
- if (valid)
- return mi->pc;
- }
-
- if (rsize != NULL)
- *rsize = 0;
- if (msize != NULL)
- *msize = 0;
- if (mfp_used != NULL)
- *mfp_used = 0;
-
- /* Prologue must start with subtracting a constant from gr1.
- Normally this is sub gr1,gr1,<rsize * 4>. */
- insn = read_memory_integer (p, 4);
- if ((insn & 0xffffff00) != 0x25010100)
- {
- /* If the frame is large, instead of a single instruction it
- might be a pair of instructions:
- const <reg>, <rsize * 4>
- sub gr1,gr1,<reg>
- */
- int reg;
- /* Possible value for rsize. */
- unsigned int rsize0;
-
- if ((insn & 0xff000000) != 0x03000000)
- {
- p = pc;
- goto done;
- }
- reg = (insn >> 8) & 0xff;
- rsize0 = (((insn >> 8) & 0xff00) | (insn & 0xff));
- p += 4;
- insn = read_memory_integer (p, 4);
- if ((insn & 0xffffff00) != 0x24010100
- || (insn & 0xff) != reg)
- {
- p = pc;
- goto done;
- }
- if (rsize != NULL)
- *rsize = rsize0;
- }
- else
- {
- if (rsize != NULL)
- *rsize = (insn & 0xff);
- }
- p += 4;
-
- /* Next instruction must be asgeu V_SPILL,gr1,rab. */
- insn = read_memory_integer (p, 4);
- if (insn != 0x5e40017e)
- {
- p = pc;
- goto done;
- }
- p += 4;
-
- /* Next instruction usually sets the frame pointer (lr1) by adding
- <size * 4> from gr1. However, this can (and high C does) be
- deferred until anytime before the first function call. So it is
- OK if we don't see anything which sets lr1. */
- /* Normally this is just add lr1,gr1,<size * 4>. */
- insn = read_memory_integer (p, 4);
- if ((insn & 0xffffff00) == 0x15810100)
- p += 4;
- else
- {
- /* However, for large frames it can be
- const <reg>, <size *4>
- add lr1,gr1,<reg>
- */
- int reg;
- CORE_ADDR q;
-
- if ((insn & 0xff000000) == 0x03000000)
- {
- reg = (insn >> 8) & 0xff;
- q = p + 4;
- insn = read_memory_integer (q, 4);
- if ((insn & 0xffffff00) == 0x14810100
- && (insn & 0xff) == reg)
- p = q;
- }
- }
-
- /* Next comes "add lr{<rsize-1>},msp,0", but only if a memory
- frame pointer is in use. We just check for add lr<anything>,msp,0;
- we don't check this rsize against the first instruction, and
- we don't check that the trace-back tag indicates a memory frame pointer
- is in use.
-
- The recommended instruction is actually "sll lr<whatever>,msp,0".
- We check for that, too. Originally Jim Kingdon's code seemed
- to be looking for a "sub" instruction here, but the mask was set
- up to lose all the time. */
- insn = read_memory_integer (p, 4);
- if (((insn & 0xff80ffff) == 0x15807d00) /* add */
- || ((insn & 0xff80ffff) == 0x81807d00) ) /* sll */
- {
- p += 4;
- if (mfp_used != NULL)
- *mfp_used = 1;
- }
-
- /* Next comes a subtraction from msp to allocate a memory frame,
- but only if a memory frame is
- being used. We don't check msize against the trace-back tag.
-
- Normally this is just
- sub msp,msp,<msize>
- */
- insn = read_memory_integer (p, 4);
- if ((insn & 0xffffff00) == 0x257d7d00)
- {
- p += 4;
- if (msize != NULL)
- *msize = insn & 0xff;
- }
- else
- {
- /* For large frames, instead of a single instruction it might
- be
-
- const <reg>, <msize>
- consth <reg>, <msize> ; optional
- sub msp,msp,<reg>
- */
- int reg;
- unsigned msize0;
- CORE_ADDR q = p;
-
- if ((insn & 0xff000000) == 0x03000000)
- {
- reg = (insn >> 8) & 0xff;
- msize0 = ((insn >> 8) & 0xff00) | (insn & 0xff);
- q += 4;
- insn = read_memory_integer (q, 4);
- /* Check for consth. */
- if ((insn & 0xff000000) == 0x02000000
- && (insn & 0x0000ff00) == reg)
- {
- msize0 |= (insn << 8) & 0xff000000;
- msize0 |= (insn << 16) & 0x00ff0000;
- q += 4;
- insn = read_memory_integer (q, 4);
- }
- /* Check for sub msp,msp,<reg>. */
- if ((insn & 0xffffff00) == 0x247d7d00
- && (insn & 0xff) == reg)
- {
- p = q + 4;
- if (msize != NULL)
- *msize = msize0;
- }
- }
- }
-
- done:
- if (misc_index >= 0)
- {
- if (mi == 0)
- {
- /* Add a new cache entry. */
- mi = (struct prologue_info *)xmalloc (sizeof (struct prologue_info));
- misc_function_vector[misc_index].misc_info = (char *)mi;
- mi->rsize_valid = 0;
- mi->msize_valid = 0;
- mi->mfp_valid = 0;
- }
- /* else, cache entry exists, but info is incomplete. */
- mi->pc = p;
- if (rsize != NULL)
- {
- mi->rsize = *rsize;
- mi->rsize_valid = 1;
- }
- if (msize != NULL)
- {
- mi->msize = *msize;
- mi->msize_valid = 1;
- }
- if (mfp_used != NULL)
- {
- mi->mfp_used = *mfp_used;
- mi->mfp_valid = 1;
- }
- }
- return p;
-}
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-CORE_ADDR
-skip_prologue (pc)
- CORE_ADDR pc;
-{
- return examine_prologue (pc, (unsigned *)NULL, (unsigned *)NULL,
- (int *)NULL);
-}
-
-/* Initialize the frame. In addition to setting "extra" frame info,
- we also set ->frame because we use it in a nonstandard way, and ->pc
- because we need to know it to get the other stuff. See the diagram
- of stacks and the frame cache in tm-29k.h for more detail. */
-static void
-init_frame_info (innermost_frame, fci)
- int innermost_frame;
- struct frame_info *fci;
-{
- CORE_ADDR p;
- long insn;
- unsigned rsize;
- unsigned msize;
- int mfp_used;
- struct symbol *func;
-
- p = fci->pc;
-
- if (innermost_frame)
- fci->frame = read_register (GR1_REGNUM);
- else
- fci->frame = fci->next_frame + fci->next->rsize;
-
-#if CALL_DUMMY_LOCATION == ON_STACK
- This wont work;
-#else
- if (PC_IN_CALL_DUMMY (p, 0, 0))
-#endif
- {
- fci->rsize = DUMMY_FRAME_RSIZE;
- /* This doesn't matter since we never try to get locals or args
- from a dummy frame. */
- fci->msize = 0;
- /* Dummy frames always use a memory frame pointer. */
- fci->saved_msp =
- read_register_stack_integer (fci->frame + DUMMY_FRAME_RSIZE - 4, 4);
- return;
- }
-
- func = find_pc_function (p);
- if (func != NULL)
- p = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
- else
- {
- /* Search backward to find the trace-back tag. However,
- do not trace back beyond the start of the text segment
- (just as a sanity check to avoid going into never-never land). */
- while (p >= text_start
- && ((insn = read_memory_integer (p, 4)) & 0xff000000) != 0)
- p -= 4;
-
- if (p < text_start)
- {
- /* Couldn't find the trace-back tag.
- Something strange is going on. */
- fci->saved_msp = 0;
- fci->rsize = 0;
- fci->msize = 0;
- return;
- }
- else
- /* Advance to the first word of the function, i.e. the word
- after the trace-back tag. */
- p += 4;
- }
- /* We've found the start of the function. Since High C interchanges
- the meanings of bits 23 and 22 (as of Jul 90), and we
- need to look at the prologue anyway to figure out
- what rsize is, ignore the contents of the trace-back tag. */
- examine_prologue (p, &rsize, &msize, &mfp_used);
- fci->rsize = rsize;
- fci->msize = msize;
- if (innermost_frame)
- {
- fci->saved_msp = read_register (MSP_REGNUM) + msize;
- }
- else
- {
- if (mfp_used)
- fci->saved_msp =
- read_register_stack_integer (fci->frame + rsize - 1, 4);
- else
- fci->saved_msp = fci->next->saved_msp + msize;
- }
-}
-
-void
-init_extra_frame_info (fci)
- struct frame_info *fci;
-{
- if (fci->next == 0)
- /* Assume innermost frame. May produce strange results for "info frame"
- but there isn't any way to tell the difference. */
- init_frame_info (1, fci);
- else {
- /* We're in get_prev_frame_info.
- Take care of everything in init_frame_pc. */
- ;
- }
-}
-
-void
-init_frame_pc (fromleaf, fci)
- int fromleaf;
- struct frame_info *fci;
-{
- fci->pc = (fromleaf ? SAVED_PC_AFTER_CALL (fci->next) :
- fci->next ? FRAME_SAVED_PC (fci->next) : read_pc ());
- init_frame_info (0, fci);
-}
-
-/* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their
- offsets being relative to the memory stack pointer (high C) or
- saved_msp (gcc). */
-
-CORE_ADDR
-frame_locals_address (fi)
- struct frame_info *fi;
-{
- struct block *b = block_for_pc (fi->pc);
- /* If compiled without -g, assume GCC. */
- if (b == NULL || BLOCK_GCC_COMPILED (b))
- return fi->saved_msp;
- else
- return fi->saved_msp - fi->msize;
-}
-
-/* Routines for reading the register stack. The caller gets to treat
- the register stack as a uniform stack in memory, from address $gr1
- straight through $rfb and beyond. */
-
-/* Analogous to read_memory except the length is understood to be 4.
- Also, myaddr can be NULL (meaning don't bother to read), and
- if actual_mem_addr is non-NULL, store there the address that it
- was fetched from (or if from a register the offset within
- registers). Set *LVAL to lval_memory or lval_register, depending
- on where it came from. */
-void
-read_register_stack (memaddr, myaddr, actual_mem_addr, lval)
- CORE_ADDR memaddr;
- char *myaddr;
- CORE_ADDR *actual_mem_addr;
- enum lval_type *lval;
-{
- long rfb = read_register (RFB_REGNUM);
- long rsp = read_register (RSP_REGNUM);
- if (memaddr < rfb)
- {
- /* It's in a register. */
- int regnum = (memaddr - rsp) / 4 + LR0_REGNUM;
- if (regnum < LR0_REGNUM || regnum > LR0_REGNUM + 127)
- error ("Attempt to read register stack out of range.");
- if (myaddr != NULL)
- read_register_gen (regnum, myaddr);
- if (lval != NULL)
- *lval = lval_register;
- if (actual_mem_addr != NULL)
- *actual_mem_addr = REGISTER_BYTE (regnum);
- }
- else
- {
- /* It's in the memory portion of the register stack. */
- if (myaddr != NULL)
- read_memory (memaddr, myaddr, 4);
- if (lval != NULL)
- *lval = lval_memory;
- if (actual_mem_addr != NULL)
- *actual_mem_addr = memaddr;
- }
-}
-
-/* Analogous to read_memory_integer
- except the length is understood to be 4. */
-long
-read_register_stack_integer (memaddr, len)
- CORE_ADDR memaddr;
- int len;
-{
- long buf;
- read_register_stack (memaddr, &buf, NULL, NULL);
- SWAP_TARGET_AND_HOST (&buf, 4);
- return buf;
-}
-
-/* Copy 4 bytes from GDB memory at MYADDR into inferior memory
- at MEMADDR and put the actual address written into in
- *ACTUAL_MEM_ADDR. */
-static void
-write_register_stack (memaddr, myaddr, actual_mem_addr)
- CORE_ADDR memaddr;
- char *myaddr;
- CORE_ADDR *actual_mem_addr;
-{
- long rfb = read_register (RFB_REGNUM);
- long rsp = read_register (RSP_REGNUM);
- if (memaddr < rfb)
- {
- /* It's in a register. */
- int regnum = (memaddr - rsp) / 4 + LR0_REGNUM;
- if (regnum < LR0_REGNUM || regnum > LR0_REGNUM + 127)
- error ("Attempt to read register stack out of range.");
- if (myaddr != NULL)
- write_register (regnum, *(long *)myaddr);
- if (actual_mem_addr != NULL)
- *actual_mem_addr = NULL;
- }
- else
- {
- /* It's in the memory portion of the register stack. */
- if (myaddr != NULL)
- write_memory (memaddr, myaddr, 4);
- if (actual_mem_addr != NULL)
- *actual_mem_addr = memaddr;
- }
-}
-
-/* Find register number REGNUM relative to FRAME and put its
- (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable
- was optimized out (and thus can't be fetched). If the variable
- was fetched from memory, set *ADDRP to where it was fetched from,
- otherwise it was fetched from a register.
-
- The argument RAW_BUFFER must point to aligned memory. */
-void
-get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp)
- char *raw_buffer;
- int *optimized;
- CORE_ADDR *addrp;
- FRAME frame;
- int regnum;
- enum lval_type *lvalp;
-{
- struct frame_info *fi = get_frame_info (frame);
- CORE_ADDR addr;
- enum lval_type lval;
-
- /* Once something has a register number, it doesn't get optimized out. */
- if (optimized != NULL)
- *optimized = 0;
- if (regnum == RSP_REGNUM)
- {
- if (raw_buffer != NULL)
- *(CORE_ADDR *)raw_buffer = fi->frame;
- if (lvalp != NULL)
- *lvalp = not_lval;
- return;
- }
- else if (regnum == PC_REGNUM)
- {
- if (raw_buffer != NULL)
- *(CORE_ADDR *)raw_buffer = fi->pc;
-
- /* Not sure we have to do this. */
- if (lvalp != NULL)
- *lvalp = not_lval;
-
- return;
- }
- else if (regnum == MSP_REGNUM)
- {
- if (raw_buffer != NULL)
- {
- if (fi->next != NULL)
- *(CORE_ADDR *)raw_buffer = fi->next->saved_msp;
- else
- *(CORE_ADDR *)raw_buffer = read_register (MSP_REGNUM);
- }
- /* The value may have been computed, not fetched. */
- if (lvalp != NULL)
- *lvalp = not_lval;
- return;
- }
- else if (regnum < LR0_REGNUM || regnum >= LR0_REGNUM + 128)
- {
- /* These registers are not saved over procedure calls,
- so just print out the current values. */
- if (raw_buffer != NULL)
- *(CORE_ADDR *)raw_buffer = read_register (regnum);
- if (lvalp != NULL)
- *lvalp = lval_register;
- if (addrp != NULL)
- *addrp = REGISTER_BYTE (regnum);
- return;
- }
-
- addr = fi->frame + (regnum - LR0_REGNUM) * 4;
- if (raw_buffer != NULL)
- read_register_stack (addr, raw_buffer, &addr, &lval);
- if (lvalp != NULL)
- *lvalp = lval;
- if (addrp != NULL)
- *addrp = addr;
-}
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-
-void
-pop_frame ()
-{
- FRAME frame = get_current_frame ();
- struct frame_info *fi = get_frame_info (frame);
- CORE_ADDR rfb = read_register (RFB_REGNUM);
- CORE_ADDR gr1 = fi->frame + fi->rsize;
- CORE_ADDR lr1;
- CORE_ADDR ret_addr;
- int i;
-
- /* If popping a dummy frame, need to restore registers. */
- if (PC_IN_CALL_DUMMY (read_register (PC_REGNUM),
- read_register (SP_REGNUM),
- FRAME_FP (fi)))
- {
- for (i = 0; i < DUMMY_SAVE_SR128; ++i)
- write_register
- (SR_REGNUM (i + 128),
- read_register (LR0_REGNUM + DUMMY_ARG / 4 + i));
- for (i = 0; i < DUMMY_SAVE_GREGS; ++i)
- write_register
- (RETURN_REGNUM + i,
- read_register (LR0_REGNUM + DUMMY_ARG / 4 + DUMMY_SAVE_SR128 + i));
- }
-
- /* Restore the memory stack pointer. */
- write_register (MSP_REGNUM, fi->saved_msp);
- /* Restore the register stack pointer. */
- write_register (GR1_REGNUM, gr1);
- /* Check whether we need to fill registers. */
- lr1 = read_register (LR0_REGNUM + 1);
- if (lr1 > rfb)
- {
- /* Fill. */
- int num_bytes = lr1 - rfb;
- int i;
- long word;
- write_register (RAB_REGNUM, read_register (RAB_REGNUM) + num_bytes);
- write_register (RFB_REGNUM, lr1);
- for (i = 0; i < num_bytes; i += 4)
- {
- /* Note: word is in host byte order. */
- word = read_memory_integer (rfb + i, 4);
- write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word);
- }
- }
- ret_addr = read_register (LR0_REGNUM);
- write_register (PC_REGNUM, ret_addr);
- write_register (NPC_REGNUM, ret_addr + 4);
- flush_cached_frames ();
- set_current_frame (create_new_frame (0, read_pc()));
-}
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-void
-push_dummy_frame ()
-{
- long w;
- CORE_ADDR rab, gr1;
- CORE_ADDR msp = read_register (MSP_REGNUM);
- int i;
-
- /* Save the PC. */
- write_register (LR0_REGNUM, read_register (PC_REGNUM));
-
- /* Allocate the new frame. */
- gr1 = read_register (GR1_REGNUM) - DUMMY_FRAME_RSIZE;
- write_register (GR1_REGNUM, gr1);
-
- rab = read_register (RAB_REGNUM);
- if (gr1 < rab)
- {
- /* We need to spill registers. */
- int num_bytes = rab - gr1;
- CORE_ADDR rfb = read_register (RFB_REGNUM);
- int i;
- long word;
-
- write_register (RFB_REGNUM, rfb - num_bytes);
- write_register (RAB_REGNUM, gr1);
- for (i = 0; i < num_bytes; i += 4)
- {
- /* Note: word is in target byte order. */
- read_register_gen (LR0_REGNUM + i / 4, &word, 4);
- write_memory (rfb - num_bytes + i, &word, 4);
- }
- }
-
- /* There are no arguments in to the dummy frame, so we don't need
- more than rsize plus the return address and lr1. */
- write_register (LR0_REGNUM + 1, gr1 + DUMMY_FRAME_RSIZE + 2 * 4);
-
- /* Set the memory frame pointer. */
- write_register (LR0_REGNUM + DUMMY_FRAME_RSIZE / 4 - 1, msp);
-
- /* Allocate arg_slop. */
- write_register (MSP_REGNUM, msp - 16 * 4);
-
- /* Save registers. */
- for (i = 0; i < DUMMY_SAVE_SR128; ++i)
- write_register (LR0_REGNUM + DUMMY_ARG / 4 + i,
- read_register (SR_REGNUM (i + 128)));
- for (i = 0; i < DUMMY_SAVE_GREGS; ++i)
- write_register (LR0_REGNUM + DUMMY_ARG / 4 + DUMMY_SAVE_SR128 + i,
- read_register (RETURN_REGNUM + i));
-}
diff --git a/gdb/ansidecl.h b/gdb/ansidecl.h
deleted file mode 100755
index aecdb5e..0000000
--- a/gdb/ansidecl.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Copyright (C) 1989 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* ANSI and traditional C compatibility macros
-
- ANSI C is assumed if __STDC__ is #defined.
-
- Macros
- PTR - Generic pointer type
- LONG_DOUBLE - `long double' type
- CONST - `const' keyword
- VOLATILE - `volatile' keyword
- SIGNED - `signed' keyword
- PTRCONST - Generic const pointer (void *const)
-
- EXFUN(name, prototype) - declare external function NAME
- with prototype PROTOTYPE
- DEFUN(name, arglist, args) - define function NAME with
- args ARGLIST of types in ARGS
- DEFUN_VOID(name) - define function NAME with no args
- AND - argument separator for ARGS
- NOARGS - null arglist
- DOTS - `...' in args
-
- For example:
- extern int EXFUN(printf, (CONST char *format DOTS));
- int DEFUN(fprintf, (stream, format),
- FILE *stream AND CONST char *format DOTS) { ... }
- void DEFUN_VOID(abort) { ... }
-*/
-
-#ifndef _ANSIDECL_H
-
-#define _ANSIDECL_H 1
-
-
-/* Every source file includes this file,
- so they will all get the switch for lint. */
-/* LINTLIBRARY */
-
-
-#ifdef __STDC__
-
-#define PTR void *
-#define PTRCONST void *CONST
-#define LONG_DOUBLE long double
-
-#define AND ,
-#define NOARGS void
-#define CONST const
-#define VOLATILE volatile
-#define SIGNED signed
-#define DOTS , ...
-
-#define EXFUN(name, proto) name proto
-#define DEFUN(name, arglist, args) name(args)
-#define DEFUN_VOID(name) name(NOARGS)
-
-#else /* Not ANSI C. */
-
-#define PTR char *
-#define PTRCONST PTR
-#define LONG_DOUBLE double
-
-#define AND ;
-#define NOARGS
-#define CONST
-#define VOLATILE
-#define SIGNED
-#define DOTS
-
-#define EXFUN(name, proto) name()
-#define DEFUN(name, arglist, args) name arglist args;
-#define DEFUN_VOID(name) name()
-
-#endif /* ANSI C. */
-
-
-#endif /* ansidecl.h */
diff --git a/gdb/arm-convert.s b/gdb/arm-convert.s
deleted file mode 100644
index 416132b..0000000
--- a/gdb/arm-convert.s
+++ /dev/null
@@ -1,16 +0,0 @@
- .text
- .global _convert_from_extended
-
-_convert_from_extended:
-
- ldfe f0,[a1]
- stfd f0,[a2]
- movs pc,lr
-
- .global _convert_to_extended
-
-_convert_to_extended:
-
- ldfd f0,[a1]
- stfe f0,[a2]
- movs pc,lr
diff --git a/gdb/arm-opcode.h b/gdb/arm-opcode.h
deleted file mode 100755
index d27a54e..0000000
--- a/gdb/arm-opcode.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/* ARM opcode list.
- Copyright (C) 1989, Free Software Foundation, Inc.
-
-This file is part of GDB and GAS.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* types of instruction (encoded in bits 26 and 27 of the instruction) */
-
-#define TYPE_ARITHMETIC 0
-#define TYPE_LDR_STR 1
-#define TYPE_BLOCK_BRANCH 2
-#define TYPE_SWI 3
-
-/* bit 25 decides whether an instruction is a block move or a branch */
-#define SUBTYPE_BLOCK 0
-#define SUBTYPE_BRANCH 1
-
-/* codes to distinguish the arithmetic instructions */
-
-#define OPCODE_AND 0
-#define OPCODE_EOR 1
-#define OPCODE_SUB 2
-#define OPCODE_RSB 3
-#define OPCODE_ADD 4
-#define OPCODE_ADC 5
-#define OPCODE_SBC 6
-#define OPCODE_RSC 7
-#define OPCODE_TST 8
-#define OPCODE_TEQ 9
-#define OPCODE_CMP 10
-#define OPCODE_CMN 11
-#define OPCODE_ORR 12
-#define OPCODE_MOV 13
-#define OPCODE_BIC 14
-#define OPCODE_MVN 15
-
-/* condition codes */
-
-#define COND_EQ 0
-#define COND_NE 1
-#define COND_CS 2
-#define COND_CC 3
-#define COND_MI 4
-#define COND_PL 5
-#define COND_VS 6
-#define COND_VC 7
-#define COND_HI 8
-#define COND_LS 9
-#define COND_GE 10
-#define COND_LT 11
-#define COND_GT 12
-#define COND_LE 13
-#define COND_AL 14
-#define COND_NV 15
-
-/* Describes the format of an ARM machine instruction */
-
-struct generic_fmt {
- unsigned rest :25; /* the rest of the instruction */
- unsigned subtype :1; /* used to decide between block and branch */
- unsigned type :2; /* one of TYPE_* */
- unsigned cond :4; /* one of COND_* defined above */
-};
-
-struct arith_fmt {
- unsigned operand2 :12; /* #nn or rn or rn shift #m or rn shift rm */
- unsigned dest :4; /* place where the answer goes */
- unsigned operand1 :4; /* first operand to instruction */
- unsigned set :1; /* == 1 means set processor flags */
- unsigned opcode :4; /* one of OPCODE_* defined above */
- unsigned immed :1; /* operand2 is an immediate value */
- unsigned type :2; /* == TYPE_ARITHMETIC */
- unsigned cond :4; /* one of COND_* defined above */
-};
-
-struct ldr_str_fmt {
- unsigned offset :12; /* #nn or rn or rn shift #m */
- unsigned reg :4; /* destination for LDR, source for STR */
- unsigned base :4; /* base register */
- unsigned is_load :1; /* == 1 for LDR */
- unsigned writeback :1; /* == 1 means write back (base+offset) into base */
- unsigned byte :1; /* == 1 means byte access else word */
- unsigned up :1; /* == 1 means add offset else subtract it */
- unsigned pre_index :1; /* == 1 means [a,b] form else [a],b form */
- unsigned immed :1; /* == 0 means immediate offset */
- unsigned type :2; /* == TYPE_LDR_STR */
- unsigned cond :4; /* one of COND_* defined above */
-};
-
-struct block_fmt {
- unsigned mask :16; /* register mask */
- unsigned base :4; /* register used as base of move */
- unsigned is_load :1; /* == 1 for LDM */
- unsigned writeback :1; /* == 1 means update base after move */
- unsigned set :1; /* == 1 means set flags in pc if included in mask */
- unsigned increment :1; /* == 1 means increment base register */
- unsigned before :1; /* == 1 means inc/dec before each move */
- unsigned is_block :1; /* == SUBTYPE_BLOCK */
- unsigned type :2; /* == TYPE_BLOCK_BRANCH */
- unsigned cond :4; /* one of COND_* defined above */
-};
-
-struct branch_fmt {
- unsigned dest :24; /* destination of the branch */
- unsigned link :1; /* branch with link (function call) */
- unsigned is_branch :1; /* == SUBTYPE_BRANCH */
- unsigned type :2; /* == TYPE_BLOCK_BRANCH */
- unsigned cond :4; /* one of COND_* defined above */
-};
-
-#define ROUND_N 0
-#define ROUND_P 1
-#define ROUND_M 2
-#define ROUND_Z 3
-
-#define FLOAT2_MVF 0
-#define FLOAT2_MNF 1
-#define FLOAT2_ABS 2
-#define FLOAT2_RND 3
-#define FLOAT2_SQT 4
-#define FLOAT2_LOG 5
-#define FLOAT2_LGN 6
-#define FLOAT2_EXP 7
-#define FLOAT2_SIN 8
-#define FLOAT2_COS 9
-#define FLOAT2_TAN 10
-#define FLOAT2_ASN 11
-#define FLOAT2_ACS 12
-#define FLOAT2_ATN 13
-
-#define FLOAT3_ADF 0
-#define FLOAT3_MUF 1
-#define FLOAT3_SUF 2
-#define FLOAT3_RSF 3
-#define FLOAT3_DVF 4
-#define FLOAT3_RDF 5
-#define FLOAT3_POW 6
-#define FLOAT3_RPW 7
-#define FLOAT3_RMF 8
-#define FLOAT3_FML 9
-#define FLOAT3_FDV 10
-#define FLOAT3_FRD 11
-#define FLOAT3_POL 12
-
-struct float2_fmt {
- unsigned operand2 :3; /* second operand */
- unsigned immed :1; /* == 1 if second operand is a constant */
- unsigned pad1 :1; /* == 0 */
- unsigned rounding :2; /* ROUND_* */
- unsigned is_double :1; /* == 1 if precision is double (only if not extended) */
- unsigned pad2 :4; /* == 1 */
- unsigned dest :3; /* destination */
- unsigned is_2_op :1; /* == 1 if 2 operand ins */
- unsigned operand1 :3; /* first operand (only of is_2_op == 0) */
- unsigned is_extended :1; /* == 1 if precision is extended */
- unsigned opcode :4; /* FLOAT2_* or FLOAT3_* depending on is_2_op */
- unsigned must_be_2 :2; /* == 2 */
- unsigned type :2; /* == TYPE_SWI */
- unsigned cond :4; /* COND_* */
-};
-
-struct swi_fmt {
- unsigned argument :24; /* argument to SWI (syscall number) */
- unsigned must_be_3 :2; /* == 3 */
- unsigned type :2; /* == TYPE_SWI */
- unsigned cond :4; /* one of COND_* defined above */
-};
-
-union insn_fmt {
- struct generic_fmt generic;
- struct arith_fmt arith;
- struct ldr_str_fmt ldr_str;
- struct block_fmt block;
- struct branch_fmt branch;
- struct swi_fmt swi;
- unsigned long ins;
-};
-
-struct opcode {
- unsigned long value, mask; /* recognise instruction if (op&mask)==value */
- char *assembler; /* how to disassemble this instruction */
-};
-
-/* format of the assembler string :
-
- %% %
- %<bitfield>d print the bitfield in decimal
- %<bitfield>x print the bitfield in hex
- %<bitfield>r print as an ARM register
- %<bitfield>f print a floating point constant if >7 else an fp register
- %c print condition code (always bits 28-31)
- %P print floating point precision in arithmetic insn
- %Q print floating point precision in ldf/stf insn
- %R print floating point rounding mode
- %<bitnum>'c print specified char iff bit is one
- %<bitnum>`c print specified char iff bit is zero
- %<bitnum>?ab print a if bit is one else print b
- %p print 'p' iff bits 12-15 are 15
- %o print operand2 (immediate or register + shift)
- %a print address for ldr/str instruction
- %b print branch destination
- %A print address for ldc/stc/ldf/stf instruction
- %m print register mask for ldm/stm instruction
-*/
-
-static struct opcode opcodes[] = {
- /* ARM instructions */
- 0x00000090, 0x0fe000f0, "mul%20's %12-15r, %16-19r, %0-3r",
- 0x00200090, 0x0fe000f0, "mla%20's %12-15r, %16-19r, %0-3r, %8-11r",
- 0x00000000, 0x0de00000, "and%c%20's %12-15r, %16-19r, %o",
- 0x00200000, 0x0de00000, "eor%c%20's %12-15r, %16-19r, %o",
- 0x00400000, 0x0de00000, "sub%c%20's %12-15r, %16-19r, %o",
- 0x00600000, 0x0de00000, "rsb%c%20's %12-15r, %16-19r, %o",
- 0x00800000, 0x0de00000, "add%c%20's %12-15r, %16-19r, %o",
- 0x00a00000, 0x0de00000, "adc%c%20's %12-15r, %16-19r, %o",
- 0x00c00000, 0x0de00000, "sbc%c%20's %12-15r, %16-19r, %o",
- 0x00e00000, 0x0de00000, "rsc%c%20's %12-15r, %16-19r, %o",
- 0x01000000, 0x0de00000, "tst%c%p %16-19r, %o",
- 0x01200000, 0x0de00000, "teq%c%p %16-19r, %o",
- 0x01400000, 0x0de00000, "cmp%c%p %16-19r, %o",
- 0x01600000, 0x0de00000, "cmn%c%p %16-19r, %o",
- 0x01800000, 0x0de00000, "orr%c%20's %12-15r, %16-19r, %o",
- 0x01a00000, 0x0de00000, "mov%c%20's %12-15r, %o",
- 0x01c00000, 0x0de00000, "bic%c%20's %12-15r, %16-19r, %o",
- 0x01e00000, 0x0de00000, "mvn%c%20's %12-15r, %o",
- 0x04000000, 0x0c100000, "str%c%22'b %12-15r, %a",
- 0x04100000, 0x0c100000, "ldr%c%22'b %12-15r, %a",
- 0x08000000, 0x0e100000, "stm%c%23?id%24?ba %16-19r%22`!, %m",
- 0x08100000, 0x0e100000, "ldm%c%23?id%24?ba %16-19r%22`!, %m%22'^",
- 0x0a000000, 0x0e000000, "b%c%24'l %b",
- 0x0f000000, 0x0f000000, "swi%c %0-23x",
- /* Floating point coprocessor instructions */
- 0x0e000100, 0x0ff08f10, "adf%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e100100, 0x0ff08f10, "muf%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e200100, 0x0ff08f10, "suf%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e300100, 0x0ff08f10, "rsf%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e400100, 0x0ff08f10, "dvf%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e500100, 0x0ff08f10, "rdf%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e600100, 0x0ff08f10, "pow%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e700100, 0x0ff08f10, "rpw%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e800100, 0x0ff08f10, "rmf%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e900100, 0x0ff08f10, "fml%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0ea00100, 0x0ff08f10, "fdv%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0eb00100, 0x0ff08f10, "frd%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0ec00100, 0x0ff08f10, "pol%c%P%R %12-14f, %16-18f, %0-3f",
- 0x0e008100, 0x0ff08f10, "mvf%c%P%R %12-14f, %0-3f",
- 0x0e108100, 0x0ff08f10, "mnf%c%P%R %12-14f, %0-3f",
- 0x0e208100, 0x0ff08f10, "abs%c%P%R %12-14f, %0-3f",
- 0x0e308100, 0x0ff08f10, "rnd%c%P%R %12-14f, %0-3f",
- 0x0e408100, 0x0ff08f10, "sqt%c%P%R %12-14f, %0-3f",
- 0x0e508100, 0x0ff08f10, "log%c%P%R %12-14f, %0-3f",
- 0x0e608100, 0x0ff08f10, "lgn%c%P%R %12-14f, %0-3f",
- 0x0e708100, 0x0ff08f10, "exp%c%P%R %12-14f, %0-3f",
- 0x0e808100, 0x0ff08f10, "sin%c%P%R %12-14f, %0-3f",
- 0x0e908100, 0x0ff08f10, "cos%c%P%R %12-14f, %0-3f",
- 0x0ea08100, 0x0ff08f10, "tan%c%P%R %12-14f, %0-3f",
- 0x0eb08100, 0x0ff08f10, "asn%c%P%R %12-14f, %0-3f",
- 0x0ec08100, 0x0ff08f10, "acs%c%P%R %12-14f, %0-3f",
- 0x0ed08100, 0x0ff08f10, "atn%c%P%R %12-14f, %0-3f",
- 0x0e000110, 0x0ff00f1f, "flt%c%P%R %16-18f, %12-15r",
- 0x0e100110, 0x0fff0f98, "fix%c%R %12-15r, %0-2f",
- 0x0e200110, 0x0fff0fff, "wfs%c %12-15r",
- 0x0e300110, 0x0fff0fff, "rfs%c %12-15r",
- 0x0e400110, 0x0fff0fff, "wfc%c %12-15r",
- 0x0e500110, 0x0fff0fff, "rfc%c %12-15r",
- 0x0e90f110, 0x0ff8fff0, "cmf%c %16-18f, %0-3f",
- 0x0eb0f110, 0x0ff8fff0, "cnf%c %16-18f, %0-3f",
- 0x0ed0f110, 0x0ff8fff0, "cmfe%c %16-18f, %0-3f",
- 0x0ef0f110, 0x0ff8fff0, "cnfe%c %16-18f, %0-3f",
- 0x0c000100, 0x0e100f00, "stf%c%Q %12-14f, %A",
- 0x0c100100, 0x0e100f00, "ldf%c%Q %12-14f, %A",
- /* Generic coprocessor instructions */
- 0x0e000000, 0x0f000010, "cdp%c %8-11d, %20-23d, cr%12-15d, cr%16-19d, cr%0-3d, {%5-7d}",
- 0x0e000010, 0x0f100010, "mrc%c %8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, {%5-7d}",
- 0x0e100010, 0x0f100010, "mcr%c %8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, {%5-7d}",
- 0x0c000000, 0x0e100000, "stc%c%22`l %8-11d, cr%12-15d, %A",
- 0x0c100000, 0x0e100000, "ldc%c%22`l %8-11d, cr%12-15d, %A",
- /* the rest */
- 0x00000000, 0x00000000, "undefined instruction %0-31x",
-};
-#define N_OPCODES (sizeof opcodes / sizeof opcodes[0])
diff --git a/gdb/arm-pinsn.c b/gdb/arm-pinsn.c
deleted file mode 100644
index 5da7997..0000000
--- a/gdb/arm-pinsn.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/* Print ARM instructions for GDB, the GNU debugger.
- Copyright (C) 1986, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "arm-opcode.h"
-
-extern char *reg_names[];
-
-static char *shift_names[] = {
- "lsl", "lsr", "asr", "ror",
-};
-
-static char *cond_names[] = {
- "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
- "hi", "ls", "ge", "lt", "gt", "le", "", "nv"
-};
-
-static char float_precision[] = "sdep";
-static char float_rounding[] = " pmz";
-static float float_immed[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 0.5, 10.0 };
-
-static void print_ldr_str_offset();
-static void print_ldc_stc_offset();
-static long immediate_value();
-
-/* Print the ARM instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned long ins;
- register struct opcode *op;
- register char *p;
- register int i, c;
- int s, e, val;
-
- ins = read_memory_integer(memaddr, 4);
- for (i = 0, op = opcodes; i < N_OPCODES; i++, op++)
- if ((ins & op->mask) == op->value) break;
- assert(i != N_OPCODES);
-
- for (p = op->assembler; *p;) {
- c = *p++;
- if (c == '%') {
- s = e = 0;
- while (isdigit(*p))
- s = s*10 + (*p++ - '0');
- if (*p == '-') {
- p++;
- while (isdigit(*p))
- e = e*10 + (*p++ - '0');
- } else
- e = s;
- assert(s >= 0 && s <= 31 && e >= 0 && e <= 31);
- val = (ins >> s) & ((1 << (e + 1 - s)) - 1);
- switch (*p++) {
- case '%' :
- putc('%', stream);
- break;
- case 'd' :
- fprintf(stream, "%d", val);
- break;
- case 'x' :
- fprintf(stream, "%x", val);
- break;
- case 'r' :
- assert(val >= 0 && val <= 15);
- fprintf(stream, "%s", reg_names[val]);
- break;
- case 'c' :
- fprintf(stream, "%s", cond_names[ins >> 28]);
- break;
- case '\'' :
- assert(*p);
- c = *p++;
- if (val)
- putc(c, stream);
- break;
- case '`' :
- assert(*p);
- c = *p++;
- if (!val)
- putc(c, stream);
- break;
- case '?' :
- assert(*p);
- c = *p++;
- assert(*p);
- if (val)
- p++;
- else
- c = *p++;
- putc(c, stream);
- break;
- case 'p' :
- if (((ins >> 12) & 0xf) == 0xf)
- putc('p', stream);
- break;
- case 'o' :
- if (ins & (1<<25)) {
- int immed = immediate_value(ins & 0xfff);
- fprintf (stream, "#%d (0x%x)", immed, immed);
- } else {
- int operand2 = ins & 0xfff;
- /* in operand2 :
- bits 0-3 are the base register
- bits 5-6 are the shift (0=lsl, 1=lsr, 2=asr, 3=ror)
- if bit 4 is zero then bits 7-11 are an immediate shift count
- else bit 7 must be zero and bits 8-11 are the register
- to be used as a shift count.
- Note: no shift at all is encoded as "reg lsl #0" */
- fprintf (stream, "%s", reg_names[operand2 & 0xf]);
- if (operand2 & 0xff0) {
- /* ror #0 is really rrx (rotate right extend) */
- if ((operand2 & 0xff0) == 0x060)
- fprintf (stream, ", rrx");
- else {
- fprintf (stream, ", %s ",
- shift_names[(operand2 >> 5) & 3]);
- if (operand2 & (1<<4)) /* register shift */
- fprintf (stream, "%s",
- reg_names[operand2 >> 8]);
- else /* immediate shift */
- fprintf (stream, "#%d",
- operand2 >> 7);
- }
- }
- }
- break;
- case 'a' :
- fprintf (stream, "[%s", reg_names[(ins >> 16) & 0xf]);
- if (ins & (1<<24)) {
- fprintf (stream, ", ");
- print_ldr_str_offset (ins, stream);
- putc (']', stream);
- if (ins & (1<<21)) putc('!', stream);
- /* If it is a pc relative load, then it is probably
- a constant so print it */
- if (((ins >> 16) & 0xf) == 15 &&
- (ins & (1<<25)) == 0 &&
- (ins & (1<<20))) {
- int addr = memaddr + 8 +
- (ins & 0xfff) * ((ins & (1<<23)) ? 1 : -1);
- fprintf (stream, " (contents=");
- print_address (read_memory_integer(addr, 4), stream);
- fprintf (stream, ")");
- }
- } else {
- fprintf (stream, "]," );
- print_ldr_str_offset (ins, stream);
- }
- break;
- case 'b' :
- print_address (memaddr + 8 + (((int)ins << 8) >> 6), stream);
- break;
- case 'A' :
- fprintf (stream, "[%s", reg_names[(ins >> 16) & 0xf]);
- if (ins & (1<<24)) {
- fprintf (stream, ", ");
- print_ldc_stc_offset (ins, stream);
- putc(']', stream);
- if (ins & (1<<21))
- putc('!', stream);
- } else {
- fprintf (stream, "], ");
- print_ldc_stc_offset (ins, stream);
- }
- break;
- case 'm' :
- {
- int regnum, first = 1;
- putc('{', stream);
- for (regnum = 0; regnum < 16; regnum++)
- if (ins & (1<<regnum)) {
- if (!first)
- putc (',', stream);
- first = 0;
- fprintf (stream, "%s", reg_names[regnum]);
- }
- putc('}', stream);
- }
- break;
- case 'P' :
- val = ((ins >> 18) & 2) | ((ins >> 7) & 1);
- putc(float_precision[val], stream);
- break;
- case 'Q' :
- val = ((ins >> 21) & 2) | ((ins >> 15) & 1);
- putc(float_precision[val], stream);
- break;
- case 'R' :
- val = ((ins >> 5) & 3);
- if (val) putc(float_rounding[val], stream);
- break;
- case 'f' :
- assert(val >= 0 && val <= 15);
- if (val > 7)
- fprintf (stream, "#%3.1f", float_immed[val - 8]);
- else
- fprintf (stream, "f%d", val);
- break;
- default:
- abort();
- }
- } else
- putc(c, stream);
- }
- return 4;
-}
-
-static long
-immediate_value(operand)
-int operand;
-{
- int val = operand & 0xff;
- int shift = 2*(operand >> 8);
- /* immediate value is (val ror shift) */
- return (val >> shift) | (val << (32 - shift));
-}
-
-static void
-print_ldr_str_offset(ins, stream)
-unsigned long ins;
-FILE *stream;
-{
- if ((ins & (1<<25)) == 0)
- fprintf (stream, "#%d",
- (ins & 0xfff) * ((ins & (1<<23)) ? 1 : -1));
- else {
- fprintf (stream, "%s%s", reg_names[ins & 0xf],
- (ins & (1<<23)) ? "" : "-");
- if (ins & 0xff0)
- fprintf (stream, ", %s #%d",
- shift_names[(ins >> 5) & 3],
- (ins >> 7) & 0x1f);
- }
-}
-
-static void
-print_ldc_stc_offset(ins, stream)
-unsigned long ins;
-FILE *stream;
-{
- fprintf (stream, "#%d",
- 4 * (ins & 0xff) * ((ins & (1<<23)) ? 1 : -1));
-}
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
deleted file mode 100644
index b4fe1b5..0000000
--- a/gdb/arm-tdep.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/* Copyright (C) 1988, 1989 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "arm-opcode.h"
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-
-#define N_TXTADDR(hdr) 0x8000
-#define N_DATADDR(hdr) (hdr.a_text + 0x8000)
-
-#include "gdbcore.h"
-#include <sys/user.h> /* After a.out.h */
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include <errno.h>
-
-
-/* Work with core dump and executable files, for GDB.
- This code would be in core.c if it weren't machine-dependent. */
-
-/* Structure to describe the chain of shared libraries used
- by the execfile.
- e.g. prog shares Xt which shares X11 which shares c. */
-
-struct shared_library {
- struct exec_header header;
- char name[SHLIBLEN];
- CORE_ADDR text_start; /* CORE_ADDR of 1st byte of text, this file */
- long data_offset; /* offset of data section in file */
- int chan; /* file descriptor for the file */
- struct shared_library *shares; /* library this one shares */
-};
-static struct shared_library *shlib = 0;
-
-/* Hook for `exec_file_command' command to call. */
-
-extern void (*exec_file_display_hook) ();
-
-static CORE_ADDR unshared_text_start;
-
-/* extended header from exec file (for shared library info) */
-
-static struct exec_header exec_header;
-
-void
-exec_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
-
- /* Eliminate all traces of old exec file.
- Mark text segment as empty. */
-
- if (execfile)
- free (execfile);
- execfile = 0;
- data_start = 0;
- data_end -= exec_data_start;
- text_start = 0;
- unshared_text_start = 0;
- text_end = 0;
- exec_data_start = 0;
- exec_data_end = 0;
- if (execchan >= 0)
- close (execchan);
- execchan = -1;
- if (shlib) {
- close_shared_library(shlib);
- shlib = 0;
- }
-
- /* Now open and digest the file the user requested, if any. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
- &execfile);
- if (execchan < 0)
- perror_with_name (filename);
-
- {
- struct stat st_exec;
-
-#ifdef HEADER_SEEK_FD
- HEADER_SEEK_FD (execchan);
-#endif
-
- val = myread (execchan, &exec_header, sizeof exec_header);
- exec_aouthdr = exec_header.a_exec;
-
- if (val < 0)
- perror_with_name (filename);
-
- text_start = 0x8000;
-
- /* Look for shared library if needed */
- if (exec_header.a_exec.a_magic & MF_USES_SL)
- shlib = open_shared_library(exec_header.a_shlibname, text_start);
-
- text_offset = N_TXTOFF (exec_aouthdr);
- exec_data_offset = N_TXTOFF (exec_aouthdr) + exec_aouthdr.a_text;
-
- if (shlib) {
- unshared_text_start = shared_text_end(shlib) & ~0x7fff;
- stack_start = shlib->header.a_exec.a_sldatabase;
- stack_end = STACK_END_ADDR;
- } else
- unshared_text_start = 0x8000;
- text_end = unshared_text_start + exec_aouthdr.a_text;
-
- exec_data_start = unshared_text_start + exec_aouthdr.a_text;
- exec_data_end = exec_data_start + exec_aouthdr.a_data;
-
- data_start = exec_data_start;
- data_end += exec_data_start;
-
- fstat (execchan, &st_exec);
- exec_mtime = st_exec.st_mtime;
- }
-
- validate_files ();
- }
- else if (from_tty)
- printf ("No exec file now.\n");
-
- /* Tell display code (if any) about the changed file name. */
- if (exec_file_display_hook)
- (*exec_file_display_hook) (filename);
-}
-
-/* Read from the program's memory (except for inferior processes).
- This function is misnamed, since it only reads, never writes; and
- since it will use the core file and/or executable file as necessary.
-
- It should be extended to write as well as read, FIXME, for patching files.
-
- Return 0 if address could be read, EIO if addresss out of bounds. */
-
-int
-xfer_core_file (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- register int i;
- register int val;
- int xferchan;
- char **xferfile;
- int fileptr;
- int returnval = 0;
-
- while (len > 0)
- {
- xferfile = 0;
- xferchan = 0;
-
- /* Determine which file the next bunch of addresses reside in,
- and where in the file. Set the file's read/write pointer
- to point at the proper place for the desired address
- and set xferfile and xferchan for the correct file.
-
- If desired address is nonexistent, leave them zero.
-
- i is set to the number of bytes that can be handled
- along with the next address.
-
- We put the most likely tests first for efficiency. */
-
- /* Note that if there is no core file
- data_start and data_end are equal. */
- if (memaddr >= data_start && memaddr < data_end)
- {
- i = min (len, data_end - memaddr);
- fileptr = memaddr - data_start + data_offset;
- xferfile = &corefile;
- xferchan = corechan;
- }
- /* Note that if there is no core file
- stack_start and stack_end define the shared library data. */
- else if (memaddr >= stack_start && memaddr < stack_end)
- {
- if (corechan < 0) {
- struct shared_library *lib;
- for (lib = shlib; lib; lib = lib->shares)
- if (memaddr >= lib->header.a_exec.a_sldatabase &&
- memaddr < lib->header.a_exec.a_sldatabase +
- lib->header.a_exec.a_data)
- break;
- if (lib) {
- i = min (len, lib->header.a_exec.a_sldatabase +
- lib->header.a_exec.a_data - memaddr);
- fileptr = lib->data_offset + memaddr -
- lib->header.a_exec.a_sldatabase;
- xferfile = execfile;
- xferchan = lib->chan;
- }
- } else {
- i = min (len, stack_end - memaddr);
- fileptr = memaddr - stack_start + stack_offset;
- xferfile = &corefile;
- xferchan = corechan;
- }
- }
- else if (corechan < 0
- && memaddr >= exec_data_start && memaddr < exec_data_end)
- {
- i = min (len, exec_data_end - memaddr);
- fileptr = memaddr - exec_data_start + exec_data_offset;
- xferfile = &execfile;
- xferchan = execchan;
- }
- else if (memaddr >= text_start && memaddr < text_end)
- {
- struct shared_library *lib;
- for (lib = shlib; lib; lib = lib->shares)
- if (memaddr >= lib->text_start &&
- memaddr < lib->text_start + lib->header.a_exec.a_text)
- break;
- if (lib) {
- i = min (len, lib->header.a_exec.a_text +
- lib->text_start - memaddr);
- fileptr = memaddr - lib->text_start + text_offset;
- xferfile = &execfile;
- xferchan = lib->chan;
- } else {
- i = min (len, text_end - memaddr);
- fileptr = memaddr - unshared_text_start + text_offset;
- xferfile = &execfile;
- xferchan = execchan;
- }
- }
- else if (memaddr < text_start)
- {
- i = min (len, text_start - memaddr);
- }
- else if (memaddr >= text_end
- && memaddr < (corechan >= 0? data_start : exec_data_start))
- {
- i = min (len, data_start - memaddr);
- }
- else if (corechan >= 0
- && memaddr >= data_end && memaddr < stack_start)
- {
- i = min (len, stack_start - memaddr);
- }
- else if (corechan < 0 && memaddr >= exec_data_end)
- {
- i = min (len, - memaddr);
- }
- else if (memaddr >= stack_end && stack_end != 0)
- {
- i = min (len, - memaddr);
- }
- else
- {
- /* Address did not classify into one of the known ranges.
- This shouldn't happen; we catch the endpoints. */
- fatal ("Internal: Bad case logic in xfer_core_file.");
- }
-
- /* Now we know which file to use.
- Set up its pointer and transfer the data. */
- if (xferfile)
- {
- if (*xferfile == 0)
- if (xferfile == &execfile)
- error ("No program file to examine.");
- else
- error ("No core dump file or running program to examine.");
- val = lseek (xferchan, fileptr, 0);
- if (val < 0)
- perror_with_name (*xferfile);
- val = myread (xferchan, myaddr, i);
- if (val < 0)
- perror_with_name (*xferfile);
- }
- /* If this address is for nonexistent memory,
- read zeros if reading, or do nothing if writing.
- Actually, we never right. */
- else
- {
- bzero (myaddr, i);
- returnval = EIO;
- }
-
- memaddr += i;
- myaddr += i;
- len -= i;
- }
- return returnval;
-}
-
-/* APCS (ARM procedure call standard) defines the following prologue:
-
- mov ip, sp
- [stmfd sp!, {a1,a2,a3,a4}]
- stmfd sp!, {...,fp,ip,lr,pc}
- [stfe f7, [sp, #-12]!]
- [stfe f6, [sp, #-12]!]
- [stfe f5, [sp, #-12]!]
- [stfe f4, [sp, #-12]!]
- sub fp, ip, #nn // nn == 20 or 4 depending on second ins
-*/
-
-CORE_ADDR
-skip_prologue(pc)
-CORE_ADDR pc;
-{
- union insn_fmt op;
- CORE_ADDR skip_pc = pc;
-
- op.ins = read_memory_integer(skip_pc, 4);
- /* look for the "mov ip,sp" */
- if (op.generic.type != TYPE_ARITHMETIC ||
- op.arith.opcode != OPCODE_MOV ||
- op.arith.dest != SPTEMP ||
- op.arith.operand2 != SP) return pc;
- skip_pc += 4;
- /* skip the "stmfd sp!,{a1,a2,a3,a4}" if its there */
- op.ins = read_memory_integer(skip_pc, 4);
- if (op.generic.type == TYPE_BLOCK_BRANCH &&
- op.generic.subtype == SUBTYPE_BLOCK &&
- op.block.mask == 0xf &&
- op.block.base == SP &&
- op.block.is_load == 0 &&
- op.block.writeback == 1 &&
- op.block.increment == 0 &&
- op.block.before == 1) skip_pc += 4;
- /* skip the "stmfd sp!,{...,fp,ip,lr,pc} */
- op.ins = read_memory_integer(skip_pc, 4);
- if (op.generic.type != TYPE_BLOCK_BRANCH ||
- op.generic.subtype != SUBTYPE_BLOCK ||
- /* the mask should look like 110110xxxxxx0000 */
- (op.block.mask & 0xd800) != 0xd800 ||
- op.block.base != SP ||
- op.block.is_load != 0 ||
- op.block.writeback != 1 ||
- op.block.increment != 0 ||
- op.block.before != 1) return pc;
- skip_pc += 4;
- /* check for "sub fp,ip,#nn" */
- op.ins = read_memory_integer(skip_pc, 4);
- if (op.generic.type != TYPE_ARITHMETIC ||
- op.arith.opcode != OPCODE_SUB ||
- op.arith.dest != FP ||
- op.arith.operand1 != SPTEMP) return pc;
- return skip_pc + 4;
-}
-
-static void
-print_fpu_flags(flags)
-int flags;
-{
- if (flags & (1 << 0)) fputs("IVO ", stdout);
- if (flags & (1 << 1)) fputs("DVZ ", stdout);
- if (flags & (1 << 2)) fputs("OFL ", stdout);
- if (flags & (1 << 3)) fputs("UFL ", stdout);
- if (flags & (1 << 4)) fputs("INX ", stdout);
- putchar('\n');
-}
-
-void
-arm_float_info()
-{
- register unsigned long status = read_register(FPS_REGNUM);
- int type;
-
- type = (status >> 24) & 127;
- printf("%s FPU type %d\n",
- (status & (1<<31)) ? "Hardware" : "Software",
- type);
- fputs("mask: ", stdout);
- print_fpu_flags(status >> 16);
- fputs("flags: ", stdout);
- print_fpu_flags(status);
-}
diff --git a/gdb/arm-xdep.c b/gdb/arm-xdep.c
deleted file mode 100644
index e03e16d..0000000
--- a/gdb/arm-xdep.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/* Acorn Risc Machine host machine support.
- Copyright (C) 1988, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "arm-opcode.h"
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-
-#define N_TXTADDR(hdr) 0x8000
-#define N_DATADDR(hdr) (hdr.a_text + 0x8000)
-
-#include "gdbcore.h"
-
-#include <sys/user.h> /* After a.out.h */
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include <errno.h>
-
-void
-fetch_inferior_registers (regno)
- int regno;
-{
- register int regno;
- register unsigned int regaddr;
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
-
- struct user u;
- unsigned int offset = (char *) &u.u_ar0 - (char *) &u;
- offset = ptrace (PT_READ_U, inferior_pid, offset, 0) - KERNEL_U_ADDR;
-
- registers_fetched ();
-
- for (regno = 0; regno < 16; regno++)
- {
- regaddr = offset + regno * 4;
- *(int *)&buf[0] = ptrace (PT_READ_U, inferior_pid, regaddr, 0);
- if (regno == PC_REGNUM)
- *(int *)&buf[0] = GET_PC_PART(*(int *)&buf[0]);
- supply_register (regno, buf);
- }
- *(int *)&buf[0] = ptrace (PT_READ_U, inferior_pid, offset + PC*4);
- supply_register (PS_REGNUM, buf); /* set virtual register ps same as pc */
-
- /* read the floating point registers */
- offset = (char *) &u.u_fp_regs - (char *)&u;
- *(int *)buf = ptrace (PT_READ_U, inferior_pid, offset, 0);
- supply_register (FPS_REGNUM, buf);
- for (regno = 16; regno < 24; regno++) {
- regaddr = offset + 4 + 12 * (regno - 16);
- for (i = 0; i < 12; i += sizeof(int))
- *(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid, regaddr + i, 0);
- supply_register (regno, buf);
- }
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- int regno;
-{
- register unsigned int regaddr;
- char buf[80];
-
- struct user u;
- unsigned long value;
- unsigned int offset = (char *) &u.u_ar0 - (char *) &u;
- offset = ptrace (PT_READ_U, inferior_pid, offset, 0) - KERNEL_U_ADDR;
-
- if (regno >= 0) {
- if (regno >= 16) return;
- regaddr = offset + 4 * regno;
- errno = 0;
- value = read_register(regno);
- if (regno == PC_REGNUM)
- value = SET_PC_PART(read_register (PS_REGNUM), value);
- ptrace (PT_WRITE_U, inferior_pid, regaddr, value);
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- else for (regno = 0; regno < 15; regno++)
- {
- regaddr = offset + regno * 4;
- errno = 0;
- value = read_register(regno);
- if (regno == PC_REGNUM)
- value = SET_PC_PART(read_register (PS_REGNUM), value);
- ptrace (6, inferior_pid, regaddr, value);
- if (errno != 0)
- {
- sprintf (buf, "writing all regs, number %d", regno);
- perror_with_name (buf);
- }
- }
-}
-
-/* Work with core dump and executable files, for GDB.
- This code would be in core.c if it weren't machine-dependent. */
-
-/* Structure to describe the chain of shared libraries used
- by the execfile.
- e.g. prog shares Xt which shares X11 which shares c. */
-
-struct shared_library {
- struct exec_header header;
- char name[SHLIBLEN];
- CORE_ADDR text_start; /* CORE_ADDR of 1st byte of text, this file */
- long data_offset; /* offset of data section in file */
- int chan; /* file descriptor for the file */
- struct shared_library *shares; /* library this one shares */
-};
-static struct shared_library *shlib = 0;
-
-/* Hook for `exec_file_command' command to call. */
-
-extern void (*exec_file_display_hook) ();
-
-static CORE_ADDR unshared_text_start;
-
-/* extended header from exec file (for shared library info) */
-
-static struct exec_header exec_header;
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- extern char registers[];
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
- /* 4.2-style (and perhaps also sysV-style) core dump file. */
- {
- struct user u;
-
- unsigned int reg_offset, fp_reg_offset;
-
- val = myread (corechan, &u, sizeof u);
- if (val < 0)
- perror_with_name ("Not a core file: reading upage");
- if (val != sizeof u)
- error ("Not a core file: could only read %d bytes", val);
-
- /* We are depending on exec_file_command having been called
- previously to set exec_data_start. Since the executable
- and the core file share the same text segment, the address
- of the data segment will be the same in both. */
- data_start = exec_data_start;
-
- data_end = data_start + NBPG * u.u_dsize;
- stack_start = stack_end - NBPG * u.u_ssize;
- data_offset = NBPG * UPAGES;
- stack_offset = NBPG * (UPAGES + u.u_dsize);
-
- /* Some machines put an absolute address in here and some put
- the offset in the upage of the regs. */
- reg_offset = (int) u.u_ar0;
- if (reg_offset > NBPG * UPAGES)
- reg_offset -= KERNEL_U_ADDR;
- fp_reg_offset = (char *) &u.u_fp_regs - (char *)&u;
-
- /* I don't know where to find this info.
- So, for now, mark it as not available. */
- N_SET_MAGIC (core_aouthdr, 0);
-
- /* Read the register values out of the core file and store
- them where `read_register' will find them. */
-
- {
- register int regno;
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- char buf[MAX_REGISTER_RAW_SIZE];
-
- if (regno < 16)
- val = lseek (corechan, reg_offset + 4 * regno, 0);
- else if (regno < 24)
- val = lseek (corechan, fp_reg_offset + 4 + 12*(regno - 24), 0);
- else if (regno == 24)
- val = lseek (corechan, fp_reg_offset, 0);
- else if (regno == 25)
- val = lseek (corechan, reg_offset + 4 * PC, 0);
- if (val < 0
- || (val = myread (corechan, buf, sizeof buf)) < 0)
- {
- char * buffer = (char *) alloca (strlen (reg_names[regno])
- + 30);
- strcpy (buffer, "Reading register ");
- strcat (buffer, reg_names[regno]);
-
- perror_with_name (buffer);
- }
-
- if (regno == PC_REGNUM)
- *(int *)buf = GET_PC_PART(*(int *)buf);
- supply_register (regno, buf);
- }
- }
- }
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- {
- corefile = concat (current_directory, "/", filename, NULL);
- }
-
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- select_frame (get_current_frame (), 0);
- validate_files ();
- }
- else if (from_tty)
- printf ("No core file now.\n");
-}
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
deleted file mode 100644
index ee42d7c..0000000
--- a/gdb/blockframe.c
+++ /dev/null
@@ -1,745 +0,0 @@
-/* Get info from stack frames;
- convert between frames, blocks, functions and pc values.
- Copyright (C) 1986, 1987, 1988, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "gdbcore.h"
-#include "value.h" /* for read_register */
-#include "target.h" /* for target_has_stack */
-
-CORE_ADDR read_pc (); /* In infcmd.c */
-
-/* Start and end of object file containing the entry point.
- STARTUP_FILE_END is the first address of the next file.
- This file is assumed to be a startup file
- and frames with pc's inside it
- are treated as nonexistent.
-
- Setting these variables is necessary so that backtraces do not fly off
- the bottom of the stack. */
-CORE_ADDR startup_file_start;
-CORE_ADDR startup_file_end;
-
-/* Is ADDR outside the startup file? Note that if your machine
- has a way to detect the bottom of the stack, there is no need
- to call this function from FRAME_CHAIN_VALID; the reason for
- doing so is that some machines have no way of detecting bottom
- of stack. */
-int
-outside_startup_file (addr)
- CORE_ADDR addr;
-{
- return !(addr >= startup_file_start && addr < startup_file_end);
-}
-
-/* Support an alternate method to avoid running off the bottom of
- the stack (or top, depending upon your stack orientation).
-
- There are two frames that are "special", the frame for the function
- containing the process entry point, since it has no predecessor frame,
- and the frame for the function containing the user code entry point
- (the main() function), since all the predecessor frames are for the
- process startup code. Since we have no guarantee that the linked
- in startup modules have any debugging information that gdb can use,
- we need to avoid following frame pointers back into frames that might
- have been built in the startup code, as we might get hopelessly
- confused. However, we almost always have debugging information
- available for main().
-
- These variables are used to save the range of PC values which are valid
- within the main() function and within the function containing the process
- entry point. If we always consider the frame for main() as the outermost
- frame when debugging user code, and the frame for the process entry
- point function as the outermost frame when debugging startup code, then
- all we have to do is have FRAME_CHAIN_VALID return false whenever a
- frame's current PC is within the range specified by these variables.
- In essence, we set "blocks" in the frame chain beyond which we will
- not proceed when following the frame chain.
-
- A nice side effect is that we can still debug startup code without
- running off the end of the frame chain, assuming that we have usable
- debugging information in the startup modules, and if we choose to not
- use the block at main, or can't find it for some reason, everything
- still works as before. And if we have no startup code debugging
- information but we do have usable information for main(), backtraces
- from user code don't go wandering off into the startup code.
-
- To use this method, define your FRAME_CHAIN_VALID macro like:
-
- #define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 \
- && !(inside_main_scope ((thisframe)->pc)) \
- && !(inside_entry_scope ((thisframe)->pc)))
-
- and add initializations of the four scope controlling variables inside
- the object file / debugging information processing modules. */
-
-CORE_ADDR entry_scope_lowpc;
-CORE_ADDR entry_scope_highpc;
-CORE_ADDR main_scope_lowpc;
-CORE_ADDR main_scope_highpc;
-
-/* Test a specified PC value to see if it is in the range of addresses
- that correspond to the main() function. See comments above for why
- we might want to do this.
-
- Typically called from FRAME_CHAIN_VALID. */
-
-int
-inside_main_scope (pc)
-CORE_ADDR pc;
-{
- return (main_scope_lowpc <= pc && pc < main_scope_highpc);
-}
-
-/* Test a specified PC value to see if it is in the range of addresses
- that correspond to the process entry point function. See comments above
- for why we might want to do this.
-
- Typically called from FRAME_CHAIN_VALID. */
-
-int
-inside_entry_scope (pc)
-CORE_ADDR pc;
-{
- return (entry_scope_lowpc <= pc && pc < entry_scope_highpc);
-}
-
-/* Address of innermost stack frame (contents of FP register) */
-
-static FRAME current_frame;
-
-/*
- * Cache for frame addresses already read by gdb. Valid only while
- * inferior is stopped. Control variables for the frame cache should
- * be local to this module.
- */
-struct obstack frame_cache_obstack;
-
-/* Return the innermost (currently executing) stack frame. */
-
-FRAME
-get_current_frame ()
-{
- /* We assume its address is kept in a general register;
- param.h says which register. */
-
- return current_frame;
-}
-
-void
-set_current_frame (frame)
- FRAME frame;
-{
- current_frame = frame;
-}
-
-FRAME
-create_new_frame (addr, pc)
- FRAME_ADDR addr;
- CORE_ADDR pc;
-{
- struct frame_info *fci; /* Same type as FRAME */
-
- fci = (struct frame_info *)
- obstack_alloc (&frame_cache_obstack,
- sizeof (struct frame_info));
-
- /* Arbitrary frame */
- fci->next = (struct frame_info *) 0;
- fci->prev = (struct frame_info *) 0;
- fci->frame = addr;
- fci->next_frame = 0; /* Since arbitrary */
- fci->pc = pc;
-
-#ifdef INIT_EXTRA_FRAME_INFO
- INIT_EXTRA_FRAME_INFO (0, fci);
-#endif
-
- return fci;
-}
-
-/* Return the frame that called FRAME.
- If FRAME is the original frame (it has no caller), return 0. */
-
-FRAME
-get_prev_frame (frame)
- FRAME frame;
-{
- /* We're allowed to know that FRAME and "struct frame_info *" are
- the same */
- return get_prev_frame_info (frame);
-}
-
-/* Return the frame that FRAME calls (0 if FRAME is the innermost
- frame). */
-
-FRAME
-get_next_frame (frame)
- FRAME frame;
-{
- /* We're allowed to know that FRAME and "struct frame_info *" are
- the same */
- return frame->next;
-}
-
-/*
- * Flush the entire frame cache.
- */
-void
-flush_cached_frames ()
-{
- /* Since we can't really be sure what the first object allocated was */
- obstack_free (&frame_cache_obstack, 0);
- obstack_init (&frame_cache_obstack);
-
- current_frame = (struct frame_info *) 0; /* Invalidate cache */
-}
-
-/* Flush the frame cache, and start a new one if necessary. */
-void
-reinit_frame_cache ()
-{
- FRAME fr = current_frame;
- flush_cached_frames ();
- if (fr)
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
-}
-
-/* Return a structure containing various interesting information
- about a specified stack frame. */
-/* How do I justify including this function? Well, the FRAME
- identifier format has gone through several changes recently, and
- it's not completely inconceivable that it could happen again. If
- it does, have this routine around will help */
-
-struct frame_info *
-get_frame_info (frame)
- FRAME frame;
-{
- return frame;
-}
-
-/* If a machine allows frameless functions, it should define a macro
- FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) in param.h. FI is the struct
- frame_info for the frame, and FRAMELESS should be set to nonzero
- if it represents a frameless function invocation. */
-
-/* Return nonzero if the function for this frame has a prologue. Many
- machines can define FRAMELESS_FUNCTION_INVOCATION to just call this
- function. */
-
-int
-frameless_look_for_prologue (frame)
- FRAME frame;
-{
- CORE_ADDR func_start, after_prologue;
- func_start = (get_pc_function_start (frame->pc) +
- FUNCTION_START_OFFSET);
- if (func_start)
- {
- after_prologue = func_start;
-#ifdef SKIP_PROLOGUE_FRAMELESS_P
- /* This is faster, since only care whether there *is* a prologue,
- not how long it is. */
- SKIP_PROLOGUE_FRAMELESS_P (after_prologue);
-#else
- SKIP_PROLOGUE (after_prologue);
-#endif
- return after_prologue == func_start;
- }
- else
- /* If we can't find the start of the function, we don't really
- know whether the function is frameless, but we should be able
- to get a reasonable (i.e. best we can do under the
- circumstances) backtrace by saying that it isn't. */
- return 0;
-}
-
-/* Default a few macros that people seldom redefine. */
-
-#if !defined (INIT_FRAME_PC)
-#define INIT_FRAME_PC(fromleaf, prev) \
- prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \
- prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
-#endif
-
-#ifndef FRAME_CHAIN_COMBINE
-#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
-#endif
-
-/* Return a structure containing various interesting information
- about the frame that called NEXT_FRAME. Returns NULL
- if there is no such frame. */
-
-struct frame_info *
-get_prev_frame_info (next_frame)
- FRAME next_frame;
-{
- FRAME_ADDR address;
- struct frame_info *prev;
- int fromleaf = 0;
-
- /* If the requested entry is in the cache, return it.
- Otherwise, figure out what the address should be for the entry
- we're about to add to the cache. */
-
- if (!next_frame)
- {
- if (!current_frame)
- {
- error ("You haven't set up a process's stack to examine.");
- }
-
- return current_frame;
- }
-
- /* If we have the prev one, return it */
- if (next_frame->prev)
- return next_frame->prev;
-
- /* On some machines it is possible to call a function without
- setting up a stack frame for it. On these machines, we
- define this macro to take two args; a frameinfo pointer
- identifying a frame and a variable to set or clear if it is
- or isn't leafless. */
-#ifdef FRAMELESS_FUNCTION_INVOCATION
- /* Still don't want to worry about this except on the innermost
- frame. This macro will set FROMLEAF if NEXT_FRAME is a
- frameless function invocation. */
- if (!(next_frame->next))
- {
- FRAMELESS_FUNCTION_INVOCATION (next_frame, fromleaf);
- if (fromleaf)
- address = next_frame->frame;
- }
-#endif
-
- if (!fromleaf)
- {
- /* Two macros defined in tm.h specify the machine-dependent
- actions to be performed here.
- First, get the frame's chain-pointer.
- If that is zero, the frame is the outermost frame or a leaf
- called by the outermost frame. This means that if start
- calls main without a frame, we'll return 0 (which is fine
- anyway).
-
- Nope; there's a problem. This also returns when the current
- routine is a leaf of main. This is unacceptable. We move
- this to after the ffi test; I'd rather have backtraces from
- start go curfluy than have an abort called from main not show
- main. */
- address = FRAME_CHAIN (next_frame);
- if (!FRAME_CHAIN_VALID (address, next_frame))
- return 0;
- address = FRAME_CHAIN_COMBINE (address, next_frame);
- }
- if (address == 0)
- return 0;
-
- prev = (struct frame_info *)
- obstack_alloc (&frame_cache_obstack,
- sizeof (struct frame_info));
-
- if (next_frame)
- next_frame->prev = prev;
- prev->next = next_frame;
- prev->prev = (struct frame_info *) 0;
- prev->frame = address;
- prev->next_frame = prev->next ? prev->next->frame : 0;
-
-#ifdef INIT_EXTRA_FRAME_INFO
- INIT_EXTRA_FRAME_INFO(fromleaf, prev);
-#endif
-
- /* This entry is in the frame queue now, which is good since
- FRAME_SAVED_PC may use that queue to figure out it's value
- (see tm-sparc.h). We want the pc saved in the inferior frame. */
- INIT_FRAME_PC(fromleaf, prev);
-
- return prev;
-}
-
-CORE_ADDR
-get_frame_pc (frame)
- FRAME frame;
-{
- struct frame_info *fi;
- fi = get_frame_info (frame);
- return fi->pc;
-}
-
-#if defined (FRAME_FIND_SAVED_REGS)
-/* Find the addresses in which registers are saved in FRAME. */
-
-void
-get_frame_saved_regs (frame_info_addr, saved_regs_addr)
- struct frame_info *frame_info_addr;
- struct frame_saved_regs *saved_regs_addr;
-{
- FRAME_FIND_SAVED_REGS (frame_info_addr, *saved_regs_addr);
-}
-#endif
-
-/* Return the innermost lexical block in execution
- in a specified stack frame. The frame address is assumed valid. */
-
-struct block *
-get_frame_block (frame)
- FRAME frame;
-{
- struct frame_info *fi;
- CORE_ADDR pc;
-
- fi = get_frame_info (frame);
-
- pc = fi->pc;
- if (fi->next_frame != 0)
- /* We are not in the innermost frame. We need to subtract one to
- get the correct block, in case the call instruction was the
- last instruction of the block. If there are any machines on
- which the saved pc does not point to after the call insn, we
- probably want to make fi->pc point after the call insn anyway. */
- --pc;
- return block_for_pc (pc);
-}
-
-struct block *
-get_current_block ()
-{
- return block_for_pc (read_pc ());
-}
-
-CORE_ADDR
-get_pc_function_start (pc)
- CORE_ADDR pc;
-{
- register struct block *bl = block_for_pc (pc);
- register struct symbol *symbol;
- if (bl == 0 || (symbol = block_function (bl)) == 0)
- {
- register int misc_index = find_pc_misc_function (pc);
- if (misc_index >= 0)
- return misc_function_vector[misc_index].address;
- return 0;
- }
- bl = SYMBOL_BLOCK_VALUE (symbol);
- return BLOCK_START (bl);
-}
-
-/* Return the symbol for the function executing in frame FRAME. */
-
-struct symbol *
-get_frame_function (frame)
- FRAME frame;
-{
- register struct block *bl = get_frame_block (frame);
- if (bl == 0)
- return 0;
- return block_function (bl);
-}
-
-/* Return the blockvector immediately containing the innermost lexical block
- containing the specified pc value, or 0 if there is none.
- PINDEX is a pointer to the index value of the block. If PINDEX
- is NULL, we don't pass this information back to the caller. */
-
-struct blockvector *
-blockvector_for_pc (pc, pindex)
- register CORE_ADDR pc;
- int *pindex;
-{
- register struct block *b;
- register int bot, top, half;
- register struct symtab *s;
- struct blockvector *bl;
-
- /* First search all symtabs for one whose file contains our pc */
- s = find_pc_symtab (pc);
- if (s == 0)
- return 0;
-
- bl = BLOCKVECTOR (s);
- b = BLOCKVECTOR_BLOCK (bl, 0);
-
- /* Then search that symtab for the smallest block that wins. */
- /* Use binary search to find the last block that starts before PC. */
-
- bot = 0;
- top = BLOCKVECTOR_NBLOCKS (bl);
-
- while (top - bot > 1)
- {
- half = (top - bot + 1) >> 1;
- b = BLOCKVECTOR_BLOCK (bl, bot + half);
- if (BLOCK_START (b) <= pc)
- bot += half;
- else
- top = bot + half;
- }
-
- /* Now search backward for a block that ends after PC. */
-
- while (bot >= 0)
- {
- b = BLOCKVECTOR_BLOCK (bl, bot);
- if (BLOCK_END (b) > pc)
- {
- if (pindex)
- *pindex = bot;
- return bl;
- }
- bot--;
- }
-
- return 0;
-}
-
-/* Return the innermost lexical block containing the specified pc value,
- or 0 if there is none. */
-
-struct block *
-block_for_pc (pc)
- register CORE_ADDR pc;
-{
- register struct blockvector *bl;
- int index;
-
- bl = blockvector_for_pc (pc, &index);
- if (bl)
- return BLOCKVECTOR_BLOCK (bl, index);
- return 0;
-}
-
-/* Return the function containing pc value PC.
- Returns 0 if function is not known. */
-
-struct symbol *
-find_pc_function (pc)
- CORE_ADDR pc;
-{
- register struct block *b = block_for_pc (pc);
- if (b == 0)
- return 0;
- return block_function (b);
-}
-
-/* These variables are used to cache the most recent result
- * of find_pc_partial_function. */
-
-static CORE_ADDR cache_pc_function_low = 0;
-static CORE_ADDR cache_pc_function_high = 0;
-static char *cache_pc_function_name = 0;
-
-/* Clear cache, e.g. when symbol table is discarded. */
-
-void
-clear_pc_function_cache()
-{
- cache_pc_function_low = 0;
- cache_pc_function_high = 0;
- cache_pc_function_name = (char *)0;
-}
-
-/* Finds the "function" (text symbol) that is smaller than PC
- but greatest of all of the potential text symbols. Sets
- *NAME and/or *ADDRESS conditionally if that pointer is non-zero.
- Returns 0 if it couldn't find anything, 1 if it did. On a zero
- return, *NAME and *ADDRESS are always set to zero. On a 1 return,
- *NAME and *ADDRESS contain real information. */
-
-int
-find_pc_partial_function (pc, name, address)
- CORE_ADDR pc;
- char **name;
- CORE_ADDR *address;
-{
- struct partial_symtab *pst;
- struct symbol *f;
- int miscfunc;
- struct partial_symbol *psb;
-
- if (pc >= cache_pc_function_low && pc < cache_pc_function_high)
- {
- if (address)
- *address = cache_pc_function_low;
- if (name)
- *name = cache_pc_function_name;
- return 1;
- }
-
- pst = find_pc_psymtab (pc);
- if (pst)
- {
- if (pst->readin)
- {
- /* The information we want has already been read in.
- We can go to the already readin symbols and we'll get
- the best possible answer. */
- f = find_pc_function (pc);
- if (!f)
- {
- return_error:
- /* No available symbol. */
- if (name != 0)
- *name = 0;
- if (address != 0)
- *address = 0;
- return 0;
- }
-
- cache_pc_function_low = BLOCK_START (SYMBOL_BLOCK_VALUE (f));
- cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f));
- cache_pc_function_name = SYMBOL_NAME (f);
- if (name)
- *name = cache_pc_function_name;
- if (address)
- *address = cache_pc_function_low;
- return 1;
- }
-
- /* Get the information from a combination of the pst
- (static symbols), and the misc function vector (extern
- symbols). */
- miscfunc = find_pc_misc_function (pc);
- psb = find_pc_psymbol (pst, pc);
-
- if (!psb && miscfunc == -1)
- {
- goto return_error;
- }
- if (psb
- && (miscfunc == -1
- || (SYMBOL_VALUE_ADDRESS (psb)
- >= misc_function_vector[miscfunc].address)))
- {
- /* This case isn't being cached currently. */
- if (address)
- *address = SYMBOL_VALUE_ADDRESS (psb);
- if (name)
- *name = SYMBOL_NAME (psb);
- return 1;
- }
- }
- else
- /* Must be in the misc function stuff. */
- {
- miscfunc = find_pc_misc_function (pc);
- if (miscfunc == -1)
- goto return_error;
- }
-
- {
- if (misc_function_vector[miscfunc].type == mf_text)
- cache_pc_function_low = misc_function_vector[miscfunc].address;
- else
- /* It is a transfer table for Sun shared libraries. */
- cache_pc_function_low = pc - FUNCTION_START_OFFSET;
- }
- cache_pc_function_name = misc_function_vector[miscfunc].name;
- if (miscfunc < misc_function_count /* && FIXME mf_text again? */ )
- cache_pc_function_high = misc_function_vector[miscfunc+1].address;
- else
- cache_pc_function_high = cache_pc_function_low + 1;
- if (address)
- *address = cache_pc_function_low;
- if (name)
- *name = cache_pc_function_name;
- return 1;
-}
-
-/* Find the misc function whose address is the largest
- while being less than PC. Return its index in misc_function_vector.
- Returns -1 if PC is not in suitable range. */
-
-int
-find_pc_misc_function (pc)
- register CORE_ADDR pc;
-{
- register int lo = 0;
- register int hi = misc_function_count-1;
- register int new;
-
- /* Note that the last thing in the vector is always _etext. */
- /* Actually, "end", now that non-functions
- go on the misc_function_vector. */
-
- /* Above statement is not *always* true - fix for case where there are */
- /* no misc functions at all (ie no symbol table has been read). */
- if (hi < 0) return -1; /* no misc functions recorded */
-
- /* trivial reject range test */
- if (pc < misc_function_vector[0].address ||
- pc > misc_function_vector[hi].address)
- return -1;
-
- /* Note that the following search will not return hi if
- pc == misc_function_vector[hi].address. If "end" points to the
- first unused location, this is correct and the above test
- simply needs to be changed to
- "pc >= misc_function_vector[hi].address". */
- do {
- new = (lo + hi) >> 1;
- if (misc_function_vector[new].address == pc)
- return new; /* an exact match */
- else if (misc_function_vector[new].address > pc)
- hi = new;
- else
- lo = new;
- } while (hi-lo != 1);
-
- /* if here, we had no exact match, so return the lower choice */
- return lo;
-}
-
-/* Return the innermost stack frame executing inside of the specified block,
- or zero if there is no such frame. */
-
-FRAME
-block_innermost_frame (block)
- struct block *block;
-{
- struct frame_info *fi;
- register FRAME frame;
- register CORE_ADDR start = BLOCK_START (block);
- register CORE_ADDR end = BLOCK_END (block);
-
- frame = 0;
- while (1)
- {
- frame = get_prev_frame (frame);
- if (frame == 0)
- return 0;
- fi = get_frame_info (frame);
- if (fi->pc >= start && fi->pc < end)
- return frame;
- }
-}
-
-void
-_initialize_blockframe ()
-{
- obstack_init (&frame_cache_obstack);
-}
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
deleted file mode 100644
index f6b136f..0000000
--- a/gdb/breakpoint.c
+++ /dev/null
@@ -1,2448 +0,0 @@
-/* Everything about breakpoints, for GDB.
- Copyright (C) 1986, 1987, 1989, 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <ctype.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "breakpoint.h"
-#include "expression.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "value.h"
-#include "ctype.h"
-#include "command.h"
-#include "inferior.h"
-#include "target.h"
-#include "language.h"
-#include <string.h>
-
-extern int addressprint; /* Print machine addresses? */
-extern int demangle; /* Print de-mangled symbol names? */
-
-extern int catch_errors ();
-extern void set_next_address (); /* ...for x/ command */
-
-/* Are we executing breakpoint commands? */
-static int executing_breakpoint_commands;
-
-/* States of enablement of breakpoint.
- `temporary' means disable when hit.
- `delete' means delete when hit. */
-
-enum enable { disabled, enabled, temporary, delete};
-
-/* Not that the ->silent field is not currently used by any commands
- (though the code is in there if it was to be, and set_raw_breakpoint
- does set it to 0). I implemented it because I thought it would be
- useful for a hack I had to put in; I'm going to leave it in because
- I can see how there might be times when it would indeed be useful */
-
-/* This is for a breakpoint or a watchpoint. */
-
-struct breakpoint
-{
- struct breakpoint *next;
- /* Number assigned to distinguish breakpoints. */
- int number;
- /* Address to break at, or NULL if not a breakpoint. */
- CORE_ADDR address;
- /* Line number of this address. Redundant. Only matters if address
- is non-NULL. */
- int line_number;
- /* Symtab of file of this address. Redundant. Only matters if address
- is non-NULL. */
- struct symtab *symtab;
- /* Zero means disabled; remember the info but don't break here. */
- enum enable enable;
- /* Non-zero means a silent breakpoint (don't print frame info
- if we stop here). */
- unsigned char silent;
- /* Number of stops at this breakpoint that should
- be continued automatically before really stopping. */
- int ignore_count;
- /* "Real" contents of byte where breakpoint has been inserted.
- Valid only when breakpoints are in the program. Under the complete
- control of the target insert_breakpoint and remove_breakpoint routines.
- No other code should assume anything about the value(s) here. */
- char shadow_contents[BREAKPOINT_MAX];
- /* Nonzero if this breakpoint is now inserted. Only matters if address
- is non-NULL. */
- char inserted;
- /* Nonzero if this is not the first breakpoint in the list
- for the given address. Only matters if address is non-NULL. */
- char duplicate;
- /* Chain of command lines to execute when this breakpoint is hit. */
- struct command_line *commands;
- /* Stack depth (address of frame). If nonzero, break only if fp
- equals this. */
- FRAME_ADDR frame;
- /* Conditional. Break only if this expression's value is nonzero. */
- struct expression *cond;
-
- /* String we used to set the breakpoint (malloc'd). Only matters if
- address is non-NULL. */
- char *addr_string;
- /* String form of the breakpoint condition (malloc'd), or NULL if there
- is no condition. */
- char *cond_string;
-
- /* The expression we are watching, or NULL if not a watchpoint. */
- struct expression *exp;
- /* The largest block within which it is valid, or NULL if it is
- valid anywhere (e.g. consists just of global symbols). */
- struct block *exp_valid_block;
- /* Value of the watchpoint the last time we checked it. */
- value val;
-};
-
-#define ALL_BREAKPOINTS(b) for (b = breakpoint_chain; b; b = b->next)
-
-/* Chain of all breakpoints defined. */
-
-struct breakpoint *breakpoint_chain;
-
-/* Number of last breakpoint made. */
-
-static int breakpoint_count;
-
-/* Set breakpoint count to NUM. */
-static void
-set_breakpoint_count (num)
- int num;
-{
- breakpoint_count = num;
- set_internalvar (lookup_internalvar ("bpnum"),
- value_from_longest (builtin_type_int, (LONGEST) num));
-}
-
-/* Default address, symtab and line to put a breakpoint at
- for "break" command with no arg.
- if default_breakpoint_valid is zero, the other three are
- not valid, and "break" with no arg is an error.
-
- This set by print_stack_frame, which calls set_default_breakpoint. */
-
-int default_breakpoint_valid;
-CORE_ADDR default_breakpoint_address;
-struct symtab *default_breakpoint_symtab;
-int default_breakpoint_line;
-
-static void delete_breakpoint ();
-void breakpoint_auto_delete ();
-
-/* Flag indicating extra verbosity for xgdb. */
-extern int xgdb_verbose;
-
-/* *PP is a string denoting a breakpoint. Get the number of the breakpoint.
- Advance *PP after the string and any trailing whitespace.
-
- Currently the string can either be a number or "$" followed by the name
- of a convenience variable. Making it an expression wouldn't work well
- for map_breakpoint_numbers (e.g. "4 + 5 + 6"). */
-static int
-get_number (pp)
- char **pp;
-{
- int retval;
- char *p = *pp;
-
- if (p == NULL)
- /* Empty line means refer to the last breakpoint. */
- return breakpoint_count;
- else if (*p == '$')
- {
- /* Make a copy of the name, so we can null-terminate it
- to pass to lookup_internalvar(). */
- char *varname;
- char *start = ++p;
- value val;
-
- while (isalnum (*p) || *p == '_')
- p++;
- varname = (char *) alloca (p - start + 1);
- strncpy (varname, start, p - start);
- varname[p - start] = '\0';
- val = value_of_internalvar (lookup_internalvar (varname));
- if (TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_INT)
- error (
-"Convenience variables used to specify breakpoints must have integer values."
- );
- retval = (int) value_as_long (val);
- }
- else
- {
- while (*p >= '0' && *p <= '9')
- ++p;
- if (p == *pp)
- /* There is no number here. (e.g. "cond a == b"). */
- error_no_arg ("breakpoint number");
- retval = atoi (*pp);
- }
- if (!(isspace (*p) || *p == '\0'))
- error ("breakpoint number expected");
- while (isspace (*p))
- p++;
- *pp = p;
- return retval;
-}
-
-/* condition N EXP -- set break condition of breakpoint N to EXP. */
-
-static void
-condition_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- register struct breakpoint *b;
- char *p;
- register int bnum;
-
- if (arg == 0)
- error_no_arg ("breakpoint number");
-
- p = arg;
- bnum = get_number (&p);
-
- ALL_BREAKPOINTS (b)
- if (b->number == bnum)
- {
- if (b->cond)
- {
- free (b->cond);
- b->cond = 0;
- }
- if (b->cond_string != NULL)
- free (b->cond_string);
-
- if (*p == 0)
- {
- b->cond = 0;
- b->cond_string = NULL;
- if (from_tty)
- printf ("Breakpoint %d now unconditional.\n", bnum);
- }
- else
- {
- arg = p;
- /* I don't know if it matters whether this is the string the user
- typed in or the decompiled expression. */
- b->cond_string = savestring (arg, strlen (arg));
- b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
- if (*arg)
- error ("Junk at end of expression");
- }
- return;
- }
-
- error ("No breakpoint number %d.", bnum);
-}
-
-/* ARGSUSED */
-static void
-commands_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- register struct breakpoint *b;
- char *p;
- register int bnum;
- struct command_line *l;
-
- /* If we allowed this, we would have problems with when to
- free the storage, if we change the commands currently
- being read from. */
-
- if (executing_breakpoint_commands)
- error ("Can't use the \"commands\" command among a breakpoint's commands.");
-
- p = arg;
- bnum = get_number (&p);
- if (p && *p)
- error ("Unexpected extra arguments following breakpoint number.");
-
- ALL_BREAKPOINTS (b)
- if (b->number == bnum)
- {
- if (from_tty && input_from_terminal_p ())
- {
- printf ("Type commands for when breakpoint %d is hit, one per line.\n\
-End with a line saying just \"end\".\n", bnum);
- fflush (stdout);
- }
- l = read_command_lines ();
- free_command_lines (&b->commands);
- b->commands = l;
- return;
- }
- error ("No breakpoint number %d.", bnum);
-}
-
-extern int memory_breakpoint_size; /* from mem-break.c */
-
-/* Like target_read_memory() but if breakpoints are inserted, return
- the shadow contents instead of the breakpoints themselves. */
-int
-read_memory_nobpt (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- unsigned len;
-{
- int status;
- struct breakpoint *b;
-
- if (memory_breakpoint_size < 0)
- /* No breakpoints on this machine. */
- return target_read_memory (memaddr, myaddr, len);
-
- ALL_BREAKPOINTS (b)
- {
- if (b->address == NULL || !b->inserted)
- continue;
- else if (b->address + memory_breakpoint_size <= memaddr)
- /* The breakpoint is entirely before the chunk of memory
- we are reading. */
- continue;
- else if (b->address >= memaddr + len)
- /* The breakpoint is entirely after the chunk of memory we
- are reading. */
- continue;
- else
- {
- /* Copy the breakpoint from the shadow contents, and recurse
- for the things before and after. */
-
- /* Addresses and length of the part of the breakpoint that
- we need to copy. */
- CORE_ADDR membpt = b->address;
- unsigned int bptlen = memory_breakpoint_size;
- /* Offset within shadow_contents. */
- int bptoffset = 0;
-
- if (membpt < memaddr)
- {
- /* Only copy the second part of the breakpoint. */
- bptlen -= memaddr - membpt;
- bptoffset = memaddr - membpt;
- membpt = memaddr;
- }
-
- if (membpt + bptlen > memaddr + len)
- {
- /* Only copy the first part of the breakpoint. */
- bptlen -= (membpt + bptlen) - (memaddr + len);
- }
-
- bcopy (b->shadow_contents + bptoffset,
- myaddr + membpt - memaddr, bptlen);
-
- if (membpt > memaddr)
- {
- /* Copy the section of memory before the breakpoint. */
- status = read_memory_nobpt (memaddr, myaddr, membpt - memaddr);
- if (status != 0)
- return status;
- }
-
- if (membpt + bptlen < memaddr + len)
- {
- /* Copy the section of memory after the breakpoint. */
- status = read_memory_nobpt
- (membpt + bptlen,
- myaddr + membpt + bptlen - memaddr,
- memaddr + len - (membpt + bptlen));
- if (status != 0)
- return status;
- }
- return 0;
- }
- }
- /* Nothing overlaps. Just call read_memory_noerr. */
- return target_read_memory (memaddr, myaddr, len);
-}
-
-/* insert_breakpoints is used when starting or continuing the program.
- remove_breakpoints is used when the program stops.
- Both return zero if successful,
- or an `errno' value if could not write the inferior. */
-
-int
-insert_breakpoints ()
-{
- register struct breakpoint *b;
- int val = 0;
- int disabled_breaks = 0;
-
- ALL_BREAKPOINTS (b)
- if (b->address != NULL
- && b->enable != disabled
- && ! b->inserted
- && ! b->duplicate)
- {
- val = target_insert_breakpoint(b->address, b->shadow_contents);
- if (val)
- {
- /* Can't set the breakpoint. */
-#if defined (DISABLE_UNSETTABLE_BREAK)
- if (DISABLE_UNSETTABLE_BREAK (b->address))
- {
- val = 0;
- b->enable = disabled;
- if (!disabled_breaks)
- {
- fprintf (stderr,
- "Cannot insert breakpoint %d:\n", b->number);
- printf_filtered ("Disabling shared library breakpoints:\n");
- }
- disabled_breaks = 1;
- printf_filtered ("%d ", b->number);
- }
- else
-#endif
- {
- fprintf (stderr, "Cannot insert breakpoint %d:\n", b->number);
-#ifdef ONE_PROCESS_WRITETEXT
- fprintf (stderr,
- "The same program may be running in another process.\n");
-#endif
- memory_error (val, b->address); /* which bombs us out */
- }
- }
- else
- b->inserted = 1;
- }
- if (disabled_breaks)
- printf_filtered ("\n");
- return val;
-}
-
-int
-remove_breakpoints ()
-{
- register struct breakpoint *b;
- int val;
-
-#ifdef BREAKPOINT_DEBUG
- printf ("Removing breakpoints.\n");
-#endif /* BREAKPOINT_DEBUG */
-
- ALL_BREAKPOINTS (b)
- if (b->address != NULL && b->inserted)
- {
- val = target_remove_breakpoint(b->address, b->shadow_contents);
- if (val)
- return val;
- b->inserted = 0;
-#ifdef BREAKPOINT_DEBUG
- printf ("Removed breakpoint at %s",
- local_hex_string(b->address));
- printf (", shadow %s",
- local_hex_string(b->shadow_contents[0]));
- printf (", %s.\n",
- local_hex_string(b->shadow_contents[1]));
-#endif /* BREAKPOINT_DEBUG */
- }
-
- return 0;
-}
-
-/* Clear the "inserted" flag in all breakpoints.
- This is done when the inferior is loaded. */
-
-void
-mark_breakpoints_out ()
-{
- register struct breakpoint *b;
-
- ALL_BREAKPOINTS (b)
- b->inserted = 0;
-}
-
-/* breakpoint_here_p (PC) returns 1 if an enabled breakpoint exists at PC.
- When continuing from a location with a breakpoint,
- we actually single step once before calling insert_breakpoints. */
-
-int
-breakpoint_here_p (pc)
- CORE_ADDR pc;
-{
- register struct breakpoint *b;
-
- ALL_BREAKPOINTS (b)
- if (b->enable != disabled && b->address == pc)
- return 1;
-
- return 0;
-}
-
-/* bpstat stuff. External routines' interfaces are documented
- in breakpoint.h. */
-void
-bpstat_clear (bsp)
- bpstat *bsp;
-{
- bpstat p;
- bpstat q;
-
- if (bsp == 0)
- return;
- p = *bsp;
- while (p != NULL)
- {
- q = p->next;
- if (p->old_val != NULL)
- value_free (p->old_val);
- free (p);
- p = q;
- }
- *bsp = NULL;
-}
-
-bpstat
-bpstat_copy (bs)
- bpstat bs;
-{
- bpstat p = NULL;
- bpstat tmp;
- bpstat retval;
-
- if (bs == NULL)
- return bs;
-
- for (; bs != NULL; bs = bs->next)
- {
- tmp = (bpstat) xmalloc (sizeof (*tmp));
- bcopy (bs, tmp, sizeof (*tmp));
- if (p == NULL)
- /* This is the first thing in the chain. */
- retval = tmp;
- else
- p->next = tmp;
- p = tmp;
- }
- p->next = NULL;
- return retval;
-}
-
-int
-bpstat_num (bsp)
- bpstat *bsp;
-{
- struct breakpoint *b;
-
- if ((*bsp) == NULL)
- return 0; /* No more breakpoint values */
- else
- {
- b = (*bsp)->breakpoint_at;
- *bsp = (*bsp)->next;
- if (b == NULL)
- return -1; /* breakpoint that's been deleted since */
- else
- return b->number; /* We have its number */
- }
-}
-
-void
-bpstat_clear_actions (bs)
- bpstat bs;
-{
- for (; bs != NULL; bs = bs->next)
- {
- bs->commands = NULL;
- if (bs->old_val != NULL)
- {
- value_free (bs->old_val);
- bs->old_val = NULL;
- }
- }
-}
-
-/* Stub for cleaning up our state if we error-out of a breakpoint command */
-/* ARGSUSED */
-static void
-cleanup_executing_breakpoints (ignore)
- int ignore;
-{
- executing_breakpoint_commands = 0;
-}
-
-/* Execute all the commands associated with all the breakpoints at this
- location. Any of these commands could cause the process to proceed
- beyond this point, etc. We look out for such changes by checking
- the global "breakpoint_proceeded" after each command. */
-void
-bpstat_do_actions (bsp)
- bpstat *bsp;
-{
- bpstat bs;
- struct cleanup *old_chain;
-
- executing_breakpoint_commands = 1;
- old_chain = make_cleanup (cleanup_executing_breakpoints, 0);
-
-top:
- bs = *bsp;
-
- breakpoint_proceeded = 0;
- for (; bs != NULL; bs = bs->next)
- {
- while (bs->commands)
- {
- char *line = bs->commands->line;
- bs->commands = bs->commands->next;
- execute_command (line, 0);
- /* If the inferior is proceeded by the command, bomb out now.
- The bpstat chain has been blown away by wait_for_inferior.
- But since execution has stopped again, there is a new bpstat
- to look at, so start over. */
- if (breakpoint_proceeded)
- goto top;
- }
- }
- clear_momentary_breakpoints ();
-
- executing_breakpoint_commands = 0;
- discard_cleanups (old_chain);
-}
-
-int
-bpstat_print (bs)
- bpstat bs;
-{
- /* bs->breakpoint_at can be NULL if it was a momentary breakpoint
- which has since been deleted. */
- if (bs == NULL || bs->breakpoint_at == NULL)
- return 0;
-
- /* If bpstat_stop_status says don't print, OK, we won't. An example
- circumstance is when we single-stepped for both a watchpoint and
- for a "stepi" instruction. The bpstat says that the watchpoint
- explains the stop, but we shouldn't print because the watchpoint's
- value didn't change -- and the real reason we are stopping here
- rather than continuing to step (as the watchpoint would've had us do)
- is because of the "stepi". */
- if (!bs->print)
- return 0;
-
- if (bs->breakpoint_at->address != NULL)
- {
- /* I think the user probably only wants to see one breakpoint
- number, not all of them. */
- printf_filtered ("\nBreakpoint %d, ", bs->breakpoint_at->number);
- return 0;
- }
-
- if (bs->old_val != NULL)
- {
- printf_filtered ("\nWatchpoint %d, ", bs->breakpoint_at->number);
- print_expression (bs->breakpoint_at->exp, stdout);
- printf_filtered ("\nOld value = ");
- value_print (bs->old_val, stdout, 0, Val_pretty_default);
- printf_filtered ("\nNew value = ");
- value_print (bs->breakpoint_at->val, stdout, 0,
- Val_pretty_default);
- printf_filtered ("\n");
- value_free (bs->old_val);
- bs->old_val = NULL;
- return 1;
- }
-
- /* Maybe another breakpoint in the chain caused us to stop.
- (Currently all watchpoints go on the bpstat whether hit or
- not. That probably could (should) be changed, provided care is taken
- with respect to bpstat_explains_signal). */
- if (bs->next)
- return bpstat_print (bs->next);
-
- fprintf_filtered (stderr, "gdb internal error: in bpstat_print\n");
- return 0;
-}
-
-/* Evaluate the expression EXP and return 1 if value is zero.
- This is used inside a catch_errors to evaluate the breakpoint condition.
- The argument is a "struct expression *" that has been cast to char * to
- make it pass through catch_errors. */
-
-static int
-breakpoint_cond_eval (exp)
- char *exp;
-{
- return !value_true (evaluate_expression ((struct expression *)exp));
-}
-
-/* Allocate a new bpstat and chain it to the current one. */
-
-static bpstat
-bpstat_alloc (b, cbs)
- register struct breakpoint *b;
- bpstat cbs; /* Current "bs" value */
-{
- bpstat bs;
-
- bs = (bpstat) xmalloc (sizeof (*bs));
- cbs->next = bs;
- bs->breakpoint_at = b;
- /* If the condition is false, etc., don't do the commands. */
- bs->commands = NULL;
- bs->momentary = b->number == -3;
- bs->old_val = NULL;
- return bs;
-}
-
-/* Determine whether we stopped at a breakpoint, etc, or whether we
- don't understand this stop. Result is a chain of bpstat's such that:
-
- if we don't understand the stop, the result is a null pointer.
-
- if we understand why we stopped, the result is not null, and
- the first element of the chain contains summary "stop" and
- "print" flags for the whole chain.
-
- Each element of the chain refers to a particular breakpoint or
- watchpoint at which we have stopped. (We may have stopped for
- several reasons.)
-
- Each element of the chain has valid next, breakpoint_at,
- commands, FIXME??? fields.
-
- */
-
-
-bpstat
-bpstat_stop_status (pc, frame_address)
- CORE_ADDR *pc;
- FRAME_ADDR frame_address;
-{
- register struct breakpoint *b;
- int stop = 0;
- int print = 0;
- CORE_ADDR bp_addr;
-#if DECR_PC_AFTER_BREAK != 0 || defined (SHIFT_INST_REGS)
- /* True if we've hit a breakpoint (as opposed to a watchpoint). */
- int real_breakpoint = 0;
-#endif
- /* Root of the chain of bpstat's */
- struct bpstat__struct root_bs[1];
- /* Pointer to the last thing in the chain currently. */
- bpstat bs = root_bs;
-
- /* Get the address where the breakpoint would have been. */
- bp_addr = *pc - DECR_PC_AFTER_BREAK;
-
- ALL_BREAKPOINTS (b)
- {
- int this_bp_stop;
- int this_bp_print;
-
- if (b->enable == disabled)
- continue;
- if (b->address != NULL && b->address != bp_addr)
- continue;
-
- bs = bpstat_alloc (b, bs); /* Alloc a bpstat to explain stop */
-
- this_bp_stop = 1;
- this_bp_print = 1;
-
- if (b->exp != NULL) /* Watchpoint */
- {
- int within_current_scope;
- if (b->exp_valid_block != NULL)
- within_current_scope =
- contained_in (get_selected_block (), b->exp_valid_block);
- else
- within_current_scope = 1;
-
- if (within_current_scope)
- {
- /* We use value_{,free_to_}mark because it could be a
- *long* time before we return to the command level and
- call free_all_values. */
-
- value mark = value_mark ();
- value new_val = evaluate_expression (b->exp);
- if (!value_equal (b->val, new_val))
- {
- release_value (new_val);
- value_free_to_mark (mark);
- bs->old_val = b->val;
- b->val = new_val;
- /* We will stop here */
- }
- else
- {
- /* Nothing changed, don't do anything. */
- value_free_to_mark (mark);
- continue;
- /* We won't stop here */
- }
- }
- else
- {
- /* This seems like the only logical thing to do because
- if we temporarily ignored the watchpoint, then when
- we reenter the block in which it is valid it contains
- garbage (in the case of a function, it may have two
- garbage values, one before and one after the prologue).
- So we can't even detect the first assignment to it and
- watch after that (since the garbage may or may not equal
- the first value assigned). */
- b->enable = disabled;
- printf_filtered ("\
-Watchpoint %d disabled because the program has left the block in\n\
-which its expression is valid.\n", b->number);
- /* We won't stop here */
- /* FIXME, maybe we should stop here!!! */
- continue;
- }
- }
-#if DECR_PC_AFTER_BREAK != 0 || defined (SHIFT_INST_REGS)
- else
- real_breakpoint = 1;
-#endif
-
- if (b->frame && b->frame != frame_address)
- this_bp_stop = 0;
- else
- {
- int value_is_zero;
-
- if (b->cond)
- {
- /* Need to select the frame, with all that implies
- so that the conditions will have the right context. */
- select_frame (get_current_frame (), 0);
- value_is_zero
- = catch_errors (breakpoint_cond_eval, (char *)(b->cond),
- "Error in testing breakpoint condition:\n");
- /* FIXME-someday, should give breakpoint # */
- free_all_values ();
- }
- if (b->cond && value_is_zero)
- {
- this_bp_stop = 0;
- }
- else if (b->ignore_count > 0)
- {
- b->ignore_count--;
- this_bp_stop = 0;
- }
- else
- {
- /* We will stop here */
- if (b->enable == temporary)
- b->enable = disabled;
- bs->commands = b->commands;
- if (b->silent)
- this_bp_print = 0;
- if (bs->commands && !strcmp ("silent", bs->commands->line))
- {
- bs->commands = bs->commands->next;
- this_bp_print = 0;
- }
- }
- }
- if (this_bp_stop)
- stop = 1;
- if (this_bp_print)
- print = 1;
- }
-
- bs->next = NULL; /* Terminate the chain */
- bs = root_bs->next; /* Re-grab the head of the chain */
- if (bs)
- {
- bs->stop = stop;
- bs->print = print;
-#if DECR_PC_AFTER_BREAK != 0 || defined (SHIFT_INST_REGS)
- if (real_breakpoint)
- {
- *pc = bp_addr;
-#if defined (SHIFT_INST_REGS)
- {
- CORE_ADDR pc = read_register (PC_REGNUM);
- CORE_ADDR npc = read_register (NPC_REGNUM);
- if (pc != npc)
- {
- write_register (NNPC_REGNUM, npc);
- write_register (NPC_REGNUM, pc);
- }
- }
-#else /* No SHIFT_INST_REGS. */
- write_pc (bp_addr);
-#endif /* No SHIFT_INST_REGS. */
- }
-#endif /* DECR_PC_AFTER_BREAK != 0. */
- }
- return bs;
-}
-
-int
-bpstat_should_step ()
-{
- struct breakpoint *b;
- ALL_BREAKPOINTS (b)
- if (b->enable != disabled && b->exp != NULL)
- return 1;
- return 0;
-}
-
-/* Print information on breakpoint number BNUM, or -1 if all.
- If WATCHPOINTS is zero, process only breakpoints; if WATCHPOINTS
- is nonzero, process only watchpoints. */
-
-static void
-breakpoint_1 (bnum, watchpoints)
- int bnum;
- int watchpoints;
-{
- register struct breakpoint *b;
- register struct command_line *l;
- register struct symbol *sym;
- CORE_ADDR last_addr = (CORE_ADDR)-1;
- int header_printed = 0;
-
- ALL_BREAKPOINTS (b)
- if (bnum == -1 || bnum == b->number)
- {
- if (b->address == NULL && !watchpoints)
- {
- if (bnum == -1)
- continue;
- error ("That is a watchpoint, not a breakpoint.");
- }
- if (b->address != NULL && watchpoints)
- {
- if (bnum == -1)
- continue;
- error ("That is a breakpoint, not a watchpoint.");
- }
-
- if (!header_printed)
- {
- if (watchpoints)
- printf_filtered (" Enb Expression\n");
- else if (addressprint)
- printf_filtered (" Enb Address Where\n");
- else
- printf_filtered (" Enb Where\n");
- header_printed = 1;
- }
-
- printf_filtered ("#%-3d %c ", b->number, "nyod"[(int) b->enable]);
- if (b->address == NULL) {
- printf_filtered (" ");
- print_expression (b->exp, stdout);
- } else {
- if (addressprint)
- printf_filtered (" %s ", local_hex_string_custom(b->address, "08"));
-
- last_addr = b->address;
- if (b->symtab)
- {
- sym = find_pc_function (b->address);
- if (sym)
- {
- fputs_filtered (" in ", stdout);
- fputs_demangled (SYMBOL_NAME (sym), stdout, 1);
- fputs_filtered (" at ", stdout);
- }
- fputs_filtered (b->symtab->filename, stdout);
- printf_filtered (":%d", b->line_number);
- }
- else
- print_address_symbolic (b->address, stdout, demangle, " ");
- }
-
- printf_filtered ("\n");
-
- if (b->frame)
- printf_filtered ("\tstop only in stack frame at %s\n",
- local_hex_string(b->frame));
- if (b->cond)
- {
- printf_filtered ("\tstop only if ");
- print_expression (b->cond, stdout);
- printf_filtered ("\n");
- }
- if (b->ignore_count)
- printf_filtered ("\tignore next %d hits\n", b->ignore_count);
- if ((l = b->commands))
- while (l)
- {
- fputs_filtered ("\t", stdout);
- fputs_filtered (l->line, stdout);
- fputs_filtered ("\n", stdout);
- l = l->next;
- }
- }
-
- if (!header_printed)
- {
- char *which = watchpoints ? "watch" : "break";
- if (bnum == -1)
- printf_filtered ("No %spoints.\n", which);
- else
- printf_filtered ("No %spoint numbered %d.\n", which, bnum);
- }
-
- /* Compare against (CORE_ADDR)-1 in case some compiler decides
- that a comparison of an unsigned with -1 is always false. */
- if (last_addr != (CORE_ADDR)-1)
- set_next_address (last_addr);
-}
-
-/* ARGSUSED */
-static void
-breakpoints_info (bnum_exp, from_tty)
- char *bnum_exp;
- int from_tty;
-{
- int bnum = -1;
-
- if (bnum_exp)
- bnum = parse_and_eval_address (bnum_exp);
-
- breakpoint_1 (bnum, 0);
-}
-
-/* ARGSUSED */
-static void
-watchpoints_info (bnum_exp, from_tty)
- char *bnum_exp;
- int from_tty;
-{
- int bnum = -1;
-
- if (bnum_exp)
- bnum = parse_and_eval_address (bnum_exp);
-
- breakpoint_1 (bnum, 1);
-}
-
-/* Print a message describing any breakpoints set at PC. */
-
-static void
-describe_other_breakpoints (pc)
- register CORE_ADDR pc;
-{
- register int others = 0;
- register struct breakpoint *b;
-
- ALL_BREAKPOINTS (b)
- if (b->address == pc)
- others++;
- if (others > 0)
- {
- printf ("Note: breakpoint%s ", (others > 1) ? "s" : "");
- ALL_BREAKPOINTS (b)
- if (b->address == pc)
- {
- others--;
- printf ("%d%s%s ",
- b->number,
- (b->enable == disabled) ? " (disabled)" : "",
- (others > 1) ? "," : ((others == 1) ? " and" : ""));
- }
- printf ("also set at pc %s.\n", local_hex_string(pc));
- }
-}
-
-/* Set the default place to put a breakpoint
- for the `break' command with no arguments. */
-
-void
-set_default_breakpoint (valid, addr, symtab, line)
- int valid;
- CORE_ADDR addr;
- struct symtab *symtab;
- int line;
-{
- default_breakpoint_valid = valid;
- default_breakpoint_address = addr;
- default_breakpoint_symtab = symtab;
- default_breakpoint_line = line;
-}
-
-/* Rescan breakpoints at address ADDRESS,
- marking the first one as "first" and any others as "duplicates".
- This is so that the bpt instruction is only inserted once. */
-
-static void
-check_duplicates (address)
- CORE_ADDR address;
-{
- register struct breakpoint *b;
- register int count = 0;
-
- if (address == NULL) /* Watchpoints are uninteresting */
- return;
-
- ALL_BREAKPOINTS (b)
- if (b->enable != disabled && b->address == address)
- {
- count++;
- b->duplicate = count > 1;
- }
-}
-
-/* Low level routine to set a breakpoint.
- Takes as args the three things that every breakpoint must have.
- Returns the breakpoint object so caller can set other things.
- Does not set the breakpoint number!
- Does not print anything.
-
- ==> This routine should not be called if there is a chance of later
- error(); otherwise it leaves a bogus breakpoint on the chain. Validate
- your arguments BEFORE calling this routine! */
-
-static struct breakpoint *
-set_raw_breakpoint (sal)
- struct symtab_and_line sal;
-{
- register struct breakpoint *b, *b1;
-
- b = (struct breakpoint *) xmalloc (sizeof (struct breakpoint));
- bzero (b, sizeof *b);
- b->address = sal.pc;
- b->symtab = sal.symtab;
- b->line_number = sal.line;
- b->enable = enabled;
- b->next = 0;
- b->silent = 0;
- b->ignore_count = 0;
- b->commands = NULL;
- b->frame = NULL;
-
- /* Add this breakpoint to the end of the chain
- so that a list of breakpoints will come out in order
- of increasing numbers. */
-
- b1 = breakpoint_chain;
- if (b1 == 0)
- breakpoint_chain = b;
- else
- {
- while (b1->next)
- b1 = b1->next;
- b1->next = b;
- }
-
- check_duplicates (sal.pc);
-
- return b;
-}
-
-/* Set a breakpoint that will evaporate an end of command
- at address specified by SAL.
- Restrict it to frame FRAME if FRAME is nonzero. */
-
-void
-set_momentary_breakpoint (sal, frame)
- struct symtab_and_line sal;
- FRAME frame;
-{
- register struct breakpoint *b;
- b = set_raw_breakpoint (sal);
- b->number = -3;
- b->enable = delete;
- b->frame = (frame ? FRAME_FP (frame) : 0);
-}
-
-void
-clear_momentary_breakpoints ()
-{
- register struct breakpoint *b;
- ALL_BREAKPOINTS (b)
- if (b->number == -3)
- {
- delete_breakpoint (b);
- break;
- }
-}
-
-/* Tell the user we have just set a breakpoint B. */
-static void
-mention (b)
- struct breakpoint *b;
-{
- if (b->exp)
- {
- printf_filtered ("Watchpoint %d: ", b->number);
- print_expression (b->exp, stdout);
- }
- else
- {
- printf_filtered ("Breakpoint %d at %s", b->number,
- local_hex_string(b->address));
- if (b->symtab)
- printf_filtered (": file %s, line %d.",
- b->symtab->filename, b->line_number);
- }
- printf_filtered ("\n");
-}
-
-#if 0
-/* Nobody calls this currently. */
-/* Set a breakpoint from a symtab and line.
- If TEMPFLAG is nonzero, it is a temporary breakpoint.
- ADDR_STRING is a malloc'd string holding the name of where we are
- setting the breakpoint. This is used later to re-set it after the
- program is relinked and symbols are reloaded.
- Print the same confirmation messages that the breakpoint command prints. */
-
-void
-set_breakpoint (s, line, tempflag, addr_string)
- struct symtab *s;
- int line;
- int tempflag;
- char *addr_string;
-{
- register struct breakpoint *b;
- struct symtab_and_line sal;
-
- sal.symtab = s;
- sal.line = line;
- sal.pc = find_line_pc (sal.symtab, sal.line);
- if (sal.pc == 0)
- error ("No line %d in file \"%s\".\n", sal.line, sal.symtab->filename);
- else
- {
- describe_other_breakpoints (sal.pc);
-
- b = set_raw_breakpoint (sal);
- set_breakpoint_count (breakpoint_count + 1);
- b->number = breakpoint_count;
- b->cond = 0;
- b->addr_string = addr_string;
- if (tempflag)
- b->enable = temporary;
-
- mention (b);
- }
-}
-#endif
-
-/* Set a breakpoint according to ARG (function, linenum or *address)
- and make it temporary if TEMPFLAG is nonzero. */
-
-static void
-break_command_1 (arg, tempflag, from_tty)
- char *arg;
- int tempflag, from_tty;
-{
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- register struct expression *cond = 0;
- register struct breakpoint *b;
-
- /* Pointers in arg to the start, and one past the end, of the condition. */
- char *cond_start = NULL;
- char *cond_end;
- /* Pointers in arg to the start, and one past the end,
- of the address part. */
- char *addr_start = NULL;
- char *addr_end;
-
- int i;
- CORE_ADDR pc;
-
- sals.sals = NULL;
- sals.nelts = 0;
-
- sal.line = sal.pc = sal.end = 0;
- sal.symtab = 0;
-
- /* If no arg given, or if first arg is 'if ', use the default breakpoint. */
-
- if (!arg || (arg[0] == 'i' && arg[1] == 'f'
- && (arg[2] == ' ' || arg[2] == '\t')))
- {
- if (default_breakpoint_valid)
- {
- sals.sals = (struct symtab_and_line *)
- xmalloc (sizeof (struct symtab_and_line));
- sal.pc = default_breakpoint_address;
- sal.line = default_breakpoint_line;
- sal.symtab = default_breakpoint_symtab;
- sals.sals[0] = sal;
- sals.nelts = 1;
- }
- else
- error ("No default breakpoint address now.");
- }
- else
- {
- addr_start = arg;
-
- /* Force almost all breakpoints to be in terms of the
- current_source_symtab (which is decode_line_1's default). This
- should produce the results we want almost all of the time while
- leaving default_breakpoint_* alone. */
- if (default_breakpoint_valid
- && (!current_source_symtab
- || (arg && (*arg == '+' || *arg == '-'))))
- sals = decode_line_1 (&arg, 1, default_breakpoint_symtab,
- default_breakpoint_line);
- else
- sals = decode_line_1 (&arg, 1, (struct symtab *)NULL, 0);
-
- addr_end = arg;
- }
-
- if (! sals.nelts)
- return;
-
- for (i = 0; i < sals.nelts; i++)
- {
- sal = sals.sals[i];
- if (sal.pc == 0 && sal.symtab != 0)
- {
- pc = find_line_pc (sal.symtab, sal.line);
- if (pc == 0)
- error ("No line %d in file \"%s\".",
- sal.line, sal.symtab->filename);
- }
- else
- pc = sal.pc;
-
- while (arg && *arg)
- {
- if (arg[0] == 'i' && arg[1] == 'f'
- && (arg[2] == ' ' || arg[2] == '\t'))
- {
- arg += 2;
- cond_start = arg;
- cond = parse_exp_1 (&arg, block_for_pc (pc), 0);
- cond_end = arg;
- }
- else
- error ("Junk at end of arguments.");
- }
- sals.sals[i].pc = pc;
- }
-
- for (i = 0; i < sals.nelts; i++)
- {
- sal = sals.sals[i];
-
- if (from_tty)
- describe_other_breakpoints (sal.pc);
-
- b = set_raw_breakpoint (sal);
- set_breakpoint_count (breakpoint_count + 1);
- b->number = breakpoint_count;
- b->cond = cond;
-
- if (addr_start)
- b->addr_string = savestring (addr_start, addr_end - addr_start);
- if (cond_start)
- b->cond_string = savestring (cond_start, cond_end - cond_start);
-
- if (tempflag)
- b->enable = temporary;
-
- mention (b);
- }
-
- if (sals.nelts > 1)
- {
- printf ("Multiple breakpoints were set.\n");
- printf ("Use the \"delete\" command to delete unwanted breakpoints.\n");
- }
- free (sals.sals);
-}
-
-void
-break_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- break_command_1 (arg, 0, from_tty);
-}
-
-static void
-tbreak_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- break_command_1 (arg, 1, from_tty);
-}
-
-/* ARGSUSED */
-static void
-watch_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- struct breakpoint *b;
- struct symtab_and_line sal;
- struct expression *exp;
- struct block *exp_valid_block;
- struct value *val;
-
- sal.pc = NULL;
- sal.symtab = NULL;
- sal.line = 0;
-
- /* Parse arguments. */
- innermost_block = NULL;
- exp = parse_expression (arg);
- exp_valid_block = innermost_block;
- val = evaluate_expression (exp);
- release_value (val);
-
- /* Now set up the breakpoint. */
- b = set_raw_breakpoint (sal);
- set_breakpoint_count (breakpoint_count + 1);
- b->number = breakpoint_count;
- b->exp = exp;
- b->exp_valid_block = exp_valid_block;
- b->val = val;
- b->cond = 0;
- b->cond_string = NULL;
- mention (b);
-}
-
-/*
- * Helper routine for the until_command routine in infcmd.c. Here
- * because it uses the mechanisms of breakpoints.
- */
-/* ARGSUSED */
-void
-until_break_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- FRAME prev_frame = get_prev_frame (selected_frame);
-
- clear_proceed_status ();
-
- /* Set a breakpoint where the user wants it and at return from
- this function */
-
- if (default_breakpoint_valid)
- sals = decode_line_1 (&arg, 1, default_breakpoint_symtab,
- default_breakpoint_line);
- else
- sals = decode_line_1 (&arg, 1, (struct symtab *)NULL, 0);
-
- if (sals.nelts != 1)
- error ("Couldn't get information on specified line.");
-
- sal = sals.sals[0];
- free (sals.sals); /* malloc'd, so freed */
-
- if (*arg)
- error ("Junk at end of arguments.");
-
- if (sal.pc == 0 && sal.symtab != 0)
- sal.pc = find_line_pc (sal.symtab, sal.line);
-
- if (sal.pc == 0)
- error ("No line %d in file \"%s\".", sal.line, sal.symtab->filename);
-
- set_momentary_breakpoint (sal, selected_frame);
-
- /* Keep within the current frame */
-
- if (prev_frame)
- {
- struct frame_info *fi;
-
- fi = get_frame_info (prev_frame);
- sal = find_pc_line (fi->pc, 0);
- sal.pc = fi->pc;
- set_momentary_breakpoint (sal, prev_frame);
- }
-
- proceed (-1, -1, 0);
-}
-
-#if 0
-/* These aren't used; I don't konw what they were for. */
-/* Set a breakpoint at the catch clause for NAME. */
-static int
-catch_breakpoint (name)
- char *name;
-{
-}
-
-static int
-disable_catch_breakpoint ()
-{
-}
-
-static int
-delete_catch_breakpoint ()
-{
-}
-
-static int
-enable_catch_breakpoint ()
-{
-}
-#endif /* 0 */
-
-struct sal_chain
-{
- struct sal_chain *next;
- struct symtab_and_line sal;
-};
-
-#if 0
-/* This isn't used; I don't know what it was for. */
-/* For each catch clause identified in ARGS, run FUNCTION
- with that clause as an argument. */
-static struct symtabs_and_lines
-map_catch_names (args, function)
- char *args;
- int (*function)();
-{
- register char *p = args;
- register char *p1;
- struct symtabs_and_lines sals;
-#if 0
- struct sal_chain *sal_chain = 0;
-#endif
-
- if (p == 0)
- error_no_arg ("one or more catch names");
-
- sals.nelts = 0;
- sals.sals = NULL;
-
- while (*p)
- {
- p1 = p;
- /* Don't swallow conditional part. */
- if (p1[0] == 'i' && p1[1] == 'f'
- && (p1[2] == ' ' || p1[2] == '\t'))
- break;
-
- if (isalpha (*p1))
- {
- p1++;
- while (isalnum (*p1) || *p1 == '_' || *p1 == '$')
- p1++;
- }
-
- if (*p1 && *p1 != ' ' && *p1 != '\t')
- error ("Arguments must be catch names.");
-
- *p1 = 0;
-#if 0
- if (function (p))
- {
- struct sal_chain *next
- = (struct sal_chain *)alloca (sizeof (struct sal_chain));
- next->next = sal_chain;
- next->sal = get_catch_sal (p);
- sal_chain = next;
- goto win;
- }
-#endif
- printf ("No catch clause for exception %s.\n", p);
-#if 0
- win:
-#endif
- p = p1;
- while (*p == ' ' || *p == '\t') p++;
- }
-}
-#endif /* 0 */
-
-/* This shares a lot of code with `print_frame_label_vars' from stack.c. */
-
-static struct symtabs_and_lines
-get_catch_sals (this_level_only)
- int this_level_only;
-{
- extern struct blockvector *blockvector_for_pc ();
- register struct blockvector *bl;
- register struct block *block;
- int index, have_default = 0;
- struct frame_info *fi;
- CORE_ADDR pc;
- struct symtabs_and_lines sals;
- struct sal_chain *sal_chain = 0;
- char *blocks_searched;
-
- /* Not sure whether an error message is always the correct response,
- but it's better than a core dump. */
- if (selected_frame == NULL)
- error ("No selected frame.");
- block = get_frame_block (selected_frame);
- fi = get_frame_info (selected_frame);
- pc = fi->pc;
-
- sals.nelts = 0;
- sals.sals = NULL;
-
- if (block == 0)
- error ("No symbol table info available.\n");
-
- bl = blockvector_for_pc (BLOCK_END (block) - 4, &index);
- blocks_searched = (char *) alloca (BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
- bzero (blocks_searched, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
-
- while (block != 0)
- {
- CORE_ADDR end = BLOCK_END (block) - 4;
- int last_index;
-
- if (bl != blockvector_for_pc (end, &index))
- error ("blockvector blotch");
- if (BLOCKVECTOR_BLOCK (bl, index) != block)
- error ("blockvector botch");
- last_index = BLOCKVECTOR_NBLOCKS (bl);
- index += 1;
-
- /* Don't print out blocks that have gone by. */
- while (index < last_index
- && BLOCK_END (BLOCKVECTOR_BLOCK (bl, index)) < pc)
- index++;
-
- while (index < last_index
- && BLOCK_END (BLOCKVECTOR_BLOCK (bl, index)) < end)
- {
- if (blocks_searched[index] == 0)
- {
- struct block *b = BLOCKVECTOR_BLOCK (bl, index);
- int nsyms;
- register int i;
- register struct symbol *sym;
-
- nsyms = BLOCK_NSYMS (b);
-
- for (i = 0; i < nsyms; i++)
- {
- sym = BLOCK_SYM (b, i);
- if (! strcmp (SYMBOL_NAME (sym), "default"))
- {
- if (have_default)
- continue;
- have_default = 1;
- }
- if (SYMBOL_CLASS (sym) == LOC_LABEL)
- {
- struct sal_chain *next = (struct sal_chain *)
- alloca (sizeof (struct sal_chain));
- next->next = sal_chain;
- next->sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0);
- sal_chain = next;
- }
- }
- blocks_searched[index] = 1;
- }
- index++;
- }
- if (have_default)
- break;
- if (sal_chain && this_level_only)
- break;
-
- /* After handling the function's top-level block, stop.
- Don't continue to its superblock, the block of
- per-file symbols. */
- if (BLOCK_FUNCTION (block))
- break;
- block = BLOCK_SUPERBLOCK (block);
- }
-
- if (sal_chain)
- {
- struct sal_chain *tmp_chain;
-
- /* Count the number of entries. */
- for (index = 0, tmp_chain = sal_chain; tmp_chain;
- tmp_chain = tmp_chain->next)
- index++;
-
- sals.nelts = index;
- sals.sals = (struct symtab_and_line *)
- xmalloc (index * sizeof (struct symtab_and_line));
- for (index = 0; sal_chain; sal_chain = sal_chain->next, index++)
- sals.sals[index] = sal_chain->sal;
- }
-
- return sals;
-}
-
-/* Commands to deal with catching exceptions. */
-
-void
-catch_command_1 (arg, tempflag, from_tty)
- char *arg;
- int tempflag;
- int from_tty;
-{
- /* First, translate ARG into something we can deal with in terms
- of breakpoints. */
-
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- register struct expression *cond = 0;
- register struct breakpoint *b;
- char *save_arg;
- int i;
- CORE_ADDR pc;
-
- sal.line = sal.pc = sal.end = 0;
- sal.symtab = 0;
-
- /* If no arg given, or if first arg is 'if ', all active catch clauses
- are breakpointed. */
-
- if (!arg || (arg[0] == 'i' && arg[1] == 'f'
- && (arg[2] == ' ' || arg[2] == '\t')))
- {
- /* Grab all active catch clauses. */
- sals = get_catch_sals (0);
- }
- else
- {
- /* Grab selected catch clauses. */
- error ("catch NAME not implemeneted");
-#if 0
- /* This isn't used; I don't know what it was for. */
- sals = map_catch_names (arg, catch_breakpoint);
-#endif
- }
-
- if (! sals.nelts)
- return;
-
- save_arg = arg;
- for (i = 0; i < sals.nelts; i++)
- {
- sal = sals.sals[i];
- if (sal.pc == 0 && sal.symtab != 0)
- {
- pc = find_line_pc (sal.symtab, sal.line);
- if (pc == 0)
- error ("No line %d in file \"%s\".",
- sal.line, sal.symtab->filename);
- }
- else
- pc = sal.pc;
-
- while (arg && *arg)
- {
- if (arg[0] == 'i' && arg[1] == 'f'
- && (arg[2] == ' ' || arg[2] == '\t'))
- cond = (struct expression *) parse_exp_1 ((arg += 2, &arg),
- block_for_pc (pc), 0);
- else
- error ("Junk at end of arguments.");
- }
- arg = save_arg;
- sals.sals[i].pc = pc;
- }
-
- for (i = 0; i < sals.nelts; i++)
- {
- sal = sals.sals[i];
-
- if (from_tty)
- describe_other_breakpoints (sal.pc);
-
- b = set_raw_breakpoint (sal);
- b->number = ++breakpoint_count;
- b->cond = cond;
- if (tempflag)
- b->enable = temporary;
-
- printf ("Breakpoint %d at %s", b->number, local_hex_string(b->address));
- if (b->symtab)
- printf (": file %s, line %d.", b->symtab->filename, b->line_number);
- printf ("\n");
- }
-
- if (sals.nelts > 1)
- {
- printf ("Multiple breakpoints were set.\n");
- printf ("Use the \"delete\" command to delete unwanted breakpoints.\n");
- }
- free (sals.sals);
-}
-
-#if 0
-/* These aren't used; I don't know what they were for. */
-/* Disable breakpoints on all catch clauses described in ARGS. */
-static void
-disable_catch (args)
- char *args;
-{
- /* Map the disable command to catch clauses described in ARGS. */
-}
-
-/* Enable breakpoints on all catch clauses described in ARGS. */
-static void
-enable_catch (args)
- char *args;
-{
- /* Map the disable command to catch clauses described in ARGS. */
-}
-
-/* Delete breakpoints on all catch clauses in the active scope. */
-static void
-delete_catch (args)
- char *args;
-{
- /* Map the delete command to catch clauses described in ARGS. */
-}
-#endif /* 0 */
-
-static void
-catch_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- catch_command_1 (arg, 0, from_tty);
-}
-
-static void
-clear_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- register struct breakpoint *b, *b1;
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- register struct breakpoint *found;
- int i;
-
- if (arg)
- {
- sals = decode_line_spec (arg, 1);
- }
- else
- {
- sals.sals = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line));
- sal.line = default_breakpoint_line;
- sal.symtab = default_breakpoint_symtab;
- sal.pc = 0;
- if (sal.symtab == 0)
- error ("No source file specified.");
-
- sals.sals[0] = sal;
- sals.nelts = 1;
- }
-
- for (i = 0; i < sals.nelts; i++)
- {
- /* If exact pc given, clear bpts at that pc.
- But if sal.pc is zero, clear all bpts on specified line. */
- sal = sals.sals[i];
- found = (struct breakpoint *) 0;
- while (breakpoint_chain
- && (sal.pc ? breakpoint_chain->address == sal.pc
- : (breakpoint_chain->symtab == sal.symtab
- && breakpoint_chain->line_number == sal.line)))
- {
- b1 = breakpoint_chain;
- breakpoint_chain = b1->next;
- b1->next = found;
- found = b1;
- }
-
- ALL_BREAKPOINTS (b)
- while (b->next
- && b->next->address != NULL
- && (sal.pc ? b->next->address == sal.pc
- : (b->next->symtab == sal.symtab
- && b->next->line_number == sal.line)))
- {
- b1 = b->next;
- b->next = b1->next;
- b1->next = found;
- found = b1;
- }
-
- if (found == 0)
- {
- if (arg)
- error ("No breakpoint at %s.", arg);
- else
- error ("No breakpoint at this line.");
- }
-
- if (found->next) from_tty = 1; /* Always report if deleted more than one */
- if (from_tty) printf ("Deleted breakpoint%s ", found->next ? "s" : "");
- while (found)
- {
- if (from_tty) printf ("%d ", found->number);
- b1 = found->next;
- delete_breakpoint (found);
- found = b1;
- }
- if (from_tty) putchar ('\n');
- }
- free (sals.sals);
-}
-
-/* Delete breakpoint in BS if they are `delete' breakpoints.
- This is called after any breakpoint is hit, or after errors. */
-
-void
-breakpoint_auto_delete (bs)
- bpstat bs;
-{
- for (; bs; bs = bs->next)
- if (bs->breakpoint_at && bs->breakpoint_at->enable == delete)
- delete_breakpoint (bs->breakpoint_at);
-}
-
-/* Delete a breakpoint and clean up all traces of it in the data structures. */
-
-static void
-delete_breakpoint (bpt)
- struct breakpoint *bpt;
-{
- register struct breakpoint *b;
- register bpstat bs;
-
- if (bpt->inserted)
- target_remove_breakpoint(bpt->address, bpt->shadow_contents);
-
- if (breakpoint_chain == bpt)
- breakpoint_chain = bpt->next;
-
- ALL_BREAKPOINTS (b)
- if (b->next == bpt)
- {
- b->next = bpt->next;
- break;
- }
-
- check_duplicates (bpt->address);
-
- free_command_lines (&bpt->commands);
- if (bpt->cond)
- free (bpt->cond);
- if (bpt->cond_string != NULL)
- free (bpt->cond_string);
- if (bpt->addr_string != NULL)
- free (bpt->addr_string);
-
- if (xgdb_verbose && bpt->number >=0)
- printf ("breakpoint #%d deleted\n", bpt->number);
-
- /* Be sure no bpstat's are pointing at it after it's been freed. */
- /* FIXME, how can we find all bpstat's? We just check stop_bpstat for now. */
- for (bs = stop_bpstat; bs; bs = bs->next)
- if (bs->breakpoint_at == bpt)
- bs->breakpoint_at = NULL;
- free (bpt);
-}
-
-static void map_breakpoint_numbers ();
-
-static void
-delete_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
-
- if (arg == 0)
- {
- /* Ask user only if there are some breakpoints to delete. */
- if (!from_tty
- || (breakpoint_chain && query ("Delete all breakpoints? ", 0, 0)))
- {
- /* No arg; clear all breakpoints. */
- while (breakpoint_chain)
- delete_breakpoint (breakpoint_chain);
- }
- }
- else
- map_breakpoint_numbers (arg, delete_breakpoint);
-}
-
-/* Reset a breakpoint given it's struct breakpoint * BINT.
- The value we return ends up being the return value from catch_errors.
- Unused in this case. */
-
-static int
-breakpoint_re_set_one (bint)
- char *bint;
-{
- struct breakpoint *b = (struct breakpoint *)bint; /* get past catch_errs */
- int i;
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- char *s;
-
- if (b->address != NULL && b->addr_string != NULL)
- {
- s = b->addr_string;
- sals = decode_line_1 (&s, 1, (struct symtab *)NULL, 0);
- for (i = 0; i < sals.nelts; i++)
- {
- sal = sals.sals[i];
-
- b->symtab = sal.symtab;
- b->line_number = sal.line;
- if (sal.pc == 0 && sal.symtab != 0)
- {
- sal.pc = find_line_pc (sal.symtab, sal.line);
- if (sal.pc == 0)
- error ("No line %d in file \"%s\".",
- sal.line, sal.symtab->filename);
- }
- b->address = sal.pc;
-
- if (b->cond_string != NULL)
- {
- s = b->cond_string;
- b->cond = parse_exp_1 (&s, block_for_pc (sal.pc), 0);
- }
-
- check_duplicates (b->address);
-
- mention (b);
- }
- free (sals.sals);
- }
- else
- {
- /* Anything without a string can't be re-set. */
- delete_breakpoint (b);
- }
- return 0;
-}
-
-/* Re-set all breakpoints after symbols have been re-loaded. */
-void
-breakpoint_re_set ()
-{
- struct breakpoint *b;
-
- ALL_BREAKPOINTS (b)
- {
- b->symtab = 0; /* Be sure we don't point to old dead symtab */
- (void) catch_errors (breakpoint_re_set_one, (char *) b,
- "Error in re-setting breakpoint:\n");
- }
-
- /* Blank line to finish off all those mention() messages we just printed. */
- printf_filtered ("\n");
-}
-
-/* Set ignore-count of breakpoint number BPTNUM to COUNT.
- If from_tty is nonzero, it prints a message to that effect,
- which ends with a period (no newline). */
-
-void
-set_ignore_count (bptnum, count, from_tty)
- int bptnum, count, from_tty;
-{
- register struct breakpoint *b;
-
- if (count < 0)
- count = 0;
-
- ALL_BREAKPOINTS (b)
- if (b->number == bptnum)
- {
- b->ignore_count = count;
- if (!from_tty)
- return;
- else if (count == 0)
- printf ("Will stop next time breakpoint %d is reached.", bptnum);
- else if (count == 1)
- printf ("Will ignore next crossing of breakpoint %d.", bptnum);
- else
- printf ("Will ignore next %d crossings of breakpoint %d.",
- count, bptnum);
- return;
- }
-
- error ("No breakpoint number %d.", bptnum);
-}
-
-/* Clear the ignore counts of all breakpoints. */
-void
-breakpoint_clear_ignore_counts ()
-{
- struct breakpoint *b;
-
- ALL_BREAKPOINTS (b)
- b->ignore_count = 0;
-}
-
-/* Command to set ignore-count of breakpoint N to COUNT. */
-
-static void
-ignore_command (args, from_tty)
- char *args;
- int from_tty;
-{
- char *p = args;
- register int num;
-
- if (p == 0)
- error_no_arg ("a breakpoint number");
-
- num = get_number (&p);
-
- if (*p == 0)
- error ("Second argument (specified ignore-count) is missing.");
-
- set_ignore_count (num,
- longest_to_int (value_as_long (parse_and_eval (p))),
- from_tty);
- printf ("\n");
-}
-
-/* Call FUNCTION on each of the breakpoints
- whose numbers are given in ARGS. */
-
-static void
-map_breakpoint_numbers (args, function)
- char *args;
- void (*function) ();
-{
- register char *p = args;
- char *p1;
- register int num;
- register struct breakpoint *b;
-
- if (p == 0)
- error_no_arg ("one or more breakpoint numbers");
-
- while (*p)
- {
- p1 = p;
-
- num = get_number (&p1);
-
- ALL_BREAKPOINTS (b)
- if (b->number == num)
- {
- function (b);
- goto win;
- }
- printf ("No breakpoint number %d.\n", num);
- win:
- p = p1;
- }
-}
-
-static void
-enable_breakpoint (bpt)
- struct breakpoint *bpt;
-{
- bpt->enable = enabled;
-
- if (xgdb_verbose && bpt->number >= 0)
- printf ("breakpoint #%d enabled\n", bpt->number);
-
- check_duplicates (bpt->address);
- if (bpt->val != NULL)
- {
- if (bpt->exp_valid_block != NULL
- && !contained_in (get_selected_block (), bpt->exp_valid_block))
- {
- printf_filtered ("\
-Cannot enable watchpoint %d because the block in which its expression\n\
-is valid is not currently in scope.\n", bpt->number);
- return;
- }
-
- value_free (bpt->val);
-
- bpt->val = evaluate_expression (bpt->exp);
- release_value (bpt->val);
- }
-}
-
-/* ARGSUSED */
-static void
-enable_command (args, from_tty)
- char *args;
- int from_tty;
-{
- struct breakpoint *bpt;
- if (args == 0)
- ALL_BREAKPOINTS (bpt)
- enable_breakpoint (bpt);
- else
- map_breakpoint_numbers (args, enable_breakpoint);
-}
-
-static void
-disable_breakpoint (bpt)
- struct breakpoint *bpt;
-{
- bpt->enable = disabled;
-
- if (xgdb_verbose && bpt->number >= 0)
- printf ("breakpoint #%d disabled\n", bpt->number);
-
- check_duplicates (bpt->address);
-}
-
-/* ARGSUSED */
-static void
-disable_command (args, from_tty)
- char *args;
- int from_tty;
-{
- register struct breakpoint *bpt;
- if (args == 0)
- ALL_BREAKPOINTS (bpt)
- disable_breakpoint (bpt);
- else
- map_breakpoint_numbers (args, disable_breakpoint);
-}
-
-static void
-enable_once_breakpoint (bpt)
- struct breakpoint *bpt;
-{
- bpt->enable = temporary;
-
- check_duplicates (bpt->address);
-}
-
-/* ARGSUSED */
-static void
-enable_once_command (args, from_tty)
- char *args;
- int from_tty;
-{
- map_breakpoint_numbers (args, enable_once_breakpoint);
-}
-
-static void
-enable_delete_breakpoint (bpt)
- struct breakpoint *bpt;
-{
- bpt->enable = delete;
-
- check_duplicates (bpt->address);
-}
-
-/* ARGSUSED */
-static void
-enable_delete_command (args, from_tty)
- char *args;
- int from_tty;
-{
- map_breakpoint_numbers (args, enable_delete_breakpoint);
-}
-
-/*
- * Use default_breakpoint_'s, or nothing if they aren't valid.
- */
-struct symtabs_and_lines
-decode_line_spec_1 (string, funfirstline)
- char *string;
- int funfirstline;
-{
- struct symtabs_and_lines sals;
- if (string == 0)
- error ("Empty line specification.");
- if (default_breakpoint_valid)
- sals = decode_line_1 (&string, funfirstline,
- default_breakpoint_symtab, default_breakpoint_line);
- else
- sals = decode_line_1 (&string, funfirstline, (struct symtab *)NULL, 0);
- if (*string)
- error ("Junk at end of line specification: %s", string);
- return sals;
-}
-
-
-/* Chain containing all defined enable commands. */
-
-extern struct cmd_list_element
- *enablelist, *disablelist,
- *deletelist, *enablebreaklist;
-
-extern struct cmd_list_element *cmdlist;
-
-void
-_initialize_breakpoint ()
-{
- breakpoint_chain = 0;
- /* Don't bother to call set_breakpoint_count. $bpnum isn't useful
- before a breakpoint is set. */
- breakpoint_count = 0;
-
- add_com ("ignore", class_breakpoint, ignore_command,
- "Set ignore-count of breakpoint number N to COUNT.");
-
- add_com ("commands", class_breakpoint, commands_command,
- "Set commands to be executed when a breakpoint is hit.\n\
-Give breakpoint number as argument after \"commands\".\n\
-With no argument, the targeted breakpoint is the last one set.\n\
-The commands themselves follow starting on the next line.\n\
-Type a line containing \"end\" to indicate the end of them.\n\
-Give \"silent\" as the first line to make the breakpoint silent;\n\
-then no output is printed when it is hit, except what the commands print.");
-
- add_com ("condition", class_breakpoint, condition_command,
- "Specify breakpoint number N to break only if COND is true.\n\
-N is an integer; COND is an expression to be evaluated whenever\n\
-breakpoint N is reached. ");
-
- add_com ("tbreak", class_breakpoint, tbreak_command,
- "Set a temporary breakpoint. Args like \"break\" command.\n\
-Like \"break\" except the breakpoint is only enabled temporarily,\n\
-so it will be disabled when hit. Equivalent to \"break\" followed\n\
-by using \"enable once\" on the breakpoint number.");
-
- add_prefix_cmd ("enable", class_breakpoint, enable_command,
- "Enable some breakpoints.\n\
-Give breakpoint numbers (separated by spaces) as arguments.\n\
-With no subcommand, breakpoints are enabled until you command otherwise.\n\
-This is used to cancel the effect of the \"disable\" command.\n\
-With a subcommand you can enable temporarily.",
- &enablelist, "enable ", 1, &cmdlist);
-
- add_abbrev_prefix_cmd ("breakpoints", class_breakpoint, enable_command,
- "Enable some breakpoints.\n\
-Give breakpoint numbers (separated by spaces) as arguments.\n\
-This is used to cancel the effect of the \"disable\" command.\n\
-May be abbreviated to simply \"enable\".\n",
- &enablebreaklist, "enable breakpoints ", 1, &enablelist);
-
- add_cmd ("once", no_class, enable_once_command,
- "Enable breakpoints for one hit. Give breakpoint numbers.\n\
-If a breakpoint is hit while enabled in this fashion, it becomes disabled.\n\
-See the \"tbreak\" command which sets a breakpoint and enables it once.",
- &enablebreaklist);
-
- add_cmd ("delete", no_class, enable_delete_command,
- "Enable breakpoints and delete when hit. Give breakpoint numbers.\n\
-If a breakpoint is hit while enabled in this fashion, it is deleted.",
- &enablebreaklist);
-
- add_cmd ("delete", no_class, enable_delete_command,
- "Enable breakpoints and delete when hit. Give breakpoint numbers.\n\
-If a breakpoint is hit while enabled in this fashion, it is deleted.",
- &enablelist);
-
- add_cmd ("once", no_class, enable_once_command,
- "Enable breakpoints for one hit. Give breakpoint numbers.\n\
-If a breakpoint is hit while enabled in this fashion, it becomes disabled.\n\
-See the \"tbreak\" command which sets a breakpoint and enables it once.",
- &enablelist);
-
- add_prefix_cmd ("disable", class_breakpoint, disable_command,
- "Disable some breakpoints.\n\
-Arguments are breakpoint numbers with spaces in between.\n\
-To disable all breakpoints, give no argument.\n\
-A disabled breakpoint is not forgotten, but has no effect until reenabled.",
- &disablelist, "disable ", 1, &cmdlist);
- add_com_alias ("dis", "disable", class_breakpoint, 1);
- add_com_alias ("disa", "disable", class_breakpoint, 1);
-
- add_cmd ("breakpoints", class_alias, disable_command,
- "Disable some breakpoints.\n\
-Arguments are breakpoint numbers with spaces in between.\n\
-To disable all breakpoints, give no argument.\n\
-A disabled breakpoint is not forgotten, but has no effect until reenabled.\n\
-This command may be abbreviated \"disable\".",
- &disablelist);
-
- add_prefix_cmd ("delete", class_breakpoint, delete_command,
- "Delete some breakpoints or auto-display expressions.\n\
-Arguments are breakpoint numbers with spaces in between.\n\
-To delete all breakpoints, give no argument.\n\
-\n\
-Also a prefix command for deletion of other GDB objects.\n\
-The \"unset\" command is also an alias for \"delete\".",
- &deletelist, "delete ", 1, &cmdlist);
- add_com_alias ("d", "delete", class_breakpoint, 1);
-
- add_cmd ("breakpoints", class_alias, delete_command,
- "Delete some breakpoints or auto-display expressions.\n\
-Arguments are breakpoint numbers with spaces in between.\n\
-To delete all breakpoints, give no argument.\n\
-This command may be abbreviated \"delete\".",
- &deletelist);
-
- add_com ("clear", class_breakpoint, clear_command,
- "Clear breakpoint at specified line or function.\n\
-Argument may be line number, function name, or \"*\" and an address.\n\
-If line number is specified, all breakpoints in that line are cleared.\n\
-If function is specified, breakpoints at beginning of function are cleared.\n\
-If an address is specified, breakpoints at that address are cleared.\n\n\
-With no argument, clears all breakpoints in the line that the selected frame\n\
-is executing in.\n\
-\n\
-See also the \"delete\" command which clears breakpoints by number.");
-
- add_com ("break", class_breakpoint, break_command,
- "Set breakpoint at specified line or function.\n\
-Argument may be line number, function name, or \"*\" and an address.\n\
-If line number is specified, break at start of code for that line.\n\
-If function is specified, break at start of code for that function.\n\
-If an address is specified, break at that exact address.\n\
-With no arg, uses current execution address of selected stack frame.\n\
-This is useful for breaking on return to a stack frame.\n\
-\n\
-Multiple breakpoints at one place are permitted, and useful if conditional.\n\
-\n\
-Do \"help breakpoints\" for info on other commands dealing with breakpoints.");
- add_com_alias ("b", "break", class_run, 1);
- add_com_alias ("br", "break", class_run, 1);
- add_com_alias ("bre", "break", class_run, 1);
- add_com_alias ("brea", "break", class_run, 1);
-
- add_info ("breakpoints", breakpoints_info,
- "Status of all breakpoints, or breakpoint number NUMBER.\n\
-Second column is \"y\" for enabled breakpoint, \"n\" for disabled,\n\
-\"o\" for enabled once (disable when hit), \"d\" for enable but delete when hit.\n\
-Then come the address and the file/line number.\n\n\
-Convenience variable \"$_\" and default examine address for \"x\"\n\
-are set to the address of the last breakpoint listed.\n\n\
-Convenience variable \"$bpnum\" contains the number of the last\n\
-breakpoint set.");
-
- add_com ("catch", class_breakpoint, catch_command,
- "Set breakpoints to catch exceptions that are raised.\n\
-Argument may be a single exception to catch, multiple exceptions\n\
-to catch, or the default exception \"default\". If no arguments\n\
-are given, breakpoints are set at all exception handlers catch clauses\n\
-within the current scope.\n\
-\n\
-A condition specified for the catch applies to all breakpoints set\n\
-with this command\n\
-\n\
-Do \"help breakpoints\" for info on other commands dealing with breakpoints.");
-
- add_com ("watch", class_breakpoint, watch_command,
- "Set a watchpoint for an expression.\n\
-A watchpoint stops execution of your program whenever the value of\n\
-an expression changes.");
-
- add_info ("watchpoints", watchpoints_info,
- "Status of all watchpoints, or watchpoint number NUMBER.\n\
-Second column is \"y\" for enabled watchpoints, \"n\" for disabled.");
-}
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
deleted file mode 100644
index 00ee8c5..0000000
--- a/gdb/breakpoint.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Copyright (C) 1990 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined (BREAKPOINT_H)
-#define BREAKPOINT_H 1
-
-/* This is the maximum number of bytes a breakpoint instruction can take.
- Feel free to increase it. It's just used in a few places to size
- arrays that should be independent of the target architecture. */
-
-#define BREAKPOINT_MAX 10
-
-extern void breakpoint_re_set ();
-extern void clear_momentary_breakpoints ();
-extern void set_momentary_breakpoint ();
-extern void set_ignore_count ();
-extern void set_default_breakpoint ();
-
-extern void mark_breakpoints_out ();
-extern void breakpoint_auto_delete ();
-extern void breakpoint_clear_ignore_counts ();
-
-/* The following are for displays, which aren't really breakpoints, but
- here is as good a place as any for them. */
-
-extern void disable_current_display ();
-extern void do_displays ();
-extern void disable_display ();
-extern void clear_displays ();
-
-
-/* The follow stuff is an abstract data type "bpstat" ("breakpoint status").
- This provides the ability to determine whether we have stopped at a
- breakpoint, and what we should do about it. */
-
-typedef struct bpstat__struct *bpstat;
-
-/* Interface: */
-
-/* Clear a bpstat so that it says we are not at any breakpoint.
- Also free any storage that is part of a bpstat. */
-void bpstat_clear();
-
-/* Return a copy of a bpstat. Like "bs1 = bs2" but all storage that
- is part of the bpstat is copied as well. */
-bpstat bpstat_copy();
-
-/* Get a bpstat associated with having just stopped at address *PC
- and frame address FRAME_ADDRESS. Update *PC to point at the
- breakpoint (if we hit a breakpoint). */
-bpstat bpstat_stop_status (/* CORE_ADDR *pc; FRAME_ADDR frame_address */);
-
-/* Nonzero if we should print the frame. */
-#define bpstat_should_print(bs) ((bs) != NULL && (bs)->print)
-
-/* Nonzero if we should stop. */
-#define bpstat_stop(bs) ((bs) != NULL && (bs)->stop)
-
-/* Nonzero if we hit a momentary breakpoint. */
-#define bpstat_momentary_breakpoint(bs) ((bs) != NULL && (bs)->momentary)
-
-/* Nonzero if a signal that we got in wait() was due to circumstances
- explained by the BS. */
-/* Currently that is true iff we have hit a breakpoint. */
-#define bpstat_explains_signal(bs) ((bs) != NULL)
-
-/* Nonzero if we should step constantly (e.g. watchpoints on machines
- without hardware support). This isn't related to a specific bpstat,
- just to things like whether watchpoints are set. */
-int bpstat_should_step (/* void */);
-
-/* Print a message indicating what happened. Returns nonzero to
- say that only the source line should be printed after this (zero
- return means print the frame as well as the source line). */
-int bpstat_print (/* bpstat bs */);
-
-/* Return the breakpoint number of the first breakpoint we are stopped
- at. *BSP upon return is a bpstat which points to the remaining
- breakpoints stopped at (but which is not guaranteed to be good for
- anything but further calls to bpstat_num).
- Return 0 if passed a bpstat which does not indicate any breakpoints. */
-int bpstat_num (/* bpstat *bsp; */);
-
-/* Perform actions associated with having stopped at *BSP. */
-void bpstat_do_actions (/* bpstat bs; */);
-
-/* Modify BS so that the actions will not be performed. */
-void bpstat_clear_actions (/* bpstat bs; */);
-
-
-/* Implementation: */
-#include "value.h"
-struct bpstat__struct
-{
- /* Linked list because there can be two breakpoints at the
- same place, and a bpstat reflects the fact that both have been hit. */
- bpstat next;
- /* Breakpoint that we are at. */
- struct breakpoint *breakpoint_at;
- /* Commands left to be done. */
- struct command_line *commands;
- /* Old value associated with a watchpoint. */
- value old_val;
- /* Nonzero if we should print the frame. Only significant for the first
- bpstat in the chain. */
- char print;
- /* Nonzero if we should stop. Only significant for the first bpstat in
- the chain. */
- char stop;
- /* Nonzero if we hit a momentary breakpoint. Only significant for the
- first bpstat in the chain. */
- char momentary;
-};
-#endif /* breakpoint.h not already included. */
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
deleted file mode 100644
index 410417d..0000000
--- a/gdb/buildsym.c
+++ /dev/null
@@ -1,3097 +0,0 @@
-/* Build symbol tables in GDB's internal format.
- Copyright (C) 1986-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This module provides subroutines used for creating and adding to
- the symbol table. These routines are called from various symbol-
- file-reading routines.
-
- They originated in dbxread.c of gdb-4.2, and were split out to
- make xcoffread.c more maintainable by sharing code. */
-
-#include "defs.h"
-#include "param.h"
-#include "obstack.h"
-#include "symtab.h"
-#include "breakpoint.h"
-#include "gdbcore.h" /* for bfd stuff for symfile.h */
-#include "symfile.h" /* Needed for "struct complaint" */
-#include "stab.gnu.h" /* We always use GNU stabs, not native */
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-/* Ask buildsym.h to define the vars it normally declares `extern'. */
-#define EXTERN /**/
-#include "buildsym.h" /* Our own declarations */
-#undef EXTERN
-
-extern void qsort ();
-extern double atof ();
-
-/* Things we export from outside, and probably shouldn't. FIXME. */
-extern void new_object_header_files ();
-extern char *next_symbol_text ();
-extern int hashname ();
-extern void patch_block_stabs (); /* AIX xcoffread.c */
-extern struct type *builtin_type (); /* AIX xcoffread.c */
-
-
-static void cleanup_undefined_types ();
-static void fix_common_block ();
-
-static const char vptr_name[] = { '_','v','p','t','r',CPLUS_MARKER,'\0' };
-static const char vb_name[] = { '_','v','b',CPLUS_MARKER,'\0' };
-
-/* Define this as 1 if a pcc declaration of a char or short argument
- gives the correct address. Otherwise assume pcc gives the
- address of the corresponding int, which is not the same on a
- big-endian machine. */
-
-#ifndef BELIEVE_PCC_PROMOTION
-#define BELIEVE_PCC_PROMOTION 0
-#endif
-
-/* Make a list of forward references which haven't been defined. */
-static struct type **undef_types;
-static int undef_types_allocated, undef_types_length;
-
-/* Initial sizes of data structures. These are realloc'd larger if needed,
- and realloc'd down to the size actually used, when completed. */
-
-#define INITIAL_CONTEXT_STACK_SIZE 10
-#define INITIAL_TYPE_VECTOR_LENGTH 160
-#define INITIAL_LINE_VECTOR_LENGTH 1000
-
-/* Complaints about the symbols we have encountered. */
-
-struct complaint innerblock_complaint =
- {"inner block not inside outer block in %s", 0, 0};
-
-struct complaint blockvector_complaint =
- {"block at %x out of order", 0, 0};
-
-#if 0
-struct complaint dbx_class_complaint =
- {"encountered DBX-style class variable debugging information.\n\
-You seem to have compiled your program with \
-\"g++ -g0\" instead of \"g++ -g\".\n\
-Therefore GDB will not know about your class variables", 0, 0};
-#endif
-
-struct complaint const_vol_complaint =
- {"const/volatile indicator missing (ok if using g++ v1.x), got '%c'", 0, 0};
-
-struct complaint error_type_complaint =
- {"debug info mismatch between compiler and debugger", 0, 0};
-
-struct complaint invalid_member_complaint =
- {"invalid (minimal) member type data format at symtab pos %d.", 0, 0};
-
-struct complaint range_type_base_complaint =
- {"base type %d of range type is not defined", 0, 0};
-
-/* Look up a dbx type-number pair. Return the address of the slot
- where the type for that number-pair is stored.
- The number-pair is in TYPENUMS.
-
- This can be used for finding the type associated with that pair
- or for associating a new type with the pair. */
-
-struct type **
-dbx_lookup_type (typenums)
- int typenums[2];
-{
- register int filenum = typenums[0], index = typenums[1];
- unsigned old_len;
-
- if (filenum < 0 || filenum >= n_this_object_header_files)
- error ("Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
- filenum, index, symnum);
-
- if (filenum == 0)
- {
- /* Type is defined outside of header files.
- Find it in this object file's type vector. */
- if (index >= type_vector_length)
- {
- old_len = type_vector_length;
- if (old_len == 0) {
- type_vector_length = INITIAL_TYPE_VECTOR_LENGTH;
- type_vector = (struct type **)
- malloc (type_vector_length * sizeof (struct type *));
- }
- while (index >= type_vector_length)
- type_vector_length *= 2;
- type_vector = (struct type **)
- xrealloc (type_vector,
- (type_vector_length * sizeof (struct type *)));
- bzero (&type_vector[old_len],
- (type_vector_length - old_len) * sizeof (struct type *));
- }
- return &type_vector[index];
- }
- else
- {
- register int real_filenum = this_object_header_files[filenum];
- register struct header_file *f;
- int f_orig_length;
-
- if (real_filenum >= n_header_files)
- abort ();
-
- f = &header_files[real_filenum];
-
- f_orig_length = f->length;
- if (index >= f_orig_length)
- {
- while (index >= f->length)
- f->length *= 2;
- f->vector = (struct type **)
- xrealloc (f->vector, f->length * sizeof (struct type *));
- bzero (&f->vector[f_orig_length],
- (f->length - f_orig_length) * sizeof (struct type *));
- }
- return &f->vector[index];
- }
-}
-
-/* Create a type object. Occaisionally used when you need a type
- which isn't going to be given a type number. */
-
-struct type *
-dbx_create_type ()
-{
- register struct type *type =
- (struct type *) obstack_alloc (symbol_obstack, sizeof (struct type));
-
- bzero (type, sizeof (struct type));
- TYPE_VPTR_FIELDNO (type) = -1;
- TYPE_VPTR_BASETYPE (type) = 0;
- return type;
-}
-
-/* Make sure there is a type allocated for type numbers TYPENUMS
- and return the type object.
- This can create an empty (zeroed) type object.
- TYPENUMS may be (-1, -1) to return a new type object that is not
- put into the type vector, and so may not be referred to by number. */
-
-struct type *
-dbx_alloc_type (typenums)
- int typenums[2];
-{
- register struct type **type_addr;
- register struct type *type;
-
- if (typenums[0] != -1)
- {
- type_addr = dbx_lookup_type (typenums);
- type = *type_addr;
- }
- else
- {
- type_addr = 0;
- type = 0;
- }
-
- /* If we are referring to a type not known at all yet,
- allocate an empty type for it.
- We will fill it in later if we find out how. */
- if (type == 0)
- {
- type = dbx_create_type ();
- if (type_addr)
- *type_addr = type;
- }
-
- return type;
-}
-
-/* maintain the lists of symbols and blocks */
-
-/* Add a symbol to one of the lists of symbols. */
-void
-add_symbol_to_list (symbol, listhead)
- struct symbol *symbol;
- struct pending **listhead;
-{
- /* We keep PENDINGSIZE symbols in each link of the list.
- If we don't have a link with room in it, add a new link. */
- if (*listhead == 0 || (*listhead)->nsyms == PENDINGSIZE)
- {
- register struct pending *link;
- if (free_pendings)
- {
- link = free_pendings;
- free_pendings = link->next;
- }
- else
- link = (struct pending *) xmalloc (sizeof (struct pending));
-
- link->next = *listhead;
- *listhead = link;
- link->nsyms = 0;
- }
-
- (*listhead)->symbol[(*listhead)->nsyms++] = symbol;
-}
-
-/* Find a symbol on a pending list. */
-struct symbol *
-find_symbol_in_list (list, name, length)
- struct pending *list;
- char *name;
- int length;
-{
- int j;
-
- while (list) {
- for (j = list->nsyms; --j >= 0; ) {
- char *pp = SYMBOL_NAME (list->symbol[j]);
- if (*pp == *name && strncmp (pp, name, length) == 0 && pp[length] == '\0')
- return list->symbol[j];
- }
- list = list->next;
- }
- return NULL;
-}
-
-/* At end of reading syms, or in case of quit,
- really free as many `struct pending's as we can easily find. */
-
-/* ARGSUSED */
-void
-really_free_pendings (foo)
- int foo;
-{
- struct pending *next, *next1;
-#if 0
- struct pending_block *bnext, *bnext1;
-#endif
-
- for (next = free_pendings; next; next = next1)
- {
- next1 = next->next;
- free (next);
- }
- free_pendings = 0;
-
-#if 0 /* Now we make the links in the symbol_obstack, so don't free them. */
- for (bnext = pending_blocks; bnext; bnext = bnext1)
- {
- bnext1 = bnext->next;
- free (bnext);
- }
-#endif
- pending_blocks = 0;
-
- for (next = file_symbols; next; next = next1)
- {
- next1 = next->next;
- free (next);
- }
- file_symbols = 0;
-
- for (next = global_symbols; next; next = next1)
- {
- next1 = next->next;
- free (next);
- }
- global_symbols = 0;
-}
-
-/* Take one of the lists of symbols and make a block from it.
- Keep the order the symbols have in the list (reversed from the input file).
- Put the block on the list of pending blocks. */
-
-void
-finish_block (symbol, listhead, old_blocks, start, end)
- struct symbol *symbol;
- struct pending **listhead;
- struct pending_block *old_blocks;
- CORE_ADDR start, end;
-{
- register struct pending *next, *next1;
- register struct block *block;
- register struct pending_block *pblock;
- struct pending_block *opblock;
- register int i;
-
- /* Count the length of the list of symbols. */
-
- for (next = *listhead, i = 0;
- next;
- i += next->nsyms, next = next->next)
- /*EMPTY*/;
-
- block = (struct block *) obstack_alloc (symbol_obstack,
- (sizeof (struct block) + ((i - 1) * sizeof (struct symbol *))));
-
- /* Copy the symbols into the block. */
-
- BLOCK_NSYMS (block) = i;
- for (next = *listhead; next; next = next->next)
- {
- register int j;
- for (j = next->nsyms - 1; j >= 0; j--)
- BLOCK_SYM (block, --i) = next->symbol[j];
- }
-
- BLOCK_START (block) = start;
- BLOCK_END (block) = end;
- BLOCK_SUPERBLOCK (block) = 0; /* Filled in when containing block is made */
- BLOCK_GCC_COMPILED (block) = processing_gcc_compilation;
-
- /* Put the block in as the value of the symbol that names it. */
-
- if (symbol)
- {
- SYMBOL_BLOCK_VALUE (symbol) = block;
- BLOCK_FUNCTION (block) = symbol;
- }
- else
- BLOCK_FUNCTION (block) = 0;
-
- /* Now "free" the links of the list, and empty the list. */
-
- for (next = *listhead; next; next = next1)
- {
- next1 = next->next;
- next->next = free_pendings;
- free_pendings = next;
- }
- *listhead = 0;
-
- /* Install this block as the superblock
- of all blocks made since the start of this scope
- that don't have superblocks yet. */
-
- opblock = 0;
- for (pblock = pending_blocks; pblock != old_blocks; pblock = pblock->next)
- {
- if (BLOCK_SUPERBLOCK (pblock->block) == 0) {
-#if 1
- /* Check to be sure the blocks are nested as we receive them.
- If the compiler/assembler/linker work, this just burns a small
- amount of time. */
- if (BLOCK_START (pblock->block) < BLOCK_START (block)
- || BLOCK_END (pblock->block) > BLOCK_END (block)) {
- complain(&innerblock_complaint, symbol? SYMBOL_NAME (symbol):
- "(don't know)");
- BLOCK_START (pblock->block) = BLOCK_START (block);
- BLOCK_END (pblock->block) = BLOCK_END (block);
- }
-#endif
- BLOCK_SUPERBLOCK (pblock->block) = block;
- }
- opblock = pblock;
- }
-
- /* Record this block on the list of all blocks in the file.
- Put it after opblock, or at the beginning if opblock is 0.
- This puts the block in the list after all its subblocks. */
-
- /* Allocate in the symbol_obstack to save time.
- It wastes a little space. */
- pblock = (struct pending_block *)
- obstack_alloc (symbol_obstack,
- sizeof (struct pending_block));
- pblock->block = block;
- if (opblock)
- {
- pblock->next = opblock->next;
- opblock->next = pblock;
- }
- else
- {
- pblock->next = pending_blocks;
- pending_blocks = pblock;
- }
-}
-
-struct blockvector *
-make_blockvector ()
-{
- register struct pending_block *next;
- register struct blockvector *blockvector;
- register int i;
-
- /* Count the length of the list of blocks. */
-
- for (next = pending_blocks, i = 0; next; next = next->next, i++);
-
- blockvector = (struct blockvector *)
- obstack_alloc (symbol_obstack,
- (sizeof (struct blockvector)
- + (i - 1) * sizeof (struct block *)));
-
- /* Copy the blocks into the blockvector.
- This is done in reverse order, which happens to put
- the blocks into the proper order (ascending starting address).
- finish_block has hair to insert each block into the list
- after its subblocks in order to make sure this is true. */
-
- BLOCKVECTOR_NBLOCKS (blockvector) = i;
- for (next = pending_blocks; next; next = next->next) {
- BLOCKVECTOR_BLOCK (blockvector, --i) = next->block;
- }
-
-#if 0 /* Now we make the links in the obstack, so don't free them. */
- /* Now free the links of the list, and empty the list. */
-
- for (next = pending_blocks; next; next = next1)
- {
- next1 = next->next;
- free (next);
- }
-#endif
- pending_blocks = 0;
-
-#if 1 /* FIXME, shut this off after a while to speed up symbol reading. */
- /* Some compilers output blocks in the wrong order, but we depend
- on their being in the right order so we can binary search.
- Check the order and moan about it. FIXME. */
- if (BLOCKVECTOR_NBLOCKS (blockvector) > 1)
- for (i = 1; i < BLOCKVECTOR_NBLOCKS (blockvector); i++) {
- if (BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i-1))
- > BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i))) {
- complain (&blockvector_complaint,
- BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i)));
- }
- }
-#endif
-
- return blockvector;
-}
-
-/* Start recording information about source code that came from an included
- (or otherwise merged-in) source file with a different name. */
-
-void
-start_subfile (name, dirname)
- char *name;
- char *dirname;
-{
- register struct subfile *subfile;
-
- /* See if this subfile is already known as a subfile of the
- current main source file. */
-
- for (subfile = subfiles; subfile; subfile = subfile->next)
- {
- if (!strcmp (subfile->name, name))
- {
- current_subfile = subfile;
- return;
- }
- }
-
- /* This subfile is not known. Add an entry for it.
- Make an entry for this subfile in the list of all subfiles
- of the current main source file. */
-
- subfile = (struct subfile *) xmalloc (sizeof (struct subfile));
- subfile->next = subfiles;
- subfiles = subfile;
- current_subfile = subfile;
-
- /* Save its name and compilation directory name */
- subfile->name = obsavestring (name, strlen (name));
- if (dirname == NULL)
- subfile->dirname = NULL;
- else
- subfile->dirname = obsavestring (dirname, strlen (dirname));
-
- /* Initialize line-number recording for this subfile. */
- subfile->line_vector = 0;
-}
-
-/* Handle the N_BINCL and N_EINCL symbol types
- that act like N_SOL for switching source files
- (different subfiles, as we call them) within one object file,
- but using a stack rather than in an arbitrary order. */
-
-void
-push_subfile ()
-{
- register struct subfile_stack *tem
- = (struct subfile_stack *) xmalloc (sizeof (struct subfile_stack));
-
- tem->next = subfile_stack;
- subfile_stack = tem;
- if (current_subfile == 0 || current_subfile->name == 0)
- abort ();
- tem->name = current_subfile->name;
- tem->prev_index = header_file_prev_index;
-}
-
-char *
-pop_subfile ()
-{
- register char *name;
- register struct subfile_stack *link = subfile_stack;
-
- if (link == 0)
- abort ();
-
- name = link->name;
- subfile_stack = link->next;
- header_file_prev_index = link->prev_index;
- free (link);
-
- return name;
-}
-
-/* Manage the vector of line numbers for each subfile. */
-
-void
-record_line (subfile, line, pc)
- register struct subfile *subfile;
- int line;
- CORE_ADDR pc;
-{
- struct linetable_entry *e;
- /* Ignore the dummy line number in libg.o */
-
- if (line == 0xffff)
- return;
-
- /* Make sure line vector exists and is big enough. */
- if (!subfile->line_vector) {
- subfile->line_vector_length = INITIAL_LINE_VECTOR_LENGTH;
- subfile->line_vector = (struct linetable *)
- xmalloc (sizeof (struct linetable)
- + subfile->line_vector_length * sizeof (struct linetable_entry));
- subfile->line_vector->nitems = 0;
- }
-
- if (subfile->line_vector->nitems + 1 >= subfile->line_vector_length)
- {
- subfile->line_vector_length *= 2;
- subfile->line_vector = (struct linetable *)
- xrealloc (subfile->line_vector, (sizeof (struct linetable)
- + subfile->line_vector_length * sizeof (struct linetable_entry)));
- }
-
- e = subfile->line_vector->item + subfile->line_vector->nitems++;
- e->line = line; e->pc = pc;
-}
-
-
-/* Needed in order to sort line tables from IBM xcoff files. Sigh! */
-
-/* static */
-int
-compare_line_numbers (ln1, ln2)
- struct linetable_entry *ln1, *ln2;
-{
- return ln1->line - ln2->line;
-}
-
-/* Start a new symtab for a new source file.
- This is called when a dbx symbol of type N_SO is seen;
- it indicates the start of data for one original source file. */
-
-void
-start_symtab (name, dirname, start_addr)
- char *name;
- char *dirname;
- CORE_ADDR start_addr;
-{
-
- last_source_file = name;
- last_source_start_addr = start_addr;
- file_symbols = 0;
- global_symbols = 0;
- global_stabs = 0; /* AIX COFF */
- file_stabs = 0; /* AIX COFF */
- within_function = 0;
-
- /* Context stack is initially empty. Allocate first one with room for
- 10 levels; reuse it forever afterward. */
- if (context_stack == 0) {
- context_stack_size = INITIAL_CONTEXT_STACK_SIZE;
- context_stack = (struct context_stack *)
- xmalloc (context_stack_size * sizeof (struct context_stack));
- }
- context_stack_depth = 0;
-
- new_object_header_files ();
-
- type_vector_length = 0;
- type_vector = (struct type **) 0;
-
- /* Initialize the list of sub source files with one entry
- for this file (the top-level source file). */
-
- subfiles = 0;
- current_subfile = 0;
- start_subfile (name, dirname);
-}
-
-/* Finish the symbol definitions for one main source file,
- close off all the lexical contexts for that file
- (creating struct block's for them), then make the struct symtab
- for that file and put it in the list of all such.
-
- END_ADDR is the address of the end of the file's text. */
-
-struct symtab *
-end_symtab (end_addr, sort_pending, sort_linevec, objfile)
- CORE_ADDR end_addr;
- int sort_pending;
- int sort_linevec;
- struct objfile *objfile;
-{
- register struct symtab *symtab;
- register struct blockvector *blockvector;
- register struct subfile *subfile;
- struct subfile *nextsub;
-
- /* Finish the lexical context of the last function in the file;
- pop the context stack. */
-
- if (context_stack_depth > 0)
- {
- register struct context_stack *cstk;
- context_stack_depth--;
- cstk = &context_stack[context_stack_depth];
- /* Make a block for the local symbols within. */
- finish_block (cstk->name, &local_symbols, cstk->old_blocks,
- cstk->start_addr, end_addr);
-
- /* Debug: if context stack still has something in it, we are in
- trouble. */
- if (context_stack_depth > 0)
- abort ();
- }
-
- /* It is unfortunate that in aixcoff, pending blocks might not be ordered
- in this stage. Especially, blocks for static functions will show up at
- the end. We need to sort them, so tools like `find_pc_function' and
- `find_pc_block' can work reliably. */
- if (sort_pending && pending_blocks) {
- /* FIXME! Remove this horrid bubble sort and use qsort!!! */
- int swapped;
- do {
- struct pending_block *pb, *pbnext;
-
- pb = pending_blocks, pbnext = pb->next;
- swapped = 0;
-
- while ( pbnext ) {
-
- /* swap blocks if unordered! */
-
- if (BLOCK_START(pb->block) < BLOCK_START(pbnext->block)) {
- struct block *tmp = pb->block;
- pb->block = pbnext->block;
- pbnext->block = tmp;
- swapped = 1;
- }
- pb = pbnext;
- pbnext = pbnext->next;
- }
- } while (swapped);
- }
-
- /* Cleanup any undefined types that have been left hanging around
- (this needs to be done before the finish_blocks so that
- file_symbols is still good). */
- cleanup_undefined_types ();
-
- /* Hooks for xcoffread.c */
- if (file_stabs) {
- patch_block_stabs (file_symbols, file_stabs);
- free (file_stabs);
- file_stabs = 0;
- }
-
- if (global_stabs) {
- patch_block_stabs (global_symbols, global_stabs);
- free (global_stabs);
- global_stabs = 0;
- }
-
- if (pending_blocks == 0
- && file_symbols == 0
- && global_symbols == 0) {
- /* Ignore symtabs that have no functions with real debugging info */
- blockvector = NULL;
- } else {
- /* Define the STATIC_BLOCK and GLOBAL_BLOCK, and build the blockvector. */
- finish_block (0, &file_symbols, 0, last_source_start_addr, end_addr);
- finish_block (0, &global_symbols, 0, last_source_start_addr, end_addr);
- blockvector = make_blockvector ();
- }
-
- /* Now create the symtab objects proper, one for each subfile. */
- /* (The main file is the last one on the chain.) */
-
- for (subfile = subfiles; subfile; subfile = nextsub)
- {
- /* If we have blocks of symbols, make a symtab.
- Otherwise, just ignore this file and any line number info in it. */
- symtab = 0;
- if (blockvector) {
- if (subfile->line_vector) {
- /* First, shrink the linetable to make more memory. */
- subfile->line_vector = (struct linetable *)
- xrealloc (subfile->line_vector, (sizeof (struct linetable)
- + subfile->line_vector->nitems * sizeof (struct linetable_entry)));
-
- if (sort_linevec)
- qsort (subfile->line_vector->item, subfile->line_vector->nitems,
- sizeof (struct linetable_entry), compare_line_numbers);
- }
-
- /* Now, allocate a symbol table. */
- symtab = allocate_symtab (subfile->name, objfile);
-
- /* Fill in its components. */
- symtab->blockvector = blockvector;
- symtab->linetable = subfile->line_vector;
- symtab->dirname = subfile->dirname;
- symtab->free_code = free_linetable;
- symtab->free_ptr = 0;
-
- /* Link the new symtab into the list of such. */
- symtab->next = symtab_list;
- symtab_list = symtab;
- } else {
- /* No blocks for this file. Delete any line number info we have
- for it. */
- if (subfile->line_vector)
- free (subfile->line_vector);
- }
-
- nextsub = subfile->next;
- free (subfile);
- }
-
- if (type_vector)
- free ((char *) type_vector);
- type_vector = 0;
- type_vector_length = 0;
-
- last_source_file = 0;
- current_subfile = 0;
-
- return symtab;
-}
-
-
-/* Push a context block. Args are an identifying nesting level (checkable
- when you pop it), and the starting PC address of this context. */
-
-struct context_stack *
-push_context (desc, valu)
- int desc;
- CORE_ADDR valu;
-{
- register struct context_stack *new;
-
- if (context_stack_depth == context_stack_size)
- {
- context_stack_size *= 2;
- context_stack = (struct context_stack *)
- xrealloc (context_stack,
- (context_stack_size
- * sizeof (struct context_stack)));
- }
-
- new = &context_stack[context_stack_depth++];
- new->depth = desc;
- new->locals = local_symbols;
- new->old_blocks = pending_blocks;
- new->start_addr = valu;
- new->name = 0;
-
- local_symbols = 0;
-
- return new;
-}
-
-/* Initialize anything that needs initializing when starting to read
- a fresh piece of a symbol file, e.g. reading in the stuff corresponding
- to a psymtab. */
-
-void
-buildsym_init ()
-{
- free_pendings = 0;
- file_symbols = 0;
- global_symbols = 0;
- pending_blocks = 0;
-}
-
-/* Initialize anything that needs initializing when a completely new
- symbol file is specified (not just adding some symbols from another
- file, e.g. a shared library). */
-
-void
-buildsym_new_init ()
-{
- /* Empty the hash table of global syms looking for values. */
- bzero (global_sym_chain, sizeof global_sym_chain);
-
- buildsym_init ();
-}
-
-/* Scan through all of the global symbols defined in the object file,
- assigning values to the debugging symbols that need to be assigned
- to. Get these symbols from the misc function list. */
-
-void
-scan_file_globals ()
-{
- int hash;
- int mf;
-
- for (mf = 0; mf < misc_function_count; mf++)
- {
- char *namestring = misc_function_vector[mf].name;
- struct symbol *sym, *prev;
-
- QUIT;
-
- prev = (struct symbol *) 0;
-
- /* Get the hash index and check all the symbols
- under that hash index. */
-
- hash = hashname (namestring);
-
- for (sym = global_sym_chain[hash]; sym;)
- {
- if (*namestring == SYMBOL_NAME (sym)[0]
- && !strcmp(namestring + 1, SYMBOL_NAME (sym) + 1))
- {
- /* Splice this symbol out of the hash chain and
- assign the value we have to it. */
- if (prev)
- SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
- else
- global_sym_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
-
- /* Check to see whether we need to fix up a common block. */
- /* Note: this code might be executed several times for
- the same symbol if there are multiple references. */
- if (SYMBOL_CLASS (sym) == LOC_BLOCK)
- fix_common_block (sym, misc_function_vector[mf].address);
- else
- SYMBOL_VALUE_ADDRESS (sym) = misc_function_vector[mf].address;
-
- if (prev)
- sym = SYMBOL_VALUE_CHAIN (prev);
- else
- sym = global_sym_chain[hash];
- }
- else
- {
- prev = sym;
- sym = SYMBOL_VALUE_CHAIN (sym);
- }
- }
- }
-}
-
-
-/* Read a number by which a type is referred to in dbx data,
- or perhaps read a pair (FILENUM, TYPENUM) in parentheses.
- Just a single number N is equivalent to (0,N).
- Return the two numbers by storing them in the vector TYPENUMS.
- TYPENUMS will then be used as an argument to dbx_lookup_type. */
-
-void
-read_type_number (pp, typenums)
- register char **pp;
- register int *typenums;
-{
- if (**pp == '(')
- {
- (*pp)++;
- typenums[0] = read_number (pp, ',');
- typenums[1] = read_number (pp, ')');
- }
- else
- {
- typenums[0] = 0;
- typenums[1] = read_number (pp, 0);
- }
-}
-
-/* To handle GNU C++ typename abbreviation, we need to be able to
- fill in a type's name as soon as space for that type is allocated.
- `type_synonym_name' is the name of the type being allocated.
- It is cleared as soon as it is used (lest all allocated types
- get this name). */
-static char *type_synonym_name;
-
-/* ARGSUSED */
-struct symbol *
-define_symbol (valu, string, desc, type)
- unsigned int valu;
- char *string;
- int desc;
- int type;
-{
- register struct symbol *sym;
- char *p = (char *) strchr (string, ':');
- int deftype;
- int synonym = 0;
- register int i;
-
- /* Ignore syms with empty names. */
- if (string[0] == 0)
- return 0;
-
- /* Ignore old-style symbols from cc -go */
- if (p == 0)
- return 0;
-
- sym = (struct symbol *)obstack_alloc (symbol_obstack, sizeof (struct symbol));
-
- if (processing_gcc_compilation) {
- /* GCC 2.x puts the line number in desc. SunOS apparently puts in the
- number of bytes occupied by a type or object, which we ignore. */
- SYMBOL_LINE(sym) = desc;
- } else {
- SYMBOL_LINE(sym) = 0; /* unknown */
- }
-
- if (string[0] == CPLUS_MARKER)
- {
- /* Special GNU C++ names. */
- switch (string[1])
- {
- case 't':
- SYMBOL_NAME (sym) = "this";
- break;
- case 'v': /* $vtbl_ptr_type */
- /* Was: SYMBOL_NAME (sym) = "vptr"; */
- goto normal;
- case 'e':
- SYMBOL_NAME (sym) = "eh_throw";
- break;
-
- case '_':
- /* This was an anonymous type that was never fixed up. */
- goto normal;
-
- default:
- abort ();
- }
- }
- else
- {
- normal:
- SYMBOL_NAME (sym)
- = (char *) obstack_alloc (symbol_obstack, ((p - string) + 1));
- /* Open-coded bcopy--saves function call time. */
- {
- register char *p1 = string;
- register char *p2 = SYMBOL_NAME (sym);
- while (p1 != p)
- *p2++ = *p1++;
- *p2++ = '\0';
- }
- }
- p++;
- /* Determine the type of name being defined. */
- /* The Acorn RISC machine's compiler can put out locals that don't
- start with "234=" or "(3,4)=", so assume anything other than the
- deftypes we know how to handle is a local. */
- /* (Peter Watkins @ Computervision)
- Handle Sun-style local fortran array types 'ar...' .
- (gnu@cygnus.com) -- this strchr() handles them properly?
- (tiemann@cygnus.com) -- 'C' is for catch. */
- if (!strchr ("cfFGpPrStTvVXC", *p))
- deftype = 'l';
- else
- deftype = *p++;
-
- /* c is a special case, not followed by a type-number.
- SYMBOL:c=iVALUE for an integer constant symbol.
- SYMBOL:c=rVALUE for a floating constant symbol.
- SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
- e.g. "b:c=e6,0" for "const b = blob1"
- (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
- if (deftype == 'c')
- {
- if (*p++ != '=')
- error ("Invalid symbol data at symtab pos %d.", symnum);
- switch (*p++)
- {
- case 'r':
- {
- double d = atof (p);
- char *dbl_valu;
-
- SYMBOL_TYPE (sym) = builtin_type_double;
- dbl_valu =
- (char *) obstack_alloc (symbol_obstack, sizeof (double));
- bcopy (&d, dbl_valu, sizeof (double));
- SWAP_TARGET_AND_HOST (dbl_valu, sizeof (double));
- SYMBOL_VALUE_BYTES (sym) = dbl_valu;
- SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
- }
- break;
- case 'i':
- {
- SYMBOL_TYPE (sym) = builtin_type_int;
- SYMBOL_VALUE (sym) = atoi (p);
- SYMBOL_CLASS (sym) = LOC_CONST;
- }
- break;
- case 'e':
- /* SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
- e.g. "b:c=e6,0" for "const b = blob1"
- (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
- {
- int typenums[2];
-
- read_type_number (&p, typenums);
- if (*p++ != ',')
- error ("Invalid symbol data: no comma in enum const symbol");
-
- SYMBOL_TYPE (sym) = *dbx_lookup_type (typenums);
- SYMBOL_VALUE (sym) = atoi (p);
- SYMBOL_CLASS (sym) = LOC_CONST;
- }
- break;
- default:
- error ("Invalid symbol data at symtab pos %d.", symnum);
- }
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &file_symbols);
- return sym;
- }
-
- /* Now usually comes a number that says which data type,
- and possibly more stuff to define the type
- (all of which is handled by read_type) */
-
- if (deftype == 'p' && *p == 'F')
- /* pF is a two-letter code that means a function parameter in Fortran.
- The type-number specifies the type of the return value.
- Translate it into a pointer-to-function type. */
- {
- p++;
- SYMBOL_TYPE (sym)
- = lookup_pointer_type (lookup_function_type (read_type (&p)));
- }
- else
- {
- struct type *type_read;
- synonym = *p == 't';
-
- if (synonym)
- {
- p += 1;
- type_synonym_name = obsavestring (SYMBOL_NAME (sym),
- strlen (SYMBOL_NAME (sym)));
- }
-
- type_read = read_type (&p);
-
- if ((deftype == 'F' || deftype == 'f')
- && TYPE_CODE (type_read) != TYPE_CODE_FUNC)
- {
-#if 0
-/* This code doesn't work -- it needs to realloc and can't. */
- struct type *new = (struct type *)
- obstack_alloc (symbol_obstack, sizeof (struct type));
-
- /* Generate a template for the type of this function. The
- types of the arguments will be added as we read the symbol
- table. */
- *new = *lookup_function_type (type_read);
- SYMBOL_TYPE(sym) = new;
- in_function_type = new;
-#else
- SYMBOL_TYPE (sym) = lookup_function_type (type_read);
-#endif
- }
- else
- SYMBOL_TYPE (sym) = type_read;
- }
-
- switch (deftype)
- {
- case 'C':
- /* The name of a caught exception. */
- SYMBOL_CLASS (sym) = LOC_LABEL;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- SYMBOL_VALUE_ADDRESS (sym) = valu;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'f':
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &file_symbols);
- break;
-
- case 'F':
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &global_symbols);
- break;
-
- case 'G':
- /* For a class G (global) symbol, it appears that the
- value is not correct. It is necessary to search for the
- corresponding linker definition to find the value.
- These definitions appear at the end of the namelist. */
- i = hashname (SYMBOL_NAME (sym));
- SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
- global_sym_chain[i] = sym;
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &global_symbols);
- break;
-
- /* This case is faked by a conditional above,
- when there is no code letter in the dbx data.
- Dbx data never actually contains 'l'. */
- case 'l':
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'p':
- /* Normally this is a parameter, a LOC_ARG. On the i960, it
- can also be a LOC_LOCAL_ARG depending on symbol type. */
-#ifndef DBX_PARM_SYMBOL_CLASS
-#define DBX_PARM_SYMBOL_CLASS(type) LOC_ARG
-#endif
- SYMBOL_CLASS (sym) = DBX_PARM_SYMBOL_CLASS (type);
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
-#if 0
- /* This doesn't work yet. */
- add_param_to_type (&in_function_type, sym);
-#endif
- add_symbol_to_list (sym, &local_symbols);
-
- /* If it's gcc-compiled, if it says `short', believe it. */
- if (processing_gcc_compilation || BELIEVE_PCC_PROMOTION)
- break;
-
-#if defined(BELIEVE_PCC_PROMOTION_TYPE)
- /* This macro is defined on machines (e.g. sparc) where
- we should believe the type of a PCC 'short' argument,
- but shouldn't believe the address (the address is
- the address of the corresponding int). Note that
- this is only different from the BELIEVE_PCC_PROMOTION
- case on big-endian machines.
-
- My guess is that this correction, as opposed to changing
- the parameter to an 'int' (as done below, for PCC
- on most machines), is the right thing to do
- on all machines, but I don't want to risk breaking
- something that already works. On most PCC machines,
- the sparc problem doesn't come up because the calling
- function has to zero the top bytes (not knowing whether
- the called function wants an int or a short), so there
- is no practical difference between an int and a short
- (except perhaps what happens when the GDB user types
- "print short_arg = 0x10000;").
-
- Hacked for SunOS 4.1 by gnu@cygnus.com. In 4.1, the compiler
- actually produces the correct address (we don't need to fix it
- up). I made this code adapt so that it will offset the symbol
- if it was pointing at an int-aligned location and not
- otherwise. This way you can use the same gdb for 4.0.x and
- 4.1 systems. */
-
- if (0 == SYMBOL_VALUE (sym) % sizeof (int))
- {
- if (SYMBOL_TYPE (sym) == builtin_type_char
- || SYMBOL_TYPE (sym) == builtin_type_unsigned_char)
- SYMBOL_VALUE (sym) += 3;
- else if (SYMBOL_TYPE (sym) == builtin_type_short
- || SYMBOL_TYPE (sym) == builtin_type_unsigned_short)
- SYMBOL_VALUE (sym) += 2;
- }
- break;
-
-#else /* no BELIEVE_PCC_PROMOTION_TYPE. */
-
- /* If PCC says a parameter is a short or a char,
- it is really an int. */
- if (SYMBOL_TYPE (sym) == builtin_type_char
- || SYMBOL_TYPE (sym) == builtin_type_short)
- SYMBOL_TYPE (sym) = builtin_type_int;
- else if (SYMBOL_TYPE (sym) == builtin_type_unsigned_char
- || SYMBOL_TYPE (sym) == builtin_type_unsigned_short)
- SYMBOL_TYPE (sym) = builtin_type_unsigned_int;
- break;
-
-#endif /* no BELIEVE_PCC_PROMOTION_TYPE. */
-
- case 'P':
- SYMBOL_CLASS (sym) = LOC_REGPARM;
- SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'r':
- SYMBOL_CLASS (sym) = LOC_REGISTER;
- SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'S':
- /* Static symbol at top level of file */
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &file_symbols);
- break;
-
- case 't':
- SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0
- && (TYPE_FLAGS (SYMBOL_TYPE (sym)) & TYPE_FLAG_PERM) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym)) =
- obsavestring (SYMBOL_NAME (sym),
- strlen (SYMBOL_NAME (sym)));
- /* C++ vagaries: we may have a type which is derived from
- a base type which did not have its name defined when the
- derived class was output. We fill in the derived class's
- base part member's name here in that case. */
- else if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
- || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_UNION)
- && TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)))
- {
- int j;
- for (j = TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)) - 1; j >= 0; j--)
- if (TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) == 0)
- TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) =
- type_name_no_tag (TYPE_BASECLASS (SYMBOL_TYPE (sym), j));
- }
-
- add_symbol_to_list (sym, &file_symbols);
- break;
-
- case 'T':
- SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
- if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0
- && (TYPE_FLAGS (SYMBOL_TYPE (sym)) & TYPE_FLAG_PERM) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym))
- = obconcat ("",
- (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_ENUM
- ? "enum "
- : (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
- ? "struct " : "union ")),
- SYMBOL_NAME (sym));
- add_symbol_to_list (sym, &file_symbols);
-
- if (synonym)
- {
- register struct symbol *typedef_sym
- = (struct symbol *) obstack_alloc (symbol_obstack, sizeof (struct symbol));
- SYMBOL_NAME (typedef_sym) = SYMBOL_NAME (sym);
- SYMBOL_TYPE (typedef_sym) = SYMBOL_TYPE (sym);
-
- SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
- SYMBOL_VALUE (typedef_sym) = valu;
- SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE;
- add_symbol_to_list (typedef_sym, &file_symbols);
- }
- break;
-
- case 'V':
- /* Static symbol of local scope */
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'v':
- /* Reference parameter */
- SYMBOL_CLASS (sym) = LOC_REF_ARG;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'X':
- /* This is used by Sun FORTRAN for "function result value".
- Sun claims ("dbx and dbxtool interfaces", 2nd ed)
- that Pascal uses it too, but when I tried it Pascal used
- "x:3" (local symbol) instead. */
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- default:
- error ("Invalid symbol data: unknown symbol-type code `%c' at symtab pos %d.", deftype, symnum);
- }
- return sym;
-}
-
-/* What about types defined as forward references inside of a small lexical
- scope? */
-/* Add a type to the list of undefined types to be checked through
- once this file has been read in. */
-void
-add_undefined_type (type)
- struct type *type;
-{
- if (undef_types_length == undef_types_allocated)
- {
- undef_types_allocated *= 2;
- undef_types = (struct type **)
- xrealloc (undef_types,
- undef_types_allocated * sizeof (struct type *));
- }
- undef_types[undef_types_length++] = type;
-}
-
-/* Add here something to go through each undefined type, see if it's
- still undefined, and do a full lookup if so. */
-static void
-cleanup_undefined_types ()
-{
- struct type **type;
-
- for (type = undef_types; type < undef_types + undef_types_length; type++)
- {
- /* Reasonable test to see if it's been defined since. */
- if (TYPE_NFIELDS (*type) == 0)
- {
- struct pending *ppt;
- int i;
- /* Name of the type, without "struct" or "union" */
- char *typename = TYPE_NAME (*type);
-
- if (!strncmp (typename, "struct ", 7))
- typename += 7;
- if (!strncmp (typename, "union ", 6))
- typename += 6;
-
- for (ppt = file_symbols; ppt; ppt = ppt->next)
- for (i = 0; i < ppt->nsyms; i++)
- {
- struct symbol *sym = ppt->symbol[i];
-
- if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
- && SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE
- && (TYPE_CODE (SYMBOL_TYPE (sym)) ==
- TYPE_CODE (*type))
- && !strcmp (SYMBOL_NAME (sym), typename))
- bcopy (SYMBOL_TYPE (sym), *type, sizeof (struct type));
- }
- }
- else
- /* It has been defined; don't mark it as a stub. */
- TYPE_FLAGS (*type) &= ~TYPE_FLAG_STUB;
- }
- undef_types_length = 0;
-}
-
-/* Skip rest of this symbol and return an error type.
-
- General notes on error recovery: error_type always skips to the
- end of the symbol (modulo cretinous dbx symbol name continuation).
- Thus code like this:
-
- if (*(*pp)++ != ';')
- return error_type (pp);
-
- is wrong because if *pp starts out pointing at '\0' (typically as the
- result of an earlier error), it will be incremented to point to the
- start of the next symbol, which might produce strange results, at least
- if you run off the end of the string table. Instead use
-
- if (**pp != ';')
- return error_type (pp);
- ++*pp;
-
- or
-
- if (**pp != ';')
- foo = error_type (pp);
- else
- ++*pp;
-
- And in case it isn't obvious, the point of all this hair is so the compiler
- can define new types and new syntaxes, and old versions of the
- debugger will be able to read the new symbol tables. */
-
-struct type *
-error_type (pp)
- char **pp;
-{
- complain (&error_type_complaint, 0);
- while (1)
- {
- /* Skip to end of symbol. */
- while (**pp != '\0')
- (*pp)++;
-
- /* Check for and handle cretinous dbx symbol name continuation! */
- if ((*pp)[-1] == '\\')
- *pp = next_symbol_text ();
- else
- break;
- }
- return builtin_type_error;
-}
-
-/* Read a dbx type reference or definition;
- return the type that is meant.
- This can be just a number, in which case it references
- a type already defined and placed in type_vector.
- Or the number can be followed by an =, in which case
- it means to define a new type according to the text that
- follows the =. */
-
-struct type *
-read_type (pp)
- register char **pp;
-{
- register struct type *type = 0;
- struct type *type1;
- int typenums[2];
- int xtypenums[2];
-
- /* Read type number if present. The type number may be omitted.
- for instance in a two-dimensional array declared with type
- "ar1;1;10;ar1;1;10;4". */
- if ((**pp >= '0' && **pp <= '9')
- || **pp == '(')
- {
- read_type_number (pp, typenums);
-
- /* Type is not being defined here. Either it already exists,
- or this is a forward reference to it. dbx_alloc_type handles
- both cases. */
- if (**pp != '=')
- return dbx_alloc_type (typenums);
-
- /* Type is being defined here. */
-#if 0 /* Callers aren't prepared for a NULL result! FIXME -- metin! */
- {
- struct type *tt;
-
- /* if such a type already exists, this is an unnecessary duplication
- of the stab string, which is common in (RS/6000) xlc generated
- objects. In that case, simply return NULL and let the caller take
- care of it. */
-
- tt = *dbx_lookup_type (typenums);
- if (tt && tt->length && tt->code)
- return NULL;
- }
-#endif
-
- *pp += 2;
- }
- else
- {
- /* 'typenums=' not present, type is anonymous. Read and return
- the definition, but don't put it in the type vector. */
- typenums[0] = typenums[1] = -1;
- *pp += 1;
- }
-
- switch ((*pp)[-1])
- {
- case 'x':
- {
- enum type_code code;
-
- /* Used to index through file_symbols. */
- struct pending *ppt;
- int i;
-
- /* Name including "struct", etc. */
- char *type_name;
-
- /* Name without "struct", etc. */
- char *type_name_only;
-
- {
- char *prefix;
- char *from, *to;
-
- /* Set the type code according to the following letter. */
- switch ((*pp)[0])
- {
- case 's':
- code = TYPE_CODE_STRUCT;
- prefix = "struct ";
- break;
- case 'u':
- code = TYPE_CODE_UNION;
- prefix = "union ";
- break;
- case 'e':
- code = TYPE_CODE_ENUM;
- prefix = "enum ";
- break;
- default:
- return error_type (pp);
- }
-
- to = type_name = (char *)
- obstack_alloc (symbol_obstack,
- (strlen (prefix) +
- ((char *) strchr (*pp, ':') - (*pp)) + 1));
-
- /* Copy the prefix. */
- from = prefix;
- while (*to++ = *from++)
- ;
- to--;
-
- type_name_only = to;
-
- /* Copy the name. */
- from = *pp + 1;
- while ((*to++ = *from++) != ':')
- ;
- *--to = '\0';
-
- /* Set the pointer ahead of the name which we just read. */
- *pp = from;
-
-#if 0
- /* The following hack is clearly wrong, because it doesn't
- check whether we are in a baseclass. I tried to reproduce
- the case that it is trying to fix, but I couldn't get
- g++ to put out a cross reference to a basetype. Perhaps
- it doesn't do it anymore. */
- /* Note: for C++, the cross reference may be to a base type which
- has not yet been seen. In this case, we skip to the comma,
- which will mark the end of the base class name. (The ':'
- at the end of the base class name will be skipped as well.)
- But sometimes (ie. when the cross ref is the last thing on
- the line) there will be no ','. */
- from = (char *) strchr (*pp, ',');
- if (from)
- *pp = from;
-#endif /* 0 */
- }
-
- /* Now check to see whether the type has already been declared. */
- /* This is necessary at least in the case where the
- program says something like
- struct foo bar[5];
- The compiler puts out a cross-reference; we better find
- set the length of the structure correctly so we can
- set the length of the array. */
- for (ppt = file_symbols; ppt; ppt = ppt->next)
- for (i = 0; i < ppt->nsyms; i++)
- {
- struct symbol *sym = ppt->symbol[i];
-
- if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
- && SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE
- && (TYPE_CODE (SYMBOL_TYPE (sym)) == code)
- && !strcmp (SYMBOL_NAME (sym), type_name_only))
- {
- obstack_free (symbol_obstack, type_name);
- type = SYMBOL_TYPE (sym);
- return type;
- }
- }
-
- /* Didn't find the type to which this refers, so we must
- be dealing with a forward reference. Allocate a type
- structure for it, and keep track of it so we can
- fill in the rest of the fields when we get the full
- type. */
- type = dbx_alloc_type (typenums);
- TYPE_CODE (type) = code;
- TYPE_NAME (type) = type_name;
- if (code == TYPE_CODE_STRUCT)
- {
- TYPE_CPLUS_SPECIFIC (type)
- = (struct cplus_struct_type *) obstack_alloc (symbol_obstack, sizeof (struct cplus_struct_type));
- bzero (TYPE_CPLUS_SPECIFIC (type), sizeof (struct cplus_struct_type));
- }
-
- TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
-
- add_undefined_type (type);
- return type;
- }
-
- case '-': /* RS/6000 built-in type */
- (*pp)--;
- type = builtin_type (pp); /* (in xcoffread.c) */
- goto after_digits;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case '(':
- (*pp)--;
- read_type_number (pp, xtypenums);
- type = *dbx_lookup_type (xtypenums);
- /* fall through */
-
- after_digits:
- if (type == 0)
- type = builtin_type_void;
- if (typenums[0] != -1)
- *dbx_lookup_type (typenums) = type;
- break;
-
- case '*':
- type1 = read_type (pp);
-/* FIXME -- we should be doing smash_to_XXX types here. */
-#if 0
- /* postponed type decoration should be allowed. */
- if (typenums[1] > 0 && typenums[1] < type_vector_length &&
- (type = type_vector[typenums[1]])) {
- smash_to_pointer_type (type, type1);
- break;
- }
-#endif
- type = lookup_pointer_type (type1);
- if (typenums[0] != -1)
- *dbx_lookup_type (typenums) = type;
- break;
-
- case '@':
- {
- struct type *domain = read_type (pp);
- struct type *memtype;
-
- if (**pp != ',')
- /* Invalid member type data format. */
- return error_type (pp);
- ++*pp;
-
- memtype = read_type (pp);
- type = dbx_alloc_type (typenums);
- smash_to_member_type (type, domain, memtype);
- }
- break;
-
- case '#':
- if ((*pp)[0] == '#')
- {
- /* We'll get the parameter types from the name. */
- struct type *return_type;
-
- *pp += 1;
- return_type = read_type (pp);
- if (*(*pp)++ != ';')
- complain (&invalid_member_complaint, symnum);
- type = allocate_stub_method (return_type);
- if (typenums[0] != -1)
- *dbx_lookup_type (typenums) = type;
- }
- else
- {
- struct type *domain = read_type (pp);
- struct type *return_type;
- struct type **args;
-
- if (*(*pp)++ != ',')
- error ("invalid member type data format, at symtab pos %d.",
- symnum);
-
- return_type = read_type (pp);
- args = read_args (pp, ';');
- type = dbx_alloc_type (typenums);
- smash_to_method_type (type, domain, return_type, args);
- }
- break;
-
- case '&':
- type1 = read_type (pp);
- type = lookup_reference_type (type1);
- if (typenums[0] != -1)
- *dbx_lookup_type (typenums) = type;
- break;
-
- case 'f':
- type1 = read_type (pp);
- type = lookup_function_type (type1);
- if (typenums[0] != -1)
- *dbx_lookup_type (typenums) = type;
- break;
-
- case 'r':
- type = read_range_type (pp, typenums);
- if (typenums[0] != -1)
- *dbx_lookup_type (typenums) = type;
- break;
-
- case 'e':
- type = dbx_alloc_type (typenums);
- type = read_enum_type (pp, type);
- *dbx_lookup_type (typenums) = type;
- break;
-
- case 's':
- type = dbx_alloc_type (typenums);
- TYPE_NAME (type) = type_synonym_name;
- type_synonym_name = 0;
- type = read_struct_type (pp, type);
- break;
-
- case 'u':
- type = dbx_alloc_type (typenums);
- TYPE_NAME (type) = type_synonym_name;
- type_synonym_name = 0;
- type = read_struct_type (pp, type);
- TYPE_CODE (type) = TYPE_CODE_UNION;
- break;
-
- case 'a':
- if (**pp != 'r')
- return error_type (pp);
- ++*pp;
-
- type = dbx_alloc_type (typenums);
- type = read_array_type (pp, type);
- break;
-
- default:
- --*pp; /* Go back to the symbol in error */
- /* Particularly important if it was \0! */
- return error_type (pp);
- }
-
- if (type == 0)
- abort ();
-
-#if 0
- /* If this is an overriding temporary alteration for a header file's
- contents, and this type number is unknown in the global definition,
- put this type into the global definition at this type number. */
- if (header_file_prev_index >= 0)
- {
- register struct type **tp
- = explicit_lookup_type (header_file_prev_index, typenums[1]);
- if (*tp == 0)
- *tp = type;
- }
-#endif
- return type;
-}
-
-/* This page contains subroutines of read_type. */
-
-/* Read the description of a structure (or union type)
- and return an object describing the type. */
-
-struct type *
-read_struct_type (pp, type)
- char **pp;
- register struct type *type;
-{
- /* Total number of methods defined in this class.
- If the class defines two `f' methods, and one `g' method,
- then this will have the value 3. */
- int total_length = 0;
-
- struct nextfield
- {
- struct nextfield *next;
- int visibility; /* 0=public, 1=protected, 2=public */
- struct field field;
- };
-
- struct next_fnfield
- {
- struct next_fnfield *next;
- int visibility; /* 0=public, 1=protected, 2=public */
- struct fn_field fn_field;
- };
-
- struct next_fnfieldlist
- {
- struct next_fnfieldlist *next;
- struct fn_fieldlist fn_fieldlist;
- };
-
- register struct nextfield *list = 0;
- struct nextfield *new;
- register char *p;
- int nfields = 0;
- register int n;
-
- register struct next_fnfieldlist *mainlist = 0;
- int nfn_fields = 0;
-
- if (TYPE_MAIN_VARIANT (type) == 0)
- TYPE_MAIN_VARIANT (type) = type;
-
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
- TYPE_CPLUS_SPECIFIC (type)
- = (struct cplus_struct_type *) obstack_alloc (symbol_obstack, sizeof (struct cplus_struct_type));
- bzero (TYPE_CPLUS_SPECIFIC (type), sizeof (struct cplus_struct_type));
-
- /* First comes the total size in bytes. */
-
- TYPE_LENGTH (type) = read_number (pp, 0);
-
- /* C++: Now, if the class is a derived class, then the next character
- will be a '!', followed by the number of base classes derived from.
- Each element in the list contains visibility information,
- the offset of this base class in the derived structure,
- and then the base type. */
- if (**pp == '!')
- {
- int i, n_baseclasses, offset;
- struct type *baseclass;
- int via_public;
-
- /* Nonzero if it is a virtual baseclass, i.e.,
-
- struct A{};
- struct B{};
- struct C : public B, public virtual A {};
-
- B is a baseclass of C; A is a virtual baseclass for C. This is a C++
- 2.0 language feature. */
- int via_virtual;
-
- *pp += 1;
-
- n_baseclasses = read_number (pp, ',');
- TYPE_FIELD_VIRTUAL_BITS (type) =
- (B_TYPE *) obstack_alloc (symbol_obstack, B_BYTES (n_baseclasses));
- B_CLRALL (TYPE_FIELD_VIRTUAL_BITS (type), n_baseclasses);
-
- for (i = 0; i < n_baseclasses; i++)
- {
- if (**pp == '\\')
- *pp = next_symbol_text ();
-
- switch (**pp)
- {
- case '0':
- via_virtual = 0;
- break;
- case '1':
- via_virtual = 1;
- break;
- default:
- /* Bad visibility format. */
- return error_type (pp);
- }
- ++*pp;
-
- switch (**pp)
- {
- case '0':
- via_public = 0;
- break;
- case '2':
- via_public = 2;
- break;
- default:
- /* Bad visibility format. */
- return error_type (pp);
- }
- if (via_virtual)
- SET_TYPE_FIELD_VIRTUAL (type, i);
- ++*pp;
-
- /* Offset of the portion of the object corresponding to
- this baseclass. Always zero in the absence of
- multiple inheritance. */
- offset = read_number (pp, ',');
- baseclass = read_type (pp);
- *pp += 1; /* skip trailing ';' */
-
- /* Make this baseclass visible for structure-printing purposes. */
- new = (struct nextfield *) alloca (sizeof (struct nextfield));
- new->next = list;
- list = new;
- list->visibility = via_public;
- list->field.type = baseclass;
- list->field.name = type_name_no_tag (baseclass);
- list->field.bitpos = offset;
- list->field.bitsize = 0; /* this should be an unpacked field! */
- nfields++;
- }
- TYPE_N_BASECLASSES (type) = n_baseclasses;
- }
-
- /* Now come the fields, as NAME:?TYPENUM,BITPOS,BITSIZE; for each one.
- At the end, we see a semicolon instead of a field.
-
- In C++, this may wind up being NAME:?TYPENUM:PHYSNAME; for
- a static field.
-
- The `?' is a placeholder for one of '/2' (public visibility),
- '/1' (protected visibility), '/0' (private visibility), or nothing
- (C style symbol table, public visibility). */
-
- /* We better set p right now, in case there are no fields at all... */
- p = *pp;
-
- while (**pp != ';')
- {
- /* Check for and handle cretinous dbx symbol name continuation! */
- if (**pp == '\\') *pp = next_symbol_text ();
-
- /* Get space to record the next field's data. */
- new = (struct nextfield *) alloca (sizeof (struct nextfield));
- new->next = list;
- list = new;
-
- /* Get the field name. */
- p = *pp;
- if (*p == CPLUS_MARKER)
- {
- /* Special GNU C++ name. */
- if (*++p == 'v')
- {
- const char *prefix;
- char *name = 0;
- struct type *context;
-
- switch (*++p)
- {
- case 'f':
- prefix = vptr_name;
- break;
- case 'b':
- prefix = vb_name;
- break;
- default:
- error ("invalid abbreviation at symtab pos %d.", symnum);
- }
- *pp = p + 1;
- context = read_type (pp);
- name = type_name_no_tag (context);
- if (name == 0)
- {
- error ("type name unknown at symtab pos %d.", symnum);
- TYPE_NAME (context) = name;
- }
- list->field.name = obconcat (prefix, name, "");
- p = ++(*pp);
- if (p[-1] != ':')
- error ("invalid abbreviation at symtab pos %d.", symnum);
- list->field.type = read_type (pp);
- (*pp)++; /* Skip the comma. */
- list->field.bitpos = read_number (pp, ';');
- /* This field is unpacked. */
- list->field.bitsize = 0;
- }
- /* GNU C++ anonymous type. */
- else if (*p == '_')
- break;
- else
- error ("invalid abbreviation at symtab pos %d.", symnum);
-
- nfields++;
- continue;
- }
-
- while (*p != ':') p++;
- list->field.name = obsavestring (*pp, p - *pp);
-
- /* C++: Check to see if we have hit the methods yet. */
- if (p[1] == ':')
- break;
-
- *pp = p + 1;
-
- /* This means we have a visibility for a field coming. */
- if (**pp == '/')
- {
- switch (*++*pp)
- {
- case '0':
- list->visibility = 0; /* private */
- *pp += 1;
- break;
-
- case '1':
- list->visibility = 1; /* protected */
- *pp += 1;
- break;
-
- case '2':
- list->visibility = 2; /* public */
- *pp += 1;
- break;
- }
- }
- else /* normal dbx-style format. */
- list->visibility = 2; /* public */
-
- list->field.type = read_type (pp);
- if (**pp == ':')
- {
- /* Static class member. */
- list->field.bitpos = (long)-1;
- p = ++(*pp);
- while (*p != ';') p++;
- list->field.bitsize = (long) savestring (*pp, p - *pp);
- *pp = p + 1;
- nfields++;
- continue;
- }
- else if (**pp != ',')
- /* Bad structure-type format. */
- return error_type (pp);
-
- (*pp)++; /* Skip the comma. */
- list->field.bitpos = read_number (pp, ',');
- list->field.bitsize = read_number (pp, ';');
-
-#if 0
- /* FIXME-tiemann: Can't the compiler put out something which
- lets us distinguish these? (or maybe just not put out anything
- for the field). What is the story here? What does the compiler
- really do? Also, patch gdb.texinfo for this case; I document
- it as a possible problem there. Search for "DBX-style". */
-
- /* This is wrong because this is identical to the symbols
- produced for GCC 0-size arrays. For example:
- typedef union {
- int num;
- char str[0];
- } foo;
- The code which dumped core in such circumstances should be
- fixed not to dump core. */
-
- /* g++ -g0 can put out bitpos & bitsize zero for a static
- field. This does not give us any way of getting its
- class, so we can't know its name. But we can just
- ignore the field so we don't dump core and other nasty
- stuff. */
- if (list->field.bitpos == 0
- && list->field.bitsize == 0)
- {
- complain (&dbx_class_complaint, 0);
- /* Ignore this field. */
- list = list->next;
- }
- else
-#endif /* 0 */
- {
- /* Detect an unpacked field and mark it as such.
- dbx gives a bit size for all fields.
- Note that forward refs cannot be packed,
- and treat enums as if they had the width of ints. */
- if (TYPE_CODE (list->field.type) != TYPE_CODE_INT
- && TYPE_CODE (list->field.type) != TYPE_CODE_ENUM)
- list->field.bitsize = 0;
- if ((list->field.bitsize == 8 * TYPE_LENGTH (list->field.type)
- || (TYPE_CODE (list->field.type) == TYPE_CODE_ENUM
- && (list->field.bitsize
- == 8 * TYPE_LENGTH (builtin_type_int))
- )
- )
- &&
- list->field.bitpos % 8 == 0)
- list->field.bitsize = 0;
- nfields++;
- }
- }
-
- if (p[1] == ':')
- /* chill the list of fields: the last entry (at the head)
- is a partially constructed entry which we now scrub. */
- list = list->next;
-
- /* Now create the vector of fields, and record how big it is.
- We need this info to record proper virtual function table information
- for this class's virtual functions. */
-
- TYPE_NFIELDS (type) = nfields;
- TYPE_FIELDS (type) = (struct field *) obstack_alloc (symbol_obstack,
- sizeof (struct field) * nfields);
-
- TYPE_FIELD_PRIVATE_BITS (type) =
- (B_TYPE *) obstack_alloc (symbol_obstack, B_BYTES (nfields));
- B_CLRALL (TYPE_FIELD_PRIVATE_BITS (type), nfields);
-
- TYPE_FIELD_PROTECTED_BITS (type) =
- (B_TYPE *) obstack_alloc (symbol_obstack, B_BYTES (nfields));
- B_CLRALL (TYPE_FIELD_PROTECTED_BITS (type), nfields);
-
- /* Copy the saved-up fields into the field vector. */
-
- for (n = nfields; list; list = list->next)
- {
- n -= 1;
- TYPE_FIELD (type, n) = list->field;
- if (list->visibility == 0)
- SET_TYPE_FIELD_PRIVATE (type, n);
- else if (list->visibility == 1)
- SET_TYPE_FIELD_PROTECTED (type, n);
- }
-
- /* Now come the method fields, as NAME::methods
- where each method is of the form TYPENUM,ARGS,...:PHYSNAME;
- At the end, we see a semicolon instead of a field.
-
- For the case of overloaded operators, the format is
- OPERATOR::*.methods, where OPERATOR is the string "operator",
- `*' holds the place for an operator name (such as `+=')
- and `.' marks the end of the operator name. */
- if (p[1] == ':')
- {
- /* Now, read in the methods. To simplify matters, we
- "unread" the name that has been read, so that we can
- start from the top. */
-
- /* For each list of method lists... */
- do
- {
- int i;
- struct next_fnfield *sublist = 0;
- struct type *look_ahead_type = NULL;
- int length = 0;
- struct next_fnfieldlist *new_mainlist =
- (struct next_fnfieldlist *)alloca (sizeof (struct next_fnfieldlist));
- char *main_fn_name;
-
- p = *pp;
-
- /* read in the name. */
- while (*p != ':') p++;
-#if 0
- if ((*pp)[0] == 'o' && (*pp)[1] == 'p' && (*pp)[2] == CPLUS_MARKER)
- {
- /* This lets the user type "break operator+".
- We could just put in "+" as the name, but that wouldn't
- work for "*". */
- /* I don't understand what this is trying to do.
- It seems completely bogus. -Per Bothner. */
- static char opname[32] = {'o', 'p', CPLUS_MARKER};
- char *o = opname + 3;
-
- /* Skip past '::'. */
- *pp = p + 2;
- if (**pp == '\\') *pp = next_symbol_text ();
- p = *pp;
- while (*p != '.')
- *o++ = *p++;
- main_fn_name = savestring (opname, o - opname);
- /* Skip past '.' */
- *pp = p + 1;
- }
- else
-#endif
- main_fn_name = savestring (*pp, p - *pp);
- /* Skip past '::'. */
- *pp = p + 2;
- new_mainlist->fn_fieldlist.name = main_fn_name;
-
- do
- {
- struct next_fnfield *new_sublist =
- (struct next_fnfield *)alloca (sizeof (struct next_fnfield));
-
- /* Check for and handle cretinous dbx symbol name continuation! */
- if (look_ahead_type == NULL) /* Normal case. */
- {
- if (**pp == '\\') *pp = next_symbol_text ();
-
- new_sublist->fn_field.type = read_type (pp);
- if (**pp != ':')
- /* Invalid symtab info for method. */
- return error_type (pp);
- }
- else
- { /* g++ version 1 kludge */
- new_sublist->fn_field.type = look_ahead_type;
- look_ahead_type = NULL;
- }
-
- *pp += 1;
- p = *pp;
- while (*p != ';') p++;
- /* If this is just a stub, then we don't have the
- real name here. */
- new_sublist->fn_field.physname = savestring (*pp, p - *pp);
- *pp = p + 1;
- new_sublist->visibility = *(*pp)++ - '0';
- if (**pp == '\\') *pp = next_symbol_text ();
- switch (**pp)
- {
- case 'A': /* Normal functions. */
- new_sublist->fn_field.is_const = 0;
- new_sublist->fn_field.is_volatile = 0;
- (*pp)++;
- break;
- case 'B': /* `const' member functions. */
- new_sublist->fn_field.is_const = 1;
- new_sublist->fn_field.is_volatile = 0;
- (*pp)++;
- break;
- case 'C': /* `volatile' member function. */
- new_sublist->fn_field.is_const = 0;
- new_sublist->fn_field.is_volatile = 1;
- (*pp)++;
- break;
- case 'D': /* `const volatile' member function. */
- new_sublist->fn_field.is_const = 1;
- new_sublist->fn_field.is_volatile = 1;
- (*pp)++;
- break;
- default:
- /* This probably just means we're processing a file compiled
- with g++ version 1. */
- complain(&const_vol_complaint, **pp);
- }
-
- switch (*(*pp)++)
- {
- case '*':
- /* virtual member function, followed by index. */
- /* The sign bit is set to distinguish pointers-to-methods
- from virtual function indicies. Since the array is
- in words, the quantity must be shifted left by 1
- on 16 bit machine, and by 2 on 32 bit machine, forcing
- the sign bit out, and usable as a valid index into
- the array. Remove the sign bit here. */
- new_sublist->fn_field.voffset =
- (0x7fffffff & read_number (pp, ';')) + 2;
-
- if (**pp == '\\') *pp = next_symbol_text ();
-
- if (**pp == ';' || **pp == '\0')
- /* Must be g++ version 1. */
- new_sublist->fn_field.fcontext = 0;
- else
- {
- /* Figure out from whence this virtual function came.
- It may belong to virtual function table of
- one of its baseclasses. */
- look_ahead_type = read_type (pp);
- if (**pp == ':')
- { /* g++ version 1 overloaded methods. */ }
- else
- {
- new_sublist->fn_field.fcontext = look_ahead_type;
- if (**pp != ';')
- return error_type (pp);
- else
- ++*pp;
- look_ahead_type = NULL;
- }
- }
- break;
-
- case '?':
- /* static member function. */
- new_sublist->fn_field.voffset = VOFFSET_STATIC;
- break;
- default:
- /* **pp == '.'. */
- /* normal member function. */
- new_sublist->fn_field.voffset = 0;
- new_sublist->fn_field.fcontext = 0;
- break;
- }
-
- new_sublist->next = sublist;
- sublist = new_sublist;
- length++;
- if (**pp == '\\') *pp = next_symbol_text ();
- }
- while (**pp != ';' && **pp != '\0');
-
- *pp += 1;
-
- new_mainlist->fn_fieldlist.fn_fields =
- (struct fn_field *) obstack_alloc (symbol_obstack,
- sizeof (struct fn_field) * length);
- TYPE_FN_PRIVATE_BITS (new_mainlist->fn_fieldlist) =
- (B_TYPE *) obstack_alloc (symbol_obstack, B_BYTES (length));
- B_CLRALL (TYPE_FN_PRIVATE_BITS (new_mainlist->fn_fieldlist), length);
-
- TYPE_FN_PROTECTED_BITS (new_mainlist->fn_fieldlist) =
- (B_TYPE *) obstack_alloc (symbol_obstack, B_BYTES (length));
- B_CLRALL (TYPE_FN_PROTECTED_BITS (new_mainlist->fn_fieldlist), length);
-
- for (i = length; (i--, sublist); sublist = sublist->next)
- {
- new_mainlist->fn_fieldlist.fn_fields[i] = sublist->fn_field;
- if (sublist->visibility == 0)
- B_SET (new_mainlist->fn_fieldlist.private_fn_field_bits, i);
- else if (sublist->visibility == 1)
- B_SET (new_mainlist->fn_fieldlist.protected_fn_field_bits, i);
- }
-
- new_mainlist->fn_fieldlist.length = length;
- new_mainlist->next = mainlist;
- mainlist = new_mainlist;
- nfn_fields++;
- total_length += length;
- }
- while (**pp != ';');
- }
-
- *pp += 1;
-
- TYPE_FN_FIELDLISTS (type) =
- (struct fn_fieldlist *) obstack_alloc (symbol_obstack,
- sizeof (struct fn_fieldlist) * nfn_fields);
-
- TYPE_NFN_FIELDS (type) = nfn_fields;
- TYPE_NFN_FIELDS_TOTAL (type) = total_length;
-
- {
- int i;
- for (i = 0; i < TYPE_N_BASECLASSES (type); ++i)
- TYPE_NFN_FIELDS_TOTAL (type) +=
- TYPE_NFN_FIELDS_TOTAL (TYPE_BASECLASS (type, i));
- }
-
- for (n = nfn_fields; mainlist; mainlist = mainlist->next)
- TYPE_FN_FIELDLISTS (type)[--n] = mainlist->fn_fieldlist;
-
- if (**pp == '~')
- {
- *pp += 1;
-
- if (**pp == '=' || **pp == '+' || **pp == '-')
- {
- /* Obsolete flags that used to indicate the presence
- of constructors and/or destructors. */
- *pp += 1;
- }
-
- /* Read either a '%' or the final ';'. */
- if (*(*pp)++ == '%')
- {
- /* We'd like to be able to derive the vtable pointer field
- from the type information, but when it's inherited, that's
- hard. A reason it's hard is because we may read in the
- info about a derived class before we read in info about
- the base class that provides the vtable pointer field.
- Once the base info has been read, we could fill in the info
- for the derived classes, but for the fact that by then,
- we don't remember who needs what. */
-
- int predicted_fieldno = -1;
-
- /* Now we must record the virtual function table pointer's
- field information. */
-
- struct type *t;
- int i;
-
-
-#if 0
- {
- /* In version 2, we derive the vfield ourselves. */
- for (n = 0; n < nfields; n++)
- {
- if (! strncmp (TYPE_FIELD_NAME (type, n), vptr_name,
- sizeof (vptr_name) -1))
- {
- predicted_fieldno = n;
- break;
- }
- }
- if (predicted_fieldno < 0)
- for (n = 0; n < TYPE_N_BASECLASSES (type); n++)
- if (! TYPE_FIELD_VIRTUAL (type, n)
- && TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, n)) >= 0)
- {
- predicted_fieldno = TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, n));
- break;
- }
- }
-#endif
-
- t = read_type (pp);
- p = (*pp)++;
- while (*p != '\0' && *p != ';')
- p++;
- if (*p == '\0')
- /* Premature end of symbol. */
- return error_type (pp);
-
- TYPE_VPTR_BASETYPE (type) = t;
- if (type == t)
- {
- if (TYPE_FIELD_NAME (t, TYPE_N_BASECLASSES (t)) == 0)
- {
- /* FIXME-tiemann: what's this? */
-#if 0
- TYPE_VPTR_FIELDNO (type) = i = TYPE_N_BASECLASSES (t);
-#else
- error_type (pp);
-#endif
- }
- else for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); --i)
- if (! strncmp (TYPE_FIELD_NAME (t, i), vptr_name,
- sizeof (vptr_name) -1))
- {
- TYPE_VPTR_FIELDNO (type) = i;
- break;
- }
- if (i < 0)
- /* Virtual function table field not found. */
- return error_type (pp);
- }
- else
- TYPE_VPTR_FIELDNO (type) = TYPE_VPTR_FIELDNO (t);
-
-#if 0
- if (TYPE_VPTR_FIELDNO (type) != predicted_fieldno)
- error ("TYPE_VPTR_FIELDNO miscalculated");
-#endif
-
- *pp = p + 1;
- }
- }
-
- return type;
-}
-
-/* Read a definition of an array type,
- and create and return a suitable type object.
- Also creates a range type which represents the bounds of that
- array. */
-struct type *
-read_array_type (pp, type)
- register char **pp;
- register struct type *type;
-{
- struct type *index_type, *element_type, *range_type;
- int lower, upper;
- int adjustable = 0;
-
- /* Format of an array type:
- "ar<index type>;lower;upper;<array_contents_type>". Put code in
- to handle this.
-
- Fortran adjustable arrays use Adigits or Tdigits for lower or upper;
- for these, produce a type like float[][]. */
-
- index_type = read_type (pp);
- if (**pp != ';')
- /* Improper format of array type decl. */
- return error_type (pp);
- ++*pp;
-
- if (!(**pp >= '0' && **pp <= '9'))
- {
- *pp += 1;
- adjustable = 1;
- }
- lower = read_number (pp, ';');
-
- if (!(**pp >= '0' && **pp <= '9'))
- {
- *pp += 1;
- adjustable = 1;
- }
- upper = read_number (pp, ';');
-
- element_type = read_type (pp);
-
- if (adjustable)
- {
- lower = 0;
- upper = -1;
- }
-
- {
- /* Create range type. */
- range_type = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
- TYPE_CODE (range_type) = TYPE_CODE_RANGE;
- TYPE_TARGET_TYPE (range_type) = index_type;
-
- /* This should never be needed. */
- TYPE_LENGTH (range_type) = sizeof (int);
-
- TYPE_NFIELDS (range_type) = 2;
- TYPE_FIELDS (range_type) =
- (struct field *) obstack_alloc (symbol_obstack,
- 2 * sizeof (struct field));
- TYPE_FIELD_BITPOS (range_type, 0) = lower;
- TYPE_FIELD_BITPOS (range_type, 1) = upper;
- }
-
- TYPE_CODE (type) = TYPE_CODE_ARRAY;
- TYPE_TARGET_TYPE (type) = element_type;
- TYPE_LENGTH (type) = (upper - lower + 1) * TYPE_LENGTH (element_type);
- TYPE_NFIELDS (type) = 1;
- TYPE_FIELDS (type) =
- (struct field *) obstack_alloc (symbol_obstack,
- sizeof (struct field));
- TYPE_FIELD_TYPE (type, 0) = range_type;
-
- return type;
-}
-
-
-/* Read a definition of an enumeration type,
- and create and return a suitable type object.
- Also defines the symbols that represent the values of the type. */
-
-struct type *
-read_enum_type (pp, type)
- register char **pp;
- register struct type *type;
-{
- register char *p;
- char *name;
- register long n;
- register struct symbol *sym;
- int nsyms = 0;
- struct pending **symlist;
- struct pending *osyms, *syms;
- int o_nsyms;
-
- if (within_function)
- symlist = &local_symbols;
- else
- symlist = &file_symbols;
- osyms = *symlist;
- o_nsyms = osyms ? osyms->nsyms : 0;
-
- /* Read the value-names and their values.
- The input syntax is NAME:VALUE,NAME:VALUE, and so on.
- A semicolon or comman instead of a NAME means the end. */
- while (**pp && **pp != ';' && **pp != ',')
- {
- /* Check for and handle cretinous dbx symbol name continuation! */
- if (**pp == '\\') *pp = next_symbol_text ();
-
- p = *pp;
- while (*p != ':') p++;
- name = obsavestring (*pp, p - *pp);
- *pp = p + 1;
- n = read_number (pp, ',');
-
- sym = (struct symbol *) obstack_alloc (symbol_obstack, sizeof (struct symbol));
- bzero (sym, sizeof (struct symbol));
- SYMBOL_NAME (sym) = name;
- SYMBOL_CLASS (sym) = LOC_CONST;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- SYMBOL_VALUE (sym) = n;
- add_symbol_to_list (sym, symlist);
- nsyms++;
- }
-
- if (**pp == ';')
- (*pp)++; /* Skip the semicolon. */
-
- /* Now fill in the fields of the type-structure. */
-
- TYPE_LENGTH (type) = sizeof (int);
- TYPE_CODE (type) = TYPE_CODE_ENUM;
- TYPE_NFIELDS (type) = nsyms;
- TYPE_FIELDS (type) = (struct field *) obstack_alloc (symbol_obstack, sizeof (struct field) * nsyms);
-
- /* Find the symbols for the values and put them into the type.
- The symbols can be found in the symlist that we put them on
- to cause them to be defined. osyms contains the old value
- of that symlist; everything up to there was defined by us. */
- /* Note that we preserve the order of the enum constants, so
- that in something like "enum {FOO, LAST_THING=FOO}" we print
- FOO, not LAST_THING. */
-
- for (syms = *symlist, n = 0; syms; syms = syms->next)
- {
- int j = 0;
- if (syms == osyms)
- j = o_nsyms;
- for (; j < syms->nsyms; j++,n++)
- {
- struct symbol *xsym = syms->symbol[j];
- SYMBOL_TYPE (xsym) = type;
- TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
- TYPE_FIELD_VALUE (type, n) = 0;
- TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
- TYPE_FIELD_BITSIZE (type, n) = 0;
- }
- if (syms == osyms)
- break;
- }
-
-#if 0
- /* This screws up perfectly good C programs with enums. FIXME. */
- /* Is this Modula-2's BOOLEAN type? Flag it as such if so. */
- if(TYPE_NFIELDS(type) == 2 &&
- ((!strcmp(TYPE_FIELD_NAME(type,0),"TRUE") &&
- !strcmp(TYPE_FIELD_NAME(type,1),"FALSE")) ||
- (!strcmp(TYPE_FIELD_NAME(type,1),"TRUE") &&
- !strcmp(TYPE_FIELD_NAME(type,0),"FALSE"))))
- TYPE_CODE(type) = TYPE_CODE_BOOL;
-#endif
-
- return type;
-}
-
-/* Read a number from the string pointed to by *PP.
- The value of *PP is advanced over the number.
- If END is nonzero, the character that ends the
- number must match END, or an error happens;
- and that character is skipped if it does match.
- If END is zero, *PP is left pointing to that character.
-
- If the number fits in a long, set *VALUE and set *BITS to 0.
- If not, set *BITS to be the number of bits in the number.
-
- If encounter garbage, set *BITS to -1. */
-
-void
-read_huge_number (pp, end, valu, bits)
- char **pp;
- int end;
- long *valu;
- int *bits;
-{
- char *p = *pp;
- int sign = 1;
- long n = 0;
- int radix = 10;
- char overflow = 0;
- int nbits = 0;
- int c;
- long upper_limit;
-
- if (*p == '-')
- {
- sign = -1;
- p++;
- }
-
- /* Leading zero means octal. GCC uses this to output values larger
- than an int (because that would be hard in decimal). */
- if (*p == '0')
- {
- radix = 8;
- p++;
- }
-
- upper_limit = LONG_MAX / radix;
- while ((c = *p++) >= '0' && c <= ('0' + radix))
- {
- if (n <= upper_limit)
- {
- n *= radix;
- n += c - '0'; /* FIXME this overflows anyway */
- }
- else
- overflow = 1;
-
- /* This depends on large values being output in octal, which is
- what GCC does. */
- if (radix == 8)
- {
- if (nbits == 0)
- {
- if (c == '0')
- /* Ignore leading zeroes. */
- ;
- else if (c == '1')
- nbits = 1;
- else if (c == '2' || c == '3')
- nbits = 2;
- else
- nbits = 3;
- }
- else
- nbits += 3;
- }
- }
- if (end)
- {
- if (c && c != end)
- {
- if (bits != NULL)
- *bits = -1;
- return;
- }
- }
- else
- --p;
-
- *pp = p;
- if (overflow)
- {
- if (nbits == 0)
- {
- /* Large decimal constants are an error (because it is hard to
- count how many bits are in them). */
- if (bits != NULL)
- *bits = -1;
- return;
- }
-
- /* -0x7f is the same as 0x80. So deal with it by adding one to
- the number of bits. */
- if (sign == -1)
- ++nbits;
- if (bits)
- *bits = nbits;
- }
- else
- {
- if (valu)
- *valu = n * sign;
- if (bits)
- *bits = 0;
- }
-}
-
-#define MAX_OF_C_TYPE(t) ((1 << (sizeof (t)*8 - 1)) - 1)
-#define MIN_OF_C_TYPE(t) (-(1 << (sizeof (t)*8 - 1)))
-
-struct type *
-read_range_type (pp, typenums)
- char **pp;
- int typenums[2];
-{
- int rangenums[2];
- long n2, n3;
- int n2bits, n3bits;
- int self_subrange;
- struct type *result_type;
-
- /* First comes a type we are a subrange of.
- In C it is usually 0, 1 or the type being defined. */
- read_type_number (pp, rangenums);
- self_subrange = (rangenums[0] == typenums[0] &&
- rangenums[1] == typenums[1]);
-
- /* A semicolon should now follow; skip it. */
- if (**pp == ';')
- (*pp)++;
-
- /* The remaining two operands are usually lower and upper bounds
- of the range. But in some special cases they mean something else. */
- read_huge_number (pp, ';', &n2, &n2bits);
- read_huge_number (pp, ';', &n3, &n3bits);
-
- if (n2bits == -1 || n3bits == -1)
- return error_type (pp);
-
- /* If limits are huge, must be large integral type. */
- if (n2bits != 0 || n3bits != 0)
- {
- char got_signed = 0;
- char got_unsigned = 0;
- /* Number of bits in the type. */
- int nbits;
-
- /* Range from 0 to <large number> is an unsigned large integral type. */
- if ((n2bits == 0 && n2 == 0) && n3bits != 0)
- {
- got_unsigned = 1;
- nbits = n3bits;
- }
- /* Range from <large number> to <large number>-1 is a large signed
- integral type. */
- else if (n2bits != 0 && n3bits != 0 && n2bits == n3bits + 1)
- {
- got_signed = 1;
- nbits = n2bits;
- }
-
- /* Check for "long long". */
- if (got_signed && nbits == TARGET_LONG_LONG_BIT)
- return builtin_type_long_long;
- if (got_unsigned && nbits == TARGET_LONG_LONG_BIT)
- return builtin_type_unsigned_long_long;
-
- if (got_signed || got_unsigned)
- {
- result_type = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
- bzero (result_type, sizeof (struct type));
- TYPE_LENGTH (result_type) = nbits / TARGET_CHAR_BIT;
- TYPE_CODE (result_type) = TYPE_CODE_INT;
- if (got_unsigned)
- TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED;
- return result_type;
- }
- else
- return error_type (pp);
- }
-
- /* A type defined as a subrange of itself, with bounds both 0, is void. */
- if (self_subrange && n2 == 0 && n3 == 0)
- return builtin_type_void;
-
- /* If n3 is zero and n2 is not, we want a floating type,
- and n2 is the width in bytes.
-
- Fortran programs appear to use this for complex types also,
- and they give no way to distinguish between double and single-complex!
- We don't have complex types, so we would lose on all fortran files!
- So return type `double' for all of those. It won't work right
- for the complex values, but at least it makes the file loadable. */
-
- if (n3 == 0 && n2 > 0)
- {
- if (n2 == sizeof (float))
- return builtin_type_float;
- return builtin_type_double;
- }
-
- /* If the upper bound is -1, it must really be an unsigned int. */
-
- else if (n2 == 0 && n3 == -1)
- {
- /* FIXME -- this confuses host and target type sizes. */
- if (sizeof (int) == sizeof (long))
- return builtin_type_unsigned_int;
- else
- return builtin_type_unsigned_long;
- }
-
- /* Special case: char is defined (Who knows why) as a subrange of
- itself with range 0-127. */
- else if (self_subrange && n2 == 0 && n3 == 127)
- return builtin_type_char;
-
- /* Assumptions made here: Subrange of self is equivalent to subrange
- of int. FIXME: Host and target type-sizes assumed the same. */
- else if (n2 == 0
- && (self_subrange ||
- *dbx_lookup_type (rangenums) == builtin_type_int))
- {
- /* an unsigned type */
-#ifdef LONG_LONG
- if (n3 == - sizeof (long long))
- return builtin_type_unsigned_long_long;
-#endif
- if (n3 == (unsigned int)~0L)
- return builtin_type_unsigned_int;
- if (n3 == (unsigned long)~0L)
- return builtin_type_unsigned_long;
- if (n3 == (unsigned short)~0L)
- return builtin_type_unsigned_short;
- if (n3 == (unsigned char)~0L)
- return builtin_type_unsigned_char;
- }
-#ifdef LONG_LONG
- else if (n3 == 0 && n2 == -sizeof (long long))
- return builtin_type_long_long;
-#endif
- else if (n2 == -n3 -1)
- {
- /* a signed type */
- if (n3 == (1 << (8 * sizeof (int) - 1)) - 1)
- return builtin_type_int;
- if (n3 == (1 << (8 * sizeof (long) - 1)) - 1)
- return builtin_type_long;
- if (n3 == (1 << (8 * sizeof (short) - 1)) - 1)
- return builtin_type_short;
- if (n3 == (1 << (8 * sizeof (char) - 1)) - 1)
- return builtin_type_char;
- }
-
- /* We have a real range type on our hands. Allocate space and
- return a real pointer. */
-
- /* At this point I don't have the faintest idea how to deal with
- a self_subrange type; I'm going to assume that this is used
- as an idiom, and that all of them are special cases. So . . . */
- if (self_subrange)
- return error_type (pp);
-
- result_type = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
- bzero (result_type, sizeof (struct type));
-
- TYPE_CODE (result_type) = TYPE_CODE_RANGE;
-
- TYPE_TARGET_TYPE (result_type) = *dbx_lookup_type(rangenums);
- if (TYPE_TARGET_TYPE (result_type) == 0) {
- complain (&range_type_base_complaint, rangenums[1]);
- TYPE_TARGET_TYPE (result_type) = builtin_type_int;
- }
-
- TYPE_NFIELDS (result_type) = 2;
- TYPE_FIELDS (result_type) =
- (struct field *) obstack_alloc (symbol_obstack,
- 2 * sizeof (struct field));
- bzero (TYPE_FIELDS (result_type), 2 * sizeof (struct field));
- TYPE_FIELD_BITPOS (result_type, 0) = n2;
- TYPE_FIELD_BITPOS (result_type, 1) = n3;
-
-#if 0
-/* Note that TYPE_LENGTH (result_type) is just overridden a few
- statements down. What do we really need here? */
- /* We have to figure out how many bytes it takes to hold this
- range type. I'm going to assume that anything that is pushing
- the bounds of a long was taken care of above. */
- if (n2 >= MIN_OF_C_TYPE(char) && n3 <= MAX_OF_C_TYPE(char))
- TYPE_LENGTH (result_type) = 1;
- else if (n2 >= MIN_OF_C_TYPE(short) && n3 <= MAX_OF_C_TYPE(short))
- TYPE_LENGTH (result_type) = sizeof (short);
- else if (n2 >= MIN_OF_C_TYPE(int) && n3 <= MAX_OF_C_TYPE(int))
- TYPE_LENGTH (result_type) = sizeof (int);
- else if (n2 >= MIN_OF_C_TYPE(long) && n3 <= MAX_OF_C_TYPE(long))
- TYPE_LENGTH (result_type) = sizeof (long);
- else
- /* Ranged type doesn't fit within known sizes. */
- /* FIXME -- use "long long" here. */
- return error_type (pp);
-#endif
-
- TYPE_LENGTH (result_type) = TYPE_LENGTH (TYPE_TARGET_TYPE (result_type));
-
- return result_type;
-}
-
-/* Read a number from the string pointed to by *PP.
- The value of *PP is advanced over the number.
- If END is nonzero, the character that ends the
- number must match END, or an error happens;
- and that character is skipped if it does match.
- If END is zero, *PP is left pointing to that character. */
-
-long
-read_number (pp, end)
- char **pp;
- int end;
-{
- register char *p = *pp;
- register long n = 0;
- register int c;
- int sign = 1;
-
- /* Handle an optional leading minus sign. */
-
- if (*p == '-')
- {
- sign = -1;
- p++;
- }
-
- /* Read the digits, as far as they go. */
-
- while ((c = *p++) >= '0' && c <= '9')
- {
- n *= 10;
- n += c - '0';
- }
- if (end)
- {
- if (c && c != end)
- error ("Invalid symbol data: invalid character \\%03o at symbol pos %d.", c, symnum);
- }
- else
- --p;
-
- *pp = p;
- return n * sign;
-}
-
-/* Read in an argument list. This is a list of types, separated by commas
- and terminated with END. Return the list of types read in, or (struct type
- **)-1 if there is an error. */
-struct type **
-read_args (pp, end)
- char **pp;
- int end;
-{
- /* FIXME! Remove this arbitrary limit! */
- struct type *types[1024], **rval; /* allow for fns of 1023 parameters */
- int n = 0;
-
- while (**pp != end)
- {
- if (**pp != ',')
- /* Invalid argument list: no ','. */
- return (struct type **)-1;
- *pp += 1;
-
- /* Check for and handle cretinous dbx symbol name continuation! */
- if (**pp == '\\')
- *pp = next_symbol_text ();
-
- types[n++] = read_type (pp);
- }
- *pp += 1; /* get past `end' (the ':' character) */
-
- if (n == 1)
- {
- rval = (struct type **) xmalloc (2 * sizeof (struct type *));
- }
- else if (TYPE_CODE (types[n-1]) != TYPE_CODE_VOID)
- {
- rval = (struct type **) xmalloc ((n + 1) * sizeof (struct type *));
- bzero (rval + n, sizeof (struct type *));
- }
- else
- {
- rval = (struct type **) xmalloc (n * sizeof (struct type *));
- }
- bcopy (types, rval, n * sizeof (struct type *));
- return rval;
-}
-
-/* Add a common block's start address to the offset of each symbol
- declared to be in it (by being between a BCOMM/ECOMM pair that uses
- the common block name). */
-
-static void
-fix_common_block (sym, valu)
- struct symbol *sym;
- int valu;
-{
- struct pending *next = (struct pending *) SYMBOL_NAMESPACE (sym);
- for ( ; next; next = next->next)
- {
- register int j;
- for (j = next->nsyms - 1; j >= 0; j--)
- SYMBOL_VALUE_ADDRESS (next->symbol[j]) += valu;
- }
-}
-
-/* Initializer for this module */
-void
-_initialize_buildsym ()
-{
- undef_types_allocated = 20;
- undef_types_length = 0;
- undef_types = (struct type **) xmalloc (undef_types_allocated *
- sizeof (struct type *));
-}
diff --git a/gdb/buildsym.h b/gdb/buildsym.h
deleted file mode 100644
index 2722d5b..0000000
--- a/gdb/buildsym.h
+++ /dev/null
@@ -1,296 +0,0 @@
-/* Build symbol tables in GDB's internal format.
- Copyright (C) 1986-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This module provides definitions used for creating and adding to
- the symbol table. These routines are called from various symbol-
- file-reading routines.
-
- They originated in dbxread.c of gdb-4.2, and were split out to
- make xcoffread.c more maintainable by sharing code.
-
- Variables declared in this file can be defined by #define-ing
- the name EXTERN to null. It is used to declare variables that
- are normally extern, but which get defined in a single module
- using this technique. */
-
-#ifndef EXTERN
-#define EXTERN extern
-#endif
-
-extern void add_symbol_to_list ();
-struct symbol *find_symbol_in_list ();
-extern void read_type_number ();
-extern struct type *read_type ();
-extern struct type *read_range_type ();
-extern struct type *read_enum_type ();
-extern struct type *read_struct_type ();
-extern struct type *read_array_type ();
-extern struct type **read_args ();
-extern struct type **dbx_lookup_type ();
-extern long read_number ();
-extern void finish_block ();
-extern struct blockvector *make_blockvector ();
-extern void add_undefined_type ();
-extern void really_free_pendings ();
-extern void start_subfile ();
-extern void push_subfile ();
-extern char *pop_subfile ();
-extern struct symtab *end_symtab ();
-extern void scan_file_globals ();
-extern void buildsym_new_init ();
-extern void buildsym_init ();
-extern struct context_stack *push_context ();
-extern void record_line ();
-extern void start_symtab ();
-extern struct symbol *define_symbol ();
-
-/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
-
-#ifndef STAB_REG_TO_REGNUM
-#define STAB_REG_TO_REGNUM(VALUE) (VALUE)
-#endif
-
-/* Name of source file whose symbol data we are now processing.
- This comes from a symbol of type N_SO. */
-
-EXTERN char *last_source_file;
-
-/* Core address of start of text of current source file.
- This too comes from the N_SO symbol. */
-
-EXTERN CORE_ADDR last_source_start_addr;
-
-/* The list of sub-source-files within the current individual compilation.
- Each file gets its own symtab with its own linetable and associated info,
- but they all share one blockvector. */
-
-struct subfile
-{
- struct subfile *next;
- char *name;
- char *dirname;
- struct linetable *line_vector;
- int line_vector_length;
-};
-
-EXTERN struct subfile *subfiles;
-
-EXTERN struct subfile *current_subfile;
-
-/* Global variable which, when set, indicates that we are processing a
- .o file compiled with gcc */
-
-EXTERN unsigned char processing_gcc_compilation;
-
-/* Count symbols as they are processed, for error messages. */
-
-EXTERN unsigned int symnum;
-
-/* Vector of types defined so far, indexed by their dbx type numbers.
- (In newer sun systems, dbx uses a pair of numbers in parens,
- as in "(SUBFILENUM,NUMWITHINSUBFILE)". Then these numbers must be
- translated through the type_translations hash table to get
- the index into the type vector.) */
-
-EXTERN struct type **type_vector;
-
-/* Number of elements allocated for type_vector currently. */
-
-EXTERN int type_vector_length;
-
-/* Hash table of global symbols whose values are not known yet.
- They are chained thru the SYMBOL_VALUE_CHAIN, since we don't
- have the correct data for that slot yet. */
-/* The use of the LOC_BLOCK code in this chain is nonstandard--
- it refers to a FORTRAN common block rather than the usual meaning. */
-
-#define HASHSIZE 127
-EXTERN struct symbol *global_sym_chain[HASHSIZE];
-
-/* Record the symbols defined for each context in a list.
- We don't create a struct block for the context until we
- know how long to make it. */
-
-#define PENDINGSIZE 100
-
-struct pending
-{
- struct pending *next;
- int nsyms;
- struct symbol *symbol[PENDINGSIZE];
-};
-
-/* List of free `struct pending' structures for reuse. */
-EXTERN struct pending *free_pendings;
-
-/* Here are the three lists that symbols are put on. */
-
-EXTERN struct pending *file_symbols; /* static at top level, and types */
-
-EXTERN struct pending *global_symbols; /* global functions and variables */
-
-EXTERN struct pending *local_symbols; /* everything local to lexic context */
-
-/* Kludge for xcoffread.c */
-struct pending_stabs {
- int count, length;
- char *stab[1];
-};
-
-EXTERN struct pending_stabs *global_stabs;
-EXTERN struct pending_stabs *file_stabs;
-
-/* List of symbols declared since the last BCOMM. This list is a tail
- of local_symbols. When ECOMM is seen, the symbols on the list
- are noted so their proper addresses can be filled in later,
- using the common block base address gotten from the assembler
- stabs. */
-
-EXTERN struct pending *common_block;
-EXTERN int common_block_i;
-
-/* Stack representing unclosed lexical contexts
- (that will become blocks, eventually). */
-
-struct context_stack
-{
- struct pending *locals; /* Outer locals at the time we entered */
- struct pending_block *old_blocks; /* Pointer into blocklist as of entry */
- struct symbol *name; /* Name of function, if any, defining context*/
- CORE_ADDR start_addr; /* PC where this context starts */
- CORE_ADDR end_addr; /* Temp slot for exception handling. */
- int depth; /* For error-checking matching push/pop */
-};
-
-EXTERN struct context_stack *context_stack;
-
-/* Index of first unused entry in context stack. */
-EXTERN int context_stack_depth;
-
-/* Currently allocated size of context stack. */
-
-EXTERN int context_stack_size;
-
-/* Macro "function" for popping contexts from the stack. Pushing is done
- by a real function, push_context. This returns a pointer to a struct
- context_stack. */
-
-#define pop_context() \
- (&context_stack[--context_stack_depth]);
-
-/* Nonzero if within a function (so symbols should be local,
- if nothing says specifically). */
-
-EXTERN int within_function;
-
-/* List of blocks already made (lexical contexts already closed).
- This is used at the end to make the blockvector. */
-
-struct pending_block
-{
- struct pending_block *next;
- struct block *block;
-};
-
-EXTERN struct pending_block *pending_blocks;
-
-extern CORE_ADDR startup_file_start; /* From blockframe.c */
-extern CORE_ADDR startup_file_end; /* From blockframe.c */
-
-/* Global variable which, when set, indicates that we are processing a
- .o file compiled with gcc */
-
-EXTERN unsigned char processing_gcc_compilation;
-
-/* Setup a define to deal cleanly with the underscore problem */
-
-#ifdef NAMES_HAVE_UNDERSCORE
-#define HASH_OFFSET 1
-#else
-#define HASH_OFFSET 0
-#endif
-
-/* Support for Sun changes to dbx symbol format */
-
-/* For each identified header file, we have a table of types defined
- in that header file.
-
- header_files maps header file names to their type tables.
- It is a vector of n_header_files elements.
- Each element describes one header file.
- It contains a vector of types.
-
- Sometimes it can happen that the same header file produces
- different results when included in different places.
- This can result from conditionals or from different
- things done before including the file.
- When this happens, there are multiple entries for the file in this table,
- one entry for each distinct set of results.
- The entries are distinguished by the INSTANCE field.
- The INSTANCE field appears in the N_BINCL and N_EXCL symbol table and is
- used to match header-file references to their corresponding data. */
-
-struct header_file
-{
- char *name; /* Name of header file */
- int instance; /* Numeric code distinguishing instances
- of one header file that produced
- different results when included.
- It comes from the N_BINCL or N_EXCL. */
- struct type **vector; /* Pointer to vector of types */
- int length; /* Allocated length (# elts) of that vector */
-};
-
-EXTERN struct header_file *header_files;
-
-EXTERN int n_header_files;
-
-EXTERN int n_allocated_header_files;
-
-/* Within each object file, various header files are assigned numbers.
- A type is defined or referred to with a pair of numbers
- (FILENUM,TYPENUM) where FILENUM is the number of the header file
- and TYPENUM is the number within that header file.
- TYPENUM is the index within the vector of types for that header file.
-
- FILENUM == 1 is special; it refers to the main source of the object file,
- and not to any header file. FILENUM != 1 is interpreted by looking it up
- in the following table, which contains indices in header_files. */
-
-EXTERN int *this_object_header_files;
-
-EXTERN int n_this_object_header_files;
-
-EXTERN int n_allocated_this_object_header_files;
-
-/* When a header file is getting special overriding definitions
- for one source file, record here the header_files index
- of its normal definition vector.
- At other times, this is -1. */
-
-EXTERN int header_file_prev_index;
-
-struct subfile_stack
-{
- struct subfile_stack *next;
- char *name;
- int prev_index;
-};
-
-EXTERN struct subfile_stack *subfile_stack;
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
deleted file mode 100644
index bea0463..0000000
--- a/gdb/c-exp.y
+++ /dev/null
@@ -1,1583 +0,0 @@
-/* YACC parser for C expressions, for GDB.
- Copyright (C) 1986, 1989, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Parse a C expression from text in a string,
- and return the result as a struct expression pointer.
- That structure contains arithmetic operations in reverse polish,
- with constants represented by operations that are followed by special data.
- See expression.h for the details of the format.
- What is important here is that it can be built up sequentially
- during the process of parsing; the lower levels of the tree always
- come first in the result. */
-
-%{
-
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include "value.h"
-#include "language.h"
-
-/* These MUST be included in any grammar file!!!!
- Please choose unique names! */
-#define yyparse c_parse
-#define yylex c_lex
-#define yyerror c_error
-#define yylval c_lval
-#define yychar c_char
-#define yydebug c_debug
-#define yypact c_pact
-#define yyr1 c_r1
-#define yyr2 c_r2
-#define yydef c_def
-#define yychk c_chk
-#define yypgo c_pgo
-#define yyact c_act
-#define yyexca c_exca
-#define yyerrflag c_errflag
-#define yynerrs c_nerrs
-#define yyps c_ps
-#define yypv c_pv
-#define yys c_s
-#define yystate c_state
-#define yytmp c_tmp
-#define yyv c_v
-#define yyval c_val
-#define yylloc c_lloc
-
-/* Forward decls */
-void yyerror ();
-static int parse_number ();
-int yyparse ();
-
-/* #define YYDEBUG 1 */
-
-%}
-
-/* Although the yacc "value" of an expression is not used,
- since the result is stored in the structure being created,
- other node types do have values. */
-
-%union
- {
- LONGEST lval;
- unsigned LONGEST ulval;
- double dval;
- struct symbol *sym;
- struct type *tval;
- struct stoken sval;
- struct ttype tsym;
- struct symtoken ssym;
- int voidval;
- struct block *bval;
- enum exp_opcode opcode;
- struct internalvar *ivar;
-
- struct type **tvec;
- int *ivec;
- }
-
-%type <voidval> exp exp1 type_exp start variable
-%type <tval> type typebase
-%type <tvec> nonempty_typelist
-/* %type <bval> block */
-
-/* Fancy type parsing. */
-%type <voidval> func_mod direct_abs_decl abs_decl
-%type <tval> ptype
-%type <lval> array_mod
-
-%token <lval> INT CHAR
-%token <ulval> UINT
-%token <dval> FLOAT
-
-/* Both NAME and TYPENAME tokens represent symbols in the input,
- and both convey their data as strings.
- But a TYPENAME is a string that happens to be defined as a typedef
- or builtin type name (such as int or char)
- and a NAME is any other symbol.
- Contexts where this distinction is not important can use the
- nonterminal "name", which matches either NAME or TYPENAME. */
-
-%token <sval> STRING
-%token <ssym> NAME /* BLOCKNAME defined below to give it higher precedence. */
-%token <tsym> TYPENAME
-%type <sval> name
-%type <ssym> name_not_typename
-%type <tsym> typename
-
-/* A NAME_OR_INT is a symbol which is not known in the symbol table,
- but which would parse as a valid number in the current input radix.
- E.g. "c" when input_radix==16. Depending on the parse, it will be
- turned into a name or into a number. NAME_OR_UINT ditto. */
-
-%token <ssym> NAME_OR_INT NAME_OR_UINT
-
-%token STRUCT UNION ENUM SIZEOF UNSIGNED COLONCOLON
-%token TEMPLATE
-%token ERROR
-
-/* Special type cases, put in to allow the parser to distinguish different
- legal basetypes. */
-%token SIGNED LONG SHORT INT_KEYWORD
-
-%token <lval> LAST REGNAME
-
-%token <ivar> VARIABLE
-
-%token <opcode> ASSIGN_MODIFY
-
-/* C++ */
-%token THIS
-
-%left ','
-%left ABOVE_COMMA
-%right '=' ASSIGN_MODIFY
-%right '?'
-%left OR
-%left AND
-%left '|'
-%left '^'
-%left '&'
-%left EQUAL NOTEQUAL
-%left '<' '>' LEQ GEQ
-%left LSH RSH
-%left '@'
-%left '+' '-'
-%left '*' '/' '%'
-%right UNARY INCREMENT DECREMENT
-%right ARROW '.' '[' '('
-%token <ssym> BLOCKNAME
-%type <bval> block
-%left COLONCOLON
-
-%%
-
-start : exp1
- | type_exp
- ;
-
-type_exp: type
- { write_exp_elt_opcode(OP_TYPE);
- write_exp_elt_type($1);
- write_exp_elt_opcode(OP_TYPE);}
- ;
-
-/* Expressions, including the comma operator. */
-exp1 : exp
- | exp1 ',' exp
- { write_exp_elt_opcode (BINOP_COMMA); }
- ;
-
-/* Expressions, not including the comma operator. */
-exp : '*' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_IND); }
-
-exp : '&' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_ADDR); }
-
-exp : '-' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_NEG); }
- ;
-
-exp : '!' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_ZEROP); }
- ;
-
-exp : '~' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_LOGNOT); }
- ;
-
-exp : INCREMENT exp %prec UNARY
- { write_exp_elt_opcode (UNOP_PREINCREMENT); }
- ;
-
-exp : DECREMENT exp %prec UNARY
- { write_exp_elt_opcode (UNOP_PREDECREMENT); }
- ;
-
-exp : exp INCREMENT %prec UNARY
- { write_exp_elt_opcode (UNOP_POSTINCREMENT); }
- ;
-
-exp : exp DECREMENT %prec UNARY
- { write_exp_elt_opcode (UNOP_POSTDECREMENT); }
- ;
-
-exp : SIZEOF exp %prec UNARY
- { write_exp_elt_opcode (UNOP_SIZEOF); }
- ;
-
-exp : exp ARROW name
- { write_exp_elt_opcode (STRUCTOP_PTR);
- write_exp_string ($3);
- write_exp_elt_opcode (STRUCTOP_PTR); }
- ;
-
-exp : exp ARROW '*' exp
- { write_exp_elt_opcode (STRUCTOP_MPTR); }
- ;
-
-exp : exp '.' name
- { write_exp_elt_opcode (STRUCTOP_STRUCT);
- write_exp_string ($3);
- write_exp_elt_opcode (STRUCTOP_STRUCT); }
- ;
-
-exp : exp '.' '*' exp
- { write_exp_elt_opcode (STRUCTOP_MEMBER); }
- ;
-
-exp : exp '[' exp1 ']'
- { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
- ;
-
-exp : exp '('
- /* This is to save the value of arglist_len
- being accumulated by an outer function call. */
- { start_arglist (); }
- arglist ')' %prec ARROW
- { write_exp_elt_opcode (OP_FUNCALL);
- write_exp_elt_longcst ((LONGEST) end_arglist ());
- write_exp_elt_opcode (OP_FUNCALL); }
- ;
-
-arglist :
- ;
-
-arglist : exp
- { arglist_len = 1; }
- ;
-
-arglist : arglist ',' exp %prec ABOVE_COMMA
- { arglist_len++; }
- ;
-
-exp : '{' type '}' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_MEMVAL);
- write_exp_elt_type ($2);
- write_exp_elt_opcode (UNOP_MEMVAL); }
- ;
-
-exp : '(' type ')' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type ($2);
- write_exp_elt_opcode (UNOP_CAST); }
- ;
-
-exp : '(' exp1 ')'
- { }
- ;
-
-/* Binary operators in order of decreasing precedence. */
-
-exp : exp '@' exp
- { write_exp_elt_opcode (BINOP_REPEAT); }
- ;
-
-exp : exp '*' exp
- { write_exp_elt_opcode (BINOP_MUL); }
- ;
-
-exp : exp '/' exp
- { write_exp_elt_opcode (BINOP_DIV); }
- ;
-
-exp : exp '%' exp
- { write_exp_elt_opcode (BINOP_REM); }
- ;
-
-exp : exp '+' exp
- { write_exp_elt_opcode (BINOP_ADD); }
- ;
-
-exp : exp '-' exp
- { write_exp_elt_opcode (BINOP_SUB); }
- ;
-
-exp : exp LSH exp
- { write_exp_elt_opcode (BINOP_LSH); }
- ;
-
-exp : exp RSH exp
- { write_exp_elt_opcode (BINOP_RSH); }
- ;
-
-exp : exp EQUAL exp
- { write_exp_elt_opcode (BINOP_EQUAL); }
- ;
-
-exp : exp NOTEQUAL exp
- { write_exp_elt_opcode (BINOP_NOTEQUAL); }
- ;
-
-exp : exp LEQ exp
- { write_exp_elt_opcode (BINOP_LEQ); }
- ;
-
-exp : exp GEQ exp
- { write_exp_elt_opcode (BINOP_GEQ); }
- ;
-
-exp : exp '<' exp
- { write_exp_elt_opcode (BINOP_LESS); }
- ;
-
-exp : exp '>' exp
- { write_exp_elt_opcode (BINOP_GTR); }
- ;
-
-exp : exp '&' exp
- { write_exp_elt_opcode (BINOP_LOGAND); }
- ;
-
-exp : exp '^' exp
- { write_exp_elt_opcode (BINOP_LOGXOR); }
- ;
-
-exp : exp '|' exp
- { write_exp_elt_opcode (BINOP_LOGIOR); }
- ;
-
-exp : exp AND exp
- { write_exp_elt_opcode (BINOP_AND); }
- ;
-
-exp : exp OR exp
- { write_exp_elt_opcode (BINOP_OR); }
- ;
-
-exp : exp '?' exp ':' exp %prec '?'
- { write_exp_elt_opcode (TERNOP_COND); }
- ;
-
-exp : exp '=' exp
- { write_exp_elt_opcode (BINOP_ASSIGN); }
- ;
-
-exp : exp ASSIGN_MODIFY exp
- { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
- write_exp_elt_opcode ($2);
- write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); }
- ;
-
-exp : INT
- { write_exp_elt_opcode (OP_LONG);
- if ($1 == (int) $1 || $1 == (unsigned int) $1)
- write_exp_elt_type (builtin_type_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_LONGEST);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : NAME_OR_INT
- { YYSTYPE val;
- parse_number ($1.stoken.ptr, $1.stoken.length, 0, &val);
- write_exp_elt_opcode (OP_LONG);
- if (val.lval == (int) val.lval ||
- val.lval == (unsigned int) val.lval)
- write_exp_elt_type (builtin_type_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_LONGEST);
- write_exp_elt_longcst (val.lval);
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : UINT
- {
- write_exp_elt_opcode (OP_LONG);
- if ($1 == (unsigned int) $1)
- write_exp_elt_type (builtin_type_unsigned_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_UNSIGNED_LONGEST);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LONG);
- }
- ;
-
-exp : NAME_OR_UINT
- { YYSTYPE val;
- parse_number ($1.stoken.ptr, $1.stoken.length, 0, &val);
- write_exp_elt_opcode (OP_LONG);
- if (val.ulval == (unsigned int) val.ulval)
- write_exp_elt_type (builtin_type_unsigned_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_UNSIGNED_LONGEST);
- write_exp_elt_longcst ((LONGEST)val.ulval);
- write_exp_elt_opcode (OP_LONG);
- }
- ;
-
-exp : CHAR
- { write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : FLOAT
- { write_exp_elt_opcode (OP_DOUBLE);
- write_exp_elt_type (builtin_type_double);
- write_exp_elt_dblcst ($1);
- write_exp_elt_opcode (OP_DOUBLE); }
- ;
-
-exp : variable
- ;
-
-exp : LAST
- { write_exp_elt_opcode (OP_LAST);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LAST); }
- ;
-
-exp : REGNAME
- { write_exp_elt_opcode (OP_REGISTER);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_REGISTER); }
- ;
-
-exp : VARIABLE
- { write_exp_elt_opcode (OP_INTERNALVAR);
- write_exp_elt_intern ($1);
- write_exp_elt_opcode (OP_INTERNALVAR); }
- ;
-
-exp : SIZEOF '(' type ')' %prec UNARY
- { write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : STRING
- { write_exp_elt_opcode (OP_STRING);
- write_exp_string ($1);
- write_exp_elt_opcode (OP_STRING); }
- ;
-
-/* C++. */
-exp : THIS
- { write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS); }
- ;
-
-/* end of C++. */
-
-block : BLOCKNAME
- {
- if ($1.sym != 0)
- $$ = SYMBOL_BLOCK_VALUE ($1.sym);
- else
- {
- struct symtab *tem =
- lookup_symtab (copy_name ($1.stoken));
- if (tem)
- $$ = BLOCKVECTOR_BLOCK
- (BLOCKVECTOR (tem), STATIC_BLOCK);
- else
- error ("No file or function \"%s\".",
- copy_name ($1.stoken));
- }
- }
- ;
-
-block : block COLONCOLON name
- { struct symbol *tem
- = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, 0, NULL);
- if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
- error ("No function \"%s\" in specified context.",
- copy_name ($3));
- $$ = SYMBOL_BLOCK_VALUE (tem); }
- ;
-
-variable: block COLONCOLON name
- { struct symbol *sym;
- sym = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, 0, NULL);
- if (sym == 0)
- error ("No symbol \"%s\" in specified context.",
- copy_name ($3));
-
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE); }
- ;
-
-variable: typebase COLONCOLON name
- {
- struct type *type = $1;
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_UNION)
- error ("`%s' is not defined as an aggregate type.",
- TYPE_NAME (type));
-
- write_exp_elt_opcode (OP_SCOPE);
- write_exp_elt_type (type);
- write_exp_string ($3);
- write_exp_elt_opcode (OP_SCOPE);
- }
- | typebase COLONCOLON '~' name
- {
- struct type *type = $1;
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_UNION)
- error ("`%s' is not defined as an aggregate type.",
- TYPE_NAME (type));
-
- if (strcmp (type_name_no_tag (type), $4.ptr))
- error ("invalid destructor `%s::~%s'",
- type_name_no_tag (type), $4.ptr);
-
- write_exp_elt_opcode (OP_SCOPE);
- write_exp_elt_type (type);
- write_exp_string ($4);
- write_exp_elt_opcode (OP_SCOPE);
- write_exp_elt_opcode (UNOP_LOGNOT);
- }
- | COLONCOLON name
- {
- char *name = copy_name ($2);
- struct symbol *sym;
- int i;
-
- sym =
- lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL);
- if (sym)
- {
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- break;
- }
- for (i = 0; i < misc_function_count; i++)
- if (!strcmp (misc_function_vector[i].name, name))
- break;
-
- if (i < misc_function_count)
- {
- enum misc_function_type mft =
- misc_function_vector[i].type;
-
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) misc_function_vector[i].address);
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_opcode (UNOP_MEMVAL);
- if (mft == mf_data || mft == mf_bss)
- write_exp_elt_type (builtin_type_int);
- else if (mft == mf_text)
- write_exp_elt_type (lookup_function_type (builtin_type_int));
- else
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_opcode (UNOP_MEMVAL);
- }
- else
- if (symtab_list == 0
- && partial_symtab_list == 0)
- error ("No symbol table is loaded. Use the \"file\" command.");
- else
- error ("No symbol \"%s\" in current context.", name);
- }
- ;
-
-variable: name_not_typename
- { struct symbol *sym = $1.sym;
-
- if (sym)
- {
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_LOCAL:
- case LOC_LOCAL_ARG:
- if (innermost_block == 0 ||
- contained_in (block_found,
- innermost_block))
- innermost_block = block_found;
- case LOC_UNDEF:
- case LOC_CONST:
- case LOC_STATIC:
- case LOC_TYPEDEF:
- case LOC_LABEL:
- case LOC_BLOCK:
- case LOC_CONST_BYTES:
-
- /* In this case the expression can
- be evaluated regardless of what
- frame we are in, so there is no
- need to check for the
- innermost_block. These cases are
- listed so that gcc -Wall will
- report types that may not have
- been considered. */
-
- break;
- }
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- }
- else if ($1.is_a_field_of_this)
- {
- /* C++: it hangs off of `this'. Must
- not inadvertently convert from a method call
- to data ref. */
- if (innermost_block == 0 ||
- contained_in (block_found, innermost_block))
- innermost_block = block_found;
- write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (STRUCTOP_PTR);
- write_exp_string ($1.stoken);
- write_exp_elt_opcode (STRUCTOP_PTR);
- }
- else
- {
- register int i;
- register char *arg = copy_name ($1.stoken);
-
- /* FIXME, this search is linear! At least
- optimize the strcmp with a 1-char cmp... */
- for (i = 0; i < misc_function_count; i++)
- if (!strcmp (misc_function_vector[i].name, arg))
- break;
-
- if (i < misc_function_count)
- {
- enum misc_function_type mft =
- misc_function_vector[i].type;
-
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) misc_function_vector[i].address);
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_opcode (UNOP_MEMVAL);
- if (mft == mf_data || mft == mf_bss)
- write_exp_elt_type (builtin_type_int);
- else if (mft == mf_text)
- write_exp_elt_type (lookup_function_type (builtin_type_int));
- else
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_opcode (UNOP_MEMVAL);
- }
- else if (symtab_list == 0
- && partial_symtab_list == 0)
- error ("No symbol table is loaded. Use the \"file\" command.");
- else
- error ("No symbol \"%s\" in current context.",
- copy_name ($1.stoken));
- }
- }
- ;
-
-
-ptype : typebase
- | typebase abs_decl
- {
- /* This is where the interesting stuff happens. */
- int done = 0;
- int array_size;
- struct type *follow_type = $1;
-
- while (!done)
- switch (pop_type ())
- {
- case tp_end:
- done = 1;
- break;
- case tp_pointer:
- follow_type = lookup_pointer_type (follow_type);
- break;
- case tp_reference:
- follow_type = lookup_reference_type (follow_type);
- break;
- case tp_array:
- array_size = pop_type_int ();
- if (array_size != -1)
- follow_type = create_array_type (follow_type,
- array_size);
- else
- follow_type = lookup_pointer_type (follow_type);
- break;
- case tp_function:
- follow_type = lookup_function_type (follow_type);
- break;
- }
- $$ = follow_type;
- }
- ;
-
-abs_decl: '*'
- { push_type (tp_pointer); $$ = 0; }
- | '*' abs_decl
- { push_type (tp_pointer); $$ = $2; }
- | '&'
- { push_type (tp_reference); $$ = 0; }
- | '&' abs_decl
- { push_type (tp_reference); $$ = $2; }
- | direct_abs_decl
- ;
-
-direct_abs_decl: '(' abs_decl ')'
- { $$ = $2; }
- | direct_abs_decl array_mod
- {
- push_type_int ($2);
- push_type (tp_array);
- }
- | array_mod
- {
- push_type_int ($1);
- push_type (tp_array);
- $$ = 0;
- }
- | direct_abs_decl func_mod
- { push_type (tp_function); }
- | func_mod
- { push_type (tp_function); }
- ;
-
-array_mod: '[' ']'
- { $$ = -1; }
- | '[' INT ']'
- { $$ = $2; }
- ;
-
-func_mod: '(' ')'
- { $$ = 0; }
- | '(' nonempty_typelist ')'
- { free ($2); $$ = 0; }
- ;
-
-type : ptype
- | typebase COLONCOLON '*'
- { $$ = lookup_member_type (builtin_type_int, $1); }
- | type '(' typebase COLONCOLON '*' ')'
- { $$ = lookup_member_type ($1, $3); }
- | type '(' typebase COLONCOLON '*' ')' '(' ')'
- { $$ = lookup_member_type
- (lookup_function_type ($1), $3); }
- | type '(' typebase COLONCOLON '*' ')' '(' nonempty_typelist ')'
- { $$ = lookup_member_type
- (lookup_function_type ($1), $3);
- free ($8); }
- ;
-
-typebase
- : TYPENAME
- { $$ = $1.type; }
- | INT_KEYWORD
- { $$ = builtin_type_int; }
- | LONG
- { $$ = builtin_type_long; }
- | SHORT
- { $$ = builtin_type_short; }
- | LONG INT_KEYWORD
- { $$ = builtin_type_long; }
- | UNSIGNED LONG INT_KEYWORD
- { $$ = builtin_type_unsigned_long; }
- | LONG LONG
- { $$ = builtin_type_long_long; }
- | LONG LONG INT_KEYWORD
- { $$ = builtin_type_long_long; }
- | UNSIGNED LONG LONG
- { $$ = builtin_type_unsigned_long_long; }
- | UNSIGNED LONG LONG INT_KEYWORD
- { $$ = builtin_type_unsigned_long_long; }
- | SHORT INT_KEYWORD
- { $$ = builtin_type_short; }
- | UNSIGNED SHORT INT_KEYWORD
- { $$ = builtin_type_unsigned_short; }
- | STRUCT name
- { $$ = lookup_struct (copy_name ($2),
- expression_context_block); }
- | UNION name
- { $$ = lookup_union (copy_name ($2),
- expression_context_block); }
- | ENUM name
- { $$ = lookup_enum (copy_name ($2),
- expression_context_block); }
- | UNSIGNED typename
- { $$ = lookup_unsigned_typename (TYPE_NAME($2.type)); }
- | UNSIGNED
- { $$ = builtin_type_unsigned_int; }
- | SIGNED typename
- { $$ = $2.type; }
- | SIGNED
- { $$ = builtin_type_int; }
- | TEMPLATE name '<' type '>'
- { $$ = lookup_template_type(copy_name($2), $4,
- expression_context_block);
- }
- ;
-
-typename: TYPENAME
- | INT_KEYWORD
- {
- $$.stoken.ptr = "int";
- $$.stoken.length = 3;
- $$.type = builtin_type_int;
- }
- | LONG
- {
- $$.stoken.ptr = "long";
- $$.stoken.length = 4;
- $$.type = builtin_type_long;
- }
- | SHORT
- {
- $$.stoken.ptr = "short";
- $$.stoken.length = 5;
- $$.type = builtin_type_short;
- }
- ;
-
-nonempty_typelist
- : type
- { $$ = (struct type **)xmalloc (sizeof (struct type *) * 2);
- $$[0] = (struct type *)0;
- $$[1] = $1;
- }
- | nonempty_typelist ',' type
- { int len = sizeof (struct type *) * ++($<ivec>1[0]);
- $$ = (struct type **)xrealloc ($1, len);
- $$[$<ivec>$[0]] = $3;
- }
- ;
-
-name : NAME { $$ = $1.stoken; }
- | BLOCKNAME { $$ = $1.stoken; }
- | TYPENAME { $$ = $1.stoken; }
- | NAME_OR_INT { $$ = $1.stoken; }
- | NAME_OR_UINT { $$ = $1.stoken; }
- ;
-
-name_not_typename : NAME
- | BLOCKNAME
-/* These would be useful if name_not_typename was useful, but it is just
- a fake for "variable", so these cause reduce/reduce conflicts because
- the parser can't tell whether NAME_OR_INT is a name_not_typename (=variable,
- =exp) or just an exp. If name_not_typename was ever used in an lvalue
- context where only a name could occur, this might be useful.
- | NAME_OR_INT
- | NAME_OR_UINT
- */
- ;
-
-%%
-
-/* Take care of parsing a number (anything that starts with a digit).
- Set yylval and return the token type; update lexptr.
- LEN is the number of characters in it. */
-
-/*** Needs some error checking for the float case ***/
-
-static int
-parse_number (p, len, parsed_float, putithere)
- register char *p;
- register int len;
- int parsed_float;
- YYSTYPE *putithere;
-{
- register LONGEST n = 0;
- register LONGEST prevn = 0;
- register int i;
- register int c;
- register int base = input_radix;
- int unsigned_p = 0;
-
- extern double atof ();
-
- if (parsed_float)
- {
- /* It's a float since it contains a point or an exponent. */
- putithere->dval = atof (p);
- return FLOAT;
- }
-
- /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
- if (p[0] == '0')
- switch (p[1])
- {
- case 'x':
- case 'X':
- if (len >= 3)
- {
- p += 2;
- base = 16;
- len -= 2;
- }
- break;
-
- case 't':
- case 'T':
- case 'd':
- case 'D':
- if (len >= 3)
- {
- p += 2;
- base = 10;
- len -= 2;
- }
- break;
-
- default:
- base = 8;
- break;
- }
-
- while (len-- > 0)
- {
- c = *p++;
- if (c >= 'A' && c <= 'Z')
- c += 'a' - 'A';
- if (c != 'l' && c != 'u')
- n *= base;
- if (c >= '0' && c <= '9')
- n += i = c - '0';
- else
- {
- if (base > 10 && c >= 'a' && c <= 'f')
- n += i = c - 'a' + 10;
- else if (len == 0 && c == 'l')
- ;
- else if (len == 0 && c == 'u')
- unsigned_p = 1;
- else
- return ERROR; /* Char not a digit */
- }
- if (i >= base)
- return ERROR; /* Invalid digit in this base */
- if(!unsigned_p && (prevn >= n))
- unsigned_p=1; /* Try something unsigned */
- /* Don't do the range check if n==i and i==0, since that special
- case will give an overflow error. */
- if(RANGE_CHECK && n!=0)
- {
- if((unsigned_p && (unsigned)prevn >= (unsigned)n))
- range_error("Overflow on numeric constant.");
- }
- prevn=n;
- }
-
- if (unsigned_p)
- {
- putithere->ulval = n;
- return UINT;
- }
- else
- {
- putithere->lval = n;
- return INT;
- }
-}
-
-struct token
-{
- char *operator;
- int token;
- enum exp_opcode opcode;
-};
-
-const static struct token tokentab3[] =
- {
- {">>=", ASSIGN_MODIFY, BINOP_RSH},
- {"<<=", ASSIGN_MODIFY, BINOP_LSH}
- };
-
-const static struct token tokentab2[] =
- {
- {"+=", ASSIGN_MODIFY, BINOP_ADD},
- {"-=", ASSIGN_MODIFY, BINOP_SUB},
- {"*=", ASSIGN_MODIFY, BINOP_MUL},
- {"/=", ASSIGN_MODIFY, BINOP_DIV},
- {"%=", ASSIGN_MODIFY, BINOP_REM},
- {"|=", ASSIGN_MODIFY, BINOP_LOGIOR},
- {"&=", ASSIGN_MODIFY, BINOP_LOGAND},
- {"^=", ASSIGN_MODIFY, BINOP_LOGXOR},
- {"++", INCREMENT, BINOP_END},
- {"--", DECREMENT, BINOP_END},
- {"->", ARROW, BINOP_END},
- {"&&", AND, BINOP_END},
- {"||", OR, BINOP_END},
- {"::", COLONCOLON, BINOP_END},
- {"<<", LSH, BINOP_END},
- {">>", RSH, BINOP_END},
- {"==", EQUAL, BINOP_END},
- {"!=", NOTEQUAL, BINOP_END},
- {"<=", LEQ, BINOP_END},
- {">=", GEQ, BINOP_END}
- };
-
-/* Read one token, getting characters through lexptr. */
-
-int
-yylex ()
-{
- register int c;
- register int namelen;
- register unsigned i;
- register char *tokstart;
-
- retry:
-
- tokstart = lexptr;
- /* See if it is a special token of length 3. */
- for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
- if (!strncmp (tokstart, tokentab3[i].operator, 3))
- {
- lexptr += 3;
- yylval.opcode = tokentab3[i].opcode;
- return tokentab3[i].token;
- }
-
- /* See if it is a special token of length 2. */
- for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
- if (!strncmp (tokstart, tokentab2[i].operator, 2))
- {
- lexptr += 2;
- yylval.opcode = tokentab2[i].opcode;
- return tokentab2[i].token;
- }
-
- switch (c = *tokstart)
- {
- case 0:
- return 0;
-
- case ' ':
- case '\t':
- case '\n':
- lexptr++;
- goto retry;
-
- case '\'':
- lexptr++;
- c = *lexptr++;
- if (c == '\\')
- c = parse_escape (&lexptr);
- yylval.lval = c;
- c = *lexptr++;
- if (c != '\'')
- error ("Invalid character constant.");
- return CHAR;
-
- case '(':
- paren_depth++;
- lexptr++;
- return c;
-
- case ')':
- if (paren_depth == 0)
- return 0;
- paren_depth--;
- lexptr++;
- return c;
-
- case ',':
- if (comma_terminates && paren_depth == 0)
- return 0;
- lexptr++;
- return c;
-
- case '.':
- /* Might be a floating point number. */
- if (lexptr[1] < '0' || lexptr[1] > '9')
- goto symbol; /* Nope, must be a symbol. */
- /* FALL THRU into number case. */
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- {
- /* It's a number. */
- int got_dot = 0, got_e = 0, toktype;
- register char *p = tokstart;
- int hex = input_radix > 10;
-
- if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
- {
- p += 2;
- hex = 1;
- }
- else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
- {
- p += 2;
- hex = 0;
- }
-
- for (;; ++p)
- {
- if (!hex && !got_e && (*p == 'e' || *p == 'E'))
- got_dot = got_e = 1;
- else if (!hex && !got_dot && *p == '.')
- got_dot = 1;
- else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
- && (*p == '-' || *p == '+'))
- /* This is the sign of the exponent, not the end of the
- number. */
- continue;
- /* We will take any letters or digits. parse_number will
- complain if past the radix, or if L or U are not final. */
- else if ((*p < '0' || *p > '9')
- && ((*p < 'a' || *p > 'z')
- && (*p < 'A' || *p > 'Z')))
- break;
- }
- toktype = parse_number (tokstart, p - tokstart, got_dot|got_e, &yylval);
- if (toktype == ERROR)
- {
- char *err_copy = (char *) alloca (p - tokstart + 1);
-
- bcopy (tokstart, err_copy, p - tokstart);
- err_copy[p - tokstart] = 0;
- error ("Invalid number \"%s\".", err_copy);
- }
- lexptr = p;
- return toktype;
- }
-
- case '+':
- case '-':
- case '*':
- case '/':
- case '%':
- case '|':
- case '&':
- case '^':
- case '~':
- case '!':
- case '@':
- case '<':
- case '>':
- case '[':
- case ']':
- case '?':
- case ':':
- case '=':
- case '{':
- case '}':
- symbol:
- lexptr++;
- return c;
-
- case '"':
- for (namelen = 1; (c = tokstart[namelen]) != '"'; namelen++)
- if (c == '\\')
- {
- c = tokstart[++namelen];
- if (c >= '0' && c <= '9')
- {
- c = tokstart[++namelen];
- if (c >= '0' && c <= '9')
- c = tokstart[++namelen];
- }
- }
- yylval.sval.ptr = tokstart + 1;
- yylval.sval.length = namelen - 1;
- lexptr += namelen + 1;
- return STRING;
- }
-
- if (!(c == '_' || c == '$'
- || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
- /* We must have come across a bad character (e.g. ';'). */
- error ("Invalid character '%c' in expression.", c);
-
- /* It's a name. See how long it is. */
- namelen = 0;
- for (c = tokstart[namelen];
- (c == '_' || c == '$' || (c >= '0' && c <= '9')
- || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
- c = tokstart[++namelen])
- ;
-
- /* The token "if" terminates the expression and is NOT
- removed from the input stream. */
- if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
- {
- return 0;
- }
-
- lexptr += namelen;
-
- /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
- and $$digits (equivalent to $<-digits> if you could type that).
- Make token type LAST, and put the number (the digits) in yylval. */
-
- if (*tokstart == '$')
- {
- register int negate = 0;
- c = 1;
- /* Double dollar means negate the number and add -1 as well.
- Thus $$ alone means -1. */
- if (namelen >= 2 && tokstart[1] == '$')
- {
- negate = 1;
- c = 2;
- }
- if (c == namelen)
- {
- /* Just dollars (one or two) */
- yylval.lval = - negate;
- return LAST;
- }
- /* Is the rest of the token digits? */
- for (; c < namelen; c++)
- if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
- break;
- if (c == namelen)
- {
- yylval.lval = atoi (tokstart + 1 + negate);
- if (negate)
- yylval.lval = - yylval.lval;
- return LAST;
- }
- }
-
- /* Handle tokens that refer to machine registers:
- $ followed by a register name. */
-
- if (*tokstart == '$') {
- for (c = 0; c < NUM_REGS; c++)
- if (namelen - 1 == strlen (reg_names[c])
- && !strncmp (tokstart + 1, reg_names[c], namelen - 1))
- {
- yylval.lval = c;
- return REGNAME;
- }
- for (c = 0; c < num_std_regs; c++)
- if (namelen - 1 == strlen (std_regs[c].name)
- && !strncmp (tokstart + 1, std_regs[c].name, namelen - 1))
- {
- yylval.lval = std_regs[c].regnum;
- return REGNAME;
- }
- }
- /* Catch specific keywords. Should be done with a data structure. */
- switch (namelen)
- {
- case 8:
- if (!strncmp (tokstart, "unsigned", 8))
- return UNSIGNED;
- if (!strncmp (tokstart, "template", 8))
- return TEMPLATE;
- break;
- case 6:
- if (!strncmp (tokstart, "struct", 6))
- return STRUCT;
- if (!strncmp (tokstart, "signed", 6))
- return SIGNED;
- if (!strncmp (tokstart, "sizeof", 6))
- return SIZEOF;
- break;
- case 5:
- if (!strncmp (tokstart, "union", 5))
- return UNION;
- if (!strncmp (tokstart, "short", 5))
- return SHORT;
- break;
- case 4:
- if (!strncmp (tokstart, "enum", 4))
- return ENUM;
- if (!strncmp (tokstart, "long", 4))
- return LONG;
- if (!strncmp (tokstart, "this", 4))
- {
- static const char this_name[] =
- { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
-
- if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, 0, NULL))
- return THIS;
- }
- break;
- case 3:
- if (!strncmp (tokstart, "int", 3))
- return INT_KEYWORD;
- break;
- default:
- break;
- }
-
- yylval.sval.ptr = tokstart;
- yylval.sval.length = namelen;
-
- /* Any other names starting in $ are debugger internal variables. */
-
- if (*tokstart == '$')
- {
- yylval.ivar = lookup_internalvar (copy_name (yylval.sval) + 1);
- return VARIABLE;
- }
-
- /* Use token-type BLOCKNAME for symbols that happen to be defined as
- functions or symtabs. If this is not so, then ...
- Use token-type TYPENAME for symbols that happen to be defined
- currently as names of types; NAME for other symbols.
- The caller is not constrained to care about the distinction. */
- {
- char *tmp = copy_name (yylval.sval);
- struct symbol *sym;
- int is_a_field_of_this = 0;
- int hextype;
-
- sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE,
- current_language->la_language == language_cplus
- ? &is_a_field_of_this : NULL,
- NULL);
- if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) ||
- lookup_partial_symtab (tmp))
- {
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return BLOCKNAME;
- }
- if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
- {
- yylval.tsym.type = SYMBOL_TYPE (sym);
- return TYPENAME;
- }
- if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
- return TYPENAME;
-
- /* Input names that aren't symbols but ARE valid hex numbers,
- when the input radix permits them, can be names or numbers
- depending on the parse. Note we support radixes > 16 here. */
- if (!sym &&
- ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
- (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
- {
- YYSTYPE newlval; /* Its value is ignored. */
- hextype = parse_number (tokstart, namelen, 0, &newlval);
- if (hextype == INT)
- {
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return NAME_OR_INT;
- }
- if (hextype == UINT)
- {
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return NAME_OR_UINT;
- }
- }
-
- /* Any other kind of symbol */
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return NAME;
- }
-}
-
-void
-yyerror (msg)
- char *msg;
-{
- error (msg ? msg : "Invalid syntax in expression.");
-}
-
-/* Table mapping opcodes into strings for printing operators
- and precedences of the operators. */
-
-const static struct op_print c_op_print_tab[] =
- {
- {",", BINOP_COMMA, PREC_COMMA, 0},
- {"=", BINOP_ASSIGN, PREC_ASSIGN, 1},
- {"||", BINOP_OR, PREC_OR, 0},
- {"&&", BINOP_AND, PREC_AND, 0},
- {"|", BINOP_LOGIOR, PREC_LOGIOR, 0},
- {"&", BINOP_LOGAND, PREC_LOGAND, 0},
- {"^", BINOP_LOGXOR, PREC_LOGXOR, 0},
- {"==", BINOP_EQUAL, PREC_EQUAL, 0},
- {"!=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
- {"<=", BINOP_LEQ, PREC_ORDER, 0},
- {">=", BINOP_GEQ, PREC_ORDER, 0},
- {">", BINOP_GTR, PREC_ORDER, 0},
- {"<", BINOP_LESS, PREC_ORDER, 0},
- {">>", BINOP_RSH, PREC_SHIFT, 0},
- {"<<", BINOP_LSH, PREC_SHIFT, 0},
- {"+", BINOP_ADD, PREC_ADD, 0},
- {"-", BINOP_SUB, PREC_ADD, 0},
- {"*", BINOP_MUL, PREC_MUL, 0},
- {"/", BINOP_DIV, PREC_MUL, 0},
- {"%", BINOP_REM, PREC_MUL, 0},
- {"@", BINOP_REPEAT, PREC_REPEAT, 0},
- {"-", UNOP_NEG, PREC_PREFIX, 0},
- {"!", UNOP_ZEROP, PREC_PREFIX, 0},
- {"~", UNOP_LOGNOT, PREC_PREFIX, 0},
- {"*", UNOP_IND, PREC_PREFIX, 0},
- {"&", UNOP_ADDR, PREC_PREFIX, 0},
- {"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
- {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
- {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
- /* C++ */
- {"::", BINOP_SCOPE, PREC_PREFIX, 0},
-};
-
-/* These variables point to the objects
- representing the predefined C data types. */
-
-struct type *builtin_type_void;
-struct type *builtin_type_char;
-struct type *builtin_type_short;
-struct type *builtin_type_int;
-struct type *builtin_type_long;
-struct type *builtin_type_long_long;
-struct type *builtin_type_unsigned_char;
-struct type *builtin_type_unsigned_short;
-struct type *builtin_type_unsigned_int;
-struct type *builtin_type_unsigned_long;
-struct type *builtin_type_unsigned_long_long;
-struct type *builtin_type_float;
-struct type *builtin_type_double;
-struct type *builtin_type_long_double;
-struct type *builtin_type_complex;
-struct type *builtin_type_double_complex;
-
-struct type ** const (c_builtin_types[]) =
-{
- &builtin_type_int,
- &builtin_type_long,
- &builtin_type_short,
- &builtin_type_char,
- &builtin_type_float,
- &builtin_type_double,
- &builtin_type_void,
- &builtin_type_long_long,
- &builtin_type_unsigned_char,
- &builtin_type_unsigned_short,
- &builtin_type_unsigned_int,
- &builtin_type_unsigned_long,
- &builtin_type_unsigned_long_long,
- &builtin_type_long_double,
- &builtin_type_complex,
- &builtin_type_double_complex,
- 0
-};
-
-const struct language_defn c_language_defn = {
- "c", /* Language name */
- language_c,
- c_builtin_types,
- range_check_off,
- type_check_off,
- c_parse,
- c_error,
- &BUILTIN_TYPE_LONGEST, /* longest signed integral type */
- &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */
- &builtin_type_double, /* longest floating point type */ /*FIXME*/
- "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
- "0%o", "0%", "o", /* Octal format, prefix, suffix */
- c_op_print_tab, /* expression operators for printing */
- LANG_MAGIC
-};
-
-const struct language_defn cplus_language_defn = {
- "c++", /* Language name */
- language_cplus,
- c_builtin_types,
- range_check_off,
- type_check_off,
- c_parse,
- c_error,
- &BUILTIN_TYPE_LONGEST, /* longest signed integral type */
- &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */
- &builtin_type_double, /* longest floating point type */ /*FIXME*/
- "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
- "0%o", "0%", "o", /* Octal format, prefix, suffix */
- c_op_print_tab, /* expression operators for printing */
- LANG_MAGIC
-};
-
-void
-_initialize_c_exp ()
-{
- builtin_type_void =
- init_type (TYPE_CODE_VOID, 1, 0,
- "void");
- builtin_type_char =
- init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0,
- "char");
- builtin_type_unsigned_char =
- init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 1,
- "unsigned char");
- builtin_type_short =
- init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT, 0,
- "short");
- builtin_type_unsigned_short =
- init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT, 1,
- "unsigned short");
- builtin_type_int =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, 0,
- "int");
- builtin_type_unsigned_int =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, 1,
- "unsigned int");
- builtin_type_long =
- init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT, 0,
- "long");
- builtin_type_unsigned_long =
- init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT, 1,
- "unsigned long");
- builtin_type_long_long =
- init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, 0,
- "long long");
- builtin_type_unsigned_long_long =
- init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, 1,
- "unsigned long long");
- builtin_type_float =
- init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT, 0,
- "float");
- builtin_type_double =
- init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, 0,
- "double");
- builtin_type_long_double =
- init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, 0,
- "long double");
- builtin_type_complex =
- init_type (TYPE_CODE_FLT, TARGET_COMPLEX_BIT / TARGET_CHAR_BIT, 0,
- "complex");
- builtin_type_double_complex =
- init_type (TYPE_CODE_FLT, TARGET_DOUBLE_COMPLEX_BIT / TARGET_CHAR_BIT, 0,
- "double complex");
-
- add_language (&c_language_defn);
- add_language (&cplus_language_defn);
-}
diff --git a/gdb/coffread.c b/gdb/coffread.c
deleted file mode 100644
index 4b9f245..0000000
--- a/gdb/coffread.c
+++ /dev/null
@@ -1,2067 +0,0 @@
-/* Read coff symbol tables and convert to internal format, for GDB.
- Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
- Copyright (C) 1987-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "breakpoint.h"
-#include "bfd.h"
-#include "symfile.h"
-
-#include <obstack.h>
-#include <string.h>
-
-#include "internalcoff.h" /* Internal format of COFF symbols in BFD */
-#include "libcoff.h" /* FIXME secret internal data from BFD */
-
-static void add_symbol_to_list ();
-static void read_coff_symtab ();
-static void patch_opaque_types ();
-static struct type *decode_function_type ();
-static struct type *decode_type ();
-static struct type *decode_base_type ();
-static struct type *read_enum_type ();
-static struct type *read_struct_type ();
-static void finish_block ();
-static struct blockvector *make_blockvector ();
-static struct symbol *process_coff_symbol ();
-static int init_stringtab ();
-static void free_stringtab ();
-static char *getfilename ();
-static char *getsymname ();
-static int init_lineno ();
-static void enter_linenos ();
-static void read_one_sym ();
-
-extern int fclose ();
-
-/* To be an sdb debug type, type must have at least a basic or primary
- derived type. Using this rather than checking against T_NULL is
- said to prevent core dumps if we try to operate on Michael Bloom
- dbx-in-coff file. */
-
-#define SDB_TYPE(type) (BTYPE(type) | (type & N_TMASK))
-
-/*
- * Convert from an sdb register number to an internal gdb register number.
- * This should be defined in tm.h, if REGISTER_NAMES is not set up
- * to map one to one onto the sdb register numbers.
- */
-#ifndef SDB_REG_TO_REGNUM
-# define SDB_REG_TO_REGNUM(value) (value)
-#endif
-
-/* Name of source file whose symbol data we are now processing.
- This comes from a symbol named ".file". */
-
-static char *last_source_file;
-
-/* Core address of start and end of text of current source file.
- This comes from a ".text" symbol where x_nlinno > 0. */
-
-static CORE_ADDR cur_src_start_addr;
-static CORE_ADDR cur_src_end_addr;
-
-/* Core address of the end of the first object file. */
-static CORE_ADDR first_object_file_end;
-
-/* The addresses of the symbol table stream and number of symbols
- of the object file we are reading (as copied into core). */
-
-static FILE *nlist_stream_global;
-static int nlist_nsyms_global;
-
-/* The index in the symbol table of the last coff symbol that was processed. */
-
-static int symnum;
-
-/* Vector of types defined so far, indexed by their coff symnum. */
-
-static struct type **type_vector;
-
-/* Number of elements allocated for type_vector currently. */
-
-static int type_vector_length;
-
-/* Vector of line number information. */
-
-static struct linetable *line_vector;
-
-/* Index of next entry to go in line_vector_index. */
-
-static int line_vector_index;
-
-/* Last line number recorded in the line vector. */
-
-static int prev_line_number;
-
-/* Number of elements allocated for line_vector currently. */
-
-static int line_vector_length;
-
-/* Pointers to scratch storage, used for reading raw symbols and auxents. */
-
-static char *temp_sym;
-static char *temp_aux;
-
-/* Local variables that hold the shift and mask values for the
- COFF file that we are currently reading. These come back to us
- from BFD, and are referenced by their macro names, as well as
- internally to the BTYPE, ISPTR, ISFCN, ISARY, ISTAG, and DECREF
- macros from ../internalcoff.h . */
-
-static unsigned local_n_btmask;
-static unsigned local_n_btshft;
-static unsigned local_n_tmask;
-static unsigned local_n_tshift;
-
-#define N_BTMASK local_n_btmask
-#define N_BTSHFT local_n_btshft
-#define N_TMASK local_n_tmask
-#define N_TSHIFT local_n_tshift
-
-/* Local variables that hold the sizes in the file of various COFF structures.
- (We only need to know this to read them from the file -- BFD will then
- translate the data in them, into `internal_xxx' structs in the right
- byte order, alignment, etc.) */
-
-static unsigned local_linesz;
-static unsigned local_symesz;
-static unsigned local_auxesz;
-
-
-/* Chain of typedefs of pointers to empty struct/union types.
- They are chained thru the SYMBOL_VALUE_CHAIN. */
-
-#define HASHSIZE 127
-static struct symbol *opaque_type_chain[HASHSIZE];
-
-/* Record the symbols defined for each context in a list.
- We don't create a struct block for the context until we
- know how long to make it. */
-
-struct pending
-{
- struct pending *next;
- struct symbol *symbol;
-};
-
-/* Here are the three lists that symbols are put on. */
-
-struct pending *file_symbols; /* static at top level, and types */
-
-struct pending *global_symbols; /* global functions and variables */
-
-struct pending *local_symbols; /* everything local to lexical context */
-
-/* List of unclosed lexical contexts
- (that will become blocks, eventually). */
-
-struct context_stack
-{
- struct context_stack *next;
- struct pending *locals;
- struct pending_block *old_blocks;
- struct symbol *name;
- CORE_ADDR start_addr;
- int depth;
-};
-
-struct context_stack *context_stack;
-
-/* Nonzero if within a function (so symbols should be local,
- if nothing says specifically). */
-
-int within_function;
-
-#if 0
-/* The type of the function we are currently reading in. This is
- used by define_symbol to record the type of arguments to a function. */
-
-struct type *in_function_type;
-#endif
-
-/* List of blocks already made (lexical contexts already closed).
- This is used at the end to make the blockvector. */
-
-struct pending_block
-{
- struct pending_block *next;
- struct block *block;
-};
-
-struct pending_block *pending_blocks;
-
-extern CORE_ADDR startup_file_start; /* From blockframe.c */
-extern CORE_ADDR startup_file_end; /* From blockframe.c */
-
-/* Complaints about various problems in the file being read */
-
-struct complaint ef_complaint =
- {"Unmatched .ef symbol(s) ignored starting at symnum %d", 0, 0};
-
-struct complaint no_aux_complaint =
- {"symbol %d without one aux entry", 0, 0};
-
-struct complaint lineno_complaint =
- {"Line number pointer %d lower than start of line numbers", 0, 0};
-
-
-/* Look up a coff type-number index. Return the address of the slot
- where the type for that index is stored.
- The type-number is in INDEX.
-
- This can be used for finding the type associated with that index
- or for associating a new type with the index. */
-
-static struct type **
-coff_lookup_type (index)
- register int index;
-{
- if (index >= type_vector_length)
- {
- int old_vector_length = type_vector_length;
-
- type_vector_length *= 2;
- if (type_vector_length < index) {
- type_vector_length = index * 2;
- }
- type_vector = (struct type **)
- xrealloc (type_vector, type_vector_length * sizeof (struct type *));
- bzero (&type_vector[old_vector_length],
- (type_vector_length - old_vector_length) * sizeof(struct type *));
- }
- return &type_vector[index];
-}
-
-/* Make sure there is a type allocated for type number index
- and return the type object.
- This can create an empty (zeroed) type object. */
-
-static struct type *
-coff_alloc_type (index)
- int index;
-{
- register struct type **type_addr = coff_lookup_type (index);
- register struct type *type = *type_addr;
-
- /* If we are referring to a type not known at all yet,
- allocate an empty type for it.
- We will fill it in later if we find out how. */
- if (type == 0)
- {
- type = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
- bzero (type, sizeof (struct type));
- TYPE_VPTR_FIELDNO (type) = -1;
- *type_addr = type;
- }
- return type;
-}
-
-/* maintain the lists of symbols and blocks */
-
-/* Add a symbol to one of the lists of symbols. */
-static void
-add_symbol_to_list (symbol, listhead)
- struct symbol *symbol;
- struct pending **listhead;
-{
- register struct pending *link
- = (struct pending *) xmalloc (sizeof (struct pending));
-
- link->next = *listhead;
- link->symbol = symbol;
- *listhead = link;
-}
-
-/* Take one of the lists of symbols and make a block from it.
- Put the block on the list of pending blocks. */
-
-static void
-finish_block (symbol, listhead, old_blocks, start, end)
- struct symbol *symbol;
- struct pending **listhead;
- struct pending_block *old_blocks;
- CORE_ADDR start, end;
-{
- register struct pending *next, *next1;
- register struct block *block;
- register struct pending_block *pblock;
- struct pending_block *opblock;
- register int i;
-
- /* Count the length of the list of symbols. */
-
- for (next = *listhead, i = 0; next; next = next->next, i++);
-
- block = (struct block *)
- obstack_alloc (symbol_obstack, sizeof (struct block) + (i - 1) * sizeof (struct symbol *));
-
- /* Copy the symbols into the block. */
-
- BLOCK_NSYMS (block) = i;
- for (next = *listhead; next; next = next->next)
- BLOCK_SYM (block, --i) = next->symbol;
-
- BLOCK_START (block) = start;
- BLOCK_END (block) = end;
- BLOCK_SUPERBLOCK (block) = 0; /* Filled in when containing block is made */
-
- /* Put the block in as the value of the symbol that names it. */
-
- if (symbol)
- {
- SYMBOL_BLOCK_VALUE (symbol) = block;
- BLOCK_FUNCTION (block) = symbol;
- }
- else
- BLOCK_FUNCTION (block) = 0;
-
- /* Now free the links of the list, and empty the list. */
-
- for (next = *listhead; next; next = next1)
- {
- next1 = next->next;
- free (next);
- }
- *listhead = 0;
-
- /* Install this block as the superblock
- of all blocks made since the start of this scope
- that don't have superblocks yet. */
-
- opblock = 0;
- for (pblock = pending_blocks; pblock != old_blocks; pblock = pblock->next)
- {
- if (BLOCK_SUPERBLOCK (pblock->block) == 0)
- BLOCK_SUPERBLOCK (pblock->block) = block;
- opblock = pblock;
- }
-
- /* Record this block on the list of all blocks in the file.
- Put it after opblock, or at the beginning if opblock is 0.
- This puts the block in the list after all its subblocks. */
-
- pblock = (struct pending_block *) xmalloc (sizeof (struct pending_block));
- pblock->block = block;
- if (opblock)
- {
- pblock->next = opblock->next;
- opblock->next = pblock;
- }
- else
- {
- pblock->next = pending_blocks;
- pending_blocks = pblock;
- }
-}
-
-static struct blockvector *
-make_blockvector ()
-{
- register struct pending_block *next, *next1;
- register struct blockvector *blockvector;
- register int i;
-
- /* Count the length of the list of blocks. */
-
- for (next = pending_blocks, i = 0; next; next = next->next, i++);
-
- blockvector = (struct blockvector *)
- obstack_alloc (symbol_obstack, sizeof (struct blockvector) + (i - 1) * sizeof (struct block *));
-
- /* Copy the blocks into the blockvector.
- This is done in reverse order, which happens to put
- the blocks into the proper order (ascending starting address).
- finish_block has hair to insert each block into the list
- after its subblocks in order to make sure this is true. */
-
- BLOCKVECTOR_NBLOCKS (blockvector) = i;
- for (next = pending_blocks; next; next = next->next)
- BLOCKVECTOR_BLOCK (blockvector, --i) = next->block;
-
- /* Now free the links of the list, and empty the list. */
-
- for (next = pending_blocks; next; next = next1)
- {
- next1 = next->next;
- free (next);
- }
- pending_blocks = 0;
-
- return blockvector;
-}
-
-/* Manage the vector of line numbers. */
-
-static void
-record_line (line, pc)
- int line;
- CORE_ADDR pc;
-{
- struct linetable_entry *e;
- /* Make sure line vector is big enough. */
-
- if (line_vector_index + 2 >= line_vector_length)
- {
- line_vector_length *= 2;
- line_vector = (struct linetable *)
- xrealloc (line_vector, sizeof (struct linetable)
- + (line_vector_length
- * sizeof (struct linetable_entry)));
- }
-
- e = line_vector->item + line_vector_index++;
- e->line = line; e->pc = pc;
-}
-
-/* Start a new symtab for a new source file.
- This is called when a COFF ".file" symbol is seen;
- it indicates the start of data for one original source file. */
-
-static void
-start_symtab ()
-{
- file_symbols = 0;
- global_symbols = 0;
- context_stack = 0;
- within_function = 0;
- last_source_file = 0;
-
- /* Initialize the source file line number information for this file. */
-
- if (line_vector) /* Unlikely, but maybe possible? */
- free (line_vector);
- line_vector_index = 0;
- line_vector_length = 1000;
- prev_line_number = -2; /* Force first line number to be explicit */
- line_vector = (struct linetable *)
- xmalloc (sizeof (struct linetable)
- + line_vector_length * sizeof (struct linetable_entry));
-}
-
-/* Save the vital information from when starting to read a file,
- for use when closing off the current file.
- NAME is the file name the symbols came from, START_ADDR is the first
- text address for the file, and SIZE is the number of bytes of text. */
-
-static void
-complete_symtab (name, start_addr, size)
- char *name;
- CORE_ADDR start_addr;
- unsigned int size;
-{
- last_source_file = savestring (name, strlen (name));
- cur_src_start_addr = start_addr;
- cur_src_end_addr = start_addr + size;
-
- if (entry_point < cur_src_end_addr
- && entry_point >= cur_src_start_addr)
- {
- startup_file_start = cur_src_start_addr;
- startup_file_end = cur_src_end_addr;
- }
-}
-
-/* Finish the symbol definitions for one main source file,
- close off all the lexical contexts for that file
- (creating struct block's for them), then make the
- struct symtab for that file and put it in the list of all such. */
-
-static void
-end_symtab (objfile)
- struct objfile *objfile;
-{
- register struct symtab *symtab;
- register struct context_stack *cstk;
- register struct blockvector *blockvector;
- register struct linetable *lv;
-
- /* Finish the lexical context of the last function in the file. */
-
- if (context_stack)
- {
- cstk = context_stack;
- context_stack = 0;
- /* Make a block for the local symbols within. */
- finish_block (cstk->name, &local_symbols, cstk->old_blocks,
- cstk->start_addr, cur_src_end_addr);
- free (cstk);
- }
-
- /* Ignore a file that has no functions with real debugging info. */
- if (pending_blocks == 0 && file_symbols == 0 && global_symbols == 0)
- {
- free (line_vector);
- line_vector = 0;
- line_vector_length = -1;
- last_source_file = 0;
- return;
- }
-
- /* Create the two top-level blocks for this file (STATIC_BLOCK and
- GLOBAL_BLOCK). */
- finish_block (0, &file_symbols, 0, cur_src_start_addr, cur_src_end_addr);
- finish_block (0, &global_symbols, 0, cur_src_start_addr, cur_src_end_addr);
-
- /* Create the blockvector that points to all the file's blocks. */
- blockvector = make_blockvector ();
-
- /* Now create the symtab object for this source file. */
- symtab = allocate_symtab (last_source_file, objfile);
-
- /* Fill in its components. */
- symtab->blockvector = blockvector;
- symtab->free_code = free_linetable;
- symtab->free_ptr = 0;
- symtab->filename = last_source_file;
- symtab->dirname = NULL;
- lv = line_vector;
- lv->nitems = line_vector_index;
- symtab->linetable = (struct linetable *)
- xrealloc (lv, (sizeof (struct linetable)
- + lv->nitems * sizeof (struct linetable_entry)));
-
- free_named_symtabs (symtab->filename);
-
- /* Link the new symtab into the list of such. */
- symtab->next = symtab_list;
- symtab_list = symtab;
-
- /* Reinitialize for beginning of new file. */
- line_vector = 0;
- line_vector_length = -1;
- last_source_file = 0;
-}
-
-static void
-record_misc_function (name, address)
- char *name;
- CORE_ADDR address;
-{
- /* We don't want TDESC entry points on the misc_function_vector */
- if (name[0] == '@') return;
-
- /* mf_text isn't true, but apparently COFF doesn't tell us what it really
- is, so this guess is more useful than mf_unknown. */
- prim_record_misc_function (savestring (name, strlen (name)),
- address,
- (int)mf_text);
-}
-
-/* coff_symfile_init ()
- is the coff-specific initialization routine for reading symbols.
- It is passed a struct sym_fns which contains, among other things,
- the BFD for the file whose symbols are being read, and a slot for
- a pointer to "private data" which we fill with cookies and other
- treats for coff_symfile_read ().
-
- We will only be called if this is a COFF or COFF-like file.
- BFD handles figuring out the format of the file, and code in symtab.c
- uses BFD's determination to vector to us.
-
- The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */
-
-struct coff_symfile_info {
- file_ptr min_lineno_offset; /* Where in file lowest line#s are */
- file_ptr max_lineno_offset; /* 1+last byte of line#s in file */
-};
-
-static int text_bfd_scnum;
-
-static void
-coff_symfile_init (sf)
- struct sym_fns *sf;
-{
- asection *section;
- bfd *abfd = sf->sym_bfd;
-
- /* Allocate struct to keep track of the symfile */
- /* FIXME memory leak */
- sf->sym_private = xmalloc (sizeof (struct coff_symfile_info));
-
- /* Save startup file's range of PC addresses to help blockframe.c
- decide where the bottom of the stack is. */
- if (bfd_get_file_flags (abfd) & EXEC_P)
- {
- /* Executable file -- record its entry point so we'll recognize
- the startup file because it contains the entry point. */
- entry_point = bfd_get_start_address (abfd);
- }
- else
- {
- /* Examination of non-executable.o files. Short-circuit this stuff. */
- /* ~0 will not be in any file, we hope. */
- entry_point = ~0;
- /* set the startup file to be an empty range. */
- startup_file_start = 0;
- startup_file_end = 0;
- }
- /* Save the section number for the text section */
- if (section = bfd_get_section_by_name(abfd,".text"))
- text_bfd_scnum = section->index;
- else
- text_bfd_scnum = -1;
-}
-
-/* This function is called for every section; it finds the outer limits
- of the line table (minimum and maximum file offset) so that the
- mainline code can read the whole thing for efficiency. */
-
-/* ARGSUSED */
-static void
-find_linenos (abfd, asect, vpinfo)
- bfd *abfd;
- sec_ptr asect;
- void *vpinfo;
-{
- struct coff_symfile_info *info;
- int size, count;
- file_ptr offset, maxoff;
-
-/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */
- count = asect->lineno_count;
-/* End of warning */
-
- if (count == 0)
- return;
- size = count * local_linesz;
-
- info = (struct coff_symfile_info *)vpinfo;
-/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */
- offset = asect->line_filepos;
-/* End of warning */
-
- if (offset < info->min_lineno_offset || info->min_lineno_offset == 0)
- info->min_lineno_offset = offset;
-
- maxoff = offset + size;
- if (maxoff > info->max_lineno_offset)
- info->max_lineno_offset = maxoff;
-}
-
-
-/* The BFD for this file -- only good while we're actively reading
- symbols into a psymtab or a symtab. */
-
-static bfd *symfile_bfd;
-
-/* Read a symbol file, after initialization by coff_symfile_init. */
-/* FIXME! Addr and Mainline are not used yet -- this will not work for
- shared libraries or add_file! */
-
-/* ARGSUSED */
-static void
-coff_symfile_read (sf, addr, mainline)
- struct sym_fns *sf;
- CORE_ADDR addr;
- int mainline;
-{
- struct coff_symfile_info *info = (struct coff_symfile_info *)sf->sym_private;
- bfd *abfd = sf->objfile->obfd;
- coff_data_type *cdata = coff_data (abfd);
- char *name = bfd_get_filename (abfd);
- int desc;
- register int val;
- int num_symbols;
- int symtab_offset;
- int stringtab_offset;
-
- symfile_bfd = abfd; /* Kludge for swap routines */
-
-/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */
- desc = fileno ((FILE *)(abfd->iostream)); /* File descriptor */
- num_symbols = bfd_get_symcount (abfd); /* How many syms */
- symtab_offset = cdata->sym_filepos; /* Symbol table file offset */
- stringtab_offset = symtab_offset + /* String table file offset */
- num_symbols * cdata->local_symesz;
-
- /* Set a few file-statics that give us specific information about
- the particular COFF file format we're reading. */
- local_linesz = cdata->local_linesz;
- local_n_btmask = cdata->local_n_btmask;
- local_n_btshft = cdata->local_n_btshft;
- local_n_tmask = cdata->local_n_tmask;
- local_n_tshift = cdata->local_n_tshift;
- local_linesz = cdata->local_linesz;
- local_symesz = cdata->local_symesz;
- local_auxesz = cdata->local_auxesz;
-
- /* Allocate space for raw symbol and aux entries, based on their
- space requirements as reported by BFD. */
- temp_sym = (char *) xmalloc
- (cdata->local_symesz + cdata->local_auxesz);
- temp_aux = temp_sym + cdata->local_symesz;
- make_cleanup (free_current_contents, &temp_sym);
-/* End of warning */
-
- /* Read the line number table, all at once. */
- info->min_lineno_offset = 0;
- info->max_lineno_offset = 0;
- bfd_map_over_sections (abfd, find_linenos, info);
-
- val = init_lineno (desc, info->min_lineno_offset,
- info->max_lineno_offset - info->min_lineno_offset);
- if (val < 0)
- error ("\"%s\": error reading line numbers\n", name);
-
- /* Now read the string table, all at once. */
-
- val = init_stringtab (desc, stringtab_offset);
- if (val < 0)
- error ("\"%s\": can't get string table", name);
- make_cleanup (free_stringtab, 0);
-
- /* Position to read the symbol table. Do not read it all at once. */
- val = lseek (desc, (long)symtab_offset, 0);
- if (val < 0)
- perror_with_name (name);
-
- init_misc_bunches ();
- make_cleanup (discard_misc_bunches, 0);
-
- /* Now that the executable file is positioned at symbol table,
- process it and define symbols accordingly. */
-
- read_coff_symtab (desc, num_symbols, sf->objfile);
-
- patch_opaque_types ();
-
- /* Sort symbols alphabetically within each block. */
-
- sort_all_symtab_syms ();
-
- /* Go over the misc symbol bunches and install them in vector. */
-
- condense_misc_bunches (!mainline);
-
- /* Make a default for file to list. */
-
- select_source_symtab (0); /* FIXME, this might be too slow, see dbxread */
-}
-
-static void
-coff_new_init ()
-{
- /* Nothin' to do */
-}
-
-/* Simplified internal version of coff symbol table information */
-
-struct coff_symbol {
- char *c_name;
- int c_symnum; /* symbol number of this entry */
- int c_naux; /* 0 if syment only, 1 if syment + auxent, etc */
- long c_value;
- int c_sclass;
- int c_secnum;
- unsigned int c_type;
-};
-
-/* Given pointers to a symbol table in coff style exec file,
- analyze them and create struct symtab's describing the symbols.
- NSYMS is the number of symbols in the symbol table.
- We read them one at a time using read_one_sym (). */
-
-static void
-read_coff_symtab (desc, nsyms, objfile)
- int desc;
- int nsyms;
- struct objfile *objfile;
-{
- int newfd; /* Avoid multiple closes on same desc */
- FILE *stream;
- register struct context_stack *new;
- struct coff_symbol coff_symbol;
- register struct coff_symbol *cs = &coff_symbol;
- static struct internal_syment main_sym;
- static union internal_auxent main_aux;
- struct coff_symbol fcn_cs_saved;
- static struct internal_syment fcn_sym_saved;
- static union internal_auxent fcn_aux_saved;
-
- /* A .file is open. */
- int in_source_file = 0;
- int num_object_files = 0;
- int next_file_symnum = -1;
-
- /* Name of the current file. */
- char *filestring = "";
- int depth;
- int fcn_first_line;
- int fcn_last_line;
- int fcn_start_addr;
- long fcn_line_ptr;
- struct cleanup *old_chain;
-
-
- newfd = dup (desc);
- if (newfd == -1)
- fatal ("Too many open files");
- stream = fdopen (newfd, "r");
-
- /* These cleanups will be discarded below if we succeed. */
- old_chain = make_cleanup (free_objfile, objfile);
- make_cleanup (fclose, stream);
-
- nlist_stream_global = stream;
- nlist_nsyms_global = nsyms;
- last_source_file = 0;
- bzero (opaque_type_chain, sizeof opaque_type_chain);
-
- if (type_vector) /* Get rid of previous one */
- free (type_vector);
- type_vector_length = 160;
- type_vector = (struct type **)
- xmalloc (type_vector_length * sizeof (struct type *));
- bzero (type_vector, type_vector_length * sizeof (struct type *));
-
- start_symtab ();
-
- symnum = 0;
- while (symnum < nsyms)
- {
- QUIT; /* Make this command interruptable. */
- read_one_sym (cs, &main_sym, &main_aux);
-
-#ifdef SEM
- temp_sem_val = cs->c_name[0] << 24 | cs->c_name[1] << 16 |
- cs->c_name[2] << 8 | cs->c_name[3];
- if (int_sem_val == temp_sem_val)
- last_coffsem = (int) strtol (cs->c_name+4, (char **) NULL, 10);
-#endif
-
- if (cs->c_symnum == next_file_symnum && cs->c_sclass != C_FILE)
- {
- if (last_source_file)
- end_symtab (objfile);
-
- start_symtab ();
- complete_symtab ("_globals_", 0, first_object_file_end);
- /* done with all files, everything from here on out is globals */
- }
-
- /* Special case for file with type declarations only, no text. */
- if (!last_source_file && SDB_TYPE (cs->c_type)
- && cs->c_secnum == N_DEBUG)
- complete_symtab (filestring, 0, 0);
-
- /* Typedefs should not be treated as symbol definitions. */
- if (ISFCN (cs->c_type) && cs->c_sclass != C_TPDEF)
- {
- /* record as misc function. if we get '.bf' next,
- * then we undo this step
- */
- record_misc_function (cs->c_name, cs->c_value);
-
- fcn_line_ptr = main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr;
- fcn_start_addr = cs->c_value;
- fcn_cs_saved = *cs;
- fcn_sym_saved = main_sym;
- fcn_aux_saved = main_aux;
- continue;
- }
-
- switch (cs->c_sclass)
- {
- case C_EFCN:
- case C_EXTDEF:
- case C_ULABEL:
- case C_USTATIC:
- case C_LINE:
- case C_ALIAS:
- case C_HIDDEN:
- printf ("Bad n_sclass = %d\n", cs->c_sclass);
- break;
-
- case C_FILE:
- /*
- * c_value field contains symnum of next .file entry in table
- * or symnum of first global after last .file.
- */
- next_file_symnum = cs->c_value;
- filestring = getfilename (&main_aux);
- /*
- * Complete symbol table for last object file
- * containing debugging information.
- */
- if (last_source_file)
- {
- end_symtab (objfile);
- start_symtab ();
- }
- in_source_file = 1;
- break;
-
- case C_STAT:
- if (cs->c_name[0] == '.') {
- if (strcmp (cs->c_name, ".text") == 0) {
- /* FIXME: don't wire in ".text" as section name
- or symbol name! */
- if (++num_object_files == 1) {
- /* last address of startup file */
- first_object_file_end = cs->c_value +
- main_aux.x_scn.x_scnlen;
- }
- /* Check for in_source_file deals with case of
- a file with debugging symbols
- followed by a later file with no symbols. */
- if (in_source_file)
- complete_symtab (filestring, cs->c_value,
- main_aux.x_scn.x_scnlen);
- in_source_file = 0;
- }
- /* flush rest of '.' symbols */
- break;
- }
- else if (!SDB_TYPE (cs->c_type)
- && cs->c_name[0] == 'L'
- && (strncmp (cs->c_name, "LI%", 3) == 0
- || strncmp (cs->c_name, "LF%", 3) == 0
- || strncmp (cs->c_name,"LC%",3) == 0
- || strncmp (cs->c_name,"LP%",3) == 0
- || strncmp (cs->c_name,"LPB%",4) == 0
- || strncmp (cs->c_name,"LBB%",4) == 0
- || strncmp (cs->c_name,"LBE%",4) == 0
- || strncmp (cs->c_name,"LPBX%",5) == 0))
- /* At least on a 3b1, gcc generates swbeg and string labels
- that look like this. Ignore them. */
- break;
- /* fall in for static symbols that don't start with '.' */
- case C_EXT:
- if (!SDB_TYPE (cs->c_type)) {
- /* FIXME: This is BOGUS Will Robinson!
- Coff should provide the SEC_CODE flag for executable sections,
- then if we could look up sections by section number we
- could see if the flags indicate SEC_CODE. If so, then
- record this symbol as a miscellaneous function. But why
- are absolute syms recorded as functions, anyway? */
- if (cs->c_secnum <= text_bfd_scnum+1) {/* text or abs */
- record_misc_function (cs->c_name, cs->c_value);
- break;
- } else {
- cs->c_type = T_INT;
- }
- }
- (void) process_coff_symbol (cs, &main_aux);
- break;
-
- case C_FCN:
- if (strcmp (cs->c_name, ".bf") == 0)
- {
- within_function = 1;
-
- /* value contains address of first non-init type code */
- /* main_aux.x_sym.x_misc.x_lnsz.x_lnno
- contains line number of '{' } */
- if (cs->c_naux != 1)
- complain (no_aux_complaint, cs->c_symnum);
- fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
-
- new = (struct context_stack *)
- xmalloc (sizeof (struct context_stack));
- new->depth = depth = 0;
- new->next = 0;
- context_stack = new;
- new->locals = 0;
- new->old_blocks = pending_blocks;
- new->start_addr = fcn_start_addr;
- fcn_cs_saved.c_name = getsymname (&fcn_sym_saved);
- new->name = process_coff_symbol (&fcn_cs_saved,
- &fcn_aux_saved);
- }
- else if (strcmp (cs->c_name, ".ef") == 0)
- {
- /* the value of .ef is the address of epilogue code;
- * not useful for gdb
- */
- /* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
- contains number of lines to '}' */
- new = context_stack;
- if (new == 0)
- {
- complain (&ef_complaint, cs->c_symnum);
- within_function = 0;
- break;
- }
- if (cs->c_naux != 1) {
- complain (no_aux_complaint, cs->c_symnum);
- fcn_last_line = 0x7FFFFFFF;
- } else {
- fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
- }
- enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line);
-
- finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr,
-#if defined (FUNCTION_EPILOGUE_SIZE)
- /* This macro should be defined only on
- machines where the
- fcn_aux_saved.x_sym.x_misc.x_fsize
- field is always zero.
- So use the .bf record information that
- points to the epilogue and add the size
- of the epilogue. */
- cs->c_value + FUNCTION_EPILOGUE_SIZE
-#else
- fcn_cs_saved.c_value +
- fcn_aux_saved.x_sym.x_misc.x_fsize
-#endif
- );
- context_stack = 0;
- within_function = 0;
- free (new);
- }
- break;
-
- case C_BLOCK:
- if (strcmp (cs->c_name, ".bb") == 0)
- {
- new = (struct context_stack *)
- xmalloc (sizeof (struct context_stack));
- depth++;
- new->depth = depth;
- new->next = context_stack;
- context_stack = new;
- new->locals = local_symbols;
- new->old_blocks = pending_blocks;
- new->start_addr = cs->c_value;
- new->name = 0;
- local_symbols = 0;
- }
- else if (strcmp (cs->c_name, ".eb") == 0)
- {
- new = context_stack;
- if (new == 0 || depth != new->depth)
- error ("Invalid symbol data: .bb/.eb symbol mismatch at symbol %d.",
- symnum);
- if (local_symbols && context_stack->next)
- {
- /* Make a block for the local symbols within. */
- finish_block (0, &local_symbols, new->old_blocks,
- new->start_addr, cs->c_value);
- }
- depth--;
- local_symbols = new->locals;
- context_stack = new->next;
- free (new);
- }
- break;
-
- default:
- (void) process_coff_symbol (cs, &main_aux);
- break;
- }
- }
-
- if (last_source_file)
- end_symtab (objfile);
- fclose (stream);
- discard_cleanups (old_chain);
-}
-
-/* Routines for reading headers and symbols from executable. */
-
-#ifdef FIXME
-/* Move these XXXMAGIC symbol defns into BFD! */
-
-/* Read COFF file header, check magic number,
- and return number of symbols. */
-read_file_hdr (chan, file_hdr)
- int chan;
- FILHDR *file_hdr;
-{
- lseek (chan, 0L, 0);
- if (myread (chan, (char *)file_hdr, FILHSZ) < 0)
- return -1;
-
- switch (file_hdr->f_magic)
- {
-#ifdef MC68MAGIC
- case MC68MAGIC:
-#endif
-#ifdef NS32GMAGIC
- case NS32GMAGIC:
- case NS32SMAGIC:
-#endif
-#ifdef I386MAGIC
- case I386MAGIC:
-#endif
-#ifdef CLIPPERMAGIC
- case CLIPPERMAGIC:
-#endif
-#if defined (MC68KWRMAGIC) \
- && (!defined (MC68MAGIC) || MC68KWRMAGIC != MC68MAGIC)
- case MC68KWRMAGIC:
-#endif
-#ifdef MC68KROMAGIC
- case MC68KROMAGIC:
- case MC68KPGMAGIC:
-#endif
-#ifdef MC88DGMAGIC
- case MC88DGMAGIC:
-#endif
-#ifdef MC88MAGIC
- case MC88MAGIC:
-#endif
-#ifdef I960ROMAGIC
- case I960ROMAGIC: /* Intel 960 */
-#endif
-#ifdef I960RWMAGIC
- case I960RWMAGIC: /* Intel 960 */
-#endif
- return file_hdr->f_nsyms;
-
- default:
-#ifdef BADMAG
- if (BADMAG(file_hdr))
- return -1;
- else
- return file_hdr->f_nsyms;
-#else
- return -1;
-#endif
- }
-}
-#endif
-
-/* Read the next symbol, swap it, and return it in both internal_syment
- form, and coff_symbol form. Also return its first auxent, if any,
- in internal_auxent form, and skip any other auxents. */
-
-static void
-read_one_sym (cs, sym, aux)
- register struct coff_symbol *cs;
- register struct internal_syment *sym;
- register union internal_auxent *aux;
-{
- int i;
-
- cs->c_symnum = symnum;
- fread (temp_sym, local_symesz, 1, nlist_stream_global);
- bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *)sym);
- cs->c_naux = sym->n_numaux & 0xff;
- if (cs->c_naux >= 1)
- {
- fread (temp_aux, local_auxesz, 1, nlist_stream_global);
- bfd_coff_swap_aux_in (symfile_bfd, temp_aux, sym->n_type, sym->n_sclass,
- (char *)aux);
- /* If more than one aux entry, read past it (only the first aux
- is important). */
- for (i = 1; i < cs->c_naux; i++)
- fread (temp_aux, local_auxesz, 1, nlist_stream_global);
- }
- cs->c_name = getsymname (sym);
- cs->c_value = sym->n_value;
- cs->c_sclass = (sym->n_sclass & 0xff);
- cs->c_secnum = sym->n_scnum;
- cs->c_type = (unsigned) sym->n_type;
- if (!SDB_TYPE (cs->c_type))
- cs->c_type = 0;
-
- symnum += 1 + cs->c_naux;
-}
-
-/* Support for string table handling */
-
-static char *stringtab = NULL;
-
-static int
-init_stringtab (chan, offset)
- int chan;
- long offset;
-{
- long length;
- int val;
- unsigned char lengthbuf[4];
-
- if (stringtab)
- {
- free (stringtab);
- stringtab = NULL;
- }
-
- if (lseek (chan, offset, 0) < 0)
- return -1;
-
- val = myread (chan, (char *)lengthbuf, sizeof lengthbuf);
- length = bfd_h_get_32 (symfile_bfd, lengthbuf);
-
- /* If no string table is needed, then the file may end immediately
- after the symbols. Just return with `stringtab' set to null. */
- if (val != sizeof length || length < sizeof length)
- return 0;
-
- stringtab = (char *) xmalloc (length);
- if (stringtab == NULL)
- return -1;
-
- bcopy (&length, stringtab, sizeof length);
- if (length == sizeof length) /* Empty table -- just the count */
- return 0;
-
- val = myread (chan, stringtab + sizeof length, length - sizeof length);
- if (val != length - sizeof length || stringtab[length - 1] != '\0')
- return -1;
-
- return 0;
-}
-
-static void
-free_stringtab ()
-{
- if (stringtab)
- free (stringtab);
- stringtab = NULL;
-}
-
-static char *
-getsymname (symbol_entry)
- struct internal_syment *symbol_entry;
-{
- static char buffer[SYMNMLEN+1];
- char *result;
-
- if (symbol_entry->_n._n_n._n_zeroes == 0)
- {
- result = stringtab + symbol_entry->_n._n_n._n_offset;
- }
- else
- {
- strncpy (buffer, symbol_entry->_n._n_name, SYMNMLEN);
- buffer[SYMNMLEN] = '\0';
- result = buffer;
- }
- return result;
-}
-
-static char *
-getfilename (aux_entry)
- union internal_auxent *aux_entry;
-{
- static char buffer[BUFSIZ];
- register char *temp;
- char *result;
- extern char *rindex ();
-
-#ifndef COFF_NO_LONG_FILE_NAMES
-#if defined (x_zeroes)
- /* Data General. */
- if (aux_entry->x_zeroes == 0)
- strcpy (buffer, stringtab + aux_entry->x_offset);
-#else /* no x_zeroes */
- if (aux_entry->x_file.x_n.x_zeroes == 0)
- strcpy (buffer, stringtab + aux_entry->x_file.x_n.x_offset);
-#endif /* no x_zeroes */
- else
-#endif /* COFF_NO_LONG_FILE_NAMES */
- {
-#if defined (x_name)
- /* Data General. */
- strncpy (buffer, aux_entry->x_name, FILNMLEN);
-#else
- strncpy (buffer, aux_entry->x_file.x_fname, FILNMLEN);
-#endif
- buffer[FILNMLEN] = '\0';
- }
- result = buffer;
- if ((temp = rindex (result, '/')) != NULL)
- result = temp + 1;
- return (result);
-}
-
-/* Support for line number handling */
-static char *linetab = NULL;
-static long linetab_offset;
-static unsigned long linetab_size;
-
-/* Read in all the line numbers for fast lookups later. Leave them in
- external (unswapped) format in memory; we'll swap them as we enter
- them into GDB's data structures. */
-
-static int
-init_lineno (chan, offset, size)
- int chan;
- long offset;
- int size;
-{
- int val;
-
- linetab_offset = offset;
- linetab_size = size;
-
- if (size == 0)
- return 0;
-
- if (lseek (chan, offset, 0) < 0)
- return -1;
-
- /* Allocate the desired table, plus a sentinel */
- linetab = (char *) xmalloc (size + local_linesz);
-
- val = myread (chan, linetab, size);
- if (val != size)
- return -1;
-
- /* Terminate it with an all-zero sentinel record */
- bzero (linetab + size, local_linesz);
-
- make_cleanup (free, linetab); /* Be sure it gets de-allocated. */
- return 0;
-}
-
-#if !defined (L_LNNO32)
-#define L_LNNO32(lp) ((lp)->l_lnno)
-#endif
-
-static void
-enter_linenos (file_offset, first_line, last_line)
- long file_offset;
- register int first_line;
- register int last_line;
-{
- register char *rawptr;
- struct internal_lineno lptr;
-
- if (file_offset < linetab_offset)
- {
- complain (&lineno_complaint, file_offset);
- if (file_offset > linetab_size) /* Too big to be an offset? */
- return;
- file_offset += linetab_offset; /* Try reading at that linetab offset */
- }
-
- rawptr = &linetab[file_offset - linetab_offset];
-
- /* skip first line entry for each function */
- rawptr += local_linesz;
- /* line numbers start at one for the first line of the function */
- first_line--;
-
- for (;;) {
- bfd_coff_swap_lineno_in (symfile_bfd, rawptr, &lptr);
- rawptr += local_linesz;
- /* The next function, or the sentinel, will have L_LNNO32 zero; we exit. */
- if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
- record_line (first_line + L_LNNO32 (&lptr), lptr.l_addr.l_paddr);
- else
- break;
- }
-}
-
-static int
-hashname (name)
- char *name;
-{
- register char *p = name;
- register int total = p[0];
- register int c;
-
- c = p[1];
- total += c << 2;
- if (c)
- {
- c = p[2];
- total += c << 4;
- if (c)
- total += p[3] << 6;
- }
-
- return total % HASHSIZE;
-}
-
-static void
-patch_type (type, real_type)
- struct type *type;
- struct type *real_type;
-{
- register struct type *target = TYPE_TARGET_TYPE (type);
- register struct type *real_target = TYPE_TARGET_TYPE (real_type);
- int field_size = TYPE_NFIELDS (real_target) * sizeof (struct field);
-
- TYPE_LENGTH (target) = TYPE_LENGTH (real_target);
- TYPE_NFIELDS (target) = TYPE_NFIELDS (real_target);
- TYPE_FIELDS (target) = (struct field *)
- obstack_alloc (symbol_obstack, field_size);
-
- bcopy (TYPE_FIELDS (real_target), TYPE_FIELDS (target), field_size);
-
- if (TYPE_NAME (real_target))
- {
- if (TYPE_NAME (target))
- free (TYPE_NAME (target));
- TYPE_NAME (target) = concat (TYPE_NAME (real_target), NULL);
- }
-}
-
-/* Patch up all appropriate typdef symbols in the opaque_type_chains
- so that they can be used to print out opaque data structures properly */
-
-static void
-patch_opaque_types ()
-{
- struct symtab *s;
-
- /* Look at each symbol in the per-file block of each symtab. */
- for (s = symtab_list; s; s = s->next)
- {
- register struct block *b;
- register int i;
-
- /* Go through the per-file symbols only */
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
- for (i = BLOCK_NSYMS (b) - 1; i >= 0; i--)
- {
- register struct symbol *real_sym;
-
- /* Find completed typedefs to use to fix opaque ones.
- Remove syms from the chain when their types are stored,
- but search the whole chain, as there may be several syms
- from different files with the same name. */
- real_sym = BLOCK_SYM (b, i);
- if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF &&
- SYMBOL_NAMESPACE (real_sym) == VAR_NAMESPACE &&
- TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR &&
- TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
- {
- register char *name = SYMBOL_NAME (real_sym);
- register int hash = hashname (name);
- register struct symbol *sym, *prev;
-
- prev = 0;
- for (sym = opaque_type_chain[hash]; sym;)
- {
- if (name[0] == SYMBOL_NAME (sym)[0] &&
- !strcmp (name + 1, SYMBOL_NAME (sym) + 1))
- {
- if (prev)
- SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
- else
- opaque_type_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
-
- patch_type (SYMBOL_TYPE (sym), SYMBOL_TYPE (real_sym));
-
- if (prev)
- sym = SYMBOL_VALUE_CHAIN (prev);
- else
- sym = opaque_type_chain[hash];
- }
- else
- {
- prev = sym;
- sym = SYMBOL_VALUE_CHAIN (sym);
- }
- }
- }
- }
- }
-}
-
-#if defined (clipper)
-#define BELIEVE_PCC_PROMOTION 1
-#endif
-
-static struct symbol *
-process_coff_symbol (cs, aux)
- register struct coff_symbol *cs;
- register union internal_auxent *aux;
-{
- register struct symbol *sym
- = (struct symbol *) obstack_alloc (symbol_obstack, sizeof (struct symbol));
- char *name;
-#ifdef NAMES_HAVE_UNDERSCORE
- int offset = 1;
-#else
- int offset = 0;
-#endif
-
- bzero (sym, sizeof (struct symbol));
- name = cs->c_name;
- name = (name[0] == '_' ? name + offset : name);
- SYMBOL_NAME (sym) = obstack_copy0 (symbol_obstack, name, strlen (name));
-
- /* default assumptions */
- SYMBOL_VALUE (sym) = cs->c_value;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
-
- if (ISFCN (cs->c_type))
- {
-#if 0
- /* FIXME: This has NOT been tested. The DBX version has.. */
- /* Generate a template for the type of this function. The
- types of the arguments will be added as we read the symbol
- table. */
- struct type *new = (struct type *)
- obstack_alloc (symbol_obstack, sizeof (struct type));
-
- bcopy(lookup_function_type (decode_function_type (cs, cs->c_type, aux)),
- new, sizeof(struct type));
- SYMBOL_TYPE (sym) = new;
- in_function_type = SYMBOL_TYPE(sym);
-#else
- SYMBOL_TYPE(sym) =
- lookup_function_type (decode_function_type (cs, cs->c_type, aux));
-#endif
-
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- if (cs->c_sclass == C_STAT)
- add_symbol_to_list (sym, &file_symbols);
- else if (cs->c_sclass == C_EXT)
- add_symbol_to_list (sym, &global_symbols);
- }
- else
- {
- SYMBOL_TYPE (sym) = decode_type (cs, cs->c_type, aux);
- switch (cs->c_sclass)
- {
- case C_NULL:
- break;
-
- case C_AUTO:
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case C_EXT:
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
- add_symbol_to_list (sym, &global_symbols);
- break;
-
- case C_STAT:
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
- if (within_function) {
- /* Static symbol of local scope */
- add_symbol_to_list (sym, &local_symbols);
- }
- else {
- /* Static symbol at top level of file */
- add_symbol_to_list (sym, &file_symbols);
- }
- break;
-
-#ifdef C_GLBLREG /* AMD coff */
- case C_GLBLREG:
-#endif
- case C_REG:
- SYMBOL_CLASS (sym) = LOC_REGISTER;
- SYMBOL_VALUE (sym) = SDB_REG_TO_REGNUM(cs->c_value);
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case C_LABEL:
- break;
-
- case C_ARG:
- SYMBOL_CLASS (sym) = LOC_ARG;
-#if 0
- /* FIXME: This has not bee tested. */
- /* Add parameter to function. */
- add_param_to_type(&in_function_type,sym);
-#endif
- add_symbol_to_list (sym, &local_symbols);
-#if !defined (BELIEVE_PCC_PROMOTION)
- /* If PCC says a parameter is a short or a char,
- it is really an int. */
- if (SYMBOL_TYPE (sym) == builtin_type_char
- || SYMBOL_TYPE (sym) == builtin_type_short)
- SYMBOL_TYPE (sym) = builtin_type_int;
- else if (SYMBOL_TYPE (sym) == builtin_type_unsigned_char
- || SYMBOL_TYPE (sym) == builtin_type_unsigned_short)
- SYMBOL_TYPE (sym) = builtin_type_unsigned_int;
-#endif
- break;
-
- case C_REGPARM:
- SYMBOL_CLASS (sym) = LOC_REGPARM;
- SYMBOL_VALUE (sym) = SDB_REG_TO_REGNUM(cs->c_value);
- add_symbol_to_list (sym, &local_symbols);
-#if !defined (BELIEVE_PCC_PROMOTION)
- /* If PCC says a parameter is a short or a char,
- it is really an int. */
- if (SYMBOL_TYPE (sym) == builtin_type_char
- || SYMBOL_TYPE (sym) == builtin_type_short)
- SYMBOL_TYPE (sym) = builtin_type_int;
- else if (SYMBOL_TYPE (sym) == builtin_type_unsigned_char
- || SYMBOL_TYPE (sym) == builtin_type_unsigned_short)
- SYMBOL_TYPE (sym) = builtin_type_unsigned_int;
-#endif
- break;
-
- case C_TPDEF:
- SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
-
- /* If type has no name, give it one */
- if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0
- && (TYPE_FLAGS (SYMBOL_TYPE (sym)) & TYPE_FLAG_PERM) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym))
- = concat (SYMBOL_NAME (sym), NULL);
-
- /* Keep track of any type which points to empty structured type,
- so it can be filled from a definition from another file */
- if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR &&
- TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) == 0)
- {
- register int i = hashname (SYMBOL_NAME (sym));
-
- SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
- opaque_type_chain[i] = sym;
- }
- add_symbol_to_list (sym, &file_symbols);
- break;
-
- case C_STRTAG:
- case C_UNTAG:
- case C_ENTAG:
- SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
- if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0
- && (TYPE_FLAGS (SYMBOL_TYPE (sym)) & TYPE_FLAG_PERM) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym))
- = concat ("",
- (cs->c_sclass == C_ENTAG
- ? "enum "
- : (cs->c_sclass == C_STRTAG
- ? "struct " : "union ")),
- SYMBOL_NAME (sym), NULL);
- add_symbol_to_list (sym, &file_symbols);
- break;
-
- default:
- break;
- }
- }
- return sym;
-}
-
-/* Decode a coff type specifier;
- return the type that is meant. */
-
-static
-struct type *
-decode_type (cs, c_type, aux)
- register struct coff_symbol *cs;
- unsigned int c_type;
- register union internal_auxent *aux;
-{
- register struct type *type = 0;
- unsigned int new_c_type;
-
- if (c_type & ~N_BTMASK)
- {
- new_c_type = DECREF (c_type);
- if (ISPTR (c_type))
- {
- type = decode_type (cs, new_c_type, aux);
- type = lookup_pointer_type (type);
- }
- else if (ISFCN (c_type))
- {
- type = decode_type (cs, new_c_type, aux);
- type = lookup_function_type (type);
- }
- else if (ISARY (c_type))
- {
- int i, n;
- register unsigned short *dim;
- struct type *base_type;
-
- /* Define an array type. */
- /* auxent refers to array, not base type */
- if (aux->x_sym.x_tagndx.l == 0)
- cs->c_naux = 0;
-
- /* shift the indices down */
- dim = &aux->x_sym.x_fcnary.x_ary.x_dimen[0];
- i = 1;
- n = dim[0];
- for (i = 0; *dim && i < DIMNUM - 1; i++, dim++)
- *dim = *(dim + 1);
- *dim = 0;
-
- type = (struct type *)
- obstack_alloc (symbol_obstack, sizeof (struct type));
- bzero (type, sizeof (struct type));
-
- base_type = decode_type (cs, new_c_type, aux);
-
- TYPE_CODE (type) = TYPE_CODE_ARRAY;
- TYPE_TARGET_TYPE (type) = base_type;
- TYPE_LENGTH (type) = n * TYPE_LENGTH (base_type);
- }
- return type;
- }
-
- /* Reference to existing type */
- if (cs->c_naux > 0 && aux->x_sym.x_tagndx.l != 0)
- {
- type = coff_alloc_type (aux->x_sym.x_tagndx.l);
- return type;
- }
-
- return decode_base_type (cs, BTYPE (c_type), aux);
-}
-
-/* Decode a coff type specifier for function definition;
- return the type that the function returns. */
-
-static
-struct type *
-decode_function_type (cs, c_type, aux)
- register struct coff_symbol *cs;
- unsigned int c_type;
- register union internal_auxent *aux;
-{
- if (aux->x_sym.x_tagndx.l == 0)
- cs->c_naux = 0; /* auxent refers to function, not base type */
-
- return decode_type (cs, DECREF (c_type), aux);
-}
-
-/* basic C types */
-
-static
-struct type *
-decode_base_type (cs, c_type, aux)
- register struct coff_symbol *cs;
- unsigned int c_type;
- register union internal_auxent *aux;
-{
- struct type *type;
-
- switch (c_type)
- {
- case T_NULL:
- /* shows up with "void (*foo)();" structure members */
- return builtin_type_void;
-
-#if 0
-/* DGUX actually defines both T_ARG and T_VOID to the same value. */
-#ifdef T_ARG
- case T_ARG:
- /* Shows up in DGUX, I think. Not sure where. */
- return builtin_type_void; /* shouldn't show up here */
-#endif
-#endif /* 0 */
-
-#ifdef T_VOID
- case T_VOID:
- /* Intel 960 COFF has this symbol and meaning. */
- return builtin_type_void;
-#endif
-
- case T_CHAR:
- return builtin_type_char;
-
- case T_SHORT:
- return builtin_type_short;
-
- case T_INT:
- return builtin_type_int;
-
- case T_LONG:
- return builtin_type_long;
-
- case T_FLOAT:
- return builtin_type_float;
-
- case T_DOUBLE:
- return builtin_type_double;
-
- case T_STRUCT:
- if (cs->c_naux != 1)
- {
- /* anonymous structure type */
- type = coff_alloc_type (cs->c_symnum);
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
- TYPE_NAME (type) = concat ("struct ", "<opaque>", NULL);
- TYPE_CPLUS_SPECIFIC (type)
- = (struct cplus_struct_type *) obstack_alloc (symbol_obstack, sizeof (struct cplus_struct_type));
- bzero (TYPE_CPLUS_SPECIFIC (type), sizeof (struct cplus_struct_type));
- TYPE_LENGTH (type) = 0;
- TYPE_FIELDS (type) = 0;
- TYPE_NFIELDS (type) = 0;
- }
- else
- {
- type = read_struct_type (cs->c_symnum,
- aux->x_sym.x_misc.x_lnsz.x_size,
- aux->x_sym.x_fcnary.x_fcn.x_endndx);
- }
- return type;
-
- case T_UNION:
- if (cs->c_naux != 1)
- {
- /* anonymous union type */
- type = coff_alloc_type (cs->c_symnum);
- TYPE_NAME (type) = concat ("union ", "<opaque>", NULL);
- TYPE_LENGTH (type) = 0;
- TYPE_FIELDS (type) = 0;
- TYPE_NFIELDS (type) = 0;
- }
- else
- {
- type = read_struct_type (cs->c_symnum,
- aux->x_sym.x_misc.x_lnsz.x_size,
- aux->x_sym.x_fcnary.x_fcn.x_endndx);
- }
- TYPE_CODE (type) = TYPE_CODE_UNION;
- return type;
-
- case T_ENUM:
- return read_enum_type (cs->c_symnum,
- aux->x_sym.x_misc.x_lnsz.x_size,
- aux->x_sym.x_fcnary.x_fcn.x_endndx);
-
- case T_MOE:
- /* shouldn't show up here */
- break;
-
- case T_UCHAR:
- return builtin_type_unsigned_char;
-
- case T_USHORT:
- return builtin_type_unsigned_short;
-
- case T_UINT:
- return builtin_type_unsigned_int;
-
- case T_ULONG:
- return builtin_type_unsigned_long;
- }
- printf ("unexpected type %d at symnum %d\n", c_type, cs->c_symnum);
- return builtin_type_void;
-}
-
-/* This page contains subroutines of read_type. */
-
-/* Read the description of a structure (or union type)
- and return an object describing the type. */
-
-static struct type *
-read_struct_type (index, length, lastsym)
- int index;
- int length;
- int lastsym;
-{
- struct nextfield
- {
- struct nextfield *next;
- struct field field;
- };
-
- register struct type *type;
- register struct nextfield *list = 0;
- struct nextfield *new;
- int nfields = 0;
- register int n;
- char *name;
-#ifdef NAMES_HAVE_UNDERSCORE
- int offset = 1;
-#else
- int offset = 0;
-#endif
- struct coff_symbol member_sym;
- register struct coff_symbol *ms = &member_sym;
- struct internal_syment sub_sym;
- union internal_auxent sub_aux;
- int done = 0;
-
- type = coff_alloc_type (index);
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
- TYPE_CPLUS_SPECIFIC (type)
- = (struct cplus_struct_type *) obstack_alloc (symbol_obstack, sizeof (struct cplus_struct_type));
- bzero (TYPE_CPLUS_SPECIFIC (type), sizeof (struct cplus_struct_type));
- TYPE_LENGTH (type) = length;
-
- while (!done && symnum < lastsym && symnum < nlist_nsyms_global)
- {
- read_one_sym (ms, &sub_sym, &sub_aux);
- name = ms->c_name;
- name = (name[0] == '_' ? name + offset : name);
-
- switch (ms->c_sclass)
- {
- case C_MOS:
- case C_MOU:
-
- /* Get space to record the next field's data. */
- new = (struct nextfield *) alloca (sizeof (struct nextfield));
- new->next = list;
- list = new;
-
- /* Save the data. */
- list->field.name = savestring (name, strlen (name));
- list->field.type = decode_type (ms, ms->c_type, &sub_aux);
- list->field.bitpos = 8 * ms->c_value;
- list->field.bitsize = 0;
- nfields++;
- break;
-
- case C_FIELD:
-
- /* Get space to record the next field's data. */
- new = (struct nextfield *) alloca (sizeof (struct nextfield));
- new->next = list;
- list = new;
-
- /* Save the data. */
- list->field.name = savestring (name, strlen (name));
- list->field.type = decode_type (ms, ms->c_type, &sub_aux);
- list->field.bitpos = ms->c_value;
- list->field.bitsize = sub_aux.x_sym.x_misc.x_lnsz.x_size;
- nfields++;
- break;
-
- case C_EOS:
- done = 1;
- break;
- }
- }
- /* Now create the vector of fields, and record how big it is. */
-
- TYPE_NFIELDS (type) = nfields;
- TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (symbol_obstack, sizeof (struct field) * nfields);
-
- /* Copy the saved-up fields into the field vector. */
-
- for (n = nfields; list; list = list->next)
- TYPE_FIELD (type, --n) = list->field;
-
- return type;
-}
-
-/* Read a definition of an enumeration type,
- and create and return a suitable type object.
- Also defines the symbols that represent the values of the type. */
-/* Currently assumes it's sizeof (int) and doesn't use length. */
-
-/* ARGSUSED */
-static struct type *
-read_enum_type (index, length, lastsym)
- int index;
- int length;
- int lastsym;
-{
- register struct symbol *sym;
- register struct type *type;
- int nsyms = 0;
- int done = 0;
- struct pending **symlist;
- struct coff_symbol member_sym;
- register struct coff_symbol *ms = &member_sym;
- struct internal_syment sub_sym;
- union internal_auxent sub_aux;
- struct pending *osyms, *syms;
- register int n;
- char *name;
-#ifdef NAMES_HAVE_UNDERSCORE
- int offset = 1;
-#else
- int offset = 0;
-#endif
-
- type = coff_alloc_type (index);
- if (within_function)
- symlist = &local_symbols;
- else
- symlist = &file_symbols;
- osyms = *symlist;
-
- while (!done && symnum < lastsym && symnum < nlist_nsyms_global)
- {
- read_one_sym (ms, &sub_sym, &sub_aux);
- name = ms->c_name;
- name = (name[0] == '_' ? name + offset : name);
-
- switch (ms->c_sclass)
- {
- case C_MOE:
- sym = (struct symbol *) xmalloc (sizeof (struct symbol));
- bzero (sym, sizeof (struct symbol));
-
- SYMBOL_NAME (sym) = savestring (name, strlen (name));
- SYMBOL_CLASS (sym) = LOC_CONST;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- SYMBOL_VALUE (sym) = ms->c_value;
- add_symbol_to_list (sym, symlist);
- nsyms++;
- break;
-
- case C_EOS:
- /* Sometimes the linker (on 386/ix 2.0.2 at least) screws
- up the count of how many symbols to read. So stop
- on .eos. */
- done = 1;
- break;
- }
- }
-
- /* Now fill in the fields of the type-structure. */
-
- /* FIXME: Should be sizeof (int) on target, not host. */
- TYPE_LENGTH (type) = sizeof (int);
- TYPE_CODE (type) = TYPE_CODE_ENUM;
- TYPE_NFIELDS (type) = nsyms;
- TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (symbol_obstack, sizeof (struct field) * nsyms);
-
- /* Find the symbols for the values and put them into the type.
- The symbols can be found in the symlist that we put them on
- to cause them to be defined. osyms contains the old value
- of that symlist; everything up to there was defined by us. */
-
- for (syms = *symlist, n = nsyms; syms != osyms; syms = syms->next)
- {
- SYMBOL_TYPE (syms->symbol) = type;
- TYPE_FIELD_NAME (type, --n) = SYMBOL_NAME (syms->symbol);
- TYPE_FIELD_VALUE (type, n) = 0;
- TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (syms->symbol);
- TYPE_FIELD_BITSIZE (type, n) = 0;
- }
- /* Is this Modula-2's BOOLEAN type? Flag it as such if so. */
- if(TYPE_NFIELDS(type) == 2 &&
- ((!strcmp(TYPE_FIELD_NAME(type,0),"TRUE") &&
- !strcmp(TYPE_FIELD_NAME(type,1),"FALSE")) ||
- (!strcmp(TYPE_FIELD_NAME(type,1),"TRUE") &&
- !strcmp(TYPE_FIELD_NAME(type,0),"FALSE"))))
- TYPE_CODE(type) = TYPE_CODE_BOOL;
- return type;
-}
-
-/* Register our ability to parse symbols for coff BFD files */
-
-static struct sym_fns coff_sym_fns =
-{
- "coff", 4,
- coff_new_init, coff_symfile_init, coff_symfile_read,
-};
-
-void
-_initialize_coffread ()
-{
- add_symtab_fns(&coff_sym_fns);
-}
diff --git a/gdb/command.c b/gdb/command.c
deleted file mode 100644
index d883940..0000000
--- a/gdb/command.c
+++ /dev/null
@@ -1,1213 +0,0 @@
-/* Library for reading command lines and decoding commands.
- Copyright (C) 1986, 1989, 1990 Free Software Foundation, Inc.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "command.h"
-#include "symtab.h"
-#include "value.h"
-#include <ctype.h>
-#include <string.h>
-
-extern char *getenv ();
-
-/* Add element named NAME to command list *LIST.
- FUN should be the function to execute the command;
- it will get a character string as argument, with leading
- and trailing blanks already eliminated.
-
- DOC is a documentation string for the command.
- Its first line should be a complete sentence.
- It should start with ? for a command that is an abbreviation
- or with * for a command that most users don't need to know about. */
-
-struct cmd_list_element *
-add_cmd (name, class, fun, doc, list)
- char *name;
- enum command_class class;
- void (*fun) ();
- char *doc;
- struct cmd_list_element **list;
-{
- register struct cmd_list_element *c
- = (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
-
- delete_cmd (name, list);
- c->next = *list;
- c->name = name;
- c->class = class;
- c->function = fun;
- c->doc = doc;
- c->prefixlist = 0;
- c->prefixname = (char *)NULL;
- c->allow_unknown = 0;
- c->abbrev_flag = 0;
- c->aux = 0;
- c->type = not_set_cmd;
- c->completer = make_symbol_completion_list;
- c->var = 0;
- c->var_type = var_boolean;
- c->user_commands = 0;
- *list = c;
- return c;
-}
-
-/* Same as above, except that the abbrev_flag is set. */
-
-struct cmd_list_element *
-add_abbrev_cmd (name, class, fun, doc, list)
- char *name;
- enum command_class class;
- void (*fun) ();
- char *doc;
- struct cmd_list_element **list;
-{
- register struct cmd_list_element *c
- = add_cmd (name, class, fun, doc, list);
-
- c->abbrev_flag = 1;
- return c;
-}
-
-struct cmd_list_element *
-add_alias_cmd (name, oldname, class, abbrev_flag, list)
- char *name;
- char *oldname;
- enum command_class class;
- int abbrev_flag;
- struct cmd_list_element **list;
-{
- /* Must do this since lookup_cmd tries to side-effect its first arg */
- char *copied_name;
- register struct cmd_list_element *old;
- register struct cmd_list_element *c;
- copied_name = (char *) alloca (strlen (oldname) + 1);
- strcpy (copied_name, oldname);
- old = lookup_cmd (&copied_name, *list, "", 1, 1);
-
- if (old == 0)
- {
- delete_cmd (name, list);
- return 0;
- }
-
- c = add_cmd (name, class, old->function, old->doc, list);
- c->prefixlist = old->prefixlist;
- c->prefixname = old->prefixname;
- c->allow_unknown = old->allow_unknown;
- c->abbrev_flag = abbrev_flag;
- c->aux = old->aux;
- return c;
-}
-
-/* Like add_cmd but adds an element for a command prefix:
- a name that should be followed by a subcommand to be looked up
- in another command list. PREFIXLIST should be the address
- of the variable containing that list. */
-
-struct cmd_list_element *
-add_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
- allow_unknown, list)
- char *name;
- enum command_class class;
- void (*fun) ();
- char *doc;
- struct cmd_list_element **prefixlist;
- char *prefixname;
- int allow_unknown;
- struct cmd_list_element **list;
-{
- register struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
- c->prefixlist = prefixlist;
- c->prefixname = prefixname;
- c->allow_unknown = allow_unknown;
- return c;
-}
-
-/* Like add_prefix_cmd butsets the abbrev_flag on the new command. */
-
-struct cmd_list_element *
-add_abbrev_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
- allow_unknown, list)
- char *name;
- enum command_class class;
- void (*fun) ();
- char *doc;
- struct cmd_list_element **prefixlist;
- char *prefixname;
- int allow_unknown;
- struct cmd_list_element **list;
-{
- register struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
- c->prefixlist = prefixlist;
- c->prefixname = prefixname;
- c->allow_unknown = allow_unknown;
- c->abbrev_flag = 1;
- return c;
-}
-
-/* ARGSUSED */
-void
-not_just_help_class_command (args, from_tty, c)
- char *args;
- int from_tty;
- struct cmd_list_element *c;
-{
-}
-
-/* Add element named NAME to command list LIST (the list for set
- or some sublist thereof).
- CLASS is as in add_cmd.
- VAR_TYPE is the kind of thing we are setting.
- VAR is address of the variable being controlled by this command.
- DOC is the documentation string. */
-struct cmd_list_element *
-add_set_cmd (name, class, var_type, var, doc, list)
- char *name;
- enum command_class class;
- var_types var_type;
- char *var;
- char *doc;
- struct cmd_list_element **list;
-{
- /* For set/show, we have to call do_setshow_command
- differently than an ordinary function (take commandlist as
- well as arg), so the function field isn't helpful. However,
- function == NULL means that it's a help class, so set the function
- to not_just_help_class_command. */
- struct cmd_list_element *c
- = add_cmd (name, class, not_just_help_class_command, doc, list);
-
- c->type = set_cmd;
- c->var_type = var_type;
- c->var = var;
- return c;
-}
-
-/* Where SETCMD has already been added, add the corresponding show
- command to LIST and return a pointer to it. */
-struct cmd_list_element *
-add_show_from_set (setcmd, list)
- struct cmd_list_element *setcmd;
- struct cmd_list_element **list;
-{
- struct cmd_list_element *showcmd =
- (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
-
- bcopy (setcmd, showcmd, sizeof (struct cmd_list_element));
- delete_cmd (showcmd->name, list);
- showcmd->type = show_cmd;
-
- /* Replace "set " at start of docstring with "show ". */
- if (setcmd->doc[0] == 'S' && setcmd->doc[1] == 'e'
- && setcmd->doc[2] == 't' && setcmd->doc[3] == ' ')
- showcmd->doc = concat ("Show ", setcmd->doc + 4, NULL);
- else
- fprintf (stderr, "GDB internal error: Bad docstring for set command\n");
-
- showcmd->next = *list;
- *list = showcmd;
- return showcmd;
-}
-
-/* Remove the command named NAME from the command list. */
-
-void
-delete_cmd (name, list)
- char *name;
- struct cmd_list_element **list;
-{
- register struct cmd_list_element *c;
- struct cmd_list_element *p;
-
- while (*list && !strcmp ((*list)->name, name))
- {
- p = (*list)->next;
- free (*list);
- *list = p;
- }
-
- if (*list)
- for (c = *list; c->next;)
- {
- if (!strcmp (c->next->name, name))
- {
- p = c->next->next;
- free (c->next);
- c->next = p;
- }
- else
- c = c->next;
- }
-}
-
-/* This command really has to deal with two things:
- * 1) I want documentation on *this string* (usually called by
- * "help commandname").
- * 2) I want documentation on *this list* (usually called by
- * giving a command that requires subcommands. Also called by saying
- * just "help".)
- *
- * I am going to split this into two seperate comamnds, help_cmd and
- * help_list.
- */
-
-void
-help_cmd (command, stream)
- char *command;
- FILE *stream;
-{
- struct cmd_list_element *c;
- extern struct cmd_list_element *cmdlist;
-
- if (!command)
- {
- help_list (cmdlist, "", all_classes, stream);
- return;
- }
-
- c = lookup_cmd (&command, cmdlist, "", 0, 0);
-
- if (c == 0)
- return;
-
- /* There are three cases here.
- If c->prefixlist is nonzero, we have a prefix command.
- Print its documentation, then list its subcommands.
-
- If c->function is nonzero, we really have a command.
- Print its documentation and return.
-
- If c->function is zero, we have a class name.
- Print its documentation (as if it were a command)
- and then set class to the number of this class
- so that the commands in the class will be listed. */
-
- fputs_filtered (c->doc, stream);
- fputs_filtered ("\n", stream);
-
- if (c->prefixlist == 0 && c->function != 0)
- return;
- fprintf_filtered (stream, "\n");
-
- /* If this is a prefix command, print it's subcommands */
- if (c->prefixlist)
- help_list (*c->prefixlist, c->prefixname, all_commands, stream);
-
- /* If this is a class name, print all of the commands in the class */
- if (c->function == 0)
- help_list (cmdlist, "", c->class, stream);
-}
-
-/*
- * Get a specific kind of help on a command list.
- *
- * LIST is the list.
- * CMDTYPE is the prefix to use in the title string.
- * CLASS is the class with which to list the nodes of this list (see
- * documentation for help_cmd_list below), As usual, ALL_COMMANDS for
- * everything, ALL_CLASSES for just classes, and non-negative for only things
- * in a specific class.
- * and STREAM is the output stream on which to print things.
- * If you call this routine with a class >= 0, it recurses.
- */
-void
-help_list (list, cmdtype, class, stream)
- struct cmd_list_element *list;
- char *cmdtype;
- enum command_class class;
- FILE *stream;
-{
- int len;
- char *cmdtype1, *cmdtype2;
-
- /* If CMDTYPE is "foo ", CMDTYPE1 gets " foo" and CMDTYPE2 gets "foo sub" */
- len = strlen (cmdtype);
- cmdtype1 = (char *) alloca (len + 1);
- cmdtype1[0] = 0;
- cmdtype2 = (char *) alloca (len + 4);
- cmdtype2[0] = 0;
- if (len)
- {
- cmdtype1[0] = ' ';
- strncpy (cmdtype1 + 1, cmdtype, len - 1);
- cmdtype1[len] = 0;
- strncpy (cmdtype2, cmdtype, len - 1);
- strcpy (cmdtype2 + len - 1, " sub");
- }
-
- if (class == all_classes)
- fprintf_filtered (stream, "List of classes of %scommands:\n\n", cmdtype2);
- else
- fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2);
-
- help_cmd_list (list, class, cmdtype, (int)class >= 0, stream);
-
- if (class == all_classes)
- fprintf_filtered (stream, "\n\
-Type \"help%s\" followed by a class name for a list of commands in that class.",
- cmdtype1);
-
- fprintf_filtered (stream, "\n\
-Type \"help%s\" followed by %scommand name for full documentation.\n\
-Command name abbreviations are allowed if unambiguous.\n",
- cmdtype1, cmdtype2);
-}
-
-/* Print only the first line of STR on STREAM. */
-static void
-print_doc_line (stream, str)
- FILE *stream;
- char *str;
-{
- static char *line_buffer = 0;
- static int line_size;
- register char *p;
-
- if (!line_buffer)
- {
- line_size = 80;
- line_buffer = (char *) xmalloc (line_size);
- }
-
- p = str;
- while (*p && *p != '\n' && *p != '.' && *p != ',')
- p++;
- if (p - str > line_size - 1)
- {
- line_size = p - str + 1;
- free (line_buffer);
- line_buffer = (char *) xmalloc (line_size);
- }
- strncpy (line_buffer, str, p - str);
- line_buffer[p - str] = '\0';
- if (islower (line_buffer[0]))
- line_buffer[0] = toupper (line_buffer[0]);
- fputs_filtered (line_buffer, stream);
-}
-
-/*
- * Implement a help command on command list LIST.
- * RECURSE should be non-zero if this should be done recursively on
- * all sublists of LIST.
- * PREFIX is the prefix to print before each command name.
- * STREAM is the stream upon which the output should be written.
- * CLASS should be:
- * A non-negative class number to list only commands in that
- * class.
- * ALL_COMMANDS to list all commands in list.
- * ALL_CLASSES to list all classes in list.
- *
- * Note that RECURSE will be active on *all* sublists, not just the
- * ones seclected by the criteria above (ie. the selection mechanism
- * is at the low level, not the high-level).
- */
-void
-help_cmd_list (list, class, prefix, recurse, stream)
- struct cmd_list_element *list;
- enum command_class class;
- char *prefix;
- int recurse;
- FILE *stream;
-{
- register struct cmd_list_element *c;
-
- for (c = list; c; c = c->next)
- {
- if (c->abbrev_flag == 0 &&
- (class == all_commands
- || (class == all_classes && c->function == 0)
- || (class == c->class && c->function != 0)))
- {
- fprintf_filtered (stream, "%s%s -- ", prefix, c->name);
- print_doc_line (stream, c->doc);
- fputs_filtered ("\n", stream);
- }
- if (recurse
- && c->prefixlist != 0
- && c->abbrev_flag == 0)
- help_cmd_list (*c->prefixlist, class, c->prefixname, 1, stream);
- }
-}
-
-/* This routine takes a line of TEXT and a CLIST in which to
- start the lookup. When it returns it will have incremented the text
- pointer past the section of text it matched, set *RESULT_LIST to
- the list in which the last word was matched, and will return the
- cmd list element which the text matches. It will return 0 if no
- match at all was possible. It will return -1 if ambigous matches are
- possible; in this case *RESULT_LIST will be set to the list in which
- there are ambiguous choices (and text will be set to the ambiguous
- text string).
-
- It does no error reporting whatsoever; control will always return
- to the superior routine.
-
- In the case of an ambiguous return (-1), *RESULT_LIST will be set to
- point at the prefix_command (ie. the best match) *or* (special
- case) will be 0 if no prefix command was ever found. For example,
- in the case of "info a", "info" matches without ambiguity, but "a"
- could be "args" or "address", so *RESULT_LIST is set to
- the cmd_list_element for "info". So in this case
- result list should not be interpeted as a pointer to the beginning
- of a list; it simply points to a specific command.
-
- If RESULT_LIST is NULL, don't set *RESULT_LIST (but don't otherwise
- affect the operation).
-
- This routine does *not* modify the text pointed to by TEXT.
-
- If IGNORE_HELP_CLASSES is nonzero, ignore any command list
- elements which are actually help classes rather than commands (i.e.
- the function field of the struct cmd_list_element is 0). */
-
-struct cmd_list_element *
-lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
- char **text;
- struct cmd_list_element *clist, **result_list;
- int ignore_help_classes;
-{
- char *p, *command;
- int len, tmp, nfound;
- struct cmd_list_element *found, *c;
-
- while (**text == ' ' || **text == '\t')
- (*text)++;
-
- /* Treating underscores as part of command words is important
- so that "set args_foo()" doesn't get interpreted as
- "set args _foo()". */
- for (p = *text;
- *p && (isalnum(*p) || *p == '-' || *p == '_');
- p++)
- ;
-
- /* If nothing but whitespace, return 0. */
- if (p == *text)
- return 0;
-
- len = p - *text;
-
- /* *text and p now bracket the first command word to lookup (and
- it's length is len). We copy this into a local temporary,
- converting to lower case as we go. */
-
- command = (char *) alloca (len + 1);
- for (tmp = 0; tmp < len; tmp++)
- {
- char x = (*text)[tmp];
- command[tmp] = (x >= 'A' && x <= 'Z') ? x - 'A' + 'a' : x;
- }
- command[len] = '\0';
-
- /* Look it up. */
- found = 0;
- nfound = 0;
- for (c = clist; c; c = c->next)
- if (!strncmp (command, c->name, len)
- && (!ignore_help_classes || c->function))
- {
- found = c;
- nfound++;
- if (c->name[len] == '\0')
- {
- nfound = 1;
- break;
- }
- }
-
- /* If nothing matches, we have a simple failure. */
- if (nfound == 0)
- return 0;
-
- if (nfound > 1)
- {
- if (result_list != NULL)
- /* Will be modified in calling routine
- if we know what the prefix command is. */
- *result_list = 0;
- return (struct cmd_list_element *) -1; /* Ambiguous. */
- }
-
- /* We've matched something on this list. Move text pointer forward. */
-
- *text = p;
- if (found->prefixlist)
- {
- c = lookup_cmd_1 (text, *found->prefixlist, result_list,
- ignore_help_classes);
- if (!c)
- {
- /* Didn't find anything; this is as far as we got. */
- if (result_list != NULL)
- *result_list = clist;
- return found;
- }
- else if (c == (struct cmd_list_element *) -1)
- {
- /* We've gotten this far properley, but the next step
- is ambiguous. We need to set the result list to the best
- we've found (if an inferior hasn't already set it). */
- if (result_list != NULL)
- if (!*result_list)
- /* This used to say *result_list = *found->prefixlist
- If that was correct, need to modify the documentation
- at the top of this function to clarify what is supposed
- to be going on. */
- *result_list = found;
- return c;
- }
- else
- {
- /* We matched! */
- return c;
- }
- }
- else
- {
- if (result_list != NULL)
- *result_list = clist;
- return found;
- }
-}
-
-/* All this hair to move the space to the front of cmdtype */
-
-void
-undef_cmd_error (cmdtype, q)
- char *cmdtype, *q;
-{
- error ("Undefined %scommand: \"%s\". Try \"help%s%.*s\".",
- cmdtype,
- q,
- *cmdtype? " ": "",
- strlen(cmdtype)-1,
- cmdtype);
-}
-
-/* Look up the contents of *LINE as a command in the command list LIST.
- LIST is a chain of struct cmd_list_element's.
- If it is found, return the struct cmd_list_element for that command
- and update *LINE to point after the command name, at the first argument.
- If not found, call error if ALLOW_UNKNOWN is zero
- otherwise (or if error returns) return zero.
- Call error if specified command is ambiguous,
- unless ALLOW_UNKNOWN is negative.
- CMDTYPE precedes the word "command" in the error message.
-
- If INGNORE_HELP_CLASSES is nonzero, ignore any command list
- elements which are actually help classes rather than commands (i.e.
- the function field of the struct cmd_list_element is 0). */
-
-struct cmd_list_element *
-lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
- char **line;
- struct cmd_list_element *list;
- char *cmdtype;
- int allow_unknown;
- int ignore_help_classes;
-{
- struct cmd_list_element *last_list = 0;
- struct cmd_list_element *c =
- lookup_cmd_1 (line, list, &last_list, ignore_help_classes);
- char *ptr = (*line) + strlen (*line) - 1;
-
- /* Clear off trailing whitespace. */
- while (ptr >= *line && (*ptr == ' ' || *ptr == '\t'))
- ptr--;
- *(ptr + 1) = '\0';
-
- if (!c)
- {
- if (!allow_unknown)
- {
- if (!*line)
- error ("Lack of needed %scommand", cmdtype);
- else
- {
- char *p = *line, *q;
-
- while (isalnum(*p) || *p == '-')
- p++;
-
- q = (char *) alloca (p - *line + 1);
- strncpy (q, *line, p - *line);
- q[p-*line] = '\0';
- undef_cmd_error (cmdtype, q);
- }
- }
- else
- return 0;
- }
- else if (c == (struct cmd_list_element *) -1)
- {
- /* Ambigous. Local values should be off prefixlist or called
- values. */
- int local_allow_unknown = (last_list ? last_list->allow_unknown :
- allow_unknown);
- char *local_cmdtype = last_list ? last_list->prefixname : cmdtype;
- struct cmd_list_element *local_list =
- (last_list ? *(last_list->prefixlist) : list);
-
- if (local_allow_unknown < 0)
- {
- if (last_list)
- return last_list; /* Found something. */
- else
- return 0; /* Found nothing. */
- }
- else
- {
- /* Report as error. */
- int amb_len;
- char ambbuf[100];
-
- for (amb_len = 0;
- ((*line)[amb_len] && (*line)[amb_len] != ' '
- && (*line)[amb_len] != '\t');
- amb_len++)
- ;
-
- ambbuf[0] = 0;
- for (c = local_list; c; c = c->next)
- if (!strncmp (*line, c->name, amb_len))
- {
- if (strlen (ambbuf) + strlen (c->name) + 6 < (int)sizeof ambbuf)
- {
- if (strlen (ambbuf))
- strcat (ambbuf, ", ");
- strcat (ambbuf, c->name);
- }
- else
- {
- strcat (ambbuf, "..");
- break;
- }
- }
- error ("Ambiguous %scommand \"%s\": %s.", local_cmdtype,
- *line, ambbuf);
- return 0; /* lint */
- }
- }
- else
- {
- /* We've got something. It may still not be what the caller
- wants (if this command *needs* a subcommand). */
- while (**line == ' ' || **line == '\t')
- (*line)++;
-
- if (c->prefixlist && **line && !c->allow_unknown)
- undef_cmd_error (c->prefixname, *line);
-
- /* Seems to be what he wants. Return it. */
- return c;
- }
- return 0;
-}
-
-#if 0
-/* Look up the contents of *LINE as a command in the command list LIST.
- LIST is a chain of struct cmd_list_element's.
- If it is found, return the struct cmd_list_element for that command
- and update *LINE to point after the command name, at the first argument.
- If not found, call error if ALLOW_UNKNOWN is zero
- otherwise (or if error returns) return zero.
- Call error if specified command is ambiguous,
- unless ALLOW_UNKNOWN is negative.
- CMDTYPE precedes the word "command" in the error message. */
-
-struct cmd_list_element *
-lookup_cmd (line, list, cmdtype, allow_unknown)
- char **line;
- struct cmd_list_element *list;
- char *cmdtype;
- int allow_unknown;
-{
- register char *p;
- register struct cmd_list_element *c, *found;
- int nfound;
- char ambbuf[100];
- char *processed_cmd;
- int i, cmd_len;
-
- /* Skip leading whitespace. */
-
- while (**line == ' ' || **line == '\t')
- (*line)++;
-
- /* Clear out trailing whitespace. */
-
- p = *line + strlen (*line);
- while (p != *line && (p[-1] == ' ' || p[-1] == '\t'))
- p--;
- *p = 0;
-
- /* Find end of command name. */
-
- p = *line;
- while (*p == '-'
- || (*p >= 'a' && *p <= 'z')
- || (*p >= 'A' && *p <= 'Z')
- || (*p >= '0' && *p <= '9'))
- p++;
-
- /* Look up the command name.
- If exact match, keep that.
- Otherwise, take command abbreviated, if unique. Note that (in my
- opinion) a null string does *not* indicate ambiguity; simply the
- end of the argument. */
-
- if (p == *line)
- {
- if (!allow_unknown)
- error ("Lack of needed %scommand", cmdtype);
- return 0;
- }
-
- /* Copy over to a local buffer, converting to lowercase on the way.
- This is in case the command being parsed is a subcommand which
- doesn't match anything, and that's ok. We want the original
- untouched for the routine of the original command. */
-
- processed_cmd = (char *) alloca (p - *line + 1);
- for (cmd_len = 0; cmd_len < p - *line; cmd_len++)
- {
- char x = (*line)[cmd_len];
- if (x >= 'A' && x <= 'Z')
- processed_cmd[cmd_len] = x - 'A' + 'a';
- else
- processed_cmd[cmd_len] = x;
- }
- processed_cmd[cmd_len] = '\0';
-
- /* Check all possibilities in the current command list. */
- found = 0;
- nfound = 0;
- for (c = list; c; c = c->next)
- {
- if (!strncmp (processed_cmd, c->name, cmd_len))
- {
- found = c;
- nfound++;
- if (c->name[cmd_len] == 0)
- {
- nfound = 1;
- break;
- }
- }
- }
-
- /* Report error for undefined command name. */
-
- if (nfound != 1)
- {
- if (nfound > 1 && allow_unknown >= 0)
- {
- ambbuf[0] = 0;
- for (c = list; c; c = c->next)
- if (!strncmp (processed_cmd, c->name, cmd_len))
- {
- if (strlen (ambbuf) + strlen (c->name) + 6 < sizeof ambbuf)
- {
- if (strlen (ambbuf))
- strcat (ambbuf, ", ");
- strcat (ambbuf, c->name);
- }
- else
- {
- strcat (ambbuf, "..");
- break;
- }
- }
- error ("Ambiguous %scommand \"%s\": %s.", cmdtype,
- processed_cmd, ambbuf);
- }
- else if (!allow_unknown)
- error ("Undefined %scommand: \"%s\".", cmdtype, processed_cmd);
- return 0;
- }
-
- /* Skip whitespace before the argument. */
-
- while (*p == ' ' || *p == '\t') p++;
- *line = p;
-
- if (found->prefixlist && *p)
- {
- c = lookup_cmd (line, *found->prefixlist, found->prefixname,
- found->allow_unknown);
- if (c)
- return c;
- }
-
- return found;
-}
-#endif
-
-/* Helper function for SYMBOL_COMPLETION_FUNCTION. */
-
-/* Return a vector of char pointers which point to the different
- possible completions in LIST of TEXT. */
-
-char **
-complete_on_cmdlist (list, text)
- struct cmd_list_element *list;
- char *text;
-{
- struct cmd_list_element *ptr;
- char **matchlist;
- int sizeof_matchlist;
- int matches;
- int textlen = strlen (text);
-
- sizeof_matchlist = 10;
- matchlist = (char **) xmalloc (sizeof_matchlist * sizeof (char *));
- matches = 0;
-
- for (ptr = list; ptr; ptr = ptr->next)
- if (!strncmp (ptr->name, text, textlen)
- && !ptr->abbrev_flag
- && (ptr->function
- || ptr->prefixlist))
- {
- if (matches == sizeof_matchlist)
- {
- sizeof_matchlist *= 2;
- matchlist = (char **) xrealloc ((char *)matchlist,
- (sizeof_matchlist
- * sizeof (char *)));
- }
-
- matchlist[matches] = (char *)
- xmalloc (strlen (ptr->name) + 1);
- strcpy (matchlist[matches++], ptr->name);
- }
-
- if (matches == 0)
- {
- free (matchlist);
- matchlist = 0;
- }
- else
- {
- matchlist = (char **) xrealloc ((char *)matchlist, ((matches + 1)
- * sizeof (char *)));
- matchlist[matches] = (char *) 0;
- }
-
- return matchlist;
-}
-
-static int
-parse_binary_operation (arg)
- char *arg;
-{
- int length;
-
- if (!arg || !*arg)
- return 1;
-
- length = strlen (arg);
-
- while (arg[length - 1] == ' ' || arg[length - 1] == '\t')
- length--;
-
- if (!strncmp (arg, "on", length)
- || !strncmp (arg, "1", length)
- || !strncmp (arg, "yes", length))
- return 1;
- else
- if (!strncmp (arg, "off", length)
- || !strncmp (arg, "0", length)
- || !strncmp (arg, "no", length))
- return 0;
- else
- {
- error ("\"on\" or \"off\" expected.");
- return 0;
- }
-}
-
-/* Do a "set" or "show" command. ARG is NULL if no argument, or the text
- of the argument, and FROM_TTY is nonzero if this command is being entered
- directly by the user (i.e. these are just like any other
- command). C is the command list element for the command. */
-void
-do_setshow_command (arg, from_tty, c)
- char *arg;
- int from_tty;
- struct cmd_list_element *c;
-{
- if (c->type == set_cmd)
- {
- switch (c->var_type)
- {
- case var_string:
- {
- char *new;
- char *p;
- char *q;
- int ch;
-
- if (arg == NULL)
- arg = "";
- new = (char *) xmalloc (strlen (arg) + 2);
- p = arg; q = new;
- while (ch = *p++)
- {
- if (ch == '\\')
- {
- /* \ at end of argument is used after spaces
- so they won't be lost. */
- if (*p == 0)
- break;
- ch = parse_escape (&p);
- if (ch == 0)
- break; /* C loses */
- else if (ch > 0)
- *q++ = ch;
- }
- else
- *q++ = ch;
- }
- if (*(p - 1) != '\\')
- *q++ = ' ';
- *q++ = '\0';
- new = (char *) xrealloc (new, q - new);
- if (*(char **)c->var != NULL)
- free (*(char **)c->var);
- *(char **) c->var = new;
- }
- break;
- case var_string_noescape:
- if (arg == NULL)
- arg = "";
- if (*(char **)c->var != NULL)
- free (*(char **)c->var);
- *(char **) c->var = savestring (arg, strlen (arg));
- break;
- case var_filename:
- if (arg == NULL)
- error_no_arg ("filename to set it to.");
- if (*(char **)c->var != NULL)
- free (*(char **)c->var);
- *(char **)c->var = tilde_expand (arg);
- break;
- case var_boolean:
- *(int *) c->var = parse_binary_operation (arg);
- break;
- case var_uinteger:
- if (arg == NULL)
- error_no_arg ("integer to set it to.");
- *(int *) c->var = parse_and_eval_address (arg);
- if (*(int *) c->var == 0)
- *(int *) c->var = UINT_MAX;
- break;
- case var_zinteger:
- if (arg == NULL)
- error_no_arg ("integer to set it to.");
- *(int *) c->var = parse_and_eval_address (arg);
- break;
- default:
- error ("gdb internal error: bad var_type in do_setshow_command");
- }
- }
- else if (c->type == show_cmd)
- {
- /* Print doc minus "show" at start. */
- print_doc_line (stdout, c->doc + 5);
-
- fputs_filtered (" is ", stdout);
- wrap_here (" ");
- switch (c->var_type)
- {
- case var_string:
- {
- unsigned char *p;
- fputs_filtered ("\"", stdout);
- for (p = *(unsigned char **) c->var; *p != '\0'; p++)
- printchar (*p, stdout, '"');
- fputs_filtered ("\"", stdout);
- }
- break;
- case var_string_noescape:
- case var_filename:
- fputs_filtered ("\"", stdout);
- fputs_filtered (*(char **) c->var, stdout);
- fputs_filtered ("\"", stdout);
- break;
- case var_boolean:
- fputs_filtered (*(int *) c->var ? "on" : "off", stdout);
- break;
- case var_uinteger:
- if (*(unsigned int *) c->var == UINT_MAX) {
- fputs_filtered ("unlimited", stdout);
- break;
- }
- /* else fall through */
- case var_zinteger:
- fprintf_filtered (stdout, "%d", *(unsigned int *) c->var);
- break;
- default:
- error ("gdb internal error: bad var_type in do_setshow_command");
- }
- fputs_filtered (".\n", stdout);
- }
- else
- error ("gdb internal error: bad cmd_type in do_setshow_command");
- (*c->function) (NULL, from_tty, c);
-}
-
-/* Show all the settings in a list of show commands. */
-
-void
-cmd_show_list (list, from_tty, prefix)
- struct cmd_list_element *list;
- int from_tty;
- char *prefix;
-{
- for (; list != NULL; list = list->next) {
- /* If we find a prefix, run its list, prefixing our output by its
- prefix (with "show " skipped). */
- if (list->prefixlist && !list->abbrev_flag)
- cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
- if (list->type == show_cmd)
- {
- fputs_filtered (prefix, stdout);
- fputs_filtered (list->name, stdout);
- fputs_filtered (": ", stdout);
- do_setshow_command ((char *)NULL, from_tty, list);
- }
- }
-}
-
-/* ARGSUSED */
-static void
-shell_escape (arg, from_tty)
- char *arg;
- int from_tty;
-{
- int rc, status, pid;
- char *p, *user_shell;
- extern char *rindex ();
-
- if ((user_shell = (char *) getenv ("SHELL")) == NULL)
- user_shell = "/bin/sh";
-
- /* Get the name of the shell for arg0 */
- if ((p = rindex (user_shell, '/')) == NULL)
- p = user_shell;
- else
- p++; /* Get past '/' */
-
- if ((pid = fork()) == 0)
- {
- if (!arg)
- execl (user_shell, p, 0);
- else
- execl (user_shell, p, "-c", arg, 0);
-
- fprintf (stderr, "Exec of shell failed\n");
- exit (0);
- }
-
- if (pid != -1)
- while ((rc = wait (&status)) != pid && rc != -1)
- ;
- else
- error ("Fork failed");
-}
-
-static void
-make_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- char *p;
-
- if (arg == 0)
- p = "make";
- else
- {
- p = xmalloc (sizeof("make ") + strlen(arg));
- strcpy (p, "make ");
- strcpy (p + sizeof("make ")-1, arg);
- }
-
- shell_escape (p, from_tty);
-}
-
-static void
-user_info_1 (c, stream)
- struct cmd_list_element *c;
- FILE *stream;
-{
- register struct command_line *cmdlines;
-
- cmdlines = c->user_commands;
- if (!cmdlines)
- return;
- fprintf_filtered (stream, "User command %s:\n", c->name);
- while (cmdlines)
- {
- fprintf_filtered (stream, "%s\n", cmdlines->line);
- cmdlines = cmdlines->next;
- }
- fputs_filtered ("\n", stream);
-}
-
-/* ARGSUSED */
-static void
-user_info (args, from_tty)
- char *args;
- int from_tty;
-{
- struct cmd_list_element *c;
- extern struct cmd_list_element *cmdlist;
-
- if (args)
- {
- c = lookup_cmd (&args, cmdlist, "", 0, 1);
- if (c->class != class_user)
- error ("Not a user command.");
- user_info_1 (c, stdout);
- }
- else
- {
- for (c = cmdlist; c; c = c->next)
- {
- if (c->class == class_user)
- user_info_1 (c, stdout);
- }
- }
-}
-
-void
-_initialize_command ()
-{
- add_com ("shell", class_support, shell_escape,
- "Execute the rest of the line as a shell command. \n\
-With no arguments, run an inferior shell.");
-
- add_com ("make", class_support, make_command,
- "Run the ``make'' program using the rest of the line as arguments.");
-
- add_info ("user", user_info, "Show definitions of user defined commands.\n\
-Argument is the name of the user defined command.\n\
-With no argument, show definitions of all user defined commands.");
-}
diff --git a/gdb/command.h b/gdb/command.h
deleted file mode 100644
index aa907fd..0000000
--- a/gdb/command.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Header file for command-reading library command.c.
- Copyright (C) 1986, 1989, 1990 Free Software Foundation, Inc.
-
- 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifndef _COMMAND_H_INCLUDED
-#define _COMMAND_H_INCLUDED
-
-/* Not a set/show command. Note that some commands which begin with
- "set" or "show" might be in this category, if their syntax does
- not fall into one of the following categories. */
-typedef enum cmd_types {
- not_set_cmd,
- set_cmd,
- show_cmd,
-} cmd_types;
-
-/* Types of "set" or "show" command. */
-typedef enum var_types {
- /* "on" or "off". *VAR is an integer which is nonzero for on,
- zero for off. */
- var_boolean,
- /* Unsigned Integer. *VAR is an unsigned int. The user can type 0
- to mean "unlimited", which is stored in *VAR as UINT_MAX. */
- var_uinteger,
- /* String which the user enters with escapes (e.g. the user types \n and
- it is a real newline in the stored string).
- *VAR is a malloc'd string, or NULL if the string is empty. */
- var_string,
- /* String which stores what the user types verbatim.
- *VAR is a malloc'd string, or NULL if the string is empty. */
- var_string_noescape,
- /* String which stores a filename.
- *VAR is a malloc'd string, or NULL if the string is empty. */
- var_filename,
- /* ZeroableInteger. *VAR is an int. Like Unsigned Integer except
- that zero really means zero. */
- var_zinteger,
-} var_types;
-
-/* This structure records one command'd definition. */
-
-struct cmd_list_element
- {
- /* Points to next command in this list. */
- struct cmd_list_element *next;
-
- /* Name of this command. */
- char *name;
-
- /* Command class; class values are chosen by application program. */
- enum command_class class;
-
- /* Function definition of this command.
- Zero for command class names and for help topics that
- are not really commands. */
- void (*function) ();
-# define NO_FUNCTION ((void (*)()) 0 )
-
- /* Documentation of this command (or help topic).
- First line is brief documentation; remaining lines form, with it,
- the full documentation. First line should end with a period.
- Entire string should also end with a period, not a newline. */
- char *doc;
-
- /* Auxiliary information.
- It is up to the calling program to decide what this means. */
- char *aux;
-
- /* Nonzero identifies a prefix command. For them, the address
- of the variable containing the list of subcommands. */
- struct cmd_list_element **prefixlist;
-
- /* For prefix commands only:
- String containing prefix commands to get here: this one
- plus any others needed to get to it. Should end in a space.
- It is used before the word "command" in describing the
- commands reached through this prefix. */
- char *prefixname;
-
- /* For prefix commands only:
- nonzero means do not get an error if subcommand is not
- recognized; call the prefix's own function in that case. */
- char allow_unknown;
-
- /* Nonzero says this is an abbreviation, and should not
- be mentioned in lists of commands.
- This allows "br<tab>" to complete to "break", which it
- otherwise wouldn't. */
- char abbrev_flag;
-
- /* Completion routine for this command. */
- char **(*completer)();
-
- /* Type of "set" or "show" command (or SET_NOT_SET if not "set"
- or "show"). */
- cmd_types type;
-
- /* Pointer to variable affected by "set" and "show". Doesn't matter
- if type is not_set. */
- char *var;
-
- /* What kind of variable is *VAR? */
- var_types var_type;
-
- /* Pointer to command strings of user-defined commands */
- struct command_line *user_commands;
- };
-
-/* Forward-declarations of the entry-points of command.c. */
-
-extern struct cmd_list_element *add_cmd ();
-extern struct cmd_list_element *add_alias_cmd ();
-extern struct cmd_list_element *add_prefix_cmd ();
-extern struct cmd_list_element *add_abbrev_prefix_cmd ();
-extern struct cmd_list_element *lookup_cmd (), *lookup_cmd_1 ();
-extern void add_com ();
-extern void add_com_alias ();
-extern void add_info ();
-extern void add_info_alias ();
-extern char **complete_on_cmdlist ();
-extern void delete_cmd ();
-extern void help_cmd ();
-extern struct cmd_list_element *add_set_cmd ();
-extern struct cmd_list_element *add_show_from_set ();
-
-/* Do a "set" or "show" command. ARG is NULL if no argument, or the text
- of the argument, and FROM_TTY is nonzero if this command is being entered
- directly by the user (i.e. these are just like any other
- command). C is the command list element for the command. */
-extern void do_setshow_command ();
-
-/* Do a "show" command for each thing on a command list. */
-extern void cmd_show_list ();
-
-extern void error_no_arg (); /* Print error for missing argument */
-extern void dont_repeat (); /* Avoid auto-repeat of command */
-
-#endif /* _COMMAND_H_INCLUDED */
diff --git a/gdb/config.gdb b/gdb/config.gdb
deleted file mode 100755
index c380fe4..0000000
--- a/gdb/config.gdb
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/bin/sh
-
-# Shell script to do machine-dependent things in
-# preparation for compiling gdb.
-#
-# Usage: config.gdb machine
-#
-# If config.gdb succeeds, it leaves its status in config.status.
-# If config.gdb fails after disturbing the status quo,
-# config.status is removed.
-
-progname=$0
-host=
-target=
-list_hosts=
-list_targets=
-srcdir=
-
-for arg in $*; do
- case $arg in
- -srcdir=*|+srcdir=*)
- srcdir=`echo $arg | sed 's/[+-]srcdir=//'`
- ;;
- -host|+host)
- list_hosts=true
- ;;
- -target|+target)
- list_targets=true
- ;;
- -host=*|+host=*)
- if [ "$host" = "" ]; then
- host=`echo $arg | sed 's/[+-]host=//'`
- else
- echo Error: Attempt to specify host machine twice
- bad=true
- fi
- ;;
- -target=*|+target=*)
- if [ "$target" = "" ]; then
- target=`echo $arg | sed 's/[+-]target=//'`
- else
- echo Error: Attempt to specify target machine twice
- bad=true
- fi
- ;;
- *)
- if [ "$host" = "" ]; then
- host=$arg
- else
- if [ "$target" = "" ]; then
- target=$arg
- else
- echo Error: More arguments than host and target machine names
- bad=true
- fi
- fi
- ;;
- esac
-done
-
-if [ "$target" = "" ]; then target=$host; fi
-if [ "$host" = "" ]; then bad=true; fi
-
-# Find the source files, if location was not specified
-if [ "$srcdir" = "" ]; then
- srcdirdefaulted=true
- srcdir=.
- if [ ! -r main.c ]; then
- srcdir=..
- fi
-fi
-if [ ! -r ${srcdir}/main.c ]; then
- if [ "$srcdirdefaulted" != "true" ]; then
- echo "$progname: Can't find debugger sources in \`${srcdir}'." 1>&2
- else
- echo "$progname: Can't find debugger sources in \`.' or \`..'." 1>&2
- fi
- exit 1
-fi
-
-if [ "$list_hosts" = "true" ]; then
- cd $srcdir/xconfig
- for i in * ; do
-# The {} in ${i} are required or else /bin/sh in sony newsos 3.2 removes
-# the quote after it.
- awk <$i "NR == 1 { lastchar = substr(\"${i}\", length(\"${i}\"), 1)
-if (lastchar != \"~\" && lastchar != \"#\") \
-printf \"%-12s %s\n\", \"${i}\", substr(\$0,2) }"
- done
-fi
-
-if [ "$list_targets" = "true" ]; then
- cd $srcdir/tconfig
- for i in * ; do
- awk <$i "NR == 1 { lastchar = substr(\"${i}\", length(\"${i}\"), 1)
-if (lastchar != \"~\" && lastchar != \"#\") \
-printf \"%-12s %s\n\", \"${i}\", substr(\$0,2) }"
- done
-fi
-
-if [ "$list_hosts" = "true" -o "$list_targets" = "true" ]; then
- exit 0
-fi
-
-if [ "$host" != "" -a ! -f $srcdir/xconfig/$host ]; then
- echo "No such host $host"
- bad=true
-fi
-
-if [ "$target" != "" -a ! -f $srcdir/tconfig/$target ]; then
- echo "No such target $target"
- bad=true
-fi
-
-if [ "$bad" = "true" ] ; then
- echo "Usage: "
- echo " $progname [+srcdir=\`dir'] machine"
- echo " For normal usage"
- echo " $progname [+srcdir=\`dir'] \`host' \`target'"
- echo " $progname [+srcdir=\`dir'] +host=\`host' +target=\`target'"
- echo " If you are doing remote debugging between machines of two"
- echo " different types (cross-debugging). \`host' is the type of"
- echo " machine on which GDB will be running. \`target' is the"
- echo " machine that the program you are debugging will be"
- echo " running on."
- echo " $progname +host"
- echo " Print a list of valid host machine types."
- echo " $progname +target"
- echo " Print a list of valid target machine types."
- echo
- echo " +srcdir=\`dir' means that the sources are in \`dir'. For"
- echo " example, \`cd /obj/hp300; config.gdb +srcdir=/src/gdb hp300'"
- echo " If +srcdir is not specified, sources can either be in \`.'"
- echo " or \`..'."
- echo
-
- if [ -r config.status ]
- then
- cat config.status
- fi
- exit 1
-fi
-
-rm -f tm.h xm.h
-
-cat $srcdir/xconfig/$host $srcdir/tconfig/$target | awk '$1 == "#msg" {
- print substr($0,6)}'
-paramfile=${srcdir}/`awk '
- $1 == "TM_FILE=" { print $2 }' <$srcdir/tconfig/$target`
-if [ "$paramfile" != "${srcdir}/" ] ; then
- # Make a symlink if possible, otherwise try a hard link
- ln -s $paramfile tm.h 2>/dev/null || ln $paramfile tm.h
-fi
-
-paramfile=${srcdir}/`awk '
- $1 == "XM_FILE=" { print $2 }' <$srcdir/xconfig/$host`
-if [ "$paramfile" != "${srcdir}/" ] ; then
- # Make a symlink if possible, otherwise try a hard link
- ln -s $paramfile xm.h 2>/dev/null || ln $paramfile xm.h
-fi
-
-rm -f config.status
-
-case ${srcdir} in
- .)
- ;;
- *)
- echo "srcdir=${srcdir}" >./Makefile.sdir
- grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \
- echo "source ${srcdir}/.gdbinit" >> .gdbinit
-esac
-
-rm -f Makefile
-make "srcdir=${srcdir}" \
- "M_MAKEFILE=$srcdir/tconfig/$target $srcdir/xconfig/$host" \
- -f $srcdir/Makefile.dist Makefile
-
-echo "GDB is now set up for host machine $host and target machine $target." \
- | tee config.status
-exit 0
diff --git a/gdb/config.status b/gdb/config.status
deleted file mode 100755
index ec87176..0000000
--- a/gdb/config.status
+++ /dev/null
@@ -1 +0,0 @@
-GDB is now set up for host machine none and target machine none.
diff --git a/gdb/config.sub b/gdb/config.sub
deleted file mode 100755
index dac9ab8..0000000
--- a/gdb/config.sub
+++ /dev/null
@@ -1,446 +0,0 @@
-#!/bin/sh
-
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration (e.g. a typo).
-
-# Please email any bugs, comments, and/or additions to this file to:
-# configure@cygnus.com
-
-# decode aliases into canonical names
-
-case "$1" in
-# cpu alone is a valid alias for cpu-none-none.
-vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc | ns32k \
- | alliant | arm | c1 | c2 | mips | pyramid | tron | a29k \
- | romp | rs6000 | i960 | h8300)
- cpu=$1
- vendor=none
- os=none
- ;;
-altos | altos3068)
- cpu=m68k
- vendor=altos
- os=sysv # maybe?
- ;;
-altosgas)
- cpu=m68k
- vendor=altos
- os=gas
- ;;
-am29k)
- cpu=a29k
- vendor=none
- os=bsd
- ;;
-amdahl)
- cpu=580
- vendor=amdahl
- os=uts
- ;;
-amigados)
- cpu=m68k
- vendor=cbm
- os=amigados # Native AmigaDOS
- ;;
-amigaunix | amix)
- cpu=m68k
- vendor=cbm
- os=svr4 # System V Release 4 (svr4 is an industry recognized acronym)
- ;;
-apollo68)
- cpu=m68k
- vendor=apollo
- os=sysv # maybe?
- ;;
-balance)
- cpu=ns32k
- vendor=sequent
- os=dynix
- ;;
-convex-c1)
- cpu=c1
- vendor=convex
- os=sysv # maybe?
- ;;
-convex-c2)
- cpu=c2
- vendor=convex
- os=sysv # maybe?
- ;;
-cray | ymp)
- cpu=ymp
- vendor=cray
- os=unicos
- ;;
-cray2)
- cpu=cray2
- vendor=cray
- os=unicos
- ;;
-dec3100 | decstatn | decstation | decstation-3100 | pmax | pmin)
- cpu=mips
- vendor=dec
- os=ultrix
- ;;
-delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- cpu=m68k
- vendor=motorola
- os=sysv # maybe?
- ;;
-
-delta88)
- cpu=m88k
- vendor=motorola
- os=m88kbcs
- ;;
-
-gmicro)
- cpu=tron
- vendor=gmicro
- os=sysv # maybe?
- ;;
-
-h8300hds)
- cpu=h8300
- vendor=hitachi
- os=hds
- ;;
-
-# start-sanitize-v9
-hal-32 | hal32)
- cpu=sparc64
- vendor=hal
- os=hal32
- ;;
-hal-64 | hal64)
- cpu=sparc64
- vendor=hal
- os=hal64
- ;;
-sparc64)
- cpu=sparc64
- vendor=sun
- os=v9
- ;;
-sparc64-v7 | sparc64v7)
- cpu=sparc64
- vendor=sun
- os=v7
- ;;
-# end-sanitize-v9
-hp300bsd)
- cpu=m68k
- vendor=hp
- os=bsd
- ;;
-hp300hpux | hpux | hp9k3[2-9][0-9])
- cpu=m68k
- vendor=hp
- os=hpux
- ;;
-hp9k31[0-9] | hp9k2[0-9][0-9])
- cpu=m68000
- vendor=hp
- os=hpux
- ;;
-i386sco)
- cpu=i386
- vendor=sco
- os=sysv # maybe?
- ;;
-i386v)
- cpu=i386
- vendor=none
- os=sysv
- ;;
-i386v32)
- cpu=i386
- vendor=none
- os=sysv32
- ;;
-iris | iris4d)
- cpu=mips
- vendor=sgi
- os=irix # maybe?
- ;;
-
-dpx2)
- vendor=bull
- cpu=m68k
- os=sysv
- ;;
-isi | isi68)
- cpu=m68k
- vendor=isi
- os=sysv # maybe?
- ;;
-littlemips)
- cpu=mips
- vendor=little
- os=bsd
- ;;
-magnum | m3230)
- cpu=mips
- vendor=mips
- os=sysv # maybe?
- ;;
-merlin)
- cpu=ns32k
- vendor=utek
- os=sysv # maybe?
- ;;
-miniframe)
- cpu=m68000
- vendor=convergent
- os=sysv # maybe?
- ;;
-mmax)
- cpu=ns32k
- vendor=encore
- os=sysv # maybe?
- ;;
-news | news700 | news800 | news900)
- cpu=m68k
- vendor=sony
- os=newsos3 # Based on bsd-4.3
- ;;
-news1000)
- cpu=m68030
- vendor=sony
- os=newsos3 # ?
- ;;
-news-3600 | bigmips | risc-news)
- cpu=mips
- vendor=sony
- os=newsos4 # Presumably?
- ;;
-next)
- cpu=m68k
- vendor=next
- os=sysv # maybe?
- ;;
-nindy960)
- cpu=i960
- vendor=intel
- os=nindy
- ;;
-none)
- cpu=none
- vendor=none
- os=none
- ;;
-np1)
- cpu=np1
- vendor=gould
- os=sysv # maybe?
- ;;
-rtpc)
- cpu=romp
- vendor=ibm
- os=aix # maybe?
- ;;
-pbd)
- cpu=sparc
- vendor=unicom
- os=sysv
- ;;
-pn)
- cpu=pn
- vendor=gould
- os=sysv # maybe?
- ;;
-ps2)
- cpu=i386
- vendor=ibm
- os=sysv # maybe?
- ;;
-sun2)
- cpu=m68000
- vendor=sun
- os=sunos4
- ;;
-sun2os3)
- cpu=m68000
- vendor=sun
- os=sunos3
- ;;
-sun2os4)
- cpu=m68000
- vendor=sun
- os=sunos4
- ;;
-sun3)
- cpu=m68k
- vendor=sun
- os=sunos4
- ;;
-sun3os3)
- cpu=m68k
- vendor=sun
- os=sunos3
- ;;
-sun3os4)
- cpu=m68k
- vendor=sun
- os=sunos4
- ;;
-sun386 | roadrunner | sun386i)
- cpu=i386
- vendor=sun
- os=sunos
- ;;
-sun4)
- cpu=sparc
- vendor=sun
- os=sunos4
- ;;
-sun4os3)
- cpu=sparc
- vendor=sun
- os=sunos3
- ;;
-sun4os4)
- cpu=sparc
- vendor=sun
- os=sunos4
- ;;
-symmetry)
- cpu=i386
- vendor=sequent
- os=dynix
- ;;
-tower | tower-32)
- cpu=m68k
- vendor=ncr
- os=sysv # maybe?
- ;;
-ultra3)
- cpu=a29k
- vendor=nyu
- os=sym1
- ;;
-umax)
- cpu=ns32k
- vendor=encore
- os=sysv # maybe?
- ;;
-unixpc | safari | pc7300 | 3b1 | 7300 | 7300-att | att-7300)
- cpu=m68k
- vendor=att
- os=sysv # maybe?
- ;;
-vax-dec)
- cpu=vax
- vendor=dec
- os=ultrix # maybe?
- ;;
-vxworks68)
- cpu=m68k
- vendor=wrs
- os=vxworks
- ;;
-vxworks960)
- cpu=i960
- vendor=wrs
- os=vxworks
- ;;
-xmp)
- cpu=xmp
- vendor=cray
- os=unicos
- ;;
-# not an alias. parse what we expect to be a canonical name.
-*)
- cpu=`echo $1 | sed 's/-.*$//'`
-
- if [ "${cpu}" = "$1" ] ; then
- # no vendor so this is an invalid name.
- echo '***' No vendor: configuration \`$1\' not recognized 1>&2
- exit 1
- else
- # parse out vendor
- rest=`echo $1 | sed "s/${cpu}-//"`
- vendor=`echo ${rest} | sed 's/-.*$//'`
-
- if [ "${vendor}" = "${rest}" ] ; then
- # a missing os is acceptable
- os=none
- else
- os=`echo ${rest} | sed "s/${vendor}-//"`
- fi
- fi
- ;;
-esac
-
-# At this point we should have three parts of a canonical name in cpu,
-# vendor, and os.
-
-# verify that the cpu is known.
-
-case "${cpu}" in
-none | vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc \
- | ns32k | alliant | arm | c1 | c2 | mips | pyramid | tron \
- | a29k | romp | rs6000 | i960 | xmp | ymp | cray2 | 580 | h8300)
- ;;
-
-# start-sanitize-v9
-sparc64) ;;
-# end-sanitize-v9
-
-*)
- echo '***' Invalid cpu \`${cpu}\': configuration \`$1\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# verify that the vendor is known.
-
-case "${vendor}" in
- altos | amdahl | aout | apollo | att | bcs | bout |\
- cbm | convergent | convex | coff | cray | dec | encore |\
- gould | hitachi | intel | isi | hp | ibm | little | mips | motorola |\
- ncr | next | none | nyu | sco | sequent | sgi | sony | sun |\
- unicom | utek | wrs | bull ) ;;
-
-# start-sanitize-v9
-hal) ;;
-# end-sanitize-v9
-
-*)
- echo '***' Invalid vendor \`${vendor}\': configuration \`$1\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# verify that the os is known, if it exists.
-
-case "${os}" in
-aix* | aout | bout | bsd* | coff | ctix* | dynix* | esix* | hpux* \
- | hds | irix* | isc* | kern | mach* | newsos* | nindy* | none \
- | osf* | sco* | sunos* | sysv* | ultrix* | unos* | v88r* \
- | vms* | vxworks* | sym[1-9]* | unicos* | uts | svr4 \
- | amigados)
- ;;
-
-# start-sanitize-v9
-hal32 | hal64 | v7 | v9) ;;
-# end-sanitize-v9
-
-*)
- echo '***' Invalid os \`${os}\': configuration \`$1\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-echo ${cpu}-${vendor}-${os}
diff --git a/gdb/config/.Sanitize b/gdb/config/.Sanitize
deleted file mode 100644
index 92cdbdf..0000000
--- a/gdb/config/.Sanitize
+++ /dev/null
@@ -1,83 +0,0 @@
-# Sanitize.in for devo.
-# $Id$
-#
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-echo Sanitizing `pwd`...
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-3b1
-a29k
-a29k-kern
-altos
-altosgas
-amix
-arm
-bigmips
-convex
-decstation
-delta88
-hp300bsd
-hp300hpux
-i386sco
-i386aout
-i386v
-i386v-g
-i386v32
-i386v32-g
-i960
-irix3
-isi
-littlemips
-m88k
-merlin
-news
-news1000
-nindy960
-none
-np1
-pn
-pyramid
-sun2os3
-sun2os4
-sun3
-sun386
-sun3os3
-sun3os4
-sun4
-sun4os3
-sun4os4
-symmetry
-tahoe
-ultra3
-umax
-vax
-vxworks68
-vxworks960
-
-Do-last:
-
-echo Done in `pwd`.
-
-# End of file.
diff --git a/gdb/config/3b1.mh b/gdb/config/3b1.mh
deleted file mode 100644
index 1dc2893..0000000
--- a/gdb/config/3b1.mh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Host: AT&T 3b1/Unix pc
-# I don't think cc has been tried. -traditional for <sys/ioctl.h>
-# (not sure whether necessary).
-CC= gcc -traditional
-# GCC runs out of virtual memory.
-# A separate CC for pinsn routines is no longer supported, though.
-# FIXME -- someone unlucky enough to have a 3B1, let bug-gcc@prep.ai.mit.edu
-# know what works and what fails on the 3B1.
-#PINSN_CC= cc
-
-XDEPFILES= infptrace.o coredep.o
-XM_FILE= xm-3b1.h
diff --git a/gdb/config/3b1.mt b/gdb/config/3b1.mt
deleted file mode 100644
index bba2ed1..0000000
--- a/gdb/config/3b1.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: AT&T 3b1/Unix pc
-TDEPFILES= exec.o m68k-pinsn.o
-TM_FILE= tm-3b1.h
diff --git a/gdb/config/a29k-kern.mt b/gdb/config/a29k-kern.mt
deleted file mode 100644
index bdc9490..0000000
--- a/gdb/config/a29k-kern.mt
+++ /dev/null
@@ -1,10 +0,0 @@
-# Target: Remote AMD 29000 that runs Unix kernel on NYU Ultra3 processor board.
-# This builds a gdb that should run on a host (we use sun3os4) that
-# then communicates over the serial line to either an Adapt or MiniMon,
-# for use in debugging Unix kernels.
-# As compared to ordinary remote 29K debugging, this changes the register
-# numbering a bit, to hold kernel regs, and adds support for looking at
-# the upage.
-TDEPFILES= exec.o am29k-pinsn.o am29k-tdep.o remote-mm.o remote-adapt.o
-TM_FILE= tm-ultra3.h
-TM_CFLAGS = -DKERNEL_DEBUGGING -DNO_HIF_SUPPORT
diff --git a/gdb/config/a29k.mt b/gdb/config/a29k.mt
deleted file mode 100644
index aa1db16..0000000
--- a/gdb/config/a29k.mt
+++ /dev/null
@@ -1,10 +0,0 @@
-# Target: AMD 29000.
-# These defines should give you a gdb running on ? (sun3os4 if you like)
-# that will be able to communicate over a serial line with either an
-# EB board (remote-eb.c),
-# Adapt (remote-adapt.c),
-# or a MiniMon debugger (remote-mm.c).
-# Or run native on an Ultracomputer.
-TDEPFILES= exec.o am29k-pinsn.o am29k-tdep.o remote-eb.o remote-mm.o remote-adapt.o
-TM_FILE= tm-29k.h
-TM_CFLAGS = -DNO_HIF_SUPPORT
diff --git a/gdb/config/altos.mh b/gdb/config/altos.mh
deleted file mode 100644
index c88f657..0000000
--- a/gdb/config/altos.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Altos 3068 (68k, System V release 2)
-XDEPFILES= infptrace.o altos-xdep.o
-XM_FILE= xm-altos.h
-REGEX=regex.o
-REGEX1=regex.o
-SYSV_DEFINE=-DSYSV
diff --git a/gdb/config/altos.mt b/gdb/config/altos.mt
deleted file mode 100644
index d156615..0000000
--- a/gdb/config/altos.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Altos 3068 (68k, System V release 2)
-TDEPFILES= m68k-pinsn.o exec.o
-TM_FILE= tm-altos.h
diff --git a/gdb/config/altosgas.mh b/gdb/config/altosgas.mh
deleted file mode 100644
index b9b231a..0000000
--- a/gdb/config/altosgas.mh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Host: Altos 3068 (68k, System V release 2), using COFF encapsulation
-#msg Use of the coff encapsulation features require the GNU binutils utilities
-#msg To be ahead of their System V counterparts in your path.
-
-XDEPFILES= infptrace.o altos-xdep.o
-XM_FILE= xm-altos.h
-REGEX=regex.o
-REGEX1=regex.o
-SYSV_DEFINE=-DSYSV
diff --git a/gdb/config/altosgas.mt b/gdb/config/altosgas.mt
deleted file mode 100644
index 7c2912e..0000000
--- a/gdb/config/altosgas.mt
+++ /dev/null
@@ -1,7 +0,0 @@
-# Target: Altos 3068 (68k, System V release 2), using COFF encapsulation
-
-#msg Use of the coff encapsulation features require the GNU binutils utilities
-#msg To be ahead of their System V counterparts in your path.
-
-TDEPFILES= m68k-pinsn.o exec.o
-TM_FILE= tm-altosgas.h
diff --git a/gdb/config/am29k b/gdb/config/am29k
deleted file mode 100755
index 562e43f..0000000
--- a/gdb/config/am29k
+++ /dev/null
@@ -1,5 +0,0 @@
-# Target: AMD 29000 on EB29K board over a serial line.
-TDEPFILES= exec.o am29k-pinsn.o remote-eb.o am29k-tdep.o
-TM_FILE= tm-29k.h
-# The following is for ../include/a.out.encap.h
-TM_CFLAGS = -DCOFF_ENCAPSULATE -DTARGET=TARGET_AM29K
diff --git a/gdb/config/amix.mh b/gdb/config/amix.mh
deleted file mode 100644
index f110dcc..0000000
--- a/gdb/config/amix.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Commodore Amiga running SVR4.
-XDEPFILES= procfs.o
-XM_FILE= xm-amix.h
-SYSV_DEFINE=-DSYSV
-REGEX=regex.o
-REGEX1=regex.o
diff --git a/gdb/config/amix.mt b/gdb/config/amix.mt
deleted file mode 100644
index ea92eef..0000000
--- a/gdb/config/amix.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Commodore Amiga running SVR4
-TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o
-TM_FILE= tm-amix.h
diff --git a/gdb/config/arm.mh b/gdb/config/arm.mh
deleted file mode 100644
index 3f144f0..0000000
--- a/gdb/config/arm.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Acorn RISC machine running RISCiX (4.3bsd)
-XDEPFILES= infptrace.o arm-xdep.o arm-convert.o
-XM_FILE= xm-arm.h
diff --git a/gdb/config/arm.mt b/gdb/config/arm.mt
deleted file mode 100644
index 146995b..0000000
--- a/gdb/config/arm.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Acorn RISC machine running RISCiX (4.3bsd)
-TDEPFILES= arm-tdep.o arm-pinsn.o
-TM_FILE= tm-arm.h
diff --git a/gdb/config/bigmips.mh b/gdb/config/bigmips.mh
deleted file mode 100644
index 2dafb6e..0000000
--- a/gdb/config/bigmips.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Big-endian MIPS machine such as Sony News
-XDEPFILES= infptrace.o mips-xdep.o coredep.o
-XM_FILE= xm-bigmips.h
diff --git a/gdb/config/bigmips.mt b/gdb/config/bigmips.mt
deleted file mode 100644
index c52e39b..0000000
--- a/gdb/config/bigmips.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Big-endian MIPS machine such as Sony News
-TDEPFILES= mips-pinsn.o mips-tdep.o mipsread.o exec.o
-TM_FILE= tm-bigmips.h
diff --git a/gdb/config/convex.mh b/gdb/config/convex.mh
deleted file mode 100644
index 35a121f..0000000
--- a/gdb/config/convex.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Convex Unix (4bsd)
-XDEPFILES= convex-xdep.o
-XM_FILE= xm-convex.h
diff --git a/gdb/config/convex.mt b/gdb/config/convex.mt
deleted file mode 100644
index aa8dfc5..0000000
--- a/gdb/config/convex.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Convex Unix (4bsd)
-TDEPFILES= convex-tdep.o convex-pinsn.o
-TM_FILE= tm-convex.h
diff --git a/gdb/config/decstation.mh b/gdb/config/decstation.mh
deleted file mode 100644
index 28fcc1e..0000000
--- a/gdb/config/decstation.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Little-endian MIPS machine such as DECstation.
-XDEPFILES= infptrace.o mips-xdep.o coredep.o
-XM_FILE= xm-mips.h
diff --git a/gdb/config/decstation.mt b/gdb/config/decstation.mt
deleted file mode 100644
index 8025b9c..0000000
--- a/gdb/config/decstation.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Little-endian MIPS machine such as DECstation.
-TDEPFILES= mips-pinsn.o mips-tdep.o mipsread.o exec.o
-TM_FILE= tm-mips.h
diff --git a/gdb/config/delta88.mh b/gdb/config/delta88.mh
deleted file mode 100644
index ce4f37c..0000000
--- a/gdb/config/delta88.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: Motorola 88000 running DGUX
-XDEPFILES= infptrace.o m88k-xdep.o
-XM_FILE= xm-delta88.h
-REGEX=regex.o
-REGEX1=regex.o
-ALLOCA=alloca.o
-ALLOCA1=alloca.o
-# Have to use /bin/nm because a bfd nm won't do the right thing
-MUNCH_DEFINE=MUNCH_NM=/bin/nm
-M_INSTALL=cp gdb.z $(ddestdir)/man/man1
diff --git a/gdb/config/delta88.mt b/gdb/config/delta88.mt
deleted file mode 100644
index 7dbb174..0000000
--- a/gdb/config/delta88.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Motorola 88000
-TDEPFILES= m88k-tdep.o m88k-pinsn.o exec.o coredep.o
-TM_FILE= tm-delta88.h
diff --git a/gdb/config/hp300bsd.mh b/gdb/config/hp300bsd.mh
deleted file mode 100644
index 273be90..0000000
--- a/gdb/config/hp300bsd.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Hewlett-Packard 9000 series 300, running BSD
-XDEPFILES= infptrace.o coredep.o
-XM_FILE= xm-hp300bsd.h
diff --git a/gdb/config/hp300bsd.mt b/gdb/config/hp300bsd.mt
deleted file mode 100644
index 2a730ce..0000000
--- a/gdb/config/hp300bsd.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Hewlett-Packard 9000 series 300, running BSD
-TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
-TM_FILE= tm-hp300bsd.h
diff --git a/gdb/config/hp300hpux.mh b/gdb/config/hp300hpux.mh
deleted file mode 100644
index 18dc1b8..0000000
--- a/gdb/config/hp300hpux.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: Hewlett-Packard 9000 series 300, running HPUX
-# The following is true because gcc uses a different .o file format
-# than the native HPUX compiler
-#msg If you compile GDB with GCC on HPUX, you must make sure
-#msg that the `nm' used in `munch' is GNU nm
-#msg
-
-# The headers in the directory hp-include override system headers
-# and tell GDB to use BSD executable file format (hence -Ihp-include)
-XDEPFILES= infptrace.o hp300ux-xdep.o
-XM_FILE= xm-hp300hpux.h
-SYSV_DEFINE=-DSYSV
-REGEX=regex.o
-REGEX1=regex.o
-ALLOCA=alloca.o
diff --git a/gdb/config/hp300hpux.mt b/gdb/config/hp300hpux.mt
deleted file mode 100644
index d061486..0000000
--- a/gdb/config/hp300hpux.mt
+++ /dev/null
@@ -1,11 +0,0 @@
-# Target: Hewlett-Packard 9000 series 300, running HPUX
-
-#msg Note that GDB can only read symbols from programs that were
-#msg compiled with GCC
-#msg
-
-# The headers in the directory hp-include override system headers
-# and tell GDB to use BSD executable file format (hence -Ihp-include)
-TM_CFLAGS=-Ihp-include
-TDEPFILES= exec.o m68k-pinsn.o
-TM_FILE= tm-hp300hpux.h
diff --git a/gdb/config/i386aout.mt b/gdb/config/i386aout.mt
deleted file mode 100644
index 1025038..0000000
--- a/gdb/config/i386aout.mt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Target: Intel 386 with a.out
-
-TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
-TM_FILE= tm-i386v-g.h
diff --git a/gdb/config/i386mach.mh b/gdb/config/i386mach.mh
deleted file mode 100644
index f880b89..0000000
--- a/gdb/config/i386mach.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Intel 386 running Mach
-
-XDEPFILES= infptrace.o mach386-xdep.o
-XM_FILE= xm-i386mach.h
diff --git a/gdb/config/i386sco.mh b/gdb/config/i386sco.mh
deleted file mode 100644
index 1cbeb63..0000000
--- a/gdb/config/i386sco.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: Intel 386 running SCO Unix (pre-SVR4)
-XDEPFILES= infptrace.o coredep.o i386-xdep.o i387-tdep.o
-XM_FILE= xm-i386sco.h
-XM_CLIBS= -lPW
-SYSV_DEFINE=-DSYSV
-REGEX=regex.o
-REGEX1=regex.o
diff --git a/gdb/config/i386sco.mt b/gdb/config/i386sco.mt
deleted file mode 100644
index 720eea2..0000000
--- a/gdb/config/i386sco.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 running SCO Unix (pre-SVR4)
-TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
-TM_FILE= tm-i386v.h
diff --git a/gdb/config/i386v-g.mh b/gdb/config/i386v-g.mh
deleted file mode 100644
index 2316ffb..0000000
--- a/gdb/config/i386v-g.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: Intel 386 running System V, using COFF encapsulation
-XDEPFILES= infptrace.o coredep.o i386-xdep.o i387-tdep.o
-XM_FILE= xm-i386v.h
-XM_CLIBS= -lPW
-SYSV_DEFINE=-DSYSV
-REGEX=regex.o
-REGEX1=regex.o
diff --git a/gdb/config/i386v-g.mt b/gdb/config/i386v-g.mt
deleted file mode 100644
index cd07b5c..0000000
--- a/gdb/config/i386v-g.mt
+++ /dev/null
@@ -1,7 +0,0 @@
-# Target: Intel 386 running System V, using COFF encapsulation
-
-#msg Use of the COFF encapsulation features requires the GNU binary utilities
-#msg to be ahead of their System V counterparts in your path.
-
-TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
-TM_FILE= tm-i386v-g.h
diff --git a/gdb/config/i386v.mh b/gdb/config/i386v.mh
deleted file mode 100644
index 86dd4c2..0000000
--- a/gdb/config/i386v.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: Intel 386 running System V
-XDEPFILES= infptrace.o coredep.o i386-xdep.o i387-tdep.o
-XM_FILE= xm-i386v.h
-XM_CLIBS= -lPW
-SYSV_DEFINE=-DSYSV
-REGEX=regex.o
-REGEX1=regex.o
diff --git a/gdb/config/i386v.mt b/gdb/config/i386v.mt
deleted file mode 100644
index d595f7e..0000000
--- a/gdb/config/i386v.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 running System V
-TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
-TM_FILE= tm-i386v.h
diff --git a/gdb/config/i386v32-g.mh b/gdb/config/i386v32-g.mh
deleted file mode 100644
index 0349512..0000000
--- a/gdb/config/i386v32-g.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: Intel 386 running System V release 3.2, using COFF encapsulation
-XDEPFILES= infptrace.o coredep.o i386-xdep.o i387-tdep.o
-XM_FILE= xm-i386v32.h
-XM_CLIBS= -lPW
-SYSV_DEFINE=-DSYSV
-REGEX=regex.o
-REGEX1=regex.o
diff --git a/gdb/config/i386v32-g.mt b/gdb/config/i386v32-g.mt
deleted file mode 100644
index e2cd6b4..0000000
--- a/gdb/config/i386v32-g.mt
+++ /dev/null
@@ -1,7 +0,0 @@
-# Target: Intel 386 running System V release 3.2, using COFF encapsulation
-
-#msg Use of the COFF encapsulation features requires the GNU binary utilities
-#msg to be ahead of their System V counterparts in your path.
-
-TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
-TM_FILE= tm-i386v-g.h
diff --git a/gdb/config/i386v32.mh b/gdb/config/i386v32.mh
deleted file mode 100644
index 691b698..0000000
--- a/gdb/config/i386v32.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: Intel 386 running System V release 3.2
-XDEPFILES= infptrace.o coredep.o i386-xdep.o i387-tdep.o
-XM_FILE= xm-i386v32.h
-XM_CLIBS= -lPW
-SYSV_DEFINE=-DSYSV
-REGEX=regex.o
-REGEX1=regex.o
diff --git a/gdb/config/i386v32.mt b/gdb/config/i386v32.mt
deleted file mode 100644
index 48d6abf..0000000
--- a/gdb/config/i386v32.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 running System V release 3.2
-TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
-TM_FILE= tm-i386v.h
diff --git a/gdb/config/i960.mt b/gdb/config/i960.mt
deleted file mode 100644
index f6a7556..0000000
--- a/gdb/config/i960.mt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Target: Intel 80960, under NINDY or under VxWorks, selected at runtime.
-#msg
-#msg You must specify either "nindy960" or "vxworks960"; there is no
-#msg generic i960 target any more.
-#msg
diff --git a/gdb/config/irix3.mh b/gdb/config/irix3.mh
deleted file mode 100644
index 55dae08..0000000
--- a/gdb/config/irix3.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: SGI Iris running irix 3.x
-XDEPFILES= infptrace.o coredep.o
-XM_FILE= xm-irix3.h
-ALLOCA=alloca.o
-ALLOCA1=alloca.o
-MUNCH_DEFINE=-B
diff --git a/gdb/config/irix3.mt b/gdb/config/irix3.mt
deleted file mode 100644
index 3cd05bb..0000000
--- a/gdb/config/irix3.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Big-endian MIPS machine such as Sony News
-TDEPFILES= mips-pinsn.o mips-tdep.o mipsread.o exec.o
-TM_FILE= tm-irix3.h
diff --git a/gdb/config/isi.mh b/gdb/config/isi.mh
deleted file mode 100644
index 08bce4a..0000000
--- a/gdb/config/isi.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: ISI Optimum V (3.05) under 4.3bsd.
-XDEPFILES= infptrace.o coredep.o
-XM_FILE= xm-isi.h
diff --git a/gdb/config/isi.mt b/gdb/config/isi.mt
deleted file mode 100644
index fb4d83f..0000000
--- a/gdb/config/isi.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: ISI Optimum V (3.05) under 4.3bsd.
-TDEPFILES= exec.o m68k-pinsn.o
-TM_FILE= tm-isi.h
diff --git a/gdb/config/littlemips.mh b/gdb/config/littlemips.mh
deleted file mode 100644
index 28fcc1e..0000000
--- a/gdb/config/littlemips.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Little-endian MIPS machine such as DECstation.
-XDEPFILES= infptrace.o mips-xdep.o coredep.o
-XM_FILE= xm-mips.h
diff --git a/gdb/config/littlemips.mt b/gdb/config/littlemips.mt
deleted file mode 100644
index 8025b9c..0000000
--- a/gdb/config/littlemips.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Little-endian MIPS machine such as DECstation.
-TDEPFILES= mips-pinsn.o mips-tdep.o mipsread.o exec.o
-TM_FILE= tm-mips.h
diff --git a/gdb/config/m88k.mh b/gdb/config/m88k.mh
deleted file mode 100644
index 5d396aa..0000000
--- a/gdb/config/m88k.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Motorola 88000 running DGUX
-XDEPFILES= infptrace.o m88k-xdep.o
-XM_FILE= xm-m88k.h
diff --git a/gdb/config/m88k.mt b/gdb/config/m88k.mt
deleted file mode 100644
index abb8c85..0000000
--- a/gdb/config/m88k.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Motorola 88000 Binary Compatability Standard
-TDEPFILES= m88k-tdep.o m88k-pinsn.o exec.o coredep.o
-TM_FILE= tm-m88k.h
diff --git a/gdb/config/merlin.mh b/gdb/config/merlin.mh
deleted file mode 100644
index 7cd492e..0000000
--- a/gdb/config/merlin.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Merlin running utek 2.1
-XDEPFILES= infptrace.o coredep.o
-XM_FILE= xm-merlin.h
-# See SHELL_FILE in m-merlin.h for a explanation of this.
-M_INSTALL=cp /bin/sh /usr/local/lib/gdb-sh; \
-chmod ogu+rw /usr/local/lib/gdb-sh
diff --git a/gdb/config/merlin.mt b/gdb/config/merlin.mt
deleted file mode 100644
index 25460e2..0000000
--- a/gdb/config/merlin.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Merlin running utek 2.1
-TDEPFILES= exec.o ns32k-pinsn.o
-TM_FILE= tm-merlin.h
diff --git a/gdb/config/mh-vax b/gdb/config/mh-vax
deleted file mode 100755
index cee0da1..0000000
--- a/gdb/config/mh-vax
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: DEC VAX running BSD or Ultrix
-# The following types of /bin/cc failures have been observed:
-# 1. Something in readline.c which I have never seen
-# 2. ``"values.c", line 816: compiler error: schain botch''
-#msg /bin/cc has been known to fail on VAXen running BSD4.3
-#msg If this occurs, use gcc
-#msg (but see comments in Makefile.dist about compiling with gcc).
-
-XDEPFILES= infptrace.o coredep.o
-XM_FILE= xm-vax.h
diff --git a/gdb/config/news.mh b/gdb/config/news.mh
deleted file mode 100644
index 3b7c950..0000000
--- a/gdb/config/news.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sony news series 700/800/900 (68020) running NewsOS version 3.
-XDEPFILES= infptrace.o coredep.o news-xdep.o
-XM_FILE= xm-news.h
diff --git a/gdb/config/news.mt b/gdb/config/news.mt
deleted file mode 100644
index f00779a..0000000
--- a/gdb/config/news.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sony news series 700/800/900 (68020) running NewsOS version 3.
-TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o
-TM_FILE= tm-news.h
diff --git a/gdb/config/news1000.mh b/gdb/config/news1000.mh
deleted file mode 100644
index 8388b35..0000000
--- a/gdb/config/news1000.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sony news series 1000 (68030) running NewsOS version 3.
-XDEPFILES= infptrace.o coredep.o news-xdep.o
-XM_FILE= xm-news1000.h
diff --git a/gdb/config/news1000.mt b/gdb/config/news1000.mt
deleted file mode 100644
index ca16e59..0000000
--- a/gdb/config/news1000.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sony news series 1000 (68030) running NewsOS version 3.
-TDEPFILES= m68k-pinsn.o exec.o
-TM_FILE= tm-news.h
diff --git a/gdb/config/nindy960.mt b/gdb/config/nindy960.mt
deleted file mode 100644
index 0751bd6..0000000
--- a/gdb/config/nindy960.mt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Target: Intel 80960, in an embedded system under the NINDY monitor
-TDEPFILES= exec.o i960-pinsn.o i960-tdep.o nindy-tdep.o remote-nindy.o nindy.o Onindy.o ttybreak.o ttyflush.o
-TM_FILE= tm-nindy960.h
-TM_CFLAGS=
diff --git a/gdb/config/none.mh b/gdb/config/none.mh
deleted file mode 100644
index 2a83347..0000000
--- a/gdb/config/none.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: "no target". This can be used to build you
-# a Makefile that only runs administrative commands like 'clean',
-# 'gdb.tar.Z', etc.
diff --git a/gdb/config/none.mt b/gdb/config/none.mt
deleted file mode 100644
index 9917e2b..0000000
--- a/gdb/config/none.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: "no target".
-# This can be used to build you a Makefile that only runs administrative
-# commands like 'clean', 'gdb.tar.Z', etc.
diff --git a/gdb/config/np1.mh b/gdb/config/np1.mh
deleted file mode 100644
index 8afa094..0000000
--- a/gdb/config/np1.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Gould NP1
-XDEPFILES= infptrace.o gould-xdep.o
-XM_FILE= xm-np1.h
diff --git a/gdb/config/np1.mt b/gdb/config/np1.mt
deleted file mode 100644
index 1a5d68b..0000000
--- a/gdb/config/np1.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Gould NP1
-TDEPFILES= exec.o gould-pinsn.o
-TM_FILE= tm-np1.h
diff --git a/gdb/config/pn.mh b/gdb/config/pn.mh
deleted file mode 100644
index 56c58f9..0000000
--- a/gdb/config/pn.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Gould Powernode
-XDEPFILES= infptrace.o coredep.o
-XM_FILE= xm-pn.h
diff --git a/gdb/config/pn.mt b/gdb/config/pn.mt
deleted file mode 100644
index e53ab9e..0000000
--- a/gdb/config/pn.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Gould Powernode
-TDEPFILES= exec.o gould-pinsn.o
-TM_FILE= tm-pn.h
diff --git a/gdb/config/pyramid.mh b/gdb/config/pyramid.mh
deleted file mode 100644
index 362a878..0000000
--- a/gdb/config/pyramid.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Host: Pyramid under OSx 4.0 (4.2bsd).
-
-#msg If you don't compile GDB with GCC, you'll need to add
-#msg ALLOCA=alloca.o and ALLOCA1=alloca.o to the Makefile.
-#msg
-
-XDEPFILES= pyr-xdep.o infptrace.o
-XM_FILE= xm-pyr.h
diff --git a/gdb/config/pyramid.mt b/gdb/config/pyramid.mt
deleted file mode 100644
index 40c8786..0000000
--- a/gdb/config/pyramid.mt
+++ /dev/null
@@ -1,7 +0,0 @@
-# Target: Pyramid under OSx 4.0 (4.2bsd).
-
-#msg Note that GDB on Pyramids only works with GCC,
-#msg at least for some programs.
-
-TDEPFILES= pyr-pinsn.o pyr-tdep.o exec.o
-TM_FILE= tm-pyr.h
diff --git a/gdb/config/rs6000.mh b/gdb/config/rs6000.mh
deleted file mode 100644
index 6f644b5..0000000
--- a/gdb/config/rs6000.mh
+++ /dev/null
@@ -1,22 +0,0 @@
-# Host machine: IBM RS/6000 running AIX 3.1.
-# Copyright (C) 1990, 1991 Free Software Foundation, Inc.
-
-# This file is part of GDB.
-
-# GDB 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 1, or (at your option)
-# any later version.
-
-# GDB 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 GDB; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-XDEPFILES= xcoffexec.o infptrace.o rs6000-xdep.o
-XM_FILE= xm-rs6000.h
-XM_CFLAGS = -bnodelcsect
diff --git a/gdb/config/rs6000.mt b/gdb/config/rs6000.mt
deleted file mode 100644
index 85441c7..0000000
--- a/gdb/config/rs6000.mt
+++ /dev/null
@@ -1,22 +0,0 @@
-# Target machine: AIX 3.1 on IBM RS/6000.
-# Copyright (C) 1991 Free Software Foundation, Inc.
-
-# This file is part of GDB.
-
-# GDB 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 1, or (at your option)
-# any later version.
-
-# GDB 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 GDB; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#TDEPFILES= exec.o rs6k-pinsn.o rs6k-tdep.o
-TDEPFILES= rs6000-pinsn.o rs6000-tdep.o
-TM_FILE= tm-rs6000.h
diff --git a/gdb/config/rtbsd.mh b/gdb/config/rtbsd.mh
deleted file mode 100644
index d6310db..0000000
--- a/gdb/config/rtbsd.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# IBM RT/PC running BSD unix.
-# This file contributed at NYU, where we are using the RT to remote
-# debug a 29k running unix. No attempt, as of 7/16/91, has been made
-# to support debugging of RT executables.
-XDEPFILES=coredep.o infptrace.o
-XM_CFLAGS=-DHOSTING_ONLY # No debugging of RT executables
-XM_FILE= xm-rtbsd.h
-CC=gcc -traditional # hc/pcc just can't cut it.
diff --git a/gdb/config/sun2os3.mh b/gdb/config/sun2os3.mh
deleted file mode 100644
index ea2fee6..0000000
--- a/gdb/config/sun2os3.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sun 2, running SunOS 3
-XDEPFILES= infptrace.o sun3-xdep.o
-XM_FILE= xm-sun2.h
diff --git a/gdb/config/sun2os3.mt b/gdb/config/sun2os3.mt
deleted file mode 100644
index bee830d..0000000
--- a/gdb/config/sun2os3.mt
+++ /dev/null
@@ -1,8 +0,0 @@
-# Target: Sun 2, running SunOS 3
-# The system-supplied assembler re-orders the symbols so that gdb
-# can't find "gcc_compiled.".
-#msg If you compile your program with GCC, use the GNU assembler.
-#msg
-
-TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
-TM_FILE= tm-sun2.h
diff --git a/gdb/config/sun2os4.mh b/gdb/config/sun2os4.mh
deleted file mode 100644
index ec614a6..0000000
--- a/gdb/config/sun2os4.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sun 2, running SunOS 4
-XDEPFILES= infptrace.o sun3-xdep.o
-XM_FILE= xm-sun2.h
diff --git a/gdb/config/sun2os4.mt b/gdb/config/sun2os4.mt
deleted file mode 100644
index 4443c5b..0000000
--- a/gdb/config/sun2os4.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sun 2, running SunOS 4
-TDEPFILES= exec.o m68k-pinsn.o solib.o m68k-tdep.o
-TM_FILE= tm-sun2os4.h
diff --git a/gdb/config/sun3.mh b/gdb/config/sun3.mh
deleted file mode 100644
index 4ec8d54..0000000
--- a/gdb/config/sun3.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sun 3, running SunOS 4
-XDEPFILES= infptrace.o sun3-xdep.o
-XM_FILE= xm-sun3os4.h
diff --git a/gdb/config/sun3.mt b/gdb/config/sun3.mt
deleted file mode 100644
index 9c93c56..0000000
--- a/gdb/config/sun3.mt
+++ /dev/null
@@ -1,8 +0,0 @@
-# Target: Sun 3, running SunOS 4, as a target system
-# The system-supplied assembler re-orders the symbols so that gdb
-# can't find "gcc_compiled.".
-#msg If you compile your program with GCC, use the GNU assembler.
-#msg
-
-TDEPFILES= exec.o m68k-pinsn.o solib.o m68k-tdep.o
-TM_FILE= tm-sun3os4.h
diff --git a/gdb/config/sun386.mh b/gdb/config/sun386.mh
deleted file mode 100644
index d03a06e..0000000
--- a/gdb/config/sun386.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sun 386i
-XDEPFILES= infptrace.o sun386-xdep.o
-XM_FILE= xm-sun386.h
diff --git a/gdb/config/sun386.mt b/gdb/config/sun386.mt
deleted file mode 100644
index 614df41..0000000
--- a/gdb/config/sun386.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sun 386i target configuration file.
-TDEPFILES= exec.o i386-pinsn.o solib.o
-TM_FILE= tm-sun386.h
diff --git a/gdb/config/sun3os3.mh b/gdb/config/sun3os3.mh
deleted file mode 100644
index adb908a..0000000
--- a/gdb/config/sun3os3.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sun 3, running SunOS 3
-XDEPFILES= infptrace.o sun3-xdep.o
-XM_FILE= xm-sun3.h
diff --git a/gdb/config/sun3os3.mt b/gdb/config/sun3os3.mt
deleted file mode 100644
index fa3c662..0000000
--- a/gdb/config/sun3os3.mt
+++ /dev/null
@@ -1,8 +0,0 @@
-# Target: Sun 3, running SunOS 3
-# The system-supplied assembler re-orders the symbols so that gdb
-# can't find "gcc_compiled.".
-#msg If you compile your program with GCC, use the GNU assembler.
-#msg
-
-TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o
-TM_FILE= tm-sun3.h
diff --git a/gdb/config/sun3os4.mh b/gdb/config/sun3os4.mh
deleted file mode 100644
index 4ec8d54..0000000
--- a/gdb/config/sun3os4.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sun 3, running SunOS 4
-XDEPFILES= infptrace.o sun3-xdep.o
-XM_FILE= xm-sun3os4.h
diff --git a/gdb/config/sun3os4.mt b/gdb/config/sun3os4.mt
deleted file mode 100644
index c249002..0000000
--- a/gdb/config/sun3os4.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sun 3, running SunOS 4, as a target system
-TDEPFILES= exec.o m68k-pinsn.o solib.o m68k-tdep.o
-TM_FILE= tm-sun3os4.h
diff --git a/gdb/config/sun4.mh b/gdb/config/sun4.mh
deleted file mode 100644
index d83d0ed..0000000
--- a/gdb/config/sun4.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sun 4 or Sparcstation, running SunOS 4
-XDEPFILES= infptrace.o sparc-xdep.o
-XM_FILE= xm-sun4os4.h
diff --git a/gdb/config/sun4.mt b/gdb/config/sun4.mt
deleted file mode 100644
index 39928b8..0000000
--- a/gdb/config/sun4.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sun 4 or Sparcstation, running SunOS 4
-TDEPFILES= exec.o sparc-tdep.o sparc-pinsn.o solib.o
-TM_FILE= tm-sun4os4.h
diff --git a/gdb/config/sun4os3.mh b/gdb/config/sun4os3.mh
deleted file mode 100644
index 742c9cb..0000000
--- a/gdb/config/sun4os3.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sun 4 or Sparcstation, running SunOS 3
-XDEPFILES= infptrace.o sparc-xdep.o
-XM_FILE= xm-sparc.h
diff --git a/gdb/config/sun4os3.mt b/gdb/config/sun4os3.mt
deleted file mode 100644
index b1890e8..0000000
--- a/gdb/config/sun4os3.mt
+++ /dev/null
@@ -1,8 +0,0 @@
-# Target: Sun 4 or Sparcstation, running SunOS 3
-# The system-supplied assembler re-orders the symbols so that gdb
-# can't find "gcc_compiled.".
-#msg If you compile your program with GCC, use the GNU assembler.
-#msg
-
-TDEPFILES= exec.o sparc-tdep.o sparc-pinsn.o
-TM_FILE= tm-sparc.h
diff --git a/gdb/config/sun4os4.mh b/gdb/config/sun4os4.mh
deleted file mode 100644
index d83d0ed..0000000
--- a/gdb/config/sun4os4.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sun 4 or Sparcstation, running SunOS 4
-XDEPFILES= infptrace.o sparc-xdep.o
-XM_FILE= xm-sun4os4.h
diff --git a/gdb/config/sun4os4.mt b/gdb/config/sun4os4.mt
deleted file mode 100644
index 39928b8..0000000
--- a/gdb/config/sun4os4.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sun 4 or Sparcstation, running SunOS 4
-TDEPFILES= exec.o sparc-tdep.o sparc-pinsn.o solib.o
-TM_FILE= tm-sun4os4.h
diff --git a/gdb/config/symmetry.mh b/gdb/config/symmetry.mh
deleted file mode 100644
index 562afa6..0000000
--- a/gdb/config/symmetry.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
-XDEPFILES= infptrace.o symm-xdep.o
-XM_FILE= xm-symmetry.h
diff --git a/gdb/config/symmetry.mt b/gdb/config/symmetry.mt
deleted file mode 100644
index e241993..0000000
--- a/gdb/config/symmetry.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
-TDEPFILES= symm-tdep.o i386-pinsn.o
-TM_FILE= tm-symmetry.h
diff --git a/gdb/config/tahoe.mh b/gdb/config/tahoe.mh
deleted file mode 100644
index 6b3a6bb..0000000
--- a/gdb/config/tahoe.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: CCI or Harris Tahoe running BSD Unix
-XDEPFILES= infptrace.o coredep.o
-REGEX=regex.o
-REGEX1=regex.o
-XM_FILE= xm-tahoe.h
diff --git a/gdb/config/tahoe.mt b/gdb/config/tahoe.mt
deleted file mode 100644
index 9527900..0000000
--- a/gdb/config/tahoe.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: CCI or Harris Tahoe running BSD Unix
-TDEPFILES= tahoe-pinsn.o exec.o
-TM_FILE= tm-tahoe.h
diff --git a/gdb/config/ultra3.mh b/gdb/config/ultra3.mh
deleted file mode 100644
index d7b227f..0000000
--- a/gdb/config/ultra3.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: NYU Ultracomputer (AMD 29000 running Unix)
-CC=u3cc
-MUNCH_DEFINE="MUNCH_NM=u3nm"
-XDEPFILES= ultra3-xdep.o infptrace.o
-XM_FILE= xm-ultra3.h
-XM_CFLAGS = -DSYM1
-XM_CLIBS = -lsysv -ljobs -ltermlib
diff --git a/gdb/config/ultra3.mt b/gdb/config/ultra3.mt
deleted file mode 100644
index d2d3876..0000000
--- a/gdb/config/ultra3.mt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Target: AMD 29000 running Unix on New York Univerisity processor board.
-TDEPFILES= exec.o am29k-pinsn.o am29k-tdep.o
-TM_FILE= tm-ultra3.h
-# SYM1 is some OS they have.
-TM_CFLAGS = -DSYM1
diff --git a/gdb/config/umax.mh b/gdb/config/umax.mh
deleted file mode 100644
index 77eebaa..0000000
--- a/gdb/config/umax.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: Encore running umax 4.2
-XDEPFILES= infptrace.o umax-xdep.o
-XM_FILE= xm-umax.h
diff --git a/gdb/config/umax.mt b/gdb/config/umax.mt
deleted file mode 100644
index afaaeaa..0000000
--- a/gdb/config/umax.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Encore running umax 4.2
-TDEPFILES= exec.o ns32k-pinsn.o
-TM_FILE= tm-umax.h
diff --git a/gdb/config/vax.mt b/gdb/config/vax.mt
deleted file mode 100644
index ca4d36b..0000000
--- a/gdb/config/vax.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: DEC VAX running BSD or Ultrix
-TDEPFILES= vax-pinsn.o exec.o
-TM_FILE= tm-vax.h
diff --git a/gdb/config/vxworks68.mt b/gdb/config/vxworks68.mt
deleted file mode 100644
index 92791c5..0000000
--- a/gdb/config/vxworks68.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: VxWorks running on a 68000
-TDEPFILES= exec.o m68k-pinsn.o m68k-tdep.o remote-vx.o xdr_ld.o xdr_ptrace.o xdr_rdb.o xdr_regs.o
-TM_FILE= tm-vx68.h
diff --git a/gdb/config/vxworks960.mt b/gdb/config/vxworks960.mt
deleted file mode 100644
index 3f3c059..0000000
--- a/gdb/config/vxworks960.mt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Target: VxWorks running on an Intel 960
-TDEPFILES= exec.o i960-pinsn.o i960-tdep.o remote-vx.o xdr_ld.o xdr_ptrace.o xdr_rdb.o xdr_regs.o
-TM_FILE= tm-vx960.h
-# Define this for the vx-share routines, which don't see param.h.
-TM_CFLAGS= -DI80960
diff --git a/gdb/configure b/gdb/configure
deleted file mode 100755
index 5b73541..0000000
--- a/gdb/configure
+++ /dev/null
@@ -1,882 +0,0 @@
-#!/bin/sh
-
-# Configuration script
-# Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
-
-#This file is part of GNU.
-
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-# $Id$
-
-#
-# Shell script to create proper links to machine-dependent files in
-# preparation for compilation.
-#
-# If configure succeeds, it leaves its status in config.status.
-# If configure fails after disturbing the status quo,
-# config.status is removed.
-#
-
-remove=rm
-hard_link=ln
-symbolic_link='ln -s'
-
-#for Test
-#remove="echo rm"
-#hard_link="echo ln"
-#symbolic_link="echo ln -s"
-
-progname=$0
-
-# clear some things potentially inherited from environment.
-ansi=
-arguments=$*
-defaulttargets=
-destdir=
-fatal=
-hostsubdir=
-Makefile=Makefile
-Makefile_in=Makefile.in
-norecursion=
-recurring=
-removing=
-srcdir=
-srctrigger=
-target=
-targets=
-commontargets=
-configdirs=
-targetsubdir=
-template=
-verbose=
-
-for arg in $*;
-do
- case ${arg} in
- -ansi | +a*)
- ansi=true
- clib=clib
- ;;
- -destdir=* | +destdir=* | +destdi=* | +destd=* | +dest=* | +des=* | +de=* | +d=*)
- destdir=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
- ;;
- -languages=* | +languages=* | +language=* | +languag=* \
- | +langua=* | +langu=* | +lang=* | +lan=* | +la=* \
- | +l=*)
- languages="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
- ;;
- -gas | +g*)
- gas=yes
- ;;
- -help | +h*)
- fatal=true
- ;;
- -nfp | +nf*)
- nfp=yes
- ;;
- -norecursion | +no*)
- norecursion=true
- ;;
- -recurring | +recurring | +recurrin | +recurri | +recurr | +recur | +recu | +rec | +re)
- recurring=true
- ;;
- -rm | +rm)
- removing=${arg}
- ;;
-# -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
-# srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
-# ;;
- -subdirs | +f* | +su*)
- subdirs=${arg}
- ;;
- -target=* | +target=* | +targe=* | +targ=* | +tar=* | +ta=*)
- if [ -n "${targets}" ] ; then
- subdirs="+subdirs"
- fi
-
- newtargets="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
- targets="${newtargets}"
- ;;
- -template=* | +template=* | +templat=* | +templa=* | +templ=* | +temp=* | +tem=* | +te=*)
- template=`echo ${arg} | sed 's/[+-]template=//'`
- ;;
- -v | -verbose | +v*)
- verbose=${arg}
- ;;
- -* | +*)
- (echo ;
- echo "Unrecognized option: \"${arg}\"". ;
- echo) 1>&2
- fatal=true
- ;;
- *)
- if [ -n "${hosts}" ] ; then
- subdirs="+subdirs"
- fi
-
- newhosts="${hosts} ${arg}"
- hosts=${newhosts}
- ;;
- esac
-done
-
-if [ -n "${verbose}" ] ; then
- echo `pwd`/configure $*
-fi
-
-# process host and target only if not rebuilding configure itself or removing.
-if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then
- # Complain if an arg is missing
- if [ -z "${hosts}" ] ; then
- (echo ;
- echo "configure: No HOST specified." ;
- echo) 1>&2
- fatal=true
- fi
-fi
-
-if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
- (echo "Usage: configure HOST" ;
- echo ;
- echo "Options: [defaults in brackets]" ;
- echo " +ansi configure w/ANSI library. [no ansi lib]" ;
- echo " +destdir=MYDIR configure for installation into MYDIR. [/usr/local]" ;
- echo " +subdirs configure in subdirectories. [in source directories]" ;
- echo " +lang=LANG configure to build LANG. [gcc]" ;
- echo " +help print this message. [normal config]" ;
- echo " +gas configure the compilers for use with gas. [native as]" ;
- echo " +nfp configure the compilers default to soft floating point. [hard float]" ;
- echo " +norecursion configure this directory only. [recurse]" ;
- echo " +rm remove this configuration. [build a configuration]" ;
- echo " +target=TARGET configure for TARGET. [TARGET = HOST]" ;
- echo " +template=TEM rebuild configure using TEM. [normal config]" ;
- echo ;
- echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
- echo "Asking for more than one \"+target\" implies \"+subdirs\". Any other" ;
- echo "options given will apply to all targets.") 1>&2
-
- if [ -r config.status ] ; then
- cat config.status
- fi
-
- exit 1
-fi
-
-#### configure.in common parts come in here.
-srcname="GDB"
-srctrigger=main.c
-
-## end of common part.
-
-# are we rebuilding config itself?
-if [ -n "${template}" ] ; then
- if [ ! -r ${template} ] ; then
- echo '***' "Can't find template ${template}." 1>&2
- exit 1
- fi
-
-# prep the template
- sed -e '/^#### configure.in common parts come in here.$/,/^## end of common part.$/c\
-#### configure.in common parts come in here.\
-## end of common part.' \
- -e '/^#### configure.in per-host parts come in here.$/,/^## end of per-host part.$/c\
-#### configure.in per-host parts come in here.\
-## end of per-host part.' \
- -e '/^#### configure.in per-target parts come in here.$/,/^## end of per-target part.$/c\
-#### configure.in per-target parts come in here.\
-## end of per-target part.' \
- -e '/^#### configure.in post-target parts come in here.$/,/^## end of post-target part.$/c\
-#### configure.in post-target parts come in here.\
-## end of post-target part.' \
- < ${template} > template.new
-
- if [ -r configure.in ] ; then
- if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
- echo '***' `pwd`/configure.in has no "per-host:" line. 1>&2
- exit 1
- fi
-
- if [ -z "`grep '^# per\-target:' configure.in`" ] ; then
- echo '***' `pwd`/configure.in has no "per-target:" line. 1>&2
- exit 1
- fi
-
- # split configure.in into common, per-host, per-target,
- # and post-target parts. Post-target is optional.
- sed -e '/^# per\-host:/,$d' configure.in > configure.com
- sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.in > configure.hst
- if grep -s '^# post-target:' configure.in ; then
- sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' configure.in > configure.tgt
- sed -e '1,/^# post\-target:/d' configure.in > configure.pos
- else
- sed -e '1,/^# per\-target:/d' configure.in > configure.tgt
- echo >configure.pos
- fi
-
- # and insert them
- sed -e '/^#### configure.in common parts come in here.$/ r configure.com' \
- -e '/^#### configure.in per\-host parts come in here.$/ r configure.hst' \
- -e '/^#### configure.in per\-target parts come in here.$/ r configure.tgt' \
- -e '/^#### configure.in post\-target parts come in here.$/ r configure.pos' \
- template.new > configure.new
-
- rm -f configure.com configure.tgt configure.hst configure.pos
- else
- echo Warning: no configure.in in `pwd`
- cat ${template} >> configure
- fi
-
- chmod a+x configure.new
- rm template.new
-# mv configure configure.old
- mv configure.new configure
-
- if [ -n "${verbose}" ] ; then
- echo Rebuilt configure in `pwd`
- fi
-
- # Now update config.sub from the template directory.
- if echo "$template" | grep -s 'configure$' ; then
- cp `echo "$template" | sed s/configure$/config.sub/` ./config.sub.new
- # mv config.sub config.sub.old
- mv config.sub.new config.sub
-
- if [ -n "${verbose}" ] ; then
- echo Rebuilt config.sub in `pwd`
- fi
- fi
-
- if [ -z "${norecursion}" ] ; then
- # If template is relative path, make it absolute for recurring.
- if echo "${template}" | grep -s '^/' ; then
- true
- else
- template=`pwd`/${template}
- fi
-
- while [ -n "${configdirs}" ] ; do
- # set configdir to car of configdirs, configdirs to cdr of configdirs
- set ${configdirs}; configdir=$1; shift; configdirs=$*
-
- if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then
- targetspecificdirs=${configdir}.*
- else
- targetspecificdirs=
- fi
-
- for i in ${configdir} ${targetspecificdirs} ; do
- if [ -d $i ] ; then
- if [ -r $i/configure ] ; then
- (cd $i ;
- ./configure +template=${template} ${verbose})
- else
- echo Warning: No configure script in `pwd`/$i
- fi
- else
- if [ -n "${verbose}" ] ; then
- echo Warning: directory $i is missing.
- fi
- fi
- done
- done
- fi
-
- exit 0
-fi
-
-# some sanity checks on configure.in
-if [ -z "${srctrigger}" ] ; then
- echo Warning: srctrigger not set in configure.in. `pwd` not configured.
- exit 1
-fi
-
-for host in ${hosts} ; do
- # Default other arg
- if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
- targets=${host}
- defaulttargets=true
- fi
-
- host_alias=${host}
-
- result=`/bin/sh ./config.sub ${host}`
- host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- host=${host_cpu}-${host_vendor}-${host_os}
- host_makefile_frag=config/hmake-${host}
-
-#### configure.in per-host parts come in here.
-
-# map host info into gdb names.
-
-case "${host_cpu}" in
-
-m68k)
- case "${host_vendor}" in
- att) gdb_host=3b1 ;;
- altos)
- case "${host_os}" in
- gas) gdb_host=altosgas ;;
- *) gdb_host=altos ;;
- esac
- ;;
- hp)
- case ${host_os} in
- hpux) gdb_host=hp300hpux ;;
- bsd) gdb_host=hp300bsd ;;
- esac
- ;;
-
- isi) gdb_host=isi ;;
- sony) gdb_host=news ;;
- sun)
- case "${host_os}" in
- sunos3) gdb_host=sun3os3 ;;
- sunos4) gdb_host=sun3os4 ;;
- *) gdb_host=sun3 ;;
- esac
- ;;
- esac
- ;;
-
-m68000)
- case "${host_vendor}" in
- sun)
- case "${host_os}" in
- sunos3) gdb_host=sun2os3 ;;
- sunos4) gdb_host=sun2os4 ;;
- *) gdb_host=sun2 ;;
- esac
- esac
- ;;
-
-sparc)
- case "${host_os}" in
- sunos3) gdb_host=sun4os3 ;;
- sunos4) gdb_host=sun4os4 ;;
- *) gdb_host=sun4 ;;
- esac
- ;;
-
-m68030)
- case "${host_vendor}" in
- sony) gdb_host=news1000 ;;
- esac
- ;;
-
-mips)
- case "${host_vendor}" in
- sony) gdb_host=bigmips ;;
- dec) gdb_host=dec3100 ;;
- little) gdb_host=littlemips ;;
- sgi) gdb_host=irix3 ;;
- esac
- ;;
-
-i386)
- case "${host_vendor}" in
- sun) gdb_host=sun386 ;;
- sco) gdb_host=i386sco ;;
- sequent) gdb_host=symmetry ;;
- *)
- case "${host_os}" in
- sysv) gdb_host=i386v ;;
- sysv32) gdb_host=i386v32 ;;
- esac
- ;;
- esac
- ;;
-
-c1 | c2) gdb_host=convex ;;
-
-ns32k)
- case "${host_vendor}" in
- umax) gdb_host=umax ;;
- esac
- ;;
-
-romp)
- gdb_host=rtbsd
- ;;
-
-a29k)
- gdb_host=ultra3
- ;;
-
-arm | vax | m88k | merlin | none | np1 | pn | pyramid | tahoe)
- gdb_host=${host_cpu}
- ;;
-
-### unhandled hosts
-#altosgas
-#i386v-g
-#i386v32-g
-
-esac
-
-if [ ! -f xconfig/${gdb_host} ]; then
- echo '***' "Gdb does not support host ${host}" 1>&2
- exit 1
-fi
-
-# We really shouldn't depend on there being a space after XM_FILE= ...
-hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <xconfig/${gdb_host}`
-
-## end of per-host part.
-
- for target in ${targets} ; do
-
- target_alias=${target}
- result=`/bin/sh ./config.sub ${target}`
- target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- target=${target_cpu}-${target_vendor}-${target_os}
- target_makefile_frag=config/tmake-${target}
-
-#### configure.in per-target parts come in here.
-
-case "${target_cpu}" in
-
-m68k)
- case "${target_vendor}" in
- att) gdb_target=3b1 ;;
- altos) gdb_target=altos ;;
- hp)
- case "${target_os}" in
- bsd) gdb_target=hp300bsd ;;
- hpux) gdb_target=hp300hpux ;;
- esac
- ;;
- sun)
- case "${target_os}" in
- sunos3) gdb_target=sun3os3 ;;
- sunos4) gdb_target=sun3os4 ;;
- *) gdb_target=sun3 ;;
- esac
- ;;
- wrs) gdb_target=vxworks68 ;;
- isi) gdb_target=isi ;;
- sony) gdb_target=news ;;
- esac
- ;;
-
-m68000)
- case "${target_vendor}" in
- sun)
- case "${target_os}" in
- sunos3) gdb_target=sun2os3 ;;
- sunos4) gdb_target=sun2os4 ;;
- *) gdb_target=sun2 ;;
- esac
- esac
- ;;
-
-m68030)
- case "${target_vendor}" in
- sony) gdb_target=news1000 ;;
- esac
- ;;
-
-none | arm | tahoe | vax | np1 | pn | np1 | pn | pyramid | merlin | m88k)
- gdb_target=${target_cpu} ;;
-
-a29k)
- case "${target_os}" in
- none|aout|coff) gdb_target=a29k ;;
- sym1) gdb_target=ultra3 ;;
- kern) gdb_target=a29k-kern ;;
- esac
- ;;
-
-mips)
- case "${target_vendor}" in
- sony) gdb_target=bigmips ;;
- dec) gdb_target=dec3100 ;;
- little) gdb_target=littlemips ;;
- sgi) gdb_target=irix3 ;;
- esac
- ;;
-
-c1 | c2) gdb_target=convex ;;
-
-sparc)
- case "${target_vendor}" in
- sun)
- case "${target_os}" in
- sunos3) gdb_target=sun4os3 ;;
- sunos4) gdb_target=sun4os4 ;;
- *) gdb_target=sun4 ;;
- esac
- ;;
- esac
- ;;
-
-
-i386)
- case "${target_vendor}" in
- sco) gdb_target=i386sco ;;
- sun) gdb_target=sun386 ;;
- sequent) gdb_target=symmetry ;;
- coff) gdb_target=i386v ;;
- aout) gdb_target=i386v ;;
- *)
- case "${target_os}" in
- sysv) gdb_target=i386v ;;
- sysv32) gdb_target=i386v32 ;;
- esac
- esac
- ;;
-
-i960)
- case "${target_vendor}" in
- bout | wrs) gdb_target=vxworks960 ;;
- coff | intel) gdb_target=nindy960 ;;
- esac
- ;;
-
-ns32k)
- case "${target_vendor}" in
- utek) gdb_target=umax ;;
- esac
- ;;
-
-### unhandled targets
-# altosgas
-# i386v-g
-# i386v32-g
-
-esac
-
-if [ ! -f tconfig/${gdb_target} ]; then
- echo '***' "Gdb does not support target ${target}" 1>&2
- exit 1
-fi
-
-if [ -z "${removing}" ] ; then
- cat xconfig/${gdb_host} tconfig/${gdb_target} | awk '$1 == "#msg" {
- print substr($0,6)}'
-fi
-
-# We really shouldn't depend on there being a space after TM_FILE= ...
-targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <tconfig/${gdb_target}`
-
-host_makefile_frag=xconfig/${gdb_host}
-target_makefile_frag=tconfig/${gdb_target}
-
-# If hostfile (XM_FILE) and/or targetfile (TM_FILE) is not set in the
-# ?config/* file, we don't make the corresponding links. But we have
-# to remove the xm.h files and tm.h files anyway, e.g. when switching
-# from "configure host" to "configure none".
-files=
-links=
-rm -f xm.h
-if [ "${hostfile}" != "" ]; then
- files="${files} ${hostfile}"
- links="${links} xm.h"
-fi
-rm -f tm.h
-if [ "${targetfile}" != "" ]; then
- files="${files} ${targetfile}"
- links="${links} tm.h"
-fi
-
-## end of per-target part.
-
- # Temporarily, we support only direct subdir builds.
- hostsubdir=H-${host_alias}
- targetsubdir=T-${target_alias}
-
- if [ -n "${removing}" ] ; then
- if [ -n "${subdirs}" ] ; then
- if [ -d "${hostsubdir}" ] ; then
- rm -rf ${hostsubdir}/${targetsubdir}
-
- if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target- | grep -v Target-independent`" ] ; then
- rm -rf ${hostsubdir}
- fi
- else
- echo Warning: no `pwd`/${hostsubdir} to remove.
- fi
- else
- rm -f ${Makefile} config.status ${links}
- fi
- else
- if [ -n "${subdirs}" ] ; then
- # check for existing status before allowing forced subdirs.
- if [ -f ${Makefile} ] ; then
- echo '***' "${Makefile} already exists in source directory. `pwd` not configured." 1>&2
- exit 1
- fi
-
- if [ ! -d ${hostsubdir} ] ; then mkdir ${hostsubdir} ; fi
- cd ${hostsubdir}
-
- if [ ! -d ${targetsubdir} ] ; then
- if [ -z "${commontargets}" ] ; then
- mkdir ${targetsubdir}
- else
- if [ ! -d Target-independent ] ; then
- mkdir Target-independent
- fi
-
- ${symbolic_link} Target-independent ${targetsubdir}
- fi # if target independent
- fi # if no target dir yet
-
- cd ${targetsubdir}
-
- srcdir=../..
- else
- # if not subdir builds, then make sure none exist.
- if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then
- echo '***' "Configured subdirs exist. `pwd` not configured." 1>&2
- exit 1
- fi
- fi
-
- # Find the source files, if location was not specified.
- if [ -z "${srcdir}" ] ; then
- srcdirdefaulted=1
- srcdir=.
- if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
- srcdir=..
- fi
- fi
-
- if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
- if [ -z "${srcdirdefaulted}" ] ; then
- echo '***' "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2
- else
- echo '***' "${progname}: Can't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2
- fi
-
- echo '***' \(At least ${srctrigger} is missing.\) 1>&2
- exit 1
- fi
-
- # Set up the list of links to be made.
- # ${links} is the list of link names, and ${files} is the list of names to link to.
-
- # Make the links.
- while [ -n "${files}" ] ; do
- # set file to car of files, files to cdr of files
- set ${files}; file=$1; shift; files=$*
- set ${links}; link=$1; shift; links=$*
-
- if [ ! -r ${srcdir}/${file} ] ; then
- echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
- echo '***' "since the file \"${file}\" does not exist." 1>&2
- exit 1
- fi
-
- ${remove} -f ${link}
- rm -f config.status
- # Make a symlink if possible, otherwise try a hard link
- ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
-
- if [ ! -r ${link} ] ; then
- echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
- exit 1
- fi
-
- if [ -n "${verbose}" ] ; then
- echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
- fi
- done
-
- # Create a .gdbinit file which runs the one in srcdir
- # and tells GDB to look there for source files.
-
- case ${srcdir} in
- .)
- ;;
- *)
- echo "dir ." > .gdbinit
- echo "dir ${srcdir}" >> .gdbinit
- echo "source ${srcdir}/.gdbinit" >> .gdbinit
- ;;
- esac
-
- # Install a makefile, and make it set VPATH
- # if necessary so that the sources are found.
- # Also change its value of srcdir.
-
- # FIXME-someday: This business of always writing to .tem and mv back
- # is so that I don't screw things up while developing. Once this
- # template is stable, these should be optimized. xoxorich.
-
- # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
- if [ "${host}" != "${target}" ] ; then
- echo "CROSS=-DCROSS_COMPILE" > ${Makefile}
- echo "ALL=start.encap" >> ${Makefile}
- else
- echo "ALL=all.internal" > ${Makefile}
- fi
-
- # set target, host, VPATH
- echo "host_alias = ${host_alias}" >> ${Makefile}
- echo "host_cpu = ${host_cpu}" >> ${Makefile}
- echo "host_vendor = ${host_vendor}" >> ${Makefile}
- echo "host_os = ${host_os}" >> ${Makefile}
-
- echo "target_alias = ${target_alias}" >> ${Makefile}
- echo "target_cpu = ${target_cpu}" >> ${Makefile}
- echo "target_vendor = ${target_vendor}" >> ${Makefile}
- echo "target_os = ${target_os}" >> ${Makefile}
-
- if [ -n "${subdirs}" ] ; then
- echo "subdir = /${hostsubdir}/${targetsubdir}" >> ${Makefile}
- else
- echo "subdir =" >> ${Makefile}
- fi
-
- # echo "workdir = `pwd`" >> ${Makefile}
- echo "VPATH = ${srcdir}" >> ${Makefile}
-
- # add "Makefile.in" (or whatever it's called)
- cat ${srcdir}/${Makefile_in} >> ${Makefile}
-
- # Conditionalize the makefile for this host.
- if [ -f ${srcdir}/${host_makefile_frag} ] ; then
- (echo "host_makefile_frag = ${srcdir}/${host_makefile_frag}" ;
- sed -e "/^####/ r ${srcdir}/${host_makefile_frag}" ${Makefile}) > Makefile.tem
- mv Makefile.tem ${Makefile}
- fi
-
- # Conditionalize the makefile for this target.
- if [ -f ${srcdir}/${target_makefile_frag} ] ; then
- (echo "target_makefile_frag = ${srcdir}/${target_makefile_frag}" ;
- sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" ${Makefile}) > Makefile.tem
- mv Makefile.tem ${Makefile}
- fi
-
- # set srcdir
- sed "s@^srcdir = \.@srcdir = ${srcdir}@" ${Makefile} > Makefile.tem
- mv Makefile.tem ${Makefile}
-
- # set destdir
- if [ -n "${destdir}" ] ; then
- sed "s:^destdir =.*$:destdir = ${destdir}:" ${Makefile} > Makefile.tem
- mv Makefile.tem ${Makefile}
- fi
-
- # reset SUBDIRS
- sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" ${Makefile} > Makefile.tem
- mv Makefile.tem ${Makefile}
-
- # reset NONSUBDIRS
- sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" ${Makefile} > Makefile.tem
- mv Makefile.tem ${Makefile}
-
- using=
- if [ -f ${srcdir}/${host_makefile_frag} ] ; then
- using=" using \"${host_makefile_frag}\""
- fi
-
- # remove any form feeds.
- sed -e "s/ //" ${Makefile} > Makefile.tem
- mv Makefile.tem ${Makefile}
-
- if [ -f ${srcdir}/${target_makefile_frag} ] ; then
- if [ -z "${using}" ] ; then
- andusing=" using \"${target_makefile_frag}\""
- else
- andusing="${using} and \"${target_makefile_frag}\""
- fi
- else
- andusing=${using}
- fi
-
- if [ -n "${verbose}" -o -z "${recurring}" ] ; then
- echo "Created \"${Makefile}\"" in `pwd`${andusing}.
- fi
-
-#### configure.in post-target parts come in here.
-
-case ${srcdir} in
- .)
- ;;
- *)
- grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \
- echo "source ${srcdir}/.gdbinit" >> .gdbinit
-esac
-
-cat ${srcdir}/alldeps.mak ${srcdir}/depend >>Makefile
-## end of post-target part.
-
- # describe the chosen configuration in config.status.
- # Make that file a shellscript which will reestablish
- # the same configuration. Used in Makefiles to rebuild
- # Makefiles.
-
- echo "#!/bin/sh
-# ${srcname} was configured as follows:
-${srcdir}/configure" ${arguments} `if [ -z "${norecursion}" ] ; then echo +norecursion ; else true ; fi` > config.status
- chmod a+x config.status
-
- originaldir=`pwd`
- cd ${srcdir}
- fi
-
- # If there are subdirectories, then recurse.
- if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
- for configdir in ${configdirs} ; do
- if [ -n "${verbose}" ] ; then
- echo Configuring ${configdir}...
- fi
-
- if [ -d ${configdir} ] ; then
- (cd ${configdir} ;
- ./configure +recurring ${host_alias} +target=${target_alias} \
- ${verbose} ${subdirs} ${removing} +destdir=${destdir}) \
- | sed 's/^/ /'
- else
- if [ -n "${verbose}" ] ; then
- echo Warning: directory \"${configdir}\" is missing.
- fi
- fi
- done
- fi
- done # for each target
-
- # Now build a Makefile for this host.
- if [ -n "${subdirs}" -a ! -n "${removing}" ] ; then
- cd ${hostsubdir}
- cat > GNUmakefile << E!O!F
-# Makefile generated by configure for host ${host_alias}.
-
-ALL := $(shell ls -d Target-*)
-
-%:
- $(foreach subdir,$(ALL),$(MAKE) -C $(subdir) \$@ &&) true
-
-all:
-E!O!F
- cd ..
- fi
-done # for each host
-
-exit 0
-
-#
-# Local Variables:
-# fill-column: 131
-# End:
-#
-
-# end of configure
diff --git a/gdb/configure.in b/gdb/configure.in
deleted file mode 100644
index ce82cf2..0000000
--- a/gdb/configure.in
+++ /dev/null
@@ -1,319 +0,0 @@
-configdirs="doc"
-srcname="GDB"
-srctrigger=main.c
-# per-host:
-
-# map host info into gdb names.
-
-case "${host_cpu}" in
-
-m68k)
- case "${host_vendor}" in
- att) gdb_host=3b1 ;;
- altos)
- case "${host_os}" in
- gas) gdb_host=altosgas ;;
- *) gdb_host=altos ;;
- esac
- ;;
-
- cbm)
- case ${host_os} in
- amigados) gdb_host=amigados ;;
- svr4) gdb_host=amix ;;
- esac
- ;;
-
- hp)
- case ${host_os} in
- hpux) gdb_host=hp300hpux ;;
- bsd) gdb_host=hp300bsd ;;
- esac
- ;;
-
- isi) gdb_host=isi ;;
- sony) gdb_host=news ;;
- sun)
- case "${host_os}" in
- sunos3) gdb_host=sun3os3 ;;
- sunos4) gdb_host=sun3os4 ;;
- *) gdb_host=sun3 ;;
- esac
- ;;
- esac
- ;;
-
-m68000)
- case "${host_vendor}" in
- sun)
- case "${host_os}" in
- sunos3) gdb_host=sun2os3 ;;
- sunos4) gdb_host=sun2os4 ;;
- *) gdb_host=sun2 ;;
- esac
- esac
- ;;
-
-sparc)
- case "${host_os}" in
- sunos3) gdb_host=sun4os3 ;;
- sunos4) gdb_host=sun4os4 ;;
- *) gdb_host=sun4 ;;
- esac
- ;;
-
-m68030)
- case "${host_vendor}" in
- sony) gdb_host=news1000 ;;
- esac
- ;;
-
-mips)
- case "${host_vendor}" in
- sony) gdb_host=bigmips ;;
- dec) gdb_host=decstation ;;
- little) gdb_host=littlemips ;;
- sgi) gdb_host=irix3 ;;
- esac
- ;;
-
-i386)
- case "${host_vendor}" in
- sun) gdb_host=sun386 ;;
- sco) gdb_host=i386sco ;;
- sequent) gdb_host=symmetry ;;
- *)
- case "${host_os}" in
- sysv) gdb_host=i386v ;;
- sysv32) gdb_host=i386v32 ;;
- mach) gdb_host=i386mach ;;
- esac
- ;;
- esac
- ;;
-
-c1 | c2) gdb_host=convex ;;
-
-ns32k)
- case "${host_vendor}" in
- umax) gdb_host=umax ;;
- esac
- ;;
-
-romp)
- gdb_host=rtbsd
- ;;
-
-rs6000)
- gdb_host=rs6000
- ;;
-
-a29k)
- gdb_host=ultra3
- ;;
-
-m88k)
- case "${host_vendor}" in
- motorola)
- gdb_host=delta88 ;;
- *)
- gdb_host=m88k ;;
- esac
- ;;
-
-arm | vax | merlin | none | np1 | pn | pyramid | tahoe)
- gdb_host=${host_cpu}
- ;;
-
-### unhandled hosts
-#altosgas
-#i386v-g
-#i386v32-g
-
-esac
-
-
-if [ ! -f xconfig/${gdb_host} ]; then
- echo '***' "Gdb does not support host ${host}" 1>&2
- exit 1
-fi
-
-# We really shouldn't depend on there being a space after XM_FILE= ...
-hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <xconfig/${gdb_host}`
-
-# per-target:
-
-case "${target_cpu}" in
-
-m68k)
- case "${target_vendor}" in
- att) gdb_target=3b1 ;;
- altos) gdb_target=altos ;;
- cbm)
- case ${target_os} in
- amigados) gdb_host=amigados ;;
- svr4) gdb_target=amix ;;
- esac
- ;;
- hp)
- case "${target_os}" in
- bsd) gdb_target=hp300bsd ;;
- hpux) gdb_target=hp300hpux ;;
- esac
- ;;
- sun)
- case "${target_os}" in
- sunos3) gdb_target=sun3os3 ;;
- sunos4) gdb_target=sun3os4 ;;
- *) gdb_target=sun3 ;;
- esac
- ;;
- wrs) gdb_target=vxworks68 ;;
- isi) gdb_target=isi ;;
- sony) gdb_target=news ;;
- esac
- ;;
-
-m68000)
- case "${target_vendor}" in
- sun)
- case "${target_os}" in
- sunos3) gdb_target=sun2os3 ;;
- sunos4) gdb_target=sun2os4 ;;
- *) gdb_target=sun2 ;;
- esac
- esac
- ;;
-
-m68030)
- case "${target_vendor}" in
- sony) gdb_target=news1000 ;;
- esac
- ;;
-
-none | arm | tahoe | vax | np1 | pn | np1 | pn | pyramid | merlin)
- gdb_target=${target_cpu} ;;
-
-m88k)
- case "${target_vendor}" in
- motorola) gdb_target=delta88 ;;
- *) gdb_target=dgux ;;
- esac
- ;;
-a29k)
- case "${target_os}" in
- none|aout|coff) gdb_target=a29k ;;
- sym1) gdb_target=ultra3 ;;
- kern) gdb_target=a29k-kern ;;
- ebmon) gdb_target=a29k;;
- esac
- ;;
-
-mips)
- case "${target_vendor}" in
- sony) gdb_target=bigmips ;;
- dec) gdb_target=decstation ;;
- little) gdb_target=littlemips ;;
- sgi) gdb_target=irix3 ;;
- esac
- ;;
-
-c1 | c2) gdb_target=convex ;;
-
-sparc)
- case "${target_vendor}" in
- sun)
- case "${target_os}" in
- sunos3) gdb_target=sun4os3 ;;
- sunos4) gdb_target=sun4os4 ;;
- *) gdb_target=sun4 ;;
- esac
- ;;
- esac
- ;;
-
-
-i386)
- case "${target_vendor}" in
- sco) gdb_target=i386sco ;;
- sun) gdb_target=sun386 ;;
- sequent) gdb_target=symmetry ;;
- coff) gdb_target=i386v ;;
- aout) gdb_target=i386aout ;;
- *)
- case "${target_os}" in
- sysv) gdb_target=i386v ;;
- sysv32) gdb_target=i386v32 ;;
- mach) gdb_target=i386mach ;;
- esac
- esac
- ;;
-
-i960)
- case "${target_vendor}" in
- bout | wrs) gdb_target=vxworks960 ;;
- coff | intel) gdb_target=nindy960 ;;
- esac
- ;;
-
-ns32k)
- case "${target_vendor}" in
- utek) gdb_target=umax ;;
- esac
- ;;
-
-rs6000)
- gdb_target=rs6000
- ;;
-
-### unhandled targets
-# altosgas
-# i386v-g
-# i386v32-g
-
-esac
-
-if [ ! -f tconfig/${gdb_target} ]; then
- echo '***' "Gdb does not support target ${target}" 1>&2
- exit 1
-fi
-
-if [ -z "${removing}" ] ; then
- cat xconfig/${gdb_host} tconfig/${gdb_target} | awk '$1 == "#msg" {
- print substr($0,6)}'
-fi
-
-# We really shouldn't depend on there being a space after TM_FILE= ...
-targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <tconfig/${gdb_target}`
-
-host_makefile_frag=xconfig/${gdb_host}
-target_makefile_frag=tconfig/${gdb_target}
-
-# If hostfile (XM_FILE) and/or targetfile (TM_FILE) is not set in the
-# ?config/* file, we don't make the corresponding links. But we have
-# to remove the xm.h files and tm.h files anyway, e.g. when switching
-# from "configure host" to "configure none".
-files=
-links=
-rm -f xm.h
-if [ "${hostfile}" != "" ]; then
- files="${files} ${hostfile}"
- links="${links} xm.h"
-fi
-rm -f tm.h
-if [ "${targetfile}" != "" ]; then
- files="${files} ${targetfile}"
- links="${links} tm.h"
-fi
-
-# post-target:
-
-case ${srcdir} in
- .)
- ;;
- *)
- grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \
- echo "source ${srcdir}/.gdbinit" >> .gdbinit
-esac
-
-cat ${srcdir}/alldeps.mak ${srcdir}/depend >>Makefile
diff --git a/gdb/convex-opcode.h b/gdb/convex-opcode.h
deleted file mode 100755
index 523c874..0000000
--- a/gdb/convex-opcode.h
+++ /dev/null
@@ -1,1677 +0,0 @@
-/* Include information for instruction dissasembly on the Convex.
- Copyright (C) 1989, Free Software Foundation.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define xxx 0
-#define rrr 1
-#define rr 2
-#define rxr 3
-#define r 4
-#define nops 5
-#define nr 6
-#define pcrel 7
-#define lr 8
-#define rxl 9
-#define rlr 10
-#define rrl 11
-#define iml 12
-#define imr 13
-#define a1r 14
-#define a1l 15
-#define a2r 16
-#define a2l 17
-#define a3 18
-#define a4 19
-#define a5 20
-#define V 1
-#define S 2
-#define VM 3
-#define A 4
-#define VL 5
-#define VS 6
-#define VLS 7
-#define PSW 8
-/* Prevent an error during "make depend". */
-#if !defined (PC)
-#define PC 9
-#endif
-#define ITR 10
-#define VV 11
-#define ITSR 12
-#define TOC 13
-#define CIR 14
-#define TTR 15
-#define VMU 16
-#define VML 17
-#define ICR 18
-#define TCPU 19
-#define CPUID 20
-#define TID 21
-char *op[] = {
- "",
- "v0\0v1\0v2\0v3\0v4\0v5\0v6\0v7",
- "s0\0s1\0s2\0s3\0s4\0s5\0s6\0s7",
- "vm",
- "sp\0a1\0a2\0a3\0a4\0a5\0ap\0fp",
- "vl",
- "vs",
- "vls",
- "psw",
- "pc",
- "itr",
- "vv",
- "itsr",
- "toc",
- "cir",
- "ttr",
- "vmu",
- "vml",
- "icr",
- "tcpu",
- "cpuid",
- "tid",
-};
-struct formstr format0[] = {
- {0,0,rrr,V,S,S}, /* mov */
- {0,0,rrr,S,S,V}, /* mov */
- {1,1,rrr,V,V,V}, /* merg.t */
- {2,1,rrr,V,V,V}, /* mask.t */
- {1,2,rrr,V,S,V}, /* merg.f */
- {2,2,rrr,V,S,V}, /* mask.f */
- {1,1,rrr,V,S,V}, /* merg.t */
- {2,1,rrr,V,S,V}, /* mask.t */
- {3,3,rrr,V,V,V}, /* mul.s */
- {3,4,rrr,V,V,V}, /* mul.d */
- {4,3,rrr,V,V,V}, /* div.s */
- {4,4,rrr,V,V,V}, /* div.d */
- {3,3,rrr,V,S,V}, /* mul.s */
- {3,4,rrr,V,S,V}, /* mul.d */
- {4,3,rrr,V,S,V}, /* div.s */
- {4,4,rrr,V,S,V}, /* div.d */
- {5,0,rrr,V,V,V}, /* and */
- {6,0,rrr,V,V,V}, /* or */
- {7,0,rrr,V,V,V}, /* xor */
- {8,0,rrr,V,V,V}, /* shf */
- {5,0,rrr,V,S,V}, /* and */
- {6,0,rrr,V,S,V}, /* or */
- {7,0,rrr,V,S,V}, /* xor */
- {8,0,rrr,V,S,V}, /* shf */
- {9,3,rrr,V,V,V}, /* add.s */
- {9,4,rrr,V,V,V}, /* add.d */
- {10,3,rrr,V,V,V}, /* sub.s */
- {10,4,rrr,V,V,V}, /* sub.d */
- {9,3,rrr,V,S,V}, /* add.s */
- {9,4,rrr,V,S,V}, /* add.d */
- {10,3,rrr,V,S,V}, /* sub.s */
- {10,4,rrr,V,S,V}, /* sub.d */
- {9,5,rrr,V,V,V}, /* add.b */
- {9,6,rrr,V,V,V}, /* add.h */
- {9,7,rrr,V,V,V}, /* add.w */
- {9,8,rrr,V,V,V}, /* add.l */
- {9,5,rrr,V,S,V}, /* add.b */
- {9,6,rrr,V,S,V}, /* add.h */
- {9,7,rrr,V,S,V}, /* add.w */
- {9,8,rrr,V,S,V}, /* add.l */
- {10,5,rrr,V,V,V}, /* sub.b */
- {10,6,rrr,V,V,V}, /* sub.h */
- {10,7,rrr,V,V,V}, /* sub.w */
- {10,8,rrr,V,V,V}, /* sub.l */
- {10,5,rrr,V,S,V}, /* sub.b */
- {10,6,rrr,V,S,V}, /* sub.h */
- {10,7,rrr,V,S,V}, /* sub.w */
- {10,8,rrr,V,S,V}, /* sub.l */
- {3,5,rrr,V,V,V}, /* mul.b */
- {3,6,rrr,V,V,V}, /* mul.h */
- {3,7,rrr,V,V,V}, /* mul.w */
- {3,8,rrr,V,V,V}, /* mul.l */
- {3,5,rrr,V,S,V}, /* mul.b */
- {3,6,rrr,V,S,V}, /* mul.h */
- {3,7,rrr,V,S,V}, /* mul.w */
- {3,8,rrr,V,S,V}, /* mul.l */
- {4,5,rrr,V,V,V}, /* div.b */
- {4,6,rrr,V,V,V}, /* div.h */
- {4,7,rrr,V,V,V}, /* div.w */
- {4,8,rrr,V,V,V}, /* div.l */
- {4,5,rrr,V,S,V}, /* div.b */
- {4,6,rrr,V,S,V}, /* div.h */
- {4,7,rrr,V,S,V}, /* div.w */
- {4,8,rrr,V,S,V}, /* div.l */
-};
-struct formstr format1[] = {
- {11,0,xxx,0,0,0}, /* exit */
- {12,0,a3,0,0,0}, /* jmp */
- {13,2,a3,0,0,0}, /* jmpi.f */
- {13,1,a3,0,0,0}, /* jmpi.t */
- {14,2,a3,0,0,0}, /* jmpa.f */
- {14,1,a3,0,0,0}, /* jmpa.t */
- {15,2,a3,0,0,0}, /* jmps.f */
- {15,1,a3,0,0,0}, /* jmps.t */
- {16,0,a3,0,0,0}, /* tac */
- {17,0,a1r,A,0,0}, /* ldea */
- {18,8,a1l,VLS,0,0}, /* ld.l */
- {18,9,a1l,VM,0,0}, /* ld.x */
- {19,0,a3,0,0,0}, /* tas */
- {20,0,a3,0,0,0}, /* pshea */
- {21,8,a2l,VLS,0,0}, /* st.l */
- {21,9,a2l,VM,0,0}, /* st.x */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {22,0,a3,0,0,0}, /* call */
- {23,0,a3,0,0,0}, /* calls */
- {24,0,a3,0,0,0}, /* callq */
- {25,0,a1r,A,0,0}, /* pfork */
- {26,5,a2r,S,0,0}, /* ste.b */
- {26,6,a2r,S,0,0}, /* ste.h */
- {26,7,a2r,S,0,0}, /* ste.w */
- {26,8,a2r,S,0,0}, /* ste.l */
- {18,5,a1r,A,0,0}, /* ld.b */
- {18,6,a1r,A,0,0}, /* ld.h */
- {18,7,a1r,A,0,0}, /* ld.w */
- {27,7,a1r,A,0,0}, /* incr.w */
- {21,5,a2r,A,0,0}, /* st.b */
- {21,6,a2r,A,0,0}, /* st.h */
- {21,7,a2r,A,0,0}, /* st.w */
- {27,8,a1r,S,0,0}, /* incr.l */
- {18,5,a1r,S,0,0}, /* ld.b */
- {18,6,a1r,S,0,0}, /* ld.h */
- {18,7,a1r,S,0,0}, /* ld.w */
- {18,8,a1r,S,0,0}, /* ld.l */
- {21,5,a2r,S,0,0}, /* st.b */
- {21,6,a2r,S,0,0}, /* st.h */
- {21,7,a2r,S,0,0}, /* st.w */
- {21,8,a2r,S,0,0}, /* st.l */
- {18,5,a1r,V,0,0}, /* ld.b */
- {18,6,a1r,V,0,0}, /* ld.h */
- {18,7,a1r,V,0,0}, /* ld.w */
- {18,8,a1r,V,0,0}, /* ld.l */
- {21,5,a2r,V,0,0}, /* st.b */
- {21,6,a2r,V,0,0}, /* st.h */
- {21,7,a2r,V,0,0}, /* st.w */
- {21,8,a2r,V,0,0}, /* st.l */
-};
-struct formstr format2[] = {
- {28,5,rr,A,A,0}, /* cvtw.b */
- {28,6,rr,A,A,0}, /* cvtw.h */
- {29,7,rr,A,A,0}, /* cvtb.w */
- {30,7,rr,A,A,0}, /* cvth.w */
- {28,5,rr,S,S,0}, /* cvtw.b */
- {28,6,rr,S,S,0}, /* cvtw.h */
- {29,7,rr,S,S,0}, /* cvtb.w */
- {30,7,rr,S,S,0}, /* cvth.w */
- {28,3,rr,S,S,0}, /* cvtw.s */
- {31,7,rr,S,S,0}, /* cvts.w */
- {32,3,rr,S,S,0}, /* cvtd.s */
- {31,4,rr,S,S,0}, /* cvts.d */
- {31,8,rr,S,S,0}, /* cvts.l */
- {32,8,rr,S,S,0}, /* cvtd.l */
- {33,3,rr,S,S,0}, /* cvtl.s */
- {33,4,rr,S,S,0}, /* cvtl.d */
- {34,0,rr,A,A,0}, /* ldpa */
- {8,0,nr,A,0,0}, /* shf */
- {18,6,nr,A,0,0}, /* ld.h */
- {18,7,nr,A,0,0}, /* ld.w */
- {33,7,rr,S,S,0}, /* cvtl.w */
- {28,8,rr,S,S,0}, /* cvtw.l */
- {35,1,rr,S,S,0}, /* plc.t */
- {36,0,rr,S,S,0}, /* tzc */
- {37,6,rr,A,A,0}, /* eq.h */
- {37,7,rr,A,A,0}, /* eq.w */
- {37,6,nr,A,0,0}, /* eq.h */
- {37,7,nr,A,0,0}, /* eq.w */
- {37,5,rr,S,S,0}, /* eq.b */
- {37,6,rr,S,S,0}, /* eq.h */
- {37,7,rr,S,S,0}, /* eq.w */
- {37,8,rr,S,S,0}, /* eq.l */
- {38,6,rr,A,A,0}, /* leu.h */
- {38,7,rr,A,A,0}, /* leu.w */
- {38,6,nr,A,0,0}, /* leu.h */
- {38,7,nr,A,0,0}, /* leu.w */
- {38,5,rr,S,S,0}, /* leu.b */
- {38,6,rr,S,S,0}, /* leu.h */
- {38,7,rr,S,S,0}, /* leu.w */
- {38,8,rr,S,S,0}, /* leu.l */
- {39,6,rr,A,A,0}, /* ltu.h */
- {39,7,rr,A,A,0}, /* ltu.w */
- {39,6,nr,A,0,0}, /* ltu.h */
- {39,7,nr,A,0,0}, /* ltu.w */
- {39,5,rr,S,S,0}, /* ltu.b */
- {39,6,rr,S,S,0}, /* ltu.h */
- {39,7,rr,S,S,0}, /* ltu.w */
- {39,8,rr,S,S,0}, /* ltu.l */
- {40,6,rr,A,A,0}, /* le.h */
- {40,7,rr,A,A,0}, /* le.w */
- {40,6,nr,A,0,0}, /* le.h */
- {40,7,nr,A,0,0}, /* le.w */
- {40,5,rr,S,S,0}, /* le.b */
- {40,6,rr,S,S,0}, /* le.h */
- {40,7,rr,S,S,0}, /* le.w */
- {40,8,rr,S,S,0}, /* le.l */
- {41,6,rr,A,A,0}, /* lt.h */
- {41,7,rr,A,A,0}, /* lt.w */
- {41,6,nr,A,0,0}, /* lt.h */
- {41,7,nr,A,0,0}, /* lt.w */
- {41,5,rr,S,S,0}, /* lt.b */
- {41,6,rr,S,S,0}, /* lt.h */
- {41,7,rr,S,S,0}, /* lt.w */
- {41,8,rr,S,S,0}, /* lt.l */
- {9,7,rr,S,A,0}, /* add.w */
- {8,0,rr,A,A,0}, /* shf */
- {0,0,rr,A,A,0}, /* mov */
- {0,0,rr,S,A,0}, /* mov */
- {0,7,rr,S,S,0}, /* mov.w */
- {8,0,rr,S,S,0}, /* shf */
- {0,0,rr,S,S,0}, /* mov */
- {0,0,rr,A,S,0}, /* mov */
- {5,0,rr,A,A,0}, /* and */
- {6,0,rr,A,A,0}, /* or */
- {7,0,rr,A,A,0}, /* xor */
- {42,0,rr,A,A,0}, /* not */
- {5,0,rr,S,S,0}, /* and */
- {6,0,rr,S,S,0}, /* or */
- {7,0,rr,S,S,0}, /* xor */
- {42,0,rr,S,S,0}, /* not */
- {40,3,rr,S,S,0}, /* le.s */
- {40,4,rr,S,S,0}, /* le.d */
- {41,3,rr,S,S,0}, /* lt.s */
- {41,4,rr,S,S,0}, /* lt.d */
- {9,3,rr,S,S,0}, /* add.s */
- {9,4,rr,S,S,0}, /* add.d */
- {10,3,rr,S,S,0}, /* sub.s */
- {10,4,rr,S,S,0}, /* sub.d */
- {37,3,rr,S,S,0}, /* eq.s */
- {37,4,rr,S,S,0}, /* eq.d */
- {43,6,rr,A,A,0}, /* neg.h */
- {43,7,rr,A,A,0}, /* neg.w */
- {3,3,rr,S,S,0}, /* mul.s */
- {3,4,rr,S,S,0}, /* mul.d */
- {4,3,rr,S,S,0}, /* div.s */
- {4,4,rr,S,S,0}, /* div.d */
- {9,6,rr,A,A,0}, /* add.h */
- {9,7,rr,A,A,0}, /* add.w */
- {9,6,nr,A,0,0}, /* add.h */
- {9,7,nr,A,0,0}, /* add.w */
- {9,5,rr,S,S,0}, /* add.b */
- {9,6,rr,S,S,0}, /* add.h */
- {9,7,rr,S,S,0}, /* add.w */
- {9,8,rr,S,S,0}, /* add.l */
- {10,6,rr,A,A,0}, /* sub.h */
- {10,7,rr,A,A,0}, /* sub.w */
- {10,6,nr,A,0,0}, /* sub.h */
- {10,7,nr,A,0,0}, /* sub.w */
- {10,5,rr,S,S,0}, /* sub.b */
- {10,6,rr,S,S,0}, /* sub.h */
- {10,7,rr,S,S,0}, /* sub.w */
- {10,8,rr,S,S,0}, /* sub.l */
- {3,6,rr,A,A,0}, /* mul.h */
- {3,7,rr,A,A,0}, /* mul.w */
- {3,6,nr,A,0,0}, /* mul.h */
- {3,7,nr,A,0,0}, /* mul.w */
- {3,5,rr,S,S,0}, /* mul.b */
- {3,6,rr,S,S,0}, /* mul.h */
- {3,7,rr,S,S,0}, /* mul.w */
- {3,8,rr,S,S,0}, /* mul.l */
- {4,6,rr,A,A,0}, /* div.h */
- {4,7,rr,A,A,0}, /* div.w */
- {4,6,nr,A,0,0}, /* div.h */
- {4,7,nr,A,0,0}, /* div.w */
- {4,5,rr,S,S,0}, /* div.b */
- {4,6,rr,S,S,0}, /* div.h */
- {4,7,rr,S,S,0}, /* div.w */
- {4,8,rr,S,S,0}, /* div.l */
-};
-struct formstr format3[] = {
- {32,3,rr,V,V,0}, /* cvtd.s */
- {31,4,rr,V,V,0}, /* cvts.d */
- {33,4,rr,V,V,0}, /* cvtl.d */
- {32,8,rr,V,V,0}, /* cvtd.l */
- {0,0,rrl,S,S,VM}, /* mov */
- {0,0,rlr,S,VM,S}, /* mov */
- {0,0,0,0,0,0},
- {44,0,rr,S,S,0}, /* lop */
- {36,0,rr,V,V,0}, /* tzc */
- {44,0,rr,V,V,0}, /* lop */
- {0,0,0,0,0,0},
- {42,0,rr,V,V,0}, /* not */
- {8,0,rr,S,V,0}, /* shf */
- {35,1,rr,V,V,0}, /* plc.t */
- {45,2,rr,V,V,0}, /* cprs.f */
- {45,1,rr,V,V,0}, /* cprs.t */
- {37,3,rr,V,V,0}, /* eq.s */
- {37,4,rr,V,V,0}, /* eq.d */
- {43,3,rr,V,V,0}, /* neg.s */
- {43,4,rr,V,V,0}, /* neg.d */
- {37,3,rr,S,V,0}, /* eq.s */
- {37,4,rr,S,V,0}, /* eq.d */
- {43,3,rr,S,S,0}, /* neg.s */
- {43,4,rr,S,S,0}, /* neg.d */
- {40,3,rr,V,V,0}, /* le.s */
- {40,4,rr,V,V,0}, /* le.d */
- {41,3,rr,V,V,0}, /* lt.s */
- {41,4,rr,V,V,0}, /* lt.d */
- {40,3,rr,S,V,0}, /* le.s */
- {40,4,rr,S,V,0}, /* le.d */
- {41,3,rr,S,V,0}, /* lt.s */
- {41,4,rr,S,V,0}, /* lt.d */
- {37,5,rr,V,V,0}, /* eq.b */
- {37,6,rr,V,V,0}, /* eq.h */
- {37,7,rr,V,V,0}, /* eq.w */
- {37,8,rr,V,V,0}, /* eq.l */
- {37,5,rr,S,V,0}, /* eq.b */
- {37,6,rr,S,V,0}, /* eq.h */
- {37,7,rr,S,V,0}, /* eq.w */
- {37,8,rr,S,V,0}, /* eq.l */
- {40,5,rr,V,V,0}, /* le.b */
- {40,6,rr,V,V,0}, /* le.h */
- {40,7,rr,V,V,0}, /* le.w */
- {40,8,rr,V,V,0}, /* le.l */
- {40,5,rr,S,V,0}, /* le.b */
- {40,6,rr,S,V,0}, /* le.h */
- {40,7,rr,S,V,0}, /* le.w */
- {40,8,rr,S,V,0}, /* le.l */
- {41,5,rr,V,V,0}, /* lt.b */
- {41,6,rr,V,V,0}, /* lt.h */
- {41,7,rr,V,V,0}, /* lt.w */
- {41,8,rr,V,V,0}, /* lt.l */
- {41,5,rr,S,V,0}, /* lt.b */
- {41,6,rr,S,V,0}, /* lt.h */
- {41,7,rr,S,V,0}, /* lt.w */
- {41,8,rr,S,V,0}, /* lt.l */
- {43,5,rr,V,V,0}, /* neg.b */
- {43,6,rr,V,V,0}, /* neg.h */
- {43,7,rr,V,V,0}, /* neg.w */
- {43,8,rr,V,V,0}, /* neg.l */
- {43,5,rr,S,S,0}, /* neg.b */
- {43,6,rr,S,S,0}, /* neg.h */
- {43,7,rr,S,S,0}, /* neg.w */
- {43,8,rr,S,S,0}, /* neg.l */
-};
-struct formstr format4[] = {
- {46,0,nops,0,0,0}, /* nop */
- {47,0,pcrel,0,0,0}, /* br */
- {48,2,pcrel,0,0,0}, /* bri.f */
- {48,1,pcrel,0,0,0}, /* bri.t */
- {49,2,pcrel,0,0,0}, /* bra.f */
- {49,1,pcrel,0,0,0}, /* bra.t */
- {50,2,pcrel,0,0,0}, /* brs.f */
- {50,1,pcrel,0,0,0}, /* brs.t */
-};
-struct formstr format5[] = {
- {51,5,rr,V,V,0}, /* ldvi.b */
- {51,6,rr,V,V,0}, /* ldvi.h */
- {51,7,rr,V,V,0}, /* ldvi.w */
- {51,8,rr,V,V,0}, /* ldvi.l */
- {28,3,rr,V,V,0}, /* cvtw.s */
- {31,7,rr,V,V,0}, /* cvts.w */
- {28,8,rr,V,V,0}, /* cvtw.l */
- {33,7,rr,V,V,0}, /* cvtl.w */
- {52,5,rxr,V,V,0}, /* stvi.b */
- {52,6,rxr,V,V,0}, /* stvi.h */
- {52,7,rxr,V,V,0}, /* stvi.w */
- {52,8,rxr,V,V,0}, /* stvi.l */
- {52,5,rxr,S,V,0}, /* stvi.b */
- {52,6,rxr,S,V,0}, /* stvi.h */
- {52,7,rxr,S,V,0}, /* stvi.w */
- {52,8,rxr,S,V,0}, /* stvi.l */
-};
-struct formstr format6[] = {
- {53,0,r,A,0,0}, /* ldsdr */
- {54,0,r,A,0,0}, /* ldkdr */
- {55,3,r,S,0,0}, /* ln.s */
- {55,4,r,S,0,0}, /* ln.d */
- {56,0,nops,0,0,0}, /* patu */
- {57,0,r,A,0,0}, /* pate */
- {58,0,nops,0,0,0}, /* pich */
- {59,0,nops,0,0,0}, /* plch */
- {0,0,lr,PSW,A,0}, /* mov */
- {0,0,rxl,A,PSW,0}, /* mov */
- {0,0,lr,PC,A,0}, /* mov */
- {60,0,r,S,0,0}, /* idle */
- {0,0,lr,ITR,S,0}, /* mov */
- {0,0,rxl,S,ITR,0}, /* mov */
- {0,0,0,0,0,0},
- {0,0,rxl,S,ITSR,0}, /* mov */
- {61,0,nops,0,0,0}, /* rtnq */
- {62,0,nops,0,0,0}, /* cfork */
- {63,0,nops,0,0,0}, /* rtn */
- {64,0,nops,0,0,0}, /* wfork */
- {65,0,nops,0,0,0}, /* join */
- {66,0,nops,0,0,0}, /* rtnc */
- {67,3,r,S,0,0}, /* exp.s */
- {67,4,r,S,0,0}, /* exp.d */
- {68,3,r,S,0,0}, /* sin.s */
- {68,4,r,S,0,0}, /* sin.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {69,3,r,S,0,0}, /* cos.s */
- {69,4,r,S,0,0}, /* cos.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {70,7,r,A,0,0}, /* psh.w */
- {0,0,0,0,0,0},
- {71,7,r,A,0,0}, /* pop.w */
- {0,0,0,0,0,0},
- {70,7,r,S,0,0}, /* psh.w */
- {70,8,r,S,0,0}, /* psh.l */
- {71,7,r,S,0,0}, /* pop.w */
- {71,8,r,S,0,0}, /* pop.l */
- {72,0,nops,0,0,0}, /* eni */
- {73,0,nops,0,0,0}, /* dsi */
- {74,0,nops,0,0,0}, /* bkpt */
- {75,0,nops,0,0,0}, /* msync */
- {76,0,r,S,0,0}, /* mski */
- {77,0,r,S,0,0}, /* xmti */
- {0,0,rxl,S,VV,0}, /* mov */
- {78,0,nops,0,0,0}, /* tstvv */
- {0,0,lr,VS,A,0}, /* mov */
- {0,0,rxl,A,VS,0}, /* mov */
- {0,0,lr,VL,A,0}, /* mov */
- {0,0,rxl,A,VL,0}, /* mov */
- {0,7,lr,VS,S,0}, /* mov.w */
- {0,7,rxl,S,VS,0}, /* mov.w */
- {0,7,lr,VL,S,0}, /* mov.w */
- {0,7,rxl,S,VL,0}, /* mov.w */
- {79,0,r,A,0,0}, /* diag */
- {80,0,nops,0,0,0}, /* pbkpt */
- {81,3,r,S,0,0}, /* sqrt.s */
- {81,4,r,S,0,0}, /* sqrt.d */
- {82,0,nops,0,0,0}, /* casr */
- {0,0,0,0,0,0},
- {83,3,r,S,0,0}, /* atan.s */
- {83,4,r,S,0,0}, /* atan.d */
-};
-struct formstr format7[] = {
- {84,5,r,V,0,0}, /* sum.b */
- {84,6,r,V,0,0}, /* sum.h */
- {84,7,r,V,0,0}, /* sum.w */
- {84,8,r,V,0,0}, /* sum.l */
- {85,0,r,V,0,0}, /* all */
- {86,0,r,V,0,0}, /* any */
- {87,0,r,V,0,0}, /* parity */
- {0,0,0,0,0,0},
- {88,5,r,V,0,0}, /* max.b */
- {88,6,r,V,0,0}, /* max.h */
- {88,7,r,V,0,0}, /* max.w */
- {88,8,r,V,0,0}, /* max.l */
- {89,5,r,V,0,0}, /* min.b */
- {89,6,r,V,0,0}, /* min.h */
- {89,7,r,V,0,0}, /* min.w */
- {89,8,r,V,0,0}, /* min.l */
- {84,3,r,V,0,0}, /* sum.s */
- {84,4,r,V,0,0}, /* sum.d */
- {90,3,r,V,0,0}, /* prod.s */
- {90,4,r,V,0,0}, /* prod.d */
- {88,3,r,V,0,0}, /* max.s */
- {88,4,r,V,0,0}, /* max.d */
- {89,3,r,V,0,0}, /* min.s */
- {89,4,r,V,0,0}, /* min.d */
- {90,5,r,V,0,0}, /* prod.b */
- {90,6,r,V,0,0}, /* prod.h */
- {90,7,r,V,0,0}, /* prod.w */
- {90,8,r,V,0,0}, /* prod.l */
- {35,2,lr,VM,S,0}, /* plc.f */
- {35,1,lr,VM,S,0}, /* plc.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr formatx[] = {
- {0,0,0,0,0,0},
-};
-struct formstr format1a[] = {
- {91,0,imr,A,0,0}, /* halt */
- {92,0,a4,0,0,0}, /* sysc */
- {18,6,imr,A,0,0}, /* ld.h */
- {18,7,imr,A,0,0}, /* ld.w */
- {5,0,imr,A,0,0}, /* and */
- {6,0,imr,A,0,0}, /* or */
- {7,0,imr,A,0,0}, /* xor */
- {8,0,imr,A,0,0}, /* shf */
- {9,6,imr,A,0,0}, /* add.h */
- {9,7,imr,A,0,0}, /* add.w */
- {10,6,imr,A,0,0}, /* sub.h */
- {10,7,imr,A,0,0}, /* sub.w */
- {3,6,imr,A,0,0}, /* mul.h */
- {3,7,imr,A,0,0}, /* mul.w */
- {4,6,imr,A,0,0}, /* div.h */
- {4,7,imr,A,0,0}, /* div.w */
- {18,7,iml,VL,0,0}, /* ld.w */
- {18,7,iml,VS,0,0}, /* ld.w */
- {0,0,0,0,0,0},
- {8,7,imr,S,0,0}, /* shf.w */
- {93,0,a5,0,0,0}, /* trap */
- {0,0,0,0,0,0},
- {37,6,imr,A,0,0}, /* eq.h */
- {37,7,imr,A,0,0}, /* eq.w */
- {38,6,imr,A,0,0}, /* leu.h */
- {38,7,imr,A,0,0}, /* leu.w */
- {39,6,imr,A,0,0}, /* ltu.h */
- {39,7,imr,A,0,0}, /* ltu.w */
- {40,6,imr,A,0,0}, /* le.h */
- {40,7,imr,A,0,0}, /* le.w */
- {41,6,imr,A,0,0}, /* lt.h */
- {41,7,imr,A,0,0}, /* lt.w */
-};
-struct formstr format1b[] = {
- {18,4,imr,S,0,0}, /* ld.d */
- {18,10,imr,S,0,0}, /* ld.u */
- {18,8,imr,S,0,0}, /* ld.l */
- {18,7,imr,S,0,0}, /* ld.w */
- {5,0,imr,S,0,0}, /* and */
- {6,0,imr,S,0,0}, /* or */
- {7,0,imr,S,0,0}, /* xor */
- {8,0,imr,S,0,0}, /* shf */
- {9,6,imr,S,0,0}, /* add.h */
- {9,7,imr,S,0,0}, /* add.w */
- {10,6,imr,S,0,0}, /* sub.h */
- {10,7,imr,S,0,0}, /* sub.w */
- {3,6,imr,S,0,0}, /* mul.h */
- {3,7,imr,S,0,0}, /* mul.w */
- {4,6,imr,S,0,0}, /* div.h */
- {4,7,imr,S,0,0}, /* div.w */
- {9,3,imr,S,0,0}, /* add.s */
- {10,3,imr,S,0,0}, /* sub.s */
- {3,3,imr,S,0,0}, /* mul.s */
- {4,3,imr,S,0,0}, /* div.s */
- {40,3,imr,S,0,0}, /* le.s */
- {41,3,imr,S,0,0}, /* lt.s */
- {37,6,imr,S,0,0}, /* eq.h */
- {37,7,imr,S,0,0}, /* eq.w */
- {38,6,imr,S,0,0}, /* leu.h */
- {38,7,imr,S,0,0}, /* leu.w */
- {39,6,imr,S,0,0}, /* ltu.h */
- {39,7,imr,S,0,0}, /* ltu.w */
- {40,6,imr,S,0,0}, /* le.h */
- {40,7,imr,S,0,0}, /* le.w */
- {41,6,imr,S,0,0}, /* lt.h */
- {41,7,imr,S,0,0}, /* lt.w */
-};
-struct formstr e0_format0[] = {
- {10,3,rrr,S,V,V}, /* sub.s */
- {10,4,rrr,S,V,V}, /* sub.d */
- {4,3,rrr,S,V,V}, /* div.s */
- {4,4,rrr,S,V,V}, /* div.d */
- {10,11,rrr,S,V,V}, /* sub.s.f */
- {10,12,rrr,S,V,V}, /* sub.d.f */
- {4,11,rrr,S,V,V}, /* div.s.f */
- {4,12,rrr,S,V,V}, /* div.d.f */
- {3,11,rrr,V,V,V}, /* mul.s.f */
- {3,12,rrr,V,V,V}, /* mul.d.f */
- {4,11,rrr,V,V,V}, /* div.s.f */
- {4,12,rrr,V,V,V}, /* div.d.f */
- {3,11,rrr,V,S,V}, /* mul.s.f */
- {3,12,rrr,V,S,V}, /* mul.d.f */
- {4,11,rrr,V,S,V}, /* div.s.f */
- {4,12,rrr,V,S,V}, /* div.d.f */
- {5,2,rrr,V,V,V}, /* and.f */
- {6,2,rrr,V,V,V}, /* or.f */
- {7,2,rrr,V,V,V}, /* xor.f */
- {8,2,rrr,V,V,V}, /* shf.f */
- {5,2,rrr,V,S,V}, /* and.f */
- {6,2,rrr,V,S,V}, /* or.f */
- {7,2,rrr,V,S,V}, /* xor.f */
- {8,2,rrr,V,S,V}, /* shf.f */
- {9,11,rrr,V,V,V}, /* add.s.f */
- {9,12,rrr,V,V,V}, /* add.d.f */
- {10,11,rrr,V,V,V}, /* sub.s.f */
- {10,12,rrr,V,V,V}, /* sub.d.f */
- {9,11,rrr,V,S,V}, /* add.s.f */
- {9,12,rrr,V,S,V}, /* add.d.f */
- {10,11,rrr,V,S,V}, /* sub.s.f */
- {10,12,rrr,V,S,V}, /* sub.d.f */
- {9,13,rrr,V,V,V}, /* add.b.f */
- {9,14,rrr,V,V,V}, /* add.h.f */
- {9,15,rrr,V,V,V}, /* add.w.f */
- {9,16,rrr,V,V,V}, /* add.l.f */
- {9,13,rrr,V,S,V}, /* add.b.f */
- {9,14,rrr,V,S,V}, /* add.h.f */
- {9,15,rrr,V,S,V}, /* add.w.f */
- {9,16,rrr,V,S,V}, /* add.l.f */
- {10,13,rrr,V,V,V}, /* sub.b.f */
- {10,14,rrr,V,V,V}, /* sub.h.f */
- {10,15,rrr,V,V,V}, /* sub.w.f */
- {10,16,rrr,V,V,V}, /* sub.l.f */
- {10,13,rrr,V,S,V}, /* sub.b.f */
- {10,14,rrr,V,S,V}, /* sub.h.f */
- {10,15,rrr,V,S,V}, /* sub.w.f */
- {10,16,rrr,V,S,V}, /* sub.l.f */
- {3,13,rrr,V,V,V}, /* mul.b.f */
- {3,14,rrr,V,V,V}, /* mul.h.f */
- {3,15,rrr,V,V,V}, /* mul.w.f */
- {3,16,rrr,V,V,V}, /* mul.l.f */
- {3,13,rrr,V,S,V}, /* mul.b.f */
- {3,14,rrr,V,S,V}, /* mul.h.f */
- {3,15,rrr,V,S,V}, /* mul.w.f */
- {3,16,rrr,V,S,V}, /* mul.l.f */
- {4,13,rrr,V,V,V}, /* div.b.f */
- {4,14,rrr,V,V,V}, /* div.h.f */
- {4,15,rrr,V,V,V}, /* div.w.f */
- {4,16,rrr,V,V,V}, /* div.l.f */
- {4,13,rrr,V,S,V}, /* div.b.f */
- {4,14,rrr,V,S,V}, /* div.h.f */
- {4,15,rrr,V,S,V}, /* div.w.f */
- {4,16,rrr,V,S,V}, /* div.l.f */
-};
-struct formstr e0_format1[] = {
- {0,0,0,0,0,0},
- {94,0,a3,0,0,0}, /* tst */
- {95,0,a3,0,0,0}, /* lck */
- {96,0,a3,0,0,0}, /* ulk */
- {17,0,a1r,S,0,0}, /* ldea */
- {97,0,a1r,A,0,0}, /* spawn */
- {98,0,a1r,A,0,0}, /* ldcmr */
- {99,0,a2r,A,0,0}, /* stcmr */
- {100,0,a1r,A,0,0}, /* popr */
- {101,0,a2r,A,0,0}, /* pshr */
- {102,7,a1r,A,0,0}, /* rcvr.w */
- {103,7,a2r,A,0,0}, /* matm.w */
- {104,7,a2r,A,0,0}, /* sndr.w */
- {104,8,a2r,S,0,0}, /* sndr.l */
- {102,8,a1r,S,0,0}, /* rcvr.l */
- {103,8,a2r,S,0,0}, /* matm.l */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {105,7,a2r,A,0,0}, /* putr.w */
- {105,8,a2r,S,0,0}, /* putr.l */
- {106,7,a1r,A,0,0}, /* getr.w */
- {106,8,a1r,S,0,0}, /* getr.l */
- {26,13,a2r,S,0,0}, /* ste.b.f */
- {26,14,a2r,S,0,0}, /* ste.h.f */
- {26,15,a2r,S,0,0}, /* ste.w.f */
- {26,16,a2r,S,0,0}, /* ste.l.f */
- {107,7,a2r,A,0,0}, /* matr.w */
- {108,7,a2r,A,0,0}, /* mat.w */
- {109,7,a1r,A,0,0}, /* get.w */
- {110,7,a1r,A,0,0}, /* rcv.w */
- {0,0,0,0,0,0},
- {111,7,a1r,A,0,0}, /* inc.w */
- {112,7,a2r,A,0,0}, /* put.w */
- {113,7,a2r,A,0,0}, /* snd.w */
- {107,8,a2r,S,0,0}, /* matr.l */
- {108,8,a2r,S,0,0}, /* mat.l */
- {109,8,a1r,S,0,0}, /* get.l */
- {110,8,a1r,S,0,0}, /* rcv.l */
- {0,0,0,0,0,0},
- {111,8,a1r,S,0,0}, /* inc.l */
- {112,8,a2r,S,0,0}, /* put.l */
- {113,8,a2r,S,0,0}, /* snd.l */
- {18,13,a1r,V,0,0}, /* ld.b.f */
- {18,14,a1r,V,0,0}, /* ld.h.f */
- {18,15,a1r,V,0,0}, /* ld.w.f */
- {18,16,a1r,V,0,0}, /* ld.l.f */
- {21,13,a2r,V,0,0}, /* st.b.f */
- {21,14,a2r,V,0,0}, /* st.h.f */
- {21,15,a2r,V,0,0}, /* st.w.f */
- {21,16,a2r,V,0,0}, /* st.l.f */
-};
-struct formstr e0_format2[] = {
- {28,5,rr,V,V,0}, /* cvtw.b */
- {28,6,rr,V,V,0}, /* cvtw.h */
- {29,7,rr,V,V,0}, /* cvtb.w */
- {30,7,rr,V,V,0}, /* cvth.w */
- {28,13,rr,V,V,0}, /* cvtw.b.f */
- {28,14,rr,V,V,0}, /* cvtw.h.f */
- {29,15,rr,V,V,0}, /* cvtb.w.f */
- {30,15,rr,V,V,0}, /* cvth.w.f */
- {31,8,rr,V,V,0}, /* cvts.l */
- {32,7,rr,V,V,0}, /* cvtd.w */
- {33,3,rr,V,V,0}, /* cvtl.s */
- {28,4,rr,V,V,0}, /* cvtw.d */
- {31,16,rr,V,V,0}, /* cvts.l.f */
- {32,15,rr,V,V,0}, /* cvtd.w.f */
- {33,11,rr,V,V,0}, /* cvtl.s.f */
- {28,12,rr,V,V,0}, /* cvtw.d.f */
- {114,0,rr,S,S,0}, /* enal */
- {8,7,rr,S,S,0}, /* shf.w */
- {115,0,rr,S,S,0}, /* enag */
- {0,0,0,0,0,0},
- {28,4,rr,S,S,0}, /* cvtw.d */
- {32,7,rr,S,S,0}, /* cvtd.w */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {116,3,rr,S,S,0}, /* frint.s */
- {116,4,rr,S,S,0}, /* frint.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {116,3,rr,V,V,0}, /* frint.s */
- {116,4,rr,V,V,0}, /* frint.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {116,11,rr,V,V,0}, /* frint.s.f */
- {116,12,rr,V,V,0}, /* frint.d.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {81,3,rr,V,V,0}, /* sqrt.s */
- {81,4,rr,V,V,0}, /* sqrt.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {81,11,rr,V,V,0}, /* sqrt.s.f */
- {81,12,rr,V,V,0}, /* sqrt.d.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e0_format3[] = {
- {32,11,rr,V,V,0}, /* cvtd.s.f */
- {31,12,rr,V,V,0}, /* cvts.d.f */
- {33,12,rr,V,V,0}, /* cvtl.d.f */
- {32,16,rr,V,V,0}, /* cvtd.l.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {36,2,rr,V,V,0}, /* tzc.f */
- {44,2,rr,V,V,0}, /* lop.f */
- {117,2,rr,V,V,0}, /* xpnd.f */
- {42,2,rr,V,V,0}, /* not.f */
- {8,2,rr,S,V,0}, /* shf.f */
- {35,17,rr,V,V,0}, /* plc.t.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {37,11,rr,V,V,0}, /* eq.s.f */
- {37,12,rr,V,V,0}, /* eq.d.f */
- {43,11,rr,V,V,0}, /* neg.s.f */
- {43,12,rr,V,V,0}, /* neg.d.f */
- {37,11,rr,S,V,0}, /* eq.s.f */
- {37,12,rr,S,V,0}, /* eq.d.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {40,11,rr,V,V,0}, /* le.s.f */
- {40,12,rr,V,V,0}, /* le.d.f */
- {41,11,rr,V,V,0}, /* lt.s.f */
- {41,12,rr,V,V,0}, /* lt.d.f */
- {40,11,rr,S,V,0}, /* le.s.f */
- {40,12,rr,S,V,0}, /* le.d.f */
- {41,11,rr,S,V,0}, /* lt.s.f */
- {41,12,rr,S,V,0}, /* lt.d.f */
- {37,13,rr,V,V,0}, /* eq.b.f */
- {37,14,rr,V,V,0}, /* eq.h.f */
- {37,15,rr,V,V,0}, /* eq.w.f */
- {37,16,rr,V,V,0}, /* eq.l.f */
- {37,13,rr,S,V,0}, /* eq.b.f */
- {37,14,rr,S,V,0}, /* eq.h.f */
- {37,15,rr,S,V,0}, /* eq.w.f */
- {37,16,rr,S,V,0}, /* eq.l.f */
- {40,13,rr,V,V,0}, /* le.b.f */
- {40,14,rr,V,V,0}, /* le.h.f */
- {40,15,rr,V,V,0}, /* le.w.f */
- {40,16,rr,V,V,0}, /* le.l.f */
- {40,13,rr,S,V,0}, /* le.b.f */
- {40,14,rr,S,V,0}, /* le.h.f */
- {40,15,rr,S,V,0}, /* le.w.f */
- {40,16,rr,S,V,0}, /* le.l.f */
- {41,13,rr,V,V,0}, /* lt.b.f */
- {41,14,rr,V,V,0}, /* lt.h.f */
- {41,15,rr,V,V,0}, /* lt.w.f */
- {41,16,rr,V,V,0}, /* lt.l.f */
- {41,13,rr,S,V,0}, /* lt.b.f */
- {41,14,rr,S,V,0}, /* lt.h.f */
- {41,15,rr,S,V,0}, /* lt.w.f */
- {41,16,rr,S,V,0}, /* lt.l.f */
- {43,13,rr,V,V,0}, /* neg.b.f */
- {43,14,rr,V,V,0}, /* neg.h.f */
- {43,15,rr,V,V,0}, /* neg.w.f */
- {43,16,rr,V,V,0}, /* neg.l.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e0_format4[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e0_format5[] = {
- {51,13,rr,V,V,0}, /* ldvi.b.f */
- {51,14,rr,V,V,0}, /* ldvi.h.f */
- {51,15,rr,V,V,0}, /* ldvi.w.f */
- {51,16,rr,V,V,0}, /* ldvi.l.f */
- {28,11,rr,V,V,0}, /* cvtw.s.f */
- {31,15,rr,V,V,0}, /* cvts.w.f */
- {28,16,rr,V,V,0}, /* cvtw.l.f */
- {33,15,rr,V,V,0}, /* cvtl.w.f */
- {52,13,rxr,V,V,0}, /* stvi.b.f */
- {52,14,rxr,V,V,0}, /* stvi.h.f */
- {52,15,rxr,V,V,0}, /* stvi.w.f */
- {52,16,rxr,V,V,0}, /* stvi.l.f */
- {52,13,rxr,S,V,0}, /* stvi.b.f */
- {52,14,rxr,S,V,0}, /* stvi.h.f */
- {52,15,rxr,S,V,0}, /* stvi.w.f */
- {52,16,rxr,S,V,0}, /* stvi.l.f */
-};
-struct formstr e0_format6[] = {
- {0,0,rxl,S,CIR,0}, /* mov */
- {0,0,lr,CIR,S,0}, /* mov */
- {0,0,lr,TOC,S,0}, /* mov */
- {0,0,lr,CPUID,S,0}, /* mov */
- {0,0,rxl,S,TTR,0}, /* mov */
- {0,0,lr,TTR,S,0}, /* mov */
- {118,0,nops,0,0,0}, /* ctrsl */
- {119,0,nops,0,0,0}, /* ctrsg */
- {0,0,rxl,S,VMU,0}, /* mov */
- {0,0,lr,VMU,S,0}, /* mov */
- {0,0,rxl,S,VML,0}, /* mov */
- {0,0,lr,VML,S,0}, /* mov */
- {0,0,rxl,S,ICR,0}, /* mov */
- {0,0,lr,ICR,S,0}, /* mov */
- {0,0,rxl,S,TCPU,0}, /* mov */
- {0,0,lr,TCPU,S,0}, /* mov */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {120,0,nops,0,0,0}, /* stop */
- {0,0,0,0,0,0},
- {0,0,rxl,S,TID,0}, /* mov */
- {0,0,lr,TID,S,0}, /* mov */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e0_format7[] = {
- {84,13,r,V,0,0}, /* sum.b.f */
- {84,14,r,V,0,0}, /* sum.h.f */
- {84,15,r,V,0,0}, /* sum.w.f */
- {84,16,r,V,0,0}, /* sum.l.f */
- {85,2,r,V,0,0}, /* all.f */
- {86,2,r,V,0,0}, /* any.f */
- {87,2,r,V,0,0}, /* parity.f */
- {0,0,0,0,0,0},
- {88,13,r,V,0,0}, /* max.b.f */
- {88,14,r,V,0,0}, /* max.h.f */
- {88,15,r,V,0,0}, /* max.w.f */
- {88,16,r,V,0,0}, /* max.l.f */
- {89,13,r,V,0,0}, /* min.b.f */
- {89,14,r,V,0,0}, /* min.h.f */
- {89,15,r,V,0,0}, /* min.w.f */
- {89,16,r,V,0,0}, /* min.l.f */
- {84,11,r,V,0,0}, /* sum.s.f */
- {84,12,r,V,0,0}, /* sum.d.f */
- {90,11,r,V,0,0}, /* prod.s.f */
- {90,12,r,V,0,0}, /* prod.d.f */
- {88,11,r,V,0,0}, /* max.s.f */
- {88,12,r,V,0,0}, /* max.d.f */
- {89,11,r,V,0,0}, /* min.s.f */
- {89,12,r,V,0,0}, /* min.d.f */
- {90,13,r,V,0,0}, /* prod.b.f */
- {90,14,r,V,0,0}, /* prod.h.f */
- {90,15,r,V,0,0}, /* prod.w.f */
- {90,16,r,V,0,0}, /* prod.l.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format0[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {10,18,rrr,S,V,V}, /* sub.s.t */
- {10,19,rrr,S,V,V}, /* sub.d.t */
- {4,18,rrr,S,V,V}, /* div.s.t */
- {4,19,rrr,S,V,V}, /* div.d.t */
- {3,18,rrr,V,V,V}, /* mul.s.t */
- {3,19,rrr,V,V,V}, /* mul.d.t */
- {4,18,rrr,V,V,V}, /* div.s.t */
- {4,19,rrr,V,V,V}, /* div.d.t */
- {3,18,rrr,V,S,V}, /* mul.s.t */
- {3,19,rrr,V,S,V}, /* mul.d.t */
- {4,18,rrr,V,S,V}, /* div.s.t */
- {4,19,rrr,V,S,V}, /* div.d.t */
- {5,1,rrr,V,V,V}, /* and.t */
- {6,1,rrr,V,V,V}, /* or.t */
- {7,1,rrr,V,V,V}, /* xor.t */
- {8,1,rrr,V,V,V}, /* shf.t */
- {5,1,rrr,V,S,V}, /* and.t */
- {6,1,rrr,V,S,V}, /* or.t */
- {7,1,rrr,V,S,V}, /* xor.t */
- {8,1,rrr,V,S,V}, /* shf.t */
- {9,18,rrr,V,V,V}, /* add.s.t */
- {9,19,rrr,V,V,V}, /* add.d.t */
- {10,18,rrr,V,V,V}, /* sub.s.t */
- {10,19,rrr,V,V,V}, /* sub.d.t */
- {9,18,rrr,V,S,V}, /* add.s.t */
- {9,19,rrr,V,S,V}, /* add.d.t */
- {10,18,rrr,V,S,V}, /* sub.s.t */
- {10,19,rrr,V,S,V}, /* sub.d.t */
- {9,20,rrr,V,V,V}, /* add.b.t */
- {9,21,rrr,V,V,V}, /* add.h.t */
- {9,22,rrr,V,V,V}, /* add.w.t */
- {9,23,rrr,V,V,V}, /* add.l.t */
- {9,20,rrr,V,S,V}, /* add.b.t */
- {9,21,rrr,V,S,V}, /* add.h.t */
- {9,22,rrr,V,S,V}, /* add.w.t */
- {9,23,rrr,V,S,V}, /* add.l.t */
- {10,20,rrr,V,V,V}, /* sub.b.t */
- {10,21,rrr,V,V,V}, /* sub.h.t */
- {10,22,rrr,V,V,V}, /* sub.w.t */
- {10,23,rrr,V,V,V}, /* sub.l.t */
- {10,20,rrr,V,S,V}, /* sub.b.t */
- {10,21,rrr,V,S,V}, /* sub.h.t */
- {10,22,rrr,V,S,V}, /* sub.w.t */
- {10,23,rrr,V,S,V}, /* sub.l.t */
- {3,20,rrr,V,V,V}, /* mul.b.t */
- {3,21,rrr,V,V,V}, /* mul.h.t */
- {3,22,rrr,V,V,V}, /* mul.w.t */
- {3,23,rrr,V,V,V}, /* mul.l.t */
- {3,20,rrr,V,S,V}, /* mul.b.t */
- {3,21,rrr,V,S,V}, /* mul.h.t */
- {3,22,rrr,V,S,V}, /* mul.w.t */
- {3,23,rrr,V,S,V}, /* mul.l.t */
- {4,20,rrr,V,V,V}, /* div.b.t */
- {4,21,rrr,V,V,V}, /* div.h.t */
- {4,22,rrr,V,V,V}, /* div.w.t */
- {4,23,rrr,V,V,V}, /* div.l.t */
- {4,20,rrr,V,S,V}, /* div.b.t */
- {4,21,rrr,V,S,V}, /* div.h.t */
- {4,22,rrr,V,S,V}, /* div.w.t */
- {4,23,rrr,V,S,V}, /* div.l.t */
-};
-struct formstr e1_format1[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {26,20,a2r,S,0,0}, /* ste.b.t */
- {26,21,a2r,S,0,0}, /* ste.h.t */
- {26,22,a2r,S,0,0}, /* ste.w.t */
- {26,23,a2r,S,0,0}, /* ste.l.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {18,20,a1r,V,0,0}, /* ld.b.t */
- {18,21,a1r,V,0,0}, /* ld.h.t */
- {18,22,a1r,V,0,0}, /* ld.w.t */
- {18,23,a1r,V,0,0}, /* ld.l.t */
- {21,20,a2r,V,0,0}, /* st.b.t */
- {21,21,a2r,V,0,0}, /* st.h.t */
- {21,22,a2r,V,0,0}, /* st.w.t */
- {21,23,a2r,V,0,0}, /* st.l.t */
-};
-struct formstr e1_format2[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {28,20,rr,V,V,0}, /* cvtw.b.t */
- {28,21,rr,V,V,0}, /* cvtw.h.t */
- {29,22,rr,V,V,0}, /* cvtb.w.t */
- {30,22,rr,V,V,0}, /* cvth.w.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {31,23,rr,V,V,0}, /* cvts.l.t */
- {32,22,rr,V,V,0}, /* cvtd.w.t */
- {33,18,rr,V,V,0}, /* cvtl.s.t */
- {28,19,rr,V,V,0}, /* cvtw.d.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {116,18,rr,V,V,0}, /* frint.s.t */
- {116,19,rr,V,V,0}, /* frint.d.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {81,18,rr,V,V,0}, /* sqrt.s.t */
- {81,19,rr,V,V,0}, /* sqrt.d.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format3[] = {
- {32,18,rr,V,V,0}, /* cvtd.s.t */
- {31,19,rr,V,V,0}, /* cvts.d.t */
- {33,19,rr,V,V,0}, /* cvtl.d.t */
- {32,23,rr,V,V,0}, /* cvtd.l.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {36,1,rr,V,V,0}, /* tzc.t */
- {44,1,rr,V,V,0}, /* lop.t */
- {117,1,rr,V,V,0}, /* xpnd.t */
- {42,1,rr,V,V,0}, /* not.t */
- {8,1,rr,S,V,0}, /* shf.t */
- {35,24,rr,V,V,0}, /* plc.t.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {37,18,rr,V,V,0}, /* eq.s.t */
- {37,19,rr,V,V,0}, /* eq.d.t */
- {43,18,rr,V,V,0}, /* neg.s.t */
- {43,19,rr,V,V,0}, /* neg.d.t */
- {37,18,rr,S,V,0}, /* eq.s.t */
- {37,19,rr,S,V,0}, /* eq.d.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {40,18,rr,V,V,0}, /* le.s.t */
- {40,19,rr,V,V,0}, /* le.d.t */
- {41,18,rr,V,V,0}, /* lt.s.t */
- {41,19,rr,V,V,0}, /* lt.d.t */
- {40,18,rr,S,V,0}, /* le.s.t */
- {40,19,rr,S,V,0}, /* le.d.t */
- {41,18,rr,S,V,0}, /* lt.s.t */
- {41,19,rr,S,V,0}, /* lt.d.t */
- {37,20,rr,V,V,0}, /* eq.b.t */
- {37,21,rr,V,V,0}, /* eq.h.t */
- {37,22,rr,V,V,0}, /* eq.w.t */
- {37,23,rr,V,V,0}, /* eq.l.t */
- {37,20,rr,S,V,0}, /* eq.b.t */
- {37,21,rr,S,V,0}, /* eq.h.t */
- {37,22,rr,S,V,0}, /* eq.w.t */
- {37,23,rr,S,V,0}, /* eq.l.t */
- {40,20,rr,V,V,0}, /* le.b.t */
- {40,21,rr,V,V,0}, /* le.h.t */
- {40,22,rr,V,V,0}, /* le.w.t */
- {40,23,rr,V,V,0}, /* le.l.t */
- {40,20,rr,S,V,0}, /* le.b.t */
- {40,21,rr,S,V,0}, /* le.h.t */
- {40,22,rr,S,V,0}, /* le.w.t */
- {40,23,rr,S,V,0}, /* le.l.t */
- {41,20,rr,V,V,0}, /* lt.b.t */
- {41,21,rr,V,V,0}, /* lt.h.t */
- {41,22,rr,V,V,0}, /* lt.w.t */
- {41,23,rr,V,V,0}, /* lt.l.t */
- {41,20,rr,S,V,0}, /* lt.b.t */
- {41,21,rr,S,V,0}, /* lt.h.t */
- {41,22,rr,S,V,0}, /* lt.w.t */
- {41,23,rr,S,V,0}, /* lt.l.t */
- {43,20,rr,V,V,0}, /* neg.b.t */
- {43,21,rr,V,V,0}, /* neg.h.t */
- {43,22,rr,V,V,0}, /* neg.w.t */
- {43,23,rr,V,V,0}, /* neg.l.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format4[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format5[] = {
- {51,20,rr,V,V,0}, /* ldvi.b.t */
- {51,21,rr,V,V,0}, /* ldvi.h.t */
- {51,22,rr,V,V,0}, /* ldvi.w.t */
- {51,23,rr,V,V,0}, /* ldvi.l.t */
- {28,18,rr,V,V,0}, /* cvtw.s.t */
- {31,22,rr,V,V,0}, /* cvts.w.t */
- {28,23,rr,V,V,0}, /* cvtw.l.t */
- {33,22,rr,V,V,0}, /* cvtl.w.t */
- {52,20,rxr,V,V,0}, /* stvi.b.t */
- {52,21,rxr,V,V,0}, /* stvi.h.t */
- {52,22,rxr,V,V,0}, /* stvi.w.t */
- {52,23,rxr,V,V,0}, /* stvi.l.t */
- {52,20,rxr,S,V,0}, /* stvi.b.t */
- {52,21,rxr,S,V,0}, /* stvi.h.t */
- {52,22,rxr,S,V,0}, /* stvi.w.t */
- {52,23,rxr,S,V,0}, /* stvi.l.t */
-};
-struct formstr e1_format6[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format7[] = {
- {84,20,r,V,0,0}, /* sum.b.t */
- {84,21,r,V,0,0}, /* sum.h.t */
- {84,22,r,V,0,0}, /* sum.w.t */
- {84,23,r,V,0,0}, /* sum.l.t */
- {85,1,r,V,0,0}, /* all.t */
- {86,1,r,V,0,0}, /* any.t */
- {87,1,r,V,0,0}, /* parity.t */
- {0,0,0,0,0,0},
- {88,20,r,V,0,0}, /* max.b.t */
- {88,21,r,V,0,0}, /* max.h.t */
- {88,22,r,V,0,0}, /* max.w.t */
- {88,23,r,V,0,0}, /* max.l.t */
- {89,20,r,V,0,0}, /* min.b.t */
- {89,21,r,V,0,0}, /* min.h.t */
- {89,22,r,V,0,0}, /* min.w.t */
- {89,23,r,V,0,0}, /* min.l.t */
- {84,18,r,V,0,0}, /* sum.s.t */
- {84,19,r,V,0,0}, /* sum.d.t */
- {90,18,r,V,0,0}, /* prod.s.t */
- {90,19,r,V,0,0}, /* prod.d.t */
- {88,18,r,V,0,0}, /* max.s.t */
- {88,19,r,V,0,0}, /* max.d.t */
- {89,18,r,V,0,0}, /* min.s.t */
- {89,19,r,V,0,0}, /* min.d.t */
- {90,20,r,V,0,0}, /* prod.b.t */
- {90,21,r,V,0,0}, /* prod.h.t */
- {90,22,r,V,0,0}, /* prod.w.t */
- {90,23,r,V,0,0}, /* prod.l.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-char *lop[] = {
- "mov", /* 0 */
- "merg", /* 1 */
- "mask", /* 2 */
- "mul", /* 3 */
- "div", /* 4 */
- "and", /* 5 */
- "or", /* 6 */
- "xor", /* 7 */
- "shf", /* 8 */
- "add", /* 9 */
- "sub", /* 10 */
- "exit", /* 11 */
- "jmp", /* 12 */
- "jmpi", /* 13 */
- "jmpa", /* 14 */
- "jmps", /* 15 */
- "tac", /* 16 */
- "ldea", /* 17 */
- "ld", /* 18 */
- "tas", /* 19 */
- "pshea", /* 20 */
- "st", /* 21 */
- "call", /* 22 */
- "calls", /* 23 */
- "callq", /* 24 */
- "pfork", /* 25 */
- "ste", /* 26 */
- "incr", /* 27 */
- "cvtw", /* 28 */
- "cvtb", /* 29 */
- "cvth", /* 30 */
- "cvts", /* 31 */
- "cvtd", /* 32 */
- "cvtl", /* 33 */
- "ldpa", /* 34 */
- "plc", /* 35 */
- "tzc", /* 36 */
- "eq", /* 37 */
- "leu", /* 38 */
- "ltu", /* 39 */
- "le", /* 40 */
- "lt", /* 41 */
- "not", /* 42 */
- "neg", /* 43 */
- "lop", /* 44 */
- "cprs", /* 45 */
- "nop", /* 46 */
- "br", /* 47 */
- "bri", /* 48 */
- "bra", /* 49 */
- "brs", /* 50 */
- "ldvi", /* 51 */
- "stvi", /* 52 */
- "ldsdr", /* 53 */
- "ldkdr", /* 54 */
- "ln", /* 55 */
- "patu", /* 56 */
- "pate", /* 57 */
- "pich", /* 58 */
- "plch", /* 59 */
- "idle", /* 60 */
- "rtnq", /* 61 */
- "cfork", /* 62 */
- "rtn", /* 63 */
- "wfork", /* 64 */
- "join", /* 65 */
- "rtnc", /* 66 */
- "exp", /* 67 */
- "sin", /* 68 */
- "cos", /* 69 */
- "psh", /* 70 */
- "pop", /* 71 */
- "eni", /* 72 */
- "dsi", /* 73 */
- "bkpt", /* 74 */
- "msync", /* 75 */
- "mski", /* 76 */
- "xmti", /* 77 */
- "tstvv", /* 78 */
- "diag", /* 79 */
- "pbkpt", /* 80 */
- "sqrt", /* 81 */
- "casr", /* 82 */
- "atan", /* 83 */
- "sum", /* 84 */
- "all", /* 85 */
- "any", /* 86 */
- "parity", /* 87 */
- "max", /* 88 */
- "min", /* 89 */
- "prod", /* 90 */
- "halt", /* 91 */
- "sysc", /* 92 */
- "trap", /* 93 */
- "tst", /* 94 */
- "lck", /* 95 */
- "ulk", /* 96 */
- "spawn", /* 97 */
- "ldcmr", /* 98 */
- "stcmr", /* 99 */
- "popr", /* 100 */
- "pshr", /* 101 */
- "rcvr", /* 102 */
- "matm", /* 103 */
- "sndr", /* 104 */
- "putr", /* 105 */
- "getr", /* 106 */
- "matr", /* 107 */
- "mat", /* 108 */
- "get", /* 109 */
- "rcv", /* 110 */
- "inc", /* 111 */
- "put", /* 112 */
- "snd", /* 113 */
- "enal", /* 114 */
- "enag", /* 115 */
- "frint", /* 116 */
- "xpnd", /* 117 */
- "ctrsl", /* 118 */
- "ctrsg", /* 119 */
- "stop", /* 120 */
-};
-char *rop[] = {
- "", /* 0 */
- ".t", /* 1 */
- ".f", /* 2 */
- ".s", /* 3 */
- ".d", /* 4 */
- ".b", /* 5 */
- ".h", /* 6 */
- ".w", /* 7 */
- ".l", /* 8 */
- ".x", /* 9 */
- ".u", /* 10 */
- ".s.f", /* 11 */
- ".d.f", /* 12 */
- ".b.f", /* 13 */
- ".h.f", /* 14 */
- ".w.f", /* 15 */
- ".l.f", /* 16 */
- ".t.f", /* 17 */
- ".s.t", /* 18 */
- ".d.t", /* 19 */
- ".b.t", /* 20 */
- ".h.t", /* 21 */
- ".w.t", /* 22 */
- ".l.t", /* 23 */
- ".t.t", /* 24 */
-};
diff --git a/gdb/convex-pinsn.c b/gdb/convex-pinsn.c
deleted file mode 100644
index ca9e9ca..0000000
--- a/gdb/convex-pinsn.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/* Print Convex instructions for GDB, the GNU debugger.
- Copyright (C) 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-
-/* reg (fmt_field, inst_field) --
- the {first,second,third} operand of instruction as fmt_field = [ijk]
- gets the value of the field from the [ijk] position of the instruction */
-
-#define reg(a,b) ((char (*)[3])(op[fmt->a]))[inst.f0.b]
-
-/* lit (fmt_field) -- field [ijk] is a literal (PSW, VL, eg) */
-
-#define lit(i) op[fmt->i]
-
-/* aj[j] -- name for A register j */
-
-#define aj ((char (*)[3])(op[A]))
-
-union inst {
- struct {
- unsigned : 7;
- unsigned i : 3;
- unsigned j : 3;
- unsigned k : 3;
- unsigned : 16;
- unsigned : 32;
- } f0;
- struct {
- unsigned : 8;
- unsigned indir : 1;
- unsigned len : 1;
- unsigned j : 3;
- unsigned k : 3;
- unsigned : 16;
- unsigned : 32;
- } f1;
- unsigned char byte[8];
- unsigned short half[4];
- char signed_byte[8];
- short signed_half[4];
-};
-
-struct opform {
- int mask; /* opcode mask */
- int shift; /* opcode align */
- struct formstr *formstr[3]; /* ST, E0, E1 */
-};
-
-struct formstr {
- unsigned lop:8, rop:5; /* opcode */
- unsigned fmt:5; /* inst format */
- unsigned i:5, j:5, k:2; /* operand formats */
-};
-
-#include "convx-opcode.h"
-
-unsigned char formdecode [] = {
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 4,4,4,4,4,4,4,4,5,5,5,5,6,6,7,8,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-
-struct opform opdecode[] = {
- 0x7e00, 9, format0, e0_format0, e1_format0,
- 0x3f00, 8, format1, e0_format1, e1_format1,
- 0x1fc0, 6, format2, e0_format2, e1_format2,
- 0x0fc0, 6, format3, e0_format3, e1_format3,
- 0x0700, 8, format4, e0_format4, e1_format4,
- 0x03c0, 6, format5, e0_format5, e1_format5,
- 0x01f8, 3, format6, e0_format6, e1_format6,
- 0x00f8, 3, format7, e0_format7, e1_format7,
- 0x0000, 0, formatx, formatx, formatx,
- 0x0f80, 7, formatx, formatx, formatx,
- 0x0f80, 7, formatx, formatx, formatx,
-};
-
-/* Print the instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- union inst inst;
- struct formstr *fmt;
- register int format, op1, pfx;
- int l;
-
- read_memory (memaddr, &inst, sizeof inst);
-
- /* Remove and note prefix, if present */
-
- pfx = inst.half[0];
- if ((pfx & 0xfff0) == 0x7ef0)
- {
- pfx = ((pfx >> 3) & 1) + 1;
- *(long long *) &inst = *(long long *) &inst.half[1];
- }
- else pfx = 0;
-
- /* Split opcode into format.op1 and look up in appropriate table */
-
- format = formdecode[inst.byte[0]];
- op1 = (inst.half[0] & opdecode[format].mask) >> opdecode[format].shift;
- if (format == 9)
- {
- if (pfx)
- fmt = formatx;
- else if (inst.f1.j == 0)
- fmt = &format1a[op1];
- else if (inst.f1.j == 1)
- fmt = &format1b[op1];
- else
- fmt = formatx;
- }
- else
- fmt = &opdecode[format].formstr[pfx][op1];
-
- /* Print it */
-
- if (fmt->fmt == xxx)
- {
- /* noninstruction */
- fprintf (stream, "0x%04x", pfx ? pfx : inst.half[0]);
- return 2;
- }
-
- if (pfx)
- pfx = 2;
-
- fprintf (stream, "%s%s%s", lop[fmt->lop], rop[fmt->rop],
- &" "[strlen(lop[fmt->lop]) + strlen(rop[fmt->rop])]);
-
- switch (fmt->fmt)
- {
- case rrr: /* three register */
- fprintf (stream, "%s,%s,%s", reg(i,i), reg(j,j), reg(k,k));
- return pfx + 2;
-
- case rr: /* two register */
- fprintf (stream, "%s,%s", reg(i,j), reg(j,k));
- return pfx + 2;
-
- case rxr: /* two register, reversed i and j fields */
- fprintf (stream, "%s,%s", reg(i,k), reg(j,j));
- return pfx + 2;
-
- case r: /* one register */
- fprintf (stream, "%s", reg(i,k));
- return pfx + 2;
-
- case nops: /* no operands */
- return pfx + 2;
-
- case nr: /* short immediate, one register */
- fprintf (stream, "#%d,%s", inst.f0.j, reg(i,k));
- return pfx + 2;
-
- case pcrel: /* pc relative */
- print_address (memaddr + 2 * inst.signed_byte[1], stream);
- return pfx + 2;
-
- case lr: /* literal, one register */
- fprintf (stream, "%s,%s", lit(i), reg(j,k));
- return pfx + 2;
-
- case rxl: /* one register, literal */
- fprintf (stream, "%s,%s", reg(i,k), lit(j));
- return pfx + 2;
-
- case rlr: /* register, literal, register */
- fprintf (stream, "%s,%s,%s", reg(i,j), lit(j), reg(k,k));
- return pfx + 2;
-
- case rrl: /* register, register, literal */
- fprintf (stream, "%s,%s,%s", reg(i,j), reg(j,k), lit(k));
- return pfx + 2;
-
- case iml: /* immediate, literal */
- if (inst.f1.len)
- {
- fprintf (stream, "#%#x,%s",
- (inst.signed_half[1] << 16) + inst.half[2], lit(i));
- return pfx + 6;
- }
- else
- {
- fprintf (stream, "#%d,%s", inst.signed_half[1], lit(i));
- return pfx + 4;
- }
-
- case imr: /* immediate, register */
- if (inst.f1.len)
- {
- fprintf (stream, "#%#x,%s",
- (inst.signed_half[1] << 16) + inst.half[2], reg(i,k));
- return pfx + 6;
- }
- else
- {
- fprintf (stream, "#%d,%s", inst.signed_half[1], reg(i,k));
- return pfx + 4;
- }
-
- case a1r: /* memory, register */
- l = print_effa (inst, stream);
- fprintf (stream, ",%s", reg(i,k));
- return pfx + l;
-
- case a1l: /* memory, literal */
- l = print_effa (inst, stream);
- fprintf (stream, ",%s", lit(i));
- return pfx + l;
-
- case a2r: /* register, memory */
- fprintf (stream, "%s,", reg(i,k));
- return pfx + print_effa (inst, stream);
-
- case a2l: /* literal, memory */
- fprintf (stream, "%s,", lit(i));
- return pfx + print_effa (inst, stream);
-
- case a3: /* memory */
- return pfx + print_effa (inst, stream);
-
- case a4: /* system call */
- l = 29; goto a4a5;
- case a5: /* trap */
- l = 27;
- a4a5:
- if (inst.f1.len)
- {
- unsigned int m = (inst.signed_half[1] << 16) + inst.half[2];
- fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l)));
- return pfx + 6;
- }
- else
- {
- unsigned int m = inst.signed_half[1];
- fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l)));
- return pfx + 4;
- }
- }
-}
-
-
-/* print effective address @nnn(aj), return instruction length */
-
-int print_effa (inst, stream)
- union inst inst;
- FILE *stream;
-{
- int n, l;
-
- if (inst.f1.len)
- {
- n = (inst.signed_half[1] << 16) + inst.half[2];
- l = 6;
- }
- else
- {
- n = inst.signed_half[1];
- l = 4;
- }
-
- if (inst.f1.indir)
- printf ("@");
-
- if (!inst.f1.j)
- {
- print_address (n, stream);
- return l;
- }
-
- fprintf (stream, (n & 0xf0000000) == 0x80000000 ? "%#x(%s)" : "%d(%s)",
- n, aj[inst.f1.j]);
-
- return l;
-}
diff --git a/gdb/convex-tdep.c b/gdb/convex-tdep.c
deleted file mode 100644
index ce6382b..0000000
--- a/gdb/convex-tdep.c
+++ /dev/null
@@ -1,931 +0,0 @@
-/* Convex stuff for GDB.
- Copyright (C) 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "command.h"
-#include "symtab.h"
-#include "value.h"
-#include "frame.h"
-#include "inferior.h"
-#include "wait.h"
-
-#include <signal.h>
-#include <fcntl.h>
-
-#include "gdbcore.h"
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <sys/pcntl.h>
-#include <sys/thread.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-
-#include "gdbcmd.h"
-
-exec_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- int n;
- struct stat st_exec;
-
- /* Eliminate all traces of old exec file.
- Mark text segment as empty. */
-
- if (execfile)
- free (execfile);
- execfile = 0;
- data_start = 0;
- data_end = 0;
- text_start = 0;
- text_end = 0;
- exec_data_start = 0;
- exec_data_end = 0;
- if (execchan >= 0)
- close (execchan);
- execchan = -1;
-
- n_exec = 0;
-
- /* Now open and digest the file the user requested, if any. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
- &execfile);
- if (execchan < 0)
- perror_with_name (filename);
-
- if (myread (execchan, &filehdr, sizeof filehdr) < 0)
- perror_with_name (filename);
-
- if (! IS_SOFF_MAGIC (filehdr.h_magic))
- error ("%s: not an executable file.", filename);
-
- if (myread (execchan, &opthdr, filehdr.h_opthdr) <= 0)
- perror_with_name (filename);
-
- /* Read through the section headers.
- For text, data, etc, record an entry in the exec file map.
- Record text_start and text_end. */
-
- lseek (execchan, (long) filehdr.h_scnptr, 0);
-
- for (n = 0; n < filehdr.h_nscns; n++)
- {
- if (myread (execchan, &scnhdr, sizeof scnhdr) < 0)
- perror_with_name (filename);
-
- if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT
- && (scnhdr.s_flags & S_TYPMASK) <= S_COMON)
- {
- exec_map[n_exec].mem_addr = scnhdr.s_vaddr;
- exec_map[n_exec].mem_end = scnhdr.s_vaddr + scnhdr.s_size;
- exec_map[n_exec].file_addr = scnhdr.s_scnptr;
- exec_map[n_exec].type = scnhdr.s_flags & S_TYPMASK;
- n_exec++;
-
- if ((scnhdr.s_flags & S_TYPMASK) == S_TEXT)
- {
- text_start = scnhdr.s_vaddr;
- text_end = scnhdr.s_vaddr + scnhdr.s_size;
- }
- }
- }
-
- fstat (execchan, &st_exec);
- exec_mtime = st_exec.st_mtime;
-
- validate_files ();
- }
- else if (from_tty)
- printf_filtered ("No exec file now.\n");
-
- /* Tell display code (if any) about the changed file name. */
- if (exec_file_display_hook)
- (*exec_file_display_hook) (filename);
-}
-
-/* Read data from SOFF exec or core file.
- Return 0 on success, EIO if address out of bounds. */
-
-int
-xfer_core_file (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- register int i;
- register int n;
- register int val;
- int xferchan;
- char **xferfile;
- int fileptr;
- int returnval = 0;
-
- while (len > 0)
- {
- xferfile = 0;
- xferchan = 0;
-
- /* Determine which file the next bunch of addresses reside in,
- and where in the file. Set the file's read/write pointer
- to point at the proper place for the desired address
- and set xferfile and xferchan for the correct file.
- If desired address is nonexistent, leave them zero.
- i is set to the number of bytes that can be handled
- along with the next address. */
-
- i = len;
-
- for (n = 0; n < n_core; n++)
- {
- if (memaddr >= core_map[n].mem_addr && memaddr < core_map[n].mem_end
- && (core_map[n].thread == -1
- || core_map[n].thread == inferior_thread))
- {
- i = min (len, core_map[n].mem_end - memaddr);
- fileptr = core_map[n].file_addr + memaddr - core_map[n].mem_addr;
- if (core_map[n].file_addr)
- {
- xferfile = &corefile;
- xferchan = corechan;
- }
- break;
- }
- else if (core_map[n].mem_addr >= memaddr
- && core_map[n].mem_addr < memaddr + i)
- i = core_map[n].mem_addr - memaddr;
- }
-
- if (!xferfile)
- for (n = 0; n < n_exec; n++)
- {
- if (memaddr >= exec_map[n].mem_addr
- && memaddr < exec_map[n].mem_end)
- {
- i = min (len, exec_map[n].mem_end - memaddr);
- fileptr = exec_map[n].file_addr + memaddr
- - exec_map[n].mem_addr;
- if (exec_map[n].file_addr)
- {
- xferfile = &execfile;
- xferchan = execchan;
- }
- break;
- }
- else if (exec_map[n].mem_addr >= memaddr
- && exec_map[n].mem_addr < memaddr + i)
- i = exec_map[n].mem_addr - memaddr;
- }
-
- /* Now we know which file to use.
- Set up its pointer and transfer the data. */
- if (xferfile)
- {
- if (*xferfile == 0)
- if (xferfile == &execfile)
- error ("No program file to examine.");
- else
- error ("No core dump file or running program to examine.");
- val = lseek (xferchan, fileptr, 0);
- if (val < 0)
- perror_with_name (*xferfile);
- val = myread (xferchan, myaddr, i);
- if (val < 0)
- perror_with_name (*xferfile);
- }
- /* If this address is for nonexistent memory,
- read zeros if reading, or do nothing if writing. */
- else
- {
- bzero (myaddr, i);
- returnval = EIO;
- }
-
- memaddr += i;
- myaddr += i;
- len -= i;
- }
- return returnval;
-}
-
-
-/* Here from info files command to print an address map. */
-
-print_maps ()
-{
- struct pmap ptrs[200];
- int n;
-
- /* ID strings for core and executable file sections */
-
- static char *idstr[] =
- {
- "0", "text", "data", "tdata", "bss", "tbss",
- "common", "ttext", "ctx", "tctx", "10", "11", "12",
- };
-
- for (n = 0; n < n_core; n++)
- {
- core_map[n].which = 0;
- ptrs[n] = core_map[n];
- }
- for (n = 0; n < n_exec; n++)
- {
- exec_map[n].which = 1;
- ptrs[n_core+n] = exec_map[n];
- }
-
- qsort (ptrs, n_core + n_exec, sizeof *ptrs, ptr_cmp);
-
- for (n = 0; n < n_core + n_exec; n++)
- {
- struct pmap *p = &ptrs[n];
- if (n > 0)
- {
- if (p->mem_addr < ptrs[n-1].mem_end)
- p->mem_addr = ptrs[n-1].mem_end;
- if (p->mem_addr >= p->mem_end)
- continue;
- }
- printf_filtered ("%08x .. %08x %-6s %s\n",
- p->mem_addr, p->mem_end, idstr[p->type],
- p->which ? execfile : corefile);
- }
-}
-
-/* Compare routine to put file sections in order.
- Sort into increasing order on address, and put core file sections
- before exec file sections if both files contain the same addresses. */
-
-static ptr_cmp (a, b)
- struct pmap *a, *b;
-{
- if (a->mem_addr != b->mem_addr) return a->mem_addr - b->mem_addr;
- return a->which - b->which;
-}
-
-/* Trapped internal variables are used to handle special registers.
- A trapped i.v. calls a hook here every time it is dereferenced,
- to provide a new value for the variable, and it calls a hook here
- when a new value is assigned, to do something with the value.
-
- The vector registers are $vl, $vs, $vm, $vN, $VN (N in 0..7).
- The communication registers are $cN, $CN (N in 0..63).
- They not handled as regular registers because it's expensive to
- read them, and their size varies, and they have too many names. */
-
-
-/* Return 1 if NAME is a trapped internal variable, else 0. */
-
-int
-is_trapped_internalvar (name)
- char *name;
-{
- if ((name[0] == 'c' || name[0] == 'C')
- && name[1] >= '0' && name[1] <= '9'
- && (name[2] == '\0'
- || (name[2] >= '0' && name[2] <= '9'
- && name[3] == '\0' && name[1] != '0'))
- && atoi (&name[1]) < 64) return 1;
-
- if ((name[0] == 'v' || name[0] == 'V')
- && (((name[1] & -8) == '0' && name[2] == '\0')
- || !strcmp (name, "vl")
- || !strcmp (name, "vs")
- || !strcmp (name, "vm")))
- return 1;
- else return 0;
-}
-
-/* Return the value of trapped internal variable VAR */
-
-value
-value_of_trapped_internalvar (var)
- struct internalvar *var;
-{
- char *name = var->name;
- value val;
- struct type *type;
- long len = *read_vector_register (VL_REGNUM);
- if (len <= 0 || len > 128) len = 128;
-
- if (!strcmp (name, "vl"))
- {
- val = value_from_longest (builtin_type_int,
- (LONGEST) *read_vector_register_1 (VL_REGNUM));
- }
- else if (!strcmp (name, "vs"))
- {
- val = value_from_longest (builtin_type_int,
- (LONGEST) *read_vector_register_1 (VS_REGNUM));
- }
- else if (!strcmp (name, "vm"))
- {
- long vm[4];
- long i, *p;
- bcopy (read_vector_register_1 (VM_REGNUM), vm, sizeof vm);
- type = vector_type (builtin_type_int, len);
- val = allocate_value (type);
- p = (long *) VALUE_CONTENTS (val);
- for (i = 0; i < len; i++)
- *p++ = !! (vm[3 - (i >> 5)] & (1 << (i & 037)));
- }
- else if (name[0] == 'V')
- {
- type = vector_type (builtin_type_long_long, len);
- val = allocate_value (type);
- bcopy (read_vector_register_1 (name[1] - '0'),
- VALUE_CONTENTS (val), TYPE_LENGTH (type));
- }
- else if (name[0] == 'v')
- {
- long *p1, *p2;
- type = vector_type (builtin_type_long, len);
- val = allocate_value (type);
- p1 = read_vector_register_1 (name[1] - '0');
- p2 = (long *) VALUE_CONTENTS (val);
- while (--len >= 0) {p1++; *p2++ = *p1++;}
- }
-
- else if (name[0] == 'c')
- val = value_from_longest (builtin_type_int,
- read_comm_register (atoi (&name[1])));
- else if (name[0] == 'C')
- val = value_from_longest (builtin_type_long_long,
- read_comm_register (atoi (&name[1])));
-
- VALUE_LVAL (val) = lval_internalvar;
- VALUE_INTERNALVAR (val) = var;
- return val;
-}
-
-/* Construct the type for a vector register's value --
- array[LENGTH] of ELEMENT_TYPE. */
-
-static struct type *
-vector_type (element_type, length)
- struct type *element_type;
- long length;
-{
- struct type *type = (struct type *) xmalloc (sizeof (struct type));
- bzero (type, sizeof type);
- TYPE_CODE (type) = TYPE_CODE_ARRAY;
- TYPE_TARGET_TYPE (type) = element_type;
- TYPE_LENGTH (type) = length * TYPE_LENGTH (TYPE_TARGET_TYPE (type));
- return type;
-}
-
-/* Handle a new value assigned to a trapped internal variable */
-
-void
-set_trapped_internalvar (var, val, bitpos, bitsize, offset)
- struct internalvar *var;
- value val;
- int bitpos, bitsize, offset;
-{
- char *name = var->name;
- long long newval = value_as_long (val);
-
- if (!strcmp (name, "vl"))
- write_vector_register (VL_REGNUM, 0, newval);
- else if (!strcmp (name, "vs"))
- write_vector_register (VS_REGNUM, 0, newval);
- else if (name[0] == 'c' || name[0] == 'C')
- write_comm_register (atoi (&name[1]), newval);
- else if (!strcmp (name, "vm"))
- error ("can't assign to $vm");
- else
- {
- offset /= bitsize / 8;
- write_vector_register (name[1] - '0', offset, newval);
- }
-}
-
-/* Print an integer value when no format was specified. gdb normally
- prints these values in decimal, but the the leading 0x80000000 of
- pointers produces intolerable 10-digit negative numbers.
- If it looks like an address, print it in hex instead. */
-
-decout (stream, type, val)
- FILE *stream;
- struct type *type;
- LONGEST val;
-{
- long lv = val;
-
- switch (output_radix)
- {
- case 0:
- if ((lv == val || (unsigned) lv == val)
- && ((lv & 0xf0000000) == 0x80000000
- || ((lv & 0xf0000000) == 0xf0000000 && lv < STACK_END_ADDR)))
- {
- fprintf_filtered (stream, "%#x", lv);
- return;
- }
-
- case 10:
- fprintf_filtered (stream, TYPE_UNSIGNED (type) ? "%llu" : "%lld", val);
- return;
-
- case 8:
- if (TYPE_LENGTH (type) <= sizeof lv)
- fprintf_filtered (stream, "%#o", lv);
- else
- fprintf_filtered (stream, "%#llo", val);
- return;
-
- case 16:
- if (TYPE_LENGTH (type) <= sizeof lv)
- fprintf_filtered (stream, "%#x", lv);
- else
- fprintf_filtered (stream, "%#llx", val);
- return;
- }
-}
-
-/* Change the default output radix to 10 or 16, or set it to 0 (heuristic).
- This command is mostly obsolete now that the print command allows
- formats to apply to aggregates, but is still handy occasionally. */
-
-static void
-set_base_command (arg)
- char *arg;
-{
- int new_radix;
-
- if (!arg)
- output_radix = 0;
- else
- {
- new_radix = atoi (arg);
- if (new_radix != 10 && new_radix != 16 && new_radix != 8)
- error ("base must be 8, 10 or 16, or null");
- else output_radix = new_radix;
- }
-}
-
-/* Turn pipelining on or off in the inferior. */
-
-static void
-set_pipelining_command (arg)
- char *arg;
-{
- if (!arg)
- {
- sequential = !sequential;
- printf_filtered ("%s\n", sequential ? "off" : "on");
- }
- else if (!strcmp (arg, "on"))
- sequential = 0;
- else if (!strcmp (arg, "off"))
- sequential = 1;
- else error ("valid args are `on', to allow instructions to overlap, or\n\
-`off', to prevent it and thereby pinpoint exceptions.");
-}
-
-/* Enable, disable, or force parallel execution in the inferior. */
-
-static void
-set_parallel_command (arg)
- char *arg;
-{
- struct rlimit rl;
- int prevparallel = parallel;
-
- if (!strncmp (arg, "fixed", strlen (arg)))
- parallel = 2;
- else if (!strcmp (arg, "on"))
- parallel = 1;
- else if (!strcmp (arg, "off"))
- parallel = 0;
- else error ("valid args are `on', to allow multiple threads, or\n\
-`fixed', to force multiple threads, or\n\
-`off', to run with one thread only.");
-
- if ((prevparallel == 0) != (parallel == 0) && inferior_pid)
- printf_filtered ("will take effect at next run.\n");
-
- getrlimit (RLIMIT_CONCUR, &rl);
- rl.rlim_cur = parallel ? rl.rlim_max : 1;
- setrlimit (RLIMIT_CONCUR, &rl);
-
- if (inferior_pid)
- set_fixed_scheduling (inferior_pid, parallel == 2);
-}
-
-/* Add a new name for an existing command. */
-
-static void
-alias_command (arg)
- char *arg;
-{
- static char *aliaserr = "usage is `alias NEW OLD', no args allowed";
- char *newname = arg;
- struct cmd_list_element *new, *old;
-
- if (!arg)
- error_no_arg ("newname oldname");
-
- new = lookup_cmd (&arg, cmdlist, "", -1);
- if (new && !strncmp (newname, new->name, strlen (new->name)))
- {
- newname = new->name;
- if (!(*arg == '-'
- || (*arg >= 'a' && *arg <= 'z')
- || (*arg >= 'A' && *arg <= 'Z')
- || (*arg >= '0' && *arg <= '9')))
- error (aliaserr);
- }
- else
- {
- arg = newname;
- while (*arg == '-'
- || (*arg >= 'a' && *arg <= 'z')
- || (*arg >= 'A' && *arg <= 'Z')
- || (*arg >= '0' && *arg <= '9'))
- arg++;
- if (*arg != ' ' && *arg != '\t')
- error (aliaserr);
- *arg = '\0';
- arg++;
- }
-
- old = lookup_cmd (&arg, cmdlist, "", 0);
-
- if (*arg != '\0')
- error (aliaserr);
-
- if (new && !strncmp (newname, new->name, strlen (new->name)))
- {
- char *tem;
- if (new->class == (int) class_user || new->class == (int) class_alias)
- tem = "Redefine command \"%s\"? ";
- else
- tem = "Really redefine built-in command \"%s\"? ";
- if (!query (tem, new->name))
- error ("Command \"%s\" not redefined.", new->name);
- }
-
- add_com (newname, class_alias, old->function, old->doc);
-}
-
-
-
-/* Print the current thread number, and any threads with signals in the
- queue. */
-
-thread_info ()
-{
- struct threadpid *p;
-
- if (have_inferior_p ())
- {
- ps.pi_buffer = (char *) &comm_registers;
- ps.pi_nbytes = sizeof comm_registers;
- ps.pi_offset = 0;
- ps.pi_thread = inferior_thread;
- ioctl (inferior_fd, PIXRDCREGS, &ps);
- }
-
- printf_filtered ("Current thread %d stopped with signal %d.%d (%s).\n",
- inferior_thread, stop_signal, stop_sigcode,
- subsig_name (stop_signal, stop_sigcode));
-
- for (p = signal_stack; p->pid; p--)
- printf_filtered ("Thread %d stopped with signal %d.%d (%s).\n",
- p->thread, p->signo, p->subsig,
- subsig_name (p->signo, p->subsig));
-
- if (iscrlbit (comm_registers.crctl.lbits.cc, 64+13))
- printf_filtered ("New thread start pc %#x\n",
- (long) (comm_registers.crreg.pcpsw >> 32));
-}
-
-/* Return string describing a signal.subcode number */
-
-static char *
-subsig_name (signo, subcode)
- int signo, subcode;
-{
- static char *subsig4[] = {
- "error exit", "privileged instruction", "unknown",
- "unknown", "undefined opcode",
- 0};
- static char *subsig5[] = {0,
- "breakpoint", "single step", "fork trap", "exec trap", "pfork trap",
- "join trap", "idle trap", "last thread", "wfork trap",
- "process breakpoint", "trap instruction",
- 0};
- static char *subsig8[] = {0,
- "int overflow", "int divide check", "float overflow",
- "float divide check", "float underflow", "reserved operand",
- "sqrt error", "exp error", "ln error", "sin error", "cos error",
- 0};
- static char *subsig10[] = {0,
- "invalid inward ring address", "invalid outward ring call",
- "invalid inward ring return", "invalid syscall gate",
- "invalid rtn frame length", "invalid comm reg address",
- "invalid trap gate",
- 0};
- static char *subsig11[] = {0,
- "read access denied", "write access denied", "execute access denied",
- "segment descriptor fault", "page table fault", "data reference fault",
- "i/o access denied", "levt pte invalid",
- 0};
-
- static char **subsig_list[] =
- {0, 0, 0, 0, subsig4, subsig5, 0, 0, subsig8, 0, subsig10, subsig11, 0};
-
- int i;
- char *p = signo < NSIG ? sys_siglist[signo] : "unknown";
-
- if (signo >= (sizeof subsig_list / sizeof *subsig_list)
- || !subsig_list[signo])
- return p;
- for (i = 1; subsig_list[signo][i]; i++)
- if (i == subcode)
- return subsig_list[signo][subcode];
- return p;
-}
-
-
-/* Print a compact display of thread status, essentially x/i $pc
- for all active threads. */
-
-static void
-threadstat ()
-{
- int t;
-
- for (t = 0; t < n_threads; t++)
- if (thread_state[t] == PI_TALIVE)
- {
- printf_filtered ("%d%c %08x%c %d.%d ", t,
- (t == inferior_thread ? '*' : ' '), thread_pc[t],
- (thread_is_in_kernel[t] ? '#' : ' '),
- thread_signal[t], thread_sigcode[t]);
- print_insn (thread_pc[t], stdout);
- printf_filtered ("\n");
- }
-}
-
-/* Change the current thread to ARG. */
-
-set_thread_command (arg)
- char *arg;
-{
- int thread;
-
- if (!arg)
- {
- threadstat ();
- return;
- }
-
- thread = parse_and_eval_address (arg);
-
- if (thread < 0 || thread > n_threads || thread_state[thread] != PI_TALIVE)
- error ("no such thread.");
-
- select_thread (thread);
-
- stop_pc = read_pc ();
- flush_cached_frames ();
- set_current_frame (create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- select_frame (get_current_frame (), 0);
- print_stack_frame (selected_frame, selected_frame_level, -1);
-}
-
-/* Here on CONT command; gdb's dispatch address is changed to come here.
- Set global variable ALL_CONTINUE to tell resume() that it should
- start up all threads, and that a thread switch will not blow gdb's
- mind. */
-
-static void
-convex_cont_command (proc_count_exp, from_tty)
- char *proc_count_exp;
- int from_tty;
-{
- all_continue = 1;
- cont_command (proc_count_exp, from_tty);
-}
-
-/* Here on 1CONT command. Resume only the current thread. */
-
-one_cont_command (proc_count_exp, from_tty)
- char *proc_count_exp;
- int from_tty;
-{
- cont_command (proc_count_exp, from_tty);
-}
-
-/* Print the contents and lock bits of all communication registers,
- or just register ARG if ARG is a communication register,
- or the 3-word resource structure in memory at address ARG. */
-
-comm_registers_info (arg)
- char *arg;
-{
- int i, regnum;
-
- if (arg)
- {
- if (sscanf (arg, "$c%d", &regnum) == 1) {
- ;
- } else if (sscanf (arg, "$C%d", &regnum) == 1) {
- ;
- } else {
- regnum = parse_and_eval_address (arg);
- if (regnum > 0)
- regnum &= ~0x8000;
- }
-
- if (regnum >= 64)
- error ("%s: invalid register name.", arg);
-
- /* if we got a (user) address, examine the resource struct there */
-
- if (regnum < 0)
- {
- static int buf[3];
- read_memory (regnum, buf, sizeof buf);
- printf_filtered ("%08x %08x%08x%s\n", regnum, buf[1], buf[2],
- buf[0] & 0xff ? " locked" : "");
- return;
- }
- }
-
- ps.pi_buffer = (char *) &comm_registers;
- ps.pi_nbytes = sizeof comm_registers;
- ps.pi_offset = 0;
- ps.pi_thread = inferior_thread;
- ioctl (inferior_fd, PIXRDCREGS, &ps);
-
- for (i = 0; i < 64; i++)
- if (!arg || i == regnum)
- printf_filtered ("%2d 0x8%03x %016llx%s\n", i, i,
- comm_registers.crreg.r4[i],
- (iscrlbit (comm_registers.crctl.lbits.cc, i)
- ? " locked" : ""));
-}
-
-/* Print the psw */
-
-static void
-psw_info (arg)
- char *arg;
-{
- struct pswbit
- {
- int bit;
- int pos;
- char *text;
- };
-
- static struct pswbit pswbit[] =
- {
- { 0x80000000, -1, "A carry" },
- { 0x40000000, -1, "A integer overflow" },
- { 0x20000000, -1, "A zero divide" },
- { 0x10000000, -1, "Integer overflow enable" },
- { 0x08000000, -1, "Trace" },
- { 0x06000000, 25, "Frame length" },
- { 0x01000000, -1, "Sequential" },
- { 0x00800000, -1, "S carry" },
- { 0x00400000, -1, "S integer overflow" },
- { 0x00200000, -1, "S zero divide" },
- { 0x00100000, -1, "Zero divide enable" },
- { 0x00080000, -1, "Floating underflow" },
- { 0x00040000, -1, "Floating overflow" },
- { 0x00020000, -1, "Floating reserved operand" },
- { 0x00010000, -1, "Floating zero divide" },
- { 0x00008000, -1, "Floating error enable" },
- { 0x00004000, -1, "Floating underflow enable" },
- { 0x00002000, -1, "IEEE" },
- { 0x00001000, -1, "Sequential stores" },
- { 0x00000800, -1, "Intrinsic error" },
- { 0x00000400, -1, "Intrinsic error enable" },
- { 0x00000200, -1, "Trace thread creates" },
- { 0x00000100, -1, "Thread init trap" },
- { 0x000000e0, 5, "Reserved" },
- { 0x0000001f, 0, "Intrinsic error code" },
- {0, 0, 0},
- };
-
- long psw;
- struct pswbit *p;
-
- if (arg)
- psw = parse_and_eval_address (arg);
- else
- psw = read_register (PS_REGNUM);
-
- for (p = pswbit; p->bit; p++)
- {
- if (p->pos < 0)
- printf_filtered ("%08x %s %s\n", p->bit,
- (psw & p->bit) ? "yes" : "no ", p->text);
- else
- printf_filtered ("%08x %3d %s\n", p->bit,
- (psw & p->bit) >> p->pos, p->text);
- }
-}
-
-_initialize_convex_dep ()
-{
- add_com ("alias", class_support, alias_command,
- "Add a new name for an existing command.");
-
- add_cmd ("base", class_vars, set_base_command,
- "Change the integer output radix to 8, 10 or 16\n\
-or use just `set base' with no args to return to the ad-hoc default,\n\
-which is 16 for integers that look like addresses, 10 otherwise.",
- &setlist);
-
- add_cmd ("pipeline", class_run, set_pipelining_command,
- "Enable or disable overlapped execution of instructions.\n\
-With `set pipe off', exceptions are reported with\n\
-$pc pointing at the instruction after the faulting one.\n\
-The default is `set pipe on', which runs faster.",
- &setlist);
-
- add_cmd ("parallel", class_run, set_parallel_command,
- "Enable or disable multi-threaded execution of parallel code.\n\
-`set parallel off' means run the program on a single CPU.\n\
-`set parallel fixed' means run the program with all CPUs assigned to it.\n\
-`set parallel on' means run the program on any CPUs that are available.",
- &setlist);
-
- add_com ("1cont", class_run, one_cont_command,
- "Continue the program, activating only the current thread.\n\
-Args are the same as the `cont' command.");
-
- add_com ("thread", class_run, set_thread_command,
- "Change the current thread, the one under scrutiny and control.\n\
-With no arg, show the active threads, the current one marked with *.");
-
- add_info ("threads", thread_info,
- "List status of active threads.");
-
- add_info ("comm-registers", comm_registers_info,
- "List communication registers and their contents.\n\
-A communication register name as argument means describe only that register.\n\
-An address as argument means describe the resource structure at that address.\n\
-`Locked' means that the register has been sent to but not yet received from.");
-
- add_info ("psw", psw_info,
- "Display $ps, the processor status word, bit by bit.\n\
-An argument means display that value's interpretation as a psw.");
-
- add_cmd ("convex", no_class, 0, "Convex-specific commands.\n\
-32-bit registers $pc $ps $sp $ap $fp $a1-5 $s0-7 $v0-7 $vl $vs $vm $c0-63\n\
-64-bit registers $S0-7 $V0-7 $C0-63\n\
-\n\
-info threads display info on stopped threads waiting to signal\n\
-thread display list of active threads\n\
-thread N select thread N (its registers, stack, memory, etc.)\n\
-step, next, etc step selected thread only\n\
-1cont continue selected thread only\n\
-cont continue all threads\n\
-info comm-registers display contents of comm register(s) or a resource struct\n\
-info psw display processor status word $ps\n\
-set base N change integer radix used by `print' without a format\n\
-set pipeline off exceptions are precise, $pc points after the faulting insn\n\
-set pipeline on normal mode, $pc is somewhere ahead of faulting insn\n\
-set parallel off program runs on a single CPU\n\
-set parallel fixed all CPUs are assigned to the program\n\
-set parallel on normal mode, parallel execution on random available CPUs\n\
-",
- &cmdlist);
-
-}
diff --git a/gdb/convex-xdep.c b/gdb/convex-xdep.c
deleted file mode 100644
index bfce6eb..0000000
--- a/gdb/convex-xdep.c
+++ /dev/null
@@ -1,983 +0,0 @@
-/* Convex stuff for GDB.
- Copyright (C) 1990-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "command.h"
-#include "symtab.h"
-#include "value.h"
-#include "frame.h"
-#include "inferior.h"
-#include "wait.h"
-
-#include <signal.h>
-#include <fcntl.h>
-#include "gdbcore.h"
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <sys/pcntl.h>
-#include <sys/thread.h>
-#include <sys/proc.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-
-#include <convex/vmparam.h>
-#include <convex/filehdr.h>
-#include <convex/opthdr.h>
-#include <convex/scnhdr.h>
-#include <convex/core.h>
-
-/* Per-thread data, read from the inferior at each stop and written
- back at each resume. */
-
-/* Number of active threads.
- Tables are valid for thread numbers less than this. */
-
-static int n_threads;
-
-#define MAXTHREADS 8
-
-/* Thread state. The remaining data is valid only if this is PI_TALIVE. */
-
-static int thread_state[MAXTHREADS];
-
-/* Stop pc, signal, signal subcode */
-
-static int thread_pc[MAXTHREADS];
-static int thread_signal[MAXTHREADS];
-static int thread_sigcode[MAXTHREADS];
-
-/* Thread registers.
- If thread is selected, the regs are in registers[] instead. */
-
-static char thread_regs[MAXTHREADS][REGISTER_BYTES];
-
-/* 1 if the top frame on the thread's stack was a context frame,
- meaning that the kernel is up to something and we should not
- touch the thread at all except to resume it. */
-
-static char thread_is_in_kernel[MAXTHREADS];
-
-/* The currently selected thread's number. */
-
-static int inferior_thread;
-
-/* Inferior process's file handle and a process control block
- to feed args to ioctl with. */
-
-static int inferior_fd;
-static struct pcntl ps;
-
-/* SOFF file headers for exec or core file. */
-
-static FILEHDR filehdr;
-static OPTHDR opthdr;
-static SCNHDR scnhdr;
-
-/* Address maps constructed from section headers of exec and core files.
- Defines process address -> file address translation. */
-
-struct pmap
-{
- long mem_addr; /* process start address */
- long mem_end; /* process end+1 address */
- long file_addr; /* file start address */
- long thread; /* -1 shared; 0,1,... thread-local */
- long type; /* S_TEXT S_DATA S_BSS S_TBSS etc */
- long which; /* used to sort map for info files */
-};
-
-static int n_exec, n_core;
-static struct pmap exec_map[100];
-static struct pmap core_map[100];
-
-/* Offsets in the core file of core_context and core_tcontext blocks. */
-
-static int context_offset;
-static int tcontext_offset[MAXTHREADS];
-
-/* Core file control blocks. */
-
-static struct core_context_v70 c;
-static struct core_tcontext_v70 tc;
-static struct user u;
-static thread_t th;
-static proc_t pr;
-
-/* The registers of the currently selected thread. */
-
-extern char registers[REGISTER_BYTES];
-
-/* Vector and communication registers from core dump or from inferior.
- These are read on demand, ie, not normally valid. */
-
-static struct vecst vector_registers;
-static struct creg_ctx comm_registers;
-
-/* Flag, set on a vanilla CONT command and cleared when the inferior
- is continued. */
-
-static int all_continue;
-
-/* Flag, set when the inferior is continued by a vanilla CONT command,
- cleared if it is continued for any other purpose. */
-
-static int thread_switch_ok;
-
-/* Stack of signals recieved from threads but not yet delivered to gdb. */
-
-struct threadpid
-{
- int pid;
- int thread;
- int signo;
- int subsig;
- int pc;
-};
-
-static struct threadpid signal_stack_bot[100];
-static struct threadpid *signal_stack = signal_stack_bot;
-
-/* How to detect empty stack -- bottom frame is all zero. */
-
-#define signal_stack_is_empty() (signal_stack->pid == 0)
-
-/* Mode controlled by SET PIPE command, controls the psw SEQ bit
- which forces each instruction to complete before the next one starts. */
-
-static int sequential = 0;
-
-/* Mode controlled by the SET PARALLEL command. Values are:
- 0 concurrency limit 1 thread, dynamic scheduling
- 1 no concurrency limit, dynamic scheduling
- 2 no concurrency limit, fixed scheduling */
-
-static int parallel = 1;
-
-/* Mode controlled by SET BASE command, output radix for unformatted
- integer typeout, as in argument lists, aggregates, and so on.
- Zero means guess whether it's an address (hex) or not (decimal). */
-
-static int output_radix = 0;
-
-/* Signal subcode at last thread stop. */
-
-static int stop_sigcode;
-
-/* Hack, see wait() below. */
-
-static int exec_trap_timer;
-
-#include "gdbcmd.h"
-
-/* Nonzero if we are debugging an attached outside process
- rather than an inferior. */
-
-extern int attach_flag;
-
-
-
-static struct type *vector_type ();
-static long *read_vector_register ();
-static long *read_vector_register_1 ();
-static void write_vector_register ();
-static REGISTER_TYPE read_comm_register ();
-static void write_comm_register ();
-static void convex_cont_command ();
-static void thread_continue ();
-static void select_thread ();
-static void scan_stack ();
-static void set_fixed_scheduling ();
-static char *subsig_name ();
-static void psw_info ();
-static sig_noop ();
-static ptr_cmp ();
-
-extern char *sys_siglist[];
-
-/* Execute ptrace. Convex V7 replaced ptrace with pattach.
- Allow ptrace (0) as a no-op. */
-
-int
-call_ptrace (request, pid, procaddr, buf)
- int request, pid, procaddr, buf;
-{
- if (request == 0)
- return;
- error ("no ptrace");
-}
-
-/* Replacement for system execle routine.
- Convert it to an equivalent exect, which pattach insists on. */
-
-execle (name, argv)
- char *name, *argv;
-{
- char ***envp = (char ***) &argv;
- while (*envp++) ;
-
- signal (SIGTRAP, sig_noop);
- exect (name, &argv, *envp);
-}
-
-/* Stupid handler for stupid trace trap that otherwise causes
- startup to stupidly hang. */
-
-static sig_noop ()
-{}
-
-/* Read registers from inferior into registers[] array.
- For convex, they are already there, read in when the inferior stops. */
-
-void
-fetch_inferior_registers (regno)
- int regno;
-{
-}
-
-/* Store our register values back into the inferior.
- For Convex, do this only once, right before resuming inferior. */
-
-store_inferior_registers (regno)
- int regno;
-{
-}
-
-/* Copy LEN bytes from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR.
- On failure (cannot read from inferior, usually because address is out
- of bounds) returns the value of errno. */
-
-int
-read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- errno = 0;
- while (len > 0)
- {
- /* little-known undocumented max request size */
- int i = (len < 12288) ? len : 12288;
-
- lseek (inferior_fd, memaddr, 0);
- read (inferior_fd, myaddr, i);
-
- memaddr += i;
- myaddr += i;
- len -= i;
- }
- if (errno)
- bzero (myaddr, len);
- return errno;
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR.
- Returns errno on failure (cannot write the inferior) */
-
-int
-write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- errno = 0;
- lseek (inferior_fd, memaddr, 0);
- write (inferior_fd, myaddr, len);
- return errno;
-}
-
-/* Here from create_inferior when the inferior process has been created
- and started up. We must do a pattach to grab it for debugging.
-
- Also, intercept the CONT command by altering its dispatch address. */
-
-create_inferior_hook (pid)
- int pid;
-{
- static char cont[] = "cont";
- static char cont1[] = "c";
- char *linep = cont;
- char *linep1 = cont1;
- char **line = &linep;
- char **line1 = &linep1;
- struct cmd_list_element *c;
-
- c = lookup_cmd (line, cmdlist, "", 0);
- c->function = convex_cont_command;
- c = lookup_cmd (line1, cmdlist, "", 0);
- c->function = convex_cont_command;
-
- inferior_fd = pattach (pid, O_EXCL);
- if (inferior_fd < 0)
- perror_with_name ("pattach");
- inferior_thread = 0;
- set_fixed_scheduling (pid, parallel == 2);
-}
-
-/* Attach process PID for debugging. */
-
-attach (pid)
- int pid;
-{
- int fd = pattach (pid, O_EXCL);
- if (fd < 0)
- perror_with_name ("pattach");
- attach_flag = 1;
- /* wait for strange kernel reverberations to go away */
- sleep (1);
-
- setpgrp (pid, pid);
-
- inferior_fd = fd;
- inferior_thread = 0;
- return pid;
-}
-
-/* Stop debugging the process whose number is PID
- and continue it with signal number SIGNAL.
- SIGNAL = 0 means just continue it. */
-
-void
-detach (signal)
- int signal;
-{
- signal_stack = signal_stack_bot;
- thread_continue (-1, 0, signal);
- ioctl (inferior_fd, PIXDETACH, &ps);
- close (inferior_fd);
- inferior_fd = 0;
- attach_flag = 0;
-}
-
-/* Kill off the inferior process. */
-
-kill_inferior ()
-{
- if (inferior_pid == 0)
- return;
- ioctl (inferior_fd, PIXTERMINATE, 0);
- wait (0);
- target_mourn_inferior ();
-}
-
-/* This is used when GDB is exiting. It gives less chance of error.*/
-
-kill_inferior_fast ()
-{
- if (inferior_pid == 0)
- return;
- ioctl (inferior_fd, PIXTERMINATE, 0);
- wait (0);
-}
-
-/* Read vector register REG, and return a pointer to the value. */
-
-static long *
-read_vector_register (reg)
- int reg;
-{
- if (have_inferior_p ())
- {
- errno = 0;
- ps.pi_buffer = (char *) &vector_registers;
- ps.pi_nbytes = sizeof vector_registers;
- ps.pi_offset = 0;
- ps.pi_thread = inferior_thread;
- ioctl (inferior_fd, PIXRDVREGS, &ps);
- if (errno)
- bzero (&vector_registers, sizeof vector_registers);
- }
- else if (corechan >= 0)
- {
- lseek (corechan, tcontext_offset[inferior_thread], 0);
- if (myread (corechan, &tc, sizeof tc) < 0)
- perror_with_name (corefile);
- lseek (corechan, tc.core_thread_p, 0);
- if (myread (corechan, &th, sizeof th) < 0)
- perror_with_name (corefile);
- lseek (corechan, tc.core_vregs_p, 0);
- if (myread (corechan, &vector_registers, 16*128) < 0)
- perror_with_name (corefile);
- vector_registers.vm[0] = th.t_vect_ctx.vc_vm[0];
- vector_registers.vm[1] = th.t_vect_ctx.vc_vm[1];
- vector_registers.vls = th.t_vect_ctx.vc_vls;
- }
-
- return read_vector_register_1 (reg);
-}
-
-/* Return a pointer to vector register REG, which must already have been
- fetched from the inferior or core file. */
-
-static long *
-read_vector_register_1 (reg)
- int reg;
-{
- switch (reg)
- {
- case VM_REGNUM:
- return (long *) vector_registers.vm;
- case VS_REGNUM:
- return (long *) &vector_registers.vls;
- case VL_REGNUM:
- return 1 + (long *) &vector_registers.vls;
- default:
- return (long *) &vector_registers.vr[reg];
- }
-}
-
-/* Write vector register REG, element ELEMENT, new value VAL.
- NB: must use read-modify-write on the entire vector state,
- since pattach does not do offsetted writes correctly. */
-
-static void
-write_vector_register (reg, element, val)
- int reg, element;
- REGISTER_TYPE val;
-{
- if (have_inferior_p ())
- {
- errno = 0;
- ps.pi_thread = inferior_thread;
- ps.pi_offset = 0;
- ps.pi_buffer = (char *) &vector_registers;
- ps.pi_nbytes = sizeof vector_registers;
-
- ioctl (inferior_fd, PIXRDVREGS, &ps);
-
- switch (reg)
- {
- case VL_REGNUM:
- vector_registers.vls =
- (vector_registers.vls & 0xffffffff00000000LL)
- + (unsigned long) val;
- break;
-
- case VS_REGNUM:
- vector_registers.vls =
- (val << 32) + (unsigned long) vector_registers.vls;
- break;
-
- default:
- vector_registers.vr[reg].el[element] = val;
- break;
- }
-
- ioctl (inferior_fd, PIXWRVREGS, &ps);
-
- if (errno)
- perror_with_name ("writing vector register");
- }
-}
-
-/* Return the contents of communication register NUM. */
-
-static REGISTER_TYPE
-read_comm_register (num)
- int num;
-{
- if (have_inferior_p ())
- {
- ps.pi_buffer = (char *) &comm_registers;
- ps.pi_nbytes = sizeof comm_registers;
- ps.pi_offset = 0;
- ps.pi_thread = inferior_thread;
- ioctl (inferior_fd, PIXRDCREGS, &ps);
- }
- return comm_registers.crreg.r4[num];
-}
-
-/* Store a new value VAL into communication register NUM.
- NB: Must use read-modify-write on the whole comm register set
- since pattach does not do offsetted writes correctly. */
-
-static void
-write_comm_register (num, val)
- int num;
- REGISTER_TYPE val;
-{
- if (have_inferior_p ())
- {
- ps.pi_buffer = (char *) &comm_registers;
- ps.pi_nbytes = sizeof comm_registers;
- ps.pi_offset = 0;
- ps.pi_thread = inferior_thread;
- ioctl (inferior_fd, PIXRDCREGS, &ps);
- comm_registers.crreg.r4[num] = val;
- ioctl (inferior_fd, PIXWRCREGS, &ps);
- }
-}
-
-/* Resume execution of the inferior process.
- If STEP is nonzero, single-step it.
- If SIGNAL is nonzero, give it that signal. */
-
-void
-resume (step, signal)
- int step;
- int signal;
-{
- errno = 0;
- if (step || signal)
- thread_continue (inferior_thread, step, signal);
- else
- thread_continue (-1, 0, 0);
-}
-
-/* Maybe resume some threads.
- THREAD is which thread to resume, or -1 to resume them all.
- STEP and SIGNAL are as in resume.
-
- Global variable ALL_CONTINUE is set when we are here to do a
- `cont' command; otherwise we may be doing `finish' or a call or
- something else that will not tolerate an automatic thread switch.
-
- If there are stopped threads waiting to deliver signals, and
- ALL_CONTINUE, do not actually resume anything. gdb will do a wait
- and see one of the stopped threads in the queue. */
-
-static void
-thread_continue (thread, step, signal)
- int thread, step, signal;
-{
- int n;
-
- /* If we are to continue all threads, but not for the CONTINUE command,
- pay no attention and continue only the selected thread. */
-
- if (thread < 0 && ! all_continue)
- thread = inferior_thread;
-
- /* If we are not stepping, we have now executed the continue part
- of a CONTINUE command. */
-
- if (! step)
- all_continue = 0;
-
- /* Allow wait() to switch threads if this is an all-out continue. */
-
- thread_switch_ok = thread < 0;
-
- /* If there are threads queued up, don't resume. */
-
- if (thread_switch_ok && ! signal_stack_is_empty ())
- return;
-
- /* OK, do it. */
-
- for (n = 0; n < n_threads; n++)
- if (thread_state[n] == PI_TALIVE)
- {
- select_thread (n);
-
- if ((thread < 0 || n == thread) && ! thread_is_in_kernel[n])
- {
- /* Blam the trace bits in the stack's saved psws to match
- the desired step mode. This is required so that
- single-stepping a return doesn't restore a psw with a
- clear trace bit and fly away, and conversely,
- proceeding through a return in a routine that was
- stepped into doesn't cause a phantom break by restoring
- a psw with the trace bit set. */
- scan_stack (PSW_T_BIT, step);
- scan_stack (PSW_S_BIT, sequential);
- }
-
- ps.pi_buffer = registers;
- ps.pi_nbytes = REGISTER_BYTES;
- ps.pi_offset = 0;
- ps.pi_thread = n;
- if (! thread_is_in_kernel[n])
- if (ioctl (inferior_fd, PIXWRREGS, &ps))
- perror_with_name ("PIXWRREGS");
-
- if (thread < 0 || n == thread)
- {
- ps.pi_pc = 1;
- ps.pi_signo = signal;
- if (ioctl (inferior_fd, step ? PIXSTEP : PIXCONTINUE, &ps) < 0)
- perror_with_name ("PIXCONTINUE");
- }
- }
-
- if (ioctl (inferior_fd, PIXRUN, &ps) < 0)
- perror_with_name ("PIXRUN");
-}
-
-/* Replacement for system wait routine.
-
- The system wait returns with one or more threads stopped by
- signals. Put stopped threads on a stack and return them one by
- one, so that it appears that wait returns one thread at a time.
-
- Global variable THREAD_SWITCH_OK is set when gdb can tolerate wait
- returning a new thread. If it is false, then only one thread is
- running; we will do a real wait, the thread will do something, and
- we will return that. */
-
-pid_t
-wait (w)
- union wait *w;
-{
- int pid;
-
- if (!w)
- return wait3 (0, 0, 0);
-
- /* Do a real wait if we were told to, or if there are no queued threads. */
-
- if (! thread_switch_ok || signal_stack_is_empty ())
- {
- int thread;
-
- pid = wait3 (w, 0, 0);
-
- if (!WIFSTOPPED (*w) || pid != inferior_pid)
- return pid;
-
- /* The inferior has done something and stopped. Read in all the
- threads' registers, and queue up any signals that happened. */
-
- if (ioctl (inferior_fd, PIXGETTHCOUNT, &ps) < 0)
- perror_with_name ("PIXGETTHCOUNT");
-
- n_threads = ps.pi_othdcnt;
- for (thread = 0; thread < n_threads; thread++)
- {
- ps.pi_thread = thread;
- if (ioctl (inferior_fd, PIXGETSUBCODE, &ps) < 0)
- perror_with_name ("PIXGETSUBCODE");
- thread_state[thread] = ps.pi_otstate;
-
- if (ps.pi_otstate == PI_TALIVE)
- {
- select_thread (thread);
- ps.pi_buffer = registers;
- ps.pi_nbytes = REGISTER_BYTES;
- ps.pi_offset = 0;
- ps.pi_thread = thread;
- if (ioctl (inferior_fd, PIXRDREGS, &ps) < 0)
- perror_with_name ("PIXRDREGS");
-
- registers_fetched ();
-
- thread_pc[thread] = read_pc ();
- thread_signal[thread] = ps.pi_osigno;
- thread_sigcode[thread] = ps.pi_osigcode;
-
- /* If the thread's stack has a context frame
- on top, something fucked is going on. I do not
- know what, but do I know this: the only thing you
- can do with such a thread is continue it. */
-
- thread_is_in_kernel[thread] =
- ((read_register (PS_REGNUM) >> 25) & 3) == 0;
-
- /* Signals push an extended frame and then fault
- with a ridiculous pc. Pop the frame. */
-
- if (thread_pc[thread] > STACK_END_ADDR)
- {
- POP_FRAME;
- if (is_break_pc (thread_pc[thread]))
- thread_pc[thread] = read_pc () - 2;
- else
- thread_pc[thread] = read_pc ();
- write_register (PC_REGNUM, thread_pc[thread]);
- }
-
- if (ps.pi_osigno || ps.pi_osigcode)
- {
- signal_stack++;
- signal_stack->pid = pid;
- signal_stack->thread = thread;
- signal_stack->signo = thread_signal[thread];
- signal_stack->subsig = thread_sigcode[thread];
- signal_stack->pc = thread_pc[thread];
- }
-
- /* The following hackery is caused by a unix 7.1 feature:
- the inferior's fixed scheduling mode is cleared when
- it execs the shell (since the shell is not a parallel
- program). So, note the 5.4 trap we get when
- the shell does its exec, then catch the 5.0 trap
- that occurs when the debuggee starts, and set fixed
- scheduling mode properly. */
-
- if (ps.pi_osigno == 5 && ps.pi_osigcode == 4)
- exec_trap_timer = 1;
- else
- exec_trap_timer--;
-
- if (ps.pi_osigno == 5 && exec_trap_timer == 0)
- set_fixed_scheduling (pid, parallel == 2);
- }
- }
-
- if (signal_stack_is_empty ())
- error ("no active threads?!");
- }
-
- /* Select the thread that stopped, and return *w saying why. */
-
- select_thread (signal_stack->thread);
-
- stop_signal = signal_stack->signo;
- stop_sigcode = signal_stack->subsig;
-
- WSETSTOP (*w, signal_stack->signo);
- w->w_thread = signal_stack->thread;
- return (signal_stack--)->pid;
-}
-
-/* Select thread THREAD -- its registers, stack, per-thread memory.
- This is the only routine that may assign to inferior_thread
- or thread_regs[]. */
-
-static void
-select_thread (thread)
- int thread;
-{
- if (thread == inferior_thread)
- return;
-
- bcopy (registers, thread_regs[inferior_thread], REGISTER_BYTES);
- ps.pi_thread = inferior_thread = thread;
- if (have_inferior_p ())
- ioctl (inferior_fd, PISETRWTID, &ps);
- bcopy (thread_regs[thread], registers, REGISTER_BYTES);
-}
-
-/* Routine to set or clear a psw bit in the psw and also all psws
- saved on the stack. Quits when we get to a frame in which the
- saved psw is correct. */
-
-static void
-scan_stack (bit, val)
- long bit, val;
-{
- long ps = read_register (PS_REGNUM);
- long fp;
- if (val ? !(ps & bit) : (ps & bit))
- {
- ps ^= bit;
- write_register (PS_REGNUM, ps);
-
- fp = read_register (FP_REGNUM);
- while (fp & 0x80000000)
- {
- ps = read_memory_integer (fp + 4, 4);
- if (val ? (ps & bit) : !(ps & bit))
- break;
- ps ^= bit;
- write_memory (fp + 4, &ps, 4);
- fp = read_memory_integer (fp + 8, 4);
- }
- }
-}
-
-/* Set fixed scheduling (alliant mode) of process PID to ARG (0 or 1). */
-
-static void
-set_fixed_scheduling (pid, arg)
- int arg;
-{
- struct pattributes pattr;
- getpattr (pid, &pattr);
- pattr.pattr_pfixed = arg;
- setpattr (pid, &pattr);
-}
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int n;
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
- n_core = 0;
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
-
- if (myread (corechan, &filehdr, sizeof filehdr) < 0)
- perror_with_name (filename);
-
- if (!IS_CORE_SOFF_MAGIC (filehdr.h_magic))
- error ("%s: not a core file.\n", filename);
-
- if (myread (corechan, &opthdr, filehdr.h_opthdr) < 0)
- perror_with_name (filename);
-
- /* Read through the section headers.
- For text, data, etc, record an entry in the core file map.
- For context and tcontext, record the file address of
- the context blocks. */
-
- lseek (corechan, (long) filehdr.h_scnptr, 0);
-
- n_threads = 0;
- for (n = 0; n < filehdr.h_nscns; n++)
- {
- if (myread (corechan, &scnhdr, sizeof scnhdr) < 0)
- perror_with_name (filename);
- if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT
- && (scnhdr.s_flags & S_TYPMASK) <= S_COMON)
- {
- core_map[n_core].mem_addr = scnhdr.s_vaddr;
- core_map[n_core].mem_end = scnhdr.s_vaddr + scnhdr.s_size;
- core_map[n_core].file_addr = scnhdr.s_scnptr;
- core_map[n_core].type = scnhdr.s_flags & S_TYPMASK;
- if (core_map[n_core].type != S_TBSS
- && core_map[n_core].type != S_TDATA
- && core_map[n_core].type != S_TTEXT)
- core_map[n_core].thread = -1;
- else if (n_core == 0
- || core_map[n_core-1].mem_addr != scnhdr.s_vaddr)
- core_map[n_core].thread = 0;
- else
- core_map[n_core].thread = core_map[n_core-1].thread + 1;
- n_core++;
- }
- else if ((scnhdr.s_flags & S_TYPMASK) == S_CONTEXT)
- context_offset = scnhdr.s_scnptr;
- else if ((scnhdr.s_flags & S_TYPMASK) == S_TCONTEXT)
- tcontext_offset[n_threads++] = scnhdr.s_scnptr;
- }
-
- /* Read the context block, struct user, struct proc,
- and the comm regs. */
-
- lseek (corechan, context_offset, 0);
- if (myread (corechan, &c, sizeof c) < 0)
- perror_with_name (filename);
- lseek (corechan, c.core_user_p, 0);
- if (myread (corechan, &u, sizeof u) < 0)
- perror_with_name (filename);
- lseek (corechan, c.core_proc_p, 0);
- if (myread (corechan, &pr, sizeof pr) < 0)
- perror_with_name (filename);
- comm_registers = pr.p_creg;
-
- /* Core file apparently is really there. Make it really exist
- for xfer_core_file so we can do read_memory on it. */
-
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- corefile = concat (current_directory, "/", filename, NULL);
-
- printf_filtered ("Program %s ", u.u_comm);
-
- /* Read the thread registers and fill in the thread_xxx[] data. */
-
- for (n = 0; n < n_threads; n++)
- {
- select_thread (n);
-
- lseek (corechan, tcontext_offset[n], 0);
- if (myread (corechan, &tc, sizeof tc) < 0)
- perror_with_name (corefile);
- lseek (corechan, tc.core_thread_p, 0);
- if (myread (corechan, &th, sizeof th) < 0)
- perror_with_name (corefile);
-
- lseek (corechan, tc.core_syscall_context_p, 0);
- if (myread (corechan, registers, REGISTER_BYTES) < 0)
- perror_with_name (corefile);
-
- thread_signal[n] = th.t_cursig;
- thread_sigcode[n] = th.t_code;
- thread_state[n] = th.t_state;
- thread_pc[n] = read_pc ();
-
- if (thread_pc[n] > STACK_END_ADDR)
- {
- POP_FRAME;
- if (is_break_pc (thread_pc[n]))
- thread_pc[n] = read_pc () - 2;
- else
- thread_pc[n] = read_pc ();
- write_register (PC_REGNUM, thread_pc[n]);
- }
-
- printf_filtered ("thread %d received signal %d, %s\n",
- n, thread_signal[n],
- thread_signal[n] < NSIG
- ? sys_siglist[thread_signal[n]]
- : "(undocumented)");
- }
-
- /* Select an interesting thread -- also-rans died with SIGKILL,
- so find one that didn't. */
-
- for (n = 0; n < n_threads; n++)
- if (thread_signal[n] != 0 && thread_signal[n] != SIGKILL)
- {
- select_thread (n);
- stop_signal = thread_signal[n];
- stop_sigcode = thread_sigcode[n];
- break;
- }
-
- core_aouthdr.a_magic = 0;
-
- flush_cached_frames ();
- set_current_frame (create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- select_frame (get_current_frame (), 0);
- validate_files ();
-
- print_stack_frame (selected_frame, selected_frame_level, -1);
- }
- else if (from_tty)
- printf_filtered ("No core file now.\n");
-}
diff --git a/gdb/convx-opcode.h b/gdb/convx-opcode.h
deleted file mode 100644
index 75e6f7c..0000000
--- a/gdb/convx-opcode.h
+++ /dev/null
@@ -1,1677 +0,0 @@
-/* Include information for instruction dissasembly on the Convex.
- Copyright (C) 1989, Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define xxx 0
-#define rrr 1
-#define rr 2
-#define rxr 3
-#define r 4
-#define nops 5
-#define nr 6
-#define pcrel 7
-#define lr 8
-#define rxl 9
-#define rlr 10
-#define rrl 11
-#define iml 12
-#define imr 13
-#define a1r 14
-#define a1l 15
-#define a2r 16
-#define a2l 17
-#define a3 18
-#define a4 19
-#define a5 20
-#define V 1
-#define S 2
-#define VM 3
-#define A 4
-#define VL 5
-#define VS 6
-#define VLS 7
-#define PSW 8
-/* Prevent an error during "make depend". */
-#if !defined (PC)
-#define PC 9
-#endif
-#define ITR 10
-#define VV 11
-#define ITSR 12
-#define TOC 13
-#define CIR 14
-#define TTR 15
-#define VMU 16
-#define VML 17
-#define ICR 18
-#define TCPU 19
-#define CPUID 20
-#define TID 21
-char *op[] = {
- "",
- "v0\0v1\0v2\0v3\0v4\0v5\0v6\0v7",
- "s0\0s1\0s2\0s3\0s4\0s5\0s6\0s7",
- "vm",
- "sp\0a1\0a2\0a3\0a4\0a5\0ap\0fp",
- "vl",
- "vs",
- "vls",
- "psw",
- "pc",
- "itr",
- "vv",
- "itsr",
- "toc",
- "cir",
- "ttr",
- "vmu",
- "vml",
- "icr",
- "tcpu",
- "cpuid",
- "tid",
-};
-struct formstr format0[] = {
- {0,0,rrr,V,S,S}, /* mov */
- {0,0,rrr,S,S,V}, /* mov */
- {1,1,rrr,V,V,V}, /* merg.t */
- {2,1,rrr,V,V,V}, /* mask.t */
- {1,2,rrr,V,S,V}, /* merg.f */
- {2,2,rrr,V,S,V}, /* mask.f */
- {1,1,rrr,V,S,V}, /* merg.t */
- {2,1,rrr,V,S,V}, /* mask.t */
- {3,3,rrr,V,V,V}, /* mul.s */
- {3,4,rrr,V,V,V}, /* mul.d */
- {4,3,rrr,V,V,V}, /* div.s */
- {4,4,rrr,V,V,V}, /* div.d */
- {3,3,rrr,V,S,V}, /* mul.s */
- {3,4,rrr,V,S,V}, /* mul.d */
- {4,3,rrr,V,S,V}, /* div.s */
- {4,4,rrr,V,S,V}, /* div.d */
- {5,0,rrr,V,V,V}, /* and */
- {6,0,rrr,V,V,V}, /* or */
- {7,0,rrr,V,V,V}, /* xor */
- {8,0,rrr,V,V,V}, /* shf */
- {5,0,rrr,V,S,V}, /* and */
- {6,0,rrr,V,S,V}, /* or */
- {7,0,rrr,V,S,V}, /* xor */
- {8,0,rrr,V,S,V}, /* shf */
- {9,3,rrr,V,V,V}, /* add.s */
- {9,4,rrr,V,V,V}, /* add.d */
- {10,3,rrr,V,V,V}, /* sub.s */
- {10,4,rrr,V,V,V}, /* sub.d */
- {9,3,rrr,V,S,V}, /* add.s */
- {9,4,rrr,V,S,V}, /* add.d */
- {10,3,rrr,V,S,V}, /* sub.s */
- {10,4,rrr,V,S,V}, /* sub.d */
- {9,5,rrr,V,V,V}, /* add.b */
- {9,6,rrr,V,V,V}, /* add.h */
- {9,7,rrr,V,V,V}, /* add.w */
- {9,8,rrr,V,V,V}, /* add.l */
- {9,5,rrr,V,S,V}, /* add.b */
- {9,6,rrr,V,S,V}, /* add.h */
- {9,7,rrr,V,S,V}, /* add.w */
- {9,8,rrr,V,S,V}, /* add.l */
- {10,5,rrr,V,V,V}, /* sub.b */
- {10,6,rrr,V,V,V}, /* sub.h */
- {10,7,rrr,V,V,V}, /* sub.w */
- {10,8,rrr,V,V,V}, /* sub.l */
- {10,5,rrr,V,S,V}, /* sub.b */
- {10,6,rrr,V,S,V}, /* sub.h */
- {10,7,rrr,V,S,V}, /* sub.w */
- {10,8,rrr,V,S,V}, /* sub.l */
- {3,5,rrr,V,V,V}, /* mul.b */
- {3,6,rrr,V,V,V}, /* mul.h */
- {3,7,rrr,V,V,V}, /* mul.w */
- {3,8,rrr,V,V,V}, /* mul.l */
- {3,5,rrr,V,S,V}, /* mul.b */
- {3,6,rrr,V,S,V}, /* mul.h */
- {3,7,rrr,V,S,V}, /* mul.w */
- {3,8,rrr,V,S,V}, /* mul.l */
- {4,5,rrr,V,V,V}, /* div.b */
- {4,6,rrr,V,V,V}, /* div.h */
- {4,7,rrr,V,V,V}, /* div.w */
- {4,8,rrr,V,V,V}, /* div.l */
- {4,5,rrr,V,S,V}, /* div.b */
- {4,6,rrr,V,S,V}, /* div.h */
- {4,7,rrr,V,S,V}, /* div.w */
- {4,8,rrr,V,S,V}, /* div.l */
-};
-struct formstr format1[] = {
- {11,0,xxx,0,0,0}, /* exit */
- {12,0,a3,0,0,0}, /* jmp */
- {13,2,a3,0,0,0}, /* jmpi.f */
- {13,1,a3,0,0,0}, /* jmpi.t */
- {14,2,a3,0,0,0}, /* jmpa.f */
- {14,1,a3,0,0,0}, /* jmpa.t */
- {15,2,a3,0,0,0}, /* jmps.f */
- {15,1,a3,0,0,0}, /* jmps.t */
- {16,0,a3,0,0,0}, /* tac */
- {17,0,a1r,A,0,0}, /* ldea */
- {18,8,a1l,VLS,0,0}, /* ld.l */
- {18,9,a1l,VM,0,0}, /* ld.x */
- {19,0,a3,0,0,0}, /* tas */
- {20,0,a3,0,0,0}, /* pshea */
- {21,8,a2l,VLS,0,0}, /* st.l */
- {21,9,a2l,VM,0,0}, /* st.x */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {22,0,a3,0,0,0}, /* call */
- {23,0,a3,0,0,0}, /* calls */
- {24,0,a3,0,0,0}, /* callq */
- {25,0,a1r,A,0,0}, /* pfork */
- {26,5,a2r,S,0,0}, /* ste.b */
- {26,6,a2r,S,0,0}, /* ste.h */
- {26,7,a2r,S,0,0}, /* ste.w */
- {26,8,a2r,S,0,0}, /* ste.l */
- {18,5,a1r,A,0,0}, /* ld.b */
- {18,6,a1r,A,0,0}, /* ld.h */
- {18,7,a1r,A,0,0}, /* ld.w */
- {27,7,a1r,A,0,0}, /* incr.w */
- {21,5,a2r,A,0,0}, /* st.b */
- {21,6,a2r,A,0,0}, /* st.h */
- {21,7,a2r,A,0,0}, /* st.w */
- {27,8,a1r,S,0,0}, /* incr.l */
- {18,5,a1r,S,0,0}, /* ld.b */
- {18,6,a1r,S,0,0}, /* ld.h */
- {18,7,a1r,S,0,0}, /* ld.w */
- {18,8,a1r,S,0,0}, /* ld.l */
- {21,5,a2r,S,0,0}, /* st.b */
- {21,6,a2r,S,0,0}, /* st.h */
- {21,7,a2r,S,0,0}, /* st.w */
- {21,8,a2r,S,0,0}, /* st.l */
- {18,5,a1r,V,0,0}, /* ld.b */
- {18,6,a1r,V,0,0}, /* ld.h */
- {18,7,a1r,V,0,0}, /* ld.w */
- {18,8,a1r,V,0,0}, /* ld.l */
- {21,5,a2r,V,0,0}, /* st.b */
- {21,6,a2r,V,0,0}, /* st.h */
- {21,7,a2r,V,0,0}, /* st.w */
- {21,8,a2r,V,0,0}, /* st.l */
-};
-struct formstr format2[] = {
- {28,5,rr,A,A,0}, /* cvtw.b */
- {28,6,rr,A,A,0}, /* cvtw.h */
- {29,7,rr,A,A,0}, /* cvtb.w */
- {30,7,rr,A,A,0}, /* cvth.w */
- {28,5,rr,S,S,0}, /* cvtw.b */
- {28,6,rr,S,S,0}, /* cvtw.h */
- {29,7,rr,S,S,0}, /* cvtb.w */
- {30,7,rr,S,S,0}, /* cvth.w */
- {28,3,rr,S,S,0}, /* cvtw.s */
- {31,7,rr,S,S,0}, /* cvts.w */
- {32,3,rr,S,S,0}, /* cvtd.s */
- {31,4,rr,S,S,0}, /* cvts.d */
- {31,8,rr,S,S,0}, /* cvts.l */
- {32,8,rr,S,S,0}, /* cvtd.l */
- {33,3,rr,S,S,0}, /* cvtl.s */
- {33,4,rr,S,S,0}, /* cvtl.d */
- {34,0,rr,A,A,0}, /* ldpa */
- {8,0,nr,A,0,0}, /* shf */
- {18,6,nr,A,0,0}, /* ld.h */
- {18,7,nr,A,0,0}, /* ld.w */
- {33,7,rr,S,S,0}, /* cvtl.w */
- {28,8,rr,S,S,0}, /* cvtw.l */
- {35,1,rr,S,S,0}, /* plc.t */
- {36,0,rr,S,S,0}, /* tzc */
- {37,6,rr,A,A,0}, /* eq.h */
- {37,7,rr,A,A,0}, /* eq.w */
- {37,6,nr,A,0,0}, /* eq.h */
- {37,7,nr,A,0,0}, /* eq.w */
- {37,5,rr,S,S,0}, /* eq.b */
- {37,6,rr,S,S,0}, /* eq.h */
- {37,7,rr,S,S,0}, /* eq.w */
- {37,8,rr,S,S,0}, /* eq.l */
- {38,6,rr,A,A,0}, /* leu.h */
- {38,7,rr,A,A,0}, /* leu.w */
- {38,6,nr,A,0,0}, /* leu.h */
- {38,7,nr,A,0,0}, /* leu.w */
- {38,5,rr,S,S,0}, /* leu.b */
- {38,6,rr,S,S,0}, /* leu.h */
- {38,7,rr,S,S,0}, /* leu.w */
- {38,8,rr,S,S,0}, /* leu.l */
- {39,6,rr,A,A,0}, /* ltu.h */
- {39,7,rr,A,A,0}, /* ltu.w */
- {39,6,nr,A,0,0}, /* ltu.h */
- {39,7,nr,A,0,0}, /* ltu.w */
- {39,5,rr,S,S,0}, /* ltu.b */
- {39,6,rr,S,S,0}, /* ltu.h */
- {39,7,rr,S,S,0}, /* ltu.w */
- {39,8,rr,S,S,0}, /* ltu.l */
- {40,6,rr,A,A,0}, /* le.h */
- {40,7,rr,A,A,0}, /* le.w */
- {40,6,nr,A,0,0}, /* le.h */
- {40,7,nr,A,0,0}, /* le.w */
- {40,5,rr,S,S,0}, /* le.b */
- {40,6,rr,S,S,0}, /* le.h */
- {40,7,rr,S,S,0}, /* le.w */
- {40,8,rr,S,S,0}, /* le.l */
- {41,6,rr,A,A,0}, /* lt.h */
- {41,7,rr,A,A,0}, /* lt.w */
- {41,6,nr,A,0,0}, /* lt.h */
- {41,7,nr,A,0,0}, /* lt.w */
- {41,5,rr,S,S,0}, /* lt.b */
- {41,6,rr,S,S,0}, /* lt.h */
- {41,7,rr,S,S,0}, /* lt.w */
- {41,8,rr,S,S,0}, /* lt.l */
- {9,7,rr,S,A,0}, /* add.w */
- {8,0,rr,A,A,0}, /* shf */
- {0,0,rr,A,A,0}, /* mov */
- {0,0,rr,S,A,0}, /* mov */
- {0,7,rr,S,S,0}, /* mov.w */
- {8,0,rr,S,S,0}, /* shf */
- {0,0,rr,S,S,0}, /* mov */
- {0,0,rr,A,S,0}, /* mov */
- {5,0,rr,A,A,0}, /* and */
- {6,0,rr,A,A,0}, /* or */
- {7,0,rr,A,A,0}, /* xor */
- {42,0,rr,A,A,0}, /* not */
- {5,0,rr,S,S,0}, /* and */
- {6,0,rr,S,S,0}, /* or */
- {7,0,rr,S,S,0}, /* xor */
- {42,0,rr,S,S,0}, /* not */
- {40,3,rr,S,S,0}, /* le.s */
- {40,4,rr,S,S,0}, /* le.d */
- {41,3,rr,S,S,0}, /* lt.s */
- {41,4,rr,S,S,0}, /* lt.d */
- {9,3,rr,S,S,0}, /* add.s */
- {9,4,rr,S,S,0}, /* add.d */
- {10,3,rr,S,S,0}, /* sub.s */
- {10,4,rr,S,S,0}, /* sub.d */
- {37,3,rr,S,S,0}, /* eq.s */
- {37,4,rr,S,S,0}, /* eq.d */
- {43,6,rr,A,A,0}, /* neg.h */
- {43,7,rr,A,A,0}, /* neg.w */
- {3,3,rr,S,S,0}, /* mul.s */
- {3,4,rr,S,S,0}, /* mul.d */
- {4,3,rr,S,S,0}, /* div.s */
- {4,4,rr,S,S,0}, /* div.d */
- {9,6,rr,A,A,0}, /* add.h */
- {9,7,rr,A,A,0}, /* add.w */
- {9,6,nr,A,0,0}, /* add.h */
- {9,7,nr,A,0,0}, /* add.w */
- {9,5,rr,S,S,0}, /* add.b */
- {9,6,rr,S,S,0}, /* add.h */
- {9,7,rr,S,S,0}, /* add.w */
- {9,8,rr,S,S,0}, /* add.l */
- {10,6,rr,A,A,0}, /* sub.h */
- {10,7,rr,A,A,0}, /* sub.w */
- {10,6,nr,A,0,0}, /* sub.h */
- {10,7,nr,A,0,0}, /* sub.w */
- {10,5,rr,S,S,0}, /* sub.b */
- {10,6,rr,S,S,0}, /* sub.h */
- {10,7,rr,S,S,0}, /* sub.w */
- {10,8,rr,S,S,0}, /* sub.l */
- {3,6,rr,A,A,0}, /* mul.h */
- {3,7,rr,A,A,0}, /* mul.w */
- {3,6,nr,A,0,0}, /* mul.h */
- {3,7,nr,A,0,0}, /* mul.w */
- {3,5,rr,S,S,0}, /* mul.b */
- {3,6,rr,S,S,0}, /* mul.h */
- {3,7,rr,S,S,0}, /* mul.w */
- {3,8,rr,S,S,0}, /* mul.l */
- {4,6,rr,A,A,0}, /* div.h */
- {4,7,rr,A,A,0}, /* div.w */
- {4,6,nr,A,0,0}, /* div.h */
- {4,7,nr,A,0,0}, /* div.w */
- {4,5,rr,S,S,0}, /* div.b */
- {4,6,rr,S,S,0}, /* div.h */
- {4,7,rr,S,S,0}, /* div.w */
- {4,8,rr,S,S,0}, /* div.l */
-};
-struct formstr format3[] = {
- {32,3,rr,V,V,0}, /* cvtd.s */
- {31,4,rr,V,V,0}, /* cvts.d */
- {33,4,rr,V,V,0}, /* cvtl.d */
- {32,8,rr,V,V,0}, /* cvtd.l */
- {0,0,rrl,S,S,VM}, /* mov */
- {0,0,rlr,S,VM,S}, /* mov */
- {0,0,0,0,0,0},
- {44,0,rr,S,S,0}, /* lop */
- {36,0,rr,V,V,0}, /* tzc */
- {44,0,rr,V,V,0}, /* lop */
- {0,0,0,0,0,0},
- {42,0,rr,V,V,0}, /* not */
- {8,0,rr,S,V,0}, /* shf */
- {35,1,rr,V,V,0}, /* plc.t */
- {45,2,rr,V,V,0}, /* cprs.f */
- {45,1,rr,V,V,0}, /* cprs.t */
- {37,3,rr,V,V,0}, /* eq.s */
- {37,4,rr,V,V,0}, /* eq.d */
- {43,3,rr,V,V,0}, /* neg.s */
- {43,4,rr,V,V,0}, /* neg.d */
- {37,3,rr,S,V,0}, /* eq.s */
- {37,4,rr,S,V,0}, /* eq.d */
- {43,3,rr,S,S,0}, /* neg.s */
- {43,4,rr,S,S,0}, /* neg.d */
- {40,3,rr,V,V,0}, /* le.s */
- {40,4,rr,V,V,0}, /* le.d */
- {41,3,rr,V,V,0}, /* lt.s */
- {41,4,rr,V,V,0}, /* lt.d */
- {40,3,rr,S,V,0}, /* le.s */
- {40,4,rr,S,V,0}, /* le.d */
- {41,3,rr,S,V,0}, /* lt.s */
- {41,4,rr,S,V,0}, /* lt.d */
- {37,5,rr,V,V,0}, /* eq.b */
- {37,6,rr,V,V,0}, /* eq.h */
- {37,7,rr,V,V,0}, /* eq.w */
- {37,8,rr,V,V,0}, /* eq.l */
- {37,5,rr,S,V,0}, /* eq.b */
- {37,6,rr,S,V,0}, /* eq.h */
- {37,7,rr,S,V,0}, /* eq.w */
- {37,8,rr,S,V,0}, /* eq.l */
- {40,5,rr,V,V,0}, /* le.b */
- {40,6,rr,V,V,0}, /* le.h */
- {40,7,rr,V,V,0}, /* le.w */
- {40,8,rr,V,V,0}, /* le.l */
- {40,5,rr,S,V,0}, /* le.b */
- {40,6,rr,S,V,0}, /* le.h */
- {40,7,rr,S,V,0}, /* le.w */
- {40,8,rr,S,V,0}, /* le.l */
- {41,5,rr,V,V,0}, /* lt.b */
- {41,6,rr,V,V,0}, /* lt.h */
- {41,7,rr,V,V,0}, /* lt.w */
- {41,8,rr,V,V,0}, /* lt.l */
- {41,5,rr,S,V,0}, /* lt.b */
- {41,6,rr,S,V,0}, /* lt.h */
- {41,7,rr,S,V,0}, /* lt.w */
- {41,8,rr,S,V,0}, /* lt.l */
- {43,5,rr,V,V,0}, /* neg.b */
- {43,6,rr,V,V,0}, /* neg.h */
- {43,7,rr,V,V,0}, /* neg.w */
- {43,8,rr,V,V,0}, /* neg.l */
- {43,5,rr,S,S,0}, /* neg.b */
- {43,6,rr,S,S,0}, /* neg.h */
- {43,7,rr,S,S,0}, /* neg.w */
- {43,8,rr,S,S,0}, /* neg.l */
-};
-struct formstr format4[] = {
- {46,0,nops,0,0,0}, /* nop */
- {47,0,pcrel,0,0,0}, /* br */
- {48,2,pcrel,0,0,0}, /* bri.f */
- {48,1,pcrel,0,0,0}, /* bri.t */
- {49,2,pcrel,0,0,0}, /* bra.f */
- {49,1,pcrel,0,0,0}, /* bra.t */
- {50,2,pcrel,0,0,0}, /* brs.f */
- {50,1,pcrel,0,0,0}, /* brs.t */
-};
-struct formstr format5[] = {
- {51,5,rr,V,V,0}, /* ldvi.b */
- {51,6,rr,V,V,0}, /* ldvi.h */
- {51,7,rr,V,V,0}, /* ldvi.w */
- {51,8,rr,V,V,0}, /* ldvi.l */
- {28,3,rr,V,V,0}, /* cvtw.s */
- {31,7,rr,V,V,0}, /* cvts.w */
- {28,8,rr,V,V,0}, /* cvtw.l */
- {33,7,rr,V,V,0}, /* cvtl.w */
- {52,5,rxr,V,V,0}, /* stvi.b */
- {52,6,rxr,V,V,0}, /* stvi.h */
- {52,7,rxr,V,V,0}, /* stvi.w */
- {52,8,rxr,V,V,0}, /* stvi.l */
- {52,5,rxr,S,V,0}, /* stvi.b */
- {52,6,rxr,S,V,0}, /* stvi.h */
- {52,7,rxr,S,V,0}, /* stvi.w */
- {52,8,rxr,S,V,0}, /* stvi.l */
-};
-struct formstr format6[] = {
- {53,0,r,A,0,0}, /* ldsdr */
- {54,0,r,A,0,0}, /* ldkdr */
- {55,3,r,S,0,0}, /* ln.s */
- {55,4,r,S,0,0}, /* ln.d */
- {56,0,nops,0,0,0}, /* patu */
- {57,0,r,A,0,0}, /* pate */
- {58,0,nops,0,0,0}, /* pich */
- {59,0,nops,0,0,0}, /* plch */
- {0,0,lr,PSW,A,0}, /* mov */
- {0,0,rxl,A,PSW,0}, /* mov */
- {0,0,lr,PC,A,0}, /* mov */
- {60,0,r,S,0,0}, /* idle */
- {0,0,lr,ITR,S,0}, /* mov */
- {0,0,rxl,S,ITR,0}, /* mov */
- {0,0,0,0,0,0},
- {0,0,rxl,S,ITSR,0}, /* mov */
- {61,0,nops,0,0,0}, /* rtnq */
- {62,0,nops,0,0,0}, /* cfork */
- {63,0,nops,0,0,0}, /* rtn */
- {64,0,nops,0,0,0}, /* wfork */
- {65,0,nops,0,0,0}, /* join */
- {66,0,nops,0,0,0}, /* rtnc */
- {67,3,r,S,0,0}, /* exp.s */
- {67,4,r,S,0,0}, /* exp.d */
- {68,3,r,S,0,0}, /* sin.s */
- {68,4,r,S,0,0}, /* sin.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {69,3,r,S,0,0}, /* cos.s */
- {69,4,r,S,0,0}, /* cos.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {70,7,r,A,0,0}, /* psh.w */
- {0,0,0,0,0,0},
- {71,7,r,A,0,0}, /* pop.w */
- {0,0,0,0,0,0},
- {70,7,r,S,0,0}, /* psh.w */
- {70,8,r,S,0,0}, /* psh.l */
- {71,7,r,S,0,0}, /* pop.w */
- {71,8,r,S,0,0}, /* pop.l */
- {72,0,nops,0,0,0}, /* eni */
- {73,0,nops,0,0,0}, /* dsi */
- {74,0,nops,0,0,0}, /* bkpt */
- {75,0,nops,0,0,0}, /* msync */
- {76,0,r,S,0,0}, /* mski */
- {77,0,r,S,0,0}, /* xmti */
- {0,0,rxl,S,VV,0}, /* mov */
- {78,0,nops,0,0,0}, /* tstvv */
- {0,0,lr,VS,A,0}, /* mov */
- {0,0,rxl,A,VS,0}, /* mov */
- {0,0,lr,VL,A,0}, /* mov */
- {0,0,rxl,A,VL,0}, /* mov */
- {0,7,lr,VS,S,0}, /* mov.w */
- {0,7,rxl,S,VS,0}, /* mov.w */
- {0,7,lr,VL,S,0}, /* mov.w */
- {0,7,rxl,S,VL,0}, /* mov.w */
- {79,0,r,A,0,0}, /* diag */
- {80,0,nops,0,0,0}, /* pbkpt */
- {81,3,r,S,0,0}, /* sqrt.s */
- {81,4,r,S,0,0}, /* sqrt.d */
- {82,0,nops,0,0,0}, /* casr */
- {0,0,0,0,0,0},
- {83,3,r,S,0,0}, /* atan.s */
- {83,4,r,S,0,0}, /* atan.d */
-};
-struct formstr format7[] = {
- {84,5,r,V,0,0}, /* sum.b */
- {84,6,r,V,0,0}, /* sum.h */
- {84,7,r,V,0,0}, /* sum.w */
- {84,8,r,V,0,0}, /* sum.l */
- {85,0,r,V,0,0}, /* all */
- {86,0,r,V,0,0}, /* any */
- {87,0,r,V,0,0}, /* parity */
- {0,0,0,0,0,0},
- {88,5,r,V,0,0}, /* max.b */
- {88,6,r,V,0,0}, /* max.h */
- {88,7,r,V,0,0}, /* max.w */
- {88,8,r,V,0,0}, /* max.l */
- {89,5,r,V,0,0}, /* min.b */
- {89,6,r,V,0,0}, /* min.h */
- {89,7,r,V,0,0}, /* min.w */
- {89,8,r,V,0,0}, /* min.l */
- {84,3,r,V,0,0}, /* sum.s */
- {84,4,r,V,0,0}, /* sum.d */
- {90,3,r,V,0,0}, /* prod.s */
- {90,4,r,V,0,0}, /* prod.d */
- {88,3,r,V,0,0}, /* max.s */
- {88,4,r,V,0,0}, /* max.d */
- {89,3,r,V,0,0}, /* min.s */
- {89,4,r,V,0,0}, /* min.d */
- {90,5,r,V,0,0}, /* prod.b */
- {90,6,r,V,0,0}, /* prod.h */
- {90,7,r,V,0,0}, /* prod.w */
- {90,8,r,V,0,0}, /* prod.l */
- {35,2,lr,VM,S,0}, /* plc.f */
- {35,1,lr,VM,S,0}, /* plc.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr formatx[] = {
- {0,0,0,0,0,0},
-};
-struct formstr format1a[] = {
- {91,0,imr,A,0,0}, /* halt */
- {92,0,a4,0,0,0}, /* sysc */
- {18,6,imr,A,0,0}, /* ld.h */
- {18,7,imr,A,0,0}, /* ld.w */
- {5,0,imr,A,0,0}, /* and */
- {6,0,imr,A,0,0}, /* or */
- {7,0,imr,A,0,0}, /* xor */
- {8,0,imr,A,0,0}, /* shf */
- {9,6,imr,A,0,0}, /* add.h */
- {9,7,imr,A,0,0}, /* add.w */
- {10,6,imr,A,0,0}, /* sub.h */
- {10,7,imr,A,0,0}, /* sub.w */
- {3,6,imr,A,0,0}, /* mul.h */
- {3,7,imr,A,0,0}, /* mul.w */
- {4,6,imr,A,0,0}, /* div.h */
- {4,7,imr,A,0,0}, /* div.w */
- {18,7,iml,VL,0,0}, /* ld.w */
- {18,7,iml,VS,0,0}, /* ld.w */
- {0,0,0,0,0,0},
- {8,7,imr,S,0,0}, /* shf.w */
- {93,0,a5,0,0,0}, /* trap */
- {0,0,0,0,0,0},
- {37,6,imr,A,0,0}, /* eq.h */
- {37,7,imr,A,0,0}, /* eq.w */
- {38,6,imr,A,0,0}, /* leu.h */
- {38,7,imr,A,0,0}, /* leu.w */
- {39,6,imr,A,0,0}, /* ltu.h */
- {39,7,imr,A,0,0}, /* ltu.w */
- {40,6,imr,A,0,0}, /* le.h */
- {40,7,imr,A,0,0}, /* le.w */
- {41,6,imr,A,0,0}, /* lt.h */
- {41,7,imr,A,0,0}, /* lt.w */
-};
-struct formstr format1b[] = {
- {18,4,imr,S,0,0}, /* ld.d */
- {18,10,imr,S,0,0}, /* ld.u */
- {18,8,imr,S,0,0}, /* ld.l */
- {18,7,imr,S,0,0}, /* ld.w */
- {5,0,imr,S,0,0}, /* and */
- {6,0,imr,S,0,0}, /* or */
- {7,0,imr,S,0,0}, /* xor */
- {8,0,imr,S,0,0}, /* shf */
- {9,6,imr,S,0,0}, /* add.h */
- {9,7,imr,S,0,0}, /* add.w */
- {10,6,imr,S,0,0}, /* sub.h */
- {10,7,imr,S,0,0}, /* sub.w */
- {3,6,imr,S,0,0}, /* mul.h */
- {3,7,imr,S,0,0}, /* mul.w */
- {4,6,imr,S,0,0}, /* div.h */
- {4,7,imr,S,0,0}, /* div.w */
- {9,3,imr,S,0,0}, /* add.s */
- {10,3,imr,S,0,0}, /* sub.s */
- {3,3,imr,S,0,0}, /* mul.s */
- {4,3,imr,S,0,0}, /* div.s */
- {40,3,imr,S,0,0}, /* le.s */
- {41,3,imr,S,0,0}, /* lt.s */
- {37,6,imr,S,0,0}, /* eq.h */
- {37,7,imr,S,0,0}, /* eq.w */
- {38,6,imr,S,0,0}, /* leu.h */
- {38,7,imr,S,0,0}, /* leu.w */
- {39,6,imr,S,0,0}, /* ltu.h */
- {39,7,imr,S,0,0}, /* ltu.w */
- {40,6,imr,S,0,0}, /* le.h */
- {40,7,imr,S,0,0}, /* le.w */
- {41,6,imr,S,0,0}, /* lt.h */
- {41,7,imr,S,0,0}, /* lt.w */
-};
-struct formstr e0_format0[] = {
- {10,3,rrr,S,V,V}, /* sub.s */
- {10,4,rrr,S,V,V}, /* sub.d */
- {4,3,rrr,S,V,V}, /* div.s */
- {4,4,rrr,S,V,V}, /* div.d */
- {10,11,rrr,S,V,V}, /* sub.s.f */
- {10,12,rrr,S,V,V}, /* sub.d.f */
- {4,11,rrr,S,V,V}, /* div.s.f */
- {4,12,rrr,S,V,V}, /* div.d.f */
- {3,11,rrr,V,V,V}, /* mul.s.f */
- {3,12,rrr,V,V,V}, /* mul.d.f */
- {4,11,rrr,V,V,V}, /* div.s.f */
- {4,12,rrr,V,V,V}, /* div.d.f */
- {3,11,rrr,V,S,V}, /* mul.s.f */
- {3,12,rrr,V,S,V}, /* mul.d.f */
- {4,11,rrr,V,S,V}, /* div.s.f */
- {4,12,rrr,V,S,V}, /* div.d.f */
- {5,2,rrr,V,V,V}, /* and.f */
- {6,2,rrr,V,V,V}, /* or.f */
- {7,2,rrr,V,V,V}, /* xor.f */
- {8,2,rrr,V,V,V}, /* shf.f */
- {5,2,rrr,V,S,V}, /* and.f */
- {6,2,rrr,V,S,V}, /* or.f */
- {7,2,rrr,V,S,V}, /* xor.f */
- {8,2,rrr,V,S,V}, /* shf.f */
- {9,11,rrr,V,V,V}, /* add.s.f */
- {9,12,rrr,V,V,V}, /* add.d.f */
- {10,11,rrr,V,V,V}, /* sub.s.f */
- {10,12,rrr,V,V,V}, /* sub.d.f */
- {9,11,rrr,V,S,V}, /* add.s.f */
- {9,12,rrr,V,S,V}, /* add.d.f */
- {10,11,rrr,V,S,V}, /* sub.s.f */
- {10,12,rrr,V,S,V}, /* sub.d.f */
- {9,13,rrr,V,V,V}, /* add.b.f */
- {9,14,rrr,V,V,V}, /* add.h.f */
- {9,15,rrr,V,V,V}, /* add.w.f */
- {9,16,rrr,V,V,V}, /* add.l.f */
- {9,13,rrr,V,S,V}, /* add.b.f */
- {9,14,rrr,V,S,V}, /* add.h.f */
- {9,15,rrr,V,S,V}, /* add.w.f */
- {9,16,rrr,V,S,V}, /* add.l.f */
- {10,13,rrr,V,V,V}, /* sub.b.f */
- {10,14,rrr,V,V,V}, /* sub.h.f */
- {10,15,rrr,V,V,V}, /* sub.w.f */
- {10,16,rrr,V,V,V}, /* sub.l.f */
- {10,13,rrr,V,S,V}, /* sub.b.f */
- {10,14,rrr,V,S,V}, /* sub.h.f */
- {10,15,rrr,V,S,V}, /* sub.w.f */
- {10,16,rrr,V,S,V}, /* sub.l.f */
- {3,13,rrr,V,V,V}, /* mul.b.f */
- {3,14,rrr,V,V,V}, /* mul.h.f */
- {3,15,rrr,V,V,V}, /* mul.w.f */
- {3,16,rrr,V,V,V}, /* mul.l.f */
- {3,13,rrr,V,S,V}, /* mul.b.f */
- {3,14,rrr,V,S,V}, /* mul.h.f */
- {3,15,rrr,V,S,V}, /* mul.w.f */
- {3,16,rrr,V,S,V}, /* mul.l.f */
- {4,13,rrr,V,V,V}, /* div.b.f */
- {4,14,rrr,V,V,V}, /* div.h.f */
- {4,15,rrr,V,V,V}, /* div.w.f */
- {4,16,rrr,V,V,V}, /* div.l.f */
- {4,13,rrr,V,S,V}, /* div.b.f */
- {4,14,rrr,V,S,V}, /* div.h.f */
- {4,15,rrr,V,S,V}, /* div.w.f */
- {4,16,rrr,V,S,V}, /* div.l.f */
-};
-struct formstr e0_format1[] = {
- {0,0,0,0,0,0},
- {94,0,a3,0,0,0}, /* tst */
- {95,0,a3,0,0,0}, /* lck */
- {96,0,a3,0,0,0}, /* ulk */
- {17,0,a1r,S,0,0}, /* ldea */
- {97,0,a1r,A,0,0}, /* spawn */
- {98,0,a1r,A,0,0}, /* ldcmr */
- {99,0,a2r,A,0,0}, /* stcmr */
- {100,0,a1r,A,0,0}, /* popr */
- {101,0,a2r,A,0,0}, /* pshr */
- {102,7,a1r,A,0,0}, /* rcvr.w */
- {103,7,a2r,A,0,0}, /* matm.w */
- {104,7,a2r,A,0,0}, /* sndr.w */
- {104,8,a2r,S,0,0}, /* sndr.l */
- {102,8,a1r,S,0,0}, /* rcvr.l */
- {103,8,a2r,S,0,0}, /* matm.l */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {105,7,a2r,A,0,0}, /* putr.w */
- {105,8,a2r,S,0,0}, /* putr.l */
- {106,7,a1r,A,0,0}, /* getr.w */
- {106,8,a1r,S,0,0}, /* getr.l */
- {26,13,a2r,S,0,0}, /* ste.b.f */
- {26,14,a2r,S,0,0}, /* ste.h.f */
- {26,15,a2r,S,0,0}, /* ste.w.f */
- {26,16,a2r,S,0,0}, /* ste.l.f */
- {107,7,a2r,A,0,0}, /* matr.w */
- {108,7,a2r,A,0,0}, /* mat.w */
- {109,7,a1r,A,0,0}, /* get.w */
- {110,7,a1r,A,0,0}, /* rcv.w */
- {0,0,0,0,0,0},
- {111,7,a1r,A,0,0}, /* inc.w */
- {112,7,a2r,A,0,0}, /* put.w */
- {113,7,a2r,A,0,0}, /* snd.w */
- {107,8,a2r,S,0,0}, /* matr.l */
- {108,8,a2r,S,0,0}, /* mat.l */
- {109,8,a1r,S,0,0}, /* get.l */
- {110,8,a1r,S,0,0}, /* rcv.l */
- {0,0,0,0,0,0},
- {111,8,a1r,S,0,0}, /* inc.l */
- {112,8,a2r,S,0,0}, /* put.l */
- {113,8,a2r,S,0,0}, /* snd.l */
- {18,13,a1r,V,0,0}, /* ld.b.f */
- {18,14,a1r,V,0,0}, /* ld.h.f */
- {18,15,a1r,V,0,0}, /* ld.w.f */
- {18,16,a1r,V,0,0}, /* ld.l.f */
- {21,13,a2r,V,0,0}, /* st.b.f */
- {21,14,a2r,V,0,0}, /* st.h.f */
- {21,15,a2r,V,0,0}, /* st.w.f */
- {21,16,a2r,V,0,0}, /* st.l.f */
-};
-struct formstr e0_format2[] = {
- {28,5,rr,V,V,0}, /* cvtw.b */
- {28,6,rr,V,V,0}, /* cvtw.h */
- {29,7,rr,V,V,0}, /* cvtb.w */
- {30,7,rr,V,V,0}, /* cvth.w */
- {28,13,rr,V,V,0}, /* cvtw.b.f */
- {28,14,rr,V,V,0}, /* cvtw.h.f */
- {29,15,rr,V,V,0}, /* cvtb.w.f */
- {30,15,rr,V,V,0}, /* cvth.w.f */
- {31,8,rr,V,V,0}, /* cvts.l */
- {32,7,rr,V,V,0}, /* cvtd.w */
- {33,3,rr,V,V,0}, /* cvtl.s */
- {28,4,rr,V,V,0}, /* cvtw.d */
- {31,16,rr,V,V,0}, /* cvts.l.f */
- {32,15,rr,V,V,0}, /* cvtd.w.f */
- {33,11,rr,V,V,0}, /* cvtl.s.f */
- {28,12,rr,V,V,0}, /* cvtw.d.f */
- {114,0,rr,S,S,0}, /* enal */
- {8,7,rr,S,S,0}, /* shf.w */
- {115,0,rr,S,S,0}, /* enag */
- {0,0,0,0,0,0},
- {28,4,rr,S,S,0}, /* cvtw.d */
- {32,7,rr,S,S,0}, /* cvtd.w */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {116,3,rr,S,S,0}, /* frint.s */
- {116,4,rr,S,S,0}, /* frint.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {116,3,rr,V,V,0}, /* frint.s */
- {116,4,rr,V,V,0}, /* frint.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {116,11,rr,V,V,0}, /* frint.s.f */
- {116,12,rr,V,V,0}, /* frint.d.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {81,3,rr,V,V,0}, /* sqrt.s */
- {81,4,rr,V,V,0}, /* sqrt.d */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {81,11,rr,V,V,0}, /* sqrt.s.f */
- {81,12,rr,V,V,0}, /* sqrt.d.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e0_format3[] = {
- {32,11,rr,V,V,0}, /* cvtd.s.f */
- {31,12,rr,V,V,0}, /* cvts.d.f */
- {33,12,rr,V,V,0}, /* cvtl.d.f */
- {32,16,rr,V,V,0}, /* cvtd.l.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {36,2,rr,V,V,0}, /* tzc.f */
- {44,2,rr,V,V,0}, /* lop.f */
- {117,2,rr,V,V,0}, /* xpnd.f */
- {42,2,rr,V,V,0}, /* not.f */
- {8,2,rr,S,V,0}, /* shf.f */
- {35,17,rr,V,V,0}, /* plc.t.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {37,11,rr,V,V,0}, /* eq.s.f */
- {37,12,rr,V,V,0}, /* eq.d.f */
- {43,11,rr,V,V,0}, /* neg.s.f */
- {43,12,rr,V,V,0}, /* neg.d.f */
- {37,11,rr,S,V,0}, /* eq.s.f */
- {37,12,rr,S,V,0}, /* eq.d.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {40,11,rr,V,V,0}, /* le.s.f */
- {40,12,rr,V,V,0}, /* le.d.f */
- {41,11,rr,V,V,0}, /* lt.s.f */
- {41,12,rr,V,V,0}, /* lt.d.f */
- {40,11,rr,S,V,0}, /* le.s.f */
- {40,12,rr,S,V,0}, /* le.d.f */
- {41,11,rr,S,V,0}, /* lt.s.f */
- {41,12,rr,S,V,0}, /* lt.d.f */
- {37,13,rr,V,V,0}, /* eq.b.f */
- {37,14,rr,V,V,0}, /* eq.h.f */
- {37,15,rr,V,V,0}, /* eq.w.f */
- {37,16,rr,V,V,0}, /* eq.l.f */
- {37,13,rr,S,V,0}, /* eq.b.f */
- {37,14,rr,S,V,0}, /* eq.h.f */
- {37,15,rr,S,V,0}, /* eq.w.f */
- {37,16,rr,S,V,0}, /* eq.l.f */
- {40,13,rr,V,V,0}, /* le.b.f */
- {40,14,rr,V,V,0}, /* le.h.f */
- {40,15,rr,V,V,0}, /* le.w.f */
- {40,16,rr,V,V,0}, /* le.l.f */
- {40,13,rr,S,V,0}, /* le.b.f */
- {40,14,rr,S,V,0}, /* le.h.f */
- {40,15,rr,S,V,0}, /* le.w.f */
- {40,16,rr,S,V,0}, /* le.l.f */
- {41,13,rr,V,V,0}, /* lt.b.f */
- {41,14,rr,V,V,0}, /* lt.h.f */
- {41,15,rr,V,V,0}, /* lt.w.f */
- {41,16,rr,V,V,0}, /* lt.l.f */
- {41,13,rr,S,V,0}, /* lt.b.f */
- {41,14,rr,S,V,0}, /* lt.h.f */
- {41,15,rr,S,V,0}, /* lt.w.f */
- {41,16,rr,S,V,0}, /* lt.l.f */
- {43,13,rr,V,V,0}, /* neg.b.f */
- {43,14,rr,V,V,0}, /* neg.h.f */
- {43,15,rr,V,V,0}, /* neg.w.f */
- {43,16,rr,V,V,0}, /* neg.l.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e0_format4[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e0_format5[] = {
- {51,13,rr,V,V,0}, /* ldvi.b.f */
- {51,14,rr,V,V,0}, /* ldvi.h.f */
- {51,15,rr,V,V,0}, /* ldvi.w.f */
- {51,16,rr,V,V,0}, /* ldvi.l.f */
- {28,11,rr,V,V,0}, /* cvtw.s.f */
- {31,15,rr,V,V,0}, /* cvts.w.f */
- {28,16,rr,V,V,0}, /* cvtw.l.f */
- {33,15,rr,V,V,0}, /* cvtl.w.f */
- {52,13,rxr,V,V,0}, /* stvi.b.f */
- {52,14,rxr,V,V,0}, /* stvi.h.f */
- {52,15,rxr,V,V,0}, /* stvi.w.f */
- {52,16,rxr,V,V,0}, /* stvi.l.f */
- {52,13,rxr,S,V,0}, /* stvi.b.f */
- {52,14,rxr,S,V,0}, /* stvi.h.f */
- {52,15,rxr,S,V,0}, /* stvi.w.f */
- {52,16,rxr,S,V,0}, /* stvi.l.f */
-};
-struct formstr e0_format6[] = {
- {0,0,rxl,S,CIR,0}, /* mov */
- {0,0,lr,CIR,S,0}, /* mov */
- {0,0,lr,TOC,S,0}, /* mov */
- {0,0,lr,CPUID,S,0}, /* mov */
- {0,0,rxl,S,TTR,0}, /* mov */
- {0,0,lr,TTR,S,0}, /* mov */
- {118,0,nops,0,0,0}, /* ctrsl */
- {119,0,nops,0,0,0}, /* ctrsg */
- {0,0,rxl,S,VMU,0}, /* mov */
- {0,0,lr,VMU,S,0}, /* mov */
- {0,0,rxl,S,VML,0}, /* mov */
- {0,0,lr,VML,S,0}, /* mov */
- {0,0,rxl,S,ICR,0}, /* mov */
- {0,0,lr,ICR,S,0}, /* mov */
- {0,0,rxl,S,TCPU,0}, /* mov */
- {0,0,lr,TCPU,S,0}, /* mov */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {120,0,nops,0,0,0}, /* stop */
- {0,0,0,0,0,0},
- {0,0,rxl,S,TID,0}, /* mov */
- {0,0,lr,TID,S,0}, /* mov */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e0_format7[] = {
- {84,13,r,V,0,0}, /* sum.b.f */
- {84,14,r,V,0,0}, /* sum.h.f */
- {84,15,r,V,0,0}, /* sum.w.f */
- {84,16,r,V,0,0}, /* sum.l.f */
- {85,2,r,V,0,0}, /* all.f */
- {86,2,r,V,0,0}, /* any.f */
- {87,2,r,V,0,0}, /* parity.f */
- {0,0,0,0,0,0},
- {88,13,r,V,0,0}, /* max.b.f */
- {88,14,r,V,0,0}, /* max.h.f */
- {88,15,r,V,0,0}, /* max.w.f */
- {88,16,r,V,0,0}, /* max.l.f */
- {89,13,r,V,0,0}, /* min.b.f */
- {89,14,r,V,0,0}, /* min.h.f */
- {89,15,r,V,0,0}, /* min.w.f */
- {89,16,r,V,0,0}, /* min.l.f */
- {84,11,r,V,0,0}, /* sum.s.f */
- {84,12,r,V,0,0}, /* sum.d.f */
- {90,11,r,V,0,0}, /* prod.s.f */
- {90,12,r,V,0,0}, /* prod.d.f */
- {88,11,r,V,0,0}, /* max.s.f */
- {88,12,r,V,0,0}, /* max.d.f */
- {89,11,r,V,0,0}, /* min.s.f */
- {89,12,r,V,0,0}, /* min.d.f */
- {90,13,r,V,0,0}, /* prod.b.f */
- {90,14,r,V,0,0}, /* prod.h.f */
- {90,15,r,V,0,0}, /* prod.w.f */
- {90,16,r,V,0,0}, /* prod.l.f */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format0[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {10,18,rrr,S,V,V}, /* sub.s.t */
- {10,19,rrr,S,V,V}, /* sub.d.t */
- {4,18,rrr,S,V,V}, /* div.s.t */
- {4,19,rrr,S,V,V}, /* div.d.t */
- {3,18,rrr,V,V,V}, /* mul.s.t */
- {3,19,rrr,V,V,V}, /* mul.d.t */
- {4,18,rrr,V,V,V}, /* div.s.t */
- {4,19,rrr,V,V,V}, /* div.d.t */
- {3,18,rrr,V,S,V}, /* mul.s.t */
- {3,19,rrr,V,S,V}, /* mul.d.t */
- {4,18,rrr,V,S,V}, /* div.s.t */
- {4,19,rrr,V,S,V}, /* div.d.t */
- {5,1,rrr,V,V,V}, /* and.t */
- {6,1,rrr,V,V,V}, /* or.t */
- {7,1,rrr,V,V,V}, /* xor.t */
- {8,1,rrr,V,V,V}, /* shf.t */
- {5,1,rrr,V,S,V}, /* and.t */
- {6,1,rrr,V,S,V}, /* or.t */
- {7,1,rrr,V,S,V}, /* xor.t */
- {8,1,rrr,V,S,V}, /* shf.t */
- {9,18,rrr,V,V,V}, /* add.s.t */
- {9,19,rrr,V,V,V}, /* add.d.t */
- {10,18,rrr,V,V,V}, /* sub.s.t */
- {10,19,rrr,V,V,V}, /* sub.d.t */
- {9,18,rrr,V,S,V}, /* add.s.t */
- {9,19,rrr,V,S,V}, /* add.d.t */
- {10,18,rrr,V,S,V}, /* sub.s.t */
- {10,19,rrr,V,S,V}, /* sub.d.t */
- {9,20,rrr,V,V,V}, /* add.b.t */
- {9,21,rrr,V,V,V}, /* add.h.t */
- {9,22,rrr,V,V,V}, /* add.w.t */
- {9,23,rrr,V,V,V}, /* add.l.t */
- {9,20,rrr,V,S,V}, /* add.b.t */
- {9,21,rrr,V,S,V}, /* add.h.t */
- {9,22,rrr,V,S,V}, /* add.w.t */
- {9,23,rrr,V,S,V}, /* add.l.t */
- {10,20,rrr,V,V,V}, /* sub.b.t */
- {10,21,rrr,V,V,V}, /* sub.h.t */
- {10,22,rrr,V,V,V}, /* sub.w.t */
- {10,23,rrr,V,V,V}, /* sub.l.t */
- {10,20,rrr,V,S,V}, /* sub.b.t */
- {10,21,rrr,V,S,V}, /* sub.h.t */
- {10,22,rrr,V,S,V}, /* sub.w.t */
- {10,23,rrr,V,S,V}, /* sub.l.t */
- {3,20,rrr,V,V,V}, /* mul.b.t */
- {3,21,rrr,V,V,V}, /* mul.h.t */
- {3,22,rrr,V,V,V}, /* mul.w.t */
- {3,23,rrr,V,V,V}, /* mul.l.t */
- {3,20,rrr,V,S,V}, /* mul.b.t */
- {3,21,rrr,V,S,V}, /* mul.h.t */
- {3,22,rrr,V,S,V}, /* mul.w.t */
- {3,23,rrr,V,S,V}, /* mul.l.t */
- {4,20,rrr,V,V,V}, /* div.b.t */
- {4,21,rrr,V,V,V}, /* div.h.t */
- {4,22,rrr,V,V,V}, /* div.w.t */
- {4,23,rrr,V,V,V}, /* div.l.t */
- {4,20,rrr,V,S,V}, /* div.b.t */
- {4,21,rrr,V,S,V}, /* div.h.t */
- {4,22,rrr,V,S,V}, /* div.w.t */
- {4,23,rrr,V,S,V}, /* div.l.t */
-};
-struct formstr e1_format1[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {26,20,a2r,S,0,0}, /* ste.b.t */
- {26,21,a2r,S,0,0}, /* ste.h.t */
- {26,22,a2r,S,0,0}, /* ste.w.t */
- {26,23,a2r,S,0,0}, /* ste.l.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {18,20,a1r,V,0,0}, /* ld.b.t */
- {18,21,a1r,V,0,0}, /* ld.h.t */
- {18,22,a1r,V,0,0}, /* ld.w.t */
- {18,23,a1r,V,0,0}, /* ld.l.t */
- {21,20,a2r,V,0,0}, /* st.b.t */
- {21,21,a2r,V,0,0}, /* st.h.t */
- {21,22,a2r,V,0,0}, /* st.w.t */
- {21,23,a2r,V,0,0}, /* st.l.t */
-};
-struct formstr e1_format2[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {28,20,rr,V,V,0}, /* cvtw.b.t */
- {28,21,rr,V,V,0}, /* cvtw.h.t */
- {29,22,rr,V,V,0}, /* cvtb.w.t */
- {30,22,rr,V,V,0}, /* cvth.w.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {31,23,rr,V,V,0}, /* cvts.l.t */
- {32,22,rr,V,V,0}, /* cvtd.w.t */
- {33,18,rr,V,V,0}, /* cvtl.s.t */
- {28,19,rr,V,V,0}, /* cvtw.d.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {116,18,rr,V,V,0}, /* frint.s.t */
- {116,19,rr,V,V,0}, /* frint.d.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {81,18,rr,V,V,0}, /* sqrt.s.t */
- {81,19,rr,V,V,0}, /* sqrt.d.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format3[] = {
- {32,18,rr,V,V,0}, /* cvtd.s.t */
- {31,19,rr,V,V,0}, /* cvts.d.t */
- {33,19,rr,V,V,0}, /* cvtl.d.t */
- {32,23,rr,V,V,0}, /* cvtd.l.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {36,1,rr,V,V,0}, /* tzc.t */
- {44,1,rr,V,V,0}, /* lop.t */
- {117,1,rr,V,V,0}, /* xpnd.t */
- {42,1,rr,V,V,0}, /* not.t */
- {8,1,rr,S,V,0}, /* shf.t */
- {35,24,rr,V,V,0}, /* plc.t.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {37,18,rr,V,V,0}, /* eq.s.t */
- {37,19,rr,V,V,0}, /* eq.d.t */
- {43,18,rr,V,V,0}, /* neg.s.t */
- {43,19,rr,V,V,0}, /* neg.d.t */
- {37,18,rr,S,V,0}, /* eq.s.t */
- {37,19,rr,S,V,0}, /* eq.d.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {40,18,rr,V,V,0}, /* le.s.t */
- {40,19,rr,V,V,0}, /* le.d.t */
- {41,18,rr,V,V,0}, /* lt.s.t */
- {41,19,rr,V,V,0}, /* lt.d.t */
- {40,18,rr,S,V,0}, /* le.s.t */
- {40,19,rr,S,V,0}, /* le.d.t */
- {41,18,rr,S,V,0}, /* lt.s.t */
- {41,19,rr,S,V,0}, /* lt.d.t */
- {37,20,rr,V,V,0}, /* eq.b.t */
- {37,21,rr,V,V,0}, /* eq.h.t */
- {37,22,rr,V,V,0}, /* eq.w.t */
- {37,23,rr,V,V,0}, /* eq.l.t */
- {37,20,rr,S,V,0}, /* eq.b.t */
- {37,21,rr,S,V,0}, /* eq.h.t */
- {37,22,rr,S,V,0}, /* eq.w.t */
- {37,23,rr,S,V,0}, /* eq.l.t */
- {40,20,rr,V,V,0}, /* le.b.t */
- {40,21,rr,V,V,0}, /* le.h.t */
- {40,22,rr,V,V,0}, /* le.w.t */
- {40,23,rr,V,V,0}, /* le.l.t */
- {40,20,rr,S,V,0}, /* le.b.t */
- {40,21,rr,S,V,0}, /* le.h.t */
- {40,22,rr,S,V,0}, /* le.w.t */
- {40,23,rr,S,V,0}, /* le.l.t */
- {41,20,rr,V,V,0}, /* lt.b.t */
- {41,21,rr,V,V,0}, /* lt.h.t */
- {41,22,rr,V,V,0}, /* lt.w.t */
- {41,23,rr,V,V,0}, /* lt.l.t */
- {41,20,rr,S,V,0}, /* lt.b.t */
- {41,21,rr,S,V,0}, /* lt.h.t */
- {41,22,rr,S,V,0}, /* lt.w.t */
- {41,23,rr,S,V,0}, /* lt.l.t */
- {43,20,rr,V,V,0}, /* neg.b.t */
- {43,21,rr,V,V,0}, /* neg.h.t */
- {43,22,rr,V,V,0}, /* neg.w.t */
- {43,23,rr,V,V,0}, /* neg.l.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format4[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format5[] = {
- {51,20,rr,V,V,0}, /* ldvi.b.t */
- {51,21,rr,V,V,0}, /* ldvi.h.t */
- {51,22,rr,V,V,0}, /* ldvi.w.t */
- {51,23,rr,V,V,0}, /* ldvi.l.t */
- {28,18,rr,V,V,0}, /* cvtw.s.t */
- {31,22,rr,V,V,0}, /* cvts.w.t */
- {28,23,rr,V,V,0}, /* cvtw.l.t */
- {33,22,rr,V,V,0}, /* cvtl.w.t */
- {52,20,rxr,V,V,0}, /* stvi.b.t */
- {52,21,rxr,V,V,0}, /* stvi.h.t */
- {52,22,rxr,V,V,0}, /* stvi.w.t */
- {52,23,rxr,V,V,0}, /* stvi.l.t */
- {52,20,rxr,S,V,0}, /* stvi.b.t */
- {52,21,rxr,S,V,0}, /* stvi.h.t */
- {52,22,rxr,S,V,0}, /* stvi.w.t */
- {52,23,rxr,S,V,0}, /* stvi.l.t */
-};
-struct formstr e1_format6[] = {
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-struct formstr e1_format7[] = {
- {84,20,r,V,0,0}, /* sum.b.t */
- {84,21,r,V,0,0}, /* sum.h.t */
- {84,22,r,V,0,0}, /* sum.w.t */
- {84,23,r,V,0,0}, /* sum.l.t */
- {85,1,r,V,0,0}, /* all.t */
- {86,1,r,V,0,0}, /* any.t */
- {87,1,r,V,0,0}, /* parity.t */
- {0,0,0,0,0,0},
- {88,20,r,V,0,0}, /* max.b.t */
- {88,21,r,V,0,0}, /* max.h.t */
- {88,22,r,V,0,0}, /* max.w.t */
- {88,23,r,V,0,0}, /* max.l.t */
- {89,20,r,V,0,0}, /* min.b.t */
- {89,21,r,V,0,0}, /* min.h.t */
- {89,22,r,V,0,0}, /* min.w.t */
- {89,23,r,V,0,0}, /* min.l.t */
- {84,18,r,V,0,0}, /* sum.s.t */
- {84,19,r,V,0,0}, /* sum.d.t */
- {90,18,r,V,0,0}, /* prod.s.t */
- {90,19,r,V,0,0}, /* prod.d.t */
- {88,18,r,V,0,0}, /* max.s.t */
- {88,19,r,V,0,0}, /* max.d.t */
- {89,18,r,V,0,0}, /* min.s.t */
- {89,19,r,V,0,0}, /* min.d.t */
- {90,20,r,V,0,0}, /* prod.b.t */
- {90,21,r,V,0,0}, /* prod.h.t */
- {90,22,r,V,0,0}, /* prod.w.t */
- {90,23,r,V,0,0}, /* prod.l.t */
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
- {0,0,0,0,0,0},
-};
-char *lop[] = {
- "mov", /* 0 */
- "merg", /* 1 */
- "mask", /* 2 */
- "mul", /* 3 */
- "div", /* 4 */
- "and", /* 5 */
- "or", /* 6 */
- "xor", /* 7 */
- "shf", /* 8 */
- "add", /* 9 */
- "sub", /* 10 */
- "exit", /* 11 */
- "jmp", /* 12 */
- "jmpi", /* 13 */
- "jmpa", /* 14 */
- "jmps", /* 15 */
- "tac", /* 16 */
- "ldea", /* 17 */
- "ld", /* 18 */
- "tas", /* 19 */
- "pshea", /* 20 */
- "st", /* 21 */
- "call", /* 22 */
- "calls", /* 23 */
- "callq", /* 24 */
- "pfork", /* 25 */
- "ste", /* 26 */
- "incr", /* 27 */
- "cvtw", /* 28 */
- "cvtb", /* 29 */
- "cvth", /* 30 */
- "cvts", /* 31 */
- "cvtd", /* 32 */
- "cvtl", /* 33 */
- "ldpa", /* 34 */
- "plc", /* 35 */
- "tzc", /* 36 */
- "eq", /* 37 */
- "leu", /* 38 */
- "ltu", /* 39 */
- "le", /* 40 */
- "lt", /* 41 */
- "not", /* 42 */
- "neg", /* 43 */
- "lop", /* 44 */
- "cprs", /* 45 */
- "nop", /* 46 */
- "br", /* 47 */
- "bri", /* 48 */
- "bra", /* 49 */
- "brs", /* 50 */
- "ldvi", /* 51 */
- "stvi", /* 52 */
- "ldsdr", /* 53 */
- "ldkdr", /* 54 */
- "ln", /* 55 */
- "patu", /* 56 */
- "pate", /* 57 */
- "pich", /* 58 */
- "plch", /* 59 */
- "idle", /* 60 */
- "rtnq", /* 61 */
- "cfork", /* 62 */
- "rtn", /* 63 */
- "wfork", /* 64 */
- "join", /* 65 */
- "rtnc", /* 66 */
- "exp", /* 67 */
- "sin", /* 68 */
- "cos", /* 69 */
- "psh", /* 70 */
- "pop", /* 71 */
- "eni", /* 72 */
- "dsi", /* 73 */
- "bkpt", /* 74 */
- "msync", /* 75 */
- "mski", /* 76 */
- "xmti", /* 77 */
- "tstvv", /* 78 */
- "diag", /* 79 */
- "pbkpt", /* 80 */
- "sqrt", /* 81 */
- "casr", /* 82 */
- "atan", /* 83 */
- "sum", /* 84 */
- "all", /* 85 */
- "any", /* 86 */
- "parity", /* 87 */
- "max", /* 88 */
- "min", /* 89 */
- "prod", /* 90 */
- "halt", /* 91 */
- "sysc", /* 92 */
- "trap", /* 93 */
- "tst", /* 94 */
- "lck", /* 95 */
- "ulk", /* 96 */
- "spawn", /* 97 */
- "ldcmr", /* 98 */
- "stcmr", /* 99 */
- "popr", /* 100 */
- "pshr", /* 101 */
- "rcvr", /* 102 */
- "matm", /* 103 */
- "sndr", /* 104 */
- "putr", /* 105 */
- "getr", /* 106 */
- "matr", /* 107 */
- "mat", /* 108 */
- "get", /* 109 */
- "rcv", /* 110 */
- "inc", /* 111 */
- "put", /* 112 */
- "snd", /* 113 */
- "enal", /* 114 */
- "enag", /* 115 */
- "frint", /* 116 */
- "xpnd", /* 117 */
- "ctrsl", /* 118 */
- "ctrsg", /* 119 */
- "stop", /* 120 */
-};
-char *rop[] = {
- "", /* 0 */
- ".t", /* 1 */
- ".f", /* 2 */
- ".s", /* 3 */
- ".d", /* 4 */
- ".b", /* 5 */
- ".h", /* 6 */
- ".w", /* 7 */
- ".l", /* 8 */
- ".x", /* 9 */
- ".u", /* 10 */
- ".s.f", /* 11 */
- ".d.f", /* 12 */
- ".b.f", /* 13 */
- ".h.f", /* 14 */
- ".w.f", /* 15 */
- ".l.f", /* 16 */
- ".t.f", /* 17 */
- ".s.t", /* 18 */
- ".d.t", /* 19 */
- ".b.t", /* 20 */
- ".h.t", /* 21 */
- ".w.t", /* 22 */
- ".l.t", /* 23 */
- ".t.t", /* 24 */
-};
diff --git a/gdb/copying.awk b/gdb/copying.awk
deleted file mode 100644
index 378d620..0000000
--- a/gdb/copying.awk
+++ /dev/null
@@ -1,55 +0,0 @@
-BEGIN {
- FS="\"";
- print "/* Do not modify this file; it is created automatically";
- print " by copying.awk. */";
- print "#include \"defs.h\""
- print "#include \"command.h\""
- print "extern int immediate_quit;";
- print "static void";
- print "copying_info ()";
- print "{";
- print " immediate_quit++;";
- }
-NR == 1,/^[ ]*NO WARRANTY[ ]*$/ {
- if (! ($0 ~ /^[ ]*NO WARRANTY[ ]*$/))
- {
- printf " printf_filtered (\"";
- for (i = 1; i < NF; i++)
- printf "%s\\\"", $i;
- printf "%s\\n\");\n", $NF;
- }
- }
-/^[ ]*NO WARRANTY[ ]*$/ {
- print " immediate_quit--;";
- print "}";
- print "";
- print "static void";
- print "warranty_info ()";
- print "{";
- print " immediate_quit++;";
- }
-/^[ ]*NO WARRANTY[ ]*$/, /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/{
- if (! ($0 ~ /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/))
- {
- printf " printf_filtered (\"";
- for (i = 1; i < NF; i++)
- printf "%s\\\"", $i;
- printf "%s\\n\");\n", $NF;
- }
- }
-END {
- print " immediate_quit--;";
- print "}";
- print "";
- print "void"
- print "_initialize_copying ()";
- print "{";
- print " add_info (\"copying\", copying_info,";
- print " \"Conditions for redistributing copies of GDB.\");";
- print " add_info (\"warranty\", warranty_info,";
- print " \"Various kinds of warranty you do not have.\");";
- print "}";
- }
-
-
-
diff --git a/gdb/copying.c b/gdb/copying.c
deleted file mode 100644
index c31c280c7..0000000
--- a/gdb/copying.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/* Do not modify this file; it is created automatically
- by copying.awk. */
-#include "defs.h"
-#include "command.h"
-#include "gdbcmd.h"
-extern int immediate_quit;
-static void
-show_copying ()
-{
- immediate_quit++;
- printf_filtered ("\n");
- printf_filtered (" GNU GENERAL PUBLIC LICENSE\n");
- printf_filtered (" Version 1, February 1989\n");
- printf_filtered ("\n");
- printf_filtered (" Copyright (C) 1989 Free Software Foundation, Inc.\n");
- printf_filtered (" 675 Mass Ave, Cambridge, MA 02139, USA\n");
- printf_filtered (" Everyone is permitted to copy and distribute verbatim copies\n");
- printf_filtered (" of this license document, but changing it is not allowed.\n");
- printf_filtered ("\n");
- printf_filtered (" Preamble\n");
- printf_filtered ("\n");
- printf_filtered (" The license agreements of most software companies try to keep users\n");
- printf_filtered ("at the mercy of those companies. By contrast, our General Public\n");
- printf_filtered ("License is intended to guarantee your freedom to share and change free\n");
- printf_filtered ("software--to make sure the software is free for all its users. The\n");
- printf_filtered ("General Public License applies to the Free Software Foundation's\n");
- printf_filtered ("software and to any other program whose authors commit to using it.\n");
- printf_filtered ("You can use it for your programs, too.\n");
- printf_filtered ("\n");
- printf_filtered (" When we speak of free software, we are referring to freedom, not\n");
- printf_filtered ("price. Specifically, the General Public License is designed to make\n");
- printf_filtered ("sure that you have the freedom to give away or sell copies of free\n");
- printf_filtered ("software, that you receive source code or can get it if you want it,\n");
- printf_filtered ("that you can change the software or use pieces of it in new free\n");
- printf_filtered ("programs; and that you know you can do these things.\n");
- printf_filtered ("\n");
- printf_filtered (" To protect your rights, we need to make restrictions that forbid\n");
- printf_filtered ("anyone to deny you these rights or to ask you to surrender the rights.\n");
- printf_filtered ("These restrictions translate to certain responsibilities for you if you\n");
- printf_filtered ("distribute copies of the software, or if you modify it.\n");
- printf_filtered ("\n");
- printf_filtered (" For example, if you distribute copies of a such a program, whether\n");
- printf_filtered ("gratis or for a fee, you must give the recipients all the rights that\n");
- printf_filtered ("you have. You must make sure that they, too, receive or can get the\n");
- printf_filtered ("source code. And you must tell them their rights.\n");
- printf_filtered ("\n");
- printf_filtered (" We protect your rights with two steps: (1) copyright the software, and\n");
- printf_filtered ("(2) offer you this license which gives you legal permission to copy,\n");
- printf_filtered ("distribute and/or modify the software.\n");
- printf_filtered ("\n");
- printf_filtered (" Also, for each author's protection and ours, we want to make certain\n");
- printf_filtered ("that everyone understands that there is no warranty for this free\n");
- printf_filtered ("software. If the software is modified by someone else and passed on, we\n");
- printf_filtered ("want its recipients to know that what they have is not the original, so\n");
- printf_filtered ("that any problems introduced by others will not reflect on the original\n");
- printf_filtered ("authors' reputations.\n");
- printf_filtered ("\n");
- printf_filtered (" The precise terms and conditions for copying, distribution and\n");
- printf_filtered ("modification follow.\n");
- printf_filtered (" \n");
- printf_filtered (" GNU GENERAL PUBLIC LICENSE\n");
- printf_filtered (" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n");
- printf_filtered ("\n");
- printf_filtered (" 0. This License Agreement applies to any program or other work which\n");
- printf_filtered ("contains a notice placed by the copyright holder saying it may be\n");
- printf_filtered ("distributed under the terms of this General Public License. The\n");
- printf_filtered ("\"Program\", below, refers to any such program or work, and a \"work based\n");
- printf_filtered ("on the Program\" means either the Program or any work containing the\n");
- printf_filtered ("Program or a portion of it, either verbatim or with modifications. Each\n");
- printf_filtered ("licensee is addressed as \"you\".\n");
- printf_filtered ("\n");
- printf_filtered (" 1. You may copy and distribute verbatim copies of the Program's source\n");
- printf_filtered ("code as you receive it, in any medium, provided that you conspicuously and\n");
- printf_filtered ("appropriately publish on each copy an appropriate copyright notice and\n");
- printf_filtered ("disclaimer of warranty; keep intact all the notices that refer to this\n");
- printf_filtered ("General Public License and to the absence of any warranty; and give any\n");
- printf_filtered ("other recipients of the Program a copy of this General Public License\n");
- printf_filtered ("along with the Program. You may charge a fee for the physical act of\n");
- printf_filtered ("transferring a copy.\n");
- printf_filtered ("\n");
- printf_filtered (" 2. You may modify your copy or copies of the Program or any portion of\n");
- printf_filtered ("it, and copy and distribute such modifications under the terms of Paragraph\n");
- printf_filtered ("1 above, provided that you also do the following:\n");
- printf_filtered ("\n");
- printf_filtered (" a) cause the modified files to carry prominent notices stating that\n");
- printf_filtered (" you changed the files and the date of any change; and\n");
- printf_filtered ("\n");
- printf_filtered (" b) cause the whole of any work that you distribute or publish, that\n");
- printf_filtered (" in whole or in part contains the Program or any part thereof, either\n");
- printf_filtered (" with or without modifications, to be licensed at no charge to all\n");
- printf_filtered (" third parties under the terms of this General Public License (except\n");
- printf_filtered (" that you may choose to grant warranty protection to some or all\n");
- printf_filtered (" third parties, at your option).\n");
- printf_filtered ("\n");
- printf_filtered (" c) If the modified program normally reads commands interactively when\n");
- printf_filtered (" run, you must cause it, when started running for such interactive use\n");
- printf_filtered (" in the simplest and most usual way, to print or display an\n");
- printf_filtered (" announcement including an appropriate copyright notice and a notice\n");
- printf_filtered (" that there is no warranty (or else, saying that you provide a\n");
- printf_filtered (" warranty) and that users may redistribute the program under these\n");
- printf_filtered (" conditions, and telling the user how to view a copy of this General\n");
- printf_filtered (" Public License.\n");
- printf_filtered ("\n");
- printf_filtered (" d) You may charge a fee for the physical act of transferring a\n");
- printf_filtered (" copy, and you may at your option offer warranty protection in\n");
- printf_filtered (" exchange for a fee.\n");
- printf_filtered ("\n");
- printf_filtered ("Mere aggregation of another independent work with the Program (or its\n");
- printf_filtered ("derivative) on a volume of a storage or distribution medium does not bring\n");
- printf_filtered ("the other work under the scope of these terms.\n");
- printf_filtered (" \n");
- printf_filtered (" 3. You may copy and distribute the Program (or a portion or derivative of\n");
- printf_filtered ("it, under Paragraph 2) in object code or executable form under the terms of\n");
- printf_filtered ("Paragraphs 1 and 2 above provided that you also do one of the following:\n");
- printf_filtered ("\n");
- printf_filtered (" a) accompany it with the complete corresponding machine-readable\n");
- printf_filtered (" source code, which must be distributed under the terms of\n");
- printf_filtered (" Paragraphs 1 and 2 above; or,\n");
- printf_filtered ("\n");
- printf_filtered (" b) accompany it with a written offer, valid for at least three\n");
- printf_filtered (" years, to give any third party free (except for a nominal charge\n");
- printf_filtered (" for the cost of distribution) a complete machine-readable copy of the\n");
- printf_filtered (" corresponding source code, to be distributed under the terms of\n");
- printf_filtered (" Paragraphs 1 and 2 above; or,\n");
- printf_filtered ("\n");
- printf_filtered (" c) accompany it with the information you received as to where the\n");
- printf_filtered (" corresponding source code may be obtained. (This alternative is\n");
- printf_filtered (" allowed only for noncommercial distribution and only if you\n");
- printf_filtered (" received the program in object code or executable form alone.)\n");
- printf_filtered ("\n");
- printf_filtered ("Source code for a work means the preferred form of the work for making\n");
- printf_filtered ("modifications to it. For an executable file, complete source code means\n");
- printf_filtered ("all the source code for all modules it contains; but, as a special\n");
- printf_filtered ("exception, it need not include source code for modules which are standard\n");
- printf_filtered ("libraries that accompany the operating system on which the executable\n");
- printf_filtered ("file runs, or for standard header files or definitions files that\n");
- printf_filtered ("accompany that operating system.\n");
- printf_filtered ("\n");
- printf_filtered (" 4. You may not copy, modify, sublicense, distribute or transfer the\n");
- printf_filtered ("Program except as expressly provided under this General Public License.\n");
- printf_filtered ("Any attempt otherwise to copy, modify, sublicense, distribute or transfer\n");
- printf_filtered ("the Program is void, and will automatically terminate your rights to use\n");
- printf_filtered ("the Program under this License. However, parties who have received\n");
- printf_filtered ("copies, or rights to use copies, from you under this General Public\n");
- printf_filtered ("License will not have their licenses terminated so long as such parties\n");
- printf_filtered ("remain in full compliance.\n");
- printf_filtered ("\n");
- printf_filtered (" 5. By copying, distributing or modifying the Program (or any work based\n");
- printf_filtered ("on the Program) you indicate your acceptance of this license to do so,\n");
- printf_filtered ("and all its terms and conditions.\n");
- printf_filtered ("\n");
- printf_filtered (" 6. Each time you redistribute the Program (or any work based on the\n");
- printf_filtered ("Program), the recipient automatically receives a license from the original\n");
- printf_filtered ("licensor to copy, distribute or modify the Program subject to these\n");
- printf_filtered ("terms and conditions. You may not impose any further restrictions on the\n");
- printf_filtered ("recipients' exercise of the rights granted herein.\n");
- printf_filtered (" \n");
- printf_filtered (" 7. The Free Software Foundation may publish revised and/or new versions\n");
- printf_filtered ("of the General Public License from time to time. Such new versions will\n");
- printf_filtered ("be similar in spirit to the present version, but may differ in detail to\n");
- printf_filtered ("address new problems or concerns.\n");
- printf_filtered ("\n");
- printf_filtered ("Each version is given a distinguishing version number. If the Program\n");
- printf_filtered ("specifies a version number of the license which applies to it and \"any\n");
- printf_filtered ("later version\", you have the option of following the terms and conditions\n");
- printf_filtered ("either of that version or of any later version published by the Free\n");
- printf_filtered ("Software Foundation. If the Program does not specify a version number of\n");
- printf_filtered ("the license, you may choose any version ever published by the Free Software\n");
- printf_filtered ("Foundation.\n");
- printf_filtered ("\n");
- printf_filtered (" 8. If you wish to incorporate parts of the Program into other free\n");
- printf_filtered ("programs whose distribution conditions are different, write to the author\n");
- printf_filtered ("to ask for permission. For software which is copyrighted by the Free\n");
- printf_filtered ("Software Foundation, write to the Free Software Foundation; we sometimes\n");
- printf_filtered ("make exceptions for this. Our decision will be guided by the two goals\n");
- printf_filtered ("of preserving the free status of all derivatives of our free software and\n");
- printf_filtered ("of promoting the sharing and reuse of software generally.\n");
- printf_filtered ("\n");
- immediate_quit--;
-}
-
-static void
-show_warranty ()
-{
- immediate_quit++;
- printf_filtered (" NO WARRANTY\n");
- printf_filtered ("\n");
- printf_filtered (" 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n");
- printf_filtered ("FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n");
- printf_filtered ("OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n");
- printf_filtered ("PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n");
- printf_filtered ("OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n");
- printf_filtered ("MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n");
- printf_filtered ("TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n");
- printf_filtered ("PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n");
- printf_filtered ("REPAIR OR CORRECTION.\n");
- printf_filtered ("\n");
- printf_filtered (" 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n");
- printf_filtered ("WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n");
- printf_filtered ("REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n");
- printf_filtered ("INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n");
- printf_filtered ("OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n");
- printf_filtered ("TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n");
- printf_filtered ("YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n");
- printf_filtered ("PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n");
- printf_filtered ("POSSIBILITY OF SUCH DAMAGES.\n");
- printf_filtered ("\n");
- immediate_quit--;
-}
-
-void
-_initialize_copying ()
-{
- add_cmd ("copying", no_class, show_copying,
- "Conditions for redistributing copies of GDB.",
- &showlist);
- add_cmd ("warranty", no_class, show_warranty,
- "Various kinds of warranty you do not have.",
- &showlist);
-}
diff --git a/gdb/core.c b/gdb/core.c
deleted file mode 100644
index 8b6895d..0000000
--- a/gdb/core.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/* Work with core dump and executable files, for GDB.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <errno.h>
-#include <signal.h>
-#include <fcntl.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h" /* required by inferior.h */
-#include "inferior.h"
-#include "symtab.h"
-#include "command.h"
-#include "bfd.h"
-#include "target.h"
-#include "gdbcore.h"
-
-extern int xfer_memory ();
-extern void child_attach (), child_create_inferior ();
-
-extern int sys_nerr;
-extern char *sys_errlist[];
-extern char *sys_siglist[];
-
-extern char registers[];
-
-/* Hook for `exec_file_command' command to call. */
-
-void (*exec_file_display_hook) () = NULL;
-
-/* Binary file diddling handle for the core file. */
-
-bfd *core_bfd = NULL;
-
-/* Forward decl */
-extern struct target_ops core_ops;
-
-
-/* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
-/* ARGSUSED */
-void
-core_close (quitting)
- int quitting;
-{
- if (core_bfd) {
- free (bfd_get_filename (core_bfd));
- bfd_close (core_bfd);
- core_bfd = NULL;
-#ifdef CLEAR_SOLIB
- CLEAR_SOLIB ();
-#endif
- if (core_ops.sections) {
- free (core_ops.sections);
- core_ops.sections = NULL;
- core_ops.sections_end = NULL;
- }
- }
-}
-
-#ifdef SOLIB_ADD
-/* Stub function for catch_errors around shared library hacking. */
-
-int
-solib_add_stub (from_tty)
- char *from_tty;
-{
- SOLIB_ADD (NULL, (int)from_tty, &core_ops);
- return 0;
-}
-#endif /* SOLIB_ADD */
-
-/* This routine opens and sets up the core file bfd */
-
-void
-core_open (filename, from_tty)
- char *filename;
- int from_tty;
-{
- const char *p;
- int siggy;
- struct cleanup *old_chain;
- char *temp;
- bfd *temp_bfd;
- int ontop;
- int scratch_chan;
-
- target_preopen (from_tty);
- if (!filename)
- {
- error (core_bfd?
- "No core file specified. (Use `detach' to stop debugging a core file.)"
- : "No core file specified.");
- }
-
- filename = tilde_expand (filename);
- if (filename[0] != '/') {
- temp = concat (current_directory, "/", filename, NULL);
- free (filename);
- filename = temp;
- }
-
- old_chain = make_cleanup (free, filename);
-
- scratch_chan = open (filename, write_files? O_RDWR: O_RDONLY, 0);
- if (scratch_chan < 0)
- perror_with_name (filename);
-
- temp_bfd = bfd_fdopenr (filename, NULL, scratch_chan);
- if (temp_bfd == NULL)
- {
- perror_with_name (filename);
- }
-
- if (!bfd_check_format (temp_bfd, bfd_core))
- {
- make_cleanup (bfd_close, temp_bfd); /* Do it after the err msg */
- error ("\"%s\" is not a core dump: %s", filename, bfd_errmsg(bfd_error));
- }
-
- /* Looks semi-reasonable. Toss the old core file and work on the new. */
-
- discard_cleanups (old_chain); /* Don't free filename any more */
- unpush_target (&core_ops);
- core_bfd = temp_bfd;
- old_chain = make_cleanup (core_close, core_bfd);
-
- validate_files ();
-
- /* Find the data section */
- if (build_section_table (core_bfd, &core_ops.sections,
- &core_ops.sections_end))
- error ("Can't find sections in `%s': %s", bfd_get_filename(core_bfd),
- bfd_errmsg (bfd_error));
-
- ontop = !push_target (&core_ops);
- discard_cleanups (old_chain);
-
- p = bfd_core_file_failing_command (core_bfd);
- if (p)
- printf ("Core was generated by `%s'.\n", p);
-
- siggy = bfd_core_file_failing_signal (core_bfd);
- if (siggy > 0)
- printf ("Program terminated with signal %d, %s.\n", siggy,
- siggy < NSIG ? sys_siglist[siggy] : "(undocumented)");
-
- if (ontop) {
- /* Fetch all registers from core file */
- target_fetch_registers (-1);
-
- /* Add symbols and section mappings for any shared libraries */
-#ifdef SOLIB_ADD
- (void) catch_errors (solib_add_stub, (char *)from_tty, (char *)0);
-#endif
-
- /* Now, set up the frame cache, and print the top of stack */
- set_current_frame (create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- select_frame (get_current_frame (), 0);
- print_stack_frame (selected_frame, selected_frame_level, 1);
- } else {
- printf (
-"Warning: you won't be able to access this core file until you terminate\n\
-your %s; do ``info files''\n", current_target->to_longname);
- }
-}
-
-void
-core_detach (args, from_tty)
- char *args;
- int from_tty;
-{
- if (args)
- error ("Too many arguments");
- unpush_target (&core_ops);
- if (from_tty)
- printf ("No core file now.\n");
-}
-
-/* Backward compatability with old way of specifying core files. */
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- dont_repeat (); /* Either way, seems bogus. */
- if (!filename)
- core_detach (filename, from_tty);
- else
- core_open (filename, from_tty);
-}
-
-
-/* Call this to specify the hook for exec_file_command to call back.
- This is called from the x-window display code. */
-
-void
-specify_exec_file_hook (hook)
- void (*hook) ();
-{
- exec_file_display_hook = hook;
-}
-
-/* The exec file must be closed before running an inferior.
- If it is needed again after the inferior dies, it must
- be reopened. */
-
-void
-close_exec_file ()
-{
-#ifdef FIXME
- if (exec_bfd)
- bfd_tempclose (exec_bfd);
-#endif
-}
-
-void
-reopen_exec_file ()
-{
-#ifdef FIXME
- if (exec_bfd)
- bfd_reopen (exec_bfd);
-#endif
-}
-
-/* If we have both a core file and an exec file,
- print a warning if they don't go together. */
-
-void
-validate_files ()
-{
- if (exec_bfd && core_bfd)
- {
- if (!core_file_matches_executable_p (core_bfd, exec_bfd))
- printf ("Warning: core file may not match specified executable file.\n");
- else if (bfd_get_mtime(exec_bfd) > bfd_get_mtime(core_bfd))
- printf ("Warning: exec file is newer than core file.\n");
- }
-}
-
-/* Return the name of the executable file as a string.
- ERR nonzero means get error if there is none specified;
- otherwise return 0 in that case. */
-
-char *
-get_exec_file (err)
- int err;
-{
- if (exec_bfd) return bfd_get_filename(exec_bfd);
- if (!err) return NULL;
-
- error ("No executable file specified.\n\
-Use the \"file\" or \"exec-file\" command.");
- return NULL;
-}
-
-static void
-core_files_info (t)
- struct target_ops *t;
-{
- struct section_table *p;
-
- printf_filtered ("\t`%s', ", bfd_get_filename(core_bfd));
- wrap_here (" ");
- printf_filtered ("file type %s.\n", bfd_get_target(core_bfd));
-
- for (p = t->sections; p < t->sections_end; p++) {
- printf_filtered ("\t%s", local_hex_string_custom (p->addr, "08"));
- printf_filtered (" - %s is %s",
- local_hex_string_custom (p->endaddr, "08"),
- bfd_section_name (p->bfd, p->sec_ptr));
- if (p->bfd != core_bfd) {
- printf_filtered (" in %s", bfd_get_filename (p->bfd));
- }
- printf_filtered ("\n");
- }
-}
-
-void
-memory_error (status, memaddr)
- int status;
- CORE_ADDR memaddr;
-{
-
- if (status == EIO)
- {
- /* Actually, address between memaddr and memaddr + len
- was out of bounds. */
- error ("Cannot access memory at address %s.", local_hex_string(memaddr));
- }
- else
- {
- if (status >= sys_nerr || status < 0)
- error ("Error accessing memory address %s: unknown error (%d).",
- local_hex_string(memaddr), status);
- else
- error ("Error accessing memory address %s: %s.",
- local_hex_string(memaddr), sys_errlist[status]);
- }
-}
-
-/* Same as target_read_memory, but report an error if can't read. */
-void
-read_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int status;
- status = target_read_memory (memaddr, myaddr, len);
- if (status != 0)
- memory_error (status, memaddr);
-}
-
-/* Same as target_write_memory, but report an error if can't write. */
-void
-write_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int status;
-
- status = target_write_memory (memaddr, myaddr, len);
- if (status != 0)
- memory_error (status, memaddr);
-}
-
-/* Read an integer from debugged memory, given address and number of bytes. */
-
-long
-read_memory_integer (memaddr, len)
- CORE_ADDR memaddr;
- int len;
-{
- char cbuf;
- short sbuf;
- int ibuf;
- long lbuf;
-
- if (len == sizeof (char))
- {
- read_memory (memaddr, &cbuf, len);
- return cbuf;
- }
- if (len == sizeof (short))
- {
- read_memory (memaddr, (char *)&sbuf, len);
- SWAP_TARGET_AND_HOST (&sbuf, sizeof (short));
- return sbuf;
- }
- if (len == sizeof (int))
- {
- read_memory (memaddr, (char *)&ibuf, len);
- SWAP_TARGET_AND_HOST (&ibuf, sizeof (int));
- return ibuf;
- }
- if (len == sizeof (lbuf))
- {
- read_memory (memaddr, (char *)&lbuf, len);
- SWAP_TARGET_AND_HOST (&lbuf, sizeof (lbuf));
- return lbuf;
- }
- error ("Cannot handle integers of %d bytes.", len);
- return -1; /* for lint */
-}
-
-/* Get the registers out of a core file. This is the machine-
- independent part. Fetch_core_registers is the machine-dependent
- part, typically implemented in the xm-file for each architecture. */
-
-/* We just get all the registers, so we don't use regno. */
-/* ARGSUSED */
-static void
-get_core_registers (regno)
- int regno;
-{
- sec_ptr reg_sec;
- unsigned size;
- char *the_regs;
-
- reg_sec = bfd_get_section_by_name (core_bfd, ".reg");
- if (!reg_sec) 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))
- {
- fetch_core_registers (the_regs, size, 0,
- (unsigned) bfd_section_vma (abfd,reg_sec));
- }
- else
- {
-cant:
- fprintf (stderr, "Couldn't fetch registers from core file: %s\n",
- bfd_errmsg (bfd_error));
- }
-
- /* Now do it again for the float registers, if they exist. */
- reg_sec = bfd_get_section_by_name (core_bfd, ".reg2");
- if (reg_sec) {
- 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))
- {
- fetch_core_registers (the_regs, size, 2,
- (unsigned) bfd_section_vma (abfd,reg_sec));
- }
- else
- {
- fprintf (stderr, "Couldn't fetch register set 2 from core file: %s\n",
- bfd_errmsg (bfd_error));
- }
- }
- registers_fetched();
-}
-
-struct target_ops core_ops = {
- "core", "Local core dump file",
- "Use a core file as a target. Specify the filename of the core file.",
- core_open, core_close,
- child_attach, core_detach, 0, 0, /* resume, wait */
- get_core_registers,
- 0, 0, 0, 0, /* store_regs, prepare_to_store, conv_to, conv_from */
- xfer_memory, core_files_info,
- 0, 0, /* core_insert_breakpoint, core_remove_breakpoint, */
- 0, 0, 0, 0, 0, /* terminal stuff */
- 0, 0, 0, 0, /* kill, load, call fn, lookup sym */
- child_create_inferior, 0, /* mourn_inferior */
- core_stratum, 0, /* next */
- 0, 1, 1, 1, 0, /* all mem, mem, stack, regs, exec */
- 0, 0, /* section pointers */
- OPS_MAGIC, /* Always the last thing */
-};
-
-void
-_initialize_core()
-{
-
- add_com ("core-file", class_files, core_file_command,
- "Use FILE as core dump for examining memory and registers.\n\
-No arg means have no core file. This command has been superseded by the\n\
-`target core' and `detach' commands.");
- add_target (&core_ops);
-}
diff --git a/gdb/coredep.c b/gdb/coredep.c
deleted file mode 100644
index 87be349..0000000
--- a/gdb/coredep.c
+++ /dev/null
@@ -1,113 +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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* core.c is supposed to be the more machine-independent aspects of this;
- this file is more machine-specific. */
-
-#include "defs.h"
-#include "param.h"
-#include "gdbcore.h"
-#include <stdio.h>
-
-/* These are needed on various systems to expand REGISTER_U_ADDR. */
-#include <sys/types.h>
-#include <sys/param.h>
-#ifndef USG
-#include <sys/dir.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/user.h>
-#include <sys/ptrace.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. */
-
- /* 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
- 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;
- if (reg_ptr > core_reg_size)
- fprintf (stderr, "Can't find registers in core file\n");
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- addr = 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 >= NUM_REGS)
- error ("Invalid register number %d.", regno);
-
- REGISTER_U_ADDR (addr, blockend, regno);
-
- return addr;
-}
-
-#endif /* REGISTER_U_ADDR */
diff --git a/gdb/cplus-dem.c b/gdb/cplus-dem.c
deleted file mode 100644
index 6800f3f..0000000
--- a/gdb/cplus-dem.c
+++ /dev/null
@@ -1,1369 +0,0 @@
-/* Demangler for GNU C++
- Copyright (C) 1989 Free Software Foundation, Inc.
- written by James Clark (jjc@jclark.uucp)
-
- 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This is for g++ 1.36.1 (November 6 version). It will probably
- require changes for any other version.
-
- Modified for g++ 1.36.2 (November 18 version).
-
- Modified for g++ 1.90.06 (December 31 version).
-
- Modified for g++ 1.95.03 (November 13 verison). */
-
-/* This file exports one function
-
- char *cplus_demangle (const char *name, int mode)
-
- If NAME is a mangled function name produced by GNU C++, then
- a pointer to a malloced string giving a C++ representation
- of the name will be returned; otherwise NULL will be returned.
- It is the caller's responsibility to free the string which
- is returned.
-
- If MODE > 0, then ANSI qualifiers such as `const' and `void' are output.
- Otherwise they are not.
- If MODE >= 0, parameters are emitted; otherwise not.
-
- For example,
-
- cplus_demangle ("foo__1Ai", 0) => "A::foo(int)"
- cplus_demangle ("foo__1Ai", 1) => "A::foo(int)"
- cplus_demangle ("foo__1Ai", -1) => "A::foo"
-
- cplus_demangle ("foo__1Afe", 0) => "A::foo(float,...)"
- cplus_demangle ("foo__1Afe", 1) => "A::foo(float,...)"
- cplus_demangle ("foo__1Afe", -1) => "A::foo"
-
- This file imports xmalloc and xrealloc, which are like malloc and
- realloc except that they generate a fatal error if there is no
- available memory. */
-
-/* define this if names don't start with _ */
-/* #define nounderscore 1 */
-
-#include <stdio.h>
-#include <ctype.h>
-
-/* GDB-specific, FIXME. */
-#include "defs.h"
-#include "param.h"
-
-#ifdef USG
-#include <memory.h>
-#include <string.h>
-#else
-#include <strings.h>
-#define memcpy(s1, s2, n) bcopy ((s2), (s1), (n))
-#define memcmp(s1, s2, n) bcmp ((s2), (s1), (n))
-#define strchr index
-#define strrchr rindex
-#endif
-
-/* This is '$' on systems where the assembler can deal with that.
- Where the assembler can't, it's '.' (but on many systems '.' is
- used for other things). */
-#if !defined (CPLUS_MARKER)
-#define CPLUS_MARKER '$'
-#endif
-
-#ifndef __STDC__
-#define const
-#endif
-
-#ifdef __STDC__
-extern char *cplus_demangle (const char *type, int mode);
-#else
-extern char *cplus_demangle ();
-#endif
-
-#ifdef __STDC__
-/* GDB prototypes these as void* in defs.h, so we better too, at least
- as long as we're including defs.h. */
-extern void *xmalloc (int);
-extern void *xrealloc (char *, int);
-extern void free (void *);
-#else
-extern char *xmalloc ();
-extern char *xrealloc ();
-extern void free ();
-#endif
-
-static char **typevec = 0;
-static int ntypes = 0;
-static int typevec_size = 0;
-
-const static struct optable {
- const char *in;
- const char *out;
- int ansi;
-} optable[] = {
- "nw", " new", 1, /* new (1.92, ansi) */
- "dl", " delete", 1, /* new (1.92, ansi) */
- "new", " new", 0, /* old (1.91, and 1.x) */
- "delete", " delete", 0, /* old (1.91, and 1.x) */
- "as", "=", 1, /* ansi */
- "ne", "!=", 1, /* old, ansi */
- "eq", "==", 1, /* old, ansi */
- "ge", ">=", 1, /* old, ansi */
- "gt", ">", 1, /* old, ansi */
- "le", "<=", 1, /* old, ansi */
- "lt", "<", 1, /* old, ansi */
- "plus", "+", 0, /* old */
- "pl", "+", 1, /* ansi */
- "apl", "+=", 1, /* ansi */
- "minus", "-", 0, /* old */
- "mi", "-", 1, /* ansi */
- "ami", "-=", 1, /* ansi */
- "mult", "*", 0, /* old */
- "ml", "*", 1, /* ansi */
- "aml", "*=", 1, /* ansi */
- "convert", "+", 0, /* old (unary +) */
- "negate", "-", 0, /* old (unary -) */
- "trunc_mod", "%", 0, /* old */
- "md", "%", 1, /* ansi */
- "amd", "%=", 1, /* ansi */
- "trunc_div", "/", 0, /* old */
- "dv", "/", 1, /* ansi */
- "adv", "/=", 1, /* ansi */
- "truth_andif", "&&", 0, /* old */
- "aa", "&&", 1, /* ansi */
- "truth_orif", "||", 0, /* old */
- "oo", "||", 1, /* ansi */
- "truth_not", "!", 0, /* old */
- "nt", "!", 1, /* ansi */
- "postincrement", "++", 0, /* old */
- "pp", "++", 1, /* ansi */
- "postdecrement", "--", 0, /* old */
- "mm", "--", 1, /* ansi */
- "bit_ior", "|", 0, /* old */
- "or", "|", 1, /* ansi */
- "aor", "|=", 1, /* ansi */
- "bit_xor", "^", 0, /* old */
- "er", "^", 1, /* ansi */
- "aer", "^=", 1, /* ansi */
- "bit_and", "&", 0, /* old */
- "ad", "&", 1, /* ansi */
- "aad", "&=", 1, /* ansi */
- "bit_not", "~", 0, /* old */
- "co", "~", 1, /* ansi */
- "call", "()", 0, /* old */
- "cl", "()", 1, /* ansi */
- "alshift", "<<", 0, /* old */
- "ls", "<<", 1, /* ansi */
- "als", "<<=", 1, /* ansi */
- "arshift", ">>", 0, /* old */
- "rs", ">>", 1, /* ansi */
- "ars", ">>=", 1, /* ansi */
- "component", "->", 0, /* old */
- "rf", "->", 1, /* ansi */
- "indirect", "*", 0, /* old */
- "method_call", "->()", 0, /* old */
- "addr", "&", 0, /* old (unary &) */
- "array", "[]", 0, /* old */
- "vc", "[]", 1, /* ansi */
- "compound", ",", 0, /* old */
- "cm", ",", 1, /* ansi */
- "cond", "?:", 0, /* old */
- "cn", "?:", 1, /* psuedo-ansi */
- "max", ">?", 0, /* old */
- "mx", ">?", 1, /* psuedo-ansi */
- "min", "<?", 0, /* old */
- "mn", "<?", 1, /* psuedo-ansi */
- "nop", "", 0, /* old (for operator=) */
-};
-
-/* Beware: these aren't '\0' terminated. */
-
-typedef struct string {
- char *b; /* pointer to start of string */
- char *p; /* pointer after last character */
- char *e; /* pointer after end of allocated space */
-} string;
-
-#ifdef __STDC__
-static void string_need (string *s, int n);
-static void string_delete (string *s);
-static void string_init (string *s);
-static void string_clear (string *s);
-static int string_empty (string *s);
-static void string_append (string *p, const char *s);
-static void string_appends (string *p, string *s);
-static void string_appendn (string *p, const char *s, int n);
-static void string_prepend (string *p, const char *s);
-#if 0
-static void string_prepends (string *p, string *s);
-#endif
-static void string_prependn (string *p, const char *s, int n);
-static int get_count (const char **type, int *count);
-static int do_args (const char **type, string *decl, int arg_mode);
-static int do_type (const char **type, string *result, int arg_mode);
-static int do_arg (const char **type, string *result, int arg_mode);
-static void munge_function_name (string *name, int arg_mode);
-static void remember_type (const char *type, int len);
-#else
-static void string_need ();
-static void string_delete ();
-static void string_init ();
-static void string_clear ();
-static int string_empty ();
-static void string_append ();
-static void string_appends ();
-static void string_appendn ();
-static void string_prepend ();
-#if 0
-static void string_prepends ();
-#endif
-static void string_prependn ();
-static int get_count ();
-static int do_args ();
-static int do_type ();
-static int do_arg ();
-static int do_args ();
-static void munge_function_name ();
-static void remember_type ();
-#endif
-
-/* Takes operator name as e.g. "++" and returns mangled
- operator name (e.g. "postincrement_expr"), or NULL if not found.
-
- If ARG_MODE == 1, return the ANSI name;
- if ARG_MODE == 0 return the old GNU name. */
-char *
-cplus_mangle_opname (opname, arg_mode)
- char *opname;
- int arg_mode;
-{
- int i, len = strlen (opname);
-
- if (arg_mode != 0 && arg_mode != 1)
- error ("invalid arg_mode");
-
- for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].out) == len
- && arg_mode == optable[i].ansi
- && memcmp (optable[i].out, opname, len) == 0)
- return (char *)optable[i].in;
- }
- return 0;
-}
-
-char *
-cplus_demangle (type, arg_mode)
- const char *type;
- int arg_mode;
-{
- string decl;
- int n;
- int success = 0;
- int constructor = 0;
- int destructor = 0;
- int static_type = 0;
- int const_flag = 0;
- int i;
- const char *p;
-#ifndef LONGERNAMES
- const char *premangle;
-#endif
-
-# define print_ansi_qualifiers (arg_mode > 0)
-# define print_arg_types (arg_mode >= 0)
-
- if (type == NULL || *type == '\0')
- return NULL;
-#ifndef nounderscore
- if (*type++ != '_')
- return NULL;
-#endif
- p = type;
- while (*p != '\0' && !(*p == '_' && p[1] == '_'))
- p++;
- if (*p == '\0')
- {
- /* destructor */
- if (type[0] == '_' && type[1] == CPLUS_MARKER && type[2] == '_')
- {
- int n = (strlen (type) - 3)*2 + 3 + 2 + 1;
- char *tem = (char *) xmalloc (n);
- strcpy (tem, type + 3);
- strcat (tem, "::~");
- strcat (tem, type + 3);
- if (print_arg_types)
- strcat (tem, "()");
- return tem;
- }
- /* static data member */
- if (*type != '_' && (p = strchr (type, CPLUS_MARKER)) != NULL)
- {
- int n = strlen (type) + 2;
- char *tem = (char *) xmalloc (n);
- memcpy (tem, type, p - type);
- strcpy (tem + (p - type), "::");
- strcpy (tem + (p - type) + 2, p + 1);
- return tem;
- }
- /* virtual table "_vt$" */
- if (type[0] == '_' && type[1] == 'v' && type[2] == 't' && type[3] == CPLUS_MARKER)
- {
- int n = strlen (type + 4) + 14 + 1;
- char *tem = (char *) xmalloc (n);
- strcpy (tem, type + 4);
- strcat (tem, " virtual table");
- return tem;
- }
- return NULL;
- }
-
- string_init (&decl);
-
- if (static_type)
- {
- if (!isdigit (p[0]) && ('t' != p[0]))
- {
- string_delete (&decl);
- return NULL;
- }
- }
- else if (p == type)
- {
- if (!isdigit (p[2]) && ('t' != p[2]))
- {
- p += 1;
- while (*p != '\0' && !(*p == '_' && p[1] == '_'))
- p++;
- string_appendn (&decl, type, p - type);
- *(decl.p) = '\0';
- munge_function_name (&decl, 1);
- if (decl.b[0] == '_')
- {
- string_delete (&decl);
- return NULL;
- }
- else
- p += 2;
- }
- else
- {
- constructor = 1;
- p += 2;
- }
- }
- else
- {
- string_appendn (&decl, type, p - type);
- *(decl.p) = '\0';
- munge_function_name (&decl, arg_mode);
- p += 2;
- }
-
-#ifndef LONGERNAMES
- premangle = p;
-#endif
- switch (*p)
- {
- case 'C':
- /* a const member function */
- if (!isdigit (p[1]))
- {
- string_delete (&decl);
- return NULL;
- }
- p += 1;
- const_flag = 1;
- /* fall through */
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- n = 0;
- do
- {
- n *= 10;
- n += *p - '0';
- p += 1;
- }
- while (isdigit (*p));
- if (strlen (p) < n)
- {
- string_delete (&decl);
- return NULL;
- }
- if (constructor || destructor)
- {
- string_appendn (&decl, p, n);
- string_append (&decl, "::");
- if (destructor)
- string_append(&decl, "~");
- string_appendn (&decl, p, n);
- }
- else
- {
- string_prepend (&decl, "::");
- string_prependn (&decl, p, n);
- }
- p += n;
-#ifndef LONGERNAMES
- remember_type (premangle, p - premangle);
-#endif
- if (static_type)
- {
- string_append(&decl, p+1);
- p += strlen(p);
- success = 1;
- }
- else
- success = do_args (&p, &decl, arg_mode);
- if (const_flag && print_arg_types)
- string_append (&decl, " const");
- break;
- case 'F':
- p += 1;
- success = do_args (&p, &decl, arg_mode);
- break;
- /* template additions */
- case 't':
- p += 1;
- {
- int r, i;
- int non_empty = 0;
- string tname;
- string trawname;
-
- string temp;
- int need_comma = 0;
-
- string_init(&tname);
- string_init(&trawname);
-
- /* get template name */
- if (!get_count (&p, &r))
- return 0;
- string_appendn (&tname, p, r);
- string_appendn (&trawname, p, r);
- string_appendn (&trawname, "", 1);
- p += r;
- string_append (&tname, "<");
- /* get size of template parameter list */
- if (!get_count (&p, &r))
- return 0;
- for (i = 0; i < r; i++)
- {
- if (need_comma)
- string_append (&tname, ", ");
- /* Z for type parameters */
- if (*p == 'Z')
- {
- p += 1;
-
- success = do_type (&p, &temp, arg_mode);
- string_appendn (&temp, "", 1);
- if (success)
- string_append (&tname, temp.b);
- string_delete(&temp);
- if (!success)
- break;
- }
- /* otherwise, value parameter */
- else
- {
- const char *old_p = p;
- int is_pointer = 0;
- int is_real = 0;
- int is_integral = 0;
- int done = 0;
-
- success = do_type (&p, &temp, arg_mode);
- string_appendn (&temp, "", 1);
- if (success)
- string_append (&tname, temp.b);
- string_delete(&temp);
- if (!success)
- break;
- string_append (&tname, "=");
- while (*old_p && !done)
- {
- switch (*old_p)
- {
- case 'P':
- case 'R':
- done = is_pointer = 1;
- break;
- case 'C': /* const */
- case 'U': /* unsigned */
- case 'V': /* volatile */
- case 'F': /* function */
- case 'M': /* member function */
- case 'O': /* ??? */
- old_p++;
- continue;
- case 'Q': /* repetition of following */
- case 'T': /* remembered type */
- abort();
- break;
- case 'v': /* void */
- abort();
- break;
- case 'x': /* long long */
- case 'l': /* long */
- case 'i': /* int */
- case 's': /* short */
- case 'c': /* char */
- done = is_integral = 1;
- break;
- case 'r': /* long double */
- case 'd': /* double */
- case 'f': /* float */
- done = is_real = 1;
- break;
- default:
- abort();
- }
- }
- if (is_integral)
- {
- if (*p == 'm')
- {
- string_appendn (&tname, "-", 1);
- p++;
- }
- while (isdigit (*p))
- {
- string_appendn (&tname, p, 1);
- p++;
- }
- }
- else if (is_real)
- {
- if (*p == 'm')
- {
- string_appendn (&tname, "-", 1);
- p++;
- }
- while (isdigit (*p))
- {
- string_appendn (&tname, p, 1);
- p++;
- }
- if (*p == '.') /* fraction */
- {
- string_appendn (&tname, ".", 1);
- p++;
- while (isdigit (*p))
- {
- string_appendn (&tname, p, 1);
- p++;
- }
- }
- if (*p == 'e') /* exponent */
- {
- string_appendn (&tname, "e", 1);
- p++;
- while (isdigit (*p))
- {
- string_appendn (&tname, p, 1);
- p++;
- }
- }
- }
- else if (is_pointer)
- {
- int symbol_len;
-
- if (!get_count (&p, &symbol_len))
- {
- success = 0;
- break;
- }
- string_appendn (&tname, p, symbol_len);
- p += symbol_len;
- }
- }
- need_comma = 1;
- }
- string_append (&tname, ">::");
- if (destructor)
- string_append(&tname, "~");
- if (constructor || destructor) {
- string_append (&tname, trawname.b);
- }
- string_delete(&trawname);
-
- if (!success) {
- string_delete(&tname);
- return 0;
- }
- string_prepend (&decl, tname.b);
- string_delete(&tname);
-
- if (static_type)
- {
- string_append(&decl, p+1);
- p += strlen(p);
- success = 1;
- }
- else
- success = do_args (&p, &decl, arg_mode);
- break;
- }
- }
-
- for (i = 0; i < ntypes; i++)
- if (typevec[i] != NULL)
- free (typevec[i]);
- ntypes = 0;
- if (typevec != NULL)
- {
- free ((char *)typevec);
- typevec = NULL;
- typevec_size = 0;
- }
-
- if (success)
- {
- string_appendn (&decl, "", 1);
- return decl.b;
- }
- else
- {
- string_delete (&decl);
- return NULL;
- }
-}
-
-static int
-get_count (type, count)
- const char **type;
- int *count;
-{
- if (!isdigit (**type))
- return 0;
- *count = **type - '0';
- *type += 1;
- /* see flush_repeats in cplus-method.c */
- if (isdigit (**type))
- {
- const char *p = *type;
- int n = *count;
- do
- {
- n *= 10;
- n += *p - '0';
- p += 1;
- }
- while (isdigit (*p));
- if (*p == '_')
- {
- *type = p + 1;
- *count = n;
- }
- }
- return 1;
-}
-
-/* result will be initialised here; it will be freed on failure */
-
-static int
-do_type (type, result, arg_mode)
- const char **type;
- string *result;
- int arg_mode;
-{
- int n;
- int done;
- int non_empty = 0;
- int success;
- string decl;
- const char *remembered_type;
-
- string_init (&decl);
- string_init (result);
-
- done = 0;
- success = 1;
- while (success && !done)
- {
- int member;
- switch (**type)
- {
- case 'Q':
- n = (*type)[1] - '0';
- if (n < 0 || n > 9)
- success = 0;
- *type += 2;
- while (n-- > 0)
- do_type (type, result, arg_mode);
- break;
-
- case 'P':
- *type += 1;
- string_prepend (&decl, "*");
- break;
-
- case 'R':
- *type += 1;
- string_prepend (&decl, "&");
- break;
-
- case 'T':
- *type += 1;
- if (!get_count (type, &n) || n >= ntypes)
- success = 0;
- else
- {
- remembered_type = typevec[n];
- type = &remembered_type;
- }
- break;
-
- case 'F':
- *type += 1;
- if (!string_empty (&decl) && decl.b[0] == '*')
- {
- string_prepend (&decl, "(");
- string_append (&decl, ")");
- }
- if (!do_args (type, &decl, arg_mode) || **type != '_')
- success = 0;
- else
- *type += 1;
- break;
-
- case 'M':
- case 'O':
- {
- int constp = 0;
- int volatilep = 0;
-
- member = **type == 'M';
- *type += 1;
- if (!isdigit (**type))
- {
- success = 0;
- break;
- }
- n = 0;
- do
- {
- n *= 10;
- n += **type - '0';
- *type += 1;
- }
- while (isdigit (**type));
- if (strlen (*type) < n)
- {
- success = 0;
- break;
- }
- string_append (&decl, ")");
- string_prepend (&decl, "::");
- string_prependn (&decl, *type, n);
- string_prepend (&decl, "(");
- *type += n;
- if (member)
- {
- if (**type == 'C')
- {
- *type += 1;
- constp = 1;
- }
- if (**type == 'V')
- {
- *type += 1;
- volatilep = 1;
- }
- if (*(*type)++ != 'F')
- {
- success = 0;
- break;
- }
- }
- if ((member && !do_args (type, &decl, arg_mode)) || **type != '_')
- {
- success = 0;
- break;
- }
- *type += 1;
- if (! print_ansi_qualifiers)
- break;
- if (constp)
- {
- if (non_empty)
- string_append (&decl, " ");
- else
- non_empty = 1;
- string_append (&decl, "const");
- }
- if (volatilep)
- {
- if (non_empty)
- string_append (&decl, " ");
- else
- non_empty = 1;
- string_append (&decl, "volatile");
- }
- break;
- }
-
- case 'C':
- if ((*type)[1] == 'P')
- {
- *type += 1;
- if (print_ansi_qualifiers)
- {
- if (!string_empty (&decl))
- string_prepend (&decl, " ");
- string_prepend (&decl, "const");
- }
- break;
- }
-
- /* fall through */
- default:
- done = 1;
- break;
- }
- }
-
- done = 0;
- non_empty = 0;
- while (success && !done)
- {
- switch (**type)
- {
- case 'C':
- *type += 1;
- if (print_ansi_qualifiers)
- {
- if (non_empty)
- string_append (result, " ");
- else
- non_empty = 1;
- string_append (result, "const");
- }
- break;
- case 'U':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- else
- non_empty = 1;
- string_append (result, "unsigned");
- break;
- case 'V':
- *type += 1;
- if (print_ansi_qualifiers)
- {
- if (non_empty)
- string_append (result, " ");
- else
- non_empty = 1;
- string_append (result, "volatile");
- }
- break;
- default:
- done = 1;
- break;
- }
- }
-
- if (success)
- switch (**type)
- {
- case '\0':
- case '_':
- break;
- case 'v':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- string_append (result, "void");
- break;
- case 'x':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- string_append (result, "long long");
- break;
- case 'l':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- string_append (result, "long");
- break;
- case 'i':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- string_append (result, "int");
- break;
- case 's':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- string_append (result, "short");
- break;
- case 'c':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- string_append (result, "char");
- break;
- case 'r':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- string_append (result, "long double");
- break;
- case 'd':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- string_append (result, "double");
- break;
- case 'f':
- *type += 1;
- if (non_empty)
- string_append (result, " ");
- string_append (result, "float");
- break;
- case 'G':
- *type += 1;
- if (!isdigit (**type))
- {
- success = 0;
- break;
- }
- /* fall through */
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- n = 0;
- do
- {
- n *= 10;
- n += **type - '0';
- *type += 1;
- }
- while (isdigit (**type));
- if (strlen (*type) < n)
- {
- success = 0;
- break;
- }
- if (non_empty)
- string_append (result, " ");
- string_appendn (result, *type, n);
- *type += n;
- break;
- default:
- success = 0;
- break;
- }
-
- if (success)
- {
- if (!string_empty (&decl))
- {
- string_append (result, " ");
- string_appends (result, &decl);
- }
- string_delete (&decl);
- return 1;
- }
- else
- {
- string_delete (&decl);
- string_delete (result);
- return 0;
- }
-}
-
-/* `result' will be initialised in do_type; it will be freed on failure */
-
-static int
-do_arg (type, result, arg_mode)
- const char **type;
- string *result;
- int arg_mode;
-{
- const char *start = *type;
-
- if (!do_type (type, result, arg_mode))
- return 0;
- remember_type (start, *type - start);
- return 1;
-}
-
-static void
-remember_type (start, len)
- const char *start;
- int len;
-{
- char *tem;
-
- if (ntypes >= typevec_size)
- {
- if (typevec_size == 0)
- {
- typevec_size = 3;
- typevec = (char **) xmalloc (sizeof (char*)*typevec_size);
- }
- else
- {
- typevec_size *= 2;
- typevec = (char **) xrealloc ((char *)typevec, sizeof (char*)*typevec_size);
- }
- }
- tem = (char *) xmalloc (len + 1);
- memcpy (tem, start, len);
- tem[len] = '\0';
- typevec[ntypes++] = tem;
-}
-
-/* `decl' must be already initialised, usually non-empty;
- it won't be freed on failure */
-
-static int
-do_args (type, decl, arg_mode)
- const char **type;
- string *decl;
- int arg_mode;
-{
- string arg;
- int need_comma = 0;
-
- if (print_arg_types)
- string_append (decl, "(");
-
- while (**type != '_' && **type != '\0' && **type != 'e' && **type != 'v')
- {
- if (**type == 'N')
- {
- int r;
- int t;
- *type += 1;
- if (!get_count (type, &r) || !get_count (type, &t) || t >= ntypes)
- return 0;
- while (--r >= 0)
- {
- const char *tem = typevec[t];
- if (need_comma && print_arg_types)
- string_append (decl, ", ");
- if (!do_arg (&tem, &arg, arg_mode))
- return 0;
- if (print_arg_types)
- string_appends (decl, &arg);
- string_delete (&arg);
- need_comma = 1;
- }
- }
- else
- {
- if (need_comma & print_arg_types)
- string_append (decl, ", ");
- if (!do_arg (type, &arg, arg_mode))
- return 0;
- if (print_arg_types)
- string_appends (decl, &arg);
- string_delete (&arg);
- need_comma = 1;
- }
- }
-
- if (**type == 'v')
- *type += 1;
- else if (**type == 'e')
- {
- *type += 1;
- if (print_arg_types)
- {
- if (need_comma)
- string_append (decl, ",");
- string_append (decl, "...");
- }
- }
-
- if (print_arg_types)
- string_append (decl, ")");
- return 1;
-}
-
-static void
-munge_function_name (name, arg_mode)
- string *name;
- int arg_mode;
-{
- if (string_empty (name))
- return;
-
- if (name->p - name->b >= 3
- && name->b[0] == 'o' && name->b[1] == 'p' && name->b[2] == CPLUS_MARKER)
- {
- int i;
- /* see if it's an assignment expression */
- if (name->p - name->b >= 10 /* op$assign_ */
- && memcmp (name->b + 3, "assign_", 7) == 0)
- {
- for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++)
- {
- int len = name->p - name->b - 10;
- if (strlen (optable[i].in) == len
- && memcmp (optable[i].in, name->b + 10, len) == 0)
- {
- string_clear (name);
- string_append (name, "operator");
- string_append (name, optable[i].out);
- string_append (name, "=");
- return;
- }
- }
- }
- else
- {
- for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++)
- {
- int len = name->p - name->b - 3;
- if (strlen (optable[i].in) == len
- && memcmp (optable[i].in, name->b + 3, len) == 0)
- {
- string_clear (name);
- string_append (name, "operator");
- string_append (name, optable[i].out);
- return;
- }
- }
- }
- return;
- }
- else if (name->p - name->b >= 5 && memcmp (name->b, "type$", 5) == 0)
- {
- /* type conversion operator */
- string type;
- const char *tem = name->b + 5;
- if (do_type (&tem, &type, arg_mode))
- {
- string_clear (name);
- string_append (name, "operator ");
- string_appends (name, &type);
- string_delete (&type);
- return;
- }
- }
- /* ANSI. */
- else if (name->b[2] == 'o' && name->b[3] == 'p')
- {
- /* type conversion operator. */
- string type;
- const char *tem = name->b + 4;
- if (do_type (&tem, &type, arg_mode))
- {
- string_clear (name);
- string_append (name, "operator ");
- string_appends (name, &type);
- string_delete (&type);
- return;
- }
- }
- else if (name->b[0] == '_' && name->b[1] == '_'
- && name->b[2] >= 'a' && name->b[2] <= 'z'
- && name->b[3] >= 'a' && name->b[3] <= 'z')
- {
- int i;
-
- if (name->b[4] == '\0')
- {
- /* Operator. */
- for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 2
- && memcmp (optable[i].in, name->b + 2, 2) == 0)
- {
- string_clear (name);
- string_append (name, "operator");
- string_append (name, optable[i].out);
- return;
- }
- }
- }
- else
- {
- if (name->b[2] != 'a' || name->b[5] != '\0')
- return;
- /* Assignment. */
- for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++)
- {
- if (strlen (optable[i].in) == 3
- && memcmp (optable[i].in, name->b + 2, 3) == 0)
- {
- string_clear (name);
- string_append (name, "operator");
- string_append (name, optable[i].out);
- return;
- }
- }
- }
- }
-}
-
-/* a mini string-handling package */
-
-static void
-string_need (s, n)
- string *s;
- int n;
-{
- if (s->b == NULL)
- {
- if (n < 32)
- n = 32;
- s->p = s->b = (char *) xmalloc (n);
- s->e = s->b + n;
- }
- else if (s->e - s->p < n)
- {
- int tem = s->p - s->b;
- n += tem;
- n *= 2;
- s->b = (char *) xrealloc (s->b, n);
- s->p = s->b + tem;
- s->e = s->b + n;
- }
-}
-
-static void
-string_delete (s)
- string *s;
-{
- if (s->b != NULL)
- {
- free (s->b);
- s->b = s->e = s->p = NULL;
- }
-}
-
-static void
-string_init (s)
- string *s;
-{
- s->b = s->p = s->e = NULL;
-}
-
-static void
-string_clear (s)
- string *s;
-{
- s->p = s->b;
-}
-
-static int
-string_empty (s)
- string *s;
-{
- return s->b == s->p;
-}
-
-static void
-string_append (p, s)
- string *p;
- const char *s;
-{
- int n;
- if (s == NULL || *s == '\0')
- return;
- n = strlen (s);
- string_need (p, n);
- memcpy (p->p, s, n);
- p->p += n;
-}
-
-static void
-string_appends (p, s)
- string *p, *s;
-{
- int n;
- if (s->b == s->p)
- return;
- n = s->p - s->b;
- string_need (p, n);
- memcpy (p->p, s->b, n);
- p->p += n;
-}
-
-static void
-string_appendn (p, s, n)
- string *p;
- const char *s;
- int n;
-{
- if (n == 0)
- return;
- string_need (p, n);
- memcpy (p->p, s, n);
- p->p += n;
-}
-
-static void
-string_prepend (p, s)
- string *p;
- const char *s;
-{
- if (s == NULL || *s == '\0')
- return;
- string_prependn (p, s, strlen (s));
-}
-
-#if 0
-static void
-string_prepends (p, s)
- string *p, *s;
-{
- if (s->b == s->p)
- return;
- string_prependn (p, s->b, s->p - s->b);
-}
-#endif
-
-static void
-string_prependn (p, s, n)
- string *p;
- const char *s;
- int n;
-{
- char *q;
-
- if (n == 0)
- return;
- string_need (p, n);
- for (q = p->p - 1; q >= p->b; q--)
- q[n] = q[0];
- memcpy (p->b, s, n);
- p->p += n;
-}
diff --git a/gdb/createtags b/gdb/createtags
deleted file mode 100755
index 6f02ff2..0000000
--- a/gdb/createtags
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-#
-# Here we check to see if we are compiling in a directory that contains
-# symlinks to the source files instead of the actual files. If this is so,
-# we setup the TAGS entries to point to the actual source directory.
-#
-filelist=""
-if test "`find main.c -type l -print `" != "" ; then
- prefix=`ls -l main.c | awk '{print $11}' | sed 's;main.c$;;'`
-else
- prefix=""
-fi
-
-# Replace .o at end of filename with .c
-for i in $@ ; do
- file=`echo $i-x- | sed -e 's/\.o-x-/\.c-x-/' | sed -e 's/-x-//'`
- filelist="$filelist $prefix$file"
-done
-
-etags $filelist
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
deleted file mode 100644
index c7741ab..0000000
--- a/gdb/dbxread.c
+++ /dev/null
@@ -1,2847 +0,0 @@
-/* Read dbx symbol tables and convert to internal format, for GDB.
- Copyright (C) 1986-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This module provides three functions: dbx_symfile_init,
- which initializes to read a symbol file; dbx_new_init, which
- discards existing cached information when all symbols are being
- discarded; and dbx_symfile_read, which reads a symbol table
- from a file.
-
- dbx_symfile_read only does the minimum work necessary for letting the
- user "name" things symbolically; it does not read the entire symtab.
- Instead, it reads the external and static symbols and puts them in partial
- symbol tables. When more extensive information is requested of a
- file, the corresponding partial symbol table is mutated into a full
- fledged symbol table by going back and reading the symbols
- for real. dbx_psymtab_to_symtab() is the function that does this */
-
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "param.h"
-
-#ifdef USG
-#include <sys/types.h>
-#include <fcntl.h>
-#define L_SET 0
-#define L_INCR 1
-#endif
-
-#include <obstack.h>
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include "symtab.h"
-#include "breakpoint.h"
-#include "command.h"
-#include "target.h"
-#include "gdbcore.h" /* for bfd stuff */
-#include "libaout.h" /* FIXME Secret internal BFD stuff for a.out */
-#include "symfile.h"
-#include "buildsym.h"
-
-#include "aout64.h"
-#include "stab.gnu.h" /* We always use GNU stabs, not native, now */
-
-/* Information is passed among various dbxread routines for accessing
- symbol files. A pointer to this structure is kept in the sym_private
- field of the struct sym_fns passed in by symfile.h. */
-
-struct dbx_symfile_info {
- asection *text_sect; /* Text section accessor */
- int symcount; /* How many symbols are there in the file */
- char *stringtab; /* The actual string table */
- int stringtab_size; /* Its size */
- off_t symtab_offset; /* Offset in file to symbol table */
- int desc; /* File descriptor of symbol file */
-};
-
-
-/* Each partial symbol table entry contains a pointer to private data for the
- read_symtab() function to use when expanding a partial symbol table entry
- to a full symbol table entry.
-
- For dbxread this structure contains the offset within the file symbol table
- of first local symbol for this file, and length (in bytes) of the section
- of the symbol table devoted to this file's symbols (actually, the section
- bracketed may contain more than just this file's symbols). If ldsymlen is
- 0, the only reason for this thing's existence is the dependency list.
- Nothing else will happen when it is read in. */
-
-#define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
-#define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
-
-struct symloc {
- int ldsymoff;
- int ldsymlen;
-};
-
-extern void qsort ();
-extern double atof ();
-
-/* Forward declarations */
-
-static void read_dbx_symtab ();
-static void init_psymbol_list ();
-static void process_one_symbol ();
-static struct symbol *define_symbol ();
-void start_subfile ();
-int hashname ();
-static struct pending *copy_pending ();
-static struct symtab *read_ofile_symtab ();
-static void dbx_psymtab_to_symtab ();
-
-static const char vptr_name[] = { '_','v','p','t','r',CPLUS_MARKER,'\0' };
-static const char vb_name[] = { '_','v','b',CPLUS_MARKER,'\0' };
-
-/* Macro to determine which symbols to ignore when reading the first symbol
- of a file. Some machines override this definition. */
-#ifndef IGNORE_SYMBOL
-/* This code is used on Ultrix systems. Ignore it */
-#define IGNORE_SYMBOL(type) (type == (int)N_NSYMS)
-#endif
-
-/* Macro for name of symbol to indicate a file compiled with gcc. */
-#ifndef GCC_COMPILED_FLAG_SYMBOL
-#define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled."
-#endif
-
-/* Define this as 1 if a pcc declaration of a char or short argument
- gives the correct address. Otherwise assume pcc gives the
- address of the corresponding int, which is not the same on a
- big-endian machine. */
-
-#ifndef BELIEVE_PCC_PROMOTION
-#define BELIEVE_PCC_PROMOTION 0
-#endif
-
-/* Nonzero means give verbose info on gdb action. From main.c. */
-extern int info_verbose;
-
-/* The BFD for this file -- only good while we're actively reading
- symbols into a psymtab or a symtab. */
-
-static bfd *symfile_bfd;
-
-/* String table for the main symbol file. It is kept in memory
- permanently, to speed up symbol reading. Other files' symbol tables
- are read in on demand. FIXME, this should be cleaner. */
-
-static char *symfile_string_table;
-static int symfile_string_table_size;
-
-/* The size of each symbol in the symbol file (in external form).
- This is set by dbx_symfile_read when building psymtabs, and by
- dbx_psymtab_to_symtab when building symtabs. */
-
-static unsigned symbol_size;
-
-/* Complaints about the symbols we have encountered. */
-
-struct complaint lbrac_complaint =
- {"bad block start address patched", 0, 0};
-
-struct complaint string_table_offset_complaint =
- {"bad string table offset in symbol %d", 0, 0};
-
-struct complaint unknown_symtype_complaint =
- {"unknown symbol type %s", 0, 0};
-
-struct complaint lbrac_rbrac_complaint =
- {"block start larger than block end", 0, 0};
-
-/* During initial symbol readin, we need to have a structure to keep
- track of which psymtabs have which bincls in them. This structure
- is used during readin to setup the list of dependencies within each
- partial symbol table. */
-
-struct header_file_location
-{
- char *name; /* Name of header file */
- int instance; /* See above */
- struct partial_symtab *pst; /* Partial symtab that has the
- BINCL/EINCL defs for this file */
-};
-
-/* The actual list and controling variables */
-static struct header_file_location *bincl_list, *next_bincl;
-static int bincls_allocated;
-
-/* When a header file is getting special overriding definitions
- for one source file, record here the header_files index
- of its normal definition vector.
- At other times, this is -1. */
-
-static int header_file_prev_index;
-
-/* Free up old header file tables, and allocate new ones.
- We're reading a new symbol file now. */
-
-void
-free_and_init_header_files ()
-{
- register int i;
- for (i = 0; i < n_header_files; i++)
- free (header_files[i].name);
- if (header_files) /* First time null */
- free (header_files);
- if (this_object_header_files) /* First time null */
- free (this_object_header_files);
-
- n_allocated_header_files = 10;
- header_files = (struct header_file *) xmalloc (10 * sizeof (struct header_file));
- n_header_files = 0;
-
- n_allocated_this_object_header_files = 10;
- this_object_header_files = (int *) xmalloc (10 * sizeof (int));
-}
-
-/* Called at the start of each object file's symbols.
- Clear out the mapping of header file numbers to header files. */
-
-void
-new_object_header_files ()
-{
- /* Leave FILENUM of 0 free for builtin types and this file's types. */
- n_this_object_header_files = 1;
- header_file_prev_index = -1;
-}
-
-/* Add header file number I for this object file
- at the next successive FILENUM. */
-
-static void
-add_this_object_header_file (i)
- int i;
-{
- if (n_this_object_header_files == n_allocated_this_object_header_files)
- {
- n_allocated_this_object_header_files *= 2;
- this_object_header_files
- = (int *) xrealloc (this_object_header_files,
- n_allocated_this_object_header_files * sizeof (int));
- }
-
- this_object_header_files[n_this_object_header_files++] = i;
-}
-
-/* Add to this file an "old" header file, one already seen in
- a previous object file. NAME is the header file's name.
- INSTANCE is its instance code, to select among multiple
- symbol tables for the same header file. */
-
-static void
-add_old_header_file (name, instance)
- char *name;
- int instance;
-{
- register struct header_file *p = header_files;
- register int i;
-
- for (i = 0; i < n_header_files; i++)
- if (!strcmp (p[i].name, name) && instance == p[i].instance)
- {
- add_this_object_header_file (i);
- return;
- }
- error ("Invalid symbol data: \"repeated\" header file that hasn't been seen before, at symtab pos %d.",
- symnum);
-}
-
-/* Add to this file a "new" header file: definitions for its types follow.
- NAME is the header file's name.
- Most often this happens only once for each distinct header file,
- but not necessarily. If it happens more than once, INSTANCE has
- a different value each time, and references to the header file
- use INSTANCE values to select among them.
-
- dbx output contains "begin" and "end" markers for each new header file,
- but at this level we just need to know which files there have been;
- so we record the file when its "begin" is seen and ignore the "end". */
-
-static void
-add_new_header_file (name, instance)
- char *name;
- int instance;
-{
- register int i;
- header_file_prev_index = -1;
-
- /* Make sure there is room for one more header file. */
-
- if (n_header_files == n_allocated_header_files)
- {
- n_allocated_header_files *= 2;
- header_files = (struct header_file *)
- xrealloc (header_files,
- (n_allocated_header_files
- * sizeof (struct header_file)));
- }
-
- /* Create an entry for this header file. */
-
- i = n_header_files++;
- header_files[i].name = savestring (name, strlen(name));
- header_files[i].instance = instance;
- header_files[i].length = 10;
- header_files[i].vector
- = (struct type **) xmalloc (10 * sizeof (struct type *));
- bzero (header_files[i].vector, 10 * sizeof (struct type *));
-
- add_this_object_header_file (i);
-}
-
-#if 0
-static struct type **
-explicit_lookup_type (real_filenum, index)
- int real_filenum, index;
-{
- register struct header_file *f = &header_files[real_filenum];
-
- if (index >= f->length)
- {
- f->length *= 2;
- f->vector = (struct type **)
- xrealloc (f->vector, f->length * sizeof (struct type *));
- bzero (&f->vector[f->length / 2],
- f->length * sizeof (struct type *) / 2);
- }
- return &f->vector[index];
-}
-#endif
-
-/* Handle the N_BINCL and N_EINCL symbol types
- that act like N_SOL for switching source files
- (different subfiles, as we call them) within one object file,
- but using a stack rather than in an arbitrary order. */
-
-struct subfile_stack
-{
- struct subfile_stack *next;
- char *name;
- int prev_index;
-};
-
-struct subfile_stack *subfile_stack;
-
-static void
-push_subfile ()
-{
- register struct subfile_stack *tem
- = (struct subfile_stack *) xmalloc (sizeof (struct subfile_stack));
-
- tem->next = subfile_stack;
- subfile_stack = tem;
- if (current_subfile == 0 || current_subfile->name == 0)
- abort ();
- tem->name = current_subfile->name;
- tem->prev_index = header_file_prev_index;
-}
-
-static char *
-pop_subfile ()
-{
- register char *name;
- register struct subfile_stack *link = subfile_stack;
-
- if (link == 0)
- abort ();
-
- name = link->name;
- subfile_stack = link->next;
- header_file_prev_index = link->prev_index;
- free (link);
-
- return name;
-}
-
-static void
-record_misc_function (name, address, type)
- char *name;
- CORE_ADDR address;
- int type;
-{
- enum misc_function_type misc_type;
-
- switch (type &~ N_EXT) {
- case N_TEXT: misc_type = mf_text; break;
- case N_DATA: misc_type = mf_data; break;
- case N_BSS: misc_type = mf_bss; break;
- case N_ABS: misc_type = mf_abs; break;
-#ifdef N_SETV
- case N_SETV: misc_type = mf_data; break;
-#endif
- default: misc_type = mf_unknown; break;
- }
-
- prim_record_misc_function (obsavestring (name, strlen (name)),
- address, misc_type);
-}
-
-/* Scan and build partial symbols for a symbol file.
- We have been initialized by a call to dbx_symfile_init, which
- put all the relevant info into a "struct dbx_symfile_info"
- hung off the struct sym_fns SF.
-
- ADDR is the address relative to which the symbols in it are (e.g.
- the base address of the text segment).
- MAINLINE is true if we are reading the main symbol
- table (as opposed to a shared lib or dynamically loaded file). */
-
-static void
-dbx_symfile_read (sf, addr, mainline)
- struct sym_fns *sf;
- CORE_ADDR addr;
- int mainline; /* FIXME comments above */
-{
- struct dbx_symfile_info *info = (struct dbx_symfile_info *) (sf->sym_private);
- bfd *sym_bfd = sf->sym_bfd;
- int val;
- char *filename = bfd_get_filename (sym_bfd);
-
- val = lseek (info->desc, info->symtab_offset, L_SET);
- if (val < 0)
- perror_with_name (filename);
-
- /* If mainline, set global string table pointers, and reinitialize global
- partial symbol list. */
- if (mainline) {
- symfile_string_table = info->stringtab;
- symfile_string_table_size = info->stringtab_size;
- }
-
- /* If we are reinitializing, or if we have never loaded syms yet, init */
- if (mainline || global_psymbols.size == 0 || static_psymbols.size == 0)
- init_psymbol_list (info->symcount);
-
- symfile_bfd = sym_bfd; /* Kludge for SWAP_SYMBOL */
-
- /* FIXME POKING INSIDE BFD DATA STRUCTURES */
- symbol_size = obj_symbol_entry_size (sym_bfd);
-
- pending_blocks = 0;
- make_cleanup (really_free_pendings, 0);
-
- init_misc_bunches ();
- make_cleanup (discard_misc_bunches, 0);
-
- /* Now that the symbol table data of the executable file are all in core,
- process them and define symbols accordingly. */
-
- read_dbx_symtab (filename,
- addr - bfd_section_vma (sym_bfd, info->text_sect), /*offset*/
- info->desc, info->stringtab, info->stringtab_size,
- info->symcount,
- bfd_section_vma (sym_bfd, info->text_sect),
- bfd_section_size (sym_bfd, info->text_sect));
-
- /* Go over the misc symbol bunches and install them in vector. */
-
- condense_misc_bunches (!mainline);
-
- /* Free up any memory we allocated for ourselves. */
-
- if (!mainline) {
- free (info->stringtab); /* Stringtab is only saved for mainline */
- }
- free (info);
- sf->sym_private = 0; /* Zap pointer to our (now gone) info struct */
-
- if (!partial_symtab_list) {
- wrap_here ("");
- printf_filtered ("(no debugging symbols found)...");
- wrap_here ("");
- }
-}
-
-/* Initialize anything that needs initializing when a completely new
- symbol file is specified (not just adding some symbols from another
- file, e.g. a shared library). */
-
-static void
-dbx_new_init ()
-{
- buildsym_new_init ();
-
- /* Don't put these on the cleanup chain; they need to stick around
- until the next call to dbx_new_init. *Then* we'll free them. */
- if (symfile_string_table)
- {
- free (symfile_string_table);
- symfile_string_table = 0;
- symfile_string_table_size = 0;
- }
- free_and_init_header_files ();
-}
-
-
-/* dbx_symfile_init ()
- is the dbx-specific initialization routine for reading symbols.
- It is passed a struct sym_fns which contains, among other things,
- the BFD for the file whose symbols are being read, and a slot for a pointer
- to "private data" which we fill with goodies.
-
- We read the string table into malloc'd space and stash a pointer to it.
-
- Since BFD doesn't know how to read debug symbols in a format-independent
- way (and may never do so...), we have to do it ourselves. We will never
- be called unless this is an a.out (or very similar) file.
- FIXME, there should be a cleaner peephole into the BFD environment here. */
-
-static void
-dbx_symfile_init (sf)
- struct sym_fns *sf;
-{
- int val;
- int desc;
- struct stat statbuf;
- bfd *sym_bfd = sf->sym_bfd;
- char *name = bfd_get_filename (sym_bfd);
- struct dbx_symfile_info *info;
- unsigned char size_temp[4];
-
- /* Allocate struct to keep track of the symfile */
- sf->sym_private = xmalloc (sizeof (*info));
- info = (struct dbx_symfile_info *)sf->sym_private;
-
- /* FIXME POKING INSIDE BFD DATA STRUCTURES */
- desc = fileno ((FILE *)(sym_bfd->iostream)); /* Raw file descriptor */
-#define STRING_TABLE_OFFSET (sym_bfd->origin + obj_str_filepos (sym_bfd))
-#define SYMBOL_TABLE_OFFSET (sym_bfd->origin + obj_sym_filepos (sym_bfd))
- /* FIXME POKING INSIDE BFD DATA STRUCTURES */
-
- info->desc = desc;
- info->text_sect = bfd_get_section_by_name (sym_bfd, ".text");
- if (!info->text_sect)
- abort();
- info->symcount = bfd_get_symcount (sym_bfd);
-
- /* Read the string table size and check it for bogosity. */
- val = lseek (desc, STRING_TABLE_OFFSET, L_SET);
- if (val < 0)
- perror_with_name (name);
- if (fstat (desc, &statbuf) == -1)
- perror_with_name (name);
-
- val = myread (desc, size_temp, sizeof (long));
- if (val < 0)
- perror_with_name (name);
- info->stringtab_size = bfd_h_get_32 (sym_bfd, size_temp);
-
- if (info->stringtab_size >= 0 && info->stringtab_size < statbuf.st_size)
- {
- info->stringtab = (char *) xmalloc (info->stringtab_size);
- /* Caller is responsible for freeing the string table. No cleanup. */
- }
- else
- info->stringtab = NULL;
- if (info->stringtab == NULL && info->stringtab_size != 0)
- error ("ridiculous string table size: %d bytes", info->stringtab_size);
-
- /* Now read in the string table in one big gulp. */
-
- val = lseek (desc, STRING_TABLE_OFFSET, L_SET);
- if (val < 0)
- perror_with_name (name);
- val = myread (desc, info->stringtab, info->stringtab_size);
- if (val < 0)
- perror_with_name (name);
-
- /* Record the position of the symbol table for later use. */
-
- info->symtab_offset = SYMBOL_TABLE_OFFSET;
-}
-
-/* Buffer for reading the symbol table entries. */
-static struct internal_nlist symbuf[4096];
-static int symbuf_idx;
-static int symbuf_end;
-
-/* I/O descriptor for reading the symbol table. */
-static int symtab_input_desc;
-
-/* The address in memory of the string table of the object file we are
- reading (which might not be the "main" object file, but might be a
- shared library or some other dynamically loaded thing). This is set
- by read_dbx_symtab when building psymtabs, and by read_ofile_symtab
- when building symtabs, and is used only by next_symbol_text. */
-static char *stringtab_global;
-
-/* Refill the symbol table input buffer
- and set the variables that control fetching entries from it.
- Reports an error if no data available.
- This function can read past the end of the symbol table
- (into the string table) but this does no harm. */
-
-static int
-fill_symbuf ()
-{
- int nbytes = myread (symtab_input_desc, symbuf, sizeof (symbuf));
- if (nbytes < 0)
- perror_with_name ("<symbol file>");
- else if (nbytes == 0)
- error ("Premature end of file reading symbol table");
- symbuf_end = nbytes / symbol_size;
- symbuf_idx = 0;
- return 1;
-}
-
-#define SWAP_SYMBOL(symp) \
- { \
- (symp)->n_strx = bfd_h_get_32(symfile_bfd, \
- (unsigned char *)&(symp)->n_strx); \
- (symp)->n_desc = bfd_h_get_16 (symfile_bfd, \
- (unsigned char *)&(symp)->n_desc); \
- (symp)->n_value = bfd_h_get_32 (symfile_bfd, \
- (unsigned char *)&(symp)->n_value); \
- }
-
-/* Invariant: The symbol pointed to by symbuf_idx is the first one
- that hasn't been swapped. Swap the symbol at the same time
- that symbuf_idx is incremented. */
-
-/* dbx allows the text of a symbol name to be continued into the
- next symbol name! When such a continuation is encountered
- (a \ at the end of the text of a name)
- call this function to get the continuation. */
-
-char *
-next_symbol_text ()
-{
- if (symbuf_idx == symbuf_end)
- fill_symbuf ();
- symnum++;
- SWAP_SYMBOL(&symbuf[symbuf_idx]);
- return symbuf[symbuf_idx++].n_strx + stringtab_global;
-}
-
-/* Initializes storage for all of the partial symbols that will be
- created by read_dbx_symtab and subsidiaries. */
-
-static void
-init_psymbol_list (total_symbols)
- int total_symbols;
-{
- /* Free any previously allocated psymbol lists. */
- if (global_psymbols.list)
- free (global_psymbols.list);
- if (static_psymbols.list)
- free (static_psymbols.list);
-
- /* Current best guess is that there are approximately a twentieth
- of the total symbols (in a debugging file) are global or static
- oriented symbols */
- global_psymbols.size = total_symbols / 10;
- static_psymbols.size = total_symbols / 10;
- global_psymbols.next = global_psymbols.list = (struct partial_symbol *)
- xmalloc (global_psymbols.size * sizeof (struct partial_symbol));
- static_psymbols.next = static_psymbols.list = (struct partial_symbol *)
- xmalloc (static_psymbols.size * sizeof (struct partial_symbol));
-}
-
-/* Initialize the list of bincls to contain none and have some
- allocated. */
-
-static void
-init_bincl_list (number)
- int number;
-{
- bincls_allocated = number;
- next_bincl = bincl_list = (struct header_file_location *)
- xmalloc (bincls_allocated * sizeof(struct header_file_location));
-}
-
-/* Add a bincl to the list. */
-
-static void
-add_bincl_to_list (pst, name, instance)
- struct partial_symtab *pst;
- char *name;
- int instance;
-{
- if (next_bincl >= bincl_list + bincls_allocated)
- {
- int offset = next_bincl - bincl_list;
- bincls_allocated *= 2;
- bincl_list = (struct header_file_location *)
- xrealloc ((char *)bincl_list,
- bincls_allocated * sizeof (struct header_file_location));
- next_bincl = bincl_list + offset;
- }
- next_bincl->pst = pst;
- next_bincl->instance = instance;
- next_bincl++->name = name;
-}
-
-/* Given a name, value pair, find the corresponding
- bincl in the list. Return the partial symtab associated
- with that header_file_location. */
-
-static struct partial_symtab *
-find_corresponding_bincl_psymtab (name, instance)
- char *name;
- int instance;
-{
- struct header_file_location *bincl;
-
- for (bincl = bincl_list; bincl < next_bincl; bincl++)
- if (bincl->instance == instance
- && !strcmp (name, bincl->name))
- return bincl->pst;
-
- return (struct partial_symtab *) 0;
-}
-
-/* Free the storage allocated for the bincl list. */
-
-static void
-free_bincl_list ()
-{
- free (bincl_list);
- bincls_allocated = 0;
-}
-
-static struct partial_symtab *start_psymtab ();
-static void end_psymtab();
-
-#ifdef DEBUG
-/* This is normally a macro defined in read_dbx_symtab, but this
- is a lot easier to debug. */
-
-ADD_PSYMBOL_TO_PLIST(NAME, NAMELENGTH, NAMESPACE, CLASS, PLIST, VALUE)
- char *NAME;
- int NAMELENGTH;
- enum namespace NAMESPACE;
- enum address_class CLASS;
- struct psymbol_allocation_list *PLIST;
- unsigned long VALUE;
-{
- register struct partial_symbol *psym;
-
-#define LIST *PLIST
- do {
- if ((LIST).next >=
- (LIST).list + (LIST).size)
- {
- (LIST).list = (struct partial_symbol *)
- xrealloc ((LIST).list,
- ((LIST).size * 2
- * sizeof (struct partial_symbol)));
- /* Next assumes we only went one over. Should be good if
- program works correctly */
- (LIST).next =
- (LIST).list + (LIST).size;
- (LIST).size *= 2;
- }
- psym = (LIST).next++;
-#undef LIST
-
- SYMBOL_NAME (psym) = (char *) obstack_alloc (psymbol_obstack,
- (NAMELENGTH) + 1);
- strncpy (SYMBOL_NAME (psym), (NAME), (NAMELENGTH));
- SYMBOL_NAME (psym)[(NAMELENGTH)] = '\0';
- SYMBOL_NAMESPACE (psym) = (NAMESPACE);
- SYMBOL_CLASS (psym) = (CLASS);
- SYMBOL_VALUE (psym) = (VALUE);
- } while (0);
-}
-
-/* Since one arg is a struct, we have to pass in a ptr and deref it (sigh) */
-#define ADD_PSYMBOL_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE) \
- ADD_PSYMBOL_TO_PLIST(NAME, NAMELENGTH, NAMESPACE, CLASS, &LIST, VALUE)
-
-#endif /* DEBUG */
-
-/* Given pointers to an a.out symbol table in core containing dbx
- style data, setup partial_symtab's describing each source file for
- which debugging information is available. NLISTLEN is the number
- of symbols in the symbol table. All symbol names are given as
- offsets relative to STRINGTAB. STRINGTAB_SIZE is the size of
- STRINGTAB. SYMFILE_NAME is the name of the file we are reading from
- and ADDR is its relocated address (if incremental) or 0 (if not). */
-
-static void
-read_dbx_symtab (symfile_name, addr,
- desc, stringtab, stringtab_size, nlistlen,
- text_addr, text_size)
- char *symfile_name;
- CORE_ADDR addr;
- int desc;
- register char *stringtab;
- register long stringtab_size;
- register int nlistlen;
- CORE_ADDR text_addr;
- int text_size;
-{
- register struct internal_nlist *bufp;
- register char *namestring;
- register struct partial_symbol *psym;
- int nsl;
- int past_first_source_file = 0;
- CORE_ADDR last_o_file_start = 0;
- struct cleanup *old_chain;
- char *p;
-
- /* End of the text segment of the executable file. */
- CORE_ADDR end_of_text_addr;
-
- /* Current partial symtab */
- struct partial_symtab *pst;
-
- /* List of current psymtab's include files */
- char **psymtab_include_list;
- int includes_allocated;
- int includes_used;
-
- /* Index within current psymtab dependency list */
- struct partial_symtab **dependency_list;
- int dependencies_used, dependencies_allocated;
-
- stringtab_global = stringtab;
-
- pst = (struct partial_symtab *) 0;
-
- includes_allocated = 30;
- includes_used = 0;
- psymtab_include_list = (char **) alloca (includes_allocated *
- sizeof (char *));
-
- dependencies_allocated = 30;
- dependencies_used = 0;
- dependency_list =
- (struct partial_symtab **) alloca (dependencies_allocated *
- sizeof (struct partial_symtab *));
-
- /* FIXME!! If an error occurs, this blows away the whole symbol table!
- It should only blow away the psymtabs created herein. We could
- be reading a shared library or a dynloaded file! */
- old_chain = make_cleanup (free_all_psymtabs, 0);
-
- /* Init bincl list */
- init_bincl_list (20);
- make_cleanup (free_bincl_list, 0);
-
- last_source_file = 0;
-
-#ifdef END_OF_TEXT_DEFAULT
- end_of_text_addr = END_OF_TEXT_DEFAULT;
-#else
- end_of_text_addr = text_addr + addr + text_size; /* Relocate */
-#endif
-
- symtab_input_desc = desc; /* This is needed for fill_symbuf below */
- symbuf_end = symbuf_idx = 0;
-
- for (symnum = 0; symnum < nlistlen; symnum++)
- {
- /* Get the symbol for this run and pull out some info */
- QUIT; /* allow this to be interruptable */
- if (symbuf_idx == symbuf_end)
- fill_symbuf ();
- bufp = &symbuf[symbuf_idx++];
-
- /*
- * Special case to speed up readin.
- */
- if (bufp->n_type == (unsigned char)N_SLINE) continue;
-
- SWAP_SYMBOL (bufp);
-
- /* Ok. There is a lot of code duplicated in the rest of this
- switch statement (for efficiency reasons). Since I don't
- like duplicating code, I will do my penance here, and
- describe the code which is duplicated:
-
- *) The assignment to namestring.
- *) The call to strchr.
- *) The addition of a partial symbol the the two partial
- symbol lists. This last is a large section of code, so
- I've imbedded it in the following macro.
- */
-
-/* Set namestring based on bufp. If the string table index is invalid,
- give a fake name, and print a single error message per symbol file read,
- rather than abort the symbol reading or flood the user with messages. */
-#define SET_NAMESTRING()\
- if (bufp->n_strx < 0 || bufp->n_strx >= stringtab_size) { \
- complain (&string_table_offset_complaint, symnum); \
- namestring = "foo"; \
- } else \
- namestring = bufp->n_strx + stringtab
-
-/* Add a symbol with an integer value to a psymtab. */
-/* This is a macro unless we're debugging. See above this function. */
-#ifndef DEBUG
-# define ADD_PSYMBOL_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE) \
- ADD_PSYMBOL_VT_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE, \
- SYMBOL_VALUE)
-#endif /* DEBUG */
-
-/* Add a symbol with a CORE_ADDR value to a psymtab. */
-#define ADD_PSYMBOL_ADDR_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE) \
- ADD_PSYMBOL_VT_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE, \
- SYMBOL_VALUE_ADDRESS)
-
-/* Add any kind of symbol to a psymtab. */
-#define ADD_PSYMBOL_VT_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE, VT)\
- do { \
- if ((LIST).next >= \
- (LIST).list + (LIST).size) \
- { \
- (LIST).list = (struct partial_symbol *) \
- xrealloc ((LIST).list, \
- ((LIST).size * 2 \
- * sizeof (struct partial_symbol))); \
- /* Next assumes we only went one over. Should be good if \
- program works correctly */ \
- (LIST).next = \
- (LIST).list + (LIST).size; \
- (LIST).size *= 2; \
- } \
- psym = (LIST).next++; \
- \
- SYMBOL_NAME (psym) = (char *) obstack_alloc (psymbol_obstack, \
- (NAMELENGTH) + 1); \
- strncpy (SYMBOL_NAME (psym), (NAME), (NAMELENGTH)); \
- SYMBOL_NAME (psym)[(NAMELENGTH)] = '\0'; \
- SYMBOL_NAMESPACE (psym) = (NAMESPACE); \
- SYMBOL_CLASS (psym) = (CLASS); \
- VT (psym) = (VALUE); \
- } while (0);
-
-/* End of macro definitions, now let's handle them symbols! */
-
- switch (bufp->n_type)
- {
- /*
- * Standard, external, non-debugger, symbols
- */
-
- case N_TEXT | N_EXT:
- case N_NBTEXT | N_EXT:
- case N_NBDATA | N_EXT:
- case N_NBBSS | N_EXT:
- case N_SETV | N_EXT:
- case N_ABS | N_EXT:
- case N_DATA | N_EXT:
- case N_BSS | N_EXT:
-
- bufp->n_value += addr; /* Relocate */
-
- SET_NAMESTRING();
-
- bss_ext_symbol:
- record_misc_function (namestring, bufp->n_value,
- bufp->n_type); /* Always */
-
- continue;
-
- /* Standard, local, non-debugger, symbols */
-
- case N_NBTEXT:
-
- /* We need to be able to deal with both N_FN or N_TEXT,
- because we have no way of knowing whether the sys-supplied ld
- or GNU ld was used to make the executable. Sequents throw
- in another wrinkle -- they renumbered N_FN. */
- case N_FN:
- case N_FN_SEQ:
- case N_TEXT:
- bufp->n_value += addr; /* Relocate */
- SET_NAMESTRING();
- if ((namestring[0] == '-' && namestring[1] == 'l')
- || (namestring [(nsl = strlen (namestring)) - 1] == 'o'
- && namestring [nsl - 2] == '.'))
- {
- if (entry_point < bufp->n_value
- && entry_point >= last_o_file_start
- && addr == 0) /* FIXME nogood nomore */
- {
- startup_file_start = last_o_file_start;
- startup_file_end = bufp->n_value;
- }
- if (past_first_source_file && pst
- /* The gould NP1 uses low values for .o and -l symbols
- which are not the address. */
- && bufp->n_value > pst->textlow)
- {
- end_psymtab (pst, psymtab_include_list, includes_used,
- symnum * symbol_size, bufp->n_value,
- dependency_list, dependencies_used,
- global_psymbols.next, static_psymbols.next);
- pst = (struct partial_symtab *) 0;
- includes_used = 0;
- dependencies_used = 0;
- }
- else
- past_first_source_file = 1;
- last_o_file_start = bufp->n_value;
- }
- continue;
-
- case N_DATA:
- bufp->n_value += addr; /* Relocate */
- SET_NAMESTRING ();
- /* Check for __DYNAMIC, which is used by Sun shared libraries.
- Record it even if it's local, not global, so we can find it.
- Same with virtual function tables, both global and static. */
- if ((namestring[8] == 'C' && (strcmp ("__DYNAMIC", namestring) == 0))
- || VTBL_PREFIX_P ((namestring+HASH_OFFSET)))
- {
- /* Not really a function here, but... */
- record_misc_function (namestring, bufp->n_value,
- bufp->n_type); /* Always */
- }
- continue;
-
- case N_UNDF | N_EXT:
- if (bufp->n_value != 0) {
- /* This is a "Fortran COMMON" symbol. See if the target
- environment knows where it has been relocated to. */
-
- CORE_ADDR reladdr;
-
- SET_NAMESTRING();
- if (target_lookup_symbol (namestring, &reladdr)) {
- continue; /* Error in lookup; ignore symbol for now. */
- }
- bufp->n_type ^= (N_BSS^N_UNDF); /* Define it as a bss-symbol */
- bufp->n_value = reladdr;
- goto bss_ext_symbol;
- }
- continue; /* Just undefined, not COMMON */
-
- /* Lots of symbol types we can just ignore. */
-
- case N_UNDF:
- case N_ABS:
- case N_BSS:
- case N_NBDATA:
- case N_NBBSS:
- continue;
-
- /* Keep going . . .*/
-
- /*
- * Special symbol types for GNU
- */
- case N_INDR:
- case N_INDR | N_EXT:
- case N_SETA:
- case N_SETA | N_EXT:
- case N_SETT:
- case N_SETT | N_EXT:
- case N_SETD:
- case N_SETD | N_EXT:
- case N_SETB:
- case N_SETB | N_EXT:
- case N_SETV:
- continue;
-
- /*
- * Debugger symbols
- */
-
- case N_SO: {
- unsigned long valu = bufp->n_value;
- /* Symbol number of the first symbol of this file (i.e. the N_SO
- if there is just one, or the first if we have a pair). */
- int first_symnum = symnum;
-
- /* End the current partial symtab and start a new one */
-
- SET_NAMESTRING();
-
- /* Peek at the next symbol. If it is also an N_SO, the
- first one just indicates the directory. */
- if (symbuf_idx == symbuf_end)
- fill_symbuf ();
- bufp = &symbuf[symbuf_idx];
- /* n_type is only a char, so swapping swapping is irrelevant. */
- if (bufp->n_type == (unsigned char)N_SO)
- {
- SWAP_SYMBOL (bufp);
- SET_NAMESTRING ();
- valu = bufp->n_value;
- symbuf_idx++;
- symnum++;
- }
- valu += addr; /* Relocate */
-
- if (pst && past_first_source_file)
- {
- end_psymtab (pst, psymtab_include_list, includes_used,
- first_symnum * symbol_size, valu,
- dependency_list, dependencies_used,
- global_psymbols.next, static_psymbols.next);
- pst = (struct partial_symtab *) 0;
- includes_used = 0;
- dependencies_used = 0;
- }
- else
- past_first_source_file = 1;
-
- pst = start_psymtab (symfile_name, addr,
- namestring, valu,
- first_symnum * symbol_size,
- global_psymbols.next, static_psymbols.next);
- continue;
- }
-
- case N_BINCL:
- /* Add this bincl to the bincl_list for future EXCLs. No
- need to save the string; it'll be around until
- read_dbx_symtab function returns */
-
- SET_NAMESTRING();
-
- add_bincl_to_list (pst, namestring, bufp->n_value);
-
- /* Mark down an include file in the current psymtab */
-
- psymtab_include_list[includes_used++] = namestring;
- if (includes_used >= includes_allocated)
- {
- char **orig = psymtab_include_list;
-
- psymtab_include_list = (char **)
- alloca ((includes_allocated *= 2) *
- sizeof (char *));
- bcopy (orig, psymtab_include_list,
- includes_used * sizeof (char *));
- }
-
- continue;
-
- case N_SOL:
- /* Mark down an include file in the current psymtab */
-
- SET_NAMESTRING();
-
- /* In C++, one may expect the same filename to come round many
- times, when code is coming alternately from the main file
- and from inline functions in other files. So I check to see
- if this is a file we've seen before -- either the main
- source file, or a previously included file.
-
- This seems to be a lot of time to be spending on N_SOL, but
- things like "break c-exp.y:435" need to work (I
- suppose the psymtab_include_list could be hashed or put
- in a binary tree, if profiling shows this is a major hog). */
- if (pst && !strcmp (namestring, pst->filename))
- continue;
- {
- register int i;
- for (i = 0; i < includes_used; i++)
- if (!strcmp (namestring, psymtab_include_list[i]))
- {
- i = -1;
- break;
- }
- if (i == -1)
- continue;
- }
-
- psymtab_include_list[includes_used++] = namestring;
- if (includes_used >= includes_allocated)
- {
- char **orig = psymtab_include_list;
-
- psymtab_include_list = (char **)
- alloca ((includes_allocated *= 2) *
- sizeof (char *));
- bcopy (orig, psymtab_include_list,
- includes_used * sizeof (char *));
- }
- continue;
-
- case N_LSYM: /* Typedef or automatic variable. */
- case N_STSYM: /* Data seg var -- static */
- case N_LCSYM: /* BSS " */
- case N_NBSTS: /* Gould nobase. */
- case N_NBLCS: /* symbols. */
-
- SET_NAMESTRING();
-
- p = (char *) strchr (namestring, ':');
-
- /* Skip if there is no :. */
- if (!p) continue;
-
- switch (p[1])
- {
- case 'T':
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
- STRUCT_NAMESPACE, LOC_TYPEDEF,
- static_psymbols, bufp->n_value);
- if (p[2] == 't')
- {
- /* Also a typedef with the same name. */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
- static_psymbols, bufp->n_value);
- p += 1;
- }
- goto check_enum;
- case 't':
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
- static_psymbols, bufp->n_value);
- check_enum:
- /* If this is an enumerated type, we need to
- add all the enum constants to the partial symbol
- table. This does not cover enums without names, e.g.
- "enum {a, b} c;" in C, but fortunately those are
- rare. There is no way for GDB to find those from the
- enum type without spending too much time on it. Thus
- to solve this problem, the compiler needs to put out separate
- constant symbols ('c' N_LSYMS) for enum constants in
- enums without names, or put out a dummy type. */
-
- /* We are looking for something of the form
- <name> ":" ("t" | "T") [<number> "="] "e"
- {<constant> ":" <value> ","} ";". */
-
- /* Skip over the colon and the 't' or 'T'. */
- p += 2;
- /* This type may be given a number. Skip over it. */
- while ((*p >= '0' && *p <= '9')
- || *p == '=')
- p++;
-
- if (*p++ == 'e')
- {
- /* We have found an enumerated type. */
- /* According to comments in read_enum_type
- a comma could end it instead of a semicolon.
- I don't know where that happens.
- Accept either. */
- while (*p && *p != ';' && *p != ',')
- {
- char *q;
-
- /* Check for and handle cretinous dbx symbol name
- continuation! */
- if (*p == '\\')
- p = next_symbol_text ();
-
- /* Point to the character after the name
- of the enum constant. */
- for (q = p; *q && *q != ':'; q++)
- ;
- /* Note that the value doesn't matter for
- enum constants in psymtabs, just in symtabs. */
- ADD_PSYMBOL_TO_LIST (p, q - p,
- VAR_NAMESPACE, LOC_CONST,
- static_psymbols, 0);
- /* Point past the name. */
- p = q;
- /* Skip over the value. */
- while (*p && *p != ',')
- p++;
- /* Advance past the comma. */
- if (*p)
- p++;
- }
- }
-
- continue;
- case 'c':
- /* Constant, e.g. from "const" in Pascal. */
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_CONST,
- static_psymbols, bufp->n_value);
- continue;
- default:
- /* Skip if the thing following the : is
- not a letter (which indicates declaration of a local
- variable, which we aren't interested in). */
- continue;
- }
-
- case N_FUN:
- case N_GSYM: /* Global (extern) variable; can be
- data or bss (sigh). */
-
- /* Following may probably be ignored; I'll leave them here
- for now (until I do Pascal and Modula 2 extensions). */
-
- case N_PC: /* I may or may not need this; I
- suspect not. */
- case N_M2C: /* I suspect that I can ignore this here. */
- case N_SCOPE: /* Same. */
-
- SET_NAMESTRING();
-
- p = (char *) strchr (namestring, ':');
- if (!p)
- continue; /* Not a debugging symbol. */
-
-
-
- /* Main processing section for debugging symbols which
- the initial read through the symbol tables needs to worry
- about. If we reach this point, the symbol which we are
- considering is definitely one we are interested in.
- p must also contain the (valid) index into the namestring
- which indicates the debugging type symbol. */
-
- switch (p[1])
- {
- case 'c':
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_CONST,
- static_psymbols, bufp->n_value);
- continue;
- case 'S':
- bufp->n_value += addr; /* Relocate */
- ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
- static_psymbols, bufp->n_value);
- continue;
- case 'G':
- bufp->n_value += addr; /* Relocate */
- /* The addresses in these entries are reported to be
- wrong. See the code that reads 'G's for symtabs. */
- ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
- global_psymbols, bufp->n_value);
- continue;
-
- case 't':
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
- static_psymbols, bufp->n_value);
- continue;
-
- case 'f':
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
- static_psymbols, bufp->n_value);
- continue;
-
- /* Global functions were ignored here, but now they
- are put into the global psymtab like one would expect.
- They're also in the misc fn vector...
- FIXME, why did it used to ignore these? That broke
- "i fun" on these functions. */
- case 'F':
- ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
- global_psymbols, bufp->n_value);
- continue;
-
- /* Two things show up here (hopefully); static symbols of
- local scope (static used inside braces) or extensions
- of structure symbols. We can ignore both. */
- case 'V':
- case '(':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- continue;
-
- default:
- /* Unexpected symbol. Ignore it; perhaps it is an extension
- that we don't know about.
-
- Someone says sun cc puts out symbols like
- /foo/baz/maclib::/usr/local/bin/maclib,
- which would get here with a symbol type of ':'. */
- continue;
- }
-
- case N_EXCL:
-
- SET_NAMESTRING();
-
- /* Find the corresponding bincl and mark that psymtab on the
- psymtab dependency list */
- {
- struct partial_symtab *needed_pst =
- find_corresponding_bincl_psymtab (namestring, bufp->n_value);
-
- /* If this include file was defined earlier in this file,
- leave it alone. */
- if (needed_pst == pst) continue;
-
- if (needed_pst)
- {
- int i;
- int found = 0;
-
- for (i = 0; i < dependencies_used; i++)
- if (dependency_list[i] == needed_pst)
- {
- found = 1;
- break;
- }
-
- /* If it's already in the list, skip the rest. */
- if (found) continue;
-
- dependency_list[dependencies_used++] = needed_pst;
- if (dependencies_used >= dependencies_allocated)
- {
- struct partial_symtab **orig = dependency_list;
- dependency_list =
- (struct partial_symtab **)
- alloca ((dependencies_allocated *= 2)
- * sizeof (struct partial_symtab *));
- bcopy (orig, dependency_list,
- (dependencies_used
- * sizeof (struct partial_symtab *)));
-#ifdef DEBUG_INFO
- fprintf (stderr, "Had to reallocate dependency list.\n");
- fprintf (stderr, "New dependencies allocated: %d\n",
- dependencies_allocated);
-#endif
- }
- }
- else
- error ("Invalid symbol data: \"repeated\" header file not previously seen, at symtab pos %d.",
- symnum);
- }
- continue;
-
- case N_EINCL:
- case N_DSLINE:
- case N_BSLINE:
- case N_SSYM: /* Claim: Structure or union element.
- Hopefully, I can ignore this. */
- case N_ENTRY: /* Alternate entry point; can ignore. */
- case N_MAIN: /* Can definitely ignore this. */
- case N_CATCH: /* These are GNU C++ extensions */
- case N_EHDECL: /* that can safely be ignored here. */
- case N_LENG:
- case N_BCOMM:
- case N_ECOMM:
- case N_ECOML:
- case N_FNAME:
- case N_SLINE:
- case N_RSYM:
- case N_PSYM:
- case N_LBRAC:
- case N_RBRAC:
- case N_NSYMS: /* Ultrix 4.0: symbol count */
- case N_DEFD: /* GNU Modula-2 */
- /* These symbols aren't interesting; don't worry about them */
-
- continue;
-
- default:
- /* If we haven't found it yet, ignore it. It's probably some
- new type we don't know about yet. */
- complain (&unknown_symtype_complaint, local_hex_string(bufp->n_type));
- continue;
- }
- }
-
- /* If there's stuff to be cleaned up, clean it up. */
- if (nlistlen > 0 /* We have some syms */
- && entry_point < bufp->n_value
- && entry_point >= last_o_file_start)
- {
- startup_file_start = last_o_file_start;
- startup_file_end = bufp->n_value;
- }
-
- if (pst)
- {
- end_psymtab (pst, psymtab_include_list, includes_used,
- symnum * symbol_size, end_of_text_addr,
- dependency_list, dependencies_used,
- global_psymbols.next, static_psymbols.next);
- includes_used = 0;
- dependencies_used = 0;
- pst = (struct partial_symtab *) 0;
- }
-
- free_bincl_list ();
- discard_cleanups (old_chain);
-}
-
-/* Allocate and partially fill a partial symtab. It will be
- completely filled at the end of the symbol list.
-
- SYMFILE_NAME is the name of the symbol-file we are reading from, and ADDR
- is the address relative to which its symbols are (incremental) or 0
- (normal). */
-
-
-static struct partial_symtab *
-start_psymtab (symfile_name, addr,
- filename, textlow, ldsymoff, global_syms, static_syms)
- char *symfile_name;
- CORE_ADDR addr;
- char *filename;
- CORE_ADDR textlow;
- int ldsymoff;
- struct partial_symbol *global_syms;
- struct partial_symbol *static_syms;
-{
- struct partial_symtab *result =
- (struct partial_symtab *) obstack_alloc (psymbol_obstack,
- sizeof (struct partial_symtab));
-
- result->addr = addr;
-
- result->symfile_name =
- (char *) obstack_alloc (psymbol_obstack,
- strlen (symfile_name) + 1);
- strcpy (result->symfile_name, symfile_name);
-
- result->filename =
- (char *) obstack_alloc (psymbol_obstack,
- strlen (filename) + 1);
- strcpy (result->filename, filename);
-
- result->textlow = textlow;
- result->read_symtab_private = (char *) obstack_alloc (psymbol_obstack,
- sizeof (struct symloc));
- LDSYMOFF(result) = ldsymoff;
-
- result->readin = 0;
- result->symtab = 0;
- result->read_symtab = dbx_psymtab_to_symtab;
-
- result->globals_offset = global_syms - global_psymbols.list;
- result->statics_offset = static_syms - static_psymbols.list;
-
- result->n_global_syms = 0;
- result->n_static_syms = 0;
-
-
- return result;
-}
-
-static int
-compare_psymbols (s1, s2)
- register struct partial_symbol *s1, *s2;
-{
- register char
- *st1 = SYMBOL_NAME (s1),
- *st2 = SYMBOL_NAME (s2);
-
- if (st1[0] - st2[0])
- return st1[0] - st2[0];
- if (st1[1] - st2[1])
- return st1[1] - st2[1];
- return strcmp (st1 + 1, st2 + 1);
-}
-
-
-/* Close off the current usage of a partial_symbol table entry. This
- involves setting the correct number of includes (with a realloc),
- setting the high text mark, setting the symbol length in the
- executable, and setting the length of the global and static lists
- of psymbols.
-
- The global symbols and static symbols are then seperately sorted.
-
- Then the partial symtab is put on the global list.
- *** List variables and peculiarities of same. ***
- */
-static void
-end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
- capping_text, dependency_list, number_dependencies,
- capping_global, capping_static)
- struct partial_symtab *pst;
- char **include_list;
- int num_includes;
- int capping_symbol_offset;
- CORE_ADDR capping_text;
- struct partial_symtab **dependency_list;
- int number_dependencies;
- struct partial_symbol *capping_global, *capping_static;
-{
- int i;
-
- LDSYMLEN(pst) = capping_symbol_offset - LDSYMOFF(pst);
- pst->texthigh = capping_text;
-
- pst->n_global_syms =
- capping_global - (global_psymbols.list + pst->globals_offset);
- pst->n_static_syms =
- capping_static - (static_psymbols.list + pst->statics_offset);
-
- pst->number_of_dependencies = number_dependencies;
- if (number_dependencies)
- {
- pst->dependencies = (struct partial_symtab **)
- obstack_alloc (psymbol_obstack,
- number_dependencies * sizeof (struct partial_symtab *));
- bcopy (dependency_list, pst->dependencies,
- number_dependencies * sizeof (struct partial_symtab *));
- }
- else
- pst->dependencies = 0;
-
- for (i = 0; i < num_includes; i++)
- {
- /* Eventually, put this on obstack */
- struct partial_symtab *subpst =
- (struct partial_symtab *)
- obstack_alloc (psymbol_obstack,
- sizeof (struct partial_symtab));
-
- subpst->filename =
- (char *) obstack_alloc (psymbol_obstack,
- strlen (include_list[i]) + 1);
- strcpy (subpst->filename, include_list[i]);
-
- subpst->symfile_name = pst->symfile_name;
- subpst->addr = pst->addr;
- subpst->read_symtab_private = (char *) obstack_alloc (psymbol_obstack,
- sizeof (struct symloc));
- LDSYMOFF(subpst) =
- LDSYMLEN(subpst) =
- subpst->textlow =
- subpst->texthigh = 0;
-
- /* We could save slight bits of space by only making one of these,
- shared by the entire set of include files. FIXME-someday. */
- subpst->dependencies = (struct partial_symtab **)
- obstack_alloc (psymbol_obstack,
- sizeof (struct partial_symtab *));
- subpst->dependencies[0] = pst;
- subpst->number_of_dependencies = 1;
-
- subpst->globals_offset =
- subpst->n_global_syms =
- subpst->statics_offset =
- subpst->n_static_syms = 0;
-
- subpst->readin = 0;
- subpst->symtab = 0;
- subpst->read_symtab = dbx_psymtab_to_symtab;
-
- subpst->next = partial_symtab_list;
- partial_symtab_list = subpst;
- }
-
- /* Sort the global list; don't sort the static list */
- qsort (global_psymbols.list + pst->globals_offset, pst->n_global_syms,
- sizeof (struct partial_symbol), compare_psymbols);
-
- /* If there is already a psymtab or symtab for a file of this name, remove it.
- (If there is a symtab, more drastic things also happen.)
- This happens in VxWorks. */
- free_named_symtabs (pst->filename);
-
- /* Put the psymtab on the psymtab list */
- pst->next = partial_symtab_list;
- partial_symtab_list = pst;
-}
-
-static void
-psymtab_to_symtab_1 (pst, desc, stringtab, stringtab_size, sym_offset)
- struct partial_symtab *pst;
- int desc;
- char *stringtab;
- int stringtab_size;
- int sym_offset;
-{
- struct cleanup *old_chain;
- int i;
-
- if (!pst)
- return;
-
- if (pst->readin)
- {
- fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst->filename);
- return;
- }
-
- /* Read in all partial symtabs on which this one is dependent */
- for (i = 0; i < pst->number_of_dependencies; i++)
- if (!pst->dependencies[i]->readin)
- {
- /* Inform about additional files that need to be read in. */
- if (info_verbose)
- {
- fputs_filtered (" ", stdout);
- wrap_here ("");
- fputs_filtered ("and ", stdout);
- wrap_here ("");
- printf_filtered ("%s...", pst->dependencies[i]->filename);
- wrap_here (""); /* Flush output */
- fflush (stdout);
- }
- psymtab_to_symtab_1 (pst->dependencies[i], desc,
- stringtab, stringtab_size, sym_offset);
- }
-
- if (LDSYMLEN(pst)) /* Otherwise it's a dummy */
- {
- /* Init stuff necessary for reading in symbols */
- buildsym_init ();
- old_chain = make_cleanup (really_free_pendings, 0);
-
- /* Read in this files symbols */
- lseek (desc, sym_offset, L_SET);
- pst->symtab =
- read_ofile_symtab (desc, stringtab, stringtab_size,
- LDSYMOFF(pst),
- LDSYMLEN(pst), pst->textlow,
- pst->texthigh - pst->textlow, pst->addr);
- sort_symtab_syms (pst->symtab);
-
- do_cleanups (old_chain);
- }
-
- pst->readin = 1;
-}
-
-/*
- * Read in all of the symbols for a given psymtab for real.
- * Be verbose about it if the user wants that.
- */
-static void
-dbx_psymtab_to_symtab (pst)
- struct partial_symtab *pst;
-{
- int desc;
- char *stringtab;
- int stsize, val;
- struct stat statbuf;
- struct cleanup *old_chain;
- bfd *sym_bfd;
- long st_temp;
-
- if (!pst)
- return;
-
- if (pst->readin)
- {
- fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst->filename);
- return;
- }
-
- if (LDSYMLEN(pst) || pst->number_of_dependencies)
- {
- /* Print the message now, before reading the string table,
- to avoid disconcerting pauses. */
- if (info_verbose)
- {
- printf_filtered ("Reading in symbols for %s...", pst->filename);
- fflush (stdout);
- }
-
- /* Open symbol file and read in string table. Symbol_file_command
- guarantees that the symbol file name will be absolute, so there is
- no need for openp. */
- desc = open(pst->symfile_name, O_RDONLY, 0);
-
- if (desc < 0)
- perror_with_name (pst->symfile_name);
-
- sym_bfd = bfd_fdopenr (pst->symfile_name, NULL, desc);
- if (!sym_bfd)
- {
- (void)close (desc);
- error ("Could not open `%s' to read symbols: %s",
- pst->symfile_name, bfd_errmsg (bfd_error));
- }
- old_chain = make_cleanup (bfd_close, sym_bfd);
- if (!bfd_check_format (sym_bfd, bfd_object))
- error ("\"%s\": can't read symbols: %s.",
- pst->symfile_name, bfd_errmsg (bfd_error));
-
- /* We keep the string table for symfile resident in memory, but
- not the string table for any other symbol files. */
- if ((symfile == 0) || 0 != strcmp(pst->symfile_name, symfile))
- {
- /* Read in the string table */
-
- /* FIXME, this uses internal BFD variables. See above in
- dbx_symbol_file_open where the macro is defined! */
- lseek (desc, STRING_TABLE_OFFSET, L_SET);
-
- val = myread (desc, &st_temp, sizeof st_temp);
- if (val < 0)
- perror_with_name (pst->symfile_name);
- stsize = bfd_h_get_32 (sym_bfd, (unsigned char *)&st_temp);
- if (fstat (desc, &statbuf) < 0)
- perror_with_name (pst->symfile_name);
-
- if (stsize >= 0 && stsize < statbuf.st_size)
- {
-#ifdef BROKEN_LARGE_ALLOCA
- stringtab = (char *) xmalloc (stsize);
- make_cleanup (free, stringtab);
-#else
- stringtab = (char *) alloca (stsize);
-#endif
- }
- else
- stringtab = NULL;
- if (stringtab == NULL && stsize != 0)
- error ("ridiculous string table size: %d bytes", stsize);
-
- /* FIXME, this uses internal BFD variables. See above in
- dbx_symbol_file_open where the macro is defined! */
- val = lseek (desc, STRING_TABLE_OFFSET, L_SET);
- if (val < 0)
- perror_with_name (pst->symfile_name);
- val = myread (desc, stringtab, stsize);
- if (val < 0)
- perror_with_name (pst->symfile_name);
- }
- else
- {
- stringtab = symfile_string_table;
- stsize = symfile_string_table_size;
- }
-
- symfile_bfd = sym_bfd; /* Kludge for SWAP_SYMBOL */
- /* FIXME POKING INSIDE BFD DATA STRUCTURES */
- symbol_size = obj_symbol_entry_size (sym_bfd);
-
- /* FIXME, this uses internal BFD variables. See above in
- dbx_symbol_file_open where the macro is defined! */
- psymtab_to_symtab_1 (pst, desc, stringtab, stsize,
- SYMBOL_TABLE_OFFSET);
-
- /* Match with global symbols. This only needs to be done once,
- after all of the symtabs and dependencies have been read in. */
- scan_file_globals ();
-
- do_cleanups (old_chain);
-
- /* Finish up the debug error message. */
- if (info_verbose)
- printf_filtered ("done.\n");
- }
-}
-
-/* Process a pair of symbols. Currently they must both be N_SO's. */
-/* ARGSUSED */
-static void
-process_symbol_pair (type1, desc1, value1, name1,
- type2, desc2, value2, name2)
- int type1;
- int desc1;
- CORE_ADDR value1;
- char *name1;
- int type2;
- int desc2;
- CORE_ADDR value2;
- char *name2;
-{
- /* No need to check PCC_SOL_BROKEN, on the assumption that such
- broken PCC's don't put out N_SO pairs. */
- if (last_source_file)
- (void)end_symtab (value2, 0, 0);
- start_symtab (name2, name1, value2);
-}
-
-/*
- * Read in a defined section of a specific object file's symbols.
- *
- * DESC is the file descriptor for the file, positioned at the
- * beginning of the symtab
- * STRINGTAB is a pointer to the files string
- * table, already read in
- * SYM_OFFSET is the offset within the file of
- * the beginning of the symbols we want to read, NUM_SUMBOLS is the
- * number of symbols to read
- * TEXT_OFFSET is the beginning of the text segment we are reading symbols for
- * TEXT_SIZE is the size of the text segment read in.
- * OFFSET is a relocation offset which gets added to each symbol
- */
-
-static struct symtab *
-read_ofile_symtab (desc, stringtab, stringtab_size, sym_offset,
- sym_size, text_offset, text_size, offset)
- int desc;
- register char *stringtab;
- unsigned int stringtab_size;
- int sym_offset;
- int sym_size;
- CORE_ADDR text_offset;
- int text_size;
- int offset;
-{
- register char *namestring;
- struct internal_nlist *bufp;
- unsigned char type;
- unsigned max_symnum;
- subfile_stack = 0;
-
- stringtab_global = stringtab;
- last_source_file = 0;
-
- symtab_input_desc = desc;
- symbuf_end = symbuf_idx = 0;
-
- /* It is necessary to actually read one symbol *before* the start
- of this symtab's symbols, because the GCC_COMPILED_FLAG_SYMBOL
- occurs before the N_SO symbol.
-
- Detecting this in read_dbx_symtab
- would slow down initial readin, so we look for it here instead. */
- if (sym_offset >= (int)symbol_size)
- {
- lseek (desc, sym_offset - symbol_size, L_INCR);
- fill_symbuf ();
- bufp = &symbuf[symbuf_idx++];
- SWAP_SYMBOL (bufp);
-
- SET_NAMESTRING ();
-
- processing_gcc_compilation =
- (bufp->n_type == N_TEXT
- && !strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL));
- /* FIXME!!! Check for gcc2_compiled... */
- }
- else
- {
- /* The N_SO starting this symtab is the first symbol, so we
- better not check the symbol before it. I'm not this can
- happen, but it doesn't hurt to check for it. */
- lseek(desc, sym_offset, L_INCR);
- processing_gcc_compilation = 0;
- }
-
- if (symbuf_idx == symbuf_end)
- fill_symbuf();
- bufp = &symbuf[symbuf_idx];
- if (bufp->n_type != (unsigned char)N_SO)
- error("First symbol in segment of executable not a source symbol");
-
- max_symnum = sym_size / symbol_size;
-
- for (symnum = 0;
- symnum < max_symnum;
- symnum++)
- {
- QUIT; /* Allow this to be interruptable */
- if (symbuf_idx == symbuf_end)
- fill_symbuf();
- bufp = &symbuf[symbuf_idx++];
- SWAP_SYMBOL (bufp);
-
- type = bufp->n_type;
- if (type == (unsigned char)N_CATCH)
- {
- /* N_CATCH is not fixed up by the linker, and unfortunately,
- there's no other place to put it in the .stab map. */
- bufp->n_value += text_offset + offset;
- }
- else {
- type &= ~N_EXT; /* Ignore external-bit */
- if (type == N_TEXT || type == N_DATA || type == N_BSS)
- bufp->n_value += offset;
- type = bufp->n_type;
- }
-
- SET_NAMESTRING ();
-
- if (type & N_STAB)
- {
- short bufp_n_desc = bufp->n_desc;
- unsigned long valu = bufp->n_value;
-
- /* Check for a pair of N_SO symbols. */
- if (type == (unsigned char)N_SO)
- {
- if (symbuf_idx == symbuf_end)
- fill_symbuf ();
- bufp = &symbuf[symbuf_idx];
- if (bufp->n_type == (unsigned char)N_SO)
- {
- char *namestring1 = namestring;
-
- SWAP_SYMBOL (bufp);
- bufp->n_value += offset; /* Relocate */
- symbuf_idx++;
- symnum++;
- SET_NAMESTRING ();
-
- process_symbol_pair (N_SO, bufp_n_desc, valu, namestring1,
- N_SO, bufp->n_desc, bufp->n_value,
- namestring);
- }
- else
- process_one_symbol(type, bufp_n_desc, valu, namestring);
- }
- else
- process_one_symbol (type, bufp_n_desc, valu, namestring);
- }
- /* We skip checking for a new .o or -l file; that should never
- happen in this routine. */
- else if (type == N_TEXT
- && !strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL))
- /* I don't think this code will ever be executed, because
- the GCC_COMPILED_FLAG_SYMBOL usually is right before
- the N_SO symbol which starts this source file.
- However, there is no reason not to accept
- the GCC_COMPILED_FLAG_SYMBOL anywhere. */
- processing_gcc_compilation = 1;
- else if (type & N_EXT || type == (unsigned char)N_TEXT
- || type == (unsigned char)N_NBTEXT
- ) {
- /* Global symbol: see if we came across a dbx defintion for
- a corresponding symbol. If so, store the value. Remove
- syms from the chain when their values are stored, but
- search the whole chain, as there may be several syms from
- different files with the same name. */
- /* This is probably not true. Since the files will be read
- in one at a time, each reference to a global symbol will
- be satisfied in each file as it appears. So we skip this
- section. */
- ;
- }
- }
-
- return end_symtab (text_offset + text_size, 0, 0);
-}
-
-int
-hashname (name)
- char *name;
-{
- register char *p = name;
- register int total = p[0];
- register int c;
-
- c = p[1];
- total += c << 2;
- if (c)
- {
- c = p[2];
- total += c << 4;
- if (c)
- total += p[3] << 6;
- }
-
- /* Ensure result is positive. */
- if (total < 0) total += (1000 << 6);
- return total % HASHSIZE;
-}
-
-
-static void
-process_one_symbol (type, desc, valu, name)
- int type, desc;
- CORE_ADDR valu;
- char *name;
-{
-#ifndef SUN_FIXED_LBRAC_BUG
- /* This records the last pc address we've seen. We depend on their being
- an SLINE or FUN or SO before the first LBRAC, since the variable does
- not get reset in between reads of different symbol files. */
- static CORE_ADDR last_pc_address;
-#endif
- register struct context_stack *new;
- char *colon_pos;
-
- /* Something is wrong if we see real data before
- seeing a source file name. */
-
- if (last_source_file == 0 && type != (unsigned char)N_SO)
- {
- /* Currently this ignores N_ENTRY on Gould machines, N_NSYM on machines
- where that code is defined. */
- if (IGNORE_SYMBOL (type))
- return;
-
- /* FIXME, this should not be an error, since it precludes extending
- the symbol table information in this way... */
- error ("Invalid symbol data: does not start by identifying a source file.");
- }
-
- switch (type)
- {
- case N_FUN:
- case N_FNAME:
- /* Either of these types of symbols indicates the start of
- a new function. We must process its "name" normally for dbx,
- but also record the start of a new lexical context, and possibly
- also the end of the lexical context for the previous function. */
- /* This is not always true. This type of symbol may indicate a
- text segment variable. */
-
-#ifndef SUN_FIXED_LBRAC_BUG
- last_pc_address = valu; /* Save for SunOS bug circumcision */
-#endif
-
- colon_pos = strchr (name, ':');
- if (!colon_pos++
- || (*colon_pos != 'f' && *colon_pos != 'F'))
- {
- define_symbol (valu, name, desc, type);
- break;
- }
-
- within_function = 1;
- if (context_stack_depth > 0)
- {
- new = &context_stack[--context_stack_depth];
- /* Make a block for the local symbols within. */
- finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr, valu);
- }
- /* Stack must be empty now. */
- if (context_stack_depth != 0)
- error ("Invalid symbol data: unmatched N_LBRAC before symtab pos %d.",
- symnum);
-
- new = &context_stack[context_stack_depth++];
- new->old_blocks = pending_blocks;
- new->start_addr = valu;
- new->name = define_symbol (valu, name, desc, type);
- local_symbols = 0;
- break;
-
- case N_CATCH:
- /* Record the address at which this catch takes place. */
- define_symbol (valu, name, desc, type);
- break;
-
- case N_EHDECL:
- /* Don't know what to do with these yet. */
- error ("action uncertain for eh extensions");
- break;
-
- case N_LBRAC:
- /* This "symbol" just indicates the start of an inner lexical
- context within a function. */
-
-#if !defined (BLOCK_ADDRESS_ABSOLUTE)
- /* On most machines, the block addresses are relative to the
- N_SO, the linker did not relocate them (sigh). */
- valu += last_source_start_addr;
-#endif
-
-#ifndef SUN_FIXED_LBRAC_BUG
- if (valu < last_pc_address) {
- /* Patch current LBRAC pc value to match last handy pc value */
- complain (&lbrac_complaint, 0);
- valu = last_pc_address;
- }
-#endif
- if (context_stack_depth == context_stack_size)
- {
- context_stack_size *= 2;
- context_stack = (struct context_stack *)
- xrealloc (context_stack,
- (context_stack_size
- * sizeof (struct context_stack)));
- }
-
- new = &context_stack[context_stack_depth++];
- new->depth = desc;
- new->locals = local_symbols;
- new->old_blocks = pending_blocks;
- new->start_addr = valu;
- new->name = 0;
- local_symbols = 0;
- break;
-
- case N_RBRAC:
- /* This "symbol" just indicates the end of an inner lexical
- context that was started with N_LBRAC. */
-
-#if !defined (BLOCK_ADDRESS_ABSOLUTE)
- /* On most machines, the block addresses are relative to the
- N_SO, the linker did not relocate them (sigh). */
- valu += last_source_start_addr;
-#endif
-
- new = &context_stack[--context_stack_depth];
- if (desc != new->depth)
- error ("Invalid symbol data: N_LBRAC/N_RBRAC symbol mismatch, symtab pos %d.", symnum);
-
- /* Some compilers put the variable decls inside of an
- LBRAC/RBRAC block. This macro should be nonzero if this
- is true. DESC is N_DESC from the N_RBRAC symbol.
- GCC_P is true if we've detected the GCC_COMPILED_SYMBOL. */
-#if !defined (VARIABLES_INSIDE_BLOCK)
-#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) 0
-#endif
-
- /* Can only use new->locals as local symbols here if we're in
- gcc or on a machine that puts them before the lbrack. */
- if (!VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
- local_symbols = new->locals;
-
- /* If this is not the outermost LBRAC...RBRAC pair in the
- function, its local symbols preceded it, and are the ones
- just recovered from the context stack. Defined the block for them.
-
- If this is the outermost LBRAC...RBRAC pair, there is no
- need to do anything; leave the symbols that preceded it
- to be attached to the function's own block. However, if
- it is so, we need to indicate that we just moved outside
- of the function. */
- if (local_symbols
- && (context_stack_depth
- > !VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation)))
- {
- /* FIXME Muzzle a compiler bug that makes end < start. */
- if (new->start_addr > valu)
- {
- complain(&lbrac_rbrac_complaint, 0);
- new->start_addr = valu;
- }
- /* Make a block for the local symbols within. */
- finish_block (0, &local_symbols, new->old_blocks,
- new->start_addr, valu);
- }
- else
- {
- within_function = 0;
- }
- if (VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
- /* Now pop locals of block just finished. */
- local_symbols = new->locals;
- break;
-
- case N_FN:
- case N_FN_SEQ:
- /* This kind of symbol indicates the start of an object file. */
- break;
-
- case N_SO:
- /* This type of symbol indicates the start of data
- for one source file.
- Finish the symbol table of the previous source file
- (if any) and start accumulating a new symbol table. */
-#ifndef SUN_FIXED_LBRAC_BUG
- last_pc_address = valu; /* Save for SunOS bug circumcision */
-#endif
-
-#ifdef PCC_SOL_BROKEN
- /* pcc bug, occasionally puts out SO for SOL. */
- if (context_stack_depth > 0)
- {
- start_subfile (name, NULL);
- break;
- }
-#endif
- if (last_source_file)
- (void)end_symtab (valu, 0, 0);
- start_symtab (name, NULL, valu);
- break;
-
- case N_SOL:
- /* This type of symbol indicates the start of data for
- a sub-source-file, one whose contents were copied or
- included in the compilation of the main source file
- (whose name was given in the N_SO symbol.) */
- start_subfile (name, NULL);
- break;
-
- case N_BINCL:
- push_subfile ();
- add_new_header_file (name, valu);
- start_subfile (name, NULL);
- break;
-
- case N_EINCL:
- start_subfile (pop_subfile (), NULL);
- break;
-
- case N_EXCL:
- add_old_header_file (name, valu);
- break;
-
- case N_SLINE:
- /* This type of "symbol" really just records
- one line-number -- core-address correspondence.
- Enter it in the line list for this symbol table. */
-#ifndef SUN_FIXED_LBRAC_BUG
- last_pc_address = valu; /* Save for SunOS bug circumcision */
-#endif
- record_line (current_subfile, desc, valu);
- break;
-
- case N_BCOMM:
- if (common_block)
- error ("Invalid symbol data: common within common at symtab pos %d",
- symnum);
- common_block = local_symbols;
- common_block_i = local_symbols ? local_symbols->nsyms : 0;
- break;
-
- case N_ECOMM:
- /* Symbols declared since the BCOMM are to have the common block
- start address added in when we know it. common_block points to
- the first symbol after the BCOMM in the local_symbols list;
- copy the list and hang it off the symbol for the common block name
- for later fixup. */
- {
- int i;
- struct symbol *sym =
- (struct symbol *) xmalloc (sizeof (struct symbol));
- bzero (sym, sizeof *sym);
- SYMBOL_NAME (sym) = savestring (name, strlen (name));
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_NAMESPACE (sym) = (enum namespace)((long)
- copy_pending (local_symbols, common_block_i, common_block));
- i = hashname (SYMBOL_NAME (sym));
- SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
- global_sym_chain[i] = sym;
- common_block = 0;
- break;
- }
-
- case N_ECOML:
- case N_LENG:
- case N_DEFD: /* GNU Modula-2 symbol */
- break;
-
- default:
- if (name)
- define_symbol (valu, name, desc, type);
- }
-}
-
-/* To handle GNU C++ typename abbreviation, we need to be able to
- fill in a type's name as soon as space for that type is allocated.
- `type_synonym_name' is the name of the type being allocated.
- It is cleared as soon as it is used (lest all allocated types
- get this name). */
-static char *type_synonym_name;
-
-/* ARGSUSED */
-static struct symbol *
-define_symbol (valu, string, desc, type)
- unsigned int valu;
- char *string;
- int desc;
- int type;
-{
- register struct symbol *sym;
- char *p = (char *) strchr (string, ':');
- int deftype;
- int synonym = 0;
- register int i;
-
- /* Ignore syms with empty names. */
- if (string[0] == 0)
- return 0;
-
- /* Ignore old-style symbols from cc -go */
- if (p == 0)
- return 0;
-
- sym = (struct symbol *)obstack_alloc (symbol_obstack, sizeof (struct symbol));
-
- if (processing_gcc_compilation) {
- /* GCC 2.x puts the line number in desc. SunOS apparently puts in the
- number of bytes occupied by a type or object, which we ignore. */
- SYMBOL_LINE(sym) = desc;
- } else {
- SYMBOL_LINE(sym) = 0; /* unknown */
- }
-
- if (string[0] == CPLUS_MARKER)
- {
- /* Special GNU C++ names. */
- switch (string[1])
- {
- case 't':
- SYMBOL_NAME (sym) = "this";
- break;
- case 'v': /* $vtbl_ptr_type */
- /* Was: SYMBOL_NAME (sym) = "vptr"; */
- goto normal;
- case 'e':
- SYMBOL_NAME (sym) = "eh_throw";
- break;
-
- case '_':
- /* This was an anonymous type that was never fixed up. */
- goto normal;
-
- default:
- abort ();
- }
- }
- else
- {
- normal:
- SYMBOL_NAME (sym)
- = (char *) obstack_alloc (symbol_obstack, ((p - string) + 1));
- /* Open-coded bcopy--saves function call time. */
- {
- register char *p1 = string;
- register char *p2 = SYMBOL_NAME (sym);
- while (p1 != p)
- *p2++ = *p1++;
- *p2++ = '\0';
- }
- }
- p++;
- /* Determine the type of name being defined. */
- /* The Acorn RISC machine's compiler can put out locals that don't
- start with "234=" or "(3,4)=", so assume anything other than the
- deftypes we know how to handle is a local. */
- /* (Peter Watkins @ Computervision)
- Handle Sun-style local fortran array types 'ar...' .
- (gnu@cygnus.com) -- this strchr() handles them properly?
- (tiemann@cygnus.com) -- 'C' is for catch. */
- if (!strchr ("cfFGpPrStTvVXC", *p))
- deftype = 'l';
- else
- deftype = *p++;
-
- /* c is a special case, not followed by a type-number.
- SYMBOL:c=iVALUE for an integer constant symbol.
- SYMBOL:c=rVALUE for a floating constant symbol.
- SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
- e.g. "b:c=e6,0" for "const b = blob1"
- (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
- if (deftype == 'c')
- {
- if (*p++ != '=')
- error ("Invalid symbol data at symtab pos %d.", symnum);
- switch (*p++)
- {
- case 'r':
- {
- double d = atof (p);
- char *dbl_valu;
-
- SYMBOL_TYPE (sym) = builtin_type_double;
- dbl_valu =
- (char *) obstack_alloc (symbol_obstack, sizeof (double));
- bcopy (&d, dbl_valu, sizeof (double));
- SWAP_TARGET_AND_HOST (dbl_valu, sizeof (double));
- SYMBOL_VALUE_BYTES (sym) = dbl_valu;
- SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
- }
- break;
- case 'i':
- {
- SYMBOL_TYPE (sym) = builtin_type_int;
- SYMBOL_VALUE (sym) = atoi (p);
- SYMBOL_CLASS (sym) = LOC_CONST;
- }
- break;
- case 'e':
- /* SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
- e.g. "b:c=e6,0" for "const b = blob1"
- (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
- {
- int typenums[2];
-
- read_type_number (&p, typenums);
- if (*p++ != ',')
- error ("Invalid symbol data: no comma in enum const symbol");
-
- SYMBOL_TYPE (sym) = *dbx_lookup_type (typenums);
- SYMBOL_VALUE (sym) = atoi (p);
- SYMBOL_CLASS (sym) = LOC_CONST;
- }
- break;
- default:
- error ("Invalid symbol data at symtab pos %d.", symnum);
- }
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &file_symbols);
- return sym;
- }
-
- /* Now usually comes a number that says which data type,
- and possibly more stuff to define the type
- (all of which is handled by read_type) */
-
- if (deftype == 'p' && *p == 'F')
- /* pF is a two-letter code that means a function parameter in Fortran.
- The type-number specifies the type of the return value.
- Translate it into a pointer-to-function type. */
- {
- p++;
- SYMBOL_TYPE (sym)
- = lookup_pointer_type (lookup_function_type (read_type (&p)));
- }
- else
- {
- struct type *type_read;
- synonym = *p == 't';
-
- if (synonym)
- {
- p += 1;
- type_synonym_name = obsavestring (SYMBOL_NAME (sym),
- strlen (SYMBOL_NAME (sym)));
- }
-
- type_read = read_type (&p);
-
- if ((deftype == 'F' || deftype == 'f')
- && TYPE_CODE (type_read) != TYPE_CODE_FUNC)
- {
-#if 0
-/* This code doesn't work -- it needs to realloc and can't. */
- struct type *new = (struct type *)
- obstack_alloc (symbol_obstack, sizeof (struct type));
-
- /* Generate a template for the type of this function. The
- types of the arguments will be added as we read the symbol
- table. */
- *new = *lookup_function_type (type_read);
- SYMBOL_TYPE(sym) = new;
- in_function_type = new;
-#else
- SYMBOL_TYPE (sym) = lookup_function_type (type_read);
-#endif
- }
- else
- SYMBOL_TYPE (sym) = type_read;
- }
-
- switch (deftype)
- {
- case 'C':
- /* The name of a caught exception. */
- SYMBOL_CLASS (sym) = LOC_LABEL;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- SYMBOL_VALUE_ADDRESS (sym) = valu;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'f':
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &file_symbols);
- break;
-
- case 'F':
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &global_symbols);
- break;
-
- case 'G':
- /* For a class G (global) symbol, it appears that the
- value is not correct. It is necessary to search for the
- corresponding linker definition to find the value.
- These definitions appear at the end of the namelist. */
- i = hashname (SYMBOL_NAME (sym));
- SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
- global_sym_chain[i] = sym;
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &global_symbols);
- break;
-
- /* This case is faked by a conditional above,
- when there is no code letter in the dbx data.
- Dbx data never actually contains 'l'. */
- case 'l':
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'p':
- /* Normally this is a parameter, a LOC_ARG. On the i960, it
- can also be a LOC_LOCAL_ARG depending on symbol type. */
-#ifndef DBX_PARM_SYMBOL_CLASS
-#define DBX_PARM_SYMBOL_CLASS(type) LOC_ARG
-#endif
- SYMBOL_CLASS (sym) = DBX_PARM_SYMBOL_CLASS (type);
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
-#if 0
- /* This doesn't work yet. */
- add_param_to_type (&in_function_type, sym);
-#endif
- add_symbol_to_list (sym, &local_symbols);
-
- /* If it's gcc-compiled, if it says `short', believe it. */
- if (processing_gcc_compilation || BELIEVE_PCC_PROMOTION)
- break;
-
-#if defined(BELIEVE_PCC_PROMOTION_TYPE)
- /* This macro is defined on machines (e.g. sparc) where
- we should believe the type of a PCC 'short' argument,
- but shouldn't believe the address (the address is
- the address of the corresponding int). Note that
- this is only different from the BELIEVE_PCC_PROMOTION
- case on big-endian machines.
-
- My guess is that this correction, as opposed to changing
- the parameter to an 'int' (as done below, for PCC
- on most machines), is the right thing to do
- on all machines, but I don't want to risk breaking
- something that already works. On most PCC machines,
- the sparc problem doesn't come up because the calling
- function has to zero the top bytes (not knowing whether
- the called function wants an int or a short), so there
- is no practical difference between an int and a short
- (except perhaps what happens when the GDB user types
- "print short_arg = 0x10000;").
-
- Hacked for SunOS 4.1 by gnu@cygnus.com. In 4.1, the compiler
- actually produces the correct address (we don't need to fix it
- up). I made this code adapt so that it will offset the symbol
- if it was pointing at an int-aligned location and not
- otherwise. This way you can use the same gdb for 4.0.x and
- 4.1 systems. */
-
- if (0 == SYMBOL_VALUE (sym) % sizeof (int))
- {
- if (SYMBOL_TYPE (sym) == builtin_type_char
- || SYMBOL_TYPE (sym) == builtin_type_unsigned_char)
- SYMBOL_VALUE (sym) += 3;
- else if (SYMBOL_TYPE (sym) == builtin_type_short
- || SYMBOL_TYPE (sym) == builtin_type_unsigned_short)
- SYMBOL_VALUE (sym) += 2;
- }
- break;
-
-#else /* no BELIEVE_PCC_PROMOTION_TYPE. */
-
- /* If PCC says a parameter is a short or a char,
- it is really an int. */
- if (SYMBOL_TYPE (sym) == builtin_type_char
- || SYMBOL_TYPE (sym) == builtin_type_short)
- SYMBOL_TYPE (sym) = builtin_type_int;
- else if (SYMBOL_TYPE (sym) == builtin_type_unsigned_char
- || SYMBOL_TYPE (sym) == builtin_type_unsigned_short)
- SYMBOL_TYPE (sym) = builtin_type_unsigned_int;
- break;
-
-#endif /* no BELIEVE_PCC_PROMOTION_TYPE. */
-
- case 'P':
- SYMBOL_CLASS (sym) = LOC_REGPARM;
- SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'r':
- SYMBOL_CLASS (sym) = LOC_REGISTER;
- SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'S':
- /* Static symbol at top level of file */
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &file_symbols);
- break;
-
- case 't':
- SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0
- && (TYPE_FLAGS (SYMBOL_TYPE (sym)) & TYPE_FLAG_PERM) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym)) =
- obsavestring (SYMBOL_NAME (sym),
- strlen (SYMBOL_NAME (sym)));
- /* C++ vagaries: we may have a type which is derived from
- a base type which did not have its name defined when the
- derived class was output. We fill in the derived class's
- base part member's name here in that case. */
- else if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
- || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_UNION)
- && TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)))
- {
- int j;
- for (j = TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)) - 1; j >= 0; j--)
- if (TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) == 0)
- TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) =
- type_name_no_tag (TYPE_BASECLASS (SYMBOL_TYPE (sym), j));
- }
-
- add_symbol_to_list (sym, &file_symbols);
- break;
-
- case 'T':
- SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
- if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0
- && (TYPE_FLAGS (SYMBOL_TYPE (sym)) & TYPE_FLAG_PERM) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym))
- = obconcat ("",
- (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_ENUM
- ? "enum "
- : (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
- ? "struct " : "union ")),
- SYMBOL_NAME (sym));
- add_symbol_to_list (sym, &file_symbols);
-
- if (synonym)
- {
- register struct symbol *typedef_sym
- = (struct symbol *) obstack_alloc (symbol_obstack, sizeof (struct symbol));
- SYMBOL_NAME (typedef_sym) = SYMBOL_NAME (sym);
- SYMBOL_TYPE (typedef_sym) = SYMBOL_TYPE (sym);
-
- SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
- SYMBOL_VALUE (typedef_sym) = valu;
- SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE;
- add_symbol_to_list (typedef_sym, &file_symbols);
- }
- break;
-
- case 'V':
- /* Static symbol of local scope */
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'v':
- /* Reference parameter */
- SYMBOL_CLASS (sym) = LOC_REF_ARG;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- case 'X':
- /* This is used by Sun FORTRAN for "function result value".
- Sun claims ("dbx and dbxtool interfaces", 2nd ed)
- that Pascal uses it too, but when I tried it Pascal used
- "x:3" (local symbol) instead. */
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- SYMBOL_VALUE (sym) = valu;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &local_symbols);
- break;
-
- default:
- error ("Invalid symbol data: unknown symbol-type code `%c' at symtab pos %d.", deftype, symnum);
- }
- return sym;
-}
-
-#if 0
-/* This would be a good idea, but it doesn't really work. The problem
- is that in order to get the virtual context for a particular type,
- you need to know the virtual info from all of its basetypes,
- and you need to have processed its methods. Since GDB reads
- symbols on a file-by-file basis, this means processing the symbols
- of all the files that are needed for each baseclass, which
- means potentially reading in all the debugging info just to fill
- in information we may never need. */
-
-/* This page contains subroutines of read_type. */
-
-/* FOR_TYPE is a struct type defining a virtual function NAME with type
- FN_TYPE. The `virtual context' for this virtual function is the
- first base class of FOR_TYPE in which NAME is defined with signature
- matching FN_TYPE. OFFSET serves as a hash on matches here.
-
- TYPE is the current type in which we are searching. */
-
-static struct type *
-virtual_context (for_type, type, name, fn_type, offset)
- struct type *for_type, *type;
- char *name;
- struct type *fn_type;
- int offset;
-{
- struct type *basetype = 0;
- int i;
-
- if (for_type != type)
- {
- /* Check the methods of TYPE. */
- /* Need to do a check_stub_type here, but that breaks
- things because we can get infinite regress. */
- for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
- if (!strcmp (TYPE_FN_FIELDLIST_NAME (type, i), name))
- break;
- if (i >= 0)
- {
- int j = TYPE_FN_FIELDLIST_LENGTH (type, i);
- struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
-
- while (--j >= 0)
- if (TYPE_FN_FIELD_VOFFSET (f, j) == offset-1)
- return TYPE_FN_FIELD_FCONTEXT (f, j);
- }
- }
- for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
- {
- basetype = virtual_context (for_type, TYPE_BASECLASS (type, i), name,
- fn_type, offset);
- if (basetype != for_type)
- return basetype;
- }
- return for_type;
-}
-#endif
-
-/* Copy a pending list, used to record the contents of a common
- block for later fixup. */
-static struct pending *
-copy_pending (beg, begi, end)
- struct pending *beg, *end;
- int begi;
-{
- struct pending *new = 0;
- struct pending *next;
-
- for (next = beg; next != 0 && (next != end || begi < end->nsyms);
- next = next->next, begi = 0)
- {
- register int j;
- for (j = begi; j < next->nsyms; j++)
- add_symbol_to_list (next->symbol[j], &new);
- }
- return new;
-}
-
-/* Register our willingness to decode symbols for SunOS and a.out and
- b.out files handled by BFD... */
-static struct sym_fns sunos_sym_fns = {"sunOs", 6,
- dbx_new_init, dbx_symfile_init, dbx_symfile_read};
-
-static struct sym_fns aout_sym_fns = {"a.out", 5,
- dbx_new_init, dbx_symfile_init, dbx_symfile_read};
-
-static struct sym_fns bout_sym_fns = {"b.out", 5,
- dbx_new_init, dbx_symfile_init, dbx_symfile_read};
-
-void
-_initialize_dbxread ()
-{
- add_symtab_fns(&sunos_sym_fns);
- add_symtab_fns(&aout_sym_fns);
- add_symtab_fns(&bout_sym_fns);
-}
diff --git a/gdb/defs.h b/gdb/defs.h
deleted file mode 100644
index 52d8496..0000000
--- a/gdb/defs.h
+++ /dev/null
@@ -1,296 +0,0 @@
-/* Basic definitions for GDB, the GNU debugger.
- Copyright (C) 1986, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined (DEFS_H)
-#define DEFS_H
-
-/* An address in the program being debugged. Host byte order. */
-typedef unsigned int CORE_ADDR;
-
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#define max(a, b) ((a) > (b) ? (a) : (b))
-
-/* The character C++ uses to build identifiers that must be unique from
- the program's identifiers (such as $this and $$vptr). */
-#define CPLUS_MARKER '$' /* May be overridden to '.' for SysV */
-
-/*
- * Allow things in gdb to be declared "const". If compiling ANSI, it
- * just works. If compiling with gcc but non-ansi, redefine to __const__.
- * If non-ansi, non-gcc, then eliminate "const" entirely, making those
- * objects be read-write rather than read-only.
- */
-#ifndef const
-#ifndef __STDC__
-# ifdef __GNUC__
-# define const __const__
-# else
-# define const /*nothing*/
-# endif /* GNUC */
-#endif /* STDC */
-#endif /* const */
-
-#ifndef volatile
-#ifndef __STDC__
-# ifdef __GNUC__
-# define volatile __volatile__
-# else
-# define volatile /*nothing*/
-# endif /* GNUC */
-#endif /* STDC */
-#endif /* volatile */
-
-extern char *savestring ();
-extern char *strsave ();
-extern char *concat ();
-#ifdef __STDC__
-extern void *xmalloc (), *xrealloc ();
-#else
-extern char *xmalloc (), *xrealloc ();
-#endif
-extern void free ();
-extern int parse_escape ();
-extern char *reg_names[];
-/* Indicate that these routines do not return to the caller. */
-extern volatile void error(), fatal();
-
-/* Various possibilities for alloca. */
-#ifndef alloca
-# ifdef __GNUC__
-# define alloca __builtin_alloca
-# else
-# ifdef sparc
-# include <alloca.h>
-# endif
- extern char *alloca ();
-# endif
-#endif
-
-extern int errno; /* System call error return status */
-
-extern int quit_flag;
-extern int immediate_quit;
-extern void quit ();
-
-#define QUIT { if (quit_flag) quit (); }
-
-/* Notes on classes: class_alias is for alias commands which are not
- abbreviations of the original command. */
-
-enum command_class
-{
- /* Special args to help_list */
- all_classes = -2, all_commands = -1,
- /* Classes of commands */
- no_class = -1, class_run = 0, class_vars, class_stack,
- class_files, class_support, class_info, class_breakpoint,
- class_alias, class_obscure, class_user
-};
-
-/* the cleanup list records things that have to be undone
- if an error happens (descriptors to be closed, memory to be freed, etc.)
- Each link in the chain records a function to call and an
- argument to give it.
-
- Use make_cleanup to add an element to the cleanup chain.
- Use do_cleanups to do all cleanup actions back to a given
- point in the chain. Use discard_cleanups to remove cleanups
- from the chain back to a given point, not doing them. */
-
-struct cleanup
-{
- struct cleanup *next;
- void (*function) ();
- int arg;
-};
-
-/* From utils.c. */
-extern void do_cleanups ();
-extern void discard_cleanups ();
-extern struct cleanup *make_cleanup ();
-extern struct cleanup *save_cleanups ();
-extern void restore_cleanups ();
-extern void free_current_contents ();
-extern int myread ();
-extern int query ();
-extern void wrap_here (
-#ifdef __STDC__
- char *
-#endif
- );
-extern void reinitialize_more_filter ();
-extern void fputs_filtered ();
-extern void puts_filtered ();
-extern void fprintf_filtered ();
-extern void printf_filtered ();
-extern void print_spaces ();
-extern void print_spaces_filtered ();
-extern char *n_spaces ();
-extern void printchar ();
-extern void fprint_symbol ();
-extern void fputs_demangled ();
-extern void perror_with_name ();
-extern void print_sys_errmsg ();
-
-/* From printcmd.c */
-extern void print_address_symbolic ();
-extern void print_address ();
-
-/* From source.c */
-void mod_path (
-#ifdef __STDC__
- char *, char **
-#endif
- );
-
-/* From readline (but not in any readline .h files). */
-extern char *tilde_expand ();
-
-/* Structure for saved commands lines
- (for breakpoints, defined commands, etc). */
-
-struct command_line
-{
- struct command_line *next;
- char *line;
-};
-
-extern struct command_line *read_command_lines ();
-extern void free_command_lines ();
-
-/* String containing the current directory (what getwd would return). */
-
-char *current_directory;
-
-/* Default radixes for input and output. Only some values supported. */
-extern unsigned input_radix;
-extern unsigned output_radix;
-
-/* Baud rate specified for communication with serial target systems. */
-char *baud_rate;
-
-#if !defined (UINT_MAX)
-#define UINT_MAX 0xffffffff
-#endif
-
-#if !defined (LONG_MAX)
-#define LONG_MAX 0x7fffffff
-#endif
-
-#if !defined (INT_MAX)
-#define INT_MAX 0x7fffffff
-#endif
-
-#if !defined (INT_MIN)
-/* Two's complement, 32 bit. */
-#define INT_MIN -0x80000000
-#endif
-
-/* Number of bits in a char or unsigned char for the target machine.
- Just like CHAR_BIT in <limits.h> but describes the target machine. */
-#if !defined (TARGET_CHAR_BIT)
-#define TARGET_CHAR_BIT 8
-#endif
-
-/* Number of bits in a short or unsigned short for the target machine. */
-#if !defined (TARGET_SHORT_BIT)
-#define TARGET_SHORT_BIT (sizeof (short) * TARGET_CHAR_BIT)
-#endif
-
-/* Number of bits in an int or unsigned int for the target machine. */
-#if !defined (TARGET_INT_BIT)
-#define TARGET_INT_BIT (sizeof (int) * TARGET_CHAR_BIT)
-#endif
-
-/* Number of bits in a long or unsigned long for the target machine. */
-#if !defined (TARGET_LONG_BIT)
-#define TARGET_LONG_BIT (sizeof (long) * TARGET_CHAR_BIT)
-#endif
-
-/* Number of bits in a long long or unsigned long long for the target machine. */
-#if !defined (TARGET_LONG_LONG_BIT)
-#define TARGET_LONG_LONG_BIT (2 * TARGET_LONG_BIT)
-#endif
-
-/* Number of bits in a float for the target machine. */
-#if !defined (TARGET_FLOAT_BIT)
-#define TARGET_FLOAT_BIT (sizeof (float) * TARGET_CHAR_BIT)
-#endif
-
-/* Number of bits in a double for the target machine. */
-#if !defined (TARGET_DOUBLE_BIT)
-#define TARGET_DOUBLE_BIT (sizeof (double) * TARGET_CHAR_BIT)
-#endif
-
-/* Number of bits in a long double for the target machine. */
-#if !defined (TARGET_LONG_DOUBLE_BIT)
-#define TARGET_LONG_DOUBLE_BIT (2 * TARGET_DOUBLE_BIT)
-#endif
-
-/* Number of bits in a "complex" for the target machine. */
-#if !defined (TARGET_COMPLEX_BIT)
-#define TARGET_COMPLEX_BIT (2 * TARGET_FLOAT_BIT)
-#endif
-
-/* Number of bits in a "double complex" for the target machine. */
-#if !defined (TARGET_DOUBLE_COMPLEX_BIT)
-#define TARGET_DOUBLE_COMPLEX_BIT (2 * TARGET_DOUBLE_BIT)
-#endif
-
-/* Convert a LONGEST to an int. This is used in contexts (e.g. number
- of arguments to a function, number in a value history, register
- number, etc.) where the value must not be larger than can fit
- in an int. */
-#if !defined (longest_to_int)
-#if defined (LONG_LONG)
-#define longest_to_int(x) (((x) > INT_MAX || (x) < INT_MIN) \
- ? error ("Value out of range.") : (int) (x))
-#else /* No LONG_LONG. */
-/* Assume sizeof (int) == sizeof (long). */
-#define longest_to_int(x) ((int) (x))
-#endif /* No LONG_LONG. */
-#endif /* No longest_to_int. */
-
-/* Languages represented in the symbol table and elsewhere. */
-
-enum language
-{
- language_unknown, /* Language not known */
- language_auto, /* Placeholder for automatic setting */
- language_c, /* C */
- language_m2, /* Modula-2 */
-};
-
-/* Return a format string for printf that will print a number in the local
- (language-specific) hexadecimal format. Result is static and is
- overwritten by the next call. local_hex_format_custom takes printf
- options like "08" or "l" (to produce e.g. %08x or %lx). */
-
-#define local_hex_format() (current_language->la_hex_format)
-char *local_hex_format_custom(); /* language.c */
-
-/* Return a string that contains a number formatted in the local
- (language-specific) hexadecimal format. Result is static and is
- overwritten by the next call. local_hex_string_custom takes printf
- options like "08" or "l". */
-
-char *local_hex_string (); /* language.c */
-char *local_hex_string_custom (); /* language.c */
-
-#endif /* no DEFS_H */
diff --git a/gdb/depend b/gdb/depend
deleted file mode 100755
index 73bff51..0000000
--- a/gdb/depend
+++ /dev/null
@@ -1,12 +0,0 @@
-blockframe.o : blockframe.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- frame.h gdbcore.h ${srcdir}/../include/bfd.h ${srcdir}/../include/ansidecl.h value.h \
- target.h
-breakpoint.o : breakpoint.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status symtab.h \
- frame.h breakpoint.h value.h expression.h gdbcore.h ${srcdir}/../include/bfd.h \
- ${srcdir}/../include/ansidecl.h gdbcmd.h command.h inferior.h target.h language.h
-buildsym.o : buildsym.c defs.h param.h tm.h config.status param-no-tm.h xm.h config.status \
- ${srcdir}/../include/obstack.h symtab.h breakpoint.h value.h gdbcore.h \
- ${srcdir}/../include/bfd.h ${srcdir}/../include/ansidecl.h symfile.h \
- ${srcdir}/../include/stab.gnu.h ${srcdir}/../include/stab.def buildsym.h
-c-exp.tab.o : c-exp.tab.c ${srcdir}/defs.h ${srcdir}/param.h tm.h config.status ${srcdir}/param-no-tm.h xm.h config.status \
- ${srcdir}/symtab.h ${srcdir}/frame.h ${srcdir}/expression.h ${srcdir}/parser-defs.h ${srcdir}/value.h ${srcdir}/language.h
diff --git a/gdb/doc/.Sanitize b/gdb/doc/.Sanitize
deleted file mode 100644
index de85865..0000000
--- a/gdb/doc/.Sanitize
+++ /dev/null
@@ -1,85 +0,0 @@
-# Sanitize.in for devo.
-# $Id$
-#
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-echo Sanitizing `pwd`...
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-Makefile
-all.m4
-amd29k.m4
-gdbinv-m.m4
-gdbinv-s.m4
-gdb.texinfo
-gdbint.texinfo
-gen.m4
-i80386.m4
-i960.m4
-m680x0.m4
-none.m4
-pretex.m4
-rc-cm.tex
-rc-ps.tex
-rc-pslong.tex
-rdl-apps.texi
-refcard.tex
-sparc.m4
-threecol.tex
-vax.m4
-
-Do-last:
-
-echo Done in `pwd`.
-
-#
-#
-# $Log$
-# Revision 2.6 1991/08/23 22:35:41 pesch
-# * rdl-apps.texi: renamed from rdl-apps.texinfo
-#
-# * Makefile, .Sanitize, gdb.texinfo: reflect above name change
-#
-# Revision 2.5 1991/08/22 07:59:45 gnu
-# Keep rdl-apps.texi for users who don't read the doc on how to build the doc.
-#
-# Revision 2.4 1991/08/07 00:15:02 pesch
-# Makefile: GDB documentation nos has its own Makefile
-# .Sanitize: add Makefile; recognize renamed refcard.tex (formerly gdbrc.tex)
-# gdbint.texinfo: add markup in "Cleanups" chapter
-#
-# Revision 2.3 1991/08/01 22:34:55 pesch
-# *** empty log message ***
-#
-# Revision 2.2 1991/07/29 22:38:53 pesch
-# Updated list of files to keep to reflect reintegration of most fragments
-# into gdb.texinfo.
-#
-# Revision 2.1 1991/05/23 21:57:03 rich
-# First cut.
-#
-#
-#
-
-# End of file.
diff --git a/gdb/doc/Makefile b/gdb/doc/Makefile
deleted file mode 100755
index db880a6..0000000
--- a/gdb/doc/Makefile
+++ /dev/null
@@ -1,111 +0,0 @@
-##Copyright (C) 1991 Free Software Foundation, Inc.
-
-# Makefile for GDB documentation.
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# main GDB source directory
-srcdir = ..
-
-# Documentation (gdb.dvi) needs either GNU m4 or SysV m4;
-# Berkeley/Sun don't have quite enough.
-#M4=/usr/5bin/m4
-M4=gm4
-
-# where to find texinfo; GDB dist should include a recent one
-TEXIDIR=${srcdir}/../texinfo/fsf
-
-# where to find makeinfo, preferably one designed for texinfo-2
-MAKEINFO=makeinfo
-
-# Where is the source dir for the READLINE library? Traditionally in .. or .
-# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
-READLINE_DIR = ${srcdir}/../readline
-
-# Main GDB manual's source files
-SFILES_DOCDIR = \
- gdb.texinfo pretex.m4 none.m4 all.m4 gdbinv-m.m4 gdbinv-s.m4 gdbVN.m4
-
-all: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi
-
-clean:
- rm -f gdb.dvi rdl-apps.texi gdb-all* gdb.info* gdbVN.m4
- rm -f gdb-internals gdbint.?? gdbint.???
- rm -f refcard.ps refcard.dvi rcfonts.tex refcard.log *~
-
-# GDB QUICK REFERENCE (TeX dvi file, CM fonts)
-refcard.dvi : refcard.tex
- rm -f rcfonts.tex; cp rc-cm.tex rcfonts.tex
- TEXINPUTS=.:$$TEXINPUTS tex refcard.tex; rm -f refcard.log
- rm -f rcfonts.tex
-
-# GDB QUICK REFERENCE (PostScript output, common PS fonts)
-refcard.ps : refcard.tex
- rm -f rcfonts.tex; cp rc-ps.tex rcfonts.tex
- TEXINPUTS=.:$$TEXINPUTS tex refcard.tex
- dvips -t landscape refcard -o; rm -f refcard.dvi refcard.log
- rm -f rcfonts.tex
-
-# Cover file for "Readline" appendices
-rdl-apps.texi: ${READLINE_DIR}/inc-readline.texinfo \
- ${READLINE_DIR}/inc-history.texinfo
- rm -f rdl-apps.texi
- echo "@include ${READLINE_DIR}/inc-readline.texinfo" >rdl-apps.texi
- echo "@include ${READLINE_DIR}/inc-history.texinfo" >>rdl-apps.texi
-
-# File to record current GDB version number (copied from main dir Makefile.in)
-gdbVN.m4 : ${srcdir}/Makefile.in
- ( VER=`sed <${srcdir}/Makefile.in -n 's/VERSION = //p'` ;\
- echo "_define__(<_GDB_VN__>,$$VER)" > gdbVN.m4 )
-
-# GDB MANUAL: texinfo source, created by preprocessing w/m4
-# Be sure to not create a bad gdb-all.texi if ${M4} is missing or aborts...
-gdb-all.texi: ${SFILES_DOCDIR}
- rm -f foobus.texinfo
- ${M4} pretex.m4 none.m4 all.m4 gdb.texinfo >foobus.texinfo
- rm -f gdb-all.texi
- mv foobus.texinfo gdb-all.texi
-
-# GDB MANUAL: TeX dvi file
-gdb.dvi : gdb-all.texi rdl-apps.texi
- TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-all.texi
- texindex gdb-all.??
- TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-all.texi
- mv gdb-all.dvi gdb.dvi
- rm -f gdb-all.?? gdb-all.???
-
-# GDB MANUAL: info file
-# We're using texinfo2, and older makeinfo's may not be able to
-# cope with all the markup. In the meantime, we distribute the info
-# files
-gdb.info: gdb-all.texi
- ${MAKEINFO} gdb-all.texi
-
-# GDB INTERNALS MANUAL: TeX dvi file
-gdbint.dvi : gdbint.texinfo
- TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo
- texindex gdbint.??
- TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo
- rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \
- gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs
-
-# GDB INTERNALS MANUAL: info file
-gdb-internals : gdbint.texinfo
- ${MAKEINFO} gdbint.texinfo
-
-
-
-
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
deleted file mode 100644
index 628c1cc..0000000
--- a/gdb/doc/Makefile.in
+++ /dev/null
@@ -1,202 +0,0 @@
-##Copyright (C) 1991 Free Software Foundation, Inc.
-
-# Makefile for GDB documentation.
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-srcdir = .
-
-ddestdir = /usr/local
-idestdir = $(ddestdir)
-
-SHELL = /bin/sh
-
-# main GDB source directory
-gdbdir = ..
-
-# Documentation (gdb.dvi) needs either GNU m4 or SysV m4;
-# Berkeley/Sun don't have quite enough.
-#M4=/usr/5bin/m4
-M4=gm4
-
-# where to find texinfo; GDB dist should include a recent one
-TEXIDIR=$(srcdir)/${gdbdir}/../texinfo/fsf
-
-# where to find makeinfo, preferably one designed for texinfo-2
-MAKEINFO=makeinfo
-
-# where to find texi2roff, ditto
-TEXI2ROFF=texi2roff
-
-# Where is the source dir for the READLINE library? Traditionally in .. or .
-# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
-READLINE_DIR = $(srcdir)/${gdbdir}/../readline
-
-# Main GDB manual's source files
-SFILES_DOCDIR = \
- $(srcdir)/gdb.texinfo $(srcdir)/pretex.m4 $(srcdir)/none.m4 \
- $(srcdir)/all.m4 gdbinv-m.m4 gdbinv-s.m4 gdbVN.m4
-
-# Which version of GDB manual? default includes everything
-CONFIG=all
-
-all install:
-
-all-info: gdb.info gdbint.info
-#all: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi
-
-install-info: all-info
- for i in *.info* ; do \
- echo Installing $$i... ; \
- (cp $$i $(idestdir)/info/$$i.n \
- && mv -f $(idestdir)/info/$$i.n $(idestdir)/info/$$i) \
- || exit 1 ; \
- done
-
-clean:
- rm -f gdb.dvi rdl-apps.texi gdb-all* gdb.info* gdbVN.m4
- rm -f gdb-internals gdbint.?? gdbint.??? gdbint.info
- rm -f refcard.ps refcard.dvi rcfonts.tex refcard.log *~
-
-# GDB QUICK REFERENCE (TeX dvi file, CM fonts)
-refcard.dvi : refcard.tex
- rm -f rcfonts.tex; cp rc-cm.tex rcfonts.tex
- TEXINPUTS=.:$$TEXINPUTS tex refcard.tex; rm -f refcard.log
- rm -f rcfonts.tex
-
-# GDB QUICK REFERENCE (PostScript output, common PS fonts)
-refcard.ps : refcard.tex
- rm -f rcfonts.tex; cp rc-ps.tex rcfonts.tex
- TEXINPUTS=.:$$TEXINPUTS tex refcard.tex
- dvips -t landscape refcard -o; rm -f refcard.dvi refcard.log
- rm -f rcfonts.tex
-
-# Cover file for "Readline" appendices
-rdl-apps.texi: ${READLINE_DIR}/inc-read.texi \
- ${READLINE_DIR}/inc-hist.texi
- rm -f rdl-apps.texi
- echo "@include ${READLINE_DIR}/inc-read.texi" >rdl-apps.texi
- echo "@include ${READLINE_DIR}/inc-hist.texi" >>rdl-apps.texi
-
-# File to record current GDB version number (copied from main dir Makefile.in)
-gdbVN.m4 : ${gdbdir}/Makefile.in
- ( VER=`sed <$(srcdir)/${gdbdir}/Makefile.in -n 's/VERSION = //p'` ;\
- echo "_define__(<_GDB_VN__>,$$VER)" > gdbVN.m4 )
-
-# GDB MANUAL: texinfo source, created by preprocessing w/m4
-# If you want other configs in the makefile, add or modify instructions for
-# building source here, then change CONFIG (that way you get info, dvi,
-# roff targets automatically for your config).
-# Be sure to not create a bad gdb-all.texi if ${M4} is missing or aborts...
-gdb-all.texi: ${SFILES_DOCDIR}
- rm -f foobus.texinfo
- ${M4} $(srcdir)/pretex.m4 $(srcdir)/none.m4 $(srcdir)/all.m4 $(srcdir)/gdb.texinfo >foobus.texinfo
- rm -f gdb-all.texi
- mv foobus.texinfo gdb-all.texi
-
-# GDB MANUAL: TeX dvi file
-gdb.dvi : gdb-${CONFIG}.texi rdl-apps.texi
- TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-${CONFIG}.texi
- texindex gdb-${CONFIG}.??
- TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdb-${CONFIG}.texi
- mv gdb-${CONFIG}.dvi gdb.dvi
- rm -f gdb-${CONFIG}.?? gdb-${CONFIG}.???
-
-# GDB MANUAL: info file
-# We're using texinfo2, and older makeinfo's may not be able to
-# cope with all the markup. In the meantime, we distribute the info
-# files
-gdb.info: gdb-${CONFIG}.texi
- $(MAKEINFO) -o gdb.info gdb-${CONFIG}.texi
-
-# GDB MANUAL: roff translations
-# Try to use a recent texi2roff. v2 was put on prep in jan91.
-# If you want an index, see texi2roff doc for postprocessing
-# and add -i to texi2roff invocations below.
-# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
-# correspondint -e lines when later texi2roff's are current)
-# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
-# + @c's deleted explicitly because texi2roff sees texinfo commands in them
-# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
-# + @alphaenumerate is ridiculously new, turned into @enumerate
-
-
-# gdb manual suitable for [tn]roff -mm
-# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
-# try leaving them in
-gdb.mm: gdb-${CONFIG}.texi
- sed -e '/\\input texinfo/d' \
- -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
- -e '/^@ifinfo/,/^@end ifinfo/d' \
- -e '/^@c/d' \
- -e 's/{.*,,/{/' \
- -e '/@noindent/d' \
- -e 's/@ / /g' \
- -e 's/^@alphaenumerate/@enumerate/g' \
- -e 's/^@end alphaenumerate/@end enumerate/g' \
- gdb-${CONFIG}.texi | \
- $(TEXI2ROFF) -mm | \
- sed -e 's/---/\\(em/g' \
- >gdb.mm
-
-# gdb manual suitable for [gtn]roff -me
-gdb.me: gdb-${CONFIG}.texi
- sed -e '/\\input texinfo/d' \
- -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
- -e '/^@ifinfo/,/^@end ifinfo/d' \
- -e '/^@c/d' \
- -e 's/{.*,,/{/' \
- -e 's/@ / /g' \
- -e 's/^@alphaenumerate/@enumerate/g' \
- -e 's/^@end alphaenumerate/@end enumerate/g' \
- gdb-${CONFIG}.texi | \
- $(TEXI2ROFF) -me | \
- sed -e 's/---/\\(em/g' \
- >gdb.me
-
-# gdb manual suitable for [gtn]roff -ms
-gdb.ms: gdb-${CONFIG}.texi
- sed -e '/\\input texinfo/d' \
- -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
- -e '/^@ifinfo/,/^@end ifinfo/d' \
- -e '/^@c/d' \
- -e 's/{.*,,/{/' \
- -e 's/@ / /g' \
- -e 's/^@alphaenumerate/@enumerate/g' \
- -e 's/^@end alphaenumerate/@end enumerate/g' \
- gdb-${CONFIG}.texi | \
- $(TEXI2ROFF) -ms | \
- sed -e 's/---/\\(em/g' \
- >gdb.ms
-
-# GDB INTERNALS MANUAL: TeX dvi file
-gdbint.dvi : gdbint.texinfo
- TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo
- texindex gdbint.??
- TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex gdbint.texinfo
- rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \
- gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs
-
-# GDB INTERNALS MANUAL: info file
-gdb-internals: gdbint.info
-
-gdbint.info: gdbint.texinfo
- $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
-
-force:
-
-Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
- $(SHELL) ./config.status
diff --git a/gdb/doc/all.m4 b/gdb/doc/all.m4
deleted file mode 100644
index 4d97fbe..0000000
--- a/gdb/doc/all.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-_divert__(-1)
-_define__(<_ALL_ARCH__>,<1>)
-_define__(<_GENERIC__>,<1>) In case none.m4 changes its mind abt default
-
-_define__(<_AOUT__>,<1>)
-_define__(<_BOUT__>,<1>)
-_define__(<_COFF__>,<1>)
-_define__(<_ELF__>,<1>)
-
-_define__(<_AMD29K__>,<1>)
-_define__(<_I80386__>,<1>)
-_define__(<_I960__>,<1>)
-_define__(<_M680X0__>,<1>)
-_define__(<_SPARC__>,<1>)
-_define__(<_VAX__>,<1>)
-_define__(<_VXWORKS__>,<1>)
-
-_divert__<> \ No newline at end of file
diff --git a/gdb/doc/amd29k.m4 b/gdb/doc/amd29k.m4
deleted file mode 100644
index cf3ba386..0000000
--- a/gdb/doc/amd29k.m4
+++ /dev/null
@@ -1,5 +0,0 @@
-_divert__(-1)
-_define__(<_AMD29K__>,<1>)
-_define__(<_HOST__>,<AMD 29K>)
-_define__(<_MACH_DEP__>,<AMD29K Dependent>
-_divert__<> \ No newline at end of file
diff --git a/gdb/doc/configure.in b/gdb/doc/configure.in
deleted file mode 100644
index a03a968..0000000
--- a/gdb/doc/configure.in
+++ /dev/null
@@ -1,8 +0,0 @@
-srcname="GDB doc"
-srctrigger=gdb.texinfo
-# per-host:
-
-# per-target:
-
-files="gdbinv-m.m4.in gdbinv-s.m4.in"
-links="gdbinv-m.m4 gdbinv-s.m4"
diff --git a/gdb/doc/gdb.alter-m4 b/gdb/doc/gdb.alter-m4
deleted file mode 100755
index 56007dd..0000000
--- a/gdb/doc/gdb.alter-m4
+++ /dev/null
@@ -1,205 +0,0 @@
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Altering, _GDBN__ Files, Symbols, Top
-@chapter Altering Execution
-
-Once you think you have found an error in the program, you might want to
-find out for certain whether correcting the apparent error would lead to
-correct results in the rest of the run. You can find the answer by
-experiment, using the _GDBN__ features for altering execution of the
-program.
-
-For example, you can store new values into variables or memory
-locations, give the program a signal, restart it at a different address,
-or even return prematurely from a function to its caller.
-
-@menu
-* Assignment:: Assignment to Variables
-* Jumping:: Continuing at a Different Address
-* Signaling:: Giving the Program a Signal
-* Returning:: Returning from a Function
-* Calling:: Calling your Program's Functions
-@end menu
-
-@node Assignment, Jumping, Altering, Altering
-@section Assignment to Variables
-
-@cindex assignment
-@cindex setting variables
-To alter the value of a variable, evaluate an assignment expression.
-@xref{Expressions}. For example,
-
-@example
-print x=4
-@end example
-
-@noindent
-would store the value 4 into the variable @code{x}, and then print the
-value of the assignment expression (which is 4). All the assignment
-operators of C are supported, including the increment operators
-@samp{++} and @samp{--}, and combining assignments such as @samp{+=} and
-_0__@samp{<<=}_1__.
-
-@kindex set
-@kindex set variable
-@cindex variables, setting
-If you are not interested in seeing the value of the assignment, use the
-@code{set} command instead of the @code{print} command. @code{set} is
-really the same as @code{print} except that the expression's value is not
-printed and is not put in the value history (@pxref{Value History}). The
-expression is evaluated only for its effects.
-
-If the beginning of the argument string of the @code{set} command
-appears identical to a @code{set} subcommand, use the @code{set
-variable} command instead of just @code{set}. This command is identical
-to @code{set} except for its lack of subcommands. For example, a
-program might well have a variable @code{width}---which leads to
-an error if we try to set a new value with just @samp{set width=13}, as
-we might if @code{set width} didn't happen to be a _GDBN__ command:
-@example
-(_GDBP__) whatis width
-type = double
-(_GDBP__) p width
-$4 = 13
-(_GDBP__) set width=47
-Invalid syntax in expression.
-@end example
-@noindent
-The invalid expression, of course, is @samp{=47}. What we can do in
-order to actually set our program's variable @code{width} is
-@example
-(_GDBP__) set var width=47
-@end example
-
-_GDBN__ allows more implicit conversions in assignments than C does; you can
-freely store an integer value into a pointer variable or vice versa, and
-any structure can be converted to any other structure that is the same
-length or shorter.
-@comment FIXME: how do structs align/pad in these conversions?
-@comment /pesch@cygnus.com 18dec1990
-
-To store values into arbitrary places in memory, use the @samp{@{@dots{}@}}
-construct to generate a value of specified type at a specified address
-(@pxref{Expressions}). For example, @code{@{int@}0x83040} refers
-to memory location @code{0x83040} as an integer (which implies a certain size
-and representation in memory), and
-
-@example
-set @{int@}0x83040 = 4
-@end example
-
-@noindent
-stores the value 4 into that memory location.
-
-@node Jumping, Signaling, Assignment, Altering
-@section Continuing at a Different Address
-
-Ordinarily, when you continue the program, you do so at the place where
-it stopped, with the @code{continue} command. You can instead continue at
-an address of your own choosing, with the following commands:
-
-@table @code
-@item jump @var{linespec}
-@kindex jump
-Resume execution at line @var{linespec}. Execution will stop
-immediately if there is a breakpoint there. @xref{List} for a
-description of the different forms of @var{linespec}.
-
-The @code{jump} command does not change the current stack frame, or
-the stack pointer, or the contents of any memory location or any
-register other than the program counter. If line @var{linespec} is in
-a different function from the one currently executing, the results may
-be bizarre if the two functions expect different patterns of arguments or
-of local variables. For this reason, the @code{jump} command requests
-confirmation if the specified line is not in the function currently
-executing. However, even bizarre results are predictable if you are
-well acquainted with the machine-language code of the program.
-
-@item jump *@var{address}
-Resume execution at the instruction at address @var{address}.
-@end table
-
-You can get much the same effect as the @code{jump} command by storing a
-new value into the register @code{$pc}. The difference is that this
-does not start the program running; it only changes the address where it
-@emph{will} run when it is continued. For example,
-
-@example
-set $pc = 0x485
-@end example
-
-@noindent
-causes the next @code{continue} command or stepping command to execute at
-address 0x485, rather than at the address where the program stopped.
-@xref{Stepping}.
-
-The most common occasion to use the @code{jump} command is to back up,
-perhaps with more breakpoints set, over a portion of a program that has
-already executed, in order to examine its execution in more detail.
-
-@node Signaling, Returning, Jumping, Altering
-@c @group
-@section Giving the Program a Signal
-
-@table @code
-@item signal @var{signalnum}
-@kindex signal
-Resume execution where the program stopped, but give it immediately the
-signal number @var{signalnum}.
-
-Alternatively, if @var{signalnum} is zero, continue execution without
-giving a signal. This is useful when the program stopped on account of
-a signal and would ordinary see the signal when resumed with the
-@code{continue} command; @samp{signal 0} causes it to resume without a
-signal.
-
-@code{signal} does not repeat when you press @key{RET} a second time
-after executing the command.
-@end table
-@c @end group
-
-@node Returning, Calling, Signaling, Altering
-@section Returning from a Function
-
-@table @code
-@item return
-@itemx return @var{expression}
-@cindex returning from a function
-@kindex return
-You can cancel execution of a function call with the @code{return}
-command. If you give an
-@var{expression} argument, its value is used as the function's return
-value.
-@end table
-
-When you use @code{return}, _GDBN__ discards the selected stack frame
-(and all frames within it). You can think of this as making the
-discarded frame return prematurely. If you wish to specify a value to
-be returned, give that value as the argument to @code{return}.
-
-This pops the selected stack frame (@pxref{Selection}), and any other
-frames inside of it, leaving its caller as the innermost remaining
-frame. That frame becomes selected. The specified value is stored in
-the registers used for returning values of functions.
-
-The @code{return} command does not resume execution; it leaves the
-program stopped in the state that would exist if the function had just
-returned. In contrast, the @code{finish} command (@pxref{Stepping})
-resumes execution until the selected stack frame returns naturally.
-
-@node Calling, , Returning, Altering
-@section Calling your Program's Functions
-
-@cindex calling functions
-@kindex call
-@table @code
-@item call @var{expr}
-Evaluate the expression @var{expr} without displaying @code{void}
-returned values.
-@end table
-
-You can use this variant of the @code{print} command if you want to
-execute a function from your program, but without cluttering the output
-with @code{void} returned values. The result is printed and saved in
-the value history, if it is not void.
diff --git a/gdb/doc/gdb.bugs-m4 b/gdb/doc/gdb.bugs-m4
deleted file mode 100755
index 9647926..0000000
--- a/gdb/doc/gdb.bugs-m4
+++ /dev/null
@@ -1,221 +0,0 @@
-_dnl__ Copyright (c) 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node _GDBN__ Bugs, Renamed Commands, Emacs, Top
-@chapter Reporting Bugs in _GDBN__
-@cindex Bugs in _GDBN__
-@cindex Reporting Bugs in _GDBN__
-
-Your bug reports play an essential role in making _GDBN__ reliable.
-
-Reporting a bug may help you by bringing a solution to your problem, or it
-may not. But in any case the principal function of a bug report is to help
-the entire community by making the next version of _GDBN__ work better. Bug
-reports are your contribution to the maintenance of _GDBN__.
-
-In order for a bug report to serve its purpose, you must include the
-information that enables us to fix the bug.
-
-@menu
-* Bug Criteria:: Have You Found a Bug?
-* Bug Reporting:: How to Report Bugs
-@end menu
-
-@node Bug Criteria, Bug Reporting, _GDBN__ Bugs, _GDBN__ Bugs
-@section Have You Found a Bug?
-@cindex Bug Criteria
-
-If you are not sure whether you have found a bug, here are some guidelines:
-
-@itemize @bullet
-@item
-@cindex Fatal Signal
-@cindex Core Dump
-If the debugger gets a fatal signal, for any input whatever, that is a
-_GDBN__ bug. Reliable debuggers never crash.
-
-@item
-@cindex error on Valid Input
-If _GDBN__ produces an error message for valid input, that is a bug.
-
-@item
-@cindex Invalid Input
-If _GDBN__ does not produce an error message for invalid input,
-that is a bug. However, you should note that your idea of
-``invalid input'' might be our idea of ``an extension'' or ``support
-for traditional practice''.
-
-@item
-If you are an experienced user of debugging tools, your suggestions
-for improvement of _GDBN__ are welcome in any case.
-@end itemize
-
-@node Bug Reporting, , Bug Criteria, _GDBN__ Bugs
-@section How to Report Bugs
-@cindex Bug Reports
-@cindex Compiler Bugs, Reporting
-
-A number of companies and individuals offer support for GNU products.
-If you obtained _GDBN__ from a support organization, we recommend you
-contact that organization first.
-
-Contact information for many support companies and individuals is
-available in the file @file{etc/SERVICE} in the GNU Emacs distribution.
-
-In any event, we also recommend that you send bug reports for _GDBN__ to one
-of these addresses:
-
-@example
-bug-gdb@@prep.ai.mit.edu
-@{ucbvax|mit-eddie|uunet@}!prep.ai.mit.edu!bug-gdb
-@end example
-
-@strong{Do not send bug reports to @samp{info-gdb}, or to
-@samp{help-gdb}, or to any newsgroups.} Most users of _GDBN__ do not want to
-receive bug reports. Those that do, have arranged to receive @samp{bug-gdb}.
-
-The mailing list @samp{bug-gdb} has a newsgroup which serves as a
-repeater. The mailing list and the newsgroup carry exactly the same
-messages. Often people think of posting bug reports to the newsgroup
-instead of mailing them. This appears to work, but it has one problem
-which can be crucial: a newsgroup posting often lacks a mail path
-back to the sender. Thus, if we need to ask for more information, we
-may be unable to reach you. For this reason, it is better to send bug
-reports to the mailing list.
-
-As a last resort, send bug reports on paper to:
-
-@example
-GNU Debugger Bugs
-545 Tech Square
-Cambridge, MA 02139
-@end example
-
-The fundamental principle of reporting bugs usefully is this:
-@strong{report all the facts}. If you are not sure whether to state a
-fact or leave it out, state it!
-
-Often people omit facts because they think they know what causes the
-problem and assume that some details don't matter. Thus, you might
-assume that the name of the variable you use in an example does not matter.
-Well, probably it doesn't, but one cannot be sure. Perhaps the bug is a
-stray memory reference which happens to fetch from the location where that
-name is stored in memory; perhaps, if the name were different, the contents
-of that location would fool the debugger into doing the right thing despite
-the bug. Play it safe and give a specific, complete example. That is the
-easiest thing for you to do, and the most helpful.
-
-Keep in mind that the purpose of a bug report is to enable us to fix
-the bug if it is new to us. It isn't as important what happens if
-the bug is already known. Therefore, always write your bug reports on
-the assumption that the bug has not been reported previously.
-
-Sometimes people give a few sketchy facts and ask, ``Does this ring a
-bell?'' Those bug reports are useless, and we urge everyone to
-@emph{refuse to respond to them} except to chide the sender to report
-bugs properly.
-
-To enable us to fix the bug, you should include all these things:
-
-@itemize @bullet
-@item
-The version of _GDBN__. _GDBN__ announces it if you start with no
-arguments; you can also print it at any time using @code{show version}.
-
-Without this, we won't know whether there is any point in looking for
-the bug in the current version of _GDBN__.
-
-@item
-A complete input script, and all necessary source files, that will
-reproduce the bug.
-
-@item
-What compiler (and its version) was used to compile _GDBN__---e.g.
-``_GCC__-1.37.1''.
-
-@item
-The command arguments you gave the compiler to compile your example and
-observe the bug. For example, did you use @samp{-O}? To guarantee
-you won't omit something important, list them all.
-
-If we were to try to guess the arguments, we would probably guess wrong
-and then we might not encounter the bug.
-
-@item
-The type of machine you are using, and the operating system name and
-version number.
-
-@item
-A description of what behavior you observe that you believe is
-incorrect. For example, ``It gets a fatal signal.''
-
-Of course, if the bug is that _GDBN__ gets a fatal signal, then we will
-certainly notice it. But if the bug is incorrect output, we might not
-notice unless it is glaringly wrong. We are human, after all. You
-might as well not give us a chance to make a mistake.
-
-Even if the problem you experience is a fatal signal, you should still
-say so explicitly. Suppose something strange is going on, such as,
-your copy of _GDBN__ is out of synch, or you have encountered a
-bug in the C library on your system. (This has happened!) Your copy
-might crash and ours would not. If you told us to expect a crash,
-then when ours fails to crash, we would know that the bug was not
-happening for us. If you had not told us to expect a crash, then we
-would not be able to draw any conclusion from our observations.
-
-@item
-If you wish to suggest changes to the _GDBN__ source, send us context
-diffs. If you even discuss something in the _GDBN__ source, refer to
-it by context, not by line number.
-
-The line numbers in our development sources won't match those in your
-sources. Your line numbers would convey no useful information to us.
-
-@end itemize
-
-Here are some things that are not necessary:
-
-@itemize @bullet
-@item
-A description of the envelope of the bug.
-
-Often people who encounter a bug spend a lot of time investigating
-which changes to the input file will make the bug go away and which
-changes will not affect it.
-
-This is often time consuming and not very useful, because the way we
-will find the bug is by running a single example under the debugger
-with breakpoints, not by pure deduction from a series of examples.
-We recommend that you save your time for something else.
-
-Of course, if you can find a simpler example to report @emph{instead}
-of the original one, that is a convenience for us. Errors in the
-output will be easier to spot, running under the debugger will take
-less time, etc.
-
-However, simplification is not vital; if you don't want to do this,
-report the bug anyway and send us the entire test case you used.
-
-@item
-A patch for the bug.
-
-A patch for the bug does help us if it is a good one. But don't omit
-the necessary information, such as the test case, on the assumption that
-a patch is all we need. We might see problems with your patch and decide
-to fix the problem another way, or we might not understand it at all.
-
-Sometimes with a program as complicated as _GDBN__ it is very hard to
-construct an example that will make the program follow a certain path
-through the code. If you don't send us the example, we won't be able
-to construct one, so we won't be able to verify that the bug is fixed.
-
-And if we can't understand what bug you are trying to fix, or why your
-patch should be an improvement, we won't install it. A test case will
-help us to understand.
-
-@item
-A guess about what the bug is or what it depends on.
-
-Such guesses are usually wrong. Even we can't guess right about such
-things without first using the debugger to find the facts.
-@end itemize
diff --git a/gdb/doc/gdb.canned-m4 b/gdb/doc/gdb.canned-m4
deleted file mode 100755
index 4cbb8f4..0000000
--- a/gdb/doc/gdb.canned-m4
+++ /dev/null
@@ -1,178 +0,0 @@
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Sequences, Emacs, Controlling _GDBN__, Top
-@chapter Canned Sequences of Commands
-
-Aside from breakpoint commands (@pxref{Break Commands}), _GDBN__ provides two
-ways to store sequences of commands for execution as a unit:
-user-defined commands and command files.
-
-@menu
-* Define:: User-Defined Commands
-* Command Files:: Command Files
-* Output:: Commands for Controlled Output
-@end menu
-
-@node Define, Command Files, Sequences, Sequences
-@section User-Defined Commands
-
-@cindex user-defined command
-A @dfn{user-defined command} is a sequence of _GDBN__ commands to which you
-assign a new name as a command. This is done with the @code{define}
-command.
-
-@table @code
-@item define @var{commandname}
-@kindex define
-Define a command named @var{commandname}. If there is already a command
-by that name, you are asked to confirm that you want to redefine it.
-
-The definition of the command is made up of other _GDBN__ command lines,
-which are given following the @code{define} command. The end of these
-commands is marked by a line containing @code{end}.
-
-@item document @var{commandname}
-@kindex document
-Give documentation to the user-defined command @var{commandname}. The
-command @var{commandname} must already be defined. This command reads
-lines of documentation just as @code{define} reads the lines of the
-command definition, ending with @code{end}. After the @code{document}
-command is finished, @code{help} on command @var{commandname} will print
-the documentation you have specified.
-
-You may use the @code{document} command again to change the
-documentation of a command. Redefining the command with @code{define}
-does not change the documentation.
-
-@item help user-defined
-@kindex help user-defined
-List all user-defined commands, with the first line of the documentation
-(if any) for each.
-
-@item info user
-@itemx info user @var{commandname}
-@kindex info user
-Display the _GDBN__ commands used to define @var{commandname} (but not its
-documentation). If no @var{commandname} is given, display the
-definitions for all user-defined commands.
-@end table
-
-User-defined commands do not take arguments. When they are executed, the
-commands of the definition are not printed. An error in any command
-stops execution of the user-defined command.
-
-Commands that would ask for confirmation if used interactively proceed
-without asking when used inside a user-defined command. Many _GDBN__ commands
-that normally print messages to say what they are doing omit the messages
-when used in a user-defined command.
-
-@node Command Files, Output, Define, Sequences
-@section Command Files
-
-@cindex command files
-A command file for _GDBN__ is a file of lines that are _GDBN__ commands. Comments
-(lines starting with @kbd{#}) may also be included. An empty line in a
-command file does nothing; it does not mean to repeat the last command, as
-it would from the terminal.
-
-@cindex init file
-@cindex @file{_GDBINIT__}
-When you start _GDBN__, it automatically executes commands from its
-@dfn{init files}. These are files named @file{_GDBINIT__}. _GDBN__
-reads the init file (if any) in your home directory and then the init
-file (if any) in the current working directory. (The init files are not
-executed if you use the @samp{-nx} option; @pxref{Mode Options}.) You
-can also request the execution of a command file with the @code{source}
-command:
-
-@table @code
-@item source @var{filename}
-@kindex source
-Execute the command file @var{filename}.
-@end table
-
-The lines in a command file are executed sequentially. They are not
-printed as they are executed. An error in any command terminates execution
-of the command file.
-
-Commands that would ask for confirmation if used interactively proceed
-without asking when used in a command file. Many _GDBN__ commands that
-normally print messages to say what they are doing omit the messages
-when called from command files.
-
-@node Output, , Command Files, Sequences
-@section Commands for Controlled Output
-
-During the execution of a command file or a user-defined command, normal
-_GDBN__ output is suppressed; the only output that appears is what is
-explicitly printed by the commands in the definition. This section
-describes three commands useful for generating exactly the output you
-want.
-
-@table @code
-@item echo @var{text}
-@kindex echo
-@c I don't consider backslash-space a standard C escape sequence
-@c because it's not in ANSI.
-Print @var{text}. Nonprinting characters can be included in @var{text}
-using C escape sequences, such as @samp{\n} to print a newline. @b{No
-newline will be printed unless you specify one.} In addition to the
-standard C escape sequences, a backslash followed by a space stands for a
-space. This is useful for outputting a string with spaces at the
-beginning or the end, since leading and trailing spaces are otherwise
-trimmed from all arguments. Thus, to print @samp{@ and foo =@ }, use the
-command @samp{echo \@ and foo = \@ }.
-@c FIXME: verify hard copy actually issues enspaces for '@ '! Will this
-@c confuse texinfo?
-
-A backslash at the end of @var{text} can be used, as in C, to continue
-the command onto subsequent lines. For example,
-
-@example
-echo This is some text\n\
-which is continued\n\
-onto several lines.\n
-@end example
-
-produces the same output as
-
-@example
-echo This is some text\n
-echo which is continued\n
-echo onto several lines.\n
-@end example
-
-@item output @var{expression}
-@kindex output
-Print the value of @var{expression} and nothing but that value: no
-newlines, no @samp{$@var{nn} = }. The value is not entered in the
-value history either. @xref{Expressions} for more information on
-expressions.
-
-@item output/@var{fmt} @var{expression}
-Print the value of @var{expression} in format @var{fmt}. You can use
-the same formats as for @code{print}; @pxref{Output formats}, for more
-information.
-
-@item printf @var{string}, @var{expressions}@dots{}
-@kindex printf
-Print the values of the @var{expressions} under the control of
-@var{string}. The @var{expressions} are separated by commas and may
-be either numbers or pointers. Their values are printed as specified
-by @var{string}, exactly as if the program were to execute
-
-@example
-printf (@var{string}, @var{expressions}@dots{});
-@end example
-
-For example, you can print two values in hex like this:
-
-@example
-printf "foo, bar-foo = 0x%x, 0x%x\n", foo, bar-foo
-@end example
-
-The only backslash-escape sequences that you can use in the format
-string are the simple ones that consist of backslash followed by a
-letter.
-@end table
diff --git a/gdb/doc/gdb.cmds-m4 b/gdb/doc/gdb.cmds-m4
deleted file mode 100755
index 1020258..0000000
--- a/gdb/doc/gdb.cmds-m4
+++ /dev/null
@@ -1,160 +0,0 @@
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Commands, Running, Invocation, Top
-@chapter _GDBN__ Commands
-
-@menu
-* Command Syntax:: Command Syntax
-* Help:: Getting Help
-@end menu
-
-@node Command Syntax, Help, Commands, Commands
-@section Command Syntax
-A _GDBN__ command is a single line of input. There is no limit on how long
-it can be. It starts with a command name, which is followed by arguments
-whose meaning depends on the command name. For example, the command
-@code{step} accepts an argument which is the number of times to step,
-as in @samp{step 5}. You can also use the @code{step} command with
-no arguments. Some command names do not allow any arguments.
-
-@cindex abbreviation
-_GDBN__ command names may always be truncated if that abbreviation is
-unambiguous. Other possible command abbreviations are listed in the
-documentation for individual commands. Sometimes even ambiguous
-abbreviations are allowed; for example, @code{s} is specially defined as
-equivalent to @code{step} even though there are other commands whose
-names start with @code{s}.
-
-@cindex repeating commands
-A blank line as input to _GDBN__ means to repeat the previous command.
-Certain commands (for example, @code{run}) will not repeat this way;
-these are commands for which unintentional repetition might cause
-trouble and which you are unlikely to want to repeat.
-
-The @code{list} and @code{x} commands construct new arguments when
-repeated, rather than repeating exactly as typed, to permit easy
-scanning of source or memory.
-
-@kindex #
-@cindex comment
-A line of input starting with @kbd{#} is a comment; it does nothing.
-This is useful mainly in command files (@xref{Command Files}).
-
-@node Help, , Command Syntax, Commands
-@section Getting Help
-@cindex online documentation
-@kindex help
-You can always ask _GDBN__ itself for information on its commands, using the
-command @code{help}.
-
-@table @code
-@item help
-@itemx h
-@kindex h
-You can use @code{help} (abbreviated @code{h}) with no arguments to
-display a short list of named categories of commands:
-@smallexample
-(_GDBP__) help
-List of classes of commands:
-
-running -- Running the program
-stack -- Examining the stack
-data -- Examining data
-breakpoints -- Making program stop at certain points
-files -- Specifying and examining files
-status -- Status inquiries
-support -- Support facilities
-user-defined -- User-defined commands
-aliases -- Aliases of other commands
-obscure -- Obscure features
-
-Type "help" followed by a class name for a list of commands in that class.
-Type "help" followed by command name for full documentation.
-Command name abbreviations are allowed if unambiguous.
-(_GDBP__)
-@end smallexample
-
-@item help @var{category}
-Using one of the general help categories as an argument, you can get a
-list of the individual commands in a category. For example, here is the
-help display for category @code{status}:
-@smallexample
-(_GDBP__) help status
-Status inquiries.
-
-List of commands:
-
-show -- Generic command for showing things set with "set"
-info -- Generic command for printing status
-
-Type "help" followed by command name for full documentation.
-Command name abbreviations are allowed if unambiguous.
-(_GDBP__)
-@end smallexample
-
-@item help @var{command}
-With a command name as @code{help} argument, _GDBN__ will display a
-short paragraph on how to use that command.
-@end table
-
-In addition to @code{help}, you can use the _GDBN__ commands @code{info}
-and @code{show} to inquire about the state of your program, or the state
-of _GDBN__ itself. Both commands support many topics of inquiry; this
-manual introduces each of them in the appropriate context. The listings
-under @code{info} and under @code{show} in the Index point to
-all the sub-commands.
-@c FIXME: @pxref{Index} used to be here, but even though it shows up in
-@c FIXME...the 'aux' file with a pageno the xref can't find it.
-
-@c @group
-@table @code
-@item info
-@kindex info
-@kindex i
-This command (abbreviated @code{i}) is for describing the state of your
-program; for example, it can list the arguments given to your program
-(@code{info args}), the registers currently in use (@code{info
-registers}), or the breakpoints you've set (@code{info breakpoints}).
-You can get a complete list of the @code{info} sub-commands with
-@w{@code{help info}}.
-
-@kindex show
-@item show
-In contrast, @code{show} is for describing the state of _GDBN__ itself.
-You can change most of the things you can @code{show}, by using the
-related command @code{set}; for example, you can control what number
-system is used for displays with @code{set radix}, or simply inquire
-which is currently in use with @code{show radix}.
-
-@kindex info set
-To display all the settable parameters and their current
-values, you can use @code{show} with no arguments; you may also use
-@code{info set}. Both commands produce the same display.
-@c FIXME: "info set" violates the rule that "info" is for state of
-@c FIXME...program. Ck w/ GNU: "info set" to be called something else,
-@c FIXME...or change desc of rule---eg "state of prog and debugging session"?
-@end table
-@c @end group
-
-Here are three miscellaneous @code{show} subcommands, all of which are
-exceptional in lacking corresponding @code{set} commands:
-
-@table @code
-@kindex show version
-@item show version
-Show what version of _GDBN__ is running. You should include this
-information in _GDBN__ bug-reports. If multiple versions of _GDBN__ are
-in use at your site, you may occasionally want to make sure what version
-of _GDBN__ you're running; as _GDBN__ evolves, new commands are
-introduced, and old ones may wither away. The version number is also
-announced when you start _GDBN__ with no arguments.
-
-@kindex show copying
-@item show copying
-Display information about permission for copying _GDBN__.
-
-@kindex show warranty
-@item show warranty
-Display the GNU ``NO WARRANTY'' statement.
-@end table
diff --git a/gdb/doc/gdb.ctl-m4 b/gdb/doc/gdb.ctl-m4
deleted file mode 100755
index 4ff4a16..0000000
--- a/gdb/doc/gdb.ctl-m4
+++ /dev/null
@@ -1,306 +0,0 @@
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Controlling _GDBN__, Sequences, Targets, Top
-@chapter Controlling _GDBN__
-
-You can alter many aspects of _GDBN__'s interaction with you by using
-the @code{set} command. For commands controlling how _GDBN__ displays
-data, @pxref{Print Settings}; other settings are described here.
-
-@menu
-* Prompt:: Prompt
-* Editing:: Command Editing
-* History:: Command History
-* Screen Size:: Screen Size
-* Numbers:: Numbers
-* Messages/Warnings:: Optional Warnings and Messages
-@end menu
-
-@node Prompt, Editing, Controlling _GDBN__, Controlling _GDBN__
-@section Prompt
-@cindex prompt
-_GDBN__ indicates its readiness to read a command by printing a string
-called the @dfn{prompt}. This string is normally @samp{(_GDBP__)}. You
-can change the prompt string with the @code{set prompt} command. For
-instance, when debugging _GDBN__ with _GDBN__, it is useful to change
-the prompt in one of the _GDBN__<>s so that you can always tell which
-one you are talking to.
-
-@table @code
-@item set prompt @var{newprompt}
-@kindex set prompt
-Directs _GDBN__ to use @var{newprompt} as its prompt string henceforth.
-@kindex show prompt
-@item show prompt
-Prints a line of the form: @samp{Gdb's prompt is: @var{your-prompt}}
-@end table
-
-@node Editing, History, Prompt, Controlling _GDBN__
-@section Command Editing
-@cindex readline
-@cindex command line editing
-_GDBN__ reads its input commands via the @dfn{readline} interface. This
-GNU library provides consistent behavior for programs which provide a
-command line interface to the user. Advantages are @code{emacs}-style
-or @code{vi}-style inline editing of commands, @code{csh}-like history
-substitution, and a storage and recall of command history across
-debugging sessions.
-
-You may control the behavior of command line editing in _GDBN__ with the
-command @code{set}.
-
-@table @code
-@kindex set editing
-@cindex editing
-@item set editing
-@itemx set editing on
-Enable command line editing (enabled by default).
-
-@item set editing off
-Disable command line editing.
-
-@kindex show editing
-@item show editing
-Show whether command line editing is enabled.
-@end table
-
-@node History, Screen Size, Editing, Controlling _GDBN__
-@section Command History
-@table @code
-@cindex history substitution
-@cindex history file
-@kindex set history filename
-@item set history filename @var{fname}
-Set the name of the _GDBN__ command history file to @var{fname}. This is
-the file from which _GDBN__ will read an initial command history
-list or to which it will write this list when it exits. This list is
-accessed through history expansion or through the history
-command editing characters listed below. This file defaults to the
-value of the environment variable @code{GDBHISTFILE}, or to
-@file{./.gdb_history} if this variable is not set.
-
-@cindex history save
-@kindex set history save
-@item set history save
-@itemx set history save on
-Record command history in a file, whose name may be specified with the
-@code{set history filename} command. By default, this option is disabled.
-
-@item set history save off
-Stop recording command history in a file.
-
-@cindex history size
-@kindex set history size
-@item set history size @var{size}
-Set the number of commands which _GDBN__ will keep in its history list.
-This defaults to the value of the environment variable
-@code{HISTSIZE}, or to 256 if this variable is not set.
-@end table
-
-@cindex history expansion
-History expansion assigns special meaning to the character @kbd{!}.
-@iftex
-(@xref{Event Designators}.)
-@end iftex
-Since @kbd{!} is also the logical not operator in C, history expansion
-is off by default. If you decide to enable history expansion with the
-@code{set history expansion on} command, you may sometimes need to
-follow @kbd{!} (when it is used as logical not, in an expression) with
-a space or a tab to prevent it from being expanded. The readline
-history facilities will not attempt substitution on the strings
-@kbd{!=} and @kbd{!(}, even when history expansion is enabled.
-
-The commands to control history expansion are:
-
-@table @code
-
-@kindex set history expansion
-@item set history expansion on
-@itemx set history expansion
-Enable history expansion. History expansion is off by default.
-
-@item set history expansion off
-Disable history expansion.
-
-The readline code comes with more complete documentation of
-editing and history expansion features. Users unfamiliar with @code{emacs}
-or @code{vi} may wish to read it.
-@iftex
-@xref{Command Line Editing}.
-@end iftex
-
-@c @group
-@kindex show history
-@item show history
-@itemx show history filename
-@itemx show history save
-@itemx show history size
-@itemx show history expansion
-These commands display the state of the _GDBN__ history parameters.
-@code{show history} by itself displays all four states.
-@c @end group
-
-@end table
-
-@table @code
-@kindex show commands
-@item show commands
-Display the last ten commands in the command history.
-
-@item show commands @var{n}
-Print ten commands centered on command number @var{n}.
-
-@item show commands +
-Print ten commands just after the commands last printed.
-
-@end table
-
-@node Screen Size, Numbers, History, Controlling _GDBN__
-@section Screen Size
-@cindex size of screen
-@cindex pauses in output
-Certain commands to _GDBN__ may produce large amounts of information
-output to the screen. To help you read all of it, _GDBN__ pauses and
-asks you for input at the end of each page of output. Type @key{RET}
-when you want to continue the output. _GDBN__ also uses the screen
-width setting to determine when to wrap lines of output. Depending on
-what is being printed, it tries to break the line at a readable place,
-rather than simply letting it overflow onto the following line.
-
-Normally _GDBN__ knows the size of the screen from the termcap data base
-together with the value of the @code{TERM} environment variable and the
-@code{stty rows} and @code{stty cols} settings. If this is not correct,
-you can override it with the @code{set height} and @code{set
-width} commands:
-
-@table @code
-@item set height @var{lpp}
-@itemx show height
-@itemx set width @var{cpl}
-@itemx show width
-@kindex set height
-@kindex set width
-@kindex show width
-@kindex show height
-These @code{set} commands specify a screen height of @var{lpp} lines and
-a screen width of @var{cpl} characters. The associated @code{show}
-commands display the current settings.
-
-If you specify a height of zero lines, _GDBN__ will not pause during output
-no matter how long the output is. This is useful if output is to a file
-or to an editor buffer.
-@end table
-
-@node Numbers, Messages/Warnings, Screen Size, Controlling _GDBN__
-@section Numbers
-@cindex number representation
-@cindex entering numbers
-You can always enter numbers in octal, decimal, or hexadecimal in _GDBN__ by
-the usual conventions: octal numbers begin with @samp{0}, decimal
-numbers end with @samp{.}, and hexadecimal numbers begin with @samp{0x}.
-Numbers that begin with none of these are, by default, entered in base
-10; likewise, the default display for numbers---when no particular
-format is specified---is base 10. You can change the default base for
-both input and output with the @code{set radix} command.
-
-@table @code
-@kindex set radix
-@item set radix @var{base}
-Set the default base for numeric input and display. Supported choices
-for @var{base} are decimal 8, 10, 16. @var{base} must itself be
-specified either unambiguously or using the current default radix; for
-example, any of
-
-@example
-set radix 012
-set radix 10.
-set radix 0xa
-@end example
-
-@noindent
-will set the base to decimal. On the other hand, @samp{set radix 10}
-will leave the radix unchanged no matter what it was.
-
-@kindex show radix
-@item show radix
-Display the current default base for numeric input and display.
-
-@end table
-
-@node Messages/Warnings, , Numbers, Controlling _GDBN__
-@section Optional Warnings and Messages
-By default, _GDBN__ is silent about its inner workings. If you are running
-on a slow machine, you may want to use the @code{set verbose} command.
-It will make _GDBN__ tell you when it does a lengthy internal operation, so
-you won't think it has crashed.
-
-Currently, the messages controlled by @code{set verbose} are those which
-announce that the symbol table for a source file is being read
-(@pxref{Files}, in the description of the command
-@code{symbol-file}).
-@c The following is the right way to do it, but emacs 18.55 doesn't support
-@c @ref, and neither the emacs lisp manual version of texinfmt or makeinfo
-@c is released.
-@ignore
-see @code{symbol-file} in @ref{Files}).
-@end ignore
-
-@table @code
-@kindex set verbose
-@item set verbose on
-Enables _GDBN__'s output of certain informational messages.
-
-@item set verbose off
-Disables _GDBN__'s output of certain informational messages.
-
-@kindex show verbose
-@item show verbose
-Displays whether @code{set verbose} is on or off.
-@end table
-
-By default, if _GDBN__ encounters bugs in the symbol table of an object file,
-it prints a single message about each type of problem it finds, then
-shuts up (@pxref{Symbol Errors}). You can suppress these messages, or allow more than one such
-message to be printed if you want to see how frequent the problems are.
-
-@table @code
-@kindex set complaints
-@item set complaints @var{limit}
-Permits _GDBN__ to output @var{limit} complaints about each type of unusual
-symbols before becoming silent about the problem. Set @var{limit} to
-zero to suppress all complaints; set it to a large number to prevent
-complaints from being suppressed.
-
-@kindex show complaints
-@item show complaints
-Displays how many symbol complaints _GDBN__ is permitted to produce.
-@end table
-
-By default, _GDBN__ is cautious, and asks what sometimes seem to be a
-lot of stupid questions to confirm certain commands. For example, if
-you try to run a program which is already running:
-@example
-(_GDBP__) run
-The program being debugged has been started already.
-Start it from the beginning? (y or n)
-@end example
-
-If you're willing to unflinchingly face the consequences of your own
-commands, you can disable this ``feature'':
-
-@table @code
-@kindex set confirm
-@cindex flinching
-@cindex confirmation
-@cindex stupid questions
-@item set confirm off
-Disables confirmation requests.
-
-@item set confirm on
-Enables confirmation requests (the default).
-
-@item show confirm
-@kindex show confirm
-Displays state of confirmation requests.
-@end table
diff --git a/gdb/doc/gdb.data-m4 b/gdb/doc/gdb.data-m4
deleted file mode 100755
index 9c74f60..0000000
--- a/gdb/doc/gdb.data-m4
+++ /dev/null
@@ -1,926 +0,0 @@
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Data, Symbols, Source, Top
-@chapter Examining Data
-
-@cindex printing data
-@cindex examining data
-@kindex print
-@kindex inspect
-@c "inspect" isn't quite a synonym if you're using Epoch, which we don't
-@c document because it's nonstandard... Under Epoch it displays in a
-@c different window or something like that.
-The usual way to examine data in your program is with the @code{print}
-command (abbreviated @code{p}), or its synonym @code{inspect}. It
-evaluates and prints the value of any valid expression of the language
-the program is written in (for now, C or C++). You type
-
-@example
-print @var{exp}
-@end example
-
-@noindent
-where @var{exp} is any valid expression (in the source language), and
-the value of @var{exp} is printed in a format appropriate to its data
-type.
-
-A more low-level way of examining data is with the @code{x} command.
-It examines data in memory at a specified address and prints it in a
-specified format. @xref{Memory}.
-
-@menu
-* Expressions:: Expressions
-* Variables:: Program Variables
-* Arrays:: Artificial Arrays
-* Output formats:: Output formats
-* Memory:: Examining Memory
-* Auto Display:: Automatic Display
-* Print Settings:: Print Settings
-* Value History:: Value History
-* Convenience Vars:: Convenience Variables
-* Registers:: Registers
-* Floating Point Hardware:: Floating Point Hardware
-@end menu
-
-@node Expressions, Variables, Data, Data
-@section Expressions
-
-@cindex expressions
-@code{print} and many other _GDBN__ commands accept an expression and
-compute its value. Any kind of constant, variable or operator defined
-by the programming language you are using is legal in an expression in
-_GDBN__. This includes conditional expressions, function calls, casts
-and string constants. It unfortunately does not include symbols defined
-by preprocessor @code{#define} commands, or C++ expressions involving
-@samp{::}, the name resolution operator.
-@c FIXME: actually C++ a::b works except in obscure circumstances where it
-@c FIXME...can conflict with GDB's own name scope resolution.
-
-Casts are supported in all languages, not just in C, because it is so
-useful to cast a number into a pointer so as to examine a structure
-at that address in memory.
-
-_GDBN__ supports three kinds of operator in addition to those of programming
-languages:
-
-@table @code
-@item @@
-@samp{@@} is a binary operator for treating parts of memory as arrays.
-@xref{Arrays}, for more information.
-
-@item ::
-@samp{::} allows you to specify a variable in terms of the file or
-function where it is defined. @xref{Variables}.
-
-@item @{@var{type}@} @var{addr}
-Refers to an object of type @var{type} stored at address @var{addr} in
-memory. @var{addr} may be any expression whose value is an integer or
-pointer (but parentheses are required around binary operators, just as in
-a cast). This construct is allowed regardless of what kind of data is
-normally supposed to reside at @var{addr}.@refill
-@end table
-
-@node Variables, Arrays, Expressions, Data
-@section Program Variables
-
-The most common kind of expression to use is the name of a variable
-in your program.
-
-Variables in expressions are understood in the selected stack frame
-(@pxref{Selection}); they must either be global (or static) or be visible
-according to the scope rules of the programming language from the point of
-execution in that frame. This means that in the function
-
-@example
-foo (a)
- int a;
-@{
- bar (a);
- @{
- int b = test ();
- bar (b);
- @}
-@}
-@end example
-
-@noindent
-the variable @code{a} is usable whenever the program is executing
-within the function @code{foo}, but the variable @code{b} is visible
-only while the program is executing inside the block in which @code{b}
-is declared.
-
-@cindex variable name conflict
-There is an exception: you can refer to a variable or function whose
-scope is a single source file even if the current execution point is not
-in this file. But it is possible to have more than one such variable or
-function with the same name (in different source files). If that happens,
-referring to that name has unpredictable effects. If you wish, you can
-specify a variable in a particular file, using the colon-colon notation:
-
-@cindex colon-colon
-@kindex ::
-@example
-@var{file}::@var{variable}
-@end example
-
-@noindent
-Here @var{file} is the name of the source file whose variable you want.
-
-@cindex C++ name resolution
-This use of @samp{::} is very rarely in conflict with the very similar
-use of the same notation in C++. _GDBN__ also supports use of the C++
-name resolution operator in _GDBN__ expressions.
-
-@node Arrays, Output formats, Variables, Data
-@section Artificial Arrays
-
-@cindex artificial array
-@kindex @@
-It is often useful to print out several successive objects of the
-same type in memory; a section of an array, or an array of
-dynamically determined size for which only a pointer exists in the
-program.
-
-This can be done by constructing an @dfn{artificial array} with the
-binary operator @samp{@@}. The left operand of @samp{@@} should be
-the first element of the desired array, as an individual object.
-The right operand should be the desired length of the array. The result is
-an array value whose elements are all of the type of the left argument.
-The first element is actually the left argument; the second element
-comes from bytes of memory immediately following those that hold the
-first element, and so on. Here is an example. If a program says
-
-@example
-int *array = (int *) malloc (len * sizeof (int));
-@end example
-
-@noindent
-you can print the contents of @code{array} with
-
-@example
-p *array@@len
-@end example
-
-The left operand of @samp{@@} must reside in memory. Array values made
-with @samp{@@} in this way behave just like other arrays in terms of
-subscripting, and are coerced to pointers when used in expressions.
-Artificial arrays most often appear in expressions via the value history
-(@pxref{Value History}), after printing one out.)
-
-@node Output formats, Memory, Arrays, Data
-@section Output formats
-
-@cindex formatted output
-@cindex output formats
-By default, _GDBN__ prints a value according to its data type. Sometimes
-this is not what you want. For example, you might want to print a number
-in hex, or a pointer in decimal. Or you might want to view data in memory
-at a certain address as a character string or as an instruction. To do
-these things, specify an @dfn{output format} when you print a value.
-
-The simplest use of output formats is to say how to print a value
-already computed. This is done by starting the arguments of the
-@code{print} command with a slash and a format letter. The format
-letters supported are:
-
-@table @code
-@item x
-Regard the bits of the value as an integer, and print the integer in
-hexadecimal.
-
-@item d
-Print as integer in signed decimal.
-
-@item u
-Print as integer in unsigned decimal.
-
-@item o
-Print as integer in octal.
-
-@item t
-Print as integer in binary. The letter @samp{t} stands for ``two''.
-
-@item a
-Print as an address, both absolute in hex and as an offset from the
-nearest preceding symbol. This format can be used to discover where (in
-what function) an unknown address is located:
-@example
-(_GDBP__) p/a 0x54320
-_0__$3 = 0x54320 <_initialize_vx+396>_1__
-@end example
-
-
-@item c
-Regard as an integer and print it as a character constant.
-
-@item f
-Regard the bits of the value as a floating point number and print
-using typical floating point syntax.
-@end table
-
-For example, to print the program counter in hex (@pxref{Registers}), type
-
-@example
-p/x $pc
-@end example
-
-@noindent
-Note that no space is required before the slash; this is because command
-names in _GDBN__ cannot contain a slash.
-
-To reprint the last value in the value history with a different format,
-you can use the @code{print} command with just a format and no
-expression. For example, @samp{p/x} reprints the last value in hex.
-
-@node Memory, Auto Display, Output formats, Data
-@section Examining Memory
-
-@cindex examining memory
-@table @code
-@kindex x
-@item x/@var{nfu} @var{expr}
-The command @code{x} (for `examine') can be used to examine memory
-without being constrained by your program's data types. You can specify
-the unit size @var{u} of memory to inspect, and a repeat count @var{n} of how
-many of those units to display. @code{x} understands the formats
-@var{f} used by @code{print}; two additional formats, @samp{s} (string)
-and @samp{i} (machine instruction) can be used without specifying a unit
-size.
-@end table
-
-For example, @samp{x/3uh 0x54320} is a request to display three halfwords
-(@code{h}) of memory, formatted as unsigned decimal integers (@samp{u}),
-starting at address @code{0x54320}. @samp{x/4xw $sp} prints the four
-words (@samp{w}) of memory above the stack pointer (here, @samp{$sp};
-@pxref{Registers}) in hexadecimal (@samp{x}).
-
-Since the letters indicating unit sizes are all distinct from the
-letters specifying output formats, you don't have to remember whether
-unit size or format comes first; either order will work. The output
-specifications @samp{4xw} and @samp{4wx} mean exactly the same thing.
-
-After the format specification, you supply an expression for the address
-where _GDBN__ is to begin reading from memory. The expression need not
-have a pointer value (though it may); it is always interpreted as an
-integer address of a byte of memory. @xref{Expressions} for more
-information on expressions.
-
-These are the memory units @var{u} you can specify with the @code{x}
-command:
-
-@table @code
-@item b
-Examine individual bytes.
-
-@item h
-Examine halfwords (two bytes each).
-
-@item w
-Examine words (four bytes each).
-
-@cindex word
-Many assemblers and cpu designers still use `word' for a 16-bit quantity,
-as a holdover from specific predecessor machines of the 1970's that really
-did use two-byte words. But more generally the term `word' has always
-referred to the size of quantity that a machine normally operates on and
-stores in its registers. This is 32 bits for all the machines that _GDBN__
-runs on.
-
-@item g
-Examine giant words (8 bytes).
-@end table
-
-You can combine these unit specifications with any of the formats
-described for @code{print}. @xref{Output formats}.
-
-@code{x} has two additional output specifications which derive the unit
-size from the data inspected:
-
-@table @code
-@item s
-Print a null-terminated string of characters. Any explicitly specified
-unit size is ignored; instead, the unit is however many bytes it takes
-to reach a null character (including the null character).
-
-@item i
-Print a machine instruction in assembler syntax (or nearly). Any
-specified unit size is ignored; the number of bytes in an instruction
-varies depending on the type of machine, the opcode and the addressing
-modes used. The command @code{disassemble} gives an alternative way of
-inspecting machine instructions. @xref{Machine Code}.
-@end table
-
-If you omit either the format @var{f} or the unit size @var{u}, @code{x}
-will use the same one that was used last. If you don't use any letters
-or digits after the slash, you can omit the slash as well.
-
-You can also omit the address to examine. Then the address used is just
-after the last unit examined. This is why string and instruction
-formats actually compute a unit-size based on the data: so that the next
-string or instruction examined will start in the right place.
-
-When the @code{print} command shows a value that resides in memory,
-@code{print} also sets the default address for the @code{x} command.
-@code{info line} also sets the default for @code{x}, to the address of
-the start of the machine code for the specified line (@pxref{Machine
-Code}), and @code{info breakpoints} sets it to the address of the last
-breakpoint listed (@pxref{Set Breaks}).
-
-When you use @key{RET} to repeat an @code{x} command, the address
-specified previously (if any) is ignored, so that the repeated command
-examines the successive locations in memory rather than the same ones.
-
-You can examine several consecutive units of memory with one command by
-writing a repeat-count after the slash (before the format letters, if
-any). Omitting the repeat count @var{n} displays one unit of the
-appropriate size. The repeat count must be a decimal integer. It has
-the same effect as repeating the @code{x} command @var{n} times except
-that the output may be more compact, with several units per line. For
-example,
-
-@example
-x/10i $pc
-@end example
-
-@noindent
-prints ten instructions starting with the one to be executed next in the
-selected frame. After doing this, you could print a further seven
-instructions with
-
-@example
-x/7
-@end example
-
-@noindent
----where the format and address are allowed to default.
-
-@kindex $_
-@kindex $__
-The addresses and contents printed by the @code{x} command are not put
-in the value history because there is often too much of them and they
-would get in the way. Instead, _GDBN__ makes these values available for
-subsequent use in expressions as values of the convenience variables
-@code{$_} and @code{$__}. After an @code{x} command, the last address
-examined is available for use in expressions in the convenience variable
-@code{$_}. The contents of that address, as examined, are available in
-the convenience variable @code{$__}.
-
-If the @code{x} command has a repeat count, the address and contents saved
-are from the last memory unit printed; this is not the same as the last
-address printed if several units were printed on the last line of output.
-
-@node Auto Display, Print Settings, Memory, Data
-@section Automatic Display
-@cindex automatic display
-@cindex display of expressions
-
-If you find that you want to print the value of an expression frequently
-(to see how it changes), you might want to add it to the @dfn{automatic
-display list} so that _GDBN__ will print its value each time the program stops.
-Each expression added to the list is given a number to identify it;
-to remove an expression from the list, you specify that number.
-The automatic display looks like this:
-
-@example
-2: foo = 38
-3: bar[5] = (struct hack *) 0x3804
-@end example
-
-@noindent
-showing item numbers, expressions and their current values. As with
-displays you request manually using @code{x} or @code{print}, you can
-specify the output format you prefer; in fact, @code{display} decides
-whether to use @code{print} or @code{x} depending on how elaborate your
-format specification is---it uses @code{x} if you specify a unit size,
-or one of the two formats (@samp{i} and @samp{s}) that are only
-supported by @code{x}; otherwise it uses @code{print}.
-
-@table @code
-@item display @var{exp}
-@kindex display
-Add the expression @var{exp} to the list of expressions to display
-each time the program stops. @xref{Expressions}.
-
-@code{display} will not repeat if you press @key{RET} again after using it.
-
-@item display/@var{fmt} @var{exp}
-For @var{fmt} specifying only a display format and not a size or
-count, add the expression @var{exp} to the auto-display list but
-arranges to display it each time in the specified format @var{fmt}.
-@xref{Output formats}.
-
-@item display/@var{fmt} @var{addr}
-For @var{fmt} @samp{i} or @samp{s}, or including a unit-size or a
-number of units, add the expression @var{addr} as a memory address to
-be examined each time the program stops. Examining means in effect
-doing @samp{x/@var{fmt} @var{addr}}. @xref{Memory}.
-@end table
-
-For example, @samp{display/i $pc} can be helpful, to see the machine
-instruction about to be executed each time execution stops (@samp{$pc}
-is a common name for the program counter; @pxref{Registers}).
-
-@table @code
-@item undisplay @var{dnums}@dots{}
-@itemx delete display @var{dnums}@dots{}
-@kindex delete display
-@kindex undisplay
-Remove item numbers @var{dnums} from the list of expressions to display.
-
-@code{undisplay} will not repeat if you press @key{RET} after using it.
-(Otherwise you would just get the error @samp{No display number @dots{}}.)
-
-@item disable display @var{dnums}@dots{}
-@kindex disable display
-Disable the display of item numbers @var{dnums}. A disabled display
-item is not printed automatically, but is not forgotten. It may be
-enabled again later.
-
-@item enable display @var{dnums}@dots{}
-@kindex enable display
-Enable display of item numbers @var{dnums}. It becomes effective once
-again in auto display of its expression, until you specify otherwise.
-
-@item display
-Display the current values of the expressions on the list, just as is
-done when the program stops.
-
-@item info display
-@kindex info display
-Print the list of expressions previously set up to display
-automatically, each one with its item number, but without showing the
-values. This includes disabled expressions, which are marked as such.
-It also includes expressions which would not be displayed right now
-because they refer to automatic variables not currently available.
-@end table
-
-If a display expression refers to local variables, then it does not make
-sense outside the lexical context for which it was set up. Such an
-expression is disabled when execution enters a context where one of its
-variables is not defined. For example, if you give the command
-@code{display last_char} while inside a function with an argument
-@code{last_char}, then this argument will be displayed while the program
-continues to stop inside that function. When it stops elsewhere---where
-there is no variable @code{last_char}---display is disabled. The next time
-your program stops where @code{last_char} is meaningful, you can enable the
-display expression once again.
-
-@node Print Settings, Value History, Auto Display, Data
-@section Print Settings
-
-@cindex format options
-@cindex print settings
-_GDBN__ provides the following ways to control how arrays, structures,
-and symbols are printed.
-
-@noindent
-These settings are useful for debugging programs in any language:
-
-@table @code
-@item set print address
-@item set print address on
-@kindex set print address
-_GDBN__ will print memory addresses showing the location of stack
-traces, structure values, pointer values, breakpoints, and so forth,
-even when it also displays the contents of those addresses. The default
-is on. For example, this is what a stack frame display looks like, with
-@code{set print address on}:
-@smallexample
-(_GDBP__) f
-#0 set_quotes (lq=0x34c78 "<<", rq=0x34c88 ">>")
- at input.c:530
-530 if (lquote != def_lquote)
-@end smallexample
-
-@item set print address off
-Do not print addresses when displaying their contents. For example,
-this is the same stack frame displayed with @code{set print address off}:
-@example
-(_GDBP__) set print addr off
-(_GDBP__) f
-#0 set_quotes (lq="<<", rq=">>") at input.c:530
-530 if (lquote != def_lquote)
-@end example
-
-@item show print address
-@kindex show print address
-Show whether or not addresses are to be printed.
-
-@item set print array
-@itemx set print array on
-@kindex set print array
-_GDBN__ will pretty print arrays. This format is more convenient to read,
-but uses more space. The default is off.
-
-@item set print array off.
-Return to compressed format for arrays.
-
-@item show print array
-@kindex show print array
-Show whether compressed or pretty format is selected for displaying
-arrays.
-
-@item set print elements @var{number-of-elements}
-@kindex set print elements
-If _GDBN__ is printing a large array, it will stop printing after it has
-printed the number of elements set by the @code{set print elements} command.
-This limit also applies to the display of strings.
-
-@item show print elements
-@kindex show print elements
-Display the number of elements of a large array that _GDBN__ will print
-before losing patience.
-
-@item set print pretty on
-@kindex set print pretty
-Cause _GDBN__ to print structures in an indented format with one member per
-line, like this:
-
-@example
-$1 = @{
- next = 0x0,
- flags = @{
- sweet = 1,
- sour = 1
- @},
- meat = 0x54 "Pork"
-@}
-@end example
-
-@item set print pretty off
-Cause _GDBN__ to print structures in a compact format, like this:
-
-@smallexample
-$1 = @{next = 0x0, flags = @{sweet = 1, sour = 1@}, meat \
-= 0x54 "Pork"@}
-@end smallexample
-
-@noindent
-This is the default format.
-
-@item show print pretty
-@kindex show print pretty
-Show which format _GDBN__ will use to print structures.
-
-@item set print sevenbit-strings on
-Print using only seven-bit characters; if this option is set,
-_GDBN__ will display any eight-bit characters (in strings or character
-values) using the notation @code{\}@var{nnn}. For example, @kbd{M-a} is
-displayed as @code{\341}.
-
-@item set print sevenbit-strings off
-Print using either seven-bit or eight-bit characters, as required. This
-is the default.
-
-@item show print sevenbit-strings
-Show whether or not _GDBN__ will print only seven-bit characters.
-
-@item set print union on
-@kindex set print union
-Tell _GDBN__ to print unions which are contained in structures. This is the
-default setting.
-
-@item set print union off
-Tell _GDBN__ not to print unions which are contained in structures.
-
-@item show print union
-@kindex show print union
-Ask _GDBN__ whether or not it will print unions which are contained in
-structures.
-
-For example, given the declarations
-
-@smallexample
-typedef enum @{Tree, Bug@} Species;
-typedef enum @{Big_tree, Acorn, Seedling@} Tree_forms;
-typedef enum @{Caterpillar, Cocoon, Butterfly@} Bug_forms;
-
-struct thing @{
- Species it;
- union @{
- Tree_forms tree;
- Bug_forms bug;
- @} form;
-@};
-
-struct thing foo = @{Tree, @{Acorn@}@};
-@end smallexample
-
-@noindent
-with @code{set print union on} in effect @samp{p foo} would print
-
-@smallexample
-$1 = @{it = Tree, form = @{tree = Acorn, bug = Cocoon@}@}
-@end smallexample
-
-@noindent
-and with @code{set print union off} in effect it would print
-
-@smallexample
-$1 = @{it = Tree, form = @{...@}@}
-@end smallexample
-@end table
-
-@noindent
-These settings are of interest when debugging C++ programs:
-
-@table @code
-@item set print demangle
-@itemx set print demangle on
-@kindex set print demangle
-Print C++ names in their source form rather than in the mangled form
-in which they are passed to the assembler and linker for type-safe linkage.
-The default is on.
-
-@item show print demangle
-@kindex show print demangle
-Show whether C++ names will be printed in mangled or demangled form.
-
-@item set print asm-demangle
-@itemx set print asm-demangle on
-@kindex set print asm-demangle
-Print C++ names in their source form rather than their mangled form, even
-in assembler code printouts such as instruction disassemblies.
-The default is off.
-
-@item show print asm-demangle
-@kindex show print asm-demangle
-Show whether C++ names in assembly listings will be printed in mangled
-or demangled form.
-
-@item set print object
-@itemx set print object on
-@kindex set print object
-When displaying a pointer to an object, identify the @emph{actual}
-(derived) type of the object rather than the @emph{declared} type, using
-the virtual function table.
-
-@item set print object off
-Display only the declared type of objects, without reference to the
-virtual function table. This is the default setting.
-
-@item show print object
-@kindex show print object
-Show whether actual, or declared, object types will be displayed.
-
-@item set print vtbl
-@itemx set print vtbl on
-@kindex set print vtbl
-Pretty print C++ virtual function tables. The default is off.
-
-@item set print vtbl off
-Do not pretty print C++ virtual function tables.
-
-@item show print vtbl
-@kindex show print vtbl
-Show whether C++ virtual function tables are pretty printed, or not.
-
-@end table
-
-@node Value History, Convenience Vars, Print Settings, Data
-@section Value History
-
-@cindex value history
-Values printed by the @code{print} command are saved in _GDBN__'s @dfn{value
-history} so that you can refer to them in other expressions. Values are
-kept until the symbol table is re-read or discarded (for example with
-the @code{file} or @code{symbol-file} commands). When the symbol table
-changes, the value history is discarded, since the values may contain
-pointers back to the types defined in the symbol table.
-
-@cindex @code{$}
-@cindex @code{$$}
-@cindex history number
-The values printed are given @dfn{history numbers} for you to refer to them
-by. These are successive integers starting with one. @code{print} shows you
-the history number assigned to a value by printing @samp{$@var{num} = }
-before the value; here @var{num} is the history number.
-
-To refer to any previous value, use @samp{$} followed by the value's
-history number. The way @code{print} labels its output is designed to
-remind you of this. Just @code{$} refers to the most recent value in
-the history, and @code{$$} refers to the value before that.
-@code{$$@var{n}} refers to the @var{n}th value from the end; @code{$$2}
-is the value just prior to @code{$$}, @code{$$1} is equivalent to
-@code{$$}, and @code{$$0} is equivalent to @code{$}.
-
-For example, suppose you have just printed a pointer to a structure and
-want to see the contents of the structure. It suffices to type
-
-@example
-p *$
-@end example
-
-If you have a chain of structures where the component @code{next} points
-to the next one, you can print the contents of the next one with this:
-
-@example
-p *$.next
-@end example
-
-@noindent
-You can print successive links in the chain by repeating this
-command---which you can do by just typing @key{RET}.
-
-Note that the history records values, not expressions. If the value of
-@code{x} is 4 and you type these commands:
-
-@example
-print x
-set x=5
-@end example
-
-@noindent
-then the value recorded in the value history by the @code{print} command
-remains 4 even though the value of @code{x} has changed.
-
-@table @code
-@kindex show values
-@item show values
-Print the last ten values in the value history, with their item numbers.
-This is like @samp{p@ $$9} repeated ten times, except that @code{show
-values} does not change the history.
-
-@item show values @var{n}
-Print ten history values centered on history item number @var{n}.
-
-@item show values +
-Print ten history values just after the values last printed. If no more
-values are available, produces no display.
-@end table
-
-Pressing @key{RET} to repeat @code{show values @var{n}} has exactly the
-same effect as @samp{show values +}.
-
-@node Convenience Vars, Registers, Value History, Data
-@section Convenience Variables
-
-@cindex convenience variables
-_GDBN__ provides @dfn{convenience variables} that you can use within
-_GDBN__ to hold on to a value and refer to it later. These variables
-exist entirely within _GDBN__; they are not part of your program, and
-setting a convenience variable has no direct effect on further execution
-of your program. That's why you can use them freely.
-
-Convenience variables are prefixed with @samp{$}. Any name preceded by
-@samp{$} can be used for a convenience variable, unless it is one of
-the predefined machine-specific register names (@pxref{Registers}).
-(Value history references, in contrast, are @emph{numbers} preceded
-by @samp{$}. @xref{Value History}.)
-
-You can save a value in a convenience variable with an assignment
-expression, just as you would set a variable in your program. Example:
-
-@example
-set $foo = *object_ptr
-@end example
-
-@noindent
-would save in @code{$foo} the value contained in the object pointed to by
-@code{object_ptr}.
-
-Using a convenience variable for the first time creates it; but its value
-is @code{void} until you assign a new value. You can alter the value with
-another assignment at any time.
-
-Convenience variables have no fixed types. You can assign a convenience
-variable any type of value, including structures and arrays, even if
-that variable already has a value of a different type. The convenience
-variable, when used as an expression, has the type of its current value.
-
-@table @code
-@item show convenience
-@kindex show convenience
-Print a list of convenience variables used so far, and their values.
-Abbreviated @code{show con}.
-@end table
-
-One of the ways to use a convenience variable is as a counter to be
-incremented or a pointer to be advanced. For example, to print
-a field from successive elements of an array of structures:
-
-_0__@example
-set $i = 0
-print bar[$i++]->contents
-@i{@dots{} repeat that command by typing @key{RET}.}
-_1__@end example
-
-Some convenience variables are created automatically by _GDBN__ and given
-values likely to be useful.
-
-@table @code
-@item $_
-The variable @code{$_} is automatically set by the @code{x} command to
-the last address examined (@pxref{Memory}). Other commands which
-provide a default address for @code{x} to examine also set @code{$_}
-to that address; these commands include @code{info line} and @code{info
-breakpoint}.
-
-@item $__
-The variable @code{$__} is automatically set by the @code{x} command
-to the value found in the last address examined.
-@end table
-
-@node Registers, Floating Point Hardware, Convenience Vars, Data
-@section Registers
-
-@cindex registers
-Machine register contents can be referred to in expressions as variables
-with names starting with @samp{$}. The names of registers are different
-for each machine; use @code{info registers} to see the names used on
-your machine.
-
-@table @code
-@item info registers
-@kindex info registers
-Print the names and values of all registers (in the selected stack frame).
-
-@item info registers @var{regname}
-Print the relativized value of register @var{regname}. @var{regname}
-may be any register name valid on the machine you are using, with
-or without the initial @samp{$}.
-@end table
-
-The register names @code{$pc} and @code{$sp} are used on most machines
-for the program counter register and the stack pointer. For example,
-you could print the program counter in hex with
-@example
-p/x $pc
-@end example
-
-@noindent
-or print the instruction to be executed next with
-@example
-x/i $pc
-@end example
-
-@noindent
-or add four to the stack pointer with
-@example
-set $sp += 4
-@end example
-
-@noindent
-The last is a way of removing one word from the stack, on machines where
-stacks grow downward in memory (most machines, nowadays). This assumes
-that the innermost stack frame is selected; setting @code{$sp} is
-not allowed when other stack frames are selected. (To pop entire frames
-off the stack, regardless of machine architecture, use @code{return};
-@pxref{Returning}.)
-
-Often @code{$fp} is used for a register that contains a pointer to the
-current stack frame, and @code{$ps} is sometimes used for a register
-that contains the processor status. These standard register names may
-be available on your machine even though the @code{info registers}
-command shows other names. For example, on the SPARC, @code{info
-registers} displays the processor status register as @code{$psr} but you
-can also refer to it as @code{$ps}.
-
-_GDBN__ always considers the contents of an ordinary register as an
-integer when the register is examined in this way. Some machines have
-special registers which can hold nothing but floating point; these
-registers are considered to have floating point values. There is no way
-to refer to the contents of an ordinary register as floating point value
-(although you can @emph{print} it as a floating point value with
-@samp{print/f $@var{regname}}).
-
-Some registers have distinct ``raw'' and ``virtual'' data formats. This
-means that the data format in which the register contents are saved by
-the operating system is not the same one that your program normally
-sees. For example, the registers of the 68881 floating point
-coprocessor are always saved in ``extended'' (raw) format, but all C
-programs expect to work with ``double'' (virtual) format. In such
-cases, _GDBN__ normally works with the virtual format only (the format that
-makes sense for your program), but the @code{info registers} command
-prints the data in both formats.
-
-Normally, register values are relative to the selected stack frame
-(@pxref{Selection}). This means that you get the value that the
-register would contain if all stack frames farther in were exited and
-their saved registers restored. In order to see the true contents of
-hardware registers, you must select the innermost frame (with
-@samp{frame 0}).
-
-However, _GDBN__ must deduce where registers are saved, from the machine
-code generated by your compiler. If some registers are not saved, or if
-_GDBN__ is unable to locate the saved registers, the selected stack
-frame will make no difference.
-
-@node Floating Point Hardware, , Registers, Data
-@section Floating Point Hardware
-@cindex floating point
-Depending on the host machine architecture, _GDBN__ may be able to give
-you more information about the status of the floating point hardware.
-
-@table @code
-@item info float
-@kindex info float
-If available, provides hardware-dependent information about the floating
-point unit. The exact contents and layout vary depending on the
-floating point chip.
-@end table
-@c FIXME: this is a cop-out. Try to get examples, explanations. Only
-@c FIXME...supported currently on arm's and 386's. Mark properly with
-@c FIXME... m4 macros to isolate general statements from hardware-dep,
-@c FIXME... at that point.
diff --git a/gdb/doc/gdb.emacs-m4 b/gdb/doc/gdb.emacs-m4
deleted file mode 100755
index 855371e..0000000
--- a/gdb/doc/gdb.emacs-m4
+++ /dev/null
@@ -1,166 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Emacs, _GDBN__ Bugs, Sequences, Top
-@chapter Using _GDBN__ under GNU Emacs
-
-@cindex emacs
-A special interface allows you to use GNU Emacs to view (and
-edit) the source files for the program you are debugging with
-_GDBN__.
-
-To use this interface, use the command @kbd{M-x gdb} in Emacs. Give the
-executable file you want to debug as an argument. This command starts
-_GDBN__ as a subprocess of Emacs, with input and output through a newly
-created Emacs buffer.
-
-Using _GDBN__ under Emacs is just like using _GDBN__ normally except for two
-things:
-
-@itemize @bullet
-@item
-All ``terminal'' input and output goes through the Emacs buffer.
-@end itemize
-
-This applies both to _GDBN__ commands and their output, and to the input
-and output done by the program you are debugging.
-
-This is useful because it means that you can copy the text of previous
-commands and input them again; you can even use parts of the output
-in this way.
-
-All the facilities of Emacs' Shell mode are available for this purpose.
-
-@itemize @bullet
-@item
-_GDBN__ displays source code through Emacs.
-@end itemize
-
-Each time _GDBN__ displays a stack frame, Emacs automatically finds the
-source file for that frame and puts an arrow (_0__@samp{=>}_1__) at the
-left margin of the current line. Emacs uses a separate buffer for
-source display, and splits the window to show both your _GDBN__ session
-and the source.
-
-Explicit _GDBN__ @code{list} or search commands still produce output as
-usual, but you probably will have no reason to use them.
-
-@quotation
-@emph{Warning:} If the directory where your program resides is not your
-current directory, it can be easy to confuse Emacs about the location of
-the source files, in which case the auxiliary display buffer will not
-appear to show your source. _GDBN__ can find programs by searching your
-environment's @code{PATH} variable, so the _GDBN__ input and output
-session will proceed normally; but Emacs doesn't get enough information
-back from _GDBN__ to locate the source files in this situation. To
-avoid this problem, either start _GDBN__ mode from the directory where
-your program resides, or specify a full path name when prompted for the
-@kbd{M-x gdb} argument.
-
-A similar confusion can result if you use the _GDBN__ @code{file} command to
-switch to debugging a program in some other location, from an existing
-_GDBN__ buffer in Emacs.
-@end quotation
-
-By default, @kbd{M-x gdb} calls the program called @file{gdb}. If
-you need to call _GDBN__ by a different name (for example, if you keep
-several configurations around, with different names) you can set the
-Emacs variable @code{gdb-command-name}; for example,
-@example
-(setq gdb-command-name "mygdb")
-@end example
-@noindent
-(preceded by @kbd{ESC ESC}, or typed in the @code{*scratch*} buffer, or
-in your @file{.emacs} file) will make Emacs call the program named
-``@code{mygdb}'' instead.
-
-In the _GDBN__ I/O buffer, you can use these special Emacs commands in
-addition to the standard Shell mode commands:
-
-@table @kbd
-@item C-h m
-Describe the features of Emacs' _GDBN__ Mode.
-
-@item M-s
-Execute to another source line, like the _GDBN__ @code{step} command; also
-update the display window to show the current file and location.
-
-@item M-n
-Execute to next source line in this function, skipping all function
-calls, like the _GDBN__ @code{next} command. Then update the display window
-to show the current file and location.
-
-@item M-i
-Execute one instruction, like the _GDBN__ @code{stepi} command; update
-display window accordingly.
-
-@item M-x gdb-nexti
-Execute to next instruction, using the _GDBN__ @code{nexti} command; update
-display window accordingly.
-
-@item C-c C-f
-Execute until exit from the selected stack frame, like the _GDBN__
-@code{finish} command.
-
-@item M-c
-Continue execution of the program, like the _GDBN__ @code{continue}
-command. @emph{Warning:} In Emacs v19, this command is @kbd{C-c C-p}.
-
-@item M-u
-Go up the number of frames indicated by the numeric argument
-(@pxref{Arguments, , Numeric Arguments, emacs, The GNU Emacs Manual}),
-like the _GDBN__ @code{up} command. @emph{Warning:} In Emacs v19, this
-command is @kbd{C-c C-u}.@refill
-
-@item M-d
-Go down the number of frames indicated by the numeric argument, like the
-_GDBN__ @code{down} command. @emph{Warning:} In Emacs v19, this command
-is @kbd{C-c C-d}.
-
-@item C-x &
-Read the number where the cursor is positioned, and insert it at the end
-of the _GDBN__ I/O buffer. For example, if you wish to disassemble code
-around an address that was displayed earlier, type @kbd{disassemble};
-then move the cursor to the address display, and pick up the
-argument for @code{disassemble} by typing @kbd{C-x &}.
-
-You can customize this further on the fly by defining elements of the list
-@code{gdb-print-command}; once it is defined, you can format or
-otherwise process numbers picked up by @kbd{C-x &} before they are
-inserted. A numeric argument to @kbd{C-x &} will both flag that you
-wish special formatting, and act as an index to pick an element of the
-list. If the list element is a string, the number to be inserted is
-formatted using the Emacs function @code{format}; otherwise the number
-is passed as an argument to the corresponding list element.
-
-@end table
-
-In any source file, the Emacs command @kbd{C-x SPC} (@code{gdb-break})
-tells _GDBN__ to set a breakpoint on the source line point is on.
-
-If you accidentally delete the source-display buffer, an easy way to get
-it back is to type the command @code{f} in the _GDBN__ buffer, to
-request a frame display; when you run under Emacs, this will recreate
-the source buffer if necessary to show you the context of the current
-frame.
-
-The source files displayed in Emacs are in ordinary Emacs buffers
-which are visiting the source files in the usual way. You can edit
-the files with these buffers if you wish; but keep in mind that _GDBN__
-communicates with Emacs in terms of line numbers. If you add or
-delete lines from the text, the line numbers that _GDBN__ knows will cease
-to correspond properly to the code.
-
-@c The following dropped because Epoch is nonstandard. Reactivate
-@c if/when v19 does something similar. ---pesch@cygnus.com 19dec1990
-@ignore
-@kindex emacs epoch environment
-@kindex epoch
-@kindex inspect
-
-Version 18 of Emacs has a built-in window system called the @code{epoch}
-environment. Users of this environment can use a new command,
-@code{inspect} which performs identically to @code{print} except that
-each value is printed in its own window.
-@end ignore
diff --git a/gdb/doc/gdb.files-m4 b/gdb/doc/gdb.files-m4
deleted file mode 100755
index c71a315..0000000
--- a/gdb/doc/gdb.files-m4
+++ /dev/null
@@ -1,300 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node _GDBN__ Files, Targets, Altering, Top
-@chapter _GDBN__'s Files
-
-@menu
-* Files:: Commands to Specify Files
-* Symbol Errors:: Errors Reading Symbol Files
-@end menu
-
-@node Files, Symbol Errors, _GDBN__ Files, _GDBN__ Files
-@section Commands to Specify Files
-@cindex core dump file
-@cindex symbol table
-_GDBN__ needs to know the file name of the program to be debugged, both in
-order to read its symbol table and in order to start the program. To
-debug a core dump of a previous run, _GDBN__ must be told the file name of
-the core dump.
-
-The usual way to specify the executable and core dump file names is with
-the command arguments given when you start _GDBN__, as discussed in
-@pxref{Invocation}.
-
-Occasionally it is necessary to change to a different file during a
-_GDBN__ session. Or you may run _GDBN__ and forget to specify the files you
-want to use. In these situations the _GDBN__ commands to specify new files
-are useful.
-
-@table @code
-@item file @var{filename}
-@cindex executable file
-@kindex file
-Use @var{filename} as the program to be debugged. It is read for its
-symbols and for the contents of pure memory. It is also the program
-executed when you use the @code{run} command. If you do not specify a
-directory and the file is not found in _GDBN__'s working directory,
-
-_GDBN__ uses the environment variable @code{PATH} as a list of
-directories to search, just as the shell does when looking for a program
-to run. You can change the value of this variable, for both _GDBN__ and
-your program, using the @code{path} command.
-
-@code{file} with no argument makes _GDBN__ discard any information it
-has on both executable file and the symbol table.
-
-@item exec-file @var{filename}
-@kindex exec-file
-Specify that the program to be run (but not the symbol table) is found
-in @var{filename}. _GDBN__ will search the environment variable @code{PATH}
-if necessary to locate the program.
-
-@item symbol-file @var{filename}
-@kindex symbol-file
-Read symbol table information from file @var{filename}. @code{PATH} is
-searched when necessary. Use the @code{file} command to get both symbol
-table and program to run from the same file.
-
-@code{symbol-file} with no argument clears out _GDBN__'s information on your
-program's symbol table.
-
-The @code{symbol-file} command causes _GDBN__ to forget the contents of its
-convenience variables, the value history, and all breakpoints and
-auto-display expressions. This is because they may contain pointers to
-the internal data recording symbols and data types, which are part of
-the old symbol table data being discarded inside _GDBN__.
-
-@code{symbol-file} will not repeat if you press @key{RET} again after
-executing it once.
-
-On some kinds of object files, the @code{symbol-file} command does not
-actually read the symbol table in full right away. Instead, it scans
-the symbol table quickly to find which source files and which symbols
-are present. The details are read later, one source file at a time,
-when they are needed.
-
-The purpose of this two-stage reading strategy is to make _GDBN__ start up
-faster. For the most part, it is invisible except for occasional pauses
-while the symbol table details for a particular source file are being
-read. (The @code{set verbose} command can turn these pauses into
-messages if desired. @xref{Messages/Warnings}).
-
-When the symbol table is stored in COFF format, @code{symbol-file} does
-read the symbol table data in full right away. We haven't implemented
-the two-stage strategy for COFF yet.
-
-When _GDBN__ is configured for a particular environment, it will
-understand debugging information in whatever format is the standard
-generated for that environment; you may use either a GNU compiler, or
-other compilers that adhere to the local conventions. Best results are
-usually obtained from GNU compilers; for example, using @code{_GCC__}
-you can generate debugging information for optimized code.
-
-@item core-file @var{filename}
-@itemx core @var{filename}
-@kindex core
-@kindex core-file
-Specify the whereabouts of a core dump file to be used as the ``contents
-of memory''. Traditionally, core files contain only some parts of the
-address space of the process that generated them; _GDBN__ can access the
-executable file itself for other parts.
-
-@code{core-file} with no argument specifies that no core file is
-to be used.
-
-Note that the core file is ignored when your program is actually running
-under _GDBN__. So, if you have been running the program and you wish to
-debug a core file instead, you must kill the subprocess in which the
-program is running. To do this, use the @code{kill} command
-(@pxref{Kill Process}).
-
-@item load @var{filename}
-@kindex load
-_if__(_GENERIC__)
-Depending on what remote debugging facilities are configured into
-_GDBN__, the @code{load} command may be available. Where it exists, it
-is meant to make @var{filename} (an executable) available for debugging
-on the remote system---by downloading, or dynamic linking, for example.
-@code{load} also records @var{filename}'s symbol table in _GDBN__, like
-the @code{add-symbol-file} command.
-
-If @code{load} is not available on your _GDBN__, attempting to execute
-it gets the error message ``@code{You can't do that when your target is
-@dots{}}''
-_fi__(_GENERIC__)
-
-_if__(_VXWORKS__)
-On VxWorks, @code{load} will dynamically link @var{filename} on the
-current target system as well as adding its symbols in _GDBN__.
-_fi__(_VXWORKS__)
-
-_if__(_I960__)
-@cindex download to Nindy-960
-With the Nindy interface to an Intel 960 board, @code{load} will
-download @var{filename} to the 960 as well as adding its symbols in
-_GDBN__.
-_fi__(_I960__)
-
-@code{load} will not repeat if you press @key{RET} again after using it.
-
-@item add-symbol-file @var{filename} @var{address}
-@kindex add-symbol-file
-@cindex dynamic linking
-The @code{add-symbol-file} command reads additional symbol table information
-from the file @var{filename}. You would use this command when that file
-has been dynamically loaded (by some other means) into the program that
-is running. @var{address} should be the memory address at which the
-file has been loaded; _GDBN__ cannot figure this out for itself.
-
-The symbol table of the file @var{filename} is added to the symbol table
-originally read with the @code{symbol-file} command. You can use the
-@code{add-symbol-file} command any number of times; the new symbol data thus
-read keeps adding to the old. To discard all old symbol data instead,
-use the @code{symbol-file} command.
-
-@code{add-symbol-file} will not repeat if you press @key{RET} after using it.
-
-@item info files
-@itemx info target
-@kindex info files
-@kindex info target
-@code{info files} and @code{info target} are synonymous; both print the
-current targets (@pxref{Targets}), including the names of the executable
-and core dump files currently in use by _GDBN__, and the files from
-which symbols were loaded. The command @code{help targets} lists all
-possible targets rather than current ones.
-
-@end table
-
-All file-specifying commands allow both absolute and relative file names
-as arguments. _GDBN__ always converts the file name to an absolute path
-name and remembers it that way.
-
-@kindex sharedlibrary
-@kindex share
-@cindex shared libraries
-
-_GDBN__ supports the SunOS shared library format. Symbols from a shared
-library cannot be referenced before the shared library has been linked
-with the program. (That is to say, until after you type @code{run} and
-the function @code{main} has been entered; or when examining core
-files.) Once the shared library has been linked in, you can use the
-following commands:
-
-@table @code
-@item sharedlibrary @var{regex}
-@itemx share @var{regex}
-Load shared object library symbols for files matching a UNIX regular
-expression.
-
-@item share
-@itemx sharedlibrary
-Load symbols for all shared libraries.
-
-@item info share
-@itemx info sharedlibrary
-@kindex info sharedlibrary
-@kindex info share
-Print the names of the shared libraries which you have loaded with the
-@code{sharedlibrary} command.
-@end table
-
-@code{sharedlibrary} does not repeat automatically when you press
-@key{RET} after using it once.
-
-@node Symbol Errors, , Files, _GDBN__ Files
-@section Errors Reading Symbol Files
-While a symbol file is being read, _GDBN__ will occasionally encounter
-problems, such as symbol types it does not recognize, or known bugs in
-compiler output. By default, it prints one message about each such
-type of problem, no matter how many times the problem occurs. You can
-ask it to print more messages, to see how many times the problems occur,
-or can shut the messages off entirely, with the @code{set
-complaints} command (@xref{Messages/Warnings}).
-
-The messages currently printed, and their meanings, are:
-
-@table @code
-@item inner block not inside outer block in @var{symbol}
-
-The symbol information shows where symbol scopes begin and end
-(such as at the start of a function or a block of statements). This
-error indicates that an inner scope block is not fully contained
-in its outer scope blocks.
-
-_GDBN__ circumvents the problem by treating the inner block as if it had
-the same scope as the outer block. In the error message, @var{symbol}
-may be shown as ``@code{(don't know)}'' if the outer block is not a
-function.
-
-@item block at @var{address} out of order
-
-The symbol information for symbol scope blocks should occur in
-order of increasing addresses. This error indicates that it does not
-do so.
-
-_GDBN__ does not circumvent this problem, and will have trouble locating
-symbols in the source file whose symbols being read. (You can often
-determine what source file is affected by specifying @code{set verbose
-on}. @xref{Messages/Warnings}.)
-
-@item bad block start address patched
-
-The symbol information for a symbol scope block has a start address
-smaller than the address of the preceding source line. This is known
-to occur in the SunOS 4.1.1 (and earlier) C compiler.
-
-_GDBN__ circumvents the problem by treating the symbol scope block as
-starting on the previous source line.
-
-@c @item{encountered DBX-style class variable debugging information.
-@c You seem to have compiled your program with "g++ -g0" instead of "g++ -g".
-@c Therefore _GDBN__ will not know about your class variables}
-@c
-@c This error indicates that the symbol information produced for a C++
-@c program includes zero-size fields, which indicated static fields in
-@c a previous release of the G++ compiler. This message is probably
-@c obsolete.
-@c
-@item bad string table offset in symbol @var{n}
-
-@cindex foo
-Symbol number @var{n} contains a pointer into the string table which is
-larger than the size of the string table.
-
-_GDBN__ circumvents the problem by considering the symbol to have the
-name @code{foo}, which may cause other problems if many symbols end up
-with this name.
-
-@item unknown symbol type @code{0x@var{nn}}
-
-The symbol information contains new data types that _GDBN__ does not yet
-know how to read. @code{0x@var{nn}} is the symbol type of the misunderstood
-information, in hexadecimal.
-
-_GDBN__ circumvents the error by ignoring this symbol information. This
-will usually allow the program to be debugged, though certain symbols
-will not be accessible. If you encounter such a problem and feel like
-debugging it, you can debug @code{_GDBP__} with itself, breakpoint on
-@code{complain}, then go up to the function @code{read_dbx_symtab} and
-examine @code{*bufp} to see the symbol.
-
-@item stub type has NULL name
-_GDBN__ could not find the full definition for a struct or class.
-
-@ignore
-@c this is #if 0'd in dbxread.c as of (at least!) 17 may 1991
-@item const/volatile indicator missing, got '@var{X}'
-
-The symbol information for a C++ member function is missing some
-information that the compiler should have output for it.
-@end ignore
-
-@item C++ type mismatch between compiler and debugger
-
-The debugger could not parse a type specification output by the compiler
-for some C++ object.
-
-@end table
diff --git a/gdb/doc/gdb.gpl-m4 b/gdb/doc/gdb.gpl-m4
deleted file mode 100755
index 9925f83..0000000
--- a/gdb/doc/gdb.gpl-m4
+++ /dev/null
@@ -1,308 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Copying, Index, Installing _GDBN__, Top
-@appendix Copying GDB
-@c this is an attempt to kluge around what may be a bug in texinfo;
-@c @xrefs to this node came out pointing several pages further down when
-@c the @node was immediately followed by @unnumbered.
-@c While we're at it, might as well give an Appendix heading that
-@c matches RMS' preferred nodename "Copying".
-
-@unnumbered GNU GENERAL PUBLIC LICENSE
-@center Version 1, February 1989
-
-@display
-Copyright @copyright{} 1989 Free Software Foundation, Inc.
-675 Mass Ave, Cambridge, MA 02139, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@unnumberedsec Preamble
-
- The license agreements of most software companies try to keep users
-at the mercy of those companies. By contrast, our General Public
-License is intended to guarantee your freedom to share and change free
-software---to make sure the software is free for all its users. The
-General Public License applies to the Free Software Foundation's
-software and to any other program whose authors commit to using it.
-You can use it for your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Specifically, the General Public License is designed to make
-sure that you have the freedom to give away or sell copies of free
-software, that you receive source code or can get it if you want it,
-that you can change the software or use pieces of it in new free
-programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of a such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must tell them their rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
-@iftex
-@unnumberedsec TERMS AND CONDITIONS
-@end iftex
-@ifinfo
-@center TERMS AND CONDITIONS
-@end ifinfo
-
-@enumerate
-@item
-This License Agreement applies to any program or other work which
-contains a notice placed by the copyright holder saying it may be
-distributed under the terms of this General Public License. The
-``Program'', below, refers to any such program or work, and a ``work based
-on the Program'' means either the Program or any work containing the
-Program or a portion of it, either verbatim or with modifications. Each
-licensee is addressed as ``you''.
-
-@item
-You may copy and distribute verbatim copies of the Program's source
-code as you receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice and
-disclaimer of warranty; keep intact all the notices that refer to this
-General Public License and to the absence of any warranty; and give any
-other recipients of the Program a copy of this General Public License
-along with the Program. You may charge a fee for the physical act of
-transferring a copy.
-
-@item
-You may modify your copy or copies of the Program or any portion of
-it, and copy and distribute such modifications under the terms of Paragraph
-1 above, provided that you also do the following:
-
-@itemize @bullet
-@item
-cause the modified files to carry prominent notices stating that
-you changed the files and the date of any change; and
-
-@item
-cause the whole of any work that you distribute or publish, that
-in whole or in part contains the Program or any part thereof, either
-with or without modifications, to be licensed at no charge to all
-third parties under the terms of this General Public License (except
-that you may choose to grant warranty protection to some or all
-third parties, at your option).
-
-@item
-If the modified program normally reads commands interactively when
-run, you must cause it, when started running for such interactive use
-in the simplest and most usual way, to print or display an
-announcement including an appropriate copyright notice and a notice
-that there is no warranty (or else, saying that you provide a
-warranty) and that users may redistribute the program under these
-conditions, and telling the user how to view a copy of this General
-Public License.
-
-@item
-You may charge a fee for the physical act of transferring a
-copy, and you may at your option offer warranty protection in
-exchange for a fee.
-@end itemize
-
-Mere aggregation of another independent work with the Program (or its
-derivative) on a volume of a storage or distribution medium does not bring
-the other work under the scope of these terms.
-
-@item
-You may copy and distribute the Program (or a portion or derivative of
-it, under Paragraph 2) in object code or executable form under the terms of
-Paragraphs 1 and 2 above provided that you also do one of the following:
-
-@itemize @bullet
-@item
-accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of
-Paragraphs 1 and 2 above; or,
-
-@item
-accompany it with a written offer, valid for at least three
-years, to give any third party free (except for a nominal charge
-for the cost of distribution) a complete machine-readable copy of the
-corresponding source code, to be distributed under the terms of
-Paragraphs 1 and 2 above; or,
-
-@item
-accompany it with the information you received as to where the
-corresponding source code may be obtained. (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form alone.)
-@end itemize
-
-Source code for a work means the preferred form of the work for making
-modifications to it. For an executable file, complete source code means
-all the source code for all modules it contains; but, as a special
-exception, it need not include source code for modules which are standard
-libraries that accompany the operating system on which the executable
-file runs, or for standard header files or definitions files that
-accompany that operating system.
-
-@item
-You may not copy, modify, sublicense, distribute or transfer the
-Program except as expressly provided under this General Public License.
-Any attempt otherwise to copy, modify, sublicense, distribute or transfer
-the Program is void, and will automatically terminate your rights to use
-the Program under this License. However, parties who have received
-copies, or rights to use copies, from you under this General Public
-License will not have their licenses terminated so long as such parties
-remain in full compliance.
-
-@item
-By copying, distributing or modifying the Program (or any work based
-on the Program) you indicate your acceptance of this license to do so,
-and all its terms and conditions.
-
-@item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the original
-licensor to copy, distribute or modify the Program subject to these
-terms and conditions. You may not impose any further restrictions on the
-recipients' exercise of the rights granted herein.
-
-@item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of the license which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-the license, you may choose any version ever published by the Free Software
-Foundation.
-
-@item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-@iftex
-@heading NO WARRANTY
-@end iftex
-@ifinfo
-@center NO WARRANTY
-@end ifinfo
-
-@item
-BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-@item
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
-ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
-ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT
-LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
-SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
-WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-@end enumerate
-
-@iftex
-@heading END OF TERMS AND CONDITIONS
-@end iftex
-@ifinfo
-@center END OF TERMS AND CONDITIONS
-@end ifinfo
-
-@page
-@unnumberedsec Applying These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to humanity, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these
-terms.
-
- To do so, attach the following notices to the program. It is safest to
-attach them to the start of each source file to most effectively convey
-the exclusion of warranty; and each file should have at least the
-``copyright'' line and a pointer to where the full notice is found.
-
-@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
-Copyright (C) 19@var{yy} @var{name of author}
-
-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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-@end smallexample
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-@smallexample
-Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type `show c' for details.
-@end smallexample
-
-The hypothetical commands `show w' and `show c' should show the
-appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than `show w' and `show
-c'; they could even be mouse-clicks or menu items---whatever suits your
-program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a ``copyright disclaimer'' for the program, if
-necessary. Here is a sample; alter the names:
-
-@smallexample
-Yoyodyne, Inc., hereby disclaims all copyright interest in the
-program `Gnomovision' (a program to direct compilers to make passes
-at assemblers) written by James Hacker.
-
-@var{signature of Ty Coon}, 1 April 1989
-Ty Coon, President of Vice
-@end smallexample
-
-That's all there is to it!
diff --git a/gdb/doc/gdb.install-m4 b/gdb/doc/gdb.install-m4
deleted file mode 100755
index 651c8d0..0000000
--- a/gdb/doc/gdb.install-m4
+++ /dev/null
@@ -1,57 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Installing _GDBN__, Copying, Renamed Commands, Top
-@appendix Installing _GDBN__
-@cindex configuring _GDBN__
-@cindex installation
-
-The script @code{config.gdb} automates the process of preparing _GDBN__
-for installation; you can then use @code{make} to actually build it.
-The best way to build _GDBN__ is in a subdirectory that records the
-configuration options used; this gives you a clean way of building
-_GDBN__ binaries with several different configuration options.
-@code{config.gdb} doesn't depend on this---it's just a good habit. For
-example, assuming the _GDBN__ source is in a directory called
-``@code{gdb-4.0}'':
-
-@example
-cd gdb-4.0
-mkdir =sun3os4
-cd =sun3os4
-../config.gdb sun3os4
-make
-@end example
-
-@noindent
-will install _GDBN__ on a Sun 3 running SunOS 4.
-
-@table @code
-@kindex config.gdb
-@item config.gdb @var{machine}
-@itemx config.gdb -srcdir=@var{dir} @var{machine}
-This is the most usual way of configuring _GDBN__; to debug programs running
-on the same machine as _GDBN__ itself. If you wish to build the _GDBN__ binaries
-in a completely different directory from the sources, specify a path to
-the source directory using the @samp{-srcdir} option.
-
-@item config.gdb -host
-@cindex host environments
-Display a list of supported host environments for _GDBN__.
-
-@item config.gdb @var{host} @var{target}
-@itemx config.gdb -srcdir=@var{dir} @var{host} @var{target}
-@cindex cross-debugging
-_GDBN__ can also be used as a cross-debugger, running on a machine of one
-type while debugging a program running on a machine of another type.
-You configure it this way by specifying first the @var{host}, then the
-@var{target} environment on the @code{config.gdb} argument list; the
-@var{host} is where _GDBN__ runs, and the @var{target} is where your program
-runs. @xref{Remote}. Again, you can use @samp{-srcdir} to specify a
-path to the _GDBN__ source.
-
-@item config.gdb -target
-@cindex target environments
-Display a list of supported target environments for _GDBN__.
-@end table
diff --git a/gdb/doc/gdb.invoc-m4 b/gdb/doc/gdb.invoc-m4
deleted file mode 100755
index 1ff32de..0000000
--- a/gdb/doc/gdb.invoc-m4
+++ /dev/null
@@ -1,207 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Invocation, Commands, Sample Session, Top
-@chapter Getting In and Out of _GDBN__
-
-@menu
-* Starting _GDBN__:: Starting _GDBN__
-* Leaving _GDBN__:: Leaving _GDBN__
-* Shell Commands:: Shell Commands
-@end menu
-
-@node Starting _GDBN__, Leaving _GDBN__, Invocation, Invocation
-@section Starting _GDBN__
-
-_GDBN__ is invoked with the shell command @code{_GDBP__}. Once started,
-it reads commands from the terminal until you tell it to exit.
-
-You can run @code{_GDBP__} with no arguments or options; but the most
-usual way to start _GDBN__ is with one argument or two, specifying an
-executable program as the argument:
-@example
-_GDBP__ program
-@end example
-@noindent
-You can also start with both an executable program and a core file specified:
-@example
-_GDBP__ program core
-@end example
-
-@noindent
-You can further control how _GDBN__ starts up by using command-line
-options. _GDBN__ itself can remind you of the options available:
-@example
-_GDBP__ -help
-@end example
-@noindent
-will display all available options and briefly describe their use
-(@samp{_GDBP__ -h} is a shorter equivalent).
-
-All options and command line arguments you give are processed
-in sequential order. The order makes a difference when the
-@samp{-x} option is used.
-
-@menu
-* File Options:: Choosing Files
-* Mode Options:: Choosing Modes
-_if__(!_GENERIC__)
-_include__(gdb.inv.m-m4)_dnl__
-_fi__(!_GENERIC__)
-@end menu
-
-@node File Options, Mode Options, Starting _GDBN__, Starting _GDBN__
-@subsection Choosing Files
-
-As shown above, any arguments other than options specify an executable
-file and core file; that is, the first argument encountered with no
-associated option flag is equivalent to a @samp{-se} option, and the
-second, if any, is equivalent to a @samp{-c} option. Many options have
-both long and short forms; both are shown here. The long forms are also
-recognized if you truncate them, so long as enough of the option is
-present to be unambiguous. (If you prefer, you can flag option
-arguments with @samp{+} rather than @samp{-}, though we illustrate the
-more usual convention.)
-
-@table @code
-@item -symbols=@var{file}
-@itemx -s @var{file}
-Read symbol table from file @var{file}.
-
-@item -exec=@var{file}
-@itemx -e @var{file}
-Use file @var{file} as the executable file to execute when
-appropriate, and for examining pure data in conjunction with a core
-dump.
-
-@item -se @var{file}
-Read symbol table from file @var{file} and use it as the executable
-file.
-
-@item -core=@var{file}
-@itemx -c @var{file}
-Use file @var{file} as a core dump to examine.
-
-@item -command=@var{file}
-@itemx -x @var{file}
-Execute _GDBN__ commands from file @var{file}. @xref{Command Files}.
-
-@item -directory=@var{directory}
-@itemx -d @var{directory}
-Add @var{directory} to the path to search for source files.
-@end table
-
-_if__(!_GENERIC__)
-@node Mode Options, i960-Nindy Remote, File Options, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node Mode Options, , File Options, Starting _GDBN__
-_fi__(_GENERIC__)
-@subsection Choosing Modes
-
-@table @code
-@item -nx
-@itemx -n
-Do not execute commands from any @file{_GDBINIT__} initialization files.
-Normally, the commands in these files are executed after all the
-command options and arguments have been processed. @xref{Command
-Files}.
-
-@item -quiet
-@itemx -q
-``Quiet''. Do not print the introductory and copyright messages. These
-messages are also suppressed in batch mode, or if an executable file name is
-specified on the _GDBN__ command line.
-
-@item -batch
-Run in batch mode. Exit with status @code{0} after processing all the command
-files specified with @samp{-x} (and @file{_GDBINIT__}, if not inhibited).
-Exit with nonzero status if an error occurs in executing the _GDBN__
-commands in the command files.
-
-Batch mode may be useful for running _GDBN__ as a filter, for example to
-download and run a program on another computer; in order to make this
-more useful, the message
-@example
-Program exited normally.
-@end example
-@noindent
-(which is ordinarily issued whenever a program running under _GDBN__ control
-terminates) is not issued when running in batch mode.
-
-@item -cd @var{directory}
-Run _GDBN__ using @var{directory} as its working directory,
-instead of the current directory.
-
-@item -fullname
-@itemx -f
-This option is used when Emacs runs _GDBN__ as a subprocess. It tells _GDBN__
-to output the full file name and line number in a standard,
-recognizable fashion each time a stack frame is displayed (which
-includes each time the program stops). This recognizable format looks
-like two @samp{\032} characters, followed by the file name, line number
-and character position separated by colons, and a newline. The
-Emacs-to-_GDBN__ interface program uses the two @samp{\032} characters as
-a signal to display the source code for the frame.
-
-@item -b @var{bps}
-Set the line speed (baud rate or bits per second) of any serial
-interface used by _GDBN__ for remote debugging.
-
-@item -tty @var{device}
-Run using @var{device} for your program's standard input and output.
-@c FIXME: kingdon thinks there's more to -tty. Investigate.
-@end table
-
-_if__(!_GENERIC__)
-_include__(gdb.inv.s-m4)
-_fi__(!_GENERIC__)
-
-@node Leaving _GDBN__, Shell Commands, Starting _GDBN__, Invocation
-@section Leaving _GDBN__
-@cindex exiting _GDBN__
-@table @code
-@item quit
-@kindex quit
-@kindex q
-To exit _GDBN__, use the @code{quit} command (abbreviated @code{q}), or type
-an end-of-file character (usually @kbd{C-d}).
-@end table
-
-@cindex interrupt
-An interrupt (often @kbd{C-c}) will not exit from _GDBN__, but rather
-will terminate the action of any _GDBN__ command that is in progress and
-return to _GDBN__ command level. It is safe to type the interrupt
-character at any time because _GDBN__ does not allow it to take effect
-until a time when it is safe.
-
-If you've been using _GDBN__ to control an attached process or device,
-you can release it with the @code{detach} command; @pxref{Attach}.
-
-@node Shell Commands, , Leaving _GDBN__, Invocation
-@section Shell Commands
-If you just need to execute occasional shell commands during your
-debugging session, there's no need to leave or suspend _GDBN__; you can
-just use the @code{shell} command.
-
-@table @code
-@item shell @var{command string}
-@kindex shell
-@cindex shell escape
-Directs _GDBN__ to invoke an inferior shell to execute @var{command
-string}. If it exists, the environment variable @code{SHELL} is used
-for the name of the shell to run. Otherwise _GDBN__ uses
-@code{/bin/sh}.
-@end table
-
-The utility @code{make} is often needed in development environments.
-You don't have to use the @code{shell} command for this purpose in _GDBN__:
-
-@table @code
-@item make @var{make-args}
-@kindex make
-@cindex calling make
-Causes _GDBN__ to execute an inferior @code{make} program with the specified
-arguments. This is equivalent to @samp{shell make @var{make-args}}.
-@end table
diff --git a/gdb/doc/gdb.rdln-m4 b/gdb/doc/gdb.rdln-m4
deleted file mode 100755
index 7248efa..0000000
--- a/gdb/doc/gdb.rdln-m4
+++ /dev/null
@@ -1,7 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@iftex
-@include rdl-apps.texinfo
-@end iftex
diff --git a/gdb/doc/gdb.rename-m4 b/gdb/doc/gdb.rename-m4
deleted file mode 100755
index 7731a41..0000000
--- a/gdb/doc/gdb.rename-m4
+++ /dev/null
@@ -1,112 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Renamed Commands, Installing _GDBN__, _GDBN__ Bugs, Top
-@appendix Renamed Commands
-
-The following commands were renamed in _GDBN__ 4.0, in order to make the
-command set as a whole more consistent and easier to use and remember:
-
-@kindex add-syms
-@kindex delete environment
-@kindex info copying
-@kindex info convenience
-@kindex info directories
-@kindex info editing
-@kindex info history
-@kindex info targets
-@kindex info values
-@kindex info version
-@kindex info warranty
-@kindex set addressprint
-@kindex set arrayprint
-@kindex set prettyprint
-@kindex set screen-height
-@kindex set screen-width
-@kindex set unionprint
-@kindex set vtblprint
-@kindex set demangle
-@kindex set asm-demangle
-@kindex set sevenbit-strings
-@kindex set array-max
-@kindex set caution
-@kindex set history write
-@kindex show addressprint
-@kindex show arrayprint
-@kindex show prettyprint
-@kindex show screen-height
-@kindex show screen-width
-@kindex show unionprint
-@kindex show vtblprint
-@kindex show demangle
-@kindex show asm-demangle
-@kindex show sevenbit-strings
-@kindex show array-max
-@kindex show caution
-@kindex show history write
-@kindex unset
-
-@ifinfo
-OLD COMMAND NEW COMMAND
---------------- ----------------------------------
-add-syms add-symbol-file
-delete environment unset environment
-info convenience show convenience
-info copying show copying
-info directories show directories
-info editing show commands
-info history show values
-info targets help target
-info values show values
-info version show version
-info warranty show warranty
-set/show addressprint set/show print address
-set/show array-max set/show print elements
-set/show arrayprint set/show print array
-set/show asm-demangle set/show print asm-demangle
-set/show caution set/show confirm
-set/show demangle set/show print demangle
-set/show history write set/show history save
-set/show prettyprint set/show print pretty
-set/show screen-height set/show height
-set/show screen-width set/show width
-set/show sevenbit-strings set/show print sevenbit-strings
-set/show unionprint set/show print union
-set/show vtblprint set/show print vtbl
-
-unset [ No longer an alias for delete ]
-@end ifinfo
-
-@tex
-\vskip \parskip\vskip \baselineskip
-\halign{\tt #\hfil &\qquad#&\tt #\hfil\cr
-{\bf Old Command} &&{\bf New Command}\cr
-add-syms &&add-symbol-file\cr
-delete environment &&unset environment\cr
-info convenience &&show convenience\cr
-info copying &&show copying\cr
-info directories &&show directories \cr
-info editing &&show commands\cr
-info history &&show values\cr
-info targets &&help target\cr
-info values &&show values\cr
-info version &&show version\cr
-info warranty &&show warranty\cr
-set{\rm / }show addressprint &&set{\rm / }show print address\cr
-set{\rm / }show array-max &&set{\rm / }show print elements\cr
-set{\rm / }show arrayprint &&set{\rm / }show print array\cr
-set{\rm / }show asm-demangle &&set{\rm / }show print asm-demangle\cr
-set{\rm / }show caution &&set{\rm / }show confirm\cr
-set{\rm / }show demangle &&set{\rm / }show print demangle\cr
-set{\rm / }show history write &&set{\rm / }show history save\cr
-set{\rm / }show prettyprint &&set{\rm / }show print pretty\cr
-set{\rm / }show screen-height &&set{\rm / }show height\cr
-set{\rm / }show screen-width &&set{\rm / }show width\cr
-set{\rm / }show sevenbit-strings &&set{\rm / }show print sevenbit-strings\cr
-set{\rm / }show unionprint &&set{\rm / }show print union\cr
-set{\rm / }show vtblprint &&set{\rm / }show print vtbl\cr
-\cr
-unset &&\rm(No longer an alias for delete)\cr
-}
-@end tex
diff --git a/gdb/doc/gdb.run-m4 b/gdb/doc/gdb.run-m4
deleted file mode 100755
index 09df60b..0000000
--- a/gdb/doc/gdb.run-m4
+++ /dev/null
@@ -1,390 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Running, Stopping, Commands, Top
-@chapter Running Programs Under _GDBN__
-
-@menu
-* Compilation:: Compiling for Debugging
-* Starting:: Starting your Program
-* Arguments:: Your Program's Arguments
-* Environment:: Your Program's Environment
-* Working Directory:: Your Program's Working Directory
-* Input/Output:: Your Program's Input and Output
-* Attach:: Debugging an Already-Running Process
-* Kill Process:: Killing the Child Process
-@end menu
-
-@node Compilation, Starting, Running, Running
-@section Compiling for Debugging
-
-In order to debug a program effectively, you need to generate
-debugging information when you compile it. This debugging information
-is stored in the object file; it describes the data type of each
-variable or function and the correspondence between source line numbers
-and addresses in the executable code.
-
-To request debugging information, specify the @samp{-g} option when you run
-the compiler.
-
-Many C compilers are unable to handle the @samp{-g} and @samp{-O}
-options together. Using those compilers, you cannot generate optimized
-executables containing debugging information.
-
-The GNU C compiler supports @samp{-g} with or without @samp{-O}, making it
-possible to debug optimized code. We recommend that you @emph{always} use
-@samp{-g} whenever you compile a program. You may think the program is
-correct, but there's no sense in pushing your luck.
-
-Some things do not work as well with @samp{-g -O} as with just
-@samp{-g}, particularly on machines with instruction scheduling. If in
-doubt, recompile with @samp{-g} alone, and if this fixes the problem,
-please report it as a bug (including a test case!).
-
-Older versions of the GNU C compiler permitted a variant option
-@samp{-gg} for debugging information. _GDBN__ no longer supports this
-format; if your GNU C compiler has this option, do not use it.
-
-@ignore
-@comment As far as I know, there are no cases in which _GDBN__ will
-@comment produce strange output in this case. (but no promises).
-If your program includes archives made with the @code{ar} program, and
-if the object files used as input to @code{ar} were compiled without the
-@samp{-g} option and have names longer than 15 characters, _GDBN__ will get
-confused reading the program's symbol table. No error message will be
-given, but _GDBN__ may behave strangely. The reason for this problem is a
-deficiency in the Unix archive file format, which cannot represent file
-names longer than 15 characters.
-
-To avoid this problem, compile the archive members with the @samp{-g}
-option or use shorter file names. Alternatively, use a version of GNU
-@code{ar} dated more recently than August 1989.
-@end ignore
-
-
-@node Starting, Arguments, Compilation, Running
-@section Starting your Program
-@cindex starting
-@cindex running
-@table @code
-@item run
-@itemx r
-@kindex run
-Use the @code{run} command to start your program under _GDBN__.
-_if__(_VXWORKS__)
-Except on VxWorks, you
-_fi__(_VXWORKS__)
-_if__(!_VXWORKS__)
-You
-_fi__(!_VXWORKS__)
-must first specify the program name with an argument to _GDBN__
-(@pxref{Invocation}), or using the @code{file} or @code{exec-file}
-command (@pxref{Files}).@refill
-@end table
-
-On targets that support processes, @code{run} creates an inferior
-process and makes that process run your program. On other targets,
-@code{run} jumps to the start of the program.
-
-The execution of a program is affected by certain information it
-receives from its superior. _GDBN__ provides ways to specify this
-information, which you must do @i{before} starting the program. (You
-can change it after starting the program, but such changes will only affect
-the program the next time you start it.) This information may be
-divided into four categories:
-
-@table @asis
-@item The @i{arguments.}
-You specify the arguments to give your program as the arguments of the
-@code{run} command. If a shell is available on your target, the shell
-is used to pass the arguments, so that you may use normal conventions
-(such as wildcard expansion or variable substitution) in
-describing the arguments. In Unix systems, you can control which shell
-is used with the @code{SHELL} environment variable. @xref{Arguments}.@refill
-
-@item The @i{environment.}
-Your program normally inherits its environment from _GDBN__, but you can
-use the _GDBN__ commands @code{set environment} and @code{unset
-environment} to change parts of the environment that will be given to
-the program. @xref{Environment}.@refill
-
-@item The @i{working directory.}
-Your program inherits its working directory from _GDBN__. You can set
-_GDBN__'s working directory with the @code{cd} command in _GDBN__.
-@xref{Working Directory}.
-
-@item The @i{standard input and output.}
-Your program normally uses the same device for standard input and
-standard output as _GDBN__ is using. You can redirect input and output
-in the @code{run} command line, or you can use the @code{tty} command to
-set a different device for your program.
-@xref{Input/Output}.
-@end table
-
-When you issue the @code{run} command, your program begins to execute
-immediately. @xref{Stopping}, for discussion of how to arrange for your
-program to stop. Once your program has been started by the @code{run}
-command (and then stopped), you may evaluate expressions that involve
-calls to functions in the inferior, using the @code{print} or
-@code{call} commands. @xref{Data}.
-
-If the modification time of your symbol file has changed since the last
-time _GDBN__ read its symbols, _GDBN__ will discard its symbol table and re-read
-it. In this process, it tries to retain your current breakpoints.
-
-@node Arguments, Environment, Starting, Running
-@section Your Program's Arguments
-
-@cindex arguments (to your program)
-The arguments to your program can be specified by the arguments of the
-@code{run} command. They are passed to a shell, which expands wildcard
-characters and performs redirection of I/O, and thence to the program.
-_GDBN__ uses the shell indicated by your environment variable
-@code{SHELL} if it exists; otherwise, _GDBN__ uses @code{/bin/sh}.
-
-@code{run} with no arguments uses the same arguments used by the previous
-@code{run}, or those set by the @code{set args} command.
-
-@kindex set args
-@table @code
-@item set args
-Specify the arguments to be used the next time your program is run. If
-@code{set args} has no arguments, @code{run} will execute your program
-with no arguments. Once you have run your program with arguments, this
-is the only way to run it again without arguments.
-
-@item show args
-@kindex show args
-Show the arguments to give your program when it is started.
-@end table
-
-@node Environment, Working Directory, Arguments, Running
-@section Your Program's Environment
-
-@cindex environment (of your program)
-The @dfn{environment} consists of a set of environment variables and
-their values. Environment variables conventionally record such things as
-your user name, your home directory, your terminal type, and your search
-path for programs to run. Usually you set up environment variables with
-the shell and they are inherited by all the other programs you run. When
-debugging, it can be useful to try running the program with a modified
-environment without having to start _GDBN__ over again.
-
-@table @code
-@item path @var{directory}
-@kindex path
-Add @var{directory} to the front of the @code{PATH} environment variable
-(the search path for executables), for both _GDBN__ and your program.
-You may specify several directory names, separated by @samp{:} or
-whitespace. If @var{directory} is already in the path, it is moved to
-the front, so it will be searched sooner. You can use the string
-@samp{$cwd} to refer to whatever is the current working directory at the
-time _GDBN__ searches the path. @footnote{If you use @samp{.} instead,
-it refers to the directory where you executed the @code{path} command.
-_GDBN__ fills in the current path where needed in the @var{directory}
-argument, before adding it to the search path.}
-@c 'path' is explicitly nonrepeatable, but RMS points out it's silly to
-@c document that, since repeating it would be a no-op.
-
-@item show paths
-@kindex show paths
-Display the list of search paths for executables (the @code{PATH}
-environment variable).
-
-@item show environment @var{varname}
-@kindex show environment
-Print the value of environment variable @var{varname} to be given to
-your program when it starts.
-
-@item show environment
-Print the names and values of all environment variables to be given to
-your program.
-
-@item set environment @var{varname} @var{value}
-@itemx set environment @var{varname} = @var{value}
-@kindex set environment
-Sets environment variable @var{varname} to @var{value}. The value
-changes for your program only, not for _GDBN__ itself. @var{value} may
-be any string; the values of environment variables are just strings, and
-any interpretation is supplied by your program itself. The @var{value}
-parameter is optional; if it is eliminated, the variable is set to a
-null value.
-@c "any string" here doesn't include leading, trailing
-@c blanks. Gnu asks: does anyone care?
-
-For example, this command:
-
-@example
-set env USER = foo
-@end example
-
-@noindent
-tells a Unix program, when subsequently run, that its user is named
-@samp{foo}. (The spaces around @samp{=} are used for clarity here; they
-are not actually required.)
-
-@item unset environment @var{varname}
-@kindex unset environment
-Remove variable @var{varname} from the environment to be passed to your
-program. This is different from @samp{set env @var{varname} =};
-@code{unset environment} removes the variable from the environment,
-rather than assigning it an empty value.
-@end table
-
-@node Working Directory, Input/Output, Environment, Running
-@section Your Program's Working Directory
-
-@cindex working directory (of your program)
-Each time you start your program with @code{run}, it inherits its
-working directory from the current working directory of _GDBN__. _GDBN__'s
-working directory is initially whatever it inherited from its parent
-process (typically the shell), but you can specify a new working
-directory in _GDBN__ with the @code{cd} command.
-
-The _GDBN__ working directory also serves as a default for the commands
-that specify files for _GDBN__ to operate on. @xref{Files}.
-
-@table @code
-@item cd @var{directory}
-@kindex cd
-Set _GDBN__'s working directory to @var{directory}.
-
-@item pwd
-@kindex pwd
-Print _GDBN__'s working directory.
-@end table
-
-@node Input/Output, Attach, Working Directory, Running
-@section Your Program's Input and Output
-
-@cindex redirection
-@cindex i/o
-@cindex terminal
-@cindex controlling terminal
-By default, the program you run under _GDBN__ does input and output to
-the same terminal that _GDBN__ uses. _GDBN__ switches the terminal to
-its own terminal modes to interact with you, but it records the terminal
-modes your program was using and switches back to them when you continue
-running your program.
-
-@table @code
-@item info terminal
-@kindex info terminal
-Displays _GDBN__'s recorded information about the terminal modes your
-program is using.
-@end table
-
-You can redirect the program's input and/or output using shell
-redirection with the @code{run} command. For example,
-
-_0__@example
-run > outfile
-_1__@end example
-
-@noindent
-starts the program, diverting its output to the file @file{outfile}.
-
-@kindex tty
-Another way to specify where the program should do input and output is
-with the @code{tty} command. This command accepts a file name as
-argument, and causes this file to be the default for future @code{run}
-commands. It also resets the controlling terminal for the child
-process, for future @code{run} commands. For example,
-
-@example
-tty /dev/ttyb
-@end example
-
-@noindent
-directs that processes started with subsequent @code{run} commands
-default to do input and output on the terminal @file{/dev/ttyb} and have
-that as their controlling terminal.
-
-An explicit redirection in @code{run} overrides the @code{tty} command's
-effect on the input/output device, but not its effect on the controlling
-terminal.
-
-When you use the @code{tty} command or redirect input in the @code{run}
-command, only the input @emph{for your program} is affected. The input
-for _GDBN__ still comes from your terminal.
-
-@node Attach, Kill Process, Input/Output, Running
-@section Debugging an Already-Running Process
-@kindex attach
-@cindex attach
-
-@table @code
-@item attach @var{process-id}
-This command
-attaches to a running process---one that was started outside _GDBN__.
-(@code{info files} will show your active targets.) The command takes as
-argument a process ID. The usual way to find out the process-id of
-a Unix process is with the @code{ps} utility, or with the @samp{jobs -l}
-shell command.
-
-@code{attach} will not repeat if you press @key{RET} a second time after
-executing the command.
-@end table
-
-To use @code{attach}, you must be debugging in an environment which
-supports processes. You must also have permission to send the process a
-signal, and it must have the same effective user ID as the _GDBN__
-process.
-
-When using @code{attach}, you should first use the @code{file} command
-to specify the program running in the process and load its symbol table.
-@xref{Files}.
-
-The first thing _GDBN__ does after arranging to debug the specified
-process is to stop it. You can examine and modify an attached process
-with all the _GDBN__ commands that ordinarily available when you start
-processes with @code{run}. You can insert breakpoints; you can step and
-continue; you can modify storage. If you would rather the process
-continue running, you may use the @code{continue} command after
-attaching _GDBN__ to the process.
-
-@table @code
-@item detach
-@kindex detach
-When you have finished debugging the attached process, you can use the
-@code{detach} command to release it from _GDBN__'s control. Detaching
-the process continues its execution. After the @code{detach} command,
-that process and _GDBN__ become completely independent once more, and you
-are ready to @code{attach} another process or start one with @code{run}.
-@code{detach} will not repeat if you press @key{RET} again after
-executing the command.
-@end table
-
-If you exit _GDBN__ or use the @code{run} command while you have an attached
-process, you kill that process. By default, you will be asked for
-confirmation if you try to do either of these things; you can control
-whether or not you need to confirm by using the @code{set confirm} command
-(@pxref{Messages/Warnings}).
-
-@node Kill Process, , Attach, Running
-@c @group
-@section Killing the Child Process
-
-@table @code
-@item kill
-@kindex kill
-Kill the child process in which your program is running under _GDBN__.
-@end table
-
-This command is useful if you wish to debug a core dump instead of a
-running process. _GDBN__ ignores any core dump file while your program
-is running.
-@c @end group
-
-On some operating systems, you can't execute your program in another
-process while breakpoints are active inside _GDBN__. You can use the
-@code{kill} command in this situation to permit running the program
-outside the debugger.
-
-The @code{kill} command is also useful if you wish to recompile and
-relink the program, since on many systems it is impossible to modify an
-executable file which is running in a process. In this case, when you
-next type @code{run}, _GDBN__ will notice that the file has changed, and
-will re-read the symbol table (while trying to preserve your current
-breakpoint settings).
diff --git a/gdb/doc/gdb.sample-m4 b/gdb/doc/gdb.sample-m4
deleted file mode 100755
index ae258ad..0000000
--- a/gdb/doc/gdb.sample-m4
+++ /dev/null
@@ -1,263 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Sample Session, Invocation, New Features, Top
-@chapter A Sample _GDBN__ Session
-
-You can use this manual at your leisure to read all about _GDBN__.
-However, a handful of commands are enough to get started using the
-debugger. This chapter illustrates these commands.
-
-@iftex
-In this sample session, we emphasize user input like this: @i{input},
-to make it easier to pick out from the surrounding output.
-@end iftex
-
-@c FIXME: this example may not be appropriate for some configs, where
-@c FIXME...primary interest is in remote use.
-_0__
-One of the preliminary versions of GNU @code{m4} (a generic macro
-processor) exhibits the following bug: sometimes, when we change its
-quote strings from the default, the commands used to capture one macro's
-definition in another stop working. In the following short @code{m4}
-session, we define a macro @code{foo} which expands to @code{0000}; we
-then use the @code{m4} builtin @code{defn} to define @code{bar} as the
-same thing. However, when we change the open quote string to
-@code{<QUOTE>} and the close quote string to @code{<UNQUOTE>}, the same
-procedure fails to define a new synonym @code{baz}:
-
-@smallexample
-$ @i{cd gnu/m4}
-$ @i{./m4}
-@i{define(foo,0000)}
-
-@i{foo}
-0000
-@i{define(bar,defn(`foo'))}
-
-@i{bar}
-0000
-@i{changequote(<QUOTE>,<UNQUOTE>)}
-
-@i{define(baz,defn(<QUOTE>foo<UNQUOTE>))}
-@i{baz}
-@i{C-D}
-m4: End of input: 0: fatal error: EOF in string
-@end smallexample
-
-@noindent
-Let's use _GDBN__ to try to see what's going on.
-
-@smallexample
-$ @i{_GDBP__ m4}
-Reading symbol data from m4...done.
-(_GDBP__)
-@end smallexample
-
-@noindent
-_GDBN__ only reads enough symbol data to know where to find the rest
-when needed; as a result, the first prompt comes up very quickly. We
-then tell _GDBN__ to use a narrower display width than usual, so
-that examples will fit in this manual.
-
-@smallexample
-(_GDBP__) @i{set width 70}
-@end smallexample
-
-@noindent
-Let's see how the @code{m4} builtin @code{changequote} works.
-Having looked at the source, we know the relevant subroutine is
-@code{m4_changequote}, so we set a breakpoint there with _GDBN__'s
-@code{break} command.
-
-@smallexample
-(_GDBP__) @i{break m4_changequote}
-Breakpoint 1 at 0x62f4: file builtin.c, line 879.
-@end smallexample
-
-@noindent
-Using the @code{run} command, we start @code{m4} running under _GDBN__
-control; as long as control does not reach the @code{m4_changequote}
-subroutine, the program runs as usual:
-
-@smallexample
-(_GDBP__) @i{run}
-Starting program: /work/Editorial/gdb/gnu/m4/m4
-@i{define(foo,0000)}
-
-@i{foo}
-0000
-@end smallexample
-
-@noindent
-To trigger the breakpoint, we call @code{changequote}. _GDBN__
-suspends execution of @code{m4}, displaying information about the
-context where it stops.
-
-@smallexample
-@i{changequote(<QUOTE>,<UNQUOTE>)}
-
-Breakpoint 1, m4_changequote (argc=3, argv=0x33c70) at builtin.c:879
-879 if (bad_argc(TOKEN_DATA_TEXT(argv[0]), argc, 1, 3))
-@end smallexample
-
-@noindent
-Now we use the command @code{n} (@code{next}) to advance execution to
-the next line of the current function.
-
-@smallexample
-(_GDBP__) @i{n}
-882 set_quotes((argc >= 2) ? TOKEN_DATA_TEXT(argv[1]) : nil,
-@end smallexample
-
-@noindent
-@code{set_quotes} looks like a promising subroutine. We can go into it
-by using the command @code{s} (@code{step}) instead of @code{next}.
-@code{step} goes to the next line to be executed in @emph{any}
-subroutine, so it steps into @code{set_quotes}.
-
-@smallexample
-(_GDBP__) @i{s}
-set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")
- at input.c:530
-530 if (lquote != def_lquote)
-@end smallexample
-
-@noindent
-The summary display showing the subroutine where @code{m4} is now
-suspended (and its arguments) is called a stack frame display. We can
-use the @code{backtrace} command (which can also be spelled @code{bt}),
-to see where we are in the stack: it displays a stack frame for each
-active subroutine.
-
-@smallexample
-(_GDBP__) @i{bt}
-#0 set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")
- at input.c:530
-#1 0x6344 in m4_changequote (argc=3, argv=0x33c70) at builtin.c:882
-#2 0x8174 in expand_macro (sym=0x33320) at macro.c:242
-#3 0x7a88 in expand_token (obs=0x0, t=209696, td=0xf7fffa30)
- at macro.c:71
-#4 0x79dc in expand_input () at macro.c:40
-#5 0x2930 in main (argc=0, argv=0xf7fffb20) at m4.c:195
-@end smallexample
-
-@noindent
-Let's step through a few more lines to see what happens. The first two
-times, we can use @samp{s}; the next two times we use @code{n} to avoid
-falling into the @code{xstrdup} subroutine.
-@smallexample
-(_GDBP__) @i{s}
-0x3b5c 532 if (rquote != def_rquote)
-(_GDBP__) @i{s}
-0x3b80 535 lquote = (lq == nil || *lq == '\0') ? def_lquote :\
- xstrdup(lq);
-(_GDBP__) @i{n}
-536 rquote = (rq == nil || *rq == '\0') ? def_rquote : xstrdup\
-(rq);
-(_GDBP__) @i{n}
-538 len_lquote = strlen(rquote);
-@end smallexample
-
-@noindent
-The last line displayed looks a little odd; let's examine the variables
-@code{lquote} and @code{rquote} to see if they are in fact the new left
-and right quotes we specified. We can use the command @code{p}
-(@code{print}) to see their values.
-
-@smallexample
-(_GDBP__) @i{p lquote}
-$1 = 0x35d40 "<QUOTE>"
-(_GDBP__) @i{p rquote}
-$2 = 0x35d50 "<UNQUOTE>"
-@end smallexample
-
-@noindent
-@code{lquote} and @code{rquote} are indeed the new left and right quotes.
-Let's look at some context; we can display ten lines of source
-surrounding the current line, with the @code{l} (@code{list}) command.
-
-@smallexample
-(_GDBP__) @i{l}
-533 xfree(rquote);
-534
-535 lquote = (lq == nil || *lq == '\0') ? def_lquote : xstrdup\
-(lq);
-536 rquote = (rq == nil || *rq == '\0') ? def_rquote : xstrdup\
-(rq);
-537
-538 len_lquote = strlen(rquote);
-539 len_rquote = strlen(lquote);
-540 @}
-541
-542 void
-@end smallexample
-
-@noindent
-Let's step past the two lines that set @code{len_lquote} and
-@code{len_rquote}, and then examine the values of those variables.
-
-@smallexample
-(_GDBP__) @i{n}
-539 len_rquote = strlen(lquote);
-(_GDBP__) @i{n}
-540 @}
-(_GDBP__) @i{p len_lquote}
-$3 = 9
-(_GDBP__) @i{p len_rquote}
-$4 = 7
-@end smallexample
-
-@noindent
-That certainly looks wrong, assuming @code{len_lquote} and
-@code{len_rquote} are meant to be the lengths of @code{lquote} and
-@code{rquote} respectively. Let's try setting them to better values.
-We can use the @code{p} command for this, since it'll print the value of
-any expression---and that expression can include subroutine calls and
-assignments.
-
-@smallexample
-(_GDBP__) p len_lquote=strlen(lquote)
-$5 = 7
-(_GDBP__) p len_rquote=strlen(rquote)
-$6 = 9
-@end smallexample
-
-@noindent
-Let's see if that fixes the problem of using the new quotes with the
-@code{m4} built-in @code{defn}. We can allow @code{m4} to continue
-executing with the @code{c} (@code{continue}) command, and then try the
-example that caused trouble initially:
-
-@smallexample
-(_GDBP__) @i{c}
-Continuing.
-
-@i{define(baz,defn(<QUOTE>foo<UNQUOTE>))}
-
-baz
-0000
-@end smallexample
-
-@noindent
-Success! The new quotes now work just as well as the default ones. The
-problem seems to have been just the two typos defining the wrong
-lengths. We'll let @code{m4} exit by giving it an EOF as input.
-
-@smallexample
-@i{C-D}
-Program exited normally.
-@end smallexample
-
-@noindent
-The message @samp{Program exited normally.} is from _GDBN__; it
-indicates @code{m4} has finished executing. We can end our _GDBN__
-session with the _GDBN__ @code{quit} command.
-
-@smallexample
-(_GDBP__) @i{quit}
-
-$
-_1__@end smallexample
-
diff --git a/gdb/doc/gdb.src-m4 b/gdb/doc/gdb.src-m4
deleted file mode 100755
index fdc6e33..0000000
--- a/gdb/doc/gdb.src-m4
+++ /dev/null
@@ -1,288 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Source, Data, Stack, Top
-@chapter Examining Source Files
-
-_GDBN__ can print parts of your program's source, since the debugging
-information recorded in your program tells _GDBN__ what source files
-were used to built it. When your program stops, _GDBN__ spontaneously
-prints the line where it stopped. Likewise, when you select a stack
-frame (@pxref{Selection}), _GDBN__ prints the line where execution in
-that frame has stopped. You can print other portions of source files by
-explicit command.
-
-If you use _GDBN__ through its GNU Emacs interface, you may prefer to
-use Emacs facilities to view source; @pxref{Emacs}.
-
-@menu
-* List:: Printing Source Lines
-* Search:: Searching Source Files
-* Source Path:: Specifying Source Directories
-* Machine Code:: Source and Machine Code
-@end menu
-
-@node List, Search, Source, Source
-@section Printing Source Lines
-
-@kindex list
-@kindex l
-To print lines from a source file, use the @code{list} command
-(abbreviated @code{l}). There are several ways to specify what part
-of the file you want to print.
-
-Here are the forms of the @code{list} command most commonly used:
-
-@table @code
-@item list @var{linenum}
-Print ten lines centered around line number @var{linenum} in the
-current source file.
-
-@item list @var{function}
-Print ten lines centered around the beginning of function
-@var{function}.
-
-@item list
-Print ten more lines. If the last lines printed were printed with a
-@code{list} command, this prints ten lines following the last lines
-printed; however, if the last line printed was a solitary line printed
-as part of displaying a stack frame (@pxref{Stack}), this prints ten
-lines centered around that line.
-
-@item list -
-Print ten lines just before the lines last printed.
-@end table
-
-Repeating a @code{list} command with @key{RET} discards the argument,
-so it is equivalent to typing just @code{list}. This is more useful
-than listing the same lines again. An exception is made for an
-argument of @samp{-}; that argument is preserved in repetition so that
-each repetition moves up in the source file.
-
-@cindex linespec
-In general, the @code{list} command expects you to supply zero, one or two
-@dfn{linespecs}. Linespecs specify source lines; there are several ways
-of writing them but the effect is always to specify some source line.
-Here is a complete description of the possible arguments for @code{list}:
-
-@table @code
-@item list @var{linespec}
-Print ten lines centered around the line specified by @var{linespec}.
-
-@item list @var{first},@var{last}
-Print lines from @var{first} to @var{last}. Both arguments are
-linespecs.
-
-@item list ,@var{last}
-Print ten lines ending with @var{last}.
-
-@item list @var{first},
-Print ten lines starting with @var{first}.
-
-@item list +
-Print ten lines just after the lines last printed.
-
-@item list -
-Print ten lines just before the lines last printed.
-
-@item list
-As described in the preceding table.
-@end table
-
-Here are the ways of specifying a single source line---all the
-kinds of linespec.
-
-@table @code
-@item @var{number}
-Specifies line @var{number} of the current source file.
-When a @code{list} command has two linespecs, this refers to
-the same source file as the first linespec.
-
-@item +@var{offset}
-Specifies the line @var{offset} lines after the last line printed.
-When used as the second linespec in a @code{list} command that has
-two, this specifies the line @var{offset} lines down from the
-first linespec.
-
-@item -@var{offset}
-Specifies the line @var{offset} lines before the last line printed.
-
-@item @var{filename}:@var{number}
-Specifies line @var{number} in the source file @var{filename}.
-
-@item @var{function}
-@c FIXME: "of the open-brace" is C-centric. When we add other langs...
-Specifies the line of the open-brace that begins the body of the
-function @var{function}.
-
-@item @var{filename}:@var{function}
-Specifies the line of the open-brace that begins the body of the
-function @var{function} in the file @var{filename}. You only need the
-file name with a function name to avoid ambiguity when there are
-identically named functions in different source files.
-
-@item *@var{address}
-Specifies the line containing the program address @var{address}.
-@var{address} may be any expression.
-@end table
-
-@node Search, Source Path, List, Source
-@section Searching Source Files
-@cindex searching
-@kindex reverse-search
-
-There are two commands for searching through the current source file for a
-regular expression.
-
-@table @code
-@item forward-search @var{regexp}
-@itemx search @var{regexp}
-@kindex search
-@kindex forward-search
-The command @samp{forward-search @var{regexp}} checks each line, starting
-with the one following the last line listed, for a match for @var{regexp}.
-It lists the line that is found. You can abbreviate the command name
-as @code{fo}. The synonym @samp{search @var{regexp}} is also supported.
-
-@item reverse-search @var{regexp}
-The command @samp{reverse-search @var{regexp}} checks each line, starting
-with the one before the last line listed and going backward, for a match
-for @var{regexp}. It lists the line that is found. You can abbreviate
-this command as @code{rev}.
-@end table
-
-@node Source Path, Machine Code, Search, Source
-@section Specifying Source Directories
-
-@cindex source path
-@cindex directories for source files
-Executable programs sometimes do not record the directories of the source
-files from which they were compiled, just the names. Even when they do,
-the directories could be moved between the compilation and your debugging
-session. _GDBN__ has a list of directories to search for source files;
-this is called the @dfn{source path}. Each time _GDBN__ wants a source file,
-it tries all the directories in the list, in the order they are present
-in the list, until it finds a file with the desired name. Note that
-the executable search path is @emph{not} used for this purpose. Neither is
-the current working directory, unless it happens to be in the source
-path.
-
-If _GDBN__ can't find a source file in the source path, and the object
-program records a directory, _GDBN__ tries that directory too. If the
-source path is empty, and there is no record of the compilation
-directory, _GDBN__ will, as a last resort, look in the current
-directory.
-
-Whenever you reset or rearrange the source path, _GDBN__ will clear out
-any information it has cached about where source files are found, where
-each line is in the file, etc.
-
-@kindex directory
-When you start _GDBN__, its source path is empty.
-To add other directories, use the @code{directory} command.
-
-@table @code
-@item directory @var{dirname} @dots{}
-Add directory @var{dirname} to the front of the source path. Several
-directory names may be given to this command, separated by @samp{:} or
-whitespace. You may specify a directory that is already in the source
-path; this moves it forward, so it will be searched sooner. You can use
-the string @samp{$cdir} to refer to the compilation directory (if one is
-recorded), and @samp{$cwd} to refer to the current working directory.
-@footnote{@samp{$cwd} is not the same as @samp{.}---the former tracks
-the current working directory as it changes during your _GDBN__ session,
-while the latter is immediately expanded to the current directory at the
-time you add an entry to the source path.}
-
-@item directory
-Reset the source path to empty again. This requires confirmation.
-
-@c RET-repeat for @code{directory} is explicitly disabled, but since
-@c repeating it would be a no-op we don't say that. (thanks to RMS)
-
-@item show directories
-@kindex show directories
-Print the source path: show which directories it contains.
-@end table
-
-If your source path is cluttered with directories that are no longer of
-interest, _GDBN__ may sometimes cause confusion by finding the wrong
-versions of source. You can correct the situation as follows:
-
-@enumerate
-@item
-Use @code{directory} with no argument to reset the source path to empty.
-
-@item
-Use @code{directory} with suitable arguments to reinstall the
-directories you want in the source path. You can add all the
-directories in one command.
-@end enumerate
-
-@node Machine Code, , Source Path, Source
-@section Source and Machine Code
-You can use the command @code{info line} to map source lines to program
-addresses (and viceversa), and the command @code{disassemble} to display
-a range of addresses as machine instructions.
-
-@table @code
-@item info line @var{linespec}
-@kindex info line
-Print the starting and ending addresses of the compiled code for
-source line @var{linespec}. You can specify source lines in any of the
-ways understood by the @code{list} command (@pxref{List}).
-@end table
-
-For example, we can use @code{info line} to inquire on where the object
-code for the first line of function @code{m4_changequote} lies:
-@smallexample
-(_GDBP__) info line m4_changecom
-Line 895 of "builtin.c" starts at pc 0x634c and ends at 0x6350.
-@end smallexample
-
-@noindent
-We can also inquire (using @code{*@var{addr}} as the form for
-@var{linespec}) what source line covers a particular address:
-@smallexample
-(_GDBP__) info line *0x63ff
-Line 926 of "builtin.c" starts at pc 0x63e4 and ends at 0x6404.
-@end smallexample
-
-@kindex $_
-After @code{info line}, the default address for the @code{x}
-command is changed to the starting address of the line, so that
-@samp{x/i} is sufficient to begin examining the machine code
-(@pxref{Memory}). Also, this address is saved as the value of the
-convenience variable @code{$_} (@pxref{Convenience Vars}).
-
-@table @code
-@kindex disassemble
-@item disassemble
-This specialized command is provided to dump a range of memory as
-machine instructions. The default memory range is the function
-surrounding the program counter of the selected frame. A single
-argument to this command is a program counter value; the function
-surrounding this value will be dumped. Two arguments (separated by one
-or more spaces) specify a range of addresses (first inclusive, second
-exclusive) to be dumped.
-@end table
-
-We can use @code{disassemble} to inspect the object code
-range shown in the last @code{info line} example:
-
-@smallexample
-(_GDBP__) disas 0x63e4 0x6404
-Dump of assembler code from 0x63e4 to 0x6404:
-0x63e4 <builtin_init+5340>: ble 0x63f8 <builtin_init+5360>
-0x63e8 <builtin_init+5344>: sethi %hi(0x4c00), %o0
-0x63ec <builtin_init+5348>: ld [%i1+4], %o0
-0x63f0 <builtin_init+5352>: b 0x63fc <builtin_init+5364>
-0x63f4 <builtin_init+5356>: ld [%o0+4], %o0
-0x63f8 <builtin_init+5360>: or %o0, 0x1a4, %o0
-0x63fc <builtin_init+5364>: call 0x9288 <path_search>
-0x6400 <builtin_init+5368>: nop
-End of assembler dump.
-(_GDBP__)
-
-@end smallexample
diff --git a/gdb/doc/gdb.stack-m4 b/gdb/doc/gdb.stack-m4
deleted file mode 100755
index 4bed2f5..0000000
--- a/gdb/doc/gdb.stack-m4
+++ /dev/null
@@ -1,279 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Stack, Source, Stopping, Top
-@chapter Examining the Stack
-
-When your program has stopped, the first thing you need to know is where it
-stopped and how it got there.
-
-@cindex call stack
-Each time your program performs a function call, the information about
-where in the program the call was made from is saved in a block of data
-called a @dfn{stack frame}. The frame also contains the arguments of the
-call and the local variables of the function that was called. All the
-stack frames are allocated in a region of memory called the @dfn{call
-stack}.
-
-When your program stops, the _GDBN__ commands for examining the stack allow you
-to see all of this information.
-
-@cindex selected frame
-One of the stack frames is @dfn{selected} by _GDBN__ and many _GDBN__ commands
-refer implicitly to the selected frame. In particular, whenever you ask
-_GDBN__ for the value of a variable in the program, the value is found in the
-selected frame. There are special _GDBN__ commands to select whichever frame
-you are interested in.
-
-When the program stops, _GDBN__ automatically selects the currently executing
-frame and describes it briefly as the @code{frame} command does
-(@pxref{Frame Info, Info}).
-
-@menu
-* Frames:: Stack Frames
-* Backtrace:: Backtraces
-* Selection:: Selecting a Frame
-* Frame Info:: Information on a Frame
-@end menu
-
-@node Frames, Backtrace, Stack, Stack
-@section Stack Frames
-
-@cindex frame
-@cindex stack frame
-The call stack is divided up into contiguous pieces called @dfn{stack
-frames}, or @dfn{frames} for short; each frame is the data associated
-with one call to one function. The frame contains the arguments given
-to the function, the function's local variables, and the address at
-which the function is executing.
-
-@cindex initial frame
-@cindex outermost frame
-@cindex innermost frame
-When your program is started, the stack has only one frame, that of the
-function @code{main}. This is called the @dfn{initial} frame or the
-@dfn{outermost} frame. Each time a function is called, a new frame is
-made. Each time a function returns, the frame for that function invocation
-is eliminated. If a function is recursive, there can be many frames for
-the same function. The frame for the function in which execution is
-actually occurring is called the @dfn{innermost} frame. This is the most
-recently created of all the stack frames that still exist.
-
-@cindex frame pointer
-Inside your program, stack frames are identified by their addresses. A
-stack frame consists of many bytes, each of which has its own address; each
-kind of computer has a convention for choosing one of those bytes whose
-address serves as the address of the frame. Usually this address is kept
-in a register called the @dfn{frame pointer register} while execution is
-going on in that frame.
-
-@cindex frame number
-_GDBN__ assigns numbers to all existing stack frames, starting with
-zero for the innermost frame, one for the frame that called it,
-and so on upward. These numbers do not really exist in your program;
-they are assigned by _GDBN__ to give you a way of designating stack
-frames in _GDBN__ commands.
-
-@cindex frameless execution
-Some compilers allow functions to be compiled so that they operate
-without stack frames. (For example, the @code{_GCC__} option
-@samp{-fomit-frame-pointer} will generate functions without a frame.)
-This is occasionally done with heavily used library functions to save
-the frame setup time. _GDBN__ has limited facilities for dealing with
-these function invocations. If the innermost function invocation has no
-stack frame, _GDBN__ will nevertheless regard it as though it had a
-separate frame, which is numbered zero as usual, allowing correct
-tracing of the function call chain. However, _GDBN__ has no provision
-for frameless functions elsewhere in the stack.
-
-@node Backtrace, Selection, Frames, Stack
-@section Backtraces
-
-A backtrace is a summary of how the program got where it is. It shows one
-line per frame, for many frames, starting with the currently executing
-frame (frame zero), followed by its caller (frame one), and on up the
-stack.
-
-@table @code
-@item backtrace
-@itemx bt
-@kindex backtrace
-@kindex bt
-Print a backtrace of the entire stack: one line per frame for all
-frames in the stack.
-
-You can stop the backtrace at any time by typing the system interrupt
-character, normally @kbd{Control-C}.
-
-@item backtrace @var{n}
-@itemx bt @var{n}
-Similar, but print only the innermost @var{n} frames.
-
-@item backtrace -@var{n}
-@itemx bt -@var{n}
-Similar, but print only the outermost @var{n} frames.
-@end table
-
-@kindex where
-@kindex info stack
-@kindex info s
-The names @code{where} and @code{info stack} (abbreviated @code{info s})
-are additional aliases for @code{backtrace}.
-
-Each line in the backtrace shows the frame number and the function name.
-The program counter value is also shown---unless you use @code{set
-print address off}. The backtrace also shows the source file name and
-line number, as well as the arguments to the function. The program
-counter value is omitted if it is at the beginning of the code for that
-line number.
-
-Here is an example of a backtrace. It was made with the command
-@samp{bt 3}, so it shows the innermost three frames.
-
-@smallexample
-@group
-#0 m4_traceon (obs=0x24eb0, argc=1, argv=0x2b8c8) at builtin.c:993
-#1 0x6e38 in expand_macro (sym=0x2b600) at macro.c:242
-#2 0x6840 in expand_token (obs=0x0, t=177664, td=0xf7fffb08)
- at macro.c:71
-(More stack frames follow...)
-@end group
-@end smallexample
-
-@noindent
-The display for frame zero doesn't begin with a program counter
-value, indicating that the program has stopped at the beginning of the
-code for line @code{993} of @code{builtin.c}.
-
-@node Selection, Frame Info, Backtrace, Stack
-@section Selecting a Frame
-
-Most commands for examining the stack and other data in the program work on
-whichever stack frame is selected at the moment. Here are the commands for
-selecting a stack frame; all of them finish by printing a brief description
-of the stack frame just selected.
-
-@table @code
-@item frame @var{n}
-@itemx f @var{n}
-@kindex frame
-@kindex f
-Select frame number @var{n}. Recall that frame zero is the innermost
-(currently executing) frame, frame one is the frame that called the
-innermost one, and so on. The highest-numbered frame is @code{main}'s
-frame.
-
-@item frame @var{addr}
-@itemx f @var{addr}
-Select the frame at address @var{addr}. This is useful mainly if the
-chaining of stack frames has been damaged by a bug, making it
-impossible for _GDBN__ to assign numbers properly to all frames. In
-addition, this can be useful when the program has multiple stacks and
-switches between them.
-
-_if_(_SPARC__)
-On the SPARC architecture, @code{frame} needs two addresses to
-select an arbitrary frame: a frame pointer and a stack pointer.
-@c note to future updaters: this is conditioned on a flag
-@c FRAME_SPECIFICATION_DYADIC in the tm-*.h files, currently only used
-@c by SPARC, hence the specific attribution. Generalize or list all
-@c possibilities if more supported machines start doing this.
-_fi_(_SPARC__)
-
-@item up @var{n}
-@kindex up
-Move @var{n} frames up the stack. For positive numbers @var{n}, this
-advances toward the outermost frame, to higher frame numbers, to frames
-that have existed longer. @var{n} defaults to one.
-
-@item down @var{n}
-@kindex down
-@kindex do
-Move @var{n} frames down the stack. For positive numbers @var{n}, this
-advances toward the innermost frame, to lower frame numbers, to frames
-that were created more recently. @var{n} defaults to one. You may
-abbreviate @code{down} as @code{do}.
-@end table
-
-All of these commands end by printing two lines of output describing the
-frame. The first line shows the frame number, the function name, the
-arguments, and the source file and line number of execution in that
-frame. The second line shows the text of that source line. For
-example:
-
-@smallexample
-(_GDBP__) up
-#1 0x22f0 in main (argc=1, argv=0xf7fffbf4, env=0xf7fffbfc) at env.c:10
-10 read_input_file (argv[i]);
-@end smallexample
-
-After such a printout, the @code{list} command with no arguments will print
-ten lines centered on the point of execution in the frame. @xref{List}.
-
-@table @code
-@item up-silently @var{n}
-@itemx down-silently @var{n}
-@kindex down-silently
-@kindex up-silently
-These two commands are variants of @code{up} and @code{down},
-respectively; they differ in that they do their work silently, without
-causing display of the new frame. They are intended primarily for use
-in _GDBN__ command scripts, where the output might be unnecessary and
-distracting.
-
-@end table
-
-@node Frame Info, , Selection, Stack
-@section Information About a Frame
-
-There are several other commands to print information about the selected
-stack frame.
-
-@table @code
-@item frame
-@itemx f
-When used without any argument, this command does not change which frame
-is selected, but prints a brief description of the currently
-selected stack frame. It can be abbreviated @code{f}. With an
-argument, this command is used to select a stack frame (@pxref{Selection}).
-
-@item info frame
-@kindex info frame
-@itemx info f
-@kindex info f
-This command prints a verbose description of the selected stack frame,
-including the address of the frame, the addresses of the next frame down
-(called by this frame) and the next frame up (caller of this frame),
-the address of the frame's arguments, the program counter saved in it
-(the address of execution in the caller frame), and which registers
-were saved in the frame. The verbose description is useful when
-something has gone wrong that has made the stack format fail to fit
-the usual conventions.
-
-@item info frame @var{addr}
-@itemx info f @var{addr}
-Print a verbose description of the frame at address @var{addr},
-without selecting that frame. The selected frame remains unchanged by
-this command.
-
-@item info args
-@kindex info args
-Print the arguments of the selected frame, each on a separate line.
-
-@item info locals
-@kindex info locals
-Print the local variables of the selected frame, each on a separate
-line. These are all variables declared static or automatic within all
-program blocks that execution in this frame is currently inside of.
-
-@item info catch
-@kindex info catch
-@cindex catch exceptions
-@cindex exception handlers
-Print a list of all the exception handlers that are active in the
-current stack frame at the current point of execution. To see other
-exception handlers, visit the associated frame (using the @code{up},
-@code{down}, or @code{frame} commands); then type @code{info catch}.
-@xref{Exception Handling}.
-@end table
diff --git a/gdb/doc/gdb.stop-m4 b/gdb/doc/gdb.stop-m4
deleted file mode 100755
index 934d786..0000000
--- a/gdb/doc/gdb.stop-m4
+++ /dev/null
@@ -1,920 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Stopping, Stack, Running, Top
-@chapter Stopping and Continuing
-
-When you run a program normally, it runs until it terminates. The
-principal purpose of using a debugger is so that you can stop your
-program before it terminates; or so that, if the program runs into
-trouble, you can investigate and find out why.
-
-Inside _GDBN__, your program may stop for any of several reasons, such
-as a signal, a breakpoint, or reaching a new line after a _GDBN__
-command such as @code{step}. Usually, the messages shown by _GDBN__
-provide ample explanation of the status of your program---but you can
-also explicitly request this information at any time.
-
-@table @code
-@item info program
-@kindex info program
-Display information about the status of your program: whether it is
-running or not, what process it is, and why it stopped.
-@end table
-
-@menu
-* Breakpoints:: Breakpoints, Watchpoints, and Exceptions
-* Stepping:: Stepping
-* Continuing:: Continuing
-* Signals:: Signals
-@end menu
-
-@node Breakpoints, Stepping, Stopping, Stopping
-@section Breakpoints, Watchpoints, and Exceptions
-
-@cindex breakpoints
-A @dfn{breakpoint} makes your program stop whenever a certain point in
-the program is reached. For each breakpoint, you can add various
-conditions to control in finer detail whether the program will stop.
-You can set breakpoints with the @code{break} command and its variants
-(@pxref{Set Breaks}), to specify the place where the program should stop
-by line number, function name or exact address in the program. In
-languages with exception handling (such as GNU C++), you can also set
-breakpoints where an execption is raised (@pxref{Exception Handling}).
-
-@cindex watchpoints
-A @dfn{watchpoint} is a special breakpoint that stops your program when
-the value of an expression changes. You must use a different command to
-set watchpoints (@pxref{Set Watchpoints}), but aside from that, you can
-manage a watchpoint exactly like any other breakpoint: you enable, disable, and
-delete both breakpoints and watchpoints using exactly the same commands.
-
-Each breakpoint or watchpoint is assigned a number when it is created;
-these numbers are successive integers starting with one. In many of the
-commands for controlling various features of breakpoints you use the
-breakpoint number to say which breakpoint you want to change. Each
-breakpoint may be @dfn{enabled} or @dfn{disabled}; if disabled, it has
-no effect on the program until you enable it again.
-
-@menu
-* Set Breaks:: Setting Breakpoints
-* Set Watchpoints:: Setting Watchpoints
-* Exception Handling:: Breakpoints and Exceptions
-* Delete Breaks:: Deleting Breakpoints
-* Disabling:: Disabling Breakpoints
-* Conditions:: Break Conditions
-* Break Commands:: Breakpoint Command Lists
-* Breakpoint Menus:: Breakpoint Menus
-* Error in Breakpoints::
-@end menu
-
-@node Set Breaks, Set Watchpoints, Breakpoints, Breakpoints
-@subsection Setting Breakpoints
-
-@kindex break
-@kindex b
-Breakpoints are set with the @code{break} command (abbreviated @code{b}).
-
-You have several ways to say where the breakpoint should go.
-
-@table @code
-@item break @var{function}
-Set a breakpoint at entry to function @var{function}. When using source
-languages that permit overloading of symbols, such as C++,
-@var{function} may refer to more than one possible place to break.
-@xref{Breakpoint Menus}, for a discussion of that situation.
-
-@item break +@var{offset}
-@itemx break -@var{offset}
-Set a breakpoint some number of lines forward or back from the position
-at which execution stopped in the currently selected frame.
-
-@item break @var{linenum}
-Set a breakpoint at line @var{linenum} in the current source file.
-That file is the last file whose source text was printed. This
-breakpoint will stop the program just before it executes any of the
-code on that line.
-
-@item break @var{filename}:@var{linenum}
-Set a breakpoint at line @var{linenum} in source file @var{filename}.
-
-@item break @var{filename}:@var{function}
-Set a breakpoint at entry to function @var{function} found in file
-@var{filename}. Specifying a file name as well as a function name is
-superfluous except when multiple files contain similarly named
-functions.
-
-@item break *@var{address}
-Set a breakpoint at address @var{address}. You can use this to set
-breakpoints in parts of the program which do not have debugging
-information or source files.
-
-@item break
-When called without any arguments, @code{break} sets a breakpoint at the
-next instruction to be executed in the selected stack frame
-(@pxref{Stack}). In any selected frame but the innermost, this will
-cause the program to stop as soon as control returns to that frame.
-This is similar to the effect of a @code{finish} command in the frame
-inside the selected frame---except that @code{finish} doesn't leave an
-active breakpoint. If you use @code{break} without an argument in the
-innermost frame, _GDBN__ will stop the next time it reaches the current
-location; this may be useful inside loops.
-
-_GDBN__ normally ignores breakpoints when it resumes execution, until at
-least one instruction has been executed. If it did not do this, you
-would be unable to proceed past a breakpoint without first disabling the
-breakpoint. This rule applies whether or not the breakpoint already
-existed when the program stopped.
-
-@item break @dots{} if @var{cond}
-Set a breakpoint with condition @var{cond}; evaluate the expression
-@var{cond} each time the breakpoint is reached, and stop only if the
-value is nonzero. @samp{@dots{}} stands for one of the possible
-arguments described above (or no argument) specifying where to break.
-@xref{Conditions}, for more information on breakpoint conditions.
-
-@item tbreak @var{args}
-@kindex tbreak
-Set a breakpoint enabled only for one stop. @var{args} are the
-same as in the @code{break} command, and the breakpoint is set in the same
-way, but the breakpoint is automatically disabled the first time it
-is hit. @xref{Disabling}.
-
-@item rbreak @var{regex}
-@kindex rbreak
-Set a breakpoint on all functions matching @var{regex}. This is
-useful for setting breakpoints on overloaded functions that are not
-members of any special classes. This command sets an unconditional
-breakpoint on all matches, printing a list of all breakpoints it set.
-Once these breakpoints are set, they are treated just like the
-breakpoints set with the @code{break} command. They can be deleted,
-disabled, made conditional, etc., in the standard ways.
-
-@kindex info breakpoints
-@kindex $_
-@item info breakpoints
-The command @code{info breakpoints} prints a list of all breakpoints
-(but not watchpoints) set and not deleted, showing their numbers, where
-in the program they are, and any special features in use for them.
-Disabled breakpoints are included in the list, but marked as disabled.
-@code{info break} with a breakpoint number as argument lists only that
-breakpoint. The convenience variable @code{$_} and the default
-examining-address for the @code{x} command are set to the address of the
-last breakpoint listed (@pxref{Memory}). The equivalent command for
-watchpoints is @code{info watch}.
-@end table
-
-_GDBN__ allows you to set any number of breakpoints at the same place in the
-program. There is nothing silly or meaningless about this. When the
-breakpoints are conditional, this is even useful (@pxref{Conditions}).
-
-@node Set Watchpoints, Exception Handling, Set Breaks, Breakpoints
-@subsection Setting Watchpoints
-@cindex setting watchpoints
-You can use a watchpoint to stop execution whenever the value of an
-expression changes, without having to predict a particular place in the
-inferior process where this may happen.
-
-Watchpoints currently execute two orders of magnitude more slowly than
-other breakpoints, but this can well be worth it to catch errors where
-you have no clue what part of your program is the culprit. Some
-processors provide special hardware to implement this feature; future
-releases of _GDBN__ will use such hardware if it is available.
-
-@table @code
-@kindex watch
-@item watch @var{expr}
-Set a watchpoint for an expression.
-
-@kindex info watchpoints
-@item info watchpoints
-This command prints a list of watchpoints; it is otherwise similar to
-@code{info break}.
-@end table
-
-@node Exception Handling, Delete Breaks, Set Watchpoints, Breakpoints
-@subsection Breakpoints and Exceptions
-@cindex exception handlers
-
-Some languages, such as GNU C++, implement exception handling. _GDBN__
-can be used to examine what caused the program to raise an exception
-and to list the exceptions the program is prepared to handle at a
-given point in time.
-
-@table @code
-@item catch @var{exceptions}
-@kindex catch
-
-You can set breakpoints at active exception handlers by using the
-@code{catch} command. @var{exceptions} is a list of names of exceptions
-to catch.
-@end table
-
-You can use @code{info catch} to list active exception handlers;
-@pxref{Frame Info}.
-
-There are currently some limitations to exception handling in _GDBN__.
-These will be corrected in a future release.
-
-@itemize @bullet
-@item
-If you call a function interactively, _GDBN__ normally returns
-control to you when the function has finished executing. If the call
-raises an exception, however, the call may bypass the mechanism that
-returns control to the user and cause the program to simply continue
-running until it hits a breakpoint, catches a signal that _GDBN__ is
-listening for, or exits.
-@item
-You cannot raise an exception interactively.
-@item
-You cannot interactively install an exception handler.
-@end itemize
-
-@cindex raise exceptions
-Sometimes @code{catch} is not the best way to debug exception handling:
-if you need to know exactly where an exception is raised, it's better to
-stop @emph{before} the exception handler is called, since that way you
-can see the stack before any unwinding takes place. If you set a
-breakpoint in an exception handler instead, it may not be easy to find
-out where the exception was raised.
-
-To stop just before an exception handler is called, you need some
-knowledge of the implementation. In the case of GNU C++ exception are
-raised by calling a library function named @code{__raise_exception}
-which has the following ANSI C interface:
-
-@example
- /* ADDR is where the exception identifier is stored.
- ID is the exception identifier. */
- void __raise_exception (void **@var{addr}, void *@var{id});
-@end example
-
-@noindent
-To make the debugger catch all exceptions before any stack
-unwinding takes place, set a breakpoint on @code{__raise_exception}
-(@pxref{Breakpoints}).
-
-With a conditional breakpoint (@xref{Conditions}) that depends on the
-value of @var{id}, you can stop your program when a specific exception
-is raised. You can use multiple conditional breakpoints to stop the
-program when any of a number of exceptions are raised.
-
-@node Delete Breaks, Disabling, Exception Handling, Breakpoints
-@subsection Deleting Breakpoints
-
-@cindex clearing breakpoints, watchpoints
-@cindex deleting breakpoints, watchpoints
-It is often necessary to eliminate a breakpoint or watchpoint once it
-has done its job and you no longer want the program to stop there. This
-is called @dfn{deleting} the breakpoint. A breakpoint that has been
-deleted no longer exists in any sense; it is forgotten.
-
-With the @code{clear} command you can delete breakpoints according to
-where they are in the program. With the @code{delete} command you can
-delete individual breakpoints or watchpoints by specifying their
-breakpoint numbers.
-
-It is not necessary to delete a breakpoint to proceed past it. _GDBN__
-automatically ignores breakpoints on the first instruction to be executed
-when you continue execution without changing the execution address.
-
-@table @code
-@item clear
-@kindex clear
-Delete any breakpoints at the next instruction to be executed in the
-selected stack frame (@pxref{Selection}). When the innermost frame
-is selected, this is a good way to delete a breakpoint that the program
-just stopped at.
-
-@item clear @var{function}
-@itemx clear @var{filename}:@var{function}
-Delete any breakpoints set at entry to the function @var{function}.
-
-@item clear @var{linenum}
-@itemx clear @var{filename}:@var{linenum}
-Delete any breakpoints set at or within the code of the specified line.
-
-@item delete breakpoints @var{bnums}@dots{}
-@itemx delete @var{bnums}@dots{}
-@itemx delete
-@cindex delete breakpoints
-@kindex delete
-@kindex d
-Delete the breakpoints or watchpoints of the numbers specified as
-arguments. If no argument is specified, delete all breakpoints. You
-can abbreviate this command as @code{d}.
-@end table
-
-@node Disabling, Conditions, Delete Breaks, Breakpoints
-@subsection Disabling Breakpoints
-
-@cindex disabled breakpoints
-@cindex enabled breakpoints
-Rather than deleting a breakpoint or watchpoint, you might prefer to
-@dfn{disable} it. This makes the breakpoint inoperative as if it had
-been deleted, but remembers the information on the breakpoint so that
-you can @dfn{enable} it again later.
-
-You disable and enable breakpoints and watchpoints with the
-@code{enable} and @code{disable} commands, optionally specifying one or
-more breakpoint numbers as arguments. Use @code{info break} or
-@code{info watch} to print a list of breakpoints or watchpoints if you
-don't know which numbers to use.
-
-A breakpoint or watchpoint can have any of four different states of
-enablement:
-
-@itemize @bullet
-@item
-Enabled. The breakpoint will stop the program. A breakpoint made
-with the @code{break} command starts out in this state.
-@item
-Disabled. The breakpoint has no effect on the program.
-@item
-Enabled once. The breakpoint will stop the program, but
-when it does so it will become disabled. A breakpoint made
-with the @code{tbreak} command starts out in this state.
-@item
-Enabled for deletion. The breakpoint will stop the program, but
-immediately after it does so it will be deleted permanently.
-@end itemize
-
-You can use the following commands to enable or disable breakpoints and
-watchpoints:
-
-@table @code
-@item disable breakpoints @var{bnums}@dots{}
-@itemx disable @var{bnums}@dots{}
-@itemx disable
-@kindex disable breakpoints
-@kindex disable
-@kindex dis
-Disable the specified breakpoints---or all breakpoints, if none are
-listed. A disabled breakpoint has no effect but is not forgotten. All
-options such as ignore-counts, conditions and commands are remembered in
-case the breakpoint is enabled again later. You may abbreviate
-@code{disable} as @code{dis}.
-
-@item enable breakpoints @var{bnums}@dots{}
-@itemx enable @var{bnums}@dots{}
-@itemx enable
-@kindex enable breakpoints
-@kindex enable
-Enable the specified breakpoints (or all defined breakpoints). They
-become effective once again in stopping the program, until you specify
-otherwise.
-
-@item enable breakpoints once @var{bnums}@dots{}
-@itemx enable once @var{bnums}@dots{}
-Enable the specified breakpoints temporarily. Each will be disabled
-again the next time it stops the program (unless you have used one of
-these commands to specify a different state before that time comes).
-
-@item enable breakpoints delete @var{bnums}@dots{}
-@itemx enable delete @var{bnums}@dots{}
-Enable the specified breakpoints to work once and then die. Each of
-the breakpoints will be deleted the next time it stops the program
-(unless you have used one of these commands to specify a different
-state before that time comes).
-@end table
-
-Save for a breakpoint set with @code{tbreak} (@pxref{Set Breaks}),
-breakpoints that you set initially enabled; subsequently, they become
-disabled or enabled only when you use one of the commands above. (The
-command @code{until} can set and delete a breakpoint of its own, but it
-will not change the state of your other breakpoints;
-@pxref{Stepping}.)
-
-@node Conditions, Break Commands, Disabling, Breakpoints
-@subsection Break Conditions
-@cindex conditional breakpoints
-@cindex breakpoint conditions
-
-The simplest sort of breakpoint breaks every time the program reaches a
-specified place. You can also specify a @dfn{condition} for a
-breakpoint. A condition is just a Boolean expression in your
-programming language. (@xref{Expressions}). A breakpoint with a
-condition evaluates the expression each time the program reaches it, and
-the program stops only if the condition is true.
-
-Conditions are also accepted for watchpoints; you may not need them,
-since a watchpoint is inspecting the value of an expression anyhow---but
-it might be simpler, say, to just set a watchpoint on a variable name,
-then have a condition that tests whether the new value is an interesting
-one.
-
-Break conditions may have side effects, and may even call functions in your
-program. These may sound like strange things to do, but their effects are
-completely predictable unless there is another enabled breakpoint at the
-same address. (In that case, _GDBN__ might see the other breakpoint first and
-stop the program without checking the condition of this one.) Note that
-breakpoint commands are usually more convenient and flexible for the
-purpose of performing side effects when a breakpoint is reached
-(@pxref{Break Commands}).
-
-Break conditions can be specified when a breakpoint is set, by using
-@samp{if} in the arguments to the @code{break} command. @xref{Set Breaks}.
-They can also be changed at any time with the @code{condition} command.
-The @code{watch} command doesn't recognize the @code{if} keyword;
-@code{condition} is the only way to impose a further condition on a
-watchpoint.
-
-@table @code
-@item condition @var{bnum} @var{expression}
-@kindex condition
-Specify @var{expression} as the break condition for breakpoint or
-watchpoint number @var{bnum}. From now on, this breakpoint will stop
-the program only if the value of @var{expression} is true (nonzero, in
-C). When you call @code{condition}, the expression you specify is
-checked immediately for syntactic correctness, and to determine whether
-symbols in it have referents in the context of your breakpoint. _GDBN__
-does not actually evaluate @var{expression} at the time the
-@code{condition} command is given, however. @xref{Expressions}.
-
-@item condition @var{bnum}
-Remove the condition from breakpoint number @var{bnum}. It becomes
-an ordinary unconditional breakpoint.
-@end table
-
-@cindex ignore count (of breakpoint)
-A special case of a breakpoint condition is to stop only when the
-breakpoint has been reached a certain number of times. This is so
-useful that there is a special way to do it, using the @dfn{ignore
-count} of the breakpoint. Every breakpoint has an ignore count, which
-is an integer. Most of the time, the ignore count is zero, and
-therefore has no effect. But if the program reaches a breakpoint whose
-ignore count is positive, then instead of stopping, it just decrements
-the ignore count by one and continues. As a result, if the ignore count
-value is @var{n}, the breakpoint will not stop the next @var{n} times it
-is reached.
-
-@table @code
-@item ignore @var{bnum} @var{count}
-@kindex ignore
-Set the ignore count of breakpoint number @var{bnum} to @var{count}.
-The next @var{count} times the breakpoint is reached, your program's
-execution will not stop; other than to decrement the ignore count, _GDBN__
-takes no action.
-
-To make the breakpoint stop the next time it is reached, specify
-a count of zero.
-
-@item continue @var{count}
-@itemx c @var{count}
-@itemx fg @var{count}
-@kindex continue @var{count}
-Continue execution of the program, setting the ignore count of the
-breakpoint that the program stopped at to @var{count} minus one.
-Thus, the program will not stop at this breakpoint until the
-@var{count}'th time it is reached.
-
-An argument to this command is meaningful only when the program stopped
-due to a breakpoint. At other times, the argument to @code{continue} is
-ignored.
-
-The synonym @code{fg} is provided purely for convenience, and has
-exactly the same behavior as other forms of the command.
-@end table
-
-If a breakpoint has a positive ignore count and a condition, the condition
-is not checked. Once the ignore count reaches zero, the condition will
-be checked.
-
-You could achieve the effect of the ignore count with a
-condition such as _0__@w{@samp{$foo-- <= 0}}_1__ using a debugger convenience
-variable that is decremented each time. @xref{Convenience Vars}.
-
-@node Break Commands, Breakpoint Menus, Conditions, Breakpoints
-@subsection Breakpoint Command Lists
-
-@cindex breakpoint commands
-You can give any breakpoint (or watchpoint) a series of commands to
-execute when the program stops due to that breakpoint. For example, you
-might want to print the values of certain expressions, or enable other
-breakpoints.
-
-@table @code
-@item commands @var{bnum}
-@itemx @dots{} @var{command-list} @dots{}
-@itemx end
-@kindex commands
-@kindex end
-Specify a list of commands for breakpoint number @var{bnum}. The commands
-themselves appear on the following lines. Type a line containing just
-@code{end} to terminate the commands.
-
-To remove all commands from a breakpoint, use the command
-@code{commands} and follow it immediately by @code{end}; that is, give
-no commands.
-
-With no @var{bnum} argument, @code{commands} refers to the last
-breakpoint or watchpoint set (not to the breakpoint most recently
-encountered).
-@end table
-
-Pressing @key{RET} as a means of repeating the last _GDBN__ command is
-disabled from the time you enter @code{commands} to just after the
-corresponding @code{end}.
-
-You can use breakpoint commands to start the program up again. Simply
-use the @code{continue} command, or @code{step}, or any other command to
-resume execution. However, if you do this, any further commands in the
-same breakpoint's command list are ignored. When the program stops
-again, _GDBN__ will act according to the cause of that stop.
-
-@kindex silent
-If the first command specified is @code{silent}, the usual message about
-stopping at a breakpoint is not printed. This may be desirable for
-breakpoints that are to print a specific message and then continue.
-If the remaining commands too print nothing, you will see no sign that
-the breakpoint was reached at all. @code{silent} is not really a command;
-it is meaningful only at the beginning of the commands for a breakpoint.
-
-The commands @code{echo} and @code{output} that allow you to print precisely
-controlled output are often useful in silent breakpoints. @xref{Output}.
-
-For example, here is how you could use breakpoint commands to print the
-value of @code{x} at entry to @code{foo} whenever @code{x} is positive.
-
-_0__@example
-break foo if x>0
-commands
-silent
-echo x is\040
-output x
-echo \n
-cont
-end
-_1__@end example
-
-One application for breakpoint commands is to correct one bug so you can
-test another. Put a breakpoint just after the erroneous line of code, give
-it a condition to detect the case in which something erroneous has been
-done, and give it commands to assign correct values to any variables that
-need them. End with the @code{continue} command so that the program does not
-stop, and start with the @code{silent} command so that no output is
-produced. Here is an example:
-
-@example
-break 403
-commands
-silent
-set x = y + 4
-cont
-end
-@end example
-
-@cindex lost output
-One deficiency in the operation of automatically continuing breakpoints
-under Unix appears when your program uses raw mode for the terminal.
-_GDBN__ switches back to its own terminal modes (not raw) before executing
-commands, and then must switch back to raw mode when your program is
-continued. This causes any pending terminal input to be lost.
-In the GNU system, this will be fixed by changing the behavior of
-terminal modes.
-
-Under Unix, when you have this problem, you might be able to get around
-it by putting your actions into the breakpoint condition instead of
-commands. For example
-
-@example
-condition 5 (x = y + 4), 0
-@end example
-
-@noindent
-specifies a condition expression (@xref{Expressions}) that will change
-@code{x} as needed, then always have the value zero so the program will not
-stop. Loss of input is avoided here because break conditions are
-evaluated without changing the terminal modes. When you want to have
-nontrivial conditions for performing the side effects, the operators
-@samp{&&}, @samp{||} and @samp{?@dots{}:} may be useful.
-
-@node Breakpoint Menus, Error in Breakpoints, Break Commands, Breakpoints
-@subsection Breakpoint Menus
-@cindex C++ overloading
-@cindex symbol overloading
-
-Some programming languages (notably C++) permit a single function name
-to be defined several times, for application in different contexts.
-This is called @dfn{overloading}. When a function name is overloaded,
-@samp{break @var{function}} is not enough to tell _GDBN__ where you want
-a breakpoint. _GDBN__ responds to this situation by offering you a menu
-of numbered choices for different possible breakpoints, and waiting for
-your selection with the prompt @samp{>}. The first two
-options are always @samp{[0] cancel} and @samp{[1] all}. Typing @kbd{1}
-will set a breakpoint at all the definitions available for
-@var{function}, and typing @kbd{0} will abort the @code{break} command
-without setting any new breakpoints.
-
-For example, the following session excerpt shows an attempt to set a
-breakpoint at the overloaded symbol @code{String::after}. In the
-example, we choose three particular definitions of the function:
-
-@example
-(_GDBP__) b String::after
-[0] cancel
-[1] all
-[2] file:String.cc; line number:867
-[3] file:String.cc; line number:860
-[4] file:String.cc; line number:875
-[5] file:String.cc; line number:853
-[6] file:String.cc; line number:846
-[7] file:String.cc; line number:735
-> 2 4 6
-Breakpoint 1 at 0xb26c: file String.cc, line 867.
-Breakpoint 2 at 0xb344: file String.cc, line 875.
-Breakpoint 3 at 0xafcc: file String.cc, line 846.
-Multiple breakpoints were set.
-Use the "delete" command to delete unwanted breakpoints.
-(_GDBP__)
-@end example
-
-
-@node Error in Breakpoints, , Breakpoint Menus, Breakpoints
-@subsection ``Cannot Insert Breakpoints''
-
-@c FIXME: "cannot insert breakpoints" error, v unclear.
-@c Q in pending mail to Gilmore. ---pesch@cygnus.com, 26mar91
-Under some operating systems, breakpoints cannot be used in a program if
-any other process is running that program. In this situation,
-attempting to run or continue a program with a breakpoint will cause _GDBN__
-to stop the other process.
-
-When this happens, you have three ways to proceed:
-
-@enumerate
-@item
-Remove or disable the breakpoints, then continue.
-
-@item
-Suspend _GDBN__, and copy the file containing the program to a new name.
-Resume _GDBN__ and use the @code{exec-file} command to specify that _GDBN__
-should run the program under that name. Then start the program again.
-
-@c FIXME: RMS commented here "Show example". Maybe when someone
-@c explains the first FIXME: in this section...
-
-@item
-Relink the program so that the text segment is nonsharable, using the
-linker option @samp{-N}. The operating system limitation may not apply
-to nonsharable executables.
-@end enumerate
-
-@node Stepping, Continuing, Breakpoints, Stopping
-@section Stepping
-
-@cindex stepping
-@dfn{Stepping} means setting your program in motion for a limited time,
-so that control will return automatically to _GDBN__ after one line of
-code or one machine instruction. @footnote{Your program might stop even
-sooner, during stepping, since a signal may arrive before your program
-reaches the next source line. Also, since breakpoints are active during
-stepping, your program will stop for them even if it has not gone as far
-as the stepping command specifies.}
-
-A typical technique for using stepping is to put a breakpoint
-(@pxref{Breakpoints}) at the beginning of the function or the section of
-the program in which a problem is believed to lie, run the program until
-it stops at that breakpoint, and then step through the suspect area,
-examining the variables that are interesting, until you see the problem
-happen.
-
-@table @code
-@item step
-@kindex step
-@kindex s
-Continue running the program until control reaches a different source
-line, then stop it and return control to the debugger. This command is
-abbreviated @code{s}.
-
-You may use the @code{step} command when control is within a function
-for which there is no debugging information. In that case, execution
-will proceed until control reaches a different function, or is about to
-return from this function.
-
-@item step @var{count}
-Continue running as in @code{step}, but do so @var{count} times. If a
-breakpoint is reached or a signal not related to stepping occurs before
-@var{count} steps, stepping stops right away.
-
-@item next
-@kindex next
-@kindex n
-Continue to the next source line in the current stack frame. Similar to
-@code{step}, but any function calls appearing within the line of code
-are executed without stopping. Execution stops when control reaches a
-different line of code at the stack level which was executing when the
-@code{next} command was given. This command is abbreviated @code{n}.
-
-An argument is a repeat count, as in @code{step}.
-
-@code{next} within a function that lacks debugging information acts like
-@code{step}, but any function calls appearing within the code of the
-function are executed without stopping.
-
-@item finish
-@kindex finish
-Continue running until just after the selected stack frame returns (or
-until there is some other reason to stop, such as a fatal signal or a
-breakpoint). Print the value returned by the selected stack frame (if
-any).
-
-Contrast this with the @code{return} command (@pxref{Returning}).
-
-@item until
-@kindex until
-@item u
-@kindex u
-Continue running until a source line past the current line, in the
-current stack frame, is reached. This command is used to avoid single
-stepping through a loop more than once. It is like the @code{next}
-command, except that when @code{until} encounters a jump, it
-automatically continues execution until the program counter is greater
-than the address of the jump.
-
-This means that when you reach the end of a loop after single stepping
-though it, @code{until} will cause the program to continue execution
-until the loop is exited. In contrast, a @code{next} command at the end
-of a loop will simply step back to the beginning of the loop, which
-would force you to step through the next iteration.
-
-@code{until} always stops the program if it attempts to exit the current
-stack frame.
-
-@code{until} may produce somewhat counterintuitive results if the order
-of the source lines does not match the actual order of execution. For
-example, in the following excerpt from a debugging session, the @code{f}
-(@code{frame}) command shows that execution is stopped at line
-@code{206}; yet when we use @code{until}, we get to line @code{195}:
-
-@example
-(_GDBP__) f
-#0 main (argc=4, argv=0xf7fffae8) at m4.c:206
-206 expand_input();
-(_GDBP__) until
-195 for ( ; argc > 0; NEXTARG) @{
-@end example
-
-In this case, (as for any C @code{for}-loop), the loop-step expression
-(here, @samp{argc > 0}) is executed @emph{after} the statements in the
-body of the loop, but is written before them. Therefore, the
-@code{until} command appeared to step back to the beginning of the loop
-when it advanced to this expression. However, it has not really gone to
-an earlier statement---not in terms of the actual machine code.
-
-@code{until} with no argument works by means of single
-instruction stepping, and hence is slower than @code{until} with an
-argument.
-
-@item until @var{location}
-@item u @var{location}
-Continue running the program until either the specified location is
-reached, or the current (innermost) stack frame returns. @var{location}
-is any of the forms of argument acceptable to @code{break} (@pxref{Set
-Breaks}). This form of the command uses breakpoints, and hence is
-quicker than @code{until} without an argument.
-
-@item stepi
-@itemx si
-@kindex stepi
-@kindex si
-Execute one machine instruction, then stop and return to the debugger.
-
-It is often useful to do @samp{display/i $pc} when stepping by machine
-instructions. This will cause the next instruction to be executed to
-be displayed automatically at each stop. @xref{Auto Display}.
-
-An argument is a repeat count, as in @code{step}.
-
-@item nexti
-@itemx ni
-@kindex nexti
-@kindex ni
-Execute one machine instruction, but if it is a function call,
-proceed until the function returns.
-
-An argument is a repeat count, as in @code{next}.
-@end table
-
-The @code{continue} command can be used after stepping to resume execution
-until the next breakpoint or signal.
-
-@node Continuing, Signals, Stepping, Stopping
-@section Continuing
-
-After your program stops, most likely you will want it to run some more if
-the bug you are looking for has not happened yet.
-
-@table @code
-@item continue
-@kindex continue
-Continue running the program at the place where it stopped.
-@end table
-
-If the program stopped at a breakpoint, the place to continue running
-is the address of the breakpoint. You might expect that continuing would
-just stop at the same breakpoint immediately. In fact, @code{continue}
-takes special care to prevent that from happening. You do not need
-to disable the breakpoint to proceed through it after stopping there.
-You can, however, specify an ignore-count for the breakpoint that the
-program stopped at, by means of an argument to the @code{continue} command.
-@xref{Conditions}.
-
-If the program stopped because of a signal other than @code{SIGINT} or
-@code{SIGTRAP}, continuing will cause the program to see that signal.
-You may not want this to happen. For example, if the program stopped
-due to some sort of memory reference error, you might store correct
-values into the erroneous variables and continue, hoping to see more
-execution; but the program would probably terminate immediately as
-a result of the fatal signal once it sees the signal. To prevent this,
-you can continue with @samp{signal 0}. @xref{Signaling}. You can
-also act in advance to control what signals your program will see, using
-the @code{handle} command (@pxref{Signals}).
-
-@node Signals, , Continuing, Stopping
-@section Signals
-@cindex signals
-
-A signal is an asynchronous event that can happen in a program. The
-operating system defines the possible kinds of signals, and gives each
-kind a name and a number. For example, in Unix @code{SIGINT} is the
-signal a program gets when you type an interrupt (often @kbd{C-c});
-@code{SIGSEGV} is the signal a program gets from referencing a place in
-memory far away from all the areas in use; @code{SIGALRM} occurs when
-the alarm clock timer goes off (which happens only if the program has
-requested an alarm).
-
-@cindex fatal signals
-Some signals, including @code{SIGALRM}, are a normal part of the
-functioning of the program. Others, such as @code{SIGSEGV}, indicate
-errors; these signals are @dfn{fatal} (kill the program immediately) if the
-program has not specified in advance some other way to handle the signal.
-@code{SIGINT} does not indicate an error in the program, but it is normally
-fatal so it can carry out the purpose of the interrupt: to kill the program.
-
-_GDBN__ has the ability to detect any occurrence of a signal in the program
-running under _GDBN__'s control. You can tell _GDBN__ in advance what to do for
-each kind of signal.
-
-@cindex handling signals
-Normally, _GDBN__ is set up to ignore non-erroneous signals like @code{SIGALRM}
-(so as not to interfere with their role in the functioning of the program)
-but to stop the program immediately whenever an error signal happens.
-You can change these settings with the @code{handle} command.
-
-@table @code
-@item info signals
-@kindex info signals
-Print a table of all the kinds of signals and how _GDBN__ has been told to
-handle each one. You can use this to see the signal numbers of all
-the defined types of signals.
-
-@item handle @var{signal} @var{keywords}@dots{}
-@kindex handle
-Change the way _GDBN__ handles signal @var{signal}. @var{signal} can be the
-number of a signal or its name (with or without the @samp{SIG} at the
-beginning). The @var{keywords} say what change to make.
-@end table
-
-@c @group
-The keywords allowed by the @code{handle} command can be abbreviated.
-Their full names are:
-
-@table @code
-@item nostop
-_GDBN__ should not stop the program when this signal happens. It may
-still print a message telling you that the signal has come in.
-
-@item stop
-_GDBN__ should stop the program when this signal happens. This implies
-the @code{print} keyword as well.
-
-@item print
-_GDBN__ should print a message when this signal happens.
-
-@item noprint
-_GDBN__ should not mention the occurrence of the signal at all. This
-implies the @code{nostop} keyword as well.
-
-@item pass
-_GDBN__ should allow the program to see this signal; the program will be
-able to handle the signal, or may be terminated if the signal is fatal
-and not handled.
-
-@item nopass
-_GDBN__ should not allow the program to see this signal.
-@end table
-@c @end group
-
-When a signal has been set to stop the program, the program cannot see the
-signal until you continue. It will see the signal then, if @code{pass} is
-in effect for the signal in question @i{at that time}. In other words,
-after _GDBN__ reports a signal, you can use the @code{handle} command with
-@code{pass} or @code{nopass} to control whether that signal will be seen by
-the program when you later continue it.
-
-You can also use the @code{signal} command to prevent the program from
-seeing a signal, or cause it to see a signal it normally would not see,
-or to give it any signal at any time. @xref{Signaling}.
-
diff --git a/gdb/doc/gdb.symb-m4 b/gdb/doc/gdb.symb-m4
deleted file mode 100755
index e257d31..0000000
--- a/gdb/doc/gdb.symb-m4
+++ /dev/null
@@ -1,132 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Symbols, Altering, Data, Top
-@chapter Examining the Symbol Table
-
-The commands described in this section allow you to inquire about the
-symbols (names of variables, functions and types) defined in your
-program. This information is inherent in the text of your program and
-does not change as the program executes. _GDBN__ finds it in your
-program's symbol table, in the file indicated when you started _GDBN__
-(@pxref{File Options}), or by one of the file-management commands
-(@pxref{Files}).
-
-@table @code
-@item info address @var{symbol}
-@kindex info address
-Describe where the data for @var{symbol} is stored. For a register
-variable, this says which register it is kept in. For a non-register
-local variable, this prints the stack-frame offset at which the variable
-is always stored.
-
-Note the contrast with @samp{print &@var{symbol}}, which does not work
-at all for a register variables, and for a stack local variable prints
-the exact address of the current instantiation of the variable.
-
-@item whatis @var{exp}
-@kindex whatis
-Print the data type of expression @var{exp}. @var{exp} is not
-actually evaluated, and any side-effecting operations (such as
-assignments or function calls) inside it do not take place.
-@xref{Expressions}.
-
-@item whatis
-Print the data type of @code{$}, the last value in the value history.
-
-@item ptype @var{typename}
-@kindex ptype
-Print a description of data type @var{typename}. @var{typename} may be
-the name of a type, or for C code it may have the form
-@samp{struct @var{struct-tag}}, @samp{union @var{union-tag}} or
-@samp{enum @var{enum-tag}}.@refill
-
-@item ptype @var{exp}
-Print a description of the type of expression @var{exp}. @code{ptype}
-differs from @code{whatis} by printing a detailed description, instead of just
-the name of the type. For example, if your program declares a variable
-as
-@example
-struct complex @{double real; double imag;@} v;
-@end example
-@noindent
-compare the output of the two commands:
-@example
-(_GDBP__) whatis v
-type = struct complex
-(_GDBP__) ptype v
-type = struct complex @{
- double real;
- double imag;
-@}
-@end example
-
-@item info types @var{regexp}
-@itemx info types
-@kindex info types
-Print a brief description of all types whose name matches @var{regexp}
-(or all types in your program, if you supply no argument). Each
-complete typename is matched as though it were a complete line; thus,
-@samp{i type value} gives information on all types in your program whose
-name includes the string @code{value}, but @samp{i type ^value$} gives
-information only on types whose complete name is @code{value}.
-
-This command differs from @code{ptype} in two ways: first, like
-@code{whatis}, it does not print a detailed description; second, it
-lists all source files where a type is defined.
-
-@item info source
-@kindex info source
-Show the name of the current source file---that is, the source file for
-the function containing the current point of execution.
-
-@item info sources
-@kindex info sources
-Print the names of all source files in the program for which there is
-debugging information, organized into two lists: those for which symbols
-have been read in, and those for which symbols will be read in on
-demand.
-@c FIXME: above passive AND awkward!
-
-@item info functions
-@kindex info functions
-Print the names and data types of all defined functions.
-
-@item info functions @var{regexp}
-Print the names and data types of all defined functions
-whose names contain a match for regular expression @var{regexp}.
-Thus, @samp{info fun step} finds all functions whose names
-include @code{step}; @samp{info fun ^step} finds those whose names
-start with @code{step}.
-
-@item info variables
-@kindex info variables
-Print the names and data types of all variables that are declared
-outside of functions (i.e., excluding local variables).
-
-@item info variables @var{regexp}
-Print the names and data types of all variables (except for local
-variables) whose names contain a match for regular expression
-@var{regexp}.
-
-
-@ignore
-This was never implemented.
-@item info methods
-@itemx info methods @var{regexp}
-@kindex info methods
-The @code{info methods} command permits the user to examine all defined
-methods within C++ program, or (with the @var{regexp} argument) a
-specific set of methods found in the various C++ classes. Many
-C++ classes provide a large number of methods. Thus, the output
-from the @code{ptype} command can be overwhelming and hard to use. The
-@code{info-methods} command filters the methods, printing only those
-which match the regular-expression @var{regexp}.
-@end ignore
-
-@item printsyms @var{filename}
-@kindex printsyms
-Write a complete dump of the debugger's symbol data into the
-file @var{filename}.
-@end table
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
deleted file mode 100644
index 4c4dfd5..0000000
--- a/gdb/doc/gdb.texinfo
+++ /dev/null
@@ -1,7934 +0,0 @@
-_dnl__ -*-Texinfo-*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-\input texinfo
-@setfilename _GDBP__.info
-@c $Id$
-@c THIS MANUAL REQUIRES TEXINFO-2 macros and info-makers to format properly.
-@c
-@c NOTE: this manual is marked up for preprocessing with a collection
-@c of m4 macros called "pretex.m4". If you see <_if__> and <_fi__>
-@c scattered around the source, you have the full source before
-@c preprocessing; if you don't, you have the source configured for
-@c _HOST__ architectures (and you can of course get the full source,
-@c with all configurations, from wherever you got this).
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Gdb: (gdb). The GNU debugger.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-_if__(0)
-
-THIS IS THE SOURCE PRIOR TO PREPROCESSING. The full source needs to
-be run through m4 before either tex- or info- formatting: for example,
-_0__
- m4 pretex.m4 none.m4 all.m4 gdb.texinfo >gdb-all.texinfo
-_1__
-will produce (assuming your path finds either GNU m4 >= 0.84, or SysV
-m4; Berkeley won't do) a file suitable for formatting. See the text in
-"pretex.m4" for a fuller explanation (and the macro definitions).
-
-_fi__(0)
-_include__(gdbVN.m4)
-@c @smallbook
-@c @cropmarks
-@tex
-\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision$} % For use in headers, footers too
-@end tex
-@c
-@syncodeindex ky cp
-@c FOR UPDATES LEADING TO THIS DRAFT, GDB CHANGELOG CONSULTED BETWEEN:
-@c Fri Oct 11 23:27:06 1991 John Gilmore (gnu at cygnus.com)
-@c Sat Dec 22 02:51:40 1990 John Gilmore (gnu at cygint)
-@ifinfo
-This file documents the GNU debugger _GDBN__.
-
-Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
-@end ifinfo
-@c @smallbook
-@setchapternewpage odd
-_if__(_GENERIC__)
-@settitle Using _GDBN__ (<v>_GDB_VN__)
-_fi__(_GENERIC__)
-_if__(!_GENERIC__)
-@settitle Using _GDBN__ <v>_GDB_VN__ (_HOST__)
-_fi__(!_GENERIC__)
-@iftex
-@finalout
-@end iftex
-@titlepage
-@title Using _GDBN__
-@subtitle A Guide to the GNU Source-Level Debugger
-_if__(!_GENERIC__)
-@subtitle On _HOST__ Systems
-_fi__(!_GENERIC__)
-@sp 1
-@subtitle _GDBN__ version _GDB_VN__
-@subtitle November 1991
-@c TEXI2ROFF-KILL
-@c let's be nice to texi2roff, it can't be expected to know about hfill...
-@author Richard M. Stallman@qquad @hfill Free Software Foundation
-@author Roland H. Pesch@qquad @hfill Cygnus Support
-@ignore
-@c END TEXI2ROFF-KILL
-@c sneaky, eh?
-@author Richard M. Stallman, Free Software Foundation
-@author Roland H. Pesch, Cygnus Support
-@c TEXI2ROFF-KILL
-@end ignore
-@c END TEXI2ROFF-KILL
-@page
-@tex
-{\parskip=0pt
-\hfill rms\@ai.mit.edu, pesch\@cygnus.com\par
-\hfill {\it Using _GDBN__}, \manvers\par
-\hfill \TeX{}info \texinfoversion\par
-}
-@end tex
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
-@end titlepage
-@page
-
-@node Top, Summary, (dir), (dir)
-@ifinfo
-This file describes version _GDB_VN__ of GDB, the GNU symbolic debugger.
-@end ifinfo
-
-@menu
-* Summary:: Summary of _GDBN__
-* New Features:: New Features in _GDBN__ version _GDB_VN__
-* Sample Session:: A Sample _GDBN__ Session
-* Invocation:: Getting In and Out of _GDBN__
-* Commands:: _GDBN__ Commands
-* Running:: Running Programs Under _GDBN__
-* Stopping:: Stopping and Continuing
-* Stack:: Examining the Stack
-* Source:: Examining Source Files
-* Data:: Examining Data
-* Languages:: Using _GDBN__ with Different Languages
-* Symbols:: Examining the Symbol Table
-* Altering:: Altering Execution
-* _GDBN__ Files:: _GDBN__'s Files
-* Targets:: Specifying a Debugging Target
-* Controlling _GDBN__:: Controlling _GDBN__
-* Sequences:: Canned Sequences of Commands
-* Emacs:: Using _GDBN__ under GNU Emacs
-* _GDBN__ Bugs:: Reporting Bugs in _GDBN__
-* Renamed Commands::
-* Installing _GDBN__:: Installing _GDBN__
-* Copying:: GNU GENERAL PUBLIC LICENSE
-* Index:: Index
-
- --- The Detailed Node Listing ---
-
-Summary of _GDBN__
-
-* Free Software:: Free Software
-* Contributors:: Contributors to _GDBN__
-
-Getting In and Out of _GDBN__
-
-* Starting _GDBN__:: Starting _GDBN__
-* Leaving _GDBN__:: Leaving _GDBN__
-* Shell Commands:: Shell Commands
-
-Starting _GDBN__
-
-* File Options:: Choosing Files
-* Mode Options:: Choosing Modes
-
-_GDBN__ Commands
-
-* Command Syntax:: Command Syntax
-* Help:: Getting Help
-
-Running Programs Under _GDBN__
-
-* Compilation:: Compiling for Debugging
-* Starting:: Starting your Program
-* Arguments:: Your Program's Arguments
-* Environment:: Your Program's Environment
-* Working Directory:: Your Program's Working Directory
-* Input/Output:: Your Program's Input and Output
-* Attach:: Debugging an Already-Running Process
-* Kill Process:: Killing the Child Process
-
-Stopping and Continuing
-
-* Breakpoints:: Breakpoints, Watchpoints, and Exceptions
-* Continuing and Stepping:: Resuming Execution
-* Signals:: Signals
-
-Breakpoints, Watchpoints, and Exceptions
-
-* Set Breaks:: Setting Breakpoints
-* Set Watchpoints:: Setting Watchpoints
-* Exception Handling:: Breakpoints and Exceptions
-* Delete Breaks:: Deleting Breakpoints
-* Disabling:: Disabling Breakpoints
-* Conditions:: Break Conditions
-* Break Commands:: Breakpoint Command Lists
-* Breakpoint Menus:: Breakpoint Menus
-* Error in Breakpoints:: ``Cannot insert breakpoints''
-
-Examining the Stack
-
-* Frames:: Stack Frames
-* Backtrace:: Backtraces
-* Selection:: Selecting a Frame
-* Frame Info:: Information on a Frame
-
-Examining Source Files
-
-* List:: Printing Source Lines
-* Search:: Searching Source Files
-* Source Path:: Specifying Source Directories
-* Machine Code:: Source and Machine Code
-
-Examining Data
-
-* Expressions:: Expressions
-* Variables:: Program Variables
-* Arrays:: Artificial Arrays
-* Output formats:: Output formats
-* Memory:: Examining Memory
-* Auto Display:: Automatic Display
-* Print Settings:: Print Settings
-* Value History:: Value History
-* Convenience Vars:: Convenience Variables
-* Registers:: Registers
-* Floating Point Hardware:: Floating Point Hardware
-
-Using GDB with Different Languages
-
-* Setting:: Switching between source languages
-* Show:: Displaying the language
-* Checks:: Type and Range checks
-* Support:: Supported languages
-
-Switching between source languages
-
-* Manually:: Setting the working language manually
-* Automatically:: Having GDB infer the source language
-
-Type and range Checking
-
-* Type Checking:: An overview of type checking
-* Range Checking:: An overview of range checking
-
-Supported Languages
-
-* C:: C and C++
-* Modula-2:: Modula-2
-
-C and C++
-
-* C Operators:: C and C++ Operators
-* C Constants:: C and C++ Constants
-* Cplusplus expressions:: C++ Expressions
-* C Defaults:: Default settings for C and C++
-* C Checks:: C and C++ Type and Range Checks
-* Debugging C:: _GDBN__ and C
-* Debugging C plus plus:: Special features for C++
-
-Modula-2
-
-* M2 Operators:: Built-in operators
-* Builtin Func/Proc:: Built-in Functions and Procedures
-* M2 Constants:: Modula-2 Constants
-* M2 Defaults:: Default settings for Modula-2
-* Deviations:: Deviations from standard Modula-2
-* M2 Checks:: Modula-2 Type and Range Checks
-* M2 Scope:: The scope operators @code{::} and @code{.}
-* GDB/M2:: GDB and Modula-2
-
-Altering Execution
-
-* Assignment:: Assignment to Variables
-* Jumping:: Continuing at a Different Address
-* Signaling:: Giving the Program a Signal
-* Returning:: Returning from a Function
-* Calling:: Calling your Program's Functions
-* Patching:: Patching your Program
-
-_GDBN__'s Files
-
-* Files:: Commands to Specify Files
-* Symbol Errors:: Errors Reading Symbol Files
-
-Specifying a Debugging Target
-
-* Active Targets:: Active Targets
-* Target Commands:: Commands for Managing Targets
-* Remote:: Remote Debugging
-
-Remote Debugging
-
-* i960-Nindy Remote:: _GDBN__ with a Remote i960 (Nindy)
-* EB29K Remote:: _GDBN__ with a Remote EB29K
-* VxWorks Remote:: _GDBN__ and VxWorks
-
-_GDBN__ with a Remote i960 (Nindy)
-
-* Nindy Startup:: Startup with Nindy
-* Nindy Options:: Options for Nindy
-* Nindy reset:: Nindy Reset Command
-
-_GDBN__ with a Remote EB29K
-
-* Comms (EB29K):: Communications Setup
-* gdb-EB29K:: EB29K cross-debugging
-* Remote Log:: Remote Log
-
-_GDBN__ and VxWorks
-
-* VxWorks connection:: Connecting to VxWorks
-* VxWorks download:: VxWorks Download
-* VxWorks attach:: Running Tasks
-
-Controlling _GDBN__
-
-* Prompt:: Prompt
-* Editing:: Command Editing
-* History:: Command History
-* Screen Size:: Screen Size
-* Numbers:: Numbers
-* Messages/Warnings:: Optional Warnings and Messages
-
-Canned Sequences of Commands
-
-* Define:: User-Defined Commands
-* Command Files:: Command Files
-* Output:: Commands for Controlled Output
-
-Reporting Bugs in _GDBN__
-
-* Bug Criteria:: Have You Found a Bug?
-* Bug Reporting:: How to Report Bugs
-
-Installing GDB
-
-* Subdirectories:: Configuration subdirectories
-* Config Names:: Specifying names for hosts and targets
-* configure Options:: Summary of options for configure
-* Formatting Documentation:: How to format and print GDB documentation
-@end menu
-
-@node Summary, New Features, Top, Top
-@unnumbered Summary of _GDBN__
-
-The purpose of a debugger such as _GDBN__ is to allow you to see what is
-going on ``inside'' another program while it executes---or what another
-program was doing at the moment it crashed.
-
-_GDBN__ can do four main kinds of things (plus other things in support of
-these) to help you catch bugs in the act:
-
-@itemize @bullet
-@item
-Start your program, specifying anything that might affect its behavior.
-
-@item
-Make your program stop on specified conditions.
-
-@item
-Examine what has happened, when your program has stopped.
-
-@item
-Change things in your program, so you can experiment with correcting the
-effects of one bug and go on to learn about another.
-@end itemize
-
-You can use _GDBN__ to debug programs written in C, C++, and Modula-2.
-Fortran support will be added when a GNU Fortran compiler is ready.
-
-@menu
-* Free Software:: Free Software
-* Contributors:: Contributors to GDB
-@end menu
-
-@node Free Software, Contributors, Summary, Summary
-@unnumberedsec Free Software
-_GDBN__ is @dfn{free software}, protected by the GNU General Public License (GPL).
-The GPL gives you the freedom to copy or adapt a licensed
-program---but every person getting a copy also gets with it the
-freedom to modify that copy (which means that they must get access to
-the source code), and the freedom to distribute further copies.
-Typical software companies use copyrights to limit your freedoms; the
-Free Software Foundation uses the GPL to preserve these freedoms.
-
-Fundamentally, the General Public License is a license which says that
-you have these freedoms and that you can't take these freedoms away
-from anyone else.
-
-@c FIXME: (passim) go through all xrefs, expanding to use text headings
-For full details, @pxref{Copying}.
-@node Contributors, , Free Software, Summary
-@unnumberedsec Contributors to GDB
-
-Richard Stallman was the original author of GDB, and of many other GNU
-programs. Many others have contributed to its development. This
-section attempts to credit major contributors. One of the virtues of
-free software is that everyone is free to contribute to it; with
-regret, we cannot actually acknowledge everyone here. The file
-@file{ChangeLog} in the GDB distribution approximates a blow-by-blow
-account.
-
-Changes much prior to version 2.0 are lost in the mists of time.
-
-@quotation
-@emph{Plea:} Additions to this section are particularly welcome. If you
-or your friends (or enemies; let's be evenhanded) have been unfairly
-omitted from this list, we would like to add your names!
-@end quotation
-
-So that they may not regard their long labor as thankless, we
-particularly thank those who shepherded GDB through major releases: John
-Gilmore (releases _GDB_VN__, 4.1, 4.0); Jim Kingdon (releases 3.9, 3.5,
-3.4, 3.3); and Randy Smith (releases 3.2, 3.1, 3.0). As major
-maintainer of GDB for some period, each contributed significantly to the
-structure, stability, and capabilities of the entire debugger.
-
-Richard Stallman, assisted at various times by Pete TerMaat, Chris
-Hanson, and Richard Mlynarik, handled releases through 2.8.
-
-Michael Tiemann is the author of most of the GNU C++ support in GDB,
-with significant additional contributions from Per Bothner. James
-Clark wrote the GNU C++ demangler. Early work on C++ was by Peter
-TerMaat (who also did much general update work leading to release 3.0).
-
-GDB _GDB_VN__ uses the BFD subroutine library to examine multiple
-object-file formats; BFD was a joint project of V. Gumby
-Henkel-Wallace, Rich Pixley, Steve Chamberlain, and John Gilmore.
-
-David Johnson wrote the original COFF support; Pace Willison did
-the original support for encapsulated COFF.
-
-Adam de Boor and Bradley Davis contributed the ISI Optimum V support.
-Per Bothner, Noboyuki Hikichi, and Alessandro Forin contributed MIPS
-support. Jean-Daniel Fekete contributed Sun 386i support. Chris
-Hanson improved the HP9000 support. Noboyuki Hikichi and Tomoyuki
-Hasei contributed Sony/News OS 3 support. David Johnson contributed
-Encore Umax support. Jyrki Kuoppala contributed Altos 3068 support.
-Keith Packard contributed NS32K support. Doug Rabson contributed
-Acorn Risc Machine support. Chris Smith contributed Convex support
-(and Fortran debugging). Jonathan Stone contributed Pyramid support.
-Michael Tiemann contributed SPARC support. Tim Tucker contributed
-support for the Gould NP1 and Gould Powernode. Pace Willison
-contributed Intel 386 support. Jay Vosburgh contributed Symmetry
-support.
-
-Rich Schaefer and Peter Schauer helped with support of SunOS shared
-libraries.
-
-Jay Fenlason and Roland McGrath ensured that GDB and GAS agree about
-several machine instruction sets.
-
-Patrick Duval, Ted Goldstein, Vikram Koka and Glenn Engel helped
-develop remote debugging. Intel Corporation and Wind River Systems
-contributed remote debugging modules for their products.
-
-Brian Fox is the author of the readline libraries providing
-command-line editing and command history.
-
-Andrew Beers of SUNY Buffalo wrote the language-switching code and
-the Modula-2 support, and contributed the Languages chapter of this
-manual.
-
-@node New Features, Sample Session, Summary, Top
-@unnumbered New Features since _GDBN__ version 3.5
-
-@table @emph
-@item Targets
-Using the new command @code{target}, you can select at runtime whether
-you are debugging local files, local processes, standalone systems over
-a serial port, realtime systems over a TCP/IP connection, etc. The
-command @code{load} can download programs into a remote system. Serial
-stubs are available for Motorola 680x0 and Intel 80386 remote systems;
-_GDBN__ also supports debugging realtime processes running under
-VxWorks, using SunRPC Remote Procedure Calls over TCP/IP to talk to a
-debugger stub on the target system. Internally, _GDBN__ now uses a
-function vector to mediate access to different targets; if you need to
-add your own support for a remote protocol, this makes it much easier.
-
-@item Watchpoints
-_GDBN__ now sports watchpoints as well as breakpoints. You can use a
-watchpoint to stop execution whenever the value of an expression
-changes, without having to predict a particular place in your program
-where this may happen.
-
-@item Wide Output
-Commands that issue wide output now insert newlines at places designed
-to make the output more readable.
-
-@item Object Code Formats
-_GDBN__ uses a new library called the Binary File Descriptor (BFD)
-Library to permit it to switch dynamically, without reconfiguration or
-recompilation, between different object-file formats. Formats currently
-supported are COFF, a.out, and the Intel 960 b.out; files may be read as
-.o's, archive libraries, or core dumps. BFD is available as a
-subroutine library so that other programs may take advantage of it, and
-the other GNU binary utilities are being converted to use it.
-
-@item Configuration and Ports
-Compile-time configuration (to select a particular architecture and
-operating system) is much easier. The script @code{configure} now
-allows you to configure _GDBN__ as either a native debugger or a
-cross-debugger. @xref{Installing _GDBN__} for details on how to
-configure and on what architectures are now available.
-
-@item Interaction
-The user interface to _GDBN__'s control variables has been simplified
-and consolidated in two commands, @code{set} and @code{show}. Output
-lines are now broken at readable places, rather than overflowing onto
-the next line. You can suppress output of machine-level addresses,
-displaying only source language information.
-
-
-@item C++
-_GDBN__ now supports C++ multiple inheritance (if used with a GCC
-version 2 compiler), and also has limited support for C++ exception
-handling, with the commands @code{catch} and @code{info catch}: _GDBN__
-can break when an exception is raised, before the stack is peeled back
-to the exception handler's context.
-
-@item Modula-2
-_GDBN__ now has preliminary support for the GNU Modula-2 compiler,
-currently under development at the State University of New York at
-Buffalo. Coordinated development of both _GDBN__ and the GNU Modula-2
-compiler will continue through the fall of 1991 and into 1992. Other
-Modula-2 compilers are currently not supported, and attempting to debug
-programs compiled with them will likely result in an error as the symbol
-table of the executable is read in.
-
-@item Command Rationalization
-Many _GDBN__ commands have been renamed to make them easier to remember
-and use. In particular, the subcommands of @code{info} and
-@code{show}/@code{set} are grouped to make the former refer to the state
-of your program, and the latter refer to the state of _GDBN__ itself.
-@xref{Renamed Commands}, for details on what commands were renamed.
-
-@item Shared Libraries
-_GDBN__ _GDB_VN__ can debug programs and core files that use SunOS shared
-libraries.
-
-@item Reference Card
-_GDBN__ _GDB_VN__ has a reference card; @xref{Formatting Documentation} for
-instructions on printing it.
-
-@item Work in Progress
-Kernel debugging for BSD and Mach systems; Tahoe and HPPA architecture
-support.
-
-@end table
-
-@node Sample Session, Invocation, New Features, Top
-@chapter A Sample _GDBN__ Session
-
-You can use this manual at your leisure to read all about _GDBN__.
-However, a handful of commands are enough to get started using the
-debugger. This chapter illustrates these commands.
-
-@iftex
-In this sample session, we emphasize user input like this: @i{input},
-to make it easier to pick out from the surrounding output.
-@end iftex
-
-@c FIXME: this example may not be appropriate for some configs, where
-@c FIXME...primary interest is in remote use.
-_0__
-One of the preliminary versions of GNU @code{m4} (a generic macro
-processor) exhibits the following bug: sometimes, when we change its
-quote strings from the default, the commands used to capture one macro's
-definition in another stop working. In the following short @code{m4}
-session, we define a macro @code{foo} which expands to @code{0000}; we
-then use the @code{m4} builtin @code{defn} to define @code{bar} as the
-same thing. However, when we change the open quote string to
-@code{<QUOTE>} and the close quote string to @code{<UNQUOTE>}, the same
-procedure fails to define a new synonym @code{baz}:
-
-@smallexample
-$ @i{cd gnu/m4}
-$ @i{./m4}
-@i{define(foo,0000)}
-
-@i{foo}
-0000
-@i{define(bar,defn(`foo'))}
-
-@i{bar}
-0000
-@i{changequote(<QUOTE>,<UNQUOTE>)}
-
-@i{define(baz,defn(<QUOTE>foo<UNQUOTE>))}
-@i{baz}
-@i{C-d}
-m4: End of input: 0: fatal error: EOF in string
-@end smallexample
-
-@noindent
-Let's use _GDBN__ to try to see what's going on.
-
-@smallexample
-$ @i{_GDBP__ m4}
-@c FIXME: this falsifies the exact text played out, to permit smallbook
-@c FIXME... format to come out better.
-GDB is free software and you are welcome to distribute copies
- of it under certain conditions; type "show copying" to see
- the conditions.
-There is absolutely no warranty for GDB; type "show warranty"
-for details.
-GDB _GDB_VN__, Copyright 1991 Free Software Foundation, Inc...
-(_GDBP__)
-@end smallexample
-
-@noindent
-_GDBN__ reads only enough symbol data to know where to find the rest
-when needed; as a result, the first prompt comes up very quickly. We
-then tell _GDBN__ to use a narrower display width than usual, so
-that examples will fit in this manual.
-
-@smallexample
-(_GDBP__) @i{set width 70}
-@end smallexample
-
-@noindent
-Let's see how the @code{m4} builtin @code{changequote} works.
-Having looked at the source, we know the relevant subroutine is
-@code{m4_changequote}, so we set a breakpoint there with _GDBN__'s
-@code{break} command.
-
-@smallexample
-(_GDBP__) @i{break m4_changequote}
-Breakpoint 1 at 0x62f4: file builtin.c, line 879.
-@end smallexample
-
-@noindent
-Using the @code{run} command, we start @code{m4} running under _GDBN__
-control; as long as control does not reach the @code{m4_changequote}
-subroutine, the program runs as usual:
-
-@smallexample
-(_GDBP__) @i{run}
-Starting program: /work/Editorial/gdb/gnu/m4/m4
-@i{define(foo,0000)}
-
-@i{foo}
-0000
-@end smallexample
-
-@noindent
-To trigger the breakpoint, we call @code{changequote}. _GDBN__
-suspends execution of @code{m4}, displaying information about the
-context where it stops.
-
-@smallexample
-@i{changequote(<QUOTE>,<UNQUOTE>)}
-
-Breakpoint 1, m4_changequote (argc=3, argv=0x33c70)
- at builtin.c:879
-879 if (bad_argc(TOKEN_DATA_TEXT(argv[0]), argc, 1, 3))
-@end smallexample
-
-@noindent
-Now we use the command @code{n} (@code{next}) to advance execution to
-the next line of the current function.
-
-@smallexample
-(_GDBP__) @i{n}
-882 set_quotes((argc >= 2) ? TOKEN_DATA_TEXT(argv[1])\
- : nil,
-@end smallexample
-
-@noindent
-@code{set_quotes} looks like a promising subroutine. We can go into it
-by using the command @code{s} (@code{step}) instead of @code{next}.
-@code{step} goes to the next line to be executed in @emph{any}
-subroutine, so it steps into @code{set_quotes}.
-
-@smallexample
-(_GDBP__) @i{s}
-set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")
- at input.c:530
-530 if (lquote != def_lquote)
-@end smallexample
-
-@noindent
-The summary display showing the subroutine where @code{m4} is now
-suspended (and its arguments) is called a stack frame display. We can
-use the @code{backtrace} command (which can also be spelled @code{bt}),
-to see where we are in the stack: it displays a stack frame for each
-active subroutine.
-
-@smallexample
-(_GDBP__) @i{bt}
-#0 set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")
- at input.c:530
-#1 0x6344 in m4_changequote (argc=3, argv=0x33c70)
- at builtin.c:882
-#2 0x8174 in expand_macro (sym=0x33320) at macro.c:242
-#3 0x7a88 in expand_token (obs=0x0, t=209696, td=0xf7fffa30)
- at macro.c:71
-#4 0x79dc in expand_input () at macro.c:40
-#5 0x2930 in main (argc=0, argv=0xf7fffb20) at m4.c:195
-@end smallexample
-
-@noindent
-Let's step through a few more lines to see what happens. The first two
-times, we can use @samp{s}; the next two times we use @code{n} to avoid
-falling into the @code{xstrdup} subroutine.
-@smallexample
-(_GDBP__) @i{s}
-0x3b5c 532 if (rquote != def_rquote)
-(_GDBP__) @i{s}
-0x3b80 535 lquote = (lq == nil || *lq == '\0') ? \
-def_lquote : xstrdup(lq);
-(_GDBP__) @i{n}
-536 rquote = (rq == nil || *rq == '\0') ? def_rquote\
- : xstrdup(rq);
-(_GDBP__) @i{n}
-538 len_lquote = strlen(rquote);
-@end smallexample
-
-@noindent
-The last line displayed looks a little odd; let's examine the variables
-@code{lquote} and @code{rquote} to see if they are in fact the new left
-and right quotes we specified. We can use the command @code{p}
-(@code{print}) to see their values.
-
-@smallexample
-(_GDBP__) @i{p lquote}
-$1 = 0x35d40 "<QUOTE>"
-(_GDBP__) @i{p rquote}
-$2 = 0x35d50 "<UNQUOTE>"
-@end smallexample
-
-@noindent
-@code{lquote} and @code{rquote} are indeed the new left and right quotes.
-Let's look at some context; we can display ten lines of source
-surrounding the current line, with the @code{l} (@code{list}) command.
-
-@smallexample
-(_GDBP__) @i{l}
-533 xfree(rquote);
-534
-535 lquote = (lq == nil || *lq == '\0') ? def_lquote\
- : xstrdup (lq);
-536 rquote = (rq == nil || *rq == '\0') ? def_rquote\
- : xstrdup (rq);
-537
-538 len_lquote = strlen(rquote);
-539 len_rquote = strlen(lquote);
-540 @}
-541
-542 void
-@end smallexample
-
-@noindent
-Let's step past the two lines that set @code{len_lquote} and
-@code{len_rquote}, and then examine the values of those variables.
-
-@smallexample
-(_GDBP__) @i{n}
-539 len_rquote = strlen(lquote);
-(_GDBP__) @i{n}
-540 @}
-(_GDBP__) @i{p len_lquote}
-$3 = 9
-(_GDBP__) @i{p len_rquote}
-$4 = 7
-@end smallexample
-
-@noindent
-That certainly looks wrong, assuming @code{len_lquote} and
-@code{len_rquote} are meant to be the lengths of @code{lquote} and
-@code{rquote} respectively. Let's try setting them to better values.
-We can use the @code{p} command for this, since it'll print the value of
-any expression---and that expression can include subroutine calls and
-assignments.
-
-@smallexample
-(_GDBP__) p len_lquote=strlen(lquote)
-$5 = 7
-(_GDBP__) p len_rquote=strlen(rquote)
-$6 = 9
-@end smallexample
-
-@noindent
-Let's see if that fixes the problem of using the new quotes with the
-@code{m4} built-in @code{defn}. We can allow @code{m4} to continue
-executing with the @code{c} (@code{continue}) command, and then try the
-example that caused trouble initially:
-
-@smallexample
-(_GDBP__) @i{c}
-Continuing.
-
-@i{define(baz,defn(<QUOTE>foo<UNQUOTE>))}
-
-baz
-0000
-@end smallexample
-
-@noindent
-Success! The new quotes now work just as well as the default ones. The
-problem seems to have been just the two typos defining the wrong
-lengths. We'll let @code{m4} exit by giving it an EOF as input.
-
-@smallexample
-@i{C-d}
-Program exited normally.
-@end smallexample
-
-@noindent
-The message @samp{Program exited normally.} is from _GDBN__; it
-indicates @code{m4} has finished executing. We can end our _GDBN__
-session with the _GDBN__ @code{quit} command.
-
-@smallexample
-(_GDBP__) @i{quit}
-_1__@end smallexample
-
-@node Invocation, Commands, Sample Session, Top
-@chapter Getting In and Out of _GDBN__
-
-@menu
-* Starting _GDBN__:: Starting _GDBN__
-* Leaving _GDBN__:: Leaving _GDBN__
-* Shell Commands:: Shell Commands
-@end menu
-
-@node Starting _GDBN__, Leaving _GDBN__, Invocation, Invocation
-@section Starting _GDBN__
-
-_GDBN__ is invoked with the shell command @code{_GDBP__}. Once started,
-it reads commands from the terminal until you tell it to exit.
-
-You can run @code{_GDBP__} with no arguments or options; but the most
-usual way to start _GDBN__ is with one argument or two, specifying an
-executable program as the argument:
-@example
-_GDBP__ program
-@end example
-@noindent
-You can also start with both an executable program and a core file specified:
-@example
-_GDBP__ program core
-@end example
-
-You can, instead, specify a process ID as a second argument, if you want
-to debug a running process:
-@example
-_GDBP__ program 1234
-@end example
-@noindent
-would attach _GDBN__ to process @code{1234} (unless you also have a file
-named @file{1234}; _GDBN__ does check for a core file first).
-
-@noindent
-You can further control how _GDBN__ starts up by using command-line
-options. _GDBN__ itself can remind you of the options available:
-@example
-_GDBP__ -help
-@end example
-@noindent
-will display all available options and briefly describe their use
-(@samp{_GDBP__ -h} is a shorter equivalent).
-
-All options and command line arguments you give are processed
-in sequential order. The order makes a difference when the
-@samp{-x} option is used.
-
-@menu
-* File Options:: Choosing Files
-* Mode Options:: Choosing Modes
-_if__(!_GENERIC__)
-_include__(gdbinv-m.m4)_dnl__
-_fi__(!_GENERIC__)
-@end menu
-
-@node File Options, Mode Options, Starting _GDBN__, Starting _GDBN__
-@subsection Choosing Files
-
-As shown above, any arguments other than options specify an executable
-file and core file (or process ID); that is, the first argument
-encountered with no associated option flag is equivalent to a @samp{-se}
-option, and the second, if any, is equivalent to a @samp{-c} option if
-it's the name of a file.
-Many options have both long and short forms; both are shown here. The
-long forms are also recognized if you truncate them, so long as enough
-of the option is present to be unambiguous. (If you prefer, you can
-flag option arguments with @samp{+} rather than @samp{-}, though we
-illustrate the more usual convention.)
-
-@table @code
-@item -symbols=@var{file}
-@itemx -s @var{file}
-Read symbol table from file @var{file}.
-
-@item -exec=@var{file}
-@itemx -e @var{file}
-Use file @var{file} as the executable file to execute when
-appropriate, and for examining pure data in conjunction with a core
-dump.
-
-@item -se=@var{file}
-Read symbol table from file @var{file} and use it as the executable
-file.
-
-@item -core=@var{file}
-@itemx -c @var{file}
-Use file @var{file} as a core dump to examine.
-
-@item -command=@var{file}
-@itemx -x @var{file}
-Execute _GDBN__ commands from file @var{file}. @xref{Command Files}.
-
-@item -directory=@var{directory}
-@itemx -d @var{directory}
-Add @var{directory} to the path to search for source files.
-@end table
-
-_if__(!_GENERIC__)
-@node Mode Options, Mode Options, File Options, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node Mode Options, , File Options, Starting _GDBN__
-_fi__(_GENERIC__)
-@subsection Choosing Modes
-
-@table @code
-@item -nx
-@itemx -n
-Do not execute commands from any @file{_GDBINIT__} initialization files.
-Normally, the commands in these files are executed after all the
-command options and arguments have been processed.
-@xref{Command Files}.
-
-@item -quiet
-@itemx -q
-``Quiet''. Do not print the introductory and copyright messages. These
-messages are also suppressed in batch mode.
-
-@item -batch
-Run in batch mode. Exit with status @code{0} after processing all the command
-files specified with @samp{-x} (and @file{_GDBINIT__}, if not inhibited).
-Exit with nonzero status if an error occurs in executing the _GDBN__
-commands in the command files.
-
-Batch mode may be useful for running _GDBN__ as a filter, for example to
-download and run a program on another computer; in order to make this
-more useful, the message
-@example
-Program exited normally.
-@end example
-@noindent
-(which is ordinarily issued whenever a program running under _GDBN__ control
-terminates) is not issued when running in batch mode.
-
-@item -cd=@var{directory}
-Run _GDBN__ using @var{directory} as its working directory,
-instead of the current directory.
-
-@item -fullname
-@itemx -f
-Emacs sets this option when it runs _GDBN__ as a subprocess. It tells _GDBN__
-to output the full file name and line number in a standard,
-recognizable fashion each time a stack frame is displayed (which
-includes each time the program stops). This recognizable format looks
-like two @samp{\032} characters, followed by the file name, line number
-and character position separated by colons, and a newline. The
-Emacs-to-_GDBN__ interface program uses the two @samp{\032} characters as
-a signal to display the source code for the frame.
-
-@item -b @var{bps}
-Set the line speed (baud rate or bits per second) of any serial
-interface used by _GDBN__ for remote debugging.
-
-@item -tty=@var{device}
-Run using @var{device} for your program's standard input and output.
-@c FIXME: kingdon thinks there's more to -tty. Investigate.
-@end table
-
-_if__(!_GENERIC__)
-_include__(gdbinv-s.m4)
-_fi__(!_GENERIC__)
-
-@node Leaving _GDBN__, Shell Commands, Starting _GDBN__, Invocation
-@section Leaving _GDBN__
-@cindex exiting _GDBN__
-@table @code
-@item quit
-@kindex quit
-@kindex q
-To exit _GDBN__, use the @code{quit} command (abbreviated @code{q}), or type
-an end-of-file character (usually @kbd{C-d}).
-@end table
-
-@cindex interrupt
-An interrupt (often @kbd{C-c}) will not exit from _GDBN__, but rather
-will terminate the action of any _GDBN__ command that is in progress and
-return to _GDBN__ command level. It is safe to type the interrupt
-character at any time because _GDBN__ does not allow it to take effect
-until a time when it is safe.
-
-If you've been using _GDBN__ to control an attached process or device,
-you can release it with the @code{detach} command; @pxref{Attach}.
-
-@node Shell Commands, , Leaving _GDBN__, Invocation
-@section Shell Commands
-If you need to execute occasional shell commands during your
-debugging session, there's no need to leave or suspend _GDBN__; you can
-just use the @code{shell} command.
-
-@table @code
-@item shell @var{command string}
-@kindex shell
-@cindex shell escape
-Directs _GDBN__ to invoke an inferior shell to execute @var{command
-string}. If it exists, the environment variable @code{SHELL} is used
-for the name of the shell to run. Otherwise _GDBN__ uses
-@code{/bin/sh}.
-@end table
-
-The utility @code{make} is often needed in development environments.
-You don't have to use the @code{shell} command for this purpose in _GDBN__:
-
-@table @code
-@item make @var{make-args}
-@kindex make
-@cindex calling make
-Causes _GDBN__ to execute an inferior @code{make} program with the specified
-arguments. This is equivalent to @samp{shell make @var{make-args}}.
-@end table
-
-@node Commands, Running, Invocation, Top
-@chapter _GDBN__ Commands
-
-@menu
-* Command Syntax:: Command Syntax
-* Help:: Getting Help
-@end menu
-
-@node Command Syntax, Help, Commands, Commands
-@section Command Syntax
-A _GDBN__ command is a single line of input. There is no limit on how long
-it can be. It starts with a command name, which is followed by arguments
-whose meaning depends on the command name. For example, the command
-@code{step} accepts an argument which is the number of times to step,
-as in @samp{step 5}. You can also use the @code{step} command with
-no arguments. Some command names do not allow any arguments.
-
-@cindex abbreviation
-_GDBN__ command names may always be truncated if that abbreviation is
-unambiguous. Other possible command abbreviations are listed in the
-documentation for individual commands. In some cases, even ambiguous
-abbreviations are allowed; for example, @code{s} is specially defined as
-equivalent to @code{step} even though there are other commands whose
-names start with @code{s}. You can test abbreviations by using them as
-arguments to the @code{help} command.
-
-@cindex repeating commands
-@kindex RET
-A blank line as input to _GDBN__ (typing just @key{RET}) means to
-repeat the previous command. Certain commands (for example, @code{run})
-will not repeat this way; these are commands for which unintentional
-repetition might cause trouble and which you are unlikely to want to
-repeat.
-
-The @code{list} and @code{x} commands, when you repeat them with
-@key{RET}, construct new arguments rather than repeating
-exactly as typed. This permits easy scanning of source or memory.
-
-_GDBN__ can also use @key{RET} in another way: to partition lengthy
-output, in a way similar to the common utility @code{more}
-(@pxref{Screen Size}). Since it's easy to press one @key{RET} too many
-in this situation, _GDBN__ disables command repetition after any command
-that generates this sort of display.
-
-@kindex #
-@cindex comment
-A line of input starting with @kbd{#} is a comment; it does nothing.
-This is useful mainly in command files (@xref{Command Files}).
-
-@node Help, , Command Syntax, Commands
-@section Getting Help
-@cindex online documentation
-@kindex help
-You can always ask _GDBN__ itself for information on its commands, using the
-command @code{help}.
-
-@table @code
-@item help
-@itemx h
-@kindex h
-You can use @code{help} (abbreviated @code{h}) with no arguments to
-display a short list of named classes of commands:
-@smallexample
-(_GDBP__) help
-List of classes of commands:
-
-running -- Running the program
-stack -- Examining the stack
-data -- Examining data
-breakpoints -- Making program stop at certain points
-files -- Specifying and examining files
-status -- Status inquiries
-support -- Support facilities
-user-defined -- User-defined commands
-aliases -- Aliases of other commands
-obscure -- Obscure features
-
-Type "help" followed by a class name for a list of
-commands in that class.
-Type "help" followed by command name for full
-documentation.
-Command name abbreviations are allowed if unambiguous.
-(_GDBP__)
-@end smallexample
-
-@item help @var{class}
-Using one of the general help classes as an argument, you can get a
-list of the individual commands in that class. For example, here is the
-help display for the class @code{status}:
-@smallexample
-(_GDBP__) help status
-Status inquiries.
-
-List of commands:
-
-show -- Generic command for showing things set with "set"
-info -- Generic command for printing status
-
-Type "help" followed by command name for full
-documentation.
-Command name abbreviations are allowed if unambiguous.
-(_GDBP__)
-@end smallexample
-
-@item help @var{command}
-With a command name as @code{help} argument, _GDBN__ will display a
-short paragraph on how to use that command.
-@end table
-
-In addition to @code{help}, you can use the _GDBN__ commands @code{info}
-and @code{show} to inquire about the state of your program, or the state
-of _GDBN__ itself. Each command supports many topics of inquiry; this
-manual introduces each of them in the appropriate context. The listings
-under @code{info} and under @code{show} in the Index point to
-all the sub-commands.
-@c FIXME: @pxref{Index} used to be here, but even though it shows up in
-@c FIXME...the 'aux' file with a pageno the xref can't find it.
-
-@c @group
-@table @code
-@item info
-@kindex info
-@kindex i
-This command (abbreviated @code{i}) is for describing the state of your
-program; for example, it can list the arguments given to your program
-(@code{info args}), the registers currently in use (@code{info
-registers}), or the breakpoints you've set (@code{info breakpoints}).
-You can get a complete list of the @code{info} sub-commands with
-@w{@code{help info}}.
-
-@kindex show
-@item show
-In contrast, @code{show} is for describing the state of _GDBN__ itself.
-You can change most of the things you can @code{show}, by using the
-related command @code{set}; for example, you can control what number
-system is used for displays with @code{set radix}, or simply inquire
-which is currently in use with @code{show radix}.
-
-@kindex info set
-To display all the settable parameters and their current
-values, you can use @code{show} with no arguments; you may also use
-@code{info set}. Both commands produce the same display.
-@c FIXME: "info set" violates the rule that "info" is for state of
-@c FIXME...program. Ck w/ GNU: "info set" to be called something else,
-@c FIXME...or change desc of rule---eg "state of prog and debugging session"?
-@end table
-@c @end group
-
-Here are three miscellaneous @code{show} subcommands, all of which are
-exceptional in lacking corresponding @code{set} commands:
-
-@table @code
-@kindex show version
-@cindex version number
-@item show version
-Show what version of _GDBN__ is running. You should include this
-information in _GDBN__ bug-reports. If multiple versions of _GDBN__ are
-in use at your site, you may occasionally want to make sure what version
-of _GDBN__ you're running; as _GDBN__ evolves, new commands are
-introduced, and old ones may wither away. The version number is also
-announced when you start _GDBN__ with no arguments.
-
-@kindex show copying
-@item show copying
-Display information about permission for copying _GDBN__.
-
-@kindex show warranty
-@item show warranty
-Display the GNU ``NO WARRANTY'' statement.
-@end table
-
-@node Running, Stopping, Commands, Top
-@chapter Running Programs Under _GDBN__
-
-@menu
-* Compilation:: Compiling for Debugging
-* Starting:: Starting your Program
-* Arguments:: Your Program's Arguments
-* Environment:: Your Program's Environment
-* Working Directory:: Your Program's Working Directory
-* Input/Output:: Your Program's Input and Output
-* Attach:: Debugging an Already-Running Process
-* Kill Process:: Killing the Child Process
-@end menu
-
-@node Compilation, Starting, Running, Running
-@section Compiling for Debugging
-
-In order to debug a program effectively, you need to generate
-debugging information when you compile it. This debugging information
-is stored in the object file; it describes the data type of each
-variable or function and the correspondence between source line numbers
-and addresses in the executable code.
-
-To request debugging information, specify the @samp{-g} option when you run
-the compiler.
-
-Many C compilers are unable to handle the @samp{-g} and @samp{-O}
-options together. Using those compilers, you cannot generate optimized
-executables containing debugging information.
-
-The GNU C compiler supports @samp{-g} with or without @samp{-O}, making it
-possible to debug optimized code. We recommend that you @emph{always} use
-@samp{-g} whenever you compile a program. You may think the program is
-correct, but there's no sense in pushing your luck.
-
-Some things do not work as well with @samp{-g -O} as with just
-@samp{-g}, particularly on machines with instruction scheduling. If in
-doubt, recompile with @samp{-g} alone, and if this fixes the problem,
-please report it as a bug (including a test case!).
-
-Older versions of the GNU C compiler permitted a variant option
-@samp{-gg} for debugging information. _GDBN__ no longer supports this
-format; if your GNU C compiler has this option, do not use it.
-
-@ignore
-@comment As far as I know, there are no cases in which _GDBN__ will
-@comment produce strange output in this case. (but no promises).
-If your program includes archives made with the @code{ar} program, and
-if the object files used as input to @code{ar} were compiled without the
-@samp{-g} option and have names longer than 15 characters, _GDBN__ will get
-confused reading the program's symbol table. No error message will be
-given, but _GDBN__ may behave strangely. The reason for this problem is a
-deficiency in the Unix archive file format, which cannot represent file
-names longer than 15 characters.
-
-To avoid this problem, compile the archive members with the @samp{-g}
-option or use shorter file names. Alternatively, use a version of GNU
-@code{ar} dated more recently than August 1989.
-@end ignore
-
-
-@node Starting, Arguments, Compilation, Running
-@section Starting your Program
-@cindex starting
-@cindex running
-@table @code
-@item run
-@itemx r
-@kindex run
-Use the @code{run} command to start your program under _GDBN__. You
-must first specify the program name
-_if__(_VXWORKS__)
-(except on VxWorks)
-_fi__(_VXWORKS__)
-with an argument to _GDBN__
-(@pxref{Invocation}), or using the @code{file} or @code{exec-file}
-command (@pxref{Files}).
-@refill
-@end table
-
-@c FIXME explain or avoid "target" here?
-On targets that support processes, @code{run} creates an inferior
-process and makes that process run your program. On other targets,
-@code{run} jumps to the start of the program.
-
-The execution of a program is affected by certain information it
-receives from its superior. _GDBN__ provides ways to specify this
-information, which you must do @i{before} starting the program. (You
-can change it after starting the program, but such changes will only affect
-the program the next time you start it.) This information may be
-divided into four categories:
-
-@table @asis
-@item The @i{arguments.}
-You specify the arguments to give your program as the arguments of the
-@code{run} command. If a shell is available on your target, the shell
-is used to pass the arguments, so that you may use normal conventions
-(such as wildcard expansion or variable substitution) in
-describing the arguments. In Unix systems, you can control which shell
-is used with the @code{SHELL} environment variable. @xref{Arguments}.@refill
-
-@item The @i{environment.}
-Your program normally inherits its environment from _GDBN__, but you can
-use the _GDBN__ commands @code{set environment} and @code{unset
-environment} to change parts of the environment that will be given to
-the program. @xref{Environment}.@refill
-
-@item The @i{working directory.}
-Your program inherits its working directory from _GDBN__. You can set
-_GDBN__'s working directory with the @code{cd} command in _GDBN__.
-@xref{Working Directory}.
-
-@item The @i{standard input and output.}
-Your program normally uses the same device for standard input and
-standard output as _GDBN__ is using. You can redirect input and output
-in the @code{run} command line, or you can use the @code{tty} command to
-set a different device for your program.
-@xref{Input/Output}.
-
-@cindex pipes
-@emph{Warning:} While input and output redirection work, you can't use
-pipes to pass the output of the program you're debugging to another
-program; if you attempt this, _GDBN__ is likely to wind up debugging the
-wrong program.
-@end table
-
-When you issue the @code{run} command, your program begins to execute
-immediately. @xref{Stopping}, for discussion of how to arrange for your
-program to stop. Once your program has been started by the @code{run}
-command (and then stopped), you may evaluate expressions that involve
-calls to functions in the inferior, using the @code{print} or
-@code{call} commands. @xref{Data}.
-
-If the modification time of your symbol file has changed since the last
-time _GDBN__ read its symbols, _GDBN__ will discard its symbol table and re-read
-it. In this process, it tries to retain your current breakpoints.
-
-@node Arguments, Environment, Starting, Running
-@section Your Program's Arguments
-
-@cindex arguments (to your program)
-The arguments to your program can be specified by the arguments of the
-@code{run} command. They are passed to a shell, which expands wildcard
-characters and performs redirection of I/O, and thence to the program.
-_GDBN__ uses the shell indicated by your environment variable
-@code{SHELL} if it exists; otherwise, _GDBN__ uses @code{/bin/sh}.
-
-@code{run} with no arguments uses the same arguments used by the previous
-@code{run}, or those set by the @code{set args} command.
-
-@kindex set args
-@table @code
-@item set args
-Specify the arguments to be used the next time your program is run. If
-@code{set args} has no arguments, @code{run} will execute your program
-with no arguments. Once you have run your program with arguments,
-using @code{set args} before the next @code{run} is the only way to run
-it again without arguments.
-
-@item show args
-@kindex show args
-Show the arguments to give your program when it is started.
-@end table
-
-@node Environment, Working Directory, Arguments, Running
-@section Your Program's Environment
-
-@cindex environment (of your program)
-The @dfn{environment} consists of a set of environment variables and
-their values. Environment variables conventionally record such things as
-your user name, your home directory, your terminal type, and your search
-path for programs to run. Usually you set up environment variables with
-the shell and they are inherited by all the other programs you run. When
-debugging, it can be useful to try running the program with a modified
-environment without having to start _GDBN__ over again.
-
-@table @code
-@item path @var{directory}
-@kindex path
-Add @var{directory} to the front of the @code{PATH} environment variable
-(the search path for executables), for both _GDBN__ and your program.
-You may specify several directory names, separated by @samp{:} or
-whitespace. If @var{directory} is already in the path, it is moved to
-the front, so it will be searched sooner.
-
-You can use the string @samp{$cwd} to refer to whatever is the current
-working directory at the time _GDBN__ searches the path. If you use
-@samp{.} instead, it refers to the directory where you executed the
-@code{path} command. _GDBN__ fills in the current path where needed in
-the @var{directory} argument, before adding it to the search path.
-@c 'path' is explicitly nonrepeatable, but RMS points out it's silly to
-@c document that, since repeating it would be a no-op.
-
-@item show paths
-@kindex show paths
-Display the list of search paths for executables (the @code{PATH}
-environment variable).
-
-@item show environment @r{[}@var{varname}@r{]}
-@kindex show environment
-Print the value of environment variable @var{varname} to be given to
-your program when it starts. If you don't supply @var{varname},
-print the names and values of all environment variables to be given to
-your program. You can abbreviate @code{environment} as @code{env}.
-
-@item set environment @var{varname} @r{[}=@r{]} @var{value}
-@kindex set environment
-Sets environment variable @var{varname} to @var{value}. The value
-changes for your program only, not for _GDBN__ itself. @var{value} may
-be any string; the values of environment variables are just strings, and
-any interpretation is supplied by your program itself. The @var{value}
-parameter is optional; if it is eliminated, the variable is set to a
-null value.
-@c "any string" here doesn't include leading, trailing
-@c blanks. Gnu asks: does anyone care?
-
-For example, this command:
-
-@example
-set env USER = foo
-@end example
-
-@noindent
-tells a Unix program, when subsequently run, that its user is named
-@samp{foo}. (The spaces around @samp{=} are used for clarity here; they
-are not actually required.)
-
-@item unset environment @var{varname}
-@kindex unset environment
-Remove variable @var{varname} from the environment to be passed to your
-program. This is different from @samp{set env @var{varname} =};
-@code{unset environment} removes the variable from the environment,
-rather than assigning it an empty value.
-@end table
-
-@node Working Directory, Input/Output, Environment, Running
-@section Your Program's Working Directory
-
-@cindex working directory (of your program)
-Each time you start your program with @code{run}, it inherits its
-working directory from the current working directory of _GDBN__. _GDBN__'s
-working directory is initially whatever it inherited from its parent
-process (typically the shell), but you can specify a new working
-directory in _GDBN__ with the @code{cd} command.
-
-The _GDBN__ working directory also serves as a default for the commands
-that specify files for _GDBN__ to operate on. @xref{Files}.
-
-@table @code
-@item cd @var{directory}
-@kindex cd
-Set _GDBN__'s working directory to @var{directory}.
-
-@item pwd
-@kindex pwd
-Print _GDBN__'s working directory.
-@end table
-
-@node Input/Output, Attach, Working Directory, Running
-@section Your Program's Input and Output
-
-@cindex redirection
-@cindex i/o
-@cindex terminal
-By default, the program you run under _GDBN__ does input and output to
-the same terminal that _GDBN__ uses. _GDBN__ switches the terminal to
-its own terminal modes to interact with you, but it records the terminal
-modes your program was using and switches back to them when you continue
-running your program.
-
-@table @code
-@item info terminal
-@kindex info terminal
-Displays _GDBN__'s recorded information about the terminal modes your
-program is using.
-@end table
-
-You can redirect the program's input and/or output using shell
-redirection with the @code{run} command. For example,
-
-_0__@example
-run > outfile
-_1__@end example
-
-@noindent
-starts the program, diverting its output to the file @file{outfile}.
-
-@kindex tty
-@cindex controlling terminal
-Another way to specify where the program should do input and output is
-with the @code{tty} command. This command accepts a file name as
-argument, and causes this file to be the default for future @code{run}
-commands. It also resets the controlling terminal for the child
-process, for future @code{run} commands. For example,
-
-@example
-tty /dev/ttyb
-@end example
-
-@noindent
-directs that processes started with subsequent @code{run} commands
-default to do input and output on the terminal @file{/dev/ttyb} and have
-that as their controlling terminal.
-
-An explicit redirection in @code{run} overrides the @code{tty} command's
-effect on the input/output device, but not its effect on the controlling
-terminal.
-
-When you use the @code{tty} command or redirect input in the @code{run}
-command, only the input @emph{for your program} is affected. The input
-for _GDBN__ still comes from your terminal.
-
-@node Attach, Kill Process, Input/Output, Running
-@section Debugging an Already-Running Process
-@kindex attach
-@cindex attach
-
-@table @code
-@item attach @var{process-id}
-This command
-attaches to a running process---one that was started outside _GDBN__.
-(@code{info files} will show your active targets.) The command takes as
-argument a process ID. The usual way to find out the process-id of
-a Unix process is with the @code{ps} utility, or with the @samp{jobs -l}
-shell command.
-
-@code{attach} will not repeat if you press @key{RET} a second time after
-executing the command.
-@end table
-
-To use @code{attach}, you must be debugging in an environment which
-supports processes. You must also have permission to send the process a
-signal, and it must have the same effective user ID as the _GDBN__
-process.
-
-When using @code{attach}, you should first use the @code{file} command
-to specify the program running in the process and load its symbol table.
-@xref{Files}.
-
-The first thing _GDBN__ does after arranging to debug the specified
-process is to stop it. You can examine and modify an attached process
-with all the _GDBN__ commands that are ordinarily available when you start
-processes with @code{run}. You can insert breakpoints; you can step and
-continue; you can modify storage. If you would rather the process
-continue running, you may use the @code{continue} command after
-attaching _GDBN__ to the process.
-
-@table @code
-@item detach
-@kindex detach
-When you have finished debugging the attached process, you can use the
-@code{detach} command to release it from _GDBN__'s control. Detaching
-the process continues its execution. After the @code{detach} command,
-that process and _GDBN__ become completely independent once more, and you
-are ready to @code{attach} another process or start one with @code{run}.
-@code{detach} will not repeat if you press @key{RET} again after
-executing the command.
-@end table
-
-If you exit _GDBN__ or use the @code{run} command while you have an attached
-process, you kill that process. By default, you will be asked for
-confirmation if you try to do either of these things; you can control
-whether or not you need to confirm by using the @code{set confirm} command
-(@pxref{Messages/Warnings}).
-
-@node Kill Process, , Attach, Running
-@c @group
-@section Killing the Child Process
-
-@table @code
-@item kill
-@kindex kill
-Kill the child process in which your program is running under _GDBN__.
-@end table
-
-This command is useful if you wish to debug a core dump instead of a
-running process. _GDBN__ ignores any core dump file while your program
-is running.
-@c @end group
-
-On some operating systems, a program can't be executed outside _GDBN__
-while you have breakpoints set on it inside _GDBN__. You can use the
-@code{kill} command in this situation to permit running the program
-outside the debugger.
-
-The @code{kill} command is also useful if you wish to recompile and
-relink the program, since on many systems it is impossible to modify an
-executable file while it is running in a process. In this case, when you
-next type @code{run}, _GDBN__ will notice that the file has changed, and
-will re-read the symbol table (while trying to preserve your current
-breakpoint settings).
-
-@node Stopping, Stack, Running, Top
-@chapter Stopping and Continuing
-
-The principal purpose of using a debugger is so that you can stop your
-program before it terminates; or so that, if the program runs into
-trouble, you can investigate and find out why.
-
-Inside _GDBN__, your program may stop for any of several reasons, such
-as a signal, a breakpoint, or reaching a new line after a _GDBN__
-command such as @code{step}. You may then examine and change
-variables, set new breakpoints or remove old ones, and then continue
-execution. Usually, the messages shown by _GDBN__ provide ample
-explanation of the status of your program---but you can also explicitly
-request this information at any time.
-
-@table @code
-@item info program
-@kindex info program
-Display information about the status of your program: whether it is
-running or not, what process it is, and why it stopped.
-@end table
-
-@menu
-* Breakpoints:: Breakpoints, Watchpoints, and Exceptions
-* Continuing and Stepping:: Resuming Execution
-* Signals:: Signals
-@end menu
-
-@node Breakpoints, Continuing and Stepping, Stopping, Stopping
-@section Breakpoints, Watchpoints, and Exceptions
-
-@cindex breakpoints
-A @dfn{breakpoint} makes your program stop whenever a certain point in
-the program is reached. For each breakpoint, you can add various
-conditions to control in finer detail whether the program will stop.
-You can set breakpoints with the @code{break} command and its variants
-(@pxref{Set Breaks}), to specify the place where the program should stop
-by line number, function name or exact address in the program. In
-languages with exception handling (such as GNU C++), you can also set
-breakpoints where an exception is raised (@pxref{Exception Handling}).
-
-@cindex watchpoints
-A @dfn{watchpoint} is a special breakpoint that stops your program when
-the value of an expression changes. You must use a different command to
-set watchpoints (@pxref{Set Watchpoints}), but aside from that, you can
-manage a watchpoint like any other breakpoint: you enable, disable, and
-delete both breakpoints and watchpoints using the same commands.
-
-Each breakpoint or watchpoint is assigned a number when it is created;
-these numbers are successive integers starting with one. In many of the
-commands for controlling various features of breakpoints you use the
-breakpoint number to say which breakpoint you want to change. Each
-breakpoint may be @dfn{enabled} or @dfn{disabled}; if disabled, it has
-no effect on the program until you enable it again.
-
-@menu
-* Set Breaks:: Setting Breakpoints
-* Set Watchpoints:: Setting Watchpoints
-* Exception Handling:: Breakpoints and Exceptions
-* Delete Breaks:: Deleting Breakpoints
-* Disabling:: Disabling Breakpoints
-* Conditions:: Break Conditions
-* Break Commands:: Breakpoint Command Lists
-* Breakpoint Menus:: Breakpoint Menus
-* Error in Breakpoints::
-@end menu
-
-@node Set Breaks, Set Watchpoints, Breakpoints, Breakpoints
-@subsection Setting Breakpoints
-
-@c FIXME LMB what does GDB do if no code on line of breakpt?
-@c consider in particular declaration with/without initialization.
-@c
-@c FIXME 2 is there stuff on this already? break at fun start, already init?
-
-@kindex break
-@kindex b
-Breakpoints are set with the @code{break} command (abbreviated @code{b}).
-
-You have several ways to say where the breakpoint should go.
-
-@table @code
-@item break @var{function}
-Set a breakpoint at entry to function @var{function}. When using source
-languages that permit overloading of symbols, such as C++,
-@var{function} may refer to more than one possible place to break.
-@xref{Breakpoint Menus}, for a discussion of that situation.
-
-@item break +@var{offset}
-@itemx break -@var{offset}
-Set a breakpoint some number of lines forward or back from the position
-at which execution stopped in the currently selected frame.
-
-@item break @var{linenum}
-Set a breakpoint at line @var{linenum} in the current source file.
-That file is the last file whose source text was printed. This
-breakpoint will stop the program just before it executes any of the
-code on that line.
-
-@item break @var{filename}:@var{linenum}
-Set a breakpoint at line @var{linenum} in source file @var{filename}.
-
-@item break @var{filename}:@var{function}
-Set a breakpoint at entry to function @var{function} found in file
-@var{filename}. Specifying a file name as well as a function name is
-superfluous except when multiple files contain similarly named
-functions.
-
-@item break *@var{address}
-Set a breakpoint at address @var{address}. You can use this to set
-breakpoints in parts of the program which do not have debugging
-information or source files.
-
-@item break
-When called without any arguments, @code{break} sets a breakpoint at the
-next instruction to be executed in the selected stack frame
-(@pxref{Stack}). In any selected frame but the innermost, this will
-cause the program to stop as soon as control returns to that frame.
-This is similar to the effect of a @code{finish} command in the frame
-inside the selected frame---except that @code{finish} doesn't leave an
-active breakpoint. If you use @code{break} without an argument in the
-innermost frame, _GDBN__ will stop the next time it reaches the current
-location; this may be useful inside loops.
-
-_GDBN__ normally ignores breakpoints when it resumes execution, until at
-least one instruction has been executed. If it did not do this, you
-would be unable to proceed past a breakpoint without first disabling the
-breakpoint. This rule applies whether or not the breakpoint already
-existed when the program stopped.
-
-@item break @dots{} if @var{cond}
-Set a breakpoint with condition @var{cond}; evaluate the expression
-@var{cond} each time the breakpoint is reached, and stop only if the
-value is nonzero---that is, if @var{cond} evaluates as true.
-@samp{@dots{}} stands for one of the possible arguments described above
-(or no argument) specifying where to break. @xref{Conditions}, for more
-information on breakpoint conditions.
-
-@item tbreak @var{args}
-@kindex tbreak
-Set a breakpoint enabled only for one stop. @var{args} are the
-same as for the @code{break} command, and the breakpoint is set in the same
-way, but the breakpoint is automatically disabled the first time it
-is hit. @xref{Disabling}.
-
-@item rbreak @var{regex}
-@kindex rbreak
-@cindex regular expression
-@c FIXME what kind of regexp?
-Set breakpoints on all functions matching the regular expression
-@var{regex}. This command
-sets an unconditional breakpoint on all matches, printing a list of all
-breakpoints it set. Once these breakpoints are set, they are treated
-just like the breakpoints set with the @code{break} command. They can
-be deleted, disabled, made conditional, etc., in the standard ways.
-
-When debugging C++ programs, @code{rbreak} is useful for setting
-breakpoints on overloaded functions that are not members of any special
-classes.
-
-@kindex info breakpoints
-@cindex @code{$_} and @code{info breakpoints}
-@item info breakpoints @r{[}@var{n}@r{]}
-@item info break @r{[}@var{n}@r{]}
-Print a list of all breakpoints (but not watchpoints) set and not
-deleted, showing their numbers, where in the program they are, and any
-special features in use for them. Disabled breakpoints are included in
-the list, but marked as disabled. @code{info break} with a breakpoint
-number @var{n} as argument lists only that breakpoint. The convenience
-variable @code{$_} and the default examining-address for the @code{x}
-command are set to the address of the last breakpoint listed
-(@pxref{Memory}). The equivalent command for watchpoints is @code{info
-watch}. @end table
-
-_GDBN__ allows you to set any number of breakpoints at the same place in the
-program. There is nothing silly or meaningless about this. When the
-breakpoints are conditional, this is even useful (@pxref{Conditions}).
-
-@node Set Watchpoints, Exception Handling, Set Breaks, Breakpoints
-@subsection Setting Watchpoints
-@cindex setting watchpoints
-You can use a watchpoint to stop execution whenever the value of an
-expression changes, without having to predict a particular place
-where this may happen.
-
-Watchpoints currently execute two orders of magnitude more slowly than
-other breakpoints, but this can well be worth it to catch errors where
-you have no clue what part of your program is the culprit. Some
-processors provide special hardware to support watchpoint evaluation; future
-releases of _GDBN__ will use such hardware if it is available.
-
-@table @code
-@kindex watch
-@item watch @var{expr}
-Set a watchpoint for an expression.
-
-@kindex info watchpoints
-@item info watchpoints
-This command prints a list of watchpoints; it is otherwise similar to
-@code{info break}.
-@end table
-
-@node Exception Handling, Delete Breaks, Set Watchpoints, Breakpoints
-@subsection Breakpoints and Exceptions
-@cindex exception handlers
-
-Some languages, such as GNU C++, implement exception handling. You can
-use _GDBN__ to examine what caused the program to raise an exception,
-and to list the exceptions the program is prepared to handle at a
-given point in time.
-
-@table @code
-@item catch @var{exceptions}
-@kindex catch
-You can set breakpoints at active exception handlers by using the
-@code{catch} command. @var{exceptions} is a list of names of exceptions
-to catch.
-@end table
-
-You can use @code{info catch} to list active exception handlers;
-@pxref{Frame Info}.
-
-There are currently some limitations to exception handling in _GDBN__.
-These will be corrected in a future release.
-
-@itemize @bullet
-@item
-If you call a function interactively, _GDBN__ normally returns
-control to you when the function has finished executing. If the call
-raises an exception, however, the call may bypass the mechanism that
-returns control to the user and cause the program to simply continue
-running until it hits a breakpoint, catches a signal that _GDBN__ is
-listening for, or exits.
-@item
-You cannot raise an exception interactively.
-@item
-You cannot interactively install an exception handler.
-@end itemize
-
-@cindex raise exceptions
-Sometimes @code{catch} is not the best way to debug exception handling:
-if you need to know exactly where an exception is raised, it's better to
-stop @emph{before} the exception handler is called, since that way you
-can see the stack before any unwinding takes place. If you set a
-breakpoint in an exception handler instead, it may not be easy to find
-out where the exception was raised.
-
-To stop just before an exception handler is called, you need some
-knowledge of the implementation. In the case of GNU C++, exceptions are
-raised by calling a library function named @code{__raise_exception}
-which has the following ANSI C interface:
-
-@example
- /* @var{addr} is where the exception identifier is stored.
- ID is the exception identifier. */
- void __raise_exception (void **@var{addr}, void *@var{id});
-@end example
-
-@noindent
-To make the debugger catch all exceptions before any stack
-unwinding takes place, set a breakpoint on @code{__raise_exception}
-(@pxref{Breakpoints}).
-
-With a conditional breakpoint (@xref{Conditions}) that depends on the
-value of @var{id}, you can stop your program when a specific exception
-is raised. You can use multiple conditional breakpoints to stop the
-program when any of a number of exceptions are raised.
-
-@node Delete Breaks, Disabling, Exception Handling, Breakpoints
-@subsection Deleting Breakpoints
-
-@cindex clearing breakpoints, watchpoints
-@cindex deleting breakpoints, watchpoints
-It is often necessary to eliminate a breakpoint or watchpoint once it
-has done its job and you no longer want the program to stop there. This
-is called @dfn{deleting} the breakpoint. A breakpoint that has been
-deleted no longer exists; it is forgotten.
-
-With the @code{clear} command you can delete breakpoints according to
-where they are in the program. With the @code{delete} command you can
-delete individual breakpoints or watchpoints by specifying their
-breakpoint numbers.
-
-It is not necessary to delete a breakpoint to proceed past it. _GDBN__
-automatically ignores breakpoints on the first instruction to be executed
-when you continue execution without changing the execution address.
-
-@table @code
-@item clear
-@kindex clear
-Delete any breakpoints at the next instruction to be executed in the
-selected stack frame (@pxref{Selection}). When the innermost frame
-is selected, this is a good way to delete a breakpoint that the program
-just stopped at.
-
-@item clear @var{function}
-@itemx clear @var{filename}:@var{function}
-Delete any breakpoints set at entry to the function @var{function}.
-
-@item clear @var{linenum}
-@itemx clear @var{filename}:@var{linenum}
-Delete any breakpoints set at or within the code of the specified line.
-
-@item delete @r{[}breakpoints@r{]} @r{[}@var{bnums}@dots{}@r{]}
-@cindex delete breakpoints
-@kindex delete
-@kindex d
-Delete the breakpoints or watchpoints of the numbers specified as
-arguments. If no argument is specified, delete all breakpoints (_GDBN__
-asks confirmation, unless you've @code{set confirm off}). You
-can abbreviate this command as @code{d}.
-@end table
-
-@node Disabling, Conditions, Delete Breaks, Breakpoints
-@subsection Disabling Breakpoints
-
-@cindex disabled breakpoints
-@cindex enabled breakpoints
-Rather than deleting a breakpoint or watchpoint, you might prefer to
-@dfn{disable} it. This makes the breakpoint inoperative as if it had
-been deleted, but remembers the information on the breakpoint so that
-you can @dfn{enable} it again later.
-
-You disable and enable breakpoints and watchpoints with the
-@code{enable} and @code{disable} commands, optionally specifying one or
-more breakpoint numbers as arguments. Use @code{info break} or
-@code{info watch} to print a list of breakpoints or watchpoints if you
-don't know which numbers to use.
-
-A breakpoint or watchpoint can have any of four different states of
-enablement:
-
-@itemize @bullet
-@item
-Enabled. The breakpoint will stop the program. A breakpoint set
-with the @code{break} command starts out in this state.
-@item
-Disabled. The breakpoint has no effect on the program.
-@item
-Enabled once. The breakpoint will stop the program, but
-when it does so it will become disabled. A breakpoint set
-with the @code{tbreak} command starts out in this state.
-@item
-Enabled for deletion. The breakpoint will stop the program, but
-immediately after it does so it will be deleted permanently.
-@end itemize
-
-You can use the following commands to enable or disable breakpoints and
-watchpoints:
-
-@table @code
-@item disable @r{[}breakpoints@r{]} @r{[}@var{bnums}@dots{}@r{]}
-@kindex disable breakpoints
-@kindex disable
-@kindex dis
-Disable the specified breakpoints---or all breakpoints, if none are
-listed. A disabled breakpoint has no effect but is not forgotten. All
-options such as ignore-counts, conditions and commands are remembered in
-case the breakpoint is enabled again later. You may abbreviate
-@code{disable} as @code{dis}.
-
-@item enable @r{[}breakpoints@r{]} @r{[}@var{bnums}@dots{}@r{]}
-@kindex enable breakpoints
-@kindex enable
-Enable the specified breakpoints (or all defined breakpoints). They
-become effective once again in stopping the program.
-
-@item enable @r{[}breakpoints@r{]} once @var{bnums}@dots{}
-Enable the specified breakpoints temporarily. Each will be disabled
-again the next time it stops the program.
-
-@item enable @r{[}breakpoints@r{]} delete @var{bnums}@dots{}
-Enable the specified breakpoints to work once and then die. Each of
-the breakpoints will be deleted the next time it stops the program.
-@end table
-
-Save for a breakpoint set with @code{tbreak} (@pxref{Set Breaks}),
-breakpoints that you set are initially enabled; subsequently, they become
-disabled or enabled only when you use one of the commands above. (The
-command @code{until} can set and delete a breakpoint of its own, but it
-will not change the state of your other breakpoints;
-@pxref{Continuing and Stepping}.)
-
-@node Conditions, Break Commands, Disabling, Breakpoints
-@subsection Break Conditions
-@cindex conditional breakpoints
-@cindex breakpoint conditions
-
-@c FIXME what is scope of break condition expr? Context where wanted?
-@c in particular for a watchpoint?
-The simplest sort of breakpoint breaks every time the program reaches a
-specified place. You can also specify a @dfn{condition} for a
-breakpoint. A condition is just a Boolean expression in your
-programming language. (@xref{Expressions}). A breakpoint with a condition
-evaluates the expression each time the program reaches it, and the
-program stops only if the condition is @emph{true}.
-
-This is the converse of using assertions for program validation; in that
-situation, you want to stop when the assertion is violated---that is,
-when the condition is false. In C, if you want to test an assertion expressed
-by the condition @var{assert}, you should set the condition
-@samp{! @var{assert}} on the appropriate breakpoint.
-
-Conditions are also accepted for watchpoints; you may not need them,
-since a watchpoint is inspecting the value of an expression anyhow---but
-it might be simpler, say, to just set a watchpoint on a variable name,
-and specify a condition that tests whether the new value is an interesting
-one.
-
-Break conditions ca have side effects, and may even call functions in
-your program. This can be useful, for example, to activate functions
-that log program progress, or to use your own print functions to format
-special data structures. The effects are completely predictable unless
-there is another enabled breakpoint at the same address. (In that
-case, _GDBN__ might see the other breakpoint first and stop the program
-without checking the condition of this one.) Note that breakpoint
-commands are usually more convenient and flexible for the purpose of
-performing side effects when a breakpoint is reached
-(@pxref{Break Commands}).
-
-Break conditions can be specified when a breakpoint is set, by using
-@samp{if} in the arguments to the @code{break} command. @xref{Set Breaks}.
-They can also be changed at any time with the @code{condition} command.
-The @code{watch} command doesn't recognize the @code{if} keyword;
-@code{condition} is the only way to impose a further condition on a
-watchpoint.
-
-@table @code
-@item condition @var{bnum} @var{expression}
-@kindex condition
-Specify @var{expression} as the break condition for breakpoint or
-watchpoint number @var{bnum}. From now on, this breakpoint will stop
-the program only if the value of @var{expression} is true (nonzero, in
-C). When you use @code{condition}, _GDBN__ checks @var{expression}
-immediately for syntactic correctness, and to determine whether symbols
-in it have referents in the context of your breakpoint.
-@c FIXME so what does GDB do if there's no referent? Moreover, what
-@c about watchpoints?
-_GDBN__ does
-not actually evaluate @var{expression} at the time the @code{condition}
-command is given, however. @xref{Expressions}.
-
-@item condition @var{bnum}
-Remove the condition from breakpoint number @var{bnum}. It becomes
-an ordinary unconditional breakpoint.
-@end table
-
-@cindex ignore count (of breakpoint)
-A special case of a breakpoint condition is to stop only when the
-breakpoint has been reached a certain number of times. This is so
-useful that there is a special way to do it, using the @dfn{ignore
-count} of the breakpoint. Every breakpoint has an ignore count, which
-is an integer. Most of the time, the ignore count is zero, and
-therefore has no effect. But if the program reaches a breakpoint whose
-ignore count is positive, then instead of stopping, it just decrements
-the ignore count by one and continues. As a result, if the ignore count
-value is @var{n}, the breakpoint will not stop the next @var{n} times it
-is reached.
-
-@table @code
-@item ignore @var{bnum} @var{count}
-@kindex ignore
-Set the ignore count of breakpoint number @var{bnum} to @var{count}.
-The next @var{count} times the breakpoint is reached, your program's
-execution will not stop; other than to decrement the ignore count, _GDBN__
-takes no action.
-
-To make the breakpoint stop the next time it is reached, specify
-a count of zero.
-
-@item continue @var{count}
-@itemx c @var{count}
-@itemx fg @var{count}
-@kindex continue @var{count}
-Continue execution of the program, setting the ignore count of the
-breakpoint that the program stopped at to @var{count} minus one.
-Thus, the program will not stop at this breakpoint until the
-@var{count}'th time it is reached.
-
-An argument to this command is meaningful only when the program stopped
-due to a breakpoint. At other times, the argument to @code{continue} is
-ignored.
-
-The synonym @code{fg} is provided purely for convenience, and has
-exactly the same behavior as other forms of the command.
-@end table
-
-If a breakpoint has a positive ignore count and a condition, the condition
-is not checked. Once the ignore count reaches zero, the condition will
-be checked.
-
-You could achieve the effect of the ignore count with a
-condition such as _0__@w{@samp{$foo-- <= 0}}_1__ using a debugger convenience
-variable that is decremented each time. @xref{Convenience Vars}.
-
-@node Break Commands, Breakpoint Menus, Conditions, Breakpoints
-@subsection Breakpoint Command Lists
-
-@cindex breakpoint commands
-You can give any breakpoint (or watchpoint) a series of commands to
-execute when the program stops due to that breakpoint. For example, you
-might want to print the values of certain expressions, or enable other
-breakpoints.
-
-@table @code
-@item commands @r{[}@var{bnum}@r{]}
-@itemx @dots{} @var{command-list} @dots{}
-@itemx end
-@kindex commands
-@kindex end
-Specify a list of commands for breakpoint number @var{bnum}. The commands
-themselves appear on the following lines. Type a line containing just
-@code{end} to terminate the commands.
-
-To remove all commands from a breakpoint, type @code{commands} and
-follow it immediately with @code{end}; that is, give no commands.
-
-With no @var{bnum} argument, @code{commands} refers to the last
-breakpoint or watchpoint set (not to the breakpoint most recently
-encountered).
-@end table
-
-Pressing @key{RET} as a means of repeating the last _GDBN__ command is
-disabled within a @var{command-list}.
-
-You can use breakpoint commands to start the program up again. Simply
-use the @code{continue} command, or @code{step}, or any other command
-that resumes execution. Subsequent commands in the command list are
-ignored.
-
-@kindex silent
-If the first command specified is @code{silent}, the usual message about
-stopping at a breakpoint is not printed. This may be desirable for
-breakpoints that are to print a specific message and then continue.
-If the remaining commands too print nothing, you will see no sign that
-the breakpoint was reached at all. @code{silent} is meaningful only
-at the beginning of a breakpoint command list.
-
-The commands @code{echo} and @code{output} that allow you to print precisely
-controlled output are often useful in silent breakpoints. @xref{Output}.
-
-For example, here is how you could use breakpoint commands to print the
-value of @code{x} at entry to @code{foo} whenever @code{x} is positive.
-
-_0__@example
-break foo if x>0
-commands
-silent
-echo x is\040
-output x
-echo \n
-cont
-end
-_1__@end example
-
-One application for breakpoint commands is to compensate for one bug so
-you can test for another. Put a breakpoint just after the erroneous line
-of code, give it a condition to detect the case in which something
-erroneous has been done, and give it commands to assign correct values
-to any variables that need them. End with the @code{continue} command
-so that the program does not stop, and start with the @code{silent}
-command so that no output is produced. Here is an example:
-
-@example
-break 403
-commands
-silent
-set x = y + 4
-cont
-end
-@end example
-
-@cindex lost output
-One deficiency in the operation of automatically continuing breakpoints
-under Unix appears when your program uses raw mode for the terminal.
-_GDBN__ switches back to its own terminal modes (not raw) before executing
-commands, and then must switch back to raw mode when your program is
-continued. This causes any pending terminal input to be lost.
-@c FIXME: revisit below when GNU sys avail.
-@c In the GNU system, this will be fixed by changing the behavior of
-@c terminal modes.
-
-Under Unix, you can get around this problem by writing actions into
-the breakpoint condition rather than in commands. For example
-
-@example
-condition 5 (x = y + 4), 0
-@end example
-
-@noindent
-specifies a condition expression (@xref{Expressions}) that will change
-@code{x} as needed, then always have the value zero so the program will
-not stop. No input is lost here, because _GDBN__ evaluates break
-conditions without changing the terminal modes. When you want to have
-nontrivial conditions for performing the side effects, the operators
-@samp{&&}, @samp{||} and @samp{?@dots{}:} may be useful.
-
-@node Breakpoint Menus, Error in Breakpoints, Break Commands, Breakpoints
-@subsection Breakpoint Menus
-@cindex overloading
-@cindex symbol overloading
-
-Some programming languages (notably C++) permit a single function name
-to be defined several times, for application in different contexts.
-This is called @dfn{overloading}. When a function name is overloaded,
-@samp{break @var{function}} is not enough to tell _GDBN__ where you
-want a breakpoint. _GDBN__ offers you a menu of numbered choices for
-different possible breakpoints, and waits for your selection with the
-prompt @samp{>}. The first two options are always @samp{[0] cancel}
-and @samp{[1] all}. Typing @kbd{1} sets a breakpoint at each
-definition of @var{function}, and typing @kbd{0} aborts the
-@code{break} command without setting any new breakpoints.
-
-For example, the following session excerpt shows an attempt to set a
-breakpoint at the overloaded symbol @code{String::after}.
-We choose three particular definitions of that function name:
-
-@example
-(_GDBP__) b String::after
-[0] cancel
-[1] all
-[2] file:String.cc; line number:867
-[3] file:String.cc; line number:860
-[4] file:String.cc; line number:875
-[5] file:String.cc; line number:853
-[6] file:String.cc; line number:846
-[7] file:String.cc; line number:735
-> 2 4 6
-Breakpoint 1 at 0xb26c: file String.cc, line 867.
-Breakpoint 2 at 0xb344: file String.cc, line 875.
-Breakpoint 3 at 0xafcc: file String.cc, line 846.
-Multiple breakpoints were set.
-Use the "delete" command to delete unwanted breakpoints.
-(_GDBP__)
-@end example
-
-
-@node Error in Breakpoints, , Breakpoint Menus, Breakpoints
-@subsection ``Cannot Insert Breakpoints''
-
-@c FIXME: "cannot insert breakpoints" error, v unclear.
-@c Q in pending mail to Gilmore. ---pesch@cygnus.com, 26mar91
-@c some light may be shed by looking at instances of
-@c ONE_PROCESS_WRITETEXT. But error seems possible otherwise
-@c too. pesch, 20sep91
-Under some operating systems, breakpoints cannot be used in a program if
-any other process is running that program. In this situation,
-attempting to run or continue a program with a breakpoint causes _GDBN__
-to stop the other process.
-
-When this happens, you have three ways to proceed:
-
-@enumerate
-@item
-Remove or disable the breakpoints, then continue.
-
-@item
-Suspend _GDBN__, and copy the file containing the program to a new name.
-Resume _GDBN__ and use the @code{exec-file} command to specify that _GDBN__
-should run the program under that name. Then start the program again.
-
-@c FIXME: RMS commented here "Show example". Maybe when someone
-@c explains the first FIXME: in this section...
-
-@item
-Relink the program so that the text segment is nonsharable, using the
-linker option @samp{-N}. The operating system limitation may not apply
-to nonsharable executables.
-@end enumerate
-
-@node Continuing and Stepping, Signals, Breakpoints, Stopping
-@section Continuing and Stepping
-
-@cindex stepping
-@cindex continuing
-@cindex resuming execution
-@dfn{Continuing} means resuming program execution until your program
-completes normally. In contrast, @dfn{stepping} means executing just
-one more ``step'' of your program, where ``step'' may mean either one
-line of source code, or one machine instruction (depending on what
-particular command you use). Either when continuing
-or when stepping, the program may stop even sooner, due to a breakpoint
-or to a signal. (If due to a signal, you may want to use @code{handle},
-or use @samp{signal 0} to resume execution; @pxref{Signals}.)
-
-@table @code
-@item continue @r{[}@var{ignore-count}@r{]}
-@kindex continue
-Resume program execution, at the address where the program last stopped;
-any breakpoints set at that address are bypassed. The optional argument
-@var{ignore-count} allows you to specify a further number of times to
-ignore a breakpoint at this location; its effect is like that of
-@code{ignore} (@pxref{Conditions}).
-
-To resume execution at a different place, you can use @code{return}
-(@pxref{Returning}) to go back to the calling function; or @code{jump}
-(@pxref{Jumping}) to go to an arbitrary location in your program.
-
-@end table
-
-A typical technique for using stepping is to set a breakpoint
-(@pxref{Breakpoints}) at the beginning of the function or the section of
-the program in which a problem is believed to lie, run the program until
-it stops at that breakpoint, and then step through the suspect area,
-examining the variables that are interesting, until you see the problem
-happen.
-
-@table @code
-@item step
-@kindex step
-@kindex s
-Continue running the program until control reaches a different source
-line, then stop it and return control to _GDBN__. This command is
-abbreviated @code{s}.
-
-@quotation
-@emph{Warning:} If you use the @code{step} command while control is
-within a function that was compiled without debugging information,
-execution will proceed until control reaches another function.
-@end quotation
-
-@item step @var{count}
-Continue running as in @code{step}, but do so @var{count} times. If a
-breakpoint is reached or a signal not related to stepping occurs before
-@var{count} steps, stepping stops right away.
-
-@item next @r{[}@var{count}@r{]}
-@kindex next
-@kindex n
-Continue to the next source line in the current (innermost) stack frame.
-Similar to @code{step}, but any function calls appearing within the line
-of code are executed without stopping. Execution stops when control
-reaches a different line of code at the stack level which was executing
-when the @code{next} command was given. This command is abbreviated
-@code{n}.
-
-An argument @var{count} is a repeat count, as for @code{step}.
-
-@code{next} within a function that lacks debugging information acts like
-@code{step}, but any function calls appearing within the code of the
-function are executed without stopping.
-
-@item finish
-@kindex finish
-Continue running until just after function in the selected stack frame
-returns. Print the returned value (if any).
-
-Contrast this with the @code{return} command (@pxref{Returning}).
-
-@item until
-@kindex until
-@item u
-@kindex u
-Continue running until a source line past the current line, in the
-current stack frame, is reached. This command is used to avoid single
-stepping through a loop more than once. It is like the @code{next}
-command, except that when @code{until} encounters a jump, it
-automatically continues execution until the program counter is greater
-than the address of the jump.
-
-This means that when you reach the end of a loop after single stepping
-though it, @code{until} will cause the program to continue execution
-until the loop is exited. In contrast, a @code{next} command at the end
-of a loop will simply step back to the beginning of the loop, which
-would force you to step through the next iteration.
-
-@code{until} always stops the program if it attempts to exit the current
-stack frame.
-
-@code{until} may produce somewhat counterintuitive results if the order
-of machine code does not match the order of the source lines. For
-example, in the following excerpt from a debugging session, the @code{f}
-(@code{frame}) command shows that execution is stopped at line
-@code{206}; yet when we use @code{until}, we get to line @code{195}:
-
-@example
-(_GDBP__) f
-#0 main (argc=4, argv=0xf7fffae8) at m4.c:206
-206 expand_input();
-(_GDBP__) until
-195 for ( ; argc > 0; NEXTARG) @{
-@end example
-
-This happened because, for execution efficiency, the compiler had
-generated code for the loop closure test at the end, rather than the
-start, of the loop---even though the test in a C @code{for}-loop is
-written before the body of the loop. The @code{until} command appeared
-to step back to the beginning of the loop when it advanced to this
-expression; however, it has not really gone to an earlier
-statement---not in terms of the actual machine code.
-
-@code{until} with no argument works by means of single
-instruction stepping, and hence is slower than @code{until} with an
-argument.
-
-@item until @var{location}
-@item u @var{location}
-Continue running the program until either the specified location is
-reached, or the current stack frame returns. @var{location}
-is any of the forms of argument acceptable to @code{break}
-(@pxref{Set Breaks}). This form of the command uses breakpoints, and
-hence is quicker than @code{until} without an argument.
-
-@item stepi
-@itemx si
-@kindex stepi
-@kindex si
-Execute one machine instruction, then stop and return to the debugger.
-
-It is often useful to do @samp{display/i $pc} when stepping by machine
-instructions. This will cause the next instruction to be executed to
-be displayed automatically at each stop. @xref{Auto Display}.
-
-An argument is a repeat count, as in @code{step}.
-
-@item nexti
-@itemx ni
-@kindex nexti
-@kindex ni
-Execute one machine instruction, but if it is a function call,
-proceed until the function returns.
-
-An argument is a repeat count, as in @code{next}.
-@end table
-
-
-@node Signals, , Continuing and Stepping, Stopping
-@section Signals
-@cindex signals
-
-A signal is an asynchronous event that can happen in a program. The
-operating system defines the possible kinds of signals, and gives each
-kind a name and a number. For example, in Unix @code{SIGINT} is the
-signal a program gets when you type an interrupt (often @kbd{C-c});
-@code{SIGSEGV} is the signal a program gets from referencing a place in
-memory far away from all the areas in use; @code{SIGALRM} occurs when
-the alarm clock timer goes off (which happens only if the program has
-requested an alarm).
-
-@cindex fatal signals
-Some signals, including @code{SIGALRM}, are a normal part of the
-functioning of the program. Others, such as @code{SIGSEGV}, indicate
-errors; these signals are @dfn{fatal} (kill the program immediately) if the
-program has not specified in advance some other way to handle the signal.
-@code{SIGINT} does not indicate an error in the program, but it is normally
-fatal so it can carry out the purpose of the interrupt: to kill the program.
-
-_GDBN__ has the ability to detect any occurrence of a signal in the program
-running under _GDBN__'s control. You can tell _GDBN__ in advance what to do for
-each kind of signal.
-
-@cindex handling signals
-Normally, _GDBN__ is set up to ignore non-erroneous signals like @code{SIGALRM}
-(so as not to interfere with their role in the functioning of the program)
-but to stop the program immediately whenever an error signal happens.
-You can change these settings with the @code{handle} command.
-
-@table @code
-@item info signals
-@kindex info signals
-Print a table of all the kinds of signals and how _GDBN__ has been told to
-handle each one. You can use this to see the signal numbers of all
-the defined types of signals.
-
-@item handle @var{signal} @var{keywords}@dots{}
-@kindex handle
-Change the way _GDBN__ handles signal @var{signal}. @var{signal} can be the
-number of a signal or its name (with or without the @samp{SIG} at the
-beginning). The @var{keywords} say what change to make.
-@end table
-
-@c @group
-The keywords allowed by the @code{handle} command can be abbreviated.
-Their full names are:
-
-@table @code
-@item nostop
-_GDBN__ should not stop the program when this signal happens. It may
-still print a message telling you that the signal has come in.
-
-@item stop
-_GDBN__ should stop the program when this signal happens. This implies
-the @code{print} keyword as well.
-
-@item print
-_GDBN__ should print a message when this signal happens.
-
-@item noprint
-_GDBN__ should not mention the occurrence of the signal at all. This
-implies the @code{nostop} keyword as well.
-
-@item pass
-_GDBN__ should allow the program to see this signal; the program will be
-able to handle the signal, or may be terminated if the signal is fatal
-and not handled.
-
-@item nopass
-_GDBN__ should not allow the program to see this signal.
-@end table
-@c @end group
-
-When a signal has been set to stop the program, the program cannot see the
-signal until you continue. It will see the signal then, if @code{pass} is
-in effect for the signal in question @i{at that time}. In other words,
-after _GDBN__ reports a signal, you can use the @code{handle} command with
-@code{pass} or @code{nopass} to control whether that signal will be seen by
-the program when you later continue it.
-
-You can also use the @code{signal} command to prevent the program from
-seeing a signal, or cause it to see a signal it normally would not see,
-or to give it any signal at any time. For example, if the program stopped
-due to some sort of memory reference error, you might store correct
-values into the erroneous variables and continue, hoping to see more
-execution; but the program would probably terminate immediately as
-a result of the fatal signal once it sees the signal. To prevent this,
-you can continue with @samp{signal 0}. @xref{Signaling}.
-
-@node Stack, Source, Stopping, Top
-@chapter Examining the Stack
-
-When your program has stopped, the first thing you need to know is where it
-stopped and how it got there.
-
-@cindex call stack
-Each time your program performs a function call, the information about
-where in the program the call was made from is saved in a block of data
-called a @dfn{stack frame}. The frame also contains the arguments of the
-call and the local variables of the function that was called. All the
-stack frames are allocated in a region of memory called the @dfn{call
-stack}.
-
-When your program stops, the _GDBN__ commands for examining the stack allow you
-to see all of this information.
-
-@cindex selected frame
-One of the stack frames is @dfn{selected} by _GDBN__ and many _GDBN__ commands
-refer implicitly to the selected frame. In particular, whenever you ask
-_GDBN__ for the value of a variable in the program, the value is found in the
-selected frame. There are special _GDBN__ commands to select whichever frame
-you are interested in.
-
-When the program stops, _GDBN__ automatically selects the currently executing
-frame and describes it briefly as the @code{frame} command does
-(@pxref{Frame Info}).
-
-@menu
-* Frames:: Stack Frames
-* Backtrace:: Backtraces
-* Selection:: Selecting a Frame
-* Frame Info:: Information on a Frame
-@end menu
-
-@node Frames, Backtrace, Stack, Stack
-@section Stack Frames
-
-@cindex frame
-@cindex stack frame
-The call stack is divided up into contiguous pieces called @dfn{stack
-frames}, or @dfn{frames} for short; each frame is the data associated
-with one call to one function. The frame contains the arguments given
-to the function, the function's local variables, and the address at
-which the function is executing.
-
-@cindex initial frame
-@cindex outermost frame
-@cindex innermost frame
-When your program is started, the stack has only one frame, that of the
-function @code{main}. This is called the @dfn{initial} frame or the
-@dfn{outermost} frame. Each time a function is called, a new frame is
-made. Each time a function returns, the frame for that function invocation
-is eliminated. If a function is recursive, there can be many frames for
-the same function. The frame for the function in which execution is
-actually occurring is called the @dfn{innermost} frame. This is the most
-recently created of all the stack frames that still exist.
-
-@cindex frame pointer
-Inside your program, stack frames are identified by their addresses. A
-stack frame consists of many bytes, each of which has its own address; each
-kind of computer has a convention for choosing one of those bytes whose
-address serves as the address of the frame. Usually this address is kept
-in a register called the @dfn{frame pointer register} while execution is
-going on in that frame.
-
-@cindex frame number
-_GDBN__ assigns numbers to all existing stack frames, starting with
-zero for the innermost frame, one for the frame that called it,
-and so on upward. These numbers do not really exist in your program;
-they are assigned by _GDBN__ to give you a way of designating stack
-frames in _GDBN__ commands.
-
-@cindex frameless execution
-Some compilers allow functions to be compiled so that they operate
-without stack frames. (For example, the @code{_GCC__} option
-@samp{-fomit-frame-pointer} will generate functions without a frame.)
-This is occasionally done with heavily used library functions to save
-the frame setup time. _GDBN__ has limited facilities for dealing with
-these function invocations. If the innermost function invocation has no
-stack frame, _GDBN__ will nevertheless regard it as though it had a
-separate frame, which is numbered zero as usual, allowing correct
-tracing of the function call chain. However, _GDBN__ has no provision
-for frameless functions elsewhere in the stack.
-
-@node Backtrace, Selection, Frames, Stack
-@section Backtraces
-
-A backtrace is a summary of how the program got where it is. It shows one
-line per frame, for many frames, starting with the currently executing
-frame (frame zero), followed by its caller (frame one), and on up the
-stack.
-
-@table @code
-@item backtrace
-@itemx bt
-@kindex backtrace
-@kindex bt
-Print a backtrace of the entire stack: one line per frame for all
-frames in the stack.
-
-You can stop the backtrace at any time by typing the system interrupt
-character, normally @kbd{C-c}.
-
-@item backtrace @var{n}
-@itemx bt @var{n}
-Similar, but print only the innermost @var{n} frames.
-
-@item backtrace -@var{n}
-@itemx bt -@var{n}
-Similar, but print only the outermost @var{n} frames.
-@end table
-
-@kindex where
-@kindex info stack
-@kindex info s
-The names @code{where} and @code{info stack} (abbreviated @code{info s})
-are additional aliases for @code{backtrace}.
-
-Each line in the backtrace shows the frame number and the function name.
-The program counter value is also shown---unless you use @code{set
-print address off}. The backtrace also shows the source file name and
-line number, as well as the arguments to the function. The program
-counter value is omitted if it is at the beginning of the code for that
-line number.
-
-Here is an example of a backtrace. It was made with the command
-@samp{bt 3}, so it shows the innermost three frames.
-
-@smallexample
-@group
-#0 m4_traceon (obs=0x24eb0, argc=1, argv=0x2b8c8)
- at builtin.c:993
-#1 0x6e38 in expand_macro (sym=0x2b600) at macro.c:242
-#2 0x6840 in expand_token (obs=0x0, t=177664, td=0xf7fffb08)
- at macro.c:71
-(More stack frames follow...)
-@end group
-@end smallexample
-
-@noindent
-The display for frame zero doesn't begin with a program counter
-value, indicating that the program has stopped at the beginning of the
-code for line @code{993} of @code{builtin.c}.
-
-@node Selection, Frame Info, Backtrace, Stack
-@section Selecting a Frame
-
-Most commands for examining the stack and other data in the program work on
-whichever stack frame is selected at the moment. Here are the commands for
-selecting a stack frame; all of them finish by printing a brief description
-of the stack frame just selected.
-
-@table @code
-@item frame @var{n}
-@itemx f @var{n}
-@kindex frame
-@kindex f
-Select frame number @var{n}. Recall that frame zero is the innermost
-(currently executing) frame, frame one is the frame that called the
-innermost one, and so on. The highest-numbered frame is @code{main}'s
-frame.
-
-@item frame @var{addr}
-@itemx f @var{addr}
-Select the frame at address @var{addr}. This is useful mainly if the
-chaining of stack frames has been damaged by a bug, making it
-impossible for _GDBN__ to assign numbers properly to all frames. In
-addition, this can be useful when the program has multiple stacks and
-switches between them.
-
-_if__(_SPARC__)
-On the SPARC architecture, @code{frame} needs two addresses to
-select an arbitrary frame: a frame pointer and a stack pointer.
-@c note to future updaters: this is conditioned on a flag
-@c FRAME_SPECIFICATION_DYADIC in the tm-*.h files, currently only used
-@c by SPARC, hence the specific attribution. Generalize or list all
-@c possibilities if more supported machines start doing this.
-_fi__(_SPARC__)
-
-@item up @var{n}
-@kindex up
-Move @var{n} frames up the stack. For positive numbers @var{n}, this
-advances toward the outermost frame, to higher frame numbers, to frames
-that have existed longer. @var{n} defaults to one.
-
-@item down @var{n}
-@kindex down
-@kindex do
-Move @var{n} frames down the stack. For positive numbers @var{n}, this
-advances toward the innermost frame, to lower frame numbers, to frames
-that were created more recently. @var{n} defaults to one. You may
-abbreviate @code{down} as @code{do}.
-@end table
-
-All of these commands end by printing two lines of output describing the
-frame. The first line shows the frame number, the function name, the
-arguments, and the source file and line number of execution in that
-frame. The second line shows the text of that source line. For
-example:
-
-@smallexample
-(_GDBP__) up
-#1 0x22f0 in main (argc=1, argv=0xf7fffbf4, env=0xf7fffbfc)
- at env.c:10
-10 read_input_file (argv[i]);
-@end smallexample
-
-After such a printout, the @code{list} command with no arguments will print
-ten lines centered on the point of execution in the frame. @xref{List}.
-
-@table @code
-@item up-silently @var{n}
-@itemx down-silently @var{n}
-@kindex down-silently
-@kindex up-silently
-These two commands are variants of @code{up} and @code{down},
-respectively; they differ in that they do their work silently, without
-causing display of the new frame. They are intended primarily for use
-in _GDBN__ command scripts, where the output might be unnecessary and
-distracting.
-
-@end table
-
-@node Frame Info, , Selection, Stack
-@section Information About a Frame
-
-There are several other commands to print information about the selected
-stack frame.
-
-@table @code
-@item frame
-@itemx f
-When used without any argument, this command does not change which frame
-is selected, but prints a brief description of the currently
-selected stack frame. It can be abbreviated @code{f}. With an
-argument, this command is used to select a stack frame (@pxref{Selection}).
-
-@item info frame
-@kindex info frame
-@itemx info f
-@kindex info f
-This command prints a verbose description of the selected stack frame,
-including the address of the frame, the addresses of the next frame down
-(called by this frame) and the next frame up (caller of this frame), the
-language that the source code corresponding to this frame was written in,
-the address of the frame's arguments, the program counter saved in it
-(the address of execution in the caller frame), and which registers
-were saved in the frame. The verbose description is useful when
-something has gone wrong that has made the stack format fail to fit
-the usual conventions.
-
-@item info frame @var{addr}
-@itemx info f @var{addr}
-Print a verbose description of the frame at address @var{addr},
-without selecting that frame. The selected frame remains unchanged by
-this command.
-
-@item info args
-@kindex info args
-Print the arguments of the selected frame, each on a separate line.
-
-@item info locals
-@kindex info locals
-Print the local variables of the selected frame, each on a separate
-line. These are all variables declared static or automatic within all
-program blocks that execution in this frame is currently inside of.
-
-@item info catch
-@kindex info catch
-@cindex catch exceptions
-@cindex exception handlers
-Print a list of all the exception handlers that are active in the
-current stack frame at the current point of execution. To see other
-exception handlers, visit the associated frame (using the @code{up},
-@code{down}, or @code{frame} commands); then type @code{info catch}.
-@xref{Exception Handling}.
-@end table
-
-@node Source, Data, Stack, Top
-@chapter Examining Source Files
-
-_GDBN__ can print parts of your program's source, since the debugging
-information recorded in your program tells _GDBN__ what source files
-were used to built it. When your program stops, _GDBN__ spontaneously
-prints the line where it stopped. Likewise, when you select a stack
-frame (@pxref{Selection}), _GDBN__ prints the line where execution in
-that frame has stopped. You can print other portions of source files by
-explicit command.
-
-If you use _GDBN__ through its GNU Emacs interface, you may prefer to
-use Emacs facilities to view source; @pxref{Emacs}.
-
-@menu
-* List:: Printing Source Lines
-* Search:: Searching Source Files
-* Source Path:: Specifying Source Directories
-* Machine Code:: Source and Machine Code
-@end menu
-
-@node List, Search, Source, Source
-@section Printing Source Lines
-
-@kindex list
-@kindex l
-To print lines from a source file, use the @code{list} command
-(abbreviated @code{l}). There are several ways to specify what part
-of the file you want to print.
-
-Here are the forms of the @code{list} command most commonly used:
-
-@table @code
-@item list @var{linenum}
-Print lines centered around line number @var{linenum} in the
-current source file.
-
-@item list @var{function}
-Print lines centered around the beginning of function
-@var{function}.
-
-@item list
-Print more lines. If the last lines printed were printed with a
-@code{list} command, this prints lines following the last lines
-printed; however, if the last line printed was a solitary line printed
-as part of displaying a stack frame (@pxref{Stack}), this prints
-lines centered around that line.
-
-@item list -
-Print lines just before the lines last printed.
-@end table
-
-By default, _GDBN__ prints ten source lines with any of these forms of
-the @code{list} command. You can change this using @code{set listsize}:
-
-@table @code
-@item set listsize @var{count}
-@kindex set listsize
-Make the @code{list} command display @var{count} source lines (unless
-the @code{list} argument explicitly specifies some other number).
-
-@item show listsize
-@kindex show listsize
-Display the number of lines that @code{list} will currently display by
-default.
-@end table
-
-Repeating a @code{list} command with @key{RET} discards the argument,
-so it is equivalent to typing just @code{list}. This is more useful
-than listing the same lines again. An exception is made for an
-argument of @samp{-}; that argument is preserved in repetition so that
-each repetition moves up in the source file.
-
-@cindex linespec
-In general, the @code{list} command expects you to supply zero, one or two
-@dfn{linespecs}. Linespecs specify source lines; there are several ways
-of writing them but the effect is always to specify some source line.
-Here is a complete description of the possible arguments for @code{list}:
-
-@table @code
-@item list @var{linespec}
-Print lines centered around the line specified by @var{linespec}.
-
-@item list @var{first},@var{last}
-Print lines from @var{first} to @var{last}. Both arguments are
-linespecs.
-
-@item list ,@var{last}
-Print lines ending with @var{last}.
-
-@item list @var{first},
-Print lines starting with @var{first}.
-
-@item list +
-Print lines just after the lines last printed.
-
-@item list -
-Print lines just before the lines last printed.
-
-@item list
-As described in the preceding table.
-@end table
-
-Here are the ways of specifying a single source line---all the
-kinds of linespec.
-
-@table @code
-@item @var{number}
-Specifies line @var{number} of the current source file.
-When a @code{list} command has two linespecs, this refers to
-the same source file as the first linespec.
-
-@item +@var{offset}
-Specifies the line @var{offset} lines after the last line printed.
-When used as the second linespec in a @code{list} command that has
-two, this specifies the line @var{offset} lines down from the
-first linespec.
-
-@item -@var{offset}
-Specifies the line @var{offset} lines before the last line printed.
-
-@item @var{filename}:@var{number}
-Specifies line @var{number} in the source file @var{filename}.
-
-@item @var{function}
-@c FIXME: "of the open-brace" is C-centric. When we add other langs...
-Specifies the line of the open-brace that begins the body of the
-function @var{function}.
-
-@item @var{filename}:@var{function}
-Specifies the line of the open-brace that begins the body of the
-function @var{function} in the file @var{filename}. You only need the
-file name with a function name to avoid ambiguity when there are
-identically named functions in different source files.
-
-@item *@var{address}
-Specifies the line containing the program address @var{address}.
-@var{address} may be any expression.
-@end table
-
-@node Search, Source Path, List, Source
-@section Searching Source Files
-@cindex searching
-@kindex reverse-search
-
-There are two commands for searching through the current source file for a
-regular expression.
-
-@table @code
-@item forward-search @var{regexp}
-@itemx search @var{regexp}
-@kindex search
-@kindex forward-search
-The command @samp{forward-search @var{regexp}} checks each line, starting
-with the one following the last line listed, for a match for @var{regexp}.
-It lists the line that is found. You can abbreviate the command name
-as @code{fo}. The synonym @samp{search @var{regexp}} is also supported.
-
-@item reverse-search @var{regexp}
-The command @samp{reverse-search @var{regexp}} checks each line, starting
-with the one before the last line listed and going backward, for a match
-for @var{regexp}. It lists the line that is found. You can abbreviate
-this command as @code{rev}.
-@end table
-
-@node Source Path, Machine Code, Search, Source
-@section Specifying Source Directories
-
-@cindex source path
-@cindex directories for source files
-Executable programs sometimes do not record the directories of the source
-files from which they were compiled, just the names. Even when they do,
-the directories could be moved between the compilation and your debugging
-session. _GDBN__ has a list of directories to search for source files;
-this is called the @dfn{source path}. Each time _GDBN__ wants a source file,
-it tries all the directories in the list, in the order they are present
-in the list, until it finds a file with the desired name. Note that
-the executable search path is @emph{not} used for this purpose. Neither is
-the current working directory, unless it happens to be in the source
-path.
-
-If _GDBN__ can't find a source file in the source path, and the object
-program records a directory, _GDBN__ tries that directory too. If the
-source path is empty, and there is no record of the compilation
-directory, _GDBN__ will, as a last resort, look in the current
-directory.
-
-Whenever you reset or rearrange the source path, _GDBN__ will clear out
-any information it has cached about where source files are found, where
-each line is in the file, etc.
-
-@kindex directory
-When you start _GDBN__, its source path is empty.
-To add other directories, use the @code{directory} command.
-
-@table @code
-@item directory @var{dirname} @dots{}
-Add directory @var{dirname} to the front of the source path. Several
-directory names may be given to this command, separated by @samp{:} or
-whitespace. You may specify a directory that is already in the source
-path; this moves it forward, so it will be searched sooner.
-
-You can use the string @samp{$cdir} to refer to the compilation
-directory (if one is recorded), and @samp{$cwd} to refer to the current
-working directory. @samp{$cwd} is not the same as @samp{.}---the former
-tracks the current working directory as it changes during your _GDBN__
-session, while the latter is immediately expanded to the current
-directory at the time you add an entry to the source path.
-
-@item directory
-Reset the source path to empty again. This requires confirmation.
-
-@c RET-repeat for @code{directory} is explicitly disabled, but since
-@c repeating it would be a no-op we don't say that. (thanks to RMS)
-
-@item show directories
-@kindex show directories
-Print the source path: show which directories it contains.
-@end table
-
-If your source path is cluttered with directories that are no longer of
-interest, _GDBN__ may sometimes cause confusion by finding the wrong
-versions of source. You can correct the situation as follows:
-
-@enumerate
-@item
-Use @code{directory} with no argument to reset the source path to empty.
-
-@item
-Use @code{directory} with suitable arguments to reinstall the
-directories you want in the source path. You can add all the
-directories in one command.
-@end enumerate
-
-@node Machine Code, , Source Path, Source
-@section Source and Machine Code
-You can use the command @code{info line} to map source lines to program
-addresses (and viceversa), and the command @code{disassemble} to display
-a range of addresses as machine instructions.
-
-@table @code
-@item info line @var{linespec}
-@kindex info line
-Print the starting and ending addresses of the compiled code for
-source line @var{linespec}. You can specify source lines in any of the
-ways understood by the @code{list} command (@pxref{List}).
-@end table
-
-For example, we can use @code{info line} to inquire on where the object
-code for the first line of function @code{m4_changequote} lies:
-@smallexample
-(_GDBP__) info line m4_changecom
-Line 895 of "builtin.c" starts at pc 0x634c and ends at 0x6350.
-@end smallexample
-
-@noindent
-We can also inquire (using @code{*@var{addr}} as the form for
-@var{linespec}) what source line covers a particular address:
-@smallexample
-(_GDBP__) info line *0x63ff
-Line 926 of "builtin.c" starts at pc 0x63e4 and ends at 0x6404.
-@end smallexample
-
-@cindex @code{$_} and @code{info line}
-After @code{info line}, the default address for the @code{x}
-command is changed to the starting address of the line, so that
-@samp{x/i} is sufficient to begin examining the machine code
-(@pxref{Memory}). Also, this address is saved as the value of the
-convenience variable @code{$_} (@pxref{Convenience Vars}).
-
-@table @code
-@kindex disassemble
-@item disassemble
-This specialized command is provided to dump a range of memory as
-machine instructions. The default memory range is the function
-surrounding the program counter of the selected frame. A single
-argument to this command is a program counter value; the function
-surrounding this value will be dumped. Two arguments (separated by one
-or more spaces) specify a range of addresses (first inclusive, second
-exclusive) to be dumped.
-@end table
-
-We can use @code{disassemble} to inspect the object code
-range shown in the last @code{info line} example:
-
-@smallexample
-(_GDBP__) disas 0x63e4 0x6404
-Dump of assembler code from 0x63e4 to 0x6404:
-0x63e4 <builtin_init+5340>: ble 0x63f8 <builtin_init+5360>
-0x63e8 <builtin_init+5344>: sethi %hi(0x4c00), %o0
-0x63ec <builtin_init+5348>: ld [%i1+4], %o0
-0x63f0 <builtin_init+5352>: b 0x63fc <builtin_init+5364>
-0x63f4 <builtin_init+5356>: ld [%o0+4], %o0
-0x63f8 <builtin_init+5360>: or %o0, 0x1a4, %o0
-0x63fc <builtin_init+5364>: call 0x9288 <path_search>
-0x6400 <builtin_init+5368>: nop
-End of assembler dump.
-(_GDBP__)
-
-@end smallexample
-
-@node Data, Languages, Source, Top
-@chapter Examining Data
-
-@cindex printing data
-@cindex examining data
-@kindex print
-@kindex inspect
-@c "inspect" isn't quite a synonym if you're using Epoch, which we don't
-@c document because it's nonstandard... Under Epoch it displays in a
-@c different window or something like that.
-The usual way to examine data in your program is with the @code{print}
-command (abbreviated @code{p}), or its synonym @code{inspect}. It
-evaluates and prints the value of an expression of the language your
-program is written in (@pxref{Languages}).
-
-@table @code
-@item print @var{exp}
-@itemx print /@var{f} @var{exp}
-@var{exp} is an expression (in the source language). By default
-the value of @var{exp} is printed in a format appropriate to its data
-type; you can choose a different format by specifying @samp{/@var{f}},
-where @var{f} is a letter specifying the format; @pxref{Output formats}.
-
-@item print
-@itemx print /@var{f}
-If you omit @var{exp}, _GDBN__ displays the last value again (from the
-@dfn{value history}; @pxref{Value History}). This allows you to
-conveniently inspect the same value in an alternative format.
-@end table
-
-A more low-level way of examining data is with the @code{x} command.
-It examines data in memory at a specified address and prints it in a
-specified format. @xref{Memory}.
-
-If you're interested in information about types, or about how the fields
-of a struct or class are declared, use the @code{ptype @var{exp}}
-command rather than @code{print}. @xref{Symbols}.
-
-@menu
-* Expressions:: Expressions
-* Variables:: Program Variables
-* Arrays:: Artificial Arrays
-* Output formats:: Output formats
-* Memory:: Examining Memory
-* Auto Display:: Automatic Display
-* Print Settings:: Print Settings
-* Value History:: Value History
-* Convenience Vars:: Convenience Variables
-* Registers:: Registers
-* Floating Point Hardware:: Floating Point Hardware
-@end menu
-
-@node Expressions, Variables, Data, Data
-@section Expressions
-
-@cindex expressions
-@code{print} and many other _GDBN__ commands accept an expression and
-compute its value. Any kind of constant, variable or operator defined
-by the programming language you are using is legal in an expression in
-_GDBN__. This includes conditional expressions, function calls, casts
-and string constants. It unfortunately does not include symbols defined
-by preprocessor @code{#define} commands.
-
-Because C is so widespread, most of the expressions shown in examples in
-this manual are in C. @xref{Languages,, Using _GDBN__ with Different
-Languages}, for information on how to use expressions in other
-languages.
-
-In this section, we discuss operators that you can use in _GDBN__
-expressions regardless of your programming language.
-
-Casts are supported in all languages, not just in C, because it is so
-useful to cast a number into a pointer so as to examine a structure
-at that address in memory.
-@c FIXME: casts supported---Mod2 true?
-
-_GDBN__ supports these operators in addition to those of programming
-languages:
-
-@table @code
-@item @@
-@samp{@@} is a binary operator for treating parts of memory as arrays.
-@xref{Arrays}, for more information.
-
-@item ::
-@samp{::} allows you to specify a variable in terms of the file or
-function where it is defined. @xref{Variables}.
-
-@item @{@var{type}@} @var{addr}
-Refers to an object of type @var{type} stored at address @var{addr} in
-memory. @var{addr} may be any expression whose value is an integer or
-pointer (but parentheses are required around binary operators, just as in
-a cast). This construct is allowed regardless of what kind of data is
-normally supposed to reside at @var{addr}.@refill
-@end table
-
-@node Variables, Arrays, Expressions, Data
-@section Program Variables
-
-The most common kind of expression to use is the name of a variable
-in your program.
-
-Variables in expressions are understood in the selected stack frame
-(@pxref{Selection}); they must either be global (or static) or be visible
-according to the scope rules of the programming language from the point of
-execution in that frame. This means that in the function
-
-@example
-foo (a)
- int a;
-@{
- bar (a);
- @{
- int b = test ();
- bar (b);
- @}
-@}
-@end example
-
-@noindent
-the variable @code{a} is usable whenever the program is executing
-within the function @code{foo}, but the variable @code{b} is visible
-only while the program is executing inside the block in which @code{b}
-is declared.
-
-@cindex variable name conflict
-There is an exception: you can refer to a variable or function whose
-scope is a single source file even if the current execution point is not
-in this file. But it is possible to have more than one such variable or
-function with the same name (in different source files). If that happens,
-referring to that name has unpredictable effects. If you wish, you can
-specify a variable in a particular file, using the colon-colon notation:
-
-@cindex colon-colon
-@kindex ::
-@example
-@var{file}::@var{variable}
-@end example
-
-@noindent
-Here @var{file} is the name of the source file whose variable you want.
-
-@cindex C++ scope resolution
-This use of @samp{::} is very rarely in conflict with the very similar
-use of the same notation in C++. _GDBN__ also supports use of the C++
-scope resolution operator in _GDBN__ expressions.
-
-@cindex wrong values
-@cindex variable values, wrong
-@quotation
-@emph{Warning:} Occasionally, a local variable may appear to have the
-wrong value at certain points in a function---just after entry to the
-function, and just before exit. You may see this problem when you're
-stepping by machine instructions. This is because on most machines, it
-takes more than one instruction to set up a stack frame (including local
-variable definitions); if you're stepping by machine instructions,
-variables may appear to have the wrong values until the stack frame is
-completely built. On function exit, it usually also takes more than one
-machine instruction to destroy a stack frame; after you begin stepping
-through that group of instructions, local variable definitions may be
-gone.
-@end quotation
-
-@node Arrays, Output formats, Variables, Data
-@section Artificial Arrays
-
-@cindex artificial array
-@kindex @@
-It is often useful to print out several successive objects of the
-same type in memory; a section of an array, or an array of
-dynamically determined size for which only a pointer exists in the
-program.
-
-This can be done by constructing an @dfn{artificial array} with the
-binary operator @samp{@@}. The left operand of @samp{@@} should be
-the first element of the desired array, as an individual object.
-The right operand should be the desired length of the array. The result is
-an array value whose elements are all of the type of the left argument.
-The first element is actually the left argument; the second element
-comes from bytes of memory immediately following those that hold the
-first element, and so on. Here is an example. If a program says
-
-@example
-int *array = (int *) malloc (len * sizeof (int));
-@end example
-
-@noindent
-you can print the contents of @code{array} with
-
-@example
-p *array@@len
-@end example
-
-The left operand of @samp{@@} must reside in memory. Array values made
-with @samp{@@} in this way behave just like other arrays in terms of
-subscripting, and are coerced to pointers when used in expressions.
-Artificial arrays most often appear in expressions via the value history
-(@pxref{Value History}), after printing one out.)
-
-Sometimes the artificial array mechanism isn't quite enough; in
-moderately complex data structures, the elements of interest may not
-actually be adjacent---for example, if you're interested in the values
-of pointers in an array. One useful work-around in this situation is to
-use a convenience variable (@pxref{Convenience Vars}) as a counter in an
-expression that prints the first interesting value, and then repeat that
-expression via @key{RET}. For instance, suppose you have an array
-@code{dtab} of pointers to structures, and you're interested in the
-values of a field @code{fv} in each structure. Here's an example of
-what you might type:
-@example
-set $i = 0
-p dtab[$i++]->fv
-@key{RET}
-@key{RET}
-@dots{}
-@end example
-
-@node Output formats, Memory, Arrays, Data
-@section Output formats
-
-@cindex formatted output
-@cindex output formats
-By default, _GDBN__ prints a value according to its data type. Sometimes
-this is not what you want. For example, you might want to print a number
-in hex, or a pointer in decimal. Or you might want to view data in memory
-at a certain address as a character string or as an instruction. To do
-these things, specify an @dfn{output format} when you print a value.
-
-The simplest use of output formats is to say how to print a value
-already computed. This is done by starting the arguments of the
-@code{print} command with a slash and a format letter. The format
-letters supported are:
-
-@table @code
-@item x
-Regard the bits of the value as an integer, and print the integer in
-hexadecimal.
-
-@item d
-Print as integer in signed decimal.
-
-@item u
-Print as integer in unsigned decimal.
-
-@item o
-Print as integer in octal.
-
-@item t
-Print as integer in binary. The letter @samp{t} stands for ``two''.
-
-@item a
-Print as an address, both absolute in hex and as an offset from the
-nearest preceding symbol. This format can be used to discover where (in
-what function) an unknown address is located:
-@example
-(_GDBP__) p/a 0x54320
-_0__$3 = 0x54320 <_initialize_vx+396>_1__
-@end example
-
-
-@item c
-Regard as an integer and print it as a character constant.
-
-@item f
-Regard the bits of the value as a floating point number and print
-using typical floating point syntax.
-@end table
-
-For example, to print the program counter in hex (@pxref{Registers}), type
-
-@example
-p/x $pc
-@end example
-
-@noindent
-Note that no space is required before the slash; this is because command
-names in _GDBN__ cannot contain a slash.
-
-To reprint the last value in the value history with a different format,
-you can use the @code{print} command with just a format and no
-expression. For example, @samp{p/x} reprints the last value in hex.
-
-@node Memory, Auto Display, Output formats, Data
-@section Examining Memory
-
-@cindex examining memory
-@table @code
-@kindex x
-@item x/@var{nfu} @var{addr}
-@itemx x @var{addr}
-@itemx x
-You can use the command @code{x} (for `examine') to examine memory in
-any of several formats, independently of your program's data types.
-@var{n}, @var{f}, and @var{u} are all optional parameters to specify how
-much memory to display, and how to format it; @var{addr} is an
-expression giving the address where you want to start displaying memory.
-If you use defaults for @var{nfu}, you need not type the slash @samp{/}.
-Several commands set convenient defaults for @var{addr}.
-@end table
-
-@var{n}, the repeat count, is a decimal integer; the default is 1. It
-specifies how much memory (counting by units @var{u}) to display.
-@c This really is **decimal**; unaffected by 'set radix' as of GDB
-@c 4.1.2.
-
-@var{f}, the display format, is one of the formats used by @code{print},
-or @samp{s} (null-terminated string) or @samp{i} (machine instruction).
-The default is @samp{x} (hexadecimal) initially, or the format from the
-last time you used either @code{x} or @code{print}.
-
-@var{u}, the unit size, is any of
-@table @code
-@item b
-Bytes.
-@item h
-Halfwords (two bytes).
-@item w
-Words (four bytes). This is the initial default.
-@item g
-Giant words (eight bytes).
-@end table
-
-@noindent
-Each time you specify a unit size with @code{x}, that size becomes the
-default unit the next time you use @code{x}. (For the @samp{s} and
-@samp{i} formats, the unit size is ignored and is normally not written.)
-
-@var{addr} is the address where you want _GDBN__ to begin displaying
-memory. The expression need not have a pointer value (though it may);
-it is always interpreted as an integer address of a byte of memory.
-@xref{Expressions} for more information on expressions. The default for
-@var{addr} is usually just after the last address examined---but several
-other commands also set the default address: @code{info breakpoints} (to
-the address of the last breakpoint listed), @code{info line} (to the
-starting address of a line), and @code{print} (if you use it to display
-a value from memory).
-
-For example, @samp{x/3uh 0x54320} is a request to display three halfwords
-(@code{h}) of memory, formatted as unsigned decimal integers (@samp{u}),
-starting at address @code{0x54320}. @samp{x/4xw $sp} prints the four
-words (@samp{w}) of memory above the stack pointer (here, @samp{$sp};
-@pxref{Registers}) in hexadecimal (@samp{x}).
-
-Since the letters indicating unit sizes are all distinct from the
-letters specifying output formats, you don't have to remember whether
-unit size or format comes first; either order will work. The output
-specifications @samp{4xw} and @samp{4wx} mean exactly the same thing.
-(However, the count @var{n} must come first; @samp{wx4} will not work.)
-
-Even though the unit size @var{u} is ignored for the formats @samp{s}
-and @samp{i}, you might still want to use a count @var{n}; for example,
-@samp{3i} specifies that you want to see three machine instructions,
-including any operands. The command @code{disassemble} gives an
-alternative way of inspecting machine instructions; @pxref{Machine
-Code}.
-
-All the defaults for the arguments to @code{x} are designed to make it
-easy to continue scanning memory with minimal specifications each time
-you use @code{x}. For example, after you've inspected three machine
-instructions with @samp{x/3i @var{addr}}, you can inspect the next seven
-with just @samp{x/7}. If you use @key{RET} to repeat the @code{x} command,
-the repeat count @var{n} is used again; the other arguments default as
-for successive uses of @code{x}.
-
-@cindex @code{$_}, @code{$__}, and value history
-The addresses and contents printed by the @code{x} command are not saved
-in the value history because there is often too much of them and they
-would get in the way. Instead, _GDBN__ makes these values available for
-subsequent use in expressions as values of the convenience variables
-@code{$_} and @code{$__}. After an @code{x} command, the last address
-examined is available for use in expressions in the convenience variable
-@code{$_}. The contents of that address, as examined, are available in
-the convenience variable @code{$__}.
-
-If the @code{x} command has a repeat count, the address and contents saved
-are from the last memory unit printed; this is not the same as the last
-address printed if several units were printed on the last line of output.
-
-@node Auto Display, Print Settings, Memory, Data
-@section Automatic Display
-@cindex automatic display
-@cindex display of expressions
-
-If you find that you want to print the value of an expression frequently
-(to see how it changes), you might want to add it to the @dfn{automatic
-display list} so that _GDBN__ will print its value each time the program stops.
-Each expression added to the list is given a number to identify it;
-to remove an expression from the list, you specify that number.
-The automatic display looks like this:
-
-@example
-2: foo = 38
-3: bar[5] = (struct hack *) 0x3804
-@end example
-
-@noindent
-showing item numbers, expressions and their current values. As with
-displays you request manually using @code{x} or @code{print}, you can
-specify the output format you prefer; in fact, @code{display} decides
-whether to use @code{print} or @code{x} depending on how elaborate your
-format specification is---it uses @code{x} if you specify a unit size,
-or one of the two formats (@samp{i} and @samp{s}) that are only
-supported by @code{x}; otherwise it uses @code{print}.
-
-@table @code
-@item display @var{exp}
-@kindex display
-Add the expression @var{exp} to the list of expressions to display
-each time the program stops. @xref{Expressions}.
-
-@code{display} will not repeat if you press @key{RET} again after using it.
-
-@item display/@var{fmt} @var{exp}
-For @var{fmt} specifying only a display format and not a size or
-count, add the expression @var{exp} to the auto-display list but
-arranges to display it each time in the specified format @var{fmt}.
-@xref{Output formats}.
-
-@item display/@var{fmt} @var{addr}
-For @var{fmt} @samp{i} or @samp{s}, or including a unit-size or a
-number of units, add the expression @var{addr} as a memory address to
-be examined each time the program stops. Examining means in effect
-doing @samp{x/@var{fmt} @var{addr}}. @xref{Memory}.
-@end table
-
-For example, @samp{display/i $pc} can be helpful, to see the machine
-instruction about to be executed each time execution stops (@samp{$pc}
-is a common name for the program counter; @pxref{Registers}).
-
-@table @code
-@item undisplay @var{dnums}@dots{}
-@itemx delete display @var{dnums}@dots{}
-@kindex delete display
-@kindex undisplay
-Remove item numbers @var{dnums} from the list of expressions to display.
-
-@code{undisplay} will not repeat if you press @key{RET} after using it.
-(Otherwise you would just get the error @samp{No display number @dots{}}.)
-
-@item disable display @var{dnums}@dots{}
-@kindex disable display
-Disable the display of item numbers @var{dnums}. A disabled display
-item is not printed automatically, but is not forgotten. It may be
-enabled again later.
-
-@item enable display @var{dnums}@dots{}
-@kindex enable display
-Enable display of item numbers @var{dnums}. It becomes effective once
-again in auto display of its expression, until you specify otherwise.
-
-@item display
-Display the current values of the expressions on the list, just as is
-done when the program stops.
-
-@item info display
-@kindex info display
-Print the list of expressions previously set up to display
-automatically, each one with its item number, but without showing the
-values. This includes disabled expressions, which are marked as such.
-It also includes expressions which would not be displayed right now
-because they refer to automatic variables not currently available.
-@end table
-
-If a display expression refers to local variables, then it does not make
-sense outside the lexical context for which it was set up. Such an
-expression is disabled when execution enters a context where one of its
-variables is not defined. For example, if you give the command
-@code{display last_char} while inside a function with an argument
-@code{last_char}, then this argument will be displayed while the program
-continues to stop inside that function. When it stops elsewhere---where
-there is no variable @code{last_char}---display is disabled. The next time
-your program stops where @code{last_char} is meaningful, you can enable the
-display expression once again.
-
-@node Print Settings, Value History, Auto Display, Data
-@section Print Settings
-
-@cindex format options
-@cindex print settings
-_GDBN__ provides the following ways to control how arrays, structures,
-and symbols are printed.
-
-@noindent
-These settings are useful for debugging programs in any language:
-
-@table @code
-@item set print address
-@item set print address on
-@kindex set print address
-_GDBN__ will print memory addresses showing the location of stack
-traces, structure values, pointer values, breakpoints, and so forth,
-even when it also displays the contents of those addresses. The default
-is on. For example, this is what a stack frame display looks like, with
-@code{set print address on}:
-@smallexample
-(_GDBP__) f
-#0 set_quotes (lq=0x34c78 "<<", rq=0x34c88 ">>")
- at input.c:530
-530 if (lquote != def_lquote)
-@end smallexample
-
-@item set print address off
-Do not print addresses when displaying their contents. For example,
-this is the same stack frame displayed with @code{set print address off}:
-@example
-(_GDBP__) set print addr off
-(_GDBP__) f
-#0 set_quotes (lq="<<", rq=">>") at input.c:530
-530 if (lquote != def_lquote)
-@end example
-
-@item show print address
-@kindex show print address
-Show whether or not addresses are to be printed.
-
-@item set print array
-@itemx set print array on
-@kindex set print array
-_GDBN__ will pretty print arrays. This format is more convenient to read,
-but uses more space. The default is off.
-
-@item set print array off.
-Return to compressed format for arrays.
-
-@item show print array
-@kindex show print array
-Show whether compressed or pretty format is selected for displaying
-arrays.
-
-@item set print elements @var{number-of-elements}
-@kindex set print elements
-If _GDBN__ is printing a large array, it will stop printing after it has
-printed the number of elements set by the @code{set print elements} command.
-This limit also applies to the display of strings.
-
-@item show print elements
-@kindex show print elements
-Display the number of elements of a large array that _GDBN__ will print
-before losing patience.
-
-@item set print pretty on
-@kindex set print pretty
-Cause _GDBN__ to print structures in an indented format with one member per
-line, like this:
-
-@example
-$1 = @{
- next = 0x0,
- flags = @{
- sweet = 1,
- sour = 1
- @},
- meat = 0x54 "Pork"
-@}
-@end example
-
-@item set print pretty off
-Cause _GDBN__ to print structures in a compact format, like this:
-
-@smallexample
-$1 = @{next = 0x0, flags = @{sweet = 1, sour = 1@}, meat \
-= 0x54 "Pork"@}
-@end smallexample
-
-@noindent
-This is the default format.
-
-@item show print pretty
-@kindex show print pretty
-Show which format _GDBN__ will use to print structures.
-
-@item set print sevenbit-strings on
-@kindex set print sevenbit-strings
-Print using only seven-bit characters; if this option is set,
-_GDBN__ will display any eight-bit characters (in strings or character
-values) using the notation @code{\}@var{nnn}. For example, @kbd{M-a} is
-displayed as @code{\341}.
-
-@item set print sevenbit-strings off
-Print using either seven-bit or eight-bit characters, as required. This
-is the default.
-
-@item show print sevenbit-strings
-@kindex show print sevenbit-strings
-Show whether or not _GDBN__ will print only seven-bit characters.
-
-@item set print union on
-@kindex set print union
-Tell _GDBN__ to print unions which are contained in structures. This is the
-default setting.
-
-@item set print union off
-Tell _GDBN__ not to print unions which are contained in structures.
-
-@item show print union
-@kindex show print union
-Ask _GDBN__ whether or not it will print unions which are contained in
-structures.
-
-For example, given the declarations
-
-@smallexample
-typedef enum @{Tree, Bug@} Species;
-typedef enum @{Big_tree, Acorn, Seedling@} Tree_forms;
-typedef enum @{Caterpillar, Cocoon, Butterfly@}
- Bug_forms;
-
-struct thing @{
- Species it;
- union @{
- Tree_forms tree;
- Bug_forms bug;
- @} form;
-@};
-
-struct thing foo = @{Tree, @{Acorn@}@};
-@end smallexample
-
-@noindent
-with @code{set print union on} in effect @samp{p foo} would print
-
-@smallexample
-$1 = @{it = Tree, form = @{tree = Acorn, bug = Cocoon@}@}
-@end smallexample
-
-@noindent
-and with @code{set print union off} in effect it would print
-
-@smallexample
-$1 = @{it = Tree, form = @{...@}@}
-@end smallexample
-@end table
-
-@noindent
-These settings are of interest when debugging C++ programs:
-
-@table @code
-@item set print demangle
-@itemx set print demangle on
-@kindex set print demangle
-Print C++ names in their source form rather than in the mangled form
-in which they are passed to the assembler and linker for type-safe linkage.
-The default is on.
-
-@item show print demangle
-@kindex show print demangle
-Show whether C++ names will be printed in mangled or demangled form.
-
-@item set print asm-demangle
-@itemx set print asm-demangle on
-@kindex set print asm-demangle
-Print C++ names in their source form rather than their mangled form, even
-in assembler code printouts such as instruction disassemblies.
-The default is off.
-
-@item show print asm-demangle
-@kindex show print asm-demangle
-Show whether C++ names in assembly listings will be printed in mangled
-or demangled form.
-
-@item set print object
-@itemx set print object on
-@kindex set print object
-When displaying a pointer to an object, identify the @emph{actual}
-(derived) type of the object rather than the @emph{declared} type, using
-the virtual function table.
-
-@item set print object off
-Display only the declared type of objects, without reference to the
-virtual function table. This is the default setting.
-
-@item show print object
-@kindex show print object
-Show whether actual, or declared, object types will be displayed.
-
-@item set print vtbl
-@itemx set print vtbl on
-@kindex set print vtbl
-Pretty print C++ virtual function tables. The default is off.
-
-@item set print vtbl off
-Do not pretty print C++ virtual function tables.
-
-@item show print vtbl
-@kindex show print vtbl
-Show whether C++ virtual function tables are pretty printed, or not.
-
-@end table
-
-@node Value History, Convenience Vars, Print Settings, Data
-@section Value History
-
-@cindex value history
-Values printed by the @code{print} command are saved in _GDBN__'s @dfn{value
-history} so that you can refer to them in other expressions. Values are
-kept until the symbol table is re-read or discarded (for example with
-the @code{file} or @code{symbol-file} commands). When the symbol table
-changes, the value history is discarded, since the values may contain
-pointers back to the types defined in the symbol table.
-
-@cindex @code{$}
-@cindex @code{$$}
-@cindex history number
-The values printed are given @dfn{history numbers} for you to refer to them
-by. These are successive integers starting with one. @code{print} shows you
-the history number assigned to a value by printing @samp{$@var{num} = }
-before the value; here @var{num} is the history number.
-
-To refer to any previous value, use @samp{$} followed by the value's
-history number. The way @code{print} labels its output is designed to
-remind you of this. Just @code{$} refers to the most recent value in
-the history, and @code{$$} refers to the value before that.
-@code{$$@var{n}} refers to the @var{n}th value from the end; @code{$$2}
-is the value just prior to @code{$$}, @code{$$1} is equivalent to
-@code{$$}, and @code{$$0} is equivalent to @code{$}.
-
-For example, suppose you have just printed a pointer to a structure and
-want to see the contents of the structure. It suffices to type
-
-@example
-p *$
-@end example
-
-If you have a chain of structures where the component @code{next} points
-to the next one, you can print the contents of the next one with this:
-
-@example
-p *$.next
-@end example
-
-@noindent
-You can print successive links in the chain by repeating this
-command---which you can do by just typing @key{RET}.
-
-Note that the history records values, not expressions. If the value of
-@code{x} is 4 and you type these commands:
-
-@example
-print x
-set x=5
-@end example
-
-@noindent
-then the value recorded in the value history by the @code{print} command
-remains 4 even though the value of @code{x} has changed.
-
-@table @code
-@kindex show values
-@item show values
-Print the last ten values in the value history, with their item numbers.
-This is like @samp{p@ $$9} repeated ten times, except that @code{show
-values} does not change the history.
-
-@item show values @var{n}
-Print ten history values centered on history item number @var{n}.
-
-@item show values +
-Print ten history values just after the values last printed. If no more
-values are available, produces no display.
-@end table
-
-Pressing @key{RET} to repeat @code{show values @var{n}} has exactly the
-same effect as @samp{show values +}.
-
-@node Convenience Vars, Registers, Value History, Data
-@section Convenience Variables
-
-@cindex convenience variables
-_GDBN__ provides @dfn{convenience variables} that you can use within
-_GDBN__ to hold on to a value and refer to it later. These variables
-exist entirely within _GDBN__; they are not part of your program, and
-setting a convenience variable has no direct effect on further execution
-of your program. That's why you can use them freely.
-
-Convenience variables are prefixed with @samp{$}. Any name preceded by
-@samp{$} can be used for a convenience variable, unless it is one of
-the predefined machine-specific register names (@pxref{Registers}).
-(Value history references, in contrast, are @emph{numbers} preceded
-by @samp{$}. @xref{Value History}.)
-
-You can save a value in a convenience variable with an assignment
-expression, just as you would set a variable in your program. Example:
-
-@example
-set $foo = *object_ptr
-@end example
-
-@noindent
-would save in @code{$foo} the value contained in the object pointed to by
-@code{object_ptr}.
-
-Using a convenience variable for the first time creates it; but its value
-is @code{void} until you assign a new value. You can alter the value with
-another assignment at any time.
-
-Convenience variables have no fixed types. You can assign a convenience
-variable any type of value, including structures and arrays, even if
-that variable already has a value of a different type. The convenience
-variable, when used as an expression, has the type of its current value.
-
-@table @code
-@item show convenience
-@kindex show convenience
-Print a list of convenience variables used so far, and their values.
-Abbreviated @code{show con}.
-@end table
-
-One of the ways to use a convenience variable is as a counter to be
-incremented or a pointer to be advanced. For example, to print
-a field from successive elements of an array of structures:
-
-_0__@example
-set $i = 0
-print bar[$i++]->contents
-@i{@dots{} repeat that command by typing @key{RET}.}
-_1__@end example
-
-Some convenience variables are created automatically by _GDBN__ and given
-values likely to be useful.
-
-@table @code
-@item $_
-@kindex $_
-The variable @code{$_} is automatically set by the @code{x} command to
-the last address examined (@pxref{Memory}). Other commands which
-provide a default address for @code{x} to examine also set @code{$_}
-to that address; these commands include @code{info line} and @code{info
-breakpoint}. The type of @code{$_} is @code{void *} except when set by the
-@code{x} command, in which case it is a pointer to the type of @code{$__}.
-
-@item $__
-@kindex $__
-The variable @code{$__} is automatically set by the @code{x} command
-to the value found in the last address examined. Its type is chosen
-to match the format in which the data was printed.
-@end table
-
-@node Registers, Floating Point Hardware, Convenience Vars, Data
-@section Registers
-
-@cindex registers
-You can refer to machine register contents, in expressions, as variables
-with names starting with @samp{$}. The names of registers are different
-for each machine; use @code{info registers} to see the names used on
-your machine.
-
-@table @code
-@item info registers
-@kindex info registers
-Print the names and values of all registers except floating-point
-registers (in the selected stack frame).
-
-@item info all-registers
-@kindex info all-registers
-@cindex floating point registers
-Print the names and values of all registers, including floating-point
-registers.
-
-@item info registers @var{regname}
-Print the relativized value of register @var{regname}. @var{regname}
-may be any register name valid on the machine you are using, with
-or without the initial @samp{$}.
-@end table
-
-_GDBN__ has four ``standard'' register names that are available (in
-expressions) on most machines---whenever they don't conflict with an
-architecture's canonical mnemonics for registers. The register names
-@code{$pc} and @code{$sp} are used for the program counter register and
-the stack pointer. @code{$fp} is used for a register that contains a
-pointer to the current stack frame, and @code{$ps} is used for a
-register that contains the processor status. For example,
-you could print the program counter in hex with
-@example
-p/x $pc
-@end example
-
-@noindent
-or print the instruction to be executed next with
-@example
-x/i $pc
-@end example
-
-@noindent
-or add four to the stack pointer @footnote{This is a way of removing one
-word from the stack, on machines where stacks grow downward in memory
-(most machines, nowadays). This assumes that the innermost stack frame
-is selected; setting @code{$sp} is not allowed when other stack frames
-are selected. To pop entire frames off the stack, regardless of
-machine architecture, use @code{return}; @pxref{Returning}.} with
-@example
-set $sp += 4
-@end example
-
-Whenever possible, these four standard register names are available on
-your machine even though the machine has different canonical mnemonics,
-so long as there is no conflict. The @code{info registers} command
-shows the canonical names. For example, on the SPARC, @code{info
-registers} displays the processor status register as @code{$psr} but you
-can also refer to it as @code{$ps}.
-
-_GDBN__ always considers the contents of an ordinary register as an
-integer when the register is examined in this way. Some machines have
-special registers which can hold nothing but floating point; these
-registers are considered to have floating point values. There is no way
-to refer to the contents of an ordinary register as floating point value
-(although you can @emph{print} it as a floating point value with
-@samp{print/f $@var{regname}}).
-
-Some registers have distinct ``raw'' and ``virtual'' data formats. This
-means that the data format in which the register contents are saved by
-the operating system is not the same one that your program normally
-sees. For example, the registers of the 68881 floating point
-coprocessor are always saved in ``extended'' (raw) format, but all C
-programs expect to work with ``double'' (virtual) format. In such
-cases, _GDBN__ normally works with the virtual format only (the format that
-makes sense for your program), but the @code{info registers} command
-prints the data in both formats.
-
-Normally, register values are relative to the selected stack frame
-(@pxref{Selection}). This means that you get the value that the
-register would contain if all stack frames farther in were exited and
-their saved registers restored. In order to see the true contents of
-hardware registers, you must select the innermost frame (with
-@samp{frame 0}).
-
-However, _GDBN__ must deduce where registers are saved, from the machine
-code generated by your compiler. If some registers are not saved, or if
-_GDBN__ is unable to locate the saved registers, the selected stack
-frame will make no difference.
-
-@node Floating Point Hardware, , Registers, Data
-@section Floating Point Hardware
-@cindex floating point
-Depending on the host machine architecture, _GDBN__ may be able to give
-you more information about the status of the floating point hardware.
-
-@table @code
-@item info float
-@kindex info float
-If available, provides hardware-dependent information about the floating
-point unit. The exact contents and layout vary depending on the
-floating point chip.
-@end table
-@c FIXME: this is a cop-out. Try to get examples, explanations. Only
-@c FIXME...supported currently on arm's and 386's. Mark properly with
-@c FIXME... m4 macros to isolate general statements from hardware-dep,
-@c FIXME... at that point.
-
-@node Languages, Symbols, Data, Top
-@chapter Using _GDBN__ with Different Languages
-@cindex languages
-
-Although programming languages generally have common aspects, they are
-rarely expressed in the same manner. For instance, in ANSI C,
-dereferencing a pointer @code{p} is accomplished by @code{*p}, but in
-Modula-2, it is accomplished by @code{p^}. Values can also be
-represented (and displayed) differently. Hex numbers in C are written
-like @samp{0x1ae}, while in Modula-2 they appear as @samp{1AEH}.
-
-@cindex working language
-Language-specific information is built into _GDBN__ for some languages,
-allowing you to express operations like the above in the program's
-native language, and allowing _GDBN__ to output values in a manner
-consistent with the syntax of the program's native language. The
-language you use to build expressions, called the @dfn{working
-language}, can be selected manually, or _GDBN__ can set it
-automatically.
-
-@menu
-* Setting:: Switching between source languages
-* Show:: Displaying the language
-* Checks:: Type and Range checks
-* Support:: Supported languages
-@end menu
-
-@node Setting, Show, Languages, Languages
-@section Switching between source languages
-
-There are two ways to control the working language---either have _GDBN__
-set it automatically, or select it manually yourself. You can use the
-@code{set language} command for either purpose. On startup, _GDBN__
-defaults to setting the language automatically.
-
-@menu
-* Manually:: Setting the working language manually
-* Automatically:: Having _GDBN__ infer the source language
-@end menu
-
-@node Manually, Automatically, Setting, Setting
-@subsection Setting the working language
-
-@kindex set language
-To set the language, issue the command @samp{set language @var{lang}},
-where @var{lang} is the name of a language: @code{c} or @code{modula-2}.
-For a list of the supported languages, type @samp{set language}.
-
-Setting the language manually prevents _GDBN__ from updating the working
-language automatically. This can lead to confusion if you try
-to debug a program when the working language is not the same as the
-source language, when an expression is acceptable to both
-languages---but means different things. For instance, if the current
-source file were written in C, and _GDBN__ was parsing Modula-2, a
-command such as:
-
-@example
-print a = b + c
-@end example
-
-@noindent
-might not have the effect you intended. In C, this means to add
-@code{b} and @code{c} and place the result in @code{a}. The result
-printed would be the value of @code{a}. In Modula-2, this means to compare
-@code{a} to the result of @code{b+c}, yielding a @code{BOOLEAN} value.
-
-If you allow _GDBN__ to set the language automatically, then
-you can count on expressions evaluating the same way in your debugging
-session and in your program.
-
-@node Automatically, , Manually, Setting
-@subsection Having _GDBN__ infer the source language
-
-To have _GDBN__ set the working language automatically, use @samp{set
-language local} or @samp{set language auto}. _GDBN__ then infers the
-language that a program was written in by looking at the name of its
-source files, and examining their extensions:
-
-@table @file
-@item *.mod
-Modula-2 source file
-
-@item *.c
-@itemx *.cc
-C or C++ source file.
-@end table
-
-This information is recorded for each function or procedure in a source
-file. When your program stops in a frame (usually by encountering a
-breakpoint), _GDBN__ sets the working language to the language recorded
-for the function in that frame. If the language for a frame is unknown
-(that is, if the function or block corresponding to the frame was
-defined in a source file that does not have a recognized extension), the
-current working language is not changed, and _GDBN__ issues a warning.
-
-This may not seem necessary for most programs, which are written
-entirely in one source language. However, program modules and libraries
-written in one source language can be used by a main program written in
-a different source language. Using @samp{set language auto} in this
-case frees you from having to set the working language manually.
-
-@node Show, Checks, Setting, Languages
-@section Displaying the language
-
-The following commands will help you find out which language is the
-working language, and also what language source files were written in.
-
-@kindex show language
-@kindex info frame
-@kindex info source
-@table @code
-@item show language
-Display the current working language. This is the
-language you can use with commands such as @code{print} to
-build and compute expressions that may involve variables in the program.
-
-@item info frame
-Among the other information listed here (@pxref{Frame Info,,Information
-about a Frame}) is the source language for this frame. This is the
-language that will become the working language if you ever use an
-identifier that is in this frame.
-
-@item info source
-Among the other information listed here (@pxref{Symbols,,Examining the
-Symbol Table}) is the source language of this source file.
-
-@end table
-
-@node Checks, Support, Show, Languages
-@section Type and range Checking
-
-@quotation
-@emph{Warning:} In this release, the _GDBN__ commands for type and range
-checking are included, but they do not yet have any effect. This
-section documents the intended facilities.
-@end quotation
-@c FIXME remove warning when type/range code added
-
-Some languages are designed to guard you against making seemingly common
-errors through a series of compile- and run-time checks. These include
-checking the type of arguments to functions and operators, and making
-sure mathematical overflows are caught at run time. Checks such as
-these help to ensure a program's correctness once it has been compiled
-by eliminating type mismatches, and providing active checks for range
-errors when the program is running.
-
-_GDBN__ can check for conditions like the above if you wish.
-Although _GDBN__ will not check the statements in your program, it
-can check expressions entered directly into _GDBN__ for evaluation via
-the @code{print} command, for example. As with the working language,
-_GDBN__ can also decide whether or not to check automatically based on
-the source language of the program being debugged.
-@xref{Support,,Supported Languages}, for the default settings
-of supported languages.
-
-@menu
-* Type Checking:: An overview of type checking
-* Range Checking:: An overview of range checking
-@end menu
-
-@cindex type checking
-@cindex checks, type
-@node Type Checking, Range Checking, Checks, Checks
-@subsection An overview of type checking
-
-Some languages, such as Modula-2, are strongly typed, meaning that the
-arguments to operators and functions have to be of the correct type,
-otherwise an error occurs. These checks prevent type mismatch
-errors from ever causing any run-time problems. For example,
-
-@example
-1 + 2 @result{} 3
-@error{} 1 + 2.3
-@end example
-
-The second example fails because the @code{CARDINAL} 1 is not
-type-compatible with the @code{REAL} 2.3.
-
-For expressions you use in _GDBN__ commands, you can tell the _GDBN__
-type checker to skip checking; to treat any mismatches as errors and
-abandon the expression; or only issue warnings when type mismatches
-occur, but evaluate the expression anyway. When you choose the last of
-these, _GDBN__ evaluates expressions like the second example above, but
-also issues a warning.
-
-Even though you may turn type checking off, other type-based reasons may
-prevent _GDBN__ from evaluating an expression. For instance, _GDBN__ does not
-know how to add an @code{int} and a @code{struct foo}. These particular
-type errors have nothing to do with the language in use, and usually
-arise from expressions, such as the one described above, which make
-little sense to evaluate anyway.
-
-Each language defines to what degree it is strict about type. For
-instance, both Modula-2 and C require the arguments to arithmetical
-operators to be numbers. In C, enumerated types and pointers can be
-represented as numbers, so that they are valid arguments to mathematical
-operators. @xref{Support,,Supported Languages}, for futher
-details on specific languages.
-
-_GDBN__ provides some additional commands for controlling the type checker:
-
-@kindex set check
-@kindex set check type
-@kindex show check type
-@table @code
-@item set check type auto
-Set type checking on or off based on the current working language.
-@xref{Support,,Supported Languages}, for the default settings for
-each language.
-
-@item set check type on
-@itemx set check type off
-Set type checking on or off, overriding the default setting for the
-current working language. Issue a warning if the setting does not
-match the language's default. If any type mismatches occur in
-evaluating an expression while typechecking is on, _GDBN__ prints a
-message and aborts evaluation of the expression.
-
-@item set check type warn
-Cause the type checker to issue warnings, but to always attempt to
-evaluate the expression. Evaluating the expression may still
-be impossible for other reasons. For example, _GDBN__ cannot add
-numbers and structures.
-
-@item show type
-Show the current setting of the type checker, and whether or not _GDBN__ is
-setting it automatically.
-@end table
-
-@cindex range checking
-@cindex checks, range
-@node Range Checking, , Type Checking, Checks
-@subsection An overview of Range Checking
-
-In some languages (such as Modula-2), it is an error to exceed the
-bounds of a type; this is enforced with run-time checks. Such range
-checking is meant to ensure program correctness by making sure
-computations do not overflow, or indices on an array element access do
-not exceed the bounds of the array.
-
-For expressions you use in _GDBN__ commands, you can tell _GDBN__ to
-ignore range errors; to always treat them as errors and abandon the
-expression; or to issue warnings when a range error occurs but evaluate
-the expression anyway.
-
-A range error can result from numerical overflow, from exceeding an
-array index bound, or when you type in a constant that is not a member
-of any type. Some languages, however, do not treat overflows as an
-error. In many implementations of C, mathematical overflow causes the
-result to ``wrap around'' to lower values---for example, if @var{m} is
-the largest integer value, and @var{s} is the smallest, then
-@example
-@var{m} + 1 @result{} @var{s}
-@end example
-
-This, too, is specific to individual languages, and in some cases
-specific to individual compilers or machines. @xref{Support,,
-Supported Languages}, for further details on specific languages.
-
-_GDBN__ provides some additional commands for controlling the range checker:
-
-@kindex set check
-@kindex set check range
-@kindex show check range
-@table @code
-@item set check range auto
-Set range checking on or off based on the current working language.
-@xref{Support,,Supported Languages}, for the default settings for
-each language.
-
-@item set check range on
-@itemx set check range off
-Set range checking on or off, overriding the default setting for the
-current working language. A warning is issued if the setting does not
-match the language's default. If a range error occurs, then a message
-is printed and evaluation of the expression is aborted.
-
-@item set check range warn
-Output messages when the _GDBN__ range checker detects a range error,
-but attempt to evaluate the expression anyway. Evaluating the
-expression may still be impossible for other reasons, such as accessing
-memory that the process does not own (a typical example from many UNIX
-systems).
-
-@item show range
-Show the current setting of the range checker, and whether or not it is
-being set automatically by _GDBN__.
-@end table
-
-@node Support, , Checks, Languages
-@section Supported Languages
-
-_GDBN__ _GDB_VN__ supports C, C++, and Modula-2. The syntax for C and C++ is
-so closely related that _GDBN__ does not distinguish the two. Some
-_GDBN__ features may be used in expressions regardless of the language
-you use: the _GDBN__ @code{@@} and @code{::} operators, and the
-@samp{@{type@}addr} construct (@pxref{Expressions}) can be used with the constructs of
-any of the supported languages.
-
-The following sections detail to what degree each of these
-source languages is supported by _GDBN__. These sections are
-not meant to be language tutorials or references, but serve only as a
-reference guide to what the _GDBN__ expression parser will accept, and
-what input and output formats should look like for different languages.
-There are many good books written on each of these languages; please
-look to these for a language reference or tutorial.
-
-@menu
-* C:: C and C++
-* Modula-2:: Modula-2
-@end menu
-
-@node C, Modula-2, Support, Support
-@subsection C and C++
-@cindex C and C++
-
-@cindex expressions in C or C++
-Since C and C++ are so closely related, _GDBN__ does not distinguish
-between them when interpreting the expressions recognized in _GDBN__
-commands.
-
-@cindex C++
-@kindex g++
-@cindex GNU C++
-The C++ debugging facilities are jointly implemented by the GNU C++
-compiler and _GDBN__. Therefore, to debug your C++ code effectively,
-you must compile your C++ programs with the GNU C++ compiler,
-@code{g++}.
-
-
-@menu
-* C Operators:: C and C++ Operators
-* C Constants:: C and C++ Constants
-* Cplusplus expressions:: C++ Expressions
-* C Defaults:: Default settings for C and C++
-* C Checks:: C and C++ Type and Range Checks
-* Debugging C:: _GDBN__ and C
-* Debugging C plus plus:: Special features for C++
-@end menu
-
-@cindex C and C++ operators
-@node C Operators, C Constants, C, C
-@subsubsection C and C++ Operators
-
-Operators must be defined on values of specific types. For instance,
-@code{+} is defined on numbers, but not on structures. Operators are
-often defined on groups of types. For the purposes of C and C++, the
-following definitions hold:
-
-@itemize @bullet
-@item
-@emph{Integral types} include @code{int} with any of its storage-class
-specifiers, @code{char}, and @code{enum}s.
-
-@item
-@emph{Floating-point types} include @code{float} and @code{double}.
-
-@item
-@emph{Pointer types} include all types defined as @code{(@var{type}
-*)}.
-
-@item
-@emph{Scalar types} include all of the above.
-
-@end itemize
-
-@noindent
-The following operators are supported. They are listed here
-in order of increasing precedence:
-
-@table @code
-_0__
-@item ,
-The comma or sequencing operator. Expressions in a comma-separated list
-are evaluated from left to right, with the result of the entire
-expression being the last expression evaluated.
-
-@item =
-Assignment. The value of an assignment expression is the value
-assigned. Defined on scalar types.
-
-@item @var{op}=
-Used in an expression of the form @var{a} @var{op}@code{=} @var{b}, and
-translated to @var{a} @code{=} @var{a op b}. @var{op}@code{=} and
-@code{=} have the same precendence. @var{op} is any one of the
-operators @code{|}, @code{^}, @code{&}, @code{<<}, @code{>>}, @code{+},
-@code{-}, @code{*}, @code{/}, @code{%}.
-
-@item ?:
-The ternary operator. @code{@var{a} ? @var{b} : @var{c}} can be thought
-of as: if @var{a} then @var{b} else @var{c}. @var{a} should be of an
-integral type.
-
-@item ||
-Logical OR. Defined on integral types.
-
-@item &&
-Logical AND. Defined on integral types.
-
-@item |
-Bitwise OR. Defined on integral types.
-
-@item ^
-Bitwise exclusive-OR. Defined on integral types.
-
-@item &
-Bitwise AND. Defined on integral types.
-
-@item ==@r{, }!=
-Equality and inequality. Defined on scalar types. The value of these
-expressions is 0 for false and non-zero for true.
-
-@item <@r{, }>@r{, }<=@r{, }>=
-Less than, greater than, less than or equal, greater than or equal.
-Defined on scalar types. The value of these expressions is 0 for false
-and non-zero for true.
-
-@item <<@r{, }>>
-left shift, and right shift. Defined on integral types.
-
-@item @@
-The _GDBN__ ``artificial array'' operator (@pxref{Expressions}).
-
-@item +@r{, }-
-Addition and subtraction. Defined on integral types, floating-point types and
-pointer types.
-
-@item *@r{, }/@r{, }%
-Multiplication, division, and modulus. Multiplication and division are
-defined on integral and floating-point types. Modulus is defined on
-integral types.
-
-@item ++@r{, }--
-Increment and decrement. When appearing before a variable, the
-operation is performed before the variable is used in an expression;
-when appearing after it, the variable's value is used before the
-operation takes place.
-
-@item *
-Pointer dereferencing. Defined on pointer types. Same precedence as
-@code{++}.
-
-@item &
-Address operator. Defined on variables. Same precedence as @code{++}.
-
-@item -
-Negative. Defined on integral and floating-point types. Same
-precedence as @code{++}.
-
-@item !
-Logical negation. Defined on integral types. Same precedence as
-@code{++}.
-
-@item ~
-Bitwise complement operator. Defined on integral types. Same precedence as
-@code{++}.
-
-@item .@r{, }->
-Structure member, and pointer-to-structure member. For convenience,
-_GDBN__ regards the two as equivalent, choosing whether to dereference a
-pointer based on the stored type information.
-Defined on @code{struct}s and @code{union}s.
-
-@item []
-Array indexing. @code{@var{a}[@var{i}]} is defined as
-@code{*(@var{a}+@var{i})}. Same precedence as @code{->}.
-
-@item ()
-Function parameter list. Same precedence as @code{->}.
-
-@item ::
-C++ scope resolution operator. Defined on
-@code{struct}, @code{union}, and @code{class} types.
-
-@item ::
-The _GDBN__ scope operator (@pxref{Expressions}). Same precedence as
-@code{::}, above. _1__
-@end table
-
-@cindex C and C++ constants
-@node C Constants, Cplusplus expressions, C Operators, C
-@subsubsection C and C++ Constants
-
-_GDBN__ allows you to express the constants of C and C++ in the
-following ways:
-
-@itemize @bullet
-
-@item
-Integer constants are a sequence of digits. Octal constants are
-specified by a leading @samp{0} (ie. zero), and hexadecimal constants by
-a leading @samp{0x} or @samp{0X}. Constants may also end with an
-@samp{l}, specifying that the constant should be treated as a
-@code{long} value.
-
-@item
-Floating point constants are a sequence of digits, followed by a decimal
-point, followed by a sequence of digits, and optionally followed by an
-exponent. An exponent is of the form:
-@samp{@w{e@r{[[}+@r{]|}-@r{]}@var{nnn}}}, where @var{nnn} is another
-sequence of digits. The @samp{+} is optional for positive exponents.
-
-@item
-Enumerated constants consist of enumerated identifiers, or their
-integral equivalents.
-
-@item
-Character constants are a single character surrounded by single quotes
-(@code{'}), or a number---the ordinal value of the corresponding character
-(usually its @sc{ASCII} value). Within quotes, the single character may
-be represented by a letter or by @dfn{escape sequences}, which are of
-the form @samp{\@var{nnn}}, where @var{nnn} is the octal representation
-of the character's ordinal value; or of the form @samp{\@var{x}}, where
-@samp{@var{x}} is a predefined special character---for example,
-@samp{\n} for newline.
-
-@item
-String constants are a sequence of character constants surrounded
-by double quotes (@code{"}).
-
-@item
-Pointer constants are an integral value.
-
-@end itemize
-
-
-@node Cplusplus expressions, C Defaults, C Constants, C
-@subsubsection C++ Expressions
-
-@cindex expressions in C++
-_GDBN__'s expression handling has the following extensions to
-interpret a significant subset of C++ expressions:
-
-@enumerate
-
-@cindex member functions
-@item
-Member function calls are allowed; you can use expressions like
-@example
-count = aml->GetOriginal(x, y)
-@end example
-
-@kindex this
-@cindex namespace in C++
-@item
-While a member function is active (in the selected stack frame), your
-expressions have the same namespace available as the member function;
-that is, _GDBN__ allows implicit references to the class instance
-pointer @code{this} following the same rules as C++.
-
-@cindex call overloaded functions
-@cindex type conversions in C++
-@item
-You can call overloaded functions; _GDBN__ will resolve the function
-call to the right definition, with one restriction---you must use
-arguments of the type required by the function that you want to call.
-_GDBN__ will not perform conversions requiring constructors or
-user-defined type operators.
-
-@cindex reference declarations
-@item
-_GDBN__ understands variables declared as C++ references; you can use them in
-expressions just as you do in C++ source---they are automatically
-dereferenced.
-
-In the parameter list shown when _GDBN__ displays a frame, the values of
-reference variables are not displayed (unlike other variables); this
-avoids clutter, since references are often used for large structures.
-The @emph{address} of a reference variable is always shown, unless
-you've specified @samp{set print address off}.
-
-
-@item
-_GDBN__ supports the C++ name resolution operator @code{::}---your
-expressions can use it just as expressions in your program do. Since
-one scope may be defined in another, you can use @code{::} repeatedly if
-necessary, for example in an expression like
-@samp{@var{scope1}::@var{scope2}::@var{name}}. _GDBN__ also allows
-resolving name scope by reference to source files, in both C and C++
-debugging; @pxref{Variables}.
-
-@end enumerate
-
-
-@node C Defaults, C Checks, Cplusplus expressions, C
-@subsubsection C and C++ Defaults
-@cindex C and C++ defaults
-
-If you allow _GDBN__ to set type and range checking automatically, they
-both default to @code{off} whenever the working language changes to
-C/C++. This happens regardless of whether you, or _GDBN__,
-selected the working language.
-
-If you allow _GDBN__ to set the language automatically, it sets the
-working language to C/C++ on entering code compiled from a source file
-whose name ends with @file{.c} or @file{.cc}.
-@xref{Automatically,,Having _GDBN__ infer the source language}, for
-further details.
-
-@node C Checks, Debugging C, C Defaults, C
-@subsubsection C and C++ Type and Range Checks
-@cindex C and C++ checks
-
-@quotation
-@emph{Warning:} in this release, _GDBN__ does not yet perform type or
-range checking.
-@end quotation
-@c FIXME remove warning when type/range checks added
-
-By default, when _GDBN__ parses C or C++ expressions, type checking
-is not used. However, if you turn type checking on, _GDBN__ will
-consider two variables type equivalent if:
-
-@itemize @bullet
-@item
-The two variables are structured and have the same structure, union, or
-enumerated tag.
-
-@item
-Two two variables have the same type name, or types that have been
-declared equivalent through @code{typedef}.
-
-@ignore
-@c leaving this out because neither J Gilmore nor R Pesch understand it.
-@c FIXME--beers?
-@item
-The two @code{struct}, @code{union}, or @code{enum} variables are
-declared in the same declaration. (Note: this may not be true for all C
-compilers.)
-@end ignore
-
-@end itemize
-
-Range checking, if turned on, is done on mathematical operations. Array
-indices are not checked, since they are often used to index a pointer
-that is not itself an array.
-
-@node Debugging C, Debugging C plus plus, C Checks, C
-@subsubsection _GDBN__ and C
-
-The @code{set print union} and @code{show print union} commands apply to
-the @code{union} type. When set to @samp{on}, any @code{union} that is
-inside a @code{struct} or @code{class} will also be printed.
-Otherwise, it will appear as @samp{@{...@}}.
-
-The @code{@@} operator aids in the debugging of dynamic arrays, formed
-with pointers and a memory allocation function. (@pxref{Expressions})
-
-@node Debugging C plus plus, , Debugging C, C
-@subsubsection _GDBN__ Commands for C++
-
-@cindex commands for C++
-Some _GDBN__ commands are particularly useful with C++, and some are
-designed specifically for use with C++. Here is a summary:
-
-@table @code
-@cindex break in overloaded functions
-@item @r{breakpoint menus}
-When you want a breakpoint in a function whose name is overloaded,
-_GDBN__'s breakpoint menus help you specify which function definition
-you want. @xref{Breakpoint Menus}.
-
-@cindex overloading in C++
-@item rbreak @var{regex}
-Setting breakpoints using regular expressions is helpful for setting
-breakpoints on overloaded functions that are not members of any special
-classes.
-@xref{Set Breaks}.
-
-@cindex C++ exception handling
-@item catch @var{exceptions}
-@itemx info catch
-Debug C++ exception handling using these commands. @xref{Exception Handling}.
-
-@cindex inheritance
-@item ptype @var{typename}
-Print inheritance relationships as well as other information for type
-@var{typename}.
-@xref{Symbols}.
-
-@cindex C++ symbol display
-@item set print demangle
-@itemx show print demangle
-@itemx set print asm-demangle
-@itemx show print asm-demangle
-Control whether C++ symbols display in their source form, both when
-displaying code as C++ source and when displaying disassemblies.
-@xref{Print Settings}.
-
-@item set print object
-@itemx show print object
-Choose whether to print derived (actual) or declared types of objects.
-@xref{Print Settings}.
-
-@item set print vtbl
-@itemx show print vtbl
-Control the format for printing virtual function tables.
-@xref{Print Settings}.
-
-@end table
-
-
-@node Modula-2, , C, Support
-@subsection Modula-2
-@cindex Modula-2
-
-The extensions made to _GDBN__ to support Modula-2 support output
-from the GNU Modula-2 compiler (which is currently being developed).
-Other Modula-2 compilers are not currently supported, and attempting to
-debug executables produced by them will most likely result in an error
-as _GDBN__ reads in the executable's symbol table.
-
-@cindex expressions in Modula-2
-@menu
-* M2 Operators:: Built-in operators
-* Builtin Func/Proc:: Built-in Functions and Procedures
-* M2 Constants:: Modula-2 Constants
-* M2 Defaults:: Default settings for Modula-2
-* Deviations:: Deviations from standard Modula-2
-* M2 Checks:: Modula-2 Type and Range Checks
-* M2 Scope:: The scope operators @code{::} and @code{.}
-* GDB/M2:: _GDBN__ and Modula-2
-@end menu
-
-@node M2 Operators, Builtin Func/Proc, Modula-2, Modula-2
-@subsubsection Operators
-@cindex Modula-2 operators
-
-Operators must be defined on values of specific types. For instance,
-@code{+} is defined on numbers, but not on structures. Operators are
-often defined on groups of types. For the purposes of Modula-2, the
-following definitions hold:
-
-@itemize @bullet
-
-@item
-@emph{Integral types} consist of @code{INTEGER}, @code{CARDINAL}, and
-their subranges.
-
-@item
-@emph{Character types} consist of @code{CHAR} and its subranges.
-
-@item
-@emph{Floating-point types} consist of @code{REAL}.
-
-@item
-@emph{Pointer types} consist of anything declared as @code{POINTER TO
-@var{type}}.
-
-@item
-@emph{Scalar types} consist of all of the above.
-
-@item
-@emph{Set types} consist of @code{SET}s and @code{BITSET}s.
-
-@item
-@emph{Boolean types} consist of @code{BOOLEAN}.
-
-@end itemize
-
-@noindent
-The following operators are supported, and appear in order of
-increasing precedence:
-
-@table @code
-_0__
-@item ,
-Function argument or array index separator.
-
-@item :=
-Assignment. The value of @var{var} @code{:=} @var{value} is
-@var{value}.
-
-@item <@r{, }>
-Less than, greater than on integral, floating-point, or enumerated
-types.
-
-@item <=@r{, }>=
-Less than, greater than, less than or equal to, greater than or equal to
-on integral, floating-point and enumerated types, or set inclusion on
-set types. Same precedence as @code{<}.
-
-@item =@r{, }<>@r{, }#
-Equality and two ways of expressing inequality, valid on scalar types.
-Same precedence as @code{<}. In _GDBN__ scripts, only @code{<>} is
-available for inequality, since @code{#} conflicts with the script
-comment character.
-
-@item IN
-Set membership. Defined on set types and the types of their members.
-Same precedence as @code{<}.
-
-@item OR
-Boolean disjunction. Defined on boolean types.
-
-@item AND@r{, }&
-Boolean conjuction. Defined on boolean types.
-
-@item @@
-The _GDBN__ ``artificial array'' operator (@pxref{Expressions}).
-
-@item +@r{, }-
-Addition and subtraction on integral and floating-point types, or union
-and difference on set types.
-
-@item *
-Multiplication on integral and floating-point types, or set intersection
-on set types.
-
-@item /
-Division on floating-point types, or symmetric set difference on set
-types. Same precedence as @code{*}.
-
-@item DIV@r{, }MOD
-Integer division and remainder. Defined on integral types. Same
-precedence as @code{*}.
-
-@item -
-Negative. Defined on @code{INTEGER}s and @code{REAL}s.
-
-@item ^
-Pointer dereferencing. Defined on pointer types.
-
-@item NOT
-Boolean negation. Defined on boolean types. Same precedence as
-@code{^}.
-
-@item .
-@code{RECORD} field selector. Defined on @code{RECORD}s. Same
-precedence as @code{^}.
-
-@item []
-Array indexing. Defined on @code{ARRAY}s. Same precedence as @code{^}.
-
-@item ()
-Procedure argument list. Defined on @code{PROCEDURE}s. Same precedence
-as @code{^}.
-
-@item ::@r{, }.
-_GDBN__ and Modula-2 scope operators.
-
-@end table
-
-@quotation
-@emph{Warning:} Sets and their operations are not yet supported, so _GDBN__
-will treat the use of the operator @code{IN}, or the use of operators
-@code{+}, @code{-}, @code{*}, @code{/}, @code{=}, , @code{<>}, @code{#},
-@code{<=}, and @code{>=} on sets as an error.
-@end quotation
-_1__
-
-@cindex Modula-2 builtins
-@node Builtin Func/Proc, M2 Constants, M2 Operators, Modula-2
-@subsubsection Built-in Functions and Procedures
-
-Modula-2 also makes available several built-in procedures and functions.
-In describing these, the following metavariables are used:
-
-@table @var
-
-@item a
-represents an @code{ARRAY} variable.
-
-@item c
-represents a @code{CHAR} constant or variable.
-
-@item i
-represents a variable or constant of integral type.
-
-@item m
-represents an identifier that belongs to a set. Generally used in the
-same function with the metavariable @var{s}. The type of @var{s} should
-be @code{SET OF @var{mtype}} (where @var{mtype} is the type of @var{m}.
-
-@item n
-represents a variable or constant of integral or floating-point type.
-
-@item r
-represents a variable or constant of floating-point type.
-
-@item t
-represents a type.
-
-@item v
-represents a variable.
-
-@item x
-represents a variable or constant of one of many types. See the
-explanation of the function for details.
-
-@end table
-
-All Modula-2 built-in procedures also return a result, described below.
-
-@table @code
-@item ABS(@var{n})
-Returns the absolute value of @var{n}.
-
-@item CAP(@var{c})
-If @var{c} is a lower case letter, it returns its upper case
-equivalent, otherwise it returns its argument
-
-@item CHR(@var{i})
-Returns the character whose ordinal value is @var{i}.
-
-@item DEC(@var{v})
-Decrements the value in the variable @var{v}. Returns the new value.
-
-@item DEC(@var{v},@var{i})
-Decrements the value in the variable @var{v} by @var{i}. Returns the
-new value.
-
-@item EXCL(@var{m},@var{s})
-Removes the element @var{m} from the set @var{s}. Returns the new
-set.
-
-@item FLOAT(@var{i})
-Returns the floating point equivalent of the integer @var{i}.
-
-@item HIGH(@var{a})
-Returns the index of the last member of @var{a}.
-
-@item INC(@var{v})
-Increments the value in the variable @var{v}. Returns the new value.
-
-@item INC(@var{v},@var{i})
-Increments the value in the variable @var{v} by @var{i}. Returns the
-new value.
-
-@item INCL(@var{m},@var{s})
-Adds the element @var{m} to the set @var{s} if it is not already
-there. Returns the new set.
-
-@item MAX(@var{t})
-Returns the maximum value of the type @var{t}.
-
-@item MIN(@var{t})
-Returns the minimum value of the type @var{t}.
-
-@item ODD(@var{i})
-Returns boolean TRUE if @var{i} is an odd number.
-
-@item ORD(@var{x})
-Returns the ordinal value of its argument. For example, the ordinal
-value of a character is its ASCII value (on machines supporting the
-ASCII character set). @var{x} must be of an ordered type, which include
-integral, character and enumerated types.
-
-@item SIZE(@var{x})
-Returns the size of its argument. @var{x} can be a variable or a type.
-
-@item TRUNC(@var{r})
-Returns the integral part of @var{r}.
-
-@item VAL(@var{t},@var{i})
-Returns the member of the type @var{t} whose ordinal value is @var{i}.
-@end table
-
-@quotation
-@emph{Warning:} Sets and their operations are not yet supported, so
-_GDBN__ will treat the use of procedures @code{INCL} and @code{EXCL} as
-an error.
-@end quotation
-
-@cindex Modula-2 constants
-@node M2 Constants, M2 Defaults, Builtin Func/Proc, Modula-2
-@subsubsection Constants
-
-_GDBN__ allows you to express the constants of Modula-2 in the following
-ways:
-
-@itemize @bullet
-
-@item
-Integer constants are simply a sequence of digits. When used in an
-expression, a constant is interpreted to be type-compatible with the
-rest of the expression. Hexadecimal integers are specified by a
-trailing @samp{H}, and octal integers by a trailing @samp{B}.
-
-@item
-Floating point constants appear as a sequence of digits, followed by a
-decimal point and another sequence of digits. An optional exponent can
-then be specified, in the form @samp{E@r{[}+@r{|}-@r{]}@var{nnn}}, where
-@samp{@r{[}+@r{|}-@r{]}@var{nnn}} is the desired exponent. All of the
-digits of the floating point constant must be valid decimal (base 10)
-digits.
-
-@item
-Character constants consist of a single character enclosed by a pair of
-like quotes, either single (@code{'}) or double (@code{"}). They may
-also be expressed by their ordinal value (their ASCII value, usually)
-followed by a @samp{C}.
-
-@item
-String constants consist of a sequence of characters enclosed by a pair
-of like quotes, either single (@code{'}) or double (@code{"}). Escape
-sequences in the style of C are also allowed. @xref{C Constants}, for a
-brief explanation of escape sequences.
-
-@item
-Enumerated constants consist of an enumerated identifier.
-
-@item
-Boolean constants consist of the identifiers @code{TRUE} and
-@code{FALSE}.
-
-@item
-Pointer constants consist of integral values only.
-
-@item
-Set constants are not yet supported.
-
-@end itemize
-
-@node M2 Defaults, Deviations, M2 Constants, Modula-2
-@subsubsection Modula-2 Defaults
-@cindex Modula-2 defaults
-
-If type and range checking are set automatically by _GDBN__, they
-both default to @code{on} whenever the working language changes to
-Modula-2. This happens regardless of whether you, or _GDBN__,
-selected the working language.
-
-If you allow _GDBN__ to set the language automatically, then entering
-code compiled from a file whose name ends with @file{.mod} will set the
-working language to Modula-2. @xref{Automatically,,Having _GDBN__ set
-the language automatically}, for further details.
-
-@node Deviations, M2 Checks, M2 Defaults, Modula-2
-@subsubsection Deviations from Standard Modula-2
-@cindex Modula-2, deviations from
-
-A few changes have been made to make Modula-2 programs easier to debug.
-This is done primarily via loosening its type strictness:
-
-@itemize @bullet
-@item
-Unlike in standard Modula-2, pointer constants can be formed by
-integers. This allows you to modify pointer variables during
-debugging. (In standard Modula-2, the actual address contained in a
-pointer variable is hidden from you; it can only be modified
-through direct assignment to another pointer variable or expression that
-returned a pointer.)
-
-@item
-C escape sequences can be used in strings and characters to represent
-non-printable characters. _GDBN__ will print out strings with these
-escape sequences embedded. Single non-printable characters are
-printed using the @samp{CHR(@var{nnn})} format.
-
-@item
-The assignment operator (@code{:=}) returns the value of its right-hand
-argument.
-
-@item
-All builtin procedures both modify @emph{and} return their argument.
-
-@end itemize
-
-@node M2 Checks, M2 Scope, Deviations, Modula-2
-@subsubsection Modula-2 Type and Range Checks
-@cindex Modula-2 checks
-
-@quotation
-@emph{Warning:} in this release, _GDBN__ does not yet perform type or
-range checking.
-@end quotation
-@c FIXME remove warning when type/range checks added
-
-_GDBN__ considers two Modula-2 variables type equivalent if:
-
-@itemize @bullet
-@item
-They are of types that have been declared equivalent via a @code{TYPE
-@var{t1} = @var{t2}} statement
-
-@item
-They have been declared on the same line. (Note: This is true of the
-GNU Modula-2 compiler, but it may not be true of other compilers.)
-
-@end itemize
-
-As long as type checking is enabled, any attempt to combine variables
-whose types are not equivalent is an error.
-
-Range checking is done on all mathematical operations, assignment, array
-index bounds, and all builtin functions and procedures.
-
-@node M2 Scope, GDB/M2, M2 Checks, Modula-2
-@subsubsection The scope operators @code{::} and @code{.}
-@cindex scope
-@kindex .
-@kindex ::
-
-There are a few subtle differences between the Modula-2 scope operator
-(@code{.}) and the _GDBN__ scope operator (@code{::}). The two have
-similar syntax:
-
-@example
-
-@var{module} . @var{id}
-@var{scope} :: @var{id}
-
-@end example
-
-@noindent
-where @var{scope} is the name of a module or a procedure,
-@var{module} the name of a module, and @var{id} is any delcared
-identifier within the program, except another module.
-
-Using the @code{::} operator makes _GDBN__ search the scope
-specified by @var{scope} for the identifier @var{id}. If it is not
-found in the specified scope, then _GDBN__ will search all scopes
-enclosing the one specified by @var{scope}.
-
-Using the @code{.} operator makes _GDBN__ search the current scope for
-the identifier specified by @var{id} that was imported from the
-definition module specified by @var{module}. With this operator, it is
-an error if the identifier @var{id} was not imported from definition
-module @var{module}, or if @var{id} is not an identifier in
-@var{module}.
-
-@node GDB/M2, , M2 Scope, Modula-2
-@subsubsection _GDBN__ and Modula-2
-
-Some _GDBN__ commands have little use when debugging Modula-2 programs.
-Five subcommands of @code{set print} and @code{show print} apply
-specifically to C and C++: @samp{vtbl}, @samp{demangle},
-@samp{asm-demangle}, @samp{object}, and @samp{union}. The first four
-apply to C++, and the last to C's @code{union} type, which has no direct
-analogue in Modula-2.
-
-The @code{@@} operator (@pxref{Expressions}), while available
-while using any language, is not useful with Modula-2. Its
-intent is to aid the debugging of @dfn{dynamic arrays}, which cannot be
-created in Modula-2 as they can in C or C++. However, because an
-address can be specified by an integral constant, the construct
-@samp{@{@var{type}@}@var{adrexp}} is still useful. (@pxref{Expressions})
-
-_0__
-@cindex @code{#} in Modula-2
-In _GDBN__ scripts, the Modula-2 inequality operator @code{#} is
-interpreted as the beginning of a comment. Use @code{<>} instead.
-_1__
-
-
-@node Symbols, Altering, Languages, Top
-@chapter Examining the Symbol Table
-
-The commands described in this section allow you to inquire about the
-symbols (names of variables, functions and types) defined in your
-program. This information is inherent in the text of your program and
-does not change as the program executes. _GDBN__ finds it in your
-program's symbol table, in the file indicated when you started _GDBN__
-(@pxref{File Options}), or by one of the file-management commands
-(@pxref{Files}).
-
-@table @code
-@item info address @var{symbol}
-@kindex info address
-Describe where the data for @var{symbol} is stored. For a register
-variable, this says which register it is kept in. For a non-register
-local variable, this prints the stack-frame offset at which the variable
-is always stored.
-
-Note the contrast with @samp{print &@var{symbol}}, which does not work
-at all for a register variables, and for a stack local variable prints
-the exact address of the current instantiation of the variable.
-
-@item whatis @var{exp}
-@kindex whatis
-Print the data type of expression @var{exp}. @var{exp} is not
-actually evaluated, and any side-effecting operations (such as
-assignments or function calls) inside it do not take place.
-@xref{Expressions}.
-
-@item whatis
-Print the data type of @code{$}, the last value in the value history.
-
-@item ptype @var{typename}
-@kindex ptype
-Print a description of data type @var{typename}. @var{typename} may be
-the name of a type, or for C code it may have the form
-@samp{struct @var{struct-tag}}, @samp{union @var{union-tag}} or
-@samp{enum @var{enum-tag}}.@refill
-
-@item ptype @var{exp}
-@itemx ptype
-Print a description of the type of expression @var{exp}. @code{ptype}
-differs from @code{whatis} by printing a detailed description, instead of just
-the name of the type. For example, if your program declares a variable
-as
-@example
-struct complex @{double real; double imag;@} v;
-@end example
-@noindent
-compare the output of the two commands:
-@example
-(_GDBP__) whatis v
-type = struct complex
-(_GDBP__) ptype v
-type = struct complex @{
- double real;
- double imag;
-@}
-@end example
-@noindent
-As with @code{whatis}, using @code{ptype} without an argument refers to
-the type of @code{$}, the last value in the value history.
-
-@item info types @var{regexp}
-@itemx info types
-@kindex info types
-Print a brief description of all types whose name matches @var{regexp}
-(or all types in your program, if you supply no argument). Each
-complete typename is matched as though it were a complete line; thus,
-@samp{i type value} gives information on all types in your program whose
-name includes the string @code{value}, but @samp{i type ^value$} gives
-information only on types whose complete name is @code{value}.
-
-This command differs from @code{ptype} in two ways: first, like
-@code{whatis}, it does not print a detailed description; second, it
-lists all source files where a type is defined.
-
-@item info source
-@kindex info source
-Show the name of the current source file---that is, the source file for
-the function containing the current point of execution---and the language
-it was written in.
-
-@item info sources
-@kindex info sources
-Print the names of all source files in the program for which there is
-debugging information, organized into two lists: files whose symbols
-have already been read, and files whose symbols will be read when needed.
-
-@item info functions
-@kindex info functions
-Print the names and data types of all defined functions.
-
-@item info functions @var{regexp}
-Print the names and data types of all defined functions
-whose names contain a match for regular expression @var{regexp}.
-Thus, @samp{info fun step} finds all functions whose names
-include @code{step}; @samp{info fun ^step} finds those whose names
-start with @code{step}.
-
-@item info variables
-@kindex info variables
-Print the names and data types of all variables that are declared
-outside of functions (i.e., excluding local variables).
-
-@item info variables @var{regexp}
-Print the names and data types of all variables (except for local
-variables) whose names contain a match for regular expression
-@var{regexp}.
-
-
-@ignore
-This was never implemented.
-@item info methods
-@itemx info methods @var{regexp}
-@kindex info methods
-The @code{info methods} command permits the user to examine all defined
-methods within C++ program, or (with the @var{regexp} argument) a
-specific set of methods found in the various C++ classes. Many
-C++ classes provide a large number of methods. Thus, the output
-from the @code{ptype} command can be overwhelming and hard to use. The
-@code{info-methods} command filters the methods, printing only those
-which match the regular-expression @var{regexp}.
-@end ignore
-
-@item printsyms @var{filename}
-@itemx printpsyms @var{filename}
-@kindex printsyms
-@cindex symbol dump
-@kindex printsyms
-@cindex partial symbol dump
-Write a dump of debugging symbol data into the file @var{filename}.
-These commands are used to debug the _GDBN__ symbol-reading code. Only
-symbols with debugging data are included. If you use @code{printsyms},
-_GDBN__ includes all the symbols for which it has already collected full
-details: that is, @var{filename} reflects symbols for only those files
-whose symbols _GDBN__ has read. You can use the command @code{info
-sources} to find out which files these are. If you use
-@code{printpsyms}, the dump also shows information about symbols that
-_GDBN__ only knows partially---that is, symbols defined in files that
-_GDBN__ has skimmed, but not yet read completely. The description of
-@code{symbol-file} describes how _GDBN__ reads symbols; both commands
-are described under @ref{Files}.
-
-@end table
-
-@node Altering, _GDBN__ Files, Symbols, Top
-@chapter Altering Execution
-
-Once you think you have found an error in the program, you might want to
-find out for certain whether correcting the apparent error would lead to
-correct results in the rest of the run. You can find the answer by
-experiment, using the _GDBN__ features for altering execution of the
-program.
-
-For example, you can store new values into variables or memory
-locations, give the program a signal, restart it at a different address,
-or even return prematurely from a function to its caller.
-
-@menu
-* Assignment:: Assignment to Variables
-* Jumping:: Continuing at a Different Address
-* Signaling:: Giving the Program a Signal
-* Returning:: Returning from a Function
-* Calling:: Calling your Program's Functions
-* Patching:: Patching your Program
-@end menu
-
-@node Assignment, Jumping, Altering, Altering
-@section Assignment to Variables
-
-@cindex assignment
-@cindex setting variables
-To alter the value of a variable, evaluate an assignment expression.
-@xref{Expressions}. For example,
-
-@example
-print x=4
-@end example
-
-@noindent
-would store the value 4 into the variable @code{x}, and then print the
-value of the assignment expression (which is 4). @xref{Languages}, for
-more information on operators in supported languages.
-
-@kindex set variable
-@cindex variables, setting
-If you are not interested in seeing the value of the assignment, use the
-@code{set} command instead of the @code{print} command. @code{set} is
-really the same as @code{print} except that the expression's value is not
-printed and is not put in the value history (@pxref{Value History}). The
-expression is evaluated only for its effects.
-
-If the beginning of the argument string of the @code{set} command
-appears identical to a @code{set} subcommand, use the @code{set
-variable} command instead of just @code{set}. This command is identical
-to @code{set} except for its lack of subcommands. For example, a
-program might well have a variable @code{width}---which leads to
-an error if we try to set a new value with just @samp{set width=13}, as
-we might if @code{set width} didn't happen to be a _GDBN__ command:
-@example
-(_GDBP__) whatis width
-type = double
-(_GDBP__) p width
-$4 = 13
-(_GDBP__) set width=47
-Invalid syntax in expression.
-@end example
-@noindent
-The invalid expression, of course, is @samp{=47}. What we can do in
-order to actually set our program's variable @code{width} is
-@example
-(_GDBP__) set var width=47
-@end example
-
-_GDBN__ allows more implicit conversions in assignments than C does; you can
-freely store an integer value into a pointer variable or vice versa, and
-any structure can be converted to any other structure that is the same
-length or shorter.
-@comment FIXME: how do structs align/pad in these conversions?
-@comment /pesch@cygnus.com 18dec1990
-
-To store values into arbitrary places in memory, use the @samp{@{@dots{}@}}
-construct to generate a value of specified type at a specified address
-(@pxref{Expressions}). For example, @code{@{int@}0x83040} refers
-to memory location @code{0x83040} as an integer (which implies a certain size
-and representation in memory), and
-
-@example
-set @{int@}0x83040 = 4
-@end example
-
-@noindent
-stores the value 4 into that memory location.
-
-@node Jumping, Signaling, Assignment, Altering
-@section Continuing at a Different Address
-
-Ordinarily, when you continue the program, you do so at the place where
-it stopped, with the @code{continue} command. You can instead continue at
-an address of your own choosing, with the following commands:
-
-@table @code
-@item jump @var{linespec}
-@kindex jump
-Resume execution at line @var{linespec}. Execution will stop
-immediately if there is a breakpoint there. @xref{List} for a
-description of the different forms of @var{linespec}.
-
-The @code{jump} command does not change the current stack frame, or
-the stack pointer, or the contents of any memory location or any
-register other than the program counter. If line @var{linespec} is in
-a different function from the one currently executing, the results may
-be bizarre if the two functions expect different patterns of arguments or
-of local variables. For this reason, the @code{jump} command requests
-confirmation if the specified line is not in the function currently
-executing. However, even bizarre results are predictable if you are
-well acquainted with the machine-language code of the program.
-
-@item jump *@var{address}
-Resume execution at the instruction at address @var{address}.
-@end table
-
-You can get much the same effect as the @code{jump} command by storing a
-new value into the register @code{$pc}. The difference is that this
-does not start the program running; it only changes the address where it
-@emph{will} run when it is continued. For example,
-
-@example
-set $pc = 0x485
-@end example
-
-@noindent
-causes the next @code{continue} command or stepping command to execute at
-address 0x485, rather than at the address where the program stopped.
-@xref{Continuing and Stepping}.
-
-The most common occasion to use the @code{jump} command is to back up,
-perhaps with more breakpoints set, over a portion of a program that has
-already executed, in order to examine its execution in more detail.
-
-@node Signaling, Returning, Jumping, Altering
-@c @group
-@section Giving the Program a Signal
-
-@table @code
-@item signal @var{signalnum}
-@kindex signal
-Resume execution where the program stopped, but give it immediately the
-signal number @var{signalnum}.
-
-Alternatively, if @var{signalnum} is zero, continue execution without
-giving a signal. This is useful when the program stopped on account of
-a signal and would ordinary see the signal when resumed with the
-@code{continue} command; @samp{signal 0} causes it to resume without a
-signal.
-
-@code{signal} does not repeat when you press @key{RET} a second time
-after executing the command.
-@end table
-@c @end group
-
-@node Returning, Calling, Signaling, Altering
-@section Returning from a Function
-
-@table @code
-@item return
-@itemx return @var{expression}
-@cindex returning from a function
-@kindex return
-You can cancel execution of a function call with the @code{return}
-command. If you give an
-@var{expression} argument, its value is used as the function's return
-value.
-@end table
-
-When you use @code{return}, _GDBN__ discards the selected stack frame
-(and all frames within it). You can think of this as making the
-discarded frame return prematurely. If you wish to specify a value to
-be returned, give that value as the argument to @code{return}.
-
-This pops the selected stack frame (@pxref{Selection}), and any other
-frames inside of it, leaving its caller as the innermost remaining
-frame. That frame becomes selected. The specified value is stored in
-the registers used for returning values of functions.
-
-The @code{return} command does not resume execution; it leaves the
-program stopped in the state that would exist if the function had just
-returned. In contrast, the @code{finish} command
-(@pxref{Continuing and Stepping})
-resumes execution until the selected stack frame returns naturally.@refill
-
-@node Calling, Patching, Returning, Altering
-@section Calling your Program's Functions
-
-@cindex calling functions
-@kindex call
-@table @code
-@item call @var{expr}
-Evaluate the expression @var{expr} without displaying @code{void}
-returned values.
-@end table
-
-You can use this variant of the @code{print} command if you want to
-execute a function from your program, but without cluttering the output
-with @code{void} returned values. The result is printed and saved in
-the value history, if it is not void.
-
-@node Patching, , Calling, Altering
-@section Patching your Program
-@cindex patching binaries
-@cindex writing into executables
-@cindex writing into corefiles
-By default, _GDBN__ opens the file containing your program's executable
-code (or the corefile) read-only. This prevents accidental alterations
-to machine code; but it also prevents you from intentionally patching
-your program's binary.
-
-If you'd like to be able to patch the binary, you can specify that
-explicitly with the @code{set write} command. For example, you might
-want to turn on internal debugging flags, or even to make emergency
-repairs.
-
-@table @code
-@item set write on
-@itemx set write off
-@kindex set write
-If you specify @samp{set write on}, _GDBN__ will open executable and
-core files for both reading and writing; if you specify @samp{set write
-off} (the default), _GDBN__ will open them read-only.
-
-If you've already loaded a file, you must load it
-again (using the @code{exec-file} or @code{core-file} command) after
-changing @code{set write}, for your new setting to take effect.
-
-@item show write
-@kindex show write
-Display whether executable files and core files will be opened for
-writing as well as reading.
-
-@end table
-
-@node _GDBN__ Files, Targets, Altering, Top
-@chapter _GDBN__'s Files
-
-@menu
-* Files:: Commands to Specify Files
-* Symbol Errors:: Errors Reading Symbol Files
-@end menu
-
-@node Files, Symbol Errors, _GDBN__ Files, _GDBN__ Files
-@section Commands to Specify Files
-@cindex core dump file
-@cindex symbol table
-_GDBN__ needs to know the file name of the program to be debugged, both in
-order to read its symbol table and in order to start the program. To
-debug a core dump of a previous run, _GDBN__ must be told the file name of
-the core dump.
-
-The usual way to specify the executable and core dump file names is with
-the command arguments given when you start _GDBN__, as discussed in
-@pxref{Invocation}.
-
-Occasionally it is necessary to change to a different file during a
-_GDBN__ session. Or you may run _GDBN__ and forget to specify the files you
-want to use. In these situations the _GDBN__ commands to specify new files
-are useful.
-
-@table @code
-@item file @var{filename}
-@cindex executable file
-@kindex file
-Use @var{filename} as the program to be debugged. It is read for its
-symbols and for the contents of pure memory. It is also the program
-executed when you use the @code{run} command. If you do not specify a
-directory and the file is not found in _GDBN__'s working directory,
-
-_GDBN__ uses the environment variable @code{PATH} as a list of
-directories to search, just as the shell does when looking for a program
-to run. You can change the value of this variable, for both _GDBN__ and
-your program, using the @code{path} command.
-
-@item file
-@code{file} with no argument makes _GDBN__ discard any information it
-has on both executable file and the symbol table.
-
-@item exec-file @r{[} @var{filename} @r{]}
-@kindex exec-file
-Specify that the program to be run (but not the symbol table) is found
-in @var{filename}. _GDBN__ will search the environment variable @code{PATH}
-if necessary to locate the program. Omitting @var{filename} means to
-discard information on the executable file.
-
-@item symbol-file @r{[} @var{filename} @r{]}
-@kindex symbol-file
-Read symbol table information from file @var{filename}. @code{PATH} is
-searched when necessary. Use the @code{file} command to get both symbol
-table and program to run from the same file.
-
-@code{symbol-file} with no argument clears out _GDBN__'s information on your
-program's symbol table.
-
-The @code{symbol-file} command causes _GDBN__ to forget the contents of its
-convenience variables, the value history, and all breakpoints and
-auto-display expressions. This is because they may contain pointers to
-the internal data recording symbols and data types, which are part of
-the old symbol table data being discarded inside _GDBN__.
-
-@code{symbol-file} will not repeat if you press @key{RET} again after
-executing it once.
-
-On some kinds of object files, the @code{symbol-file} command does not
-actually read the symbol table in full right away. Instead, it scans
-the symbol table quickly to find which source files and which symbols
-are present. The details are read later, one source file at a time,
-when they are needed.
-
-The purpose of this two-stage reading strategy is to make _GDBN__ start up
-faster. For the most part, it is invisible except for occasional pauses
-while the symbol table details for a particular source file are being
-read. (The @code{set verbose} command can turn these pauses into
-messages if desired. @xref{Messages/Warnings}).
-
-When the symbol table is stored in COFF format, @code{symbol-file} does
-read the symbol table data in full right away. We haven't implemented
-the two-stage strategy for COFF yet.
-
-When _GDBN__ is configured for a particular environment, it will
-understand debugging information in whatever format is the standard
-generated for that environment; you may use either a GNU compiler, or
-other compilers that adhere to the local conventions. Best results are
-usually obtained from GNU compilers; for example, using @code{_GCC__}
-you can generate debugging information for optimized code.
-
-@item core-file @r{[} @var{filename} @r{]}
-@kindex core
-@kindex core-file
-Specify the whereabouts of a core dump file to be used as the ``contents
-of memory''. Traditionally, core files contain only some parts of the
-address space of the process that generated them; _GDBN__ can access the
-executable file itself for other parts.
-
-@code{core-file} with no argument specifies that no core file is
-to be used.
-
-Note that the core file is ignored when your program is actually running
-under _GDBN__. So, if you have been running the program and you wish to
-debug a core file instead, you must kill the subprocess in which the
-program is running. To do this, use the @code{kill} command
-(@pxref{Kill Process}).
-
-@item load @var{filename}
-@kindex load
-_if__(_GENERIC__)
-Depending on what remote debugging facilities are configured into
-_GDBN__, the @code{load} command may be available. Where it exists, it
-is meant to make @var{filename} (an executable) available for debugging
-on the remote system---by downloading, or dynamic linking, for example.
-@code{load} also records @var{filename}'s symbol table in _GDBN__, like
-the @code{add-symbol-file} command.
-
-If @code{load} is not available on your _GDBN__, attempting to execute
-it gets the error message ``@code{You can't do that when your target is
-@dots{}}''
-_fi__(_GENERIC__)
-
-_if__(_VXWORKS__)
-On VxWorks, @code{load} will dynamically link @var{filename} on the
-current target system as well as adding its symbols in _GDBN__.
-_fi__(_VXWORKS__)
-
-_if__(_I960__)
-@cindex download to Nindy-960
-With the Nindy interface to an Intel 960 board, @code{load} will
-download @var{filename} to the 960 as well as adding its symbols in
-_GDBN__.
-_fi__(_I960__)
-
-@code{load} will not repeat if you press @key{RET} again after using it.
-
-@item add-symbol-file @var{filename} @var{address}
-@kindex add-symbol-file
-@cindex dynamic linking
-The @code{add-symbol-file} command reads additional symbol table information
-from the file @var{filename}. You would use this command when @var{filename}
-has been dynamically loaded (by some other means) into the program that
-is running. @var{address} should be the memory address at which the
-file has been loaded; _GDBN__ cannot figure this out for itself.
-
-The symbol table of the file @var{filename} is added to the symbol table
-originally read with the @code{symbol-file} command. You can use the
-@code{add-symbol-file} command any number of times; the new symbol data thus
-read keeps adding to the old. To discard all old symbol data instead,
-use the @code{symbol-file} command.
-
-@code{add-symbol-file} will not repeat if you press @key{RET} after using it.
-
-@item info files
-@itemx info target
-@kindex info files
-@kindex info target
-@code{info files} and @code{info target} are synonymous; both print the
-current targets (@pxref{Targets}), including the names of the executable
-and core dump files currently in use by _GDBN__, and the files from
-which symbols were loaded. The command @code{help targets} lists all
-possible targets rather than current ones.
-
-@end table
-
-All file-specifying commands allow both absolute and relative file names
-as arguments. _GDBN__ always converts the file name to an absolute path
-name and remembers it that way.
-
-@cindex shared libraries
-
-_GDBN__ supports the SunOS shared library format. _GDBN__ automatically
-loads symbol definitions from shared libraries when you use the
-@code{run} command, or when you examine a core file. (Before you issue
-the @code{run} command, _GDBN__ won't understand references to a
-function in a shared library, however---unless you're debugging a core
-file).
-@c FIXME: next _GDBN__ release should permit some refs to undef
-@c FIXME...symbols---eg in a break cmd---assuming they're from a shared lib
-
-@table @code
-@item info share
-@itemx info sharedlibrary
-@kindex info sharedlibrary
-@kindex info share
-Print the names of the shared libraries which are currently loaded.
-
-@item sharedlibrary @var{regex}
-@itemx share @var{regex}
-@kindex sharedlibrary
-@kindex share
-This is an obsolescent command; you can use it to explicitly
-load shared object library symbols for files matching a UNIX regular
-expression, but as with files loaded automatically, it will only load
-shared libraries required by your program for a core file or after
-typing @code{run}. If @var{regex} is omitted all shared libraries
-required by your program are loaded.
-@end table
-
-@node Symbol Errors, , Files, _GDBN__ Files
-@section Errors Reading Symbol Files
-While reading a symbol file, _GDBN__ will occasionally encounter
-problems, such as symbol types it does not recognize, or known bugs in
-compiler output. By default, _GDBN__ does not notify you of such
-problems, since they're relatively common and primarily of interest to
-people debugging compilers. If you are interested in seeing information
-about ill-constructed symbol tables, you can either ask _GDBN__ to print
-only one message about each such type of problem, no matter how many
-times the problem occurs; or you can ask _GDBN__ to print more messages,
-to see how many times the problems occur, with the @code{set complaints}
-command (@xref{Messages/Warnings}).
-
-The messages currently printed, and their meanings, are:
-
-@table @code
-@item inner block not inside outer block in @var{symbol}
-
-The symbol information shows where symbol scopes begin and end
-(such as at the start of a function or a block of statements). This
-error indicates that an inner scope block is not fully contained
-in its outer scope blocks.
-
-_GDBN__ circumvents the problem by treating the inner block as if it had
-the same scope as the outer block. In the error message, @var{symbol}
-may be shown as ``@code{(don't know)}'' if the outer block is not a
-function.
-
-@item block at @var{address} out of order
-
-The symbol information for symbol scope blocks should occur in
-order of increasing addresses. This error indicates that it does not
-do so.
-
-_GDBN__ does not circumvent this problem, and will have trouble locating
-symbols in the source file whose symbols being read. (You can often
-determine what source file is affected by specifying @code{set verbose
-on}. @xref{Messages/Warnings}.)
-
-@item bad block start address patched
-
-The symbol information for a symbol scope block has a start address
-smaller than the address of the preceding source line. This is known
-to occur in the SunOS 4.1.1 (and earlier) C compiler.
-
-_GDBN__ circumvents the problem by treating the symbol scope block as
-starting on the previous source line.
-
-@item bad string table offset in symbol @var{n}
-
-@cindex foo
-Symbol number @var{n} contains a pointer into the string table which is
-larger than the size of the string table.
-
-_GDBN__ circumvents the problem by considering the symbol to have the
-name @code{foo}, which may cause other problems if many symbols end up
-with this name.
-
-@item unknown symbol type @code{0x@var{nn}}
-
-The symbol information contains new data types that _GDBN__ does not yet
-know how to read. @code{0x@var{nn}} is the symbol type of the misunderstood
-information, in hexadecimal.
-
-_GDBN__ circumvents the error by ignoring this symbol information. This
-will usually allow the program to be debugged, though certain symbols
-will not be accessible. If you encounter such a problem and feel like
-debugging it, you can debug @code{_GDBP__} with itself, breakpoint on
-@code{complain}, then go up to the function @code{read_dbx_symtab} and
-examine @code{*bufp} to see the symbol.
-
-@item stub type has NULL name
-_GDBN__ could not find the full definition for a struct or class.
-
-@item const/volatile indicator missing (ok if using g++ v1.x), got@dots{}
-
-The symbol information for a C++ member function is missing some
-information that recent versions of the compiler should have output
-for it.
-
-@item info mismatch between compiler and debugger
-
-_GDBN__ could not parse a type specification output by the compiler.
-
-@end table
-
-@node Targets, Controlling _GDBN__, _GDBN__ Files, Top
-@chapter Specifying a Debugging Target
-@cindex debugging target
-@kindex target
-A @dfn{target} is the execution environment occupied by your program.
-Often, _GDBN__ runs in the same host environment as the program you are
-debugging; in that case, the debugging target is specified as a side
-effect when you use the @code{file} or @code{core} commands. When you
-need more flexibility---for example, running _GDBN__ on a physically
-separate host, or controlling a standalone system over a serial port or
-a realtime system over a TCP/IP connection---you can use the
-@code{target} command to specify one of the target types configured for
-_GDBN__ (@pxref{Target Commands}).
-
-@menu
-* Active Targets:: Active Targets
-* Target Commands:: Commands for Managing Targets
-* Remote:: Remote Debugging
-@end menu
-
-@node Active Targets, Target Commands, Targets, Targets
-@section Active Targets
-@cindex stacking targets
-@cindex active targets
-@cindex multiple targets
-
-There are three classes of targets: processes, core files, and
-executable files. _GDBN__ can work concurrently on up to three active
-targets, one in each class. This allows you to (for example) start a
-process and inspect its activity without abandoning your work on a core
-file.
-
-If, for example, you execute @samp{gdb a.out}, then the executable file
-@code{a.out} is the only active target. If you designate a core file as
-well---presumably from a prior run that crashed and coredumped---then
-_GDBN__ has two active targets and will use them in tandem, looking
-first in the corefile target, then in the executable file, to satisfy
-requests for memory addresses. (Typically, these two classes of target
-are complementary, since core files contain only the program's
-read-write memory---variables and so on---plus machine status, while
-executable files contain only the program text and initialized data.)
-
-When you type @code{run}, your executable file becomes an active process
-target as well. When a process target is active, all _GDBN__ commands
-requesting memory addresses refer to that target; addresses in an active
-core file or executable file target are obscured while the process
-target is active.
-
-Use the @code{core-file}, and @code{exec-file} commands to select a new
-core file or executable target (@pxref{Files}). To specify as a target
-a process that's already running, use the @code{attach} command
-(@pxref{Attach}).
-
-@node Target Commands, Remote, Active Targets, Targets
-@section Commands for Managing Targets
-
-@table @code
-@item target @var{type} @var{parameters}
-Connects the _GDBN__ host environment to a target machine or process. A
-target is typically a protocol for talking to debugging facilities. You
-use the argument @var{type} to specify the type or protocol of the
-target machine.
-
-Further @var{parameters} are interpreted by the target protocol, but
-typically include things like device names or host names to connect
-with, process numbers, and baud rates.
-
-The @code{target} command will not repeat if you press @key{RET} again
-after executing the command.
-
-@item help target
-@kindex help target
-Displays the names of all targets available. To display targets
-currently selected, use either @code{info target} or @code{info files}
-(@pxref{Files}).
-
-@item help target @var{name}
-Describe a particular target, including any parameters necessary to
-select it.
-@end table
-
-Here are some common targets (available, or not, depending on the _GDBN__
-configuration):
-
-@table @code
-@item target exec @var{prog}
-@kindex target exec
-An executable file. @samp{target exec @var{prog}} is the same as
-@samp{exec-file @var{prog}}.
-
-@item target core @var{filename}
-@kindex target core
-A core dump file. @samp{target core @var{filename}} is the same as
-@samp{core-file @var{filename}}.
-
-@item target remote @var{dev}
-@kindex target remote
-Remote serial target in _GDBN__-specific protocol. The argument @var{dev}
-specifies what serial device to use for the connection (e.g.
-@file{/dev/ttya}). @xref{Remote}.
-
-_if__(_AMD29K__)
-@item target amd-eb @var{dev} @var{speed} @var{PROG}
-@kindex target amd-eb
-@cindex AMD EB29K
-Remote PC-resident AMD EB29K board, attached over serial lines.
-@var{dev} is the serial device, as for @code{target remote};
-@var{speed} allows you to specify the linespeed; and @var{PROG} is the
-name of the program to be debugged, as it appears to DOS on the PC.
-@xref{EB29K Remote}.
-
-_fi__(_AMD29K__)
-_if__(_I960__)
-@item target nindy @var{devicename}
-@kindex target nindy
-An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is
-the name of the serial device to use for the connection, e.g.
-@file{/dev/ttya}. @xref{i960-Nindy Remote}.
-
-_fi__(_I960__)
-_if__(_VXWORKS__)
-@item target vxworks @var{machinename}
-@kindex target vxworks
-A VxWorks system, attached via TCP/IP. The argument @var{machinename}
-is the target system's machine name or IP address.
-@xref{VxWorks Remote}.
-_fi__(_VXWORKS__)
-@end table
-
-_if__(_GENERIC__)
-Different targets are available on different configurations of _GDBN__; your
-configuration may have more or fewer targets.
-_fi__(_GENERIC__)
-
-@node Remote, , Target Commands, Targets
-@section Remote Debugging
-@cindex remote debugging
-
-_if__(_GENERIC__)
-@menu
-_include__(gdbinv-m.m4)<>_dnl__
-@end menu
-_fi__(_GENERIC__)
-
-If you are trying to debug a program running on a machine that can't run
-_GDBN__ in the usual way, it is often useful to use remote debugging. For
-example, you might use remote debugging on an operating system kernel, or on
-a small system which does not have a general purpose operating system
-powerful enough to run a full-featured debugger.
-
-Some configurations of _GDBN__ have special serial or TCP/IP interfaces
-to make this work with particular debugging targets. In addition,
-_GDBN__ comes with a generic serial protocol (specific to _GDBN__, but
-not specific to any particular target system) which you can use if you
-write the remote stubs---the code that will run on the remote system to
-communicate with _GDBN__.
-
-To use the _GDBN__ remote serial protocol, the program to be debugged on
-the remote machine needs to contain a debugging stub which talks to
-_GDBN__ over the serial line. Several working remote stubs are
-distributed with _GDBN__; see the @file{README} file in the _GDBN__
-distribution for more information.
-
-For details of this communication protocol, see the comments in the
-_GDBN__ source file @file{remote.c}.
-
-To start remote debugging, first run _GDBN__ and specify as an executable file
-the program that is running in the remote machine. This tells _GDBN__ how
-to find the program's symbols and the contents of its pure text. Then
-establish communication using the @code{target remote} command with a device
-name as an argument. For example:
-
-@example
-target remote /dev/ttyb
-@end example
-
-@noindent
-if the serial line is connected to the device named @file{/dev/ttyb}. This
-will stop the remote machine if it is not already stopped.
-
-Now you can use all the usual commands to examine and change data and to
-step and continue the remote program.
-
-To resume the remote program and stop debugging it, use the @code{detach}
-command.
-
-Other remote targets may be available in your
-configuration of _GDBN__; use @code{help targets} to list them.
-
-_if__(_GENERIC__)
-@c Text on starting up GDB in various specific cases; it goes up front
-@c in manuals configured for any of those particular situations, here
-@c otherwise.
-_include__(gdbinv-s.m4)
-_fi__(_GENERIC__)
-
-@node Controlling _GDBN__, Sequences, Targets, Top
-@chapter Controlling _GDBN__
-
-You can alter many aspects of _GDBN__'s interaction with you by using
-the @code{set} command. For commands controlling how _GDBN__ displays
-data, @pxref{Print Settings}; other settings are described here.
-
-@menu
-* Prompt:: Prompt
-* Editing:: Command Editing
-* History:: Command History
-* Screen Size:: Screen Size
-* Numbers:: Numbers
-* Messages/Warnings:: Optional Warnings and Messages
-@end menu
-
-@node Prompt, Editing, Controlling _GDBN__, Controlling _GDBN__
-@section Prompt
-@cindex prompt
-_GDBN__ indicates its readiness to read a command by printing a string
-called the @dfn{prompt}. This string is normally @samp{(_GDBP__)}. You
-can change the prompt string with the @code{set prompt} command. For
-instance, when debugging _GDBN__ with _GDBN__, it is useful to change
-the prompt in one of the _GDBN__<>s so that you can always tell which
-one you are talking to.
-
-@table @code
-@item set prompt @var{newprompt}
-@kindex set prompt
-Directs _GDBN__ to use @var{newprompt} as its prompt string henceforth.
-@kindex show prompt
-@item show prompt
-Prints a line of the form: @samp{Gdb's prompt is: @var{your-prompt}}
-@end table
-
-@node Editing, History, Prompt, Controlling _GDBN__
-@section Command Editing
-@cindex readline
-@cindex command line editing
-_GDBN__ reads its input commands via the @dfn{readline} interface. This
-GNU library provides consistent behavior for programs which provide a
-command line interface to the user. Advantages are @code{emacs}-style
-or @code{vi}-style inline editing of commands, @code{csh}-like history
-substitution, and a storage and recall of command history across
-debugging sessions.
-
-You may control the behavior of command line editing in _GDBN__ with the
-command @code{set}.
-
-@table @code
-@kindex set editing
-@cindex editing
-@item set editing
-@itemx set editing on
-Enable command line editing (enabled by default).
-
-@item set editing off
-Disable command line editing.
-
-@kindex show editing
-@item show editing
-Show whether command line editing is enabled.
-@end table
-
-@node History, Screen Size, Editing, Controlling _GDBN__
-@section Command History
-@table @code
-@cindex history substitution
-@cindex history file
-@kindex set history filename
-@item set history filename @var{fname}
-Set the name of the _GDBN__ command history file to @var{fname}. This is
-the file from which _GDBN__ will read an initial command history
-list or to which it will write this list when it exits. This list is
-accessed through history expansion or through the history
-command editing characters listed below. This file defaults to the
-value of the environment variable @code{GDBHISTFILE}, or to
-@file{./.gdb_history} if this variable is not set.
-
-@cindex history save
-@kindex set history save
-@item set history save
-@itemx set history save on
-Record command history in a file, whose name may be specified with the
-@code{set history filename} command. By default, this option is disabled.
-
-@item set history save off
-Stop recording command history in a file.
-
-@cindex history size
-@kindex set history size
-@item set history size @var{size}
-Set the number of commands which _GDBN__ will keep in its history list.
-This defaults to the value of the environment variable
-@code{HISTSIZE}, or to 256 if this variable is not set.
-@end table
-
-@cindex history expansion
-History expansion assigns special meaning to the character @kbd{!}.
-@iftex
-(@xref{Event Designators}.)
-@end iftex
-Since @kbd{!} is also the logical not operator in C, history expansion
-is off by default. If you decide to enable history expansion with the
-@code{set history expansion on} command, you may sometimes need to
-follow @kbd{!} (when it is used as logical not, in an expression) with
-a space or a tab to prevent it from being expanded. The readline
-history facilities will not attempt substitution on the strings
-@kbd{!=} and @kbd{!(}, even when history expansion is enabled.
-
-The commands to control history expansion are:
-
-@table @code
-
-@kindex set history expansion
-@item set history expansion on
-@itemx set history expansion
-Enable history expansion. History expansion is off by default.
-
-@item set history expansion off
-Disable history expansion.
-
-The readline code comes with more complete documentation of
-editing and history expansion features. Users unfamiliar with @code{emacs}
-or @code{vi} may wish to read it.
-@iftex
-@xref{Command Line Editing}.
-@end iftex
-
-@c @group
-@kindex show history
-@item show history
-@itemx show history filename
-@itemx show history save
-@itemx show history size
-@itemx show history expansion
-These commands display the state of the _GDBN__ history parameters.
-@code{show history} by itself displays all four states.
-@c @end group
-
-@end table
-
-@table @code
-@kindex show commands
-@item show commands
-Display the last ten commands in the command history.
-
-@item show commands @var{n}
-Print ten commands centered on command number @var{n}.
-
-@item show commands +
-Print ten commands just after the commands last printed.
-
-@end table
-
-@node Screen Size, Numbers, History, Controlling _GDBN__
-@section Screen Size
-@cindex size of screen
-@cindex pauses in output
-Certain commands to _GDBN__ may produce large amounts of information
-output to the screen. To help you read all of it, _GDBN__ pauses and
-asks you for input at the end of each page of output. Type @key{RET}
-when you want to continue the output. _GDBN__ also uses the screen
-width setting to determine when to wrap lines of output. Depending on
-what is being printed, it tries to break the line at a readable place,
-rather than simply letting it overflow onto the following line.
-
-Normally _GDBN__ knows the size of the screen from the termcap data base
-together with the value of the @code{TERM} environment variable and the
-@code{stty rows} and @code{stty cols} settings. If this is not correct,
-you can override it with the @code{set height} and @code{set
-width} commands:
-
-@table @code
-@item set height @var{lpp}
-@itemx show height
-@itemx set width @var{cpl}
-@itemx show width
-@kindex set height
-@kindex set width
-@kindex show width
-@kindex show height
-These @code{set} commands specify a screen height of @var{lpp} lines and
-a screen width of @var{cpl} characters. The associated @code{show}
-commands display the current settings.
-
-If you specify a height of zero lines, _GDBN__ will not pause during output
-no matter how long the output is. This is useful if output is to a file
-or to an editor buffer.
-@end table
-
-@node Numbers, Messages/Warnings, Screen Size, Controlling _GDBN__
-@section Numbers
-@cindex number representation
-@cindex entering numbers
-You can always enter numbers in octal, decimal, or hexadecimal in _GDBN__ by
-the usual conventions: octal numbers begin with @samp{0}, decimal
-numbers end with @samp{.}, and hexadecimal numbers begin with @samp{0x}.
-Numbers that begin with none of these are, by default, entered in base
-10; likewise, the default display for numbers---when no particular
-format is specified---is base 10. You can change the default base for
-both input and output with the @code{set radix} command.
-
-@table @code
-@kindex set radix
-@item set radix @var{base}
-Set the default base for numeric input and display. Supported choices
-for @var{base} are decimal 2, 8, 10, 16. @var{base} must itself be
-specified either unambiguously or using the current default radix; for
-example, any of
-
-@example
-set radix 1010
-set radix 012
-set radix 10.
-set radix 0xa
-@end example
-
-@noindent
-will set the base to decimal. On the other hand, @samp{set radix 10}
-will leave the radix unchanged no matter what it was.
-
-@kindex show radix
-@item show radix
-Display the current default base for numeric input and display.
-
-@end table
-
-@node Messages/Warnings, , Numbers, Controlling _GDBN__
-@section Optional Warnings and Messages
-By default, _GDBN__ is silent about its inner workings. If you are running
-on a slow machine, you may want to use the @code{set verbose} command.
-It will make _GDBN__ tell you when it does a lengthy internal operation, so
-you won't think it has crashed.
-
-Currently, the messages controlled by @code{set verbose} are those which
-announce that the symbol table for a source file is being read
-(@pxref{Files}, in the description of the command
-@code{symbol-file}).
-@c The following is the right way to do it, but emacs 18.55 doesn't support
-@c @ref, and neither the emacs lisp manual version of texinfmt or makeinfo
-@c is released.
-@ignore
-see @code{symbol-file} in @ref{Files}).
-@end ignore
-
-@table @code
-@kindex set verbose
-@item set verbose on
-Enables _GDBN__'s output of certain informational messages.
-
-@item set verbose off
-Disables _GDBN__'s output of certain informational messages.
-
-@kindex show verbose
-@item show verbose
-Displays whether @code{set verbose} is on or off.
-@end table
-
-By default, if _GDBN__ encounters bugs in the symbol table of an object
-file, it is silent; but if you are debugging a compiler, you may find
-this information useful (@pxref{Symbol Errors}).
-
-@table @code
-@kindex set complaints
-@item set complaints @var{limit}
-Permits _GDBN__ to output @var{limit} complaints about each type of unusual
-symbols before becoming silent about the problem. Set @var{limit} to
-zero to suppress all complaints; set it to a large number to prevent
-complaints from being suppressed.
-
-@kindex show complaints
-@item show complaints
-Displays how many symbol complaints _GDBN__ is permitted to produce.
-@end table
-
-By default, _GDBN__ is cautious, and asks what sometimes seem to be a
-lot of stupid questions to confirm certain commands. For example, if
-you try to run a program which is already running:
-@example
-(_GDBP__) run
-The program being debugged has been started already.
-Start it from the beginning? (y or n)
-@end example
-
-If you're willing to unflinchingly face the consequences of your own
-commands, you can disable this ``feature'':
-
-@table @code
-@kindex set confirm
-@cindex flinching
-@cindex confirmation
-@cindex stupid questions
-@item set confirm off
-Disables confirmation requests.
-
-@item set confirm on
-Enables confirmation requests (the default).
-
-@item show confirm
-@kindex show confirm
-Displays state of confirmation requests.
-@end table
-
-@c FIXME this doesn't really belong here. But where *does* it belong?
-@cindex reloading symbols
-Some systems allow individual object files that make up your program to
-be replaced without stopping and restarting your program.
-_if__(_VXWORKS__)
-For example, in VxWorks you can simply recompile a defective object file
-and keep on running.
-_fi__(_VXWORKS__)
-If you're running on one of these systems, you can allow _GDBN__ to
-reload the symbols for automatically relinked modules:@refill
-@table @code
-@kindex set symbol-reloading
-@item set symbol-reloading on
-Replace symbol definitions for the corresponding source file when an
-object file with a particular name is seen again.
-
-@item set symbol-reloading off
-Don't replace symbol definitions when re-encountering object files of
-the same name. This is the default state; if you're not running on a
-system that permits automatically relinking modules, you should leave
-@code{symbol-reloading} off, since otherwise _GDBN__ may discard symbols
-when linking large programs, that may contain several modules (from
-different directories or libraries) with the same name.
-
-@item show symbol-reloading
-Show the current @code{on} or @code{off} setting.
-@end table
-
-@node Sequences, Emacs, Controlling _GDBN__, Top
-@chapter Canned Sequences of Commands
-
-Aside from breakpoint commands (@pxref{Break Commands}), _GDBN__ provides two
-ways to store sequences of commands for execution as a unit:
-user-defined commands and command files.
-
-@menu
-* Define:: User-Defined Commands
-* Command Files:: Command Files
-* Output:: Commands for Controlled Output
-@end menu
-
-@node Define, Command Files, Sequences, Sequences
-@section User-Defined Commands
-
-@cindex user-defined command
-A @dfn{user-defined command} is a sequence of _GDBN__ commands to which you
-assign a new name as a command. This is done with the @code{define}
-command.
-
-@table @code
-@item define @var{commandname}
-@kindex define
-Define a command named @var{commandname}. If there is already a command
-by that name, you are asked to confirm that you want to redefine it.
-
-The definition of the command is made up of other _GDBN__ command lines,
-which are given following the @code{define} command. The end of these
-commands is marked by a line containing @code{end}.
-
-@item document @var{commandname}
-@kindex document
-Give documentation to the user-defined command @var{commandname}. The
-command @var{commandname} must already be defined. This command reads
-lines of documentation just as @code{define} reads the lines of the
-command definition, ending with @code{end}. After the @code{document}
-command is finished, @code{help} on command @var{commandname} will print
-the documentation you have specified.
-
-You may use the @code{document} command again to change the
-documentation of a command. Redefining the command with @code{define}
-does not change the documentation.
-
-@item help user-defined
-@kindex help user-defined
-List all user-defined commands, with the first line of the documentation
-(if any) for each.
-
-@item info user
-@itemx info user @var{commandname}
-@kindex info user
-Display the _GDBN__ commands used to define @var{commandname} (but not its
-documentation). If no @var{commandname} is given, display the
-definitions for all user-defined commands.
-@end table
-
-User-defined commands do not take arguments. When they are executed, the
-commands of the definition are not printed. An error in any command
-stops execution of the user-defined command.
-
-Commands that would ask for confirmation if used interactively proceed
-without asking when used inside a user-defined command. Many _GDBN__ commands
-that normally print messages to say what they are doing omit the messages
-when used in a user-defined command.
-
-@node Command Files, Output, Define, Sequences
-@section Command Files
-
-@cindex command files
-A command file for _GDBN__ is a file of lines that are _GDBN__ commands. Comments
-(lines starting with @kbd{#}) may also be included. An empty line in a
-command file does nothing; it does not mean to repeat the last command, as
-it would from the terminal.
-
-@cindex init file
-@cindex @file{_GDBINIT__}
-When you start _GDBN__, it automatically executes commands from its
-@dfn{init files}. These are files named @file{_GDBINIT__}. _GDBN__
-reads the init file (if any) in your home directory and then the init
-file (if any) in the current working directory. (The init files are not
-executed if you use the @samp{-nx} option; @pxref{Mode Options}.) You
-can also request the execution of a command file with the @code{source}
-command:
-
-@table @code
-@item source @var{filename}
-@kindex source
-Execute the command file @var{filename}.
-@end table
-
-The lines in a command file are executed sequentially. They are not
-printed as they are executed. An error in any command terminates execution
-of the command file.
-
-Commands that would ask for confirmation if used interactively proceed
-without asking when used in a command file. Many _GDBN__ commands that
-normally print messages to say what they are doing omit the messages
-when called from command files.
-
-@node Output, , Command Files, Sequences
-@section Commands for Controlled Output
-
-During the execution of a command file or a user-defined command, normal
-_GDBN__ output is suppressed; the only output that appears is what is
-explicitly printed by the commands in the definition. This section
-describes three commands useful for generating exactly the output you
-want.
-
-@table @code
-@item echo @var{text}
-@kindex echo
-@c I don't consider backslash-space a standard C escape sequence
-@c because it's not in ANSI.
-Print @var{text}. Nonprinting characters can be included in @var{text}
-using C escape sequences, such as @samp{\n} to print a newline. @b{No
-newline will be printed unless you specify one.} In addition to the
-standard C escape sequences, a backslash followed by a space stands for a
-space. This is useful for outputting a string with spaces at the
-beginning or the end, since leading and trailing spaces are otherwise
-trimmed from all arguments. Thus, to print @samp{@ and foo =@ }, use the
-command @samp{echo \@ and foo = \@ }.
-@c FIXME? '@ ' works in tex and info, but confuses texi2roff[-2].
-
-A backslash at the end of @var{text} can be used, as in C, to continue
-the command onto subsequent lines. For example,
-
-@example
-echo This is some text\n\
-which is continued\n\
-onto several lines.\n
-@end example
-
-produces the same output as
-
-@example
-echo This is some text\n
-echo which is continued\n
-echo onto several lines.\n
-@end example
-
-@item output @var{expression}
-@kindex output
-Print the value of @var{expression} and nothing but that value: no
-newlines, no @samp{$@var{nn} = }. The value is not entered in the
-value history either. @xref{Expressions} for more information on
-expressions.
-
-@item output/@var{fmt} @var{expression}
-Print the value of @var{expression} in format @var{fmt}. You can use
-the same formats as for @code{print}; @pxref{Output formats}, for more
-information.
-
-@item printf @var{string}, @var{expressions}@dots{}
-@kindex printf
-Print the values of the @var{expressions} under the control of
-@var{string}. The @var{expressions} are separated by commas and may
-be either numbers or pointers. Their values are printed as specified
-by @var{string}, exactly as if the program were to execute
-
-@example
-printf (@var{string}, @var{expressions}@dots{});
-@end example
-
-For example, you can print two values in hex like this:
-
-@example
-printf "foo, bar-foo = 0x%x, 0x%x\n", foo, bar-foo
-@end example
-
-The only backslash-escape sequences that you can use in the format
-string are the simple ones that consist of backslash followed by a
-letter.
-@end table
-
-@node Emacs, _GDBN__ Bugs, Sequences, Top
-@chapter Using _GDBN__ under GNU Emacs
-
-@cindex emacs
-A special interface allows you to use GNU Emacs to view (and
-edit) the source files for the program you are debugging with
-_GDBN__.
-
-To use this interface, use the command @kbd{M-x gdb} in Emacs. Give the
-executable file you want to debug as an argument. This command starts
-_GDBN__ as a subprocess of Emacs, with input and output through a newly
-created Emacs buffer.
-
-Using _GDBN__ under Emacs is just like using _GDBN__ normally except for two
-things:
-
-@itemize @bullet
-@item
-All ``terminal'' input and output goes through the Emacs buffer.
-@end itemize
-
-This applies both to _GDBN__ commands and their output, and to the input
-and output done by the program you are debugging.
-
-This is useful because it means that you can copy the text of previous
-commands and input them again; you can even use parts of the output
-in this way.
-
-All the facilities of Emacs' Shell mode are available for interacting
-with your program. In particular, you can send signals the usual
-way---for example, @kbd{C-c C-c} for an interrupt, @kbd{C-c C-z} for a
-stop.
-
-@itemize @bullet
-@item
-_GDBN__ displays source code through Emacs.
-@end itemize
-
-Each time _GDBN__ displays a stack frame, Emacs automatically finds the
-source file for that frame and puts an arrow (_0__@samp{=>}_1__) at the
-left margin of the current line. Emacs uses a separate buffer for
-source display, and splits the window to show both your _GDBN__ session
-and the source.
-
-Explicit _GDBN__ @code{list} or search commands still produce output as
-usual, but you probably will have no reason to use them.
-
-@quotation
-@emph{Warning:} If the directory where your program resides is not your
-current directory, it can be easy to confuse Emacs about the location of
-the source files, in which case the auxiliary display buffer will not
-appear to show your source. _GDBN__ can find programs by searching your
-environment's @code{PATH} variable, so the _GDBN__ input and output
-session will proceed normally; but Emacs doesn't get enough information
-back from _GDBN__ to locate the source files in this situation. To
-avoid this problem, either start _GDBN__ mode from the directory where
-your program resides, or specify a full path name when prompted for the
-@kbd{M-x gdb} argument.
-
-A similar confusion can result if you use the _GDBN__ @code{file} command to
-switch to debugging a program in some other location, from an existing
-_GDBN__ buffer in Emacs.
-@end quotation
-
-By default, @kbd{M-x gdb} calls the program called @file{gdb}. If
-you need to call _GDBN__ by a different name (for example, if you keep
-several configurations around, with different names) you can set the
-Emacs variable @code{gdb-command-name}; for example,
-@example
-(setq gdb-command-name "mygdb")
-@end example
-@noindent
-(preceded by @kbd{ESC ESC}, or typed in the @code{*scratch*} buffer, or
-in your @file{.emacs} file) will make Emacs call the program named
-``@code{mygdb}'' instead.
-
-In the _GDBN__ I/O buffer, you can use these special Emacs commands in
-addition to the standard Shell mode commands:
-
-@table @kbd
-@item C-h m
-Describe the features of Emacs' _GDBN__ Mode.
-
-@item M-s
-Execute to another source line, like the _GDBN__ @code{step} command; also
-update the display window to show the current file and location.
-
-@item M-n
-Execute to next source line in this function, skipping all function
-calls, like the _GDBN__ @code{next} command. Then update the display window
-to show the current file and location.
-
-@item M-i
-Execute one instruction, like the _GDBN__ @code{stepi} command; update
-display window accordingly.
-
-@item M-x gdb-nexti
-Execute to next instruction, using the _GDBN__ @code{nexti} command; update
-display window accordingly.
-
-@item C-c C-f
-Execute until exit from the selected stack frame, like the _GDBN__
-@code{finish} command.
-
-@item M-c
-Continue execution of the program, like the _GDBN__ @code{continue}
-command.
-
-@emph{Warning:} In Emacs v19, this command is @kbd{C-c C-p}.
-
-@item M-u
-Go up the number of frames indicated by the numeric argument
-(@pxref{Arguments, , Numeric Arguments, emacs, The GNU Emacs Manual}),
-like the _GDBN__ @code{up} command.
-
-@emph{Warning:} In Emacs v19, this command is @kbd{C-c C-u}.@refill
-
-@item M-d
-Go down the number of frames indicated by the numeric argument, like the
-_GDBN__ @code{down} command.
-
-@emph{Warning:} In Emacs v19, this command is @kbd{C-c C-d}.
-
-@item C-x &
-Read the number where the cursor is positioned, and insert it at the end
-of the _GDBN__ I/O buffer. For example, if you wish to disassemble code
-around an address that was displayed earlier, type @kbd{disassemble};
-then move the cursor to the address display, and pick up the
-argument for @code{disassemble} by typing @kbd{C-x &}.
-
-You can customize this further on the fly by defining elements of the list
-@code{gdb-print-command}; once it is defined, you can format or
-otherwise process numbers picked up by @kbd{C-x &} before they are
-inserted. A numeric argument to @kbd{C-x &} will both indicate that you
-wish special formatting, and act as an index to pick an element of the
-list. If the list element is a string, the number to be inserted is
-formatted using the Emacs function @code{format}; otherwise the number
-is passed as an argument to the corresponding list element.
-
-@end table
-
-In any source file, the Emacs command @kbd{C-x SPC} (@code{gdb-break})
-tells _GDBN__ to set a breakpoint on the source line point is on.
-
-If you accidentally delete the source-display buffer, an easy way to get
-it back is to type the command @code{f} in the _GDBN__ buffer, to
-request a frame display; when you run under Emacs, this will recreate
-the source buffer if necessary to show you the context of the current
-frame.
-
-The source files displayed in Emacs are in ordinary Emacs buffers
-which are visiting the source files in the usual way. You can edit
-the files with these buffers if you wish; but keep in mind that _GDBN__
-communicates with Emacs in terms of line numbers. If you add or
-delete lines from the text, the line numbers that _GDBN__ knows will cease
-to correspond properly to the code.
-
-@c The following dropped because Epoch is nonstandard. Reactivate
-@c if/when v19 does something similar. ---pesch@cygnus.com 19dec1990
-@ignore
-@kindex emacs epoch environment
-@kindex epoch
-@kindex inspect
-
-Version 18 of Emacs has a built-in window system called the @code{epoch}
-environment. Users of this environment can use a new command,
-@code{inspect} which performs identically to @code{print} except that
-each value is printed in its own window.
-@end ignore
-
-@node _GDBN__ Bugs, Renamed Commands, Emacs, Top
-@chapter Reporting Bugs in _GDBN__
-@cindex Bugs in _GDBN__
-@cindex Reporting Bugs in _GDBN__
-
-Your bug reports play an essential role in making _GDBN__ reliable.
-
-Reporting a bug may help you by bringing a solution to your problem, or it
-may not. But in any case the principal function of a bug report is to help
-the entire community by making the next version of _GDBN__ work better. Bug
-reports are your contribution to the maintenance of _GDBN__.
-
-In order for a bug report to serve its purpose, you must include the
-information that enables us to fix the bug.
-
-@menu
-* Bug Criteria:: Have You Found a Bug?
-* Bug Reporting:: How to Report Bugs
-@end menu
-
-@node Bug Criteria, Bug Reporting, _GDBN__ Bugs, _GDBN__ Bugs
-@section Have You Found a Bug?
-@cindex Bug Criteria
-
-If you are not sure whether you have found a bug, here are some guidelines:
-
-@itemize @bullet
-@item
-@cindex Fatal Signal
-@cindex Core Dump
-If the debugger gets a fatal signal, for any input whatever, that is a
-_GDBN__ bug. Reliable debuggers never crash.
-
-@item
-@cindex error on Valid Input
-If _GDBN__ produces an error message for valid input, that is a bug.
-
-@item
-@cindex Invalid Input
-If _GDBN__ does not produce an error message for invalid input,
-that is a bug. However, you should note that your idea of
-``invalid input'' might be our idea of ``an extension'' or ``support
-for traditional practice''.
-
-@item
-If you are an experienced user of debugging tools, your suggestions
-for improvement of _GDBN__ are welcome in any case.
-@end itemize
-
-@node Bug Reporting, , Bug Criteria, _GDBN__ Bugs
-@section How to Report Bugs
-@cindex Bug Reports
-@cindex _GDBN__ Bugs, Reporting
-
-A number of companies and individuals offer support for GNU products.
-If you obtained _GDBN__ from a support organization, we recommend you
-contact that organization first.
-
-Contact information for many support companies and individuals is
-available in the file @file{etc/SERVICE} in the GNU Emacs distribution.
-
-In any event, we also recommend that you send bug reports for _GDBN__ to one
-of these addresses:
-
-@example
-bug-gdb@@prep.ai.mit.edu
-@{ucbvax|mit-eddie|uunet@}!prep.ai.mit.edu!bug-gdb
-@end example
-
-@strong{Do not send bug reports to @samp{info-gdb}, or to
-@samp{help-gdb}, or to any newsgroups.} Most users of _GDBN__ do not want to
-receive bug reports. Those that do, have arranged to receive @samp{bug-gdb}.
-
-The mailing list @samp{bug-gdb} has a newsgroup @samp{gnu.gdb.bug} which
-serves as a repeater. The mailing list and the newsgroup carry exactly
-the same messages. Often people think of posting bug reports to the
-newsgroup instead of mailing them. This appears to work, but it has one
-problem which can be crucial: a newsgroup posting often lacks a mail
-path back to the sender. Thus, if we need to ask for more information,
-we may be unable to reach you. For this reason, it is better to send
-bug reports to the mailing list.
-
-As a last resort, send bug reports on paper to:
-
-@example
-GNU Debugger Bugs
-Free Software Foundation
-545 Tech Square
-Cambridge, MA 02139
-@end example
-
-The fundamental principle of reporting bugs usefully is this:
-@strong{report all the facts}. If you are not sure whether to state a
-fact or leave it out, state it!
-
-Often people omit facts because they think they know what causes the
-problem and assume that some details don't matter. Thus, you might
-assume that the name of the variable you use in an example does not matter.
-Well, probably it doesn't, but one cannot be sure. Perhaps the bug is a
-stray memory reference which happens to fetch from the location where that
-name is stored in memory; perhaps, if the name were different, the contents
-of that location would fool the debugger into doing the right thing despite
-the bug. Play it safe and give a specific, complete example. That is the
-easiest thing for you to do, and the most helpful.
-
-Keep in mind that the purpose of a bug report is to enable us to fix
-the bug if it is new to us. It isn't as important what happens if
-the bug is already known. Therefore, always write your bug reports on
-the assumption that the bug has not been reported previously.
-
-Sometimes people give a few sketchy facts and ask, ``Does this ring a
-bell?'' Those bug reports are useless, and we urge everyone to
-@emph{refuse to respond to them} except to chide the sender to report
-bugs properly.
-
-To enable us to fix the bug, you should include all these things:
-
-@itemize @bullet
-@item
-The version of _GDBN__. _GDBN__ announces it if you start with no
-arguments; you can also print it at any time using @code{show version}.
-
-Without this, we won't know whether there is any point in looking for
-the bug in the current version of _GDBN__.
-
-@item
-A complete input script, and all necessary source files, that will
-reproduce the bug.
-
-@item
-What compiler (and its version) was used to compile _GDBN__---e.g.
-``_GCC__-1.37.1''.
-
-@item
-The command arguments you gave the compiler to compile your example and
-observe the bug. For example, did you use @samp{-O}? To guarantee
-you won't omit something important, list them all.
-
-If we were to try to guess the arguments, we would probably guess wrong
-and then we might not encounter the bug.
-
-@item
-The type of machine you are using, and the operating system name and
-version number.
-
-@item
-A description of what behavior you observe that you believe is
-incorrect. For example, ``It gets a fatal signal.''
-
-Of course, if the bug is that _GDBN__ gets a fatal signal, then we will
-certainly notice it. But if the bug is incorrect output, we might not
-notice unless it is glaringly wrong. We are human, after all. You
-might as well not give us a chance to make a mistake.
-
-Even if the problem you experience is a fatal signal, you should still
-say so explicitly. Suppose something strange is going on, such as,
-your copy of _GDBN__ is out of synch, or you have encountered a
-bug in the C library on your system. (This has happened!) Your copy
-might crash and ours would not. If you told us to expect a crash,
-then when ours fails to crash, we would know that the bug was not
-happening for us. If you had not told us to expect a crash, then we
-would not be able to draw any conclusion from our observations.
-
-@item
-If you wish to suggest changes to the _GDBN__ source, send us context
-diffs. If you even discuss something in the _GDBN__ source, refer to
-it by context, not by line number.
-
-The line numbers in our development sources won't match those in your
-sources. Your line numbers would convey no useful information to us.
-
-@end itemize
-
-Here are some things that are not necessary:
-
-@itemize @bullet
-@item
-A description of the envelope of the bug.
-
-Often people who encounter a bug spend a lot of time investigating
-which changes to the input file will make the bug go away and which
-changes will not affect it.
-
-This is often time consuming and not very useful, because the way we
-will find the bug is by running a single example under the debugger
-with breakpoints, not by pure deduction from a series of examples.
-We recommend that you save your time for something else.
-
-Of course, if you can find a simpler example to report @emph{instead}
-of the original one, that is a convenience for us. Errors in the
-output will be easier to spot, running under the debugger will take
-less time, etc.
-
-However, simplification is not vital; if you don't want to do this,
-report the bug anyway and send us the entire test case you used.
-
-@item
-A patch for the bug.
-
-A patch for the bug does help us if it is a good one. But don't omit
-the necessary information, such as the test case, on the assumption that
-a patch is all we need. We might see problems with your patch and decide
-to fix the problem another way, or we might not understand it at all.
-
-Sometimes with a program as complicated as _GDBN__ it is very hard to
-construct an example that will make the program follow a certain path
-through the code. If you don't send us the example, we won't be able
-to construct one, so we won't be able to verify that the bug is fixed.
-
-And if we can't understand what bug you are trying to fix, or why your
-patch should be an improvement, we won't install it. A test case will
-help us to understand.
-
-@item
-A guess about what the bug is or what it depends on.
-
-Such guesses are usually wrong. Even we can't guess right about such
-things without first using the debugger to find the facts.
-@end itemize
-
-@iftex
-@include rdl-apps.texi
-@end iftex
-
-@node Renamed Commands, Installing _GDBN__, _GDBN__ Bugs, Top
-@appendix Renamed Commands
-
-The following commands were renamed in _GDBN__ 4.0, in order to make the
-command set as a whole more consistent and easier to use and remember:
-
-@kindex add-syms
-@kindex delete environment
-@kindex info copying
-@kindex info convenience
-@kindex info directories
-@kindex info editing
-@kindex info history
-@kindex info targets
-@kindex info values
-@kindex info version
-@kindex info warranty
-@kindex set addressprint
-@kindex set arrayprint
-@kindex set prettyprint
-@kindex set screen-height
-@kindex set screen-width
-@kindex set unionprint
-@kindex set vtblprint
-@kindex set demangle
-@kindex set asm-demangle
-@kindex set sevenbit-strings
-@kindex set array-max
-@kindex set caution
-@kindex set history write
-@kindex show addressprint
-@kindex show arrayprint
-@kindex show prettyprint
-@kindex show screen-height
-@kindex show screen-width
-@kindex show unionprint
-@kindex show vtblprint
-@kindex show demangle
-@kindex show asm-demangle
-@kindex show sevenbit-strings
-@kindex show array-max
-@kindex show caution
-@kindex show history write
-@kindex unset
-
-@c TEXI2ROFF-KILL
-@ifinfo
-@c END TEXI2ROFF-KILL
-@example
-OLD COMMAND NEW COMMAND
-@c TEXI2ROFF-KILL
---------------- -------------------------------
-@c END TEXI2ROFF-KILL
-add-syms add-symbol-file
-delete environment unset environment
-info convenience show convenience
-info copying show copying
-info directories show directories
-info editing show commands
-info history show values
-info targets help target
-info values show values
-info version show version
-info warranty show warranty
-set/show addressprint set/show print address
-set/show array-max set/show print elements
-set/show arrayprint set/show print array
-set/show asm-demangle set/show print asm-demangle
-set/show caution set/show confirm
-set/show demangle set/show print demangle
-set/show history write set/show history save
-set/show prettyprint set/show print pretty
-set/show screen-height set/show height
-set/show screen-width set/show width
-set/show sevenbit-strings set/show print sevenbit-strings
-set/show unionprint set/show print union
-set/show vtblprint set/show print vtbl
-
-unset [No longer an alias for delete]
-@end example
-@c TEXI2ROFF-KILL
-@end ifinfo
-
-@tex
-\vskip \parskip\vskip \baselineskip
-\halign{\tt #\hfil &\qquad#&\tt #\hfil\cr
-{\bf Old Command} &&{\bf New Command}\cr
-add-syms &&add-symbol-file\cr
-delete environment &&unset environment\cr
-info convenience &&show convenience\cr
-info copying &&show copying\cr
-info directories &&show directories \cr
-info editing &&show commands\cr
-info history &&show values\cr
-info targets &&help target\cr
-info values &&show values\cr
-info version &&show version\cr
-info warranty &&show warranty\cr
-set{\rm / }show addressprint &&set{\rm / }show print address\cr
-set{\rm / }show array-max &&set{\rm / }show print elements\cr
-set{\rm / }show arrayprint &&set{\rm / }show print array\cr
-set{\rm / }show asm-demangle &&set{\rm / }show print asm-demangle\cr
-set{\rm / }show caution &&set{\rm / }show confirm\cr
-set{\rm / }show demangle &&set{\rm / }show print demangle\cr
-set{\rm / }show history write &&set{\rm / }show history save\cr
-set{\rm / }show prettyprint &&set{\rm / }show print pretty\cr
-set{\rm / }show screen-height &&set{\rm / }show height\cr
-set{\rm / }show screen-width &&set{\rm / }show width\cr
-set{\rm / }show sevenbit-strings &&set{\rm / }show print sevenbit-strings\cr
-set{\rm / }show unionprint &&set{\rm / }show print union\cr
-set{\rm / }show vtblprint &&set{\rm / }show print vtbl\cr
-\cr
-unset &&\rm(No longer an alias for delete)\cr
-}
-@end tex
-@c END TEXI2ROFF-KILL
-
-@node Installing _GDBN__, Copying, Renamed Commands, Top
-@appendix Installing _GDBN__
-@cindex configuring _GDBN__
-@cindex installation
-
-_GDBN__ comes with a @code{configure} script that automates the process
-of preparing _GDBN__ for installation; you can then use @code{make} to
-build the @code{_GDBP__} program.
-
-The _GDBP__ distribution includes all the source code you need for
-_GDBP__ in a single directory @file{gdb-_GDB_VN__}. That directory in turn
-contains:
-
-@table @code
-@item gdb-_GDB_VN__/configure @r{(and supporting files)}
-script for configuring _GDBN__ and all its supporting libraries.
-
-@item gdb-_GDB_VN__/gdb
-the source specific to _GDBN__ itself
-
-@item gdb-_GDB_VN__/bfd
-source for the Binary File Descriptor Library
-
-@item gdb-_GDB_VN__/include
-GNU include files
-
-@item gdb-_GDB_VN__/libiberty
-source for the @samp{-liberty} free software library
-
-@item gdb-_GDB_VN__/readline
-source for the GNU command-line interface
-@end table
-@noindent
-It is most convenient to run @code{configure} from the @file{gdb-_GDB_VN__}
-directory. The simplest way to configure and build _GDBN__ is the
-following:
-@example
-cd gdb-_GDB_VN__
-./configure @var{host}
-make
-@end example
-@noindent
-where @var{host} is something like @samp{sun4} or @samp{decstation}, that
-identifies the platform where _GDBN__ will run. This builds the three
-libraries @file{bfd}, @file{readline}, and @file{libiberty}, then
-@code{gdb} itself. The configured source files, and the binaries, are
-left in the corresponding source directories.
-
-@code{configure} is a Bourne-shell (@code{/bin/sh}) script; if your
-system doesn't recognize this automatically when you run a different
-shell, you may need to run @code{sh} on it explicitly:
-@samp{sh configure @var{host}}.
-
-You can @emph{run} the @code{configure} script from any of the
-subordinate directories in the _GDBN__ distribution (if you only want to
-configure that subdirectory); but be sure to specify a path to it. For
-example, to configure only the @code{bfd} subdirectory,
-@example
-@group
-cd gdb-_GDB_VN__/bfd
-../configure @var{host}
-@end group
-@end example
-
-You can install @code{_GDBP__} anywhere; it has no hardwired paths. However,
-you should make sure that the shell on your path (named by the
-@samp{SHELL} environment variable) is publicly readable; some systems
-refuse to let _GDBN__ debug child processes whose programs are not
-readable, and _GDBN__ uses the shell to start your program.
-
-@menu
-* Subdirectories:: Configuration subdirectories
-* Config Names:: Specifying names for hosts and targets
-* configure Options:: Summary of options for configure
-* Formatting Documentation:: How to format and print _GDBN__ documentation
-@end menu
-
-
-@node Subdirectories, Config Names, Installing _GDBN__, Installing _GDBN__
-@section Configuration Subdirectories
-If you want to run _GDBN__ versions for several host or target machines,
-you'll need a different _GDBP__ compiled for each combination of host
-and target. @code{configure} is designed to make this easy by allowing
-you to generate each configuration in a separate subdirectory. If your
-@code{make} program handles the @samp{VPATH} feature (GNU @code{make}
-does), running @code{make} in each of these directories then builds the
-_GDBP__ program specified there.
-
-@code{configure} creates these subdirectories for you when you
-simultaneously specify several configurations; but it's a good habit
-even for a single configuration. You can specify the use of
-subdirectories using the @samp{+subdirs} option (abbreviated
-@samp{+sub}). For example, you can build _GDBN__ this way on a Sun 4 as
-follows:
-
-@example
-@group
-cd gdb-_GDB_VN__
-./configure +sub sun4
-cd H-sun4/T-sun4
-make
-@end group
-@end example
-
-When @code{configure} uses subdirectories to build programs or
-libraries, it creates nested directories
-@file{H-@var{host}/T-@var{target}}. @code{configure} uses these two
-directory levels because _GDBN__ can be configured for cross-compiling:
-_GDBN__ can run on one machine (the host) while debugging programs that
-run on another machine (the target). You specify cross-debugging
-targets by giving the @samp{+target=@var{target}} option to
-@code{configure}. Specifying only hosts still gives you two levels of
-subdirectory for each host, with the same configuration suffix on both;
-that is, if you give any number of hosts but no targets, _GDBN__ will be
-configured for native debugging on each host. On the other hand,
-whenever you specify both hosts and targets on the same command line,
-@code{configure} creates all combinations of the hosts and targets you
-list.@refill
-
-If you run @code{configure} from a directory (notably,
-@file{gdb-_GDB_VN__}) that contains source directories for multiple
-libraries or programs, @code{configure} creates the
-@file{H-@var{host}/T-@var{target}} subdirectories in each library or
-program's source directory. For example, typing:
-@example
-cd gdb-_GDB_VN__
-configure sun4 +target=vxworks960
-@end example
-@noindent
-creates the following directories:
-@example
-gdb-_GDB_VN__/H-sun4/T-vxworks960
-gdb-_GDB_VN__/bfd/H-sun4/T-vxworks960
-gdb-_GDB_VN__/gdb/H-sun4/T-vxworks960
-gdb-_GDB_VN__/libiberty/H-sun4/T-vxworks960
-gdb-_GDB_VN__/readline/H-sun4/T-vxworks960
-@end example
-
-When you run @code{make} to build a program or library, you must run it
-in a configured directory. If you made a single configuration,
-without subdirectories, run @code{make} in the source directory.
-If you have @file{H-@var{host}/T-@var{target}} subdirectories,
-run @code{make} in those subdirectories.
-
-The @code{Makefile} generated by @code{configure} for each source
-directory runs recursively, so that typing @code{make} in
-@file{gdb-_GDB_VN__} (or in a
-@file{gdb-_GDB_VN__/H-@var{host}/T-@var{target}} subdirectory) builds
-all the required libraries, then _GDBN__.@refill
-
-When you have multiple hosts or targets configured, you can run
-@code{make} on them in parallel (for example, if they are NFS-mounted on
-each of the hosts); they will not interfere with each other.
-
-You can also use the @samp{+objdir=@var{altroot}} option to have the
-configured files placed in a parallel directory structure rather than
-alongside the source files; @pxref{configure Options}.
-
-@node Config Names, configure Options, Subdirectories, Installing _GDBN__
-@section Specifying Names for Hosts and Targets
-
-The specifications used for hosts and targets in the @code{configure}
-script are based on a three-part naming scheme, but some short predefined
-aliases are also supported. The full naming scheme encodes three pieces
-of information in the following pattern:
-@example
-@var{architecture}-@var{vendor}-@var{os}
-@end example
-
-For example, you can use the alias @code{sun4} as a @var{host} argument
-or in a @code{+target=@var{target}} option, but the equivalent full name
-is @samp{sparc-sun-sunos4}.
-
-The following table shows all the architectures, hosts, and OS prefixes
-that @code{configure} recognizes in _GDBN__ _GDB_VN__. Entries in the ``OS
-prefix'' column ending in a @samp{*} may be followed by a release number.
-
-@c TEXI2ROFF-KILL
-@ifinfo
-@c END TEXI2ROFF-KILL
-@example
-
-ARCHITECTURE VENDOR OS prefix
-@c TEXI2ROFF-KILL
-------------+--------------------------+---------------------------
-@c END TEXI2ROFF-KILL
- | |
- 580 | altos hp | aix* msdos*
- a29k | amd ibm | amigados newsos*
- alliant | amdahl intel | aout nindy*
- arm | aout isi | bout osf*
- c1 | apollo little | bsd* sco*
- c2 | att mips | coff sunos*
- cray2 | bcs motorola | ctix* svr4
- h8300 | bout ncr | dgux* sym*
- i386 | bull next | dynix* sysv*
- i860 | cbm nyu | ebmon ultrix*
- i960 | coff sco | esix* unicos*
- m68000 | convergent sequent | hds unos*
- m68k | convex sgi | hpux* uts
- m88k | cray sony | irix* v88r*
- mips | dec sun | isc* vms*
- ns32k | encore unicom | kern vxworks*
- pyramid | gould utek | mach*
- romp | hitachi wrs |
- rs6000 | |
- sparc | |
- tahoe | |
- tron | |
- vax | |
- xmp | |
- ymp | |
-@end example
-@c TEXI2ROFF-KILL
-@end ifinfo
-@tex
-%\vskip\parskip
-\vskip \baselineskip
-\hfil\vbox{\offinterlineskip
-\halign{\strut\tt #\hfil\ &\vrule#&\strut\ \tt #\hfil\ &\strut\ \tt #\hfil
-\ &\vrule#&\strut\ \tt #\hfil\ &\strut\ \tt #\hfil \cr
-{\bf Architecture} &&{\bf Vendor} &&&{\bf OS prefix}\cr
-\multispan7\hrulefill\cr
- 580 && altos & hp && aix* & msdos* \cr
- a29k && amd & ibm && amigados & newsos* \cr
- alliant && amdahl & intel && aout & nindy* \cr
- arm && aout & isi && bout & osf* \cr
- c1 && apollo & little && bsd* & sco* \cr
- c2 && att & mips && coff & sunos* \cr
- cray2 && bcs & motorola && ctix* & svr4 \cr
- h8300 && bout & ncr && dgux* & sym* \cr
- i386 && bull & next && dynix* & sysv* \cr
- i860 && cbm & nyu && ebmon & ultrix* \cr
- i960 && coff & sco && esix* & unicos* \cr
- m68000 && convergent& sequent && hds & unos* \cr
- m68k && convex & sgi && hpux* & uts \cr
- m88k && cray & sony && irix* & v88r* \cr
- mips && dec & sun && isc* & vms* \cr
- ns32k && encore & unicom && kern & vxworks* \cr
- pyramid && gould & utek && mach* & \cr
- romp && hitachi & wrs && & \cr
- rs6000 && & && & \cr
- sparc && & && & \cr
- tahoe && & && & \cr
- tron && & && & \cr
- vax && & && & \cr
- xmp && & && & \cr
- ymp && & && & \cr
-}\hfil}
-@end tex
-@c END TEXI2ROFF-KILL
-@quotation
-@emph{Warning:} Many combinations of architecture, vendor, and OS are
-untested.
-@end quotation
-
-The @code{configure} script accompanying _GDBN__ _GDB_VN__ does not provide
-any query facility to list all supported host and target names or
-aliases. @code{configure} calls the Bourne shell script
-@code{config.sub} to map abbreviations to full names; you can read the
-script, if you wish, or you can use it to test your guesses on
-abbreviations---for example:
-@example
-% sh config.sub sun4
-sparc-sun-sunos4
-% sh config.sub sun3
-m68k-sun-sunos4
-% sh config.sub decstation
-mips-dec-ultrix
-% sh config.sub hp300bsd
-m68k-hp-bsd
-% sh config.sub i386v
-i386-none-sysv
-% sh config.sub i486v
-*** Configuration "i486v" not recognized
-@end example
-@noindent
-@code{config.sub} is also distributed in the directory @file{gdb-_GDB_VN__}.
-
-@node configure Options, Formatting Documentation, Config Names, Installing _GDBN__
-@section @code{configure} Options
-
-Here is a summary of all the @code{configure} options and arguments that
-you might use for building _GDBN__:
-
-@example
-configure @r{[}+destdir=@var{dir}@r{]} @r{[}+subdirs@r{]}
- @r{[}+objdir=@var{altroot}@r{]} @r{[}+norecursion@r{]} @r{[}+rm@r{]}
- @r{[}+target=@var{target}@dots{}@r{]} @var{host}@dots{}
-@end example
-@noindent
-You may introduce options with the character @samp{-} rather than
-@samp{+} if you prefer; but you may abbreviate option names if you use
-@samp{+}.
-
-@table @code
-@item +destdir=@var{dir}
-@var{dir} is an installation directory @emph{path prefix}. After you
-configure with this option, @code{make install} will install _GDBN__ as
-@file{@var{dir}/bin/_GDBP__}, and the libraries in @file{@var{dir}/lib}.
-If you specify @samp{+destdir=/usr/local}, for example, @code{make
-install} creates @file{/usr/local/bin/gdb}.@refill
-
-@item +subdirs
-Write configuration specific files in subdirectories of the form
-@example
-H-@var{host}/T-@var{target}
-@end example
-@noindent
-(and configure the @code{Makefile} to generate object code in
-subdirectories of this form as well). Without this option, if you
-specify only one configuration for _GDBN__, @code{configure} will use
-the same directory for source, configured files, and binaries. This
-option is used automatically if you specify more than one @var{host} or
-more than one @samp{+target=@var{target}} option on the @code{configure}
-command line.
-
-@item +norecursion
-Configure only the directory where @code{configure} is executed; do not
-propagate configuration to subdirectories.
-
-@item +objdir=@var{altroot}
-@var{altroot} is an alternative directory used as the root for
-configured files. @code{configure} will create directories under
-@var{altroot} in parallel to the source directories. If you use
-@samp{+objdir=@var{altroot}} with @samp{+subdirs}, @code{configure} also
-builds the @samp{H-@var{host}/T-@var{target}} subdirectories in the
-directory tree rooted in @var{altroot}.
-
-
-@item +rm
-Remove the configuration that the other arguments specify.
-
-@c This doesn't work (yet if ever). FIXME.
-@c @item +parse=@var{lang} @dots{}
-@c Configure the _GDBN__ expression parser to parse the listed languages.
-@c @samp{all} configures _GDBN__ for all supported languages. To get a
-@c list of all supported languages, omit the argument. Without this
-@c option, _GDBN__ is configured to parse all supported languages.
-
-@item +target=@var{target} @dots{}
-Configure _GDBN__ for cross-debugging programs running on each specified
-@var{target}. You may specify as many @samp{+target} options as you
-wish. Without this option, _GDBN__ is configured to debug programs that
-run on the same machine (@var{host}) as _GDBN__ itself.
-
-There is no convenient way to generate a list of all available targets.
-
-@item @var{host} @dots{}
-Configure _GDBN__ to run on each specified @var{host}. You may specify as
-many host names as you wish.
-
-There is no convenient way to generate a list of all available hosts.
-@end table
-
-@noindent
-@code{configure} accepts other options, for compatibility with
-configuring other GNU tools recursively; but these are the only
-options that affect _GDBN__ or its supporting libraries.
-
-@node Formatting Documentation, , configure Options, Installing _GDBN__
-@section Formatting the Documentation
-
-@cindex _GDBN__ reference card
-@cindex reference card
-The _GDBN__ _GDB_VN__ release includes an already-formatted reference card,
-ready for printing on a PostScript printer, as @file{gdb-_GDB_VN__/gdb/refcard.ps}.
-It uses the most common PostScript fonts: the Times family, Courier, and
-Symbol. If you have a PostScript printer, you can print the reference
-card by just sending @file{refcard.ps} to the printer.
-
-The release also includes the online Info version of this manual already
-formatted: the main Info file is @file{gdb-_GDB_VN__/gdb/gdb.info}, and it
-refers to subordinate files matching @samp{gdb.info*} in the same
-directory.
-
-If you want to make these Info files yourself from the _GDBN__ manual's
-source, you need the GNU @code{makeinfo} program. Once you have it, you
-can type
-@example
-cd gdb-_GDB_VN__/gdb
-make gdb.info
-@end example
-@noindent
-to make the Info file.
-
-If you want to format and print copies of the manual, you need several
-things:
-@itemize @bullet
-@item
-@TeX{}, the public domain typesetting program written by Donald Knuth,
-must be installed on your system and available through your execution
-path.
-@item
-@file{gdb-_GDB_VN__/texinfo}: @TeX{} macros defining the GNU
-Documentation Format.
-@item
-@emph{A @sc{dvi} output program.} @TeX{} doesn't actually make marks on
-paper; it produces output files called @sc{dvi} files. If your system
-has @TeX{} installed, chances are it has a program for printing out
-these files; one popular example is @code{dvips}, which can print
-@sc{dvi} files on PostScript printers.
-@end itemize
-@noindent
-Once you have these things, you can type
-@example
-cd gdb-_GDB_VN__/gdb
-make gdb.dvi
-@end example
-@noindent
-to format the text of this manual, and print it with the usual output
-method for @TeX{} @sc{dvi} files at your site.
-
-If you want to print the reference card, but don't have a PostScript
-printer, or you want to use Computer Modern fonts instead,
-you can still print it if you have @TeX{}. Format the reference card by typing
-@example
-cd gdb-_GDB_VN__/gdb
-make refcard.dvi
-@end example
-@noindent
-
-The _GDBN__ reference card is designed to print in landscape mode on US
-``letter'' size paper; that is, on a sheet 11 inches wide by 8.5 inches
-high. You will need to specify this form of printing as an option to
-your @sc{dvi} output program.
-
-
-@node Copying, Index, Installing _GDBN__, Top
-@unnumbered GNU GENERAL PUBLIC LICENSE
-@center Version 2, June 1991
-
-@display
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
-675 Mass Ave, Cambridge, MA 02139, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@unnumberedsec Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software---to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
-@iftex
-@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end iftex
-@ifinfo
-@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end ifinfo
-
-@enumerate
-@item
-This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The ``Program'', below,
-refers to any such program or work, and a ``work based on the Program''
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term ``modification''.) Each licensee is addressed as ``you''.
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-@item
-You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-@item
-You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-@alphaenumerate
-@item
-You must cause the modified files to carry prominent notices
-stating that you changed the files and the date of any change.
-
-@item
-You must cause any work that you distribute or publish, that in
-whole or in part contains or is derived from the Program or any
-part thereof, to be licensed as a whole at no charge to all third
-parties under the terms of this License.
-
-@item
-If the modified program normally reads commands interactively
-when run, you must cause it, when started running for such
-interactive use in the most ordinary way, to print or display an
-announcement including an appropriate copyright notice and a
-notice that there is no warranty (or else, saying that you provide
-a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this
-License. (Exception: if the Program itself is interactive but
-does not normally print such an announcement, your work based on
-the Program is not required to print an announcement.)
-@end alphaenumerate
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-@item
-You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-@alphaenumerate
-@item
-Accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of Sections
-1 and 2 above on a medium customarily used for software interchange; or,
-
-@item
-Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
-cost of physically performing source distribution, a complete
-machine-readable copy of the corresponding source code, to be
-distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-
-@item
-Accompany it with the information you received as to the offer
-to distribute corresponding source code. (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form with such
-an offer, in accord with Subsection b above.)
-@end alphaenumerate
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-@item
-You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-@item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-@item
-If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-@item
-If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-@item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-@item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-@iftex
-@heading NO WARRANTY
-@end iftex
-@ifinfo
-@center NO WARRANTY
-@end ifinfo
-
-@item
-BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-@item
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-@end enumerate
-
-@iftex
-@heading END OF TERMS AND CONDITIONS
-@end iftex
-@ifinfo
-@center END OF TERMS AND CONDITIONS
-@end ifinfo
-
-@page
-@unnumberedsec Applying These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the ``copyright'' line and a pointer to where the full notice is found.
-
-@smallexample
-@var{one line to give the program's name and an idea of what it does.}
-Copyright (C) 19@var{yy} @var{name of author}
-
-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., 675 Mass Ave,
-Cambridge, MA 02139, USA.
-@end smallexample
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-@smallexample
-Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
-type `show w'. This is free software, and you are welcome
-to redistribute it under certain conditions; type `show c'
-for details.
-@end smallexample
-
-The hypothetical commands @samp{show w} and @samp{show c} should show
-the appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than @samp{show w} and
-@samp{show c}; they could even be mouse-clicks or menu items---whatever
-suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a ``copyright disclaimer'' for the program, if
-necessary. Here is a sample; alter the names:
-
-@smallexample
-Yoyodyne, Inc., hereby disclaims all copyright interest in
-the program `Gnomovision' (which makes passes at compilers)
-written by James Hacker.
-
-@var{signature of Ty Coon}, 1 April 1989
-Ty Coon, President of Vice
-@end smallexample
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
-@node Index, , Copying, Top
-@unnumbered Index
-
-@printindex cp
-
-@tex
-% I think something like @colophon should be in texinfo. In the
-% meantime:
-\long\def\colophon{\hbox to0pt{}\vfill
-\centerline{The body of this manual is set in}
-\centerline{\fontname\tenrm,}
-\centerline{with headings in {\bf\fontname\tenbf}}
-\centerline{and examples in {\tt\fontname\tentt}.}
-\centerline{{\it\fontname\tenit\/} and}
-\centerline{{\sl\fontname\tensl\/}}
-\centerline{are used for emphasis.}\vfill}
-\page\colophon
-% Blame: pesch@cygnus.com, 28mar91.
-@end tex
-
-@contents
-@bye
diff --git a/gdb/doc/gdb.tgts-m4 b/gdb/doc/gdb.tgts-m4
deleted file mode 100755
index f3bee50..0000000
--- a/gdb/doc/gdb.tgts-m4
+++ /dev/null
@@ -1,192 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@node Targets, Controlling _GDBN__, _GDBN__ Files, Top
-@chapter Specifying a Debugging Target
-@cindex debugging target
-@kindex target
-A @dfn{target} is an interface between the debugger and a particular
-kind of file or process.
-
-Often, you will be able to run _GDBN__ in the same host environment as the
-program you are debugging; in that case, the debugging target can just be
-specified as a side effect of the @code{file} or @code{core} commands.
-When you need more flexibility---for example, running _GDBN__ on a
-physically separate host, controlling standalone systems over a
-serial port, or realtime systems over a TCP/IP connection---you can use
-the @code{target} command.
-
-@menu
-* Active Targets:: Active Targets
-* Target Commands:: Commands for Managing Targets
-* Remote:: Remote Debugging
-@end menu
-
-@node Active Targets, Target Commands, Targets, Targets
-@section Active Targets
-@cindex stacking targets
-@cindex active targets
-@cindex multiple targets
-
-Targets are managed in three @dfn{strata} that correspond to different
-classes of target: processes, core files, and executable files. This
-allows you to (for example) start a process and inspect its activity
-without abandoning your work on a core file.
-
-More than one target can potentially respond to a request. In
-particular, when you access memory _GDBN__ will examine the three strata of
-targets until it finds a target that can handle that particular address.
-Strata are always examined in a fixed order: first a process if there is
-one, then a core file if there is one, and finally an executable file if
-there is one of those.
-
-When you specify a new target in a given stratum, it replaces any target
-previously in that stratum.
-
-To get rid of a target without replacing it, use the @code{detach}
-command. The related command @code{attach} provides you with a way of
-choosing a particular running process as a new target. @xref{Attach}.
-
-@node Target Commands, Remote, Active Targets, Targets
-@section Commands for Managing Targets
-
-@table @code
-@item target @var{type} @var{parameters}
-Connects the _GDBN__ host environment to a target machine or process. A
-target is typically a protocol for talking to debugging facilities. You
-use the argument @var{type} to specify the type or protocol of the
-target machine.
-
-Further @var{parameters} are interpreted by the target protocol, but
-typically include things like device names or host names to connect
-with, process numbers, and baud rates.
-
-The @code{target} command will not repeat if you press @key{RET} again
-after executing the command.
-
-@item help target
-@kindex help target
-Displays the names of all targets available. To display targets
-currently selected, use either @code{info target} or @code{info files}
-(@pxref{Files}).
-
-@item help target @var{name}
-Describe a particular target, including any parameters necessary to
-select it.
-@end table
-
-Here are some common targets (available, or not, depending on the _GDBN__
-configuration):
-
-@table @code
-@item target exec @var{prog}
-@kindex target exec
-An executable file. @samp{target exec @var{prog}} is the same as
-@samp{exec-file @var{prog}}.
-
-@item target core @var{filename}
-@kindex target core
-A core dump file. @samp{target core @var{filename}} is the same as
-@samp{core-file @var{filename}}.
-
-@item target remote @var{dev}
-@kindex target remote
-Remote serial target in _GDBN__-specific protocol. The argument @var{dev}
-specifies what serial device to use for the connection (e.g.
-@file{/dev/ttya}). @xref{Remote}.
-
-_if__(_AMD29K__)
-@item target amd-eb @var{dev} @var{speed} @var{PROG}
-@kindex target amd-eb
-@cindex AMD EB29K
-Remote PC-resident AMD EB29K board, attached over serial lines.
-@var{dev} is the serial device, as for @code{target remote};
-@var{speed} allows you to specify the linespeed; and @var{PROG} is the
-name of the program to be debugged, as it appears to DOS on the PC.
-@xref{EB29K Remote}.
-
-_fi__(_AMD29K__)
-_if__(_I960__)
-@item target nindy @var{devicename}
-@kindex target nindy
-An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is
-the name of the serial device to use for the connection, e.g.
-@file{/dev/ttya}. @xref{i960-Nindy Remote}.
-
-_fi__(_I960__)
-_if__(_VXWORKS__)
-@item target vxworks @var{machinename}
-@kindex target vxworks
-A VxWorks system, attached via TCP/IP. The argument @var{machinename}
-is the target system's machine name or IP address.
-@xref{VxWorks Remote}.
-_fi__(_VXWORKS__)
-@end table
-
-_if__(_GENERIC__)
-Different targets are available on different configurations of _GDBN__; your
-configuration may have more or fewer targets.
-_fi__(_GENERIC__)
-
-@node Remote, , Target Commands, Targets
-@section Remote Debugging
-@cindex remote debugging
-
-_if__(_GENERIC__)
-@menu
-_include__(gdb.inv.m-m4)<>_dnl__
-@end menu
-_fi__(_GENERIC__)
-
-If you are trying to debug a program running on a machine that can't run
-_GDBN__ in the usual way, it is often useful to use remote debugging. For
-example, you might use remote debugging on an operating system kernel, or on
-a small system which does not have a general purpose operating system
-powerful enough to run a full-featured debugger.
-
-Some configurations of _GDBN__ have special serial or TCP/IP interfaces
-to make this work with particular debugging targets. In addition,
-_GDBN__ comes with a generic serial protocol (specific to _GDBN__, but
-not specific to any particular target system) which you can use if you
-write the remote stubs---the code that will run on the remote system to
-communicate with _GDBN__.
-
-To use the _GDBN__ remote serial protocol, the program to be debugged on
-the remote machine needs to contain a debugging stub which talks to
-_GDBN__ over the serial line. Several working remote stubs are
-distributed with _GDBN__; see the @file{README} file in the _GDBN__
-distribution for more information.
-
-For details of this communication protocol, see the comments in the
-_GDBN__ source file @file{remote.c}.
-
-To start remote debugging, first run _GDBN__ and specify as an executable file
-the program that is running in the remote machine. This tells _GDBN__ how
-to find the program's symbols and the contents of its pure text. Then
-establish communication using the @code{target remote} command with a device
-name as an argument. For example:
-
-@example
-target remote /dev/ttyb
-@end example
-
-@noindent
-if the serial line is connected to the device named @file{/dev/ttyb}. This
-will stop the remote machine if it is not already stopped.
-
-Now you can use all the usual commands to examine and change data and to
-step and continue the remote program.
-
-To resume the remote program and stop debugging it, use the @code{detach}
-command.
-
-Other remote targets may be available in your
-configuration of _GDBN__; use @code{help targets} to list them.
-
-_if__(_GENERIC__)
-_include__(gdb.inv.s-m4)
-@c Text on starting up GDB in various specific cases; it goes up front
-@c in manuals configured for any of those particular situations, here
-@c otherwise.
-_fi__(_GENERIC__)
diff --git a/gdb/doc/gdb.top-m4 b/gdb/doc/gdb.top-m4
deleted file mode 100755
index f17e305..0000000
--- a/gdb/doc/gdb.top-m4
+++ /dev/null
@@ -1,451 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT: $Id$
-@c
-@syncodeindex ky cp
-@c FOR UPDATES LEADING TO THIS DRAFT, GDB CHANGELOG CONSULTED BETWEEN:
-@c Sun May 19 05:36:59 1991 John Gilmore (gnu at cygint.cygnus.com)
-@c Sat Dec 22 02:51:40 1990 John Gilmore (gnu at cygint)
-@ifinfo
-This file documents the GNU debugger _GDBN__.
-
-Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
-@end ifinfo
-@smallbook
-@setchapternewpage odd
-_if__(_GENERIC__)
-@settitle Using _GDBN__ (v4.0)
-_fi__(_GENERIC__)
-_if__(!_GENERIC__)
-@settitle Using _GDBN__ v4.0 (_HOST__)
-_fi__(!_GENERIC__)
-@iftex
-@finalout
-@end iftex
-@titlepage
-@title{Using _GDBN__}
-@subtitle{A Guide to the GNU Source-Level Debugger}
-_if__(!_GENERIC__)
-@subtitle{On _HOST__ Systems}
-_fi__(!_GENERIC__)
-@sp 1
-@c Maybe crank this up to "Fourth Edition" when released at FSF
-@c @subtitle Third Edition---_GDBN__ version 4.0
-@subtitle _GDBN__ version 4.0
-@subtitle May 1991
-@author{Richard M. Stallman@qquad @hfill Free Software Foundation}
-@author{Roland H. Pesch@qquad @hfill Cygnus Support}
-@page
-@tex
-{\parskip=0pt
-\hfill rms\@ai.mit.edu, pesch\@cygnus.com\par
-\hfill {\it Using _GDBN__}, \manvers\par
-\hfill \TeX{}info \texinfoversion\par
-}
-@end tex
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
-@end titlepage
-@page
-
-@node Top, Summary, (dir), (dir)
-@ifinfo
-This file describes version 4.0 of GDB, the GNU symbolic debugger.
-@end ifinfo
-
-@menu
-* Summary:: Summary of _GDBN__
-* New Features:: New Features in _GDBN__ version 4.0
-* Sample Session:: A Sample _GDBN__ Session
-* Invocation:: Getting In and Out of _GDBN__
-* Commands::
-* Running:: Running Programs Under _GDBN__
-* Stopping:: Stopping and Continuing
-* Stack:: Examining the Stack
-* Source:: Examining Source Files
-* Data:: Examining Data
-* Symbols:: Examining the Symbol Table
-* Altering:: Altering Execution
-* _GDBN__ Files::
-* Targets:: Specifying a Debugging Target
-* Controlling _GDBN__:: Controlling _GDBN__
-* Sequences:: Canned Sequences of Commands
-* Emacs:: Using _GDBN__ under GNU Emacs
-* _GDBN__ Bugs:: Reporting Bugs in _GDBN__
-* Renamed Commands::
-* Installing _GDBN__:: Installing _GDBN__
-* Copying:: GNU GENERAL PUBLIC LICENSE
-* Index:: Index
- --- The Detailed Node Listing ---
-
-Summary of _GDBN__
-
-* Free Software:: Free Software
-* Contributors:: Contributors to _GDBN__
-
-Getting In and Out of _GDBN__
-
-* Starting _GDBN__:: Starting _GDBN__
-* Leaving _GDBN__:: Leaving _GDBN__
-* Shell Commands:: Shell Commands
-
-Starting _GDBN__
-
-* File Options:: Choosing Files
-* Mode Options:: Choosing Modes
-
-_GDBN__ Commands
-
-* Command Syntax:: Command Syntax
-* Help:: Getting Help
-
-Running Programs Under _GDBN__
-
-* Compilation:: Compiling for Debugging
-* Starting:: Starting your Program
-* Arguments:: Your Program's Arguments
-* Environment:: Your Program's Environment
-* Working Directory:: Your Program's Working Directory
-* Input/Output:: Your Program's Input and Output
-* Attach:: Debugging an Already-Running Process
-* Kill Process:: Killing the Child Process
-
-Stopping and Continuing
-
-* Breakpoints:: Breakpoints, Watchpoints, and Exceptions
-* Stepping:: Stepping
-* Continuing:: Continuing
-* Signals:: Signals
-
-Breakpoints, Watchpoints, and Exceptions
-
-* Set Breaks:: Setting Breakpoints
-* Set Watchpoints:: Setting Watchpoints
-* Exception Handling:: Breakpoints and Exceptions
-* Delete Breaks:: Deleting Breakpoints
-* Disabling:: Disabling Breakpoints
-* Conditions:: Break Conditions
-* Break Commands:: Breakpoint Command Lists
-* Breakpoint Menus:: Breakpoint Menus
-* Error in Breakpoints::
-
-Examining the Stack
-
-* Frames:: Stack Frames
-* Backtrace:: Backtraces
-* Selection:: Selecting a Frame
-* Frame Info:: Information on a Frame
-
-Examining Source Files
-
-* List:: Printing Source Lines
-* Search:: Searching Source Files
-* Source Path:: Specifying Source Directories
-* Machine Code:: Source and Machine Code
-
-Examining Data
-
-* Expressions:: Expressions
-* Variables:: Program Variables
-* Arrays:: Artificial Arrays
-* Output formats:: Output formats
-* Memory:: Examining Memory
-* Auto Display:: Automatic Display
-* Print Settings:: Print Settings
-* Value History:: Value History
-* Convenience Vars:: Convenience Variables
-* Registers:: Registers
-* Floating Point Hardware:: Floating Point Hardware
-
-Altering Execution
-
-* Assignment:: Assignment to Variables
-* Jumping:: Continuing at a Different Address
-* Signaling:: Giving the Program a Signal
-* Returning:: Returning from a Function
-* Calling:: Calling your Program's Functions
-
-_GDBN__'s Files
-
-* Files:: Commands to Specify Files
-* Symbol Errors:: Errors Reading Symbol Files
-
-Specifying a Debugging Target
-
-* Active Targets:: Active Targets
-* Target Commands:: Commands for Managing Targets
-* Remote:: Remote Debugging
-
-Remote Debugging
-
-* i960-Nindy Remote::
-* EB29K Remote::
-* VxWorks Remote::
-
-_GDBN__ with a Remote i960 (Nindy)
-
-* Nindy Startup:: Startup with Nindy
-* Nindy Options:: Options for Nindy
-* Nindy reset:: Nindy Reset Command
-
-_GDBN__ with a Remote EB29K
-
-* Comms (EB29K):: Communications Setup
-* gdb-EB29K:: EB29K cross-debugging
-* Remote Log:: Remote Log
-
-_GDBN__ and VxWorks
-
-* VxWorks connection:: Connecting to VxWorks
-* VxWorks download:: VxWorks Download
-* VxWorks attach:: Running Tasks
-
-Controlling _GDBN__
-
-* Prompt:: Prompt
-* Editing:: Command Editing
-* History:: Command History
-* Screen Size:: Screen Size
-* Numbers:: Numbers
-* Messages/Warnings:: Optional Warnings and Messages
-
-Canned Sequences of Commands
-
-* Define:: User-Defined Commands
-* Command Files:: Command Files
-* Output:: Commands for Controlled Output
-
-Reporting Bugs in _GDBN__
-
-* Bug Criteria:: Have You Found a Bug?
-* Bug Reporting:: How to Report Bugs
-@end menu
-
-@node Summary, New Features, Top, Top
-@unnumbered Summary of _GDBN__
-
-The purpose of a debugger such as _GDBN__ is to allow you to see what is
-going on ``inside'' another program while it executes---or what another
-program was doing at the moment it crashed.
-
-_GDBN__ can do four main kinds of things (plus other things in support of
-these) to help you catch bugs in the act:
-
-@itemize @bullet
-@item
-Start your program, specifying anything that might affect its behavior.
-
-@item
-Make your program stop on specified conditions.
-
-@item
-Examine what has happened, when your program has stopped.
-
-@item
-Change things in your program, so you can experiment with correcting the
-effects of one bug and go on to learn about another.
-@end itemize
-
-_GDBN__ can be used to debug programs written in C and C++. Pascal support
-is being implemented, and Fortran support will be added when a GNU
-Fortran compiler is ready.
-
-@menu
-* Free Software:: Free Software
-* Contributors:: Contributors to GDB
-@end menu
-
-@node Free Software, Contributors, Summary, Summary
-@unnumberedsec Free Software
-_GDBN__ is @dfn{free software}, protected by the GNU General Public License (GPL).
-The GPL gives you the freedom to copy or adapt a licensed
-program---but every person getting a copy also gets with it the
-freedom to modify that copy (which means that they must get access to
-the source code), and the freedom to distribute further copies.
-Typical software companies use copyrights to limit your freedoms; the
-Free Software Foundation uses the GPL to preserve these freedoms.
-
-Fundamentally, the General Public License is a license which says that
-you have these freedoms and that you can't take these freedoms away
-from anyone else.
-
-@c FIXME: (passim) go through all xrefs, expanding to use text headings
-For full details, @pxref{Copying}.
-@node Contributors, , Free Software, Summary
-@unnumberedsec Contributors to GDB
-
-Richard Stallman was the original author of GDB, as with many GNU
-programs. Many others have contributed to its development. This
-section attempts to credit major contributors. One of the virtues of
-free software is that everyone is free to contribute to it; with
-regret, we cannot actually acknowledge everyone here. The file
-@file{ChangeLog} in the GDB distribution approximates a blow-by-blow
-account.
-
-Changes much prior to version 2.0 are lost in the mists of time.
-
-@quotation
-@emph{Plea:} Additions to this section are particularly welcome. If you
-or your friends (or enemies; let's be evenhanded) have been unfairly
-omitted from this list, we would like to add your names!
-@end quotation
-
-So that they may not regard their long labor as thankless, we
-particularly thank those who shepherded GDB through major releases:
-John Gilmore (release 4.0); Jim Kingdon (releases 3.9, 3.5, 3.4, 3.3);
-and Randy Smith (releases 3.2, 3.1, 3.0). As major maintainer of GDB
-for some period, each contributed significantly to the structure,
-stability, and capabilities of the entire debugger.
-
-Richard Stallman, assisted at various times by Pete TerMaat, Chris
-Hanson, and Richard Mlynarik, handled releases through 2.8.
-
-Michael Tiemann is the author of most of the GNU C++ support in GDB,
-with significant additional contributions from Per Bothner. James
-Clark wrote the GNU C++ demangler. Early work on C++ was by Peter
-TerMaat (who also did much general update work leading to release 3.0).
-
-GDB 4.0 uses the BFD subroutine library to examine multiple
-object-file formats; BFD was a joint project of V. Gumby
-Henkel-Wallace, Rich Pixley, Steve Chamberlain, and John Gilmore.
-
-David Johnson wrote the original COFF support; Pace Willison did
-the original support for encapsulated COFF.
-
-Adam de Boor and Bradley Davis contributed the ISI Optimum V support.
-Per Bothner, Noboyuki Hikichi, and Alessandro Forin contributed MIPS
-support. Jean-Daniel Fekete contributed Sun 386i support. Chris
-Hanson improved the HP9000 support. Noboyuki Hikichi and Tomoyuki
-Hasei contributed Sony/News OS 3 support. David Johnson contributed
-Encore Umax support. Jyrki Kuoppala contributed Altos 3068 support.
-Keith Packard contributed NS32K support. Doug Rabson contributed
-Acorn Risc Machine support. Chris Smith contributed Convex support
-(and Fortran debugging). Jonathan Stone contributed Pyramid support.
-Michael Tiemann contributed SPARC support. Tim Tucker contributed
-support for the Gould NP1 and Gould Powernode. Pace Willison
-contributed Intel 386 support. Jay Vosburgh contributed Symmetry
-support.
-
-Rich Schaefer helped with support of SunOS shared libraries.
-
-Jay Fenlason and Roland McGrath ensured that GDB and GAS agree about
-several machine instruction sets.
-
-Patrick Duval, Ted Goldstein, Vikram Koka and Glenn Engel helped
-develop remote debugging. Intel Corporation and Wind River Systems
-contributed remote debugging modules for their products.
-
-Brian Fox is the author of the readline libraries providing
-command-line editing and command history.
-
-@node New Features, Sample Session, Summary, Top
-@unnumbered New Features since _GDBN__ version 3.5
-
-@table @emph
-@item Targets
-Using the new command @code{target}, you can select at runtime whether
-you are debugging local files, local processes, standalone systems over
-a serial port, realtime systems over a TCP/IP connection, etc.
-Internally, _GDBN__ now uses a function vector to mediate access to
-different targets; if you need to add your own support for a remote
-protocol, this makes it much easier.
-
-@item Watchpoints
-_GDBN__ now sports watchpoints as well as breakpoints. You can use a
-watchpoint to stop execution whenever the value of an expression
-changes, without having to predict a particular place in your program
-where this may happen.
-
-@item Object Code Formats
-_GDBN__ uses a new scheme called Binary File Descriptors (BFD) to permit
-it to switch dynamically, without reconfiguration or recompilation,
-between different object-file formats. Formats currently supported are
-COFF, a.out, and the Intel 960 b.out; files may be read as .o's, archive
-libraries, or core dumps. BFD is available as a subroutine library so
-that other programs may take advantage of it, and the other GNU binary
-utilities are being converted to use it.
-
-@item Configuration
-Compile-time configuration (to select a particular architecture and
-operating system) is much easier. The script @code{config.gdb} now
-handles specification of separate host and target configurations.
-
-@item Interaction
-The user interface to _GDBN__'s control variables has been simplified
-and consolidated in two commands, @code{set} and @code{show}. Output
-lines are now broken at readable places, rather than overflowing onto
-the next line. You can suppress output of machine-level addresses,
-displaying only source language information.
-
-
-@item Source Language
-_GDBN__ now has limited support for C++ exception handling: _GDBN__ can
-break when an exception is raised, before the stack is peeled back to
-the exception handler's context.
-
-@item Command Rationalization
-Many _GDBN__ commands have been renamed to make them easier to remember
-and use. In particular, the subcommands of @code{info} and
-@code{show}/@code{set} are grouped to make the former refer to the state
-of your program, and the latter refer to the state of _GDBN__ itself.
-@xref{Renamed Commands}, for details on what commands were renamed.
-
-@item Ports
-_GDBN__ has been ported to the following new architectures: AT&T 3b1,
-Acorn RISC machine, HP300 running HPUX, big- and little-endian MIPS
-machines, Motorola 88k, Sun 386i, and Sun 3 running SunOS 4. In
-addition, the following are supported as targets only: AMD 29k, Intel
-960, and Wind River's VxWorks.
-
-@item Shared Libraries
-_GDBN__ 4.0 supports SunOS shared libraries.
-
-@item Work in Progress
-Kernel debugging for BSD and Mach systems; Tahoe and HPPA architecture
-support.
-
-@end table
-
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
deleted file mode 100644
index a7ce163..0000000
--- a/gdb/doc/gdbint.texinfo
+++ /dev/null
@@ -1,802 +0,0 @@
-\input texinfo
-@setfilename gdbint.info
-@c $Id$
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Gdb Internals: (gdbint). The GNU debugger internals.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-@ifinfo
-This file documents the internals of the GNU debugger GDB.
-
-Copyright (C) 1990, 1991 Free Software Foundation, Inc.
-Contributed by Cygnus Support. Written by John Gilmore.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy or distribute modified versions of this
-manual under the terms of the GPL (for which purpose this text may be
-regarded as a program in the language TeX).
-@end ifinfo
-
-@setchapternewpage off
-@settitle GDB Internals
-@titlepage
-@title{Working in GDB}
-@subtitle{A guide to the internals of the GNU debugger}
-@author John Gilmore
-@author Cygnus Support
-@page
-@tex
-\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision$} % For use in headers, footers too
-{\parskip=0pt
-\hfill Cygnus Support\par
-\hfill \manvers\par
-\hfill \TeX{}info \texinfoversion\par
-}
-@end tex
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1990, 1991 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@end titlepage
-
-@node Top, README, (dir), (dir)
-
-@menu
-* README:: The README File
-* New Architectures:: Defining a New Host or Target Architecture
-* Config:: Adding a New Configuration
-* Host:: Adding a New Host
-* Target:: Adding a New Target
-* Languages:: Defining New Source Languages
-* Releases:: Configuring GDB for Release
-* BFD support for GDB:: How BFD and GDB interface
-* Symbol Reading:: Defining New Symbol Readers
-* Cleanups:: Cleanups
-* Wrapping:: Wrapping Output Lines
-
-@end menu
-
-@node README, New Architectures, Top, Top
-@chapter The @file{README} File
-
-Check the @file{README} file, it often has useful information that does not
-appear anywhere else in the directory.
-
-
-@node New Architectures, Config, README, Top
-@chapter Defining a New Host or Target Architecture
-
-When building support for a new host and/or target, much of the work you
-need to do is handled by specifying configuration files;
-@pxref{Config,,Adding a New Configuration}. Further work can be
-divided into ``host-dependent'' (@pxref{Host,,Adding a New Host}) and
-``target-dependent'' (@pxref{Target,,Adding a New Target}). The
-following discussion is meant to explain the difference between hosts
-and targets.
-
-@heading What is considered ``host-dependent'' versus ``target-dependent''?
-
-@dfn{Host} refers to attributes of the system where GDB runs.
-@dfn{Target} refers to the system where the program being debugged
-executes. In most cases they are the same machine; unfortunately, that
-means you must add @emph{both} host and target support for new machines
-in this category.
-
-The @file{xconfig/*}, @file{xm-*.h} and @file{*-xdep.c} files are for
-host support. Similarly, the @file{tconfig/*}, @file{tm-*.h} and
-@file{*-tdep.c} files are for target support. The question is, what
-features or aspects of a debugging or cross-debugging environment are
-considered to be ``host'' support?
-
-Defines and include files needed to build on the host are host support.
-Examples are tty support, system defined types, host byte order, host
-float format.
-
-Unix child process support is considered an aspect of the host. Since
-when you fork on the host you are still on the host, the various macros
-needed for finding the registers in the upage, running @code{ptrace}, and such
-are all in the host-dependent files.
-
-@c FIXME so what kinds of things are target support?
-
-This is still somewhat of a grey area; I (John Gilmore) didn't do the
-@file{xm-*} and @file{tm-*} split for gdb (it was done by Jim Kingdon)
-so I have had to figure out the grounds on which it was split, and make
-my own choices as I evolve it. I have moved many things out of the xdep
-files actually, partly as a result of BFD and partly by removing
-duplicated code.
-
-
-@node Config, Host, New Architectures, Top
-@chapter Adding a New Configuration
-
-Most of the work in making GDB compile on a new machine is in specifying
-the configuration of the machine. This is done in a dizzying variety of
-header files and configuration scripts, which we hope to make more
-sensible soon. Let's say your new host is called an @var{xxx} (e.g.
-@samp{sun4}), and its full three-part configuration name is
-@code{@var{xarch}-@var{xvend}-@var{xos}} (e.g. @samp{sparc-sun-sunos4}). In
-particular:
-
-In the top level directory, edit @file{config.sub} and add @var{xarch},
-@var{xvend}, and @var{xos} to the lists of supported architectures,
-vendors, and operating systems near the bottom of the file. Also, add
-@var{xxx} as an alias that maps to
-@code{@var{xarch}-@var{xvend}-@var{xos}}. You can test your changes by
-running
-
-@example
-./config.sub @var{xxx}
-@end example
-@noindent
-and
-@example
-./config.sub @code{@var{xarch}-@var{xvend}-@var{xos}}
-@end example
-@noindent
-which should both respond with @code{@var{xarch}-@var{xvend}-@var{xos}}
-and no error messages.
-
-Now, go to the @file{bfd} directory and
-create a new file @file{bfd/hosts/h-@var{xxx}.h}. Examine the
-other @file{h-*.h} files as templates, and create one that brings in the
-right include files for your system, and defines any host-specific
-macros needed by GDB.
-
-Then edit @file{bfd/configure.in}. Add shell script code to recognize your
-@code{@var{xarch}-@var{xvend}-@var{xos}} configuration, and set
-@code{my_host} to @var{xxx} when you recognize it. This will cause your
-file @file{h-@var{xxx}.h} to be linked to @file{sysdep.h} at configuration
-time.
-
-Also, if this host requires any changes to the Makefile, create a file
-@file{bfd/config/hm-@var{xxx}}, which includes the required lines.
-
-(If you have the binary utilities and/or GNU ld in the same tree,
-you'll also have to edit @file{binutils/configure.in} or
-@file{ld/configure.in} to match what you've done in the @file{bfd}
-directory.)
-
-It's likely that the @file{libiberty} and @file{readline} directories
-won't need any changes for your configuration, but if they do, you can
-change the @file{configure.in} file there to recognize your system and
-map to an @file{hm-@var{xxx}} file. Then add @file{hm-@var{xxx}}
-to the @file{config/} subdirectory, to set any makefile variables you
-need. The only current options in there are things like @samp{-DSYSV}.
-
-Aha! Now to configure GDB itself! Edit
-@file{gdb/configure.in} to recognize your system and set @code{gdb_host}
-to @var{xxx}, and (unless your desired target is already available) also
-set @code{gdb_target} to something appropriate (for instance,
-@var{xxx}). To handle new hosts, modify the segment after the comment
-@samp{# per-host}; to handle new targets, modify after @samp{#
-per-target}.
-@c Would it be simpler to just use different per-host and per-target
-@c *scripts*, and call them from {configure} ?
-
-Finally, you'll need to specify and define GDB's host- and
-target-dependent files used for your configuration; the next two
-chapters discuss those.
-
-
-@node Host, Target, Config, Top
-@chapter Adding a New Host
-
-Once you have specified a new configuration for your host
-(@pxref{Config,,Adding a New Configuration}), there are two remaining
-pieces to making GDB work on a new machine. First, you have to make it
-host on the new machine (compile there, handle that machine's terminals
-properly, etc). If you will be cross-debugging to some other kind of
-system that's already supported, you are done.
-
-If you want to use GDB to debug programs that run on the new machine,
-you have to get it to understand the machine's object files, symbol
-files, and interfaces to processes. @pxref{Target,,Adding a New Target}
-
-Several files control GDB's configuration for host systems:
-
-@table @file
-@item gdb/xconfig/@var{xxx}
-Specifies what object files are needed when hosting on machine @var{xxx},
-by defining the makefile macro @samp{XDEPFILES=@dots{}}. Also
-specifies the header file which describes @var{xxx}, by defining
-@samp{XM_FILE= xm-@var{xxx}.h}. You can also define @samp{CC},
-@samp{REGEX} and @samp{REGEX1}, @samp{SYSV_DEFINE}, @samp{XM_CFLAGS},
-@samp{XM_ADD_FILES}, @samp{XM_CLIBS}, @samp{XM_CDEPS},
-etc.; see @file{Makefile.in}.
-
-@item gdb/xm-@var{xxx}.h
-(@file{xm.h} is a link to this file, created by configure).
-Contains C macro definitions describing the host system environment,
-such as byte order, host C compiler and library, ptrace support,
-and core file structure. Crib from existing @file{xm-*.h} files
-to create a new one.
-
-@item gdb/@var{xxx}-xdep.c
-Contains any miscellaneous C code required for this machine
-as a host. On some machines it doesn't exist at all.
-@end table
-
-There are some ``generic'' versions of routines that can be used by
-various host systems. These can be customized in various ways by macros
-defined in your @file{xm-@var{xxx}.h} file. If these routines work for
-the @var{xxx} host, you can just include the generic file's name (with
-@samp{.o}, not @samp{.c}) in @code{XDEPFILES}.
-
-Otherwise, if your machine needs custom support routines, you will need
-to write routines that perform the same functions as the generic file.
-Put them into @code{@var{xxx}-xdep.c}, and put @code{@var{xxx}-xdep.o}
-into @code{XDEPFILES}.
-
-@subheading Generic Host Support Files
-
-@table @file
-
-@item infptrace.c
-This is the low level interface to inferior processes for systems
-using the Unix @code{ptrace} call in a vanilla way.
-
-@item coredep.c::fetch_core_registers()
-Support for reading registers out of a core file. This routine calls
-@code{register_addr()}, see below.
-Now that BFD is used to read core files, virtually all machines should
-use @code{coredep.c}, and should just provide @code{fetch_core_registers} in
-@code{@var{xxx}-xdep.c}.
-
-@item coredep.c::register_addr()
-If your @code{xm-@var{xxx}.h} file defines the macro
-@code{REGISTER_U_ADDR(reg)} to be the offset within the @samp{user}
-struct of a register (represented as a GDB register number),
-@file{coredep.c} will define the @code{register_addr()} function and use
-the macro in it. If you do not define @code{REGISTER_U_ADDR}, but you
-are using the standard @code{fetch_core_registers()}, you will need to
-define your own version of @code{register_addr()}, put it into your
-@code{@var{xxx}-xdep.c} file, and be sure @code{@var{xxx}-xdep.o} is in
-the @code{XDEPFILES} list. If you have your own
-@code{fetch_core_registers()}, you may not need a separate
-@code{register_addr()}. Many custom @code{fetch_core_registers()}
-implementations simply locate the registers themselves.@refill
-@end table
-
-Object files needed when the target system is an @var{xxx} are listed
-in the file @file{tconfig/@var{xxx}}, in the makefile macro
-@samp{TDEPFILES = }@dots{}. The header file that defines the target
-system should be called @file{tm-@var{xxx}.h}, and should be specified
-as the value of @samp{TM_FILE} in @file{tconfig/@var{xxx}}. You can
-also define @samp{TM_CFLAGS}, @samp{TM_CLIBS}, and @samp{TM_CDEPS} in
-there; see @file{Makefile.in}.
-
-Now, you are now ready to try configuring GDB to compile for your system.
-From the top level (above @file{bfd}, @file{gdb}, etc), do:
-
-@example
-./configure @var{xxx} +target=vxworks960
-@end example
-
-This will configure your system to cross-compile for VxWorks on
-the Intel 960, which is probably not what you really want, but it's
-a test case that works at this stage. (You haven't set up to be
-able to debug programs that run @emph{on} @var{xxx} yet.)
-
-If this succeeds, you can try building it all with:
-
-@example
-make
-@end example
-
-Good luck! Comments and suggestions about this section are particularly
-welcome; send them to @samp{bug-gdb@@prep.ai.mit.edu}.
-
-When hosting GDB on a new operating system, to make it possible to debug
-core files, you will need to either write specific code for parsing your
-OS's core files, or customize @file{bfd/trad-core.c}. First, use
-whatever @code{#include} files your machine uses to define the struct of
-registers that is accessible (possibly in the u-area) in a core file
-(rather than @file{machine/reg.h}), and an include file that defines whatever
-header exists on a core file (e.g. the u-area or a @samp{struct core}). Then
-modify @code{trad_unix_core_file_p()} to use these values to set up the
-section information for the data segment, stack segment, any other
-segments in the core file (perhaps shared library contents or control
-information), ``registers'' segment, and if there are two discontiguous
-sets of registers (e.g. integer and float), the ``reg2'' segment. This
-section information basically delimits areas in the core file in a
-standard way, which the section-reading routines in BFD know how to seek
-around in.
-
-Then back in GDB, you need a matching routine called
-@code{fetch_core_registers()}. If you can use the generic one, it's in
-@file{core-dep.c}; if not, it's in your @file{@var{xxx}-xdep.c} file.
-It will be passed a char pointer to the entire ``registers'' segment,
-its length, and a zero; or a char pointer to the entire ``regs2''
-segment, its length, and a 2. The routine should suck out the supplied
-register values and install them into GDB's ``registers'' array.
-(@xref{New Architectures,,Defining a New Host or Target Architecture},
-for more info about this.)
-
-
-@node Target, Languages, Host, Top
-@chapter Adding a New Target
-
-For a new target called @var{ttt}, first specify the configuration as
-described in @ref{Config,,Adding a New Configuration}. If your new
-target is the same as your new host, you've probably already done that.
-
-A variety of files specify attributes of the target environment:
-
-@table @file
-@item gdb/tconfig/@var{ttt}
-Specifies what object files are needed for target @var{ttt}, by
-defining the makefile macro @samp{TDEPFILES=@dots{}}.
-Also specifies the header file which describes @var{ttt}, by defining
-@samp{TM_FILE= tm-@var{ttt}.h}. You can also define @samp{CC},
-@samp{REGEX} and @samp{REGEX1}, @samp{SYSV_DEFINE}, @samp{TM_CFLAGS},
-and other Makefile variables here; see @file{Makefile.in}.
-
-@item gdb/tm-@var{ttt}.h
-(@file{tm.h} is a link to this file, created by configure).
-Contains macro definitions about the target machine's
-registers, stack frame format and instructions.
-Crib from existing @file{tm-*.h} files when building a new one.
-
-@item gdb/@var{ttt}-tdep.c
-Contains any miscellaneous code required for this target machine.
-On some machines it doesn't exist at all. Sometimes the macros
-in @file{tm-@var{ttt}.h} become very complicated, so they are
-implemented as functions here instead, and the macro is simply
-defined to call the function.
-
-@item gdb/exec.c
-Defines functions for accessing files that are
-executable on the target system. These functions open and examine an
-exec file, extract data from one, write data to one, print information
-about one, etc. Now that executable files are handled with BFD, every
-target should be able to use the generic exec.c rather than its
-own custom code.
-
-@item gdb/@var{arch}-pinsn.c
-Prints (disassembles) the target machine's instructions.
-This file is usually shared with other target machines which use the
-same processor, which is why it is @file{@var{arch}-pinsn.c} rather
-than @file{@var{ttt}-pinsn.c}.
-
-@item gdb/@var{arch}-opcode.h
-Contains some large initialized
-data structures describing the target machine's instructions.
-This is a bit strange for a @file{.h} file, but it's OK since
-it is only included in one place. @file{@var{arch}-opcode.h} is shared
-between the debugger and the assembler, if the GNU assembler has been
-ported to the target machine.
-
-@item gdb/tm-@var{arch}.h
-This often exists to describe the basic layout of the target machine's
-processor chip (registers, stack, etc).
-If used, it is included by @file{tm-@var{xxx}.h}. It can
-be shared among many targets that use the same processor.
-
-@item gdb/@var{arch}-tdep.c
-Similarly, there are often common subroutines that are shared by all
-target machines that use this particular architecture.
-@end table
-
-When adding support for a new target machine, there are various areas
-of support that might need change, or might be OK.
-
-If you are using an existing object file format (a.out or COFF),
-there is probably little to be done. See @file{bfd/doc/bfd.texinfo}
-for more information on writing new a.out or COFF versions.
-
-If you need to add a new object file format, you are beyond the scope
-of this document right now. Look at the structure of the a.out
-and COFF support, build a transfer vector (@code{xvec}) for your new format,
-and start populating it with routines. Add it to the list in
-@file{bfd/targets.c}.
-
-If you are adding a new operating system for an existing CPU chip, add a
-@file{tm-@var{xos}.h} file that describes the operating system
-facilities that are unusual (extra symbol table info; the breakpoint
-instruction needed; etc). Then write a
-@file{tm-@var{xarch}-@var{xos}.h} that just @code{#include}s
-@file{tm-@var{xarch}.h} and @file{tm-@var{xos}.h}. (Now that we have
-three-part configuration names, this will probably get revised to
-separate the @var{xos} configuration from the @var{xarch}
-configuration.)
-
-
-@node Languages, Releases, Target, Top
-@chapter Adding a Source Language to GDB
-
-To add other languages to GDB's expression parser, follow the following steps:
-
-@table @emph
-@item Create the expression parser.
-
-This should reside in a file @file{@var{lang}-exp.y}. Routines for building
-parsed expressions into a @samp{union exp_element} list are in @file{parse.c}.
-
-Since we can't depend upon everyone having Bison, and YACC produces
-parsers that define a bunch of global names, the following lines
-@emph{must} be included at the top of the YACC parser, to prevent
-the various parsers from defining the same global names:
-
-@example
-#define yyparse @var{lang}_parse
-#define yylex @var{lang}_lex
-#define yyerror @var{lang}_error
-#define yylval @var{lang}_lval
-#define yychar @var{lang}_char
-#define yydebug @var{lang}_debug
-#define yypact @var{lang}_pact
-#define yyr1 @var{lang}_r1
-#define yyr2 @var{lang}_r2
-#define yydef @var{lang}_def
-#define yychk @var{lang}_chk
-#define yypgo @var{lang}_pgo
-#define yyact @var{lang}_act
-#define yyexca @var{lang}_exca
-#define yyerrflag @var{lang}_errflag
-#define yynerrs @var{lang}_nerrs
-@end example
-
-At the bottom of your parser, define a @code{struct language_defn} and
-initialize it with the right values for your language. Define an
-@code{initialize_@var{lang}} routine and have it call
-@samp{add_language(@var{lang}_language_defn)} to tell the rest of GDB
-that your language exists. You'll need some other supporting variables
-and functions, which will be used via pointers from your
-@code{@var{lang}_language_defn}. See the declaration of @code{struct
-language_defn} in @file{language.h}, and the other @file{*-exp.y} files,
-for more information.
-
-@item Add any evaluation routines, if necessary
-
-If you need new opcodes (that represent the operations of the language),
-add them to the enumerated type in @file{expression.h}. Add support
-code for these operations in @code{eval.c:evaluate_subexp()}. Add cases
-for new opcodes in two functions from @file{parse.c}:
-@code{prefixify_subexp()} and @code{length_of_subexp()}. These compute
-the number of @code{exp_element}s that a given operation takes up.
-
-@item Update some existing code
-
-Add an enumerated identifier for your language to the enumerated type
-@code{enum language} in @file{defs.h}.
-
-Update the routines in @file{language.c} so your language is included. These
-routines include type predicates and such, which (in some cases) are
-language dependent. If your language does not appear in the switch
-statement, an error is reported.
-
-Also included in @file{language.c} is the code that updates the variable
-@code{current_language}, and the routines that translate the
-@code{language_@var{lang}} enumerated identifier into a printable
-string.
-
-Update the function @code{_initialize_language} to include your language. This
-function picks the default language upon startup, so is dependent upon
-which languages that GDB is built for.
-
-Update @code{allocate_symtab} in @file{symfile.c} and/or symbol-reading
-code so that the language of each symtab (source file) is set properly.
-This is used to determine the language to use at each stack frame level.
-Currently, the language is set based upon the extension of the source
-file. If the language can be better inferred from the symbol
-information, please set the language of the symtab in the symbol-reading
-code.
-
-Add helper code to @code{expprint.c:print_subexp()} to handle any new
-expression opcodes you have added to @file{expression.h}. Also, add the
-printed representations of your operators to @code{op_print_tab}.
-
-@item Add a place of call
-
-Add a call to @code{@var{lang}_parse()} and @code{@var{lang}_error} in
-@code{parse.c:parse_exp_1()}.
-
-@item Use macros to trim code
-
-The user has the option of building GDB for some or all of the
-languages. If the user decides to build GDB for the language
-@var{lang}, then every file dependent on @file{language.h} will have the
-macro @code{_LANG_@var{lang}} defined in it. Use @code{#ifdef}s to
-leave out large routines that the user won't need if he or she is not
-using your language.
-
-Note that you do not need to do this in your YACC parser, since if GDB
-is not build for @var{lang}, then @file{@var{lang}-exp.tab.o} (the
-compiled form of your parser) is not linked into GDB at all.
-
-See the file @file{configure.in} for how GDB is configured for different
-languages.
-
-@item Edit @file{Makefile.in}
-
-Add dependencies in @file{Makefile.in}. Make sure you update the macro
-variables such as @code{HFILES} and @code{OBJS}, otherwise your code may
-not get linked in, or, worse yet, it may not get @code{tar}red into the
-distribution!
-@end table
-
-
-@node Releases, BFD support for GDB, Languages, Top
-@chapter Configuring GDB for Release
-
-From the top level directory (containing @file{gdb}, @file{bfd},
-@file{libiberty}, and so on):
-@example
-make gdb.tar.Z
-@end example
-
-This will properly configure, clean, rebuild any files that are
-distributed pre-built (e.g. @file{c-exp.tab.c} or @file{refcard.ps}),
-and will then make a tarfile.
-
-This procedure requires:
-@itemize @bullet
-@item symbolic links
-@item @code{makeinfo} (texinfo2 level)
-@item @TeX{}
-@item @code{dvips}
-@item @code{yacc} or @code{bison}
-@end itemize
-@noindent
-@dots{} and the usual slew of utilities (@code{sed}, @code{tar}, etc.).
-
-@subheading TEMPORARY RELEASE PROCEDURE FOR DOCUMENTATION
-
-@file{gdb.texinfo} is currently marked up using the texinfo-2 macros,
-which are not yet a default for anything (but we have to start using
-them sometime).
-
-For making paper, the only thing this implies is the right generation of
-@file{texinfo.tex} needs to be included in the distribution.
-
-For making info files, however, rather than duplicating the texinfo2
-distribution, generate @file{gdb-all.texinfo} locally, and include the files
-@file{gdb.info*} in the distribution. Note the plural; @code{makeinfo} will
-split the document into one overall file and five or so included files.
-
-
-@node BFD support for GDB, Symbol Reading, Releases, Top
-@chapter Binary File Descriptor Library Support for GDB
-
-BFD provides support for GDB in several ways:
-
-@table @emph
-@item identifying executable and core files
-BFD will identify a variety of file types, including a.out, coff, and
-several variants thereof, as well as several kinds of core files.
-
-@item access to sections of files
-BFD parses the file headers to determine the names, virtual addresses,
-sizes, and file locations of all the various named sections in files
-(such as the text section or the data section). GDB simply calls
-BFD to read or write section X at byte offset Y for length Z.
-
-@item specialized core file support
-BFD provides routines to determine the failing command name stored
-in a core file, the signal with which the program failed, and whether
-a core file matches (i.e. could be a core dump of) a particular executable
-file.
-
-@item locating the symbol information
-GDB uses an internal interface of BFD to determine where to find the
-symbol information in an executable file or symbol-file. GDB itself
-handles the reading of symbols, since BFD does not ``understand'' debug
-symbols, but GDB uses BFD's cached information to find the symbols,
-string table, etc.
-@end table
-
-@c The interface for symbol reading is described in @ref{Symbol
-@c Reading,,Symbol Reading}.
-
-
-@node Symbol Reading, Cleanups, BFD support for GDB, Top
-@chapter Symbol Reading
-
-GDB reads symbols from "symbol files". The usual symbol file is the
-file containing the program which gdb is debugging. GDB can be directed
-to use a different file for symbols (with the ``symbol-file''
-command), and it can also read more symbols via the ``add-file'' and ``load''
-commands, or while reading symbols from shared libraries.
-
-Symbol files are initially opened by @file{symfile.c} using the BFD
-library. BFD identifies the type of the file by examining its header.
-@code{symfile_init} then uses this identification to locate a
-set of symbol-reading functions.
-
-Symbol reading modules identify themselves to GDB by calling
-@code{add_symtab_fns} during their module initialization. The argument
-to @code{add_symtab_fns} is a @code{struct sym_fns} which contains
-the name (or name prefix) of the symbol format, the length of the prefix,
-and pointers to four functions. These functions are called at various
-times to process symbol-files whose identification matches the specified
-prefix.
-
-The functions supplied by each module are:
-
-@table @code
-@item @var{xxx}_symfile_init(struct sym_fns *sf)
-
-Called from @code{symbol_file_add} when we are about to read a new
-symbol file. This function should clean up any internal state
-(possibly resulting from half-read previous files, for example)
-and prepare to read a new symbol file. Note that the symbol file
-which we are reading might be a new "main" symbol file, or might
-be a secondary symbol file whose symbols are being added to the
-existing symbol table.
-
-The argument to @code{@var{xxx}_symfile_init} is a newly allocated
-@code{struct sym_fns} whose @code{bfd} field contains the BFD
-for the new symbol file being read. Its @code{private} field
-has been zeroed, and can be modified as desired. Typically,
-a struct of private information will be @code{malloc}'d, and
-a pointer to it will be placed in the @code{private} field.
-
-There is no result from @code{@var{xxx}_symfile_init}, but it can call
-@code{error} if it detects an unavoidable problem.
-
-@item @var{xxx}_new_init()
-
-Called from @code{symbol_file_add} when discarding existing symbols.
-This function need only handle
-the symbol-reading module's internal state; the symbol table data
-structures visible to the rest of GDB will be discarded by
-@code{symbol_file_add}. It has no arguments and no result.
-It may be called after @code{@var{xxx}_symfile_init}, if a new symbol
-table is being read, or may be called alone if all symbols are
-simply being discarded.
-
-@item @var{xxx}_symfile_read(struct sym_fns *sf, CORE_ADDR addr, int mainline)
-
-Called from @code{symbol_file_add} to actually read the symbols from a
-symbol-file into a set of psymtabs or symtabs.
-
-@code{sf} points to the struct sym_fns originally passed to
-@code{@var{xxx}_sym_init} for possible initialization. @code{addr} is the
-offset between the file's specified start address and its true address
-in memory. @code{mainline} is 1 if this is the main symbol table being
-read, and 0 if a secondary symbol file (e.g. shared library or
-dynamically loaded file) is being read.@refill
-@end table
-
-In addition, if a symbol-reading module creates psymtabs when
-@var{xxx}_symfile_read is called, these psymtabs will contain a pointer to
-a function @code{@var{xxx}_psymtab_to_symtab}, which can be called from
-any point in the GDB symbol-handling code.
-
-@table @code
-@item @var{xxx}_psymtab_to_symtab (struct partial_symtab *pst)
-
-Called from @code{psymtab_to_symtab} (or the PSYMTAB_TO_SYMTAB
-macro) if the psymtab has not already been read in and had its
-@code{pst->symtab} pointer set. The argument is the psymtab
-to be fleshed-out into a symtab. Upon return, pst->readin
-should have been set to 1, and pst->symtab should contain a
-pointer to the new corresponding symtab, or zero if there
-were no symbols in that part of the symbol file.
-@end table
-
-
-@node Cleanups, Wrapping, Symbol Reading, Top
-@chapter Cleanups
-
-Cleanups are a structured way to deal with things that need to be done
-later. When your code does something (like @code{malloc} some memory, or open
-a file) that needs to be undone later (e.g. free the memory or close
-the file), it can make a cleanup. The cleanup will be done at some
-future point: when the command is finished, when an error occurs, or
-when your code decides it's time to do cleanups.
-
-You can also discard cleanups, that is, throw them away without doing
-what they say. This is only done if you ask that it be done.
-
-Syntax:
-
-@table @code
-@item @var{old_chain} = make_cleanup (@var{function}, @var{arg});
-Make a cleanup which will cause @var{function} to be called with @var{arg}
-(a @code{char *}) later. The result, @var{old_chain}, is a handle that can be
-passed to @code{do_cleanups} or @code{discard_cleanups} later. Unless you are
-going to call @code{do_cleanups} or @code{discard_cleanups} yourself,
-you can ignore the result from @code{make_cleanup}.
-
-
-@item do_cleanups (@var{old_chain});
-Perform all cleanups done since @code{make_cleanup} returned @var{old_chain}.
-E.g.:
-@example
-make_cleanup (a, 0);
-old = make_cleanup (b, 0);
-do_cleanups (old);
-@end example
-@noindent
-will call @code{b()} but will not call @code{a()}. The cleanup that calls @code{a()} will remain
-in the cleanup chain, and will be done later unless otherwise discarded.@refill
-
-@item discard_cleanups (@var{old_chain});
-Same as @code{do_cleanups} except that it just removes the cleanups from the
-chain and does not call the specified functions.
-
-@end table
-
-Some functions, e.g. @code{fputs_filtered()} or @code{error()}, specify that they
-``should not be called when cleanups are not in place''. This means
-that any actions you need to reverse in the case of an error or
-interruption must be on the cleanup chain before you call these functions,
-since they might never return to your code (they @samp{longjmp} instead).
-
-
-@node Wrapping, Frames, Cleanups, Top
-@chapter Wrapping Output Lines
-
-Output that goes through @code{printf_filtered} or @code{fputs_filtered} or
-@code{fputs_demangled} needs only to have calls to @code{wrap_here} added
-in places that would be good breaking points. The utility routines
-will take care of actually wrapping if the line width is exceeded.
-
-The argument to @code{wrap_here} is an indentation string which is printed
-@emph{only} if the line breaks there. This argument is saved away and used
-later. It must remain valid until the next call to @code{wrap_here} or
-until a newline has been printed through the @code{*_filtered} functions.
-Don't pass in a local variable and then return!
-
-It is usually best to call @code{wrap_here()} after printing a comma or space.
-If you call it before printing a space, make sure that your indentation
-properly accounts for the leading space that will print if the line wraps
-there.
-
-Any function or set of functions that produce filtered output must finish
-by printing a newline, to flush the wrap buffer, before switching to
-unfiltered (``@code{printf}'') output. Symbol reading routines that print
-warnings are a good example.
-
-
-@node Frames, , Cleanups, Top
-@chapter Frames
-
-A frame is a construct that GDB uses to keep track of calling and called
-functions.
-
-FRAME_FP in the machine description has no meaning to the machine-independent
-part of GDB, except that it is used when setting up a new frame from
-scratch, as follows:
-
-@example
- create_new_frame (read_register (FP_REGNUM), read_pc ()));
-@end example
-
-Other than that, all the meaning imparted to FP_REGNUM is imparted by
-the machine-dependent code. So, FP_REGNUM can have any value that
-is convenient for the code that creates new frames. (create_new_frame
-calls INIT_EXTRA_FRAME_INFO if it is defined; that is where you should
-use the FP_REGNUM value, if your frames are nonstandard.)
-
-FRAME_CHAIN:
-
-Given a GDB frame, determine the address of the calling function's frame.
-This will be used to create a new GDB frame struct, and then
-INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
-
-@contents
-@bye
-
diff --git a/gdb/doc/gdbinv-m.m4 b/gdb/doc/gdbinv-m.m4
deleted file mode 100755
index 8fe5f91..0000000
--- a/gdb/doc/gdbinv-m.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-_dnl__ M4 FRAGMENT: $Id$
-_if__(_I960__)
-* i960-Nindy Remote:: _GDBN__ with a Remote i960 (Nindy)
-_fi__(_I960__)
-_if__(_AMD29K__)
-* EB29K Remote:: _GDBN__ with a Remote EB29K
-_fi__(_AMD29K__)
-_if__(_VXWORKS__)
-* VxWorks Remote:: _GDBN__ and VxWorks
-_fi__(_VXWORKS__)
diff --git a/gdb/doc/gdbinv-m.m4.in b/gdb/doc/gdbinv-m.m4.in
deleted file mode 100644
index 8fe5f91..0000000
--- a/gdb/doc/gdbinv-m.m4.in
+++ /dev/null
@@ -1,13 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-_dnl__ M4 FRAGMENT: $Id$
-_if__(_I960__)
-* i960-Nindy Remote:: _GDBN__ with a Remote i960 (Nindy)
-_fi__(_I960__)
-_if__(_AMD29K__)
-* EB29K Remote:: _GDBN__ with a Remote EB29K
-_fi__(_AMD29K__)
-_if__(_VXWORKS__)
-* VxWorks Remote:: _GDBN__ and VxWorks
-_fi__(_VXWORKS__)
diff --git a/gdb/doc/gdbinv-s.m4 b/gdb/doc/gdbinv-s.m4
deleted file mode 100755
index e0814be..0000000
--- a/gdb/doc/gdbinv-s.m4
+++ /dev/null
@@ -1,427 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT $Id$
-@c This text diverted to "Remote Debugging" section in general case;
-@c however, if we're doing a manual specifically for one of these, it
-@c belongs up front (in "Getting In and Out" chapter).
-_if__(_I960__)
-_if__(!_GENERIC__)
-@node i960-Nindy Remote, EB29K Remote, Mode Options, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node i960-Nindy Remote, EB29K Remote, Remote, Remote
-_fi__(_GENERIC__)
-@subsection _GDBN__ with a Remote i960 (Nindy)
-
-@cindex Nindy
-@cindex i960
-@dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When
-_GDBN__ is configured to control a remote Intel 960 using Nindy, you can
-tell _GDBN__ how to connect to the 960 in several ways:
-
-@itemize @bullet
-@item
-Through command line options specifying serial port, version of the
-Nindy protocol, and communications speed;
-
-@item
-By responding to a prompt on startup;
-
-@item
-By using the @code{target} command at any point during your _GDBN__
-session. @xref{Target Commands}.
-
-@end itemize
-
-@menu
-* Nindy Startup:: Startup with Nindy
-* Nindy Options:: Options for Nindy
-* Nindy reset:: Nindy Reset Command
-@end menu
-
-@node Nindy Startup, Nindy Options, i960-Nindy Remote, i960-Nindy Remote
-@subsubsection Startup with Nindy
-
-If you simply start @code{_GDBN__} without using any command-line
-options, you are prompted for what serial port to use, @emph{before} you
-reach the ordinary _GDBN__ prompt:
-@example
-Attach /dev/ttyNN -- specify NN, or "quit" to quit:
-@end example
-@noindent
-Respond to the prompt with whatever suffix (after @samp{/dev/tty})
-identifies the serial port you want to use. You can, if you choose,
-simply start up with no Nindy connection by responding to the prompt
-with an empty line. If you do this, and later wish to attach to Nindy,
-use @code{target} (@pxref{Target Commands}).
-
-@node Nindy Options, Nindy reset, Nindy Startup, i960-Nindy Remote
-@subsubsection Options for Nindy
-
-These are the startup options for beginning your _GDBN__ session with a
-Nindy-960 board attached:
-
-@table @code
-@item -r @var{port}
-Specify the serial port name of a serial interface to be used to connect
-to the target system. This option is only available when _GDBN__ is
-configured for the Intel 960 target architecture. You may specify
-@var{port} as any of: a full pathname (e.g. @samp{-r /dev/ttya}), a
-device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique
-suffix for a specific @code{tty} (e.g. @samp{-r a}).
-
-@item -O
-(An uppercase letter ``O'', not a zero.) Specify that _GDBN__ should use
-the ``old'' Nindy monitor protocol to connect to the target system.
-This option is only available when _GDBN__ is configured for the Intel 960
-target architecture.
-
-@quotation
-@emph{Warning:} if you specify @samp{-O}, but are actually trying to
-connect to a target system that expects the newer protocol, the connection
-will fail, appearing to be a speed mismatch. _GDBN__ will repeatedly
-attempt to reconnect at several different line speeds. You can abort
-this process with an interrupt.
-@end quotation
-
-@item -brk
-Specify that _GDBN__ should first send a @code{BREAK} signal to the target
-system, in an attempt to reset it, before connecting to a Nindy target.
-
-@quotation
-@emph{Warning:} Many target systems do not have the hardware that this
-requires; it only works with a few boards.
-@end quotation
-
-@end table
-
-The standard @samp{-b} option controls the line speed used on the serial
-port.
-
-@node Nindy reset, , Nindy Options, i960-Nindy Remote
-@c @group
-@subsubsection Nindy Reset Command
-@table @code
-@item reset
-@kindex reset
-For a Nindy target, this command sends a ``break'' to the remote target
-system; this is only useful if the target has been equipped with a
-circuit to perform a hard reset (or some other interesting action) when
-a break is detected.
-@end table
-@c @end group
-_fi__(_I960__)
-
-_if__(_AMD29K__)
-_if__(!_GENERIC__)
-@node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Remote
-_fi__(_GENERIC__)
-@subsection _GDBN__ with a Remote EB29K
-
-@cindex EB29K board
-@cindex running 29K programs
-
-To use _GDBN__ from a Unix system to run programs on AMD's EB29K
-board in a PC, you must first connect a serial cable between the PC
-and a serial port on the Unix system. In the following, we assume
-you've hooked the cable between the PC's @file{COM1} port and
-@file{/dev/ttya} on the Unix system.
-
-@menu
-* Comms (EB29K):: Communications Setup
-* _GDBP__-EB29K:: EB29K cross-debugging
-* Remote Log:: Remote Log
-@end menu
-
-@node Comms (EB29K), _GDBP__-EB29K, EB29K Remote, EB29K Remote
-@subsubsection Communications Setup
-The next step is to set up the PC's port, by doing something like the
-following in DOS on the PC:
-_0__@example
-C:\> MODE com1:9600,n,8,1,none
-_1__@end example
-@noindent
-This example---run on an MS DOS 4.0 system---sets the PC port to 9600
-bps, no parity, eight data bits, one stop bit, and no ``retry'' action;
-you must match the communications parameters when establishing the Unix
-end of the connection as well.
-@c FIXME: Who knows what this "no retry action" crud from the DOS manual may
-@c mean? It's optional; leave it out? ---pesch@cygnus.com, 25feb91
-
-To give control of the PC to the Unix side of the serial line, type
-the following at the DOS console:
-_0__@example
-C:\> CTTY com1
-_1__@end example
-@noindent
-(Later, if you wish to return control to the DOS console, you can use
-the command @code{CTTY con}---but you must send it over the device that
-had control, in our example over the @file{COM1} serial line).
-
-From the Unix host, use a communications program such as @code{tip} or
-@code{cu} to communicate with the PC; for example,
-@example
-cu -s 9600 -l /dev/ttya
-@end example
-@noindent
-The @code{cu} options shown specify, respectively, the linespeed and the
-serial port to use. If you use @code{tip} instead, your command line
-may look something like the following:
-@example
-tip -9600 /dev/ttya
-@end example
-@noindent
-Your system may define a different name where our example uses
-@file{/dev/ttya} as the argument to @code{tip}. The communications
-parameters, including what port to use, are associated with the
-@code{tip} argument in the ``remote'' descriptions file---normally the
-system table @file{/etc/remote}.
-@c FIXME: What if anything needs doing to match the "n,8,1,none" part of
-@c the DOS side's comms setup? cu can support -o (odd
-@c parity), -e (even parity)---apparently no settings for no parity or
-@c for character size. Taken from stty maybe...? John points out tip
-@c can set these as internal variables, eg ~s parity=none; man stty
-@c suggests that it *might* work to stty these options with stdin or
-@c stdout redirected... ---pesch@cygnus.com, 25feb91
-
-@kindex EBMON
-Using the @code{tip} or @code{cu} connection, change the DOS working
-directory to the directory containing a copy of your 29K program, then
-start the PC program @code{EBMON} (an EB29K control program supplied
-with your board by AMD). You should see an initial display from
-@code{EBMON} similar to the one that follows, ending with the
-@code{EBMON} prompt @samp{#}---
-_0__@example
-C:\> G:
-
-G:\> CD \usr\joe\work29k
-
-G:\USR\JOE\WORK29K> EBMON
-Am29000 PC Coprocessor Board Monitor, version 3.0-18
-Copyright 1990 Advanced Micro Devices, Inc.
-Written by Gibbons and Associates, Inc.
-
-Enter '?' or 'H' for help
-
-PC Coprocessor Type = EB29K
-I/O Base = 0x208
-Memory Base = 0xd0000
-
-Data Memory Size = 2048KB
-Available I-RAM Range = 0x8000 to 0x1fffff
-Available D-RAM Range = 0x80002000 to 0x801fffff
-
-PageSize = 0x400
-Register Stack Size = 0x800
-Memory Stack Size = 0x1800
-
-CPU PRL = 0x3
-Am29027 Available = No
-Byte Write Available = Yes
-
-# ~.
-_1__@end example
-
-Then exit the @code{cu} or @code{tip} program (done in the example by
-typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} will keep
-running, ready for _GDBN__ to take over.
-
-For this example, we've assumed what is probably the most convenient
-way to make sure the same 29K program is on both the PC and the Unix
-system: a PC/NFS connection that establishes ``drive @code{G:}'' on the
-PC as a file system on the Unix host. If you don't have PC/NFS or
-something similar connecting the two systems, you must arrange some
-other way---perhaps floppy-disk transfer---of getting the 29K program
-from the Unix system to the PC; _GDBN__ will @emph{not} download it over the
-serial line.
-
-@node _GDBP__-EB29K, Remote Log, Comms (EB29K), EB29K Remote
-@subsubsection EB29K cross-debugging
-Finally, @code{cd} to the directory containing an image of your 29K
-program on the Unix system, and start _GDBN__---specifying as argument the
-name of your 29K program:
-@example
-cd /usr/joe/work29k
-_GDBP__ myfoo
-@end example
-Now you can use the @code{target} command:
-@example
-target amd-eb /dev/ttya 9600 MYFOO
-@end example
-@c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to
-@c emphasize that this is the name as seen by DOS (since I think DOS is
-@c single-minded about case of letters). ---pesch@cygnus.com, 25feb91
-
-@noindent
-In this example, we've assumed your program is in a file called
-@file{myfoo}. Note that the filename given as the last argument to
-@code{target amd-eb} should be the name of the program as it appears to DOS.
-In our example this is simply @code{MYFOO}, but in general it can include
-a DOS path, and depending on your transfer mechanism may not resemble
-the name on the Unix side.
-
-At this point, you can set any breakpoints you wish; when you're ready
-to see your program run on the 29K board, use the _GDBN__ command
-@code{run}.
-
-To stop debugging the remote program, use the _GDBN__ @code{detach}
-command.
-
-To return control of the PC to its console, use @code{tip} or @code{cu}
-once again, after your _GDBN__ session has concluded, to attach to
-@code{EBMON}. You can then type the command @code{q} to shut down
-@code{EBMON}, returning control to the DOS command-line interpreter.
-Type @code{CTTY con} to return command input to the main DOS console,
-and type @kbd{~.} to leave @code{tip} or @code{cu}.
-
-@node Remote Log, , _GDBP__-EB29K, EB29K Remote
-@subsubsection Remote Log
-@kindex eb.log
-@cindex log file for EB29K
-The @code{target amd-eb} command creates a file @file{eb.log} in the
-current working directory, to help debug problems with the connection.
-@file{eb.log} records all the output from @code{EBMON}, including echoes
-of the commands sent to it. Running @samp{tail -f} on this file in
-another window often helps to understand trouble with @code{EBMON}, or
-unexpected events on the PC side of the connection.
-_fi__(_AMD29K__)
-
-_if__(_VXWORKS__)
-_if__(!_GENERIC__)
-@node VxWorks Remote, , EB29K Remote, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node VxWorks Remote, , EB29K Remote, Remote
-_fi__(_GENERIC__)
-@subsection _GDBN__ and VxWorks
-@cindex VxWorks
-_GDBN__ enables developers to spawn and debug tasks running on networked
-VxWorks targets from a Unix host. Already-running tasks spawned from
-the VxWorks shell can also be debugged. _GDBN__ uses code that runs on
-both the UNIX host and on the VxWorks target. The program
-@code{_GDBP__} is installed and executed on the UNIX host.
-
-The remote debugging interface (RDB) routines are installed and executed
-on the VxWorks target. These routines are included in the VxWorks library
-@file{rdb.a} and are incorporated into the system image when source-level
-debugging is enabled in the VxWorks configuration.
-
-@kindex INCLUDE_RDB
-You can define @code{INCLUDE_RDB} in the VxWorks configuration file
-@file{configAll.h} to include the RDB interface routines and spawn the
-source debugging task @code{tRdbTask} when VxWorks is booted. For more
-information on configuring and remaking VxWorks, see the @cite{VxWorks
-Programmer's Guide}.
-
-Once you have included the RDB interface in your VxWorks system image
-and set your Unix execution search path to find _GDBN__, you are ready
-to run _GDBN__. From your UNIX host, type:
-
-@smallexample
-% _GDBP__
-@end smallexample
-
-_GDBN__ will come up showing the prompt:
-
-@smallexample
-(_GDBP__)
-@end smallexample
-
-@menu
-* VxWorks connection:: Connecting to VxWorks
-* VxWorks download:: VxWorks Download
-* VxWorks attach:: Running Tasks
-@end menu
-
-@node VxWorks connection, VxWorks download, VxWorks Remote, VxWorks Remote
-@subsubsection Connecting to VxWorks
-
-The _GDBN__ command @code{target} lets you connect to a VxWorks target on the
-network. To connect to a target whose host name is ``@code{tt}'', type:
-
-@smallexample
-(_GDBP__) target vxworks tt
-@end smallexample
-
-_GDBN__ will display a message similar to the following:
-
-@smallexample
-Attaching remote machine across net... Success!
-@end smallexample
-
-_GDBN__ will then attempt to read the symbol tables of any object
-modules loaded into the VxWorks target since it was last booted.
-_GDBN__ locates these files by searching the directories listed in the
-command search path (@pxref{Environment}); if it fails to find an
-object file, it will display a message such as:
-
-@smallexample
-prog.o: No such file or directory.
-@end smallexample
-
-This will cause the @code{target} command to abort. When this happens,
-you should add the appropriate directory to the search path, with the
-_GDBN__ command @code{path}, and execute the @code{target} command
-again.
-
-@node VxWorks download, VxWorks attach, VxWorks connection, VxWorks Remote
-@subsubsection VxWorks Download
-
-@cindex download to VxWorks
-If you have connected to the VxWorks target and you want to debug an
-object that has not yet been loaded, you can use the _GDBN__ @code{load}
-command to download a file from UNIX to VxWorks incrementally. The
-object file given as an argument to the @code{load} command is actually
-opened twice: first by the VxWorks target in order to download the code,
-then by _GDBN__ in order to read the symbol table. This can lead to
-problems if the current working directories on the two systems differ.
-It is simplest to set the working directory on both systems to the
-directory in which the object file resides, and then to reference the
-file by its name, without any path. Thus, to load a program
-@file{prog.o}, residing in @file{wherever/vw/demo/rdb}, on VxWorks type:
-
-@smallexample
--> cd "wherever/vw/demo/rdb"
-@end smallexample
-
-On _GDBN__ type:
-
-@smallexample
-(_GDBP__) cd wherever/vw/demo/rdb
-(_GDBP__) load prog.o
-@end smallexample
-
-_GDBN__ will display a response similar to the following:
-
-@smallexample
-Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
-@end smallexample
-
-You can also use the @code{load} command to reload an object module
-after editing and recompiling the corresponding source file. Note that
-this will cause _GDBN__ to delete all currently-defined breakpoints,
-auto-displays, and convenience variables, and to clear the value
-history. (This is necessary in order to preserve the integrity of
-debugger data structures that reference the target system's symbol
-table.)
-
-@node VxWorks attach, , VxWorks download, VxWorks Remote
-@subsubsection Running Tasks
-
-@cindex running VxWorks tasks
-You can also attach to an existing task using the @code{attach} command as
-follows:
-
-@smallexample
-(_GDBP__) attach @var{task}
-@end smallexample
-
-where @var{task} is the VxWorks hexadecimal task ID. The task can be running
-or suspended when you attach to it. If running, it will be suspended at
-the time of attachment.
-
-_fi__(_VXWORKS__)
diff --git a/gdb/doc/gdbinv-s.m4.in b/gdb/doc/gdbinv-s.m4.in
deleted file mode 100644
index e0814be..0000000
--- a/gdb/doc/gdbinv-s.m4.in
+++ /dev/null
@@ -1,427 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT $Id$
-@c This text diverted to "Remote Debugging" section in general case;
-@c however, if we're doing a manual specifically for one of these, it
-@c belongs up front (in "Getting In and Out" chapter).
-_if__(_I960__)
-_if__(!_GENERIC__)
-@node i960-Nindy Remote, EB29K Remote, Mode Options, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node i960-Nindy Remote, EB29K Remote, Remote, Remote
-_fi__(_GENERIC__)
-@subsection _GDBN__ with a Remote i960 (Nindy)
-
-@cindex Nindy
-@cindex i960
-@dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When
-_GDBN__ is configured to control a remote Intel 960 using Nindy, you can
-tell _GDBN__ how to connect to the 960 in several ways:
-
-@itemize @bullet
-@item
-Through command line options specifying serial port, version of the
-Nindy protocol, and communications speed;
-
-@item
-By responding to a prompt on startup;
-
-@item
-By using the @code{target} command at any point during your _GDBN__
-session. @xref{Target Commands}.
-
-@end itemize
-
-@menu
-* Nindy Startup:: Startup with Nindy
-* Nindy Options:: Options for Nindy
-* Nindy reset:: Nindy Reset Command
-@end menu
-
-@node Nindy Startup, Nindy Options, i960-Nindy Remote, i960-Nindy Remote
-@subsubsection Startup with Nindy
-
-If you simply start @code{_GDBN__} without using any command-line
-options, you are prompted for what serial port to use, @emph{before} you
-reach the ordinary _GDBN__ prompt:
-@example
-Attach /dev/ttyNN -- specify NN, or "quit" to quit:
-@end example
-@noindent
-Respond to the prompt with whatever suffix (after @samp{/dev/tty})
-identifies the serial port you want to use. You can, if you choose,
-simply start up with no Nindy connection by responding to the prompt
-with an empty line. If you do this, and later wish to attach to Nindy,
-use @code{target} (@pxref{Target Commands}).
-
-@node Nindy Options, Nindy reset, Nindy Startup, i960-Nindy Remote
-@subsubsection Options for Nindy
-
-These are the startup options for beginning your _GDBN__ session with a
-Nindy-960 board attached:
-
-@table @code
-@item -r @var{port}
-Specify the serial port name of a serial interface to be used to connect
-to the target system. This option is only available when _GDBN__ is
-configured for the Intel 960 target architecture. You may specify
-@var{port} as any of: a full pathname (e.g. @samp{-r /dev/ttya}), a
-device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique
-suffix for a specific @code{tty} (e.g. @samp{-r a}).
-
-@item -O
-(An uppercase letter ``O'', not a zero.) Specify that _GDBN__ should use
-the ``old'' Nindy monitor protocol to connect to the target system.
-This option is only available when _GDBN__ is configured for the Intel 960
-target architecture.
-
-@quotation
-@emph{Warning:} if you specify @samp{-O}, but are actually trying to
-connect to a target system that expects the newer protocol, the connection
-will fail, appearing to be a speed mismatch. _GDBN__ will repeatedly
-attempt to reconnect at several different line speeds. You can abort
-this process with an interrupt.
-@end quotation
-
-@item -brk
-Specify that _GDBN__ should first send a @code{BREAK} signal to the target
-system, in an attempt to reset it, before connecting to a Nindy target.
-
-@quotation
-@emph{Warning:} Many target systems do not have the hardware that this
-requires; it only works with a few boards.
-@end quotation
-
-@end table
-
-The standard @samp{-b} option controls the line speed used on the serial
-port.
-
-@node Nindy reset, , Nindy Options, i960-Nindy Remote
-@c @group
-@subsubsection Nindy Reset Command
-@table @code
-@item reset
-@kindex reset
-For a Nindy target, this command sends a ``break'' to the remote target
-system; this is only useful if the target has been equipped with a
-circuit to perform a hard reset (or some other interesting action) when
-a break is detected.
-@end table
-@c @end group
-_fi__(_I960__)
-
-_if__(_AMD29K__)
-_if__(!_GENERIC__)
-@node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Remote
-_fi__(_GENERIC__)
-@subsection _GDBN__ with a Remote EB29K
-
-@cindex EB29K board
-@cindex running 29K programs
-
-To use _GDBN__ from a Unix system to run programs on AMD's EB29K
-board in a PC, you must first connect a serial cable between the PC
-and a serial port on the Unix system. In the following, we assume
-you've hooked the cable between the PC's @file{COM1} port and
-@file{/dev/ttya} on the Unix system.
-
-@menu
-* Comms (EB29K):: Communications Setup
-* _GDBP__-EB29K:: EB29K cross-debugging
-* Remote Log:: Remote Log
-@end menu
-
-@node Comms (EB29K), _GDBP__-EB29K, EB29K Remote, EB29K Remote
-@subsubsection Communications Setup
-The next step is to set up the PC's port, by doing something like the
-following in DOS on the PC:
-_0__@example
-C:\> MODE com1:9600,n,8,1,none
-_1__@end example
-@noindent
-This example---run on an MS DOS 4.0 system---sets the PC port to 9600
-bps, no parity, eight data bits, one stop bit, and no ``retry'' action;
-you must match the communications parameters when establishing the Unix
-end of the connection as well.
-@c FIXME: Who knows what this "no retry action" crud from the DOS manual may
-@c mean? It's optional; leave it out? ---pesch@cygnus.com, 25feb91
-
-To give control of the PC to the Unix side of the serial line, type
-the following at the DOS console:
-_0__@example
-C:\> CTTY com1
-_1__@end example
-@noindent
-(Later, if you wish to return control to the DOS console, you can use
-the command @code{CTTY con}---but you must send it over the device that
-had control, in our example over the @file{COM1} serial line).
-
-From the Unix host, use a communications program such as @code{tip} or
-@code{cu} to communicate with the PC; for example,
-@example
-cu -s 9600 -l /dev/ttya
-@end example
-@noindent
-The @code{cu} options shown specify, respectively, the linespeed and the
-serial port to use. If you use @code{tip} instead, your command line
-may look something like the following:
-@example
-tip -9600 /dev/ttya
-@end example
-@noindent
-Your system may define a different name where our example uses
-@file{/dev/ttya} as the argument to @code{tip}. The communications
-parameters, including what port to use, are associated with the
-@code{tip} argument in the ``remote'' descriptions file---normally the
-system table @file{/etc/remote}.
-@c FIXME: What if anything needs doing to match the "n,8,1,none" part of
-@c the DOS side's comms setup? cu can support -o (odd
-@c parity), -e (even parity)---apparently no settings for no parity or
-@c for character size. Taken from stty maybe...? John points out tip
-@c can set these as internal variables, eg ~s parity=none; man stty
-@c suggests that it *might* work to stty these options with stdin or
-@c stdout redirected... ---pesch@cygnus.com, 25feb91
-
-@kindex EBMON
-Using the @code{tip} or @code{cu} connection, change the DOS working
-directory to the directory containing a copy of your 29K program, then
-start the PC program @code{EBMON} (an EB29K control program supplied
-with your board by AMD). You should see an initial display from
-@code{EBMON} similar to the one that follows, ending with the
-@code{EBMON} prompt @samp{#}---
-_0__@example
-C:\> G:
-
-G:\> CD \usr\joe\work29k
-
-G:\USR\JOE\WORK29K> EBMON
-Am29000 PC Coprocessor Board Monitor, version 3.0-18
-Copyright 1990 Advanced Micro Devices, Inc.
-Written by Gibbons and Associates, Inc.
-
-Enter '?' or 'H' for help
-
-PC Coprocessor Type = EB29K
-I/O Base = 0x208
-Memory Base = 0xd0000
-
-Data Memory Size = 2048KB
-Available I-RAM Range = 0x8000 to 0x1fffff
-Available D-RAM Range = 0x80002000 to 0x801fffff
-
-PageSize = 0x400
-Register Stack Size = 0x800
-Memory Stack Size = 0x1800
-
-CPU PRL = 0x3
-Am29027 Available = No
-Byte Write Available = Yes
-
-# ~.
-_1__@end example
-
-Then exit the @code{cu} or @code{tip} program (done in the example by
-typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} will keep
-running, ready for _GDBN__ to take over.
-
-For this example, we've assumed what is probably the most convenient
-way to make sure the same 29K program is on both the PC and the Unix
-system: a PC/NFS connection that establishes ``drive @code{G:}'' on the
-PC as a file system on the Unix host. If you don't have PC/NFS or
-something similar connecting the two systems, you must arrange some
-other way---perhaps floppy-disk transfer---of getting the 29K program
-from the Unix system to the PC; _GDBN__ will @emph{not} download it over the
-serial line.
-
-@node _GDBP__-EB29K, Remote Log, Comms (EB29K), EB29K Remote
-@subsubsection EB29K cross-debugging
-Finally, @code{cd} to the directory containing an image of your 29K
-program on the Unix system, and start _GDBN__---specifying as argument the
-name of your 29K program:
-@example
-cd /usr/joe/work29k
-_GDBP__ myfoo
-@end example
-Now you can use the @code{target} command:
-@example
-target amd-eb /dev/ttya 9600 MYFOO
-@end example
-@c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to
-@c emphasize that this is the name as seen by DOS (since I think DOS is
-@c single-minded about case of letters). ---pesch@cygnus.com, 25feb91
-
-@noindent
-In this example, we've assumed your program is in a file called
-@file{myfoo}. Note that the filename given as the last argument to
-@code{target amd-eb} should be the name of the program as it appears to DOS.
-In our example this is simply @code{MYFOO}, but in general it can include
-a DOS path, and depending on your transfer mechanism may not resemble
-the name on the Unix side.
-
-At this point, you can set any breakpoints you wish; when you're ready
-to see your program run on the 29K board, use the _GDBN__ command
-@code{run}.
-
-To stop debugging the remote program, use the _GDBN__ @code{detach}
-command.
-
-To return control of the PC to its console, use @code{tip} or @code{cu}
-once again, after your _GDBN__ session has concluded, to attach to
-@code{EBMON}. You can then type the command @code{q} to shut down
-@code{EBMON}, returning control to the DOS command-line interpreter.
-Type @code{CTTY con} to return command input to the main DOS console,
-and type @kbd{~.} to leave @code{tip} or @code{cu}.
-
-@node Remote Log, , _GDBP__-EB29K, EB29K Remote
-@subsubsection Remote Log
-@kindex eb.log
-@cindex log file for EB29K
-The @code{target amd-eb} command creates a file @file{eb.log} in the
-current working directory, to help debug problems with the connection.
-@file{eb.log} records all the output from @code{EBMON}, including echoes
-of the commands sent to it. Running @samp{tail -f} on this file in
-another window often helps to understand trouble with @code{EBMON}, or
-unexpected events on the PC side of the connection.
-_fi__(_AMD29K__)
-
-_if__(_VXWORKS__)
-_if__(!_GENERIC__)
-@node VxWorks Remote, , EB29K Remote, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node VxWorks Remote, , EB29K Remote, Remote
-_fi__(_GENERIC__)
-@subsection _GDBN__ and VxWorks
-@cindex VxWorks
-_GDBN__ enables developers to spawn and debug tasks running on networked
-VxWorks targets from a Unix host. Already-running tasks spawned from
-the VxWorks shell can also be debugged. _GDBN__ uses code that runs on
-both the UNIX host and on the VxWorks target. The program
-@code{_GDBP__} is installed and executed on the UNIX host.
-
-The remote debugging interface (RDB) routines are installed and executed
-on the VxWorks target. These routines are included in the VxWorks library
-@file{rdb.a} and are incorporated into the system image when source-level
-debugging is enabled in the VxWorks configuration.
-
-@kindex INCLUDE_RDB
-You can define @code{INCLUDE_RDB} in the VxWorks configuration file
-@file{configAll.h} to include the RDB interface routines and spawn the
-source debugging task @code{tRdbTask} when VxWorks is booted. For more
-information on configuring and remaking VxWorks, see the @cite{VxWorks
-Programmer's Guide}.
-
-Once you have included the RDB interface in your VxWorks system image
-and set your Unix execution search path to find _GDBN__, you are ready
-to run _GDBN__. From your UNIX host, type:
-
-@smallexample
-% _GDBP__
-@end smallexample
-
-_GDBN__ will come up showing the prompt:
-
-@smallexample
-(_GDBP__)
-@end smallexample
-
-@menu
-* VxWorks connection:: Connecting to VxWorks
-* VxWorks download:: VxWorks Download
-* VxWorks attach:: Running Tasks
-@end menu
-
-@node VxWorks connection, VxWorks download, VxWorks Remote, VxWorks Remote
-@subsubsection Connecting to VxWorks
-
-The _GDBN__ command @code{target} lets you connect to a VxWorks target on the
-network. To connect to a target whose host name is ``@code{tt}'', type:
-
-@smallexample
-(_GDBP__) target vxworks tt
-@end smallexample
-
-_GDBN__ will display a message similar to the following:
-
-@smallexample
-Attaching remote machine across net... Success!
-@end smallexample
-
-_GDBN__ will then attempt to read the symbol tables of any object
-modules loaded into the VxWorks target since it was last booted.
-_GDBN__ locates these files by searching the directories listed in the
-command search path (@pxref{Environment}); if it fails to find an
-object file, it will display a message such as:
-
-@smallexample
-prog.o: No such file or directory.
-@end smallexample
-
-This will cause the @code{target} command to abort. When this happens,
-you should add the appropriate directory to the search path, with the
-_GDBN__ command @code{path}, and execute the @code{target} command
-again.
-
-@node VxWorks download, VxWorks attach, VxWorks connection, VxWorks Remote
-@subsubsection VxWorks Download
-
-@cindex download to VxWorks
-If you have connected to the VxWorks target and you want to debug an
-object that has not yet been loaded, you can use the _GDBN__ @code{load}
-command to download a file from UNIX to VxWorks incrementally. The
-object file given as an argument to the @code{load} command is actually
-opened twice: first by the VxWorks target in order to download the code,
-then by _GDBN__ in order to read the symbol table. This can lead to
-problems if the current working directories on the two systems differ.
-It is simplest to set the working directory on both systems to the
-directory in which the object file resides, and then to reference the
-file by its name, without any path. Thus, to load a program
-@file{prog.o}, residing in @file{wherever/vw/demo/rdb}, on VxWorks type:
-
-@smallexample
--> cd "wherever/vw/demo/rdb"
-@end smallexample
-
-On _GDBN__ type:
-
-@smallexample
-(_GDBP__) cd wherever/vw/demo/rdb
-(_GDBP__) load prog.o
-@end smallexample
-
-_GDBN__ will display a response similar to the following:
-
-@smallexample
-Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
-@end smallexample
-
-You can also use the @code{load} command to reload an object module
-after editing and recompiling the corresponding source file. Note that
-this will cause _GDBN__ to delete all currently-defined breakpoints,
-auto-displays, and convenience variables, and to clear the value
-history. (This is necessary in order to preserve the integrity of
-debugger data structures that reference the target system's symbol
-table.)
-
-@node VxWorks attach, , VxWorks download, VxWorks Remote
-@subsubsection Running Tasks
-
-@cindex running VxWorks tasks
-You can also attach to an existing task using the @code{attach} command as
-follows:
-
-@smallexample
-(_GDBP__) attach @var{task}
-@end smallexample
-
-where @var{task} is the VxWorks hexadecimal task ID. The task can be running
-or suspended when you attach to it. If running, it will be suspended at
-the time of attachment.
-
-_fi__(_VXWORKS__)
diff --git a/gdb/doc/gen.m4 b/gdb/doc/gen.m4
deleted file mode 100644
index be995bf..0000000
--- a/gdb/doc/gen.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-_divert__(-1)
-_define__(<_GENERIC__>,<1>) In case none.m4 changes its mind abt default
-
-_define__(<_AOUT__>,<1>)
-_define__(<_COFF__>,<1>)
-_define__(<_ELF__>,<1>)
-
-_define__(<_I80386__>,<1>)
-_define__(<_M680X0__>,<1>)
-_define__(<_SPARC__>,<1>)
-_define__(<_VAX__>,<1>)
-
-_divert__<> \ No newline at end of file
diff --git a/gdb/doc/i80386.m4 b/gdb/doc/i80386.m4
deleted file mode 100644
index d8293d1..0000000
--- a/gdb/doc/i80386.m4
+++ /dev/null
@@ -1,5 +0,0 @@
-_divert__(-1)
-_define__(<_I80386__>,<1>)
-_define__(<_HOST__>,<Intel 80386>)
-_define__(<_MACH_DEP__>,<80386 Dependent>
-_divert__<> \ No newline at end of file
diff --git a/gdb/doc/i960.m4 b/gdb/doc/i960.m4
deleted file mode 100644
index e98155d..0000000
--- a/gdb/doc/i960.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-_divert__(-1)
-_define__(<_I960__>,<1>)
-_define__(<_AOUT__>,<0>)
-_define__(<_BOUT__>,<1>)
-_define__(<_COFF__>,<1>)
-_define__(<_AS__>,<gas960>)
-_define__(<_GCC__>,<gcc960>)
-_define__(<_LD__>,<gld960>)
-_define__(<_GDB__>,<gdb960>)
-_define__(<_HOST__>,<Intel 960>)
-_define__(<_MACH_DEP__>,<i960 Dependent>)
-_divert__<> \ No newline at end of file
diff --git a/gdb/doc/interim-gdb.texinfo b/gdb/doc/interim-gdb.texinfo
deleted file mode 100755
index 53a01e4..0000000
--- a/gdb/doc/interim-gdb.texinfo
+++ /dev/null
@@ -1,7901 +0,0 @@
-_dnl__ -*-Texinfo-*-
-_dnl__ Copyright (c) 1988 1989 1990 1991 Free Software Foundation, Inc.
-\input texinfo
-@setfilename _GDBP__.info
-@c $Id$
-@c THIS MANUAL REQUIRES TEXINFO-2 macros and info-makers to format properly.
-@c
-@c NOTE: this manual is marked up for preprocessing with a collection
-@c of m4 macros called "pretex.m4". If you see <_if__> and <_fi__>
-@c scattered around the source, you have the full source before
-@c preprocessing; if you don't, you have the source configured for
-@c _HOST__ architectures (and you can of course get the full source,
-@c with all configurations, from wherever you got this).
-_if__(0)
-
-THIS IS THE SOURCE PRIOR TO PREPROCESSING. The full source needs to
-be run through m4 before either tex- or info- formatting: for example,
-_0__
- m4 pretex.m4 none.m4 all.m4 gdb.texinfo >gdb-all.texinfo
-_1__
-will produce (assuming your path finds either GNU m4 >= 0.84, or SysV
-m4; Berkeley won't do) a file suitable for formatting. See the text in
-"pretex.m4" for a fuller explanation (and the macro definitions).
-
-_fi__(0)
-_include__(gdbVN.m4)
-@tex
-\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision$} % For use in headers, footers too
-@end tex
-@c
-@syncodeindex ky cp
-@c FOR UPDATES LEADING TO THIS DRAFT, GDB CHANGELOG CONSULTED BETWEEN:
-@c Fri Sep 20 16:10:52 1991 John Gilmore (gnu at cygnus.com)
-@c Sat Dec 22 02:51:40 1990 John Gilmore (gnu at cygint)
-@ifinfo
-This file documents the GNU debugger _GDBN__.
-
-Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
-@end ifinfo
-@c @smallbook
-@setchapternewpage odd
-_if__(_GENERIC__)
-@settitle Using _GDBN__ (<v>_GDB_VN__)
-_fi__(_GENERIC__)
-_if__(!_GENERIC__)
-@settitle Using _GDBN__ <v>_GDB_VN__ (_HOST__)
-_fi__(!_GENERIC__)
-@iftex
-@finalout
-@end iftex
-@titlepage
-@title{Using _GDBN__}
-@subtitle{A Guide to the GNU Source-Level Debugger}
-_if__(!_GENERIC__)
-@subtitle{On _HOST__ Systems}
-_fi__(!_GENERIC__)
-@sp 1
-@c Maybe crank this up to "Fourth Edition" when released at FSF
-@c @subtitle Third Edition---_GDBN__ version _GDB_VN__
-@subtitle _GDBN__ version _GDB_VN__
-@subtitle July 1991
-@author{Richard M. Stallman@qquad @hfill Free Software Foundation}
-@author{Roland H. Pesch@qquad @hfill Cygnus Support}
-@page
-@tex
-{\parskip=0pt
-\hfill rms\@ai.mit.edu, pesch\@cygnus.com\par
-\hfill {\it Using _GDBN__}, \manvers\par
-\hfill \TeX{}info \texinfoversion\par
-}
-@end tex
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
-@end titlepage
-@page
-
-@node Top, Summary, (dir), (dir)
-@ifinfo
-This file describes version _GDB_VN__ of GDB, the GNU symbolic debugger.
-@end ifinfo
-
-@menu
-* Summary:: Summary of _GDBN__
-* New Features:: New Features in _GDBN__ version _GDB_VN__
-* Sample Session:: A Sample _GDBN__ Session
-* Invocation:: Getting In and Out of _GDBN__
-* Commands:: _GDBN__ Commands
-* Running:: Running Programs Under _GDBN__
-* Stopping:: Stopping and Continuing
-* Stack:: Examining the Stack
-* Source:: Examining Source Files
-* Data:: Examining Data
-* Languages:: Using _GDBN__ with Different Languages
-* Symbols:: Examining the Symbol Table
-* Altering:: Altering Execution
-* _GDBN__ Files:: _GDBN__'s Files
-* Targets:: Specifying a Debugging Target
-* Controlling _GDBN__:: Controlling _GDBN__
-* Sequences:: Canned Sequences of Commands
-* Emacs:: Using _GDBN__ under GNU Emacs
-* _GDBN__ Bugs:: Reporting Bugs in _GDBN__
-* Renamed Commands::
-* Installing _GDBN__:: Installing _GDBN__
-* Copying:: GNU GENERAL PUBLIC LICENSE
-* Index:: Index
-
- --- The Detailed Node Listing ---
-
-Summary of _GDBN__
-
-* Free Software:: Free Software
-* Contributors:: Contributors to _GDBN__
-
-Getting In and Out of _GDBN__
-
-* Starting _GDBN__:: Starting _GDBN__
-* Leaving _GDBN__:: Leaving _GDBN__
-* Shell Commands:: Shell Commands
-
-Starting _GDBN__
-
-* File Options:: Choosing Files
-* Mode Options:: Choosing Modes
-
-_GDBN__ Commands
-
-* Command Syntax:: Command Syntax
-* Help:: Getting Help
-
-Running Programs Under _GDBN__
-
-* Compilation:: Compiling for Debugging
-* Starting:: Starting your Program
-* Arguments:: Your Program's Arguments
-* Environment:: Your Program's Environment
-* Working Directory:: Your Program's Working Directory
-* Input/Output:: Your Program's Input and Output
-* Attach:: Debugging an Already-Running Process
-* Kill Process:: Killing the Child Process
-
-Stopping and Continuing
-
-* Breakpoints:: Breakpoints, Watchpoints, and Exceptions
-* Continuing and Stepping:: Resuming Execution
-* Signals:: Signals
-
-Breakpoints, Watchpoints, and Exceptions
-
-* Set Breaks:: Setting Breakpoints
-* Set Watchpoints:: Setting Watchpoints
-* Exception Handling:: Breakpoints and Exceptions
-* Delete Breaks:: Deleting Breakpoints
-* Disabling:: Disabling Breakpoints
-* Conditions:: Break Conditions
-* Break Commands:: Breakpoint Command Lists
-* Breakpoint Menus:: Breakpoint Menus
-* Error in Breakpoints:: ``Cannot insert breakpoints''
-
-Examining the Stack
-
-* Frames:: Stack Frames
-* Backtrace:: Backtraces
-* Selection:: Selecting a Frame
-* Frame Info:: Information on a Frame
-
-Examining Source Files
-
-* List:: Printing Source Lines
-* Search:: Searching Source Files
-* Source Path:: Specifying Source Directories
-* Machine Code:: Source and Machine Code
-
-Examining Data
-
-* Expressions:: Expressions
-* Variables:: Program Variables
-* Arrays:: Artificial Arrays
-* Output formats:: Output formats
-* Memory:: Examining Memory
-* Auto Display:: Automatic Display
-* Print Settings:: Print Settings
-* Value History:: Value History
-* Convenience Vars:: Convenience Variables
-* Registers:: Registers
-* Floating Point Hardware:: Floating Point Hardware
-
-Using GDB with Different Languages
-
-* Setting:: Switching between source languages
-* Show:: Displaying the language
-* Checks:: Type and Range checks
-* Support:: Supported languages
-
-Switching between source languages
-
-* Manually:: Setting the working language manually
-* Automatically:: Having GDB infer the source language
-
-Type and range Checking
-
-* Type Checking:: An overview of type checking
-* Range Checking:: An overview of range checking
-
-Supported Languages
-
-* C:: C and C++
-* Modula-2:: Modula-2
-
-C and C++
-
-* C Operators:: C and C++ Operators
-* C Constants:: C and C++ Constants
-* Cplusplus expressions:: C++ Expressions
-* C Defaults:: Default settings for C and C++
-* C Checks:: C and C++ Type and Range Checks
-* Debugging C:: _GDBN__ and C
-* Debugging C plus plus:: Special features for C++
-
-Modula-2
-
-* M2 Operators:: Built-in operators
-* Builtin Func/Proc:: Built-in Functions and Procedures
-* M2 Constants:: Modula-2 Constants
-* M2 Defaults:: Default settings for Modula-2
-* Deviations:: Deviations from standard Modula-2
-* M2 Checks:: Modula-2 Type and Range Checks
-* M2 Scope:: The scope operators @code{::} and @code{.}
-* GDB/M2:: GDB and Modula-2
-
-Altering Execution
-
-* Assignment:: Assignment to Variables
-* Jumping:: Continuing at a Different Address
-* Signaling:: Giving the Program a Signal
-* Returning:: Returning from a Function
-* Calling:: Calling your Program's Functions
-* Patching:: Patching your Program
-
-_GDBN__'s Files
-
-* Files:: Commands to Specify Files
-* Symbol Errors:: Errors Reading Symbol Files
-
-Specifying a Debugging Target
-
-* Active Targets:: Active Targets
-* Target Commands:: Commands for Managing Targets
-* Remote:: Remote Debugging
-
-Remote Debugging
-
-* i960-Nindy Remote:: _GDBN__ with a Remote i960 (Nindy)
-* EB29K Remote:: _GDBN__ with a Remote EB29K
-* VxWorks Remote:: _GDBN__ and VxWorks
-
-_GDBN__ with a Remote i960 (Nindy)
-
-* Nindy Startup:: Startup with Nindy
-* Nindy Options:: Options for Nindy
-* Nindy reset:: Nindy Reset Command
-
-_GDBN__ with a Remote EB29K
-
-* Comms (EB29K):: Communications Setup
-* gdb-EB29K:: EB29K cross-debugging
-* Remote Log:: Remote Log
-
-_GDBN__ and VxWorks
-
-* VxWorks connection:: Connecting to VxWorks
-* VxWorks download:: VxWorks Download
-* VxWorks attach:: Running Tasks
-
-Controlling _GDBN__
-
-* Prompt:: Prompt
-* Editing:: Command Editing
-* History:: Command History
-* Screen Size:: Screen Size
-* Numbers:: Numbers
-* Messages/Warnings:: Optional Warnings and Messages
-
-Canned Sequences of Commands
-
-* Define:: User-Defined Commands
-* Command Files:: Command Files
-* Output:: Commands for Controlled Output
-
-Reporting Bugs in _GDBN__
-
-* Bug Criteria:: Have You Found a Bug?
-* Bug Reporting:: How to Report Bugs
-
-Installing GDB
-
-* Subdirectories:: Configuration subdirectories
-* Config Names:: Specifying names for hosts and targets
-* configure Options:: Summary of options for configure
-* Formatting Documentation:: How to format and print GDB documentation
-@end menu
-
-@node Summary, New Features, Top, Top
-@unnumbered Summary of _GDBN__
-
-The purpose of a debugger such as _GDBN__ is to allow you to see what is
-going on ``inside'' another program while it executes---or what another
-program was doing at the moment it crashed.
-
-_GDBN__ can do four main kinds of things (plus other things in support of
-these) to help you catch bugs in the act:
-
-@itemize @bullet
-@item
-Start your program, specifying anything that might affect its behavior.
-
-@item
-Make your program stop on specified conditions.
-
-@item
-Examine what has happened, when your program has stopped.
-
-@item
-Change things in your program, so you can experiment with correcting the
-effects of one bug and go on to learn about another.
-@end itemize
-
-You can use _GDBN__ to debug programs written in C, C++, and Modula-2.
-Fortran support will be added when a GNU Fortran compiler is ready.
-
-@menu
-* Free Software:: Free Software
-* Contributors:: Contributors to GDB
-@end menu
-
-@node Free Software, Contributors, Summary, Summary
-@unnumberedsec Free Software
-_GDBN__ is @dfn{free software}, protected by the GNU General Public License (GPL).
-The GPL gives you the freedom to copy or adapt a licensed
-program---but every person getting a copy also gets with it the
-freedom to modify that copy (which means that they must get access to
-the source code), and the freedom to distribute further copies.
-Typical software companies use copyrights to limit your freedoms; the
-Free Software Foundation uses the GPL to preserve these freedoms.
-
-Fundamentally, the General Public License is a license which says that
-you have these freedoms and that you can't take these freedoms away
-from anyone else.
-
-@c FIXME: (passim) go through all xrefs, expanding to use text headings
-For full details, @pxref{Copying}.
-@node Contributors, , Free Software, Summary
-@unnumberedsec Contributors to GDB
-
-Richard Stallman was the original author of GDB, and of many other GNU
-programs. Many others have contributed to its development. This
-section attempts to credit major contributors. One of the virtues of
-free software is that everyone is free to contribute to it; with
-regret, we cannot actually acknowledge everyone here. The file
-@file{ChangeLog} in the GDB distribution approximates a blow-by-blow
-account.
-
-Changes much prior to version 2.0 are lost in the mists of time.
-
-@quotation
-@emph{Plea:} Additions to this section are particularly welcome. If you
-or your friends (or enemies; let's be evenhanded) have been unfairly
-omitted from this list, we would like to add your names!
-@end quotation
-
-So that they may not regard their long labor as thankless, we
-particularly thank those who shepherded GDB through major releases: John
-Gilmore (releases _GDB_VN__, 4.0); Jim Kingdon (releases 3.9, 3.5, 3.4, 3.3);
-and Randy Smith (releases 3.2, 3.1, 3.0). As major maintainer of GDB
-for some period, each contributed significantly to the structure,
-stability, and capabilities of the entire debugger.
-
-Richard Stallman, assisted at various times by Pete TerMaat, Chris
-Hanson, and Richard Mlynarik, handled releases through 2.8.
-
-Michael Tiemann is the author of most of the GNU C++ support in GDB,
-with significant additional contributions from Per Bothner. James
-Clark wrote the GNU C++ demangler. Early work on C++ was by Peter
-TerMaat (who also did much general update work leading to release 3.0).
-
-GDB _GDB_VN__ uses the BFD subroutine library to examine multiple
-object-file formats; BFD was a joint project of V. Gumby
-Henkel-Wallace, Rich Pixley, Steve Chamberlain, and John Gilmore.
-
-David Johnson wrote the original COFF support; Pace Willison did
-the original support for encapsulated COFF.
-
-Adam de Boor and Bradley Davis contributed the ISI Optimum V support.
-Per Bothner, Noboyuki Hikichi, and Alessandro Forin contributed MIPS
-support. Jean-Daniel Fekete contributed Sun 386i support. Chris
-Hanson improved the HP9000 support. Noboyuki Hikichi and Tomoyuki
-Hasei contributed Sony/News OS 3 support. David Johnson contributed
-Encore Umax support. Jyrki Kuoppala contributed Altos 3068 support.
-Keith Packard contributed NS32K support. Doug Rabson contributed
-Acorn Risc Machine support. Chris Smith contributed Convex support
-(and Fortran debugging). Jonathan Stone contributed Pyramid support.
-Michael Tiemann contributed SPARC support. Tim Tucker contributed
-support for the Gould NP1 and Gould Powernode. Pace Willison
-contributed Intel 386 support. Jay Vosburgh contributed Symmetry
-support.
-
-Rich Schaefer and Peter Schauer helped with support of SunOS shared
-libraries.
-
-Jay Fenlason and Roland McGrath ensured that GDB and GAS agree about
-several machine instruction sets.
-
-Patrick Duval, Ted Goldstein, Vikram Koka and Glenn Engel helped
-develop remote debugging. Intel Corporation and Wind River Systems
-contributed remote debugging modules for their products.
-
-Brian Fox is the author of the readline libraries providing
-command-line editing and command history.
-
-Andrew Beers of SUNY Buffalo wrote the language-switching code and
-the Modula-2 support, and contributed the Languages chapter of this
-manual.
-
-@node New Features, Sample Session, Summary, Top
-@unnumbered New Features since _GDBN__ version 3.5
-
-@table @emph
-@item Targets
-Using the new command @code{target}, you can select at runtime whether
-you are debugging local files, local processes, standalone systems over
-a serial port, realtime systems over a TCP/IP connection, etc. The
-command @code{load} can download programs into a remote system. Serial
-stubs are available for Motorola 680x0 and Intel 80386 remote systems;
-_GDBN__ also supports debugging realtime processes running under
-VxWorks, using SunRPC Remote Procedure Calls over TCP/IP to talk to a
-debugger stub on the target system. Internally, _GDBN__ now uses a
-function vector to mediate access to different targets; if you need to
-add your own support for a remote protocol, this makes it much easier.
-
-@item Watchpoints
-_GDBN__ now sports watchpoints as well as breakpoints. You can use a
-watchpoint to stop execution whenever the value of an expression
-changes, without having to predict a particular place in your program
-where this may happen.
-
-@item Wide Output
-Commands that issue wide output now insert newlines at places designed
-to make the output more readable.
-
-@item Object Code Formats
-_GDBN__ uses a new library called the Binary File Descriptor (BFD)
-Library to permit it to switch dynamically, without reconfiguration or
-recompilation, between different object-file formats. Formats currently
-supported are COFF, a.out, and the Intel 960 b.out; files may be read as
-.o's, archive libraries, or core dumps. BFD is available as a
-subroutine library so that other programs may take advantage of it, and
-the other GNU binary utilities are being converted to use it.
-
-@item Configuration and Ports
-Compile-time configuration (to select a particular architecture and
-operating system) is much easier. The script @code{configure} now
-allows you to configure _GDBN__ as either a native debugger or a
-cross-debugger. @xref{Installing _GDBN__} for details on how to
-configure and on what architectures are now available.
-
-@item Interaction
-The user interface to _GDBN__'s control variables has been simplified
-and consolidated in two commands, @code{set} and @code{show}. Output
-lines are now broken at readable places, rather than overflowing onto
-the next line. You can suppress output of machine-level addresses,
-displaying only source language information.
-
-
-@item C++
-_GDBN__ now supports C++ multiple inheritance (if used with a GCC
-version 2 compiler), and also has limited support for C++ exception
-handling, with the commands @code{catch} and @code{info catch}: _GDBN__
-can break when an exception is raised, before the stack is peeled back
-to the exception handler's context.
-
-@item Modula-2
-_GDBN__ now has preliminary support for the GNU Modula-2 compiler,
-currently under development at the State University of New York at
-Buffalo. Coordinated development of both _GDBN__ and the GNU Modula-2
-compiler will continue through the fall of 1991 and into 1992. Other
-Modula-2 compilers are currently not supported, and attempting to debug
-programs compiled with them will likely result in an error as the symbol
-table of the executable is read in.
-
-@item Command Rationalization
-Many _GDBN__ commands have been renamed to make them easier to remember
-and use. In particular, the subcommands of @code{info} and
-@code{show}/@code{set} are grouped to make the former refer to the state
-of your program, and the latter refer to the state of _GDBN__ itself.
-@xref{Renamed Commands}, for details on what commands were renamed.
-
-@item Shared Libraries
-_GDBN__ _GDB_VN__ can debug programs and core files that use SunOS shared
-libraries.
-
-@item Reference Card
-_GDBN__ _GDB_VN__ has a reference card; @xref{Formatting Documentation} for
-instructions on printing it.
-
-@item Work in Progress
-Kernel debugging for BSD and Mach systems; Tahoe and HPPA architecture
-support.
-
-@end table
-
-@node Sample Session, Invocation, New Features, Top
-@chapter A Sample _GDBN__ Session
-
-You can use this manual at your leisure to read all about _GDBN__.
-However, a handful of commands are enough to get started using the
-debugger. This chapter illustrates these commands.
-
-@iftex
-In this sample session, we emphasize user input like this: @i{input},
-to make it easier to pick out from the surrounding output.
-@end iftex
-
-@c FIXME: this example may not be appropriate for some configs, where
-@c FIXME...primary interest is in remote use.
-_0__
-One of the preliminary versions of GNU @code{m4} (a generic macro
-processor) exhibits the following bug: sometimes, when we change its
-quote strings from the default, the commands used to capture one macro's
-definition in another stop working. In the following short @code{m4}
-session, we define a macro @code{foo} which expands to @code{0000}; we
-then use the @code{m4} builtin @code{defn} to define @code{bar} as the
-same thing. However, when we change the open quote string to
-@code{<QUOTE>} and the close quote string to @code{<UNQUOTE>}, the same
-procedure fails to define a new synonym @code{baz}:
-
-@smallexample
-$ @i{cd gnu/m4}
-$ @i{./m4}
-@i{define(foo,0000)}
-
-@i{foo}
-0000
-@i{define(bar,defn(`foo'))}
-
-@i{bar}
-0000
-@i{changequote(<QUOTE>,<UNQUOTE>)}
-
-@i{define(baz,defn(<QUOTE>foo<UNQUOTE>))}
-@i{baz}
-@i{C-d}
-m4: End of input: 0: fatal error: EOF in string
-@end smallexample
-
-@noindent
-Let's use _GDBN__ to try to see what's going on.
-
-@smallexample
-$ @i{_GDBP__ m4}
-GDB is free software and you are welcome to distribute copies of it
- under certain conditions; type "info copying" to see the conditions.
-There is absolutely no warranty for GDB; type "info warranty" for details.
-GDB _GDB_VN__, Copyright 1991 Free Software Foundation, Inc...
-(_GDBP__)
-@end smallexample
-
-@noindent
-_GDBN__ reads only enough symbol data to know where to find the rest
-when needed; as a result, the first prompt comes up very quickly. We
-then tell _GDBN__ to use a narrower display width than usual, so
-that examples will fit in this manual.
-
-@smallexample
-(_GDBP__) @i{set width 70}
-@end smallexample
-
-@noindent
-Let's see how the @code{m4} builtin @code{changequote} works.
-Having looked at the source, we know the relevant subroutine is
-@code{m4_changequote}, so we set a breakpoint there with _GDBN__'s
-@code{break} command.
-
-@smallexample
-(_GDBP__) @i{break m4_changequote}
-Breakpoint 1 at 0x62f4: file builtin.c, line 879.
-@end smallexample
-
-@noindent
-Using the @code{run} command, we start @code{m4} running under _GDBN__
-control; as long as control does not reach the @code{m4_changequote}
-subroutine, the program runs as usual:
-
-@smallexample
-(_GDBP__) @i{run}
-Starting program: /work/Editorial/gdb/gnu/m4/m4
-@i{define(foo,0000)}
-
-@i{foo}
-0000
-@end smallexample
-
-@noindent
-To trigger the breakpoint, we call @code{changequote}. _GDBN__
-suspends execution of @code{m4}, displaying information about the
-context where it stops.
-
-@smallexample
-@i{changequote(<QUOTE>,<UNQUOTE>)}
-
-Breakpoint 1, m4_changequote (argc=3, argv=0x33c70) at builtin.c:879
-879 if (bad_argc(TOKEN_DATA_TEXT(argv[0]), argc, 1, 3))
-@end smallexample
-
-@noindent
-Now we use the command @code{n} (@code{next}) to advance execution to
-the next line of the current function.
-
-@smallexample
-(_GDBP__) @i{n}
-882 set_quotes((argc >= 2) ? TOKEN_DATA_TEXT(argv[1]) : nil,
-@end smallexample
-
-@noindent
-@code{set_quotes} looks like a promising subroutine. We can go into it
-by using the command @code{s} (@code{step}) instead of @code{next}.
-@code{step} goes to the next line to be executed in @emph{any}
-subroutine, so it steps into @code{set_quotes}.
-
-@smallexample
-(_GDBP__) @i{s}
-set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")
- at input.c:530
-530 if (lquote != def_lquote)
-@end smallexample
-
-@noindent
-The summary display showing the subroutine where @code{m4} is now
-suspended (and its arguments) is called a stack frame display. We can
-use the @code{backtrace} command (which can also be spelled @code{bt}),
-to see where we are in the stack: it displays a stack frame for each
-active subroutine.
-
-@smallexample
-(_GDBP__) @i{bt}
-#0 set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")
- at input.c:530
-#1 0x6344 in m4_changequote (argc=3, argv=0x33c70) at builtin.c:882
-#2 0x8174 in expand_macro (sym=0x33320) at macro.c:242
-#3 0x7a88 in expand_token (obs=0x0, t=209696, td=0xf7fffa30)
- at macro.c:71
-#4 0x79dc in expand_input () at macro.c:40
-#5 0x2930 in main (argc=0, argv=0xf7fffb20) at m4.c:195
-@end smallexample
-
-@noindent
-Let's step through a few more lines to see what happens. The first two
-times, we can use @samp{s}; the next two times we use @code{n} to avoid
-falling into the @code{xstrdup} subroutine.
-@smallexample
-(_GDBP__) @i{s}
-0x3b5c 532 if (rquote != def_rquote)
-(_GDBP__) @i{s}
-0x3b80 535 lquote = (lq == nil || *lq == '\0') ? def_lquote :\
- xstrdup(lq);
-(_GDBP__) @i{n}
-536 rquote = (rq == nil || *rq == '\0') ? def_rquote : xstrdup\
-(rq);
-(_GDBP__) @i{n}
-538 len_lquote = strlen(rquote);
-@end smallexample
-
-@noindent
-The last line displayed looks a little odd; let's examine the variables
-@code{lquote} and @code{rquote} to see if they are in fact the new left
-and right quotes we specified. We can use the command @code{p}
-(@code{print}) to see their values.
-
-@smallexample
-(_GDBP__) @i{p lquote}
-$1 = 0x35d40 "<QUOTE>"
-(_GDBP__) @i{p rquote}
-$2 = 0x35d50 "<UNQUOTE>"
-@end smallexample
-
-@noindent
-@code{lquote} and @code{rquote} are indeed the new left and right quotes.
-Let's look at some context; we can display ten lines of source
-surrounding the current line, with the @code{l} (@code{list}) command.
-
-@smallexample
-(_GDBP__) @i{l}
-533 xfree(rquote);
-534
-535 lquote = (lq == nil || *lq == '\0') ? def_lquote : xstrdup\
-(lq);
-536 rquote = (rq == nil || *rq == '\0') ? def_rquote : xstrdup\
-(rq);
-537
-538 len_lquote = strlen(rquote);
-539 len_rquote = strlen(lquote);
-540 @}
-541
-542 void
-@end smallexample
-
-@noindent
-Let's step past the two lines that set @code{len_lquote} and
-@code{len_rquote}, and then examine the values of those variables.
-
-@smallexample
-(_GDBP__) @i{n}
-539 len_rquote = strlen(lquote);
-(_GDBP__) @i{n}
-540 @}
-(_GDBP__) @i{p len_lquote}
-$3 = 9
-(_GDBP__) @i{p len_rquote}
-$4 = 7
-@end smallexample
-
-@noindent
-That certainly looks wrong, assuming @code{len_lquote} and
-@code{len_rquote} are meant to be the lengths of @code{lquote} and
-@code{rquote} respectively. Let's try setting them to better values.
-We can use the @code{p} command for this, since it'll print the value of
-any expression---and that expression can include subroutine calls and
-assignments.
-
-@smallexample
-(_GDBP__) p len_lquote=strlen(lquote)
-$5 = 7
-(_GDBP__) p len_rquote=strlen(rquote)
-$6 = 9
-@end smallexample
-
-@noindent
-Let's see if that fixes the problem of using the new quotes with the
-@code{m4} built-in @code{defn}. We can allow @code{m4} to continue
-executing with the @code{c} (@code{continue}) command, and then try the
-example that caused trouble initially:
-
-@smallexample
-(_GDBP__) @i{c}
-Continuing.
-
-@i{define(baz,defn(<QUOTE>foo<UNQUOTE>))}
-
-baz
-0000
-@end smallexample
-
-@noindent
-Success! The new quotes now work just as well as the default ones. The
-problem seems to have been just the two typos defining the wrong
-lengths. We'll let @code{m4} exit by giving it an EOF as input.
-
-@smallexample
-@i{C-d}
-Program exited normally.
-@end smallexample
-
-@noindent
-The message @samp{Program exited normally.} is from _GDBN__; it
-indicates @code{m4} has finished executing. We can end our _GDBN__
-session with the _GDBN__ @code{quit} command.
-
-@smallexample
-(_GDBP__) @i{quit}
-_1__@end smallexample
-
-@node Invocation, Commands, Sample Session, Top
-@chapter Getting In and Out of _GDBN__
-
-@menu
-* Starting _GDBN__:: Starting _GDBN__
-* Leaving _GDBN__:: Leaving _GDBN__
-* Shell Commands:: Shell Commands
-@end menu
-
-@node Starting _GDBN__, Leaving _GDBN__, Invocation, Invocation
-@section Starting _GDBN__
-
-_GDBN__ is invoked with the shell command @code{_GDBP__}. Once started,
-it reads commands from the terminal until you tell it to exit.
-
-You can run @code{_GDBP__} with no arguments or options; but the most
-usual way to start _GDBN__ is with one argument or two, specifying an
-executable program as the argument:
-@example
-_GDBP__ program
-@end example
-@noindent
-You can also start with both an executable program and a core file specified:
-@example
-_GDBP__ program core
-@end example
-
-You can, instead, specify a process ID as a second argument, if you want
-to debug a running process:
-@example
-_GDBP__ program 1234
-@end example
-@noindent
-would attach _GDBN__ to process @code{1234} (unless you also have a file
-named @file{1234}; _GDBN__ does check for a core file first).
-
-@noindent
-You can further control how _GDBN__ starts up by using command-line
-options. _GDBN__ itself can remind you of the options available:
-@example
-_GDBP__ -help
-@end example
-@noindent
-will display all available options and briefly describe their use
-(@samp{_GDBP__ -h} is a shorter equivalent).
-
-All options and command line arguments you give are processed
-in sequential order. The order makes a difference when the
-@samp{-x} option is used.
-
-@menu
-* File Options:: Choosing Files
-* Mode Options:: Choosing Modes
-_if__(!_GENERIC__)
-_include__(gdbinv-m.m4)_dnl__
-_fi__(!_GENERIC__)
-@end menu
-
-@node File Options, Mode Options, Starting _GDBN__, Starting _GDBN__
-@subsection Choosing Files
-
-As shown above, any arguments other than options specify an executable
-file and core file; that is, the first argument encountered with no
-associated option flag is equivalent to a @samp{-se} option, and the
-second, if any, is equivalent to a @samp{-c} option. Many options have
-both long and short forms; both are shown here. The long forms are also
-recognized if you truncate them, so long as enough of the option is
-present to be unambiguous. (If you prefer, you can flag option
-arguments with @samp{+} rather than @samp{-}, though we illustrate the
-more usual convention.)
-
-@table @code
-@item -symbols=@var{file}
-@itemx -s @var{file}
-Read symbol table from file @var{file}.
-
-@item -exec=@var{file}
-@itemx -e @var{file}
-Use file @var{file} as the executable file to execute when
-appropriate, and for examining pure data in conjunction with a core
-dump.
-
-@item -se=@var{file}
-Read symbol table from file @var{file} and use it as the executable
-file.
-
-@item -core=@var{file}
-@itemx -c @var{file}
-Use file @var{file} as a core dump to examine.
-
-@item -command=@var{file}
-@itemx -x @var{file}
-Execute _GDBN__ commands from file @var{file}. @xref{Command Files}.
-
-@item -directory=@var{directory}
-@itemx -d @var{directory}
-Add @var{directory} to the path to search for source files.
-@end table
-
-_if__(!_GENERIC__)
-@node Mode Options, Mode Options, File Options, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node Mode Options, , File Options, Starting _GDBN__
-_fi__(_GENERIC__)
-@subsection Choosing Modes
-
-@table @code
-@item -nx
-@itemx -n
-Do not execute commands from any @file{_GDBINIT__} initialization files.
-Normally, the commands in these files are executed after all the
-command options and arguments have been processed.
-@xref{Command Files}.
-
-@item -quiet
-@itemx -q
-``Quiet''. Do not print the introductory and copyright messages. These
-messages are also suppressed in batch mode.
-
-@item -batch
-Run in batch mode. Exit with status @code{0} after processing all the command
-files specified with @samp{-x} (and @file{_GDBINIT__}, if not inhibited).
-Exit with nonzero status if an error occurs in executing the _GDBN__
-commands in the command files.
-
-Batch mode may be useful for running _GDBN__ as a filter, for example to
-download and run a program on another computer; in order to make this
-more useful, the message
-@example
-Program exited normally.
-@end example
-@noindent
-(which is ordinarily issued whenever a program running under _GDBN__ control
-terminates) is not issued when running in batch mode.
-
-@item -cd=@var{directory}
-Run _GDBN__ using @var{directory} as its working directory,
-instead of the current directory.
-
-@item -fullname
-@itemx -f
-Emacs sets this option when it runs _GDBN__ as a subprocess. It tells _GDBN__
-to output the full file name and line number in a standard,
-recognizable fashion each time a stack frame is displayed (which
-includes each time the program stops). This recognizable format looks
-like two @samp{\032} characters, followed by the file name, line number
-and character position separated by colons, and a newline. The
-Emacs-to-_GDBN__ interface program uses the two @samp{\032} characters as
-a signal to display the source code for the frame.
-
-@item -b @var{bps}
-Set the line speed (baud rate or bits per second) of any serial
-interface used by _GDBN__ for remote debugging.
-
-@item -tty=@var{device}
-Run using @var{device} for your program's standard input and output.
-@c FIXME: kingdon thinks there's more to -tty. Investigate.
-@end table
-
-_if__(!_GENERIC__)
-_include__(gdbinv-s.m4)
-_fi__(!_GENERIC__)
-
-@node Leaving _GDBN__, Shell Commands, Starting _GDBN__, Invocation
-@section Leaving _GDBN__
-@cindex exiting _GDBN__
-@table @code
-@item quit
-@kindex quit
-@kindex q
-To exit _GDBN__, use the @code{quit} command (abbreviated @code{q}), or type
-an end-of-file character (usually @kbd{C-d}).
-@end table
-
-@cindex interrupt
-An interrupt (often @kbd{C-c}) will not exit from _GDBN__, but rather
-will terminate the action of any _GDBN__ command that is in progress and
-return to _GDBN__ command level. It is safe to type the interrupt
-character at any time because _GDBN__ does not allow it to take effect
-until a time when it is safe.
-
-If you've been using _GDBN__ to control an attached process or device,
-you can release it with the @code{detach} command; @pxref{Attach}.
-
-@node Shell Commands, , Leaving _GDBN__, Invocation
-@section Shell Commands
-If you need to execute occasional shell commands during your
-debugging session, there's no need to leave or suspend _GDBN__; you can
-just use the @code{shell} command.
-
-@table @code
-@item shell @var{command string}
-@kindex shell
-@cindex shell escape
-Directs _GDBN__ to invoke an inferior shell to execute @var{command
-string}. If it exists, the environment variable @code{SHELL} is used
-for the name of the shell to run. Otherwise _GDBN__ uses
-@code{/bin/sh}.
-@end table
-
-The utility @code{make} is often needed in development environments.
-You don't have to use the @code{shell} command for this purpose in _GDBN__:
-
-@table @code
-@item make @var{make-args}
-@kindex make
-@cindex calling make
-Causes _GDBN__ to execute an inferior @code{make} program with the specified
-arguments. This is equivalent to @samp{shell make @var{make-args}}.
-@end table
-
-@node Commands, Running, Invocation, Top
-@chapter _GDBN__ Commands
-
-@menu
-* Command Syntax:: Command Syntax
-* Help:: Getting Help
-@end menu
-
-@node Command Syntax, Help, Commands, Commands
-@section Command Syntax
-A _GDBN__ command is a single line of input. There is no limit on how long
-it can be. It starts with a command name, which is followed by arguments
-whose meaning depends on the command name. For example, the command
-@code{step} accepts an argument which is the number of times to step,
-as in @samp{step 5}. You can also use the @code{step} command with
-no arguments. Some command names do not allow any arguments.
-
-@cindex abbreviation
-_GDBN__ command names may always be truncated if that abbreviation is
-unambiguous. Other possible command abbreviations are listed in the
-documentation for individual commands. In some cases, even ambiguous
-abbreviations are allowed; for example, @code{s} is specially defined as
-equivalent to @code{step} even though there are other commands whose
-names start with @code{s}. You can test abbreviations by using them as
-arguments to the @code{help} command.
-
-@cindex repeating commands
-@kindex RET
-A blank line as input to _GDBN__ (typing just @key{RET}) means to
-repeat the previous command. Certain commands (for example, @code{run})
-will not repeat this way; these are commands for which unintentional
-repetition might cause trouble and which you are unlikely to want to
-repeat.
-
-The @code{list} and @code{x} commands, when you repeat them with
-@key{RET}, construct new arguments rather than repeating
-exactly as typed. This permits easy scanning of source or memory.
-
-_GDBN__ can also use @key{RET} in another way: to partition lengthy
-output, in a way similar to the common utility @code{more}
-(@pxref{Screen Size}). Since it's easy to press one @key{RET} too many
-in this situation, _GDBN__ disables command repetition after any command
-that generates this sort of display.
-
-@kindex #
-@cindex comment
-A line of input starting with @kbd{#} is a comment; it does nothing.
-This is useful mainly in command files (@xref{Command Files}).
-
-@node Help, , Command Syntax, Commands
-@section Getting Help
-@cindex online documentation
-@kindex help
-You can always ask _GDBN__ itself for information on its commands, using the
-command @code{help}.
-
-@table @code
-@item help
-@itemx h
-@kindex h
-You can use @code{help} (abbreviated @code{h}) with no arguments to
-display a short list of named classes of commands:
-@smallexample
-(_GDBP__) help
-List of classes of commands:
-
-running -- Running the program
-stack -- Examining the stack
-data -- Examining data
-breakpoints -- Making program stop at certain points
-files -- Specifying and examining files
-status -- Status inquiries
-support -- Support facilities
-user-defined -- User-defined commands
-aliases -- Aliases of other commands
-obscure -- Obscure features
-
-Type "help" followed by a class name for a list of commands in that class.
-Type "help" followed by command name for full documentation.
-Command name abbreviations are allowed if unambiguous.
-(_GDBP__)
-@end smallexample
-
-@item help @var{class}
-Using one of the general help classes as an argument, you can get a
-list of the individual commands in that class. For example, here is the
-help display for the class @code{status}:
-@smallexample
-(_GDBP__) help status
-Status inquiries.
-
-List of commands:
-
-show -- Generic command for showing things set with "set"
-info -- Generic command for printing status
-
-Type "help" followed by command name for full documentation.
-Command name abbreviations are allowed if unambiguous.
-(_GDBP__)
-@end smallexample
-
-@item help @var{command}
-With a command name as @code{help} argument, _GDBN__ will display a
-short paragraph on how to use that command.
-@end table
-
-In addition to @code{help}, you can use the _GDBN__ commands @code{info}
-and @code{show} to inquire about the state of your program, or the state
-of _GDBN__ itself. Each command supports many topics of inquiry; this
-manual introduces each of them in the appropriate context. The listings
-under @code{info} and under @code{show} in the Index point to
-all the sub-commands.
-@c FIXME: @pxref{Index} used to be here, but even though it shows up in
-@c FIXME...the 'aux' file with a pageno the xref can't find it.
-
-@c @group
-@table @code
-@item info
-@kindex info
-@kindex i
-This command (abbreviated @code{i}) is for describing the state of your
-program; for example, it can list the arguments given to your program
-(@code{info args}), the registers currently in use (@code{info
-registers}), or the breakpoints you've set (@code{info breakpoints}).
-You can get a complete list of the @code{info} sub-commands with
-@w{@code{help info}}.
-
-@kindex show
-@item show
-In contrast, @code{show} is for describing the state of _GDBN__ itself.
-You can change most of the things you can @code{show}, by using the
-related command @code{set}; for example, you can control what number
-system is used for displays with @code{set radix}, or simply inquire
-which is currently in use with @code{show radix}.
-
-@kindex info set
-To display all the settable parameters and their current
-values, you can use @code{show} with no arguments; you may also use
-@code{info set}. Both commands produce the same display.
-@c FIXME: "info set" violates the rule that "info" is for state of
-@c FIXME...program. Ck w/ GNU: "info set" to be called something else,
-@c FIXME...or change desc of rule---eg "state of prog and debugging session"?
-@end table
-@c @end group
-
-Here are three miscellaneous @code{show} subcommands, all of which are
-exceptional in lacking corresponding @code{set} commands:
-
-@table @code
-@kindex show version
-@cindex version number
-@item show version
-Show what version of _GDBN__ is running. You should include this
-information in _GDBN__ bug-reports. If multiple versions of _GDBN__ are
-in use at your site, you may occasionally want to make sure what version
-of _GDBN__ you're running; as _GDBN__ evolves, new commands are
-introduced, and old ones may wither away. The version number is also
-announced when you start _GDBN__ with no arguments.
-
-@kindex show copying
-@item show copying
-Display information about permission for copying _GDBN__.
-
-@kindex show warranty
-@item show warranty
-Display the GNU ``NO WARRANTY'' statement.
-@end table
-
-@node Running, Stopping, Commands, Top
-@chapter Running Programs Under _GDBN__
-
-@menu
-* Compilation:: Compiling for Debugging
-* Starting:: Starting your Program
-* Arguments:: Your Program's Arguments
-* Environment:: Your Program's Environment
-* Working Directory:: Your Program's Working Directory
-* Input/Output:: Your Program's Input and Output
-* Attach:: Debugging an Already-Running Process
-* Kill Process:: Killing the Child Process
-@end menu
-
-@node Compilation, Starting, Running, Running
-@section Compiling for Debugging
-
-In order to debug a program effectively, you need to generate
-debugging information when you compile it. This debugging information
-is stored in the object file; it describes the data type of each
-variable or function and the correspondence between source line numbers
-and addresses in the executable code.
-
-To request debugging information, specify the @samp{-g} option when you run
-the compiler.
-
-Many C compilers are unable to handle the @samp{-g} and @samp{-O}
-options together. Using those compilers, you cannot generate optimized
-executables containing debugging information.
-
-The GNU C compiler supports @samp{-g} with or without @samp{-O}, making it
-possible to debug optimized code. We recommend that you @emph{always} use
-@samp{-g} whenever you compile a program. You may think the program is
-correct, but there's no sense in pushing your luck.
-
-Some things do not work as well with @samp{-g -O} as with just
-@samp{-g}, particularly on machines with instruction scheduling. If in
-doubt, recompile with @samp{-g} alone, and if this fixes the problem,
-please report it as a bug (including a test case!).
-
-Older versions of the GNU C compiler permitted a variant option
-@samp{-gg} for debugging information. _GDBN__ no longer supports this
-format; if your GNU C compiler has this option, do not use it.
-
-@ignore
-@comment As far as I know, there are no cases in which _GDBN__ will
-@comment produce strange output in this case. (but no promises).
-If your program includes archives made with the @code{ar} program, and
-if the object files used as input to @code{ar} were compiled without the
-@samp{-g} option and have names longer than 15 characters, _GDBN__ will get
-confused reading the program's symbol table. No error message will be
-given, but _GDBN__ may behave strangely. The reason for this problem is a
-deficiency in the Unix archive file format, which cannot represent file
-names longer than 15 characters.
-
-To avoid this problem, compile the archive members with the @samp{-g}
-option or use shorter file names. Alternatively, use a version of GNU
-@code{ar} dated more recently than August 1989.
-@end ignore
-
-
-@node Starting, Arguments, Compilation, Running
-@section Starting your Program
-@cindex starting
-@cindex running
-@table @code
-@item run
-@itemx r
-@kindex run
-Use the @code{run} command to start your program under _GDBN__. You
-must first specify the program name
-_if__(_VXWORKS__)
-(except on VxWorks)
-_fi__(_VXWORKS__)
-with an argument to _GDBN__
-(@pxref{Invocation}), or using the @code{file} or @code{exec-file}
-command (@pxref{Files}).
-@refill
-@end table
-
-On targets that support processes, @code{run} creates an inferior
-process and makes that process run your program. On other targets,
-@code{run} jumps to the start of the program.
-
-The execution of a program is affected by certain information it
-receives from its superior. _GDBN__ provides ways to specify this
-information, which you must do @i{before} starting the program. (You
-can change it after starting the program, but such changes will only affect
-the program the next time you start it.) This information may be
-divided into four categories:
-
-@table @asis
-@item The @i{arguments.}
-You specify the arguments to give your program as the arguments of the
-@code{run} command. If a shell is available on your target, the shell
-is used to pass the arguments, so that you may use normal conventions
-(such as wildcard expansion or variable substitution) in
-describing the arguments. In Unix systems, you can control which shell
-is used with the @code{SHELL} environment variable. @xref{Arguments}.@refill
-
-@item The @i{environment.}
-Your program normally inherits its environment from _GDBN__, but you can
-use the _GDBN__ commands @code{set environment} and @code{unset
-environment} to change parts of the environment that will be given to
-the program. @xref{Environment}.@refill
-
-@item The @i{working directory.}
-Your program inherits its working directory from _GDBN__. You can set
-_GDBN__'s working directory with the @code{cd} command in _GDBN__.
-@xref{Working Directory}.
-
-@item The @i{standard input and output.}
-Your program normally uses the same device for standard input and
-standard output as _GDBN__ is using. You can redirect input and output
-in the @code{run} command line, or you can use the @code{tty} command to
-set a different device for your program.
-@xref{Input/Output}.
-
-@cindex pipes
-@emph{Warning:} While input and output redirection work, you can't use
-pipes to pass the output of the program you're debugging to another
-program; if you attempt this, _GDBN__ is likely to wind up debugging the
-wrong program.
-@end table
-
-When you issue the @code{run} command, your program begins to execute
-immediately. @xref{Stopping}, for discussion of how to arrange for your
-program to stop. Once your program has been started by the @code{run}
-command (and then stopped), you may evaluate expressions that involve
-calls to functions in the inferior, using the @code{print} or
-@code{call} commands. @xref{Data}.
-
-If the modification time of your symbol file has changed since the last
-time _GDBN__ read its symbols, _GDBN__ will discard its symbol table and re-read
-it. In this process, it tries to retain your current breakpoints.
-
-@node Arguments, Environment, Starting, Running
-@section Your Program's Arguments
-
-@cindex arguments (to your program)
-The arguments to your program can be specified by the arguments of the
-@code{run} command. They are passed to a shell, which expands wildcard
-characters and performs redirection of I/O, and thence to the program.
-_GDBN__ uses the shell indicated by your environment variable
-@code{SHELL} if it exists; otherwise, _GDBN__ uses @code{/bin/sh}.
-
-@code{run} with no arguments uses the same arguments used by the previous
-@code{run}, or those set by the @code{set args} command.
-
-@kindex set args
-@table @code
-@item set args
-Specify the arguments to be used the next time your program is run. If
-@code{set args} has no arguments, @code{run} will execute your program
-with no arguments. Once you have run your program with arguments,
-using @code{set args} before the next @code{run} is the only way to run
-it again without arguments.
-
-@item show args
-@kindex show args
-Show the arguments to give your program when it is started.
-@end table
-
-@node Environment, Working Directory, Arguments, Running
-@section Your Program's Environment
-
-@cindex environment (of your program)
-The @dfn{environment} consists of a set of environment variables and
-their values. Environment variables conventionally record such things as
-your user name, your home directory, your terminal type, and your search
-path for programs to run. Usually you set up environment variables with
-the shell and they are inherited by all the other programs you run. When
-debugging, it can be useful to try running the program with a modified
-environment without having to start _GDBN__ over again.
-
-@table @code
-@item path @var{directory}
-@kindex path
-Add @var{directory} to the front of the @code{PATH} environment variable
-(the search path for executables), for both _GDBN__ and your program.
-You may specify several directory names, separated by @samp{:} or
-whitespace. If @var{directory} is already in the path, it is moved to
-the front, so it will be searched sooner.
-
-You can use the string @samp{$cwd} to refer to whatever is the current
-working directory at the time _GDBN__ searches the path. If you use
-@samp{.} instead, it refers to the directory where you executed the
-@code{path} command. _GDBN__ fills in the current path where needed in
-the @var{directory} argument, before adding it to the search path.
-@c 'path' is explicitly nonrepeatable, but RMS points out it's silly to
-@c document that, since repeating it would be a no-op.
-
-@item show paths
-@kindex show paths
-Display the list of search paths for executables (the @code{PATH}
-environment variable).
-
-@item show environment @r{[}@var{varname}@r{]}
-@kindex show environment
-Print the value of environment variable @var{varname} to be given to
-your program when it starts. If you don't supply @var{varname},
-print the names and values of all environment variables to be given to
-your program. You can abbreviate @code{environment} as @code{env}.
-
-@item set environment @var{varname} @r{[}=@r{]} @var{value}
-@kindex set environment
-Sets environment variable @var{varname} to @var{value}. The value
-changes for your program only, not for _GDBN__ itself. @var{value} may
-be any string; the values of environment variables are just strings, and
-any interpretation is supplied by your program itself. The @var{value}
-parameter is optional; if it is eliminated, the variable is set to a
-null value.
-@c "any string" here doesn't include leading, trailing
-@c blanks. Gnu asks: does anyone care?
-
-For example, this command:
-
-@example
-set env USER = foo
-@end example
-
-@noindent
-tells a Unix program, when subsequently run, that its user is named
-@samp{foo}. (The spaces around @samp{=} are used for clarity here; they
-are not actually required.)
-
-@item unset environment @var{varname}
-@kindex unset environment
-Remove variable @var{varname} from the environment to be passed to your
-program. This is different from @samp{set env @var{varname} =};
-@code{unset environment} removes the variable from the environment,
-rather than assigning it an empty value.
-@end table
-
-@node Working Directory, Input/Output, Environment, Running
-@section Your Program's Working Directory
-
-@cindex working directory (of your program)
-Each time you start your program with @code{run}, it inherits its
-working directory from the current working directory of _GDBN__. _GDBN__'s
-working directory is initially whatever it inherited from its parent
-process (typically the shell), but you can specify a new working
-directory in _GDBN__ with the @code{cd} command.
-
-The _GDBN__ working directory also serves as a default for the commands
-that specify files for _GDBN__ to operate on. @xref{Files}.
-
-@table @code
-@item cd @var{directory}
-@kindex cd
-Set _GDBN__'s working directory to @var{directory}.
-
-@item pwd
-@kindex pwd
-Print _GDBN__'s working directory.
-@end table
-
-@node Input/Output, Attach, Working Directory, Running
-@section Your Program's Input and Output
-
-@cindex redirection
-@cindex i/o
-@cindex terminal
-By default, the program you run under _GDBN__ does input and output to
-the same terminal that _GDBN__ uses. _GDBN__ switches the terminal to
-its own terminal modes to interact with you, but it records the terminal
-modes your program was using and switches back to them when you continue
-running your program.
-
-@table @code
-@item info terminal
-@kindex info terminal
-Displays _GDBN__'s recorded information about the terminal modes your
-program is using.
-@end table
-
-You can redirect the program's input and/or output using shell
-redirection with the @code{run} command. For example,
-
-_0__@example
-run > outfile
-_1__@end example
-
-@noindent
-starts the program, diverting its output to the file @file{outfile}.
-
-@kindex tty
-@cindex controlling terminal
-Another way to specify where the program should do input and output is
-with the @code{tty} command. This command accepts a file name as
-argument, and causes this file to be the default for future @code{run}
-commands. It also resets the controlling terminal for the child
-process, for future @code{run} commands. For example,
-
-@example
-tty /dev/ttyb
-@end example
-
-@noindent
-directs that processes started with subsequent @code{run} commands
-default to do input and output on the terminal @file{/dev/ttyb} and have
-that as their controlling terminal.
-
-An explicit redirection in @code{run} overrides the @code{tty} command's
-effect on the input/output device, but not its effect on the controlling
-terminal.
-
-When you use the @code{tty} command or redirect input in the @code{run}
-command, only the input @emph{for your program} is affected. The input
-for _GDBN__ still comes from your terminal.
-
-@node Attach, Kill Process, Input/Output, Running
-@section Debugging an Already-Running Process
-@kindex attach
-@cindex attach
-
-@table @code
-@item attach @var{process-id}
-This command
-attaches to a running process---one that was started outside _GDBN__.
-(@code{info files} will show your active targets.) The command takes as
-argument a process ID. The usual way to find out the process-id of
-a Unix process is with the @code{ps} utility, or with the @samp{jobs -l}
-shell command.
-
-@code{attach} will not repeat if you press @key{RET} a second time after
-executing the command.
-@end table
-
-To use @code{attach}, you must be debugging in an environment which
-supports processes. You must also have permission to send the process a
-signal, and it must have the same effective user ID as the _GDBN__
-process.
-
-When using @code{attach}, you should first use the @code{file} command
-to specify the program running in the process and load its symbol table.
-@xref{Files}.
-
-The first thing _GDBN__ does after arranging to debug the specified
-process is to stop it. You can examine and modify an attached process
-with all the _GDBN__ commands that are ordinarily available when you start
-processes with @code{run}. You can insert breakpoints; you can step and
-continue; you can modify storage. If you would rather the process
-continue running, you may use the @code{continue} command after
-attaching _GDBN__ to the process.
-
-@table @code
-@item detach
-@kindex detach
-When you have finished debugging the attached process, you can use the
-@code{detach} command to release it from _GDBN__'s control. Detaching
-the process continues its execution. After the @code{detach} command,
-that process and _GDBN__ become completely independent once more, and you
-are ready to @code{attach} another process or start one with @code{run}.
-@code{detach} will not repeat if you press @key{RET} again after
-executing the command.
-@end table
-
-If you exit _GDBN__ or use the @code{run} command while you have an attached
-process, you kill that process. By default, you will be asked for
-confirmation if you try to do either of these things; you can control
-whether or not you need to confirm by using the @code{set confirm} command
-(@pxref{Messages/Warnings}).
-
-@node Kill Process, , Attach, Running
-@c @group
-@section Killing the Child Process
-
-@table @code
-@item kill
-@kindex kill
-Kill the child process in which your program is running under _GDBN__.
-@end table
-
-This command is useful if you wish to debug a core dump instead of a
-running process. _GDBN__ ignores any core dump file while your program
-is running.
-@c @end group
-
-On some operating systems, a program can't be executed outside _GDBN__
-while you have breakpoints set on it inside _GDBN__. You can use the
-@code{kill} command in this situation to permit running the program
-outside the debugger.
-
-The @code{kill} command is also useful if you wish to recompile and
-relink the program, since on many systems it is impossible to modify an
-executable file while it is running in a process. In this case, when you
-next type @code{run}, _GDBN__ will notice that the file has changed, and
-will re-read the symbol table (while trying to preserve your current
-breakpoint settings).
-
-@node Stopping, Stack, Running, Top
-@chapter Stopping and Continuing
-
-The principal purpose of using a debugger is so that you can stop your
-program before it terminates; or so that, if the program runs into
-trouble, you can investigate and find out why.
-
-Inside _GDBN__, your program may stop for any of several reasons, such
-as a signal, a breakpoint, or reaching a new line after a _GDBN__
-command such as @code{step}. You may then examine and change
-variables, set new breakpoints or remove old ones, and then continue
-execution. Usually, the messages shown by _GDBN__ provide ample
-explanation of the status of your program---but you can also explicitly
-request this information at any time.
-
-@table @code
-@item info program
-@kindex info program
-Display information about the status of your program: whether it is
-running or not, what process it is, and why it stopped.
-@end table
-
-@menu
-* Breakpoints:: Breakpoints, Watchpoints, and Exceptions
-* Continuing and Stepping:: Resuming Execution
-* Signals:: Signals
-@end menu
-
-@node Breakpoints, Continuing and Stepping, Stopping, Stopping
-@section Breakpoints, Watchpoints, and Exceptions
-
-@cindex breakpoints
-A @dfn{breakpoint} makes your program stop whenever a certain point in
-the program is reached. For each breakpoint, you can add various
-conditions to control in finer detail whether the program will stop.
-You can set breakpoints with the @code{break} command and its variants
-(@pxref{Set Breaks}), to specify the place where the program should stop
-by line number, function name or exact address in the program. In
-languages with exception handling (such as GNU C++), you can also set
-breakpoints where an exception is raised (@pxref{Exception Handling}).
-
-@cindex watchpoints
-A @dfn{watchpoint} is a special breakpoint that stops your program when
-the value of an expression changes. You must use a different command to
-set watchpoints (@pxref{Set Watchpoints}), but aside from that, you can
-manage a watchpoint like any other breakpoint: you enable, disable, and
-delete both breakpoints and watchpoints using the same commands.
-
-Each breakpoint or watchpoint is assigned a number when it is created;
-these numbers are successive integers starting with one. In many of the
-commands for controlling various features of breakpoints you use the
-breakpoint number to say which breakpoint you want to change. Each
-breakpoint may be @dfn{enabled} or @dfn{disabled}; if disabled, it has
-no effect on the program until you enable it again.
-
-@menu
-* Set Breaks:: Setting Breakpoints
-* Set Watchpoints:: Setting Watchpoints
-* Exception Handling:: Breakpoints and Exceptions
-* Delete Breaks:: Deleting Breakpoints
-* Disabling:: Disabling Breakpoints
-* Conditions:: Break Conditions
-* Break Commands:: Breakpoint Command Lists
-* Breakpoint Menus:: Breakpoint Menus
-* Error in Breakpoints::
-@end menu
-
-@node Set Breaks, Set Watchpoints, Breakpoints, Breakpoints
-@subsection Setting Breakpoints
-
-@kindex break
-@kindex b
-Breakpoints are set with the @code{break} command (abbreviated @code{b}).
-
-You have several ways to say where the breakpoint should go.
-
-@table @code
-@item break @var{function}
-Set a breakpoint at entry to function @var{function}. When using source
-languages that permit overloading of symbols, such as C++,
-@var{function} may refer to more than one possible place to break.
-@xref{Breakpoint Menus}, for a discussion of that situation.
-
-@item break +@var{offset}
-@itemx break -@var{offset}
-Set a breakpoint some number of lines forward or back from the position
-at which execution stopped in the currently selected frame.
-
-@item break @var{linenum}
-Set a breakpoint at line @var{linenum} in the current source file.
-That file is the last file whose source text was printed. This
-breakpoint will stop the program just before it executes any of the
-code on that line.
-
-@item break @var{filename}:@var{linenum}
-Set a breakpoint at line @var{linenum} in source file @var{filename}.
-
-@item break @var{filename}:@var{function}
-Set a breakpoint at entry to function @var{function} found in file
-@var{filename}. Specifying a file name as well as a function name is
-superfluous except when multiple files contain similarly named
-functions.
-
-@item break *@var{address}
-Set a breakpoint at address @var{address}. You can use this to set
-breakpoints in parts of the program which do not have debugging
-information or source files.
-
-@item break
-When called without any arguments, @code{break} sets a breakpoint at the
-next instruction to be executed in the selected stack frame
-(@pxref{Stack}). In any selected frame but the innermost, this will
-cause the program to stop as soon as control returns to that frame.
-This is similar to the effect of a @code{finish} command in the frame
-inside the selected frame---except that @code{finish} doesn't leave an
-active breakpoint. If you use @code{break} without an argument in the
-innermost frame, _GDBN__ will stop the next time it reaches the current
-location; this may be useful inside loops.
-
-_GDBN__ normally ignores breakpoints when it resumes execution, until at
-least one instruction has been executed. If it did not do this, you
-would be unable to proceed past a breakpoint without first disabling the
-breakpoint. This rule applies whether or not the breakpoint already
-existed when the program stopped.
-
-@item break @dots{} if @var{cond}
-Set a breakpoint with condition @var{cond}; evaluate the expression
-@var{cond} each time the breakpoint is reached, and stop only if the
-value is nonzero---that is, if @var{cond} evaluates as true.
-@samp{@dots{}} stands for one of the possible arguments described above
-(or no argument) specifying where to break. @xref{Conditions}, for more
-information on breakpoint conditions.
-
-@item tbreak @var{args}
-@kindex tbreak
-Set a breakpoint enabled only for one stop. @var{args} are the
-same as for the @code{break} command, and the breakpoint is set in the same
-way, but the breakpoint is automatically disabled the first time it
-is hit. @xref{Disabling}.
-
-@item rbreak @var{regex}
-@kindex rbreak
-@cindex regular expression
-Set breakpoints on all functions matching the regular expression
-@var{regex}. This command
-sets an unconditional breakpoint on all matches, printing a list of all
-breakpoints it set. Once these breakpoints are set, they are treated
-just like the breakpoints set with the @code{break} command. They can
-be deleted, disabled, made conditional, etc., in the standard ways.
-
-When debugging C++ programs, @code{rbreak} is useful for setting
-breakpoints on overloaded functions that are not members of any special
-classes.
-
-@kindex info breakpoints
-@cindex @code{$_} and @code{info breakpoints}
-@item info breakpoints @r{[}@var{n}@r{]}
-@item info break @r{[}@var{n}@r{]}
-Print a list of all breakpoints (but not watchpoints) set and not
-deleted, showing their numbers, where in the program they are, and any
-special features in use for them. Disabled breakpoints are included in
-the list, but marked as disabled. @code{info break} with a breakpoint
-number @var{n} as argument lists only that breakpoint. The convenience
-variable @code{$_} and the default examining-address for the @code{x}
-command are set to the address of the last breakpoint listed
-(@pxref{Memory}). The equivalent command for watchpoints is @code{info
-watch}. @end table
-
-_GDBN__ allows you to set any number of breakpoints at the same place in the
-program. There is nothing silly or meaningless about this. When the
-breakpoints are conditional, this is even useful (@pxref{Conditions}).
-
-@node Set Watchpoints, Exception Handling, Set Breaks, Breakpoints
-@subsection Setting Watchpoints
-@cindex setting watchpoints
-You can use a watchpoint to stop execution whenever the value of an
-expression changes, without having to predict a particular place
-where this may happen.
-
-Watchpoints currently execute two orders of magnitude more slowly than
-other breakpoints, but this can well be worth it to catch errors where
-you have no clue what part of your program is the culprit. Some
-processors provide special hardware to support watchpoint evaluation; future
-releases of _GDBN__ will use such hardware if it is available.
-
-@table @code
-@kindex watch
-@item watch @var{expr}
-Set a watchpoint for an expression.
-
-@kindex info watchpoints
-@item info watchpoints
-This command prints a list of watchpoints; it is otherwise similar to
-@code{info break}.
-@end table
-
-@node Exception Handling, Delete Breaks, Set Watchpoints, Breakpoints
-@subsection Breakpoints and Exceptions
-@cindex exception handlers
-
-Some languages, such as GNU C++, implement exception handling. You can
-use _GDBN__ to examine what caused the program to raise an exception,
-and to list the exceptions the program is prepared to handle at a
-given point in time.
-
-@table @code
-@item catch @var{exceptions}
-@kindex catch
-You can set breakpoints at active exception handlers by using the
-@code{catch} command. @var{exceptions} is a list of names of exceptions
-to catch.
-@end table
-
-You can use @code{info catch} to list active exception handlers;
-@pxref{Frame Info}.
-
-There are currently some limitations to exception handling in _GDBN__.
-These will be corrected in a future release.
-
-@itemize @bullet
-@item
-If you call a function interactively, _GDBN__ normally returns
-control to you when the function has finished executing. If the call
-raises an exception, however, the call may bypass the mechanism that
-returns control to the user and cause the program to simply continue
-running until it hits a breakpoint, catches a signal that _GDBN__ is
-listening for, or exits.
-@item
-You cannot raise an exception interactively.
-@item
-You cannot interactively install an exception handler.
-@end itemize
-
-@cindex raise exceptions
-Sometimes @code{catch} is not the best way to debug exception handling:
-if you need to know exactly where an exception is raised, it's better to
-stop @emph{before} the exception handler is called, since that way you
-can see the stack before any unwinding takes place. If you set a
-breakpoint in an exception handler instead, it may not be easy to find
-out where the exception was raised.
-
-To stop just before an exception handler is called, you need some
-knowledge of the implementation. In the case of GNU C++, exceptions are
-raised by calling a library function named @code{__raise_exception}
-which has the following ANSI C interface:
-
-@example
- /* @var{addr} is where the exception identifier is stored.
- ID is the exception identifier. */
- void __raise_exception (void **@var{addr}, void *@var{id});
-@end example
-
-@noindent
-To make the debugger catch all exceptions before any stack
-unwinding takes place, set a breakpoint on @code{__raise_exception}
-(@pxref{Breakpoints}).
-
-With a conditional breakpoint (@xref{Conditions}) that depends on the
-value of @var{id}, you can stop your program when a specific exception
-is raised. You can use multiple conditional breakpoints to stop the
-program when any of a number of exceptions are raised.
-
-@node Delete Breaks, Disabling, Exception Handling, Breakpoints
-@subsection Deleting Breakpoints
-
-@cindex clearing breakpoints, watchpoints
-@cindex deleting breakpoints, watchpoints
-It is often necessary to eliminate a breakpoint or watchpoint once it
-has done its job and you no longer want the program to stop there. This
-is called @dfn{deleting} the breakpoint. A breakpoint that has been
-deleted no longer exists; it is forgotten.
-
-With the @code{clear} command you can delete breakpoints according to
-where they are in the program. With the @code{delete} command you can
-delete individual breakpoints or watchpoints by specifying their
-breakpoint numbers.
-
-It is not necessary to delete a breakpoint to proceed past it. _GDBN__
-automatically ignores breakpoints on the first instruction to be executed
-when you continue execution without changing the execution address.
-
-@table @code
-@item clear
-@kindex clear
-Delete any breakpoints at the next instruction to be executed in the
-selected stack frame (@pxref{Selection}). When the innermost frame
-is selected, this is a good way to delete a breakpoint that the program
-just stopped at.
-
-@item clear @var{function}
-@itemx clear @var{filename}:@var{function}
-Delete any breakpoints set at entry to the function @var{function}.
-
-@item clear @var{linenum}
-@itemx clear @var{filename}:@var{linenum}
-Delete any breakpoints set at or within the code of the specified line.
-
-@item delete @r{[}breakpoints@r{]} @r{[}@var{bnums}@dots{}@r{]}
-@cindex delete breakpoints
-@kindex delete
-@kindex d
-Delete the breakpoints or watchpoints of the numbers specified as
-arguments. If no argument is specified, delete all breakpoints (_GDBN__
-asks confirmation, unless you've @code{set confirm off}). You
-can abbreviate this command as @code{d}.
-@end table
-
-@node Disabling, Conditions, Delete Breaks, Breakpoints
-@subsection Disabling Breakpoints
-
-@cindex disabled breakpoints
-@cindex enabled breakpoints
-Rather than deleting a breakpoint or watchpoint, you might prefer to
-@dfn{disable} it. This makes the breakpoint inoperative as if it had
-been deleted, but remembers the information on the breakpoint so that
-you can @dfn{enable} it again later.
-
-You disable and enable breakpoints and watchpoints with the
-@code{enable} and @code{disable} commands, optionally specifying one or
-more breakpoint numbers as arguments. Use @code{info break} or
-@code{info watch} to print a list of breakpoints or watchpoints if you
-don't know which numbers to use.
-
-A breakpoint or watchpoint can have any of four different states of
-enablement:
-
-@itemize @bullet
-@item
-Enabled. The breakpoint will stop the program. A breakpoint set
-with the @code{break} command starts out in this state.
-@item
-Disabled. The breakpoint has no effect on the program.
-@item
-Enabled once. The breakpoint will stop the program, but
-when it does so it will become disabled. A breakpoint set
-with the @code{tbreak} command starts out in this state.
-@item
-Enabled for deletion. The breakpoint will stop the program, but
-immediately after it does so it will be deleted permanently.
-@end itemize
-
-You can use the following commands to enable or disable breakpoints and
-watchpoints:
-
-@table @code
-@item disable @r{[}breakpoints@r{]} @r{[}@var{bnums}@dots{}@r{]}
-@kindex disable breakpoints
-@kindex disable
-@kindex dis
-Disable the specified breakpoints---or all breakpoints, if none are
-listed. A disabled breakpoint has no effect but is not forgotten. All
-options such as ignore-counts, conditions and commands are remembered in
-case the breakpoint is enabled again later. You may abbreviate
-@code{disable} as @code{dis}.
-
-@item enable @r{[}breakpoints@r{]} @r{[}@var{bnums}@dots{}@r{]}
-@kindex enable breakpoints
-@kindex enable
-Enable the specified breakpoints (or all defined breakpoints). They
-become effective once again in stopping the program.
-
-@item enable @r{[}breakpoints@r{]} once @var{bnums}@dots{}
-Enable the specified breakpoints temporarily. Each will be disabled
-again the next time it stops the program.
-
-@item enable @r{[}breakpoints@r{]} delete @var{bnums}@dots{}
-Enable the specified breakpoints to work once and then die. Each of
-the breakpoints will be deleted the next time it stops the program.
-@end table
-
-Save for a breakpoint set with @code{tbreak} (@pxref{Set Breaks}),
-breakpoints that you set are initially enabled; subsequently, they become
-disabled or enabled only when you use one of the commands above. (The
-command @code{until} can set and delete a breakpoint of its own, but it
-will not change the state of your other breakpoints;
-@pxref{Continuing and Stepping}.)
-
-@node Conditions, Break Commands, Disabling, Breakpoints
-@subsection Break Conditions
-@cindex conditional breakpoints
-@cindex breakpoint conditions
-
-The simplest sort of breakpoint breaks every time the program reaches a
-specified place. You can also specify a @dfn{condition} for a
-breakpoint. A condition is just a Boolean expression in your
-programming language. (@xref{Expressions}). A breakpoint with a condition
-evaluates the expression each time the program reaches it, and the
-program stops only if the condition is @emph{true}.
-
-This is the converse of using assertions for program validation; in that
-situation, you want to stop when the assertion is violated---that is,
-when the condition is false. In C, if you want to test an assertion expressed
-by the condition @var{assert}, you should set the condition
-@samp{! @var{assert}} on the appropriate breakpoint.
-
-Conditions are also accepted for watchpoints; you may not need them,
-since a watchpoint is inspecting the value of an expression anyhow---but
-it might be simpler, say, to just set a watchpoint on a variable name,
-and specify a condition that tests whether the new value is an interesting
-one.
-
-Break conditions ca have side effects, and may even call functions in
-your program. This can be useful, for example, to activate functions
-that log program progress, or to use your own print functions to format
-special data structures. The effects are completely predictable unless
-there is another enabled breakpoint at the same address. (In that
-case, _GDBN__ might see the other breakpoint first and stop the program
-without checking the condition of this one.) Note that breakpoint
-commands are usually more convenient and flexible for the purpose of
-performing side effects when a breakpoint is reached
-(@pxref{Break Commands}).
-
-Break conditions can be specified when a breakpoint is set, by using
-@samp{if} in the arguments to the @code{break} command. @xref{Set Breaks}.
-They can also be changed at any time with the @code{condition} command.
-The @code{watch} command doesn't recognize the @code{if} keyword;
-@code{condition} is the only way to impose a further condition on a
-watchpoint.
-
-@table @code
-@item condition @var{bnum} @var{expression}
-@kindex condition
-Specify @var{expression} as the break condition for breakpoint or
-watchpoint number @var{bnum}. From now on, this breakpoint will stop
-the program only if the value of @var{expression} is true (nonzero, in
-C). When you use @code{condition}, _GDBN__ checks @var{expression}
-immediately for syntactic correctness, and to determine whether symbols
-in it have referents in the context of your breakpoint. _GDBN__ does
-not actually evaluate @var{expression} at the time the @code{condition}
-command is given, however. @xref{Expressions}.
-
-@item condition @var{bnum}
-Remove the condition from breakpoint number @var{bnum}. It becomes
-an ordinary unconditional breakpoint.
-@end table
-
-@cindex ignore count (of breakpoint)
-A special case of a breakpoint condition is to stop only when the
-breakpoint has been reached a certain number of times. This is so
-useful that there is a special way to do it, using the @dfn{ignore
-count} of the breakpoint. Every breakpoint has an ignore count, which
-is an integer. Most of the time, the ignore count is zero, and
-therefore has no effect. But if the program reaches a breakpoint whose
-ignore count is positive, then instead of stopping, it just decrements
-the ignore count by one and continues. As a result, if the ignore count
-value is @var{n}, the breakpoint will not stop the next @var{n} times it
-is reached.
-
-@table @code
-@item ignore @var{bnum} @var{count}
-@kindex ignore
-Set the ignore count of breakpoint number @var{bnum} to @var{count}.
-The next @var{count} times the breakpoint is reached, your program's
-execution will not stop; other than to decrement the ignore count, _GDBN__
-takes no action.
-
-To make the breakpoint stop the next time it is reached, specify
-a count of zero.
-
-@item continue @var{count}
-@itemx c @var{count}
-@itemx fg @var{count}
-@kindex continue @var{count}
-Continue execution of the program, setting the ignore count of the
-breakpoint that the program stopped at to @var{count} minus one.
-Thus, the program will not stop at this breakpoint until the
-@var{count}'th time it is reached.
-
-An argument to this command is meaningful only when the program stopped
-due to a breakpoint. At other times, the argument to @code{continue} is
-ignored.
-
-The synonym @code{fg} is provided purely for convenience, and has
-exactly the same behavior as other forms of the command.
-@end table
-
-If a breakpoint has a positive ignore count and a condition, the condition
-is not checked. Once the ignore count reaches zero, the condition will
-be checked.
-
-You could achieve the effect of the ignore count with a
-condition such as _0__@w{@samp{$foo-- <= 0}}_1__ using a debugger convenience
-variable that is decremented each time. @xref{Convenience Vars}.
-
-@node Break Commands, Breakpoint Menus, Conditions, Breakpoints
-@subsection Breakpoint Command Lists
-
-@cindex breakpoint commands
-You can give any breakpoint (or watchpoint) a series of commands to
-execute when the program stops due to that breakpoint. For example, you
-might want to print the values of certain expressions, or enable other
-breakpoints.
-
-@table @code
-@item commands @r{[}@var{bnum}@r{]}
-@itemx @dots{} @var{command-list} @dots{}
-@itemx end
-@kindex commands
-@kindex end
-Specify a list of commands for breakpoint number @var{bnum}. The commands
-themselves appear on the following lines. Type a line containing just
-@code{end} to terminate the commands.
-
-To remove all commands from a breakpoint, type @code{commands} followed
-immediately by @code{end}; that is, give no commands.
-
-With no @var{bnum} argument, @code{commands} refers to the last
-breakpoint or watchpoint set (not to the breakpoint most recently
-encountered).
-@end table
-
-Pressing @key{RET} as a means of repeating the last _GDBN__ command is
-disabled within a @var{command-list}.
-
-You can use breakpoint commands to start the program up again. Simply
-use the @code{continue} command, or @code{step}, or any other command
-that resumes execution. Subsequent commands in the command list are
-ignored.
-
-@kindex silent
-If the first command specified is @code{silent}, the usual message about
-stopping at a breakpoint is not printed. This may be desirable for
-breakpoints that are to print a specific message and then continue.
-If the remaining commands too print nothing, you will see no sign that
-the breakpoint was reached at all. @code{silent} is meaningful only
-at the beginning of a breakpoint command list.
-
-The commands @code{echo} and @code{output} that allow you to print precisely
-controlled output are often useful in silent breakpoints. @xref{Output}.
-
-For example, here is how you could use breakpoint commands to print the
-value of @code{x} at entry to @code{foo} whenever @code{x} is positive.
-
-_0__@example
-break foo if x>0
-commands
-silent
-echo x is\040
-output x
-echo \n
-cont
-end
-_1__@end example
-
-One application for breakpoint commands is to compensate for one bug so
-you can test for another. Put a breakpoint just after the erroneous line
-of code, give it a condition to detect the case in which something
-erroneous has been done, and give it commands to assign correct values
-to any variables that need them. End with the @code{continue} command
-so that the program does not stop, and start with the @code{silent}
-command so that no output is produced. Here is an example:
-
-@example
-break 403
-commands
-silent
-set x = y + 4
-cont
-end
-@end example
-
-@cindex lost output
-One deficiency in the operation of automatically continuing breakpoints
-under Unix appears when your program uses raw mode for the terminal.
-_GDBN__ switches back to its own terminal modes (not raw) before executing
-commands, and then must switch back to raw mode when your program is
-continued. This causes any pending terminal input to be lost.
-@c FIXME: revisit below when GNU sys avail.
-@c In the GNU system, this will be fixed by changing the behavior of
-@c terminal modes.
-
-Under Unix, you can get around this problem by writing actions into
-the breakpoint condition rather than in commands. For example
-
-@example
-condition 5 (x = y + 4), 0
-@end example
-
-@noindent
-specifies a condition expression (@xref{Expressions}) that will change
-@code{x} as needed, then always have the value zero so the program will
-not stop. No input is lost here, because _GDBN__ evaluates break
-conditions without changing the terminal modes. When you want to have
-nontrivial conditions for performing the side effects, the operators
-@samp{&&}, @samp{||} and @samp{?@dots{}:} may be useful.
-
-@node Breakpoint Menus, Error in Breakpoints, Break Commands, Breakpoints
-@subsection Breakpoint Menus
-@cindex overloading
-@cindex symbol overloading
-
-Some programming languages (notably C++) permit a single function name
-to be defined several times, for application in different contexts.
-This is called @dfn{overloading}. When a function name is overloaded,
-@samp{break @var{function}} is not enough to tell _GDBN__ where you
-want a breakpoint. _GDBN__ offers you a menu of numbered choices for
-different possible breakpoints, and waits for your selection with the
-prompt @samp{>}. The first two options are always @samp{[0] cancel}
-and @samp{[1] all}. Typing @kbd{1} sets a breakpoint at each
-definition of @var{function}, and typing @kbd{0} aborts the
-@code{break} command without setting any new breakpoints.
-
-For example, the following session excerpt shows an attempt to set a
-breakpoint at the overloaded symbol @code{String::after}.
-We choose three particular definitions of that function name:
-
-@example
-(_GDBP__) b String::after
-[0] cancel
-[1] all
-[2] file:String.cc; line number:867
-[3] file:String.cc; line number:860
-[4] file:String.cc; line number:875
-[5] file:String.cc; line number:853
-[6] file:String.cc; line number:846
-[7] file:String.cc; line number:735
-> 2 4 6
-Breakpoint 1 at 0xb26c: file String.cc, line 867.
-Breakpoint 2 at 0xb344: file String.cc, line 875.
-Breakpoint 3 at 0xafcc: file String.cc, line 846.
-Multiple breakpoints were set.
-Use the "delete" command to delete unwanted breakpoints.
-(_GDBP__)
-@end example
-
-
-@node Error in Breakpoints, , Breakpoint Menus, Breakpoints
-@subsection ``Cannot Insert Breakpoints''
-
-@c FIXME: "cannot insert breakpoints" error, v unclear.
-@c Q in pending mail to Gilmore. ---pesch@cygnus.com, 26mar91
-@c some light may be shed by looking at instances of
-@c ONE_PROCESS_WRITETEXT. But error seems possible otherwise
-@c too. pesch, 20sep91
-Under some operating systems, breakpoints cannot be used in a program if
-any other process is running that program. In this situation,
-attempting to run or continue a program with a breakpoint causes _GDBN__
-to stop the other process.
-
-When this happens, you have three ways to proceed:
-
-@enumerate
-@item
-Remove or disable the breakpoints, then continue.
-
-@item
-Suspend _GDBN__, and copy the file containing the program to a new name.
-Resume _GDBN__ and use the @code{exec-file} command to specify that _GDBN__
-should run the program under that name. Then start the program again.
-
-@c FIXME: RMS commented here "Show example". Maybe when someone
-@c explains the first FIXME: in this section...
-
-@item
-Relink the program so that the text segment is nonsharable, using the
-linker option @samp{-N}. The operating system limitation may not apply
-to nonsharable executables.
-@end enumerate
-
-@node Continuing and Stepping, Signals, Breakpoints, Stopping
-@section Continuing and Stepping
-
-@cindex stepping
-@cindex continuing
-@cindex resuming execution
-@dfn{Continuing} means resuming program execution until your program
-completes normally. In contrast, @dfn{stepping} means resuming program
-execution for a very limited time: one line of source code, or one
-machine instruction. Either when continuing or when stepping, the
-program may stop even sooner, due to a breakpoint or to a signal. (If
-due to a signal, you may want to use @code{handle}, or use @samp{signal
-0} to resume execution; @pxref{Signals}.)
-
-@table @code
-@item continue @r{[}@var{ignore-count}@r{]}
-@kindex continue
-Resume program execution, at the address where the program last stopped;
-any breakpoints set at that address are bypassed. The optional argument
-@var{ignore-count} allows you to specify a further number of times to
-ignore a breakpoint at this location; its effect is like that of
-@code{ignore} (@pxref{Conditions}).
-
-To resume execution at a different place, you can use @code{return}
-(@pxref{Returning}) to go back to the calling function; or @code{jump}
-(@pxref{Jumping}) to go to an arbitrary location in your program.
-
-@end table
-
-A typical technique for using stepping is to set a breakpoint
-(@pxref{Breakpoints}) at the beginning of the function or the section of
-the program in which a problem is believed to lie, run the program until
-it stops at that breakpoint, and then step through the suspect area,
-examining the variables that are interesting, until you see the problem
-happen.
-
-@table @code
-@item step
-@kindex step
-@kindex s
-Continue running the program until control reaches a different source
-line, then stop it and return control to _GDBN__. This command is
-abbreviated @code{s}.
-
-@quotation
-@emph{Warning:} If you use the @code{step} command while control is
-within a function that was compiled without debugging information,
-execution will proceed until control reaches another function.
-@end quotation
-
-@item step @var{count}
-Continue running as in @code{step}, but do so @var{count} times. If a
-breakpoint is reached or a signal not related to stepping occurs before
-@var{count} steps, stepping stops right away.
-
-@item next @r{[}@var{count}@r{]}
-@kindex next
-@kindex n
-Continue to the next source line in the current (innermost) stack frame.
-Similar to @code{step}, but any function calls appearing within the line
-of code are executed without stopping. Execution stops when control
-reaches a different line of code at the stack level which was executing
-when the @code{next} command was given. This command is abbreviated
-@code{n}.
-
-An argument @var{count} is a repeat count, as for @code{step}.
-
-@code{next} within a function that lacks debugging information acts like
-@code{step}, but any function calls appearing within the code of the
-function are executed without stopping.
-
-@item finish
-@kindex finish
-Continue running until just after function in the selected stack frame
-returns. Print the returned value (if any).
-
-Contrast this with the @code{return} command (@pxref{Returning}).
-
-@item until
-@kindex until
-@item u
-@kindex u
-Continue running until a source line past the current line, in the
-current stack frame, is reached. This command is used to avoid single
-stepping through a loop more than once. It is like the @code{next}
-command, except that when @code{until} encounters a jump, it
-automatically continues execution until the program counter is greater
-than the address of the jump.
-
-This means that when you reach the end of a loop after single stepping
-though it, @code{until} will cause the program to continue execution
-until the loop is exited. In contrast, a @code{next} command at the end
-of a loop will simply step back to the beginning of the loop, which
-would force you to step through the next iteration.
-
-@code{until} always stops the program if it attempts to exit the current
-stack frame.
-
-@code{until} may produce somewhat counterintuitive results if the order
-of machine code does not match the order of the source lines. For
-example, in the following excerpt from a debugging session, the @code{f}
-(@code{frame}) command shows that execution is stopped at line
-@code{206}; yet when we use @code{until}, we get to line @code{195}:
-
-@example
-(_GDBP__) f
-#0 main (argc=4, argv=0xf7fffae8) at m4.c:206
-206 expand_input();
-(_GDBP__) until
-195 for ( ; argc > 0; NEXTARG) @{
-@end example
-
-This happened because, for execution efficiency, the compiler had
-generated code for the loop closure test at the end, rather than the
-start, of the loop---even though the test in a C @code{for}-loop is
-written before the body of the loop. The @code{until} command appeared
-to step back to the beginning of the loop when it advanced to this
-expression; however, it has not really gone to an earlier
-statement---not in terms of the actual machine code.
-
-@code{until} with no argument works by means of single
-instruction stepping, and hence is slower than @code{until} with an
-argument.
-
-@item until @var{location}
-@item u @var{location}
-Continue running the program until either the specified location is
-reached, or the current stack frame returns. @var{location}
-is any of the forms of argument acceptable to @code{break}
-(@pxref{Set Breaks}). This form of the command uses breakpoints, and
-hence is quicker than @code{until} without an argument.
-
-@item stepi
-@itemx si
-@kindex stepi
-@kindex si
-Execute one machine instruction, then stop and return to the debugger.
-
-It is often useful to do @samp{display/i $pc} when stepping by machine
-instructions. This will cause the next instruction to be executed to
-be displayed automatically at each stop. @xref{Auto Display}.
-
-An argument is a repeat count, as in @code{step}.
-
-@item nexti
-@itemx ni
-@kindex nexti
-@kindex ni
-Execute one machine instruction, but if it is a function call,
-proceed until the function returns.
-
-An argument is a repeat count, as in @code{next}.
-@end table
-
-
-@node Signals, , Continuing and Stepping, Stopping
-@section Signals
-@cindex signals
-
-A signal is an asynchronous event that can happen in a program. The
-operating system defines the possible kinds of signals, and gives each
-kind a name and a number. For example, in Unix @code{SIGINT} is the
-signal a program gets when you type an interrupt (often @kbd{C-c});
-@code{SIGSEGV} is the signal a program gets from referencing a place in
-memory far away from all the areas in use; @code{SIGALRM} occurs when
-the alarm clock timer goes off (which happens only if the program has
-requested an alarm).
-
-@cindex fatal signals
-Some signals, including @code{SIGALRM}, are a normal part of the
-functioning of the program. Others, such as @code{SIGSEGV}, indicate
-errors; these signals are @dfn{fatal} (kill the program immediately) if the
-program has not specified in advance some other way to handle the signal.
-@code{SIGINT} does not indicate an error in the program, but it is normally
-fatal so it can carry out the purpose of the interrupt: to kill the program.
-
-_GDBN__ has the ability to detect any occurrence of a signal in the program
-running under _GDBN__'s control. You can tell _GDBN__ in advance what to do for
-each kind of signal.
-
-@cindex handling signals
-Normally, _GDBN__ is set up to ignore non-erroneous signals like @code{SIGALRM}
-(so as not to interfere with their role in the functioning of the program)
-but to stop the program immediately whenever an error signal happens.
-You can change these settings with the @code{handle} command.
-
-@table @code
-@item info signals
-@kindex info signals
-Print a table of all the kinds of signals and how _GDBN__ has been told to
-handle each one. You can use this to see the signal numbers of all
-the defined types of signals.
-
-@item handle @var{signal} @var{keywords}@dots{}
-@kindex handle
-Change the way _GDBN__ handles signal @var{signal}. @var{signal} can be the
-number of a signal or its name (with or without the @samp{SIG} at the
-beginning). The @var{keywords} say what change to make.
-@end table
-
-@c @group
-The keywords allowed by the @code{handle} command can be abbreviated.
-Their full names are:
-
-@table @code
-@item nostop
-_GDBN__ should not stop the program when this signal happens. It may
-still print a message telling you that the signal has come in.
-
-@item stop
-_GDBN__ should stop the program when this signal happens. This implies
-the @code{print} keyword as well.
-
-@item print
-_GDBN__ should print a message when this signal happens.
-
-@item noprint
-_GDBN__ should not mention the occurrence of the signal at all. This
-implies the @code{nostop} keyword as well.
-
-@item pass
-_GDBN__ should allow the program to see this signal; the program will be
-able to handle the signal, or may be terminated if the signal is fatal
-and not handled.
-
-@item nopass
-_GDBN__ should not allow the program to see this signal.
-@end table
-@c @end group
-
-When a signal has been set to stop the program, the program cannot see the
-signal until you continue. It will see the signal then, if @code{pass} is
-in effect for the signal in question @i{at that time}. In other words,
-after _GDBN__ reports a signal, you can use the @code{handle} command with
-@code{pass} or @code{nopass} to control whether that signal will be seen by
-the program when you later continue it.
-
-You can also use the @code{signal} command to prevent the program from
-seeing a signal, or cause it to see a signal it normally would not see,
-or to give it any signal at any time. For example, if the program stopped
-due to some sort of memory reference error, you might store correct
-values into the erroneous variables and continue, hoping to see more
-execution; but the program would probably terminate immediately as
-a result of the fatal signal once it sees the signal. To prevent this,
-you can continue with @samp{signal 0}. @xref{Signaling}.
-
-@node Stack, Source, Stopping, Top
-@chapter Examining the Stack
-
-When your program has stopped, the first thing you need to know is where it
-stopped and how it got there.
-
-@cindex call stack
-Each time your program performs a function call, the information about
-where in the program the call was made from is saved in a block of data
-called a @dfn{stack frame}. The frame also contains the arguments of the
-call and the local variables of the function that was called. All the
-stack frames are allocated in a region of memory called the @dfn{call
-stack}.
-
-When your program stops, the _GDBN__ commands for examining the stack allow you
-to see all of this information.
-
-@cindex selected frame
-One of the stack frames is @dfn{selected} by _GDBN__ and many _GDBN__ commands
-refer implicitly to the selected frame. In particular, whenever you ask
-_GDBN__ for the value of a variable in the program, the value is found in the
-selected frame. There are special _GDBN__ commands to select whichever frame
-you are interested in.
-
-When the program stops, _GDBN__ automatically selects the currently executing
-frame and describes it briefly as the @code{frame} command does
-(@pxref{Frame Info}).
-
-@menu
-* Frames:: Stack Frames
-* Backtrace:: Backtraces
-* Selection:: Selecting a Frame
-* Frame Info:: Information on a Frame
-@end menu
-
-@node Frames, Backtrace, Stack, Stack
-@section Stack Frames
-
-@cindex frame
-@cindex stack frame
-The call stack is divided up into contiguous pieces called @dfn{stack
-frames}, or @dfn{frames} for short; each frame is the data associated
-with one call to one function. The frame contains the arguments given
-to the function, the function's local variables, and the address at
-which the function is executing.
-
-@cindex initial frame
-@cindex outermost frame
-@cindex innermost frame
-When your program is started, the stack has only one frame, that of the
-function @code{main}. This is called the @dfn{initial} frame or the
-@dfn{outermost} frame. Each time a function is called, a new frame is
-made. Each time a function returns, the frame for that function invocation
-is eliminated. If a function is recursive, there can be many frames for
-the same function. The frame for the function in which execution is
-actually occurring is called the @dfn{innermost} frame. This is the most
-recently created of all the stack frames that still exist.
-
-@cindex frame pointer
-Inside your program, stack frames are identified by their addresses. A
-stack frame consists of many bytes, each of which has its own address; each
-kind of computer has a convention for choosing one of those bytes whose
-address serves as the address of the frame. Usually this address is kept
-in a register called the @dfn{frame pointer register} while execution is
-going on in that frame.
-
-@cindex frame number
-_GDBN__ assigns numbers to all existing stack frames, starting with
-zero for the innermost frame, one for the frame that called it,
-and so on upward. These numbers do not really exist in your program;
-they are assigned by _GDBN__ to give you a way of designating stack
-frames in _GDBN__ commands.
-
-@cindex frameless execution
-Some compilers allow functions to be compiled so that they operate
-without stack frames. (For example, the @code{_GCC__} option
-@samp{-fomit-frame-pointer} will generate functions without a frame.)
-This is occasionally done with heavily used library functions to save
-the frame setup time. _GDBN__ has limited facilities for dealing with
-these function invocations. If the innermost function invocation has no
-stack frame, _GDBN__ will nevertheless regard it as though it had a
-separate frame, which is numbered zero as usual, allowing correct
-tracing of the function call chain. However, _GDBN__ has no provision
-for frameless functions elsewhere in the stack.
-
-@node Backtrace, Selection, Frames, Stack
-@section Backtraces
-
-A backtrace is a summary of how the program got where it is. It shows one
-line per frame, for many frames, starting with the currently executing
-frame (frame zero), followed by its caller (frame one), and on up the
-stack.
-
-@table @code
-@item backtrace
-@itemx bt
-@kindex backtrace
-@kindex bt
-Print a backtrace of the entire stack: one line per frame for all
-frames in the stack.
-
-You can stop the backtrace at any time by typing the system interrupt
-character, normally @kbd{C-c}.
-
-@item backtrace @var{n}
-@itemx bt @var{n}
-Similar, but print only the innermost @var{n} frames.
-
-@item backtrace -@var{n}
-@itemx bt -@var{n}
-Similar, but print only the outermost @var{n} frames.
-@end table
-
-@kindex where
-@kindex info stack
-@kindex info s
-The names @code{where} and @code{info stack} (abbreviated @code{info s})
-are additional aliases for @code{backtrace}.
-
-Each line in the backtrace shows the frame number and the function name.
-The program counter value is also shown---unless you use @code{set
-print address off}. The backtrace also shows the source file name and
-line number, as well as the arguments to the function. The program
-counter value is omitted if it is at the beginning of the code for that
-line number.
-
-Here is an example of a backtrace. It was made with the command
-@samp{bt 3}, so it shows the innermost three frames.
-
-@smallexample
-@group
-#0 m4_traceon (obs=0x24eb0, argc=1, argv=0x2b8c8) at builtin.c:993
-#1 0x6e38 in expand_macro (sym=0x2b600) at macro.c:242
-#2 0x6840 in expand_token (obs=0x0, t=177664, td=0xf7fffb08)
- at macro.c:71
-(More stack frames follow...)
-@end group
-@end smallexample
-
-@noindent
-The display for frame zero doesn't begin with a program counter
-value, indicating that the program has stopped at the beginning of the
-code for line @code{993} of @code{builtin.c}.
-
-@node Selection, Frame Info, Backtrace, Stack
-@section Selecting a Frame
-
-Most commands for examining the stack and other data in the program work on
-whichever stack frame is selected at the moment. Here are the commands for
-selecting a stack frame; all of them finish by printing a brief description
-of the stack frame just selected.
-
-@table @code
-@item frame @var{n}
-@itemx f @var{n}
-@kindex frame
-@kindex f
-Select frame number @var{n}. Recall that frame zero is the innermost
-(currently executing) frame, frame one is the frame that called the
-innermost one, and so on. The highest-numbered frame is @code{main}'s
-frame.
-
-@item frame @var{addr}
-@itemx f @var{addr}
-Select the frame at address @var{addr}. This is useful mainly if the
-chaining of stack frames has been damaged by a bug, making it
-impossible for _GDBN__ to assign numbers properly to all frames. In
-addition, this can be useful when the program has multiple stacks and
-switches between them.
-
-_if__(_SPARC__)
-On the SPARC architecture, @code{frame} needs two addresses to
-select an arbitrary frame: a frame pointer and a stack pointer.
-@c note to future updaters: this is conditioned on a flag
-@c FRAME_SPECIFICATION_DYADIC in the tm-*.h files, currently only used
-@c by SPARC, hence the specific attribution. Generalize or list all
-@c possibilities if more supported machines start doing this.
-_fi__(_SPARC__)
-
-@item up @var{n}
-@kindex up
-Move @var{n} frames up the stack. For positive numbers @var{n}, this
-advances toward the outermost frame, to higher frame numbers, to frames
-that have existed longer. @var{n} defaults to one.
-
-@item down @var{n}
-@kindex down
-@kindex do
-Move @var{n} frames down the stack. For positive numbers @var{n}, this
-advances toward the innermost frame, to lower frame numbers, to frames
-that were created more recently. @var{n} defaults to one. You may
-abbreviate @code{down} as @code{do}.
-@end table
-
-All of these commands end by printing two lines of output describing the
-frame. The first line shows the frame number, the function name, the
-arguments, and the source file and line number of execution in that
-frame. The second line shows the text of that source line. For
-example:
-
-@smallexample
-(_GDBP__) up
-#1 0x22f0 in main (argc=1, argv=0xf7fffbf4, env=0xf7fffbfc) at env.c:10
-10 read_input_file (argv[i]);
-@end smallexample
-
-After such a printout, the @code{list} command with no arguments will print
-ten lines centered on the point of execution in the frame. @xref{List}.
-
-@table @code
-@item up-silently @var{n}
-@itemx down-silently @var{n}
-@kindex down-silently
-@kindex up-silently
-These two commands are variants of @code{up} and @code{down},
-respectively; they differ in that they do their work silently, without
-causing display of the new frame. They are intended primarily for use
-in _GDBN__ command scripts, where the output might be unnecessary and
-distracting.
-
-@end table
-
-@node Frame Info, , Selection, Stack
-@section Information About a Frame
-
-There are several other commands to print information about the selected
-stack frame.
-
-@table @code
-@item frame
-@itemx f
-When used without any argument, this command does not change which frame
-is selected, but prints a brief description of the currently
-selected stack frame. It can be abbreviated @code{f}. With an
-argument, this command is used to select a stack frame (@pxref{Selection}).
-
-@item info frame
-@kindex info frame
-@itemx info f
-@kindex info f
-This command prints a verbose description of the selected stack frame,
-including the address of the frame, the addresses of the next frame down
-(called by this frame) and the next frame up (caller of this frame), the
-language that the source code corresponding to this frame was written in,
-the address of the frame's arguments, the program counter saved in it
-(the address of execution in the caller frame), and which registers
-were saved in the frame. The verbose description is useful when
-something has gone wrong that has made the stack format fail to fit
-the usual conventions.
-
-@item info frame @var{addr}
-@itemx info f @var{addr}
-Print a verbose description of the frame at address @var{addr},
-without selecting that frame. The selected frame remains unchanged by
-this command.
-
-@item info args
-@kindex info args
-Print the arguments of the selected frame, each on a separate line.
-
-@item info locals
-@kindex info locals
-Print the local variables of the selected frame, each on a separate
-line. These are all variables declared static or automatic within all
-program blocks that execution in this frame is currently inside of.
-
-@item info catch
-@kindex info catch
-@cindex catch exceptions
-@cindex exception handlers
-Print a list of all the exception handlers that are active in the
-current stack frame at the current point of execution. To see other
-exception handlers, visit the associated frame (using the @code{up},
-@code{down}, or @code{frame} commands); then type @code{info catch}.
-@xref{Exception Handling}.
-@end table
-
-@node Source, Data, Stack, Top
-@chapter Examining Source Files
-
-_GDBN__ can print parts of your program's source, since the debugging
-information recorded in your program tells _GDBN__ what source files
-were used to built it. When your program stops, _GDBN__ spontaneously
-prints the line where it stopped. Likewise, when you select a stack
-frame (@pxref{Selection}), _GDBN__ prints the line where execution in
-that frame has stopped. You can print other portions of source files by
-explicit command.
-
-If you use _GDBN__ through its GNU Emacs interface, you may prefer to
-use Emacs facilities to view source; @pxref{Emacs}.
-
-@menu
-* List:: Printing Source Lines
-* Search:: Searching Source Files
-* Source Path:: Specifying Source Directories
-* Machine Code:: Source and Machine Code
-@end menu
-
-@node List, Search, Source, Source
-@section Printing Source Lines
-
-@kindex list
-@kindex l
-To print lines from a source file, use the @code{list} command
-(abbreviated @code{l}). There are several ways to specify what part
-of the file you want to print.
-
-Here are the forms of the @code{list} command most commonly used:
-
-@table @code
-@item list @var{linenum}
-Print lines centered around line number @var{linenum} in the
-current source file.
-
-@item list @var{function}
-Print lines centered around the beginning of function
-@var{function}.
-
-@item list
-Print more lines. If the last lines printed were printed with a
-@code{list} command, this prints lines following the last lines
-printed; however, if the last line printed was a solitary line printed
-as part of displaying a stack frame (@pxref{Stack}), this prints
-lines centered around that line.
-
-@item list -
-Print lines just before the lines last printed.
-@end table
-
-By default, _GDBN__ prints ten source lines with any of these forms of
-the @code{list} command. You can change this using @code{set listsize}:
-
-@table @code
-@item set listsize @var{count}
-@kindex set listsize
-Make the @code{list} command display @var{count} source lines (unless
-the @code{list} argument explicitly specifies some other number).
-
-@item show listsize
-@kindex show listsize
-Display the number of lines that @code{list} will currently display by
-default.
-@end table
-
-Repeating a @code{list} command with @key{RET} discards the argument,
-so it is equivalent to typing just @code{list}. This is more useful
-than listing the same lines again. An exception is made for an
-argument of @samp{-}; that argument is preserved in repetition so that
-each repetition moves up in the source file.
-
-@cindex linespec
-In general, the @code{list} command expects you to supply zero, one or two
-@dfn{linespecs}. Linespecs specify source lines; there are several ways
-of writing them but the effect is always to specify some source line.
-Here is a complete description of the possible arguments for @code{list}:
-
-@table @code
-@item list @var{linespec}
-Print lines centered around the line specified by @var{linespec}.
-
-@item list @var{first},@var{last}
-Print lines from @var{first} to @var{last}. Both arguments are
-linespecs.
-
-@item list ,@var{last}
-Print lines ending with @var{last}.
-
-@item list @var{first},
-Print lines starting with @var{first}.
-
-@item list +
-Print lines just after the lines last printed.
-
-@item list -
-Print lines just before the lines last printed.
-
-@item list
-As described in the preceding table.
-@end table
-
-Here are the ways of specifying a single source line---all the
-kinds of linespec.
-
-@table @code
-@item @var{number}
-Specifies line @var{number} of the current source file.
-When a @code{list} command has two linespecs, this refers to
-the same source file as the first linespec.
-
-@item +@var{offset}
-Specifies the line @var{offset} lines after the last line printed.
-When used as the second linespec in a @code{list} command that has
-two, this specifies the line @var{offset} lines down from the
-first linespec.
-
-@item -@var{offset}
-Specifies the line @var{offset} lines before the last line printed.
-
-@item @var{filename}:@var{number}
-Specifies line @var{number} in the source file @var{filename}.
-
-@item @var{function}
-@c FIXME: "of the open-brace" is C-centric. When we add other langs...
-Specifies the line of the open-brace that begins the body of the
-function @var{function}.
-
-@item @var{filename}:@var{function}
-Specifies the line of the open-brace that begins the body of the
-function @var{function} in the file @var{filename}. You only need the
-file name with a function name to avoid ambiguity when there are
-identically named functions in different source files.
-
-@item *@var{address}
-Specifies the line containing the program address @var{address}.
-@var{address} may be any expression.
-@end table
-
-@node Search, Source Path, List, Source
-@section Searching Source Files
-@cindex searching
-@kindex reverse-search
-
-There are two commands for searching through the current source file for a
-regular expression.
-
-@table @code
-@item forward-search @var{regexp}
-@itemx search @var{regexp}
-@kindex search
-@kindex forward-search
-The command @samp{forward-search @var{regexp}} checks each line, starting
-with the one following the last line listed, for a match for @var{regexp}.
-It lists the line that is found. You can abbreviate the command name
-as @code{fo}. The synonym @samp{search @var{regexp}} is also supported.
-
-@item reverse-search @var{regexp}
-The command @samp{reverse-search @var{regexp}} checks each line, starting
-with the one before the last line listed and going backward, for a match
-for @var{regexp}. It lists the line that is found. You can abbreviate
-this command as @code{rev}.
-@end table
-
-@node Source Path, Machine Code, Search, Source
-@section Specifying Source Directories
-
-@cindex source path
-@cindex directories for source files
-Executable programs sometimes do not record the directories of the source
-files from which they were compiled, just the names. Even when they do,
-the directories could be moved between the compilation and your debugging
-session. _GDBN__ has a list of directories to search for source files;
-this is called the @dfn{source path}. Each time _GDBN__ wants a source file,
-it tries all the directories in the list, in the order they are present
-in the list, until it finds a file with the desired name. Note that
-the executable search path is @emph{not} used for this purpose. Neither is
-the current working directory, unless it happens to be in the source
-path.
-
-If _GDBN__ can't find a source file in the source path, and the object
-program records a directory, _GDBN__ tries that directory too. If the
-source path is empty, and there is no record of the compilation
-directory, _GDBN__ will, as a last resort, look in the current
-directory.
-
-Whenever you reset or rearrange the source path, _GDBN__ will clear out
-any information it has cached about where source files are found, where
-each line is in the file, etc.
-
-@kindex directory
-When you start _GDBN__, its source path is empty.
-To add other directories, use the @code{directory} command.
-
-@table @code
-@item directory @var{dirname} @dots{}
-Add directory @var{dirname} to the front of the source path. Several
-directory names may be given to this command, separated by @samp{:} or
-whitespace. You may specify a directory that is already in the source
-path; this moves it forward, so it will be searched sooner.
-
-You can use the string @samp{$cdir} to refer to the compilation
-directory (if one is recorded), and @samp{$cwd} to refer to the current
-working directory. @samp{$cwd} is not the same as @samp{.}---the former
-tracks the current working directory as it changes during your _GDBN__
-session, while the latter is immediately expanded to the current
-directory at the time you add an entry to the source path.
-
-@item directory
-Reset the source path to empty again. This requires confirmation.
-
-@c RET-repeat for @code{directory} is explicitly disabled, but since
-@c repeating it would be a no-op we don't say that. (thanks to RMS)
-
-@item show directories
-@kindex show directories
-Print the source path: show which directories it contains.
-@end table
-
-If your source path is cluttered with directories that are no longer of
-interest, _GDBN__ may sometimes cause confusion by finding the wrong
-versions of source. You can correct the situation as follows:
-
-@enumerate
-@item
-Use @code{directory} with no argument to reset the source path to empty.
-
-@item
-Use @code{directory} with suitable arguments to reinstall the
-directories you want in the source path. You can add all the
-directories in one command.
-@end enumerate
-
-@node Machine Code, , Source Path, Source
-@section Source and Machine Code
-You can use the command @code{info line} to map source lines to program
-addresses (and viceversa), and the command @code{disassemble} to display
-a range of addresses as machine instructions.
-
-@table @code
-@item info line @var{linespec}
-@kindex info line
-Print the starting and ending addresses of the compiled code for
-source line @var{linespec}. You can specify source lines in any of the
-ways understood by the @code{list} command (@pxref{List}).
-@end table
-
-For example, we can use @code{info line} to inquire on where the object
-code for the first line of function @code{m4_changequote} lies:
-@smallexample
-(_GDBP__) info line m4_changecom
-Line 895 of "builtin.c" starts at pc 0x634c and ends at 0x6350.
-@end smallexample
-
-@noindent
-We can also inquire (using @code{*@var{addr}} as the form for
-@var{linespec}) what source line covers a particular address:
-@smallexample
-(_GDBP__) info line *0x63ff
-Line 926 of "builtin.c" starts at pc 0x63e4 and ends at 0x6404.
-@end smallexample
-
-@cindex @code{$_} and @code{info line}
-After @code{info line}, the default address for the @code{x}
-command is changed to the starting address of the line, so that
-@samp{x/i} is sufficient to begin examining the machine code
-(@pxref{Memory}). Also, this address is saved as the value of the
-convenience variable @code{$_} (@pxref{Convenience Vars}).
-
-@table @code
-@kindex disassemble
-@item disassemble
-This specialized command is provided to dump a range of memory as
-machine instructions. The default memory range is the function
-surrounding the program counter of the selected frame. A single
-argument to this command is a program counter value; the function
-surrounding this value will be dumped. Two arguments (separated by one
-or more spaces) specify a range of addresses (first inclusive, second
-exclusive) to be dumped.
-@end table
-
-We can use @code{disassemble} to inspect the object code
-range shown in the last @code{info line} example:
-
-@smallexample
-(_GDBP__) disas 0x63e4 0x6404
-Dump of assembler code from 0x63e4 to 0x6404:
-0x63e4 <builtin_init+5340>: ble 0x63f8 <builtin_init+5360>
-0x63e8 <builtin_init+5344>: sethi %hi(0x4c00), %o0
-0x63ec <builtin_init+5348>: ld [%i1+4], %o0
-0x63f0 <builtin_init+5352>: b 0x63fc <builtin_init+5364>
-0x63f4 <builtin_init+5356>: ld [%o0+4], %o0
-0x63f8 <builtin_init+5360>: or %o0, 0x1a4, %o0
-0x63fc <builtin_init+5364>: call 0x9288 <path_search>
-0x6400 <builtin_init+5368>: nop
-End of assembler dump.
-(_GDBP__)
-
-@end smallexample
-
-@node Data, Languages, Source, Top
-@chapter Examining Data
-
-@cindex printing data
-@cindex examining data
-@kindex print
-@kindex inspect
-@c "inspect" isn't quite a synonym if you're using Epoch, which we don't
-@c document because it's nonstandard... Under Epoch it displays in a
-@c different window or something like that.
-The usual way to examine data in your program is with the @code{print}
-command (abbreviated @code{p}), or its synonym @code{inspect}. It
-evaluates and prints the value of an expression of the language your
-program is written in (@pxref{Languages}). You type
-
-@example
-print @var{exp}
-@end example
-
-@noindent
-where @var{exp} is an expression (in the source language), and
-the value of @var{exp} is printed in a format appropriate to its data
-type.
-
-A more low-level way of examining data is with the @code{x} command.
-It examines data in memory at a specified address and prints it in a
-specified format. @xref{Memory}.
-
-If you're interested in information about types, or about how the fields
-of a struct or class are declared, use the @code{ptype @var{exp}}
-command rather than @code{print}. @xref{Symbols}.
-
-@menu
-* Expressions:: Expressions
-* Variables:: Program Variables
-* Arrays:: Artificial Arrays
-* Output formats:: Output formats
-* Memory:: Examining Memory
-* Auto Display:: Automatic Display
-* Print Settings:: Print Settings
-* Value History:: Value History
-* Convenience Vars:: Convenience Variables
-* Registers:: Registers
-* Floating Point Hardware:: Floating Point Hardware
-@end menu
-
-@node Expressions, Variables, Data, Data
-@section Expressions
-
-@cindex expressions
-@code{print} and many other _GDBN__ commands accept an expression and
-compute its value. Any kind of constant, variable or operator defined
-by the programming language you are using is legal in an expression in
-_GDBN__. This includes conditional expressions, function calls, casts
-and string constants. It unfortunately does not include symbols defined
-by preprocessor @code{#define} commands.
-
-Because C is so widespread, most of the expressions shown in examples in
-this manual are in C. @xref{Languages,, Using _GDBN__ with Different
-Languages}, for information on how to use expressions in other
-languages.
-
-In this section, we discuss operators that you can use in _GDBN__
-expressions regardless of your programming language.
-
-Casts are supported in all languages, not just in C, because it is so
-useful to cast a number into a pointer so as to examine a structure
-at that address in memory.
-@c FIXME: casts supported---Mod2 true?
-
-_GDBN__ supports these operators in addition to those of programming
-languages:
-
-@table @code
-@item @@
-@samp{@@} is a binary operator for treating parts of memory as arrays.
-@xref{Arrays}, for more information.
-
-@item ::
-@samp{::} allows you to specify a variable in terms of the file or
-function where it is defined. @xref{Variables}.
-
-@item @{@var{type}@} @var{addr}
-Refers to an object of type @var{type} stored at address @var{addr} in
-memory. @var{addr} may be any expression whose value is an integer or
-pointer (but parentheses are required around binary operators, just as in
-a cast). This construct is allowed regardless of what kind of data is
-normally supposed to reside at @var{addr}.@refill
-@end table
-
-@node Variables, Arrays, Expressions, Data
-@section Program Variables
-
-The most common kind of expression to use is the name of a variable
-in your program.
-
-Variables in expressions are understood in the selected stack frame
-(@pxref{Selection}); they must either be global (or static) or be visible
-according to the scope rules of the programming language from the point of
-execution in that frame. This means that in the function
-
-@example
-foo (a)
- int a;
-@{
- bar (a);
- @{
- int b = test ();
- bar (b);
- @}
-@}
-@end example
-
-@noindent
-the variable @code{a} is usable whenever the program is executing
-within the function @code{foo}, but the variable @code{b} is visible
-only while the program is executing inside the block in which @code{b}
-is declared.
-
-@cindex variable name conflict
-There is an exception: you can refer to a variable or function whose
-scope is a single source file even if the current execution point is not
-in this file. But it is possible to have more than one such variable or
-function with the same name (in different source files). If that happens,
-referring to that name has unpredictable effects. If you wish, you can
-specify a variable in a particular file, using the colon-colon notation:
-
-@cindex colon-colon
-@kindex ::
-@example
-@var{file}::@var{variable}
-@end example
-
-@noindent
-Here @var{file} is the name of the source file whose variable you want.
-
-@cindex C++ scope resolution
-This use of @samp{::} is very rarely in conflict with the very similar
-use of the same notation in C++. _GDBN__ also supports use of the C++
-scope resolution operator in _GDBN__ expressions.
-
-@cindex wrong values
-@cindex variable values, wrong
-@quotation
-@emph{Warning:} Occasionally, a local variable may appear to have the
-wrong value at certain points in a function---just after entry to the
-function, and just before exit. You may see this problem when you're
-stepping by machine instructions. This is because on most machines, it
-takes more than one instruction to set up a stack frame (including local
-variable definitions); if you're stepping by machine instructions,
-variables may appear to have the wrong values until the stack frame is
-completely built. On function exit, it usually also takes more than one
-machine instruction to destroy a stack frame; after you begin stepping
-through that group of instructions, local variable definitions may be
-gone.
-@end quotation
-
-@node Arrays, Output formats, Variables, Data
-@section Artificial Arrays
-
-@cindex artificial array
-@kindex @@
-It is often useful to print out several successive objects of the
-same type in memory; a section of an array, or an array of
-dynamically determined size for which only a pointer exists in the
-program.
-
-This can be done by constructing an @dfn{artificial array} with the
-binary operator @samp{@@}. The left operand of @samp{@@} should be
-the first element of the desired array, as an individual object.
-The right operand should be the desired length of the array. The result is
-an array value whose elements are all of the type of the left argument.
-The first element is actually the left argument; the second element
-comes from bytes of memory immediately following those that hold the
-first element, and so on. Here is an example. If a program says
-
-@example
-int *array = (int *) malloc (len * sizeof (int));
-@end example
-
-@noindent
-you can print the contents of @code{array} with
-
-@example
-p *array@@len
-@end example
-
-The left operand of @samp{@@} must reside in memory. Array values made
-with @samp{@@} in this way behave just like other arrays in terms of
-subscripting, and are coerced to pointers when used in expressions.
-Artificial arrays most often appear in expressions via the value history
-(@pxref{Value History}), after printing one out.)
-
-Sometimes the artificial array mechanism isn't quite enough; in
-moderately complex data structures, the elements of interest may not
-actually be adjacent---for example, if you're interested in the values
-of pointers in an array. One useful work-around in this situation is to
-use a convenience variable (@pxref{Convenience Vars}) as a counter in an
-expression that prints the first interesting value, and then repeat that
-expression via @key{RET}. For instance, suppose you have an array
-@code{dtab} of pointers to structures, and you're interested in the
-values of a field @code{fv} in each structure. Here's an example of
-what you might type:
-@example
-set $i = 0
-p dtab[$i++]->fv
-@key{RET}
-@key{RET}
-@dots{}
-@end example
-
-@node Output formats, Memory, Arrays, Data
-@section Output formats
-
-@cindex formatted output
-@cindex output formats
-By default, _GDBN__ prints a value according to its data type. Sometimes
-this is not what you want. For example, you might want to print a number
-in hex, or a pointer in decimal. Or you might want to view data in memory
-at a certain address as a character string or as an instruction. To do
-these things, specify an @dfn{output format} when you print a value.
-
-The simplest use of output formats is to say how to print a value
-already computed. This is done by starting the arguments of the
-@code{print} command with a slash and a format letter. The format
-letters supported are:
-
-@table @code
-@item x
-Regard the bits of the value as an integer, and print the integer in
-hexadecimal.
-
-@item d
-Print as integer in signed decimal.
-
-@item u
-Print as integer in unsigned decimal.
-
-@item o
-Print as integer in octal.
-
-@item t
-Print as integer in binary. The letter @samp{t} stands for ``two''.
-
-@item a
-Print as an address, both absolute in hex and as an offset from the
-nearest preceding symbol. This format can be used to discover where (in
-what function) an unknown address is located:
-@example
-(_GDBP__) p/a 0x54320
-_0__$3 = 0x54320 <_initialize_vx+396>_1__
-@end example
-
-
-@item c
-Regard as an integer and print it as a character constant.
-
-@item f
-Regard the bits of the value as a floating point number and print
-using typical floating point syntax.
-@end table
-
-For example, to print the program counter in hex (@pxref{Registers}), type
-
-@example
-p/x $pc
-@end example
-
-@noindent
-Note that no space is required before the slash; this is because command
-names in _GDBN__ cannot contain a slash.
-
-To reprint the last value in the value history with a different format,
-you can use the @code{print} command with just a format and no
-expression. For example, @samp{p/x} reprints the last value in hex.
-
-@node Memory, Auto Display, Output formats, Data
-@section Examining Memory
-
-@cindex examining memory
-@table @code
-@kindex x
-@item x/@var{nfu} @var{expr}
-The command @code{x} (for `examine') can be used to examine memory
-without being constrained by your program's data types. You can specify
-the unit size @var{u} of memory to inspect, and a repeat count @var{n} of how
-many of those units to display. @code{x} understands the formats
-@var{f} used by @code{print}; two additional formats, @samp{s} (string)
-and @samp{i} (machine instruction) can be used without specifying a unit
-size.
-@end table
-
-For example, @samp{x/3uh 0x54320} is a request to display three halfwords
-(@code{h}) of memory, formatted as unsigned decimal integers (@samp{u}),
-starting at address @code{0x54320}. @samp{x/4xw $sp} prints the four
-words (@samp{w}) of memory above the stack pointer (here, @samp{$sp};
-@pxref{Registers}) in hexadecimal (@samp{x}).
-
-Since the letters indicating unit sizes are all distinct from the
-letters specifying output formats, you don't have to remember whether
-unit size or format comes first; either order will work. The output
-specifications @samp{4xw} and @samp{4wx} mean exactly the same thing.
-
-After the format specification, you supply an expression for the address
-where _GDBN__ is to begin reading from memory. The expression need not
-have a pointer value (though it may); it is always interpreted as an
-integer address of a byte of memory. @xref{Expressions} for more
-information on expressions.
-
-These are the memory units @var{u} you can specify with the @code{x}
-command:
-
-@table @code
-@item b
-Examine individual bytes.
-
-@item h
-Examine halfwords (two bytes each).
-
-@item w
-Examine words (four bytes each).
-
-@cindex word
-Many assemblers and cpu designers still use `word' for a 16-bit quantity,
-as a holdover from specific predecessor machines of the 1970's that really
-did use two-byte words. But more generally the term `word' has always
-referred to the size of quantity that a machine normally operates on and
-stores in its registers. This is 32 bits for all the machines that _GDBN__
-runs on.
-
-@item g
-Examine giant words (8 bytes).
-@end table
-
-You can combine these unit specifications with any of the formats
-described for @code{print}. @xref{Output formats}.
-
-@code{x} has two additional output specifications which derive the unit
-size from the data inspected:
-
-@table @code
-@item s
-Print a null-terminated string of characters. Any explicitly specified
-unit size is ignored; instead, the unit is however many bytes it takes
-to reach a null character (including the null character).
-
-@item i
-Print a machine instruction in assembler syntax (or nearly). Any
-specified unit size is ignored; the number of bytes in an instruction
-varies depending on the type of machine, the opcode and the addressing
-modes used. The command @code{disassemble} gives an alternative way of
-inspecting machine instructions. @xref{Machine Code}.
-@end table
-
-If you omit either the format @var{f} or the unit size @var{u}, @code{x}
-will use the same one that was used last. If you don't use any letters
-or digits after the slash, you can omit the slash as well.
-
-You can also omit the address to examine. Then the address used is just
-after the last unit examined. This is why string and instruction
-formats actually compute a unit-size based on the data: so that the next
-string or instruction examined will start in the right place.
-
-When the @code{print} command shows a value that resides in memory,
-@code{print} also sets the default address for the @code{x} command.
-@code{info line} also sets the default for @code{x}, to the address of
-the start of the machine code for the specified line
-(@pxref{Machine Code}),
-and @code{info breakpoints} sets it to the address of the last
-breakpoint listed (@pxref{Set Breaks}).@refill
-
-When you use @key{RET} to repeat an @code{x} command, the address
-specified previously (if any) is ignored, so that the repeated command
-examines the successive locations in memory rather than the same ones.
-
-You can examine several consecutive units of memory with one command by
-writing a repeat-count after the slash (before the format letters, if
-any). Omitting the repeat count @var{n} displays one unit of the
-appropriate size. The repeat count must be a decimal integer. It has
-the same effect as repeating the @code{x} command @var{n} times except
-that the output may be more compact, with several units per line. For
-example,
-
-@example
-x/10i $pc
-@end example
-
-@noindent
-prints ten instructions starting with the one to be executed next in the
-selected frame. After doing this, you could print a further seven
-instructions with
-
-@example
-x/7
-@end example
-
-@noindent
----where the format and address are allowed to default.
-
-@cindex @code{$_}, @code{$__}, and value history
-The addresses and contents printed by the @code{x} command are not put
-in the value history because there is often too much of them and they
-would get in the way. Instead, _GDBN__ makes these values available for
-subsequent use in expressions as values of the convenience variables
-@code{$_} and @code{$__}. After an @code{x} command, the last address
-examined is available for use in expressions in the convenience variable
-@code{$_}. The contents of that address, as examined, are available in
-the convenience variable @code{$__}.
-
-If the @code{x} command has a repeat count, the address and contents saved
-are from the last memory unit printed; this is not the same as the last
-address printed if several units were printed on the last line of output.
-
-@node Auto Display, Print Settings, Memory, Data
-@section Automatic Display
-@cindex automatic display
-@cindex display of expressions
-
-If you find that you want to print the value of an expression frequently
-(to see how it changes), you might want to add it to the @dfn{automatic
-display list} so that _GDBN__ will print its value each time the program stops.
-Each expression added to the list is given a number to identify it;
-to remove an expression from the list, you specify that number.
-The automatic display looks like this:
-
-@example
-2: foo = 38
-3: bar[5] = (struct hack *) 0x3804
-@end example
-
-@noindent
-showing item numbers, expressions and their current values. As with
-displays you request manually using @code{x} or @code{print}, you can
-specify the output format you prefer; in fact, @code{display} decides
-whether to use @code{print} or @code{x} depending on how elaborate your
-format specification is---it uses @code{x} if you specify a unit size,
-or one of the two formats (@samp{i} and @samp{s}) that are only
-supported by @code{x}; otherwise it uses @code{print}.
-
-@table @code
-@item display @var{exp}
-@kindex display
-Add the expression @var{exp} to the list of expressions to display
-each time the program stops. @xref{Expressions}.
-
-@code{display} will not repeat if you press @key{RET} again after using it.
-
-@item display/@var{fmt} @var{exp}
-For @var{fmt} specifying only a display format and not a size or
-count, add the expression @var{exp} to the auto-display list but
-arranges to display it each time in the specified format @var{fmt}.
-@xref{Output formats}.
-
-@item display/@var{fmt} @var{addr}
-For @var{fmt} @samp{i} or @samp{s}, or including a unit-size or a
-number of units, add the expression @var{addr} as a memory address to
-be examined each time the program stops. Examining means in effect
-doing @samp{x/@var{fmt} @var{addr}}. @xref{Memory}.
-@end table
-
-For example, @samp{display/i $pc} can be helpful, to see the machine
-instruction about to be executed each time execution stops (@samp{$pc}
-is a common name for the program counter; @pxref{Registers}).
-
-@table @code
-@item undisplay @var{dnums}@dots{}
-@itemx delete display @var{dnums}@dots{}
-@kindex delete display
-@kindex undisplay
-Remove item numbers @var{dnums} from the list of expressions to display.
-
-@code{undisplay} will not repeat if you press @key{RET} after using it.
-(Otherwise you would just get the error @samp{No display number @dots{}}.)
-
-@item disable display @var{dnums}@dots{}
-@kindex disable display
-Disable the display of item numbers @var{dnums}. A disabled display
-item is not printed automatically, but is not forgotten. It may be
-enabled again later.
-
-@item enable display @var{dnums}@dots{}
-@kindex enable display
-Enable display of item numbers @var{dnums}. It becomes effective once
-again in auto display of its expression, until you specify otherwise.
-
-@item display
-Display the current values of the expressions on the list, just as is
-done when the program stops.
-
-@item info display
-@kindex info display
-Print the list of expressions previously set up to display
-automatically, each one with its item number, but without showing the
-values. This includes disabled expressions, which are marked as such.
-It also includes expressions which would not be displayed right now
-because they refer to automatic variables not currently available.
-@end table
-
-If a display expression refers to local variables, then it does not make
-sense outside the lexical context for which it was set up. Such an
-expression is disabled when execution enters a context where one of its
-variables is not defined. For example, if you give the command
-@code{display last_char} while inside a function with an argument
-@code{last_char}, then this argument will be displayed while the program
-continues to stop inside that function. When it stops elsewhere---where
-there is no variable @code{last_char}---display is disabled. The next time
-your program stops where @code{last_char} is meaningful, you can enable the
-display expression once again.
-
-@node Print Settings, Value History, Auto Display, Data
-@section Print Settings
-
-@cindex format options
-@cindex print settings
-_GDBN__ provides the following ways to control how arrays, structures,
-and symbols are printed.
-
-@noindent
-These settings are useful for debugging programs in any language:
-
-@table @code
-@item set print address
-@item set print address on
-@kindex set print address
-_GDBN__ will print memory addresses showing the location of stack
-traces, structure values, pointer values, breakpoints, and so forth,
-even when it also displays the contents of those addresses. The default
-is on. For example, this is what a stack frame display looks like, with
-@code{set print address on}:
-@smallexample
-(_GDBP__) f
-#0 set_quotes (lq=0x34c78 "<<", rq=0x34c88 ">>")
- at input.c:530
-530 if (lquote != def_lquote)
-@end smallexample
-
-@item set print address off
-Do not print addresses when displaying their contents. For example,
-this is the same stack frame displayed with @code{set print address off}:
-@example
-(_GDBP__) set print addr off
-(_GDBP__) f
-#0 set_quotes (lq="<<", rq=">>") at input.c:530
-530 if (lquote != def_lquote)
-@end example
-
-@item show print address
-@kindex show print address
-Show whether or not addresses are to be printed.
-
-@item set print array
-@itemx set print array on
-@kindex set print array
-_GDBN__ will pretty print arrays. This format is more convenient to read,
-but uses more space. The default is off.
-
-@item set print array off.
-Return to compressed format for arrays.
-
-@item show print array
-@kindex show print array
-Show whether compressed or pretty format is selected for displaying
-arrays.
-
-@item set print elements @var{number-of-elements}
-@kindex set print elements
-If _GDBN__ is printing a large array, it will stop printing after it has
-printed the number of elements set by the @code{set print elements} command.
-This limit also applies to the display of strings.
-
-@item show print elements
-@kindex show print elements
-Display the number of elements of a large array that _GDBN__ will print
-before losing patience.
-
-@item set print pretty on
-@kindex set print pretty
-Cause _GDBN__ to print structures in an indented format with one member per
-line, like this:
-
-@example
-$1 = @{
- next = 0x0,
- flags = @{
- sweet = 1,
- sour = 1
- @},
- meat = 0x54 "Pork"
-@}
-@end example
-
-@item set print pretty off
-Cause _GDBN__ to print structures in a compact format, like this:
-
-@smallexample
-$1 = @{next = 0x0, flags = @{sweet = 1, sour = 1@}, meat \
-= 0x54 "Pork"@}
-@end smallexample
-
-@noindent
-This is the default format.
-
-@item show print pretty
-@kindex show print pretty
-Show which format _GDBN__ will use to print structures.
-
-@item set print sevenbit-strings on
-@kindex set print sevenbit-strings
-Print using only seven-bit characters; if this option is set,
-_GDBN__ will display any eight-bit characters (in strings or character
-values) using the notation @code{\}@var{nnn}. For example, @kbd{M-a} is
-displayed as @code{\341}.
-
-@item set print sevenbit-strings off
-Print using either seven-bit or eight-bit characters, as required. This
-is the default.
-
-@item show print sevenbit-strings
-@kindex show print sevenbit-strings
-Show whether or not _GDBN__ will print only seven-bit characters.
-
-@item set print union on
-@kindex set print union
-Tell _GDBN__ to print unions which are contained in structures. This is the
-default setting.
-
-@item set print union off
-Tell _GDBN__ not to print unions which are contained in structures.
-
-@item show print union
-@kindex show print union
-Ask _GDBN__ whether or not it will print unions which are contained in
-structures.
-
-For example, given the declarations
-
-@smallexample
-typedef enum @{Tree, Bug@} Species;
-typedef enum @{Big_tree, Acorn, Seedling@} Tree_forms;
-typedef enum @{Caterpillar, Cocoon, Butterfly@} Bug_forms;
-
-struct thing @{
- Species it;
- union @{
- Tree_forms tree;
- Bug_forms bug;
- @} form;
-@};
-
-struct thing foo = @{Tree, @{Acorn@}@};
-@end smallexample
-
-@noindent
-with @code{set print union on} in effect @samp{p foo} would print
-
-@smallexample
-$1 = @{it = Tree, form = @{tree = Acorn, bug = Cocoon@}@}
-@end smallexample
-
-@noindent
-and with @code{set print union off} in effect it would print
-
-@smallexample
-$1 = @{it = Tree, form = @{...@}@}
-@end smallexample
-@end table
-
-@noindent
-These settings are of interest when debugging C++ programs:
-
-@table @code
-@item set print demangle
-@itemx set print demangle on
-@kindex set print demangle
-Print C++ names in their source form rather than in the mangled form
-in which they are passed to the assembler and linker for type-safe linkage.
-The default is on.
-
-@item show print demangle
-@kindex show print demangle
-Show whether C++ names will be printed in mangled or demangled form.
-
-@item set print asm-demangle
-@itemx set print asm-demangle on
-@kindex set print asm-demangle
-Print C++ names in their source form rather than their mangled form, even
-in assembler code printouts such as instruction disassemblies.
-The default is off.
-
-@item show print asm-demangle
-@kindex show print asm-demangle
-Show whether C++ names in assembly listings will be printed in mangled
-or demangled form.
-
-@item set print object
-@itemx set print object on
-@kindex set print object
-When displaying a pointer to an object, identify the @emph{actual}
-(derived) type of the object rather than the @emph{declared} type, using
-the virtual function table.
-
-@item set print object off
-Display only the declared type of objects, without reference to the
-virtual function table. This is the default setting.
-
-@item show print object
-@kindex show print object
-Show whether actual, or declared, object types will be displayed.
-
-@item set print vtbl
-@itemx set print vtbl on
-@kindex set print vtbl
-Pretty print C++ virtual function tables. The default is off.
-
-@item set print vtbl off
-Do not pretty print C++ virtual function tables.
-
-@item show print vtbl
-@kindex show print vtbl
-Show whether C++ virtual function tables are pretty printed, or not.
-
-@end table
-
-@node Value History, Convenience Vars, Print Settings, Data
-@section Value History
-
-@cindex value history
-Values printed by the @code{print} command are saved in _GDBN__'s @dfn{value
-history} so that you can refer to them in other expressions. Values are
-kept until the symbol table is re-read or discarded (for example with
-the @code{file} or @code{symbol-file} commands). When the symbol table
-changes, the value history is discarded, since the values may contain
-pointers back to the types defined in the symbol table.
-
-@cindex @code{$}
-@cindex @code{$$}
-@cindex history number
-The values printed are given @dfn{history numbers} for you to refer to them
-by. These are successive integers starting with one. @code{print} shows you
-the history number assigned to a value by printing @samp{$@var{num} = }
-before the value; here @var{num} is the history number.
-
-To refer to any previous value, use @samp{$} followed by the value's
-history number. The way @code{print} labels its output is designed to
-remind you of this. Just @code{$} refers to the most recent value in
-the history, and @code{$$} refers to the value before that.
-@code{$$@var{n}} refers to the @var{n}th value from the end; @code{$$2}
-is the value just prior to @code{$$}, @code{$$1} is equivalent to
-@code{$$}, and @code{$$0} is equivalent to @code{$}.
-
-For example, suppose you have just printed a pointer to a structure and
-want to see the contents of the structure. It suffices to type
-
-@example
-p *$
-@end example
-
-If you have a chain of structures where the component @code{next} points
-to the next one, you can print the contents of the next one with this:
-
-@example
-p *$.next
-@end example
-
-@noindent
-You can print successive links in the chain by repeating this
-command---which you can do by just typing @key{RET}.
-
-Note that the history records values, not expressions. If the value of
-@code{x} is 4 and you type these commands:
-
-@example
-print x
-set x=5
-@end example
-
-@noindent
-then the value recorded in the value history by the @code{print} command
-remains 4 even though the value of @code{x} has changed.
-
-@table @code
-@kindex show values
-@item show values
-Print the last ten values in the value history, with their item numbers.
-This is like @samp{p@ $$9} repeated ten times, except that @code{show
-values} does not change the history.
-
-@item show values @var{n}
-Print ten history values centered on history item number @var{n}.
-
-@item show values +
-Print ten history values just after the values last printed. If no more
-values are available, produces no display.
-@end table
-
-Pressing @key{RET} to repeat @code{show values @var{n}} has exactly the
-same effect as @samp{show values +}.
-
-@node Convenience Vars, Registers, Value History, Data
-@section Convenience Variables
-
-@cindex convenience variables
-_GDBN__ provides @dfn{convenience variables} that you can use within
-_GDBN__ to hold on to a value and refer to it later. These variables
-exist entirely within _GDBN__; they are not part of your program, and
-setting a convenience variable has no direct effect on further execution
-of your program. That's why you can use them freely.
-
-Convenience variables are prefixed with @samp{$}. Any name preceded by
-@samp{$} can be used for a convenience variable, unless it is one of
-the predefined machine-specific register names (@pxref{Registers}).
-(Value history references, in contrast, are @emph{numbers} preceded
-by @samp{$}. @xref{Value History}.)
-
-You can save a value in a convenience variable with an assignment
-expression, just as you would set a variable in your program. Example:
-
-@example
-set $foo = *object_ptr
-@end example
-
-@noindent
-would save in @code{$foo} the value contained in the object pointed to by
-@code{object_ptr}.
-
-Using a convenience variable for the first time creates it; but its value
-is @code{void} until you assign a new value. You can alter the value with
-another assignment at any time.
-
-Convenience variables have no fixed types. You can assign a convenience
-variable any type of value, including structures and arrays, even if
-that variable already has a value of a different type. The convenience
-variable, when used as an expression, has the type of its current value.
-
-@table @code
-@item show convenience
-@kindex show convenience
-Print a list of convenience variables used so far, and their values.
-Abbreviated @code{show con}.
-@end table
-
-One of the ways to use a convenience variable is as a counter to be
-incremented or a pointer to be advanced. For example, to print
-a field from successive elements of an array of structures:
-
-_0__@example
-set $i = 0
-print bar[$i++]->contents
-@i{@dots{} repeat that command by typing @key{RET}.}
-_1__@end example
-
-Some convenience variables are created automatically by _GDBN__ and given
-values likely to be useful.
-
-@table @code
-@item $_
-@kindex $_
-The variable @code{$_} is automatically set by the @code{x} command to
-the last address examined (@pxref{Memory}). Other commands which
-provide a default address for @code{x} to examine also set @code{$_}
-to that address; these commands include @code{info line} and @code{info
-breakpoint}. The type of @code{$_} is @code{void *} except when set by the
-@code{x} command, in which case it is a pointer to the type of @code{$__}.
-
-@item $__
-@kindex $__
-The variable @code{$__} is automatically set by the @code{x} command
-to the value found in the last address examined. Its type is chosen
-to match the format in which the data was printed.
-@end table
-
-@node Registers, Floating Point Hardware, Convenience Vars, Data
-@section Registers
-
-@cindex registers
-You can refer to machine register contents, in expressions, as variables
-with names starting with @samp{$}. The names of registers are different
-for each machine; use @code{info registers} to see the names used on
-your machine.
-
-@table @code
-@item info registers
-@kindex info registers
-Print the names and values of all registers except floating-point
-registers (in the selected stack frame).
-
-@item info all-registers
-@kindex info all-registers
-@cindex floating point registers
-Print the names and values of all registers, including floating-point
-registers.
-
-@item info registers @var{regname}
-Print the relativized value of register @var{regname}. @var{regname}
-may be any register name valid on the machine you are using, with
-or without the initial @samp{$}.
-@end table
-
-The register names @code{$pc} and @code{$sp} are used on most machines
-for the program counter register and the stack pointer. For example,
-you could print the program counter in hex with
-@example
-p/x $pc
-@end example
-
-@noindent
-or print the instruction to be executed next with
-@example
-x/i $pc
-@end example
-
-@noindent
-or add four to the stack pointer with
-@example
-set $sp += 4
-@end example
-
-@noindent
-The last is a way of removing one word from the stack, on machines where
-stacks grow downward in memory (most machines, nowadays). This assumes
-that the innermost stack frame is selected; setting @code{$sp} is
-not allowed when other stack frames are selected. (To pop entire frames
-off the stack, regardless of machine architecture, use @code{return};
-@pxref{Returning}.)
-
-Often @code{$fp} is used for a register that contains a pointer to the
-current stack frame, and @code{$ps} is sometimes used for a register
-that contains the processor status. These standard register names may
-be available on your machine even though the @code{info registers}
-command shows other names. For example, on the SPARC, @code{info
-registers} displays the processor status register as @code{$psr} but you
-can also refer to it as @code{$ps}.
-
-_GDBN__ always considers the contents of an ordinary register as an
-integer when the register is examined in this way. Some machines have
-special registers which can hold nothing but floating point; these
-registers are considered to have floating point values. There is no way
-to refer to the contents of an ordinary register as floating point value
-(although you can @emph{print} it as a floating point value with
-@samp{print/f $@var{regname}}).
-
-Some registers have distinct ``raw'' and ``virtual'' data formats. This
-means that the data format in which the register contents are saved by
-the operating system is not the same one that your program normally
-sees. For example, the registers of the 68881 floating point
-coprocessor are always saved in ``extended'' (raw) format, but all C
-programs expect to work with ``double'' (virtual) format. In such
-cases, _GDBN__ normally works with the virtual format only (the format that
-makes sense for your program), but the @code{info registers} command
-prints the data in both formats.
-
-Normally, register values are relative to the selected stack frame
-(@pxref{Selection}). This means that you get the value that the
-register would contain if all stack frames farther in were exited and
-their saved registers restored. In order to see the true contents of
-hardware registers, you must select the innermost frame (with
-@samp{frame 0}).
-
-However, _GDBN__ must deduce where registers are saved, from the machine
-code generated by your compiler. If some registers are not saved, or if
-_GDBN__ is unable to locate the saved registers, the selected stack
-frame will make no difference.
-
-@node Floating Point Hardware, , Registers, Data
-@section Floating Point Hardware
-@cindex floating point
-Depending on the host machine architecture, _GDBN__ may be able to give
-you more information about the status of the floating point hardware.
-
-@table @code
-@item info float
-@kindex info float
-If available, provides hardware-dependent information about the floating
-point unit. The exact contents and layout vary depending on the
-floating point chip.
-@end table
-@c FIXME: this is a cop-out. Try to get examples, explanations. Only
-@c FIXME...supported currently on arm's and 386's. Mark properly with
-@c FIXME... m4 macros to isolate general statements from hardware-dep,
-@c FIXME... at that point.
-
-@node Languages, Symbols, Data, Top
-@chapter Using _GDBN__ with Different Languages
-@cindex languages
-
-Although programming languages generally have common aspects, they are
-rarely expressed in the same manner. For instance, in ANSI C,
-dereferencing a pointer @code{p} is accomplished by @code{*p}, but in
-Modula-2, it is accomplished by @code{p^}. Values can also be
-represented (and displayed) differently. Hex numbers in C are written
-like @samp{0x1ae}, while in Modula-2 they appear as @samp{1AEH}.
-
-@cindex working language
-Language-specific information is built into _GDBN__ for some languages,
-allowing you to express operations like the above in the program's
-native language, and allowing _GDBN__ to output values in a manner
-consistent with the syntax of the program's native language. The
-language you use to build expressions, called the @dfn{working
-language}, can be selected manually, or _GDBN__ can set it
-automatically.
-
-@menu
-* Setting:: Switching between source languages
-* Show:: Displaying the language
-* Checks:: Type and Range checks
-* Support:: Supported languages
-@end menu
-
-@node Setting, Show, Languages, Languages
-@section Switching between source languages
-
-There are two ways to control the working language---either have _GDBN__
-set it automatically, or select it manually yourself. You can use the
-@code{set language} command for either purpose. On startup, _GDBN__
-defaults to setting the language automatically.
-
-@menu
-* Manually:: Setting the working language manually
-* Automatically:: Having _GDBN__ infer the source language
-@end menu
-
-@node Manually, Automatically, Setting, Setting
-@subsection Setting the working language
-
-@kindex set language
-To set the language, issue the command @samp{set language @var{lang}},
-where @var{lang} is the name of a language: @code{c} or @code{modula-2}.
-For a list of the supported languages, type @samp{set language}.
-
-Setting the language manually prevents _GDBN__ from updating the working
-language automatically. This can lead to confusion if you try
-to debug a program when the working language is not the same as the
-source language, when an expression is acceptable to both
-languages---but means different things. For instance, if the current
-source file were written in C, and _GDBN__ was parsing Modula-2, a
-command such as:
-
-@example
-print a = b + c
-@end example
-
-@noindent
-might not have the effect you intended. In C, this means to add
-@code{b} and @code{c} and place the result in @code{a}. The result
-printed would be the value of @code{a}. In Modula-2, this means to compare
-@code{a} to the result of @code{b+c}, yielding a @code{BOOLEAN} value.
-
-If you allow _GDBN__ to set the language automatically, then
-you can count on expressions evaluating the same way in your debugging
-session and in your program.
-
-@node Automatically, , Manually, Setting
-@subsection Having _GDBN__ infer the source language
-
-To have _GDBN__ set the working language automatically, use @samp{set
-language local} or @samp{set language auto}. _GDBN__ then infers the
-language that a program was written in by looking at the name of its
-source files, and examining their extensions:
-
-@table @file
-@item *.mod
-Modula-2 source file
-
-@item *.c
-@itemx *.cc
-C or C++ source file.
-@end table
-
-This information is recorded for each function or procedure in a source
-file. When your program stops in a frame (usually by encountering a
-breakpoint), _GDBN__ sets the working language to the language recorded
-for the function in that frame. If the language for a frame is unknown
-(that is, if the function or block corresponding to the frame was
-defined in a source file that does not have a recognized extension), the
-current working language is not changed, and _GDBN__ issues a warning.
-
-This may not seem necessary for most programs, which are written
-entirely in one source language. However, program modules and libraries
-written in one source language can be used by a main program written in
-a different source language. Using @samp{set language auto} in this
-case frees you from having to set the working language manually.
-
-@node Show, Checks, Setting, Languages
-@section Displaying the language
-
-The following commands will help you find out which language is the
-working language, and also what language source files were written in.
-
-@kindex show language
-@kindex info frame
-@kindex info source
-@table @code
-@item show language
-Display the current working language. This is the
-language you can use with commands such as @code{print} to
-build and compute expressions that may involve variables in the program.
-
-@item info frame
-Among the other information listed here (@pxref{Frame Info,,Information
-about a Frame}) is the source language for this frame. This is the
-language that will become the working language if you ever use an
-identifier that is in this frame.
-
-@item info source
-Among the other information listed here (@pxref{Symbols,,Examining the
-Symbol Table}) is the source language of this source file.
-
-@end table
-
-@node Checks, Support, Show, Languages
-@section Type and range Checking
-
-@quotation
-@emph{Warning:} In this release, the _GDBN__ commands for type and range
-checking are included, but they do not yet have any effect. This
-section documents the intended facilities.
-@end quotation
-@c FIXME remove warning when type/range code added
-
-Some languages are designed to guard you against making seemingly common
-errors through a series of compile- and run-time checks. These include
-checking the type of arguments to functions and operators, and making
-sure mathematical overflows are caught at run time. Checks such as
-these help to ensure a program's correctness once it has been compiled
-by eliminating type mismatches, and providing active checks for range
-errors when the program is running.
-
-_GDBN__ can check for conditions like the above if you wish.
-Although _GDBN__ will not check the statements in your program, it
-can check expressions entered directly into _GDBN__ for evaluation via
-the @code{print} command, for example. As with the working language,
-_GDBN__ can also decide whether or not to check automatically based on
-the source language of the program being debugged.
-@xref{Support,,Supported Languages}, for the default settings
-of supported languages.
-
-@menu
-* Type Checking:: An overview of type checking
-* Range Checking:: An overview of range checking
-@end menu
-
-@cindex type checking
-@cindex checks, type
-@node Type Checking, Range Checking, Checks, Checks
-@subsection An overview of type checking
-
-Some languages, such as Modula-2, are strongly typed, meaning that the
-arguments to operators and functions have to be of the correct type,
-otherwise an error occurs. These checks prevent type mismatch
-errors from ever causing any run-time problems. For example,
-
-@example
-1 + 2 @result{} 3
-@error{} 1 + 2.3
-@end example
-
-The second example fails because the @code{CARDINAL} 1 is not
-type-compatible with the @code{REAL} 2.3.
-
-For expressions you use in _GDBN__ commands, you can tell the _GDBN__
-type checker to skip checking; to treat any mismatches as errors and
-abandon the expression; or only issue warnings when type mismatches
-occur, but evaluate the expression anyway. When you choose the last of
-these, _GDBN__ evaluates expressions like the second example above, but
-also issues a warning.
-
-Even though you may turn type checking off, other type-based reasons may
-prevent _GDBN__ from evaluating an expression. For instance, _GDBN__ does not
-know how to add an @code{int} and a @code{struct foo}. These particular
-type errors have nothing to do with the language in use, and usually
-arise from expressions, such as the one described above, which make
-little sense to evaluate anyway.
-
-Each language defines to what degree it is strict about type. For
-instance, both Modula-2 and C require the arguments to arithmetical
-operators to be numbers. In C, enumerated types and pointers can be
-represented as numbers, so that they are valid arguments to mathematical
-operators. @xref{Support,,Supported Languages}, for futher
-details on specific languages.
-
-_GDBN__ provides some additional commands for controlling the type checker:
-
-@kindex set check
-@kindex set check type
-@kindex show check type
-@table @code
-@item set check type auto
-Set type checking on or off based on the current working language.
-@xref{Support,,Supported Languages}, for the default settings for
-each language.
-
-@item set check type on
-@itemx set check type off
-Set type checking on or off, overriding the default setting for the
-current working language. Issue a warning if the setting does not
-match the language's default. If any type mismatches occur in
-evaluating an expression while typechecking is on, _GDBN__ prints a
-message and aborts evaluation of the expression.
-
-@item set check type warn
-Cause the type checker to issue warnings, but to always attempt to
-evaluate the expression. Evaluating the expression may still
-be impossible for other reasons. For example, _GDBN__ cannot add
-numbers and structures.
-
-@item show type
-Show the current setting of the type checker, and whether or not _GDBN__ is
-setting it automatically.
-@end table
-
-@cindex range checking
-@cindex checks, range
-@node Range Checking, , Type Checking, Checks
-@subsection An overview of Range Checking
-
-In some languages (such as Modula-2), it is an error to exceed the
-bounds of a type; this is enforced with run-time checks. Such range
-checking is meant to ensure program correctness by making sure
-computations do not overflow, or indices on an array element access do
-not exceed the bounds of the array.
-
-For expressions you use in _GDBN__ commands, you can tell _GDBN__ to
-ignore range errors; to always treat them as errors and abandon the
-expression; or to issue warnings when a range error occurs but evaluate
-the expression anyway.
-
-A range error can result from numerical overflow, from exceeding an
-array index bound, or when you type in a constant that is not a member
-of any type. Some languages, however, do not treat overflows as an
-error. In many implementations of C, mathematical overflow causes the
-result to ``wrap around'' to lower values---for example, if @var{m} is
-the largest integer value, and @var{s} is the smallest, then
-@example
-@var{m} + 1 @result{} @var{s}
-@end example
-
-This, too, is specific to individual languages, and in some cases
-specific to individual compilers or machines. @xref{Support,,
-Supported Languages}, for further details on specific languages.
-
-_GDBN__ provides some additional commands for controlling the range checker:
-
-@kindex set check
-@kindex set check range
-@kindex show check range
-@table @code
-@item set check range auto
-Set range checking on or off based on the current working language.
-@xref{Support,,Supported Languages}, for the default settings for
-each language.
-
-@item set check range on
-@itemx set check range off
-Set range checking on or off, overriding the default setting for the
-current working language. A warning is issued if the setting does not
-match the language's default. If a range error occurs, then a message
-is printed and evaluation of the expression is aborted.
-
-@item set check range warn
-Output messages when the _GDBN__ range checker detects a range error,
-but attempt to evaluate the expression anyway. Evaluating the
-expression may still be impossible for other reasons, such as accessing
-memory that the process does not own (a typical example from many UNIX
-systems).
-
-@item show range
-Show the current setting of the range checker, and whether or not it is
-being set automatically by _GDBN__.
-@end table
-
-@node Support, , Checks, Languages
-@section Supported Languages
-
-_GDBN__ _GDB_VN__ supports C, C++, and Modula-2. The syntax for C and C++ is
-so closely related that _GDBN__ does not distinguish the two. Some
-_GDBN__ features may be used in expressions regardless of the language
-you use: the _GDBN__ @code{@@} and @code{::} operators, and the
-@samp{@{type@}addr} construct (@pxref{Expressions}) can be used with the constructs of
-any of the supported languages.
-
-The following sections detail to what degree each of these
-source languages is supported by _GDBN__. These sections are
-not meant to be language tutorials or references, but serve only as a
-reference guide to what the _GDBN__ expression parser will accept, and
-what input and output formats should look like for different languages.
-There are many good books written on each of these languages; please
-look to these for a language reference or tutorial.
-
-@menu
-* C:: C and C++
-* Modula-2:: Modula-2
-@end menu
-
-@node C, Modula-2, Support, Support
-@subsection C and C++
-@cindex C and C++
-
-@cindex expressions in C or C++
-Since C and C++ are so closely related, _GDBN__ does not distinguish
-between them when interpreting the expressions recognized in _GDBN__
-commands.
-
-@cindex C++
-@kindex g++
-@cindex GNU C++
-The C++ debugging facilities are jointly implemented by the GNU C++
-compiler and _GDBN__. Therefore, to debug your C++ code effectively,
-you must compile your C++ programs with the GNU C++ compiler,
-@code{g++}.
-
-
-@menu
-* C Operators:: C and C++ Operators
-* C Constants:: C and C++ Constants
-* Cplusplus expressions:: C++ Expressions
-* C Defaults:: Default settings for C and C++
-* C Checks:: C and C++ Type and Range Checks
-* Debugging C:: _GDBN__ and C
-* Debugging C plus plus:: Special features for C++
-@end menu
-
-@cindex C and C++ operators
-@node C Operators, C Constants, C, C
-@subsubsection C and C++ Operators
-
-Operators must be defined on values of specific types. For instance,
-@code{+} is defined on numbers, but not on structures. Operators are
-often defined on groups of types. For the purposes of C and C++, the
-following definitions hold:
-
-@itemize @bullet
-@item
-@emph{Integral types} include @code{int} with any of its storage-class
-specifiers, @code{char}, and @code{enum}s.
-
-@item
-@emph{Floating-point types} include @code{float} and @code{double}.
-
-@item
-@emph{Pointer types} include all types defined as @code{(@var{type}
-*)}.
-
-@item
-@emph{Scalar types} include all of the above.
-
-@end itemize
-
-@noindent
-The following operators are supported. They are listed here
-in order of increasing precedence:
-
-@table @code
-_0__
-@item ,
-The comma or sequencing operator. Expressions in a comma-separated list
-are evaluated from left to right, with the result of the entire
-expression being the last expression evaluated.
-
-@item =
-Assignment. The value of an assignment expression is the value
-assigned. Defined on scalar types.
-
-@item @var{op}=
-Used in an expression of the form @var{a} @var{op}@code{=} @var{b}, and
-translated to @var{a} @code{=} @var{a op b}. @var{op}@code{=} and
-@code{=} have the same precendence. @var{op} is any one of the
-operators @code{|}, @code{^}, @code{&}, @code{<<}, @code{>>}, @code{+},
-@code{-}, @code{*}, @code{/}, @code{%}.
-
-@item ?:
-The ternary operator. @code{@var{a} ? @var{b} : @var{c}} can be thought
-of as: if @var{a} then @var{b} else @var{c}. @var{a} should be of an
-integral type.
-
-@item ||
-Logical OR. Defined on integral types.
-
-@item &&
-Logical AND. Defined on integral types.
-
-@item |
-Bitwise OR. Defined on integral types.
-
-@item ^
-Bitwise exclusive-OR. Defined on integral types.
-
-@item &
-Bitwise AND. Defined on integral types.
-
-@item ==@r{, }!=
-Equality and inequality. Defined on scalar types. The value of these
-expressions is 0 for false and non-zero for true.
-
-@item <@r{, }>@r{, }<=@r{, }>=
-Less than, greater than, less than or equal, greater than or equal.
-Defined on scalar types. The value of these expressions is 0 for false
-and non-zero for true.
-
-@item <<@r{, }>>
-left shift, and right shift. Defined on integral types.
-
-@item @@
-The _GDBN__ ``artificial array'' operator (@pxref{Expressions}).
-
-@item +@r{, }-
-Addition and subtraction. Defined on integral types, floating-point types and
-pointer types.
-
-@item *@r{, }/@r{, }%
-Multiplication, division, and modulus. Multiplication and division are
-defined on integral and floating-point types. Modulus is defined on
-integral types.
-
-@item ++@r{, }--
-Increment and decrement. When appearing before a variable, the
-operation is performed before the variable is used in an expression;
-when appearing after it, the variable's value is used before the
-operation takes place.
-
-@item *
-Pointer dereferencing. Defined on pointer types. Same precedence as
-@code{++}.
-
-@item &
-Address operator. Defined on variables. Same precedence as @code{++}.
-
-@item -
-Negative. Defined on integral and floating-point types. Same
-precedence as @code{++}.
-
-@item !
-Logical negation. Defined on integral types. Same precedence as
-@code{++}.
-
-@item ~
-Bitwise complement operator. Defined on integral types. Same precedence as
-@code{++}.
-
-@item .@r{, }->
-Structure member, and pointer-to-structure member. For convenience,
-_GDBN__ regards the two as equivalent, choosing whether to dereference a
-pointer based on the stored type information.
-Defined on @code{struct}s and @code{union}s.
-
-@item []
-Array indexing. @code{@var{a}[@var{i}]} is defined as
-@code{*(@var{a}+@var{i})}. Same precedence as @code{->}.
-
-@item ()
-Function parameter list. Same precedence as @code{->}.
-
-@item ::
-C++ scope resolution operator. Defined on
-@code{struct}, @code{union}, and @code{class} types.
-
-@item ::
-The _GDBN__ scope operator (@pxref{Expressions}). Same precedence as
-@code{::}, above. _1__
-@end table
-
-@cindex C and C++ constants
-@node C Constants, Cplusplus expressions, C Operators, C
-@subsubsection C and C++ Constants
-
-_GDBN__ allows you to express the constants of C and C++ in the
-following ways:
-
-@itemize @bullet
-
-@item
-Integer constants are a sequence of digits. Octal constants are
-specified by a leading @samp{0} (ie. zero), and hexadecimal constants by
-a leading @samp{0x} or @samp{0X}. Constants may also end with an
-@samp{l}, specifying that the constant should be treated as a
-@code{long} value.
-
-@item
-Floating point constants are a sequence of digits, followed by a decimal
-point, followed by a sequence of digits, and optionally followed by an
-exponent. An exponent is of the form:
-@samp{@w{e@r{[[}+@r{]|}-@r{]}@var{nnn}}}, where @var{nnn} is another
-sequence of digits. The @samp{+} is optional for positive exponents.
-
-@item
-Enumerated constants consist of enumerated identifiers, or their
-integral equivalents.
-
-@item
-Character constants are a single character surrounded by single quotes
-(@code{'}), or a number---the ordinal value of the corresponding character
-(usually its @sc{ASCII} value). Within quotes, the single character may
-be represented by a letter or by @dfn{escape sequences}, which are of
-the form @samp{\@var{nnn}}, where @var{nnn} is the octal representation
-of the character's ordinal value; or of the form @samp{\@var{x}}, where
-@samp{@var{x}} is a predefined special character---for example,
-@samp{\n} for newline.
-
-@item
-String constants are a sequence of character constants surrounded
-by double quotes (@code{"}).
-
-@item
-Pointer constants are an integral value.
-
-@end itemize
-
-
-@node Cplusplus expressions, C Defaults, C Constants, C
-@subsubsection C++ Expressions
-
-@cindex expressions in C++
-_GDBN__'s expression handling has the following extensions to
-interpret a significant subset of C++ expressions:
-
-@enumerate
-
-@cindex member functions
-@item
-Member function calls are allowed; you can use expressions like
-@example
-count = aml->GetOriginal(x, y)
-@end example
-
-@kindex this
-@cindex namespace in C++
-@item
-While a member function is active (in the selected stack frame), your
-expressions have the same namespace available as the member function;
-that is, _GDBN__ allows implicit references to the class instance
-pointer @code{this} following the same rules as C++.
-
-@cindex call overloaded functions
-@cindex type conversions in C++
-@item
-You can call overloaded functions; _GDBN__ will resolve the function
-call to the right definition, with one restriction---you must use
-arguments of the type required by the function that you want to call.
-_GDBN__ will not perform conversions requiring constructors or
-user-defined type operators.
-
-@cindex reference declarations
-@item
-_GDBN__ understands variables declared as C++ references; you can use them in
-expressions just as you do in C++ source---they are automatically
-dereferenced.
-
-In the parameter list shown when _GDBN__ displays a frame, the values of
-reference variables are not displayed (unlike other variables); this
-avoids clutter, since references are often used for large structures.
-The @emph{address} of a reference variable is always shown, unless
-you've specified @samp{set print address off}.
-
-
-@item
-_GDBN__ supports the C++ name resolution operator @code{::}---your
-expressions can use it just as expressions in your program do. Since
-one scope may be defined in another, you can use @code{::} repeatedly if
-necessary, for example in an expression like
-@samp{@var{scope1}::@var{scope2}::@var{name}}. _GDBN__ also allows
-resolving name scope by reference to source files, in both C and C++
-debugging; @pxref{Variables}.
-
-@end enumerate
-
-
-@node C Defaults, C Checks, Cplusplus expressions, C
-@subsubsection C and C++ Defaults
-@cindex C and C++ defaults
-
-If you allow _GDBN__ to set type and range checking automatically, they
-both default to @code{off} whenever the working language changes to
-C/C++. This happens regardless of whether you, or _GDBN__,
-selected the working language.
-
-If you allow _GDBN__ to set the language automatically, it sets the
-working language to C/C++ on entering code compiled from a source file
-whose name ends with @file{.c} or @file{.cc}.
-@xref{Automatically,,Having _GDBN__ infer the source language}, for
-further details.
-
-@node C Checks, Debugging C, C Defaults, C
-@subsubsection C and C++ Type and Range Checks
-@cindex C and C++ checks
-
-@quotation
-@emph{Warning:} in this release, _GDBN__ does not yet perform type or
-range checking.
-@end quotation
-@c FIXME remove warning when type/range checks added
-
-By default, when _GDBN__ parses C or C++ expressions, type checking
-is not used. However, if you turn type checking on, _GDBN__ will
-consider two variables type equivalent if:
-
-@itemize @bullet
-@item
-The two variables are structured and have the same structure, union, or
-enumerated tag.
-
-@item
-Two two variables have the same type name, or types that have been
-declared equivalent through @code{typedef}.
-
-@ignore
-@c leaving this out because neither J Gilmore nor R Pesch understand it.
-@c FIXME--beers?
-@item
-The two @code{struct}, @code{union}, or @code{enum} variables are
-declared in the same declaration. (Note: this may not be true for all C
-compilers.)
-@end ignore
-
-@end itemize
-
-Range checking, if turned on, is done on mathematical operations. Array
-indices are not checked, since they are often used to index a pointer
-that is not itself an array.
-
-@node Debugging C, Debugging C plus plus, C Checks, C
-@subsubsection _GDBN__ and C
-
-The @code{set print union} and @code{show print union} commands apply to
-the @code{union} type. When set to @samp{on}, any @code{union} that is
-inside a @code{struct} or @code{class} will also be printed.
-Otherwise, it will appear as @samp{@{...@}}.
-
-The @code{@@} operator aids in the debugging of dynamic arrays, formed
-with pointers and a memory allocation function. (@pxref{Expressions})
-
-@node Debugging C plus plus, , Debugging C, C
-@subsubsection _GDBN__ Commands for C++
-
-@cindex commands for C++
-Some _GDBN__ commands are particularly useful with C++, and some are
-designed specifically for use with C++. Here is a summary:
-
-@table @code
-@cindex break in overloaded functions
-@item @r{breakpoint menus}
-When you want a breakpoint in a function whose name is overloaded,
-_GDBN__'s breakpoint menus help you specify which function definition
-you want. @xref{Breakpoint Menus}.
-
-@cindex overloading in C++
-@item rbreak @var{regex}
-Setting breakpoints using regular expressions is helpful for setting
-breakpoints on overloaded functions that are not members of any special
-classes.
-@xref{Set Breaks}.
-
-@cindex C++ exception handling
-@item catch @var{exceptions}
-@itemx info catch
-Debug C++ exception handling using these commands. @xref{Exception Handling}.
-
-@cindex inheritance
-@item ptype @var{typename}
-Print inheritance relationships as well as other information for type
-@var{typename}.
-@xref{Symbols}.
-
-@cindex C++ symbol display
-@item set print demangle
-@itemx show print demangle
-@itemx set print asm-demangle
-@itemx show print asm-demangle
-Control whether C++ symbols display in their source form, both when
-displaying code as C++ source and when displaying disassemblies.
-@xref{Print Settings}.
-
-@item set print object
-@itemx show print object
-Choose whether to print derived (actual) or declared types of objects.
-@xref{Print Settings}.
-
-@item set print vtbl
-@itemx show print vtbl
-Control the format for printing virtual function tables.
-@xref{Print Settings}.
-
-@end table
-
-
-@node Modula-2, , C, Support
-@subsection Modula-2
-@cindex Modula-2
-
-The extensions made to _GDBN__ to support Modula-2 support output
-from the GNU Modula-2 compiler (which is currently being developed).
-Other Modula-2 compilers are not currently supported, and attempting to
-debug executables produced by them will most likely result in an error
-as _GDBN__ reads in the executable's symbol table.
-
-@cindex expressions in Modula-2
-@menu
-* M2 Operators:: Built-in operators
-* Builtin Func/Proc:: Built-in Functions and Procedures
-* M2 Constants:: Modula-2 Constants
-* M2 Defaults:: Default settings for Modula-2
-* Deviations:: Deviations from standard Modula-2
-* M2 Checks:: Modula-2 Type and Range Checks
-* M2 Scope:: The scope operators @code{::} and @code{.}
-* GDB/M2:: _GDBN__ and Modula-2
-@end menu
-
-@node M2 Operators, Builtin Func/Proc, Modula-2, Modula-2
-@subsubsection Operators
-@cindex Modula-2 operators
-
-Operators must be defined on values of specific types. For instance,
-@code{+} is defined on numbers, but not on structures. Operators are
-often defined on groups of types. For the purposes of Modula-2, the
-following definitions hold:
-
-@itemize @bullet
-
-@item
-@emph{Integral types} consist of @code{INTEGER}, @code{CARDINAL}, and
-their subranges.
-
-@item
-@emph{Character types} consist of @code{CHAR} and its subranges.
-
-@item
-@emph{Floating-point types} consist of @code{REAL}.
-
-@item
-@emph{Pointer types} consist of anything declared as @code{POINTER TO
-@var{type}}.
-
-@item
-@emph{Scalar types} consist of all of the above.
-
-@item
-@emph{Set types} consist of @code{SET}s and @code{BITSET}s.
-
-@item
-@emph{Boolean types} consist of @code{BOOLEAN}.
-
-@end itemize
-
-@noindent
-The following operators are supported, and appear in order of
-increasing precedence:
-
-@table @code
-_0__
-@item ,
-Function argument or array index separator.
-
-@item :=
-Assignment. The value of @var{var} @code{:=} @var{value} is
-@var{value}.
-
-@item <@r{, }>
-Less than, greater than on integral, floating-point, or enumerated
-types.
-
-@item <=@r{, }>=
-Less than, greater than, less than or equal to, greater than or equal to
-on integral, floating-point and enumerated types, or set inclusion on
-set types. Same precedence as @code{<}.
-
-@item =@r{, }<>@r{, }#
-Equality and two ways of expressing inequality, valid on scalar types.
-Same precedence as @code{<}. In _GDBN__ scripts, only @code{<>} is
-available for inequality, since @code{#} conflicts with the script
-comment character.
-
-@item IN
-Set membership. Defined on set types and the types of their members.
-Same precedence as @code{<}.
-
-@item OR
-Boolean disjunction. Defined on boolean types.
-
-@item AND@r{, }&
-Boolean conjuction. Defined on boolean types.
-
-@item @@
-The _GDBN__ ``artificial array'' operator (@pxref{Expressions}).
-
-@item +@r{, }-
-Addition and subtraction on integral and floating-point types, or union
-and difference on set types.
-
-@item *
-Multiplication on integral and floating-point types, or set intersection
-on set types.
-
-@item /
-Division on floating-point types, or symmetric set difference on set
-types. Same precedence as @code{*}.
-
-@item DIV@r{, }MOD
-Integer division and remainder. Defined on integral types. Same
-precedence as @code{*}.
-
-@item -
-Negative. Defined on @code{INTEGER}s and @code{REAL}s.
-
-@item ^
-Pointer dereferencing. Defined on pointer types.
-
-@item NOT
-Boolean negation. Defined on boolean types. Same precedence as
-@code{^}.
-
-@item .
-@code{RECORD} field selector. Defined on @code{RECORD}s. Same
-precedence as @code{^}.
-
-@item []
-Array indexing. Defined on @code{ARRAY}s. Same precedence as @code{^}.
-
-@item ()
-Procedure argument list. Defined on @code{PROCEDURE}s. Same precedence
-as @code{^}.
-
-@item ::@r{, }.
-_GDBN__ and Modula-2 scope operators.
-
-@end table
-
-@quotation
-@emph{Warning:} Sets and their operations are not yet supported, so _GDBN__
-will treat the use of the operator @code{IN}, or the use of operators
-@code{+}, @code{-}, @code{*}, @code{/}, @code{=}, , @code{<>}, @code{#},
-@code{<=}, and @code{>=} on sets as an error.
-@end quotation
-_1__
-
-@cindex Modula-2 builtins
-@node Builtin Func/Proc, M2 Constants, M2 Operators, Modula-2
-@subsubsection Built-in Functions and Procedures
-
-Modula-2 also makes available several built-in procedures and functions.
-In describing these, the following metavariables are used:
-
-@table @var
-
-@item a
-represents an @code{ARRAY} variable.
-
-@item c
-represents a @code{CHAR} constant or variable.
-
-@item i
-represents a variable or constant of integral type.
-
-@item m
-represents an identifier that belongs to a set. Generally used in the
-same function with the metavariable @var{s}. The type of @var{s} should
-be @code{SET OF @var{mtype}} (where @var{mtype} is the type of @var{m}.
-
-@item n
-represents a variable or constant of integral or floating-point type.
-
-@item r
-represents a variable or constant of floating-point type.
-
-@item t
-represents a type.
-
-@item v
-represents a variable.
-
-@item x
-represents a variable or constant of one of many types. See the
-explanation of the function for details.
-
-@end table
-
-All Modula-2 built-in procedures also return a result, described below.
-
-@table @code
-@item ABS(@var{n})
-Returns the absolute value of @var{n}.
-
-@item CAP(@var{c})
-If @var{c} is a lower case letter, it returns its upper case
-equivalent, otherwise it returns its argument
-
-@item CHR(@var{i})
-Returns the character whose ordinal value is @var{i}.
-
-@item DEC(@var{v})
-Decrements the value in the variable @var{v}. Returns the new value.
-
-@item DEC(@var{v},@var{i})
-Decrements the value in the variable @var{v} by @var{i}. Returns the
-new value.
-
-@item EXCL(@var{m},@var{s})
-Removes the element @var{m} from the set @var{s}. Returns the new
-set.
-
-@item FLOAT(@var{i})
-Returns the floating point equivalent of the integer @var{i}.
-
-@item HIGH(@var{a})
-Returns the index of the last member of @var{a}.
-
-@item INC(@var{v})
-Increments the value in the variable @var{v}. Returns the new value.
-
-@item INC(@var{v},@var{i})
-Increments the value in the variable @var{v} by @var{i}. Returns the
-new value.
-
-@item INCL(@var{m},@var{s})
-Adds the element @var{m} to the set @var{s} if it is not already
-there. Returns the new set.
-
-@item MAX(@var{t})
-Returns the maximum value of the type @var{t}.
-
-@item MIN(@var{t})
-Returns the minimum value of the type @var{t}.
-
-@item ODD(@var{i})
-Returns boolean TRUE if @var{i} is an odd number.
-
-@item ORD(@var{x})
-Returns the ordinal value of its argument. For example, the ordinal
-value of a character is its ASCII value (on machines supporting the
-ASCII character set). @var{x} must be of an ordered type, which include
-integral, character and enumerated types.
-
-@item SIZE(@var{x})
-Returns the size of its argument. @var{x} can be a variable or a type.
-
-@item TRUNC(@var{r})
-Returns the integral part of @var{r}.
-
-@item VAL(@var{t},@var{i})
-Returns the member of the type @var{t} whose ordinal value is @var{i}.
-@end table
-
-@quotation
-@emph{Warning:} Sets and their operations are not yet supported, so
-_GDBN__ will treat the use of procedures @code{INCL} and @code{EXCL} as
-an error.
-@end quotation
-
-@cindex Modula-2 constants
-@node M2 Constants, M2 Defaults, Builtin Func/Proc, Modula-2
-@subsubsection Constants
-
-_GDBN__ allows you to express the constants of Modula-2 in the following
-ways:
-
-@itemize @bullet
-
-@item
-Integer constants are simply a sequence of digits. When used in an
-expression, a constant is interpreted to be type-compatible with the
-rest of the expression. Hexadecimal integers are specified by a
-trailing @samp{H}, and octal integers by a trailing @samp{B}.
-
-@item
-Floating point constants appear as a sequence of digits, followed by a
-decimal point and another sequence of digits. An optional exponent can
-then be specified, in the form @samp{E@r{[}+@r{|}-@r{]}@var{nnn}}, where
-@samp{@r{[}+@r{|}-@r{]}@var{nnn}} is the desired exponent. All of the
-digits of the floating point constant must be valid decimal (base 10)
-digits.
-
-@item
-Character constants consist of a single character enclosed by a pair of
-like quotes, either single (@code{'}) or double (@code{"}). They may
-also be expressed by their ordinal value (their ASCII value, usually)
-followed by a @samp{C}.
-
-@item
-String constants consist of a sequence of characters enclosed by a pair
-of like quotes, either single (@code{'}) or double (@code{"}). Escape
-sequences in the style of C are also allowed. @xref{C Constants}, for a
-brief explanation of escape sequences.
-
-@item
-Enumerated constants consist of an enumerated identifier.
-
-@item
-Boolean constants consist of the identifiers @code{TRUE} and
-@code{FALSE}.
-
-@item
-Pointer constants consist of integral values only.
-
-@item
-Set constants are not yet supported.
-
-@end itemize
-
-@node M2 Defaults, Deviations, M2 Constants, Modula-2
-@subsubsection Modula-2 Defaults
-@cindex Modula-2 defaults
-
-If type and range checking are set automatically by _GDBN__, they
-both default to @code{on} whenever the working language changes to
-Modula-2. This happens regardless of whether you, or _GDBN__,
-selected the working language.
-
-If you allow _GDBN__ to set the language automatically, then entering
-code compiled from a file whose name ends with @file{.mod} will set the
-working language to Modula-2. @xref{Automatically,,Having _GDBN__ set
-the language automatically}, for further details.
-
-@node Deviations, M2 Checks, M2 Defaults, Modula-2
-@subsubsection Deviations from Standard Modula-2
-@cindex Modula-2, deviations from
-
-A few changes have been made to make Modula-2 programs easier to debug.
-This is done primarily via loosening its type strictness:
-
-@itemize @bullet
-@item
-Unlike in standard Modula-2, pointer constants can be formed by
-integers. This allows you to modify pointer variables during
-debugging. (In standard Modula-2, the actual address contained in a
-pointer variable is hidden from you; it can only be modified
-through direct assignment to another pointer variable or expression that
-returned a pointer.)
-
-@item
-C escape sequences can be used in strings and characters to represent
-non-printable characters. _GDBN__ will print out strings with these
-escape sequences embedded. Single non-printable characters are
-printed using the @samp{CHR(@var{nnn})} format.
-
-@item
-The assignment operator (@code{:=}) returns the value of its right-hand
-argument.
-
-@item
-All builtin procedures both modify @emph{and} return their argument.
-
-@end itemize
-
-@node M2 Checks, M2 Scope, Deviations, Modula-2
-@subsubsection Modula-2 Type and Range Checks
-@cindex Modula-2 checks
-
-@quotation
-@emph{Warning:} in this release, _GDBN__ does not yet perform type or
-range checking.
-@end quotation
-@c FIXME remove warning when type/range checks added
-
-_GDBN__ considers two Modula-2 variables type equivalent if:
-
-@itemize @bullet
-@item
-They are of types that have been declared equivalent via a @code{TYPE
-@var{t1} = @var{t2}} statement
-
-@item
-They have been declared on the same line. (Note: This is true of the
-GNU Modula-2 compiler, but it may not be true of other compilers.)
-
-@end itemize
-
-As long as type checking is enabled, any attempt to combine variables
-whose types are not equivalent is an error.
-
-Range checking is done on all mathematical operations, assignment, array
-index bounds, and all builtin functions and procedures.
-
-@node M2 Scope, GDB/M2, M2 Checks, Modula-2
-@subsubsection The scope operators @code{::} and @code{.}
-@cindex scope
-@kindex .
-@kindex ::
-
-There are a few subtle differences between the Modula-2 scope operator
-(@code{.}) and the _GDBN__ scope operator (@code{::}). The two have
-similar syntax:
-
-@example
-
-@var{module} . @var{id}
-@var{scope} :: @var{id}
-
-@end example
-
-@noindent
-where @var{scope} is the name of a module or a procedure,
-@var{module} the name of a module, and @var{id} is any delcared
-identifier within the program, except another module.
-
-Using the @code{::} operator makes _GDBN__ search the scope
-specified by @var{scope} for the identifier @var{id}. If it is not
-found in the specified scope, then _GDBN__ will search all scopes
-enclosing the one specified by @var{scope}.
-
-Using the @code{.} operator makes _GDBN__ search the current scope for
-the identifier specified by @var{id} that was imported from the
-definition module specified by @var{module}. With this operator, it is
-an error if the identifier @var{id} was not imported from definition
-module @var{module}, or if @var{id} is not an identifier in
-@var{module}.
-
-@node GDB/M2, , M2 Scope, Modula-2
-@subsubsection _GDBN__ and Modula-2
-
-Some _GDBN__ commands have little use when debugging Modula-2 programs.
-Five subcommands of @code{set print} and @code{show print} apply
-specifically to C and C++: @samp{vtbl}, @samp{demangle},
-@samp{asm-demangle}, @samp{object}, and @samp{union}. The first four
-apply to C++, and the last to C's @code{union} type, which has no direct
-analogue in Modula-2.
-
-The @code{@@} operator (@pxref{Expressions}), while available
-while using any language, is not useful with Modula-2. Its
-intent is to aid the debugging of @dfn{dynamic arrays}, which cannot be
-created in Modula-2 as they can in C or C++. However, because an
-address can be specified by an integral constant, the construct
-@samp{@{@var{type}@}@var{adrexp}} is still useful. (@pxref{Expressions})
-
-_0__
-@cindex @code{#} in Modula-2
-In _GDBN__ scripts, the Modula-2 inequality operator @code{#} is
-interpreted as the beginning of a comment. Use @code{<>} instead.
-_1__
-
-
-@node Symbols, Altering, Languages, Top
-@chapter Examining the Symbol Table
-
-The commands described in this section allow you to inquire about the
-symbols (names of variables, functions and types) defined in your
-program. This information is inherent in the text of your program and
-does not change as the program executes. _GDBN__ finds it in your
-program's symbol table, in the file indicated when you started _GDBN__
-(@pxref{File Options}), or by one of the file-management commands
-(@pxref{Files}).
-
-@table @code
-@item info address @var{symbol}
-@kindex info address
-Describe where the data for @var{symbol} is stored. For a register
-variable, this says which register it is kept in. For a non-register
-local variable, this prints the stack-frame offset at which the variable
-is always stored.
-
-Note the contrast with @samp{print &@var{symbol}}, which does not work
-at all for a register variables, and for a stack local variable prints
-the exact address of the current instantiation of the variable.
-
-@item whatis @var{exp}
-@kindex whatis
-Print the data type of expression @var{exp}. @var{exp} is not
-actually evaluated, and any side-effecting operations (such as
-assignments or function calls) inside it do not take place.
-@xref{Expressions}.
-
-@item whatis
-Print the data type of @code{$}, the last value in the value history.
-
-@item ptype @var{typename}
-@kindex ptype
-Print a description of data type @var{typename}. @var{typename} may be
-the name of a type, or for C code it may have the form
-@samp{struct @var{struct-tag}}, @samp{union @var{union-tag}} or
-@samp{enum @var{enum-tag}}.@refill
-
-@item ptype @var{exp}
-Print a description of the type of expression @var{exp}. @code{ptype}
-differs from @code{whatis} by printing a detailed description, instead of just
-the name of the type. For example, if your program declares a variable
-as
-@example
-struct complex @{double real; double imag;@} v;
-@end example
-@noindent
-compare the output of the two commands:
-@example
-(_GDBP__) whatis v
-type = struct complex
-(_GDBP__) ptype v
-type = struct complex @{
- double real;
- double imag;
-@}
-@end example
-
-@item info types @var{regexp}
-@itemx info types
-@kindex info types
-Print a brief description of all types whose name matches @var{regexp}
-(or all types in your program, if you supply no argument). Each
-complete typename is matched as though it were a complete line; thus,
-@samp{i type value} gives information on all types in your program whose
-name includes the string @code{value}, but @samp{i type ^value$} gives
-information only on types whose complete name is @code{value}.
-
-This command differs from @code{ptype} in two ways: first, like
-@code{whatis}, it does not print a detailed description; second, it
-lists all source files where a type is defined.
-
-@item info source
-@kindex info source
-Show the name of the current source file---that is, the source file for
-the function containing the current point of execution---and the language
-it was written in.
-
-@item info sources
-@kindex info sources
-Print the names of all source files in the program for which there is
-debugging information, organized into two lists: files whose symbols
-have already been read, and files whose symbols will be read when needed.
-
-@item info functions
-@kindex info functions
-Print the names and data types of all defined functions.
-
-@item info functions @var{regexp}
-Print the names and data types of all defined functions
-whose names contain a match for regular expression @var{regexp}.
-Thus, @samp{info fun step} finds all functions whose names
-include @code{step}; @samp{info fun ^step} finds those whose names
-start with @code{step}.
-
-@item info variables
-@kindex info variables
-Print the names and data types of all variables that are declared
-outside of functions (i.e., excluding local variables).
-
-@item info variables @var{regexp}
-Print the names and data types of all variables (except for local
-variables) whose names contain a match for regular expression
-@var{regexp}.
-
-
-@ignore
-This was never implemented.
-@item info methods
-@itemx info methods @var{regexp}
-@kindex info methods
-The @code{info methods} command permits the user to examine all defined
-methods within C++ program, or (with the @var{regexp} argument) a
-specific set of methods found in the various C++ classes. Many
-C++ classes provide a large number of methods. Thus, the output
-from the @code{ptype} command can be overwhelming and hard to use. The
-@code{info-methods} command filters the methods, printing only those
-which match the regular-expression @var{regexp}.
-@end ignore
-
-@item printsyms @var{filename}
-@kindex printsyms
-Write a dump of debugging symbol data into the file
-@var{filename}. Only symbols with debugging data are included. _GDBN__
-includes all the symbols it already knows about: that is, @var{filename}
-reflects symbols for only those files whose symbols _GDBN__ has read.
-You can find out which files these are using the command @code{info
-files}. The description of @code{symbol-file} describes how _GDBN__
-reads symbols; both commands are described under @ref{Files}.
-@end table
-
-@node Altering, _GDBN__ Files, Symbols, Top
-@chapter Altering Execution
-
-Once you think you have found an error in the program, you might want to
-find out for certain whether correcting the apparent error would lead to
-correct results in the rest of the run. You can find the answer by
-experiment, using the _GDBN__ features for altering execution of the
-program.
-
-For example, you can store new values into variables or memory
-locations, give the program a signal, restart it at a different address,
-or even return prematurely from a function to its caller.
-
-@menu
-* Assignment:: Assignment to Variables
-* Jumping:: Continuing at a Different Address
-* Signaling:: Giving the Program a Signal
-* Returning:: Returning from a Function
-* Calling:: Calling your Program's Functions
-* Patching:: Patching your Program
-@end menu
-
-@node Assignment, Jumping, Altering, Altering
-@section Assignment to Variables
-
-@cindex assignment
-@cindex setting variables
-To alter the value of a variable, evaluate an assignment expression.
-@xref{Expressions}. For example,
-
-@example
-print x=4
-@end example
-
-@noindent
-would store the value 4 into the variable @code{x}, and then print the
-value of the assignment expression (which is 4). @xref{Languages}, for
-more information on operators in supported languages.
-
-@kindex set variable
-@cindex variables, setting
-If you are not interested in seeing the value of the assignment, use the
-@code{set} command instead of the @code{print} command. @code{set} is
-really the same as @code{print} except that the expression's value is not
-printed and is not put in the value history (@pxref{Value History}). The
-expression is evaluated only for its effects.
-
-If the beginning of the argument string of the @code{set} command
-appears identical to a @code{set} subcommand, use the @code{set
-variable} command instead of just @code{set}. This command is identical
-to @code{set} except for its lack of subcommands. For example, a
-program might well have a variable @code{width}---which leads to
-an error if we try to set a new value with just @samp{set width=13}, as
-we might if @code{set width} didn't happen to be a _GDBN__ command:
-@example
-(_GDBP__) whatis width
-type = double
-(_GDBP__) p width
-$4 = 13
-(_GDBP__) set width=47
-Invalid syntax in expression.
-@end example
-@noindent
-The invalid expression, of course, is @samp{=47}. What we can do in
-order to actually set our program's variable @code{width} is
-@example
-(_GDBP__) set var width=47
-@end example
-
-_GDBN__ allows more implicit conversions in assignments than C does; you can
-freely store an integer value into a pointer variable or vice versa, and
-any structure can be converted to any other structure that is the same
-length or shorter.
-@comment FIXME: how do structs align/pad in these conversions?
-@comment /pesch@cygnus.com 18dec1990
-
-To store values into arbitrary places in memory, use the @samp{@{@dots{}@}}
-construct to generate a value of specified type at a specified address
-(@pxref{Expressions}). For example, @code{@{int@}0x83040} refers
-to memory location @code{0x83040} as an integer (which implies a certain size
-and representation in memory), and
-
-@example
-set @{int@}0x83040 = 4
-@end example
-
-@noindent
-stores the value 4 into that memory location.
-
-@node Jumping, Signaling, Assignment, Altering
-@section Continuing at a Different Address
-
-Ordinarily, when you continue the program, you do so at the place where
-it stopped, with the @code{continue} command. You can instead continue at
-an address of your own choosing, with the following commands:
-
-@table @code
-@item jump @var{linespec}
-@kindex jump
-Resume execution at line @var{linespec}. Execution will stop
-immediately if there is a breakpoint there. @xref{List} for a
-description of the different forms of @var{linespec}.
-
-The @code{jump} command does not change the current stack frame, or
-the stack pointer, or the contents of any memory location or any
-register other than the program counter. If line @var{linespec} is in
-a different function from the one currently executing, the results may
-be bizarre if the two functions expect different patterns of arguments or
-of local variables. For this reason, the @code{jump} command requests
-confirmation if the specified line is not in the function currently
-executing. However, even bizarre results are predictable if you are
-well acquainted with the machine-language code of the program.
-
-@item jump *@var{address}
-Resume execution at the instruction at address @var{address}.
-@end table
-
-You can get much the same effect as the @code{jump} command by storing a
-new value into the register @code{$pc}. The difference is that this
-does not start the program running; it only changes the address where it
-@emph{will} run when it is continued. For example,
-
-@example
-set $pc = 0x485
-@end example
-
-@noindent
-causes the next @code{continue} command or stepping command to execute at
-address 0x485, rather than at the address where the program stopped.
-@xref{Continuing and Stepping}.
-
-The most common occasion to use the @code{jump} command is to back up,
-perhaps with more breakpoints set, over a portion of a program that has
-already executed, in order to examine its execution in more detail.
-
-@node Signaling, Returning, Jumping, Altering
-@c @group
-@section Giving the Program a Signal
-
-@table @code
-@item signal @var{signalnum}
-@kindex signal
-Resume execution where the program stopped, but give it immediately the
-signal number @var{signalnum}.
-
-Alternatively, if @var{signalnum} is zero, continue execution without
-giving a signal. This is useful when the program stopped on account of
-a signal and would ordinary see the signal when resumed with the
-@code{continue} command; @samp{signal 0} causes it to resume without a
-signal.
-
-@code{signal} does not repeat when you press @key{RET} a second time
-after executing the command.
-@end table
-@c @end group
-
-@node Returning, Calling, Signaling, Altering
-@section Returning from a Function
-
-@table @code
-@item return
-@itemx return @var{expression}
-@cindex returning from a function
-@kindex return
-You can cancel execution of a function call with the @code{return}
-command. If you give an
-@var{expression} argument, its value is used as the function's return
-value.
-@end table
-
-When you use @code{return}, _GDBN__ discards the selected stack frame
-(and all frames within it). You can think of this as making the
-discarded frame return prematurely. If you wish to specify a value to
-be returned, give that value as the argument to @code{return}.
-
-This pops the selected stack frame (@pxref{Selection}), and any other
-frames inside of it, leaving its caller as the innermost remaining
-frame. That frame becomes selected. The specified value is stored in
-the registers used for returning values of functions.
-
-The @code{return} command does not resume execution; it leaves the
-program stopped in the state that would exist if the function had just
-returned. In contrast, the @code{finish} command
-(@pxref{Continuing and Stepping})
-resumes execution until the selected stack frame returns naturally.@refill
-
-@node Calling, Patching, Returning, Altering
-@section Calling your Program's Functions
-
-@cindex calling functions
-@kindex call
-@table @code
-@item call @var{expr}
-Evaluate the expression @var{expr} without displaying @code{void}
-returned values.
-@end table
-
-You can use this variant of the @code{print} command if you want to
-execute a function from your program, but without cluttering the output
-with @code{void} returned values. The result is printed and saved in
-the value history, if it is not void.
-
-@node Patching, , Calling, Altering
-@section Patching your Program
-@cindex patching binaries
-@cindex writing into executables
-@cindex writing into corefiles
-By default, _GDBN__ opens the file containing your program's executable
-code (or the corefile) read-only. This prevents accidental alterations
-to machine code; but it also prevents you from intentionally patching
-your program's binary.
-
-If you'd like to be able to patch the binary, you can specify that
-explicitly with the @code{set write} command. For example, you might
-want to turn on internal debugging flags, or even to make emergency
-repairs.
-
-@table @code
-@item set write on
-@itemx set write off
-@kindex set write
-If you specify @samp{set write on}, _GDBN__ will open executable and
-core files for both reading and writing; if you specify @samp{set write
-off} (the default), _GDBN__ will open them read-only.
-
-If you've already loaded a file, you must load it
-again (using the @code{exec-file} or @code{core-file} command) after
-changing @code{set write}, for your new setting to take effect.
-
-@item show write
-@kindex show write
-Display whether executable files and core files will be opened for
-writing as well as reading.
-
-@end table
-
-@node _GDBN__ Files, Targets, Altering, Top
-@chapter _GDBN__'s Files
-
-@menu
-* Files:: Commands to Specify Files
-* Symbol Errors:: Errors Reading Symbol Files
-@end menu
-
-@node Files, Symbol Errors, _GDBN__ Files, _GDBN__ Files
-@section Commands to Specify Files
-@cindex core dump file
-@cindex symbol table
-_GDBN__ needs to know the file name of the program to be debugged, both in
-order to read its symbol table and in order to start the program. To
-debug a core dump of a previous run, _GDBN__ must be told the file name of
-the core dump.
-
-The usual way to specify the executable and core dump file names is with
-the command arguments given when you start _GDBN__, as discussed in
-@pxref{Invocation}.
-
-Occasionally it is necessary to change to a different file during a
-_GDBN__ session. Or you may run _GDBN__ and forget to specify the files you
-want to use. In these situations the _GDBN__ commands to specify new files
-are useful.
-
-@table @code
-@item file @var{filename}
-@cindex executable file
-@kindex file
-Use @var{filename} as the program to be debugged. It is read for its
-symbols and for the contents of pure memory. It is also the program
-executed when you use the @code{run} command. If you do not specify a
-directory and the file is not found in _GDBN__'s working directory,
-
-_GDBN__ uses the environment variable @code{PATH} as a list of
-directories to search, just as the shell does when looking for a program
-to run. You can change the value of this variable, for both _GDBN__ and
-your program, using the @code{path} command.
-
-@code{file} with no argument makes _GDBN__ discard any information it
-has on both executable file and the symbol table.
-
-@item exec-file @var{filename}
-@kindex exec-file
-Specify that the program to be run (but not the symbol table) is found
-in @var{filename}. _GDBN__ will search the environment variable @code{PATH}
-if necessary to locate the program.
-
-@item symbol-file @var{filename}
-@kindex symbol-file
-Read symbol table information from file @var{filename}. @code{PATH} is
-searched when necessary. Use the @code{file} command to get both symbol
-table and program to run from the same file.
-
-@code{symbol-file} with no argument clears out _GDBN__'s information on your
-program's symbol table.
-
-The @code{symbol-file} command causes _GDBN__ to forget the contents of its
-convenience variables, the value history, and all breakpoints and
-auto-display expressions. This is because they may contain pointers to
-the internal data recording symbols and data types, which are part of
-the old symbol table data being discarded inside _GDBN__.
-
-@code{symbol-file} will not repeat if you press @key{RET} again after
-executing it once.
-
-On some kinds of object files, the @code{symbol-file} command does not
-actually read the symbol table in full right away. Instead, it scans
-the symbol table quickly to find which source files and which symbols
-are present. The details are read later, one source file at a time,
-when they are needed.
-
-The purpose of this two-stage reading strategy is to make _GDBN__ start up
-faster. For the most part, it is invisible except for occasional pauses
-while the symbol table details for a particular source file are being
-read. (The @code{set verbose} command can turn these pauses into
-messages if desired. @xref{Messages/Warnings}).
-
-When the symbol table is stored in COFF format, @code{symbol-file} does
-read the symbol table data in full right away. We haven't implemented
-the two-stage strategy for COFF yet.
-
-When _GDBN__ is configured for a particular environment, it will
-understand debugging information in whatever format is the standard
-generated for that environment; you may use either a GNU compiler, or
-other compilers that adhere to the local conventions. Best results are
-usually obtained from GNU compilers; for example, using @code{_GCC__}
-you can generate debugging information for optimized code.
-
-@item core-file @var{filename}
-@itemx core @var{filename}
-@kindex core
-@kindex core-file
-Specify the whereabouts of a core dump file to be used as the ``contents
-of memory''. Traditionally, core files contain only some parts of the
-address space of the process that generated them; _GDBN__ can access the
-executable file itself for other parts.
-
-@code{core-file} with no argument specifies that no core file is
-to be used.
-
-Note that the core file is ignored when your program is actually running
-under _GDBN__. So, if you have been running the program and you wish to
-debug a core file instead, you must kill the subprocess in which the
-program is running. To do this, use the @code{kill} command
-(@pxref{Kill Process}).
-
-@item load @var{filename}
-@kindex load
-_if__(_GENERIC__)
-Depending on what remote debugging facilities are configured into
-_GDBN__, the @code{load} command may be available. Where it exists, it
-is meant to make @var{filename} (an executable) available for debugging
-on the remote system---by downloading, or dynamic linking, for example.
-@code{load} also records @var{filename}'s symbol table in _GDBN__, like
-the @code{add-symbol-file} command.
-
-If @code{load} is not available on your _GDBN__, attempting to execute
-it gets the error message ``@code{You can't do that when your target is
-@dots{}}''
-_fi__(_GENERIC__)
-
-_if__(_VXWORKS__)
-On VxWorks, @code{load} will dynamically link @var{filename} on the
-current target system as well as adding its symbols in _GDBN__.
-_fi__(_VXWORKS__)
-
-_if__(_I960__)
-@cindex download to Nindy-960
-With the Nindy interface to an Intel 960 board, @code{load} will
-download @var{filename} to the 960 as well as adding its symbols in
-_GDBN__.
-_fi__(_I960__)
-
-@code{load} will not repeat if you press @key{RET} again after using it.
-
-@item add-symbol-file @var{filename} @var{address}
-@kindex add-symbol-file
-@cindex dynamic linking
-The @code{add-symbol-file} command reads additional symbol table information
-from the file @var{filename}. You would use this command when @var{filename}
-has been dynamically loaded (by some other means) into the program that
-is running. @var{address} should be the memory address at which the
-file has been loaded; _GDBN__ cannot figure this out for itself.
-
-The symbol table of the file @var{filename} is added to the symbol table
-originally read with the @code{symbol-file} command. You can use the
-@code{add-symbol-file} command any number of times; the new symbol data thus
-read keeps adding to the old. To discard all old symbol data instead,
-use the @code{symbol-file} command.
-
-@code{add-symbol-file} will not repeat if you press @key{RET} after using it.
-
-@item info files
-@itemx info target
-@kindex info files
-@kindex info target
-@code{info files} and @code{info target} are synonymous; both print the
-current targets (@pxref{Targets}), including the names of the executable
-and core dump files currently in use by _GDBN__, and the files from
-which symbols were loaded. The command @code{help targets} lists all
-possible targets rather than current ones.
-
-@end table
-
-All file-specifying commands allow both absolute and relative file names
-as arguments. _GDBN__ always converts the file name to an absolute path
-name and remembers it that way.
-
-@cindex shared libraries
-
-_GDBN__ supports the SunOS shared library format. _GDBN__ automatically
-loads symbol definitions from shared libraries when you use the
-@code{run} command, or when you examine a core file. (Before you issue
-the @code{run} command, _GDBN__ won't understand references to a
-function in a shared library, however---unless you're debugging a core
-file).
-@c FIXME: next _GDBN__ release should permit some refs to undef
-@c FIXME...symbols---eg in a break cmd---assuming they're from a shared lib
-
-@table @code
-@item info share
-@itemx info sharedlibrary
-@kindex info sharedlibrary
-@kindex info share
-Print the names of the shared libraries which are currently loaded.
-
-@item sharedlibrary @var{regex}
-@itemx share @var{regex}
-@kindex sharedlibrary
-@kindex share
-This is an obsolescent command; you can use it to explicitly
-load shared object library symbols for files matching a UNIX regular
-expression, but as with files loaded automatically, it will only load
-shared libraries required by your program for a core file or after
-typing @code{run}. If @var{regex} is omitted all shared libraries
-required by your program are loaded.
-@end table
-
-@node Symbol Errors, , Files, _GDBN__ Files
-@section Errors Reading Symbol Files
-While reading a symbol file, _GDBN__ will occasionally encounter
-problems, such as symbol types it does not recognize, or known bugs in
-compiler output. By default, _GDBN__ does not notify you of such
-problems, since they're relatively common and primarily of interest to
-people debugging compilers. If you are interested in seeing information
-about ill-constructed symbol tables, you can either ask _GDBN__ to print
-only one message about each such type of problem, no matter how many
-times the problem occurs; or you can ask _GDBN__ to print more messages,
-to see how many times the problems occur, with the @code{set complaints}
-command (@xref{Messages/Warnings}).
-
-The messages currently printed, and their meanings, are:
-
-@table @code
-@item inner block not inside outer block in @var{symbol}
-
-The symbol information shows where symbol scopes begin and end
-(such as at the start of a function or a block of statements). This
-error indicates that an inner scope block is not fully contained
-in its outer scope blocks.
-
-_GDBN__ circumvents the problem by treating the inner block as if it had
-the same scope as the outer block. In the error message, @var{symbol}
-may be shown as ``@code{(don't know)}'' if the outer block is not a
-function.
-
-@item block at @var{address} out of order
-
-The symbol information for symbol scope blocks should occur in
-order of increasing addresses. This error indicates that it does not
-do so.
-
-_GDBN__ does not circumvent this problem, and will have trouble locating
-symbols in the source file whose symbols being read. (You can often
-determine what source file is affected by specifying @code{set verbose
-on}. @xref{Messages/Warnings}.)
-
-@item bad block start address patched
-
-The symbol information for a symbol scope block has a start address
-smaller than the address of the preceding source line. This is known
-to occur in the SunOS 4.1.1 (and earlier) C compiler.
-
-_GDBN__ circumvents the problem by treating the symbol scope block as
-starting on the previous source line.
-
-@item bad string table offset in symbol @var{n}
-
-@cindex foo
-Symbol number @var{n} contains a pointer into the string table which is
-larger than the size of the string table.
-
-_GDBN__ circumvents the problem by considering the symbol to have the
-name @code{foo}, which may cause other problems if many symbols end up
-with this name.
-
-@item unknown symbol type @code{0x@var{nn}}
-
-The symbol information contains new data types that _GDBN__ does not yet
-know how to read. @code{0x@var{nn}} is the symbol type of the misunderstood
-information, in hexadecimal.
-
-_GDBN__ circumvents the error by ignoring this symbol information. This
-will usually allow the program to be debugged, though certain symbols
-will not be accessible. If you encounter such a problem and feel like
-debugging it, you can debug @code{_GDBP__} with itself, breakpoint on
-@code{complain}, then go up to the function @code{read_dbx_symtab} and
-examine @code{*bufp} to see the symbol.
-
-@item stub type has NULL name
-_GDBN__ could not find the full definition for a struct or class.
-
-@ignore
-@c this is #if 0'd in dbxread.c as of (at least!) 17 may 1991
-@item const/volatile indicator missing, got '@var{X}'
-
-The symbol information for a C++ member function is missing some
-information that the compiler should have output for it.
-@end ignore
-
-@item C++ type mismatch between compiler and debugger
-
-_GDBN__ could not parse a type specification output by the compiler
-for some C++ object.
-
-@end table
-
-@node Targets, Controlling _GDBN__, _GDBN__ Files, Top
-@chapter Specifying a Debugging Target
-@cindex debugging target
-@kindex target
-A @dfn{target} is an interface between the debugger and a particular
-kind of file or process.
-
-Often, you will be able to run _GDBN__ in the same host environment as the
-program you are debugging; in that case, the debugging target can just be
-specified as a side effect of the @code{file} or @code{core} commands.
-When you need more flexibility---for example, running _GDBN__ on a
-physically separate host, controlling standalone systems over a
-serial port, or realtime systems over a TCP/IP connection---you can use
-the @code{target} command.
-
-@menu
-* Active Targets:: Active Targets
-* Target Commands:: Commands for Managing Targets
-* Remote:: Remote Debugging
-@end menu
-
-@node Active Targets, Target Commands, Targets, Targets
-@section Active Targets
-@cindex stacking targets
-@cindex active targets
-@cindex multiple targets
-
-Targets are managed in three @dfn{strata} that correspond to different
-classes of target: processes, core files, and executable files. This
-allows you to (for example) start a process and inspect its activity
-without abandoning your work on a core file.
-
-More than one target can potentially respond to a request. In
-particular, when you access memory _GDBN__ will examine the three strata of
-targets until it finds a target that can handle that particular address.
-Strata are always examined in a fixed order: first a process if there is
-one, then a core file if there is one, and finally an executable file if
-there is one of those.
-
-When you specify a new target in a given stratum, it replaces any target
-previously in that stratum.
-
-To get rid of a target without replacing it, use the @code{detach}
-command. The related command @code{attach} provides you with a way of
-choosing a particular running process as a new target. @xref{Attach}.
-
-@node Target Commands, Remote, Active Targets, Targets
-@section Commands for Managing Targets
-
-@table @code
-@item target @var{type} @var{parameters}
-Connects the _GDBN__ host environment to a target machine or process. A
-target is typically a protocol for talking to debugging facilities. You
-use the argument @var{type} to specify the type or protocol of the
-target machine.
-
-Further @var{parameters} are interpreted by the target protocol, but
-typically include things like device names or host names to connect
-with, process numbers, and baud rates.
-
-The @code{target} command will not repeat if you press @key{RET} again
-after executing the command.
-
-@item help target
-@kindex help target
-Displays the names of all targets available. To display targets
-currently selected, use either @code{info target} or @code{info files}
-(@pxref{Files}).
-
-@item help target @var{name}
-Describe a particular target, including any parameters necessary to
-select it.
-@end table
-
-Here are some common targets (available, or not, depending on the _GDBN__
-configuration):
-
-@table @code
-@item target exec @var{prog}
-@kindex target exec
-An executable file. @samp{target exec @var{prog}} is the same as
-@samp{exec-file @var{prog}}.
-
-@item target core @var{filename}
-@kindex target core
-A core dump file. @samp{target core @var{filename}} is the same as
-@samp{core-file @var{filename}}.
-
-@item target remote @var{dev}
-@kindex target remote
-Remote serial target in _GDBN__-specific protocol. The argument @var{dev}
-specifies what serial device to use for the connection (e.g.
-@file{/dev/ttya}). @xref{Remote}.
-
-_if__(_AMD29K__)
-@item target amd-eb @var{dev} @var{speed} @var{PROG}
-@kindex target amd-eb
-@cindex AMD EB29K
-Remote PC-resident AMD EB29K board, attached over serial lines.
-@var{dev} is the serial device, as for @code{target remote};
-@var{speed} allows you to specify the linespeed; and @var{PROG} is the
-name of the program to be debugged, as it appears to DOS on the PC.
-@xref{EB29K Remote}.
-
-_fi__(_AMD29K__)
-_if__(_I960__)
-@item target nindy @var{devicename}
-@kindex target nindy
-An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is
-the name of the serial device to use for the connection, e.g.
-@file{/dev/ttya}. @xref{i960-Nindy Remote}.
-
-_fi__(_I960__)
-_if__(_VXWORKS__)
-@item target vxworks @var{machinename}
-@kindex target vxworks
-A VxWorks system, attached via TCP/IP. The argument @var{machinename}
-is the target system's machine name or IP address.
-@xref{VxWorks Remote}.
-_fi__(_VXWORKS__)
-@end table
-
-_if__(_GENERIC__)
-Different targets are available on different configurations of _GDBN__; your
-configuration may have more or fewer targets.
-_fi__(_GENERIC__)
-
-@node Remote, , Target Commands, Targets
-@section Remote Debugging
-@cindex remote debugging
-
-_if__(_GENERIC__)
-@menu
-_include__(gdbinv-m.m4)<>_dnl__
-@end menu
-_fi__(_GENERIC__)
-
-If you are trying to debug a program running on a machine that can't run
-_GDBN__ in the usual way, it is often useful to use remote debugging. For
-example, you might use remote debugging on an operating system kernel, or on
-a small system which does not have a general purpose operating system
-powerful enough to run a full-featured debugger.
-
-Some configurations of _GDBN__ have special serial or TCP/IP interfaces
-to make this work with particular debugging targets. In addition,
-_GDBN__ comes with a generic serial protocol (specific to _GDBN__, but
-not specific to any particular target system) which you can use if you
-write the remote stubs---the code that will run on the remote system to
-communicate with _GDBN__.
-
-To use the _GDBN__ remote serial protocol, the program to be debugged on
-the remote machine needs to contain a debugging stub which talks to
-_GDBN__ over the serial line. Several working remote stubs are
-distributed with _GDBN__; see the @file{README} file in the _GDBN__
-distribution for more information.
-
-For details of this communication protocol, see the comments in the
-_GDBN__ source file @file{remote.c}.
-
-To start remote debugging, first run _GDBN__ and specify as an executable file
-the program that is running in the remote machine. This tells _GDBN__ how
-to find the program's symbols and the contents of its pure text. Then
-establish communication using the @code{target remote} command with a device
-name as an argument. For example:
-
-@example
-target remote /dev/ttyb
-@end example
-
-@noindent
-if the serial line is connected to the device named @file{/dev/ttyb}. This
-will stop the remote machine if it is not already stopped.
-
-Now you can use all the usual commands to examine and change data and to
-step and continue the remote program.
-
-To resume the remote program and stop debugging it, use the @code{detach}
-command.
-
-Other remote targets may be available in your
-configuration of _GDBN__; use @code{help targets} to list them.
-
-_if__(_GENERIC__)
-@c Text on starting up GDB in various specific cases; it goes up front
-@c in manuals configured for any of those particular situations, here
-@c otherwise.
-_include__(gdbinv-s.m4)
-_fi__(_GENERIC__)
-
-@node Controlling _GDBN__, Sequences, Targets, Top
-@chapter Controlling _GDBN__
-
-You can alter many aspects of _GDBN__'s interaction with you by using
-the @code{set} command. For commands controlling how _GDBN__ displays
-data, @pxref{Print Settings}; other settings are described here.
-
-@menu
-* Prompt:: Prompt
-* Editing:: Command Editing
-* History:: Command History
-* Screen Size:: Screen Size
-* Numbers:: Numbers
-* Messages/Warnings:: Optional Warnings and Messages
-@end menu
-
-@node Prompt, Editing, Controlling _GDBN__, Controlling _GDBN__
-@section Prompt
-@cindex prompt
-_GDBN__ indicates its readiness to read a command by printing a string
-called the @dfn{prompt}. This string is normally @samp{(_GDBP__)}. You
-can change the prompt string with the @code{set prompt} command. For
-instance, when debugging _GDBN__ with _GDBN__, it is useful to change
-the prompt in one of the _GDBN__<>s so that you can always tell which
-one you are talking to.
-
-@table @code
-@item set prompt @var{newprompt}
-@kindex set prompt
-Directs _GDBN__ to use @var{newprompt} as its prompt string henceforth.
-@kindex show prompt
-@item show prompt
-Prints a line of the form: @samp{Gdb's prompt is: @var{your-prompt}}
-@end table
-
-@node Editing, History, Prompt, Controlling _GDBN__
-@section Command Editing
-@cindex readline
-@cindex command line editing
-_GDBN__ reads its input commands via the @dfn{readline} interface. This
-GNU library provides consistent behavior for programs which provide a
-command line interface to the user. Advantages are @code{emacs}-style
-or @code{vi}-style inline editing of commands, @code{csh}-like history
-substitution, and a storage and recall of command history across
-debugging sessions.
-
-You may control the behavior of command line editing in _GDBN__ with the
-command @code{set}.
-
-@table @code
-@kindex set editing
-@cindex editing
-@item set editing
-@itemx set editing on
-Enable command line editing (enabled by default).
-
-@item set editing off
-Disable command line editing.
-
-@kindex show editing
-@item show editing
-Show whether command line editing is enabled.
-@end table
-
-@node History, Screen Size, Editing, Controlling _GDBN__
-@section Command History
-@table @code
-@cindex history substitution
-@cindex history file
-@kindex set history filename
-@item set history filename @var{fname}
-Set the name of the _GDBN__ command history file to @var{fname}. This is
-the file from which _GDBN__ will read an initial command history
-list or to which it will write this list when it exits. This list is
-accessed through history expansion or through the history
-command editing characters listed below. This file defaults to the
-value of the environment variable @code{GDBHISTFILE}, or to
-@file{./.gdb_history} if this variable is not set.
-
-@cindex history save
-@kindex set history save
-@item set history save
-@itemx set history save on
-Record command history in a file, whose name may be specified with the
-@code{set history filename} command. By default, this option is disabled.
-
-@item set history save off
-Stop recording command history in a file.
-
-@cindex history size
-@kindex set history size
-@item set history size @var{size}
-Set the number of commands which _GDBN__ will keep in its history list.
-This defaults to the value of the environment variable
-@code{HISTSIZE}, or to 256 if this variable is not set.
-@end table
-
-@cindex history expansion
-History expansion assigns special meaning to the character @kbd{!}.
-@iftex
-(@xref{Event Designators}.)
-@end iftex
-Since @kbd{!} is also the logical not operator in C, history expansion
-is off by default. If you decide to enable history expansion with the
-@code{set history expansion on} command, you may sometimes need to
-follow @kbd{!} (when it is used as logical not, in an expression) with
-a space or a tab to prevent it from being expanded. The readline
-history facilities will not attempt substitution on the strings
-@kbd{!=} and @kbd{!(}, even when history expansion is enabled.
-
-The commands to control history expansion are:
-
-@table @code
-
-@kindex set history expansion
-@item set history expansion on
-@itemx set history expansion
-Enable history expansion. History expansion is off by default.
-
-@item set history expansion off
-Disable history expansion.
-
-The readline code comes with more complete documentation of
-editing and history expansion features. Users unfamiliar with @code{emacs}
-or @code{vi} may wish to read it.
-@iftex
-@xref{Command Line Editing}.
-@end iftex
-
-@c @group
-@kindex show history
-@item show history
-@itemx show history filename
-@itemx show history save
-@itemx show history size
-@itemx show history expansion
-These commands display the state of the _GDBN__ history parameters.
-@code{show history} by itself displays all four states.
-@c @end group
-
-@end table
-
-@table @code
-@kindex show commands
-@item show commands
-Display the last ten commands in the command history.
-
-@item show commands @var{n}
-Print ten commands centered on command number @var{n}.
-
-@item show commands +
-Print ten commands just after the commands last printed.
-
-@end table
-
-@node Screen Size, Numbers, History, Controlling _GDBN__
-@section Screen Size
-@cindex size of screen
-@cindex pauses in output
-Certain commands to _GDBN__ may produce large amounts of information
-output to the screen. To help you read all of it, _GDBN__ pauses and
-asks you for input at the end of each page of output. Type @key{RET}
-when you want to continue the output. _GDBN__ also uses the screen
-width setting to determine when to wrap lines of output. Depending on
-what is being printed, it tries to break the line at a readable place,
-rather than simply letting it overflow onto the following line.
-
-Normally _GDBN__ knows the size of the screen from the termcap data base
-together with the value of the @code{TERM} environment variable and the
-@code{stty rows} and @code{stty cols} settings. If this is not correct,
-you can override it with the @code{set height} and @code{set
-width} commands:
-
-@table @code
-@item set height @var{lpp}
-@itemx show height
-@itemx set width @var{cpl}
-@itemx show width
-@kindex set height
-@kindex set width
-@kindex show width
-@kindex show height
-These @code{set} commands specify a screen height of @var{lpp} lines and
-a screen width of @var{cpl} characters. The associated @code{show}
-commands display the current settings.
-
-If you specify a height of zero lines, _GDBN__ will not pause during output
-no matter how long the output is. This is useful if output is to a file
-or to an editor buffer.
-@end table
-
-@node Numbers, Messages/Warnings, Screen Size, Controlling _GDBN__
-@section Numbers
-@cindex number representation
-@cindex entering numbers
-You can always enter numbers in octal, decimal, or hexadecimal in _GDBN__ by
-the usual conventions: octal numbers begin with @samp{0}, decimal
-numbers end with @samp{.}, and hexadecimal numbers begin with @samp{0x}.
-Numbers that begin with none of these are, by default, entered in base
-10; likewise, the default display for numbers---when no particular
-format is specified---is base 10. You can change the default base for
-both input and output with the @code{set radix} command.
-
-@table @code
-@kindex set radix
-@item set radix @var{base}
-Set the default base for numeric input and display. Supported choices
-for @var{base} are decimal 2, 8, 10, 16. @var{base} must itself be
-specified either unambiguously or using the current default radix; for
-example, any of
-
-@example
-set radix 1010
-set radix 012
-set radix 10.
-set radix 0xa
-@end example
-
-@noindent
-will set the base to decimal. On the other hand, @samp{set radix 10}
-will leave the radix unchanged no matter what it was.
-
-@kindex show radix
-@item show radix
-Display the current default base for numeric input and display.
-
-@end table
-
-@node Messages/Warnings, , Numbers, Controlling _GDBN__
-@section Optional Warnings and Messages
-By default, _GDBN__ is silent about its inner workings. If you are running
-on a slow machine, you may want to use the @code{set verbose} command.
-It will make _GDBN__ tell you when it does a lengthy internal operation, so
-you won't think it has crashed.
-
-Currently, the messages controlled by @code{set verbose} are those which
-announce that the symbol table for a source file is being read
-(@pxref{Files}, in the description of the command
-@code{symbol-file}).
-@c The following is the right way to do it, but emacs 18.55 doesn't support
-@c @ref, and neither the emacs lisp manual version of texinfmt or makeinfo
-@c is released.
-@ignore
-see @code{symbol-file} in @ref{Files}).
-@end ignore
-
-@table @code
-@kindex set verbose
-@item set verbose on
-Enables _GDBN__'s output of certain informational messages.
-
-@item set verbose off
-Disables _GDBN__'s output of certain informational messages.
-
-@kindex show verbose
-@item show verbose
-Displays whether @code{set verbose} is on or off.
-@end table
-
-By default, if _GDBN__ encounters bugs in the symbol table of an object
-file, it is silent; but if you are debugging a compiler, you may find
-this information useful (@pxref{Symbol Errors}).
-
-@table @code
-@kindex set complaints
-@item set complaints @var{limit}
-Permits _GDBN__ to output @var{limit} complaints about each type of unusual
-symbols before becoming silent about the problem. Set @var{limit} to
-zero to suppress all complaints; set it to a large number to prevent
-complaints from being suppressed.
-
-@kindex show complaints
-@item show complaints
-Displays how many symbol complaints _GDBN__ is permitted to produce.
-@end table
-
-By default, _GDBN__ is cautious, and asks what sometimes seem to be a
-lot of stupid questions to confirm certain commands. For example, if
-you try to run a program which is already running:
-@example
-(_GDBP__) run
-The program being debugged has been started already.
-Start it from the beginning? (y or n)
-@end example
-
-If you're willing to unflinchingly face the consequences of your own
-commands, you can disable this ``feature'':
-
-@table @code
-@kindex set confirm
-@cindex flinching
-@cindex confirmation
-@cindex stupid questions
-@item set confirm off
-Disables confirmation requests.
-
-@item set confirm on
-Enables confirmation requests (the default).
-
-@item show confirm
-@kindex show confirm
-Displays state of confirmation requests.
-@end table
-
-@c FIXME this doesn't really belong here. But where *does* it belong?
-@cindex reloading symbols
-Some systems allow individual object files that make up your program to
-be replaced without stopping and restarting your program.
-_if__(_VXWORKS__)
-For example, in VxWorks you can simply recompile a defective object file
-and keep on running.
-_fi__(_VXWORKS__)
-If you're running on one of these systems, you can allow _GDBN__ to
-reload the symbols for automatically relinked modules:@refill
-@table @code
-@kindex set symbol-reloading
-@item set symbol-reloading on
-Replace symbol definitions for the corresponding source file when an
-object file with a particular name is seen again.
-
-@item set symbol-reloading off
-Don't replace symbol definitions when re-encountering object files of
-the same name. This is the default state; if you're not running on a
-system that permits automatically relinking modules, you should leave
-@code{symbol-reloading} off, since otherwise _GDBN__ may discard symbols
-when linking large programs, that may contain several modules (from
-different directories or libraries) with the same name.
-
-@item show symbol-reloading
-Show the current @code{on} or @code{off} setting.
-@end table
-
-@node Sequences, Emacs, Controlling _GDBN__, Top
-@chapter Canned Sequences of Commands
-
-Aside from breakpoint commands (@pxref{Break Commands}), _GDBN__ provides two
-ways to store sequences of commands for execution as a unit:
-user-defined commands and command files.
-
-@menu
-* Define:: User-Defined Commands
-* Command Files:: Command Files
-* Output:: Commands for Controlled Output
-@end menu
-
-@node Define, Command Files, Sequences, Sequences
-@section User-Defined Commands
-
-@cindex user-defined command
-A @dfn{user-defined command} is a sequence of _GDBN__ commands to which you
-assign a new name as a command. This is done with the @code{define}
-command.
-
-@table @code
-@item define @var{commandname}
-@kindex define
-Define a command named @var{commandname}. If there is already a command
-by that name, you are asked to confirm that you want to redefine it.
-
-The definition of the command is made up of other _GDBN__ command lines,
-which are given following the @code{define} command. The end of these
-commands is marked by a line containing @code{end}.
-
-@item document @var{commandname}
-@kindex document
-Give documentation to the user-defined command @var{commandname}. The
-command @var{commandname} must already be defined. This command reads
-lines of documentation just as @code{define} reads the lines of the
-command definition, ending with @code{end}. After the @code{document}
-command is finished, @code{help} on command @var{commandname} will print
-the documentation you have specified.
-
-You may use the @code{document} command again to change the
-documentation of a command. Redefining the command with @code{define}
-does not change the documentation.
-
-@item help user-defined
-@kindex help user-defined
-List all user-defined commands, with the first line of the documentation
-(if any) for each.
-
-@item info user
-@itemx info user @var{commandname}
-@kindex info user
-Display the _GDBN__ commands used to define @var{commandname} (but not its
-documentation). If no @var{commandname} is given, display the
-definitions for all user-defined commands.
-@end table
-
-User-defined commands do not take arguments. When they are executed, the
-commands of the definition are not printed. An error in any command
-stops execution of the user-defined command.
-
-Commands that would ask for confirmation if used interactively proceed
-without asking when used inside a user-defined command. Many _GDBN__ commands
-that normally print messages to say what they are doing omit the messages
-when used in a user-defined command.
-
-@node Command Files, Output, Define, Sequences
-@section Command Files
-
-@cindex command files
-A command file for _GDBN__ is a file of lines that are _GDBN__ commands. Comments
-(lines starting with @kbd{#}) may also be included. An empty line in a
-command file does nothing; it does not mean to repeat the last command, as
-it would from the terminal.
-
-@cindex init file
-@cindex @file{_GDBINIT__}
-When you start _GDBN__, it automatically executes commands from its
-@dfn{init files}. These are files named @file{_GDBINIT__}. _GDBN__
-reads the init file (if any) in your home directory and then the init
-file (if any) in the current working directory. (The init files are not
-executed if you use the @samp{-nx} option; @pxref{Mode Options}.) You
-can also request the execution of a command file with the @code{source}
-command:
-
-@table @code
-@item source @var{filename}
-@kindex source
-Execute the command file @var{filename}.
-@end table
-
-The lines in a command file are executed sequentially. They are not
-printed as they are executed. An error in any command terminates execution
-of the command file.
-
-Commands that would ask for confirmation if used interactively proceed
-without asking when used in a command file. Many _GDBN__ commands that
-normally print messages to say what they are doing omit the messages
-when called from command files.
-
-@node Output, , Command Files, Sequences
-@section Commands for Controlled Output
-
-During the execution of a command file or a user-defined command, normal
-_GDBN__ output is suppressed; the only output that appears is what is
-explicitly printed by the commands in the definition. This section
-describes three commands useful for generating exactly the output you
-want.
-
-@table @code
-@item echo @var{text}
-@kindex echo
-@c I don't consider backslash-space a standard C escape sequence
-@c because it's not in ANSI.
-Print @var{text}. Nonprinting characters can be included in @var{text}
-using C escape sequences, such as @samp{\n} to print a newline. @b{No
-newline will be printed unless you specify one.} In addition to the
-standard C escape sequences, a backslash followed by a space stands for a
-space. This is useful for outputting a string with spaces at the
-beginning or the end, since leading and trailing spaces are otherwise
-trimmed from all arguments. Thus, to print @samp{@ and foo =@ }, use the
-command @samp{echo \@ and foo = \@ }.
-@c FIXME: verify hard copy actually issues enspaces for '@ '! Will this
-@c confuse texinfo?
-
-A backslash at the end of @var{text} can be used, as in C, to continue
-the command onto subsequent lines. For example,
-
-@example
-echo This is some text\n\
-which is continued\n\
-onto several lines.\n
-@end example
-
-produces the same output as
-
-@example
-echo This is some text\n
-echo which is continued\n
-echo onto several lines.\n
-@end example
-
-@item output @var{expression}
-@kindex output
-Print the value of @var{expression} and nothing but that value: no
-newlines, no @samp{$@var{nn} = }. The value is not entered in the
-value history either. @xref{Expressions} for more information on
-expressions.
-
-@item output/@var{fmt} @var{expression}
-Print the value of @var{expression} in format @var{fmt}. You can use
-the same formats as for @code{print}; @pxref{Output formats}, for more
-information.
-
-@item printf @var{string}, @var{expressions}@dots{}
-@kindex printf
-Print the values of the @var{expressions} under the control of
-@var{string}. The @var{expressions} are separated by commas and may
-be either numbers or pointers. Their values are printed as specified
-by @var{string}, exactly as if the program were to execute
-
-@example
-printf (@var{string}, @var{expressions}@dots{});
-@end example
-
-For example, you can print two values in hex like this:
-
-@example
-printf "foo, bar-foo = 0x%x, 0x%x\n", foo, bar-foo
-@end example
-
-The only backslash-escape sequences that you can use in the format
-string are the simple ones that consist of backslash followed by a
-letter.
-@end table
-
-@node Emacs, _GDBN__ Bugs, Sequences, Top
-@chapter Using _GDBN__ under GNU Emacs
-
-@cindex emacs
-A special interface allows you to use GNU Emacs to view (and
-edit) the source files for the program you are debugging with
-_GDBN__.
-
-To use this interface, use the command @kbd{M-x gdb} in Emacs. Give the
-executable file you want to debug as an argument. This command starts
-_GDBN__ as a subprocess of Emacs, with input and output through a newly
-created Emacs buffer.
-
-Using _GDBN__ under Emacs is just like using _GDBN__ normally except for two
-things:
-
-@itemize @bullet
-@item
-All ``terminal'' input and output goes through the Emacs buffer.
-@end itemize
-
-This applies both to _GDBN__ commands and their output, and to the input
-and output done by the program you are debugging.
-
-This is useful because it means that you can copy the text of previous
-commands and input them again; you can even use parts of the output
-in this way.
-
-All the facilities of Emacs' Shell mode are available for interacting
-with your program. In particular, you can send signals the usual
-way---for example, @kbd{C-c C-c} for an interrupt, @kbd{C-c C-z} for a
-stop.
-
-@itemize @bullet
-@item
-_GDBN__ displays source code through Emacs.
-@end itemize
-
-Each time _GDBN__ displays a stack frame, Emacs automatically finds the
-source file for that frame and puts an arrow (_0__@samp{=>}_1__) at the
-left margin of the current line. Emacs uses a separate buffer for
-source display, and splits the window to show both your _GDBN__ session
-and the source.
-
-Explicit _GDBN__ @code{list} or search commands still produce output as
-usual, but you probably will have no reason to use them.
-
-@quotation
-@emph{Warning:} If the directory where your program resides is not your
-current directory, it can be easy to confuse Emacs about the location of
-the source files, in which case the auxiliary display buffer will not
-appear to show your source. _GDBN__ can find programs by searching your
-environment's @code{PATH} variable, so the _GDBN__ input and output
-session will proceed normally; but Emacs doesn't get enough information
-back from _GDBN__ to locate the source files in this situation. To
-avoid this problem, either start _GDBN__ mode from the directory where
-your program resides, or specify a full path name when prompted for the
-@kbd{M-x gdb} argument.
-
-A similar confusion can result if you use the _GDBN__ @code{file} command to
-switch to debugging a program in some other location, from an existing
-_GDBN__ buffer in Emacs.
-@end quotation
-
-By default, @kbd{M-x gdb} calls the program called @file{gdb}. If
-you need to call _GDBN__ by a different name (for example, if you keep
-several configurations around, with different names) you can set the
-Emacs variable @code{gdb-command-name}; for example,
-@example
-(setq gdb-command-name "mygdb")
-@end example
-@noindent
-(preceded by @kbd{ESC ESC}, or typed in the @code{*scratch*} buffer, or
-in your @file{.emacs} file) will make Emacs call the program named
-``@code{mygdb}'' instead.
-
-In the _GDBN__ I/O buffer, you can use these special Emacs commands in
-addition to the standard Shell mode commands:
-
-@table @kbd
-@item C-h m
-Describe the features of Emacs' _GDBN__ Mode.
-
-@item M-s
-Execute to another source line, like the _GDBN__ @code{step} command; also
-update the display window to show the current file and location.
-
-@item M-n
-Execute to next source line in this function, skipping all function
-calls, like the _GDBN__ @code{next} command. Then update the display window
-to show the current file and location.
-
-@item M-i
-Execute one instruction, like the _GDBN__ @code{stepi} command; update
-display window accordingly.
-
-@item M-x gdb-nexti
-Execute to next instruction, using the _GDBN__ @code{nexti} command; update
-display window accordingly.
-
-@item C-c C-f
-Execute until exit from the selected stack frame, like the _GDBN__
-@code{finish} command.
-
-@item M-c
-Continue execution of the program, like the _GDBN__ @code{continue}
-command. @emph{Warning:} In Emacs v19, this command is @kbd{C-c C-p}.
-
-@item M-u
-Go up the number of frames indicated by the numeric argument
-(@pxref{Arguments, , Numeric Arguments, emacs, The GNU Emacs Manual}),
-like the _GDBN__ @code{up} command. @emph{Warning:} In Emacs v19, this
-command is @kbd{C-c C-u}.@refill
-
-@item M-d
-Go down the number of frames indicated by the numeric argument, like the
-_GDBN__ @code{down} command. @emph{Warning:} In Emacs v19, this command
-is @kbd{C-c C-d}.
-
-@item C-x &
-Read the number where the cursor is positioned, and insert it at the end
-of the _GDBN__ I/O buffer. For example, if you wish to disassemble code
-around an address that was displayed earlier, type @kbd{disassemble};
-then move the cursor to the address display, and pick up the
-argument for @code{disassemble} by typing @kbd{C-x &}.
-
-You can customize this further on the fly by defining elements of the list
-@code{gdb-print-command}; once it is defined, you can format or
-otherwise process numbers picked up by @kbd{C-x &} before they are
-inserted. A numeric argument to @kbd{C-x &} will both indicate that you
-wish special formatting, and act as an index to pick an element of the
-list. If the list element is a string, the number to be inserted is
-formatted using the Emacs function @code{format}; otherwise the number
-is passed as an argument to the corresponding list element.
-
-@end table
-
-In any source file, the Emacs command @kbd{C-x SPC} (@code{gdb-break})
-tells _GDBN__ to set a breakpoint on the source line point is on.
-
-If you accidentally delete the source-display buffer, an easy way to get
-it back is to type the command @code{f} in the _GDBN__ buffer, to
-request a frame display; when you run under Emacs, this will recreate
-the source buffer if necessary to show you the context of the current
-frame.
-
-The source files displayed in Emacs are in ordinary Emacs buffers
-which are visiting the source files in the usual way. You can edit
-the files with these buffers if you wish; but keep in mind that _GDBN__
-communicates with Emacs in terms of line numbers. If you add or
-delete lines from the text, the line numbers that _GDBN__ knows will cease
-to correspond properly to the code.
-
-@c The following dropped because Epoch is nonstandard. Reactivate
-@c if/when v19 does something similar. ---pesch@cygnus.com 19dec1990
-@ignore
-@kindex emacs epoch environment
-@kindex epoch
-@kindex inspect
-
-Version 18 of Emacs has a built-in window system called the @code{epoch}
-environment. Users of this environment can use a new command,
-@code{inspect} which performs identically to @code{print} except that
-each value is printed in its own window.
-@end ignore
-
-@node _GDBN__ Bugs, Renamed Commands, Emacs, Top
-@chapter Reporting Bugs in _GDBN__
-@cindex Bugs in _GDBN__
-@cindex Reporting Bugs in _GDBN__
-
-Your bug reports play an essential role in making _GDBN__ reliable.
-
-Reporting a bug may help you by bringing a solution to your problem, or it
-may not. But in any case the principal function of a bug report is to help
-the entire community by making the next version of _GDBN__ work better. Bug
-reports are your contribution to the maintenance of _GDBN__.
-
-In order for a bug report to serve its purpose, you must include the
-information that enables us to fix the bug.
-
-@menu
-* Bug Criteria:: Have You Found a Bug?
-* Bug Reporting:: How to Report Bugs
-@end menu
-
-@node Bug Criteria, Bug Reporting, _GDBN__ Bugs, _GDBN__ Bugs
-@section Have You Found a Bug?
-@cindex Bug Criteria
-
-If you are not sure whether you have found a bug, here are some guidelines:
-
-@itemize @bullet
-@item
-@cindex Fatal Signal
-@cindex Core Dump
-If the debugger gets a fatal signal, for any input whatever, that is a
-_GDBN__ bug. Reliable debuggers never crash.
-
-@item
-@cindex error on Valid Input
-If _GDBN__ produces an error message for valid input, that is a bug.
-
-@item
-@cindex Invalid Input
-If _GDBN__ does not produce an error message for invalid input,
-that is a bug. However, you should note that your idea of
-``invalid input'' might be our idea of ``an extension'' or ``support
-for traditional practice''.
-
-@item
-If you are an experienced user of debugging tools, your suggestions
-for improvement of _GDBN__ are welcome in any case.
-@end itemize
-
-@node Bug Reporting, , Bug Criteria, _GDBN__ Bugs
-@section How to Report Bugs
-@cindex Bug Reports
-@cindex _GDBN__ Bugs, Reporting
-
-A number of companies and individuals offer support for GNU products.
-If you obtained _GDBN__ from a support organization, we recommend you
-contact that organization first.
-
-Contact information for many support companies and individuals is
-available in the file @file{etc/SERVICE} in the GNU Emacs distribution.
-
-In any event, we also recommend that you send bug reports for _GDBN__ to one
-of these addresses:
-
-@example
-bug-gdb@@prep.ai.mit.edu
-@{ucbvax|mit-eddie|uunet@}!prep.ai.mit.edu!bug-gdb
-@end example
-
-@strong{Do not send bug reports to @samp{info-gdb}, or to
-@samp{help-gdb}, or to any newsgroups.} Most users of _GDBN__ do not want to
-receive bug reports. Those that do, have arranged to receive @samp{bug-gdb}.
-
-The mailing list @samp{bug-gdb} has a newsgroup @samp{gnu.gdb.bug} which
-serves as a repeater. The mailing list and the newsgroup carry exactly
-the same messages. Often people think of posting bug reports to the
-newsgroup instead of mailing them. This appears to work, but it has one
-problem which can be crucial: a newsgroup posting often lacks a mail
-path back to the sender. Thus, if we need to ask for more information,
-we may be unable to reach you. For this reason, it is better to send
-bug reports to the mailing list.
-
-As a last resort, send bug reports on paper to:
-
-@example
-GNU Debugger Bugs
-Free Software Foundation
-545 Tech Square
-Cambridge, MA 02139
-@end example
-
-The fundamental principle of reporting bugs usefully is this:
-@strong{report all the facts}. If you are not sure whether to state a
-fact or leave it out, state it!
-
-Often people omit facts because they think they know what causes the
-problem and assume that some details don't matter. Thus, you might
-assume that the name of the variable you use in an example does not matter.
-Well, probably it doesn't, but one cannot be sure. Perhaps the bug is a
-stray memory reference which happens to fetch from the location where that
-name is stored in memory; perhaps, if the name were different, the contents
-of that location would fool the debugger into doing the right thing despite
-the bug. Play it safe and give a specific, complete example. That is the
-easiest thing for you to do, and the most helpful.
-
-Keep in mind that the purpose of a bug report is to enable us to fix
-the bug if it is new to us. It isn't as important what happens if
-the bug is already known. Therefore, always write your bug reports on
-the assumption that the bug has not been reported previously.
-
-Sometimes people give a few sketchy facts and ask, ``Does this ring a
-bell?'' Those bug reports are useless, and we urge everyone to
-@emph{refuse to respond to them} except to chide the sender to report
-bugs properly.
-
-To enable us to fix the bug, you should include all these things:
-
-@itemize @bullet
-@item
-The version of _GDBN__. _GDBN__ announces it if you start with no
-arguments; you can also print it at any time using @code{show version}.
-
-Without this, we won't know whether there is any point in looking for
-the bug in the current version of _GDBN__.
-
-@item
-A complete input script, and all necessary source files, that will
-reproduce the bug.
-
-@item
-What compiler (and its version) was used to compile _GDBN__---e.g.
-``_GCC__-1.37.1''.
-
-@item
-The command arguments you gave the compiler to compile your example and
-observe the bug. For example, did you use @samp{-O}? To guarantee
-you won't omit something important, list them all.
-
-If we were to try to guess the arguments, we would probably guess wrong
-and then we might not encounter the bug.
-
-@item
-The type of machine you are using, and the operating system name and
-version number.
-
-@item
-A description of what behavior you observe that you believe is
-incorrect. For example, ``It gets a fatal signal.''
-
-Of course, if the bug is that _GDBN__ gets a fatal signal, then we will
-certainly notice it. But if the bug is incorrect output, we might not
-notice unless it is glaringly wrong. We are human, after all. You
-might as well not give us a chance to make a mistake.
-
-Even if the problem you experience is a fatal signal, you should still
-say so explicitly. Suppose something strange is going on, such as,
-your copy of _GDBN__ is out of synch, or you have encountered a
-bug in the C library on your system. (This has happened!) Your copy
-might crash and ours would not. If you told us to expect a crash,
-then when ours fails to crash, we would know that the bug was not
-happening for us. If you had not told us to expect a crash, then we
-would not be able to draw any conclusion from our observations.
-
-@item
-If you wish to suggest changes to the _GDBN__ source, send us context
-diffs. If you even discuss something in the _GDBN__ source, refer to
-it by context, not by line number.
-
-The line numbers in our development sources won't match those in your
-sources. Your line numbers would convey no useful information to us.
-
-@end itemize
-
-Here are some things that are not necessary:
-
-@itemize @bullet
-@item
-A description of the envelope of the bug.
-
-Often people who encounter a bug spend a lot of time investigating
-which changes to the input file will make the bug go away and which
-changes will not affect it.
-
-This is often time consuming and not very useful, because the way we
-will find the bug is by running a single example under the debugger
-with breakpoints, not by pure deduction from a series of examples.
-We recommend that you save your time for something else.
-
-Of course, if you can find a simpler example to report @emph{instead}
-of the original one, that is a convenience for us. Errors in the
-output will be easier to spot, running under the debugger will take
-less time, etc.
-
-However, simplification is not vital; if you don't want to do this,
-report the bug anyway and send us the entire test case you used.
-
-@item
-A patch for the bug.
-
-A patch for the bug does help us if it is a good one. But don't omit
-the necessary information, such as the test case, on the assumption that
-a patch is all we need. We might see problems with your patch and decide
-to fix the problem another way, or we might not understand it at all.
-
-Sometimes with a program as complicated as _GDBN__ it is very hard to
-construct an example that will make the program follow a certain path
-through the code. If you don't send us the example, we won't be able
-to construct one, so we won't be able to verify that the bug is fixed.
-
-And if we can't understand what bug you are trying to fix, or why your
-patch should be an improvement, we won't install it. A test case will
-help us to understand.
-
-@item
-A guess about what the bug is or what it depends on.
-
-Such guesses are usually wrong. Even we can't guess right about such
-things without first using the debugger to find the facts.
-@end itemize
-
-@iftex
-@include rdl-apps.texi
-@end iftex
-
-@node Renamed Commands, Installing _GDBN__, _GDBN__ Bugs, Top
-@appendix Renamed Commands
-
-The following commands were renamed in _GDBN__ 4.0, in order to make the
-command set as a whole more consistent and easier to use and remember:
-
-@kindex add-syms
-@kindex delete environment
-@kindex info copying
-@kindex info convenience
-@kindex info directories
-@kindex info editing
-@kindex info history
-@kindex info targets
-@kindex info values
-@kindex info version
-@kindex info warranty
-@kindex set addressprint
-@kindex set arrayprint
-@kindex set prettyprint
-@kindex set screen-height
-@kindex set screen-width
-@kindex set unionprint
-@kindex set vtblprint
-@kindex set demangle
-@kindex set asm-demangle
-@kindex set sevenbit-strings
-@kindex set array-max
-@kindex set caution
-@kindex set history write
-@kindex show addressprint
-@kindex show arrayprint
-@kindex show prettyprint
-@kindex show screen-height
-@kindex show screen-width
-@kindex show unionprint
-@kindex show vtblprint
-@kindex show demangle
-@kindex show asm-demangle
-@kindex show sevenbit-strings
-@kindex show array-max
-@kindex show caution
-@kindex show history write
-@kindex unset
-
-@ifinfo
-@example
-OLD COMMAND NEW COMMAND
---------------- -------------------------------
-add-syms add-symbol-file
-delete environment unset environment
-info convenience show convenience
-info copying show copying
-info directories show directories
-info editing show commands
-info history show values
-info targets help target
-info values show values
-info version show version
-info warranty show warranty
-set/show addressprint set/show print address
-set/show array-max set/show print elements
-set/show arrayprint set/show print array
-set/show asm-demangle set/show print asm-demangle
-set/show caution set/show confirm
-set/show demangle set/show print demangle
-set/show history write set/show history save
-set/show prettyprint set/show print pretty
-set/show screen-height set/show height
-set/show screen-width set/show width
-set/show sevenbit-strings set/show print sevenbit-strings
-set/show unionprint set/show print union
-set/show vtblprint set/show print vtbl
-
-unset [No longer an alias for delete]
-@end example
-@end ifinfo
-
-@tex
-\vskip \parskip\vskip \baselineskip
-\halign{\tt #\hfil &\qquad#&\tt #\hfil\cr
-{\bf Old Command} &&{\bf New Command}\cr
-add-syms &&add-symbol-file\cr
-delete environment &&unset environment\cr
-info convenience &&show convenience\cr
-info copying &&show copying\cr
-info directories &&show directories \cr
-info editing &&show commands\cr
-info history &&show values\cr
-info targets &&help target\cr
-info values &&show values\cr
-info version &&show version\cr
-info warranty &&show warranty\cr
-set{\rm / }show addressprint &&set{\rm / }show print address\cr
-set{\rm / }show array-max &&set{\rm / }show print elements\cr
-set{\rm / }show arrayprint &&set{\rm / }show print array\cr
-set{\rm / }show asm-demangle &&set{\rm / }show print asm-demangle\cr
-set{\rm / }show caution &&set{\rm / }show confirm\cr
-set{\rm / }show demangle &&set{\rm / }show print demangle\cr
-set{\rm / }show history write &&set{\rm / }show history save\cr
-set{\rm / }show prettyprint &&set{\rm / }show print pretty\cr
-set{\rm / }show screen-height &&set{\rm / }show height\cr
-set{\rm / }show screen-width &&set{\rm / }show width\cr
-set{\rm / }show sevenbit-strings &&set{\rm / }show print sevenbit-strings\cr
-set{\rm / }show unionprint &&set{\rm / }show print union\cr
-set{\rm / }show vtblprint &&set{\rm / }show print vtbl\cr
-\cr
-unset &&\rm(No longer an alias for delete)\cr
-}
-@end tex
-
-@node Installing _GDBN__, Copying, Renamed Commands, Top
-@appendix Installing _GDBN__
-@cindex configuring _GDBN__
-@cindex installation
-
-_GDBN__ comes with a @code{configure} script that automates the process
-of preparing _GDBN__ for installation; you can then use @code{make} to
-build the @code{_GDBP__} program.
-
-The _GDBP__ distribution includes all the source code you need for
-_GDBP__ in a single directory @file{gdb-_GDB_VN__}. That directory in turn
-contains:
-
-@table @code
-@item gdb-_GDB_VN__/configure
-Overall script for configuring _GDBN__ and all its supporting libraries.
-
-@item gdb-_GDB_VN__/gdb
-the source specific to _GDBN__ itself
-
-@item gdb-_GDB_VN__/bfd
-source for the Binary File Descriptor Library
-
-@item gdb-_GDB_VN__/include
-GNU include files
-
-@item gdb-_GDB_VN__/libiberty
-source for the @samp{-liberty} free software library
-
-@item gdb-_GDB_VN__/readline
-source for the GNU command-line interface
-@end table
-@noindent
-Each of these directories has its own @code{configure} script, which are
-used by the overall @code{configure} script in @file{gdb-_GDB_VN__}.
-
-It is most convenient to run @code{configure} from the @file{gdb-_GDB_VN__}
-directory. The simplest way to configure and build _GDBN__ is the
-following:
-@example
-cd gdb-_GDB_VN__
-./configure @var{host}
-make
-@end example
-@noindent
-where @var{host} is something like @samp{sun4} or @samp{decstation}, that
-identifies the platform where _GDBN__ will run. This builds the three
-libraries @file{bfd}, @file{readline}, and @file{libiberty}, then
-@code{gdb} itself. The configured source files, and the binaries, are
-left in the corresponding source directories.
-
-You can install @code{_GDBP__} anywhere; it has no hardwired paths. However,
-you should make sure that the shell on your path (named by the
-@samp{SHELL} environment variable) is publicly readable; some systems
-refuse to let _GDBN__ debug child processes whose programs are not
-readable, and _GDBN__ uses the shell to start your program.
-
-@menu
-* Subdirectories:: Configuration subdirectories
-* Config Names:: Specifying names for hosts and targets
-* configure Options:: Summary of options for configure
-* Formatting Documentation:: How to format and print _GDBN__ documentation
-@end menu
-
-
-@node Subdirectories, Config Names, Installing _GDBN__, Installing _GDBN__
-@section Configuration Subdirectories
-If you want to run _GDBN__ versions for several host or target machines,
-you'll need a different _GDBP__ compiled for each combination of host
-and target. @code{configure} is designed to make this easy by allowing
-you to generate each configuration in a separate subdirectory. If your
-@code{make} program handles the @samp{VPATH} feature (GNU @code{make}
-does), running @code{make} in each of these directories then builds the
-_GDBP__ program specified there.
-
-@code{configure} creates these subdirectories for you when you
-simultaneously specify several configurations; but it's a good habit
-even for a single configuration. You can specify the use of
-subdirectories using the @samp{+subdirs} option (abbreviated
-@samp{+sub}). For example, you can build _GDBN__ on a Sun 4 as follows:
-
-@example
-@group
-cd gdb-_GDB_VN__
-./configure +sub sun4
-cd Host-sparc-sun-sunos4/Target-sparc-sun-sunos4
-make
-@end group
-@end example
-
-When @code{configure} uses subdirectories to build programs or
-libraries, it creates nested directories
-@file{Host-@var{host}/Target-@var{target}}. (As you see in the example,
-the names used for @var{host} and @var{target} may be expanded from your
-@code{configure} argument; @pxref{Config Names}). @code{configure} uses
-these two directory levels because _GDBN__ can be configured for
-cross-compiling: _GDBN__ can run on one machine (the host) while
-debugging programs that run on another machine (the target). You
-specify cross-debugging targets by giving the
-@samp{+target=@var{target}} option to @code{configure}. Specifying only
-hosts still gives you two levels of subdirectory for each host, with the
-same configuration suffix on both; that is, if you give any number of
-hosts but no targets, _GDBN__ will be configured for native debugging on
-each host. On the other hand, whenever you specify both hosts and
-targets on the same command line, @code{configure} creates all
-combinations of the hosts and targets you list.@refill
-
-When you run @code{make} to build a program or library, you must run it
-in a configured directory. If you made a single configuration,
-without subdirectories, run @code{make} in the source directory.
-If you have @file{Host-@var{host}/Target-@var{target}} subdirectories,
-run @code{make} in those subdirectories.
-
-Each @code{configure} and @code{Makefile} under each source directory
-runs recursively, so that typing @code{make} in @file{gdb-_GDB_VN__} (or in a
-@file{gdb-_GDB_VN__/Host-@var{host}/Target-@var{target}} subdirectory)
-builds all the required libraries, then _GDBN__.@refill
-
-If you run @code{configure} from a directory (such as @file{gdb-_GDB_VN__}) that
-contains source directories for multiple libraries or programs,
-@code{configure} creates the @file{Host-@var{host}/Target-@var{target}}
-subdirectories in each library or program's source directory. For
-example, typing:
-@example
-cd gdb-_GDB_VN__
-configure sun4 +target=vxworks960
-@end example
-@noindent
-creates the following directories:
-@smallexample
-gdb-_GDB_VN__/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-gdb-_GDB_VN__/bfd/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-gdb-_GDB_VN__/gdb/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-gdb-_GDB_VN__/libiberty/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-gdb-_GDB_VN__/readline/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-@end smallexample
-@noindent
-The @code{Makefile} in
-@smallexample
-gdb-_GDB_VN__/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-@end smallexample
-@noindent
-will @code{cd} to the appropriate lower-level directories, for example:
-@smallexample
-gdb-_GDB_VN__/bfd/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
-@end smallexample
-@noindent
-building each in turn.
-
-When you have multiple hosts or targets configured, you can run
-@code{make} on them in parallel (for example, if they are NFS-mounted on
-each of the hosts); they will not interfere with each other.
-
-
-@iftex
-@c FIXME isn't there something kinder, gentler than @page?
-@page
-@end iftex
-@node Config Names, configure Options, Subdirectories, Installing _GDBN__
-@section Specifying Names for Hosts and Targets
-
-The specifications used for hosts and targets in the @code{configure}
-script are based on a three-part naming scheme, but some short predefined
-aliases are also supported. The full naming scheme encodes three pieces
-of information in the following pattern:
-@example
-@var{architecture}-@var{vendor}-@var{os}
-@end example
-
-For example, you can use the alias @code{sun4} as a @var{host} argument
-or in a @code{+target=@var{target}} option, but the full name of that
-configuration specifies that the architecture is @samp{sparc}, the
-vendor is @samp{sun}, and the operating system is @samp{sunos4}.
-
-@iftex
-@c I know this is ugly, but @group is useless except in examples now...
-@c (using texinfo 2.52 or so)
-@page
-@end iftex
-
-The following table shows all the architectures, hosts, and OS prefixes
-that @code{configure} recognizes in _GDBN__ _GDB_VN__. Entries in the ``OS
-prefix'' column ending in a @samp{*} may be followed by a release number.
-
-@ifinfo
-@example
-
-ARCHITECTURE VENDOR OS prefix
-------------+-------------+-------------
- | |
- 580 | altos | aix*
- a29k | amdahl | amigados
- alliant | aout | aout
- arm | apollo | bout
- c1 | att | bsd*
- c2 | bull | coff
- cray2 | bcs | ctix*
- h8300 | bout | dynix*
- i386 | cbm | esix*
- i860 | coff | hpux*
- i960 | convergent | irix*
- m68000 | convex | isc*
- m68k | cray | kern
- m88k | dec | mach*
- mips | encore | newsos*
- ns32k | gould | nindy*
- pyramid | hp | none
- romp | ibm | osf*
- rs6000 | intel | sco*
- rtpc | isi | sunos*
- sparc | little | svr4
- tahoe | mips | sym*
- tron | motorola | sysv*
- vax | ncr | ultrix*
- xmp | next | unicos
- ymp | none | unos*
- | nyu | uts
- | sco | v88r*
- | sequent | vms*
- | sgi | vxworks*
- | sony |
- | sun |
- | unicom |
- | utek |
- | wrs |
-
-@end example
-@quotation
-@emph{Warning:} Many combinations of architecture, vendor, and OS are
-untested.
-@end quotation
-@end ifinfo
-@c FIXME: this table is probably screwed in @smallbook. Try setting
-@c FIXME...smallbook fonts?
-@tex
-%\vskip\parskip
-\vskip \baselineskip
-\halign{\hskip\parindent\tt #\hfil &\qquad#&\tt #\hfil &\qquad#&\tt
-#\hfil &\qquad\qquad\it #\hfil\cr
-{\bf Architecture} &&{\bf Vendor} &&{\bf OS prefix}\cr
-\multispan5\hrulefill\cr
- 580 && altos && aix* \cr
- a29k && amdahl && amigados\cr
- alliant && aout && aout \cr
- arm && apollo && bout \cr
- c1 && att && bsd* \cr
- c2 && bull && coff \cr
- cray2 && bcs && ctix* \cr
- h8300 && bout && dynix* \cr
- i386 && cbm && esix* \cr
- i860 && coff && hpux* &Warning: \cr
- i960 && convergent && irix* &Many combinations \cr
- m68000 && convex && isc* &of architecture, vendor \cr
- m68k && cray && kern &and OS are untested. \cr
- m88k && dec && mach* \cr
- mips && encore && newsos* \cr
- ns32k && gould && nindy* \cr
- pyramid && hp && none \cr
- romp && ibm && osf* \cr
- rs6000 && intel && sco* \cr
- rtpc && isi && sunos* \cr
- sparc && little && svr4 \cr
- tahoe && mips && sym* \cr
- tron && motorola && sysv* \cr
- vax && ncr && ultrix* \cr
- xmp && next && unicos \cr
- ymp && none && unos* \cr
- && nyu && uts \cr
- && sco && v88r* \cr
- && sequent && vms* \cr
- && sgi && vxworks*\cr
- && sony &&\cr
- && sun &&\cr
- && unicom &&\cr
- && utek &&\cr
- && wrs &&\cr
-}
-@end tex
-
-The @code{configure} script accompanying _GDBN__ _GDB_VN__ does not provide
-any query facility to list all supported host and target names or
-aliases. @code{configure} calls the Bourne shell script
-@code{config.sub} to map abbreviations to full names; you can read the
-script, if you wish, or you can use it to test your guesses on
-abbreviations---for example:
-@example
-% sh config.sub sun4
-sparc-sun-sunos4
-% sh config.sub sun3
-m68k-sun-sunos4
-% sh config.sub decstation
-mips-dec-ultrix
-% sh config.sub hp300bsd
-m68k-hp-bsd
-% sh config.sub i386v
-i386-none-sysv
-% sh config.sub i486v
-*** No vendor: configuration `i486v' not recognized
-@end example
-
-@node configure Options, Formatting Documentation, Config Names, Installing _GDBN__
-@section @code{configure} Options
-
-Here is a summary of all the @code{configure} options and arguments that
-you might use for building _GDBN__:
-
-@example
-configure @r{[}+destdir=@var{dir}@r{]} @r{[}+subdirs@r{]} @r{[}+norecur@r{]} @r{[}+rm@r{]}
- @r{[}+target=@var{target}@dots{}@r{]} @var{host}@dots{}
-@end example
-@noindent
-You may introduce options with the character @samp{-} rather than
-@samp{+} if you prefer; but you may abbreviate option names if you use
-@samp{+}.
-
-@table @code
-@item +destdir=@var{dir}
-@var{dir} is an installation directory @emph{path prefix}. After you
-configure with this option, @code{make install} will install _GDBN__ as
-@file{@var{dir}/bin/_GDBP__}, and the libraries in @file{@var{dir}/lib}.
-If you specify @samp{+destdir=/usr/local}, for example, @code{make
-install} creates @file{/usr/local/bin/gdb}.@refill
-
-@item +subdirs
-Write configuration specific files in subdirectories of the form
-@example
-Host-@var{host}/Target-@var{target}
-@end example
-@noindent
-(and configure the @code{Makefile} to write binaries there too).
-Without this option, if you specify only one configuration for _GDBN__,
-@code{configure} will use the same directory for source, configured
-files, and binaries. This option is used automatically if you specify
-more than one @var{host} or more than one @samp{+target=@var{target}}
-option on the @code{configure} command line.
-
-@item +norecur
-Configure only the directory where @code{configure} is executed; do not
-propagate configuration to subdirectories.
-
-@item +rm
-Remove the configuration that the other arguments specify.
-
-@c This doesn't work (yet if ever). FIXME.
-@c @item +parse=@var{lang} @dots{}
-@c Configure the _GDBN__ expression parser to parse the listed languages.
-@c @samp{all} configures _GDBN__ for all supported languages. To get a
-@c list of all supported languages, omit the argument. Without this
-@c option, _GDBN__ is configured to parse all supported languages.
-
-@item +target=@var{target} @dots{}
-Configure _GDBN__ for cross-debugging programs running on each specified
-@var{target}. You may specify as many @samp{+target} options as you
-wish. Without this option, _GDBN__ is configured to debug programs that
-run on the same machine (@var{host}) as _GDBN__ itself.
-
-There is no convenient way to generate a list of all available targets.
-
-@item @var{host} @dots{}
-Configure _GDBN__ to run on each specified @var{host}. You may specify as
-many host names as you wish.
-
-There is no convenient way to generate a list of all available hosts.
-@end table
-
-@noindent
-@code{configure} accepts other options, for compatibility with
-configuring other GNU tools recursively; but these are the only
-options that affect _GDBN__ or its supporting libraries.
-
-@node Formatting Documentation, , configure Options, Installing _GDBN__
-@section Formatting the Documentation
-
-@cindex _GDBN__ reference card
-@cindex reference card
-The _GDBN__ _GDB_VN__ release includes an already-formatted reference card,
-ready for printing on a PostScript printer, as @file{gdb-_GDB_VN__/gdb/refcard.ps}.
-It uses the most common PostScript fonts: the Times family, Courier, and
-Symbol. If you have a PostScript printer, you can print the reference
-card by just sending @file{refcard.ps} to the printer.
-
-The release also includes the online Info version of this manual already
-formatted: the main Info file is @file{gdb-_GDB_VN__/gdb/gdb.info}, and it
-refers to subordinate files matching @samp{gdb.info*} in the same
-directory.
-
-If you want to make these Info files yourself from the _GDBN__ manual's
-source, you need the GNU @code{makeinfo} program. Once you have it, you
-can type
-@example
-cd gdb-_GDB_VN__/gdb
-make gdb.info
-@end example
-@noindent
-to make the Info file.
-
-If you want to format and print copies of the manual, you need several
-things:
-@itemize @bullet
-@item
-@TeX{}, the public domain typesetting program written by Donald Knuth,
-must be installed on your system and available through your execution
-path.
-@item
-@file{gdb-_GDB_VN__/texinfo}: @TeX{} macros defining the GNU
-Documentation Format.
-@item
-@emph{A @sc{dvi} output program.} @TeX{} doesn't actually make marks on
-paper; it produces output files called @sc{dvi} files. If your system
-has @TeX{} installed, chances are it has a program for printing out
-these files; one popular example is @code{dvips}, which can print
-@sc{dvi} files on PostScript printers.
-@end itemize
-@noindent
-Once you have these things, you can type
-@example
-cd gdb-_GDB_VN__/gdb
-make gdb.dvi
-@end example
-@noindent
-to format the text of this manual, and print it with the usual output
-method for @TeX{} @sc{dvi} files at your site.
-
-If you want to print the reference card, but don't have a PostScript
-printer, or you want to use Computer Modern fonts instead,
-you can still print it if you have @TeX{}. Format the reference card by typing
-@example
-cd gdb-_GDB_VN__/gdb
-make refcard.dvi
-@end example
-@noindent
-
-The _GDBN__ reference card is designed to print in landscape mode on US
-``letter'' size paper; that is, on a sheet 11 inches wide by 8.5 inches
-high. You will need to specify this form of printing as an option to
-your @sc{dvi} output program.
-
-
-@node Copying, Index, Installing _GDBN__, Top
-@unnumbered GNU GENERAL PUBLIC LICENSE
-@center Version 2, June 1991
-
-@display
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
-675 Mass Ave, Cambridge, MA 02139, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@unnumberedsec Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software---to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
-@iftex
-@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end iftex
-@ifinfo
-@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end ifinfo
-
-@enumerate
-@item
-This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The ``Program'', below,
-refers to any such program or work, and a ``work based on the Program''
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term ``modification''.) Each licensee is addressed as ``you''.
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-@item
-You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-@item
-You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-@alphaenumerate
-@item
-You must cause the modified files to carry prominent notices
-stating that you changed the files and the date of any change.
-
-@item
-You must cause any work that you distribute or publish, that in
-whole or in part contains or is derived from the Program or any
-part thereof, to be licensed as a whole at no charge to all third
-parties under the terms of this License.
-
-@item
-If the modified program normally reads commands interactively
-when run, you must cause it, when started running for such
-interactive use in the most ordinary way, to print or display an
-announcement including an appropriate copyright notice and a
-notice that there is no warranty (or else, saying that you provide
-a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this
-License. (Exception: if the Program itself is interactive but
-does not normally print such an announcement, your work based on
-the Program is not required to print an announcement.)
-@end alphaenumerate
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-@item
-You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-@alphaenumerate
-@item
-Accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of Sections
-1 and 2 above on a medium customarily used for software interchange; or,
-
-@item
-Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
-cost of physically performing source distribution, a complete
-machine-readable copy of the corresponding source code, to be
-distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-
-@item
-Accompany it with the information you received as to the offer
-to distribute corresponding source code. (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form with such
-an offer, in accord with Subsection b above.)
-@end alphaenumerate
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-@item
-You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-@item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-@item
-If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-@item
-If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-@item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-@item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-@iftex
-@heading NO WARRANTY
-@end iftex
-@ifinfo
-@center NO WARRANTY
-@end ifinfo
-
-@item
-BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-@item
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-@end enumerate
-
-@iftex
-@heading END OF TERMS AND CONDITIONS
-@end iftex
-@ifinfo
-@center END OF TERMS AND CONDITIONS
-@end ifinfo
-
-@page
-@unnumberedsec Applying These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the ``copyright'' line and a pointer to where the full notice is found.
-
-@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
-Copyright (C) 19@var{yy} @var{name of author}
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA.
-@end smallexample
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-@smallexample
-Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type `show c' for details.
-@end smallexample
-
-The hypothetical commands @samp{show w} and @samp{show c} should show
-the appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than @samp{show w} and
-@samp{show c}; they could even be mouse-clicks or menu items---whatever
-suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a ``copyright disclaimer'' for the program, if
-necessary. Here is a sample; alter the names:
-
-@example
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-`Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-@var{signature of Ty Coon}, 1 April 1989
-Ty Coon, President of Vice
-@end example
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
-@node Index, , Copying, Top
-@unnumbered Index
-
-@printindex cp
-
-@tex
-% I think something like @colophon should be in texinfo. In the
-% meantime:
-\long\def\colophon{\hbox to0pt{}\vfill
-\centerline{The body of this manual is set in}
-\centerline{\fontname\tenrm,}
-\centerline{with headings in {\bf\fontname\tenbf}}
-\centerline{and examples in {\tt\fontname\tentt}.}
-\centerline{{\it\fontname\tenit\/} and}
-\centerline{{\sl\fontname\tensl\/}}
-\centerline{are used for emphasis.}\vfill}
-\page\colophon
-% Blame: pesch@cygnus.com, 28mar91.
-@end tex
-
-@contents
-@bye
diff --git a/gdb/doc/interim-gdbinv-m.m4 b/gdb/doc/interim-gdbinv-m.m4
deleted file mode 100755
index 8fe5f91..0000000
--- a/gdb/doc/interim-gdbinv-m.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-_dnl__ M4 FRAGMENT: $Id$
-_if__(_I960__)
-* i960-Nindy Remote:: _GDBN__ with a Remote i960 (Nindy)
-_fi__(_I960__)
-_if__(_AMD29K__)
-* EB29K Remote:: _GDBN__ with a Remote EB29K
-_fi__(_AMD29K__)
-_if__(_VXWORKS__)
-* VxWorks Remote:: _GDBN__ and VxWorks
-_fi__(_VXWORKS__)
diff --git a/gdb/doc/interim-gdbinv-s.m4 b/gdb/doc/interim-gdbinv-s.m4
deleted file mode 100755
index 82de97a..0000000
--- a/gdb/doc/interim-gdbinv-s.m4
+++ /dev/null
@@ -1,427 +0,0 @@
-_dnl__ -*- Texinfo -*-
-_dnl__ Copyright (c) 1990 1991 Free Software Foundation, Inc.
-_dnl__ This file is part of the source for the GDB manual.
-@c M4 FRAGMENT $Id$
-@c This text diverted to "Remote Debugging" section in general case;
-@c however, if we're doing a manual specifically for one of these, it
-@c belongs up front (in "Getting In and Out" chapter).
-_if__(_I960__)
-_if__(!_GENERIC__)
-@node i960-Nindy Remote, EB29K Remote, Mode Options, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node i960-Nindy Remote, EB29K Remote, Remote, Remote
-_fi__(_GENERIC__)
-@subsection _GDBN__ with a Remote i960 (Nindy)
-
-@cindex Nindy
-@cindex i960
-@dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When
-_GDBN__ is configured to control a remote Intel 960 using Nindy, you can
-tell _GDBN__ how to connect to the 960 in several ways:
-
-@itemize @bullet
-@item
-Through command line options specifying serial port, version of the
-Nindy protocol, and communications speed;
-
-@item
-By responding to a prompt on startup;
-
-@item
-By using the @code{target} command at any point during your _GDBN__
-session. @xref{Target Commands}.
-
-@end itemize
-
-@menu
-* Nindy Startup:: Startup with Nindy
-* Nindy Options:: Options for Nindy
-* Nindy reset:: Nindy Reset Command
-@end menu
-
-@node Nindy Startup, Nindy Options, i960-Nindy Remote, i960-Nindy Remote
-@subsubsection Startup with Nindy
-
-If you simply start @code{_GDBN__} without using any command-line
-options, you are prompted for what serial port to use, @emph{before} you
-reach the ordinary _GDBN__ prompt:
-@example
-Attach /dev/ttyNN -- specify NN, or "quit" to quit:
-@end example
-@noindent
-Respond to the prompt with whatever suffix (after @samp{/dev/tty})
-identifies the serial port you want to use. You can, if you choose,
-simply start up with no Nindy connection by responding to the prompt
-with an empty line. If you do this, and later wish to attach to Nindy,
-use @code{target} (@pxref{Target Commands}).
-
-@node Nindy Options, Nindy reset, Nindy Startup, i960-Nindy Remote
-@subsubsection Options for Nindy
-
-These are the startup options for beginning your _GDBN__ session with a
-Nindy-960 board attached:
-
-@table @code
-@item -r @var{port}
-Specify the serial port name of a serial interface to be used to connect
-to the target system. This option is only available when _GDBN__ is
-configured for the Intel 960 target architecture. You may specify
-@var{port} as any of: a full pathname (e.g. @samp{-r /dev/ttya}), a
-device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique
-suffix for a specific @code{tty} (e.g. @samp{-r a}).
-
-@item -O
-(An uppercase letter ``O'', not a zero.) Specify that _GDBN__ should use
-the ``old'' Nindy monitor protocol to connect to the target system.
-This option is only available when _GDBN__ is configured for the Intel 960
-target architecture.
-
-@quotation
-@emph{Warning:} if you specify @samp{-O}, but are actually trying to
-connect to a target system that expects the newer protocol, the connection
-will fail, appearing to be a speed mismatch. _GDBN__ will repeatedly
-attempt to reconnect at several different line speeds. You can abort
-this process with an interrupt.
-@end quotation
-
-@item -brk
-Specify that _GDBN__ should first send a @code{BREAK} signal to the target
-system, in an attempt to reset it, before connecting to a Nindy target.
-
-@quotation
-@emph{Warning:} Many target systems do not have the hardware that this
-requires; it only works with a few boards.
-@end quotation
-
-@end table
-
-The standard @samp{-b} option controls the line speed used on the serial
-port.
-
-@node Nindy reset, , Nindy Options, i960-Nindy Remote
-@c @group
-@subsubsection Nindy Reset Command
-@table @code
-@item reset
-@kindex reset
-For a Nindy target, this command sends a ``break'' to the remote target
-system; this is only useful if the target has been equipped with a
-circuit to perform a hard reset (or some other interesting action) when
-a break is detected.
-@end table
-@c @end group
-_fi__(_I960__)
-
-_if__(_AMD29K__)
-_if__(!_GENERIC__)
-@node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Remote
-_fi__(_GENERIC__)
-@subsection _GDBN__ with a Remote EB29K
-
-@cindex EB29K board
-@cindex running 29K programs
-
-To use _GDBN__ from a Unix system to run programs on AMD's EB29K
-board in a PC, you must first connect a serial cable between the PC
-and a serial port on the Unix system. In the following, we assume
-you've hooked the cable between the PC's @file{COM1} port and
-@file{/dev/ttya} on the Unix system.
-
-@menu
-* Comms (EB29K):: Communications Setup
-* _GDBP__-EB29K:: EB29K cross-debugging
-* Remote Log:: Remote Log
-@end menu
-
-@node Comms (EB29K), _GDBP__-EB29K, EB29K Remote, EB29K Remote
-@subsubsection Communications Setup
-The next step is to set up the PC's port, by doing something like the
-following in DOS on the PC:
-_0__@example
-C:\> MODE com1:9600,n,8,1,none
-_1__@end example
-@noindent
-This example---run on an MS DOS 4.0 system---sets the PC port to 9600
-bps, no parity, eight data bits, one stop bit, and no ``retry'' action;
-you must match the communications parameters when establishing the Unix
-end of the connection as well.
-@c FIXME: Who knows what this "no retry action" crud from the DOS manual may
-@c mean? It's optional; leave it out? ---pesch@cygnus.com, 25feb91
-
-To give control of the PC to the Unix side of the serial line, type
-the following at the DOS console:
-_0__@example
-C:\> CTTY com1
-_1__@end example
-@noindent
-(Later, if you wish to return control to the DOS console, you can use
-the command @code{CTTY con}---but you must send it over the device that
-had control, in our example over the @file{COM1} serial line).
-
-From the Unix host, use a communications program such as @code{tip} or
-@code{cu} to communicate with the PC; for example,
-@example
-cu -s 9600 -l /dev/ttya
-@end example
-@noindent
-The @code{cu} options shown specify, respectively, the linespeed and the
-serial port to use. If you use @code{tip} instead, your command line
-may look something like the following:
-@example
-tip -9600 /dev/ttya
-@end example
-@noindent
-Your system may define a different name where our example uses
-@file{/dev/ttya} as the argument to @code{tip}. The communications
-parameters, including what port to use, are associated with the
-@code{tip} argument in the ``remote'' descriptions file---normally the
-system table @file{/etc/remote}.
-@c FIXME: What if anything needs doing to match the "n,8,1,none" part of
-@c the DOS side's comms setup? cu can support -o (odd
-@c parity), -e (even parity)---apparently no settings for no parity or
-@c for character size. Taken from stty maybe...? John points out tip
-@c can set these as internal variables, eg ~s parity=none; man stty
-@c suggests that it *might* work to stty these options with stdin or
-@c stdout redirected... ---pesch@cygnus.com, 25feb91
-
-@kindex EBMON
-Using the @code{tip} or @code{cu} connection, change the DOS working
-directory to the directory containing a copy of your 29K program, then
-start the PC program @code{EBMON} (an EB29K control program supplied
-with your board by AMD). You should see an initial display from
-@code{EBMON} similar to the one that follows, ending with the
-@code{EBMON} prompt @samp{#}---
-_0__@example
-C:\> G:
-
-G:\> CD \usr\joe\work29k
-
-G:\USR\JOE\WORK29K> EBMON
-Am29000 PC Coprocessor Board Monitor, version 3.0-18
-Copyright 1990 Advanced Micro Devices, Inc.
-Written by Gibbons and Associates, Inc.
-
-Enter '?' or 'H' for help
-
-PC Coprocessor Type = EB29K
-I/O Base = 0x208
-Memory Base = 0xd0000
-
-Data Memory Size = 2048KB
-Available I-RAM Range = 0x8000 to 0x1fffff
-Available D-RAM Range = 0x80002000 to 0x801fffff
-
-PageSize = 0x400
-Register Stack Size = 0x800
-Memory Stack Size = 0x1800
-
-CPU PRL = 0x3
-Am29027 Available = No
-Byte Write Available = Yes
-
-# ~.
-_1__@end example
-
-Then exit the @code{cu} or @code{tip} program (done in the example by
-typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} will keep
-running, ready for _GDBN__ to take over.
-
-For this example, we've assumed what is probably the most convenient
-way to make sure the same 29K program is on both the PC and the Unix
-system: a PC/NFS connection that establishes ``drive @code{G:}'' on the
-PC as a file system on the Unix host. If you don't have PC/NFS or
-something similar connecting the two systems, you must arrange some
-other way---perhaps floppy-disk transfer---of getting the 29K program
-from the Unix system to the PC; _GDBN__ will @emph{not} download it over the
-serial line.
-
-@node _GDBP__-EB29K, Remote Log, Comms (EB29K), EB29K Remote
-@subsubsection EB29K cross-debugging
-Finally, @code{cd} to the directory containing an image of your 29K
-program on the Unix system, and start _GDBN__---specifying as argument the
-name of your 29K program:
-@example
-cd /usr/joe/work29k
-_GDBP__ myfoo
-@end example
-Now you can use the @code{target} command:
-@example
-target amd-eb /dev/ttya 9600 MYFOO
-@end example
-@c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to
-@c emphasize that this is the name as seen by DOS (since I think DOS is
-@c single-minded about case of letters). ---pesch@cygnus.com, 25feb91
-
-@noindent
-In this example, we've assumed your program is in a file called
-@file{myfoo}. Note that the filename given as the last argument to
-@code{target amd-eb} should be the name of the program as it appears to DOS.
-In our example this is simply @code{MYFOO}, but in general it can include
-a DOS path, and depending on your transfer mechanism may not resemble
-the name on the Unix side.
-
-At this point, you can set any breakpoints you wish; when you're ready
-to see your program run on the 29K board, use the _GDBN__ command
-@code{run}.
-
-To stop debugging the remote program, use the _GDBN__ @code{detach}
-command.
-
-To return control of the PC to its console, use @code{tip} or @code{cu}
-once again, after your _GDBN__ session has concluded, to attach to
-@code{EBMON}. You can then type the command @code{q} to shut down
-@code{EBMON}, returning control to the DOS command-line interpreter.
-Type @code{CTTY con} to return command input to the main DOS console,
-and type @kbd{~.} to leave @code{tip} or @code{cu}.
-
-@node Remote Log, , _GDBP__-EB29K, EB29K Remote
-@subsubsection Remote Log
-@kindex eb.log
-@cindex log file for EB29K
-The @code{target amd-eb} command creates a file @file{eb.log} in the
-current working directory, to help debug problems with the connection.
-@file{eb.log} records all the output from @code{EBMON}, including echoes
-of the commands sent to it. Running @samp{tail -f} on this file in
-another window often helps to understand trouble with @code{EBMON}, or
-unexpected events on the PC side of the connection.
-_fi__(_AMD29K__)
-
-_if__(_VXWORKS__)
-_if__(!_GENERIC__)
-@node VxWorks Remote, , EB29K Remote, Starting _GDBN__
-_fi__(!_GENERIC__)
-_if__(_GENERIC__)
-@node VxWorks Remote, , EB29K Remote, Remote
-_fi__(_GENERIC__)
-@subsection _GDBN__ and VxWorks
-@cindex VxWorks
-_GDBN__ enables developers to spawn and debug tasks running on networked
-VxWorks targets from a Unix host. Already-running tasks spawned from
-the VxWorks shell can also be debugged. _GDBN__ uses code that runs on
-both the UNIX host and on the VxWorks target. The program
-@code{_GDBP__} is installed and executed on the UNIX host.
-
-The remote debugging interface (RDB) routines are installed and executed
-on the VxWorks target. These routines are included in the VxWorks library
-@file{rdb.a} and are incorporated into the system image when source-level
-debugging is enabled in the VxWorks configuration.
-
-@kindex INCLUDE_RDB
-Defining @code{INCLUDE_RDB} in the VxWorks configuration file
-@file{configAll.h} includes the RDB interface routines and spawns the
-source debugging task @code{tRdbTask} when VxWorks is booted. For more
-information on configuring and remaking VxWorks, see the @cite{VxWorks
-Programmer's Guide}.
-
-Once you have included the RDB interface in your VxWorks system image
-and set your Unix execution search path to find _GDBN__, you are ready
-to run _GDBN__. From your UNIX host, type:
-
-@smallexample
-% _GDBP__
-@end smallexample
-
-_GDBN__ will come up showing the prompt:
-
-@smallexample
-(_GDBP__)
-@end smallexample
-
-@menu
-* VxWorks connection:: Connecting to VxWorks
-* VxWorks download:: VxWorks Download
-* VxWorks attach:: Running Tasks
-@end menu
-
-@node VxWorks connection, VxWorks download, VxWorks Remote, VxWorks Remote
-@subsubsection Connecting to VxWorks
-
-The _GDBN__ command @code{target} lets you connect to a VxWorks target on the
-network. To connect to a target whose host name is ``@code{tt}'', type:
-
-@smallexample
-(_GDBP__) target vxworks tt
-@end smallexample
-
-_GDBN__ will display a message similar to the following:
-
-@smallexample
-Attaching remote machine across net... Success!
-@end smallexample
-
-_GDBN__ will then attempt to read the symbol tables of any object
-modules loaded into the VxWorks target since it was last booted.
-_GDBN__ locates these files by searching the directories listed in the
-command search path (@pxref{Environment}); if it fails to find an
-object file, it will display a message such as:
-
-@smallexample
-prog.o: No such file or directory.
-@end smallexample
-
-This will cause the @code{target} command to abort. When this happens,
-you should add the appropriate directory to the search path, with the
-_GDBN__ command @code{path}, and execute the @code{target} command
-again.
-
-@node VxWorks download, VxWorks attach, VxWorks connection, VxWorks Remote
-@subsubsection VxWorks Download
-
-@cindex download to VxWorks
-If you have connected to the VxWorks target and you want to debug an
-object that has not yet been loaded, you can use the _GDBN__ @code{load}
-command to download a file from UNIX to VxWorks incrementally. The
-object file given as an argument to the @code{load} command is actually
-opened twice: first by the VxWorks target in order to download the code,
-then by _GDBN__ in order to read the symbol table. This can lead to
-problems if the current working directories on the two systems differ.
-It is simplest to set the working directory on both systems to the
-directory in which the object file resides, and then to reference the
-file by its name, without any path. Thus, to load a program
-@file{prog.o}, residing in @file{wherever/vw/demo/rdb}, on VxWorks type:
-
-@smallexample
--> cd "wherever/vw/demo/rdb"
-@end smallexample
-
-On _GDBN__ type:
-
-@smallexample
-(_GDBP__) cd wherever/vw/demo/rdb
-(_GDBP__) load prog.o
-@end smallexample
-
-_GDBN__ will display a response similar to the following:
-
-@smallexample
-Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
-@end smallexample
-
-You can also use the @code{load} command to reload an object module
-after editing and recompiling the corresponding source file. Note that
-this will cause _GDBN__ to delete all currently-defined breakpoints,
-auto-displays, and convenience variables, and to clear the value
-history. (This is necessary in order to preserve the integrity of
-debugger data structures that reference the target system's symbol
-table.)
-
-@node VxWorks attach, , VxWorks download, VxWorks Remote
-@subsubsection Running Tasks
-
-@cindex running VxWorks tasks
-You can also attach to an existing task using the @code{attach} command as
-follows:
-
-@smallexample
-(_GDBP__) attach @var{task}
-@end smallexample
-
-where @var{task} is the VxWorks hexadecimal task ID. The task can be running
-or suspended when you attach to it. If running, it will be suspended at
-the time of attachment.
-
-_fi__(_VXWORKS__)
diff --git a/gdb/doc/m680x0.m4 b/gdb/doc/m680x0.m4
deleted file mode 100644
index e5f83b6..0000000
--- a/gdb/doc/m680x0.m4
+++ /dev/null
@@ -1,5 +0,0 @@
-_divert__(-1)
-_define__(<_M680X0__>,<1>)
-_define__(<_HOST__>,<Motorola 680x0>)
-_define__(<_MACH_DEP__>,<M680x0 Dependent>)
-_divert__<> \ No newline at end of file
diff --git a/gdb/doc/none.m4 b/gdb/doc/none.m4
deleted file mode 100644
index 940245c..0000000
--- a/gdb/doc/none.m4
+++ /dev/null
@@ -1,49 +0,0 @@
-_divert__(-1)
-
-Switches:
-
-_define__(<_ALL_ARCH__>,<0>) (Meant as most inclusive; file turning
- it on is expected to also turn on
- all arch-related switches including
- "_GENERIC__")
-_define__(<_GENERIC__>,<1>) (may not be quite all configs;
- meant for "most vanilla" manual)
-_define__(<_INTERNALS__>,<0>)
-
-_define__(<_AOUT__>,<1>) Object formats. Note we turn on one.
-_define__(<_BOUT__>,<0>)
-_define__(<_COFF__>,<0>)
-_define__(<_ELF__>,<0>)
-
-_define__(<_AMD29K__>,<0>) Specific architectures. Note none
-_define__(<_I80386__>,<0>) starts out on.
-_define__(<_I960__>,<0>)
-_define__(<_M680X0__>,<0>)
-_define__(<_SPARC__>,<0>)
-_define__(<_VAX__>,<0>)
-_define__(<_VXWORKS__>,<0>)
-
-Text:
-
-Default names; individual configs may override
-Assembler:
-_define__(<_AS__>,<as>)
-C Compiler:
-_define__(<_GCC__>,<gcc>)
-Linker:
-_define__(<_LD__>,<ld>)
-Debugger name:
-_define__(<_GDBN__>,<GDB>)
-Debugger program:
-_define__(<_GDBP__>,<gdb>)
-Debugger init file:
-_define__(<_GDBINIT__>,<.gdbinit>)
-
-Text for host; individual configs *should* override, but this may
-catch some flubs
-_define__(<_HOST__>,<machine specific>)
-
-"Machine Dependent" nodename
-_define__(<_MACH_DEP__>,<Machine Dependent>)
-
-_divert__<> \ No newline at end of file
diff --git a/gdb/doc/pretex.m4 b/gdb/doc/pretex.m4
deleted file mode 100644
index 40c3d26..0000000
--- a/gdb/doc/pretex.m4
+++ /dev/null
@@ -1,268 +0,0 @@
-divert(-1) -*-Text-*-
-` Copyright (c) 1991 Free Software Foundation, Inc.'
-` This file defines and documents the M4 macros used '
-` to preprocess some GNU manuals'
-` $Id$'
-
-I. INTRODUCTION
-
-This collection of M4 macros is meant to help in pre-processing texinfo
-files to allow configuring them by hosts; for example, the reader of an
-as manual who only has access to a 386 may not really want to see crud about
-VAXen.
-
-A preprocessor is used, rather than extending texinfo, because this
-way we can hack the conditionals in only one place; otherwise we would
-have to write TeX macros, update makeinfo, and update the Emacs
-info-formatting functions.
-
-II. COMPATIBILITY
-
-These macros should work with GNU m4 and System V m4; they do not work
-with Sun or Berkeley M4.
-
-III. USAGE
-
-A. M4 INVOCATION
-Assume this file is called "pretex.m4". Then, to preprocess a
-document "mybook.texinfo" you might do something like the following:
-
- m4 pretex.m4 none.m4 PARTIC.m4 mybook.texinfo >mybook-PARTIC.texinfo
-
----where your path is set to find GNU or SysV "m4", and the other m4
-files mentioned are as follows:
-
- none.m4: A file that defines, as 0, all the options you might
- want to turn on using the conditionals defined below.
- Unlike the C preprocessor, m4 does not default
- undefined macros to 0. For example, here is a "none.m4"
- I have been using:
- _divert__(-1)
-
- _define__(<_ALL_ARCH__>,<0>)
- _define__(<_INTERNALS__>,<0>)
-
- _define__(<_AMD29K__>,<0>)
- _define__(<_I80386__>,<0>)
- _define__(<_I960__>,<0>)
- _define__(<_M680X0__>,<0>)
- _define__(<_SPARC__>,<0>)
- _define__(<_VAX__>,<0>)
-
- _divert__<>
-
- PARTIC.m4: A file that turns on whichever options you actually
- want the manual configured for, in this particular
- instance. Its contents are similar to one or more of
- the lines in "none.m4", but of course the second
- argument to _define__ is <1> rather than <0>.
-
- This is also a convenient place to _define__ any macros
- that you want to expand to different text for
- different configurations---for example, the name of
- the program being described.
-
-Naturally, these are just suggested conventions; you could put your macro
-definitions in any files or combinations of files you like.
-
-These macros use the characters < and > as m4 quotes; if you need
-these characters in your text, you will also want to use the macros
-_0__ and _1__ from this package---see the description of "Quote
-Handling" in the "Implementation" section below.
-
-B. WHAT GOES IN THE PRE-TEXINFO SOURCE
-
-For the most part, the text of your book. In addition, you can
-have text that is included only conditionally, using the macros
-_if__ and _fi__ defined below. They BOTH take an argument! This is
-primarily meant for readability (so a human can more easily see what
-conditional end matches what conditional beginning), but the argument
-is actually used in the _fi__ as well as the _if__ implementation.
-You should always give a _fi__ the same argument as its matching
-_if__. Other arguments may appear to work for a while, but are almost
-certain to produce the wrong output for some configurations.
-
-For example, here is an excerpt from the very beginning of the
-documentation for GNU as, to name the info file appropriately for
-different configurations:
- _if__(_ALL_ARCH__)
- @setfilename as.info
- _fi__(_ALL_ARCH__)
- _if__(_M680X0__ && !_ALL_ARCH__)
- @setfilename as-m680x0.info
- _fi__(_M680X0__ && !_ALL_ARCH__)
- _if__(_AMD29K__ && !_ALL_ARCH__)
- @setfilename as-29k.info
- _fi__(_AMD29K__ && !_ALL_ARCH__)
-
-Note that you can use Boolean expressions in the arguments; the
-expression language is that of the built-in m4 macro `eval', described
-in the m4 manual.
-
-IV. IMPLEMENTATION
-
-A.PRIMITIVE RENAMING
-First, we redefine m4's built-ins to avoid conflict with plain text.
-The naming convention used is that our macros all begin with a single
-underbar and end with two underbars. The asymmetry is meant to avoid
-conflict with some other conventions (which we may want to document) that
-are intended to avoid conflict, like ANSI C predefined macros.
-
-define(`_undefine__',defn(`undefine'))
-define(`_define__',defn(`define'))
-define(`_defn__',defn(`defn'))
-define(`_ppf__',`_define__(`_$1__',_defn__(`$1'))_undefine__(`$1')')
-_ppf__(`builtin')
-_ppf__(`changecom')
-_ppf__(`changequote')
-_ppf__(`decr')
-_ppf__(`define')
-_ppf__(`defn')
-_ppf__(`divert')
-_ppf__(`divnum')
-_ppf__(`dnl')
-_ppf__(`dumpdef')
-_ppf__(`errprint')
-_ppf__(`esyscmd')
-_ppf__(`eval')
-_ppf__(`format')
-_ppf__(`ifdef')
-_ppf__(`ifelse')
-_ppf__(`include')
-_ppf__(`incr')
-_ppf__(`index')
-_ppf__(`len')
-_ppf__(`m4exit')
-_ppf__(`m4wrap')
-_ppf__(`maketemp')
-_ppf__(`patsubst')
-_ppf__(`popdef')
-_ppf__(`pushdef')
-_ppf__(`regexp')
-_ppf__(`shift')
-_ppf__(`sinclude')
-_ppf__(`substr')
-_ppf__(`syscmd')
-_ppf__(`sysval')
-_ppf__(`traceoff')
-_ppf__(`traceon')
-_ppf__(`translit')
-_ppf__(`undefine')
-_ppf__(`undivert')
-_ppf__(`unix')
-
-B. QUOTE HANDLING.
-
-The characters used as quotes by M4, by default, are unfortunately
-quite likely to occur in ordinary text. To avoid surprises, we will
-use the characters <> ---which are just as suggestive (more so to
-Francophones, perhaps) but a little less common in text (save for
-those poor Francophones. You win some, you lose some). Still, we
-expect also to have to set < and > occasionally in text; to do that,
-we define a macro to turn off quote handling (_0__) and a macro to
-turn it back on (_1__), according to our convention.
-
- BEWARE: This seems to make < and > unusable as relational operations
- in calls to the builtin "eval". So far I've gotten
- along without; but a better choice may be possible.
-
-Note that we postponed this for a while, for convenience in discussing
-the issue and in the primitive renaming---not to mention in defining
-_0__ and _1__ themselves! However, the quote redefinitions MUST
-precede the _if__ / _fi__ definitions, because M4 will expand the text
-as given---if we use the wrong quotes here, we will get the wrong
-quotes when we use the conditionals.
-
-_define__(_0__,`_changequote__(,)')_define__(_1__,`_changequote__(<,>)')
-_1__
-
-C. CONDITIONALS
-
-We define two macros, _if__ and _fi__. BOTH take arguments! This is
-meant both to help the human reader match up a _fi__ with its
-corresponding _if__ and to aid in the implementation. You may use the
-full expression syntax supported by M4 (see docn of `eval' builtin in
-the m4 manual).
-
-The conditional macros are carefully defined to avoid introducing
-extra whitespace (i.e., blank lines or blank characters). One side
-effect exists---
-
- BEWARE: text following an `_if__' on the same line is
- DISCARDED even if the condition is true; text
- following a `_fi__' on the same line is also
- always discarded.
-
-The recommended convention is to always place _if__ and _fi__ on a
-line by themselves. This will also aid the human reader. TeX won't
-care about the line breaks; as for info, you may want to insert calls
-to `@refill' at the end of paragraphs containing conditionalized text,
-where you don't want line breaks separating unconditional from
-conditional text. info formatting will then give you nice looking
-paragraphs in the info file.
-
-Nesting: conditionals are designed to nest, in the following way:
-*nothing* is output between an outer pair of false conditionals, even
-if there are true conditionals inside. A false conditional "defeats"
-all conditionals within it. The counter _IF_FS__ is used to
-implement this; kindly avoid redefining it directly.
-
-_define__(<_IF_FS__>,<0>)
-
-NOTE: The definitions for our "pushf" and "popf" macros use eval
-rather than incr and decr, because GNU m4 (0.75) tries to call eval
-for us when we say "incr" or "decr"---but doesn't notice we've changed
-eval's name.
-
-_define__(
- <_pushf__>,
- <_define__(<_IF_FS__>,
- _eval__((_IF_FS__)+1))>)
-_define__(
- <_popf__>,
- <_ifelse__(0,_IF_FS__,
- <<>_dnl__<>>,
- <_define__(<_IF_FS__>,_eval__((_IF_FS__)-1))>)>)
-
-_define__(
- <_if__>,
- <_ifelse__(1,_eval__( ($1) ),
- <<>_dnl__<>>,
- <_pushf__<>_divert__(-1)>)>)
-_define__(
- <_fi__>,
- <_ifelse__(1,_eval__( ($1) ),
- <<>_dnl__<>>,
- <_popf__<>_ifelse__(0,_IF_FS__,
- <_divert__<>_dnl__<>>,<>)>)>)
-
-D. CHAPTER/SECTION MACRO
-In a parametrized manual, the heading level may need to be calculated;
-for example, a manual that has a chapter on machine dependencies
-should be conditionally structured as follows:
- - IF the manual is configured for a SINGLE machine type, use
-the chapter heading for that machine type, and run headings down
-from there (top level for a particular machine is chapter, then within
-that we have section, subsection etc);
- - ELSE, if MANY machine types are described in the chapter,
-use a generic chapter heading such as "@chapter Machine Dependencies",
-use "section" for the top level description of EACH machine, and run
-headings down from there (top level for a particular machine is
-section, then within that we have subsection, subsubsection etc).
-
-The macro <_CHAPSEC__> is for this purpose: its argument is evaluated (so
-you can construct expressions to express choices such as above), then
-expands as follows:
- 0: @chapter
- 1: @section
- 2: @subsection
- 3: @subsubsection
- ...and so on.
-
-_define__(<_CHAPSEC__>,<@_cs__(_eval__($1))>)
-_define__(<_cs__>,<_ifelse__(
- 0, $1, <chapter>,
- 1, $1, <section>,
- <sub<>_cs__(_eval__($1 - 1))>)>)
-
-_divert__<>_dnl__<>
diff --git a/gdb/doc/rc-cm.tex b/gdb/doc/rc-cm.tex
deleted file mode 100755
index 1b44a07..0000000
--- a/gdb/doc/rc-cm.tex
+++ /dev/null
@@ -1,22 +0,0 @@
-% $Id$
-% To choose CM (Computer Modern) fonts for the refcard, link
-% or copy this file to rcfonts.tex
-%
-%The Times-Roman family is both more attractive and more compact than
-%Computer Modern. On the other hand, while common, it is not free.
-%There are three sets of font definitions:
-% 1) rc-cm.tex uses the free (Computer Modern) fonts
-% 2) rc-ps.tex uses common PostScript fonts, with fontnames from the
-% Karl Berry scheme recommended in the documentation for dvips.
-% 3) rc-pslong.tex uses common PostScript fonts, with the long names
-% used by PostScript programs directly.
-%
-%-------------------- Computer Modern font defs: --------------------
-\font\bbf=cmbx10
-\font\vbbf=cmbx12
-\font\smrm=cmr5
-\font\brm=cmr10
-\font\rm=cmr7
-\font\it=cmti7
-\font\tt=cmtt8
-%-------------------- end font defs ---------------------------------
diff --git a/gdb/doc/rc-ps.tex b/gdb/doc/rc-ps.tex
deleted file mode 100755
index 1a0e970..0000000
--- a/gdb/doc/rc-ps.tex
+++ /dev/null
@@ -1,30 +0,0 @@
-% $Id$
-% To choose PS fonts (Karl Berry TeX fontnames) for the refcard, link
-% or copy this file to rcfonts.tex
-%
-%The Times-Roman family is both more attractive and more compact than
-%Computer Modern. On the other hand, while common, it is not free.
-%There are three sets of font definitions:
-% 1) rc-cm.tex uses the free (Computer Modern) fonts
-% 2) rc-ps.tex uses common PostScript fonts, with fontnames from the
-% Karl Berry scheme recommended in the documentation for dvips.
-% 3) rc-pslong.tex uses common PostScript fonts, with the long names
-% used by PostScript programs directly.
-%
-% One caution: due to differing character ordering between TeX and PS,
-%if your TeX is pre-3.0, or if you don't have virtual Courier
-%matching the TeX character positions, you might want to use CMtt for
-%\tt even if you switch to PostScript fonts for the rest of the text.
-%
-%-------------------- PostScript fonts (K Berry names) --------------
-\font\bbf=ptmb at 10pt
-\font\vbbf=ptmb at 12pt
-\font\smrm=ptmr at 6pt
-\font\brm=ptmr at 10pt
-\font\rm=ptmr at 8pt
-\font\it=ptmri at 8pt
-\font\tt=pcrr at 8pt
-% Used only for \copyright, replacing plain TeX macro.
-\font\sym=psyr at 7pt
-\def\copyright{{\sym\char'323}}
-%-------------------- end font defs ---------------------------------
diff --git a/gdb/doc/rc-pslong.tex b/gdb/doc/rc-pslong.tex
deleted file mode 100755
index 24643d1..0000000
--- a/gdb/doc/rc-pslong.tex
+++ /dev/null
@@ -1,30 +0,0 @@
-% $Id$
-% To choose PS fonts (long PS fontnames) for the refcard, link
-% or copy this file to rcfonts.tex
-%
-%The Times-Roman family is both more attractive and more compact than
-%Computer Modern. On the other hand, while common, it is not free.
-%There are three sets of font definitions:
-% 1) rc-cm.tex uses the free (Computer Modern) fonts
-% 2) rc-ps.tex uses common PostScript fonts, with fontnames from the
-% Karl Berry scheme recommended in the documentation for dvips.
-% 3) rc-pslong.tex uses common PostScript fonts, with the long names
-% used by PostScript programs directly.
-%
-% One caution: due to differing character ordering between TeX and PS,
-%if your TeX is pre-3.0, or if you don't have virtual Courier
-%matching the TeX character positions, you might want to use CMtt for
-%\tt even if you switch to PostScript fonts for the rest of the text.
-%
-%-------------------- PostScript fonts (long names) -----------------
-\font\bbf=Times-Bold at 10pt
-\font\vbbf=Times-Bold at 12pt
-\font\smrm=Times-Roman at 6pt
-\font\brm=Times-Roman at 10pt
-\font\rm=Times-Roman at 8pt
-\font\it=Times-Italic at 8pt
-\font\tt=Courier at 8pt
-% Used only for \copyright, replacing plain TeX macro.
-\font\sym=Symbol at 7pt
-\def\copyright{{\sym\char'323}}
-%-------------------- end font defs ---------------------------------
diff --git a/gdb/doc/rdl-apps.texi b/gdb/doc/rdl-apps.texi
deleted file mode 100755
index 28fd2ba..0000000
--- a/gdb/doc/rdl-apps.texi
+++ /dev/null
@@ -1,2 +0,0 @@
-@include ./../../readline/inc-read.texi
-@include ./../../readline/inc-hist.texi
diff --git a/gdb/doc/refcard.tex b/gdb/doc/refcard.tex
deleted file mode 100644
index 0c24e8f..0000000
--- a/gdb/doc/refcard.tex
+++ /dev/null
@@ -1,465 +0,0 @@
-%This file is TeX source for a reference card describing GDB, the GNU debugger.
-%$Id$
-%Copyright (C) 1991 Free Software Foundation, Inc.
-%Permission is granted to make and distribute verbatim copies of
-%this reference provided the copyright notices and permission notices
-%are preserved on all copies.
-%
-%TeX markup is a programming language; accordingly this file is source
-%for a program to generate a reference.
-%
-%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 1, 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 can find a copy of the GNU General Public License in the GDB
-%manual; or write to the Free Software Foundation, Inc.,
-%675 Mass Ave, Cambridge, MA 02139, USA.
-%
-%You can contact the author as: pesch@cygnus.com
-%
-% Roland Pesch
-% Cygnus Support
-% 814 University Ave.
-% Palo Alto, CA 94301 USA
-%
-% +1 415 322 3811
-%
-% Cygnus Support is an organization devoted to commercial
-% support of free software. For general information
-% contact ``info@cygnus.com''
-%
-% NOTE ON INTENTIONAL OMISSIONS: This reference card includes most GDB
-% commands, but due to space constraints there are some things I chose
-% to omit. In general, not all synonyms for commands are covered.
-% The GDB-under-Emacs section omits gdb-mode functions without default
-% keybindings. GDB startup options are not described.
-% set print sevenbit-strings, set symbol-reloading omitted.
-% set check range/type omitted at least til code is in GDB.
-%
-{%
-\def\$#1${{#1}}% Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision$}%
-}%
-\input threecol
-\input rcfonts
-%
-\vsize=8in
-\hyphenpenalty=5000\tolerance=2000\raggedright\raggedbottom
-\normalbaselineskip=9pt\baselineskip=9pt
-%
-\parindent=0pt
-\parskip=0pt
-\footline={\vbox to0pt{\hss}}
-%
-\def\ctl#1{{\tt C-#1}}
-\def\opt#1{{\brm[{\rm #1}]}}
-\def\xtra#1{\noalign{\smallskip{\tt#1}}}
-%
-\long\def\sec#1;#2\endsec{\vskip 1pc
-\halign{%
-%COL 1 (of halign):
-\vtop{\hsize=1.1in\tt
-##\par\vskip 2pt }\hfil
-%COL 2 (of halign):
-&\vtop{\hsize=2.1in\hangafter=1\hangindent=0.5em
-\rm ##\par\vskip 2pt}\cr
-%Tail of \long\def fills in halign body with \sec args:
-\noalign{{\bbf #1}\vskip 2pt}
-#2
-}
-}
-
-{\vbbf GDB QUICK REFERENCE}
-\vskip 5pt
-{\smrm GDB Version 4.2---Cygnus Support 1991}
-
-\sec Essential Commands;
-gdb {\it program} \opt{{\it core}}&debug {\it program} \opt{using
-coredump {\it core}}\cr
-b \opt{\it file\tt:}{\it function}&set breakpoint at {\it function} \opt{in \it file}\cr
-run \opt{{\it arglist}}&start your program \opt{with {\it arglist}}\cr
-bt& backtrace: display program stack\cr
-p {\it expr}&display the value of an expression\cr
-c &continue running your program\cr
-n &next line, stepping over function calls\cr
-s &next line, stepping into function calls\cr
-\endsec
-
-\sec Starting GDB;
-gdb&starts GDB, with no debugging files\cr
-gdb {\it program}&begin debugging {\it program}\cr
-gdb {\it program core}&debug coredump {\it core} produced by {\it program}\cr
-\endsec
-
-\sec Stopping GDB;
-quit&exit GDB; also {\tt q} or {\tt EOF} (eg \ctl{d})\cr
-INTERRUPT&(eg \ctl{c}) terminate current command, or send to running process\cr
-\endsec
-
-\sec Getting Help;
-help&list classes of commands\cr
-help {\it class}&one-line descriptions for commands in {\it class}\cr
-help {\it command}&describe {\it command}\cr
-\endsec
-
-\sec Executing your Program;
-run {\it arglist}&start your program with {\it arglist}\cr
-run&start your program with current argument list\cr
-run $\ldots$ <{\it inf} >{\it outf}&start program with input, output
-redirected\cr
-\cr
-kill&kill running program\cr
-\cr
-tty {\it dev}&use {\it dev} as stdin and stdout for next {\tt run}\cr
-set args {\it arglist}&specify {\it arglist} for next
-{\tt run}\cr
-set args&specify empty argument list\cr
-show args&display argument list\cr
-\cr
-show environment&show all environment variables\cr
-show env {\it var}&show value of environment variable {\it var}\cr
-set env {\it var} {\it string}&set environment variable {\it var}\cr
-unset env {\it var}&remove {\it var} from environment\cr
-\endsec
-
-\sec Shell Commands;
-cd {\it dir}&change working directory to {\it dir}\cr
-pwd&Print working directory\cr
-make $\ldots$&call ``{\tt make}''\cr
-shell {\it cmd}&execute arbitrary shell command string\cr
-\endsec
-
-\vfill
-\centerline{\smrm \copyright 1991 Free Software Foundation, Inc.\qquad Permissions on back}
-\eject
-\sec Breakpoints and Watchpoints;
-break \opt{\it file\tt:}{\it line}\par
-b \opt{\it file\tt:}{\it line}&set breakpoint at {\it line} number \opt{in \it file}\par
-eg:\quad{\tt break main.c:37}\quad\cr
-break \opt{\it file\tt:}{\it function}&set breakpoint at {\it
-function} \opt{in \it file}\cr
-break +{\it offset}\par
-break -{\it offset}&set break at {\it offset} lines from current stop\cr
-break *{\it addr}&set breakpoint at address {\it addr}\cr
-break&set breakpoint at next instruction\cr
-break $\ldots$ if {\it expr}&break conditionally on nonzero {\it expr}\cr
-cond {\it n} \opt{\it expr}&new conditional expression on breakpoint
-{\it n}; make unconditional if no {\it expr}\cr
-tbreak $\ldots$&temporary break; disable when reached\cr
-rbreak {\it regex}&break on all functions matching {\it regex}\cr
-watch {\it expr}&set a watchpoint for expression {\it expr}\cr
-catch {\it x}&break at C++ handler for exception {\it x}\cr
-\cr
-info break&show defined breakpoints\cr
-info watch&show defined watchpoints\cr
-\cr
-clear&delete breakpoints at next instruction\cr
-clear \opt{\it file\tt:}{\it fun}&delete breakpoints at entry to {\it fun}()\cr
-clear \opt{\it file\tt:}{\it line}&delete breakpoints on source line \cr
-delete \opt{{\it n}}&delete breakpoints {\it n};
-\opt{or all breakpoints}\cr
-\cr
-disable \opt{{\it n}}&disable breakpoints {\it n} \opt{or all}\cr
-enable \opt{{\it n}}&enable breakpoints {\it n} \opt{or all}\cr
-enable once \opt{{\it n}}&enable breakpoints; disable again when
-reached\cr
-enable del \opt{{\it n}}&enable breakpoints; delete when reached\cr
-\cr
-ignore {\it n} {\it count}&ignore breakpoint {\it n}, {\it count}
-times\cr
-\cr
-commands {\it n}\par
-\qquad {\it command list}&execute GDB {\it command list} every time breakpoint {\it n} is reached\cr
-end&end of {\it command list}\cr
-\endsec
-
-\sec Program Stack;
-backtrace \opt{\it n}\par
-bt \opt{\it n}&print trace of all frames in stack; or of {\it n}
-frames---innermost if {\it n}{\tt >0}, outermost if {\it n}{\tt <0}\cr
-frame \opt{\it n}&select frame number {\it n} or frame at address {\it
-n}; if no {\it n}, display current frame\cr
-up {\it n}&select frame {\it n} frames up\cr
-down {\it n}&select frame {\it n} frames down\cr
-info frame \opt{\it addr}&describe selected frame, or frame at
-{\it addr}\cr
-info args&arguments of selected frame\cr
-info locals&local variables of selected frame\cr
-info reg \opt{\it{rn}}&register values \opt{for reg {\it rn\/}} in selected frame\cr
-info catch&exception handlers active in selected frame\cr
-\endsec
-
-\vfill\eject
-\sec Execution Control;
-continue \opt{\it count}\par
-c \opt{\it count}&continue running; if {\it count} specified, ignore
-this breakpoint next {\it count} times\cr
-\cr
-step \opt{\it count}\par
-s \opt{\it count}&execute until another line reached; repeat {\it count} times if
-specified\cr
-\cr
-stepi \opt{\it count}\par
-si \opt{\it count}&step by machine instructions rather than source
-lines\cr
-\cr
-next \opt{\it count}\par
-n \opt{\it count}&execute next line, including any function calls\cr
-\cr
-nexti \opt{\it count}\par
-ni \opt{\it count}&next machine instruction rather than source
-line\cr
-\cr
-until \opt{\it location}&run until next instruction (or {\it
-location})\cr
-finish&run until selected stack frame returns\cr
-return \opt{\it expr}&pop selected stack frame without executing
-\opt{setting return value}\cr
-signal {\it num}&resume execution with signal {\it s} (none if {\tt 0})\cr
-jump {\it line}\par
-jump *{\it address}&resume execution at specified {\it line} number or
-{\it address}\cr
-set var={\it expr}&evaluate {\it expr} without displaying it; use for
-altering program variables\cr
-\endsec
-
-\sec Display;
-print \opt{\tt/{\it f}\/} {\it expr}\par
-p \opt{\tt/{\it f}\/} {\it expr}&show value of {\it expr} according to format {\it f}:\cr
-\qquad x&hexadecimal\cr
-\qquad d&signed decimal\cr
-\qquad u&unsigned decimal\cr
-\qquad o&octal\cr
-\qquad a&address, absolute and relative\cr
-\qquad c&character\cr
-\qquad f&floating point\cr
-call \opt{\tt /{\it f}\/} {\it expr}&like {\tt print} but does not display
-{\tt void}\cr
-x \opt{\tt/{\it Nuf}\/} {\it expr}&examine memory at address {\it expr};
-optional format spec follows slash\cr
-\quad {\it N}&count of how many units to display\cr
-\quad {\it u}&unit size; one of\cr
-&{\tt\qquad b}\ individual bytes\cr
-&{\tt\qquad h}\ halfwords (two bytes)\cr
-&{\tt\qquad w}\ words (four bytes)\cr
-&{\tt\qquad g}\ giant words (eight bytes)\cr
-\quad {\it f}&printing format. Any {\tt print} format, or\cr
-&{\tt\qquad s}\ null-terminated string\cr
-&{\tt\qquad i}\ machine instructions\cr
-disassem \opt{\it addr}&display memory as machine instructions\cr
-\endsec
-
-\sec Automatic Display;
-display \opt{\tt/\it f\/} {\it expr}&show value of {\it expr} each time
-program stops \opt{according to format {\it f}\/}\cr
-display&display all enabled expressions on list\cr
-undisplay {\it n}&remove number(s) {\it n} from list of
-automatically displayed expressions\cr
-disable disp {\it n}&disable display for expression(s) number {\it
-n}\cr
-enable disp {\it n}&enable display for expression(s) number {\it
-n}\cr
-info display&numbered list of display expressions\cr
-\endsec
-
-\vfill\eject
-
-\sec Expressions;
-{\it expr}&an expression in C, C++, or Modula-2 (including function calls), or:\cr
-{\it addr\/}@{\it len}&an array of {\it len} elements beginning at {\it
-addr}\cr
-{\it file}::{\it nm}&a variable or function {\it nm} defined in {\it
-file}\cr
-$\tt\{${\it type}$\tt\}${\it addr}&read memory at {\it addr} as specified
-{\it type}\cr
-\$&most recent displayed value\cr
-\${\it n}&{\it n}th displayed value\cr
-\$\$&displayed value previous to \$\cr
-\$\${\it n}&{\it n}th displayed value back from \$\cr
-\$\_&last address examined with {\tt x}\cr
-\$\_\_&value at address \$\_\cr
-\${\it var}&convenience variable; assign any value\cr
-\cr
-show values \opt{{\it n}}&show last 10 values \opt{or surrounding
-\${\it n}}\cr
-show convenience&display all convenience variables\cr
-\endsec
-
-\sec Symbol Table;
-info address {\it s}&show where symbol {\it s} is stored\cr
-info func \opt{\it regex}&show names, types of defined functions
-(all, or matching {\it regex})\cr
-info var \opt{\it regex}&show names, types of global variables (all,
-or matching {\it regex})\cr
-whatis {\it expr}\par
-ptype {\it expr}&show data type of {\it expr} without evaluating; {\tt
-ptype} gives more detail\cr
-ptype {\it type}&describe type, struct, union, or enum\cr
-\endsec
-
-\sec GDB Scripts;
-source {\it script}&read, execute GDB commands from file {\it
-script}\cr
-\cr
-define {\it cmd}\par
-\qquad {\it command list}&new GDB command {\it cmd}, executes script
-defined by {\it command list} \cr
-end&end of {\it command list}\cr
-document {\it cmd}\par
-\qquad {\it help text}&new online documentation for GDB command {\it
-cmd}\cr
-end&end of {\it help text}\cr
-\endsec
-
-\sec Signals;
-handle {\it signal} {\it act}&specify GDB actions for {\it signal}:\cr
-\quad print&announce signal\cr
-\quad noprint&be silent for signal\cr
-\quad stop&halt execution on signal\cr
-\quad nostop&do not halt execution\cr
-\quad pass&allow your program to handle signal\cr
-\quad nopass&do not allow your program to see signal\cr
-info signals&show table of signals, GDB action for each\cr
-\endsec
-
-\sec Debugging Targets;
-target {\it type} {\it param}&connect to target machine, process, or file\cr
-help target&display available targets\cr
-attach {\it param}&connect to another process\cr
-detach&release target from GDB control\cr
-\endsec
-
-\vfill\eject
-\sec Controlling GDB;
-set {\it param} {\it value}&set one of GDB's internal parameters\cr
-show {\it param}&display current setting of a GDB parameter\cr
-\xtra{\rm Parameters understood by {\tt set} and {\tt show}:}
-\quad complaints {\it limit}&number of messages on unusual symbols\cr
-\quad confirm {\it on/off}&enable or disable cautionary queries\cr
-\quad editing {\it on/off}&control {\tt readline} command-line editing\cr
-\quad height {\it lpp}&number of lines before pause in display\cr
-\quad language {\it lang}&Language for GDB expressions ({\tt auto}, {\tt c} or
-{\tt modula-2})\cr
-\quad listsize {\it n}&number of lines shown by {\tt list}\cr
-\quad prompt {\it str}&use {\it str} as GDB prompt\cr
-\quad radix {\it base}&octal, decimal, or hex number representation\cr
-\quad verbose {\it on/off}&control messages when loading
-symbol table\cr
-\quad width {\it cpl}&number of characters before line folded\cr
-\quad write {\it on/off}&Allow or forbid patching binary, core files
-(when reopened with {\tt exec} or {\tt core})
-\cr
-\quad history $\ldots$&({\tt h}) groups the following options:\cr
-\quad h exp {\it off/on}&disable or enable {\tt readline} history expansion\cr
-\quad h file {\it filename}&file for recording GDB command history\cr
-\quad h size {\it size}&number of commands kept in history list\cr
-\quad h save {\it off/on}&control use of external file for
-command history\cr
-\cr
-\quad print $\ldots$&({\tt p}) groups the following options:\cr
-\quad p address {\it on/off}&print memory addresses in stacks,
-values\cr
-\quad p array {\it off/on}&compact or attractive format for
-arrays\cr
-\quad p demangl {\it on/off}&source (demangled) or internal form for C++
-symbols\cr
-\quad p asm-dem {\it on/off}&demangle C++ symbols in
-machine-instruction output\cr
-\quad p elements {\it limit}&number of elements to display from an
-array\cr
-\quad p object {\it on/off}&print C++ derived types for objects\cr
-\quad p pretty {\it off/on}&struct display: compact or indented\cr
-\quad p union {\it on/off}&enable or disable display of union members\cr
-\quad p vtbl {\it off/on}&display of C++ virtual function
-tables\cr
-\cr
-show commands&show last 10 commands\cr
-show commands {\it n}&show 10 commands around number {\it n}\cr
-show commands +&show next 10 commands\cr
-\endsec
-
-\sec Working Files;
-file {\it file}&use {\it file} for symbols and executable\cr
-core {\it file}&read {\it file} as coredump\cr
-exec {\it file}&use {\it file} as executable only\cr
-symbol {\it file}&use only symbol table from {\it file}\cr
-load {\it file}&dynamically link {\it file\/} and add its symbols\cr
-add-sym {\it file} {\it addr}&read additional symbols from {\it file},
-dynamically loaded at {\it addr}\cr
-info files&display working files and targets in use\cr
-path {\it dirs}&add {\it dirs} to front of path searched for
-executable and symbol files\cr
-show path&display executable and symbol file path\cr
-info share&list names of shared libraries currently loaded\cr
-\endsec
-
-\vfill\eject
-\sec Source Files;
-dir {\it names}&add directory {\it names} to front of source path\cr
-dir&clear source path\cr
-show dir&show current source path\cr
-\cr
-list&show next ten lines of source\cr
-list -&show previous ten lines\cr
-list {\it lines}&display source centered around {\it lines},
-specified as one of:\cr
-\quad{\opt{\it file\tt:}\it num}&line number \opt{in named file}\cr
-\quad{\opt{\it file\tt:}\it function}&beginning of function \opt{in
-named file}\cr
-\quad{\tt +\it off}&{\it off} lines after last printed\cr
-\quad{\tt -\it off}&{\it off} lines previous to last printed\cr
-\quad{\tt*\it address}&line containing {\it address}\cr
-list {\it f},{\it l}&from line {\it f} to line {\it l}\cr
-info line {\it num}&show starting, ending addresses of compiled code for
-source line {\it num}\cr
-info source&show name of current source file\cr
-info sources&list all source files in use\cr
-forw {\it regex}&search following source lines for {\it regex}\cr
-rev {\it regex}&search preceding source lines for {\it regex}\cr
-\endsec
-
-\sec GDB under GNU Emacs;
-M-x gdb&run GDB under Emacs\cr
-\ctl{h} m&describe GDB mode\cr
-M-s&step one line ({\tt step})\cr
-M-n&next line ({\tt next})\cr
-M-i&step one instruction ({\tt stepi})\cr
-\ctl{c} \ctl{f}&finish current stack frame ({\tt finish})\cr
-M-c&continue ({\tt cont})\cr
-M-u&up {\it arg} frames ({\tt up})\cr
-M-d&down {\it arg} frames ({\tt down})\cr
-\ctl{x} \&&copy number from point, insert at end\cr
-\ctl{x} SPC&(in source file) set break at point\cr
-\endsec
-
-\sec GDB License;
-info copying&Display GNU General Public License\cr
-info warranty&There is NO WARRANTY for GDB. Display full no-warranty
-statement.\cr
-\endsec
-
-
-\vfill
-{\smrm\parskip=6pt
-\centerline{Copyright \copyright 1991 Free Software Foundation, Inc.}
-\centerline{Roland Pesch (pesch@cygnus.com), September 1991---\manvers}
-\centerline{The author assumes no responsibility for any errors on this card.}
-
-This card may be freely distributed under the terms of the GNU
-General Public License.
-
-\centerline{Please contribute to development of this card by
-annotating it.}
-
-GDB itself is free software; you are welcome to distribute copies of
-it under the terms of the GNU General Public License. There is
-absolutely no warranty for GDB.
-}
-\end
diff --git a/gdb/doc/sparc.m4 b/gdb/doc/sparc.m4
deleted file mode 100644
index 8cc6a3e..0000000
--- a/gdb/doc/sparc.m4
+++ /dev/null
@@ -1,5 +0,0 @@
-_divert__(-1)
-_define__(<_SPARC__>,<1>)
-_define__(<_HOST__>,<SPARC>)
-_define__(<_MACH_DEP__>,<SPARC Dependent>)
-_divert__<> \ No newline at end of file
diff --git a/gdb/doc/threecol.tex b/gdb/doc/threecol.tex
deleted file mode 100755
index 604101e..0000000
--- a/gdb/doc/threecol.tex
+++ /dev/null
@@ -1,28 +0,0 @@
-%Three-column format for landscape printing on 8.5x11 paper
-%pesch 1990 december 31
-%We want output .25 inch *from paper edge*; i.e. -.75in from TeX default
-\hoffset=-0.8in \voffset=-0.75in
-\newdimen\fullhsize
-\fullhsize=10.5in \hsize=3.3in
-\def\fulline{\hbox to \fullhsize}
-\let\lcr=L \newbox\leftcolumn\newbox\centercolumn
-\output={\if L\lcr
- \global\setbox\leftcolumn=\columnbox \global\let\lcr=C
- \else
- \if C\lcr
- \global\setbox\centercolumn=\columnbox \global\let\lcr=R
- \else \tripleformat \global\let\lcr=L
- \fi
- \fi
-% \ifnum\outputpenalty>-20000 \else\dosupereject\fi
- }
-\def\tripleformat{\shipout\vbox{\fulline{\box\leftcolumn\hskip .2in plus1fil
- \box\centercolumn\hskip .2in plus1fil
- \columnbox}
- }
- \advancepageno}
-\def\columnbox{\leftline{\pagebody}}
-\def\bye{\par\vfill
- \supereject
- \if R\lcr \null\vfill\eject\fi
- \end}
diff --git a/gdb/doc/vax.m4 b/gdb/doc/vax.m4
deleted file mode 100644
index 59cb2ab..0000000
--- a/gdb/doc/vax.m4
+++ /dev/null
@@ -1,5 +0,0 @@
-_divert__(-1)
-_define__(<_VAX__>,<1>)
-_define__(<_HOST__>,<VAX>)
-_define__(<_MACH_DEP__>,<VAX Dependent>)
-_divert__<> \ No newline at end of file
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
deleted file mode 100644
index 98cb95b..0000000
--- a/gdb/dwarfread.c
+++ /dev/null
@@ -1,3545 +0,0 @@
-/* DWARF debugging format support for GDB.
- Copyright (C) 1991 Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support, portions based on dbxread.c,
- mipsread.c, coffread.c, and dwarfread.c from a Data General SVR4 gdb port.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
-
-FIXME: Figure out how to get the frame pointer register number in the
-execution environment of the target. Remove R_FP kludge
-
-FIXME: Add generation of dependencies list to partial symtab code.
-
-FIXME: Currently we ignore host/target byte ordering and integer size
-differences. Should remap data from external form to an internal form
-before trying to use it.
-
-FIXME: Resolve minor differences between what information we put in the
-partial symbol table and what dbxread puts in. For example, we don't yet
-put enum constants there. And dbxread seems to invent a lot of typedefs
-we never see. Use the new printpsym command to see the partial symbol table
-contents.
-
-FIXME: Change forward declarations of static functions to allow for compilers
-without prototypes.
-
-FIXME: Figure out a better way to tell gdb (all the debug reading routines)
-the names of the gccX_compiled flags.
-
-FIXME: Figure out a better way to tell gdb about the name of the function
-contain the user's entry point (I.E. main())
-
-FIXME: The current DWARF specification has a very strong bias towards
-machines with 32-bit integers, as it assumes that many attributes of the
-program (such as an address) will fit in such an integer. There are many
-references in the spec to things that are 2, 4, or 8 bytes long. Given that
-we will probably run into problems on machines where some of these assumptions
-are invalid (64-bit ints for example), we don't bother at this time to try to
-make this code more flexible and just use shorts, ints, and longs (and their
-sizes) where it seems appropriate. I.E. we use a short int to hold DWARF
-tags, and assume that the tag size in the file is the same as sizeof(short).
-
-FIXME: Figure out how to get the name of the symbol indicating that a module
-has been compiled with gcc (gcc_compiledXX) in a more portable way than
-hardcoding it into the object file readers.
-
-FIXME: See other FIXME's and "ifdef 0" scattered throughout the code for
-other things to work on, if you get bored. :-)
-
-*/
-#include <stdio.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include <fcntl.h>
-
-#include "defs.h"
-#include "param.h"
-#include "bfd.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "dwarf.h"
-#include "ansidecl.h"
-
-#ifdef MAINTENANCE /* Define to 1 to compile in some maintenance stuff */
-#define SQUAWK(stuff) dwarfwarn stuff
-#else
-#define SQUAWK(stuff)
-#endif
-
-#ifndef R_FP /* FIXME */
-#define R_FP 14 /* Kludge to get frame pointer register number */
-#endif
-
-typedef unsigned int DIEREF; /* Reference to a DIE */
-
-#define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled%" /* FIXME */
-#define GCC2_COMPILED_FLAG_SYMBOL "gcc2_compiled%" /* FIXME */
-
-#define STREQ(a,b) (strcmp(a,b)==0)
-
-extern CORE_ADDR startup_file_start; /* From blockframe.c */
-extern CORE_ADDR startup_file_end; /* From blockframe.c */
-extern CORE_ADDR entry_scope_lowpc; /* From blockframe.c */
-extern CORE_ADDR entry_scope_highpc; /* From blockframc.c */
-extern CORE_ADDR main_scope_lowpc; /* From blockframe.c */
-extern CORE_ADDR main_scope_highpc; /* From blockframc.c */
-extern int info_verbose; /* From main.c; nonzero => verbose */
-
-
-/* The DWARF debugging information consists of two major pieces,
- one is a block of DWARF Information Entries (DIE's) and the other
- is a line number table. The "struct dieinfo" structure contains
- the information for a single DIE, the one currently being processed.
-
- In order to make it easier to randomly access the attribute fields
- of the current DIE, which are specifically unordered within the DIE
- each DIE is scanned and an instance of the "struct dieinfo"
- structure is initialized.
-
- Initialization is done in two levels. The first, done by basicdieinfo(),
- just initializes those fields that are vital to deciding whether or not
- to use this DIE, how to skip past it, etc. The second, done by the
- function completedieinfo(), fills in the rest of the information.
-
- Attributes which have block forms are not interpreted at the time
- the DIE is scanned, instead we just save pointers to the start
- of their value fields.
-
- Some fields have a flag <name>_p that is set when the value of the
- field is valid (I.E. we found a matching attribute in the DIE). Since
- we may want to test for the presence of some attributes in the DIE,
- such as AT_low_pc, without restricting the values of the field,
- we need someway to note that we found such an attribute.
-
- */
-
-typedef char BLOCK;
-
-struct dieinfo {
- char * die; /* Pointer to the raw DIE data */
- long dielength; /* Length of the raw DIE data */
- DIEREF dieref; /* Offset of this DIE */
- short dietag; /* Tag for this DIE */
- long at_padding;
- long at_sibling;
- BLOCK * at_location;
- char * at_name;
- unsigned short at_fund_type;
- BLOCK * at_mod_fund_type;
- long at_user_def_type;
- BLOCK * at_mod_u_d_type;
- short at_ordering;
- BLOCK * at_subscr_data;
- long at_byte_size;
- short at_bit_offset;
- long at_bit_size;
- BLOCK * at_element_list;
- long at_stmt_list;
- long at_low_pc;
- long at_high_pc;
- long at_language;
- long at_member;
- long at_discr;
- BLOCK * at_discr_value;
- short at_visibility;
- long at_import;
- BLOCK * at_string_length;
- char * at_comp_dir;
- char * at_producer;
- long at_frame_base;
- long at_start_scope;
- long at_stride_size;
- long at_src_info;
- short at_prototyped;
- unsigned int has_at_low_pc:1;
- unsigned int has_at_stmt_list:1;
-};
-
-static int diecount; /* Approximate count of dies for compilation unit */
-static struct dieinfo *curdie; /* For warnings and such */
-
-static char *dbbase; /* Base pointer to dwarf info */
-static int dbroff; /* Relative offset from start of .debug section */
-static char *lnbase; /* Base pointer to line section */
-static int isreg; /* Kludge to identify register variables */
-
-static CORE_ADDR baseaddr; /* Add to each symbol value */
-
-/* Each partial symbol table entry contains a pointer to private data for the
- read_symtab() function to use when expanding a partial symbol table entry
- to a full symbol table entry. For DWARF debugging info, this data is
- contained in the following structure and macros are provided for easy
- access to the members given a pointer to a partial symbol table entry.
-
- dbfoff Always the absolute file offset to the start of the ".debug"
- section for the file containing the DIE's being accessed.
-
- dbroff Relative offset from the start of the ".debug" access to the
- first DIE to be accessed. When building the partial symbol
- table, this value will be zero since we are accessing the
- entire ".debug" section. When expanding a partial symbol
- table entry, this value will be the offset to the first
- DIE for the compilation unit containing the symbol that
- triggers the expansion.
-
- dblength The size of the chunk of DIE's being examined, in bytes.
-
- lnfoff The absolute file offset to the line table fragment. Ignored
- when building partial symbol tables, but used when expanding
- them, and contains the absolute file offset to the fragment
- of the ".line" section containing the line numbers for the
- current compilation unit.
- */
-
-struct dwfinfo {
- int dbfoff; /* Absolute file offset to start of .debug section */
- int dbroff; /* Relative offset from start of .debug section */
- int dblength; /* Size of the chunk of DIE's being examined */
- int lnfoff; /* Absolute file offset to line table fragment */
-};
-
-#define DBFOFF(p) (((struct dwfinfo *)((p)->read_symtab_private))->dbfoff)
-#define DBROFF(p) (((struct dwfinfo *)((p)->read_symtab_private))->dbroff)
-#define DBLENGTH(p) (((struct dwfinfo *)((p)->read_symtab_private))->dblength)
-#define LNFOFF(p) (((struct dwfinfo *)((p)->read_symtab_private))->lnfoff)
-
-/* Record the symbols defined for each context in a linked list. We don't
- create a struct block for the context until we know how long to make it.
- Global symbols for each file are maintained in the global_symbols list. */
-
-struct pending_symbol {
- struct pending_symbol *next; /* Next pending symbol */
- struct symbol *symbol; /* The actual symbol */
-};
-
-static struct pending_symbol *global_symbols; /* global funcs and vars */
-static struct block *global_symbol_block;
-
-/* Line number entries are read into a dynamically expandable vector before
- being added to the symbol table section. Once we know how many there are
- we can add them. */
-
-static struct linetable *line_vector; /* Vector of line numbers. */
-static int line_vector_index; /* Index of next entry. */
-static int line_vector_length; /* Current allocation limit */
-
-/* Scope information is kept in a scope tree, one node per scope. Each time
- a new scope is started, a child node is created under the current node
- and set to the current scope. Each time a scope is closed, the current
- scope moves back up the tree to the parent of the current scope.
-
- Each scope contains a pointer to the list of symbols defined in the scope,
- a pointer to the block vector for the scope, a pointer to the symbol
- that names the scope (if any), and the range of PC values that mark
- the start and end of the scope. */
-
-struct scopenode {
- struct scopenode *parent;
- struct scopenode *child;
- struct scopenode *sibling;
- struct pending_symbol *symbols;
- struct block *block;
- struct symbol *namesym;
- CORE_ADDR lowpc;
- CORE_ADDR highpc;
-};
-
-static struct scopenode *scopetree;
-static struct scopenode *scope;
-
-/* DIES which have user defined types or modified user defined types refer to
- other DIES for the type information. Thus we need to associate the offset
- of a DIE for a user defined type with a pointer to the type information.
-
- Originally this was done using a simple but expensive algorithm, with an
- array of unsorted structures, each containing an offset/type-pointer pair.
- This array was scanned linearly each time a lookup was done. The result
- was that gdb was spending over half it's startup time munging through this
- array of pointers looking for a structure that had the right offset member.
-
- The second attempt used the same array of structures, but the array was
- sorted using qsort each time a new offset/type was recorded, and a binary
- search was used to find the type pointer for a given DIE offset. This was
- even slower, due to the overhead of sorting the array each time a new
- offset/type pair was entered.
-
- The third attempt uses a fixed size array of type pointers, indexed by a
- value derived from the DIE offset. Since the minimum DIE size is 4 bytes,
- we can divide any DIE offset by 4 to obtain a unique index into this fixed
- size array. Since each element is a 4 byte pointer, it takes exactly as
- much memory to hold this array as to hold the DWARF info for a given
- compilation unit. But it gets freed as soon as we are done with it. */
-
-static struct type **utypes; /* Pointer to array of user type pointers */
-static int numutypes; /* Max number of user type pointers */
-
-/* Forward declarations of static functions so we don't have to worry
- about ordering within this file. The EXFUN macro may be slightly
- misleading. Should probably be called DCLFUN instead, or something
- more intuitive, since it can be used for both static and external
- definitions. */
-
-static void
-EXFUN (dwarfwarn, (char *fmt DOTS));
-
-static void
-EXFUN (scan_partial_symbols, (char *thisdie AND char *enddie));
-
-static void
-EXFUN (scan_compilation_units,
- (char *filename AND CORE_ADDR addr AND char *thisdie AND char *enddie
- AND unsigned int dbfoff AND unsigned int lnoffset
- AND struct objfile *objfile));
-
-static struct partial_symtab *
-EXFUN(start_psymtab, (struct objfile *objfile AND CORE_ADDR addr
- AND char *filename AND CORE_ADDR textlow
- AND CORE_ADDR texthigh AND int dbfoff
- AND int curoff AND int culength AND int lnfoff
- AND struct partial_symbol *global_syms
- AND struct partial_symbol *static_syms));
-static void
-EXFUN(add_partial_symbol, (struct dieinfo *dip));
-
-static void
-EXFUN(add_psymbol_to_list,
- (struct psymbol_allocation_list *listp AND char *name
- AND enum namespace space AND enum address_class class
- AND CORE_ADDR value));
-
-static void
-EXFUN(init_psymbol_list, (int total_symbols));
-
-static void
-EXFUN(basicdieinfo, (struct dieinfo *dip AND char *diep));
-
-static void
-EXFUN(completedieinfo, (struct dieinfo *dip));
-
-static void
-EXFUN(dwarf_psymtab_to_symtab, (struct partial_symtab *pst));
-
-static void
-EXFUN(psymtab_to_symtab_1, (struct partial_symtab *pst));
-
-static struct symtab *
-EXFUN(read_ofile_symtab, (struct partial_symtab *pst));
-
-static void
-EXFUN(process_dies,
- (char *thisdie AND char *enddie AND struct objfile *objfile));
-
-static void
-EXFUN(read_structure_scope,
- (struct dieinfo *dip AND char *thisdie AND char *enddie));
-
-static struct type *
-EXFUN(decode_array_element_type, (char *scan AND char *end));
-
-static struct type *
-EXFUN(decode_subscr_data, (char *scan AND char *end));
-
-static void
-EXFUN(read_array_type, (struct dieinfo *dip));
-
-static void
-EXFUN(read_subroutine_type,
- (struct dieinfo *dip AND char *thisdie AND char *enddie));
-
-static void
-EXFUN(read_enumeration,
- (struct dieinfo *dip AND char *thisdie AND char *enddie));
-
-static struct type *
-EXFUN(struct_type,
- (struct dieinfo *dip AND char *thisdie AND char *enddie));
-
-static struct type *
-EXFUN(enum_type, (struct dieinfo *dip));
-
-static void
-EXFUN(start_symtab, (void));
-
-static void
-EXFUN(end_symtab,
- (char *filename AND long language AND struct objfile *objfile));
-
-static int
-EXFUN(scopecount, (struct scopenode *node));
-
-static void
-EXFUN(openscope,
- (struct symbol *namesym AND CORE_ADDR lowpc AND CORE_ADDR highpc));
-
-static void
-EXFUN(freescope, (struct scopenode *node));
-
-static struct block *
-EXFUN(buildblock, (struct pending_symbol *syms));
-
-static void
-EXFUN(closescope, (void));
-
-static void
-EXFUN(record_line, (int line AND CORE_ADDR pc));
-
-static void
-EXFUN(decode_line_numbers, (char *linetable));
-
-static struct type *
-EXFUN(decode_die_type, (struct dieinfo *dip));
-
-static struct type *
-EXFUN(decode_mod_fund_type, (char *typedata));
-
-static struct type *
-EXFUN(decode_mod_u_d_type, (char *typedata));
-
-static struct type *
-EXFUN(decode_modified_type,
- (unsigned char *modifiers AND unsigned short modcount AND int mtype));
-
-static struct type *
-EXFUN(decode_fund_type, (unsigned short fundtype));
-
-static char *
-EXFUN(create_name, (char *name AND struct obstack *obstackp));
-
-static void
-EXFUN(add_symbol_to_list,
- (struct symbol *symbol AND struct pending_symbol **listhead));
-
-static struct block **
-EXFUN(gatherblocks, (struct block **dest AND struct scopenode *node));
-
-static struct blockvector *
-EXFUN(make_blockvector, (void));
-
-static struct type *
-EXFUN(lookup_utype, (DIEREF dieref));
-
-static struct type *
-EXFUN(alloc_utype, (DIEREF dieref AND struct type *usetype));
-
-static struct symbol *
-EXFUN(new_symbol, (struct dieinfo *dip));
-
-static int
-EXFUN(locval, (char *loc));
-
-static void
-EXFUN(record_misc_function, (char *name AND CORE_ADDR address AND
- enum misc_function_type));
-
-static int
-EXFUN(compare_psymbols,
- (struct partial_symbol *s1 AND struct partial_symbol *s2));
-
-
-/*
-
-GLOBAL FUNCTION
-
- dwarf_build_psymtabs -- build partial symtabs from DWARF debug info
-
-SYNOPSIS
-
- void dwarf_build_psymtabs (int desc, char *filename, CORE_ADDR addr,
- int mainline, unsigned int dbfoff, unsigned int dbsize,
- unsigned int lnoffset, unsigned int lnsize,
- struct objfile *objfile)
-
-DESCRIPTION
-
- This function is called upon to build partial symtabs from files
- containing DIE's (Dwarf Information Entries) and DWARF line numbers.
-
- It is passed a file descriptor for an open file containing the DIES
- and line number information, the corresponding filename for that
- file, a base address for relocating the symbols, a flag indicating
- whether or not this debugging information is from a "main symbol
- table" rather than a shared library or dynamically linked file,
- and file offset/size pairs for the DIE information and line number
- information.
-
-RETURNS
-
- No return value.
-
- */
-
-void
-DEFUN(dwarf_build_psymtabs,
- (desc, filename, addr, mainline, dbfoff, dbsize, lnoffset, lnsize,
- objfile),
- int desc AND
- char *filename AND
- CORE_ADDR addr AND
- int mainline AND
- unsigned int dbfoff AND
- unsigned int dbsize AND
- unsigned int lnoffset AND
- unsigned int lnsize AND
- struct objfile *objfile)
-{
- struct cleanup *back_to;
-
- dbbase = xmalloc (dbsize);
- dbroff = 0;
- if ((lseek (desc, dbfoff, 0) != dbfoff) ||
- (read (desc, dbbase, dbsize) != dbsize))
- {
- free (dbbase);
- error ("can't read DWARF data from '%s'", filename);
- }
- back_to = make_cleanup (free, dbbase);
-
- /* If we are reinitializing, or if we have never loaded syms yet, init.
- Since we have no idea how many DIES we are looking at, we just guess
- some arbitrary value. */
-
- if (mainline || global_psymbols.size == 0 || static_psymbols.size == 0)
- {
- init_psymbol_list (1024);
- }
-
- /* Follow the compilation unit sibling chain, building a partial symbol
- table entry for each one. Save enough information about each compilation
- unit to locate the full DWARF information later. */
-
- scan_compilation_units (filename, addr, dbbase, dbbase + dbsize,
- dbfoff, lnoffset, objfile);
-
- do_cleanups (back_to);
-}
-
-
-/*
-
-LOCAL FUNCTION
-
- record_misc_function -- add entry to miscellaneous function vector
-
-SYNOPSIS
-
- static void record_misc_function (char *name, CORE_ADDR address,
- enum misc_function_type mf_type)
-
-DESCRIPTION
-
- Given a pointer to the name of a symbol that should be added to the
- miscellaneous function vector, and the address associated with that
- symbol, records this information for later use in building the
- miscellaneous function vector.
-
- */
-
-static void
-DEFUN(record_misc_function, (name, address, mf_type),
- char *name AND CORE_ADDR address AND enum misc_function_type mf_type)
-{
- prim_record_misc_function (obsavestring (name, strlen (name)), address,
- mf_type);
-}
-
-/*
-
-LOCAL FUNCTION
-
- dwarfwarn -- issue a DWARF related warning
-
-DESCRIPTION
-
- Issue warnings about DWARF related things that aren't serious enough
- to warrant aborting with an error, but should not be ignored either.
- This includes things like detectable corruption in DIE's, missing
- DIE's, unimplemented features, etc.
-
- In general, running across tags or attributes that we don't recognize
- is not considered to be a problem and we should not issue warnings
- about such.
-
-NOTES
-
- We mostly follow the example of the error() routine, but without
- returning to command level. It is arguable about whether warnings
- should be issued at all, and if so, where they should go (stdout or
- stderr).
-
- We assume that curdie is valid and contains at least the basic
- information for the DIE where the problem was noticed.
-*/
-
-#ifdef __STDC__
-static void
-DEFUN(dwarfwarn, (fmt), char *fmt DOTS)
-{
- va_list ap;
-
- va_start (ap, fmt);
- warning_setup ();
- fprintf (stderr, "DWARF warning (ref 0x%x): ", curdie -> dieref);
- if (curdie -> at_name)
- {
- fprintf (stderr, "'%s': ", curdie -> at_name);
- }
- vfprintf (stderr, fmt, ap);
- fprintf (stderr, "\n");
- fflush (stderr);
- va_end (ap);
-}
-#else
-
-static void
-dwarfwarn (va_alist)
- va_dcl
-{
- va_list ap;
- char *fmt;
-
- va_start (ap);
- fmt = va_arg (ap, char *);
- warning_setup ();
- fprintf (stderr, "DWARF warning (ref 0x%x): ", curdie -> dieref);
- if (curdie -> at_name)
- {
- fprintf (stderr, "'%s': ", curdie -> at_name);
- }
- vfprintf (stderr, fmt, ap);
- fprintf (stderr, "\n");
- fflush (stderr);
- va_end (ap);
-}
-#endif
-/*
-
-LOCAL FUNCTION
-
- compare_psymbols -- compare two partial symbols by name
-
-DESCRIPTION
-
- Given pointer to two partial symbol table entries, compare
- them by name and return -N, 0, or +N (ala strcmp). Typically
- used by sorting routines like qsort().
-
-NOTES
-
- This is a copy from dbxread.c. It should be moved to a generic
- gdb file and made available for all psymtab builders (FIXME).
-
- Does direct compare of first two characters before punting
- and passing to strcmp for longer compares. Note that the
- original version had a bug whereby two null strings or two
- identically named one character strings would return the
- comparison of memory following the null byte.
-
- */
-
-static int
-DEFUN(compare_psymbols, (s1, s2),
- struct partial_symbol *s1 AND
- struct partial_symbol *s2)
-{
- register char *st1 = SYMBOL_NAME (s1);
- register char *st2 = SYMBOL_NAME (s2);
-
- if ((st1[0] - st2[0]) || !st1[0])
- {
- return (st1[0] - st2[0]);
- }
- else if ((st1[1] - st2[1]) || !st1[1])
- {
- return (st1[1] - st2[1]);
- }
- else
- {
- return (strcmp (st1 + 2, st2 + 2));
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- read_lexical_block_scope -- process all dies in a lexical block
-
-SYNOPSIS
-
- static void read_lexical_block_scope (struct dieinfo *dip,
- char *thisdie, char *enddie)
-
-DESCRIPTION
-
- Process all the DIES contained within a lexical block scope.
- Start a new scope, process the dies, and then close the scope.
-
- */
-
-static void
-DEFUN(read_lexical_block_scope, (dip, thisdie, enddie, objfile),
- struct dieinfo *dip AND
- char *thisdie AND
- char *enddie AND
- struct objfile *objfile)
-{
- openscope (NULL, dip -> at_low_pc, dip -> at_high_pc);
- process_dies (thisdie + dip -> dielength, enddie, objfile);
- closescope ();
-}
-
-/*
-
-LOCAL FUNCTION
-
- lookup_utype -- look up a user defined type from die reference
-
-SYNOPSIS
-
- static type *lookup_utype (DIEREF dieref)
-
-DESCRIPTION
-
- Given a DIE reference, lookup the user defined type associated with
- that DIE, if it has been registered already. If not registered, then
- return NULL. Alloc_utype() can be called to register an empty
- type for this reference, which will be filled in later when the
- actual referenced DIE is processed.
- */
-
-static struct type *
-DEFUN(lookup_utype, (dieref), DIEREF dieref)
-{
- struct type *type = NULL;
- int utypeidx;
-
- utypeidx = (dieref - dbroff) / 4;
- if ((utypeidx < 0) || (utypeidx >= numutypes))
- {
- dwarfwarn ("reference to DIE (0x%x) outside compilation unit", dieref);
- }
- else
- {
- type = *(utypes + utypeidx);
- }
- return (type);
-}
-
-
-/*
-
-LOCAL FUNCTION
-
- alloc_utype -- add a user defined type for die reference
-
-SYNOPSIS
-
- static type *alloc_utype (DIEREF dieref, struct type *utypep)
-
-DESCRIPTION
-
- Given a die reference DIEREF, and a possible pointer to a user
- defined type UTYPEP, register that this reference has a user
- defined type and either use the specified type in UTYPEP or
- make a new empty type that will be filled in later.
-
- We should only be called after calling lookup_utype() to verify that
- there is not currently a type registered for DIEREF.
- */
-
-static struct type *
-DEFUN(alloc_utype, (dieref, utypep),
- DIEREF dieref AND
- struct type *utypep)
-{
- struct type **typep;
- int utypeidx;
-
- utypeidx = (dieref - dbroff) / 4;
- typep = utypes + utypeidx;
- if ((utypeidx < 0) || (utypeidx >= numutypes))
- {
- utypep = builtin_type_int;
- dwarfwarn ("reference to DIE (0x%x) outside compilation unit", dieref);
- }
- else if (*typep != NULL)
- {
- utypep = *typep;
- SQUAWK (("internal error: dup user type allocation"));
- }
- else
- {
- if (utypep == NULL)
- {
- utypep = (struct type *)
- obstack_alloc (symbol_obstack, sizeof (struct type));
- (void) memset (utypep, 0, sizeof (struct type));
- }
- *typep = utypep;
- }
- return (utypep);
-}
-
-/*
-
-LOCAL FUNCTION
-
- decode_die_type -- return a type for a specified die
-
-SYNOPSIS
-
- static struct type *decode_die_type (struct dieinfo *dip)
-
-DESCRIPTION
-
- Given a pointer to a die information structure DIP, decode the
- type of the die and return a pointer to the decoded type. All
- dies without specific types default to type int.
- */
-
-static struct type *
-DEFUN(decode_die_type, (dip), struct dieinfo *dip)
-{
- struct type *type = NULL;
-
- if (dip -> at_fund_type != 0)
- {
- type = decode_fund_type (dip -> at_fund_type);
- }
- else if (dip -> at_mod_fund_type != NULL)
- {
- type = decode_mod_fund_type (dip -> at_mod_fund_type);
- }
- else if (dip -> at_user_def_type)
- {
- if ((type = lookup_utype (dip -> at_user_def_type)) == NULL)
- {
- type = alloc_utype (dip -> at_user_def_type, NULL);
- }
- }
- else if (dip -> at_mod_u_d_type)
- {
- type = decode_mod_u_d_type (dip -> at_mod_u_d_type);
- }
- else
- {
- type = builtin_type_int;
- }
- return (type);
-}
-
-/*
-
-LOCAL FUNCTION
-
- struct_type -- compute and return the type for a struct or union
-
-SYNOPSIS
-
- static struct type *struct_type (struct dieinfo *dip, char *thisdie,
- char *enddie)
-
-DESCRIPTION
-
- Given pointer to a die information structure for a die which
- defines a union or structure, and pointers to the raw die data
- that define the range of dies which define the members, compute
- and return the user defined type for the structure or union.
- */
-
-static struct type *
-DEFUN(struct_type, (dip, thisdie, enddie),
- struct dieinfo *dip AND
- char *thisdie AND
- char *enddie)
-{
- struct type *type;
- struct nextfield {
- struct nextfield *next;
- struct field field;
- };
- struct nextfield *list = NULL;
- struct nextfield *new;
- int nfields = 0;
- int n;
- char *tpart1;
- char *tpart2;
- char *tpart3;
- struct dieinfo mbr;
-
- if ((type = lookup_utype (dip -> dieref)) == NULL)
- {
- type = alloc_utype (dip -> dieref, NULL);
- }
- switch (dip -> dietag)
- {
- case TAG_structure_type:
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
- TYPE_CPLUS_SPECIFIC (type)
- = (struct cplus_struct_type *) obstack_alloc (symbol_obstack, sizeof (struct cplus_struct_type));
- bzero (TYPE_CPLUS_SPECIFIC (type), sizeof (struct cplus_struct_type));
- tpart1 = "struct ";
- break;
- case TAG_union_type:
- TYPE_CODE (type) = TYPE_CODE_UNION;
- tpart1 = "union ";
- break;
- default:
- tpart1 = "";
- SQUAWK (("missing structure or union tag"));
- TYPE_CODE (type) = TYPE_CODE_UNDEF;
- break;
- }
- if (dip -> at_name == NULL)
- {
- tpart2 = "{...}";
- }
- else
- {
- tpart2 = dip -> at_name;
- }
- if (dip -> at_byte_size == 0)
- {
- tpart3 = " <opaque>";
- } else {
- TYPE_LENGTH (type) = dip -> at_byte_size;
- tpart3 = "";
- }
- TYPE_NAME (type) = concat (tpart1, tpart2, tpart3, NULL);
- thisdie += dip -> dielength;
- while (thisdie < enddie)
- {
- basicdieinfo (&mbr, thisdie);
- completedieinfo (&mbr);
- if (mbr.dielength <= sizeof (long))
- {
- break;
- }
- switch (mbr.dietag)
- {
- case TAG_member:
- /* Get space to record the next field's data. */
- new = (struct nextfield *) alloca (sizeof (struct nextfield));
- new -> next = list;
- list = new;
- /* Save the data. */
- list -> field.name = savestring (mbr.at_name, strlen (mbr.at_name));
- list -> field.type = decode_die_type (&mbr);
- list -> field.bitpos = 8 * locval (mbr.at_location);
- list -> field.bitsize = 0;
- nfields++;
- break;
- default:
- SQUAWK (("bad member of '%s'", TYPE_NAME (type)));
- break;
- }
- thisdie += mbr.dielength;
- }
- /* Now create the vector of fields, and record how big it is. */
- TYPE_NFIELDS (type) = nfields;
- TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (symbol_obstack, sizeof (struct field) * nfields);
- /* Copy the saved-up fields into the field vector. */
- for (n = nfields; list; list = list -> next)
- {
- TYPE_FIELD (type, --n) = list -> field;
- }
- return (type);
-}
-
-/*
-
-LOCAL FUNCTION
-
- read_structure_scope -- process all dies within struct or union
-
-SYNOPSIS
-
- static void read_structure_scope (struct dieinfo *dip,
- char *thisdie, char *enddie)
-
-DESCRIPTION
-
- Called when we find the DIE that starts a structure or union
- scope (definition) to process all dies that define the members
- of the structure or union. DIP is a pointer to the die info
- struct for the DIE that names the structure or union.
-
-NOTES
-
- Note that we need to call struct_type regardless of whether or not
- we have a symbol, since we might have a structure or union without
- a tag name (thus no symbol for the tagname).
- */
-
-static void
-DEFUN(read_structure_scope, (dip, thisdie, enddie),
- struct dieinfo *dip AND
- char *thisdie AND
- char *enddie)
-{
- struct type *type;
- struct symbol *sym;
-
- type = struct_type (dip, thisdie, enddie);
- if ((sym = new_symbol (dip)) != NULL)
- {
- SYMBOL_TYPE (sym) = type;
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- decode_array_element_type -- decode type of the array elements
-
-SYNOPSIS
-
- static struct type *decode_array_element_type (char *scan, char *end)
-
-DESCRIPTION
-
- As the last step in decoding the array subscript information for an
- array DIE, we need to decode the type of the array elements. We are
- passed a pointer to this last part of the subscript information and
- must return the appropriate type. If the type attribute is not
- recognized, just warn about the problem and return type int.
- */
-
-static struct type *
-DEFUN(decode_array_element_type, (scan, end), char *scan AND char *end)
-{
- struct type *typep;
- short attribute;
- DIEREF dieref;
- unsigned short fundtype;
-
- (void) memcpy (&attribute, scan, sizeof (short));
- scan += sizeof (short);
- switch (attribute)
- {
- case AT_fund_type:
- (void) memcpy (&fundtype, scan, sizeof (short));
- typep = decode_fund_type (fundtype);
- break;
- case AT_mod_fund_type:
- typep = decode_mod_fund_type (scan);
- break;
- case AT_user_def_type:
- (void) memcpy (&dieref, scan, sizeof (DIEREF));
- if ((typep = lookup_utype (dieref)) == NULL)
- {
- typep = alloc_utype (dieref, NULL);
- }
- break;
- case AT_mod_u_d_type:
- typep = decode_mod_u_d_type (scan);
- break;
- default:
- SQUAWK (("bad array element type attribute 0x%x", attribute));
- typep = builtin_type_int;
- break;
- }
- return (typep);
-}
-
-/*
-
-LOCAL FUNCTION
-
- decode_subscr_data -- decode array subscript and element type data
-
-SYNOPSIS
-
- static struct type *decode_subscr_data (char *scan, char *end)
-
-DESCRIPTION
-
- The array subscripts and the data type of the elements of an
- array are described by a list of data items, stored as a block
- of contiguous bytes. There is a data item describing each array
- dimension, and a final data item describing the element type.
- The data items are ordered the same as their appearance in the
- source (I.E. leftmost dimension first, next to leftmost second,
- etc).
-
- We are passed a pointer to the start of the block of bytes
- containing the data items, and a pointer to the first byte past
- the data. This function decodes the data and returns a type.
-
-BUGS
- FIXME: This code only implements the forms currently used
- by the AT&T and GNU C compilers.
-
- The end pointer is supplied for error checking, maybe we should
- use it for that...
- */
-
-static struct type *
-DEFUN(decode_subscr_data, (scan, end), char *scan AND char *end)
-{
- struct type *typep = NULL;
- struct type *nexttype;
- int format;
- short fundtype;
- long lowbound;
- long highbound;
-
- format = *scan++;
- switch (format)
- {
- case FMT_ET:
- typep = decode_array_element_type (scan, end);
- break;
- case FMT_FT_C_C:
- (void) memcpy (&fundtype, scan, sizeof (short));
- scan += sizeof (short);
- if (fundtype != FT_integer && fundtype != FT_signed_integer
- && fundtype != FT_unsigned_integer)
- {
- SQUAWK (("array subscripts must be integral types, not type 0x%x",
- fundtype));
- }
- else
- {
- (void) memcpy (&lowbound, scan, sizeof (long));
- scan += sizeof (long);
- (void) memcpy (&highbound, scan, sizeof (long));
- scan += sizeof (long);
- nexttype = decode_subscr_data (scan, end);
- if (nexttype != NULL)
- {
- typep = (struct type *)
- obstack_alloc (symbol_obstack, sizeof (struct type));
- (void) memset (typep, 0, sizeof (struct type));
- TYPE_CODE (typep) = TYPE_CODE_ARRAY;
- TYPE_LENGTH (typep) = TYPE_LENGTH (nexttype);
- TYPE_LENGTH (typep) *= lowbound + highbound + 1;
- TYPE_TARGET_TYPE (typep) = nexttype;
- }
- }
- break;
- case FMT_FT_C_X:
- case FMT_FT_X_C:
- case FMT_FT_X_X:
- case FMT_UT_C_C:
- case FMT_UT_C_X:
- case FMT_UT_X_C:
- case FMT_UT_X_X:
- SQUAWK (("array subscript format 0x%x not handled yet", format));
- break;
- default:
- SQUAWK (("unknown array subscript format %x", format));
- break;
- }
- return (typep);
-}
-
-/*
-
-LOCAL FUNCTION
-
- read_array_type -- read TAG_array_type DIE
-
-SYNOPSIS
-
- static void read_array_type (struct dieinfo *dip)
-
-DESCRIPTION
-
- Extract all information from a TAG_array_type DIE and add to
- the user defined type vector.
- */
-
-static void
-DEFUN(read_array_type, (dip), struct dieinfo *dip)
-{
- struct type *type;
- char *sub;
- char *subend;
- short temp;
-
- if (dip -> at_ordering != ORD_row_major)
- {
- /* FIXME: Can gdb even handle column major arrays? */
- SQUAWK (("array not row major; not handled correctly"));
- }
- if ((sub = dip -> at_subscr_data) != NULL)
- {
- (void) memcpy (&temp, sub, sizeof (short));
- subend = sub + sizeof (short) + temp;
- sub += sizeof (short);
- type = decode_subscr_data (sub, subend);
- if (type == NULL)
- {
- type = alloc_utype (dip -> dieref, NULL);
- TYPE_CODE (type) = TYPE_CODE_ARRAY;
- TYPE_TARGET_TYPE (type) = builtin_type_int;
- TYPE_LENGTH (type) = 1 * TYPE_LENGTH (TYPE_TARGET_TYPE (type));
- }
- else
- {
- type = alloc_utype (dip -> dieref, type);
- }
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- read_subroutine_type -- process TAG_subroutine_type dies
-
-SYNOPSIS
-
- static void read_subroutine_type (struct dieinfo *dip, char thisdie,
- char *enddie)
-
-DESCRIPTION
-
- Handle DIES due to C code like:
-
- struct foo {
- int (*funcp)(int a, long l); (Generates TAG_subroutine_type DIE)
- int b;
- };
-
-NOTES
-
- The parameter DIES are currently ignored. See if gdb has a way to
- include this info in it's type system, and decode them if so. Is
- this what the type structure's "arg_types" field is for? (FIXME)
- */
-
-static void
-DEFUN(read_subroutine_type, (dip, thisdie, enddie),
- struct dieinfo *dip AND
- char *thisdie AND
- char *enddie)
-{
- struct type *type;
-
- type = decode_die_type (dip);
- type = lookup_function_type (type);
- type = alloc_utype (dip -> dieref, type);
-}
-
-/*
-
-LOCAL FUNCTION
-
- read_enumeration -- process dies which define an enumeration
-
-SYNOPSIS
-
- static void read_enumeration (struct dieinfo *dip, char *thisdie,
- char *enddie)
-
-DESCRIPTION
-
- Given a pointer to a die which begins an enumeration, process all
- the dies that define the members of the enumeration.
-
-NOTES
-
- Note that we need to call enum_type regardless of whether or not we
- have a symbol, since we might have an enum without a tag name (thus
- no symbol for the tagname).
- */
-
-static void
-DEFUN(read_enumeration, (dip, thisdie, enddie),
- struct dieinfo *dip AND
- char *thisdie AND
- char *enddie)
-{
- struct type *type;
- struct symbol *sym;
-
- type = enum_type (dip);
- if ((sym = new_symbol (dip)) != NULL)
- {
- SYMBOL_TYPE (sym) = type;
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- enum_type -- decode and return a type for an enumeration
-
-SYNOPSIS
-
- static type *enum_type (struct dieinfo *dip)
-
-DESCRIPTION
-
- Given a pointer to a die information structure for the die which
- starts an enumeration, process all the dies that define the members
- of the enumeration and return a type pointer for the enumeration.
- */
-
-static struct type *
-DEFUN(enum_type, (dip), struct dieinfo *dip)
-{
- struct type *type;
- struct nextfield {
- struct nextfield *next;
- struct field field;
- };
- struct nextfield *list = NULL;
- struct nextfield *new;
- int nfields = 0;
- int n;
- char *tpart1;
- char *tpart2;
- char *tpart3;
- char *scan;
- char *listend;
- long temp;
-
- if ((type = lookup_utype (dip -> dieref)) == NULL)
- {
- type = alloc_utype (dip -> dieref, NULL);
- }
- TYPE_CODE (type) = TYPE_CODE_ENUM;
- tpart1 = "enum ";
- if (dip -> at_name == NULL)
- {
- tpart2 = "{...}";
- } else {
- tpart2 = dip -> at_name;
- }
- if (dip -> at_byte_size == 0)
- {
- tpart3 = " <opaque>";
- }
- else
- {
- TYPE_LENGTH (type) = dip -> at_byte_size;
- tpart3 = "";
- }
- TYPE_NAME (type) = concat (tpart1, tpart2, tpart3, NULL);
- if ((scan = dip -> at_element_list) != NULL)
- {
- (void) memcpy (&temp, scan, sizeof (temp));
- listend = scan + temp + sizeof (temp);
- scan += sizeof (temp);
- while (scan < listend)
- {
- new = (struct nextfield *) alloca (sizeof (struct nextfield));
- new -> next = list;
- list = new;
- list -> field.type = NULL;
- list -> field.bitsize = 0;
- (void) memcpy (&list -> field.bitpos, scan, sizeof (long));
- scan += sizeof (long);
- list -> field.name = savestring (scan, strlen (scan));
- scan += strlen (scan) + 1;
- nfields++;
- }
- }
- /* Now create the vector of fields, and record how big it is. */
- TYPE_NFIELDS (type) = nfields;
- TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (symbol_obstack, sizeof (struct field) * nfields);
- /* Copy the saved-up fields into the field vector. */
- for (n = nfields; list; list = list -> next)
- {
- TYPE_FIELD (type, --n) = list -> field;
- }
- return (type);
-}
-
-/*
-
-LOCAL FUNCTION
-
- read_func_scope -- process all dies within a function scope
-
-DESCRIPTION
-
- Process all dies within a given function scope. We are passed
- a die information structure pointer DIP for the die which
- starts the function scope, and pointers into the raw die data
- that define the dies within the function scope.
-
- For now, we ignore lexical block scopes within the function.
- The problem is that AT&T cc does not define a DWARF lexical
- block scope for the function itself, while gcc defines a
- lexical block scope for the function. We need to think about
- how to handle this difference, or if it is even a problem.
- (FIXME)
- */
-
-static void
-DEFUN(read_func_scope, (dip, thisdie, enddie, objfile),
- struct dieinfo *dip AND
- char *thisdie AND
- char *enddie AND
- struct objfile *objfile)
-{
- struct symbol *sym;
-
- if (entry_point >= dip -> at_low_pc && entry_point < dip -> at_high_pc)
- {
- entry_scope_lowpc = dip -> at_low_pc;
- entry_scope_highpc = dip -> at_high_pc;
- }
- if (strcmp (dip -> at_name, "main") == 0) /* FIXME: hardwired name */
- {
- main_scope_lowpc = dip -> at_low_pc;
- main_scope_highpc = dip -> at_high_pc;
- }
- sym = new_symbol (dip);
- openscope (sym, dip -> at_low_pc, dip -> at_high_pc);
- process_dies (thisdie + dip -> dielength, enddie, objfile);
- closescope ();
-}
-
-/*
-
-LOCAL FUNCTION
-
- read_file_scope -- process all dies within a file scope
-
-DESCRIPTION
-
- Process all dies within a given file scope. We are passed a
- pointer to the die information structure for the die which
- starts the file scope, and pointers into the raw die data which
- mark the range of dies within the file scope.
-
- When the partial symbol table is built, the file offset for the line
- number table for each compilation unit is saved in the partial symbol
- table entry for that compilation unit. As the symbols for each
- compilation unit are read, the line number table is read into memory
- and the variable lnbase is set to point to it. Thus all we have to
- do is use lnbase to access the line number table for the current
- compilation unit.
- */
-
-static void
-DEFUN(read_file_scope, (dip, thisdie, enddie, objfile),
- struct dieinfo *dip AND
- char *thisdie AND
- char *enddie AND
- struct objfile *objfile)
-{
- struct cleanup *back_to;
-
- if (entry_point >= dip -> at_low_pc && entry_point < dip -> at_high_pc)
- {
- startup_file_start = dip -> at_low_pc;
- startup_file_end = dip -> at_high_pc;
- }
- numutypes = (enddie - thisdie) / 4;
- utypes = (struct type **) xmalloc (numutypes * sizeof (struct type *));
- back_to = make_cleanup (free, utypes);
- (void) memset (utypes, 0, numutypes * sizeof (struct type *));
- start_symtab ();
- openscope (NULL, dip -> at_low_pc, dip -> at_high_pc);
- decode_line_numbers (lnbase);
- process_dies (thisdie + dip -> dielength, enddie, objfile);
- closescope ();
- end_symtab (dip -> at_name, dip -> at_language, objfile);
- do_cleanups (back_to);
- utypes = NULL;
- numutypes = 0;
-}
-
-/*
-
-LOCAL FUNCTION
-
- start_symtab -- do initialization for starting new symbol table
-
-SYNOPSIS
-
- static void start_symtab (void)
-
-DESCRIPTION
-
- Called whenever we are starting to process dies for a new
- compilation unit, to perform initializations. Right now
- the only thing we really have to do is initialize storage
- space for the line number vector.
-
- */
-
-static void
-DEFUN_VOID (start_symtab)
-{
- int nbytes;
-
- line_vector_index = 0;
- line_vector_length = 1000;
- nbytes = sizeof (struct linetable);
- nbytes += line_vector_length * sizeof (struct linetable_entry);
- line_vector = (struct linetable *) xmalloc (nbytes);
-}
-
-/*
-
-LOCAL FUNCTION
-
- process_dies -- process a range of DWARF Information Entries
-
-SYNOPSIS
-
- static void process_dies (char *thisdie, char *enddie)
-
-DESCRIPTION
-
- Process all DIE's in a specified range. May be (and almost
- certainly will be) called recursively.
- */
-
-static void
-DEFUN(process_dies, (thisdie, enddie, objfile),
- char *thisdie AND char *enddie AND struct objfile *objfile)
-{
- char *nextdie;
- struct dieinfo di;
-
- while (thisdie < enddie)
- {
- basicdieinfo (&di, thisdie);
- if (di.dielength < sizeof (long))
- {
- break;
- }
- else if (di.dietag == TAG_padding)
- {
- nextdie = thisdie + di.dielength;
- }
- else
- {
- completedieinfo (&di);
- if (di.at_sibling != 0)
- {
- nextdie = dbbase + di.at_sibling - dbroff;
- }
- else
- {
- nextdie = thisdie + di.dielength;
- }
- switch (di.dietag)
- {
- case TAG_compile_unit:
- read_file_scope (&di, thisdie, nextdie, objfile);
- break;
- case TAG_global_subroutine:
- case TAG_subroutine:
- if (di.has_at_low_pc)
- {
- read_func_scope (&di, thisdie, nextdie, objfile);
- }
- break;
- case TAG_lexical_block:
- read_lexical_block_scope (&di, thisdie, nextdie, objfile);
- break;
- case TAG_structure_type:
- case TAG_union_type:
- read_structure_scope (&di, thisdie, nextdie);
- break;
- case TAG_enumeration_type:
- read_enumeration (&di, thisdie, nextdie);
- break;
- case TAG_subroutine_type:
- read_subroutine_type (&di, thisdie, nextdie);
- break;
- case TAG_array_type:
- read_array_type (&di);
- break;
- default:
- (void) new_symbol (&di);
- break;
- }
- }
- thisdie = nextdie;
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- end_symtab -- finish processing for a compilation unit
-
-SYNOPSIS
-
- static void end_symtab (char *filename, long language)
-
-DESCRIPTION
-
- Complete the symbol table entry for the current compilation
- unit. Make the struct symtab and put it on the list of all
- such symtabs.
-
- */
-
-static void
-DEFUN(end_symtab, (filename, language, objfile),
- char *filename AND long language AND struct objfile *objfile)
-{
- struct symtab *symtab;
- struct blockvector *blockvector;
- int nbytes;
-
- /* Ignore a file that has no functions with real debugging info. */
- if (global_symbols == NULL && scopetree -> block == NULL)
- {
- free (line_vector);
- line_vector = NULL;
- line_vector_length = -1;
- freescope (scopetree);
- scope = scopetree = NULL;
- }
-
- /* Create the blockvector that points to all the file's blocks. */
-
- blockvector = make_blockvector ();
-
- /* Now create the symtab object for this source file. */
-
- symtab = allocate_symtab (savestring (filename, strlen (filename)),
- objfile);
-
- symtab -> free_ptr = 0;
-
- /* Fill in its components. */
- symtab -> blockvector = blockvector;
- symtab -> free_code = free_linetable;
-
- /* Save the line number information. */
-
- line_vector -> nitems = line_vector_index;
- nbytes = sizeof (struct linetable);
- if (line_vector_index > 1)
- {
- nbytes += (line_vector_index - 1) * sizeof (struct linetable_entry);
- }
- symtab -> linetable = (struct linetable *) xrealloc (line_vector, nbytes);
-
- /* FIXME: The following may need to be expanded for other languages */
- switch (language)
- {
- case LANG_C89:
- case LANG_C:
- symtab -> language = language_c;
- break;
- case LANG_C_PLUS_PLUS:
- symtab -> language = language_cplus;
- break;
- default:
- ;
- }
-
- /* Link the new symtab into the list of such. */
- symtab -> next = symtab_list;
- symtab_list = symtab;
-
- /* Recursively free the scope tree */
- freescope (scopetree);
- scope = scopetree = NULL;
-
- /* Reinitialize for beginning of new file. */
- line_vector = 0;
- line_vector_length = -1;
-}
-
-/*
-
-LOCAL FUNCTION
-
- scopecount -- count the number of enclosed scopes
-
-SYNOPSIS
-
- static int scopecount (struct scopenode *node)
-
-DESCRIPTION
-
- Given pointer to a node, compute the size of the subtree which is
- rooted in this node, which also happens to be the number of scopes
- to the subtree.
- */
-
-static int
-DEFUN(scopecount, (node), struct scopenode *node)
-{
- int count = 0;
-
- if (node != NULL)
- {
- count += scopecount (node -> child);
- count += scopecount (node -> sibling);
- count++;
- }
- return (count);
-}
-
-/*
-
-LOCAL FUNCTION
-
- openscope -- start a new lexical block scope
-
-SYNOPSIS
-
- static void openscope (struct symbol *namesym, CORE_ADDR lowpc,
- CORE_ADDR highpc)
-
-DESCRIPTION
-
- Start a new scope by allocating a new scopenode, adding it as the
- next child of the current scope (if any) or as the root of the
- scope tree, and then making the new node the current scope node.
- */
-
-static void
-DEFUN(openscope, (namesym, lowpc, highpc),
- struct symbol *namesym AND
- CORE_ADDR lowpc AND
- CORE_ADDR highpc)
-{
- struct scopenode *new;
- struct scopenode *child;
-
- new = (struct scopenode *) xmalloc (sizeof (*new));
- (void) memset (new, 0, sizeof (*new));
- new -> namesym = namesym;
- new -> lowpc = lowpc;
- new -> highpc = highpc;
- if (scope == NULL)
- {
- scopetree = new;
- }
- else if ((child = scope -> child) == NULL)
- {
- scope -> child = new;
- new -> parent = scope;
- }
- else
- {
- while (child -> sibling != NULL)
- {
- child = child -> sibling;
- }
- child -> sibling = new;
- new -> parent = scope;
- }
- scope = new;
-}
-
-/*
-
-LOCAL FUNCTION
-
- freescope -- free a scope tree rooted at the given node
-
-SYNOPSIS
-
- static void freescope (struct scopenode *node)
-
-DESCRIPTION
-
- Given a pointer to a node in the scope tree, free the subtree
- rooted at that node. First free all the children and sibling
- nodes, and then the node itself. Used primarily for cleaning
- up after ourselves and returning memory to the system.
- */
-
-static void
-DEFUN(freescope, (node), struct scopenode *node)
-{
- if (node != NULL)
- {
- freescope (node -> child);
- freescope (node -> sibling);
- free (node);
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- buildblock -- build a new block from pending symbols list
-
-SYNOPSIS
-
- static struct block *buildblock (struct pending_symbol *syms)
-
-DESCRIPTION
-
- Given a pointer to a list of symbols, build a new block and free
- the symbol list structure. Also check each symbol to see if it
- is the special symbol that flags that this block was compiled by
- gcc, and if so, mark the block appropriately.
- */
-
-static struct block *
-DEFUN(buildblock, (syms), struct pending_symbol *syms)
-{
- struct pending_symbol *next, *next1;
- int i;
- struct block *newblock;
- int nbytes;
-
- for (next = syms, i = 0 ; next ; next = next -> next, i++) {;}
-
- /* Allocate a new block */
-
- nbytes = sizeof (struct block);
- if (i > 1)
- {
- nbytes += (i - 1) * sizeof (struct symbol *);
- }
- newblock = (struct block *) obstack_alloc (symbol_obstack, nbytes);
- (void) memset (newblock, 0, nbytes);
-
- /* Copy the symbols into the block. */
-
- BLOCK_NSYMS (newblock) = i;
- for (next = syms ; next ; next = next -> next)
- {
- BLOCK_SYM (newblock, --i) = next -> symbol;
- if (STREQ (GCC_COMPILED_FLAG_SYMBOL, SYMBOL_NAME (next -> symbol)) ||
- STREQ (GCC2_COMPILED_FLAG_SYMBOL, SYMBOL_NAME (next -> symbol)))
- {
- BLOCK_GCC_COMPILED (newblock) = 1;
- }
- }
-
- /* Now free the links of the list, and empty the list. */
-
- for (next = syms ; next ; next = next1)
- {
- next1 = next -> next;
- free (next);
- }
-
- return (newblock);
-}
-
-/*
-
-LOCAL FUNCTION
-
- closescope -- close a lexical block scope
-
-SYNOPSIS
-
- static void closescope (void)
-
-DESCRIPTION
-
- Close the current lexical block scope. Closing the current scope
- is as simple as moving the current scope pointer up to the parent
- of the current scope pointer. But we also take this opportunity
- to build the block for the current scope first, since we now have
- all of it's symbols.
- */
-
-static void
-DEFUN_VOID(closescope)
-{
- struct scopenode *child;
-
- if (scope == NULL)
- {
- error ("DWARF parse error, too many close scopes");
- }
- else
- {
- if (scope -> parent == NULL)
- {
- global_symbol_block = buildblock (global_symbols);
- global_symbols = NULL;
- BLOCK_START (global_symbol_block) = scope -> lowpc + baseaddr;
- BLOCK_END (global_symbol_block) = scope -> highpc + baseaddr;
- }
- scope -> block = buildblock (scope -> symbols);
- scope -> symbols = NULL;
- BLOCK_START (scope -> block) = scope -> lowpc + baseaddr;
- BLOCK_END (scope -> block) = scope -> highpc + baseaddr;
-
- /* Put the local block in as the value of the symbol that names it. */
-
- if (scope -> namesym)
- {
- SYMBOL_BLOCK_VALUE (scope -> namesym) = scope -> block;
- BLOCK_FUNCTION (scope -> block) = scope -> namesym;
- }
-
- /* Install this scope's local block as the superblock of all child
- scope blocks. */
-
- for (child = scope -> child ; child ; child = child -> sibling)
- {
- BLOCK_SUPERBLOCK (child -> block) = scope -> block;
- }
-
- scope = scope -> parent;
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- record_line -- record a line number entry in the line vector
-
-SYNOPSIS
-
- static void record_line (int line, CORE_ADDR pc)
-
-DESCRIPTION
-
- Given a line number and the corresponding pc value, record
- this pair in the line number vector, expanding the vector as
- necessary.
- */
-
-static void
-DEFUN(record_line, (line, pc), int line AND CORE_ADDR pc)
-{
- struct linetable_entry *e;
- int nbytes;
-
- /* Make sure line vector is big enough. */
-
- if (line_vector_index + 2 >= line_vector_length)
- {
- line_vector_length *= 2;
- nbytes = sizeof (struct linetable);
- nbytes += (line_vector_length * sizeof (struct linetable_entry));
- line_vector = (struct linetable *) xrealloc (line_vector, nbytes);
- }
- e = line_vector -> item + line_vector_index++;
- e -> line = line;
- e -> pc = pc;
-}
-
-/*
-
-LOCAL FUNCTION
-
- decode_line_numbers -- decode a line number table fragment
-
-SYNOPSIS
-
- static void decode_line_numbers (char *tblscan, char *tblend,
- long length, long base, long line, long pc)
-
-DESCRIPTION
-
- Translate the DWARF line number information to gdb form.
-
- The ".line" section contains one or more line number tables, one for
- each ".line" section from the objects that were linked.
-
- The AT_stmt_list attribute for each TAG_source_file entry in the
- ".debug" section contains the offset into the ".line" section for the
- start of the table for that file.
-
- The table itself has the following structure:
-
- <table length><base address><source statement entry>
- 4 bytes 4 bytes 10 bytes
-
- The table length is the total size of the table, including the 4 bytes
- for the length information.
-
- The base address is the address of the first instruction generated
- for the source file.
-
- Each source statement entry has the following structure:
-
- <line number><statement position><address delta>
- 4 bytes 2 bytes 4 bytes
-
- The line number is relative to the start of the file, starting with
- line 1.
-
- The statement position either -1 (0xFFFF) or the number of characters
- from the beginning of the line to the beginning of the statement.
-
- The address delta is the difference between the base address and
- the address of the first instruction for the statement.
-
- Note that we must copy the bytes from the packed table to our local
- variables before attempting to use them, to avoid alignment problems
- on some machines, particularly RISC processors.
-
-BUGS
-
- Does gdb expect the line numbers to be sorted? They are now by
- chance/luck, but are not required to be. (FIXME)
-
- The line with number 0 is unused, gdb apparently can discover the
- span of the last line some other way. How? (FIXME)
- */
-
-static void
-DEFUN(decode_line_numbers, (linetable), char *linetable)
-{
- char *tblscan;
- char *tblend;
- long length;
- long base;
- long line;
- long pc;
-
- if (linetable != NULL)
- {
- tblscan = tblend = linetable;
- (void) memcpy (&length, tblscan, sizeof (long));
- tblscan += sizeof (long);
- tblend += length;
- (void) memcpy (&base, tblscan, sizeof (long));
- base += baseaddr;
- tblscan += sizeof (long);
- while (tblscan < tblend)
- {
- (void) memcpy (&line, tblscan, sizeof (long));
- tblscan += sizeof (long) + sizeof (short);
- (void) memcpy (&pc, tblscan, sizeof (long));
- tblscan += sizeof (long);
- pc += base;
- if (line > 0)
- {
- record_line (line, pc);
- }
- }
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- add_symbol_to_list -- add a symbol to head of current symbol list
-
-SYNOPSIS
-
- static void add_symbol_to_list (struct symbol *symbol, struct
- pending_symbol **listhead)
-
-DESCRIPTION
-
- Given a pointer to a symbol and a pointer to a pointer to a
- list of symbols, add this symbol as the current head of the
- list. Typically used for example to add a symbol to the
- symbol list for the current scope.
-
- */
-
-static void
-DEFUN(add_symbol_to_list, (symbol, listhead),
- struct symbol *symbol AND struct pending_symbol **listhead)
-{
- struct pending_symbol *link;
-
- if (symbol != NULL)
- {
- link = (struct pending_symbol *) xmalloc (sizeof (*link));
- link -> next = *listhead;
- link -> symbol = symbol;
- *listhead = link;
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- gatherblocks -- walk a scope tree and build block vectors
-
-SYNOPSIS
-
- static struct block **gatherblocks (struct block **dest,
- struct scopenode *node)
-
-DESCRIPTION
-
- Recursively walk a scope tree rooted in the given node, adding blocks
- to the array pointed to by DEST, in preorder. I.E., first we add the
- block for the current scope, then all the blocks for child scopes,
- and finally all the blocks for sibling scopes.
- */
-
-static struct block **
-DEFUN(gatherblocks, (dest, node),
- struct block **dest AND struct scopenode *node)
-{
- if (node != NULL)
- {
- *dest++ = node -> block;
- dest = gatherblocks (dest, node -> child);
- dest = gatherblocks (dest, node -> sibling);
- }
- return (dest);
-}
-
-/*
-
-LOCAL FUNCTION
-
- make_blockvector -- make a block vector from current scope tree
-
-SYNOPSIS
-
- static struct blockvector *make_blockvector (void)
-
-DESCRIPTION
-
- Make a blockvector from all the blocks in the current scope tree.
- The first block is always the global symbol block, followed by the
- block for the root of the scope tree which is the local symbol block,
- followed by all the remaining blocks in the scope tree, which are all
- local scope blocks.
-
-NOTES
-
- Note that since the root node of the scope tree is created at the time
- each file scope is entered, there are always at least two blocks,
- neither of which may have any symbols, but always contribute a block
- to the block vector. So the test for number of blocks greater than 1
- below is unnecessary given bug free code.
-
- The resulting block structure varies slightly from that produced
- by dbxread.c, in that block 0 and block 1 are sibling blocks while
- with dbxread.c, block 1 is a child of block 0. This does not
- seem to cause any problems, but probably should be fixed. (FIXME)
- */
-
-static struct blockvector *
-DEFUN_VOID(make_blockvector)
-{
- struct blockvector *blockvector = NULL;
- int i;
- int nbytes;
-
- /* Recursively walk down the tree, counting the number of blocks.
- Then add one to account for the global's symbol block */
-
- i = scopecount (scopetree) + 1;
- nbytes = sizeof (struct blockvector);
- if (i > 1)
- {
- nbytes += (i - 1) * sizeof (struct block *);
- }
- blockvector = (struct blockvector *)
- obstack_alloc (symbol_obstack, nbytes);
-
- /* Copy the blocks into the blockvector. */
-
- BLOCKVECTOR_NBLOCKS (blockvector) = i;
- BLOCKVECTOR_BLOCK (blockvector, 0) = global_symbol_block;
- gatherblocks (&BLOCKVECTOR_BLOCK (blockvector, 1), scopetree);
-
- return (blockvector);
-}
-
-/*
-
-LOCAL FUNCTION
-
- locval -- compute the value of a location attribute
-
-SYNOPSIS
-
- static int locval (char *loc)
-
-DESCRIPTION
-
- Given pointer to a string of bytes that define a location, compute
- the location and return the value.
-
- When computing values involving the current value of the frame pointer,
- the value zero is used, which results in a value relative to the frame
- pointer, rather than the absolute value. This is what GDB wants
- anyway.
-
- When the result is a register number, the global isreg flag is set,
- otherwise it is cleared. This is a kludge until we figure out a better
- way to handle the problem. Gdb's design does not mesh well with the
- DWARF notion of a location computing interpreter, which is a shame
- because the flexibility goes unused.
-
-NOTES
-
- Note that stack[0] is unused except as a default error return.
- Note that stack overflow is not yet handled.
- */
-
-static int
-DEFUN(locval, (loc), char *loc)
-{
- unsigned short nbytes;
- auto int stack[64];
- int stacki;
- char *end;
- long regno;
-
- (void) memcpy (&nbytes, loc, sizeof (short));
- end = loc + sizeof (short) + nbytes;
- stacki = 0;
- stack[stacki] = 0;
- isreg = 0;
- for (loc += sizeof (short); loc < end; loc += sizeof (long))
- {
- switch (*loc++) {
- case 0:
- /* error */
- loc = end;
- break;
- case OP_REG:
- /* push register (number) */
- (void) memcpy (&stack[++stacki], loc, sizeof (long));
- isreg = 1;
- break;
- case OP_BASEREG:
- /* push value of register (number) */
- /* Actually, we compute the value as if register has 0 */
- (void) memcpy (&regno, loc, sizeof (long));
- if (regno == R_FP)
- {
- stack[++stacki] = 0;
- }
- else
- {
- stack[++stacki] = 0;
- SQUAWK (("BASEREG %d not handled!", regno));
- }
- break;
- case OP_ADDR:
- /* push address (relocated address) */
- (void) memcpy (&stack[++stacki], loc, sizeof (long));
- break;
- case OP_CONST:
- /* push constant (number) */
- (void) memcpy (&stack[++stacki], loc, sizeof (long));
- break;
- case OP_DEREF2:
- /* pop, deref and push 2 bytes (as a long) */
- SQUAWK (("OP_DEREF2 address %#x not handled", stack[stacki]));
- break;
- case OP_DEREF4: /* pop, deref and push 4 bytes (as a long) */
- SQUAWK (("OP_DEREF4 address %#x not handled", stack[stacki]));
- break;
- case OP_ADD: /* pop top 2 items, add, push result */
- stack[stacki - 1] += stack[stacki];
- stacki--;
- break;
- }
- }
- return (stack[stacki]);
-}
-
-/*
-
-LOCAL FUNCTION
-
- read_ofile_symtab -- build a full symtab entry from chunk of DIE's
-
-SYNOPSIS
-
- static struct symtab *read_ofile_symtab (struct partial_symtab *pst)
-
-DESCRIPTION
-
- OFFSET is a relocation offset which gets added to each symbol (FIXME).
- */
-
-static struct symtab *
-DEFUN(read_ofile_symtab, (pst),
- struct partial_symtab *pst)
-{
- struct cleanup *back_to;
- long lnsize;
- int foffset;
- bfd *abfd = pst->objfile->obfd;
-
- /* Allocate a buffer for the entire chunk of DIE's for this compilation
- unit, seek to the location in the file, and read in all the DIE's. */
-
- diecount = 0;
- dbbase = xmalloc (DBLENGTH(pst));
- dbroff = DBROFF(pst);
- foffset = DBFOFF(pst) + dbroff;
- if (bfd_seek (abfd, foffset, 0) ||
- (bfd_read (dbbase, DBLENGTH(pst), 1, abfd) != DBLENGTH(pst)))
- {
- free (dbbase);
- error ("can't read DWARF data");
- }
- back_to = make_cleanup (free, dbbase);
-
- /* If there is a line number table associated with this compilation unit
- then read the first long word from the line number table fragment, which
- contains the size of the fragment in bytes (including the long word
- itself). Allocate a buffer for the fragment and read it in for future
- processing. */
-
- lnbase = NULL;
- if (LNFOFF (pst))
- {
- if (bfd_seek (abfd, LNFOFF (pst), 0) ||
- (bfd_read (&lnsize, sizeof(long), 1, abfd) != sizeof(long)))
- {
- error ("can't read DWARF line number table size");
- }
- lnbase = xmalloc (lnsize);
- if (bfd_seek (abfd, LNFOFF (pst), 0) ||
- (bfd_read (lnbase, lnsize, 1, abfd) != lnsize))
- {
- free (lnbase);
- error ("can't read DWARF line numbers");
- }
- make_cleanup (free, lnbase);
- }
-
- process_dies (dbbase, dbbase + DBLENGTH(pst), pst->objfile);
- do_cleanups (back_to);
- return (symtab_list);
-}
-
-/*
-
-LOCAL FUNCTION
-
- psymtab_to_symtab_1 -- do grunt work for building a full symtab entry
-
-SYNOPSIS
-
- static void psymtab_to_symtab_1 (struct partial_symtab *pst)
-
-DESCRIPTION
-
- Called once for each partial symbol table entry that needs to be
- expanded into a full symbol table entry.
-
-*/
-
-static void
-DEFUN(psymtab_to_symtab_1,
- (pst),
- struct partial_symtab *pst)
-{
- int i;
-
- if (!pst)
- {
- return;
- }
- if (pst->readin)
- {
- fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst -> filename);
- return;
- }
-
- /* Read in all partial symtabs on which this one is dependent */
- for (i = 0; i < pst -> number_of_dependencies; i++)
- if (!pst -> dependencies[i] -> readin)
- {
- /* Inform about additional files that need to be read in. */
- if (info_verbose)
- {
- fputs_filtered (" ", stdout);
- wrap_here ("");
- fputs_filtered ("and ", stdout);
- wrap_here ("");
- printf_filtered ("%s...", pst -> dependencies[i] -> filename);
- wrap_here (""); /* Flush output */
- fflush (stdout);
- }
- psymtab_to_symtab_1 (pst -> dependencies[i]);
- }
-
- if (DBLENGTH(pst)) /* Otherwise it's a dummy */
- {
- /* Init stuff necessary for reading in symbols */
- pst -> symtab = read_ofile_symtab (pst);
- if (info_verbose)
- {
- printf_filtered ("%d DIE's, sorting...", diecount);
- fflush (stdout);
- }
- sort_symtab_syms (pst -> symtab);
- }
- pst -> readin = 1;
-}
-
-/*
-
-LOCAL FUNCTION
-
- dwarf_psymtab_to_symtab -- build a full symtab entry from partial one
-
-SYNOPSIS
-
- static void dwarf_psymtab_to_symtab (struct partial_symtab *pst)
-
-DESCRIPTION
-
- This is the DWARF support entry point for building a full symbol
- table entry from a partial symbol table entry. We are passed a
- pointer to the partial symbol table entry that needs to be expanded.
-
-*/
-
-static void
-DEFUN(dwarf_psymtab_to_symtab, (pst), struct partial_symtab *pst)
-{
- int desc;
- bfd *sym_bfd;
-
- if (!pst)
- {
- return;
- }
- if (pst -> readin)
- {
- fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst -> filename);
- return;
- }
-
- if (DBLENGTH(pst) || pst -> number_of_dependencies)
- {
- /* Print the message now, before starting serious work, to avoid
- disconcerting pauses. */
- if (info_verbose)
- {
- printf_filtered ("Reading in symbols for %s...", pst -> filename);
- fflush (stdout);
- }
-
- psymtab_to_symtab_1 (pst);
-
-#if 0 /* FIXME: Check to see what dbxread is doing here and see if
- we need to do an equivalent or is this something peculiar to
- stabs/a.out format. */
- /* Match with global symbols. This only needs to be done once,
- after all of the symtabs and dependencies have been read in. */
- scan_file_globals ();
-#endif
-
- /* Finish up the debug error message. */
- if (info_verbose)
- {
- printf_filtered ("done.\n");
- }
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- init_psymbol_list -- initialize storage for partial symbols
-
-SYNOPSIS
-
- static void init_psymbol_list (int total_symbols)
-
-DESCRIPTION
-
- Initializes storage for all of the partial symbols that will be
- created by dwarf_build_psymtabs and subsidiaries.
- */
-
-static void
-DEFUN(init_psymbol_list, (total_symbols), int total_symbols)
-{
- /* Free any previously allocated psymbol lists. */
-
- if (global_psymbols.list)
- {
- free (global_psymbols.list);
- }
- if (static_psymbols.list)
- {
- free (static_psymbols.list);
- }
-
- /* Current best guess is that there are approximately a twentieth
- of the total symbols (in a debugging file) are global or static
- oriented symbols */
-
- global_psymbols.size = total_symbols / 10;
- static_psymbols.size = total_symbols / 10;
- global_psymbols.next = global_psymbols.list = (struct partial_symbol *)
- xmalloc (global_psymbols.size * sizeof (struct partial_symbol));
- static_psymbols.next = static_psymbols.list = (struct partial_symbol *)
- xmalloc (static_psymbols.size * sizeof (struct partial_symbol));
-}
-
-/*
-
-LOCAL FUNCTION
-
- start_psymtab -- allocate and partially fill a partial symtab entry
-
-DESCRIPTION
-
- Allocate and partially fill a partial symtab. It will be completely
- filled at the end of the symbol list.
-
- SYMFILE_NAME is the name of the symbol-file we are reading from, and
- ADDR is the address relative to which its symbols are (incremental)
- or 0 (normal). FILENAME is the name of the compilation unit that
- these symbols were defined in, and they appear starting a address
- TEXTLOW. DBROFF is the absolute file offset in SYMFILE_NAME where
- the full symbols can be read for compilation unit FILENAME.
- GLOBAL_SYMS and STATIC_SYMS are pointers to the current end of the
- psymtab vector.
-
- */
-
-static struct partial_symtab *
-DEFUN(start_psymtab,
- (objfile, addr, filename, textlow, texthigh, dbfoff, curoff,
- culength, lnfoff, global_syms, static_syms),
- struct objfile *objfile AND
- CORE_ADDR addr AND
- char *filename AND
- CORE_ADDR textlow AND
- CORE_ADDR texthigh AND
- int dbfoff AND
- int curoff AND
- int culength AND
- int lnfoff AND
- struct partial_symbol *global_syms AND
- struct partial_symbol *static_syms)
-{
- struct partial_symtab *result;
-
- result = (struct partial_symtab *)
- obstack_alloc (psymbol_obstack, sizeof (struct partial_symtab));
- (void) memset (result, 0, sizeof (struct partial_symtab));
- result -> addr = addr;
- result -> objfile = objfile;
- result -> filename = create_name (filename, psymbol_obstack);
- result -> textlow = textlow;
- result -> texthigh = texthigh;
- result -> read_symtab_private = (char *) obstack_alloc (psymbol_obstack,
- sizeof (struct dwfinfo));
- DBFOFF (result) = dbfoff;
- DBROFF (result) = curoff;
- DBLENGTH (result) = culength;
- LNFOFF (result) = lnfoff;
- result -> readin = 0;
- result -> symtab = NULL;
- result -> read_symtab = dwarf_psymtab_to_symtab;
- result -> globals_offset = global_syms - global_psymbols.list;
- result -> statics_offset = static_syms - static_psymbols.list;
-
- result->n_global_syms = 0;
- result->n_static_syms = 0;
-
- return result;
-}
-
-/*
-
-LOCAL FUNCTION
-
- add_psymbol_to_list -- add a partial symbol to given list
-
-DESCRIPTION
-
- Add a partial symbol to one of the partial symbol vectors (pointed to
- by listp). The vector is grown as necessary.
-
- */
-
-static void
-DEFUN(add_psymbol_to_list,
- (listp, name, space, class, value),
- struct psymbol_allocation_list *listp AND
- char *name AND
- enum namespace space AND
- enum address_class class AND
- CORE_ADDR value)
-{
- struct partial_symbol *psym;
- int newsize;
-
- if (listp -> next >= listp -> list + listp -> size)
- {
- newsize = listp -> size * 2;
- listp -> list = (struct partial_symbol *)
- xrealloc (listp -> list, (newsize * sizeof (struct partial_symbol)));
- /* Next assumes we only went one over. Should be good if program works
- correctly */
- listp -> next = listp -> list + listp -> size;
- listp -> size = newsize;
- }
- psym = listp -> next++;
- SYMBOL_NAME (psym) = create_name (name, psymbol_obstack);
- SYMBOL_NAMESPACE (psym) = space;
- SYMBOL_CLASS (psym) = class;
- SYMBOL_VALUE (psym) = value;
-}
-
-/*
-
-LOCAL FUNCTION
-
- add_partial_symbol -- add symbol to partial symbol table
-
-DESCRIPTION
-
- Given a DIE, if it is one of the types that we want to
- add to a partial symbol table, finish filling in the die info
- and then add a partial symbol table entry for it.
-
-*/
-
-static void
-DEFUN(add_partial_symbol, (dip), struct dieinfo *dip)
-{
- switch (dip -> dietag)
- {
- case TAG_global_subroutine:
- record_misc_function (dip -> at_name, dip -> at_low_pc, mf_text);
- add_psymbol_to_list (&global_psymbols, dip -> at_name, VAR_NAMESPACE,
- LOC_BLOCK, dip -> at_low_pc);
- break;
- case TAG_global_variable:
- record_misc_function (dip -> at_name, locval (dip -> at_location),
- mf_data);
- add_psymbol_to_list (&global_psymbols, dip -> at_name, VAR_NAMESPACE,
- LOC_STATIC, 0);
- break;
- case TAG_subroutine:
- add_psymbol_to_list (&static_psymbols, dip -> at_name, VAR_NAMESPACE,
- LOC_BLOCK, dip -> at_low_pc);
- break;
- case TAG_local_variable:
- add_psymbol_to_list (&static_psymbols, dip -> at_name, VAR_NAMESPACE,
- LOC_STATIC, 0);
- break;
- case TAG_typedef:
- add_psymbol_to_list (&static_psymbols, dip -> at_name, VAR_NAMESPACE,
- LOC_TYPEDEF, 0);
- break;
- case TAG_structure_type:
- case TAG_union_type:
- case TAG_enumeration_type:
- add_psymbol_to_list (&static_psymbols, dip -> at_name, STRUCT_NAMESPACE,
- LOC_TYPEDEF, 0);
- break;
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- scan_partial_symbols -- scan DIE's within a single compilation unit
-
-DESCRIPTION
-
- Process the DIE's within a single compilation unit, looking for
- interesting DIE's that contribute to the partial symbol table entry
- for this compilation unit. Since we cannot follow any sibling
- chains without reading the complete DIE info for every DIE,
- it is probably faster to just sequentially check each one to
- see if it is one of the types we are interested in, and if
- so, then extracting all the attributes info and generating a
- partial symbol table entry.
-
-NOTES
-
- Don't attempt to add anonymous structures, unions, or enumerations
- since they have no name. Also, for variables and subroutines,
- check that this is the place where the actual definition occurs,
- rather than just a reference to an external.
-
- */
-
-static void
-DEFUN(scan_partial_symbols, (thisdie, enddie), char *thisdie AND char *enddie)
-{
- char *nextdie;
- struct dieinfo di;
-
- while (thisdie < enddie)
- {
- basicdieinfo (&di, thisdie);
- if (di.dielength < sizeof (long))
- {
- break;
- }
- else
- {
- nextdie = thisdie + di.dielength;
- switch (di.dietag)
- {
- case TAG_global_subroutine:
- case TAG_subroutine:
- case TAG_global_variable:
- case TAG_local_variable:
- completedieinfo (&di);
- if (di.at_name && (di.has_at_low_pc || di.at_location))
- {
- add_partial_symbol (&di);
- }
- break;
- case TAG_typedef:
- case TAG_structure_type:
- case TAG_union_type:
- case TAG_enumeration_type:
- completedieinfo (&di);
- if (di.at_name)
- {
- add_partial_symbol (&di);
- }
- break;
- }
- }
- thisdie = nextdie;
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- scan_compilation_units -- build a psymtab entry for each compilation
-
-DESCRIPTION
-
- This is the top level dwarf parsing routine for building partial
- symbol tables.
-
- It scans from the beginning of the DWARF table looking for the first
- TAG_compile_unit DIE, and then follows the sibling chain to locate
- each additional TAG_compile_unit DIE.
-
- For each TAG_compile_unit DIE it creates a partial symtab structure,
- calls a subordinate routine to collect all the compilation unit's
- global DIE's, file scope DIEs, typedef DIEs, etc, and then links the
- new partial symtab structure into the partial symbol table. It also
- records the appropriate information in the partial symbol table entry
- to allow the chunk of DIE's and line number table for this compilation
- unit to be located and re-read later, to generate a complete symbol
- table entry for the compilation unit.
-
- Thus it effectively partitions up a chunk of DIE's for multiple
- compilation units into smaller DIE chunks and line number tables,
- and associates them with a partial symbol table entry.
-
-NOTES
-
- If any compilation unit has no line number table associated with
- it for some reason (a missing at_stmt_list attribute, rather than
- just one with a value of zero, which is valid) then we ensure that
- the recorded file offset is zero so that the routine which later
- reads line number table fragments knows that there is no fragment
- to read.
-
-RETURNS
-
- Returns no value.
-
- */
-
-static void
-DEFUN(scan_compilation_units,
- (filename, addr, thisdie, enddie, dbfoff, lnoffset, objfile),
- char *filename AND
- CORE_ADDR addr AND
- char *thisdie AND
- char *enddie AND
- unsigned int dbfoff AND
- unsigned int lnoffset AND
- struct objfile *objfile)
-{
- char *nextdie;
- struct dieinfo di;
- struct partial_symtab *pst;
- int culength;
- int curoff;
- int curlnoffset;
-
- while (thisdie < enddie)
- {
- basicdieinfo (&di, thisdie);
- if (di.dielength < sizeof (long))
- {
- break;
- }
- else if (di.dietag != TAG_compile_unit)
- {
- nextdie = thisdie + di.dielength;
- }
- else
- {
- completedieinfo (&di);
- if (di.at_sibling != 0)
- {
- nextdie = dbbase + di.at_sibling - dbroff;
- }
- else
- {
- nextdie = thisdie + di.dielength;
- }
- curoff = thisdie - dbbase;
- culength = nextdie - thisdie;
- curlnoffset = di.has_at_stmt_list ? lnoffset + di.at_stmt_list : 0;
- pst = start_psymtab (objfile, addr, di.at_name,
- di.at_low_pc, di.at_high_pc,
- dbfoff, curoff, culength, curlnoffset,
- global_psymbols.next,
- static_psymbols.next);
- scan_partial_symbols (thisdie + di.dielength, nextdie);
- pst -> n_global_syms = global_psymbols.next -
- (global_psymbols.list + pst -> globals_offset);
- pst -> n_static_syms = static_psymbols.next -
- (static_psymbols.list + pst -> statics_offset);
- /* Sort the global list; don't sort the static list */
- qsort (global_psymbols.list + pst -> globals_offset,
- pst -> n_global_syms, sizeof (struct partial_symbol),
- compare_psymbols);
- /* If there is already a psymtab or symtab for a file of this name,
- remove it. (If there is a symtab, more drastic things also
- happen.) This happens in VxWorks. */
- free_named_symtabs (pst -> filename);
- /* Place the partial symtab on the partial symtab list */
- pst -> next = partial_symtab_list;
- partial_symtab_list = pst;
- }
- thisdie = nextdie;
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- new_symbol -- make a symbol table entry for a new symbol
-
-SYNOPSIS
-
- static struct symbol *new_symbol (struct dieinfo *dip)
-
-DESCRIPTION
-
- Given a pointer to a DWARF information entry, figure out if we need
- to make a symbol table entry for it, and if so, create a new entry
- and return a pointer to it.
- */
-
-static struct symbol *
-DEFUN(new_symbol, (dip), struct dieinfo *dip)
-{
- struct symbol *sym = NULL;
-
- if (dip -> at_name != NULL)
- {
- sym = (struct symbol *) obstack_alloc (symbol_obstack,
- sizeof (struct symbol));
- (void) memset (sym, 0, sizeof (struct symbol));
- SYMBOL_NAME (sym) = create_name (dip -> at_name, symbol_obstack);
- /* default assumptions */
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_TYPE (sym) = decode_die_type (dip);
- switch (dip -> dietag)
- {
- case TAG_label:
- SYMBOL_VALUE (sym) = dip -> at_low_pc + baseaddr;
- SYMBOL_CLASS (sym) = LOC_LABEL;
- break;
- case TAG_global_subroutine:
- case TAG_subroutine:
- SYMBOL_VALUE (sym) = dip -> at_low_pc + baseaddr;
- SYMBOL_TYPE (sym) = lookup_function_type (SYMBOL_TYPE (sym));
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- if (dip -> dietag == TAG_global_subroutine)
- {
- add_symbol_to_list (sym, &global_symbols);
- }
- else
- {
- add_symbol_to_list (sym, &scope -> symbols);
- }
- break;
- case TAG_global_variable:
- case TAG_local_variable:
- if (dip -> at_location != NULL)
- {
- SYMBOL_VALUE (sym) = locval (dip -> at_location);
- }
- if (dip -> dietag == TAG_global_variable)
- {
- add_symbol_to_list (sym, &global_symbols);
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE (sym) += baseaddr;
- }
- else
- {
- add_symbol_to_list (sym, &scope -> symbols);
- if (scope -> parent != NULL)
- {
- if (isreg)
- {
- SYMBOL_CLASS (sym) = LOC_REGISTER;
- }
- else
- {
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- }
- }
- else
- {
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE (sym) += baseaddr;
- }
- }
- break;
- case TAG_formal_parameter:
- if (dip -> at_location != NULL)
- {
- SYMBOL_VALUE (sym) = locval (dip -> at_location);
- }
- add_symbol_to_list (sym, &scope -> symbols);
- if (isreg)
- {
- SYMBOL_CLASS (sym) = LOC_REGPARM;
- }
- else
- {
- SYMBOL_CLASS (sym) = LOC_ARG;
- }
- break;
- case TAG_unspecified_parameters:
- /* From varargs functions; gdb doesn't seem to have any interest in
- this information, so just ignore it for now. (FIXME?) */
- break;
- case TAG_structure_type:
- case TAG_union_type:
- case TAG_enumeration_type:
- SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
- add_symbol_to_list (sym, &scope -> symbols);
- break;
- case TAG_typedef:
- SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- add_symbol_to_list (sym, &scope -> symbols);
- break;
- default:
- /* Not a tag we recognize. Hopefully we aren't processing trash
- data, but since we must specifically ignore things we don't
- recognize, there is nothing else we should do at this point. */
- break;
- }
- }
- return (sym);
-}
-
-/*
-
-LOCAL FUNCTION
-
- decode_mod_fund_type -- decode a modified fundamental type
-
-SYNOPSIS
-
- static struct type *decode_mod_fund_type (char *typedata)
-
-DESCRIPTION
-
- Decode a block of data containing a modified fundamental
- type specification. TYPEDATA is a pointer to the block,
- which consists of a two byte length, containing the size
- of the rest of the block. At the end of the block is a
- two byte value that gives the fundamental type. Everything
- in between are type modifiers.
-
- We simply compute the number of modifiers and call the general
- function decode_modified_type to do the actual work.
-*/
-
-static struct type *
-DEFUN(decode_mod_fund_type, (typedata), char *typedata)
-{
- struct type *typep = NULL;
- unsigned short modcount;
- unsigned char *modifiers;
-
- /* Get the total size of the block, exclusive of the size itself */
- (void) memcpy (&modcount, typedata, sizeof (short));
- /* Deduct the size of the fundamental type bytes at the end of the block. */
- modcount -= sizeof (short);
- /* Skip over the two size bytes at the beginning of the block. */
- modifiers = (unsigned char *) typedata + sizeof (short);
- /* Now do the actual decoding */
- typep = decode_modified_type (modifiers, modcount, AT_mod_fund_type);
- return (typep);
-}
-
-/*
-
-LOCAL FUNCTION
-
- decode_mod_u_d_type -- decode a modified user defined type
-
-SYNOPSIS
-
- static struct type *decode_mod_u_d_type (char *typedata)
-
-DESCRIPTION
-
- Decode a block of data containing a modified user defined
- type specification. TYPEDATA is a pointer to the block,
- which consists of a two byte length, containing the size
- of the rest of the block. At the end of the block is a
- four byte value that gives a reference to a user defined type.
- Everything in between are type modifiers.
-
- We simply compute the number of modifiers and call the general
- function decode_modified_type to do the actual work.
-*/
-
-static struct type *
-DEFUN(decode_mod_u_d_type, (typedata), char *typedata)
-{
- struct type *typep = NULL;
- unsigned short modcount;
- unsigned char *modifiers;
-
- /* Get the total size of the block, exclusive of the size itself */
- (void) memcpy (&modcount, typedata, sizeof (short));
- /* Deduct the size of the reference type bytes at the end of the block. */
- modcount -= sizeof (long);
- /* Skip over the two size bytes at the beginning of the block. */
- modifiers = (unsigned char *) typedata + sizeof (short);
- /* Now do the actual decoding */
- typep = decode_modified_type (modifiers, modcount, AT_mod_u_d_type);
- return (typep);
-}
-
-/*
-
-LOCAL FUNCTION
-
- decode_modified_type -- decode modified user or fundamental type
-
-SYNOPSIS
-
- static struct type *decode_modified_type (unsigned char *modifiers,
- unsigned short modcount, int mtype)
-
-DESCRIPTION
-
- Decode a modified type, either a modified fundamental type or
- a modified user defined type. MODIFIERS is a pointer to the
- block of bytes that define MODCOUNT modifiers. Immediately
- following the last modifier is a short containing the fundamental
- type or a long containing the reference to the user defined
- type. Which one is determined by MTYPE, which is either
- AT_mod_fund_type or AT_mod_u_d_type to indicate what modified
- type we are generating.
-
- We call ourself recursively to generate each modified type,`
- until MODCOUNT reaches zero, at which point we have consumed
- all the modifiers and generate either the fundamental type or
- user defined type. When the recursion unwinds, each modifier
- is applied in turn to generate the full modified type.
-
-NOTES
-
- If we find a modifier that we don't recognize, and it is not one
- of those reserved for application specific use, then we issue a
- warning and simply ignore the modifier.
-
-BUGS
-
- We currently ignore MOD_const and MOD_volatile. (FIXME)
-
- */
-
-static struct type *
-DEFUN(decode_modified_type,
- (modifiers, modcount, mtype),
- unsigned char *modifiers AND unsigned short modcount AND int mtype)
-{
- struct type *typep = NULL;
- unsigned short fundtype;
- DIEREF dieref;
- unsigned char modifier;
-
- if (modcount == 0)
- {
- switch (mtype)
- {
- case AT_mod_fund_type:
- (void) memcpy (&fundtype, modifiers, sizeof (short));
- typep = decode_fund_type (fundtype);
- break;
- case AT_mod_u_d_type:
- (void) memcpy (&dieref, modifiers, sizeof (DIEREF));
- if ((typep = lookup_utype (dieref)) == NULL)
- {
- typep = alloc_utype (dieref, NULL);
- }
- break;
- default:
- SQUAWK (("botched modified type decoding (mtype 0x%x)", mtype));
- typep = builtin_type_int;
- break;
- }
- }
- else
- {
- modifier = *modifiers++;
- typep = decode_modified_type (modifiers, --modcount, mtype);
- switch (modifier)
- {
- case MOD_pointer_to:
- typep = lookup_pointer_type (typep);
- break;
- case MOD_reference_to:
- typep = lookup_reference_type (typep);
- break;
- case MOD_const:
- SQUAWK (("type modifier 'const' ignored")); /* FIXME */
- break;
- case MOD_volatile:
- SQUAWK (("type modifier 'volatile' ignored")); /* FIXME */
- break;
- default:
- if (!(MOD_lo_user <= modifier && modifier <= MOD_hi_user))
- {
- SQUAWK (("unknown type modifier %u", modifier));
- }
- break;
- }
- }
- return (typep);
-}
-
-/*
-
-LOCAL FUNCTION
-
- decode_fund_type -- translate basic DWARF type to gdb base type
-
-DESCRIPTION
-
- Given an integer that is one of the fundamental DWARF types,
- translate it to one of the basic internal gdb types and return
- a pointer to the appropriate gdb type (a "struct type *").
-
-NOTES
-
- If we encounter a fundamental type that we are unprepared to
- deal with, and it is not in the range of those types defined
- as application specific types, then we issue a warning and
- treat the type as builtin_type_int.
-*/
-
-static struct type *
-DEFUN(decode_fund_type, (fundtype), unsigned short fundtype)
-{
- struct type *typep = NULL;
-
- switch (fundtype)
- {
-
- case FT_void:
- typep = builtin_type_void;
- break;
-
- case FT_pointer: /* (void *) */
- typep = lookup_pointer_type (builtin_type_void);
- break;
-
- case FT_char:
- case FT_signed_char:
- typep = builtin_type_char;
- break;
-
- case FT_short:
- case FT_signed_short:
- typep = builtin_type_short;
- break;
-
- case FT_integer:
- case FT_signed_integer:
- case FT_boolean: /* Was FT_set in AT&T version */
- typep = builtin_type_int;
- break;
-
- case FT_long:
- case FT_signed_long:
- typep = builtin_type_long;
- break;
-
- case FT_float:
- typep = builtin_type_float;
- break;
-
- case FT_dbl_prec_float:
- typep = builtin_type_double;
- break;
-
- case FT_unsigned_char:
- typep = builtin_type_unsigned_char;
- break;
-
- case FT_unsigned_short:
- typep = builtin_type_unsigned_short;
- break;
-
- case FT_unsigned_integer:
- typep = builtin_type_unsigned_int;
- break;
-
- case FT_unsigned_long:
- typep = builtin_type_unsigned_long;
- break;
-
- case FT_ext_prec_float:
- typep = builtin_type_long_double;
- break;
-
- case FT_complex:
- typep = builtin_type_complex;
- break;
-
- case FT_dbl_prec_complex:
- typep = builtin_type_double_complex;
- break;
-
- case FT_long_long:
- case FT_signed_long_long:
- typep = builtin_type_long_long;
- break;
-
- case FT_unsigned_long_long:
- typep = builtin_type_unsigned_long_long;
- break;
-
- }
-
- if ((typep == NULL) && !(FT_lo_user <= fundtype && fundtype <= FT_hi_user))
- {
- SQUAWK (("unexpected fundamental type 0x%x", fundtype));
- typep = builtin_type_void;
- }
-
- return (typep);
-}
-
-/*
-
-LOCAL FUNCTION
-
- create_name -- allocate a fresh copy of a string on an obstack
-
-DESCRIPTION
-
- Given a pointer to a string and a pointer to an obstack, allocates
- a fresh copy of the string on the specified obstack.
-
-*/
-
-static char *
-DEFUN(create_name, (name, obstackp), char *name AND struct obstack *obstackp)
-{
- int length;
- char *newname;
-
- length = strlen (name) + 1;
- newname = (char *) obstack_alloc (obstackp, length);
- (void) strcpy (newname, name);
- return (newname);
-}
-
-/*
-
-LOCAL FUNCTION
-
- basicdieinfo -- extract the minimal die info from raw die data
-
-SYNOPSIS
-
- void basicdieinfo (char *diep, struct dieinfo *dip)
-
-DESCRIPTION
-
- Given a pointer to raw DIE data, and a pointer to an instance of a
- die info structure, this function extracts the basic information
- from the DIE data required to continue processing this DIE, along
- with some bookkeeping information about the DIE.
-
- The information we absolutely must have includes the DIE tag,
- and the DIE length. If we need the sibling reference, then we
- will have to call completedieinfo() to process all the remaining
- DIE information.
-
- Note that since there is no guarantee that the data is properly
- aligned in memory for the type of access required (indirection
- through anything other than a char pointer), we use memcpy to
- shuffle data items larger than a char. Possibly inefficient, but
- quite portable.
-
- We also take care of some other basic things at this point, such
- as ensuring that the instance of the die info structure starts
- out completely zero'd and that curdie is initialized for use
- in error reporting if we have a problem with the current die.
-
-NOTES
-
- All DIE's must have at least a valid length, thus the minimum
- DIE size is sizeof (long). In order to have a valid tag, the
- DIE size must be at least sizeof (short) larger, otherwise they
- are forced to be TAG_padding DIES.
-
- Padding DIES must be at least sizeof(long) in length, implying that
- if a padding DIE is used for alignment and the amount needed is less
- than sizeof(long) then the padding DIE has to be big enough to align
- to the next alignment boundry.
- */
-
-static void
-DEFUN(basicdieinfo, (dip, diep), struct dieinfo *dip AND char *diep)
-{
- curdie = dip;
- (void) memset (dip, 0, sizeof (struct dieinfo));
- dip -> die = diep;
- dip -> dieref = dbroff + (diep - dbbase);
- (void) memcpy (&dip -> dielength, diep, sizeof (long));
- if (dip -> dielength < sizeof (long))
- {
- dwarfwarn ("malformed DIE, bad length (%d bytes)", dip -> dielength);
- }
- else if (dip -> dielength < (sizeof (long) + sizeof (short)))
- {
- dip -> dietag = TAG_padding;
- }
- else
- {
- (void) memcpy (&dip -> dietag, diep + sizeof (long), sizeof (short));
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- completedieinfo -- finish reading the information for a given DIE
-
-SYNOPSIS
-
- void completedieinfo (struct dieinfo *dip)
-
-DESCRIPTION
-
- Given a pointer to an already partially initialized die info structure,
- scan the raw DIE data and finish filling in the die info structure
- from the various attributes found.
-
- Note that since there is no guarantee that the data is properly
- aligned in memory for the type of access required (indirection
- through anything other than a char pointer), we use memcpy to
- shuffle data items larger than a char. Possibly inefficient, but
- quite portable.
-
-NOTES
-
- Each time we are called, we increment the diecount variable, which
- keeps an approximate count of the number of dies processed for
- each compilation unit. This information is presented to the user
- if the info_verbose flag is set.
-
- */
-
-static void
-DEFUN(completedieinfo, (dip), struct dieinfo *dip)
-{
- char *diep; /* Current pointer into raw DIE data */
- char *end; /* Terminate DIE scan here */
- unsigned short attr; /* Current attribute being scanned */
- unsigned short form; /* Form of the attribute */
- short block2sz; /* Size of a block2 attribute field */
- long block4sz; /* Size of a block4 attribute field */
-
- diecount++;
- diep = dip -> die;
- end = diep + dip -> dielength;
- diep += sizeof (long) + sizeof (short);
- while (diep < end)
- {
- (void) memcpy (&attr, diep, sizeof (short));
- diep += sizeof (short);
- switch (attr)
- {
- case AT_fund_type:
- (void) memcpy (&dip -> at_fund_type, diep, sizeof (short));
- break;
- case AT_ordering:
- (void) memcpy (&dip -> at_ordering, diep, sizeof (short));
- break;
- case AT_bit_offset:
- (void) memcpy (&dip -> at_bit_offset, diep, sizeof (short));
- break;
- case AT_visibility:
- (void) memcpy (&dip -> at_visibility, diep, sizeof (short));
- break;
- case AT_sibling:
- (void) memcpy (&dip -> at_sibling, diep, sizeof (long));
- break;
- case AT_stmt_list:
- (void) memcpy (&dip -> at_stmt_list, diep, sizeof (long));
- dip -> has_at_stmt_list = 1;
- break;
- case AT_low_pc:
- (void) memcpy (&dip -> at_low_pc, diep, sizeof (long));
- dip -> has_at_low_pc = 1;
- break;
- case AT_high_pc:
- (void) memcpy (&dip -> at_high_pc, diep, sizeof (long));
- break;
- case AT_language:
- (void) memcpy (&dip -> at_language, diep, sizeof (long));
- break;
- case AT_user_def_type:
- (void) memcpy (&dip -> at_user_def_type, diep, sizeof (long));
- break;
- case AT_byte_size:
- (void) memcpy (&dip -> at_byte_size, diep, sizeof (long));
- break;
- case AT_bit_size:
- (void) memcpy (&dip -> at_bit_size, diep, sizeof (long));
- break;
- case AT_member:
- (void) memcpy (&dip -> at_member, diep, sizeof (long));
- break;
- case AT_discr:
- (void) memcpy (&dip -> at_discr, diep, sizeof (long));
- break;
- case AT_import:
- (void) memcpy (&dip -> at_import, diep, sizeof (long));
- break;
- case AT_location:
- dip -> at_location = diep;
- break;
- case AT_mod_fund_type:
- dip -> at_mod_fund_type = diep;
- break;
- case AT_subscr_data:
- dip -> at_subscr_data = diep;
- break;
- case AT_mod_u_d_type:
- dip -> at_mod_u_d_type = diep;
- break;
- case AT_element_list:
- dip -> at_element_list = diep;
- break;
- case AT_discr_value:
- dip -> at_discr_value = diep;
- break;
- case AT_string_length:
- dip -> at_string_length = diep;
- break;
- case AT_name:
- dip -> at_name = diep;
- break;
- case AT_comp_dir:
- dip -> at_comp_dir = diep;
- break;
- case AT_producer:
- dip -> at_producer = diep;
- break;
- case AT_frame_base:
- (void) memcpy (&dip -> at_frame_base, diep, sizeof (long));
- break;
- case AT_start_scope:
- (void) memcpy (&dip -> at_start_scope, diep, sizeof (long));
- break;
- case AT_stride_size:
- (void) memcpy (&dip -> at_stride_size, diep, sizeof (long));
- break;
- case AT_src_info:
- (void) memcpy (&dip -> at_src_info, diep, sizeof (long));
- break;
- case AT_prototyped:
- (void) memcpy (&dip -> at_prototyped, diep, sizeof (short));
- break;
- default:
- /* Found an attribute that we are unprepared to handle. However
- it is specifically one of the design goals of DWARF that
- consumers should ignore unknown attributes. As long as the
- form is one that we recognize (so we know how to skip it),
- we can just ignore the unknown attribute. */
- break;
- }
- form = attr & 0xF;
- switch (form)
- {
- case FORM_DATA2:
- diep += sizeof (short);
- break;
- case FORM_DATA4:
- diep += sizeof (long);
- break;
- case FORM_DATA8:
- diep += 8 * sizeof (char); /* sizeof (long long) ? */
- break;
- case FORM_ADDR:
- case FORM_REF:
- diep += sizeof (long);
- break;
- case FORM_BLOCK2:
- (void) memcpy (&block2sz, diep, sizeof (short));
- block2sz += sizeof (short);
- diep += block2sz;
- break;
- case FORM_BLOCK4:
- (void) memcpy (&block4sz, diep, sizeof (long));
- block4sz += sizeof (long);
- diep += block4sz;
- break;
- case FORM_STRING:
- diep += strlen (diep) + 1;
- break;
- default:
- SQUAWK (("unknown attribute form (0x%x), skipped rest", form));
- diep = end;
- break;
- }
- }
-}
diff --git a/gdb/elfread.c b/gdb/elfread.c
deleted file mode 100644
index d203e2e..0000000
--- a/gdb/elfread.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/* Read ELF (Executable and Linking Format) object files for GDB.
- Copyright (C) 1991 Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/************************************************************************
- * *
- * NOTICE *
- * *
- * This file is still under construction. When it is complete, this *
- * notice will be removed. Until then, direct any questions or changes *
- * to Fred Fish at Cygnus Support (fnf@cygint) *
- * *
- * FIXME Still needs support for shared libraries. *
- * FIXME Still needs support for core files. *
- * FIXME The ".debug" and ".line" section names are hardwired. *
- * FIXME Still needs support ELF symbol tables (as distinct *
- * from DWARF support). Can use them to build the misc *
- * function vector at least. This is fairly trivial once *
- * bfd is extended to handle ELF symbol tables. *
- * *
- ************************************************************************/
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "elf-common.h"
-#include "elf-external.h"
-#include "elf-internal.h"
-#include "bfd.h"
-#include "symfile.h"
-#include "symtab.h"
-#include "ansidecl.h"
-
-extern int EXFUN (strcmp, (CONST char *a, CONST char *b));
-extern int EXFUN (dwarf_build_psymtabs,
- (int desc, char *filename, CORE_ADDR addr, int mainline,
- unsigned int dbfoff, unsigned int dbsize, unsigned int lnoffset,
- unsigned int lnsize, struct objfile *objfile));
-
-#define STREQ(a,b) (strcmp((a),(b))==0)
-
-struct elfinfo {
- unsigned int dboffset; /* Offset to dwarf debug section */
- unsigned int dbsize; /* Size of dwarf debug section */
- unsigned int lnoffset; /* Offset to dwarf line number section */
- unsigned int lnsize; /* Size of dwarf line number section */
-};
-
-/* We are called once per section from elf_symfile_read. We
- need to examine each section we are passed, check to see
- if it is something we are interested in processing, and
- if so, stash away some access information for the section.
-
- For now we recognize the dwarf debug information sections and
- line number sections from matching their section names. The
- ELF definition is no real help here since it has no direct
- knowledge of DWARF (by design, so any debugging format can be
- used).
-
- FIXME: The section names should not be hardwired strings. */
-
-static void
-DEFUN(elf_locate_sections, (abfd, sectp, ei),
- bfd *abfd AND
- asection *sectp AND
- struct elfinfo *ei)
-{
- if (STREQ (sectp -> name, ".debug"))
- {
- ei -> dboffset = sectp -> filepos;
- ei -> dbsize = sectp -> size;
- }
- else if (STREQ (sectp -> name, ".line"))
- {
- ei -> lnoffset = sectp -> filepos;
- ei -> lnsize = sectp -> size;
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- record_misc_function -- add entry to miscellaneous function vector
-
-SYNOPSIS
-
- static void record_misc_function (char *name, CORE_ADDR address)
-
-DESCRIPTION
-
- Given a pointer to the name of a symbol that should be added to the
- miscellaneous function vector, and the address associated with that
- symbol, records this information for later use in building the
- miscellaneous function vector.
-
-NOTES
-
- FIXME: For now we just use mf_unknown as the type. This should be
- fixed.
- */
-
-static void
-DEFUN(record_misc_function, (name, address), char *name AND CORE_ADDR address)
-{
- prim_record_misc_function (obsavestring (name, strlen (name)), address,
- mf_unknown);
-}
-
-static void
-DEFUN (elf_symtab_read, (abfd, addr),
- bfd *abfd AND
- CORE_ADDR addr)
-{
- unsigned int storage_needed;
- asymbol *sym;
- asymbol **symbol_table;
- unsigned int number_of_symbols;
- unsigned int i;
- struct cleanup *back_to;
-
- storage_needed = get_symtab_upper_bound (abfd);
-
- if (storage_needed > 0)
- {
- symbol_table = (asymbol **) bfd_xmalloc (storage_needed);
- back_to = make_cleanup (free, symbol_table);
- number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
-
- for (i = 0; i < number_of_symbols; i++)
- {
- sym = *symbol_table++;
- /* Select global symbols that are defined in a specific section
- or are absolute. */
- if (sym -> flags & BSF_GLOBAL
- && ((sym -> section != NULL) || (sym -> flags & BSF_ABSOLUTE)))
- {
- record_misc_function ((char *) sym -> name, sym -> value);
- }
- }
- do_cleanups (back_to);
- }
-}
-
-/* Scan and build partial symbols for a symbol file.
- We have been initialized by a call to elf_symfile_init, which
- currently does nothing.
-
- ADDR is the address relative to which the symbols in it are (e.g.
- the base address of the text segment).
-
- MAINLINE is true if we are reading the main symbol
- table (as opposed to a shared lib or dynamically loaded file).
-
- This function only does the minimum work necessary for letting the
- user "name" things symbolically; it does not read the entire symtab.
- Instead, it reads the external and static symbols and puts them in partial
- symbol tables. When more extensive information is requested of a
- file, the corresponding partial symbol table is mutated into a full
- fledged symbol table by going back and reading the symbols
- for real. The function dwarf_psymtab_to_symtab() is the function that
- does this for DWARF symbols.
-
- Note that ELF files have a "minimal" symbol table, which looks a lot
- like a COFF symbol table, but has only the minimal information necessary
- for linking. We process this also, and just use the information to
- add to the misc function vector. This gives us some minimal debugging
- capability even for files compiled without -g.
- */
-
-static void
-DEFUN(elf_symfile_read, (sf, addr, mainline),
- struct sym_fns *sf AND
- CORE_ADDR addr AND
- int mainline)
-{
- bfd *abfd = sf->objfile->obfd;
- struct elfinfo ei;
- struct cleanup *back_to;
-
- init_misc_bunches ();
- back_to = make_cleanup (discard_misc_bunches, 0);
-
- /* Process the normal ELF symbol table first. */
-
- elf_symtab_read (abfd, addr);
-
- /* Now process the DWARF debugging information, which is contained in
- special ELF sections. We first have to find them... */
-
- (void) memset ((char *) &ei, 0, sizeof (ei));
- bfd_map_over_sections (abfd, elf_locate_sections, &ei);
- if (ei.dboffset && ei.lnoffset)
- {
- addr = 0; /* FIXME: force address base to zero for now */
- dwarf_build_psymtabs (fileno ((FILE *)(abfd -> iostream)),
- bfd_get_filename (abfd),
- addr, mainline,
- ei.dboffset, ei.dbsize,
- ei.lnoffset, ei.lnsize, sf->objfile);
- }
-
- if (!partial_symtab_list)
- {
- wrap_here ("");
- printf_filtered ("(no debugging symbols found)...");
- wrap_here ("");
- }
-
- /* Go over the miscellaneous functions and install them in the
- miscellaneous function vector. */
-
- condense_misc_bunches (!mainline);
- do_cleanups (back_to);
-}
-
-/* Initialize anything that needs initializing when a completely new symbol
- file is specified (not just adding some symbols from another file, e.g. a
- shared library).
-
- For now at least, we have nothing in particular to do, so this function is
- just a stub. */
-
-static void
-DEFUN_VOID (elf_new_init)
-{
-}
-
-/* ELF specific initialization routine for reading symbols.
-
- It is passed a pointer to a struct sym_fns which contains, among other
- things, the BFD for the file whose symbols are being read, and a slot for
- a pointer to "private data" which we can fill with goodies.
-
- For now at least, we have nothing in particular to do, so this function is
- just a stub. */
-
-static void
-DEFUN(elf_symfile_init, (sf),
- struct sym_fns *sf)
-{
-}
-
-
-/* Register that we are able to handle ELF object file formats and DWARF
- debugging formats.
-
- Unlike other object file formats, where the debugging information format
- is implied by the object file format, the ELF object file format and the
- DWARF debugging information format are two distinct, and potentially
- separate entities. I.E. it is perfectly possible to have ELF objects
- with debugging formats other than DWARF. And it is conceivable that the
- DWARF debugging format might be used with another object file format,
- like COFF, by simply using COFF's custom section feature.
-
- GDB, and to a lesser extent BFD, should support the notion of separate
- object file formats and debugging information formats. For now, we just
- use "elf" in the same sense as "a.out" or "coff", to imply both the ELF
- object file format and the DWARF debugging format. */
-
-static struct sym_fns elf_sym_fns = {
- "elf", /* sym_name: name or name prefix of BFD target type */
- 3, /* sym_namelen: number of significant sym_name chars */
- elf_new_init, /* sym_new_init: init anything gbl to entire symtab */
- elf_symfile_init, /* sym_init: read initial info, setup for sym_read() */
- elf_symfile_read, /* sym_read: read a symbol file into symtab */
- NULL, /* sym_bfd: accessor for symbol file being read */
- NULL, /* sym_private: sym_init & sym_read shared info */
- NULL /* next: pointer to next struct sym_fns */
-};
-
-void
-DEFUN_VOID (_initialize_elfread)
-{
- add_symtab_fns (&elf_sym_fns);
-}
diff --git a/gdb/environ.c b/gdb/environ.c
deleted file mode 100644
index 45767e5..0000000
--- a/gdb/environ.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/* environ.c -- library for manipulating environments for GNU.
- Copyright (C) 1986, 1989 Free Software Foundation, Inc.
-
- 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#define max(a, b) ((a) > (b) ? (a) : (b))
-
-#include "environ.h"
-#include <string.h>
-
-extern char *xmalloc ();
-extern char *xrealloc ();
-extern void free ();
-
-/* Return a new environment object. */
-
-struct environ *
-make_environ ()
-{
- register struct environ *e;
-
- e = (struct environ *) xmalloc (sizeof (struct environ));
-
- e->allocated = 10;
- e->vector = (char **) xmalloc ((e->allocated + 1) * sizeof (char *));
- e->vector[0] = 0;
- return e;
-}
-
-/* Free an environment and all the strings in it. */
-
-void
-free_environ (e)
- register struct environ *e;
-{
- register char **vector = e->vector;
-
- while (*vector)
- free (*vector++);
-
- free (e);
-}
-
-/* Copy the environment given to this process into E.
- Also copies all the strings in it, so we can be sure
- that all strings in these environments are safe to free. */
-
-void
-init_environ (e)
- register struct environ *e;
-{
- extern char **environ;
- register int i;
-
- for (i = 0; environ[i]; i++) /*EMPTY*/;
-
- if (e->allocated < i)
- {
- e->allocated = max (i, e->allocated + 10);
- e->vector = (char **) xrealloc ((char *)e->vector,
- (e->allocated + 1) * sizeof (char *));
- }
-
- bcopy (environ, e->vector, (i + 1) * sizeof (char *));
-
- while (--i >= 0)
- {
- register int len = strlen (e->vector[i]);
- register char *new = (char *) xmalloc (len + 1);
- bcopy (e->vector[i], new, len + 1);
- e->vector[i] = new;
- }
-}
-
-/* Return the vector of environment E.
- This is used to get something to pass to execve. */
-
-char **
-environ_vector (e)
- struct environ *e;
-{
- return e->vector;
-}
-
-/* Return the value in environment E of variable VAR. */
-
-char *
-get_in_environ (e, var)
- struct environ *e;
- char *var;
-{
- register int len = strlen (var);
- register char **vector = e->vector;
- register char *s;
-
- for (; s = *vector; vector++)
- if (!strncmp (s, var, len)
- && s[len] == '=')
- return &s[len + 1];
-
- return 0;
-}
-
-/* Store the value in E of VAR as VALUE. */
-
-void
-set_in_environ (e, var, value)
- struct environ *e;
- char *var;
- char *value;
-{
- register int i;
- register int len = strlen (var);
- register char **vector = e->vector;
- register char *s;
-
- for (i = 0; s = vector[i]; i++)
- if (!strncmp (s, var, len)
- && s[len] == '=')
- break;
-
- if (s == 0)
- {
- if (i == e->allocated)
- {
- e->allocated += 10;
- vector = (char **) xrealloc ((char *)vector,
- (e->allocated + 1) * sizeof (char *));
- e->vector = vector;
- }
- vector[i + 1] = 0;
- }
- else
- free (s);
-
- s = (char *) xmalloc (len + strlen (value) + 2);
- strcpy (s, var);
- strcat (s, "=");
- strcat (s, value);
- vector[i] = s;
-
- /* Certain variables get exported back to the parent (e.g. our)
- environment, too. */
- if (!strcmp(var, "PATH") /* Object file location */
- || !strcmp (var, "G960BASE") /* Intel 960 downloads */
- || !strcmp (var, "G960BIN") /* Intel 960 downloads */
- || !strcmp (var, "GNUTARGET") /* BFD object file type */
- ) {
- putenv (strsave (s));
- }
- return;
-}
-
-/* Remove the setting for variable VAR from environment E. */
-
-void
-unset_in_environ (e, var)
- struct environ *e;
- char *var;
-{
- register int len = strlen (var);
- register char **vector = e->vector;
- register char *s;
-
- for (; s = *vector; vector++)
- if (!strncmp (s, var, len)
- && s[len] == '=')
- {
- free (s);
- bcopy (vector + 1, vector,
- (e->allocated - (vector - e->vector)) * sizeof (char *));
- e->vector[e->allocated - 1] = 0;
- return;
- }
-}
diff --git a/gdb/environ.h b/gdb/environ.h
deleted file mode 100644
index 13f31f4..0000000
--- a/gdb/environ.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Header for environment manipulation library.
- Copyright (C) 1989, Free Software Foundation.
-
- 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* We manipulate environments represented as these structures. */
-
-struct environ
-{
- /* Number of usable slots allocated in VECTOR.
- VECTOR always has one slot not counted here,
- to hold the terminating zero. */
- int allocated;
- /* A vector of slots, ALLOCATED + 1 of them.
- The first few slots contain strings "VAR=VALUE"
- and the next one contains zero.
- Then come some unused slots. */
- char **vector;
-};
-
-struct environ *make_environ ();
-void free_environ ();
-void init_environ ();
-char *get_in_environ ();
-void set_in_environ ();
-void unset_in_environ ();
-char **environ_vector ();
diff --git a/gdb/eval.c b/gdb/eval.c
deleted file mode 100644
index 0694d15..0000000
--- a/gdb/eval.c
+++ /dev/null
@@ -1,1054 +0,0 @@
-/* Evaluate expressions for GDB.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "value.h"
-#include "expression.h"
-#include "target.h"
-#include "frame.h"
-
-#define NULL_TYPE ((struct type *)0)
-
-
-/* Parse the string EXP as a C expression, evaluate it,
- and return the result as a number. */
-
-CORE_ADDR
-parse_and_eval_address (exp)
- char *exp;
-{
- struct expression *expr = parse_expression (exp);
- register CORE_ADDR addr;
- register struct cleanup *old_chain
- = make_cleanup (free_current_contents, &expr);
-
- addr = value_as_pointer (evaluate_expression (expr));
- do_cleanups (old_chain);
- return addr;
-}
-
-/* Like parse_and_eval_address but takes a pointer to a char * variable
- and advanced that variable across the characters parsed. */
-
-CORE_ADDR
-parse_and_eval_address_1 (expptr)
- char **expptr;
-{
- struct expression *expr = parse_exp_1 (expptr, (struct block *)0, 0);
- register CORE_ADDR addr;
- register struct cleanup *old_chain
- = make_cleanup (free_current_contents, &expr);
-
- addr = value_as_pointer (evaluate_expression (expr));
- do_cleanups (old_chain);
- return addr;
-}
-
-value
-parse_and_eval (exp)
- char *exp;
-{
- struct expression *expr = parse_expression (exp);
- register value val;
- register struct cleanup *old_chain
- = make_cleanup (free_current_contents, &expr);
-
- val = evaluate_expression (expr);
- do_cleanups (old_chain);
- return val;
-}
-
-/* Parse up to a comma (or to a closeparen)
- in the string EXPP as an expression, evaluate it, and return the value.
- EXPP is advanced to point to the comma. */
-
-value
-parse_to_comma_and_eval (expp)
- char **expp;
-{
- struct expression *expr = parse_exp_1 (expp, (struct block *) 0, 1);
- register value val;
- register struct cleanup *old_chain
- = make_cleanup (free_current_contents, &expr);
-
- val = evaluate_expression (expr);
- do_cleanups (old_chain);
- return val;
-}
-
-/* Evaluate an expression in internal prefix form
- such as is constructed by expread.y.
-
- See expression.h for info on the format of an expression. */
-
-static value evaluate_subexp ();
-static value evaluate_subexp_for_address ();
-static value evaluate_subexp_for_sizeof ();
-static value evaluate_subexp_with_coercion ();
-
-/* Values of NOSIDE argument to eval_subexp. */
-enum noside
-{ EVAL_NORMAL,
- EVAL_SKIP, /* Only effect is to increment pos. */
- EVAL_AVOID_SIDE_EFFECTS, /* Don't modify any variables or
- call any functions. The value
- returned will have the correct
- type, and will have an
- approximately correct lvalue
- type (inaccuracy: anything that is
- listed as being in a register in
- the function in which it was
- declared will be lval_register). */
-};
-
-value
-evaluate_expression (exp)
- struct expression *exp;
-{
- int pc = 0;
- return evaluate_subexp (NULL_TYPE, exp, &pc, EVAL_NORMAL);
-}
-
-/* Evaluate an expression, avoiding all memory references
- and getting a value whose type alone is correct. */
-
-value
-evaluate_type (exp)
- struct expression *exp;
-{
- int pc = 0;
- return evaluate_subexp (NULL_TYPE, exp, &pc, EVAL_AVOID_SIDE_EFFECTS);
-}
-
-static value
-evaluate_subexp (expect_type, exp, pos, noside)
- struct type *expect_type;
- register struct expression *exp;
- register int *pos;
- enum noside noside;
-{
- enum exp_opcode op;
- int tem;
- register int pc, pc2, oldpos;
- register value arg1, arg2, arg3;
- int nargs;
- value *argvec;
-
- pc = (*pos)++;
- op = exp->elts[pc].opcode;
-
- switch (op)
- {
- case OP_SCOPE:
- tem = strlen (&exp->elts[pc + 2].string);
- (*pos) += 3 + ((tem + sizeof (union exp_element))
- / sizeof (union exp_element));
- arg1 = value_static_field (exp->elts[pc + 1].type,
- &exp->elts[pc + 2].string, -1);
- if (arg1 == NULL)
- error ("There is no field named %s", &exp->elts[pc + 2].string);
- return arg1;
-
- case OP_LONG:
- (*pos) += 3;
- return value_from_longest (exp->elts[pc + 1].type,
- exp->elts[pc + 2].longconst);
-
- case OP_DOUBLE:
- (*pos) += 3;
- return value_from_double (exp->elts[pc + 1].type,
- exp->elts[pc + 2].doubleconst);
-
- case OP_VAR_VALUE:
- (*pos) += 2;
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
- struct symbol * sym = exp->elts[pc + 1].symbol;
- enum lval_type lv;
-
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_CONST:
- case LOC_LABEL:
- case LOC_CONST_BYTES:
- lv = not_lval;
- break;
-
- case LOC_REGISTER:
- case LOC_REGPARM:
- lv = lval_register;
- break;
-
- default:
- lv = lval_memory;
- break;
- }
-
- return value_zero (SYMBOL_TYPE (sym), lv);
- }
- else
- return value_of_variable (exp->elts[pc + 1].symbol);
-
- case OP_LAST:
- (*pos) += 2;
- return
- access_value_history (longest_to_int (exp->elts[pc + 1].longconst));
-
- case OP_REGISTER:
- (*pos) += 2;
- return value_of_register (longest_to_int (exp->elts[pc + 1].longconst));
-
- case OP_INTERNALVAR:
- (*pos) += 2;
- return value_of_internalvar (exp->elts[pc + 1].internalvar);
-
- case OP_STRING:
- tem = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + ((tem + sizeof (union exp_element))
- / sizeof (union exp_element));
- if (noside == EVAL_SKIP)
- goto nosideret;
- return value_string (&exp->elts[pc + 1].string, tem);
-
- case TERNOP_COND:
- /* Skip third and second args to evaluate the first one. */
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (value_zerop (arg1))
- {
- evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- return evaluate_subexp (NULL_TYPE, exp, pos, noside);
- }
- else
- {
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- return arg2;
- }
-
- case OP_FUNCALL:
- (*pos) += 2;
- op = exp->elts[*pos].opcode;
- if (op == STRUCTOP_MEMBER || op == STRUCTOP_MPTR)
- {
- int fnptr;
-
- nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1;
- /* First, evaluate the structure into arg2 */
- pc2 = (*pos)++;
-
- if (noside == EVAL_SKIP)
- goto nosideret;
-
- if (op == STRUCTOP_MEMBER)
- {
- arg2 = evaluate_subexp_for_address (exp, pos, noside);
- }
- else
- {
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- }
-
- /* If the function is a virtual function, then the
- aggregate value (providing the structure) plays
- its part by providing the vtable. Otherwise,
- it is just along for the ride: call the function
- directly. */
-
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-
- fnptr = longest_to_int (value_as_long (arg1));
- /* FIXME-tiemann: this is way obsolete. */
- if (fnptr < 128)
- {
- struct type *basetype;
- int i, j;
- basetype = TYPE_TARGET_TYPE (VALUE_TYPE (arg2));
- basetype = TYPE_VPTR_BASETYPE (basetype);
- for (i = TYPE_NFN_FIELDS (basetype) - 1; i >= 0; i--)
- {
- struct fn_field *f = TYPE_FN_FIELDLIST1 (basetype, i);
- /* If one is virtual, then all are virtual. */
- if (TYPE_FN_FIELD_VIRTUAL_P (f, 0))
- for (j = TYPE_FN_FIELDLIST_LENGTH (basetype, i) - 1; j >= 0; --j)
- if (TYPE_FN_FIELD_VOFFSET (f, j) == fnptr)
- {
- value vtbl;
- value base = value_ind (arg2);
- struct type *fntype = lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j));
-
- if (TYPE_VPTR_FIELDNO (basetype) < 0)
- fill_in_vptr_fieldno (basetype);
-
- VALUE_TYPE (base) = basetype;
- vtbl = value_field (base, TYPE_VPTR_FIELDNO (basetype));
- VALUE_TYPE (vtbl) = lookup_pointer_type (fntype);
- VALUE_TYPE (arg1) = builtin_type_int;
- arg1 = value_subscript (vtbl, arg1);
- VALUE_TYPE (arg1) = fntype;
- goto got_it;
- }
- }
- if (i < 0)
- error ("virtual function at index %d not found", fnptr);
- }
- else
- {
- VALUE_TYPE (arg1) = lookup_pointer_type (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)));
- }
- got_it:
-
- /* Now, say which argument to start evaluating from */
- tem = 2;
- }
- else if (op == STRUCTOP_STRUCT || op == STRUCTOP_PTR)
- {
- /* Hair for method invocations */
- int tem2;
-
- nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1;
- /* First, evaluate the structure into arg2 */
- pc2 = (*pos)++;
- tem2 = strlen (&exp->elts[pc2 + 1].string);
- *pos += 2 + (tem2 + sizeof (union exp_element)) / sizeof (union exp_element);
- if (noside == EVAL_SKIP)
- goto nosideret;
-
- if (op == STRUCTOP_STRUCT)
- {
- arg2 = evaluate_subexp_for_address (exp, pos, noside);
- }
- else
- {
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- }
- /* Now, say which argument to start evaluating from */
- tem = 2;
- }
- else
- {
- nargs = longest_to_int (exp->elts[pc + 1].longconst);
- tem = 0;
- }
- argvec = (value *) alloca (sizeof (value) * (nargs + 2));
- for (; tem <= nargs; tem++)
- /* Ensure that array expressions are coerced into pointer objects. */
- argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
-
- /* signal end of arglist */
- argvec[tem] = 0;
-
- if (op == STRUCTOP_STRUCT || op == STRUCTOP_PTR)
- {
- int static_memfuncp;
- value temp = arg2;
-
- argvec[1] = arg2;
- argvec[0] =
- value_struct_elt (&temp, argvec+1, &exp->elts[pc2 + 1].string,
- &static_memfuncp,
- op == STRUCTOP_STRUCT
- ? "structure" : "structure pointer");
- if (VALUE_OFFSET (temp))
- {
- arg2 = value_from_longest (lookup_pointer_type (VALUE_TYPE (temp)),
- value_as_long (arg2)+VALUE_OFFSET (temp));
- argvec[1] = arg2;
- }
- if (static_memfuncp)
- {
- argvec[1] = argvec[0];
- nargs--;
- argvec++;
- }
- }
- else if (op == STRUCTOP_MEMBER || op == STRUCTOP_MPTR)
- {
- argvec[1] = arg2;
- argvec[0] = arg1;
- }
-
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
- /* If the return type doesn't look like a function type, call an
- error. This can happen if somebody tries to turn a variable into
- a function call. This is here because people often want to
- call, eg, strcmp, which gdb doesn't know is a function. If
- gdb isn't asked for it's opinion (ie. through "whatis"),
- it won't offer it. */
-
- struct type *ftype =
- TYPE_TARGET_TYPE (VALUE_TYPE (argvec[0]));
-
- if (ftype)
- return allocate_value (TYPE_TARGET_TYPE (VALUE_TYPE (argvec[0])));
- else
- error ("Expression of type other than \"Function returning ...\" used as function");
- }
- return target_call_function (argvec[0], nargs, argvec + 1);
-
- case STRUCTOP_STRUCT:
- tem = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + ((tem + sizeof (union exp_element))
- / sizeof (union exp_element));
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (lookup_struct_elt_type (VALUE_TYPE (arg1),
- &exp->elts[pc + 1].string,
- 1),
- lval_memory);
- else
- {
- value temp = arg1;
- return value_struct_elt (&temp, (value *)0, &exp->elts[pc + 1].string,
- (int *) 0, "structure");
- }
-
- case STRUCTOP_PTR:
- tem = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (lookup_struct_elt_type (TYPE_TARGET_TYPE
- (VALUE_TYPE (arg1)),
- &exp->elts[pc + 1].string,
- 1),
- lval_memory);
- else
- {
- value temp = arg1;
- return value_struct_elt (&temp, (value *)0, &exp->elts[pc + 1].string,
- (int *) 0, "structure pointer");
- }
-
- case STRUCTOP_MEMBER:
- arg1 = evaluate_subexp_for_address (exp, pos, noside);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- /* Now, convert these values to an address. */
- if (TYPE_CODE (VALUE_TYPE (arg2)) != TYPE_CODE_PTR
- || ((TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2)))
- != TYPE_CODE_MEMBER)
- && (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2)))
- != TYPE_CODE_METHOD)))
- error ("non-pointer-to-member value used in pointer-to-member construct");
- arg3 = value_from_longest (
- lookup_pointer_type (TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2)))),
- value_as_long (arg1) + value_as_long (arg2));
- return value_ind (arg3);
-
- case STRUCTOP_MPTR:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- /* Now, convert these values to an address. */
- if (TYPE_CODE (VALUE_TYPE (arg2)) != TYPE_CODE_PTR
- || (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) != TYPE_CODE_MEMBER
- && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) != TYPE_CODE_METHOD))
- error ("non-pointer-to-member value used in pointer-to-member construct");
- arg3 = value_from_longest (
- lookup_pointer_type (TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2)))),
- value_as_long (arg1) + value_as_long (arg2));
- return value_ind (arg3);
-
- case BINOP_ASSIGN:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
- if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
- return arg1;
- if (binop_user_defined_p (op, arg1, arg2))
- return value_x_binop (arg1, arg2, op, OP_NULL);
- else
- return value_assign (arg1, arg2);
-
- case BINOP_ASSIGN_MODIFY:
- (*pos) += 2;
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
- if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
- return arg1;
- op = exp->elts[pc + 1].opcode;
- if (binop_user_defined_p (op, arg1, arg2))
- return value_x_binop (arg1, arg2, BINOP_ASSIGN_MODIFY, op);
- else if (op == BINOP_ADD)
- arg2 = value_add (arg1, arg2);
- else if (op == BINOP_SUB)
- arg2 = value_sub (arg1, arg2);
- else
- arg2 = value_binop (arg1, arg2, op);
- return value_assign (arg1, arg2);
-
- case BINOP_ADD:
- arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (binop_user_defined_p (op, arg1, arg2))
- return value_x_binop (arg1, arg2, op, OP_NULL);
- else
- return value_add (arg1, arg2);
-
- case BINOP_SUB:
- arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (binop_user_defined_p (op, arg1, arg2))
- return value_x_binop (arg1, arg2, op, OP_NULL);
- else
- return value_sub (arg1, arg2);
-
- case BINOP_MUL:
- case BINOP_DIV:
- case BINOP_REM:
- case BINOP_LSH:
- case BINOP_RSH:
- case BINOP_LOGAND:
- case BINOP_LOGIOR:
- case BINOP_LOGXOR:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (binop_user_defined_p (op, arg1, arg2))
- return value_x_binop (arg1, arg2, op, OP_NULL);
- else
- if (noside == EVAL_AVOID_SIDE_EFFECTS
- && op == BINOP_DIV)
- return value_zero (VALUE_TYPE (arg1), not_lval);
- else
- return value_binop (arg1, arg2, op);
-
- case BINOP_SUBSCRIPT:
- arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)),
- VALUE_LVAL (arg1));
-
- if (binop_user_defined_p (op, arg1, arg2))
- return value_x_binop (arg1, arg2, op, OP_NULL);
- else
- return value_subscript (arg1, arg2);
-
- case BINOP_AND:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- {
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- goto nosideret;
- }
-
- oldpos = *pos;
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
- *pos = oldpos;
-
- if (binop_user_defined_p (op, arg1, arg2))
- {
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- return value_x_binop (arg1, arg2, op, OP_NULL);
- }
- else
- {
- tem = value_zerop (arg1);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos,
- (tem ? EVAL_SKIP : noside));
- return value_from_longest (builtin_type_int,
- (LONGEST) (!tem && !value_zerop (arg2)));
- }
-
- case BINOP_OR:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- {
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- goto nosideret;
- }
-
- oldpos = *pos;
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
- *pos = oldpos;
-
- if (binop_user_defined_p (op, arg1, arg2))
- {
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- return value_x_binop (arg1, arg2, op, OP_NULL);
- }
- else
- {
- tem = value_zerop (arg1);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos,
- (!tem ? EVAL_SKIP : noside));
- return value_from_longest (builtin_type_int,
- (LONGEST) (!tem || !value_zerop (arg2)));
- }
-
- case BINOP_EQUAL:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (binop_user_defined_p (op, arg1, arg2))
- {
- return value_x_binop (arg1, arg2, op, OP_NULL);
- }
- else
- {
- tem = value_equal (arg1, arg2);
- return value_from_longest (builtin_type_int, (LONGEST) tem);
- }
-
- case BINOP_NOTEQUAL:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (binop_user_defined_p (op, arg1, arg2))
- {
- return value_x_binop (arg1, arg2, op, OP_NULL);
- }
- else
- {
- tem = value_equal (arg1, arg2);
- return value_from_longest (builtin_type_int, (LONGEST) ! tem);
- }
-
- case BINOP_LESS:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (binop_user_defined_p (op, arg1, arg2))
- {
- return value_x_binop (arg1, arg2, op, OP_NULL);
- }
- else
- {
- tem = value_less (arg1, arg2);
- return value_from_longest (builtin_type_int, (LONGEST) tem);
- }
-
- case BINOP_GTR:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (binop_user_defined_p (op, arg1, arg2))
- {
- return value_x_binop (arg1, arg2, op, OP_NULL);
- }
- else
- {
- tem = value_less (arg2, arg1);
- return value_from_longest (builtin_type_int, (LONGEST) tem);
- }
-
- case BINOP_GEQ:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (binop_user_defined_p (op, arg1, arg2))
- {
- return value_x_binop (arg1, arg2, op, OP_NULL);
- }
- else
- {
- tem = value_less (arg1, arg2);
- return value_from_longest (builtin_type_int, (LONGEST) ! tem);
- }
-
- case BINOP_LEQ:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (binop_user_defined_p (op, arg1, arg2))
- {
- return value_x_binop (arg1, arg2, op, OP_NULL);
- }
- else
- {
- tem = value_less (arg2, arg1);
- return value_from_longest (builtin_type_int, (LONGEST) ! tem);
- }
-
- case BINOP_REPEAT:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (TYPE_CODE (VALUE_TYPE (arg2)) != TYPE_CODE_INT)
- error ("Non-integral right operand for \"@\" operator.");
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return allocate_repeat_value (VALUE_TYPE (arg1),
- longest_to_int (value_as_long (arg2)));
- else
- return value_repeat (arg1, longest_to_int (value_as_long (arg2)));
-
- case BINOP_COMMA:
- evaluate_subexp (NULL_TYPE, exp, pos, noside);
- return evaluate_subexp (NULL_TYPE, exp, pos, noside);
-
- case UNOP_NEG:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (unop_user_defined_p (op, arg1))
- return value_x_unop (arg1, op);
- else
- return value_neg (arg1);
-
- case UNOP_LOGNOT:
- /* C++: check for and handle destructor names. */
- op = exp->elts[*pos].opcode;
-
- /* FIXME-tiemann: this is a cop-out. */
- if (op == OP_SCOPE)
- error ("destructor in eval");
-
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (unop_user_defined_p (UNOP_LOGNOT, arg1))
- return value_x_unop (arg1, UNOP_LOGNOT);
- else
- return value_lognot (arg1);
-
- case UNOP_ZEROP:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (unop_user_defined_p (op, arg1))
- return value_x_unop (arg1, op);
- else
- return value_from_longest (builtin_type_int,
- (LONGEST) value_zerop (arg1));
-
- case UNOP_IND:
- if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR)
- expect_type = TYPE_TARGET_TYPE (expect_type);
- arg1 = evaluate_subexp (expect_type, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
- if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR
- || TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_REF
- /* In C you can dereference an array to get the 1st elt. */
- || TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_ARRAY
- )
- return value_zero (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)),
- lval_memory);
- else if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_INT)
- /* GDB allows dereferencing an int. */
- return value_zero (builtin_type_int, lval_memory);
- else
- error ("Attempt to take contents of a non-pointer value.");
- }
- return value_ind (arg1);
-
- case UNOP_ADDR:
- /* C++: check for and handle pointer to members. */
-
- op = exp->elts[*pos].opcode;
-
- if (noside == EVAL_SKIP)
- {
- if (op == OP_SCOPE)
- {
- char *name = &exp->elts[pc+3].string;
- int temm = strlen (name);
- (*pos) += 2 + (temm + sizeof (union exp_element)) / sizeof (union exp_element);
- }
- else
- evaluate_subexp (expect_type, exp, pos, EVAL_SKIP);
- goto nosideret;
- }
-
- if (op == OP_SCOPE)
- {
- char *name = &exp->elts[pc+3].string;
- int temm = strlen (name);
- struct type *domain = exp->elts[pc+2].type;
- (*pos) += 2 + (temm + sizeof (union exp_element)) / sizeof (union exp_element);
- arg1 = value_struct_elt_for_address (domain, expect_type, name);
- if (arg1)
- return arg1;
- error ("no field `%s' in structure", name);
- }
- else
- return evaluate_subexp_for_address (exp, pos, noside);
-
- case UNOP_SIZEOF:
- if (noside == EVAL_SKIP)
- {
- evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- goto nosideret;
- }
- return evaluate_subexp_for_sizeof (exp, pos);
-
- case UNOP_CAST:
- (*pos) += 2;
- arg1 = evaluate_subexp (expect_type, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- return value_cast (exp->elts[pc + 1].type, arg1);
-
- case UNOP_MEMVAL:
- (*pos) += 2;
- arg1 = evaluate_subexp (expect_type, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (exp->elts[pc + 1].type, lval_memory);
- else
- return value_at_lazy (exp->elts[pc + 1].type,
- value_as_pointer (arg1));
-
- case UNOP_PREINCREMENT:
- arg1 = evaluate_subexp (expect_type, exp, pos, noside);
- if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
- return arg1;
- else if (unop_user_defined_p (op, arg1))
- {
- return value_x_unop (arg1, op);
- }
- else
- {
- arg2 = value_add (arg1, value_from_longest (builtin_type_char,
- (LONGEST) 1));
- return value_assign (arg1, arg2);
- }
-
- case UNOP_PREDECREMENT:
- arg1 = evaluate_subexp (expect_type, exp, pos, noside);
- if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
- return arg1;
- else if (unop_user_defined_p (op, arg1))
- {
- return value_x_unop (arg1, op);
- }
- else
- {
- arg2 = value_sub (arg1, value_from_longest (builtin_type_char,
- (LONGEST) 1));
- return value_assign (arg1, arg2);
- }
-
- case UNOP_POSTINCREMENT:
- arg1 = evaluate_subexp (expect_type, exp, pos, noside);
- if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
- return arg1;
- else if (unop_user_defined_p (op, arg1))
- {
- return value_x_unop (arg1, op);
- }
- else
- {
- arg2 = value_add (arg1, value_from_longest (builtin_type_char,
- (LONGEST) 1));
- value_assign (arg1, arg2);
- return arg1;
- }
-
- case UNOP_POSTDECREMENT:
- arg1 = evaluate_subexp (expect_type, exp, pos, noside);
- if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
- return arg1;
- else if (unop_user_defined_p (op, arg1))
- {
- return value_x_unop (arg1, op);
- }
- else
- {
- arg2 = value_sub (arg1, value_from_longest (builtin_type_char,
- (LONGEST) 1));
- value_assign (arg1, arg2);
- return arg1;
- }
-
- case OP_THIS:
- (*pos) += 1;
- return value_of_this (1);
-
- default:
- error ("internal error: I do not know how to evaluate what you gave me");
- }
-
- nosideret:
- return value_from_longest (builtin_type_long, (LONGEST) 1);
-}
-
-/* Evaluate a subexpression of EXP, at index *POS,
- and return the address of that subexpression.
- Advance *POS over the subexpression.
- If the subexpression isn't an lvalue, get an error.
- NOSIDE may be EVAL_AVOID_SIDE_EFFECTS;
- then only the type of the result need be correct. */
-
-static value
-evaluate_subexp_for_address (exp, pos, noside)
- register struct expression *exp;
- register int *pos;
- enum noside noside;
-{
- enum exp_opcode op;
- register int pc;
-
- pc = (*pos);
- op = exp->elts[pc].opcode;
-
- switch (op)
- {
- case UNOP_IND:
- (*pos)++;
- return evaluate_subexp (NULL_TYPE, exp, pos, noside);
-
- case UNOP_MEMVAL:
- (*pos) += 3;
- return value_cast (lookup_pointer_type (exp->elts[pc + 1].type),
- evaluate_subexp (NULL_TYPE, exp, pos, noside));
-
- case OP_VAR_VALUE:
- (*pos) += 3;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
- struct type *type =
- lookup_pointer_type (SYMBOL_TYPE (exp->elts[pc + 1].symbol));
- enum address_class sym_class =
- SYMBOL_CLASS (exp->elts[pc + 1].symbol);
-
- if (sym_class == LOC_CONST
- || sym_class == LOC_CONST_BYTES
- || sym_class == LOC_REGISTER
- || sym_class == LOC_REGPARM)
- error ("Attempt to take address of register or constant.");
-
- return
- value_zero (type, not_lval);
- }
- else
- return locate_var_value (exp->elts[pc + 1].symbol, (FRAME) 0);
-
- default:
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
- value x = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (VALUE_LVAL (x) == lval_memory)
- return value_zero (TYPE_POINTER_TYPE (VALUE_TYPE (x)),
- not_lval);
- else
- error ("Attempt to take address of non-lval");
- }
- return value_addr (evaluate_subexp (NULL_TYPE, exp, pos, noside));
- }
-}
-
-/* Evaluate like `evaluate_subexp' except coercing arrays to pointers.
- When used in contexts where arrays will be coerced anyway,
- this is equivalent to `evaluate_subexp'
- but much faster because it avoids actually fetching array contents. */
-
-static value
-evaluate_subexp_with_coercion (exp, pos, noside)
- register struct expression *exp;
- register int *pos;
- enum noside noside;
-{
- register enum exp_opcode op;
- register int pc;
- register value val;
-
- pc = (*pos);
- op = exp->elts[pc].opcode;
-
- switch (op)
- {
- case OP_VAR_VALUE:
- if (TYPE_CODE (SYMBOL_TYPE (exp->elts[pc + 1].symbol)) == TYPE_CODE_ARRAY)
- {
- (*pos) += 3;
- val = locate_var_value (exp->elts[pc + 1].symbol, (FRAME) 0);
- return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (SYMBOL_TYPE (exp->elts[pc + 1].symbol))),
- val);
- }
- default:
- return evaluate_subexp (NULL_TYPE, exp, pos, noside);
- }
-}
-
-/* Evaluate a subexpression of EXP, at index *POS,
- and return a value for the size of that subexpression.
- Advance *POS over the subexpression. */
-
-static value
-evaluate_subexp_for_sizeof (exp, pos)
- register struct expression *exp;
- register int *pos;
-{
- enum exp_opcode op;
- register int pc;
- value val;
-
- pc = (*pos);
- op = exp->elts[pc].opcode;
-
- switch (op)
- {
- /* This case is handled specially
- so that we avoid creating a value for the result type.
- If the result type is very big, it's desirable not to
- create a value unnecessarily. */
- case UNOP_IND:
- (*pos)++;
- val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
- return value_from_longest (builtin_type_int, (LONGEST)
- TYPE_LENGTH (TYPE_TARGET_TYPE (VALUE_TYPE (val))));
-
- case UNOP_MEMVAL:
- (*pos) += 3;
- return value_from_longest (builtin_type_int,
- (LONGEST) TYPE_LENGTH (exp->elts[pc + 1].type));
-
- case OP_VAR_VALUE:
- (*pos) += 3;
- return value_from_longest (builtin_type_int,
- (LONGEST) TYPE_LENGTH (SYMBOL_TYPE (exp->elts[pc + 1].symbol)));
-
- default:
- val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
- return value_from_longest (builtin_type_int,
- (LONGEST) TYPE_LENGTH (VALUE_TYPE (val)));
- }
-}
diff --git a/gdb/exec.c b/gdb/exec.c
deleted file mode 100644
index 0c645f2..0000000
--- a/gdb/exec.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/* Work with executable files, for GDB.
- Copyright (C) 1988, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcmd.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <fcntl.h>
-#include <string.h>
-
-#include "gdbcore.h"
-
-#include <ctype.h>
-#include <sys/stat.h>
-
-extern char *getenv();
-extern void child_create_inferior (), child_attach ();
-extern void symbol_file_command ();
-
-/* The Binary File Descriptor handle for the executable file. */
-
-bfd *exec_bfd = NULL;
-
-/* Whether to open exec and core files read-only or read-write. */
-
-int write_files = 0;
-
-/* Text start and end addresses (KLUDGE) if needed */
-
-#ifdef NEED_TEXT_START_END
-CORE_ADDR text_start = 0;
-CORE_ADDR text_end = 0;
-#endif
-
-/* Forward decl */
-
-extern struct target_ops exec_ops;
-
-/* ARGSUSED */
-void
-exec_close (quitting)
- int quitting;
-{
- if (exec_bfd) {
- bfd_close (exec_bfd);
- exec_bfd = NULL;
- }
- if (exec_ops.sections) {
- free (exec_ops.sections);
- exec_ops.sections = NULL;
- exec_ops.sections_end = NULL;
- }
-}
-
-void
-exec_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- target_preopen (from_tty);
-
- /* Remove any previous exec file. */
- unpush_target (&exec_ops);
-
- /* Now open and digest the file the user requested, if any. */
-
- if (filename)
- {
- char *scratch_pathname;
- int scratch_chan;
-
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- scratch_chan = openp (getenv ("PATH"), 1, filename,
- write_files? O_RDWR: O_RDONLY, 0,
- &scratch_pathname);
- if (scratch_chan < 0)
- perror_with_name (filename);
-
- exec_bfd = bfd_fdopenr (scratch_pathname, NULL, scratch_chan);
- if (!exec_bfd)
- error ("Could not open `%s' as an executable file: %s",
- scratch_pathname, bfd_errmsg (bfd_error));
- if (!bfd_check_format (exec_bfd, bfd_object))
- error ("\"%s\": not in executable format: %s.",
- scratch_pathname, bfd_errmsg (bfd_error));
-
-#if FIXME
-/* This code needs to be incorporated into BFD */
-#ifdef COFF_ENCAPSULATE
- /* If we have a coff header, it can give us better values for
- text_start and exec_data_start. This is particularly useful
- for remote debugging of embedded systems. */
- if (N_FLAGS(exec_aouthdr) & N_FLAGS_COFF_ENCAPSULATE)
- {
- struct coffheader ch;
- int val;
- val = lseek (execchan, -(sizeof (AOUTHDR) + sizeof (ch)), 1);
- if (val == -1)
- perror_with_name (filename);
- val = myread (execchan, &ch, sizeof (ch));
- if (val < 0)
- perror_with_name (filename);
- text_start = ch.text_start;
- exec_data_start = ch.data_start;
- } else
-#endif
- {
- text_start =
- IS_OBJECT_FILE (exec_aouthdr) ? 0 : N_TXTADDR (exec_aouthdr);
- exec_data_start = IS_OBJECT_FILE (exec_aouthdr)
- ? exec_aouthdr.a_text : N_DATADDR (exec_aouthdr);
- }
-#endif FIXME
-
- if (build_section_table (exec_bfd, &exec_ops.sections,
- &exec_ops.sections_end))
- error ("Can't find the file sections in `%s': %s",
- exec_bfd->filename, bfd_errmsg (bfd_error));
-
-#ifdef NEED_TEXT_START_END
- /* This is a KLUDGE (FIXME) because a few places in a few ports
- (29K springs to mind) need this info for now. */
- {
- struct section_table *p;
- for (p = exec_ops.sections; p < exec_ops.sections_end; p++)
- if (!strcmp (".text", bfd_section_name (p->bfd, p->sec_ptr)))
- {
- text_start = p->addr;
- text_end = p->endaddr;
- break;
- }
- }
-#endif
-
- validate_files ();
-
- push_target (&exec_ops);
-
- /* Tell display code (if any) about the changed file name. */
- if (exec_file_display_hook)
- (*exec_file_display_hook) (filename);
- }
- else if (from_tty)
- printf ("No exec file now.\n");
-}
-
-/* Set both the exec file and the symbol file, in one command.
- What a novelty. Why did GDB go through four major releases before this
- command was added? */
-
-void
-file_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- /* FIXME, if we lose on reading the symbol file, we should revert
- the exec file, but that's rough. */
- exec_file_command (arg, from_tty);
- symbol_file_command (arg, from_tty);
-}
-
-
-/* Locate all mappable sections of a BFD file.
- table_pp_char is a char * to get it through bfd_map_over_sections;
- we cast it back to its proper type. */
-
-void
-add_to_section_table (abfd, asect, table_pp_char)
- bfd *abfd;
- sec_ptr asect;
- char *table_pp_char;
-{
- struct section_table **table_pp = (struct section_table **)table_pp_char;
- flagword aflag;
-
- aflag = bfd_get_section_flags (abfd, asect);
- /* FIXME, we need to handle BSS segment here...it alloc's but doesn't load */
- if (!(aflag & SEC_LOAD))
- return;
- if (0 == bfd_section_size (abfd, asect))
- return;
- (*table_pp)->bfd = abfd;
- (*table_pp)->sec_ptr = asect;
- (*table_pp)->addr = bfd_section_vma (abfd, asect);
- (*table_pp)->endaddr = (*table_pp)->addr + bfd_section_size (abfd, asect);
- (*table_pp)++;
-}
-
-int
-build_section_table (some_bfd, start, end)
- bfd *some_bfd;
- struct section_table **start, **end;
-{
- unsigned count;
-
- count = bfd_count_sections (some_bfd);
- if (count == 0)
- abort(); /* return 1? */
- if (*start)
- free (*start);
- *start = (struct section_table *) xmalloc (count * sizeof (**start));
- *end = *start;
- bfd_map_over_sections (some_bfd, add_to_section_table, (char *)end);
- if (*end > *start + count)
- abort();
- /* We could realloc the table, but it probably loses for most files. */
- return 0;
-}
-
-/* Read or write the exec file.
-
- Args are address within a BFD file, address within gdb address-space,
- length, and a flag indicating whether to read or write.
-
- Result is a length:
-
- 0: We cannot handle this address and length.
- > 0: We have handled N bytes starting at this address.
- (If N == length, we did it all.) We might be able
- to handle more bytes beyond this length, but no
- promises.
- < 0: We cannot handle this address, but if somebody
- else handles (-N) bytes, we can start from there.
-
- The same routine is used to handle both core and exec files;
- we just tail-call it with more arguments to select between them. */
-
-int
-xfer_memory (memaddr, myaddr, len, write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
- struct target_ops *target;
-{
- boolean res;
- struct section_table *p;
- CORE_ADDR nextsectaddr, memend;
- boolean (*xfer_fn) ();
-
- if (len <= 0)
- abort();
-
- memend = memaddr + len;
- xfer_fn = write? bfd_set_section_contents: bfd_get_section_contents;
- nextsectaddr = memend;
-
- for (p = target->sections; p < target->sections_end; p++)
- {
- if (p->addr <= memaddr)
- if (p->endaddr >= memend)
- {
- /* Entire transfer is within this section. */
- res = xfer_fn (p->bfd, p->sec_ptr, myaddr, memaddr - p->addr, len);
- return (res != false)? len: 0;
- }
- else if (p->endaddr <= memaddr)
- {
- /* This section ends before the transfer starts. */
- continue;
- }
- else
- {
- /* This section overlaps the transfer. Just do half. */
- len = p->endaddr - memaddr;
- res = xfer_fn (p->bfd, p->sec_ptr, myaddr, memaddr - p->addr, len);
- return (res != false)? len: 0;
- }
- else if (p->addr < nextsectaddr)
- nextsectaddr = p->addr;
- }
-
- if (nextsectaddr >= memend)
- return 0; /* We can't help */
- else
- return - (nextsectaddr - memaddr); /* Next boundary where we can help */
-}
-
-#ifdef FIXME
-#ifdef REG_STACK_SEGMENT
-/* MOVE TO BFD... */
- /* Pyramids and AM29000s have an extra segment in the virtual address space
- for the (control) stack of register-window frames. The AM29000 folk
- call it the "register stack" rather than the "memory stack". */
- else if (memaddr >= reg_stack_start && memaddr < reg_stack_end)
- {
- i = min (len, reg_stack_end - memaddr);
- fileptr = memaddr - reg_stack_start + reg_stack_offset;
- wanna_xfer = coredata;
- }
-#endif /* REG_STACK_SEGMENT */
-#endif FIXME
-
-static void
-exec_files_info ()
-{
- struct section_table *p;
-
- printf ("\tExecutable file `%s'.\n", bfd_get_filename(exec_bfd));
-
- for (p = exec_ops.sections; p < exec_ops.sections_end; p++) {
- printf("\t%s", local_hex_string_custom (p->addr, "08"));
- printf(" - %s is %s\n", local_hex_string_custom (p->endaddr, "08"),
- bfd_section_name (exec_bfd, p->sec_ptr));
- }
-}
-
-static void
-set_section_command (args, from_tty)
- char *args;
- int from_tty;
-{
- struct section_table *p;
- char *secname;
- unsigned seclen;
- unsigned long secaddr;
- char secprint[100];
- long offset;
-
- if (args == 0)
- error ("Must specify section name and its virtual address");
-
- /* Parse out section name */
- for (secname = args; !isspace(*args); args++) ;
- seclen = args - secname;
-
- /* Parse out new virtual address */
- secaddr = parse_and_eval_address (args);
-
- for (p = exec_ops.sections; p < exec_ops.sections_end; p++) {
- if (!strncmp (secname, bfd_section_name (exec_bfd, p->sec_ptr), seclen)
- && bfd_section_name (exec_bfd, p->sec_ptr)[seclen] == '\0') {
- offset = secaddr - p->addr;
- p->addr += offset;
- p->endaddr += offset;
- exec_files_info();
- return;
- }
- }
- if (seclen >= sizeof (secprint))
- seclen = sizeof (secprint) - 1;
- strncpy (secprint, secname, seclen);
- secprint[seclen] = '\0';
- error ("Section %s not found", secprint);
-}
-
-struct target_ops exec_ops = {
- "exec", "Local exec file",
- "Use an executable file as a target.\n\
-Specify the filename of the executable file.",
- exec_file_command, exec_close, /* open, close */
- child_attach, 0, 0, 0, /* attach, detach, resume, wait, */
- 0, 0, /* fetch_registers, store_registers, */
- 0, 0, 0, /* prepare_to_store, conv_to, conv_from, */
- xfer_memory, exec_files_info,
- 0, 0, /* insert_breakpoint, remove_breakpoint, */
- 0, 0, 0, 0, 0, /* terminal stuff */
- 0, 0, /* kill, load */
- 0, 0, /* call fn, lookup sym */
- child_create_inferior,
- 0, /* mourn_inferior */
- file_stratum, 0, /* next */
- 0, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */
- 0, 0, /* section pointers */
- OPS_MAGIC, /* Always the last thing */
-};
-
-void
-_initialize_exec()
-{
-
- add_com ("file", class_files, file_command,
- "Use FILE as program to be debugged.\n\
-It is read for its symbols, for getting the contents of pure memory,\n\
-and it is the program executed when you use the `run' command.\n\
-If FILE cannot be found as specified, your execution directory path\n\
-($PATH) is searched for a command of that name.\n\
-No arg means to have no executable file and no symbols.");
-
- add_com ("exec-file", class_files, exec_file_command,
- "Use FILE as program for getting contents of pure memory.\n\
-If FILE cannot be found as specified, your execution directory path\n\
-is searched for a command of that name.\n\
-No arg means have no executable file.");
-
- add_com ("section", class_files, set_section_command,
- "Change the base address of section SECTION of the exec file to ADDR.\n\
-This can be used if the exec file does not contain section addresses,\n\
-(such as in the a.out format), or when the addresses specified in the\n\
-file itself are wrong. Each section must be changed separately. The\n\
-``info files'' command lists all the sections and their addresses.");
-
- add_show_from_set
- (add_set_cmd ("write", class_support, var_boolean, (char *)&write_files,
- "Set writing into executable and core files.",
- &setlist),
- &showlist);
-
- add_target (&exec_ops);
-}
diff --git a/gdb/expprint.c b/gdb/expprint.c
deleted file mode 100644
index e96dc7f..0000000
--- a/gdb/expprint.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/* Print in infix form a struct expression.
- Copyright (C) 1986, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "symtab.h"
-#include "param.h"
-#include "expression.h"
-#include "value.h"
-
-
-/* These codes indicate operator precedences, least tightly binding first. */
-/* Adding 1 to a precedence value is done for binary operators,
- on the operand which is more tightly bound, so that operators
- of equal precedence within that operand will get parentheses. */
-/* PREC_HYPER and PREC_ABOVE_COMMA are not the precedence of any operator;
- they are used as the "surrounding precedence" to force
- various kinds of things to be parenthesized. */
-enum precedence
-{ PREC_NULL, PREC_COMMA, PREC_ABOVE_COMMA, PREC_ASSIGN, PREC_OR, PREC_AND,
- PREC_LOGIOR, PREC_LOGAND, PREC_LOGXOR, PREC_EQUAL, PREC_ORDER,
- PREC_SHIFT, PREC_ADD, PREC_MUL, PREC_REPEAT,
- PREC_HYPER, PREC_PREFIX, PREC_SUFFIX };
-
-/* Table mapping opcodes into strings for printing operators
- and precedences of the operators. */
-
-struct op_print
-{
- char *string;
- enum exp_opcode opcode;
- /* Precedence of operator. These values are used only by comparisons. */
- enum precedence precedence;
- int right_assoc;
-};
-
-const static struct op_print op_print_tab[] =
- {
- {",", BINOP_COMMA, PREC_COMMA, 0},
- {"=", BINOP_ASSIGN, PREC_ASSIGN, 1},
- {"||", BINOP_OR, PREC_OR, 0},
- {"&&", BINOP_AND, PREC_AND, 0},
- {"|", BINOP_LOGIOR, PREC_LOGIOR, 0},
- {"&", BINOP_LOGAND, PREC_LOGAND, 0},
- {"^", BINOP_LOGXOR, PREC_LOGXOR, 0},
- {"==", BINOP_EQUAL, PREC_EQUAL, 0},
- {"!=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
- {"<=", BINOP_LEQ, PREC_ORDER, 0},
- {">=", BINOP_GEQ, PREC_ORDER, 0},
- {">", BINOP_GTR, PREC_ORDER, 0},
- {"<", BINOP_LESS, PREC_ORDER, 0},
- {">>", BINOP_RSH, PREC_SHIFT, 0},
- {"<<", BINOP_LSH, PREC_SHIFT, 0},
- {"+", BINOP_ADD, PREC_ADD, 0},
- {"-", BINOP_SUB, PREC_ADD, 0},
- {"*", BINOP_MUL, PREC_MUL, 0},
- {"/", BINOP_DIV, PREC_MUL, 0},
- {"%", BINOP_REM, PREC_MUL, 0},
- {"@", BINOP_REPEAT, PREC_REPEAT, 0},
- {"-", UNOP_NEG, PREC_PREFIX, 0},
- {"!", UNOP_ZEROP, PREC_PREFIX, 0},
- {"~", UNOP_LOGNOT, PREC_PREFIX, 0},
- {"*", UNOP_IND, PREC_PREFIX, 0},
- {"&", UNOP_ADDR, PREC_PREFIX, 0},
- {"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
- {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
- {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
- /* C++ */
- {"::", BINOP_SCOPE, PREC_PREFIX, 0},
- };
-
-static void print_subexp ();
-
-void
-print_expression (exp, stream)
- struct expression *exp;
- FILE *stream;
-{
- int pc = 0;
- print_subexp (exp, &pc, stream, PREC_NULL);
-}
-
-/* Print the subexpression of EXP that starts in position POS, on STREAM.
- PREC is the precedence of the surrounding operator;
- if the precedence of the main operator of this subexpression is less,
- parentheses are needed here. */
-
-static void
-print_subexp (exp, pos, stream, prec)
- register struct expression *exp;
- register int *pos;
- FILE *stream;
- enum precedence prec;
-{
- register unsigned tem;
- register int pc;
- unsigned nargs;
- register char *op_str;
- int assign_modify = 0;
- enum exp_opcode opcode;
- enum precedence myprec;
- /* Set to 1 for a right-associative operator. */
- int assoc;
-
- pc = (*pos)++;
- opcode = exp->elts[pc].opcode;
- switch (opcode)
- {
- case OP_SCOPE:
- myprec = PREC_PREFIX;
- assoc = 0;
- (*pos) += 2;
- print_subexp (exp, pos, stream,
- (enum precedence) ((int) myprec + assoc));
- fputs_filtered (" :: ", stream);
- nargs = strlen (&exp->elts[pc + 2].string);
- (*pos) += 1 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element);
-
- fputs_filtered (&exp->elts[pc + 2].string, stream);
- return;
-
- case OP_LONG:
- (*pos) += 3;
- value_print (value_from_long (exp->elts[pc + 1].type,
- exp->elts[pc + 2].longconst),
- stream, 0, Val_no_prettyprint);
- return;
-
- case OP_DOUBLE:
- (*pos) += 3;
- value_print (value_from_double (exp->elts[pc + 1].type,
- exp->elts[pc + 2].doubleconst),
- stream, 0, Val_no_prettyprint);
- return;
-
- case OP_VAR_VALUE:
- (*pos) += 2;
- fputs_filtered (SYMBOL_NAME (exp->elts[pc + 1].symbol), stream);
- return;
-
- case OP_LAST:
- (*pos) += 2;
- fprintf_filtered (stream, "$%d",
- longest_to_int (exp->elts[pc + 1].longconst));
- return;
-
- case OP_REGISTER:
- (*pos) += 2;
- fprintf_filtered (stream, "$%s",
- longest_to_int (reg_names[exp->elts[pc + 1].longconst]));
- return;
-
- case OP_INTERNALVAR:
- (*pos) += 2;
- fprintf_filtered (stream, "$%s",
- internalvar_name (exp->elts[pc + 1].internalvar));
- return;
-
- case OP_FUNCALL:
- (*pos) += 2;
- nargs = longest_to_int (exp->elts[pc + 1].longconst);
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- fputs_filtered (" (", stream);
- for (tem = 0; tem < nargs; tem++)
- {
- if (tem != 0)
- fputs_filtered (", ", stream);
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- }
- fputs_filtered (")", stream);
- return;
-
- case OP_STRING:
- nargs = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element);
- fputs_filtered ("\"", stream);
- for (tem = 0; tem < nargs; tem++)
- printchar ((&exp->elts[pc + 1].string)[tem], stream, '"');
- fputs_filtered ("\"", stream);
- return;
-
- case TERNOP_COND:
- if ((int) prec > (int) PREC_COMMA)
- fputs_filtered ("(", stream);
- /* Print the subexpressions, forcing parentheses
- around any binary operations within them.
- This is more parentheses than are strictly necessary,
- but it looks clearer. */
- print_subexp (exp, pos, stream, PREC_HYPER);
- fputs_filtered (" ? ", stream);
- print_subexp (exp, pos, stream, PREC_HYPER);
- fputs_filtered (" : ", stream);
- print_subexp (exp, pos, stream, PREC_HYPER);
- if ((int) prec > (int) PREC_COMMA)
- fputs_filtered (")", stream);
- return;
-
- case STRUCTOP_STRUCT:
- tem = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- fputs_filtered (".", stream);
- fputs_filtered (&exp->elts[pc + 1].string, stream);
- return;
-
- case STRUCTOP_PTR:
- tem = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- fputs_filtered ("->", stream);
- fputs_filtered (&exp->elts[pc + 1].string, stream);
- return;
-
- case BINOP_SUBSCRIPT:
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- fputs_filtered ("[", stream);
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- fputs_filtered ("]", stream);
- return;
-
- case UNOP_POSTINCREMENT:
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- fputs_filtered ("++", stream);
- return;
-
- case UNOP_POSTDECREMENT:
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- fputs_filtered ("--", stream);
- return;
-
- case UNOP_CAST:
- (*pos) += 2;
- if ((int) prec > (int) PREC_PREFIX)
- fputs_filtered ("(", stream);
- fputs_filtered ("(", stream);
- type_print (exp->elts[pc + 1].type, "", stream, 0);
- fputs_filtered (") ", stream);
- print_subexp (exp, pos, stream, PREC_PREFIX);
- if ((int) prec > (int) PREC_PREFIX)
- fputs_filtered (")", stream);
- return;
-
- case UNOP_MEMVAL:
- (*pos) += 2;
- if ((int) prec > (int) PREC_PREFIX)
- fputs_filtered ("(", stream);
- fputs_filtered ("{", stream);
- type_print (exp->elts[pc + 1].type, "", stream, 0);
- fputs_filtered ("} ", stream);
- print_subexp (exp, pos, stream, PREC_PREFIX);
- if ((int) prec > (int) PREC_PREFIX)
- fputs_filtered (")", stream);
- return;
-
- case BINOP_ASSIGN_MODIFY:
- opcode = exp->elts[pc + 1].opcode;
- (*pos) += 2;
- myprec = PREC_ASSIGN;
- assoc = 1;
- assign_modify = 1;
- for (tem = 0; tem < sizeof op_print_tab / sizeof op_print_tab[0]; tem++)
- if (op_print_tab[tem].opcode == opcode)
- {
- op_str = op_print_tab[tem].string;
- break;
- }
- break;
-
- case OP_THIS:
- ++(*pos);
- fputs_filtered ("this", stream);
- return;
-
- default:
- for (tem = 0; tem < sizeof op_print_tab / sizeof op_print_tab[0]; tem++)
- if (op_print_tab[tem].opcode == opcode)
- {
- op_str = op_print_tab[tem].string;
- myprec = op_print_tab[tem].precedence;
- assoc = op_print_tab[tem].right_assoc;
- break;
- }
- }
-
- if ((int) myprec < (int) prec)
- fputs_filtered ("(", stream);
- if ((int) opcode > (int) BINOP_END)
- {
- /* Unary prefix operator. */
- fputs_filtered (op_str, stream);
- print_subexp (exp, pos, stream, PREC_PREFIX);
- }
- else
- {
- /* Binary operator. */
- /* Print left operand.
- If operator is right-associative,
- increment precedence for this operand. */
- print_subexp (exp, pos, stream,
- (enum precedence) ((int) myprec + assoc));
- /* Print the operator itself. */
- if (assign_modify)
- fprintf_filtered (stream, " %s= ", op_str);
- else if (op_str[0] == ',')
- fprintf_filtered (stream, "%s ", op_str);
- else
- fprintf_filtered (stream, " %s ", op_str);
- /* Print right operand.
- If operator is left-associative,
- increment precedence for this operand. */
- print_subexp (exp, pos, stream,
- (enum precedence) ((int) myprec + !assoc));
- }
- if ((int) myprec < (int) prec)
- fputs_filtered (")", stream);
-}
diff --git a/gdb/expread.tab.c b/gdb/expread.tab.c
deleted file mode 100755
index bb9894c..0000000
--- a/gdb/expread.tab.c
+++ /dev/null
@@ -1,2948 +0,0 @@
-
-/* A Bison parser, made from ./expread.y */
-
-#define INT 258
-#define CHAR 259
-#define UINT 260
-#define FLOAT 261
-#define STRING 262
-#define NAME 263
-#define BLOCKNAME 264
-#define TYPENAME 265
-#define NAME_OR_INT 266
-#define NAME_OR_UINT 267
-#define STRUCT 268
-#define UNION 269
-#define ENUM 270
-#define SIZEOF 271
-#define UNSIGNED 272
-#define COLONCOLON 273
-#define ERROR 274
-#define SIGNED 275
-#define LONG 276
-#define SHORT 277
-#define INT_KEYWORD 278
-#define LAST 279
-#define REGNAME 280
-#define VARIABLE 281
-#define ASSIGN_MODIFY 282
-#define THIS 283
-#define ABOVE_COMMA 284
-#define OR 285
-#define AND 286
-#define EQUAL 287
-#define NOTEQUAL 288
-#define LEQ 289
-#define GEQ 290
-#define LSH 291
-#define RSH 292
-#define UNARY 293
-#define INCREMENT 294
-#define DECREMENT 295
-#define ARROW 296
-
-#line 29 "./expread.y"
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "expression.h"
-#include "value.h"
-#include "command.h"
-
-static struct expression *expout;
-static int expout_size;
-static int expout_ptr;
-
-static int yylex ();
-static void yyerror ();
-static void write_exp_elt ();
-static void write_exp_elt_opcode ();
-static void write_exp_elt_sym ();
-static void write_exp_elt_longcst ();
-static void write_exp_elt_dblcst ();
-static void write_exp_elt_type ();
-static void write_exp_elt_intern ();
-static void write_exp_string ();
-static void start_arglist ();
-static int end_arglist ();
-static void free_funcalls ();
-static char *copy_name ();
-static int parse_number ();
-
-/* If this is nonzero, this block is used as the lexical context
- for symbol names. */
-
-static struct block *expression_context_block;
-
-/* The innermost context required by the stack and register variables
- we've encountered so far. */
-struct block *innermost_block;
-
-/* The block in which the most recently discovered symbol was found. */
-struct block *block_found;
-
-/* Number of arguments seen so far in innermost function call. */
-static int arglist_len;
-
-/* Data structure for saving values of arglist_len
- for function calls whose arguments contain other function calls. */
-
-struct funcall
- {
- struct funcall *next;
- int arglist_len;
- };
-
-struct funcall *funcall_chain;
-
-/* This kind of datum is used to represent the name
- of a symbol token. */
-
-struct stoken
- {
- char *ptr;
- int length;
- };
-
-struct ttype
- {
- struct stoken stoken;
- struct type *type;
- };
-
-struct symtoken
- {
- struct stoken stoken;
- struct symbol *sym;
- int is_a_field_of_this;
- };
-
-/* For parsing of complicated types.
- An array should be preceded in the list by the size of the array. */
-enum type_pieces
- {tp_end = -1, tp_pointer, tp_reference, tp_array, tp_function};
-/* The stack can contain either an enum type_pieces or an int. */
-union type_stack_elt {
- enum type_pieces piece;
- int int_val;
-};
-static union type_stack_elt *type_stack;
-static int type_stack_depth, type_stack_size;
-
-static void push_type ();
-static void push_type_int ();
-static enum type_pieces pop_type ();
-static int pop_type_int ();
-
-/* Allow debugging of parsing. */
-#define YYDEBUG 1
-
-#line 132 "./expread.y"
-typedef union
- {
- LONGEST lval;
- unsigned LONGEST ulval;
- double dval;
- struct symbol *sym;
- struct type *tval;
- struct stoken sval;
- struct ttype tsym;
- struct symtoken ssym;
- int voidval;
- struct block *bval;
- enum exp_opcode opcode;
- struct internalvar *ivar;
-
- struct type **tvec;
- int *ivec;
- } YYSTYPE;
-
-#ifndef YYLTYPE
-typedef
- struct yyltype
- {
- int timestamp;
- int first_line;
- int first_column;
- int last_line;
- int last_column;
- char *text;
- }
- yyltype;
-
-#define YYLTYPE yyltype
-#endif
-
-#include <stdio.h>
-
-#ifndef __STDC__
-#define const
-#endif
-
-
-
-#define YYFINAL 197
-#define YYFLAG -32768
-#define YYNTBASE 66
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 296 ? yytranslate[x] : 84)
-
-static const char yytranslate[] = { 0,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 59, 2, 2, 2, 51, 37, 2, 58,
- 62, 49, 47, 29, 48, 56, 50, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 65, 2, 40,
- 31, 41, 32, 46, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 57, 2, 61, 36, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 63, 35, 64, 60, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 30, 33, 34, 38, 39, 42, 43,
- 44, 45, 52, 53, 54, 55
-};
-
-static const short yyprhs[] = { 0,
- 0, 2, 4, 8, 11, 14, 17, 20, 23, 26,
- 29, 32, 35, 38, 42, 47, 51, 56, 61, 62,
- 68, 69, 71, 75, 80, 85, 89, 93, 97, 101,
- 105, 109, 113, 117, 121, 125, 129, 133, 137, 141,
- 145, 149, 153, 157, 161, 165, 171, 175, 179, 181,
- 183, 185, 187, 189, 191, 193, 195, 197, 199, 204,
- 206, 208, 210, 214, 218, 222, 227, 230, 232, 234,
- 237, 239, 242, 244, 247, 249, 253, 256, 258, 261,
- 263, 266, 270, 273, 275, 279, 286, 295, 305, 307,
- 309, 311, 313, 316, 320, 323, 327, 331, 336, 339,
- 343, 346, 349, 352, 355, 357, 360, 362, 364, 366,
- 368, 370, 372, 376, 378, 380, 382, 384, 386, 388
-};
-
-static const short yyrhs[] = { 67,
- 0, 68, 0, 67, 29, 68, 0, 49, 68, 0,
- 37, 68, 0, 48, 68, 0, 59, 68, 0, 60,
- 68, 0, 53, 68, 0, 54, 68, 0, 68, 53,
- 0, 68, 54, 0, 16, 68, 0, 68, 55, 82,
- 0, 68, 55, 49, 68, 0, 68, 56, 82, 0,
- 68, 56, 49, 68, 0, 68, 57, 67, 61, 0,
- 0, 68, 58, 69, 70, 62, 0, 0, 68, 0,
- 70, 29, 68, 0, 63, 78, 64, 68, 0, 58,
- 78, 62, 68, 0, 58, 67, 62, 0, 68, 46,
- 68, 0, 68, 49, 68, 0, 68, 50, 68, 0,
- 68, 51, 68, 0, 68, 47, 68, 0, 68, 48,
- 68, 0, 68, 44, 68, 0, 68, 45, 68, 0,
- 68, 38, 68, 0, 68, 39, 68, 0, 68, 42,
- 68, 0, 68, 43, 68, 0, 68, 40, 68, 0,
- 68, 41, 68, 0, 68, 37, 68, 0, 68, 36,
- 68, 0, 68, 35, 68, 0, 68, 34, 68, 0,
- 68, 33, 68, 0, 68, 32, 68, 65, 68, 0,
- 68, 31, 68, 0, 68, 27, 68, 0, 3, 0,
- 11, 0, 5, 0, 12, 0, 4, 0, 6, 0,
- 72, 0, 24, 0, 25, 0, 26, 0, 16, 58,
- 78, 62, 0, 7, 0, 28, 0, 9, 0, 71,
- 18, 82, 0, 71, 18, 82, 0, 79, 18, 82,
- 0, 79, 18, 60, 82, 0, 18, 82, 0, 83,
- 0, 79, 0, 79, 74, 0, 49, 0, 49, 74,
- 0, 37, 0, 37, 74, 0, 75, 0, 58, 74,
- 62, 0, 75, 76, 0, 76, 0, 75, 77, 0,
- 77, 0, 57, 61, 0, 57, 3, 61, 0, 58,
- 62, 0, 73, 0, 79, 18, 49, 0, 78, 58,
- 79, 18, 49, 62, 0, 78, 58, 79, 18, 49,
- 62, 58, 62, 0, 78, 58, 79, 18, 49, 62,
- 58, 81, 62, 0, 10, 0, 23, 0, 21, 0,
- 22, 0, 21, 23, 0, 17, 21, 23, 0, 21,
- 21, 0, 21, 21, 23, 0, 17, 21, 21, 0,
- 17, 21, 21, 23, 0, 22, 23, 0, 17, 22,
- 23, 0, 13, 82, 0, 14, 82, 0, 15, 82,
- 0, 17, 80, 0, 17, 0, 20, 80, 0, 20,
- 0, 10, 0, 23, 0, 21, 0, 22, 0, 78,
- 0, 81, 29, 78, 0, 8, 0, 9, 0, 10,
- 0, 11, 0, 12, 0, 8, 0, 9, 0
-};
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
- 225, 229, 230, 235, 238, 241, 245, 249, 253, 257,
- 261, 265, 269, 273, 279, 283, 289, 293, 297, 301,
- 307, 310, 314, 318, 324, 330, 336, 340, 344, 348,
- 352, 356, 360, 364, 368, 372, 376, 380, 384, 388,
- 392, 396, 400, 404, 408, 412, 416, 420, 426, 436,
- 449, 461, 474, 481, 488, 491, 497, 503, 509, 516,
- 523, 530, 548, 558, 570, 583, 601, 647, 741, 742,
- 777, 779, 781, 783, 785, 788, 790, 795, 801, 803,
- 807, 809, 813, 817, 818, 820, 822, 825, 832, 834,
- 836, 838, 840, 842, 844, 846, 848, 850, 852, 854,
- 856, 859, 862, 865, 867, 869, 871, 875, 876, 882,
- 888, 897, 902, 909, 910, 911, 912, 913, 916, 917
-};
-
-static const char * const yytname[] = { "$",
-"error","$illegal.","INT","CHAR","UINT","FLOAT","STRING","NAME","BLOCKNAME","TYPENAME",
-"NAME_OR_INT","NAME_OR_UINT","STRUCT","UNION","ENUM","SIZEOF","UNSIGNED","COLONCOLON","ERROR","SIGNED",
-"LONG","SHORT","INT_KEYWORD","LAST","REGNAME","VARIABLE","ASSIGN_MODIFY","THIS","','","ABOVE_COMMA",
-"'='","'?'","OR","AND","'|'","'^'","'&'","EQUAL","NOTEQUAL","'<'",
-"'>'","LEQ","GEQ","LSH","RSH","'@'","'+'","'-'","'*'","'/'",
-"'%'","UNARY","INCREMENT","DECREMENT","ARROW","'.'","'['","'('","'!'","'~'",
-"']'","')'","'{'","'}'","':'","start","exp1","exp","@1","arglist",
-"block","variable","ptype","abs_decl","direct_abs_decl","array_mod","func_mod","type","typebase","typename",
-"nonempty_typelist","name","name_not_typename",""
-};
-#endif
-
-static const short yyr1[] = { 0,
- 66, 67, 67, 68, 68, 68, 68, 68, 68, 68,
- 68, 68, 68, 68, 68, 68, 68, 68, 69, 68,
- 70, 70, 70, 68, 68, 68, 68, 68, 68, 68,
- 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
- 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
- 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
- 68, 71, 71, 72, 72, 72, 72, 72, 73, 73,
- 74, 74, 74, 74, 74, 75, 75, 75, 75, 75,
- 76, 76, 77, 78, 78, 78, 78, 78, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 80, 80, 80,
- 80, 81, 81, 82, 82, 82, 82, 82, 83, 83
-};
-
-static const short yyr2[] = { 0,
- 1, 1, 3, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 3, 4, 3, 4, 4, 0, 5,
- 0, 1, 3, 4, 4, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 5, 3, 3, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 4, 1,
- 1, 1, 3, 3, 3, 4, 2, 1, 1, 2,
- 1, 2, 1, 2, 1, 3, 2, 1, 2, 1,
- 2, 3, 2, 1, 3, 6, 8, 9, 1, 1,
- 1, 1, 2, 3, 2, 3, 3, 4, 2, 3,
- 2, 2, 2, 2, 1, 2, 1, 1, 1, 1,
- 1, 1, 3, 1, 1, 1, 1, 1, 1, 1
-};
-
-static const short yydefact[] = { 0,
- 49, 53, 51, 54, 60, 119, 120, 89, 50, 52,
- 0, 0, 0, 0, 105, 0, 107, 91, 92, 90,
- 56, 57, 58, 61, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 2, 0, 55, 0, 68, 114,
- 115, 116, 117, 118, 101, 102, 103, 0, 13, 108,
- 110, 111, 109, 104, 67, 110, 111, 106, 95, 93,
- 99, 5, 6, 4, 9, 10, 0, 84, 0, 69,
- 7, 8, 0, 69, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 11, 12, 0,
- 0, 0, 19, 0, 0, 0, 97, 94, 100, 96,
- 26, 0, 0, 0, 73, 71, 0, 0, 70, 75,
- 78, 80, 0, 0, 3, 48, 47, 0, 45, 44,
- 43, 42, 41, 35, 36, 39, 40, 37, 38, 33,
- 34, 27, 31, 32, 28, 29, 30, 0, 14, 0,
- 16, 0, 21, 64, 0, 65, 59, 98, 0, 25,
- 85, 74, 72, 0, 81, 83, 0, 0, 77, 79,
- 24, 0, 15, 17, 18, 22, 0, 66, 0, 82,
- 76, 46, 0, 20, 0, 23, 86, 0, 87, 112,
- 0, 0, 88, 113, 0, 0, 0
-};
-
-static const short yydefgoto[] = { 195,
- 67, 35, 153, 177, 36, 37, 68, 119, 120, 121,
- 122, 69, 38, 54, 191, 156, 39
-};
-
-static const short yypact[] = { 167,
--32768,-32768,-32768,-32768,-32768,-32768, 7,-32768,-32768,-32768,
- 22, 22, 22, 228, 190, 22, 245, 119, -7,-32768,
--32768,-32768,-32768,-32768, 167, 167, 167, 167, 167, 167,
- 167, 167, 528, 60, 303, 33,-32768, 76,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768, 167, 216,-32768,
- 134, 77,-32768,-32768,-32768,-32768,-32768,-32768, 78,-32768,
--32768, 216, 216, 216, 216, 216, 59,-32768, -52, 75,
- 216, 216, -55, 80, 167, 167, 167, 167, 167, 167,
- 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
- 167, 167, 167, 167, 167, 167, 167,-32768,-32768, 198,
- 249, 167,-32768, 22, 138, -34, 90,-32768,-32768,-32768,
--32768, 528, 167, 96, 165, 165, 26, 104,-32768, -50,
--32768,-32768, 167, 47, 303, 303, 303, 268, 355, 379,
- 402, 424, 445, 464, 464, 479, 479, 479, 479, 506,
- 506, 518, 529, 529, 216, 216, 216, 167,-32768, 167,
--32768, -2, 167, 98, 22,-32768, 32,-32768, 113, 216,
--32768,-32768,-32768, 62,-32768,-32768, 82, 106,-32768,-32768,
- 216, 167, 216, 216,-32768, 303, 68,-32768, 137,-32768,
--32768, 330, 167,-32768, 132, 303, 139, 105,-32768, 141,
- 73, 528,-32768, 141, 196, 201,-32768
-};
-
-static const short yypgoto[] = {-32768,
- 1, -14,-32768,-32768,-32768,-32768,-32768, 36,-32768, 83,
- 85, -29, -28, 200,-32768, 10,-32768
-};
-
-
-#define YYLAST 587
-
-
-static const short yytable[] = { 49,
- 34, 70, 112, 73, 74, 112, 117, 168, 123, 113,
- 62, 63, 64, 65, 66, 61, 71, 72, 106, 70,
- 45, 46, 47, 112, -62, 55, 75, 157, 164, 40,
- 41, 42, 43, 44, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 104, 17, 18, 19, 20, 21, 22, 23, 175, 24,
- 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
- 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
- 145, 146, 147, 159, 28, 29, 165, 75, 75, 30,
- 31, 32, 114, 105, 33, 161, 183, 124, 160, 109,
- 110, 192, 152, 40, 41, 42, 43, 44, 171, 149,
- 151, 115, 158, 154, 8, -63, 115, 11, 12, 13,
- 111, 15, 180, 116, 17, 18, 19, 20, 116, 184,
- 179, 117, 118, 173, 193, 174, 117, 118, 176, 59,
- 115, 60, 160, 181, 161, 40, 41, 42, 43, 44,
- 162, 163, 116, 167, 107, 155, 108, 182, 190, 74,
- 117, 118, 194, 74, 178, 166, 189, 166, 186, 1,
- 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 16, 185, 17, 18, 19, 20,
- 21, 22, 23, 187, 24, 196, 188, 155, 112, 50,
- 197, 115, 169, 25, 170, 40, 41, 42, 43, 44,
- 51, 52, 53, 116, 26, 27, 58, 0, 0, 28,
- 29, 117, 118, 0, 30, 31, 32, 0, 0, 33,
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 15, 16, 148, 17, 18, 19,
- 20, 21, 22, 23, 50, 24, 40, 41, 42, 43,
- 44, 0, 0, 0, 25, 56, 57, 53, 98, 99,
- 100, 101, 102, 103, 0, 26, 27, 0, 0, 0,
- 28, 29, 0, 0, 0, 48, 31, 32, 0, 0,
- 33, 0, 0, 0, 76, 0, 0, 150, 77, 78,
- 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
- 89, 90, 91, 92, 93, 94, 95, 96, 97, 0,
- 98, 99, 100, 101, 102, 103, 0, 0, 0, 76,
- 0, 0, 172, 77, 78, 79, 80, 81, 82, 83,
- 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
- 94, 95, 96, 97, 0, 98, 99, 100, 101, 102,
- 103, 78, 79, 80, 81, 82, 83, 84, 85, 86,
- 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
- 97, 0, 98, 99, 100, 101, 102, 103, 80, 81,
- 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 97, 0, 98, 99, 100,
- 101, 102, 103, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 0, 98, 99, 100, 101, 102, 103, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 0, 98, 99, 100, 101, 102, 103,
- 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
- 93, 94, 95, 96, 97, 0, 98, 99, 100, 101,
- 102, 103, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 97, 0, 98, 99, 100,
- 101, 102, 103, 86, 87, 88, 89, 90, 91, 92,
- 93, 94, 95, 96, 97, 0, 98, 99, 100, 101,
- 102, 103, 90, 91, 92, 93, 94, 95, 96, 97,
- 0, 98, 99, 100, 101, 102, 103, 8, 0, 0,
- 11, 12, 13, 0, 15, 0, 0, 17, 18, 19,
- 20, 92, 93, 94, 95, 96, 97, 0, 98, 99,
- 100, 101, 102, 103, 93, 94, 95, 96, 97, 0,
- 98, 99, 100, 101, 102, 103, 0, 95, 96, 97,
- 0, 98, 99, 100, 101, 102, 103
-};
-
-static const short yycheck[] = { 14,
- 0, 30, 58, 33, 33, 58, 57, 58, 64, 62,
- 25, 26, 27, 28, 29, 23, 31, 32, 48, 48,
- 11, 12, 13, 58, 18, 16, 29, 62, 3, 8,
- 9, 10, 11, 12, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 18, 20, 21, 22, 23, 24, 25, 26, 61, 28,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 112, 53, 54, 61, 29, 29, 58,
- 59, 60, 18, 18, 63, 49, 29, 18, 113, 23,
- 23, 29, 102, 8, 9, 10, 11, 12, 123, 100,
- 101, 37, 23, 104, 10, 18, 37, 13, 14, 15,
- 62, 17, 61, 49, 20, 21, 22, 23, 49, 62,
- 18, 57, 58, 148, 62, 150, 57, 58, 153, 21,
- 37, 23, 157, 62, 49, 8, 9, 10, 11, 12,
- 115, 116, 49, 118, 21, 60, 23, 172, 188, 188,
- 57, 58, 192, 192, 155, 62, 62, 62, 183, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 49, 20, 21, 22, 23,
- 24, 25, 26, 62, 28, 0, 58, 60, 58, 10,
- 0, 37, 120, 37, 120, 8, 9, 10, 11, 12,
- 21, 22, 23, 49, 48, 49, 17, -1, -1, 53,
- 54, 57, 58, -1, 58, 59, 60, -1, -1, 63,
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 49, 20, 21, 22,
- 23, 24, 25, 26, 10, 28, 8, 9, 10, 11,
- 12, -1, -1, -1, 37, 21, 22, 23, 53, 54,
- 55, 56, 57, 58, -1, 48, 49, -1, -1, -1,
- 53, 54, -1, -1, -1, 58, 59, 60, -1, -1,
- 63, -1, -1, -1, 27, -1, -1, 49, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 50, 51, -1,
- 53, 54, 55, 56, 57, 58, -1, -1, -1, 27,
- -1, -1, 65, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, -1, 53, 54, 55, 56, 57,
- 58, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- 51, -1, 53, 54, 55, 56, 57, 58, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, -1, 53, 54, 55,
- 56, 57, 58, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- -1, 53, 54, 55, 56, 57, 58, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, -1, 53, 54, 55, 56, 57, 58,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, -1, 53, 54, 55, 56,
- 57, 58, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, -1, 53, 54, 55,
- 56, 57, 58, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, -1, 53, 54, 55, 56,
- 57, 58, 44, 45, 46, 47, 48, 49, 50, 51,
- -1, 53, 54, 55, 56, 57, 58, 10, -1, -1,
- 13, 14, 15, -1, 17, -1, -1, 20, 21, 22,
- 23, 46, 47, 48, 49, 50, 51, -1, 53, 54,
- 55, 56, 57, 58, 47, 48, 49, 50, 51, -1,
- 53, 54, 55, 56, 57, 58, -1, 49, 50, 51,
- -1, 53, 54, 55, 56, 57, 58
-};
-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/latest/lib/bison.simple"
-
-/* Skeleton output parser for bison,
- Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
-
- 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-#ifndef alloca
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else /* Not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
-#include <alloca.h>
-#else /* Not sparc */
-#ifdef MSDOS
-#include <malloc.h>
-#endif /* MSDOS */
-#endif /* Not sparc. */
-#endif /* Not GNU C. */
-#endif /* alloca not defined. */
-
-/* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
-
-/* Note: there must be only one dollar sign in this file.
- It is replaced by the list of actions, each action
- as one case of the switch. */
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY -2
-#define YYEOF 0
-#define YYACCEPT return(0)
-#define YYABORT return(1)
-#define YYERROR goto yyerrlab1
-/* Like YYERROR except do call yyerror.
- This remains here temporarily to ease the
- transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-#define YYFAIL goto yyerrlab
-#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(token, value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { yychar = (token), yylval = (value); \
- yychar1 = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { yyerror ("syntax error: cannot back up"); YYERROR; } \
-while (0)
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-#ifndef YYPURE
-#define YYLEX yylex()
-#endif
-
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#define YYLEX yylex(&yylval, &yylloc)
-#else
-#define YYLEX yylex(&yylval)
-#endif
-#endif
-
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
-
-int yychar; /* the lookahead symbol */
-YYSTYPE yylval; /* the semantic value of the */
- /* lookahead symbol */
-
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc; /* location data for the lookahead */
- /* symbol */
-#endif
-
-int yynerrs; /* number of parse errors so far */
-#endif /* not YYPURE */
-
-#if YYDEBUG != 0
-int yydebug; /* nonzero means print parse trace */
-/* Since this is uninitialized, it does not stop multiple parsers
- from coexisting. */
-#endif
-
-/* YYINITDEPTH indicates the initial size of the parser's stacks */
-
-#ifndef YYINITDEPTH
-#define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH is the maximum size the stacks can grow to
- (effective only if the built-in stack extension method is used). */
-
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
-#endif
-
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
-static void
-__yy_bcopy (from, to, count)
- char *from;
- char *to;
- int count;
-{
- register char *f = from;
- register char *t = to;
- register int i = count;
-
- while (i-- > 0)
- *t++ = *f++;
-}
-
-#else /* __cplusplus */
-
-/* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
-static void
-__yy_bcopy (char *from, char *to, int count)
-{
- register char *f = from;
- register char *t = to;
- register int i = count;
-
- while (i-- > 0)
- *t++ = *f++;
-}
-
-#endif
-
-#line 160 "/usr/latest/lib/bison.simple"
-int
-yyparse()
-{
- register int yystate;
- register int yyn;
- register short *yyssp;
- register YYSTYPE *yyvsp;
- int yyerrstatus; /* number of tokens to shift before error messages enabled */
- int yychar1; /* lookahead token as an internal (translated) token number */
-
- short yyssa[YYINITDEPTH]; /* the state stack */
- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
-
- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
- YYLTYPE *yyls = yylsa;
- YYLTYPE *yylsp;
- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
-
-#define YYPOPSTACK (yyvsp--, yysp--, yylsp--)
-#else
-#define YYPOPSTACK (yyvsp--, yysp--)
-#endif
-
- int yystacksize = YYINITDEPTH;
-
-#ifdef YYPURE
- int yychar;
- YYSTYPE yylval;
- int yynerrs;
-#ifdef YYLSP_NEEDED
- YYLTYPE yylloc;
-#endif
-#endif
-
- YYSTYPE yyval; /* the variable used to return */
- /* semantic values from the action */
- /* routines */
-
- int yylen;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Starting parse\n");
-#endif
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack. */
-
- yyssp = yyss - 1;
- yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
- yylsp = yyls;
-#endif
-
-/* Push a new state, which is found in yystate . */
-/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks. */
-yynewstate:
-
- *++yyssp = yystate;
-
- if (yyssp >= yyss + yystacksize - 1)
- {
- /* Give user a chance to reallocate the stack */
- /* Use copies of these so that the &'s don't force the real ones into memory. */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
- YYLTYPE *yyls1 = yyls;
-#endif
-
- /* Get the current used size of the three stacks, in elements. */
- int size = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- /* Each stack pointer address is followed by the size of
- the data in use in that stack, in bytes. */
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
-#ifdef YYLSP_NEEDED
- &yyls1, size * sizeof (*yylsp),
-#endif
- &yystacksize);
-
- yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
- yyls = yyls1;
-#endif
-#else /* no yyoverflow */
- /* Extend the stack our own way. */
- if (yystacksize >= YYMAXDEPTH)
- {
- yyerror("parser stack overflow");
- return 2;
- }
- yystacksize *= 2;
- if (yystacksize > YYMAXDEPTH)
- yystacksize = YYMAXDEPTH;
- yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
- __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
- yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
- __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
- __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
-#endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + size - 1;
- yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
- yylsp = yyls + size - 1;
-#endif
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
-
- if (yyssp >= yyss + yystacksize - 1)
- YYABORT;
- }
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Entering state %d\n", yystate);
-#endif
-
- yybackup:
-
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
-
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yydefault;
-
- /* Not known => get a lookahead token if don't already have one. */
-
- /* yychar is either YYEMPTY or YYEOF
- or a valid token in external form. */
-
- if (yychar == YYEMPTY)
- {
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Reading a token: ");
-#endif
- yychar = YYLEX;
- }
-
- /* Convert token to internal form (in yychar1) for indexing tables with */
-
- if (yychar <= 0) /* This means end of input. */
- {
- yychar1 = 0;
- yychar = YYEOF; /* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Now at end of input.\n");
-#endif
- }
- else
- {
- yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
-#endif
- }
-
- yyn += yychar1;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
- goto yydefault;
-
- yyn = yytable[yyn];
-
- /* yyn is what to do for this token type in this state.
- Negative => reduce, -yyn is rule number.
- Positive => shift, yyn is new state.
- New state is final state => don't bother to shift,
- just return success.
- 0, or most negative number => error. */
-
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrlab;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the lookahead token. */
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- /* count tokens shifted since error; after three, turn off error status. */
- if (yyerrstatus) yyerrstatus--;
-
- yystate = yyn;
- goto yynewstate;
-
-/* Do the default action for the current state. */
-yydefault:
-
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
-
-/* Do a reduction. yyn is the number of a rule to reduce with. */
-yyreduce:
- yylen = yyr2[yyn];
- yyval = yyvsp[1-yylen]; /* implement default value of the action */
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- int i;
-
- fprintf (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
-
- /* Print the symboles being reduced, and their result. */
- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
- fprintf (stderr, "%s ", yytname[yyrhs[i]]);
- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
- }
-#endif
-
-
- switch (yyn) {
-
-case 3:
-#line 231 "./expread.y"
-{ write_exp_elt_opcode (BINOP_COMMA); ;
- break;}
-case 4:
-#line 236 "./expread.y"
-{ write_exp_elt_opcode (UNOP_IND); ;
- break;}
-case 5:
-#line 239 "./expread.y"
-{ write_exp_elt_opcode (UNOP_ADDR); ;
- break;}
-case 6:
-#line 242 "./expread.y"
-{ write_exp_elt_opcode (UNOP_NEG); ;
- break;}
-case 7:
-#line 246 "./expread.y"
-{ write_exp_elt_opcode (UNOP_ZEROP); ;
- break;}
-case 8:
-#line 250 "./expread.y"
-{ write_exp_elt_opcode (UNOP_LOGNOT); ;
- break;}
-case 9:
-#line 254 "./expread.y"
-{ write_exp_elt_opcode (UNOP_PREINCREMENT); ;
- break;}
-case 10:
-#line 258 "./expread.y"
-{ write_exp_elt_opcode (UNOP_PREDECREMENT); ;
- break;}
-case 11:
-#line 262 "./expread.y"
-{ write_exp_elt_opcode (UNOP_POSTINCREMENT); ;
- break;}
-case 12:
-#line 266 "./expread.y"
-{ write_exp_elt_opcode (UNOP_POSTDECREMENT); ;
- break;}
-case 13:
-#line 270 "./expread.y"
-{ write_exp_elt_opcode (UNOP_SIZEOF); ;
- break;}
-case 14:
-#line 274 "./expread.y"
-{ write_exp_elt_opcode (STRUCTOP_PTR);
- write_exp_string (yyvsp[0].sval);
- write_exp_elt_opcode (STRUCTOP_PTR); ;
- break;}
-case 15:
-#line 280 "./expread.y"
-{ write_exp_elt_opcode (STRUCTOP_MPTR); ;
- break;}
-case 16:
-#line 284 "./expread.y"
-{ write_exp_elt_opcode (STRUCTOP_STRUCT);
- write_exp_string (yyvsp[0].sval);
- write_exp_elt_opcode (STRUCTOP_STRUCT); ;
- break;}
-case 17:
-#line 290 "./expread.y"
-{ write_exp_elt_opcode (STRUCTOP_MEMBER); ;
- break;}
-case 18:
-#line 294 "./expread.y"
-{ write_exp_elt_opcode (BINOP_SUBSCRIPT); ;
- break;}
-case 19:
-#line 300 "./expread.y"
-{ start_arglist (); ;
- break;}
-case 20:
-#line 302 "./expread.y"
-{ write_exp_elt_opcode (OP_FUNCALL);
- write_exp_elt_longcst ((LONGEST) end_arglist ());
- write_exp_elt_opcode (OP_FUNCALL); ;
- break;}
-case 22:
-#line 311 "./expread.y"
-{ arglist_len = 1; ;
- break;}
-case 23:
-#line 315 "./expread.y"
-{ arglist_len++; ;
- break;}
-case 24:
-#line 319 "./expread.y"
-{ write_exp_elt_opcode (UNOP_MEMVAL);
- write_exp_elt_type (yyvsp[-2].tval);
- write_exp_elt_opcode (UNOP_MEMVAL); ;
- break;}
-case 25:
-#line 325 "./expread.y"
-{ write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type (yyvsp[-2].tval);
- write_exp_elt_opcode (UNOP_CAST); ;
- break;}
-case 26:
-#line 331 "./expread.y"
-{ ;
- break;}
-case 27:
-#line 337 "./expread.y"
-{ write_exp_elt_opcode (BINOP_REPEAT); ;
- break;}
-case 28:
-#line 341 "./expread.y"
-{ write_exp_elt_opcode (BINOP_MUL); ;
- break;}
-case 29:
-#line 345 "./expread.y"
-{ write_exp_elt_opcode (BINOP_DIV); ;
- break;}
-case 30:
-#line 349 "./expread.y"
-{ write_exp_elt_opcode (BINOP_REM); ;
- break;}
-case 31:
-#line 353 "./expread.y"
-{ write_exp_elt_opcode (BINOP_ADD); ;
- break;}
-case 32:
-#line 357 "./expread.y"
-{ write_exp_elt_opcode (BINOP_SUB); ;
- break;}
-case 33:
-#line 361 "./expread.y"
-{ write_exp_elt_opcode (BINOP_LSH); ;
- break;}
-case 34:
-#line 365 "./expread.y"
-{ write_exp_elt_opcode (BINOP_RSH); ;
- break;}
-case 35:
-#line 369 "./expread.y"
-{ write_exp_elt_opcode (BINOP_EQUAL); ;
- break;}
-case 36:
-#line 373 "./expread.y"
-{ write_exp_elt_opcode (BINOP_NOTEQUAL); ;
- break;}
-case 37:
-#line 377 "./expread.y"
-{ write_exp_elt_opcode (BINOP_LEQ); ;
- break;}
-case 38:
-#line 381 "./expread.y"
-{ write_exp_elt_opcode (BINOP_GEQ); ;
- break;}
-case 39:
-#line 385 "./expread.y"
-{ write_exp_elt_opcode (BINOP_LESS); ;
- break;}
-case 40:
-#line 389 "./expread.y"
-{ write_exp_elt_opcode (BINOP_GTR); ;
- break;}
-case 41:
-#line 393 "./expread.y"
-{ write_exp_elt_opcode (BINOP_LOGAND); ;
- break;}
-case 42:
-#line 397 "./expread.y"
-{ write_exp_elt_opcode (BINOP_LOGXOR); ;
- break;}
-case 43:
-#line 401 "./expread.y"
-{ write_exp_elt_opcode (BINOP_LOGIOR); ;
- break;}
-case 44:
-#line 405 "./expread.y"
-{ write_exp_elt_opcode (BINOP_AND); ;
- break;}
-case 45:
-#line 409 "./expread.y"
-{ write_exp_elt_opcode (BINOP_OR); ;
- break;}
-case 46:
-#line 413 "./expread.y"
-{ write_exp_elt_opcode (TERNOP_COND); ;
- break;}
-case 47:
-#line 417 "./expread.y"
-{ write_exp_elt_opcode (BINOP_ASSIGN); ;
- break;}
-case 48:
-#line 421 "./expread.y"
-{ write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
- write_exp_elt_opcode (yyvsp[-1].opcode);
- write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); ;
- break;}
-case 49:
-#line 427 "./expread.y"
-{ write_exp_elt_opcode (OP_LONG);
- if (yyvsp[0].lval == (int) yyvsp[0].lval || yyvsp[0].lval == (unsigned int) yyvsp[0].lval)
- write_exp_elt_type (builtin_type_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_LONGEST);
- write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
- write_exp_elt_opcode (OP_LONG); ;
- break;}
-case 50:
-#line 437 "./expread.y"
-{ YYSTYPE val;
- parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val);
- write_exp_elt_opcode (OP_LONG);
- if (val.lval == (int) val.lval ||
- val.lval == (unsigned int) val.lval)
- write_exp_elt_type (builtin_type_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_LONGEST);
- write_exp_elt_longcst (val.lval);
- write_exp_elt_opcode (OP_LONG); ;
- break;}
-case 51:
-#line 450 "./expread.y"
-{
- write_exp_elt_opcode (OP_LONG);
- if (yyvsp[0].ulval == (unsigned int) yyvsp[0].ulval)
- write_exp_elt_type (builtin_type_unsigned_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_UNSIGNED_LONGEST);
- write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
- write_exp_elt_opcode (OP_LONG);
- ;
- break;}
-case 52:
-#line 462 "./expread.y"
-{ YYSTYPE val;
- parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val);
- write_exp_elt_opcode (OP_LONG);
- if (val.ulval == (unsigned int) val.ulval)
- write_exp_elt_type (builtin_type_unsigned_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_UNSIGNED_LONGEST);
- write_exp_elt_longcst ((LONGEST)val.ulval);
- write_exp_elt_opcode (OP_LONG);
- ;
- break;}
-case 53:
-#line 475 "./expread.y"
-{ write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
- write_exp_elt_opcode (OP_LONG); ;
- break;}
-case 54:
-#line 482 "./expread.y"
-{ write_exp_elt_opcode (OP_DOUBLE);
- write_exp_elt_type (builtin_type_double);
- write_exp_elt_dblcst (yyvsp[0].dval);
- write_exp_elt_opcode (OP_DOUBLE); ;
- break;}
-case 56:
-#line 492 "./expread.y"
-{ write_exp_elt_opcode (OP_LAST);
- write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
- write_exp_elt_opcode (OP_LAST); ;
- break;}
-case 57:
-#line 498 "./expread.y"
-{ write_exp_elt_opcode (OP_REGISTER);
- write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
- write_exp_elt_opcode (OP_REGISTER); ;
- break;}
-case 58:
-#line 504 "./expread.y"
-{ write_exp_elt_opcode (OP_INTERNALVAR);
- write_exp_elt_intern (yyvsp[0].ivar);
- write_exp_elt_opcode (OP_INTERNALVAR); ;
- break;}
-case 59:
-#line 510 "./expread.y"
-{ write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
- write_exp_elt_opcode (OP_LONG); ;
- break;}
-case 60:
-#line 517 "./expread.y"
-{ write_exp_elt_opcode (OP_STRING);
- write_exp_string (yyvsp[0].sval);
- write_exp_elt_opcode (OP_STRING); ;
- break;}
-case 61:
-#line 524 "./expread.y"
-{ write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS); ;
- break;}
-case 62:
-#line 531 "./expread.y"
-{
- if (yyvsp[0].ssym.sym != 0)
- yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym);
- else
- {
- struct symtab *tem =
- lookup_symtab (copy_name (yyvsp[0].ssym.stoken));
- if (tem)
- yyval.bval = BLOCKVECTOR_BLOCK
- (BLOCKVECTOR (tem), STATIC_BLOCK);
- else
- error ("No file or function \"%s\".",
- copy_name (yyvsp[0].ssym.stoken));
- }
- ;
- break;}
-case 63:
-#line 549 "./expread.y"
-{ struct symbol *tem
- = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
- VAR_NAMESPACE, 0, NULL);
- if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
- error ("No function \"%s\" in specified context.",
- copy_name (yyvsp[0].sval));
- yyval.bval = SYMBOL_BLOCK_VALUE (tem); ;
- break;}
-case 64:
-#line 559 "./expread.y"
-{ struct symbol *sym;
- sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
- VAR_NAMESPACE, 0, NULL);
- if (sym == 0)
- error ("No symbol \"%s\" in specified context.",
- copy_name (yyvsp[0].sval));
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE); ;
- break;}
-case 65:
-#line 571 "./expread.y"
-{
- struct type *type = yyvsp[-2].tval;
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_UNION)
- error ("`%s' is not defined as an aggregate type.",
- TYPE_NAME (type));
-
- write_exp_elt_opcode (OP_SCOPE);
- write_exp_elt_type (type);
- write_exp_string (yyvsp[0].sval);
- write_exp_elt_opcode (OP_SCOPE);
- ;
- break;}
-case 66:
-#line 584 "./expread.y"
-{
- struct type *type = yyvsp[-3].tval;
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_UNION)
- error ("`%s' is not defined as an aggregate type.",
- TYPE_NAME (type));
-
- if (strcmp (type_name_no_tag (type), yyvsp[0].sval.ptr))
- error ("invalid destructor `%s::~%s'",
- type_name_no_tag (type), yyvsp[0].sval.ptr);
-
- write_exp_elt_opcode (OP_SCOPE);
- write_exp_elt_type (type);
- write_exp_string (yyvsp[0].sval);
- write_exp_elt_opcode (OP_SCOPE);
- write_exp_elt_opcode (UNOP_LOGNOT);
- ;
- break;}
-case 67:
-#line 602 "./expread.y"
-{
- char *name = copy_name (yyvsp[0].sval);
- struct symbol *sym;
- int i;
-
- sym =
- lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL);
- if (sym)
- {
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- break;
- }
- for (i = 0; i < misc_function_count; i++)
- if (!strcmp (misc_function_vector[i].name, name))
- break;
-
- if (i < misc_function_count)
- {
- enum misc_function_type mft =
- misc_function_vector[i].type;
-
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) misc_function_vector[i].address);
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_opcode (UNOP_MEMVAL);
- if (mft == mf_data || mft == mf_bss)
- write_exp_elt_type (builtin_type_int);
- else if (mft == mf_text)
- write_exp_elt_type (lookup_function_type (builtin_type_int));
- else
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_opcode (UNOP_MEMVAL);
- }
- else
- if (symtab_list == 0
- && partial_symtab_list == 0)
- error ("No symbol table is loaded. Use the \"file\" command.");
- else
- error ("No symbol \"%s\" in current context.", name);
- ;
- break;}
-case 68:
-#line 648 "./expread.y"
-{ struct symbol *sym = yyvsp[0].ssym.sym;
-
- if (sym)
- {
- switch (sym->class)
- {
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_LOCAL:
- case LOC_LOCAL_ARG:
- if (innermost_block == 0 ||
- contained_in (block_found,
- innermost_block))
- innermost_block = block_found;
- case LOC_UNDEF:
- case LOC_CONST:
- case LOC_STATIC:
- case LOC_TYPEDEF:
- case LOC_LABEL:
- case LOC_BLOCK:
- case LOC_CONST_BYTES:
-
- /* In this case the expression can
- be evaluated regardless of what
- frame we are in, so there is no
- need to check for the
- innermost_block. These cases are
- listed so that gcc -Wall will
- report types that may not have
- been considered. */
-
- break;
- }
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- }
- else if (yyvsp[0].ssym.is_a_field_of_this)
- {
- /* C++: it hangs off of `this'. Must
- not inadvertently convert from a method call
- to data ref. */
- if (innermost_block == 0 ||
- contained_in (block_found, innermost_block))
- innermost_block = block_found;
- write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (STRUCTOP_PTR);
- write_exp_string (yyvsp[0].ssym.stoken);
- write_exp_elt_opcode (STRUCTOP_PTR);
- }
- else
- {
- register int i;
- register char *arg = copy_name (yyvsp[0].ssym.stoken);
-
- /* FIXME, this search is linear! At least
- optimize the strcmp with a 1-char cmp... */
- for (i = 0; i < misc_function_count; i++)
- if (!strcmp (misc_function_vector[i].name, arg))
- break;
-
- if (i < misc_function_count)
- {
- enum misc_function_type mft =
- misc_function_vector[i].type;
-
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) misc_function_vector[i].address);
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_opcode (UNOP_MEMVAL);
- if (mft == mf_data || mft == mf_bss)
- write_exp_elt_type (builtin_type_int);
- else if (mft == mf_text)
- write_exp_elt_type (lookup_function_type (builtin_type_int));
- else
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_opcode (UNOP_MEMVAL);
- }
- else if (symtab_list == 0
- && partial_symtab_list == 0)
- error ("No symbol table is loaded. Use the \"file\" command.");
- else
- error ("No symbol \"%s\" in current context.",
- copy_name (yyvsp[0].ssym.stoken));
- }
- ;
- break;}
-case 70:
-#line 743 "./expread.y"
-{
- /* This is where the interesting stuff happens. */
- int done = 0;
- int array_size;
- struct type *follow_type = yyvsp[-1].tval;
-
- while (!done)
- switch (pop_type ())
- {
- case tp_end:
- done = 1;
- break;
- case tp_pointer:
- follow_type = lookup_pointer_type (follow_type);
- break;
- case tp_reference:
- follow_type = lookup_reference_type (follow_type);
- break;
- case tp_array:
- array_size = pop_type_int ();
- if (array_size != -1)
- follow_type = create_array_type (follow_type,
- array_size);
- else
- follow_type = lookup_pointer_type (follow_type);
- break;
- case tp_function:
- follow_type = lookup_function_type (follow_type);
- break;
- }
- yyval.tval = follow_type;
- ;
- break;}
-case 71:
-#line 778 "./expread.y"
-{ push_type (tp_pointer); yyval.voidval = 0; ;
- break;}
-case 72:
-#line 780 "./expread.y"
-{ push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; ;
- break;}
-case 73:
-#line 782 "./expread.y"
-{ push_type (tp_reference); yyval.voidval = 0; ;
- break;}
-case 74:
-#line 784 "./expread.y"
-{ push_type (tp_reference); yyval.voidval = yyvsp[0].voidval; ;
- break;}
-case 76:
-#line 789 "./expread.y"
-{ yyval.voidval = yyvsp[-1].voidval; ;
- break;}
-case 77:
-#line 791 "./expread.y"
-{
- push_type_int (yyvsp[0].lval);
- push_type (tp_array);
- ;
- break;}
-case 78:
-#line 796 "./expread.y"
-{
- push_type_int (yyvsp[0].lval);
- push_type (tp_array);
- yyval.voidval = 0;
- ;
- break;}
-case 79:
-#line 802 "./expread.y"
-{ push_type (tp_function); ;
- break;}
-case 80:
-#line 804 "./expread.y"
-{ push_type (tp_function); ;
- break;}
-case 81:
-#line 808 "./expread.y"
-{ yyval.lval = -1; ;
- break;}
-case 82:
-#line 810 "./expread.y"
-{ yyval.lval = yyvsp[-1].lval; ;
- break;}
-case 83:
-#line 814 "./expread.y"
-{ yyval.voidval = 0; ;
- break;}
-case 85:
-#line 819 "./expread.y"
-{ yyval.tval = lookup_member_type (builtin_type_int, yyvsp[-2].tval); ;
- break;}
-case 86:
-#line 821 "./expread.y"
-{ yyval.tval = lookup_member_type (yyvsp[-5].tval, yyvsp[-3].tval); ;
- break;}
-case 87:
-#line 823 "./expread.y"
-{ yyval.tval = lookup_member_type
- (lookup_function_type (yyvsp[-7].tval), yyvsp[-5].tval); ;
- break;}
-case 88:
-#line 826 "./expread.y"
-{ yyval.tval = lookup_member_type
- (lookup_function_type (yyvsp[-8].tval), yyvsp[-6].tval);
- free (yyvsp[-1].tvec); ;
- break;}
-case 89:
-#line 833 "./expread.y"
-{ yyval.tval = yyvsp[0].tsym.type; ;
- break;}
-case 90:
-#line 835 "./expread.y"
-{ yyval.tval = builtin_type_int; ;
- break;}
-case 91:
-#line 837 "./expread.y"
-{ yyval.tval = builtin_type_long; ;
- break;}
-case 92:
-#line 839 "./expread.y"
-{ yyval.tval = builtin_type_short; ;
- break;}
-case 93:
-#line 841 "./expread.y"
-{ yyval.tval = builtin_type_long; ;
- break;}
-case 94:
-#line 843 "./expread.y"
-{ yyval.tval = builtin_type_unsigned_long; ;
- break;}
-case 95:
-#line 845 "./expread.y"
-{ yyval.tval = builtin_type_long_long; ;
- break;}
-case 96:
-#line 847 "./expread.y"
-{ yyval.tval = builtin_type_long_long; ;
- break;}
-case 97:
-#line 849 "./expread.y"
-{ yyval.tval = builtin_type_unsigned_long_long; ;
- break;}
-case 98:
-#line 851 "./expread.y"
-{ yyval.tval = builtin_type_unsigned_long_long; ;
- break;}
-case 99:
-#line 853 "./expread.y"
-{ yyval.tval = builtin_type_short; ;
- break;}
-case 100:
-#line 855 "./expread.y"
-{ yyval.tval = builtin_type_unsigned_short; ;
- break;}
-case 101:
-#line 857 "./expread.y"
-{ yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
- expression_context_block); ;
- break;}
-case 102:
-#line 860 "./expread.y"
-{ yyval.tval = lookup_union (copy_name (yyvsp[0].sval),
- expression_context_block); ;
- break;}
-case 103:
-#line 863 "./expread.y"
-{ yyval.tval = lookup_enum (copy_name (yyvsp[0].sval),
- expression_context_block); ;
- break;}
-case 104:
-#line 866 "./expread.y"
-{ yyval.tval = lookup_unsigned_typename (TYPE_NAME(yyvsp[0].tsym.type)); ;
- break;}
-case 105:
-#line 868 "./expread.y"
-{ yyval.tval = builtin_type_unsigned_int; ;
- break;}
-case 106:
-#line 870 "./expread.y"
-{ yyval.tval = yyvsp[0].tsym.type; ;
- break;}
-case 107:
-#line 872 "./expread.y"
-{ yyval.tval = builtin_type_int; ;
- break;}
-case 109:
-#line 877 "./expread.y"
-{
- yyval.tsym.stoken.ptr = "int";
- yyval.tsym.stoken.length = 3;
- yyval.tsym.type = builtin_type_int;
- ;
- break;}
-case 110:
-#line 883 "./expread.y"
-{
- yyval.tsym.stoken.ptr = "long";
- yyval.tsym.stoken.length = 4;
- yyval.tsym.type = builtin_type_long;
- ;
- break;}
-case 111:
-#line 889 "./expread.y"
-{
- yyval.tsym.stoken.ptr = "short";
- yyval.tsym.stoken.length = 5;
- yyval.tsym.type = builtin_type_short;
- ;
- break;}
-case 112:
-#line 898 "./expread.y"
-{ yyval.tvec = (struct type **)xmalloc (sizeof (struct type *) * 2);
- yyval.tvec[0] = (struct type *)0;
- yyval.tvec[1] = yyvsp[0].tval;
- ;
- break;}
-case 113:
-#line 903 "./expread.y"
-{ int len = sizeof (struct type *) * ++(yyvsp[-2].ivec[0]);
- yyval.tvec = (struct type **)xrealloc (yyvsp[-2].tvec, len);
- yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval;
- ;
- break;}
-case 114:
-#line 909 "./expread.y"
-{ yyval.sval = yyvsp[0].ssym.stoken; ;
- break;}
-case 115:
-#line 910 "./expread.y"
-{ yyval.sval = yyvsp[0].ssym.stoken; ;
- break;}
-case 116:
-#line 911 "./expread.y"
-{ yyval.sval = yyvsp[0].tsym.stoken; ;
- break;}
-case 117:
-#line 912 "./expread.y"
-{ yyval.sval = yyvsp[0].ssym.stoken; ;
- break;}
-case 118:
-#line 913 "./expread.y"
-{ yyval.sval = yyvsp[0].ssym.stoken; ;
- break;}
-}
- /* the action file gets copied in in place of this dollarsign */
-#line 423 "/usr/latest/lib/bison.simple"
-
- yyvsp -= yylen;
- yyssp -= yylen;
-#ifdef YYLSP_NEEDED
- yylsp -= yylen;
-#endif
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
-#endif
-
- *++yyvsp = yyval;
-
-#ifdef YYLSP_NEEDED
- yylsp++;
- if (yylen == 0)
- {
- yylsp->first_line = yylloc.first_line;
- yylsp->first_column = yylloc.first_column;
- yylsp->last_line = (yylsp-1)->last_line;
- yylsp->last_column = (yylsp-1)->last_column;
- yylsp->text = 0;
- }
- else
- {
- yylsp->last_line = (yylsp+yylen-1)->last_line;
- yylsp->last_column = (yylsp+yylen-1)->last_column;
- }
-#endif
-
- /* Now "shift" the result of the reduction.
- Determine what state that goes to,
- based on the state we popped back to
- and the rule number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTBASE];
-
- goto yynewstate;
-
-yyerrlab: /* here on detecting error */
-
- if (! yyerrstatus)
- /* If not already recovering from an error, report this error. */
- {
- ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (yyn > YYFLAG && yyn < YYLAST)
- {
- int size = 0;
- char *msg;
- int x, count;
-
- count = 0;
- for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- size += strlen(yytname[x]) + 15, count++;
- msg = (char *) xmalloc(size + 15);
- strcpy(msg, "parse error");
-
- if (count < 5)
- {
- count = 0;
- for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- {
- strcat(msg, count == 0 ? ", expecting `" : " or `");
- strcat(msg, yytname[x]);
- strcat(msg, "'");
- count++;
- }
- }
- yyerror(msg);
- free(msg);
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror("parse error");
- }
-
-yyerrlab1: /* here on error raised explicitly by an action */
-
- if (yyerrstatus == 3)
- {
- /* if just tried and failed to reuse lookahead token after an error, discard it. */
-
- /* return failure if at end of input */
- if (yychar == YYEOF)
- YYABORT;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
- yychar = YYEMPTY;
- }
-
- /* Else will try to reuse lookahead token
- after shifting the error token. */
-
- yyerrstatus = 3; /* Each real token shifted decrements this */
-
- goto yyerrhandle;
-
-yyerrdefault: /* current state does not do anything special for the error token. */
-
-#if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
- if (yyn) goto yydefault;
-#endif
-
-yyerrpop: /* pop the current state because it cannot handle the error token */
-
- if (yyssp == yyss) YYABORT;
- yyvsp--;
- yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
- yylsp--;
-#endif
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
-#endif
-
-yyerrhandle:
-
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
-
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
-
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrpop;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting error token, ");
-#endif
-
- *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- yystate = yyn;
- goto yynewstate;
-}
-#line 928 "./expread.y"
-
-
-/* Begin counting arguments for a function call,
- saving the data about any containing call. */
-
-static void
-start_arglist ()
-{
- register struct funcall *new = (struct funcall *) xmalloc (sizeof (struct funcall));
-
- new->next = funcall_chain;
- new->arglist_len = arglist_len;
- arglist_len = 0;
- funcall_chain = new;
-}
-
-/* Return the number of arguments in a function call just terminated,
- and restore the data for the containing function call. */
-
-static int
-end_arglist ()
-{
- register int val = arglist_len;
- register struct funcall *call = funcall_chain;
- funcall_chain = call->next;
- arglist_len = call->arglist_len;
- free (call);
- return val;
-}
-
-/* Free everything in the funcall chain.
- Used when there is an error inside parsing. */
-
-static void
-free_funcalls ()
-{
- register struct funcall *call, *next;
-
- for (call = funcall_chain; call; call = next)
- {
- next = call->next;
- free (call);
- }
-}
-
-/* This page contains the functions for adding data to the struct expression
- being constructed. */
-
-/* Add one element to the end of the expression. */
-
-/* To avoid a bug in the Sun 4 compiler, we pass things that can fit into
- a register through here */
-
-static void
-write_exp_elt (expelt)
- union exp_element expelt;
-{
- if (expout_ptr >= expout_size)
- {
- expout_size *= 2;
- expout = (struct expression *) xrealloc (expout,
- sizeof (struct expression)
- + expout_size * sizeof (union exp_element));
- }
- expout->elts[expout_ptr++] = expelt;
-}
-
-static void
-write_exp_elt_opcode (expelt)
- enum exp_opcode expelt;
-{
- union exp_element tmp;
-
- tmp.opcode = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_sym (expelt)
- struct symbol *expelt;
-{
- union exp_element tmp;
-
- tmp.symbol = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_longcst (expelt)
- LONGEST expelt;
-{
- union exp_element tmp;
-
- tmp.longconst = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_dblcst (expelt)
- double expelt;
-{
- union exp_element tmp;
-
- tmp.doubleconst = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_type (expelt)
- struct type *expelt;
-{
- union exp_element tmp;
-
- tmp.type = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_intern (expelt)
- struct internalvar *expelt;
-{
- union exp_element tmp;
-
- tmp.internalvar = expelt;
-
- write_exp_elt (tmp);
-}
-
-/* Add a string constant to the end of the expression.
- Follow it by its length in bytes, as a separate exp_element. */
-
-static void
-write_exp_string (str)
- struct stoken str;
-{
- register int len = str.length;
- register int lenelt
- = (len + sizeof (union exp_element)) / sizeof (union exp_element);
-
- expout_ptr += lenelt;
-
- if (expout_ptr >= expout_size)
- {
- expout_size = max (expout_size * 2, expout_ptr + 10);
- expout = (struct expression *)
- xrealloc (expout, (sizeof (struct expression)
- + (expout_size * sizeof (union exp_element))));
- }
- bcopy (str.ptr, (char *) &expout->elts[expout_ptr - lenelt], len);
- ((char *) &expout->elts[expout_ptr - lenelt])[len] = 0;
- write_exp_elt_longcst ((LONGEST) len);
-}
-
-/* During parsing of a C expression, the pointer to the next character
- is in this variable. */
-
-static char *lexptr;
-
-/* Tokens that refer to names do so with explicit pointer and length,
- so they can share the storage that lexptr is parsing.
-
- When it is necessary to pass a name to a function that expects
- a null-terminated string, the substring is copied out
- into a block of storage that namecopy points to.
-
- namecopy is allocated once, guaranteed big enough, for each parsing. */
-
-static char *namecopy;
-
-/* Current depth in parentheses within the expression. */
-
-static int paren_depth;
-
-/* Nonzero means stop parsing on first comma (if not within parentheses). */
-
-static int comma_terminates;
-
-/* Take care of parsing a number (anything that starts with a digit).
- Set yylval and return the token type; update lexptr.
- LEN is the number of characters in it. */
-
-/*** Needs some error checking for the float case ***/
-
-static int
-parse_number (p, len, parsed_float, putithere)
- register char *p;
- register int len;
- int parsed_float;
- YYSTYPE *putithere;
-{
- register LONGEST n = 0;
- register int i;
- register int c;
- register int base = input_radix;
- int unsigned_p = 0;
-
- extern double atof ();
-
- if (parsed_float)
- {
- /* It's a float since it contains a point or an exponent. */
- putithere->dval = atof (p);
- return FLOAT;
- }
-
- /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
- if (p[0] == '0')
- switch (p[1])
- {
- case 'x':
- case 'X':
- if (len >= 3)
- {
- p += 2;
- base = 16;
- len -= 2;
- }
- break;
-
- case 't':
- case 'T':
- case 'd':
- case 'D':
- if (len >= 3)
- {
- p += 2;
- base = 10;
- len -= 2;
- }
- break;
-
- default:
- base = 8;
- break;
- }
-
- while (len-- > 0)
- {
- c = *p++;
- if (c >= 'A' && c <= 'Z')
- c += 'a' - 'A';
- if (c != 'l' && c != 'u')
- n *= base;
- if (c >= '0' && c <= '9')
- n += i = c - '0';
- else
- {
- if (base > 10 && c >= 'a' && c <= 'f')
- n += i = c - 'a' + 10;
- else if (len == 0 && c == 'l')
- ;
- else if (len == 0 && c == 'u')
- unsigned_p = 1;
- else
- return ERROR; /* Char not a digit */
- }
- if (i >= base)
- return ERROR; /* Invalid digit in this base */
- }
-
- if (unsigned_p)
- {
- putithere->ulval = n;
- return UINT;
- }
- else
- {
- putithere->lval = n;
- return INT;
- }
-}
-
-struct token
-{
- char *operator;
- int token;
- enum exp_opcode opcode;
-};
-
-const static struct token tokentab3[] =
- {
- {">>=", ASSIGN_MODIFY, BINOP_RSH},
- {"<<=", ASSIGN_MODIFY, BINOP_LSH}
- };
-
-const static struct token tokentab2[] =
- {
- {"+=", ASSIGN_MODIFY, BINOP_ADD},
- {"-=", ASSIGN_MODIFY, BINOP_SUB},
- {"*=", ASSIGN_MODIFY, BINOP_MUL},
- {"/=", ASSIGN_MODIFY, BINOP_DIV},
- {"%=", ASSIGN_MODIFY, BINOP_REM},
- {"|=", ASSIGN_MODIFY, BINOP_LOGIOR},
- {"&=", ASSIGN_MODIFY, BINOP_LOGAND},
- {"^=", ASSIGN_MODIFY, BINOP_LOGXOR},
- {"++", INCREMENT, BINOP_END},
- {"--", DECREMENT, BINOP_END},
- {"->", ARROW, BINOP_END},
- {"&&", AND, BINOP_END},
- {"||", OR, BINOP_END},
- {"::", COLONCOLON, BINOP_END},
- {"<<", LSH, BINOP_END},
- {">>", RSH, BINOP_END},
- {"==", EQUAL, BINOP_END},
- {"!=", NOTEQUAL, BINOP_END},
- {"<=", LEQ, BINOP_END},
- {">=", GEQ, BINOP_END}
- };
-
-/* assign machine-independent names to certain registers
- * (unless overridden by the REGISTER_NAMES table)
- */
-struct std_regs {
- char *name;
- int regnum;
-} std_regs[] = {
-#ifdef PC_REGNUM
- { "pc", PC_REGNUM },
-#endif
-#ifdef FP_REGNUM
- { "fp", FP_REGNUM },
-#endif
-#ifdef SP_REGNUM
- { "sp", SP_REGNUM },
-#endif
-#ifdef PS_REGNUM
- { "ps", PS_REGNUM },
-#endif
-};
-
-#define NUM_STD_REGS (sizeof std_regs / sizeof std_regs[0])
-
-/* Read one token, getting characters through lexptr. */
-
-static int
-yylex ()
-{
- register int c;
- register int namelen;
- register unsigned i;
- register char *tokstart;
-
- retry:
-
- tokstart = lexptr;
- /* See if it is a special token of length 3. */
- for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
- if (!strncmp (tokstart, tokentab3[i].operator, 3))
- {
- lexptr += 3;
- yylval.opcode = tokentab3[i].opcode;
- return tokentab3[i].token;
- }
-
- /* See if it is a special token of length 2. */
- for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
- if (!strncmp (tokstart, tokentab2[i].operator, 2))
- {
- lexptr += 2;
- yylval.opcode = tokentab2[i].opcode;
- return tokentab2[i].token;
- }
-
- switch (c = *tokstart)
- {
- case 0:
- return 0;
-
- case ' ':
- case '\t':
- case '\n':
- lexptr++;
- goto retry;
-
- case '\'':
- lexptr++;
- c = *lexptr++;
- if (c == '\\')
- c = parse_escape (&lexptr);
- yylval.lval = c;
- c = *lexptr++;
- if (c != '\'')
- error ("Invalid character constant.");
- return CHAR;
-
- case '(':
- paren_depth++;
- lexptr++;
- return c;
-
- case ')':
- if (paren_depth == 0)
- return 0;
- paren_depth--;
- lexptr++;
- return c;
-
- case ',':
- if (comma_terminates && paren_depth == 0)
- return 0;
- lexptr++;
- return c;
-
- case '.':
- /* Might be a floating point number. */
- if (lexptr[1] < '0' || lexptr[1] > '9')
- goto symbol; /* Nope, must be a symbol. */
- /* FALL THRU into number case. */
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- {
- /* It's a number. */
- int got_dot = 0, got_e = 0, toktype;
- register char *p = tokstart;
- int hex = input_radix > 10;
-
- if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
- {
- p += 2;
- hex = 1;
- }
- else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
- {
- p += 2;
- hex = 0;
- }
-
- for (;; ++p)
- {
- if (!hex && !got_e && (*p == 'e' || *p == 'E'))
- got_dot = got_e = 1;
- else if (!hex && !got_dot && *p == '.')
- got_dot = 1;
- else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
- && (*p == '-' || *p == '+'))
- /* This is the sign of the exponent, not the end of the
- number. */
- continue;
- /* We will take any letters or digits. parse_number will
- complain if past the radix, or if L or U are not final. */
- else if ((*p < '0' || *p > '9')
- && ((*p < 'a' || *p > 'z')
- && (*p < 'A' || *p > 'Z')))
- break;
- }
- toktype = parse_number (tokstart, p - tokstart, got_dot|got_e, &yylval);
- if (toktype == ERROR)
- {
- char *err_copy = (char *) alloca (p - tokstart + 1);
-
- bcopy (tokstart, err_copy, p - tokstart);
- err_copy[p - tokstart] = 0;
- error ("Invalid number \"%s\".", err_copy);
- }
- lexptr = p;
- return toktype;
- }
-
- case '+':
- case '-':
- case '*':
- case '/':
- case '%':
- case '|':
- case '&':
- case '^':
- case '~':
- case '!':
- case '@':
- case '<':
- case '>':
- case '[':
- case ']':
- case '?':
- case ':':
- case '=':
- case '{':
- case '}':
- symbol:
- lexptr++;
- return c;
-
- case '"':
- for (namelen = 1; (c = tokstart[namelen]) != '"'; namelen++)
- if (c == '\\')
- {
- c = tokstart[++namelen];
- if (c >= '0' && c <= '9')
- {
- c = tokstart[++namelen];
- if (c >= '0' && c <= '9')
- c = tokstart[++namelen];
- }
- }
- yylval.sval.ptr = tokstart + 1;
- yylval.sval.length = namelen - 1;
- lexptr += namelen + 1;
- return STRING;
- }
-
- if (!(c == '_' || c == '$'
- || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
- /* We must have come across a bad character (e.g. ';'). */
- error ("Invalid character '%c' in expression.", c);
-
- /* It's a name. See how long it is. */
- namelen = 0;
- for (c = tokstart[namelen];
- (c == '_' || c == '$' || (c >= '0' && c <= '9')
- || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
- c = tokstart[++namelen])
- ;
-
- /* The token "if" terminates the expression and is NOT
- removed from the input stream. */
- if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
- {
- return 0;
- }
-
- lexptr += namelen;
-
- /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
- and $$digits (equivalent to $<-digits> if you could type that).
- Make token type LAST, and put the number (the digits) in yylval. */
-
- if (*tokstart == '$')
- {
- register int negate = 0;
- c = 1;
- /* Double dollar means negate the number and add -1 as well.
- Thus $$ alone means -1. */
- if (namelen >= 2 && tokstart[1] == '$')
- {
- negate = 1;
- c = 2;
- }
- if (c == namelen)
- {
- /* Just dollars (one or two) */
- yylval.lval = - negate;
- return LAST;
- }
- /* Is the rest of the token digits? */
- for (; c < namelen; c++)
- if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
- break;
- if (c == namelen)
- {
- yylval.lval = atoi (tokstart + 1 + negate);
- if (negate)
- yylval.lval = - yylval.lval;
- return LAST;
- }
- }
-
- /* Handle tokens that refer to machine registers:
- $ followed by a register name. */
-
- if (*tokstart == '$') {
- for (c = 0; c < NUM_REGS; c++)
- if (namelen - 1 == strlen (reg_names[c])
- && !strncmp (tokstart + 1, reg_names[c], namelen - 1))
- {
- yylval.lval = c;
- return REGNAME;
- }
- for (c = 0; c < NUM_STD_REGS; c++)
- if (namelen - 1 == strlen (std_regs[c].name)
- && !strncmp (tokstart + 1, std_regs[c].name, namelen - 1))
- {
- yylval.lval = std_regs[c].regnum;
- return REGNAME;
- }
- }
- /* Catch specific keywords. Should be done with a data structure. */
- switch (namelen)
- {
- case 8:
- if (!strncmp (tokstart, "unsigned", 8))
- return UNSIGNED;
- break;
- case 6:
- if (!strncmp (tokstart, "struct", 6))
- return STRUCT;
- if (!strncmp (tokstart, "signed", 6))
- return SIGNED;
- if (!strncmp (tokstart, "sizeof", 6))
- return SIZEOF;
- break;
- case 5:
- if (!strncmp (tokstart, "union", 5))
- return UNION;
- if (!strncmp (tokstart, "short", 5))
- return SHORT;
- break;
- case 4:
- if (!strncmp (tokstart, "enum", 4))
- return ENUM;
- if (!strncmp (tokstart, "long", 4))
- return LONG;
- if (!strncmp (tokstart, "this", 4))
- {
- static const char this_name[] =
- { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
-
- if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, 0, NULL))
- return THIS;
- }
- break;
- case 3:
- if (!strncmp (tokstart, "int", 3))
- return INT_KEYWORD;
- break;
- default:
- break;
- }
-
- yylval.sval.ptr = tokstart;
- yylval.sval.length = namelen;
-
- /* Any other names starting in $ are debugger internal variables. */
-
- if (*tokstart == '$')
- {
- yylval.ivar = lookup_internalvar (copy_name (yylval.sval) + 1);
- return VARIABLE;
- }
-
- /* Use token-type BLOCKNAME for symbols that happen to be defined as
- functions or symtabs. If this is not so, then ...
- Use token-type TYPENAME for symbols that happen to be defined
- currently as names of types; NAME for other symbols.
- The caller is not constrained to care about the distinction. */
- {
- char *tmp = copy_name (yylval.sval);
- struct symbol *sym;
- int is_a_field_of_this = 0;
- int hextype;
-
- sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE, &is_a_field_of_this, NULL);
- if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) ||
- lookup_partial_symtab (tmp))
- {
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return BLOCKNAME;
- }
- if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
- {
- yylval.tsym.type = SYMBOL_TYPE (sym);
- return TYPENAME;
- }
- if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
- return TYPENAME;
-
- /* Input names that aren't symbols but ARE valid hex numbers,
- when the input radix permits them, can be names or numbers
- depending on the parse. Note we support radixes > 16 here. */
- if (!sym &&
- ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
- (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
- {
- YYSTYPE newlval; /* Its value is ignored. */
- hextype = parse_number (tokstart, namelen, 0, &newlval);
- if (hextype == INT)
- {
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return NAME_OR_INT;
- }
- if (hextype == UINT)
- {
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return NAME_OR_UINT;
- }
- }
-
- /* Any other kind of symbol */
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return NAME;
- }
-}
-
-static void
-yyerror (msg)
- char *msg;
-{
- error ("Invalid syntax in expression.");
-}
-
-/* Return a null-terminated temporary copy of the name
- of a string token. */
-
-static char *
-copy_name (token)
- struct stoken token;
-{
- bcopy (token.ptr, namecopy, token.length);
- namecopy[token.length] = 0;
- return namecopy;
-}
-
-/* Reverse an expression from suffix form (in which it is constructed)
- to prefix form (in which we can conveniently print or execute it). */
-
-static void prefixify_subexp ();
-
-static void
-prefixify_expression (expr)
- register struct expression *expr;
-{
- register int len = sizeof (struct expression) +
- expr->nelts * sizeof (union exp_element);
- register struct expression *temp;
- register int inpos = expr->nelts, outpos = 0;
-
- temp = (struct expression *) alloca (len);
-
- /* Copy the original expression into temp. */
- bcopy (expr, temp, len);
-
- prefixify_subexp (temp, expr, inpos, outpos);
-}
-
-/* Return the number of exp_elements in the subexpression of EXPR
- whose last exp_element is at index ENDPOS - 1 in EXPR. */
-
-static int
-length_of_subexp (expr, endpos)
- register struct expression *expr;
- register int endpos;
-{
- register int oplen = 1;
- register int args = 0;
- register int i;
-
- if (endpos < 0)
- error ("?error in length_of_subexp");
-
- i = (int) expr->elts[endpos - 1].opcode;
-
- switch (i)
- {
- /* C++ */
- case OP_SCOPE:
- oplen = 4 + ((expr->elts[endpos - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
- break;
-
- case OP_LONG:
- case OP_DOUBLE:
- oplen = 4;
- break;
-
- case OP_VAR_VALUE:
- case OP_LAST:
- case OP_REGISTER:
- case OP_INTERNALVAR:
- oplen = 3;
- break;
-
- case OP_FUNCALL:
- oplen = 3;
- args = 1 + expr->elts[endpos - 2].longconst;
- break;
-
- case UNOP_CAST:
- case UNOP_MEMVAL:
- oplen = 3;
- args = 1;
- break;
-
- case STRUCTOP_STRUCT:
- case STRUCTOP_PTR:
- args = 1;
- case OP_STRING:
- oplen = 3 + ((expr->elts[endpos - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
- break;
-
- case TERNOP_COND:
- args = 3;
- break;
-
- case BINOP_ASSIGN_MODIFY:
- oplen = 3;
- args = 2;
- break;
-
- /* C++ */
- case OP_THIS:
- oplen = 2;
- break;
-
- default:
- args = 1 + (i < (int) BINOP_END);
- }
-
- while (args > 0)
- {
- oplen += length_of_subexp (expr, endpos - oplen);
- args--;
- }
-
- return oplen;
-}
-
-/* Copy the subexpression ending just before index INEND in INEXPR
- into OUTEXPR, starting at index OUTBEG.
- In the process, convert it from suffix to prefix form. */
-
-static void
-prefixify_subexp (inexpr, outexpr, inend, outbeg)
- register struct expression *inexpr;
- struct expression *outexpr;
- register int inend;
- int outbeg;
-{
- register int oplen = 1;
- register int args = 0;
- register int i;
- int *arglens;
- enum exp_opcode opcode;
-
- /* Compute how long the last operation is (in OPLEN),
- and also how many preceding subexpressions serve as
- arguments for it (in ARGS). */
-
- opcode = inexpr->elts[inend - 1].opcode;
- switch (opcode)
- {
- /* C++ */
- case OP_SCOPE:
- oplen = 4 + ((inexpr->elts[inend - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
- break;
-
- case OP_LONG:
- case OP_DOUBLE:
- oplen = 4;
- break;
-
- case OP_VAR_VALUE:
- case OP_LAST:
- case OP_REGISTER:
- case OP_INTERNALVAR:
- oplen = 3;
- break;
-
- case OP_FUNCALL:
- oplen = 3;
- args = 1 + inexpr->elts[inend - 2].longconst;
- break;
-
- case UNOP_CAST:
- case UNOP_MEMVAL:
- oplen = 3;
- args = 1;
- break;
-
- case STRUCTOP_STRUCT:
- case STRUCTOP_PTR:
- args = 1;
- case OP_STRING:
- oplen = 3 + ((inexpr->elts[inend - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
-
- break;
-
- case TERNOP_COND:
- args = 3;
- break;
-
- case BINOP_ASSIGN_MODIFY:
- oplen = 3;
- args = 2;
- break;
-
- /* C++ */
- case OP_THIS:
- oplen = 2;
- break;
-
- default:
- args = 1 + ((int) opcode < (int) BINOP_END);
- }
-
- /* Copy the final operator itself, from the end of the input
- to the beginning of the output. */
- inend -= oplen;
- bcopy (&inexpr->elts[inend], &outexpr->elts[outbeg],
- oplen * sizeof (union exp_element));
- outbeg += oplen;
-
- /* Find the lengths of the arg subexpressions. */
- arglens = (int *) alloca (args * sizeof (int));
- for (i = args - 1; i >= 0; i--)
- {
- oplen = length_of_subexp (inexpr, inend);
- arglens[i] = oplen;
- inend -= oplen;
- }
-
- /* Now copy each subexpression, preserving the order of
- the subexpressions, but prefixifying each one.
- In this loop, inend starts at the beginning of
- the expression this level is working on
- and marches forward over the arguments.
- outbeg does similarly in the output. */
- for (i = 0; i < args; i++)
- {
- oplen = arglens[i];
- inend += oplen;
- prefixify_subexp (inexpr, outexpr, inend, outbeg);
- outbeg += oplen;
- }
-}
-
-/* This page contains the two entry points to this file. */
-
-/* Read a C expression from the string *STRINGPTR points to,
- parse it, and return a pointer to a struct expression that we malloc.
- Use block BLOCK as the lexical context for variable names;
- if BLOCK is zero, use the block of the selected stack frame.
- Meanwhile, advance *STRINGPTR to point after the expression,
- at the first nonwhite character that is not part of the expression
- (possibly a null character).
-
- If COMMA is nonzero, stop if a comma is reached. */
-
-struct expression *
-parse_c_1 (stringptr, block, comma)
- char **stringptr;
- struct block *block;
- int comma;
-{
- struct cleanup *old_chain;
-
- lexptr = *stringptr;
-
- paren_depth = 0;
- type_stack_depth = 0;
-
- comma_terminates = comma;
-
- if (lexptr == 0 || *lexptr == 0)
- error_no_arg ("expression to compute");
-
- old_chain = make_cleanup (free_funcalls, 0);
- funcall_chain = 0;
-
- expression_context_block = block ? block : get_selected_block ();
-
- namecopy = (char *) alloca (strlen (lexptr) + 1);
- expout_size = 10;
- expout_ptr = 0;
- expout = (struct expression *)
- xmalloc (sizeof (struct expression)
- + expout_size * sizeof (union exp_element));
- make_cleanup (free_current_contents, &expout);
- if (yyparse ())
- yyerror (NULL);
- discard_cleanups (old_chain);
- expout->nelts = expout_ptr;
- expout = (struct expression *)
- xrealloc (expout,
- sizeof (struct expression)
- + expout_ptr * sizeof (union exp_element));
- prefixify_expression (expout);
- *stringptr = lexptr;
- return expout;
-}
-
-/* Parse STRING as an expression, and complain if this fails
- to use up all of the contents of STRING. */
-
-struct expression *
-parse_c_expression (string)
- char *string;
-{
- register struct expression *exp;
- exp = parse_c_1 (&string, 0, 0);
- if (*string)
- error ("Junk after end of expression.");
- return exp;
-}
-
-static void
-push_type (tp)
- enum type_pieces tp;
-{
- if (type_stack_depth == type_stack_size)
- {
- type_stack_size *= 2;
- type_stack = (union type_stack_elt *)
- xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
- }
- type_stack[type_stack_depth++].piece = tp;
-}
-
-static void
-push_type_int (n)
- int n;
-{
- if (type_stack_depth == type_stack_size)
- {
- type_stack_size *= 2;
- type_stack = (union type_stack_elt *)
- xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
- }
- type_stack[type_stack_depth++].int_val = n;
-}
-
-static enum type_pieces
-pop_type ()
-{
- if (type_stack_depth)
- return type_stack[--type_stack_depth].piece;
- return tp_end;
-}
-
-static int
-pop_type_int ()
-{
- if (type_stack_depth)
- return type_stack[--type_stack_depth].int_val;
- /* "Can't happen". */
- return 0;
-}
-
-void
-_initialize_expread ()
-{
- type_stack_size = 80;
- type_stack_depth = 0;
- type_stack = (union type_stack_elt *)
- xmalloc (type_stack_size * sizeof (*type_stack));
-}
diff --git a/gdb/expread.y b/gdb/expread.y
deleted file mode 100755
index cc62554..0000000
--- a/gdb/expread.y
+++ /dev/null
@@ -1,1989 +0,0 @@
-/* Parse C expressions for GDB.
- Copyright (C) 1986, 1989, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Parse a C expression from text in a string,
- and return the result as a struct expression pointer.
- That structure contains arithmetic operations in reverse polish,
- with constants represented by operations that are followed by special data.
- See expression.h for the details of the format.
- What is important here is that it can be built up sequentially
- during the process of parsing; the lower levels of the tree always
- come first in the result. */
-
-%{
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "expression.h"
-#include "value.h"
-#include "command.h"
-
-static struct expression *expout;
-static int expout_size;
-static int expout_ptr;
-
-static int yylex ();
-static void yyerror ();
-static void write_exp_elt ();
-static void write_exp_elt_opcode ();
-static void write_exp_elt_sym ();
-static void write_exp_elt_longcst ();
-static void write_exp_elt_dblcst ();
-static void write_exp_elt_type ();
-static void write_exp_elt_intern ();
-static void write_exp_string ();
-static void start_arglist ();
-static int end_arglist ();
-static void free_funcalls ();
-static char *copy_name ();
-static int parse_number ();
-
-/* If this is nonzero, this block is used as the lexical context
- for symbol names. */
-
-static struct block *expression_context_block;
-
-/* The innermost context required by the stack and register variables
- we've encountered so far. */
-struct block *innermost_block;
-
-/* The block in which the most recently discovered symbol was found. */
-struct block *block_found;
-
-/* Number of arguments seen so far in innermost function call. */
-static int arglist_len;
-
-/* Data structure for saving values of arglist_len
- for function calls whose arguments contain other function calls. */
-
-struct funcall
- {
- struct funcall *next;
- int arglist_len;
- };
-
-struct funcall *funcall_chain;
-
-/* This kind of datum is used to represent the name
- of a symbol token. */
-
-struct stoken
- {
- char *ptr;
- int length;
- };
-
-struct ttype
- {
- struct stoken stoken;
- struct type *type;
- };
-
-struct symtoken
- {
- struct stoken stoken;
- struct symbol *sym;
- int is_a_field_of_this;
- };
-
-/* For parsing of complicated types.
- An array should be preceded in the list by the size of the array. */
-enum type_pieces
- {tp_end = -1, tp_pointer, tp_reference, tp_array, tp_function};
-/* The stack can contain either an enum type_pieces or an int. */
-union type_stack_elt {
- enum type_pieces piece;
- int int_val;
-};
-static union type_stack_elt *type_stack;
-static int type_stack_depth, type_stack_size;
-
-static void push_type ();
-static void push_type_int ();
-static enum type_pieces pop_type ();
-static int pop_type_int ();
-
-/* Allow debugging of parsing. */
-#define YYDEBUG 1
-%}
-
-/* Although the yacc "value" of an expression is not used,
- since the result is stored in the structure being created,
- other node types do have values. */
-
-%union
- {
- LONGEST lval;
- unsigned LONGEST ulval;
- double dval;
- struct symbol *sym;
- struct type *tval;
- struct stoken sval;
- struct ttype tsym;
- struct symtoken ssym;
- int voidval;
- struct block *bval;
- enum exp_opcode opcode;
- struct internalvar *ivar;
-
- struct type **tvec;
- int *ivec;
- }
-
-%type <voidval> exp exp1 start variable
-%type <tval> type typebase
-%type <tvec> nonempty_typelist
-%type <bval> block
-
-/* Fancy type parsing. */
-%type <voidval> func_mod direct_abs_decl abs_decl
-%type <tval> ptype
-%type <lval> array_mod
-
-%token <lval> INT CHAR
-%token <ulval> UINT
-%token <dval> FLOAT
-
-/* Both NAME and TYPENAME tokens represent symbols in the input,
- and both convey their data as strings.
- But a TYPENAME is a string that happens to be defined as a typedef
- or builtin type name (such as int or char)
- and a NAME is any other symbol.
-
- Contexts where this distinction is not important can use the
- nonterminal "name", which matches either NAME or TYPENAME. */
-
-%token <sval> STRING
-%token <ssym> NAME BLOCKNAME
-%token <tsym> TYPENAME
-%type <sval> name
-%type <ssym> name_not_typename
-%type <tsym> typename
-
-/* A NAME_OR_INT is a symbol which is not known in the symbol table,
- but which would parse as a valid number in the current input radix.
- E.g. "c" when input_radix==16. Depending on the parse, it will be
- turned into a name or into a number. NAME_OR_UINT ditto. */
-
-%token <ssym> NAME_OR_INT NAME_OR_UINT
-
-%token STRUCT UNION ENUM SIZEOF UNSIGNED COLONCOLON
-%token ERROR
-
-/* Special type cases, put in to allow the parser to distinguish different
- legal basetypes. */
-%token SIGNED LONG SHORT INT_KEYWORD
-
-%token <lval> LAST REGNAME
-
-%token <ivar> VARIABLE
-
-%token <opcode> ASSIGN_MODIFY
-
-/* C++ */
-%token THIS
-
-%left ','
-%left ABOVE_COMMA
-%right '=' ASSIGN_MODIFY
-%right '?'
-%left OR
-%left AND
-%left '|'
-%left '^'
-%left '&'
-%left EQUAL NOTEQUAL
-%left '<' '>' LEQ GEQ
-%left LSH RSH
-%left '@'
-%left '+' '-'
-%left '*' '/' '%'
-%right UNARY INCREMENT DECREMENT
-%right ARROW '.' '[' '('
-%left COLONCOLON
-
-%%
-
-start : exp1
- ;
-
-/* Expressions, including the comma operator. */
-exp1 : exp
- | exp1 ',' exp
- { write_exp_elt_opcode (BINOP_COMMA); }
- ;
-
-/* Expressions, not including the comma operator. */
-exp : '*' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_IND); }
-
-exp : '&' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_ADDR); }
-
-exp : '-' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_NEG); }
- ;
-
-exp : '!' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_ZEROP); }
- ;
-
-exp : '~' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_LOGNOT); }
- ;
-
-exp : INCREMENT exp %prec UNARY
- { write_exp_elt_opcode (UNOP_PREINCREMENT); }
- ;
-
-exp : DECREMENT exp %prec UNARY
- { write_exp_elt_opcode (UNOP_PREDECREMENT); }
- ;
-
-exp : exp INCREMENT %prec UNARY
- { write_exp_elt_opcode (UNOP_POSTINCREMENT); }
- ;
-
-exp : exp DECREMENT %prec UNARY
- { write_exp_elt_opcode (UNOP_POSTDECREMENT); }
- ;
-
-exp : SIZEOF exp %prec UNARY
- { write_exp_elt_opcode (UNOP_SIZEOF); }
- ;
-
-exp : exp ARROW name
- { write_exp_elt_opcode (STRUCTOP_PTR);
- write_exp_string ($3);
- write_exp_elt_opcode (STRUCTOP_PTR); }
- ;
-
-exp : exp ARROW '*' exp
- { write_exp_elt_opcode (STRUCTOP_MPTR); }
- ;
-
-exp : exp '.' name
- { write_exp_elt_opcode (STRUCTOP_STRUCT);
- write_exp_string ($3);
- write_exp_elt_opcode (STRUCTOP_STRUCT); }
- ;
-
-exp : exp '.' '*' exp
- { write_exp_elt_opcode (STRUCTOP_MEMBER); }
- ;
-
-exp : exp '[' exp1 ']'
- { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
- ;
-
-exp : exp '('
- /* This is to save the value of arglist_len
- being accumulated by an outer function call. */
- { start_arglist (); }
- arglist ')' %prec ARROW
- { write_exp_elt_opcode (OP_FUNCALL);
- write_exp_elt_longcst ((LONGEST) end_arglist ());
- write_exp_elt_opcode (OP_FUNCALL); }
- ;
-
-arglist :
- ;
-
-arglist : exp
- { arglist_len = 1; }
- ;
-
-arglist : arglist ',' exp %prec ABOVE_COMMA
- { arglist_len++; }
- ;
-
-exp : '{' type '}' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_MEMVAL);
- write_exp_elt_type ($2);
- write_exp_elt_opcode (UNOP_MEMVAL); }
- ;
-
-exp : '(' type ')' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type ($2);
- write_exp_elt_opcode (UNOP_CAST); }
- ;
-
-exp : '(' exp1 ')'
- { }
- ;
-
-/* Binary operators in order of decreasing precedence. */
-
-exp : exp '@' exp
- { write_exp_elt_opcode (BINOP_REPEAT); }
- ;
-
-exp : exp '*' exp
- { write_exp_elt_opcode (BINOP_MUL); }
- ;
-
-exp : exp '/' exp
- { write_exp_elt_opcode (BINOP_DIV); }
- ;
-
-exp : exp '%' exp
- { write_exp_elt_opcode (BINOP_REM); }
- ;
-
-exp : exp '+' exp
- { write_exp_elt_opcode (BINOP_ADD); }
- ;
-
-exp : exp '-' exp
- { write_exp_elt_opcode (BINOP_SUB); }
- ;
-
-exp : exp LSH exp
- { write_exp_elt_opcode (BINOP_LSH); }
- ;
-
-exp : exp RSH exp
- { write_exp_elt_opcode (BINOP_RSH); }
- ;
-
-exp : exp EQUAL exp
- { write_exp_elt_opcode (BINOP_EQUAL); }
- ;
-
-exp : exp NOTEQUAL exp
- { write_exp_elt_opcode (BINOP_NOTEQUAL); }
- ;
-
-exp : exp LEQ exp
- { write_exp_elt_opcode (BINOP_LEQ); }
- ;
-
-exp : exp GEQ exp
- { write_exp_elt_opcode (BINOP_GEQ); }
- ;
-
-exp : exp '<' exp
- { write_exp_elt_opcode (BINOP_LESS); }
- ;
-
-exp : exp '>' exp
- { write_exp_elt_opcode (BINOP_GTR); }
- ;
-
-exp : exp '&' exp
- { write_exp_elt_opcode (BINOP_LOGAND); }
- ;
-
-exp : exp '^' exp
- { write_exp_elt_opcode (BINOP_LOGXOR); }
- ;
-
-exp : exp '|' exp
- { write_exp_elt_opcode (BINOP_LOGIOR); }
- ;
-
-exp : exp AND exp
- { write_exp_elt_opcode (BINOP_AND); }
- ;
-
-exp : exp OR exp
- { write_exp_elt_opcode (BINOP_OR); }
- ;
-
-exp : exp '?' exp ':' exp %prec '?'
- { write_exp_elt_opcode (TERNOP_COND); }
- ;
-
-exp : exp '=' exp
- { write_exp_elt_opcode (BINOP_ASSIGN); }
- ;
-
-exp : exp ASSIGN_MODIFY exp
- { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
- write_exp_elt_opcode ($2);
- write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); }
- ;
-
-exp : INT
- { write_exp_elt_opcode (OP_LONG);
- if ($1 == (int) $1 || $1 == (unsigned int) $1)
- write_exp_elt_type (builtin_type_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_LONGEST);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : NAME_OR_INT
- { YYSTYPE val;
- parse_number ($1.stoken.ptr, $1.stoken.length, 0, &val);
- write_exp_elt_opcode (OP_LONG);
- if (val.lval == (int) val.lval ||
- val.lval == (unsigned int) val.lval)
- write_exp_elt_type (builtin_type_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_LONGEST);
- write_exp_elt_longcst (val.lval);
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : UINT
- {
- write_exp_elt_opcode (OP_LONG);
- if ($1 == (unsigned int) $1)
- write_exp_elt_type (builtin_type_unsigned_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_UNSIGNED_LONGEST);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LONG);
- }
- ;
-
-exp : NAME_OR_UINT
- { YYSTYPE val;
- parse_number ($1.stoken.ptr, $1.stoken.length, 0, &val);
- write_exp_elt_opcode (OP_LONG);
- if (val.ulval == (unsigned int) val.ulval)
- write_exp_elt_type (builtin_type_unsigned_int);
- else
- write_exp_elt_type (BUILTIN_TYPE_UNSIGNED_LONGEST);
- write_exp_elt_longcst ((LONGEST)val.ulval);
- write_exp_elt_opcode (OP_LONG);
- }
- ;
-
-exp : CHAR
- { write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : FLOAT
- { write_exp_elt_opcode (OP_DOUBLE);
- write_exp_elt_type (builtin_type_double);
- write_exp_elt_dblcst ($1);
- write_exp_elt_opcode (OP_DOUBLE); }
- ;
-
-exp : variable
- ;
-
-exp : LAST
- { write_exp_elt_opcode (OP_LAST);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LAST); }
- ;
-
-exp : REGNAME
- { write_exp_elt_opcode (OP_REGISTER);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_REGISTER); }
- ;
-
-exp : VARIABLE
- { write_exp_elt_opcode (OP_INTERNALVAR);
- write_exp_elt_intern ($1);
- write_exp_elt_opcode (OP_INTERNALVAR); }
- ;
-
-exp : SIZEOF '(' type ')' %prec UNARY
- { write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : STRING
- { write_exp_elt_opcode (OP_STRING);
- write_exp_string ($1);
- write_exp_elt_opcode (OP_STRING); }
- ;
-
-/* C++. */
-exp : THIS
- { write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS); }
- ;
-
-/* end of C++. */
-
-block : BLOCKNAME
- {
- if ($1.sym != 0)
- $$ = SYMBOL_BLOCK_VALUE ($1.sym);
- else
- {
- struct symtab *tem =
- lookup_symtab (copy_name ($1.stoken));
- if (tem)
- $$ = BLOCKVECTOR_BLOCK
- (BLOCKVECTOR (tem), STATIC_BLOCK);
- else
- error ("No file or function \"%s\".",
- copy_name ($1.stoken));
- }
- }
- ;
-
-block : block COLONCOLON name
- { struct symbol *tem
- = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, 0, NULL);
- if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
- error ("No function \"%s\" in specified context.",
- copy_name ($3));
- $$ = SYMBOL_BLOCK_VALUE (tem); }
- ;
-
-variable: block COLONCOLON name
- { struct symbol *sym;
- sym = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, 0, NULL);
- if (sym == 0)
- error ("No symbol \"%s\" in specified context.",
- copy_name ($3));
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE); }
- ;
-
-variable: typebase COLONCOLON name
- {
- struct type *type = $1;
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_UNION)
- error ("`%s' is not defined as an aggregate type.",
- TYPE_NAME (type));
-
- write_exp_elt_opcode (OP_SCOPE);
- write_exp_elt_type (type);
- write_exp_string ($3);
- write_exp_elt_opcode (OP_SCOPE);
- }
- | typebase COLONCOLON '~' name
- {
- struct type *type = $1;
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_UNION)
- error ("`%s' is not defined as an aggregate type.",
- TYPE_NAME (type));
-
- if (strcmp (type_name_no_tag (type), $4.ptr))
- error ("invalid destructor `%s::~%s'",
- type_name_no_tag (type), $4.ptr);
-
- write_exp_elt_opcode (OP_SCOPE);
- write_exp_elt_type (type);
- write_exp_string ($4);
- write_exp_elt_opcode (OP_SCOPE);
- write_exp_elt_opcode (UNOP_LOGNOT);
- }
- | COLONCOLON name
- {
- char *name = copy_name ($2);
- struct symbol *sym;
- int i;
-
- sym =
- lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL);
- if (sym)
- {
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- break;
- }
- for (i = 0; i < misc_function_count; i++)
- if (!strcmp (misc_function_vector[i].name, name))
- break;
-
- if (i < misc_function_count)
- {
- enum misc_function_type mft =
- misc_function_vector[i].type;
-
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) misc_function_vector[i].address);
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_opcode (UNOP_MEMVAL);
- if (mft == mf_data || mft == mf_bss)
- write_exp_elt_type (builtin_type_int);
- else if (mft == mf_text)
- write_exp_elt_type (lookup_function_type (builtin_type_int));
- else
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_opcode (UNOP_MEMVAL);
- }
- else
- if (symtab_list == 0
- && partial_symtab_list == 0)
- error ("No symbol table is loaded. Use the \"file\" command.");
- else
- error ("No symbol \"%s\" in current context.", name);
- }
- ;
-
-variable: name_not_typename
- { struct symbol *sym = $1.sym;
-
- if (sym)
- {
- switch (sym->class)
- {
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_LOCAL:
- case LOC_LOCAL_ARG:
- if (innermost_block == 0 ||
- contained_in (block_found,
- innermost_block))
- innermost_block = block_found;
- case LOC_UNDEF:
- case LOC_CONST:
- case LOC_STATIC:
- case LOC_TYPEDEF:
- case LOC_LABEL:
- case LOC_BLOCK:
- case LOC_CONST_BYTES:
-
- /* In this case the expression can
- be evaluated regardless of what
- frame we are in, so there is no
- need to check for the
- innermost_block. These cases are
- listed so that gcc -Wall will
- report types that may not have
- been considered. */
-
- break;
- }
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- }
- else if ($1.is_a_field_of_this)
- {
- /* C++: it hangs off of `this'. Must
- not inadvertently convert from a method call
- to data ref. */
- if (innermost_block == 0 ||
- contained_in (block_found, innermost_block))
- innermost_block = block_found;
- write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (OP_THIS);
- write_exp_elt_opcode (STRUCTOP_PTR);
- write_exp_string ($1.stoken);
- write_exp_elt_opcode (STRUCTOP_PTR);
- }
- else
- {
- register int i;
- register char *arg = copy_name ($1.stoken);
-
- /* FIXME, this search is linear! At least
- optimize the strcmp with a 1-char cmp... */
- for (i = 0; i < misc_function_count; i++)
- if (!strcmp (misc_function_vector[i].name, arg))
- break;
-
- if (i < misc_function_count)
- {
- enum misc_function_type mft =
- misc_function_vector[i].type;
-
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) misc_function_vector[i].address);
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_opcode (UNOP_MEMVAL);
- if (mft == mf_data || mft == mf_bss)
- write_exp_elt_type (builtin_type_int);
- else if (mft == mf_text)
- write_exp_elt_type (lookup_function_type (builtin_type_int));
- else
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_opcode (UNOP_MEMVAL);
- }
- else if (symtab_list == 0
- && partial_symtab_list == 0)
- error ("No symbol table is loaded. Use the \"file\" command.");
- else
- error ("No symbol \"%s\" in current context.",
- copy_name ($1.stoken));
- }
- }
- ;
-
-
-ptype : typebase
- | typebase abs_decl
- {
- /* This is where the interesting stuff happens. */
- int done = 0;
- int array_size;
- struct type *follow_type = $1;
-
- while (!done)
- switch (pop_type ())
- {
- case tp_end:
- done = 1;
- break;
- case tp_pointer:
- follow_type = lookup_pointer_type (follow_type);
- break;
- case tp_reference:
- follow_type = lookup_reference_type (follow_type);
- break;
- case tp_array:
- array_size = pop_type_int ();
- if (array_size != -1)
- follow_type = create_array_type (follow_type,
- array_size);
- else
- follow_type = lookup_pointer_type (follow_type);
- break;
- case tp_function:
- follow_type = lookup_function_type (follow_type);
- break;
- }
- $$ = follow_type;
- }
- ;
-
-abs_decl: '*'
- { push_type (tp_pointer); $$ = 0; }
- | '*' abs_decl
- { push_type (tp_pointer); $$ = $2; }
- | '&'
- { push_type (tp_reference); $$ = 0; }
- | '&' abs_decl
- { push_type (tp_reference); $$ = $2; }
- | direct_abs_decl
- ;
-
-direct_abs_decl: '(' abs_decl ')'
- { $$ = $2; }
- | direct_abs_decl array_mod
- {
- push_type_int ($2);
- push_type (tp_array);
- }
- | array_mod
- {
- push_type_int ($1);
- push_type (tp_array);
- $$ = 0;
- }
- | direct_abs_decl func_mod
- { push_type (tp_function); }
- | func_mod
- { push_type (tp_function); }
- ;
-
-array_mod: '[' ']'
- { $$ = -1; }
- | '[' INT ']'
- { $$ = $2; }
- ;
-
-func_mod: '(' ')'
- { $$ = 0; }
- ;
-
-type : ptype
- | typebase COLONCOLON '*'
- { $$ = lookup_member_type (builtin_type_int, $1); }
- | type '(' typebase COLONCOLON '*' ')'
- { $$ = lookup_member_type ($1, $3); }
- | type '(' typebase COLONCOLON '*' ')' '(' ')'
- { $$ = lookup_member_type
- (lookup_function_type ($1), $3); }
- | type '(' typebase COLONCOLON '*' ')' '(' nonempty_typelist ')'
- { $$ = lookup_member_type
- (lookup_function_type ($1), $3);
- free ($8); }
- ;
-
-typebase
- : TYPENAME
- { $$ = $1.type; }
- | INT_KEYWORD
- { $$ = builtin_type_int; }
- | LONG
- { $$ = builtin_type_long; }
- | SHORT
- { $$ = builtin_type_short; }
- | LONG INT_KEYWORD
- { $$ = builtin_type_long; }
- | UNSIGNED LONG INT_KEYWORD
- { $$ = builtin_type_unsigned_long; }
- | LONG LONG
- { $$ = builtin_type_long_long; }
- | LONG LONG INT_KEYWORD
- { $$ = builtin_type_long_long; }
- | UNSIGNED LONG LONG
- { $$ = builtin_type_unsigned_long_long; }
- | UNSIGNED LONG LONG INT_KEYWORD
- { $$ = builtin_type_unsigned_long_long; }
- | SHORT INT_KEYWORD
- { $$ = builtin_type_short; }
- | UNSIGNED SHORT INT_KEYWORD
- { $$ = builtin_type_unsigned_short; }
- | STRUCT name
- { $$ = lookup_struct (copy_name ($2),
- expression_context_block); }
- | UNION name
- { $$ = lookup_union (copy_name ($2),
- expression_context_block); }
- | ENUM name
- { $$ = lookup_enum (copy_name ($2),
- expression_context_block); }
- | UNSIGNED typename
- { $$ = lookup_unsigned_typename (TYPE_NAME($2.type)); }
- | UNSIGNED
- { $$ = builtin_type_unsigned_int; }
- | SIGNED typename
- { $$ = $2.type; }
- | SIGNED
- { $$ = builtin_type_int; }
- ;
-
-typename: TYPENAME
- | INT_KEYWORD
- {
- $$.stoken.ptr = "int";
- $$.stoken.length = 3;
- $$.type = builtin_type_int;
- }
- | LONG
- {
- $$.stoken.ptr = "long";
- $$.stoken.length = 4;
- $$.type = builtin_type_long;
- }
- | SHORT
- {
- $$.stoken.ptr = "short";
- $$.stoken.length = 5;
- $$.type = builtin_type_short;
- }
- ;
-
-nonempty_typelist
- : type
- { $$ = (struct type **)xmalloc (sizeof (struct type *) * 2);
- $$[0] = (struct type *)0;
- $$[1] = $1;
- }
- | nonempty_typelist ',' type
- { int len = sizeof (struct type *) * ++($<ivec>1[0]);
- $$ = (struct type **)xrealloc ($1, len);
- $$[$<ivec>$[0]] = $3;
- }
- ;
-
-name : NAME { $$ = $1.stoken; }
- | BLOCKNAME { $$ = $1.stoken; }
- | TYPENAME { $$ = $1.stoken; }
- | NAME_OR_INT { $$ = $1.stoken; }
- | NAME_OR_UINT { $$ = $1.stoken; }
- ;
-
-name_not_typename : NAME
- | BLOCKNAME
-/* These would be useful if name_not_typename was useful, but it is just
- a fake for "variable", so these cause reduce/reduce conflicts because
- the parser can't tell whether NAME_OR_INT is a name_not_typename (=variable,
- =exp) or just an exp. If name_not_typename was ever used in an lvalue
- context where only a name could occur, this might be useful.
- | NAME_OR_INT
- | NAME_OR_UINT
- */
- ;
-
-%%
-
-/* Begin counting arguments for a function call,
- saving the data about any containing call. */
-
-static void
-start_arglist ()
-{
- register struct funcall *new = (struct funcall *) xmalloc (sizeof (struct funcall));
-
- new->next = funcall_chain;
- new->arglist_len = arglist_len;
- arglist_len = 0;
- funcall_chain = new;
-}
-
-/* Return the number of arguments in a function call just terminated,
- and restore the data for the containing function call. */
-
-static int
-end_arglist ()
-{
- register int val = arglist_len;
- register struct funcall *call = funcall_chain;
- funcall_chain = call->next;
- arglist_len = call->arglist_len;
- free (call);
- return val;
-}
-
-/* Free everything in the funcall chain.
- Used when there is an error inside parsing. */
-
-static void
-free_funcalls ()
-{
- register struct funcall *call, *next;
-
- for (call = funcall_chain; call; call = next)
- {
- next = call->next;
- free (call);
- }
-}
-
-/* This page contains the functions for adding data to the struct expression
- being constructed. */
-
-/* Add one element to the end of the expression. */
-
-/* To avoid a bug in the Sun 4 compiler, we pass things that can fit into
- a register through here */
-
-static void
-write_exp_elt (expelt)
- union exp_element expelt;
-{
- if (expout_ptr >= expout_size)
- {
- expout_size *= 2;
- expout = (struct expression *) xrealloc (expout,
- sizeof (struct expression)
- + expout_size * sizeof (union exp_element));
- }
- expout->elts[expout_ptr++] = expelt;
-}
-
-static void
-write_exp_elt_opcode (expelt)
- enum exp_opcode expelt;
-{
- union exp_element tmp;
-
- tmp.opcode = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_sym (expelt)
- struct symbol *expelt;
-{
- union exp_element tmp;
-
- tmp.symbol = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_longcst (expelt)
- LONGEST expelt;
-{
- union exp_element tmp;
-
- tmp.longconst = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_dblcst (expelt)
- double expelt;
-{
- union exp_element tmp;
-
- tmp.doubleconst = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_type (expelt)
- struct type *expelt;
-{
- union exp_element tmp;
-
- tmp.type = expelt;
-
- write_exp_elt (tmp);
-}
-
-static void
-write_exp_elt_intern (expelt)
- struct internalvar *expelt;
-{
- union exp_element tmp;
-
- tmp.internalvar = expelt;
-
- write_exp_elt (tmp);
-}
-
-/* Add a string constant to the end of the expression.
- Follow it by its length in bytes, as a separate exp_element. */
-
-static void
-write_exp_string (str)
- struct stoken str;
-{
- register int len = str.length;
- register int lenelt
- = (len + sizeof (union exp_element)) / sizeof (union exp_element);
-
- expout_ptr += lenelt;
-
- if (expout_ptr >= expout_size)
- {
- expout_size = max (expout_size * 2, expout_ptr + 10);
- expout = (struct expression *)
- xrealloc (expout, (sizeof (struct expression)
- + (expout_size * sizeof (union exp_element))));
- }
- bcopy (str.ptr, (char *) &expout->elts[expout_ptr - lenelt], len);
- ((char *) &expout->elts[expout_ptr - lenelt])[len] = 0;
- write_exp_elt_longcst ((LONGEST) len);
-}
-
-/* During parsing of a C expression, the pointer to the next character
- is in this variable. */
-
-static char *lexptr;
-
-/* Tokens that refer to names do so with explicit pointer and length,
- so they can share the storage that lexptr is parsing.
-
- When it is necessary to pass a name to a function that expects
- a null-terminated string, the substring is copied out
- into a block of storage that namecopy points to.
-
- namecopy is allocated once, guaranteed big enough, for each parsing. */
-
-static char *namecopy;
-
-/* Current depth in parentheses within the expression. */
-
-static int paren_depth;
-
-/* Nonzero means stop parsing on first comma (if not within parentheses). */
-
-static int comma_terminates;
-
-/* Take care of parsing a number (anything that starts with a digit).
- Set yylval and return the token type; update lexptr.
- LEN is the number of characters in it. */
-
-/*** Needs some error checking for the float case ***/
-
-static int
-parse_number (p, len, parsed_float, putithere)
- register char *p;
- register int len;
- int parsed_float;
- YYSTYPE *putithere;
-{
- register LONGEST n = 0;
- register int i;
- register int c;
- register int base = input_radix;
- int unsigned_p = 0;
-
- extern double atof ();
-
- if (parsed_float)
- {
- /* It's a float since it contains a point or an exponent. */
- putithere->dval = atof (p);
- return FLOAT;
- }
-
- /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
- if (p[0] == '0')
- switch (p[1])
- {
- case 'x':
- case 'X':
- if (len >= 3)
- {
- p += 2;
- base = 16;
- len -= 2;
- }
- break;
-
- case 't':
- case 'T':
- case 'd':
- case 'D':
- if (len >= 3)
- {
- p += 2;
- base = 10;
- len -= 2;
- }
- break;
-
- default:
- base = 8;
- break;
- }
-
- while (len-- > 0)
- {
- c = *p++;
- if (c >= 'A' && c <= 'Z')
- c += 'a' - 'A';
- if (c != 'l' && c != 'u')
- n *= base;
- if (c >= '0' && c <= '9')
- n += i = c - '0';
- else
- {
- if (base > 10 && c >= 'a' && c <= 'f')
- n += i = c - 'a' + 10;
- else if (len == 0 && c == 'l')
- ;
- else if (len == 0 && c == 'u')
- unsigned_p = 1;
- else
- return ERROR; /* Char not a digit */
- }
- if (i >= base)
- return ERROR; /* Invalid digit in this base */
- }
-
- if (unsigned_p)
- {
- putithere->ulval = n;
- return UINT;
- }
- else
- {
- putithere->lval = n;
- return INT;
- }
-}
-
-struct token
-{
- char *operator;
- int token;
- enum exp_opcode opcode;
-};
-
-const static struct token tokentab3[] =
- {
- {">>=", ASSIGN_MODIFY, BINOP_RSH},
- {"<<=", ASSIGN_MODIFY, BINOP_LSH}
- };
-
-const static struct token tokentab2[] =
- {
- {"+=", ASSIGN_MODIFY, BINOP_ADD},
- {"-=", ASSIGN_MODIFY, BINOP_SUB},
- {"*=", ASSIGN_MODIFY, BINOP_MUL},
- {"/=", ASSIGN_MODIFY, BINOP_DIV},
- {"%=", ASSIGN_MODIFY, BINOP_REM},
- {"|=", ASSIGN_MODIFY, BINOP_LOGIOR},
- {"&=", ASSIGN_MODIFY, BINOP_LOGAND},
- {"^=", ASSIGN_MODIFY, BINOP_LOGXOR},
- {"++", INCREMENT, BINOP_END},
- {"--", DECREMENT, BINOP_END},
- {"->", ARROW, BINOP_END},
- {"&&", AND, BINOP_END},
- {"||", OR, BINOP_END},
- {"::", COLONCOLON, BINOP_END},
- {"<<", LSH, BINOP_END},
- {">>", RSH, BINOP_END},
- {"==", EQUAL, BINOP_END},
- {"!=", NOTEQUAL, BINOP_END},
- {"<=", LEQ, BINOP_END},
- {">=", GEQ, BINOP_END}
- };
-
-/* assign machine-independent names to certain registers
- * (unless overridden by the REGISTER_NAMES table)
- */
-struct std_regs {
- char *name;
- int regnum;
-} std_regs[] = {
-#ifdef PC_REGNUM
- { "pc", PC_REGNUM },
-#endif
-#ifdef FP_REGNUM
- { "fp", FP_REGNUM },
-#endif
-#ifdef SP_REGNUM
- { "sp", SP_REGNUM },
-#endif
-#ifdef PS_REGNUM
- { "ps", PS_REGNUM },
-#endif
-};
-
-#define NUM_STD_REGS (sizeof std_regs / sizeof std_regs[0])
-
-/* Read one token, getting characters through lexptr. */
-
-static int
-yylex ()
-{
- register int c;
- register int namelen;
- register unsigned i;
- register char *tokstart;
-
- retry:
-
- tokstart = lexptr;
- /* See if it is a special token of length 3. */
- for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
- if (!strncmp (tokstart, tokentab3[i].operator, 3))
- {
- lexptr += 3;
- yylval.opcode = tokentab3[i].opcode;
- return tokentab3[i].token;
- }
-
- /* See if it is a special token of length 2. */
- for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
- if (!strncmp (tokstart, tokentab2[i].operator, 2))
- {
- lexptr += 2;
- yylval.opcode = tokentab2[i].opcode;
- return tokentab2[i].token;
- }
-
- switch (c = *tokstart)
- {
- case 0:
- return 0;
-
- case ' ':
- case '\t':
- case '\n':
- lexptr++;
- goto retry;
-
- case '\'':
- lexptr++;
- c = *lexptr++;
- if (c == '\\')
- c = parse_escape (&lexptr);
- yylval.lval = c;
- c = *lexptr++;
- if (c != '\'')
- error ("Invalid character constant.");
- return CHAR;
-
- case '(':
- paren_depth++;
- lexptr++;
- return c;
-
- case ')':
- if (paren_depth == 0)
- return 0;
- paren_depth--;
- lexptr++;
- return c;
-
- case ',':
- if (comma_terminates && paren_depth == 0)
- return 0;
- lexptr++;
- return c;
-
- case '.':
- /* Might be a floating point number. */
- if (lexptr[1] < '0' || lexptr[1] > '9')
- goto symbol; /* Nope, must be a symbol. */
- /* FALL THRU into number case. */
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- {
- /* It's a number. */
- int got_dot = 0, got_e = 0, toktype;
- register char *p = tokstart;
- int hex = input_radix > 10;
-
- if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
- {
- p += 2;
- hex = 1;
- }
- else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
- {
- p += 2;
- hex = 0;
- }
-
- for (;; ++p)
- {
- if (!hex && !got_e && (*p == 'e' || *p == 'E'))
- got_dot = got_e = 1;
- else if (!hex && !got_dot && *p == '.')
- got_dot = 1;
- else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
- && (*p == '-' || *p == '+'))
- /* This is the sign of the exponent, not the end of the
- number. */
- continue;
- /* We will take any letters or digits. parse_number will
- complain if past the radix, or if L or U are not final. */
- else if ((*p < '0' || *p > '9')
- && ((*p < 'a' || *p > 'z')
- && (*p < 'A' || *p > 'Z')))
- break;
- }
- toktype = parse_number (tokstart, p - tokstart, got_dot|got_e, &yylval);
- if (toktype == ERROR)
- {
- char *err_copy = (char *) alloca (p - tokstart + 1);
-
- bcopy (tokstart, err_copy, p - tokstart);
- err_copy[p - tokstart] = 0;
- error ("Invalid number \"%s\".", err_copy);
- }
- lexptr = p;
- return toktype;
- }
-
- case '+':
- case '-':
- case '*':
- case '/':
- case '%':
- case '|':
- case '&':
- case '^':
- case '~':
- case '!':
- case '@':
- case '<':
- case '>':
- case '[':
- case ']':
- case '?':
- case ':':
- case '=':
- case '{':
- case '}':
- symbol:
- lexptr++;
- return c;
-
- case '"':
- for (namelen = 1; (c = tokstart[namelen]) != '"'; namelen++)
- if (c == '\\')
- {
- c = tokstart[++namelen];
- if (c >= '0' && c <= '9')
- {
- c = tokstart[++namelen];
- if (c >= '0' && c <= '9')
- c = tokstart[++namelen];
- }
- }
- yylval.sval.ptr = tokstart + 1;
- yylval.sval.length = namelen - 1;
- lexptr += namelen + 1;
- return STRING;
- }
-
- if (!(c == '_' || c == '$'
- || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
- /* We must have come across a bad character (e.g. ';'). */
- error ("Invalid character '%c' in expression.", c);
-
- /* It's a name. See how long it is. */
- namelen = 0;
- for (c = tokstart[namelen];
- (c == '_' || c == '$' || (c >= '0' && c <= '9')
- || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
- c = tokstart[++namelen])
- ;
-
- /* The token "if" terminates the expression and is NOT
- removed from the input stream. */
- if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
- {
- return 0;
- }
-
- lexptr += namelen;
-
- /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
- and $$digits (equivalent to $<-digits> if you could type that).
- Make token type LAST, and put the number (the digits) in yylval. */
-
- if (*tokstart == '$')
- {
- register int negate = 0;
- c = 1;
- /* Double dollar means negate the number and add -1 as well.
- Thus $$ alone means -1. */
- if (namelen >= 2 && tokstart[1] == '$')
- {
- negate = 1;
- c = 2;
- }
- if (c == namelen)
- {
- /* Just dollars (one or two) */
- yylval.lval = - negate;
- return LAST;
- }
- /* Is the rest of the token digits? */
- for (; c < namelen; c++)
- if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
- break;
- if (c == namelen)
- {
- yylval.lval = atoi (tokstart + 1 + negate);
- if (negate)
- yylval.lval = - yylval.lval;
- return LAST;
- }
- }
-
- /* Handle tokens that refer to machine registers:
- $ followed by a register name. */
-
- if (*tokstart == '$') {
- for (c = 0; c < NUM_REGS; c++)
- if (namelen - 1 == strlen (reg_names[c])
- && !strncmp (tokstart + 1, reg_names[c], namelen - 1))
- {
- yylval.lval = c;
- return REGNAME;
- }
- for (c = 0; c < NUM_STD_REGS; c++)
- if (namelen - 1 == strlen (std_regs[c].name)
- && !strncmp (tokstart + 1, std_regs[c].name, namelen - 1))
- {
- yylval.lval = std_regs[c].regnum;
- return REGNAME;
- }
- }
- /* Catch specific keywords. Should be done with a data structure. */
- switch (namelen)
- {
- case 8:
- if (!strncmp (tokstart, "unsigned", 8))
- return UNSIGNED;
- break;
- case 6:
- if (!strncmp (tokstart, "struct", 6))
- return STRUCT;
- if (!strncmp (tokstart, "signed", 6))
- return SIGNED;
- if (!strncmp (tokstart, "sizeof", 6))
- return SIZEOF;
- break;
- case 5:
- if (!strncmp (tokstart, "union", 5))
- return UNION;
- if (!strncmp (tokstart, "short", 5))
- return SHORT;
- break;
- case 4:
- if (!strncmp (tokstart, "enum", 4))
- return ENUM;
- if (!strncmp (tokstart, "long", 4))
- return LONG;
- if (!strncmp (tokstart, "this", 4))
- {
- static const char this_name[] =
- { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
-
- if (lookup_symbol (this_name, expression_context_block,
- VAR_NAMESPACE, 0, NULL))
- return THIS;
- }
- break;
- case 3:
- if (!strncmp (tokstart, "int", 3))
- return INT_KEYWORD;
- break;
- default:
- break;
- }
-
- yylval.sval.ptr = tokstart;
- yylval.sval.length = namelen;
-
- /* Any other names starting in $ are debugger internal variables. */
-
- if (*tokstart == '$')
- {
- yylval.ivar = lookup_internalvar (copy_name (yylval.sval) + 1);
- return VARIABLE;
- }
-
- /* Use token-type BLOCKNAME for symbols that happen to be defined as
- functions or symtabs. If this is not so, then ...
- Use token-type TYPENAME for symbols that happen to be defined
- currently as names of types; NAME for other symbols.
- The caller is not constrained to care about the distinction. */
- {
- char *tmp = copy_name (yylval.sval);
- struct symbol *sym;
- int is_a_field_of_this = 0;
- int hextype;
-
- sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE, &is_a_field_of_this, NULL);
- if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) ||
- lookup_partial_symtab (tmp))
- {
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return BLOCKNAME;
- }
- if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
- {
- yylval.tsym.type = SYMBOL_TYPE (sym);
- return TYPENAME;
- }
- if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
- return TYPENAME;
-
- /* Input names that aren't symbols but ARE valid hex numbers,
- when the input radix permits them, can be names or numbers
- depending on the parse. Note we support radixes > 16 here. */
- if (!sym &&
- ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
- (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
- {
- YYSTYPE newlval; /* Its value is ignored. */
- hextype = parse_number (tokstart, namelen, 0, &newlval);
- if (hextype == INT)
- {
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return NAME_OR_INT;
- }
- if (hextype == UINT)
- {
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return NAME_OR_UINT;
- }
- }
-
- /* Any other kind of symbol */
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
- return NAME;
- }
-}
-
-/* ARGSUSED */
-static void
-yyerror (msg)
- char *msg;
-{
- error ("Invalid syntax in expression.");
-}
-
-/* Return a null-terminated temporary copy of the name
- of a string token. */
-
-static char *
-copy_name (token)
- struct stoken token;
-{
- bcopy (token.ptr, namecopy, token.length);
- namecopy[token.length] = 0;
- return namecopy;
-}
-
-/* Reverse an expression from suffix form (in which it is constructed)
- to prefix form (in which we can conveniently print or execute it). */
-
-static void prefixify_subexp ();
-
-static void
-prefixify_expression (expr)
- register struct expression *expr;
-{
- register int len = sizeof (struct expression) +
- expr->nelts * sizeof (union exp_element);
- register struct expression *temp;
- register int inpos = expr->nelts, outpos = 0;
-
- temp = (struct expression *) alloca (len);
-
- /* Copy the original expression into temp. */
- bcopy (expr, temp, len);
-
- prefixify_subexp (temp, expr, inpos, outpos);
-}
-
-/* Return the number of exp_elements in the subexpression of EXPR
- whose last exp_element is at index ENDPOS - 1 in EXPR. */
-
-static int
-length_of_subexp (expr, endpos)
- register struct expression *expr;
- register int endpos;
-{
- register int oplen = 1;
- register int args = 0;
- register int i;
-
- if (endpos < 0)
- error ("?error in length_of_subexp");
-
- i = (int) expr->elts[endpos - 1].opcode;
-
- switch (i)
- {
- /* C++ */
- case OP_SCOPE:
- oplen = 4 + ((expr->elts[endpos - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
- break;
-
- case OP_LONG:
- case OP_DOUBLE:
- oplen = 4;
- break;
-
- case OP_VAR_VALUE:
- case OP_LAST:
- case OP_REGISTER:
- case OP_INTERNALVAR:
- oplen = 3;
- break;
-
- case OP_FUNCALL:
- oplen = 3;
- args = 1 + expr->elts[endpos - 2].longconst;
- break;
-
- case UNOP_CAST:
- case UNOP_MEMVAL:
- oplen = 3;
- args = 1;
- break;
-
- case STRUCTOP_STRUCT:
- case STRUCTOP_PTR:
- args = 1;
- case OP_STRING:
- oplen = 3 + ((expr->elts[endpos - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
- break;
-
- case TERNOP_COND:
- args = 3;
- break;
-
- case BINOP_ASSIGN_MODIFY:
- oplen = 3;
- args = 2;
- break;
-
- /* C++ */
- case OP_THIS:
- oplen = 2;
- break;
-
- default:
- args = 1 + (i < (int) BINOP_END);
- }
-
- while (args > 0)
- {
- oplen += length_of_subexp (expr, endpos - oplen);
- args--;
- }
-
- return oplen;
-}
-
-/* Copy the subexpression ending just before index INEND in INEXPR
- into OUTEXPR, starting at index OUTBEG.
- In the process, convert it from suffix to prefix form. */
-
-static void
-prefixify_subexp (inexpr, outexpr, inend, outbeg)
- register struct expression *inexpr;
- struct expression *outexpr;
- register int inend;
- int outbeg;
-{
- register int oplen = 1;
- register int args = 0;
- register int i;
- int *arglens;
- enum exp_opcode opcode;
-
- /* Compute how long the last operation is (in OPLEN),
- and also how many preceding subexpressions serve as
- arguments for it (in ARGS). */
-
- opcode = inexpr->elts[inend - 1].opcode;
- switch (opcode)
- {
- /* C++ */
- case OP_SCOPE:
- oplen = 4 + ((inexpr->elts[inend - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
- break;
-
- case OP_LONG:
- case OP_DOUBLE:
- oplen = 4;
- break;
-
- case OP_VAR_VALUE:
- case OP_LAST:
- case OP_REGISTER:
- case OP_INTERNALVAR:
- oplen = 3;
- break;
-
- case OP_FUNCALL:
- oplen = 3;
- args = 1 + inexpr->elts[inend - 2].longconst;
- break;
-
- case UNOP_CAST:
- case UNOP_MEMVAL:
- oplen = 3;
- args = 1;
- break;
-
- case STRUCTOP_STRUCT:
- case STRUCTOP_PTR:
- args = 1;
- case OP_STRING:
- oplen = 3 + ((inexpr->elts[inend - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
-
- break;
-
- case TERNOP_COND:
- args = 3;
- break;
-
- case BINOP_ASSIGN_MODIFY:
- oplen = 3;
- args = 2;
- break;
-
- /* C++ */
- case OP_THIS:
- oplen = 2;
- break;
-
- default:
- args = 1 + ((int) opcode < (int) BINOP_END);
- }
-
- /* Copy the final operator itself, from the end of the input
- to the beginning of the output. */
- inend -= oplen;
- bcopy (&inexpr->elts[inend], &outexpr->elts[outbeg],
- oplen * sizeof (union exp_element));
- outbeg += oplen;
-
- /* Find the lengths of the arg subexpressions. */
- arglens = (int *) alloca (args * sizeof (int));
- for (i = args - 1; i >= 0; i--)
- {
- oplen = length_of_subexp (inexpr, inend);
- arglens[i] = oplen;
- inend -= oplen;
- }
-
- /* Now copy each subexpression, preserving the order of
- the subexpressions, but prefixifying each one.
- In this loop, inend starts at the beginning of
- the expression this level is working on
- and marches forward over the arguments.
- outbeg does similarly in the output. */
- for (i = 0; i < args; i++)
- {
- oplen = arglens[i];
- inend += oplen;
- prefixify_subexp (inexpr, outexpr, inend, outbeg);
- outbeg += oplen;
- }
-}
-
-/* This page contains the two entry points to this file. */
-
-/* Read a C expression from the string *STRINGPTR points to,
- parse it, and return a pointer to a struct expression that we malloc.
- Use block BLOCK as the lexical context for variable names;
- if BLOCK is zero, use the block of the selected stack frame.
- Meanwhile, advance *STRINGPTR to point after the expression,
- at the first nonwhite character that is not part of the expression
- (possibly a null character).
-
- If COMMA is nonzero, stop if a comma is reached. */
-
-struct expression *
-parse_c_1 (stringptr, block, comma)
- char **stringptr;
- struct block *block;
- int comma;
-{
- struct cleanup *old_chain;
-
- lexptr = *stringptr;
-
- paren_depth = 0;
- type_stack_depth = 0;
-
- comma_terminates = comma;
-
- if (lexptr == 0 || *lexptr == 0)
- error_no_arg ("expression to compute");
-
- old_chain = make_cleanup (free_funcalls, 0);
- funcall_chain = 0;
-
- expression_context_block = block ? block : get_selected_block ();
-
- namecopy = (char *) alloca (strlen (lexptr) + 1);
- expout_size = 10;
- expout_ptr = 0;
- expout = (struct expression *)
- xmalloc (sizeof (struct expression)
- + expout_size * sizeof (union exp_element));
- make_cleanup (free_current_contents, &expout);
- if (yyparse ())
- yyerror (NULL);
- discard_cleanups (old_chain);
- expout->nelts = expout_ptr;
- expout = (struct expression *)
- xrealloc (expout,
- sizeof (struct expression)
- + expout_ptr * sizeof (union exp_element));
- prefixify_expression (expout);
- *stringptr = lexptr;
- return expout;
-}
-
-/* Parse STRING as an expression, and complain if this fails
- to use up all of the contents of STRING. */
-
-struct expression *
-parse_c_expression (string)
- char *string;
-{
- register struct expression *exp;
- exp = parse_c_1 (&string, 0, 0);
- if (*string)
- error ("Junk after end of expression.");
- return exp;
-}
-
-static void
-push_type (tp)
- enum type_pieces tp;
-{
- if (type_stack_depth == type_stack_size)
- {
- type_stack_size *= 2;
- type_stack = (union type_stack_elt *)
- xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
- }
- type_stack[type_stack_depth++].piece = tp;
-}
-
-static void
-push_type_int (n)
- int n;
-{
- if (type_stack_depth == type_stack_size)
- {
- type_stack_size *= 2;
- type_stack = (union type_stack_elt *)
- xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
- }
- type_stack[type_stack_depth++].int_val = n;
-}
-
-static enum type_pieces
-pop_type ()
-{
- if (type_stack_depth)
- return type_stack[--type_stack_depth].piece;
- return tp_end;
-}
-
-static int
-pop_type_int ()
-{
- if (type_stack_depth)
- return type_stack[--type_stack_depth].int_val;
- /* "Can't happen". */
- return 0;
-}
-
-void
-_initialize_expread ()
-{
- type_stack_size = 80;
- type_stack_depth = 0;
- type_stack = (union type_stack_elt *)
- xmalloc (type_stack_size * sizeof (*type_stack));
-}
diff --git a/gdb/expression.h b/gdb/expression.h
deleted file mode 100644
index b7a6fff..0000000
--- a/gdb/expression.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/* Definitions for expressions stored in reversed prefix form, for GDB.
- Copyright (C) 1986, 1989 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Definitions for saved C expressions. */
-
-/* An expression is represented as a vector of union exp_element's.
- Each exp_element is an opcode, except that some opcodes cause
- the following exp_element to be treated as a long or double constant
- or as a variable. The opcodes are obeyed, using a stack for temporaries.
- The value is left on the temporary stack at the end. */
-
-/* When it is necessary to include a string,
- it can occupy as many exp_elements as it needs.
- We find the length of the string using strlen,
- divide to find out how many exp_elements are used up,
- and skip that many. Strings, like numbers, are indicated
- by the preceding opcode. */
-
-enum exp_opcode
-{
-/* BINOP_... operate on two values computed by following subexpressions,
- replacing them by one result value. They take no immediate arguments. */
- BINOP_ADD, /* + */
- BINOP_SUB, /* - */
- BINOP_MUL, /* * */
- BINOP_DIV, /* / */
- BINOP_REM, /* % */
- BINOP_LSH, /* << */
- BINOP_RSH, /* >> */
- BINOP_AND, /* && */
- BINOP_OR, /* || */
- BINOP_LOGAND, /* & */
- BINOP_LOGIOR, /* | */
- BINOP_LOGXOR, /* ^ */
- BINOP_EQUAL, /* == */
- BINOP_NOTEQUAL, /* != */
- BINOP_LESS, /* < */
- BINOP_GTR, /* > */
- BINOP_LEQ, /* <= */
- BINOP_GEQ, /* >= */
- BINOP_REPEAT, /* @ */
- BINOP_ASSIGN, /* = */
- BINOP_COMMA, /* , */
- BINOP_SUBSCRIPT, /* x[y] */
- BINOP_EXP, /* Exponentiation */
-
-/* C++. */
- BINOP_MIN, /* <? */
- BINOP_MAX, /* >? */
- BINOP_SCOPE, /* :: */
-
- /* STRUCTOP_MEMBER is used for pointer-to-member constructs.
- X . * Y translates into X STRUCTOP_MEMBER Y. */
- STRUCTOP_MEMBER,
- /* STRUCTOP_MPTR is used for pointer-to-member constructs
- when X is a pointer instead of an aggregate. */
- STRUCTOP_MPTR,
-/* end of C++. */
-
- BINOP_END,
-
- BINOP_ASSIGN_MODIFY, /* +=, -=, *=, and so on.
- The following exp_element is another opcode,
- a BINOP_, saying how to modify.
- Then comes another BINOP_ASSIGN_MODIFY,
- making three exp_elements in total. */
-
-/* Operates on three values computed by following subexpressions. */
- TERNOP_COND, /* ?: */
-
-/* The OP_... series take immediate following arguments.
- After the arguments come another OP_... (the same one)
- so that the grouping can be recognized from the end. */
-
-/* OP_LONG is followed by a type pointer in the next exp_element
- and the long constant value in the following exp_element.
- Then comes another OP_LONG.
- Thus, the operation occupies four exp_elements. */
-
- OP_LONG,
-/* OP_DOUBLE is similar but takes a double constant instead of a long one. */
- OP_DOUBLE,
-/* OP_VAR_VALUE takes one struct symbol * in the following exp_element,
- followed by another OP_VAR_VALUE, making three exp_elements. */
- OP_VAR_VALUE,
-/* OP_LAST is followed by an integer in the next exp_element.
- The integer is zero for the last value printed,
- or it is the absolute number of a history element.
- With another OP_LAST at the end, this makes three exp_elements. */
- OP_LAST,
-/* OP_REGISTER is followed by an integer in the next exp_element.
- This is the number of a register to fetch (as an int).
- With another OP_REGISTER at the end, this makes three exp_elements. */
- OP_REGISTER,
-/* OP_INTERNALVAR is followed by an internalvar ptr in the next exp_element.
- With another OP_INTERNALVAR at the end, this makes three exp_elements. */
- OP_INTERNALVAR,
-/* OP_FUNCALL is followed by an integer in the next exp_element.
- The integer is the number of args to the function call.
- That many plus one values from following subexpressions
- are used, the first one being the function.
- The integer is followed by a repeat of OP_FUNCALL,
- making three exp_elements. */
- OP_FUNCALL,
-/* OP_STRING represents a string constant.
- Its format is the same as that of a STRUCTOP, but the string
- data is just made into a string constant when the operation
- is executed. */
- OP_STRING,
-
-/* UNOP_CAST is followed by a type pointer in the next exp_element.
- With another UNOP_CAST at the end, this makes three exp_elements.
- It casts the value of the following subexpression. */
- UNOP_CAST,
-/* UNOP_MEMVAL is followed by a type pointer in the next exp_element
- With another UNOP_MEMVAL at the end, this makes three exp_elements.
- It casts the contents of the word addressed by the value of the
- following subexpression. */
- UNOP_MEMVAL,
-/* UNOP_... operate on one value from a following subexpression
- and replace it with a result. They take no immediate arguments. */
- UNOP_NEG, /* Unary - */
- UNOP_ZEROP, /* Unary ! */
- UNOP_LOGNOT, /* Unary ~ */
- UNOP_IND, /* Unary * */
- UNOP_ADDR, /* Unary & */
- UNOP_PREINCREMENT, /* ++ before an expression */
- UNOP_POSTINCREMENT, /* ++ after an expression */
- UNOP_PREDECREMENT, /* -- before an expression */
- UNOP_POSTDECREMENT, /* -- after an expression */
- UNOP_SIZEOF, /* Unary sizeof (followed by expression) */
-
-/* STRUCTOP_... operate on a value from a following subexpression
- by extracting a structure component specified by a string
- that appears in the following exp_elements (as many as needed).
- STRUCTOP_STRUCT is used for "." and STRUCTOP_PTR for "->".
- They differ only in the error message given in case the value is
- not suitable or the structure component specified is not found.
-
- The length of the string follows in the next exp_element,
- (after the string), followed by another STRUCTOP_... code. */
- STRUCTOP_STRUCT,
- STRUCTOP_PTR,
-
-/* C++ */
- /* OP_THIS is just a placeholder for the class instance variable.
- It just comes in a tight (OP_THIS, OP_THIS) pair. */
- OP_THIS,
-
- /* OP_SCOPE surrounds a type name and a field name. The type
- name is encoded as one element, but the field name stays as
- a string, which, of course, is variable length. */
- OP_SCOPE,
-
-};
-
-union exp_element
-{
- enum exp_opcode opcode;
- struct symbol *symbol;
- LONGEST longconst;
- double doubleconst;
- char string;
- struct type *type;
- struct internalvar *internalvar;
-};
-
-struct expression
-{
- int nelts;
- union exp_element elts[1];
-};
-
-/* From expread.y. */
-struct expression *parse_c_expression ();
-struct expression *parse_c_1 ();
-
-/* The innermost context required by the stack and register variables
- we've encountered so far. To use this, set it to NULL, then call
- parse_c_<whatever>, then look at it. */
-extern struct block *innermost_block;
-
-/* From expprint.c. */
-void print_expression ();
diff --git a/gdb/findvar.c b/gdb/findvar.c
deleted file mode 100644
index 58da6b6..0000000
--- a/gdb/findvar.c
+++ /dev/null
@@ -1,700 +0,0 @@
-/* Find a variable's value in memory, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "inferior.h"
-#include "target.h"
-
-#if !defined (GET_SAVED_REGISTER)
-
-/* Return the address in which frame FRAME's value of register REGNUM
- has been saved in memory. Or return zero if it has not been saved.
- If REGNUM specifies the SP, the value we return is actually
- the SP value, not an address where it was saved. */
-
-CORE_ADDR
-find_saved_register (frame, regnum)
- FRAME frame;
- int regnum;
-{
- struct frame_info *fi;
- struct frame_saved_regs saved_regs;
-
- register FRAME frame1 = 0;
- register CORE_ADDR addr = 0;
-
- if (frame == 0) /* No regs saved if want current frame */
- return 0;
-
-#ifdef HAVE_REGISTER_WINDOWS
- /* We assume that a register in a register window will only be saved
- in one place (since the name changes and/or disappears as you go
- towards inner frames), so we only call get_frame_saved_regs on
- the current frame. This is directly in contradiction to the
- usage below, which assumes that registers used in a frame must be
- saved in a lower (more interior) frame. This change is a result
- of working on a register window machine; get_frame_saved_regs
- always returns the registers saved within a frame, within the
- context (register namespace) of that frame. */
-
- /* However, note that we don't want this to return anything if
- nothing is saved (if there's a frame inside of this one). Also,
- callers to this routine asking for the stack pointer want the
- stack pointer saved for *this* frame; this is returned from the
- next frame. */
-
-
- if (REGISTER_IN_WINDOW_P(regnum))
- {
- frame1 = get_next_frame (frame);
- if (!frame1) return 0; /* Registers of this frame are
- active. */
-
- /* Get the SP from the next frame in; it will be this
- current frame. */
- if (regnum != SP_REGNUM)
- frame1 = frame;
-
- fi = get_frame_info (frame1);
- get_frame_saved_regs (fi, &saved_regs);
- return saved_regs.regs[regnum]; /* ... which might be zero */
- }
-#endif /* HAVE_REGISTER_WINDOWS */
-
- /* Note that this next routine assumes that registers used in
- frame x will be saved only in the frame that x calls and
- frames interior to it. This is not true on the sparc, but the
- above macro takes care of it, so we should be all right. */
- while (1)
- {
- QUIT;
- frame1 = get_prev_frame (frame1);
- if (frame1 == 0 || frame1 == frame)
- break;
- fi = get_frame_info (frame1);
- get_frame_saved_regs (fi, &saved_regs);
- if (saved_regs.regs[regnum])
- addr = saved_regs.regs[regnum];
- }
-
- return addr;
-}
-
-/* Find register number REGNUM relative to FRAME and put its
- (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable
- was optimized out (and thus can't be fetched). Set *LVAL to
- lval_memory, lval_register, or not_lval, depending on whether the
- value was fetched from memory, from a register, or in a strange
- and non-modifiable way (e.g. a frame pointer which was calculated
- rather than fetched). Set *ADDRP to the address, either in memory
- on as a REGISTER_BYTE offset into the registers array.
-
- Note that this implementation never sets *LVAL to not_lval. But
- it can be replaced by defining GET_SAVED_REGISTER and supplying
- your own.
-
- The argument RAW_BUFFER must point to aligned memory. */
-void
-get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
- char *raw_buffer;
- int *optimized;
- CORE_ADDR *addrp;
- FRAME frame;
- int regnum;
- enum lval_type *lval;
-{
- CORE_ADDR addr;
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
- addr = find_saved_register (frame, regnum);
- if (addr != NULL)
- {
- if (lval != NULL)
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer != NULL)
- *(CORE_ADDR *)raw_buffer = addr;
- if (addrp != NULL)
- *addrp = 0;
- return;
- }
- if (raw_buffer != NULL)
- read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
- }
- else
- {
- if (lval != NULL)
- *lval = lval_register;
- addr = REGISTER_BYTE (regnum);
- if (raw_buffer != NULL)
- read_register_gen (regnum, raw_buffer);
- }
- if (addrp != NULL)
- *addrp = addr;
-}
-#endif /* GET_SAVED_REGISTER. */
-
-/* Copy the bytes of register REGNUM, relative to the current stack frame,
- into our memory at MYADDR, in target byte order.
- The number of bytes copied is REGISTER_RAW_SIZE (REGNUM).
-
- Returns 1 if could not be read, 0 if could. */
-
-int
-read_relative_register_raw_bytes (regnum, myaddr)
- int regnum;
- char *myaddr;
-{
- int optim;
- if (regnum == FP_REGNUM && selected_frame)
- {
- bcopy (&FRAME_FP(selected_frame), myaddr, sizeof (CORE_ADDR));
- SWAP_TARGET_AND_HOST (myaddr, sizeof (CORE_ADDR)); /* in target order */
- return 0;
- }
-
- get_saved_register (myaddr, &optim, (CORE_ADDR *) NULL, selected_frame,
- regnum, (enum lval_type *)NULL);
- return optim;
-}
-
-/* Return a `value' with the contents of register REGNUM
- in its virtual format, with the type specified by
- REGISTER_VIRTUAL_TYPE. */
-
-value
-value_of_register (regnum)
- int regnum;
-{
- CORE_ADDR addr;
- int optim;
- register value val;
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
- char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
- enum lval_type lval;
-
- get_saved_register (raw_buffer, &optim, &addr,
- selected_frame, regnum, &lval);
-
- target_convert_to_virtual (regnum, raw_buffer, virtual_buffer);
- val = allocate_value (REGISTER_VIRTUAL_TYPE (regnum));
- bcopy (virtual_buffer, VALUE_CONTENTS_RAW (val),
- REGISTER_VIRTUAL_SIZE (regnum));
- VALUE_LVAL (val) = lval;
- VALUE_ADDRESS (val) = addr;
- VALUE_REGNO (val) = regnum;
- VALUE_OPTIMIZED_OUT (val) = optim;
- return val;
-}
-
-/* Low level examining and depositing of registers.
-
- The caller is responsible for making
- sure that the inferior is stopped before calling the fetching routines,
- or it will get garbage. (a change from GDB version 3, in which
- the caller got the value from the last stop). */
-
-/* Contents of the registers in target byte order.
- We allocate some extra slop since we do a lot of bcopy's around `registers',
- and failing-soft is better than failing hard. */
-char registers[REGISTER_BYTES + /* SLOP */ 256];
-
-/* Nonzero if that register has been fetched. */
-char register_valid[NUM_REGS];
-
-/* Indicate that registers may have changed, so invalidate the cache. */
-void
-registers_changed ()
-{
- int i;
- for (i = 0; i < NUM_REGS; i++)
- register_valid[i] = 0;
-}
-
-/* Indicate that all registers have been fetched, so mark them all valid. */
-void
-registers_fetched ()
-{
- int i;
- for (i = 0; i < NUM_REGS; i++)
- register_valid[i] = 1;
-}
-
-/* Copy LEN bytes of consecutive data from registers
- starting with the REGBYTE'th byte of register data
- into memory at MYADDR. */
-
-void
-read_register_bytes (regbyte, myaddr, len)
- int regbyte;
- char *myaddr;
- int len;
-{
- /* Fetch all registers. */
- int i;
- for (i = 0; i < NUM_REGS; i++)
- if (!register_valid[i])
- {
- target_fetch_registers (-1);
- break;
- }
- if (myaddr != NULL)
- bcopy (&registers[regbyte], myaddr, len);
-}
-
-/* Read register REGNO into memory at MYADDR, which must be large enough
- for REGISTER_RAW_BYTES (REGNO). Target byte-order.
- If the register is known to be the size of a CORE_ADDR or smaller,
- read_register can be used instead. */
-void
-read_register_gen (regno, myaddr)
- int regno;
- char *myaddr;
-{
- if (!register_valid[regno])
- target_fetch_registers (regno);
- bcopy (&registers[REGISTER_BYTE (regno)], myaddr, REGISTER_RAW_SIZE (regno));
-}
-
-/* Copy LEN bytes of consecutive data from memory at MYADDR
- into registers starting with the REGBYTE'th byte of register data. */
-
-void
-write_register_bytes (regbyte, myaddr, len)
- int regbyte;
- char *myaddr;
- int len;
-{
- /* Make sure the entire registers array is valid. */
- read_register_bytes (0, (char *)NULL, REGISTER_BYTES);
- bcopy (myaddr, &registers[regbyte], len);
- target_store_registers (-1);
-}
-
-/* Return the contents of register REGNO, regarding it as an integer. */
-
-CORE_ADDR
-read_register (regno)
- int regno;
-{
- int reg;
- if (!register_valid[regno])
- target_fetch_registers (regno);
- /* FIXME, this loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
- reg = *(int *) &registers[REGISTER_BYTE (regno)];
- SWAP_TARGET_AND_HOST (&reg, sizeof (int));
- return reg;
-}
-
-/* Registers we shouldn't try to store. */
-#if !defined (CANNOT_STORE_REGISTER)
-#define CANNOT_STORE_REGISTER(regno) 0
-#endif
-
-/* Store VALUE in the register number REGNO, regarded as an integer. */
-
-void
-write_register (regno, val)
- int regno, val;
-{
- /* On the sparc, writing %g0 is a no-op, so we don't even want to change
- the registers array if something writes to this register. */
- if (CANNOT_STORE_REGISTER (regno))
- return;
-
- SWAP_TARGET_AND_HOST (&val, sizeof (int));
-
- target_prepare_to_store ();
-
- register_valid [regno] = 1;
- /* FIXME, this loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
- /* FIXME, this depends on REGISTER_BYTE (regno) being aligned for host */
- *(int *) &registers[REGISTER_BYTE (regno)] = val;
-
- target_store_registers (regno);
-}
-
-/* Record that register REGNO contains VAL.
- This is used when the value is obtained from the inferior or core dump,
- so there is no need to store the value there. */
-
-void
-supply_register (regno, val)
- int regno;
- char *val;
-{
- register_valid[regno] = 1;
- bcopy (val, &registers[REGISTER_BYTE (regno)], REGISTER_RAW_SIZE (regno));
-}
-
-/* Given a struct symbol for a variable,
- and a stack frame id, read the value of the variable
- and return a (pointer to a) struct value containing the value.
- If the variable cannot be found, return a zero pointer.
- If FRAME is NULL, use the selected_frame. */
-
-value
-read_var_value (var, frame)
- register struct symbol *var;
- FRAME frame;
-{
- register value v;
- struct frame_info *fi;
- struct type *type = SYMBOL_TYPE (var);
- CORE_ADDR addr;
- register int len;
-
- v = allocate_value (type);
- VALUE_LVAL (v) = lval_memory; /* The most likely possibility. */
- len = TYPE_LENGTH (type);
-
- if (frame == 0) frame = selected_frame;
-
- switch (SYMBOL_CLASS (var))
- {
- case LOC_CONST:
- bcopy (&SYMBOL_VALUE (var), VALUE_CONTENTS_RAW (v), len);
- SWAP_TARGET_AND_HOST (VALUE_CONTENTS_RAW (v), len);
- VALUE_LVAL (v) = not_lval;
- return v;
-
- case LOC_LABEL:
- addr = SYMBOL_VALUE_ADDRESS (var);
- bcopy (&addr, VALUE_CONTENTS_RAW (v), len);
- SWAP_TARGET_AND_HOST (VALUE_CONTENTS_RAW (v), len);
- VALUE_LVAL (v) = not_lval;
- return v;
-
- case LOC_CONST_BYTES:
- {
- char *bytes_addr;
- bytes_addr = SYMBOL_VALUE_BYTES (var);
- bcopy (bytes_addr, VALUE_CONTENTS_RAW (v), len);
- VALUE_LVAL (v) = not_lval;
- return v;
- }
-
- case LOC_STATIC:
- case LOC_EXTERNAL:
- addr = SYMBOL_VALUE_ADDRESS (var);
- break;
-
-/* Nonzero if a struct which is located in a register or a LOC_ARG
- really contains
- the address of the struct, not the struct itself. GCC_P is nonzero
- if the function was compiled with GCC. */
-#if !defined (REG_STRUCT_HAS_ADDR)
-#define REG_STRUCT_HAS_ADDR(gcc_p) 0
-#endif
-
- case LOC_ARG:
- fi = get_frame_info (frame);
- if (fi == NULL)
- return 0;
- addr = FRAME_ARGS_ADDRESS (fi);
- if (!addr) {
- return 0;
- }
- addr += SYMBOL_VALUE (var);
- break;
-
- case LOC_REF_ARG:
- fi = get_frame_info (frame);
- if (fi == NULL)
- return 0;
- addr = FRAME_ARGS_ADDRESS (fi);
- if (!addr) {
- return 0;
- }
- addr += SYMBOL_VALUE (var);
- read_memory (addr, &addr, sizeof (CORE_ADDR));
- break;
-
- case LOC_LOCAL:
- case LOC_LOCAL_ARG:
- fi = get_frame_info (frame);
- if (fi == NULL)
- return 0;
- addr = SYMBOL_VALUE (var) + FRAME_LOCALS_ADDRESS (fi);
- break;
-
- case LOC_TYPEDEF:
- error ("Cannot look up value of a typedef");
- break;
-
- case LOC_BLOCK:
- VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (var));
- return v;
-
- case LOC_REGISTER:
- case LOC_REGPARM:
- {
- struct block *b;
-
- if (frame == NULL)
- return 0;
- b = get_frame_block (frame);
-
- v = value_from_register (type, SYMBOL_VALUE (var), frame);
-
- if (REG_STRUCT_HAS_ADDR (BLOCK_GCC_COMPILED (b))
- && TYPE_CODE (type) == TYPE_CODE_STRUCT)
- addr = *(CORE_ADDR *)VALUE_CONTENTS (v);
- else
- return v;
- }
- break;
-
- default:
- error ("Cannot look up value of a botched symbol.");
- break;
- }
-
- VALUE_ADDRESS (v) = addr;
- VALUE_LAZY (v) = 1;
- return v;
-}
-
-/* Return a value of type TYPE, stored in register REGNUM, in frame
- FRAME. */
-
-value
-value_from_register (type, regnum, frame)
- struct type *type;
- int regnum;
- FRAME frame;
-{
- char raw_buffer [MAX_REGISTER_RAW_SIZE];
- char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
- CORE_ADDR addr;
- int optim;
- value v = allocate_value (type);
- int len = TYPE_LENGTH (type);
- char *value_bytes = 0;
- int value_bytes_copied = 0;
- int num_storage_locs;
- enum lval_type lval;
-
- VALUE_REGNO (v) = regnum;
-
- num_storage_locs = (len > REGISTER_VIRTUAL_SIZE (regnum) ?
- ((len - 1) / REGISTER_RAW_SIZE (regnum)) + 1 :
- 1);
-
- if (num_storage_locs > 1)
- {
- /* Value spread across multiple storage locations. */
-
- int local_regnum;
- int mem_stor = 0, reg_stor = 0;
- int mem_tracking = 1;
- CORE_ADDR last_addr = 0;
- CORE_ADDR first_addr;
-
- value_bytes = (char *) alloca (len + MAX_REGISTER_RAW_SIZE);
-
- /* Copy all of the data out, whereever it may be. */
-
- for (local_regnum = regnum;
- value_bytes_copied < len;
- (value_bytes_copied += REGISTER_RAW_SIZE (local_regnum),
- ++local_regnum))
- {
- get_saved_register (value_bytes + value_bytes_copied,
- &optim,
- &addr,
- frame,
- local_regnum,
- &lval);
- if (lval == lval_register)
- reg_stor++;
- else
- {
- mem_stor++;
-
- if (regnum == local_regnum)
- first_addr = addr;
-
- mem_tracking =
- (mem_tracking
- && (regnum == local_regnum
- || addr == last_addr));
- }
- last_addr = addr;
- }
-
- if ((reg_stor && mem_stor)
- || (mem_stor && !mem_tracking))
- /* Mixed storage; all of the hassle we just went through was
- for some good purpose. */
- {
- VALUE_LVAL (v) = lval_reg_frame_relative;
- VALUE_FRAME (v) = FRAME_FP (frame);
- VALUE_FRAME_REGNUM (v) = regnum;
- }
- else if (mem_stor)
- {
- VALUE_LVAL (v) = lval_memory;
- VALUE_ADDRESS (v) = first_addr;
- }
- else if (reg_stor)
- {
- VALUE_LVAL (v) = lval_register;
- VALUE_ADDRESS (v) = first_addr;
- }
- else
- fatal ("value_from_register: Value not stored anywhere!");
-
- VALUE_OPTIMIZED_OUT (v) = optim;
-
- /* Any structure stored in more than one register will always be
- an integral number of registers. Otherwise, you'd need to do
- some fiddling with the last register copied here for little
- endian machines. */
-
- /* Copy into the contents section of the value. */
- bcopy (value_bytes, VALUE_CONTENTS_RAW (v), len);
-
- return v;
- }
-
- /* Data is completely contained within a single register. Locate the
- register's contents in a real register or in core;
- read the data in raw format. */
-
- get_saved_register (raw_buffer, &optim, &addr, frame, regnum, &lval);
- VALUE_OPTIMIZED_OUT (v) = optim;
- VALUE_LVAL (v) = lval;
- VALUE_ADDRESS (v) = addr;
-
- /* Convert the raw contents to virtual contents.
- (Just copy them if the formats are the same.) */
-
- target_convert_to_virtual (regnum, raw_buffer, virtual_buffer);
-
- if (REGISTER_CONVERTIBLE (regnum))
- {
- /* When the raw and virtual formats differ, the virtual format
- corresponds to a specific data type. If we want that type,
- copy the data into the value.
- Otherwise, do a type-conversion. */
-
- if (type != REGISTER_VIRTUAL_TYPE (regnum))
- {
- /* eg a variable of type `float' in a 68881 register
- with raw type `extended' and virtual type `double'.
- Fetch it as a `double' and then convert to `float'. */
- v = allocate_value (REGISTER_VIRTUAL_TYPE (regnum));
- bcopy (virtual_buffer, VALUE_CONTENTS_RAW (v), len);
- v = value_cast (type, v);
- }
- else
- bcopy (virtual_buffer, VALUE_CONTENTS_RAW (v), len);
- }
- else
- {
- /* Raw and virtual formats are the same for this register. */
-
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
- if (len < REGISTER_RAW_SIZE (regnum))
- {
- /* Big-endian, and we want less than full size. */
- VALUE_OFFSET (v) = REGISTER_RAW_SIZE (regnum) - len;
- }
-#endif
-
- bcopy (virtual_buffer + VALUE_OFFSET (v),
- VALUE_CONTENTS_RAW (v), len);
- }
-
- return v;
-}
-
-/* Given a struct symbol for a variable or function,
- and a stack frame id,
- return a (pointer to a) struct value containing the properly typed
- address. */
-
-value
-locate_var_value (var, frame)
- register struct symbol *var;
- FRAME frame;
-{
- CORE_ADDR addr = 0;
- struct type *type = SYMBOL_TYPE (var);
- struct type *result_type;
- value lazy_value;
-
- /* Evaluate it first; if the result is a memory address, we're fine.
- Lazy evaluation pays off here. */
-
- lazy_value = read_var_value (var, frame);
- if (lazy_value == 0)
- error ("Address of \"%s\" is unknown.", SYMBOL_NAME (var));
-
- if (VALUE_LAZY (lazy_value)
- || TYPE_CODE (type) == TYPE_CODE_FUNC)
- {
- addr = VALUE_ADDRESS (lazy_value);
-
- /* C++: The "address" of a reference should yield the address
- * of the object pointed to. So force an extra de-reference. */
-
- if (TYPE_CODE (type) == TYPE_CODE_REF)
- {
- char *buf = alloca (TYPE_LENGTH (type));
- read_memory (addr, buf, TYPE_LENGTH (type));
- addr = unpack_pointer (type, buf);
- type = TYPE_TARGET_TYPE (type);
- }
-
- /* Address of an array is of the type of address of it's elements. */
- /* FIXME, this is probably wrong now for ANSI C. */
- result_type =
- lookup_pointer_type (TYPE_CODE (type) == TYPE_CODE_ARRAY ?
- TYPE_TARGET_TYPE (type) : type);
-
- return value_cast (result_type,
- value_from_long (builtin_type_long, (LONGEST) addr));
- }
-
- /* Not a memory address; check what the problem was. */
- switch (VALUE_LVAL (lazy_value))
- {
- case lval_register:
- case lval_reg_frame_relative:
- error ("Address requested for identifier \"%s\" which is in a register.",
- SYMBOL_NAME (var));
- break;
-
- default:
- error ("Can't take address of \"%s\" which isn't an lvalue.",
- SYMBOL_NAME (var));
- break;
- }
- return 0; /* For lint -- never reached */
-}
diff --git a/gdb/frame.h b/gdb/frame.h
deleted file mode 100644
index 5c98c9c..0000000
--- a/gdb/frame.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* Definitions for dealing with stack frames, for GDB, the GNU debugger.
- Copyright (C) 1986, 1989 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined (FRAME_H)
-#define FRAME_H 1
-#include "param.h"
-
-/*
- * FRAME is the type of the identifier of a specific stack frame. It
- * is a pointer to the frame cache item corresponding to this frame.
- * Please note that frame id's are *not* constant over calls to the
- * inferior. Use frame addresses, which are.
- *
- * FRAME_ADDR is the type of the address of a specific frame. I
- * cannot imagine a case in which this would not be CORE_ADDR, so
- * maybe it's silly to give it it's own type. Life's rough.
- *
- * FRAME_FP is a macro which converts from a frame identifier into a
- * frame_address.
- *
- * FRAME_INFO_ID is a macro which "converts" from a frame info pointer
- * to a frame id. This is here in case I or someone else decides to
- * change the FRAME type again.
- *
- * This file and blockframe.c are the only places which are allowed to
- * use the equivalence between FRAME and struct frame_info *. EXCEPTION:
- * value.h uses CORE_ADDR instead of FRAME_ADDR because the compiler
- * will accept that in the absense of this file.
- */
-typedef struct frame_info *FRAME;
-typedef CORE_ADDR FRAME_ADDR;
-#define FRAME_FP(fr) ((fr)->frame)
-#define FRAME_INFO_ID(f) (f)
-
-/*
- * Caching structure for stack frames. This is also the structure
- * used for extended info about stack frames. May add more to this
- * structure as it becomes necessary.
- *
- * Note that the first entry in the cache will always refer to the
- * innermost executing frame. This value should be set (is it?
- * Check) in something like normal_stop.
- */
-struct frame_info
- {
- /* Nominal address of the frame described. */
- FRAME_ADDR frame;
- /* Address at which execution is occurring in this frame.
- For the innermost frame, it's the current pc.
- For other frames, it is a pc saved in the next frame. */
- CORE_ADDR pc;
- /* The frame called by the frame we are describing, or 0.
- This may be set even if there isn't a frame called by the one
- we are describing (.->next == 0); in that case it is simply the
- bottom of this frame */
- FRAME_ADDR next_frame;
- /* Anything extra for this structure that may have been defined
- in the machine depedent files. */
-#ifdef EXTRA_FRAME_INFO
- EXTRA_FRAME_INFO
-#endif
- /* Pointers to the next and previous frame_info's in this stack. */
- FRAME next, prev;
- };
-
-/* Describe the saved registers of a frame. */
-
-struct frame_saved_regs
- {
- /* For each register, address of where it was saved on entry to the frame,
- or zero if it was not saved on entry to this frame. */
- CORE_ADDR regs[NUM_REGS];
- };
-
-/* The stack frame that the user has specified for commands to act on.
- Note that one cannot assume this is the address of valid data. */
-
-extern FRAME selected_frame;
-
-extern struct frame_info *get_frame_info ();
-extern struct frame_info *get_prev_frame_info ();
-
-extern FRAME create_new_frame ();
-extern void flush_cached_frames ();
-
-extern void get_frame_saved_regs ();
-
-extern void set_current_frame ();
-extern FRAME get_prev_frame ();
-extern FRAME get_current_frame ();
-extern FRAME get_next_frame ();
-
-extern struct block *get_frame_block ();
-extern struct block *get_current_block ();
-extern struct block *get_selected_block ();
-extern struct symbol *get_frame_function ();
-extern CORE_ADDR get_frame_pc ();
-extern CORE_ADDR get_pc_function_start ();
-struct block *block_for_pc ();
-
-int frameless_look_for_prologue ();
-
-void print_frame_args ();
-
-/* In stack.c */
-extern FRAME find_relative_frame ();
-extern void print_selected_frame ();
-extern void print_sel_frame ();
-extern void select_frame ();
-extern void record_selected_frame ();
-
-#endif /* frame.h not already included. */
diff --git a/gdb/gdb-int.texinfo b/gdb/gdb-int.texinfo
deleted file mode 100755
index cc1b188..0000000
--- a/gdb/gdb-int.texinfo
+++ /dev/null
@@ -1,242 +0,0 @@
-\input texinfo
-@setfilename gdb-internals
-@ifinfo
-This file documents the internals of the GNU debugger GDB.
-
-Copyright (C) 1990, 1991 Free Software Foundation, Inc.
-Contributed by Cygnus Support. Written by John Gilmore.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy or distribute modified versions of this
-manual under the terms of the GPL (for which purpose this text may be
-regarded as a program in the language TeX).
-@end ifinfo
-
-@setchapternewpage odd
-@settitle GDB Internals
-@titlepage
-@title{Working in GDB}
-@subtitle{A guide to the internals of the GNU debugger}
-@author John Gilmore
-@author Cygnus Support
-@page
-@tex
-\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision$} % For use in headers, footers too
-{\parskip=0pt
-\hfill Cygnus Support\par
-\hfill \manvers\par
-\hfill \TeX{}info \texinfoversion\par
-}
-@end tex
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1990, 1991 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@end titlepage
-
-@node Top, Cleanups, (dir), (dir)
-
-@menu
-* Cleanups:: Cleanups
-* Wrapping:: Wrapping output lines
-* Releases:: Configuring GDB for release
-* README:: The README file
-* New Architectures:: Defining a new host or target architecture
-* Host versus Targt:: What features are in which files
-
-@end menu
-
-@node Cleanups, Wrapping, Top, Top
-@chapter Cleanups
-
-Cleanups are a structured way to deal with things that need to be done
-later. When your code does something (like malloc some memory, or open
-a file) that needs to be undone later (e.g. free the memory or close
-the file), it can make a cleanup. The cleanup will be done at some
-future point: when the command is finished, when an error occurs, or
-when your code decides it's time to do cleanups.
-
-You can also discard cleanups, that is, throw them away without doing
-what they say. This is only done if you ask that it be done.
-
-Syntax:
-
-@table @code
-@item old_chain = make_cleanup (function, arg);
-This makes a cleanup which will cause FUNCTION to be called with ARG
-(a char *) later. The result, OLD_CHAIN, is a handle that can be
-passed to do_cleanups or discard_cleanups later. Unless you are
-going to call do_cleanups or discard_cleanups yourself,
-you can ignore the result from make_cleanup.
-
-
-@item do_cleanups (old_chain);
-Performs all cleanups done since make_cleanup returned OLD_CHAIN.
-E.g.: make_cleanup (a, 0); old = make_cleanup (b, 0); do_cleanups (old);
-will call b() but will not call a(). The cleanup that calls a() will remain
-in the cleanup chain, and will be done later unless otherwise discarded.
-
-@item discard_cleanups (old_chain);
-Same as do_cleanups except that it just removes the cleanups from the
-chain and does not call the specified functions.
-
-@end table
-
-Some functions, e.g. @code{fputs_filtered()} or @code{error()}, specify that they
-``should not be called when cleanups are not in place''. This means
-that any actions you need to reverse in the case of an error or
-interruption must be on the cleanup chain before you call these functions,
-since they might never return to your code (they @samp{longjmp} instead).
-
-
-@node Wrapping, Releases, Cleanups, Top
-@chapter Wrapping output lines
-
-Output that goes through printf_filtered or fputs_filtered or
-fputs_demangled needs only to have calls to wrap_here() added
-in places that would be good breaking points. The utility routines
-will take care of actually wrapping if the line width is exceeded.
-
-The argument to wrap_here() is an indentation string which is printed
-ONLY if the line breaks there. This argument is saved away and used
-later. It must remain valid until the next call to wrap_here() or
-until a newline has been printed through the *_filtered functions.
-Don't pass in a local variable and then return!
-
-It is usually best to call wrap_here() after printing a comma or space.
-If you call it before printing a space, make sure that your indentation
-properly accounts for the leading space that will print if the line wraps
-there.
-
-Any function or set of functions that produce filtered output must finish
-by printing a newline, to flush the wrap buffer, before switching to
-unfiltered ("printf") output. Symbol reading routines that print
-warnings are a good example.
-
-
-@node Releases, README, Wrapping, Top
-@chapter Configuring GDB for release
-
-
-GDB should be released after doing @samp{config.gdb none} in the top level
-directory. This will leave a makefile there, but no tm- or xm- files.
-The makefile is needed, for example, for @samp{make gdb.tar.Z}@dots{} If you
-have tm- or xm-files in the main source directory, C's include rules
-cause them to be used in preference to tm- and xm-files in the
-subdirectories where the user will actually configure and build the
-binaries.
-
-@samp{config.gdb none} is also a good way to rebuild the top level Makefile
-after changing Makefile.dist, alldeps.mak, etc.
-
-
-
-@node README, New Architectures, Releases, Top
-@chapter The README file
-
-
-Check the README file, it often has useful information that does not
-appear anywhere else in the directory.
-
-
-
-@node New Architectures, Host versus Target, README, Top
-@chapter Defining a new host or target architecture
-
-
-When building support for a new host and/or target, this will help you
-organize where to put the various parts. @var{ARCH} stands for the
-architecture involved.
-
-Object files needed when the host system is an @var{ARCH} are listed in
-the file @file{xconfig/@var{ARCH}}, in the Makefile macro @samp{XDEPFILES
-= }@dots{}. You can also define XXXXXX in there.
-
-There are some ``generic'' versions of routines that can be used by
-various host systems. If these routines work for the @var{ARCH} host,
-you can just include the generic file's name (with .o, not .c) in
-@code{XDEPFILES}. Otherwise, you will need to write routines that
-perform the same functions as the generic file, put them into
-@code{@var{ARCH}-xdep.c}, and put @code{@var{ARCH}-xdep.o} into
-@code{XDEPFILES}. These generic host support files include:
-
-@example
- coredep.c, coredep.o
-@end example
-
-@table @code
-@item fetch_core_registers()
-Support for reading registers out of a core file. This routine calls
-@code{register_addr(}), see below.
-
-@item register_addr()
-If your @code{xm-@var{ARCH}.h} file defines the macro @code{REGISTER_U_ADDR(reg)} to be the
-offset within the @samp{user} struct of a register (represented as a GDB
-register number), @file{coredep.c} will define the @code{register_addr()} function
-and use the macro in it. If you do not define @code{REGISTER_U_ADDR}, but
-you are using the standard @code{fetch_core_registers}, you
-will need to define your own version of @code{register_addr}, put it into
-your @code{@var{ARCH}-xdep.c} file, and be sure @code{@var{ARCH}-xdep.o} is in the @code{XDEPFILES} list.
-If you have your own @code{fetch_core_registers}, you only need to define
-@code{register_addr} if your @code{fetch_core_registers} calls it. Many custom
-@code{fetch_core_registers} implementations simply locate the registers
-themselves.
-@end table
-
-Files needed when the target system is an @var{ARCH} are listed in the file
-@file{tconfig/@var{ARCH}}, in the @code{Makefile} macro @samp{TDEPFILES = }@dots{}. You can also
-define XXXXXX in there.
-
-Similar generic support files for target systems are:
-
-@example
- exec.c, exec.o:
-@end example
-
-This file defines functions for accessing files that are executable
-on the target system. These functions open and examine an exec file,
-extract data from one, write data to one, print information about one,
-etc. Now that executable files are handled with BFD, every architecture
-should be able to use the generic exec.c rather than its own custom code.
-
-@node Host versus Target, , README, Top
-@chapter What is considered ``host-dependent'' versus ``target-dependent''?
-
-The xconfig/*, xm-*.h and *-xdep.c files are for host support. The
-question is, what features or aspects of a debugging or cross-debugging
-environment are considered to be ``host'' support.
-
-Defines and include files needed to build on the host are host support.
-Examples are tty support, system defined types, host byte order, host
-float format.
-
-Unix child process support is considered an aspect of the host. Since
-when you fork on the host you are still on the host, the various macros
-needed for finding the registers in the upage, running ptrace, and such
-are all in the host-dependent files.
-
-This is still somewhat of a grey area; I (John Gilmore) didn't do the
-xm- and tm- split for gdb (it was done by Jim Kingdon) so I have had to
-figure out the grounds on which it was split, and make my own choices
-as I evolve it. I have moved many things out of the xdep files
-actually, partly as a result of BFD and partly by removing duplicated
-code.
-
-@contents
-@bye
-
diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h
deleted file mode 100644
index 39151f5..0000000
--- a/gdb/gdbcmd.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Header file for GDB-specific command-line stuff.
- Copyright (C) 1986, 1989, 1990 Free Software Foundation, Inc.
-
- 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "command.h"
-
-/* Chain containing all defined commands. */
-
-extern struct cmd_list_element *cmdlist;
-
-/* Chain containing all defined info subcommands. */
-
-extern struct cmd_list_element *infolist;
-
-/* Chain containing all defined enable subcommands. */
-
-extern struct cmd_list_element *enablelist;
-
-/* Chain containing all defined disable subcommands. */
-
-extern struct cmd_list_element *disablelist;
-
-/* Chain containing all defined delete subcommands. */
-
-extern struct cmd_list_element *deletelist;
-
-/* Chain containing all defined "enable breakpoint" subcommands. */
-
-extern struct cmd_list_element *enablebreaklist;
-
-/* Chain containing all defined set subcommands */
-
-extern struct cmd_list_element *setlist;
-
-/* Chain containing all defined show subcommands. */
-extern struct cmd_list_element *showlist;
-
-/* Chain containing all defined \"set history\". */
-
-extern struct cmd_list_element *sethistlist;
-
-/* Chain containing all defined \"show history\". */
-extern struct cmd_list_element *showhistlist;
-
-/* Chain containing all defined \"unset history\". */
-
-extern struct cmd_list_element *unsethistlist;
-
-void execute_command ();
-char **noop_completer ();
diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
deleted file mode 100644
index 0be67bb..0000000
--- a/gdb/gdbcore.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Machine independent variables that describe the core file under GDB.
- Copyright (C) 1986, 1987, 1989, 1990 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Interface routines for core, executable, etc. */
-
-#include "bfd.h" /* Binary File Description */
-
-/* Return the name of the executable file as a string.
- ERR nonzero means get error if there is none specified;
- otherwise return 0 in that case. */
-char *get_exec_file ();
-
-/* Nonzero if there is a core file. */
-int have_core_file_p ();
-
-/* Read "memory data" from whatever target or inferior we have.
- Returns zero if successful, errno value if not. EIO is used
- for address out of bounds. If breakpoints are inserted, returns
- shadow contents, not the breakpoints themselves. From breakpoint.c. */
-int read_memory_nobpt ();
-
-/* Report a memory error with error(). */
-
-void memory_error ();
-
-/* Like target_read_memory, but report an error if can't read. */
-void read_memory ();
-
-/* Read an integer from debugged memory, given address and number of bytes. */
-long read_memory_integer ();
-
-void write_memory (
-#ifdef __STDC__
- CORE_ADDR, char *, int
-#endif
- );
-
-/* Hook for `exec_file_command' command to call. */
-
-extern void (*exec_file_display_hook) ();
-
-/* Binary File Diddlers for the exec and core files */
-extern bfd *core_bfd;
-extern bfd *exec_bfd;
-
-void core_file_command ();
-void exec_file_command ();
-void validate_files ();
-unsigned int register_addr ();
-int xfer_core_file ();
-void fetch_core_registers ();
-void registers_fetched ();
-
-#if !defined (KERNEL_U_ADDR)
-extern CORE_ADDR kernel_u_addr;
-#define KERNEL_U_ADDR kernel_u_addr
-#endif
-
-/* Struct section_table maps address ranges to file sections. It is
- mostly used with BFD files, but can be used without (e.g. for handling
- raw disks, or files not in formats handled by BFD). */
-
-struct section_table {
- CORE_ADDR addr; /* Lowest address in section */
- CORE_ADDR endaddr; /* 1+highest address in section */
- sec_ptr sec_ptr; /* BFD section pointer */
-};
-
-/* Builds a section table, given args BFD, SECTABLE_PTR, SECEND_PTR.
- Returns 0 if OK, 1 on error. */
-
-int build_section_table ();
diff --git a/gdb/getpagesize.h b/gdb/getpagesize.h
deleted file mode 100755
index 32adae6..0000000
--- a/gdb/getpagesize.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifdef BSD
-#ifndef BSD4_1
-#define HAVE_GETPAGESIZE
-#endif
-#endif
-
-#ifndef HAVE_GETPAGESIZE
-
-#include <sys/param.h>
-
-#ifdef EXEC_PAGESIZE
-#define getpagesize() EXEC_PAGESIZE
-#else
-#ifdef NBPG
-#define getpagesize() NBPG * CLSIZE
-#ifndef CLSIZE
-#define CLSIZE 1
-#endif /* no CLSIZE */
-#else /* no NBPG */
-#define getpagesize() NBPC
-#endif /* no NBPG */
-#endif /* no EXEC_PAGESIZE */
-
-#endif /* not HAVE_GETPAGESIZE */
-
diff --git a/gdb/gmalloc.c b/gdb/gmalloc.c
deleted file mode 100755
index d533eaa..0000000
--- a/gdb/gmalloc.c
+++ /dev/null
@@ -1,1152 +0,0 @@
-
-/* gmalloc.c - THIS FILE IS AUTOMAGICALLY GENERATED SO DON'T EDIT IT. */
-
-/* Single-file skeleton for GNU malloc.
- Copyright 1989 Free Software Foundation
- Written May 1989 by Mike Haertel.
-
- The author may be reached (Email) at the address mike@ai.mit.edu,
- or (US mail) as Mike Haertel c/o Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define __ONEFILE
-
-/* DO NOT DELETE THIS LINE -- ansidecl.h INSERTED HERE. */
-/* Copyright (C) 1989 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* ANSI and traditional C compatibility macros
-
- ANSI C is assumed if __STDC__ is #defined.
-
- Macros
- PTR - Generic pointer type
- LONG_DOUBLE - `long double' type
- CONST - `const' keyword
- VOLATILE - `volatile' keyword
- SIGNED - `signed' keyword
- PTRCONST - Generic const pointer (void *const)
-
- EXFUN(name, prototype) - declare external function NAME
- with prototype PROTOTYPE
- DEFUN(name, arglist, args) - define function NAME with
- args ARGLIST of types in ARGS
- DEFUN_VOID(name) - define function NAME with no args
- AND - argument separator for ARGS
- NOARGS - null arglist
- DOTS - `...' in args
-
- For example:
- extern int EXFUN(printf, (CONST char *format DOTS));
- int DEFUN(fprintf, (stream, format),
- FILE *stream AND CONST char *format DOTS) { ... }
- void DEFUN_VOID(abort) { ... }
-*/
-
-#ifndef _ANSIDECL_H
-
-#define _ANSIDECL_H 1
-
-
-/* Every source file includes this file,
- so they will all get the switch for lint. */
-/* LINTLIBRARY */
-
-
-#ifdef __STDC__
-
-#define PTR void *
-#define PTRCONST void *CONST
-#define LONG_DOUBLE long double
-
-#define AND ,
-#define NOARGS void
-#define CONST const
-#define VOLATILE volatile
-#define SIGNED signed
-#define DOTS , ...
-
-#define EXFUN(name, proto) name proto
-#define DEFUN(name, arglist, args) name(args)
-#define DEFUN_VOID(name) name(NOARGS)
-
-#else /* Not ANSI C. */
-
-#define PTR char *
-#define PTRCONST PTR
-#define LONG_DOUBLE double
-
-#define AND ;
-#define NOARGS
-#define CONST
-#define VOLATILE
-#define SIGNED
-#define DOTS
-
-#define EXFUN(name, proto) name()
-#define DEFUN(name, arglist, args) name arglist args;
-#define DEFUN_VOID(name) name()
-
-#endif /* ANSI C. */
-
-
-#endif /* ansidecl.h */
-
-#ifdef __STDC__
-#include <limits.h>
-#else
-/* DO NOT DELETE THIS LINE -- limits.h INSERTED HERE. */
-/* Number of bits in a `char'. */
-#define CHAR_BIT 8
-
-/* No multibyte characters supported yet. */
-#define MB_LEN_MAX 1
-
-/* Minimum and maximum values a `signed char' can hold. */
-#define SCHAR_MIN -128
-#define SCHAR_MAX 127
-
-/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
-#define UCHAR_MAX 255U
-
-/* Minimum and maximum values a `char' can hold. */
-#ifdef __CHAR_UNSIGNED__
-#define CHAR_MIN 0
-#define CHAR_MAX 255U
-#else
-#define CHAR_MIN -128
-#define CHAR_MAX 127
-#endif
-
-/* Minimum and maximum values a `signed short int' can hold. */
-#define SHRT_MIN -32768
-#define SHRT_MAX 32767
-
-/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
-#define USHRT_MAX 65535U
-
-/* Minimum and maximum values a `signed int' can hold. */
-#define INT_MIN -2147483648
-#define INT_MAX 2147483647
-
-/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
-#define UINT_MAX 4294967295U
-
-/* Minimum and maximum values a `signed long int' can hold.
- (Same as `int'). */
-#define LONG_MIN (-LONG_MAX-1)
-#define LONG_MAX 2147483647
-
-/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
-#define ULONG_MAX 4294967295U
-#endif
-
-#ifdef __STDC__
-#include <stddef.h>
-#else
-/* DO NOT DELETE THIS LINE -- stddef.h INSERTED HERE. */
-#ifndef _STDDEF_H
-#define _STDDEF_H
-
-/* Signed type of difference of two pointers. */
-
-typedef long ptrdiff_t;
-
-/* Unsigned type of `sizeof' something. */
-
-#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
-#define _SIZE_T
-typedef unsigned long size_t;
-#endif /* _SIZE_T */
-
-/* A null pointer constant. */
-
-#undef NULL /* in case <stdio.h> has defined it. */
-#define NULL 0
-
-/* Offset of member MEMBER in a struct of type TYPE. */
-
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-
-#endif /* _STDDEF_H */
-#endif
-
-/* DO NOT DELETE THIS LINE -- stdlib.h INSERTED HERE. */
-/* Fake stdlib.h supplying the stuff needed by malloc. */
-
-#ifndef __ONEFILE
-#include <stddef.h>
-#endif
-
-extern void EXFUN(abort, (void));
-extern void EXFUN(free, (PTR));
-extern PTR EXFUN(malloc, (size_t));
-extern PTR EXFUN(realloc, (PTR, size_t));
-
-/* DO NOT DELETE THIS LINE -- string.h INSERTED HERE. */
-/* Fake string.h supplying stuff used by malloc. */
-#ifndef __ONEFILE
-#include <stddef.h>
-#endif
-
-extern PTR EXFUN(memcpy, (PTR, CONST PTR, size_t));
-extern PTR EXFUN(memset, (PTR, int, size_t));
-#define memmove memcpy
-
-#define _MALLOC_INTERNAL
-/* DO NOT DELETE THIS LINE -- malloc.h INSERTED HERE. */
-/* Declarations for `malloc' and friends.
- Copyright 1990 Free Software Foundation
- Written May 1989 by Mike Haertel.
-
- The author may be reached (Email) at the address mike@ai.mit.edu,
- or (US mail) as Mike Haertel c/o Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifndef _MALLOC_H
-
-#define _MALLOC_H 1
-
-#ifndef __ONEFILE
-#define __need_NULL
-#define __need_size_t
-#define __need_ptrdiff_t
-#include <stddef.h>
-#endif
-
-#ifdef _MALLOC_INTERNAL
-
-#ifndef __ONEFILE
-#include <limits.h>
-#endif
-
-/* The allocator divides the heap into blocks of fixed size; large
- requests receive one or more whole blocks, and small requests
- receive a fragment of a block. Fragment sizes are powers of two,
- and all fragments of a block are the same size. When all the
- fragments in a block have been freed, the block itself is freed. */
-#define INT_BIT (CHAR_BIT * sizeof(int))
-#define BLOCKLOG (INT_BIT > 16 ? 12 : 9)
-#define BLOCKSIZE (1 << BLOCKLOG)
-#define BLOCKIFY(SIZE) (((SIZE) + BLOCKSIZE - 1) / BLOCKSIZE)
-
-/* Determine the amount of memory spanned by the initial heap table
- (not an absolute limit). */
-#define HEAP (INT_BIT > 16 ? 4194304 : 65536)
-
-/* Number of contiguous free blocks allowed to build up at the end of
- memory before they will be returned to the system. */
-#define FINAL_FREE_BLOCKS 8
-
-/* Where to start searching the free list when looking for new memory.
- The two possible values are 0 and _heapindex. Starting at 0 seems
- to reduce total memory usage, while starting at _heapindex seems to
- run faster. */
-#define MALLOC_SEARCH_START _heapindex
-
-/* Data structure giving per-block information. */
-typedef union
- {
- /* Heap information for a busy block. */
- struct
- {
- /* Zero for a large block, or positive giving the
- logarithm to the base two of the fragment size. */
- int type;
- union
- {
- struct
- {
- size_t nfree; /* Free fragments in a fragmented block. */
- size_t first; /* First free fragment of the block. */
- } frag;
- /* Size (in blocks) of a large cluster. */
- size_t size;
- } info;
- } busy;
- /* Heap information for a free block (that may be the first of
- a free cluster). */
- struct
- {
- size_t size; /* Size (in blocks) of a free cluster. */
- size_t next; /* Index of next free cluster. */
- size_t prev; /* Index of previous free cluster. */
- } free;
- } malloc_info;
-
-/* Pointer to first block of the heap. */
-extern char *_heapbase;
-
-/* Table indexed by block number giving per-block information. */
-extern malloc_info *_heapinfo;
-
-/* Address to block number and vice versa. */
-#define BLOCK(A) (((char *) (A) - _heapbase) / BLOCKSIZE + 1)
-#define ADDRESS(B) ((PTR) (((B) - 1) * BLOCKSIZE + _heapbase))
-
-/* Current search index for the heap table. */
-extern size_t _heapindex;
-
-/* Limit of valid info table indices. */
-extern size_t _heaplimit;
-
-/* Doubly linked lists of free fragments. */
-struct list
- {
- struct list *next;
- struct list *prev;
- };
-
-/* Free list headers for each fragment size. */
-extern struct list _fraghead[];
-
-/* Instrumentation. */
-extern size_t _chunks_used;
-extern size_t _bytes_used;
-extern size_t _chunks_free;
-extern size_t _bytes_free;
-
-/* Internal version of free() used in morecore(). */
-extern void EXFUN(__free, (PTR __ptr));
-
-#endif /* _MALLOC_INTERNAL. */
-
-/* Underlying allocation function; successive calls should
- return contiguous pieces of memory. */
-extern PTR EXFUN((*__morecore), (ptrdiff_t __size));
-
-/* Default value of previous. */
-extern PTR EXFUN(__default_morecore, (ptrdiff_t __size));
-
-/* Flag whether malloc has been called. */
-extern int __malloc_initialized;
-
-/* Hooks for debugging versions. */
-extern void EXFUN((*__free_hook), (PTR __ptr));
-extern PTR EXFUN((*__malloc_hook), (size_t __size));
-extern PTR EXFUN((*__realloc_hook), (PTR __ptr, size_t __size));
-
-/* Activate a standard collection of debugging hooks. */
-extern void EXFUN(mcheck, (void EXFUN((*func), (void))));
-
-/* Statistics available to the user. */
-struct mstats
- {
- size_t bytes_total; /* Total size of the heap. */
- size_t chunks_used; /* Chunks allocated by the user. */
- size_t bytes_used; /* Byte total of user-allocated chunks. */
- size_t chunks_free; /* Chunks in the free list. */
- size_t bytes_free; /* Byte total of chunks in the free list. */
- };
-
-/* Pick up the current statistics. */
-extern struct mstats EXFUN(mstats, (NOARGS));
-
-#endif /* malloc.h */
-
-/* DO NOT DELETE THIS LINE -- free.c INSERTED HERE. */
-/* Free a block of memory allocated by `malloc'.
- Copyright 1990 Free Software Foundation
- Written May 1989 by Mike Haertel.
-
- The author may be reached (Email) at the address mike@ai.mit.edu,
- or (US mail) as Mike Haertel c/o Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifndef __ONEFILE
-#include "ansidecl.h"
-#include <stddef.h>
-#include <stdlib.h>
-
-#define _MALLOC_INTERNAL
-#include "malloc.h"
-#endif /* __ONEFILE */
-
-/* Debugging hook for free. */
-void EXFUN((*__free_hook), (PTR __ptr));
-
-/* Return memory to the heap. Like free() but don't call a __free_hook
- if there is one. */
-void
-DEFUN(__free, (ptr), PTR ptr)
-{
- int type;
- size_t block, blocks;
- register size_t i;
- struct list *prev, *next;
-
- block = BLOCK(ptr);
-
- type = _heapinfo[block].busy.type;
- switch (type)
- {
- case 0:
- /* Get as many statistics as early as we can. */
- --_chunks_used;
- _bytes_used -= _heapinfo[block].busy.info.size * BLOCKSIZE;
- _bytes_free += _heapinfo[block].busy.info.size * BLOCKSIZE;
-
- /* Find the free cluster previous to this one in the free list.
- Start searching at the last block referenced; this may benefit
- programs with locality of allocation. */
- i = _heapindex;
- if (i > block)
- while (i > block)
- i = _heapinfo[i].free.prev;
- else
- {
- do
- i = _heapinfo[i].free.next;
- while (i > 0 && i < block);
- i = _heapinfo[i].free.prev;
- }
-
- /* Determine how to link this block into the free list. */
- if (block == i + _heapinfo[i].free.size)
- {
- /* Coalesce this block with its predecessor. */
- _heapinfo[i].free.size += _heapinfo[block].busy.info.size;
- block = i;
- }
- else
- {
- /* Really link this block back into the free list. */
- _heapinfo[block].free.size = _heapinfo[block].busy.info.size;
- _heapinfo[block].free.next = _heapinfo[i].free.next;
- _heapinfo[block].free.prev = i;
- _heapinfo[i].free.next = block;
- _heapinfo[_heapinfo[block].free.next].free.prev = block;
- ++_chunks_free;
- }
-
- /* Now that the block is linked in, see if we can coalesce it
- with its successor (by deleting its successor from the list
- and adding in its size). */
- if (block + _heapinfo[block].free.size == _heapinfo[block].free.next)
- {
- _heapinfo[block].free.size
- += _heapinfo[_heapinfo[block].free.next].free.size;
- _heapinfo[block].free.next
- = _heapinfo[_heapinfo[block].free.next].free.next;
- _heapinfo[_heapinfo[block].free.next].free.prev = block;
- --_chunks_free;
- }
-
- /* Now see if we can return stuff to the system. */
- blocks = _heapinfo[block].free.size;
- if (blocks >= FINAL_FREE_BLOCKS && block + blocks == _heaplimit
- && (*__morecore)(0) == ADDRESS(block + blocks))
- {
- register size_t bytes = blocks * BLOCKSIZE;
- _heaplimit -= blocks;
- (*__morecore)(- bytes);
- _heapinfo[_heapinfo[block].free.prev].free.next
- = _heapinfo[block].free.next;
- _heapinfo[_heapinfo[block].free.next].free.prev
- = _heapinfo[block].free.prev;
- block = _heapinfo[block].free.prev;
- --_chunks_free;
- _bytes_free -= bytes;
- }
-
- /* Set the next search to begin at this block. */
- _heapindex = block;
- break;
-
- default:
- /* Do some of the statistics. */
- --_chunks_used;
- _bytes_used -= 1 << type;
- ++_chunks_free;
- _bytes_free += 1 << type;
-
- /* Get the address of the first free fragment in this block. */
- prev = (struct list *) ((char *) ADDRESS(block) +
- (_heapinfo[block].busy.info.frag.first << type));
-
- if (_heapinfo[block].busy.info.frag.nfree == (BLOCKSIZE >> type) - 1)
- {
- /* If all fragments of this block are free, remove them
- from the fragment list and free the whole block. */
- next = prev;
- for (i = 1; i < BLOCKSIZE >> type; ++i)
- next = next->next;
- prev->prev->next = next;
- if (next != NULL)
- next->prev = prev->prev;
- _heapinfo[block].busy.type = 0;
- _heapinfo[block].busy.info.size = 1;
-
- /* Keep the statistics accurate. */
- ++_chunks_used;
- _bytes_used += BLOCKSIZE;
- _chunks_free -= BLOCKSIZE >> type;
- _bytes_free -= BLOCKSIZE;
-
- free(ADDRESS(block));
- }
- else if (_heapinfo[block].busy.info.frag.nfree != 0)
- {
- /* If some fragments of this block are free, link this
- fragment into the fragment list after the first free
- fragment of this block. */
- next = (struct list *) ptr;
- next->next = prev->next;
- next->prev = prev;
- prev->next = next;
- if (next->next != NULL)
- next->next->prev = next;
- ++_heapinfo[block].busy.info.frag.nfree;
- }
- else
- {
- /* No fragments of this block are free, so link this
- fragment into the fragment list and announce that
- it is the first free fragment of this block. */
- prev = (struct list *) ptr;
- _heapinfo[block].busy.info.frag.nfree = 1;
- _heapinfo[block].busy.info.frag.first = (unsigned int)
- (((char *) ptr - (char *) NULL) % BLOCKSIZE >> type);
- prev->next = _fraghead[type].next;
- prev->prev = &_fraghead[type];
- prev->prev->next = prev;
- if (prev->next != NULL)
- prev->next->prev = prev;
- }
- break;
- }
-}
-
-/* Return memory to the heap. */
-void
-DEFUN(free, (ptr), PTR ptr)
-{
- if (ptr == NULL)
- return;
-
- if (__free_hook != NULL)
- (*__free_hook)(ptr);
- else
- __free (ptr);
-}
-
-/* DO NOT DELETE THIS LINE -- malloc.c INSERTED HERE. */
-/* Memory allocator `malloc'.
- Copyright 1990 Free Software Foundation
- Written May 1989 by Mike Haertel.
-
- The author may be reached (Email) at the address mike@ai.mit.edu,
- or (US mail) as Mike Haertel c/o Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifndef __ONEFILE
-#include "ansidecl.h"
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define _MALLOC_INTERNAL
-#include "malloc.h"
-#endif /* __ONEFILE */
-
-/* How to really get more memory. */
-PTR EXFUN((*__morecore), (ptrdiff_t __size)) = __default_morecore;
-
-/* Debugging hook for `malloc'. */
-PTR EXFUN((*__malloc_hook), (size_t __size));
-
-/* Pointer to the base of the first block. */
-char *_heapbase;
-
-/* Block information table. Allocated with align/__free (not malloc/free). */
-malloc_info *_heapinfo;
-
-/* Number of info entries. */
-static size_t heapsize;
-
-/* Search index in the info table. */
-size_t _heapindex;
-
-/* Limit of valid info table indices. */
-size_t _heaplimit;
-
-/* Free lists for each fragment size. */
-struct list _fraghead[BLOCKLOG];
-
-/* Instrumentation. */
-size_t _chunks_used;
-size_t _bytes_used;
-size_t _chunks_free;
-size_t _bytes_free;
-
-/* Are you experienced? */
-int __malloc_initialized;
-
-/* Aligned allocation. */
-static PTR
-DEFUN(align, (size), size_t size)
-{
- PTR result;
- unsigned int adj;
-
- result = (*__morecore)(size);
- adj = (unsigned int) ((char *) result - (char *) NULL) % BLOCKSIZE;
- if (adj != 0)
- {
- adj = BLOCKSIZE - adj;
- (void) (*__morecore)(adj);
- result = (char *) result + adj;
- }
- return result;
-}
-
-/* Set everything up and remember that we have. */
-static int
-DEFUN_VOID(initialize)
-{
- heapsize = HEAP / BLOCKSIZE;
- _heapinfo = (malloc_info *) align(heapsize * sizeof(malloc_info));
- if (_heapinfo == NULL)
- return 0;
- memset(_heapinfo, 0, heapsize * sizeof(malloc_info));
- _heapinfo[0].free.size = 0;
- _heapinfo[0].free.next = _heapinfo[0].free.prev = 0;
- _heapindex = 0;
- _heapbase = (char *) _heapinfo;
- __malloc_initialized = 1;
- return 1;
-}
-
-/* Get neatly aligned memory, initializing or
- growing the heap info table as necessary. */
-static PTR
-DEFUN(morecore, (size), size_t size)
-{
- PTR result;
- malloc_info *newinfo, *oldinfo;
- size_t newsize;
-
- result = align(size);
- if (result == NULL)
- return NULL;
-
- /* Check if we need to grow the info table. */
- if (BLOCK((char *) result + size) > heapsize)
- {
- newsize = heapsize;
- while (BLOCK((char *) result + size) > newsize)
- newsize *= 2;
- newinfo = (malloc_info *) align(newsize * sizeof(malloc_info));
- if (newinfo == NULL)
- {
- (*__morecore)(- size);
- return NULL;
- }
- memset(newinfo, 0, newsize * sizeof(malloc_info));
- memcpy(newinfo, _heapinfo, heapsize * sizeof(malloc_info));
- oldinfo = _heapinfo;
- newinfo[BLOCK(oldinfo)].busy.type = 0;
- newinfo[BLOCK(oldinfo)].busy.info.size
- = BLOCKIFY(heapsize * sizeof(malloc_info));
- _heapinfo = newinfo;
- __free(oldinfo);
- heapsize = newsize;
- }
-
- _heaplimit = BLOCK((char *) result + size);
- return result;
-}
-
-/* Allocate memory from the heap. */
-PTR
-DEFUN(malloc, (size), size_t size)
-{
- PTR result;
- size_t block, blocks, lastblocks, start;
- register size_t i;
- struct list *next;
-
- if (size == 0)
- return NULL;
-
- if (__malloc_hook != NULL)
- return (*__malloc_hook)(size);
-
- if (!__malloc_initialized)
- if (!initialize())
- return NULL;
-
- if (size < sizeof(struct list))
- size = sizeof(struct list);
-
- /* Determine the allocation policy based on the request size. */
- if (size <= BLOCKSIZE / 2)
- {
- /* Small allocation to receive a fragment of a block.
- Determine the logarithm to base two of the fragment size. */
- register size_t log = 1;
- --size;
- while ((size /= 2) != 0)
- ++log;
-
- /* Look in the fragment lists for a
- free fragment of the desired size. */
- next = _fraghead[log].next;
- if (next != NULL)
- {
- /* There are free fragments of this size.
- Pop a fragment out of the fragment list and return it.
- Update the block's nfree and first counters. */
- result = (PTR) next;
- next->prev->next = next->next;
- if (next->next != NULL)
- next->next->prev = next->prev;
- block = BLOCK(result);
- if (--_heapinfo[block].busy.info.frag.nfree != 0)
- _heapinfo[block].busy.info.frag.first = (unsigned int)
- (((char *) next->next - (char *) NULL) % BLOCKSIZE) >> log;
-
- /* Update the statistics. */
- ++_chunks_used;
- _bytes_used += 1 << log;
- --_chunks_free;
- _bytes_free -= 1 << log;
- }
- else
- {
- /* No free fragments of the desired size, so get a new block
- and break it into fragments, returning the first. */
- result = malloc(BLOCKSIZE);
- if (result == NULL)
- return NULL;
-
- /* Link all fragments but the first into the free list. */
- for (i = 1; i < BLOCKSIZE >> log; ++i)
- {
- next = (struct list *) ((char *) result + (i << log));
- next->next = _fraghead[log].next;
- next->prev = &_fraghead[log];
- next->prev->next = next;
- if (next->next != NULL)
- next->next->prev = next;
- }
-
- /* Initialize the nfree and first counters for this block. */
- block = BLOCK(result);
- _heapinfo[block].busy.type = log;
- _heapinfo[block].busy.info.frag.nfree = i - 1;
- _heapinfo[block].busy.info.frag.first = i - 1;
-
- _chunks_free += (BLOCKSIZE >> log) - 1;
- _bytes_free += BLOCKSIZE - (1 << log);
- }
- }
- else
- {
- /* Large allocation to receive one or more blocks.
- Search the free list in a circle starting at the last place visited.
- If we loop completely around without finding a large enough
- space we will have to get more memory from the system. */
- blocks = BLOCKIFY(size);
- start = block = MALLOC_SEARCH_START;
- while (_heapinfo[block].free.size < blocks)
- {
- block = _heapinfo[block].free.next;
- if (block == start)
- {
- /* Need to get more from the system. Check to see if
- the new core will be contiguous with the final free
- block; if so we don't need to get as much. */
- block = _heapinfo[0].free.prev;
- lastblocks = _heapinfo[block].free.size;
- if (_heaplimit != 0 && block + lastblocks == _heaplimit &&
- (*__morecore)(0) == ADDRESS(block + lastblocks) &&
- (morecore((blocks - lastblocks) * BLOCKSIZE)) != NULL)
- {
- _heapinfo[block].free.size = blocks;
- _bytes_free += (blocks - lastblocks) * BLOCKSIZE;
- continue;
- }
- result = morecore(blocks * BLOCKSIZE);
- if (result == NULL)
- return NULL;
- block = BLOCK(result);
- _heapinfo[block].busy.type = 0;
- _heapinfo[block].busy.info.size = blocks;
- ++_chunks_used;
- _bytes_used += blocks * BLOCKSIZE;
- return result;
- }
- }
-
- /* At this point we have found a suitable free list entry.
- Figure out how to remove what we need from the list. */
- result = ADDRESS(block);
- if (_heapinfo[block].free.size > blocks)
- {
- /* The block we found has a bit left over,
- so relink the tail end back into the free list. */
- _heapinfo[block + blocks].free.size
- = _heapinfo[block].free.size - blocks;
- _heapinfo[block + blocks].free.next
- = _heapinfo[block].free.next;
- _heapinfo[block + blocks].free.prev
- = _heapinfo[block].free.prev;
- _heapinfo[_heapinfo[block].free.prev].free.next
- = _heapinfo[_heapinfo[block].free.next].free.prev
- = _heapindex = block + blocks;
- }
- else
- {
- /* The block exactly matches our requirements,
- so just remove it from the list. */
- _heapinfo[_heapinfo[block].free.next].free.prev
- = _heapinfo[block].free.prev;
- _heapinfo[_heapinfo[block].free.prev].free.next
- = _heapindex = _heapinfo[block].free.next;
- --_chunks_free;
- }
-
- _heapinfo[block].busy.type = 0;
- _heapinfo[block].busy.info.size = blocks;
- ++_chunks_used;
- _bytes_used += blocks * BLOCKSIZE;
- _bytes_free -= blocks * BLOCKSIZE;
- }
-
- return result;
-}
-
-/* DO NOT DELETE THIS LINE -- realloc.c INSERTED HERE. */
-/* Change the size of a block allocated by `malloc'.
- Copyright 1990 Free Software Foundation
- Written May 1989 by Mike Haertel.
-
- The author may be reached (Email) at the address mike@ai.mit.edu,
- or (US mail) as Mike Haertel c/o Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifndef __ONEFILE
-#include "ansidecl.h"
-#include <stdlib.h>
-#include <string.h>
-
-#define _MALLOC_INTERNAL
-#include "malloc.h"
-#endif /* __ONEFILE */
-
-#define MIN(A, B) ((A) < (B) ? (A) : (B))
-
-/* Debugging hook for realloc. */
-PTR EXFUN((*__realloc_hook), (PTR __ptr, size_t __size));
-
-/* Resize the given region to the new size, returning a pointer
- to the (possibly moved) region. This is optimized for speed;
- some benchmarks seem to indicate that greater compactness is
- achieved by unconditionally allocating and copying to a
- new region. This module has incestuous knowledge of the
- internals of both free and malloc. */
-PTR
-DEFUN(realloc, (ptr, size), PTR ptr AND size_t size)
-{
- PTR result;
- int type;
- size_t block, blocks, oldlimit;
-
- if (size == 0)
- {
- free(ptr);
- return NULL;
- }
- else if (ptr == NULL)
- return malloc(size);
-
- if (__realloc_hook != NULL)
- return (*__realloc_hook)(ptr, size);
-
- block = BLOCK(ptr);
-
- type = _heapinfo[block].busy.type;
- switch (type)
- {
- case 0:
- /* Maybe reallocate a large block to a small fragment. */
- if (size <= BLOCKSIZE / 2)
- {
- result = malloc(size);
- if (result != NULL)
- {
- memcpy(result, ptr, size);
- free(ptr);
- return result;
- }
- }
-
- /* The new size is a large allocation as well;
- see if we can hold it in place. */
- blocks = BLOCKIFY(size);
- if (blocks < _heapinfo[block].busy.info.size)
- {
- /* The new size is smaller; return
- excess memory to the free list. */
- _heapinfo[block + blocks].busy.type = 0;
- _heapinfo[block + blocks].busy.info.size
- = _heapinfo[block].busy.info.size - blocks;
- _heapinfo[block].busy.info.size = blocks;
- free(ADDRESS(block + blocks));
- result = ptr;
- }
- else if (blocks == _heapinfo[block].busy.info.size)
- /* No size change necessary. */
- result = ptr;
- else
- {
- /* Won't fit, so allocate a new region that will.
- Free the old region first in case there is sufficient
- adjacent free space to grow without moving. */
- blocks = _heapinfo[block].busy.info.size;
- /* Prevent free from actually returning memory to the system. */
- oldlimit = _heaplimit;
- _heaplimit = 0;
- free(ptr);
- _heaplimit = oldlimit;
- result = malloc(size);
- if (result == NULL)
- {
- (void) malloc(blocks * BLOCKSIZE);
- return NULL;
- }
- if (ptr != result)
- memmove(result, ptr, blocks * BLOCKSIZE);
- }
- break;
-
- default:
- /* Old size is a fragment; type is logarithm
- to base two of the fragment size. */
- if (size > 1 << (type - 1) && size <= 1 << type)
- /* The new size is the same kind of fragment. */
- result = ptr;
- else
- {
- /* The new size is different; allocate a new space,
- and copy the lesser of the new size and the old. */
- result = malloc(size);
- if (result == NULL)
- return NULL;
- memcpy(result, ptr, MIN(size, 1 << type));
- free(ptr);
- }
- break;
- }
-
- return result;
-}
-
-/* DO NOT DELETE THIS LINE -- unix.c INSERTED HERE. */
-/* unix.c - get more memory with a UNIX system call.
- Copyright 1990 Free Software Foundation
- Written May 1989 by Mike Haertel.
-
- The author may be reached (Email) at the address mike@ai.mit.edu,
- or (US mail) as Mike Haertel c/o Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifndef __ONEFILE
-#include "ansidecl.h"
-#include <stddef.h>
-
-#define _MALLOC_INTERNAL
-#include "malloc.h"
-#endif /* __ONEFILE */
-
-extern PTR EXFUN(sbrk, (ptrdiff_t size));
-
-PTR
-DEFUN(__default_morecore, (size), ptrdiff_t size)
-{
- PTR result;
-
- result = sbrk(size);
- if (result == (PTR) -1)
- return NULL;
- return result;
-}
-
-#define __getpagesize getpagesize
-/* DO NOT DELETE THIS LINE -- valloc.c INSERTED HERE. */
-/* Allocate memory on a page boundary.
- Copyright 1990 Free Software Foundation
- Written May 1989 by Mike Haertel.
-
- The author may be reached (Email) at the address mike@ai.mit.edu,
- or (US mail) as Mike Haertel c/o Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifndef __ONEFILE
-#include "ansidecl.h"
-#include <stdlib.h>
-#endif /* __ONEFILE */
-
-#if defined(M_UNIX)
-/*
- * M_UNIX is defined by the SCO compilers, including the port of gcc.
- */
-
-/* On SunOS 4.1.1, <sys/param.h> typedefs size_t, which is bad since
- we typedef it above. Maybe it's better just to have people compile
- -Dgetpagesize()=4096. */
-/* Deal with page size. */
-#ifndef HAVE_GETPAGESIZE
-
-#include <sys/param.h>
-
-#if !defined (PAGESIZE)
-#ifdef EXEC_PAGESIZE
-#define PAGESIZE EXEC_PAGESIZE
-#else
-#ifdef NBPG
-#define PAGESIZE NBPG * CLSIZE
-#ifndef CLSIZE
-#define CLSIZE 1
-#endif /* no CLSIZE */
-#else /* no NBPG */
-#define PAGESIZE NBPC
-#endif /* no NBPG */
-#endif /* no EXEC_PAGESIZE */
-#endif /* no PAGESIZE */
-
-size_t
-DEFUN_VOID(__getpagesize)
-{
- return PAGESIZE;
-}
-#endif /* not HAVE_GETPAGESIZE */
-#endif /* M_UNIX */
-
-extern size_t EXFUN(__getpagesize, (NOARGS));
-
-static size_t pagesize;
-
-PTR
-DEFUN(valloc, (size), size_t size)
-{
- PTR result;
- unsigned int adj;
-
- if (pagesize == 0)
- pagesize = __getpagesize();
-
- result = malloc(size + pagesize);
- if (result == NULL)
- return NULL;
- adj = (unsigned int) ((char *) result - (char *) NULL) % pagesize;
- if (adj != 0)
- result = (char *) result + pagesize - adj;
- return result;
-}
diff --git a/gdb/gmalloc.h b/gdb/gmalloc.h
deleted file mode 100755
index 93fef5e..0000000
--- a/gdb/gmalloc.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* Declarations for `malloc' and friends.
- Copyright 1990 Free Software Foundation
- Written May 1989 by Mike Haertel.
-
- The author may be reached (Email) at the address mike@ai.mit.edu,
- or (US mail) as Mike Haertel c/o Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifndef _MALLOC_H
-
-#define _MALLOC_H 1
-
-#ifndef __ONEFILE
-#define __need_NULL
-#define __need_size_t
-#define __need_ptrdiff_t
-#include <stddef.h>
-#endif
-
-#ifdef _MALLOC_INTERNAL
-
-#ifndef __ONEFILE
-#include <limits.h>
-#endif
-
-/* The allocator divides the heap into blocks of fixed size; large
- requests receive one or more whole blocks, and small requests
- receive a fragment of a block. Fragment sizes are powers of two,
- and all fragments of a block are the same size. When all the
- fragments in a block have been freed, the block itself is freed. */
-#define INT_BIT (CHAR_BIT * sizeof(int))
-#define BLOCKLOG (INT_BIT > 16 ? 12 : 9)
-#define BLOCKSIZE (1 << BLOCKLOG)
-#define BLOCKIFY(SIZE) (((SIZE) + BLOCKSIZE - 1) / BLOCKSIZE)
-
-/* Determine the amount of memory spanned by the initial heap table
- (not an absolute limit). */
-#define HEAP (INT_BIT > 16 ? 4194304 : 65536)
-
-/* Number of contiguous free blocks allowed to build up at the end of
- memory before they will be returned to the system. */
-#define FINAL_FREE_BLOCKS 8
-
-/* Where to start searching the free list when looking for new memory.
- The two possible values are 0 and _heapindex. Starting at 0 seems
- to reduce total memory usage, while starting at _heapindex seems to
- run faster. */
-#define MALLOC_SEARCH_START _heapindex
-
-/* Data structure giving per-block information. */
-typedef union
- {
- /* Heap information for a busy block. */
- struct
- {
- /* Zero for a large block, or positive giving the
- logarithm to the base two of the fragment size. */
- int type;
- union
- {
- struct
- {
- size_t nfree; /* Free fragments in a fragmented block. */
- size_t first; /* First free fragment of the block. */
- } frag;
- /* Size (in blocks) of a large cluster. */
- size_t size;
- } info;
- } busy;
- /* Heap information for a free block (that may be the first of
- a free cluster). */
- struct
- {
- size_t size; /* Size (in blocks) of a free cluster. */
- size_t next; /* Index of next free cluster. */
- size_t prev; /* Index of previous free cluster. */
- } free;
- } malloc_info;
-
-/* Pointer to first block of the heap. */
-extern char *_heapbase;
-
-/* Table indexed by block number giving per-block information. */
-extern malloc_info *_heapinfo;
-
-/* Address to block number and vice versa. */
-#define BLOCK(A) (((char *) (A) - _heapbase) / BLOCKSIZE + 1)
-#define ADDRESS(B) ((PTR) (((B) - 1) * BLOCKSIZE + _heapbase))
-
-/* Current search index for the heap table. */
-extern size_t _heapindex;
-
-/* Limit of valid info table indices. */
-extern size_t _heaplimit;
-
-/* Doubly linked lists of free fragments. */
-struct list
- {
- struct list *next;
- struct list *prev;
- };
-
-/* Free list headers for each fragment size. */
-extern struct list _fraghead[];
-
-/* Instrumentation. */
-extern size_t _chunks_used;
-extern size_t _bytes_used;
-extern size_t _chunks_free;
-extern size_t _bytes_free;
-
-/* Internal version of free() used in morecore(). */
-extern void EXFUN(__free, (PTR __ptr));
-
-#endif /* _MALLOC_INTERNAL. */
-
-/* Underlying allocation function; successive calls should
- return contiguous pieces of memory. */
-extern PTR EXFUN((*__morecore), (ptrdiff_t __size));
-
-/* Default value of previous. */
-extern PTR EXFUN(__default_morecore, (ptrdiff_t __size));
-
-/* Flag whether malloc has been called. */
-extern int __malloc_initialized;
-
-/* Hooks for debugging versions. */
-extern void EXFUN((*__free_hook), (PTR __ptr));
-extern PTR EXFUN((*__malloc_hook), (size_t __size));
-extern PTR EXFUN((*__realloc_hook), (PTR __ptr, size_t __size));
-
-/* Activate a standard collection of debugging hooks. */
-extern void EXFUN(mcheck, (void EXFUN((*func), (void))));
-
-/* Statistics available to the user. */
-struct mstats
- {
- size_t bytes_total; /* Total size of the heap. */
- size_t chunks_used; /* Chunks allocated by the user. */
- size_t bytes_used; /* Byte total of user-allocated chunks. */
- size_t chunks_free; /* Chunks in the free list. */
- size_t bytes_free; /* Byte total of chunks in the free list. */
- };
-
-/* Pick up the current statistics. */
-extern struct mstats EXFUN(mstats, (NOARGS));
-
-#endif /* malloc.h */
diff --git a/gdb/gould-pinsn.c b/gdb/gould-pinsn.c
deleted file mode 100644
index 0ad9f3e..0000000
--- a/gdb/gould-pinsn.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/* Print GOULD RISC instructions for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "gdbcore.h"
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#if defined GOULD_PN
-#include "pn-opcode.h"
-#else
-#include "np1-opcode.h"
-#endif
-
-/* GOULD RISC instructions are never longer than this many bytes. */
-#define MAXLEN 4
-
-/* Number of elements in the opcode table. */
-#define NOPCODES (sizeof gld_opcodes / sizeof gld_opcodes[0])
-
-
-/* Print the GOULD instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned char buffer[MAXLEN];
- register int i;
- register char *d;
- register int bestmask;
- unsigned best;
- int temp, index, bestlen;
-
- read_memory (memaddr, buffer, MAXLEN);
-
- bestmask = 0;
- index = -1;
- best = 0xffffffff;
- for (i = 0; i < NOPCODES; i++)
- {
- register unsigned int opcode = gld_opcodes[i].opcode;
- register unsigned int mask = gld_opcodes[i].mask;
- register unsigned int len = gld_opcodes[i].length;
- register unsigned int test;
-
- /* Get possible opcode bytes into integer */
- test = buffer[0] << 24;
- test |= buffer[1] << 16;
- test |= buffer[2] << 8;
- test |= buffer[3];
-
- /* Mask with opcode and see if match */
- if ((opcode & mask) == (test & mask))
- {
- /* See if second or third match */
- if (index >= 0)
- {
- /* Take new one if it looks good */
- if (bestlen == MAXLEN && len == MAXLEN)
- {
- /* See if lower bits matched */
- if (((bestmask & 3) == 0) &&
- ((mask & 3) != 0))
- {
- bestmask = mask;
- bestlen = len;
- best = test;
- index = i;
- }
- }
- }
- else
- {
- /* First match, save it */
- bestmask = mask;
- bestlen = len;
- best = test;
- index = i;
- }
- }
- }
-
- /* Handle undefined instructions. */
- if (index < 0)
- {
- fprintf (stream, "undefined 0%o",(buffer[0]<<8)+buffer[1]);
- return 2;
- }
-
- /* Print instruction name */
- fprintf (stream, "%-12s", gld_opcodes[index].name);
-
- /* Adjust if short instruction */
- if (gld_opcodes[index].length < 4)
- {
- best >>= 16;
- i = 0;
- }
- else
- {
- i = 16;
- }
-
- /* Dump out instruction arguments */
- for (d = gld_opcodes[index].args; *d; ++d)
- {
- switch (*d)
- {
- case 'f':
- fprintf (stream, "%d", (best >> (7 + i)) & 7);
- break;
- case 'r':
- fprintf (stream, "r%d", (best >> (7 + i)) & 7);
- break;
- case 'R':
- fprintf (stream, "r%d", (best >> (4 + i)) & 7);
- break;
- case 'b':
- fprintf (stream, "b%d", (best >> (7 + i)) & 7);
- break;
- case 'B':
- fprintf (stream, "b%d", (best >> (4 + i)) & 7);
- break;
- case 'v':
- fprintf (stream, "b%d", (best >> (7 + i)) & 7);
- break;
- case 'V':
- fprintf (stream, "b%d", (best >> (4 + i)) & 7);
- break;
- case 'X':
- temp = (best >> 20) & 7;
- if (temp)
- fprintf (stream, "r%d", temp);
- else
- putc ('0', stream);
- break;
- case 'A':
- temp = (best >> 16) & 7;
- if (temp)
- fprintf (stream, "(b%d)", temp);
- break;
- case 'S':
- fprintf (stream, "#%d", best & 0x1f);
- break;
- case 'I':
- fprintf (stream, "#%x", best & 0xffff);
- break;
- case 'O':
- fprintf (stream, "%x", best & 0xffff);
- break;
- case 'h':
- fprintf (stream, "%d", best & 0xfffe);
- break;
- case 'd':
- fprintf (stream, "%d", best & 0xfffc);
- break;
- case 'T':
- fprintf (stream, "%d", (best >> 8) & 0xff);
- break;
- case 'N':
- fprintf (stream, "%d", best & 0xff);
- break;
- default:
- putc (*d, stream);
- break;
- }
- }
-
- /* Return length of instruction */
- return (gld_opcodes[index].length);
-}
-
-/*
- * Find the number of arguments to a function.
- */
-findarg(frame)
- struct frame_info *frame;
-{
- register struct symbol *func;
- register unsigned pc;
-
-#ifdef notdef
- /* find starting address of frame function */
- pc = get_pc_function_start (frame->pc);
-
- /* find function symbol info */
- func = find_pc_function (pc);
-
- /* call blockframe code to look for match */
- if (func != NULL)
- return (func->value.block->nsyms / sizeof(int));
-#endif
-
- return (-1);
-}
-
-/*
- * In the case of the NPL, the frame's norminal address is Br2 and the
- * previous routines frame is up the stack X bytes. Finding out what
- * 'X' is can be tricky.
- *
- * 1.) stored in the code function header xA(Br1).
- * 2.) must be careful of recurssion.
- */
-FRAME_ADDR
-findframe(thisframe)
- FRAME thisframe;
-{
- register FRAME_ADDR pointer;
- FRAME_ADDR framechain();
-#if 0
- struct frame_info *frame;
-
- /* Setup toplevel frame structure */
- frame->pc = read_pc();
- frame->next_frame = 0;
- frame->frame = read_register (SP_REGNUM); /* Br2 */
-
- /* Search for this frame (start at current Br2) */
- do
- {
- pointer = framechain(frame);
- frame->next_frame = frame->frame;
- frame->frame = pointer;
- frame->pc = FRAME_SAVED_PC(frame);
- }
- while (frame->next_frame != thisframe);
-#endif
-
- pointer = framechain (thisframe);
-
- /* stop gap for now, end at __base3 */
- if (thisframe->pc == 0)
- return 0;
-
- return pointer;
-}
-
-/*
- * Gdb front-end and internal framechain routine.
- * Go back up stack one level. Tricky...
- */
-FRAME_ADDR
-framechain(frame)
- register struct frame_info *frame;
-{
- register CORE_ADDR func, prevsp;
- register unsigned value;
-
- /* Get real function start address from internal frame address */
- func = get_pc_function_start(frame->pc);
-
- /* If no stack given, read register Br1 "(sp)" */
- if (!frame->frame)
- prevsp = read_register (SP_REGNUM);
- else
- prevsp = frame->frame;
-
- /* Check function header, case #2 */
- value = read_memory_integer (func, 4);
- if (value)
- {
- /* 32bit call push value stored in function header */
- prevsp += value;
- }
- else
- {
- /* read half-word from suabr at start of function */
- prevsp += read_memory_integer (func + 10, 2);
- }
-
- return (prevsp);
-}
diff --git a/gdb/gould-xdep.c b/gdb/gould-xdep.c
deleted file mode 100644
index bd6276d..0000000
--- a/gdb/gould-xdep.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Low level interface to ptrace, for GDB when running under Unix.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include "gdbcore.h"
-
-#include <sys/file.h>
-#include <sys/stat.h>
-
-/* Work with core dump and executable files, for GDB.
- This code would be in core.c if it weren't machine-dependent. */
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- extern char registers[];
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
- /* 4.2-style (and perhaps also sysV-style) core dump file. */
- {
- struct user u;
- int reg_offset;
-
- val = myread (corechan, &u, sizeof u);
- if (val < 0)
- perror_with_name (filename);
- data_start = exec_data_start;
-
- data_end = data_start + NBPG * u.u_dsize;
- stack_start = stack_end - NBPG * u.u_ssize;
- data_offset = NBPG * UPAGES;
- stack_offset = NBPG * (UPAGES + u.u_dsize);
- reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
-
- /* I don't know where to find this info.
- So, for now, mark it as not available. */
- core_aouthdr.a_magic = 0;
-
- /* Read the register values out of the core file and store
- them where `read_register' will find them. */
-
- {
- register int regno;
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- char buf[MAX_REGISTER_RAW_SIZE];
-
- val = lseek (corechan, register_addr (regno, reg_offset), 0);
- if (val < 0)
- perror_with_name (filename);
-
- val = myread (corechan, buf, sizeof buf);
- if (val < 0)
- perror_with_name (filename);
- supply_register (regno, buf);
- }
- }
- }
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- {
- corefile = concat (current_directory, "/", filename, NULL);
- }
-
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- select_frame (get_current_frame (), 0);
- validate_files ();
- }
- else if (from_tty)
- printf ("No core file now.\n");
-}
diff --git a/gdb/hp300hpux-xdep.c b/gdb/hp300hpux-xdep.c
deleted file mode 100755
index f7f1cf0..0000000
--- a/gdb/hp300hpux-xdep.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* HP/UX interface for HP 300's, for GDB when running under Unix.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-
-/* Defining this means some system include files define some extra stuff. */
-#define WOPR
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/ptrace.h>
-#include <sys/reg.h>
-#include <sys/trap.h>
-
-#include "gdbcore.h"
-
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#define INFERIOR_AR0(u) \
- ((ptrace \
- (PT_RUAREA, inferior_pid, ((char *) &u.u_ar0 - (char *) &u), 0)) \
- - KERNEL_U_ADDR)
-
-static void
-fetch_inferior_register (regno, regaddr)
- register int regno;
- register unsigned int regaddr;
-{
-#ifndef HPUX_VERSION_5
- if (regno == PS_REGNUM)
- {
- union { int i; short s[2]; } ps_val;
- int regval;
-
- ps_val.i = (ptrace (PT_RUAREA, inferior_pid, regaddr, 0));
- regval = ps_val.s[0];
- supply_register (regno, &regval);
- }
- else
-#endif /* not HPUX_VERSION_5 */
- {
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
-
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- *(int *) &buf[i] = ptrace (PT_RUAREA, inferior_pid, regaddr, 0);
- regaddr += sizeof (int);
- }
- supply_register (regno, buf);
- }
- return;
-}
-
-static void
-store_inferior_register_1 (regno, regaddr, value)
- int regno;
- unsigned int regaddr;
- int value;
-{
- errno = 0;
- ptrace (PT_WUAREA, inferior_pid, regaddr, value);
-#if 0
- /* HP-UX randomly sets errno to non-zero for regno == 25.
- However, the value is correctly written, so ignore errno. */
- if (errno != 0)
- {
- char string_buf[64];
-
- sprintf (string_buf, "writing register number %d", regno);
- perror_with_name (string_buf);
- }
-#endif
- return;
-}
-
-static void
-store_inferior_register (regno, regaddr)
- register int regno;
- register unsigned int regaddr;
-{
-#ifndef HPUX_VERSION_5
- if (regno == PS_REGNUM)
- {
- union { int i; short s[2]; } ps_val;
-
- ps_val.i = (ptrace (PT_RUAREA, inferior_pid, regaddr, 0));
- ps_val.s[0] = (read_register (regno));
- store_inferior_register_1 (regno, regaddr, ps_val.i);
- }
- else
-#endif /* not HPUX_VERSION_5 */
- {
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
- extern char registers[];
-
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- store_inferior_register_1
- (regno, regaddr,
- (*(int *) &registers[(REGISTER_BYTE (regno)) + i]));
- regaddr += sizeof (int);
- }
- }
- return;
-}
-
-void
-fetch_inferior_registers (regno)
- int regno;
-{
- struct user u;
- register int regno;
- register unsigned int ar0_offset;
-
- ar0_offset = (INFERIOR_AR0 (u));
- if (regno == -1)
- {
- for (regno = 0; (regno < FP0_REGNUM); regno++)
- fetch_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno)));
- for (; (regno < NUM_REGS); regno++)
- fetch_inferior_register (regno, (FP_REGISTER_ADDR (u, regno)));
- }
- else
- fetch_inferior_register (regno,
- (regno < FP0_REGNUM
- ? REGISTER_ADDR (ar0_offset, regno)
- : FP_REGISTER_ADDR (u, regno)));
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- register int regno;
-{
- struct user u;
- register unsigned int ar0_offset;
- extern char registers[];
-
- if (regno >= FP0_REGNUM)
- {
- store_inferior_register (regno, (FP_REGISTER_ADDR (u, regno)));
- return;
- }
-
- ar0_offset = (INFERIOR_AR0 (u));
- if (regno >= 0)
- {
- store_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno)));
- return;
- }
-
- for (regno = 0; (regno < FP0_REGNUM); regno++)
- store_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno)));
- for (; (regno < NUM_REGS); regno++)
- store_inferior_register (regno, (FP_REGISTER_ADDR (u, regno)));
- return;
-}
-
-
-/* Take the register values out of a core file and store
- them where `read_register' will find them. */
-
-#ifdef HPUX_VERSION_5
-#define e_PS e_regs[PS]
-#define e_PC e_regs[PC]
-#endif /* HPUX_VERSION_5 */
-
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
- char *core_reg_sect;
- int core_reg_size;
- int which;
-{
- int val, regno;
- struct user u;
- struct exception_stack *pes = (struct exception_stack *) core_reg_sect;
-#define es (*pes)
- char *buf;
-
- if (which == 0) {
- if (core_reg_size <
- ((char *) &es.e_offset - (char *) &es.e_regs[R0]))
- error ("Not enough registers in core file");
- for (regno = 0; (regno < PS_REGNUM); regno++)
- supply_register (regno, &es.e_regs[regno + R0]);
- val = es.e_PS;
- supply_register (regno++, &val);
- supply_register (regno++, &es.e_PC);
-
- } else if (which == 2) {
-
- /* FIXME: This may not work if the float regs and control regs are
- discontinuous. */
- for (regno = FP0_REGNUM, buf = core_reg_sect;
- (regno < NUM_REGS);
- buf += REGISTER_RAW_SIZE (regno), regno++)
- {
- supply_register (regno, buf);
- }
- }
-}
diff --git a/gdb/hp300ux-xdep.c b/gdb/hp300ux-xdep.c
deleted file mode 100644
index 7b2c12b..0000000
--- a/gdb/hp300ux-xdep.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* HP/UX interface for HP 300's, for GDB when running under Unix.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-
-/* Defining this means some system include files define some extra stuff. */
-#define WOPR
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/ptrace.h>
-#include <sys/reg.h>
-#include <sys/trap.h>
-
-#include "gdbcore.h"
-
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#define INFERIOR_AR0(u) \
- ((ptrace \
- (PT_RUAREA, inferior_pid, ((char *) &u.u_ar0 - (char *) &u), 0)) \
- - KERNEL_U_ADDR)
-
-static void
-fetch_inferior_register (regno, regaddr)
- register int regno;
- register unsigned int regaddr;
-{
-#ifndef HPUX_VERSION_5
- if (regno == PS_REGNUM)
- {
- union { int i; short s[2]; } ps_val;
- int regval;
-
- ps_val.i = (ptrace (PT_RUAREA, inferior_pid, regaddr, 0));
- regval = ps_val.s[0];
- supply_register (regno, &regval);
- }
- else
-#endif /* not HPUX_VERSION_5 */
- {
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
-
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- *(int *) &buf[i] = ptrace (PT_RUAREA, inferior_pid, regaddr, 0);
- regaddr += sizeof (int);
- }
- supply_register (regno, buf);
- }
- return;
-}
-
-static void
-store_inferior_register_1 (regno, regaddr, value)
- int regno;
- unsigned int regaddr;
- int value;
-{
- errno = 0;
- ptrace (PT_WUAREA, inferior_pid, regaddr, value);
-#if 0
- /* HP-UX randomly sets errno to non-zero for regno == 25.
- However, the value is correctly written, so ignore errno. */
- if (errno != 0)
- {
- char string_buf[64];
-
- sprintf (string_buf, "writing register number %d", regno);
- perror_with_name (string_buf);
- }
-#endif
- return;
-}
-
-static void
-store_inferior_register (regno, regaddr)
- register int regno;
- register unsigned int regaddr;
-{
-#ifndef HPUX_VERSION_5
- if (regno == PS_REGNUM)
- {
- union { int i; short s[2]; } ps_val;
-
- ps_val.i = (ptrace (PT_RUAREA, inferior_pid, regaddr, 0));
- ps_val.s[0] = (read_register (regno));
- store_inferior_register_1 (regno, regaddr, ps_val.i);
- }
- else
-#endif /* not HPUX_VERSION_5 */
- {
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
- extern char registers[];
-
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- store_inferior_register_1
- (regno, regaddr,
- (*(int *) &registers[(REGISTER_BYTE (regno)) + i]));
- regaddr += sizeof (int);
- }
- }
- return;
-}
-
-void
-fetch_inferior_registers (regno)
- int regno;
-{
- struct user u;
- register int regno;
- register unsigned int ar0_offset;
-
- ar0_offset = (INFERIOR_AR0 (u));
- if (regno == -1)
- {
- for (regno = 0; (regno < FP0_REGNUM); regno++)
- fetch_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno)));
- for (; (regno < NUM_REGS); regno++)
- fetch_inferior_register (regno, (FP_REGISTER_ADDR (u, regno)));
- }
- else
- fetch_inferior_register (regno,
- (regno < FP0_REGNUM
- ? REGISTER_ADDR (ar0_offset, regno)
- : FP_REGISTER_ADDR (u, regno)));
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- register int regno;
-{
- struct user u;
- register unsigned int ar0_offset;
- extern char registers[];
-
- if (regno >= FP0_REGNUM)
- {
- store_inferior_register (regno, (FP_REGISTER_ADDR (u, regno)));
- return;
- }
-
- ar0_offset = (INFERIOR_AR0 (u));
- if (regno >= 0)
- {
- store_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno)));
- return;
- }
-
- for (regno = 0; (regno < FP0_REGNUM); regno++)
- store_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno)));
- for (; (regno < NUM_REGS); regno++)
- store_inferior_register (regno, (FP_REGISTER_ADDR (u, regno)));
- return;
-}
-
-
-/* Take the register values out of a core file and store
- them where `read_register' will find them. */
-
-#ifdef HPUX_VERSION_5
-#define e_PS e_regs[PS]
-#define e_PC e_regs[PC]
-#endif /* HPUX_VERSION_5 */
-
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
- char *core_reg_sect;
- int core_reg_size;
- int which;
-{
- int val, regno;
- struct user u;
- struct exception_stack *pes = (struct exception_stack *) core_reg_sect;
-#define es (*pes)
- char *buf;
-
- if (which == 0) {
- if (core_reg_size <
- ((char *) &es.e_offset - (char *) &es.e_regs[R0]))
- error ("Not enough registers in core file");
- for (regno = 0; (regno < PS_REGNUM); regno++)
- supply_register (regno, &es.e_regs[regno + R0]);
- val = es.e_PS;
- supply_register (regno++, &val);
- supply_register (regno++, &es.e_PC);
-
- } else if (which == 2) {
-
- /* FIXME: This may not work if the float regs and control regs are
- discontinuous. */
- for (regno = FP0_REGNUM, buf = core_reg_sect;
- (regno < NUM_REGS);
- buf += REGISTER_RAW_SIZE (regno), regno++)
- {
- supply_register (regno, buf);
- }
- }
-}
diff --git a/gdb/i386-pinsn.c b/gdb/i386-pinsn.c
deleted file mode 100644
index 88b171a..0000000
--- a/gdb/i386-pinsn.c
+++ /dev/null
@@ -1,1831 +0,0 @@
-/* Print i386 instructions for GDB, the GNU debugger.
- Copyright (C) 1988, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
- * July 1988
- */
-
-/*
- * The main tables describing the instructions is essentially a copy
- * of the "Opcode Map" chapter (Appendix A) of the Intel 80386
- * Programmers Manual. Usually, there is a capital letter, followed
- * by a small letter. The capital letter tell the addressing mode,
- * and the small letter tells about the operand size. Refer to
- * the Intel manual for details.
- */
-
-#include <stdio.h>
-#include <ctype.h>
-
-/* For the GDB interface at the bottom of the file... */
-#include "defs.h"
-#include "param.h"
-#include "gdbcore.h"
-
-#define Eb OP_E, b_mode
-#define indirEb OP_indirE, b_mode
-#define Gb OP_G, b_mode
-#define Ev OP_E, v_mode
-#define indirEv OP_indirE, v_mode
-#define Ew OP_E, w_mode
-#define Ma OP_E, v_mode
-#define M OP_E, 0
-#define Mp OP_E, 0 /* ? */
-#define Gv OP_G, v_mode
-#define Gw OP_G, w_mode
-#define Rw OP_rm, w_mode
-#define Rd OP_rm, d_mode
-#define Ib OP_I, b_mode
-#define sIb OP_sI, b_mode /* sign extened byte */
-#define Iv OP_I, v_mode
-#define Iw OP_I, w_mode
-#define Jb OP_J, b_mode
-#define Jv OP_J, v_mode
-#define ONE OP_ONE, 0
-#define Cd OP_C, d_mode
-#define Dd OP_D, d_mode
-#define Td OP_T, d_mode
-
-#define eAX OP_REG, eAX_reg
-#define eBX OP_REG, eBX_reg
-#define eCX OP_REG, eCX_reg
-#define eDX OP_REG, eDX_reg
-#define eSP OP_REG, eSP_reg
-#define eBP OP_REG, eBP_reg
-#define eSI OP_REG, eSI_reg
-#define eDI OP_REG, eDI_reg
-#define AL OP_REG, al_reg
-#define CL OP_REG, cl_reg
-#define DL OP_REG, dl_reg
-#define BL OP_REG, bl_reg
-#define AH OP_REG, ah_reg
-#define CH OP_REG, ch_reg
-#define DH OP_REG, dh_reg
-#define BH OP_REG, bh_reg
-#define AX OP_REG, ax_reg
-#define DX OP_REG, dx_reg
-#define indirDX OP_REG, indir_dx_reg
-
-#define Sw OP_SEG, w_mode
-#define Ap OP_DIR, lptr
-#define Av OP_DIR, v_mode
-#define Ob OP_OFF, b_mode
-#define Ov OP_OFF, v_mode
-#define Xb OP_DSSI, b_mode
-#define Xv OP_DSSI, v_mode
-#define Yb OP_ESDI, b_mode
-#define Yv OP_ESDI, v_mode
-
-#define es OP_REG, es_reg
-#define ss OP_REG, ss_reg
-#define cs OP_REG, cs_reg
-#define ds OP_REG, ds_reg
-#define fs OP_REG, fs_reg
-#define gs OP_REG, gs_reg
-
-int OP_E(), OP_indirE(), OP_G(), OP_I(), OP_sI(), OP_REG();
-int OP_J(), OP_SEG();
-int OP_DIR(), OP_OFF(), OP_DSSI(), OP_ESDI(), OP_ONE(), OP_C();
-int OP_D(), OP_T(), OP_rm();
-
-
-#define b_mode 1
-#define v_mode 2
-#define w_mode 3
-#define d_mode 4
-
-#define es_reg 100
-#define cs_reg 101
-#define ss_reg 102
-#define ds_reg 103
-#define fs_reg 104
-#define gs_reg 105
-#define eAX_reg 107
-#define eCX_reg 108
-#define eDX_reg 109
-#define eBX_reg 110
-#define eSP_reg 111
-#define eBP_reg 112
-#define eSI_reg 113
-#define eDI_reg 114
-
-#define lptr 115
-
-#define al_reg 116
-#define cl_reg 117
-#define dl_reg 118
-#define bl_reg 119
-#define ah_reg 120
-#define ch_reg 121
-#define dh_reg 122
-#define bh_reg 123
-
-#define ax_reg 124
-#define cx_reg 125
-#define dx_reg 126
-#define bx_reg 127
-#define sp_reg 128
-#define bp_reg 129
-#define si_reg 130
-#define di_reg 131
-
-#define indir_dx_reg 150
-
-#define GRP1b NULL, NULL, 0
-#define GRP1S NULL, NULL, 1
-#define GRP1Ss NULL, NULL, 2
-#define GRP2b NULL, NULL, 3
-#define GRP2S NULL, NULL, 4
-#define GRP2b_one NULL, NULL, 5
-#define GRP2S_one NULL, NULL, 6
-#define GRP2b_cl NULL, NULL, 7
-#define GRP2S_cl NULL, NULL, 8
-#define GRP3b NULL, NULL, 9
-#define GRP3S NULL, NULL, 10
-#define GRP4 NULL, NULL, 11
-#define GRP5 NULL, NULL, 12
-#define GRP6 NULL, NULL, 13
-#define GRP7 NULL, NULL, 14
-#define GRP8 NULL, NULL, 15
-
-#define FLOATCODE 50
-#define FLOAT NULL, NULL, FLOATCODE
-
-struct dis386 {
- char *name;
- int (*op1)();
- int bytemode1;
- int (*op2)();
- int bytemode2;
- int (*op3)();
- int bytemode3;
-};
-
-struct dis386 dis386[] = {
- /* 00 */
- { "addb", Eb, Gb },
- { "addS", Ev, Gv },
- { "addb", Gb, Eb },
- { "addS", Gv, Ev },
- { "addb", AL, Ib },
- { "addS", eAX, Iv },
- { "pushl", es },
- { "popl", es },
- /* 08 */
- { "orb", Eb, Gb },
- { "orS", Ev, Gv },
- { "orb", Gb, Eb },
- { "orS", Gv, Ev },
- { "orb", AL, Ib },
- { "orS", eAX, Iv },
- { "pushl", cs },
- { "(bad)" }, /* 0x0f extended opcode escape */
- /* 10 */
- { "adcb", Eb, Gb },
- { "adcS", Ev, Gv },
- { "adcb", Gb, Eb },
- { "adcS", Gv, Ev },
- { "adcb", AL, Ib },
- { "adcS", eAX, Iv },
- { "pushl", ss },
- { "popl", ss },
- /* 18 */
- { "sbbb", Eb, Gb },
- { "sbbS", Ev, Gv },
- { "sbbb", Gb, Eb },
- { "sbbS", Gv, Ev },
- { "sbbb", AL, Ib },
- { "sbbS", eAX, Iv },
- { "pushl", ds },
- { "popl", ds },
- /* 20 */
- { "andb", Eb, Gb },
- { "andS", Ev, Gv },
- { "andb", Gb, Eb },
- { "andS", Gv, Ev },
- { "andb", AL, Ib },
- { "andS", eAX, Iv },
- { "(bad)" }, /* SEG ES prefix */
- { "daa" },
- /* 28 */
- { "subb", Eb, Gb },
- { "subS", Ev, Gv },
- { "subb", Gb, Eb },
- { "subS", Gv, Ev },
- { "subb", AL, Ib },
- { "subS", eAX, Iv },
- { "(bad)" }, /* SEG CS prefix */
- { "das" },
- /* 30 */
- { "xorb", Eb, Gb },
- { "xorS", Ev, Gv },
- { "xorb", Gb, Eb },
- { "xorS", Gv, Ev },
- { "xorb", AL, Ib },
- { "xorS", eAX, Iv },
- { "(bad)" }, /* SEG SS prefix */
- { "aaa" },
- /* 38 */
- { "cmpb", Eb, Gb },
- { "cmpS", Ev, Gv },
- { "cmpb", Gb, Eb },
- { "cmpS", Gv, Ev },
- { "cmpb", AL, Ib },
- { "cmpS", eAX, Iv },
- { "(bad)" }, /* SEG DS prefix */
- { "aas" },
- /* 40 */
- { "incS", eAX },
- { "incS", eCX },
- { "incS", eDX },
- { "incS", eBX },
- { "incS", eSP },
- { "incS", eBP },
- { "incS", eSI },
- { "incS", eDI },
- /* 48 */
- { "decS", eAX },
- { "decS", eCX },
- { "decS", eDX },
- { "decS", eBX },
- { "decS", eSP },
- { "decS", eBP },
- { "decS", eSI },
- { "decS", eDI },
- /* 50 */
- { "pushS", eAX },
- { "pushS", eCX },
- { "pushS", eDX },
- { "pushS", eBX },
- { "pushS", eSP },
- { "pushS", eBP },
- { "pushS", eSI },
- { "pushS", eDI },
- /* 58 */
- { "popS", eAX },
- { "popS", eCX },
- { "popS", eDX },
- { "popS", eBX },
- { "popS", eSP },
- { "popS", eBP },
- { "popS", eSI },
- { "popS", eDI },
- /* 60 */
- { "pusha" },
- { "popa" },
- { "boundS", Gv, Ma },
- { "arpl", Ew, Gw },
- { "(bad)" }, /* seg fs */
- { "(bad)" }, /* seg gs */
- { "(bad)" }, /* op size prefix */
- { "(bad)" }, /* adr size prefix */
- /* 68 */
- { "pushS", Iv }, /* 386 book wrong */
- { "imulS", Gv, Ev, Iv },
- { "pushl", sIb }, /* push of byte really pushes 4 bytes */
- { "imulS", Gv, Ev, Ib },
- { "insb", Yb, indirDX },
- { "insS", Yv, indirDX },
- { "outsb", indirDX, Xb },
- { "outsS", indirDX, Xv },
- /* 70 */
- { "jo", Jb },
- { "jno", Jb },
- { "jb", Jb },
- { "jae", Jb },
- { "je", Jb },
- { "jne", Jb },
- { "jbe", Jb },
- { "ja", Jb },
- /* 78 */
- { "js", Jb },
- { "jns", Jb },
- { "jp", Jb },
- { "jnp", Jb },
- { "jl", Jb },
- { "jnl", Jb },
- { "jle", Jb },
- { "jg", Jb },
- /* 80 */
- { GRP1b },
- { GRP1S },
- { "(bad)" },
- { GRP1Ss },
- { "testb", Eb, Gb },
- { "testS", Ev, Gv },
- { "xchgb", Eb, Gb },
- { "xchgS", Ev, Gv },
- /* 88 */
- { "movb", Eb, Gb },
- { "movS", Ev, Gv },
- { "movb", Gb, Eb },
- { "movS", Gv, Ev },
- { "movw", Ew, Sw },
- { "leaS", Gv, M },
- { "movw", Sw, Ew },
- { "popS", Ev },
- /* 90 */
- { "nop" },
- { "xchgS", eCX, eAX },
- { "xchgS", eDX, eAX },
- { "xchgS", eBX, eAX },
- { "xchgS", eSP, eAX },
- { "xchgS", eBP, eAX },
- { "xchgS", eSI, eAX },
- { "xchgS", eDI, eAX },
- /* 98 */
- { "cwtl" },
- { "cltd" },
- { "lcall", Ap },
- { "(bad)" }, /* fwait */
- { "pushf" },
- { "popf" },
- { "sahf" },
- { "lahf" },
- /* a0 */
- { "movb", AL, Ob },
- { "movS", eAX, Ov },
- { "movb", Ob, AL },
- { "movS", Ov, eAX },
- { "movsb", Yb, Xb },
- { "movsS", Yv, Xv },
- { "cmpsb", Yb, Xb },
- { "cmpsS", Yv, Xv },
- /* a8 */
- { "testb", AL, Ib },
- { "testS", eAX, Iv },
- { "stosb", Yb, AL },
- { "stosS", Yv, eAX },
- { "lodsb", AL, Xb },
- { "lodsS", eAX, Xv },
- { "scasb", AL, Xb },
- { "scasS", eAX, Xv },
- /* b0 */
- { "movb", AL, Ib },
- { "movb", CL, Ib },
- { "movb", DL, Ib },
- { "movb", BL, Ib },
- { "movb", AH, Ib },
- { "movb", CH, Ib },
- { "movb", DH, Ib },
- { "movb", BH, Ib },
- /* b8 */
- { "movS", eAX, Iv },
- { "movS", eCX, Iv },
- { "movS", eDX, Iv },
- { "movS", eBX, Iv },
- { "movS", eSP, Iv },
- { "movS", eBP, Iv },
- { "movS", eSI, Iv },
- { "movS", eDI, Iv },
- /* c0 */
- { GRP2b },
- { GRP2S },
- { "ret", Iw },
- { "ret" },
- { "lesS", Gv, Mp },
- { "ldsS", Gv, Mp },
- { "movb", Eb, Ib },
- { "movS", Ev, Iv },
- /* c8 */
- { "enter", Iw, Ib },
- { "leave" },
- { "lret", Iw },
- { "lret" },
- { "int3" },
- { "int", Ib },
- { "into" },
- { "iret" },
- /* d0 */
- { GRP2b_one },
- { GRP2S_one },
- { GRP2b_cl },
- { GRP2S_cl },
- { "aam", Ib },
- { "aad", Ib },
- { "(bad)" },
- { "xlat" },
- /* d8 */
- { FLOAT },
- { FLOAT },
- { FLOAT },
- { FLOAT },
- { FLOAT },
- { FLOAT },
- { FLOAT },
- { FLOAT },
- /* e0 */
- { "loopne", Jb },
- { "loope", Jb },
- { "loop", Jb },
- { "jCcxz", Jb },
- { "inb", AL, Ib },
- { "inS", eAX, Ib },
- { "outb", Ib, AL },
- { "outS", Ib, eAX },
- /* e8 */
- { "call", Av },
- { "jmp", Jv },
- { "ljmp", Ap },
- { "jmp", Jb },
- { "inb", AL, indirDX },
- { "inS", eAX, indirDX },
- { "outb", indirDX, AL },
- { "outS", indirDX, eAX },
- /* f0 */
- { "(bad)" }, /* lock prefix */
- { "(bad)" },
- { "(bad)" }, /* repne */
- { "(bad)" }, /* repz */
- { "hlt" },
- { "cmc" },
- { GRP3b },
- { GRP3S },
- /* f8 */
- { "clc" },
- { "stc" },
- { "cli" },
- { "sti" },
- { "cld" },
- { "std" },
- { GRP4 },
- { GRP5 },
-};
-
-struct dis386 dis386_twobyte[] = {
- /* 00 */
- { GRP6 },
- { GRP7 },
- { "larS", Gv, Ew },
- { "lslS", Gv, Ew },
- { "(bad)" },
- { "(bad)" },
- { "clts" },
- { "(bad)" },
- /* 08 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 10 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 18 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 20 */
- /* these are all backward in appendix A of the intel book */
- { "movl", Rd, Cd },
- { "movl", Rd, Dd },
- { "movl", Cd, Rd },
- { "movl", Dd, Rd },
- { "movl", Rd, Td },
- { "(bad)" },
- { "movl", Td, Rd },
- { "(bad)" },
- /* 28 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 30 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 38 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 40 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 48 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 50 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 58 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 60 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 68 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 70 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 78 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* 80 */
- { "jo", Jv },
- { "jno", Jv },
- { "jb", Jv },
- { "jae", Jv },
- { "je", Jv },
- { "jne", Jv },
- { "jbe", Jv },
- { "ja", Jv },
- /* 88 */
- { "js", Jv },
- { "jns", Jv },
- { "jp", Jv },
- { "jnp", Jv },
- { "jl", Jv },
- { "jge", Jv },
- { "jle", Jv },
- { "jg", Jv },
- /* 90 */
- { "seto", Eb },
- { "setno", Eb },
- { "setb", Eb },
- { "setae", Eb },
- { "sete", Eb },
- { "setne", Eb },
- { "setbe", Eb },
- { "seta", Eb },
- /* 98 */
- { "sets", Eb },
- { "setns", Eb },
- { "setp", Eb },
- { "setnp", Eb },
- { "setl", Eb },
- { "setge", Eb },
- { "setle", Eb },
- { "setg", Eb },
- /* a0 */
- { "pushl", fs },
- { "popl", fs },
- { "(bad)" },
- { "btS", Ev, Gv },
- { "shldS", Ev, Gv, Ib },
- { "shldS", Ev, Gv, CL },
- { "(bad)" },
- { "(bad)" },
- /* a8 */
- { "pushl", gs },
- { "popl", gs },
- { "(bad)" },
- { "btsS", Ev, Gv },
- { "shrdS", Ev, Gv, Ib },
- { "shrdS", Ev, Gv, CL },
- { "(bad)" },
- { "imulS", Gv, Ev },
- /* b0 */
- { "(bad)" },
- { "(bad)" },
- { "lssS", Gv, Mp }, /* 386 lists only Mp */
- { "btrS", Ev, Gv },
- { "lfsS", Gv, Mp }, /* 386 lists only Mp */
- { "lgsS", Gv, Mp }, /* 386 lists only Mp */
- { "movzbS", Gv, Eb },
- { "movzwS", Gv, Ew },
- /* b8 */
- { "(bad)" },
- { "(bad)" },
- { GRP8 },
- { "btcS", Ev, Gv },
- { "bsfS", Gv, Ev },
- { "bsrS", Gv, Ev },
- { "movsbS", Gv, Eb },
- { "movswS", Gv, Ew },
- /* c0 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* c8 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* d0 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* d8 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* e0 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* e8 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* f0 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- /* f8 */
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
- { "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
-};
-
-static char obuf[100];
-static char *obufp;
-static char scratchbuf[100];
-static unsigned char *start_codep;
-static unsigned char *codep;
-static int mod;
-static int rm;
-static int reg;
-static void oappend ();
-
-static char *names32[]={
- "%eax","%ecx","%edx","%ebx", "%esp","%ebp","%esi","%edi",
-};
-static char *names16[] = {
- "%ax","%cx","%dx","%bx","%sp","%bp","%si","%di",
-};
-static char *names8[] = {
- "%al","%cl","%dl","%bl","%ah","%ch","%dh","%bh",
-};
-static char *names_seg[] = {
- "%es","%cs","%ss","%ds","%fs","%gs","%?","%?",
-};
-
-struct dis386 grps[][8] = {
- /* GRP1b */
- {
- { "addb", Eb, Ib },
- { "orb", Eb, Ib },
- { "adcb", Eb, Ib },
- { "sbbb", Eb, Ib },
- { "andb", Eb, Ib },
- { "subb", Eb, Ib },
- { "xorb", Eb, Ib },
- { "cmpb", Eb, Ib }
- },
- /* GRP1S */
- {
- { "addS", Ev, Iv },
- { "orS", Ev, Iv },
- { "adcS", Ev, Iv },
- { "sbbS", Ev, Iv },
- { "andS", Ev, Iv },
- { "subS", Ev, Iv },
- { "xorS", Ev, Iv },
- { "cmpS", Ev, Iv }
- },
- /* GRP1Ss */
- {
- { "addS", Ev, sIb },
- { "orS", Ev, sIb },
- { "adcS", Ev, sIb },
- { "sbbS", Ev, sIb },
- { "andS", Ev, sIb },
- { "subS", Ev, sIb },
- { "xorS", Ev, sIb },
- { "cmpS", Ev, sIb }
- },
- /* GRP2b */
- {
- { "rolb", Eb, Ib },
- { "rorb", Eb, Ib },
- { "rclb", Eb, Ib },
- { "rcrb", Eb, Ib },
- { "shlb", Eb, Ib },
- { "shrb", Eb, Ib },
- { "(bad)" },
- { "sarb", Eb, Ib },
- },
- /* GRP2S */
- {
- { "rolS", Ev, Ib },
- { "rorS", Ev, Ib },
- { "rclS", Ev, Ib },
- { "rcrS", Ev, Ib },
- { "shlS", Ev, Ib },
- { "shrS", Ev, Ib },
- { "(bad)" },
- { "sarS", Ev, Ib },
- },
- /* GRP2b_one */
- {
- { "rolb", Eb },
- { "rorb", Eb },
- { "rclb", Eb },
- { "rcrb", Eb },
- { "shlb", Eb },
- { "shrb", Eb },
- { "(bad)" },
- { "sarb", Eb },
- },
- /* GRP2S_one */
- {
- { "rolS", Ev },
- { "rorS", Ev },
- { "rclS", Ev },
- { "rcrS", Ev },
- { "shlS", Ev },
- { "shrS", Ev },
- { "(bad)" },
- { "sarS", Ev },
- },
- /* GRP2b_cl */
- {
- { "rolb", Eb, CL },
- { "rorb", Eb, CL },
- { "rclb", Eb, CL },
- { "rcrb", Eb, CL },
- { "shlb", Eb, CL },
- { "shrb", Eb, CL },
- { "(bad)" },
- { "sarb", Eb, CL },
- },
- /* GRP2S_cl */
- {
- { "rolS", Ev, CL },
- { "rorS", Ev, CL },
- { "rclS", Ev, CL },
- { "rcrS", Ev, CL },
- { "shlS", Ev, CL },
- { "shrS", Ev, CL },
- { "(bad)" },
- { "sarS", Ev, CL }
- },
- /* GRP3b */
- {
- { "testb", Eb, Ib },
- { "(bad)", Eb },
- { "notb", Eb },
- { "negb", Eb },
- { "mulb", AL, Eb },
- { "imulb", AL, Eb },
- { "divb", AL, Eb },
- { "idivb", AL, Eb }
- },
- /* GRP3S */
- {
- { "testS", Ev, Iv },
- { "(bad)" },
- { "notS", Ev },
- { "negS", Ev },
- { "mulS", eAX, Ev },
- { "imulS", eAX, Ev },
- { "divS", eAX, Ev },
- { "idivS", eAX, Ev },
- },
- /* GRP4 */
- {
- { "incb", Eb },
- { "decb", Eb },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- },
- /* GRP5 */
- {
- { "incS", Ev },
- { "decS", Ev },
- { "call", indirEv },
- { "lcall", indirEv },
- { "jmp", indirEv },
- { "ljmp", indirEv },
- { "pushS", Ev },
- { "(bad)" },
- },
- /* GRP6 */
- {
- { "sldt", Ew },
- { "str", Ew },
- { "lldt", Ew },
- { "ltr", Ew },
- { "verr", Ew },
- { "verw", Ew },
- { "(bad)" },
- { "(bad)" }
- },
- /* GRP7 */
- {
- { "sgdt", Ew },
- { "sidt", Ew },
- { "lgdt", Ew },
- { "lidt", Ew },
- { "smsw", Ew },
- { "(bad)" },
- { "lmsw", Ew },
- { "(bad)" },
- },
- /* GRP8 */
- {
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "btS", Ev, Ib },
- { "btsS", Ev, Ib },
- { "btrS", Ev, Ib },
- { "btcS", Ev, Ib },
- }
-};
-
-#define PREFIX_REPZ 1
-#define PREFIX_REPNZ 2
-#define PREFIX_LOCK 4
-#define PREFIX_CS 8
-#define PREFIX_SS 0x10
-#define PREFIX_DS 0x20
-#define PREFIX_ES 0x40
-#define PREFIX_FS 0x80
-#define PREFIX_GS 0x100
-#define PREFIX_DATA 0x200
-#define PREFIX_ADR 0x400
-#define PREFIX_FWAIT 0x800
-
-static int prefixes;
-
-ckprefix ()
-{
- prefixes = 0;
- while (1)
- {
- switch (*codep)
- {
- case 0xf3:
- prefixes |= PREFIX_REPZ;
- break;
- case 0xf2:
- prefixes |= PREFIX_REPNZ;
- break;
- case 0xf0:
- prefixes |= PREFIX_LOCK;
- break;
- case 0x2e:
- prefixes |= PREFIX_CS;
- break;
- case 0x36:
- prefixes |= PREFIX_SS;
- break;
- case 0x3e:
- prefixes |= PREFIX_DS;
- break;
- case 0x26:
- prefixes |= PREFIX_ES;
- break;
- case 0x64:
- prefixes |= PREFIX_FS;
- break;
- case 0x65:
- prefixes |= PREFIX_GS;
- break;
- case 0x66:
- prefixes |= PREFIX_DATA;
- break;
- case 0x67:
- prefixes |= PREFIX_ADR;
- break;
- case 0x9b:
- prefixes |= PREFIX_FWAIT;
- break;
- default:
- return;
- }
- codep++;
- }
-}
-
-static int dflag;
-static int aflag;
-
-static char op1out[100], op2out[100], op3out[100];
-static int op_address[3], op_ad, op_index[3];
-static int start_pc;
-extern void fputs_filtered ();
-
-/*
- * disassemble the first instruction in 'inbuf'. You have to make
- * sure all of the bytes of the instruction are filled in.
- * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
- * (see topic "Redundant prefixes" in the "Differences from 8086"
- * section of the "Virtual 8086 Mode" chapter.)
- * 'pc' should be the address of this instruction, it will
- * be used to print the target address if this is a relative jump or call
- * 'outbuf' gets filled in with the disassembled instruction. it should
- * be long enough to hold the longest disassembled instruction.
- * 100 bytes is certainly enough, unless symbol printing is added later
- * The function returns the length of this instruction in bytes.
- */
-i386dis (pc, inbuf, stream)
- int pc;
- unsigned char *inbuf;
- FILE *stream;
-{
- struct dis386 *dp;
- char *p;
- int i;
- int enter_instruction;
- char *first, *second, *third;
- int needcomma;
-
- obuf[0] = 0;
- op1out[0] = 0;
- op2out[0] = 0;
- op3out[0] = 0;
-
- op_index[0] = op_index[1] = op_index[2] = -1;
-
- start_pc = pc;
- start_codep = inbuf;
- codep = inbuf;
-
- ckprefix ();
-
- if (*codep == 0xc8)
- enter_instruction = 1;
- else
- enter_instruction = 0;
-
- obufp = obuf;
-
- if (prefixes & PREFIX_REPZ)
- oappend ("repz ");
- if (prefixes & PREFIX_REPNZ)
- oappend ("repnz ");
- if (prefixes & PREFIX_LOCK)
- oappend ("lock ");
-
- if ((prefixes & PREFIX_FWAIT)
- && ((*codep < 0xd8) || (*codep > 0xdf)))
- {
- /* fwait not followed by floating point instruction */
- fputs_filtered ("fwait", stream);
- return (1);
- }
-
- /* these would be initialized to 0 if disassembling for 8086 or 286 */
- dflag = 1;
- aflag = 1;
-
- if (prefixes & PREFIX_DATA)
- dflag ^= 1;
-
- if (prefixes & PREFIX_ADR)
- {
- aflag ^= 1;
- oappend ("addr16 ");
- }
-
- if (*codep == 0x0f)
- dp = &dis386_twobyte[*++codep];
- else
- dp = &dis386[*codep];
- codep++;
- mod = (*codep >> 6) & 3;
- reg = (*codep >> 3) & 7;
- rm = *codep & 7;
-
- if (dp->name == NULL && dp->bytemode1 == FLOATCODE)
- {
- dofloat ();
- }
- else
- {
- if (dp->name == NULL)
- dp = &grps[dp->bytemode1][reg];
-
- putop (dp->name);
-
- obufp = op1out;
- op_ad = 2;
- if (dp->op1)
- (*dp->op1)(dp->bytemode1);
-
- obufp = op2out;
- op_ad = 1;
- if (dp->op2)
- (*dp->op2)(dp->bytemode2);
-
- obufp = op3out;
- op_ad = 0;
- if (dp->op3)
- (*dp->op3)(dp->bytemode3);
- }
-
- obufp = obuf + strlen (obuf);
- for (i = strlen (obuf); i < 6; i++)
- oappend (" ");
- oappend (" ");
- fputs_filtered (obuf, stream);
-
- /* enter instruction is printed with operands in the
- * same order as the intel book; everything else
- * is printed in reverse order
- */
- if (enter_instruction)
- {
- first = op1out;
- second = op2out;
- third = op3out;
- op_ad = op_index[0];
- op_index[0] = op_index[2];
- op_index[2] = op_ad;
- }
- else
- {
- first = op3out;
- second = op2out;
- third = op1out;
- }
- needcomma = 0;
- if (*first)
- {
- if (op_index[0] != -1)
- print_address (op_address[op_index[0]], stream);
- else
- fputs_filtered (first, stream);
- needcomma = 1;
- }
- if (*second)
- {
- if (needcomma)
- fputs_filtered (",", stream);
- if (op_index[1] != -1)
- print_address (op_address[op_index[1]], stream);
- else
- fputs_filtered (second, stream);
- needcomma = 1;
- }
- if (*third)
- {
- if (needcomma)
- fputs_filtered (",", stream);
- if (op_index[2] != -1)
- print_address (op_address[op_index[2]], stream);
- else
- fputs_filtered (third, stream);
- }
- return (codep - inbuf);
-}
-
-char *float_mem[] = {
- /* d8 */
- "fadds",
- "fmuls",
- "fcoms",
- "fcomps",
- "fsubs",
- "fsubrs",
- "fdivs",
- "fdivrs",
- /* d9 */
- "flds",
- "(bad)",
- "fsts",
- "fstps",
- "fldenv",
- "fldcw",
- "fNstenv",
- "fNstcw",
- /* da */
- "fiaddl",
- "fimull",
- "ficoml",
- "ficompl",
- "fisubl",
- "fisubrl",
- "fidivl",
- "fidivrl",
- /* db */
- "fildl",
- "(bad)",
- "fistl",
- "fistpl",
- "(bad)",
- "fldt",
- "(bad)",
- "fstpt",
- /* dc */
- "faddl",
- "fmull",
- "fcoml",
- "fcompl",
- "fsubl",
- "fsubrl",
- "fdivl",
- "fdivrl",
- /* dd */
- "fldl",
- "(bad)",
- "fstl",
- "fstpl",
- "frstor",
- "(bad)",
- "fNsave",
- "fNstsw",
- /* de */
- "fiadd",
- "fimul",
- "ficom",
- "ficomp",
- "fisub",
- "fisubr",
- "fidiv",
- "fidivr",
- /* df */
- "fild",
- "(bad)",
- "fist",
- "fistp",
- "fbld",
- "fildll",
- "fbstp",
- "fistpll",
-};
-
-#define ST OP_ST, 0
-#define STi OP_STi, 0
-int OP_ST(), OP_STi();
-
-#define FGRPd9_2 NULL, NULL, 0
-#define FGRPd9_4 NULL, NULL, 1
-#define FGRPd9_5 NULL, NULL, 2
-#define FGRPd9_6 NULL, NULL, 3
-#define FGRPd9_7 NULL, NULL, 4
-#define FGRPda_5 NULL, NULL, 5
-#define FGRPdb_4 NULL, NULL, 6
-#define FGRPde_3 NULL, NULL, 7
-#define FGRPdf_4 NULL, NULL, 8
-
-struct dis386 float_reg[][8] = {
- /* d8 */
- {
- { "fadd", ST, STi },
- { "fmul", ST, STi },
- { "fcom", STi },
- { "fcomp", STi },
- { "fsub", ST, STi },
- { "fsubr", ST, STi },
- { "fdiv", ST, STi },
- { "fdivr", ST, STi },
- },
- /* d9 */
- {
- { "fld", STi },
- { "fxch", STi },
- { FGRPd9_2 },
- { "(bad)" },
- { FGRPd9_4 },
- { FGRPd9_5 },
- { FGRPd9_6 },
- { FGRPd9_7 },
- },
- /* da */
- {
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { FGRPda_5 },
- { "(bad)" },
- { "(bad)" },
- },
- /* db */
- {
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { FGRPdb_4 },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- },
- /* dc */
- {
- { "fadd", STi, ST },
- { "fmul", STi, ST },
- { "(bad)" },
- { "(bad)" },
- { "fsub", STi, ST },
- { "fsubr", STi, ST },
- { "fdiv", STi, ST },
- { "fdivr", STi, ST },
- },
- /* dd */
- {
- { "ffree", STi },
- { "(bad)" },
- { "fst", STi },
- { "fstp", STi },
- { "fucom", STi },
- { "fucomp", STi },
- { "(bad)" },
- { "(bad)" },
- },
- /* de */
- {
- { "faddp", STi, ST },
- { "fmulp", STi, ST },
- { "(bad)" },
- { FGRPde_3 },
- { "fsubp", STi, ST },
- { "fsubrp", STi, ST },
- { "fdivp", STi, ST },
- { "fdivrp", STi, ST },
- },
- /* df */
- {
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- { FGRPdf_4 },
- { "(bad)" },
- { "(bad)" },
- { "(bad)" },
- },
-};
-
-
-char *fgrps[][8] = {
- /* d9_2 0 */
- {
- "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
- },
-
- /* d9_4 1 */
- {
- "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
- },
-
- /* d9_5 2 */
- {
- "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
- },
-
- /* d9_6 3 */
- {
- "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
- },
-
- /* d9_7 4 */
- {
- "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
- },
-
- /* da_5 5 */
- {
- "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
- },
-
- /* db_4 6 */
- {
- "feni(287 only)","fdisi(287 only)","fNclex","fNinit",
- "fNsetpm(287 only)","(bad)","(bad)","(bad)",
- },
-
- /* de_3 7 */
- {
- "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
- },
-
- /* df_4 8 */
- {
- "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
- },
-};
-
-
-dofloat ()
-{
- struct dis386 *dp;
- unsigned char floatop;
-
- floatop = codep[-1];
-
- if (mod != 3)
- {
- putop (float_mem[(floatop - 0xd8) * 8 + reg]);
- obufp = op1out;
- OP_E (v_mode);
- return;
- }
- codep++;
-
- dp = &float_reg[floatop - 0xd8][reg];
- if (dp->name == NULL)
- {
- putop (fgrps[dp->bytemode1][rm]);
- /* instruction fnstsw is only one with strange arg */
- if (floatop == 0xdf && *codep == 0xe0)
- strcpy (op1out, "%eax");
- }
- else
- {
- putop (dp->name);
- obufp = op1out;
- if (dp->op1)
- (*dp->op1)(dp->bytemode1);
- obufp = op2out;
- if (dp->op2)
- (*dp->op2)(dp->bytemode2);
- }
-}
-
-/* ARGSUSED */
-OP_ST (ignore)
-{
- oappend ("%st");
-}
-
-/* ARGSUSED */
-OP_STi (ignore)
-{
- sprintf (scratchbuf, "%%st(%d)", rm);
- oappend (scratchbuf);
-}
-
-
-/* capital letters in template are macros */
-putop (template)
- char *template;
-{
- char *p;
-
- for (p = template; *p; p++)
- {
- switch (*p)
- {
- default:
- *obufp++ = *p;
- break;
- case 'C': /* For jcxz/jecxz */
- if (aflag == 0)
- *obufp++ = 'e';
- break;
- case 'N':
- if ((prefixes & PREFIX_FWAIT) == 0)
- *obufp++ = 'n';
- break;
- case 'S':
- /* operand size flag */
- if (dflag)
- *obufp++ = 'l';
- else
- *obufp++ = 'w';
- break;
- }
- }
- *obufp = 0;
-}
-
-static void
-oappend (s)
-char *s;
-{
- strcpy (obufp, s);
- obufp += strlen (s);
- *obufp = 0;
-}
-
-append_prefix ()
-{
- if (prefixes & PREFIX_CS)
- oappend ("%cs:");
- if (prefixes & PREFIX_DS)
- oappend ("%ds:");
- if (prefixes & PREFIX_SS)
- oappend ("%ss:");
- if (prefixes & PREFIX_ES)
- oappend ("%es:");
- if (prefixes & PREFIX_FS)
- oappend ("%fs:");
- if (prefixes & PREFIX_GS)
- oappend ("%gs:");
-}
-
-OP_indirE (bytemode)
-{
- oappend ("*");
- OP_E (bytemode);
-}
-
-OP_E (bytemode)
-{
- int disp;
- int havesib;
- int didoutput = 0;
- int base;
- int index;
- int scale;
- int havebase;
-
- /* skip mod/rm byte */
- codep++;
-
- havesib = 0;
- havebase = 0;
- disp = 0;
-
- if (mod == 3)
- {
- switch (bytemode)
- {
- case b_mode:
- oappend (names8[rm]);
- break;
- case w_mode:
- oappend (names16[rm]);
- break;
- case v_mode:
- if (dflag)
- oappend (names32[rm]);
- else
- oappend (names16[rm]);
- break;
- default:
- oappend ("<bad dis table>");
- break;
- }
- return;
- }
-
- append_prefix ();
- if (rm == 4)
- {
- havesib = 1;
- havebase = 1;
- scale = (*codep >> 6) & 3;
- index = (*codep >> 3) & 7;
- base = *codep & 7;
- codep++;
- }
-
- switch (mod)
- {
- case 0:
- switch (rm)
- {
- case 4:
- /* implies havesib and havebase */
- if (base == 5) {
- havebase = 0;
- disp = get32 ();
- }
- break;
- case 5:
- disp = get32 ();
- break;
- default:
- havebase = 1;
- base = rm;
- break;
- }
- break;
- case 1:
- disp = *(char *)codep++;
- if (rm != 4)
- {
- havebase = 1;
- base = rm;
- }
- break;
- case 2:
- disp = get32 ();
- if (rm != 4)
- {
- havebase = 1;
- base = rm;
- }
- break;
- }
-
- if (mod != 0 || rm == 5 || (havesib && base == 5))
- {
- sprintf (scratchbuf, "0x%x", disp);
- oappend (scratchbuf);
- }
-
- if (havebase || havesib)
- {
- oappend ("(");
- if (havebase)
- oappend (names32[base]);
- if (havesib)
- {
- if (index != 4)
- {
- sprintf (scratchbuf, ",%s", names32[index]);
- oappend (scratchbuf);
- }
- sprintf (scratchbuf, ",%d", 1 << scale);
- oappend (scratchbuf);
- }
- oappend (")");
- }
-}
-
-OP_G (bytemode)
-{
- switch (bytemode)
- {
- case b_mode:
- oappend (names8[reg]);
- break;
- case w_mode:
- oappend (names16[reg]);
- break;
- case d_mode:
- oappend (names32[reg]);
- break;
- case v_mode:
- if (dflag)
- oappend (names32[reg]);
- else
- oappend (names16[reg]);
- break;
- default:
- oappend ("<internal disassembler error>");
- break;
- }
-}
-
-get32 ()
-{
- int x = 0;
-
- x = *codep++ & 0xff;
- x |= (*codep++ & 0xff) << 8;
- x |= (*codep++ & 0xff) << 16;
- x |= (*codep++ & 0xff) << 24;
- return (x);
-}
-
-get16 ()
-{
- int x = 0;
-
- x = *codep++ & 0xff;
- x |= (*codep++ & 0xff) << 8;
- return (x);
-}
-
-set_op (op)
-int op;
-{
- op_index[op_ad] = op_ad;
- op_address[op_ad] = op;
-}
-
-OP_REG (code)
-{
- char *s;
-
- switch (code)
- {
- case indir_dx_reg: s = "(%dx)"; break;
- case ax_reg: case cx_reg: case dx_reg: case bx_reg:
- case sp_reg: case bp_reg: case si_reg: case di_reg:
- s = names16[code - ax_reg];
- break;
- case es_reg: case ss_reg: case cs_reg:
- case ds_reg: case fs_reg: case gs_reg:
- s = names_seg[code - es_reg];
- break;
- case al_reg: case ah_reg: case cl_reg: case ch_reg:
- case dl_reg: case dh_reg: case bl_reg: case bh_reg:
- s = names8[code - al_reg];
- break;
- case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
- case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
- if (dflag)
- s = names32[code - eAX_reg];
- else
- s = names16[code - eAX_reg];
- break;
- default:
- s = "<internal disassembler error>";
- break;
- }
- oappend (s);
-}
-
-OP_I (bytemode)
-{
- int op;
-
- switch (bytemode)
- {
- case b_mode:
- op = *codep++ & 0xff;
- break;
- case v_mode:
- if (dflag)
- op = get32 ();
- else
- op = get16 ();
- break;
- case w_mode:
- op = get16 ();
- break;
- default:
- oappend ("<internal disassembler error>");
- return;
- }
- sprintf (scratchbuf, "$0x%x", op);
- oappend (scratchbuf);
-}
-
-OP_sI (bytemode)
-{
- int op;
-
- switch (bytemode)
- {
- case b_mode:
- op = *(char *)codep++;
- break;
- case v_mode:
- if (dflag)
- op = get32 ();
- else
- op = (short)get16();
- break;
- case w_mode:
- op = (short)get16 ();
- break;
- default:
- oappend ("<internal disassembler error>");
- return;
- }
- sprintf (scratchbuf, "$0x%x", op);
- oappend (scratchbuf);
-}
-
-OP_J (bytemode)
-{
- int disp;
- int mask = -1;
-
- switch (bytemode)
- {
- case b_mode:
- disp = *(char *)codep++;
- break;
- case v_mode:
- if (dflag)
- disp = get32 ();
- else
- {
- disp = (short)get16 ();
- /* for some reason, a data16 prefix on a jump instruction
- means that the pc is masked to 16 bits after the
- displacement is added! */
- mask = 0xffff;
- }
- break;
- default:
- oappend ("<internal disassembler error>");
- return;
- }
- disp = (start_pc + codep - start_codep + disp) & mask;
- set_op (disp);
- sprintf (scratchbuf, "0x%x", disp);
- oappend (scratchbuf);
-}
-
-/* ARGSUSED */
-OP_SEG (dummy)
-{
- static char *sreg[] = {
- "%es","%cs","%ss","%ds","%fs","%gs","%?","%?",
- };
-
- oappend (sreg[reg]);
-}
-
-OP_DIR (size)
-{
- int seg, offset;
-
- switch (size)
- {
- case lptr:
- if (aflag)
- {
- offset = get32 ();
- seg = get16 ();
- }
- else
- {
- offset = get16 ();
- seg = get16 ();
- }
- sprintf (scratchbuf, "0x%x,0x%x", seg, offset);
- oappend (scratchbuf);
- break;
- case v_mode:
- if (aflag)
- offset = get32 ();
- else
- offset = (short)get16 ();
-
- offset = start_pc + codep - start_codep + offset;
- set_op (offset);
- sprintf (scratchbuf, "0x%x", offset);
- oappend (scratchbuf);
- break;
- default:
- oappend ("<internal disassembler error>");
- break;
- }
-}
-
-/* ARGSUSED */
-OP_OFF (bytemode)
-{
- int off;
-
- if (aflag)
- off = get32 ();
- else
- off = get16 ();
-
- sprintf (scratchbuf, "0x%x", off);
- oappend (scratchbuf);
-}
-
-/* ARGSUSED */
-OP_ESDI (dummy)
-{
- oappend ("%es:(");
- oappend (aflag ? "%edi" : "%di");
- oappend (")");
-}
-
-/* ARGSUSED */
-OP_DSSI (dummy)
-{
- oappend ("%ds:(");
- oappend (aflag ? "%esi" : "%si");
- oappend (")");
-}
-
-/* ARGSUSED */
-OP_ONE (dummy)
-{
- oappend ("1");
-}
-
-/* ARGSUSED */
-OP_C (dummy)
-{
- codep++; /* skip mod/rm */
- sprintf (scratchbuf, "%%cr%d", reg);
- oappend (scratchbuf);
-}
-
-/* ARGSUSED */
-OP_D (dummy)
-{
- codep++; /* skip mod/rm */
- sprintf (scratchbuf, "%%db%d", reg);
- oappend (scratchbuf);
-}
-
-/* ARGSUSED */
-OP_T (dummy)
-{
- codep++; /* skip mod/rm */
- sprintf (scratchbuf, "%%tr%d", reg);
- oappend (scratchbuf);
-}
-
-OP_rm (bytemode)
-{
- switch (bytemode)
- {
- case d_mode:
- oappend (names32[rm]);
- break;
- case w_mode:
- oappend (names16[rm]);
- break;
- }
-}
-
-#define MAXLEN 20
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned char buffer[MAXLEN];
-
- read_memory (memaddr, buffer, MAXLEN);
-
- return (i386dis ((int)memaddr, buffer, stream));
-}
-
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
deleted file mode 100644
index 98dd25a..0000000
--- a/gdb/i386-tdep.c
+++ /dev/null
@@ -1,490 +0,0 @@
-/* Intel 386 target-dependent stuff.
- Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "gdbcore.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#ifndef N_SET_MAGIC
-#ifdef COFF_FORMAT
-#define N_SET_MAGIC(exec, val) ((exec).magic = (val))
-#else
-#define N_SET_MAGIC(exec, val) ((exec).a_magic = (val))
-#endif
-#endif
-
-#include <sys/file.h>
-#include <sys/stat.h>
-
-/* helper functions for tm-i386.h */
-
-/* stdio style buffering to minimize calls to ptrace */
-static CORE_ADDR codestream_next_addr;
-static CORE_ADDR codestream_addr;
-static unsigned char codestream_buf[sizeof (int)];
-static int codestream_off;
-static int codestream_cnt;
-
-#define codestream_tell() (codestream_addr + codestream_off)
-#define codestream_peek() (codestream_cnt == 0 ? \
- codestream_fill(1): codestream_buf[codestream_off])
-#define codestream_get() (codestream_cnt-- == 0 ? \
- codestream_fill(0) : codestream_buf[codestream_off++])
-
-static unsigned char
-codestream_fill (peek_flag)
-{
- codestream_addr = codestream_next_addr;
- codestream_next_addr += sizeof (int);
- codestream_off = 0;
- codestream_cnt = sizeof (int);
- read_memory (codestream_addr,
- (unsigned char *)codestream_buf,
- sizeof (int));
-
- if (peek_flag)
- return (codestream_peek());
- else
- return (codestream_get());
-}
-
-static void
-codestream_seek (place)
-{
- codestream_next_addr = place & -sizeof (int);
- codestream_cnt = 0;
- codestream_fill (1);
- while (codestream_tell() != place)
- codestream_get ();
-}
-
-static void
-codestream_read (buf, count)
- unsigned char *buf;
-{
- unsigned char *p;
- int i;
- p = buf;
- for (i = 0; i < count; i++)
- *p++ = codestream_get ();
-}
-
-/* next instruction is a jump, move to target */
-static
-i386_follow_jump ()
-{
- int long_delta;
- short short_delta;
- char byte_delta;
- int data16;
- int pos;
-
- pos = codestream_tell ();
-
- data16 = 0;
- if (codestream_peek () == 0x66)
- {
- codestream_get ();
- data16 = 1;
- }
-
- switch (codestream_get ())
- {
- case 0xe9:
- /* relative jump: if data16 == 0, disp32, else disp16 */
- if (data16)
- {
- codestream_read ((unsigned char *)&short_delta, 2);
-
- /* include size of jmp inst (including the 0x66 prefix). */
- pos += short_delta + 4;
- }
- else
- {
- codestream_read ((unsigned char *)&long_delta, 4);
- pos += long_delta + 5;
- }
- break;
- case 0xeb:
- /* relative jump, disp8 (ignore data16) */
- codestream_read ((unsigned char *)&byte_delta, 1);
- pos += byte_delta + 2;
- break;
- }
- codestream_seek (pos);
-}
-
-/*
- * find & return amound a local space allocated, and advance codestream to
- * first register push (if any)
- *
- * if entry sequence doesn't make sense, return -1, and leave
- * codestream pointer random
- */
-static long
-i386_get_frame_setup (pc)
-{
- unsigned char op;
-
- codestream_seek (pc);
-
- i386_follow_jump ();
-
- op = codestream_get ();
-
- if (op == 0x58) /* popl %eax */
- {
- /*
- * this function must start with
- *
- * popl %eax 0x58
- * xchgl %eax, (%esp) 0x87 0x04 0x24
- * or xchgl %eax, 0(%esp) 0x87 0x44 0x24 0x00
- *
- * (the system 5 compiler puts out the second xchg
- * inst, and the assembler doesn't try to optimize it,
- * so the 'sib' form gets generated)
- *
- * this sequence is used to get the address of the return
- * buffer for a function that returns a structure
- */
- int pos;
- unsigned char buf[4];
- static unsigned char proto1[3] = { 0x87,0x04,0x24 };
- static unsigned char proto2[4] = { 0x87,0x44,0x24,0x00 };
- pos = codestream_tell ();
- codestream_read (buf, 4);
- if (bcmp (buf, proto1, 3) == 0)
- pos += 3;
- else if (bcmp (buf, proto2, 4) == 0)
- pos += 4;
-
- codestream_seek (pos);
- op = codestream_get (); /* update next opcode */
- }
-
- if (op == 0x55) /* pushl %ebp */
- {
- /* check for movl %esp, %ebp - can be written two ways */
- switch (codestream_get ())
- {
- case 0x8b:
- if (codestream_get () != 0xec)
- return (-1);
- break;
- case 0x89:
- if (codestream_get () != 0xe5)
- return (-1);
- break;
- default:
- return (-1);
- }
- /* check for stack adjustment
- *
- * subl $XXX, %esp
- *
- * note: you can't subtract a 16 bit immediate
- * from a 32 bit reg, so we don't have to worry
- * about a data16 prefix
- */
- op = codestream_peek ();
- if (op == 0x83)
- {
- /* subl with 8 bit immed */
- codestream_get ();
- if (codestream_get () != 0xec)
- /* Some instruction starting with 0x83 other than subl. */
- {
- codestream_seek (codestream_tell () - 2);
- return 0;
- }
- /* subl with signed byte immediate
- * (though it wouldn't make sense to be negative)
- */
- return (codestream_get());
- }
- else if (op == 0x81)
- {
- /* subl with 32 bit immed */
- int locals;
- codestream_get();
- if (codestream_get () != 0xec)
- /* Some instruction starting with 0x81 other than subl. */
- {
- codestream_seek (codestream_tell () - 2);
- return 0;
- }
- /* subl with 32 bit immediate */
- codestream_read ((unsigned char *)&locals, 4);
- SWAP_TARGET_AND_HOST (&locals, 4);
- return (locals);
- }
- else
- {
- return (0);
- }
- }
- else if (op == 0xc8)
- {
- /* enter instruction: arg is 16 bit unsigned immed */
- unsigned short slocals;
- codestream_read ((unsigned char *)&slocals, 2);
- SWAP_TARGET_AND_HOST (&slocals, 2);
- codestream_get (); /* flush final byte of enter instruction */
- return (slocals);
- }
- return (-1);
-}
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-/* on the 386, the instruction following the call could be:
- * popl %ecx - one arg
- * addl $imm, %esp - imm/4 args; imm may be 8 or 32 bits
- * anything else - zero args
- */
-
-int
-i386_frame_num_args (fi)
- struct frame_info fi;
-{
- int retpc;
- unsigned char op;
- struct frame_info *pfi;
-
- int frameless;
-
- FRAMELESS_FUNCTION_INVOCATION (fi, frameless);
- if (frameless)
- /* In the absence of a frame pointer, GDB doesn't get correct values
- for nameless arguments. Return -1, so it doesn't print any
- nameless arguments. */
- return -1;
-
- pfi = get_prev_frame_info ((fi));
- if (pfi == 0)
- {
- /* Note: this can happen if we are looking at the frame for
- main, because FRAME_CHAIN_VALID won't let us go into
- start. If we have debugging symbols, that's not really
- a big deal; it just means it will only show as many arguments
- to main as are declared. */
- return -1;
- }
- else
- {
- retpc = pfi->pc;
- op = read_memory_integer (retpc, 1);
- if (op == 0x59)
- /* pop %ecx */
- return 1;
- else if (op == 0x83)
- {
- op = read_memory_integer (retpc+1, 1);
- if (op == 0xc4)
- /* addl $<signed imm 8 bits>, %esp */
- return (read_memory_integer (retpc+2,1)&0xff)/4;
- else
- return 0;
- }
- else if (op == 0x81)
- { /* add with 32 bit immediate */
- op = read_memory_integer (retpc+1, 1);
- if (op == 0xc4)
- /* addl $<imm 32>, %esp */
- return read_memory_integer (retpc+2, 4) / 4;
- else
- return 0;
- }
- else
- {
- return 0;
- }
- }
-}
-
-/*
- * parse the first few instructions of the function to see
- * what registers were stored.
- *
- * We handle these cases:
- *
- * The startup sequence can be at the start of the function,
- * or the function can start with a branch to startup code at the end.
- *
- * %ebp can be set up with either the 'enter' instruction, or
- * 'pushl %ebp, movl %esp, %ebp' (enter is too slow to be useful,
- * but was once used in the sys5 compiler)
- *
- * Local space is allocated just below the saved %ebp by either the
- * 'enter' instruction, or by 'subl $<size>, %esp'. 'enter' has
- * a 16 bit unsigned argument for space to allocate, and the
- * 'addl' instruction could have either a signed byte, or
- * 32 bit immediate.
- *
- * Next, the registers used by this function are pushed. In
- * the sys5 compiler they will always be in the order: %edi, %esi, %ebx
- * (and sometimes a harmless bug causes it to also save but not restore %eax);
- * however, the code below is willing to see the pushes in any order,
- * and will handle up to 8 of them.
- *
- * If the setup sequence is at the end of the function, then the
- * next instruction will be a branch back to the start.
- */
-
-i386_frame_find_saved_regs (fip, fsrp)
- struct frame_info *fip;
- struct frame_saved_regs *fsrp;
-{
- long locals;
- unsigned char *p;
- unsigned char op;
- CORE_ADDR dummy_bottom;
- CORE_ADDR adr;
- int i;
-
- bzero (fsrp, sizeof *fsrp);
-
- /* if frame is the end of a dummy, compute where the
- * beginning would be
- */
- dummy_bottom = fip->frame - 4 - REGISTER_BYTES - CALL_DUMMY_LENGTH;
-
- /* check if the PC is in the stack, in a dummy frame */
- if (dummy_bottom <= fip->pc && fip->pc <= fip->frame)
- {
- /* all regs were saved by push_call_dummy () */
- adr = fip->frame;
- for (i = 0; i < NUM_REGS; i++)
- {
- adr -= REGISTER_RAW_SIZE (i);
- fsrp->regs[i] = adr;
- }
- return;
- }
-
- locals = i386_get_frame_setup (get_pc_function_start (fip->pc));
-
- if (locals >= 0)
- {
- adr = fip->frame - 4 - locals;
- for (i = 0; i < 8; i++)
- {
- op = codestream_get ();
- if (op < 0x50 || op > 0x57)
- break;
- fsrp->regs[op - 0x50] = adr;
- adr -= 4;
- }
- }
-
- fsrp->regs[PC_REGNUM] = fip->frame + 4;
- fsrp->regs[FP_REGNUM] = fip->frame;
-}
-
-/* return pc of first real instruction */
-i386_skip_prologue (pc)
-{
- unsigned char op;
- int i;
-
- if (i386_get_frame_setup (pc) < 0)
- return (pc);
-
- /* found valid frame setup - codestream now points to
- * start of push instructions for saving registers
- */
-
- /* skip over register saves */
- for (i = 0; i < 8; i++)
- {
- op = codestream_peek ();
- /* break if not pushl inst */
- if (op < 0x50 || op > 0x57)
- break;
- codestream_get ();
- }
-
- i386_follow_jump ();
-
- return (codestream_tell ());
-}
-
-i386_push_dummy_frame ()
-{
- CORE_ADDR sp = read_register (SP_REGNUM);
- int regnum;
- char regbuf[MAX_REGISTER_RAW_SIZE];
-
- sp = push_word (sp, read_register (PC_REGNUM));
- sp = push_word (sp, read_register (FP_REGNUM));
- write_register (FP_REGNUM, sp);
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- {
- read_register_gen (regnum, regbuf);
- sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum));
- }
- write_register (SP_REGNUM, sp);
-}
-
-i386_pop_frame ()
-{
- FRAME frame = get_current_frame ();
- CORE_ADDR fp;
- int regnum;
- struct frame_saved_regs fsr;
- struct frame_info *fi;
- char regbuf[MAX_REGISTER_RAW_SIZE];
-
- fi = get_frame_info (frame);
- fp = fi->frame;
- get_frame_saved_regs (fi, &fsr);
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- {
- CORE_ADDR adr;
- adr = fsr.regs[regnum];
- if (adr)
- {
- read_memory (adr, regbuf, REGISTER_RAW_SIZE (regnum));
- write_register_bytes (REGISTER_BYTE (regnum), regbuf,
- REGISTER_RAW_SIZE (regnum));
- }
- }
- write_register (FP_REGNUM, read_memory_integer (fp, 4));
- write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
- write_register (SP_REGNUM, fp + 8);
- flush_cached_frames ();
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
-}
diff --git a/gdb/i386-xdep.c b/gdb/i386-xdep.c
deleted file mode 100644
index 2d69d1d..0000000
--- a/gdb/i386-xdep.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/* Intel 386 stuff.
- Copyright (C) 1988, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "language.h"
-#include "gdbcore.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include <sys/reg.h>
-#include "ieee-float.h"
-
-#include "target.h"
-
-extern void print_387_control_word (); /* i387-tdep.h */
-extern void print_387_status_word ();
-
-extern struct ext_format ext_format_i387;
-
-/* this table must line up with REGISTER_NAMES in m-i386.h */
-/* symbols like 'EAX' come from <sys/reg.h> */
-static int regmap[] =
-{
- EAX, ECX, EDX, EBX,
- UESP, EBP, ESI, EDI,
- EIP, EFL, CS, SS,
- DS, ES, FS, GS,
-};
-
-/* blockend is the value of u.u_ar0, and points to the
- * place where GS is stored
- */
-i386_register_u_addr (blockend, regnum)
-{
-#if 0
- /* this will be needed if fp registers are reinstated */
- /* for now, you can look at them with 'info float'
- * sys5 wont let you change them with ptrace anyway
- */
- if (regnum >= FP0_REGNUM && regnum <= FP7_REGNUM)
- {
- int ubase, fpstate;
- struct user u;
- ubase = blockend + 4 * (SS + 1) - KSTKSZ;
- fpstate = ubase + ((char *)&u.u_fpstate - (char *)&u);
- return (fpstate + 0x1c + 10 * (regnum - FP0_REGNUM));
- }
- else
-#endif
- return (blockend + 4 * regmap[regnum]);
-
-}
-
-#if 0
-/* mauro@olympus 1991.10.20 -- compiling the following code causes
- undefined symbols at link time, specifically: corechan, have_inferior_p */
-struct env387
-{
- unsigned short control;
- unsigned short r0;
- unsigned short status;
- unsigned short r1;
- unsigned short tag;
- unsigned short r2;
- unsigned long eip;
- unsigned short code_seg;
- unsigned short opcode;
- unsigned long operand;
- unsigned short operand_seg;
- unsigned short r3;
- unsigned char regs[8][10];
-};
-
-static
-print_387_status (status, ep)
- unsigned short status;
- struct env387 *ep;
-{
- int i;
- int bothstatus;
- int top;
- int fpreg;
- unsigned char *p;
-
- bothstatus = ((status != 0) && (ep->status != 0));
- if (status != 0)
- {
- if (bothstatus)
- printf ("u: ");
- print_387_status_word (status);
- }
-
- if (ep->status != 0)
- {
- if (bothstatus)
- printf ("e: ");
- print_387_status_word (ep->status);
- }
-
- print_387_control_word (ep->control);
- printf ("last exception: ");
- printf ("opcode %s; ", local_hex_string(ep->opcode));
- printf ("pc %s:", local_hex_string(ep->code_seg));
- printf ("%s; ", local_hex_string(ep->eip));
- printf ("operand %s", local_hex_string(ep->operand_seg));
- printf (":%s\n", local_hex_string(ep->operand));
-
- top = (ep->status >> 11) & 7;
-
- printf ("regno tag msb lsb value\n");
- for (fpreg = 7; fpreg >= 0; fpreg--)
- {
- double val;
-
- printf ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
-
- switch ((ep->tag >> (fpreg * 2)) & 3)
- {
- case 0: printf ("valid "); break;
- case 1: printf ("zero "); break;
- case 2: printf ("trap "); break;
- case 3: printf ("empty "); break;
- }
- for (i = 9; i >= 0; i--)
- printf ("%02x", ep->regs[fpreg][i]);
-
- ieee_extended_to_double (&ext_format_i387, (char *)ep->regs[fpreg],
- &val);
- printf (" %g\n", val);
- }
- if (ep->r0)
- printf ("warning: reserved0 is %s\n", local_hex_string(ep->r0));
- if (ep->r1)
- printf ("warning: reserved1 is %s\n", local_hex_string(ep->r1));
- if (ep->r2)
- printf ("warning: reserved2 is %s\n", local_hex_string(ep->r2));
- if (ep->r3)
- printf ("warning: reserved3 is %s\n", local_hex_string(ep->r3));
-}
-
-#ifndef U_FPSTATE
-#define U_FPSTATE(u) u.u_fpstate
-#endif
-
-i386_float_info ()
-{
- struct user u; /* just for address computations */
- int i;
- /* fpstate defined in <sys/user.h> */
- struct fpstate *fpstatep;
- char buf[sizeof (struct fpstate) + 2 * sizeof (int)];
- unsigned int uaddr;
- char fpvalid = 0;
- unsigned int rounded_addr;
- unsigned int rounded_size;
- extern int corechan;
- int skip;
-
- uaddr = (char *)&u.u_fpvalid - (char *)&u;
- if (target_has_execution)
- {
- unsigned int data;
- unsigned int mask;
-
- rounded_addr = uaddr & -sizeof (int);
- data = ptrace (3, inferior_pid, rounded_addr, 0);
- mask = 0xff << ((uaddr - rounded_addr) * 8);
-
- fpvalid = ((data & mask) != 0);
- }
-#if 0
- else
- {
- if (lseek (corechan, uaddr, 0) < 0)
- perror ("seek on core file");
- if (myread (corechan, &fpvalid, 1) < 0)
- perror ("read on core file");
-
- }
-#endif /* no core support yet */
-
- if (fpvalid == 0)
- {
- printf ("no floating point status saved\n");
- return;
- }
-
- uaddr = (char *)&U_FPSTATE(u) - (char *)&u;
- if (target_has_execution)
- {
- int *ip;
-
- rounded_addr = uaddr & -sizeof (int);
- rounded_size = (((uaddr + sizeof (struct fpstate)) - uaddr) +
- sizeof (int) - 1) / sizeof (int);
- skip = uaddr - rounded_addr;
-
- ip = (int *)buf;
- for (i = 0; i < rounded_size; i++)
- {
- *ip++ = ptrace (3, inferior_pid, rounded_addr, 0);
- rounded_addr += sizeof (int);
- }
- }
-#if 0
- else
- {
- if (lseek (corechan, uaddr, 0) < 0)
- perror_with_name ("seek on core file");
- if (myread (corechan, buf, sizeof (struct fpstate)) < 0)
- perror_with_name ("read from core file");
- skip = 0;
- }
- #endif /* 0 */
-
- fpstatep = (struct fpstate *)(buf + skip);
- print_387_status (fpstatep->status, (struct env387 *)fpstatep->state);
-}
-#endif /* mauro@olympus 1991.10.20 */
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
deleted file mode 100644
index e2e5557..0000000
--- a/gdb/i387-tdep.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Intel 387 floating point stuff.
- Copyright (C) 1988, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "language.h"
-#include "gdbcore.h"
-#include "ieee-float.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include <sys/reg.h>
-
-struct ext_format ext_format_i387 = {
-/* tot sbyte smask expbyte manbyte */
- 10, 9, 0x80, 9,8, 4,0 /* i387 */
-};
-
-/* FIXME: Eliminate these routines when we have the time to change all
- the callers. */
-void
-i387_to_double (from, to)
- char *from, *to;
-{
- ieee_extended_to_double (&ext_format_i387, from, (double *)to);
-}
-
-void
-double_to_i387 (from, to)
- char *from, *to;
-{
- double_to_ieee_extended (&ext_format_i387, (double *)from, to);
-}
-
-void
-print_387_control_word (control)
-unsigned short control;
-{
- printf ("control %s: ", local_hex_string(control));
- printf ("compute to ");
- switch ((control >> 8) & 3)
- {
- case 0: printf ("24 bits; "); break;
- case 1: printf ("(bad); "); break;
- case 2: printf ("53 bits; "); break;
- case 3: printf ("64 bits; "); break;
- }
- printf ("round ");
- switch ((control >> 10) & 3)
- {
- case 0: printf ("NEAREST; "); break;
- case 1: printf ("DOWN; "); break;
- case 2: printf ("UP; "); break;
- case 3: printf ("CHOP; "); break;
- }
- if (control & 0x3f)
- {
- printf ("mask:");
- if (control & 0x0001) printf (" INVALID");
- if (control & 0x0002) printf (" DENORM");
- if (control & 0x0004) printf (" DIVZ");
- if (control & 0x0008) printf (" OVERF");
- if (control & 0x0010) printf (" UNDERF");
- if (control & 0x0020) printf (" LOS");
- printf (";");
- }
- printf ("\n");
- if (control & 0xe080) printf ("warning: reserved bits on: %s\n",
- local_hex_string(control & 0xe080));
-}
-
-void
-print_387_status_word (status)
- unsigned short status;
-{
- printf ("status %s: ", local_hex_string (status));
- if (status & 0xff)
- {
- printf ("exceptions:");
- if (status & 0x0001) printf (" INVALID");
- if (status & 0x0002) printf (" DENORM");
- if (status & 0x0004) printf (" DIVZ");
- if (status & 0x0008) printf (" OVERF");
- if (status & 0x0010) printf (" UNDERF");
- if (status & 0x0020) printf (" LOS");
- if (status & 0x0040) printf (" FPSTACK");
- printf ("; ");
- }
- printf ("flags: %d%d%d%d; ",
- (status & 0x4000) != 0,
- (status & 0x0400) != 0,
- (status & 0x0200) != 0,
- (status & 0x0100) != 0);
-
- printf ("top %d\n", (status >> 11) & 7);
-}
diff --git a/gdb/i960-pinsn.c b/gdb/i960-pinsn.c
deleted file mode 100644
index a651c48..0000000
--- a/gdb/i960-pinsn.c
+++ /dev/null
@@ -1,863 +0,0 @@
-/* i80960 instruction disassembler for GDB.
- Copyright (C) 1990-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-
-extern char *reg_names[];
-
-static FILE *stream; /* Output goes here */
-static void print_addr();
-static void ctrl();
-static void cobr();
-static void reg();
-static int mem();
-static void ea();
-static void dstop();
-static void regop();
-static void invalid();
-static int pinsn();
-static void put_abs();
-
-
-/* Print the i960 instruction at address 'memaddr' in debugged memory,
- on stream 's'. Returns length of the instruction, in bytes. */
-int
-print_insn( memaddr, s )
- CORE_ADDR memaddr;
- FILE *s;
-{
- unsigned int word1, word2;
-
- stream = s;
- word1 = read_memory_integer( memaddr, 4 );
- word2 = read_memory_integer( memaddr+4, 4 );
- return pinsn( memaddr, word1, word2 );
-}
-
-
-/* Read the i960 instruction at 'memaddr' and return the address of
- the next instruction after that, or 0 if 'memaddr' is not the
- address of a valid instruction. The first word of the instruction
- is stored at 'pword1', and the second word, if any, is stored at
- 'pword2'. */
-
-CORE_ADDR
-next_insn (memaddr, pword1, pword2)
- unsigned long *pword1, *pword2;
- CORE_ADDR memaddr;
-{
- int len;
- unsigned long buf[2];
-
- /* Read the two (potential) words of the instruction at once,
- to eliminate the overhead of two calls to read_memory ().
- TODO: read more instructions at once and cache them. */
-
- read_memory (memaddr, buf, sizeof (buf));
- *pword1 = buf[0];
- SWAP_TARGET_AND_HOST (pword1, sizeof (long));
- *pword2 = buf[1];
- SWAP_TARGET_AND_HOST (pword2, sizeof (long));
-
- /* Divide instruction set into classes based on high 4 bits of opcode*/
-
- switch ((*pword1 >> 28) & 0xf)
- {
- case 0x0:
- case 0x1: /* ctrl */
-
- case 0x2:
- case 0x3: /* cobr */
-
- case 0x5:
- case 0x6:
- case 0x7: /* reg */
- len = 4;
- break;
-
- case 0x8:
- case 0x9:
- case 0xa:
- case 0xb:
- case 0xc:
- len = mem (memaddr, *pword1, *pword2, 1);
- break;
-
- default: /* invalid instruction */
- len = 0;
- break;
- }
-
- if (len)
- return memaddr + len;
- else
- return 0;
-}
-
-#define IN_GDB
-
-/*****************************************************************************
- * All code below this point should be identical with that of
- * the disassembler in gdmp960.
- *****************************************************************************/
-
-struct tabent {
- char *name;
- char numops;
-};
-
-static int
-pinsn( memaddr, word1, word2 )
- unsigned long memaddr;
- unsigned long word1, word2;
-{
- int instr_len;
-
- instr_len = 4;
- put_abs( word1, word2 );
-
- /* Divide instruction set into classes based on high 4 bits of opcode*/
-
- switch ( (word1 >> 28) & 0xf ){
- case 0x0:
- case 0x1:
- ctrl( memaddr, word1, word2 );
- break;
- case 0x2:
- case 0x3:
- cobr( memaddr, word1, word2 );
- break;
- case 0x5:
- case 0x6:
- case 0x7:
- reg( word1 );
- break;
- case 0x8:
- case 0x9:
- case 0xa:
- case 0xb:
- case 0xc:
- instr_len = mem( memaddr, word1, word2, 0 );
- break;
- default:
- /* invalid instruction, print as data word */
- invalid( word1 );
- break;
- }
- return instr_len;
-}
-
-/****************************************/
-/* CTRL format */
-/****************************************/
-static void
-ctrl( memaddr, word1, word2 )
- unsigned long memaddr;
- unsigned long word1, word2;
-{
- int i;
- static struct tabent ctrl_tab[] = {
- NULL, 0, /* 0x00 */
- NULL, 0, /* 0x01 */
- NULL, 0, /* 0x02 */
- NULL, 0, /* 0x03 */
- NULL, 0, /* 0x04 */
- NULL, 0, /* 0x05 */
- NULL, 0, /* 0x06 */
- NULL, 0, /* 0x07 */
- "b", 1, /* 0x08 */
- "call", 1, /* 0x09 */
- "ret", 0, /* 0x0a */
- "bal", 1, /* 0x0b */
- NULL, 0, /* 0x0c */
- NULL, 0, /* 0x0d */
- NULL, 0, /* 0x0e */
- NULL, 0, /* 0x0f */
- "bno", 1, /* 0x10 */
- "bg", 1, /* 0x11 */
- "be", 1, /* 0x12 */
- "bge", 1, /* 0x13 */
- "bl", 1, /* 0x14 */
- "bne", 1, /* 0x15 */
- "ble", 1, /* 0x16 */
- "bo", 1, /* 0x17 */
- "faultno", 0, /* 0x18 */
- "faultg", 0, /* 0x19 */
- "faulte", 0, /* 0x1a */
- "faultge", 0, /* 0x1b */
- "faultl", 0, /* 0x1c */
- "faultne", 0, /* 0x1d */
- "faultle", 0, /* 0x1e */
- "faulto", 0, /* 0x1f */
- };
-
- i = (word1 >> 24) & 0xff;
- if ( (ctrl_tab[i].name == NULL) || ((word1 & 1) != 0) ){
- invalid( word1 );
- return;
- }
-
- fputs( ctrl_tab[i].name, stream );
- if ( word1 & 2 ){ /* Predicts branch not taken */
- fputs( ".f", stream );
- }
-
- if ( ctrl_tab[i].numops == 1 ){
- /* EXTRACT DISPLACEMENT AND CONVERT TO ADDRESS */
- word1 &= 0x00ffffff;
- if ( word1 & 0x00800000 ){ /* Sign bit is set */
- word1 |= (-1 & ~0xffffff); /* Sign extend */
- }
- putc( '\t', stream );
- print_addr( word1 + memaddr );
- }
-}
-
-/****************************************/
-/* COBR format */
-/****************************************/
-static void
-cobr( memaddr, word1, word2 )
- unsigned long memaddr;
- unsigned long word1, word2;
-{
- int src1;
- int src2;
- int i;
-
- static struct tabent cobr_tab[] = {
- "testno", 1, /* 0x20 */
- "testg", 1, /* 0x21 */
- "teste", 1, /* 0x22 */
- "testge", 1, /* 0x23 */
- "testl", 1, /* 0x24 */
- "testne", 1, /* 0x25 */
- "testle", 1, /* 0x26 */
- "testo", 1, /* 0x27 */
- NULL, 0, /* 0x28 */
- NULL, 0, /* 0x29 */
- NULL, 0, /* 0x2a */
- NULL, 0, /* 0x2b */
- NULL, 0, /* 0x2c */
- NULL, 0, /* 0x2d */
- NULL, 0, /* 0x2e */
- NULL, 0, /* 0x2f */
- "bbc", 3, /* 0x30 */
- "cmpobg", 3, /* 0x31 */
- "cmpobe", 3, /* 0x32 */
- "cmpobge", 3, /* 0x33 */
- "cmpobl", 3, /* 0x34 */
- "cmpobne", 3, /* 0x35 */
- "cmpoble", 3, /* 0x36 */
- "bbs", 3, /* 0x37 */
- "cmpibno", 3, /* 0x38 */
- "cmpibg", 3, /* 0x39 */
- "cmpibe", 3, /* 0x3a */
- "cmpibge", 3, /* 0x3b */
- "cmpibl", 3, /* 0x3c */
- "cmpibne", 3, /* 0x3d */
- "cmpible", 3, /* 0x3e */
- "cmpibo", 3, /* 0x3f */
- };
-
- i = ((word1 >> 24) & 0xff) - 0x20;
- if ( cobr_tab[i].name == NULL ){
- invalid( word1 );
- return;
- }
-
- fputs( cobr_tab[i].name, stream );
- if ( word1 & 2 ){ /* Predicts branch not taken */
- fputs( ".f", stream );
- }
- putc( '\t', stream );
-
- src1 = (word1 >> 19) & 0x1f;
- src2 = (word1 >> 14) & 0x1f;
-
- if ( word1 & 0x02000 ){ /* M1 is 1 */
- fprintf( stream, "%d", src1 );
- } else { /* M1 is 0 */
- fputs( reg_names[src1], stream );
- }
-
- if ( cobr_tab[i].numops > 1 ){
- if ( word1 & 1 ){ /* S2 is 1 */
- fprintf( stream, ",sf%d,", src2 );
- } else { /* S1 is 0 */
- fprintf( stream, ",%s,", reg_names[src2] );
- }
-
- /* Extract displacement and convert to address
- */
- word1 &= 0x00001ffc;
- if ( word1 & 0x00001000 ){ /* Negative displacement */
- word1 |= (-1 & ~0x1fff); /* Sign extend */
- }
- print_addr( memaddr + word1 );
- }
-}
-
-/****************************************/
-/* MEM format */
-/****************************************/
-static int /* returns instruction length: 4 or 8 */
-mem( memaddr, word1, word2, noprint )
- unsigned long memaddr;
- unsigned long word1, word2;
- int noprint; /* If TRUE, return instruction length, but
- don't output any text. */
-{
- int i, j;
- int len;
- int mode;
- int offset;
- char *reg1, *reg2, *reg3;
-
- /* This lookup table is too sparse to make it worth typing in, but not
- * so large as to make a sparse array necessary. We allocate the
- * table at runtime, initialize all entries to empty, and copy the
- * real ones in from an initialization table.
- *
- * NOTE: In this table, the meaning of 'numops' is:
- * 1: single operand
- * 2: 2 operands, load instruction
- * -2: 2 operands, store instruction
- */
- static struct tabent *mem_tab = NULL;
- static struct { int opcode; char *name; char numops; } mem_init[] = {
-#define MEM_MIN 0x80
- 0x80, "ldob", 2,
- 0x82, "stob", -2,
- 0x84, "bx", 1,
- 0x85, "balx", 2,
- 0x86, "callx", 1,
- 0x88, "ldos", 2,
- 0x8a, "stos", -2,
- 0x8c, "lda", 2,
- 0x90, "ld", 2,
- 0x92, "st", -2,
- 0x98, "ldl", 2,
- 0x9a, "stl", -2,
- 0xa0, "ldt", 2,
- 0xa2, "stt", -2,
- 0xb0, "ldq", 2,
- 0xb2, "stq", -2,
- 0xc0, "ldib", 2,
- 0xc2, "stib", -2,
- 0xc8, "ldis", 2,
- 0xca, "stis", -2,
-#define MEM_MAX 0xca
-#define MEM_SIZ ((MEM_MAX-MEM_MIN+1) * sizeof(struct tabent))
- 0, NULL, 0
- };
-
- if ( mem_tab == NULL ){
- mem_tab = (struct tabent *) xmalloc( MEM_SIZ );
- bzero( mem_tab, MEM_SIZ );
- for ( i = 0; mem_init[i].opcode != 0; i++ ){
- j = mem_init[i].opcode - MEM_MIN;
- mem_tab[j].name = mem_init[i].name;
- mem_tab[j].numops = mem_init[i].numops;
- }
- }
-
- i = ((word1 >> 24) & 0xff) - MEM_MIN;
- mode = (word1 >> 10) & 0xf;
-
- if ( (mem_tab[i].name != NULL) /* Valid instruction */
- && ((mode == 5) || (mode >=12)) ){ /* With 32-bit displacement */
- len = 8;
- } else {
- len = 4;
- }
-
- if ( noprint ){
- return len;
- }
-
- if ( (mem_tab[i].name == NULL) || (mode == 6) ){
- invalid( word1 );
- return len;
- }
-
- fprintf( stream, "%s\t", mem_tab[i].name );
-
- reg1 = reg_names[ (word1 >> 19) & 0x1f ]; /* MEMB only */
- reg2 = reg_names[ (word1 >> 14) & 0x1f ];
- reg3 = reg_names[ word1 & 0x1f ]; /* MEMB only */
- offset = word1 & 0xfff; /* MEMA only */
-
- switch ( mem_tab[i].numops ){
-
- case 2: /* LOAD INSTRUCTION */
- if ( mode & 4 ){ /* MEMB FORMAT */
- ea( memaddr, mode, reg2, reg3, word1, word2 );
- fprintf( stream, ",%s", reg1 );
- } else { /* MEMA FORMAT */
- fprintf( stream, "0x%x", offset );
- if (mode & 8) {
- fprintf( stream, "(%s)", reg2 );
- }
- fprintf( stream, ",%s", reg1 );
- }
- break;
-
- case -2: /* STORE INSTRUCTION */
- if ( mode & 4 ){ /* MEMB FORMAT */
- fprintf( stream, "%s,", reg1 );
- ea( memaddr, mode, reg2, reg3, word1, word2 );
- } else { /* MEMA FORMAT */
- fprintf( stream, "%s,0x%x", reg1, offset );
- if (mode & 8) {
- fprintf( stream, "(%s)", reg2 );
- }
- }
- break;
-
- case 1: /* BX/CALLX INSTRUCTION */
- if ( mode & 4 ){ /* MEMB FORMAT */
- ea( memaddr, mode, reg2, reg3, word1, word2 );
- } else { /* MEMA FORMAT */
- fprintf( stream, "0x%x", offset );
- if (mode & 8) {
- fprintf( stream, "(%s)", reg2 );
- }
- }
- break;
- }
-
- return len;
-}
-
-/****************************************/
-/* REG format */
-/****************************************/
-static void
-reg( word1 )
- unsigned long word1;
-{
- int i, j;
- int opcode;
- int fp;
- int m1, m2, m3;
- int s1, s2;
- int src, src2, dst;
- char *mnemp;
-
- /* This lookup table is too sparse to make it worth typing in, but not
- * so large as to make a sparse array necessary. We allocate the
- * table at runtime, initialize all entries to empty, and copy the
- * real ones in from an initialization table.
- *
- * NOTE: In this table, the meaning of 'numops' is:
- * 1: single operand, which is NOT a destination.
- * -1: single operand, which IS a destination.
- * 2: 2 operands, the 2nd of which is NOT a destination.
- * -2: 2 operands, the 2nd of which IS a destination.
- * 3: 3 operands
- *
- * If an opcode mnemonic begins with "F", it is a floating-point
- * opcode (the "F" is not printed).
- */
-
- static struct tabent *reg_tab = NULL;
- static struct { int opcode; char *name; char numops; } reg_init[] = {
-#define REG_MIN 0x580
- 0x580, "notbit", 3,
- 0x581, "and", 3,
- 0x582, "andnot", 3,
- 0x583, "setbit", 3,
- 0x584, "notand", 3,
- 0x586, "xor", 3,
- 0x587, "or", 3,
- 0x588, "nor", 3,
- 0x589, "xnor", 3,
- 0x58a, "not", -2,
- 0x58b, "ornot", 3,
- 0x58c, "clrbit", 3,
- 0x58d, "notor", 3,
- 0x58e, "nand", 3,
- 0x58f, "alterbit", 3,
- 0x590, "addo", 3,
- 0x591, "addi", 3,
- 0x592, "subo", 3,
- 0x593, "subi", 3,
- 0x598, "shro", 3,
- 0x59a, "shrdi", 3,
- 0x59b, "shri", 3,
- 0x59c, "shlo", 3,
- 0x59d, "rotate", 3,
- 0x59e, "shli", 3,
- 0x5a0, "cmpo", 2,
- 0x5a1, "cmpi", 2,
- 0x5a2, "concmpo", 2,
- 0x5a3, "concmpi", 2,
- 0x5a4, "cmpinco", 3,
- 0x5a5, "cmpinci", 3,
- 0x5a6, "cmpdeco", 3,
- 0x5a7, "cmpdeci", 3,
- 0x5ac, "scanbyte", 2,
- 0x5ae, "chkbit", 2,
- 0x5b0, "addc", 3,
- 0x5b2, "subc", 3,
- 0x5cc, "mov", -2,
- 0x5d8, "eshro", 3,
- 0x5dc, "movl", -2,
- 0x5ec, "movt", -2,
- 0x5fc, "movq", -2,
- 0x600, "synmov", 2,
- 0x601, "synmovl", 2,
- 0x602, "synmovq", 2,
- 0x603, "cmpstr", 3,
- 0x604, "movqstr", 3,
- 0x605, "movstr", 3,
- 0x610, "atmod", 3,
- 0x612, "atadd", 3,
- 0x613, "inspacc", -2,
- 0x614, "ldphy", -2,
- 0x615, "synld", -2,
- 0x617, "fill", 3,
- 0x630, "sdma", 3,
- 0x631, "udma", 0,
- 0x640, "spanbit", -2,
- 0x641, "scanbit", -2,
- 0x642, "daddc", 3,
- 0x643, "dsubc", 3,
- 0x644, "dmovt", -2,
- 0x645, "modac", 3,
- 0x646, "condrec", -2,
- 0x650, "modify", 3,
- 0x651, "extract", 3,
- 0x654, "modtc", 3,
- 0x655, "modpc", 3,
- 0x656, "receive", -2,
- 0x659, "sysctl", 3,
- 0x660, "calls", 1,
- 0x662, "send", 3,
- 0x663, "sendserv", 1,
- 0x664, "resumprcs", 1,
- 0x665, "schedprcs", 1,
- 0x666, "saveprcs", 0,
- 0x668, "condwait", 1,
- 0x669, "wait", 1,
- 0x66a, "signal", 1,
- 0x66b, "mark", 0,
- 0x66c, "fmark", 0,
- 0x66d, "flushreg", 0,
- 0x66f, "syncf", 0,
- 0x670, "emul", 3,
- 0x671, "ediv", 3,
- 0x673, "ldtime", -1,
- 0x674, "Fcvtir", -2,
- 0x675, "Fcvtilr", -2,
- 0x676, "Fscalerl", 3,
- 0x677, "Fscaler", 3,
- 0x680, "Fatanr", 3,
- 0x681, "Flogepr", 3,
- 0x682, "Flogr", 3,
- 0x683, "Fremr", 3,
- 0x684, "Fcmpor", 2,
- 0x685, "Fcmpr", 2,
- 0x688, "Fsqrtr", -2,
- 0x689, "Fexpr", -2,
- 0x68a, "Flogbnr", -2,
- 0x68b, "Froundr", -2,
- 0x68c, "Fsinr", -2,
- 0x68d, "Fcosr", -2,
- 0x68e, "Ftanr", -2,
- 0x68f, "Fclassr", 1,
- 0x690, "Fatanrl", 3,
- 0x691, "Flogeprl", 3,
- 0x692, "Flogrl", 3,
- 0x693, "Fremrl", 3,
- 0x694, "Fcmporl", 2,
- 0x695, "Fcmprl", 2,
- 0x698, "Fsqrtrl", -2,
- 0x699, "Fexprl", -2,
- 0x69a, "Flogbnrl", -2,
- 0x69b, "Froundrl", -2,
- 0x69c, "Fsinrl", -2,
- 0x69d, "Fcosrl", -2,
- 0x69e, "Ftanrl", -2,
- 0x69f, "Fclassrl", 1,
- 0x6c0, "Fcvtri", -2,
- 0x6c1, "Fcvtril", -2,
- 0x6c2, "Fcvtzri", -2,
- 0x6c3, "Fcvtzril", -2,
- 0x6c9, "Fmovr", -2,
- 0x6d9, "Fmovrl", -2,
- 0x6e1, "Fmovre", -2,
- 0x6e2, "Fcpysre", 3,
- 0x6e3, "Fcpyrsre", 3,
- 0x701, "mulo", 3,
- 0x708, "remo", 3,
- 0x70b, "divo", 3,
- 0x741, "muli", 3,
- 0x748, "remi", 3,
- 0x749, "modi", 3,
- 0x74b, "divi", 3,
- 0x78b, "Fdivr", 3,
- 0x78c, "Fmulr", 3,
- 0x78d, "Fsubr", 3,
- 0x78f, "Faddr", 3,
- 0x79b, "Fdivrl", 3,
- 0x79c, "Fmulrl", 3,
- 0x79d, "Fsubrl", 3,
- 0x79f, "Faddrl", 3,
-#define REG_MAX 0x79f
-#define REG_SIZ ((REG_MAX-REG_MIN+1) * sizeof(struct tabent))
- 0, NULL, 0
- };
-
- if ( reg_tab == NULL ){
- reg_tab = (struct tabent *) xmalloc( REG_SIZ );
- bzero( reg_tab, REG_SIZ );
- for ( i = 0; reg_init[i].opcode != 0; i++ ){
- j = reg_init[i].opcode - REG_MIN;
- reg_tab[j].name = reg_init[i].name;
- reg_tab[j].numops = reg_init[i].numops;
- }
- }
-
- opcode = ((word1 >> 20) & 0xff0) | ((word1 >> 7) & 0xf);
- i = opcode - REG_MIN;
-
- if ( (opcode<REG_MIN) || (opcode>REG_MAX) || (reg_tab[i].name==NULL) ){
- invalid( word1 );
- return;
- }
-
- mnemp = reg_tab[i].name;
- if ( *mnemp == 'F' ){
- fp = 1;
- mnemp++;
- } else {
- fp = 0;
- }
-
- fputs( mnemp, stream );
-
- s1 = (word1 >> 5) & 1;
- s2 = (word1 >> 6) & 1;
- m1 = (word1 >> 11) & 1;
- m2 = (word1 >> 12) & 1;
- m3 = (word1 >> 13) & 1;
- src = word1 & 0x1f;
- src2 = (word1 >> 14) & 0x1f;
- dst = (word1 >> 19) & 0x1f;
-
- if ( reg_tab[i].numops != 0 ){
- putc( '\t', stream );
-
- switch ( reg_tab[i].numops ){
- case 1:
- regop( m1, s1, src, fp );
- break;
- case -1:
- dstop( m3, dst, fp );
- break;
- case 2:
- regop( m1, s1, src, fp );
- putc( ',', stream );
- regop( m2, s2, src2, fp );
- break;
- case -2:
- regop( m1, s1, src, fp );
- putc( ',', stream );
- dstop( m3, dst, fp );
- break;
- case 3:
- regop( m1, s1, src, fp );
- putc( ',', stream );
- regop( m2, s2, src2, fp );
- putc( ',', stream );
- dstop( m3, dst, fp );
- break;
- }
- }
-}
-
-
-/*
- * Print out effective address for memb instructions.
- */
-static void
-ea( memaddr, mode, reg2, reg3, word1, word2 )
- unsigned long memaddr;
- int mode;
- char *reg2, *reg3;
- unsigned int word2;
-{
- int scale;
- static int scale_tab[] = { 1, 2, 4, 8, 16 };
-
- scale = (word1 >> 7) & 0x07;
- if ( (scale > 4) || ((word1 >> 5) & 0x03 != 0) ){
- invalid( word1 );
- return;
- }
- scale = scale_tab[scale];
-
- switch (mode) {
- case 4: /* (reg) */
- fprintf( stream, "(%s)", reg2 );
- break;
- case 5: /* displ+8(ip) */
- print_addr( word2+8+memaddr );
- break;
- case 7: /* (reg)[index*scale] */
- if (scale == 1) {
- fprintf( stream, "(%s)[%s]", reg2, reg3 );
- } else {
- fprintf( stream, "(%s)[%s*%d]",reg2,reg3,scale);
- }
- break;
- case 12: /* displacement */
- print_addr( word2 );
- break;
- case 13: /* displ(reg) */
- print_addr( word2 );
- fprintf( stream, "(%s)", reg2 );
- break;
- case 14: /* displ[index*scale] */
- print_addr( word2 );
- if (scale == 1) {
- fprintf( stream, "[%s]", reg3 );
- } else {
- fprintf( stream, "[%s*%d]", reg3, scale );
- }
- break;
- case 15: /* displ(reg)[index*scale] */
- print_addr( word2 );
- if (scale == 1) {
- fprintf( stream, "(%s)[%s]", reg2, reg3 );
- } else {
- fprintf( stream, "(%s)[%s*%d]",reg2,reg3,scale );
- }
- break;
- default:
- invalid( word1 );
- return;
- }
-}
-
-
-/************************************************/
-/* Register Instruction Operand */
-/************************************************/
-static void
-regop( mode, spec, reg, fp )
- int mode, spec, reg, fp;
-{
- if ( fp ){ /* FLOATING POINT INSTRUCTION */
- if ( mode == 1 ){ /* FP operand */
- switch ( reg ){
- case 0: fputs( "fp0", stream ); break;
- case 1: fputs( "fp1", stream ); break;
- case 2: fputs( "fp2", stream ); break;
- case 3: fputs( "fp3", stream ); break;
- case 16: fputs( "0f0.0", stream ); break;
- case 22: fputs( "0f1.0", stream ); break;
- default: putc( '?', stream ); break;
- }
- } else { /* Non-FP register */
- fputs( reg_names[reg], stream );
- }
- } else { /* NOT FLOATING POINT */
- if ( mode == 1 ){ /* Literal */
- fprintf( stream, "%d", reg );
- } else { /* Register */
- if ( spec == 0 ){
- fputs( reg_names[reg], stream );
- } else {
- fprintf( stream, "sf%d", reg );
- }
- }
- }
-}
-
-/************************************************/
-/* Register Instruction Destination Operand */
-/************************************************/
-static void
-dstop( mode, reg, fp )
- int mode, reg, fp;
-{
- /* 'dst' operand can't be a literal. On non-FP instructions, register
- * mode is assumed and "m3" acts as if were "s3"; on FP-instructions,
- * sf registers are not allowed so m3 acts normally.
- */
- if ( fp ){
- regop( mode, 0, reg, fp );
- } else {
- regop( 0, mode, reg, fp );
- }
-}
-
-
-static void
-invalid( word1 )
- int word1;
-{
- fprintf( stream, ".word\t0x%08x", word1 );
-}
-
-static void
-print_addr(a)
-{
- fprintf( stream, "0x%x", a );
-}
-
-static void
-put_abs( word1, word2 )
- unsigned long word1, word2;
-{
-#ifdef IN_GDB
- return;
-#else
- int len;
-
- switch ( (word1 >> 28) & 0xf ){
- case 0x8:
- case 0x9:
- case 0xa:
- case 0xb:
- case 0xc:
- /* MEM format instruction */
- len = mem( 0, word1, word2, 1 );
- break;
- default:
- len = 4;
- break;
- }
-
- if ( len == 8 ){
- fprintf( stream, "%08x %08x\t", word1, word2 );
- } else {
- fprintf( stream, "%08x \t", word1 );
- }
-;
-
-#endif
-}
diff --git a/gdb/i960-tdep.c b/gdb/i960-tdep.c
deleted file mode 100644
index 27fde37..0000000
--- a/gdb/i960-tdep.c
+++ /dev/null
@@ -1,646 +0,0 @@
-/* Target-machine dependent code for the Intel 960
- Copyright (C) 1991 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- examine_prologue and other parts contributed by Wind River Systems.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Miscellaneous i80960-dependent routines.
- Most are called from macros defined in "tm-i960.h". */
-
-#include <stdio.h>
-#include <signal.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "value.h"
-#include "frame.h"
-#include "signame.h"
-#include "ieee-float.h"
-
-/* Structure of i960 extended floating point format. */
-
-const struct ext_format ext_format_i960 = {
-/* tot sbyte smask expbyte manbyte */
- 12, 9, 0x80, 9,8, 4,0, /* i960 */
-};
-
-/* gdb960 is always running on a non-960 host. Check its characteristics.
- This routine must be called as part of gdb initialization. */
-
-static void
-check_host()
-{
- int i;
-
- static struct typestruct {
- int hostsize; /* Size of type on host */
- int i960size; /* Size of type on i960 */
- char *typename; /* Name of type, for error msg */
- } types[] = {
- { sizeof(short), 2, "short" },
- { sizeof(int), 4, "int" },
- { sizeof(long), 4, "long" },
- { sizeof(float), 4, "float" },
- { sizeof(double), 8, "double" },
- { sizeof(char *), 4, "pointer" },
- };
-#define TYPELEN (sizeof(types) / sizeof(struct typestruct))
-
- /* Make sure that host type sizes are same as i960
- */
- for ( i = 0; i < TYPELEN; i++ ){
- if ( types[i].hostsize != types[i].i960size ){
- printf("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n",
- types[i].typename, types[i].i960size );
- }
-
- }
-}
-
-/* Examine an i960 function prologue, recording the addresses at which
- registers are saved explicitly by the prologue code, and returning
- the address of the first instruction after the prologue (but not
- after the instruction at address LIMIT, as explained below).
-
- LIMIT places an upper bound on addresses of the instructions to be
- examined. If the prologue code scan reaches LIMIT, the scan is
- aborted and LIMIT is returned. This is used, when examining the
- prologue for the current frame, to keep examine_prologue () from
- claiming that a given register has been saved when in fact the
- instruction that saves it has not yet been executed. LIMIT is used
- at other times to stop the scan when we hit code after the true
- function prologue (e.g. for the first source line) which might
- otherwise be mistaken for function prologue.
-
- The format of the function prologue matched by this routine is
- derived from examination of the source to gcc960 1.21, particularly
- the routine i960_function_prologue (). A "regular expression" for
- the function prologue is given below:
-
- (lda LRn, g14
- mov g14, g[0-7]
- (mov 0, g14) | (lda 0, g14))?
-
- (mov[qtl]? g[0-15], r[4-15])*
- ((addo [1-31], sp, sp) | (lda n(sp), sp))?
- (st[qtl]? g[0-15], n(fp))*
-
- (cmpobne 0, g14, LFn
- mov sp, g14
- lda 0x30(sp), sp
- LFn: stq g0, (g14)
- stq g4, 0x10(g14)
- stq g8, 0x20(g14))?
-
- (st g14, n(fp))?
- (mov g13,r[4-15])?
-*/
-
-/* Macros for extracting fields from i960 instructions. */
-
-#define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos))
-#define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width))
-
-#define REG_SRC1(insn) EXTRACT_FIELD (insn, 0, 5)
-#define REG_SRC2(insn) EXTRACT_FIELD (insn, 14, 5)
-#define REG_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5)
-#define MEM_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5)
-#define MEMA_OFFSET(insn) EXTRACT_FIELD (insn, 0, 12)
-
-/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
- is not the address of a valid instruction, the address of the next
- instruction beyond ADDR otherwise. *PWORD1 receives the first word
- of the instruction, and (for two-word instructions), *PWORD2 receives
- the second. */
-
-#define NEXT_PROLOGUE_INSN(addr, lim, pword1, pword2) \
- (((addr) < (lim)) ? next_insn (addr, pword1, pword2) : 0)
-
-static CORE_ADDR
-examine_prologue (ip, limit, frame_addr, fsr)
- register CORE_ADDR ip;
- register CORE_ADDR limit;
- FRAME_ADDR frame_addr;
- struct frame_saved_regs *fsr;
-{
- register CORE_ADDR next_ip;
- register int src, dst;
- register unsigned int *pcode;
- unsigned int insn1, insn2;
- int size;
- int within_leaf_prologue;
- CORE_ADDR save_addr;
- static unsigned int varargs_prologue_code [] =
- {
- 0x3507a00c, /* cmpobne 0x0, g14, LFn */
- 0x5cf01601, /* mov sp, g14 */
- 0x8c086030, /* lda 0x30(sp), sp */
- 0xb2879000, /* LFn: stq g0, (g14) */
- 0xb2a7a010, /* stq g4, 0x10(g14) */
- 0xb2c7a020 /* stq g8, 0x20(g14) */
- };
-
- /* Accept a leaf procedure prologue code fragment if present.
- Note that ip might point to either the leaf or non-leaf
- entry point; we look for the non-leaf entry point first: */
-
- within_leaf_prologue = 0;
- if ((next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2))
- && ((insn1 & 0xfffff000) == 0x8cf00000 /* lda LRx, g14 (MEMA) */
- || (insn1 & 0xfffffc60) == 0x8cf03000)) /* lda LRx, g14 (MEMB) */
- {
- within_leaf_prologue = 1;
- next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2);
- }
-
- /* Now look for the prologue code at a leaf entry point: */
-
- if (next_ip
- && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */
- && REG_SRCDST (insn1) <= G0_REGNUM + 7)
- {
- within_leaf_prologue = 1;
- if ((next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2))
- && (insn1 == 0x8cf00000 /* lda 0, g14 */
- || insn1 == 0x5cf01e00)) /* mov 0, g14 */
- {
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- within_leaf_prologue = 0;
- }
- }
-
- /* If something that looks like the beginning of a leaf prologue
- has been seen, but the remainder of the prologue is missing, bail.
- We don't know what we've got. */
-
- if (within_leaf_prologue)
- return (ip);
-
- /* Accept zero or more instances of "mov[qtl]? gx, ry", where y >= 4.
- This may cause us to mistake the moving of a register
- parameter to a local register for the saving of a callee-saved
- register, but that can't be helped, since with the
- "-fcall-saved" flag, any register can be made callee-saved. */
-
- while (next_ip
- && (insn1 & 0xfc802fb0) == 0x5c000610
- && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4))
- {
- src = REG_SRC1 (insn1);
- size = EXTRACT_FIELD (insn1, 24, 2) + 1;
- save_addr = frame_addr + ((dst - R0_REGNUM) * 4);
- while (size--)
- {
- fsr->regs[src++] = save_addr;
- save_addr += 4;
- }
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept an optional "addo n, sp, sp" or "lda n(sp), sp". */
-
- if (next_ip &&
- ((insn1 & 0xffffffe0) == 0x59084800 /* addo n, sp, sp */
- || (insn1 & 0xfffff000) == 0x8c086000 /* lda n(sp), sp (MEMA) */
- || (insn1 & 0xfffffc60) == 0x8c087400)) /* lda n(sp), sp (MEMB) */
- {
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept zero or more instances of "st[qtl]? gx, n(fp)".
- This may cause us to mistake the copying of a register
- parameter to the frame for the saving of a callee-saved
- register, but that can't be helped, since with the
- "-fcall-saved" flag, any register can be made callee-saved.
- We can, however, refuse to accept a save of register g14,
- since that is matched explicitly below. */
-
- while (next_ip &&
- ((insn1 & 0xf787f000) == 0x9287e000 /* stl? gx, n(fp) (MEMA) */
- || (insn1 & 0xf787fc60) == 0x9287f400 /* stl? gx, n(fp) (MEMB) */
- || (insn1 & 0xef87f000) == 0xa287e000 /* st[tq] gx, n(fp) (MEMA) */
- || (insn1 & 0xef87fc60) == 0xa287f400) /* st[tq] gx, n(fp) (MEMB) */
- && ((src = MEM_SRCDST (insn1)) != G14_REGNUM))
- {
- save_addr = frame_addr + ((insn1 & BITMASK (12, 1))
- ? insn2 : MEMA_OFFSET (insn1));
- size = (insn1 & BITMASK (29, 1)) ? ((insn1 & BITMASK (28, 1)) ? 4 : 3)
- : ((insn1 & BITMASK (27, 1)) ? 2 : 1);
- while (size--)
- {
- fsr->regs[src++] = save_addr;
- save_addr += 4;
- }
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept the varargs prologue code if present. */
-
- size = sizeof (varargs_prologue_code) / sizeof (int);
- pcode = varargs_prologue_code;
- while (size-- && next_ip && *pcode++ == insn1)
- {
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept an optional "st g14, n(fp)". */
-
- if (next_ip &&
- ((insn1 & 0xfffff000) == 0x92f7e000 /* st g14, n(fp) (MEMA) */
- || (insn1 & 0xfffffc60) == 0x92f7f400)) /* st g14, n(fp) (MEMB) */
- {
- fsr->regs[G14_REGNUM] = frame_addr + ((insn1 & BITMASK (12, 1))
- ? insn2 : MEMA_OFFSET (insn1));
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept zero or one instance of "mov g13, ry", where y >= 4.
- This is saving the address where a struct should be returned. */
-
- if (next_ip
- && (insn1 & 0xff802fbf) == 0x5c00061d
- && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4))
- {
- save_addr = frame_addr + ((dst - R0_REGNUM) * 4);
- fsr->regs[G0_REGNUM+13] = save_addr;
- ip = next_ip;
-#if 0 /* We'll need this once there is a subsequent instruction examined. */
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
-#endif
- }
-
- return (ip);
-}
-
-/* Given an ip value corresponding to the start of a function,
- return the ip of the first instruction after the function
- prologue. */
-
-CORE_ADDR
-skip_prologue (ip)
- CORE_ADDR (ip);
-{
- struct frame_saved_regs saved_regs_dummy;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- sal = find_pc_line (ip, 0);
- limit = (sal.end) ? sal.end : 0xffffffff;
-
- return (examine_prologue (ip, limit, (FRAME_ADDR) 0, &saved_regs_dummy));
-}
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame.
-
- We cache the result of doing this in the frame_cache_obstack, since
- it is fairly expensive. */
-
-void
-frame_find_saved_regs (fi, fsr)
- struct frame_info *fi;
- struct frame_saved_regs *fsr;
-{
- register CORE_ADDR next_addr;
- register CORE_ADDR *saved_regs;
- register int regnum;
- register struct frame_saved_regs *cache_fsr;
- extern struct obstack frame_cache_obstack;
- CORE_ADDR ip;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- if (!fi->fsr)
- {
- cache_fsr = (struct frame_saved_regs *)
- obstack_alloc (&frame_cache_obstack,
- sizeof (struct frame_saved_regs));
- bzero (cache_fsr, sizeof (struct frame_saved_regs));
- fi->fsr = cache_fsr;
-
- /* Find the start and end of the function prologue. If the PC
- is in the function prologue, we only consider the part that
- has executed already. */
-
- ip = get_pc_function_start (fi->pc);
- sal = find_pc_line (ip, 0);
- limit = (sal.end && sal.end < fi->pc) ? sal.end: fi->pc;
-
- examine_prologue (ip, limit, fi->frame, cache_fsr);
-
- /* Record the addresses at which the local registers are saved.
- Strictly speaking, we should only do this for non-leaf procedures,
- but no one will ever look at these values if it is a leaf procedure,
- since local registers are always caller-saved. */
-
- next_addr = (CORE_ADDR) fi->frame;
- saved_regs = cache_fsr->regs;
- for (regnum = R0_REGNUM; regnum <= R15_REGNUM; regnum++)
- {
- *saved_regs++ = next_addr;
- next_addr += 4;
- }
-
- cache_fsr->regs[FP_REGNUM] = cache_fsr->regs[PFP_REGNUM];
- }
-
- *fsr = *fi->fsr;
-
- /* Fetch the value of the sp from memory every time, since it
- is conceivable that it has changed since the cache was flushed.
- This unfortunately undoes much of the savings from caching the
- saved register values. I suggest adding an argument to
- get_frame_saved_regs () specifying the register number we're
- interested in (or -1 for all registers). This would be passed
- through to FRAME_FIND_SAVED_REGS (), permitting more efficient
- computation of saved register addresses (e.g., on the i960,
- we don't have to examine the prologue to find local registers).
- -- markf@wrs.com
- FIXME, we don't need to refetch this, since the cache is cleared
- every time the child process is restarted. If GDB itself
- modifies SP, it has to clear the cache by hand (does it?). -gnu */
-
- fsr->regs[SP_REGNUM] = read_memory_integer (fsr->regs[SP_REGNUM], 4);
-}
-
-/* Return the address of the argument block for the frame
- described by FI. Returns 0 if the address is unknown. */
-
-CORE_ADDR
-frame_args_address (fi, must_be_correct)
- struct frame_info *fi;
-{
- register FRAME frame;
- struct frame_saved_regs fsr;
- CORE_ADDR ap;
-
- /* If g14 was saved in the frame by the function prologue code, return
- the saved value. If the frame is current and we are being sloppy,
- return the value of g14. Otherwise, return zero. */
-
- frame = FRAME_INFO_ID (fi);
- get_frame_saved_regs (fi, &fsr);
- if (fsr.regs[G14_REGNUM])
- ap = read_memory_integer (fsr.regs[G14_REGNUM],4);
- else {
- if (must_be_correct)
- return 0; /* Don't cache this result */
- if (get_next_frame (frame))
- ap = 0;
- else
- ap = read_register (G14_REGNUM);
- }
- fi->arg_pointer = ap; /* Cache it for next time */
- return ap;
-}
-
-/* Return the address of the return struct for the frame
- described by FI. Returns 0 if the address is unknown. */
-
-CORE_ADDR
-frame_struct_result_address (fi)
- struct frame_info *fi;
-{
- register FRAME frame;
- struct frame_saved_regs fsr;
- CORE_ADDR ap;
-
- /* If the frame is non-current, check to see if g14 was saved in the
- frame by the function prologue code; return the saved value if so,
- zero otherwise. If the frame is current, return the value of g14.
-
- FIXME, shouldn't this use the saved value as long as we are past
- the function prologue, and only use the current value if we have
- no saved value and are at TOS? -- gnu@cygnus.com */
-
- frame = FRAME_INFO_ID (fi);
- if (get_next_frame (frame)) {
- get_frame_saved_regs (fi, &fsr);
- if (fsr.regs[G13_REGNUM])
- ap = read_memory_integer (fsr.regs[G13_REGNUM],4);
- else
- ap = 0;
- } else {
- ap = read_register (G13_REGNUM);
- }
- return ap;
-}
-
-/* Return address to which the currently executing leafproc will return,
- or 0 if ip is not in a leafproc (or if we can't tell if it is).
-
- Do this by finding the starting address of the routine in which ip lies.
- If the instruction there is "mov g14, gx" (where x is in [0,7]), this
- is a leafproc and the return address is in register gx. Well, this is
- true unless the return address points at a RET instruction in the current
- procedure, which indicates that we have a 'dual entry' routine that
- has been entered through the CALL entry point. */
-
-CORE_ADDR
-leafproc_return (ip)
- CORE_ADDR ip; /* ip from currently executing function */
-{
- int i;
- register struct misc_function *mf;
- char *p;
- int dst;
- unsigned int insn1, insn2;
- CORE_ADDR return_addr;
- char *index ();
-
- if ((i = find_pc_misc_function (ip)) >= 0)
- {
- mf = &misc_function_vector[i];
- if ((p = index (mf->name, '.')) && !strcmp (p, ".lf"))
- {
- if (next_insn (mf->address, &insn1, &insn2)
- && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */
- && (dst = REG_SRCDST (insn1)) <= G0_REGNUM + 7)
- {
- /* Get the return address. If the "mov g14, gx"
- instruction hasn't been executed yet, read
- the return address from g14; otherwise, read it
- from the register into which g14 was moved. */
-
- return_addr = read_register ((ip == mf->address)
- ? G14_REGNUM : dst);
-
- /* We know we are in a leaf procedure, but we don't know
- whether the caller actually did a "bal" to the ".lf"
- entry point, or a normal "call" to the non-leaf entry
- point one instruction before. In the latter case, the
- return address will be the address of a "ret"
- instruction within the procedure itself. We test for
- this below. */
-
- if (!next_insn (return_addr, &insn1, &insn2)
- || (insn1 & 0xff000000) != 0xa000000 /* ret */
- || find_pc_misc_function (return_addr) != i)
- return (return_addr);
- }
- }
- }
-
- return (0);
-}
-
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions.
- On the i960, the frame *is* set up immediately after the call,
- unless the function is a leaf procedure. */
-
-CORE_ADDR
-saved_pc_after_call (frame)
- FRAME frame;
-{
- CORE_ADDR saved_pc;
- CORE_ADDR get_frame_pc ();
-
- saved_pc = leafproc_return (get_frame_pc (frame));
- if (!saved_pc)
- saved_pc = FRAME_SAVED_PC (frame);
-
- return (saved_pc);
-}
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-
-pop_frame ()
-{
- register struct frame_info *current_fi, *prev_fi;
- register int i;
- CORE_ADDR save_addr;
- CORE_ADDR leaf_return_addr;
- struct frame_saved_regs fsr;
- char local_regs_buf[16 * 4];
-
- current_fi = get_frame_info (get_current_frame ());
-
- /* First, undo what the hardware does when we return.
- If this is a non-leaf procedure, restore local registers from
- the save area in the calling frame. Otherwise, load the return
- address obtained from leafproc_return () into the rip. */
-
- leaf_return_addr = leafproc_return (current_fi->pc);
- if (!leaf_return_addr)
- {
- /* Non-leaf procedure. Restore local registers, incl IP. */
- prev_fi = get_frame_info (get_prev_frame (FRAME_INFO_ID (current_fi)));
- read_memory (prev_fi->frame, local_regs_buf, sizeof (local_regs_buf));
- write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf,
- sizeof (local_regs_buf));
-
- /* Restore frame pointer. */
- write_register (FP_REGNUM, prev_fi->frame);
- }
- else
- {
- /* Leaf procedure. Just restore the return address into the IP. */
- write_register (RIP_REGNUM, leaf_return_addr);
- }
-
- /* Now restore any global regs that the current function had saved. */
- get_frame_saved_regs (current_fi, &fsr);
- for (i = G0_REGNUM; i < G14_REGNUM; i++)
- {
- if (save_addr = fsr.regs[i])
- write_register (i, read_memory_integer (save_addr, 4));
- }
-
- /* Flush the frame cache, create a frame for the new innermost frame,
- and make it the current frame. */
-
- flush_cached_frames ();
- set_current_frame (create_new_frame (read_register (FP_REGNUM), read_pc ()));
-}
-
-/* Print out text describing a "signal number" with which the i80960 halted.
-
- See the file "fault.c" in the nindy monitor source code for a list
- of stop codes. */
-
-void
-print_fault( siggnal )
- int siggnal; /* Signal number, as returned by target_wait() */
-{
- static char unknown[] = "Unknown fault or trace";
- static char *sigmsgs[] = {
- /* FAULTS */
- "parallel fault", /* 0x00 */
- unknown, /* 0x01 */
- "operation fault", /* 0x02 */
- "arithmetic fault", /* 0x03 */
- "floating point fault", /* 0x04 */
- "constraint fault", /* 0x05 */
- "virtual memory fault", /* 0x06 */
- "protection fault", /* 0x07 */
- "machine fault", /* 0x08 */
- "structural fault", /* 0x09 */
- "type fault", /* 0x0a */
- "reserved (0xb) fault", /* 0x0b */
- "process fault", /* 0x0c */
- "descriptor fault", /* 0x0d */
- "event fault", /* 0x0e */
- "reserved (0xf) fault", /* 0x0f */
-
- /* TRACES */
- "single-step trace", /* 0x10 */
- "branch trace", /* 0x11 */
- "call trace", /* 0x12 */
- "return trace", /* 0x13 */
- "pre-return trace", /* 0x14 */
- "supervisor call trace",/* 0x15 */
- "breakpoint trace", /* 0x16 */
- };
-# define NUMMSGS ((int)( sizeof(sigmsgs) / sizeof(sigmsgs[0]) ))
-
- if (siggnal < NSIG) {
- printf ("\nProgram received signal %d, %s\n",
- siggnal,
- sys_siglist[siggnal]);
- } else {
- /* The various target_wait()s bias the 80960 "signal number"
- by adding NSIG to it, so it won't get confused with any
- of the Unix signals elsewhere in GDB. We need to
- "unbias" it before using it. */
- siggnal -= NSIG;
-
- printf("Program stopped for reason #%d: %s.\n", siggnal,
- (siggnal < NUMMSGS && siggnal >= 0)?
- sigmsgs[siggnal] : unknown );
- }
-}
-
-/* Initialization stub */
-
-_initialize_i960_tdep ()
-{
- check_host ();
-}
diff --git a/gdb/ieee-float.c b/gdb/ieee-float.c
deleted file mode 100644
index 69a60f2..0000000
--- a/gdb/ieee-float.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* IEEE floating point support routines, for GDB, the GNU Debugger.
- Copyright (C) 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "param.h"
-#include "ieee-float.h"
-#include <math.h> /* ldexp */
-
-/* Convert an IEEE extended float to a double.
- FROM is the address of the extended float.
- Store the double in *TO. */
-
-void
-ieee_extended_to_double (ext_format, from, to)
- struct ext_format *ext_format;
- char *from;
- double *to;
-{
- unsigned char *ufrom = (unsigned char *)from;
- double dto;
- unsigned long mant0, mant1, exponent;
-
- bcopy (&from[MANBYTE_H], &mant0, 4);
- bcopy (&from[MANBYTE_L], &mant1, 4);
- exponent = ((ufrom[EXPBYTE_H] & (unsigned char)~SIGNMASK) << 8) | ufrom[EXPBYTE_L];
-
-#if 0
- /* We can't do anything useful with a NaN anyway, so ignore its
- difference. It will end up as Infinity or something close. */
- if (exponent == EXT_EXP_NAN) {
- /* We have a NaN source. */
- dto = 0.123456789; /* Not much else useful to do -- we don't know if
- the host system even *has* NaNs, nor how to
- generate an innocuous one if it does. */
- } else
-#endif
- if (exponent == 0 && mant0 == 0 && mant1 == 0) {
- dto = 0;
- } else {
- /* Build the result algebraically. Might go infinite, underflow, etc;
- who cares. */
- mant0 |= 0x80000000;
- dto = ldexp ((double)mant0, exponent - EXT_EXP_BIAS - 31);
- dto += ldexp ((double)mant1, exponent - EXT_EXP_BIAS - 31 - 32);
- if (ufrom[EXPBYTE_H] & SIGNMASK) /* If negative... */
- dto = -dto; /* ...negate. */
- }
- *to = dto;
-}
-
-/* The converse: convert the double *FROM to an extended float
- and store where TO points. */
-
-void
-double_to_ieee_extended (ext_format, from, to)
- struct ext_format *ext_format;
- double *from;
- char *to;
-{
- double dfrom = *from;
- unsigned long twolongs[2];
- unsigned long mant0, mant1, exponent;
- unsigned char tobytes[8];
-
- bzero (to, TOTALSIZE);
- if (dfrom == 0)
- return; /* Result is zero */
- if (dfrom != dfrom) {
- /* From is NaN */
- to[EXPBYTE_H] = (unsigned char)(EXT_EXP_NAN >> 8);
- to[EXPBYTE_L] = (unsigned char)EXT_EXP_NAN;
- to[MANBYTE_H] = 1; /* Be sure it's not infinity, but NaN value is irrel */
- return; /* Result is NaN */
- }
- if (dfrom < 0)
- to[SIGNBYTE] |= SIGNMASK; /* Set negative sign */
- /* How to tell an infinity from an ordinary number? FIXME-someday */
-
- /* The following code assumes that the host has IEEE doubles. FIXME-someday.
- It also assumes longs are 32 bits! FIXME-someday. */
- bcopy (from, twolongs, 8);
- bcopy (from, tobytes, 8);
-#if HOST_BYTE_ORDER == BIG_ENDIAN
- exponent = ((tobytes[1] & 0xF0) >> 4) | (tobytes[0] & 0x7F) << 4;
- mant0 = (twolongs[0] << 11) | twolongs[1] >> 21;
- mant1 = (twolongs[1] << 11);
-#else
- exponent = ((tobytes[6] & 0xF0) >> 4) | (tobytes[7] & 0x7F) << 4;
- mant0 = (twolongs[1] << 11) | twolongs[0] >> 21;
- mant1 = (twolongs[0] << 11);
-#endif
-
- /* Fiddle with leading 1-bit, implied in double, explicit in extended. */
- if (exponent == 0)
- mant0 &= 0x7FFFFFFF;
- else
- mant0 |= 0x80000000;
-
- exponent -= DBL_EXP_BIAS; /* Get integer exp */
- exponent += EXT_EXP_BIAS; /* Offset for extended */
-
- /* OK, now store it in extended format. */
- to[EXPBYTE_H] |= (unsigned char)(exponent >> 8); /* Retain sign */
- to[EXPBYTE_L] = (unsigned char) exponent;
-
- bcopy (&mant0, &to[MANBYTE_H], 4);
- bcopy (&mant1, &to[MANBYTE_L], 4);
-}
-
-
-#ifdef DEBUG
-
-/* Test some numbers to see that extended/double conversion works for them. */
-
-ieee_test (n)
- int n;
-{
- union { double d; int i[2]; } di;
- double result;
- int i;
- char exten[16];
- extern struct ext_format ext_format_68881;
-
- for (i = 0; i < n; i++) {
- di.i[0] = (random() << 16) | (random() & 0xffff);
- di.i[1] = (random() << 16) | (random() & 0xffff);
- double_to_ieee_extended (&ext_format_68881, &di.d, exten);
- ieee_extended_to_double (&ext_format_68881, exten, &result);
- if (di.d != result)
- printf ("Differ: %x %x %g => %x %x %g\n", di.d, di.d, result, result);
- }
-}
-
-#endif
diff --git a/gdb/ieee-float.h b/gdb/ieee-float.h
deleted file mode 100644
index bbe9e03..0000000
--- a/gdb/ieee-float.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* IEEE floating point support declarations, for GDB, the GNU Debugger.
- Copyright (C) 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Parameters for extended float format: */
-
-struct ext_format {
- unsigned totalsize; /* Total size of extended number */
- unsigned signbyte; /* Byte number of sign bit */
- unsigned char signmask; /* Mask for sign bit */
- unsigned expbyte_h; /* High byte of exponent */
- unsigned expbyte_l; /* Low byte of exponent */
- unsigned manbyte_h; /* High byte of mantissa */
- unsigned manbyte_l; /* Low byte of mantissa */
-};
-
-#define TOTALSIZE ext_format->totalsize
-#define SIGNBYTE ext_format->signbyte
-#define SIGNMASK ext_format->signmask
-#define EXPBYTE_H ext_format->expbyte_h
-#define EXPBYTE_L ext_format->expbyte_l
-#define MANBYTE_H ext_format->manbyte_h
-#define MANBYTE_L ext_format->manbyte_l
-
-/* Actual ext_format structs for various machines are in the *-tdep.c file
- for each machine. */
-
-#define EXT_EXP_NAN 0x7FFF /* Exponent value that indicates NaN */
-#define EXT_EXP_BIAS 0x3FFF /* Amount added to "true" exponent for ext */
-#define DBL_EXP_BIAS 0x3FF /* Ditto, for doubles */
-
-/* Convert an IEEE extended float to a double.
- FROM is the address of the extended float.
- Store the double in *TO. */
-
-extern void
-ieee_extended_to_double (
-#ifdef __STDC__
- struct ext_format *ext_format, char *from, double *to
-#endif
-);
-
-/* The converse: convert the double *FROM to an extended float
- and store where TO points. */
-
-void
-double_to_ieee_extended (
-#ifdef __STDC__
- struct ext_format *ext_format, double *from, char *to
-#endif
-);
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
deleted file mode 100644
index f387ba0..0000000
--- a/gdb/infcmd.c
+++ /dev/null
@@ -1,1116 +0,0 @@
-/* Memory-access and commands for inferior process, for GDB.
- Copyright (C) 1986, 1987, 1988, 1989 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <signal.h>
-#include <sys/param.h>
-#include <string.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "inferior.h"
-#include "environ.h"
-#include "value.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
-#include "target.h"
-
-extern char *sys_siglist[];
-
-extern void until_break_command (); /* breakpoint.c */
-
-#define ERROR_NO_INFERIOR \
- if (!target_has_execution) error ("The program is not being run.");
-
-/* String containing arguments to give to the program, separated by spaces.
- Empty string (pointer to '\0') means no args. */
-
-static char *inferior_args;
-
-/* File name for default use for standard in/out in the inferior. */
-
-char *inferior_io_terminal;
-
-/* Pid of our debugged inferior, or 0 if no inferior now.
- Since various parts of infrun.c test this to see whether there is a program
- being debugged it should be nonzero (currently 3 is used) for remote
- debugging. */
-
-int inferior_pid;
-
-/* Last signal that the inferior received (why it stopped). */
-
-int stop_signal;
-
-/* Address at which inferior stopped. */
-
-CORE_ADDR stop_pc;
-
-/* Stack frame when program stopped. */
-
-FRAME_ADDR stop_frame_address;
-
-/* Chain containing status of breakpoint(s) that we have stopped at. */
-
-bpstat stop_bpstat;
-
-/* Flag indicating that a command has proceeded the inferior past the
- current breakpoint. */
-
-int breakpoint_proceeded;
-
-/* Nonzero if stopped due to a step command. */
-
-int stop_step;
-
-/* Nonzero if stopped due to completion of a stack dummy routine. */
-
-int stop_stack_dummy;
-
-/* Nonzero if stopped due to a random (unexpected) signal in inferior
- process. */
-
-int stopped_by_random_signal;
-
-/* Range to single step within.
- If this is nonzero, respond to a single-step signal
- by continuing to step if the pc is in this range. */
-
-CORE_ADDR step_range_start; /* Inclusive */
-CORE_ADDR step_range_end; /* Exclusive */
-
-/* Stack frame address as of when stepping command was issued.
- This is how we know when we step into a subroutine call,
- and how to set the frame for the breakpoint used to step out. */
-
-FRAME_ADDR step_frame_address;
-
-/* 1 means step over all subroutine calls.
- -1 means step over calls to undebuggable functions. */
-
-int step_over_calls;
-
-/* If stepping, nonzero means step count is > 1
- so don't print frame next time inferior stops
- if it stops due to stepping. */
-
-int step_multi;
-
-/* Environment to use for running inferior,
- in format described in environ.h. */
-
-struct environ *inferior_environ;
-
-CORE_ADDR read_pc ();
-void breakpoint_clear_ignore_counts ();
-
-
-/* ARGSUSED */
-void
-tty_command (file, from_tty)
- char *file;
- int from_tty;
-{
- if (file == 0)
- error_no_arg ("terminal name for running target process");
-
- inferior_io_terminal = savestring (file, strlen (file));
-}
-
-static void
-run_command (args, from_tty)
- char *args;
- int from_tty;
-{
- char *exec_file;
-
- dont_repeat ();
-
- if (inferior_pid)
- {
- if (
- !query ("The program being debugged has been started already.\n\
-Start it from the beginning? "))
- error ("Program not restarted.");
- target_kill ((char *)0, 0);
- }
-
- exec_file = (char *) get_exec_file (0);
-
- /* The exec file is re-read every time we do an inferior_died, so
- we just have to worry about the symbol file. */
- reread_symbols ();
-
- if (args)
- {
- char *cmd;
- cmd = concat ("set args ", args, "");
- make_cleanup (free, cmd);
- execute_command (cmd, from_tty);
- }
-
- if (from_tty)
- {
- printf ("Starting program: %s %s\n",
- exec_file? exec_file: "", inferior_args);
- fflush (stdout);
- }
-
- target_create_inferior (exec_file, inferior_args,
- environ_vector (inferior_environ));
-}
-
-void
-continue_command (proc_count_exp, from_tty)
- char *proc_count_exp;
- int from_tty;
-{
- ERROR_NO_INFERIOR;
-
- /* If have argument, set proceed count of breakpoint we stopped at. */
-
- if (proc_count_exp != NULL)
- {
- bpstat bs = stop_bpstat;
- int num = bpstat_num (&bs);
- if (num == 0 && from_tty)
- {
- printf_filtered
- ("Not stopped at any breakpoint; argument ignored.\n");
- }
- while (num != 0)
- {
- set_ignore_count (num,
- parse_and_eval_address (proc_count_exp) - 1,
- from_tty);
- /* set_ignore_count prints a message ending with a period.
- So print two spaces before "Continuing.". */
- if (from_tty)
- printf (" ");
- num = bpstat_num (&bs);
- }
- }
-
- if (from_tty)
- printf ("Continuing.\n");
-
- clear_proceed_status ();
-
- proceed ((CORE_ADDR) -1, -1, 0);
-}
-
-/* Step until outside of current statement. */
-static void step_1 ();
-
-/* ARGSUSED */
-static void
-step_command (count_string, from_tty)
- char * count_string;
- int from_tty;
-{
- step_1 (0, 0, count_string);
-}
-
-/* Likewise, but skip over subroutine calls as if single instructions. */
-
-/* ARGSUSED */
-static void
-next_command (count_string, from_tty)
- char * count_string;
- int from_tty;
-{
- step_1 (1, 0, count_string);
-}
-
-/* Likewise, but step only one instruction. */
-
-/* ARGSUSED */
-static void
-stepi_command (count_string, from_tty)
- char * count_string;
- int from_tty;
-{
- step_1 (0, 1, count_string);
-}
-
-/* ARGSUSED */
-static void
-nexti_command (count_string, from_tty)
- char * count_string;
- int from_tty;
-{
- step_1 (1, 1, count_string);
-}
-
-static void
-step_1 (skip_subroutines, single_inst, count_string)
- int skip_subroutines;
- int single_inst;
- char *count_string;
-{
- register int count = 1;
- FRAME fr;
-
- ERROR_NO_INFERIOR;
- count = count_string ? parse_and_eval_address (count_string) : 1;
-
- for (; count > 0; count--)
- {
- clear_proceed_status ();
-
-
- fr = get_current_frame ();
- if (!fr) /* Avoid coredump here. Why tho? */
- error ("No current frame");
- step_frame_address = FRAME_FP (fr);
-
- if (! single_inst)
- {
- find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end);
- if (step_range_end == 0)
- {
- int misc;
-
- misc = find_pc_misc_function (stop_pc);
- target_terminal_ours ();
- printf ("Current function has no line number information.\n");
- fflush (stdout);
-
- /* No info or after _etext ("Can't happen") */
- if (misc == -1 || misc == misc_function_count - 1)
- error ("No data available on pc function.");
-
- printf ("Single stepping until function exit.\n");
- fflush (stdout);
-
- step_range_start = misc_function_vector[misc].address;
- step_range_end = misc_function_vector[misc + 1].address;
- }
- }
- else
- {
- /* Say we are stepping, but stop after one insn whatever it does.
- Don't step through subroutine calls even to undebuggable
- functions. */
- step_range_start = step_range_end = 1;
- if (!skip_subroutines)
- step_over_calls = 0;
- }
-
- if (skip_subroutines)
- step_over_calls = 1;
-
- step_multi = (count > 1);
- proceed ((CORE_ADDR) -1, -1, 1);
- if (! stop_step)
- break;
-#if defined (SHIFT_INST_REGS)
- write_register (NNPC_REGNUM, read_register (NPC_REGNUM));
- write_register (NPC_REGNUM, read_register (PC_REGNUM));
-#endif
- }
-}
-
-/* Continue program at specified address. */
-
-static void
-jump_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- register CORE_ADDR addr;
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
-
- ERROR_NO_INFERIOR;
-
- if (!arg)
- error_no_arg ("starting address");
-
- sals = decode_line_spec_1 (arg, 1);
- if (sals.nelts != 1)
- {
- error ("Unreasonable jump request");
- }
-
- sal = sals.sals[0];
- free (sals.sals);
-
- if (sal.symtab == 0 && sal.pc == 0)
- error ("No source file has been specified.");
-
- if (sal.pc == 0)
- sal.pc = find_line_pc (sal.symtab, sal.line);
-
- {
- struct symbol *fn = get_frame_function (get_current_frame ());
- struct symbol *sfn = find_pc_function (sal.pc);
- if (fn != 0 && sfn != fn
- && ! query ("Line %d is not in `%s'. Jump anyway? ",
- sal.line, SYMBOL_NAME (fn)))
- error ("Not confirmed.");
- }
-
- if (sal.pc == 0)
- error ("No line %d in file \"%s\".", sal.line, sal.symtab->filename);
-
- addr = ADDR_BITS_SET (sal.pc);
-
- if (from_tty)
- printf ("Continuing at 0x%x.\n", addr);
-
- clear_proceed_status ();
- proceed (addr, 0, 0);
-}
-
-/* Continue program giving it specified signal. */
-
-static void
-signal_command (signum_exp, from_tty)
- char *signum_exp;
- int from_tty;
-{
- register int signum;
-
- dont_repeat (); /* Too dangerous. */
- ERROR_NO_INFERIOR;
-
- if (!signum_exp)
- error_no_arg ("signal number");
-
- signum = parse_and_eval_address (signum_exp);
-
- if (from_tty)
- printf ("Continuing with signal %d.\n", signum);
-
- clear_proceed_status ();
- proceed (stop_pc, signum, 0);
-}
-
-/* Execute a "stack dummy", a piece of code stored in the stack
- by the debugger to be executed in the inferior.
-
- To call: first, do PUSH_DUMMY_FRAME.
- Then push the contents of the dummy. It should end with a breakpoint insn.
- Then call here, passing address at which to start the dummy.
-
- The contents of all registers are saved before the dummy frame is popped
- and copied into the buffer BUFFER.
-
- The dummy's frame is automatically popped whenever that break is hit.
- If that is the first time the program stops, run_stack_dummy
- returns to its caller with that frame already gone.
- Otherwise, the caller never gets returned to. */
-
-/* 4 => return instead of letting the stack dummy run. */
-
-static int stack_dummy_testing = 0;
-
-void
-run_stack_dummy (addr, buffer)
- CORE_ADDR addr;
- char buffer[REGISTER_BYTES];
-{
- /* Now proceed, having reached the desired place. */
- clear_proceed_status ();
- if (stack_dummy_testing & 4)
- {
- POP_FRAME;
- return;
- }
- proceed_to_finish = 1; /* We want stop_registers, please... */
- proceed (addr, 0, 0);
-
- if (!stop_stack_dummy)
- /* This used to say
- "Cannot continue previously requested operation". */
- error ("\
-The program being debugged stopped while in a function called from GDB.\n\
-The expression which contained the function call has been discarded.");
-
- /* On return, the stack dummy has been popped already. */
-
- bcopy (stop_registers, buffer, sizeof stop_registers);
-}
-
-/* Proceed until we reach a different source line with pc greater than
- our current one or exit the function. We skip calls in both cases.
-
- Note that eventually this command should probably be changed so
- that only source lines are printed out when we hit the breakpoint
- we set. I'm going to postpone this until after a hopeful rewrite
- of wait_for_inferior and the proceed status code. -- randy */
-
-/* ARGSUSED */
-void
-until_next_command (from_tty)
- int from_tty;
-{
- FRAME frame;
- CORE_ADDR pc;
- struct symbol *func;
- struct symtab_and_line sal;
-
- clear_proceed_status ();
-
- frame = get_current_frame ();
-
- /* Step until either exited from this function or greater
- than the current line (if in symbolic section) or pc (if
- not). */
-
- pc = read_pc ();
- func = find_pc_function (pc);
-
- if (!func)
- {
- int misc_func = find_pc_misc_function (pc);
-
- if (misc_func != -1)
- error ("Execution is not within a known function.");
-
- step_range_start = misc_function_vector[misc_func].address;
- step_range_end = pc;
- }
- else
- {
- sal = find_pc_line (pc, 0);
-
- step_range_start = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
- step_range_end = sal.end;
- }
-
- step_over_calls = 1;
- step_frame_address = FRAME_FP (frame);
-
- step_multi = 0; /* Only one call to proceed */
-
- proceed ((CORE_ADDR) -1, -1, 1);
-}
-
-void
-until_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- if (!target_has_execution)
- error ("The program is not running.");
- if (arg)
- until_break_command (arg, from_tty);
- else
- until_next_command (from_tty);
-}
-
-/* "finish": Set a temporary breakpoint at the place
- the selected frame will return to, then continue. */
-
-static void
-finish_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- struct symtab_and_line sal;
- register FRAME frame;
- struct frame_info *fi;
- register struct symbol *function;
-
- if (arg)
- error ("The \"finish\" command does not take any arguments.");
- if (!target_has_execution)
- error ("The program is not running.");
- if (selected_frame == NULL)
- error ("No selected frame.");
-
- frame = get_prev_frame (selected_frame);
- if (frame == 0)
- error ("\"finish\" not meaningful in the outermost frame.");
-
- clear_proceed_status ();
-
- fi = get_frame_info (frame);
- sal = find_pc_line (fi->pc, 0);
- sal.pc = fi->pc;
- set_momentary_breakpoint (sal, frame);
-
- /* Find the function we will return from. */
-
- fi = get_frame_info (selected_frame);
- function = find_pc_function (fi->pc);
-
- if (from_tty)
- {
- printf ("Run till exit from ");
- print_selected_frame ();
- }
-
- proceed_to_finish = 1; /* We want stop_registers, please... */
- proceed ((CORE_ADDR) -1, -1, 0);
-
- if (bpstat_momentary_breakpoint (stop_bpstat) && function != 0)
- {
- struct type *value_type;
- register value val;
- CORE_ADDR funcaddr;
-
- value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
- if (!value_type)
- fatal ("internal: finish_command: function has no target type");
-
- if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
- return;
-
- funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
-
- val = value_being_returned (value_type, stop_registers,
- using_struct_return (value_of_variable (function),
- funcaddr,
- value_type,
- BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function))));
-
- printf ("Value returned is $%d = ", record_latest_value (val));
- value_print (val, stdout, 0, Val_no_prettyprint);
- putchar ('\n');
- }
-}
-
-/* ARGSUSED */
-static void
-program_info (args, from_tty)
- char *args;
- int from_tty;
-{
- bpstat bs = stop_bpstat;
- int num = bpstat_num (&bs);
-
- if (!target_has_execution)
- {
- printf ("The program being debugged is not being run.\n");
- return;
- }
-
- target_files_info ();
- printf ("Program stopped at 0x%x.\n", stop_pc);
- if (stop_step)
- printf ("It stopped after being stepped.\n");
- else if (num != 0)
- {
- /* There may be several breakpoints in the same place, so this
- isn't as strange as it seems. */
- while (num != 0)
- {
- if (num < 0)
- printf ("It stopped at a breakpoint that has since been deleted.\n");
- else
- printf ("It stopped at breakpoint %d.\n", num);
- num = bpstat_num (&bs);
- }
- }
- else if (stop_signal) {
-#ifdef PRINT_RANDOM_SIGNAL
- PRINT_RANDOM_SIGNAL (stop_signal);
-#else
- printf ("It stopped with signal %d (%s).\n",
- stop_signal,
- (stop_signal > NSIG)? "unknown": sys_siglist[stop_signal]);
-#endif
- }
-
- if (!from_tty)
- printf ("Type \"info stack\" or \"info registers\" for more information.\n");
-}
-
-static void
-environment_info (var)
- char *var;
-{
- if (var)
- {
- register char *val = get_in_environ (inferior_environ, var);
- if (val)
- printf ("%s = %s\n", var, val);
- else
- printf ("Environment variable \"%s\" not defined.\n", var);
- }
- else
- {
- register char **vector = environ_vector (inferior_environ);
- while (*vector)
- printf ("%s\n", *vector++);
- }
-}
-
-static void
-set_environment_command (arg)
- char *arg;
-{
- register char *p, *val, *var;
- int nullset = 0;
-
- if (arg == 0)
- error_no_arg ("environment variable and value");
-
- /* Find seperation between variable name and value */
- p = (char *) strchr (arg, '=');
- val = (char *) strchr (arg, ' ');
-
- if (p != 0 && val != 0)
- {
- /* We have both a space and an equals. If the space is before the
- equals and the only thing between the two is more space, use
- the equals */
- if (p > val)
- while (*val == ' ')
- val++;
-
- /* Take the smaller of the two. If there was space before the
- "=", they will be the same right now. */
- p = arg + min (p - arg, val - arg);
- }
- else if (val != 0 && p == 0)
- p = val;
-
- if (p == arg)
- error_no_arg ("environment variable to set");
-
- if (p == 0 || p[1] == 0)
- {
- nullset = 1;
- if (p == 0)
- p = arg + strlen (arg); /* So that savestring below will work */
- }
- else
- {
- /* Not setting variable value to null */
- val = p + 1;
- while (*val == ' ' || *val == '\t')
- val++;
- }
-
- while (p != arg && (p[-1] == ' ' || p[-1] == '\t')) p--;
-
- var = savestring (arg, p - arg);
- if (nullset)
- {
- printf ("Setting environment variable \"%s\" to null value.\n", var);
- set_in_environ (inferior_environ, var, "");
- }
- else
- set_in_environ (inferior_environ, var, val);
- free (var);
-}
-
-static void
-unset_environment_command (var, from_tty)
- char *var;
- int from_tty;
-{
- if (var == 0)
- {
- /* If there is no argument, delete all environment variables.
- Ask for confirmation if reading from the terminal. */
- if (!from_tty || query ("Delete all environment variables? "))
- {
- free_environ (inferior_environ);
- inferior_environ = make_environ ();
- }
- }
- else
- unset_in_environ (inferior_environ, var);
-}
-
-/* Handle the execution path (PATH variable) */
-
-const static char path_var_name[] = "PATH";
-
-/* ARGSUSED */
-void
-path_info (args, from_tty)
- char *args;
- int from_tty;
-{
- printf ("Executable and object file path: %s\n",
- get_in_environ (inferior_environ, path_var_name));
-}
-
-/* Add zero or more directories to the front of the execution path. */
-
-void
-path_command (dirname, from_tty)
- char *dirname;
- int from_tty;
-{
- char *exec_path;
-
- dont_repeat ();
- exec_path = strsave (get_in_environ (inferior_environ, path_var_name));
- mod_path (dirname, &exec_path);
- set_in_environ (inferior_environ, path_var_name, exec_path);
- free (exec_path);
- if (from_tty)
- path_info ((char *)NULL, from_tty);
-}
-
-CORE_ADDR
-read_pc ()
-{
- return ADDR_BITS_REMOVE ((CORE_ADDR) read_register (PC_REGNUM));
-}
-
-void
-write_pc (val)
- CORE_ADDR val;
-{
- write_register (PC_REGNUM, (long) val);
-#ifdef NPC_REGNUM
- write_register (NPC_REGNUM, (long) val+4);
-#endif
- pc_changed = 0;
-}
-
-char *reg_names[] = REGISTER_NAMES;
-
-/* Print out the machine register regnum. If regnum is -1,
- print all registers.
- For most machines, having all_registers_info() print the
- register(s) one per line is good enough. If a different format
- is required, (eg, for SPARC or Pyramid 90x, which both have
- lots of regs), or there is an existing convention for showing
- all the registers, define the macro DO_REGISTERS_INFO(regnum)
- to provide that format. */
-#if !defined (DO_REGISTERS_INFO)
-#define DO_REGISTERS_INFO(regnum) do_registers_info(regnum)
-static void do_registers_info (regnum)
- int regnum;
-{
- register int i;
-
- if (regnum == -1)
- printf_filtered (
- "Register Contents (relative to selected stack frame)\n\n");
-
- for (i = 0; i < NUM_REGS; i++)
- {
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
- char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
-
- if (regnum != -1 && i != regnum)
- continue;
-
- fputs_filtered (reg_names[i], stdout);
- print_spaces_filtered (15 - strlen (reg_names[i]), stdout);
-
- /* Get the data in raw format, then convert also to virtual format. */
- if (read_relative_register_raw_bytes (i, raw_buffer))
- {
- printf_filtered ("Invalid register contents\n");
- continue;
- }
-
- target_convert_to_virtual (i, raw_buffer, virtual_buffer);
-
- /* If virtual format is floating, print it that way, and in raw hex. */
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT
- && ! INVALID_FLOAT (virtual_buffer, REGISTER_VIRTUAL_SIZE (i)))
- {
- register int j;
-
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0,
- stdout, 0, 1, 0, Val_pretty_default);
-
- printf_filtered ("\t(raw 0x");
- for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
- printf_filtered ("%02x", (unsigned char)raw_buffer[j]);
- printf_filtered (")");
- }
-
-/* FIXME! val_print probably can handle all of these cases now... */
-
- /* Else if virtual format is too long for printf,
- print in hex a byte at a time. */
- else if (REGISTER_VIRTUAL_SIZE (i) > sizeof (long))
- {
- register int j;
- printf_filtered ("0x");
- for (j = 0; j < REGISTER_VIRTUAL_SIZE (i); j++)
- printf_filtered ("%02x", (unsigned char)virtual_buffer[j]);
- }
- /* Else print as integer in hex and in decimal. */
- else
- {
- val_print (REGISTER_VIRTUAL_TYPE (i), raw_buffer, 0,
- stdout, 'x', 1, 0, Val_pretty_default);
- printf_filtered ("\t");
- val_print (REGISTER_VIRTUAL_TYPE (i), raw_buffer, 0,
- stdout, 0, 1, 0, Val_pretty_default);
- }
-
- /* The SPARC wants to print even-numbered float regs as doubles
- in addition to printing them as floats. */
-#ifdef PRINT_REGISTER_HOOK
- PRINT_REGISTER_HOOK (i);
-#endif
-
- printf_filtered ("\n");
- }
-}
-#endif /* no DO_REGISTERS_INFO. */
-
-static void
-registers_info (addr_exp)
- char *addr_exp;
-{
- int regnum;
-
- if (!target_has_registers)
- error ("The program has no registers now.");
-
- if (addr_exp)
- {
- if (*addr_exp >= '0' && *addr_exp <= '9')
- regnum = atoi (addr_exp);
- else
- {
- register char *p = addr_exp;
- if (p[0] == '$')
- p++;
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (!strcmp (p, reg_names[regnum]))
- break;
- if (regnum == NUM_REGS)
- error ("%s: invalid register name.", addr_exp);
- }
- }
- else
- regnum = -1;
-
- DO_REGISTERS_INFO(regnum);
-}
-
-/*
- * TODO:
- * Should save/restore the tty state since it might be that the
- * program to be debugged was started on this tty and it wants
- * the tty in some state other than what we want. If it's running
- * on another terminal or without a terminal, then saving and
- * restoring the tty state is a harmless no-op.
- * This only needs to be done if we are attaching to a process.
- */
-
-/*
- * attach_command --
- * takes a program started up outside of gdb and ``attaches'' to it.
- * This stops it cold in its tracks and allows us to start tracing it.
- * For this to work, we must be able to send the process a
- * signal and we must have the same effective uid as the program.
- */
-void
-attach_command (args, from_tty)
- char *args;
- int from_tty;
-{
- dont_repeat (); /* Not for the faint of heart */
- target_attach (args, from_tty);
-}
-
-/*
- * detach_command --
- * takes a program previously attached to and detaches it.
- * The program resumes execution and will no longer stop
- * on signals, etc. We better not have left any breakpoints
- * in the program or it'll die when it hits one. For this
- * to work, it may be necessary for the process to have been
- * previously attached. It *might* work if the program was
- * started via the normal ptrace (PTRACE_TRACEME).
- */
-
-static void
-detach_command (args, from_tty)
- char *args;
- int from_tty;
-{
- dont_repeat (); /* Not for the faint of heart */
- target_detach (args, from_tty);
-}
-
-/* ARGSUSED */
-static void
-float_info (addr_exp)
- char *addr_exp;
-{
-#ifdef FLOAT_INFO
- FLOAT_INFO;
-#else
- printf ("No floating point info available for this processor.\n");
-#endif
-}
-
-struct cmd_list_element *unsetlist = NULL;
-
-/* ARGSUSED */
-static void
-unset_command (args, from_tty)
- char *args;
- int from_tty;
-{
- printf ("\"unset\" must be followed by the name of an unset subcommand.\n");
- help_list (unsetlist, "unset ", -1, stdout);
-}
-
-void
-_initialize_infcmd ()
-{
- struct cmd_list_element *c;
-
- add_com ("tty", class_run, tty_command,
- "Set terminal for future runs of program being debugged.");
-
- add_show_from_set
- (add_set_cmd ("args", class_run, var_string_noescape, (char *)&inferior_args,
-
-"Set arguments to give program being debugged when it is started.\n\
-Follow this command with any number of args, to be passed to the program.",
- &setlist),
- &showlist);
-
- c = add_cmd
- ("environment", no_class, environment_info,
- "The environment to give the program, or one variable's value.\n\
-With an argument VAR, prints the value of environment variable VAR to\n\
-give the program being debugged. With no arguments, prints the entire\n\
-environment to be given to the program.", &showlist);
- c->completer = noop_completer;
-
- add_prefix_cmd ("unset", no_class, unset_command,
- "Complement to certain \"set\" commands",
- &unsetlist, "unset ", 0, &cmdlist);
-
- c = add_cmd ("environment", class_run, unset_environment_command,
- "Cancel environment variable VAR for the program.\n\
-This does not affect the program until the next \"run\" command.",
- &unsetlist);
- c->completer = noop_completer;
-
- c = add_cmd ("environment", class_run, set_environment_command,
- "Set environment variable value to give the program.\n\
-Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
-VALUES of environment variables are uninterpreted strings.\n\
-This does not affect the program until the next \"run\" command.",
- &setlist);
- c->completer = noop_completer;
-
- add_com ("path", class_files, path_command,
- "Add directory DIR(s) to beginning of search path for object files.\n\
-$cwd in the path means the current working directory.\n\
-This path is equivalent to the $PATH shell variable. It is a list of\n\
-directories, separated by colons. These directories are searched to find\n\
-fully linked executable files and separately compiled object files as needed.");
-
- add_info ("path", path_info,
- "Current search path for finding object files.\n\
-$cwd in the path means the current working directory.\n\
-This path is equivalent to the $PATH shell variable. It is a list of\n\
-directories, separated by colons. These directories are searched to find\n\
-fully linked executable files and separately compiled object files as needed.");
-
- add_com ("attach", class_run, attach_command,
- "Attach to a process or file outside of GDB.\n\
-This command attaches to another target, of the same type as your last\n\
-`target' command (`info files' will show your target stack).\n\
-The command may take as argument a process id or a device file.\n\
-For a process id, you must have permission to send the process a signal,\n\
-and it must have the same effective uid as the debugger.\n\
-When using \"attach\", you should use the \"file\" command to specify\n\
-the program running in the process, and to load its symbol table.");
-
- add_com ("detach", class_run, detach_command,
- "Detach a process or file previously attached.\n\
-If a process, it is no longer traced, and it continues its execution. If you\n\
-were debugging a file, the file is closed and gdb no longer accesses it.");
-
- add_com ("signal", class_run, signal_command,
- "Continue program giving it signal number SIGNUMBER.");
-
- add_com ("stepi", class_run, stepi_command,
- "Step one instruction exactly.\n\
-Argument N means do this N times (or till program stops for another reason).");
- add_com_alias ("si", "stepi", class_alias, 0);
-
- add_com ("nexti", class_run, nexti_command,
- "Step one instruction, but proceed through subroutine calls.\n\
-Argument N means do this N times (or till program stops for another reason).");
- add_com_alias ("ni", "nexti", class_alias, 0);
-
- add_com ("finish", class_run, finish_command,
- "Execute until selected stack frame returns.\n\
-Upon return, the value returned is printed and put in the value history.");
-
- add_com ("next", class_run, next_command,
- "Step program, proceeding through subroutine calls.\n\
-Like the \"step\" command as long as subroutine calls do not happen;\n\
-when they do, the call is treated as one instruction.\n\
-Argument N means do this N times (or till program stops for another reason).");
- add_com_alias ("n", "next", class_run, 1);
-
- add_com ("step", class_run, step_command,
- "Step program until it reaches a different source line.\n\
-Argument N means do this N times (or till program stops for another reason).");
- add_com_alias ("s", "step", class_run, 1);
-
- add_com ("until", class_run, until_command,
- "Execute until the program reaches a source line greater than the current\n\
-or a specified line or address or function (same args as break command).\n\
-Execution will also stop upon exit from the current stack frame.");
- add_com_alias ("u", "until", class_run, 1);
-
- add_com ("jump", class_run, jump_command,
- "Continue program being debugged at specified line or address.\n\
-Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
-for an address to start at.");
-
- add_com ("continue", class_run, continue_command,
- "Continue program being debugged, after signal or breakpoint.\n\
-If proceeding from breakpoint, a number N may be used as an argument:\n\
-then the same breakpoint won't break until the Nth time it is reached.");
- add_com_alias ("c", "cont", class_run, 1);
- add_com_alias ("fg", "cont", class_run, 1);
-
- add_com ("run", class_run, run_command,
- "Start debugged program. You may specify arguments to give it.\n\
-Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n\
-Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n\n\
-With no arguments, uses arguments last specified (with \"run\" or \"set args\".\n\
-To cancel previous arguments and run with no arguments,\n\
-use \"set args\" without arguments.");
- add_com_alias ("r", "run", class_run, 1);
-
- add_info ("registers", registers_info,
- "List of registers and their contents, for selected stack frame.\n\
-Register name as argument means describe only that register.");
-
- add_info ("program", program_info,
- "Execution status of the program.");
-
- add_info ("float", float_info,
- "Print the status of the floating point unit\n");
-
- inferior_args = savestring ("", 1); /* Initially no args */
- inferior_environ = make_environ ();
- init_environ (inferior_environ);
-}
diff --git a/gdb/inferior.h b/gdb/inferior.h
deleted file mode 100644
index eed848c..0000000
--- a/gdb/inferior.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/* Variables that describe the inferior process running under GDB:
- Where it is, why it stopped, and how to step it.
- Copyright (C) 1986, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* For bpstat. */
-#include "breakpoint.h"
-
-/* For FRAME_ADDR. */
-#include "frame.h"
-
-/*
- * Structure in which to save the status of the inferior. Save
- * through "save_inferior_status", restore through
- * "restore_inferior_status".
- * This pair of routines should be called around any transfer of
- * control to the inferior which you don't want showing up in your
- * control variables.
- */
-struct inferior_status {
- int pc_changed;
- int stop_signal;
- int stop_pc;
- FRAME_ADDR stop_frame_address;
- bpstat stop_bpstat;
- int stop_step;
- int stop_stack_dummy;
- int stopped_by_random_signal;
- int trap_expected;
- CORE_ADDR step_range_start;
- CORE_ADDR step_range_end;
- FRAME_ADDR step_frame_address;
- int step_over_calls;
- CORE_ADDR step_resume_break_address;
- int stop_after_trap;
- int stop_soon_quietly;
- FRAME_ADDR selected_frame_address;
- int selected_level;
- char stop_registers[REGISTER_BYTES];
- int breakpoint_proceeded;
- int restore_stack_info;
- int proceed_to_finish;
-};
-
-void save_inferior_status (), restore_inferior_status ();
-
-/* File name for default use for standard in/out in the inferior. */
-
-extern char *inferior_io_terminal;
-
-/* Pid of our debugged inferior, or 0 if no inferior now. */
-
-extern int inferior_pid;
-
-/* Character array containing an image of the inferior programs' registers. */
-
-extern char registers[];
-
-extern void clear_proceed_status ();
-extern void start_inferior ();
-extern void proceed ();
-extern void kill_inferior ();
-extern void kill_inferior_fast ();
-extern void generic_mourn_inferior ();
-extern void terminal_ours ();
-extern void detach ();
-extern void run_stack_dummy ();
-extern CORE_ADDR read_pc ();
-extern void write_pc ();
-extern void wait_for_inferior ();
-extern void init_wait_for_inferior ();
-extern void close_exec_file ();
-extern void reopen_exec_file ();
-
-/* From infcmd.c */
-void attach_command (
-#ifdef __STDC__
- char *arg, int from_tty
-#endif
- );
-
-/* Last signal that the inferior received (why it stopped). */
-
-extern int stop_signal;
-
-/* Address at which inferior stopped. */
-
-extern CORE_ADDR stop_pc;
-
-/* Stack frame when program stopped. */
-
-extern FRAME_ADDR stop_frame_address;
-
-/* Chain containing status of breakpoint(s) that we have stopped at. */
-
-extern bpstat stop_bpstat;
-
-/* Flag indicating that a command has proceeded the inferior past the
- current breakpoint. */
-
-extern int breakpoint_proceeded;
-
-/* Nonzero if stopped due to a step command. */
-
-extern int stop_step;
-
-/* Nonzero if stopped due to completion of a stack dummy routine. */
-
-extern int stop_stack_dummy;
-
-/* Nonzero if program stopped due to a random (unexpected) signal in
- inferior process. */
-
-extern int stopped_by_random_signal;
-
-/* Range to single step within.
- If this is nonzero, respond to a single-step signal
- by continuing to step if the pc is in this range. */
-
-extern CORE_ADDR step_range_start; /* Inclusive */
-extern CORE_ADDR step_range_end; /* Exclusive */
-
-/* Stack frame address as of when stepping command was issued.
- This is how we know when we step into a subroutine call,
- and how to set the frame for the breakpoint used to step out. */
-
-extern FRAME_ADDR step_frame_address;
-
-/* 1 means step over all subroutine calls.
- -1 means step over calls to undebuggable functions. */
-
-extern int step_over_calls;
-
-/* If stepping, nonzero means step count is > 1
- so don't print frame next time inferior stops
- if it stops due to stepping. */
-
-extern int step_multi;
-
-/* Nonzero means expecting a trap and caller will handle it themselves.
- It is used after attach, due to attaching to a process;
- when running in the shell before the child program has been exec'd;
- and when running some kinds of remote stuff (FIXME?). */
-
-int stop_soon_quietly;
-
-/* Nonzero if proceed is being used for a "finish" command or a similar
- situation when stop_registers should be saved. */
-
-extern int proceed_to_finish;
-
-/* Save register contents here when about to pop a stack dummy frame,
- if-and-only-if proceed_to_finish is set.
- Thus this contains the return value from the called function (assuming
- values are returned in a register). */
-
-extern char stop_registers[REGISTER_BYTES];
-
-/* Nonzero if pc has been changed by the debugger
- since the inferior stopped. */
-
-extern int pc_changed;
-
-/* Nonzero if the child process in inferior_pid was attached rather
- than forked. */
-
-int attach_flag;
-
-/* Possible values for CALL_DUMMY_LOCATION. */
-#define ON_STACK 1
-#define BEFORE_TEXT_END 2
-#define AFTER_TEXT_END 3
-
-#if !defined (CALL_DUMMY_LOCATION)
-#define CALL_DUMMY_LOCATION ON_STACK
-#endif /* No CALL_DUMMY_LOCATION. */
-
-/* Are we in a call dummy? The code below which allows DECR_PC_AFTER_BREAK
- below is for infrun.c, which may give the macro a pc without that
- subtracted out. */
-#if !defined (PC_IN_CALL_DUMMY)
-#if CALL_DUMMY_LOCATION == BEFORE_TEXT_END
-#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
- ((pc) >= text_end - CALL_DUMMY_LENGTH \
- && (pc) < text_end + DECR_PC_AFTER_BREAK)
-#else /* Not before text_end. */
-#if CALL_DUMMY_LOCATION == AFTER_TEXT_END
-#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
- ((pc) >= text_end \
- && (pc) < text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK)
-#else /* On stack. */
-#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
- ((sp) INNER_THAN (pc) && (pc) INNER_THAN (frame_address))
-#endif /* On stack. */
-#endif /* Not before text_end. */
-#endif /* No PC_IN_CALL_DUMMY. */
diff --git a/gdb/inflow.c b/gdb/inflow.c
deleted file mode 100644
index fd8f0b8..0000000
--- a/gdb/inflow.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/* Low level interface to ptrace, for GDB when running under Unix.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "command.h"
-#include "signals.h"
-#include "terminal.h"
-#include "target.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-/* Some USG-esque systems (some of which are BSD-esque enough so that USG
- is not defined) want this header, and it won't do any harm. */
-#include <fcntl.h>
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-
-extern struct target_ops child_ops;
-
-/* Nonzero if we are debugging an attached outside process
- rather than an inferior. */
-
-int attach_flag;
-
-
-/* Record terminal status separately for debugger and inferior. */
-
-static TERMINAL sg_inferior;
-static TERMINAL sg_ours;
-
-static int tflags_inferior;
-static int tflags_ours;
-
-#if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN)
-static struct tchars tc_inferior;
-static struct tchars tc_ours;
-#endif
-
-#ifdef TIOCGLTC
-static struct ltchars ltc_inferior;
-static struct ltchars ltc_ours;
-#endif
-
-#ifdef TIOCLGET
-static int lmode_inferior;
-static int lmode_ours;
-#endif
-
-#ifdef TIOCGPGRP
-static int pgrp_inferior;
-static int pgrp_ours;
-#else
-static void (*sigint_ours) ();
-static void (*sigquit_ours) ();
-#endif /* TIOCGPGRP */
-
-/* Copy of inferior_io_terminal when inferior was last started. */
-static char *inferior_thisrun_terminal;
-
-static void terminal_ours_1 ();
-
-/* Nonzero if our terminal settings are in effect.
- Zero if the inferior's settings are in effect. */
-static int terminal_is_ours;
-
-/* Initialize the terminal settings we record for the inferior,
- before we actually run the inferior. */
-
-void
-terminal_init_inferior ()
-{
- sg_inferior = sg_ours;
- tflags_inferior = tflags_ours;
-
-#if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN)
- tc_inferior = tc_ours;
-#endif
-
-#ifdef TIOCGLTC
- ltc_inferior = ltc_ours;
-#endif
-
-#ifdef TIOCLGET
- lmode_inferior = lmode_ours;
-#endif
-
-#ifdef TIOCGPGRP
- pgrp_inferior = inferior_pid;
-#endif /* TIOCGPGRP */
-
- terminal_is_ours = 1;
-}
-
-/* Put the inferior's terminal settings into effect.
- This is preparation for starting or resuming the inferior. */
-
-void
-terminal_inferior ()
-{
- if (terminal_is_ours && inferior_thisrun_terminal == 0)
- {
- fcntl (0, F_SETFL, tflags_inferior);
- fcntl (0, F_SETFL, tflags_inferior);
- ioctl (0, TIOCSETN, &sg_inferior);
-
-#if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN)
- ioctl (0, TIOCSETC, &tc_inferior);
-#endif
-#ifdef TIOCGLTC
- ioctl (0, TIOCSLTC, &ltc_inferior);
-#endif
-#ifdef TIOCLGET
- ioctl (0, TIOCLSET, &lmode_inferior);
-#endif
-
-#ifdef TIOCGPGRP
- ioctl (0, TIOCSPGRP, &pgrp_inferior);
-#else
- sigint_ours = (void (*) ()) signal (SIGINT, SIG_IGN);
- sigquit_ours = (void (*) ()) signal (SIGQUIT, SIG_IGN);
-#endif /* TIOCGPGRP */
- }
- terminal_is_ours = 0;
-}
-
-/* Put some of our terminal settings into effect,
- enough to get proper results from our output,
- but do not change into or out of RAW mode
- so that no input is discarded.
-
- After doing this, either terminal_ours or terminal_inferior
- should be called to get back to a normal state of affairs. */
-
-void
-terminal_ours_for_output ()
-{
- terminal_ours_1 (1);
-}
-
-/* Put our terminal settings into effect.
- First record the inferior's terminal settings
- so they can be restored properly later. */
-
-void
-terminal_ours ()
-{
- terminal_ours_1 (0);
-}
-
-static void
-terminal_ours_1 (output_only)
- int output_only;
-{
-#ifdef TIOCGPGRP
- /* Ignore this signal since it will happen when we try to set the pgrp. */
- void (*osigttou) ();
-#endif /* TIOCGPGRP */
-
- /* The check for inferior_thisrun_terminal had been commented out
- when the call to ioctl (TIOCNOTTY) was commented out.
- Checking inferior_thisrun_terminal is necessary so that
- if GDB is running in the background, it won't block trying
- to do the ioctl()'s below. */
- if (inferior_thisrun_terminal != 0)
- return;
-
- if (!terminal_is_ours)
- {
- terminal_is_ours = 1;
-
-#ifdef TIOCGPGRP
- osigttou = (void (*) ()) signal (SIGTTOU, SIG_IGN);
-
- ioctl (0, TIOCGPGRP, &pgrp_inferior);
- ioctl (0, TIOCSPGRP, &pgrp_ours);
-
- signal (SIGTTOU, osigttou);
-#else
- signal (SIGINT, sigint_ours);
- signal (SIGQUIT, sigquit_ours);
-#endif /* TIOCGPGRP */
-
- tflags_inferior = fcntl (0, F_GETFL, 0);
- ioctl (0, TIOCGETP, &sg_inferior);
-
-#if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN)
- ioctl (0, TIOCGETC, &tc_inferior);
-#endif
-#ifdef TIOCGLTC
- ioctl (0, TIOCGLTC, &ltc_inferior);
-#endif
-#ifdef TIOCLGET
- ioctl (0, TIOCLGET, &lmode_inferior);
-#endif
- }
-
-#ifdef HAVE_TERMIO
- sg_ours.c_lflag |= ICANON;
- if (output_only && !(sg_inferior.c_lflag & ICANON))
- sg_ours.c_lflag &= ~ICANON;
-#else /* not HAVE_TERMIO */
- sg_ours.sg_flags &= ~RAW & ~CBREAK;
- if (output_only)
- sg_ours.sg_flags |= (RAW | CBREAK) & sg_inferior.sg_flags;
-#endif /* not HAVE_TERMIO */
-
- fcntl (0, F_SETFL, tflags_ours);
- fcntl (0, F_SETFL, tflags_ours);
- ioctl (0, TIOCSETN, &sg_ours);
-
-#if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN)
- ioctl (0, TIOCSETC, &tc_ours);
-#endif
-#ifdef TIOCGLTC
- ioctl (0, TIOCSLTC, &ltc_ours);
-#endif
-#ifdef TIOCLGET
- ioctl (0, TIOCLSET, &lmode_ours);
-#endif
-
-#ifdef HAVE_TERMIO
- sg_ours.c_lflag |= ICANON;
-#else /* not HAVE_TERMIO */
- sg_ours.sg_flags &= ~RAW & ~CBREAK;
-#endif /* not HAVE_TERMIO */
-}
-
-/* ARGSUSED */
-void
-term_info (arg, from_tty)
- char *arg;
- int from_tty;
-{
- target_terminal_info (arg, from_tty);
-}
-
-/* ARGSUSED */
-void
-child_terminal_info (args, from_tty)
- char *args;
- int from_tty;
-{
- register int i;
-
- printf_filtered ("Inferior's terminal status (currently saved by GDB):\n");
-
-#ifdef HAVE_TERMIO
-
- printf_filtered ("fcntl flags = 0x%x, c_iflag = 0x%x, c_oflag = 0x%x,\n",
- tflags_inferior, sg_inferior.c_iflag, sg_inferior.c_oflag);
- printf_filtered ("c_cflag = 0x%x, c_lflag = 0x%x, c_line = 0x%x.\n",
- sg_inferior.c_cflag, sg_inferior.c_lflag, sg_inferior.c_line);
- printf_filtered ("c_cc: ");
- for (i = 0; (i < NCC); i += 1)
- printf_filtered ("0x%x ", sg_inferior.c_cc[i]);
- printf_filtered ("\n");
-
-#else /* not HAVE_TERMIO */
-
- printf_filtered ("fcntl flags = 0x%x, sgttyb.sg_flags = 0x%x, owner pid = %d.\n",
- tflags_inferior, sg_inferior.sg_flags, pgrp_inferior);
-
-#endif /* not HAVE_TERMIO */
-
-#if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN)
- printf_filtered ("tchars: ");
- for (i = 0; i < (int)sizeof (struct tchars); i++)
- printf_filtered ("0x%x ", ((char *)&tc_inferior)[i]);
- printf_filtered ("\n");
-#endif
-
-#ifdef TIOCGLTC
- printf_filtered ("ltchars: ");
- for (i = 0; i < (int)sizeof (struct ltchars); i++)
- printf_filtered ("0x%x ", ((char *)&ltc_inferior)[i]);
- printf_filtered ("\n");
-#endif
-
-#ifdef TIOCLGET
- printf_filtered ("lmode: 0x%x\n", lmode_inferior);
-#endif
-}
-
-/* NEW_TTY_PREFORK is called before forking a new child process,
- so we can record the state of ttys in the child to be formed.
- TTYNAME is null if we are to share the terminal with gdb;
- or points to a string containing the name of the desired tty.
-
- NEW_TTY is called in new child processes under Unix, which will
- become debugger target processes. This actually switches to
- the terminal specified in the NEW_TTY_PREFORK call. */
-
-new_tty_prefork (ttyname)
- char *ttyname;
-{
- /* Save the name for later, for determining whether we and the child
- are sharing a tty. */
- inferior_thisrun_terminal = ttyname;
-}
-
-void
-new_tty ()
-{
- register int tty;
-
- if (inferior_thisrun_terminal == 0)
- return;
-
-#ifdef TIOCNOTTY
- /* Disconnect the child process from our controlling terminal. */
- tty = open("/dev/tty", O_RDWR);
- if (tty > 0)
- {
- ioctl(tty, TIOCNOTTY, 0);
- close(tty);
- }
-#endif
-
- /* Now open the specified new terminal. */
-
- tty = open(inferior_thisrun_terminal, O_RDWR);
- if (tty == -1)
- {
- print_sys_errmsg (inferior_thisrun_terminal, errno);
- _exit(1);
- }
-
- /* Avoid use of dup2; doesn't exist on all systems. */
- if (tty != 0)
- { close (0); dup (tty); }
- if (tty != 1)
- { close (1); dup (tty); }
- if (tty != 2)
- { close (2); dup (tty); }
- if (tty > 2)
- close(tty);
-}
-
-/* Kill the inferior process. Make us have no inferior. */
-
-/* ARGSUSED */
-static void
-kill_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- if (inferior_pid == 0)
- error ("The program is not being run.");
- if (!query ("Kill the inferior process? "))
- error ("Not confirmed.");
- target_kill (arg, from_tty);
-
- /* Killing off the inferior can leave us with a core file. If so,
- print the state we are left in. */
- if (target_has_stack) {
- printf_filtered ("In %s,\n", current_target->to_longname);
- if (selected_frame == NULL)
- fputs_filtered ("No selected stack frame.\n", stdout);
- else
- print_stack_frame (selected_frame, selected_frame_level, 1);
- }
-}
-
-/* The inferior process has died. Long live the inferior! */
-
-void
-generic_mourn_inferior ()
-{
- inferior_pid = 0;
- attach_flag = 0;
- mark_breakpoints_out ();
- registers_changed ();
-
-#ifdef CLEAR_DEFERRED_STORES
- /* Delete any pending stores to the inferior... */
- CLEAR_DEFERRED_STORES;
-#endif
-
- reopen_exec_file ();
- if (target_has_stack) {
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- select_frame (get_current_frame (), 0);
- } else {
- set_current_frame (0);
- select_frame ((FRAME) 0, -1);
- }
- /* It is confusing to the user for ignore counts to stick around
- from previous runs of the inferior. So clear them. */
- breakpoint_clear_ignore_counts ();
-}
-
-void
-child_mourn_inferior ()
-{
- unpush_target (&child_ops);
- generic_mourn_inferior ();
-}
-
-#if 0
-/* This function is just for testing, and on some systems (Sony NewsOS
- 3.2) <sys/user.h> also includes <sys/time.h> which leads to errors
- (since on this system at least sys/time.h is not protected against
- multiple inclusion). */
-/* ARGSUSED */
-static void
-try_writing_regs_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- register int i;
- register int value;
-
- if (inferior_pid == 0)
- error ("There is no inferior process now.");
-
- /* A Sun 3/50 or 3/60 (at least) running SunOS 4.0.3 will have a
- kernel panic if we try to write past the end of the user area.
- Presumably Sun will fix this bug (it has been reported), but it
- is tacky to crash the system, so at least on SunOS4 we need to
- stop writing when we hit the end of the user area. */
- for (i = 0; i < sizeof (struct user); i += 2)
- {
- QUIT;
- errno = 0;
- value = call_ptrace (3, inferior_pid, i, 0);
- call_ptrace (6, inferior_pid, i, value);
- if (errno == 0)
- {
- printf (" Succeeded with address 0x%x; value 0x%x (%d).\n",
- i, value, value);
- }
- else if ((i & 0377) == 0)
- printf (" Failed at 0x%x.\n", i);
- }
-}
-#endif
-
-void
-_initialize_inflow ()
-{
- add_info ("terminal", term_info,
- "Print inferior's saved terminal status.");
-
-#if 0
- add_com ("try-writing-regs", class_obscure, try_writing_regs_command,
- "Try writing all locations in inferior's system block.\n\
-Report which ones can be written.");
-#endif
-
- add_com ("kill", class_run, kill_command,
- "Kill execution of program being debugged.");
-
- inferior_pid = 0;
-
- ioctl (0, TIOCGETP, &sg_ours);
- tflags_ours = fcntl (0, F_GETFL, 0);
-
-#if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN)
- ioctl (0, TIOCGETC, &tc_ours);
-#endif
-#ifdef TIOCGLTC
- ioctl (0, TIOCGLTC, &ltc_ours);
-#endif
-#ifdef TIOCLGET
- ioctl (0, TIOCLGET, &lmode_ours);
-#endif
-
-#ifdef TIOCGPGRP
- ioctl (0, TIOCGPGRP, &pgrp_ours);
-#endif /* TIOCGPGRP */
-
- terminal_is_ours = 1;
-}
-
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
deleted file mode 100644
index 014576b..0000000
--- a/gdb/infptrace.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/* Low level Unix child interface to ptrace, for GDB when running under Unix.
- Copyright (C) 1988, 1989, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#ifndef USG
-#include <sys/ptrace.h>
-#endif
-
-#if !defined (PT_KILL)
-#define PT_KILL 8
-#define PT_STEP 9
-#define PT_CONTINUE 7
-#define PT_READ_U 3
-#define PT_WRITE_U 6
-#define PT_READ_I 1
-#define PT_READ_D 2
-#define PT_WRITE_I 4
-#define PT_WRITE_D 5
-#endif /* No PT_KILL. */
-
-#ifndef PT_ATTACH
-#define PT_ATTACH PTRACE_ATTACH
-#endif
-#ifndef PT_DETACH
-#define PT_DETACH PTRACE_DETACH
-#endif
-
-#include "gdbcore.h"
-#include <sys/user.h> /* After a.out.h */
-#include <sys/file.h>
-#include <sys/stat.h>
-
-/* This function simply calls ptrace with the given arguments.
- It exists so that all calls to ptrace are isolated in this
- machine-dependent file. */
-int
-call_ptrace (request, pid, addr, data)
- int request, pid, *addr, data;
-{
- return ptrace (request, pid, addr, data);
-}
-
-#ifdef DEBUG_PTRACE
-/* For the rest of the file, use an extra level of indirection */
-/* This lets us breakpoint usefully on call_ptrace. */
-#define ptrace call_ptrace
-#endif
-
-/* This is used when GDB is exiting. It gives less chance of error.*/
-
-void
-kill_inferior_fast ()
-{
- if (inferior_pid == 0)
- return;
- ptrace (PT_KILL, inferior_pid, 0, 0);
- wait ((int *)0);
-}
-
-void
-kill_inferior (args, from_tty)
- char *args;
- int from_tty;
-{
- kill_inferior_fast ();
- target_mourn_inferior ();
-}
-
-/* Resume execution of the inferior process.
- If STEP is nonzero, single-step it.
- If SIGNAL is nonzero, give it that signal. */
-
-void
-child_resume (step, signal)
- int step;
- int signal;
-{
- errno = 0;
-
- /* An address of (int *)1 tells ptrace to continue from where it was.
- (If GDB wanted it to start some other way, we have already written
- a new PC value to the child.) */
-
- if (step)
- ptrace (PT_STEP, inferior_pid, (int *)1, signal);
- else
- ptrace (PT_CONTINUE, inferior_pid, (int *)1, signal);
-
- if (errno)
- perror_with_name ("ptrace");
-}
-
-#ifdef ATTACH_DETACH
-/* Nonzero if we are debugging an attached process rather than
- an inferior. */
-extern int attach_flag;
-
-/* Start debugging the process whose number is PID. */
-int
-attach (pid)
- int pid;
-{
- errno = 0;
- ptrace (PT_ATTACH, pid, 0, 0);
- if (errno)
- perror_with_name ("ptrace");
- attach_flag = 1;
- return pid;
-}
-
-/* Stop debugging the process whose number is PID
- and continue it with signal number SIGNAL.
- SIGNAL = 0 means just continue it. */
-
-void
-detach (signal)
- int signal;
-{
- errno = 0;
- ptrace (PT_DETACH, inferior_pid, 1, signal);
- if (errno)
- perror_with_name ("ptrace");
- attach_flag = 0;
-}
-#endif /* ATTACH_DETACH */
-
-#if !defined (FETCH_INFERIOR_REGISTERS)
-
-/* KERNEL_U_ADDR is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-#if defined (KERNEL_U_ADDR_BSD)
-/* Get kernel_u_addr using BSD-style nlist(). */
-CORE_ADDR kernel_u_addr;
-
-void
-_initialize_kernel_u_addr ()
-{
- struct nlist names[2];
-
- names[0].n_un.n_name = "_u";
- names[1].n_un.n_name = NULL;
- if (nlist ("/vmunix", names) == 0)
- kernel_u_addr = names[0].n_value;
- else
- fatal ("Unable to get kernel u area address.");
-}
-#endif /* KERNEL_U_ADDR_BSD. */
-
-#if defined (KERNEL_U_ADDR_HPUX)
-/* Get kernel_u_addr using HPUX-style nlist(). */
-CORE_ADDR kernel_u_addr;
-
-struct hpnlist {
- char * n_name;
- long n_value;
- unsigned char n_type;
- unsigned char n_length;
- short n_almod;
- short n_unused;
-};
-static struct hpnlist nl[] = {{ "_u", -1, }, { (char *) 0, }};
-
-/* read the value of the u area from the hp-ux kernel */
-void _initialize_kernel_u_addr ()
-{
- struct user u;
- nlist ("/hp-ux", &nl);
- kernel_u_addr = nl[0].n_value;
-}
-#endif /* KERNEL_U_ADDR_HPUX. */
-
-#if !defined (offsetof)
-#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
-#endif
-
-/* U_REGS_OFFSET is the offset of the registers within the u area. */
-#if !defined (U_REGS_OFFSET)
-#define U_REGS_OFFSET \
- ptrace (PT_READ_U, inferior_pid, \
- (int *)(offsetof (struct user, u_ar0)), 0) - KERNEL_U_ADDR
-#endif
-
-/* Fetch one register. */
-static void
-fetch_register (regno)
- int regno;
-{
- register unsigned int regaddr;
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
-
- /* Offset of registers within the u area. */
- unsigned int offset = U_REGS_OFFSET;
-
- regaddr = register_addr (regno, offset);
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- *(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid, (int *)regaddr, 0);
- regaddr += sizeof (int);
- }
- supply_register (regno, buf);
-}
-
-/* Fetch all registers, or just one, from the child process. */
-
-void
-fetch_inferior_registers (regno)
- int regno;
-{
- if (regno == -1)
- for (regno = 0; regno < NUM_REGS; regno++)
- fetch_register (regno);
- else
- fetch_register (regno);
-}
-
-/* Registers we shouldn't try to store. */
-#if !defined (CANNOT_STORE_REGISTER)
-#define CANNOT_STORE_REGISTER(regno) 0
-#endif
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-int
-store_inferior_registers (regno)
- int regno;
-{
- register unsigned int regaddr;
- char buf[80];
- extern char registers[];
- register int i;
- int result = 0;
-
- unsigned int offset = U_REGS_OFFSET;
-
- if (regno >= 0)
- {
- regaddr = register_addr (regno, offset);
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
- {
- errno = 0;
- ptrace (PT_WRITE_U, inferior_pid, (int *)regaddr,
- *(int *) &registers[REGISTER_BYTE (regno) + i]);
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d(%d)", regno, i);
- perror_with_name (buf);
- result = -1;
- }
- regaddr += sizeof(int);
- }
- }
- else
- {
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- if (CANNOT_STORE_REGISTER (regno))
- continue;
- regaddr = register_addr (regno, offset);
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
- {
- errno = 0;
- ptrace (PT_WRITE_U, inferior_pid, (int *)regaddr,
- *(int *) &registers[REGISTER_BYTE (regno) + i]);
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d(%d)", regno, i);
- perror_with_name (buf);
- result = -1;
- }
- regaddr += sizeof(int);
- }
- }
- }
- return result;
-}
-#endif /* !defined (FETCH_INFERIOR_REGISTERS). */
-
-/* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory
- in the NEW_SUN_PTRACE case.
- It ought to be straightforward. But it appears that writing did
- not write the data that I specified. I cannot understand where
- it got the data that it actually did write. */
-
-/* Copy LEN bytes to or from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. Copy to inferior if
- WRITE is nonzero.
-
- Returns the length copied, which is either the LEN argument or zero.
- This xfer function does not do partial moves, since child_ops
- doesn't allow memory operations to cross below us in the target stack
- anyway. */
-
-int
-child_xfer_memory (memaddr, myaddr, len, write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
- struct target_ops target; /* ignored */
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & - sizeof (int);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
- /* Allocate buffer of that many longwords. */
- register int *buffer = (int *) alloca (count * sizeof (int));
-
- if (write)
- {
- /* Fill start and end extra bytes of buffer with existing memory data. */
-
- if (addr != memaddr || len < (int)sizeof (int)) {
- /* Need part of initial word -- fetch it. */
- buffer[0] = ptrace (PT_READ_I, inferior_pid, (int *)addr, 0);
- }
-
- if (count > 1) /* FIXME, avoid if even boundary */
- {
- buffer[count - 1]
- = ptrace (PT_READ_I, inferior_pid,
- (int *)(addr + (count - 1) * sizeof (int)), 0);
- }
-
- /* Copy data to be written over corresponding part of buffer */
-
- bcopy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
-
- /* Write the entire buffer. */
-
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- errno = 0;
- ptrace (PT_WRITE_D, inferior_pid, (int *)addr, buffer[i]);
- if (errno)
- {
- /* Using the appropriate one (I or D) is necessary for
- Gould NP1, at least. */
- errno = 0;
- ptrace (PT_WRITE_I, inferior_pid, (int *)addr, buffer[i]);
- }
- if (errno)
- return 0;
- }
- }
- else
- {
- /* Read all the longwords */
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- errno = 0;
- buffer[i] = ptrace (PT_READ_I, inferior_pid, (int *)addr, 0);
- if (errno)
- return 0;
- QUIT;
- }
-
- /* Copy appropriate bytes out of the buffer. */
- bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
- }
- return len;
-}
diff --git a/gdb/infrun.c b/gdb/infrun.c
deleted file mode 100644
index 3ca563f..0000000
--- a/gdb/infrun.c
+++ /dev/null
@@ -1,1803 +0,0 @@
-/* Start (run) and stop the inferior process, for GDB.
- Copyright (C) 1986, 1987, 1988, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Notes on the algorithm used in wait_for_inferior to determine if we
- just did a subroutine call when stepping. We have the following
- information at that point:
-
- Current and previous (just before this step) pc.
- Current and previous sp.
- Current and previous start of current function.
-
- If the starts of the functions don't match, then
-
- a) We did a subroutine call.
-
- In this case, the pc will be at the beginning of a function.
-
- b) We did a subroutine return.
-
- Otherwise.
-
- c) We did a longjmp.
-
- If we did a longjump, we were doing "nexti", since a next would
- have attempted to skip over the assembly language routine in which
- the longjmp is coded and would have simply been the equivalent of a
- continue. I consider this ok behaivior. We'd like one of two
- things to happen if we are doing a nexti through the longjmp()
- routine: 1) It behaves as a stepi, or 2) It acts like a continue as
- above. Given that this is a special case, and that anybody who
- thinks that the concept of sub calls is meaningful in the context
- of a longjmp, I'll take either one. Let's see what happens.
-
- Acts like a subroutine return. I can handle that with no problem
- at all.
-
- -->So: If the current and previous beginnings of the current
- function don't match, *and* the pc is at the start of a function,
- we've done a subroutine call. If the pc is not at the start of a
- function, we *didn't* do a subroutine call.
-
- -->If the beginnings of the current and previous function do match,
- either:
-
- a) We just did a recursive call.
-
- In this case, we would be at the very beginning of a
- function and 1) it will have a prologue (don't jump to
- before prologue, or 2) (we assume here that it doesn't have
- a prologue) there will have been a change in the stack
- pointer over the last instruction. (Ie. it's got to put
- the saved pc somewhere. The stack is the usual place. In
- a recursive call a register is only an option if there's a
- prologue to do something with it. This is even true on
- register window machines; the prologue sets up the new
- window. It might not be true on a register window machine
- where the call instruction moved the register window
- itself. Hmmm. One would hope that the stack pointer would
- also change. If it doesn't, somebody send me a note, and
- I'll work out a more general theory.
- bug-gdb@prep.ai.mit.edu). This is true (albeit slipperly
- so) on all machines I'm aware of:
-
- m68k: Call changes stack pointer. Regular jumps don't.
-
- sparc: Recursive calls must have frames and therefor,
- prologues.
-
- vax: All calls have frames and hence change the
- stack pointer.
-
- b) We did a return from a recursive call. I don't see that we
- have either the ability or the need to distinguish this
- from an ordinary jump. The stack frame will be printed
- when and if the frame pointer changes; if we are in a
- function without a frame pointer, it's the users own
- lookout.
-
- c) We did a jump within a function. We assume that this is
- true if we didn't do a recursive call.
-
- d) We are in no-man's land ("I see no symbols here"). We
- don't worry about this; it will make calls look like simple
- jumps (and the stack frames will be printed when the frame
- pointer moves), which is a reasonably non-violent response.
-
-#if 0
- We skip this; it causes more problems than it's worth.
-#ifdef SUN4_COMPILER_FEATURE
- We do a special ifdef for the sun 4, forcing it to single step
- into calls which don't have prologues. This means that we can't
- nexti over leaf nodes, we can probably next over them (since they
- won't have debugging symbols, usually), and we can next out of
- functions returning structures (with a "call .stret4" at the end).
-#endif
-#endif
-*/
-
-
-
-
-
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "inferior.h"
-#include "breakpoint.h"
-#include "wait.h"
-#include "gdbcore.h"
-#include "signame.h"
-#include "command.h"
-#include "terminal.h" /* For #ifdef TIOCGPGRP and new_tty */
-#include "target.h"
-
-#include <signal.h>
-
-/* unistd.h is needed to #define X_OK */
-#ifdef USG
-#include <unistd.h>
-#else
-#include <sys/file.h>
-#endif
-
-#ifdef SET_STACK_LIMIT_HUGE
-#include <sys/time.h>
-#include <sys/resource.h>
-
-extern int original_stack_limit;
-#endif /* SET_STACK_LIMIT_HUGE */
-
-extern char *getenv ();
-extern char **environ;
-
-extern struct target_ops child_ops; /* In inftarg.c */
-
-
-/* Sigtramp is a routine that the kernel calls (which then calls the
- signal handler). On most machines it is a library routine that
- is linked into the executable.
-
- This macro, given a program counter value and the name of the
- function in which that PC resides (which can be null if the
- name is not known), returns nonzero if the PC and name show
- that we are in sigtramp.
-
- On most machines just see if the name is sigtramp (and if we have
- no name, assume we are not in sigtramp). */
-#if !defined (IN_SIGTRAMP)
-#define IN_SIGTRAMP(pc, name) \
- (name && !strcmp ("_sigtramp", name))
-#endif
-
-/* Tables of how to react to signals; the user sets them. */
-
-static char signal_stop[NSIG];
-static char signal_print[NSIG];
-static char signal_program[NSIG];
-
-/* Nonzero if breakpoints are now inserted in the inferior. */
-/* Nonstatic for initialization during xxx_create_inferior. FIXME. */
-
-/*static*/ int breakpoints_inserted;
-
-/* Function inferior was in as of last step command. */
-
-static struct symbol *step_start_function;
-
-/* Nonzero => address for special breakpoint for resuming stepping. */
-
-static CORE_ADDR step_resume_break_address;
-
-/* Pointer to orig contents of the byte where the special breakpoint is. */
-
-static char step_resume_break_shadow[BREAKPOINT_MAX];
-
-/* Nonzero means the special breakpoint is a duplicate
- so it has not itself been inserted. */
-
-static int step_resume_break_duplicate;
-
-/* Nonzero if we are expecting a trace trap and should proceed from it. */
-
-static int trap_expected;
-
-/* Nonzero if the next time we try to continue the inferior, it will
- step one instruction and generate a spurious trace trap.
- This is used to compensate for a bug in HP-UX. */
-
-static int trap_expected_after_continue;
-
-/* Nonzero means expecting a trace trap
- and should stop the inferior and return silently when it happens. */
-
-int stop_after_trap;
-
-/* Nonzero means expecting a trap and caller will handle it themselves.
- It is used after attach, due to attaching to a process;
- when running in the shell before the child program has been exec'd;
- and when running some kinds of remote stuff (FIXME?). */
-
-int stop_soon_quietly;
-
-/* Nonzero if pc has been changed by the debugger
- since the inferior stopped. */
-
-int pc_changed;
-
-/* Nonzero if proceed is being used for a "finish" command or a similar
- situation when stop_registers should be saved. */
-
-int proceed_to_finish;
-
-/* Save register contents here when about to pop a stack dummy frame,
- if-and-only-if proceed_to_finish is set.
- Thus this contains the return value from the called function (assuming
- values are returned in a register). */
-
-char stop_registers[REGISTER_BYTES];
-
-/* Nonzero if program stopped due to error trying to insert breakpoints. */
-
-static int breakpoints_failed;
-
-/* Nonzero after stop if current stack frame should be printed. */
-
-static int stop_print_frame;
-
-#ifdef NO_SINGLE_STEP
-extern int one_stepped; /* From machine dependent code */
-extern void single_step (); /* Same. */
-#endif /* NO_SINGLE_STEP */
-
-static void insert_step_breakpoint ();
-static void remove_step_breakpoint ();
-/*static*/ void wait_for_inferior ();
-void init_wait_for_inferior ();
-void normal_stop ();
-
-
-/* Things to clean up if we QUIT out of resume (). */
-/* ARGSUSED */
-static void
-resume_cleanups (arg)
- int arg;
-{
- normal_stop ();
-}
-
-/* Resume the inferior, but allow a QUIT. This is useful if the user
- wants to interrupt some lengthy single-stepping operation
- (for child processes, the SIGINT goes to the inferior, and so
- we get a SIGINT random_signal, but for remote debugging and perhaps
- other targets, that's not true).
-
- STEP nonzero if we should step (zero to continue instead).
- SIG is the signal to give the inferior (zero for none). */
-static void
-resume (step, sig)
- int step;
- int sig;
-{
- struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
- QUIT;
-
-#ifdef NO_SINGLE_STEP
- if (step) {
- single_step(); /* Do it the hard way, w/temp breakpoints */
- step = 0; /* ...and don't ask hardware to do it. */
- }
-#endif
-
- /* Handle any optimized stores to the inferior NOW... */
-#ifdef DO_DEFERRED_STORES
- DO_DEFERRED_STORES;
-#endif
-
- target_resume (step, sig);
- discard_cleanups (old_cleanups);
-}
-
-
-/* Clear out all variables saying what to do when inferior is continued.
- First do this, then set the ones you want, then call `proceed'. */
-
-void
-clear_proceed_status ()
-{
- trap_expected = 0;
- step_range_start = 0;
- step_range_end = 0;
- step_frame_address = 0;
- step_over_calls = -1;
- step_resume_break_address = 0;
- stop_after_trap = 0;
- stop_soon_quietly = 0;
- proceed_to_finish = 0;
- breakpoint_proceeded = 1; /* We're about to proceed... */
-
- /* Discard any remaining commands or status from previous stop. */
- bpstat_clear (&stop_bpstat);
-}
-
-/* Basic routine for continuing the program in various fashions.
-
- ADDR is the address to resume at, or -1 for resume where stopped.
- SIGGNAL is the signal to give it, or 0 for none,
- or -1 for act according to how it stopped.
- STEP is nonzero if should trap after one instruction.
- -1 means return after that and print nothing.
- You should probably set various step_... variables
- before calling here, if you are stepping.
-
- You should call clear_proceed_status before calling proceed. */
-
-void
-proceed (addr, siggnal, step)
- CORE_ADDR addr;
- int siggnal;
- int step;
-{
- int oneproc = 0;
-
- if (step > 0)
- step_start_function = find_pc_function (read_pc ());
- if (step < 0)
- stop_after_trap = 1;
-
- if (addr == (CORE_ADDR)-1)
- {
- /* If there is a breakpoint at the address we will resume at,
- step one instruction before inserting breakpoints
- so that we do not stop right away. */
-
- if (!pc_changed && breakpoint_here_p (read_pc ()))
- oneproc = 1;
- }
- else
- {
- write_register (PC_REGNUM, addr);
-#ifdef NPC_REGNUM
- write_register (NPC_REGNUM, addr + 4);
-#ifdef NNPC_REGNUM
- write_register (NNPC_REGNUM, addr + 8);
-#endif
-#endif
- }
-
- if (trap_expected_after_continue)
- {
- /* If (step == 0), a trap will be automatically generated after
- the first instruction is executed. Force step one
- instruction to clear this condition. This should not occur
- if step is nonzero, but it is harmless in that case. */
- oneproc = 1;
- trap_expected_after_continue = 0;
- }
-
- if (oneproc)
- /* We will get a trace trap after one instruction.
- Continue it automatically and insert breakpoints then. */
- trap_expected = 1;
- else
- {
- int temp = insert_breakpoints ();
- if (temp)
- {
- print_sys_errmsg ("ptrace", temp);
- error ("Cannot insert breakpoints.\n\
-The same program may be running in another process.");
- }
- breakpoints_inserted = 1;
- }
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- if (siggnal >= 0)
- stop_signal = siggnal;
- /* If this signal should not be seen by program,
- give it zero. Used for debugging signals. */
- else if (stop_signal < NSIG && !signal_program[stop_signal])
- stop_signal= 0;
-
- /* Resume inferior. */
- resume (oneproc || step || bpstat_should_step (), stop_signal);
-
- /* Wait for it to stop (if not standalone)
- and in any case decode why it stopped, and act accordingly. */
-
- wait_for_inferior ();
- normal_stop ();
-}
-
-#if 0
-/* This might be useful (not sure), but isn't currently used. See also
- write_pc(). */
-/* Writing the inferior pc as a register calls this function
- to inform infrun that the pc has been set in the debugger. */
-
-void
-writing_pc (val)
- CORE_ADDR val;
-{
- stop_pc = val;
- pc_changed = 1;
-}
-#endif
-
-/* Record the pc and sp of the program the last time it stopped.
- These are just used internally by wait_for_inferior, but need
- to be preserved over calls to it and cleared when the inferior
- is started. */
-static CORE_ADDR prev_pc;
-static CORE_ADDR prev_sp;
-static CORE_ADDR prev_func_start;
-static char *prev_func_name;
-
-
-/* Start an inferior Unix child process and sets inferior_pid to its pid.
- EXEC_FILE is the file to run.
- ALLARGS is a string containing the arguments to the program.
- ENV is the environment vector to pass. Errors reported with error(). */
-
-#ifndef SHELL_FILE
-#define SHELL_FILE "/bin/sh"
-#endif
-
-void
-child_create_inferior (exec_file, allargs, env)
- char *exec_file;
- char *allargs;
- char **env;
-{
- int pid;
- char *shell_command;
- extern int sys_nerr;
- extern char *sys_errlist[];
- char *shell_file;
- static char default_shell_file[] = SHELL_FILE;
- int len;
- int pending_execs;
- /* Set debug_fork then attach to the child while it sleeps, to debug. */
- static int debug_fork = 0;
- /* This is set to the result of setpgrp, which if vforked, will be visible
- to you in the parent process. It's only used by humans for debugging. */
- static int debug_setpgrp = 657473;
- char **save_our_env;
-
- /* The user might want tilde-expansion, and in general probably wants
- the program to behave the same way as if run from
- his/her favorite shell. So we let the shell run it for us.
- FIXME, this should probably search the local environment (as
- modified by the setenv command), not the env gdb inherited. */
- shell_file = getenv ("SHELL");
- if (shell_file == NULL)
- shell_file = default_shell_file;
-
- len = 5 + strlen (exec_file) + 1 + strlen (allargs) + 1 + /*slop*/ 10;
- /* If desired, concat something onto the front of ALLARGS.
- SHELL_COMMAND is the result. */
-#ifdef SHELL_COMMAND_CONCAT
- shell_command = (char *) alloca (strlen (SHELL_COMMAND_CONCAT) + len);
- strcpy (shell_command, SHELL_COMMAND_CONCAT);
-#else
- shell_command = (char *) alloca (len);
- shell_command[0] = '\0';
-#endif
- strcat (shell_command, "exec ");
- strcat (shell_command, exec_file);
- strcat (shell_command, " ");
- strcat (shell_command, allargs);
-
- /* exec is said to fail if the executable is open. */
- close_exec_file ();
-
- /* Retain a copy of our environment variables, since the child will
- replace the value of environ and if we're vforked, we have to
- restore it. */
- save_our_env = environ;
-
- /* Tell the terminal handling subsystem what tty we plan to run on;
- it will just record the information for later. */
-
- new_tty_prefork (inferior_io_terminal);
-
- /* It is generally good practice to flush any possible pending stdio
- output prior to doing a fork, to avoid the possibility of both the
- parent and child flushing the same data after the fork. */
-
- fflush (stdout);
- fflush (stderr);
-
-#if defined(USG) && !defined(HAVE_VFORK)
- pid = fork ();
-#else
- if (debug_fork)
- pid = fork ();
- else
- pid = vfork ();
-#endif
-
- if (pid < 0)
- perror_with_name ("vfork");
-
- if (pid == 0)
- {
- if (debug_fork)
- sleep (debug_fork);
-
-#ifdef TIOCGPGRP
- /* Run inferior in a separate process group. */
-#ifdef USG
- debug_setpgrp = setpgrp ();
-#else
- debug_setpgrp = setpgrp (getpid (), getpid ());
-#endif
- if (debug_setpgrp == -1)
- perror("setpgrp failed in child");
-#endif /* TIOCGPGRP */
-
-#ifdef SET_STACK_LIMIT_HUGE
- /* Reset the stack limit back to what it was. */
- {
- struct rlimit rlim;
-
- getrlimit (RLIMIT_STACK, &rlim);
- rlim.rlim_cur = original_stack_limit;
- setrlimit (RLIMIT_STACK, &rlim);
- }
-#endif /* SET_STACK_LIMIT_HUGE */
-
- /* Ask the tty subsystem to switch to the one we specified earlier
- (or to share the current terminal, if none was specified). */
-
- new_tty ();
-
- /* Changing the signal handlers for the inferior after
- a vfork can also change them for the superior, so we don't mess
- with signals here. See comments in
- initialize_signals for how we get the right signal handlers
- for the inferior. */
-
-#ifdef USE_PROC_FS
- proc_set_exec_trap (); /* Use SVR4 /proc interface */
-#else
- call_ptrace (0, 0, 0, 0); /* "Trace me, Dr. Memory!" */
-#endif
-
- /* There is no execlpe call, so we have to set the environment
- for our child in the global variable. If we've vforked, this
- clobbers the parent, but environ is restored a few lines down
- in the parent. By the way, yes we do need to look down the
- path to find $SHELL. Rich Pixley says so, and I agree. */
- environ = env;
- execlp (shell_file, shell_file, "-c", shell_command, (char *)0);
-
- fprintf (stderr, "Cannot exec %s: %s.\n", shell_file,
- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
- fflush (stderr);
- _exit (0177);
- }
-
- /* Restore our environment in case a vforked child clob'd it. */
- environ = save_our_env;
-
- /* Now that we have a child process, make it our target. */
- push_target (&child_ops);
-
-#ifdef CREATE_INFERIOR_HOOK
- CREATE_INFERIOR_HOOK (pid);
-#endif
-
-/* The process was started by the fork that created it,
- but it will have stopped one instruction after execing the shell.
- Here we must get it up to actual execution of the real program. */
-
- inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
-
- clear_proceed_status ();
-
-#if defined (START_INFERIOR_HOOK)
- START_INFERIOR_HOOK ();
-#endif
-
- /* We will get a trace trap after one instruction.
- Continue it automatically. Eventually (after shell does an exec)
- it will get another trace trap. Then insert breakpoints and continue. */
-
-#ifdef START_INFERIOR_TRAPS_EXPECTED
- pending_execs = START_INFERIOR_TRAPS_EXPECTED;
-#else
- pending_execs = 2;
-#endif
-
- init_wait_for_inferior ();
-
- /* Set up the "saved terminal modes" of the inferior
- based on what modes we are starting it with. */
- target_terminal_init ();
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- while (1)
- {
- stop_soon_quietly = 1; /* Make wait_for_inferior be quiet */
- wait_for_inferior ();
- if (stop_signal != SIGTRAP)
- {
- /* Let shell child handle its own signals in its own way */
- /* FIXME, what if child has exit()ed? Must exit loop somehow */
- resume (0, stop_signal);
- }
- else
- {
- /* We handle SIGTRAP, however; it means child did an exec. */
- if (0 == --pending_execs)
- break;
- resume (0, 0); /* Just make it go on */
- }
- }
- stop_soon_quietly = 0;
-
- /* We are now in the child process of interest, having exec'd the
- correct program, and are poised at the first instruction of the
- new program. */
-#ifdef SOLIB_CREATE_INFERIOR_HOOK
- SOLIB_CREATE_INFERIOR_HOOK ();
-#endif
-
- /* Should this perhaps just be a "proceed" call? FIXME */
- insert_step_breakpoint ();
- breakpoints_failed = insert_breakpoints ();
- if (!breakpoints_failed)
- {
- breakpoints_inserted = 1;
- target_terminal_inferior();
- /* Start the child program going on its first instruction, single-
- stepping if we need to. */
- resume (bpstat_should_step (), 0);
- wait_for_inferior ();
- normal_stop ();
- }
-}
-
-/* Start remote-debugging of a machine over a serial link. */
-
-void
-start_remote ()
-{
- init_wait_for_inferior ();
- clear_proceed_status ();
- stop_soon_quietly = 1;
- trap_expected = 0;
- wait_for_inferior ();
- normal_stop ();
-}
-
-/* Initialize static vars when a new inferior begins. */
-
-void
-init_wait_for_inferior ()
-{
- /* These are meaningless until the first time through wait_for_inferior. */
- prev_pc = 0;
- prev_sp = 0;
- prev_func_start = 0;
- prev_func_name = NULL;
-
- trap_expected_after_continue = 0;
- breakpoints_inserted = 0;
- mark_breakpoints_out ();
- stop_signal = 0; /* Don't confuse first call to proceed(). */
-}
-
-
-/* Attach to process PID, then initialize for debugging it
- and wait for the trace-trap that results from attaching. */
-
-void
-child_attach (args, from_tty)
- char *args;
- int from_tty;
-{
- char *exec_file;
- int pid;
-
- dont_repeat();
-
- if (!args)
- error_no_arg ("process-id to attach");
-
-#ifndef ATTACH_DETACH
- error ("Can't attach to a process on this machine.");
-#else
- pid = atoi (args);
-
- if (target_has_execution)
- {
- if (query ("A program is being debugged already. Kill it? "))
- target_kill ((char *)0, from_tty);
- else
- error ("Inferior not killed.");
- }
-
- exec_file = (char *) get_exec_file (1);
-
- if (from_tty)
- {
- printf ("Attaching program: %s pid %d\n",
- exec_file, pid);
- fflush (stdout);
- }
-
- attach (pid);
- inferior_pid = pid;
- push_target (&child_ops);
-
- mark_breakpoints_out ();
- target_terminal_init ();
- clear_proceed_status ();
- stop_soon_quietly = 1;
- /*proceed (-1, 0, -2);*/
- target_terminal_inferior ();
- wait_for_inferior ();
-#ifdef SOLIB_ADD
- SOLIB_ADD ((char *)0, from_tty, (struct target_ops *)0);
-#endif
- normal_stop ();
-#endif /* ATTACH_DETACH */
-}
-
-/* Wait for control to return from inferior to debugger.
- If inferior gets a signal, we may decide to start it up again
- instead of returning. That is why there is a loop in this function.
- When this function actually returns it means the inferior
- should be left stopped and GDB should read more commands. */
-
-void
-wait_for_inferior ()
-{
- WAITTYPE w;
- int another_trap;
- int random_signal;
- CORE_ADDR stop_sp;
- CORE_ADDR stop_func_start;
- char *stop_func_name;
- CORE_ADDR prologue_pc;
- int stop_step_resume_break;
- struct symtab_and_line sal;
- int remove_breakpoints_on_following_step = 0;
- int current_line;
-
-#if 0
- /* This no longer works now that read_register is lazy;
- it might try to ptrace when the process is not stopped. */
- prev_pc = read_pc ();
- (void) find_pc_partial_function (prev_pc, &prev_func_name,
- &prev_func_start);
- prev_func_start += FUNCTION_START_OFFSET;
- prev_sp = read_register (SP_REGNUM);
-#endif /* 0 */
-
- sal = find_pc_line(prev_pc, 0);
- current_line = sal.line;
-
- while (1)
- {
- /* Clean up saved state that will become invalid. */
- pc_changed = 0;
- flush_cached_frames ();
- registers_changed ();
-
- target_wait (&w);
-
- /* See if the process still exists; clean up if it doesn't. */
- if (WIFEXITED (w))
- {
- target_terminal_ours (); /* Must do this before mourn anyway */
- if (WEXITSTATUS (w))
- printf ("\nProgram exited with code 0%o.\n",
- (unsigned int)WEXITSTATUS (w));
- else
- if (!batch_mode())
- printf ("\nProgram exited normally.\n");
- fflush (stdout);
- target_mourn_inferior ();
-#ifdef NO_SINGLE_STEP
- one_stepped = 0;
-#endif
- stop_print_frame = 0;
- break;
- }
- else if (!WIFSTOPPED (w))
- {
- stop_print_frame = 0;
- stop_signal = WTERMSIG (w);
- target_terminal_ours (); /* Must do this before mourn anyway */
- target_kill ((char *)0, 0); /* kill mourns as well */
-#ifdef PRINT_RANDOM_SIGNAL
- printf ("\nProgram terminated: ");
- PRINT_RANDOM_SIGNAL (stop_signal);
-#else
- printf ("\nProgram terminated with signal %d, %s\n",
- stop_signal,
- stop_signal < NSIG
- ? sys_siglist[stop_signal]
- : "(undocumented)");
-#endif
- printf ("The inferior process no longer exists.\n");
- fflush (stdout);
-#ifdef NO_SINGLE_STEP
- one_stepped = 0;
-#endif
- break;
- }
-
-#ifdef NO_SINGLE_STEP
- if (one_stepped)
- single_step (0); /* This actually cleans up the ss */
-#endif /* NO_SINGLE_STEP */
-
- stop_pc = read_pc ();
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
-
- stop_frame_address = FRAME_FP (get_current_frame ());
- stop_sp = read_register (SP_REGNUM);
- stop_func_start = 0;
- stop_func_name = 0;
- /* Don't care about return value; stop_func_start and stop_func_name
- will both be 0 if it doesn't work. */
- (void) find_pc_partial_function (stop_pc, &stop_func_name,
- &stop_func_start);
- stop_func_start += FUNCTION_START_OFFSET;
- another_trap = 0;
- bpstat_clear (&stop_bpstat);
- stop_step = 0;
- stop_stack_dummy = 0;
- stop_print_frame = 1;
- stop_step_resume_break = 0;
- random_signal = 0;
- stopped_by_random_signal = 0;
- breakpoints_failed = 0;
-
- /* Look at the cause of the stop, and decide what to do.
- The alternatives are:
- 1) break; to really stop and return to the debugger,
- 2) drop through to start up again
- (set another_trap to 1 to single step once)
- 3) set random_signal to 1, and the decision between 1 and 2
- will be made according to the signal handling tables. */
-
- stop_signal = WSTOPSIG (w);
-
- /* First, distinguish signals caused by the debugger from signals
- that have to do with the program's own actions.
- Note that breakpoint insns may cause SIGTRAP or SIGILL
- or SIGEMT, depending on the operating system version.
- Here we detect when a SIGILL or SIGEMT is really a breakpoint
- and change it to SIGTRAP. */
-
- if (stop_signal == SIGTRAP
- || (breakpoints_inserted &&
- (stop_signal == SIGILL
- || stop_signal == SIGEMT))
- || stop_soon_quietly)
- {
- if (stop_signal == SIGTRAP && stop_after_trap)
- {
- stop_print_frame = 0;
- break;
- }
- if (stop_soon_quietly)
- break;
-
- /* Don't even think about breakpoints
- if just proceeded over a breakpoint.
-
- However, if we are trying to proceed over a breakpoint
- and end up in sigtramp, then step_resume_break_address
- will be set and we should check whether we've hit the
- step breakpoint. */
- if (stop_signal == SIGTRAP && trap_expected
- && step_resume_break_address == NULL)
- bpstat_clear (&stop_bpstat);
- else
- {
- /* See if there is a breakpoint at the current PC. */
-#if DECR_PC_AFTER_BREAK
- /* Notice the case of stepping through a jump
- that leads just after a breakpoint.
- Don't confuse that with hitting the breakpoint.
- What we check for is that 1) stepping is going on
- and 2) the pc before the last insn does not match
- the address of the breakpoint before the current pc. */
- if (!(prev_pc != stop_pc - DECR_PC_AFTER_BREAK
- && step_range_end && !step_resume_break_address))
-#endif /* DECR_PC_AFTER_BREAK not zero */
- {
- /* See if we stopped at the special breakpoint for
- stepping over a subroutine call. If both are zero,
- this wasn't the reason for the stop. */
- if (stop_pc - DECR_PC_AFTER_BREAK
- == step_resume_break_address
- && step_resume_break_address)
- {
- stop_step_resume_break = 1;
- if (DECR_PC_AFTER_BREAK)
- {
- stop_pc -= DECR_PC_AFTER_BREAK;
- write_register (PC_REGNUM, stop_pc);
- pc_changed = 0;
- }
- }
- else
- {
- stop_bpstat =
- bpstat_stop_status (&stop_pc, stop_frame_address);
- /* Following in case break condition called a
- function. */
- stop_print_frame = 1;
- }
- }
- }
-
- if (stop_signal == SIGTRAP)
- random_signal
- = !(bpstat_explains_signal (stop_bpstat)
- || trap_expected
- || stop_step_resume_break
- || PC_IN_CALL_DUMMY (stop_pc, stop_sp, stop_frame_address)
- || (step_range_end && !step_resume_break_address));
- else
- {
- random_signal
- = !(bpstat_explains_signal (stop_bpstat)
- || stop_step_resume_break
- /* End of a stack dummy. Some systems (e.g. Sony
- news) give another signal besides SIGTRAP,
- so check here as well as above. */
- || (stop_sp INNER_THAN stop_pc
- && stop_pc INNER_THAN stop_frame_address)
- );
- if (!random_signal)
- stop_signal = SIGTRAP;
- }
- }
- else
- random_signal = 1;
-
- /* For the program's own signals, act according to
- the signal handling tables. */
-
- if (random_signal)
- {
- /* Signal not for debugging purposes. */
- int printed = 0;
-
- stopped_by_random_signal = 1;
-
- if (stop_signal >= NSIG
- || signal_print[stop_signal])
- {
- printed = 1;
- target_terminal_ours_for_output ();
-#ifdef PRINT_RANDOM_SIGNAL
- PRINT_RANDOM_SIGNAL (stop_signal);
-#else
- printf ("\nProgram received signal %d, %s\n",
- stop_signal,
- stop_signal < NSIG
- ? sys_siglist[stop_signal]
- : "(undocumented)");
-#endif /* PRINT_RANDOM_SIGNAL */
- fflush (stdout);
- }
- if (stop_signal >= NSIG
- || signal_stop[stop_signal])
- break;
- /* If not going to stop, give terminal back
- if we took it away. */
- else if (printed)
- target_terminal_inferior ();
-
- /* Note that virtually all the code below does `if !random_signal'.
- Perhaps this code should end with a goto or continue. At least
- one (now fixed) bug was caused by this -- a !random_signal was
- missing in one of the tests below. */
- }
-
- /* Handle cases caused by hitting a breakpoint. */
-
- if (!random_signal
- && (bpstat_explains_signal (stop_bpstat) || stop_step_resume_break))
- {
- /* Does a breakpoint want us to stop? */
- if (bpstat_stop (stop_bpstat))
- {
- stop_print_frame = bpstat_should_print (stop_bpstat);
- break;
- }
- /* But if we have hit the step-resumption breakpoint,
- remove it. It has done its job getting us here.
- The sp test is to make sure that we don't get hung
- up in recursive calls in functions without frame
- pointers. If the stack pointer isn't outside of
- where the breakpoint was set (within a routine to be
- stepped over), we're in the middle of a recursive
- call. Not true for reg window machines (sparc)
- because the must change frames to call things and
- the stack pointer doesn't have to change if it
- the bp was set in a routine without a frame (pc can
- be stored in some other window).
-
- The removal of the sp test is to allow calls to
- alloca. Nasty things were happening. Oh, well,
- gdb can only handle one level deep of lack of
- frame pointer. */
- if (stop_step_resume_break
- && (step_frame_address == 0
- || (stop_frame_address == step_frame_address)))
- {
- remove_step_breakpoint ();
- step_resume_break_address = 0;
-
- /* If were waiting for a trap, hitting the step_resume_break
- doesn't count as getting it. */
- if (trap_expected)
- another_trap = 1;
- }
- /* Otherwise, must remove breakpoints and single-step
- to get us past the one we hit. */
- else
- {
- remove_breakpoints ();
- remove_step_breakpoint ();
- breakpoints_inserted = 0;
- another_trap = 1;
- }
-
- /* We come here if we hit a breakpoint but should not
- stop for it. Possibly we also were stepping
- and should stop for that. So fall through and
- test for stepping. But, if not stepping,
- do not stop. */
- }
-
- /* If this is the breakpoint at the end of a stack dummy,
- just stop silently. */
- if (!random_signal
- && PC_IN_CALL_DUMMY (stop_pc, stop_sp, stop_frame_address))
- {
- stop_print_frame = 0;
- stop_stack_dummy = 1;
-#ifdef HP_OS_BUG
- trap_expected_after_continue = 1;
-#endif
- break;
- }
-
- if (step_resume_break_address)
- /* Having a step-resume breakpoint overrides anything
- else having to do with stepping commands until
- that breakpoint is reached. */
- ;
- /* If stepping through a line, keep going if still within it. */
- else if (!random_signal
- && step_range_end
- && stop_pc >= step_range_start
- && stop_pc < step_range_end
- /* The step range might include the start of the
- function, so if we are at the start of the
- step range and either the stack or frame pointers
- just changed, we've stepped outside */
- && !(stop_pc == step_range_start
- && stop_frame_address
- && (stop_sp INNER_THAN prev_sp
- || stop_frame_address != step_frame_address)))
- {
-#if 0
- /* When "next"ing through a function,
- This causes an extra stop at the end.
- Is there any reason for this?
- It's confusing to the user. */
- /* Don't step through the return from a function
- unless that is the first instruction stepped through. */
- if (ABOUT_TO_RETURN (stop_pc))
- {
- stop_step = 1;
- break;
- }
-#endif
- }
-
- /* We stepped out of the stepping range. See if that was due
- to a subroutine call that we should proceed to the end of. */
- else if (!random_signal && step_range_end)
- {
- if (stop_func_start)
- {
- prologue_pc = stop_func_start;
- SKIP_PROLOGUE (prologue_pc);
- }
-
- /* Did we just take a signal? */
- if (IN_SIGTRAMP (stop_pc, stop_func_name)
- && !IN_SIGTRAMP (prev_pc, prev_func_name))
- {
- /* This code is needed at least in the following case:
- The user types "next" and then a signal arrives (before
- the "next" is done). */
- /* We've just taken a signal; go until we are back to
- the point where we took it and one more. */
- step_resume_break_address = prev_pc;
- step_resume_break_duplicate =
- breakpoint_here_p (step_resume_break_address);
- if (breakpoints_inserted)
- insert_step_breakpoint ();
- /* Make sure that the stepping range gets us past
- that instruction. */
- if (step_range_end == 1)
- step_range_end = (step_range_start = prev_pc) + 1;
- remove_breakpoints_on_following_step = 1;
- }
-
- /* ==> See comments at top of file on this algorithm. <==*/
-
- else if (stop_pc == stop_func_start
- && (stop_func_start != prev_func_start
- || prologue_pc != stop_func_start
- || stop_sp != prev_sp))
- {
- /* It's a subroutine call */
- if (step_over_calls > 0
- || (step_over_calls && find_pc_function (stop_pc) == 0))
- {
- /* A subroutine call has happened. */
- /* Set a special breakpoint after the return */
- step_resume_break_address =
- ADDR_BITS_REMOVE
- (SAVED_PC_AFTER_CALL (get_current_frame ()));
- step_resume_break_duplicate
- = breakpoint_here_p (step_resume_break_address);
- if (breakpoints_inserted)
- insert_step_breakpoint ();
- }
- /* Subroutine call with source code we should not step over.
- Do step to the first line of code in it. */
- else if (step_over_calls)
- {
- SKIP_PROLOGUE (stop_func_start);
- sal = find_pc_line (stop_func_start, 0);
- /* Use the step_resume_break to step until
- the end of the prologue, even if that involves jumps
- (as it seems to on the vax under 4.2). */
- /* If the prologue ends in the middle of a source line,
- continue to the end of that source line.
- Otherwise, just go to end of prologue. */
-#ifdef PROLOGUE_FIRSTLINE_OVERLAP
- /* no, don't either. It skips any code that's
- legitimately on the first line. */
-#else
- if (sal.end && sal.pc != stop_func_start)
- stop_func_start = sal.end;
-#endif
-
- if (stop_func_start == stop_pc)
- {
- /* We are already there: stop now. */
- stop_step = 1;
- break;
- }
- else
- /* Put the step-breakpoint there and go until there. */
- {
- step_resume_break_address = stop_func_start;
-
- step_resume_break_duplicate
- = breakpoint_here_p (step_resume_break_address);
- if (breakpoints_inserted)
- insert_step_breakpoint ();
- /* Do not specify what the fp should be when we stop
- since on some machines the prologue
- is where the new fp value is established. */
- step_frame_address = 0;
- /* And make sure stepping stops right away then. */
- step_range_end = step_range_start;
- }
- }
- else
- {
- /* We get here only if step_over_calls is 0 and we
- just stepped into a subroutine. I presume
- that step_over_calls is only 0 when we're
- supposed to be stepping at the assembly
- language level.*/
- stop_step = 1;
- break;
- }
- }
- /* No subroutine call; stop now. */
- else
- {
- /* We've wandered out of the step range (but we haven't done a
- subroutine call or return (that's handled elsewhere)). We
- don't really want to stop until we encounter the start of a
- new statement. If so, we stop. Otherwise, we reset
- step_range_start and step_range_end, and just continue. */
- sal = find_pc_line(stop_pc, 0);
-
- if (step_range_end == 1 || /* Don't do this for stepi/nexti */
- sal.line == 0 || /* Stop now if no line # info */
- (current_line != sal.line
- && stop_pc == sal.pc)) {
- stop_step = 1;
- break;
- } else {
- /* This is probably not necessary, but it probably makes
- stepping more efficient, as we avoid calling find_pc_line()
- for each instruction we step over. */
- step_range_start = sal.pc;
- step_range_end = sal.end;
- }
- }
- }
-
- else if (trap_expected
- && IN_SIGTRAMP (stop_pc, stop_func_name)
- && !IN_SIGTRAMP (prev_pc, prev_func_name))
- {
- /* What has happened here is that we have just stepped the inferior
- with a signal (because it is a signal which shouldn't make
- us stop), thus stepping into sigtramp.
-
- So we need to set a step_resume_break_address breakpoint
- and continue until we hit it, and then step. */
- step_resume_break_address = prev_pc;
- /* Always 1, I think, but it's probably easier to have
- the step_resume_break as usual rather than trying to
- re-use the breakpoint which is already there. */
- step_resume_break_duplicate =
- breakpoint_here_p (step_resume_break_address);
- if (breakpoints_inserted)
- insert_step_breakpoint ();
- remove_breakpoints_on_following_step = 1;
- another_trap = 1;
- }
-
- /* Save the pc before execution, to compare with pc after stop. */
- prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */
- prev_func_start = stop_func_start; /* Ok, since if DECR_PC_AFTER
- BREAK is defined, the
- original pc would not have
- been at the start of a
- function. */
- prev_func_name = stop_func_name;
- prev_sp = stop_sp;
-
- /* If we did not do break;, it means we should keep
- running the inferior and not return to debugger. */
-
- if (trap_expected && stop_signal != SIGTRAP)
- {
- /* We took a signal (which we are supposed to pass through to
- the inferior, else we'd have done a break above) and we
- haven't yet gotten our trap. Simply continue. */
- resume ((step_range_end && !step_resume_break_address)
- || (trap_expected && !step_resume_break_address)
- || bpstat_should_step (),
- stop_signal);
- }
- else
- {
- /* Either the trap was not expected, but we are continuing
- anyway (the user asked that this signal be passed to the
- child)
- -- or --
- The signal was SIGTRAP, e.g. it was our signal, but we
- decided we should resume from it.
-
- We're going to run this baby now!
-
- Insert breakpoints now, unless we are trying
- to one-proceed past a breakpoint. */
- /* If we've just finished a special step resume and we don't
- want to hit a breakpoint, pull em out. */
- if (!step_resume_break_address &&
- remove_breakpoints_on_following_step)
- {
- remove_breakpoints_on_following_step = 0;
- remove_breakpoints ();
- breakpoints_inserted = 0;
- }
- else if (!breakpoints_inserted &&
- (step_resume_break_address != NULL || !another_trap))
- {
- insert_step_breakpoint ();
- breakpoints_failed = insert_breakpoints ();
- if (breakpoints_failed)
- break;
- breakpoints_inserted = 1;
- }
-
- trap_expected = another_trap;
-
- if (stop_signal == SIGTRAP)
- stop_signal = 0;
-
-#ifdef SHIFT_INST_REGS
- /* I'm not sure when this following segment applies. I do know, now,
- that we shouldn't rewrite the regs when we were stopped by a
- random signal from the inferior process. */
-
- if (!bpstat_explains_signal (stop_bpstat)
- && (stop_signal != SIGCLD)
- && !stopped_by_random_signal)
- {
- CORE_ADDR pc_contents = read_register (PC_REGNUM);
- CORE_ADDR npc_contents = read_register (NPC_REGNUM);
- if (pc_contents != npc_contents)
- {
- write_register (NNPC_REGNUM, npc_contents);
- write_register (NPC_REGNUM, pc_contents);
- }
- }
-#endif /* SHIFT_INST_REGS */
-
- resume ((step_range_end && !step_resume_break_address)
- || (trap_expected && !step_resume_break_address)
- || bpstat_should_step (),
- stop_signal);
- }
- }
- if (target_has_execution)
- {
- /* Assuming the inferior still exists, set these up for next
- time, just like we did above if we didn't break out of the
- loop. */
- prev_pc = read_pc ();
- prev_func_start = stop_func_start;
- prev_func_name = stop_func_name;
- prev_sp = stop_sp;
- }
-}
-
-/* Here to return control to GDB when the inferior stops for real.
- Print appropriate messages, remove breakpoints, give terminal our modes.
-
- STOP_PRINT_FRAME nonzero means print the executing frame
- (pc, function, args, file, line number and line text).
- BREAKPOINTS_FAILED nonzero means stop was due to error
- attempting to insert breakpoints. */
-
-void
-normal_stop ()
-{
- /* Make sure that the current_frame's pc is correct. This
- is a correction for setting up the frame info before doing
- DECR_PC_AFTER_BREAK */
- if (target_has_execution)
- (get_current_frame ())->pc = read_pc ();
-
- if (breakpoints_failed)
- {
- target_terminal_ours_for_output ();
- print_sys_errmsg ("ptrace", breakpoints_failed);
- printf ("Stopped; cannot insert breakpoints.\n\
-The same program may be running in another process.\n");
- }
-
- if (target_has_execution)
- remove_step_breakpoint ();
-
- if (target_has_execution && breakpoints_inserted)
- if (remove_breakpoints ())
- {
- target_terminal_ours_for_output ();
- printf ("Cannot remove breakpoints because program is no longer writable.\n\
-It might be running in another process.\n\
-Further execution is probably impossible.\n");
- }
-
- breakpoints_inserted = 0;
-
- /* Delete the breakpoint we stopped at, if it wants to be deleted.
- Delete any breakpoint that is to be deleted at the next stop. */
-
- breakpoint_auto_delete (stop_bpstat);
-
- /* If an auto-display called a function and that got a signal,
- delete that auto-display to avoid an infinite recursion. */
-
- if (stopped_by_random_signal)
- disable_current_display ();
-
- if (step_multi && stop_step)
- return;
-
- target_terminal_ours ();
-
- if (!target_has_stack)
- return;
-
- /* Select innermost stack frame except on return from a stack dummy routine,
- or if the program has exited. Print it without a level number if
- we have changed functions or hit a breakpoint. Print source line
- if we have one. */
- if (!stop_stack_dummy)
- {
- select_frame (get_current_frame (), 0);
-
- if (stop_print_frame)
- {
- int source_only;
-
- source_only = bpstat_print (stop_bpstat);
- source_only = source_only ||
- ( stop_step
- && step_frame_address == stop_frame_address
- && step_start_function == find_pc_function (stop_pc));
-
- print_stack_frame (selected_frame, -1, source_only? -1: 1);
-
- /* Display the auto-display expressions. */
- do_displays ();
- }
- }
-
- /* Save the function value return registers, if we care.
- We might be about to restore their previous contents. */
- if (proceed_to_finish)
- read_register_bytes (0, stop_registers, REGISTER_BYTES);
-
- if (stop_stack_dummy)
- {
- /* Pop the empty frame that contains the stack dummy.
- POP_FRAME ends with a setting of the current frame, so we
- can use that next. */
- POP_FRAME;
- select_frame (get_current_frame (), 0);
- }
-}
-
-static void
-insert_step_breakpoint ()
-{
- if (step_resume_break_address && !step_resume_break_duplicate)
- target_insert_breakpoint (step_resume_break_address,
- step_resume_break_shadow);
-}
-
-static void
-remove_step_breakpoint ()
-{
- if (step_resume_break_address && !step_resume_break_duplicate)
- target_remove_breakpoint (step_resume_break_address,
- step_resume_break_shadow);
-}
-
-static void
-sig_print_header ()
-{
- printf_filtered ("Signal\t\tStop\tPrint\tPass to program\tDescription\n");
-}
-
-static void
-sig_print_info (number)
- int number;
-{
- char *abbrev = sig_abbrev(number);
- if (abbrev == NULL)
- printf_filtered ("%d\t\t", number);
- else
- printf_filtered ("SIG%s (%d)\t", abbrev, number);
- printf_filtered ("%s\t", signal_stop[number] ? "Yes" : "No");
- printf_filtered ("%s\t", signal_print[number] ? "Yes" : "No");
- printf_filtered ("%s\t\t", signal_program[number] ? "Yes" : "No");
- printf_filtered ("%s\n", sys_siglist[number]);
-}
-
-/* Specify how various signals in the inferior should be handled. */
-
-static void
-handle_command (args, from_tty)
- char *args;
- int from_tty;
-{
- register char *p = args;
- int signum = 0;
- register int digits, wordlen;
- char *nextarg;
-
- if (!args)
- error_no_arg ("signal to handle");
-
- while (*p)
- {
- /* Find the end of the next word in the args. */
- for (wordlen = 0;
- p[wordlen] && p[wordlen] != ' ' && p[wordlen] != '\t';
- wordlen++);
- /* Set nextarg to the start of the word after the one we just
- found, and null-terminate this one. */
- if (p[wordlen] == '\0')
- nextarg = p + wordlen;
- else
- {
- p[wordlen] = '\0';
- nextarg = p + wordlen + 1;
- }
-
-
- for (digits = 0; p[digits] >= '0' && p[digits] <= '9'; digits++);
-
- if (signum == 0)
- {
- /* It is the first argument--must be the signal to operate on. */
- if (digits == wordlen)
- {
- /* Numeric. */
- signum = atoi (p);
- if (signum <= 0 || signum >= NSIG)
- {
- p[wordlen] = '\0';
- error ("Invalid signal %s given as argument to \"handle\".", p);
- }
- }
- else
- {
- /* Symbolic. */
- signum = sig_number (p);
- if (signum == -1)
- error ("No such signal \"%s\"", p);
- }
-
- if (signum == SIGTRAP || signum == SIGINT)
- {
- if (!query ("SIG%s is used by the debugger.\nAre you sure you want to change it? ", sig_abbrev (signum)))
- error ("Not confirmed.");
- }
- }
- /* Else, if already got a signal number, look for flag words
- saying what to do for it. */
- else if (!strncmp (p, "stop", wordlen))
- {
- signal_stop[signum] = 1;
- signal_print[signum] = 1;
- }
- else if (wordlen >= 2 && !strncmp (p, "print", wordlen))
- signal_print[signum] = 1;
- else if (wordlen >= 2 && !strncmp (p, "pass", wordlen))
- signal_program[signum] = 1;
- else if (!strncmp (p, "ignore", wordlen))
- signal_program[signum] = 0;
- else if (wordlen >= 3 && !strncmp (p, "nostop", wordlen))
- signal_stop[signum] = 0;
- else if (wordlen >= 4 && !strncmp (p, "noprint", wordlen))
- {
- signal_print[signum] = 0;
- signal_stop[signum] = 0;
- }
- else if (wordlen >= 4 && !strncmp (p, "nopass", wordlen))
- signal_program[signum] = 0;
- else if (wordlen >= 3 && !strncmp (p, "noignore", wordlen))
- signal_program[signum] = 1;
- /* Not a number and not a recognized flag word => complain. */
- else
- {
- error ("Unrecognized flag word: \"%s\".", p);
- }
-
- /* Find start of next word. */
- p = nextarg;
- while (*p == ' ' || *p == '\t') p++;
- }
-
- if (from_tty)
- {
- /* Show the results. */
- sig_print_header ();
- sig_print_info (signum);
- }
-}
-
-/* Print current contents of the tables set by the handle command. */
-
-static void
-signals_info (signum_exp)
- char *signum_exp;
-{
- register int i;
- sig_print_header ();
-
- if (signum_exp)
- {
- /* First see if this is a symbol name. */
- i = sig_number (signum_exp);
- if (i == -1)
- {
- /* Nope, maybe it's an address which evaluates to a signal
- number. */
- i = parse_and_eval_address (signum_exp);
- if (i >= NSIG || i < 0)
- error ("Signal number out of bounds.");
- }
- sig_print_info (i);
- return;
- }
-
- printf_filtered ("\n");
- for (i = 0; i < NSIG; i++)
- {
- QUIT;
-
- sig_print_info (i);
- }
-
- printf_filtered ("\nUse the \"handle\" command to change these tables.\n");
-}
-
-/* Save all of the information associated with the inferior<==>gdb
- connection. INF_STATUS is a pointer to a "struct inferior_status"
- (defined in inferior.h). */
-
-void
-save_inferior_status (inf_status, restore_stack_info)
- struct inferior_status *inf_status;
- int restore_stack_info;
-{
- inf_status->pc_changed = pc_changed;
- inf_status->stop_signal = stop_signal;
- inf_status->stop_pc = stop_pc;
- inf_status->stop_frame_address = stop_frame_address;
- inf_status->stop_step = stop_step;
- inf_status->stop_stack_dummy = stop_stack_dummy;
- inf_status->stopped_by_random_signal = stopped_by_random_signal;
- inf_status->trap_expected = trap_expected;
- inf_status->step_range_start = step_range_start;
- inf_status->step_range_end = step_range_end;
- inf_status->step_frame_address = step_frame_address;
- inf_status->step_over_calls = step_over_calls;
- inf_status->step_resume_break_address = step_resume_break_address;
- inf_status->stop_after_trap = stop_after_trap;
- inf_status->stop_soon_quietly = stop_soon_quietly;
- /* Save original bpstat chain here; replace it with copy of chain.
- If caller's caller is walking the chain, they'll be happier if we
- hand them back the original chain when restore_i_s is called. */
- inf_status->stop_bpstat = stop_bpstat;
- stop_bpstat = bpstat_copy (stop_bpstat);
- inf_status->breakpoint_proceeded = breakpoint_proceeded;
- inf_status->restore_stack_info = restore_stack_info;
- inf_status->proceed_to_finish = proceed_to_finish;
-
- bcopy (stop_registers, inf_status->stop_registers, REGISTER_BYTES);
-
- record_selected_frame (&(inf_status->selected_frame_address),
- &(inf_status->selected_level));
- return;
-}
-
-void
-restore_inferior_status (inf_status)
- struct inferior_status *inf_status;
-{
- FRAME fid;
- int level = inf_status->selected_level;
-
- pc_changed = inf_status->pc_changed;
- stop_signal = inf_status->stop_signal;
- stop_pc = inf_status->stop_pc;
- stop_frame_address = inf_status->stop_frame_address;
- stop_step = inf_status->stop_step;
- stop_stack_dummy = inf_status->stop_stack_dummy;
- stopped_by_random_signal = inf_status->stopped_by_random_signal;
- trap_expected = inf_status->trap_expected;
- step_range_start = inf_status->step_range_start;
- step_range_end = inf_status->step_range_end;
- step_frame_address = inf_status->step_frame_address;
- step_over_calls = inf_status->step_over_calls;
- step_resume_break_address = inf_status->step_resume_break_address;
- stop_after_trap = inf_status->stop_after_trap;
- stop_soon_quietly = inf_status->stop_soon_quietly;
- bpstat_clear (&stop_bpstat);
- stop_bpstat = inf_status->stop_bpstat;
- breakpoint_proceeded = inf_status->breakpoint_proceeded;
- proceed_to_finish = inf_status->proceed_to_finish;
-
- bcopy (inf_status->stop_registers, stop_registers, REGISTER_BYTES);
-
- /* The inferior can be gone if the user types "print exit(0)"
- (and perhaps other times). */
- if (target_has_stack && inf_status->restore_stack_info)
- {
- fid = find_relative_frame (get_current_frame (),
- &level);
-
- /* If inf_status->selected_frame_address is NULL, there was no
- previously selected frame. */
- if (fid == 0 ||
- FRAME_FP (fid) != inf_status->selected_frame_address ||
- level != 0)
- {
-#if 0
- /* I'm not sure this error message is a good idea. I have
- only seen it occur after "Can't continue previously
- requested operation" (we get called from do_cleanups), in
- which case it just adds insult to injury (one confusing
- error message after another. Besides which, does the
- user really care if we can't restore the previously
- selected frame? */
- fprintf (stderr, "Unable to restore previously selected frame.\n");
-#endif
- select_frame (get_current_frame (), 0);
- return;
- }
-
- select_frame (fid, inf_status->selected_level);
- }
-}
-
-
-void
-_initialize_infrun ()
-{
- register int i;
-
- add_info ("signals", signals_info,
- "What debugger does when program gets various signals.\n\
-Specify a signal number as argument to print info on that signal only.");
-
- add_com ("handle", class_run, handle_command,
- "Specify how to handle a signal.\n\
-Args are signal number followed by flags.\n\
-Flags allowed are \"stop\", \"print\", \"pass\",\n\
- \"nostop\", \"noprint\" or \"nopass\".\n\
-Print means print a message if this signal happens.\n\
-Stop means reenter debugger if this signal happens (implies print).\n\
-Pass means let program see this signal; otherwise program doesn't know.\n\
-Pass and Stop may be combined.");
-
- for (i = 0; i < NSIG; i++)
- {
- signal_stop[i] = 1;
- signal_print[i] = 1;
- signal_program[i] = 1;
- }
-
- /* Signals caused by debugger's own actions
- should not be given to the program afterwards. */
- signal_program[SIGTRAP] = 0;
- signal_program[SIGINT] = 0;
-
- /* Signals that are not errors should not normally enter the debugger. */
-#ifdef SIGALRM
- signal_stop[SIGALRM] = 0;
- signal_print[SIGALRM] = 0;
-#endif /* SIGALRM */
-#ifdef SIGVTALRM
- signal_stop[SIGVTALRM] = 0;
- signal_print[SIGVTALRM] = 0;
-#endif /* SIGVTALRM */
-#ifdef SIGPROF
- signal_stop[SIGPROF] = 0;
- signal_print[SIGPROF] = 0;
-#endif /* SIGPROF */
-#ifdef SIGCHLD
- signal_stop[SIGCHLD] = 0;
- signal_print[SIGCHLD] = 0;
-#endif /* SIGCHLD */
-#ifdef SIGCLD
- signal_stop[SIGCLD] = 0;
- signal_print[SIGCLD] = 0;
-#endif /* SIGCLD */
-#ifdef SIGIO
- signal_stop[SIGIO] = 0;
- signal_print[SIGIO] = 0;
-#endif /* SIGIO */
-#ifdef SIGURG
- signal_stop[SIGURG] = 0;
- signal_print[SIGURG] = 0;
-#endif /* SIGURG */
-}
-
diff --git a/gdb/infrun.hacked.c b/gdb/infrun.hacked.c
deleted file mode 100644
index d38bd06..0000000
--- a/gdb/infrun.hacked.c
+++ /dev/null
@@ -1,1707 +0,0 @@
-/* Start and stop the inferior process, for GDB.
- Copyright (C) 1986, 1987, 1988, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Notes on the algorithm used in wait_for_inferior to determine if we
- just did a subroutine call when stepping. We have the following
- information at that point:
-
- Current and previous (just before this step) pc.
- Current and previous sp.
- Current and previous start of current function.
-
- If the start's of the functions don't match, then
-
- a) We did a subroutine call.
-
- In this case, the pc will be at the beginning of a function.
-
- b) We did a subroutine return.
-
- Otherwise.
-
- c) We did a longjmp.
-
- If we did a longjump, we were doing "nexti", since a next would
- have attempted to skip over the assembly language routine in which
- the longjmp is coded and would have simply been the equivalent of a
- continue. I consider this ok behaivior. We'd like one of two
- things to happen if we are doing a nexti through the longjmp()
- routine: 1) It behaves as a stepi, or 2) It acts like a continue as
- above. Given that this is a special case, and that anybody who
- thinks that the concept of sub calls is meaningful in the context
- of a longjmp, I'll take either one. Let's see what happens.
-
- Acts like a subroutine return. I can handle that with no problem
- at all.
-
- -->So: If the current and previous beginnings of the current
- function don't match, *and* the pc is at the start of a function,
- we've done a subroutine call. If the pc is not at the start of a
- function, we *didn't* do a subroutine call.
-
- -->If the beginnings of the current and previous function do match,
- either:
-
- a) We just did a recursive call.
-
- In this case, we would be at the very beginning of a
- function and 1) it will have a prologue (don't jump to
- before prologue, or 2) (we assume here that it doesn't have
- a prologue) there will have been a change in the stack
- pointer over the last instruction. (Ie. it's got to put
- the saved pc somewhere. The stack is the usual place. In
- a recursive call a register is only an option if there's a
- prologue to do something with it. This is even true on
- register window machines; the prologue sets up the new
- window. It might not be true on a register window machine
- where the call instruction moved the register window
- itself. Hmmm. One would hope that the stack pointer would
- also change. If it doesn't, somebody send me a note, and
- I'll work out a more general theory.
- bug-gdb@prep.ai.mit.edu). This is true (albeit slipperly
- so) on all machines I'm aware of:
-
- m68k: Call changes stack pointer. Regular jumps don't.
-
- sparc: Recursive calls must have frames and therefor,
- prologues.
-
- vax: All calls have frames and hence change the
- stack pointer.
-
- b) We did a return from a recursive call. I don't see that we
- have either the ability or the need to distinguish this
- from an ordinary jump. The stack frame will be printed
- when and if the frame pointer changes; if we are in a
- function without a frame pointer, it's the users own
- lookout.
-
- c) We did a jump within a function. We assume that this is
- true if we didn't do a recursive call.
-
- d) We are in no-man's land ("I see no symbols here"). We
- don't worry about this; it will make calls look like simple
- jumps (and the stack frames will be printed when the frame
- pointer moves), which is a reasonably non-violent response.
-
-#if 0
- We skip this; it causes more problems than it's worth.
-#ifdef SUN4_COMPILER_FEATURE
- We do a special ifdef for the sun 4, forcing it to single step
- into calls which don't have prologues. This means that we can't
- nexti over leaf nodes, we can probably next over them (since they
- won't have debugging symbols, usually), and we can next out of
- functions returning structures (with a "call .stret4" at the end).
-#endif
-#endif
-*/
-
-
-
-
-
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "inferior.h"
-#include "breakpoint.h"
-#include "wait.h"
-#include "gdbcore.h"
-#include "signame.h"
-#include "command.h"
-#include "terminal.h" /* For #ifdef TIOCGPGRP and new_tty */
-#include "target.h"
-
-#include <signal.h>
-
-/* unistd.h is needed to #define X_OK */
-#ifdef USG
-#include <unistd.h>
-#else
-#include <sys/file.h>
-#endif
-
-#ifdef SET_STACK_LIMIT_HUGE
-extern int original_stack_limit;
-#endif /* SET_STACK_LIMIT_HUGE */
-
-/* Required by <sys/user.h>. */
-#include <sys/types.h>
-/* Required by <sys/user.h>, at least on system V. */
-#include <sys/dir.h>
-/* Needed by IN_SIGTRAMP on some machines (e.g. vax). */
-#include <sys/param.h>
-/* Needed by IN_SIGTRAMP on some machines (e.g. vax). */
-#include <sys/user.h>
-
-extern int errno;
-extern char *getenv ();
-
-extern struct target_ops child_ops; /* In inftarg.c */
-
-/* Copy of inferior_io_terminal when inferior was last started. */
-
-extern char *inferior_thisrun_terminal;
-
-
-/* Sigtramp is a routine that the kernel calls (which then calls the
- signal handler). On most machines it is a library routine that
- is linked into the executable.
-
- This macro, given a program counter value and the name of the
- function in which that PC resides (which can be null if the
- name is not known), returns nonzero if the PC and name show
- that we are in sigtramp.
-
- On most machines just see if the name is sigtramp (and if we have
- no name, assume we are not in sigtramp). */
-#if !defined (IN_SIGTRAMP)
-#define IN_SIGTRAMP(pc, name) \
- name && !strcmp ("_sigtramp", name)
-#endif
-
-/* Tables of how to react to signals; the user sets them. */
-
-static char signal_stop[NSIG];
-static char signal_print[NSIG];
-static char signal_program[NSIG];
-
-/* Nonzero if breakpoints are now inserted in the inferior. */
-/* Nonstatic for initialization during xxx_create_inferior. FIXME. */
-
-/*static*/ int breakpoints_inserted;
-
-/* Function inferior was in as of last step command. */
-
-static struct symbol *step_start_function;
-
-/* Nonzero => address for special breakpoint for resuming stepping. */
-
-static CORE_ADDR step_resume_break_address;
-
-/* Pointer to orig contents of the byte where the special breakpoint is. */
-
-static char step_resume_break_shadow[BREAKPOINT_MAX];
-
-/* Nonzero means the special breakpoint is a duplicate
- so it has not itself been inserted. */
-
-static int step_resume_break_duplicate;
-
-/* Nonzero if we are expecting a trace trap and should proceed from it. */
-
-static int trap_expected;
-
-/* Nonzero if the next time we try to continue the inferior, it will
- step one instruction and generate a spurious trace trap.
- This is used to compensate for a bug in HP-UX. */
-
-static int trap_expected_after_continue;
-
-/* Nonzero means expecting a trace trap
- and should stop the inferior and return silently when it happens. */
-
-int stop_after_trap;
-
-/* Nonzero means expecting a trap and caller will handle it themselves.
- It is used after attach, due to attaching to a process;
- when running in the shell before the child program has been exec'd;
- and when running some kinds of remote stuff (FIXME?). */
-
-int stop_soon_quietly;
-
-/* Nonzero if pc has been changed by the debugger
- since the inferior stopped. */
-
-int pc_changed;
-
-/* Nonzero if proceed is being used for a "finish" command or a similar
- situation when stop_registers should be saved. */
-
-int proceed_to_finish;
-
-/* Save register contents here when about to pop a stack dummy frame,
- if-and-only-if proceed_to_finish is set.
- Thus this contains the return value from the called function (assuming
- values are returned in a register). */
-
-char stop_registers[REGISTER_BYTES];
-
-/* Nonzero if program stopped due to error trying to insert breakpoints. */
-
-static int breakpoints_failed;
-
-/* Nonzero after stop if current stack frame should be printed. */
-
-static int stop_print_frame;
-
-#ifdef NO_SINGLE_STEP
-extern int one_stepped; /* From machine dependent code */
-extern void single_step (); /* Same. */
-#endif /* NO_SINGLE_STEP */
-
-static void insert_step_breakpoint ();
-static void remove_step_breakpoint ();
-/*static*/ void wait_for_inferior ();
-void init_wait_for_inferior ();
-static void normal_stop ();
-
-
-/* Clear out all variables saying what to do when inferior is continued.
- First do this, then set the ones you want, then call `proceed'. */
-
-void
-clear_proceed_status ()
-{
- trap_expected = 0;
- step_range_start = 0;
- step_range_end = 0;
- step_frame_address = 0;
- step_over_calls = -1;
- step_resume_break_address = 0;
- stop_after_trap = 0;
- stop_soon_quietly = 0;
- proceed_to_finish = 0;
- breakpoint_proceeded = 1; /* We're about to proceed... */
-
- /* Discard any remaining commands or status from previous stop. */
- bpstat_clear (&stop_bpstat);
-}
-
-/* Basic routine for continuing the program in various fashions.
-
- ADDR is the address to resume at, or -1 for resume where stopped.
- SIGGNAL is the signal to give it, or 0 for none,
- or -1 for act according to how it stopped.
- STEP is nonzero if should trap after one instruction.
- -1 means return after that and print nothing.
- You should probably set various step_... variables
- before calling here, if you are stepping.
-
- You should call clear_proceed_status before calling proceed. */
-
-void
-proceed (addr, siggnal, step)
- CORE_ADDR addr;
- int siggnal;
- int step;
-{
- int oneproc = 0;
-
- if (step > 0)
- step_start_function = find_pc_function (read_pc ());
- if (step < 0)
- stop_after_trap = 1;
-
- if (addr == -1)
- {
- /* If there is a breakpoint at the address we will resume at,
- step one instruction before inserting breakpoints
- so that we do not stop right away. */
-
- if (!pc_changed && breakpoint_here_p (read_pc ()))
- oneproc = 1;
- }
- else
- {
- write_register (PC_REGNUM, addr);
-#ifdef NPC_REGNUM
- write_register (NPC_REGNUM, addr + 4);
-#ifdef NNPC_REGNUM
- write_register (NNPC_REGNUM, addr + 8);
-#endif
-#endif
- }
-
- if (trap_expected_after_continue)
- {
- /* If (step == 0), a trap will be automatically generated after
- the first instruction is executed. Force step one
- instruction to clear this condition. This should not occur
- if step is nonzero, but it is harmless in that case. */
- oneproc = 1;
- trap_expected_after_continue = 0;
- }
-
- if (oneproc)
- /* We will get a trace trap after one instruction.
- Continue it automatically and insert breakpoints then. */
- trap_expected = 1;
- else
- {
- int temp = insert_breakpoints ();
- if (temp)
- {
- print_sys_errmsg ("ptrace", temp);
- error ("Cannot insert breakpoints.\n\
-The same program may be running in another process.");
- }
- breakpoints_inserted = 1;
- }
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- if (siggnal >= 0)
- stop_signal = siggnal;
- /* If this signal should not be seen by program,
- give it zero. Used for debugging signals. */
- else if (stop_signal < NSIG && !signal_program[stop_signal])
- stop_signal= 0;
-
- /* Handle any optimized stores to the inferior NOW... */
-#ifdef DO_DEFERRED_STORES
- DO_DEFERRED_STORES;
-#endif
-
- /* Resume inferior. */
- target_resume (oneproc || step || bpstat_should_step (), stop_signal);
-
- /* Wait for it to stop (if not standalone)
- and in any case decode why it stopped, and act accordingly. */
-
- wait_for_inferior ();
- normal_stop ();
-}
-
-#if 0
-/* This might be useful (not sure), but isn't currently used. See also
- write_pc(). */
-/* Writing the inferior pc as a register calls this function
- to inform infrun that the pc has been set in the debugger. */
-
-void
-writing_pc (val)
- CORE_ADDR val;
-{
- stop_pc = val;
- pc_changed = 1;
-}
-#endif
-
-/* Record the pc and sp of the program the last time it stopped.
- These are just used internally by wait_for_inferior, but need
- to be preserved over calls to it and cleared when the inferior
- is started. */
-static CORE_ADDR prev_pc;
-static CORE_ADDR prev_sp;
-static CORE_ADDR prev_func_start;
-static char *prev_func_name;
-
-/* Start an inferior Unix child process and sets inferior_pid to its pid.
- EXEC_FILE is the file to run.
- ALLARGS is a string containing the arguments to the program.
- ENV is the environment vector to pass. Errors reported with error(). */
-
-#ifndef SHELL_FILE
-#define SHELL_FILE "/bin/sh"
-#endif
-
-void
-child_create_inferior (exec_file, allargs, env)
- char *exec_file;
- char *allargs;
- char **env;
-{
- int pid;
- char *shell_command;
- extern int sys_nerr;
- extern char *sys_errlist[];
- extern int errno;
- char *shell_file;
- static char default_shell_file[] = SHELL_FILE;
- int len;
- int pending_execs;
- /* Set debug_fork then attach to the child while it sleeps, to debug. */
- static int debug_fork = 0;
- /* This is set to the result of setpgrp, which if vforked, will be visible
- to you in the parent process. It's only used by humans for debugging. */
- static int debug_setpgrp = 657473;
-
- /* The user might want tilde-expansion, and in general probably wants
- the program to behave the same way as if run from
- his/her favorite shell. So we let the shell run it for us.
- FIXME, this should probably search the local environment (as
- modified by the setenv command), not the env gdb inherited. */
- shell_file = getenv ("SHELL");
- if (shell_file == NULL)
- shell_file = default_shell_file;
-
- len = 5 + strlen (exec_file) + 1 + strlen (allargs) + 1 + /*slop*/ 10;
- /* If desired, concat something onto the front of ALLARGS.
- SHELL_COMMAND is the result. */
-#ifdef SHELL_COMMAND_CONCAT
- shell_command = (char *) alloca (strlen (SHELL_COMMAND_CONCAT) + len);
- strcpy (shell_command, SHELL_COMMAND_CONCAT);
-#else
- shell_command = (char *) alloca (len);
- shell_command[0] = '\0';
-#endif
- strcat (shell_command, "exec ");
- strcat (shell_command, exec_file);
- strcat (shell_command, " ");
- strcat (shell_command, allargs);
-
- /* exec is said to fail if the executable is open. */
- close_exec_file ();
-
-#if defined(USG) && !defined(HAVE_VFORK)
- pid = fork ();
-#else
- if (debug_fork)
- pid = fork ();
- else
- pid = vfork ();
-#endif
-
- if (pid < 0)
- perror_with_name ("vfork");
-
- if (pid == 0)
- {
- if (debug_fork)
- sleep (debug_fork);
-
-#ifdef TIOCGPGRP
- /* Run inferior in a separate process group. */
- debug_setpgrp = setpgrp (getpid (), getpid ());
- if (0 != debug_setpgrp)
- perror("setpgrp failed in child");
-#endif /* TIOCGPGRP */
-
-#ifdef SET_STACK_LIMIT_HUGE
- /* Reset the stack limit back to what it was. */
- {
- struct rlimit rlim;
-
- getrlimit (RLIMIT_STACK, &rlim);
- rlim.rlim_cur = original_stack_limit;
- setrlimit (RLIMIT_STACK, &rlim);
- }
-#endif /* SET_STACK_LIMIT_HUGE */
-
- /* Tell the terminal handling subsystem what tty we plan to run on;
- it will now switch to that one if non-null. */
-
- new_tty (inferior_io_terminal);
-
- /* Changing the signal handlers for the inferior after
- a vfork can also change them for the superior, so we don't mess
- with signals here. See comments in
- initialize_signals for how we get the right signal handlers
- for the inferior. */
-
- call_ptrace (0, 0, 0, 0); /* "Trace me, Dr. Memory!" */
- execle (shell_file, shell_file, "-c", shell_command, (char *)0, env);
-
- fprintf (stderr, "Cannot exec %s: %s.\n", shell_file,
- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
- fflush (stderr);
- _exit (0177);
- }
-
- /* Now that we have a child process, make it our target. */
- push_target (&child_ops);
-
-#ifdef CREATE_INFERIOR_HOOK
- CREATE_INFERIOR_HOOK (pid);
-#endif
-
-/* The process was started by the fork that created it,
- but it will have stopped one instruction after execing the shell.
- Here we must get it up to actual execution of the real program. */
-
- inferior_pid = pid; /* Needed for wait_for_inferior stuff below */
-
- clear_proceed_status ();
-
-#if defined (START_INFERIOR_HOOK)
- START_INFERIOR_HOOK ();
-#endif
-
- /* We will get a trace trap after one instruction.
- Continue it automatically. Eventually (after shell does an exec)
- it will get another trace trap. Then insert breakpoints and continue. */
-
-#ifdef START_INFERIOR_TRAPS_EXPECTED
- pending_execs = START_INFERIOR_TRAPS_EXPECTED;
-#else
- pending_execs = 2;
-#endif
-
- init_wait_for_inferior ();
-
- /* Set up the "saved terminal modes" of the inferior
- based on what modes we are starting it with. */
- target_terminal_init ();
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- while (1)
- {
- stop_soon_quietly = 1; /* Make wait_for_inferior be quiet */
- wait_for_inferior ();
- if (stop_signal != SIGTRAP)
- {
- /* Let shell child handle its own signals in its own way */
- /* FIXME, what if child has exit()ed? Must exit loop somehow */
- target_resume (0, stop_signal);
- }
- else
- {
- /* We handle SIGTRAP, however; it means child did an exec. */
- if (0 == --pending_execs)
- break;
- target_resume (0, 0); /* Just make it go on */
- }
- }
- stop_soon_quietly = 0;
-
- /* Should this perhaps just be a "proceed" call? FIXME */
- insert_step_breakpoint ();
- breakpoints_failed = insert_breakpoints ();
- if (!breakpoints_failed)
- {
- breakpoints_inserted = 1;
- target_terminal_inferior();
- /* Start the child program going on its first instruction, single-
- stepping if we need to. */
- target_resume (bpstat_should_step (), 0);
- wait_for_inferior ();
- normal_stop ();
- }
-}
-
-/* Start remote-debugging of a machine over a serial link. */
-
-void
-start_remote ()
-{
- init_wait_for_inferior ();
- clear_proceed_status ();
- stop_soon_quietly = 1;
- trap_expected = 0;
-}
-
-/* Initialize static vars when a new inferior begins. */
-
-void
-init_wait_for_inferior ()
-{
- /* These are meaningless until the first time through wait_for_inferior. */
- prev_pc = 0;
- prev_sp = 0;
- prev_func_start = 0;
- prev_func_name = NULL;
-
- trap_expected_after_continue = 0;
- breakpoints_inserted = 0;
- mark_breakpoints_out ();
-}
-
-
-/* Attach to process PID, then initialize for debugging it
- and wait for the trace-trap that results from attaching. */
-
-void
-child_open (args, from_tty)
- char *args;
- int from_tty;
-{
- char *exec_file;
- int pid;
-
- dont_repeat();
-
- if (!args)
- error_no_arg ("process-id to attach");
-
-#ifndef ATTACH_DETACH
- error ("Can't attach to a process on this machine.");
-#else
- pid = atoi (args);
-
- if (target_has_execution)
- {
- if (query ("A program is being debugged already. Kill it? "))
- target_kill ((char *)0, from_tty);
- else
- error ("Inferior not killed.");
- }
-
- exec_file = (char *) get_exec_file (1);
-
- if (from_tty)
- {
- printf ("Attaching program: %s pid %d\n",
- exec_file, pid);
- fflush (stdout);
- }
-
- attach (pid);
- inferior_pid = pid;
- push_target (&child_ops);
-
- mark_breakpoints_out ();
- target_terminal_init ();
- clear_proceed_status ();
- stop_soon_quietly = 1;
- /*proceed (-1, 0, -2);*/
- target_terminal_inferior ();
- wait_for_inferior ();
- normal_stop ();
-#endif /* ATTACH_DETACH */
-}
-
-/* Wait for control to return from inferior to debugger.
- If inferior gets a signal, we may decide to start it up again
- instead of returning. That is why there is a loop in this function.
- When this function actually returns it means the inferior
- should be left stopped and GDB should read more commands. */
-
-void
-wait_for_inferior ()
-{
- WAITTYPE w;
- int another_trap;
- int random_signal;
- CORE_ADDR stop_sp;
- CORE_ADDR stop_func_start;
- char *stop_func_name;
- CORE_ADDR prologue_pc;
- int stop_step_resume_break;
- struct symtab_and_line sal;
- int remove_breakpoints_on_following_step = 0;
-
-#if 0
- /* This no longer works now that read_register is lazy;
- it might try to ptrace when the process is not stopped. */
- prev_pc = read_pc ();
- (void) find_pc_partial_function (prev_pc, &prev_func_name,
- &prev_func_start);
- prev_func_start += FUNCTION_START_OFFSET;
- prev_sp = read_register (SP_REGNUM);
-#endif /* 0 */
-
- while (1)
- {
- /* Clean up saved state that will become invalid. */
- pc_changed = 0;
- flush_cached_frames ();
- registers_changed ();
-
- target_wait (&w);
-
- /* See if the process still exists; clean up if it doesn't. */
- if (WIFEXITED (w))
- {
- target_terminal_ours_for_output ();
- if (WEXITSTATUS (w))
- printf ("\nProgram exited with code 0%o.\n",
- (unsigned int)WEXITSTATUS (w));
- else
- if (!batch_mode())
- printf ("\nProgram exited normally.\n");
- fflush (stdout);
- target_mourn_inferior ();
-#ifdef NO_SINGLE_STEP
- one_stepped = 0;
-#endif
- stop_print_frame = 0;
- break;
- }
- else if (!WIFSTOPPED (w))
- {
- target_kill ((char *)0, 0);
- stop_print_frame = 0;
- stop_signal = WTERMSIG (w);
- target_terminal_ours_for_output ();
- printf ("\nProgram terminated with signal %d, %s\n",
- stop_signal,
- stop_signal < NSIG
- ? sys_siglist[stop_signal]
- : "(undocumented)");
- printf ("The inferior process no longer exists.\n");
- fflush (stdout);
-#ifdef NO_SINGLE_STEP
- one_stepped = 0;
-#endif
- break;
- }
-
-#ifdef NO_SINGLE_STEP
- if (one_stepped)
- single_step (0); /* This actually cleans up the ss */
-#endif /* NO_SINGLE_STEP */
-
- stop_pc = read_pc ();
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
-
- stop_frame_address = FRAME_FP (get_current_frame ());
- stop_sp = read_register (SP_REGNUM);
- stop_func_start = 0;
- stop_func_name = 0;
- /* Don't care about return value; stop_func_start and stop_func_name
- will both be 0 if it doesn't work. */
- (void) find_pc_partial_function (stop_pc, &stop_func_name,
- &stop_func_start);
- stop_func_start += FUNCTION_START_OFFSET;
- another_trap = 0;
- bpstat_clear (&stop_bpstat);
- stop_step = 0;
- stop_stack_dummy = 0;
- stop_print_frame = 1;
- stop_step_resume_break = 0;
- random_signal = 0;
- stopped_by_random_signal = 0;
- breakpoints_failed = 0;
-
- /* Look at the cause of the stop, and decide what to do.
- The alternatives are:
- 1) break; to really stop and return to the debugger,
- 2) drop through to start up again
- (set another_trap to 1 to single step once)
- 3) set random_signal to 1, and the decision between 1 and 2
- will be made according to the signal handling tables. */
-
- stop_signal = WSTOPSIG (w);
-
- /* First, distinguish signals caused by the debugger from signals
- that have to do with the program's own actions.
- Note that breakpoint insns may cause SIGTRAP or SIGILL
- or SIGEMT, depending on the operating system version.
- Here we detect when a SIGILL or SIGEMT is really a breakpoint
- and change it to SIGTRAP. */
-
- if (stop_signal == SIGTRAP
- || (breakpoints_inserted &&
- (stop_signal == SIGILL
- || stop_signal == SIGEMT))
- || stop_soon_quietly)
- {
- if (stop_signal == SIGTRAP && stop_after_trap)
- {
- stop_print_frame = 0;
- break;
- }
- if (stop_soon_quietly)
- break;
-
- /* Don't even think about breakpoints
- if just proceeded over a breakpoint.
-
- However, if we are trying to proceed over a breakpoint
- and end up in sigtramp, then step_resume_break_address
- will be set and we should check whether we've hit the
- step breakpoint. */
- if (stop_signal == SIGTRAP && trap_expected
- && step_resume_break_address == NULL)
- bpstat_clear (&stop_bpstat);
- else
- {
- /* See if there is a breakpoint at the current PC. */
-#if DECR_PC_AFTER_BREAK
- /* Notice the case of stepping through a jump
- that leads just after a breakpoint.
- Don't confuse that with hitting the breakpoint.
- What we check for is that 1) stepping is going on
- and 2) the pc before the last insn does not match
- the address of the breakpoint before the current pc. */
- if (!(prev_pc != stop_pc - DECR_PC_AFTER_BREAK
- && step_range_end && !step_resume_break_address))
-#endif /* DECR_PC_AFTER_BREAK not zero */
- {
- /* See if we stopped at the special breakpoint for
- stepping over a subroutine call. */
- if (stop_pc - DECR_PC_AFTER_BREAK
- == step_resume_break_address)
- {
- stop_step_resume_break = 1;
- if (DECR_PC_AFTER_BREAK)
- {
- stop_pc -= DECR_PC_AFTER_BREAK;
- write_register (PC_REGNUM, stop_pc);
- pc_changed = 0;
- }
- }
- else
- {
- stop_bpstat =
- bpstat_stop_status (&stop_pc, stop_frame_address);
- /* Following in case break condition called a
- function. */
- stop_print_frame = 1;
- }
- }
- }
-
- if (stop_signal == SIGTRAP)
- random_signal
- = !(bpstat_explains_signal (stop_bpstat)
- || trap_expected
- || stop_step_resume_break
- || PC_IN_CALL_DUMMY (stop_pc, stop_sp, stop_frame_address)
- || (step_range_end && !step_resume_break_address));
- else
- {
- random_signal
- = !(bpstat_explains_signal (stop_bpstat)
- || stop_step_resume_break
- /* End of a stack dummy. Some systems (e.g. Sony
- news) give another signal besides SIGTRAP,
- so check here as well as above. */
- || (stop_sp INNER_THAN stop_pc
- && stop_pc INNER_THAN stop_frame_address)
- );
- if (!random_signal)
- stop_signal = SIGTRAP;
- }
- }
- else
- random_signal = 1;
-
- /* For the program's own signals, act according to
- the signal handling tables. */
-
- if (random_signal)
- {
- /* Signal not for debugging purposes. */
- int printed = 0;
-
- stopped_by_random_signal = 1;
-
- if (stop_signal >= NSIG
- || signal_print[stop_signal])
- {
- printed = 1;
- target_terminal_ours_for_output ();
-#ifdef PRINT_RANDOM_SIGNAL
- PRINT_RANDOM_SIGNAL (stop_signal);
-#else
- printf ("\nProgram received signal %d, %s\n",
- stop_signal,
- stop_signal < NSIG
- ? sys_siglist[stop_signal]
- : "(undocumented)");
-#endif /* PRINT_RANDOM_SIGNAL */
- fflush (stdout);
- }
- if (stop_signal >= NSIG
- || signal_stop[stop_signal])
- break;
- /* If not going to stop, give terminal back
- if we took it away. */
- else if (printed)
- target_terminal_inferior ();
- }
-
- /* Handle cases caused by hitting a user breakpoint. */
-
- if (!random_signal && bpstat_explains_signal (stop_bpstat))
- {
- /* Does a breakpoint want us to stop? */
- if (bpstat_stop (stop_bpstat))
- {
- stop_print_frame = bpstat_should_print (stop_bpstat);
- break;
- }
-
- /* Otherwise we continue. Must remove breakpoints and single-step
- to get us past the one we hit. Possibly we also were stepping
- and should stop for that. So fall through and
- test for stepping. But, if not stepping,
- do not stop. */
- else
- {
- remove_breakpoints ();
- remove_step_breakpoint (); /* FIXME someday, do we need this? */
- breakpoints_inserted = 0;
- another_trap = 1;
- }
- }
-
- /* Handle cases caused by hitting a step-resumption breakpoint. */
-
- else if (!random_signal && stop_step_resume_break)
- {
- /* We have hit the step-resumption breakpoint.
- If we aren't in a recursive call that hit it again
- before returning from the original call, remove it;
- it has done its job getting us here. We then resume
- the stepping we were doing before the function call.
-
- If we are in a recursive call, just proceed from this
- breakpoint as usual, keeping it around to catch the final
- return of interest.
-
- There used to be an sp test to make sure that we don't get hung
- up in recursive calls in functions without frame
- pointers. If the stack pointer isn't outside of
- where the breakpoint was set (within a routine to be
- stepped over), we're in the middle of a recursive
- call. Not true for reg window machines (sparc)
- because they must change frames to call things and
- the stack pointer doesn't have to change if
- the bp was set in a routine without a frame (pc can
- be stored in some other window).
-
- The removal of the sp test is to allow calls to
- alloca. Nasty things were happening. Oh, well,
- gdb can only handle one level deep of lack of
- frame pointer. */
- if (step_frame_address == 0
- || (stop_frame_address == step_frame_address))
- {
- /* We really hit it: not a recursive call. */
- remove_step_breakpoint ();
- step_resume_break_address = 0;
-
- /* If we're waiting for a trap, hitting the step_resume_break
- doesn't count as getting it. */
- if (trap_expected)
- another_trap = 1;
- /* Fall through to resume stepping... */
- }
- else
- {
- /* Otherwise, it's the recursive call case. */
- remove_breakpoints ();
- remove_step_breakpoint ();
- breakpoints_inserted = 0;
- another_trap = 1;
- /* Fall through to continue executing at full speed
- (with a possible single-step lurch over the step-resumption
- breakpoint as we start.) */
- }
- }
-
- /* If this is the breakpoint at the end of a stack dummy,
- just stop silently. */
- if (PC_IN_CALL_DUMMY (stop_pc, stop_sp, stop_frame_address))
- {
- stop_print_frame = 0;
- stop_stack_dummy = 1;
-#ifdef HP_OS_BUG
- trap_expected_after_continue = 1;
-#endif
- break;
- }
-
- if (step_resume_break_address)
- /* Having a step-resume breakpoint overrides anything
- else having to do with stepping commands until
- that breakpoint is reached. */
- ;
- /* If stepping through a line, keep going if still within it. */
- else if (!random_signal
- && step_range_end
- && stop_pc >= step_range_start
- && stop_pc < step_range_end
- /* The step range might include the start of the
- function, so if we are at the start of the
- step range and either the stack or frame pointers
- just changed, we've stepped outside */
- && !(stop_pc == step_range_start
- && stop_frame_address
- && (stop_sp INNER_THAN prev_sp
- || stop_frame_address != step_frame_address)))
- {
-#if 0
- /* When "next"ing through a function,
- This causes an extra stop at the end.
- Is there any reason for this?
- It's confusing to the user. */
- /* Don't step through the return from a function
- unless that is the first instruction stepped through. */
- if (ABOUT_TO_RETURN (stop_pc))
- {
- stop_step = 1;
- break;
- }
-#endif
- }
-
- /* We stepped out of the stepping range. See if that was due
- to a subroutine call that we should proceed to the end of. */
- else if (!random_signal && step_range_end)
- {
- if (stop_func_start)
- {
- prologue_pc = stop_func_start;
- SKIP_PROLOGUE (prologue_pc);
- }
-
- /* Did we just take a signal? */
- if (IN_SIGTRAMP (stop_pc, stop_func_name)
- && !IN_SIGTRAMP (prev_pc, prev_func_name))
- {
- /* This code is needed at least in the following case:
- The user types "next" and then a signal arrives (before
- the "next" is done). */
- /* We've just taken a signal; go until we are back to
- the point where we took it and one more. */
- step_resume_break_address = prev_pc;
- step_resume_break_duplicate =
- breakpoint_here_p (step_resume_break_address);
- if (breakpoints_inserted)
- insert_step_breakpoint ();
- /* Make sure that the stepping range gets us past
- that instruction. */
- if (step_range_end == 1)
- step_range_end = (step_range_start = prev_pc) + 1;
- remove_breakpoints_on_following_step = 1;
- }
-
- /* ==> See comments at top of file on this algorithm. <==*/
-
- else if (stop_pc == stop_func_start
- && (stop_func_start != prev_func_start
- || prologue_pc != stop_func_start
- || stop_sp != prev_sp))
- {
- /* It's a subroutine call */
- if (step_over_calls > 0
- || (step_over_calls && find_pc_function (stop_pc) == 0))
- {
- /* A subroutine call has happened. */
- /* Set a special breakpoint after the return */
- step_resume_break_address =
- ADDR_BITS_REMOVE
- (SAVED_PC_AFTER_CALL (get_current_frame ()));
- step_resume_break_duplicate
- = breakpoint_here_p (step_resume_break_address);
- if (breakpoints_inserted)
- insert_step_breakpoint ();
- }
- /* Subroutine call with source code we should not step over.
- Do step to the first line of code in it. */
- else if (step_over_calls)
- {
- SKIP_PROLOGUE (stop_func_start);
- sal = find_pc_line (stop_func_start, 0);
- /* Use the step_resume_break to step until
- the end of the prologue, even if that involves jumps
- (as it seems to on the vax under 4.2). */
- /* If the prologue ends in the middle of a source line,
- continue to the end of that source line.
- Otherwise, just go to end of prologue. */
-#ifdef PROLOGUE_FIRSTLINE_OVERLAP
- /* no, don't either. It skips any code that's
- legitimately on the first line. */
-#else
- if (sal.end && sal.pc != stop_func_start)
- stop_func_start = sal.end;
-#endif
-
- if (stop_func_start == stop_pc)
- {
- /* We are already there: stop now. */
- stop_step = 1;
- break;
- }
- else
- /* Put the step-breakpoint there and go until there. */
- {
- step_resume_break_address = stop_func_start;
-
- step_resume_break_duplicate
- = breakpoint_here_p (step_resume_break_address);
- if (breakpoints_inserted)
- insert_step_breakpoint ();
- /* Do not specify what the fp should be when we stop
- since on some machines the prologue
- is where the new fp value is established. */
- step_frame_address = 0;
- /* And make sure stepping stops right away then. */
- step_range_end = step_range_start;
- }
- }
- else
- {
- /* We get here only if step_over_calls is 0 and we
- just stepped into a subroutine. I presume
- that step_over_calls is only 0 when we're
- supposed to be stepping at the assembly
- language level.*/
- stop_step = 1;
- break;
- }
- }
- /* No subroutine call; stop now. */
- else
- {
- stop_step = 1;
- break;
- }
- }
-
- else if (trap_expected
- && IN_SIGTRAMP (stop_pc, stop_func_name)
- && !IN_SIGTRAMP (prev_pc, prev_func_name))
- {
- /* What has happened here is that we have just stepped the inferior
- with a signal (because it is a signal which shouldn't make
- us stop), thus stepping into sigtramp.
-
- So we need to set a step_resume_break_address breakpoint
- and continue until we hit it, and then step. */
- step_resume_break_address = prev_pc;
- /* Always 1, I think, but it's probably easier to have
- the step_resume_break as usual rather than trying to
- re-use the breakpoint which is already there. */
- step_resume_break_duplicate =
- breakpoint_here_p (step_resume_break_address);
- if (breakpoints_inserted)
- insert_step_breakpoint ();
- remove_breakpoints_on_following_step = 1;
- another_trap = 1;
- }
-
- /* Save the pc before execution, to compare with pc after stop. */
- prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */
- prev_func_start = stop_func_start; /* Ok, since if DECR_PC_AFTER
- BREAK is defined, the
- original pc would not have
- been at the start of a
- function. */
- prev_func_name = stop_func_name;
- prev_sp = stop_sp;
-
- /* If we did not do break;, it means we should keep
- running the inferior and not return to debugger. */
-
- if (trap_expected && stop_signal != SIGTRAP)
- {
- /* We took a signal (which we are supposed to pass through to
- the inferior, else we'd have done a break above) and we
- haven't yet gotten our trap. Simply continue. */
- target_resume ((step_range_end && !step_resume_break_address)
- || (trap_expected && !step_resume_break_address)
- || bpstat_should_step (),
- stop_signal);
- }
- else
- {
- /* Either the trap was not expected, but we are continuing
- anyway (the user asked that this signal be passed to the
- child)
- -- or --
- The signal was SIGTRAP, e.g. it was our signal, but we
- decided we should resume from it.
-
- We're going to run this baby now!
-
- Insert breakpoints now, unless we are trying
- to one-proceed past a breakpoint. */
- /* If we've just finished a special step resume and we don't
- want to hit a breakpoint, pull em out. */
- if (!step_resume_break_address &&
- remove_breakpoints_on_following_step)
- {
- remove_breakpoints_on_following_step = 0;
- remove_breakpoints ();
- breakpoints_inserted = 0;
- }
- else if (!breakpoints_inserted &&
- (step_resume_break_address != NULL || !another_trap))
- {
- insert_step_breakpoint ();
- breakpoints_failed = insert_breakpoints ();
- if (breakpoints_failed)
- break;
- breakpoints_inserted = 1;
- }
-
- trap_expected = another_trap;
-
- if (stop_signal == SIGTRAP)
- stop_signal = 0;
-
-#ifdef SHIFT_INST_REGS
- /* I'm not sure when this following segment applies. I do know, now,
- that we shouldn't rewrite the regs when we were stopped by a
- random signal from the inferior process. */
-
- if (!stop_breakpoint && (stop_signal != SIGCLD)
- && !stopped_by_random_signal)
- {
- CORE_ADDR pc_contents = read_register (PC_REGNUM);
- CORE_ADDR npc_contents = read_register (NPC_REGNUM);
- if (pc_contents != npc_contents)
- {
- write_register (NNPC_REGNUM, npc_contents);
- write_register (NPC_REGNUM, pc_contents);
- }
- }
-#endif /* SHIFT_INST_REGS */
-
- target_resume ((step_range_end && !step_resume_break_address)
- || (trap_expected && !step_resume_break_address)
- || bpstat_should_step (),
- stop_signal);
- }
- }
- if (target_has_execution)
- {
- /* Assuming the inferior still exists, set these up for next
- time, just like we did above if we didn't break out of the
- loop. */
- prev_pc = read_pc ();
- prev_func_start = stop_func_start;
- prev_func_name = stop_func_name;
- prev_sp = stop_sp;
- }
-}
-
-/* Here to return control to GDB when the inferior stops for real.
- Print appropriate messages, remove breakpoints, give terminal our modes.
-
- STOP_PRINT_FRAME nonzero means print the executing frame
- (pc, function, args, file, line number and line text).
- BREAKPOINTS_FAILED nonzero means stop was due to error
- attempting to insert breakpoints. */
-
-static void
-normal_stop ()
-{
- /* Make sure that the current_frame's pc is correct. This
- is a correction for setting up the frame info before doing
- DECR_PC_AFTER_BREAK */
- if (target_has_execution)
- (get_current_frame ())->pc = read_pc ();
-
- if (breakpoints_failed)
- {
- target_terminal_ours_for_output ();
- print_sys_errmsg ("ptrace", breakpoints_failed);
- printf ("Stopped; cannot insert breakpoints.\n\
-The same program may be running in another process.\n");
- }
-
- if (target_has_execution)
- remove_step_breakpoint ();
-
- if (target_has_execution && breakpoints_inserted)
- if (remove_breakpoints ())
- {
- target_terminal_ours_for_output ();
- printf ("Cannot remove breakpoints because program is no longer writable.\n\
-It must be running in another process.\n\
-Further execution is probably impossible.\n");
- }
-
- breakpoints_inserted = 0;
-
- /* Delete the breakpoint we stopped at, if it wants to be deleted.
- Delete any breakpoint that is to be deleted at the next stop. */
-
- breakpoint_auto_delete (stop_bpstat);
-
- /* If an auto-display called a function and that got a signal,
- delete that auto-display to avoid an infinite recursion. */
-
- if (stopped_by_random_signal)
- disable_current_display ();
-
- if (step_multi && stop_step)
- return;
-
- target_terminal_ours ();
-
- if (!target_has_stack)
- return;
-
- /* Select innermost stack frame except on return from a stack dummy routine,
- or if the program has exited. */
- if (!stop_stack_dummy)
- {
- select_frame (get_current_frame (), 0);
-
- if (stop_print_frame)
- {
- int source_only = bpstat_print (stop_bpstat);
- print_sel_frame
- (source_only
- || (stop_step
- && step_frame_address == stop_frame_address
- && step_start_function == find_pc_function (stop_pc)));
-
- /* Display the auto-display expressions. */
- do_displays ();
- }
- }
-
- /* Save the function value return registers, if we care.
- We might be about to restore their previous contents. */
- if (proceed_to_finish)
- read_register_bytes (0, stop_registers, REGISTER_BYTES);
-
- if (stop_stack_dummy)
- {
- /* Pop the empty frame that contains the stack dummy.
- POP_FRAME ends with a setting of the current frame, so we
- can use that next. */
- POP_FRAME;
- select_frame (get_current_frame (), 0);
- }
-}
-
-static void
-insert_step_breakpoint ()
-{
- if (step_resume_break_address && !step_resume_break_duplicate)
- target_insert_breakpoint (step_resume_break_address,
- step_resume_break_shadow);
-}
-
-static void
-remove_step_breakpoint ()
-{
- if (step_resume_break_address && !step_resume_break_duplicate)
- target_remove_breakpoint (step_resume_break_address,
- step_resume_break_shadow);
-}
-
-static void
-sig_print_header ()
-{
- printf_filtered ("Signal\t\tStop\tPrint\tPass to program\tDescription\n");
-}
-
-static void
-sig_print_info (number)
- int number;
-{
- char *abbrev = sig_abbrev(number);
- if (abbrev == NULL)
- printf_filtered ("%d\t\t", number);
- else
- printf_filtered ("SIG%s (%d)\t", abbrev, number);
- printf_filtered ("%s\t", signal_stop[number] ? "Yes" : "No");
- printf_filtered ("%s\t", signal_print[number] ? "Yes" : "No");
- printf_filtered ("%s\t\t", signal_program[number] ? "Yes" : "No");
- printf_filtered ("%s\n", sys_siglist[number]);
-}
-
-/* Specify how various signals in the inferior should be handled. */
-
-static void
-handle_command (args, from_tty)
- char *args;
- int from_tty;
-{
- register char *p = args;
- int signum = 0;
- register int digits, wordlen;
- char *nextarg;
-
- if (!args)
- error_no_arg ("signal to handle");
-
- while (*p)
- {
- /* Find the end of the next word in the args. */
- for (wordlen = 0;
- p[wordlen] && p[wordlen] != ' ' && p[wordlen] != '\t';
- wordlen++);
- /* Set nextarg to the start of the word after the one we just
- found, and null-terminate this one. */
- if (p[wordlen] == '\0')
- nextarg = p + wordlen;
- else
- {
- p[wordlen] = '\0';
- nextarg = p + wordlen + 1;
- }
-
-
- for (digits = 0; p[digits] >= '0' && p[digits] <= '9'; digits++);
-
- if (signum == 0)
- {
- /* It is the first argument--must be the signal to operate on. */
- if (digits == wordlen)
- {
- /* Numeric. */
- signum = atoi (p);
- if (signum <= 0 || signum >= NSIG)
- {
- p[wordlen] = '\0';
- error ("Invalid signal %s given as argument to \"handle\".", p);
- }
- }
- else
- {
- /* Symbolic. */
- signum = sig_number (p);
- if (signum == -1)
- error ("No such signal \"%s\"", p);
- }
-
- if (signum == SIGTRAP || signum == SIGINT)
- {
- if (!query ("SIG%s is used by the debugger.\nAre you sure you want to change it? ", sig_abbrev (signum)))
- error ("Not confirmed.");
- }
- }
- /* Else, if already got a signal number, look for flag words
- saying what to do for it. */
- else if (!strncmp (p, "stop", wordlen))
- {
- signal_stop[signum] = 1;
- signal_print[signum] = 1;
- }
- else if (wordlen >= 2 && !strncmp (p, "print", wordlen))
- signal_print[signum] = 1;
- else if (wordlen >= 2 && !strncmp (p, "pass", wordlen))
- signal_program[signum] = 1;
- else if (!strncmp (p, "ignore", wordlen))
- signal_program[signum] = 0;
- else if (wordlen >= 3 && !strncmp (p, "nostop", wordlen))
- signal_stop[signum] = 0;
- else if (wordlen >= 4 && !strncmp (p, "noprint", wordlen))
- {
- signal_print[signum] = 0;
- signal_stop[signum] = 0;
- }
- else if (wordlen >= 4 && !strncmp (p, "nopass", wordlen))
- signal_program[signum] = 0;
- else if (wordlen >= 3 && !strncmp (p, "noignore", wordlen))
- signal_program[signum] = 1;
- /* Not a number and not a recognized flag word => complain. */
- else
- {
- error ("Unrecognized flag word: \"%s\".", p);
- }
-
- /* Find start of next word. */
- p = nextarg;
- while (*p == ' ' || *p == '\t') p++;
- }
-
- if (from_tty)
- {
- /* Show the results. */
- sig_print_header ();
- sig_print_info (signum);
- }
-}
-
-/* Print current contents of the tables set by the handle command. */
-
-static void
-signals_info (signum_exp)
- char *signum_exp;
-{
- register int i;
- sig_print_header ();
-
- if (signum_exp)
- {
- /* First see if this is a symbol name. */
- i = sig_number (signum_exp);
- if (i == -1)
- {
- /* Nope, maybe it's an address which evaluates to a signal
- number. */
- i = parse_and_eval_address (signum_exp);
- if (i >= NSIG || i < 0)
- error ("Signal number out of bounds.");
- }
- sig_print_info (i);
- return;
- }
-
- printf_filtered ("\n");
- for (i = 0; i < NSIG; i++)
- {
- QUIT;
-
- sig_print_info (i);
- }
-
- printf_filtered ("\nUse the \"handle\" command to change these tables.\n");
-}
-
-/* Save all of the information associated with the inferior<==>gdb
- connection. INF_STATUS is a pointer to a "struct inferior_status"
- (defined in inferior.h). */
-
-void
-save_inferior_status (inf_status, restore_stack_info)
- struct inferior_status *inf_status;
- int restore_stack_info;
-{
- inf_status->pc_changed = pc_changed;
- inf_status->stop_signal = stop_signal;
- inf_status->stop_pc = stop_pc;
- inf_status->stop_frame_address = stop_frame_address;
- inf_status->stop_step = stop_step;
- inf_status->stop_stack_dummy = stop_stack_dummy;
- inf_status->stopped_by_random_signal = stopped_by_random_signal;
- inf_status->trap_expected = trap_expected;
- inf_status->step_range_start = step_range_start;
- inf_status->step_range_end = step_range_end;
- inf_status->step_frame_address = step_frame_address;
- inf_status->step_over_calls = step_over_calls;
- inf_status->step_resume_break_address = step_resume_break_address;
- inf_status->stop_after_trap = stop_after_trap;
- inf_status->stop_soon_quietly = stop_soon_quietly;
- /* Save original bpstat chain here; replace it with copy of chain.
- If caller's caller is walking the chain, they'll be happier if we
- hand them back the original chain when restore_i_s is called. */
- inf_status->stop_bpstat = stop_bpstat;
- stop_bpstat = bpstat_copy (stop_bpstat);
- inf_status->breakpoint_proceeded = breakpoint_proceeded;
- inf_status->restore_stack_info = restore_stack_info;
- inf_status->proceed_to_finish = proceed_to_finish;
-
- bcopy (stop_registers, inf_status->stop_registers, REGISTER_BYTES);
-
- record_selected_frame (&(inf_status->selected_frame_address),
- &(inf_status->selected_level));
- return;
-}
-
-void
-restore_inferior_status (inf_status)
- struct inferior_status *inf_status;
-{
- FRAME fid;
- int level = inf_status->selected_level;
-
- pc_changed = inf_status->pc_changed;
- stop_signal = inf_status->stop_signal;
- stop_pc = inf_status->stop_pc;
- stop_frame_address = inf_status->stop_frame_address;
- stop_step = inf_status->stop_step;
- stop_stack_dummy = inf_status->stop_stack_dummy;
- stopped_by_random_signal = inf_status->stopped_by_random_signal;
- trap_expected = inf_status->trap_expected;
- step_range_start = inf_status->step_range_start;
- step_range_end = inf_status->step_range_end;
- step_frame_address = inf_status->step_frame_address;
- step_over_calls = inf_status->step_over_calls;
- step_resume_break_address = inf_status->step_resume_break_address;
- stop_after_trap = inf_status->stop_after_trap;
- stop_soon_quietly = inf_status->stop_soon_quietly;
- bpstat_clear (&stop_bpstat);
- stop_bpstat = inf_status->stop_bpstat;
- breakpoint_proceeded = inf_status->breakpoint_proceeded;
- proceed_to_finish = inf_status->proceed_to_finish;
-
- bcopy (inf_status->stop_registers, stop_registers, REGISTER_BYTES);
-
- /* The inferior can be gone if the user types "print exit(0)"
- (and perhaps other times). */
- if (target_has_stack && inf_status->restore_stack_info)
- {
- fid = find_relative_frame (get_current_frame (),
- &level);
-
- if (fid == 0 ||
- FRAME_FP (fid) != inf_status->selected_frame_address ||
- level != 0)
- {
-#if 0
- /* I'm not sure this error message is a good idea. I have
- only seen it occur after "Can't continue previously
- requested operation" (we get called from do_cleanups), in
- which case it just adds insult to injury (one confusing
- error message after another. Besides which, does the
- user really care if we can't restore the previously
- selected frame? */
- fprintf (stderr, "Unable to restore previously selected frame.\n");
-#endif
- select_frame (get_current_frame (), 0);
- return;
- }
-
- select_frame (fid, inf_status->selected_level);
- }
-}
-
-
-void
-_initialize_infrun ()
-{
- register int i;
-
- add_info ("signals", signals_info,
- "What debugger does when program gets various signals.\n\
-Specify a signal number as argument to print info on that signal only.");
-
- add_com ("handle", class_run, handle_command,
- "Specify how to handle a signal.\n\
-Args are signal number followed by flags.\n\
-Flags allowed are \"stop\", \"print\", \"pass\",\n\
- \"nostop\", \"noprint\" or \"nopass\".\n\
-Print means print a message if this signal happens.\n\
-Stop means reenter debugger if this signal happens (implies print).\n\
-Pass means let program see this signal; otherwise program doesn't know.\n\
-Pass and Stop may be combined.");
-
- for (i = 0; i < NSIG; i++)
- {
- signal_stop[i] = 1;
- signal_print[i] = 1;
- signal_program[i] = 1;
- }
-
- /* Signals caused by debugger's own actions
- should not be given to the program afterwards. */
- signal_program[SIGTRAP] = 0;
- signal_program[SIGINT] = 0;
-
- /* Signals that are not errors should not normally enter the debugger. */
-#ifdef SIGALRM
- signal_stop[SIGALRM] = 0;
- signal_print[SIGALRM] = 0;
-#endif /* SIGALRM */
-#ifdef SIGVTALRM
- signal_stop[SIGVTALRM] = 0;
- signal_print[SIGVTALRM] = 0;
-#endif /* SIGVTALRM */
-#ifdef SIGPROF
- signal_stop[SIGPROF] = 0;
- signal_print[SIGPROF] = 0;
-#endif /* SIGPROF */
-#ifdef SIGCHLD
- signal_stop[SIGCHLD] = 0;
- signal_print[SIGCHLD] = 0;
-#endif /* SIGCHLD */
-#ifdef SIGCLD
- signal_stop[SIGCLD] = 0;
- signal_print[SIGCLD] = 0;
-#endif /* SIGCLD */
-#ifdef SIGIO
- signal_stop[SIGIO] = 0;
- signal_print[SIGIO] = 0;
-#endif /* SIGIO */
-#ifdef SIGURG
- signal_stop[SIGURG] = 0;
- signal_print[SIGURG] = 0;
-#endif /* SIGURG */
-}
-
diff --git a/gdb/inftarg.c b/gdb/inftarg.c
deleted file mode 100644
index 9e3f729..0000000
--- a/gdb/inftarg.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/* Subroutines for handling an "inferior" (child) process as a target
- for debugging, in GDB.
- Copyright 1990, 1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h" /* required by inferior.h */
-#include "inferior.h"
-#include "target.h"
-#include "wait.h"
-#include "gdbcore.h"
-#include "ieee-float.h" /* Required by REGISTER_CONVERT_TO_XXX */
-
-extern int fetch_inferior_registers();
-extern int store_inferior_registers();
-extern int child_xfer_memory();
-extern int memory_insert_breakpoint(), memory_remove_breakpoint();
-extern void terminal_init_inferior(), terminal_ours(), terminal_inferior();
-extern void terminal_ours_for_output(), child_terminal_info();
-extern void kill_inferior(), add_syms_addr_command();
-extern struct value *call_function_by_hand();
-extern void child_resume();
-extern void child_create_inferior();
-extern void child_mourn_inferior();
-extern void child_attach ();
-
-/* Forward declaration */
-extern struct target_ops child_ops;
-
-/* Wait for child to do something. Return pid of child, or -1 in case
- of error; store status through argument pointer STATUS. */
-
-int
-child_wait (status)
- int *status;
-{
- int pid;
-
- do {
- pid = wait (status);
- if (pid == -1) /* No more children to wait for */
- {
- fprintf (stderr, "Child process unexpectedly missing.\n");
- *status = 42; /* Claim it exited with signal 42 */
- return -1;
- }
- } while (pid != inferior_pid); /* Some other child died or stopped */
- return pid;
-}
-
-
-/*
- * child_detach()
- * takes a program previously attached to and detaches it.
- * The program resumes execution and will no longer stop
- * on signals, etc. We better not have left any breakpoints
- * in the program or it'll die when it hits one. For this
- * to work, it may be necessary for the process to have been
- * previously attached. It *might* work if the program was
- * started via the normal ptrace (PTRACE_TRACEME).
- */
-
-static void
-child_detach (args, from_tty)
- char *args;
- int from_tty;
-{
- int siggnal = 0;
-
-#ifdef ATTACH_DETACH
- if (from_tty)
- {
- char *exec_file = get_exec_file (0);
- if (exec_file == 0)
- exec_file = "";
- printf ("Detaching program: %s pid %d\n",
- exec_file, inferior_pid);
- fflush (stdout);
- }
- if (args)
- siggnal = atoi (args);
-
- detach (siggnal);
- inferior_pid = 0;
- unpush_target (&child_ops); /* Pop out of handling an inferior */
-#else
- error ("This version of Unix does not support detaching a process.");
-#endif
-}
-
-/* Get ready to modify the registers array. On machines which store
- individual registers, this doesn't need to do anything. On machines
- which store all the registers in one fell swoop, this makes sure
- that registers contains all the registers from the program being
- debugged. */
-
-void
-child_prepare_to_store ()
-{
-#ifdef CHILD_PREPARE_TO_STORE
- CHILD_PREPARE_TO_STORE ();
-#endif
-}
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-/* Some machines won't need to use regnum. */
-/* ARGSUSED */
-void
-host_convert_to_virtual (regnum, from, to)
- int regnum;
- char *from;
- char *to;
-{
- REGISTER_CONVERT_TO_VIRTUAL (regnum, from, to);
-}
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-/* ARGSUSED */
-void
-host_convert_from_virtual (regnum, from, to)
- int regnum;
- char *from;
- char *to;
-{
- REGISTER_CONVERT_TO_RAW (regnum, from, to);
-}
-
-/* Print status information about what we're accessing. */
-
-static void
-child_files_info ()
-{
- printf ("\tUsing the running image of %s process %d.\n",
- attach_flag? "attached": "child", inferior_pid);
-}
-
-/* ARGSUSED */
-static void
-child_open (arg, from_tty)
- char *arg;
- int from_tty;
-{
- error ("Use the \"run\" command to start a Unix child process.");
-}
-
-struct target_ops child_ops = {
- "child", "Unix child process",
- "Unix child process (started by the \"run\" command).",
- child_open, 0, /* open, close */
- child_attach, child_detach,
- child_resume,
- child_wait,
- fetch_inferior_registers, store_inferior_registers,
- child_prepare_to_store,
- host_convert_to_virtual, host_convert_from_virtual,
- child_xfer_memory, child_files_info,
- memory_insert_breakpoint, memory_remove_breakpoint,
- terminal_init_inferior, terminal_inferior,
- terminal_ours_for_output, terminal_ours, child_terminal_info,
- kill_inferior, 0, add_syms_addr_command, /* load */
- call_function_by_hand,
- 0, /* lookup_symbol */
- child_create_inferior, child_mourn_inferior,
- process_stratum, 0, /* next */
- 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
- OPS_MAGIC, /* Always the last thing */
-};
-
-void
-_initialize_inftarg ()
-{
- add_target (&child_ops);
-}
diff --git a/gdb/kdb-start.c b/gdb/kdb-start.c
deleted file mode 100644
index 50e2fa9..0000000
--- a/gdb/kdb-start.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Main loop for the standalone kernel debugger.
- Copyright (C) 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "param.h"
-
-static char *args[] = {"kdb", "kdb-symbols", 0};
-
-static char *environment[] = {0};
-
-char **environ;
-
-start ()
-{
-#ifdef NAMES_HAVE_UNDERSCORE
- INIT_STACK (_kdb_stack_beg, _kdb_stack_end);
-#else /* not NAMES_HAVE_UNDERSCORE */
- INIT_STACK (kdb_stack_beg, kdb_stack_end);
-#endif /* not NAMES_HAVE_UNDERSCORE */
-
- environ = environment;
-
- main (2, args, environment);
-}
diff --git a/gdb/language.c b/gdb/language.c
deleted file mode 100644
index c584d4e..0000000
--- a/gdb/language.c
+++ /dev/null
@@ -1,1106 +0,0 @@
-/* Multiple source language support for GDB.
- Copyright 1991 Free Software Foundation, Inc.
- Contributed by the Department of Computer Science at the State University
- of New York at Buffalo.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This file contains functions that return things that are specific
- to languages. Each function should examine current_language if necessary,
- and return the appropriate result. */
-
-/* FIXME: Most of these would be better organized as macros which
- return data out of a "language-specific" struct pointer that is set
- whenever the working language changes. That would be a lot faster. */
-
-#include <stdio.h>
-#include <string.h>
-#include <varargs.h>
-
-#include "defs.h"
-#include "symtab.h"
-#include "value.h"
-#include "gdbcmd.h"
-#include "frame.h"
-#include "language.h"
-#include "expression.h"
-#include "target.h"
-#include "parser-defs.h"
-
-extern volatile void return_to_top_level ();
-
-/* Forward function declarations */
-static void set_type_range ();
-
-/* Forward declaration */
-extern struct language_defn unknown_language_defn;
-
-/* The current (default at startup) state of type and range checking.
- (If the modes are set to "auto", though, these are changed based
- on the default language at startup, and then again based on the
- language of the first source file. */
-
-enum range_mode range_mode = range_mode_auto;
-enum range_check range_check = range_check_off;
-enum type_mode type_mode = type_mode_auto;
-enum type_check type_check = type_check_off;
-
-/* The current language and language_mode (see language.h) */
-
-struct language_defn *current_language = &unknown_language_defn;
-enum language_mode language_mode = language_mode_auto;
-
-/* The list of supported languages. The list itself is malloc'd. */
-
-static struct language_defn **languages;
-static unsigned languages_size;
-static unsigned languages_allocsize;
-#define DEFAULT_ALLOCSIZE 3
-
-/* The "set language/type/range" commands all put stuff in these
- buffers. This is to make them work as set/show commands. The
- user's string is copied here, then the set_* commands look at
- them and update them to something that looks nice when it is
- printed out. */
-
-static char *language;
-static char *type;
-static char *range;
-
-/* Warning issued when current_language and the language of the current
- frame do not match. */
-char lang_frame_mismatch_warn[] =
- "Warning: the current language does not match this frame.";
-
-void set_lang_str();
-void set_type_str();
-void set_range_str();
-
-/* This page contains the functions corresponding to GDB commands
- and their helpers. */
-
-/* Show command. Display a warning if the language set
- does not match the frame. */
-void
-show_language_command (ignore, from_tty)
- char *ignore;
- int from_tty;
-{
- enum language flang; /* The language of the current frame */
-
- flang = get_frame_language();
- if (flang != language_unknown &&
- language_mode == language_mode_manual &&
- current_language->la_language != flang)
- printf_filtered("%s\n",lang_frame_mismatch_warn);
-}
-
-/* Set command. Change the current working language. */
-void
-set_language_command (ignore, from_tty)
- char *ignore;
- int from_tty;
-{
- int i;
- enum language flang;
- char *err_lang;
-
- /* FIXME -- do this from the list, with HELP. */
- if (!language || !language[0]) {
- printf("The currently understood settings are:\n\n\
-local or auto Automatic setting based on source file\n\
-c Use the C language\n\
-c++ Use the C++ language\n\
-modula-2 Use the Modula-2 language\n");
- /* Restore the silly string. */
- set_language(current_language->la_language);
- return;
- }
-
- /* Search the list of languages for a match. */
- for (i = 0; i < languages_size; i++) {
- if (!strcmp (languages[i]->la_name, language)) {
- /* Found it! Go into manual mode, and use this language. */
- if (languages[i]->la_language == language_auto) {
- /* Enter auto mode. Set to the current frame's language, if known. */
- language_mode = language_mode_auto;
- flang = get_frame_language();
- if (flang!=language_unknown)
- set_language(flang);
- return;
- } else {
- /* Enter manual mode. Set the specified language. */
- language_mode = language_mode_manual;
- current_language = languages[i];
- set_type_range ();
- set_lang_str();
- return;
- }
- }
- }
-
- /* Reset the language (esp. the global string "language") to the
- correct values. */
- err_lang=savestring(language,strlen(language));
- make_cleanup (free, err_lang); /* Free it after error */
- set_language(current_language->la_language);
- error ("Unknown language `%s'.",err_lang);
-}
-
-/* Show command. Display a warning if the type setting does
- not match the current language. */
-void
-show_type_command(ignore, from_tty)
- char *ignore;
- int from_tty;
-{
- if (type_check != current_language->la_type_check)
- printf(
-"Warning: the current type check setting does not match the language.\n");
-}
-
-/* Set command. Change the setting for type checking. */
-void
-set_type_command(ignore, from_tty)
- char *ignore;
- int from_tty;
-{
- if (!strcmp(type,"on"))
- {
- type_check = type_check_on;
- type_mode = type_mode_manual;
- }
- else if (!strcmp(type,"warn"))
- {
- type_check = type_check_warn;
- type_mode = type_mode_manual;
- }
- else if (!strcmp(type,"off"))
- {
- type_check = type_check_off;
- type_mode = type_mode_manual;
- }
- else if (!strcmp(type,"auto"))
- {
- type_mode = type_mode_auto;
- set_type_range();
- /* Avoid hitting the set_type_str call below. We
- did it in set_type_range. */
- return;
- }
- set_type_str();
- show_type_command((char *)NULL, from_tty);
-}
-
-/* Show command. Display a warning if the range setting does
- not match the current language. */
-void
-show_range_command(ignore, from_tty)
- char *ignore;
- int from_tty;
-{
-
- if (range_check != current_language->la_range_check)
- printf(
-"Warning: the current range check setting does not match the language.\n");
-}
-
-/* Set command. Change the setting for range checking. */
-void
-set_range_command(ignore, from_tty)
- char *ignore;
- int from_tty;
-{
- if (!strcmp(range,"on"))
- {
- range_check = range_check_on;
- range_mode = range_mode_manual;
- }
- else if (!strcmp(range,"warn"))
- {
- range_check = range_check_warn;
- range_mode = range_mode_manual;
- }
- else if (!strcmp(range,"off"))
- {
- range_check = range_check_off;
- range_mode = range_mode_manual;
- }
- else if (!strcmp(range,"auto"))
- {
- range_mode = range_mode_auto;
- set_type_range();
- /* Avoid hitting the set_range_str call below. We
- did it in set_type_range. */
- return;
- }
- set_range_str();
- show_range_command((char *)0, from_tty);
-}
-
-/* Set the status of range and type checking based on
- the current modes and the current language.
- If SHOW is non-zero, then print out the current language,
- type and range checking status. */
-static void
-set_type_range()
-{
-
- if (range_mode == range_mode_auto)
- range_check = current_language->la_range_check;
-
- if (type_mode == type_mode_auto)
- type_check = current_language->la_type_check;
-
- set_type_str();
- set_range_str();
-}
-
-/* Set current language to (enum language) LANG. */
-
-void
-set_language(lang)
- enum language lang;
-{
- int i;
-
- for (i = 0; i < languages_size; i++) {
- if (languages[i]->la_language == lang) {
- current_language = languages[i];
- set_type_range ();
- set_lang_str();
- break;
- }
- }
-}
-
-/* This page contains functions that update the global vars
- language, type and range. */
-void
-set_lang_str()
-{
- char *prefix = "";
-
- free (language);
- if (language_mode == language_mode_auto)
- prefix = "auto; currently ";
-
- language = concat(prefix, current_language->la_name, NULL);
-}
-
-void
-set_type_str()
-{
- char *tmp, *prefix = "";
-
- free (type);
- if (type_mode==type_mode_auto)
- prefix = "auto; currently ";
-
- switch(type_check)
- {
- case type_check_on:
- tmp = "on";
- break;
- case type_check_off:
- tmp = "off";
- break;
- case type_check_warn:
- tmp = "warn";
- break;
- default:
- error ("Unrecognized type check setting.");
- }
-
- type = concat(prefix,tmp,NULL);
-}
-
-void
-set_range_str()
-{
- char *tmp, *pref = "";
-
- free (range);
- if (range_mode==range_mode_auto)
- pref = "auto; currently ";
-
- switch(range_check)
- {
- case range_check_on:
- tmp = "on";
- break;
- case range_check_off:
- tmp = "off";
- break;
- case range_check_warn:
- tmp = "warn";
- break;
- default:
- error ("Unrecognized range check setting.");
- }
-
- range = concat(pref,tmp,NULL);
-}
-
-
-/* Print out the current language settings: language, range and
- type checking. */
-void
-language_info ()
-{
- printf("Current Language: %s\n",language);
- show_language_command((char *)0, 1);
- printf("Type checking: %s\n",type);
- show_type_command((char *)0, 1);
- printf("Range checking: %s\n",range);
- show_range_command((char *)0, 1);
-}
-
-/* Return the result of a binary operation. */
-struct type *
-binop_result_type(v1,v2)
- value v1,v2;
-{
- int l1,l2,size,uns;
-
- l1 = TYPE_LENGTH(VALUE_TYPE(v1));
- l2 = TYPE_LENGTH(VALUE_TYPE(v2));
-
- switch(current_language->la_language)
- {
- case language_c:
- case language_cplus:
- if (TYPE_CODE(VALUE_TYPE(v1))==TYPE_CODE_FLT)
- return TYPE_CODE(VALUE_TYPE(v2)) == TYPE_CODE_FLT && l2 > l1 ?
- VALUE_TYPE(v2) : VALUE_TYPE(v1);
- else if (TYPE_CODE(VALUE_TYPE(v2))==TYPE_CODE_FLT)
- return TYPE_CODE(VALUE_TYPE(v1)) == TYPE_CODE_FLT && l1 > l2 ?
- VALUE_TYPE(v1) : VALUE_TYPE(v2);
- else if (TYPE_UNSIGNED(VALUE_TYPE(v1)) && l1 > l2)
- return VALUE_TYPE(v1);
- else if (TYPE_UNSIGNED(VALUE_TYPE(v2)) && l2 > l1)
- return VALUE_TYPE(v2);
- else /* Both are signed. Result is the longer type */
- return l1 > l2 ? VALUE_TYPE(v1) : VALUE_TYPE(v2);
- break;
- case language_m2:
- /* If we are doing type-checking, l1 should equal l2, so this is
- not needed. */
- return l1 > l2 ? VALUE_TYPE(v1) : VALUE_TYPE(v2);
- break;
- }
- abort();
- return (struct type *)0; /* For lint */
-}
-
-/* This page contains functions that return format strings for
- printf for printing out numbers in different formats */
-
-/* Returns the appropriate printf format for hexadecimal
- numbers. */
-char *
-local_hex_format_custom(pre)
- char *pre;
-{
- static char form[50];
-
- strcpy (form, current_language->la_hex_format_pre);
- strcat (form, pre);
- strcat (form, current_language->la_hex_format_suf);
- return form;
-}
-
-/* Converts a number to hexadecimal and stores it in a static
- string. Returns a pointer to this string. */
-char *
-local_hex_string (num)
- int num;
-{
- static char res[50];
-
- sprintf (res, current_language->la_hex_format, num);
- return res;
-}
-
-/* Converts a number to custom hexadecimal and stores it in a static
- string. Returns a pointer to this string. */
-char *
-local_hex_string_custom(num,pre)
- int num;
- char *pre;
-{
- static char res[50];
-
- sprintf (res, local_hex_format_custom(pre), num);
- return res;
-}
-
-/* Returns the appropriate printf format for octal
- numbers. */
-char *
-local_octal_format_custom(pre)
- char *pre;
-{
- static char form[50];
-
- strcpy (form, current_language->la_octal_format_pre);
- strcat (form, pre);
- strcat (form, current_language->la_octal_format_suf);
- return form;
-}
-
-/* This page contains functions that are used in type/range checking.
- They all return zero if the type/range check fails.
-
- It is hoped that these will make extending GDB to parse different
- languages a little easier. These are primarily used in eval.c when
- evaluating expressions and making sure that their types are correct.
- Instead of having a mess of conjucted/disjuncted expressions in an "if",
- the ideas of type can be wrapped up in the following functions.
-
- Note that some of them are not currently dependent upon which language
- is currently being parsed. For example, floats are the same in
- C and Modula-2 (ie. the only floating point type has TYPE_CODE of
- TYPE_CODE_FLT), while booleans are different. */
-
-/* Returns non-zero if its argument is a simple type. This is the same for
- both Modula-2 and for C. In the C case, TYPE_CODE_CHAR will never occur,
- and thus will never cause the failure of the test. */
-int
-simple_type(type)
- struct type *type;
-{
- switch (TYPE_CODE (type)) {
- case TYPE_CODE_INT:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_FLT:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_BOOL:
- return 1;
-
- default:
- return 0;
- }
-}
-
-/* Returns non-zero if its argument is of an ordered type. */
-int
-ordered_type (type)
- struct type *type;
-{
- switch (TYPE_CODE (type)) {
- case TYPE_CODE_INT:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_FLT:
- case TYPE_CODE_RANGE:
- return 1;
-
- default:
- return 0;
- }
-}
-
-/* Returns non-zero if the two types are the same */
-int
-same_type (arg1, arg2)
- struct type *arg1, *arg2;
-{
- if (structured_type(arg1) ? !structured_type(arg2) : structured_type(arg2))
- /* One is structured and one isn't */
- return 0;
- else if (structured_type(arg1) && structured_type(arg2))
- return arg1 == arg2;
- else if (numeric_type(arg1) && numeric_type(arg2))
- return (TYPE_CODE(arg2) == TYPE_CODE(arg1)) &&
- (TYPE_UNSIGNED(arg1) == TYPE_UNSIGNED(arg2))
- ? 1 : 0;
- else
- return arg1==arg2;
-}
-
-/* Returns non-zero if the type is integral */
-int
-integral_type (type)
- struct type *type;
-{
- switch(current_language->la_language)
- {
- case language_c:
- case language_cplus:
- return (TYPE_CODE(type) != TYPE_CODE_INT) &&
- (TYPE_CODE(type) != TYPE_CODE_ENUM) ? 0 : 1;
- case language_m2:
- return TYPE_CODE(type) != TYPE_CODE_INT ? 0 : 1;
- default:
- error ("Language not supported.");
- }
-}
-
-/* Returns non-zero if the value is numeric */
-int
-numeric_type (type)
- struct type *type;
-{
- switch (TYPE_CODE (type)) {
- case TYPE_CODE_INT:
- case TYPE_CODE_FLT:
- return 1;
-
- default:
- return 0;
- }
-}
-
-/* Returns non-zero if the value is a character type */
-int
-character_type (type)
- struct type *type;
-{
- switch(current_language->la_language)
- {
- case language_m2:
- return TYPE_CODE(type) != TYPE_CODE_CHAR ? 0 : 1;
-
- case language_c:
- case language_cplus:
- return (TYPE_CODE(type) == TYPE_CODE_INT) &&
- TYPE_LENGTH(type) == sizeof(char)
- ? 1 : 0;
- }
-}
-
-/* Returns non-zero if the value is a boolean type */
-int
-boolean_type (type)
- struct type *type;
-{
- switch(current_language->la_language)
- {
- case language_m2:
- return TYPE_CODE(type) != TYPE_CODE_BOOL ? 0 : 1;
-
- case language_c:
- case language_cplus:
- return TYPE_CODE(type) != TYPE_CODE_INT ? 0 : 1;
- }
-}
-
-/* Returns non-zero if the value is a floating-point type */
-int
-float_type (type)
- struct type *type;
-{
- return TYPE_CODE(type) == TYPE_CODE_FLT;
-}
-
-/* Returns non-zero if the value is a pointer type */
-int
-pointer_type(type)
- struct type *type;
-{
- return TYPE_CODE(type) == TYPE_CODE_PTR ||
- TYPE_CODE(type) == TYPE_CODE_REF;
-}
-
-/* Returns non-zero if the value is a structured type */
-int
-structured_type(type)
- struct type *type;
-{
- switch(current_language->la_language)
- {
- case language_c:
- case language_cplus:
- return (TYPE_CODE(type) == TYPE_CODE_STRUCT) ||
- (TYPE_CODE(type) == TYPE_CODE_UNION) ||
- (TYPE_CODE(type) == TYPE_CODE_ARRAY);
- case language_m2:
- return (TYPE_CODE(type) == TYPE_CODE_STRUCT) ||
- (TYPE_CODE(type) == TYPE_CODE_SET) ||
- (TYPE_CODE(type) == TYPE_CODE_ARRAY);
- }
-}
-
-/* This page contains functions that return info about
- (struct value) values used in GDB. */
-
-/* Returns non-zero if the value VAL represents a true value. */
-int
-value_true(val)
- value val;
-{
- int len, i;
- struct type *type;
- LONGEST v;
-
- switch (current_language->la_language) {
-
- case language_c:
- case language_cplus:
- return !value_zerop (val);
-
- case language_m2:
- type = VALUE_TYPE(val);
- if (TYPE_CODE (type) != TYPE_CODE_BOOL)
- return 0; /* Not a BOOLEAN at all */
- /* Search the fields for one that matches the current value. */
- len = TYPE_NFIELDS (type);
- v = value_as_long (val);
- for (i = 0; i < len; i++)
- {
- QUIT;
- if (v == TYPE_FIELD_BITPOS (type, i))
- break;
- }
- if (i >= len)
- return 0; /* Not a valid BOOLEAN value */
- if (!strcmp ("TRUE", TYPE_FIELD_NAME(VALUE_TYPE(val), i)))
- return 1; /* BOOLEAN with value TRUE */
- else
- return 0; /* BOOLEAN with value FALSE */
- break;
-
- default:
- error ("Language not supported.");
- }
-}
-
-/* Returns non-zero if the operator OP is defined on
- the values ARG1 and ARG2. */
-void
-binop_type_check(arg1,arg2,op)
- value arg1,arg2;
- int op;
-{
- struct type *t1, *t2;
-
- /* If we're not checking types, always return success. */
- if (!STRICT_TYPE)
- return;
-
- t1=VALUE_TYPE(arg1);
- if (arg2!=(value)NULL)
- t2=VALUE_TYPE(arg2);
- else
- t2=NULL;
-
- switch(op)
- {
- case BINOP_ADD:
- case BINOP_SUB:
- if ((numeric_type(t1) && pointer_type(t2)) ||
- (pointer_type(t1) && numeric_type(t2)))
- {
- printf("warning: combining pointer and integer.\n");
- break;
- }
- case BINOP_MUL:
- case BINOP_LSH:
- case BINOP_RSH:
- if (!numeric_type(t1) || !numeric_type(t2))
- type_op_error ("Arguments to %s must be numbers.",op);
- else if (!same_type(t1,t2))
- type_op_error ("Arguments to %s must be of the same type.",op);
- break;
-
- case BINOP_AND:
- case BINOP_OR:
- if (!boolean_type(t1) || !boolean_type(t2))
- type_op_error ("Arguments to %s must be of boolean type.",op);
- break;
-
- case BINOP_EQUAL:
- if ((pointer_type(t1) && !(pointer_type(t2) || integral_type(t2))) ||
- (pointer_type(t2) && !(pointer_type(t1) || integral_type(t1))))
- type_op_error ("A pointer can only be compared to an integer or pointer.",op);
- else if ((pointer_type(t1) && integral_type(t2)) ||
- (integral_type(t1) && pointer_type(t2)))
- {
- printf("warning: combining integer and pointer.\n");
- break;
- }
- else if (!simple_type(t1) || !simple_type(t2))
- type_op_error ("Arguments to %s must be of simple type.",op);
- else if (!same_type(t1,t2))
- type_op_error ("Arguments to %s must be of the same type.",op);
- break;
-
- case BINOP_REM:
- if (!integral_type(t1) || !integral_type(t2))
- type_op_error ("Arguments to %s must be of integral type.",op);
- break;
-
- case BINOP_LESS:
- case BINOP_GTR:
- case BINOP_LEQ:
- case BINOP_GEQ:
- if (!ordered_type(t1) || !ordered_type(t2))
- type_op_error ("Arguments to %s must be of ordered type.",op);
- else if (!same_type(t1,t2))
- type_op_error ("Arguments to %s must be of the same type.",op);
- break;
-
- case BINOP_ASSIGN:
- if (pointer_type(t1) && !integral_type(t2))
- type_op_error ("A pointer can only be assigned an integer.",op);
- else if (pointer_type(t1) && integral_type(t2))
- {
- printf("warning: combining integer and pointer.");
- break;
- }
- else if (!simple_type(t1) || !simple_type(t2))
- type_op_error ("Arguments to %s must be of simple type.",op);
- else if (!same_type(t1,t2))
- type_op_error ("Arguments to %s must be of the same type.",op);
- break;
-
- /* Unary checks -- arg2 is null */
-
- case UNOP_ZEROP:
- if (!boolean_type(t1))
- type_op_error ("Argument to %s must be of boolean type.",op);
- break;
-
- case UNOP_PLUS:
- case UNOP_NEG:
- if (!numeric_type(t1))
- type_op_error ("Argument to %s must be of numeric type.",op);
- break;
-
- case UNOP_IND:
- if (integral_type(t1))
- {
- printf("warning: combining pointer and integer.\n");
- break;
- }
- else if (!pointer_type(t1))
- type_op_error ("Argument to %s must be a pointer.",op);
- break;
-
- case UNOP_PREINCREMENT:
- case UNOP_POSTINCREMENT:
- case UNOP_PREDECREMENT:
- case UNOP_POSTDECREMENT:
- if (!ordered_type(t1))
- type_op_error ("Argument to %s must be of an ordered type.",op);
- break;
-
- default:
- /* Ok. The following operators have different meanings in
- different languages. */
- switch(current_language->la_language)
- {
-#ifdef _LANG_c
- case language_c:
- case language_cplus:
- switch(op)
- {
- case BINOP_DIV:
- if (!numeric_type(t1) || !numeric_type(t2))
- type_op_error ("Arguments to %s must be numbers.",op);
- break;
- }
- break;
-#endif
-
-#ifdef _LANG_m2
- case language_m2:
- switch(op)
- {
- case BINOP_DIV:
- if (!float_type(t1) || !float_type(t2))
- type_op_error ("Arguments to %s must be floating point numbers.",op);
- break;
- case BINOP_INTDIV:
- if (!integral_type(t1) || !integral_type(t2))
- type_op_error ("Arguments to %s must be of integral type.",op);
- break;
- }
-#endif
- }
- }
-}
-
-/* This page contains functions for the printing out of
- error messages that occur during type- and range-
- checking. */
-
-/* Prints the format string FMT with the operator as a string
- corresponding to the opcode OP. If FATAL is non-zero, then
- this is an error and error () is called. Otherwise, it is
- a warning and printf() is called. */
-void
-op_error (fmt,op,fatal)
- char *fmt;
- enum exp_opcode op;
- int fatal;
-{
- if (fatal)
- error (fmt,op_string(op));
- else
- {
- printf("warning: ");
- printf(fmt,op_string(op));
- printf("\n");
- }
-}
-
-/* These are called when a language fails a type- or range-check.
- The first argument should be a printf()-style format string, and
- the rest of the arguments should be its arguments. If
- [type|range]_check is [type|range]_check_on, then return_to_top_level()
- is called in the style of error (). Otherwise, the message is prefixed
- by "warning: " and we do not return to the top level. */
-void
-type_error (va_alist)
- va_dcl
-{
- va_list args;
- char *string;
-
- if (type_check==type_check_warn)
- fprintf(stderr,"warning: ");
- else
- target_terminal_ours();
-
- va_start (args);
- string = va_arg (args, char *);
- vfprintf (stderr, string, args);
- fprintf (stderr, "\n");
- va_end (args);
- if (type_check==type_check_on)
- return_to_top_level();
-}
-
-void
-range_error (va_alist)
- va_dcl
-{
- va_list args;
- char *string;
-
- if (range_check==range_check_warn)
- fprintf(stderr,"warning: ");
- else
- target_terminal_ours();
-
- va_start (args);
- string = va_arg (args, char *);
- vfprintf (stderr, string, args);
- fprintf (stderr, "\n");
- va_end (args);
- if (range_check==range_check_on)
- return_to_top_level();
-}
-
-
-/* This page contains miscellaneous functions */
-
-/* Return the language as a string */
-char *
-language_str(lang)
- enum language lang;
-{
- int i;
-
- for (i = 0; i < languages_size; i++) {
- if (languages[i]->la_language == lang) {
- return languages[i]->la_name;
- }
- }
- return "Unknown";
-}
-
-struct cmd_list_element *setchecklist = NULL;
-struct cmd_list_element *showchecklist = NULL;
-
-static void
-set_check (ignore, from_tty)
- char *ignore;
- int from_tty;
-{
- printf(
-"\"set check\" must be followed by the name of a check subcommand.\n");
- help_list(setchecklist, "set check ", -1, stdout);
-}
-
-static void
-show_check (arg, from_tty)
- char *arg;
- int from_tty;
-{
- cmd_show_list(showchecklist, from_tty, "");
-}
-
-/* Add a language to the set of known languages. */
-
-void
-add_language (lang)
- struct language_defn *lang;
-{
- if (lang->la_magic != LANG_MAGIC)
- {
- fprintf(stderr, "Magic number of %s language struct wrong\n",
- lang->la_name);
- abort();
- }
-
- if (!languages)
- {
- languages_allocsize = DEFAULT_ALLOCSIZE;
- languages = (struct language_defn **) xmalloc
- (languages_allocsize * sizeof (*languages));
- }
- if (languages_size >= languages_allocsize)
- {
- languages_allocsize *= 2;
- languages = (struct language_defn **) xrealloc (languages,
- languages_allocsize * sizeof (*languages));
- }
- languages[languages_size++] = lang;
-}
-
-/* Define the language that is no language. */
-
-int
-unk_lang_parser ()
-{
- return 1;
-}
-
-void
-unk_lang_error ()
-{
- error ("Attempted to parse an expression with unknown language");
-}
-
-static struct type ** const (unknown_builtin_types[]) = { 0 };
-static const struct op_print unk_op_print_tab[] = { 0 };
-
-const struct language_defn unknown_language_defn = {
- "unknown",
- language_unknown,
- &unknown_builtin_types[0],
- range_check_off,
- type_check_off,
- unk_lang_parser,
- unk_lang_error,
- &builtin_type_error, /* longest signed integral type */
- &builtin_type_error, /* longest unsigned integral type */
- &builtin_type_error, /* longest floating point type */
- "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
- "0%o", "0%", "o", /* Octal format, prefix, suffix */
- unk_op_print_tab, /* expression operators for printing */
- LANG_MAGIC
-};
-
-/* These two structs define fake entries for the "local" and "auto" options. */
-const struct language_defn auto_language_defn = {
- "auto",
- language_auto,
- &unknown_builtin_types[0],
- range_check_off,
- type_check_off,
- unk_lang_parser,
- unk_lang_error,
- &builtin_type_error, /* longest signed integral type */
- &builtin_type_error, /* longest unsigned integral type */
- &builtin_type_error, /* longest floating point type */
- "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
- "0%o", "0%", "o", /* Octal format, prefix, suffix */
- unk_op_print_tab, /* expression operators for printing */
- LANG_MAGIC
-};
-
-const struct language_defn local_language_defn = {
- "local",
- language_auto,
- &unknown_builtin_types[0],
- range_check_off,
- type_check_off,
- unk_lang_parser,
- unk_lang_error,
- &builtin_type_error, /* longest signed integral type */
- &builtin_type_error, /* longest unsigned integral type */
- &builtin_type_error, /* longest floating point type */
- "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
- "0%o", "0%", "o", /* Octal format, prefix, suffix */
- unk_op_print_tab, /* expression operators for printing */
- LANG_MAGIC
-};
-
-/* Initialize the language routines */
-
-void
-_initialize_language()
-{
- struct cmd_list_element *set, *show;
-
- /* GDB commands for language specific stuff */
-
- set = add_set_cmd ("language", class_support, var_string_noescape,
- (char *)&language,
- "Set the current source language.",
- &setlist);
- show = add_show_from_set (set, &showlist);
- set->function = set_language_command;
- show->function = show_language_command;
-
- add_prefix_cmd ("check", no_class, set_check,
- "Set the status of the type/range checker",
- &setchecklist, "set check ", 0, &setlist);
- add_alias_cmd ("c", "check", no_class, 1, &setlist);
- add_alias_cmd ("ch", "check", no_class, 1, &setlist);
-
- add_prefix_cmd ("check", no_class, show_check,
- "Show the status of the type/range checker",
- &showchecklist, "show check ", 0, &showlist);
- add_alias_cmd ("c", "check", no_class, 1, &showlist);
- add_alias_cmd ("ch", "check", no_class, 1, &showlist);
-
- set = add_set_cmd ("type", class_support, var_string_noescape,
- (char *)&type,
- "Set type checking. (on/warn/off/auto)",
- &setchecklist);
- show = add_show_from_set (set, &showchecklist);
- set->function = set_type_command;
- show->function = show_type_command;
-
- set = add_set_cmd ("range", class_support, var_string_noescape,
- (char *)&range,
- "Set range checking. (on/warn/off/auto)",
- &setchecklist);
- show = add_show_from_set (set, &showchecklist);
- set->function = set_range_command;
- show->function = show_range_command;
-
- add_language (&unknown_language_defn);
- add_language (&local_language_defn);
- add_language (&auto_language_defn);
-
- language = savestring ("auto",strlen("auto"));
- range = savestring ("auto",strlen("auto"));
- type = savestring ("auto",strlen("auto"));
-
- /* Have the above take effect */
-
- set_language_command (language, 0);
- set_type_command (NULL, 0);
- set_range_command (NULL, 0);
-}
diff --git a/gdb/language.h b/gdb/language.h
deleted file mode 100644
index d09d4d3..0000000
--- a/gdb/language.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/* Source-language-related definitions for GDB.
- Copyright 1991 Free Software Foundation, Inc.
- Contributed by the Department of Computer Science at the State University
- of New York at Buffalo.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This used to be included to configure GDB for one or more specific
- languages. Now it is shortcutted to configure for all of them. FIXME. */
-/* #include "lang_def.h" */
-#define _LANG_c
-#define _LANG_m2
-
-/* range_mode ==
- range_mode_auto: range_check set automatically to default of language.
- range_mode_manual: range_check set manually by user. */
-
-extern enum range_mode {range_mode_auto, range_mode_manual} range_mode;
-
-/* range_check ==
- range_check_on: Ranges are checked in GDB expressions, producing errors.
- range_check_warn: Ranges are checked, producing warnings.
- range_check_off: Ranges are not checked in GDB expressions. */
-
-extern enum range_check
- {range_check_off, range_check_warn, range_check_on} range_check;
-
-/* type_mode ==
- type_mode_auto: type_check set automatically to default of language
- type_mode_manual: type_check set manually by user. */
-
-extern enum type_mode {type_mode_auto, type_mode_manual} type_mode;
-
-/* type_check ==
- type_check_on: Types are checked in GDB expressions, producing errors.
- type_check_warn: Types are checked, producing warnings.
- type_check_off: Types are not checked in GDB expressions. */
-
-extern enum type_check
- {type_check_off, type_check_warn, type_check_on} type_check;
-
-/* Structure tying together assorted information about a language. */
-
-struct language_defn {
- char * la_name; /* Name of the language */
- enum language la_language; /* its symtab language-enum (defs.h) */
- struct type ** const
- *la_builtin_type_vector; /* Its builtin types */
- enum range_check la_range_check; /* Default range checking */
- enum type_check la_type_check; /* Default type checking */
- int (*la_parser)(); /* Parser function */
- void (*la_error)(); /* Parser error function */
- struct type **la_longest_int; /* Longest signed integral type */
- struct type **la_longest_unsigned_int; /* Longest uns integral type */
- struct type **la_longest_float; /* Longest floating point type */
- char *la_hex_format; /* Hexadecimal printf format str */
- char *la_hex_format_pre; /* Prefix for custom format string */
- char *la_hex_format_suf; /* Suffix for custom format string */
- char *la_octal_format; /* Octal printf format str */
- char *la_octal_format_pre; /* Prefix for custom format string */
- char *la_octal_format_suf; /* Suffix for custom format string */
-const struct op_print
- *la_op_print_tab; /* Table for printing expressions */
-/* Add fields above this point, so the magic number is always last. */
- long la_magic; /* Magic number for compat checking */
-};
-
-#define LANG_MAGIC 910823L
-
-/* Pointer to the language_defn for our current language. This pointer
- always points to *some* valid struct; it can be used without checking
- it for validity. */
-
-extern struct language_defn *current_language;
-
-/* language_mode ==
- language_mode_auto: current_language automatically set upon selection
- of scope (e.g. stack frame)
- language_mode_manual: current_language set only by user. */
-
-extern enum language_mode
- {language_mode_auto, language_mode_manual} language_mode;
-
-/* These macros define the behaviour of the expression
- evaluator. */
-
-/* Should we strictly type check expressions? */
-#define STRICT_TYPE (type_check != range_check_off)
-
-/* Should we range check values against the domain of their type? */
-#define RANGE_CHECK (range_check != type_check_off)
-
-/* "cast" really means conversion */
-/* FIXME -- should be a setting in language_defn */
-#define CAST_IS_CONVERSION (current_language->la_language == language_c)
-
-void language_info();
-void set_language();
-
-/* This page contains functions that return things that are
- specific to languages. Each of these functions is based on
- the current setting of working_lang, which the user sets
- with the "set language" command. */
-
-/* Returns some built-in types */
-#define longest_int() (*current_language->la_longest_int)
-#define longest_unsigned_int() (*current_language->la_longest_unsigned_int)
-#define longest_float() (*current_language->la_longest_float)
-struct type *binop_result_type();
-
-/* Hexadecimal number formatting is in defs.h because it is so common
- throughout GDB. */
-
-/* Return a format string for printf that will print a number in the local
- (language-specific) octal format. Result is static and is
- overwritten by the next call. local_octal_format_custom takes printf
- options like "08" or "l" (to produce e.g. %08x or %lx). */
-
-#define local_octal_format() (current_language->la_octal_format)
-char *local_octal_format_custom();
-
-/* Type predicates */
-int simple_type();
-int ordered_type();
-int same_type();
-int integral_type();
-int numeric_type();
-int character_type();
-int boolean_type();
-int float_type();
-int pointer_type();
-int structured_type();
-
-/* Checks Binary and Unary operations for semantic type correctness */
-void binop_type_check();
-#define unop_type_check(v,o) binop_type_check((v),NULL,(o))
-
-/* Error messages */
-void op_error();
-#define type_op_error(f,o) \
- op_error((f),(o),type_check==type_check_on ? 1 : 0)
-#define range_op_error(f,o) \
- op_error((f),(o),range_check==range_check_on ? 1 : 0)
-void type_error();
-void range_error();
-
-/* Data: Does this value represent "truth" to the current language? */
-int value_true();
-
-/* Misc: The string representing a particular enum language. */
-char *language_str();
-
-/* Add a language to the set known by GDB (at initialization time). */
-void add_language (); /* Arg is &language_defn */
-
-extern enum language get_frame_language (); /* In stack.c */
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
deleted file mode 100644
index 2c5cf4b..0000000
--- a/gdb/m2-exp.y
+++ /dev/null
@@ -1,1226 +0,0 @@
-/* YACC grammar for Modula-2 expressions, for GDB.
- Copyright (C) 1986, 1989, 1990, 1991 Free Software Foundation, Inc.
- Generated from expread.y (now c-exp.y) and contributed by the Department
- of Computer Science at the State University of New York at Buffalo, 1991.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Parse a Modula-2 expression from text in a string,
- and return the result as a struct expression pointer.
- That structure contains arithmetic operations in reverse polish,
- with constants represented by operations that are followed by special data.
- See expression.h for the details of the format.
- What is important here is that it can be built up sequentially
- during the process of parsing; the lower levels of the tree always
- come first in the result. */
-
-%{
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "expression.h"
-#include "language.h"
-#include "value.h"
-#include "parser-defs.h"
-
-/* These MUST be included in any grammar file!!!!
- Please choose unique names! */
-#define yyparse m2_parse
-#define yylex m2_lex
-#define yyerror m2_error
-#define yylval m2_lval
-#define yychar m2_char
-#define yydebug m2_debug
-#define yypact m2_pact
-#define yyr1 m2_r1
-#define yyr2 m2_r2
-#define yydef m2_def
-#define yychk m2_chk
-#define yypgo m2_pgo
-#define yyact m2_act
-#define yyexca m2_exca
-#define yyerrflag m2_errflag
-#define yynerrs m2_nerrs
-#define yyps m2_ps
-#define yypv m2_pv
-#define yys m2_s
-#define yystate m2_state
-#define yytmp m2_tmp
-#define yyv m2_v
-#define yyval m2_val
-#define yylloc m2_lloc
-
-/* Forward decl's */
-void yyerror ();
-static int yylex ();
-int yyparse ();
-
-/* The sign of the number being parsed. */
-int number_sign = 1;
-
-/* The block that the module specified by the qualifer on an identifer is
- contained in, */
-struct block *modblock=0;
-
-char *make_qualname();
-
-/* #define YYDEBUG 1 */
-
-%}
-
-/* Although the yacc "value" of an expression is not used,
- since the result is stored in the structure being created,
- other node types do have values. */
-
-%union
- {
- LONGEST lval;
- unsigned LONGEST ulval;
- double dval;
- struct symbol *sym;
- struct type *tval;
- struct stoken sval;
- int voidval;
- struct block *bval;
- enum exp_opcode opcode;
- struct internalvar *ivar;
-
- struct type **tvec;
- int *ivec;
- }
-
-%type <voidval> exp type_exp start set
-%type <voidval> variable
-%type <tval> type
-%type <bval> block
-%type <sym> fblock
-
-%token <lval> INT HEX ERROR
-%token <ulval> UINT TRUE FALSE CHAR
-%token <dval> FLOAT
-
-/* Both NAME and TYPENAME tokens represent symbols in the input,
- and both convey their data as strings.
- But a TYPENAME is a string that happens to be defined as a typedef
- or builtin type name (such as int or char)
- and a NAME is any other symbol.
-
- Contexts where this distinction is not important can use the
- nonterminal "name", which matches either NAME or TYPENAME. */
-
-%token <sval> STRING
-%token <sval> NAME BLOCKNAME IDENT CONST VARNAME
-%token <sval> TYPENAME
-
-%token SIZE CAP ORD HIGH ABS MIN MAX FLOAT_FUNC VAL CHR ODD TRUNC
-%token INC DEC INCL EXCL
-
-/* The GDB scope operator */
-%token COLONCOLON
-
-%token <lval> LAST REGNAME
-
-%token <ivar> INTERNAL_VAR
-
-/* M2 tokens */
-%left ','
-%left ABOVE_COMMA
-%nonassoc ASSIGN
-%left '<' '>' LEQ GEQ '=' NOTEQUAL '#' IN
-%left OR
-%left AND '&'
-%left '@'
-%left '+' '-'
-%left '*' '/' DIV MOD
-%right UNARY
-%right '^' DOT '[' '('
-%right NOT '~'
-%left COLONCOLON QID
-/* This is not an actual token ; it is used for precedence.
-%right QID
-*/
-%%
-
-start : exp
- | type_exp
- ;
-
-type_exp: type
- { write_exp_elt_opcode(OP_TYPE);
- write_exp_elt_type($1);
- write_exp_elt_opcode(OP_TYPE);
- }
- ;
-
-/* Expressions */
-
-exp : exp '^' %prec UNARY
- { write_exp_elt_opcode (UNOP_IND); }
-
-exp : '-'
- { number_sign = -1; }
- exp %prec UNARY
- { number_sign = 1;
- write_exp_elt_opcode (UNOP_NEG); }
- ;
-
-exp : '+' exp %prec UNARY
- { write_exp_elt_opcode(UNOP_PLUS); }
- ;
-
-exp : not_exp exp %prec UNARY
- { write_exp_elt_opcode (UNOP_ZEROP); }
- ;
-
-not_exp : NOT
- | '~'
- ;
-
-exp : CAP '(' exp ')'
- { write_exp_elt_opcode (UNOP_CAP); }
- ;
-
-exp : ORD '(' exp ')'
- { write_exp_elt_opcode (UNOP_ORD); }
- ;
-
-exp : ABS '(' exp ')'
- { write_exp_elt_opcode (UNOP_ABS); }
- ;
-
-exp : HIGH '(' exp ')'
- { write_exp_elt_opcode (UNOP_HIGH); }
- ;
-
-exp : MIN '(' type ')'
- { write_exp_elt_opcode (UNOP_MIN);
- write_exp_elt_type ($3);
- write_exp_elt_opcode (UNOP_MIN); }
- ;
-
-exp : MAX '(' type ')'
- { write_exp_elt_opcode (UNOP_MAX);
- write_exp_elt_type ($3);
- write_exp_elt_opcode (UNOP_MIN); }
- ;
-
-exp : FLOAT_FUNC '(' exp ')'
- { write_exp_elt_opcode (UNOP_FLOAT); }
- ;
-
-exp : VAL '(' type ',' exp ')'
- { write_exp_elt_opcode (BINOP_VAL);
- write_exp_elt_type ($3);
- write_exp_elt_opcode (BINOP_VAL); }
- ;
-
-exp : CHR '(' exp ')'
- { write_exp_elt_opcode (UNOP_CHR); }
- ;
-
-exp : ODD '(' exp ')'
- { write_exp_elt_opcode (UNOP_ODD); }
- ;
-
-exp : TRUNC '(' exp ')'
- { write_exp_elt_opcode (UNOP_TRUNC); }
- ;
-
-exp : SIZE exp %prec UNARY
- { write_exp_elt_opcode (UNOP_SIZEOF); }
- ;
-
-
-exp : INC '(' exp ')'
- { write_exp_elt_opcode(UNOP_PREINCREMENT); }
- ;
-
-exp : INC '(' exp ',' exp ')'
- { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
- write_exp_elt_opcode(BINOP_ADD);
- write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
- ;
-
-exp : DEC '(' exp ')'
- { write_exp_elt_opcode(UNOP_PREDECREMENT);}
- ;
-
-exp : DEC '(' exp ',' exp ')'
- { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
- write_exp_elt_opcode(BINOP_SUB);
- write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
- ;
-
-exp : exp DOT NAME
- { write_exp_elt_opcode (STRUCTOP_STRUCT);
- write_exp_string ($3);
- write_exp_elt_opcode (STRUCTOP_STRUCT); }
- ;
-
-exp : set
- ;
-
-exp : exp IN set
- { error("Sets are not implemented.");}
- ;
-
-exp : INCL '(' exp ',' exp ')'
- { error("Sets are not implemented.");}
- ;
-
-exp : EXCL '(' exp ',' exp ')'
- { error("Sets are not implemented.");}
-
-set : '{' arglist '}'
- { error("Sets are not implemented.");}
- | type '{' arglist '}'
- { error("Sets are not implemented.");}
- ;
-
-
-/* Modula-2 array subscript notation [a,b,c...] */
-exp : exp '['
- /* This function just saves the number of arguments
- that follow in the list. It is *not* specific to
- function types */
- { start_arglist(); }
- non_empty_arglist ']' %prec DOT
- { write_exp_elt_opcode (BINOP_MULTI_SUBSCRIPT);
- write_exp_elt_longcst ((LONGEST) end_arglist());
- write_exp_elt_opcode (BINOP_MULTI_SUBSCRIPT); }
- ;
-
-exp : exp '('
- /* This is to save the value of arglist_len
- being accumulated by an outer function call. */
- { start_arglist (); }
- arglist ')' %prec DOT
- { write_exp_elt_opcode (OP_FUNCALL);
- write_exp_elt_longcst ((LONGEST) end_arglist ());
- write_exp_elt_opcode (OP_FUNCALL); }
- ;
-
-arglist :
- ;
-
-arglist : exp
- { arglist_len = 1; }
- ;
-
-arglist : arglist ',' exp %prec ABOVE_COMMA
- { arglist_len++; }
- ;
-
-non_empty_arglist
- : exp
- { arglist_len = 1; }
- ;
-
-non_empty_arglist
- : non_empty_arglist ',' exp %prec ABOVE_COMMA
- { arglist_len++; }
- ;
-
-/* GDB construct */
-exp : '{' type '}' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_MEMVAL);
- write_exp_elt_type ($2);
- write_exp_elt_opcode (UNOP_MEMVAL); }
- ;
-
-exp : type '(' exp ')' %prec UNARY
- { write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type ($1);
- write_exp_elt_opcode (UNOP_CAST); }
- ;
-
-exp : '(' exp ')'
- { }
- ;
-
-/* Binary operators in order of decreasing precedence. Note that some
- of these operators are overloaded! (ie. sets) */
-
-/* GDB construct */
-exp : exp '@' exp
- { write_exp_elt_opcode (BINOP_REPEAT); }
- ;
-
-exp : exp '*' exp
- { write_exp_elt_opcode (BINOP_MUL); }
- ;
-
-exp : exp '/' exp
- { write_exp_elt_opcode (BINOP_DIV); }
- ;
-
-exp : exp DIV exp
- { write_exp_elt_opcode (BINOP_INTDIV); }
- ;
-
-exp : exp MOD exp
- { write_exp_elt_opcode (BINOP_REM); }
- ;
-
-exp : exp '+' exp
- { write_exp_elt_opcode (BINOP_ADD); }
- ;
-
-exp : exp '-' exp
- { write_exp_elt_opcode (BINOP_SUB); }
- ;
-
-exp : exp '=' exp
- { write_exp_elt_opcode (BINOP_EQUAL); }
- ;
-
-exp : exp NOTEQUAL exp
- { write_exp_elt_opcode (BINOP_NOTEQUAL); }
- | exp '#' exp
- { write_exp_elt_opcode (BINOP_NOTEQUAL); }
- ;
-
-exp : exp LEQ exp
- { write_exp_elt_opcode (BINOP_LEQ); }
- ;
-
-exp : exp GEQ exp
- { write_exp_elt_opcode (BINOP_GEQ); }
- ;
-
-exp : exp '<' exp
- { write_exp_elt_opcode (BINOP_LESS); }
- ;
-
-exp : exp '>' exp
- { write_exp_elt_opcode (BINOP_GTR); }
- ;
-
-exp : exp AND exp
- { write_exp_elt_opcode (BINOP_AND); }
- ;
-
-exp : exp '&' exp
- { write_exp_elt_opcode (BINOP_AND); }
- ;
-
-exp : exp OR exp
- { write_exp_elt_opcode (BINOP_OR); }
- ;
-
-exp : exp ASSIGN exp
- { write_exp_elt_opcode (BINOP_ASSIGN); }
- ;
-
-
-/* Constants */
-
-exp : TRUE
- { write_exp_elt_opcode (OP_BOOL);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_BOOL); }
- ;
-
-exp : FALSE
- { write_exp_elt_opcode (OP_BOOL);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_BOOL); }
- ;
-
-exp : INT
- { write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_m2_int);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : UINT
- {
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_m2_card);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LONG);
- }
- ;
-
-exp : CHAR
- { write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_m2_char);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-
-exp : FLOAT
- { write_exp_elt_opcode (OP_DOUBLE);
- write_exp_elt_type (builtin_type_m2_real);
- write_exp_elt_dblcst ($1);
- write_exp_elt_opcode (OP_DOUBLE); }
- ;
-
-exp : variable
- ;
-
-/* The GDB internal variable $$, et al. */
-exp : LAST
- { write_exp_elt_opcode (OP_LAST);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_LAST); }
- ;
-
-exp : REGNAME
- { write_exp_elt_opcode (OP_REGISTER);
- write_exp_elt_longcst ((LONGEST) $1);
- write_exp_elt_opcode (OP_REGISTER); }
- ;
-
-exp : SIZE '(' type ')' %prec UNARY
- { write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
- write_exp_elt_opcode (OP_LONG); }
- ;
-
-exp : STRING
- { write_exp_elt_opcode (OP_M2_STRING);
- write_exp_string ($1);
- write_exp_elt_opcode (OP_M2_STRING); }
- ;
-
-/* This will be used for extensions later. Like adding modules. */
-block : fblock
- { $$ = SYMBOL_BLOCK_VALUE($1); }
- ;
-
-fblock : BLOCKNAME
- { struct symbol *sym
- = lookup_symbol (copy_name ($1), expression_context_block,
- VAR_NAMESPACE, 0, NULL);
- $$ = sym;}
- ;
-
-
-/* GDB scope operator */
-fblock : block COLONCOLON BLOCKNAME
- { struct symbol *tem
- = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, 0, NULL);
- if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
- error ("No function \"%s\" in specified context.",
- copy_name ($3));
- $$ = tem;
- }
- ;
-
-/* Useful for assigning to PROCEDURE variables */
-variable: fblock
- { write_exp_elt_opcode(OP_VAR_VALUE);
- write_exp_elt_sym ($1);
- write_exp_elt_opcode (OP_VAR_VALUE); }
- ;
-
-/* GDB internal ($foo) variable */
-variable: INTERNAL_VAR
- { write_exp_elt_opcode (OP_INTERNALVAR);
- write_exp_elt_intern ($1);
- write_exp_elt_opcode (OP_INTERNALVAR); }
- ;
-
-/* GDB scope operator */
-variable: block COLONCOLON NAME
- { struct symbol *sym;
- sym = lookup_symbol (copy_name ($3), $1,
- VAR_NAMESPACE, 0, NULL);
- if (sym == 0)
- error ("No symbol \"%s\" in specified context.",
- copy_name ($3));
-
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE); }
- ;
-
-/* Base case for variables. */
-variable: NAME
- { struct symbol *sym;
- int is_a_field_of_this;
-
- sym = lookup_symbol (copy_name ($1),
- expression_context_block,
- VAR_NAMESPACE,
- &is_a_field_of_this,
- NULL);
- if (sym)
- {
- switch (sym->class)
- {
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_LOCAL:
- if (innermost_block == 0 ||
- contained_in (block_found,
- innermost_block))
- innermost_block = block_found;
- }
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- }
- else
- {
- register int i;
- register char *arg = copy_name ($1);
-
- for (i = 0; i < misc_function_count; i++)
- if (!strcmp (misc_function_vector[i].name, arg))
- break;
-
- if (i < misc_function_count)
- {
- enum misc_function_type mft =
- (enum misc_function_type)
- misc_function_vector[i].type;
-
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST) misc_function_vector[i].address);
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_opcode (UNOP_MEMVAL);
- if (mft == mf_data || mft == mf_bss)
- write_exp_elt_type (builtin_type_int);
- else if (mft == mf_text)
- write_exp_elt_type (lookup_function_type (builtin_type_int));
- else
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_opcode (UNOP_MEMVAL);
- }
- else if (symtab_list == 0
- && partial_symtab_list == 0)
- error ("No symbol table is loaded. Use the \"symbol-file\" command.");
- else
- error ("No symbol \"%s\" in current context.",
- copy_name ($1));
- }
- }
- ;
-
-type
- : TYPENAME
- { $$ = lookup_typename (copy_name ($1),
- expression_context_block, 0); }
-
- ;
-
-%%
-
-#if 0 /* FIXME! */
-int
-overflow(a,b)
- long a,b;
-{
- return (MAX_OF_TYPE(builtin_type_m2_int) - b) < a;
-}
-
-int
-uoverflow(a,b)
- unsigned long a,b;
-{
- return (MAX_OF_TYPE(builtin_type_m2_card) - b) < a;
-}
-#endif /* FIXME */
-
-/* Take care of parsing a number (anything that starts with a digit).
- Set yylval and return the token type; update lexptr.
- LEN is the number of characters in it. */
-
-/*** Needs some error checking for the float case ***/
-
-static int
-parse_number (olen)
- int olen;
-{
- register char *p = lexptr;
- register LONGEST n = 0;
- register LONGEST prevn = 0;
- register int c,i,ischar=0;
- register int base = input_radix;
- register int len = olen;
- int unsigned_p = number_sign == 1 ? 1 : 0;
-
- extern double atof ();
-
- if(p[len-1] == 'H')
- {
- base = 16;
- len--;
- }
- else if(p[len-1] == 'C' || p[len-1] == 'B')
- {
- base = 8;
- ischar = p[len-1] == 'C';
- len--;
- }
-
- /* Scan the number */
- for (c = 0; c < len; c++)
- {
- if (p[c] == '.' && base == 10)
- {
- /* It's a float since it contains a point. */
- yylval.dval = atof (p);
- lexptr += len;
- return FLOAT;
- }
- if (p[c] == '.' && base != 10)
- error("Floating point numbers must be base 10.");
- if (base == 10 && (p[c] < '0' || p[c] > '9'))
- error("Invalid digit \'%c\' in number.",p[c]);
- }
-
- while (len-- > 0)
- {
- c = *p++;
- n *= base;
- if( base == 8 && (c == '8' || c == '9'))
- error("Invalid digit \'%c\' in octal number.",c);
- if (c >= '0' && c <= '9')
- i = c - '0';
- else
- {
- if (base == 16 && c >= 'A' && c <= 'F')
- i = c - 'A' + 10;
- else
- return ERROR;
- }
- n+=i;
- if(i >= base)
- return ERROR;
- if(!unsigned_p && number_sign == 1 && (prevn >= n))
- unsigned_p=1; /* Try something unsigned */
- /* Don't do the range check if n==i and i==0, since that special
- case will give an overflow error. */
- if(RANGE_CHECK && n!=i && i)
- {
- if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
- ((!unsigned_p && number_sign==-1) && -prevn <= -n))
- range_error("Overflow on numeric constant.");
- }
- prevn=n;
- }
-
- lexptr = p;
- if(*p == 'B' || *p == 'C' || *p == 'H')
- lexptr++; /* Advance past B,C or H */
-
- if (ischar)
- {
- yylval.ulval = n;
- return CHAR;
- }
- else if ( unsigned_p && number_sign == 1)
- {
- yylval.ulval = n;
- return UINT;
- }
- else if((unsigned_p && (n<0))) {
- range_error("Overflow on numeric constant -- number too large.");
- /* But, this can return if range_check == range_warn. */
- }
- yylval.lval = n;
- return INT;
-}
-
-
-/* Some tokens */
-
-static struct
-{
- char name[2];
- int token;
-} tokentab2[] =
-{
- {"<>", NOTEQUAL },
- {":=", ASSIGN },
- {"<=", LEQ },
- {">=", GEQ },
- {"::", COLONCOLON },
-
-};
-
-/* Some specific keywords */
-
-struct keyword {
- char keyw[10];
- int token;
-};
-
-static struct keyword keytab[] =
-{
- {"OR" , OR },
- {"IN", IN },/* Note space after IN */
- {"AND", AND },
- {"ABS", ABS },
- {"CHR", CHR },
- {"DEC", DEC },
- {"NOT", NOT },
- {"DIV", DIV },
- {"INC", INC },
- {"MAX", MAX },
- {"MIN", MIN },
- {"MOD", MOD },
- {"ODD", ODD },
- {"CAP", CAP },
- {"ORD", ORD },
- {"VAL", VAL },
- {"EXCL", EXCL },
- {"HIGH", HIGH },
- {"INCL", INCL },
- {"SIZE", SIZE },
- {"FLOAT", FLOAT_FUNC },
- {"TRUNC", TRUNC },
-};
-
-
-/* Read one token, getting characters through lexptr. */
-
-/* This is where we will check to make sure that the language and the operators used are
- compatible */
-
-static int
-yylex ()
-{
- register int c;
- register int namelen;
- register int i;
- register char *tokstart;
- register char quote;
-
- retry:
-
- tokstart = lexptr;
-
-
- /* See if it is a special token of length 2 */
- for( i = 0 ; i < sizeof tokentab2 / sizeof tokentab2[0] ; i++)
- if(!strncmp(tokentab2[i].name, tokstart, 2))
- {
- lexptr += 2;
- return tokentab2[i].token;
- }
-
- switch (c = *tokstart)
- {
- case 0:
- return 0;
-
- case ' ':
- case '\t':
- case '\n':
- lexptr++;
- goto retry;
-
- case '(':
- paren_depth++;
- lexptr++;
- return c;
-
- case ')':
- if (paren_depth == 0)
- return 0;
- paren_depth--;
- lexptr++;
- return c;
-
- case ',':
- if (comma_terminates && paren_depth == 0)
- return 0;
- lexptr++;
- return c;
-
- case '.':
- /* Might be a floating point number. */
- if (lexptr[1] >= '0' && lexptr[1] <= '9')
- break; /* Falls into number code. */
- else
- {
- lexptr++;
- return DOT;
- }
-
-/* These are character tokens that appear as-is in the YACC grammar */
- case '+':
- case '-':
- case '*':
- case '/':
- case '^':
- case '<':
- case '>':
- case '[':
- case ']':
- case '=':
- case '{':
- case '}':
- case '#':
- case '@':
- case '~':
- case '&':
- lexptr++;
- return c;
-
- case '\'' :
- case '"':
- quote = c;
- for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
- if (c == '\\')
- {
- c = tokstart[++namelen];
- if (c >= '0' && c <= '9')
- {
- c = tokstart[++namelen];
- if (c >= '0' && c <= '9')
- c = tokstart[++namelen];
- }
- }
- if(c != quote)
- error("Unterminated string or character constant.");
- yylval.sval.ptr = tokstart + 1;
- yylval.sval.length = namelen - 1;
- lexptr += namelen + 1;
-
- if(namelen == 2) /* Single character */
- {
- yylval.ulval = tokstart[1];
- return CHAR;
- }
- else
- return STRING;
- }
-
- /* Is it a number? */
- /* Note: We have already dealt with the case of the token '.'.
- See case '.' above. */
- if ((c >= '0' && c <= '9'))
- {
- /* It's a number. */
- int got_dot = 0, got_e = 0;
- register char *p = tokstart;
- int toktype;
-
- for (++p ;; ++p)
- {
- if (!got_e && (*p == 'e' || *p == 'E'))
- got_dot = got_e = 1;
- else if (!got_dot && *p == '.')
- got_dot = 1;
- else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
- && (*p == '-' || *p == '+'))
- /* This is the sign of the exponent, not the end of the
- number. */
- continue;
- else if ((*p < '0' || *p > '9') &&
- (*p < 'A' || *p > 'F') &&
- (*p != 'H')) /* Modula-2 hexadecimal number */
- break;
- }
- toktype = parse_number (p - tokstart);
- if (toktype == ERROR)
- {
- char *err_copy = (char *) alloca (p - tokstart + 1);
-
- bcopy (tokstart, err_copy, p - tokstart);
- err_copy[p - tokstart] = 0;
- error ("Invalid number \"%s\".", err_copy);
- }
- lexptr = p;
- return toktype;
- }
-
- if (!(c == '_' || c == '$'
- || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
- /* We must have come across a bad character (e.g. ';'). */
- error ("Invalid character '%c' in expression.", c);
-
- /* It's a name. See how long it is. */
- namelen = 0;
- for (c = tokstart[namelen];
- (c == '_' || c == '$' || (c >= '0' && c <= '9')
- || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
- c = tokstart[++namelen])
- ;
-
- /* The token "if" terminates the expression and is NOT
- removed from the input stream. */
- if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
- {
- return 0;
- }
-
- lexptr += namelen;
-
- /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
- and $$digits (equivalent to $<-digits> if you could type that).
- Make token type LAST, and put the number (the digits) in yylval. */
-
- if (*tokstart == '$')
- {
- register int negate = 0;
- c = 1;
- /* Double dollar means negate the number and add -1 as well.
- Thus $$ alone means -1. */
- if (namelen >= 2 && tokstart[1] == '$')
- {
- negate = 1;
- c = 2;
- }
- if (c == namelen)
- {
- /* Just dollars (one or two) */
- yylval.lval = - negate;
- return LAST;
- }
- /* Is the rest of the token digits? */
- for (; c < namelen; c++)
- if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
- break;
- if (c == namelen)
- {
- yylval.lval = atoi (tokstart + 1 + negate);
- if (negate)
- yylval.lval = - yylval.lval;
- return LAST;
- }
- }
-
- /* Handle tokens that refer to machine registers:
- $ followed by a register name. */
-
- if (*tokstart == '$') {
- for (c = 0; c < NUM_REGS; c++)
- if (namelen - 1 == strlen (reg_names[c])
- && !strncmp (tokstart + 1, reg_names[c], namelen - 1))
- {
- yylval.lval = c;
- return REGNAME;
- }
- for (c = 0; c < num_std_regs; c++)
- if (namelen - 1 == strlen (std_regs[c].name)
- && !strncmp (tokstart + 1, std_regs[c].name, namelen - 1))
- {
- yylval.lval = std_regs[c].regnum;
- return REGNAME;
- }
- }
-
-
- /* Lookup special keywords */
- for(i = 0 ; i < sizeof(keytab) / sizeof(keytab[0]) ; i++)
- if(namelen == strlen(keytab[i].keyw) && !strncmp(tokstart,keytab[i].keyw,namelen))
- return keytab[i].token;
-
- yylval.sval.ptr = tokstart;
- yylval.sval.length = namelen;
-
- /* Any other names starting in $ are debugger internal variables. */
-
- if (*tokstart == '$')
- {
- yylval.ivar = (struct internalvar *) lookup_internalvar (copy_name (yylval.sval) + 1);
- return INTERNAL_VAR;
- }
-
-
- /* Use token-type BLOCKNAME for symbols that happen to be defined as
- functions. If this is not so, then ...
- Use token-type TYPENAME for symbols that happen to be defined
- currently as names of types; NAME for other symbols.
- The caller is not constrained to care about the distinction. */
- {
-
-
- char *tmp = copy_name (yylval.sval);
- struct symbol *sym;
-
- if (lookup_partial_symtab (tmp))
- return BLOCKNAME;
- sym = lookup_symbol (tmp, expression_context_block,
- VAR_NAMESPACE, 0, NULL);
- if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
- return BLOCKNAME;
- if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))
- return TYPENAME;
-
- if(sym)
- {
- switch(sym->class)
- {
- case LOC_STATIC:
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_LOCAL:
- case LOC_LOCAL_ARG:
- case LOC_CONST:
- case LOC_CONST_BYTES:
- return NAME;
-
- case LOC_TYPEDEF:
- return TYPENAME;
-
- case LOC_BLOCK:
- return BLOCKNAME;
-
- case LOC_UNDEF:
- error("internal: Undefined class in m2lex()");
-
- case LOC_LABEL:
- error("internal: Unforseen case in m2lex()");
- }
- }
- else
- {
- /* Built-in BOOLEAN type. This is sort of a hack. */
- if(!strncmp(tokstart,"TRUE",4))
- {
- yylval.ulval = 1;
- return TRUE;
- }
- else if(!strncmp(tokstart,"FALSE",5))
- {
- yylval.ulval = 0;
- return FALSE;
- }
- }
-
- /* Must be another type of name... */
- return NAME;
- }
-}
-
-char *
-make_qualname(mod,ident)
- char *mod, *ident;
-{
- char *new = xmalloc(strlen(mod)+strlen(ident)+2);
-
- strcpy(new,mod);
- strcat(new,".");
- strcat(new,ident);
- return new;
-}
-
-
-void
-yyerror()
-{
- printf("Parsing: %s\n",lexptr);
- if (yychar < 256)
- error("Invalid syntax in expression near character '%c'.",yychar);
- else
- error("Invalid syntax in expression");
-}
-
-/* Table of operators and their precedences for printing expressions. */
-
-const static struct op_print m2_op_print_tab[] = {
- {"+", BINOP_ADD, PREC_ADD, 0},
- {"+", UNOP_PLUS, PREC_PREFIX, 0},
- {"-", BINOP_SUB, PREC_ADD, 0},
- {"-", UNOP_NEG, PREC_PREFIX, 0},
- {"*", BINOP_MUL, PREC_MUL, 0},
- {"/", BINOP_DIV, PREC_MUL, 0},
- {"DIV", BINOP_INTDIV, PREC_MUL, 0},
- {"MOD", BINOP_REM, PREC_MUL, 0},
- {":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
- {"OR", BINOP_OR, PREC_OR, 0},
- {"AND", BINOP_AND, PREC_AND, 0},
- {"NOT", UNOP_ZEROP, PREC_PREFIX, 0},
- {"=", BINOP_EQUAL, PREC_EQUAL, 0},
- {"<>", BINOP_NOTEQUAL, PREC_EQUAL, 0},
- {"<=", BINOP_LEQ, PREC_ORDER, 0},
- {">=", BINOP_GEQ, PREC_ORDER, 0},
- {">", BINOP_GTR, PREC_ORDER, 0},
- {"<", BINOP_LESS, PREC_ORDER, 0},
- {"^", UNOP_IND, PREC_PREFIX, 0},
- {"@", BINOP_REPEAT, PREC_REPEAT, 0},
-};
-
-/* The built-in types of Modula-2. */
-
-struct type *builtin_type_m2_char;
-struct type *builtin_type_m2_int;
-struct type *builtin_type_m2_card;
-struct type *builtin_type_m2_real;
-struct type *builtin_type_m2_bool;
-
-struct type ** const (m2_builtin_types[]) =
-{
- &builtin_type_m2_char,
- &builtin_type_m2_int,
- &builtin_type_m2_card,
- &builtin_type_m2_real,
- &builtin_type_m2_bool,
- 0
-};
-
-const struct language_defn m2_language_defn = {
- "modula-2",
- language_m2,
- m2_builtin_types,
- range_check_on,
- type_check_on,
- m2_parse, /* parser */
- m2_error, /* parser error function */
- &builtin_type_m2_int, /* longest signed integral type */
- &builtin_type_m2_card, /* longest unsigned integral type */
- &builtin_type_m2_real, /* longest floating point type */
- "0%XH", "0%", "XH", /* Hex format string, prefix, suffix */
- "%oB", "%", "oB", /* Octal format string, prefix, suffix */
- m2_op_print_tab, /* expression operators for printing */
- LANG_MAGIC
-};
-
-/* Initialization for Modula-2 */
-
-void
-_initialize_m2_exp ()
-{
- /* FIXME: The code below assumes that the sizes of the basic data
- types are the same on the host and target machines!!! */
-
- /* Modula-2 "pervasive" types. NOTE: these can be redefined!!! */
- builtin_type_m2_int = init_type (TYPE_CODE_INT, sizeof(int), 0, "INTEGER");
- builtin_type_m2_card = init_type (TYPE_CODE_INT, sizeof(int), 1, "CARDINAL");
- builtin_type_m2_real = init_type (TYPE_CODE_FLT, sizeof(float), 0, "REAL");
- builtin_type_m2_char = init_type (TYPE_CODE_CHAR, sizeof(char), 1, "CHAR");
-
- builtin_type_m2_bool = init_type (TYPE_CODE_BOOL, sizeof(int), 1, "BOOLEAN");
- TYPE_NFIELDS(builtin_type_m2_bool) = 2;
- TYPE_FIELDS(builtin_type_m2_bool) =
- (struct field *) malloc (sizeof (struct field) * 2);
- TYPE_FIELD_BITPOS(builtin_type_m2_bool,0) = 0;
- TYPE_FIELD_NAME(builtin_type_m2_bool,0) = (char *)malloc(6);
- strcpy(TYPE_FIELD_NAME(builtin_type_m2_bool,0),"FALSE");
- TYPE_FIELD_BITPOS(builtin_type_m2_bool,1) = 1;
- TYPE_FIELD_NAME(builtin_type_m2_bool,1) = (char *)malloc(5);
- strcpy(TYPE_FIELD_NAME(builtin_type_m2_bool,1),"TRUE");
-
- add_language (&m2_language_defn);
-}
diff --git a/gdb/m68k-opcode.h b/gdb/m68k-opcode.h
deleted file mode 100755
index 1a8f7d2..0000000
--- a/gdb/m68k-opcode.h
+++ /dev/null
@@ -1,1679 +0,0 @@
-/* Opcode table for m68000/m68020 and m68881.
- Copyright (C) 1989, Free Software Foundation.
-
-This file is part of GDB, the GNU Debugger and GAS, the GNU Assembler.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-struct m68k_opcode
-{
- char *name;
- unsigned long opcode;
- unsigned long match;
- char *args;
-};
-
-/* We store four bytes of opcode for all opcodes because that
- is the most any of them need. The actual length of an instruction
- is always at least 2 bytes, and is as much longer as necessary to
- hold the operands it has.
-
- The match component is a mask saying which bits must match
- particular opcode in order for an instruction to be an instance
- of that opcode.
-
- The args component is a string containing two characters
- for each operand of the instruction. The first specifies
- the kind of operand; the second, the place it is stored. */
-
-/* Kinds of operands:
- D data register only. Stored as 3 bits.
- A address register only. Stored as 3 bits.
- R either kind of register. Stored as 4 bits.
- F floating point coprocessor register only. Stored as 3 bits.
- O an offset (or width): immediate data 0-31 or data register.
- Stored as 6 bits in special format for BF... insns.
- + autoincrement only. Stored as 3 bits (number of the address register).
- - autodecrement only. Stored as 3 bits (number of the address register).
- Q quick immediate data. Stored as 3 bits.
- This matches an immediate operand only when value is in range 1 .. 8.
- M moveq immediate data. Stored as 8 bits.
- This matches an immediate operand only when value is in range -128..127
- T trap vector immediate data. Stored as 4 bits.
-
- k K-factor for fmove.p instruction. Stored as a 7-bit constant or
- a three bit register offset, depending on the field type.
-
- # immediate data. Stored in special places (b, w or l)
- which say how many bits to store.
- ^ immediate data for floating point instructions. Special places
- are offset by 2 bytes from '#'...
- B pc-relative address, converted to an offset
- that is treated as immediate data.
- d displacement and register. Stores the register as 3 bits
- and stores the displacement in the entire second word.
-
- C the CCR. No need to store it; this is just for filtering validity.
- S the SR. No need to store, just as with CCR.
- U the USP. No need to store, just as with CCR.
-
- I Coprocessor ID. Not printed if 1. The Coprocessor ID is always
- extracted from the 'd' field of word one, which means that an extended
- coprocessor opcode can be skipped using the 'i' place, if needed.
-
- s System Control register for the floating point coprocessor.
- S List of system control registers for floating point coprocessor.
-
- J Misc register for movec instruction, stored in 'j' format.
- Possible values:
- 000 SFC Source Function Code reg
- 001 DFC Data Function Code reg
- 002 CACR Cache Control Register
- 800 USP User Stack Pointer
- 801 VBR Vector Base reg
- 802 CAAR Cache Address Register
- 803 MSP Master Stack Pointer
- 804 ISP Interrupt Stack Pointer
-
- L Register list of the type d0-d7/a0-a7 etc.
- (New! Improved! Can also hold fp0-fp7, as well!)
- The assembler tries to see if the registers match the insn by
- looking at where the insn wants them stored.
-
- l Register list like L, but with all the bits reversed.
- Used for going the other way. . .
-
- They are all stored as 6 bits using an address mode and a register number;
- they differ in which addressing modes they match.
-
- * all (modes 0-6,7.*)
- ~ alterable memory (modes 2-6,7.0,7.1)(not 0,1,7.~)
- % alterable (modes 0-6,7.0,7.1)(not 7.~)
- ; data (modes 0,2-6,7.*)(not 1)
- @ data, but not immediate (modes 0,2-6,7.? ? ?)(not 1,7.?) This may really be ;, the 68020 book says it is
- ! control (modes 2,5,6,7.*-)(not 0,1,3,4,7.4)
- & alterable control (modes 2,5,6,7.0,7.1)(not 0,1,7.? ? ?)
- $ alterable data (modes 0,2-6,7.0,7.1)(not 1,7.~)
- ? alterable control, or data register (modes 0,2,5,6,7.0,7.1)(not 1,3,4,7.~)
- / control, or data register (modes 0,2,5,6,7.0,7.1,7.2,7.3)(not 1,3,4,7.4)
-*/
-
-/* JF: for the 68851 */
-/*
- I didn't use much imagination in choosing the
- following codes, so many of them aren't very
- mnemonic. -rab
-
- P pmmu register
- Possible values:
- 000 TC Translation Control reg
- 100 CAL Current Access Level
- 101 VAL Validate Access Level
- 110 SCC Stack Change Control
- 111 AC Access Control
-
- W wide pmmu registers
- Possible values:
- 001 DRP Dma Root Pointer
- 010 SRP Supervisor Root Pointer
- 011 CRP Cpu Root Pointer
-
- f function code register
- 0 SFC
- 1 DFC
-
- V VAL register only
-
- X BADx, BACx
- 100 BAD Breakpoint Acknowledge Data
- 101 BAC Breakpoint Acknowledge Control
-
- Y PSR
- Z PCSR
-
- | memory (modes 2-6, 7.*)
-
-*/
-
-/* Places to put an operand, for non-general operands:
- s source, low bits of first word.
- d dest, shifted 9 in first word
- 1 second word, shifted 12
- 2 second word, shifted 6
- 3 second word, shifted 0
- 4 third word, shifted 12
- 5 third word, shifted 6
- 6 third word, shifted 0
- 7 second word, shifted 7
- 8 second word, shifted 10
- D store in both place 1 and place 3; for divul and divsl.
- b second word, low byte
- w second word (entire)
- l second and third word (entire)
- g branch offset for bra and similar instructions.
- The place to store depends on the magnitude of offset.
- t store in both place 7 and place 8; for floating point operations
- c branch offset for cpBcc operations.
- The place to store is word two if bit six of word one is zero,
- and words two and three if bit six of word one is one.
- i Increment by two, to skip over coprocessor extended operands. Only
- works with the 'I' format.
- k Dynamic K-factor field. Bits 6-4 of word 2, used as a register number.
- Also used for dynamic fmovem instruction.
- C floating point coprocessor constant - 7 bits. Also used for static
- K-factors...
- j Movec register #, stored in 12 low bits of second word.
-
- Places to put operand, for general operands:
- d destination, shifted 6 bits in first word
- b source, at low bit of first word, and immediate uses one byte
- w source, at low bit of first word, and immediate uses two bytes
- l source, at low bit of first word, and immediate uses four bytes
- s source, at low bit of first word.
- Used sometimes in contexts where immediate is not allowed anyway.
- f single precision float, low bit of 1st word, immediate uses 4 bytes
- F double precision float, low bit of 1st word, immediate uses 8 bytes
- x extended precision float, low bit of 1st word, immediate uses 12 bytes
- p packed float, low bit of 1st word, immediate uses 12 bytes
-*/
-
-#define one(x) ((x) << 16)
-#define two(x, y) (((x) << 16) + y)
-
-/*
- *** DANGER WILL ROBINSON ***
-
- The assembler requires that all instances of the same mnemonic must be
- consecutive. If they aren't, the assembler will bomb at runtime
- */
-struct m68k_opcode m68k_opcodes[] =
-{
-{"abcd", one(0140400), one(0170770), "DsDd"},
-{"abcd", one(0140410), one(0170770), "-s-d"},
-
- /* Add instructions */
-{"addal", one(0150700), one(0170700), "*lAd"},
-{"addaw", one(0150300), one(0170700), "*wAd"},
-{"addib", one(0003000), one(0177700), "#b$b"},
-{"addil", one(0003200), one(0177700), "#l$l"},
-{"addiw", one(0003100), one(0177700), "#w$w"},
-{"addqb", one(0050000), one(0170700), "Qd$b"},
-{"addql", one(0050200), one(0170700), "Qd%l"},
-{"addqw", one(0050100), one(0170700), "Qd%w"},
-
-{"addb", one(0050000), one(0170700), "Qd$b"}, /* addq written as add */
-{"addb", one(0003000), one(0177700), "#b$b"}, /* addi written as add */
-{"addb", one(0150000), one(0170700), ";bDd"}, /* addb <ea>, Dd */
-{"addb", one(0150400), one(0170700), "Dd~b"}, /* addb Dd, <ea> */
-
-{"addw", one(0050100), one(0170700), "Qd%w"}, /* addq written as add */
-{"addw", one(0003100), one(0177700), "#w$w"}, /* addi written as add */
-{"addw", one(0150300), one(0170700), "*wAd"}, /* adda written as add */
-{"addw", one(0150100), one(0170700), "*wDd"}, /* addw <ea>, Dd */
-{"addw", one(0150500), one(0170700), "Dd~w"}, /* addw Dd, <ea> */
-
-{"addl", one(0050200), one(0170700), "Qd%l"}, /* addq written as add */
-{"addl", one(0003200), one(0177700), "#l$l"}, /* addi written as add */
-{"addl", one(0150700), one(0170700), "*lAd"}, /* adda written as add */
-{"addl", one(0150200), one(0170700), "*lDd"}, /* addl <ea>, Dd */
-{"addl", one(0150600), one(0170700), "Dd~l"}, /* addl Dd, <ea> */
-
-{"addxb", one(0150400), one(0170770), "DsDd"},
-{"addxb", one(0150410), one(0170770), "-s-d"},
-{"addxl", one(0150600), one(0170770), "DsDd"},
-{"addxl", one(0150610), one(0170770), "-s-d"},
-{"addxw", one(0150500), one(0170770), "DsDd"},
-{"addxw", one(0150510), one(0170770), "-s-d"},
-
-{"andib", one(0001000), one(0177700), "#b$b"},
-{"andib", one(0001074), one(0177777), "#bCb"}, /* andi to ccr */
-{"andiw", one(0001100), one(0177700), "#w$w"},
-{"andiw", one(0001174), one(0177777), "#wSw"}, /* andi to sr */
-{"andil", one(0001200), one(0177700), "#l$l"},
-
-{"andb", one(0001000), one(0177700), "#b$b"}, /* andi written as or */
-{"andb", one(0001074), one(0177777), "#bCb"}, /* andi to ccr */
-{"andb", one(0140000), one(0170700), ";bDd"}, /* memory to register */
-{"andb", one(0140400), one(0170700), "Dd~b"}, /* register to memory */
-{"andw", one(0001100), one(0177700), "#w$w"}, /* andi written as or */
-{"andw", one(0001174), one(0177777), "#wSw"}, /* andi to sr */
-{"andw", one(0140100), one(0170700), ";wDd"}, /* memory to register */
-{"andw", one(0140500), one(0170700), "Dd~w"}, /* register to memory */
-{"andl", one(0001200), one(0177700), "#l$l"}, /* andi written as or */
-{"andl", one(0140200), one(0170700), ";lDd"}, /* memory to register */
-{"andl", one(0140600), one(0170700), "Dd~l"}, /* register to memory */
-
-{"aslb", one(0160400), one(0170770), "QdDs"},
-{"aslb", one(0160440), one(0170770), "DdDs"},
-{"asll", one(0160600), one(0170770), "QdDs"},
-{"asll", one(0160640), one(0170770), "DdDs"},
-{"aslw", one(0160500), one(0170770), "QdDs"},
-{"aslw", one(0160540), one(0170770), "DdDs"},
-{"aslw", one(0160700), one(0177700), "~s"}, /* Shift memory */
-{"asrb", one(0160000), one(0170770), "QdDs"},
-{"asrb", one(0160040), one(0170770), "DdDs"},
-{"asrl", one(0160200), one(0170770), "QdDs"},
-{"asrl", one(0160240), one(0170770), "DdDs"},
-{"asrw", one(0160100), one(0170770), "QdDs"},
-{"asrw", one(0160140), one(0170770), "DdDs"},
-{"asrw", one(0160300), one(0177700), "~s"}, /* Shift memory */
-
-{"bhi", one(0061000), one(0177400), "Bg"},
-{"bls", one(0061400), one(0177400), "Bg"},
-{"bcc", one(0062000), one(0177400), "Bg"},
-{"bcs", one(0062400), one(0177400), "Bg"},
-{"bne", one(0063000), one(0177400), "Bg"},
-{"beq", one(0063400), one(0177400), "Bg"},
-{"bvc", one(0064000), one(0177400), "Bg"},
-{"bvs", one(0064400), one(0177400), "Bg"},
-{"bpl", one(0065000), one(0177400), "Bg"},
-{"bmi", one(0065400), one(0177400), "Bg"},
-{"bge", one(0066000), one(0177400), "Bg"},
-{"blt", one(0066400), one(0177400), "Bg"},
-{"bgt", one(0067000), one(0177400), "Bg"},
-{"ble", one(0067400), one(0177400), "Bg"},
-
-{"bchg", one(0000500), one(0170700), "Dd$s"},
-{"bchg", one(0004100), one(0177700), "#b$s"},
-{"bclr", one(0000600), one(0170700), "Dd$s"},
-{"bclr", one(0004200), one(0177700), "#b$s"},
-{"bfchg", two(0165300, 0), two(0177700, 0170000), "?sO2O3"},
-{"bfclr", two(0166300, 0), two(0177700, 0170000), "?sO2O3"},
-{"bfexts", two(0165700, 0), two(0177700, 0100000), "/sO2O3D1"},
-{"bfextu", two(0164700, 0), two(0177700, 0100000), "/sO2O3D1"},
-{"bfffo", two(0166700, 0), two(0177700, 0100000), "/sO2O3D1"},
-{"bfins", two(0167700, 0), two(0177700, 0100000), "D1?sO2O3"},
-{"bfset", two(0167300, 0), two(0177700, 0170000), "?sO2O3"},
-{"bftst", two(0164300, 0), two(0177700, 0170000), "/sO2O3"},
-{"bset", one(0000700), one(0170700), "Dd$s"},
-{"bset", one(0004300), one(0177700), "#b$s"},
-{"btst", one(0000400), one(0170700), "Dd@s"},
-{"btst", one(0004000), one(0177700), "#b@s"},
-
-{"bkpt", one(0044110), one(0177770), "Qs"},
-{"bra", one(0060000), one(0177400), "Bg"},
-{"bras", one(0060000), one(0177400), "Bw"},
-{"bsr", one(0060400), one(0177400), "Bg"},
-{"bsrs", one(0060400), one(0177400), "Bw"},
-
-{"callm", one(0003300), one(0177700), "#b!s"},
-{"cas2l", two(0007374, 0), two(0177777, 0107070), "D3D6D2D5R1R4"}, /* JF FOO this is really a 3 word ins */
-{"cas2w", two(0006374, 0), two(0177777, 0107070), "D3D6D2D5R1R4"}, /* JF ditto */
-{"casb", two(0005300, 0), two(0177700, 0177070), "D3D2~s"},
-{"casl", two(0007300, 0), two(0177700, 0177070), "D3D2~s"},
-{"casw", two(0006300, 0), two(0177700, 0177070), "D3D2~s"},
-
-/* {"chk", one(0040600), one(0170700), ";wDd"}, JF FOO this looks wrong */
-{"chk2b", two(0000300, 0004000), two(0177700, 07777), "!sR1"},
-{"chk2l", two(0002300, 0004000), two(0177700, 07777), "!sR1"},
-{"chk2w", two(0001300, 0004000), two(0177700, 07777), "!sR1"},
-{"chkl", one(0040400), one(0170700), ";lDd"},
-{"chkw", one(0040600), one(0170700), ";wDd"},
-{"clrb", one(0041000), one(0177700), "$s"},
-{"clrl", one(0041200), one(0177700), "$s"},
-{"clrw", one(0041100), one(0177700), "$s"},
-
-{"cmp2b", two(0000300, 0), two(0177700, 07777), "!sR1"},
-{"cmp2l", two(0002300, 0), two(0177700, 07777), "!sR1"},
-{"cmp2w", two(0001300, 0), two(0177700, 07777), "!sR1"},
-{"cmpal", one(0130700), one(0170700), "*lAd"},
-{"cmpaw", one(0130300), one(0170700), "*wAd"},
-{"cmpib", one(0006000), one(0177700), "#b;b"},
-{"cmpil", one(0006200), one(0177700), "#l;l"},
-{"cmpiw", one(0006100), one(0177700), "#w;w"},
-{"cmpb", one(0006000), one(0177700), "#b;b"}, /* cmpi written as cmp */
-{"cmpb", one(0130000), one(0170700), ";bDd"},
-{"cmpw", one(0006100), one(0177700), "#w;w"},
-{"cmpw", one(0130100), one(0170700), "*wDd"},
-{"cmpw", one(0130300), one(0170700), "*wAd"}, /* cmpa written as cmp */
-{"cmpl", one(0006200), one(0177700), "#l;l"},
-{"cmpl", one(0130200), one(0170700), "*lDd"},
-{"cmpl", one(0130700), one(0170700), "*lAd"},
-{"cmpmb", one(0130410), one(0170770), "+s+d"},
-{"cmpml", one(0130610), one(0170770), "+s+d"},
-{"cmpmw", one(0130510), one(0170770), "+s+d"},
-
-{"dbcc", one(0052310), one(0177770), "DsBw"},
-{"dbcs", one(0052710), one(0177770), "DsBw"},
-{"dbeq", one(0053710), one(0177770), "DsBw"},
-{"dbf", one(0050710), one(0177770), "DsBw"},
-{"dbge", one(0056310), one(0177770), "DsBw"},
-{"dbgt", one(0057310), one(0177770), "DsBw"},
-{"dbhi", one(0051310), one(0177770), "DsBw"},
-{"dble", one(0057710), one(0177770), "DsBw"},
-{"dbls", one(0051710), one(0177770), "DsBw"},
-{"dblt", one(0056710), one(0177770), "DsBw"},
-{"dbmi", one(0055710), one(0177770), "DsBw"},
-{"dbne", one(0053310), one(0177770), "DsBw"},
-{"dbpl", one(0055310), one(0177770), "DsBw"},
-{"dbra", one(0050710), one(0177770), "DsBw"},
-{"dbt", one(0050310), one(0177770), "DsBw"},
-{"dbvc", one(0054310), one(0177770), "DsBw"},
-{"dbvs", one(0054710), one(0177770), "DsBw"},
-
-{"divsl", two(0046100, 0006000), two(0177700, 0107770), ";lD3D1"},
-{"divsl", two(0046100, 0004000), two(0177700, 0107770), ";lDD"},
-{"divsll", two(0046100, 0004000), two(0177700, 0107770), ";lD3D1"},
-{"divsw", one(0100700), one(0170700), ";wDd"},
-{"divs", one(0100700), one(0170700), ";wDd"},
-{"divul", two(0046100, 0002000), two(0177700, 0107770), ";lD3D1"},
-{"divul", two(0046100, 0000000), two(0177700, 0107770), ";lDD"},
-{"divull", two(0046100, 0000000), two(0177700, 0107770), ";lD3D1"},
-{"divuw", one(0100300), one(0170700), ";wDd"},
-{"divu", one(0100300), one(0170700), ";wDd"},
-{"eorb", one(0005000), one(0177700), "#b$s"}, /* eori written as or */
-{"eorb", one(0005074), one(0177777), "#bCs"}, /* eori to ccr */
-{"eorb", one(0130400), one(0170700), "Dd$s"}, /* register to memory */
-{"eorib", one(0005000), one(0177700), "#b$s"},
-{"eorib", one(0005074), one(0177777), "#bCs"}, /* eori to ccr */
-{"eoril", one(0005200), one(0177700), "#l$s"},
-{"eoriw", one(0005100), one(0177700), "#w$s"},
-{"eoriw", one(0005174), one(0177777), "#wSs"}, /* eori to sr */
-{"eorl", one(0005200), one(0177700), "#l$s"},
-{"eorl", one(0130600), one(0170700), "Dd$s"},
-{"eorw", one(0005100), one(0177700), "#w$s"},
-{"eorw", one(0005174), one(0177777), "#wSs"}, /* eori to sr */
-{"eorw", one(0130500), one(0170700), "Dd$s"},
-
-{"exg", one(0140500), one(0170770), "DdDs"},
-{"exg", one(0140510), one(0170770), "AdAs"},
-{"exg", one(0140610), one(0170770), "DdAs"},
-{"exg", one(0140610), one(0170770), "AsDd"},
-
-{"extw", one(0044200), one(0177770), "Ds"},
-{"extl", one(0044300), one(0177770), "Ds"},
-{"extbl", one(0044700), one(0177770), "Ds"},
-{"extb.l", one(0044700), one(0177770), "Ds"}, /* Not sure we should support this one*/
-
-{"illegal", one(0045374), one(0177777), ""},
-{"jmp", one(0047300), one(0177700), "!s"},
-{"jsr", one(0047200), one(0177700), "!s"},
-{"lea", one(0040700), one(0170700), "!sAd"},
-{"linkw", one(0047120), one(0177770), "As#w"},
-{"linkl", one(0044010), one(0177770), "As#l"},
-{"link", one(0047120), one(0177770), "As#w"},
-{"link", one(0044010), one(0177770), "As#l"},
-
-{"lslb", one(0160410), one(0170770), "QdDs"}, /* lsrb #Q, Ds */
-{"lslb", one(0160450), one(0170770), "DdDs"}, /* lsrb Dd, Ds */
-{"lslw", one(0160510), one(0170770), "QdDs"}, /* lsrb #Q, Ds */
-{"lslw", one(0160550), one(0170770), "DdDs"}, /* lsrb Dd, Ds */
-{"lslw", one(0161700), one(0177700), "~s"}, /* Shift memory */
-{"lsll", one(0160610), one(0170770), "QdDs"}, /* lsrb #Q, Ds */
-{"lsll", one(0160650), one(0170770), "DdDs"}, /* lsrb Dd, Ds */
-
-{"lsrb", one(0160010), one(0170770), "QdDs"} /* lsrb #Q, Ds */,
-{"lsrb", one(0160050), one(0170770), "DdDs"}, /* lsrb Dd, Ds */
-{"lsrl", one(0160210), one(0170770), "QdDs"}, /* lsrb #Q, Ds */
-{"lsrl", one(0160250), one(0170770), "DdDs"}, /* lsrb #Q, Ds */
-{"lsrw", one(0160110), one(0170770), "QdDs"}, /* lsrb #Q, Ds */
-{"lsrw", one(0160150), one(0170770), "DdDs"}, /* lsrb #Q, Ds */
-{"lsrw", one(0161300), one(0177700), "~s"}, /* Shift memory */
-
-{"moveal", one(0020100), one(0170700), "*lAd"},
-{"moveaw", one(0030100), one(0170700), "*wAd"},
-{"moveb", one(0010000), one(0170000), ";b$d"}, /* move */
-{"movel", one(0070000), one(0170400), "MsDd"}, /* moveq written as move */
-{"movel", one(0020000), one(0170000), "*l$d"},
-{"movel", one(0020100), one(0170700), "*lAd"},
-{"movel", one(0047140), one(0177770), "AsUd"}, /* move to USP */
-{"movel", one(0047150), one(0177770), "UdAs"}, /* move from USP */
-
-{"movec", one(0047173), one(0177777), "R1Jj"},
-{"movec", one(0047173), one(0177777), "R1#j"},
-{"movec", one(0047172), one(0177777), "JjR1"},
-{"movec", one(0047172), one(0177777), "#jR1"},
-
-/* JF added these next four for the assembler */
-{"moveml", one(0044300), one(0177700), "Lw&s"}, /* movem reg to mem. */
-{"moveml", one(0044340), one(0177770), "lw-s"}, /* movem reg to autodecrement. */
-{"moveml", one(0046300), one(0177700), "!sLw"}, /* movem mem to reg. */
-{"moveml", one(0046330), one(0177770), "+sLw"}, /* movem autoinc to reg. */
-
-{"moveml", one(0044300), one(0177700), "#w&s"}, /* movem reg to mem. */
-{"moveml", one(0044340), one(0177770), "#w-s"}, /* movem reg to autodecrement. */
-{"moveml", one(0046300), one(0177700), "!s#w"}, /* movem mem to reg. */
-{"moveml", one(0046330), one(0177770), "+s#w"}, /* movem autoinc to reg. */
-
-/* JF added these next four for the assembler */
-{"movemw", one(0044200), one(0177700), "Lw&s"}, /* movem reg to mem. */
-{"movemw", one(0044240), one(0177770), "lw-s"}, /* movem reg to autodecrement. */
-{"movemw", one(0046200), one(0177700), "!sLw"}, /* movem mem to reg. */
-{"movemw", one(0046230), one(0177770), "+sLw"}, /* movem autoinc to reg. */
-
-{"movemw", one(0044200), one(0177700), "#w&s"}, /* movem reg to mem. */
-{"movemw", one(0044240), one(0177770), "#w-s"}, /* movem reg to autodecrement. */
-{"movemw", one(0046200), one(0177700), "!s#w"}, /* movem mem to reg. */
-{"movemw", one(0046230), one(0177770), "+s#w"}, /* movem autoinc to reg. */
-
-{"movepl", one(0000510), one(0170770), "dsDd"}, /* memory to register */
-{"movepl", one(0000710), one(0170770), "Ddds"}, /* register to memory */
-{"movepw", one(0000410), one(0170770), "dsDd"}, /* memory to register */
-{"movepw", one(0000610), one(0170770), "Ddds"}, /* register to memory */
-{"moveq", one(0070000), one(0170400), "MsDd"},
-{"movew", one(0030000), one(0170000), "*w$d"},
-{"movew", one(0030100), one(0170700), "*wAd"}, /* movea, written as move */
-{"movew", one(0040300), one(0177700), "Ss$s"}, /* Move from sr */
-{"movew", one(0041300), one(0177700), "Cs$s"}, /* Move from ccr */
-{"movew", one(0042300), one(0177700), ";wCd"}, /* move to ccr */
-{"movew", one(0043300), one(0177700), ";wSd"}, /* move to sr */
-
-{"movesb", two(0007000, 0), two(0177700, 07777), "~sR1"}, /* moves from memory */
-{"movesb", two(0007000, 04000), two(0177700, 07777), "R1~s"}, /* moves to memory */
-{"movesl", two(0007200, 0), two(0177700, 07777), "~sR1"}, /* moves from memory */
-{"movesl", two(0007200, 04000), two(0177700, 07777), "R1~s"}, /* moves to memory */
-{"movesw", two(0007100, 0), two(0177700, 07777), "~sR1"}, /* moves from memory */
-{"movesw", two(0007100, 04000), two(0177700, 07777), "R1~s"}, /* moves to memory */
-
-{"mulsl", two(0046000, 004000), two(0177700, 0107770), ";lD1"},
-{"mulsl", two(0046000, 006000), two(0177700, 0107770), ";lD3D1"},
-{"mulsw", one(0140700), one(0170700), ";wDd"},
-{"muls", one(0140700), one(0170700), ";wDd"},
-{"mulul", two(0046000, 000000), two(0177700, 0107770), ";lD1"},
-{"mulul", two(0046000, 002000), two(0177700, 0107770), ";lD3D1"},
-{"muluw", one(0140300), one(0170700), ";wDd"},
-{"mulu", one(0140300), one(0170700), ";wDd"},
-{"nbcd", one(0044000), one(0177700), "$s"},
-{"negb", one(0042000), one(0177700), "$s"},
-{"negl", one(0042200), one(0177700), "$s"},
-{"negw", one(0042100), one(0177700), "$s"},
-{"negxb", one(0040000), one(0177700), "$s"},
-{"negxl", one(0040200), one(0177700), "$s"},
-{"negxw", one(0040100), one(0177700), "$s"},
-{"nop", one(0047161), one(0177777), ""},
-{"notb", one(0043000), one(0177700), "$s"},
-{"notl", one(0043200), one(0177700), "$s"},
-{"notw", one(0043100), one(0177700), "$s"},
-
-{"orb", one(0000000), one(0177700), "#b$s"}, /* ori written as or */
-{"orb", one(0000074), one(0177777), "#bCs"}, /* ori to ccr */
-{"orb", one(0100000), one(0170700), ";bDd"}, /* memory to register */
-{"orb", one(0100400), one(0170700), "Dd~s"}, /* register to memory */
-{"orib", one(0000000), one(0177700), "#b$s"},
-{"orib", one(0000074), one(0177777), "#bCs"}, /* ori to ccr */
-{"oril", one(0000200), one(0177700), "#l$s"},
-{"oriw", one(0000100), one(0177700), "#w$s"},
-{"oriw", one(0000174), one(0177777), "#wSs"}, /* ori to sr */
-{"orl", one(0000200), one(0177700), "#l$s"},
-{"orl", one(0100200), one(0170700), ";lDd"}, /* memory to register */
-{"orl", one(0100600), one(0170700), "Dd~s"}, /* register to memory */
-{"orw", one(0000100), one(0177700), "#w$s"},
-{"orw", one(0000174), one(0177777), "#wSs"}, /* ori to sr */
-{"orw", one(0100100), one(0170700), ";wDd"}, /* memory to register */
-{"orw", one(0100500), one(0170700), "Dd~s"}, /* register to memory */
-
-{"pack", one(0100500), one(0170770), "DsDd#w"}, /* pack Ds, Dd, #w */
-{"pack", one(0100510), one(0170770), "-s-d#w"}, /* pack -(As), -(Ad), #w */
-{"pea", one(0044100), one(0177700), "!s"},
-{"reset", one(0047160), one(0177777), ""},
-
-{"rolb", one(0160430), one(0170770), "QdDs"}, /* rorb #Q, Ds */
-{"rolb", one(0160470), one(0170770), "DdDs"}, /* rorb Dd, Ds */
-{"roll", one(0160630), one(0170770), "QdDs"}, /* rorb #Q, Ds */
-{"roll", one(0160670), one(0170770), "DdDs"}, /* rorb Dd, Ds */
-{"rolw", one(0160530), one(0170770), "QdDs"}, /* rorb #Q, Ds */
-{"rolw", one(0160570), one(0170770), "DdDs"}, /* rorb Dd, Ds */
-{"rolw", one(0163700), one(0177700), "~s"}, /* Rotate memory */
-{"rorb", one(0160030), one(0170770), "QdDs"}, /* rorb #Q, Ds */
-{"rorb", one(0160070), one(0170770), "DdDs"}, /* rorb Dd, Ds */
-{"rorl", one(0160230), one(0170770), "QdDs"}, /* rorb #Q, Ds */
-{"rorl", one(0160270), one(0170770), "DdDs"}, /* rorb Dd, Ds */
-{"rorw", one(0160130), one(0170770), "QdDs"}, /* rorb #Q, Ds */
-{"rorw", one(0160170), one(0170770), "DdDs"}, /* rorb Dd, Ds */
-{"rorw", one(0163300), one(0177700), "~s"}, /* Rotate memory */
-
-{"roxlb", one(0160420), one(0170770), "QdDs"}, /* roxrb #Q, Ds */
-{"roxlb", one(0160460), one(0170770), "DdDs"}, /* roxrb Dd, Ds */
-{"roxll", one(0160620), one(0170770), "QdDs"}, /* roxrb #Q, Ds */
-{"roxll", one(0160660), one(0170770), "DdDs"}, /* roxrb Dd, Ds */
-{"roxlw", one(0160520), one(0170770), "QdDs"}, /* roxrb #Q, Ds */
-{"roxlw", one(0160560), one(0170770), "DdDs"}, /* roxrb Dd, Ds */
-{"roxlw", one(0162700), one(0177700), "~s"}, /* Rotate memory */
-{"roxrb", one(0160020), one(0170770), "QdDs"}, /* roxrb #Q, Ds */
-{"roxrb", one(0160060), one(0170770), "DdDs"}, /* roxrb Dd, Ds */
-{"roxrl", one(0160220), one(0170770), "QdDs"}, /* roxrb #Q, Ds */
-{"roxrl", one(0160260), one(0170770), "DdDs"}, /* roxrb Dd, Ds */
-{"roxrw", one(0160120), one(0170770), "QdDs"}, /* roxrb #Q, Ds */
-{"roxrw", one(0160160), one(0170770), "DdDs"}, /* roxrb Dd, Ds */
-{"roxrw", one(0162300), one(0177700), "~s"}, /* Rotate memory */
-
-{"rtd", one(0047164), one(0177777), "#w"},
-{"rte", one(0047163), one(0177777), ""},
-{"rtm", one(0003300), one(0177760), "Rs"},
-{"rtr", one(0047167), one(0177777), ""},
-{"rts", one(0047165), one(0177777), ""},
-
-{"scc", one(0052300), one(0177700), "$s"},
-{"scs", one(0052700), one(0177700), "$s"},
-{"seq", one(0053700), one(0177700), "$s"},
-{"sf", one(0050700), one(0177700), "$s"},
-{"sge", one(0056300), one(0177700), "$s"},
-{"sgt", one(0057300), one(0177700), "$s"},
-{"shi", one(0051300), one(0177700), "$s"},
-{"sle", one(0057700), one(0177700), "$s"},
-{"sls", one(0051700), one(0177700), "$s"},
-{"slt", one(0056700), one(0177700), "$s"},
-{"smi", one(0055700), one(0177700), "$s"},
-{"sne", one(0053300), one(0177700), "$s"},
-{"spl", one(0055300), one(0177700), "$s"},
-{"st", one(0050300), one(0177700), "$s"},
-{"svc", one(0054300), one(0177700), "$s"},
-{"svs", one(0054700), one(0177700), "$s"},
-
-{"sbcd", one(0100400), one(0170770), "DsDd"},
-{"sbcd", one(0100410), one(0170770), "-s-d"},
-{"stop", one(0047162), one(0177777), "#w"},
-
-{"subal", one(0110700), one(0170700), "*lAd"},
-{"subaw", one(0110300), one(0170700), "*wAd"},
-{"subb", one(0050400), one(0170700), "Qd%s"}, /* subq written as sub */
-{"subb", one(0002000), one(0177700), "#b$s"}, /* subi written as sub */
-{"subb", one(0110000), one(0170700), ";bDd"}, /* subb ? ?, Dd */
-{"subb", one(0110400), one(0170700), "Dd~s"}, /* subb Dd, ? ? */
-{"subib", one(0002000), one(0177700), "#b$s"},
-{"subil", one(0002200), one(0177700), "#l$s"},
-{"subiw", one(0002100), one(0177700), "#w$s"},
-{"subl", one(0050600), one(0170700), "Qd%s"},
-{"subl", one(0002200), one(0177700), "#l$s"},
-{"subl", one(0110700), one(0170700), "*lAd"},
-{"subl", one(0110200), one(0170700), "*lDd"},
-{"subl", one(0110600), one(0170700), "Dd~s"},
-{"subqb", one(0050400), one(0170700), "Qd%s"},
-{"subql", one(0050600), one(0170700), "Qd%s"},
-{"subqw", one(0050500), one(0170700), "Qd%s"},
-{"subw", one(0050500), one(0170700), "Qd%s"},
-{"subw", one(0002100), one(0177700), "#w$s"},
-{"subw", one(0110100), one(0170700), "*wDd"},
-{"subw", one(0110300), one(0170700), "*wAd"}, /* suba written as sub */
-{"subw", one(0110500), one(0170700), "Dd~s"},
-{"subxb", one(0110400), one(0170770), "DsDd"}, /* subxb Ds, Dd */
-{"subxb", one(0110410), one(0170770), "-s-d"}, /* subxb -(As), -(Ad) */
-{"subxl", one(0110600), one(0170770), "DsDd"},
-{"subxl", one(0110610), one(0170770), "-s-d"},
-{"subxw", one(0110500), one(0170770), "DsDd"},
-{"subxw", one(0110510), one(0170770), "-s-d"},
-
-{"swap", one(0044100), one(0177770), "Ds"},
-
-{"tas", one(0045300), one(0177700), "$s"},
-{"trap", one(0047100), one(0177760), "Ts"},
-
-{"trapcc", one(0052374), one(0177777), ""},
-{"trapcs", one(0052774), one(0177777), ""},
-{"trapeq", one(0053774), one(0177777), ""},
-{"trapf", one(0050774), one(0177777), ""},
-{"trapge", one(0056374), one(0177777), ""},
-{"trapgt", one(0057374), one(0177777), ""},
-{"traphi", one(0051374), one(0177777), ""},
-{"traple", one(0057774), one(0177777), ""},
-{"trapls", one(0051774), one(0177777), ""},
-{"traplt", one(0056774), one(0177777), ""},
-{"trapmi", one(0055774), one(0177777), ""},
-{"trapne", one(0053374), one(0177777), ""},
-{"trappl", one(0055374), one(0177777), ""},
-{"trapt", one(0050374), one(0177777), ""},
-{"trapvc", one(0054374), one(0177777), ""},
-{"trapvs", one(0054774), one(0177777), ""},
-
-{"trapcc.w", one(0052372), one(0177777), ""},
-{"trapcs.w", one(0052772), one(0177777), ""},
-{"trapeq.w", one(0053772), one(0177777), ""},
-{"trapf.w", one(0050772), one(0177777), ""},
-{"trapge.w", one(0056372), one(0177777), ""},
-{"trapgt.w", one(0057372), one(0177777), ""},
-{"traphi.w", one(0051372), one(0177777), ""},
-{"traple.w", one(0057772), one(0177777), ""},
-{"trapls.w", one(0051772), one(0177777), ""},
-{"traplt.w", one(0056772), one(0177777), ""},
-{"trapmi.w", one(0055772), one(0177777), ""},
-{"trapne.w", one(0053372), one(0177777), ""},
-{"trappl.w", one(0055372), one(0177777), ""},
-{"trapt.w", one(0050372), one(0177777), ""},
-{"trapvc.w", one(0054372), one(0177777), ""},
-{"trapvs.w", one(0054772), one(0177777), ""},
-
-{"trapcc.l", one(0052373), one(0177777), ""},
-{"trapcs.l", one(0052773), one(0177777), ""},
-{"trapeq.l", one(0053773), one(0177777), ""},
-{"trapf.l", one(0050773), one(0177777), ""},
-{"trapge.l", one(0056373), one(0177777), ""},
-{"trapgt.l", one(0057373), one(0177777), ""},
-{"traphi.l", one(0051373), one(0177777), ""},
-{"traple.l", one(0057773), one(0177777), ""},
-{"trapls.l", one(0051773), one(0177777), ""},
-{"traplt.l", one(0056773), one(0177777), ""},
-{"trapmi.l", one(0055773), one(0177777), ""},
-{"trapne.l", one(0053373), one(0177777), ""},
-{"trappl.l", one(0055373), one(0177777), ""},
-{"trapt.l", one(0050373), one(0177777), ""},
-{"trapvc.l", one(0054373), one(0177777), ""},
-{"trapvs.l", one(0054773), one(0177777), ""},
-
-{"trapv", one(0047166), one(0177777), ""},
-
-{"tstb", one(0045000), one(0177700), ";b"},
-{"tstw", one(0045100), one(0177700), "*w"},
-{"tstl", one(0045200), one(0177700), "*l"},
-
-{"unlk", one(0047130), one(0177770), "As"},
-{"unpk", one(0100600), one(0170770), "DsDd#w"},
-{"unpk", one(0100610), one(0170770), "-s-d#w"},
- /* JF floating pt stuff moved down here */
-
-{"fabsb", two(0xF000, 0x5818), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fabsd", two(0xF000, 0x5418), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fabsl", two(0xF000, 0x4018), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fabsp", two(0xF000, 0x4C18), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fabss", two(0xF000, 0x4418), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fabsw", two(0xF000, 0x5018), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fabsx", two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fabsx", two(0xF000, 0x4818), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fabsx", two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"facosb", two(0xF000, 0x581C), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"facosd", two(0xF000, 0x541C), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"facosl", two(0xF000, 0x401C), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"facosp", two(0xF000, 0x4C1C), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"facoss", two(0xF000, 0x441C), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"facosw", two(0xF000, 0x501C), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"facosx", two(0xF000, 0x001C), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"facosx", two(0xF000, 0x481C), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"facosx", two(0xF000, 0x001C), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"faddb", two(0xF000, 0x5822), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"faddd", two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"faddl", two(0xF000, 0x4022), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"faddp", two(0xF000, 0x4C22), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fadds", two(0xF000, 0x4422), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"faddw", two(0xF000, 0x5022), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"faddx", two(0xF000, 0x0022), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"faddx", two(0xF000, 0x4822), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-/* {"faddx", two(0xF000, 0x0022), two(0xF1C0, 0xE07F), "IiFt"}, JF removed */
-
-{"fasinb", two(0xF000, 0x580C), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fasind", two(0xF000, 0x540C), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fasinl", two(0xF000, 0x400C), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fasinp", two(0xF000, 0x4C0C), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fasins", two(0xF000, 0x440C), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fasinw", two(0xF000, 0x500C), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fasinx", two(0xF000, 0x000C), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fasinx", two(0xF000, 0x480C), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fasinx", two(0xF000, 0x000C), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fatanb", two(0xF000, 0x580A), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fatand", two(0xF000, 0x540A), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fatanl", two(0xF000, 0x400A), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fatanp", two(0xF000, 0x4C0A), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fatans", two(0xF000, 0x440A), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fatanw", two(0xF000, 0x500A), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fatanx", two(0xF000, 0x000A), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fatanx", two(0xF000, 0x480A), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fatanx", two(0xF000, 0x000A), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fatanhb", two(0xF000, 0x580D), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fatanhd", two(0xF000, 0x540D), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fatanhl", two(0xF000, 0x400D), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fatanhp", two(0xF000, 0x4C0D), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fatanhs", two(0xF000, 0x440D), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fatanhw", two(0xF000, 0x500D), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fatanhx", two(0xF000, 0x000D), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fatanhx", two(0xF000, 0x480D), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fatanhx", two(0xF000, 0x000D), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fbeq", one(0xF081), one(0xF1BF), "IdBc"},
-{"fbf", one(0xF080), one(0xF1BF), "IdBc"},
-{"fbge", one(0xF093), one(0xF1BF), "IdBc"},
-{"fbgl", one(0xF096), one(0xF1BF), "IdBc"},
-{"fbgle", one(0xF097), one(0xF1BF), "IdBc"},
-{"fbgt", one(0xF092), one(0xF1BF), "IdBc"},
-{"fble", one(0xF095), one(0xF1BF), "IdBc"},
-{"fblt", one(0xF094), one(0xF1BF), "IdBc"},
-{"fbne", one(0xF08E), one(0xF1BF), "IdBc"},
-{"fbnge", one(0xF09C), one(0xF1BF), "IdBc"},
-{"fbngl", one(0xF099), one(0xF1BF), "IdBc"},
-{"fbngle", one(0xF098), one(0xF1BF), "IdBc"},
-{"fbngt", one(0xF09D), one(0xF1BF), "IdBc"},
-{"fbnle", one(0xF09A), one(0xF1BF), "IdBc"},
-{"fbnlt", one(0xF09B), one(0xF1BF), "IdBc"},
-{"fboge", one(0xF083), one(0xF1BF), "IdBc"},
-{"fbogl", one(0xF086), one(0xF1BF), "IdBc"},
-{"fbogt", one(0xF082), one(0xF1BF), "IdBc"},
-{"fbole", one(0xF085), one(0xF1BF), "IdBc"},
-{"fbolt", one(0xF084), one(0xF1BF), "IdBc"},
-{"fbor", one(0xF087), one(0xF1BF), "IdBc"},
-{"fbseq", one(0xF091), one(0xF1BF), "IdBc"},
-{"fbsf", one(0xF090), one(0xF1BF), "IdBc"},
-{"fbsne", one(0xF09E), one(0xF1BF), "IdBc"},
-{"fbst", one(0xF09F), one(0xF1BF), "IdBc"},
-{"fbt", one(0xF08F), one(0xF1BF), "IdBc"},
-{"fbueq", one(0xF089), one(0xF1BF), "IdBc"},
-{"fbuge", one(0xF08B), one(0xF1BF), "IdBc"},
-{"fbugt", one(0xF08A), one(0xF1BF), "IdBc"},
-{"fbule", one(0xF08D), one(0xF1BF), "IdBc"},
-{"fbult", one(0xF08C), one(0xF1BF), "IdBc"},
-{"fbun", one(0xF088), one(0xF1BF), "IdBc"},
-
-{"fcmpb", two(0xF000, 0x5838), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fcmpd", two(0xF000, 0x5438), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fcmpl", two(0xF000, 0x4038), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fcmpp", two(0xF000, 0x4C38), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fcmps", two(0xF000, 0x4438), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fcmpw", two(0xF000, 0x5038), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fcmpx", two(0xF000, 0x0038), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fcmpx", two(0xF000, 0x4838), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-/* {"fcmpx", two(0xF000, 0x0038), two(0xF1C0, 0xE07F), "IiFt"}, JF removed */
-
-{"fcosb", two(0xF000, 0x581D), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fcosd", two(0xF000, 0x541D), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fcosl", two(0xF000, 0x401D), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fcosp", two(0xF000, 0x4C1D), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fcoss", two(0xF000, 0x441D), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fcosw", two(0xF000, 0x501D), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fcosx", two(0xF000, 0x001D), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fcosx", two(0xF000, 0x481D), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fcosx", two(0xF000, 0x001D), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fcoshb", two(0xF000, 0x5819), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fcoshd", two(0xF000, 0x5419), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fcoshl", two(0xF000, 0x4019), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fcoshp", two(0xF000, 0x4C19), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fcoshs", two(0xF000, 0x4419), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fcoshw", two(0xF000, 0x5019), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fcoshx", two(0xF000, 0x0019), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fcoshx", two(0xF000, 0x4819), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fcoshx", two(0xF000, 0x0019), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fdbeq", two(0xF048, 0x0001), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbf", two(0xF048, 0x0000), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbge", two(0xF048, 0x0013), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbgl", two(0xF048, 0x0016), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbgle", two(0xF048, 0x0017), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbgt", two(0xF048, 0x0012), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdble", two(0xF048, 0x0015), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdblt", two(0xF048, 0x0014), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbne", two(0xF048, 0x000E), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbnge", two(0xF048, 0x001C), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbngl", two(0xF048, 0x0019), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbngle", two(0xF048, 0x0018), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbngt", two(0xF048, 0x001D), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbnle", two(0xF048, 0x001A), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbnlt", two(0xF048, 0x001B), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdboge", two(0xF048, 0x0003), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbogl", two(0xF048, 0x0006), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbogt", two(0xF048, 0x0002), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbole", two(0xF048, 0x0005), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbolt", two(0xF048, 0x0004), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbor", two(0xF048, 0x0007), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbseq", two(0xF048, 0x0011), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbsf", two(0xF048, 0x0010), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbsne", two(0xF048, 0x001E), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbst", two(0xF048, 0x001F), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbt", two(0xF048, 0x000F), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbueq", two(0xF048, 0x0009), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbuge", two(0xF048, 0x000B), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbugt", two(0xF048, 0x000A), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbule", two(0xF048, 0x000D), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbult", two(0xF048, 0x000C), two(0xF1F8, 0xFFFF), "IiDsBw"},
-{"fdbun", two(0xF048, 0x0008), two(0xF1F8, 0xFFFF), "IiDsBw"},
-
-{"fdivb", two(0xF000, 0x5820), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fdivd", two(0xF000, 0x5420), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fdivl", two(0xF000, 0x4020), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fdivp", two(0xF000, 0x4C20), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fdivs", two(0xF000, 0x4420), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fdivw", two(0xF000, 0x5020), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fdivx", two(0xF000, 0x0020), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fdivx", two(0xF000, 0x4820), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-/* {"fdivx", two(0xF000, 0x0020), two(0xF1C0, 0xE07F), "IiFt"}, JF */
-
-{"fetoxb", two(0xF000, 0x5810), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fetoxd", two(0xF000, 0x5410), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fetoxl", two(0xF000, 0x4010), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fetoxp", two(0xF000, 0x4C10), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fetoxs", two(0xF000, 0x4410), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fetoxw", two(0xF000, 0x5010), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fetoxx", two(0xF000, 0x0010), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fetoxx", two(0xF000, 0x4810), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fetoxx", two(0xF000, 0x0010), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fetoxm1b", two(0xF000, 0x5808), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fetoxm1d", two(0xF000, 0x5408), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fetoxm1l", two(0xF000, 0x4008), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fetoxm1p", two(0xF000, 0x4C08), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fetoxm1s", two(0xF000, 0x4408), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fetoxm1w", two(0xF000, 0x5008), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fetoxm1x", two(0xF000, 0x0008), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fetoxm1x", two(0xF000, 0x4808), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fetoxm1x", two(0xF000, 0x0008), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fgetexpb", two(0xF000, 0x581E), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fgetexpd", two(0xF000, 0x541E), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fgetexpl", two(0xF000, 0x401E), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fgetexpp", two(0xF000, 0x4C1E), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fgetexps", two(0xF000, 0x441E), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fgetexpw", two(0xF000, 0x501E), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fgetexpx", two(0xF000, 0x001E), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fgetexpx", two(0xF000, 0x481E), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fgetexpx", two(0xF000, 0x001E), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fgetmanb", two(0xF000, 0x581F), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fgetmand", two(0xF000, 0x541F), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fgetmanl", two(0xF000, 0x401F), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fgetmanp", two(0xF000, 0x4C1F), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fgetmans", two(0xF000, 0x441F), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fgetmanw", two(0xF000, 0x501F), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fgetmanx", two(0xF000, 0x001F), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fgetmanx", two(0xF000, 0x481F), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fgetmanx", two(0xF000, 0x001F), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fintb", two(0xF000, 0x5801), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fintd", two(0xF000, 0x5401), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fintl", two(0xF000, 0x4001), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fintp", two(0xF000, 0x4C01), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fints", two(0xF000, 0x4401), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fintw", two(0xF000, 0x5001), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fintx", two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fintx", two(0xF000, 0x4801), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fintx", two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fintrzb", two(0xF000, 0x5803), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fintrzd", two(0xF000, 0x5403), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fintrzl", two(0xF000, 0x4003), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fintrzp", two(0xF000, 0x4C03), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fintrzs", two(0xF000, 0x4403), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fintrzw", two(0xF000, 0x5003), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fintrzx", two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fintrzx", two(0xF000, 0x4803), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fintrzx", two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"flog10b", two(0xF000, 0x5815), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"flog10d", two(0xF000, 0x5415), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"flog10l", two(0xF000, 0x4015), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"flog10p", two(0xF000, 0x4C15), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"flog10s", two(0xF000, 0x4415), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"flog10w", two(0xF000, 0x5015), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"flog10x", two(0xF000, 0x0015), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"flog10x", two(0xF000, 0x4815), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"flog10x", two(0xF000, 0x0015), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"flog2b", two(0xF000, 0x5816), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"flog2d", two(0xF000, 0x5416), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"flog2l", two(0xF000, 0x4016), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"flog2p", two(0xF000, 0x4C16), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"flog2s", two(0xF000, 0x4416), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"flog2w", two(0xF000, 0x5016), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"flog2x", two(0xF000, 0x0016), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"flog2x", two(0xF000, 0x4816), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"flog2x", two(0xF000, 0x0016), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"flognb", two(0xF000, 0x5814), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"flognd", two(0xF000, 0x5414), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"flognl", two(0xF000, 0x4014), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"flognp", two(0xF000, 0x4C14), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"flogns", two(0xF000, 0x4414), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"flognw", two(0xF000, 0x5014), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"flognx", two(0xF000, 0x0014), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"flognx", two(0xF000, 0x4814), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"flognx", two(0xF000, 0x0014), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"flognp1b", two(0xF000, 0x5806), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"flognp1d", two(0xF000, 0x5406), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"flognp1l", two(0xF000, 0x4006), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"flognp1p", two(0xF000, 0x4C06), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"flognp1s", two(0xF000, 0x4406), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"flognp1w", two(0xF000, 0x5006), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"flognp1x", two(0xF000, 0x0006), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"flognp1x", two(0xF000, 0x4806), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"flognp1x", two(0xF000, 0x0006), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fmodb", two(0xF000, 0x5821), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fmodd", two(0xF000, 0x5421), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fmodl", two(0xF000, 0x4021), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fmodp", two(0xF000, 0x4C21), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fmods", two(0xF000, 0x4421), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fmodw", two(0xF000, 0x5021), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fmodx", two(0xF000, 0x0021), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fmodx", two(0xF000, 0x4821), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-/* {"fmodx", two(0xF000, 0x0021), two(0xF1C0, 0xE07F), "IiFt"}, JF */
-
-{"fmoveb", two(0xF000, 0x5800), two(0xF1C0, 0xFC7F), "Ii;bF7"}, /* fmove from <ea> to fp<n> */
-{"fmoveb", two(0xF000, 0x7800), two(0xF1C0, 0xFC7F), "IiF7@b"}, /* fmove from fp<n> to <ea> */
-{"fmoved", two(0xF000, 0x5400), two(0xF1C0, 0xFC7F), "Ii;FF7"}, /* fmove from <ea> to fp<n> */
-{"fmoved", two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7@F"}, /* fmove from fp<n> to <ea> */
-{"fmovel", two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "Ii;lF7"}, /* fmove from <ea> to fp<n> */
-{"fmovel", two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7@l"}, /* fmove from fp<n> to <ea> */
-/* Warning: The addressing modes on these are probably not right:
- esp, Areg direct is only allowed for FPI */
- /* fmove.l from/to system control registers: */
-{"fmovel", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8@s"},
-{"fmovel", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8"},
-
-/* {"fmovel", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8@s"},
-{"fmovel", two(0xF000, 0x8000), two(0xF2C0, 0xE3FF), "Ii*ss8"}, */
-
-{"fmovep", two(0xF000, 0x4C00), two(0xF1C0, 0xFC7F), "Ii;pF7"}, /* fmove from <ea> to fp<n> */
-{"fmovep", two(0xF000, 0x6C00), two(0xF1C0, 0xFC00), "IiF7@pkC"}, /* fmove.p with k-factors: */
-{"fmovep", two(0xF000, 0x7C00), two(0xF1C0, 0xFC0F), "IiF7@pDk"}, /* fmove.p with k-factors: */
-
-{"fmoves", two(0xF000, 0x4400), two(0xF1C0, 0xFC7F), "Ii;fF7"}, /* fmove from <ea> to fp<n> */
-{"fmoves", two(0xF000, 0x6400), two(0xF1C0, 0xFC7F), "IiF7@f"}, /* fmove from fp<n> to <ea> */
-{"fmovew", two(0xF000, 0x5000), two(0xF1C0, 0xFC7F), "Ii;wF7"}, /* fmove from <ea> to fp<n> */
-{"fmovew", two(0xF000, 0x7000), two(0xF1C0, 0xFC7F), "IiF7@w"}, /* fmove from fp<n> to <ea> */
-{"fmovex", two(0xF000, 0x0000), two(0xF1C0, 0xE07F), "IiF8F7"}, /* fmove from <ea> to fp<n> */
-{"fmovex", two(0xF000, 0x4800), two(0xF1C0, 0xFC7F), "Ii;xF7"}, /* fmove from <ea> to fp<n> */
-{"fmovex", two(0xF000, 0x6800), two(0xF1C0, 0xFC7F), "IiF7@x"}, /* fmove from fp<n> to <ea> */
-/* JF removed {"fmovex", two(0xF000, 0x0000), two(0xF1C0, 0xE07F), "IiFt"}, / * fmove from <ea> to fp<n> */
-
-{"fmovecrx", two(0xF000, 0x5C00), two(0xF1FF, 0xFC00), "Ii#CF7"}, /* fmovecr.x #ccc, FPn */
-{"fmovecr", two(0xF000, 0x5C00), two(0xF1FF, 0xFC00), "Ii#CF7"},
-
-/* Other fmovemx. */
-{"fmovemx", two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "IdL3-s"}, /* fmovem.x to autodecrement, static and dynamic */
-{"fmovemx", two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "Id#3-s"}, /* fmovem.x to autodecrement, static and dynamic */
-
-{"fmovemx", two(0xF020, 0xE800), two(0xF1F8, 0xFF8F), "IiDk-s"}, /* fmovem.x to autodecrement, static and dynamic */
-
-{"fmovemx", two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Id#3&s"}, /* fmovem.x to control, static and dynamic: */
-{"fmovemx", two(0xF000, 0xF800), two(0xF1C0, 0xFF8F), "IiDk&s"}, /* fmovem.x to control, static and dynamic: */
-{"fmovemx", two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&s#3"}, /* fmovem.x from control, static and dynamic: */
-{"fmovemx", two(0xF000, 0xD800), two(0xF1C0, 0xFF8F), "Ii&sDk"}, /* fmovem.x from control, static and dynamic: */
-{"fmovemx", two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Idl3&s"}, /* fmovem.x to control, static and dynamic: */
-{"fmovemx", two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&sl3"}, /* fmovem.x from control, static and dynamic: */
-
-{"fmovemx", two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+sl3"}, /* fmovem.x from autoincrement, static and dynamic: */
-{"fmovemx", two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+s#3"}, /* fmovem.x from autoincrement, static and dynamic: */
-{"fmovemx", two(0xF018, 0xD800), two(0xF1F8, 0xFF8F), "Ii+sDk"}, /* fmovem.x from autoincrement, static and dynamic: */
-
-{"fmoveml", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "IiL8@s"},
-{"fmoveml", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Ii#8@s"},
-{"fmoveml", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8@s"},
-
-{"fmoveml", two(0xF000, 0x8000), two(0xF2C0, 0xE3FF), "Ii*sL8"},
-{"fmoveml", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*s#8"},
-{"fmoveml", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ss8"},
-
-/* fmovemx with register lists */
-{"fmovem", two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "IdL3-s"}, /* fmovem.x to autodecrement, static and dynamic */
-{"fmovem", two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Idl3&s"}, /* fmovem.x to control, static and dynamic: */
-{"fmovem", two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+sl3"}, /* fmovem.x from autoincrement, static and dynamic: */
-{"fmovem", two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&sl3"}, /* fmovem.x from control, static and dynamic: */
-
- /* Alternate mnemonics for GNU as and GNU CC */
-{"fmovem", two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "Id#3-s"}, /* fmovem.x to autodecrement, static and dynamic */
-{"fmovem", two(0xF020, 0xE800), two(0xF1F8, 0xFF8F), "IiDk-s"}, /* fmovem.x to autodecrement, static and dynamic */
-
-{"fmovem", two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Id#3&s"}, /* fmovem.x to control, static and dynamic: */
-{"fmovem", two(0xF000, 0xF800), two(0xF1C0, 0xFF8F), "IiDk&s"}, /* fmovem.x to control, static and dynamic: */
-
-{"fmovem", two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+s#3"}, /* fmovem.x from autoincrement, static and dynamic: */
-{"fmovem", two(0xF018, 0xD800), two(0xF1F8, 0xFF8F), "Ii+sDk"}, /* fmovem.x from autoincrement, static and dynamic: */
-
-{"fmovem", two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&s#3"}, /* fmovem.x from control, static and dynamic: */
-{"fmovem", two(0xF000, 0xD800), two(0xF1C0, 0xFF8F), "Ii&sDk"}, /* fmovem.x from control, static and dynamic: */
-
-/* fmoveml a FP-control register */
-{"fmovem", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8@s"},
-{"fmovem", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ss8"},
-
-/* fmoveml a FP-control reglist */
-{"fmovem", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "IiL8@s"},
-{"fmovem", two(0xF000, 0x8000), two(0xF2C0, 0xE3FF), "Ii*sL8"},
-
-{"fmulb", two(0xF000, 0x5823), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fmuld", two(0xF000, 0x5423), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fmull", two(0xF000, 0x4023), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fmulp", two(0xF000, 0x4C23), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fmuls", two(0xF000, 0x4423), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fmulw", two(0xF000, 0x5023), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fmulx", two(0xF000, 0x0023), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fmulx", two(0xF000, 0x4823), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-/* {"fmulx", two(0xF000, 0x0023), two(0xF1C0, 0xE07F), "IiFt"}, JF */
-
-{"fnegb", two(0xF000, 0x581A), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fnegd", two(0xF000, 0x541A), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fnegl", two(0xF000, 0x401A), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fnegp", two(0xF000, 0x4C1A), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fnegs", two(0xF000, 0x441A), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fnegw", two(0xF000, 0x501A), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fnegx", two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fnegx", two(0xF000, 0x481A), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fnegx", two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fnop", two(0xF280, 0x0000), two(0xFFFF, 0xFFFF), "Ii"},
-
-{"fremb", two(0xF000, 0x5825), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fremd", two(0xF000, 0x5425), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"freml", two(0xF000, 0x4025), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fremp", two(0xF000, 0x4C25), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"frems", two(0xF000, 0x4425), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fremw", two(0xF000, 0x5025), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fremx", two(0xF000, 0x0025), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fremx", two(0xF000, 0x4825), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-/* {"fremx", two(0xF000, 0x0025), two(0xF1C0, 0xE07F), "IiFt"}, JF */
-
-{"frestore", one(0xF140), one(0xF1C0), "Id&s"},
-{"frestore", one(0xF158), one(0xF1F8), "Id+s"},
-{"fsave", one(0xF100), one(0xF1C0), "Id&s"},
-{"fsave", one(0xF120), one(0xF1F8), "Id-s"},
-
-{"fsincosb", two(0xF000, 0x5830), two(0xF1C0, 0xFC78), "Ii;bF7FC"},
-{"fsincosd", two(0xF000, 0x5430), two(0xF1C0, 0xFC78), "Ii;FF7FC"},
-{"fsincosl", two(0xF000, 0x4030), two(0xF1C0, 0xFC78), "Ii;lF7FC"},
-{"fsincosp", two(0xF000, 0x4C30), two(0xF1C0, 0xFC78), "Ii;pF7FC"},
-{"fsincoss", two(0xF000, 0x4430), two(0xF1C0, 0xFC78), "Ii;fF7FC"},
-{"fsincosw", two(0xF000, 0x5030), two(0xF1C0, 0xFC78), "Ii;wF7FC"},
-{"fsincosx", two(0xF000, 0x0030), two(0xF1C0, 0xE078), "IiF8F7FC"},
-{"fsincosx", two(0xF000, 0x4830), two(0xF1C0, 0xFC78), "Ii;xF7FC"},
-
-{"fscaleb", two(0xF000, 0x5826), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fscaled", two(0xF000, 0x5426), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fscalel", two(0xF000, 0x4026), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fscalep", two(0xF000, 0x4C26), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fscales", two(0xF000, 0x4426), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fscalew", two(0xF000, 0x5026), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fscalex", two(0xF000, 0x0026), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fscalex", two(0xF000, 0x4826), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-/* {"fscalex", two(0xF000, 0x0026), two(0xF1C0, 0xE07F), "IiFt"}, JF */
-
-/* $ is necessary to prevent the assembler from using PC-relative.
- If @ were used, "label: fseq label" could produce "ftrapeq",
- because "label" became "pc@label". */
-{"fseq", two(0xF040, 0x0001), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsf", two(0xF040, 0x0000), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsge", two(0xF040, 0x0013), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsgl", two(0xF040, 0x0016), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsgle", two(0xF040, 0x0017), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsgt", two(0xF040, 0x0012), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsle", two(0xF040, 0x0015), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fslt", two(0xF040, 0x0014), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsne", two(0xF040, 0x000E), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsnge", two(0xF040, 0x001C), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsngl", two(0xF040, 0x0019), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsngle", two(0xF040, 0x0018), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsngt", two(0xF040, 0x001D), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsnle", two(0xF040, 0x001A), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsnlt", two(0xF040, 0x001B), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsoge", two(0xF040, 0x0003), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsogl", two(0xF040, 0x0006), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsogt", two(0xF040, 0x0002), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsole", two(0xF040, 0x0005), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsolt", two(0xF040, 0x0004), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsor", two(0xF040, 0x0007), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsseq", two(0xF040, 0x0011), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fssf", two(0xF040, 0x0010), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fssne", two(0xF040, 0x001E), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsst", two(0xF040, 0x001F), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fst", two(0xF040, 0x000F), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsueq", two(0xF040, 0x0009), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsuge", two(0xF040, 0x000B), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsugt", two(0xF040, 0x000A), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsule", two(0xF040, 0x000D), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsult", two(0xF040, 0x000C), two(0xF1C0, 0xFFFF), "Ii$s"},
-{"fsun", two(0xF040, 0x0008), two(0xF1C0, 0xFFFF), "Ii$s"},
-
-{"fsgldivb", two(0xF000, 0x5824), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fsgldivd", two(0xF000, 0x5424), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fsgldivl", two(0xF000, 0x4024), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fsgldivp", two(0xF000, 0x4C24), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fsgldivs", two(0xF000, 0x4424), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fsgldivw", two(0xF000, 0x5024), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fsgldivx", two(0xF000, 0x0024), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fsgldivx", two(0xF000, 0x4824), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fsgldivx", two(0xF000, 0x0024), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fsglmulb", two(0xF000, 0x5827), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fsglmuld", two(0xF000, 0x5427), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fsglmull", two(0xF000, 0x4027), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fsglmulp", two(0xF000, 0x4C27), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fsglmuls", two(0xF000, 0x4427), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fsglmulw", two(0xF000, 0x5027), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fsglmulx", two(0xF000, 0x0027), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fsglmulx", two(0xF000, 0x4827), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fsglmulx", two(0xF000, 0x0027), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fsinb", two(0xF000, 0x580E), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fsind", two(0xF000, 0x540E), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fsinl", two(0xF000, 0x400E), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fsinp", two(0xF000, 0x4C0E), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fsins", two(0xF000, 0x440E), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fsinw", two(0xF000, 0x500E), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fsinx", two(0xF000, 0x000E), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fsinx", two(0xF000, 0x480E), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fsinx", two(0xF000, 0x000E), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fsinhb", two(0xF000, 0x5802), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fsinhd", two(0xF000, 0x5402), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fsinhl", two(0xF000, 0x4002), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fsinhp", two(0xF000, 0x4C02), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fsinhs", two(0xF000, 0x4402), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fsinhw", two(0xF000, 0x5002), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fsinhx", two(0xF000, 0x0002), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fsinhx", two(0xF000, 0x4802), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fsinhx", two(0xF000, 0x0002), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fsqrtb", two(0xF000, 0x5804), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fsqrtd", two(0xF000, 0x5404), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fsqrtl", two(0xF000, 0x4004), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fsqrtp", two(0xF000, 0x4C04), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fsqrts", two(0xF000, 0x4404), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fsqrtw", two(0xF000, 0x5004), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fsqrtx", two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fsqrtx", two(0xF000, 0x4804), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fsqrtx", two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"fsubb", two(0xF000, 0x5828), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"fsubd", two(0xF000, 0x5428), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"fsubl", two(0xF000, 0x4028), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"fsubp", two(0xF000, 0x4C28), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"fsubs", two(0xF000, 0x4428), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"fsubw", two(0xF000, 0x5028), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"fsubx", two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"fsubx", two(0xF000, 0x4828), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"fsubx", two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"ftanb", two(0xF000, 0x580F), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"ftand", two(0xF000, 0x540F), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"ftanl", two(0xF000, 0x400F), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"ftanp", two(0xF000, 0x4C0F), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"ftans", two(0xF000, 0x440F), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"ftanw", two(0xF000, 0x500F), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"ftanx", two(0xF000, 0x000F), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"ftanx", two(0xF000, 0x480F), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"ftanx", two(0xF000, 0x000F), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"ftanhb", two(0xF000, 0x5809), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"ftanhd", two(0xF000, 0x5409), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"ftanhl", two(0xF000, 0x4009), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"ftanhp", two(0xF000, 0x4C09), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"ftanhs", two(0xF000, 0x4409), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"ftanhw", two(0xF000, 0x5009), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"ftanhx", two(0xF000, 0x0009), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"ftanhx", two(0xF000, 0x4809), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"ftanhx", two(0xF000, 0x0009), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"ftentoxb", two(0xF000, 0x5812), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"ftentoxd", two(0xF000, 0x5412), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"ftentoxl", two(0xF000, 0x4012), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"ftentoxp", two(0xF000, 0x4C12), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"ftentoxs", two(0xF000, 0x4412), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"ftentoxw", two(0xF000, 0x5012), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"ftentoxx", two(0xF000, 0x0012), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"ftentoxx", two(0xF000, 0x4812), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"ftentoxx", two(0xF000, 0x0012), two(0xF1C0, 0xE07F), "IiFt"},
-
-{"ftrapeq", two(0xF07C, 0x0001), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapf", two(0xF07C, 0x0000), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapge", two(0xF07C, 0x0013), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapgl", two(0xF07C, 0x0016), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapgle", two(0xF07C, 0x0017), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapgt", two(0xF07C, 0x0012), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftraple", two(0xF07C, 0x0015), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftraplt", two(0xF07C, 0x0014), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapne", two(0xF07C, 0x000E), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapnge", two(0xF07C, 0x001C), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapngl", two(0xF07C, 0x0019), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapngle", two(0xF07C, 0x0018), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapngt", two(0xF07C, 0x001D), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapnle", two(0xF07C, 0x001A), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapnlt", two(0xF07C, 0x001B), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapoge", two(0xF07C, 0x0003), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapogl", two(0xF07C, 0x0006), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapogt", two(0xF07C, 0x0002), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapole", two(0xF07C, 0x0005), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapolt", two(0xF07C, 0x0004), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapor", two(0xF07C, 0x0007), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapseq", two(0xF07C, 0x0011), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapsf", two(0xF07C, 0x0010), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapsne", two(0xF07C, 0x001E), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapst", two(0xF07C, 0x001F), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapt", two(0xF07C, 0x000F), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapueq", two(0xF07C, 0x0009), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapuge", two(0xF07C, 0x000B), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapugt", two(0xF07C, 0x000A), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapule", two(0xF07C, 0x000D), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapult", two(0xF07C, 0x000C), two(0xF1FF, 0xFFFF), "Ii"},
-{"ftrapun", two(0xF07C, 0x0008), two(0xF1FF, 0xFFFF), "Ii"},
-
-{"ftrapeqw", two(0xF07A, 0x0001), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapfw", two(0xF07A, 0x0000), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapgew", two(0xF07A, 0x0013), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapglw", two(0xF07A, 0x0016), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapglew", two(0xF07A, 0x0017), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapgtw", two(0xF07A, 0x0012), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftraplew", two(0xF07A, 0x0015), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapltw", two(0xF07A, 0x0014), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapnew", two(0xF07A, 0x000E), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapngew", two(0xF07A, 0x001C), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapnglw", two(0xF07A, 0x0019), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapnglew", two(0xF07A, 0x0018), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapngtw", two(0xF07A, 0x001D), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapnlew", two(0xF07A, 0x001A), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapnltw", two(0xF07A, 0x001B), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapogew", two(0xF07A, 0x0003), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapoglw", two(0xF07A, 0x0006), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapogtw", two(0xF07A, 0x0002), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapolew", two(0xF07A, 0x0005), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapoltw", two(0xF07A, 0x0004), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftraporw", two(0xF07A, 0x0007), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapseqw", two(0xF07A, 0x0011), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapsfw", two(0xF07A, 0x0010), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapsnew", two(0xF07A, 0x001E), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapstw", two(0xF07A, 0x001F), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftraptw", two(0xF07A, 0x000F), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapueqw", two(0xF07A, 0x0009), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapugew", two(0xF07A, 0x000B), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapugtw", two(0xF07A, 0x000A), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapulew", two(0xF07A, 0x000D), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapultw", two(0xF07A, 0x000C), two(0xF1FF, 0xFFFF), "Ii^w"},
-{"ftrapunw", two(0xF07A, 0x0008), two(0xF1FF, 0xFFFF), "Ii^w"},
-
-{"ftrapeql", two(0xF07B, 0x0001), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapfl", two(0xF07B, 0x0000), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapgel", two(0xF07B, 0x0013), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapgll", two(0xF07B, 0x0016), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapglel", two(0xF07B, 0x0017), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapgtl", two(0xF07B, 0x0012), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftraplel", two(0xF07B, 0x0015), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapltl", two(0xF07B, 0x0014), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapnel", two(0xF07B, 0x000E), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapngel", two(0xF07B, 0x001C), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapngll", two(0xF07B, 0x0019), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapnglel", two(0xF07B, 0x0018), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapngtl", two(0xF07B, 0x001D), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapnlel", two(0xF07B, 0x001A), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapnltl", two(0xF07B, 0x001B), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapogel", two(0xF07B, 0x0003), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapogll", two(0xF07B, 0x0006), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapogtl", two(0xF07B, 0x0002), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapolel", two(0xF07B, 0x0005), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapoltl", two(0xF07B, 0x0004), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftraporl", two(0xF07B, 0x0007), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapseql", two(0xF07B, 0x0011), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapsfl", two(0xF07B, 0x0010), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapsnel", two(0xF07B, 0x001E), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapstl", two(0xF07B, 0x001F), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftraptl", two(0xF07B, 0x000F), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapueql", two(0xF07B, 0x0009), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapugel", two(0xF07B, 0x000B), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapugtl", two(0xF07B, 0x000A), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapulel", two(0xF07B, 0x000D), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapultl", two(0xF07B, 0x000C), two(0xF1FF, 0xFFFF), "Ii^l"},
-{"ftrapunl", two(0xF07B, 0x0008), two(0xF1FF, 0xFFFF), "Ii^l"},
-
-{"ftstb", two(0xF000, 0x583A), two(0xF1C0, 0xFC7F), "Ii;b"},
-{"ftstd", two(0xF000, 0x543A), two(0xF1C0, 0xFC7F), "Ii;F"},
-{"ftstl", two(0xF000, 0x403A), two(0xF1C0, 0xFC7F), "Ii;l"},
-{"ftstp", two(0xF000, 0x4C3A), two(0xF1C0, 0xFC7F), "Ii;p"},
-{"ftsts", two(0xF000, 0x443A), two(0xF1C0, 0xFC7F), "Ii;f"},
-{"ftstw", two(0xF000, 0x503A), two(0xF1C0, 0xFC7F), "Ii;w"},
-{"ftstx", two(0xF000, 0x003A), two(0xF1C0, 0xE07F), "IiF8"},
-{"ftstx", two(0xF000, 0x483A), two(0xF1C0, 0xFC7F), "Ii;x"},
-
-{"ftwotoxb", two(0xF000, 0x5811), two(0xF1C0, 0xFC7F), "Ii;bF7"},
-{"ftwotoxd", two(0xF000, 0x5411), two(0xF1C0, 0xFC7F), "Ii;FF7"},
-{"ftwotoxl", two(0xF000, 0x4011), two(0xF1C0, 0xFC7F), "Ii;lF7"},
-{"ftwotoxp", two(0xF000, 0x4C11), two(0xF1C0, 0xFC7F), "Ii;pF7"},
-{"ftwotoxs", two(0xF000, 0x4411), two(0xF1C0, 0xFC7F), "Ii;fF7"},
-{"ftwotoxw", two(0xF000, 0x5011), two(0xF1C0, 0xFC7F), "Ii;wF7"},
-{"ftwotoxx", two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiF8F7"},
-{"ftwotoxx", two(0xF000, 0x4811), two(0xF1C0, 0xFC7F), "Ii;xF7"},
-{"ftwotoxx", two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiFt"},
-
-
-{"fjeq", one(0xF081), one(0xF1FF), "IdBc"},
-{"fjf", one(0xF080), one(0xF1FF), "IdBc"},
-{"fjge", one(0xF093), one(0xF1FF), "IdBc"},
-{"fjgl", one(0xF096), one(0xF1FF), "IdBc"},
-{"fjgle", one(0xF097), one(0xF1FF), "IdBc"},
-{"fjgt", one(0xF092), one(0xF1FF), "IdBc"},
-{"fjle", one(0xF095), one(0xF1FF), "IdBc"},
-{"fjlt", one(0xF094), one(0xF1FF), "IdBc"},
-{"fjne", one(0xF08E), one(0xF1FF), "IdBc"},
-{"fjnge", one(0xF09C), one(0xF1FF), "IdBc"},
-{"fjngl", one(0xF099), one(0xF1FF), "IdBc"},
-{"fjngle", one(0xF098), one(0xF1FF), "IdBc"},
-{"fjngt", one(0xF09D), one(0xF1FF), "IdBc"},
-{"fjnle", one(0xF09A), one(0xF1FF), "IdBc"},
-{"fjnlt", one(0xF09B), one(0xF1FF), "IdBc"},
-{"fjoge", one(0xF083), one(0xF1FF), "IdBc"},
-{"fjogl", one(0xF086), one(0xF1FF), "IdBc"},
-{"fjogt", one(0xF082), one(0xF1FF), "IdBc"},
-{"fjole", one(0xF085), one(0xF1FF), "IdBc"},
-{"fjolt", one(0xF084), one(0xF1FF), "IdBc"},
-{"fjor", one(0xF087), one(0xF1FF), "IdBc"},
-{"fjseq", one(0xF091), one(0xF1FF), "IdBc"},
-{"fjsf", one(0xF090), one(0xF1FF), "IdBc"},
-{"fjsne", one(0xF09E), one(0xF1FF), "IdBc"},
-{"fjst", one(0xF09F), one(0xF1FF), "IdBc"},
-{"fjt", one(0xF08F), one(0xF1FF), "IdBc"},
-{"fjueq", one(0xF089), one(0xF1FF), "IdBc"},
-{"fjuge", one(0xF08B), one(0xF1FF), "IdBc"},
-{"fjugt", one(0xF08A), one(0xF1FF), "IdBc"},
-{"fjule", one(0xF08D), one(0xF1FF), "IdBc"},
-{"fjult", one(0xF08C), one(0xF1FF), "IdBc"},
-{"fjun", one(0xF088), one(0xF1FF), "IdBc"},
-
-/* The assembler will ignore attempts to force a short offset */
-
-{"bhis", one(0061000), one(0177400), "Bg"},
-{"blss", one(0061400), one(0177400), "Bg"},
-{"bccs", one(0062000), one(0177400), "Bg"},
-{"bcss", one(0062400), one(0177400), "Bg"},
-{"bnes", one(0063000), one(0177400), "Bg"},
-{"beqs", one(0063400), one(0177400), "Bg"},
-{"bvcs", one(0064000), one(0177400), "Bg"},
-{"bvss", one(0064400), one(0177400), "Bg"},
-{"bpls", one(0065000), one(0177400), "Bg"},
-{"bmis", one(0065400), one(0177400), "Bg"},
-{"bges", one(0066000), one(0177400), "Bg"},
-{"blts", one(0066400), one(0177400), "Bg"},
-{"bgts", one(0067000), one(0177400), "Bg"},
-{"bles", one(0067400), one(0177400), "Bg"},
-
-/* Alternate mnemonics for SUN */
-
-{"jbsr", one(0060400), one(0177400), "Bg"},
-{"jbsr", one(0047200), one(0177700), "!s"},
-{"jra", one(0060000), one(0177400), "Bg"},
-{"jra", one(0047300), one(0177700), "!s"},
-
-{"jhi", one(0061000), one(0177400), "Bg"},
-{"jls", one(0061400), one(0177400), "Bg"},
-{"jcc", one(0062000), one(0177400), "Bg"},
-{"jcs", one(0062400), one(0177400), "Bg"},
-{"jne", one(0063000), one(0177400), "Bg"},
-{"jeq", one(0063400), one(0177400), "Bg"},
-{"jvc", one(0064000), one(0177400), "Bg"},
-{"jvs", one(0064400), one(0177400), "Bg"},
-{"jpl", one(0065000), one(0177400), "Bg"},
-{"jmi", one(0065400), one(0177400), "Bg"},
-{"jge", one(0066000), one(0177400), "Bg"},
-{"jlt", one(0066400), one(0177400), "Bg"},
-{"jgt", one(0067000), one(0177400), "Bg"},
-{"jle", one(0067400), one(0177400), "Bg"},
-
-/* Short offsets are ignored */
-
-{"jbsrs", one(0060400), one(0177400), "Bg"},
-{"jras", one(0060000), one(0177400), "Bg"},
-{"jhis", one(0061000), one(0177400), "Bg"},
-{"jlss", one(0061400), one(0177400), "Bg"},
-{"jccs", one(0062000), one(0177400), "Bg"},
-{"jcss", one(0062400), one(0177400), "Bg"},
-{"jnes", one(0063000), one(0177400), "Bg"},
-{"jeqs", one(0063400), one(0177400), "Bg"},
-{"jvcs", one(0064000), one(0177400), "Bg"},
-{"jvss", one(0064400), one(0177400), "Bg"},
-{"jpls", one(0065000), one(0177400), "Bg"},
-{"jmis", one(0065400), one(0177400), "Bg"},
-{"jges", one(0066000), one(0177400), "Bg"},
-{"jlts", one(0066400), one(0177400), "Bg"},
-{"jgts", one(0067000), one(0177400), "Bg"},
-{"jles", one(0067400), one(0177400), "Bg"},
-
-{"movql", one(0070000), one(0170400), "MsDd"},
-{"moveql", one(0070000), one(0170400), "MsDd"},
-{"moval", one(0020100), one(0170700), "*lAd"},
-{"movaw", one(0030100), one(0170700), "*wAd"},
-{"movb", one(0010000), one(0170000), ";b$d"}, /* mov */
-{"movl", one(0070000), one(0170400), "MsDd"}, /* movq written as mov */
-{"movl", one(0020000), one(0170000), "*l$d"},
-{"movl", one(0020100), one(0170700), "*lAd"},
-{"movl", one(0047140), one(0177770), "AsUd"}, /* mov to USP */
-{"movl", one(0047150), one(0177770), "UdAs"}, /* mov from USP */
-{"movc", one(0047173), one(0177777), "R1Jj"},
-{"movc", one(0047173), one(0177777), "R1#j"},
-{"movc", one(0047172), one(0177777), "JjR1"},
-{"movc", one(0047172), one(0177777), "#jR1"},
-{"movml", one(0044300), one(0177700), "#w&s"}, /* movm reg to mem. */
-{"movml", one(0044340), one(0177770), "#w-s"}, /* movm reg to autodecrement. */
-{"movml", one(0046300), one(0177700), "!s#w"}, /* movm mem to reg. */
-{"movml", one(0046330), one(0177770), "+s#w"}, /* movm autoinc to reg. */
-{"movml", one(0044300), one(0177700), "Lw&s"}, /* movm reg to mem. */
-{"movml", one(0044340), one(0177770), "lw-s"}, /* movm reg to autodecrement. */
-{"movml", one(0046300), one(0177700), "!sLw"}, /* movm mem to reg. */
-{"movml", one(0046330), one(0177770), "+sLw"}, /* movm autoinc to reg. */
-{"movmw", one(0044200), one(0177700), "#w&s"}, /* movm reg to mem. */
-{"movmw", one(0044240), one(0177770), "#w-s"}, /* movm reg to autodecrement. */
-{"movmw", one(0046200), one(0177700), "!s#w"}, /* movm mem to reg. */
-{"movmw", one(0046230), one(0177770), "+s#w"}, /* movm autoinc to reg. */
-{"movmw", one(0044200), one(0177700), "Lw&s"}, /* movm reg to mem. */
-{"movmw", one(0044240), one(0177770), "lw-s"}, /* movm reg to autodecrement. */
-{"movmw", one(0046200), one(0177700), "!sLw"}, /* movm mem to reg. */
-{"movmw", one(0046230), one(0177770), "+sLw"}, /* movm autoinc to reg. */
-{"movpl", one(0000510), one(0170770), "dsDd"}, /* memory to register */
-{"movpl", one(0000710), one(0170770), "Ddds"}, /* register to memory */
-{"movpw", one(0000410), one(0170770), "dsDd"}, /* memory to register */
-{"movpw", one(0000610), one(0170770), "Ddds"}, /* register to memory */
-{"movq", one(0070000), one(0170400), "MsDd"},
-{"movw", one(0030000), one(0170000), "*w$d"},
-{"movw", one(0030100), one(0170700), "*wAd"}, /* mova, written as mov */
-{"movw", one(0040300), one(0177700), "Ss$s"}, /* Move from sr */
-{"movw", one(0041300), one(0177700), "Cs$s"}, /* Move from ccr */
-{"movw", one(0042300), one(0177700), ";wCd"}, /* mov to ccr */
-{"movw", one(0043300), one(0177700), ";wSd"}, /* mov to sr */
-
-{"movsb", two(0007000, 0), two(0177700, 07777), "~sR1"},
-{"movsb", two(0007000, 04000), two(0177700, 07777), "R1~s"},
-{"movsl", two(0007200, 0), two(0177700, 07777), "~sR1"},
-{"movsl", two(0007200, 04000), two(0177700, 07777), "R1~s"},
-{"movsw", two(0007100, 0), two(0177700, 07777), "~sR1"},
-{"movsw", two(0007100, 04000), two(0177700, 07777), "R1~s"},
-
-#ifdef m68851
- /* name */ /* opcode */ /* match */ /* args */
-
-{"pbac", one(0xf0c7), one(0xffbf), "Bc"},
-{"pbacw", one(0xf087), one(0xffbf), "Bc"},
-{"pbas", one(0xf0c6), one(0xffbf), "Bc"},
-{"pbasw", one(0xf086), one(0xffbf), "Bc"},
-{"pbbc", one(0xf0c1), one(0xffbf), "Bc"},
-{"pbbcw", one(0xf081), one(0xffbf), "Bc"},
-{"pbbs", one(0xf0c0), one(0xffbf), "Bc"},
-{"pbbsw", one(0xf080), one(0xffbf), "Bc"},
-{"pbcc", one(0xf0cf), one(0xffbf), "Bc"},
-{"pbccw", one(0xf08f), one(0xffbf), "Bc"},
-{"pbcs", one(0xf0ce), one(0xffbf), "Bc"},
-{"pbcsw", one(0xf08e), one(0xffbf), "Bc"},
-{"pbgc", one(0xf0cd), one(0xffbf), "Bc"},
-{"pbgcw", one(0xf08d), one(0xffbf), "Bc"},
-{"pbgs", one(0xf0cc), one(0xffbf), "Bc"},
-{"pbgsw", one(0xf08c), one(0xffbf), "Bc"},
-{"pbic", one(0xf0cb), one(0xffbf), "Bc"},
-{"pbicw", one(0xf08b), one(0xffbf), "Bc"},
-{"pbis", one(0xf0ca), one(0xffbf), "Bc"},
-{"pbisw", one(0xf08a), one(0xffbf), "Bc"},
-{"pblc", one(0xf0c3), one(0xffbf), "Bc"},
-{"pblcw", one(0xf083), one(0xffbf), "Bc"},
-{"pbls", one(0xf0c2), one(0xffbf), "Bc"},
-{"pblsw", one(0xf082), one(0xffbf), "Bc"},
-{"pbsc", one(0xf0c5), one(0xffbf), "Bc"},
-{"pbscw", one(0xf085), one(0xffbf), "Bc"},
-{"pbss", one(0xf0c4), one(0xffbf), "Bc"},
-{"pbssw", one(0xf084), one(0xffbf), "Bc"},
-{"pbwc", one(0xf0c9), one(0xffbf), "Bc"},
-{"pbwcw", one(0xf089), one(0xffbf), "Bc"},
-{"pbws", one(0xf0c8), one(0xffbf), "Bc"},
-{"pbwsw", one(0xf088), one(0xffbf), "Bc"},
-
-
-{"pdbac", two(0xf048, 0x0007), two(0xfff8, 0xffff), "DsBw"},
-{"pdbas", two(0xf048, 0x0006), two(0xfff8, 0xffff), "DsBw"},
-{"pdbbc", two(0xf048, 0x0001), two(0xfff8, 0xffff), "DsBw"},
-{"pdbbs", two(0xf048, 0x0000), two(0xfff8, 0xffff), "DsBw"},
-{"pdbcc", two(0xf048, 0x000f), two(0xfff8, 0xffff), "DsBw"},
-{"pdbcs", two(0xf048, 0x000e), two(0xfff8, 0xffff), "DsBw"},
-{"pdbgc", two(0xf048, 0x000d), two(0xfff8, 0xffff), "DsBw"},
-{"pdbgs", two(0xf048, 0x000c), two(0xfff8, 0xffff), "DsBw"},
-{"pdbic", two(0xf048, 0x000b), two(0xfff8, 0xffff), "DsBw"},
-{"pdbis", two(0xf048, 0x000a), two(0xfff8, 0xffff), "DsBw"},
-{"pdblc", two(0xf048, 0x0003), two(0xfff8, 0xffff), "DsBw"},
-{"pdbls", two(0xf048, 0x0002), two(0xfff8, 0xffff), "DsBw"},
-{"pdbsc", two(0xf048, 0x0005), two(0xfff8, 0xffff), "DsBw"},
-{"pdbss", two(0xf048, 0x0004), two(0xfff8, 0xffff), "DsBw"},
-{"pdbwc", two(0xf048, 0x0009), two(0xfff8, 0xffff), "DsBw"},
-{"pdbws", two(0xf048, 0x0008), two(0xfff8, 0xffff), "DsBw"},
-
-{"pflusha", two(0xf000, 0x2400), two(0xffff, 0xffff), "" },
-
-{"pflush", two(0xf000, 0x3010), two(0xffc0, 0xfe10), "T3T9" },
-{"pflush", two(0xf000, 0x3810), two(0xffc0, 0xfe10), "T3T9&s" },
-{"pflush", two(0xf000, 0x3008), two(0xffc0, 0xfe18), "D3T9" },
-{"pflush", two(0xf000, 0x3808), two(0xffc0, 0xfe18), "D3T9&s" },
-{"pflush", two(0xf000, 0x3000), two(0xffc0, 0xfe1e), "f3T9" },
-{"pflush", two(0xf000, 0x3800), two(0xffc0, 0xfe1e), "f3T9&s" },
-
-{"pflushs", two(0xf000, 0x3410), two(0xfff8, 0xfe10), "T3T9" },
-{"pflushs", two(0xf000, 0x3c00), two(0xfff8, 0xfe00), "T3T9&s" },
-{"pflushs", two(0xf000, 0x3408), two(0xfff8, 0xfe18), "D3T9" },
-{"pflushs", two(0xf000, 0x3c08), two(0xfff8, 0xfe18), "D3T9&s" },
-{"pflushs", two(0xf000, 0x3400), two(0xfff8, 0xfe1e), "f3T9" },
-{"pflushs", two(0xf000, 0x3c00), two(0xfff8, 0xfe1e), "f3T9&s"},
-
-{"pflushr", two(0xf000, 0xa000), two(0xffc0, 0xffff), "|s" },
-
-{"ploadr", two(0xf000, 0x2210), two(0xffc0, 0xfff0), "T3&s" },
-{"ploadr", two(0xf000, 0x2208), two(0xffc0, 0xfff8), "D3&s" },
-{"ploadr", two(0xf000, 0x2200), two(0xffc0, 0xfffe), "f3&s" },
-{"ploadw", two(0xf000, 0x2010), two(0xffc0, 0xfff0), "T3&s" },
-{"ploadw", two(0xf000, 0x2008), two(0xffc0, 0xfff8), "D3&s" },
-{"ploadw", two(0xf000, 0x2000), two(0xffc0, 0xfffe), "f3&s" },
-
-/* TC, CRP, DRP, SRP, CAL, VAL, SCC, AC */
-{"pmove", two(0xf000, 0x4000), two(0xffc0, 0xe3ff), "*sP8" },
-{"pmove", two(0xf000, 0x4200), two(0xffc0, 0xe3ff), "P8%s" },
-{"pmove", two(0xf000, 0x4000), two(0xffc0, 0xe3ff), "|sW8" },
-{"pmove", two(0xf000, 0x4200), two(0xffc0, 0xe3ff), "W8~s" },
-
-/* BADx, BACx */
-{"pmove", two(0xf000, 0x6200), two(0xffc0, 0xe3e3), "*sX3" },
-{"pmove", two(0xf000, 0x6000), two(0xffc0, 0xe3e3), "X3%s" },
-
-/* PSR, PCSR */
-/* {"pmove", two(0xf000, 0x6100), two(oxffc0, oxffff), "*sZ8" }, */
-{"pmove", two(0xf000, 0x6000), two(0xffc0, 0xffff), "*sY8" },
-{"pmove", two(0xf000, 0x6200), two(0xffc0, 0xffff), "Y8%s" },
-{"pmove", two(0xf000, 0x6600), two(0xffc0, 0xffff), "Z8%s" },
-
-{"prestore", one(0xf140), one(0xffc0), "&s"},
-{"prestore", one(0xf158), one(0xfff8), "+s"},
-{"psave", one(0xf100), one(0xffc0), "&s"},
-{"psave", one(0xf100), one(0xffc0), "+s"},
-
-{"psac", two(0xf040, 0x0007), two(0xffc0, 0xffff), "@s"},
-{"psas", two(0xf040, 0x0006), two(0xffc0, 0xffff), "@s"},
-{"psbc", two(0xf040, 0x0001), two(0xffc0, 0xffff), "@s"},
-{"psbs", two(0xf040, 0x0000), two(0xffc0, 0xffff), "@s"},
-{"pscc", two(0xf040, 0x000f), two(0xffc0, 0xffff), "@s"},
-{"pscs", two(0xf040, 0x000e), two(0xffc0, 0xffff), "@s"},
-{"psgc", two(0xf040, 0x000d), two(0xffc0, 0xffff), "@s"},
-{"psgs", two(0xf040, 0x000c), two(0xffc0, 0xffff), "@s"},
-{"psic", two(0xf040, 0x000b), two(0xffc0, 0xffff), "@s"},
-{"psis", two(0xf040, 0x000a), two(0xffc0, 0xffff), "@s"},
-{"pslc", two(0xf040, 0x0003), two(0xffc0, 0xffff), "@s"},
-{"psls", two(0xf040, 0x0002), two(0xffc0, 0xffff), "@s"},
-{"pssc", two(0xf040, 0x0005), two(0xffc0, 0xffff), "@s"},
-{"psss", two(0xf040, 0x0004), two(0xffc0, 0xffff), "@s"},
-{"pswc", two(0xf040, 0x0009), two(0xffc0, 0xffff), "@s"},
-{"psws", two(0xf040, 0x0008), two(0xffc0, 0xffff), "@s"},
-
-{"ptestr", two(0xf000, 0x8210), two(0xffc0, 0xe3f0), "T3&sQ8" },
-{"ptestr", two(0xf000, 0x8310), two(0xffc0, 0xe310), "T3&sQ8A9" },
-{"ptestr", two(0xf000, 0x8208), two(0xffc0, 0xe3f8), "D3&sQ8" },
-{"ptestr", two(0xf000, 0x8308), two(0xffc0, 0xe318), "D3&sQ8A9" },
-{"ptestr", two(0xf000, 0x8200), two(0xffc0, 0xe3fe), "f3&sQ8" },
-{"ptestr", two(0xf000, 0x8300), two(0xffc0, 0xe31e), "f3&sQ8A9" },
-
-{"ptestw", two(0xf000, 0x8010), two(0xffc0, 0xe3f0), "T3&sQ8" },
-{"ptestw", two(0xf000, 0x8110), two(0xffc0, 0xe310), "T3&sQ8A9" },
-{"ptestw", two(0xf000, 0x8008), two(0xffc0, 0xe3f8), "D3&sQ8" },
-{"ptestw", two(0xf000, 0x8108), two(0xffc0, 0xe318), "D3&sQ8A9" },
-{"ptestw", two(0xf000, 0x8000), two(0xffc0, 0xe3fe), "f3&sQ8" },
-{"ptestw", two(0xf000, 0x8100), two(0xffc0, 0xe31e), "f3&sQ8A9" },
-
-{"ptrapacw", two(0xf07a, 0x0007), two(0xffff, 0xffff), "#w"},
-{"ptrapacl", two(0xf07b, 0x0007), two(0xffff, 0xffff), "#l"},
-{"ptrapac", two(0xf07c, 0x0007), two(0xffff, 0xffff), ""},
-
-{"ptrapasw", two(0xf07a, 0x0006), two(0xffff, 0xffff), "#w"},
-{"ptrapasl", two(0xf07b, 0x0006), two(0xffff, 0xffff), "#l"},
-{"ptrapas", two(0xf07c, 0x0006), two(0xffff, 0xffff), ""},
-
-{"ptrapbcw", two(0xf07a, 0x0001), two(0xffff, 0xffff), "#w"},
-{"ptrapbcl", two(0xf07b, 0x0001), two(0xffff, 0xffff), "#l"},
-{"ptrapbc", two(0xf07c, 0x0001), two(0xffff, 0xffff), ""},
-
-{"ptrapbsw", two(0xf07a, 0x0000), two(0xffff, 0xffff), "#w"},
-{"ptrapbsl", two(0xf07b, 0x0000), two(0xffff, 0xffff), "#l"},
-{"ptrapbs", two(0xf07c, 0x0000), two(0xffff, 0xffff), ""},
-
-{"ptrapccw", two(0xf07a, 0x000f), two(0xffff, 0xffff), "#w"},
-{"ptrapccl", two(0xf07b, 0x000f), two(0xffff, 0xffff), "#l"},
-{"ptrapcc", two(0xf07c, 0x000f), two(0xffff, 0xffff), ""},
-
-{"ptrapcsw", two(0xf07a, 0x000e), two(0xffff, 0xffff), "#w"},
-{"ptrapcsl", two(0xf07b, 0x000e), two(0xffff, 0xffff), "#l"},
-{"ptrapcs", two(0xf07c, 0x000e), two(0xffff, 0xffff), ""},
-
-{"ptrapgcw", two(0xf07a, 0x000d), two(0xffff, 0xffff), "#w"},
-{"ptrapgcl", two(0xf07b, 0x000d), two(0xffff, 0xffff), "#l"},
-{"ptrapgc", two(0xf07c, 0x000d), two(0xffff, 0xffff), ""},
-
-{"ptrapgsw", two(0xf07a, 0x000c), two(0xffff, 0xffff), "#w"},
-{"ptrapgsl", two(0xf07b, 0x000c), two(0xffff, 0xffff), "#l"},
-{"ptrapgs", two(0xf07c, 0x000c), two(0xffff, 0xffff), ""},
-
-{"ptrapicw", two(0xf07a, 0x000b), two(0xffff, 0xffff), "#w"},
-{"ptrapicl", two(0xf07b, 0x000b), two(0xffff, 0xffff), "#l"},
-{"ptrapic", two(0xf07c, 0x000b), two(0xffff, 0xffff), ""},
-
-{"ptrapisw", two(0xf07a, 0x000a), two(0xffff, 0xffff), "#w"},
-{"ptrapisl", two(0xf07b, 0x000a), two(0xffff, 0xffff), "#l"},
-{"ptrapis", two(0xf07c, 0x000a), two(0xffff, 0xffff), ""},
-
-{"ptraplcw", two(0xf07a, 0x0003), two(0xffff, 0xffff), "#w"},
-{"ptraplcl", two(0xf07b, 0x0003), two(0xffff, 0xffff), "#l"},
-{"ptraplc", two(0xf07c, 0x0003), two(0xffff, 0xffff), ""},
-
-{"ptraplsw", two(0xf07a, 0x0002), two(0xffff, 0xffff), "#w"},
-{"ptraplsl", two(0xf07b, 0x0002), two(0xffff, 0xffff), "#l"},
-{"ptrapls", two(0xf07c, 0x0002), two(0xffff, 0xffff), ""},
-
-{"ptrapscw", two(0xf07a, 0x0005), two(0xffff, 0xffff), "#w"},
-{"ptrapscl", two(0xf07b, 0x0005), two(0xffff, 0xffff), "#l"},
-{"ptrapsc", two(0xf07c, 0x0005), two(0xffff, 0xffff), ""},
-
-{"ptrapssw", two(0xf07a, 0x0004), two(0xffff, 0xffff), "#w"},
-{"ptrapssl", two(0xf07b, 0x0004), two(0xffff, 0xffff), "#l"},
-{"ptrapss", two(0xf07c, 0x0004), two(0xffff, 0xffff), ""},
-
-{"ptrapwcw", two(0xf07a, 0x0009), two(0xffff, 0xffff), "#w"},
-{"ptrapwcl", two(0xf07b, 0x0009), two(0xffff, 0xffff), "#l"},
-{"ptrapwc", two(0xf07c, 0x0009), two(0xffff, 0xffff), ""},
-
-{"ptrapwsw", two(0xf07a, 0x0008), two(0xffff, 0xffff), "#w"},
-{"ptrapwsl", two(0xf07b, 0x0008), two(0xffff, 0xffff), "#l"},
-{"ptrapws", two(0xf07c, 0x0008), two(0xffff, 0xffff), ""},
-
-{"pvalid", two(0xf000, 0x2800), two(0xffc0, 0xffff), "Vs&s"},
-{"pvalid", two(0xf000, 0x2c00), two(0xffc0, 0xfff8), "A3&s" },
-
-#endif /* m68851 */
-
-};
-
-int numopcodes=sizeof(m68k_opcodes)/sizeof(m68k_opcodes[0]);
-
-struct m68k_opcode *endop = m68k_opcodes+sizeof(m68k_opcodes)/sizeof(m68k_opcodes[0]);
diff --git a/gdb/m68k-pinsn.c b/gdb/m68k-pinsn.c
deleted file mode 100644
index b648abb..0000000
--- a/gdb/m68k-pinsn.c
+++ /dev/null
@@ -1,776 +0,0 @@
-/* Print m68k instructions for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "m68k-opcode.h"
-#include "gdbcore.h"
-
-/* 68k instructions are never longer than this many bytes. */
-#define MAXLEN 22
-
-/* Number of elements in the opcode table. */
-#define NOPCODES (sizeof m68k_opcodes / sizeof m68k_opcodes[0])
-
-extern char *reg_names[];
-char *fpcr_names[] = { "", "fpiar", "fpsr", "fpiar/fpsr", "fpcr",
- "fpiar/fpcr", "fpsr/fpcr", "fpiar-fpcr"};
-
-static unsigned char *print_insn_arg ();
-static unsigned char *print_indexed ();
-static void print_base ();
-static int fetch_arg ();
-
-#define NEXTBYTE(p) (p += 2, ((char *)p)[-1])
-
-#define NEXTWORD(p) \
- (p += 2, ((((char *)p)[-2]) << 8) + p[-1])
-
-#define NEXTLONG(p) \
- (p += 4, (((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1])
-
-#define NEXTSINGLE(p) \
- (p += 4, *((float *)(p - 4)))
-
-#define NEXTDOUBLE(p) \
- (p += 8, *((double *)(p - 8)))
-
-#define NEXTEXTEND(p) \
- (p += 12, 0.0) /* Need a function to convert from extended to double
- precision... */
-
-#define NEXTPACKED(p) \
- (p += 12, 0.0) /* Need a function to convert from packed to double
- precision. Actually, it's easier to print a
- packed number than a double anyway, so maybe
- there should be a special case to handle this... */
-
-/* Print the m68k instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned char buffer[MAXLEN];
- register int i;
- register unsigned char *p;
- register char *d;
- register int bestmask;
- int best;
-
- read_memory (memaddr, buffer, MAXLEN);
-
- bestmask = 0;
- best = -1;
- for (i = 0; i < NOPCODES; i++)
- {
- register unsigned int opcode = m68k_opcodes[i].opcode;
- register unsigned int match = m68k_opcodes[i].match;
- if (((0xff & buffer[0] & (match >> 24)) == (0xff & (opcode >> 24)))
- && ((0xff & buffer[1] & (match >> 16)) == (0xff & (opcode >> 16)))
- && ((0xff & buffer[2] & (match >> 8)) == (0xff & (opcode >> 8)))
- && ((0xff & buffer[3] & match) == (0xff & opcode)))
- {
- /* Don't use for printout the variants of divul and divsl
- that have the same register number in two places.
- The more general variants will match instead. */
- for (d = m68k_opcodes[i].args; *d; d += 2)
- if (d[1] == 'D')
- break;
-
- /* Don't use for printout the variants of most floating
- point coprocessor instructions which use the same
- register number in two places, as above. */
- if (*d == 0)
- for (d = m68k_opcodes[i].args; *d; d += 2)
- if (d[1] == 't')
- break;
-
- if (*d == 0 && match > bestmask)
- {
- best = i;
- bestmask = match;
- }
- }
- }
-
- /* Handle undefined instructions. */
- if (best < 0)
- {
- fprintf_filtered (stream, "0%o", (buffer[0] << 8) + buffer[1]);
- return 2;
- }
-
- fprintf_filtered (stream, "%s", m68k_opcodes[best].name);
-
- /* Point at first word of argument data,
- and at descriptor for first argument. */
- p = buffer + 2;
-
- /* Why do this this way? -MelloN */
- for (d = m68k_opcodes[best].args; *d; d += 2)
- {
- if (d[0] == '#')
- {
- if (d[1] == 'l' && p - buffer < 6)
- p = buffer + 6;
- else if (p - buffer < 4 && d[1] != 'C' && d[1] != '8' )
- p = buffer + 4;
- }
- if (d[1] >= '1' && d[1] <= '3' && p - buffer < 4)
- p = buffer + 4;
- if (d[1] >= '4' && d[1] <= '6' && p - buffer < 6)
- p = buffer + 6;
- if ((d[0] == 'L' || d[0] == 'l') && d[1] == 'w' && p - buffer < 4)
- p = buffer + 4;
- }
-
- d = m68k_opcodes[best].args;
-
- if (*d)
- fputs_filtered (" ", stream);
-
- while (*d)
- {
- p = print_insn_arg (d, buffer, p, memaddr + p - buffer, stream);
- d += 2;
- if (*d && *(d - 2) != 'I' && *d != 'k')
- fputs_filtered (",", stream);
- }
- return p - buffer;
-}
-
-static unsigned char *
-print_insn_arg (d, buffer, p, addr, stream)
- char *d;
- unsigned char *buffer;
- register unsigned char *p;
- CORE_ADDR addr; /* PC for this arg to be relative to */
- FILE *stream;
-{
- register int val;
- register int place = d[1];
- int regno;
- register char *regname;
- register unsigned char *p1;
- register double flval;
- int flt_p;
-
- switch (*d)
- {
- case 'C':
- fprintf_filtered (stream, "ccr");
- break;
-
- case 'S':
- fprintf_filtered (stream, "sr");
- break;
-
- case 'U':
- fprintf_filtered (stream, "usp");
- break;
-
- case 'J':
- {
- static struct { char *name; int value; } names[]
- = {{"sfc", 0x000}, {"dfc", 0x001}, {"cacr", 0x002},
- {"usp", 0x800}, {"vbr", 0x801}, {"caar", 0x802},
- {"msp", 0x803}, {"isp", 0x804}};
-
- val = fetch_arg (buffer, place, 12);
- for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--)
- if (names[regno].value == val)
- {
- fprintf_filtered (stream, names[regno].name);
- break;
- }
- if (regno < 0)
- fprintf_filtered (stream, "%d", val);
- }
- break;
-
- case 'Q':
- val = fetch_arg (buffer, place, 3);
- /* 0 means 8, except for the bkpt instruction... */
- if (val == 0 && d[1] != 's')
- val = 8;
- fprintf_filtered (stream, "#%d", val);
- break;
-
- case 'M':
- val = fetch_arg (buffer, place, 8);
- if (val & 0x80)
- val = val - 0x100;
- fprintf_filtered (stream, "#%d", val);
- break;
-
- case 'T':
- val = fetch_arg (buffer, place, 4);
- fprintf_filtered (stream, "#%d", val);
- break;
-
- case 'D':
- fprintf_filtered (stream, "%s", reg_names[fetch_arg (buffer, place, 3)]);
- break;
-
- case 'A':
- fprintf_filtered (stream, "%s",
- reg_names[fetch_arg (buffer, place, 3) + 010]);
- break;
-
- case 'R':
- fprintf_filtered (stream, "%s", reg_names[fetch_arg (buffer, place, 4)]);
- break;
-
- case 'F':
- fprintf_filtered (stream, "fp%d", fetch_arg (buffer, place, 3));
- break;
-
- case 'O':
- val = fetch_arg (buffer, place, 6);
- if (val & 0x20)
- fprintf_filtered (stream, "%s", reg_names [val & 7]);
- else
- fprintf_filtered (stream, "%d", val);
- break;
-
- case '+':
- fprintf_filtered (stream, "%s@+",
- reg_names[fetch_arg (buffer, place, 3) + 8]);
- break;
-
- case '-':
- fprintf_filtered (stream, "%s@-",
- reg_names[fetch_arg (buffer, place, 3) + 8]);
- break;
-
- case 'k':
- if (place == 'k')
- fprintf_filtered (stream, "{%s}", reg_names[fetch_arg (buffer, place, 3)]);
- else if (place == 'C')
- {
- val = fetch_arg (buffer, place, 7);
- if ( val > 63 ) /* This is a signed constant. */
- val -= 128;
- fprintf_filtered (stream, "{#%d}", val);
- }
- else
- error ("Invalid arg format in opcode table: \"%c%c\".",
- *d, place);
- break;
-
- case '#':
- case '^':
- p1 = buffer + (*d == '#' ? 2 : 4);
- if (place == 's')
- val = fetch_arg (buffer, place, 4);
- else if (place == 'C')
- val = fetch_arg (buffer, place, 7);
- else if (place == '8')
- val = fetch_arg (buffer, place, 3);
- else if (place == '3')
- val = fetch_arg (buffer, place, 8);
- else if (place == 'b')
- val = NEXTBYTE (p1);
- else if (place == 'w')
- val = NEXTWORD (p1);
- else if (place == 'l')
- val = NEXTLONG (p1);
- else
- error ("Invalid arg format in opcode table: \"%c%c\".",
- *d, place);
- fprintf_filtered (stream, "#%d", val);
- break;
-
- case 'B':
- if (place == 'b')
- val = NEXTBYTE (p);
- else if (place == 'B')
- val = buffer[1];
- else if (place == 'w' || place == 'W')
- val = NEXTWORD (p);
- else if (place == 'l' || place == 'L')
- val = NEXTLONG (p);
- else if (place == 'g')
- {
- val = ((char *)buffer)[1];
- if (val == 0)
- val = NEXTWORD (p);
- else if (val == -1)
- val = NEXTLONG (p);
- }
- else if (place == 'c')
- {
- if (buffer[1] & 0x40) /* If bit six is one, long offset */
- val = NEXTLONG (p);
- else
- val = NEXTWORD (p);
- }
- else
- error ("Invalid arg format in opcode table: \"%c%c\".",
- *d, place);
-
- print_address (addr + val, stream);
- break;
-
- case 'd':
- val = NEXTWORD (p);
- fprintf_filtered (stream, "%s@(%d)",
- reg_names[fetch_arg (buffer, place, 3)], val);
- break;
-
- case 's':
- fprintf_filtered (stream, "%s",
- fpcr_names[fetch_arg (buffer, place, 3)]);
- break;
-
- case 'I':
- val = fetch_arg (buffer, 'd', 3); /* Get coprocessor ID... */
- if (val != 1) /* Unusual coprocessor ID? */
- fprintf_filtered (stream, "(cpid=%d) ", val);
- if (place == 'i')
- p += 2; /* Skip coprocessor extended operands */
- break;
-
- case '*':
- case '~':
- case '%':
- case ';':
- case '@':
- case '!':
- case '$':
- case '?':
- case '/':
- case '&':
-
- if (place == 'd')
- {
- val = fetch_arg (buffer, 'x', 6);
- val = ((val & 7) << 3) + ((val >> 3) & 7);
- }
- else
- val = fetch_arg (buffer, 's', 6);
-
- /* Get register number assuming address register. */
- regno = (val & 7) + 8;
- regname = reg_names[regno];
- switch (val >> 3)
- {
- case 0:
- fprintf_filtered (stream, "%s", reg_names[val]);
- break;
-
- case 1:
- fprintf_filtered (stream, "%s", regname);
- break;
-
- case 2:
- fprintf_filtered (stream, "%s@", regname);
- break;
-
- case 3:
- fprintf_filtered (stream, "%s@+", regname);
- break;
-
- case 4:
- fprintf_filtered (stream, "%s@-", regname);
- break;
-
- case 5:
- val = NEXTWORD (p);
- fprintf_filtered (stream, "%s@(%d)", regname, val);
- break;
-
- case 6:
- p = print_indexed (regno, p, addr, stream);
- break;
-
- case 7:
- switch (val & 7)
- {
- case 0:
- val = NEXTWORD (p);
- fprintf_filtered (stream, "@#");
- print_address (val, stream);
- break;
-
- case 1:
- val = NEXTLONG (p);
- fprintf_filtered (stream, "@#");
- print_address (val, stream);
- break;
-
- case 2:
- val = NEXTWORD (p);
- print_address (addr + val, stream);
- break;
-
- case 3:
- p = print_indexed (-1, p, addr, stream);
- break;
-
- case 4:
- flt_p = 1; /* Assume it's a float... */
- switch( place )
- {
- case 'b':
- val = NEXTBYTE (p);
- flt_p = 0;
- break;
-
- case 'w':
- val = NEXTWORD (p);
- flt_p = 0;
- break;
-
- case 'l':
- val = NEXTLONG (p);
- flt_p = 0;
- break;
-
- case 'f':
- flval = NEXTSINGLE(p);
- break;
-
- case 'F':
- flval = NEXTDOUBLE(p);
- break;
-
- case 'x':
- flval = NEXTEXTEND(p);
- break;
-
- case 'p':
- flval = NEXTPACKED(p);
- break;
-
- default:
- error ("Invalid arg format in opcode table: \"%c%c\".",
- *d, place);
- }
- if ( flt_p ) /* Print a float? */
- fprintf_filtered (stream, "#%g", flval);
- else
- fprintf_filtered (stream, "#%d", val);
- break;
-
- default:
- fprintf_filtered (stream, "<invalid address mode 0%o>", val);
- }
- }
- break;
-
- case 'L':
- case 'l':
- if (place == 'w')
- {
- char doneany;
- p1 = buffer + 2;
- val = NEXTWORD (p1);
- /* Move the pointer ahead if this point is farther ahead
- than the last. */
- p = p1 > p ? p1 : p;
- if (val == 0)
- {
- fputs_filtered ("#0", stream);
- break;
- }
- if (*d == 'l')
- {
- register int newval = 0;
- for (regno = 0; regno < 16; ++regno)
- if (val & (0x8000 >> regno))
- newval |= 1 << regno;
- val = newval;
- }
- val &= 0xffff;
- doneany = 0;
- for (regno = 0; regno < 16; ++regno)
- if (val & (1 << regno))
- {
- int first_regno;
- if (doneany)
- fputs_filtered ("/", stream);
- doneany = 1;
- fprintf_filtered (stream, "%s", reg_names[regno]);
- first_regno = regno;
- while (val & (1 << (regno + 1)))
- ++regno;
- if (regno > first_regno)
- fprintf_filtered (stream, "-%s", reg_names[regno]);
- }
- }
- else if (place == '3')
- {
- /* `fmovem' insn. */
- char doneany;
- val = fetch_arg (buffer, place, 8);
- if (val == 0)
- {
- fputs_filtered ("#0", stream);
- break;
- }
- if (*d == 'l')
- {
- register int newval = 0;
- for (regno = 0; regno < 8; ++regno)
- if (val & (0x80 >> regno))
- newval |= 1 << regno;
- val = newval;
- }
- val &= 0xff;
- doneany = 0;
- for (regno = 0; regno < 8; ++regno)
- if (val & (1 << regno))
- {
- int first_regno;
- if (doneany)
- fputs_filtered ("/", stream);
- doneany = 1;
- fprintf_filtered (stream, "fp%d", regno);
- first_regno = regno;
- while (val & (1 << (regno + 1)))
- ++regno;
- if (regno > first_regno)
- fprintf_filtered (stream, "-fp%d", regno);
- }
- }
- else
- abort ();
- break;
-
- default:
- error ("Invalid arg format in opcode table: \"%c\".", *d);
- }
-
- return (unsigned char *) p;
-}
-
-/* Fetch BITS bits from a position in the instruction specified by CODE.
- CODE is a "place to put an argument", or 'x' for a destination
- that is a general address (mode and register).
- BUFFER contains the instruction. */
-
-static int
-fetch_arg (buffer, code, bits)
- unsigned char *buffer;
- char code;
- int bits;
-{
- register int val;
- switch (code)
- {
- case 's':
- val = buffer[1];
- break;
-
- case 'd': /* Destination, for register or quick. */
- val = (buffer[0] << 8) + buffer[1];
- val >>= 9;
- break;
-
- case 'x': /* Destination, for general arg */
- val = (buffer[0] << 8) + buffer[1];
- val >>= 6;
- break;
-
- case 'k':
- val = (buffer[3] >> 4);
- break;
-
- case 'C':
- val = buffer[3];
- break;
-
- case '1':
- val = (buffer[2] << 8) + buffer[3];
- val >>= 12;
- break;
-
- case '2':
- val = (buffer[2] << 8) + buffer[3];
- val >>= 6;
- break;
-
- case '3':
- case 'j':
- val = (buffer[2] << 8) + buffer[3];
- break;
-
- case '4':
- val = (buffer[4] << 8) + buffer[5];
- val >>= 12;
- break;
-
- case '5':
- val = (buffer[4] << 8) + buffer[5];
- val >>= 6;
- break;
-
- case '6':
- val = (buffer[4] << 8) + buffer[5];
- break;
-
- case '7':
- val = (buffer[2] << 8) + buffer[3];
- val >>= 7;
- break;
-
- case '8':
- val = (buffer[2] << 8) + buffer[3];
- val >>= 10;
- break;
-
- default:
- abort ();
- }
-
- switch (bits)
- {
- case 3:
- return val & 7;
- case 4:
- return val & 017;
- case 5:
- return val & 037;
- case 6:
- return val & 077;
- case 7:
- return val & 0177;
- case 8:
- return val & 0377;
- case 12:
- return val & 07777;
- default:
- abort ();
- }
-}
-
-/* Print an indexed argument. The base register is BASEREG (-1 for pc).
- P points to extension word, in buffer.
- ADDR is the nominal core address of that extension word. */
-
-static unsigned char *
-print_indexed (basereg, p, addr, stream)
- int basereg;
- unsigned char *p;
- FILE *stream;
- CORE_ADDR addr;
-{
- register int word;
- static char *scales[] = {"", "*2", "*4", "*8"};
- register int base_disp;
- register int outer_disp;
- char buf[40];
-
- word = NEXTWORD (p);
-
- /* Generate the text for the index register.
- Where this will be output is not yet determined. */
- sprintf (buf, "[%s.%c%s]",
- reg_names[(word >> 12) & 0xf],
- (word & 0x800) ? 'l' : 'w',
- scales[(word >> 9) & 3]);
-
- /* Handle the 68000 style of indexing. */
-
- if ((word & 0x100) == 0)
- {
- print_base (basereg,
- ((word & 0x80) ? word | 0xff00 : word & 0xff)
- + ((basereg == -1) ? addr : 0),
- stream);
- fputs_filtered (buf, stream);
- return p;
- }
-
- /* Handle the generalized kind. */
- /* First, compute the displacement to add to the base register. */
-
- if (word & 0200)
- basereg = -2;
- if (word & 0100)
- buf[0] = 0;
- base_disp = 0;
- switch ((word >> 4) & 3)
- {
- case 2:
- base_disp = NEXTWORD (p);
- break;
- case 3:
- base_disp = NEXTLONG (p);
- }
- if (basereg == -1)
- base_disp += addr;
-
- /* Handle single-level case (not indirect) */
-
- if ((word & 7) == 0)
- {
- print_base (basereg, base_disp, stream);
- fputs_filtered (buf, stream);
- return p;
- }
-
- /* Two level. Compute displacement to add after indirection. */
-
- outer_disp = 0;
- switch (word & 3)
- {
- case 2:
- outer_disp = NEXTWORD (p);
- break;
- case 3:
- outer_disp = NEXTLONG (p);
- }
-
- fprintf_filtered (stream, "%d(", outer_disp);
- print_base (basereg, base_disp, stream);
-
- /* If postindexed, print the closeparen before the index. */
- if (word & 4)
- fprintf_filtered (stream, ")%s", buf);
- /* If preindexed, print the closeparen after the index. */
- else
- fprintf_filtered (stream, "%s)", buf);
-
- return p;
-}
-
-/* Print a base register REGNO and displacement DISP, on STREAM.
- REGNO = -1 for pc, -2 for none (suppressed). */
-
-static void
-print_base (regno, disp, stream)
- int regno;
- int disp;
- FILE *stream;
-{
- if (regno == -2)
- fprintf_filtered (stream, "%d", disp);
- else if (regno == -1)
- fprintf_filtered (stream, "0x%x", disp);
- else
- fprintf_filtered (stream, "%d(%s)", disp, reg_names[regno]);
-}
diff --git a/gdb/m68k-stub.c b/gdb/m68k-stub.c
deleted file mode 100644
index ae7553a..0000000
--- a/gdb/m68k-stub.c
+++ /dev/null
@@ -1,980 +0,0 @@
-/****************************************************************************
-
- THIS SOFTWARE IS NOT COPYRIGHTED
-
- HP offers the following for use in the public domain. HP makes no
- warranty with regard to the software or it's performance and the
- user accepts the software "AS IS" with all faults.
-
- HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
- TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-****************************************************************************/
-
-/****************************************************************************
- * $Header$
- *
- * $Module name: remcom.c $
- * $Revision$
- * $Date$
- * $Contributor: Lake Stevens Instrument Division$
- *
- * $Description: low level support for gdb debugger. $
- *
- * $Considerations: only works on target hardware $
- *
- * $Written by: Glenn Engel $
- * $ModuleState: Experimental $
- *
- * $NOTES: See Below $
- *
- * To enable debugger support, two things need to happen. One, a
- * call to set_debug_traps() is necessary in order to allow any breakpoints
- * or error conditions to be properly intercepted and reported to gdb.
- * Two, a breakpoint needs to be generated to begin communication. This
- * is most easily accomplished by a call to breakpoint(). Breakpoint()
- * simulates a breakpoint by executing a trap #1.
- *
- * Some explanation is probably necessary to explain how exceptions are
- * handled. When an exception is encountered the 68000 pushes the current
- * program counter and status register onto the supervisor stack and then
- * transfers execution to a location specified in it's vector table.
- * The handlers for the exception vectors are hardwired to jmp to an address
- * given by the relation: (exception - 256) * 6. These are decending
- * addresses starting from -6, -12, -18, ... By allowing 6 bytes for
- * each entry, a jsr, jmp, bsr, ... can be used to enter the exception
- * handler. Using a jsr to handle an exception has an added benefit of
- * allowing a single handler to service several exceptions and use the
- * return address as the key differentiation. The vector number can be
- * computed from the return address by [ exception = (addr + 1530) / 6 ].
- * The sole purpose of the routine _catchException is to compute the
- * exception number and push it on the stack in place of the return address.
- * The external function exceptionHandler() is
- * used to attach a specific handler to a specific 68k exception.
- * For 68020 machines, the ability to have a return address around just
- * so the vector can be determined is not necessary because the '020 pushes an
- * extra word onto the stack containing the vector offset
- *
- * Because gdb will sometimes write to the stack area to execute function
- * calls, this program cannot rely on using the supervisor stack so it
- * uses it's own stack area reserved in the int array remcomStack.
- *
- *************
- *
- * The following gdb commands are supported:
- *
- * command function Return value
- *
- * g return the value of the CPU registers hex data or ENN
- * G set the value of the CPU registers OK or ENN
- *
- * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
- * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
- *
- * c Resume at current address SNN ( signal NN)
- * cAA..AA Continue at address AA..AA SNN
- *
- * s Step one instruction SNN
- * sAA..AA Step one instruction from AA..AA SNN
- *
- * k kill
- *
- * ? What was the last sigval ? SNN (signal NN)
- *
- * All commands and responses are sent with a packet which includes a
- * checksum. A packet consists of
- *
- * $<packet info>#<checksum>.
- *
- * where
- * <packet info> :: <characters representing the command or response>
- * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
- *
- * When a packet is received, it is first acknowledged with either '+' or '-'.
- * '+' indicates a successful transfer. '-' indicates a failed transfer.
- *
- * Example:
- *
- * Host: Reply:
- * $m0,10#2a +$00010203040506070809101112131415#42
- *
- ****************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-#include <setjmp.h>
-
-/************************************************************************
- *
- * external low-level support routines
- */
-typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
-typedef void (*Function)(); /* pointer to a function */
-
-extern putDebugChar(); /* write a single character */
-extern getDebugChar(); /* read and return a single char */
-
-extern Function exceptionHandler(); /* assign an exception handler */
-extern ExceptionHook exceptionHook; /* hook variable for errors/exceptions */
-
-/************************/
-/* FORWARD DECLARATIONS */
-/************************/
-void initializeRemcomErrorFrame(void);
-
-/************************************************************************/
-/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
-/* at least NUMREGBYTES*2 are needed for register packets */
-#define BUFMAX 400
-
-static char initialized; /* boolean flag. != 0 means we've been initialized */
-
-int remote_debug;
-/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
-
-static const char hexchars[]="0123456789abcdef";
-
-/* there are 180 bytes of registers on a 68020 w/68881 */
-/* many of the fpa registers are 12 byte (96 bit) registers */
-#define NUMREGBYTES 180
-enum regnames {D0,D1,D2,D3,D4,D5,D6,D7,
- A0,A1,A2,A3,A4,A5,A6,A7,
- PS,PC,
- FP0,FP1,FP2,FP3,FP4,FP5,FP6,FP7,
- FPCONTROL,FPSTATUS,FPIADDR
- };
-
-typedef struct FrameStruct
-{
- struct FrameStruct *previous;
- int exceptionPC; /* pc value when this frame created */
- int exceptionVector; /* cpu vector causing exception */
- short frameSize; /* size of cpu frame in words */
- short sr; /* for 68000, this not always sr */
- int pc;
- short format;
- int fsaveHeader;
- int morejunk[0]; /* exception frame, fp save... */
-} Frame;
-
-#define FRAMESIZE 500
-int gdbFrameStack[FRAMESIZE];
-static Frame *lastFrame;
-
-/*
- * these should not be static cuz they can be used outside this module
- */
-int registers[NUMREGBYTES/4];
-int superStack;
-
-#define STACKSIZE 10000
-int remcomStack[STACKSIZE/sizeof(int)];
-static int* stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
-
-/*
- * In many cases, the system will want to continue exception processing
- * when a continue command is given.
- * oldExceptionHook is a function to invoke in this case.
- */
-
-static ExceptionHook oldExceptionHook;
-
-/* the size of the exception stack on the 68020 varies with the type of
- * exception. The following table is the number of WORDS used
- * for each exception format.
- */
-const short exceptionSize[] = { 4,4,6,4,4,4,4,4,29,10,16,46,12,4,4,4 };
-
-/************* jump buffer used for setjmp/longjmp **************************/
-jmp_buf remcomEnv;
-
-/*************************** ASSEMBLY CODE MACROS *************************/
-/* */
-
-#ifdef __HAVE_68881__
-/* do an fsave, then remember the address to begin a restore from */
-#define SAVE_FP_REGS() asm(" fsave a0@-"); \
- asm(" fmovemx fp0-fp7,_registers+72"); \
- asm(" fmoveml fpcr/fpsr/fpi,_registers+168");
-#define RESTORE_FP_REGS() \
-asm(" \n\
- fmoveml _registers+168,fpcr/fpsr/fpi \n\
- fmovemx _registers+72,fp0-fp7 \n\
- cmpl #-1,a0@ | skip frestore flag set ? \n\
- beq skip_frestore \n\
- frestore a0@+ \n\
-skip_frestore: \n\
-");
-
-#else
-#define SAVE_FP_REGS()
-#define RESTORE_FP_REGS()
-#endif /* __HAVE_68881__ */
-
-void return_to_super(void);
-void return_to_user(void);
-
-asm("
-.text
-.globl _return_to_super
-_return_to_super:
- movel _registers+60,sp /* get new stack pointer */
- movel _lastFrame,a0 /* get last frame info */
- bra return_to_any
-
-.globl _return_to_user
-_return_to_user:
- movel _registers+60,a0 /* get usp */
- movel a0,usp /* set usp */
- movel _superStack,sp /* get original stack pointer */
-
-return_to_any:
- movel _lastFrame,a0 /* get last frame info */
- movel a0@+,_lastFrame /* link in previous frame */
- addql #8,a0 /* skip over pc, vector#*/
- movew a0@+,d0 /* get # of words in cpu frame */
- addw d0,a0 /* point to end of data */
- addw d0,a0 /* point to end of data */
- movel a0,a1
-#
-# copy the stack frame
- subql #1,d0
-copyUserLoop:
- movew a1@-,sp@-
- dbf d0,copyUserLoop
-");
- RESTORE_FP_REGS()
- asm(" moveml _registers,d0-d7/a0-a6");
- asm(" rte"); /* pop and go! */
-
-#define DISABLE_INTERRUPTS() asm(" oriw #0x0700,sr");
-#define BREAKPOINT() asm(" trap #1");
-
-/* this function is called immediately when a level 7 interrupt occurs */
-/* if the previous interrupt level was 7 then we're already servicing */
-/* this interrupt and an rte is in order to return to the debugger. */
-/* For the 68000, the offset for sr is 6 due to the jsr return address */
-asm("
-.text
-.globl __debug_level7
-__debug_level7:
- movew d0,sp@-");
-#ifdef mc68020
-asm(" movew sp@(2),d0");
-#else
-asm(" movew sp@(6),d0");
-#endif
-asm(" andiw #0x700,d0
- cmpiw #0x700,d0
- beq _already7
- movew sp@+,d0
- bra __catchException
-_already7:
- movew sp@+,d0");
-#ifndef mc68020
-asm(" lea sp@(4),sp"); /* pull off 68000 return address */
-#endif
-asm(" rte");
-
-extern void _catchException();
-
-#ifdef mc68020
-/* This function is called when a 68020 exception occurs. It saves
- * all the cpu and fpcp regs in the _registers array, creates a frame on a
- * linked list of frames which has the cpu and fpcp stack frames needed
- * to properly restore the context of these processors, and invokes
- * an exception handler (remcom_handler).
- *
- * stack on entry: stack on exit:
- * N bytes of junk exception # MSWord
- * Exception Format Word exception # MSWord
- * Program counter LSWord
- * Program counter MSWord
- * Status Register
- *
- *
- */
-asm("
-.text
-.globl __catchException
-__catchException:");
-DISABLE_INTERRUPTS();
-asm("
- moveml d0-d7/a0-a6,_registers /* save registers */
- movel _lastFrame,a0 /* last frame pointer */
-");
-SAVE_FP_REGS();
-asm("
- lea _registers,a5 /* get address of registers */
- movew sp@,d1 /* get status register */
- movew d1,a5@(66) /* save sr */
- movel sp@(2),a4 /* save pc in a4 for later use */
- movel a4,a5@(68) /* save pc in _regisers[] */
-
-#
-# figure out how many bytes in the stack frame
- movew sp@(6),d0 /* get '020 exception format */
- movew d0,d2 /* make a copy of format word */
- andiw #0xf000,d0 /* mask off format type */
- rolw #5,d0 /* rotate into the low byte *2 */
- lea _exceptionSize,a1
- addw d0,a1 /* index into the table */
- movew a1@,d0 /* get number of words in frame */
- movew d0,d3 /* save it */
- subw d0,a0 /* adjust save pointer */
- subw d0,a0 /* adjust save pointer(bytes) */
- movel a0,a1 /* copy save pointer */
- subql #1,d0 /* predecrement loop counter */
-#
-# copy the frame
-saveFrameLoop:
- movew sp@+,a1@+
- dbf d0,saveFrameLoop
-#
-# now that the stack has been clenaed,
-# save the a7 in use at time of exception
- movel sp,_superStack /* save supervisor sp */
- andiw #0x2000,d1 /* were we in supervisor mode ? */
- beq userMode
- movel a7,a5@(60) /* save a7 */
- bra a7saveDone
-userMode:
- movel usp,a1
- movel a1,a5@(60) /* save user stack pointer */
-a7saveDone:
-
-#
-# save size of frame
- movew d3,a0@-
-
-#
-# compute exception number
- andl #0xfff,d2 /* mask off vector offset */
- lsrw #2,d2 /* divide by 4 to get vect num */
- movel d2,a0@- /* save it */
-#
-# save pc causing exception
- movel a4,a0@-
-#
-# save old frame link and set the new value
- movel _lastFrame,a1 /* last frame pointer */
- movel a1,a0@- /* save pointer to prev frame */
- movel a0,_lastFrame
-
- movel d2,sp@- /* push exception num */
- movel _exceptionHook,a0 /* get address of handler */
- jbsr a0@ /* and call it */
- clrl sp@ /* replace exception num parm with frame ptr */
- jbsr __returnFromException /* jbsr, but never returns */
-");
-#else /* mc68000 */
-/* This function is called when an exception occurs. It translates the
- * return address found on the stack into an exception vector # which
- * is then handled by either handle_exception or a system handler.
- * _catchException provides a front end for both.
- *
- * stack on entry: stack on exit:
- * Program counter MSWord exception # MSWord
- * Program counter LSWord exception # MSWord
- * Status Register
- * Return Address MSWord
- * Return Address LSWord
- */
-asm("
-.text
-.globl __catchException
-__catchException:");
-DISABLE_INTERRUPTS();
-asm("
- moveml d0-d7/a0-a6,_registers /* save registers */
- movel _lastFrame,a0 /* last frame pointer */
-");
-SAVE_FP_REGS();
-asm("
- lea _registers,a5 /* get address of registers */
- movel sp@+,d2 /* pop return address */
- addl #1530,d2 /* convert return addr to */
- divs #6,d2 /* exception number */
- extl d2
-
- moveql #3,d3 /* assume a three word frame */
-
- cmpiw #3,d2 /* bus error or address error ? */
- bgt normal /* if >3 then normal error */
- movel sp@+,a0@- /* copy error info to frame buff*/
- movel sp@+,a0@- /* these are never used */
- moveql #7,d3 /* this is a 7 word frame */
-
-normal:
- movew sp@+,d1 /* pop status register */
- movel sp@+,a4 /* pop program counter */
- movew d1,a5@(66) /* save sr */
- movel a4,a5@(68) /* save pc in _regisers[] */
- movel a4,a0@- /* copy pc to frame buffer */
- movew d1,a0@- /* copy sr to frame buffer */
-
- movel sp,_superStack /* save supervisor sp */
-
- andiw #0x2000,d1 /* were we in supervisor mode ? */
- beq userMode
- movel a7,a5@(60) /* save a7 */
- bra saveDone
-userMode:
- movel usp,a1 /* save user stack pointer */
- movel a1,a5@(60) /* save user stack pointer */
-saveDone:
-
- movew d3,a0@- /* push frame size in words */
- movel d2,a0@- /* push vector number */
- movel a4,a0@- /* push exception pc */
-
-#
-# save old frame link and set the new value
- movel _lastFrame,a1 /* last frame pointer */
- movel a1,a0@- /* save pointer to prev frame */
- movel a0,_lastFrame
-
- movel d2,sp@- /* push exception num */
- movel _exceptionHook,a0 /* get address of handler */
- jbsr a0@ /* and call it */
- clrl sp@ /* replace exception num parm with frame ptr */
- jbsr __returnFromException /* jbsr, but never returns */
-");
-#endif
-
-
-/*
- * remcomHandler is a front end for handle_exception. It moves the
- * stack pointer into an area reserved for debugger use in case the
- * breakpoint happened in supervisor mode.
- */
-asm("_remcomHandler:");
-asm(" addl #4,sp"); /* pop off return address */
-asm(" movel sp@+,d0"); /* get the exception number */
-asm(" movel _stackPtr,sp"); /* move to remcom stack area */
-asm(" movel d0,sp@-"); /* push exception onto stack */
-asm(" jbsr _handle_exception"); /* this never returns */
-asm(" rts"); /* return */
-
-void _returnFromException( Frame *frame )
-{
- /* if no passed in frame, use the last one */
- if (! frame)
- {
- frame = lastFrame;
- frame->frameSize = 4;
- frame->format = 0;
- frame->fsaveHeader = -1; /* restore regs, but we dont have fsave info*/
- }
-
-#ifndef mc68020
- /* a 68000 cannot use the internal info pushed onto a bus error
- * or address error frame when doing an RTE so don't put this info
- * onto the stack or the stack will creep every time this happens.
- */
- frame->frameSize=3;
-#endif
-
- /* throw away any frames in the list after this frame */
- lastFrame = frame;
-
- frame->sr = registers[(int) PS];
- frame->pc = registers[(int) PC];
-
- if (registers[(int) PS] & 0x2000)
- {
- /* return to supervisor mode... */
- return_to_super();
- }
- else
- { /* return to user mode */
- return_to_user();
- }
-}
-
-int hex(ch)
-char ch;
-{
- if ((ch >= 'a') && (ch <= 'f')) return (ch-'a'+10);
- if ((ch >= '0') && (ch <= '9')) return (ch-'0');
- if ((ch >= 'A') && (ch <= 'F')) return (ch-'A'+10);
- return (-1);
-}
-
-
-/* scan for the sequence $<data>#<checksum> */
-void getpacket(buffer)
-char * buffer;
-{
- unsigned char checksum;
- unsigned char xmitcsum;
- int i;
- int count;
- char ch;
-
- do {
- /* wait around for the start character, ignore all other characters */
- while ((ch = getDebugChar()) != '$');
- checksum = 0;
- xmitcsum = -1;
-
- count = 0;
-
- /* now, read until a # or end of buffer is found */
- while (count < BUFMAX) {
- ch = getDebugChar();
- if (ch == '#') break;
- checksum = checksum + ch;
- buffer[count] = ch;
- count = count + 1;
- }
- buffer[count] = 0;
-
- if (ch == '#') {
- xmitcsum = hex(getDebugChar()) << 4;
- xmitcsum += hex(getDebugChar());
- if ((remote_debug ) && (checksum != xmitcsum)) {
- fprintf(stderr,"bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
- checksum,xmitcsum,buffer);
- }
-
- if (checksum != xmitcsum) putDebugChar('-'); /* failed checksum */
- else {
- putDebugChar('+'); /* successful transfer */
- /* if a sequence char is present, reply the sequence ID */
- if (buffer[2] == ':') {
- putDebugChar( buffer[0] );
- putDebugChar( buffer[1] );
- /* remove sequence chars from buffer */
- count = strlen(buffer);
- for (i=3; i <= count; i++) buffer[i-3] = buffer[i];
- }
- }
- }
- } while (checksum != xmitcsum);
-
-}
-
-/* send the packet in buffer. The host get's one chance to read it.
- This routine does not wait for a positive acknowledge. */
-
-
-void putpacket(buffer)
-char * buffer;
-{
- unsigned char checksum;
- int count;
- char ch;
-
- /* $<packet info>#<checksum>. */
- do {
- putDebugChar('$');
- checksum = 0;
- count = 0;
-
- while (ch=buffer[count]) {
- if (! putDebugChar(ch)) return;
- checksum += ch;
- count += 1;
- }
-
- putDebugChar('#');
- putDebugChar(hexchars[checksum >> 4]);
- putDebugChar(hexchars[checksum % 16]);
-
- } while (1 == 0); /* (getDebugChar() != '+'); */
-
-}
-
-char remcomInBuffer[BUFMAX];
-char remcomOutBuffer[BUFMAX];
-static short error;
-
-
-void debug_error(format, parm)
-char * format;
-char * parm;
-{
- if (remote_debug) fprintf(stderr,format,parm);
-}
-
-/* convert the memory pointed to by mem into hex, placing result in buf */
-/* return a pointer to the last char put in buf (null) */
-char* mem2hex(mem, buf, count)
-char* mem;
-char* buf;
-int count;
-{
- int i;
- unsigned char ch;
- for (i=0;i<count;i++) {
- ch = *mem++;
- *buf++ = hexchars[ch >> 4];
- *buf++ = hexchars[ch % 16];
- }
- *buf = 0;
- return(buf);
-}
-
-/* convert the hex array pointed to by buf into binary to be placed in mem */
-/* return a pointer to the character AFTER the last byte written */
-char* hex2mem(buf, mem, count)
-char* buf;
-char* mem;
-int count;
-{
- int i;
- unsigned char ch;
- for (i=0;i<count;i++) {
- ch = hex(*buf++) << 4;
- ch = ch + hex(*buf++);
- *mem++ = ch;
- }
- return(mem);
-}
-
-/* a bus error has occurred, perform a longjmp
- to return execution and allow handling of the error */
-
-void handle_buserror()
-{
- longjmp(remcomEnv,1);
-}
-
-/* this function takes the 68000 exception number and attempts to
- translate this number into a unix compatible signal value */
-int computeSignal( exceptionVector )
-int exceptionVector;
-{
- int sigval;
- switch (exceptionVector) {
- case 2 : sigval = 10; break; /* bus error */
- case 3 : sigval = 10; break; /* address error */
- case 4 : sigval = 4; break; /* illegal instruction */
- case 5 : sigval = 8; break; /* zero divide */
- case 6 : sigval = 16; break; /* chk instruction */
- case 7 : sigval = 16; break; /* trapv instruction */
- case 8 : sigval = 11; break; /* privilege violation */
- case 9 : sigval = 5; break; /* trace trap */
- case 10: sigval = 4; break; /* line 1010 emulator */
- case 11: sigval = 4; break; /* line 1111 emulator */
- case 13: sigval = 8; break; /* floating point err */
- case 31: sigval = 2; break; /* interrupt */
- case 33: sigval = 5; break; /* breakpoint */
- case 40: sigval = 8; break; /* floating point err */
- case 48: sigval = 8; break; /* floating point err */
- case 49: sigval = 8; break; /* floating point err */
- case 50: sigval = 8; break; /* zero divide */
- case 51: sigval = 8; break; /* underflow */
- case 52: sigval = 8; break; /* operand error */
- case 53: sigval = 8; break; /* overflow */
- case 54: sigval = 8; break; /* NAN */
- default:
- sigval = 7; /* "software generated"*/
- }
- return (sigval);
-}
-
-/**********************************************/
-/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
-/* RETURN NUMBER OF CHARS PROCESSED */
-/**********************************************/
-int hexToInt(char **ptr, int *intValue)
-{
- int numChars = 0;
- int hexValue;
-
- *intValue = 0;
-
- while (**ptr)
- {
- hexValue = hex(**ptr);
- if (hexValue >=0)
- {
- *intValue = (*intValue <<4) | hexValue;
- numChars ++;
- }
- else
- break;
-
- (*ptr)++;
- }
-
- return (numChars);
-}
-
-/*
- * This function does all command procesing for interfacing to gdb.
- */
-void handle_exception(int exceptionVector)
-{
- int sigval;
- int addr, length;
- char * ptr;
- int newPC;
- Frame *frame;
-
- if (remote_debug) printf("vector=%d, sr=0x%x, pc=0x%x\n",
- exceptionVector,
- registers[ PS ],
- registers[ PC ]);
-
- /* reply to host that an exception has occurred */
- sigval = computeSignal( exceptionVector );
- remcomOutBuffer[0] = 'S';
- remcomOutBuffer[1] = hexchars[sigval >> 4];
- remcomOutBuffer[2] = hexchars[sigval % 16];
- remcomOutBuffer[3] = 0;
-
- putpacket(remcomOutBuffer);
-
- while (1==1) {
- error = 0;
- remcomOutBuffer[0] = 0;
- getpacket(remcomInBuffer);
- switch (remcomInBuffer[0]) {
- case '?' : remcomOutBuffer[0] = 'S';
- remcomOutBuffer[1] = hexchars[sigval >> 4];
- remcomOutBuffer[2] = hexchars[sigval % 16];
- remcomOutBuffer[3] = 0;
- break;
- case 'd' : remote_debug = !(remote_debug); /* toggle debug flag */
- break;
- case 'g' : /* return the value of the CPU registers */
- mem2hex((char*) registers, remcomOutBuffer, NUMREGBYTES);
- break;
- case 'G' : /* set the value of the CPU registers - return OK */
- hex2mem(&remcomInBuffer[1], (char*) registers, NUMREGBYTES);
- strcpy(remcomOutBuffer,"OK");
- break;
-
- /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
- case 'm' :
- if (setjmp(remcomEnv) == 0)
- {
- exceptionHandler(2,handle_buserror);
-
- /* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
- ptr = &remcomInBuffer[1];
- if (hexToInt(&ptr,&addr))
- if (*(ptr++) == ',')
- if (hexToInt(&ptr,&length))
- {
- ptr = 0;
- mem2hex((char*) addr, remcomOutBuffer, length);
- }
-
- if (ptr)
- {
- strcpy(remcomOutBuffer,"E01");
- debug_error("malformed read memory command: %s",remcomInBuffer);
- }
- }
- else {
- exceptionHandler(2,_catchException);
- strcpy(remcomOutBuffer,"E03");
- debug_error("bus error");
- }
-
- /* restore handler for bus error */
- exceptionHandler(2,_catchException);
- break;
-
- /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
- case 'M' :
- if (setjmp(remcomEnv) == 0) {
- exceptionHandler(2,handle_buserror);
-
- /* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
- ptr = &remcomInBuffer[1];
- if (hexToInt(&ptr,&addr))
- if (*(ptr++) == ',')
- if (hexToInt(&ptr,&length))
- if (*(ptr++) == ':')
- {
- hex2mem(ptr, (char*) addr, length);
- ptr = 0;
- strcpy(remcomOutBuffer,"OK");
- }
- if (ptr)
- {
- strcpy(remcomOutBuffer,"E02");
- debug_error("malformed write memory command: %s",remcomInBuffer);
- }
- }
- else {
- exceptionHandler(2,_catchException);
- strcpy(remcomOutBuffer,"E03");
- debug_error("bus error");
- }
-
- /* restore handler for bus error */
- exceptionHandler(2,_catchException);
- break;
-
- /* cAA..AA Continue at address AA..AA(optional) */
- /* sAA..AA Step one instruction from AA..AA(optional) */
- case 'c' :
- case 's' :
- /* try to read optional parameter, pc unchanged if no parm */
- ptr = &remcomInBuffer[1];
- if (hexToInt(&ptr,&addr))
- registers[ PC ] = addr;
-
- newPC = registers[ PC];
-
- /* clear the trace bit */
- registers[ PS ] &= 0x7fff;
-
- /* set the trace bit if we're stepping */
- if (remcomInBuffer[0] == 's') registers[ PS ] |= 0x8000;
-
- /*
- * look for newPC in the linked list of exception frames.
- * if it is found, use the old frame it. otherwise,
- * fake up a dummy frame in returnFromException().
- */
- if (remote_debug) printf("new pc = 0x%x\n",newPC);
- frame = lastFrame;
- while (frame)
- {
- if (remote_debug)
- printf("frame at 0x%x has pc=0x%x, except#=%d\n",
- frame,frame->exceptionPC,
- frame->exceptionVector);
- if (frame->exceptionPC == newPC) break; /* bingo! a match */
- /*
- * for a breakpoint instruction, the saved pc may
- * be off by two due to re-executing the instruction
- * replaced by the trap instruction. Check for this.
- */
- if ((frame->exceptionVector == 33) &&
- (frame->exceptionPC == (newPC+2))) break;
- if (frame == frame->previous)
- {
- frame = 0; /* no match found */
- break;
- }
- frame = frame->previous;
- }
-
- /*
- * If we found a match for the PC AND we are not returning
- * as a result of a breakpoint (33),
- * trace exception (9), nmi (31), jmp to
- * the old exception handler as if this code never ran.
- */
- if (frame)
- {
- if ((frame->exceptionVector != 9) &&
- (frame->exceptionVector != 31) &&
- (frame->exceptionVector != 33))
- {
- /*
- * invoke the previous handler.
- */
- if (oldExceptionHook)
- (*oldExceptionHook) (frame->exceptionVector);
- newPC = registers[ PC ]; /* pc may have changed */
- if (newPC != frame->exceptionPC)
- {
- if (remote_debug)
- printf("frame at 0x%x has pc=0x%x, except#=%d\n",
- frame,frame->exceptionPC,
- frame->exceptionVector);
- /* re-use the last frame, we're skipping it (longjump?)*/
- frame = (Frame *) 0;
- _returnFromException( frame ); /* this is a jump */
- }
- }
- }
-
- /* if we couldn't find a frame, create one */
- if (frame == 0)
- {
- frame = lastFrame -1 ;
-
- /* by using a bunch of print commands with breakpoints,
- it's possible for the frame stack to creep down. If it creeps
- too far, give up and reset it to the top. Normal use should
- not see this happen.
- */
- if ((unsigned int) (frame-2) < (unsigned int) &gdbFrameStack)
- {
- initializeRemcomErrorFrame();
- frame = lastFrame;
- }
- frame->previous = lastFrame;
- lastFrame = frame;
- frame = 0; /* null so _return... will properly initialize it */
- }
-
- _returnFromException( frame ); /* this is a jump */
-
- break;
-
- /* kill the program */
- case 'k' : /* do nothing */
- break;
- } /* switch */
-
- /* reply to the request */
- putpacket(remcomOutBuffer);
- }
-}
-
-
-void initializeRemcomErrorFrame(void)
-{
- lastFrame = ((Frame *) &gdbFrameStack[FRAMESIZE-1]) - 1;
- lastFrame->previous = lastFrame;
-}
-
-/* this function is used to set up exception handlers for tracing and
- breakpoints */
-void set_debug_traps()
-{
-extern void _debug_level7();
-extern void remcomHandler();
-int exception;
-
- initializeRemcomErrorFrame();
- stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
-
- for (exception = 2; exception <= 23; exception++)
- exceptionHandler(exception,_catchException);
-
- /* level 7 interrupt */
- exceptionHandler(31,_debug_level7);
-
- /* breakpoint exception (trap #1) */
- exceptionHandler(33,_catchException);
-
- /* floating point error (trap #8) */
- exceptionHandler(40,_catchException);
-
- /* 48 to 54 are floating point coprocessor errors */
- for (exception = 48; exception <= 54; exception++)
- exceptionHandler(exception,_catchException);
-
- if (oldExceptionHook != remcomHandler)
- {
- oldExceptionHook = exceptionHook;
- exceptionHook = remcomHandler;
- }
-
- initialized = 1;
-
-}
-
-/* This function will generate a breakpoint exception. It is used at the
- beginning of a program to sync up with a debugger and can be used
- otherwise as a quick means to stop program execution and "break" into
- the debugger. */
-
-void breakpoint()
-{
- if (initialized) BREAKPOINT();
-}
-
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
deleted file mode 100644
index 2408718..0000000
--- a/gdb/m68k-tdep.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/* Target dependent code for the Motorola 68000 series.
- Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "ieee-float.h"
-#include "param.h"
-#include "frame.h"
-#include "symtab.h"
-
-const struct ext_format ext_format_68881 = {
-/* tot sbyte smask expbyte manbyte */
- 12, 0, 0x80, 0,1, 4,8 /* mc68881 */
-};
-
-
-/* Things needed for making the inferior call functions.
- It seems like every m68k based machine has almost identical definitions
- in the individual machine's configuration files. Most other cpu types
- (mips, i386, etc) have routines in their *-tdep.c files to handle this
- for most configurations. The m68k family should be able to do this as
- well. These macros can still be overridden when necessary. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-void
-m68k_push_dummy_frame ()
-{
- register CORE_ADDR sp = read_register (SP_REGNUM);
- register int regnum;
- char raw_buffer[12];
-
- sp = push_word (sp, read_register (PC_REGNUM));
- sp = push_word (sp, read_register (FP_REGNUM));
- write_register (FP_REGNUM, sp);
-#if defined (HAVE_68881)
- for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--)
- {
- read_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12);
- sp = push_bytes (sp, raw_buffer, 12);
- }
-#endif
- for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)
- {
- sp = push_word (sp, read_register (regnum));
- }
- sp = push_word (sp, read_register (PS_REGNUM));
- write_register (SP_REGNUM, sp);
-}
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-
-void
-m68k_pop_frame ()
-{
- register FRAME frame = get_current_frame ();
- register CORE_ADDR fp;
- register int regnum;
- struct frame_saved_regs fsr;
- struct frame_info *fi;
- char raw_buffer[12];
-
- fi = get_frame_info (frame);
- fp = fi -> frame;
- get_frame_saved_regs (fi, &fsr);
-#if defined (HAVE_68881)
- for (regnum = FP0_REGNUM + 7 ; regnum >= FP0_REGNUM ; regnum--)
- {
- if (fsr.regs[regnum])
- {
- read_memory (fsr.regs[regnum], raw_buffer, 12);
- write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12);
- }
- }
-#endif
- for (regnum = FP_REGNUM - 1 ; regnum >= 0 ; regnum--)
- {
- if (fsr.regs[regnum])
- {
- write_register (regnum, read_memory_integer (fsr.regs[regnum], 4));
- }
- }
- if (fsr.regs[PS_REGNUM])
- {
- write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4));
- }
- write_register (FP_REGNUM, read_memory_integer (fp, 4));
- write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
- write_register (SP_REGNUM, fp + 8);
- flush_cached_frames ();
- set_current_frame (create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
-}
-
-
-/* Given an ip value corresponding to the start of a function,
- return the ip of the first instruction after the function
- prologue. This is the generic m68k support. Machines which
- require something different can override the SKIP_PROLOGUE
- macro to point elsewhere.
-
- Some instructions which typically may appear in a function
- prologue include:
-
- A link instruction, word form:
-
- link.w %a6,&0 4e56 XXXX
-
- A link instruction, long form:
-
- link.l %fp,&F%1 480e XXXX XXXX
-
- A movm instruction to preserve integer regs:
-
- movm.l &M%1,(4,%sp) 48ef XXXX XXXX
-
- A fmovm instruction to preserve float regs:
-
- fmovm &FPM%1,(FPO%1,%sp) f237 XXXX XXXX XXXX XXXX
-
- Some profiling setup code (FIXME, not recognized yet):
-
- lea.l (.L3,%pc),%a1 43fb XXXX XXXX XXXX
- bsr _mcount 61ff XXXX XXXX
-
- */
-
-#define P_LINK_L 0x480e
-#define P_LINK_W 0x4e56
-#define P_MOV_L 0x207c
-#define P_JSR 0x4eb9
-#define P_BSR 0x61ff
-#define P_LEA_L 0x43fb
-#define P_MOVM_L 0x48ef
-#define P_FMOVM 0xf237
-
-CORE_ADDR
-m68k_skip_prologue (ip)
-CORE_ADDR ip;
-{
- register CORE_ADDR limit;
- struct symtab_and_line sal;
- register int op;
-
- /* Find out if there is a known limit for the extent of the prologue.
- If so, ensure we don't go past it. If not, assume "infinity". */
-
- sal = find_pc_line (ip, 0);
- limit = (sal.end) ? sal.end : (CORE_ADDR) ~0;
-
- while (ip < limit)
- {
- op = read_memory_integer (ip, 2);
- op &= 0xFFFF;
-
- if (op == P_LINK_W)
- {
- ip += 4; /* Skip link.w */
- }
- else if (op == P_LINK_L)
- {
- ip += 6; /* Skip link.l */
- }
- else if (op == P_MOVM_L)
- {
- ip += 6; /* Skip movm.l */
- }
- else if (op == P_FMOVM)
- {
- ip += 10; /* Skip fmovm */
- }
- else
- {
- break; /* Found unknown code, bail out. */
- }
- }
- return (ip);
-}
-
-#ifdef USE_PROC_FS /* Target dependent support for /proc */
-
-#include <sys/procfs.h>
-
-/* The /proc interface divides the target machine's register set up into
- two different sets, the general register set (gregset) and the floating
- point register set (fpregset). For each set, there is an ioctl to get
- the current register set and another ioctl to set the current values.
-
- The actual structure passed through the ioctl interface is, of course,
- naturally machine dependent, and is different for each set of registers.
- For the m68k for example, the general register set is typically defined
- by:
-
- typedef int gregset_t[18];
-
- #define R_D0 0
- ...
- #define R_PS 17
-
- and the floating point set by:
-
- typedef struct fpregset {
- int f_pcr;
- int f_psr;
- int f_fpiaddr;
- int f_fpregs[8][3]; (8 regs, 96 bits each)
- } fpregset_t;
-
- These routines provide the packing and unpacking of gregset_t and
- fpregset_t formatted data.
-
- */
-
-
-/* Given a pointer to a general register set in /proc format (gregset_t *),
- unpack the register contents and supply them as gdb's idea of the current
- register values. */
-
-void
-supply_gregset (gregsetp)
-gregset_t *gregsetp;
-{
- register int regno;
- register greg_t *regp = (greg_t *) gregsetp;
-
- for (regno = 0 ; regno < R_PC ; regno++)
- {
- supply_register (regno, (char *) (regp + regno));
- }
- supply_register (PS_REGNUM, (char *) (regp + R_PS));
- supply_register (PC_REGNUM, (char *) (regp + R_PC));
-}
-
-void
-fill_gregset (gregsetp, regno)
-gregset_t *gregsetp;
-int regno;
-{
- int regi;
- register greg_t *regp = (greg_t *) gregsetp;
- extern char registers[];
-
- for (regi = 0 ; regi < R_PC ; regi++)
- {
- if ((regno == -1) || (regno == regi))
- {
- *(regp + regno) = *(int *) &registers[REGISTER_BYTE (regi)];
- }
- }
- if ((regno == -1) || (regno == PS_REGNUM))
- {
- *(regp + R_PS) = *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
- }
- if ((regno == -1) || (regno == PC_REGNUM))
- {
- *(regp + R_PC) = *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
- }
-}
-
-#if defined (FP0_REGNUM)
-
-/* Given a pointer to a floating point register set in /proc format
- (fpregset_t *), unpack the register contents and supply them as gdb's
- idea of the current floating point register values. */
-
-void
-supply_fpregset (fpregsetp)
-fpregset_t *fpregsetp;
-{
- register int regno;
-
- for (regno = FP0_REGNUM ; regno < FPC_REGNUM ; regno++)
- {
- supply_register (regno, (char *) &(fpregsetp -> f_fpregs[regno][0]));
- }
- supply_register (FPC_REGNUM, (char *) &(fpregsetp -> f_pcr));
- supply_register (FPS_REGNUM, (char *) &(fpregsetp -> f_psr));
- supply_register (FPI_REGNUM, (char *) &(fpregsetp -> f_fpiaddr));
-}
-
-/* Given a pointer to a floating point register set in /proc format
- (fpregset_t *), update the register specified by REGNO from gdb's idea
- of the current floating point register set. If REGNO is -1, update
- them all. */
-
-void
-fill_fpregset (fpregsetp, regno)
-fpregset_t *fpregsetp;
-int regno;
-{
- int regi;
- char *to;
- char *from;
- extern char registers[];
-
- for (regi = FP0_REGNUM ; regi < FPC_REGNUM ; regi++)
- {
- if ((regno == -1) || (regno == regi))
- {
- from = (char *) &registers[REGISTER_BYTE (regi)];
- to = (char *) &(fpregsetp -> f_fpregs[regi][0]);
- bcopy (from, to, REGISTER_RAW_SIZE (regno));
- }
- }
- if ((regno == -1) || (regno == FPC_REGNUM))
- {
- fpregsetp -> f_pcr = *(int *) &registers[REGISTER_BYTE (FPC_REGNUM)];
- }
- if ((regno == -1) || (regno == FPS_REGNUM))
- {
- fpregsetp -> f_psr = *(int *) &registers[REGISTER_BYTE (FPS_REGNUM)];
- }
- if ((regno == -1) || (regno == FPI_REGNUM))
- {
- fpregsetp -> f_fpiaddr = *(int *) &registers[REGISTER_BYTE (FPI_REGNUM)];
- }
-}
-
-#endif /* defined (FP0_REGNUM) */
-
-#endif /* USE_PROC_FS */
diff --git a/gdb/m88k-opcode.h b/gdb/m88k-opcode.h
deleted file mode 100755
index c5e643a..0000000
--- a/gdb/m88k-opcode.h
+++ /dev/null
@@ -1,585 +0,0 @@
-/* This file has been modified by Data General Corporation, November 1989. */
-
-
-/*
-* Disassembler Instruction Table
-*
-* The first field of the table is the opcode field. If an opcode
-* is specified which has any non-opcode bits on, a system error
-* will occur when the system attempts the install it into the
-* instruction table. The second parameter is a pointer to the
-* instruction mnemonic. Each operand is specified by offset, width,
-* and type. The offset is the bit number of the least significant
-* bit of the operand with bit 0 being the least significant bit of
-* the instruction. The width is the number of bits used to specify
-* the operand. The type specifies the output format to be used for
-* the operand. The valid formats are: register, register indirect,
-* hex constant, and bit field specification. The last field is a
-* pointer to the next instruction in the linked list. These pointers
-* are initialized by init_disasm().
-*
-* Structure Format
-*
-* struct INSTAB {
-* UPINT opcode;
-* char *mnemonic;
-* struct OPSPEC op1,op2,op3;
-* struct SIM_FLAGS flgs;
-* struct INSTAB *next;
-* }
-*
-* struct OPSPEC {
-* UPINT offset:5;
-* UPINT width:6;
-* UPINT type:5;
-* }
-*
-* Revision History
-*
-* Revision 1.0 11/08/85 Creation date
-* 1.1 02/05/86 Updated instruction mnemonic table MD
-* 1.2 06/16/86 Updated SIM_FLAGS for floating point
-* 1.3 09/20/86 Updated for new encoding
-* 05/11/89 R. Trawick adapted from Motorola disassembler
-*/
-
-#include <stdio.h>
-
-
-/*
- * This file contains the structures and constants needed to build the M88000
- * simulator. It is the main include file, containing all the
- * structures, macros and definitions except for the floating point
- * instruction set.
- */
-
-/*
- * The following flag informs the Simulator as to what type of byte ordering
- * will be used. For instance, a BOFLAG = 1 indicates a DEC VAX and IBM type
- * of ordering shall be used.
-*/
-
-/* # define BOFLAG 1 /* BYTE ORDERING FLAG */
-
-/* define the number of bits in the primary opcode field of the instruction,
- * the destination field, the source 1 and source 2 fields.
- */
-# define OP 8 /* size of opcode field */
-# define DEST 6 /* size of destination */
-# define SOURCE1 6 /* size of source1 */
-# define SOURCE2 6 /* size of source2 */
-
-# define REGs 32 /* number of registers */
-
-# define WORD long
-# define FLAG unsigned
-# define STATE short
-
-# define TRUE 1
-# define FALSE 0
-
-# define READ 0
-# define WRITE 1
-
-/* The next four equates define the priorities that the various classes
- * of instructions have regarding writing results back into registers and
- * signalling exceptions.
- */
-
-# define PINT 0 /* Integer Priority */
-# define PFLT 1 /* Floating Point Priority */
-# define PMEM 2 /* Memory Priority */
-# define NA 3 /* Not Applicable, instruction doesnt write to regs */
-# define HIPRI 3 /* highest of these priorities */
-
-/* The instruction registers are an artificial mechanism to speed up
- * simulator execution. In the real processor, an instruction register
- * is 32 bits wide. In the simulator, the 32 bit instruction is kept in
- * a structure field called rawop, and the instruction is partially decoded,
- * and split into various fields and flags which make up the other fields
- * of the structure.
- * The partial decode is done when the instructions are initially loaded
- * into simulator memory. The simulator code memory is not an array of
- * 32 bit words, but is an array of instruction register structures.
- * Yes this wastes memory, but it executes much quicker.
- */
-
-struct IR_FIELDS {
- unsigned long op:OP,
- dest: DEST,
- src1: SOURCE1,
- src2: SOURCE2;
- int ltncy,
- extime,
- wb_pri; /* writeback priority */
- unsigned short imm_flags:2,/* immediate size */
- rs1_used:1, /* register source 1 used */
- rs2_used:1, /* register source 2 used */
- rsd_used:1, /* register source/dest. used */
- c_flag:1, /* complement */
- u_flag:1, /* upper half word */
- n_flag:1, /* execute next */
- wb_flag:1, /* uses writeback slot */
- dest_64:1, /* dest size */
- s1_64:1, /* source 1 size */
- s2_64:1, /* source 2 size */
- scale_flag:1, /* scaled register */
- brk_flg:1;
- };
-
-struct mem_segs {
- struct mem_wrd *seg; /* pointer (returned by calloc) to segment */
- unsigned long baseaddr; /* base load address from file headers */
- unsigned long endaddr; /* Ending address of segment */
- int flags; /* segment control flags (none defined 12/5/86) */
-};
-
-#define MAXSEGS (10) /* max number of segment allowed */
-#define MEMSEGSIZE (sizeof(struct mem_segs))/* size of mem_segs structure */
-
-
-#define BRK_RD (0x01) /* break on memory read */
-#define BRK_WR (0x02) /* break on memory write */
-#define BRK_EXEC (0x04) /* break on execution */
-#define BRK_CNT (0x08) /* break on terminal count */
-
-
-struct mem_wrd {
- struct IR_FIELDS opcode; /* simulator instruction break down */
- union {
- unsigned long l; /* memory element break down */
- unsigned short s[2];
- unsigned char c[4];
- } mem;
-};
-
-#define MEMWRDSIZE (sizeof(struct mem_wrd)) /* size of each 32 bit memory model */
-
-/* External declarations */
-
-extern struct mem_segs memory[];
-extern struct PROCESSOR m78000;
-
-struct PROCESSOR {
- unsigned WORD
- ip, /* execute instruction pointer */
- vbr, /* vector base register */
- psr; /* processor status register */
-
- WORD S1bus, /* source 1 */
- S2bus, /* source 2 */
- Dbus, /* destination */
- DAbus, /* data address bus */
- ALU,
- Regs[REGs], /* data registers */
- time_left[REGs], /* max clocks before reg is available */
- wb_pri[REGs], /* writeback priority of reg */
- SFU0_regs[REGs], /* integer unit control regs */
- SFU1_regs[REGs], /* floating point control regs */
- Scoreboard[REGs],
- Vbr;
- unsigned WORD scoreboard,
- Psw,
- Tpsw;
- FLAG jump_pending:1; /* waiting for a jump instr. */
- };
-
-# define i26bit 1 /* size of immediate field */
-# define i16bit 2
-# define i10bit 3
-
-/* Definitions for fields in psr */
-
-# define mode 31
-# define rbo 30
-# define ser 29
-# define carry 28
-# define sf7m 11
-# define sf6m 10
-# define sf5m 9
-# define sf4m 8
-# define sf3m 7
-# define sf2m 6
-# define sf1m 5
-# define mam 4
-# define inm 3
-# define exm 2
-# define trm 1
-# define ovfm 0
-
-#define MODEMASK (1<<(mode-1))
-# define SILENT 0 /* simulate without output to crt */
-# define VERBOSE 1 /* simulate in verbose mode */
-# define PR_INSTR 2 /* only print instructions */
-
-# define RESET 16 /* reset phase */
-
-# define PHASE1 0 /* data path phases */
-# define PHASE2 1
-
-/* the 1 clock operations */
-
-# define ADDU 1
-# define ADDC 2
-# define ADDUC 3
-# define ADD 4
-
-# define SUBU ADD+1
-# define SUBB ADD+2
-# define SUBUB ADD+3
-# define SUB ADD+4
-
-# define AND ADD+5
-# define OR ADD+6
-# define XOR ADD+7
-# define CMP ADD+8
-
-/* the LOADS */
-
-# define LDAB CMP+1
-# define LDAH CMP+2
-# define LDA CMP+3
-# define LDAD CMP+4
-
-# define LDB LDAD+1
-# define LDH LDAD+2
-# define LD LDAD+3
-# define LDD LDAD+4
-# define LDBU LDAD+5
-# define LDHU LDAD+6
-
-/* the STORES */
-
-# define STB LDHU+1
-# define STH LDHU+2
-# define ST LDHU+3
-# define STD LDHU+4
-
-/* the exchange */
-
-# define XMEMBU LDHU+5
-# define XMEM LDHU+6
-
-/* the branches */
-# define JSR STD+1
-# define BSR STD+2
-# define BR STD+3
-# define JMP STD+4
-# define BB1 STD+5
-# define BB0 STD+6
-# define RTN STD+7
-# define BCND STD+8
-
-/* the TRAPS */
-# define TB1 BCND+1
-# define TB0 BCND+2
-# define TCND BCND+3
-# define RTE BCND+4
-# define TBND BCND+5
-
-/* the MISC instructions */
-# define MUL TBND + 1
-# define DIV MUL +2
-# define DIVU MUL +3
-# define MASK MUL +4
-# define FF0 MUL +5
-# define FF1 MUL +6
-# define CLR MUL +7
-# define SET MUL +8
-# define EXT MUL +9
-# define EXTU MUL +10
-# define MAK MUL +11
-# define ROT MUL +12
-
-/* control register manipulations */
-
-# define LDCR ROT +1
-# define STCR ROT +2
-# define XCR ROT +3
-
-# define FLDCR ROT +4
-# define FSTCR ROT +5
-# define FXCR ROT +6
-
-
-# define NOP XCR +1
-
-/* floating point instructions */
-
-# define FADD NOP +1
-# define FSUB NOP +2
-# define FMUL NOP +3
-# define FDIV NOP +4
-# define FSQRT NOP +5
-# define FCMP NOP +6
-# define FIP NOP +7
-# define FLT NOP +8
-# define INT NOP +9
-# define NINT NOP +10
-# define TRNC NOP +11
-# define FLDC NOP +12
-# define FSTC NOP +13
-# define FXC NOP +14
-
-# define UEXT(src,off,wid) ((((unsigned int)(src))>>(off)) & ((1<<(wid)) - 1))
-# define SEXT(src,off,wid) (((((int)(src))<<(32-((off)+(wid)))) >>(32-(wid))) )
-# define MAKE(src,off,wid) \
- ((((unsigned int)(src)) & ((1<<(wid)) - 1)) << (off))
-
-# define opword(n) (unsigned long) (memaddr->mem.l)
-
-/* Constants and Masks */
-
-#define SFU0 0x80000000
-#define SFU1 0x84000000
-#define SFU7 0x9c000000
-#define RRI10 0xf0000000
-#define RRR 0xf4000000
-#define SFUMASK 0xfc00ffe0
-#define RRRMASK 0xfc00ffe0
-#define RRI10MASK 0xfc00fc00
-#define DEFMASK 0xfc000000
-#define CTRL 0x0000f000
-#define CTRLMASK 0xfc00f800
-
-/* Operands types */
-
-#define HEX 1
-#define REG 2
-#define IND 3
-#define CONT 3
-#define IND 3
-#define BF 4
-#define REGSC 5 /* scaled register */
-#define CRREG 6 /* control register */
-#define FCRREG 7 /* floating point control register */
-#define PCREL 8
-#define CONDMASK 9
-
-/* Hashing Specification */
-
-#define HASHVAL 79
-
-/* Type definitions */
-
-typedef unsigned int UINT;
-
-/* Structure templates */
-
-typedef struct {
- unsigned int offset:5;
- unsigned int width:6;
- unsigned int type:5;
-} OPSPEC;
-
- struct SIM_FLAGS {
- int ltncy, /* latency (max number of clocks needed to execute) */
- extime, /* execution time (min number of clocks needed to execute) */
- wb_pri; /* writeback slot priority */
- unsigned long op:OP, /* simulator version of opcode */
- imm_flags:2, /* 10,16 or 26 bit immediate flags */
- rs1_used:1, /* register source 1 used */
- rs2_used:1, /* register source 2 used */
- rsd_used:1, /* register source/dest used */
- c_flag:1, /* complement */
- u_flag:1, /* upper half word */
- n_flag:1, /* execute next */
- wb_flag:1, /* uses writeback slot */
- dest_64:1, /* double precision dest */
- s1_64:1, /* double precision source 1 */
- s2_64:1, /* double precision source 2 */
- scale_flag:1; /* register is scaled */
-};
-
-typedef struct INSTRUCTAB {
- unsigned int opcode;
- char *mnemonic;
- OPSPEC op1,op2,op3;
- struct SIM_FLAGS flgs;
- struct INSTRUCTAB *next;
-} INSTAB;
-
-
-/* Opcode Mnemonic Op 1 Spec Op 2 Spec Op 3 Spec Simflags Next */
-
-static INSTAB instructions[] =
-{0xf400c800,"jsr ",{0,5,REG} ,{0,0,0} ,{0,0,0} , {2,2,NA,JSR , 0,0,1,0,0,0,0,1,0,0,0,0}, NULL,
- 0xf400cc00,"jsr.n ",{0,5,REG} ,{0,0,0} ,{0,0,0} , {1,1,NA,JSR , 0,0,1,0,0,0,1,1,0,0,0,0}, NULL,
- 0xf400c000,"jmp ",{0,5,REG} ,{0,0,0} ,{0,0,0} , {2,2,NA,JMP , 0,0,1,0,0,0,0,1,0,0,0,0}, NULL,
- 0xf400c400,"jmp.n ",{0,5,REG} ,{0,0,0} ,{0,0,0} , {1,1,NA,JMP , 0,0,1,0,0,0,1,1,0,0,0,0}, NULL,
- 0xc8000000,"bsr ",{0,26,PCREL},{0,0,0} ,{0,0,0} , {2,2,NA,BSR , i26bit,0,0,0,0,0,0,1,0,0,0,0}, NULL,
- 0xcc000000,"bsr.n ",{0,26,PCREL},{0,0,0} ,{0,0,0} , {1,1,NA,BSR , i26bit,0,0,0,0,0,1,1,0,0,0,0}, NULL,
- 0xc0000000,"br ",{0,26,PCREL},{0,0,0} ,{0,0,0} , {2,2,NA,BR , i26bit,0,0,0,0,0,0,1,0,0,0,0}, NULL,
- 0xc4000000,"br.n ",{0,26,PCREL},{0,0,0} ,{0,0,0} , {1,1,NA,BR , i26bit,0,0,0,0,0,1,1,0,0,0,0}, NULL,
- 0xd0000000,"bb0 ",{21,5,HEX} ,{16,5,REG} ,{0,16,PCREL},{2,2,NA,BB0, i16bit,0,1,0,0,0,0,1,0,0,0,0}, NULL,
- 0xd4000000,"bb0.n ",{21,5,HEX} ,{16,5,REG} ,{0,16,PCREL},{1,1,NA,BB0, i16bit,0,1,0,0,0,1,1,0,0,0,0}, NULL,
- 0xd8000000,"bb1 ",{21,5,HEX},{16,5,REG} ,{0,16,PCREL},{2,2,NA,BB1, i16bit,0,1,0,0,0,0,1,0,0,0,0}, NULL,
- 0xdc000000,"bb1.n ",{21,5,HEX},{16,5,REG} ,{0,16,PCREL},{1,1,NA,BB1, i16bit,0,1,0,0,0,1,1,0,0,0,0}, NULL,
- 0xf000d000,"tb0 ",{21,5,HEX} ,{16,5,REG} ,{0,10,HEX}, {2,2,NA,TB0 , i10bit,0,1,0,0,0,0,1,0,0,0,0}, NULL,
- 0xf000d800,"tb1 ",{21,5,HEX} ,{16,5,REG} ,{0,10,HEX}, {2,2,NA,TB1 , i10bit,0,1,0,0,0,0,1,0,0,0,0}, NULL,
- 0xe8000000,"bcnd ",{21,5,CONDMASK},{16,5,REG},{0,16,PCREL},{2,2,NA,BCND, i16bit,0,1,0,0,0,0,1,0,0,0,0}, NULL,
- 0xec000000,"bcnd.n ",{21,5,CONDMASK},{16,5,REG},{0,16,PCREL},{1,1,NA,BCND, i16bit,0,1,0,0,0,1,1,0,0,0,0}, NULL,
- 0xf000e800,"tcnd ",{21,5,CONDMASK},{16,5,REG},{0,10,HEX}, {2,2,NA,TCND, i10bit,0,1,0,0,0,0,1,0,0,0,0}, NULL,
- 0xf8000000,"tbnd ",{16,5,REG} ,{0,16,HEX} ,{0,0,0} , {2,2,NA,TBND, i10bit,1,0,0,0,0,0,1,0,0,0,0}, NULL,
- 0xf400f800,"tbnd ",{16,5,REG} ,{0,5,REG} ,{0,0,0} , {2,2,NA,TBND, 0,1,1,0,0,0,0,1,0,0,0,0}, NULL,
- 0xf400fc00,"rte ",{0,0,0} ,{0,0,0} ,{0,0,0} , {2,2,NA,RTE , 0,0,0,0,0,0,0,1,0,0,0,0}, NULL,
- 0x1c000000,"ld.b ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {3,1,PMEM,LDB ,i16bit,1,0,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4001c00,"ld.b ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,LDB , 0,1,1,1,0,0,0,1,0,0,0,0}, NULL,
- 0x0c000000,"ld.bu ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {3,1,PMEM,LDBU, i16bit,1,0,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4000c00,"ld.bu ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,LDBU ,0,1,1,1,0,0,0,1,0,0,0,0}, NULL,
- 0x18000000,"ld.h ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {3,1,PMEM,LDH ,i16bit,1,0,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4001800,"ld.h ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,LDH ,0,1,1,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4001a00,"ld.h ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{3,1,PMEM,LDH ,0,1,1,1,0,0,0,1,0,0,0,1}, NULL,
- 0x08000000,"ld.hu ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {3,1,PMEM,LDHU, i16bit,1,0,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4000800,"ld.hu ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,LDHU ,0,1,1,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4000a00,"ld.hu ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{3,1,PMEM,LDHU ,0,1,1,1,0,0,0,1,0,0,0,1}, NULL,
- 0x14000000,"ld ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {3,1,PMEM,LD ,i16bit,1,0,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4001400,"ld ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,LD ,0,1,1,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4001600,"ld ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{3,1,PMEM,LD ,0,1,1,1,0,0,0,1,0,0,0,1}, NULL,
- 0x10000000,"ld.d ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {3,1,PMEM,LDD ,i16bit,1,0,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4001000,"ld.d ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,LDD ,0,1,1,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4001200,"ld.d ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{3,1,PMEM,LDD ,0,1,1,1,0,0,0,1,0,0,0,1}, NULL,
- 0xf4001500,"ld.usr ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,LD ,0,1,1,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4001700,"ld.usr ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{3,1,PMEM,LD ,0,1,1,1,0,0,0,1,0,0,0,1}, NULL,
- 0x2c000000,"st.b ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,NA,STB ,i16bit,1,0,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4002c00,"st.b ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,NA,STB ,0,1,1,1,0,0,0,1,0,0,0,0}, NULL,
- 0x28000000,"st.h ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,NA,STH ,i16bit,1,0,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4002800,"st.h ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,NA,STH ,0,1,1,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4002a00,"st.h ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{1,1,NA,STH ,0,1,1,1,0,0,0,1,0,0,0,1}, NULL,
- 0x24000000,"st ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,NA,ST ,i16bit,1,0,1,0,0,0,1,0,0,0,0}, NULL,
- 0xf4002400,"st ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,NA,ST ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0xf4002600,"st ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{1,1,NA,ST ,0,1,1,1,0,0,0,1,0,0,0,1} ,NULL,
- 0x20000000,"st.d ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,NA,STD ,i16bit,0,1,0,0,0,0,1,0,0,0,0} ,NULL,
- 0xf4002000,"st.d ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,NA,STD ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0xf4002200,"st.d ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{1,1,NA,STD ,0,1,1,1,0,0,0,1,0,0,0,1} ,NULL,
- 0xf4002500,"st.usr ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,NA,ST ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0xf4002700,"st.usr ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{1,1,NA,ST ,0,1,1,1,0,0,0,1,0,0,0,1} ,NULL,
- 0x00000000,"xmem.bu ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {3,1,PMEM,XMEMBU ,i16bit,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0xf4000000,"xmem.bu ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,XMEM ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x04000000,"xmem ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {3,1,PMEM,XMEM ,i16bit,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0xf4000400,"xmem ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,XMEM ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0xf4000600,"xmem ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{3,1,PMEM,XMEM ,0,1,1,1,0,0,0,1,0,0,0,1} ,NULL,
- 0xf4000500,"xmem.usr ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {3,1,PMEM,XMEM ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0xf4000700,"xmem.usr ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{3,1,PMEM,XMEM ,0,1,1,1,0,0,0,1,0,0,0,1} ,NULL,
- 0xf4003e00,"lda.b ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{1,1,PINT,LDAH, 0,1,1,1,0,0,0,0,0,0,0,1} ,NULL,
- 0xf4003a00,"lda.h ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{1,1,PINT,LDAH, 0,1,1,1,0,0,0,0,0,0,0,1} ,NULL,
- 0xf4003600,"lda ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{1,1,PINT,LDA , 0,1,1,1,0,0,0,0,0,0,0,1} ,NULL,
- 0xf4003200,"lda.d ",{21,5,REG} ,{16,5,REG} ,{0,5,REGSC},{1,1,PINT,LDAD, 0,1,1,1,0,0,0,0,0,0,0,1} ,NULL,
-
- 0x80004000,"ldcr ",{21,5,REG} ,{5,6,CRREG} ,{0,0,0} ,{1,1,PINT,LDCR, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x80008000,"stcr ",{16,5,REG} ,{5,6,CRREG} ,{0,0,0} ,{1,1,PINT,STCR, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x8000c000,"xcr ",{21,5,REG} ,{16,5,REG} ,{5,6,CRREG},{1,1,PINT,XCR, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
-
- 0xf4006000,"addu ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,ADDU, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4006200,"addu.ci ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,ADDU, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4006100,"addu.co ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,ADDU, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4006300,"addu.cio ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,ADDU, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4006400,"subu ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,SUBU, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4006600,"subu.ci ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,SUBU, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4006500,"subu.co ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,SUBU, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4006700,"subu.cio ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,SUBU, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4006900,"divu ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {32,32,PINT,DIVU, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4006d00,"mul ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,4,PINT,MUL, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007000,"add ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,ADD , 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007200,"add.ci ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,ADD , 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007100,"add.co ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,ADD , 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007300,"add.cio ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,ADD , 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007400,"sub ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,SUB , 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007600,"sub.ci ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,SUB , 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007500,"sub.co ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,SUB , 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007700,"sub.cio ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,SUB , 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007900,"div ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {32,32,PINT,DIV , 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4007d00,"cmp ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,CMP, 0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
-
- 0x60000000,"addu ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,ADDU, i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x64000000,"subu ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,SUBU, i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
-
- 0x68000000,"divu ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {32,32,PINT,DIVU, i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x6c000000,"mul ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {4,1,PINT,MUL, i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x70000000,"add ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,ADD, i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x74000000,"sub ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,SUB, i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x78000000,"div ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {32,32,PINT,DIV, i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x7c000000,"cmp ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,CMP, i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
-
- 0xf4004000,"and ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,AND ,0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4004400,"and.c ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,AND ,0,1,1,1,1,0,0,0,0,0,0,0} ,NULL,
- 0xf4005800,"or ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,OR ,0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4005c00,"or.c ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,OR ,0,1,1,1,1,0,0,0,0,0,0,0} ,NULL,
- 0xf4005000,"xor ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,XOR ,0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4005400,"xor.c ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,XOR ,0,1,1,1,1,0,0,0,0,0,0,0} ,NULL,
- 0x40000000,"and ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,AND ,i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x44000000,"and.u ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,AND ,i16bit,1,0,1,0,1,0,0,0,0,0,0} ,NULL,
- 0x58000000,"or ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,OR ,i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x5c000000,"or.u ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,OR ,i16bit,1,0,1,0,1,0,0,0,0,0,0} ,NULL,
- 0x50000000,"xor ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,XOR ,i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x54000000,"xor.u ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,XOR ,i16bit,1,0,1,0,1,0,0,0,0,0,0} ,NULL,
- 0x48000000,"mask ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,MASK ,i16bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0x4c000000,"mask.u ",{21,5,REG} ,{16,5,REG} ,{0,16,HEX}, {1,1,PINT,MASK ,i16bit,1,0,1,0,1,0,0,0,0,0,0} ,NULL,
- 0xf400ec00,"ff0 ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {1,1,PINT,FF0 ,0,0,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf400e800,"ff1 ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {1,1,PINT,FF1 ,0,0,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf0008000,"clr ",{21,5,REG} ,{16,5,REG} ,{0,10,BF} , {1,1,PINT,CLR ,i10bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf0008800,"set ",{21,5,REG} ,{16,5,REG} ,{0,10,BF} , {1,1,PINT,SET ,i10bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf0009000,"ext ",{21,5,REG} ,{16,5,REG} ,{0,10,BF} , {1,1,PINT,EXT ,i10bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf0009800,"extu ",{21,5,REG} ,{16,5,REG} ,{0,10,BF} , {1,1,PINT,EXTU ,i10bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf000a000,"mak ",{21,5,REG} ,{16,5,REG} ,{0,10,BF} , {1,1,PINT,MAK ,i10bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf000a800,"rot ",{21,5,REG} ,{16,5,REG} ,{0,10,BF} , {1,1,PINT,ROT ,i10bit,1,0,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4008000,"clr ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,CLR ,0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4008800,"set ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,SET ,0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4009000,"ext ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,EXT ,0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf4009800,"extu ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,EXTU ,0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf400a000,"mak ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,MAK ,0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
- 0xf400a800,"rot ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {1,1,PINT,ROT ,0,1,1,1,0,0,0,0,0,0,0,0} ,NULL,
-
- 0x84002800,"fadd.sss ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {5,1,PFLT,FADD ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84002880,"fadd.ssd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FADD ,0,1,1,1,0,0,0,1,0,0,1,0} ,NULL,
- 0x84002a00,"fadd.sds ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FADD ,0,1,1,1,0,0,0,1,0,1,0,0} ,NULL,
- 0x84002a80,"fadd.sdd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FADD ,0,1,1,1,0,0,0,1,0,1,1,0} ,NULL,
- 0x84002820,"fadd.dss ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FADD ,0,1,1,1,0,0,0,1,1,0,0,0} ,NULL,
- 0x840028a0,"fadd.dsd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FADD ,0,1,1,1,0,0,0,1,1,0,1,0} ,NULL,
- 0x84002a20,"fadd.dds ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FADD ,0,1,1,1,0,0,0,1,1,1,0,0} ,NULL,
- 0x84002aa0,"fadd.ddd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FADD ,0,1,1,1,0,0,0,1,1,1,1,0} ,NULL,
- 0x84003000,"fsub.sss ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {5,1,PFLT,FSUB ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84003080,"fsub.ssd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FSUB ,0,1,1,1,0,0,0,1,0,0,1,0} ,NULL,
- 0x84003200,"fsub.sds ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FSUB ,0,1,1,1,0,0,0,1,0,1,0,0} ,NULL,
- 0x84003280,"fsub.sdd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FSUB ,0,1,1,1,0,0,0,1,0,1,1,0} ,NULL,
- 0x84003020,"fsub.dss ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FSUB ,0,1,1,1,0,0,0,1,1,0,0,0} ,NULL,
- 0x840030a0,"fsub.dsd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FSUB ,0,1,1,1,0,0,0,1,1,0,1,0} ,NULL,
- 0x84003220,"fsub.dds ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FSUB ,0,1,1,1,0,0,0,1,1,1,0,0} ,NULL,
- 0x840032a0,"fsub.ddd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,2,PFLT,FSUB ,0,1,1,1,0,0,0,1,1,1,1,0} ,NULL,
- 0x84000000,"fmul.sss ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,1,PFLT,FMUL ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84000080,"fmul.ssd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {9,2,PFLT,FMUL ,0,1,1,1,0,0,0,1,0,0,1,0} ,NULL,
- 0x84000200,"fmul.sds ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {9,2,PFLT,FMUL ,0,1,1,1,0,0,0,1,0,1,0,0} ,NULL,
- 0x84000280,"fmul.sdd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {9,2,PFLT,FMUL ,0,1,1,1,0,0,0,1,0,1,1,0} ,NULL,
- 0x84000020,"fmul.dss ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {9,2,PFLT,FMUL ,0,1,1,1,0,0,0,1,1,0,0,0} ,NULL,
- 0x840000a0,"fmul.dsd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {9,2,PFLT,FMUL ,0,1,1,1,0,0,0,1,1,0,1,0} ,NULL,
- 0x84000220,"fmul.dds ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {9,2,PFLT,FMUL ,0,1,1,1,0,0,0,1,1,1,0,0} ,NULL,
- 0x840002a0,"fmul.ddd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {9,2,PFLT,FMUL ,0,1,1,1,0,0,0,1,1,1,1,0} ,NULL,
- 0x84007000,"fdiv.sss ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {30,30,PFLT,FDIV ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84007080,"fdiv.ssd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {60,60,PFLT,FDIV ,0,1,1,1,0,0,0,1,0,0,1,0} ,NULL,
- 0x84007200,"fdiv.sds ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {60,60,PFLT,FDIV ,0,1,1,1,0,0,0,1,0,1,0,0} ,NULL,
- 0x84007280,"fdiv.sdd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {60,60,PFLT,FDIV ,0,1,1,1,0,0,0,1,0,1,1,0} ,NULL,
- 0x84007020,"fdiv.dss ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {60,60,PFLT,FDIV ,0,1,1,1,0,0,0,1,1,0,0,0} ,NULL,
- 0x840070a0,"fdiv.dsd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {60,60,PFLT,FDIV ,0,1,1,1,0,0,0,1,1,0,1,0} ,NULL,
- 0x84007220,"fdiv.dds ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {60,60,PFLT,FDIV ,0,1,1,1,0,0,0,1,1,1,0,0} ,NULL,
- 0x840072a0,"fdiv.ddd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {60,60,PFLT,FDIV ,0,1,1,1,0,0,0,1,1,1,1,0} ,NULL,
- 0x84007800,"fsqrt.ss ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {5,1,PFLT,FLT ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84007880,"fsqrt.sd ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {5,1,PFLT,FLT ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84007820,"fsqrt.ds ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {5,1,PFLT,FLT ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x840078a0,"fsqrt.dd ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {6,1,PFLT,FLT ,0,0,1,1,0,0,0,1,1,0,0,0} ,NULL,
- 0x84003800,"fcmp.ss ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {5,1,PFLT,FCMP ,0,1,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84003880,"fcmp.sd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,1,PFLT,FCMP ,0,1,1,1,0,0,0,1,0,1,0,0} ,NULL,
- 0x84003a00,"fcmp.ds ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,1,PFLT,FCMP ,0,1,1,1,0,0,0,1,1,0,0,0} ,NULL,
- 0x84003a80,"fcmp.dd ",{21,5,REG} ,{16,5,REG} ,{0,5,REG} , {6,1,PFLT,FCMP ,0,1,1,1,0,0,0,1,1,1,0,0} ,NULL,
- 0x84002000,"flt.s ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {5,1,PFLT,FLT ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84002020,"flt.d ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {6,1,PFLT,FLT ,0,0,1,1,0,0,0,1,1,0,0,0} ,NULL,
- 0x84004800,"int.s ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {5,1,PFLT,INT ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84004880,"int.d ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {6,1,PFLT,INT ,0,0,1,1,0,0,0,1,1,0,0,0} ,NULL,
- 0x84005000,"nint.s ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {5,1,PFLT,INT ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84005080,"nint.d ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {6,1,PFLT,INT ,0,0,1,1,0,0,0,1,1,0,0,0} ,NULL,
- 0x84005800,"trnc.s ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {5,1,PFLT,TRNC ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x84005880,"trnc.d ",{21,5,REG} ,{0,5,REG} ,{0,0,0} , {6,1,PFLT,TRNC ,0,0,1,1,0,0,0,1,1,0,0,0} ,NULL,
-
- 0x80004800,"fldcr ",{21,5,REG} ,{5,6,FCRREG} ,{0,0,0} , {1,1,PFLT,FLDC ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x80008800,"fstcr ",{16,5,REG} ,{5,6,FCRREG} ,{0,0,0} , {1,1,PFLT,FSTC ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL,
- 0x8000c800,"fxcr ",{21,5,REG} ,{16,5,REG} ,{5,6,FCRREG} , {1,1,PFLT,FXC ,0,0,1,1,0,0,0,1,0,0,0,0} ,NULL};
-
diff --git a/gdb/m88k-pinsn.c b/gdb/m88k-pinsn.c
deleted file mode 100644
index bede269..0000000
--- a/gdb/m88k-pinsn.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/* This file has been modified by Data General Corporation, November 1989. */
-
-#include <stdio.h>
-#include "m88k-opcode.h"
-#include "defs.h"
-#include "symtab.h"
-
-void sprint_address ();
-
-/* Changed hashtab to hashtable to avoid naming conflict
- with libdc.o (used for tdesc) for m88k.
-*/
-
-INSTAB *hashtable[HASHVAL] = {0};
-
-/*
-* Disassemble an M88000 Instruction
-*
-*
-* This module decodes the first instruction in inbuf. It uses the pc
-* to display pc-relative displacements. It writes the disassembled
-* instruction in outbuf.
-*
-* Revision History
-*
-* Revision 1.0 11/08/85 Creation date by Motorola
-* 05/11/89 R. Trawick adapted to GDB interface.
-*/
-#define MAXLEN 20
-
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned char buffer[MAXLEN];
- /* should be expanded if disassembler prints symbol names */
- char outbuf[100];
- int n;
-
- /* Instruction addresses may have low two bits set. Clear them. */
- memaddr&= 0xfffffffc;
- read_memory (memaddr, buffer, MAXLEN);
-
- n = m88kdis ((int)memaddr, buffer, outbuf);
-
- fputs (outbuf, stream);
-
- return (n);
-}
-
-/*
- * disassemble the first instruction in 'inbuf'.
- * 'pc' should be the address of this instruction, it will
- * be used to print the target address if this is a relative jump or call
- * 'outbuf' gets filled in with the disassembled instruction. It should
- * be long enough to hold the longest disassembled instruction.
- * 100 bytes is certainly enough, unless symbol printing is added later
- * The function returns the length of this instruction in bytes.
- */
-
-int m88kdis( pc, inbuf, outbuf )
-
- int pc;
- int *inbuf;
- char *outbuf;
-
-{ static ihashtab_initialized = 0;
- int instruction;
- unsigned int opcode;
- INSTAB *entry_ptr;
- int opmask;
- int class;
-
- instruction= *inbuf;
-
- if (!ihashtab_initialized) {
- init_disasm();
- }
-
- /* create a the appropriate mask to isolate the opcode */
- opmask= DEFMASK;
- class= instruction & DEFMASK;
- if ((class >= SFU0) && (class <= SFU7)) {
- if (instruction < SFU1) {
- opmask= CTRLMASK;
- } else {
- opmask= SFUMASK;
- }
- } else if (class == RRR) {
- opmask= RRRMASK;
- } else if (class == RRI10) {
- opmask= RRI10MASK;
- }
-
- /* isolate the opcode */
- opcode= instruction & opmask;
-
- /* search the hash table with the isolated opcode */
- for (entry_ptr= hashtable[ opcode % HASHVAL ];
- (entry_ptr != NULL) && (entry_ptr->opcode != opcode);
- entry_ptr= entry_ptr->next) {
- }
-
- if (entry_ptr == NULL) {
- sprintf( outbuf, "word\t%08x", instruction );
- } else {
- sprintf( outbuf, "%s\t", entry_ptr->mnemonic );
- sprintop( &outbuf[strlen(outbuf)], &(entry_ptr->op1), instruction, pc, 1 );
- sprintop( &outbuf[strlen(outbuf)], &(entry_ptr->op2), instruction, pc, 0 );
- sprintop( &outbuf[strlen(outbuf)], &(entry_ptr->op3), instruction, pc, 0 );
- }
-
-
- return 4;
-}
-
-
-/*
-* Decode an Operand of an Instruction
-*
-* Functional Description
-*
-* This module formats and writes an operand of an instruction to buf
-* based on the operand specification. When the first flag is set this
-* is the first operand of an instruction. Undefined operand types
-* cause a <dis error> message.
-*
-* Parameters
-* char *buf buffer where the operand may be printed
-* OPSPEC *opptr Pointer to an operand specification
-* UINT inst Instruction from which operand is extracted
-* UINT pc PC of instruction; used for pc-relative disp.
-* int first Flag which if nonzero indicates the first
-* operand of an instruction
-*
-* Output
-*
-* The operand specified is extracted from the instruction and is
-* written to buf in the format specified. The operand is preceded
-* by a comma if it is not the first operand of an instruction and it
-* is not a register indirect form. Registers are preceded by 'r' and
-* hex values by '0x'.
-*
-* Revision History
-*
-* Revision 1.0 11/08/85 Creation date
-*/
-
-sprintop( buf, opptr, inst, pc, first )
-
- char *buf;
- OPSPEC *opptr;
- UINT inst;
- int pc;
- int first;
-
-{ int extracted_field;
- char *cond_mask_sym;
- char cond_mask_sym_buf[6];
-
- if (opptr->width == 0)
- return;
-
- switch(opptr->type) {
- case CRREG:
- if (!first)
- *buf++= ',';
- sprintf( buf, "cr%d", UEXT(inst,opptr->offset,opptr->width));
- break;
-
- case FCRREG:
- if (!first)
- *buf++= ',';
- sprintf( buf, "fcr%d", UEXT(inst,opptr->offset,opptr->width));
- break;
-
- case REGSC:
- sprintf( buf, "[r%d]", UEXT(inst,opptr->offset,opptr->width));
- break;
-
- case REG:
- if (!first)
- *buf++= ',';
- sprintf( buf, "r%d", UEXT(inst,opptr->offset,opptr->width));
- break;
-
- case HEX:
- if (!first)
- *buf++= ',';
- extracted_field= UEXT(inst, opptr->offset, opptr->width);
- if (extracted_field == 0) {
- sprintf( buf, "0" );
- } else {
- sprintf( buf, "0x%02x", extracted_field );
- }
- break;
-
- case CONDMASK:
- if (!first)
- *buf++= ',';
- extracted_field= UEXT(inst, opptr->offset, opptr->width);
- switch (extracted_field & 0x0f) {
- case 0x1: cond_mask_sym= "gt0";
- break;
- case 0x2: cond_mask_sym= "eq0";
- break;
- case 0x3: cond_mask_sym= "ge0";
- break;
- case 0xc: cond_mask_sym= "lt0";
- break;
- case 0xd: cond_mask_sym= "ne0";
- break;
- case 0xe: cond_mask_sym= "le0";
- break;
- default: cond_mask_sym= cond_mask_sym_buf;
- sprintf( cond_mask_sym_buf,
- "%x",
- extracted_field );
- break;
- }
- strcpy( buf, cond_mask_sym );
- break;
-
- case PCREL:
- if (!first)
- *buf++= ',';
- sprint_address( pc + 4*(SEXT(inst,opptr->offset,opptr->width)),
- buf );
- break;
-
- case CONT:
- sprintf( buf,
- "%d,r%d",
- UEXT(inst,opptr->offset,5),
- UEXT(inst,(opptr->offset)+5,5) );
- break;
-
- case BF:
- if (!first)
- *buf++= ',';
- sprintf( buf,
- "%d<%d>",
- UEXT(inst,(opptr->offset)+5,5),
- UEXT(inst,opptr->offset,5));
- break;
-
- default:
- sprintf( buf, "<dis error: %08x>", inst );
- }
-
-}
-
-/*
-* Initialize the Disassembler Instruction Table
-*
-* Initialize the hash table and instruction table for the disassembler.
-* This should be called once before the first call to disasm().
-*
-* Parameters
-*
-* Output
-*
-* If the debug option is selected, certain statistics about the hashing
-* distribution are written to stdout.
-*
-* Revision History
-*
-* Revision 1.0 11/08/85 Creation date
-*/
-
-init_disasm()
-{
- int i,size;
-
- for (i=0 ; i < HASHVAL ; i++)
- hashtable[i] = NULL;
-
- for (i=0, size = sizeof(instructions) / sizeof(INSTAB) ; i < size ;
- install(&instructions[i++]));
-
-}
-
-/*
-* Insert an instruction into the disassembler table by hashing the
-* opcode and inserting it into the linked list for that hash value.
-*
-* Parameters
-*
-* INSTAB *instptr Pointer to the entry in the instruction table
-* to be installed
-*
-* Revision 1.0 11/08/85 Creation date
-* 05/11/89 R. TRAWICK ADAPTED FROM MOTOROLA
-*/
-
-install(instptr)
- INSTAB *instptr;
-{
- UINT i;
-
- i = (instptr->opcode) % HASHVAL;
- instptr->next = hashtable[i];
- hashtable[i] = instptr;
-}
-
-
-/* adapted from print_address in printcmd by R. Trawick 5/15/89. The two should
- be combined.
- */
-
-void sprint_address (addr, buffer)
-
- CORE_ADDR addr;
- char *buffer;
-
-{
- register int i;
- struct symbol *fs;
- char *name;
- int name_location;
-
- sprintf ( buffer, "0x%x", addr);
-
- fs = find_pc_function (addr);
-
- if (!fs) {
- i = find_pc_misc_function (addr);
-
- if (i < 0) return; /* If nothing comes through, don't
- print anything symbolic */
-
- name = misc_function_vector[i].name;
- name_location = misc_function_vector[i].address;
- } else {
- name = fs->name;
- name_location = BLOCK_START (SYMBOL_BLOCK_VALUE (fs));
- }
-
- if (addr - name_location)
- sprintf (buffer, " <%s+%d>", name, addr - name_location);
- else
- sprintf (buffer, " <%s>", name);
-}
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c
deleted file mode 100644
index 594bd49..0000000
--- a/gdb/m88k-tdep.c
+++ /dev/null
@@ -1,858 +0,0 @@
-/* Target-machine dependent code for Motorola 88000 series, for GDB.
- Copyright (C) 1988, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "value.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include "gdbcore.h"
-#include <sys/user.h>
-#ifndef USER /* added to support BCS ptrace_user */
-
-#define USER ptrace_user
-#endif
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include "symtab.h"
-#include "setjmp.h"
-#include "value.h"
-
-void frame_find_saved_regs ();
-
-
-/* Given a GDB frame, determine the address of the calling function's frame.
- This will be used to create a new GDB frame struct, and then
- INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
-
- For us, the frame address is its stack pointer value, so we look up
- the function prologue to determine the caller's sp value, and return it. */
-
-FRAME_ADDR
-frame_chain (thisframe)
- FRAME thisframe;
-{
-
- frame_find_saved_regs (thisframe, (struct frame_saved_regs *) 0);
- /* NOTE: this depends on frame_find_saved_regs returning the VALUE, not
- the ADDRESS, of SP_REGNUM. It also depends on the cache of
- frame_find_saved_regs results. */
- if (thisframe->fsr->regs[SP_REGNUM])
- return thisframe->fsr->regs[SP_REGNUM];
- else
- return thisframe->frame; /* Leaf fn -- next frame up has same SP. */
-}
-
-int
-frameless_function_invocation (frame)
- FRAME frame;
-{
-
- frame_find_saved_regs (frame, (struct frame_saved_regs *) 0);
- /* NOTE: this depends on frame_find_saved_regs returning the VALUE, not
- the ADDRESS, of SP_REGNUM. It also depends on the cache of
- frame_find_saved_regs results. */
- if (frame->fsr->regs[SP_REGNUM])
- return 0; /* Frameful -- return addr saved somewhere */
- else
- return 1; /* Frameless -- no saved return address */
-}
-
-int
-frame_chain_valid (chain, thisframe)
- CORE_ADDR chain;
- struct frame_info *thisframe;
-{
- return (chain != 0
- && outside_startup_file (FRAME_SAVED_PC (thisframe)));
-}
-
-void
-init_extra_frame_info (fromleaf, fi)
- int fromleaf;
- struct frame_info *fi;
-{
- fi->fsr = 0; /* Not yet allocated */
- fi->args_pointer = 0; /* Unknown */
- fi->locals_pointer = 0; /* Unknown */
-}
-
-/* Examine an m88k function prologue, recording the addresses at which
- registers are saved explicitly by the prologue code, and returning
- the address of the first instruction after the prologue (but not
- after the instruction at address LIMIT, as explained below).
-
- LIMIT places an upper bound on addresses of the instructions to be
- examined. If the prologue code scan reaches LIMIT, the scan is
- aborted and LIMIT is returned. This is used, when examining the
- prologue for the current frame, to keep examine_prologue () from
- claiming that a given register has been saved when in fact the
- instruction that saves it has not yet been executed. LIMIT is used
- at other times to stop the scan when we hit code after the true
- function prologue (e.g. for the first source line) which might
- otherwise be mistaken for function prologue.
-
- The format of the function prologue matched by this routine is
- derived from examination of the source to gcc 1.95, particularly
- the routine output_prologue () in config/out-m88k.c.
-
- subu r31,r31,n # stack pointer update
-
- (st rn,r31,offset)? # save incoming regs
- (st.d rn,r31,offset)?
-
- (addu r30,r31,n)? # frame pointer update
-
- (pic sequence)? # PIC code prologue
-
- (or rn,rm,0)? # Move parameters to other regs
-*/
-
-/* Macros for extracting fields from instructions. */
-
-#define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos))
-#define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width))
-
-/* Prologue code that handles position-independent-code setup. */
-
-struct pic_prologue_code {
- unsigned long insn, mask;
-};
-
-static struct pic_prologue_code pic_prologue_code [] = {
-/* FIXME -- until this is translated to hex, we won't match it... */
- 0xffffffff, 0,
- /* or r10,r1,0 (if not saved) */
- /* bsr.n LabN */
- /* or.u r25,r0,const */
- /*LabN: or r25,r25,const2 */
- /* addu r25,r25,1 */
- /* or r1,r10,0 (if not saved) */
-};
-
-/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
- is not the address of a valid instruction, the address of the next
- instruction beyond ADDR otherwise. *PWORD1 receives the first word
- of the instruction. PWORD2 is ignored -- a remnant of the original
- i960 version. */
-
-#define NEXT_PROLOGUE_INSN(addr, lim, pword1, pword2) \
- (((addr) < (lim)) ? next_insn (addr, pword1) : 0)
-
-/* Read the m88k instruction at 'memaddr' and return the address of
- the next instruction after that, or 0 if 'memaddr' is not the
- address of a valid instruction. The instruction
- is stored at 'pword1'. */
-
-CORE_ADDR
-next_insn (memaddr, pword1)
- unsigned long *pword1;
- CORE_ADDR memaddr;
-{
- unsigned long buf[1];
-
- read_memory (memaddr, buf, sizeof (buf));
- *pword1 = buf[0];
- SWAP_TARGET_AND_HOST (pword1, sizeof (long));
-
- return memaddr + 4;
-}
-
-/* Read a register from frames called by us (or from the hardware regs). */
-
-int
-read_next_frame_reg(fi, regno)
- FRAME fi;
- int regno;
-{
- for (; fi; fi = fi->next) {
- if (regno == SP_REGNUM) return fi->frame;
- else if (fi->fsr->regs[regno])
- return read_memory_integer(fi->fsr->regs[regno], 4);
- }
- return read_register(regno);
-}
-
-/* Examine the prologue of a function. `ip' points to the first instruction.
- `limit' is the limit of the prologue (e.g. the addr of the first
- linenumber, or perhaps the program counter if we're stepping through).
- `frame_sp' is the stack pointer value in use in this frame.
- `fsr' is a pointer to a frame_saved_regs structure into which we put
- info about the registers saved by this frame.
- `fi' is a struct frame_info pointer; we fill in various fields in it
- to reflect the offsets of the arg pointer and the locals pointer. */
-
-static CORE_ADDR
-examine_prologue (ip, limit, frame_sp, fsr, fi)
- register CORE_ADDR ip;
- register CORE_ADDR limit;
- FRAME_ADDR frame_sp;
- struct frame_saved_regs *fsr;
- struct frame_info *fi;
-{
- register CORE_ADDR next_ip;
- register int src;
- register struct pic_prologue_code *pcode;
- unsigned int insn1, insn2;
- int size, offset;
- char must_adjust[32]; /* If set, must adjust offsets in fsr */
- int sp_offset = -1; /* -1 means not set (valid must be mult of 8) */
- int fp_offset = -1; /* -1 means not set */
- CORE_ADDR frame_fp;
-
- bzero (must_adjust, sizeof (must_adjust));
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
-
- /* Accept move of incoming registers to other registers, using
- "or rd,rs,0" or "or.u rd,rs,0" or "or rd,r0,rs" or "or rd,rs,r0".
- We don't have to worry about walking into the first lines of code,
- since the first line number will stop us (assuming we have symbols).
- What we have actually seen is "or r10,r0,r12". */
-
-#define OR_MOVE_INSN 0x58000000 /* or/or.u with immed of 0 */
-#define OR_MOVE_MASK 0xF800FFFF
-#define OR_REG_MOVE1_INSN 0xF4005800 /* or rd,r0,rs */
-#define OR_REG_MOVE1_MASK 0xFC1FFFE0
-#define OR_REG_MOVE2_INSN 0xF4005800 /* or rd,rs,r0 */
-#define OR_REG_MOVE2_MASK 0xFC00FFFF
- while (next_ip &&
- ((insn1 & OR_MOVE_MASK) == OR_MOVE_INSN ||
- (insn1 & OR_REG_MOVE1_MASK) == OR_REG_MOVE1_INSN ||
- (insn1 & OR_REG_MOVE2_MASK) == OR_REG_MOVE2_INSN
- )
- )
- {
- /* We don't care what moves to where. The result of the moves
- has already been reflected in what the compiler tells us is the
- location of these parameters. */
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept an optional "subu sp,sp,n" to set up the stack pointer. */
-
-#define SUBU_SP_INSN 0x67ff0000
-#define SUBU_SP_MASK 0xffff0007 /* Note offset must be mult. of 8 */
-#define SUBU_OFFSET(x) ((unsigned)(x & 0xFFFF))
- if (next_ip &&
- ((insn1 & SUBU_SP_MASK) == SUBU_SP_INSN)) /* subu r31, r31, N */
- {
- sp_offset = -SUBU_OFFSET (insn1);
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* The function must start with a stack-pointer adjustment, or
- we don't know WHAT'S going on... */
- if (sp_offset == -1)
- return ip;
-
- /* Accept zero or more instances of "st rx,sp,n" or "st.d rx,sp,n".
- This may cause us to mistake the copying of a register
- parameter to the frame for the saving of a callee-saved
- register, but that can't be helped, since with the
- "-fcall-saved" flag, any register can be made callee-saved.
- This probably doesn't matter, since the ``saved'' caller's values of
- non-callee-saved registers are not relevant anyway. */
-
-#define STD_STACK_INSN 0x201f0000
-#define STD_STACK_MASK 0xfc1f0000
-#define ST_STACK_INSN 0x241f0000
-#define ST_STACK_MASK 0xfc1f0000
-#define ST_OFFSET(x) ((unsigned)((x) & 0xFFFF))
-#define ST_SRC(x) EXTRACT_FIELD ((x), 21, 5)
-
- while (next_ip)
- {
- if ((insn1 & ST_STACK_MASK) == ST_STACK_INSN)
- size = 1;
- else if ((insn1 & STD_STACK_MASK) == STD_STACK_INSN)
- size = 2;
- else
- break;
-
- src = ST_SRC (insn1);
- offset = ST_OFFSET (insn1);
- while (size--)
- {
- must_adjust[src] = 1;
- fsr->regs[src++] = offset; /* Will be adjusted later */
- offset += 4;
- }
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept an optional "addu r30,r31,n" to set up the frame pointer. */
-
-#define ADDU_FP_INSN 0x63df0000
-#define ADDU_FP_MASK 0xffff0000
-#define ADDU_OFFSET(x) ((unsigned)(x & 0xFFFF))
- if (next_ip &&
- ((insn1 & ADDU_FP_MASK) == ADDU_FP_INSN)) /* addu r30, r31, N */
- {
- fp_offset = ADDU_OFFSET (insn1);
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept the PIC prologue code if present. */
-
- pcode = pic_prologue_code;
- size = sizeof (pic_prologue_code) / sizeof (*pic_prologue_code);
- /* If return addr is saved, we don't use first or last insn of PICstuff. */
- if (fsr->regs[SRP_REGNUM]) {
- pcode++;
- size-=2;
- }
-
- while (size-- && next_ip && (pcode->insn == (pcode->mask & insn1)))
- {
- pcode++;
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept moves of parameter registers to other registers, using
- "or rd,rs,0" or "or.u rd,rs,0" or "or rd,r0,rs" or "or rd,rs,r0".
- We don't have to worry about walking into the first lines of code,
- since the first line number will stop us (assuming we have symbols).
- What gcc actually seems to produce is "or rd,r0,rs". */
-
-#define OR_MOVE_INSN 0x58000000 /* or/or.u with immed of 0 */
-#define OR_MOVE_MASK 0xF800FFFF
-#define OR_REG_MOVE1_INSN 0xF4005800 /* or rd,r0,rs */
-#define OR_REG_MOVE1_MASK 0xFC1FFFE0
-#define OR_REG_MOVE2_INSN 0xF4005800 /* or rd,rs,r0 */
-#define OR_REG_MOVE2_MASK 0xFC00FFFF
- while (next_ip &&
- ((insn1 & OR_MOVE_MASK) == OR_MOVE_INSN ||
- (insn1 & OR_REG_MOVE1_MASK) == OR_REG_MOVE1_INSN ||
- (insn1 & OR_REG_MOVE2_MASK) == OR_REG_MOVE2_INSN
- )
- )
- {
- /* We don't care what moves to where. The result of the moves
- has already been reflected in what the compiler tells us is the
- location of these parameters. */
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* We're done with the prologue. If we don't care about the stack
- frame itself, just return. (Note that fsr->regs has been trashed,
- but the one caller who calls with fi==0 passes a dummy there.) */
-
- if (fi == 0)
- return ip;
-
- /* OK, now we have:
- sp_offset original negative displacement of SP
- fp_offset positive displacement between new SP and new FP, or -1
- fsr->regs[0..31] offset from original SP where reg is stored
- must_adjust[0..31] set if corresp. offset was set
-
- The current SP (frame_sp) might not be the original new SP as set
- by the function prologue, if alloca has been called. This can
- only occur if fp_offset is set, though (the compiler allocates an
- FP when it sees alloca). In that case, we have the FP,
- and can calculate the original new SP from the FP.
-
- Then, we figure out where the arguments and locals are, and
- relocate the offsets in fsr->regs to absolute addresses. */
-
- if (fp_offset != -1) {
- /* We have a frame pointer, so get it, and base our calc's on it. */
- frame_fp = (CORE_ADDR) read_next_frame_reg (fi->next, FP_REGNUM);
- frame_sp = frame_fp - fp_offset;
- } else {
- /* We have no frame pointer, therefore frame_sp is still the same value
- as set by prologue. But where is the frame itself? */
- if (must_adjust[SRP_REGNUM]) {
- /* Function header saved SRP (r1), the return address. Frame starts
- 4 bytes down from where it was saved. */
- frame_fp = frame_sp + fsr->regs[SRP_REGNUM] - 4;
- fi->locals_pointer = frame_fp;
- } else {
- /* Function header didn't save SRP (r1), so we are in a leaf fn or
- are otherwise confused. */
- frame_fp = -1;
- }
- }
-
- /* The locals are relative to the FP (whether it exists as an allocated
- register, or just as an assumed offset from the SP) */
- fi->locals_pointer = frame_fp;
-
- /* The arguments are just above the SP as it was before we adjusted it
- on entry. */
- fi->args_pointer = frame_sp - sp_offset;
-
- /* Now that we know the SP value used by the prologue, we know where
- it saved all the registers. */
- for (src = 0; src < 32; src++)
- if (must_adjust[src])
- fsr->regs[src] += frame_sp;
-
- /* The saved value of the SP is always known. */
- /* (we hope...) */
- if (fsr->regs[SP_REGNUM] != 0
- && fsr->regs[SP_REGNUM] != frame_sp - sp_offset)
- fprintf(stderr, "Bad saved SP value %x != %x, offset %x!\n",
- fsr->regs[SP_REGNUM],
- frame_sp - sp_offset, sp_offset);
-
- fsr->regs[SP_REGNUM] = frame_sp - sp_offset;
-
- return (ip);
-}
-
-/* Given an ip value corresponding to the start of a function,
- return the ip of the first instruction after the function
- prologue. */
-
-CORE_ADDR
-skip_prologue (ip)
- CORE_ADDR (ip);
-{
- struct frame_saved_regs saved_regs_dummy;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- sal = find_pc_line (ip, 0);
- limit = (sal.end) ? sal.end : 0xffffffff;
-
- return (examine_prologue (ip, limit, (FRAME_ADDR) 0, &saved_regs_dummy,
- (struct frame_info *)0 ));
-}
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame.
-
- We cache the result of doing this in the frame_cache_obstack, since
- it is fairly expensive. */
-
-void
-frame_find_saved_regs (fi, fsr)
- struct frame_info *fi;
- struct frame_saved_regs *fsr;
-{
- register CORE_ADDR next_addr;
- register CORE_ADDR *saved_regs;
- register int regnum;
- register struct frame_saved_regs *cache_fsr;
- extern struct obstack frame_cache_obstack;
- CORE_ADDR ip;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- if (!fi->fsr)
- {
- cache_fsr = (struct frame_saved_regs *)
- obstack_alloc (&frame_cache_obstack,
- sizeof (struct frame_saved_regs));
- bzero (cache_fsr, sizeof (struct frame_saved_regs));
- fi->fsr = cache_fsr;
-
- /* Find the start and end of the function prologue. If the PC
- is in the function prologue, we only consider the part that
- has executed already. */
-
- ip = get_pc_function_start (fi->pc);
- sal = find_pc_line (ip, 0);
- limit = (sal.end && sal.end < fi->pc) ? sal.end: fi->pc;
-
- /* This will fill in fields in *fi as well as in cache_fsr. */
- examine_prologue (ip, limit, fi->frame, cache_fsr, fi);
- }
-
- if (fsr)
- *fsr = *fi->fsr;
-}
-
-/* Return the address of the locals block for the frame
- described by FI. Returns 0 if the address is unknown.
- NOTE! Frame locals are referred to by negative offsets from the
- argument pointer, so this is the same as frame_args_address(). */
-
-CORE_ADDR
-frame_locals_address (fi)
- struct frame_info *fi;
-{
- register FRAME frame;
- struct frame_saved_regs fsr;
- CORE_ADDR ap;
-
- if (fi->args_pointer) /* Cached value is likely there. */
- return fi->args_pointer;
-
- /* Nope, generate it. */
-
- get_frame_saved_regs (fi, &fsr);
-
- return fi->args_pointer;
-}
-
-/* Return the address of the argument block for the frame
- described by FI. Returns 0 if the address is unknown. */
-
-CORE_ADDR
-frame_args_address (fi)
- struct frame_info *fi;
-{
- register FRAME frame;
- struct frame_saved_regs fsr;
- CORE_ADDR ap;
-
- if (fi->args_pointer) /* Cached value is likely there. */
- return fi->args_pointer;
-
- /* Nope, generate it. */
-
- get_frame_saved_regs (fi, &fsr);
-
- return fi->args_pointer;
-}
-
-/* Return the saved PC from this frame.
-
- If the frame has a memory copy of SRP_REGNUM, use that. If not,
- just use the register SRP_REGNUM itself. */
-
-CORE_ADDR
-frame_saved_pc (frame)
- FRAME frame;
-{
- return read_next_frame_reg(frame, SRP_REGNUM);
-}
-
-
-#if TARGET_BYTE_ORDER != HOST_BYTE_ORDER
-you lose
-#else /* Host and target byte order the same. */
-#define SINGLE_EXP_BITS 8
-#define DOUBLE_EXP_BITS 11
-int
-IEEE_isNAN(fp, len)
- int *fp, len;
- /* fp points to a single precision OR double precision
- * floating point value; len is the number of bytes, either 4 or 8.
- * Returns 1 iff fp points to a valid IEEE floating point number.
- * Returns 0 if fp points to a denormalized number or a NaN
- */
-{
- int exponent;
- if (len == 4)
- {
- exponent = *fp;
- exponent = exponent << 1 >> (32 - SINGLE_EXP_BITS - 1);
- return ((exponent == -1) || (! exponent && *fp));
- }
- else if (len == 8)
- {
- exponent = *(fp+1);
- exponent = exponent << 1 >> (32 - DOUBLE_EXP_BITS - 1);
- return ((exponent == -1) || (! exponent && *fp * *(fp+1)));
- }
- else return 1;
-}
-#endif /* Host and target byte order the same. */
-
-static int
-pushed_size (prev_words, v)
- int prev_words;
- struct value *v;
-{
- switch (TYPE_CODE (VALUE_TYPE (v)))
- {
- case TYPE_CODE_VOID: /* Void type (values zero length) */
-
- return 0; /* That was easy! */
-
- case TYPE_CODE_PTR: /* Pointer type */
- case TYPE_CODE_ENUM: /* Enumeration type */
- case TYPE_CODE_INT: /* Integer type */
- case TYPE_CODE_REF: /* C++ Reference types */
- case TYPE_CODE_ARRAY: /* Array type, lower bound zero */
-
- return 1;
-
- case TYPE_CODE_FLT: /* Floating type */
-
- if (TYPE_LENGTH (VALUE_TYPE (v)) == 4)
- return 1;
- else
- /* Assume that it must be a double. */
- if (prev_words & 1) /* at an odd-word boundary */
- return 3; /* round to 8-byte boundary */
- else
- return 2;
-
- case TYPE_CODE_STRUCT: /* C struct or Pascal record */
- case TYPE_CODE_UNION: /* C union or Pascal variant part */
-
- return (((TYPE_LENGTH (VALUE_TYPE (v)) + 3) / 4) * 4);
-
- case TYPE_CODE_FUNC: /* Function type */
- case TYPE_CODE_SET: /* Pascal sets */
- case TYPE_CODE_RANGE: /* Range (integers within bounds) */
- case TYPE_CODE_PASCAL_ARRAY: /* Array with explicit type of index */
- case TYPE_CODE_MEMBER: /* Member type */
- case TYPE_CODE_METHOD: /* Method type */
- /* Don't know how to pass these yet. */
-
- case TYPE_CODE_UNDEF: /* Not used; catches errors */
- default:
- abort ();
- }
-}
-
-static void
-store_parm_word (address, val)
- CORE_ADDR address;
- int val;
-{
- write_memory (address, &val, 4);
-}
-
-static int
-store_parm (prev_words, left_parm_addr, v)
- unsigned int prev_words;
- CORE_ADDR left_parm_addr;
- struct value *v;
-{
- CORE_ADDR start = left_parm_addr + (prev_words * 4);
- int *val_addr = (int *)VALUE_CONTENTS(v);
-
- switch (TYPE_CODE (VALUE_TYPE (v)))
- {
- case TYPE_CODE_VOID: /* Void type (values zero length) */
-
- return 0;
-
- case TYPE_CODE_PTR: /* Pointer type */
- case TYPE_CODE_ENUM: /* Enumeration type */
- case TYPE_CODE_INT: /* Integer type */
- case TYPE_CODE_ARRAY: /* Array type, lower bound zero */
- case TYPE_CODE_REF: /* C++ Reference types */
-
- store_parm_word (start, *val_addr);
- return 1;
-
- case TYPE_CODE_FLT: /* Floating type */
-
- if (TYPE_LENGTH (VALUE_TYPE (v)) == 4)
- {
- store_parm_word (start, *val_addr);
- return 1;
- }
- else
- {
- store_parm_word (start + ((prev_words & 1) * 4), val_addr[0]);
- store_parm_word (start + ((prev_words & 1) * 4) + 4, val_addr[1]);
- return 2 + (prev_words & 1);
- }
-
- case TYPE_CODE_STRUCT: /* C struct or Pascal record */
- case TYPE_CODE_UNION: /* C union or Pascal variant part */
-
- {
- unsigned int words = (((TYPE_LENGTH (VALUE_TYPE (v)) + 3) / 4) * 4);
- unsigned int word;
-
- for (word = 0; word < words; word++)
- store_parm_word (start + (word * 4), val_addr[word]);
- return words;
- }
-
- default:
- abort ();
- }
-}
-
- /* This routine sets up all of the parameter values needed to make a pseudo
- call. The name "push_parameters" is a misnomer on some archs,
- because (on the m88k) most parameters generally end up being passed in
- registers rather than on the stack. In this routine however, we do
- end up storing *all* parameter values onto the stack (even if we will
- realize later that some of these stores were unnecessary). */
-
-#define FIRST_PARM_REGNUM 2
-
-void
-push_parameters (return_type, struct_conv, nargs, args)
- struct type *return_type;
- int struct_conv;
- int nargs;
- value *args;
-{
- int parm_num;
- unsigned int p_words = 0;
- CORE_ADDR left_parm_addr;
-
- /* Start out by creating a space for the return value (if need be). We
- only need to do this if the return value is a struct or union. If we
- do make a space for a struct or union return value, then we must also
- arrange for the base address of that space to go into r12, which is the
- standard place to pass the address of the return value area to the
- callee. Note that only structs and unions are returned in this fashion.
- Ints, enums, pointers, and floats are returned into r2. Doubles are
- returned into the register pair {r2,r3}. Note also that the space
- reserved for a struct or union return value only has to be word aligned
- (not double-word) but it is double-word aligned here anyway (just in
- case that becomes important someday). */
-
- switch (TYPE_CODE (return_type))
- {
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- {
- int return_bytes = ((TYPE_LENGTH (return_type) + 7) / 8) * 8;
- CORE_ADDR rv_addr;
-
- rv_addr = read_register (SP_REGNUM) - return_bytes;
-
- write_register (SP_REGNUM, rv_addr); /* push space onto the stack */
- write_register (SRA_REGNUM, rv_addr);/* set return value register */
- }
- }
-
- /* Here we make a pre-pass on the whole parameter list to figure out exactly
- how many words worth of stuff we are going to pass. */
-
- for (p_words = 0, parm_num = 0; parm_num < nargs; parm_num++)
- p_words += pushed_size (p_words, value_arg_coerce (args[parm_num]));
-
- /* Now, check to see if we have to round up the number of parameter words
- to get up to the next 8-bytes boundary. This may be necessary because
- of the software convention to always keep the stack aligned on an 8-byte
- boundary. */
-
- if (p_words & 1)
- p_words++; /* round to 8-byte boundary */
-
- /* Now figure out the absolute address of the leftmost parameter, and update
- the stack pointer to point at that address. */
-
- left_parm_addr = read_register (SP_REGNUM) - (p_words * 4);
- write_register (SP_REGNUM, left_parm_addr);
-
- /* Now we can go through all of the parameters (in left-to-right order)
- and write them to their parameter stack slots. Note that we are not
- really "pushing" the parameter values. The stack space for these values
- was already allocated above. Now we are just filling it up. */
-
- for (p_words = 0, parm_num = 0; parm_num < nargs; parm_num++)
- p_words +=
- store_parm (p_words, left_parm_addr, value_arg_coerce (args[parm_num]));
-
- /* Now that we are all done storing the parameter values into the stack, we
- must go back and load up the parameter registers with the values from the
- corresponding stack slots. Note that in the two cases of (a) gaps in the
- parameter word sequence causes by (otherwise) misaligned doubles, and (b)
- slots correcponding to structs or unions, the work we do here in loading
- some parameter registers may be unnecessary, but who cares? */
-
- for (p_words = 0; p_words < 8; p_words++)
- {
- write_register (FIRST_PARM_REGNUM + p_words,
- read_memory_integer (left_parm_addr + (p_words * 4), 4));
- }
-}
-
-void
-pop_frame ()
-{
- error ("Feature not implemented for the m88k yet.");
- return;
-}
-
-void
-collect_returned_value (rval, value_type, struct_return, nargs, args)
- value *rval;
- struct type *value_type;
- int struct_return;
- int nargs;
- value *args;
-{
- char retbuf[REGISTER_BYTES];
-
- bcopy (registers, retbuf, REGISTER_BYTES);
- *rval = value_being_returned (value_type, retbuf, struct_return);
- return;
-}
-
-#if 0
-/* Now handled in a machine independent way with CALL_DUMMY_LOCATION. */
- /* Stuff a breakpoint instruction onto the stack (or elsewhere if the stack
- is not a good place for it). Return the address at which the instruction
- got stuffed, or zero if we were unable to stuff it anywhere. */
-
-CORE_ADDR
-push_breakpoint ()
-{
- static char breakpoint_insn[] = BREAKPOINT;
- extern CORE_ADDR text_end; /* of inferior */
- static char readback_buffer[] = BREAKPOINT;
- int i;
-
- /* With a little bit of luck, we can just stash the breakpoint instruction
- in the word just beyond the end of normal text space. For systems on
- which the hardware will not allow us to execute out of the stack segment,
- we have to hope that we *are* at least allowed to effectively extend the
- text segment by one word. If the actual end of user's the text segment
- happens to fall right at a page boundary this trick may fail. Note that
- we check for this by reading after writing, and comparing in order to
- be sure that the write worked. */
-
- write_memory (text_end, &breakpoint_insn, 4);
-
- /* Fill the readback buffer with some garbage which is certain to be
- unequal to the breakpoint insn. That way we can tell if the
- following read doesn't actually succeed. */
-
- for (i = 0; i < sizeof (readback_buffer); i++)
- readback_buffer[i] = ~ readback_buffer[i]; /* Invert the bits */
-
- /* Now check that the breakpoint insn was successfully installed. */
-
- read_memory (text_end, readback_buffer, sizeof (readback_buffer));
- for (i = 0; i < sizeof (readback_buffer); i++)
- if (readback_buffer[i] != breakpoint_insn[i])
- return 0; /* Failed to install! */
-
- return text_end;
-}
-#endif
diff --git a/gdb/m88k-xdep.c b/gdb/m88k-xdep.c
deleted file mode 100644
index 835d8a2..0000000
--- a/gdb/m88k-xdep.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/* Copyright (C) 1988, 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include "gdbcore.h"
-#include <sys/user.h>
-
-#ifndef USER /* added to support BCS ptrace_user */
-#define USER ptrace_user
-#endif
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include "symtab.h"
-#include "setjmp.h"
-#include "value.h"
-
-#ifdef DELTA88
-#include <sys/ptrace.h>
-
-/* define offsets to the pc instruction offsets in ptrace_user struct */
-#define SXIP_OFFSET (char *)&u.pt_sigframe.sig_sxip - (char *)&u
-#define SNIP_OFFSET (char *)&u.pt_sigframe.sig_snip - (char *)&u
-#define SFIP_OFFSET (char *)&u.pt_sigframe.sig_sfip - (char *)&u
-#else
-/* define offsets to the pc instruction offsets in ptrace_user struct */
-#define SXIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_sxip - (char *)&u
-#define SNIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_snip - (char *)&u
-#define SFIP_OFFSET (char *)&u.pt_sigframe.dg_sigframe.sc_sfip - (char *)&u
-#endif
-
-extern int have_symbol_file_p();
-
-extern jmp_buf stack_jmp;
-
-extern int errno;
-extern char registers[REGISTER_BYTES];
-
-void
-fetch_inferior_registers ()
-{
- register int regno;
- register unsigned int regaddr;
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
-
- struct USER u;
- unsigned int offset;
-
- offset = (char *) &u.pt_r0 - (char *) &u;
- regaddr = offset; /* byte offset to r0;*/
-
-/* offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR; */
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- /*regaddr = register_addr (regno, offset);*/
- /* 88k enhancement */
-
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- *(int *) &buf[i] = ptrace (3, inferior_pid, regaddr, 0);
- regaddr += sizeof (int);
- }
- supply_register (regno, buf);
- }
- /* now load up registers 36 - 38; special pc registers */
- *(int *) &buf[0] = ptrace (3,inferior_pid,SXIP_OFFSET ,0);
- supply_register (SXIP_REGNUM, buf);
- *(int *) &buf[0] = ptrace (3, inferior_pid,SNIP_OFFSET,0);
- supply_register (SNIP_REGNUM, buf);
- *(int *) &buf[0] = ptrace (3, inferior_pid,SFIP_OFFSET,0);
- supply_register (SFIP_REGNUM, buf);
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- int regno;
-{
- register unsigned int regaddr;
- char buf[80];
-
- struct USER u;
-
-
- unsigned int offset = (char *) &u.pt_r0 - (char *) &u;
-
- regaddr = offset;
-
- if (regno >= 0)
- {
-/* regaddr = register_addr (regno, offset); */
- if (regno < PC_REGNUM)
- {
- regaddr = offset + regno * sizeof (int);
- errno = 0;
- ptrace (6, inferior_pid, regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- else if (regno == SXIP_REGNUM)
- ptrace (6, inferior_pid, SXIP_OFFSET, read_register(regno));
- else if (regno == SNIP_REGNUM)
- ptrace (6, inferior_pid, SNIP_OFFSET, read_register(regno));
- else if (regno == SFIP_REGNUM)
- ptrace (6, inferior_pid, SFIP_OFFSET, read_register(regno));
- else printf ("Bad register number for store_inferior routine\n");
- }
- else {
- for (regno = 0; regno < NUM_REGS - 3; regno++)
- {
- /* regaddr = register_addr (regno, offset); */
- errno = 0;
- regaddr = offset + regno * sizeof (int);
- ptrace (6, inferior_pid, regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- ptrace (6,inferior_pid,SXIP_OFFSET,read_register(SXIP_REGNUM));
- ptrace (6,inferior_pid,SNIP_OFFSET,read_register(SNIP_REGNUM));
- ptrace (6,inferior_pid,SFIP_OFFSET,read_register(SFIP_REGNUM));
- }
-
-
-}
-
-#if 0
-/* Core files are now a function of BFD. */
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- extern char registers[];
-
- /* Need symbol file and one with tdesc info for corefiles to work */
- if (!have_symbol_file_p())
- error ("Requires symbol-file and exec-file");
- if (!execfile)
- error ("Requires exec-file and symbol-file");
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
- /* 4.2-style (and perhaps also sysV-style) core dump file. */
- {
- struct USER u;
-
- int reg_offset;
-
- val = myread (corechan, &u, sizeof u);
- if (val < 0)
- perror_with_name (filename);
- data_start = u.pt_o_data_start;
-
- data_end = data_start + u.pt_dsize;
- stack_start = stack_end - u.pt_ssize;
- data_offset = u.pt_dataptr;
- stack_offset = data_offset + u.pt_dsize;
-
-#if defined(BCS)
-#if defined(DGUX)
-
- reg_offset = 2048;
-
-
-#endif /* defined (DGUX) */
-#else
-
- /* original code: */
- reg_offset = (int) u.pt_r0 - KERNEL_U_ADDR;
-
-#endif /* defined(BCS) */
-
- /* I don't know where to find this info.
- So, for now, mark it as not available. */
-/* N_SET_MAGIC (core_aouthdr, 0); */
- bzero ((char *) &core_aouthdr, sizeof core_aouthdr);
-
- /* Read the register values out of the core file and store
- them where `read_register' will find them. */
-
- {
- register int regno;
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- char buf[MAX_REGISTER_RAW_SIZE];
-
- val = lseek (corechan, register_addr (regno, reg_offset), 0);
- if (val < 0)
- perror_with_name (filename);
-
- val = myread (corechan, buf, sizeof buf);
- if (val < 0)
- perror_with_name (filename);
- supply_register (regno, buf);
- }
- }
- }
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- {
- corefile = concat (current_directory, "/", filename, NULL);
- }
- init_tdesc();
- current_context = init_dcontext();
- set_current_frame ( create_new_frame(get_frame_base (read_pc()),
- read_pc ()));
- select_frame (get_current_frame (), 0);
- validate_files ();
- }
- else if (from_tty)
- printf ("No core file now.\n");
-}
-#endif
-
-/* blockend is the address of the end of the user structure */
-m88k_register_u_addr (blockend, regnum)
-{
- struct USER u;
- int ustart = blockend - sizeof (struct USER);
- switch (regnum)
- {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- case 27:
- case 28:
- case 29:
- case 30:
- case 31: return (ustart + ((int) &u.pt_r0 - (int) &u) + sizeof(REGISTER_TYPE) * regnum);
- case PSR_REGNUM: return (ustart + ((int) &u.pt_psr - (int) &u));
- case FPSR_REGNUM: return (ustart + ((int) &u.pt_fpsr - (int) &u));
- case FPCR_REGNUM: return (ustart + ((int) &u.pt_fpcr - (int) &u));
- case SXIP_REGNUM: return (ustart + SXIP_OFFSET);
- case SNIP_REGNUM: return (ustart + SNIP_OFFSET);
- case SFIP_REGNUM: return (ustart + SFIP_OFFSET);
- default: return (blockend + sizeof (REGISTER_TYPE) * regnum);
- }
-}
diff --git a/gdb/mach386-xdep.c b/gdb/mach386-xdep.c
deleted file mode 100644
index 754299a..0000000
--- a/gdb/mach386-xdep.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Machine-dependent code for host Mach 386's for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "signame.h"
-#include "gdbcore.h"
-
-#if defined (GDB_TARGET_IS_MACH386)
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/core.h>
-
-void
-fetch_inferior_registers ()
-{
- struct regs inferior_registers;
- struct fp_state inferior_fp_registers;
- extern char registers[];
-
- registers_fetched ();
-
- ptrace (PTRACE_GETREGS, inferior_pid, &inferior_registers);
- ptrace (PTRACE_GETFPREGS, inferior_pid, &inferior_fp_registers);
-
- bcopy (&inferior_registers, registers, sizeof inferior_registers);
-
- bcopy (inferior_fp_registers.f_st,&registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.f_st);
- bcopy (&inferior_fp_registers.f_ctrl,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- int regno;
-{
- struct regs inferior_registers;
- struct fp_state inferior_fp_registers;
- extern char registers[];
-
- bcopy (registers, &inferior_registers, 20 * 4);
-
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],inferior_fp_registers.f_st,
- sizeof inferior_fp_registers.f_st);
- bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &inferior_fp_registers.f_ctrl,
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
-
-#ifdef PTRACE_FP_BUG
- if (regno == FP_REGNUM || regno == -1)
- /* Storing the frame pointer requires a gross hack, in which an
- instruction that moves eax into ebp gets single-stepped. */
- {
- int stack = inferior_registers.r_reg[SP_REGNUM];
- int stuff = ptrace (PTRACE_PEEKDATA, inferior_pid, stack);
- int reg = inferior_registers.r_reg[EAX];
- inferior_registers.r_reg[EAX] =
- inferior_registers.r_reg[FP_REGNUM];
- ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
- ptrace (PTRACE_POKEDATA, inferior_pid, stack, 0xc589);
- ptrace (PTRACE_SINGLESTEP, inferior_pid, stack, 0);
- wait (0);
- ptrace (PTRACE_POKEDATA, inferior_pid, stack, stuff);
- inferior_registers.r_reg[EAX] = reg;
- }
-#endif
- ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
- ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers);
-}
-
-#else /* Not mach386 target. */
-
-/* These functions shouldn't be called when we're cross-debugging. */
-
-void
-fetch_inferior_registers ()
-{
-}
-
-/* ARGSUSED */
-store_inferior_registers (regno)
- int regno;
-{
-}
-
-#endif /* Not mach386 target. */
-
-/* Work with core files, for GDB. */
-
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
- char *core_reg_sect;
- unsigned core_reg_size;
- int which;
-{
- int val;
- extern char registers[];
-
- switch (which) {
- case 0:
- case 1:
- bcopy (core_reg_sect, registers, core_reg_size);
- break;
-
- case 2:
-#ifdef FP0_REGNUM
- bcopy (core_reg_sect,
- &registers[REGISTER_BYTE (FP0_REGNUM)],
- core_reg_size); /* FIXME, probably bogus */
-#endif
-#ifdef FPC_REGNUM
- bcopy (&corestr.c_fpu.f_fpstatus.f_ctrl,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof corestr.c_fpu.f_fpstatus -
- sizeof corestr.c_fpu.f_fpstatus.f_st);
-#endif
- break;
- }
-}
diff --git a/gdb/main.c b/gdb/main.c
deleted file mode 100644
index 936879c..0000000
--- a/gdb/main.c
+++ /dev/null
@@ -1,2196 +0,0 @@
-/* Top level for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1988, 1989, 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-int fclose ();
-#include "defs.h"
-#include "gdbcmd.h"
-#include "param.h"
-#include "symtab.h"
-#include "inferior.h"
-#include "signals.h"
-#include "target.h"
-#include "breakpoint.h"
-#include "language.h"
-
-#include "getopt.h"
-
-/* readline include files */
-#include "readline.h"
-#include "history.h"
-
-/* readline defines this. */
-#undef savestring
-
-#ifdef USG
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-#include <string.h>
-#include <sys/file.h>
-#include <setjmp.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <ctype.h>
-
-#ifdef SET_STACK_LIMIT_HUGE
-#include <sys/time.h>
-#include <sys/resource.h>
-
-int original_stack_limit;
-#endif
-
-
-/* If this definition isn't overridden by the header files, assume
- that isatty and fileno exist on this system. */
-#ifndef ISATTY
-#define ISATTY(FP) (isatty (fileno (FP)))
-#endif
-
-/* Initialization file name for gdb. This is overridden in some configs. */
-
-#ifndef GDBINIT_FILENAME
-#define GDBINIT_FILENAME ".gdbinit"
-#endif
-char gdbinit[] = GDBINIT_FILENAME;
-
-#define ALL_CLEANUPS ((struct cleanup *)0)
-
-/* Version number of GDB, as a string. */
-
-extern char *version;
-
-/* Message to be printed before the error message, when an error occurs. */
-
-extern char *error_pre_print;
-
-extern char lang_frame_mismatch_warn[]; /* language.c */
-
-/* Flag for whether we want all the "from_tty" gubbish printed. */
-
-int caution = 1; /* Default is yes, sigh. */
-
-/*
- * Define all cmd_list_element's
- */
-
-/* Chain containing all defined commands. */
-
-struct cmd_list_element *cmdlist;
-
-/* Chain containing all defined info subcommands. */
-
-struct cmd_list_element *infolist;
-
-/* Chain containing all defined enable subcommands. */
-
-struct cmd_list_element *enablelist;
-
-/* Chain containing all defined disable subcommands. */
-
-struct cmd_list_element *disablelist;
-
-/* Chain containing all defined delete subcommands. */
-
-struct cmd_list_element *deletelist;
-
-/* Chain containing all defined "enable breakpoint" subcommands. */
-
-struct cmd_list_element *enablebreaklist;
-
-/* Chain containing all defined set subcommands */
-
-struct cmd_list_element *setlist;
-
-/* Chain containing all defined show subcommands. */
-struct cmd_list_element *showlist;
-
-/* Chain containing all defined \"set history\". */
-
-struct cmd_list_element *sethistlist;
-
-/* Chain containing all defined \"show history\". */
-struct cmd_list_element *showhistlist;
-
-/* Chain containing all defined \"unset history\". */
-
-struct cmd_list_element *unsethistlist;
-
-/* stdio stream that command input is being read from. */
-
-FILE *instream;
-
-/* Current working directory. */
-
-char *current_directory;
-
-/* The directory name is actually stored here (usually). */
-static char dirbuf[MAXPATHLEN];
-
-/* Function to call before reading a command, if nonzero.
- The function receives two args: an input stream,
- and a prompt string. */
-
-void (*window_hook) ();
-
-extern int frame_file_full_name;
-int epoch_interface;
-int xgdb_verbose;
-
-/* The external commands we call... */
-extern void init_source_path ();
-extern void directory_command ();
-extern void exec_file_command ();
-extern void symbol_file_command ();
-extern void core_file_command ();
-extern void tty_command ();
-
-extern void help_list ();
-extern void initialize_all_files ();
-extern void init_malloc ();
-
-/* Forward declarations for this file */
-void free_command_lines ();
-char *gdb_readline ();
-char *command_line_input ();
-static void initialize_history ();
-static void initialize_main ();
-static void initialize_cmd_lists ();
-static void init_signals ();
-static void quit_command ();
-void command_loop ();
-static void source_command ();
-static void print_gdb_version ();
-static void print_gnu_advertisement ();
-static void float_handler ();
-static void cd_command ();
-static void read_command_file ();
-
-char *getenv ();
-
-/* gdb prints this when reading a command interactively */
-static char *prompt;
-
-/* Buffer used for reading command lines, and the size
- allocated for it so far. */
-
-char *line;
-int linesize = 100;
-
-/* Baud rate specified for talking to serial target systems. Default
- is left as a zero pointer, so targets can choose their own defaults. */
-
-char *baud_rate;
-
-/* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT. */
-
-#ifndef STOP_SIGNAL
-#ifdef SIGTSTP
-#define STOP_SIGNAL SIGTSTP
-#endif
-#endif
-
-/* Some System V have job control but not sigsetmask(). */
-#if !defined (HAVE_SIGSETMASK)
-#define HAVE_SIGSETMASK !defined (USG)
-#endif
-
-#if 0 == (HAVE_SIGSETMASK)
-#define sigsetmask(n)
-#endif
-
-/* This is how `error' returns to command level. */
-
-jmp_buf to_top_level;
-
-void
-return_to_top_level ()
-{
- quit_flag = 0;
- immediate_quit = 0;
- bpstat_clear_actions(stop_bpstat); /* Clear queued breakpoint commands */
- clear_momentary_breakpoints ();
- disable_current_display ();
- do_cleanups (ALL_CLEANUPS);
- longjmp (to_top_level, 1);
-}
-
-/* Call FUNC with arg ARGS, catching any errors.
- If there is no error, return the value returned by FUNC.
- If there is an error, print ERRSTRING, print the specific error message,
- then return zero. */
-
-int
-catch_errors (func, args, errstring)
- int (*func) ();
- char *args;
- char *errstring;
-{
- jmp_buf saved;
- int val;
- struct cleanup *saved_cleanup_chain;
- char *saved_error_pre_print;
-
- saved_cleanup_chain = save_cleanups ();
- saved_error_pre_print = error_pre_print;
-
- bcopy (to_top_level, saved, sizeof (jmp_buf));
- error_pre_print = errstring;
-
- if (setjmp (to_top_level) == 0)
- val = (*func) (args);
- else
- val = 0;
-
- restore_cleanups (saved_cleanup_chain);
-
- error_pre_print = saved_error_pre_print;
- bcopy (saved, to_top_level, sizeof (jmp_buf));
- return val;
-}
-
-/* Handler for SIGHUP. */
-
-static void
-disconnect ()
-{
- kill_inferior_fast ();
- signal (SIGHUP, SIG_DFL);
- kill (getpid (), SIGHUP);
-}
-
-/* Clean up on error during a "source" command (or execution of a
- user-defined command). */
-
-static void
-source_cleanup (stream)
- FILE *stream;
-{
- /* Restore the previous input stream. */
- instream = stream;
-}
-
-/* Read commands from STREAM. */
-static void
-read_command_file (stream)
- FILE *stream;
-{
- struct cleanup *cleanups;
-
- cleanups = make_cleanup (source_cleanup, instream);
- instream = stream;
- command_loop ();
- do_cleanups (cleanups);
-}
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int count;
- static int inhibit_gdbinit = 0;
- static int quiet = 0;
- static int batch = 0;
-
- /* Pointers to various arguments from command line. */
- char *symarg = NULL;
- char *execarg = NULL;
- char *corearg = NULL;
- char *cdarg = NULL;
- char *ttyarg = NULL;
-
- /* Pointers to all arguments of +command option. */
- char **cmdarg;
- /* Allocated size of cmdarg. */
- int cmdsize;
- /* Number of elements of cmdarg used. */
- int ncmd;
-
- /* Indices of all arguments of +directory option. */
- char **dirarg;
- /* Allocated size. */
- int dirsize;
- /* Number of elements used. */
- int ndir;
-
- register int i;
-
- /* This needs to happen before the first use of malloc. */
- init_malloc ();
-
-#if defined (ALIGN_STACK_ON_STARTUP)
- i = (int) &count & 0x3;
- if (i != 0)
- alloca (4 - i);
-#endif
-
- /* If error() is called from initialization code, just exit */
- if (setjmp (to_top_level)) {
- exit(1);
- }
-
- cmdsize = 1;
- cmdarg = (char **) xmalloc (cmdsize * sizeof (*cmdarg));
- ncmd = 0;
- dirsize = 1;
- dirarg = (char **) xmalloc (dirsize * sizeof (*dirarg));
- ndir = 0;
-
- quit_flag = 0;
- line = (char *) xmalloc (linesize);
- line[0] = '\0'; /* Terminate saved (now empty) cmd line */
- instream = stdin;
-
- getwd (dirbuf);
- current_directory = dirbuf;
-
-#ifdef SET_STACK_LIMIT_HUGE
- {
- struct rlimit rlim;
-
- /* Set the stack limit huge so that alloca (particularly stringtab
- * in dbxread.c) does not fail. */
- getrlimit (RLIMIT_STACK, &rlim);
- original_stack_limit = rlim.rlim_cur;
- rlim.rlim_cur = rlim.rlim_max;
- setrlimit (RLIMIT_STACK, &rlim);
- }
-#endif /* SET_STACK_LIMIT_HUGE */
-
- /* Parse arguments and options. */
- {
- int c;
- static int print_help;
- /* When var field is 0, use flag field to record the equivalent
- short option (or arbitrary numbers starting at 10 for those
- with no equivalent). */
- static struct option long_options[] =
- {
- {"quiet", 0, &quiet, 1},
- {"nx", 0, &inhibit_gdbinit, 1},
- {"batch", 0, &batch, 1},
- {"epoch", 0, &epoch_interface, 1},
- {"fullname", 0, &frame_file_full_name, 1},
- {"help", 0, &print_help, 1},
- {"se", 1, 0, 10},
- {"symbols", 1, 0, 's'},
- {"s", 1, 0, 's'},
- {"exec", 1, 0, 'e'},
- {"core", 1, 0, 'c'},
- {"c", 1, 0, 'c'},
- {"command", 1, 0, 'x'},
- {"x", 1, 0, 'x'},
- {"directory", 1, 0, 'd'},
- {"cd", 1, 0, 11},
- {"tty", 1, 0, 't'},
- {"b", 1, 0, 'b'},
-/* Allow machine descriptions to add more options... */
-#ifdef ADDITIONAL_OPTIONS
- ADDITIONAL_OPTIONS
-#endif
- {0, 0, 0, 0},
- };
-
- while (1)
- {
- c = getopt_long_only (argc, argv, "",
- long_options, &option_index);
- if (c == EOF)
- break;
-
- /* Long option that takes an argument. */
- if (c == 0 && long_options[option_index].flag == 0)
- c = long_options[option_index].val;
-
- switch (c)
- {
- case 0:
- /* Long option that just sets a flag. */
- break;
- case 10:
- symarg = optarg;
- execarg = optarg;
- break;
- case 11:
- cdarg = optarg;
- break;
- case 's':
- symarg = optarg;
- break;
- case 'e':
- execarg = optarg;
- break;
- case 'c':
- corearg = optarg;
- break;
- case 'x':
- cmdarg[ncmd++] = optarg;
- if (ncmd >= cmdsize)
- {
- cmdsize *= 2;
- cmdarg = (char **) xrealloc ((char *)cmdarg,
- cmdsize * sizeof (*cmdarg));
- }
- break;
- case 'd':
- dirarg[ndir++] = optarg;
- if (ndir >= dirsize)
- {
- dirsize *= 2;
- dirarg = (char **) xrealloc ((char *)dirarg,
- dirsize * sizeof (*dirarg));
- }
- break;
- case 't':
- ttyarg = optarg;
- break;
- case 'q':
- quiet = 1;
- break;
- case 'b':
- baud_rate = optarg;
- break;
-#ifdef ADDITIONAL_OPTION_CASES
- ADDITIONAL_OPTION_CASES
-#endif
- case '?':
- fprintf (stderr,
- "Use `%s +help' for a complete list of options.\n",
- argv[0]);
- exit (1);
- }
-
- }
- if (print_help)
- {
- fputs ("\
-This is GDB, the GNU debugger. Use the command\n\
- gdb [options] [executable [core-file]]\n\
-to enter the debugger.\n\
-\n\
-Options available are:\n\
- -help Print this message.\n\
- -quiet Do not print version number on startup.\n\
- -fullname Output information used by emacs-GDB interface.\n\
- -epoch Output information used by epoch emacs-GDB interface.\n\
- -batch Exit after processing options.\n\
- -nx Do not read .gdbinit file.\n\
- -tty=TTY Use TTY for input/output by the program being debugged.\n\
- -cd=DIR Change current directory to DIR.\n\
- -directory=DIR Search for source files in DIR.\n\
- -command=FILE Execute GDB commands from FILE.\n\
- -symbols=SYMFILE Read symbols from SYMFILE.\n\
- -exec=EXECFILE Use EXECFILE as the executable.\n\
- -se=FILE Use FILE as symbol file and executable file.\n\
- -core=COREFILE Analyze the core dump COREFILE.\n\
- -b BAUDRATE Set serial port baud rate used for remote debugging\n\
-", stderr);
-#ifdef ADDITIONAL_OPTION_HELP
- fputs (ADDITIONAL_OPTION_HELP, stderr);
-#endif
- fputs ("\n\
-For more information, type \"help\" from within GDB, or consult the\n\
-GDB manual (available as on-line info or a printed manual).\n", stderr);
- /* Exiting after printing this message seems like
- the most useful thing to do. */
- exit (0);
- }
-
- /* OK, that's all the options. The other arguments are filenames. */
- count = 0;
- for (; optind < argc; optind++)
- switch (++count)
- {
- case 1:
- symarg = argv[optind];
- execarg = argv[optind];
- break;
- case 2:
- corearg = argv[optind];
- break;
- case 3:
- fprintf (stderr,
- "Excess command line arguments ignored. (%s%s)\n",
- argv[optind], (optind == argc - 1) ? "" : " ...");
- break;
- }
- if (batch)
- quiet = 1;
- }
-
- /* Run the init function of each source file */
-
- initialize_cmd_lists (); /* This needs to be done first */
- initialize_all_files ();
- initialize_main (); /* But that omits this file! Do it now */
- init_signals ();
-
- if (!quiet)
- {
- /* Print all the junk at the top, with trailing "..." if we are about
- to read a symbol file (possibly slowly). */
- print_gnu_advertisement ();
- print_gdb_version ();
- if (symarg)
- printf_filtered ("..");
- wrap_here("");
- fflush (stdout); /* Force to screen during slow operations */
- }
-
- error_pre_print = "\n\n";
-
- /* Now perform all the actions indicated by the arguments. */
- if (cdarg != NULL)
- {
- if (!setjmp (to_top_level))
- {
- cd_command (cdarg, 0);
- init_source_path ();
- }
- }
- do_cleanups (ALL_CLEANUPS);
-
- for (i = 0; i < ndir; i++)
- if (!setjmp (to_top_level))
- directory_command (dirarg[i], 0);
- free (dirarg);
- do_cleanups (ALL_CLEANUPS);
-
- if (execarg != NULL
- && symarg != NULL
- && strcmp (execarg, symarg) == 0)
- {
- /* The exec file and the symbol-file are the same. If we can't open
- it, better only print one error message. */
- if (!setjmp (to_top_level))
- {
- exec_file_command (execarg, !batch);
- symbol_file_command (symarg, 0);
- }
- }
- else
- {
- if (execarg != NULL)
- if (!setjmp (to_top_level))
- exec_file_command (execarg, !batch);
- if (symarg != NULL)
- if (!setjmp (to_top_level))
- symbol_file_command (symarg, 0);
- }
- do_cleanups (ALL_CLEANUPS);
-
- /* After the symbol file has been read, print a newline to get us
- beyond the copyright line... But errors should still set off
- the error message with a (single) blank line. */
- if (!quiet)
- printf_filtered ("\n");
- error_pre_print = "\n";
-
- if (corearg != NULL)
- if (!setjmp (to_top_level))
- core_file_command (corearg, !batch);
- else if (isdigit (corearg[0]) && !setjmp (to_top_level))
- attach_command (corearg, !batch);
- do_cleanups (ALL_CLEANUPS);
-
- if (ttyarg != NULL)
- if (!setjmp (to_top_level))
- tty_command (ttyarg, !batch);
- do_cleanups (ALL_CLEANUPS);
-
-#ifdef ADDITIONAL_OPTION_HANDLER
- ADDITIONAL_OPTION_HANDLER;
-#endif
-
- /* Error messages should no longer be distinguished with extra output. */
- error_pre_print = 0;
-
- {
- struct stat homebuf, cwdbuf;
- char *homedir, *homeinit;
-
- /* Read init file, if it exists in home directory */
- homedir = getenv ("HOME");
- if (homedir)
- {
- homeinit = (char *) alloca (strlen (getenv ("HOME")) +
- strlen (gdbinit) + 10);
- strcpy (homeinit, getenv ("HOME"));
- strcat (homeinit, "/");
- strcat (homeinit, gdbinit);
- if (!inhibit_gdbinit && access (homeinit, R_OK) == 0)
- if (!setjmp (to_top_level))
- source_command (homeinit, 0);
- do_cleanups (ALL_CLEANUPS);
-
- /* Do stats; no need to do them elsewhere since we'll only
- need them if homedir is set. Make sure that they are
- zero in case one of them fails (this guarantees that they
- won't match if either exists). */
-
- bzero (&homebuf, sizeof (struct stat));
- bzero (&cwdbuf, sizeof (struct stat));
-
- stat (homeinit, &homebuf);
- stat (gdbinit, &cwdbuf); /* We'll only need this if
- homedir was set. */
- }
-
- /* Read the input file in the current directory, *if* it isn't
- the same file (it should exist, also). */
-
- if (!homedir
- || bcmp ((char *) &homebuf,
- (char *) &cwdbuf,
- sizeof (struct stat)))
- if (!inhibit_gdbinit && access (gdbinit, R_OK) == 0)
- if (!setjmp (to_top_level))
- source_command (gdbinit, 0);
- do_cleanups (ALL_CLEANUPS);
- }
-
- for (i = 0; i < ncmd; i++)
- if (!setjmp (to_top_level))
- {
- if (cmdarg[i][0] == '-' && cmdarg[i][1] == '\0')
- read_command_file (stdin);
- else
- source_command (cmdarg[i], !batch);
- do_cleanups (ALL_CLEANUPS);
- }
- free (cmdarg);
-
- /* Read in the old history after all the command files have been read. */
- initialize_history();
-
- if (batch)
- {
- /* We have hit the end of the batch file. */
- exit (0);
- }
-
- /* Do any host- or target-specific hacks. This is used for i960 targets
- to force the user to set a nindy target and spec its parameters. */
-
-#ifdef BEFORE_MAIN_LOOP_HOOK
- BEFORE_MAIN_LOOP_HOOK;
-#endif
-
- /* The command loop. */
-
- while (1)
- {
- if (!setjmp (to_top_level))
- {
- do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */
- command_loop ();
- quit_command ((char *)0, instream == stdin);
- }
- }
- /* No exit -- exit is through quit_command. */
-}
-
-/* Execute the line P as a command.
- Pass FROM_TTY as second argument to the defining function. */
-
-void
-execute_command (p, from_tty)
- char *p;
- int from_tty;
-{
- register struct cmd_list_element *c;
- register struct command_line *cmdlines;
- register enum language flang;
- static struct language_defn *saved_language = 0;
- static int warned = 0;
-
- free_all_values ();
-
- /* This can happen when command_line_input hits end of file. */
- if (p == NULL)
- return;
-
- while (*p == ' ' || *p == '\t') p++;
- if (*p)
- {
- char *arg;
-
- c = lookup_cmd (&p, cmdlist, "", 0, 1);
- /* Pass null arg rather than an empty one. */
- arg = *p ? p : 0;
- if (c->class == class_user)
- {
- struct cleanup *old_chain;
-
- if (*p)
- error ("User-defined commands cannot take arguments.");
- cmdlines = c->user_commands;
- if (cmdlines == 0)
- /* Null command */
- return;
-
- /* Set the instream to 0, indicating execution of a
- user-defined function. */
- old_chain = make_cleanup (source_cleanup, instream);
- instream = (FILE *) 0;
- while (cmdlines)
- {
- execute_command (cmdlines->line, 0);
- cmdlines = cmdlines->next;
- }
- do_cleanups (old_chain);
- }
- else if (c->type == set_cmd || c->type == show_cmd)
- do_setshow_command (arg, from_tty & caution, c);
- else if (c->function == NO_FUNCTION)
- error ("That is not a command, just a help topic.");
- else
- (*c->function) (arg, from_tty & caution);
- }
-
- /* Tell the user if the language has changed (except first time). */
- if (current_language != saved_language)
- {
- if (language_mode == language_mode_auto) {
- if (saved_language)
- language_info ();
- }
- saved_language = current_language;
- warned = 0;
- }
-
- /* Warn the user if the working language does not match the
- language of the current frame. Only warn the user if we are
- actually running the program, i.e. there is a stack. */
- /* FIXME: This should be cacheing the frame and only running when
- the frame changes. */
- if (target_has_stack)
- {
- flang = get_frame_language ();
- if (!warned
- && flang != language_unknown
- && flang != current_language->la_language)
- {
- printf_filtered ("%s\n", lang_frame_mismatch_warn);
- warned = 1;
- }
- }
-}
-
-/* ARGSUSED */
-void
-command_loop_marker (foo)
- int foo;
-{
-}
-
-/* Read commands from `instream' and execute them
- until end of file or error reading instream. */
-void
-command_loop ()
-{
- struct cleanup *old_chain;
- char *command;
- int stdin_is_tty = ISATTY (stdin);
-
- while (!feof (instream))
- {
- if (window_hook && instream == stdin)
- (*window_hook) (instream, prompt);
-
- quit_flag = 0;
- if (instream == stdin && stdin_is_tty)
- reinitialize_more_filter ();
- old_chain = make_cleanup (command_loop_marker, 0);
- command = command_line_input (instream == stdin ? prompt : 0,
- instream == stdin);
- if (command == 0)
- return;
- execute_command (command, instream == stdin);
- /* Do any commands attached to breakpoint we stopped at. */
- bpstat_do_actions (&stop_bpstat);
- do_cleanups (old_chain);
- }
-}
-
-/* Commands call this if they do not want to be repeated by null lines. */
-
-void
-dont_repeat ()
-{
- /* If we aren't reading from standard input, we are saving the last
- thing read from stdin in line and don't want to delete it. Null lines
- won't repeat here in any case. */
- if (instream == stdin)
- *line = 0;
-}
-
-/* Read a line from the stream "instream" without command line editing.
-
- It prints PRROMPT once at the start.
- Action is compatible with "readline", e.g. space for the result is
- malloc'd and should be freed by the caller.
-
- A NULL return means end of file. */
-char *
-gdb_readline (prrompt)
- char *prrompt;
-{
- int c;
- char *result;
- int input_index = 0;
- int result_size = 80;
-
- if (prrompt)
- {
- printf (prrompt);
- fflush (stdout);
- }
-
- result = (char *) xmalloc (result_size);
-
- while (1)
- {
- /* Read from stdin if we are executing a user defined command.
- This is the right thing for prompt_for_continue, at least. */
- c = fgetc (instream ? instream : stdin);
-
- if (c == EOF)
- {
- free (result);
- return NULL;
- }
-
- if (c == '\n')
- break;
-
- result[input_index++] = c;
- while (input_index >= result_size)
- {
- result_size *= 2;
- result = (char *) xrealloc (result, result_size);
- }
- }
-
- result[input_index++] = '\0';
- return result;
-}
-
-/* Declaration for fancy readline with command line editing. */
-char *readline ();
-
-/* Variables which control command line editing and history
- substitution. These variables are given default values at the end
- of this file. */
-static int command_editing_p;
-static int history_expansion_p;
-static int write_history_p;
-static int history_size;
-static char *history_filename;
-
-/* Variables which are necessary for fancy command line editing. */
-char *gdb_completer_word_break_characters =
- " \t\n!@#$%^&*()-+=|~`}{[]\"';:?/>.<,";
-
-/* Functions that are used as part of the fancy command line editing. */
-
-/* This can be used for functions which don't want to complete on symbols
- but don't want to complete on anything else either. */
-/* ARGSUSED */
-char **
-noop_completer (text)
- char *text;
-{
- return NULL;
-}
-
-/* Generate symbol names one by one for the completer. If STATE is
- zero, then we need to initialize, otherwise the initialization has
- already taken place. TEXT is what we expect the symbol to start
- with. RL_LINE_BUFFER is available to be looked at; it contains the
- entire text of the line. RL_POINT is the offset in that line of
- the cursor. You should pretend that the line ends at RL_POINT.
- The result is NULL if there are no more completions, else a char
- string which is a possible completion. */
-char *
-symbol_completion_function (text, state)
- char *text;
- int state;
-{
- static char **list = (char **)NULL;
- static int index;
- char *output;
- extern char *rl_line_buffer;
- extern int rl_point;
- char *tmp_command, *p;
- struct cmd_list_element *c, *result_list;
-
- if (!state)
- {
- /* Free the storage used by LIST, but not by the strings inside. This is
- because rl_complete_internal () frees the strings. */
- if (list)
- free (list);
- list = 0;
- index = 0;
-
- /* Decide whether to complete on a list of gdb commands or on
- symbols. */
- tmp_command = (char *) alloca (rl_point + 1);
- p = tmp_command;
-
- strncpy (tmp_command, rl_line_buffer, rl_point);
- tmp_command[rl_point] = '\0';
-
- if (rl_point == 0)
- {
- /* An empty line we want to consider ambiguous; that is,
- it could be any command. */
- c = (struct cmd_list_element *) -1;
- result_list = 0;
- }
- else
- c = lookup_cmd_1 (&p, cmdlist, &result_list, 1);
-
- /* Move p up to the next interesting thing. */
- while (*p == ' ' || *p == '\t')
- p++;
-
- if (!c)
- /* He's typed something unrecognizable. Sigh. */
- list = (char **) 0;
- else if (c == (struct cmd_list_element *) -1)
- {
- /* If we didn't recognize everything up to the thing that
- needs completing, and we don't know what command it is
- yet, we are in trouble. Part of the trouble might be
- that the list of delimiters used by readline includes
- '-', which we use in commands. Check for this. */
- if (p + strlen(text) != tmp_command + rl_point) {
- if (tmp_command[rl_point - strlen(text) - 1] == '-')
- text = p;
- else {
- /* This really should not produce an error. Better would
- be to pretend to hit RETURN here; this would produce a
- response like "Ambiguous command: foo, foobar, etc",
- and leave the line available for re-entry with ^P. Instead,
- this error blows away the user's typed input without
- any way to get it back. */
- error (" Unrecognized command.");
- }
- }
-
- /* He's typed something ambiguous. This is easier. */
- if (result_list)
- list = complete_on_cmdlist (*result_list->prefixlist, text);
- else
- list = complete_on_cmdlist (cmdlist, text);
- }
- else
- {
- /* If we've gotten this far, gdb has recognized a full
- command. There are several possibilities:
-
- 1) We need to complete on the command.
- 2) We need to complete on the possibilities coming after
- the command.
- 2) We need to complete the text of what comes after the
- command. */
-
- if (!*p && *text)
- /* Always (might be longer versions of thie command). */
- list = complete_on_cmdlist (result_list, text);
- else if (!*p && !*text)
- {
- if (c->prefixlist)
- list = complete_on_cmdlist (*c->prefixlist, "");
- else
- list = (*c->completer) ("");
- }
- else
- {
- if (c->prefixlist && !c->allow_unknown)
- {
-#if 0
- /* Something like "info adsfkdj". But error() is not
- the proper response; just return no completions
- instead. */
- *p = '\0';
- error ("\"%s\" command requires a subcommand.",
- tmp_command);
-#else
- list = NULL;
-#endif
- }
- else
- list = (*c->completer) (text);
- }
- }
- }
-
- /* If the debugged program wasn't compiled with symbols, or if we're
- clearly completing on a command and no command matches, return
- NULL. */
- if (!list)
- return ((char *)NULL);
-
- output = list[index];
- if (output)
- index++;
-
- return (output);
-}
-
-#ifdef STOP_SIGNAL
-static void
-stop_sig ()
-{
-#if STOP_SIGNAL == SIGTSTP
- signal (SIGTSTP, SIG_DFL);
- sigsetmask (0);
- kill (getpid (), SIGTSTP);
- signal (SIGTSTP, stop_sig);
-#else
- signal (STOP_SIGNAL, stop_sig);
-#endif
- printf ("%s", prompt);
- fflush (stdout);
-
- /* Forget about any previous command -- null line now will do nothing. */
- dont_repeat ();
-}
-#endif /* STOP_SIGNAL */
-
-/* Initialize signal handlers. */
-static void
-do_nothing ()
-{
-}
-
-static void
-init_signals ()
-{
- extern void request_quit ();
-
- signal (SIGINT, request_quit);
-
- /* If we initialize SIGQUIT to SIG_IGN, then the SIG_IGN will get
- passed to the inferior, which we don't want. It would be
- possible to do a "signal (SIGQUIT, SIG_DFL)" after we fork, but
- on BSD4.3 systems using vfork, that can affect the
- GDB process as well as the inferior (the signal handling tables
- might be in memory, shared between the two). Since we establish
- a handler for SIGQUIT, when we call exec it will set the signal
- to SIG_DFL for us. */
- signal (SIGQUIT, do_nothing);
- if (signal (SIGHUP, do_nothing) != SIG_IGN)
- signal (SIGHUP, disconnect);
- signal (SIGFPE, float_handler);
-}
-
-/* Read one line from the command input stream `instream'
- into the local static buffer `linebuffer' (whose current length
- is `linelength').
- The buffer is made bigger as necessary.
- Returns the address of the start of the line.
-
- NULL is returned for end of file.
-
- *If* the instream == stdin & stdin is a terminal, the line read
- is copied into the file line saver (global var char *line,
- length linesize) so that it can be duplicated.
-
- This routine either uses fancy command line editing or
- simple input as the user has requested. */
-
-char *
-command_line_input (prrompt, repeat)
- char *prrompt;
- int repeat;
-{
- static char *linebuffer = 0;
- static int linelength = 0;
- register char *p;
- char *p1;
- char *rl;
- char *local_prompt = prrompt;
- register int c;
- char *nline;
- char got_eof = 0;
-
- if (linebuffer == 0)
- {
- linelength = 80;
- linebuffer = (char *) xmalloc (linelength);
- }
-
- p = linebuffer;
-
- /* Control-C quits instantly if typed while in this loop
- since it should not wait until the user types a newline. */
- immediate_quit++;
-#ifdef STOP_SIGNAL
- signal (STOP_SIGNAL, stop_sig);
-#endif
-
- while (1)
- {
- /* Reports are that some Sys V's don't flush stdout/err on reads
- from stdin, when stdin/out are sockets rather than ttys. So we
- have to do it ourselves, to make emacs-gdb and xxgdb work.
- On other machines, doing this once per input should be a cheap nop. */
- fflush (stdout);
- fflush (stderr);
-
- /* Don't use fancy stuff if not talking to stdin. */
- if (command_editing_p && instream == stdin
- && ISATTY (instream))
- rl = readline (local_prompt);
- else
- rl = gdb_readline (local_prompt);
-
- if (!rl || rl == (char *) EOF)
- {
- got_eof = 1;
- break;
- }
- if (strlen(rl) + 1 + (p - linebuffer) > linelength)
- {
- linelength = strlen(rl) + 1 + (p - linebuffer);
- nline = (char *) xrealloc (linebuffer, linelength);
- p += nline - linebuffer;
- linebuffer = nline;
- }
- p1 = rl;
- /* Copy line. Don't copy null at end. (Leaves line alone
- if this was just a newline) */
- while (*p1)
- *p++ = *p1++;
-
- free (rl); /* Allocated in readline. */
-
- if (p == linebuffer || *(p - 1) != '\\')
- break;
-
- p--; /* Put on top of '\'. */
- local_prompt = (char *) 0;
- }
-
-#ifdef STOP_SIGNAL
- signal (SIGTSTP, SIG_DFL);
-#endif
- immediate_quit--;
-
- if (got_eof)
- return NULL;
-
- /* Do history expansion if that is wished. */
- if (history_expansion_p && instream == stdin
- && ISATTY (instream))
- {
- char *history_value;
- int expanded;
-
- *p = '\0'; /* Insert null now. */
- expanded = history_expand (linebuffer, &history_value);
- if (expanded)
- {
- /* Print the changes. */
- printf ("%s\n", history_value);
-
- /* If there was an error, call this function again. */
- if (expanded < 0)
- {
- free (history_value);
- return command_line_input (prrompt, repeat);
- }
- if (strlen (history_value) > linelength)
- {
- linelength = strlen (history_value) + 1;
- linebuffer = (char *) xrealloc (linebuffer, linelength);
- }
- strcpy (linebuffer, history_value);
- p = linebuffer + strlen(linebuffer);
- free (history_value);
- }
- }
-
- /* If we just got an empty line, and that is supposed
- to repeat the previous command, return the value in the
- global buffer. */
- if (repeat)
- {
- if (p == linebuffer)
- return line;
- p1 = linebuffer;
- while (*p1 == ' ' || *p1 == '\t')
- p1++;
- if (!*p1)
- return line;
- }
-
- *p = 0;
-
- /* Add line to history if appropriate. */
- if (instream == stdin
- && ISATTY (stdin) && *linebuffer)
- add_history (linebuffer);
-
- /* Note: lines consisting soley of comments are added to the command
- history. This is useful when you type a command, and then
- realize you don't want to execute it quite yet. You can comment
- out the command and then later fetch it from the value history
- and remove the '#'. The kill ring is probably better, but some
- people are in the habit of commenting things out. */
- p1 = linebuffer;
- while ((c = *p1++) != '\0')
- {
- if (c == '"')
- while ((c = *p1++) != '"')
- {
- /* Make sure an escaped '"' doesn't make us think the string
- is ended. */
- if (c == '\\')
- parse_escape (&p1);
- if (c == '\0')
- break;
- }
- else if (c == '\'')
- while ((c = *p1++) != '\'')
- {
- /* Make sure an escaped '\'' doesn't make us think the string
- is ended. */
- if (c == '\\')
- parse_escape (&p1);
- if (c == '\0')
- break;
- }
- else if (c == '#')
- {
- /* Found a comment. */
- p1[-1] = '\0';
- break;
- }
- }
-
- /* Save into global buffer if appropriate. */
- if (repeat)
- {
- if (linelength > linesize)
- {
- line = xrealloc (line, linelength);
- linesize = linelength;
- }
- strcpy (line, linebuffer);
- return line;
- }
-
- return linebuffer;
-}
-
-/* Read lines from the input stream
- and accumulate them in a chain of struct command_line's
- which is then returned. */
-
-struct command_line *
-read_command_lines ()
-{
- struct command_line *first = 0;
- register struct command_line *next, *tail = 0;
- register char *p, *p1;
- struct cleanup *old_chain = 0;
-
- while (1)
- {
- dont_repeat ();
- p = command_line_input (0, instream == stdin);
- if (p == NULL)
- /* Treat end of file like "end". */
- break;
-
- /* Remove leading and trailing blanks. */
- while (*p == ' ' || *p == '\t') p++;
- p1 = p + strlen (p);
- while (p1 != p && (p1[-1] == ' ' || p1[-1] == '\t')) p1--;
-
- /* Is this "end"? */
- if (p1 - p == 3 && !strncmp (p, "end", 3))
- break;
-
- /* No => add this line to the chain of command lines. */
- next = (struct command_line *) xmalloc (sizeof (struct command_line));
- next->line = savestring (p, p1 - p);
- next->next = 0;
- if (tail)
- {
- tail->next = next;
- }
- else
- {
- /* We just read the first line.
- From now on, arrange to throw away the lines we have
- if we quit or get an error while inside this function. */
- first = next;
- old_chain = make_cleanup (free_command_lines, &first);
- }
- tail = next;
- }
-
- dont_repeat ();
-
- /* Now we are about to return the chain to our caller,
- so freeing it becomes his responsibility. */
- if (first)
- discard_cleanups (old_chain);
- return first;
-}
-
-/* Free a chain of struct command_line's. */
-
-void
-free_command_lines (lptr)
- struct command_line **lptr;
-{
- register struct command_line *l = *lptr;
- register struct command_line *next;
-
- while (l)
- {
- next = l->next;
- free (l->line);
- free (l);
- l = next;
- }
-}
-
-/* Add an element to the list of info subcommands. */
-
-void
-add_info (name, fun, doc)
- char *name;
- void (*fun) ();
- char *doc;
-{
- add_cmd (name, no_class, fun, doc, &infolist);
-}
-
-/* Add an alias to the list of info subcommands. */
-
-void
-add_info_alias (name, oldname, abbrev_flag)
- char *name;
- char *oldname;
- int abbrev_flag;
-{
- add_alias_cmd (name, oldname, 0, abbrev_flag, &infolist);
-}
-
-/* The "info" command is defined as a prefix, with allow_unknown = 0.
- Therefore, its own definition is called only for "info" with no args. */
-
-/* ARGSUSED */
-static void
-info_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- printf ("\"info\" must be followed by the name of an info command.\n");
- help_list (infolist, "info ", -1, stdout);
-}
-
-/* The "show" command with no arguments shows all the settings. */
-
-/* ARGSUSED */
-static void
-show_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- cmd_show_list (showlist, from_tty, "");
-}
-
-/* Add an element to the list of commands. */
-
-void
-add_com (name, class, fun, doc)
- char *name;
- enum command_class class;
- void (*fun) ();
- char *doc;
-{
- add_cmd (name, class, fun, doc, &cmdlist);
-}
-
-/* Add an alias or abbreviation command to the list of commands. */
-
-void
-add_com_alias (name, oldname, class, abbrev_flag)
- char *name;
- char *oldname;
- enum command_class class;
- int abbrev_flag;
-{
- add_alias_cmd (name, oldname, class, abbrev_flag, &cmdlist);
-}
-
-void
-error_no_arg (why)
- char *why;
-{
- error ("Argument required (%s).", why);
-}
-
-/* ARGSUSED */
-static void
-help_command (command, from_tty)
- char *command;
- int from_tty; /* Ignored */
-{
- help_cmd (command, stdout);
-}
-
-static void
-validate_comname (comname)
- char *comname;
-{
- register char *p;
-
- if (comname == 0)
- error_no_arg ("name of command to define");
-
- p = comname;
- while (*p)
- {
- if (!(*p >= 'A' && *p <= 'Z')
- && !(*p >= 'a' && *p <= 'z')
- && !(*p >= '0' && *p <= '9')
- && *p != '-')
- error ("Junk in argument list: \"%s\"", p);
- p++;
- }
-}
-
-static void
-define_command (comname, from_tty)
- char *comname;
- int from_tty;
-{
- register struct command_line *cmds;
- register struct cmd_list_element *c, *newc;
- char *tem = comname;
- extern void not_just_help_class_command ();
-
- validate_comname (comname);
-
- /* Look it up, and verify that we got an exact match. */
- c = lookup_cmd (&tem, cmdlist, "", -1, 1);
- if (c && 0 != strcmp (comname, c->name))
- c = 0;
-
- if (c)
- {
- if (c->class == class_user || c->class == class_alias)
- tem = "Redefine command \"%s\"? ";
- else
- tem = "Really redefine built-in command \"%s\"? ";
- if (!query (tem, comname))
- error ("Command \"%s\" not redefined.", comname);
- }
-
- if (from_tty)
- {
- printf ("Type commands for definition of \"%s\".\n\
-End with a line saying just \"end\".\n", comname);
- fflush (stdout);
- }
- comname = savestring (comname, strlen (comname));
-
- cmds = read_command_lines ();
-
- if (c && c->class == class_user)
- free_command_lines (&c->user_commands);
-
- newc = add_cmd (comname, class_user, not_just_help_class_command,
- (c && c->class == class_user)
- ? c->doc : savestring ("User-defined.", 13), &cmdlist);
- newc->user_commands = cmds;
-}
-
-static void
-document_command (comname, from_tty)
- char *comname;
- int from_tty;
-{
- struct command_line *doclines;
- register struct cmd_list_element *c;
- char *tem = comname;
-
- validate_comname (comname);
-
- c = lookup_cmd (&tem, cmdlist, "", 0, 1);
-
- if (c->class != class_user)
- error ("Command \"%s\" is built-in.", comname);
-
- if (from_tty)
- printf ("Type documentation for \"%s\".\n\
-End with a line saying just \"end\".\n", comname);
-
- doclines = read_command_lines ();
-
- if (c->doc) free (c->doc);
-
- {
- register struct command_line *cl1;
- register int len = 0;
-
- for (cl1 = doclines; cl1; cl1 = cl1->next)
- len += strlen (cl1->line) + 1;
-
- c->doc = (char *) xmalloc (len + 1);
- *c->doc = 0;
-
- for (cl1 = doclines; cl1; cl1 = cl1->next)
- {
- strcat (c->doc, cl1->line);
- if (cl1->next)
- strcat (c->doc, "\n");
- }
- }
-
- free_command_lines (&doclines);
-}
-
-static void
-print_gnu_advertisement()
-{
- printf ("\
-GDB is free software and you are welcome to distribute copies of it\n\
- under certain conditions; type \"show copying\" to see the conditions.\n\
-There is absolutely no warranty for GDB; type \"show warranty\" for details.\n\
-");
-}
-
-static void
-print_gdb_version ()
-{
- printf_filtered ("\
-GDB %s, Copyright 1991 Free Software Foundation, Inc.",
- version);
-}
-
-/* ARGSUSED */
-static void
-show_version (args, from_tty)
- char *args;
- int from_tty;
-{
- immediate_quit++;
- print_gnu_advertisement ();
- print_gdb_version ();
- printf_filtered ("\n");
- immediate_quit--;
-}
-
-/* xgdb calls this to reprint the usual GDB prompt. */
-
-void
-print_prompt ()
-{
- printf ("%s", prompt);
- fflush (stdout);
-}
-
-static void
-quit_command (args, from_tty)
- char *args;
- int from_tty;
-{
- if (inferior_pid != 0 && target_has_execution)
- {
- if (query ("The program is running. Quit anyway? "))
- {
- target_kill (args, from_tty);
- }
- else
- error ("Not confirmed.");
- }
- /* Save the history information if it is appropriate to do so. */
- if (write_history_p && history_filename)
- write_history (history_filename);
- exit (0);
-}
-
-int
-input_from_terminal_p ()
-{
- return (instream == stdin) & caution;
-}
-
-/* ARGSUSED */
-static void
-pwd_command (args, from_tty)
- char *args;
- int from_tty;
-{
- if (args) error ("The \"pwd\" command does not take an argument: %s", args);
- getwd (dirbuf);
-
- if (strcmp (dirbuf, current_directory))
- printf ("Working directory %s\n (canonically %s).\n",
- current_directory, dirbuf);
- else
- printf ("Working directory %s.\n", current_directory);
-}
-
-static void
-cd_command (dir, from_tty)
- char *dir;
- int from_tty;
-{
- int len;
- int change;
-
- /* If the new directory is absolute, repeat is a no-op; if relative,
- repeat might be useful but is more likely to be a mistake. */
- dont_repeat ();
-
- if (dir == 0)
- error_no_arg ("new working directory");
-
- dir = tilde_expand (dir);
- make_cleanup (free, dir);
-
- len = strlen (dir);
- dir = savestring (dir, len - (len > 1 && dir[len-1] == '/'));
- if (dir[0] == '/')
- current_directory = dir;
- else
- {
- current_directory = concat (current_directory, "/", dir);
- free (dir);
- }
-
- /* Now simplify any occurrences of `.' and `..' in the pathname. */
-
- change = 1;
- while (change)
- {
- char *p;
- change = 0;
-
- for (p = current_directory; *p;)
- {
- if (!strncmp (p, "/./", 2)
- && (p[2] == 0 || p[2] == '/'))
- strcpy (p, p + 2);
- else if (!strncmp (p, "/..", 3)
- && (p[3] == 0 || p[3] == '/')
- && p != current_directory)
- {
- char *q = p;
- while (q != current_directory && q[-1] != '/') q--;
- if (q != current_directory)
- {
- strcpy (q-1, p+3);
- p = q-1;
- }
- }
- else p++;
- }
- }
-
- if (chdir (dir) < 0)
- perror_with_name (dir);
-
- forget_cached_source_info ();
-
- if (from_tty)
- pwd_command ((char *) 0, 1);
-}
-
-/* ARGSUSED */
-static void
-source_command (args, from_tty)
- char *args;
- int from_tty;
-{
- FILE *stream;
- struct cleanup *cleanups;
- char *file = args;
-
- if (file == 0)
- /* Let source without arguments read .gdbinit. */
- file = gdbinit;
-
- file = tilde_expand (file);
- make_cleanup (free, file);
-
- stream = fopen (file, "r");
- if (stream == 0)
- perror_with_name (file);
-
- cleanups = make_cleanup (fclose, stream);
-
- read_command_file (stream);
-
- do_cleanups (cleanups);
-}
-
-/* ARGSUSED */
-static void
-echo_command (text, from_tty)
- char *text;
- int from_tty;
-{
- char *p = text;
- register int c;
-
- if (text)
- while (c = *p++)
- {
- if (c == '\\')
- {
- /* \ at end of argument is used after spaces
- so they won't be lost. */
- if (*p == 0)
- return;
-
- c = parse_escape (&p);
- if (c >= 0)
- printf_filtered ("%c", c);
- }
- else
- printf_filtered ("%c", c);
- }
-
- /* Force this output to appear now. */
- wrap_here ("");
- fflush (stdout);
-}
-
-/* ARGSUSED */
-static void
-dump_me_command (args, from_tty)
- char *args;
- int from_tty;
-{
- if (query ("Should GDB dump core? "))
- {
- signal (SIGQUIT, SIG_DFL);
- kill (getpid (), SIGQUIT);
- }
-}
-
-/* Functions to manipulate command line editing control variables. */
-
-/* Number of commands to print in each call to show_commands. */
-#define Hist_print 10
-static void
-show_commands (args, from_tty)
- char *args;
- int from_tty;
-{
- /* Index for history commands. Relative to history_base. */
- int offset;
-
- /* Number of the history entry which we are planning to display next.
- Relative to history_base. */
- static int num = 0;
-
- /* The first command in the history which doesn't exist (i.e. one more
- than the number of the last command). Relative to history_base. */
- int hist_len;
-
- struct _hist_entry *history_get();
- extern int history_base;
-
-#if 0
- /* This is all reported by individual "show" commands. */
- printf_filtered ("Interactive command editing is %s.\n",
- command_editing_p ? "on" : "off");
-
- printf_filtered ("History expansion of command input is %s.\n",
- history_expansion_p ? "on" : "off");
- printf_filtered ("Writing of a history record upon exit is %s.\n",
- write_history_p ? "enabled" : "disabled");
- printf_filtered ("The size of the history list (number of stored commands) is %d.\n",
- history_size);
- printf_filtered ("The name of the history record is \"%s\".\n\n",
- history_filename ? history_filename : "");
-#endif /* 0 */
-
- /* Print out some of the commands from the command history. */
- /* First determine the length of the history list. */
- hist_len = history_size;
- for (offset = 0; offset < history_size; offset++)
- {
- if (!history_get (history_base + offset))
- {
- hist_len = offset;
- break;
- }
- }
-
- if (args)
- {
- if (args[0] == '+' && args[1] == '\0')
- /* "info editing +" should print from the stored position. */
- ;
- else
- /* "info editing <exp>" should print around command number <exp>. */
- num = (parse_and_eval_address (args) - history_base) - Hist_print / 2;
- }
- /* "info editing" means print the last Hist_print commands. */
- else
- {
- num = hist_len - Hist_print;
- }
-
- if (num < 0)
- num = 0;
-
- /* If there are at least Hist_print commands, we want to display the last
- Hist_print rather than, say, the last 6. */
- if (hist_len - num < Hist_print)
- {
- num = hist_len - Hist_print;
- if (num < 0)
- num = 0;
- }
-
-#if 0
- /* No need for a header now that "info editing" only prints one thing. */
- if (num == hist_len - Hist_print)
- printf_filtered ("The list of the last %d commands is:\n\n", Hist_print);
- else
- printf_filtered ("Some of the stored commands are:\n\n");
-#endif /* 0 */
-
- for (offset = num; offset < num + Hist_print && offset < hist_len; offset++)
- {
- printf_filtered ("%5d %s\n", history_base + offset,
- (history_get (history_base + offset))->line);
- }
-
- /* The next command we want to display is the next one that we haven't
- displayed yet. */
- num += Hist_print;
-
- /* If the user repeats this command with return, it should do what
- "info editing +" does. This is unnecessary if arg is null,
- because "info editing +" is not useful after "info editing". */
- if (from_tty && args)
- {
- args[0] = '+';
- args[1] = '\0';
- }
-}
-
-/* Called by do_setshow_command. */
-/* ARGSUSED */
-static void
-set_history_size_command (args, from_tty, c)
- char *args;
- int from_tty;
- struct cmd_list_element *c;
-{
- if (history_size == UINT_MAX)
- unstifle_history ();
- else
- stifle_history (history_size);
-}
-
-/* ARGSUSED */
-static void
-set_history (args, from_tty)
- char *args;
- int from_tty;
-{
- printf ("\"set history\" must be followed by the name of a history subcommand.\n");
- help_list (sethistlist, "set history ", -1, stdout);
-}
-
-/* ARGSUSED */
-static void
-show_history (args, from_tty)
- char *args;
- int from_tty;
-{
- cmd_show_list (showhistlist, from_tty, "");
-}
-
-int info_verbose = 0; /* Default verbose msgs off */
-
-/* Called by do_setshow_command. An elaborate joke. */
-/* ARGSUSED */
-static void
-set_verbose (args, from_tty, c)
- char *args;
- int from_tty;
- struct cmd_list_element *c;
-{
- char *cmdname = "verbose";
- struct cmd_list_element *showcmd;
-
- showcmd = lookup_cmd_1 (&cmdname, showlist, NULL, 1);
-
- if (info_verbose)
- {
- c->doc = "Set verbose printing of informational messages.";
- showcmd->doc = "Show verbose printing of informational messages.";
- }
- else
- {
- c->doc = "Set verbosity.";
- showcmd->doc = "Show verbosity.";
- }
-}
-
-static void
-float_handler ()
-{
- /* This message is based on ANSI C, section 4.7. Note that integer
- divide by zero causes this, so "float" is a misnomer. */
- error ("Erroneous arithmetic operation.");
-}
-
-/* Return whether we are running a batch file or from terminal. */
-int
-batch_mode ()
-{
- return !(instream == stdin && ISATTY (stdin));
-}
-
-
-static void
-initialize_cmd_lists ()
-{
- cmdlist = (struct cmd_list_element *) 0;
- infolist = (struct cmd_list_element *) 0;
- enablelist = (struct cmd_list_element *) 0;
- disablelist = (struct cmd_list_element *) 0;
- deletelist = (struct cmd_list_element *) 0;
- enablebreaklist = (struct cmd_list_element *) 0;
- setlist = (struct cmd_list_element *) 0;
- showlist = NULL;
- sethistlist = (struct cmd_list_element *) 0;
- showhistlist = NULL;
- unsethistlist = (struct cmd_list_element *) 0;
-}
-
-/* Init the history buffer. Note that we are called after the init file(s)
- * have been read so that the user can change the history file via his
- * .gdbinit file (for instance). The GDBHISTFILE environment variable
- * overrides all of this.
- */
-
-static void
-initialize_history()
-{
- char *tmpenv;
-
- if (tmpenv = getenv ("HISTSIZE"))
- history_size = atoi (tmpenv);
- else if (!history_size)
- history_size = 256;
-
- stifle_history (history_size);
-
- if (tmpenv = getenv ("GDBHISTFILE"))
- history_filename = savestring (tmpenv, strlen(tmpenv));
- else if (!history_filename) {
- /* We include the current directory so that if the user changes
- directories the file written will be the same as the one
- that was read. */
- history_filename = concat (current_directory, "/.gdb_history", "");
- }
- read_history (history_filename);
-}
-
-static void
-initialize_main ()
-{
- struct cmd_list_element *c;
-
-#ifdef DEFAULT_PROMPT
- prompt = savestring (DEFAULT_PROMPT, strlen(DEFAULT_PROMPT));
-#else
- prompt = savestring ("(gdb) ", 6);
-#endif
-
- /* Set the important stuff up for command editing. */
- command_editing_p = 1;
- history_expansion_p = 0;
- write_history_p = 0;
-
- /* Setup important stuff for command line editing. */
- rl_completion_entry_function = (int (*)()) symbol_completion_function;
- rl_completer_word_break_characters = gdb_completer_word_break_characters;
- rl_readline_name = "gdb";
-
- /* Define the classes of commands.
- They will appear in the help list in the reverse of this order. */
-
- add_cmd ("obscure", class_obscure, NO_FUNCTION, "Obscure features.", &cmdlist);
- add_cmd ("aliases", class_alias, NO_FUNCTION, "Aliases of other commands.", &cmdlist);
- add_cmd ("user-defined", class_user, NO_FUNCTION, "User-defined commands.\n\
-The commands in this class are those defined by the user.\n\
-Use the \"define\" command to define a command.", &cmdlist);
- add_cmd ("support", class_support, NO_FUNCTION, "Support facilities.", &cmdlist);
- add_cmd ("status", class_info, NO_FUNCTION, "Status inquiries.", &cmdlist);
- add_cmd ("files", class_files, NO_FUNCTION, "Specifying and examining files.", &cmdlist);
- add_cmd ("breakpoints", class_breakpoint, NO_FUNCTION, "Making program stop at certain points.", &cmdlist);
- add_cmd ("data", class_vars, NO_FUNCTION, "Examining data.", &cmdlist);
- add_cmd ("stack", class_stack, NO_FUNCTION, "Examining the stack.\n\
-The stack is made up of stack frames. Gdb assigns numbers to stack frames\n\
-counting from zero for the innermost (currently executing) frame.\n\n\
-At any time gdb identifies one frame as the \"selected\" frame.\n\
-Variable lookups are done with respect to the selected frame.\n\
-When the program being debugged stops, gdb selects the innermost frame.\n\
-The commands below can be used to select other frames by number or address.",
- &cmdlist);
- add_cmd ("running", class_run, NO_FUNCTION, "Running the program.", &cmdlist);
-
- add_com ("pwd", class_files, pwd_command,
- "Print working directory. This is used for your program as well.");
- add_com ("cd", class_files, cd_command,
- "Set working directory to DIR for debugger and program being debugged.\n\
-The change does not take effect for the program being debugged\n\
-until the next time it is started.");
-
- add_show_from_set
- (add_set_cmd ("prompt", class_support, var_string, (char *)&prompt,
- "Set gdb's prompt",
- &setlist),
- &showlist);
-
- add_com ("echo", class_support, echo_command,
- "Print a constant string. Give string as argument.\n\
-C escape sequences may be used in the argument.\n\
-No newline is added at the end of the argument;\n\
-use \"\\n\" if you want a newline to be printed.\n\
-Since leading and trailing whitespace are ignored in command arguments,\n\
-if you want to print some you must use \"\\\" before leading whitespace\n\
-to be printed or after trailing whitespace.");
- add_com ("document", class_support, document_command,
- "Document a user-defined command.\n\
-Give command name as argument. Give documentation on following lines.\n\
-End with a line of just \"end\".");
- add_com ("define", class_support, define_command,
- "Define a new command name. Command name is argument.\n\
-Definition appears on following lines, one command per line.\n\
-End with a line of just \"end\".\n\
-Use the \"document\" command to give documentation for the new command.\n\
-Commands defined in this way do not take arguments.");
-
-#ifdef __STDC__
- add_com ("source", class_support, source_command,
- "Read commands from a file named FILE.\n\
-Note that the file \"" GDBINIT_FILENAME "\" is read automatically in this way\n\
-when gdb is started.");
-#else
- /* Punt file name, we can't help it easily. */
- add_com ("source", class_support, source_command,
- "Read commands from a file named FILE.\n\
-Note that the file \".gdbinit\" is read automatically in this way\n\
-when gdb is started.");
-#endif
-
- add_com ("quit", class_support, quit_command, "Exit gdb.");
- add_com ("help", class_support, help_command, "Print list of commands.");
- add_com_alias ("q", "quit", class_support, 1);
- add_com_alias ("h", "help", class_support, 1);
-
-
- c = add_set_cmd ("verbose", class_support, var_boolean, (char *)&info_verbose,
- "Set ",
- &setlist),
- add_show_from_set (c, &showlist);
- c->function = set_verbose;
- set_verbose (NULL, 0, c);
-
- add_com ("dump-me", class_obscure, dump_me_command,
- "Get fatal error; make debugger dump its core.");
-
- add_show_from_set
- (add_set_cmd ("editing", class_support, var_boolean, (char *)&command_editing_p,
- "Set command line editing.\n\
-Use \"on\" to enable to enable the editing, and \"off\" to disable it.\n\
-Without an argument, command line editing is enabled.", &setlist),
- &showlist);
-
- add_prefix_cmd ("history", class_support, set_history,
- "Generic command for setting command history parameters.",
- &sethistlist, "set history ", 0, &setlist);
- add_prefix_cmd ("history", class_support, show_history,
- "Generic command for showing command history parameters.",
- &showhistlist, "show history ", 0, &showlist);
-
- add_show_from_set
- (add_set_cmd ("expansion", no_class, var_boolean, (char *)&history_expansion_p,
- "Set history expansion on command input.\n\
-Without an argument, history expansion is enabled.", &sethistlist),
- &showhistlist);
-
- add_show_from_set
- (add_set_cmd ("save", no_class, var_boolean, (char *)&write_history_p,
- "Set saving of the history record on exit.\n\
-Use \"on\" to enable to enable the saving, and \"off\" to disable it.\n\
-Without an argument, saving is enabled.", &sethistlist),
- &showhistlist);
-
- c = add_set_cmd ("size", no_class, var_uinteger, (char *)&history_size,
- "Set the size of the command history, \n\
-ie. the number of previous commands to keep a record of.", &sethistlist);
- add_show_from_set (c, &showhistlist);
- c->function = set_history_size_command;
-
- add_show_from_set
- (add_set_cmd ("filename", no_class, var_filename, (char *)&history_filename,
- "Set the filename in which to record the command history\n\
- (the list of previous commands of which a record is kept).", &sethistlist),
- &showhistlist);
-
- add_show_from_set
- (add_set_cmd ("confirm", class_support, var_boolean,
- (char *)&caution,
- "Set whether to confirm potentially dangerous operations.",
- &setlist),
- &showlist);
-
- add_prefix_cmd ("info", class_info, info_command,
- "Generic command for printing status.",
- &infolist, "info ", 0, &cmdlist);
- add_com_alias ("i", "info", class_info, 1);
-
- add_prefix_cmd ("show", class_info, show_command,
- "Generic command for showing things set with \"set\".",
- &showlist, "show ", 0, &cmdlist);
- /* Another way to get at the same thing. */
- add_info ("set", show_command, "Show all GDB settings.");
-
- add_cmd ("commands", no_class, show_commands, "Status of command editor.",
- &showlist);
-
- add_cmd ("version", no_class, show_version,
- "Report what version of GDB this is.", &showlist);
-}
diff --git a/gdb/mcheck.c b/gdb/mcheck.c
deleted file mode 100755
index 497bab2..0000000
--- a/gdb/mcheck.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Standard debugging hooks for `malloc'.
- Copyright 1990 Free Software Foundation
- Written May 1989 by Mike Haertel.
-
- The author may be reached (Email) at the address mike@ai.mit.edu,
- or (US mail) as Mike Haertel c/o Free Software Foundation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "ansidecl.h"
-#define size_t unsigned int
-#define ptrdiff_t int
-#define NULL 0
-#define __ONEFILE
-#include "gmalloc.h"
-
-/* Old hook values. */
-static void EXFUN((*old_free_hook), (PTR ptr));
-static PTR EXFUN((*old_malloc_hook), (size_t size));
-static PTR EXFUN((*old_realloc_hook), (PTR ptr, size_t size));
-
-
-/* Function to call when something awful happens. */
-extern void abort();
-static void EXFUN((*abortfunc), (void)) = (void (*)()) abort;
-
-/* Arbitrary magical numbers. */
-#define MAGICWORD 0xfedabeeb
-#define MAGICBYTE ((char) 0xd7)
-
-struct hdr
- {
- size_t size; /* Exact size requested by user. */
- unsigned int magic; /* Magic number to check header integrity. */
- };
-
-static void
-DEFUN(checkhdr, (hdr), CONST struct hdr *hdr)
-{
- if (hdr->magic != MAGICWORD || ((char *) &hdr[1])[hdr->size] != MAGICBYTE)
- (*abortfunc)();
-}
-
-static void
-DEFUN(freehook, (ptr), PTR ptr)
-{
- struct hdr *hdr = ((struct hdr *) ptr) - 1;
- checkhdr(hdr);
- hdr->magic = 0;
- __free_hook = old_free_hook;
- free(hdr);
- __free_hook = freehook;
-}
-
-static PTR
-DEFUN(mallochook, (size), size_t size)
-{
- struct hdr *hdr;
-
- __malloc_hook = old_malloc_hook;
- hdr = (struct hdr *) malloc(sizeof(struct hdr) + size + 1);
- __malloc_hook = mallochook;
- if (hdr == NULL)
- return NULL;
-
- hdr->size = size;
- hdr->magic = MAGICWORD;
- ((char *) &hdr[1])[size] = MAGICBYTE;
- return (PTR) (hdr + 1);
-}
-
-static PTR
-DEFUN(reallochook, (ptr, size), PTR ptr AND size_t size)
-{
- struct hdr *hdr = ((struct hdr *) ptr) - 1;
-
- checkhdr(hdr);
- __free_hook = old_free_hook;
- __malloc_hook = old_malloc_hook;
- __realloc_hook = old_realloc_hook;
- hdr = (struct hdr *) realloc((PTR) hdr, sizeof(struct hdr) + size + 1);
- __free_hook = freehook;
- __malloc_hook = mallochook;
- __realloc_hook = reallochook;
- if (hdr == NULL)
- return NULL;
-
- hdr->size = size;
- ((char *) &hdr[1])[size] = MAGICBYTE;
- return (PTR) (hdr + 1);
-}
-
-void
-DEFUN(mcheck, (func), void EXFUN((*func), (void)))
-{
- static int mcheck_used = 0;
-
- if (func)
- abortfunc = func;
-
- /* These hooks may not be safely inserted if malloc is already in use. */
- if (!__malloc_initialized && !mcheck_used)
- {
- old_free_hook = __free_hook;
- __free_hook = freehook;
- old_malloc_hook = __malloc_hook;
- __malloc_hook = mallochook;
- old_realloc_hook = __realloc_hook;
- __realloc_hook = reallochook;
- mcheck_used = 1;
- }
-}
diff --git a/gdb/mem-break.c b/gdb/mem-break.c
deleted file mode 100644
index eebe7e2..0000000
--- a/gdb/mem-break.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* Simulate breakpoints by patching locations in the target system.
- Copyright (C) 1990 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "param.h"
-
-#ifdef BREAKPOINT
-/* This file is only useful if BREAKPOINT is set. If not, we punt. */
-
-#include <stdio.h>
-#include "breakpoint.h"
-#include "inferior.h"
-#include "target.h"
-
-/* This is the sequence of bytes we insert for a breakpoint. On some
- machines, breakpoints are handled by the target environment and we
- don't have to worry about them here. */
-
-static char break_insn[] = BREAKPOINT;
-
-/* This is only to check that BREAKPOINT fits in BREAKPOINT_MAX bytes. */
-
-static char check_break_insn_size[BREAKPOINT_MAX] = BREAKPOINT;
-
-/* Insert a breakpoint on machines that don't have any better breakpoint
- support. We read the contents of the target location and stash it,
- then overwrite it with a breakpoint instruction. ADDR is the target
- location in the target machine. CONTENTS_CACHE is a pointer to
- memory allocated for saving the target contents. It is guaranteed
- by the caller to be long enough to save sizeof BREAKPOINT bytes.
- FIXME: This size is target_arch dependent and should be available in
- the target_arch transfer vector, if we ever have one... */
-
-int
-memory_insert_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
-{
- int val;
-
- val = target_read_memory (addr, contents_cache, sizeof break_insn);
-
- if (val == 0)
- val = target_write_memory (addr, break_insn, sizeof break_insn);
-
- return val;
-}
-
-
-int
-memory_remove_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
-{
- return target_write_memory (addr, contents_cache, sizeof break_insn);
-}
-
-
-#if 0
-/* This should move back into breakpoint.c, sad to say. Encapsulate
- sizeof (BREAKPOINT) by export it as an int from mem-break.c. */
-
-/* Like target_read_memory() but if breakpoints are inserted, return
- the shadow contents instead of the breakpoints themselves. */
-int
-read_memory_nobpt (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- unsigned len;
-{
- int status;
- struct breakpoint *b;
- ALL_BREAKPOINTS (b)
- {
- if (b->address == NULL || !b->inserted)
- continue;
- else if (b->address + sizeof (break_insn) <= memaddr)
- /* The breakpoint is entirely before the chunk of memory
- we are reading. */
- continue;
- else if (b->address >= memaddr + len)
- /* The breakpoint is entirely after the chunk of memory we
- are reading. */
- continue;
- else
- {
- /* Copy the breakpoint from the shadow contents, and recurse
- for the things before and after. */
-
- /* Addresses and length of the part of the breakpoint that
- we need to copy. */
- CORE_ADDR membpt = b->address;
- unsigned int bptlen = sizeof (break_insn);
- /* Offset within shadow_contents. */
- int bptoffset = 0;
-
- if (membpt < memaddr)
- {
- /* Only copy the second part of the breakpoint. */
- bptlen -= memaddr - membpt;
- bptoffset = memaddr - membpt;
- membpt = memaddr;
- }
-
- if (membpt + bptlen > memaddr + len)
- {
- /* Only copy the first part of the breakpoint. */
- bptlen -= (membpt + bptlen) - (memaddr + len);
- }
-
- bcopy (b->shadow_contents + bptoffset,
- myaddr + membpt - memaddr, bptlen);
-
- if (membpt > memaddr)
- {
- /* Copy the section of memory before the breakpoint. */
- status = read_memory_nobpt (memaddr, myaddr, membpt - memaddr);
- if (status != 0)
- return status;
- }
-
- if (membpt + bptlen < memaddr + len)
- {
- /* Copy the section of memory after the breakpoint. */
- status = read_memory_nobpt
- (membpt + bptlen,
- myaddr + membpt + bptlen - memaddr,
- memaddr + len - (membpt + bptlen));
- if (status != 0)
- return status;
- }
- return 0;
- }
- }
- /* Nothing overlaps. Just call read_memory_noerr. */
- return target_read_memory (memaddr, myaddr, len);
-}
-#endif /* 0 */
-
-#else /* BREAKPOINT */
-
-char nogo[] = "Breakpoints not implemented for this target.";
-
-int
-memory_insert_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
-{
- error (nogo);
- return 0; /* lint */
-}
-
-int
-memory_remove_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
-{
- error (nogo);
- return 0; /* lint */
-}
-
-#endif /* BREAKPOINT */
diff --git a/gdb/minimon.h b/gdb/minimon.h
deleted file mode 100644
index 7084f4f..0000000
--- a/gdb/minimon.h
+++ /dev/null
@@ -1,562 +0,0 @@
-/* Definitions and macros for support of AMD's remote debugger, MiniMON.
- Copyright (C) 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * Some basic types. FIXME, this should be done by declaring bitfield
- * sizes in the structs. We can't portably depend on a "long int" being
- * 32 bits, etc.
- */
-typedef long int INT32; /* 32 bit integer */
-typedef unsigned long int UINT32; /* 32 bit integer (unsigned) */
-typedef unsigned long int ADDR32; /* 32 bit address */
-typedef unsigned long int INST32; /* 32 bit instruction */
-typedef long int BOOLEAN; /* Boolean value (32 bit) */
-typedef unsigned char BYTE; /* byte (8 bit) */
-typedef short int INT16; /* 16 bit integer */
-typedef unsigned short int UINT16; /* 16 bit integer (unsigned) */
-
-/****************************************************************************/
-/************************* Message Information ******************************/
-/****************************************************************************/
-
-/*
- * Error codes
- */
-
-/* General errors */
-#define EMUSAGE 1 /* Bad args / flags */
-#define EMFAIL 2 /* Unrecoverable error */
-#define EMBADADDR 3 /* Illegal address */
-#define EMBADREG 4 /* Illegal register */
-#define EMSYNTAX 5 /* Illegal command syntax */
-#define EMACCESS 6 /* Could not access memory */
-#define EMALLOC 7 /* Could not allocate memory */
-#define EMTARGET 8 /* Unknown target type */
-#define EMHINIT 9 /* Could not initialize host */
-#define EMCOMM 10 /* Could not open communication channel */
-
-/* Message errors */
-#define EMBADMSG 11 /* Unknown message type */
-#define EMMSG2BIG 12 /* Message to large for buffer */
-#define EMNOSEND 13 /* Could not send message */
-#define EMNORECV 14 /* Could not receive message */
-
-#define EMRESET 15 /* Could not RESET target */
-#define EMCONFIG 16 /* Could not get target CONFIG */
-#define EMSTATUS 17 /* Could not get target STATUS */
-#define EMREAD 18 /* Could not READ target memory */
-#define EMWRITE 19 /* Could not WRITE target memory */
-#define EMBKPTSET 20 /* Could not set breakpoint */
-#define EMBKPTRM 21 /* Could not remove breakpoint */
-#define EMBKPTSTAT 22 /* Could not get breakpoint status */
-#define EMBKPTNONE 23 /* All breakpoints in use */
-#define EMBKPTUSED 24 /* Breakpoints already in use */
-#define EMCOPY 25 /* Could not COPY target memory */
-#define EMFILL 26 /* Could not FILL target memory */
-#define EMINIT 27 /* Could not initialize target memory */
-#define EMGO 28 /* Could not start execution */
-#define EMSTEP 29 /* Could not single step */
-#define EMBREAK 30 /* Could not BREAK */
-#define EMHIF 31 /* Could not perform HIF service */
-#define EMCHANNEL0 32 /* Could not read CHANNEL0 */
-#define EMCHANNEL1 33 /* Could not write CHANNEL1 */
-
-/* COFF file loader errors */
-#define EMOPEN 34 /* Could not open COFF file */
-#define EMHDR 35 /* Could not read COFF header */
-#define EMMAGIC 36 /* Bad magic number */
-#define EMAOUT 37 /* Could not read COFF a.out header */
-#define EMSCNHDR 38 /* Could not read COFF section header */
-#define EMSCN 39 /* Could not read COFF section */
-#define EMCLOSE 40 /* Could not close COFF file */
-
-/* Log file errors */
-#define EMLOGOPEN 41 /* Could not open log file */
-#define EMLOGREAD 42 /* Could not read log file */
-#define EMLOGWRITE 43 /* Could not write to log file */
-#define EMLOGCLOSE 44 /* Could not close log file */
-
-/* Command file errors */
-#define EMCMDOPEN 45 /* Could not open command file */
-#define EMCMDREAD 46 /* Could not read command file */
-#define EMCMDWRITE 47 /* Could not write to command file */
-#define EMCMDCLOSE 48 /* Could not close comand file */
-
-#define EMTIMEOUT 49 /* Host timed out waiting for a message */
-#define EMCOMMTYPE 50 /* A '-t' flag must be specified */
-#define EMCOMMERR 51 /* Communication error */
-#define EMBAUD 52 /* Invalid baud rate specified */
-/*
- * Memory Spaces
- */
-#define LOCAL_REG 0 /* Local processor register */
-#define GLOBAL_REG 1 /* Global processor register */
-#define SPECIAL_REG 2 /* Special processor register */
-#define TLB_REG 3 /* Translation Lookaside Buffer */
-#define COPROC_REG 4 /* Coprocessor register */
-#define I_MEM 5 /* Instruction Memory */
-#define D_MEM 6 /* Data Memory */
-#define I_ROM 7 /* Instruction ROM */
-#define D_ROM 8 /* Data ROM */
-#define I_O 9 /* Input/Output */
-#define I_CACHE 10 /* Instruction Cache */
-#define D_CACHE 11 /* Data Cache */
-
-/* To supress warnings for zero length array definitions */
-#define DUMMY 1
-
-/*
-** Host to target definitions
-*/
-
-#define RESET 0
-#define CONFIG_REQ 1
-#define STATUS_REQ 2
-#define READ_REQ 3
-#define WRITE_REQ 4
-#define BKPT_SET 5
-#define BKPT_RM 6
-#define BKPT_STAT 7
-#define COPY 8
-#define FILL 9
-#define INIT 10
-#define GO 11
-#define STEP 12
-#define BREAK 13
-
-#define HIF_CALL_RTN 64
-#define CHANNEL0 65
-#define CHANNEL1_ACK 66
-
-
-/*
-** Target to host definitions
-*/
-
-#define RESET_ACK 32
-#define CONFIG 33
-#define STATUS 34
-#define READ_ACK 35
-#define WRITE_ACK 36
-#define BKPT_SET_ACK 37
-#define BKPT_RM_ACK 38
-#define BKPT_STAT_ACK 39
-#define COPY_ACK 40
-#define FILL_ACK 41
-#define INIT_ACK 42
-#define HALT 43
-
-#define ERROR 63
-
-#define HIF_CALL 96
-#define CHANNEL0_ACK 97
-#define CHANNEL1 98
-
-
-/* A "generic" message */
-struct generic_msg_t {
- INT32 code; /* generic */
- INT32 length;
- BYTE byte[DUMMY];
-};
-
-
-/* A "generic" message (with an INT32 array) */
-struct generic_int32_msg_t {
- INT32 code; /* generic */
- INT32 length;
- INT32 int32[DUMMY];
-};
-
-
-/*
-** Host to target messages
-*/
-
-struct reset_msg_t {
- INT32 code; /* 0 */
- INT32 length;
-};
-
-
-struct config_req_msg_t {
- INT32 code; /* 1 */
- INT32 length;
-};
-
-
-struct status_req_msg_t {
- INT32 code; /* 2 */
- INT32 length;
-};
-
-
-struct read_req_msg_t {
- INT32 code; /* 3 */
- INT32 length;
- INT32 memory_space;
- ADDR32 address;
- INT32 byte_count;
-};
-
-
-struct write_req_msg_t {
- INT32 code; /* 4 */
- INT32 length;
- INT32 memory_space;
- ADDR32 address;
- INT32 byte_count;
- BYTE data[DUMMY];
-};
-
-
-struct write_r_msg_t {
- INT32 code; /* 4 */
- INT32 length;
- INT32 memory_space;
- ADDR32 address;
- INT32 byte_count;
- INT32 data[DUMMY];
-};
-
-
-struct bkpt_set_msg_t {
- INT32 code; /* 5 */
- INT32 length;
- INT32 memory_space;
- ADDR32 bkpt_addr;
- INT32 pass_count;
- INT32 bkpt_type;
-};
-
-
-struct bkpt_rm_msg_t {
- INT32 code; /* 6 */
- INT32 length;
- INT32 memory_space;
- ADDR32 bkpt_addr;
-};
-
-
-struct bkpt_stat_msg_t {
- INT32 code; /* 7 */
- INT32 length;
- INT32 memory_space;
- ADDR32 bkpt_addr;
-};
-
-
-struct copy_msg_t {
- INT32 code; /* 8 */
- INT32 length;
- INT32 source_space;
- ADDR32 source_addr;
- INT32 dest_space;
- ADDR32 dest_addr;
- INT32 byte_count;
-};
-
-
-struct fill_msg_t {
- INT32 code; /* 9 */
- INT32 length;
- INT32 memory_space;
- ADDR32 start_addr;
- INT32 fill_count;
- INT32 byte_count;
- BYTE fill_data[DUMMY];
-};
-
-
-struct init_msg_t {
- INT32 code; /* 10 */
- INT32 length;
- ADDR32 text_start;
- ADDR32 text_end;
- ADDR32 data_start;
- ADDR32 data_end;
- ADDR32 entry_point;
- INT32 mem_stack_size;
- INT32 reg_stack_size;
- ADDR32 arg_start;
- INT32 os_control;
-};
-
-
-struct go_msg_t {
- INT32 code; /* 11 */
- INT32 length;
-};
-
-
-struct step_msg_t {
- INT32 code; /* 12 */
- INT32 length;
- INT32 count;
-};
-
-
-struct break_msg_t {
- INT32 code; /* 13 */
- INT32 length;
-};
-
-
-struct hif_call_rtn_msg_t {
- INT32 code; /* 64 */
- INT32 length;
- INT32 service_number;
- INT32 gr121;
- INT32 gr96;
- INT32 gr97;
-};
-
-
-struct channel0_msg_t {
- INT32 code; /* 65 */
- INT32 length;
- BYTE data;
-};
-
-
-struct channel1_ack_msg_t {
- INT32 code; /* 66 */
- INT32 length;
-};
-
-
-/*
-** Target to host messages
-*/
-
-
-struct reset_ack_msg_t {
- INT32 code; /* 32 */
- INT32 length;
-};
-
-
-struct config_msg_t {
- INT32 code; /* 33 */
- INT32 length;
- INT32 processor_id;
- INT32 version;
- ADDR32 I_mem_start;
- INT32 I_mem_size;
- ADDR32 D_mem_start;
- INT32 D_mem_size;
- ADDR32 ROM_start;
- INT32 ROM_size;
- INT32 max_msg_size;
- INT32 max_bkpts;
- INT32 coprocessor;
- INT32 reserved;
-};
-
-
-struct status_msg_t {
- INT32 code; /* 34 */
- INT32 length;
- INT32 msgs_sent;
- INT32 msgs_received;
- INT32 errors;
- INT32 bkpts_hit;
- INT32 bkpts_free;
- INT32 traps;
- INT32 fills;
- INT32 spills;
- INT32 cycles;
- INT32 reserved;
-};
-
-
-struct read_ack_msg_t {
- INT32 code; /* 35 */
- INT32 length;
- INT32 memory_space;
- ADDR32 address;
- INT32 byte_count;
- BYTE data[DUMMY];
-};
-
-struct read_r_ack_msg_t {
- INT32 code; /* 35 */
- INT32 length;
- INT32 memory_space;
- ADDR32 address;
- INT32 byte_count;
- INT32 data[DUMMY];
-};
-
-
-struct write_ack_msg_t {
- INT32 code; /* 36 */
- INT32 length;
- INT32 memory_space;
- ADDR32 address;
- INT32 byte_count;
-};
-
-
-struct bkpt_set_ack_msg_t {
- INT32 code; /* 37 */
- INT32 length;
- INT32 memory_space;
- ADDR32 address;
- INT32 pass_count;
- INT32 bkpt_type;
-};
-
-
-struct bkpt_rm_ack_msg_t {
- INT32 code; /* 38 */
- INT32 length;
- INT32 memory_space;
- ADDR32 address;
-};
-
-
-struct bkpt_stat_ack_msg_t {
- INT32 code; /* 39 */
- INT32 length;
- INT32 memory_space;
- ADDR32 address;
- INT32 pass_count;
- INT32 bkpt_type;
-};
-
-
-struct copy_ack_msg_t {
- INT32 code; /* 40 */
- INT32 length;
- INT32 source_space;
- ADDR32 source_addr;
- INT32 dest_space;
- ADDR32 dest_addr;
- INT32 byte_count;
-};
-
-
-struct fill_ack_msg_t {
- INT32 code; /* 41 */
- INT32 length;
- INT32 memory_space;
- ADDR32 start_addr;
- INT32 fill_count;
- INT32 byte_count;
-};
-
-
-struct init_ack_msg_t {
- INT32 code; /* 42 */
- INT32 length;
-};
-
-
-struct halt_msg_t {
- INT32 code; /* 43 */
- INT32 length;
- INT32 memory_space;
- ADDR32 pc0;
- ADDR32 pc1;
- INT32 trap_number;
-};
-
-
-struct error_msg_t {
- INT32 code; /* 63 */
- INT32 length;
- INT32 error_code;
- INT32 memory_space;
- ADDR32 address;
-};
-
-
-struct hif_call_msg_t {
- INT32 code; /* 96 */
- INT32 length;
- INT32 service_number;
- INT32 lr2;
- INT32 lr3;
- INT32 lr4;
-};
-
-
-struct channel0_ack_msg_t {
- INT32 code; /* 97 */
- INT32 length;
-};
-
-
-struct channel1_msg_t {
- INT32 code; /* 98 */
- INT32 length;
- BYTE data[DUMMY];
-};
-
-
-
-/*
-** Union all of the message types together
-*/
-
-union msg_t {
- struct generic_msg_t generic_msg;
- struct generic_int32_msg_t generic_int32_msg;
-
- struct reset_msg_t reset_msg;
- struct config_req_msg_t config_req_msg;
- struct status_req_msg_t status_req_msg;
- struct read_req_msg_t read_req_msg;
- struct write_req_msg_t write_req_msg;
- struct write_r_msg_t write_r_msg;
- struct bkpt_set_msg_t bkpt_set_msg;
- struct bkpt_rm_msg_t bkpt_rm_msg;
- struct bkpt_stat_msg_t bkpt_stat_msg;
- struct copy_msg_t copy_msg;
- struct fill_msg_t fill_msg;
- struct init_msg_t init_msg;
- struct go_msg_t go_msg;
- struct step_msg_t step_msg;
- struct break_msg_t break_msg;
-
- struct hif_call_rtn_msg_t hif_call_rtn_msg;
- struct channel0_msg_t channel0_msg;
- struct channel1_ack_msg_t channel1_ack_msg;
-
- struct reset_ack_msg_t reset_ack_msg;
- struct config_msg_t config_msg;
- struct status_msg_t status_msg;
- struct read_ack_msg_t read_ack_msg;
- struct read_r_ack_msg_t read_r_ack_msg;
- struct write_ack_msg_t write_ack_msg;
- struct bkpt_set_ack_msg_t bkpt_set_ack_msg;
- struct bkpt_rm_ack_msg_t bkpt_rm_ack_msg;
- struct bkpt_stat_ack_msg_t bkpt_stat_ack_msg;
- struct copy_ack_msg_t copy_ack_msg;
- struct fill_ack_msg_t fill_ack_msg;
- struct init_ack_msg_t init_ack_msg;
- struct halt_msg_t halt_msg;
-
- struct error_msg_t error_msg;
-
- struct hif_call_msg_t hif_call_msg;
- struct channel0_ack_msg_t channel0_ack_msg;
- struct channel1_msg_t channel1_msg;
-};
diff --git a/gdb/mips-opcode.h b/gdb/mips-opcode.h
deleted file mode 100755
index f75d34e..0000000
--- a/gdb/mips-opcode.h
+++ /dev/null
@@ -1,363 +0,0 @@
-/* Mips opcde list for GDB, the GNU debugger.
- Copyright (C) 1989 Free Software Foundation, Inc.
- Contributed by Nobuyuki Hikichi(hikichi@sra.junet)
- Made to work for little-endian machines, and debugged
- by Per Bothner (bothner@cs.wisc.edu).
- Many fixes contributed by Frank Yellin (fy@lucid.com).
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if BITS_BIG_ENDIAN
-#define BIT_FIELDS_2(a,b) a;b;
-#define BIT_FIELDS_4(a,b,c,d) a;b;c;d;
-#define BIT_FIELDS_6(a,b,c,d,e,f) a;b;c;d;e;f;
-#else
-#define BIT_FIELDS_2(a,b) b;a;
-#define BIT_FIELDS_4(a,b,c,d) d;c;b;a;
-#define BIT_FIELDS_6(a,b,c,d,e,f) f;e;d;c;b;a;
-#endif
-
-struct op_i_fmt
-{
-BIT_FIELDS_4(
- unsigned op : 6,
- unsigned rs : 5,
- unsigned rt : 5,
- unsigned immediate : 16)
-};
-
-struct op_j_fmt
-{
-BIT_FIELDS_2(
- unsigned op : 6,
- unsigned target : 26)
-};
-
-struct op_r_fmt
-{
-BIT_FIELDS_6(
- unsigned op : 6,
- unsigned rs : 5,
- unsigned rt : 5,
- unsigned rd : 5,
- unsigned shamt : 5,
- unsigned funct : 6)
-};
-
-
-struct fop_i_fmt
-{
-BIT_FIELDS_4(
- unsigned op : 6,
- unsigned rs : 5,
- unsigned rt : 5,
- unsigned immediate : 16)
-};
-
-struct op_b_fmt
-{
-BIT_FIELDS_4(
- unsigned op : 6,
- unsigned rs : 5,
- unsigned rt : 5,
- short delta : 16)
-};
-
-struct fop_r_fmt
-{
-BIT_FIELDS_6(
- unsigned op : 6,
- unsigned fmt : 5,
- unsigned ft : 5,
- unsigned fs : 5,
- unsigned fd : 5,
- unsigned funct : 6)
-};
-
-struct mips_opcode
-{
- char *name;
- unsigned long opcode;
- unsigned long match;
- char *args;
- int bdelay; /* Nonzero if delayed branch. */
-};
-
-/* args format;
-
- "s" rs: source register specifier
- "t" rt: target register
- "i" immediate
- "a" target address
- "c" branch condition
- "d" rd: destination register specifier
- "h" shamt: shift amount
- "f" funct: function field
-
- for fpu
- "S" fs source 1 register
- "T" ft source 2 register
- "D" distination register
-*/
-
-#define one(x) (x << 26)
-#define op_func(x, y) ((x << 26) | y)
-#define op_cond(x, y) ((x << 26) | (y << 16))
-#define op_rs_func(x, y, z) ((x << 26) | (y << 21) | z)
-#define op_rs_b11(x, y, z) ((x << 26) | (y << 21) | z)
-#define op_o16(x, y) ((x << 26) | (y << 16))
-#define op_bc(x, y, z) ((x << 26) | (y << 21) | (z << 16))
-
-struct mips_opcode mips_opcodes[] =
-{
-/* These first opcodes are special cases of the ones in the comments */
- {"nop", 0, 0xffffffff, /*li*/ "", 0},
- {"li", op_bc(9,0,0), op_bc(0x3f,31,0), /*addiu*/ "t,j", 0},
- {"b", one(4), 0xffff0000, /*beq*/ "b", 1},
- {"move", op_func(0, 33), op_cond(0x3f,31)|0x7ff,/*addu*/ "d,s", 0},
-
- {"sll", op_func(0, 0), op_func(0x3f, 0x3f), "d,t,h", 0},
- {"srl", op_func(0, 2), op_func(0x3f, 0x3f), "d,t,h", 0},
- {"sra", op_func(0, 3), op_func(0x3f, 0x3f), "d,t,h", 0},
- {"sllv", op_func(0, 4), op_func(0x3f, 0x7ff), "d,t,s", 0},
- {"srlv", op_func(0, 6), op_func(0x3f, 0x7ff), "d,t,s", 0},
- {"srav", op_func(0, 7), op_func(0x3f, 0x7ff), "d,t,s", 0},
- {"jr", op_func(0, 8), op_func(0x3f, 0x1fffff), "s", 1},
- {"jalr", op_func(0, 9), op_func(0x3f, 0x1f07ff), "d,s", 1},
- {"syscall", op_func(0, 12), op_func(0x3f, 0x3f), "", 0},
- {"break", op_func(0, 13), op_func(0x3f, 0x3f), "", 0},
- {"mfhi", op_func(0, 16), op_func(0x3f, 0x03ff07ff), "d", 0},
- {"mthi", op_func(0, 17), op_func(0x3f, 0x1fffff), "s", 0},
- {"mflo", op_func(0, 18), op_func(0x3f, 0x03ff07ff), "d", 0},
- {"mtlo", op_func(0, 19), op_func(0x3f, 0x1fffff), "s", 0},
- {"mult", op_func(0, 24), op_func(0x3f, 0xffff), "s,t", 0},
- {"multu", op_func(0, 25), op_func(0x3f, 0xffff), "s,t", 0},
- {"div", op_func(0, 26), op_func(0x3f, 0xffff), "s,t", 0},
- {"divu", op_func(0, 27), op_func(0x3f, 0xffff), "s,t", 0},
- {"add", op_func(0, 32), op_func(0x3f, 0x7ff), "d,s,t", 0},
- {"addu", op_func(0, 33), op_func(0x3f, 0x7ff), "d,s,t", 0},
- {"sub", op_func(0, 34), op_func(0x3f, 0x7ff), "d,s,t", 0},
- {"subu", op_func(0, 35), op_func(0x3f, 0x7ff), "d,s,t", 0},
- {"and", op_func(0, 36), op_func(0x3f, 0x7ff), "d,s,t", 0},
- {"or", op_func(0, 37), op_func(0x3f, 0x7ff), "d,s,t", 0},
- {"xor", op_func(0, 38), op_func(0x3f, 0x7ff), "d,s,t", 0},
- {"nor", op_func(0, 39), op_func(0x3f, 0x7ff), "d,s,t", 0},
- {"slt", op_func(0, 42), op_func(0x3f, 0x7ff), "d,s,t", 0},
- {"sltu", op_func(0, 43), op_func(0x3f, 0x7ff), "d,s,t", 0},
-
- {"bltz", op_cond (1, 0), op_cond(0x3f, 0x1f), "s,b", 1},
- {"bgez", op_cond (1, 1), op_cond(0x3f, 0x1f), "s,b", 1},
- {"bltzal", op_cond (1, 16),op_cond(0x3f, 0x1f), "s,b", 1},
- {"bgezal", op_cond (1, 17),op_cond(0x3f, 0x1f), "s,b", 1},
-
-
- {"j", one(2), one(0x3f), "a", 1},
- {"jal", one(3), one(0x3f), "a", 1},
- {"beq", one(4), one(0x3f), "s,t,b", 1},
- {"bne", one(5), one(0x3f), "s,t,b", 1},
- {"blez", one(6), one(0x3f) | 0x1f0000, "s,b", 1},
- {"bgtz", one(7), one(0x3f) | 0x1f0000, "s,b", 1},
- {"addi", one(8), one(0x3f), "t,s,j", 0},
- {"addiu", one(9), one(0x3f), "t,s,j", 0},
- {"slti", one(10), one(0x3f), "t,s,j", 0},
- {"sltiu", one(11), one(0x3f), "t,s,j", 0},
- {"andi", one(12), one(0x3f), "t,s,i", 0},
- {"ori", one(13), one(0x3f), "t,s,i", 0},
- {"xori", one(14), one(0x3f), "t,s,i", 0},
- /* rs field is don't care field? */
- {"lui", one(15), one(0x3f), "t,i", 0},
-
-/* co processor 0 instruction */
- {"mfc0", op_rs_b11 (16, 0, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"cfc0", op_rs_b11 (16, 2, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"mtc0", op_rs_b11 (16, 4, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"ctc0", op_rs_b11 (16, 6, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
-
- {"bc0f", op_o16(16, 0x100), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc0f", op_o16(16, 0x180), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc0t", op_o16(16, 0x101), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc0t", op_o16(16, 0x181), op_o16(0x3f, 0x3ff), "b", 1},
-
- {"tlbr", op_rs_func(16, 0x10, 1), ~0, "", 0},
- {"tlbwi", op_rs_func(16, 0x10, 2), ~0, "", 0},
- {"tlbwr", op_rs_func(16, 0x10, 6), ~0, "", 0},
- {"tlbp", op_rs_func(16, 0x10, 8), ~0, "", 0},
- {"rfe", op_rs_func(16, 0x10, 16), ~0, "", 0},
-
- {"mfc1", op_rs_b11 (17, 0, 0), op_rs_b11(0x3f, 0x1f, 0),"t,S", 0},
- {"cfc1", op_rs_b11 (17, 2, 0), op_rs_b11(0x3f, 0x1f, 0),"t,S", 0},
- {"mtc1", op_rs_b11 (17, 4, 0), op_rs_b11(0x3f, 0x1f, 0),"t,S", 0},
- {"ctc1", op_rs_b11 (17, 6, 0), op_rs_b11(0x3f, 0x1f, 0),"t,S", 0},
-
- {"bc1f", op_o16(17, 0x100), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc1f", op_o16(17, 0x180), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc1t", op_o16(17, 0x101), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc1t", op_o16(17, 0x181), op_o16(0x3f, 0x3ff), "b", 1},
-
-/* fpu instruction */
- {"add.s", op_rs_func(17, 0x10, 0),
- op_rs_func(0x3f, 0x1f, 0x3f), "D,S,T", 0},
- {"add.d", op_rs_func(17, 0x11, 0),
- op_rs_func(0x3f, 0x1f, 0x3f), "D,S,T", 0},
- {"sub.s", op_rs_func(17, 0x10, 1),
- op_rs_func(0x3f, 0x1f, 0x3f), "D,S,T", 0},
- {"sub.d", op_rs_func(17, 0x11, 1),
- op_rs_func(0x3f, 0x1f, 0x3f), "D,S,T", 0},
- {"mul.s", op_rs_func(17, 0x10, 2),
- op_rs_func(0x3f, 0x1f, 0x3f), "D,S,T", 0},
- {"mul.d", op_rs_func(17, 0x11, 2),
- op_rs_func(0x3f, 0x1f, 0x3f), "D,S,T", 0},
- {"div.s", op_rs_func(17, 0x10, 3),
- op_rs_func(0x3f, 0x1f, 0x3f), "D,S,T", 0},
- {"div.d", op_rs_func(17, 0x11, 3),
- op_rs_func(0x3f, 0x1f, 0x3f), "D,S,T", 0},
- {"abs.s", op_rs_func(17, 0x10, 5),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"abs.d", op_rs_func(17, 0x11, 5),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"mov.s", op_rs_func(17, 0x10, 6),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"mov.d", op_rs_func(17, 0x11, 6),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"neg.s", op_rs_func(17, 0x10, 7),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"neg.d", op_rs_func(17, 0x11, 7),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"cvt.s.s", op_rs_func(17, 0x10, 32),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"cvt.s.d", op_rs_func(17, 0x11, 32),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"cvt.s.w", op_rs_func(17, 0x14, 32),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"cvt.d.s", op_rs_func(17, 0x10, 33),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"cvt.d.d", op_rs_func(17, 0x11, 33),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"cvt.d.w", op_rs_func(17, 0x14, 33),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"cvt.w.s", op_rs_func(17, 0x10, 36),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"cvt.w.d", op_rs_func(17, 0x11, 36),
- op_rs_func(0x3f, 0x1f, 0x1f003f), "D,S", 0},
- {"c.f.s", op_rs_func(17, 0x10, 48),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.f.d", op_rs_func(17, 0x11, 48),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.un.s", op_rs_func(17, 0x10, 49),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.un.d", op_rs_func(17, 0x11, 49),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.eq.s", op_rs_func(17, 0x10, 50),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.eq.d", op_rs_func(17, 0x11, 50),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ueq.s", op_rs_func(17, 0x10, 51),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ueq.d", op_rs_func(17, 0x11, 51),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.olt.s", op_rs_func(17, 0x10, 52),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.olt.d", op_rs_func(17, 0x11, 52),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ult.s", op_rs_func(17, 0x10, 53),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ult.d", op_rs_func(17, 0x11, 53),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ole.s", op_rs_func(17, 0x10, 54),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ole.d", op_rs_func(17, 0x11, 54),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ule.s", op_rs_func(17, 0x10, 55),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ule.d", op_rs_func(17, 0x11, 55),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.sf.s", op_rs_func(17, 0x10, 56),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.sf.d", op_rs_func(17, 0x11, 56),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ngle.s", op_rs_func(17, 0x10, 57),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ngle.d", op_rs_func(17, 0x11, 57),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.seq.s", op_rs_func(17, 0x10, 58),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.seq.d", op_rs_func(17, 0x11, 58),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ngl.s", op_rs_func(17, 0x10, 59),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ngl.d", op_rs_func(17, 0x11, 59),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.lt.s", op_rs_func(17, 0x10, 60),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.lt.d", op_rs_func(17, 0x11, 60),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.nge.s", op_rs_func(17, 0x10, 61),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.nge.d", op_rs_func(17, 0x11, 61),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.le.s", op_rs_func(17, 0x10, 62),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.le.d", op_rs_func(17, 0x11, 62),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ngt.s", op_rs_func(17, 0x10, 63),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
- {"c.ngt.d", op_rs_func(17, 0x11, 63),
- op_rs_func(0x3f, 0x1f, 0x7ff), "S,T", 0},
-
-/* co processor 2 instruction */
- {"mfc2", op_rs_b11 (18, 0, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"cfc2", op_rs_b11 (18, 2, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"mtc2", op_rs_b11 (18, 4, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"ctc2", op_rs_b11 (18, 6, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"bc2f", op_o16(18, 0x100), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc2f", op_o16(18, 0x180), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc2f", op_o16(18, 0x101), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc2t", op_o16(18, 0x181), op_o16(0x3f, 0x3ff), "b", 1},
-
-/* co processor 3 instruction */
- {"mtc3", op_rs_b11 (19, 0, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"cfc3", op_rs_b11 (19, 2, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"mtc3", op_rs_b11 (19, 4, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"ctc3", op_rs_b11 (19, 6, 0), op_rs_b11(0x3f, 0x1f, 0x1ffff), "t,d", 0},
- {"bc3f", op_o16(19, 0x100), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc3f", op_o16(19, 0x180), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc3t", op_o16(19, 0x101), op_o16(0x3f, 0x3ff), "b", 1},
- {"bc3t", op_o16(19, 0x181), op_o16(0x3f, 0x3ff), "b", 1},
-
- {"lb", one(32), one(0x3f), "t,j(s)", 0},
- {"lh", one(33), one(0x3f), "t,j(s)", 0},
- {"lwl", one(34), one(0x3f), "t,j(s)", 0},
- {"lw", one(35), one(0x3f), "t,j(s)", 0},
- {"lbu", one(36), one(0x3f), "t,j(s)", 0},
- {"lhu", one(37), one(0x3f), "t,j(s)", 0},
- {"lwr", one(38), one(0x3f), "t,j(s)", 0},
- {"sb", one(40), one(0x3f), "t,j(s)", 0},
- {"sh", one(41), one(0x3f), "t,j(s)", 0},
- {"swl", one(42), one(0x3f), "t,j(s)", 0},
- {"swr", one(46), one(0x3f), "t,j(s)", 0},
- {"sw", one(43), one(0x3f), "t,j(s)", 0},
- {"lwc0", one(48), one(0x3f), "t,j(s)", 0},
-/* for fpu */
- {"lwc1", one(49), one(0x3f), "T,j(s)", 0},
- {"lwc2", one(50), one(0x3f), "t,j(s)", 0},
- {"lwc3", one(51), one(0x3f), "t,j(s)", 0},
- {"swc0", one(56), one(0x3f), "t,j(s)", 0},
-/* for fpu */
- {"swc1", one(57), one(0x3f), "T,j(s)", 0},
- {"swc2", one(58), one(0x3f), "t,j(s)", 0},
- {"swc3", one(59), one(0x3f), "t,j(s)", 0},
-};
diff --git a/gdb/mips-pinsn.c b/gdb/mips-pinsn.c
deleted file mode 100644
index 6dc3e55..0000000
--- a/gdb/mips-pinsn.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Print mips instructions for GDB, the GNU debugger.
- Copyright (C) 1989 Free Software Foundation, Inc.
- Contributed by Nobuyuki Hikichi(hikichi@sra.co.jp)
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "mips-opcode.h"
-
-/* Mips instructions are never longer than this many bytes. */
-#define MAXLEN 4
-
-/* Number of elements in the opcode table. */
-#define NOPCODES (sizeof mips_opcodes / sizeof mips_opcodes[0])
-
-#define MKLONG(p) *(unsigned long*)p
-
-extern char *reg_names[];
-
-
-/* subroutine */
-static unsigned char *
-print_insn_arg (d, l, stream, pc)
- char *d;
- register unsigned long int *l;
- FILE *stream;
- CORE_ADDR pc;
-{
- switch (*d)
- {
- case ',':
- case '(':
- case ')':
- fputc (*d, stream);
- break;
-
- case 's':
- fprintf (stream, "$%s", reg_names[((struct op_i_fmt *) l)->rs]);
- break;
-
- case 't':
- fprintf (stream, "$%s", reg_names[((struct op_i_fmt *) l)->rt]);
- break;
-
- case 'i':
- fprintf (stream, "%d", ((struct op_i_fmt *) l)->immediate);
- break;
-
- case 'j': /* same as i, but sign-extended */
- fprintf (stream, "%d", ((struct op_b_fmt *) l)->delta);
- break;
-
- case 'a':
- print_address ((pc & 0xF0000000) | (((struct op_j_fmt *)l)->target << 2),
- stream);
- break;
-
- case 'b':
- print_address ((((struct op_b_fmt *) l)->delta << 2) + pc + 4, stream);
- break;
-
- case 'd':
- fprintf (stream, "$%s", reg_names[((struct op_r_fmt *) l)->rd]);
- break;
-
- case 'h':
- fprintf (stream, "0x%x", ((struct op_r_fmt *) l)->shamt);
- break;
-
- case 'S':
- fprintf (stream, "$f%d", ((struct fop_r_fmt *) l)->fs);
- break;
-
- case 'T':
- fprintf (stream, "$f%d", ((struct fop_r_fmt *) l)->ft);
- break;
-
- case 'D':
- fprintf (stream, "$f%d", ((struct fop_r_fmt *) l)->fd);
- break;
-
- default:
- fprintf (stream, "# internal error, undefined modifier(%c)", *d);
- break;
- }
-}
-
-/* Print the mips instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes, which
- is always 4. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned char buffer[MAXLEN];
- register int i;
- register char *d;
- unsigned long int l;
-
- read_memory (memaddr, buffer, MAXLEN);
-
- for (i = 0; i < NOPCODES; i++)
- {
- register unsigned int opcode = mips_opcodes[i].opcode;
- register unsigned int match = mips_opcodes[i].match;
- if ((*(unsigned int*)buffer & match) == opcode)
- break;
- }
-
- l = MKLONG (buffer);
- /* Handle undefined instructions. */
- if (i == NOPCODES)
- {
- fprintf (stream, "0x%x",l);
- return 4;
- }
-
- fprintf (stream, "%s", mips_opcodes[i].name);
-
- if (!(d = mips_opcodes[i].args))
- return 4;
-
- fputc (' ', stream);
-
- while (*d)
- print_insn_arg (d++, &l, stream, memaddr);
-
- return 4;
-}
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
deleted file mode 100644
index 849758b..0000000
--- a/gdb/mips-tdep.c
+++ /dev/null
@@ -1,692 +0,0 @@
-/* Work with core dump and executable files, for GDB on MIPS.
- This code would be in core.c if it weren't machine-dependent. */
-
-/* Low level interface to ptrace, for GDB when running under Unix.
- Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc.
- Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
- and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* FIXME: Can a MIPS porter/tester determine which of these include
- files we still need? -- gnu@cygnus.com */
-#include <stdio.h>
-#ifdef sgi
-#include <sys/inst.h>
-#else
-#include <mips/inst.h>
-#endif
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "value.h"
-#include "gdbcmd.h"
-#include "language.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-
-#include "gdbcore.h"
-
-#ifndef MIPSMAGIC
-#ifdef MIPSEL
-#define MIPSMAGIC MIPSELMAGIC
-#else
-#define MIPSMAGIC MIPSEBMAGIC
-#endif
-#endif
-
-#define VM_MIN_ADDRESS (unsigned)0x400000
-
-#include <sys/user.h> /* After a.out.h */
-#include <sys/file.h>
-#include <sys/stat.h>
-
-
-#define PROC_LOW_ADDR(proc) ((proc)->adr) /* least address */
-#define PROC_HIGH_ADDR(proc) ((proc)->pad2) /* upper address bound */
-#define PROC_FRAME_OFFSET(proc) ((proc)->framesize)
-#define PROC_FRAME_REG(proc) ((proc)->framereg)
-#define PROC_REG_MASK(proc) ((proc)->regmask)
-#define PROC_FREG_MASK(proc) ((proc)->fregmask)
-#define PROC_REG_OFFSET(proc) ((proc)->regoffset)
-#define PROC_FREG_OFFSET(proc) ((proc)->fregoffset)
-#define PROC_PC_REG(proc) ((proc)->pcreg)
-#define PROC_SYMBOL(proc) (*(struct symbol**)&(proc)->isym)
-#define _PROC_MAGIC_ 0x0F0F0F0F
-#define PROC_DESC_IS_DUMMY(proc) ((proc)->isym == _PROC_MAGIC_)
-#define SET_PROC_DESC_IS_DUMMY(proc) ((proc)->isym = _PROC_MAGIC_)
-
-struct linked_proc_info
-{
- struct mips_extra_func_info info;
- struct linked_proc_info *next;
-} * linked_proc_desc_table = NULL;
-
-
-#define READ_FRAME_REG(fi, regno) read_next_frame_reg((fi)->next, regno)
-
-int
-read_next_frame_reg(fi, regno)
- FRAME fi;
- int regno;
-{
-#define SIGFRAME_BASE sizeof(struct sigcontext)
-#define SIGFRAME_PC_OFF (-SIGFRAME_BASE+ 2*sizeof(int))
-#define SIGFRAME_SP_OFF (-SIGFRAME_BASE+32*sizeof(int))
-#define SIGFRAME_RA_OFF (-SIGFRAME_BASE+34*sizeof(int))
- for (; fi; fi = fi->next)
- if (in_sigtramp(fi->pc, 0)) {
- /* No idea if this code works. --PB. */
- int offset;
- if (regno == PC_REGNUM) offset = SIGFRAME_PC_OFF;
- else if (regno == RA_REGNUM) offset = SIGFRAME_RA_OFF;
- else if (regno == SP_REGNUM) offset = SIGFRAME_SP_OFF;
- else return 0;
- return read_memory_integer(fi->frame + offset, 4);
- }
- else if (regno == SP_REGNUM) return fi->frame;
- else if (fi->saved_regs->regs[regno])
- return read_memory_integer(fi->saved_regs->regs[regno], 4);
- return read_register(regno);
-}
-
-int
-mips_frame_saved_pc(frame)
- FRAME frame;
-{
- mips_extra_func_info_t proc_desc = (mips_extra_func_info_t)frame->proc_desc;
- int pcreg = proc_desc ? PROC_PC_REG(proc_desc) : RA_REGNUM;
- if (proc_desc && PROC_DESC_IS_DUMMY(proc_desc))
- return read_memory_integer(frame->frame - 4, 4);
-#if 0
- /* If in the procedure prologue, RA_REGNUM might not have been saved yet.
- * Assume non-leaf functions start with:
- * addiu $sp,$sp,-frame_size
- * sw $ra,ra_offset($sp)
- * This if the pc is pointing at either of these instructions,
- * then $ra hasn't been trashed.
- * If the pc has advanced beyond these two instructions,
- * then $ra has been saved.
- * critical, and much more complex. Handling $ra is enough to get
- * a stack trace, but some register values with be wrong.
- */
- if (frame->proc_desc && frame->pc < PROC_LOW_ADDR(proc_desc) + 8)
- return read_register(pcreg);
-#endif
- return read_next_frame_reg(frame, pcreg);
-}
-
-static struct mips_extra_func_info temp_proc_desc;
-static struct frame_saved_regs temp_saved_regs;
-
-CORE_ADDR heuristic_proc_start(pc)
- CORE_ADDR pc;
-{
-
- CORE_ADDR start_pc = pc;
- CORE_ADDR fence = start_pc - 10000;
- if (fence < VM_MIN_ADDRESS) fence = VM_MIN_ADDRESS;
- /* search back for previous return */
- for (start_pc -= 4; ; start_pc -= 4)
- if (start_pc < fence) return 0;
- else if (ABOUT_TO_RETURN(start_pc))
- break;
-
- start_pc += 8; /* skip return, and its delay slot */
-#if 0
- /* skip nops (usually 1) 0 - is this */
- while (start_pc < pc && read_memory_integer (start_pc, 4) == 0)
- start_pc += 4;
-#endif
- return start_pc;
-}
-
-mips_extra_func_info_t
-heuristic_proc_desc(start_pc, limit_pc, next_frame)
- CORE_ADDR start_pc, limit_pc;
- FRAME next_frame;
-{
- CORE_ADDR sp = next_frame ? next_frame->frame : read_register (SP_REGNUM);
- CORE_ADDR cur_pc;
- int frame_size;
- int has_frame_reg = 0;
- int reg30; /* Value of $r30. Used by gcc for frame-pointer */
- unsigned long reg_mask = 0;
-
- if (start_pc == 0) return NULL;
- bzero(&temp_proc_desc, sizeof(temp_proc_desc));
- bzero(&temp_saved_regs, sizeof(struct frame_saved_regs));
- if (start_pc + 200 < limit_pc) limit_pc = start_pc + 200;
- restart:
- frame_size = 0;
- for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += 4) {
- unsigned long word;
- int status;
-
- status = read_memory_nobpt (cur_pc, &word, 4);
- if (status) memory_error (status, cur_pc);
- if ((word & 0xFFFF0000) == 0x27bd0000) /* addiu $sp,$sp,-i */
- frame_size += (-word) & 0xFFFF;
- else if ((word & 0xFFFF0000) == 0x23bd0000) /* addu $sp,$sp,-i */
- frame_size += (-word) & 0xFFFF;
- else if ((word & 0xFFE00000) == 0xafa00000) { /* sw reg,offset($sp) */
- int reg = (word & 0x001F0000) >> 16;
- reg_mask |= 1 << reg;
- temp_saved_regs.regs[reg] = sp + (short)word;
- }
- else if ((word & 0xFFFF0000) == 0x27be0000) { /* addiu $30,$sp,size */
- if ((unsigned short)word != frame_size)
- reg30 = sp + (unsigned short)word;
- else if (!has_frame_reg) {
- int alloca_adjust;
- has_frame_reg = 1;
- reg30 = read_next_frame_reg(next_frame, 30);
- alloca_adjust = reg30 - (sp + (unsigned short)word);
- if (alloca_adjust > 0) {
- /* FP > SP + frame_size. This may be because
- /* of an alloca or somethings similar.
- * Fix sp to "pre-alloca" value, and try again.
- */
- sp += alloca_adjust;
- goto restart;
- }
- }
- }
- else if ((word & 0xFFE00000) == 0xafc00000) { /* sw reg,offset($30) */
- int reg = (word & 0x001F0000) >> 16;
- reg_mask |= 1 << reg;
- temp_saved_regs.regs[reg] = reg30 + (short)word;
- }
- }
- if (has_frame_reg) {
- PROC_FRAME_REG(&temp_proc_desc) = 30;
- PROC_FRAME_OFFSET(&temp_proc_desc) = 0;
- }
- else {
- PROC_FRAME_REG(&temp_proc_desc) = SP_REGNUM;
- PROC_FRAME_OFFSET(&temp_proc_desc) = frame_size;
- }
- PROC_REG_MASK(&temp_proc_desc) = reg_mask;
- PROC_PC_REG(&temp_proc_desc) = RA_REGNUM;
- return &temp_proc_desc;
-}
-
-mips_extra_func_info_t
-find_proc_desc(pc, next_frame)
- CORE_ADDR pc;
- FRAME next_frame;
-{
- mips_extra_func_info_t proc_desc;
- extern struct block *block_for_pc();
- struct block *b = block_for_pc(pc);
-
- struct symbol *sym =
- b ? lookup_symbol(".gdbinfo.", b, LABEL_NAMESPACE, 0, NULL) : NULL;
- if (sym != NULL)
- {
- /* IF this is the topmost frame AND
- * (this proc does not have debugging information OR
- * the PC is in the procedure prologue)
- * THEN create a "hueristic" proc_desc (by analyzing
- * the actual code) to replace the "official" proc_desc.
- */
- proc_desc = (struct mips_extra_func_info *)sym->value.value;
- if (next_frame == NULL) {
- struct symtab_and_line val;
- struct symbol *proc_symbol =
- PROC_DESC_IS_DUMMY(proc_desc) ? 0 : PROC_SYMBOL(proc_desc);
- if (proc_symbol) {
- val = find_pc_line (BLOCK_START
- (SYMBOL_BLOCK_VALUE(proc_symbol)),
- 0);
- val.pc = val.end ? val.end : pc;
- }
- if (!proc_symbol || pc < val.pc) {
- mips_extra_func_info_t found_heuristic =
- heuristic_proc_desc(PROC_LOW_ADDR(proc_desc),
- pc, next_frame);
- if (found_heuristic) proc_desc = found_heuristic;
- }
- }
- }
- else
- {
- register struct linked_proc_info *link;
- for (link = linked_proc_desc_table; link; link = link->next)
- if (PROC_LOW_ADDR(&link->info) <= pc
- && PROC_HIGH_ADDR(&link->info) > pc)
- return &link->info;
- proc_desc =
- heuristic_proc_desc(heuristic_proc_start(pc), pc, next_frame);
- }
- return proc_desc;
-}
-
-mips_extra_func_info_t cached_proc_desc;
-
-FRAME_ADDR mips_frame_chain(frame)
- FRAME frame;
-{
- extern CORE_ADDR startup_file_start; /* From blockframe.c */
- mips_extra_func_info_t proc_desc;
- CORE_ADDR saved_pc = FRAME_SAVED_PC(frame);
- if (startup_file_start)
- { /* has at least the __start symbol */
- if (saved_pc == 0 || !outside_startup_file (saved_pc)) return 0;
- }
- else
- { /* This hack depends on the internals of __start. */
- /* We also assume the breakpoints are *not* inserted */
- if (saved_pc == 0
- || read_memory_integer (saved_pc + 8, 4) & 0xFC00003F == 0xD)
- return 0; /* break */
- }
- proc_desc = find_proc_desc(saved_pc, frame);
- if (!proc_desc) return 0;
- cached_proc_desc = proc_desc;
- return read_next_frame_reg(frame, PROC_FRAME_REG(proc_desc))
- + PROC_FRAME_OFFSET(proc_desc);
-}
-
-void
-init_extra_frame_info(fci)
- struct frame_info *fci;
-{
- extern struct obstack frame_cache_obstack;
- /* Use proc_desc calculated in frame_chain */
- mips_extra_func_info_t proc_desc = fci->next ? cached_proc_desc :
- find_proc_desc(fci->pc, fci->next);
- fci->saved_regs = (struct frame_saved_regs*)
- obstack_alloc (&frame_cache_obstack, sizeof(struct frame_saved_regs));
- bzero(fci->saved_regs, sizeof(struct frame_saved_regs));
- fci->proc_desc =
- proc_desc == &temp_proc_desc ? (char*)NULL : (char*)proc_desc;
- if (proc_desc)
- {
- int ireg;
- CORE_ADDR reg_position;
- unsigned long mask;
- /* r0 bit means kernel trap */
- int kernel_trap = PROC_REG_MASK(proc_desc) & 1;
-
- /* Fixup frame-pointer - only needed for top frame */
- /* This may not be quite right, if procedure has a real frame register */
- if (fci->pc == PROC_LOW_ADDR(proc_desc))
- fci->frame = read_register (SP_REGNUM);
- else
- fci->frame = READ_FRAME_REG(fci, PROC_FRAME_REG(proc_desc))
- + PROC_FRAME_OFFSET(proc_desc);
-
- if (proc_desc == &temp_proc_desc)
- *fci->saved_regs = temp_saved_regs;
- else
- {
- /* find which general-purpose registers were saved */
- reg_position = fci->frame + PROC_REG_OFFSET(proc_desc);
- mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK(proc_desc);
- for (ireg= 31; mask; --ireg, mask <<= 1)
- if (mask & 0x80000000)
- {
- fci->saved_regs->regs[ireg] = reg_position;
- reg_position -= 4;
- }
- /* find which floating-point registers were saved */
- reg_position = fci->frame + PROC_FREG_OFFSET(proc_desc);
- /* The freg_offset points to where the first *double* register is saved.
- * So skip to the high-order word. */
- reg_position += 4;
- mask = kernel_trap ? 0xFFFFFFFF : PROC_FREG_MASK(proc_desc);
- for (ireg = 31; mask; --ireg, mask <<= 1)
- if (mask & 0x80000000)
- {
- fci->saved_regs->regs[32+ireg] = reg_position;
- reg_position -= 4;
- }
- }
-
- /* hack: if argument regs are saved, guess these contain args */
- if ((PROC_REG_MASK(proc_desc) & 0xF0) == 0) fci->num_args = -1;
- else if ((PROC_REG_MASK(proc_desc) & 0x80) == 0) fci->num_args = 4;
- else if ((PROC_REG_MASK(proc_desc) & 0x40) == 0) fci->num_args = 3;
- else if ((PROC_REG_MASK(proc_desc) & 0x20) == 0) fci->num_args = 2;
- else if ((PROC_REG_MASK(proc_desc) & 0x10) == 0) fci->num_args = 1;
-
- fci->saved_regs->regs[PC_REGNUM] = fci->saved_regs->regs[RA_REGNUM];
- }
- if (fci->next == 0)
- supply_register(FP_REGNUM, &fci->frame);
-}
-
-
-CORE_ADDR mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
- int nargs;
- value *args;
- CORE_ADDR sp;
- int struct_return;
- CORE_ADDR struct_addr;
-{
- CORE_ADDR buf;
- register i;
- int accumulate_size = struct_return ? 4 : 0;
- struct mips_arg { char *contents; int len; int offset; };
- struct mips_arg *mips_args =
- (struct mips_arg*)alloca(nargs * sizeof(struct mips_arg));
- register struct mips_arg *m_arg;
- for (i = 0, m_arg = mips_args; i < nargs; i++, m_arg++) {
- extern value value_arg_coerce();
- value arg = value_arg_coerce (args[i]);
- m_arg->len = TYPE_LENGTH (VALUE_TYPE (arg));
- /* This entire mips-specific routine is because doubles must be aligned
- * on 8-byte boundaries. It still isn't quite right, because MIPS decided
- * to align 'struct {int a, b}' on 4-byte boundaries (even though this
- * breaks their varargs implementation...). A correct solution
- * requires an simulation of gcc's 'alignof' (and use of 'alignof'
- * in stdarg.h/varargs.h).
- */
- if (m_arg->len > 4) accumulate_size = (accumulate_size + 7) & -8;
- m_arg->offset = accumulate_size;
- accumulate_size = (accumulate_size + m_arg->len + 3) & -4;
- m_arg->contents = VALUE_CONTENTS(arg);
- }
- accumulate_size = (accumulate_size + 7) & (-8);
- if (accumulate_size < 16) accumulate_size = 16;
- sp -= accumulate_size;
- for (i = nargs; m_arg--, --i >= 0; )
- write_memory(sp + m_arg->offset, m_arg->contents, m_arg->len);
- if (struct_return) {
- buf = struct_addr;
- write_memory(sp, &buf, sizeof(CORE_ADDR));
-}
- return sp;
-}
-
-/* MASK(i,j) == (1<<i) + (1<<(i+1)) + ... + (1<<j)). Assume i<=j<31. */
-#define MASK(i,j) ((1 << (j)+1)-1 ^ (1 << (i))-1)
-
-void
-mips_push_dummy_frame()
-{
- int ireg;
- struct linked_proc_info *link = (struct linked_proc_info*)
- xmalloc(sizeof(struct linked_proc_info));
- mips_extra_func_info_t proc_desc = &link->info;
- CORE_ADDR sp = read_register (SP_REGNUM);
- CORE_ADDR save_address;
- REGISTER_TYPE buffer;
- link->next = linked_proc_desc_table;
- linked_proc_desc_table = link;
-#define PUSH_FP_REGNUM 16 /* must be a register preserved across calls */
-#define GEN_REG_SAVE_MASK MASK(1,16)|MASK(24,28)|(1<<31)
-#define GEN_REG_SAVE_COUNT 22
-#define FLOAT_REG_SAVE_MASK MASK(0,19)
-#define FLOAT_REG_SAVE_COUNT 20
-#define SPECIAL_REG_SAVE_COUNT 4
- /*
- * The registers we must save are all those not preserved across
- * procedure calls. Dest_Reg (see tm-mips.h) must also be saved.
- * In addition, we must save the PC, and PUSH_FP_REGNUM.
- * (Ideally, we should also save MDLO/-HI and FP Control/Status reg.)
- *
- * Dummy frame layout:
- * (high memory)
- * Saved PC
- * Saved MMHI, MMLO, FPC_CSR
- * Saved R31
- * Saved R28
- * ...
- * Saved R1
- * Saved D18 (i.e. F19, F18)
- * ...
- * Saved D0 (i.e. F1, F0)
- * CALL_DUMMY (subroutine stub; see m-mips.h)
- * Parameter build area (not yet implemented)
- * (low memory)
- */
- PROC_REG_MASK(proc_desc) = GEN_REG_SAVE_MASK;
- PROC_FREG_MASK(proc_desc) = FLOAT_REG_SAVE_MASK;
- PROC_REG_OFFSET(proc_desc) = /* offset of (Saved R31) from FP */
- -sizeof(long) - 4 * SPECIAL_REG_SAVE_COUNT;
- PROC_FREG_OFFSET(proc_desc) = /* offset of (Saved D18) from FP */
- -sizeof(double) - 4 * (SPECIAL_REG_SAVE_COUNT + GEN_REG_SAVE_COUNT);
- /* save general registers */
- save_address = sp + PROC_REG_OFFSET(proc_desc);
- for (ireg = 32; --ireg >= 0; )
- if (PROC_REG_MASK(proc_desc) & (1 << ireg))
- {
- buffer = read_register (ireg);
- write_memory (save_address, &buffer, sizeof(REGISTER_TYPE));
- save_address -= 4;
- }
- /* save floating-points registers */
- save_address = sp + PROC_FREG_OFFSET(proc_desc);
- for (ireg = 32; --ireg >= 0; )
- if (PROC_FREG_MASK(proc_desc) & (1 << ireg))
- {
- buffer = read_register (ireg);
- write_memory (save_address, &buffer, 4);
- save_address -= 4;
- }
- write_register (PUSH_FP_REGNUM, sp);
- PROC_FRAME_REG(proc_desc) = PUSH_FP_REGNUM;
- PROC_FRAME_OFFSET(proc_desc) = 0;
- buffer = read_register (PC_REGNUM);
- write_memory (sp - 4, &buffer, sizeof(REGISTER_TYPE));
- buffer = read_register (HI_REGNUM);
- write_memory (sp - 8, &buffer, sizeof(REGISTER_TYPE));
- buffer = read_register (LO_REGNUM);
- write_memory (sp - 12, &buffer, sizeof(REGISTER_TYPE));
- buffer = read_register (FCRCS_REGNUM);
- write_memory (sp - 16, &buffer, sizeof(REGISTER_TYPE));
- sp -= 4 * (GEN_REG_SAVE_COUNT+FLOAT_REG_SAVE_COUNT+SPECIAL_REG_SAVE_COUNT);
- write_register (SP_REGNUM, sp);
- PROC_LOW_ADDR(proc_desc) = sp - CALL_DUMMY_SIZE + CALL_DUMMY_START_OFFSET;
- PROC_HIGH_ADDR(proc_desc) = sp;
- SET_PROC_DESC_IS_DUMMY(proc_desc);
- PROC_PC_REG(proc_desc) = RA_REGNUM;
-}
-
-void
-mips_pop_frame()
-{ register int regnum;
- FRAME frame = get_current_frame ();
- CORE_ADDR new_sp = frame->frame;
- mips_extra_func_info_t proc_desc = (mips_extra_func_info_t)frame->proc_desc;
- if (PROC_DESC_IS_DUMMY(proc_desc))
- {
- struct linked_proc_info **ptr = &linked_proc_desc_table;;
- for (; &ptr[0]->info != proc_desc; ptr = &ptr[0]->next )
- if (ptr[0] == NULL) abort();
- *ptr = ptr[0]->next;
- free (ptr[0]);
- write_register (HI_REGNUM, read_memory_integer(new_sp - 8, 4));
- write_register (LO_REGNUM, read_memory_integer(new_sp - 12, 4));
- write_register (FCRCS_REGNUM, read_memory_integer(new_sp - 16, 4));
- }
- write_register (PC_REGNUM, FRAME_SAVED_PC(frame));
- if (frame->proc_desc) {
- for (regnum = 32; --regnum >= 0; )
- if (PROC_REG_MASK(proc_desc) & (1 << regnum))
- write_register (regnum,
- read_memory_integer (frame->saved_regs->regs[regnum], 4));
- for (regnum = 64; --regnum >= 32; )
- if (PROC_FREG_MASK(proc_desc) & (1 << regnum))
- write_register (regnum,
- read_memory_integer (frame->saved_regs->regs[regnum], 4));
- }
- write_register (SP_REGNUM, new_sp);
- flush_cached_frames ();
- set_current_frame (create_new_frame (new_sp, read_pc ()));
-}
-
-static
-mips_print_register(regnum, all)
- int regnum, all;
-{
- unsigned char raw_buffer[8];
- REGISTER_TYPE val;
-
- read_relative_register_raw_bytes (regnum, raw_buffer);
-
- if (!(regnum & 1) && regnum >= FP0_REGNUM && regnum < FP0_REGNUM+32) {
- read_relative_register_raw_bytes (regnum+1, raw_buffer+4);
- printf_filtered ("(d%d: ", regnum&31);
- val_print (builtin_type_double, raw_buffer, 0,
- stdout, 0, 1, 0, Val_pretty_default);
- printf_filtered ("); ", regnum&31);
- }
- fputs_filtered (reg_names[regnum], stdout);
-#ifndef NUMERIC_REG_NAMES
- if (regnum < 32)
- printf_filtered ("(r%d): ", regnum);
- else
-#endif
- printf_filtered (": ");
-
- /* If virtual format is floating, print it that way. */
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT
- && ! INVALID_FLOAT (raw_buffer, REGISTER_VIRTUAL_SIZE(regnum))) {
- val_print (REGISTER_VIRTUAL_TYPE (regnum), raw_buffer, 0,
- stdout, 0, 1, 0, Val_pretty_default);
- }
- /* Else print as integer in hex. */
- else
- {
- long val;
-
- bcopy (raw_buffer, &val, sizeof (long));
- if (val == 0)
- printf_filtered ("0");
- else if (all)
- printf_filtered (local_hex_format(), val);
- else
- printf_filtered ("%s=%d", local_hex_string(val), val);
- }
-}
-
-/* Replacement for generic do_registers_info. */
-mips_do_registers_info (regnum, fpregs)
- int regnum;
- int fpregs;
-{
- if (regnum != -1) {
- mips_print_register (regnum, 0);
- printf_filtered ("\n");
- }
- else {
- for (regnum = 0; regnum < NUM_REGS; ) {
- if ((!fpregs) && regnum >= FP0_REGNUM && regnum <= FCRIR_REGNUM) {
- regnum++;
- continue;
- }
- mips_print_register (regnum, 1);
- regnum++;
- if ((regnum & 3) == 0 || regnum == NUM_REGS)
- printf_filtered (";\n");
- else
- printf_filtered ("; ");
- }
- }
-}
-/* Return number of args passed to a frame. described by FIP.
- Can return -1, meaning no way to tell. */
-
-mips_frame_num_args(fip)
- FRAME fip;
-{
-#if 0
- struct chain_info_t *p;
-
- p = mips_find_cached_frame(FRAME_FP(fip));
- if (p->valid)
- return p->the_info.numargs;
-#endif
- return -1;
-}
-
-
-/* Bad floats: Returns 0 if P points to a valid IEEE floating point number,
- 1 if P points to a denormalized number or a NaN. LEN says whether this is
- a single-precision or double-precision float */
-#define SINGLE_EXP_BITS 8
-#define DOUBLE_EXP_BITS 11
-int
-isa_NAN(p, len)
- int *p, len;
-{
- int exponent;
- if (len == 4)
- {
- exponent = *p;
- exponent = exponent << 1 >> (32 - SINGLE_EXP_BITS - 1);
- return ((exponent == -1) || (! exponent && *p));
- }
- else if (len == 8)
- {
- exponent = *(p+1);
- exponent = exponent << 1 >> (32 - DOUBLE_EXP_BITS - 1);
- return ((exponent == -1) || (! exponent && *p * *(p+1)));
- }
- else return 1;
-}
-
-/* To skip prologues, I use this predicate. Returns either PC
- itself if the code at PC does not look like a function prologue,
- PC+4 if it does (our caller does not need anything more fancy). */
-
-CORE_ADDR mips_skip_prologue(pc)
- CORE_ADDR pc;
-{
- struct symbol *f;
- struct block *b;
- unsigned long inst;
-
- /* For -g modules and most functions anyways the
- first instruction adjusts the stack. */
- inst = read_memory_integer(pc, 4);
- if ((inst & 0xffff0000) == 0x27bd0000)
- return pc + 4;
-
- /* Well, it looks like a frameless. Let's make sure.
- Note that we are not called on the current PC,
- but on the function`s start PC, and I have definitely
- seen optimized code that adjusts the SP quite later */
- b = block_for_pc(pc);
- if (!b) return pc;
-
- f = lookup_symbol(".gdbinfo.", b, LABEL_NAMESPACE, 0, NULL);
- if (!f) return pc;
- /* Ideally, I would like to use the adjusted info
- from mips_frame_info(), but for all practical
- purposes it will not matter (and it would require
- a different definition of SKIP_PROLOGUE())
-
- Actually, it would not hurt to skip the storing
- of arguments on the stack as well. */
- if (((struct mips_extra_func_info *)f->value.value)->framesize)
- return pc + 4;
-
- return pc;
-}
diff --git a/gdb/mips-xdep.c b/gdb/mips-xdep.c
deleted file mode 100644
index a5b0b03..0000000
--- a/gdb/mips-xdep.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/* Low level MIPS interface to ptrace, for GDB when running under Unix.
- Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
- Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
- and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#ifdef sgi
-#include <sys/inst.h>
-#else
-#include <mips/inst.h>
-#endif
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "value.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-/* #include <fcntl.h> Can we live without this? */
-
-#include "gdbcore.h"
-
-#include <sys/user.h> /* After a.out.h */
-#include <sys/file.h>
-#include <sys/stat.h>
-
-/* For now we stub this out; sgi format is super-hairy (and completely
- different in the new release) */
-
-#ifdef sgi
-void
-fetch_core_registers ()
-{
- return;
-}
-
-void
-fetch_inferior_registers ()
-{
- return;
-}
-
-store_inferior_registers (regno)
- int regno;
-{
- return;
-}
-
-
-#else
-
-/* Map gdb internal register number to ptrace address. */
-
-#define REGISTER_PTRACE_ADDR(regno) \
- (regno < 32 ? regno \
- : regno == PC_REGNUM ? 96 \
- : regno == CAUSE_REGNUM ? 97 \
- : regno == HI_REGNUM ? 98 \
- : regno == LO_REGNUM ? 99 \
- : regno == FCRCS_REGNUM ? 100 \
- : regno == FCRIR_REGNUM ? 101 \
- : regno >= FP0_REGNUM ? regno - (FP0_REGNUM-32)\
- : 0)
-
-/* Get all registers from the inferior */
-
-void
-fetch_inferior_registers ()
-{
- register int regno;
- register unsigned int regaddr;
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
-
- registers_fetched ();
-
- for (regno = 1; regno < NUM_REGS; regno++)
- {
- regaddr = REGISTER_PTRACE_ADDR (regno);
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- *(int *) &buf[i] = ptrace (3, inferior_pid, regaddr, 0);
- regaddr += sizeof (int);
- }
- supply_register (regno, buf);
- }
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-void
-store_inferior_registers (regno)
- int regno;
- {
- register unsigned int regaddr;
- char buf[80];
-
- if (regno == 0)
- return;
-
- if (regno > 0)
- {
- regaddr = REGISTER_PTRACE_ADDR (regno);
- errno = 0;
- ptrace (6, inferior_pid, regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- else
- {
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- if (regno == ZERO_REGNUM || regno == PS_REGNUM
- || regno == BADVADDR_REGNUM || regno == CAUSE_REGNUM
- || regno == FCRIR_REGNUM || regno == FP_REGNUM)
- continue;
- regaddr = register_addr (regno, 1);
- errno = 0;
- ptrace (6, inferior_pid, regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing all regs, number %d", regno);
- perror_with_name (buf);
- }
- }
- }
-}
-
-#endif /* sgi */
-
-#if 0
-void
-fetch_core_registers ()
-{
- register int regno;
- int val;
-
- for (regno = 1; regno < NUM_REGS; regno++) {
- char buf[MAX_REGISTER_RAW_SIZE];
-
- val = bfd_seek (core_bfd, register_addr (regno, 0));
- if (val < 0 || (val = bfd_read (core_bfd, buf, sizeof buf)) < 0) {
- char buffer[50];
- strcpy (buffer, "Reading register ");
- strcat (buffer, reg_names[regno]);
-
- perror_with_name (buffer);
- }
- supply_register (regno, buf);
- }
-}
-#endif /* 0 */
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
deleted file mode 100644
index 7d010a4..0000000
--- a/gdb/mipsread.c
+++ /dev/null
@@ -1,2809 +0,0 @@
-/* Read a symbol table in MIPS' format (Third-Eye).
- Copyright (C) 1986, 1987, 1989-1991 Free Software Foundation, Inc.
- Contributed by Alessandro Forin (af@cs.cmu.edu) at CMU
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This module provides three functions: mipscoff_symfile_init,
- which initializes to read a symbol file; mipscoff_new_init, which
- discards existing cached information when all symbols are being
- discarded; and mipscoff_symfile_read, which reads a symbol table
- from a file.
-
- mipscoff_symfile_read only does the minimum work necessary for letting the
- user "name" things symbolically; it does not read the entire symtab.
- Instead, it reads the external and static symbols and puts them in partial
- symbol tables. When more extensive information is requested of a
- file, the corresponding partial symbol table is mutated into a full
- fledged symbol table by going back and reading the symbols
- for real. mipscoff_psymtab_to_symtab() is called indirectly through
- a pointer in the psymtab to do this. */
-
-#include <stdio.h>
-#include "param.h"
-#include "obstack.h"
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include "defs.h"
-#include "symtab.h"
-#include "gdbcore.h"
-#include "symfile.h"
-#ifdef CMUCS
-#include <mips/syms.h>
-#else /* not CMUCS */
-#include <symconst.h>
-#include <sym.h>
-#endif /* not CMUCS */
-
-#include "coff-mips.h"
-
-struct coff_exec {
- struct external_filehdr f;
- struct external_aouthdr a;
-};
-
-/* Each partial symbol table entry contains a pointer to private data for the
- read_symtab() function to use when expanding a partial symbol table entry
- to a full symbol table entry.
-
- For mipsread this structure contains the index of the FDR that this psymtab
- represents and a pointer to the symbol table header HDRR from the symbol
- file that the psymtab was created from. */
-
-#define FDR_IDX(p) (((struct symloc *)((p)->read_symtab_private))->fdr_idx)
-#define CUR_HDR(p) (((struct symloc *)((p)->read_symtab_private))->cur_hdr)
-
-struct symloc {
- int fdr_idx;
- HDRR *cur_hdr;
-};
-
-/* Things we import explicitly from other modules */
-
-extern int info_verbose;
-extern struct block *block_for_pc();
-extern void sort_symtab_syms();
-
-/* Various complaints about symbol reading that don't abort the process */
-
-struct complaint unknown_ext_complaint =
- {"unknown external symbol %s", 0, 0};
-
-struct complaint unknown_sym_complaint =
- {"unknown local symbol %s", 0, 0};
-
-struct complaint unknown_st_complaint =
- {"with type %d", 0, 0};
-
-struct complaint block_overflow_complaint =
- {"block containing %s overfilled", 0, 0};
-
-struct complaint basic_type_complaint =
- {"cannot map MIPS basic type 0x%x", 0, 0};
-
-struct complaint unknown_type_qual_complaint =
- {"unknown type qualifier 0x%x", 0, 0};
-
-struct complaint array_bitsize_complaint =
- {"size of array target type not known, assuming %d bits", 0, 0};
-
-struct complaint array_parse_complaint =
- {"array type with strange relative symbol", 0, 0};
-
-/* Macros and extra defs */
-
-/* Already-parsed symbols are marked specially */
-
-#define stParsed stType
-
-/* Puns: hard to find whether -g was used and how */
-
-#define MIN_GLEVEL GLEVEL_0
-#define compare_glevel(a,b) \
- (((a) == GLEVEL_3) ? ((b) < GLEVEL_3) : \
- ((b) == GLEVEL_3) ? -1 : (int)((b) - (a)))
-
-/* When looking at .o files, avoid tripping over bad addresses */
-
-#define SAFE_TEXT_ADDR 0x400000
-#define SAFE_DATA_ADDR 0x10000000
-
-#define UNSAFE_DATA_ADDR(p) ((unsigned)p < SAFE_DATA_ADDR || (unsigned)p > 2*SAFE_DATA_ADDR)
-
-/* Things that really are local to this module */
-
-/* GDB symtable for the current compilation unit */
-
-static struct symtab *cur_stab;
-
-/* MIPS symtab header for the current file */
-
-static HDRR *cur_hdr;
-
-/* Pointer to current file decriptor record, and its index */
-
-static FDR *cur_fdr;
-static int cur_fd;
-
-/* Index of current symbol */
-
-static int cur_sdx;
-
-/* Note how much "debuggable" this image is. We would like
- to see at least one FDR with full symbols */
-
-static max_gdbinfo;
-static max_glevel;
-
-/* When examining .o files, report on undefined symbols */
-
-static int n_undef_symbols, n_undef_labels, n_undef_vars, n_undef_procs;
-
-/* Extra builtin types */
-
-struct type *builtin_type_complex;
-struct type *builtin_type_double_complex;
-struct type *builtin_type_fixed_dec;
-struct type *builtin_type_float_dec;
-struct type *builtin_type_string;
-
-/* Template types */
-
-static struct type *builtin_type_ptr;
-static struct type *builtin_type_struct;
-static struct type *builtin_type_union;
-static struct type *builtin_type_enum;
-static struct type *builtin_type_range;
-static struct type *builtin_type_set;
-
-/* Forward declarations */
-
-static struct symbol *new_symbol();
-static struct type *new_type();
-static struct field *new_field();
-static struct block *new_block();
-static struct symtab *new_symtab();
-static struct linetable *new_linetable();
-static struct blockvector *new_bvect();
-
-static struct type *parse_type();
-static struct type *make_type();
-static struct symbol *mylookup_symbol();
-static struct block *shrink_block();
-
-static int compare_symtabs();
-static int compare_psymtabs();
-static int compare_blocks();
-
-static struct partial_symtab *new_psymtab();
-static struct partial_symtab *parse_fdr();
-static int compare_psymbols();
-
-static void psymtab_to_symtab_1();
-static void add_block();
-static void add_symbol();
-static int add_line();
-static void reorder_symtabs();
-static void reorder_psymtabs();
-static void shrink_linetable();
-
-/* Things we export to other modules */
-
-/* Address bounds for the signal trampoline in inferior, if any */
-/* FIXME: Nothing really seems to use this. Why is it here? */
-
-CORE_ADDR sigtramp_address, sigtramp_end;
-
-/* The entry point (starting address) of the file, if it is an executable. */
-
-extern CORE_ADDR startup_file_start; /* From blockframe.c */
-extern CORE_ADDR startup_file_end; /* From blockframe.c */
-
-void
-mipscoff_new_init()
-{
- /* If we have a file symbol header lying around, blow it away. */
- if (cur_hdr)
- free ((char *)cur_hdr);
- cur_hdr = 0;
-}
-
-void
-mipscoff_symfile_init (sf)
- struct sym_fns *sf;
-{
- sf->sym_private = NULL;
-}
-
-void
-mipscoff_symfile_read(sf, addr, mainline)
- struct sym_fns *sf;
- CORE_ADDR addr;
- int mainline;
-{
- struct coff_symfile_info *info = (struct coff_symfile_info *)sf->sym_private;
- bfd *abfd = sf->objfile->obfd;
- char *name = bfd_get_filename (abfd);
- int desc;
- register int val;
- int symtab_offset;
- int stringtab_offset;
-
- /* Initialize a variable that we couldn't do at _initialize_ time. */
- builtin_type_ptr = lookup_pointer_type (builtin_type_void);
-
-/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */
- desc = fileno ((FILE *)(abfd->iostream)); /* Raw file descriptor */
-/* End of warning */
-
- /* Position to read the symbol table. */
- val = lseek (desc, (long)symtab_offset, 0);
- if (val < 0)
- perror_with_name (name);
-
- init_misc_bunches ();
- make_cleanup (discard_misc_bunches, 0);
-
- /* Now that the executable file is positioned at symbol table,
- process it and define symbols accordingly. */
-
- read_mips_symtab(sf->objfile, desc);
-
- /* Go over the misc symbol bunches and install them in vector. */
-
- condense_misc_bunches (!mainline);
-}
-
-/* Exported procedure: Allocate zeroed memory */
-
-char *
-xzalloc(size)
-{
- char *p = xmalloc(size);
-
- bzero(p, size);
- return p;
-}
-
-/* Exported procedure: Builds a symtab from the PST partial one.
- Restores the environment in effect when PST was created, delegates
- most of the work to an ancillary procedure, and sorts
- and reorders the symtab list at the end */
-
-static void
-mipscoff_psymtab_to_symtab(pst)
- struct partial_symtab *pst;
-{
- struct symtab *ret;
- int i;
-
- if (!pst)
- return;
-
- if (info_verbose) {
- printf_filtered("Reading in symbols for %s...", pst->filename);
- fflush(stdout);
- }
- /* Restore the header and list of pending typedefs */
- cur_hdr = CUR_HDR(pst);
-
- psymtab_to_symtab_1(pst, pst->filename);
-
- reorder_symtabs();
-
- if (info_verbose)
- printf_filtered("done.\n");
-}
-
-/* Exported procedure: Is PC in the signal trampoline code */
-
-int
-in_sigtramp(pc, name)
- CORE_ADDR pc;
- char *name;
-{
- if (sigtramp_address == 0)
- fixup_sigtramp();
- return (pc >= sigtramp_address && pc < sigtramp_end);
-}
-
-/* File-level interface functions */
-
-/* Read the symtab information from file FSYM into memory. Also,
- return address just past end of our text segment in *END_OF_TEXT_SEGP. */
-
-static
-read_the_mips_symtab(abfd, fsym, end_of_text_segp)
- bfd *abfd;
- int fsym;
- CORE_ADDR *end_of_text_segp;
-{
- int stsize, st_hdrsize;
- unsigned st_filptr;
- HDRR st_hdr;
- /* Header for executable/object file we read symbols from */
- struct coff_exec filhdr;
-
- /* We get here with DESC pointing to the symtab header. But we need
- * other info from the initial headers */
- lseek(fsym, 0L, 0);
- myread(fsym, &filhdr, sizeof filhdr);
-
- if (end_of_text_segp)
- *end_of_text_segp =
- bfd_h_get_32 (abfd, filhdr.a.text_start) +
- bfd_h_get_32 (abfd, filhdr.a.tsize);
-
- /* Find and read the symbol table header */
- st_hdrsize = bfd_h_get_32 (abfd, filhdr.f.f_nsyms);
- st_filptr = bfd_h_get_32 (abfd, filhdr.f.f_symptr);
- if (st_filptr == 0)
- return 0;
-
- lseek(fsym, st_filptr, L_SET);
- if (st_hdrsize > sizeof (st_hdr)) /* Profanity check */
- abort();
- if (read(fsym, &st_hdr, st_hdrsize) != st_hdrsize)
- goto readerr;
-
- /* Find out how large the symbol table is */
- stsize = (st_hdr.cbExtOffset - (st_filptr + st_hdrsize))
- + st_hdr.iextMax * cbEXTR;
-
- /* Allocate space for the symbol table. Read it in. */
- cur_hdr = (HDRR *) xmalloc(stsize + st_hdrsize);
-
- bcopy(&st_hdr, cur_hdr, st_hdrsize);
- if (read(fsym, (char *) cur_hdr + st_hdrsize, stsize) != stsize)
- goto readerr;
-
- /* Fixup file_pointers in it */
- fixup_symtab(cur_hdr, (char *) cur_hdr + st_hdrsize,
- st_filptr + st_hdrsize);
-
- return;
-readerr:
- error("Short read on %s", bfd_get_filename (abfd));
-}
-
-
-/* Turn all file-relative pointers in the symtab described by HDR
- into memory pointers, given that the symtab itself is located
- at DATA in memory and F_PTR in the file. */
-
-static
-fixup_symtab( hdr, data, f_ptr)
- HDRR *hdr;
- char *data;
-{
- int f_idx, s_idx;
- FDR *fh;
- SYMR *sh;
- OPTR *op;
- PDR *pr;
- EXTR *esh;
-
- /*
- * These fields are useless (and empty) by now:
- * hdr->cbDnOffset, hdr->cbOptOffset
- * We use them for other internal purposes.
- */
- hdr->cbDnOffset = 0;
- hdr->cbOptOffset = 0;
-
-#define FIX(off) \
- if (hdr->off) hdr->off = (unsigned int)data + (hdr->off - f_ptr);
-
- FIX(cbLineOffset);
- FIX(cbPdOffset);
- FIX(cbSymOffset);
- FIX(cbOptOffset);
- FIX(cbAuxOffset);
- FIX(cbSsOffset);
- FIX(cbSsExtOffset);
- FIX(cbFdOffset);
- FIX(cbRfdOffset);
- FIX(cbExtOffset);
-#undef FIX
-
-
- /*
- * Fix all string pointers inside the symtab, and
- * the FDR records. Also fix other miscellany.
- */
- for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++) {
- register unsigned code_offset;
-
- /* Header itself, and strings */
- fh = (FDR *) (hdr->cbFdOffset) + f_idx;
- fh->issBase += hdr->cbSsOffset;
- if (fh->rss != -1)
- fh->rss = (long)fh->rss + fh->issBase;
- for (s_idx = 0; s_idx < fh->csym; s_idx++) {
- sh = (SYMR*)(hdr->cbSymOffset) + fh->isymBase + s_idx;
- sh->iss = (long) sh->iss + fh->issBase;
- sh->reserved = 0;
- }
-
- cur_fd = f_idx;
-
- /* Local symbols */
- fh->isymBase = (int)((SYMR*)(hdr->cbSymOffset)+fh->isymBase);
-
- /* cannot fix fh->ipdFirst because it is a short */
-#define IPDFIRST(h,fh) \
- ((long)h->cbPdOffset + fh->ipdFirst * sizeof(PDR))
-
- /* Optional symbols (actually used for partial_symtabs) */
- fh->ioptBase = 0;
- fh->copt = 0;
-
- /* Aux symbols */
- if (fh->caux)
- fh->iauxBase = hdr->cbAuxOffset + fh->iauxBase * sizeof(AUXU);
- /* Relative file descriptor table */
- fh->rfdBase = hdr->cbRfdOffset + fh->rfdBase * sizeof(RFDT);
-
- /* Line numbers */
- if (fh->cbLine)
- fh->cbLineOffset += hdr->cbLineOffset;
-
- /* Procedure symbols. (XXX This should be done later) */
- code_offset = fh->adr;
- for (s_idx = 0; s_idx < fh->cpd; s_idx++) {
- unsigned name, only_ext;
-
- pr = (PDR*)(IPDFIRST(hdr,fh)) + s_idx;
-
- /* Simple rule to find files linked "-x" */
- only_ext = fh->rss == -1;
- if (only_ext) {
- if (pr->isym == -1) {
- /* static function */
- sh = (SYMR*)-1;
- } else {
- /* external */
- name = hdr->cbExtOffset + pr->isym * sizeof(EXTR);
- sh = &((EXTR*)name)->asym;
- }
- } else {
- /* Full symbols */
- sh = (SYMR*)fh->isymBase + pr->isym;
- /* Included code ? */
- if (s_idx == 0 && pr->adr != 0)
- code_offset -= pr->adr;
- }
-
- /* Turn index into a pointer */
- pr->isym = (long)sh;
-
- /* Fix line numbers */
- pr->cbLineOffset += fh->cbLineOffset;
-
- /* Relocate address */
- if (!only_ext)
- pr->adr += code_offset;
- }
- }
-
- /* External symbols: fix string */
- for (s_idx = 0; s_idx < hdr->iextMax; s_idx++) {
- esh = (EXTR*)(hdr->cbExtOffset) + s_idx;
- esh->asym.iss = esh->asym.iss + hdr->cbSsExtOffset;
- }
-}
-
-
-/* Find a file descriptor given its index RF relative to a file CF */
-
-static FDR *
-get_rfd (cf, rf)
- int cf, rf;
-{
- register FDR *f;
-
- f = (FDR *) (cur_hdr->cbFdOffset) + cf;
- /* Object files do not have the RFD table, all refs are absolute */
- if (f->rfdBase == 0)
- return (FDR *) (cur_hdr->cbFdOffset) + rf;
- cf = *((pRFDT) f->rfdBase + rf);
- return (FDR *) (cur_hdr->cbFdOffset) + cf;
-}
-
-/* Return a safer print NAME for a file descriptor */
-
-static char *
-fdr_name(name)
- char *name;
-{
- if (name == (char *) -1)
- return "<stripped file>";
- if (UNSAFE_DATA_ADDR(name))
- return "<NFY>";
- return name;
-}
-
-
-/* Read in and parse the symtab of the file DESC. INCREMENTAL says
- whether we are adding to the general symtab or not.
- FIXME: INCREMENTAL is currently always zero, though it should not be. */
-
-static
-read_mips_symtab (objfile, desc)
- struct objfile *objfile;
- int desc;
-{
- CORE_ADDR end_of_text_seg;
-
- read_the_mips_symtab(objfile->obfd, desc, &end_of_text_seg);
-
- parse_partial_symbols(end_of_text_seg, objfile);
-
- /*
- * Check to make sure file was compiled with -g.
- * If not, warn the user of this limitation.
- */
- if (compare_glevel(max_glevel, GLEVEL_2) < 0) {
- if (max_gdbinfo == 0)
- printf (
-"\n%s not compiled with -g, debugging support is limited.\n",
- objfile->name);
- printf(
-"You should compile with -g2 or -g3 for best debugging support.\n");
- fflush(stdout);
- }
-}
-
-/* Local utilities */
-
-/* Map of FDR indexes to partial symtabs */
-
-static struct pst_map {
- struct partial_symtab *pst; /* the psymtab proper */
- int n_globals; /* globals it exports */
- int n_statics; /* statics (locals) it contains */
-} * fdr_to_pst;
-
-
-/* Utility stack, used to nest procedures and blocks properly.
- It is a doubly linked list, to avoid too many alloc/free.
- Since we might need it quite a few times it is NOT deallocated
- after use. */
-
-static struct parse_stack {
- struct parse_stack *next, *prev;
- struct symtab *cur_st; /* Current symtab */
- struct block *cur_block; /* Block in it */
- int blocktype; /* What are we parsing */
- int maxsyms; /* Max symbols in this block */
- struct type *cur_type; /* Type we parse fields for */
- int procadr; /* Start addres of this procedure */
- int numargs; /* Its argument count */
-} *top_stack; /* Top stack ptr */
-
-
-/* Enter a new lexical context */
-
-static push_parse_stack()
-{
- struct parse_stack *new;
-
- /* Reuse frames if possible */
- if (top_stack && top_stack->prev)
- new = top_stack->prev;
- else
- new = (struct parse_stack *) xzalloc(sizeof(struct parse_stack));
- /* Initialize new frame with previous content */
- if (top_stack) {
- register struct parse_stack *prev = new->prev;
-
- *new = *top_stack;
- top_stack->prev = new;
- new->prev = prev;
- new->next = top_stack;
- }
- top_stack = new;
-}
-
-/* Exit a lexical context */
-
-static pop_parse_stack()
-{
- if (!top_stack)
- return;
- if (top_stack->next)
- top_stack = top_stack->next;
-}
-
-
-/* Cross-references might be to things we haven't looked at
- yet, e.g. type references. To avoid too many type
- duplications we keep a quick fixup table, an array
- of lists of references indexed by file descriptor */
-
-static struct pending {
- struct pending *next; /* link */
- SYMR *s; /* the symbol */
- struct type *t; /* its partial type descriptor */
-} **pending_list;
-
-
-/* Check whether we already saw symbol SH in file FH as undefined */
-
-static
-struct pending *is_pending_symbol(fh, sh)
- FDR *fh;
- SYMR *sh;
-{
- int f_idx = fh - (FDR *) cur_hdr->cbFdOffset;
- register struct pending *p;
-
- /* Linear search is ok, list is typically no more than 10 deep */
- for (p = pending_list[f_idx]; p; p = p->next)
- if (p->s == sh)
- break;
- return p;
-}
-
-/* Check whether we already saw type T in file FH as undefined */
-
-static
-struct pending *is_pending_type(fh, t)
- FDR *fh;
- struct type *t;
-{
- int f_idx = fh - (FDR *) cur_hdr->cbFdOffset;
- register struct pending *p;
-
- for (p = pending_list[f_idx]; p; p = p->next)
- if (p->t == t)
- break;
- return p;
-}
-
-/* Add a new undef symbol SH of type T */
-
-static
-add_pending(fh, sh, t)
- FDR *fh;
- SYMR *sh;
- struct type *t;
-{
- int f_idx = fh - (FDR *) cur_hdr->cbFdOffset;
- struct pending *p = is_pending_symbol(fh, sh);
-
- /* Make sure we do not make duplicates */
- if (!p) {
- p = (struct pending *) xmalloc(sizeof(*p));
- p->s = sh;
- p->t = t;
- p->next = pending_list[f_idx];
- pending_list[f_idx] = p;
- }
- sh->reserved = 1; /* for quick check */
-}
-
-/* Throw away undef entries when done with file index F_IDX */
-
-static
-free_pending(f_idx)
-{
- register struct pending *p, *q;
-
- for (p = pending_list[f_idx]; p; p = q) {
- q = p->next;
- free(p);
- }
- pending_list[f_idx] = 0;
-}
-
-/* The number of args to a procedure is not explicit in the symtab,
- this is the list of all those we know of.
- This makes parsing more reasonable and avoids extra passes */
-
-static struct numarg {
- struct numarg *next; /* link */
- unsigned adr; /* procedure's start address */
- unsigned num; /* arg count */
-} *numargs_list;
-
-/* Record that the procedure at ADR takes NUM arguments. */
-
-static
-got_numargs(adr,num)
-{
- struct numarg *n = (struct numarg *) xmalloc(sizeof(struct numarg));
-
- n->adr = adr;
- n->num = num;
- n->next = numargs_list;
- numargs_list = n;
-}
-
-/* See if we know how many arguments the procedure at ADR takes */
-
-static
-lookup_numargs(adr)
-{
- struct numarg *n = numargs_list;
-
- while (n && n->adr != adr)
- n = n->next;
- return (n) ? n->num : -1;
-}
-
-/* Release storage when done with this file */
-
-static void
-free_numargs()
-{
- struct numarg *n = numargs_list, *m;
-
- while (n) {
- m = n->next;
- free(n);
- n = m;
- }
- numargs_list = 0;
-}
-
-
-/* Parsing Routines proper. */
-
-/* Parse a single symbol. Mostly just make up a GDB symbol for it.
- For blocks, procedures and types we open a new lexical context.
- This is basically just a big switch on the symbol's type */
-
-static void
-parse_symbol(sh, ax)
- SYMR *sh;
- AUXU *ax;
-{
- struct symbol *s;
- struct block *b;
- struct type *t;
- struct field *f;
- /* When a symbol is cross-referenced from other files/symbols
- we mark it explicitly */
- int pend = (sh->reserved == 1);
- enum address_class class;
-
- switch (sh->st) {
-
- case stNil:
- break;
-
- case stGlobal: /* external symbol, goes into global block */
- class = LOC_STATIC;
- b = BLOCKVECTOR_BLOCK(BLOCKVECTOR(top_stack->cur_st),
- GLOBAL_BLOCK);
- s = new_symbol(sh->iss);
- SYMBOL_VALUE_ADDRESS(s) = (CORE_ADDR)sh->value;
- goto data;
-
- case stStatic: /* static data, goes into current block. */
- class = LOC_STATIC;
- b = top_stack->cur_block;
- s = new_symbol(sh->iss);
- SYMBOL_VALUE_ADDRESS(s) = (CORE_ADDR)sh->value;
- goto data;
-
- case stLocal: /* local variable, goes into current block */
- if (sh->sc == scRegister) {
- class = LOC_REGISTER;
- if (sh->value > 31)
- sh->value += 6;
- } else
- class = LOC_LOCAL;
- b = top_stack->cur_block;
- s = new_symbol(sh->iss);
- SYMBOL_VALUE(s) = sh->value;
-
-data: /* Common code for symbols describing data */
- SYMBOL_NAMESPACE(s) = VAR_NAMESPACE;
- SYMBOL_CLASS(s) = class;
- add_symbol(s, b);
-
- /* Type could be missing in a number of cases */
- if (sh->sc == scUndefined || sh->sc == scNil ||
- sh->index == 0xfffff)
- SYMBOL_TYPE(s) = builtin_type_int; /* undefined? */
- else
- SYMBOL_TYPE(s) = parse_type(ax + sh->index, sh, 0);
- /* Value of a data symbol is its memory address */
- break;
-
- case stParam: /* arg to procedure, goes into current block */
- max_gdbinfo++;
- top_stack->numargs++;
- s = new_symbol(sh->iss);
- SYMBOL_NAMESPACE(s) = VAR_NAMESPACE;
- if (sh->sc == scRegister) {
- SYMBOL_CLASS(s) = LOC_REGPARM;
- if (sh->value > 31)
- sh->value += 6;
- } else
- SYMBOL_CLASS(s) = LOC_ARG;
- SYMBOL_VALUE(s) = sh->value;
- SYMBOL_TYPE(s) = parse_type(ax + sh->index, sh, 0);
- add_symbol(s, top_stack->cur_block);
-#if 0
- /* FIXME: This has not been tested. See dbxread.c */
- /* Add the type of this parameter to the function/procedure
- type of this block. */
- add_param_to_type(&top_stack->cur_block->function->type,s);
-#endif
- break;
-
- case stLabel: /* label, goes into current block */
- s = new_symbol(sh->iss);
- SYMBOL_NAMESPACE(s) = VAR_NAMESPACE; /* so that it can be used */
- SYMBOL_CLASS(s) = LOC_LABEL; /* but not misused */
- SYMBOL_VALUE_ADDRESS(s) = (CORE_ADDR)sh->value;
- SYMBOL_TYPE(s) = builtin_type_int;
- add_symbol(s, top_stack->cur_block);
- break;
-
- case stProc: /* Procedure, usually goes into global block */
- case stStaticProc: /* Static procedure, goes into current block */
- s = new_symbol(sh->iss);
- SYMBOL_NAMESPACE(s) = VAR_NAMESPACE;
- SYMBOL_CLASS(s) = LOC_BLOCK;
- /* Type of the return value */
- if (sh->sc == scUndefined || sh->sc == scNil)
- t = builtin_type_int;
- else
- t = parse_type(ax + sh->index, sh, 0);
- b = top_stack->cur_block;
- if (sh->st == stProc) {
- struct blockvector *bv = BLOCKVECTOR(top_stack->cur_st);
- /* The next test should normally be true,
- but provides a hook for nested functions
- (which we don't want to make global). */
- if (b == BLOCKVECTOR_BLOCK(bv, STATIC_BLOCK))
- b = BLOCKVECTOR_BLOCK(bv, GLOBAL_BLOCK);
- }
- add_symbol(s, b);
-
- /* Make a type for the procedure itself */
-#if 0
- /* FIXME: This has not been tested yet! See dbxread.c */
- /* Generate a template for the type of this function. The
- types of the arguments will be added as we read the symbol
- table. */
- bcopy(SYMBOL_TYPE(s),lookup_function_type(t),sizeof(struct type));
-#else
- SYMBOL_TYPE(s) = lookup_function_type (t);
-#endif
-
- /* Create and enter a new lexical context */
- b = new_block(top_stack->maxsyms);
- SYMBOL_BLOCK_VALUE(s) = b;
- BLOCK_FUNCTION(b) = s;
- BLOCK_START(b) = BLOCK_END(b) = sh->value;
- BLOCK_SUPERBLOCK(b) = top_stack->cur_block;
- add_block(b, top_stack->cur_st);
-
- /* Not if we only have partial info */
- if (sh->sc == scUndefined || sh->sc == scNil)
- break;
-
- push_parse_stack();
- top_stack->cur_block = b;
- top_stack->blocktype = sh->st;
- top_stack->cur_type = SYMBOL_TYPE(s);
- top_stack->procadr = sh->value;
- top_stack->numargs = 0;
-
- sh->value = (long) SYMBOL_TYPE(s);
- break;
-
- case stBlock: /* Either a lexical block, or some type */
- push_parse_stack();
- top_stack->blocktype = stBlock;
- if (sh->sc == scInfo) { /* structure/union/enum def */
- s = new_symbol(sh->iss);
- SYMBOL_NAMESPACE(s) = STRUCT_NAMESPACE;
- SYMBOL_CLASS(s) = LOC_TYPEDEF;
- SYMBOL_VALUE(s) = 0;
- add_symbol(s, top_stack->cur_block);
- /* If this type was expected, use its partial definition */
- if (pend) {
- t = is_pending_symbol(cur_fdr, sh)->t;
- } else {
- /* Uhmm, can`t decide yet. Smash later */
- t = new_type(sh->iss);
- TYPE_CODE(t) = TYPE_CODE_UNDEF;
- add_pending(cur_fdr, sh, t);
- }
- SYMBOL_TYPE(s) = t;
- /* make this the current type */
- top_stack->cur_type = t;
- TYPE_LENGTH(t) = sh->value;
- /* Mark that symbol has a type, and say which one */
- sh->value = (long) t;
- } else {
- /* beginnning of (code) block. Value of symbol
- is the displacement from procedure start */
- b = new_block(top_stack->maxsyms);
- BLOCK_START(b) = sh->value + top_stack->procadr;
- BLOCK_SUPERBLOCK(b) = top_stack->cur_block;
- top_stack->cur_block = b;
- add_block(b, top_stack->cur_st);
- }
- break;
-
- case stEnd: /* end (of anything) */
- if (sh->sc == scInfo) {
- /* Finished with type */
- top_stack->cur_type = 0;
- } else if (sh->sc == scText &&
- (top_stack->blocktype == stProc ||
- top_stack->blocktype == stStaticProc)) {
- /* Finished with procedure */
- struct blockvector *bv = BLOCKVECTOR(top_stack->cur_st);
- struct block *b;
- int i;
-
- BLOCK_END(top_stack->cur_block) += sh->value; /* size */
- got_numargs(top_stack->procadr, top_stack->numargs);
- /* Reallocate symbols, saving memory */
- b = shrink_block(top_stack->cur_block, top_stack->cur_st);
-
- /* f77 emits proc-level with address bounds==[0,0],
- So look for such child blocks, and patch them. */
- for (i = 0; i < BLOCKVECTOR_NBLOCKS(bv); i++) {
- struct block *b_bad = BLOCKVECTOR_BLOCK(bv,i);
- if (BLOCK_SUPERBLOCK(b_bad) == b
- && BLOCK_START(b_bad) == top_stack->procadr
- && BLOCK_END(b_bad) == top_stack->procadr) {
- BLOCK_START(b_bad) = BLOCK_START(b);
- BLOCK_END(b_bad) = BLOCK_END(b);
- }
- }
- if (entry_point < BLOCK_END(b)
- && entry_point >= BLOCK_START(b)) {
- startup_file_start = BLOCK_START(b);
- startup_file_end = BLOCK_END(b);
- }
- } else if (sh->sc == scText && top_stack->blocktype == stBlock) {
- /* End of (code) block. The value of the symbol
- is the displacement from the procedure`s start
- address of the end of this block. */
- BLOCK_END(top_stack->cur_block) = sh->value + top_stack->procadr;
- (void) shrink_block(top_stack->cur_block, top_stack->cur_st);
- }
- pop_parse_stack(); /* restore previous lexical context */
- break;
-
- case stMember: /* member of struct/union/enum.. */
- f = new_field(top_stack->cur_type, sh->iss);
- f->bitpos = sh->value;
- f->type = parse_type(ax + sh->index, sh, &f->bitsize);
- break;
-
- case stTypedef: /* type definition */
- s = new_symbol(sh->iss);
- SYMBOL_NAMESPACE(s) = VAR_NAMESPACE;
- SYMBOL_CLASS(s) = LOC_TYPEDEF;
- SYMBOL_BLOCK_VALUE(s) = top_stack->cur_block;
- add_symbol(s, top_stack->cur_block);
- SYMBOL_TYPE(s) = parse_type(ax + sh->index, sh, 0);
- sh->value = (long) SYMBOL_TYPE(s);
- break;
-
- case stFile: /* file name */
- push_parse_stack();
- top_stack->blocktype = sh->st;
- break;
-
- /* I`ve never seen these for C */
- case stRegReloc:
- break; /* register relocation */
- case stForward:
- break; /* forwarding address */
- case stConstant:
- break; /* constant */
- default:
- error("Unknown symbol type %x.", sh->st);
- }
- sh->st = stParsed;
-}
-
-/* Parse the type information provided in the AX entries for
- the symbol SH. Return the bitfield size in BS, in case. */
-
-static struct type *parse_type(ax, sh, bs)
- AUXU *ax;
- SYMR *sh;
- int *bs;
-{
- /* Null entries in this map are treated specially */
- static struct type **map_bt[] =
- {
- &builtin_type_void, /* btNil */
- 0, /* btAdr */
- &builtin_type_char, /* btChar */
- &builtin_type_unsigned_char, /* btUChar */
- &builtin_type_short, /* btShort */
- &builtin_type_unsigned_short, /* btUShort */
- &builtin_type_int, /* btInt */
- &builtin_type_unsigned_int, /* btUInt */
- &builtin_type_long, /* btLong */
- &builtin_type_unsigned_long, /* btULong */
- &builtin_type_float, /* btFloat */
- &builtin_type_double, /* btDouble */
- 0, /* btStruct */
- 0, /* btUnion */
- 0, /* btEnum */
- 0, /* btTypedef */
- 0, /* btRange */
- 0, /* btSet */
- &builtin_type_complex, /* btComplex */
- &builtin_type_double_complex, /* btDComplex */
- 0, /* btIndirect */
- &builtin_type_fixed_dec, /* btFixedDec */
- &builtin_type_float_dec, /* btFloatDec */
- &builtin_type_string, /* btString */
- 0, /* btBit */
- 0, /* btPicture */
- &builtin_type_void, /* btVoid */
- };
-
- TIR *t;
- struct type *tp = 0, *tp1;
- char *fmt = "%s";
-
- /* Procedures start off by one */
- if (sh->st == stProc || sh->st == stStaticProc)
- ax++;
-
- /* Undefined ? Should not happen */
- if (ax->rndx.rfd == 0xfff) {
- return builtin_type_void;
- }
-
- /* Use aux as a type information record, map its basic type */
- t = &ax->ti;
- if (t->bt > 26 || t->bt == btPicture) {
- complain (&basic_type_complaint, t->bt);
- return builtin_type_int;
- }
- if (map_bt[t->bt])
- tp = *map_bt[t->bt];
- else {
- /* Cannot use builtin types, use templates */
- tp = make_type(TYPE_CODE_VOID, 0, 0, 0);
- switch (t->bt) {
- case btAdr:
- *tp = *builtin_type_ptr;
- break;
- case btStruct:
- *tp = *builtin_type_struct;
- fmt = "struct %s";
- break;
- case btUnion:
- *tp = *builtin_type_union;
- fmt = "union %s";
- break;
- case btEnum:
- *tp = *builtin_type_enum;
- fmt = "enum %s";
- break;
- case btRange:
- *tp = *builtin_type_range;
- break;
- case btSet:
- *tp = *builtin_type_set;
- fmt = "set %s";
- break;
- }
- }
-
- /* Move on to next aux */
- ax++;
- if (t->continued) {
- /* This is the way it would work if the compiler worked */
- register TIR *t1 = t;
- while (t1->continued)
- ax++;
- }
-
- /* For bitfields all we need is the width */
- if (t->fBitfield) {
- *bs = ax->width;
- return tp;
- }
-
- /* All these types really point to some (common) MIPS type
- definition, and only the type-qualifiers fully identify
- them. We`ll make the same effort at sharing */
- if (t->bt == btIndirect ||
- t->bt == btStruct ||
- t->bt == btUnion ||
- t->bt == btEnum ||
- t->bt == btTypedef ||
- t->bt == btRange ||
- t->bt == btSet) {
- char name[256], *pn;
-
- /* Try to cross reference this type */
- tp1 = tp;
- ax += cross_ref(ax, &tp1, &pn);
- /* SOMEONE OUGHT TO FIX DBXREAD TO DROP "STRUCT" */
- sprintf(name, fmt, pn);
-
- /* reading .o file ? */
- if (UNSAFE_DATA_ADDR(tp1))
- tp1 = tp;
- if (TYPE_CODE(tp1) == TYPE_CODE_UNDEF) {
- /*
- * Type was incompletely defined, now we know.
- */
- TYPE_CODE(tp1) = TYPE_CODE(tp);
- TYPE_NAME(tp1) = obsavestring(name, strlen(name));
- if (TYPE_CODE(tp1) == TYPE_CODE_ENUM) {
- int i;
-
- for (i = 0; i < TYPE_NFIELDS(tp1); i++)
- make_enum_constant(&TYPE_FIELD(tp1,i), tp1);
- }
- }
- if (tp1 != tp) {
- /* found as cross ref, rid of our template */
- if ((TYPE_FLAGS(tp) & TYPE_FLAG_PERM) == 0)
- free(tp);
- tp = tp1;
- /* stupid idea of prepending "struct" to type names */
- if (t->bt == btStruct && !index(TYPE_NAME(tp), ' ')) {
- sprintf(name, fmt, TYPE_NAME(tp));
- TYPE_NAME(tp) = obsavestring(name, strlen(name));
- }
- } else
- TYPE_NAME(tp) = savestring(name, strlen(name));
- }
-
- /* Deal with range types */
- if (t->bt == btRange) {
- struct field *f;
-
- f = new_field(tp, "Low");
- f->bitpos = ax->dnLow;
- ax++;
- f = new_field(tp, "High");
- f->bitpos = ax->dnHigh;
- ax++;
- }
-
- /* Parse all the type qualifiers now. If there are more
- than 6 the game will continue in the next aux */
-
-#define PARSE_TQ(tq) \
- if (t->tq != tqNil) ax += upgrade_type(&tp, t->tq, ax, sh);
-
-again: PARSE_TQ(tq0);
- PARSE_TQ(tq1);
- PARSE_TQ(tq2);
- PARSE_TQ(tq3);
- PARSE_TQ(tq4);
- PARSE_TQ(tq5);
-#undef PARSE_TQ
-
- if (t->continued) {
- t++;
- goto again;
- }
- return tp;
-}
-
-/* Make up a complex type from a basic one. Type is passed by
- reference in TPP and side-effected as necessary. The type
- qualifier TQ says how to handle the aux symbols at AX for
- the symbol SX we are currently analyzing.
- Returns the number of aux symbols we parsed. */
-
-static int
-upgrade_type(tpp, tq, ax, sh)
- struct type **tpp;
- AUXU *ax;
- SYMR *sh;
-{
- int off;
- struct type *t;
-
- /* Used in array processing */
- int rf, id;
- FDR *fh;
- struct field *f;
- SYMR ss;
- int lower, upper;
-
- switch (tq) {
- case tqPtr:
- t = lookup_pointer_type (*tpp);
- *tpp = t;
- return 0;
-
- case tqProc:
- t = lookup_function_type (*tpp);
- *tpp = t;
- return 0;
-
- case tqArray:
- off = 0;
- t = make_type(TYPE_CODE_ARRAY, 0, 0, 0);
- TYPE_TARGET_TYPE(t) = *tpp;
-
- /* Determine and record the domain type (type of index) */
- id = ax->rndx.index;
- rf = ax->rndx.rfd;
- if (rf == 0xfff) {
- rf = (++ax)->isym;
- off++;
- }
- fh = get_rfd(cur_fd, rf);
- f = new_field(t, (char *)0);
- bzero(&ss, sizeof ss);
-/* XXX */ f->type = parse_type(fh->iauxBase + id * sizeof(AUXU),
- &ss, &f->bitsize);
-
- if (off == 0) {
- /*
- * This seems to be a pointer to the end of the Block defining
- * the type. Why it is here is magic for me, and I have no
- * good use for it anyways.
- */
- /* This used to occur because cross_ref returned
- the wrong result (ax pointed wrong). FIXME,
- delete this code in a while. -- gnu@cygnus jul91 */
- complain (&array_parse_complaint, 0);
- off++;
- id = (++ax)->rndx.index;
- if ((rf = ax->rndx.rfd) == 0xfff)
- rf = (++ax)->isym, off++;
- }
- lower = (++ax)->dnLow;
- upper = (++ax)->dnHigh;
- rf = (++ax)->width; /* bit size of array element */
-
- /* Check whether supplied array element bit size matches
- the known size of the element type. If this complaint
- ends up not happening, we can remove this code. It's
- here because we aren't sure we understand this *&%&$
- symbol format. */
- id = TYPE_LENGTH(TYPE_TARGET_TYPE(t)) << 3; /* bitsize */
- if (id == 0) {
- /* Most likely an undefined type */
- id = rf;
- TYPE_LENGTH(TYPE_TARGET_TYPE(t)) = id >> 3;
- }
- if (id != rf)
- complain (&array_bitsize_complaint, rf);
-
- TYPE_LENGTH(t) = (upper < 0) ? 0 :
- (upper - lower + 1) * (rf >> 3);
- *tpp = t;
- return 4 + off;
-
- case tqVol:
- /* Volatile -- currently ignored */
- return 0;
-
- default:
- complain (&unknown_type_qual_complaint, tq);
- return 0;
- }
-}
-
-
-/* Parse a procedure descriptor record PR. Note that the procedure
- is parsed _after_ the local symbols, now we just make up the
- extra information we need into a special symbol that we insert
- in the procedure's main block. Note also that images that
- have been partially stripped (ld -x) have been deprived
- of local symbols, and we have to cope with them here.
- The procedure's code ends at BOUND */
-
-static
-parse_procedure(pr, bound)
- PDR *pr;
-{
- struct symbol *s, *i;
- SYMR *sh = (SYMR*)pr->isym;
- struct block *b;
- struct mips_extra_func_info *e;
- char name[100];
- char *sh_name;
-
- /* Reuse the MIPS record */
- e = (struct mips_extra_func_info *) pr;
- e->numargs = lookup_numargs(pr->adr);
-
- /* Make up our special symbol */
- i = new_symbol(".gdbinfo.");
- SYMBOL_VALUE(i) = (int)e;
- SYMBOL_NAMESPACE(i) = LABEL_NAMESPACE;
- SYMBOL_CLASS(i) = LOC_CONST;
- SYMBOL_TYPE(i) = builtin_type_void;
-
- /* Make up a name for static procedures. Sigh. */
- if (sh == (SYMR*)-1) {
- sprintf(name,".static_procedure@%x",pr->adr);
- sh_name = savestring(name, strlen(name));
- s = NULL;
- }
- else {
- sh_name = (char*)sh->iss;
- s = mylookup_symbol(sh_name, top_stack->cur_block,
- VAR_NAMESPACE, LOC_BLOCK);
- }
- if (s != 0) {
- b = SYMBOL_BLOCK_VALUE(s);
- } else {
- s = new_symbol(sh_name);
- SYMBOL_NAMESPACE(s) = VAR_NAMESPACE;
- SYMBOL_CLASS(s) = LOC_BLOCK;
- /* Donno its type, hope int is ok */
- SYMBOL_TYPE(s) = lookup_function_type (builtin_type_int);
- add_symbol(s, top_stack->cur_block);
- /* Wont have symbols for this one */
- b = new_block(2);
- SYMBOL_BLOCK_VALUE(s) = b;
- BLOCK_FUNCTION(b) = s;
- BLOCK_START(b) = pr->adr;
- BLOCK_END(b) = bound;
- BLOCK_SUPERBLOCK(b) = top_stack->cur_block;
- add_block(b, top_stack->cur_st);
- }
- e->isym = (long)s;
- add_symbol(i,b);
-}
-
-/* Parse the external symbol ES. Just call parse_symbol() after
- making sure we know where the aux are for it. For procedures,
- parsing of the PDRs has already provided all the needed
- information, we only parse them if SKIP_PROCEDURES is false,
- and only if this causes no symbol duplication.
-
- This routine clobbers top_stack->cur_block and ->cur_st. */
-
-static
-parse_external(es, skip_procedures)
- EXTR *es;
-{
- AUXU *ax;
-
- if (es->ifd != ifdNil) {
- cur_fd = es->ifd;
- cur_fdr = (FDR*)(cur_hdr->cbFdOffset) + cur_fd;
- ax = (AUXU*)cur_fdr->iauxBase;
- } else {
- cur_fdr = (FDR*)(cur_hdr->cbFdOffset);
- ax = 0;
- }
- top_stack->cur_st = cur_stab;
- top_stack->cur_block = BLOCKVECTOR_BLOCK(BLOCKVECTOR(top_stack->cur_st),
- GLOBAL_BLOCK);
-
- /* Reading .o files */
- if (es->asym.sc == scUndefined || es->asym.sc == scNil) {
- char *what;
- switch (es->asym.st) {
- case stStaticProc:
- case stProc: what = "procedure"; n_undef_procs++; break;
- case stGlobal: what = "variable"; n_undef_vars++; break;
- case stLabel: what = "label"; n_undef_labels++; break;
- default : what = "symbol"; break;
- }
- n_undef_symbols++;
- if (info_verbose)
- printf_filtered("Warning: %s `%s' is undefined (in %s)\n", what,
- es->asym.iss, fdr_name(cur_fdr->rss));
- return;
- }
-
- switch (es->asym.st) {
- case stProc:
- /* If we have full symbols we do not need more */
- if (skip_procedures)
- return;
- if (mylookup_symbol (es->asym.iss, top_stack->cur_block,
- VAR_NAMESPACE, LOC_BLOCK))
- break;
- /* fall through */
- case stGlobal:
- case stLabel:
- /*
- * Note that the case of a symbol with indexNil
- * must be handled anyways by parse_symbol().
- */
- parse_symbol(&es->asym, ax);
- break;
- default:
- break;
- }
-}
-
-/* Parse the line number info for file descriptor FH into
- GDB's linetable LT. MIPS' encoding requires a little bit
- of magic to get things out. Note also that MIPS' line
- numbers can go back and forth, apparently we can live
- with that and do not need to reorder our linetables */
-
-static
-parse_lines(fh, lt)
- FDR *fh;
- struct linetable *lt;
-{
- unsigned char *base = (unsigned char*)fh->cbLineOffset;
- int i, j, k;
- int delta, count, lineno = 0;
- PDR *pr;
-
- if (base == 0)
- return;
-
- /* Scan by procedure descriptors */
- i = 0; j = 0, k = 0;
- for (pr = (PDR*)IPDFIRST(cur_hdr,fh); j < fh->cpd; j++, pr++) {
- int l, halt;
-
- /* No code for this one */
- if (pr->iline == ilineNil ||
- pr->lnLow == -1 || pr->lnHigh == -1)
- continue;
- /*
- * Aurgh! To know where to stop expanding we
- * must look-ahead.
- */
- for (l = 1; l < (fh->cpd - j); l++)
- if (pr[l].iline != -1)
- break;
- if (l == (fh->cpd - j))
- halt = fh->cline;
- else
- halt = pr[l].iline;
- /*
- * When procedures are moved around the linenumbers
- * are attributed to the next procedure up
- */
- if (pr->iline >= halt) continue;
-
- base = (unsigned char*)pr->cbLineOffset;
- l = pr->adr >> 2; /* in words */
- halt += (pr->adr >> 2) - pr->iline;
- for (lineno = pr->lnLow; l < halt;) {
- count = *base & 0x0f;
- delta = *base++ >> 4;
- if (delta >= 8)
- delta -= 16;
- if (delta == -8) {
- delta = (base[0] << 8) | base[1];
- if (delta >= 0x8000)
- delta -= 0x10000;
- base += 2;
- }
- lineno += delta;/* first delta is 0 */
- k = add_line(lt, lineno, l, k);
- l += count + 1;
- }
- }
-}
-
-
-/* Parse the symbols of the file described by FH, whose index is F_IDX.
- BOUND is the highest core address of this file's procedures */
-
-static
-parse_one_file(fh, f_idx, bound)
- FDR *fh;
-{
- register int s_idx;
- SYMR *sh;
- PDR *pr;
-
- /* Parse local symbols first */
-
- for (s_idx = 0; s_idx < fh->csym; s_idx++) {
- sh = (SYMR *) (fh->isymBase) + s_idx;
- cur_sdx = s_idx;
- parse_symbol(sh, fh->iauxBase);
- }
-
- /* Procedures next, note we need to look-ahead to
- find out where the procedure's code ends */
-
- for (s_idx = 0; s_idx < fh->cpd-1; s_idx++) {
- pr = (PDR *) (IPDFIRST(cur_hdr, fh)) + s_idx;
- parse_procedure(pr, pr[1].adr); /* next proc up */
- }
- if (fh->cpd) {
- pr = (PDR *) (IPDFIRST(cur_hdr, fh)) + s_idx;
- parse_procedure(pr, bound); /* next file up */
- }
-
- /* Linenumbers. At the end, check if we can save memory */
- parse_lines(fh, LINETABLE(cur_stab));
- if (LINETABLE(cur_stab)->nitems < fh->cline)
- shrink_linetable(cur_stab);
-}
-
-/* Master parsing procedure for first-pass reading of file symbols
- into a partial_symtab.
-
- Parses the symtab described by the global symbolic header CUR_HDR.
- END_OF_TEXT_SEG gives the address just after the text segment for
- the symtab we are reading. */
-
-static
-parse_partial_symbols(end_of_text_seg, objfile)
- int end_of_text_seg;
- struct objfile *objfile;
-{
- int f_idx, s_idx, h_max, stat_idx;
- HDRR *hdr;
- /* Running pointers */
- FDR *fh;
- RFDT *rh;
- register EXTR *esh;
- register SYMR *sh;
- struct partial_symtab *pst;
-
- /*
- * Big plan:
- *
- * Only parse the Local and External symbols, and the Relative FDR.
- * Fixup enough of the loader symtab to be able to use it.
- * Allocate space only for the file's portions we need to
- * look at. (XXX)
- */
-
- hdr = cur_hdr;
- max_gdbinfo = 0;
- max_glevel = MIN_GLEVEL;
-
- /* Allocate the map FDR -> PST.
- Minor hack: -O3 images might claim some global data belongs
- to FDR -1. We`ll go along with that */
- fdr_to_pst = (struct pst_map *)xzalloc((hdr->ifdMax+1) * sizeof *fdr_to_pst);
- fdr_to_pst++;
- {
- struct partial_symtab * pst = new_psymtab("", objfile);
- fdr_to_pst[-1].pst = pst;
- FDR_IDX(pst) = -1;
- }
-
- /* Now scan the FDRs, mostly for dependencies */
- for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
- (void) parse_fdr(f_idx, 1, objfile);
-
- /* Take a good guess at how many symbols we might ever need */
- h_max = hdr->iextMax;
-
- /* Parse externals: two passes because they can be ordered
- in any way, but gdb likes to have them segregated by their
- source file. */
-
- /* Pass 1 over external syms: Presize and partition the list */
- for (s_idx = 0; s_idx < hdr->iextMax; s_idx++) {
- esh = (EXTR *) (hdr->cbExtOffset) + s_idx;
- fdr_to_pst[esh->ifd].n_globals++;
- }
-
- if (global_psymbols.list) {
- int origsize = global_psymbols.next - global_psymbols.list;
-
- global_psymbols.list = (struct partial_symbol *)
- xrealloc (global_psymbols.list,
- (h_max + origsize) * sizeof(struct partial_symbol));
- global_psymbols.next = global_psymbols.list + origsize;
- global_psymbols.size = h_max + origsize;
- } else {
- global_psymbols.list = (struct partial_symbol *)
- xmalloc (h_max * sizeof(struct partial_symbol));
- global_psymbols.next = global_psymbols.list;
- global_psymbols.size = h_max;
- }
-
- /* Pass 1.5 over files: partition out global symbol space */
- s_idx = global_psymbols.next - global_psymbols.list;
- for (f_idx = -1; f_idx < hdr->ifdMax; f_idx++) {
- fdr_to_pst[f_idx].pst->globals_offset = s_idx;
- s_idx += fdr_to_pst[f_idx].n_globals;
- }
-
- /* Pass 1.6 over files: partition out static symbol space.
- Note that this loop starts at 0, not at -1. */
- stat_idx = static_psymbols.next - static_psymbols.list;
- for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++) {
- fdr_to_pst[f_idx].pst->statics_offset = stat_idx;
- fh = f_idx + (FDR *)(hdr->cbFdOffset);
- stat_idx += fh->csym;
- }
-
- /* Now that we know its max size, allocate static symbol list */
- if (static_psymbols.list) {
- int origsize = static_psymbols.next - static_psymbols.list;
-
- static_psymbols.list = (struct partial_symbol *)
- xrealloc (static_psymbols.list,
- stat_idx * sizeof(struct partial_symbol));
- static_psymbols.next = static_psymbols.list + origsize;
- static_psymbols.size = stat_idx;
- } else {
- static_psymbols.list = (struct partial_symbol *)
- xmalloc (stat_idx * sizeof(struct partial_symbol));
- static_psymbols.next = static_psymbols.list;
- static_psymbols.size = stat_idx;
- }
-
- /* Pass 2 over external syms: fill in external symbols */
- for (s_idx = 0; s_idx < hdr->iextMax; s_idx++) {
- register struct partial_symbol *p;
- enum misc_function_type misc_type = mf_text;
- esh = (EXTR *) (hdr->cbExtOffset) + s_idx;
-
- if (esh->asym.sc == scUndefined || esh->asym.sc == scNil)
- continue;
-
- /* Locate the psymtab and the preallocated psymbol. */
- pst = fdr_to_pst[esh->ifd].pst;
- p = global_psymbols.list + pst->globals_offset +
- pst->n_global_syms++;
- SYMBOL_NAME(p) = (char *)(esh->asym.iss);
- SYMBOL_NAMESPACE(p) = VAR_NAMESPACE;
-
- switch (esh->asym.st) {
- case stProc:
- SYMBOL_CLASS(p) = LOC_BLOCK;
- SYMBOL_VALUE(p) = esh->asym.value;
- break;
- case stGlobal:
- SYMBOL_CLASS(p) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS(p) = (CORE_ADDR)esh->asym.value;
- misc_type = mf_data;
- break;
- case stLabel:
- SYMBOL_CLASS(p) = LOC_LABEL;
- SYMBOL_VALUE_ADDRESS(p) = (CORE_ADDR)esh->asym.value;
- break;
- default:
- misc_type = mf_unknown;
- complain (&unknown_ext_complaint, SYMBOL_NAME(p));
- }
- prim_record_misc_function (SYMBOL_NAME(p),
- SYMBOL_VALUE(p),
- misc_type);
- }
-
- /* Pass 3 over files, over local syms: fill in static symbols */
- for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++) {
- fh = f_idx + (FDR *)(cur_hdr->cbFdOffset);
- pst = fdr_to_pst[f_idx].pst;
- pst->texthigh = pst->textlow;
-
- for (s_idx = 0; s_idx < fh->csym; ) {
- register struct partial_symbol *p;
-
- sh = s_idx + (SYMR *) fh->isymBase;
-
- if (sh->sc == scUndefined || sh->sc == scNil) {
- /* FIXME, premature? */
- s_idx++;
- continue;
- }
-
- /* Locate the preallocated psymbol. */
- p = static_psymbols.list + pst->statics_offset +
- pst->n_static_syms;
- SYMBOL_NAME(p) = (char *)(sh->iss);
- SYMBOL_VALUE(p) = sh->value;
- SYMBOL_NAMESPACE(p) = VAR_NAMESPACE;
-
- switch (sh->st) {
- case stProc: /* Asm labels apparently */
- case stStaticProc: /* Function */
- SYMBOL_CLASS(p) = LOC_BLOCK;
- pst->n_static_syms++; /* Use gdb symbol */
- /* Skip over procedure to next one. */
- s_idx = (sh->index + (AUXU *)fh->iauxBase)
- ->isym;
- {
- long high;
- long procaddr = sh->value;
-
- sh = s_idx + (SYMR *) fh->isymBase - 1;
- if (sh->st != stEnd)
- continue;
- high = procaddr + sh->value;
- if (high > pst->texthigh)
- pst->texthigh = high;
- }
- continue;
- case stStatic: /* Variable */
- SYMBOL_CLASS(p) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS(p) = (CORE_ADDR)sh->value;
- break;
- case stTypedef: /* Typedef */
- SYMBOL_CLASS(p) = LOC_TYPEDEF;
- break;
- case stConstant: /* Constant decl */
- SYMBOL_CLASS(p) = LOC_CONST;
- break;
- case stBlock: /* { }, str, un, enum*/
- if (sh->sc == scInfo) {
- SYMBOL_NAMESPACE(p) = STRUCT_NAMESPACE;
- SYMBOL_CLASS(p) = LOC_TYPEDEF;
- pst->n_static_syms++;
- }
- /* Skip over the block */
- s_idx = sh->index;
- continue;
- case stFile: /* File headers */
- case stLabel: /* Labels */
- case stEnd: /* Ends of files */
- goto skip;
- default:
- complain (&unknown_sym_complaint, SYMBOL_NAME(p));
- complain (&unknown_st_complaint, sh->st);
- s_idx++;
- continue;
- }
- pst->n_static_syms++; /* Use this gdb symbol */
- skip:
- s_idx++; /* Go to next file symbol */
-#if 0
-/* We don't usually record static syms, but some we seem to. chk dbxread. */
-/*FIXME*/ prim_record_misc_function (SYMBOL_NAME(p),
- SYMBOL_VALUE(p),
- misc_type);
-#endif
- }
- }
-
- /* The array (of lists) of globals must be sorted. */
- reorder_psymtabs();
-
- /* Now sort the global psymbols. */
- for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++) {
- struct partial_symtab *pst = fdr_to_pst[f_idx].pst;
- if (pst->n_global_syms > 1)
- qsort (global_psymbols.list + pst->globals_offset,
- pst->n_global_syms, sizeof (struct partial_symbol),
- compare_psymbols);
- }
-
- /* Mark the last code address, and remember it for later */
- hdr->cbDnOffset = end_of_text_seg;
-
- free(&fdr_to_pst[-1]);
- fdr_to_pst = 0;
-}
-
-
-/* Do the initial analisys of the F_IDX-th file descriptor.
- Allocates a partial symtab for it, and builds the list
- of dependent files by recursion. LEV says at which level
- of recursion we are called (to pretty up debug traces) */
-
-static struct partial_symtab *
-parse_fdr(f_idx, lev, objfile)
- int f_idx;
- int lev;
- struct objfile *objfile;
-{
- register FDR *fh;
- register struct partial_symtab *pst;
- int s_idx, s_id0;
-
- fh = (FDR *) (cur_hdr->cbFdOffset) + f_idx;
-
- /* Use this to indicate into which symtab this file was parsed */
- if (fh->ioptBase)
- return (struct partial_symtab *) fh->ioptBase;
-
- /* Debuggability level */
- if (compare_glevel(max_glevel, fh->glevel) < 0)
- max_glevel = fh->glevel;
-
- /* Make a new partial_symtab */
- pst = new_psymtab(fh->rss, objfile);
- if (fh->cpd == 0){
- pst->textlow = 0;
- pst->texthigh = 0;
- } else {
- pst->textlow = fh->adr;
- pst->texthigh = fh->cpd; /* To be fixed later */
- }
-
- /* Make everything point to everything. */
- FDR_IDX(pst) = f_idx;
- fdr_to_pst[f_idx].pst = pst;
- fh->ioptBase = (int)pst;
-
- /* Analyze its dependencies */
- if (fh->crfd <= 1)
- return pst;
-
- s_id0 = 0;
- if (fh->cpd == 0) { /* If there are no functions defined here ... */
- /* ...then presumably a .h file: drop reverse depends .h->.c */
- for (; s_id0 < fh->crfd; s_id0++) {
- RFDT *rh = (RFDT *) (fh->rfdBase) + s_id0;
- if (*rh == f_idx) {
- s_id0++; /* Skip self-dependency */
- break;
- }
- }
- }
- pst->number_of_dependencies = fh->crfd - s_id0;
- pst->dependencies = (struct partial_symtab **)
- obstack_alloc (psymbol_obstack,
- pst->number_of_dependencies *
- sizeof (struct partial_symtab *));
- for (s_idx = s_id0; s_idx < fh->crfd; s_idx++) {
- RFDT *rh = (RFDT *) (fh->rfdBase) + s_idx;
-
- pst->dependencies[s_idx-s_id0] = parse_fdr(*rh, lev+1, objfile);
- }
-
- return pst;
-}
-
-
-/* Ancillary function to psymtab_to_symtab(). Does all the work
- for turning the partial symtab PST into a symtab, recurring
- first on all dependent psymtabs. The argument FILENAME is
- only passed so we can see in debug stack traces what file
- is being read. */
-
-static void
-psymtab_to_symtab_1(pst, filename)
- struct partial_symtab *pst;
- char *filename;
-{
- int i, f_max;
- struct symtab *st;
- FDR *fh;
-
- if (pst->readin)
- return;
- pst->readin = 1;
-
- pending_list = (struct pending **) cur_hdr->cbOptOffset;
- if (pending_list == 0) {
- pending_list = (struct pending **)
- xzalloc(cur_hdr->ifdMax * sizeof(struct pending *));
- cur_hdr->cbOptOffset = (int)pending_list;
- }
-
- /* How many symbols will we need */
- /* FIXME, this does not count enum values. */
- f_max = pst->n_global_syms + pst->n_static_syms;
- if (FDR_IDX(pst) == -1) {
- fh = 0;
- st = new_symtab ("unknown", f_max, 0, pst->objfile);
- } else {
- fh = (FDR *) (cur_hdr->cbFdOffset) + FDR_IDX(pst);
- f_max += fh->csym + fh->cpd;
- st = new_symtab (pst->filename, 2 * f_max, 2 * fh->cline,
- pst->objfile);
- }
-
- /* Read in all partial symbtabs on which this one is dependent.
- NOTE that we do have circular dependencies, sigh. We solved
- that by setting pst->readin before this point. */
-
- for (i = 0; i < pst->number_of_dependencies; i++)
- if (!pst->dependencies[i]->readin) {
- /* Inform about additional files to be read in. */
- if (info_verbose)
- {
- fputs_filtered (" ", stdout);
- wrap_here ("");
- fputs_filtered ("and ", stdout);
- wrap_here ("");
- printf_filtered ("%s...",
- pst->dependencies[i]->filename);
- wrap_here (""); /* Flush output */
- fflush (stdout);
- }
- /* We only pass the filename for debug purposes */
- psymtab_to_symtab_1(pst->dependencies[i],
- pst->dependencies[i]->filename);
- }
-
- /* Now read the symbols for this symtab */
-
- cur_fd = FDR_IDX(pst);
- cur_fdr = fh;
- cur_stab = st;
-
- /* Get a new lexical context */
-
- push_parse_stack();
- top_stack->cur_st = cur_stab;
- top_stack->cur_block = BLOCKVECTOR_BLOCK(BLOCKVECTOR(cur_stab),
- STATIC_BLOCK);
- BLOCK_START(top_stack->cur_block) = fh ? fh->adr : 0;
- BLOCK_END(top_stack->cur_block) = 0;
- top_stack->blocktype = stFile;
- top_stack->maxsyms = 2*f_max;
- top_stack->cur_type = 0;
- top_stack->procadr = 0;
- top_stack->numargs = 0;
-
- /* Parse locals and procedures */
- if (fh)
- parse_one_file(fh, cur_fd, (cur_fd == (cur_hdr->ifdMax - 1)) ?
- cur_hdr->cbDnOffset : fh[1].adr);
-
- /* .. and our share of externals.
- XXX use the global list to speed up things here. how ?
- FIXME, Maybe quit once we have found the right number of ext's? */
- /* parse_external clobbers top_stack->cur_block and ->cur_st here. */
- top_stack->blocktype = stFile;
- top_stack->maxsyms = cur_hdr->isymMax + cur_hdr->ipdMax + cur_hdr->iextMax;
- for (i = 0; i < cur_hdr->iextMax; i++) {
- register EXTR *esh = (EXTR *) (cur_hdr->cbExtOffset) + i;
- if (esh->ifd == cur_fd)
- parse_external(esh, 1);
- }
-
- /* If there are undefined, tell the user */
- if (n_undef_symbols) {
- printf_filtered("File %s contains %d unresolved references:",
- st->filename, n_undef_symbols);
- printf_filtered("\n\t%4d variables\n\t%4d procedures\n\t%4d labels\n",
- n_undef_vars, n_undef_procs, n_undef_labels);
- n_undef_symbols = n_undef_labels = n_undef_vars = n_undef_procs = 0;
- }
-
- pop_parse_stack();
-
- /*
- * Sort the symbol table now, we are done adding symbols to it.
- */
- sort_symtab_syms(st);
-
- /* Now link the psymtab and the symtab. */
- pst->symtab = st;
-}
-
-/* Ancillary parsing procedures. */
-
-/* Lookup the type at relative index RN. Return it in TPP
- if found and in any event come up with its name PNAME.
- Return value says how many aux symbols we ate */
-
-static
-cross_ref(rn, tpp, pname)
- RNDXR *rn;
- struct type **tpp;
- char **pname;
-{
- unsigned rf;
-
- /* Escape index means 'the next one' */
- if (rn->rfd == 0xfff)
- rf = *(unsigned *) (rn + 1);
- else
- rf = rn->rfd;
-
- if (rf == -1) {
- /* Ooops */
- *pname = "<undefined>";
- } else {
- /*
- * Find the relative file descriptor and the symbol in it
- */
- FDR *fh = get_rfd(cur_fd, rf);
- SYMR *sh;
- struct type *t;
-
- /*
- * If we have processed this symbol then we left a forwarding
- * pointer to the corresponding GDB symbol. If not, we`ll put
- * it in a list of pending symbols, to be processed later when
- * the file f will be. In any event, we collect the name for
- * the type here. Which is why we made a first pass at
- * strings.
- */
- sh = (SYMR *) (fh->isymBase) + rn->index;
-
- /* Careful, we might be looking at .o files */
- *pname = (UNSAFE_DATA_ADDR(sh->iss)) ? "<undefined>" :
- (char *) sh->iss;
-
- /* Have we parsed it ? */
- if ((!UNSAFE_DATA_ADDR(sh->value)) && (sh->st == stParsed)) {
- t = (struct type *) sh->value;
- *tpp = t;
- } else {
- struct pending *p;
-
- /* Avoid duplicates */
- p = is_pending_symbol(fh, sh);
-
- if (p)
- *tpp = p->t;
- else
- add_pending(fh, sh, *tpp);
- }
- }
-
- /* We used one auxent normally, two if we got a "next one" rf. */
- return (rn->rfd == 0xfff? 2: 1);
-}
-
-
-/* Quick&dirty lookup procedure, to avoid the MI ones that require
- keeping the symtab sorted */
-
-static struct symbol *
-mylookup_symbol (name, block, namespace, class)
- char *name;
- register struct block *block;
- enum namespace namespace;
- enum address_class class;
-{
- register int bot, top, inc;
- register struct symbol *sym;
-
- bot = 0;
- top = BLOCK_NSYMS(block);
- inc = name[0];
- while (bot < top) {
- sym = BLOCK_SYM(block, bot);
- if (SYMBOL_NAME(sym)[0] == inc
- && SYMBOL_NAMESPACE(sym) == namespace
- && SYMBOL_CLASS(sym) == class
- && !strcmp(SYMBOL_NAME(sym), name))
- return sym;
- bot++;
- }
- if (block = BLOCK_SUPERBLOCK (block))
- return mylookup_symbol (name, block, namespace, class);
- return 0;
-}
-
-
-/* Add a new symbol S to a block B.
- Infrequently, we will need to reallocate the block to make it bigger.
- We only detect this case when adding to top_stack->cur_block, since
- that's the only time we know how big the block is. FIXME. */
-
-static void
-add_symbol(s,b)
- struct symbol *s;
- struct block *b;
-{
- int nsyms = BLOCK_NSYMS(b)++;
- struct block *origb;
- struct parse_stack *stackp;
-
- if (b == top_stack->cur_block &&
- nsyms >= top_stack->maxsyms) {
- complain (&block_overflow_complaint, s->name);
- /* In this case shrink_block is actually grow_block, since
- BLOCK_NSYMS(b) is larger than its current size. */
- origb = b;
- b = shrink_block (top_stack->cur_block, top_stack->cur_st);
-
- /* Now run through the stack replacing pointers to the
- original block. shrink_block has already done this
- for the blockvector and BLOCK_FUNCTION. */
- for (stackp = top_stack; stackp; stackp = stackp->next) {
- if (stackp->cur_block == origb) {
- stackp->cur_block = b;
- stackp->maxsyms = BLOCK_NSYMS (b);
- }
- }
- }
- BLOCK_SYM(b,nsyms) = s;
-}
-
-/* Add a new block B to a symtab S */
-
-static void
-add_block(b,s)
- struct block *b;
- struct symtab *s;
-{
- struct blockvector *bv = BLOCKVECTOR(s);
-
- bv = (struct blockvector *)xrealloc(bv, sizeof(struct blockvector) +
- BLOCKVECTOR_NBLOCKS(bv) * sizeof(bv->block));
- if (bv != BLOCKVECTOR(s))
- BLOCKVECTOR(s) = bv;
-
- BLOCKVECTOR_BLOCK(bv, BLOCKVECTOR_NBLOCKS(bv)++) = b;
-}
-
-/* Add a new linenumber entry (LINENO,ADR) to a linevector LT.
- MIPS' linenumber encoding might need more than one byte
- to describe it, LAST is used to detect these continuation lines */
-
-static int
-add_line(lt, lineno, adr, last)
- struct linetable *lt;
- int lineno;
- CORE_ADDR adr;
- int last;
-{
- if (last == 0)
- last = -2; /* make sure we record first line */
-
- if (last == lineno) /* skip continuation lines */
- return lineno;
-
- lt->item[lt->nitems].line = lineno;
- lt->item[lt->nitems++].pc = adr << 2;
- return lineno;
-}
-
-
-
-/* Comparison functions, used when sorting things */
-
-/* Symtabs must be ordered viz the code segments they cover */
-
-static int
-compare_symtabs( s1, s2)
- struct symtab **s1, **s2;
-{
- /* "most specific" first */
-
- register struct block *b1, *b2;
- b1 = BLOCKVECTOR_BLOCK(BLOCKVECTOR(*s1),GLOBAL_BLOCK);
- b2 = BLOCKVECTOR_BLOCK(BLOCKVECTOR(*s2),GLOBAL_BLOCK);
- if (BLOCK_END(b1) == BLOCK_END(b2))
- return BLOCK_START(b1) - BLOCK_START(b2);
- return BLOCK_END(b1) - BLOCK_END(b2);
-}
-
-
-/* Partial Symtabs, same */
-
-static int
-compare_psymtabs( s1, s2)
- struct partial_symtab **s1, **s2;
-{
- /* Perf twist: put the ones with no code at the end */
-
- register int a = (*s1)->textlow;
- register int b = (*s2)->textlow;
- if (a == 0)
- return b;
- if (b == 0)
- return -a;
- return a - b;
-}
-
-
-/* Partial symbols are compared lexicog by their print names */
-
-static int
-compare_psymbols (s1, s2)
- register struct partial_symbol *s1, *s2;
-{
- register char
- *st1 = SYMBOL_NAME(s1),
- *st2 = SYMBOL_NAME(s2);
-
- return (st1[0] - st2[0] ? st1[0] - st2[0] :
- strcmp(st1 + 1, st2 + 1));
-}
-
-/* Blocks with a smaller low bound should come first */
-
-static int compare_blocks(b1,b2)
- struct block **b1, **b2;
-{
- register int addr_diff;
-
- addr_diff = (BLOCK_START((*b1))) - (BLOCK_START((*b2)));
- if (addr_diff == 0)
- return (BLOCK_END((*b1))) - (BLOCK_END((*b2)));
- return addr_diff;
-}
-
-
-/* Sorting and reordering procedures */
-
-/* Sort the blocks of a symtab S.
- Reorder the blocks in the blockvector by code-address,
- as required by some MI search routines */
-
-static void
-sort_blocks(s)
- struct symtab *s;
-{
- struct blockvector *bv = BLOCKVECTOR(s);
-
- if (BLOCKVECTOR_NBLOCKS(bv) <= 2) {
- /* Cosmetic */
- if (BLOCK_END(BLOCKVECTOR_BLOCK(bv,GLOBAL_BLOCK)) == 0)
- BLOCK_START(BLOCKVECTOR_BLOCK(bv,GLOBAL_BLOCK)) = 0;
- if (BLOCK_END(BLOCKVECTOR_BLOCK(bv,STATIC_BLOCK)) == 0)
- BLOCK_START(BLOCKVECTOR_BLOCK(bv,STATIC_BLOCK)) = 0;
- return;
- }
- /*
- * This is very unfortunate: normally all functions are compiled in
- * the order they are found, but if the file is compiled -O3 things
- * are very different. It would be nice to find a reliable test
- * to detect -O3 images in advance.
- */
- if (BLOCKVECTOR_NBLOCKS(bv) > 3)
- qsort(&BLOCKVECTOR_BLOCK(bv,FIRST_LOCAL_BLOCK),
- BLOCKVECTOR_NBLOCKS(bv) - FIRST_LOCAL_BLOCK,
- sizeof(struct block *),
- compare_blocks);
-
- {
- register CORE_ADDR high = 0;
- register int i, j = BLOCKVECTOR_NBLOCKS(bv);
-
- for (i = FIRST_LOCAL_BLOCK; i < j; i++)
- if (high < BLOCK_END(BLOCKVECTOR_BLOCK(bv,i)))
- high = BLOCK_END(BLOCKVECTOR_BLOCK(bv,i));
- BLOCK_END(BLOCKVECTOR_BLOCK(bv,GLOBAL_BLOCK)) = high;
- }
-
- BLOCK_START(BLOCKVECTOR_BLOCK(bv,GLOBAL_BLOCK)) =
- BLOCK_START(BLOCKVECTOR_BLOCK(bv,FIRST_LOCAL_BLOCK));
-
- BLOCK_START(BLOCKVECTOR_BLOCK(bv,STATIC_BLOCK)) =
- BLOCK_START(BLOCKVECTOR_BLOCK(bv,GLOBAL_BLOCK));
- BLOCK_END (BLOCKVECTOR_BLOCK(bv,STATIC_BLOCK)) =
- BLOCK_END (BLOCKVECTOR_BLOCK(bv,GLOBAL_BLOCK));
-}
-
-/* Sort the symtab list, as required by some search procedures.
- We want files ordered to make them look right to users, and for
- searching (see block_for_pc). */
-
-static void
-reorder_symtabs()
-{
- register int i;
- struct symtab *stab;
- register struct symtab **all_symtabs;
- register int symtab_count;
-
- if (!symtab_list)
- return;
-
- /* Create an array of pointers to all the symtabs. */
- for (symtab_count = 0, stab = symtab_list;
- stab;
- symtab_count++, stab = stab->next) {
- obstack_grow (psymbol_obstack, &stab, sizeof (stab));
- /* FIXME: Only sort blocks for new symtabs ??? */
- sort_blocks(stab);
- }
-
- all_symtabs = (struct symtab **)
- obstack_base (psymbol_obstack);
- qsort((char *)all_symtabs, symtab_count,
- sizeof(struct symtab *), compare_symtabs);
-
- /* Re-construct the symtab list, but now it is sorted. */
- for (i = 0; i < symtab_count-1; i++)
- all_symtabs[i]->next = all_symtabs[i+1];
- all_symtabs[i]->next = 0;
- symtab_list = all_symtabs[0];
-
- obstack_free (psymbol_obstack, all_symtabs);
-}
-
-/* Sort the partial symtab list, as required by some search procedures.
- PC lookups stop at the first psymtab such that textlow <= PC < texthigh */
-
-static void
-reorder_psymtabs()
-{
- register int i;
- register int all_psymtabs_count;
- struct partial_symtab *pstab;
- struct partial_symtab **all_psymtabs;
-
- if (!partial_symtab_list)
- return;
-
- /* Create an array of pointers to all the partial_symtabs. */
-
- for (all_psymtabs_count = 0, pstab = partial_symtab_list;
- pstab;
- all_psymtabs_count++, pstab = pstab->next)
- obstack_grow (psymbol_obstack, &pstab, sizeof (pstab));
-
- all_psymtabs = (struct partial_symtab **)
- obstack_base (psymbol_obstack);
-
- qsort((char *)all_psymtabs, all_psymtabs_count,
- sizeof(struct partial_symtab *), compare_psymtabs);
-
- /* Re-construct the partial_symtab_list, but now it is sorted. */
-
- for (i = 0; i < all_psymtabs_count-1; i++)
- all_psymtabs[i]->next = all_psymtabs[i+1];
- all_psymtabs[i]->next = 0;
- partial_symtab_list = all_psymtabs[0];
-
- obstack_free (psymbol_obstack, all_psymtabs);
-}
-
-/* Constructor/restructor/destructor procedures */
-
-/* Allocate a new symtab for NAME. Needs an estimate of how many symbols
- MAXSYMS and linenumbers MAXLINES we'll put in it */
-
-static
-struct symtab *
-new_symtab(name, maxsyms, maxlines, objfile)
- char *name;
-{
- struct symtab *s = allocate_symtab (name, objfile);
-
- LINETABLE(s) = new_linetable(maxlines);
-
- /* All symtabs must have at least two blocks */
- BLOCKVECTOR(s) = new_bvect(2);
- BLOCKVECTOR_BLOCK(BLOCKVECTOR(s), GLOBAL_BLOCK) = new_block(maxsyms);
- BLOCKVECTOR_BLOCK(BLOCKVECTOR(s), STATIC_BLOCK) = new_block(maxsyms);
- BLOCK_SUPERBLOCK( BLOCKVECTOR_BLOCK(BLOCKVECTOR(s),STATIC_BLOCK)) =
- BLOCKVECTOR_BLOCK(BLOCKVECTOR(s), GLOBAL_BLOCK);
-
- s->free_code = free_linetable;
-
- /* Link the new symtab into the list of such. */
- s->next = symtab_list;
- symtab_list = s;
-
- return s;
-}
-
-/* Allocate a new partial_symtab NAME */
-
-static struct partial_symtab *
-new_psymtab(name, objfile)
- char *name;
- struct objfile *objfile;
-{
- struct partial_symtab *pst;
-
- pst = (struct partial_symtab *)
- obstack_alloc (psymbol_obstack, sizeof (*pst));
- bzero (pst, sizeof (*pst));
-
- if (name == (char*)-1) /* FIXME -- why not null here? */
- pst->filename = "<no name>";
- else
- pst->filename = name;
-
- /* Chain it to its object file */
- pst->objfile = objfile;
- pst->objfile_chain = sym_objfile->psymtabs;
- sym_objfile->psymtabs = pst;
-
- pst->next = partial_symtab_list;
- partial_symtab_list = pst;
-
- /* Keep a backpointer to the file's symbols */
- pst->read_symtab_private = (char *) obstack_alloc (psymbol_obstack,
- sizeof (struct symloc));
- CUR_HDR(pst) = cur_hdr;
-
- /* The way to turn this into a symtab is to call... */
- pst->read_symtab = mipscoff_psymtab_to_symtab;
-
- return pst;
-}
-
-
-/* Allocate a linetable array of the given SIZE */
-
-static
-struct linetable *new_linetable(size)
-{
- struct linetable *l;
-
- size = size * sizeof(l->item) + sizeof(struct linetable);
- l = (struct linetable *)xmalloc(size);
- l->nitems = 0;
- return l;
-}
-
-/* Oops, too big. Shrink it. This was important with the 2.4 linetables,
- I am not so sure about the 3.4 ones */
-
-static void
-shrink_linetable(s)
- struct symtab *s;
-{
- struct linetable *l = new_linetable(LINETABLE(s)->nitems);
-
- bcopy(LINETABLE(s), l,
- LINETABLE(s)->nitems * sizeof(l->item) + sizeof(struct linetable));
- free (LINETABLE(s));
- LINETABLE(s) = l;
-}
-
-/* Allocate and zero a new blockvector of NBLOCKS blocks. */
-
-static
-struct blockvector *
-new_bvect(nblocks)
-{
- struct blockvector *bv;
- int size;
-
- size = sizeof(struct blockvector) + nblocks * sizeof(struct block*);
- bv = (struct blockvector *) xzalloc(size);
-
- BLOCKVECTOR_NBLOCKS(bv) = nblocks;
-
- return bv;
-}
-
-/* Allocate and zero a new block of MAXSYMS symbols */
-
-static
-struct block *
-new_block(maxsyms)
-{
- int size = sizeof(struct block) + (maxsyms-1) * sizeof(struct symbol *);
- struct block *b = (struct block *)xzalloc(size);
-
- return b;
-}
-
-/* Ooops, too big. Shrink block B in symtab S to its minimal size.
- Shrink_block can also be used by add_symbol to grow a block. */
-
-static struct block *
-shrink_block(b, s)
- struct block *b;
- struct symtab *s;
-{
- struct block *new;
- struct blockvector *bv = BLOCKVECTOR(s);
- int i;
-
- /* Just reallocate it and fix references to the old one */
-
- new = (struct block *) xrealloc ((char *)b, sizeof(struct block) +
- (BLOCK_NSYMS(b)-1) * sizeof(struct symbol *));
-
- /* Should chase pointers to old one. Fortunately, that`s just
- the block`s function and inferior blocks */
- if (BLOCK_FUNCTION(new) && SYMBOL_BLOCK_VALUE(BLOCK_FUNCTION(new)) == b)
- SYMBOL_BLOCK_VALUE(BLOCK_FUNCTION(new)) = new;
- for (i = 0; i < BLOCKVECTOR_NBLOCKS(bv); i++)
- if (BLOCKVECTOR_BLOCK(bv,i) == b)
- BLOCKVECTOR_BLOCK(bv,i) = new;
- else if (BLOCK_SUPERBLOCK(BLOCKVECTOR_BLOCK(bv,i)) == b)
- BLOCK_SUPERBLOCK(BLOCKVECTOR_BLOCK(bv,i)) = new;
- return new;
-}
-
-/* Create a new symbol with printname NAME */
-
-static
-struct symbol *
-new_symbol(name)
- char *name;
-{
- struct symbol *s = (struct symbol *)
- obstack_alloc (symbol_obstack, sizeof (struct symbol));
-
- bzero (s, sizeof (*s));
- SYMBOL_NAME(s) = name;
- return s;
-}
-
-/* Create a new type with printname NAME */
-
-static
-struct type *
-new_type(name)
- char *name;
-{
- struct type *t = (struct type *)
- obstack_alloc (symbol_obstack, sizeof (struct type));
-
- bzero (t, sizeof (*t));
- TYPE_VPTR_FIELDNO (t) = -1;
- TYPE_NAME(t) = name;
- return t;
-}
-
-/* Create and initialize a new type with printname NAME.
- CODE and LENGTH are the initial info we put in,
- UNS says whether the type is unsigned or not. */
-
-static
-struct type *
-make_type(code, length, uns, name)
- enum type_code code;
- int length, uns;
- char *name;
-{
- register struct type *type;
-
- type = (struct type *) xzalloc(sizeof(struct type));
- TYPE_CODE(type) = code;
- TYPE_LENGTH(type) = length;
- TYPE_FLAGS(type) = uns ? TYPE_FLAG_UNSIGNED : 0;
- TYPE_NAME(type) = name;
- TYPE_VPTR_FIELDNO (type) = -1;
-
- return type;
-}
-
-/* Allocate a new field named NAME to the type TYPE */
-
-static
-struct field *
-new_field(type,name)
- struct type *type;
- char *name;
-{
- struct field *f;
-
- /* Fields are kept in an array */
- if (TYPE_NFIELDS(type))
- TYPE_FIELDS(type) = (struct field*)xrealloc(TYPE_FIELDS(type),
- (TYPE_NFIELDS(type)+1) * sizeof(struct field));
- else
- TYPE_FIELDS(type) = (struct field*)xzalloc(sizeof(struct field));
- f = &(TYPE_FIELD(type,TYPE_NFIELDS(type)));
- TYPE_NFIELDS(type)++;
- bzero(f, sizeof(struct field));
- f->name = name; /* Whether or not NAME is zero, this works. */
- return f;
-}
-
-/* Make an enum constant for a member F of an enumerated type T */
-
-static
-make_enum_constant(f,t)
- struct field *f;
- struct type *t;
-{
- struct symbol *s;
- /*
- * This is awful, but that`s the way it is supposed to be
- * (BTW, no need to free the real 'type', it's a builtin)
- */
- f->type = (struct type *) f->bitpos;
-
- s = new_symbol(f->name);
- SYMBOL_NAMESPACE(s) = VAR_NAMESPACE;
- SYMBOL_CLASS(s) = LOC_CONST;
- SYMBOL_TYPE(s) = t;
- SYMBOL_VALUE(s) = f->bitpos;
- add_symbol(s, top_stack->cur_block);
-}
-
-
-
-/* Things used for calling functions in the inferior.
- These functions are exported to our companion
- mips-dep.c file and are here because they play
- with the symbol-table explicitly. */
-
-#if 0
-/* Need to make a new symbol on the fly for the dummy
- frame we put on the stack. Which goes in the.. */
-
-static struct symtab *dummy_symtab;
-
-/* Make up a dummy symbol for the code we put at END_PC,
- of size SIZE, invoking a function with NARGS arguments
- and using a frame of FRAMESIZE bytes */
-
-mips_create_dummy_symbol(end_pc, size, nargs, framesize)
-{
- struct block *bl;
- struct symbol *g;
- struct mips_extra_func_info *gdbinfo;
-
- /* Allocate symtab if not done already */
- if (dummy_symtab == 0)
- dummy_symtab = new_symtab(".dummy_symtab.", 100, 0);
-
- /* Make a new block. Only needs one symbol */
- bl = new_block(1);
- BLOCK_START(bl) = end_pc - size;
- BLOCK_END(bl) = end_pc;
-
- BLOCK_SUPERBLOCK(bl) =
- BLOCKVECTOR_BLOCK(BLOCKVECTOR(dummy_symtab),GLOBAL_BLOCK);
- add_block(bl, dummy_symtab);
- sort_blocks(dummy_symtab);
-
- BLOCK_FUNCTION(bl) = new_symbol("??");
- SYMBOL_BLOCK_VALUE(BLOCK_FUNCTION(bl)) = bl;
- g = new_symbol(".gdbinfo.");
- BLOCK_SYM(bl,BLOCK_NSYMS(bl)++) = g;
-
- SYMBOL_NAMESPACE(g) = LABEL_NAMESPACE;
- SYMBOL_CLASS(g) = LOC_CONST;
- SYMBOL_TYPE(g) = builtin_type_void;
- gdbinfo = (struct mips_extra_func_info *)
- xzalloc(sizeof(struct mips_extra_func_info));
-
- SYMBOL_VALUE(g) = (long) gdbinfo;
-
- gdbinfo->numargs = nargs;
- gdbinfo->framesize = framesize;
- gdbinfo->framereg = 29;
- gdbinfo->pcreg = 31;
- gdbinfo->regmask = -2;
- gdbinfo->regoffset = -4;
- gdbinfo->fregmask = 0; /* XXX */
- gdbinfo->fregoffset = 0; /* XXX */
-}
-
-/* We just returned from the dummy code at END_PC, drop its symbol */
-
-mips_destroy_dummy_symbol(end_pc)
-{
- struct block *bl;
- struct blockvector *bv = BLOCKVECTOR(dummy_symtab);
- int i;
-
- bl = block_for_pc(end_pc);
- free(BLOCK_FUNCTION(bl));
- free(SYMBOL_VALUE(BLOCK_SYM(bl,0)));
- free(BLOCK_SYM(bl,0));
-
- for (i = FIRST_LOCAL_BLOCK; i < BLOCKVECTOR_NBLOCKS(bv); i++)
- if (BLOCKVECTOR_BLOCK(bv,i) == bl)
- break;
- for (; i < BLOCKVECTOR_NBLOCKS(bv) - 1; i++)
- BLOCKVECTOR_BLOCK(bv,i) = BLOCKVECTOR_BLOCK(bv,i+1);
- BLOCKVECTOR_NBLOCKS(bv)--;
- sort_blocks(dummy_symtab);
- free(bl);
-}
-#endif
-
-/* Sigtramp: make sure we have all the necessary information
- about the signal trampoline code. Since the official code
- from MIPS does not do so, we make up that information ourselves.
- If they fix the library (unlikely) this code will neutralize itself. */
-
-static
-fixup_sigtramp()
-{
- struct symbol *s;
- struct symtab *st;
- struct block *b, *b0;
-
- sigtramp_address = -1;
-
- /* We know it is sold as sigvec */
- s = lookup_symbol("sigvec", 0, VAR_NAMESPACE, 0, NULL);
-
- /* Most programs do not play with signals */
- if (s == 0)
- return;
-
- b0 = SYMBOL_BLOCK_VALUE(s);
-
- /* A label of sigvec, to be more precise */
- s = lookup_symbol("sigtramp", b0, VAR_NAMESPACE, 0, NULL);
-
- /* But maybe this program uses its own version of sigvec */
- if (s == 0)
- return;
-
- sigtramp_address = SYMBOL_VALUE(s);
- sigtramp_end = sigtramp_address + 0x88; /* black magic */
-
- /* Did we or MIPSco fix the library ? */
- if (SYMBOL_CLASS(s) == LOC_BLOCK)
- return;
-
- /* But what symtab does it live in ? */
- st = find_pc_symtab(SYMBOL_VALUE(s));
-
- /*
- * Ok, there goes the fix: turn it into a procedure, with all the
- * needed info. Note we make it a nested procedure of sigvec,
- * which is the way the (assembly) code is actually written.
- */
- SYMBOL_NAMESPACE(s) = VAR_NAMESPACE;
- SYMBOL_CLASS(s) = LOC_BLOCK;
- SYMBOL_TYPE(s) = make_type(TYPE_CODE_FUNC, 4, 0, 0);
- TYPE_TARGET_TYPE(SYMBOL_TYPE(s)) = builtin_type_void;
-
- /* Need a block to allocate .gdbinfo. in */
- b = new_block(1);
- SYMBOL_BLOCK_VALUE(s) = b;
- BLOCK_START(b) = sigtramp_address;
- BLOCK_END(b) = sigtramp_end;
- BLOCK_FUNCTION(b) = s;
- BLOCK_SUPERBLOCK(b) = BLOCK_SUPERBLOCK(b0);
- add_block(b, st);
- sort_blocks(st);
-
- /* Make a .gdbinfo. for it */
- {
- struct mips_extra_func_info *e =
- (struct mips_extra_func_info *)
- xzalloc(sizeof(struct mips_extra_func_info));
-
- e->numargs = 0; /* the kernel thinks otherwise */
- /* align_longword(sigcontext + SIGFRAME) */
- e->framesize = 0x150;
- e->framereg = SP_REGNUM;
- e->pcreg = 31;
- e->regmask = -2;
- e->regoffset = -(41 * sizeof(int));
- e->fregmask = -1;
- e->fregoffset = -(37 * sizeof(int));
- e->isym = (long)s;
-
- s = new_symbol(".gdbinfo.");
- SYMBOL_VALUE(s) = (int) e;
- SYMBOL_NAMESPACE(s) = LABEL_NAMESPACE;
- SYMBOL_CLASS(s) = LOC_CONST;
- SYMBOL_TYPE(s) = builtin_type_void;
- }
-
- BLOCK_SYM(b,BLOCK_NSYMS(b)++) = s;
-}
-
-/* Initialization */
-
-static struct sym_fns ecoff_sym_fns = {"ecoff", 5,
- mipscoff_new_init, mipscoff_symfile_init,
- mipscoff_symfile_read};
-
-_initialize_mipsread ()
-{
- add_symtab_fns (&ecoff_sym_fns);
-
- /* Missing basic types */
- builtin_type_string = make_type(TYPE_CODE_PASCAL_ARRAY,
- 1, 0, "string");
- builtin_type_complex = make_type(TYPE_CODE_FLT,
- 2 * sizeof(float), 0, "complex");
- builtin_type_double_complex = make_type(TYPE_CODE_FLT,
- 2 * sizeof(double), 0, "double_complex");
- builtin_type_fixed_dec = make_type(TYPE_CODE_INT, sizeof(int),
- 0, "fixed_decimal");
- builtin_type_float_dec = make_type(TYPE_CODE_FLT, sizeof(double),
- 0, "floating_decimal");
-
- /* Templates types */
- builtin_type_struct = make_type(TYPE_CODE_STRUCT, 0, 0, 0);
- builtin_type_union = make_type(TYPE_CODE_UNION, 0, 0, 0);
- builtin_type_enum = make_type(TYPE_CODE_ENUM, 0, 0, 0);
- builtin_type_range = make_type(TYPE_CODE_RANGE, 0, 0, 0);
- builtin_type_set = make_type(TYPE_CODE_SET, 0, 0, 0);
-
- /* We can't do this now because builtin_type_void may not
- be set yet. Do it at symbol reading time. */
- /* builtin_type_ptr = lookup_pointer_type (builtin_type_void); */
-}
diff --git a/gdb/mtrace.awk b/gdb/mtrace.awk
deleted file mode 100755
index d7689ce..0000000
--- a/gdb/mtrace.awk
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Awk program to analyze mtrace.c output.
-#
-$1 == "+" { if (allocated[$2] != "")
- print "+", $2, "Alloc", NR, "duplicate:", allocated[$2];
- else
- allocated[$2] = $3;
- }
-$1 == "-" { if (allocated[$2] != "") {
- allocated[$2] = "";
- if (allocated[$2] != "")
- print "DELETE FAILED", $2, allocated[$2];
- } else
- print "-", $2, "Free", NR, "was never alloc'd";
- }
-$1 == "<" { if (allocated[$2] != "")
- allocated[$2] = "";
- else
- print "-", $2, "Realloc", NR, "was never alloc'd";
- }
-$1 == ">" { if (allocated[$2] != "")
- print "+", $2, "Realloc", NR, "duplicate:", allocated[$2];
- else
- allocated[$2] = $3;
- }
-
-# Ignore "= Start"
-$1 == "=" { }
-# Ignore failed realloc attempts for now
-$1 == "!" { }
-
-
-END { for (x in allocated)
- if (allocated[x] != "")
- print "+", x, allocated[x];
- }
diff --git a/gdb/mtrace.c b/gdb/mtrace.c
deleted file mode 100755
index 82e7f03..0000000
--- a/gdb/mtrace.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* More debugging hooks for `malloc'.
- Copyright 1991 Free Software Foundation
- Written April 2, 1991 by John Gilmore of Cygnus Support
- Based on mcheck.c by Mike Haertel.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "ansidecl.h"
-
-/* size_t may be defined in the system-supplied stdio.h. */
-/* So just kludge it. */
-#define size_t unsigned int
-#define ptrdiff_t int
-#define __ONEFILE
-
-/* We can't declare malloc and realloc here because we don't know
- if they are char * or void *, and the compiler will give an error
- if we get it wrong and they happen to be defined in some header
- file e.g. <stdio.h>. We can't include <stdlib.h> here because
- it has some incompatability with our own includes, e.g. size_t or
- whatever. So we just punt. This causes malloc and realloc to
- default to returning "int", which works for most cases we care
- about. FIXME-somehow. */
-/* #include <stdlib.h> */
-#include "gmalloc.h"
-
-extern char *getenv();
-
-FILE *mallstream;
-char mallenv[] = "MALLOC_TRACE";
-static char mallbuf[BUFSIZ]; /* Buffer for the output */
-
-/* Address to breakpoint on accesses to... */
-PTR mallwatch;
-
-/* Old hook values. */
-static void EXFUN((*old_free_hook), (PTR ptr));
-static PTR EXFUN((*old_malloc_hook), (size_t size));
-static PTR EXFUN((*old_realloc_hook), (PTR ptr, size_t size));
-
-/* This function is called when the block being alloc'd, realloc'd, or
- freed has an address matching the variable "mallwatch". In a debugger,
- set "mallwatch" to the address of interest, then put a breakpoint on
- tr_break. */
-
-void
-tr_break()
-{
- ;
-}
-
-static void
-DEFUN(tr_freehook, (ptr), PTR ptr)
-{
- fprintf(mallstream, "- %08x\n", ptr); /* Be sure to print it first */
- if (ptr == mallwatch)
- tr_break();
- __free_hook = old_free_hook;
- free(ptr);
- __free_hook = tr_freehook;
-}
-
-static PTR
-DEFUN(tr_mallochook, (size), size_t size)
-{
- PTR hdr;
-
- __malloc_hook = old_malloc_hook;
- hdr = (PTR) malloc(size);
- __malloc_hook = tr_mallochook;
-
- /* We could be printing a NULL here; that's OK */
- fprintf (mallstream, "+ %08x %x\n", hdr, size);
-
- if (hdr == mallwatch)
- tr_break();
-
- return hdr;
-}
-
-static PTR
-DEFUN(tr_reallochook, (ptr, size), PTR ptr AND size_t size)
-{
- PTR hdr;
-
- if (ptr == mallwatch)
- tr_break();
-
- __free_hook = old_free_hook;
- __malloc_hook = old_malloc_hook;
- __realloc_hook = old_realloc_hook;
- hdr = (PTR) realloc(ptr, size);
- __free_hook = tr_freehook;
- __malloc_hook = tr_mallochook;
- __realloc_hook = tr_reallochook;
- if (hdr == NULL) {
- fprintf (mallstream, "! %08x %x\n", ptr, size); /* Failed realloc */
- } else {
- fprintf (mallstream, "< %08x\n> %08x %x\n", ptr, hdr, size);
- }
-
- if (hdr == mallwatch)
- tr_break();
-
- return hdr;
-}
-
-/* We enable tracing if either the environment variable MALLOC_TRACE
- is set, or if the variable mallwatch has been patched to an address
- that the debugging user wants us to stop on. When patching mallwatch,
- don't forget to set a breakpoint on tr_break! */
-
-void
-mtrace()
-{
- char *mallfile;
-
- mallfile = getenv (mallenv);
- if (mallfile || mallwatch) {
- mallstream = fopen (mallfile? mallfile: "/dev/null", "w");
- if (mallstream) {
- /* Be sure it doesn't malloc its buffer! */
- setbuf (mallstream, mallbuf);
- fprintf (mallstream, "= Start\n");
- old_free_hook = __free_hook;
- __free_hook = tr_freehook;
- old_malloc_hook = __malloc_hook;
- __malloc_hook = tr_mallochook;
- old_realloc_hook = __realloc_hook;
- __realloc_hook = tr_reallochook;
- }
- }
-}
diff --git a/gdb/munch b/gdb/munch
deleted file mode 100755
index 7b1202f..0000000
--- a/gdb/munch
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-# create an initialization procedure from a list of .o files
-
-echo '/* Do not modify this file. It is created automatically by "munch". */'
-echo 'void initialize_all_files () {'
-
-NMOPT=""
-case $1 in
-MUNCH_NM=*)
- MUNCH_NM=`echo $1 | sed 's/MUNCH_NM=//'`; shift ;;
--*)
- NMOPT=$1; shift ;;
-esac
-
-# make it easy to use a different nm, e.g. for cross-developing
-
-MUNCH_NM="${MUNCH_NM-nm} $NMOPT"
-if test "`$MUNCH_NM main.o | egrep main | egrep FUNC | egrep GLOB`" != "" ; then
- # System V Release 4 style nm
- $MUNCH_NM $* | egrep '|__?initialize_' | egrep FUNC | \
- sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\).*$/ {extern void \1 (); \1 ();}/'
-elif test "`$MUNCH_NM main.o | egrep 'T _?main$'`" = "" ; then
- # System V style nm
- shift;
- $MUNCH_NM $* | egrep '^(.*[^a-zA-Z_]_|_)_?initialize_.*\.text' | \
- sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/ {extern void \1 (); \1 ();}/'
-else
- # BSD style nm
- # We now accept either text or data symbols, since the RT/PC uses data.
- $MUNCH_NM -p $* | egrep '[TD] *_?_initialize_' | \
- sed -e 's/^.*[TD] *_*\(.*\)/ {extern void _\1 (); _\1 ();}/'
-fi
-
-echo '}'
diff --git a/gdb/news-xdep.c b/gdb/news-xdep.c
deleted file mode 100644
index 6740b1b..0000000
--- a/gdb/news-xdep.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Low level interface to ptrace, for GDB when running under Unix.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifdef __GNUC__
-/* Bad implement execle(3). It's depend for "/bin/cc".
-
- main()
- {
- printf("execle:\n");
- execle(FILE, ARGS, envp);
- exit(1);
- }
-
- GCC:
- link a6,#0
- pea LC5 ; call printf
- jbsr _printf
- ; ; (not popd stack)
- pea _envp ; call execle
- clrl sp@-
- pea LC4
- pea LC4
- pea LC4
- pea LC3
- pea LC6
- jbsr _execle
- addw #32,sp ; delayed pop !!
-
- /bin/cc:
- link.l fp,#L23
- movem.l #L24,(sp)
- pea L26 ; call printf
- jbsr _printf
- addq.l #4,sp ; <--- popd stack !!
- pea _envp ; call execle
- clr.l -(sp)
- pea L32
-
- */
-
-execle(name, args)
- char *name, *args;
-{
- register char **env = &args;
- while (*env++)
- ;
- execve(name, (char **)&args, (char **)*env);
-}
-#endif
diff --git a/gdb/nindy-tdep.c b/gdb/nindy-tdep.c
deleted file mode 100644
index 8f70831..0000000
--- a/gdb/nindy-tdep.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Target-machine dependent code for the NINDY monitor running on the Intel 960
- Copyright (C) 1991 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Miscellaneous NINDY-dependent routines.
- Some replace macros normally defined in "tm.h". */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-
-/* 'start_frame' is a variable in the NINDY runtime startup routine
- that contains the frame pointer of the 'start' routine (the routine
- that calls 'main'). By reading its contents out of remote memory,
- we can tell where the frame chain ends: backtraces should halt before
- they display this frame. */
-
-int
-nindy_frame_chain_valid (chain, curframe)
- unsigned int chain;
- FRAME curframe;
-{
- struct symbol *sym;
- int i;
-
- /* crtnindy.o is an assembler module that is assumed to be linked
- * first in an i80960 executable. It contains the true entry point;
- * it performs startup up initialization and then calls 'main'.
- *
- * 'sf' is the name of a variable in crtnindy.o that is set
- * during startup to the address of the first frame.
- *
- * 'a' is the address of that variable in 80960 memory.
- */
- static char sf[] = "start_frame";
- CORE_ADDR a;
-
-
- chain &= ~0x3f; /* Zero low 6 bits because previous frame pointers
- contain return status info in them. */
- if ( chain == 0 ){
- return 0;
- }
-
- sym = lookup_symbol(sf, 0, VAR_NAMESPACE, (int *)NULL,
- (struct symtab **)NULL);
- if ( sym != 0 ){
- a = sym->value.value;
- } else {
- i = lookup_misc_func (sf);
- if (i < 0)
- return 0;
- a = misc_function_vector[i].address;
- }
-
- return ( chain != read_memory_integer(a,4) );
-}
diff --git a/gdb/np1-opcode.h b/gdb/np1-opcode.h
deleted file mode 100755
index 7e1001d..0000000
--- a/gdb/np1-opcode.h
+++ /dev/null
@@ -1,422 +0,0 @@
-/* Print GOULD NPL instructions for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-struct gld_opcode
-{
- char *name;
- unsigned long opcode;
- unsigned long mask;
- char *args;
- int length;
-};
-
-/* We store four bytes of opcode for all opcodes because that
- is the most any of them need. The actual length of an instruction
- is always at least 2 bytes, and at most four. The length of the
- instruction is based on the opcode.
-
- The mask component is a mask saying which bits must match
- particular opcode in order for an instruction to be an instance
- of that opcode.
-
- The args component is a string containing characters
- that are used to format the arguments to the instruction. */
-
-/* Kinds of operands:
- r Register in first field
- R Register in second field
- b Base register in first field
- B Base register in second field
- v Vector register in first field
- V Vector register in first field
- A Optional address register (base register)
- X Optional index register
- I Immediate data (16bits signed)
- O Offset field (16bits signed)
- h Offset field (15bits signed)
- d Offset field (14bits signed)
- S Shift count field
-
- any other characters are printed as is...
-*/
-
-/* The assembler requires that this array be sorted as follows:
- all instances of the same mnemonic must be consecutive.
- All instances of the same mnemonic with the same number of operands
- must be consecutive.
- */
-struct gld_opcode gld_opcodes[] =
-{
-{ "lb", 0xb4080000, 0xfc080000, "r,xOA,X", 4 },
-{ "lnb", 0xb8080000, 0xfc080000, "r,xOA,X", 4 },
-{ "lbs", 0xec080000, 0xfc080000, "r,xOA,X", 4 },
-{ "lh", 0xb4000001, 0xfc080001, "r,xOA,X", 4 },
-{ "lnh", 0xb8000001, 0xfc080001, "r,xOA,X", 4 },
-{ "lw", 0xb4000000, 0xfc080000, "r,xOA,X", 4 },
-{ "lnw", 0xb8000000, 0xfc080000, "r,xOA,X", 4 },
-{ "ld", 0xb4000002, 0xfc080002, "r,xOA,X", 4 },
-{ "lnd", 0xb8000002, 0xfc080002, "r,xOA,X", 4 },
-{ "li", 0xf8000000, 0xfc7f0000, "r,I", 4 },
-{ "lpa", 0x50080000, 0xfc080000, "r,xOA,X", 4 },
-{ "la", 0x50000000, 0xfc080000, "r,xOA,X", 4 },
-{ "labr", 0x58080000, 0xfc080000, "b,xOA,X", 4 },
-{ "lbp", 0x90080000, 0xfc080000, "r,xOA,X", 4 },
-{ "lhp", 0x90000001, 0xfc080001, "r,xOA,X", 4 },
-{ "lwp", 0x90000000, 0xfc080000, "r,xOA,X", 4 },
-{ "ldp", 0x90000002, 0xfc080002, "r,xOA,X", 4 },
-{ "suabr", 0x58000000, 0xfc080000, "b,xOA,X", 4 },
-{ "lf", 0xbc000000, 0xfc080000, "r,xOA,X", 4 },
-{ "lfbr", 0xbc080000, 0xfc080000, "b,xOA,X", 4 },
-{ "lwbr", 0x5c000000, 0xfc080000, "b,xOA,X", 4 },
-{ "stb", 0xd4080000, 0xfc080000, "r,xOA,X", 4 },
-{ "sth", 0xd4000001, 0xfc080001, "r,xOA,X", 4 },
-{ "stw", 0xd4000000, 0xfc080000, "r,xOA,X", 4 },
-{ "std", 0xd4000002, 0xfc080002, "r,xOA,X", 4 },
-{ "stf", 0xdc000000, 0xfc080000, "r,xOA,X", 4 },
-{ "stfbr", 0xdc080000, 0xfc080000, "b,xOA,X", 4 },
-{ "stwbr", 0x54000000, 0xfc080000, "b,xOA,X", 4 },
-{ "zmb", 0xd8080000, 0xfc080000, "r,xOA,X", 4 },
-{ "zmh", 0xd8000001, 0xfc080001, "r,xOA,X", 4 },
-{ "zmw", 0xd8000000, 0xfc080000, "r,xOA,X", 4 },
-{ "zmd", 0xd8000002, 0xfc080002, "r,xOA,X", 4 },
-{ "stbp", 0x94080000, 0xfc080000, "r,xOA,X", 4 },
-{ "sthp", 0x94000001, 0xfc080001, "r,xOA,X", 4 },
-{ "stwp", 0x94000000, 0xfc080000, "r,xOA,X", 4 },
-{ "stdp", 0x94000002, 0xfc080002, "r,xOA,X", 4 },
-{ "lil", 0xf80b0000, 0xfc7f0000, "r,D", 4 },
-{ "lwsl1", 0xec000000, 0xfc080000, "r,xOA,X", 4 },
-{ "lwsl2", 0xfc000000, 0xfc080000, "r,xOA,X", 4 },
-{ "lwsl3", 0xfc080000, 0xfc080000, "r,xOA,X", 4 },
-
-{ "lvb", 0xb0080000, 0xfc080000, "v,xOA,X", 4 },
-{ "lvh", 0xb0000001, 0xfc080001, "v,xOA,X", 4 },
-{ "lvw", 0xb0000000, 0xfc080000, "v,xOA,X", 4 },
-{ "lvd", 0xb0000002, 0xfc080002, "v,xOA,X", 4 },
-{ "liv", 0x3c040000, 0xfc0f0000, "v,R", 2 },
-{ "livf", 0x3c080000, 0xfc0f0000, "v,R", 2 },
-{ "stvb", 0xd0080000, 0xfc080000, "v,xOA,X", 4 },
-{ "stvh", 0xd0000001, 0xfc080001, "v,xOA,X", 4 },
-{ "stvw", 0xd0000000, 0xfc080000, "v,xOA,X", 4 },
-{ "stvd", 0xd0000002, 0xfc080002, "v,xOA,X", 4 },
-
-{ "trr", 0x2c000000, 0xfc0f0000, "r,R", 2 },
-{ "trn", 0x2c040000, 0xfc0f0000, "r,R", 2 },
-{ "trnd", 0x2c0c0000, 0xfc0f0000, "r,R", 2 },
-{ "trabs", 0x2c010000, 0xfc0f0000, "r,R", 2 },
-{ "trabsd", 0x2c090000, 0xfc0f0000, "r,R", 2 },
-{ "trc", 0x2c030000, 0xfc0f0000, "r,R", 2 },
-{ "xcr", 0x28040000, 0xfc0f0000, "r,R", 2 },
-{ "cxcr", 0x2c060000, 0xfc0f0000, "r,R", 2 },
-{ "cxcrd", 0x2c0e0000, 0xfc0f0000, "r,R", 2 },
-{ "tbrr", 0x2c020000, 0xfc0f0000, "r,B", 2 },
-{ "trbr", 0x28030000, 0xfc0f0000, "b,R", 2 },
-{ "xcbr", 0x28020000, 0xfc0f0000, "b,B", 2 },
-{ "tbrbr", 0x28010000, 0xfc0f0000, "b,B", 2 },
-
-{ "trvv", 0x28050000, 0xfc0f0000, "v,V", 2 },
-{ "trvvn", 0x2c050000, 0xfc0f0000, "v,V", 2 },
-{ "trvvnd", 0x2c0d0000, 0xfc0f0000, "v,V", 2 },
-{ "trvab", 0x2c070000, 0xfc0f0000, "v,V", 2 },
-{ "trvabd", 0x2c0f0000, 0xfc0f0000, "v,V", 2 },
-{ "cmpv", 0x14060000, 0xfc0f0000, "v,V", 2 },
-{ "expv", 0x14070000, 0xfc0f0000, "v,V", 2 },
-{ "mrvvlt", 0x10030000, 0xfc0f0000, "v,V", 2 },
-{ "mrvvle", 0x10040000, 0xfc0f0000, "v,V", 2 },
-{ "mrvvgt", 0x14030000, 0xfc0f0000, "v,V", 2 },
-{ "mrvvge", 0x14040000, 0xfc0f0000, "v,V", 2 },
-{ "mrvveq", 0x10050000, 0xfc0f0000, "v,V", 2 },
-{ "mrvvne", 0x10050000, 0xfc0f0000, "v,V", 2 },
-{ "mrvrlt", 0x100d0000, 0xfc0f0000, "v,R", 2 },
-{ "mrvrle", 0x100e0000, 0xfc0f0000, "v,R", 2 },
-{ "mrvrgt", 0x140d0000, 0xfc0f0000, "v,R", 2 },
-{ "mrvrge", 0x140e0000, 0xfc0f0000, "v,R", 2 },
-{ "mrvreq", 0x100f0000, 0xfc0f0000, "v,R", 2 },
-{ "mrvrne", 0x140f0000, 0xfc0f0000, "v,R", 2 },
-{ "trvr", 0x140b0000, 0xfc0f0000, "r,V", 2 },
-{ "trrv", 0x140c0000, 0xfc0f0000, "v,R", 2 },
-
-{ "bu", 0x40000000, 0xff880000, "xOA,X", 4 },
-{ "bns", 0x70080000, 0xff880000, "xOA,X", 4 },
-{ "bnco", 0x70880000, 0xff880000, "xOA,X", 4 },
-{ "bge", 0x71080000, 0xff880000, "xOA,X", 4 },
-{ "bne", 0x71880000, 0xff880000, "xOA,X", 4 },
-{ "bunge", 0x72080000, 0xff880000, "xOA,X", 4 },
-{ "bunle", 0x72880000, 0xff880000, "xOA,X", 4 },
-{ "bgt", 0x73080000, 0xff880000, "xOA,X", 4 },
-{ "bnany", 0x73880000, 0xff880000, "xOA,X", 4 },
-{ "bs" , 0x70000000, 0xff880000, "xOA,X", 4 },
-{ "bco", 0x70800000, 0xff880000, "xOA,X", 4 },
-{ "blt", 0x71000000, 0xff880000, "xOA,X", 4 },
-{ "beq", 0x71800000, 0xff880000, "xOA,X", 4 },
-{ "buge", 0x72000000, 0xff880000, "xOA,X", 4 },
-{ "bult", 0x72800000, 0xff880000, "xOA,X", 4 },
-{ "ble", 0x73000000, 0xff880000, "xOA,X", 4 },
-{ "bany", 0x73800000, 0xff880000, "xOA,X", 4 },
-{ "brlnk", 0x44000000, 0xfc080000, "r,xOA,X", 4 },
-{ "bib", 0x48000000, 0xfc080000, "r,xOA,X", 4 },
-{ "bih", 0x48080000, 0xfc080000, "r,xOA,X", 4 },
-{ "biw", 0x4c000000, 0xfc080000, "r,xOA,X", 4 },
-{ "bid", 0x4c080000, 0xfc080000, "r,xOA,X", 4 },
-{ "bivb", 0x60000000, 0xfc080000, "r,xOA,X", 4 },
-{ "bivh", 0x60080000, 0xfc080000, "r,xOA,X", 4 },
-{ "bivw", 0x64000000, 0xfc080000, "r,xOA,X", 4 },
-{ "bivd", 0x64080000, 0xfc080000, "r,xOA,X", 4 },
-{ "bvsb", 0x68000000, 0xfc080000, "r,xOA,X", 4 },
-{ "bvsh", 0x68080000, 0xfc080000, "r,xOA,X", 4 },
-{ "bvsw", 0x6c000000, 0xfc080000, "r,xOA,X", 4 },
-{ "bvsd", 0x6c080000, 0xfc080000, "r,xOA,X", 4 },
-
-{ "camb", 0x80080000, 0xfc080000, "r,xOA,X", 4 },
-{ "camh", 0x80000001, 0xfc080001, "r,xOA,X", 4 },
-{ "camw", 0x80000000, 0xfc080000, "r,xOA,X", 4 },
-{ "camd", 0x80000002, 0xfc080002, "r,xOA,X", 4 },
-{ "car", 0x10000000, 0xfc0f0000, "r,R", 2 },
-{ "card", 0x14000000, 0xfc0f0000, "r,R", 2 },
-{ "ci", 0xf8050000, 0xfc7f0000, "r,I", 4 },
-{ "chkbnd", 0x5c080000, 0xfc080000, "r,xOA,X", 4 },
-
-{ "cavv", 0x10010000, 0xfc0f0000, "v,V", 2 },
-{ "cavr", 0x10020000, 0xfc0f0000, "v,R", 2 },
-{ "cavvd", 0x10090000, 0xfc0f0000, "v,V", 2 },
-{ "cavrd", 0x100b0000, 0xfc0f0000, "v,R", 2 },
-
-{ "anmb", 0x84080000, 0xfc080000, "r,xOA,X", 4 },
-{ "anmh", 0x84000001, 0xfc080001, "r,xOA,X", 4 },
-{ "anmw", 0x84000000, 0xfc080000, "r,xOA,X", 4 },
-{ "anmd", 0x84000002, 0xfc080002, "r,xOA,X", 4 },
-{ "anr", 0x04000000, 0xfc0f0000, "r,R", 2 },
-{ "ani", 0xf8080000, 0xfc7f0000, "r,I", 4 },
-{ "ormb", 0xb8080000, 0xfc080000, "r,xOA,X", 4 },
-{ "ormh", 0xb8000001, 0xfc080001, "r,xOA,X", 4 },
-{ "ormw", 0xb8000000, 0xfc080000, "r,xOA,X", 4 },
-{ "ormd", 0xb8000002, 0xfc080002, "r,xOA,X", 4 },
-{ "orr", 0x08000000, 0xfc0f0000, "r,R", 2 },
-{ "oi", 0xf8090000, 0xfc7f0000, "r,I", 4 },
-{ "eomb", 0x8c080000, 0xfc080000, "r,xOA,X", 4 },
-{ "eomh", 0x8c000001, 0xfc080001, "r,xOA,X", 4 },
-{ "eomw", 0x8c000000, 0xfc080000, "r,xOA,X", 4 },
-{ "eomd", 0x8c000002, 0xfc080002, "r,xOA,X", 4 },
-{ "eor", 0x0c000000, 0xfc0f0000, "r,R", 2 },
-{ "eoi", 0xf80a0000, 0xfc7f0000, "r,I", 4 },
-
-{ "anvv", 0x04010000, 0xfc0f0000, "v,V", 2 },
-{ "anvr", 0x04020000, 0xfc0f0000, "v,R", 2 },
-{ "orvv", 0x08010000, 0xfc0f0000, "v,V", 2 },
-{ "orvr", 0x08020000, 0xfc0f0000, "v,R", 2 },
-{ "eovv", 0x0c010000, 0xfc0f0000, "v,V", 2 },
-{ "eovr", 0x0c020000, 0xfc0f0000, "v,R", 2 },
-
-{ "sacz", 0x100c0000, 0xfc0f0000, "r,R", 2 },
-{ "sla", 0x1c400000, 0xfc600000, "r,S", 2 },
-{ "sll", 0x1c600000, 0xfc600000, "r,S", 2 },
-{ "slc", 0x24400000, 0xfc600000, "r,S", 2 },
-{ "slad", 0x20400000, 0xfc600000, "r,S", 2 },
-{ "slld", 0x20600000, 0xfc600000, "r,S", 2 },
-{ "sra", 0x1c000000, 0xfc600000, "r,S", 2 },
-{ "srl", 0x1c200000, 0xfc600000, "r,S", 2 },
-{ "src", 0x24000000, 0xfc600000, "r,S", 2 },
-{ "srad", 0x20000000, 0xfc600000, "r,S", 2 },
-{ "srld", 0x20200000, 0xfc600000, "r,S", 2 },
-{ "sda", 0x3c030000, 0xfc0f0000, "r,R", 2 },
-{ "sdl", 0x3c020000, 0xfc0f0000, "r,R", 2 },
-{ "sdc", 0x3c010000, 0xfc0f0000, "r,R", 2 },
-{ "sdad", 0x3c0b0000, 0xfc0f0000, "r,R", 2 },
-{ "sdld", 0x3c0a0000, 0xfc0f0000, "r,R", 2 },
-
-{ "svda", 0x3c070000, 0xfc0f0000, "v,R", 2 },
-{ "svdl", 0x3c060000, 0xfc0f0000, "v,R", 2 },
-{ "svdc", 0x3c050000, 0xfc0f0000, "v,R", 2 },
-{ "svdad", 0x3c0e0000, 0xfc0f0000, "v,R", 2 },
-{ "svdld", 0x3c0d0000, 0xfc0f0000, "v,R", 2 },
-
-{ "sbm", 0xac080000, 0xfc080000, "f,xOA,X", 4 },
-{ "zbm", 0xac000000, 0xfc080000, "f,xOA,X", 4 },
-{ "tbm", 0xa8080000, 0xfc080000, "f,xOA,X", 4 },
-{ "incmb", 0xa0000000, 0xfc080000, "xOA,X", 4 },
-{ "incmh", 0xa0080000, 0xfc080000, "xOA,X", 4 },
-{ "incmw", 0xa4000000, 0xfc080000, "xOA,X", 4 },
-{ "incmd", 0xa4080000, 0xfc080000, "xOA,X", 4 },
-{ "sbmd", 0x7c080000, 0xfc080000, "r,xOA,X", 4 },
-{ "zbmd", 0x7c000000, 0xfc080000, "r,xOA,X", 4 },
-{ "tbmd", 0x78080000, 0xfc080000, "r,xOA,X", 4 },
-
-{ "ssm", 0x9c080000, 0xfc080000, "f,xOA,X", 4 },
-{ "zsm", 0x9c000000, 0xfc080000, "f,xOA,X", 4 },
-{ "tsm", 0x98080000, 0xfc080000, "f,xOA,X", 4 },
-
-{ "admb", 0xc8080000, 0xfc080000, "r,xOA,X", 4 },
-{ "admh", 0xc8000001, 0xfc080001, "r,xOA,X", 4 },
-{ "admw", 0xc8000000, 0xfc080000, "r,xOA,X", 4 },
-{ "admd", 0xc8000002, 0xfc080002, "r,xOA,X", 4 },
-{ "adr", 0x38000000, 0xfc0f0000, "r,R", 2 },
-{ "armb", 0xe8080000, 0xfc080000, "r,xOA,X", 4 },
-{ "armh", 0xe8000001, 0xfc080001, "r,xOA,X", 4 },
-{ "armw", 0xe8000000, 0xfc080000, "r,xOA,X", 4 },
-{ "armd", 0xe8000002, 0xfc080002, "r,xOA,X", 4 },
-{ "adi", 0xf8010000, 0xfc0f0000, "r,I", 4 },
-{ "sumb", 0xcc080000, 0xfc080000, "r,xOA,X", 4 },
-{ "sumh", 0xcc000001, 0xfc080001, "r,xOA,X", 4 },
-{ "sumw", 0xcc000000, 0xfc080000, "r,xOA,X", 4 },
-{ "sumd", 0xcc000002, 0xfc080002, "r,xOA,X", 4 },
-{ "sur", 0x3c000000, 0xfc0f0000, "r,R", 2 },
-{ "sui", 0xf8020000, 0xfc0f0000, "r,I", 4 },
-{ "mpmb", 0xc0080000, 0xfc080000, "r,xOA,X", 4 },
-{ "mpmh", 0xc0000001, 0xfc080001, "r,xOA,X", 4 },
-{ "mpmw", 0xc0000000, 0xfc080000, "r,xOA,X", 4 },
-{ "mpr", 0x38020000, 0xfc0f0000, "r,R", 2 },
-{ "mprd", 0x3c0f0000, 0xfc0f0000, "r,R", 2 },
-{ "mpi", 0xf8030000, 0xfc0f0000, "r,I", 4 },
-{ "dvmb", 0xc4080000, 0xfc080000, "r,xOA,X", 4 },
-{ "dvmh", 0xc4000001, 0xfc080001, "r,xOA,X", 4 },
-{ "dvmw", 0xc4000000, 0xfc080000, "r,xOA,X", 4 },
-{ "dvr", 0x380a0000, 0xfc0f0000, "r,R", 2 },
-{ "dvi", 0xf8040000, 0xfc0f0000, "r,I", 4 },
-{ "exs", 0x38080000, 0xfc0f0000, "r,R", 2 },
-
-{ "advv", 0x30000000, 0xfc0f0000, "v,V", 2 },
-{ "advvd", 0x30080000, 0xfc0f0000, "v,V", 2 },
-{ "adrv", 0x34000000, 0xfc0f0000, "v,R", 2 },
-{ "adrvd", 0x34080000, 0xfc0f0000, "v,R", 2 },
-{ "suvv", 0x30010000, 0xfc0f0000, "v,V", 2 },
-{ "suvvd", 0x30090000, 0xfc0f0000, "v,V", 2 },
-{ "surv", 0x34010000, 0xfc0f0000, "v,R", 2 },
-{ "survd", 0x34090000, 0xfc0f0000, "v,R", 2 },
-{ "mpvv", 0x30020000, 0xfc0f0000, "v,V", 2 },
-{ "mprv", 0x34020000, 0xfc0f0000, "v,R", 2 },
-
-{ "adfw", 0xe0080000, 0xfc080000, "r,xOA,X", 4 },
-{ "adfd", 0xe0080002, 0xfc080002, "r,xOA,X", 4 },
-{ "adrfw", 0x38010000, 0xfc0f0000, "r,R", 2 },
-{ "adrfd", 0x38090000, 0xfc0f0000, "r,R", 2 },
-{ "surfw", 0xe0000000, 0xfc080000, "r,xOA,X", 4 },
-{ "surfd", 0xe0000002, 0xfc080002, "r,xOA,X", 4 },
-{ "surfw", 0x38030000, 0xfc0f0000, "r,R", 2 },
-{ "surfd", 0x380b0000, 0xfc0f0000, "r,R", 2 },
-{ "mpfw", 0xe4080000, 0xfc080000, "r,xOA,X", 4 },
-{ "mpfd", 0xe4080002, 0xfc080002, "r,xOA,X", 4 },
-{ "mprfw", 0x38060000, 0xfc0f0000, "r,R", 2 },
-{ "mprfd", 0x380e0000, 0xfc0f0000, "r,R", 2 },
-{ "rfw", 0xe4000000, 0xfc080000, "r,xOA,X", 4 },
-{ "rfd", 0xe4000002, 0xfc080002, "r,xOA,X", 4 },
-{ "rrfw", 0x0c0e0000, 0xfc0f0000, "r", 2 },
-{ "rrfd", 0x0c0f0000, 0xfc0f0000, "r", 2 },
-
-{ "advvfw", 0x30040000, 0xfc0f0000, "v,V", 2 },
-{ "advvfd", 0x300c0000, 0xfc0f0000, "v,V", 2 },
-{ "adrvfw", 0x34040000, 0xfc0f0000, "v,R", 2 },
-{ "adrvfd", 0x340c0000, 0xfc0f0000, "v,R", 2 },
-{ "suvvfw", 0x30050000, 0xfc0f0000, "v,V", 2 },
-{ "suvvfd", 0x300d0000, 0xfc0f0000, "v,V", 2 },
-{ "survfw", 0x34050000, 0xfc0f0000, "v,R", 2 },
-{ "survfd", 0x340d0000, 0xfc0f0000, "v,R", 2 },
-{ "mpvvfw", 0x30060000, 0xfc0f0000, "v,V", 2 },
-{ "mpvvfd", 0x300e0000, 0xfc0f0000, "v,V", 2 },
-{ "mprvfw", 0x34060000, 0xfc0f0000, "v,R", 2 },
-{ "mprvfd", 0x340e0000, 0xfc0f0000, "v,R", 2 },
-{ "rvfw", 0x30070000, 0xfc0f0000, "v", 2 },
-{ "rvfd", 0x300f0000, 0xfc0f0000, "v", 2 },
-
-{ "fltw", 0x38070000, 0xfc0f0000, "r,R", 2 },
-{ "fltd", 0x380f0000, 0xfc0f0000, "r,R", 2 },
-{ "fixw", 0x38050000, 0xfc0f0000, "r,R", 2 },
-{ "fixd", 0x380d0000, 0xfc0f0000, "r,R", 2 },
-{ "cfpds", 0x3c090000, 0xfc0f0000, "r,R", 2 },
-
-{ "fltvw", 0x080d0000, 0xfc0f0000, "v,V", 2 },
-{ "fltvd", 0x080f0000, 0xfc0f0000, "v,V", 2 },
-{ "fixvw", 0x080c0000, 0xfc0f0000, "v,V", 2 },
-{ "fixvd", 0x080e0000, 0xfc0f0000, "v,V", 2 },
-{ "cfpvds", 0x0c0d0000, 0xfc0f0000, "v,V", 2 },
-
-{ "orvrn", 0x000a0000, 0xfc0f0000, "r,V", 2 },
-{ "andvrn", 0x00080000, 0xfc0f0000, "r,V", 2 },
-{ "frsteq", 0x04090000, 0xfc0f0000, "r,V", 2 },
-{ "sigma", 0x0c080000, 0xfc0f0000, "r,V", 2 },
-{ "sigmad", 0x0c0a0000, 0xfc0f0000, "r,V", 2 },
-{ "sigmf", 0x08080000, 0xfc0f0000, "r,V", 2 },
-{ "sigmfd", 0x080a0000, 0xfc0f0000, "r,V", 2 },
-{ "prodf", 0x04080000, 0xfc0f0000, "r,V", 2 },
-{ "prodfd", 0x040a0000, 0xfc0f0000, "r,V", 2 },
-{ "maxv", 0x10080000, 0xfc0f0000, "r,V", 2 },
-{ "maxvd", 0x100a0000, 0xfc0f0000, "r,V", 2 },
-{ "minv", 0x14080000, 0xfc0f0000, "r,V", 2 },
-{ "minvd", 0x140a0000, 0xfc0f0000, "r,V", 2 },
-
-{ "lpsd", 0xf0000000, 0xfc080000, "xOA,X", 4 },
-{ "ldc", 0xf0080000, 0xfc080000, "xOA,X", 4 },
-{ "spm", 0x040c0000, 0xfc0f0000, "r", 2 },
-{ "rpm", 0x040d0000, 0xfc0f0000, "r", 2 },
-{ "tritr", 0x00070000, 0xfc0f0000, "r", 2 },
-{ "trrit", 0x00060000, 0xfc0f0000, "r", 2 },
-{ "rpswt", 0x04080000, 0xfc0f0000, "r", 2 },
-{ "exr", 0xf8070000, 0xfc0f0000, "", 4 },
-{ "halt", 0x00000000, 0xfc0f0000, "", 2 },
-{ "wait", 0x00010000, 0xfc0f0000, "", 2 },
-{ "nop", 0x00020000, 0xfc0f0000, "", 2 },
-{ "eiae", 0x00030000, 0xfc0f0000, "", 2 },
-{ "efae", 0x000d0000, 0xfc0f0000, "", 2 },
-{ "diae", 0x000e0000, 0xfc0f0000, "", 2 },
-{ "dfae", 0x000f0000, 0xfc0f0000, "", 2 },
-{ "spvc", 0xf8060000, 0xfc0f0000, "r,T,N", 4 },
-{ "rdsts", 0x00090000, 0xfc0f0000, "r", 2 },
-{ "setcpu", 0x000c0000, 0xfc0f0000, "r", 2 },
-{ "cmc", 0x000b0000, 0xfc0f0000, "r", 2 },
-{ "trrcu", 0x00040000, 0xfc0f0000, "r", 2 },
-{ "attnio", 0x00050000, 0xfc0f0000, "", 2 },
-{ "fudit", 0x28080000, 0xfc0f0000, "", 2 },
-{ "break", 0x28090000, 0xfc0f0000, "", 2 },
-{ "frzss", 0x280a0000, 0xfc0f0000, "", 2 },
-{ "ripi", 0x04040000, 0xfc0f0000, "r,R", 2 },
-{ "xcp", 0x04050000, 0xfc0f0000, "r", 2 },
-{ "block", 0x04060000, 0xfc0f0000, "", 2 },
-{ "unblock", 0x04070000, 0xfc0f0000, "", 2 },
-{ "trsc", 0x08060000, 0xfc0f0000, "r,R", 2 },
-{ "tscr", 0x08070000, 0xfc0f0000, "r,R", 2 },
-{ "fq", 0x04080000, 0xfc0f0000, "r", 2 },
-{ "flupte", 0x2c080000, 0xfc0f0000, "r", 2 },
-{ "rviu", 0x040f0000, 0xfc0f0000, "", 2 },
-{ "ldel", 0x280c0000, 0xfc0f0000, "r,R", 2 },
-{ "ldu", 0x280d0000, 0xfc0f0000, "r,R", 2 },
-{ "stdecc", 0x280b0000, 0xfc0f0000, "r,R", 2 },
-{ "trpc", 0x08040000, 0xfc0f0000, "r", 2 },
-{ "tpcr", 0x08050000, 0xfc0f0000, "r", 2 },
-{ "ghalt", 0x0c050000, 0xfc0f0000, "r", 2 },
-{ "grun", 0x0c040000, 0xfc0f0000, "", 2 },
-{ "tmpr", 0x2c0a0000, 0xfc0f0000, "r,R", 2 },
-{ "trmp", 0x2c0b0000, 0xfc0f0000, "r,R", 2 },
-
-{ "trrve", 0x28060000, 0xfc0f0000, "r", 2 },
-{ "trver", 0x28070000, 0xfc0f0000, "r", 2 },
-{ "trvlr", 0x280f0000, 0xfc0f0000, "r", 2 },
-
-{ "linkfl", 0x18000000, 0xfc0f0000, "r,R", 2 },
-{ "linkbl", 0x18020000, 0xfc0f0000, "r,R", 2 },
-{ "linkfp", 0x18010000, 0xfc0f0000, "r,R", 2 },
-{ "linkbp", 0x18030000, 0xfc0f0000, "r,R", 2 },
-{ "linkpl", 0x18040000, 0xfc0f0000, "r,R", 2 },
-{ "ulinkl", 0x18080000, 0xfc0f0000, "r,R", 2 },
-{ "ulinkp", 0x18090000, 0xfc0f0000, "r,R", 2 },
-{ "ulinktl", 0x180a0000, 0xfc0f0000, "r,R", 2 },
-{ "ulinktp", 0x180b0000, 0xfc0f0000, "r,R", 2 },
-};
-
-int numopcodes = sizeof(gld_opcodes) / sizeof(gld_opcodes[0]);
-
-struct gld_opcode *endop = gld_opcodes + sizeof(gld_opcodes) /
- sizeof(gld_opcodes[0]);
diff --git a/gdb/ns32k-opcode.h b/gdb/ns32k-opcode.h
deleted file mode 100644
index c41ff41..0000000
--- a/gdb/ns32k-opcode.h
+++ /dev/null
@@ -1,328 +0,0 @@
-/* ns32k-opcode.h */
-
-#ifndef ns32k_opcodeT
-#define ns32k_opcodeT int
-#endif /* no ns32k_opcodeT */
-
-struct not_wot /* ns32k opcode table: wot to do with this */
- /* particular opcode */
-{
- int obits; /* number of opcode bits */
- int ibits; /* number of instruction bits */
- ns32k_opcodeT code; /* op-code (may be > 8 bits!) */
- char *args; /* how to compile said opcode */
-};
-
-struct not /* ns32k opcode text */
-{
- char * name; /* opcode name: lowercase string [key] */
- struct not_wot detail; /* rest of opcode table [datum] */
-};
-
-/* Instructions look like this:
-
- basic instruction--1, 2, or 3 bytes
- index byte for operand A, if operand A is indexed--1 byte
- index byte for operand B, if operand B is indexed--1 byte
- addressing extension for operand A
- addressing extension for operand B
- implied operands
-
- Operand A is the operand listed first in the following opcode table.
- Operand B is the operand listed second in the following opcode table.
- All instructions have at most 2 general operands, so this is enough.
- The implied operands are associated with operands other than A and B.
-
- Each operand has a digit and a letter.
-
- The digit gives the position in the assembly language. The letter,
- one of the following, tells us what kind of operand it is. */
-
-/* F : 32 bit float
- * L : 64 bit float
- * B : byte
- * W : word
- * D : double-word
- * Q : quad-word
- * d : displacement
- * q : quick
- * i : immediate (8 bits)
- * r : register number (3 bits)
- * p : displacement - pc relative addressing
-*/
-static struct not
-notstrs[] =
-{
- { "absf", 14,24, 0x35be, "1F2F" },
- { "absl", 14,24, 0x34be, "1L2L" },
- { "absb", 14,24, 0x304e, "1B2B" },
- { "absw", 14,24, 0x314e, "1W2W" },
- { "absd", 14,24, 0x334e, "1D2D" },
- { "acbb", 7,16, 0x4c, "2B1q3p" },
- { "acbw", 7,16, 0x4d, "2W1q3p" },
- { "acbd", 7,16, 0x4f, "2D1q3p" },
- { "addf", 14,24, 0x01be, "1F2F" },
- { "addl", 14,24, 0x00be, "1L2L" },
- { "addb", 6,16, 0x00, "1B2B" },
- { "addw", 6,16, 0x01, "1W2W" },
- { "addd", 6,16, 0x03, "1D2D" },
- { "addcb", 6,16, 0x10, "1B2B" },
- { "addcw", 6,16, 0x11, "1W2W" },
- { "addcd", 6,16, 0x13, "1D2D" },
- { "addpb", 14,24, 0x3c4e, "1B2B" },
- { "addpw", 14,24, 0x3d4e, "1W2W" },
- { "addpd", 14,24, 0x3f4e, "1D2D" },
- { "addqb", 7,16, 0x0c, "2B1q" },
- { "addqw", 7,16, 0x0d, "2W1q" },
- { "addqd", 7,16, 0x0f, "2D1q" },
- { "addr", 6,16, 0x27, "1D2D" },
- { "adjspb", 11,16, 0x057c, "1B" },
- { "adjspw", 11,16, 0x057d, "1W" },
- { "adjspd", 11,16, 0x057f, "1D" },
- { "andb", 6,16, 0x28, "1B2B" },
- { "andw", 6,16, 0x29, "1W2W" },
- { "andd", 6,16, 0x2b, "1D2D" },
- { "ashb", 14,24, 0x044e, "1B2B" },
- { "ashw", 14,24, 0x054e, "1B2W" },
- { "ashd", 14,24, 0x074e, "1B2D" },
- { "beq", 8,8, 0x0a, "1p" },
- { "bne", 8,8, 0x1a, "1p" },
- { "bcs", 8,8, 0x2a, "1p" },
- { "bcc", 8,8, 0x3a, "1p" },
- { "bhi", 8,8, 0x4a, "1p" },
- { "bls", 8,8, 0x5a, "1p" },
- { "bgt", 8,8, 0x6a, "1p" },
- { "ble", 8,8, 0x7a, "1p" },
- { "bfs", 8,8, 0x8a, "1p" },
- { "bfc", 8,8, 0x9a, "1p" },
- { "blo", 8,8, 0xaa, "1p" },
- { "bhs", 8,8, 0xba, "1p" },
- { "blt", 8,8, 0xca, "1p" },
- { "bge", 8,8, 0xda, "1p" },
- { "bicb", 6,16, 0x08, "1B2B" },
- { "bicw", 6,16, 0x09, "1W2W" },
- { "bicd", 6,16, 0x0b, "1D2D" },
- { "bicpsrb", 11,16, 0x17c, "1B" },
- { "bicpsrw", 11,16, 0x17d, "1W" },
- { "bispsrb", 11,16, 0x37c, "1B" },
- { "bispsrw", 11,16, 0x37d, "1W" },
- { "bpt", 8,8, 0xf2, "" },
- { "br", 8,8, 0xea, "1p" },
- { "bsr", 8,8, 0x02, "1p" },
- { "caseb", 11,16, 0x77c, "1B" },
- { "casew", 11,16, 0x77d, "1W" },
- { "cased", 11,16, 0x77f, "1D" },
- { "cbitb", 14,24, 0x084e, "1B2D" },
- { "cbitw", 14,24, 0x094e, "1W2D" },
- { "cbitd", 14,24, 0x0b4e, "1D2D" },
- { "cbitib", 14,24, 0x0c4e, "1B2D" },
- { "cbitiw", 14,24, 0x0d4e, "1W2D" },
- { "cbitid", 14,24, 0x0f4e, "1D2D" },
- { "checkb", 11,24, 0x0ee, "2A3B1r" },
- { "checkw", 11,24, 0x1ee, "2A3B1r" },
- { "checkd", 11,24, 0x3ee, "2A3D1r" },
- { "cmpf", 14,24, 0x09be, "1F2F" },
- { "cmpl", 14,24, 0x08be, "1L2L" },
- { "cmpb", 6,16, 0x04, "1B2B" },
- { "cmpw", 6,16, 0x05, "1W2W" },
- { "cmpd", 6,16, 0x07, "1D2D" },
- { "cmpmb", 14,24, 0x04ce, "1D2D3d" },
- { "cmpmw", 14,24, 0x05ce, "1D2D3d" },
- { "cmpmd", 14,24, 0x07ce, "1D2D3d" },
- { "cmpqb", 7,16, 0x1c, "2B1q" },
- { "cmpqw", 7,16, 0x1d, "2W1q" },
- { "cmpqd", 7,16, 0x1f, "2D1q" },
- { "cmpsb", 16,16, 0x040e, "1i" },
- { "cmpsw", 16,16, 0x050e, "1i" },
- { "cmpsd", 16,16, 0x070e, "1i" },
- { "cmpst", 16,16, 0x840e, "1i" },
- { "comb", 14,24, 0x344e, "1B2B" },
- { "comw", 14,24, 0x354e, "1W2W" },
- { "comd", 14,24, 0x374e, "1D2D" },
- { "cvtp", 11,24, 0x036e, "2D3D1r" },
- { "cxp", 8,8, 0x22, "1p" },
- { "cxpd", 11,16, 0x07f, "1D" },
- { "deib", 14,24, 0x2cce, "1B2W" },
- { "deiw", 14,24, 0x2dce, "1W2D" },
- { "deid", 14,24, 0x2fce, "1D2Q" },
- { "dia", 8,8, 0xc2, "" },
- { "divf", 14,24, 0x21be, "1F2F" },
- { "divl", 14,24, 0x20be, "1L2L" },
- { "divb", 14,24, 0x3cce, "1B2B" },
- { "divw", 14,24, 0x3dce, "1W2W" },
- { "divd", 14,24, 0x3fce, "1D2D" },
- { "enter", 8,8, 0x82, "1i2d" },
- { "exit", 8,8, 0x92, "1i" },
- { "extb", 11,24, 0x02e, "2D3B1r4d" },
- { "extw", 11,24, 0x12e, "2D3W1r4d" },
- { "extd", 11,24, 0x32e, "2D3D1r4d" },
- { "extsb", 14,24, 0x0cce, "1D2B3i" },
- { "extsw", 14,24, 0x0dce, "1D2W3i" },
- { "extsd", 14,24, 0x0fce, "1D2D3i" },
- { "ffsb", 14,24, 0x046e, "1B2B" },
- { "ffsw", 14,24, 0x056e, "1W2B" },
- { "ffsd", 14,24, 0x076e, "1D2B" },
- { "flag", 8,8, 0xd2, "" },
- { "floorfb", 14,24, 0x3c3e, "1F2B" },
- { "floorfw", 14,24, 0x3d3e, "1F2W" },
- { "floorfd", 14,24, 0x3f3e, "1F2D" },
- { "floorlb", 14,24, 0x383e, "1L2B" },
- { "floorlw", 14,24, 0x393e, "1L2W" },
- { "floorld", 14,24, 0x3b3e, "1L2D" },
- { "ibitb", 14,24, 0x384e, "1B2D" },
- { "ibitw", 14,24, 0x394e, "1W2D" },
- { "ibitd", 14,24, 0x3b4e, "1D2D" },
- { "indexb", 11,24, 0x42e, "2B3B1r" },
- { "indexw", 11,24, 0x52e, "2W3W1r" },
- { "indexd", 11,24, 0x72e, "2D3D1r" },
- { "insb", 11,24, 0x0ae, "2B3B1r4d" },
- { "insw", 11,24, 0x1ae, "2W3W1r4d" },
- { "insd", 11,24, 0x3ae, "2D3D1r4d" },
- { "inssb", 14,24, 0x08ce, "1B2D3i" },
- { "inssw", 14,24, 0x09ce, "1W2D3i" },
- { "inssd", 14,24, 0x0bce, "1D2D3i" },
- { "jsr", 11,16, 0x67f, "1A" },
- { "jump", 11,16, 0x27f, "1A" },
- { "lfsr", 19,24, 0x00f3e,"1D" },
- { "lmr", 15,24, 0x0b1e, "2D1q" },
- { "lprb", 7,16, 0x6c, "2B1q" },
- { "lprw", 7,16, 0x6d, "2W1q" },
- { "lprd", 7,16, 0x6f, "2D1q" },
- { "lshb", 14,24, 0x144e, "1B2B" },
- { "lshw", 14,24, 0x154e, "1B2W" },
- { "lshd", 14,24, 0x174e, "1B2D" },
- { "meib", 14,24, 0x24ce, "1B2W" },
- { "meiw", 14,24, 0x25ce, "1W2D" },
- { "meid", 14,24, 0x27ce, "1D2Q" },
- { "modb", 14,24, 0x38ce, "1B2B" },
- { "modw", 14,24, 0x39ce, "1W2W" },
- { "modd", 14,24, 0x3bce, "1D2D" },
- { "movf", 14,24, 0x05be, "1F2F" },
- { "movl", 14,24, 0x04be, "1L2L" },
- { "movb", 6,16, 0x14, "1B2B" },
- { "movw", 6,16, 0x15, "1W2W" },
- { "movd", 6,16, 0x17, "1D2D" },
- { "movbf", 14,24, 0x043e, "1B2F" },
- { "movwf", 14,24, 0x053e, "1W2F" },
- { "movdf", 14,24, 0x073e, "1D2F" },
- { "movbl", 14,24, 0x003e, "1B2L" },
- { "movwl", 14,24, 0x013e, "1W2L" },
- { "movdl", 14,24, 0x033e, "1D2L" },
- { "movfl", 14,24, 0x1b3e, "1F2L" },
- { "movlf", 14,24, 0x163e, "1L2F" },
- { "movmb", 14,24, 0x00ce, "1D2D3d" },
- { "movmw", 14,24, 0x01ce, "1D2D3d" },
- { "movmd", 14,24, 0x03ce, "1D2D3d" },
- { "movqb", 7,16, 0x5c, "2B1q" },
- { "movqw", 7,16, 0x5d, "2B1q" },
- { "movqd", 7,16, 0x5f, "2B1q" },
- { "movsb", 16,16, 0x000e, "1i" },
- { "movsw", 16,16, 0x010e, "1i" },
- { "movsd", 16,16, 0x030e, "1i" },
- { "movst", 16,16, 0x800e, "1i" },
- { "movsub", 14,24, 0x0cae, "1A1A" },
- { "movsuw", 14,24, 0x0dae, "1A1A" },
- { "movsud", 14,24, 0x0fae, "1A1A" },
- { "movusb", 14,24, 0x1cae, "1A1A" },
- { "movusw", 14,24, 0x1dae, "1A1A" },
- { "movusd", 14,24, 0x1fae, "1A1A" },
- { "movxbd", 14,24, 0x1cce, "1B2D" },
- { "movxwd", 14,24, 0x1dce, "1W2D" },
- { "movxbw", 14,24, 0x10ce, "1B2W" },
- { "movzbd", 14,24, 0x18ce, "1B2D" },
- { "movzwd", 14,24, 0x19ce, "1W2D" },
- { "movzbw", 14,24, 0x14ce, "1B2W" },
- { "mulf", 14,24, 0x31be, "1F2F" },
- { "mull", 14,24, 0x30be, "1L2L" },
- { "mulb", 14,24, 0x20ce, "1B2B" },
- { "mulw", 14,24, 0x21ce, "1W2W" },
- { "muld", 14,24, 0x23ce, "1D2D" },
- { "negf", 14,24, 0x15be, "1F2F" },
- { "negl", 14,24, 0x14be, "1L2L" },
- { "negb", 14,24, 0x204e, "1B2B" },
- { "negw", 14,24, 0x214e, "1W2W" },
- { "negd", 14,24, 0x234e, "1D2D" },
- { "nop", 8,8, 0xa2, "" },
- { "notb", 14,24, 0x244e, "1B2B" },
- { "notw", 14,24, 0x254e, "1W2W" },
- { "notd", 14,24, 0x274e, "1D2D" },
- { "orb", 6,16, 0x18, "1B1B" },
- { "orw", 6,16, 0x19, "1W1W" },
- { "ord", 6,16, 0x1b, "1D2D" },
- { "quob", 14,24, 0x30ce, "1B2B" },
- { "quow", 14,24, 0x31ce, "1W2W" },
- { "quod", 14,24, 0x33ce, "1D2D" },
- { "rdval", 19,24, 0x0031e,"1A" },
- { "remb", 14,24, 0x34ce, "1B2B" },
- { "remw", 14,24, 0x35ce, "1W2W" },
- { "remd", 14,24, 0x37ce, "1D2D" },
- { "restore", 8,8, 0x72, "1i" },
- { "ret", 8,8, 0x12, "1d" },
- { "reti", 8,8, 0x52, "" },
- { "rett", 8,8, 0x42, "" },
- { "rotb", 14,24, 0x004e, "1B2B" },
- { "rotw", 14,24, 0x014e, "1B2W" },
- { "rotd", 14,24, 0x034e, "1B2D" },
- { "roundfb", 14,24, 0x243e, "1F2B" },
- { "roundfw", 14,24, 0x253e, "1F2W" },
- { "roundfd", 14,24, 0x273e, "1F2D" },
- { "roundlb", 14,24, 0x203e, "1L2B" },
- { "roundlw", 14,24, 0x213e, "1L2W" },
- { "roundld", 14,24, 0x233e, "1L2D" },
- { "rxp", 8,8, 0x32, "1d" },
- { "sCONDb", 7,16, 0x3c, "2B1q" },
- { "sCONDw", 7,16, 0x3d, "2D1q" },
- { "sCONDd", 7,16, 0x3f, "2D1q" },
- { "save", 8,8, 0x62, "1i" },
- { "sbitb", 14,24, 0x184e, "1B2A" },
- { "sbitw", 14,24, 0x194e, "1W2A" },
- { "sbitd", 14,24, 0x1b4e, "1D2A" },
- { "sbitib", 14,24, 0x1c4e, "1B2A" },
- { "sbitiw", 14,24, 0x1d4e, "1W2A" },
- { "sbitid", 14,24, 0x1f4e, "1D2A" },
- { "setcfg", 15,24, 0x0b0e, "5D1q" },
- { "sfsr", 14,24, 0x373e, "5D1D" },
- { "skpsb", 16,16, 0x0c0e, "1i" },
- { "skpsw", 16,16, 0x0d0e, "1i" },
- { "skpsd", 16,16, 0x0f0e, "1i" },
- { "skpst", 16,16, 0x8c0e, "1i" },
- { "smr", 15,24, 0x0f1e, "2D1q" },
- { "sprb", 7,16, 0x2c, "2B1q" },
- { "sprw", 7,16, 0x2d, "2W1q" },
- { "sprd", 7,16, 0x2f, "2D1q" },
- { "subf", 14,24, 0x11be, "1F2F" },
- { "subl", 14,24, 0x10be, "1L2L" },
- { "subb", 6,16, 0x20, "1B2B" },
- { "subw", 6,16, 0x21, "1W2W" },
- { "subd", 6,16, 0x23, "1D2D" },
- { "subcb", 6,16, 0x30, "1B2B" },
- { "subcw", 6,16, 0x31, "1W2W" },
- { "subcd", 6,16, 0x33, "1D2D" },
- { "subpb", 14,24, 0x2c4e, "1B2B" },
- { "subpw", 14,24, 0x2d4e, "1W2W" },
- { "subpd", 14,24, 0x2f4e, "1D2D" },
-#ifdef NS32K_SVC_IMMED_OPERANDS
- { "svc", 8,8, 0xe2, "2i1i" }, /* not really, but unix uses it */
-#else
- { "svc", 8,8, 0xe2, "" }, /* not really, but unix uses it */
-#endif
- { "tbitb", 6,16, 0x34, "1B2A" },
- { "tbitw", 6,16, 0x35, "1W2A" },
- { "tbitd", 6,16, 0x37, "1D2A" },
- { "truncfb", 14,24, 0x2c3e, "1F2B" },
- { "truncfw", 14,24, 0x2d3e, "1F2W" },
- { "truncfd", 14,24, 0x2f3e, "1F2D" },
- { "trunclb", 14,24, 0x283e, "1L2B" },
- { "trunclw", 14,24, 0x293e, "1L2W" },
- { "truncld", 14,24, 0x2b3e, "1L2D" },
- { "wait", 8,8, 0xb2, "" },
- { "wrval", 19,24, 0x0071e,"1A" },
- { "xorb", 6,16, 0x38, "1B2B" },
- { "xorw", 6,16, 0x39, "1W2W" },
- { "xord", 6,16, 0x3b, "1D2D" },
-}; /* notstrs */
-
-/* end: ns32k.opcode.h */
-
-#define MAX_ARGS 4
-#define ARG_LEN 50
diff --git a/gdb/ns32k-pinsn.c b/gdb/ns32k-pinsn.c
deleted file mode 100644
index 8cb2482..0000000
--- a/gdb/ns32k-pinsn.c
+++ /dev/null
@@ -1,522 +0,0 @@
-/* Print 32000 instructions for GDB, the GNU debugger.
- Copyright (C) 1986,1988 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "ns32k-opcode.h"
-#include "gdbcore.h"
-
-/* 32000 instructions are never longer than this. */
-#define MAXLEN 62
-
-/* Number of elements in the opcode table. */
-#define NOPCODES (sizeof notstrs / sizeof notstrs[0])
-
-extern char *reg_names[];
-
-#define NEXT_IS_ADDR '|'
-
-/*
- * extract "count" bits starting "offset" bits
- * into buffer
- */
-
-int
-bit_extract (buffer, offset, count)
- char *buffer;
- int offset;
- int count;
-{
- int result;
- int mask;
- int bit;
-
- buffer += offset >> 3;
- offset &= 7;
- bit = 1;
- result = 0;
- while (count--)
- {
- if ((*buffer & (1 << offset)))
- result |= bit;
- if (++offset == 8)
- {
- offset = 0;
- buffer++;
- }
- bit <<= 1;
- }
- return result;
-}
-
-float
-fbit_extract (buffer, offset, count)
-{
- union {
- int ival;
- float fval;
- } foo;
-
- foo.ival = bit_extract (buffer, offset, 32);
- return foo.fval;
-}
-
-double
-dbit_extract (buffer, offset, count)
-{
- union {
- struct {int low, high; } ival;
- double dval;
- } foo;
-
- foo.ival.low = bit_extract (buffer, offset, 32);
- foo.ival.high = bit_extract (buffer, offset+32, 32);
- return foo.dval;
-}
-
-sign_extend (value, bits)
-{
- value = value & ((1 << bits) - 1);
- return (value & (1 << (bits-1))
- ? value | (~((1 << bits) - 1))
- : value);
-}
-
-flip_bytes (ptr, count)
- char *ptr;
- int count;
-{
- char tmp;
-
- while (count > 0)
- {
- tmp = *ptr;
- ptr[0] = ptr[count-1];
- ptr[count-1] = tmp;
- ptr++;
- count -= 2;
- }
-}
-
-/* Given a character C, does it represent a general addressing mode? */
-#define Is_gen(c) \
- ((c) == 'F' || (c) == 'L' || (c) == 'B' \
- || (c) == 'W' || (c) == 'D' || (c) == 'A')
-
-/* Adressing modes. */
-#define Adrmod_index_byte 0x1c
-#define Adrmod_index_word 0x1d
-#define Adrmod_index_doubleword 0x1e
-#define Adrmod_index_quadword 0x1f
-
-/* Is MODE an indexed addressing mode? */
-#define Adrmod_is_index(mode) \
- (mode == Adrmod_index_byte \
- || mode == Adrmod_index_word \
- || mode == Adrmod_index_doubleword \
- || mode == Adrmod_index_quadword)
-
-
-/* Print the 32000 instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned char buffer[MAXLEN];
- register int i;
- register unsigned char *p;
- register char *d;
- unsigned short first_word;
- int gen, disp;
- int ioffset; /* bits into instruction */
- int aoffset; /* bits into arguments */
- char arg_bufs[MAX_ARGS+1][ARG_LEN];
- int argnum;
- int maxarg;
-
- read_memory (memaddr, buffer, MAXLEN);
-
- first_word = *(unsigned short *) buffer;
- for (i = 0; i < NOPCODES; i++)
- if ((first_word & ((1 << notstrs[i].detail.obits) - 1))
- == notstrs[i].detail.code)
- break;
-
- /* Handle undefined instructions. */
- if (i == NOPCODES)
- {
- fprintf (stream, "0%o", buffer[0]);
- return 1;
- }
-
- fprintf (stream, "%s", notstrs[i].name);
-
- ioffset = notstrs[i].detail.ibits;
- aoffset = notstrs[i].detail.ibits;
- d = notstrs[i].detail.args;
-
- if (*d)
- {
- /* Offset in bits of the first thing beyond each index byte.
- Element 0 is for operand A and element 1 is for operand B.
- The rest are irrelevant, but we put them here so we don't
- index outside the array. */
- int index_offset[MAX_ARGS];
-
- /* 0 for operand A, 1 for operand B, greater for other args. */
- int whicharg = 0;
-
- fputc ('\t', stream);
-
- maxarg = 0;
-
- /* First we have to find and keep track of the index bytes,
- if we are using scaled indexed addressing mode, since the index
- bytes occur right after the basic instruction, not as part
- of the addressing extension. */
- if (Is_gen(d[1]))
- {
- int addr_mode = bit_extract (buffer, ioffset - 5, 5);
-
- if (Adrmod_is_index (addr_mode))
- {
- aoffset += 8;
- index_offset[0] = aoffset;
- }
- }
- if (d[2] && Is_gen(d[3]))
- {
- int addr_mode = bit_extract (buffer, ioffset - 10, 5);
-
- if (Adrmod_is_index (addr_mode))
- {
- aoffset += 8;
- index_offset[1] = aoffset;
- }
- }
-
- while (*d)
- {
- argnum = *d - '1';
- d++;
- if (argnum > maxarg && argnum < MAX_ARGS)
- maxarg = argnum;
- ioffset = print_insn_arg (*d, ioffset, &aoffset, buffer,
- memaddr, arg_bufs[argnum],
- index_offset[whicharg]);
- d++;
- whicharg++;
- }
- for (argnum = 0; argnum <= maxarg; argnum++)
- {
- CORE_ADDR addr;
- char *ch, *index ();
- for (ch = arg_bufs[argnum]; *ch;)
- {
- if (*ch == NEXT_IS_ADDR)
- {
- ++ch;
- addr = atoi (ch);
- print_address (addr, stream);
- while (*ch && *ch != NEXT_IS_ADDR)
- ++ch;
- if (*ch)
- ++ch;
- }
- else
- putc (*ch++, stream);
- }
- if (argnum < maxarg)
- fprintf (stream, ", ");
- }
- }
- return aoffset / 8;
-}
-
-/* Print an instruction operand of category given by d. IOFFSET is
- the bit position below which small (<1 byte) parts of the operand can
- be found (usually in the basic instruction, but for indexed
- addressing it can be in the index byte). AOFFSETP is a pointer to the
- bit position of the addressing extension. BUFFER contains the
- instruction. ADDR is where BUFFER was read from. Put the disassembled
- version of the operand in RESULT. INDEX_OFFSET is the bit position
- of the index byte (it contains garbage if this operand is not a
- general operand using scaled indexed addressing mode). */
-
-print_insn_arg (d, ioffset, aoffsetp, buffer, addr, result, index_offset)
- char d;
- int ioffset, *aoffsetp;
- char *buffer;
- CORE_ADDR addr;
- char *result;
- int index_offset;
-{
- int addr_mode;
- float Fvalue;
- double Lvalue;
- int Ivalue;
- int disp1, disp2;
- int index;
-
- switch (d)
- {
- case 'F':
- case 'L':
- case 'B':
- case 'W':
- case 'D':
- case 'A':
- addr_mode = bit_extract (buffer, ioffset-5, 5);
- ioffset -= 5;
- switch (addr_mode)
- {
- case 0x0: case 0x1: case 0x2: case 0x3:
- case 0x4: case 0x5: case 0x6: case 0x7:
- switch (d)
- {
- case 'F':
- case 'L':
- sprintf (result, "f%d", addr_mode);
- break;
- default:
- sprintf (result, "r%d", addr_mode);
- }
- break;
- case 0x8: case 0x9: case 0xa: case 0xb:
- case 0xc: case 0xd: case 0xe: case 0xf:
- disp1 = get_displacement (buffer, aoffsetp);
- sprintf (result, "%d(r%d)", disp1, addr_mode & 7);
- break;
- case 0x10:
- case 0x11:
- case 0x12:
- disp1 = get_displacement (buffer, aoffsetp);
- disp2 = get_displacement (buffer, aoffsetp);
- sprintf (result, "%d(%d(%s))", disp2, disp1,
- addr_mode==0x10?"fp":addr_mode==0x11?"sp":"sb");
- break;
- case 0x13:
- sprintf (result, "reserved");
- break;
- case 0x14:
- switch (d)
- {
- case 'B':
- Ivalue = bit_extract (buffer, *aoffsetp, 8);
- Ivalue = sign_extend (Ivalue, 8);
- *aoffsetp += 8;
- sprintf (result, "$%d", Ivalue);
- break;
- case 'W':
- Ivalue = bit_extract (buffer, *aoffsetp, 16);
- flip_bytes (&Ivalue, 2);
- *aoffsetp += 16;
- Ivalue = sign_extend (Ivalue, 16);
- sprintf (result, "$%d", Ivalue);
- break;
- case 'D':
- Ivalue = bit_extract (buffer, *aoffsetp, 32);
- flip_bytes (&Ivalue, 4);
- *aoffsetp += 32;
- sprintf (result, "$%d", Ivalue);
- break;
- case 'A':
- Ivalue = bit_extract (buffer, *aoffsetp, 32);
- flip_bytes (&Ivalue, 4);
- *aoffsetp += 32;
- sprintf (result, "$|%d|", Ivalue);
- break;
- case 'F':
- Fvalue = fbit_extract (buffer, *aoffsetp, 32);
- flip_bytes (&Fvalue, 4);
- *aoffsetp += 32;
- sprintf (result, "$%g", Fvalue);
- break;
- case 'L':
- Lvalue = dbit_extract (buffer, *aoffsetp, 64);
- flip_bytes (&Lvalue, 8);
- *aoffsetp += 64;
- sprintf (result, "$%g", Lvalue);
- break;
- }
- break;
- case 0x15:
- disp1 = get_displacement (buffer, aoffsetp);
- sprintf (result, "@|%d|", disp1);
- break;
- case 0x16:
- disp1 = get_displacement (buffer, aoffsetp);
- disp2 = get_displacement (buffer, aoffsetp);
- sprintf (result, "EXT(%d) + %d", disp1, disp2);
- break;
- case 0x17:
- sprintf (result, "tos");
- break;
- case 0x18:
- disp1 = get_displacement (buffer, aoffsetp);
- sprintf (result, "%d(fp)", disp1);
- break;
- case 0x19:
- disp1 = get_displacement (buffer, aoffsetp);
- sprintf (result, "%d(sp)", disp1);
- break;
- case 0x1a:
- disp1 = get_displacement (buffer, aoffsetp);
- sprintf (result, "%d(sb)", disp1);
- break;
- case 0x1b:
- disp1 = get_displacement (buffer, aoffsetp);
- sprintf (result, "|%d|", addr + disp1);
- break;
- case 0x1c:
- case 0x1d:
- case 0x1e:
- case 0x1f:
- index = bit_extract (buffer, index_offset - 8, 3);
- print_insn_arg (d, index_offset, aoffsetp, buffer, addr,
- result, 0);
- {
- static char *ind[] = {"b", "w", "d", "q"};
- char *off;
-
- off = result + strlen (result);
- sprintf (off, "[r%d:%s]", index,
- ind[addr_mode & 3]);
- }
- break;
- }
- break;
- case 'q':
- Ivalue = bit_extract (buffer, ioffset-4, 4);
- Ivalue = sign_extend (Ivalue, 4);
- sprintf (result, "%d", Ivalue);
- ioffset -= 4;
- break;
- case 'r':
- Ivalue = bit_extract (buffer, ioffset-3, 3);
- sprintf (result, "r%d", Ivalue&7);
- ioffset -= 3;
- break;
- case 'd':
- sprintf (result, "%d", get_displacement (buffer, aoffsetp));
- break;
- case 'p':
- sprintf (result, "%c%d%c", NEXT_IS_ADDR,
- addr + get_displacement (buffer, aoffsetp),
- NEXT_IS_ADDR);
- break;
- case 'i':
- Ivalue = bit_extract (buffer, *aoffsetp, 8);
- *aoffsetp += 8;
- sprintf (result, "0x%x", Ivalue);
- break;
- }
- return ioffset;
-}
-
-get_displacement (buffer, aoffsetp)
- char *buffer;
- int *aoffsetp;
-{
- int Ivalue;
-
- Ivalue = bit_extract (buffer, *aoffsetp, 8);
- switch (Ivalue & 0xc0)
- {
- case 0x00:
- case 0x40:
- Ivalue = sign_extend (Ivalue, 7);
- *aoffsetp += 8;
- break;
- case 0x80:
- Ivalue = bit_extract (buffer, *aoffsetp, 16);
- flip_bytes (&Ivalue, 2);
- Ivalue = sign_extend (Ivalue, 14);
- *aoffsetp += 16;
- break;
- case 0xc0:
- Ivalue = bit_extract (buffer, *aoffsetp, 32);
- flip_bytes (&Ivalue, 4);
- Ivalue = sign_extend (Ivalue, 30);
- *aoffsetp += 32;
- break;
- }
- return Ivalue;
-}
-
-/* Return the number of locals in the current frame given a pc
- pointing to the enter instruction. This is used in the macro
- FRAME_FIND_SAVED_REGS. */
-
-ns32k_localcount (enter_pc)
- CORE_ADDR enter_pc;
-{
- unsigned char localtype;
- int localcount;
-
- localtype = read_memory_integer (enter_pc+2, 1);
- if ((localtype & 0x80) == 0)
- localcount = localtype;
- else if ((localtype & 0xc0) == 0x80)
- localcount = (((localtype & 0x3f) << 8)
- | (read_memory_integer (enter_pc+3, 1) & 0xff));
- else
- localcount = (((localtype & 0x3f) << 24)
- | ((read_memory_integer (enter_pc+3, 1) & 0xff) << 16)
- | ((read_memory_integer (enter_pc+4, 1) & 0xff) << 8 )
- | (read_memory_integer (enter_pc+5, 1) & 0xff));
- return localcount;
-}
-
-/*
- * Get the address of the enter opcode for the function
- * containing PC, if there is an enter for the function,
- * and if the pc is between the enter and exit.
- * Returns positive address if pc is between enter/exit,
- * 1 if pc before enter or after exit, 0 otherwise.
- */
-
-CORE_ADDR
-ns32k_get_enter_addr (pc)
- CORE_ADDR pc;
-{
- CORE_ADDR enter_addr;
- unsigned char op;
-
- if (ABOUT_TO_RETURN (pc))
- return 1; /* after exit */
-
- enter_addr = get_pc_function_start (pc);
-
- if (pc == enter_addr)
- return 1; /* before enter */
-
- op = read_memory_integer (enter_addr, 1);
-
- if (op != 0x82)
- return 0; /* function has no enter/exit */
-
- return enter_addr; /* pc is between enter and exit */
-}
diff --git a/gdb/obstack.c b/gdb/obstack.c
deleted file mode 100755
index 590fcaa..0000000
--- a/gdb/obstack.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/* obstack.c - subroutines used implicitly by object stack macros
- Copyright (C) 1988 Free Software Foundation, Inc.
-
-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 1, 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "obstack.h"
-
-#ifdef __STDC__
-#define POINTER void *
-#else
-#define POINTER char *
-#endif
-
-/* Determine default alignment. */
-struct fooalign {char x; double d;};
-#define DEFAULT_ALIGNMENT ((char *)&((struct fooalign *) 0)->d - (char *)0)
-/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
- But in fact it might be less smart and round addresses to as much as
- DEFAULT_ROUNDING. So we prepare for it to do that. */
-union fooround {long x; double d;};
-#define DEFAULT_ROUNDING (sizeof (union fooround))
-
-/* When we copy a long block of data, this is the unit to do it with.
- On some machines, copying successive ints does not work;
- in such a case, redefine COPYING_UNIT to `long' (if that works)
- or `char' as a last resort. */
-#ifndef COPYING_UNIT
-#define COPYING_UNIT int
-#endif
-
-/* The non-GNU-C macros copy the obstack into this global variable
- to avoid multiple evaluation. */
-
-struct obstack *_obstack;
-
-/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
- Objects start on multiples of ALIGNMENT (0 means use default).
- CHUNKFUN is the function to use to allocate chunks,
- and FREEFUN the function to free them. */
-
-void
-_obstack_begin (h, size, alignment, chunkfun, freefun)
- struct obstack *h;
- int size;
- int alignment;
- POINTER (*chunkfun) ();
- void (*freefun) ();
-{
- register struct _obstack_chunk* chunk; /* points to new chunk */
-
- if (alignment == 0)
- alignment = DEFAULT_ALIGNMENT;
- if (size == 0)
- /* Default size is what GNU malloc can fit in a 4096-byte block. */
- {
- /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
- Use the values for range checking, because if range checking is off,
- the extra bytes won't be missed terribly, but if range checking is on
- and we used a larger request, a whole extra 4096 bytes would be
- allocated.
-
- These number are irrelevant to the new GNU malloc. I suspect it is
- less sensitive to the size of the request. */
- int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
- + 4 + DEFAULT_ROUNDING - 1)
- & ~(DEFAULT_ROUNDING - 1));
- size = 4096 - extra;
- }
-
- h->chunkfun = chunkfun;
- h->freefun = freefun;
- h->chunk_size = size;
- h->alignment_mask = alignment - 1;
-
- chunk = h->chunk = (struct _obstack_chunk *)(*h->chunkfun) (h->chunk_size);
- h->next_free = h->object_base = chunk->contents;
- h->chunk_limit = chunk->limit
- = (char *) chunk + h->chunk_size;
- chunk->prev = 0;
-}
-
-/* Allocate a new current chunk for the obstack *H
- on the assumption that LENGTH bytes need to be added
- to the current object, or a new object of length LENGTH allocated.
- Copies any partial object from the end of the old chunk
- to the beginning of the new one.
-
- The function must be "int" so it can be used in non-ANSI C
- compilers in a : expression. */
-
-int
-_obstack_newchunk (h, length)
- struct obstack *h;
- int length;
-{
- register struct _obstack_chunk* old_chunk = h->chunk;
- register struct _obstack_chunk* new_chunk;
- register long new_size;
- register int obj_size = h->next_free - h->object_base;
- register int i;
- int already;
-
- /* Compute size for new chunk. */
- new_size = (obj_size + length) + (obj_size >> 3) + 100;
- if (new_size < h->chunk_size)
- new_size = h->chunk_size;
-
- /* Allocate and initialize the new chunk. */
- new_chunk = h->chunk = (struct _obstack_chunk *)(*h->chunkfun) (new_size);
- new_chunk->prev = old_chunk;
- new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
-
- /* Move the existing object to the new chunk.
- Word at a time is fast and is safe if the object
- is sufficiently aligned. */
- if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT)
- {
- for (i = obj_size / sizeof (COPYING_UNIT) - 1;
- i >= 0; i--)
- ((COPYING_UNIT *)new_chunk->contents)[i]
- = ((COPYING_UNIT *)h->object_base)[i];
- /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT,
- but that can cross a page boundary on a machine
- which does not do strict alignment for COPYING_UNITS. */
- already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT);
- }
- else
- already = 0;
- /* Copy remaining bytes one by one. */
- for (i = already; i < obj_size; i++)
- new_chunk->contents[i] = h->object_base[i];
-
- h->object_base = new_chunk->contents;
- h->next_free = h->object_base + obj_size;
-}
-
-/* Return nonzero if object OBJ has been allocated from obstack H.
- This is here for debugging.
- If you use it in a program, you are probably losing. */
-
-int
-_obstack_allocated_p (h, obj)
- struct obstack *h;
- POINTER obj;
-{
- register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */
- register struct _obstack_chunk* plp; /* point to previous chunk if any */
-
- lp = (h)->chunk;
- while (lp != 0 && ((POINTER)lp > obj || (POINTER)(lp)->limit < obj))
- {
- plp = lp -> prev;
- lp = plp;
- }
- return lp != 0;
-}
-
-/* Free objects in obstack H, including OBJ and everything allocate
- more recently than OBJ. If OBJ is zero, free everything in H. */
-
-#ifdef __STDC__
-#undef obstack_free
-void
-obstack_free (struct obstack *h, POINTER obj)
-#else
-int
-_obstack_free (h, obj)
- struct obstack *h;
- POINTER obj;
-#endif
-{
- register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */
- register struct _obstack_chunk* plp; /* point to previous chunk if any */
-
- lp = (h)->chunk;
- /* We use >= because there cannot be an object at the beginning of a chunk.
- But there can be an empty object at that address
- at the end of another chunk. */
- while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj))
- {
- plp = lp -> prev;
- (*h->freefun) ((POINTER) lp);
- lp = plp;
- }
- if (lp)
- {
- (h)->object_base = (h)->next_free = (char *)(obj);
- (h)->chunk_limit = lp->limit;
- (h)->chunk = lp;
- }
- else if (obj != 0)
- /* obj is not in any of the chunks! */
- abort ();
-}
-
-/* Let same .o link with output of gcc and other compilers. */
-
-#ifdef __STDC__
-int
-_obstack_free (h, obj)
- struct obstack *h;
- POINTER obj;
-{
- obstack_free (h, obj);
-}
-#endif
-
-/* #if 0 */
-/* These are now turned off because the applications do not use it
- and it uses bcopy via obstack_grow, which causes trouble on sysV. */
-
-/* Now define the functional versions of the obstack macros.
- Define them to simply use the corresponding macros to do the job. */
-
-#ifdef __STDC__
-/* These function definitions do not work with non-ANSI preprocessors;
- they won't pass through the macro names in parentheses. */
-
-/* The function names appear in parentheses in order to prevent
- the macro-definitions of the names from being expanded there. */
-
-POINTER (obstack_base) (obstack)
- struct obstack *obstack;
-{
- return obstack_base (obstack);
-}
-
-POINTER (obstack_next_free) (obstack)
- struct obstack *obstack;
-{
- return obstack_next_free (obstack);
-}
-
-int (obstack_object_size) (obstack)
- struct obstack *obstack;
-{
- return obstack_object_size (obstack);
-}
-
-int (obstack_room) (obstack)
- struct obstack *obstack;
-{
- return obstack_room (obstack);
-}
-
-void (obstack_grow) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- obstack_grow (obstack, pointer, length);
-}
-
-void (obstack_grow0) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- obstack_grow0 (obstack, pointer, length);
-}
-
-void (obstack_1grow) (obstack, character)
- struct obstack *obstack;
- int character;
-{
- obstack_1grow (obstack, character);
-}
-
-void (obstack_blank) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- obstack_blank (obstack, length);
-}
-
-void (obstack_1grow_fast) (obstack, character)
- struct obstack *obstack;
- int character;
-{
- obstack_1grow_fast (obstack, character);
-}
-
-void (obstack_blank_fast) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- obstack_blank_fast (obstack, length);
-}
-
-POINTER (obstack_finish) (obstack)
- struct obstack *obstack;
-{
- return obstack_finish (obstack);
-}
-
-POINTER (obstack_alloc) (obstack, length)
- struct obstack *obstack;
- int length;
-{
- return obstack_alloc (obstack, length);
-}
-
-POINTER (obstack_copy) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- return obstack_copy (obstack, pointer, length);
-}
-
-POINTER (obstack_copy0) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
-{
- return obstack_copy0 (obstack, pointer, length);
-}
-
-#endif /* __STDC__ */
-
-/* #endif 0 */
diff --git a/gdb/obstack.h b/gdb/obstack.h
deleted file mode 100755
index 2e80c9c..0000000
--- a/gdb/obstack.h
+++ /dev/null
@@ -1,416 +0,0 @@
-/* obstack.h - object stack macros
- Copyright (C) 1988 Free Software Foundation, Inc.
-
-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 1, 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Summary:
-
-All the apparent functions defined here are macros. The idea
-is that you would use these pre-tested macros to solve a
-very specific set of problems, and they would run fast.
-Caution: no side-effects in arguments please!! They may be
-evaluated MANY times!!
-
-These macros operate a stack of objects. Each object starts life
-small, and may grow to maturity. (Consider building a word syllable
-by syllable.) An object can move while it is growing. Once it has
-been "finished" it never changes address again. So the "top of the
-stack" is typically an immature growing object, while the rest of the
-stack is of mature, fixed size and fixed address objects.
-
-These routines grab large chunks of memory, using a function you
-supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
-by calling `obstack_chunk_free'. You must define them and declare
-them before using any obstack macros.
-
-Each independent stack is represented by a `struct obstack'.
-Each of the obstack macros expects a pointer to such a structure
-as the first argument.
-
-One motivation for this package is the problem of growing char strings
-in symbol tables. Unless you are "fascist pig with a read-only mind"
-[Gosper's immortal quote from HAKMEM item 154, out of context] you
-would not like to put any arbitrary upper limit on the length of your
-symbols.
-
-In practice this often means you will build many short symbols and a
-few long symbols. At the time you are reading a symbol you don't know
-how long it is. One traditional method is to read a symbol into a
-buffer, realloc()ating the buffer every time you try to read a symbol
-that is longer than the buffer. This is beaut, but you still will
-want to copy the symbol from the buffer to a more permanent
-symbol-table entry say about half the time.
-
-With obstacks, you can work differently. Use one obstack for all symbol
-names. As you read a symbol, grow the name in the obstack gradually.
-When the name is complete, finalize it. Then, if the symbol exists already,
-free the newly read name.
-
-The way we do this is to take a large chunk, allocating memory from
-low addresses. When you want to build a symbol in the chunk you just
-add chars above the current "high water mark" in the chunk. When you
-have finished adding chars, because you got to the end of the symbol,
-you know how long the chars are, and you can create a new object.
-Mostly the chars will not burst over the highest address of the chunk,
-because you would typically expect a chunk to be (say) 100 times as
-long as an average object.
-
-In case that isn't clear, when we have enough chars to make up
-the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
-so we just point to it where it lies. No moving of chars is
-needed and this is the second win: potentially long strings need
-never be explicitly shuffled. Once an object is formed, it does not
-change its address during its lifetime.
-
-When the chars burst over a chunk boundary, we allocate a larger
-chunk, and then copy the partly formed object from the end of the old
-chunk to the beginning of the new larger chunk. We then carry on
-accreting characters to the end of the object as we normally would.
-
-A special macro is provided to add a single char at a time to a
-growing object. This allows the use of register variables, which
-break the ordinary 'growth' macro.
-
-Summary:
- We allocate large chunks.
- We carve out one object at a time from the current chunk.
- Once carved, an object never moves.
- We are free to append data of any size to the currently
- growing object.
- Exactly one object is growing in an obstack at any one time.
- You can run one obstack per control block.
- You may have as many control blocks as you dare.
- Because of the way we do it, you can `unwind' a obstack
- back to a previous state. (You may remove objects much
- as you would with a stack.)
-*/
-
-
-/* Don't do the contents of this file more than once. */
-
-#ifndef __OBSTACKS__
-#define __OBSTACKS__
-
-/* We use subtraction of (char *)0 instead of casting to int
- because on word-addressable machines a simple cast to int
- may ignore the byte-within-word field of the pointer. */
-
-#ifndef __PTR_TO_INT
-#define __PTR_TO_INT(P) ((P) - (char *)0)
-#endif
-
-#ifndef __INT_TO_PTR
-#define __INT_TO_PTR(P) ((P) + (char *)0)
-#endif
-
-struct _obstack_chunk /* Lives at front of each chunk. */
-{
- char *limit; /* 1 past end of this chunk */
- struct _obstack_chunk *prev; /* address of prior chunk or NULL */
- char contents[4]; /* objects begin here */
-};
-
-struct obstack /* control current object in current chunk */
-{
- long chunk_size; /* preferred size to allocate chunks in */
- struct _obstack_chunk* chunk; /* address of current struct obstack_chunk */
- char *object_base; /* address of object we are building */
- char *next_free; /* where to add next char to current object */
- char *chunk_limit; /* address of char after current chunk */
- int temp; /* Temporary for some macros. */
- int alignment_mask; /* Mask of alignment for each object. */
-#ifdef __STDC__
- void *(*chunkfun) (); /* User's fcn to allocate a chunk. */
-#else
- char *(*chunkfun) (); /* User's fcn to allocate a chunk. */
-#endif
- void (*freefun) (); /* User's function to free a chunk. */
-};
-
-#ifdef __STDC__
-
-/* Do the function-declarations after the structs
- but before defining the macros. */
-
-void obstack_init (struct obstack *obstack);
-
-void * obstack_alloc (struct obstack *obstack, int size);
-
-void * obstack_copy (struct obstack *obstack, void *address, int size);
-void * obstack_copy0 (struct obstack *obstack, void *address, int size);
-
-void obstack_free (struct obstack *obstack, void *block);
-
-void obstack_blank (struct obstack *obstack, int size);
-
-void obstack_grow (struct obstack *obstack, void *data, int size);
-void obstack_grow0 (struct obstack *obstack, void *data, int size);
-
-void obstack_1grow (struct obstack *obstack, int data_char);
-void obstack_ptr_grow (struct obstack *obstack, void *data);
-void obstack_int_grow (struct obstack *obstack, int data);
-
-void * obstack_finish (struct obstack *obstack);
-
-int obstack_object_size (struct obstack *obstack);
-
-int obstack_room (struct obstack *obstack);
-void obstack_1grow_fast (struct obstack *obstack, int data_char);
-void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
-void obstack_int_grow_fast (struct obstack *obstack, int data);
-void obstack_blank_fast (struct obstack *obstack, int size);
-
-void * obstack_base (struct obstack *obstack);
-void * obstack_next_free (struct obstack *obstack);
-int obstack_alignment_mask (struct obstack *obstack);
-int obstack_chunk_size (struct obstack *obstack);
-
-#endif /* __STDC__ */
-
-/* Non-ANSI C cannot really support alternative functions for these macros,
- so we do not declare them. */
-
-/* Pointer to beginning of object being allocated or to be allocated next.
- Note that this might not be the final address of the object
- because a new chunk might be needed to hold the final size. */
-
-#define obstack_base(h) ((h)->object_base)
-
-/* Size for allocating ordinary chunks. */
-
-#define obstack_chunk_size(h) ((h)->chunk_size)
-
-/* Pointer to next byte not yet allocated in current chunk. */
-
-#define obstack_next_free(h) ((h)->next_free)
-
-/* Mask specifying low bits that should be clear in address of an object. */
-
-#define obstack_alignment_mask(h) ((h)->alignment_mask)
-
-#define obstack_init(h) \
- _obstack_begin ((h), 0, 0, obstack_chunk_alloc, obstack_chunk_free)
-
-#define obstack_begin(h, size) \
- _obstack_begin ((h), (size), 0, obstack_chunk_alloc, obstack_chunk_free)
-
-#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
-
-#define obstack_blank_fast(h,n) ((h)->next_free += (n))
-
-#if defined (__GNUC__) && defined (__STDC__)
-
-/* For GNU C, if not -traditional,
- we can define these macros to compute all args only once
- without using a global variable.
- Also, we can avoid using the `temp' slot, to make faster code. */
-
-#define obstack_object_size(OBSTACK) \
- ({ struct obstack *__o = (OBSTACK); \
- (unsigned) (__o->next_free - __o->object_base); })
-
-#define obstack_room(OBSTACK) \
- ({ struct obstack *__o = (OBSTACK); \
- (unsigned) (__o->chunk_limit - __o->next_free); })
-
-#define obstack_grow(OBSTACK,where,length) \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- ((__o->next_free + __len > __o->chunk_limit) \
- ? _obstack_newchunk (__o, __len) : 0); \
- bcopy (where, __o->next_free, __len); \
- __o->next_free += __len; \
- (void) 0; })
-
-#define obstack_grow0(OBSTACK,where,length) \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- ((__o->next_free + __len + 1 > __o->chunk_limit) \
- ? _obstack_newchunk (__o, __len + 1) : 0), \
- bcopy (where, __o->next_free, __len), \
- __o->next_free += __len, \
- *(__o->next_free)++ = 0; \
- (void) 0; })
-
-#define obstack_1grow(OBSTACK,datum) \
-({ struct obstack *__o = (OBSTACK); \
- ((__o->next_free + 1 > __o->chunk_limit) \
- ? _obstack_newchunk (__o, 1) : 0), \
- *(__o->next_free)++ = (datum); \
- (void) 0; })
-
-/* These assume that the obstack alignment is good enough for pointers or ints,
- and that the data added so far to the current object
- shares that much alignment. */
-
-#define obstack_ptr_grow(OBSTACK,datum) \
-({ struct obstack *__o = (OBSTACK); \
- ((__o->next_free + sizeof (void *) > __o->chunk_limit) \
- ? _obstack_newchunk (__o, sizeof (void *)) : 0), \
- *(*(void ***)&__o->next_free)++ = ((void *)datum); \
- (void) 0; })
-
-#define obstack_int_grow(OBSTACK,datum) \
-({ struct obstack *__o = (OBSTACK); \
- ((__o->next_free + sizeof (int) > __o->chunk_limit) \
- ? _obstack_newchunk (__o, sizeof (int)) : 0), \
- *(*(int **)&__o->next_free)++ = ((int)datum); \
- (void) 0; })
-
-#define obstack_ptr_grow_fast(h,aptr) (*(*(void ***)&(h)->next_free)++ = (void *)aptr)
-#define obstack_int_grow_fast(h,aint) (*(*(int **)&(h)->next_free)++ = (int)aint)
-
-#define obstack_blank(OBSTACK,length) \
-({ struct obstack *__o = (OBSTACK); \
- int __len = (length); \
- ((__o->chunk_limit - __o->next_free < __len) \
- ? _obstack_newchunk (__o, __len) : 0); \
- __o->next_free += __len; \
- (void) 0; })
-
-#define obstack_alloc(OBSTACK,length) \
-({ struct obstack *__h = (OBSTACK); \
- obstack_blank (__h, (length)); \
- obstack_finish (__h); })
-
-#define obstack_copy(OBSTACK,where,length) \
-({ struct obstack *__h = (OBSTACK); \
- obstack_grow (__h, (where), (length)); \
- obstack_finish (__h); })
-
-#define obstack_copy0(OBSTACK,where,length) \
-({ struct obstack *__h = (OBSTACK); \
- obstack_grow0 (__h, (where), (length)); \
- obstack_finish (__h); })
-
-#define obstack_finish(OBSTACK) \
-({ struct obstack *__o = (OBSTACK); \
- void *value = (void *) __o->object_base; \
- __o->next_free \
- = __INT_TO_PTR ((__PTR_TO_INT (__o->next_free)+__o->alignment_mask)\
- & ~ (__o->alignment_mask)); \
- ((__o->next_free - (char *)__o->chunk \
- > __o->chunk_limit - (char *)__o->chunk) \
- ? (__o->next_free = __o->chunk_limit) : 0); \
- __o->object_base = __o->next_free; \
- value; })
-
-#define obstack_free(OBSTACK, OBJ) \
-({ struct obstack *__o = (OBSTACK); \
- void *__obj = (OBJ); \
- if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
- __o->next_free = __o->object_base = __obj; \
- else (obstack_free) (__o, __obj); })
-
-#else /* not __GNUC__ or not __STDC__ */
-
-#define obstack_object_size(h) \
- (unsigned) ((h)->next_free - (h)->object_base)
-
-#define obstack_room(h) \
- (unsigned) ((h)->chunk_limit - (h)->next_free)
-
-#define obstack_grow(h,where,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp > (h)->chunk_limit) \
- ? _obstack_newchunk ((h), (h)->temp) : 0), \
- bcopy (where, (h)->next_free, (h)->temp), \
- (h)->next_free += (h)->temp)
-
-#define obstack_grow0(h,where,length) \
-( (h)->temp = (length), \
- (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
- ? _obstack_newchunk ((h), (h)->temp + 1) : 0), \
- bcopy (where, (h)->next_free, (h)->temp), \
- (h)->next_free += (h)->temp, \
- *((h)->next_free)++ = 0)
-
-#define obstack_1grow(h,datum) \
-( (((h)->next_free + 1 > (h)->chunk_limit) \
- ? _obstack_newchunk ((h), 1) : 0), \
- *((h)->next_free)++ = (datum))
-
-#define obstack_ptr_grow(h,datum) \
-( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
- ? _obstack_newchunk ((h), sizeof (char *)) : 0), \
- *(*(char ***)&(h)->next_free)++ = ((char *)datum))
-
-#define obstack_int_grow(h,datum) \
-( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
- ? _obstack_newchunk ((h), sizeof (int)) : 0), \
- *(*(int **)&(h)->next_free)++ = ((int)datum))
-
-#define obstack_ptr_grow_fast(h,aptr) (*(*(char ***)&(h)->next_free)++ = (char *)aptr)
-#define obstack_int_grow_fast(h,aint) (*(*(int **)&(h)->next_free)++ = (int)aint)
-
-#define obstack_blank(h,length) \
-( (h)->temp = (length), \
- (((h)->chunk_limit - (h)->next_free < (h)->temp) \
- ? _obstack_newchunk ((h), (h)->temp) : 0), \
- (h)->next_free += (h)->temp)
-
-#define obstack_alloc(h,length) \
- (obstack_blank ((h), (length)), obstack_finish ((h)))
-
-#define obstack_copy(h,where,length) \
- (obstack_grow ((h), (where), (length)), obstack_finish ((h)))
-
-#define obstack_copy0(h,where,length) \
- (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
-
-#define obstack_finish(h) \
-( (h)->temp = __PTR_TO_INT ((h)->object_base), \
- (h)->next_free \
- = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
- & ~ ((h)->alignment_mask)), \
- (((h)->next_free - (char *)(h)->chunk \
- > (h)->chunk_limit - (char *)(h)->chunk) \
- ? ((h)->next_free = (h)->chunk_limit) : 0), \
- (h)->object_base = (h)->next_free, \
- __INT_TO_PTR ((h)->temp))
-
-#ifdef __STDC__
-#define obstack_free(h,obj) \
-( (h)->temp = (char *)(obj) - (char *) (h)->chunk, \
- (((h)->temp >= 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : ((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0)))
-#else
-#define obstack_free(h,obj) \
-( (h)->temp = (char *)(obj) - (char *) (h)->chunk, \
- (((h)->temp >= 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : (int) _obstack_free ((h), (h)->temp + (char *) (h)->chunk)))
-#endif
-
-#endif /* not __GNUC__ or not __STDC__ */
-
-/* Declare the external functions we use; they are in obstack.c. */
-
-#ifdef __STDC__
- extern int _obstack_newchunk (struct obstack *h, int length);
- extern int _obstack_free (struct obstack *h, void *obj);
- extern void _obstack_begin (struct obstack *h, int size, int alignment,
- void *(*chunkfun) (), void (*freefun) ());
-#else
- extern int _obstack_newchunk ();
- extern int _obstack_free ();
- extern void _obstack_begin ();
-#endif
-
-#endif /* not __OBSTACKS__ */
-
diff --git a/gdb/param-no-tm.h b/gdb/param-no-tm.h
deleted file mode 100755
index 96bc85a..0000000
--- a/gdb/param-no-tm.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined (PARAM_H)
-#define PARAM_H 1
-
-/* DO NOT #include "tm.h" -- a particular tm file has been inc'd by caller */
-
-#include "xm.h"
-
-/* TARGET_BYTE_ORDER and HOST_BYTE_ORDER should be defined to one of these. */
-#if !defined (BIG_ENDIAN)
-#define BIG_ENDIAN 4321
-#endif
-
-#if !defined (LITTLE_ENDIAN)
-#define LITTLE_ENDIAN 1234
-#endif
-
-/* The bit byte-order has to do just with numbering of bits in
- debugging symbols and such. Conceptually, it's quite separate
- from byte/word byte order. */
-
-#if !defined (BITS_BIG_ENDIAN)
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
-#define BITS_BIG_ENDIAN 1
-#endif /* Big endian. */
-
-#if TARGET_BYTE_ORDER == LITTLE_ENDIAN
-#define BITS_BIG_ENDIAN 0
-#endif /* Little endian. */
-#endif /* BITS_BIG_ENDIAN not defined. */
-
-/* Swap LEN bytes at BUFFER between target and host byte-order. */
-#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
-#define SWAP_TARGET_AND_HOST(buffer,len)
-#else /* Target and host byte order differ. */
-#define SWAP_TARGET_AND_HOST(buffer,len) \
- { \
- char tmp; \
- char *p = (char *)(buffer); \
- char *q = ((char *)(buffer)) + len - 1; \
- for (; p < q; p++, q--) \
- { \
- tmp = *q; \
- *q = *p; \
- *p = tmp; \
- } \
- }
-#endif /* Target and host byte order differ. */
-
-/* On some machines there are bits in addresses which are not really
- part of the address, but are used by the kernel, the hardware, etc.
- for special purposes. ADDR_BITS_REMOVE takes out any such bits
- so we get a "real" address such as one would find in a symbol
- table. ADDR_BITS_SET sets those bits the way the system wants
- them. */
-#if !defined (ADDR_BITS_REMOVE)
-#define ADDR_BITS_REMOVE(addr) (addr)
-#define ADDR_BITS_SET(addr) (addr)
-#endif /* No ADDR_BITS_REMOVE. */
-
-#if !defined (SYS_SIGLIST_MISSING)
-#define SYS_SIGLIST_MISSING defined (USG)
-#endif /* No SYS_SIGLIST_MISSING */
-
-#endif /* param.h not already included. */
diff --git a/gdb/param.h b/gdb/param.h
deleted file mode 100755
index b408a03..0000000
--- a/gdb/param.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* The standard thing is to include param.h. However, files that are
- specific to a particular target can include that tm-xxx.h file and
- param-no-tm.h. Any future inclusions of param.h will be protected
- against by the #if !defined stuff below. */
-
-/* This file requires defs.h. */
-
-#if !defined (PARAM_H)
-#include "tm.h"
-#endif
-
-#include "param-no-tm.h"
-
-#define PARAM_H 1
diff --git a/gdb/parse.c b/gdb/parse.c
deleted file mode 100644
index 214df03..0000000
--- a/gdb/parse.c
+++ /dev/null
@@ -1,628 +0,0 @@
-/* Parse expressions for GDB.
- Copyright (C) 1986, 1989, 1990, 1991 Free Software Foundation, Inc.
- Modified from expread.y by the Department of Computer Science at the
- State University of New York at Buffalo, 1991.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Parse an expression from text in a string,
- and return the result as a struct expression pointer.
- That structure contains arithmetic operations in reverse polish,
- with constants represented by operations that are followed by special data.
- See expression.h for the details of the format.
- What is important here is that it can be built up sequentially
- during the process of parsing; the lower levels of the tree always
- come first in the result. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "frame.h"
-#include "expression.h"
-#include "value.h"
-#include "command.h"
-#include "language.h"
-#include "parser-defs.h"
-
-/* Assign machine-independent names to certain registers
- (unless overridden by the REGISTER_NAMES table) */
-
-struct std_regs std_regs[] = {
-#ifdef PC_REGNUM
- { "pc", PC_REGNUM },
-#endif
-#ifdef FP_REGNUM
- { "fp", FP_REGNUM },
-#endif
-#ifdef SP_REGNUM
- { "sp", SP_REGNUM },
-#endif
-#ifdef PS_REGNUM
- { "ps", PS_REGNUM },
-#endif
-};
-
-unsigned num_std_regs = (sizeof std_regs / sizeof std_regs[0]);
-
-
-/* Begin counting arguments for a function call,
- saving the data about any containing call. */
-
-void
-start_arglist ()
-{
- register struct funcall *new = (struct funcall *) xmalloc (sizeof (struct funcall));
-
- new->next = funcall_chain;
- new->arglist_len = arglist_len;
- arglist_len = 0;
- funcall_chain = new;
-}
-
-/* Return the number of arguments in a function call just terminated,
- and restore the data for the containing function call. */
-
-int
-end_arglist ()
-{
- register int val = arglist_len;
- register struct funcall *call = funcall_chain;
- funcall_chain = call->next;
- arglist_len = call->arglist_len;
- free (call);
- return val;
-}
-
-/* Free everything in the funcall chain.
- Used when there is an error inside parsing. */
-
-void
-free_funcalls ()
-{
- register struct funcall *call, *next;
-
- for (call = funcall_chain; call; call = next)
- {
- next = call->next;
- free (call);
- }
-}
-
-/* This page contains the functions for adding data to the struct expression
- being constructed. */
-
-/* Add one element to the end of the expression. */
-
-/* To avoid a bug in the Sun 4 compiler, we pass things that can fit into
- a register through here */
-
-void
-write_exp_elt (expelt)
- union exp_element expelt;
-{
- if (expout_ptr >= expout_size)
- {
- expout_size *= 2;
- expout = (struct expression *) xrealloc (expout,
- sizeof (struct expression)
- + expout_size * sizeof (union exp_element));
- }
- expout->elts[expout_ptr++] = expelt;
-}
-
-void
-write_exp_elt_opcode (expelt)
- enum exp_opcode expelt;
-{
- union exp_element tmp;
-
- tmp.opcode = expelt;
-
- write_exp_elt (tmp);
-}
-
-void
-write_exp_elt_sym (expelt)
- struct symbol *expelt;
-{
- union exp_element tmp;
-
- tmp.symbol = expelt;
-
- write_exp_elt (tmp);
-}
-
-void
-write_exp_elt_longcst (expelt)
- LONGEST expelt;
-{
- union exp_element tmp;
-
- tmp.longconst = expelt;
-
- write_exp_elt (tmp);
-}
-
-void
-write_exp_elt_dblcst (expelt)
- double expelt;
-{
- union exp_element tmp;
-
- tmp.doubleconst = expelt;
-
- write_exp_elt (tmp);
-}
-
-void
-write_exp_elt_type (expelt)
- struct type *expelt;
-{
- union exp_element tmp;
-
- tmp.type = expelt;
-
- write_exp_elt (tmp);
-}
-
-void
-write_exp_elt_intern (expelt)
- struct internalvar *expelt;
-{
- union exp_element tmp;
-
- tmp.internalvar = expelt;
-
- write_exp_elt (tmp);
-}
-
-/* Add a string constant to the end of the expression.
- Follow it by its length in bytes, as a separate exp_element. */
-
-void
-write_exp_string (str)
- struct stoken str;
-{
- register int len = str.length;
- register int lenelt
- = (len + sizeof (union exp_element)) / sizeof (union exp_element);
-
- expout_ptr += lenelt;
-
- if (expout_ptr >= expout_size)
- {
- expout_size = max (expout_size * 2, expout_ptr + 10);
- expout = (struct expression *)
- xrealloc (expout, (sizeof (struct expression)
- + (expout_size * sizeof (union exp_element))));
- }
- bcopy (str.ptr, (char *) &expout->elts[expout_ptr - lenelt], len);
- ((char *) &expout->elts[expout_ptr - lenelt])[len] = 0;
- write_exp_elt_longcst ((LONGEST) len);
-}
-
-/* Return a null-terminated temporary copy of the name
- of a string token. */
-
-char *
-copy_name (token)
- struct stoken token;
-{
- bcopy (token.ptr, namecopy, token.length);
- namecopy[token.length] = 0;
- return namecopy;
-}
-
-/* Reverse an expression from suffix form (in which it is constructed)
- to prefix form (in which we can conveniently print or execute it). */
-
-static void prefixify_subexp ();
-
-void
-prefixify_expression (expr)
- register struct expression *expr;
-{
- register int len = sizeof (struct expression) +
- expr->nelts * sizeof (union exp_element);
- register struct expression *temp;
- register int inpos = expr->nelts, outpos = 0;
-
- temp = (struct expression *) alloca (len);
-
- /* Copy the original expression into temp. */
- bcopy (expr, temp, len);
-
- prefixify_subexp (temp, expr, inpos, outpos);
-}
-
-/* Return the number of exp_elements in the subexpression of EXPR
- whose last exp_element is at index ENDPOS - 1 in EXPR. */
-
-int
-length_of_subexp (expr, endpos)
- register struct expression *expr;
- register int endpos;
-{
- register int oplen = 1;
- register int args = 0;
- register int i;
-
- if (endpos < 0)
- error ("?error in length_of_subexp");
-
- i = (int) expr->elts[endpos - 1].opcode;
-
- switch (i)
- {
- /* C++ */
- case OP_SCOPE:
- oplen = 4 + ((expr->elts[endpos - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
- break;
-
- case OP_LONG:
- case OP_DOUBLE:
- oplen = 4;
- break;
-
- case OP_TYPE:
- case OP_BOOL:
- case OP_VAR_VALUE:
- case OP_LAST:
- case OP_REGISTER:
- case OP_INTERNALVAR:
- oplen = 3;
- break;
-
- case OP_FUNCALL:
- oplen = 3;
- args = 1 + expr->elts[endpos - 2].longconst;
- break;
-
- case UNOP_MAX:
- case UNOP_MIN:
- oplen = 3;
- args = 0;
- break;
-
- case BINOP_VAL:
- case UNOP_CAST:
- case UNOP_MEMVAL:
- oplen = 3;
- args = 1;
- break;
-
- case UNOP_ABS:
- case UNOP_CAP:
- case UNOP_CHR:
- case UNOP_FLOAT:
- case UNOP_HIGH:
- case UNOP_ODD:
- case UNOP_ORD:
- case UNOP_TRUNC:
- oplen = 1;
- args = 1;
- break;
-
- case STRUCTOP_STRUCT:
- case STRUCTOP_PTR:
- args = 1;
- case OP_M2_STRING:
- case OP_STRING:
- oplen = 3 + ((expr->elts[endpos - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
- break;
-
- case TERNOP_COND:
- args = 3;
- break;
-
- /* Modula-2 */
- case BINOP_MULTI_SUBSCRIPT:
- oplen=3;
- args = 1 + expr->elts[endpos- 2].longconst;
- break;
-
- case BINOP_ASSIGN_MODIFY:
- oplen = 3;
- args = 2;
- break;
-
- /* C++ */
- case OP_THIS:
- oplen = 2;
- break;
-
- default:
- args = 1 + (i < (int) BINOP_END);
- }
-
- while (args > 0)
- {
- oplen += length_of_subexp (expr, endpos - oplen);
- args--;
- }
-
- return oplen;
-}
-
-/* Copy the subexpression ending just before index INEND in INEXPR
- into OUTEXPR, starting at index OUTBEG.
- In the process, convert it from suffix to prefix form. */
-
-static void
-prefixify_subexp (inexpr, outexpr, inend, outbeg)
- register struct expression *inexpr;
- struct expression *outexpr;
- register int inend;
- int outbeg;
-{
- register int oplen = 1;
- register int args = 0;
- register int i;
- int *arglens;
- enum exp_opcode opcode;
-
- /* Compute how long the last operation is (in OPLEN),
- and also how many preceding subexpressions serve as
- arguments for it (in ARGS). */
-
- opcode = inexpr->elts[inend - 1].opcode;
- switch (opcode)
- {
- /* C++ */
- case OP_SCOPE:
- oplen = 4 + ((inexpr->elts[inend - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
- break;
-
- case OP_LONG:
- case OP_DOUBLE:
- oplen = 4;
- break;
-
- case OP_TYPE:
- case OP_BOOL:
- case OP_VAR_VALUE:
- case OP_LAST:
- case OP_REGISTER:
- case OP_INTERNALVAR:
- oplen = 3;
- break;
-
- case OP_FUNCALL:
- oplen = 3;
- args = 1 + inexpr->elts[inend - 2].longconst;
- break;
-
- case UNOP_MIN:
- case UNOP_MAX:
- oplen = 3;
- args = 0;
- break;
-
- case UNOP_CAST:
- case UNOP_MEMVAL:
- oplen = 3;
- args = 1;
- break;
-
- case UNOP_ABS:
- case UNOP_CAP:
- case UNOP_CHR:
- case UNOP_FLOAT:
- case UNOP_HIGH:
- case UNOP_ODD:
- case UNOP_ORD:
- case UNOP_TRUNC:
- oplen=1;
- args=1;
- break;
-
- case STRUCTOP_STRUCT:
- case STRUCTOP_PTR:
- args = 1;
- case OP_M2_STRING:
- case OP_STRING:
- oplen = 3 + ((inexpr->elts[inend - 2].longconst
- + sizeof (union exp_element))
- / sizeof (union exp_element));
-
- break;
-
- case TERNOP_COND:
- args = 3;
- break;
-
- case BINOP_ASSIGN_MODIFY:
- oplen = 3;
- args = 2;
- break;
-
- /* Modula-2 */
- case BINOP_MULTI_SUBSCRIPT:
- oplen=3;
- args = 1 + inexpr->elts[inend - 2].longconst;
- break;
-
- /* C++ */
- case OP_THIS:
- oplen = 2;
- break;
-
- default:
- args = 1 + ((int) opcode < (int) BINOP_END);
- }
-
- /* Copy the final operator itself, from the end of the input
- to the beginning of the output. */
- inend -= oplen;
- bcopy (&inexpr->elts[inend], &outexpr->elts[outbeg],
- oplen * sizeof (union exp_element));
- outbeg += oplen;
-
- /* Find the lengths of the arg subexpressions. */
- arglens = (int *) alloca (args * sizeof (int));
- for (i = args - 1; i >= 0; i--)
- {
- oplen = length_of_subexp (inexpr, inend);
- arglens[i] = oplen;
- inend -= oplen;
- }
-
- /* Now copy each subexpression, preserving the order of
- the subexpressions, but prefixifying each one.
- In this loop, inend starts at the beginning of
- the expression this level is working on
- and marches forward over the arguments.
- outbeg does similarly in the output. */
- for (i = 0; i < args; i++)
- {
- oplen = arglens[i];
- inend += oplen;
- prefixify_subexp (inexpr, outexpr, inend, outbeg);
- outbeg += oplen;
- }
-}
-
-/* This page contains the two entry points to this file. */
-
-/* Read an expression from the string *STRINGPTR points to,
- parse it, and return a pointer to a struct expression that we malloc.
- Use block BLOCK as the lexical context for variable names;
- if BLOCK is zero, use the block of the selected stack frame.
- Meanwhile, advance *STRINGPTR to point after the expression,
- at the first nonwhite character that is not part of the expression
- (possibly a null character).
-
- If COMMA is nonzero, stop if a comma is reached. */
-
-struct expression *
-parse_exp_1 (stringptr, block, comma)
- char **stringptr;
- struct block *block;
- int comma;
-{
- struct cleanup *old_chain;
-
- lexptr = *stringptr;
-
- paren_depth = 0;
- type_stack_depth = 0;
-
- comma_terminates = comma;
-
- if (lexptr == 0 || *lexptr == 0)
- error_no_arg ("expression to compute");
-
- old_chain = make_cleanup (free_funcalls, 0);
- funcall_chain = 0;
-
- expression_context_block = block ? block : get_selected_block ();
-
- namecopy = (char *) alloca (strlen (lexptr) + 1);
- expout_size = 10;
- expout_ptr = 0;
- expout = (struct expression *)
- xmalloc (sizeof (struct expression)
- + expout_size * sizeof (union exp_element));
- expout->language_defn = current_language;
- make_cleanup (free_current_contents, &expout);
-
- if (current_language->la_parser ())
- current_language->la_error (NULL);
-
- discard_cleanups (old_chain);
- expout->nelts = expout_ptr;
- expout = (struct expression *)
- xrealloc (expout,
- sizeof (struct expression)
- + expout_ptr * sizeof (union exp_element));
- prefixify_expression (expout);
- *stringptr = lexptr;
- return expout;
-}
-
-/* Parse STRING as an expression, and complain if this fails
- to use up all of the contents of STRING. */
-
-struct expression *
-parse_expression (string)
- char *string;
-{
- register struct expression *exp;
- exp = parse_exp_1 (&string, 0, 0);
- if (*string)
- error ("Junk after end of expression.");
- return exp;
-}
-
-void
-push_type (tp)
- enum type_pieces tp;
-{
- if (type_stack_depth == type_stack_size)
- {
- type_stack_size *= 2;
- type_stack = (union type_stack_elt *)
- xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
- }
- type_stack[type_stack_depth++].piece = tp;
-}
-
-void
-push_type_int (n)
- int n;
-{
- if (type_stack_depth == type_stack_size)
- {
- type_stack_size *= 2;
- type_stack = (union type_stack_elt *)
- xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
- }
- type_stack[type_stack_depth++].int_val = n;
-}
-
-enum type_pieces
-pop_type ()
-{
- if (type_stack_depth)
- return type_stack[--type_stack_depth].piece;
- return tp_end;
-}
-
-int
-pop_type_int ()
-{
- if (type_stack_depth)
- return type_stack[--type_stack_depth].int_val;
- /* "Can't happen". */
- return 0;
-}
-
-void
-_initialize_parse ()
-{
- type_stack_size = 80;
- type_stack_depth = 0;
- type_stack = (union type_stack_elt *)
- xmalloc (type_stack_size * sizeof (*type_stack));
-}
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
deleted file mode 100644
index c5c8077..0000000
--- a/gdb/parser-defs.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/* Parser definitions for GDB.
- Copyright (C) 1986, 1989, 1990, 1991 Free Software Foundation, Inc.
- Modified from expread.y by the Department of Computer Science at the
- State University of New York at Buffalo.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-struct std_regs {
- char *name;
- int regnum;
-};
-
-extern struct std_regs std_regs[];
-extern unsigned num_std_regs;
-
-struct expression *expout;
-int expout_size;
-int expout_ptr;
-
-extern struct type *init_type ();
-
-void write_exp_elt ();
-void write_exp_elt_opcode ();
-void write_exp_elt_sym ();
-void write_exp_elt_longcst ();
-void write_exp_elt_dblcst ();
-void write_exp_elt_type ();
-void write_exp_elt_intern ();
-void write_exp_string ();
-void start_arglist ();
-int end_arglist ();
-void free_funcalls ();
-char *copy_name ();
-
-/* If this is nonzero, this block is used as the lexical context
- for symbol names. */
-
-struct block *expression_context_block;
-
-/* The innermost context required by the stack and register variables
- we've encountered so far. */
-struct block *innermost_block;
-
-/* The block in which the most recently discovered symbol was found. */
-struct block *block_found;
-
-/* Number of arguments seen so far in innermost function call. */
-int arglist_len;
-
-/* Data structure for saving values of arglist_len
- for function calls whose arguments contain other function calls. */
-
-struct funcall
- {
- struct funcall *next;
- int arglist_len;
- };
-
-struct funcall *funcall_chain;
-
-/* This kind of datum is used to represent the name
- of a symbol token. */
-
-struct stoken
- {
- char *ptr;
- int length;
- };
-
-struct ttype
- {
- struct stoken stoken;
- struct type *type;
- };
-
-struct symtoken
- {
- struct stoken stoken;
- struct symbol *sym;
- int is_a_field_of_this;
- };
-
-/* For parsing of complicated types.
- An array should be preceded in the list by the size of the array. */
-enum type_pieces
- {tp_end = -1, tp_pointer, tp_reference, tp_array, tp_function};
-/* The stack can contain either an enum type_pieces or an int. */
-union type_stack_elt {
- enum type_pieces piece;
- int int_val;
-};
-union type_stack_elt *type_stack;
-int type_stack_depth, type_stack_size;
-
-void push_type ();
-void push_type_int ();
-enum type_pieces pop_type ();
-int pop_type_int ();
-
-/* During parsing of a C expression, the pointer to the next character
- is in this variable. */
-
-char *lexptr;
-
-/* Tokens that refer to names do so with explicit pointer and length,
- so they can share the storage that lexptr is parsing.
-
- When it is necessary to pass a name to a function that expects
- a null-terminated string, the substring is copied out
- into a block of storage that namecopy points to.
-
- namecopy is allocated once, guaranteed big enough, for each parsing. */
-
-char *namecopy;
-
-/* Current depth in parentheses within the expression. */
-
-int paren_depth;
-
-/* Nonzero means stop parsing on first comma (if not within parentheses). */
-
-int comma_terminates;
-
-/* These codes indicate operator precedences for expression printing,
- least tightly binding first. */
-/* Adding 1 to a precedence value is done for binary operators,
- on the operand which is more tightly bound, so that operators
- of equal precedence within that operand will get parentheses. */
-/* PREC_HYPER and PREC_ABOVE_COMMA are not the precedence of any operator;
- they are used as the "surrounding precedence" to force
- various kinds of things to be parenthesized. */
-enum precedence
-{ PREC_NULL, PREC_COMMA, PREC_ABOVE_COMMA, PREC_ASSIGN, PREC_OR, PREC_AND,
- PREC_LOGIOR, PREC_LOGAND, PREC_LOGXOR, PREC_EQUAL, PREC_ORDER,
- PREC_SHIFT, PREC_ADD, PREC_MUL, PREC_REPEAT,
- PREC_HYPER, PREC_PREFIX, PREC_SUFFIX };
-
-/* Table mapping opcodes into strings for printing operators
- and precedences of the operators. */
-
-struct op_print
-{
- char *string;
- enum exp_opcode opcode;
- /* Precedence of operator. These values are used only by comparisons. */
- enum precedence precedence;
- int right_assoc;
-};
diff --git a/gdb/pn-opcode.h b/gdb/pn-opcode.h
deleted file mode 100755
index 77a2770..0000000
--- a/gdb/pn-opcode.h
+++ /dev/null
@@ -1,282 +0,0 @@
-/* Print GOULD PN (PowerNode) instructions for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-struct gld_opcode
-{
- char *name;
- unsigned long opcode;
- unsigned long mask;
- char *args;
- int length;
-};
-
-/* We store four bytes of opcode for all opcodes because that
- is the most any of them need. The actual length of an instruction
- is always at least 2 bytes, and at most four. The length of the
- instruction is based on the opcode.
-
- The mask component is a mask saying which bits must match
- particular opcode in order for an instruction to be an instance
- of that opcode.
-
- The args component is a string containing characters
- that are used to format the arguments to the instruction. */
-
-/* Kinds of operands:
- r Register in first field
- R Register in second field
- b Base register in first field
- B Base register in second field
- v Vector register in first field
- V Vector register in first field
- A Optional address register (base register)
- X Optional index register
- I Immediate data (16bits signed)
- O Offset field (16bits signed)
- h Offset field (15bits signed)
- d Offset field (14bits signed)
- S Shift count field
-
- any other characters are printed as is...
-*/
-
-/* The assembler requires that this array be sorted as follows:
- all instances of the same mnemonic must be consecutive.
- All instances of the same mnemonic with the same number of operands
- must be consecutive.
- */
-struct gld_opcode gld_opcodes[] =
-{
-{ "abm", 0xa0080000, 0xfc080000, "f,xOA,X", 4 },
-{ "abr", 0x18080000, 0xfc0c0000, "r,f", 2 },
-{ "aci", 0xfc770000, 0xfc7f8000, "r,I", 4 },
-{ "adfd", 0xe0080002, 0xfc080002, "r,xOA,X", 4 },
-{ "adfw", 0xe0080000, 0xfc080000, "r,xOA,X", 4 },
-{ "adi", 0xc8010000, 0xfc7f0000, "r,I", 4 },
-{ "admb", 0xb8080000, 0xfc080000, "r,xOA,X", 4 },
-{ "admd", 0xb8000002, 0xfc080002, "r,xOA,X", 4 },
-{ "admh", 0xb8000001, 0xfc080001, "r,xOA,X", 4 },
-{ "admw", 0xb8000000, 0xfc080000, "r,xOA,X", 4 },
-{ "adr", 0x38000000, 0xfc0f0000, "r,R", 2 },
-{ "adrfd", 0x38090000, 0xfc0f0000, "r,R", 2 },
-{ "adrfw", 0x38010000, 0xfc0f0000, "r,R", 2 },
-{ "adrm", 0x38080000, 0xfc0f0000, "r,R", 2 },
-{ "ai", 0xfc030000, 0xfc07ffff, "I", 4 },
-{ "anmb", 0x84080000, 0xfc080000, "r,xOA,X", 4 },
-{ "anmd", 0x84000002, 0xfc080002, "r,xOA,X", 4 },
-{ "anmh", 0x84000001, 0xfc080001, "r,xOA,X", 4 },
-{ "anmw", 0x84000000, 0xfc080000, "r,xOA,X", 4 },
-{ "anr", 0x04000000, 0xfc0f0000, "r,R", 2 },
-{ "armb", 0xe8080000, 0xfc080000, "r,xOA,X", 4 },
-{ "armd", 0xe8000002, 0xfc080002, "r,xOA,X", 4 },
-{ "armh", 0xe8000001, 0xfc080001, "r,xOA,X", 4 },
-{ "armw", 0xe8000000, 0xfc080000, "r,xOA,X", 4 },
-{ "bcf", 0xf0000000, 0xfc080000, "I,xOA,X", 4 },
-{ "bct", 0xec000000, 0xfc080000, "I,xOA,X", 4 },
-{ "bei", 0x00060000, 0xffff0000, "", 2 },
-{ "bft", 0xf0000000, 0xff880000, "xOA,X", 4 },
-{ "bib", 0xf4000000, 0xfc780000, "r,xOA", 4 },
-{ "bid", 0xf4600000, 0xfc780000, "r,xOA", 4 },
-{ "bih", 0xf4200000, 0xfc780000, "r,xOA", 4 },
-{ "biw", 0xf4400000, 0xfc780000, "r,xOA", 4 },
-{ "bl", 0xf8800000, 0xff880000, "xOA,X", 4 },
-{ "bsub", 0x5c080000, 0xff8f0000, "", 2 },
-{ "bsubm", 0x28080000, 0xfc080000, "", 4 },
-{ "bu", 0xec000000, 0xff880000, "xOA,X", 4 },
-{ "call", 0x28080000, 0xfc0f0000, "", 2 },
-{ "callm", 0x5c080000, 0xff880000, "", 4 },
-{ "camb", 0x90080000, 0xfc080000, "r,xOA,X", 4 },
-{ "camd", 0x90000002, 0xfc080002, "r,xOA,X", 4 },
-{ "camh", 0x90000001, 0xfc080001, "r,xOA,X", 4 },
-{ "camw", 0x90000000, 0xfc080000, "r.xOA,X", 4 },
-{ "car", 0x10000000, 0xfc0f0000, "r,R", 2 },
-{ "cd", 0xfc060000, 0xfc070000, "r,f", 4 },
-{ "cea", 0x000f0000, 0xffff0000, "", 2 },
-{ "ci", 0xc8050000, 0xfc7f0000, "r,I", 4 },
-{ "cmc", 0x040a0000, 0xfc7f0000, "r", 2 },
-{ "cmmb", 0x94080000, 0xfc080000, "r,xOA,X", 4 },
-{ "cmmd", 0x94000002, 0xfc080002, "r,xOA,X", 4 },
-{ "cmmh", 0x94000001, 0xfc080001, "r,xOA,X", 4 },
-{ "cmmw", 0x94000000, 0xfc080000, "r,xOA,X", 4 },
-{ "cmr", 0x14000000, 0xfc0f0000, "r,R", 2 },
-{ "daci", 0xfc7f0000, 0xfc7f8000, "r,I", 4 },
-{ "dae", 0x000e0000, 0xffff0000, "", 2 },
-{ "dai", 0xfc040000, 0xfc07ffff, "I", 4 },
-{ "dci", 0xfc6f0000, 0xfc7f8000, "r,I", 4 },
-{ "di", 0xfc010000, 0xfc07ffff, "I", 4 },
-{ "dvfd", 0xe4000002, 0xfc080002, "r,xOA,X", 4 },
-{ "dvfw", 0xe4000000, 0xfc080000, "r,xOA,X", 4 },
-{ "dvi", 0xc8040000, 0xfc7f0000, "r,I", 4 },
-{ "dvmb", 0xc4080000, 0xfc080000, "r,xOA,X", 4 },
-{ "dvmh", 0xc4000001, 0xfc080001, "r,xOA,X", 4 },
-{ "dvmw", 0xc4000000, 0xfc080000, "r,xOA,X", 4 },
-{ "dvr", 0x380a0000, 0xfc0f0000, "r,R", 2 },
-{ "dvrfd", 0x380c0000, 0xfc0f0000, "r,R", 4 },
-{ "dvrfw", 0x38040000, 0xfc0f0000, "r,xOA,X", 4 },
-{ "eae", 0x00080000, 0xffff0000, "", 2 },
-{ "eci", 0xfc670000, 0xfc7f8080, "r,I", 4 },
-{ "ecwcs", 0xfc4f0000, 0xfc7f8000, "", 4 },
-{ "ei", 0xfc000000, 0xfc07ffff, "I", 4 },
-{ "eomb", 0x8c080000, 0xfc080000, "r,xOA,X", 4 },
-{ "eomd", 0x8c000002, 0xfc080002, "r,xOA,X", 4 },
-{ "eomh", 0x8c000001, 0xfc080001, "r,xOA,X", 4 },
-{ "eomw", 0x8c000000, 0xfc080000, "r,xOA,X", 4 },
-{ "eor", 0x0c000000, 0xfc0f0000, "r,R", 2 },
-{ "eorm", 0x0c080000, 0xfc0f0000, "r,R", 2 },
-{ "es", 0x00040000, 0xfc7f0000, "r", 2 },
-{ "exm", 0xa8000000, 0xff880000, "xOA,X", 4 },
-{ "exr", 0xc8070000, 0xfc7f0000, "r", 2 },
-{ "exrr", 0xc8070002, 0xfc7f0002, "r", 2 },
-{ "fixd", 0x380d0000, 0xfc0f0000, "r,R", 2 },
-{ "fixw", 0x38050000, 0xfc0f0000, "r,R", 2 },
-{ "fltd", 0x380f0000, 0xfc0f0000, "r,R", 2 },
-{ "fltw", 0x38070000, 0xfc0f0000, "r,R", 2 },
-{ "grio", 0xfc3f0000, 0xfc7f8000, "r,I", 4 },
-{ "halt", 0x00000000, 0xffff0000, "", 2 },
-{ "hio", 0xfc370000, 0xfc7f8000, "r,I", 4 },
-{ "jwcs", 0xfa080000, 0xff880000, "xOA,X", 4 },
-{ "la", 0x50000000, 0xfc000000, "r,xOA,X", 4 },
-{ "labr", 0x58080000, 0xfc080000, "b,xOA,X", 4 },
-{ "lb", 0xac080000, 0xfc080000, "r,xOA,X", 4 },
-{ "lcs", 0x00030000, 0xfc7f0000, "r", 2 },
-{ "ld", 0xac000002, 0xfc080002, "r,xOA,X", 4 },
-{ "lear", 0x80000000, 0xfc080000, "r,xOA,X", 4 },
-{ "lf", 0xcc000000, 0xfc080000, "r,xOA,X", 4 },
-{ "lfbr", 0xcc080000, 0xfc080000, "b,xOA,X", 4 },
-{ "lh", 0xac000001, 0xfc080001, "r,xOA,X", 4 },
-{ "li", 0xc8000000, 0xfc7f0000, "r,I", 4 },
-{ "lmap", 0x2c070000, 0xfc7f0000, "r", 2 },
-{ "lmb", 0xb0080000, 0xfc080000, "r,xOA,X", 4 },
-{ "lmd", 0xb0000002, 0xfc080002, "r,xOA,X", 4 },
-{ "lmh", 0xb0000001, 0xfc080001, "r,xOA,X", 4 },
-{ "lmw", 0xb0000000, 0xfc080000, "r,xOA,X", 4 },
-{ "lnb", 0xb4080000, 0xfc080000, "r,xOA,X", 4 },
-{ "lnd", 0xb4000002, 0xfc080002, "r,xOA,X", 4 },
-{ "lnh", 0xb4000001, 0xfc080001, "r,xOA,X", 4 },
-{ "lnw", 0xb4000000, 0xfc080000, "r,xOA,X", 4 },
-{ "lpsd", 0xf9800000, 0xff880000, "r,xOA,X", 4 },
-{ "lpsdcm", 0xfa800000, 0xff880000, "r,xOA,X", 4 },
-{ "lw", 0xac000000, 0xfc080000, "r,xOA,X", 4 },
-{ "lwbr", 0x5c000000, 0xfc080000, "b,xOA,X", 4 },
-{ "mpfd", 0xe4080002, 0xfc080002, "r,xOA,X", 4 },
-{ "mpfw", 0xe4080000, 0xfc080000, "r,xOA,X", 4 },
-{ "mpi", 0xc8030000, 0xfc7f0000, "r,I", 4 },
-{ "mpmb", 0xc0080000, 0xfc080000, "r,xOA,X", 4 },
-{ "mpmh", 0xc0000001, 0xfc080001, "r,xOA,X", 4 },
-{ "mpmw", 0xc0000000, 0xfc080000, "r,xOA,X", 4 },
-{ "mpr", 0x38020000, 0xfc0f0000, "r,R", 2 },
-{ "mprfd", 0x380e0000, 0xfc0f0000, "r,R", 2 },
-{ "mprfw", 0x38060000, 0xfc0f0000, "r,R", 2 },
-{ "nop", 0x00020000, 0xffff0000, "", 2 },
-{ "ormb", 0x88080000, 0xfc080000, "r,xOA,X", 4 },
-{ "ormd", 0x88000002, 0xfc080002, "r,xOA,X", 4 },
-{ "ormh", 0x88000001, 0xfc080001, "r,xOA,X", 4 },
-{ "ormw", 0x88000000, 0xfc080000, "r,xOA,X", 4 },
-{ "orr", 0x08000000, 0xfc0f0000, "r,R", 2 },
-{ "orrm", 0x08080000, 0xfc0f0000, "r,R", 2 },
-{ "rdsts", 0x00090000, 0xfc7f0000, "r", 2 },
-{ "return", 0x280e0000, 0xfc7f0000, "", 2 },
-{ "ri", 0xfc020000, 0xfc07ffff, "I", 4 },
-{ "rnd", 0x00050000, 0xfc7f0000, "r", 2 },
-{ "rpswt", 0x040b0000, 0xfc7f0000, "r", 2 },
-{ "rschnl", 0xfc2f0000, 0xfc7f8000, "r,I", 4 },
-{ "rsctl", 0xfc470000, 0xfc7f8000, "r,I", 4 },
-{ "rwcs", 0x000b0000, 0xfc0f0000, "r,R", 2 },
-{ "sacz", 0x10080000, 0xfc0f0000, "r,R", 2 },
-{ "sbm", 0x98080000, 0xfc080000, "f,xOA,X", 4 },
-{ "sbr", 0x18000000, 0xfc0c0000, "r,f", 4 },
-{ "sea", 0x000d0000, 0xffff0000, "", 2 },
-{ "setcpu", 0x2c090000, 0xfc7f0000, "r", 2 },
-{ "sio", 0xfc170000, 0xfc7f8000, "r,I", 4 },
-{ "sipu", 0x000a0000, 0xffff0000, "", 2 },
-{ "sla", 0x1c400000, 0xfc600000, "r,S", 2 },
-{ "slad", 0x20400000, 0xfc600000, "r,S", 2 },
-{ "slc", 0x24400000, 0xfc600000, "r,S", 2 },
-{ "sll", 0x1c600000, 0xfc600000, "r,S", 2 },
-{ "slld", 0x20600000, 0xfc600000, "r,S", 2 },
-{ "smc", 0x04070000, 0xfc070000, "", 2 },
-{ "sra", 0x1c000000, 0xfc600000, "r,S", 2 },
-{ "srad", 0x20000000, 0xfc600000, "r,S", 2 },
-{ "src", 0x24000000, 0xfc600000, "r,S", 2 },
-{ "srl", 0x1c200000, 0xfc600000, "r,S", 2 },
-{ "srld", 0x20200000, 0xfc600000, "r,S", 2 },
-{ "stb", 0xd4080000, 0xfc080000, "r,xOA,X", 4 },
-{ "std", 0xd4000002, 0xfc080002, "r,xOA,X", 4 },
-{ "stf", 0xdc000000, 0xfc080000, "r,xOA,X", 4 },
-{ "stfbr", 0x54000000, 0xfc080000, "b,xOA,X", 4 },
-{ "sth", 0xd4000001, 0xfc080001, "r,xOA,X", 4 },
-{ "stmb", 0xd8080000, 0xfc080000, "r,xOA,X", 4 },
-{ "stmd", 0xd8000002, 0xfc080002, "r,xOA,X", 4 },
-{ "stmh", 0xd8000001, 0xfc080001, "r,xOA,X", 4 },
-{ "stmw", 0xd8000000, 0xfc080000, "r,xOA,X", 4 },
-{ "stpio", 0xfc270000, 0xfc7f8000, "r,I", 4 },
-{ "stw", 0xd4000000, 0xfc080000, "r,xOA,X", 4 },
-{ "stwbr", 0x54000000, 0xfc080000, "b,xOA,X", 4 },
-{ "suabr", 0x58000000, 0xfc080000, "b,xOA,X", 4 },
-{ "sufd", 0xe0000002, 0xfc080002, "r,xOA,X", 4 },
-{ "sufw", 0xe0000000, 0xfc080000, "r,xOA,X", 4 },
-{ "sui", 0xc8020000, 0xfc7f0000, "r,I", 4 },
-{ "sumb", 0xbc080000, 0xfc080000, "r,xOA,X", 4 },
-{ "sumd", 0xbc000002, 0xfc080002, "r,xOA,X", 4 },
-{ "sumh", 0xbc000001, 0xfc080001, "r,xOA,X", 4 },
-{ "sumw", 0xbc000000, 0xfc080000, "r,xOA,X", 4 },
-{ "sur", 0x3c000000, 0xfc0f0000, "r,R", 2 },
-{ "surfd", 0x380b0000, 0xfc0f0000, "r,xOA,X", 4 },
-{ "surfw", 0x38030000, 0xfc0f0000, "r,R", 2 },
-{ "surm", 0x3c080000, 0xfc0f0000, "r,R", 2 },
-{ "svc", 0xc8060000, 0xffff0000, "", 4 },
-{ "tbm", 0xa4080000, 0xfc080000, "f,xOA,X", 4 },
-{ "tbr", 0x180c0000, 0xfc0c0000, "r,f", 2 },
-{ "tbrr", 0x2c020000, 0xfc0f0000, "r,B", 2 },
-{ "tccr", 0x28040000, 0xfc7f0000, "", 2 },
-{ "td", 0xfc050000, 0xfc070000, "r,f", 4 },
-{ "tio", 0xfc1f0000, 0xfc7f8000, "r,I", 4 },
-{ "tmapr", 0x2c0a0000, 0xfc0f0000, "r,R", 2 },
-{ "tpcbr", 0x280c0000, 0xfc7f0000, "r", 2 },
-{ "trbr", 0x2c010000, 0xfc0f0000, "b,R", 2 },
-{ "trc", 0x2c030000, 0xfc0f0000, "r,R", 2 },
-{ "trcc", 0x28050000, 0xfc7f0000, "", 2 },
-{ "trcm", 0x2c0b0000, 0xfc0f0000, "r,R", 2 },
-{ "trn", 0x2c040000, 0xfc0f0000, "r,R", 2 },
-{ "trnm", 0x2c0c0000, 0xfc0f0000, "r,R", 2 },
-{ "trr", 0x2c000000, 0xfc0f0000, "r,R", 2 },
-{ "trrm", 0x2c080000, 0xfc0f0000, "r,R", 2 },
-{ "trsc", 0x2c0e0000, 0xfc0f0000, "r,R", 2 },
-{ "trsw", 0x28000000, 0xfc7f0000, "r", 2 },
-{ "tscr", 0x2c0f0000, 0xfc0f0000, "r,R", 2 },
-{ "uei", 0x00070000, 0xffff0000, "", 2 },
-{ "wait", 0x00010000, 0xffff0000, "", 2 },
-{ "wcwcs", 0xfc5f0000, 0xfc7f8000, "", 4 },
-{ "wwcs", 0x000c0000, 0xfc0f0000, "r,R", 2 },
-{ "xcbr", 0x28020000, 0xfc0f0000, "b,B", 2 },
-{ "xcr", 0x2c050000, 0xfc0f0000, "r,R", 2 },
-{ "xcrm", 0x2c0d0000, 0xfc0f0000, "r,R", 2 },
-{ "zbm", 0x9c080000, 0xfc080000, "f,xOA,X", 4 },
-{ "zbr", 0x18040000, 0xfc0c0000, "r,f", 2 },
-{ "zmb", 0xf8080000, 0xfc080000, "r,xOA,X", 4 },
-{ "zmd", 0xf8000002, 0xfc080002, "r,xOA,X", 4 },
-{ "zmh", 0xf8000001, 0xfc080001, "r,xOA,X", 4 },
-{ "zmw", 0xf8000000, 0xfc080000, "r,xOA,X", 4 },
-{ "zr", 0x0c000000, 0xfc0f0000, "r", 2 },
-};
-
-int numopcodes = sizeof(gld_opcodes) / sizeof(gld_opcodes[0]);
-
-struct gld_opcode *endop = gld_opcodes + sizeof(gld_opcodes) /
- sizeof(gld_opcodes[0]);
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
deleted file mode 100644
index ec96d49..0000000
--- a/gdb/printcmd.c
+++ /dev/null
@@ -1,2003 +0,0 @@
-/* Print values for GNU debugger GDB.
- Copyright (C) 1986-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "symtab.h"
-#include "value.h"
-#include "language.h"
-#include "expression.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "target.h"
-
-extern int asm_demangle; /* Whether to demangle syms in asm printouts */
-extern int addressprint; /* Whether to print hex addresses in HLL " */
-
-extern struct block *get_current_block ();
-
-static void print_frame_nameless_args ();
-
-struct format_data
-{
- int count;
- char format;
- char size;
-};
-
-/* Last specified output format. */
-
-static char last_format = 'x';
-
-/* Last specified examination size. 'b', 'h', 'w' or `q'. */
-
-static char last_size = 'w';
-
-/* Default address to examine next. */
-
-static CORE_ADDR next_address;
-
-/* Last address examined. */
-
-static CORE_ADDR last_examine_address;
-
-/* Contents of last address examined.
- This is not valid past the end of the `x' command! */
-
-static value last_examine_value;
-
-/* Number of auto-display expression currently being displayed.
- So that we can deleted it if we get an error or a signal within it.
- -1 when not doing one. */
-
-int current_display_number;
-
-/* Flag to low-level print routines that this value is being printed
- in an epoch window. We'd like to pass this as a parameter, but
- every routine would need to take it. Perhaps we can encapsulate
- this in the I/O stream once we have GNU stdio. */
-
-int inspect_it = 0;
-
-static void do_one_display ();
-
-void do_displays ();
-void print_scalar_formatted ();
-
-
-/* Decode a format specification. *STRING_PTR should point to it.
- OFORMAT and OSIZE are used as defaults for the format and size
- if none are given in the format specification.
- If OSIZE is zero, then the size field of the returned value
- should be set only if a size is explicitly specified by the
- user.
- The structure returned describes all the data
- found in the specification. In addition, *STRING_PTR is advanced
- past the specification and past all whitespace following it. */
-
-struct format_data
-decode_format (string_ptr, oformat, osize)
- char **string_ptr;
- char oformat;
- char osize;
-{
- struct format_data val;
- register char *p = *string_ptr;
-
- val.format = '?';
- val.size = '?';
- val.count = 1;
-
- if (*p >= '0' && *p <= '9')
- val.count = atoi (p);
- while (*p >= '0' && *p <= '9') p++;
-
- /* Now process size or format letters that follow. */
-
- while (1)
- {
- if (*p == 'b' || *p == 'h' || *p == 'w' || *p == 'g')
- val.size = *p++;
-#ifdef LONG_LONG
- else if (*p == 'l')
- {
- val.size = 'g';
- p++;
- }
-#endif
- else if (*p >= 'a' && *p <= 'z')
- val.format = *p++;
- else
- break;
- }
-
-#ifndef LONG_LONG
- /* Make sure 'g' size is not used on integer types.
- Well, actually, we can handle hex. */
- if (val.size == 'g' && val.format != 'f' && val.format != 'x')
- val.size = 'w';
-#endif
-
- while (*p == ' ' || *p == '\t') p++;
- *string_ptr = p;
-
- /* Set defaults for format and size if not specified. */
- if (val.format == '?')
- {
- if (val.size == '?')
- {
- /* Neither has been specified. */
- val.format = oformat;
- val.size = osize;
- }
- else
- /* If a size is specified, any format makes a reasonable
- default except 'i'. */
- val.format = oformat == 'i' ? 'x' : oformat;
- }
- else if (val.size == '?')
- switch (val.format)
- {
- case 'a':
- case 's':
- /* Addresses must be words. */
- val.size = osize ? 'w' : osize;
- break;
- case 'f':
- /* Floating point has to be word or giantword. */
- if (osize == 'w' || osize == 'g')
- val.size = osize;
- else
- /* Default it to giantword if the last used size is not
- appropriate. */
- val.size = osize ? 'g' : osize;
- break;
- case 'c':
- /* Characters default to one byte. */
- val.size = osize ? 'b' : osize;
- break;
- default:
- /* The default is the size most recently specified. */
- val.size = osize;
- }
-
- return val;
-}
-
-/* Print value VAL on stdout according to FORMAT, a letter or 0.
- Do not end with a newline.
- 0 means print VAL according to its own type.
- SIZE is the letter for the size of datum being printed.
- This is used to pad hex numbers so they line up. */
-
-static void
-print_formatted (val, format, size)
- register value val;
- register char format;
- char size;
-{
- int len = TYPE_LENGTH (VALUE_TYPE (val));
-
- if (VALUE_LVAL (val) == lval_memory)
- next_address = VALUE_ADDRESS (val) + len;
-
- switch (format)
- {
- case 's':
- next_address = VALUE_ADDRESS (val)
- + value_print (value_addr (val), stdout, format, Val_pretty_default);
- break;
-
- case 'i':
- wrap_here (""); /* Force output out, print_insn not using _filtered */
- next_address = VALUE_ADDRESS (val)
- + print_insn (VALUE_ADDRESS (val), stdout);
- break;
-
- default:
- if (format == 0
- || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_ARRAY
- || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_STRUCT
- || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_UNION
- || VALUE_REPEATED (val))
- value_print (val, stdout, format, Val_pretty_default);
- else
- print_scalar_formatted (VALUE_CONTENTS (val), VALUE_TYPE (val),
- format, size, stdout);
- }
-}
-
-/* Print a scalar of data of type TYPE, pointed to in GDB by VALADDR,
- according to letters FORMAT and SIZE on STREAM.
- FORMAT may not be zero. Formats s and i are not supported at this level.
-
- This is how the elements of an array or structure are printed
- with a format. */
-
-void
-print_scalar_formatted (valaddr, type, format, size, stream)
- char *valaddr;
- struct type *type;
- char format;
- int size;
- FILE *stream;
-{
- LONGEST val_long;
- int len = TYPE_LENGTH (type);
-
- if (size == 'g' && sizeof (LONGEST) < 8
- && format == 'x')
- {
- /* ok, we're going to have to get fancy here. Assumption: a
- long is four bytes. FIXME. */
- unsigned long v1, v2;
-
- v1 = unpack_long (builtin_type_long, valaddr);
- v2 = unpack_long (builtin_type_long, valaddr + 4);
-
-#if TARGET_BYTE_ORDER == LITTLE_ENDIAN
- /* Swap the two for printing */
- {
- unsigned long tmp;
-
- tmp = v1;
- v1 = v2;
- v2 = tmp;
- }
-#endif
-
- switch (format)
- {
- case 'x':
- fprintf_filtered (stream, local_hex_format_custom("08x%08"), v1, v2);
- break;
- default:
- error ("Output size \"g\" unimplemented for format \"%c\".",
- format);
- }
- return;
- }
-
- val_long = unpack_long (type, valaddr);
-
- /* If value is unsigned, truncate it in case negative. */
- if (format != 'd')
- {
- if (len == sizeof (char))
- val_long &= (1 << 8 * sizeof(char)) - 1;
- else if (len == sizeof (short))
- val_long &= (1 << 8 * sizeof(short)) - 1;
- else if (len == sizeof (long))
- val_long &= (unsigned long) - 1;
- }
-
- switch (format)
- {
- case 'x':
- if (!size)
- {
- /* no size specified, like in print. Print varying # of digits. */
-#if defined (LONG_LONG)
- fprintf_filtered (stream, local_hex_format_custom("ll"), val_long);
-#else /* not LONG_LONG. */
- fprintf_filtered (stream, local_hex_format_custom("l"), val_long);
-#endif /* not LONG_LONG. */
- }
- else
-#if defined (LONG_LONG)
- switch (size)
- {
- case 'b':
- fprintf_filtered (stream, local_hex_format_custom("02ll"), val_long);
- break;
- case 'h':
- fprintf_filtered (stream, local_hex_format_custom("04ll"), val_long);
- break;
- case 'w':
- fprintf_filtered (stream, local_hex_format_custom("08ll"), val_long);
- break;
- case 'g':
- fprintf_filtered (stream, local_hex_format_custom("016ll"), val_long);
- break;
- default:
- error ("Undefined output size \"%c\".", size);
- }
-#else /* not LONG_LONG. */
- switch (size)
- {
- case 'b':
- fprintf_filtered (stream, local_hex_format_custom("02"), val_long);
- break;
- case 'h':
- fprintf_filtered (stream, local_hex_format_custom("04"), val_long);
- break;
- case 'w':
- fprintf_filtered (stream, local_hex_format_custom("08"), val_long);
- break;
- case 'g':
- fprintf_filtered (stream, local_hex_format_custom("016"), val_long);
- break;
- default:
- error ("Undefined output size \"%c\".", size);
- }
-#endif /* not LONG_LONG */
- break;
-
- case 'd':
-#ifdef LONG_LONG
- fprintf_filtered (stream, "%lld", val_long);
-#else
- fprintf_filtered (stream, "%d", val_long);
-#endif
- break;
-
- case 'u':
-#ifdef LONG_LONG
- fprintf_filtered (stream, "%llu", val_long);
-#else
- fprintf_filtered (stream, "%u", val_long);
-#endif
- break;
-
- case 'o':
- if (val_long)
-#ifdef LONG_LONG
- fprintf_filtered (stream, local_octal_format_custom("ll"), val_long);
-#else
- fprintf_filtered (stream, local_octal_format(), val_long);
-#endif
- else
- fprintf_filtered (stream, "0");
- break;
-
- case 'a':
- print_address (unpack_pointer (type, valaddr), stream);
- break;
-
- case 'c':
- value_print (value_from_longest (builtin_type_char, val_long), stream, 0,
- Val_pretty_default);
- break;
-
- case 'f':
- if (len == sizeof (float))
- type = builtin_type_float;
- else if (len == sizeof (double))
- type = builtin_type_double;
- print_floating (valaddr, type, stream);
- break;
-
- case 0:
- abort ();
-
- case 't':
- /* Binary; 't' stands for "two". */
- {
- char bits[8*(sizeof val_long) + 1];
- char *cp = bits;
- int width;
-
- if (!size)
- width = 8*(sizeof val_long);
- else
- switch (size)
- {
- case 'b':
- width = 8;
- break;
- case 'h':
- width = 16;
- break;
- case 'w':
- width = 32;
- break;
- case 'g':
- width = 64;
- break;
- default:
- error ("Undefined output size \"%c\".", size);
- }
-
- bits[width] = '\0';
- while (width-- > 0)
- {
- bits[width] = (val_long & 1) ? '1' : '0';
- val_long >>= 1;
- }
- if (!size)
- {
- while (*cp && *cp == '0')
- cp++;
- if (*cp == '\0')
- cp--;
- }
- fprintf_filtered (stream, cp);
- }
- break;
-
- default:
- error ("Undefined output format \"%c\".", format);
- }
-}
-
-/* Specify default address for `x' command.
- `info lines' uses this. */
-
-void
-set_next_address (addr)
- CORE_ADDR addr;
-{
- next_address = addr;
-
- /* Make address available to the user as $_. */
- set_internalvar (lookup_internalvar ("_"),
- value_from_longest (lookup_pointer_type (builtin_type_void),
- (LONGEST) addr));
-}
-
-/* Optionally print address ADDR symbolically as <SYMBOL+OFFSET> on STREAM,
- after LEADIN. Print nothing if no symbolic name is found nearby.
- DO_DEMANGLE controls whether to print a symbol in its native "raw" form,
- or to interpret it as a possible C++ name and convert it back to source
- form. */
-
-void
-print_address_symbolic (addr, stream, do_demangle, leadin)
- CORE_ADDR addr;
- FILE *stream;
- int do_demangle;
- char *leadin;
-{
- int name_location;
- register int i = find_pc_misc_function (addr);
-
- /* If nothing comes out, don't print anything symbolic. */
-
- if (i < 0)
- return;
-
- fputs_filtered (leadin, stream);
- fputs_filtered ("<", stream);
- if (do_demangle)
- fputs_demangled (misc_function_vector[i].name, stream, 1);
- else
- fputs_filtered (misc_function_vector[i].name, stream);
- name_location = misc_function_vector[i].address;
- if (addr - name_location)
- fprintf_filtered (stream, "+%d>", addr - name_location);
- else
- fputs_filtered (">", stream);
-}
-
-/* Print address ADDR symbolically on STREAM.
- First print it as a number. Then perhaps print
- <SYMBOL + OFFSET> after the number. */
-
-void
-print_address (addr, stream)
- CORE_ADDR addr;
- FILE *stream;
-{
- fprintf_filtered (stream, local_hex_format(), addr);
- print_address_symbolic (addr, stream, asm_demangle, " ");
-}
-
-/* Print address ADDR symbolically on STREAM. Parameter DEMANGLE
- controls whether to print the symbolic name "raw" or demangled.
- Global setting "addressprint" controls whether to print hex address
- or not. */
-
-void
-print_address_demangle (addr, stream, do_demangle)
- CORE_ADDR addr;
- FILE *stream;
- int do_demangle;
-{
- if (addr == 0) {
- fprintf_filtered (stream, "0");
- } else if (addressprint) {
- fprintf_filtered (stream, local_hex_format(), addr);
- print_address_symbolic (addr, stream, do_demangle, " ");
- } else {
- print_address_symbolic (addr, stream, do_demangle, "");
- }
-}
-
-
-/* Examine data at address ADDR in format FMT.
- Fetch it from memory and print on stdout. */
-
-static void
-do_examine (fmt, addr)
- struct format_data fmt;
- CORE_ADDR addr;
-{
- register char format = 0;
- register char size;
- register int count = 1;
- struct type *val_type;
- register int i;
- register int maxelts;
-
- format = fmt.format;
- size = fmt.size;
- count = fmt.count;
- next_address = addr;
-
- /* String or instruction format implies fetch single bytes
- regardless of the specified size. */
- if (format == 's' || format == 'i')
- size = 'b';
-
- if (size == 'b')
- val_type = builtin_type_char;
- else if (size == 'h')
- val_type = builtin_type_short;
- else if (size == 'w')
- val_type = builtin_type_long;
- else if (size == 'g')
-#ifndef LONG_LONG
- val_type = builtin_type_double;
-#else
- val_type = builtin_type_long_long;
-#endif
-
- maxelts = 8;
- if (size == 'w')
- maxelts = 4;
- if (size == 'g')
- maxelts = 2;
- if (format == 's' || format == 'i')
- maxelts = 1;
-
- /* Print as many objects as specified in COUNT, at most maxelts per line,
- with the address of the next one at the start of each line. */
-
- while (count > 0)
- {
- print_address (next_address, stdout);
- printf_filtered (":");
- for (i = maxelts;
- i > 0 && count > 0;
- i--, count--)
- {
- printf_filtered ("\t");
- /* Note that print_formatted sets next_address for the next
- object. */
- last_examine_address = next_address;
- last_examine_value = value_at (val_type, next_address);
- print_formatted (last_examine_value, format, size);
- }
- printf_filtered ("\n");
- fflush (stdout);
- }
-}
-
-static void
-validate_format (fmt, cmdname)
- struct format_data fmt;
- char *cmdname;
-{
- if (fmt.size != 0)
- error ("Size letters are meaningless in \"%s\" command.", cmdname);
- if (fmt.count != 1)
- error ("Item count other than 1 is meaningless in \"%s\" command.",
- cmdname);
- if (fmt.format == 'i' || fmt.format == 's')
- error ("Format letter \"%c\" is meaningless in \"%s\" command.",
- fmt.format, cmdname);
-}
-
-static void
-print_command_1 (exp, inspect, voidprint)
- char *exp;
- int inspect;
- int voidprint;
-{
- struct expression *expr;
- register struct cleanup *old_chain = 0;
- register char format = 0;
- register value val;
- struct format_data fmt;
- int cleanup = 0;
-
- /* Pass inspect flag to the rest of the print routines in a global (sigh). */
- inspect_it = inspect;
-
- if (exp && *exp == '/')
- {
- exp++;
- fmt = decode_format (&exp, last_format, 0);
- validate_format (fmt, "print");
- last_format = format = fmt.format;
- }
- else
- {
- fmt.count = 1;
- fmt.format = 0;
- fmt.size = 0;
- }
-
- if (exp && *exp)
- {
- extern int objectprint;
- struct type *type;
- expr = parse_expression (exp);
- old_chain = make_cleanup (free_current_contents, &expr);
- cleanup = 1;
- val = evaluate_expression (expr);
-
- /* C++: figure out what type we actually want to print it as. */
- type = VALUE_TYPE (val);
-
- if (objectprint
- && (TYPE_CODE (type) == TYPE_CODE_PTR
- || TYPE_CODE (type) == TYPE_CODE_REF)
- && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT)
- {
- value v;
-
- v = value_from_vtable_info (val, TYPE_TARGET_TYPE (type));
- if (v != 0)
- {
- val = v;
- type = VALUE_TYPE (val);
- }
- }
- }
- else
- val = access_value_history (0);
-
- if (voidprint || (val && VALUE_TYPE (val) &&
- TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_VOID))
- {
- int histindex = record_latest_value (val);
-
- if (inspect)
- printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
- else
- if (histindex >= 0) printf_filtered ("$%d = ", histindex);
-
- print_formatted (val, format, fmt.size);
- printf_filtered ("\n");
- if (inspect)
- printf("\") )\030");
- }
-
- if (cleanup)
- do_cleanups (old_chain);
- inspect_it = 0; /* Reset print routines to normal */
-}
-
-/* ARGSUSED */
-static void
-print_command (exp, from_tty)
- char *exp;
- int from_tty;
-{
- print_command_1 (exp, 0, 1);
-}
-
-/* Same as print, except in epoch, it gets its own window */
-/* ARGSUSED */
-static void
-inspect_command (exp, from_tty)
- char *exp;
- int from_tty;
-{
- extern int epoch_interface;
-
- print_command_1 (exp, epoch_interface, 1);
-}
-
-/* Same as print, except it doesn't print void results. */
-/* ARGSUSED */
-static void
-call_command (exp, from_tty)
- char *exp;
- int from_tty;
-{
- print_command_1 (exp, 0, 0);
-}
-
-/* ARGSUSED */
-static void
-output_command (exp, from_tty)
- char *exp;
- int from_tty;
-{
- struct expression *expr;
- register struct cleanup *old_chain;
- register char format = 0;
- register value val;
- struct format_data fmt;
-
- if (exp && *exp == '/')
- {
- exp++;
- fmt = decode_format (&exp, 0, 0);
- validate_format (fmt, "print");
- format = fmt.format;
- }
-
- expr = parse_expression (exp);
- old_chain = make_cleanup (free_current_contents, &expr);
-
- val = evaluate_expression (expr);
-
- print_formatted (val, format, fmt.size);
-
- do_cleanups (old_chain);
-}
-
-/* ARGSUSED */
-static void
-set_command (exp, from_tty)
- char *exp;
- int from_tty;
-{
- struct expression *expr = parse_expression (exp);
- register struct cleanup *old_chain
- = make_cleanup (free_current_contents, &expr);
- evaluate_expression (expr);
- do_cleanups (old_chain);
-}
-
-/* ARGSUSED */
-static void
-address_info (exp, from_tty)
- char *exp;
- int from_tty;
-{
- register struct symbol *sym;
- register long val;
- int is_a_field_of_this; /* C++: lookup_symbol sets this to nonzero
- if exp is a field of `this'. */
-
- if (exp == 0)
- error ("Argument required.");
-
- sym = lookup_symbol (exp, get_selected_block (), VAR_NAMESPACE,
- &is_a_field_of_this, (struct symtab **)NULL);
- if (sym == 0)
- {
- register int i;
-
- if (is_a_field_of_this)
- {
- printf ("Symbol \"%s\" is a field of the local class variable `this'\n", exp);
- return;
- }
-
- for (i = 0; i < misc_function_count; i++)
- if (!strcmp (misc_function_vector[i].name, exp))
- break;
-
- if (i < misc_function_count)
- printf ("Symbol \"%s\" is at %s in a file compiled without debugging.\n",
- exp, local_hex_string(misc_function_vector[i].address));
- else
- error ("No symbol \"%s\" in current context.", exp);
- return;
- }
-
- printf ("Symbol \"%s\" is ", SYMBOL_NAME (sym));
- val = SYMBOL_VALUE (sym);
-
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_CONST:
- case LOC_CONST_BYTES:
- printf ("constant");
- break;
-
- case LOC_LABEL:
- printf ("a label at address %s", local_hex_string(SYMBOL_VALUE_ADDRESS (sym)));
- break;
-
- case LOC_REGISTER:
- printf ("a variable in register %s", reg_names[val]);
- break;
-
- case LOC_STATIC:
- printf ("static storage at address %s", local_hex_string(SYMBOL_VALUE_ADDRESS (sym)));
- break;
-
- case LOC_REGPARM:
- printf ("an argument in register %s", reg_names[val]);
- break;
-
- case LOC_ARG:
- printf ("an argument at offset %ld", val);
- break;
-
- case LOC_LOCAL_ARG:
- printf ("an argument at frame offset %ld", val);
- break;
-
- case LOC_LOCAL:
- printf ("a local variable at frame offset %ld", val);
- break;
-
- case LOC_REF_ARG:
- printf ("a reference argument at offset %ld", val);
- break;
-
- case LOC_TYPEDEF:
- printf ("a typedef");
- break;
-
- case LOC_BLOCK:
- printf ("a function at address %s",
- local_hex_string(BLOCK_START (SYMBOL_BLOCK_VALUE (sym))));
- break;
-
- default:
- printf ("of unknown (botched) type");
- break;
- }
- printf (".\n");
-}
-
-static void
-x_command (exp, from_tty)
- char *exp;
- int from_tty;
-{
- struct expression *expr;
- struct format_data fmt;
- struct cleanup *old_chain;
- struct value *val;
-
- fmt.format = last_format;
- fmt.size = last_size;
- fmt.count = 1;
-
- if (exp && *exp == '/')
- {
- exp++;
- fmt = decode_format (&exp, last_format, last_size);
- last_size = fmt.size;
- last_format = fmt.format;
- }
-
- /* If we have an expression, evaluate it and use it as the address. */
-
- if (exp != 0 && *exp != 0)
- {
- expr = parse_expression (exp);
- /* Cause expression not to be there any more
- if this command is repeated with Newline.
- But don't clobber a user-defined command's definition. */
- if (from_tty)
- *exp = 0;
- old_chain = make_cleanup (free_current_contents, &expr);
- val = evaluate_expression (expr);
- if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_REF)
- val = value_ind (val);
- /* In rvalue contexts, such as this, functions are coerced into
- pointers to functions. This makes "x/i main" work. */
- if (/* last_format == 'i'
- && */ TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC
- && VALUE_LVAL (val) == lval_memory)
- next_address = VALUE_ADDRESS (val);
- else
- next_address = value_as_pointer (val);
- do_cleanups (old_chain);
- }
-
- do_examine (fmt, next_address);
-
- /* Set a couple of internal variables if appropriate. */
- if (last_examine_value)
- {
- /* Make last address examined available to the user as $_. Use
- the correct pointer type. */
- set_internalvar (lookup_internalvar ("_"),
- value_from_longest (
- lookup_pointer_type (VALUE_TYPE (last_examine_value)),
- (LONGEST) last_examine_address));
-
- /* Make contents of last address examined available to the user as $__.*/
- set_internalvar (lookup_internalvar ("__"), last_examine_value);
- }
-}
-
-/* Commands for printing types of things. */
-
-/* Print type of EXP, or last thing in value history if EXP == NULL.
- show is passed to type_print. */
-static void
-whatis_exp (exp, show)
- char *exp;
- int show;
-{
- struct expression *expr;
- register value val;
- register struct cleanup *old_chain;
-
- if (exp)
- {
- expr = parse_expression (exp);
- old_chain = make_cleanup (free_current_contents, &expr);
- val = evaluate_type (expr);
- }
- else
- val = access_value_history (0);
-
- printf_filtered ("type = ");
- type_print (VALUE_TYPE (val), "", stdout, show);
- printf_filtered ("\n");
-
- if (exp)
- do_cleanups (old_chain);
-}
-
-/* ARGSUSED */
-static void
-whatis_command (exp, from_tty)
- char *exp;
- int from_tty;
-{
- /* Most of the time users do not want to see all the fields
- in a structure. If they do they can use the "ptype" command.
- Hence the "-1" below. */
- whatis_exp (exp, -1);
-}
-
-/* Simple subroutine for ptype_command. */
-static
-struct type *
-ptype_eval(exp)
- struct expression *exp;
-{
- if(exp->elts[0].opcode==OP_TYPE)
- return exp->elts[1].type;
- else
- return 0;
-}
-
-/* TYPENAME is either the name of a type, or an expression. */
-/* ARGSUSED */
-static void
-ptype_command (typename, from_tty)
- char *typename;
- int from_tty;
-{
- register struct type *type;
- struct expression *expr;
- register struct cleanup *old_chain;
-
- if (typename)
- {
- expr = parse_expression (typename);
- old_chain = make_cleanup (free_current_contents, &expr);
- type = ptype_eval (expr);
-
- if(type)
- {
- printf_filtered ("type = ");
- type_print (type, "", stdout, 1);
- printf_filtered ("\n");
- do_cleanups (old_chain);
- }
- else
- {
- do_cleanups (old_chain);
- whatis_exp (typename, 1);
- }
- }
- else
- whatis_exp (typename, 1);
-}
-
-enum display_status {disabled, enabled};
-
-struct display
-{
- /* Chain link to next auto-display item. */
- struct display *next;
- /* Expression to be evaluated and displayed. */
- struct expression *exp;
- /* Item number of this auto-display item. */
- int number;
- /* Display format specified. */
- struct format_data format;
- /* Innermost block required by this expression when evaluated */
- struct block *block;
- /* Status of this display (enabled or disabled) */
- enum display_status status;
-};
-
-/* Chain of expressions whose values should be displayed
- automatically each time the program stops. */
-
-static struct display *display_chain;
-
-static int display_number;
-
-/* Add an expression to the auto-display chain.
- Specify the expression. */
-
-static void
-display_command (exp, from_tty)
- char *exp;
- int from_tty;
-{
- struct format_data fmt;
- register struct expression *expr;
- register struct display *new;
-
- if (exp == 0)
- {
- do_displays ();
- return;
- }
-
- if (*exp == '/')
- {
- exp++;
- fmt = decode_format (&exp, 0, 0);
- if (fmt.size && fmt.format == 0)
- fmt.format = 'x';
- if (fmt.format == 'i' || fmt.format == 's')
- fmt.size = 'b';
- }
- else
- {
- fmt.format = 0;
- fmt.size = 0;
- fmt.count = 0;
- }
-
- innermost_block = 0;
- expr = parse_expression (exp);
-
- new = (struct display *) xmalloc (sizeof (struct display));
-
- new->exp = expr;
- new->block = innermost_block;
- new->next = display_chain;
- new->number = ++display_number;
- new->format = fmt;
- new->status = enabled;
- display_chain = new;
-
- if (from_tty && target_has_execution)
- do_one_display (new);
-
- dont_repeat ();
-}
-
-static void
-free_display (d)
- struct display *d;
-{
- free (d->exp);
- free (d);
-}
-
-/* Clear out the display_chain.
- Done when new symtabs are loaded, since this invalidates
- the types stored in many expressions. */
-
-void
-clear_displays ()
-{
- register struct display *d;
-
- while (d = display_chain)
- {
- free (d->exp);
- display_chain = d->next;
- free (d);
- }
-}
-
-/* Delete the auto-display number NUM. */
-
-void
-delete_display (num)
- int num;
-{
- register struct display *d1, *d;
-
- if (!display_chain)
- error ("No display number %d.", num);
-
- if (display_chain->number == num)
- {
- d1 = display_chain;
- display_chain = d1->next;
- free_display (d1);
- }
- else
- for (d = display_chain; ; d = d->next)
- {
- if (d->next == 0)
- error ("No display number %d.", num);
- if (d->next->number == num)
- {
- d1 = d->next;
- d->next = d1->next;
- free_display (d1);
- break;
- }
- }
-}
-
-/* Delete some values from the auto-display chain.
- Specify the element numbers. */
-
-static void
-undisplay_command (args)
- char *args;
-{
- register char *p = args;
- register char *p1;
- register int num;
-
- if (args == 0)
- {
- if (query ("Delete all auto-display expressions? "))
- clear_displays ();
- dont_repeat ();
- return;
- }
-
- while (*p)
- {
- p1 = p;
- while (*p1 >= '0' && *p1 <= '9') p1++;
- if (*p1 && *p1 != ' ' && *p1 != '\t')
- error ("Arguments must be display numbers.");
-
- num = atoi (p);
-
- delete_display (num);
-
- p = p1;
- while (*p == ' ' || *p == '\t') p++;
- }
- dont_repeat ();
-}
-
-/* Display a single auto-display.
- Do nothing if the display cannot be printed in the current context,
- or if the display is disabled. */
-
-static void
-do_one_display (d)
- struct display *d;
-{
- int within_current_scope;
-
- if (d->status == disabled)
- return;
-
- if (d->block)
- within_current_scope = contained_in (get_selected_block (), d->block);
- else
- within_current_scope = 1;
- if (!within_current_scope)
- return;
-
- current_display_number = d->number;
-
- printf_filtered ("%d: ", d->number);
- if (d->format.size)
- {
- CORE_ADDR addr;
-
- printf_filtered ("x/");
- if (d->format.count != 1)
- printf_filtered ("%d", d->format.count);
- printf_filtered ("%c", d->format.format);
- if (d->format.format != 'i' && d->format.format != 's')
- printf_filtered ("%c", d->format.size);
- printf_filtered (" ");
- print_expression (d->exp, stdout);
- if (d->format.count != 1)
- printf_filtered ("\n");
- else
- printf_filtered (" ");
-
- addr = value_as_pointer (evaluate_expression (d->exp));
- if (d->format.format == 'i')
- addr = ADDR_BITS_REMOVE (addr);
-
- do_examine (d->format, addr);
- }
- else
- {
- if (d->format.format)
- printf_filtered ("/%c ", d->format.format);
- print_expression (d->exp, stdout);
- printf_filtered (" = ");
- print_formatted (evaluate_expression (d->exp),
- d->format.format, d->format.size);
- printf_filtered ("\n");
- }
-
- fflush (stdout);
- current_display_number = -1;
-}
-
-/* Display all of the values on the auto-display chain which can be
- evaluated in the current scope. */
-
-void
-do_displays ()
-{
- register struct display *d;
-
- for (d = display_chain; d; d = d->next)
- do_one_display (d);
-}
-
-/* Delete the auto-display which we were in the process of displaying.
- This is done when there is an error or a signal. */
-
-void
-disable_display (num)
- int num;
-{
- register struct display *d;
-
- for (d = display_chain; d; d = d->next)
- if (d->number == num)
- {
- d->status = disabled;
- return;
- }
- printf ("No display number %d.\n", num);
-}
-
-void
-disable_current_display ()
-{
- if (current_display_number >= 0)
- {
- disable_display (current_display_number);
- fprintf (stderr, "Disabling display %d to avoid infinite recursion.\n",
- current_display_number);
- }
- current_display_number = -1;
-}
-
-static void
-display_info ()
-{
- register struct display *d;
-
- if (!display_chain)
- printf ("There are no auto-display expressions now.\n");
- else
- printf_filtered ("Auto-display expressions now in effect:\n\
-Num Enb Expression\n");
-
- for (d = display_chain; d; d = d->next)
- {
- printf_filtered ("%d: %c ", d->number, "ny"[(int)d->status]);
- if (d->format.size)
- printf_filtered ("/%d%c%c ", d->format.count, d->format.size,
- d->format.format);
- else if (d->format.format)
- printf_filtered ("/%c ", d->format.format);
- print_expression (d->exp, stdout);
- if (d->block && !contained_in (get_selected_block (), d->block))
- printf_filtered (" (cannot be evaluated in the current context)");
- printf_filtered ("\n");
- fflush (stdout);
- }
-}
-
-void
-enable_display (args)
- char *args;
-{
- register char *p = args;
- register char *p1;
- register int num;
- register struct display *d;
-
- if (p == 0)
- {
- for (d = display_chain; d; d = d->next)
- d->status = enabled;
- }
- else
- while (*p)
- {
- p1 = p;
- while (*p1 >= '0' && *p1 <= '9')
- p1++;
- if (*p1 && *p1 != ' ' && *p1 != '\t')
- error ("Arguments must be display numbers.");
-
- num = atoi (p);
-
- for (d = display_chain; d; d = d->next)
- if (d->number == num)
- {
- d->status = enabled;
- goto win;
- }
- printf ("No display number %d.\n", num);
- win:
- p = p1;
- while (*p == ' ' || *p == '\t')
- p++;
- }
-}
-
-/* ARGSUSED */
-void
-disable_display_command (args, from_tty)
- char *args;
- int from_tty;
-{
- register char *p = args;
- register char *p1;
- register struct display *d;
-
- if (p == 0)
- {
- for (d = display_chain; d; d = d->next)
- d->status = disabled;
- }
- else
- while (*p)
- {
- p1 = p;
- while (*p1 >= '0' && *p1 <= '9')
- p1++;
- if (*p1 && *p1 != ' ' && *p1 != '\t')
- error ("Arguments must be display numbers.");
-
- disable_display (atoi (p));
-
- p = p1;
- while (*p == ' ' || *p == '\t')
- p++;
- }
-}
-
-
-/* Print the value in stack frame FRAME of a variable
- specified by a struct symbol. */
-
-void
-print_variable_value (var, frame, stream)
- struct symbol *var;
- FRAME frame;
- FILE *stream;
-{
- value val = read_var_value (var, frame);
- value_print (val, stream, 0, Val_pretty_default);
-}
-
-/* Print the arguments of a stack frame, given the function FUNC
- running in that frame (as a symbol), the info on the frame,
- and the number of args according to the stack frame (or -1 if unknown). */
-
-/* References here and elsewhere to "number of args according to the
- stack frame" appear in all cases to refer to "number of ints of args
- according to the stack frame". At least for VAX, i386, isi. */
-
-void
-print_frame_args (func, fi, num, stream)
- struct symbol *func;
- struct frame_info *fi;
- int num;
- FILE *stream;
-{
- struct block *b;
- int nsyms = 0;
- int first = 1;
- register int i;
- register struct symbol *sym;
- register value val;
- /* Offset of next stack argument beyond the one we have seen that is
- at the highest offset.
- -1 if we haven't come to a stack argument yet. */
- long highest_offset = -1;
- int arg_size;
- /* Number of ints of arguments that we have printed so far. */
- int args_printed = 0;
-
- if (func)
- {
- b = SYMBOL_BLOCK_VALUE (func);
- nsyms = BLOCK_NSYMS (b);
- }
-
- for (i = 0; i < nsyms; i++)
- {
- QUIT;
- sym = BLOCK_SYM (b, i);
-
- /* Keep track of the highest stack argument offset seen, and
- skip over any kinds of symbols we don't care about. */
-
- switch (SYMBOL_CLASS (sym)) {
- case LOC_ARG:
- case LOC_REF_ARG:
- {
- long current_offset = SYMBOL_VALUE (sym);
-
- arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
-
- /* Compute address of next argument by adding the size of
- this argument and rounding to an int boundary. */
- current_offset
- = ((current_offset + arg_size + sizeof (int) - 1)
- & ~(sizeof (int) - 1));
-
- /* If this is the highest offset seen yet, set highest_offset. */
- if (highest_offset == -1
- || (current_offset > highest_offset))
- highest_offset = current_offset;
-
- /* Add the number of ints we're about to print to args_printed. */
- args_printed += (arg_size + sizeof (int) - 1) / sizeof (int);
- }
-
- /* We care about types of symbols, but don't need to keep track of
- stack offsets in them. */
- case LOC_REGPARM:
- case LOC_LOCAL_ARG:
- break;
-
- /* Other types of symbols we just skip over. */
- default:
- continue;
- }
-
- /* We have to re-look-up the symbol because arguments often have
- two entries (one a parameter, one a register or local), and the one
- we want is the non-parm, which lookup_symbol will find for
- us. After this, sym could be any SYMBOL_CLASS... */
- sym = lookup_symbol (SYMBOL_NAME (sym),
- b, VAR_NAMESPACE, (int *)NULL, (struct symtab **)NULL);
-
- /* Print the current arg. */
- if (! first)
- fprintf_filtered (stream, ", ");
- wrap_here (" ");
- fprint_symbol (stream, SYMBOL_NAME (sym));
- fputs_filtered ("=", stream);
-
- /* Avoid value_print because it will deref ref parameters. We just
- want to print their addresses. Print ??? for args whose address
- we do not know. We pass 2 as "recurse" to val_print because our
- standard indentation here is 4 spaces, and val_print indents
- 2 for each recurse. */
- val = read_var_value (sym, FRAME_INFO_ID (fi));
- if (val)
- val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
- stream, 0, 0, 2, Val_no_prettyprint);
- else
- fputs_filtered ("???", stream);
- first = 0;
- }
-
- /* Don't print nameless args in situations where we don't know
- enough about the stack to find them. */
- if (num != -1)
- {
- long start;
- CORE_ADDR addr;
-
- if (highest_offset == -1)
- start = FRAME_ARGS_SKIP;
- else
- start = highest_offset;
-
- addr = FRAME_ARGS_ADDRESS (fi);
- if (addr)
- print_frame_nameless_args (addr, start, num - args_printed,
- first, stream);
- }
-}
-
-/* Print nameless args on STREAM.
- ARGSADDR is the address of the arglist, START is the offset
- of the first nameless arg, and NUM is the number of nameless args to
- print. FIRST is nonzero if this is the first argument (not just
- the first nameless arg). */
-static void
-print_frame_nameless_args (argsaddr, start, num, first, stream)
- CORE_ADDR argsaddr;
- long start;
- int num;
- int first;
- FILE *stream;
-{
- int i;
- for (i = 0; i < num; i++)
- {
- QUIT;
- if (!first)
- fprintf_filtered (stream, ", ");
-#ifndef PRINT_TYPELESS_INTEGER
- fprintf_filtered (stream, "%d",
- read_memory_integer (argsaddr + start, sizeof (int)));
-#else
- PRINT_TYPELESS_INTEGER (stream, builtin_type_int,
- (LONGEST)
- read_memory_integer (argsaddr + start,
- sizeof (int)));
-#endif
- first = 0;
- start += sizeof (int);
- }
-}
-
-/* ARGSUSED */
-static void
-printf_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- register char *f;
- register char *s = arg;
- char *string;
- value *val_args;
- int nargs = 0;
- int allocated_args = 20;
- char *arg_bytes;
-
- val_args = (value *) xmalloc (allocated_args * sizeof (value));
-
- if (s == 0)
- error_no_arg ("format-control string and values to print");
-
- /* Skip white space before format string */
- while (*s == ' ' || *s == '\t') s++;
-
- /* A format string should follow, enveloped in double quotes */
- if (*s++ != '"')
- error ("Bad format string, missing '\"'.");
-
- /* Parse the format-control string and copy it into the string STRING,
- processing some kinds of escape sequence. */
-
- f = string = (char *) alloca (strlen (s) + 1);
- while (*s != '"')
- {
- int c = *s++;
- switch (c)
- {
- case '\0':
- error ("Bad format string, non-terminated '\"'.");
- /* doesn't return */
-
- case '\\':
- switch (c = *s++)
- {
- case '\\':
- *f++ = '\\';
- break;
- case 'n':
- *f++ = '\n';
- break;
- case 't':
- *f++ = '\t';
- break;
- case 'r':
- *f++ = '\r';
- break;
- case '"':
- *f++ = '"';
- break;
- default:
- /* ??? TODO: handle other escape sequences */
- error ("Unrecognized \\ escape character in format string.");
- }
- break;
-
- default:
- *f++ = c;
- }
- }
-
- /* Skip over " and following space and comma. */
- s++;
- *f++ = '\0';
- while (*s == ' ' || *s == '\t') s++;
-
- if (*s != ',' && *s != 0)
- error ("Invalid argument syntax");
-
- if (*s == ',') s++;
- while (*s == ' ' || *s == '\t') s++;
-
- {
- /* Now scan the string for %-specs and see what kinds of args they want.
- argclass[I] classifies the %-specs so we can give vprintf something
- of the right size. */
-
- enum argclass {int_arg, string_arg, double_arg, long_long_arg};
- enum argclass *argclass;
- int nargs_wanted;
- int argindex;
- int lcount;
- int i;
-
- argclass = (enum argclass *) alloca (strlen (s) * sizeof *argclass);
- nargs_wanted = 0;
- f = string;
- while (*f)
- if (*f++ == '%')
- {
- lcount = 0;
- while (strchr ("0123456789.hlL-+ #", *f))
- {
- if (*f == 'l' || *f == 'L')
- lcount++;
- f++;
- }
- if (*f == 's')
- argclass[nargs_wanted++] = string_arg;
- else if (*f == 'e' || *f == 'f' || *f == 'g')
- argclass[nargs_wanted++] = double_arg;
- else if (lcount > 1)
- argclass[nargs_wanted++] = long_long_arg;
- else if (*f != '%')
- argclass[nargs_wanted++] = int_arg;
- f++;
- }
-
- /* Now, parse all arguments and evaluate them.
- Store the VALUEs in VAL_ARGS. */
-
- while (*s != '\0')
- {
- char *s1;
- if (nargs == allocated_args)
- val_args = (value *) xrealloc (val_args,
- (allocated_args *= 2)
- * sizeof (value));
- s1 = s;
- val_args[nargs] = parse_to_comma_and_eval (&s1);
-
- /* If format string wants a float, unchecked-convert the value to
- floating point of the same size */
-
- if (argclass[nargs] == double_arg)
- {
- if (TYPE_LENGTH (VALUE_TYPE (val_args[nargs])) == sizeof (float))
- VALUE_TYPE (val_args[nargs]) = builtin_type_float;
- if (TYPE_LENGTH (VALUE_TYPE (val_args[nargs])) == sizeof (double))
- VALUE_TYPE (val_args[nargs]) = builtin_type_double;
- }
- nargs++;
- s = s1;
- if (*s == ',')
- s++;
- }
-
- if (nargs != nargs_wanted)
- error ("Wrong number of arguments for specified format-string");
-
- /* Now lay out an argument-list containing the arguments
- as doubles, integers and C pointers. */
-
- arg_bytes = (char *) alloca (sizeof (double) * nargs);
- argindex = 0;
- for (i = 0; i < nargs; i++)
- {
- if (argclass[i] == string_arg)
- {
- char *str;
- CORE_ADDR tem;
- int j;
- tem = value_as_pointer (val_args[i]);
-
- /* This is a %s argument. Find the length of the string. */
- for (j = 0; ; j++)
- {
- char c;
- QUIT;
- read_memory (tem + j, &c, 1);
- if (c == 0)
- break;
- }
-
- /* Copy the string contents into a string inside GDB. */
- str = (char *) alloca (j + 1);
- read_memory (tem, str, j);
- str[j] = 0;
-
- /* Pass address of internal copy as the arg to vprintf. */
- *((int *) &arg_bytes[argindex]) = (int) str;
- argindex += sizeof (int);
- }
- else if (VALUE_TYPE (val_args[i])->code == TYPE_CODE_FLT)
- {
- *((double *) &arg_bytes[argindex]) = value_as_double (val_args[i]);
- argindex += sizeof (double);
- }
- else
-#ifdef LONG_LONG
- if (argclass[i] == long_long_arg)
- {
- *(long long *) &arg_bytes[argindex] = value_as_long (val_args[i]);
- argindex += sizeof (long long);
- }
- else
-#endif
- {
- *((long *) &arg_bytes[argindex]) = value_as_long (val_args[i]);
- argindex += sizeof (long);
- }
- }
- }
-
- /* There is not a standard way to make a va_list, so we need
- to do various things for different systems. */
-#if defined (__INT_VARARGS_H)
- {
- va_list list;
-
- list.__va_arg = 0;
- list.__va_stk = (int *) arg_bytes;
- list.__va_reg = (int *) arg_bytes;
- vprintf (string, list);
- }
-#else /* No __INT_VARARGS_H. */
- vprintf (string, arg_bytes);
-#endif /* No __INT_VARARGS_H. */
-}
-
-/* Helper function for asdump_command. Finds the bounds of a function
- for a specified section of text. PC is an address within the
- function which you want bounds for; *LOW and *HIGH are set to the
- beginning (inclusive) and end (exclusive) of the function. This
- function returns 1 on success and 0 on failure. */
-
-static int
-containing_function_bounds (pc, low, high)
- CORE_ADDR pc, *low, *high;
-{
- int scan;
-
- if (!find_pc_partial_function (pc, 0, low))
- return 0;
-
- scan = *low;
- do {
- scan++;
- if (!find_pc_partial_function (scan, 0, high))
- return 0;
- } while (*low == *high);
-
- return 1;
-}
-
-/* Dump a specified section of assembly code. With no command line
- arguments, this command will dump the assembly code for the
- function surrounding the pc value in the selected frame. With one
- argument, it will dump the assembly code surrounding that pc value.
- Two arguments are interpeted as bounds within which to dump
- assembly. */
-
-/* ARGSUSED */
-static void
-disassemble_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- CORE_ADDR low, high;
- CORE_ADDR pc;
- char *space_index;
-
- if (!arg)
- {
- if (!selected_frame)
- error ("No frame selected.\n");
-
- pc = get_frame_pc (selected_frame);
- if (!containing_function_bounds (pc, &low, &high))
- error ("No function contains pc specified by selected frame.\n");
- }
- else if (!(space_index = (char *) strchr (arg, ' ')))
- {
- /* One argument. */
- pc = parse_and_eval_address (arg);
- if (!containing_function_bounds (pc, &low, &high))
- error ("No function contains specified pc.\n");
- }
- else
- {
- /* Two arguments. */
- *space_index = '\0';
- low = parse_and_eval_address (arg);
- high = parse_and_eval_address (space_index + 1);
- }
-
- printf_filtered ("Dump of assembler code ");
- if (!space_index)
- {
- char *name;
- find_pc_partial_function (pc, &name, 0);
- printf_filtered ("for function %s:\n", name);
- }
- else
- printf_filtered ("from %s ", local_hex_string(low));
- printf_filtered ("to %s:\n", local_hex_string(high));
-
- /* Dump the specified range. */
- for (pc = low; pc < high; )
- {
- QUIT;
- print_address (pc, stdout);
- printf_filtered (":\t");
- pc += print_insn (pc, stdout);
- printf_filtered ("\n");
- }
- printf_filtered ("End of assembler dump.\n");
- fflush (stdout);
-}
-
-
-void
-_initialize_printcmd ()
-{
- current_display_number = -1;
-
- add_info ("address", address_info,
- "Describe where variable VAR is stored.");
-
- add_com ("x", class_vars, x_command,
- "Examine memory: x/FMT ADDRESS.\n\
-ADDRESS is an expression for the memory address to examine.\n\
-FMT is a repeat count followed by a format letter and a size letter.\n\
-Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),\n\
- f(float), a(address), i(instruction), c(char) and s(string).\n\
-Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).\n\
- g is meaningful only with f, for type double.\n\
-The specified number of objects of the specified size are printed\n\
-according to the format.\n\n\
-Defaults for format and size letters are those previously used.\n\
-Default count is 1. Default address is following last thing printed\n\
-with this command or \"print\".");
-
- add_com ("disassemble", class_vars, disassemble_command,
- "Disassemble a specified section of memory.\n\
-Default is the function surrounding the pc of the selected frame.\n\
-With a single argument, the function surrounding that address is dumped.\n\
-Two arguments are taken as a range of memory to dump.");
-
- add_com ("ptype", class_vars, ptype_command,
- "Print definition of type TYPE.\n\
-Argument may be a type name defined by typedef, or \"struct STRUCTNAME\"\n\
-or \"union UNIONNAME\" or \"enum ENUMNAME\".\n\
-The selected stack frame's lexical context is used to look up the name.");
-
- add_com ("whatis", class_vars, whatis_command,
- "Print data type of expression EXP.");
-
-#if 0
- add_com ("whereis", class_vars, whereis_command,
- "Print line number and file of definition of variable.");
-#endif
-
- add_info ("display", display_info,
- "Expressions to display when program stops, with code numbers.");
-
- add_cmd ("undisplay", class_vars, undisplay_command,
- "Cancel some expressions to be displayed when program stops.\n\
-Arguments are the code numbers of the expressions to stop displaying.\n\
-No argument means cancel all automatic-display expressions.\n\
-\"delete display\" has the same effect as this command.\n\
-Do \"info display\" to see current list of code numbers.",
- &cmdlist);
-
- add_com ("display", class_vars, display_command,
- "Print value of expression EXP each time the program stops.\n\
-/FMT may be used before EXP as in the \"print\" command.\n\
-/FMT \"i\" or \"s\" or including a size-letter is allowed,\n\
-as in the \"x\" command, and then EXP is used to get the address to examine\n\
-and examining is done as in the \"x\" command.\n\n\
-With no argument, display all currently requested auto-display expressions.\n\
-Use \"undisplay\" to cancel display requests previously made.");
-
- add_cmd ("display", class_vars, enable_display,
- "Enable some expressions to be displayed when program stops.\n\
-Arguments are the code numbers of the expressions to resume displaying.\n\
-No argument means enable all automatic-display expressions.\n\
-Do \"info display\" to see current list of code numbers.", &enablelist);
-
- add_cmd ("display", class_vars, disable_display_command,
- "Disable some expressions to be displayed when program stops.\n\
-Arguments are the code numbers of the expressions to stop displaying.\n\
-No argument means disable all automatic-display expressions.\n\
-Do \"info display\" to see current list of code numbers.", &disablelist);
-
- add_cmd ("display", class_vars, undisplay_command,
- "Cancel some expressions to be displayed when program stops.\n\
-Arguments are the code numbers of the expressions to stop displaying.\n\
-No argument means cancel all automatic-display expressions.\n\
-Do \"info display\" to see current list of code numbers.", &deletelist);
-
- add_com ("printf", class_vars, printf_command,
- "printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\
-This is useful for formatted output in user-defined commands.");
- add_com ("output", class_vars, output_command,
- "Like \"print\" but don't put in value history and don't print newline.\n\
-This is useful in user-defined commands.");
-
- add_prefix_cmd ("set", class_vars, set_command,
-"Perform an assignment VAR = EXP.\n\
-You must type the \"=\". VAR may be a debugger \"convenience\" variable\n\
-(names starting with $), a register (a few standard names starting with $),\n\
-or an actual variable in the program being debugged. EXP is any expression.\n\
-Use \"set variable\" for variables with names identical to set subcommands.\n\
-\nWith a subcommand, this command modifies parts of the gdb environment.\n\
-You can see these environment settings with the \"show\" command.",
- &setlist, "set ", 1, &cmdlist);
-
- /* "call" is the same as "set", but handy for dbx users to call fns. */
- add_com ("call", class_vars, call_command,
- "Call a function in the inferior process.\n\
-The argument is the function name and arguments, in the notation of the\n\
-current working language. The result is printed and saved in the value\n\
-history, if it is not void.");
-
- add_cmd ("variable", class_vars, set_command,
- "Perform an assignment VAR = EXP.\n\
-You must type the \"=\". VAR may be a debugger \"convenience\" variable\n\
-(names starting with $), a register (a few standard names starting with $),\n\
-or an actual variable in the program being debugged. EXP is any expression.\n\
-This may usually be abbreviated to simply \"set\".",
- &setlist);
-
- add_com ("print", class_vars, print_command,
- concat ("Print value of expression EXP.\n\
-Variables accessible are those of the lexical environment of the selected\n\
-stack frame, plus all those whose scope is global or an entire file.\n\
-\n\
-$NUM gets previous value number NUM. $ and $$ are the last two values.\n\
-$$NUM refers to NUM'th value back from the last one.\n\
-Names starting with $ refer to registers (with the values they would have\n\
-if the program were to return to the stack frame now selected, restoring\n\
-all registers saved by frames farther in) or else to debugger\n\
-\"convenience\" variables (any such name not a known register).\n\
-Use assignment expressions to give values to convenience variables.\n",
- "\n\
-{TYPE}ADREXP refers to a datum of data type TYPE, located at address ADREXP.\n\
-@ is a binary operator for treating consecutive data objects\n\
-anywhere in memory as an array. FOO@NUM gives an array whose first\n\
-element is FOO, whose second element is stored in the space following\n\
-where FOO is stored, etc. FOO must be an expression whose value\n\
-resides in memory.\n",
- "\n\
-EXP may be preceded with /FMT, where FMT is a format letter\n\
-but no count or size letter (see \"x\" command)."));
- add_com_alias ("p", "print", class_vars, 1);
-
- add_com ("inspect", class_vars, inspect_command,
-"Same as \"print\" command, except that if you are running in the epoch\n\
-environment, the value is printed in its own window.");
-}
diff --git a/gdb/procfs.c b/gdb/procfs.c
deleted file mode 100644
index c745997..0000000
--- a/gdb/procfs.c
+++ /dev/null
@@ -1,1049 +0,0 @@
-/* Machine independent support for SVR4 /proc (process file system) for GDB.
- Copyright (C) 1991 Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-/* N O T E S
-
-For information on the details of using /proc consult section proc(4)
-in the UNIX System V Release 4 System Administrator's Reference Manual.
-
-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 "param.h"
-
-#ifdef USE_PROC_FS /* Entire file goes away if not using /proc */
-
-#include <stdio.h>
-#include <sys/procfs.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "defs.h"
-#include "ansidecl.h"
-#include "inferior.h"
-#include "target.h"
-
-#ifndef PROC_NAME_FMT
-#define PROC_NAME_FMT "/proc/%d"
-#endif
-
-extern void EXFUN(supply_gregset, (gregset_t *gregsetp));
-extern void EXFUN(fill_gregset, (gregset_t *gresetp, int regno));
-
-#if defined (FP0_REGNUM)
-extern void EXFUN(supply_fpregset, (fpregset_t *fpregsetp));
-extern void EXFUN(fill_fpregset, (fpregset_t *fpresetp, int regno));
-#endif
-
-#if 1 /* FIXME: Gross and ugly hack to resolve coredep.c global */
-CORE_ADDR kernel_u_addr;
-#endif
-
-/* All access to the inferior, either one started by gdb or one that has
- been attached to, is controlled by an instance of a procinfo structure,
- defined below. Since gdb currently only handles one inferior at a time,
- the procinfo structure is statically allocated and only one exists at
- any given time. */
-
-struct procinfo {
- int valid; /* Nonzero if pid, fd, & pathname are valid */
- int pid; /* Process ID of inferior */
- int fd; /* File descriptor for /proc entry */
- char *pathname; /* Pathname to /proc entry */
- int was_stopped; /* Nonzero if was stopped prior to attach */
- prrun_t prrun; /* Control state when it is run */
- prstatus_t prstatus; /* Current process status info */
- gregset_t gregset; /* General register set */
- fpregset_t fpregset; /* Floating point register set */
- fltset_t fltset; /* Current traced hardware fault set */
- sigset_t trace; /* Current traced signal set */
- sysset_t exitset; /* Current traced system call exit set */
- sysset_t entryset; /* Current traced system call entry set */
-} pi;
-
-/* Forward declarations of static functions so we don't have to worry
- about ordering within this file. The EXFUN macro may be slightly
- misleading. Should probably be called DCLFUN instead, or something
- more intuitive, since it can be used for both static and external
- definitions. */
-
-static void EXFUN(proc_init_failed, (char *why));
-static int EXFUN(open_proc_file, (int pid));
-static void EXFUN(close_proc_file, (void));
-static void EXFUN(unconditionally_kill_inferior, (void));
-
-/*
-
-GLOBAL FUNCTION
-
- ptrace -- override library version to force errors for /proc version
-
-SYNOPSIS
-
- int ptrace (int request, int pid, int arg3, int arg4)
-
-DESCRIPTION
-
- When gdb is configured to use /proc, it should not be calling
- or otherwise attempting to use ptrace. In order to catch errors
- where use of /proc is configured, but some routine is still calling
- ptrace, we provide a local version of a function with that name
- that does nothing but issue an error message.
-*/
-
-int
-DEFUN(ptrace, (request, pid, arg3, arg4),
- int request AND
- int pid AND
- int arg3 AND
- int arg4)
-{
- error ("internal error - there is a call to ptrace() somewhere");
- /*NOTREACHED*/
-}
-
-/*
-
-GLOBAL FUNCTION
-
- kill_inferior_fast -- kill inferior while gdb is exiting
-
-SYNOPSIS
-
- void kill_inferior_fast (void)
-
-DESCRIPTION
-
- This is used when GDB is exiting. It gives less chance of error.
-
-NOTES
-
- Don't attempt to kill attached inferiors since we may be called
- when gdb is in the process of aborting, and killing the attached
- inferior may be very anti-social. This is particularly true if we
- were attached just so we could use the /proc facilities to get
- detailed information about it's status.
-
-*/
-
-void
-DEFUN_VOID(kill_inferior_fast)
-{
- if (inferior_pid != 0 && !attach_flag)
- {
- unconditionally_kill_inferior ();
- }
-}
-
-/*
-
-GLOBAL FUNCTION
-
- kill_inferior - kill any currently inferior
-
-SYNOPSIS
-
- void kill_inferior (void)
-
-DESCRIPTION
-
- Kill any current inferior.
-
-NOTES
-
- Kills even attached inferiors. Presumably the user has already
- been prompted that the inferior is an attached one rather than
- one started by gdb. (FIXME?)
-
-*/
-
-void
-DEFUN_VOID(kill_inferior)
-{
- if (inferior_pid != 0)
- {
- unconditionally_kill_inferior ();
- target_mourn_inferior ();
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- unconditionally_kill_inferior - terminate the inferior
-
-SYNOPSIS
-
- static void unconditionally_kill_inferior (void)
-
-DESCRIPTION
-
- Kill the current inferior. Should not be called until it
- is at least tested that there is an inferior.
-
-NOTE
-
- A possibly useful enhancement would be to first try sending
- the inferior a terminate signal, politely asking it to commit
- suicide, before we murder it.
-
-*/
-
-static void
-DEFUN_VOID(unconditionally_kill_inferior)
-{
- int signo;
-
- signo = SIGKILL;
- (void) ioctl (pi.fd, PIOCKILL, &signo);
- close_proc_file ();
- wait ((int *) 0);
-}
-
-/*
-
-GLOBAL FUNCTION
-
- child_xfer_memory -- copy data to or from inferior memory space
-
-SYNOPSIS
-
- int child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
- int dowrite, struct target_ops target)
-
-DESCRIPTION
-
- Copy LEN bytes to/from inferior's memory starting at MEMADDR
- from/to debugger memory starting at MYADDR. Copy from inferior
- if DOWRITE is zero or to inferior if DOWRITE is nonzero.
-
- Returns the length copied, which is either the LEN argument or
- zero. This xfer function does not do partial moves, since child_ops
- doesn't allow memory operations to cross below us in the target stack
- anyway.
-
-NOTES
-
- The /proc interface makes this an almost trivial task.
- */
-
-
-int
-DEFUN(child_xfer_memory, (memaddr, myaddr, len, dowrite, target),
- CORE_ADDR memaddr AND
- char *myaddr AND
- int len AND
- int dowrite AND
- struct target_ops target /* ignored */)
-{
- int nbytes = 0;
-
- if (lseek (pi.fd, (off_t) memaddr, 0) == (off_t) memaddr)
- {
- if (dowrite)
- {
- nbytes = write (pi.fd, myaddr, len);
- }
- else
- {
- nbytes = read (pi.fd, myaddr, len);
- }
- if (nbytes < 0)
- {
- nbytes = 0;
- }
- }
- return (nbytes);
-}
-
-/*
-
-GLOBAL FUNCTION
-
- store_inferior_registers -- copy register values back to inferior
-
-SYNOPSIS
-
- void store_inferior_registers (int regno)
-
-DESCRIPTION
-
- Store our current register values back into the inferior. If
- REGNO is -1 then store all the register, otherwise store just
- the value specified by REGNO.
-
-NOTES
-
- If we are storing only a single register, we first have to get all
- the current values from the process, overwrite the desired register
- in the gregset with the one we want from gdb's registers, and then
- send the whole set back to the process. For writing all the
- registers, all we have to do is generate the gregset and send it to
- the process.
-
- Also note that the process has to be stopped on an event of interest
- for this to work, which basically means that it has to have been
- run under the control of one of the other /proc ioctl calls and not
- ptrace. Since we don't use ptrace anyway, we don't worry about this
- fine point, but it is worth noting for future reference.
-
- Gdb is confused about what this function is supposed to return.
- Some versions return a value, others return nothing. Some are
- declared to return a value and actually return nothing. Gdb ignores
- anything returned. (FIXME)
-
- */
-
-void
-DEFUN(store_inferior_registers, (regno),
- int regno)
-{
- if (regno != -1)
- {
- (void) ioctl (pi.fd, PIOCGREG, &pi.gregset);
- }
- fill_gregset (&pi.gregset, regno);
- (void) ioctl (pi.fd, PIOCSREG, &pi.gregset);
-
-#if defined (FP0_REGNUM)
-
- /* Now repeat everything using the floating point register set, if the
- target has floating point hardware. Since we ignore the returned value,
- we'll never know whether it worked or not anyway. */
-
- if (regno != -1)
- {
- (void) ioctl (pi.fd, PIOCGFPREG, &pi.fpregset);
- }
- fill_fpregset (&pi.fpregset, regno);
- (void) ioctl (pi.fd, PIOCSFPREG, &pi.fpregset);
-
-#endif /* FP0_REGNUM */
-
-}
-
-/*
-
-GLOBAL FUNCTION
-
- inferior_proc_init - initialize access to a /proc entry
-
-SYNOPSIS
-
- void inferior_proc_init (int pid)
-
-DESCRIPTION
-
- When gdb starts an inferior, this function is called in the parent
- process immediately after the fork. It waits for the child to stop
- on the return from the exec system call (the child itself takes care
- of ensuring that this is set up), then sets up the set of signals
- and faults that are to be traced.
-
-NOTES
-
- If proc_init_failed ever gets called, control returns to the command
- processing loop via the standard error handling code.
- */
-
-void
-DEFUN(inferior_proc_init, (int pid),
- int pid)
-{
- if (!open_proc_file (pid))
- {
- proc_init_failed ("can't open process file");
- }
- else
- {
- (void) memset (&pi.prrun, 0, sizeof (pi.prrun));
- prfillset (&pi.prrun.pr_trace);
- prfillset (&pi.prrun.pr_fault);
- prdelset (&pi.prrun.pr_fault, FLTPAGE);
- if (ioctl (pi.fd, PIOCWSTOP, &pi.prstatus) < 0)
- {
- proc_init_failed ("PIOCWSTOP failed");
- }
- else if (ioctl (pi.fd, PIOCSTRACE, &pi.prrun.pr_trace) < 0)
- {
- proc_init_failed ("PIOCSTRACE failed");
- }
- else if (ioctl (pi.fd, PIOCSFAULT, &pi.prrun.pr_fault) < 0)
- {
- proc_init_failed ("PIOCSFAULT failed");
- }
- }
-}
-
-/*
-
-GLOBAL FUNCTION
-
- proc_set_exec_trap -- arrange for exec'd child to halt at startup
-
-SYNOPSIS
-
- void proc_set_exec_trap (void)
-
-DESCRIPTION
-
- This function is called in the child process when starting up
- an inferior, prior to doing the exec of the actual inferior.
- It sets the child process's exitset to make exit from the exec
- system call an event of interest to stop on, and then simply
- returns. The child does the exec, the system call returns, and
- the child stops at the first instruction, ready for the gdb
- parent process to take control of it.
-
-NOTE
-
- We need to use all local variables since the child may be sharing
- it's data space with the parent, if vfork was used rather than
- fork.
- */
-
-void
-DEFUN_VOID(proc_set_exec_trap)
-{
- sysset_t exitset;
- auto char procname[32];
- int fd;
-
- (void) sprintf (procname, PROC_NAME_FMT, getpid ());
- if ((fd = open (procname, O_RDWR)) < 0)
- {
- perror (procname);
- fflush (stderr);
- _exit (127);
- }
- premptyset (&exitset);
- praddset (&exitset, SYS_exec);
- praddset (&exitset, SYS_execve);
- if (ioctl (fd, PIOCSEXIT, &exitset) < 0)
- {
- perror (procname);
- fflush (stderr);
- _exit (127);
- }
-}
-
-
-#ifdef ATTACH_DETACH
-
-/*
-
-GLOBAL FUNCTION
-
- attach -- attach to an already existing process
-
-SYNOPSIS
-
- int attach (int pid)
-
-DESCRIPTION
-
- Attach to an already existing process with the specified process
- id. If the process is not already stopped, query whether to
- stop it or not.
-
-NOTES
-
- The option of stopping at attach time is specific to the /proc
- versions of gdb. Versions using ptrace force the attachee
- to stop.
-
-*/
-
-int
-DEFUN(attach, (pid),
- int pid)
-{
- if (!open_proc_file (pid))
- {
- perror_with_name (pi.pathname);
- /* NOTREACHED */
- }
-
- /* Get current status of process and if it is not already stopped,
- then stop it. Remember whether or not it was stopped when we first
- examined it. */
-
- if (ioctl (pi.fd, PIOCSTATUS, &pi.prstatus) < 0)
- {
- print_sys_errmsg (pi.pathname, errno);
- close_proc_file ();
- error ("PIOCSTATUS failed");
- }
- if (pi.prstatus.pr_flags & (PR_STOPPED | PR_ISTOP))
- {
- pi.was_stopped = 1;
- }
- else
- {
- pi.was_stopped = 0;
- if (query ("Process is currently running, stop it? "))
- {
- if (ioctl (pi.fd, PIOCSTOP, &pi.prstatus) < 0)
- {
- print_sys_errmsg (pi.pathname, errno);
- close_proc_file ();
- error ("PIOCSTOP failed");
- }
- }
- }
-
- /* Remember some things about the inferior that we will, or might, change
- so that we can restore them when we detach. */
-
- (void) ioctl (pi.fd, PIOCGTRACE, &pi.trace);
- (void) ioctl (pi.fd, PIOCGFAULT, &pi.fltset);
- (void) ioctl (pi.fd, PIOCGENTRY, &pi.entryset);
- (void) ioctl (pi.fd, PIOCGEXIT, &pi.exitset);
-
- /* Set up trace and fault sets, as gdb expects them. */
-
- (void) memset (&pi.prrun, 0, sizeof (pi.prrun));
- prfillset (&pi.prrun.pr_trace);
- prfillset (&pi.prrun.pr_fault);
- prdelset (&pi.prrun.pr_fault, FLTPAGE);
- if (ioctl (pi.fd, PIOCSFAULT, &pi.prrun.pr_fault))
- {
- print_sys_errmsg ("PIOCSFAULT failed");
- }
- if (ioctl (pi.fd, PIOCSTRACE, &pi.prrun.pr_trace))
- {
- print_sys_errmsg ("PIOCSTRACE failed");
- }
- attach_flag = 1;
- return (pid);
-}
-
-/*
-
-GLOBAL FUNCTION
-
- detach -- detach from an attached-to process
-
-SYNOPSIS
-
- void detach (int signal)
-
-DESCRIPTION
-
- Detach from the current attachee.
-
- If signal is non-zero, the attachee is started running again and sent
- the specified signal.
-
- If signal is zero and the attachee was not already stopped when we
- attached to it, then we make it runnable again when we detach.
-
- Otherwise, we query whether or not to make the attachee runnable
- again, since we may simply want to leave it in the state it was in
- when we attached.
-
- We report any problems, but do not consider them errors, since we
- MUST detach even if some things don't seem to go right. This may not
- be the ideal situation. (FIXME).
- */
-
-void
-DEFUN(detach, (signal),
- int signal)
-{
- if (signal)
- {
- struct siginfo siginfo;
- siginfo.si_signo = signal;
- siginfo.si_code = 0;
- siginfo.si_errno = 0;
- if (ioctl (pi.fd, PIOCSSIG, &siginfo) < 0)
- {
- print_sys_errmsg (pi.pathname, errno);
- printf ("PIOCSSIG failed.\n");
- }
- }
- if (ioctl (pi.fd, PIOCSEXIT, &pi.exitset) < 0)
- {
- print_sys_errmsg (pi.pathname, errno);
- printf ("PIOCSEXIT failed.\n");
- }
- if (ioctl (pi.fd, PIOCSENTRY, &pi.entryset) < 0)
- {
- print_sys_errmsg (pi.pathname, errno);
- printf ("PIOCSENTRY failed.\n");
- }
- if (ioctl (pi.fd, PIOCSTRACE, &pi.trace) < 0)
- {
- print_sys_errmsg (pi.pathname, errno);
- printf ("PIOCSTRACE failed.\n");
- }
- if (ioctl (pi.fd, PIOCSFAULT, &pi.fltset) < 0)
- {
- print_sys_errmsg (pi.pathname, errno);
- printf ("PIOCSFAULT failed.\n");
- }
- if (ioctl (pi.fd, PIOCSTATUS, &pi.prstatus) < 0)
- {
- print_sys_errmsg (pi.pathname, errno);
- printf ("PIOCSTATUS failed.\n");
- }
- else
- {
- if (signal || (pi.prstatus.pr_flags & (PR_STOPPED | PR_ISTOP)))
- {
- if (signal || !pi.was_stopped ||
- query ("Was stopped when attached, make it runnable again? "))
- {
- (void) memset (&pi.prrun, 0, sizeof (pi.prrun));
- pi.prrun.pr_flags = PRCFAULT;
- if (ioctl (pi.fd, PIOCRUN, &pi.prrun))
- {
- print_sys_errmsg (pi.pathname, errno);
- printf ("PIOCRUN failed.\n");
- }
- }
- }
- }
- close_proc_file ();
- attach_flag = 0;
-}
-
-#endif /* ATTACH_DETACH */
-
-/*
-
-GLOBAL FUNCTION
-
- proc_wait -- emulate wait() as much as possible
-
-SYNOPSIS
-
- int proc_wait (int *statloc)
-
-DESCRIPTION
-
- Try to emulate wait() as much as possible. Not sure why we can't
- just use wait(), but it seems to have problems when applied to a
- process being controlled with the /proc interface.
-
-NOTES
-
- We have a race problem here with no obvious solution. We need to let
- the inferior run until it stops on an event of interest, which means
- that we need to use the PIOCWSTOP ioctl. However, we cannot use this
- ioctl if the process is already stopped on something that is not an
- event of interest, or the call will hang indefinitely. Thus we first
- use PIOCSTATUS to see if the process is not stopped. If not, then we
- use PIOCWSTOP. But during the window between the two, if the process
- stops for any reason that is not an event of interest (such as a job
- control signal) then gdb will hang. One possible workaround is to set
- an alarm to wake up every minute of so and check to see if the process
- is still running, and if so, then reissue the PIOCWSTOP. But this is
- a real kludge, so has not been implemented. FIXME: investigate
- alternatives.
-
- FIXME: Investigate why wait() seems to have problems with programs
- being control by /proc routines.
-
- */
-
-int
-DEFUN(proc_wait, (statloc),
- int *statloc)
-{
- short what;
- short why;
- int statval = 0;
- int checkerr = 0;
- int rtnval = -1;
-
- if (ioctl (pi.fd, PIOCSTATUS, &pi.prstatus) < 0)
- {
- checkerr++;
- }
- else if (!(pi.prstatus.pr_flags & (PR_STOPPED | PR_ISTOP)))
- {
- if (ioctl (pi.fd, PIOCWSTOP, &pi.prstatus) < 0)
- {
- checkerr++;
- }
- }
- if (checkerr)
- {
- if (errno == ENOENT)
- {
- rtnval = wait (&statval);
- if (rtnval != inferior_pid)
- {
- error ("PIOCWSTOP, wait failed, returned %d", rtnval);
- /* NOTREACHED */
- }
- }
- else
- {
- print_sys_errmsg (pi.pathname, errno);
- error ("PIOCSTATUS or PIOCWSTOP failed.");
- /* NOTREACHED */
- }
- }
- else if (pi.prstatus.pr_flags & (PR_STOPPED | PR_ISTOP))
- {
- rtnval = pi.prstatus.pr_pid;
- why = pi.prstatus.pr_why;
- what = pi.prstatus.pr_what;
- if (why == PR_SIGNALLED)
- {
- statval = (what << 8) | 0177;
- }
- else if ((why == PR_SYSEXIT) &&
- (what == SYS_exec || what == SYS_execve))
- {
- statval = (SIGTRAP << 8) | 0177;
- }
- else if (why == PR_REQUESTED)
- {
- statval = (SIGSTOP << 8) | 0177;
- }
- else if (why == PR_JOBCONTROL)
- {
- statval = (what << 8) | 0177;
- }
- else if (why == PR_FAULTED)
- {
- switch (what)
- {
- case FLTPRIV:
- case FLTILL:
- statval = (SIGILL << 8) | 0177;
- break;
- case FLTBPT:
- case FLTTRACE:
- statval = (SIGTRAP << 8) | 0177;
- break;
- case FLTSTACK:
- case FLTACCESS:
- case FLTBOUNDS:
- statval = (SIGSEGV << 8) | 0177;
- break;
- case FLTIOVF:
- case FLTIZDIV:
- case FLTFPE:
- statval = (SIGFPE << 8) | 0177;
- break;
- case FLTPAGE: /* Recoverable page fault */
- default:
- rtnval = -1;
- error ("PIOCWSTOP, unknown why %d, what %d", why, what);
- /* NOTREACHED */
- }
- }
- else
- {
- rtnval = -1;
- error ("PIOCWSTOP, unknown why %d, what %d", why, what);
- /* NOTREACHED */
- }
- }
- else
- {
- error ("PIOCWSTOP, stopped for unknown/unhandled reason, flags %#x",
- pi.prstatus.pr_flags);
- /* NOTREACHED */
- }
- if (statloc)
- {
- *statloc = statval;
- }
- return (rtnval);
-}
-
-/*
-
-GLOBAL FUNCTION
-
- child_resume -- resume execution of the inferior process
-
-SYNOPSIS
-
- void child_resume (int step, int signal)
-
-DESCRIPTION
-
- Resume execution of the inferior process. If STEP is nozero, then
- just single step it. If SIGNAL is nonzero, restart it with that
- signal activated.
-
-NOTE
-
- It may not be absolutely necessary to specify the PC value for
- restarting, but to be safe we use the value that gdb considers
- to be current. One case where this might be necessary is if the
- user explicitly changes the PC value that gdb considers to be
- current. FIXME: Investigate if this is necessary or not.
- */
-
-void
-DEFUN(child_resume, (step, signal),
- int step AND
- int signal)
-{
- errno = 0;
- pi.prrun.pr_flags = PRSVADDR | PRSTRACE | PRSFAULT | PRCFAULT;
- pi.prrun.pr_vaddr = (caddr_t) *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
- if (signal)
- {
- if (signal != pi.prstatus.pr_cursig)
- {
- struct siginfo siginfo;
- siginfo.si_signo = signal;
- siginfo.si_code = 0;
- siginfo.si_errno = 0;
- (void) ioctl (pi.fd, PIOCSSIG, &siginfo);
- }
- }
- else
- {
- pi.prrun.pr_flags |= PRCSIG;
- }
- if (step)
- {
- pi.prrun.pr_flags |= PRSTEP;
- }
- if (ioctl (pi.fd, PIOCRUN, &pi.prrun) != 0)
- {
- perror_with_name (pi.pathname);
- /* NOTREACHED */
- }
-}
-
-/*
-
-GLOBAL FUNCTION
-
- fetch_inferior_registers -- fetch current registers from inferior
-
-SYNOPSIS
-
- void fetch_inferior_registers (void)
-
-DESCRIPTION
-
- Read the current values of the inferior's registers, both the
- general register set and floating point registers (if supported)
- and update gdb's idea of their current values.
-
-*/
-
-void
-DEFUN_VOID(fetch_inferior_registers)
-{
- if (ioctl (pi.fd, PIOCGREG, &pi.gregset) != -1)
- {
- supply_gregset (&pi.gregset);
- }
-#if defined (FP0_REGNUM)
- if (ioctl (pi.fd, PIOCGFPREG, &pi.fpregset) != -1)
- {
- supply_fpregset (&pi.fpregset);
- }
-#endif
-}
-
-/*
-
-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)
-
-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)
- char *core_reg_sect;
- unsigned core_reg_size;
- int which;
-{
-
- if (which == 0)
- {
- if (core_reg_size != sizeof (pi.gregset))
- {
- warning ("wrong size gregset struct in core file");
- }
- else
- {
- (void) memcpy ((char *) &pi.gregset, core_reg_sect,
- sizeof (pi.gregset));
- supply_gregset (&pi.gregset);
- }
- }
- else if (which == 2)
- {
- if (core_reg_size != sizeof (pi.fpregset))
- {
- warning ("wrong size fpregset struct in core file");
- }
- else
- {
- (void) memcpy ((char *) &pi.fpregset, core_reg_sect,
- sizeof (pi.fpregset));
-#if defined (FP0_REGNUM)
- supply_fpregset (&pi.fpregset);
-#endif
- }
- }
-}
-
-/*
-
-LOCAL FUNCTION
-
- proc_init_failed - called whenever /proc access initialization fails
-
-SYNOPSIS
-
- static void proc_init_failed (char *why)
-
-DESCRIPTION
-
- This function is called whenever initialization of access to a /proc
- entry fails. It prints a suitable error message, does some cleanup,
- and then invokes the standard error processing routine which dumps
- us back into the command loop.
- */
-
-static void
-DEFUN(proc_init_failed, (why),
- char *why)
-{
- print_sys_errmsg (pi.pathname, errno);
- (void) kill (pi.pid, SIGKILL);
- close_proc_file ();
- error (why);
- /* NOTREACHED */
-}
-
-/*
-
-LOCAL FUNCTION
-
- close_proc_file - close any currently open /proc entry
-
-SYNOPSIS
-
- static void close_proc_file (void)
-
-DESCRIPTION
-
- Close any currently open /proc entry and mark the process information
- entry as invalid. In order to ensure that we don't try to reuse any
- stale information, the pid, fd, and pathnames are explicitly
- invalidated, which may be overkill.
-
- */
-
-static void
-DEFUN_VOID(close_proc_file)
-{
- pi.pid = 0;
- if (pi.valid)
- {
- (void) close (pi.fd);
- }
- pi.fd = -1;
- if (pi.pathname)
- {
- free (pi.pathname);
- pi.pathname = NULL;
- }
- pi.valid = 0;
-}
-
-/*
-
-LOCAL FUNCTION
-
- open_proc_file - open a /proc entry for a given process id
-
-SYNOPSIS
-
- static int open_proc_file (pid)
-
-DESCRIPTION
-
- Given a process id, close the existing open /proc entry (if any)
- and open one for the new process id. Once it is open, then
- mark the local process information structure as valid, which
- guarantees that the pid, fd, and pathname fields match an open
- /proc entry. Returns zero if the open fails, nonzero otherwise.
-
- Note that the pathname is left intact, even when the open fails,
- so that callers can use it to construct meaningful error messages
- rather than just "file open failed".
- */
-
-static int
-DEFUN(open_proc_file, (pid),
- int pid)
-{
- pi.valid = 0;
- if (pi.valid)
- {
- (void) close (pi.fd);
- }
- if (pi.pathname == NULL)
- {
- pi.pathname = xmalloc (32);
- }
- sprintf (pi.pathname, PROC_NAME_FMT, pid);
- if ((pi.fd = open (pi.pathname, O_RDWR)) >= 0)
- {
- pi.valid = 1;
- pi.pid = pid;
- }
- return (pi.valid);
-}
-
-#endif /* USE_PROC_FS */
diff --git a/gdb/putenv.c b/gdb/putenv.c
deleted file mode 100644
index f7318f0..0000000
--- a/gdb/putenv.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************/
-/* */
-/* putenv(3) */
-/* */
-/* Change or add an environment entry */
-/* */
-/****************************************************************/
-/* origination 1987-Oct-7 T. Holm */
-/****************************************************************/
-
-/*
-From pacbell!ames!ll-xn!mit-eddie!uw-beaver!ssc-vax!uvicctr!tholm Wed May 4 23:40:52 1988
-Path: hoptoad!pacbell!ames!ll-xn!mit-eddie!uw-beaver!ssc-vax!uvicctr!tholm
-From: tholm@uvicctr.UUCP (Terrence W. Holm)
-Newsgroups: comp.os.minix
-Subject: putenv(3)
-Message-ID: <395@uvicctr.UUCP>
-Date: 5 May 88 06:40:52 GMT
-Reply-To: tholm@uvicctr.UUCP (Terrence W. Holm)
-Organization: University of Victoria, Victoria B.C. Canada
-Lines: 296
-
-
-EFTH Minix report #2 - May 1988 - putenv(3)
-
-
-This is an implementation of putenv(3) that we
-wrote for Minix. Please consider this a public
-domain program.
-*/
-
-#include <stdio.h>
-
-
-#define PSIZE sizeof(char *)
-
-
-extern char **environ;
-
-
-char *index();
-char *malloc();
-
-
-/****************************************************************/
-/* */
-/* putenv( entry ) */
-/* */
-/* The "entry" should follow the form */
-/* "NAME=VALUE". This routine will search the */
-/* user environment for "NAME" and replace its */
-/* value with "VALUE". */
-/* */
-/* Note that "entry" is not copied, it is used */
-/* as the environment entry. This means that it */
-/* must not be unallocated or otherwise modifed */
-/* by the caller, unless it is replaced by a */
-/* subsequent putenv(). */
-/* */
-/* If the name is not found in the environment, */
-/* then a new vector of pointers is allocated, */
-/* "entry" is put at the end and the global */
-/* variable "environ" is updated. */
-/* */
-/* This function normally returns NULL, but -1 */
-/* is returned if it can not allocate enough */
-/* space using malloc(3), or "entry" does not */
-/* contain a '='. */
-/* */
-/****************************************************************/
-
-
-putenv( entry )
- char *entry;
-
- {
- unsigned length;
- unsigned size;
- char **p;
- char **new_environ;
-
- /* Find the length of the "NAME=" */
-
- if ( (length=(unsigned) index(entry,'=')) == NULL )
- return( -1 );
-
- length = length - (unsigned) entry + 1;
-
-
- /* Scan through the environment looking for "NAME=" */
-
- for ( p=environ; *p != 0 ; p++ )
- if ( strncmp( entry, *p, length ) == 0 )
- {
- *p = entry;
- return( NULL );
- }
-
-
- /* The name was not found, build a bigger environment */
-
- size = p - environ;
-
- new_environ = (char **) malloc( (size+2)*PSIZE );
-
- if ( new_environ == NULL )
- return( -1 );
-
- bcopy( (char *) environ, (char *) new_environ, size*PSIZE );
-
- new_environ[size] = entry;
- new_environ[size+1] = NULL;
-
- environ = new_environ;
-
- return(NULL);
- }
diff --git a/gdb/pyr-opcode.h b/gdb/pyr-opcode.h
deleted file mode 100755
index 06632b8..0000000
--- a/gdb/pyr-opcode.h
+++ /dev/null
@@ -1,287 +0,0 @@
-/* pyramid.opcode.h -- gdb initial attempt. */
-
-/* pyramid opcode table: wot to do with this
- particular opcode */
-
-struct pyr_datum
-{
- char nargs;
- char * args; /* how to compile said opcode */
- unsigned long mask; /* Bit vector: which operand modes are valid
- for this opcode */
- unsigned char code; /* op-code (always 6(?) bits */
-};
-
-typedef struct pyr_insn_format {
- unsigned int mode :4;
- unsigned int operator :8;
- unsigned int index_scale :2;
- unsigned int index_reg :6;
- unsigned int operand_1 :6;
- unsigned int operand_2:6;
-} pyr_insn_format;
-
-
-/* We store four bytes of opcode for all opcodes.
- Pyramid is sufficiently RISCy that:
- - insns are always an integral number of words;
- - the length of any insn can be told from the first word of
- the insn. (ie, if there are zero, one, or two words of
- immediate operand/offset).
-
-
- The args component is a string containing two characters for each
- operand of the instruction. The first specifies the kind of operand;
- the second, the place it is stored. */
-
-/* Kinds of operands:
- mask assembler syntax description
- 0x0001: movw Rn,Rn register to register
- 0x0002: movw K,Rn quick immediate to register
- 0x0004: movw I,Rn long immediate to register
- 0x0008: movw (Rn),Rn register indirect to register
- movw (Rn)[x],Rn register indirect to register
- 0x0010: movw I(Rn),Rn offset register indirect to register
- movw I(Rn)[x],Rn offset register indirect, indexed, to register
-
- 0x0020: movw Rn,(Rn) register to register indirect
- 0x0040: movw K,(Rn) quick immediate to register indirect
- 0x0080: movw I,(Rn) long immediate to register indirect
- 0x0100: movw (Rn),(Rn) register indirect to-register indirect
- 0x0100: movw (Rn),(Rn) register indirect to-register indirect
- 0x0200: movw I(Rn),(Rn) register indirect+offset to register indirect
- 0x0200: movw I(Rn),(Rn) register indirect+offset to register indirect
-
- 0x0400: movw Rn,I(Rn) register to register indirect+offset
- 0x0800: movw K,I(Rn) quick immediate to register indirect+offset
- 0x1000: movw I,I(Rn) long immediate to register indirect+offset
- 0x1000: movw (Rn),I(Rn) register indirect to-register indirect+offset
- 0x1000: movw I(Rn),I(Rn) register indirect+offset to register indirect
- +offset
- 0x0000: (irregular) ???
-
-
- Each insn has a four-bit field encoding the type(s) of its operands.
-*/
-
-/* Some common combinations
- */
-
-/* the first 5,(0x1|0x2|0x4|0x8|0x10) ie (1|2|4|8|16), ie ( 32 -1)*/
-#define GEN_TO_REG (31)
-
-#define UNKNOWN ((unsigned long)-1)
-#define ANY (GEN_TO_REG | (GEN_TO_REG << 5) | (GEN_TO_REG << 15))
-
-#define CONVERT (1|8|0x10|0x20|0x200)
-
-#define K_TO_REG (2)
-#define I_TO_REG (4)
-#define NOTK_TO_REG (GEN_TO_REG & ~K_TO_REG)
-#define NOTI_TO_REG (GEN_TO_REG & ~I_TO_REG)
-
-/* The assembler requires that this array be sorted as follows:
- all instances of the same mnemonic must be consecutive.
- All instances of the same mnemonic with the same number of operands
- must be consecutive.
- */
-
-struct pyr_opcode /* pyr opcode text */
-{
- char * name; /* opcode name: lowercase string [key] */
- struct pyr_datum datum; /* rest of opcode table [datum] */
-};
-
-#define pyr_how args
-#define pyr_nargs nargs
-#define pyr_mask mask
-#define pyr_name name
-
-struct pyr_opcode pyr_opcodes[] =
-{
- {"movb", { 2, "", UNKNOWN, 0x11}, },
- {"movh", { 2, "", UNKNOWN, 0x12} },
- {"movw", { 2, "", ANY, 0x10} },
- {"movl", { 2, "", ANY, 0x13} },
- {"mnegw", { 2, "", (0x1|0x8|0x10), 0x14} },
- {"mnegf", { 2, "", 0x1, 0x15} },
- {"mnegd", { 2, "", 0x1, 0x16} },
- {"mcomw", { 2, "", (0x1|0x8|0x10), 0x17} },
- {"mabsw", { 2, "", (0x1|0x8|0x10), 0x18} },
- {"mabsf", { 2, "", 0x1, 0x19} },
- {"mabsd", { 2, "", 0x1, 0x1a} },
- {"mtstw", { 2, "", (0x1|0x8|0x10), 0x1c} },
- {"mtstf", { 2, "", 0x1, 0x1d} },
- {"mtstd", { 2, "", 0x1, 0x1e} },
- {"mova", { 2, "", 0x8|0x10, 0x1f} },
- {"movzbw", { 2, "", (0x1|0x8|0x10), 0x20} },
- {"movzhw", { 2, "", (0x1|0x8|0x10), 0x21} },
- /* 2 insns out of order here */
- {"movbl", { 2, "", 1, 0x4f} },
- {"filbl", { 2, "", 1, 0x4e} },
-
- {"cvtbw", { 2, "", CONVERT, 0x22} },
- {"cvthw", { 2, "", CONVERT, 0x23} },
- {"cvtwb", { 2, "", CONVERT, 0x24} },
- {"cvtwh", { 2, "", CONVERT, 0x25} },
- {"cvtwf", { 2, "", CONVERT, 0x26} },
- {"cvtwd", { 2, "", CONVERT, 0x27} },
- {"cvtfw", { 2, "", CONVERT, 0x28} },
- {"cvtfd", { 2, "", CONVERT, 0x29} },
- {"cvtdw", { 2, "", CONVERT, 0x2a} },
- {"cvtdf", { 2, "", CONVERT, 0x2b} },
-
- {"addw", { 2, "", GEN_TO_REG, 0x40} },
- {"addwc", { 2, "", GEN_TO_REG, 0x41} },
- {"subw", { 2, "", GEN_TO_REG, 0x42} },
- {"subwb", { 2, "", GEN_TO_REG, 0x43} },
- {"rsubw", { 2, "", GEN_TO_REG, 0x44} },
- {"mulw", { 2, "", GEN_TO_REG, 0x45} },
- {"emul", { 2, "", GEN_TO_REG, 0x47} },
- {"umulw", { 2, "", GEN_TO_REG, 0x46} },
- {"divw", { 2, "", GEN_TO_REG, 0x48} },
- {"ediv", { 2, "", GEN_TO_REG, 0x4a} },
- {"rdivw", { 2, "", GEN_TO_REG, 0x4b} },
- {"udivw", { 2, "", GEN_TO_REG, 0x49} },
- {"modw", { 2, "", GEN_TO_REG, 0x4c} },
- {"umodw", { 2, "", GEN_TO_REG, 0x4d} },
-
-
- {"addf", { 2, "", 1, 0x50} },
- {"addd", { 2, "", 1, 0x51} },
- {"subf", { 2, "", 1, 0x52} },
- {"subd", { 2, "", 1, 0x53} },
- {"mulf", { 2, "", 1, 0x56} },
- {"muld", { 2, "", 1, 0x57} },
- {"divf", { 2, "", 1, 0x58} },
- {"divd", { 2, "", 1, 0x59} },
-
-
- {"cmpb", { 2, "", UNKNOWN, 0x61} },
- {"cmph", { 2, "", UNKNOWN, 0x62} },
- {"cmpw", { 2, "", UNKNOWN, 0x60} },
- {"ucmpb", { 2, "", UNKNOWN, 0x66} },
- /* WHY no "ucmph"??? */
- {"ucmpw", { 2, "", UNKNOWN, 0x65} },
- {"xchw", { 2, "", UNKNOWN, 0x0f} },
-
-
- {"andw", { 2, "", GEN_TO_REG, 0x30} },
- {"orw", { 2, "", GEN_TO_REG, 0x31} },
- {"xorw", { 2, "", GEN_TO_REG, 0x32} },
- {"bicw", { 2, "", GEN_TO_REG, 0x33} },
- {"lshlw", { 2, "", GEN_TO_REG, 0x38} },
- {"ashlw", { 2, "", GEN_TO_REG, 0x3a} },
- {"ashll", { 2, "", GEN_TO_REG, 0x3c} },
- {"ashrw", { 2, "", GEN_TO_REG, 0x3b} },
- {"ashrl", { 2, "", GEN_TO_REG, 0x3d} },
- {"rotlw", { 2, "", GEN_TO_REG, 0x3e} },
- {"rotrw", { 2, "", GEN_TO_REG, 0x3f} },
-
- /* push and pop insns are "going away next release". */
- {"pushw", { 2, "", GEN_TO_REG, 0x0c} },
- {"popw", { 2, "", (0x1|0x8|0x10), 0x0d} },
- {"pusha", { 2, "", (0x8|0x10), 0x0e} },
-
- {"bitsw", { 2, "", UNKNOWN, 0x35} },
- {"bitcw", { 2, "", UNKNOWN, 0x36} },
- /* some kind of ibra/dbra insns??*/
- {"icmpw", { 2, "", UNKNOWN, 0x67} },
- {"dcmpw", { 2, "", (1|4|0x20|0x80|0x400|0x1000), 0x69} },/*FIXME*/
- {"acmpw", { 2, "", 1, 0x6b} },
-
- /* Call is written as a 1-op insn, but is always (dis)assembled as a 2-op
- insn with a 2nd op of tr14. The assembler will have to grok this. */
- {"call", { 2, "", GEN_TO_REG, 0x04} },
- {"call", { 1, "", GEN_TO_REG, 0x04} },
-
- {"callk", { 1, "", UNKNOWN, 0x06} },/* system call?*/
- /* Ret is usually written as a 0-op insn, but gets disassembled as a
- 1-op insn. The operand is always tr15. */
- {"ret", { 0, "", UNKNOWN, 0x09} },
- {"ret", { 1, "", UNKNOWN, 0x09} },
- {"adsf", { 2, "", (1|2|4), 0x08} },
- {"retd", { 2, "", UNKNOWN, 0x0a} },
- {"btc", { 2, "", UNKNOWN, 0x01} },
- {"bfc", { 2, "", UNKNOWN, 0x02} },
- /* Careful: halt is 0x00000000. Jump must have some other (mode?)bit set?? */
- {"jump", { 1, "", UNKNOWN, 0x00} },
- {"btp", { 2, "", UNKNOWN, 0xf00} },
- /* read control-stack pointer is another 1-or-2 operand insn. */
- {"rcsp", { 2, "", UNKNOWN, 0x01f} },
- {"rcsp", { 1, "", UNKNOWN, 0x01f} }
-};
-
-/* end: pyramid.opcode.h */
-/* One day I will have to take the time to find out what operands
- are valid for these insns, and guess at what they mean.
-
- I can't imagine what the "I???" insns (iglob, etc) do.
-
- the arithmetic-sounding insns ending in "p" sound awfully like BCD
- arithmetic insns:
- dshlp -> Decimal SHift Left Packed
- dshrp -> Decimal SHift Right Packed
- and cvtlp would be convert long to packed.
- I have no idea how the operands are interpreted; but having them be
- a long register with (address, length) of an in-memory packed BCD operand
- would not be surprising.
- They are unlikely to be a packed bcd string: 64 bits of long give
- is only 15 digits+sign, which isn't enough for COBOL.
- */
-#if 0
- {"wcsp", { 2, "", UNKNOWN, 0x00} }, /*write csp?*/
- /* The OSx Operating System Porting Guide claims SSL does things
- with tr12 (a register reserved to it) to do with static block-structure
- references. SSL=Set Static Link? It's "Going away next release". */
- {"ssl", { 2, "", UNKNOWN, 0x00} },
- {"ccmps", { 2, "", UNKNOWN, 0x00} },
- {"lcd", { 2, "", UNKNOWN, 0x00} },
- {"uemul", { 2, "", UNKNOWN, 0x00} }, /*unsigned emul*/
- {"srf", { 2, "", UNKNOWN, 0x00} }, /*Gidget time???*/
- {"mnegp", { 2, "", UNKNOWN, 0x00} }, /move-neg phys?*/
- {"ldp", { 2, "", UNKNOWN, 0x00} }, /*load phys?*/
- {"ldti", { 2, "", UNKNOWN, 0x00} },
- {"ldb", { 2, "", UNKNOWN, 0x00} },
- {"stp", { 2, "", UNKNOWN, 0x00} },
- {"stti", { 2, "", UNKNOWN, 0x00} },
- {"stb", { 2, "", UNKNOWN, 0x00} },
- {"stu", { 2, "", UNKNOWN, 0x00} },
- {"addp", { 2, "", UNKNOWN, 0x00} },
- {"subp", { 2, "", UNKNOWN, 0x00} },
- {"mulp", { 2, "", UNKNOWN, 0x00} },
- {"divp", { 2, "", UNKNOWN, 0x00} },
- {"dshlp", { 2, "", UNKNOWN, 0x00} }, /* dec shl packed? */
- {"dshrp", { 2, "", UNKNOWN, 0x00} }, /* dec shr packed? */
- {"movs", { 2, "", UNKNOWN, 0x00} }, /*move (string?)?*/
- {"cmpp", { 2, "", UNKNOWN, 0x00} }, /* cmp phys?*/
- {"cmps", { 2, "", UNKNOWN, 0x00} }, /* cmp (string?)?*/
- {"cvtlp", { 2, "", UNKNOWN, 0x00} }, /* cvt long to p??*/
- {"cvtpl", { 2, "", UNKNOWN, 0x00} }, /* cvt p to l??*/
- {"dintr", { 2, "", UNKNOWN, 0x00} }, /* ?? intr ?*/
- {"rphysw", { 2, "", UNKNOWN, 0x00} }, /* read phys word?*/
- {"wphysw", { 2, "", UNKNOWN, 0x00} }, /* write phys word?*/
- {"cmovs", { 2, "", UNKNOWN, 0x00} },
- {"rsubw", { 2, "", UNKNOWN, 0x00} },
- {"bicpsw", { 2, "", UNKNOWN, 0x00} }, /* clr bit in psw? */
- {"bispsw", { 2, "", UNKNOWN, 0x00} }, /* set bit in psw? */
- {"eio", { 2, "", UNKNOWN, 0x00} }, /* ?? ?io ? */
- {"callp", { 2, "", UNKNOWN, 0x00} }, /* call phys?*/
- {"callr", { 2, "", UNKNOWN, 0x00} },
- {"lpcxt", { 2, "", UNKNOWN, 0x00} }, /*load proc context*/
- {"rei", { 2, "", UNKNOWN, 0x00} }, /*ret from intrpt*/
- {"rport", { 2, "", UNKNOWN, 0x00} }, /*read-port?*/
- {"rtod", { 2, "", UNKNOWN, 0x00} }, /*read-time-of-day?*/
- {"ssi", { 2, "", UNKNOWN, 0x00} },
- {"vtpa", { 2, "", UNKNOWN, 0x00} }, /*virt-to-phys-addr?*/
- {"wicl", { 2, "", UNKNOWN, 0x00} }, /* write icl ? */
- {"wport", { 2, "", UNKNOWN, 0x00} }, /*write-port?*/
- {"wtod", { 2, "", UNKNOWN, 0x00} }, /*write-time-of-day?*/
- {"flic", { 2, "", UNKNOWN, 0x00} },
- {"iglob", { 2, "", UNKNOWN, 0x00} }, /* I global? */
- {"iphys", { 2, "", UNKNOWN, 0x00} }, /* I physical? */
- {"ipid", { 2, "", UNKNOWN, 0x00} }, /* I pid? */
- {"ivect", { 2, "", UNKNOWN, 0x00} }, /* I vector? */
- {"lamst", { 2, "", UNKNOWN, 0x00} },
- {"tio", { 2, "", UNKNOWN, 0x00} },
-#endif
diff --git a/gdb/pyr-pinsn.c b/gdb/pyr-pinsn.c
deleted file mode 100644
index 02d626c..0000000
--- a/gdb/pyr-pinsn.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/* Disassembler for the Pyramid Technology 90x
- Copyright (C) 1988,1989 Free Software Foundation, Inc.
-
-This file is part of GDB, the GNU disassembler.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "pyr-opcode.h"
-#include "gdbcore.h"
-
-
-/* A couple of functions used for debugging frame-handling on
- Pyramids. (The Pyramid-dependent handling of register values for
- windowed registers is known to be buggy.)
-
- When debugging, these functions supplant the normal definitions of some
- of the macros in m-pyramid.h The quantity of information produced
- when these functions are used makes the gdb unusable as a
- debugger for user programs. */
-
-extern unsigned pyr_saved_pc(), pyr_frame_chain();
-
-CORE_ADDR pyr_frame_chain(frame)
- CORE_ADDR frame;
-{
- int foo=frame - CONTROL_STACK_FRAME_SIZE;
- /* printf ("...following chain from %x: got %x\n", frame, foo);*/
- return foo;
-}
-
-CORE_ADDR pyr_saved_pc(frame)
- CORE_ADDR frame;
-{
- int foo=0;
- foo = read_memory_integer (((CORE_ADDR)(frame))+60, 4);
- printf ("..reading pc from frame 0x%0x+%d regs: got %0x\n",
- frame, 60/4, foo);
- return foo;
-}
-
-
-/* Pyramid instructions are never longer than this many bytes. */
-#define MAXLEN 24
-
-/* Number of elements in the opcode table. */
-/*const*/ static int nopcodes = (sizeof (pyr_opcodes) / sizeof( pyr_opcodes[0]));
-#define NOPCODES (nopcodes)
-
-extern char *reg_names[];
-
-/* Let's be byte-independent so we can use this as a cross-assembler.
- (will this ever be useful?
- */
-
-#define NEXTLONG(p) \
- (p += 4, (((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1])
-
-
-/* Print one instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned char buffer[MAXLEN];
- register int i, nargs, insn_size =4;
- register unsigned char *p;
- register char *d;
- register int insn_opcode, operand_mode;
- register int index_multiplier, index_reg_regno, op_1_regno, op_2_regno ;
- long insn; /* first word of the insn, not broken down. */
- pyr_insn_format insn_decode; /* the same, broken out into op{code,erands} */
- long extra_1, extra_2;
-
- read_memory (memaddr, buffer, MAXLEN);
- insn_decode = *((pyr_insn_format *) buffer);
- insn = * ((int *) buffer);
- insn_opcode = insn_decode.operator;
- operand_mode = insn_decode.mode;
- index_multiplier = insn_decode.index_scale;
- index_reg_regno = insn_decode.index_reg;
- op_1_regno = insn_decode.operand_1;
- op_2_regno = insn_decode.operand_2;
-
-
- if (*((int *)buffer) == 0x0) {
- /* "halt" looks just like an invalid "jump" to the insn decoder,
- so is dealt with as a special case */
- fprintf (stream, "halt");
- return (4);
- }
-
- for (i = 0; i < NOPCODES; i++)
- if (pyr_opcodes[i].datum.code == insn_opcode)
- break;
-
- if (i == NOPCODES)
- /* FIXME: Handle unrecognised instructions better. */
- fprintf (stream, "???\t#%08x\t(op=%x mode =%x)",
- insn, insn_decode.operator, insn_decode.mode);
- else
- {
- /* Print the mnemonic for the instruction. Pyramid insn operands
- are so regular that we can deal with almost all of them
- separately.
- Unconditional branches are an exception: they are encoded as
- conditional branches (branch if false condition, I think)
- with no condition specified. The average user will not be
- aware of this. To maintain their illusion that an
- unconditional branch insn exists, we will have to FIXME to
- treat the insn mnemnonic of all branch instructions here as a
- special case: check the operands of branch insn and print an
- appropriate mnemonic. */
-
- fprintf (stream, "%s\t", pyr_opcodes[i].name);
-
- /* Print the operands of the insn (as specified in
- insn.operand_mode).
- Branch operands of branches are a special case: they are a word
- offset, not a byte offset. */
-
- if (insn_decode.operator == 0x01 || insn_decode.operator == 0x02) {
- register int bit_codes=(insn >> 16)&0xf;
- register int i;
- register int displacement = (insn & 0x0000ffff) << 2;
-
- static char cc_bit_names[] = "cvzn"; /* z,n,c,v: strange order? */
-
- /* Is bfc and no bits specified an unconditional branch?*/
- for (i=0;i<4;i++) {
- if ((bit_codes) & 0x1)
- fputc (cc_bit_names[i], stream);
- bit_codes >>= 1;
- }
-
- fprintf (stream, ",%0x",
- displacement + memaddr);
- return (insn_size);
- }
-
- switch (operand_mode) {
- case 0:
- fprintf (stream, "%s,%s",
- reg_names [op_1_regno],
- reg_names [op_2_regno]);
- break;
-
- case 1:
- fprintf (stream, " 0x%0x,%s",
- op_1_regno,
- reg_names [op_2_regno]);
- break;
-
- case 2:
- read_memory (memaddr+4, buffer, MAXLEN);
- insn_size += 4;
- extra_1 = * ((int *) buffer);
- fprintf (stream, " $0x%0x,%s",
- extra_1,
- reg_names [op_2_regno]);
- break;
- case 3:
- fprintf (stream, " (%s),%s",
- reg_names [op_1_regno],
- reg_names [op_2_regno]);
- break;
-
- case 4:
- read_memory (memaddr+4, buffer, MAXLEN);
- insn_size += 4;
- extra_1 = * ((int *) buffer);
- fprintf (stream, " 0x%0x(%s),%s",
- extra_1,
- reg_names [op_1_regno],
- reg_names [op_2_regno]);
- break;
-
- /* S1 destination mode */
- case 5:
- fprintf (stream,
- ((index_reg_regno) ? "%s,(%s)[%s*%1d]" : "%s,(%s)"),
- reg_names [op_1_regno],
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
-
- case 6:
- fprintf (stream,
- ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]"
- : " $%#0x,(%s)"),
- op_1_regno,
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
-
- case 7:
- read_memory (memaddr+4, buffer, MAXLEN);
- insn_size += 4;
- extra_1 = * ((int *) buffer);
- fprintf (stream,
- ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]"
- : " $%#0x,(%s)"),
- extra_1,
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
-
- case 8:
- fprintf (stream,
- ((index_reg_regno) ? " (%s),(%s)[%s*%1d]" : " (%s),(%s)"),
- reg_names [op_1_regno],
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
-
- case 9:
- read_memory (memaddr+4, buffer, MAXLEN);
- insn_size += 4;
- extra_1 = * ((int *) buffer);
- fprintf (stream,
- ((index_reg_regno)
- ? "%#0x(%s),(%s)[%s*%1d]"
- : "%#0x(%s),(%s)"),
- extra_1,
- reg_names [op_1_regno],
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
-
- /* S2 destination mode */
- case 10:
- read_memory (memaddr+4, buffer, MAXLEN);
- insn_size += 4;
- extra_1 = * ((int *) buffer);
- fprintf (stream,
- ((index_reg_regno) ? "%s,%#0x(%s)[%s*%1d]" : "%s,%#0x(%s)"),
- reg_names [op_1_regno],
- extra_1,
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
- case 11:
- read_memory (memaddr+4, buffer, MAXLEN);
- insn_size += 4;
- extra_1 = * ((int *) buffer);
- fprintf (stream,
- ((index_reg_regno) ?
- " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"),
- op_1_regno,
- extra_1,
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
- case 12:
- read_memory (memaddr+4, buffer, MAXLEN);
- insn_size += 4;
- extra_1 = * ((int *) buffer);
- read_memory (memaddr+8, buffer, MAXLEN);
- insn_size += 4;
- extra_2 = * ((int *) buffer);
- fprintf (stream,
- ((index_reg_regno) ?
- " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"),
- extra_1,
- extra_2,
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
-
- case 13:
- read_memory (memaddr+4, buffer, MAXLEN);
- insn_size += 4;
- extra_1 = * ((int *) buffer);
- fprintf (stream,
- ((index_reg_regno)
- ? " (%s),%#0x(%s)[%s*%1d]"
- : " (%s),%#0x(%s)"),
- reg_names [op_1_regno],
- extra_1,
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
- case 14:
- read_memory (memaddr+4, buffer, MAXLEN);
- insn_size += 4;
- extra_1 = * ((int *) buffer);
- read_memory (memaddr+8, buffer, MAXLEN);
- insn_size += 4;
- extra_2 = * ((int *) buffer);
- fprintf (stream,
- ((index_reg_regno) ? "%#0x(%s),%#0x(%s)[%s*%1d]"
- : "%#0x(%s),%#0x(%s) "),
- extra_1,
- reg_names [op_1_regno],
- extra_2,
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- break;
-
- default:
- fprintf (stream,
- ((index_reg_regno) ? "%s,%s [%s*%1d]" : "%s,%s"),
- reg_names [op_1_regno],
- reg_names [op_2_regno],
- reg_names [index_reg_regno],
- index_multiplier);
- fprintf (stream,
- "\t\t# unknown mode in %08x",
- insn);
- break;
- } /* switch */
- }
-
- {
- return insn_size;
- }
- abort ();
-}
diff --git a/gdb/pyr-tdep.c b/gdb/pyr-tdep.c
deleted file mode 100644
index f3a3cde..0000000
--- a/gdb/pyr-tdep.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Pyramid target-dependent code for GDB.
- Copyright (C) 1988, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "param.h"
-#include "defs.h"
-
-/*** Prettier register printing. ***/
-
-/* Print registers in the same format as pyramid's dbx, adb, sdb. */
-pyr_print_registers(reg_buf, regnum)
- long *reg_buf[];
-{
- register int regno;
- int usp, ksp;
- struct user u;
-
- for (regno = 0; regno < 16; regno++) {
- printf/*_filtered*/ ("%6.6s: %8x %6.6s: %8x %6s: %8x %6s: %8x\n",
- reg_names[regno], reg_buf[regno],
- reg_names[regno+16], reg_buf[regno+16],
- reg_names[regno+32], reg_buf[regno+32],
- reg_names[regno+48], reg_buf[regno+48]);
- }
- usp = ptrace (3, inferior_pid,
- ((char *)&u.u_pcb.pcb_usp) -
- ((char *)&u), 0);
- ksp = ptrace (3, inferior_pid,
- ((char *)&u.u_pcb.pcb_ksp) -
- ((char *)&u), 0);
- printf/*_filtered*/ ("\n%6.6s: %8x %6.6s: %8x (%08x) %6.6s %8x\n",
- reg_names[CSP_REGNUM],reg_buf[CSP_REGNUM],
- reg_names[KSP_REGNUM], reg_buf[KSP_REGNUM], ksp,
- "usp", usp);
-}
-
-/* Print the register regnum, or all registers if regnum is -1.
- fpregs is currently ignored. */
-
-pyr_do_registers_info (regnum, fpregs)
- int regnum;
- int fpregs;
-{
- /* On a pyr, we know a virtual register can always fit in an long.
- Here (and elsewhere) we take advantage of that. Yuk. */
- long raw_regs[MAX_REGISTER_RAW_SIZE*NUM_REGS];
- register int i;
-
- for (i = 0 ; i < 64 ; i++) {
- read_relative_register_raw_bytes(i, raw_regs+i);
- }
- if (regnum == -1)
- pyr_print_registers (raw_regs, regnum);
- else
- for (i = 0; i < NUM_REGS; i++)
- if (i == regnum) {
- long val = raw_regs[i];
-
- fputs_filtered (reg_names[i], stdout);
- printf_filtered(":");
- print_spaces_filtered (6 - strlen (reg_names[i]), stdout);
- if (val == 0)
- printf_filtered ("0");
- else
- printf_filtered ("%s %d", local_hex_string_custom(val,"08"), val);
- printf_filtered("\n");
- }
-}
-
-/*** Debugging editions of various macros from m-pyr.h ****/
-
-CORE_ADDR frame_locals_address (frame)
- FRAME frame;
-{
- register int addr = find_saved_register (frame,CFP_REGNUM);
- register int result = read_memory_integer (addr, 4);
-#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
- fprintf (stderr,
- "\t[[..frame_locals:%8x, %s= %x @%x fcfp= %x foo= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n",
- frame->frame,
- reg_names[CFP_REGNUM],
- result, addr,
- frame->frame_cfp, (CFP_REGNUM),
-
-
- read_register(13), read_register(29), read_register(61),
- find_saved_register(frame, 61));
-#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
-
- /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer;
- or at least CFP_REGNUM relative to FRAME (ie, result).
- There seems to be a bug in the way the innermost frame is set up. */
-
- return ((frame->next) ? result: frame->frame_cfp);
-}
-
-CORE_ADDR frame_args_addr (frame)
- FRAME frame;
-{
- register int addr = find_saved_register (frame,CFP_REGNUM);
- register int result = read_memory_integer (addr, 4);
-
-#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
- fprintf (stderr,
- "\t[[..frame_args:%8x, %s= %x @%x fcfp= %x r_r= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n",
- frame->frame,
- reg_names[CFP_REGNUM],
- result, addr,
- frame->frame_cfp, read_register(CFP_REGNUM),
-
- read_register(13), read_register(29), read_register(61),
- find_saved_register(frame, 61));
-#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
-
- /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer;
- or at least CFP_REGNUM relative to FRAME (ie, result).
- There seems to be a bug in the way the innermost frame is set up. */
- return ((frame->next) ? result: frame->frame_cfp);
-}
diff --git a/gdb/pyr-xdep.c b/gdb/pyr-xdep.c
deleted file mode 100644
index 4a89db9..0000000
--- a/gdb/pyr-xdep.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/* Low level Pyramid interface to ptrace, for GDB when running under Unix.
- Copyright (C) 1988, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-/* #include <fcntl.h> Can we live without this? */
-
-#include "gdbcore.h"
-#include <sys/user.h> /* After a.out.h */
-#include <sys/file.h>
-#include <sys/stat.h>
-
-void
-fetch_inferior_registers ()
-{
- register int regno, datum;
- register unsigned int regaddr;
- int reg_buf[NUM_REGS+1];
- struct user u;
- register int skipped_frames = 0;
-
- registers_fetched ();
-
- for (regno = 0; regno < 64; regno++) {
- reg_buf[regno] = ptrace (3, inferior_pid, regno, 0);
-
-#if defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
- printf ("Fetching %s from inferior, got %0x\n",
- reg_names[regno],
- reg_buf[regno]);
-#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
-
- if (reg_buf[regno] == -1 && errno == EIO) {
- printf("fetch_interior_registers: fetching %s from inferior\n",
- reg_names[regno]);
- errno = 0;
- }
- supply_register (regno, reg_buf+regno);
- }
- /* that leaves regs 64, 65, and 66 */
- datum = ptrace (3, inferior_pid,
- ((char *)&u.u_pcb.pcb_csp) -
- ((char *)&u), 0);
-
-
-
- /* FIXME: Find the Current Frame Pointer (CFP). CFP is a global
- register (ie, NOT windowed), that gets saved in a frame iff
- the code for that frame has a prologue (ie, "adsf N"). If
- there is a prologue, the adsf insn saves the old cfp in
- pr13, cfp is set to sp, and N bytes of locals are allocated
- (sp is decremented by n).
- This makes finding CFP hard. I guess the right way to do it
- is:
- - If this is the innermost frame, believe ptrace() or
- the core area.
- - Otherwise:
- Find the first insn of the current frame.
- - find the saved pc;
- - find the call insn that saved it;
- - figure out where the call is to;
- - if the first insn is an adsf, we got a frame
- pointer. */
-
-
- /* Normal processors have separate stack pointers for user and
- kernel mode. Getting the last user mode frame on such
- machines is easy: the kernel context of the ptrace()'d
- process is on the kernel stack, and the USP points to what
- we want. But Pyramids only have a single cfp for both user and
- kernel mode. And processes being ptrace()'d have some
- kernel-context control frames on their stack.
- To avoid tracing back into the kernel context of an inferior,
- we skip 0 or more contiguous control frames where the pc is
- in the kernel. */
-
- while (1) {
- register int inferior_saved_pc;
- inferior_saved_pc = ptrace (1, inferior_pid, datum+((32+15)*4), 0);
- if (inferior_saved_pc > 0) break;
-#if defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
- printf("skipping kernel frame %08x, pc=%08x\n", datum,
- inferior_saved_pc);
-#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
- skipped_frames++;
- datum -= CONTROL_STACK_FRAME_SIZE;
- }
-
- reg_buf[CSP_REGNUM] = datum;
- supply_register(CSP_REGNUM, reg_buf+CSP_REGNUM);
-#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
- if (skipped_frames) {
- fprintf (stderr,
- "skipped %d frames from %x to %x; cfp was %x, now %x\n",
- skipped_frames, reg_buf[CSP_REGNUM]);
- }
-#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- int regno;
-{
- register unsigned int regaddr;
- char buf[80];
-
- if (regno >= 0)
- {
- if ((0 <= regno) && (regno < 64)) {
- /*regaddr = register_addr (regno, offset);*/
- regaddr = regno;
- errno = 0;
- ptrace (6, inferior_pid, regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- }
- else
- {
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- /*regaddr = register_addr (regno, offset);*/
- regaddr = regno;
- errno = 0;
- ptrace (6, inferior_pid, regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing all regs, number %d", regno);
- perror_with_name (buf);
- }
- }
-}
-
-/*** Extensions to core and dump files, for GDB. */
-
-extern unsigned int last_frame_offset;
-
-#ifdef PYRAMID_CORE
-
-/* Can't make definitions here static, since core.c needs them
- to do bounds checking on the core-file areas. O well. */
-
-/* have two stacks: one for data, one for register windows. */
-extern CORE_ADDR reg_stack_start;
-extern CORE_ADDR reg_stack_end;
-
-/* need this so we can find the global registers: they never get saved. */
-CORE_ADDR global_reg_offset;
-static CORE_ADDR last_frame_address;
-CORE_ADDR last_frame_offset;
-
-
-/* Address in core file of start of register window stack area.
- Don't know if is this any of meaningful, useful or necessary. */
-extern int reg_stack_offset;
-
-#endif /* PYRAMID_CORE */
-
-
-/* Work with core dump and executable files, for GDB.
- This code would be in core.c if it weren't machine-dependent. */
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- extern char registers[];
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
-
-#ifdef PYRAMID_CORE
- reg_stack_start = CONTROL_STACK_ADDR;
- reg_stack_end = CONTROL_STACK_ADDR; /* this isn't strictly true...*/
-#endif /* PYRAMID_CORE */
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
- /* 4.2-style (and perhaps also sysV-style) core dump file. */
- {
- struct user u;
-
- unsigned int reg_offset;
-
- val = myread (corechan, &u, sizeof u);
- if (val < 0)
- perror_with_name ("Not a core file: reading upage");
- if (val != sizeof u)
- error ("Not a core file: could only read %d bytes", val);
- data_start = exec_data_start;
-
- data_end = data_start + NBPG * u.u_dsize;
- data_offset = NBPG * UPAGES;
- stack_offset = NBPG * (UPAGES + u.u_dsize);
-
- /* find registers in core file */
-#ifdef PYRAMID_PTRACE
- stack_start = stack_end - NBPG * u.u_ussize;
- reg_stack_offset = stack_offset + (NBPG *u.u_ussize);
- reg_stack_end = reg_stack_start + NBPG * u.u_cssize;
-
- last_frame_address = ((int) u.u_pcb.pcb_csp);
- last_frame_offset = reg_stack_offset + last_frame_address
- - CONTROL_STACK_ADDR ;
- global_reg_offset = (char *)&u - (char *)&u.u_pcb.pcb_gr0 ;
-
- /* skip any control-stack frames that were executed in the
- kernel. */
-
- while (1) {
- char buf[4];
- val = lseek (corechan, last_frame_offset+(47*4), 0);
- if (val < 0)
- perror_with_name (filename);
- val = myread (corechan, buf, sizeof buf);
- if (val < 0)
- perror_with_name (filename);
-
- if (*(int *)buf >= 0)
- break;
- printf ("skipping frame %s\n", local_hex_string (last_frame_address));
- last_frame_offset -= CONTROL_STACK_FRAME_SIZE;
- last_frame_address -= CONTROL_STACK_FRAME_SIZE;
- }
- reg_offset = last_frame_offset;
-
-#if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
- printf ("Control stack pointer = %s\n",
- local_hex_string (u.u_pcb.pcb_csp));
- printf ("offset to control stack %d outermost frame %d (%s)\n",
- reg_stack_offset, reg_offset, local_hex_string (last_frame_address));
-#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
-
-#else /* not PYRAMID_CORE */
- stack_start = stack_end - NBPG * u.u_ssize;
- reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
-#endif /* not PYRAMID_CORE */
-
-#ifdef __not_on_pyr_yet
- /* Some machines put an absolute address in here and some put
- the offset in the upage of the regs. */
- reg_offset = (int) u.u_ar0;
- if (reg_offset > NBPG * UPAGES)
- reg_offset -= KERNEL_U_ADDR;
-#endif
-
- /* I don't know where to find this info.
- So, for now, mark it as not available. */
- N_SET_MAGIC (core_aouthdr, 0);
-
- /* Read the register values out of the core file and store
- them where `read_register' will find them. */
-
- {
- register int regno;
-
- for (regno = 0; regno < 64; regno++)
- {
- char buf[MAX_REGISTER_RAW_SIZE];
-
- val = lseek (corechan, register_addr (regno, reg_offset), 0);
- if (val < 0
- || (val = myread (corechan, buf, sizeof buf)) < 0)
- {
- char * buffer = (char *) alloca (strlen (reg_names[regno])
- + 30);
- strcpy (buffer, "Reading register ");
- strcat (buffer, reg_names[regno]);
-
- perror_with_name (buffer);
- }
-
- if (val < 0)
- perror_with_name (filename);
-#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
- printf ("[reg %s(%d), offset in file %s=0x%0x, addr =0x%0x, =%0x]\n",
- reg_names[regno], regno, filename,
- register_addr(regno, reg_offset),
- regno * 4 + last_frame_address,
- *((int *)buf));
-#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
- supply_register (regno, buf);
- }
- }
- }
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- {
- corefile = concat (current_directory, "/", filename, NULL);
- }
-
-#if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
- printf ("Providing CSP (%s) as nominal address of current frame.\n",
- local_hex_string(last_frame_address));
-#endif PYRAMID_CONTROL_FRAME_DEBUGGING
- /* FIXME: Which of the following is correct? */
-#if 0
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
-#else
- set_current_frame ( create_new_frame (last_frame_address,
- read_pc ()));
-#endif
-
- select_frame (get_current_frame (), 0);
- validate_files ();
- }
- else if (from_tty)
- printf ("No core file now.\n");
-}
diff --git a/gdb/regex.c b/gdb/regex.c
deleted file mode 100644
index a4c9e26..0000000
--- a/gdb/regex.c
+++ /dev/null
@@ -1,1732 +0,0 @@
-/* Extended regular expression matching and search library.
- Copyright (C) 1985, 1989 Free Software Foundation, Inc.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* To test, compile with -Dtest.
- This Dtestable feature turns this into a self-contained program
- which reads a pattern, describes how it compiles,
- then reads a string and searches for it. */
-
-#ifdef emacs
-
-/* The `emacs' switch turns on certain special matching commands
- that make sense only in emacs. */
-
-#include "config.h"
-#include "lisp.h"
-#include "buffer.h"
-#include "syntax.h"
-
-#else /* not emacs */
-
-#ifdef USG
-#ifndef BSTRING
-#define bcopy(s,d,n) memcpy((d),(s),(n))
-#define bcmp(s1,s2,n) memcmp((s1),(s2),(n))
-#define bzero(s,n) memset((s),0,(n))
-#endif
-#endif
-
-/* Make alloca work the best possible way. */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else
-#ifdef sparc
-#include <alloca.h>
-#endif
-#endif
-
-/*
- * Define the syntax stuff, so we can do the \<...\> things.
- */
-
-#ifndef Sword /* must be non-zero in some of the tests below... */
-#define Sword 1
-#endif
-
-#define SYNTAX(c) re_syntax_table[c]
-
-#ifdef SYNTAX_TABLE
-
-char *re_syntax_table;
-
-#else
-
-static char re_syntax_table[256];
-
-static void
-init_syntax_once ()
-{
- register int c;
- static int done = 0;
-
- if (done)
- return;
-
- bzero (re_syntax_table, sizeof re_syntax_table);
-
- for (c = 'a'; c <= 'z'; c++)
- re_syntax_table[c] = Sword;
-
- for (c = 'A'; c <= 'Z'; c++)
- re_syntax_table[c] = Sword;
-
- for (c = '0'; c <= '9'; c++)
- re_syntax_table[c] = Sword;
-
- done = 1;
-}
-
-#endif /* SYNTAX_TABLE */
-#endif /* not emacs */
-
-#include "regex.h"
-
-/* Number of failure points to allocate space for initially,
- when matching. If this number is exceeded, more space is allocated,
- so it is not a hard limit. */
-
-#ifndef NFAILURES
-#define NFAILURES 80
-#endif /* NFAILURES */
-
-/* width of a byte in bits */
-
-#define BYTEWIDTH 8
-
-#ifndef SIGN_EXTEND_CHAR
-#define SIGN_EXTEND_CHAR(x) (x)
-#endif
-
-static int obscure_syntax = 0;
-
-/* Specify the precise syntax of regexp for compilation.
- This provides for compatibility for various utilities
- which historically have different, incompatible syntaxes.
-
- The argument SYNTAX is a bit-mask containing the two bits
- RE_NO_BK_PARENS and RE_NO_BK_VBAR. */
-
-int
-re_set_syntax (syntax)
-{
- int ret;
-
- ret = obscure_syntax;
- obscure_syntax = syntax;
- return ret;
-}
-
-/* re_compile_pattern takes a regular-expression string
- and converts it into a buffer full of byte commands for matching.
-
- PATTERN is the address of the pattern string
- SIZE is the length of it.
- BUFP is a struct re_pattern_buffer * which points to the info
- on where to store the byte commands.
- This structure contains a char * which points to the
- actual space, which should have been obtained with malloc.
- re_compile_pattern may use realloc to grow the buffer space.
-
- The number of bytes of commands can be found out by looking in
- the struct re_pattern_buffer that bufp pointed to,
- after re_compile_pattern returns.
-*/
-
-#define PATPUSH(ch) (*b++ = (char) (ch))
-
-#define PATFETCH(c) \
- {if (p == pend) goto end_of_pattern; \
- c = * (unsigned char *) p++; \
- if (translate) c = translate[c]; }
-
-#define PATFETCH_RAW(c) \
- {if (p == pend) goto end_of_pattern; \
- c = * (unsigned char *) p++; }
-
-#define PATUNFETCH p--
-
-#define EXTEND_BUFFER \
- { char *old_buffer = bufp->buffer; \
- if (bufp->allocated == (1<<16)) goto too_big; \
- bufp->allocated *= 2; \
- if (bufp->allocated > (1<<16)) bufp->allocated = (1<<16); \
- if (!(bufp->buffer = (char *) realloc (bufp->buffer, bufp->allocated))) \
- goto memory_exhausted; \
- c = bufp->buffer - old_buffer; \
- b += c; \
- if (fixup_jump) \
- fixup_jump += c; \
- if (laststart) \
- laststart += c; \
- begalt += c; \
- if (pending_exact) \
- pending_exact += c; \
- }
-
-static int store_jump (), insert_jump ();
-
-char *
-re_compile_pattern (pattern, size, bufp)
- char *pattern;
- int size;
- struct re_pattern_buffer *bufp;
-{
- register char *b = bufp->buffer;
- register char *p = pattern;
- char *pend = pattern + size;
- register unsigned c, c1;
- char *p1;
- unsigned char *translate = (unsigned char *) bufp->translate;
-
- /* address of the count-byte of the most recently inserted "exactn" command.
- This makes it possible to tell whether a new exact-match character
- can be added to that command or requires a new "exactn" command. */
-
- char *pending_exact = 0;
-
- /* address of the place where a forward-jump should go
- to the end of the containing expression.
- Each alternative of an "or", except the last, ends with a forward-jump
- of this sort. */
-
- char *fixup_jump = 0;
-
- /* address of start of the most recently finished expression.
- This tells postfix * where to find the start of its operand. */
-
- char *laststart = 0;
-
- /* In processing a repeat, 1 means zero matches is allowed */
-
- char zero_times_ok;
-
- /* In processing a repeat, 1 means many matches is allowed */
-
- char many_times_ok;
-
- /* address of beginning of regexp, or inside of last \( */
-
- char *begalt = b;
-
- /* Stack of information saved by \( and restored by \).
- Four stack elements are pushed by each \(:
- First, the value of b.
- Second, the value of fixup_jump.
- Third, the value of regnum.
- Fourth, the value of begalt. */
-
- int stackb[40];
- int *stackp = stackb;
- int *stacke = stackb + 40;
- int *stackt;
-
- /* Counts \('s as they are encountered. Remembered for the matching \),
- where it becomes the "register number" to put in the stop_memory command */
-
- int regnum = 1;
-
- bufp->fastmap_accurate = 0;
-
-#ifndef emacs
-#ifndef SYNTAX_TABLE
- /*
- * Initialize the syntax table.
- */
- init_syntax_once();
-#endif
-#endif
-
- if (bufp->allocated == 0)
- {
- bufp->allocated = 28;
- if (bufp->buffer)
- /* EXTEND_BUFFER loses when bufp->allocated is 0 */
- bufp->buffer = (char *) realloc (bufp->buffer, 28);
- else
- /* Caller did not allocate a buffer. Do it for him */
- bufp->buffer = (char *) malloc (28);
- if (!bufp->buffer) goto memory_exhausted;
- begalt = b = bufp->buffer;
- }
-
- while (p != pend)
- {
- if (b - bufp->buffer > bufp->allocated - 10)
- /* Note that EXTEND_BUFFER clobbers c */
- EXTEND_BUFFER;
-
- PATFETCH (c);
-
- switch (c)
- {
- case '$':
- if (obscure_syntax & RE_TIGHT_VBAR)
- {
- if (! (obscure_syntax & RE_CONTEXT_INDEP_OPS) && p != pend)
- goto normal_char;
- /* Make operand of last vbar end before this `$'. */
- if (fixup_jump)
- store_jump (fixup_jump, jump, b);
- fixup_jump = 0;
- PATPUSH (endline);
- break;
- }
-
- /* $ means succeed if at end of line, but only in special contexts.
- If randomly in the middle of a pattern, it is a normal character. */
- if (p == pend || *p == '\n'
- || (obscure_syntax & RE_CONTEXT_INDEP_OPS)
- || (obscure_syntax & RE_NO_BK_PARENS
- ? *p == ')'
- : *p == '\\' && p[1] == ')')
- || (obscure_syntax & RE_NO_BK_VBAR
- ? *p == '|'
- : *p == '\\' && p[1] == '|'))
- {
- PATPUSH (endline);
- break;
- }
- goto normal_char;
-
- case '^':
- /* ^ means succeed if at beg of line, but only if no preceding pattern. */
-
- if (laststart && p[-2] != '\n'
- && ! (obscure_syntax & RE_CONTEXT_INDEP_OPS))
- goto normal_char;
- if (obscure_syntax & RE_TIGHT_VBAR)
- {
- if (p != pattern + 1
- && ! (obscure_syntax & RE_CONTEXT_INDEP_OPS))
- goto normal_char;
- PATPUSH (begline);
- begalt = b;
- }
- else
- PATPUSH (begline);
- break;
-
- case '+':
- case '?':
- if (obscure_syntax & RE_BK_PLUS_QM)
- goto normal_char;
- handle_plus:
- case '*':
- /* If there is no previous pattern, char not special. */
- if (!laststart && ! (obscure_syntax & RE_CONTEXT_INDEP_OPS))
- goto normal_char;
- /* If there is a sequence of repetition chars,
- collapse it down to equivalent to just one. */
- zero_times_ok = 0;
- many_times_ok = 0;
- while (1)
- {
- zero_times_ok |= c != '+';
- many_times_ok |= c != '?';
- if (p == pend)
- break;
- PATFETCH (c);
- if (c == '*')
- ;
- else if (!(obscure_syntax & RE_BK_PLUS_QM)
- && (c == '+' || c == '?'))
- ;
- else if ((obscure_syntax & RE_BK_PLUS_QM)
- && c == '\\')
- {
- int c1;
- PATFETCH (c1);
- if (!(c1 == '+' || c1 == '?'))
- {
- PATUNFETCH;
- PATUNFETCH;
- break;
- }
- c = c1;
- }
- else
- {
- PATUNFETCH;
- break;
- }
- }
-
- /* Star, etc. applied to an empty pattern is equivalent
- to an empty pattern. */
- if (!laststart)
- break;
-
- /* Now we know whether 0 matches is allowed,
- and whether 2 or more matches is allowed. */
- if (many_times_ok)
- {
- /* If more than one repetition is allowed,
- put in a backward jump at the end. */
- store_jump (b, maybe_finalize_jump, laststart - 3);
- b += 3;
- }
- insert_jump (on_failure_jump, laststart, b + 3, b);
- pending_exact = 0;
- b += 3;
- if (!zero_times_ok)
- {
- /* At least one repetition required: insert before the loop
- a skip over the initial on-failure-jump instruction */
- insert_jump (dummy_failure_jump, laststart, laststart + 6, b);
- b += 3;
- }
- break;
-
- case '.':
- laststart = b;
- PATPUSH (anychar);
- break;
-
- case '[':
- while (b - bufp->buffer
- > bufp->allocated - 3 - (1 << BYTEWIDTH) / BYTEWIDTH)
- /* Note that EXTEND_BUFFER clobbers c */
- EXTEND_BUFFER;
-
- laststart = b;
- if (*p == '^')
- PATPUSH (charset_not), p++;
- else
- PATPUSH (charset);
- p1 = p;
-
- PATPUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
- /* Clear the whole map */
- bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
- /* Read in characters and ranges, setting map bits */
- while (1)
- {
- PATFETCH (c);
- if (c == ']' && p != p1 + 1) break;
- if (*p == '-' && p[1] != ']')
- {
- PATFETCH (c1);
- PATFETCH (c1);
- while (c <= c1)
- b[c / BYTEWIDTH] |= 1 << (c % BYTEWIDTH), c++;
- }
- else
- {
- b[c / BYTEWIDTH] |= 1 << (c % BYTEWIDTH);
- }
- }
- /* Discard any bitmap bytes that are all 0 at the end of the map.
- Decrement the map-length byte too. */
- while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
- b[-1]--;
- b += b[-1];
- break;
-
- case '(':
- if (! (obscure_syntax & RE_NO_BK_PARENS))
- goto normal_char;
- else
- goto handle_open;
-
- case ')':
- if (! (obscure_syntax & RE_NO_BK_PARENS))
- goto normal_char;
- else
- goto handle_close;
-
- case '\n':
- if (! (obscure_syntax & RE_NEWLINE_OR))
- goto normal_char;
- else
- goto handle_bar;
-
- case '|':
- if (! (obscure_syntax & RE_NO_BK_VBAR))
- goto normal_char;
- else
- goto handle_bar;
-
- case '\\':
- if (p == pend) goto invalid_pattern;
- PATFETCH_RAW (c);
- switch (c)
- {
- case '(':
- if (obscure_syntax & RE_NO_BK_PARENS)
- goto normal_backsl;
- handle_open:
- if (stackp == stacke) goto nesting_too_deep;
- if (regnum < RE_NREGS)
- {
- PATPUSH (start_memory);
- PATPUSH (regnum);
- }
- *stackp++ = b - bufp->buffer;
- *stackp++ = fixup_jump ? fixup_jump - bufp->buffer + 1 : 0;
- *stackp++ = regnum++;
- *stackp++ = begalt - bufp->buffer;
- fixup_jump = 0;
- laststart = 0;
- begalt = b;
- break;
-
- case ')':
- if (obscure_syntax & RE_NO_BK_PARENS)
- goto normal_backsl;
- handle_close:
- if (stackp == stackb) goto unmatched_close;
- begalt = *--stackp + bufp->buffer;
- if (fixup_jump)
- store_jump (fixup_jump, jump, b);
- if (stackp[-1] < RE_NREGS)
- {
- PATPUSH (stop_memory);
- PATPUSH (stackp[-1]);
- }
- stackp -= 2;
- fixup_jump = 0;
- if (*stackp)
- fixup_jump = *stackp + bufp->buffer - 1;
- laststart = *--stackp + bufp->buffer;
- break;
-
- case '|':
- if (obscure_syntax & RE_NO_BK_VBAR)
- goto normal_backsl;
- handle_bar:
- insert_jump (on_failure_jump, begalt, b + 6, b);
- pending_exact = 0;
- b += 3;
- if (fixup_jump)
- store_jump (fixup_jump, jump, b);
- fixup_jump = b;
- b += 3;
- laststart = 0;
- begalt = b;
- break;
-
-#ifdef emacs
- case '=':
- PATPUSH (at_dot);
- break;
-
- case 's':
- laststart = b;
- PATPUSH (syntaxspec);
- PATFETCH (c);
- PATPUSH (syntax_spec_code[c]);
- break;
-
- case 'S':
- laststart = b;
- PATPUSH (notsyntaxspec);
- PATFETCH (c);
- PATPUSH (syntax_spec_code[c]);
- break;
-#endif /* emacs */
-
- case 'w':
- laststart = b;
- PATPUSH (wordchar);
- break;
-
- case 'W':
- laststart = b;
- PATPUSH (notwordchar);
- break;
-
- case '<':
- PATPUSH (wordbeg);
- break;
-
- case '>':
- PATPUSH (wordend);
- break;
-
- case 'b':
- PATPUSH (wordbound);
- break;
-
- case 'B':
- PATPUSH (notwordbound);
- break;
-
- case '`':
- PATPUSH (begbuf);
- break;
-
- case '\'':
- PATPUSH (endbuf);
- break;
-
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- c1 = c - '0';
- if (c1 >= regnum)
- goto normal_char;
- for (stackt = stackp - 2; stackt > stackb; stackt -= 4)
- if (*stackt == c1)
- goto normal_char;
- laststart = b;
- PATPUSH (duplicate);
- PATPUSH (c1);
- break;
-
- case '+':
- case '?':
- if (obscure_syntax & RE_BK_PLUS_QM)
- goto handle_plus;
-
- default:
- normal_backsl:
- /* You might think it would be useful for \ to mean
- not to translate; but if we don't translate it
- it will never match anything. */
- if (translate) c = translate[c];
- goto normal_char;
- }
- break;
-
- default:
- normal_char:
- if (!pending_exact || pending_exact + *pending_exact + 1 != b
- || *pending_exact == 0177 || *p == '*' || *p == '^'
- || ((obscure_syntax & RE_BK_PLUS_QM)
- ? *p == '\\' && (p[1] == '+' || p[1] == '?')
- : (*p == '+' || *p == '?')))
- {
- laststart = b;
- PATPUSH (exactn);
- pending_exact = b;
- PATPUSH (0);
- }
- PATPUSH (c);
- (*pending_exact)++;
- }
- }
-
- if (fixup_jump)
- store_jump (fixup_jump, jump, b);
-
- if (stackp != stackb) goto unmatched_open;
-
- bufp->used = b - bufp->buffer;
- return 0;
-
- invalid_pattern:
- return "Invalid regular expression";
-
- unmatched_open:
- return "Unmatched \\(";
-
- unmatched_close:
- return "Unmatched \\)";
-
- end_of_pattern:
- return "Premature end of regular expression";
-
- nesting_too_deep:
- return "Nesting too deep";
-
- too_big:
- return "Regular expression too big";
-
- memory_exhausted:
- return "Memory exhausted";
-}
-
-/* Store where `from' points a jump operation to jump to where `to' points.
- `opcode' is the opcode to store. */
-
-static int
-store_jump (from, opcode, to)
- char *from, *to;
- char opcode;
-{
- from[0] = opcode;
- from[1] = (to - (from + 3)) & 0377;
- from[2] = (to - (from + 3)) >> 8;
-}
-
-/* Open up space at char FROM, and insert there a jump to TO.
- CURRENT_END gives te end of the storage no in use,
- so we know how much data to copy up.
- OP is the opcode of the jump to insert.
-
- If you call this function, you must zero out pending_exact. */
-
-static int
-insert_jump (op, from, to, current_end)
- char op;
- char *from, *to, *current_end;
-{
- register char *pto = current_end + 3;
- register char *pfrom = current_end;
- while (pfrom != from)
- *--pto = *--pfrom;
- store_jump (from, op, to);
-}
-
-/* Given a pattern, compute a fastmap from it.
- The fastmap records which of the (1 << BYTEWIDTH) possible characters
- can start a string that matches the pattern.
- This fastmap is used by re_search to skip quickly over totally implausible text.
-
- The caller must supply the address of a (1 << BYTEWIDTH)-byte data area
- as bufp->fastmap.
- The other components of bufp describe the pattern to be used. */
-
-void
-re_compile_fastmap (bufp)
- struct re_pattern_buffer *bufp;
-{
- unsigned char *pattern = (unsigned char *) bufp->buffer;
- int size = bufp->used;
- register char *fastmap = bufp->fastmap;
- register unsigned char *p = pattern;
- register unsigned char *pend = pattern + size;
- register int j, k;
- unsigned char *translate = (unsigned char *) bufp->translate;
-
- unsigned char *stackb[NFAILURES];
- unsigned char **stackp = stackb;
-
- bzero (fastmap, (1 << BYTEWIDTH));
- bufp->fastmap_accurate = 1;
- bufp->can_be_null = 0;
-
- while (p)
- {
- if (p == pend)
- {
- bufp->can_be_null = 1;
- break;
- }
-#ifdef SWITCH_ENUM_BUG
- switch ((int) ((enum regexpcode) *p++))
-#else
- switch ((enum regexpcode) *p++)
-#endif
- {
- case exactn:
- if (translate)
- fastmap[translate[p[1]]] = 1;
- else
- fastmap[p[1]] = 1;
- break;
-
- case begline:
- case before_dot:
- case at_dot:
- case after_dot:
- case begbuf:
- case endbuf:
- case wordbound:
- case notwordbound:
- case wordbeg:
- case wordend:
- continue;
-
- case endline:
- if (translate)
- fastmap[translate['\n']] = 1;
- else
- fastmap['\n'] = 1;
- if (bufp->can_be_null != 1)
- bufp->can_be_null = 2;
- break;
-
- case finalize_jump:
- case maybe_finalize_jump:
- case jump:
- case dummy_failure_jump:
- bufp->can_be_null = 1;
- j = *p++ & 0377;
- j += SIGN_EXTEND_CHAR (*(char *)p) << 8;
- p += j + 1; /* The 1 compensates for missing ++ above */
- if (j > 0)
- continue;
- /* Jump backward reached implies we just went through
- the body of a loop and matched nothing.
- Opcode jumped to should be an on_failure_jump.
- Just treat it like an ordinary jump.
- For a * loop, it has pushed its failure point already;
- if so, discard that as redundant. */
- if ((enum regexpcode) *p != on_failure_jump)
- continue;
- p++;
- j = *p++ & 0377;
- j += SIGN_EXTEND_CHAR (*(char *)p) << 8;
- p += j + 1; /* The 1 compensates for missing ++ above */
- if (stackp != stackb && *stackp == p)
- stackp--;
- continue;
-
- case on_failure_jump:
- j = *p++ & 0377;
- j += SIGN_EXTEND_CHAR (*(char *)p) << 8;
- p++;
- *++stackp = p + j;
- continue;
-
- case start_memory:
- case stop_memory:
- p++;
- continue;
-
- case duplicate:
- bufp->can_be_null = 1;
- fastmap['\n'] = 1;
- case anychar:
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (j != '\n')
- fastmap[j] = 1;
- if (bufp->can_be_null)
- return;
- /* Don't return; check the alternative paths
- so we can set can_be_null if appropriate. */
- break;
-
- case wordchar:
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) == Sword)
- fastmap[j] = 1;
- break;
-
- case notwordchar:
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) != Sword)
- fastmap[j] = 1;
- break;
-
-#ifdef emacs
- case syntaxspec:
- k = *p++;
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) == (enum syntaxcode) k)
- fastmap[j] = 1;
- break;
-
- case notsyntaxspec:
- k = *p++;
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) != (enum syntaxcode) k)
- fastmap[j] = 1;
- break;
-#endif /* emacs */
-
- case charset:
- for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
- if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
- {
- if (translate)
- fastmap[translate[j]] = 1;
- else
- fastmap[j] = 1;
- }
- break;
-
- case charset_not:
- /* Chars beyond end of map must be allowed */
- for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
- if (translate)
- fastmap[translate[j]] = 1;
- else
- fastmap[j] = 1;
-
- for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
- if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
- {
- if (translate)
- fastmap[translate[j]] = 1;
- else
- fastmap[j] = 1;
- }
- break;
- }
-
- /* Get here means we have successfully found the possible starting characters
- of one path of the pattern. We need not follow this path any farther.
- Instead, look at the next alternative remembered in the stack. */
- if (stackp != stackb)
- p = *stackp--;
- else
- break;
- }
-}
-
-/* Like re_search_2, below, but only one string is specified. */
-
-int
-re_search (pbufp, string, size, startpos, range, regs)
- struct re_pattern_buffer *pbufp;
- char *string;
- int size, startpos, range;
- struct re_registers *regs;
-{
- return re_search_2 (pbufp, 0, 0, string, size, startpos, range, regs, size);
-}
-
-/* Like re_match_2 but tries first a match starting at index STARTPOS,
- then at STARTPOS + 1, and so on.
- RANGE is the number of places to try before giving up.
- If RANGE is negative, the starting positions tried are
- STARTPOS, STARTPOS - 1, etc.
- It is up to the caller to make sure that range is not so large
- as to take the starting position outside of the input strings.
-
-The value returned is the position at which the match was found,
- or -1 if no match was found,
- or -2 if error (such as failure stack overflow). */
-
-int
-re_search_2 (pbufp, string1, size1, string2, size2, startpos, range, regs, mstop)
- struct re_pattern_buffer *pbufp;
- char *string1, *string2;
- int size1, size2;
- int startpos;
- register int range;
- struct re_registers *regs;
- int mstop;
-{
- register char *fastmap = pbufp->fastmap;
- register unsigned char *translate = (unsigned char *) pbufp->translate;
- int total = size1 + size2;
- int val;
-
- /* Update the fastmap now if not correct already */
- if (fastmap && !pbufp->fastmap_accurate)
- re_compile_fastmap (pbufp);
-
- /* Don't waste time in a long search for a pattern
- that says it is anchored. */
- if (pbufp->used > 0 && (enum regexpcode) pbufp->buffer[0] == begbuf
- && range > 0)
- {
- if (startpos > 0)
- return -1;
- else
- range = 1;
- }
-
- while (1)
- {
- /* If a fastmap is supplied, skip quickly over characters
- that cannot possibly be the start of a match.
- Note, however, that if the pattern can possibly match
- the null string, we must test it at each starting point
- so that we take the first null string we get. */
-
- if (fastmap && startpos < total && pbufp->can_be_null != 1)
- {
- if (range > 0)
- {
- register int lim = 0;
- register unsigned char *p;
- int irange = range;
- if (startpos < size1 && startpos + range >= size1)
- lim = range - (size1 - startpos);
-
- p = ((unsigned char *)
- &(startpos >= size1 ? string2 - size1 : string1)[startpos]);
-
- if (translate)
- {
- while (range > lim && !fastmap[translate[*p++]])
- range--;
- }
- else
- {
- while (range > lim && !fastmap[*p++])
- range--;
- }
- startpos += irange - range;
- }
- else
- {
- register unsigned char c;
- if (startpos >= size1)
- c = string2[startpos - size1];
- else
- c = string1[startpos];
- c &= 0xff;
- if (translate ? !fastmap[translate[c]] : !fastmap[c])
- goto advance;
- }
- }
-
- if (range >= 0 && startpos == total
- && fastmap && pbufp->can_be_null == 0)
- return -1;
-
- val = re_match_2 (pbufp, string1, size1, string2, size2, startpos, regs, mstop);
- if (0 <= val)
- {
- if (val == -2)
- return -2;
- return startpos;
- }
-
-#ifdef C_ALLOCA
- alloca (0);
-#endif /* C_ALLOCA */
-
- advance:
- if (!range) break;
- if (range > 0) range--, startpos++; else range++, startpos--;
- }
- return -1;
-}
-
-#ifndef emacs /* emacs never uses this */
-int
-re_match (pbufp, string, size, pos, regs)
- struct re_pattern_buffer *pbufp;
- char *string;
- int size, pos;
- struct re_registers *regs;
-{
- return re_match_2 (pbufp, 0, 0, string, size, pos, regs, size);
-}
-#endif /* emacs */
-
-/* Maximum size of failure stack. Beyond this, overflow is an error. */
-
-int re_max_failures = 2000;
-
-static int bcmp_translate();
-/* Match the pattern described by PBUFP
- against data which is the virtual concatenation of STRING1 and STRING2.
- SIZE1 and SIZE2 are the sizes of the two data strings.
- Start the match at position POS.
- Do not consider matching past the position MSTOP.
-
- If pbufp->fastmap is nonzero, then it had better be up to date.
-
- The reason that the data to match are specified as two components
- which are to be regarded as concatenated
- is so this function can be used directly on the contents of an Emacs buffer.
-
- -1 is returned if there is no match. -2 is returned if there is
- an error (such as match stack overflow). Otherwise the value is the length
- of the substring which was matched. */
-
-int
-re_match_2 (pbufp, string1, size1, string2, size2, pos, regs, mstop)
- struct re_pattern_buffer *pbufp;
- unsigned char *string1, *string2;
- int size1, size2;
- int pos;
- struct re_registers *regs;
- int mstop;
-{
- register unsigned char *p = (unsigned char *) pbufp->buffer;
- register unsigned char *pend = p + pbufp->used;
- /* End of first string */
- unsigned char *end1;
- /* End of second string */
- unsigned char *end2;
- /* Pointer just past last char to consider matching */
- unsigned char *end_match_1, *end_match_2;
- register unsigned char *d, *dend;
- register int mcnt;
- unsigned char *translate = (unsigned char *) pbufp->translate;
-
- /* Failure point stack. Each place that can handle a failure further down the line
- pushes a failure point on this stack. It consists of two char *'s.
- The first one pushed is where to resume scanning the pattern;
- the second pushed is where to resume scanning the strings.
- If the latter is zero, the failure point is a "dummy".
- If a failure happens and the innermost failure point is dormant,
- it discards that failure point and tries the next one. */
-
- unsigned char *initial_stack[2 * NFAILURES];
- unsigned char **stackb = initial_stack;
- unsigned char **stackp = stackb, **stacke = &stackb[2 * NFAILURES];
-
- /* Information on the "contents" of registers.
- These are pointers into the input strings; they record
- just what was matched (on this attempt) by some part of the pattern.
- The start_memory command stores the start of a register's contents
- and the stop_memory command stores the end.
-
- At that point, regstart[regnum] points to the first character in the register,
- regend[regnum] points to the first character beyond the end of the register,
- regstart_seg1[regnum] is true iff regstart[regnum] points into string1,
- and regend_seg1[regnum] is true iff regend[regnum] points into string1. */
-
- unsigned char *regstart[RE_NREGS];
- unsigned char *regend[RE_NREGS];
- unsigned char regstart_seg1[RE_NREGS], regend_seg1[RE_NREGS];
-
- /* Set up pointers to ends of strings.
- Don't allow the second string to be empty unless both are empty. */
- if (!size2)
- {
- string2 = string1;
- size2 = size1;
- string1 = 0;
- size1 = 0;
- }
- end1 = string1 + size1;
- end2 = string2 + size2;
-
- /* Compute where to stop matching, within the two strings */
- if (mstop <= size1)
- {
- end_match_1 = string1 + mstop;
- end_match_2 = string2;
- }
- else
- {
- end_match_1 = end1;
- end_match_2 = string2 + mstop - size1;
- }
-
- /* Initialize \) text positions to -1
- to mark ones that no \( or \) has been seen for. */
-
- for (mcnt = 0; mcnt < sizeof (regend) / sizeof (*regend); mcnt++)
- regend[mcnt] = (unsigned char *) -1;
-
- /* `p' scans through the pattern as `d' scans through the data.
- `dend' is the end of the input string that `d' points within.
- `d' is advanced into the following input string whenever necessary,
- but this happens before fetching;
- therefore, at the beginning of the loop,
- `d' can be pointing at the end of a string,
- but it cannot equal string2. */
-
- if (pos <= size1)
- d = string1 + pos, dend = end_match_1;
- else
- d = string2 + pos - size1, dend = end_match_2;
-
-/* Write PREFETCH; just before fetching a character with *d. */
-#define PREFETCH \
- while (d == dend) \
- { if (dend == end_match_2) goto fail; /* end of string2 => failure */ \
- d = string2; /* end of string1 => advance to string2. */ \
- dend = end_match_2; }
-
- /* This loop loops over pattern commands.
- It exits by returning from the function if match is complete,
- or it drops through if match fails at this starting point in the input data. */
-
- while (1)
- {
- if (p == pend)
- /* End of pattern means we have succeeded! */
- {
- /* If caller wants register contents data back, convert it to indices */
- if (regs)
- {
- regs->start[0] = pos;
- if (dend == end_match_1)
- regs->end[0] = d - string1;
- else
- regs->end[0] = d - string2 + size1;
- for (mcnt = 1; mcnt < RE_NREGS; mcnt++)
- {
- if (regend[mcnt] == (unsigned char *) -1)
- {
- regs->start[mcnt] = -1;
- regs->end[mcnt] = -1;
- continue;
- }
- if (regstart_seg1[mcnt])
- regs->start[mcnt] = regstart[mcnt] - string1;
- else
- regs->start[mcnt] = regstart[mcnt] - string2 + size1;
- if (regend_seg1[mcnt])
- regs->end[mcnt] = regend[mcnt] - string1;
- else
- regs->end[mcnt] = regend[mcnt] - string2 + size1;
- }
- }
- if (dend == end_match_1)
- return (d - string1 - pos);
- else
- return d - string2 + size1 - pos;
- }
-
- /* Otherwise match next pattern command */
-#ifdef SWITCH_ENUM_BUG
- switch ((int) ((enum regexpcode) *p++))
-#else
- switch ((enum regexpcode) *p++)
-#endif
- {
-
- /* \( is represented by a start_memory, \) by a stop_memory.
- Both of those commands contain a "register number" argument.
- The text matched within the \( and \) is recorded under that number.
- Then, \<digit> turns into a `duplicate' command which
- is followed by the numeric value of <digit> as the register number. */
-
- case start_memory:
- regstart[*p] = d;
- regstart_seg1[*p++] = (dend == end_match_1);
- break;
-
- case stop_memory:
- regend[*p] = d;
- regend_seg1[*p++] = (dend == end_match_1);
- break;
-
- case duplicate:
- {
- int regno = *p++; /* Get which register to match against */
- register unsigned char *d2, *dend2;
-
- d2 = regstart[regno];
- dend2 = ((regstart_seg1[regno] == regend_seg1[regno])
- ? regend[regno] : end_match_1);
- while (1)
- {
- /* Advance to next segment in register contents, if necessary */
- while (d2 == dend2)
- {
- if (dend2 == end_match_2) break;
- if (dend2 == regend[regno]) break;
- d2 = string2, dend2 = regend[regno]; /* end of string1 => advance to string2. */
- }
- /* At end of register contents => success */
- if (d2 == dend2) break;
-
- /* Advance to next segment in data being matched, if necessary */
- PREFETCH;
-
- /* mcnt gets # consecutive chars to compare */
- mcnt = dend - d;
- if (mcnt > dend2 - d2)
- mcnt = dend2 - d2;
- /* Compare that many; failure if mismatch, else skip them. */
- if (translate ? bcmp_translate (d, d2, mcnt, translate) : bcmp (d, d2, mcnt))
- goto fail;
- d += mcnt, d2 += mcnt;
- }
- }
- break;
-
- case anychar:
- /* fetch a data character */
- PREFETCH;
- /* Match anything but a newline. */
- if ((translate ? translate[*d++] : *d++) == '\n')
- goto fail;
- break;
-
- case charset:
- case charset_not:
- {
- /* Nonzero for charset_not */
- int not = 0;
- register int c;
- if (*(p - 1) == (unsigned char) charset_not)
- not = 1;
-
- /* fetch a data character */
- PREFETCH;
-
- if (translate)
- c = translate [*d];
- else
- c = *d;
-
- if (c < *p * BYTEWIDTH
- && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
- not = !not;
-
- p += 1 + *p;
-
- if (!not) goto fail;
- d++;
- break;
- }
-
- case begline:
- if (d == string1 || d[-1] == '\n')
- break;
- goto fail;
-
- case endline:
- if (d == end2
- || (d == end1 ? (size2 == 0 || *string2 == '\n') : *d == '\n'))
- break;
- goto fail;
-
- /* "or" constructs ("|") are handled by starting each alternative
- with an on_failure_jump that points to the start of the next alternative.
- Each alternative except the last ends with a jump to the joining point.
- (Actually, each jump except for the last one really jumps
- to the following jump, because tensioning the jumps is a hassle.) */
-
- /* The start of a stupid repeat has an on_failure_jump that points
- past the end of the repeat text.
- This makes a failure point so that, on failure to match a repetition,
- matching restarts past as many repetitions have been found
- with no way to fail and look for another one. */
-
- /* A smart repeat is similar but loops back to the on_failure_jump
- so that each repetition makes another failure point. */
-
- case on_failure_jump:
- if (stackp == stacke)
- {
- unsigned char **stackx;
- if (stacke - stackb > re_max_failures * 2)
- return -2;
- stackx = (unsigned char **) alloca (2 * (stacke - stackb)
- * sizeof (char *));
- bcopy (stackb, stackx, (stacke - stackb) * sizeof (char *));
- stackp = stackx + (stackp - stackb);
- stacke = stackx + 2 * (stacke - stackb);
- stackb = stackx;
- }
- mcnt = *p++ & 0377;
- mcnt += SIGN_EXTEND_CHAR (*(char *)p) << 8;
- p++;
- *stackp++ = mcnt + p;
- *stackp++ = d;
- break;
-
- /* The end of a smart repeat has an maybe_finalize_jump back.
- Change it either to a finalize_jump or an ordinary jump. */
-
- case maybe_finalize_jump:
- mcnt = *p++ & 0377;
- mcnt += SIGN_EXTEND_CHAR (*(char *)p) << 8;
- p++;
- {
- register unsigned char *p2 = p;
- /* Compare what follows with the begining of the repeat.
- If we can establish that there is nothing that they would
- both match, we can change to finalize_jump */
- while (p2 != pend
- && (*p2 == (unsigned char) stop_memory
- || *p2 == (unsigned char) start_memory))
- p2++;
- if (p2 == pend)
- p[-3] = (unsigned char) finalize_jump;
- else if (*p2 == (unsigned char) exactn
- || *p2 == (unsigned char) endline)
- {
- register int c = *p2 == (unsigned char) endline ? '\n' : p2[2];
- register unsigned char *p1 = p + mcnt;
- /* p1[0] ... p1[2] are an on_failure_jump.
- Examine what follows that */
- if (p1[3] == (unsigned char) exactn && p1[5] != c)
- p[-3] = (unsigned char) finalize_jump;
- else if (p1[3] == (unsigned char) charset
- || p1[3] == (unsigned char) charset_not)
- {
- int not = p1[3] == (unsigned char) charset_not;
- if (c < p1[4] * BYTEWIDTH
- && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
- not = !not;
- /* not is 1 if c would match */
- /* That means it is not safe to finalize */
- if (!not)
- p[-3] = (unsigned char) finalize_jump;
- }
- }
- }
- p -= 2;
- if (p[-1] != (unsigned char) finalize_jump)
- {
- p[-1] = (unsigned char) jump;
- goto nofinalize;
- }
-
- /* The end of a stupid repeat has a finalize-jump
- back to the start, where another failure point will be made
- which will point after all the repetitions found so far. */
-
- case finalize_jump:
- stackp -= 2;
-
- case jump:
- nofinalize:
- mcnt = *p++ & 0377;
- mcnt += SIGN_EXTEND_CHAR (*(char *)p) << 8;
- p += mcnt + 1; /* The 1 compensates for missing ++ above */
- break;
-
- case dummy_failure_jump:
- if (stackp == stacke)
- {
- unsigned char **stackx
- = (unsigned char **) alloca (2 * (stacke - stackb)
- * sizeof (char *));
- bcopy (stackb, stackx, (stacke - stackb) * sizeof (char *));
- stackp = stackx + (stackp - stackb);
- stacke = stackx + 2 * (stacke - stackb);
- stackb = stackx;
- }
- *stackp++ = 0;
- *stackp++ = 0;
- goto nofinalize;
-
- case wordbound:
- if (d == string1 /* Points to first char */
- || d == end2 /* Points to end */
- || (d == end1 && size2 == 0)) /* Points to end */
- break;
- if ((SYNTAX (d[-1]) == Sword)
- != (SYNTAX (d == end1 ? *string2 : *d) == Sword))
- break;
- goto fail;
-
- case notwordbound:
- if (d == string1 /* Points to first char */
- || d == end2 /* Points to end */
- || (d == end1 && size2 == 0)) /* Points to end */
- goto fail;
- if ((SYNTAX (d[-1]) == Sword)
- != (SYNTAX (d == end1 ? *string2 : *d) == Sword))
- goto fail;
- break;
-
- case wordbeg:
- if (d == end2 /* Points to end */
- || (d == end1 && size2 == 0) /* Points to end */
- || SYNTAX (* (d == end1 ? string2 : d)) != Sword) /* Next char not a letter */
- goto fail;
- if (d == string1 /* Points to first char */
- || SYNTAX (d[-1]) != Sword) /* prev char not letter */
- break;
- goto fail;
-
- case wordend:
- if (d == string1 /* Points to first char */
- || SYNTAX (d[-1]) != Sword) /* prev char not letter */
- goto fail;
- if (d == end2 /* Points to end */
- || (d == end1 && size2 == 0) /* Points to end */
- || SYNTAX (d == end1 ? *string2 : *d) != Sword) /* Next char not a letter */
- break;
- goto fail;
-
-#ifdef emacs
- case before_dot:
- if (((d - string2 <= (unsigned) size2)
- ? d - bf_p2 : d - bf_p1)
- <= point)
- goto fail;
- break;
-
- case at_dot:
- if (((d - string2 <= (unsigned) size2)
- ? d - bf_p2 : d - bf_p1)
- == point)
- goto fail;
- break;
-
- case after_dot:
- if (((d - string2 <= (unsigned) size2)
- ? d - bf_p2 : d - bf_p1)
- >= point)
- goto fail;
- break;
-
- case wordchar:
- mcnt = (int) Sword;
- goto matchsyntax;
-
- case syntaxspec:
- mcnt = *p++;
- matchsyntax:
- PREFETCH;
- if (SYNTAX (*d++) != (enum syntaxcode) mcnt) goto fail;
- break;
-
- case notwordchar:
- mcnt = (int) Sword;
- goto matchnotsyntax;
-
- case notsyntaxspec:
- mcnt = *p++;
- matchnotsyntax:
- PREFETCH;
- if (SYNTAX (*d++) == (enum syntaxcode) mcnt) goto fail;
- break;
-#else
- case wordchar:
- PREFETCH;
- if (SYNTAX (*d++) == 0) goto fail;
- break;
-
- case notwordchar:
- PREFETCH;
- if (SYNTAX (*d++) != 0) goto fail;
- break;
-#endif /* not emacs */
-
- case begbuf:
- if (d == string1) /* Note, d cannot equal string2 */
- break; /* unless string1 == string2. */
- goto fail;
-
- case endbuf:
- if (d == end2 || (d == end1 && size2 == 0))
- break;
- goto fail;
-
- case exactn:
- /* Match the next few pattern characters exactly.
- mcnt is how many characters to match. */
- mcnt = *p++;
- if (translate)
- {
- do
- {
- PREFETCH;
- if (translate[*d++] != *p++) goto fail;
- }
- while (--mcnt);
- }
- else
- {
- do
- {
- PREFETCH;
- if (*d++ != *p++) goto fail;
- }
- while (--mcnt);
- }
- break;
- }
- continue; /* Successfully matched one pattern command; keep matching */
-
- /* Jump here if any matching operation fails. */
- fail:
- if (stackp != stackb)
- /* A restart point is known. Restart there and pop it. */
- {
- if (!stackp[-2])
- { /* If innermost failure point is dormant, flush it and keep looking */
- stackp -= 2;
- goto fail;
- }
- d = *--stackp;
- p = *--stackp;
- if (d >= string1 && d <= end1)
- dend = end_match_1;
- }
- else break; /* Matching at this starting point really fails! */
- }
- return -1; /* Failure to match */
-}
-
-static int
-bcmp_translate (s1, s2, len, translate)
- unsigned char *s1, *s2;
- register int len;
- unsigned char *translate;
-{
- register unsigned char *p1 = s1, *p2 = s2;
- while (len)
- {
- if (translate [*p1++] != translate [*p2++]) return 1;
- len--;
- }
- return 0;
-}
-
-/* Entry points compatible with bsd4.2 regex library */
-
-#ifndef emacs
-
-static struct re_pattern_buffer re_comp_buf;
-
-char *
-re_comp (s)
- char *s;
-{
- if (!s)
- {
- if (!re_comp_buf.buffer)
- return "No previous regular expression";
- return 0;
- }
-
- if (!re_comp_buf.buffer)
- {
- if (!(re_comp_buf.buffer = (char *) malloc (200)))
- return "Memory exhausted";
- re_comp_buf.allocated = 200;
- if (!(re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH)))
- return "Memory exhausted";
- }
- return re_compile_pattern (s, strlen (s), &re_comp_buf);
-}
-
-int
-re_exec (s)
- char *s;
-{
- int len = strlen (s);
- return 0 <= re_search (&re_comp_buf, s, len, 0, len, 0);
-}
-
-#endif /* emacs */
-
-#ifdef test
-
-#include <stdio.h>
-
-/* Indexed by a character, gives the upper case equivalent of the character */
-
-static char upcase[0400] =
- { 000, 001, 002, 003, 004, 005, 006, 007,
- 010, 011, 012, 013, 014, 015, 016, 017,
- 020, 021, 022, 023, 024, 025, 026, 027,
- 030, 031, 032, 033, 034, 035, 036, 037,
- 040, 041, 042, 043, 044, 045, 046, 047,
- 050, 051, 052, 053, 054, 055, 056, 057,
- 060, 061, 062, 063, 064, 065, 066, 067,
- 070, 071, 072, 073, 074, 075, 076, 077,
- 0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
- 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
- 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
- 0130, 0131, 0132, 0133, 0134, 0135, 0136, 0137,
- 0140, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
- 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
- 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
- 0130, 0131, 0132, 0173, 0174, 0175, 0176, 0177,
- 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
- 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
- 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
- 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
- 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
- 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
- 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
- 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
- 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
- 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
- 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
- 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
- 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
- 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
- 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
- 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377
- };
-
-main (argc, argv)
- int argc;
- char **argv;
-{
- char pat[80];
- struct re_pattern_buffer buf;
- int i;
- char c;
- char fastmap[(1 << BYTEWIDTH)];
-
- /* Allow a command argument to specify the style of syntax. */
- if (argc > 1)
- obscure_syntax = atoi (argv[1]);
-
- buf.allocated = 40;
- buf.buffer = (char *) malloc (buf.allocated);
- buf.fastmap = fastmap;
- buf.translate = upcase;
-
- while (1)
- {
- gets (pat);
-
- if (*pat)
- {
- re_compile_pattern (pat, strlen(pat), &buf);
-
- for (i = 0; i < buf.used; i++)
- printchar (buf.buffer[i]);
-
- putchar ('\n');
-
- printf ("%d allocated, %d used.\n", buf.allocated, buf.used);
-
- re_compile_fastmap (&buf);
- printf ("Allowed by fastmap: ");
- for (i = 0; i < (1 << BYTEWIDTH); i++)
- if (fastmap[i]) printchar (i);
- putchar ('\n');
- }
-
- gets (pat); /* Now read the string to match against */
-
- i = re_match (&buf, pat, strlen (pat), 0, 0);
- printf ("Match value %d.\n", i);
- }
-}
-
-#ifdef NOTDEF
-print_buf (bufp)
- struct re_pattern_buffer *bufp;
-{
- int i;
-
- printf ("buf is :\n----------------\n");
- for (i = 0; i < bufp->used; i++)
- printchar (bufp->buffer[i]);
-
- printf ("\n%d allocated, %d used.\n", bufp->allocated, bufp->used);
-
- printf ("Allowed by fastmap: ");
- for (i = 0; i < (1 << BYTEWIDTH); i++)
- if (bufp->fastmap[i])
- printchar (i);
- printf ("\nAllowed by translate: ");
- if (bufp->translate)
- for (i = 0; i < (1 << BYTEWIDTH); i++)
- if (bufp->translate[i])
- printchar (i);
- printf ("\nfastmap is%s accurate\n", bufp->fastmap_accurate ? "" : "n't");
- printf ("can %s be null\n----------", bufp->can_be_null ? "" : "not");
-}
-#endif
-
-printchar (c)
- char c;
-{
- if (c < 041 || c >= 0177)
- {
- putchar ('\\');
- putchar (((c >> 6) & 3) + '0');
- putchar (((c >> 3) & 7) + '0');
- putchar ((c & 7) + '0');
- }
- else
- putchar (c);
-}
-
-error (string)
- char *string;
-{
- puts (string);
- exit (1);
-}
-
-#endif /* test */
diff --git a/gdb/regex.h b/gdb/regex.h
deleted file mode 100644
index 6348c3e..0000000
--- a/gdb/regex.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/* Definitions for data structures callers pass the regex library.
- Copyright (C) 1985, 1989 Free Software Foundation, Inc.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Define number of parens for which we record the beginnings and ends.
- This affects how much space the `struct re_registers' type takes up. */
-#ifndef RE_NREGS
-#define RE_NREGS 10
-#endif
-
-/* These bits are used in the obscure_syntax variable to choose among
- alternative regexp syntaxes. */
-
-/* 1 means plain parentheses serve as grouping, and backslash
- parentheses are needed for literal searching.
- 0 means backslash-parentheses are grouping, and plain parentheses
- are for literal searching. */
-#define RE_NO_BK_PARENS 1
-
-/* 1 means plain | serves as the "or"-operator, and \| is a literal.
- 0 means \| serves as the "or"-operator, and | is a literal. */
-#define RE_NO_BK_VBAR 2
-
-/* 0 means plain + or ? serves as an operator, and \+, \? are literals.
- 1 means \+, \? are operators and plain +, ? are literals. */
-#define RE_BK_PLUS_QM 4
-
-/* 1 means | binds tighter than ^ or $.
- 0 means the contrary. */
-#define RE_TIGHT_VBAR 8
-
-/* 1 means treat \n as an _OR operator
- 0 means treat it as a normal character */
-#define RE_NEWLINE_OR 16
-
-/* 0 means that a special characters (such as *, ^, and $) always have
- their special meaning regardless of the surrounding context.
- 1 means that special characters may act as normal characters in some
- contexts. Specifically, this applies to:
- ^ - only special at the beginning, or after ( or |
- $ - only special at the end, or before ) or |
- *, +, ? - only special when not after the beginning, (, or | */
-#define RE_CONTEXT_INDEP_OPS 32
-
-/* Now define combinations of bits for the standard possibilities. */
-#define RE_SYNTAX_AWK (RE_NO_BK_PARENS | RE_NO_BK_VBAR | RE_CONTEXT_INDEP_OPS)
-#define RE_SYNTAX_EGREP (RE_SYNTAX_AWK | RE_NEWLINE_OR)
-#define RE_SYNTAX_GREP (RE_BK_PLUS_QM | RE_NEWLINE_OR)
-#define RE_SYNTAX_EMACS 0
-
-/* This data structure is used to represent a compiled pattern. */
-
-struct re_pattern_buffer
- {
- char *buffer; /* Space holding the compiled pattern commands. */
- int allocated; /* Size of space that buffer points to */
- int used; /* Length of portion of buffer actually occupied */
- char *fastmap; /* Pointer to fastmap, if any, or zero if none. */
- /* re_search uses the fastmap, if there is one,
- to skip quickly over totally implausible characters */
- char *translate; /* Translate table to apply to all characters before comparing.
- Or zero for no translation.
- The translation is applied to a pattern when it is compiled
- and to data when it is matched. */
- char fastmap_accurate;
- /* Set to zero when a new pattern is stored,
- set to one when the fastmap is updated from it. */
- char can_be_null; /* Set to one by compiling fastmap
- if this pattern might match the null string.
- It does not necessarily match the null string
- in that case, but if this is zero, it cannot.
- 2 as value means can match null string
- but at end of range or before a character
- listed in the fastmap. */
- };
-
-/* Structure to store "register" contents data in.
-
- Pass the address of such a structure as an argument to re_match, etc.,
- if you want this information back.
-
- start[i] and end[i] record the string matched by \( ... \) grouping i,
- for i from 1 to RE_NREGS - 1.
- start[0] and end[0] record the entire string matched. */
-
-struct re_registers
- {
- int start[RE_NREGS];
- int end[RE_NREGS];
- };
-
-/* These are the command codes that appear in compiled regular expressions, one per byte.
- Some command codes are followed by argument bytes.
- A command code can specify any interpretation whatever for its arguments.
- Zero-bytes may appear in the compiled regular expression. */
-
-enum regexpcode
- {
- unused,
- exactn, /* followed by one byte giving n, and then by n literal bytes */
- begline, /* fails unless at beginning of line */
- endline, /* fails unless at end of line */
- jump, /* followed by two bytes giving relative address to jump to */
- on_failure_jump, /* followed by two bytes giving relative address of place
- to resume at in case of failure. */
- finalize_jump, /* Throw away latest failure point and then jump to address. */
- maybe_finalize_jump, /* Like jump but finalize if safe to do so.
- This is used to jump back to the beginning
- of a repeat. If the command that follows
- this jump is clearly incompatible with the
- one at the beginning of the repeat, such that
- we can be sure that there is no use backtracking
- out of repetitions already completed,
- then we finalize. */
- dummy_failure_jump, /* jump, and push a dummy failure point.
- This failure point will be thrown away
- if an attempt is made to use it for a failure.
- A + construct makes this before the first repeat. */
- anychar, /* matches any one character */
- charset, /* matches any one char belonging to specified set.
- First following byte is # bitmap bytes.
- Then come bytes for a bit-map saying which chars are in.
- Bits in each byte are ordered low-bit-first.
- A character is in the set if its bit is 1.
- A character too large to have a bit in the map
- is automatically not in the set */
- charset_not, /* similar but match any character that is NOT one of those specified */
- start_memory, /* starts remembering the text that is matched
- and stores it in a memory register.
- followed by one byte containing the register number.
- Register numbers must be in the range 0 through NREGS. */
- stop_memory, /* stops remembering the text that is matched
- and stores it in a memory register.
- followed by one byte containing the register number.
- Register numbers must be in the range 0 through NREGS. */
- duplicate, /* match a duplicate of something remembered.
- Followed by one byte containing the index of the memory register. */
- before_dot, /* Succeeds if before dot */
- at_dot, /* Succeeds if at dot */
- after_dot, /* Succeeds if after dot */
- begbuf, /* Succeeds if at beginning of buffer */
- endbuf, /* Succeeds if at end of buffer */
- wordchar, /* Matches any word-constituent character */
- notwordchar, /* Matches any char that is not a word-constituent */
- wordbeg, /* Succeeds if at word beginning */
- wordend, /* Succeeds if at word end */
- wordbound, /* Succeeds if at a word boundary */
- notwordbound, /* Succeeds if not at a word boundary */
- syntaxspec, /* Matches any character whose syntax is specified.
- followed by a byte which contains a syntax code, Sword or such like */
- notsyntaxspec /* Matches any character whose syntax differs from the specified. */
- };
-
-extern char *re_compile_pattern ();
-/* Is this really advertised? */
-extern void re_compile_fastmap ();
-extern int re_search (), re_search_2 ();
-extern int re_match (), re_match_2 ();
-
-/* 4.2 bsd compatibility (yuck) */
-extern char *re_comp ();
-extern int re_exec ();
-
-#ifdef SYNTAX_TABLE
-extern char *re_syntax_table;
-#endif
diff --git a/gdb/rem-m68k.shar b/gdb/rem-m68k.shar
deleted file mode 100755
index aeb76e5..0000000
--- a/gdb/rem-m68k.shar
+++ /dev/null
@@ -1,893 +0,0 @@
-# This is a shell archive. Remove anything before this line,
-# then unpack it by saving it in a file and typing "sh file".
-#
-# Wrapped by Glenn Engel <glenne@labgre> on Mon Jun 12 15:19:20 1989
-#
-# This archive contains:
-# remcom.c
-#
-
-LANG=""; export LANG
-PATH=/bin:/usr/bin:$PATH; export PATH
-
-echo x - remcom.c
-cat >remcom.c <<'@EOF'
-
-/****************************************************************************
-
- THIS SOFTWARE IS NOT COPYRIGHTED
-
- HP offers the following for use in the public domain. HP makes no
- warranty with regard to the software or it's performance and the
- user accepts the software "AS IS" with all faults.
-
- HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
- TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-****************************************************************************/
-
-/****************************************************************************
- * $Header$
- *
- * $Module name: remcom.c $
- * $Revision$
- * $Date$
- * $Contributor: Lake Stevens Instrument Division$
- *
- * $Description: low level support for gdb debugger. $
- *
- * $Considerations: only works on target hardware $
- *
- * $Written by: Glenn Engel $
- * $ModuleState: Experimental $
- *
- * $NOTES: See Below $
- *
- * To enable debugger support, two things need to happen. One, a
- * call to set_debug_traps() is necessary in order to allow any breakpoints
- * or error conditions to be properly intercepted and reported to gdb.
- * Two, a breakpoint needs to be generated to begin communication. This
- * is most easily accomplished by a call to breakpoint(). Breakpoint()
- * simulates a breakpoint by executing a trap #1.
- *
- * Some explanation is probably necessary to explain how exceptions are
- * handled. When an exception is encountered the 68000 pushes the current
- * program counter and status register onto the supervisor stack and then
- * transfers execution to a location specified in it's vector table.
- * The handlers for the exception vectors are hardwired to jmp to an address
- * given by the relation: (exception - 256) * 6. These are decending
- * addresses starting from -6, -12, -18, ... By allowing 6 bytes for
- * each entry, a jsr, jmp, bsr, ... can be used to enter the exception
- * handler. Using a jsr to handle an exception has an added benefit of
- * allowing a single handler to service several exceptions and use the
- * return address as the key differentiation. The vector number can be
- * computed from the return address by [ exception = (addr + 1530) / 6 ].
- * The sole purpose of the routine _catchException is to compute the
- * exception number and push it on the stack in place of the return address.
- * The external function exceptionHandler() is
- * used to attach a specific handler to a specific 68k exception.
- * For 68020 machines, the ability to have a return address around just
- * so the vector can be determined is not necessary because the '020 pushes an
- * extra word onto the stack containing the vector offset
- *
- * Because gdb will sometimes write to the stack area to execute function
- * calls, this program cannot rely on using the supervisor stack so it
- * uses it's own stack area reserved in the int array remcomStack.
- *
- *************
- *
- * The following gdb commands are supported:
- *
- * command function Return value
- *
- * g return the value of the CPU registers hex data or ENN
- * G set the value of the CPU registers OK or ENN
- *
- * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
- * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
- *
- * c Resume at current address SNN ( signal NN)
- * cAA..AA Continue at address AA..AA SNN
- *
- * s Step one instruction SNN
- * sAA..AA Step one instruction from AA..AA SNN
- *
- * k kill
- *
- * ? What was the last sigval ? SNN (signal NN)
- *
- * All commands and responses are sent with a packet which includes a
- * checksum. A packet consists of
- *
- * $<packet info>#<checksum>.
- *
- * where
- * <packet info> :: <characters representing the command or response>
- * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
- *
- * When a packet is received, it is first acknowledged with either '+' or '-'.
- * '+' indicates a successful transfer. '-' indicates a failed transfer.
- *
- * Example:
- *
- * Host: Reply:
- * $m0,10#2a +$00010203040506070809101112131415#42
- *
- ****************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-#include <setjmp.h>
-
-/************************************************************************
- *
- * external low-level support routines
- */
-typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
-typedef void (*Function)(); /* pointer to a function */
-
-extern putDebugChar(); /* write a single character */
-extern getDebugChar(); /* read and return a single char */
-
-extern Function exceptionHandler(); /* assign an exception handler */
-extern ExceptionHook exceptionHook; /* hook variable for errors/exceptions */
-
-
-/************************************************************************/
-/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
-/* at least NUMREGBYTES*2 are needed for register packets */
-#define BUFMAX 400
-
-static char initialized; /* boolean flag. != 0 means we've been initialized */
-
-int remote_debug = 0;
-/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
-
-char hexchars[]="0123456789abcdef";
-
-/* there are 180 bytes of registers on a 68020 w/68881 */
-/* many of the fpa registers are 12 byte (96 bit) registers */
-#define NUMREGBYTES 180
-enum regnames {D0,D1,D2,D3,D4,D5,D6,D7,
- A0,A1,A2,A3,A4,A5,A6,A7,
- PS,PC,
- FP0,FP1,FP2,FP3,FP4,FP5,FP6,FP7,
- FPCONTROL,FPSTATUS,FPIADDR
- };
-
-typedef struct FrameStruct
-{
- struct FrameStruct *previous;
- int exceptionPC; /* pc value when this frame created */
- int exceptionVector; /* cpu vector causing exception */
- short frameSize; /* size of cpu frame in words */
- short sr; /* for 68000, this not always sr */
- int pc;
- short format;
- int fsaveHeader;
- int morejunk[0]; /* exception frame, fp save... */
-} Frame;
-
-#define FRAMESIZE 500
-static Frame *lastFrame;
-static int frameStack[FRAMESIZE];
-
-/*
- * these should not be static cuz they can be used outside this module
- */
-int registers[NUMREGBYTES/4];
-int superStack;
-
-static int remcomStack[400];
-static int* stackPtr = &remcomStack[399];
-
-/*
- * In many cases, the system will want to continue exception processing
- * when a continue command is given.
- * oldExceptionHook is a function to invoke in this case.
- */
-
-static ExceptionHook oldExceptionHook;
-
-/* the size of the exception stack on the 68020 varies with the type of
- * exception. The following table is the number of WORDS used
- * for each exception format.
- */
-static short exceptionSize[] = { 4,4,6,4,4,4,4,4,29,10,16,46,4,4,4,4 };
-
-/************* jump buffer used for setjmp/longjmp **************************/
-jmp_buf env;
-
-/*************************** ASSEMBLY CODE MACROS *************************/
-/* */
-
-#ifdef __HAVE_68881__
-/* do an fsave, then remember the address to begin a restore from */
-#define SAVE_FP_REGS() asm(" fsave a0@-"); \
- asm(" fmovemx fp0-fp7,_registers+72"); \
- asm(" fmoveml fpcr/fpsr/fpi,_registers+168");
-#define RESTORE_FP_REGS() asm(" fmoveml _registers+168,fpcr/fpsr/fpi"); \
- asm(" fmovemx _registers+72,fp0-fp7"); \
- asm(" frestore a0@+");
-#else
-#define SAVE_FP_REGS()
-#define RESTORE_FP_REGS()
-#endif /* __HAVE_68881__ */
-
-asm("
-.text
-.globl _return_to_super
-_return_to_super:
- movel _registers+60,sp /* get new stack pointer */
- movel _lastFrame,a0 /* get last frame info */
- bra return_to_any
-
-.globl _return_to_user
-_return_to_user:
- movel _registers+60,a0 /* get usp */
- movel a0,usp /* set usp */
- movel _superStack,sp /* get original stack pointer */
-
-return_to_any:
- movel _lastFrame,a0 /* get last frame info */
- movel a0@+,_lastFrame /* link in previous frame */
- addql #8,a0 /* skip over pc, vector#*/
- movew a0@+,d0 /* get # of words in cpu frame */
- addw d0,a0 /* point to end of data */
- addw d0,a0 /* point to end of data */
- movel a0,a1
-#
-# copy the stack frame
- subql #1,d0
-copyUserLoop:
- movew a1@-,sp@-
- dbf d0,copyUserLoop
-");
- RESTORE_FP_REGS()
- asm(" moveml _registers,d0-d7/a0-a6");
- asm(" rte"); /* pop and go! */
-
-#define DISABLE_INTERRUPTS() asm(" oriw #0x0700,sr");
-#define BREAKPOINT() asm(" trap #1");
-
-/* this function is called immediately when a level 7 interrupt occurs */
-/* if the previous interrupt level was 7 then we're already servicing */
-/* this interrupt and an rte is in order to return to the debugger. */
-/* For the 68000, the offset for sr is 6 due to the jsr return address */
-asm("
-.text
-.globl __debug_level7
-__debug_level7:
- movew d0,sp@-");
-#ifdef mc68020
-asm(" movew sp@(2),d0");
-#else
-asm(" movew sp@(6),d0");
-#endif
-asm(" andiw #0x700,d0
- cmpiw #0x700,d0
- beq _already7
- movew sp@+,d0
- bra __catchException
-_already7:
- movew sp@+,d0");
-#ifndef mc68020
-asm(" lea sp@(4),sp"); /* pull off 68000 return address */
-#endif
-asm(" rte");
-
-extern void _catchException();
-
-#ifdef mc68020
-/* This function is called when a 68020 exception occurs. It saves
- * all the cpu and fpcp regs in the _registers array, creates a frame on a
- * linked list of frames which has the cpu and fpcp stack frames needed
- * to properly restore the context of these processors, and invokes
- * an exception handler (remcom_handler).
- *
- * stack on entry: stack on exit:
- * N bytes of junk exception # MSWord
- * Exception Format Word exception # MSWord
- * Program counter LSWord
- * Program counter MSWord
- * Status Register
- *
- *
- */
-asm("
-.text
-.globl __catchException
-__catchException:");
-DISABLE_INTERRUPTS();
-asm("
- moveml d0-d7/a0-a6,_registers /* save registers */
- movel _lastFrame,a0 /* last frame pointer */
-");
-SAVE_FP_REGS();
-asm("
- lea _registers,a5 /* get address of registers */
- movew sp@,d1 /* get status register */
- movew d1,a5@(66) /* save sr */
- movel sp@(2),a4 /* save pc in a4 for later use */
- movel a4,a5@(68) /* save pc in _regisers[] */
-
-#
-# figure out how many bytes in the stack frame
- movew sp@(6),d0 /* get '020 exception format */
- movew d0,d2 /* make a copy of format word */
- andiw #0xf000,d0 /* mask off format type */
- rolw #5,d0 /* rotate into the low byte *2 */
- lea _exceptionSize,a1
- addw d0,a1 /* index into the table */
- movew a1@,d0 /* get number of words in frame */
- movew d0,d3 /* save it */
- subw d0,a0 /* adjust save pointer */
- subw d0,a0 /* adjust save pointer(bytes) */
- movel a0,a1 /* copy save pointer */
- subql #1,d0 /* predecrement loop counter */
-#
-# copy the frame
-saveFrameLoop:
- movew sp@+,a1@+
- dbf d0,saveFrameLoop
-#
-# now that the stack has been clenaed,
-# save the a7 in use at time of exception
- movel sp,_superStack /* save supervisor sp */
- andiw #0x2000,d1 /* were we in supervisor mode ? */
- beq userMode
- movel a7,a5@(60) /* save a7 */
- bra a7saveDone
-userMode:
- movel usp,a1
- movel a1,a5@(60) /* save user stack pointer */
-a7saveDone:
-
-#
-# save size of frame
- movew d3,a0@-
-
-#
-# compute exception number
- andl #0xfff,d2 /* mask off vector offset */
- lsrw #2,d2 /* divide by 4 to get vect num */
- movel d2,a0@- /* save it */
-#
-# save pc causing exception
- movel a4,a0@-
-#
-# save old frame link and set the new value
- movel _lastFrame,a1 /* last frame pointer */
- movel a1,a0@- /* save pointer to prev frame */
- movel a0,_lastFrame
-
- movel d2,sp@- /* push exception num */
- movel _exceptionHook,a0 /* get address of handler */
- jbsr a0@ /* and call it */
- jmp __returnFromException /* now, return */
-");
-#else /* mc68000 */
-/* This function is called when an exception occurs. It translates the
- * return address found on the stack into an exception vector # which
- * is then handled by either handle_exception or a system handler.
- * _catchException provides a front end for both.
- *
- * stack on entry: stack on exit:
- * Program counter MSWord exception # MSWord
- * Program counter LSWord exception # MSWord
- * Status Register
- * Return Address MSWord
- * Return Address LSWord
- */
-asm("
-.text
-.globl __catchException
-__catchException:");
-DISABLE_INTERRUPTS();
-asm("
- moveml d0-d7/a0-a6,_registers /* save registers */
- movel _lastFrame,a0 /* last frame pointer */
-");
-SAVE_FP_REGS();
-asm("
- lea _registers,a5 /* get address of registers */
- movel sp@+,d2 /* pop return address */
- addl #1530,d2 /* convert return addr to */
- divs #6,d2 /* exception number */
- extl d2
-
- moveql #3,d3 /* assume a three word frame */
-
- cmpiw #3,d2 /* bus error or address error ? */
- bgt normal /* if >3 then normal error */
- movel sp@+,a0@- /* copy error info to frame buff*/
- movel sp@+,a0@- /* these are never used */
- moveql #7,d3 /* this is a 7 word frame */
-
-normal:
- movew sp@+,d1 /* pop status register */
- movel sp@+,a4 /* pop program counter */
- movew d1,a5@(66) /* save sr */
- movel a4,a5@(68) /* save pc in _regisers[] */
- movel a4,a0@- /* copy pc to frame buffer */
- movew d1,a0@- /* copy sr to frame buffer */
-
- movel sp,_superStack /* save supervisor sp */
-
- andiw #0x2000,d1 /* were we in supervisor mode ? */
- beq userMode
- movel a7,a5@(60) /* save a7 */
- bra saveDone
-userMode:
- movel usp,a1 /* save user stack pointer */
- movel a1,a5@(60) /* save user stack pointer */
-saveDone:
-
- movew d3,a0@- /* push frame size in words */
- movel d2,a0@- /* push vector number */
- movel a4,a0@- /* push exception pc */
-
-#
-# save old frame link and set the new value
- movel _lastFrame,a1 /* last frame pointer */
- movel a1,a0@- /* save pointer to prev frame */
- movel a0,_lastFrame
-
- movel d2,sp@- /* push exception num */
- movel _exceptionHook,a0 /* get address of handler */
- jbsr a0@ /* and call it */
- jmp __returnFromException /* now, return */
-");
-#endif
-
-
-/*
- * remcomHandler is a front end for handle_exception. It moves the
- * stack pointer into an area reserved for debugger use in case the
- * breakpoint happened in supervisor mode.
- */
-asm("_remcomHandler:");
-asm(" addl #4,sp"); /* pop off return address */
-asm(" movel sp@+,d0"); /* get the exception number */
-asm(" movel _stackPtr,sp"); /* move to remcom stack area */
-asm(" movel d0,sp@-"); /* push exception onto stack */
-asm(" jbsr _handle_exception"); /* this never returns */
-asm(" rts"); /* return */
-
-void _returnFromException( Frame *frame )
-{
- /* if no existing frame, dummy one up */
- if (! frame)
- {
- frame = lastFrame -1;
- frame->frameSize = 4;
- frame->format = 0;
- frame->fsaveHeader = 0;
- frame->previous = lastFrame;
- }
-
-#ifndef mc68020
- /* a 68000 cannot use the internal info pushed onto a bus error
- * or address error frame when doing an RTE so don't put this info
- * onto the stack or the stack will creep every time this happens.
- */
- frame->frameSize=3;
-#endif
-
- /* throw away any frames in the list after this frame */
- lastFrame = frame;
-
- frame->sr = registers[(int) PS];
- frame->pc = registers[(int) PC];
-
- if (registers[(int) PS] & 0x2000)
- {
- /* return to supervisor mode... */
- return_to_super();
- }
- else
- { /* return to user mode */
- return_to_user();
- }
-}
-
-int hex(ch)
-char ch;
-{
- if ((ch >= 'a') && (ch <= 'f')) return (ch-'a'+10);
- if ((ch >= '0') && (ch <= '9')) return (ch-'0');
- return (0);
-}
-
-
-/* scan for the sequence $<data>#<checksum> */
-void getpacket(buffer)
-char * buffer;
-{
- unsigned char checksum;
- unsigned char xmitcsum;
- int i;
- int count;
- char ch;
-
- do {
- /* wait around for the start character, ignore all other characters */
- while ((ch = getDebugChar()) != '$');
- checksum = 0;
- count = 0;
-
- /* now, read until a # or end of buffer is found */
- while (count < BUFMAX) {
- ch = getDebugChar();
- if (ch == '#') break;
- checksum = checksum + ch;
- buffer[count] = ch;
- count = count + 1;
- }
- buffer[count] = 0;
-
- if (ch == '#') {
- xmitcsum = hex(getDebugChar()) << 4;
- xmitcsum += hex(getDebugChar());
- if ((remote_debug ) && (checksum != xmitcsum)) {
- fprintf(stderr,"bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
- checksum,xmitcsum,buffer);
- }
-
- if (checksum != xmitcsum) putDebugChar('-'); /* failed checksum */
- else {
- putDebugChar('+'); /* successful transfer */
- /* if a sequence char is present, reply the sequence ID */
- if (buffer[2] == ':') {
- putDebugChar( buffer[0] );
- putDebugChar( buffer[1] );
- /* remove sequence chars from buffer */
- count = strlen(buffer);
- for (i=3; i <= count; i++) buffer[i-3] = buffer[i];
- }
- }
- }
- } while (checksum != xmitcsum);
-
-}
-
-/* send the packet in buffer. The host get's one chance to read it.
- This routine does not wait for a positive acknowledge. */
-
-
-void putpacket(buffer)
-char * buffer;
-{
- unsigned char checksum;
- int count;
- char ch;
-
- /* $<packet info>#<checksum>. */
- do {
- putDebugChar('$');
- checksum = 0;
- count = 0;
-
- while (ch=buffer[count]) {
- if (! putDebugChar(ch)) return;
- checksum += ch;
- count += 1;
- }
-
- putDebugChar('#');
- putDebugChar(hexchars[checksum >> 4]);
- putDebugChar(hexchars[checksum % 16]);
-
- } while (1 == 0); /* (getDebugChar() != '+'); */
-
-}
-
-static char inbuffer[BUFMAX];
-static char outbuffer[BUFMAX];
-static short error;
-
-
-void debug_error(format, parm)
-char * format;
-char * parm;
-{
- if (remote_debug) fprintf(stderr,format,parm);
-}
-
-/* convert the memory pointed to by mem into hex, placing result in buf */
-/* return a pointer to the last char put in buf (null) */
-char* mem2hex(mem, buf, count)
-char* mem;
-char* buf;
-int count;
-{
- int i;
- unsigned char ch;
- for (i=0;i<count;i++) {
- ch = *mem++;
- *buf++ = hexchars[ch >> 4];
- *buf++ = hexchars[ch % 16];
- }
- *buf = 0;
- return(buf);
-}
-
-/* convert the hex array pointed to by buf into binary to be placed in mem */
-/* return a pointer to the character AFTER the last byte written */
-char* hex2mem(buf, mem, count)
-char* buf;
-char* mem;
-int count;
-{
- int i;
- unsigned char ch;
- for (i=0;i<count;i++) {
- ch = hex(*buf++) << 4;
- ch = ch + hex(*buf++);
- *mem++ = ch;
- }
- return(mem);
-}
-
-/* a bus error has occurred, perform a longjmp
- to return execution and allow handling of the error */
-
-void handle_buserror()
-{
- longjmp(env,1);
-}
-
-/* this function takes the 68000 exception number and attempts to
- translate this number into a unix compatible signal value */
-int computeSignal( exceptionVector )
-int exceptionVector;
-{
- int sigval;
- switch (exceptionVector) {
- case 2 : sigval = 10; break; /* bus error */
- case 3 : sigval = 10; break; /* address error */
- case 4 : sigval = 4; break; /* illegal instruction */
- case 5 : sigval = 8; break; /* zero divide */
- case 6 : sigval = 16; break; /* chk instruction */
- case 7 : sigval = 16; break; /* trapv instruction */
- case 8 : sigval = 11; break; /* privilege violation */
- case 9 : sigval = 5; break; /* trace trap */
- case 10: sigval = 4; break; /* line 1010 emulator */
- case 11: sigval = 4; break; /* line 1111 emulator */
- case 31: sigval = 2; break; /* interrupt */
- case 33: sigval = 5; break; /* breakpoint */
- case 40: sigval = 8; break; /* floating point err */
- case 48: sigval = 8; break; /* floating point err */
- case 49: sigval = 8; break; /* floating point err */
- case 50: sigval = 8; break; /* zero divide */
- case 51: sigval = 8; break; /* underflow */
- case 52: sigval = 8; break; /* operand error */
- case 53: sigval = 8; break; /* overflow */
- case 54: sigval = 8; break; /* NAN */
- default:
- sigval = 7; /* "software generated"*/
- }
- return (sigval);
-}
-
-/*
- * This function does all command procesing for interfacing to gdb.
- */
-void handle_exception(int exceptionVector)
-{
- int sigval;
- int addr, length;
- char * ptr;
- int newPC;
- Frame *frame;
-
- if (remote_debug) printf("vector=%d, sr=0x%x, pc=0x%x\n",
- exceptionVector,
- registers[ PS ],
- registers[ PC ]);
-
- /* reply to host that an exception has occurred */
- sigval = computeSignal( exceptionVector );
- sprintf(outbuffer,"S%02x",sigval);
- putpacket(outbuffer);
-
- while (1==1) {
- error = 0;
- outbuffer[0] = 0;
- getpacket(inbuffer);
- switch (inbuffer[0]) {
- case '?' : sprintf(outbuffer,"S%02x",sigval);
- break;
- case 'd' : remote_debug = !(remote_debug); /* toggle debug flag */
- break;
- case 'g' : /* return the value of the CPU registers */
- mem2hex((char*) registers, outbuffer, NUMREGBYTES);
- break;
- case 'G' : /* set the value of the CPU registers - return OK */
- hex2mem(&inbuffer[1], (char*) registers, NUMREGBYTES);
- strcpy(outbuffer,"OK");
- break;
-
- /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
- case 'm' :
- if (setjmp(env) == 0) {
- exceptionHandler(2,handle_buserror);
-
- if (2 == sscanf(&inbuffer[1],"%x,%x",&addr,&length)) {
- mem2hex((char*) addr, outbuffer, length);
- }
- else {
- strcpy(outbuffer,"E01");
- debug_error("malformed read memory command: %s",inbuffer);
- }
- }
- else {
- exceptionHandler(2,_catchException);
- strcpy(outbuffer,"E03");
- debug_error("bus error");
- }
-
- /* restore handler for bus error */
- exceptionHandler(2,_catchException);
- break;
-
- /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
- case 'M' :
- if (setjmp(env) == 0) {
- exceptionHandler(2,handle_buserror);
-
- if (2 == sscanf(&inbuffer[1],"%x,%x:",&addr,&length)) {
- ptr = strchr(inbuffer,':');
- ptr += 1; /* point 1 past the colon */
- hex2mem(ptr, (char*) addr, length);
- strcpy(outbuffer,"OK");
- }
- else {
- strcpy(outbuffer,"E02");
- debug_error("malformed write memory command: %s",inbuffer);
- }
- }
- else {
- exceptionHandler(2,_catchException);
- strcpy(outbuffer,"E03");
- debug_error("bus error");
- }
- break;
-
- /* cAA..AA Continue at address AA..AA(optional) */
- /* sAA..AA Step one instruction from AA..AA(optional) */
- case 'c' :
- case 's' :
- /* try to read optional parameter, addr unchanged if no parm */
- if (1 == sscanf(&inbuffer[1],"%x",&registers[ PC ]));
- newPC = registers[ PC];
-
- /* clear the trace bit */
- registers[ PS ] &= 0x7fff;
-
- /* set the trace bit if we're stepping */
- if (inbuffer[0] == 's') registers[ PS ] |= 0x8000;
-
- /*
- * look for newPC in the linked list of exception frames.
- * if it is found, use the old frame it. otherwise,
- * fake up a dummy frame in returnFromException().
- */
- if (remote_debug) printf("new pc = 0x%x\n",newPC);
- frame = lastFrame;
- while (frame)
- {
- if (remote_debug)
- printf("frame at 0x%x has pc=0x%x, except#=%d\n",
- frame,frame->exceptionPC,
- frame->exceptionVector);
- if (frame->exceptionPC == newPC) break; /* bingo! a match */
- /*
- * for a breakpoint instruction, the saved pc may
- * be off by two due to re-executing the instruction
- * replaced by the trap instruction. Check for this.
- */
- if ((frame->exceptionVector == 33) &&
- (frame->exceptionPC == (newPC+2))) break;
- frame = frame->previous;
- }
-
- /*
- * If we found a match for the PC AND we are not returning
- * as a result of a breakpoint (33),
- * trace exception (9), nmi (31), jmp to
- * the old exception handler as if this code never ran.
- */
- if (frame)
- {
- if ((frame->exceptionVector != 9) &&
- (frame->exceptionVector != 31) &&
- (frame->exceptionVector != 33))
- {
- /*
- * invoke the previous handler.
- */
- if (oldExceptionHook)
- (*oldExceptionHook) (frame->exceptionVector);
- newPC = registers[ PC ]; /* pc may have changed */
- if (newPC != frame->exceptionPC)
- {
- if (remote_debug)
- printf("frame at 0x%x has pc=0x%x, except#=%d\n",
- frame,frame->exceptionPC,
- frame->exceptionVector);
- /* dispose of this frame, we're skipping it (longjump?)*/
- lastFrame = frame->previous;
- frame = (Frame *) 0;
- }
- }
- }
-
- _returnFromException( frame );
-
- break;
-
- /* kill the program */
- case 'k' : /* do nothing */
- break;
- } /* switch */
-
- /* reply to the request */
- putpacket(outbuffer);
- }
-}
-
-
-/* this function is used to set up exception handlers for tracing and
- breakpoints */
-void set_debug_traps()
-{
-extern void _debug_level7();
-extern void remcomHandler();
-int exception;
-
- for (exception = 2; exception <= 23; exception++)
- exceptionHandler(exception,_catchException);
-
- /* level 7 interrupt */
- exceptionHandler(31,_debug_level7);
-
- /* breakpoint exception (trap #1) */
- exceptionHandler(33,_catchException);
-
- /* floating point error (trap #8) */
- exceptionHandler(40,_catchException);
-
- /* 48 to 54 are floating point coprocessor errors */
- for (exception = 48; exception <= 54; exception++)
- exceptionHandler(exception,_catchException);
-
- if (oldExceptionHook != remcomHandler)
- {
- oldExceptionHook = exceptionHook;
- exceptionHook = remcomHandler;
- }
-
- initialized = 1;
-
- lastFrame = (Frame *) &frameStack[FRAMESIZE-1];
- lastFrame->previous = (Frame *) 0;
-}
-
-/* This function will generate a breakpoint exception. It is used at the
- beginning of a program to sync up with a debugger and can be used
- otherwise as a quick means to stop program execution and "break" into
- the debugger. */
-
-void breakpoint()
-{
- if (initialized) BREAKPOINT();
-}
-
-@EOF
-
-chmod 444 remcom.c
-
-exit 0
-
diff --git a/gdb/rem-multi.shar b/gdb/rem-multi.shar
deleted file mode 100644
index 110e060..0000000
--- a/gdb/rem-multi.shar
+++ /dev/null
@@ -1,1301 +0,0 @@
-#!/bin/sh
-# This is a shell archive.
-# Run the file through sh to extract its contents.
-# shar: Shell Archiver
-# Run the following text with /bin/sh to create:
-# Remote_Makefile
-# remote_gutils.c
-# remote_inflow.c
-# remote_server.c
-# remote_utils.c
-# This archive created: Fri Jun 23 17:06:55 1989
-cat << \SHAR_EOF > Remote_Makefile
-# Makefile for the remote server for GDB, the GNU debugger.
-# Copyright (C) 1986, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-CFLAGS = -g
-CC = cc
-
-SERVER = remote_server.o\
- remote_inflow.o\
- remote_utils.o\
- remote_gutils.o
-
-prog : $(SERVER)
- $(CC) -g -o serve $(SERVER)
-SHAR_EOF
-cat << \SHAR_EOF > remote_gutils.c
-/* General utility routines for the remote server for GDB, the GNU debugger.
- Copyright (C) 1986, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include "defs.h"
-
-void error ();
-void fatal ();
-
-/* Chain of cleanup actions established with make_cleanup,
- to be executed if an error happens. */
-
-static struct cleanup *cleanup_chain;
-
-/* Nonzero means a quit has been requested. */
-
-int quit_flag;
-
-/* Nonzero means quit immediately if Control-C is typed now,
- rather than waiting until QUIT is executed. */
-
-int immediate_quit;
-
-/* Add a new cleanup to the cleanup_chain,
- and return the previous chain pointer
- to be passed later to do_cleanups or discard_cleanups.
- Args are FUNCTION to clean up with, and ARG to pass to it. */
-
-struct cleanup *
-make_cleanup (function, arg)
- void (*function) ();
- int arg;
-{
- register struct cleanup *new
- = (struct cleanup *) xmalloc (sizeof (struct cleanup));
- register struct cleanup *old_chain = cleanup_chain;
-
- new->next = cleanup_chain;
- new->function = function;
- new->arg = arg;
- cleanup_chain = new;
-
- return old_chain;
-}
-
-/* Discard cleanups and do the actions they describe
- until we get back to the point OLD_CHAIN in the cleanup_chain. */
-
-void
-do_cleanups (old_chain)
- register struct cleanup *old_chain;
-{
- register struct cleanup *ptr;
- while ((ptr = cleanup_chain) != old_chain)
- {
- (*ptr->function) (ptr->arg);
- cleanup_chain = ptr->next;
- free (ptr);
- }
-}
-
-/* Discard cleanups, not doing the actions they describe,
- until we get back to the point OLD_CHAIN in the cleanup_chain. */
-
-void
-discard_cleanups (old_chain)
- register struct cleanup *old_chain;
-{
- register struct cleanup *ptr;
- while ((ptr = cleanup_chain) != old_chain)
- {
- cleanup_chain = ptr->next;
- free (ptr);
- }
-}
-
-/* This function is useful for cleanups.
- Do
-
- foo = xmalloc (...);
- old_chain = make_cleanup (free_current_contents, &foo);
-
- to arrange to free the object thus allocated. */
-
-void
-free_current_contents (location)
- char **location;
-{
- free (*location);
-}
-
-/* Generally useful subroutines used throughout the program. */
-
-/* Like malloc but get error if no storage available. */
-
-char *
-xmalloc (size)
- long size;
-{
- register char *val = (char *) malloc (size);
- if (!val)
- fatal ("virtual memory exhausted.", 0);
- return val;
-}
-
-/* Like realloc but get error if no storage available. */
-
-char *
-xrealloc (ptr, size)
- char *ptr;
- long size;
-{
- register char *val = (char *) realloc (ptr, size);
- if (!val)
- fatal ("virtual memory exhausted.", 0);
- return val;
-}
-
-/* Print the system error message for errno, and also mention STRING
- as the file name for which the error was encountered.
- Then return to command level. */
-
-void
-perror_with_name (string)
- char *string;
-{
- extern int sys_nerr;
- extern char *sys_errlist[];
- extern int errno;
- char *err;
- char *combined;
-
- if (errno < sys_nerr)
- err = sys_errlist[errno];
- else
- err = "unknown error";
-
- combined = (char *) alloca (strlen (err) + strlen (string) + 3);
- strcpy (combined, string);
- strcat (combined, ": ");
- strcat (combined, err);
-
- error ("%s.", combined);
-}
-
-/* Print the system error message for ERRCODE, and also mention STRING
- as the file name for which the error was encountered. */
-
-void
-print_sys_errmsg (string, errcode)
- char *string;
- int errcode;
-{
- extern int sys_nerr;
- extern char *sys_errlist[];
- char *err;
- char *combined;
-
- if (errcode < sys_nerr)
- err = sys_errlist[errcode];
- else
- err = "unknown error";
-
- combined = (char *) alloca (strlen (err) + strlen (string) + 3);
- strcpy (combined, string);
- strcat (combined, ": ");
- strcat (combined, err);
-
- printf ("%s.\n", combined);
-}
-
-void
-quit ()
-{
- fflush (stdout);
- ioctl (fileno (stdout), TIOCFLUSH, 0);
- error ("Quit");
-}
-
-/* Control C comes here */
-
-void
-request_quit ()
-{
- quit_flag = 1;
- if (immediate_quit)
- quit ();
-}
-
-/* Print an error message and return to command level.
- STRING is the error message, used as a fprintf string,
- and ARG is passed as an argument to it. */
-
-void
-error (string, arg1, arg2, arg3)
- char *string;
- int arg1, arg2, arg3;
-{
- fflush (stdout);
- fprintf (stderr, string, arg1, arg2, arg3);
- fprintf (stderr, "\n");
- /************return_to_top_level ();************/
-}
-
-/* Print an error message and exit reporting failure.
- This is for a error that we cannot continue from.
- STRING and ARG are passed to fprintf. */
-
-void
-fatal (string, arg)
- char *string;
- int arg;
-{
- fprintf (stderr, "gdb: ");
- fprintf (stderr, string, arg);
- fprintf (stderr, "\n");
- exit (1);
-}
-
-/* Make a copy of the string at PTR with SIZE characters
- (and add a null character at the end in the copy).
- Uses malloc to get the space. Returns the address of the copy. */
-
-char *
-savestring (ptr, size)
- char *ptr;
- int size;
-{
- register char *p = (char *) xmalloc (size + 1);
- bcopy (ptr, p, size);
- p[size] = 0;
- return p;
-}
-
-void
-print_spaces (n, file)
- register int n;
- register FILE *file;
-{
- while (n-- > 0)
- fputc (' ', file);
-}
-
-/* Ask user a y-or-n question and return 1 iff answer is yes.
- Takes three args which are given to printf to print the question.
- The first, a control string, should end in "? ".
- It should not say how to answer, because we do that. */
-
-int
-query (ctlstr, arg1, arg2)
- char *ctlstr;
-{
- register int answer;
-
- /* Automatically answer "yes" if input is not from a terminal. */
- /***********if (!input_from_terminal_p ())
- return 1; *************************/
-
- while (1)
- {
- printf (ctlstr, arg1, arg2);
- printf ("(y or n) ");
- fflush (stdout);
- answer = fgetc (stdin);
- clearerr (stdin); /* in case of C-d */
- if (answer != '\n')
- while (fgetc (stdin) != '\n') clearerr (stdin);
- if (answer >= 'a')
- answer -= 040;
- if (answer == 'Y')
- return 1;
- if (answer == 'N')
- return 0;
- printf ("Please answer y or n.\n");
- }
-}
-
-/* Parse a C escape sequence. STRING_PTR points to a variable
- containing a pointer to the string to parse. That pointer
- is updated past the characters we use. The value of the
- escape sequence is returned.
-
- A negative value means the sequence \ newline was seen,
- which is supposed to be equivalent to nothing at all.
-
- If \ is followed by a null character, we return a negative
- value and leave the string pointer pointing at the null character.
-
- If \ is followed by 000, we return 0 and leave the string pointer
- after the zeros. A value of 0 does not mean end of string. */
-
-int
-parse_escape (string_ptr)
- char **string_ptr;
-{
- register int c = *(*string_ptr)++;
- switch (c)
- {
- case 'a':
- return '\a';
- case 'b':
- return '\b';
- case 'e':
- return 033;
- case 'f':
- return '\f';
- case 'n':
- return '\n';
- case 'r':
- return '\r';
- case 't':
- return '\t';
- case 'v':
- return '\v';
- case '\n':
- return -2;
- case 0:
- (*string_ptr)--;
- return 0;
- case '^':
- c = *(*string_ptr)++;
- if (c == '\\')
- c = parse_escape (string_ptr);
- if (c == '?')
- return 0177;
- return (c & 0200) | (c & 037);
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- {
- register int i = c - '0';
- register int count = 0;
- while (++count < 3)
- {
- if ((c = *(*string_ptr)++) >= '0' && c <= '7')
- {
- i *= 8;
- i += c - '0';
- }
- else
- {
- (*string_ptr)--;
- break;
- }
- }
- return i;
- }
- default:
- return c;
- }
-}
-
-void
-printchar (ch, stream)
- unsigned char ch;
- FILE *stream;
-{
- register int c = ch;
- if (c < 040 || c >= 0177)
- {
- if (c == '\n')
- fprintf (stream, "\\n");
- else if (c == '\b')
- fprintf (stream, "\\b");
- else if (c == '\t')
- fprintf (stream, "\\t");
- else if (c == '\f')
- fprintf (stream, "\\f");
- else if (c == '\r')
- fprintf (stream, "\\r");
- else if (c == 033)
- fprintf (stream, "\\e");
- else if (c == '\a')
- fprintf (stream, "\\a");
- else
- fprintf (stream, "\\%03o", c);
- }
- else
- {
- if (c == '\\' || c == '"' || c == '\'')
- fputc ('\\', stream);
- fputc (c, stream);
- }
-}
-SHAR_EOF
-cat << \SHAR_EOF > remote_inflow.c
-/* Low level interface to ptrace, for GDB when running under Unix.
- Copyright (C) 1986, 1987 Free Software Foundation, Inc.
-*/
-
-#include "defs.h"
-#include "param.h"
-#include "wait.h"
-#include "frame.h"
-#include "inferior.h"
-/***************************
-#include "initialize.h"
-****************************/
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <sgtty.h>
-#include <fcntl.h>
-
-/***************Begin MY defs*********************/
-int quit_flag = 0;
-char registers[REGISTER_BYTES];
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-
-char buf2[MAX_REGISTER_RAW_SIZE];
-/***************End MY defs*********************/
-
-#ifdef NEW_SUN_PTRACE
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-#endif
-
-extern char **environ;
-extern int errno;
-extern int inferior_pid;
-void error(), quit(), perror_with_name();
-int query();
-void supply_register(), write_register();
-CORE_ADDR read_register();
-
-/* Nonzero if we are debugging an attached outside process
- rather than an inferior. */
-
-
-/* Start an inferior process and returns its pid.
- ALLARGS is a vector of program-name and args.
- ENV is the environment vector to pass. */
-
-int
-create_inferior (allargs, env)
- char **allargs;
- char **env;
-{
- int pid;
- extern int sys_nerr;
- extern char *sys_errlist[];
- extern int errno;
-
- /* exec is said to fail if the executable is open. */
- /****************close_exec_file ();*****************/
-
- pid = vfork ();
- if (pid < 0)
- perror_with_name ("vfork");
-
- if (pid == 0)
- {
- /* Run inferior in a separate process group. */
- setpgrp (getpid (), getpid ());
-
-/* Not needed on Sun, at least, and loses there
- because it clobbers the superior. */
-/*??? signal (SIGQUIT, SIG_DFL);
- signal (SIGINT, SIG_DFL); */
-
- errno = 0;
- ptrace (0);
-
- execle ("/bin/sh", "sh", "-c", allargs, 0, env);
-
- fprintf (stderr, "Cannot exec /bin/sh: %s.\n",
- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
- fflush (stderr);
- _exit (0177);
- }
- return pid;
-}
-
-/* Kill the inferior process. Make us have no inferior. */
-
-kill_inferior ()
-{
- if (inferior_pid == 0)
- return;
- ptrace (8, inferior_pid, 0, 0);
- wait (0);
- /*************inferior_died ();****VK**************/
-}
-
-/* Resume execution of the inferior process.
- If STEP is nonzero, single-step it.
- If SIGNAL is nonzero, give it that signal. */
-
-unsigned char
-resume (step, signal,status)
- int step;
- int signal;
- char *status;
-{
- int pid ;
- WAITTYPE w;
-
- errno = 0;
- ptrace (step ? 9 : 7, inferior_pid, 1, signal);
- if (errno)
- perror_with_name ("ptrace");
- pid = wait(&w);
- if(pid != inferior_pid)
- perror_with_name ("wait");
-
- if(WIFEXITED(w))
- {
- printf("\nchild exited with retcode = %x \n",WRETCODE(w));
- *status = 'E';
- return((unsigned char) WRETCODE(w));
- }
- else if(!WIFSTOPPED(w))
- {
- printf("\nchild did terminated with signal = %x \n",WTERMSIG(w));
- *status = 'T';
- return((unsigned char) WTERMSIG(w));
- }
- else
- {
- printf("\nchild stopped with signal = %x \n",WSTOPSIG(w));
- *status = 'S';
- return((unsigned char) WSTOPSIG(w));
- }
-
-}
-
-
-#ifdef NEW_SUN_PTRACE
-
-void
-fetch_inferior_registers ()
-{
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- extern char registers[];
-
- ptrace (PTRACE_GETREGS, inferior_pid, &inferior_registers);
- if (errno)
- perror_with_name ("ptrace");
- /**********debugging begin **********/
- print_some_registers(&inferior_registers);
- /**********debugging end **********/
- ptrace (PTRACE_GETFPREGS, inferior_pid, &inferior_fp_registers);
- if (errno)
- perror_with_name ("ptrace");
-
- bcopy (&inferior_registers, registers, 16 * 4);
- bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.fps_regs);
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
- bcopy (&inferior_fp_registers.fps_control,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- int regno;
-{
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- extern char registers[];
-
- bcopy (registers, &inferior_registers, 16 * 4);
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
- sizeof inferior_fp_registers.fps_regs);
- inferior_registers.r_ps = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_registers.r_pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
- bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &inferior_fp_registers.fps_control,
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-
- ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
- if (errno)
- perror_with_name ("ptrace");
- ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers);
- if (errno)
- perror_with_name ("ptrace");
-}
-
-#endif /* not NEW_SUN_PTRACE */
-
-
-/* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory
- in the NEW_SUN_PTRACE case.
- It ought to be straightforward. But it appears that writing did
- not write the data that I specified. I cannot understand where
- it got the data that it actually did write. */
-
-/* Copy LEN bytes from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. */
-
-read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & - sizeof (int);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
- /* Allocate buffer of that many longwords. */
- register int *buffer = (int *) alloca (count * sizeof (int));
-
- /* Read all the longwords */
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- buffer[i] = ptrace (1, inferior_pid, addr, 0);
- }
-
- /* Copy appropriate bytes out of the buffer. */
- bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR.
- On failure (cannot write the inferior)
- returns the value of errno. */
-
-int
-write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & - sizeof (int);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
- /* Allocate buffer of that many longwords. */
- register int *buffer = (int *) alloca (count * sizeof (int));
- extern int errno;
-
- /* Fill start and end extra bytes of buffer with existing memory data. */
-
- buffer[0] = ptrace (1, inferior_pid, addr, 0);
-
- if (count > 1)
- {
- buffer[count - 1]
- = ptrace (1, inferior_pid,
- addr + (count - 1) * sizeof (int), 0);
- }
-
- /* Copy data to be written over corresponding part of buffer */
-
- bcopy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
-
- /* Write the entire buffer. */
-
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- errno = 0;
- ptrace (4, inferior_pid, addr, buffer[i]);
- if (errno)
- return errno;
- }
-
- return 0;
-}
-
-void
-try_writing_regs_command ()
-{
- register int i;
- register int value;
- extern int errno;
-
- if (inferior_pid == 0)
- error ("There is no inferior process now.");
-
- fetch_inferior_registers();
- for (i = 0;i<18 ; i ++)
- {
- QUIT;
- errno = 0;
- value = read_register(i);
- write_register ( i, value);
- if (errno == 0)
- {
- printf (" Succeeded with register %d; value 0x%x (%d).\n",
- i, value, value);
- }
- else
- printf (" Failed with register %d.\n", i);
- }
-}
-
-void
-initialize ()
-{
-
- inferior_pid = 0;
-
-
-}
-
-
-/* Return the contents of register REGNO,
- regarding it as an integer. */
-
-CORE_ADDR
-read_register (regno)
- int regno;
-{
- /* This loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
- return *(int *) &registers[REGISTER_BYTE (regno)];
-}
-
-/* Store VALUE in the register number REGNO, regarded as an integer. */
-
-void
-write_register (regno, val)
- int regno, val;
-{
- /* This loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
- *(int *) &registers[REGISTER_BYTE (regno)] = val;
-
- if (have_inferior_p ())
- store_inferior_registers (regno);
-}
-
-
-int
-have_inferior_p ()
-{
- return inferior_pid != 0;
-}
-
-print_some_registers(regs)
-int regs[];
-{
- register int i;
- for (i = 0; i < 18; i++) {
- printf("reg[%d] = %x\n", i, regs[i]);
- }
-}
-
-SHAR_EOF
-cat << \SHAR_EOF > remote_server.c
-/* Main code for remote server for GDB, the GNU Debugger.
- Copyright (C) 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "param.h"
-#include <stdio.h>
-
-void read_inferior_memory(), fetch_inferior_registers();
-unsigned char resume();
-void kill_inferior();
-void initialize(), try_writing_regs_command();
-int create_inferior(), read_register();
-
-extern char registers[];
-int inferior_pid;
-extern char **environ;
-
-/* Descriptor for I/O to remote machine. */
-int remote_desc;
-int kiodebug = 0;
-int remote_debugging;
-
-void remote_send ();
-void putpkt ();
-void getpkt ();
-void remote_open();
-void write_ok();
-void write_enn();
-void convert_ascii_to_int();
-void convert_int_to_ascii();
-void prepare_resume_reply();
-void decode_m_packet();
-void decode_M_packet();
-
-
-main(argc,argv)
-int argc; char *argv[];
-{
- char ch,status, own_buf[2000], mem_buf[2000];
- int i=0;
- unsigned char signal;
- unsigned int mem_addr, len;
-
- initialize();
- printf("\nwill open serial link\n");
- remote_open("/dev/ttya",0);
-
- if(argc < 2)
- {
- printf("Enter name of program to be run with command line args\n");
- gets(own_buf);
- inferior_pid = create_inferior(own_buf,environ);
- printf("\nProcess %s created; pid = %d\n",own_buf,inferior_pid);
- }
- else
- {
- inferior_pid = create_inferior(argv[1],environ);
- printf("\nProcess %s created; pid = %d\n",argv[1],inferior_pid);
- }
-
- do {
- getpkt(own_buf);
- printf("\nPacket received is>:%s\n",own_buf);
- i = 0;
- ch = own_buf[i++];
- switch (ch) {
- case 'h': /**********This is only for tweaking the gdb+ program *******/
- signal = resume(1,0,&status);
- prepare_resume_reply(own_buf,status,signal);
- break;
- /*************end tweak*************************************/
-
- case 'g': fetch_inferior_registers();
- convert_int_to_ascii(registers,own_buf,REGISTER_BYTES);
- break;
- case 'G': convert_ascii_to_int(&own_buf[1],registers,REGISTER_BYTES);
- if(store_inferior_registers(-1)==0)
- write_ok(own_buf);
- else
- write_enn(own_buf);
- break;
- case 'm': decode_m_packet(&own_buf[1],&mem_addr,&len);
- read_inferior_memory(mem_addr,mem_buf,len);
- convert_int_to_ascii(mem_buf,own_buf,len);
- break;
- case 'M': decode_M_packet(&own_buf[1],&mem_addr,&len,mem_buf);
- if(write_inferior_memory(mem_addr,mem_buf,len)==0)
- write_ok(own_buf);
- else
- write_enn(own_buf);
- break;
- case 'c': signal = resume(0,0,&status);
- printf("\nSignal received is >: %0x \n",signal);
- prepare_resume_reply(own_buf,status,signal);
- break;
- case 's': signal = resume(1,0,&status);
- prepare_resume_reply(own_buf,status,signal);
- break;
- case 'k': kill_inferior();
- sprintf(own_buf,"q");
- putpkt(own_buf);
- printf("\nObtained kill request...terminating\n");
- close(remote_desc);
- exit(0);
- case 't': try_writing_regs_command();
- own_buf[0] = '\0';
- break;
- default : printf("\nUnknown option chosen by master\n");
- write_enn(own_buf);
- break;
- }
-
- putpkt(own_buf);
- } while(1) ;
-
- close(remote_desc);
- /** now get out of here**/
- printf("\nFinished reading data from serial link - Bye!\n");
- exit(0);
-
-}
-
-SHAR_EOF
-cat << \SHAR_EOF > remote_utils.c
-/* Remote utility routines for the remote server for GDB, the GNU debugger.
- Copyright (C) 1986, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "param.h"
-#include <stdio.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <a.out.h>
-#include <sys/file.h>
-#include <sgtty.h>
-
-extern int remote_desc;
-extern int remote_debugging;
-extern int kiodebug;
-
-void remote_open();
-void remote_send();
-void putpkt();
-void getpkt();
-
-void write_ok();
-void write_enn();
-void convert_ascii_to_int();
-void convert_int_to_ascii();
-void prepare_resume_reply();
-
-/* Open a connection to a remote debugger.
- NAME is the filename used for communication. */
-
-void
-remote_open (name, from_tty)
- char *name;
- int from_tty;
-{
- struct sgttyb sg;
-
- remote_debugging = 0;
-
- remote_desc = open (name, O_RDWR);
- if (remote_desc < 0)
- printf("\ncould not open remote device\n");
-
- ioctl (remote_desc, TIOCGETP, &sg);
- sg.sg_flags = RAW;
- ioctl (remote_desc, TIOCSETP, &sg);
-
- if (from_tty)
- printf ("Remote debugging using %s\n", name);
- remote_debugging = 1;
-}
-
-/* Convert hex digit A to a number. */
-
-static int
-fromhex (a)
- int a;
-{
- if (a >= '0' && a <= '9')
- return a - '0';
- else if (a >= 'a' && a <= 'f')
- return a - 'a' + 10;
- else
- perror ("Reply contains invalid hex digit");
-}
-
-/* Convert number NIB to a hex digit. */
-
-static int
-tohex (nib)
- int nib;
-{
- if (nib < 10)
- return '0'+nib;
- else
- return 'a'+nib-10;
-}
-
-/* Send the command in BUF to the remote machine,
- and read the reply into BUF.
- Report an error if we get an error reply. */
-
-void
-remote_send (buf)
- char *buf;
-{
- putpkt (buf);
- getpkt (buf);
-
- if (buf[0] == 'E')
- perror ("Remote failure reply: %s", buf);
-}
-
-/* Send a packet to the remote machine, with error checking.
- The data of the packet is in BUF. */
-
-void
-putpkt (buf)
- char *buf;
-{
- int i;
- unsigned char csum = 0;
- char buf2[500];
- char buf3[1];
- int cnt = strlen (buf);
- char *p;
-
- if (kiodebug)
- fprintf (stderr, "Sending packet: %s\n", buf);
-
- /* Copy the packet into buffer BUF2, encapsulating it
- and giving it a checksum. */
-
- p = buf2;
- *p++ = '$';
-
- for (i = 0; i < cnt; i++)
- {
- csum += buf[i];
- *p++ = buf[i];
- }
- *p++ = '#';
- *p++ = tohex ((csum >> 4) & 0xf);
- *p++ = tohex (csum & 0xf);
-
- /* Send it over and over until we get a positive ack. */
-
- do {
- write (remote_desc, buf2, p - buf2);
- read (remote_desc, buf3, 1);
- } while (buf3[0] != '+');
-}
-
-static int
-readchar ()
-{
- char buf[1];
- while (read (remote_desc, buf, 1) != 1) ;
- return buf[0] & 0x7f;
-}
-
-/* Read a packet from the remote machine, with error checking,
- and store it in BUF. */
-
-void
-getpkt (buf)
- char *buf;
-{
- char *bp;
- unsigned char csum, c, c1, c2;
- extern kiodebug;
-
- while (1)
- {
- csum = 0;
- while ((c = readchar()) != '$');
-
- bp = buf;
- while (1)
- {
- c = readchar ();
- if (c == '#')
- break;
- *bp++ = c;
- csum += c;
- }
- *bp = 0;
-
- c1 = fromhex (readchar ());
- c2 = fromhex (readchar ());
- if (csum == (c1 << 4) + c2)
- break;
-
- printf ("Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n",
- (c1 << 4) + c2, csum, buf);
- write (remote_desc, "-", 1);
- }
-
- write (remote_desc, "+", 1);
-
- if (kiodebug)
- fprintf (stderr,"Packet received :%s\n", buf);
-}
-
-
-void
-write_ok(buf)
- char *buf;
-{
- buf[0] = 'O';
- buf[1] = 'k';
- buf[2] = '\0';
-}
-
-void
-write_enn(buf)
- char *buf;
-{
- buf[0] = 'E';
- buf[1] = 'N';
- buf[2] = 'N';
- buf[3] = '\0';
-}
-
-void
-convert_int_to_ascii(from,to,n)
-char *from, *to; int n;
-{
- int nib ;
- char ch;
- while( n-- )
- {
- ch = *from++;
- nib = ((ch & 0xf0) >> 4)& 0x0f;
- *to++ = tohex(nib);
- nib = ch & 0x0f;
- *to++ = tohex(nib);
- }
- *to++ = 0;
-}
-
-
-void
-convert_ascii_to_int(from,to,n)
-char *from, *to; int n;
-{
- int nib1,nib2 ;
- while( n-- )
- {
- nib1 = fromhex(*from++);
- nib2 = fromhex(*from++);
- *to++ = (((nib1 & 0x0f)<< 4)& 0xf0) | (nib2 & 0x0f);
- }
-}
-
-void
-prepare_resume_reply(buf,status,signal)
-char *buf ,status;
-unsigned char signal;
-{
- int nib;
- char ch;
-
- *buf++ = 'S';
- *buf++ = status;
- nib = ((signal & 0xf0) >> 4) ;
- *buf++ = tohex(nib);
- nib = signal & 0x0f;
- *buf++ = tohex(nib);
- *buf++ = 0;
-}
-
-void
-decode_m_packet(from,mem_addr_ptr,len_ptr)
-char *from;
-unsigned int *mem_addr_ptr, *len_ptr;
-{
- int i = 0, j = 0 ;
- char ch;
- *mem_addr_ptr = *len_ptr = 0;
- /************debugging begin************/
- printf("\nIn decode_m_packet");
- /************debugging end************/
-
- while((ch = from[i++]) != ',')
- {
- *mem_addr_ptr = *mem_addr_ptr << 4;
- *mem_addr_ptr |= fromhex(ch) & 0x0f;
- }
- /************debugging begin************/
- printf("\nFinished mem_addr part");
- /************debugging end************/
-
- for(j=0; j < 4; j++)
- {
- if((ch = from[i++]) == 0)
- break;
- *len_ptr = *len_ptr << 4;
- *len_ptr |= fromhex(ch) & 0x0f;
- }
- /************debugging begin************/
- printf("\nFinished len_ptr part");
- /************debugging end************/
-}
-
-void
-decode_M_packet(from,mem_addr_ptr,len_ptr,to)
-char *from, *to;
-unsigned int *mem_addr_ptr, *len_ptr;
-{
- int i = 0, j = 0 ;
- char ch;
- *mem_addr_ptr = *len_ptr = 0;
- /************debugging begin************/
- printf("\nIn decode_M_packet");
- /************debugging end************/
-
- while((ch = from[i++]) != ',')
- {
- *mem_addr_ptr = *mem_addr_ptr << 4;
- *mem_addr_ptr |= fromhex(ch) & 0x0f;
- }
- /************debugging begin************/
- printf("\nFinished mem_addr part: memaddr = %x",*mem_addr_ptr);
- /************debugging end************/
-
- while((ch = from[i++]) != ':')
- {
- *len_ptr = *len_ptr << 4;
- *len_ptr |= fromhex(ch) & 0x0f;
- }
- /************debugging begin************/
- printf("\nFinished len_ptr part: len = %d",*len_ptr);
- /************debugging end************/
-
- convert_ascii_to_int(&from[i++],to,*len_ptr);
-
- /************debugging begin************/
- printf("\nmembuf : %x",*(int *)to);
- /************debugging end************/
-}
-
-SHAR_EOF
-# End of shell archive
-exit 0
diff --git a/gdb/remote-adapt.c b/gdb/remote-adapt.c
deleted file mode 100644
index 6c22422..0000000
--- a/gdb/remote-adapt.c
+++ /dev/null
@@ -1,1448 +0,0 @@
-/* Remote debugging interface for AMD 290*0 Adapt Monitor Version 2.1d18.
- Copyright 1990, 1991 Free Software Foundation, Inc.
- Contributed by David Wood at New York University (wood@lab.ultra.nyu.edu).
- Adapted from work done at Cygnus Support in remote-eb.c.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This is like remote.c but is for an esoteric situation--
- having a 29k board attached to an Adapt inline monitor.
- The monitor is connected via serial line to a unix machine
- running gdb.
-
- 3/91 - developed on Sun3 OS 4.1, by David Wood
- o - I can't get binary coff to load.
- o - I can't get 19200 baud rate to work.
- 7/91 o - Freeze mode tracing can be done on a 29050. */
-
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "tm.h"
-#include "param-no-tm.h"
-#include "inferior.h"
-#include "wait.h"
-#include "value.h"
-#include <ctype.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <errno.h>
-#include "terminal.h"
-#include "target.h"
-#include "gdbcore.h"
-
-/* External data declarations */
-extern int stop_soon_quietly; /* for wait_for_inferior */
-
-/* External function declarations */
-extern struct value *call_function_by_hand();
-
-/* Forward data declarations */
-extern struct target_ops adapt_ops; /* Forward declaration */
-
-/* Forward function declarations */
-static void adapt_fetch_registers ();
-static int adapt_store_registers ();
-static void adapt_close ();
-static int adapt_clear_breakpoints();
-
-/*
- * Processor types. It is assumed that the adapt has the correct
- * ROM for the given processor.
- */
-#define TYPE_UNKNOWN 0
-#define TYPE_A29000 1
-#define TYPE_A29030 2
-#define TYPE_A29050 3
-static char *processor_name[] = { "Unknown", "A29000", "A29030", "A29050" };
-static int processor_type=TYPE_UNKNOWN;
-
-#define FREEZE_MODE (read_register(CPS_REGNUM) && 0x400)
-#define USE_SHADOW_PC ((processor_type == TYPE_A29050) && FREEZE_MODE)
-
-
-/* #define DEBUG /* */
-#ifdef DEBUG
-# define DENTER(NAME) (printf_filtered("Entering %s\n",NAME), fflush(stdout))
-# define DEXIT(NAME) (printf_filtered("Exiting %s\n",NAME), fflush(stdout))
-#else
-# define DENTER(NAME)
-# define DEXIT(NAME)
-#endif
-
-/* Can't seem to get binary coff working */
-#define ASCII_COFF /* Adapt will be downloaded with ascii coff */
-
-#define LOG_FILE "adapt.log"
-#if defined (LOG_FILE)
-FILE *log_file=NULL;
-#endif
-
-static int timeout = 5;
-static char *dev_name;
-
-/* Descriptor for I/O to remote machine. Initialize it to -1 so that
- adapt_open knows that we don't have a file open when the program
- starts. */
-int adapt_desc = -1;
-
-/* stream which is fdopen'd from adapt_desc. Only valid when
- adapt_desc != -1. */
-FILE *adapt_stream;
-
-#define ON 1
-#define OFF 0
-static void
-rawmode(desc, turnon)
-int desc;
-int turnon;
-{
- TERMINAL sg;
-
- if (desc < 0)
- return;
-
- ioctl (desc, TIOCGETP, &sg);
-
- if (turnon) {
-#ifdef HAVE_TERMIO
- sg.c_lflag &= ~(ICANON);
-#else
- sg.sg_flags |= RAW;
-#endif
- } else {
-#ifdef HAVE_TERMIO
- sg.c_lflag |= ICANON;
-#else
- sg.sg_flags &= ~(RAW);
-#endif
- }
- ioctl (desc, TIOCSETP, &sg);
-}
-
-/* Suck up all the input from the adapt */
-slurp_input()
-{
- char buf[8];
-
-#ifdef HAVE_TERMIO
- /* termio does the timeout for us. */
- while (read (adapt_desc, buf, 8) > 0);
-#else
- alarm (timeout);
- while (read (adapt_desc, buf, 8) > 0);
- alarm (0);
-#endif
-}
-
-/* Read a character from the remote system, doing all the fancy
- timeout stuff. */
-static int
-readchar ()
-{
- char buf;
-
- buf = '\0';
-#ifdef HAVE_TERMIO
- /* termio does the timeout for us. */
- read (adapt_desc, &buf, 1);
-#else
- alarm (timeout);
- if (read (adapt_desc, &buf, 1) < 0)
- {
- if (errno == EINTR)
- error ("Timeout reading from remote system.");
- else
- perror_with_name ("remote");
- }
- alarm (0);
-#endif
-
- if (buf == '\0')
- error ("Timeout reading from remote system.");
-#if defined (LOG_FILE)
- putc (buf & 0x7f, log_file);
-#endif
- return buf & 0x7f;
-}
-
-/* Keep discarding input from the remote system, until STRING is found.
- Let the user break out immediately. */
-static void
-expect (string)
- char *string;
-{
- char *p = string;
-
- fflush(adapt_stream);
- immediate_quit = 1;
- while (1)
- {
- if (readchar() == *p)
- {
- p++;
- if (*p == '\0')
- {
- immediate_quit = 0;
- return;
- }
- }
- else
- p = string;
- }
-}
-
-/* Keep discarding input until we see the adapt prompt.
-
- The convention for dealing with the prompt is that you
- o give your command
- o *then* wait for the prompt.
-
- Thus the last thing that a procedure does with the serial line
- will be an expect_prompt(). Exception: adapt_resume does not
- wait for the prompt, because the terminal is being handed over
- to the inferior. However, the next thing which happens after that
- is a adapt_wait which does wait for the prompt.
- Note that this includes abnormal exit, e.g. error(). This is
- necessary to prevent getting into states from which we can't
- recover. */
-static void
-expect_prompt ()
-{
-#if defined (LOG_FILE)
- /* This is a convenient place to do this. The idea is to do it often
- enough that we never lose much data if we terminate abnormally. */
- fflush (log_file);
-#endif
- fflush(adapt_stream);
- expect ("\n# ");
-}
-
-/* Get a hex digit from the remote system & return its value.
- If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */
-static int
-get_hex_digit (ignore_space)
- int ignore_space;
-{
- int ch;
- while (1)
- {
- ch = readchar ();
- if (ch >= '0' && ch <= '9')
- return ch - '0';
- else if (ch >= 'A' && ch <= 'F')
- return ch - 'A' + 10;
- else if (ch >= 'a' && ch <= 'f')
- return ch - 'a' + 10;
- else if (ch == ' ' && ignore_space)
- ;
- else
- {
- expect_prompt ();
- error ("Invalid hex digit from remote system.");
- }
- }
-}
-
-/* Get a byte from adapt_desc and put it in *BYT. Accept any number
- leading spaces. */
-static void
-get_hex_byte (byt)
- char *byt;
-{
- int val;
-
- val = get_hex_digit (1) << 4;
- val |= get_hex_digit (0);
- *byt = val;
-}
-
-/* Read a 32-bit hex word from the adapt, preceded by a space */
-static long
-get_hex_word()
-{
- long val;
- int j;
-
- val = 0;
- for (j = 0; j < 8; j++)
- val = (val << 4) + get_hex_digit (j == 0);
- return val;
-}
-/* Get N 32-bit hex words from remote, each preceded by a space
- and put them in registers starting at REGNO. */
-static void
-get_hex_regs (n, regno)
- int n;
- int regno;
-{
- long val;
- while (n--) {
- val = get_hex_word();
- supply_register(regno++,&val);
- }
-}
-/* Called when SIGALRM signal sent due to alarm() timeout. */
-#ifndef HAVE_TERMIO
-
-#ifndef __STDC__
-# ifndef volatile
-# define volatile /**/
-# endif
-#endif
-volatile int n_alarms;
-
-void
-adapt_timer ()
-{
-#if 0
- if (kiodebug)
- printf ("adapt_timer called\n");
-#endif
- n_alarms++;
-}
-#endif
-
-/* malloc'd name of the program on the remote system. */
-static char *prog_name = NULL;
-
-/* Number of SIGTRAPs we need to simulate. That is, the next
- NEED_ARTIFICIAL_TRAP calls to adapt_wait should just return
- SIGTRAP without actually waiting for anything. */
-
-static int need_artificial_trap = 0;
-
-void
-adapt_kill(arg,from_tty)
-char *arg;
-int from_tty;
-{
- DENTER("adapt_kill()");
- fprintf (adapt_stream, "K");
- fprintf (adapt_stream, "\r");
- expect_prompt ();
- DEXIT("adapt_kill()");
-}
-/*
- * Download a file specified in 'args', to the adapt.
- * FIXME: Assumes the file to download is a binary coff file.
- */
-static void
-adapt_load(args,fromtty)
-char *args;
-int fromtty;
-{
- FILE *fp;
- int n;
- char buffer[1024];
-
- DENTER("adapt_load()");
- if (!adapt_stream) {
- printf_filtered("Adapt not open. Use 'target' command to open adapt\n");
- return;
- }
-
- /* OK, now read in the file. Y=read, C=COFF, T=dTe port
- 0=start address. */
-
-#ifdef ASCII_COFF /* Ascii coff */
- fprintf (adapt_stream, "YA T,0\r");
- fflush(adapt_stream); /* Just in case */
- /* FIXME: should check args for only 1 argument */
- sprintf(buffer,"cat %s | btoa > /tmp/#adapt-btoa",args);
- system(buffer);
- fp = fopen("/tmp/#adapt-btoa","r");
- rawmode(adapt_desc,OFF);
- while (n=fread(buffer,1,1024,fp)) {
- do { n -= write(adapt_desc,buffer,n); } while (n>0);
- if (n<0) { perror("writing ascii coff"); break; }
- }
- fclose(fp);
- rawmode(adapt_desc,ON);
- system("rm /tmp/#adapt-btoa");
-#else /* Binary coff - can't get it to work .*/
- fprintf (adapt_stream, "YC T,0\r");
- fflush(adapt_stream); /* Just in case */
- if (!(fp = fopen(args,"r"))) {
- printf_filtered("Can't open %s\n",args);
- return;
- }
- while (n=fread(buffer,1,512,fp)) {
- do { n -= write(adapt_desc,buffer,n); } while (n>0);
- if (n<0) { perror("writing ascii coff"); break; }
- }
- fclose(fp);
-#endif
- expect_prompt (); /* Skip garbage that comes out */
- fprintf (adapt_stream, "\r");
- expect_prompt ();
- DEXIT("adapt_load()");
-}
-
-/* This is called not only when we first attach, but also when the
- user types "run" after having attached. */
-void
-adapt_create_inferior (execfile, args, env)
- char *execfile;
- char *args;
- char **env;
-{
- int entry_pt;
-
- DENTER("adapt_create_inferior()");
-
- if (args && *args)
- error ("Can't pass arguments to remote adapt process.");
-
- if (execfile == 0 || exec_bfd == 0)
- error ("No exec file specified");
-
- entry_pt = (int) bfd_get_start_address (exec_bfd);
-
- if (adapt_stream) {
- adapt_kill(NULL,NULL);
- adapt_clear_breakpoints();
- init_wait_for_inferior ();
- /* Clear the input because what the adapt sends back is different
- * depending on whether it was running or not.
- */
- slurp_input(); /* After this there should be a prompt */
- fprintf(adapt_stream,"\r");
- expect_prompt();
- printf_filtered("Do you want to download '%s' (y/n)? [y] : ",prog_name);
- {
- char buffer[10];
- gets(buffer);
- if (*buffer != 'n') {
- adapt_load(prog_name,0);
- }
- }
-
-#ifdef NOTDEF
- /* Set the PC and wait for a go/cont */
- fprintf (adapt_stream, "G %x,N\r",entry_pt);
- printf_filtered("Now use the 'continue' command to start.\n");
- expect_prompt ();
-#else
- insert_breakpoints (); /* Needed to get correct instruction in cache */
- proceed(entry_pt, -1, 0);
-#endif
-
- } else {
- printf_filtered("Adapt not open yet.\n");
- }
- DEXIT("adapt_create_inferior()");
-}
-
-/* Translate baud rates from integers to damn B_codes. Unix should
- have outgrown this crap years ago, but even POSIX wouldn't buck it. */
-
-#ifndef B19200
-#define B19200 EXTA
-#endif
-#ifndef B38400
-#define B38400 EXTB
-#endif
-
-static struct {int rate, damn_b;} baudtab[] = {
- {0, B0},
- {50, B50},
- {75, B75},
- {110, B110},
- {134, B134},
- {150, B150},
- {200, B200},
- {300, B300},
- {600, B600},
- {1200, B1200},
- {1800, B1800},
- {2400, B2400},
- {4800, B4800},
- {9600, B9600},
- {19200, B19200},
- {38400, B38400},
- {-1, -1},
-};
-
-static int damn_b (rate)
- int rate;
-{
- int i;
-
- for (i = 0; baudtab[i].rate != -1; i++)
- if (rate == baudtab[i].rate) return baudtab[i].damn_b;
- return B38400; /* Random */
-}
-
-
-/* Open a connection to a remote debugger.
- NAME is the filename used for communication, then a space,
- then the baud rate.
- */
-
-static int baudrate = 9600;
-static void
-adapt_open (name, from_tty)
- char *name;
- int from_tty;
-{
- TERMINAL sg;
- unsigned int prl;
- char *p;
-
- DENTER("adapt_open()");
- /* Find the first whitespace character, it separates dev_name from
- prog_name. */
- if (name == 0)
- goto erroid;
-
- for (p = name;
- *p != '\0' && !isspace (*p); p++)
- ;
- if (*p == '\0')
-erroid:
- error ("\
-Please include the name of the device for the serial port,\n\
-the baud rate, and the name of the program to run on the remote system.");
- dev_name = (char*)malloc(p - name + 1);
- strncpy (dev_name, name, p - name);
- dev_name[p - name] = '\0';
-
- /* Skip over the whitespace after dev_name */
- for (; isspace (*p); p++)
- /*EMPTY*/;
-
- if (1 != sscanf (p, "%d ", &baudrate))
- goto erroid;
-
- /* Skip the number and then the spaces */
- for (; isdigit (*p); p++)
- /*EMPTY*/;
- for (; isspace (*p); p++)
- /*EMPTY*/;
-
- if (prog_name != NULL)
- free (prog_name);
- prog_name = savestring (p, strlen (p));
-
- adapt_close (0);
-
- adapt_desc = open (dev_name, O_RDWR);
- if (adapt_desc < 0)
- perror_with_name (dev_name);
- ioctl (adapt_desc, TIOCGETP, &sg);
-#ifdef HAVE_TERMIO
- sg.c_cc[VMIN] = 0; /* read with timeout. */
- sg.c_cc[VTIME] = timeout * 10;
- sg.c_lflag &= ~(ICANON | ECHO);
- sg.c_cflag = (sg.c_cflag & ~CBAUD) | damn_b (baudrate);
-#else
- sg.sg_ispeed = damn_b (baudrate);
- sg.sg_ospeed = damn_b (baudrate);
- sg.sg_flags |= RAW | ANYP;
- sg.sg_flags &= ~ECHO;
-#endif
-
- ioctl (adapt_desc, TIOCSETP, &sg);
- adapt_stream = fdopen (adapt_desc, "r+");
-
- push_target (&adapt_ops);
- /* start_remote (); /* Initialize gdb process mechanisms */
-
-
-#ifndef HAVE_TERMIO
-#ifndef NO_SIGINTERRUPT
- /* Cause SIGALRM's to make reads fail with EINTR instead of resuming
- the read. */
- if (siginterrupt (SIGALRM, 1) != 0)
- perror ("adapt_open: error in siginterrupt");
-#endif
-
- /* Set up read timeout timer. */
- if ((void (*)) signal (SIGALRM, adapt_timer) == (void (*)) -1)
- perror ("adapt_open: error in signal");
-#endif
-
-#if defined (LOG_FILE)
- log_file = fopen (LOG_FILE, "w");
- if (log_file == NULL)
- perror_with_name (LOG_FILE);
-#endif
-
- /* Put this port into NORMAL mode, send the 'normal' character */
- write(adapt_desc, "", 1); /* Control A */
- write(adapt_desc, "\r", 1);
- expect_prompt ();
-
- /* Hello? Are you there? */
- write (adapt_desc, "\r", 1);
-
- expect_prompt ();
-
- /* Clear any break points */
- adapt_clear_breakpoints();
-
- /* Determine the processor revision level */
- prl = (unsigned int)read_register(CFG_REGNUM) >> 24;
- if (prl == 0x03) {
- processor_type = TYPE_A29000;
- } else if ((prl&0xf0) == 0x40) { /* 29030 = 0x4* */
- processor_type = TYPE_A29030;
- fprintf_filtered(stderr,"WARNING: debugging of A29030 not tested.\n");
- } else if ((prl&0xf0) == 0x20) { /* 29050 = 0x2* */
- processor_type = TYPE_A29050;
- fprintf_filtered(stderr,"WARNING: debugging of A29050 not tested.\n");
- } else {
- processor_type = TYPE_UNKNOWN;
- fprintf_filtered(stderr,"WARNING: processor type unknown.\n");
- }
-
- /* Print out some stuff, letting the user now what's going on */
- printf_filtered("Remote debugging on an %s connect to an Adapt via %s.\n",
- processor_name[processor_type],dev_name);
- /* FIXME: can this restriction be removed? */
- printf_filtered("Remote debugging using virtual addresses works only\n");
- printf_filtered("\twhen virtual addresses map 1:1 to physical addresses.\n");
- if (processor_type != TYPE_A29050) {
- fprintf_filtered(stderr,
- "Freeze-mode debugging not available, and can only be done on an A29050.\n");
- }
- DEXIT("adapt_open()");
-}
-
-/* Close out all files and local state before this target loses control. */
-
-static void
-adapt_close (quitting)
- int quitting;
-{
-
- DENTER("adapt_close()");
-
- /* Clear any break points */
- adapt_clear_breakpoints();
-
- /* Put this port back into REMOTE mode */
- if (adapt_stream) {
- fflush(adapt_stream);
- sleep(1); /* Let any output make it all the way back */
- write(adapt_desc, "R\r", 2);
- }
-
- /* Due to a bug in Unix, fclose closes not only the stdio stream,
- but also the file descriptor. So we don't actually close
- adapt_desc. */
- if (adapt_stream)
- fclose (adapt_stream); /* This also closes adapt_desc */
- if (adapt_desc >= 0)
- /* close (adapt_desc); */
-
- /* Do not try to close adapt_desc again, later in the program. */
- adapt_stream = NULL;
- adapt_desc = -1;
-
-#if defined (LOG_FILE)
- if (log_file) {
- if (ferror (log_file))
- printf_filtered ("Error writing log file.\n");
- if (fclose (log_file) != 0)
- printf_filtered ("Error closing log file.\n");
- log_file = NULL;
- }
-#endif
- DEXIT("adapt_close()");
-}
-
-/* Attach to the target that is already loaded and possibly running */
-static void
-adapt_attach (args, from_tty)
- char *args;
- int from_tty;
-{
-
- DENTER("adapt_attach()");
- if (from_tty)
- printf_filtered ("Attaching to remote program %s.\n", prog_name);
-
- /* push_target(&adapt_ops); /* This done in adapt_open() */
-
- mark_breakpoints_out ();
-
- /* Send the adapt a kill. It is ok if it is not already running */
- fprintf(adapt_stream, "K\r"); fflush(adapt_stream);
- expect_prompt(); /* Slurp the echo */
-
- /* We will get a task spawn event immediately. */
- init_wait_for_inferior ();
- clear_proceed_status ();
- stop_soon_quietly = 1;
- wait_for_inferior ();
- stop_soon_quietly = 0;
- normal_stop ();
- DEXIT("adapt_attach()");
-}
-
-
-/* Terminate the open connection to the remote debugger.
- Use this when you want to detach and do something else
- with your gdb. */
-void
-adapt_detach (args,from_tty)
- char *args;
- int from_tty;
-{
- DENTER("adapt_detach()");
- if (adapt_stream) { /* Send it on its way (tell it to continue) */
- adapt_clear_breakpoints();
- fprintf(adapt_stream,"G\r");
- }
-
- pop_target(); /* calls adapt_close to do the real work */
- if (from_tty)
- printf_filtered ("Ending remote %s debugging\n", target_shortname);
- DEXIT("adapt_detach()");
-}
-
-/* Tell the remote machine to resume. */
-
-void
-adapt_resume (step, sig)
- int step, sig;
-{
- DENTER("adapt_resume()");
- if (step)
- {
- write (adapt_desc, "t 1,s\r", 6);
- /* Wait for the echo. */
- expect ("t 1,s\r\n");
- /* Then comes a line containing the instruction we stepped to. */
- expect ("@");
- /* Then we get the prompt. */
- expect_prompt ();
-
- /* Force the next adapt_wait to return a trap. Not doing anything
- about I/O from the target means that the user has to type
- "continue" to see any. FIXME, this should be fixed. */
- need_artificial_trap = 1;
- }
- else
- {
- write (adapt_desc, "G\r", 2);
- /* Swallow the echo. */
- expect_prompt();
- }
- DEXIT("adapt_resume()");
-}
-
-/* Wait until the remote machine stops, then return,
- storing status in STATUS just as `wait' would. */
-
-int
-adapt_wait (status)
- WAITTYPE *status;
-{
- /* Strings to look for. '?' means match any single character.
- Note that with the algorithm we use, the initial character
- of the string cannot recur in the string, or we will not
- find some cases of the string in the input. */
-
- static char bpt[] = "@";
- /* It would be tempting to look for "\n[__exit + 0x8]\n"
- but that requires loading symbols with "yc i" and even if
- we did do that we don't know that the file has symbols. */
- static char exitmsg[] = "@????????I JMPTI GR121,LR0";
- char *bp = bpt;
- char *ep = exitmsg;
-
- /* Large enough for either sizeof (bpt) or sizeof (exitmsg) chars. */
- char swallowed[50];
- /* Current position in swallowed. */
- char *swallowed_p = swallowed;
-
- int ch;
- int ch_handled;
- int old_timeout = timeout;
- int old_immediate_quit = immediate_quit;
-
- DENTER("adapt_wait()");
-
- WSETEXIT ((*status), 0);
-
- if (need_artificial_trap != 0)
- {
- WSETSTOP ((*status), SIGTRAP);
- need_artificial_trap--;
- return 0;
- }
-
- timeout = 0; /* Don't time out -- user program is running. */
- immediate_quit = 1; /* Helps ability to QUIT */
- while (1) {
- QUIT; /* Let user quit and leave process running */
- ch_handled = 0;
- ch = readchar ();
- if (ch == *bp) {
- bp++;
- if (*bp == '\0')
- break;
- ch_handled = 1;
-
- *swallowed_p++ = ch;
- } else
- bp = bpt;
- if (ch == *ep || *ep == '?') {
- ep++;
- if (*ep == '\0')
- break;
-
- if (!ch_handled)
- *swallowed_p++ = ch;
- ch_handled = 1;
- } else
- ep = exitmsg;
- if (!ch_handled) {
- char *p;
- /* Print out any characters which have been swallowed. */
- for (p = swallowed; p < swallowed_p; ++p)
- putc (*p, stdout);
- swallowed_p = swallowed;
- putc (ch, stdout);
- }
- }
- expect_prompt ();
- if (*bp== '\0')
- WSETSTOP ((*status), SIGTRAP);
- else
- WSETEXIT ((*status), 0);
- timeout = old_timeout;
- immediate_quit = old_immediate_quit;
- DEXIT("adapt_wait()");
- return 0;
-}
-
-/* Return the name of register number REGNO
- in the form input and output by adapt.
-
- Returns a pointer to a static buffer containing the answer. */
-static char *
-get_reg_name (regno)
- int regno;
-{
- static char buf[80];
- if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32 )
- sprintf (buf, "GR%03d", regno - GR96_REGNUM + 96);
-#if defined(GR64_REGNUM)
- else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32 )
- sprintf (buf, "GR%03d", regno - GR64_REGNUM + 64);
-#endif
- else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128)
- sprintf (buf, "LR%03d", regno - LR0_REGNUM);
- else if (regno == Q_REGNUM)
- strcpy (buf, "SR131");
- else if (regno >= BP_REGNUM && regno <= CR_REGNUM)
- sprintf (buf, "SR%03d", regno - BP_REGNUM + 133);
- else if (regno == ALU_REGNUM)
- strcpy (buf, "SR132");
- else if (regno >= IPC_REGNUM && regno <= IPB_REGNUM)
- sprintf (buf, "SR%03d", regno - IPC_REGNUM + 128);
- else if (regno >= VAB_REGNUM && regno <= LRU_REGNUM) {
- /* When a 29050 is in freeze-mode, read shadow pcs instead */
- if ((regno >= NPC_REGNUM && regno <= PC2_REGNUM) && USE_SHADOW_PC)
- sprintf (buf, "SR%03d", regno - NPC_REGNUM + 20);
- else
- sprintf (buf, "SR%03d", regno - VAB_REGNUM);
- }
- else if (regno == GR1_REGNUM)
- strcpy (buf, "GR001");
- return buf;
-}
-
-/* Read the remote registers. */
-
-static void
-adapt_fetch_registers ()
-{
- int reg_index;
- int regnum_index;
- char tempbuf[10];
- int sreg_buf[16];
- int i,j;
-
- DENTER("adapt_fetch_registers()");
-
-/*
- * Global registers
- */
-#if defined(GR64_REGNUM)
- write (adapt_desc, "dw gr64,gr95\r", 13);
- for (reg_index = 64, regnum_index = GR64_REGNUM;
- reg_index < 96;
- reg_index += 4, regnum_index += 4)
- {
- sprintf (tempbuf, "GR%03d ", reg_index);
- expect (tempbuf);
- get_hex_regs (4, regnum_index);
- expect ("\n");
- }
-#endif
- write (adapt_desc, "dw gr96,gr127\r", 14);
- for (reg_index = 96, regnum_index = GR96_REGNUM;
- reg_index < 128;
- reg_index += 4, regnum_index += 4)
- {
- sprintf (tempbuf, "GR%03d ", reg_index);
- expect (tempbuf);
- get_hex_regs (4, regnum_index);
- expect ("\n");
- }
-
-/*
- * Local registers
- */
- for (i = 0; i < 128; i += 32)
- {
- /* The PC has a tendency to hang if we get these
- all in one fell swoop ("dw lr0,lr127"). */
- sprintf (tempbuf, "dw lr%d\r", i);
- write (adapt_desc, tempbuf, strlen (tempbuf));
- for (reg_index = i, regnum_index = LR0_REGNUM + i;
- reg_index < i + 32;
- reg_index += 4, regnum_index += 4)
- {
- sprintf (tempbuf, "LR%03d ", reg_index);
- expect (tempbuf);
- get_hex_regs (4, regnum_index);
- expect ("\n");
- }
- }
-
-/*
- * Special registers
- */
- sprintf (tempbuf, "dw sr0\r");
- write (adapt_desc, tempbuf, strlen (tempbuf));
- for (i=0 ; i<4 ; i++) { /* SR0 - SR14 */
- sprintf (tempbuf, "SR%3d",i*4);
- expect(tempbuf);
- for (j=0 ; j < (i==3 ? 3 : 4) ; j++)
- sreg_buf[i*4 + j] = get_hex_word();
- }
- expect_prompt();
- /*
- * Read the pcs individually if we are in freeze mode.
- * See get_reg_name(), it translates the register names for the pcs to
- * the names of the shadow pcs.
- */
- if (USE_SHADOW_PC) {
- sreg_buf[10] = read_register(NPC_REGNUM); /* pc0 */
- sreg_buf[11] = read_register(PC_REGNUM); /* pc1 */
- sreg_buf[12] = read_register(PC2_REGNUM); /* pc2 */
- }
- for (i=0 ; i<14 ; i++) /* Supply vab -> lru */
- supply_register(VAB_REGNUM+i,&sreg_buf[i]);
- sprintf (tempbuf, "dw sr128\r");
- write (adapt_desc, tempbuf, strlen (tempbuf));
- for (i=0 ; i<2 ; i++) { /* SR128 - SR135 */
- sprintf (tempbuf, "SR%3d",128 + i*4);
- expect(tempbuf);
- for (j=0 ; j<4 ; j++)
- sreg_buf[i*4 + j] = get_hex_word();
- }
- expect_prompt();
- supply_register(IPC_REGNUM,&sreg_buf[0]);
- supply_register(IPA_REGNUM,&sreg_buf[1]);
- supply_register(IPB_REGNUM,&sreg_buf[2]);
- supply_register(Q_REGNUM, &sreg_buf[3]);
- /* Skip ALU */
- supply_register(BP_REGNUM, &sreg_buf[5]);
- supply_register(FC_REGNUM, &sreg_buf[6]);
- supply_register(CR_REGNUM, &sreg_buf[7]);
-
- /* There doesn't seem to be any way to get these. */
- {
- int val = -1;
- supply_register (FPE_REGNUM, &val);
- supply_register (INT_REGNUM, &val);
- supply_register (FPS_REGNUM, &val);
- supply_register (EXO_REGNUM, &val);
- }
-
- write (adapt_desc, "dw gr1,gr1\r", 11);
- expect ("GR001 ");
- get_hex_regs (1, GR1_REGNUM);
- expect_prompt ();
-
- DEXIT("adapt_fetch_registers()");
-}
-
-/* Fetch register REGNO, or all registers if REGNO is -1.
- */
-static void
-adapt_fetch_register (regno)
- int regno;
-{
- DENTER("adapt_fetch_register()");
- if (regno == -1)
- adapt_fetch_registers ();
- else
- {
- char *name = get_reg_name (regno);
- fprintf (adapt_stream, "dw %s,%s\r", name, name);
- expect (name);
- expect (" ");
- get_hex_regs (1, regno);
- expect_prompt ();
- }
- DEXIT("adapt_fetch_register()");
-}
-
-/* Store the remote registers from the contents of the block REGS. */
-
-static int
-adapt_store_registers ()
-{
- int i, j;
-
- DENTER("adapt_store_registers()");
- fprintf (adapt_stream, "s gr1,%x\r", read_register (GR1_REGNUM));
- expect_prompt ();
-
-#if defined(GR64_REGNUM)
- for (j = 0; j < 32; j += 16)
- {
- fprintf (adapt_stream, "s gr%d,", j + 64);
- for (i = 0; i < 15; ++i)
- fprintf (adapt_stream, "%x,", read_register (GR64_REGNUM + j + i));
- fprintf (adapt_stream, "%x\r", read_register (GR64_REGNUM + j + 15));
- expect_prompt ();
- }
-#endif
- for (j = 0; j < 32; j += 16)
- {
- fprintf (adapt_stream, "s gr%d,", j + 96);
- for (i = 0; i < 15; ++i)
- fprintf (adapt_stream, "%x,", read_register (GR96_REGNUM + j + i));
- fprintf (adapt_stream, "%x\r", read_register (GR96_REGNUM + j + 15));
- expect_prompt ();
- }
-
- for (j = 0; j < 128; j += 16)
- {
- fprintf (adapt_stream, "s lr%d,", j);
- for (i = 0; i < 15; ++i)
- fprintf (adapt_stream, "%x,", read_register (LR0_REGNUM + j + i));
- fprintf (adapt_stream, "%x\r", read_register (LR0_REGNUM + j + 15));
- expect_prompt ();
- }
-
- fprintf (adapt_stream, "s sr128,%x,%x,%x\r", read_register (IPC_REGNUM),
- read_register (IPA_REGNUM), read_register (IPB_REGNUM));
- expect_prompt ();
- fprintf (adapt_stream, "s sr133,%x,%x,%x\r", read_register (BP_REGNUM),
- read_register (FC_REGNUM), read_register (CR_REGNUM));
- expect_prompt ();
- fprintf (adapt_stream, "s sr131,%x\r", read_register (Q_REGNUM));
- expect_prompt ();
- fprintf (adapt_stream, "s sr0,");
- for (i=0 ; i<7 ; ++i)
- fprintf (adapt_stream, "%x,", read_register (VAB_REGNUM + i));
- expect_prompt ();
- fprintf (adapt_stream, "s sr7,");
- for (i=7; i<14 ; ++i)
- fprintf (adapt_stream, "%x,", read_register (VAB_REGNUM + i));
- expect_prompt ();
-}
-
-/* Store register REGNO, or all if REGNO == -1.
- Return errno value. */
-int
-adapt_store_register (regno)
- int regno;
-{
- /* printf("adapt_store_register() called.\n"); fflush(stdout); /* */
- if (regno == -1)
- adapt_store_registers ();
- else
- {
- char *name = get_reg_name (regno);
- fprintf (adapt_stream, "s %s,%x\r", name, read_register (regno));
- /* Setting GR1 changes the numbers of all the locals, so
- invalidate the register cache. Do this *after* calling
- read_register, because we want read_register to return the
- value that write_register has just stuffed into the registers
- array, not the value of the register fetched from the
- inferior. */
- if (regno == GR1_REGNUM)
- registers_changed ();
- expect_prompt ();
- }
- DEXIT("adapt_store_registers()");
- return 0;
-}
-
-/* Get ready to modify the registers array. On machines which store
- individual registers, this doesn't need to do anything. On machines
- which store all the registers in one fell swoop, this makes sure
- that registers contains all the registers from the program being
- debugged. */
-
-void
-adapt_prepare_to_store ()
-{
- /* Do nothing, since we can store individual regs */
-}
-
-static CORE_ADDR
-translate_addr(addr)
-CORE_ADDR addr;
-{
-#if defined(KERNEL_DEBUGGING)
- /* Check for a virtual address in the kernel */
- /* Assume physical address of ublock is in paddr_u register */
- if (addr >= UVADDR) {
- /* PADDR_U register holds the physical address of the ublock */
- CORE_ADDR i = (CORE_ADDR)read_register(PADDR_U_REGNUM);
- return(i + addr - (CORE_ADDR)UVADDR);
- } else {
- return(addr);
- }
-#else
- return(addr);
-#endif
-}
-
-
-/* FIXME! Merge these two. */
-int
-adapt_xfer_inferior_memory (memaddr, myaddr, len, write)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
-{
-
- memaddr = translate_addr(memaddr);
-
- if (write)
- return adapt_write_inferior_memory (memaddr, myaddr, len);
- else
- return adapt_read_inferior_memory (memaddr, myaddr, len);
-}
-
-void
-adapt_files_info ()
-{
- printf_filtered("\tAttached to %s at %d baud and running program %s\n",
- dev_name, baudrate, prog_name);
- printf_filtered("\ton an %s processor.\n", processor_name[processor_type]);
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR. Returns errno value.
- * sb/sh instructions don't work on unaligned addresses, when TU=1.
- */
-int
-adapt_write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int i;
- unsigned int cps;
-
- /* DENTER("adapt_write_inferior_memory()"); */
-
-/* Turn TU bit off so we can do 'sb' commands */
- cps = read_register(CPS_REGNUM);
- if (cps & 0x00000800)
- write_register(CPS_REGNUM,cps&~(0x00000800));
-
- for (i = 0; i < len; i++)
- {
- if ((i % 16) == 0)
- fprintf (adapt_stream, "sb %x,", memaddr + i);
- if ((i % 16) == 15 || i == len - 1)
- {
- fprintf (adapt_stream, "%x\r", ((unsigned char *)myaddr)[i]);
- expect_prompt ();
- }
- else
- fprintf (adapt_stream, "%x,", ((unsigned char *)myaddr)[i]);
- }
- /* Restore the old value of cps if the TU bit was on */
- if (cps & 0x00000800)
- write_register(CPS_REGNUM,cps);
- /* DEXIT("adapt_write_inferior_memory()"); */
- return len;
-}
-
-/* Read LEN bytes from inferior memory at MEMADDR. Put the result
- at debugger address MYADDR. Returns errno value. */
-int
-adapt_read_inferior_memory(memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int i;
-
- /* Number of bytes read so far. */
- int count;
-
- /* Starting address of this pass. */
- unsigned long startaddr;
-
- /* Number of bytes to read in this pass. */
- int len_this_pass;
-
- /* Note that this code works correctly if startaddr is just less
- than UINT_MAX (well, really CORE_ADDR_MAX if there was such a
- thing). That is, something like
- adapt_read_bytes (CORE_ADDR_MAX - 4, foo, 4)
- works--it never adds len to memaddr and gets 0. */
- /* However, something like
- adapt_read_bytes (CORE_ADDR_MAX - 3, foo, 4)
- doesn't need to work. Detect it and give up if there's an attempt
- to do that. */
- /* DENTER("adapt_read_inferior_memory()"); */
-
- if (((memaddr - 1) + len) < memaddr)
- return EIO;
-
- startaddr = memaddr;
- count = 0;
- while (count < len)
- {
- len_this_pass = 16;
- if ((startaddr % 16) != 0)
- len_this_pass -= startaddr % 16;
- if (len_this_pass > (len - count))
- len_this_pass = (len - count);
-
- fprintf (adapt_stream, "db %x,%x\r", startaddr,
- (startaddr - 1) + len_this_pass);
-
-#ifdef NOTDEF /* Why do this */
- expect ("\n");
- /* Look for 8 hex digits. */
- i = 0;
- while (1)
- {
- if (isxdigit (readchar ()))
- ++i;
- else
- {
- expect_prompt ();
- error ("Hex digit expected from remote system.");
- }
- if (i >= 8)
- break;
- }
-#endif /* NOTDEF */
-
- expect (" ");
-
- for (i = 0; i < len_this_pass; i++)
- get_hex_byte (&myaddr[count++]);
-
- expect_prompt ();
-
- startaddr += len_this_pass;
- }
-
- /* DEXIT("adapt_read_inferior_memory()"); */
- return count;
-}
-
-#define MAX_BREAKS 8
-static int num_brkpts=0;
-static int
-adapt_insert_breakpoint(addr, save)
-CORE_ADDR addr;
-char *save; /* Throw away, let adapt save instructions */
-{
- DENTER("adapt_insert_breakpoint()");
- if (num_brkpts < MAX_BREAKS) {
- num_brkpts++;
- fprintf (adapt_stream, "B %x", addr);
- fprintf (adapt_stream, "\r");
- expect_prompt ();
- DEXIT("adapt_insert_breakpoint() success");
- return(0); /* Success */
- } else {
- fprintf_filtered(stderr,
- "Too many break points, break point not installed\n");
- DEXIT("adapt_insert_breakpoint() failure");
- return(1); /* Failure */
- }
-
-}
-static int
-adapt_remove_breakpoint(addr, save)
-CORE_ADDR addr;
-char *save; /* Throw away, let adapt save instructions */
-{
- DENTER("adapt_remove_breakpoint()");
- if (num_brkpts > 0) {
- num_brkpts--;
- fprintf (adapt_stream, "BR %x", addr);
- fprintf (adapt_stream, "\r");
- fflush (adapt_stream);
- expect_prompt ();
- }
- DEXIT("adapt_remove_breakpoint()");
- return(0);
-}
-
-/* Clear the adapts notion of what the break points are */
-static int
-adapt_clear_breakpoints()
-{
- DENTER("adapt_clear_breakpoint()");
- if (adapt_stream) {
- fprintf (adapt_stream, "BR"); /* Clear all break points */
- fprintf (adapt_stream, "\r");
- fflush(adapt_stream);
- expect_prompt ();
- }
- num_brkpts = 0;
- DEXIT("adapt_clear_breakpoint()");
-}
-static void
-adapt_mourn()
-{
- DENTER("adapt_mourn()");
- adapt_clear_breakpoints();
- pop_target (); /* Pop back to no-child state */
- generic_mourn_inferior ();
- DEXIT("adapt_mourn()");
-}
-
-/* Display everthing we read in from the adapt until we match/see the
- * specified string
- */
-static int
-display_until(str)
-char *str;
-{
- int i=0,j,c;
-
- while (c=readchar()) {
- if (c==str[i]) {
- i++;
- if (i == strlen(str)) return;
- } else {
- if (i) {
- for (j=0 ; j<i ; j++) /* Put everthing we matched */
- putchar(str[j]);
- i=0;
- }
- putchar(c);
- }
- }
-
-}
-
-
-/* Put a command string, in args, out to the adapt. The adapt is assumed to
- be in raw mode, all writing/reading done through adapt_desc.
- Ouput from the adapt is placed on the users terminal until the
- prompt from the adapt is seen.
- FIXME: Can't handle commands that take input. */
-
-void
-adapt_com (args, fromtty)
- char *args;
- int fromtty;
-{
- if (!adapt_stream) {
- printf_filtered("Adapt not open. Use the 'target' command to open.\n");
- return;
- }
-
- /* Clear all input so only command relative output is displayed */
- slurp_input();
-
- switch(islower(args[0]) ? toupper(args[0]) : args[0]) {
- default:
- printf_filtered("Unknown/Unimplemented adapt command '%s'\n",args);
- break;
- case 'G': /* Go, begin execution */
- write(adapt_desc,args,strlen(args));
- write(adapt_desc,"\r",1);
- expect_prompt();
- break;
- case 'B': /* Break points, B or BR */
- case 'C': /* Check current 29k status (running/halted) */
- case 'D': /* Display data/registers */
- case 'I': /* Input from i/o space */
- case 'J': /* Jam an instruction */
- case 'K': /* Kill, stop execution */
- case 'L': /* Disassemble */
- case 'O': /* Output to i/o space */
- case 'T': /* Trace */
- case 'P': /* Pulse an input line */
- case 'X': /* Examine special purpose registers */
- case 'Z': /* Display trace buffer */
- write(adapt_desc,args,strlen(args));
- write(adapt_desc,"\r",1);
- expect(args); /* Don't display the command */
- display_until("# ");
- break;
- /* Begin commands that take input in the form 'c x,y[,z...]' */
- case 'S': /* Set memory or register */
- if (index(args,',')) { /* Assume it is properly formatted */
- write(adapt_desc,args,strlen(args));
- write(adapt_desc,"\r",1);
- expect_prompt();
- }
- break;
- }
-}
-
-/* Define the target subroutine names */
-
-struct target_ops adapt_ops = {
- "adapt", "Remote AMD `Adapt' target",
- "Remote debug an AMD 290*0 using an `Adapt' monitor via RS232",
- adapt_open, adapt_close,
- adapt_attach, adapt_detach, adapt_resume, adapt_wait,
- adapt_fetch_register, adapt_store_register,
- adapt_prepare_to_store, 0, 0, /* conv_to, conv_from */
- adapt_xfer_inferior_memory,
- adapt_files_info,
- adapt_insert_breakpoint, adapt_remove_breakpoint, /* Breakpoints */
- 0, 0, 0, 0, 0, /* Terminal handling */
- adapt_kill, /* FIXME, kill */
- adapt_load,
- call_function_by_hand,
- 0, /* lookup_symbol */
- adapt_create_inferior, /* create_inferior */
- adapt_mourn, /* mourn_inferior FIXME */
- process_stratum, 0, /* next */
- 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
- 0,0, /* Section pointers */
- OPS_MAGIC, /* Always the last thing */
-};
-
-void
-_initialize_remote_adapt ()
-{
- add_target (&adapt_ops);
- add_com ("adapt <command>", class_obscure, adapt_com,
- "Send a command to the AMD Adapt remote monitor.");
-}
diff --git a/gdb/remote-eb.c b/gdb/remote-eb.c
deleted file mode 100644
index 0315fe7..0000000
--- a/gdb/remote-eb.c
+++ /dev/null
@@ -1,942 +0,0 @@
-/* Remote debugging interface for AMD 29000 EBMON on IBM PC, for GDB.
- Copyright 1990-1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support. Written by Jim Kingdon for Cygnus.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This is like remote.c but is for an esoteric situation--
- having a 29k board in a PC hooked up to a unix machine with
- a serial line, and running ctty com1 on the PC, through which
- the unix machine can run ebmon. Not to mention that the PC
- has PC/NFS, so it can access the same executables that gdb can,
- over the net in real time. */
-
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "tm-29k.h"
-#include "param-no-tm.h"
-#include "inferior.h"
-#include "wait.h"
-#include "value.h"
-#include <ctype.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <errno.h>
-#include "terminal.h"
-#include "target.h"
-
-extern struct value *call_function_by_hand();
-
-extern struct target_ops eb_ops; /* Forward declaration */
-
-static void eb_close();
-
-#define LOG_FILE "eb.log"
-#if defined (LOG_FILE)
-FILE *log_file;
-#endif
-
-static int timeout = 5;
-
-/* Descriptor for I/O to remote machine. Initialize it to -1 so that
- eb_open knows that we don't have a file open when the program
- starts. */
-int eb_desc = -1;
-
-/* stream which is fdopen'd from eb_desc. Only valid when
- eb_desc != -1. */
-FILE *eb_stream;
-
-/* Read a character from the remote system, doing all the fancy
- timeout stuff. */
-static int
-readchar ()
-{
- char buf;
-
- buf = '\0';
-#ifdef HAVE_TERMIO
- /* termio does the timeout for us. */
- read (eb_desc, &buf, 1);
-#else
- alarm (timeout);
- if (read (eb_desc, &buf, 1) < 0)
- {
- if (errno == EINTR)
- error ("Timeout reading from remote system.");
- else
- perror_with_name ("remote");
- }
- alarm (0);
-#endif
-
- if (buf == '\0')
- error ("Timeout reading from remote system.");
-#if defined (LOG_FILE)
- putc (buf & 0x7f, log_file);
-#endif
- return buf & 0x7f;
-}
-
-/* Keep discarding input from the remote system, until STRING is found.
- Let the user break out immediately. */
-static void
-expect (string)
- char *string;
-{
- char *p = string;
-
- immediate_quit = 1;
- while (1)
- {
- if (readchar() == *p)
- {
- p++;
- if (*p == '\0')
- {
- immediate_quit = 0;
- return;
- }
- }
- else
- p = string;
- }
-}
-
-/* Keep discarding input until we see the ebmon prompt.
-
- The convention for dealing with the prompt is that you
- o give your command
- o *then* wait for the prompt.
-
- Thus the last thing that a procedure does with the serial line
- will be an expect_prompt(). Exception: eb_resume does not
- wait for the prompt, because the terminal is being handed over
- to the inferior. However, the next thing which happens after that
- is a eb_wait which does wait for the prompt.
- Note that this includes abnormal exit, e.g. error(). This is
- necessary to prevent getting into states from which we can't
- recover. */
-static void
-expect_prompt ()
-{
-#if defined (LOG_FILE)
- /* This is a convenient place to do this. The idea is to do it often
- enough that we never lose much data if we terminate abnormally. */
- fflush (log_file);
-#endif
- expect ("\n# ");
-}
-
-/* Get a hex digit from the remote system & return its value.
- If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */
-static int
-get_hex_digit (ignore_space)
- int ignore_space;
-{
- int ch;
- while (1)
- {
- ch = readchar ();
- if (ch >= '0' && ch <= '9')
- return ch - '0';
- else if (ch >= 'A' && ch <= 'F')
- return ch - 'A' + 10;
- else if (ch >= 'a' && ch <= 'f')
- return ch - 'a' + 10;
- else if (ch == ' ' && ignore_space)
- ;
- else
- {
- expect_prompt ();
- error ("Invalid hex digit from remote system.");
- }
- }
-}
-
-/* Get a byte from eb_desc and put it in *BYT. Accept any number
- leading spaces. */
-static void
-get_hex_byte (byt)
- char *byt;
-{
- int val;
-
- val = get_hex_digit (1) << 4;
- val |= get_hex_digit (0);
- *byt = val;
-}
-
-/* Get N 32-bit words from remote, each preceded by a space,
- and put them in registers starting at REGNO. */
-static void
-get_hex_regs (n, regno)
- int n;
- int regno;
-{
- long val;
- int i;
-
- for (i = 0; i < n; i++)
- {
- int j;
-
- val = 0;
- for (j = 0; j < 8; j++)
- val = (val << 4) + get_hex_digit (j == 0);
- supply_register (regno++, &val);
- }
-}
-
-/* Called when SIGALRM signal sent due to alarm() timeout. */
-#ifndef HAVE_TERMIO
-
-#ifndef __STDC__
-#define volatile /**/
-#endif
-volatile int n_alarms;
-
-void
-eb_timer ()
-{
-#if 0
- if (kiodebug)
- printf ("eb_timer called\n");
-#endif
- n_alarms++;
-}
-#endif
-
-/* malloc'd name of the program on the remote system. */
-static char *prog_name = NULL;
-
-/* Nonzero if we have loaded the file ("yc") and not yet issued a "gi"
- command. "gi" is supposed to happen exactly once for each "yc". */
-static int need_gi = 0;
-
-/* Number of SIGTRAPs we need to simulate. That is, the next
- NEED_ARTIFICIAL_TRAP calls to eb_wait should just return
- SIGTRAP without actually waiting for anything. */
-
-static int need_artificial_trap = 0;
-
-/* This is called not only when we first attach, but also when the
- user types "run" after having attached. */
-void
-eb_start (inferior_args)
-char *inferior_args;
-{
- /* OK, now read in the file. Y=read, C=COFF, D=no symbols
- 0=start address, %s=filename. */
-
- fprintf (eb_stream, "YC D,0:%s", prog_name);
-
- if (inferior_args != NULL)
- fprintf(eb_stream, " %s", inferior_args);
-
- fprintf (eb_stream, "\n");
- fflush (eb_stream);
-
- expect_prompt ();
-
- need_gi = 1;
-}
-
-/* Translate baud rates from integers to damn B_codes. Unix should
- have outgrown this crap years ago, but even POSIX wouldn't buck it. */
-
-#ifndef B19200
-#define B19200 EXTA
-#endif
-#ifndef B38400
-#define B38400 EXTB
-#endif
-
-struct {int rate, damn_b;} baudtab[] = {
- {0, B0},
- {50, B50},
- {75, B75},
- {110, B110},
- {134, B134},
- {150, B150},
- {200, B200},
- {300, B300},
- {600, B600},
- {1200, B1200},
- {1800, B1800},
- {2400, B2400},
- {4800, B4800},
- {9600, B9600},
- {19200, B19200},
- {38400, B38400},
- {-1, -1},
-};
-
-int damn_b (rate)
- int rate;
-{
- int i;
-
- for (i = 0; baudtab[i].rate != -1; i++)
- if (rate == baudtab[i].rate) return baudtab[i].damn_b;
- return B38400; /* Random */
-}
-
-
-/* Open a connection to a remote debugger.
- NAME is the filename used for communication, then a space,
- then the name of the program as we should name it to EBMON. */
-
-static int baudrate = 9600;
-static char *dev_name;
-void
-eb_open (name, from_tty)
- char *name;
- int from_tty;
-{
- TERMINAL sg;
-
- char *p;
-
- target_preopen (from_tty);
-
- /* Find the first whitespace character, it separates dev_name from
- prog_name. */
- if (name == 0)
- goto erroid;
-
- for (p = name;
- *p != '\0' && !isspace (*p); p++)
- ;
- if (*p == '\0')
-erroid:
- error ("\
-Please include the name of the device for the serial port,\n\
-the baud rate, and the name of the program to run on the remote system.");
- dev_name = alloca (p - name + 1);
- strncpy (dev_name, name, p - name);
- dev_name[p - name] = '\0';
-
- /* Skip over the whitespace after dev_name */
- for (; isspace (*p); p++)
- /*EMPTY*/;
-
- if (1 != sscanf (p, "%d ", &baudrate))
- goto erroid;
-
- /* Skip the number and then the spaces */
- for (; isdigit (*p); p++)
- /*EMPTY*/;
- for (; isspace (*p); p++)
- /*EMPTY*/;
-
- if (prog_name != NULL)
- free (prog_name);
- prog_name = savestring (p, strlen (p));
-
- eb_close (0);
-
- eb_desc = open (dev_name, O_RDWR);
- if (eb_desc < 0)
- perror_with_name (dev_name);
- ioctl (eb_desc, TIOCGETP, &sg);
-#ifdef HAVE_TERMIO
- sg.c_cc[VMIN] = 0; /* read with timeout. */
- sg.c_cc[VTIME] = timeout * 10;
- sg.c_lflag &= ~(ICANON | ECHO);
- sg.c_cflag = (sg.c_cflag & ~CBAUD) | damn_b (baudrate);
-#else
- sg.sg_ispeed = damn_b (baudrate);
- sg.sg_ospeed = damn_b (baudrate);
- sg.sg_flags |= RAW | ANYP;
- sg.sg_flags &= ~ECHO;
-#endif
-
- ioctl (eb_desc, TIOCSETP, &sg);
- eb_stream = fdopen (eb_desc, "r+");
-
- push_target (&eb_ops);
- if (from_tty)
- printf ("Remote %s debugging %s using %s\n", target_shortname,
- prog_name, dev_name);
-
-#ifndef HAVE_TERMIO
-#ifndef NO_SIGINTERRUPT
- /* Cause SIGALRM's to make reads fail with EINTR instead of resuming
- the read. */
- if (siginterrupt (SIGALRM, 1) != 0)
- perror ("eb_open: error in siginterrupt");
-#endif
-
- /* Set up read timeout timer. */
- if ((void (*)) signal (SIGALRM, eb_timer) == (void (*)) -1)
- perror ("eb_open: error in signal");
-#endif
-
-#if defined (LOG_FILE)
- log_file = fopen (LOG_FILE, "w");
- if (log_file == NULL)
- perror_with_name (LOG_FILE);
-#endif
-
- /* Hello? Are you there? */
- write (eb_desc, "\n", 1);
-
- expect_prompt ();
-}
-
-/* Close out all files and local state before this target loses control. */
-
-static void
-eb_close (quitting)
- int quitting;
-{
-
- /* Due to a bug in Unix, fclose closes not only the stdio stream,
- but also the file descriptor. So we don't actually close
- eb_desc. */
- if (eb_stream)
- fclose (eb_stream); /* This also closes eb_desc */
- if (eb_desc >= 0)
- /* close (eb_desc); */
-
- /* Do not try to close eb_desc again, later in the program. */
- eb_stream = NULL;
- eb_desc = -1;
-
-#if defined (LOG_FILE)
- if (ferror (log_file))
- printf ("Error writing log file.\n");
- if (fclose (log_file) != 0)
- printf ("Error closing log file.\n");
-#endif
-}
-
-/* Terminate the open connection to the remote debugger.
- Use this when you want to detach and do something else
- with your gdb. */
-void
-eb_detach (from_tty)
- int from_tty;
-{
- pop_target(); /* calls eb_close to do the real work */
- if (from_tty)
- printf ("Ending remote %s debugging\n", target_shortname);
-}
-
-/* Tell the remote machine to resume. */
-
-void
-eb_resume (step, sig)
- int step, sig;
-{
- if (step)
- {
- write (eb_desc, "t 1,s\n", 6);
- /* Wait for the echo. */
- expect ("t 1,s\r");
- /* Then comes a line containing the instruction we stepped to. */
- expect ("\n@");
- /* Then we get the prompt. */
- expect_prompt ();
-
- /* Force the next eb_wait to return a trap. Not doing anything
- about I/O from the target means that the user has to type
- "continue" to see any. This should be fixed. */
- need_artificial_trap = 1;
- }
- else
- {
- if (need_gi)
- {
- need_gi = 0;
- write (eb_desc, "gi\n", 3);
-
- /* Swallow the echo of "gi". */
- expect ("gi\r");
- }
- else
- {
- write (eb_desc, "GR\n", 3);
- /* Swallow the echo. */
- expect ("GR\r");
- }
- }
-}
-
-/* Wait until the remote machine stops, then return,
- storing status in STATUS just as `wait' would. */
-
-int
-eb_wait (status)
- WAITTYPE *status;
-{
- /* Strings to look for. '?' means match any single character.
- Note that with the algorithm we use, the initial character
- of the string cannot recur in the string, or we will not
- find some cases of the string in the input. */
-
- static char bpt[] = "Invalid interrupt taken - #0x50 - ";
- /* It would be tempting to look for "\n[__exit + 0x8]\n"
- but that requires loading symbols with "yc i" and even if
- we did do that we don't know that the file has symbols. */
- static char exitmsg[] = "\n@????????I JMPTI GR121,LR0";
- char *bp = bpt;
- char *ep = exitmsg;
-
- /* Large enough for either sizeof (bpt) or sizeof (exitmsg) chars. */
- char swallowed[50];
- /* Current position in swallowed. */
- char *swallowed_p = swallowed;
-
- int ch;
- int ch_handled;
-
- int old_timeout = timeout;
-
- WSETEXIT ((*status), 0);
-
- if (need_artificial_trap != 0)
- {
- WSETSTOP ((*status), SIGTRAP);
- need_artificial_trap--;
- return 0;
- }
-
- timeout = 0; /* Don't time out -- user program is running. */
- while (1)
- {
- ch_handled = 0;
- ch = readchar ();
- if (ch == *bp)
- {
- bp++;
- if (*bp == '\0')
- break;
- ch_handled = 1;
-
- *swallowed_p++ = ch;
- }
- else
- bp = bpt;
-
- if (ch == *ep || *ep == '?')
- {
- ep++;
- if (*ep == '\0')
- break;
-
- if (!ch_handled)
- *swallowed_p++ = ch;
- ch_handled = 1;
- }
- else
- ep = exitmsg;
-
- if (!ch_handled)
- {
- char *p;
-
- /* Print out any characters which have been swallowed. */
- for (p = swallowed; p < swallowed_p; ++p)
- putc (*p, stdout);
- swallowed_p = swallowed;
-
- putc (ch, stdout);
- }
- }
- expect_prompt ();
- if (*bp== '\0')
- WSETSTOP ((*status), SIGTRAP);
- else
- WSETEXIT ((*status), 0);
- timeout = old_timeout;
-
- return 0;
-}
-
-/* Return the name of register number REGNO
- in the form input and output by EBMON.
-
- Returns a pointer to a static buffer containing the answer. */
-static char *
-get_reg_name (regno)
- int regno;
-{
- static char buf[80];
- if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32)
- sprintf (buf, "GR%03d", regno - GR96_REGNUM + 96);
- else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128)
- sprintf (buf, "LR%03d", regno - LR0_REGNUM);
- else if (regno == Q_REGNUM)
- strcpy (buf, "SR131");
- else if (regno >= BP_REGNUM && regno <= CR_REGNUM)
- sprintf (buf, "SR%03d", regno - BP_REGNUM + 133);
- else if (regno == ALU_REGNUM)
- strcpy (buf, "SR132");
- else if (regno >= IPC_REGNUM && regno <= IPB_REGNUM)
- sprintf (buf, "SR%03d", regno - IPC_REGNUM + 128);
- else if (regno >= VAB_REGNUM && regno <= LRU_REGNUM)
- sprintf (buf, "SR%03d", regno - VAB_REGNUM);
- else if (regno == GR1_REGNUM)
- strcpy (buf, "GR001");
- return buf;
-}
-
-/* Read the remote registers into the block REGS. */
-
-static void
-eb_fetch_registers ()
-{
- int reg_index;
- int regnum_index;
- char tempbuf[10];
- int i;
-
-#if 0
- /* This should not be necessary, because one is supposed to read the
- registers only when the inferior is stopped (at least with
- ptrace() and why not make it the same for remote?). */
- /* ^A is the "normal character" used to make sure we are talking to EBMON
- and not to the program being debugged. */
- write (eb_desc, "\001\n");
- expect_prompt ();
-#endif
-
- write (eb_desc, "dw gr96,gr127\n", 14);
- for (reg_index = 96, regnum_index = GR96_REGNUM;
- reg_index < 128;
- reg_index += 4, regnum_index += 4)
- {
- sprintf (tempbuf, "GR%03d ", reg_index);
- expect (tempbuf);
- get_hex_regs (4, regnum_index);
- expect ("\n");
- }
-
- for (i = 0; i < 128; i += 32)
- {
- /* The PC has a tendency to hang if we get these
- all in one fell swoop ("dw lr0,lr127"). */
- sprintf (tempbuf, "dw lr%d\n", i);
- write (eb_desc, tempbuf, strlen (tempbuf));
- for (reg_index = i, regnum_index = LR0_REGNUM + i;
- reg_index < i + 32;
- reg_index += 4, regnum_index += 4)
- {
- sprintf (tempbuf, "LR%03d ", reg_index);
- expect (tempbuf);
- get_hex_regs (4, regnum_index);
- expect ("\n");
- }
- }
-
- write (eb_desc, "dw sr133,sr133\n", 15);
- expect ("SR133 ");
- get_hex_regs (1, BP_REGNUM);
- expect ("\n");
-
- write (eb_desc, "dw sr134,sr134\n", 15);
- expect ("SR134 ");
- get_hex_regs (1, FC_REGNUM);
- expect ("\n");
-
- write (eb_desc, "dw sr135,sr135\n", 15);
- expect ("SR135 ");
- get_hex_regs (1, CR_REGNUM);
- expect ("\n");
-
- write (eb_desc, "dw sr131,sr131\n", 15);
- expect ("SR131 ");
- get_hex_regs (1, Q_REGNUM);
- expect ("\n");
-
- write (eb_desc, "dw sr0,sr14\n", 12);
- for (reg_index = 0, regnum_index = VAB_REGNUM;
- regnum_index <= LRU_REGNUM;
- regnum_index += 4, reg_index += 4)
- {
- sprintf (tempbuf, "SR%03d ", reg_index);
- expect (tempbuf);
- get_hex_regs (reg_index == 12 ? 3 : 4, regnum_index);
- expect ("\n");
- }
-
- /* There doesn't seem to be any way to get these. */
- {
- int val = -1;
- supply_register (FPE_REGNUM, &val);
- supply_register (INT_REGNUM, &val);
- supply_register (FPS_REGNUM, &val);
- supply_register (EXO_REGNUM, &val);
- }
-
- write (eb_desc, "dw gr1,gr1\n", 11);
- expect ("GR001 ");
- get_hex_regs (1, GR1_REGNUM);
- expect_prompt ();
-}
-
-/* Fetch register REGNO, or all registers if REGNO is -1.
- Returns errno value. */
-void
-eb_fetch_register (regno)
- int regno;
-{
- if (regno == -1)
- eb_fetch_registers ();
- else
- {
- char *name = get_reg_name (regno);
- fprintf (eb_stream, "dw %s,%s\n", name, name);
- expect (name);
- expect (" ");
- get_hex_regs (1, regno);
- expect_prompt ();
- }
- return;
-}
-
-/* Store the remote registers from the contents of the block REGS. */
-
-static void
-eb_store_registers ()
-{
- int i, j;
- fprintf (eb_stream, "s gr1,%x\n", read_register (GR1_REGNUM));
- expect_prompt ();
-
- for (j = 0; j < 32; j += 16)
- {
- fprintf (eb_stream, "s gr%d,", j + 96);
- for (i = 0; i < 15; ++i)
- fprintf (eb_stream, "%x,", read_register (GR96_REGNUM + j + i));
- fprintf (eb_stream, "%x\n", read_register (GR96_REGNUM + j + 15));
- expect_prompt ();
- }
-
- for (j = 0; j < 128; j += 16)
- {
- fprintf (eb_stream, "s lr%d,", j);
- for (i = 0; i < 15; ++i)
- fprintf (eb_stream, "%x,", read_register (LR0_REGNUM + j + i));
- fprintf (eb_stream, "%x\n", read_register (LR0_REGNUM + j + 15));
- expect_prompt ();
- }
-
- fprintf (eb_stream, "s sr133,%x,%x,%x\n", read_register (BP_REGNUM),
- read_register (FC_REGNUM), read_register (CR_REGNUM));
- expect_prompt ();
- fprintf (eb_stream, "s sr131,%x\n", read_register (Q_REGNUM));
- expect_prompt ();
- fprintf (eb_stream, "s sr0,");
- for (i = 0; i < 11; ++i)
- fprintf (eb_stream, "%x,", read_register (VAB_REGNUM + i));
- fprintf (eb_stream, "%x\n", read_register (VAB_REGNUM + 11));
- expect_prompt ();
-}
-
-/* Store register REGNO, or all if REGNO == 0.
- Return errno value. */
-int
-eb_store_register (regno)
- int regno;
-{
- if (regno == -1)
- eb_store_registers ();
- else
- {
- char *name = get_reg_name (regno);
- fprintf (eb_stream, "s %s,%x\n", name, read_register (regno));
- /* Setting GR1 changes the numbers of all the locals, so
- invalidate the register cache. Do this *after* calling
- read_register, because we want read_register to return the
- value that write_register has just stuffed into the registers
- array, not the value of the register fetched from the
- inferior. */
- if (regno == GR1_REGNUM)
- registers_changed ();
- expect_prompt ();
- }
- return 0;
-}
-
-/* Get ready to modify the registers array. On machines which store
- individual registers, this doesn't need to do anything. On machines
- which store all the registers in one fell swoop, this makes sure
- that registers contains all the registers from the program being
- debugged. */
-
-void
-eb_prepare_to_store ()
-{
- /* Do nothing, since we can store individual regs */
-}
-
-/* FIXME! Merge these two. */
-int
-eb_xfer_inferior_memory (memaddr, myaddr, len, write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
- struct target_ops *target; /* ignored */
-{
- if (write)
- return eb_write_inferior_memory (memaddr, myaddr, len);
- else
- return eb_write_inferior_memory (memaddr, myaddr, len);
-}
-
-void
-eb_files_info ()
-{
- printf ("\tAttached to %s at %d baud and running program %s.\n",
- dev_name, baudrate, prog_name);
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR. Returns errno value. */
-int
-eb_write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int i;
-
- for (i = 0; i < len; i++)
- {
- if ((i % 16) == 0)
- fprintf (eb_stream, "sb %x,", memaddr + i);
- if ((i % 16) == 15 || i == len - 1)
- {
- fprintf (eb_stream, "%x\n", ((unsigned char *)myaddr)[i]);
- expect_prompt ();
- }
- else
- fprintf (eb_stream, "%x,", ((unsigned char *)myaddr)[i]);
- }
- return 0;
-}
-
-/* Read LEN bytes from inferior memory at MEMADDR. Put the result
- at debugger address MYADDR. Returns errno value. */
-int
-eb_read_inferior_memory(memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int i;
-
- /* Number of bytes read so far. */
- int count;
-
- /* Starting address of this pass. */
- unsigned long startaddr;
-
- /* Number of bytes to read in this pass. */
- int len_this_pass;
-
- /* Note that this code works correctly if startaddr is just less
- than UINT_MAX (well, really CORE_ADDR_MAX if there was such a
- thing). That is, something like
- eb_read_bytes (CORE_ADDR_MAX - 4, foo, 4)
- works--it never adds len to memaddr and gets 0. */
- /* However, something like
- eb_read_bytes (CORE_ADDR_MAX - 3, foo, 4)
- doesn't need to work. Detect it and give up if there's an attempt
- to do that. */
- if (((memaddr - 1) + len) < memaddr)
- return EIO;
-
- startaddr = memaddr;
- count = 0;
- while (count < len)
- {
- len_this_pass = 16;
- if ((startaddr % 16) != 0)
- len_this_pass -= startaddr % 16;
- if (len_this_pass > (len - count))
- len_this_pass = (len - count);
-
- fprintf (eb_stream, "db %x,%x\n", startaddr,
- (startaddr - 1) + len_this_pass);
- expect ("\n");
-
- /* Look for 8 hex digits. */
- i = 0;
- while (1)
- {
- if (isxdigit (readchar ()))
- ++i;
- else
- {
- expect_prompt ();
- error ("Hex digit expected from remote system.");
- }
- if (i >= 8)
- break;
- }
-
- expect (" ");
-
- for (i = 0; i < len_this_pass; i++)
- get_hex_byte (&myaddr[count++]);
-
- expect_prompt ();
-
- startaddr += len_this_pass;
- }
- return 0;
-}
-
-/* Define the target subroutine names */
-
-struct target_ops eb_ops = {
- "amd-eb", "Remote serial AMD EBMON target",
- "Use a remote computer running EBMON connected by a serial line.\n\
-Arguments are the name of the device for the serial line,\n\
-the speed to connect at in bits per second, and the filename of the\n\
-executable as it exists on the remote computer. For example,\n\
- target amd-eb /dev/ttya 9600 demo",
- eb_open, eb_close,
- 0, eb_detach, eb_resume, eb_wait,
- eb_fetch_register, eb_store_register,
- eb_prepare_to_store, 0, 0, /* conv_to, conv_from */
- eb_xfer_inferior_memory, eb_files_info,
- 0, 0, /* Breakpoints */
- 0, 0, 0, 0, 0, /* Terminal handling */
- 0, /* FIXME, kill */
- 0, /* load */
- call_function_by_hand,
- 0, /* lookup_symbol */
- 0, /* create_inferior FIXME, eb_start here or something? */
- 0, /* mourn_inferior FIXME */
- process_stratum, 0, /* next */
- 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
- 0, 0, /* Section pointers */
- OPS_MAGIC, /* Always the last thing */
-};
-
-void
-_initialize_remote_eb ()
-{
- add_target (&eb_ops);
-}
diff --git a/gdb/remote-mm.c b/gdb/remote-mm.c
deleted file mode 100644
index d898402..0000000
--- a/gdb/remote-mm.c
+++ /dev/null
@@ -1,1706 +0,0 @@
-/* Remote debugging interface for Am290*0 running MiniMON monitor, for GDB.
- Copyright (C) 1990, 1991 Free Software Foundation, Inc.
- Originally written by Daniel Mann at AMD.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This is like remote.c but ecpects MiniMON to be running on the Am29000
- target hardware.
- - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this
- file to gdb 3.95. I was unable to get this working on sun3os4
- with termio, only with sgtty. Because we are only attempting to
- use this module to debug our kernel, which is already loaded when
- gdb is started up, I did not code up the file downloading facilities.
- As a result this module has only the stubs to download files.
- You should get tagged at compile time if you need to make any
- changes/additions. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "inferior.h"
-#include "wait.h"
-#include "value.h"
-#include <ctype.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include "terminal.h"
-#include "minimon.h"
-#include "target.h"
-
-/* Offset of member MEMBER in a struct of type TYPE. */
-#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
-
-/* #define DEBUG 1 /* */
-#ifdef DEBUG
-# define DENTER(NAME) (printf("Entering %s\n",NAME), fflush(stdout))
-# define DEXIT(NAME) (printf("Exiting %s\n",NAME), fflush(stdout))
-#else
-# define DENTER(NAME)
-# define DEXIT(NAME)
-#endif
-
-#define DRAIN_INPUT() (msg_recv_serial((union msg_t*)0))
-
-extern int stop_soon_quietly; /* for wait_for_inferior */
-
-extern struct value *call_function_by_hand();
-
-static void mm_resume();
-static void mm_fetch_registers ();
-static int fetch_register ();
-static int mm_store_registers ();
-static int store_register ();
-static int regnum_to_srnum();
-static void mm_close ();
-static char* msg_str();
-static char* error_msg_str();
-static int expect_msg();
-static void init_target_mm();
-static int mm_memory_space();
-
-/*
- * Processor types.
- */
-#define TYPE_UNKNOWN 0
-#define TYPE_A29000 1
-#define TYPE_A29030 2
-#define TYPE_A29050 3
-static char *processor_name[] = { "Unknown", "A29000", "A29030", "A29050" };
-static int processor_type=TYPE_UNKNOWN;
-#define FREEZE_MODE (read_register(CPS_REGNUM) && 0x400)
-#define USE_SHADOW_PC ((processor_type == TYPE_A29050) && FREEZE_MODE)
-
-#define LLOG_FILE "minimon.log"
-#if defined (LOG_FILE)
-FILE *log_file;
-#endif
-
-/*
- * Size of message buffers. I couldn't get memory reads to work when
- * the byte_count was larger than 512 (it may be a baud rate problem).
- */
-#define BUFER_SIZE 512
-/*
- * Size of data area in message buffer on the TARGET (remote system).
- */
-#define MAXDATA_T (target_config.max_msg_size - \
- offsetof(struct write_r_msg_t,data[0]))
-/*
- * Size of data area in message buffer on the HOST (gdb).
- */
-#define MAXDATA_H (BUFER_SIZE - offsetof(struct write_r_msg_t,data[0]))
-/*
- * Defined as the minimum size of data areas of the two message buffers
- */
-#define MAXDATA (MAXDATA_H < MAXDATA_T ? MAXDATA_H : MAXDATA_T)
-
-static char out_buf[BUFER_SIZE];
-static char in_buf[BUFER_SIZE];
-
-int msg_recv_serial();
-int msg_send_serial();
-
-#define MAX_RETRIES 5000
-extern struct target_ops mm_ops; /* Forward declaration */
-struct config_msg_t target_config; /* HIF needs this */
-union msg_t *out_msg_buf = (union msg_t*)out_buf;
-union msg_t *in_msg_buf = (union msg_t*)in_buf;
-
-static int timeout = 5;
-
-/* Descriptor for I/O to remote machine. Initialize it to -1 so that
- mm_open knows that we don't have a file open when the program
- starts. */
-int mm_desc = -1;
-
-/* stream which is fdopen'd from mm_desc. Only valid when
- mm_desc != -1. */
-FILE *mm_stream;
-
-/* Called when SIGALRM signal sent due to alarm() timeout. */
-#ifndef HAVE_TERMIO
-
-#ifndef __STDC__
-# ifndef volatile
-# define volatile /**/
-# endif
-#endif
-volatile int n_alarms;
-
-static void
-mm_timer ()
-{
-#if 0
- if (kiodebug)
- printf ("mm_timer called\n");
-#endif
- n_alarms++;
-}
-#endif /* HAVE_TERMIO */
-
-/* malloc'd name of the program on the remote system. */
-static char *prog_name = NULL;
-
-
-/* Number of SIGTRAPs we need to simulate. That is, the next
- NEED_ARTIFICIAL_TRAP calls to mm_wait should just return
- SIGTRAP without actually waiting for anything. */
-
-/**************************************************** REMOTE_CREATE_INFERIOR */
-/* This is called not only when we first attach, but also when the
- user types "run" after having attached. */
-static void
-mm_create_inferior (execfile, args, env)
- char *execfile;
- char *args;
- char **env;
-{
-#define MAX_TOKENS 25
-#define BUFFER_SIZE 256
- int token_count;
- int result;
- char *token[MAX_TOKENS];
- char cmd_line[BUFFER_SIZE];
-
- DENTER("mm_create_inferior()");
-
- if (args && *args)
- error ("Can't pass arguments to remote mm process (yet).");
-
- if (execfile == 0 /* || exec_bfd == 0 */ )
- error ("No exec file specified");
-
- if (!mm_stream) {
- printf("Minimon not open yet.\n");
- return;
- }
-
- /* On ultra3 (NYU) we assume the kernel is already running so there is
- no file to download.
- FIXME: Fixed required here -> load your program, possibly with mm_load().
- */
- printf_filtered ("\n\
-Assuming you are at NYU debuging a kernel, i.e., no need to download.\n\n");
-
- /* We will get a task spawn event immediately. */
-#ifdef NOTDEF /* start_remote() now does a wait without a resume
- so don't use it*/
- start_remote ();
-#else
- init_wait_for_inferior ();
- clear_proceed_status ();
- stop_soon_quietly = 1;
- proceed(-1,-1,0);
- normal_stop ();
-#endif
- DEXIT("mm_create_inferior()");
-}
-/**************************************************** REMOTE_MOURN_INFERIOR */
-static void
-mm_mourn()
-{
- DENTER("mm_mourn()");
- pop_target (); /* Pop back to no-child state */
- generic_mourn_inferior ();
- DEXIT("mm_mourn()");
-}
-
-/********************************************************************** damn_b
-*/
-/* Translate baud rates from integers to damn B_codes. Unix should
- have outgrown this crap years ago, but even POSIX wouldn't buck it. */
-
-#ifndef B19200
-#define B19200 EXTA
-#endif
-#ifndef B38400
-#define B38400 EXTB
-#endif
-
-static struct {int rate, damn_b;} baudtab[] = {
- {0, B0},
- {50, B50},
- {75, B75},
- {110, B110},
- {134, B134},
- {150, B150},
- {200, B200},
- {300, B300},
- {600, B600},
- {1200, B1200},
- {1800, B1800},
- {2400, B2400},
- {4800, B4800},
- {9600, B9600},
- {19200, B19200},
- {38400, B38400},
- {-1, -1},
-};
-
-static int damn_b (rate)
- int rate;
-{
- int i;
-
- for (i = 0; baudtab[i].rate != -1; i++)
- if (rate == baudtab[i].rate) return baudtab[i].damn_b;
- return B38400; /* Random */
-}
-
-
-/***************************************************************** REMOTE_OPEN
-** Open a connection to remote minimon.
- NAME is the filename used for communication, then a space,
- then the baud rate.
- 'target adapt /dev/ttya 9600 [prognam]' for example.
- */
-
-static char *dev_name;
-int baudrate = 9600;
-static void
-mm_open (name, from_tty)
- char *name;
- int from_tty;
-{
- TERMINAL sg;
- unsigned int prl;
- char *p;
-
- DENTER("mm_open()");
-
- /* Find the first whitespace character, it separates dev_name from
- prog_name. */
- for (p = name;
- p && *p && !isspace (*p); p++)
- ;
- if (p == 0 || *p == '\0')
-erroid:
- error ("Usage : <command> <serial-device> <baud-rate> [progname]");
- dev_name = (char*)malloc (p - name + 1);
- strncpy (dev_name, name, p - name);
- dev_name[p - name] = '\0';
-
- /* Skip over the whitespace after dev_name */
- for (; isspace (*p); p++)
- /*EMPTY*/;
-
- if (1 != sscanf (p, "%d ", &baudrate))
- goto erroid;
-
- /* Skip the number and then the spaces */
- for (; isdigit (*p); p++)
- /*EMPTY*/;
- for (; isspace (*p); p++)
- /*EMPTY*/;
-
- if (prog_name != NULL)
- free (prog_name);
- prog_name = savestring (p, strlen (p));
-
-
- if (mm_desc >= 0)
- close (mm_desc);
-
- mm_desc = open (dev_name, O_RDWR);
- if (mm_desc < 0)
- perror_with_name (dev_name);
- ioctl (mm_desc, TIOCGETP, &sg);
-#ifdef HAVE_TERMIO
- sg.c_cc[VMIN] = 0; /* read with timeout. */
- sg.c_cc[VTIME] = timeout * 10;
- sg.c_lflag &= ~(ICANON | ECHO);
- sg.c_cflag = (sg.c_cflag & ~CBAUD) | damn_b (baudrate);
-#else
- sg.sg_ispeed = damn_b (baudrate);
- sg.sg_ospeed = damn_b (baudrate);
- sg.sg_flags |= RAW;
- sg.sg_flags |= ANYP;
- sg.sg_flags &= ~ECHO;
-#endif
-
-
- ioctl (mm_desc, TIOCSETP, &sg);
- mm_stream = fdopen (mm_desc, "r+");
-
- push_target (&mm_ops);
-
-#ifndef HAVE_TERMIO
-#ifndef NO_SIGINTERRUPT
- /* Cause SIGALRM's to make reads fail with EINTR instead of resuming
- the read. */
- if (siginterrupt (SIGALRM, 1) != 0)
- perror ("mm_open: error in siginterrupt");
-#endif
-
- /* Set up read timeout timer. */
- if ((void (*)) signal (SIGALRM, mm_timer) == (void (*)) -1)
- perror ("mm_open: error in signal");
-#endif
-
-#if defined (LOG_FILE)
- log_file = fopen (LOG_FILE, "w");
- if (log_file == NULL)
- perror_with_name (LOG_FILE);
-#endif
- /*
- ** Initialize target configuration structure (global)
- */
- DRAIN_INPUT();
- out_msg_buf->config_req_msg.code = CONFIG_REQ;
- out_msg_buf->config_req_msg.length = 4*0;
- msg_send_serial(out_msg_buf); /* send config request message */
-
- expect_msg(CONFIG,in_msg_buf,1);
-
- /* Determine the processor revision level */
- /* FIXME: this code is the same as in remote-adapt.c */
- prl = (unsigned int)read_register(CFG_REGNUM) >> 24;
- if (prl == 0x03) {
- processor_type = TYPE_A29000;
- } else if ((prl&0xf0) == 0x40) { /* 29030 = 0x4* */
- processor_type = TYPE_A29030;
- fprintf_filtered(stderr,"WARNING: debugging of A29030 not tested.\n");
- } else if ((prl&0xf0) == 0x20) { /* 29050 = 0x2* */
- processor_type = TYPE_A29050;
- fprintf_filtered(stderr,"WARNING: debugging of A29050 not tested.\n");
- } else {
- processor_type = TYPE_UNKNOWN;
- fprintf_filtered(stderr,"WARNING: processor type unknown.\n");
- }
-
- /* Print out some stuff, letting the user now what's going on */
- printf_filtered("Remote debugging on an %s connect to MiniMon via %s.\n",
- processor_name[processor_type],dev_name);
- /* FIXME: can this restriction be removed? */
- printf_filtered("Remote debugging using virtual addresses works only\n");
- printf_filtered("\twhen virtual addresses map 1:1 to physical addresses.\n")
-;
- if (processor_type != TYPE_A29050) {
- fprintf_filtered(stderr,
- "Freeze-mode debugging not available, and can only be done on an A29050.\n");
- }
-
- target_config.code = CONFIG;
- target_config.length = 0;
- target_config.processor_id = in_msg_buf->config_msg.processor_id;
- target_config.version = in_msg_buf->config_msg.version;
- target_config.I_mem_start = in_msg_buf->config_msg.I_mem_start;
- target_config.I_mem_size = in_msg_buf->config_msg.I_mem_size;
- target_config.D_mem_start = in_msg_buf->config_msg.D_mem_start;
- target_config.D_mem_size = in_msg_buf->config_msg.D_mem_size;
- target_config.ROM_start = in_msg_buf->config_msg.ROM_start;
- target_config.ROM_size = in_msg_buf->config_msg.ROM_size;
- target_config.max_msg_size = in_msg_buf->config_msg.max_msg_size;
- target_config.max_bkpts = in_msg_buf->config_msg.max_bkpts;
- target_config.coprocessor = in_msg_buf->config_msg.coprocessor;
- target_config.reserved = in_msg_buf->config_msg.reserved;
- if (from_tty) {
- printf("Connected to MiniMON :\n");
- printf(" Debugcore version %d.%d\n",
- 0x0f & (target_config.version >> 4),
- 0x0f & (target_config.version ) );
- printf(" Configuration version %d.%d\n",
- 0x0f & (target_config.version >> 12),
- 0x0f & (target_config.version >> 8) );
- printf(" Message system version %d.%d\n",
- 0x0f & (target_config.version >> 20),
- 0x0f & (target_config.version >> 16) );
- printf(" Communication driver version %d.%d\n",
- 0x0f & (target_config.version >> 28),
- 0x0f & (target_config.version >> 24) );
- }
-
- /* Leave the target running...
- * The above message stopped the target in the dbg core (MiniMon),
- * so restart the target out of MiniMon,
- */
- out_msg_buf->go_msg.code = GO;
- out_msg_buf->go_msg.length = 0;
- msg_send_serial(out_msg_buf);
- /* No message to expect after a GO */
-
- DEXIT("mm_open()");
-}
-
-/**************************************************************** REMOTE_CLOSE
-** Close the open connection to the minimon debugger.
- Use this when you want to detach and do something else
- with your gdb. */
-static void
-mm_close (quitting) /*FIXME: how is quitting used */
- int quitting;
-{
- DENTER("mm_close()");
-
- if (mm_desc < 0)
- error ("Can't close remote connection: not debugging remotely.");
-
- /* We should never get here if there isn't something valid in
- mm_desc and mm_stream.
-
- Due to a bug in Unix, fclose closes not only the stdio stream,
- but also the file descriptor. So we don't actually close
- mm_desc. */
- DRAIN_INPUT();
- fclose (mm_stream);
- /* close (mm_desc); */
-
- /* Do not try to close mm_desc again, later in the program. */
- mm_stream = NULL;
- mm_desc = -1;
-
-#if defined (LOG_FILE)
- if (ferror (log_file))
- printf ("Error writing log file.\n");
- if (fclose (log_file) != 0)
- printf ("Error closing log file.\n");
-#endif
-
- printf ("Ending remote debugging\n");
-
- DEXIT("mm_close()");
-
-}
-
-/************************************************************* REMOTE_ATACH */
-/* Attach to a program that is already loaded and running
- * Upon exiting the process's execution is stopped.
- */
-static void
-mm_attach (args, from_tty)
- char *args;
- int from_tty;
-{
-
- DENTER("mm_attach()");
-
- if (!mm_stream)
- printf ("MiniMon not opened yet, use the 'target minimon' command.\n");
-
- dont_repeat();
-
- if (from_tty)
- printf ("Attaching to remote program %s...\n", prog_name);
-
-
- /* Make sure the target is currently running, it is supposed to be. */
- /* FIXME: is it ok to send MiniMon a BREAK if it is already stopped in
- * the dbg core. If so, we don't need to send this GO.
- */
- out_msg_buf->go_msg.code = GO;
- out_msg_buf->go_msg.length = 0;
- msg_send_serial(out_msg_buf);
- sleep(2); /* At the worst it will stop, receive a message, continue */
-
- /* Send the mm a break. */
- out_msg_buf->break_msg.code = BREAK;
- out_msg_buf->break_msg.length = 0;
- msg_send_serial(out_msg_buf);
-
- mark_breakpoints_out ();
- init_wait_for_inferior ();
- clear_proceed_status ();
- stop_soon_quietly = 1;
- wait_for_inferior ();
- stop_soon_quietly = 0;
- normal_stop ();
-
- DEXIT("mm_attach()");
-}
-/********************************************************** REMOTE_DETACH */
-/* Terminate the open connection to the remote debugger.
- Use this when you want to detach and do something else
- with your gdb. Leave remote process running (with no breakpoints set). */
-static void
-mm_detach (args,from_tty)
- char *args;
- int from_tty;
-{
- DENTER("mm_dettach()");
- remove_breakpoints(); /* Just in case there were any left in */
- out_msg_buf->go_msg.code = GO;
- out_msg_buf->go_msg.length = 0;
- msg_send_serial(out_msg_buf);
- pop_target(); /* calls mm_close to do the real work */
- DEXIT("mm_dettach()");
-}
-
-
-/*************************************************************** REMOTE_RESUME
-** Tell the remote machine to resume. */
-
-static void
-mm_resume (step, sig)
- int step, sig;
-{
- DENTER("mm_resume()");
-
- if (sig)
- error ("Can't send signals to a remote MiniMon system.");
-
- if (step) {
- out_msg_buf->step_msg.code= STEP;
- out_msg_buf->step_msg.length = 1*4;
- out_msg_buf->step_msg.count = 1; /* step 1 instruction */
- msg_send_serial(out_msg_buf);
- } else {
- out_msg_buf->go_msg.code= GO;
- out_msg_buf->go_msg.length = 0;
- msg_send_serial(out_msg_buf);
- }
-
- DEXIT("mm_resume()");
-}
-
-/***************************************************************** REMOTE_WAIT
-** Wait until the remote machine stops, then return,
- storing status in STATUS just as `wait' would. */
-
-static int
-mm_wait (status)
- WAITTYPE *status;
-{
- int i, result;
- int old_timeout = timeout;
- int old_immediate_quit = immediate_quit;
-
- DENTER("mm_wait()");
- WSETEXIT ((*status), 0);
-
-
-/* wait for message to arrive. It should be:
- - A HIF service request.
- - A HIF exit service request.
- - A CHANNEL0_ACK.
- - A CHANNEL1 request.
- - a debugcore HALT message.
- HIF services must be responded too, and while-looping continued.
- If the target stops executing, mm_wait() should return.
-*/
- timeout = 0; /* Wait indefinetly for a message */
- immediate_quit = 1; /* Helps ability to QUIT */
- while(1)
- {
- while(msg_recv_serial(in_msg_buf)) {
- QUIT; /* Let user quit if they want */
- }
- switch (in_msg_buf->halt_msg.code)
- {
- case HIF_CALL:
- i = in_msg_buf->hif_call_rtn_msg.service_number;
- result=service_HIF(in_msg_buf);
- if(i == 1) /* EXIT */
- goto exit;
- if(result)
- printf("Warning: failure during HIF service %d\n", i);
- break;
- case CHANNEL0_ACK:
- service_HIF(in_msg_buf);
- break;
- case CHANNEL1:
- i=in_msg_buf->channel1_msg.length;
- in_msg_buf->channel1_msg.data[i] = '\0';
- printf("%s", in_msg_buf->channel1_msg.data);
- fflush(stdout);
- /* Send CHANNEL1_ACK message */
- out_msg_buf->channel1_ack_msg.code = CHANNEL1_ACK;
- out_msg_buf->channel1_ack_msg.length = 0;
- result = msg_send_serial(out_msg_buf);
- break;
- case HALT:
- goto halted;
- default:
- goto halted;
- }
- }
-halted:
- /* FIXME, these printfs should not be here. This is a source level
- debugger, guys! */
- if (in_msg_buf->halt_msg.trap_number== 0)
- { printf("Am290*0 received vector number %d (break point)\n",
- in_msg_buf->halt_msg.trap_number);
- WSETSTOP ((*status), SIGTRAP);
- }
- else if (in_msg_buf->halt_msg.trap_number== 1)
- { printf("Am290*0 received vector number %d\n",
- in_msg_buf->halt_msg.trap_number);
- WSETSTOP ((*status), SIGBUS);
- }
- else if (in_msg_buf->halt_msg.trap_number== 3
- || in_msg_buf->halt_msg.trap_number== 4)
- { printf("Am290*0 received vector number %d\n",
- in_msg_buf->halt_msg.trap_number);
- WSETSTOP ((*status), SIGFPE);
- }
- else if (in_msg_buf->halt_msg.trap_number== 5)
- { printf("Am290*0 received vector number %d\n",
- in_msg_buf->halt_msg.trap_number);
- WSETSTOP ((*status), SIGILL);
- }
- else if (in_msg_buf->halt_msg.trap_number >= 6
- && in_msg_buf->halt_msg.trap_number <= 11)
- { printf("Am290*0 received vector number %d\n",
- in_msg_buf->halt_msg.trap_number);
- WSETSTOP ((*status), SIGSEGV);
- }
- else if (in_msg_buf->halt_msg.trap_number== 12
- || in_msg_buf->halt_msg.trap_number== 13)
- { printf("Am290*0 received vector number %d\n",
- in_msg_buf->halt_msg.trap_number);
- WSETSTOP ((*status), SIGILL);
- }
- else if (in_msg_buf->halt_msg.trap_number== 14)
- { printf("Am290*0 received vector number %d\n",
- in_msg_buf->halt_msg.trap_number);
- WSETSTOP ((*status), SIGALRM);
- }
- else if (in_msg_buf->halt_msg.trap_number== 15)
- WSETSTOP ((*status), SIGTRAP);
- else if (in_msg_buf->halt_msg.trap_number >= 16
- && in_msg_buf->halt_msg.trap_number <= 21)
- { printf("Am290*0 received vector number %d\n",
- in_msg_buf->halt_msg.trap_number);
- WSETSTOP ((*status), SIGINT);
- }
- else if (in_msg_buf->halt_msg.trap_number== 22)
- { printf("Am290*0 received vector number %d\n",
- in_msg_buf->halt_msg.trap_number);
- WSETSTOP ((*status), SIGILL);
- } /* BREAK message was sent */
- else if (in_msg_buf->halt_msg.trap_number== 75)
- WSETSTOP ((*status), SIGTRAP);
- else
-exit:
- WSETEXIT ((*status), 0);
-
- timeout = old_timeout; /* Restore original timeout value */
- immediate_quit = old_immediate_quit;
- DEXIT("mm_wait()");
- return 0;
-}
-
-/******************************************************* REMOTE_FETCH_REGISTERS
- * Read a remote register 'regno'.
- * If regno==-1 then read all the registers.
- */
-static void
-mm_fetch_registers (regno)
-int regno;
-{
- INT32 *data_p;
-
- if (regno >= 0) {
- fetch_register(regno);
- return;
- }
-
- DENTER("mm_fetch_registers()");
-
-/* Gr1/rsp */
- out_msg_buf->read_req_msg.byte_count = 4*1;
- out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
- out_msg_buf->read_req_msg.address = 1;
- msg_send_serial(out_msg_buf);
- expect_msg(READ_ACK,in_msg_buf,1);
- data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
- supply_register (GR1_REGNUM , data_p);
-
-#if defined(GR64_REGNUM) /* Read gr64-127 */
-/* Global Registers gr64-gr95 */
- out_msg_buf->read_req_msg.code= READ_REQ;
- out_msg_buf->read_req_msg.length = 4*3;
- out_msg_buf->read_req_msg.byte_count = 4*32;
- out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
- out_msg_buf->read_req_msg.address = 64;
- msg_send_serial(out_msg_buf);
- expect_msg(READ_ACK,in_msg_buf,1);
- data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
-
- for (regno=GR64_REGNUM; regno<GR64_REGNUM+32; regno++) {
- supply_register (regno, data_p++);
- }
-#endif /* GR64_REGNUM */
-
-/* Global Registers gr96-gr127 */
- out_msg_buf->read_req_msg.code= READ_REQ;
- out_msg_buf->read_req_msg.length = 4*3;
- out_msg_buf->read_req_msg.byte_count = 4 * 32;
- out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
- out_msg_buf->read_req_msg.address = 96;
- msg_send_serial(out_msg_buf);
- expect_msg(READ_ACK,in_msg_buf,1);
- data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
-
- for (regno=GR96_REGNUM; regno<GR96_REGNUM+32; regno++) {
- supply_register (regno, data_p++);
- }
-
-/* Local Registers */
- out_msg_buf->read_req_msg.byte_count = 4 * (128);
- out_msg_buf->read_req_msg.memory_space = LOCAL_REG;
- out_msg_buf->read_req_msg.address = 0;
- msg_send_serial(out_msg_buf);
- expect_msg(READ_ACK,in_msg_buf,1);
- data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
-
- for (regno=LR0_REGNUM; regno<LR0_REGNUM+128; regno++) {
- supply_register (regno, data_p++);
- }
-
-/* Protected Special Registers */
- out_msg_buf->read_req_msg.byte_count = 4*15;
- out_msg_buf->read_req_msg.memory_space = SPECIAL_REG;
- out_msg_buf->read_req_msg.address = 0;
- msg_send_serial( out_msg_buf);
- expect_msg(READ_ACK,in_msg_buf,1);
- data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
-
- for (regno=0; regno<=14; regno++) {
- supply_register (SR_REGNUM(regno), data_p++);
- }
- if (USE_SHADOW_PC) { /* Let regno_to_srnum() handle the register number */
- fetch_register(NPC_REGNUM);
- fetch_register(PC_REGNUM);
- fetch_register(PC2_REGNUM);
- }
-
-/* Unprotected Special Registers */
- out_msg_buf->read_req_msg.byte_count = 4*8;
- out_msg_buf->read_req_msg.memory_space = SPECIAL_REG;
- out_msg_buf->read_req_msg.address = 128;
- msg_send_serial( out_msg_buf);
- expect_msg(READ_ACK,in_msg_buf,1);
- data_p = &(in_msg_buf->read_r_ack_msg.data[0]);
-
- for (regno=128; regno<=135; regno++) {
- supply_register (SR_REGNUM(regno), data_p++);
- }
-
- /* There doesn't seem to be any way to get these. */
- {
- int val = -1;
- supply_register (FPE_REGNUM, &val);
- supply_register (INT_REGNUM, &val);
- supply_register (FPS_REGNUM, &val);
- supply_register (EXO_REGNUM, &val);
- }
-
- DEXIT("mm_fetch_registerS()");
-}
-
-
-/****************************************************** REMOTE_STORE_REGISTERS
- * Store register regno into the target.
- * If regno==-1 then store all the registers.
- * Result is 0 for success, -1 for failure.
- */
-
-static int
-mm_store_registers (regno)
-int regno;
-{
- int result;
-
- if (regno >= 0)
- return(store_register(regno));
-
- DENTER("mm_store_registers()");
- result = 0;
-
- out_msg_buf->write_r_msg.code= WRITE_REQ;
-
-/* Gr1/rsp */
- out_msg_buf->write_r_msg.byte_count = 4*1;
- out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
- out_msg_buf->write_r_msg.memory_space = GLOBAL_REG;
- out_msg_buf->write_r_msg.address = 1;
- out_msg_buf->write_r_msg.data[0] = read_register (GR1_REGNUM);
-
- msg_send_serial( out_msg_buf);
- if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
- result = -1;
- }
-
-#if defined(GR64_REGNUM)
-/* Global registers gr64-gr95 */
- out_msg_buf->write_r_msg.byte_count = 4* (32);
- out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
- out_msg_buf->write_r_msg.address = 64;
-
- for (regno=GR64_REGNUM ; regno<GR64_REGNUM+32 ; regno++)
- {
- out_msg_buf->write_r_msg.data[regno-GR64_REGNUM] = read_register (regno);
- }
- msg_send_serial(out_msg_buf);
- if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
- result = -1;
- }
-#endif /* GR64_REGNUM */
-
-/* Global registers gr96-gr127 */
- out_msg_buf->write_r_msg.byte_count = 4* (32);
- out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
- out_msg_buf->write_r_msg.address = 96;
- for (regno=GR96_REGNUM ; regno<GR96_REGNUM+32 ; regno++)
- {
- out_msg_buf->write_r_msg.data[regno-GR96_REGNUM] = read_register (regno);
- }
- msg_send_serial( out_msg_buf);
- if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
- result = -1;
- }
-
-/* Local Registers */
- out_msg_buf->write_r_msg.memory_space = LOCAL_REG;
- out_msg_buf->write_r_msg.byte_count = 4*128;
- out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
- out_msg_buf->write_r_msg.address = 0;
-
- for (regno = LR0_REGNUM ; regno < LR0_REGNUM+128 ; regno++)
- {
- out_msg_buf->write_r_msg.data[regno-LR0_REGNUM] = read_register (regno);
- }
- msg_send_serial( out_msg_buf);
- if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
- result = -1;
- }
-
-/* Protected Special Registers */
- /* VAB through TMR */
- out_msg_buf->write_r_msg.memory_space = SPECIAL_REG;
- out_msg_buf->write_r_msg.byte_count = 4* 10;
- out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
- out_msg_buf->write_r_msg.address = 0;
- for (regno = 0 ; regno<=9 ; regno++) /* VAB through TMR */
- out_msg_buf->write_r_msg.data[regno] = read_register (SR_REGNUM(regno));
- msg_send_serial( out_msg_buf);
- if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
- result = -1;
- }
-
- /* PC0, PC1, PC2 possibly as shadow registers */
- out_msg_buf->write_r_msg.byte_count = 4* 3;
- out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
- for (regno=10 ; regno<=12 ; regno++) /* LRU and MMU */
- out_msg_buf->write_r_msg.data[regno-10] = read_register (SR_REGNUM(regno));
- if (USE_SHADOW_PC)
- out_msg_buf->write_r_msg.address = 20; /* SPC0 */
- else
- out_msg_buf->write_r_msg.address = 10; /* PC0 */
- msg_send_serial( out_msg_buf);
- if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
- result = -1;
- }
-
- /* LRU and MMU */
- out_msg_buf->write_r_msg.byte_count = 4* 2;
- out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
- out_msg_buf->write_r_msg.address = 13;
- for (regno=13 ; regno<=14 ; regno++) /* LRU and MMU */
- out_msg_buf->write_r_msg.data[regno-13] = read_register (SR_REGNUM(regno));
- msg_send_serial( out_msg_buf);
- if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
- result = -1;
- }
-
-/* Unprotected Special Registers */
- out_msg_buf->write_r_msg.byte_count = 4*8;
- out_msg_buf->write_r_msg.length = 3*4 + out_msg_buf->write_r_msg.byte_count;
- out_msg_buf->write_r_msg.address = 128;
- for (regno = 128 ; regno<=135 ; regno++)
- out_msg_buf->write_r_msg.data[regno-128] = read_register(SR_REGNUM(regno));
- msg_send_serial( out_msg_buf);
- if (!expect_msg(WRITE_ACK,in_msg_buf,1)) {
- result = -1;
- }
-
- registers_changed ();
- DEXIT("mm_store_registers()");
- return result;
-}
-
-/*************************************************** REMOTE_PREPARE_TO_STORE */
-/* Get ready to modify the registers array. On machines which store
- individual registers, this doesn't need to do anything. On machines
- which store all the registers in one fell swoop, this makes sure
- that registers contains all the registers from the program being
- debugged. */
-
-static void
-mm_prepare_to_store ()
-{
- /* Do nothing, since we can store individual regs */
-}
-
-/******************************************************* REMOTE_XFER_MEMORY */
-static CORE_ADDR
-translate_addr(addr)
-CORE_ADDR addr;
-{
-#if defined(KERNEL_DEBUGGING)
- /* Check for a virtual address in the kernel */
- /* Assume physical address of ublock is in paddr_u register */
- /* FIXME: doesn't work for user virtual addresses */
- if (addr >= UVADDR) {
- /* PADDR_U register holds the physical address of the ublock */
- CORE_ADDR i = (CORE_ADDR)read_register(PADDR_U_REGNUM);
- return(i + addr - (CORE_ADDR)UVADDR);
- } else {
- return(addr);
- }
-#else
- return(addr);
-#endif
-}
-
-/******************************************************* REMOTE_FILES_INFO */
-static void
-mm_files_info ()
-{
- printf ("\tAttached to %s at %d baud and running program %s.\n",
- dev_name, baudrate, prog_name);
-}
-
-/************************************************* REMOTE_INSERT_BREAKPOINT */
-static int
-mm_insert_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
-{
- DENTER("mm_insert_breakpoint()");
- out_msg_buf->bkpt_set_msg.code = BKPT_SET;
- out_msg_buf->bkpt_set_msg.length = 4*4;
- out_msg_buf->bkpt_set_msg.memory_space = I_MEM;
- out_msg_buf->bkpt_set_msg.bkpt_addr = (ADDR32) addr;
- out_msg_buf->bkpt_set_msg.pass_count = 1;
- out_msg_buf->bkpt_set_msg.bkpt_type = -1; /* use illop for 29000 */
- msg_send_serial( out_msg_buf);
- if (expect_msg(BKPT_SET_ACK,in_msg_buf,1)) {
- DEXIT("mm_insert_breakpoint() success");
- return 0; /* Success */
- } else {
- DEXIT("mm_insert_breakpoint() failure");
- return 1; /* Failure */
- }
-}
-
-/************************************************* REMOTE_DELETE_BREAKPOINT */
-static int
-mm_remove_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
-{
- DENTER("mm_remove_breakpoint()");
- out_msg_buf->bkpt_rm_msg.code = BKPT_RM;
- out_msg_buf->bkpt_rm_msg.length = 4*3;
- out_msg_buf->bkpt_rm_msg.memory_space = I_MEM;
- out_msg_buf->bkpt_rm_msg.bkpt_addr = (ADDR32) addr;
- msg_send_serial( out_msg_buf);
- if (expect_msg(BKPT_RM_ACK,in_msg_buf,1)) {
- DEXIT("mm_remove_breakpoint()");
- return 0; /* Success */
- } else {
- DEXIT("mm_remove_breakpoint()");
- return 1; /* Failure */
- }
-}
-
-
-/******************************************************* REMOTE_KILL */
-static void
-mm_kill(arg,from_tty)
-char *arg;
-int from_tty;
-{
- char buf[4];
-
- DENTER("mm_kill()");
-#if defined(KERNEL_DEBUGGING)
- /* We don't ever kill the kernel */
- if (from_tty) {
- printf("Kernel not killed, but left in current state.\n");
- printf("Use detach to leave kernel running.\n");
- }
-#else
- out_msg_buf->break_msg.code = BREAK;
- out_msg_buf->bkpt_set_msg.length = 4*0;
- expect_msg(HALT,in_msg_buf,from_tty);
- if (from_tty) {
- printf("Target has been stopped.");
- printf("Would you like to do a hardware reset (y/n) [n] ");
- fgets(buf,3,stdin);
- if (buf[0] == 'y') {
- out_msg_buf->reset_msg.code = RESET;
- out_msg_buf->bkpt_set_msg.length = 4*0;
- expect_msg(RESET_ACK,in_msg_buf,from_tty);
- printf("Target has been reset.");
- }
- }
- pop_target();
-#endif
- DEXIT("mm_kill()");
-}
-
-
-
-/***************************************************************************/
-/*
- * Load a program into the target.
- */
-static void
-mm_load(arg_string,from_tty)
-char *arg_string;
-int from_tty;
-{
- dont_repeat ();
-
-#if defined(KERNEL_DEBUGGING)
- printf("The kernel had better be loaded already! Loading not done.\n");
-#else
- if (arg_string == 0)
- error ("The load command takes a file name");
-
- arg_string = tilde_expand (arg_string);
- make_cleanup (free, arg_string);
- QUIT;
- immediate_quit++;
- error("File loading is not yet supported for MiniMon.");
- /* FIXME, code to load your file here... */
- /* You may need to do an init_target_mm() */
- /* init_target_mm(?,?,?,?,?,?,?,?); */
- immediate_quit--;
- /* symbol_file_add (arg_string, from_tty, text_addr, 0); */
-#endif
-
-}
-
-/************************************************ REMOTE_WRITE_INFERIOR_MEMORY
-** Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR. Returns number of bytes written. */
-static int
-mm_write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int i,nwritten;
-
- /* DENTER("mm_write_inferior_memory()"); */
- out_msg_buf->write_req_msg.code= WRITE_REQ;
- out_msg_buf->write_req_msg.memory_space = mm_memory_space(memaddr);
-
- nwritten=0;
- while (nwritten < len) {
- int num_to_write = len - nwritten;
- if (num_to_write > MAXDATA) num_to_write = MAXDATA;
- for (i=0 ; i < num_to_write ; i++)
- out_msg_buf->write_req_msg.data[i] = myaddr[i+nwritten];
- out_msg_buf->write_req_msg.byte_count = num_to_write;
- out_msg_buf->write_req_msg.length = 3*4 + num_to_write;
- out_msg_buf->write_req_msg.address = memaddr + nwritten;
- msg_send_serial(out_msg_buf);
-
- if (expect_msg(WRITE_ACK,in_msg_buf,1)) {
- nwritten += in_msg_buf->write_ack_msg.byte_count;
- } else {
- break;
- }
- }
- /* DEXIT("mm_write_inferior_memory()"); */
- return(nwritten);
-}
-
-/************************************************* REMOTE_READ_INFERIOR_MEMORY
-** Read LEN bytes from inferior memory at MEMADDR. Put the result
- at debugger address MYADDR. Returns number of bytes read. */
-static int
-mm_read_inferior_memory(memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int i,nread;
-
- /* DENTER("mm_read_inferior_memory()"); */
- out_msg_buf->read_req_msg.code= READ_REQ;
- out_msg_buf->read_req_msg.memory_space = mm_memory_space(memaddr);
-
- nread=0;
- while (nread < len) {
- int num_to_read = (len - nread);
- if (num_to_read > MAXDATA) num_to_read = MAXDATA;
- out_msg_buf->read_req_msg.byte_count = num_to_read;
- out_msg_buf->read_req_msg.length = 3*4 + num_to_read;
- out_msg_buf->read_req_msg.address = memaddr + nread;
- msg_send_serial(out_msg_buf);
-
- if (expect_msg(READ_ACK,in_msg_buf,1)) {
- for (i=0 ; i<in_msg_buf->read_ack_msg.byte_count ; i++)
- myaddr[i+nread] = in_msg_buf->read_ack_msg.data[i];
- nread += in_msg_buf->read_ack_msg.byte_count;
- } else {
- break;
- }
- }
- return(nread);
-}
-
-/* FIXME! Merge these two. */
-static int
-mm_xfer_inferior_memory (memaddr, myaddr, len, write)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
-{
-
- memaddr = translate_addr(memaddr);
-
- if (write)
- return mm_write_inferior_memory (memaddr, myaddr, len);
- else
- return mm_read_inferior_memory (memaddr, myaddr, len);
-}
-
-
-/********************************************************** MSG_SEND_SERIAL
-** This function is used to send a message over the
-** serial line.
-**
-** If the message is successfully sent, a zero is
-** returned. If the message was not sendable, a -1
-** is returned. This function blocks. That is, it
-** does not return until the message is completely
-** sent, or until an error is encountered.
-**
-*/
-
-int
-msg_send_serial(msg_ptr)
- union msg_t *msg_ptr;
-{
- INT32 message_size;
- int byte_count;
- int result;
- char c;
-
- /* Send message header */
- byte_count = 0;
- message_size = msg_ptr->generic_msg.length + (2 * sizeof(INT32));
- do {
- c = *((char *)msg_ptr+byte_count);
- result = write(mm_desc, &c, 1);
- if (result == 1) {
- byte_count = byte_count + 1;
- }
- } while ((byte_count < message_size) );
-
- return(0);
-} /* end msg_send_serial() */
-
-/********************************************************** MSG_RECV_SERIAL
-** This function is used to receive a message over a
-** serial line.
-**
-** If the message is waiting in the buffer, a zero is
-** returned and the buffer pointed to by msg_ptr is filled
-** in. If no message was available, a -1 is returned.
-** If timeout==0, wait indefinetly for a character.
-**
-*/
-
-int
-msg_recv_serial(msg_ptr)
-union msg_t *msg_ptr;
-{
- static INT32 length=0;
- static INT32 byte_count=0;
- int result;
- char c;
- if(msg_ptr == 0) /* re-sync request */
- { length=0;
- byte_count=0;
-#ifdef HAVE_TERMIO
- /* The timeout here is the prevailing timeout set with VTIME */
- ->"timeout==0 semantics not supported"
- read(mm_desc, in_buf, BUFER_SIZE);
-#else
- alarm (1);
- read(mm_desc, in_buf, BUFER_SIZE);
- alarm (0);
-#endif
- return(0);
- }
- /* Receive message */
-#ifdef HAVE_TERMIO
-/* Timeout==0, help support the mm_wait() routine */
- ->"timeout==0 semantics not supported (and its nice if they are)"
- result = read(mm_desc, &c, 1);
-#else
- alarm(timeout);
- result = read(mm_desc, &c, 1);
- alarm (0);
-#endif
- if ( result < 0) {
- if (errno == EINTR) {
- error ("Timeout reading from remote system.");
- } else
- perror_with_name ("remote");
- } else if (result == 1) {
- *((char *)msg_ptr+byte_count) = c;
- byte_count = byte_count + 1;
- }
-
- /* Message header received. Save message length. */
- if (byte_count == (2 * sizeof(INT32)))
- length = msg_ptr->generic_msg.length;
-
- if (byte_count >= (length + (2 * sizeof(INT32)))) {
- /* Message received */
- byte_count = 0;
- return(0);
- } else
- return (-1);
-
-} /* end msg_recv_serial() */
-
-/********************************************************************* KBD_RAW
-** This function is used to put the keyboard in "raw"
-** mode for BSD Unix. The original status is saved
-** so that it may be restored later.
-*/
-TERMINAL kbd_tbuf;
-
-int
-kbd_raw() {
- int result;
- TERMINAL tbuf;
-
- /* Get keyboard termio (to save to restore original modes) */
-#ifdef HAVE_TERMIO
- result = ioctl(0, TCGETA, &kbd_tbuf);
-#else
- result = ioctl(0, TIOCGETP, &kbd_tbuf);
-#endif
- if (result == -1)
- return (errno);
-
- /* Get keyboard TERMINAL (for modification) */
-#ifdef HAVE_TERMIO
- result = ioctl(0, TCGETA, &tbuf);
-#else
- result = ioctl(0, TIOCGETP, &tbuf);
-#endif
- if (result == -1)
- return (errno);
-
- /* Set up new parameters */
-#ifdef HAVE_TERMIO
- tbuf.c_iflag = tbuf.c_iflag &
- ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON | BRKINT);
- tbuf.c_lflag = tbuf.c_lflag & ~(ICANON | ISIG | ECHO);
- tbuf.c_cc[4] = 0; /* MIN */
- tbuf.c_cc[5] = 0; /* TIME */
-#else
- /* FIXME: not sure if this is correct (matches HAVE_TERMIO). */
- tbuf.sg_flags |= RAW;
- tbuf.sg_flags |= ANYP;
- tbuf.sg_flags &= ~ECHO;
-#endif
-
- /* Set keyboard termio to new mode (RAW) */
-#ifdef HAVE_TERMIO
- result = ioctl(0, TCSETAF, &tbuf);
-#else
- result = ioctl(0, TIOCSETP, &tbuf);
-#endif
- if (result == -1)
- return (errno);
-
- return (0);
-} /* end kbd_raw() */
-
-
-
-/***************************************************************** KBD_RESTORE
-** This function is used to put the keyboard back in the
-** mode it was in before kbk_raw was called. Note that
-** kbk_raw() must have been called at least once before
-** kbd_restore() is called.
-*/
-
-int
-kbd_restore() {
- int result;
-
- /* Set keyboard termio to original mode */
-#ifdef HAVE_TERMIO
- result = ioctl(0, TCSETAF, &kbd_tbuf);
-#else
- result = ioctl(0, TIOCGETP, &kbd_tbuf);
-#endif
-
- if (result == -1)
- return (errno);
-
- return(0);
-} /* end kbd_cooked() */
-
-
-/*****************************************************************************/
-/* Fetch a single register indicatated by 'regno'.
- * Returns 0/-1 on success/failure.
- */
-static int
-fetch_register (regno)
- int regno;
-{
- int result;
- DENTER("mm_fetch_register()");
- out_msg_buf->read_req_msg.code= READ_REQ;
- out_msg_buf->read_req_msg.length = 4*3;
- out_msg_buf->read_req_msg.byte_count = 4;
-
- if (regno == GR1_REGNUM)
- { out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
- out_msg_buf->read_req_msg.address = 1;
- }
- else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32)
- { out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
- out_msg_buf->read_req_msg.address = (regno - GR96_REGNUM) + 96;
- }
-#if defined(GR64_REGNUM)
- else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32 )
- { out_msg_buf->read_req_msg.memory_space = GLOBAL_REG;
- out_msg_buf->read_req_msg.address = (regno - GR64_REGNUM) + 64;
- }
-#endif /* GR64_REGNUM */
- else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128)
- { out_msg_buf->read_req_msg.memory_space = LOCAL_REG;
- out_msg_buf->read_req_msg.address = (regno - LR0_REGNUM);
- }
- else if (regno>=FPE_REGNUM && regno<=EXO_REGNUM)
- { int val = -1;
- supply_register(160 + (regno - FPE_REGNUM),&val);
- return 0; /* Pretend Success */
- }
- else
- { out_msg_buf->read_req_msg.memory_space = SPECIAL_REG;
- out_msg_buf->read_req_msg.address = regnum_to_srnum(regno);
- }
-
- msg_send_serial(out_msg_buf);
-
- if (expect_msg(READ_ACK,in_msg_buf,1)) {
- supply_register (regno, &(in_msg_buf->read_r_ack_msg.data[0]));
- result = 0;
- } else {
- result = -1;
- }
- DEXIT("mm_fetch_register()");
- return result;
-}
-/*****************************************************************************/
-/* Store a single register indicated by 'regno'.
- * Returns 0/-1 on success/failure.
- */
-static int
-store_register (regno)
- int regno;
-{
- int result;
-
- DENTER("store_register()");
- out_msg_buf->write_req_msg.code= WRITE_REQ;
- out_msg_buf->write_req_msg.length = 4*4;
- out_msg_buf->write_req_msg.byte_count = 4;
- out_msg_buf->write_r_msg.data[0] = read_register (regno);
-
- if (regno == GR1_REGNUM)
- { out_msg_buf->write_req_msg.memory_space = GLOBAL_REG;
- out_msg_buf->write_req_msg.address = 1;
- /* Setting GR1 changes the numbers of all the locals, so invalidate the
- * register cache. Do this *after* calling read_register, because we want
- * read_register to return the value that write_register has just stuffed
- * into the registers array, not the value of the register fetched from
- * the inferior.
- */
- registers_changed ();
- }
-#if defined(GR64_REGNUM)
- else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32 )
- { out_msg_buf->write_req_msg.memory_space = GLOBAL_REG;
- out_msg_buf->write_req_msg.address = (regno - GR64_REGNUM) + 64;
- }
-#endif /* GR64_REGNUM */
- else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32)
- { out_msg_buf->write_req_msg.memory_space = GLOBAL_REG;
- out_msg_buf->write_req_msg.address = (regno - GR96_REGNUM) + 96;
- }
- else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128)
- { out_msg_buf->write_req_msg.memory_space = LOCAL_REG;
- out_msg_buf->write_req_msg.address = (regno - LR0_REGNUM);
- }
- else if (regno>=FPE_REGNUM && regno<=EXO_REGNUM)
- {
- return 0; /* Pretend Success */
- }
- else /* An unprotected or protected special register */
- { out_msg_buf->write_req_msg.memory_space = SPECIAL_REG;
- out_msg_buf->write_req_msg.address = regnum_to_srnum(regno);
- }
-
- msg_send_serial(out_msg_buf);
-
- if (expect_msg(WRITE_ACK,in_msg_buf,1)) {
- result = 0;
- } else {
- result = -1;
- }
- DEXIT("store_register()");
- return result;
-}
-/****************************************************************************/
-/*
- * Convert a gdb special register number to a 29000 special register number.
- */
-static int
-regnum_to_srnum(regno)
-int regno;
-{
- switch(regno) {
- case VAB_REGNUM: return(0);
- case OPS_REGNUM: return(1);
- case CPS_REGNUM: return(2);
- case CFG_REGNUM: return(3);
- case CHA_REGNUM: return(4);
- case CHD_REGNUM: return(5);
- case CHC_REGNUM: return(6);
- case RBP_REGNUM: return(7);
- case TMC_REGNUM: return(8);
- case TMR_REGNUM: return(9);
- case NPC_REGNUM: return(USE_SHADOW_PC ? (20) : (10));
- case PC_REGNUM: return(USE_SHADOW_PC ? (21) : (11));
- case PC2_REGNUM: return(USE_SHADOW_PC ? (22) : (12));
- case MMU_REGNUM: return(13);
- case LRU_REGNUM: return(14);
- case IPC_REGNUM: return(128);
- case IPA_REGNUM: return(129);
- case IPB_REGNUM: return(130);
- case Q_REGNUM: return(131);
- case ALU_REGNUM: return(132);
- case BP_REGNUM: return(133);
- case FC_REGNUM: return(134);
- case CR_REGNUM: return(135);
- case FPE_REGNUM: return(160);
- case INT_REGNUM: return(161);
- case FPS_REGNUM: return(162);
- case EXO_REGNUM:return(164);
- default:
- return(255); /* Failure ? */
- }
-}
-/****************************************************************************/
-/*
- * Initialize the target debugger (minimon only).
- */
-static void
-init_target_mm(tstart,tend,dstart,dend,entry,ms_size,rs_size,arg_start)
-ADDR32 tstart,tend,dstart,dend,entry;
-INT32 ms_size,rs_size;
-ADDR32 arg_start;
-{
- out_msg_buf->init_msg.code = INIT;
- out_msg_buf->init_msg.length= sizeof(struct init_msg_t)-2*sizeof(INT32);
- out_msg_buf->init_msg.text_start = tstart;
- out_msg_buf->init_msg.text_end = tend;
- out_msg_buf->init_msg.data_start = dstart;
- out_msg_buf->init_msg.data_end = dend;
- out_msg_buf->init_msg.entry_point = entry;
- out_msg_buf->init_msg.mem_stack_size = ms_size;
- out_msg_buf->init_msg.reg_stack_size = rs_size;
- out_msg_buf->init_msg.arg_start = arg_start;
- msg_send_serial(out_msg_buf);
- expect_msg(INIT_ACK,in_msg_buf,1);
-}
-/****************************************************************************/
-/*
- * Return a pointer to a string representing the given message code.
- * Not all messages are represented here, only the ones that we expect
- * to be called with.
- */
-static char*
-msg_str(code)
-INT32 code;
-{
- static char cbuf[32];
-
- switch (code) {
- case BKPT_SET_ACK: sprintf(cbuf,"%s (%d)","BKPT_SET_ACK",code); break;
- case BKPT_RM_ACK: sprintf(cbuf,"%s (%d)","BKPT_RM_ACK",code); break;
- case INIT_ACK: sprintf(cbuf,"%s (%d)","INIT_ACK",code); break;
- case READ_ACK: sprintf(cbuf,"%s (%d)","READ_ACK",code); break;
- case WRITE_ACK: sprintf(cbuf,"%s (%d)","WRITE_ACK",code); break;
- case ERROR: sprintf(cbuf,"%s (%d)","ERROR",code); break;
- case HALT: sprintf(cbuf,"%s (%d)","HALT",code); break;
- default: sprintf(cbuf,"UNKNOWN (%d)",code); break;
- }
- return(cbuf);
-}
-/****************************************************************************/
-/*
- * Selected (not all of them) error codes that we might get.
- */
-static char*
-error_msg_str(code)
-INT32 code;
-{
- static char cbuf[50];
-
- switch (code) {
- case EMFAIL: return("EMFAIL: unrecoverable error");
- case EMBADADDR: return("EMBADADDR: Illegal address");
- case EMBADREG: return("EMBADREG: Illegal register ");
- case EMACCESS: return("EMACCESS: Could not access memory");
- case EMBADMSG: return("EMBADMSG: Unknown message type");
- case EMMSG2BIG: return("EMMSG2BIG: Message to large");
- case EMNOSEND: return("EMNOSEND: Could not send message");
- case EMNORECV: return("EMNORECV: Could not recv message");
- case EMRESET: return("EMRESET: Could not RESET target");
- case EMCONFIG: return("EMCONFIG: Could not get target CONFIG");
- case EMSTATUS: return("EMSTATUS: Could not get target STATUS");
- case EMREAD: return("EMREAD: Could not READ target memory");
- case EMWRITE: return("EMWRITE: Could not WRITE target memory");
- case EMBKPTSET: return("EMBKPTSET: Could not set breakpoint");
- case EMBKPTRM: return("EMBKPTRM: Could not remove breakpoint");
- case EMBKPTSTAT:return("EMBKPTSTAT: Could not get breakpoint status");
- case EMBKPTNONE:return("EMBKPTNONE: All breakpoints in use");
- case EMBKPTUSED:return("EMBKPTUSED: Breakpoints already in use");
- case EMINIT: return("EMINIT: Could not init target memory");
- case EMGO: return("EMGO: Could not start execution");
- case EMSTEP: return("EMSTEP: Could not single step");
- case EMBREAK: return("EMBREAK: Could not BREAK");
- case EMCOMMERR: return("EMCOMMERR: Communication error");
- default: sprintf(cbuf,"error number %d",code); break;
- } /* end switch */
-
- return (cbuf);
-}
-/****************************************************************************/
-/*
- * Receive a message and expect it to be of type msgcode.
- * Returns 0/1 on failure/success.
- */
-static int
-expect_msg(msgcode,msg_buf,from_tty)
-INT32 msgcode; /* Msg code we expect */
-union msg_t *msg_buf; /* Where to put the message received */
-int from_tty; /* Print message on error if non-zero */
-{
- /* DENTER("expect_msg()"); */
- int retries=0;
- while(msg_recv_serial(msg_buf) && (retries++<MAX_RETRIES));
- if (retries >= MAX_RETRIES) {
- printf("Expected msg %s, ",msg_str(msgcode));
- printf("no message received!\n");
- /* DEXIT("expect_msg() failure"); */
- return(0); /* Failure */
- }
-
- if (msg_buf->generic_msg.code != msgcode) {
- if (from_tty) {
- printf("Expected msg %s, ",msg_str(msgcode));
- printf("got msg %s\n",msg_str(msg_buf->generic_msg.code));
- if (msg_buf->generic_msg.code == ERROR)
- printf("%s\n",error_msg_str(msg_buf->error_msg.error_code));
- }
- /* DEXIT("expect_msg() failure"); */
- return(0); /* Failure */
- }
- /* DEXIT("expect_msg() success"); */
- return(1); /* Success */
-}
-/****************************************************************************/
-/*
- * Determine the MiniMon memory space qualifier based on the addr.
- * FIXME: Can't distinguis I_ROM/D_ROM.
- * FIXME: Doesn't know anything about I_CACHE/D_CACHE.
- */
-static int
-mm_memory_space(addr)
-CORE_ADDR *addr;
-{
- ADDR32 tstart = target_config.I_mem_start;
- ADDR32 tend = tstart + target_config.I_mem_size;
- ADDR32 dstart = target_config.D_mem_start;
- ADDR32 dend = tstart + target_config.D_mem_size;
- ADDR32 rstart = target_config.ROM_start;
- ADDR32 rend = tstart + target_config.ROM_size;
-
- if (((ADDR32)addr >= tstart) && ((ADDR32)addr < tend)) {
- return I_MEM;
- } else if (((ADDR32)addr >= dstart) && ((ADDR32)addr < dend)) {
- return D_MEM;
- } else if (((ADDR32)addr >= rstart) && ((ADDR32)addr < rend)) {
- /* FIXME: how do we determine between D_ROM and I_ROM */
- return D_ROM;
- } else /* FIXME: what do me do now? */
- return D_MEM; /* Hmmm! */
-}
-
-/****************************************************************************/
-/*
- * Define the target subroutine names
- */
-struct target_ops mm_ops = {
- "minimon", "Remote AMD/Minimon target",
- "Remote debug an AMD 290*0 using the MiniMon dbg core on the target",
- mm_open, mm_close,
- mm_attach, mm_detach, mm_resume, mm_wait,
- mm_fetch_registers, mm_store_registers,
- mm_prepare_to_store, 0, 0, /* conv_to, conv_from */
- mm_xfer_inferior_memory,
- mm_files_info,
- mm_insert_breakpoint, mm_remove_breakpoint, /* Breakpoints */
- 0, 0, 0, 0, 0, /* Terminal handling */
- mm_kill, /* FIXME, kill */
- mm_load,
- call_function_by_hand,
- 0, /* lookup_symbol */
- mm_create_inferior, /* create_inferior */
- mm_mourn, /* mourn_inferior FIXME */
- process_stratum, 0, /* next */
- 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
- 0,0, /* sections, sections_end */
- OPS_MAGIC, /* Always the last thing */
-};
-
-void
-_initialize_remote_mm()
-{
- add_target (&mm_ops);
-}
-
-#ifdef NO_HIF_SUPPORT
-service_HIF(msg)
-union msg_t *msg;
-{
- return(0); /* Emulate a failure */
-}
-#endif
diff --git a/gdb/remote-multi.shar b/gdb/remote-multi.shar
deleted file mode 100755
index 86c9cf0..0000000
--- a/gdb/remote-multi.shar
+++ /dev/null
@@ -1,1313 +0,0 @@
-#!/bin/sh
-# This is a shell archive.
-# Run the file through sh to extract its contents.
-# shar: Shell Archiver
-# Run the following text with /bin/sh to create:
-# Remote_Makefile
-# remote_gutils.c
-# remote_inflow.c
-# remote_server.c
-# remote_utils.c
-# This archive created: Fri Jun 23 17:06:55 1989
-cat << \SHAR_EOF > Remote_Makefile
-# Makefile for the remote server for GDB, the GNU debugger.
-# Copyright (C) 1986, 1989 Free Software Foundation, Inc.
-#
-# This file is part of GDB.
-#
-# GDB 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 1, or (at your option)
-# any later version.
-#
-# GDB 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 GDB; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-CFLAGS = -g
-CC = cc
-
-SERVER = remote_server.o\
- remote_inflow.o\
- remote_utils.o\
- remote_gutils.o
-
-prog : $(SERVER)
- $(CC) -g -o serve $(SERVER)
-SHAR_EOF
-cat << \SHAR_EOF > remote_gutils.c
-/* General utility routines for the remote server for GDB, the GNU debugger.
- Copyright (C) 1986, 1989 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include "defs.h"
-
-void error ();
-void fatal ();
-
-/* Chain of cleanup actions established with make_cleanup,
- to be executed if an error happens. */
-
-static struct cleanup *cleanup_chain;
-
-/* Nonzero means a quit has been requested. */
-
-int quit_flag;
-
-/* Nonzero means quit immediately if Control-C is typed now,
- rather than waiting until QUIT is executed. */
-
-int immediate_quit;
-
-/* Add a new cleanup to the cleanup_chain,
- and return the previous chain pointer
- to be passed later to do_cleanups or discard_cleanups.
- Args are FUNCTION to clean up with, and ARG to pass to it. */
-
-struct cleanup *
-make_cleanup (function, arg)
- void (*function) ();
- int arg;
-{
- register struct cleanup *new
- = (struct cleanup *) xmalloc (sizeof (struct cleanup));
- register struct cleanup *old_chain = cleanup_chain;
-
- new->next = cleanup_chain;
- new->function = function;
- new->arg = arg;
- cleanup_chain = new;
-
- return old_chain;
-}
-
-/* Discard cleanups and do the actions they describe
- until we get back to the point OLD_CHAIN in the cleanup_chain. */
-
-void
-do_cleanups (old_chain)
- register struct cleanup *old_chain;
-{
- register struct cleanup *ptr;
- while ((ptr = cleanup_chain) != old_chain)
- {
- (*ptr->function) (ptr->arg);
- cleanup_chain = ptr->next;
- free (ptr);
- }
-}
-
-/* Discard cleanups, not doing the actions they describe,
- until we get back to the point OLD_CHAIN in the cleanup_chain. */
-
-void
-discard_cleanups (old_chain)
- register struct cleanup *old_chain;
-{
- register struct cleanup *ptr;
- while ((ptr = cleanup_chain) != old_chain)
- {
- cleanup_chain = ptr->next;
- free (ptr);
- }
-}
-
-/* This function is useful for cleanups.
- Do
-
- foo = xmalloc (...);
- old_chain = make_cleanup (free_current_contents, &foo);
-
- to arrange to free the object thus allocated. */
-
-void
-free_current_contents (location)
- char **location;
-{
- free (*location);
-}
-
-/* Generally useful subroutines used throughout the program. */
-
-/* Like malloc but get error if no storage available. */
-
-char *
-xmalloc (size)
- long size;
-{
- register char *val = (char *) malloc (size);
- if (!val)
- fatal ("virtual memory exhausted.", 0);
- return val;
-}
-
-/* Like realloc but get error if no storage available. */
-
-char *
-xrealloc (ptr, size)
- char *ptr;
- long size;
-{
- register char *val = (char *) realloc (ptr, size);
- if (!val)
- fatal ("virtual memory exhausted.", 0);
- return val;
-}
-
-/* Print the system error message for errno, and also mention STRING
- as the file name for which the error was encountered.
- Then return to command level. */
-
-void
-perror_with_name (string)
- char *string;
-{
- extern int sys_nerr;
- extern char *sys_errlist[];
- extern int errno;
- char *err;
- char *combined;
-
- if (errno < sys_nerr)
- err = sys_errlist[errno];
- else
- err = "unknown error";
-
- combined = (char *) alloca (strlen (err) + strlen (string) + 3);
- strcpy (combined, string);
- strcat (combined, ": ");
- strcat (combined, err);
-
- error ("%s.", combined);
-}
-
-/* Print the system error message for ERRCODE, and also mention STRING
- as the file name for which the error was encountered. */
-
-void
-print_sys_errmsg (string, errcode)
- char *string;
- int errcode;
-{
- extern int sys_nerr;
- extern char *sys_errlist[];
- char *err;
- char *combined;
-
- if (errcode < sys_nerr)
- err = sys_errlist[errcode];
- else
- err = "unknown error";
-
- combined = (char *) alloca (strlen (err) + strlen (string) + 3);
- strcpy (combined, string);
- strcat (combined, ": ");
- strcat (combined, err);
-
- printf ("%s.\n", combined);
-}
-
-void
-quit ()
-{
- fflush (stdout);
- ioctl (fileno (stdout), TIOCFLUSH, 0);
- error ("Quit");
-}
-
-/* Control C comes here */
-
-void
-request_quit ()
-{
- quit_flag = 1;
- if (immediate_quit)
- quit ();
-}
-
-/* Print an error message and return to command level.
- STRING is the error message, used as a fprintf string,
- and ARG is passed as an argument to it. */
-
-void
-error (string, arg1, arg2, arg3)
- char *string;
- int arg1, arg2, arg3;
-{
- fflush (stdout);
- fprintf (stderr, string, arg1, arg2, arg3);
- fprintf (stderr, "\n");
- /************return_to_top_level ();************/
-}
-
-/* Print an error message and exit reporting failure.
- This is for a error that we cannot continue from.
- STRING and ARG are passed to fprintf. */
-
-void
-fatal (string, arg)
- char *string;
- int arg;
-{
- fprintf (stderr, "gdb: ");
- fprintf (stderr, string, arg);
- fprintf (stderr, "\n");
- exit (1);
-}
-
-/* Make a copy of the string at PTR with SIZE characters
- (and add a null character at the end in the copy).
- Uses malloc to get the space. Returns the address of the copy. */
-
-char *
-savestring (ptr, size)
- char *ptr;
- int size;
-{
- register char *p = (char *) xmalloc (size + 1);
- bcopy (ptr, p, size);
- p[size] = 0;
- return p;
-}
-
-char *
-concat (s1, s2, s3)
- char *s1, *s2, *s3;
-{
- register int len = strlen (s1) + strlen (s2) + strlen (s3) + 1;
- register char *val = (char *) xmalloc (len);
- strcpy (val, s1);
- strcat (val, s2);
- strcat (val, s3);
- return val;
-}
-
-void
-print_spaces (n, file)
- register int n;
- register FILE *file;
-{
- while (n-- > 0)
- fputc (' ', file);
-}
-
-/* Ask user a y-or-n question and return 1 iff answer is yes.
- Takes three args which are given to printf to print the question.
- The first, a control string, should end in "? ".
- It should not say how to answer, because we do that. */
-
-int
-query (ctlstr, arg1, arg2)
- char *ctlstr;
-{
- register int answer;
-
- /* Automatically answer "yes" if input is not from a terminal. */
- /***********if (!input_from_terminal_p ())
- return 1; *************************/
-
- while (1)
- {
- printf (ctlstr, arg1, arg2);
- printf ("(y or n) ");
- fflush (stdout);
- answer = fgetc (stdin);
- clearerr (stdin); /* in case of C-d */
- if (answer != '\n')
- while (fgetc (stdin) != '\n') clearerr (stdin);
- if (answer >= 'a')
- answer -= 040;
- if (answer == 'Y')
- return 1;
- if (answer == 'N')
- return 0;
- printf ("Please answer y or n.\n");
- }
-}
-
-/* Parse a C escape sequence. STRING_PTR points to a variable
- containing a pointer to the string to parse. That pointer
- is updated past the characters we use. The value of the
- escape sequence is returned.
-
- A negative value means the sequence \ newline was seen,
- which is supposed to be equivalent to nothing at all.
-
- If \ is followed by a null character, we return a negative
- value and leave the string pointer pointing at the null character.
-
- If \ is followed by 000, we return 0 and leave the string pointer
- after the zeros. A value of 0 does not mean end of string. */
-
-int
-parse_escape (string_ptr)
- char **string_ptr;
-{
- register int c = *(*string_ptr)++;
- switch (c)
- {
- case 'a':
- return '\a';
- case 'b':
- return '\b';
- case 'e':
- return 033;
- case 'f':
- return '\f';
- case 'n':
- return '\n';
- case 'r':
- return '\r';
- case 't':
- return '\t';
- case 'v':
- return '\v';
- case '\n':
- return -2;
- case 0:
- (*string_ptr)--;
- return 0;
- case '^':
- c = *(*string_ptr)++;
- if (c == '\\')
- c = parse_escape (string_ptr);
- if (c == '?')
- return 0177;
- return (c & 0200) | (c & 037);
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- {
- register int i = c - '0';
- register int count = 0;
- while (++count < 3)
- {
- if ((c = *(*string_ptr)++) >= '0' && c <= '7')
- {
- i *= 8;
- i += c - '0';
- }
- else
- {
- (*string_ptr)--;
- break;
- }
- }
- return i;
- }
- default:
- return c;
- }
-}
-
-void
-printchar (ch, stream)
- unsigned char ch;
- FILE *stream;
-{
- register int c = ch;
- if (c < 040 || c >= 0177)
- {
- if (c == '\n')
- fprintf (stream, "\\n");
- else if (c == '\b')
- fprintf (stream, "\\b");
- else if (c == '\t')
- fprintf (stream, "\\t");
- else if (c == '\f')
- fprintf (stream, "\\f");
- else if (c == '\r')
- fprintf (stream, "\\r");
- else if (c == 033)
- fprintf (stream, "\\e");
- else if (c == '\a')
- fprintf (stream, "\\a");
- else
- fprintf (stream, "\\%03o", c);
- }
- else
- {
- if (c == '\\' || c == '"' || c == '\'')
- fputc ('\\', stream);
- fputc (c, stream);
- }
-}
-SHAR_EOF
-cat << \SHAR_EOF > remote_inflow.c
-/* Low level interface to ptrace, for GDB when running under Unix.
- Copyright (C) 1986, 1987 Free Software Foundation, Inc.
-*/
-
-#include "defs.h"
-#include "param.h"
-#include "wait.h"
-#include "frame.h"
-#include "inferior.h"
-/***************************
-#include "initialize.h"
-****************************/
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <sgtty.h>
-#include <fcntl.h>
-
-/***************Begin MY defs*********************/
-int quit_flag = 0;
-char registers[REGISTER_BYTES];
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-
-char buf2[MAX_REGISTER_RAW_SIZE];
-/***************End MY defs*********************/
-
-#ifdef NEW_SUN_PTRACE
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-#endif
-
-extern char **environ;
-extern int errno;
-extern int inferior_pid;
-void error(), quit(), perror_with_name();
-int query();
-void supply_register(), write_register();
-CORE_ADDR read_register();
-
-/* Nonzero if we are debugging an attached outside process
- rather than an inferior. */
-
-
-/* Start an inferior process and returns its pid.
- ALLARGS is a vector of program-name and args.
- ENV is the environment vector to pass. */
-
-int
-create_inferior (allargs, env)
- char **allargs;
- char **env;
-{
- int pid;
- extern int sys_nerr;
- extern char *sys_errlist[];
- extern int errno;
-
- /* exec is said to fail if the executable is open. */
- /****************close_exec_file ();*****************/
-
- pid = vfork ();
- if (pid < 0)
- perror_with_name ("vfork");
-
- if (pid == 0)
- {
- /* Run inferior in a separate process group. */
- setpgrp (getpid (), getpid ());
-
-/* Not needed on Sun, at least, and loses there
- because it clobbers the superior. */
-/*??? signal (SIGQUIT, SIG_DFL);
- signal (SIGINT, SIG_DFL); */
-
- errno = 0;
- ptrace (0);
-
- execle ("/bin/sh", "sh", "-c", allargs, 0, env);
-
- fprintf (stderr, "Cannot exec /bin/sh: %s.\n",
- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
- fflush (stderr);
- _exit (0177);
- }
- return pid;
-}
-
-/* Kill the inferior process. Make us have no inferior. */
-
-kill_inferior ()
-{
- if (inferior_pid == 0)
- return;
- ptrace (8, inferior_pid, 0, 0);
- wait (0);
- /*************inferior_died ();****VK**************/
-}
-
-/* Resume execution of the inferior process.
- If STEP is nonzero, single-step it.
- If SIGNAL is nonzero, give it that signal. */
-
-unsigned char
-resume (step, signal,status)
- int step;
- int signal;
- char *status;
-{
- int pid ;
- WAITTYPE w;
-
- errno = 0;
- ptrace (step ? 9 : 7, inferior_pid, 1, signal);
- if (errno)
- perror_with_name ("ptrace");
- pid = wait(&w);
- if(pid != inferior_pid)
- perror_with_name ("wait");
-
- if(WIFEXITED(w))
- {
- printf("\nchild exited with retcode = %x \n",WRETCODE(w));
- *status = 'E';
- return((unsigned char) WRETCODE(w));
- }
- else if(!WIFSTOPPED(w))
- {
- printf("\nchild did terminated with signal = %x \n",WTERMSIG(w));
- *status = 'T';
- return((unsigned char) WTERMSIG(w));
- }
- else
- {
- printf("\nchild stopped with signal = %x \n",WSTOPSIG(w));
- *status = 'S';
- return((unsigned char) WSTOPSIG(w));
- }
-
-}
-
-
-#ifdef NEW_SUN_PTRACE
-
-void
-fetch_inferior_registers ()
-{
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- extern char registers[];
-
- ptrace (PTRACE_GETREGS, inferior_pid, &inferior_registers);
- if (errno)
- perror_with_name ("ptrace");
- /**********debugging begin **********/
- print_some_registers(&inferior_registers);
- /**********debugging end **********/
- ptrace (PTRACE_GETFPREGS, inferior_pid, &inferior_fp_registers);
- if (errno)
- perror_with_name ("ptrace");
-
- bcopy (&inferior_registers, registers, 16 * 4);
- bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.fps_regs);
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
- bcopy (&inferior_fp_registers.fps_control,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- int regno;
-{
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- extern char registers[];
-
- bcopy (registers, &inferior_registers, 16 * 4);
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
- sizeof inferior_fp_registers.fps_regs);
- inferior_registers.r_ps = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_registers.r_pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
- bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &inferior_fp_registers.fps_control,
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-
- ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
- if (errno)
- perror_with_name ("ptrace");
- ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers);
- if (errno)
- perror_with_name ("ptrace");
-}
-
-#endif /* not NEW_SUN_PTRACE */
-
-
-/* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory
- in the NEW_SUN_PTRACE case.
- It ought to be straightforward. But it appears that writing did
- not write the data that I specified. I cannot understand where
- it got the data that it actually did write. */
-
-/* Copy LEN bytes from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. */
-
-read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & - sizeof (int);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
- /* Allocate buffer of that many longwords. */
- register int *buffer = (int *) alloca (count * sizeof (int));
-
- /* Read all the longwords */
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- buffer[i] = ptrace (1, inferior_pid, addr, 0);
- }
-
- /* Copy appropriate bytes out of the buffer. */
- bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR.
- On failure (cannot write the inferior)
- returns the value of errno. */
-
-int
-write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & - sizeof (int);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
- /* Allocate buffer of that many longwords. */
- register int *buffer = (int *) alloca (count * sizeof (int));
- extern int errno;
-
- /* Fill start and end extra bytes of buffer with existing memory data. */
-
- buffer[0] = ptrace (1, inferior_pid, addr, 0);
-
- if (count > 1)
- {
- buffer[count - 1]
- = ptrace (1, inferior_pid,
- addr + (count - 1) * sizeof (int), 0);
- }
-
- /* Copy data to be written over corresponding part of buffer */
-
- bcopy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
-
- /* Write the entire buffer. */
-
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- errno = 0;
- ptrace (4, inferior_pid, addr, buffer[i]);
- if (errno)
- return errno;
- }
-
- return 0;
-}
-
-void
-try_writing_regs_command ()
-{
- register int i;
- register int value;
- extern int errno;
-
- if (inferior_pid == 0)
- error ("There is no inferior process now.");
-
- fetch_inferior_registers();
- for (i = 0;i<18 ; i ++)
- {
- QUIT;
- errno = 0;
- value = read_register(i);
- write_register ( i, value);
- if (errno == 0)
- {
- printf (" Succeeded with register %d; value 0x%x (%d).\n",
- i, value, value);
- }
- else
- printf (" Failed with register %d.\n", i);
- }
-}
-
-void
-initialize ()
-{
-
- inferior_pid = 0;
-
-
-}
-
-
-/* Return the contents of register REGNO,
- regarding it as an integer. */
-
-CORE_ADDR
-read_register (regno)
- int regno;
-{
- /* This loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
- return *(int *) &registers[REGISTER_BYTE (regno)];
-}
-
-/* Store VALUE in the register number REGNO, regarded as an integer. */
-
-void
-write_register (regno, val)
- int regno, val;
-{
- /* This loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
- *(int *) &registers[REGISTER_BYTE (regno)] = val;
-
- if (have_inferior_p ())
- store_inferior_registers (regno);
-}
-
-
-int
-have_inferior_p ()
-{
- return inferior_pid != 0;
-}
-
-print_some_registers(regs)
-int regs[];
-{
- register int i;
- for (i = 0; i < 18; i++) {
- printf("reg[%d] = %x\n", i, regs[i]);
- }
-}
-
-SHAR_EOF
-cat << \SHAR_EOF > remote_server.c
-/* Main code for remote server for GDB, the GNU Debugger.
- Copyright (C) 1989 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "param.h"
-#include <stdio.h>
-
-void read_inferior_memory(), fetch_inferior_registers();
-unsigned char resume();
-void kill_inferior();
-void initialize(), try_writing_regs_command();
-int create_inferior(), read_register();
-
-extern char registers[];
-int inferior_pid;
-extern char **environ;
-
-/* Descriptor for I/O to remote machine. */
-int remote_desc;
-int kiodebug = 0;
-int remote_debugging;
-
-void remote_send ();
-void putpkt ();
-void getpkt ();
-void remote_open();
-void write_ok();
-void write_enn();
-void convert_ascii_to_int();
-void convert_int_to_ascii();
-void prepare_resume_reply();
-void decode_m_packet();
-void decode_M_packet();
-
-
-main(argc,argv)
-int argc; char *argv[];
-{
- char ch,status, own_buf[2000], mem_buf[2000];
- int i=0;
- unsigned char signal;
- unsigned int mem_addr, len;
-
- initialize();
- printf("\nwill open serial link\n");
- remote_open("/dev/ttya",0);
-
- if(argc < 2)
- {
- printf("Enter name of program to be run with command line args\n");
- gets(own_buf);
- inferior_pid = create_inferior(own_buf,environ);
- printf("\nProcess %s created; pid = %d\n",own_buf,inferior_pid);
- }
- else
- {
- inferior_pid = create_inferior(argv[1],environ);
- printf("\nProcess %s created; pid = %d\n",argv[1],inferior_pid);
- }
-
- do {
- getpkt(own_buf);
- printf("\nPacket received is>:%s\n",own_buf);
- i = 0;
- ch = own_buf[i++];
- switch (ch) {
- case 'h': /**********This is only for tweaking the gdb+ program *******/
- signal = resume(1,0,&status);
- prepare_resume_reply(own_buf,status,signal);
- break;
- /*************end tweak*************************************/
-
- case 'g': fetch_inferior_registers();
- convert_int_to_ascii(registers,own_buf,REGISTER_BYTES);
- break;
- case 'G': convert_ascii_to_int(&own_buf[1],registers,REGISTER_BYTES);
- if(store_inferior_registers(-1)==0)
- write_ok(own_buf);
- else
- write_enn(own_buf);
- break;
- case 'm': decode_m_packet(&own_buf[1],&mem_addr,&len);
- read_inferior_memory(mem_addr,mem_buf,len);
- convert_int_to_ascii(mem_buf,own_buf,len);
- break;
- case 'M': decode_M_packet(&own_buf[1],&mem_addr,&len,mem_buf);
- if(write_inferior_memory(mem_addr,mem_buf,len)==0)
- write_ok(own_buf);
- else
- write_enn(own_buf);
- break;
- case 'c': signal = resume(0,0,&status);
- printf("\nSignal received is >: %0x \n",signal);
- prepare_resume_reply(own_buf,status,signal);
- break;
- case 's': signal = resume(1,0,&status);
- prepare_resume_reply(own_buf,status,signal);
- break;
- case 'k': kill_inferior();
- sprintf(own_buf,"q");
- putpkt(own_buf);
- printf("\nObtained kill request...terminating\n");
- close(remote_desc);
- exit(0);
- case 't': try_writing_regs_command();
- own_buf[0] = '\0';
- break;
- default : printf("\nUnknown option chosen by master\n");
- write_enn(own_buf);
- break;
- }
-
- putpkt(own_buf);
- } while(1) ;
-
- close(remote_desc);
- /** now get out of here**/
- printf("\nFinished reading data from serial link - Bye!\n");
- exit(0);
-
-}
-
-SHAR_EOF
-cat << \SHAR_EOF > remote_utils.c
-/* Remote utility routines for the remote server for GDB, the GNU debugger.
- Copyright (C) 1986, 1989 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "param.h"
-#include <stdio.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <a.out.h>
-#include <sys/file.h>
-#include <sgtty.h>
-
-extern int remote_desc;
-extern int remote_debugging;
-extern int kiodebug;
-
-void remote_open();
-void remote_send();
-void putpkt();
-void getpkt();
-
-void write_ok();
-void write_enn();
-void convert_ascii_to_int();
-void convert_int_to_ascii();
-void prepare_resume_reply();
-
-/* Open a connection to a remote debugger.
- NAME is the filename used for communication. */
-
-void
-remote_open (name, from_tty)
- char *name;
- int from_tty;
-{
- struct sgttyb sg;
-
- remote_debugging = 0;
-
- remote_desc = open (name, O_RDWR);
- if (remote_desc < 0)
- printf("\ncould not open remote device\n");
-
- ioctl (remote_desc, TIOCGETP, &sg);
- sg.sg_flags = RAW;
- ioctl (remote_desc, TIOCSETP, &sg);
-
- if (from_tty)
- printf ("Remote debugging using %s\n", name);
- remote_debugging = 1;
-}
-
-/* Convert hex digit A to a number. */
-
-static int
-fromhex (a)
- int a;
-{
- if (a >= '0' && a <= '9')
- return a - '0';
- else if (a >= 'a' && a <= 'f')
- return a - 'a' + 10;
- else
- perror ("Reply contains invalid hex digit");
-}
-
-/* Convert number NIB to a hex digit. */
-
-static int
-tohex (nib)
- int nib;
-{
- if (nib < 10)
- return '0'+nib;
- else
- return 'a'+nib-10;
-}
-
-/* Send the command in BUF to the remote machine,
- and read the reply into BUF.
- Report an error if we get an error reply. */
-
-void
-remote_send (buf)
- char *buf;
-{
- putpkt (buf);
- getpkt (buf);
-
- if (buf[0] == 'E')
- perror ("Remote failure reply: %s", buf);
-}
-
-/* Send a packet to the remote machine, with error checking.
- The data of the packet is in BUF. */
-
-void
-putpkt (buf)
- char *buf;
-{
- int i;
- unsigned char csum = 0;
- char buf2[500];
- char buf3[1];
- int cnt = strlen (buf);
- char *p;
-
- if (kiodebug)
- fprintf (stderr, "Sending packet: %s\n", buf);
-
- /* Copy the packet into buffer BUF2, encapsulating it
- and giving it a checksum. */
-
- p = buf2;
- *p++ = '$';
-
- for (i = 0; i < cnt; i++)
- {
- csum += buf[i];
- *p++ = buf[i];
- }
- *p++ = '#';
- *p++ = tohex ((csum >> 4) & 0xf);
- *p++ = tohex (csum & 0xf);
-
- /* Send it over and over until we get a positive ack. */
-
- do {
- write (remote_desc, buf2, p - buf2);
- read (remote_desc, buf3, 1);
- } while (buf3[0] != '+');
-}
-
-static int
-readchar ()
-{
- char buf[1];
- while (read (remote_desc, buf, 1) != 1) ;
- return buf[0] & 0x7f;
-}
-
-/* Read a packet from the remote machine, with error checking,
- and store it in BUF. */
-
-void
-getpkt (buf)
- char *buf;
-{
- char *bp;
- unsigned char csum, c, c1, c2;
- extern kiodebug;
-
- while (1)
- {
- csum = 0;
- while ((c = readchar()) != '$');
-
- bp = buf;
- while (1)
- {
- c = readchar ();
- if (c == '#')
- break;
- *bp++ = c;
- csum += c;
- }
- *bp = 0;
-
- c1 = fromhex (readchar ());
- c2 = fromhex (readchar ());
- if (csum == (c1 << 4) + c2)
- break;
-
- printf ("Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n",
- (c1 << 4) + c2, csum, buf);
- write (remote_desc, "-", 1);
- }
-
- write (remote_desc, "+", 1);
-
- if (kiodebug)
- fprintf (stderr,"Packet received :%s\n", buf);
-}
-
-
-void
-write_ok(buf)
- char *buf;
-{
- buf[0] = 'O';
- buf[1] = 'k';
- buf[2] = '\0';
-}
-
-void
-write_enn(buf)
- char *buf;
-{
- buf[0] = 'E';
- buf[1] = 'N';
- buf[2] = 'N';
- buf[3] = '\0';
-}
-
-void
-convert_int_to_ascii(from,to,n)
-char *from, *to; int n;
-{
- int nib ;
- char ch;
- while( n-- )
- {
- ch = *from++;
- nib = ((ch & 0xf0) >> 4)& 0x0f;
- *to++ = tohex(nib);
- nib = ch & 0x0f;
- *to++ = tohex(nib);
- }
- *to++ = 0;
-}
-
-
-void
-convert_ascii_to_int(from,to,n)
-char *from, *to; int n;
-{
- int nib1,nib2 ;
- while( n-- )
- {
- nib1 = fromhex(*from++);
- nib2 = fromhex(*from++);
- *to++ = (((nib1 & 0x0f)<< 4)& 0xf0) | (nib2 & 0x0f);
- }
-}
-
-void
-prepare_resume_reply(buf,status,signal)
-char *buf ,status;
-unsigned char signal;
-{
- int nib;
- char ch;
-
- *buf++ = 'S';
- *buf++ = status;
- nib = ((signal & 0xf0) >> 4) ;
- *buf++ = tohex(nib);
- nib = signal & 0x0f;
- *buf++ = tohex(nib);
- *buf++ = 0;
-}
-
-void
-decode_m_packet(from,mem_addr_ptr,len_ptr)
-char *from;
-unsigned int *mem_addr_ptr, *len_ptr;
-{
- int i = 0, j = 0 ;
- char ch;
- *mem_addr_ptr = *len_ptr = 0;
- /************debugging begin************/
- printf("\nIn decode_m_packet");
- /************debugging end************/
-
- while((ch = from[i++]) != ',')
- {
- *mem_addr_ptr = *mem_addr_ptr << 4;
- *mem_addr_ptr |= fromhex(ch) & 0x0f;
- }
- /************debugging begin************/
- printf("\nFinished mem_addr part");
- /************debugging end************/
-
- for(j=0; j < 4; j++)
- {
- if((ch = from[i++]) == 0)
- break;
- *len_ptr = *len_ptr << 4;
- *len_ptr |= fromhex(ch) & 0x0f;
- }
- /************debugging begin************/
- printf("\nFinished len_ptr part");
- /************debugging end************/
-}
-
-void
-decode_M_packet(from,mem_addr_ptr,len_ptr,to)
-char *from, *to;
-unsigned int *mem_addr_ptr, *len_ptr;
-{
- int i = 0, j = 0 ;
- char ch;
- *mem_addr_ptr = *len_ptr = 0;
- /************debugging begin************/
- printf("\nIn decode_M_packet");
- /************debugging end************/
-
- while((ch = from[i++]) != ',')
- {
- *mem_addr_ptr = *mem_addr_ptr << 4;
- *mem_addr_ptr |= fromhex(ch) & 0x0f;
- }
- /************debugging begin************/
- printf("\nFinished mem_addr part: memaddr = %x",*mem_addr_ptr);
- /************debugging end************/
-
- while((ch = from[i++]) != ':')
- {
- *len_ptr = *len_ptr << 4;
- *len_ptr |= fromhex(ch) & 0x0f;
- }
- /************debugging begin************/
- printf("\nFinished len_ptr part: len = %d",*len_ptr);
- /************debugging end************/
-
- convert_ascii_to_int(&from[i++],to,*len_ptr);
-
- /************debugging begin************/
- printf("\nmembuf : %x",*(int *)to);
- /************debugging end************/
-}
-
-SHAR_EOF
-# End of shell archive
-exit 0
diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c
deleted file mode 100644
index 34bb3d2..0000000
--- a/gdb/remote-nindy.c
+++ /dev/null
@@ -1,969 +0,0 @@
-/* Memory-access and commands for remote NINDY process, for GDB.
- Copyright (C) 1990-1991 Free Software Foundation, Inc.
- Contributed by Intel Corporation. Modified from remote.c by Chris Benenati.
-
-GDB is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY. No author or distributor accepts responsibility to anyone
-for the consequences of using it or for whether it serves any
-particular purpose or works at all, unless he says so in writing.
-Refer to the GDB General Public License for full details.
-
-Everyone is granted permission to copy, modify and redistribute GDB,
-but only under the conditions described in the GDB General Public
-License. A copy of this license is supposed to have been given to you
-along with GDB so you can know your rights and responsibilities. It
-should be in a file named COPYING. Among other things, the copyright
-notice and this notice must be preserved on all copies.
-
-In other words, go ahead and share GDB, but don't try to stop
-anyone else from sharing it farther. Help stamp out software hoarding!
-*/
-
-/*
-Except for the data cache routines, this file bears little resemblence
-to remote.c. A new (although similar) protocol has been specified, and
-portions of the code are entirely dependent on having an i80960 with a
-NINDY ROM monitor at the other end of the line.
-*/
-
-/*****************************************************************************
- *
- * REMOTE COMMUNICATION PROTOCOL BETWEEN GDB960 AND THE NINDY ROM MONITOR.
- *
- *
- * MODES OF OPERATION
- * ----- -- ---------
- *
- * As far as NINDY is concerned, GDB is always in one of two modes: command
- * mode or passthrough mode.
- *
- * In command mode (the default) pre-defined packets containing requests
- * are sent by GDB to NINDY. NINDY never talks except in reponse to a request.
- *
- * Once the the user program is started, GDB enters passthrough mode, to give
- * the user program access to the terminal. GDB remains in this mode until
- * NINDY indicates that the program has stopped.
- *
- *
- * PASSTHROUGH MODE
- * ----------- ----
- *
- * GDB writes all input received from the keyboard directly to NINDY, and writes
- * all characters received from NINDY directly to the monitor.
- *
- * Keyboard input is neither buffered nor echoed to the monitor.
- *
- * GDB remains in passthrough mode until NINDY sends a single ^P character,
- * to indicate that the user process has stopped.
- *
- * Note:
- * GDB assumes NINDY performs a 'flushreg' when the user program stops.
- *
- *
- * COMMAND MODE
- * ------- ----
- *
- * All info (except for message ack and nak) is transferred between gdb
- * and the remote processor in messages of the following format:
- *
- * <info>#<checksum>
- *
- * where
- * # is a literal character
- *
- * <info> ASCII information; all numeric information is in the
- * form of hex digits ('0'-'9' and lowercase 'a'-'f').
- *
- * <checksum>
- * is a pair of ASCII hex digits representing an 8-bit
- * checksum formed by adding together each of the
- * characters in <info>.
- *
- * The receiver of a message always sends a single character to the sender
- * to indicate that the checksum was good ('+') or bad ('-'); the sender
- * re-transmits the entire message over until a '+' is received.
- *
- * In response to a command NINDY always sends back either data or
- * a result code of the form "Xnn", where "nn" are hex digits and "X00"
- * means no errors. (Exceptions: the "s" and "c" commands don't respond.)
- *
- * SEE THE HEADER OF THE FILE "gdb.c" IN THE NINDY MONITOR SOURCE CODE FOR A
- * FULL DESCRIPTION OF LEGAL COMMANDS.
- *
- * SEE THE FILE "stop.h" IN THE NINDY MONITOR SOURCE CODE FOR A LIST
- * OF STOP CODES.
- *
- ******************************************************************************/
-
-#include <stdio.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <setjmp.h>
-
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "bfd.h"
-#include "ieee-float.h"
-
-#include "wait.h"
-#include <sys/ioctl.h>
-#include <sys/file.h>
-#include <ctype.h>
-#include "nindy-share/ttycntl.h"
-#include "nindy-share/demux.h"
-#include "nindy-share/env.h"
-#include "nindy-share/stop.h"
-
-extern int unlink();
-extern char *getenv();
-extern char *mktemp();
-
-extern char *coffstrip();
-extern value call_function_by_hand ();
-extern void generic_mourn_inferior ();
-
-extern struct target_ops nindy_ops;
-extern jmp_buf to_top_level;
-extern FILE *instream;
-extern struct ext_format ext_format_i960; /* i960-tdep.c */
-
-extern char ninStopWhy ();
-
-int nindy_initial_brk; /* nonzero if want to send an initial BREAK to nindy */
-int nindy_old_protocol; /* nonzero if want to use old protocol */
-char *nindy_ttyname; /* name of tty to talk to nindy on, or null */
-
-#define DLE '\020' /* Character NINDY sends to indicate user program has
- * halted. */
-#define TRUE 1
-#define FALSE 0
-
-int nindy_fd = 0; /* Descriptor for I/O to NINDY */
-static int have_regs = 0; /* 1 iff regs read since i960 last halted */
-static int regs_changed = 0; /* 1 iff regs were modified since last read */
-
-extern char *exists();
-static void dcache_flush (), dcache_poke (), dcache_init();
-static int dcache_fetch ();
-
-/* FIXME, we can probably use the normal terminal_inferior stuff here.
- We have to do terminal_inferior and then set up the passthrough
- settings initially. Thereafter, terminal_ours and terminal_inferior
- will automatically swap the settings around for us. */
-
-/* Restore TTY to normal operation */
-
-static TTY_STRUCT orig_tty; /* TTY attributes before entering passthrough */
-
-static void
-restore_tty()
-{
- ioctl( 0, TIOCSETN, &orig_tty );
-}
-
-
-/* Recover from ^Z or ^C while remote process is running */
-
-static void (*old_ctrlc)(); /* Signal handlers before entering passthrough */
-
-#ifdef SIGTSTP
-static void (*old_ctrlz)();
-#endif
-
-static
-#ifdef USG
-void
-#endif
-cleanup()
-{
- restore_tty();
- signal(SIGINT, old_ctrlc);
-#ifdef SIGTSTP
- signal(SIGTSTP, old_ctrlz);
-#endif
- error("\n\nYou may need to reset the 80960 and/or reload your program.\n");
-}
-
-/* Clean up anything that needs cleaning when losing control. */
-
-static char *savename;
-
-static void
-nindy_close (quitting)
- int quitting;
-{
- if (nindy_fd)
- close (nindy_fd);
- nindy_fd = 0;
-
- if (savename)
- free (savename);
- savename = 0;
-}
-
-/* Open a connection to a remote debugger.
- FIXME, there should be a way to specify the various options that are
- now specified with gdb command-line options. (baud_rate, old_protocol,
- and initial_brk) */
-void
-nindy_open (name, from_tty)
- char *name; /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */
- int from_tty;
-{
-
- if (!name)
- error_no_arg ("serial port device name");
-
- target_preopen (from_tty);
-
- nindy_close (0);
-
- have_regs = regs_changed = 0;
- dcache_init();
-
- /* Allow user to interrupt the following -- we could hang if
- * there's no NINDY at the other end of the remote tty.
- */
- immediate_quit++;
- nindy_fd = ninConnect( name, baud_rate? baud_rate: "9600",
- nindy_initial_brk, !from_tty, nindy_old_protocol );
- immediate_quit--;
-
- if ( nindy_fd < 0 ){
- nindy_fd = 0;
- error( "Can't open tty '%s'", name );
- }
-
- savename = savestring (name, strlen (name));
- push_target (&nindy_ops);
- target_fetch_registers(-1);
-}
-
-/* User-initiated quit of nindy operations. */
-
-static void
-nindy_detach (name, from_tty)
- char *name;
- int from_tty;
-{
- if (name)
- error ("Too many arguments");
- pop_target ();
-}
-
-static void
-nindy_files_info ()
-{
- printf("\tAttached to %s at %s bps%s%s.\n", savename,
- baud_rate? baud_rate: "9600",
- nindy_old_protocol? " in old protocol": "",
- nindy_initial_brk? " with initial break": "");
-}
-
-/******************************************************************************
- * remote_load:
- * Download an object file to the remote system by invoking the "comm960"
- * utility. We look for "comm960" in $G960BIN, $G960BASE/bin, and
- * DEFAULT_BASE/bin/HOST/bin where
- * DEFAULT_BASE is defined in env.h, and
- * HOST must be defined on the compiler invocation line.
- ******************************************************************************/
-
-static void
-nindy_load( filename, from_tty )
- char *filename;
- int from_tty;
-{
- char *tmpfile;
- struct cleanup *old_chain;
- char *scratch_pathname;
- int scratch_chan;
-
- if (!filename)
- filename = get_exec_file (1);
-
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
- &scratch_pathname);
- if (scratch_chan < 0)
- perror_with_name (filename);
- close (scratch_chan); /* Slightly wasteful FIXME */
-
- have_regs = regs_changed = 0;
- mark_breakpoints_out();
- inferior_pid = 0;
- dcache_flush();
-
- tmpfile = coffstrip(scratch_pathname);
- if ( tmpfile ){
- old_chain = make_cleanup(unlink,tmpfile);
- immediate_quit++;
- ninDownload( tmpfile, !from_tty );
-/* FIXME, don't we want this merged in here? */
- immediate_quit--;
- do_cleanups (old_chain);
- }
-}
-
-
-
-/* Return the number of characters in the buffer before the first DLE character.
- */
-
-static
-int
-non_dle( buf, n )
- char *buf; /* Character buffer; NOT '\0'-terminated */
- int n; /* Number of characters in buffer */
-{
- int i;
-
- for ( i = 0; i < n; i++ ){
- if ( buf[i] == DLE ){
- break;
- }
- }
- return i;
-}
-
-/* Tell the remote machine to resume. */
-
-void
-nindy_resume (step, siggnal)
- int step, siggnal;
-{
- if (siggnal != 0 && siggnal != stop_signal)
- error ("Can't send signals to remote NINDY targets.");
-
- dcache_flush();
- if ( regs_changed ){
- nindy_store_registers ();
- regs_changed = 0;
- }
- have_regs = 0;
- ninGo( step );
-}
-
-/* Wait until the remote machine stops. While waiting, operate in passthrough
- * mode; i.e., pass everything NINDY sends to stdout, and everything from
- * stdin to NINDY.
- *
- * Return to caller, storing status in 'status' just as `wait' would.
- */
-
-void
-nindy_wait( status )
- WAITTYPE *status;
-{
- DEMUX_DECL; /* OS-dependent data needed by DEMUX... macros */
- char buf[500]; /* FIXME, what is "500" here? */
- int i, n;
- unsigned char stop_exit;
- unsigned char stop_code;
- TTY_STRUCT tty;
- long ip_value, fp_value, sp_value; /* Reg values from stop */
-
-
- WSETEXIT( (*status), 0 );
-
- /* OPERATE IN PASSTHROUGH MODE UNTIL NINDY SENDS A DLE CHARACTER */
-
- /* Save current tty attributes, set up signals to restore them.
- */
- ioctl( 0, TIOCGETP, &orig_tty );
- old_ctrlc = signal( SIGINT, cleanup );
-#ifdef SIGTSTP
- old_ctrlz = signal( SIGTSTP, cleanup );
-#endif
-
- /* Pass input from keyboard to NINDY as it arrives.
- * NINDY will interpret <CR> and perform echo.
- */
- tty = orig_tty;
- TTY_NINDYTERM( tty );
- ioctl( 0, TIOCSETN, &tty );
-
- while ( 1 ){
- /* Go to sleep until there's something for us on either
- * the remote port or stdin.
- */
-
- DEMUX_WAIT( nindy_fd );
-
- /* Pass input through to correct place */
-
- n = DEMUX_READ( 0, buf, sizeof(buf) );
- if ( n ){ /* Input on stdin */
- write( nindy_fd, buf, n );
- }
-
- n = DEMUX_READ( nindy_fd, buf, sizeof(buf) );
- if ( n ){ /* Input on remote */
- /* Write out any characters in buffer preceding DLE */
- i = non_dle( buf, n );
- if ( i > 0 ){
- write( 1, buf, i );
- }
-
- if ( i != n ){
- /* There *was* a DLE in the buffer */
- stop_exit = ninStopWhy( &stop_code,
- &ip_value, &fp_value, &sp_value);
- if ( !stop_exit && (stop_code==STOP_SRQ) ){
- immediate_quit++;
- ninSrq();
- immediate_quit--;
- } else {
- /* Get out of loop */
- supply_register (IP_REGNUM, &ip_value);
- supply_register (FP_REGNUM, &fp_value);
- supply_register (SP_REGNUM, &sp_value);
- break;
- }
- }
- }
- }
-
- signal( SIGINT, old_ctrlc );
-#ifdef SIGTSTP
- signal( SIGTSTP, old_ctrlz );
-#endif
- restore_tty();
-
- if ( stop_exit ){ /* User program exited */
- WSETEXIT( (*status), stop_code );
- } else { /* Fault or trace */
- switch (stop_code){
- case STOP_GDB_BPT:
- case TRACE_STEP:
- /* Make it look like a VAX trace trap */
- stop_code = SIGTRAP;
- break;
- default:
- /* The target is not running Unix, and its
- faults/traces do not map nicely into Unix signals.
- Make sure they do not get confused with Unix signals
- by numbering them with values higher than the highest
- legal Unix signal. code in i960_print_fault(),
- called via PRINT_RANDOM_SIGNAL, will interpret the
- value. */
- stop_code += NSIG;
- break;
- }
- WSETSTOP( (*status), stop_code );
- }
-}
-
-/* Read the remote registers into the block REGS. */
-
-/* This is the block that ninRegsGet and ninRegsPut handles. */
-struct nindy_regs {
- char local_regs[16 * 4];
- char global_regs[16 * 4];
- char pcw_acw[2 * 4];
- char ip[4];
- char tcw[4];
- char fp_as_double[4 * 8];
-};
-
-static int
-nindy_fetch_registers(regno)
- int regno;
-{
- struct nindy_regs nindy_regs;
- int regnum, inv;
- double dub;
-
- immediate_quit++;
- ninRegsGet( (char *) &nindy_regs );
- immediate_quit--;
-
- bcopy (nindy_regs.local_regs, &registers[REGISTER_BYTE (R0_REGNUM)], 16*4);
- bcopy (nindy_regs.global_regs, &registers[REGISTER_BYTE (G0_REGNUM)], 16*4);
- bcopy (nindy_regs.pcw_acw, &registers[REGISTER_BYTE (PCW_REGNUM)], 2*4);
- bcopy (nindy_regs.ip, &registers[REGISTER_BYTE (IP_REGNUM)], 1*4);
- bcopy (nindy_regs.tcw, &registers[REGISTER_BYTE (TCW_REGNUM)], 1*4);
- for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++) {
- dub = unpack_double (builtin_type_double,
- &nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)],
- &inv);
- /* dub now in host byte order */
- double_to_ieee_extended (&ext_format_i960, &dub,
- &registers[REGISTER_BYTE (regnum)]);
- }
-
- registers_fetched ();
- return 0;
-}
-
-static void
-nindy_prepare_to_store()
-{
- nindy_fetch_registers(-1);
-}
-
-static int
-nindy_store_registers(regno)
- int regno;
-{
- struct nindy_regs nindy_regs;
- int regnum, inv;
- double dub;
-
- bcopy (&registers[REGISTER_BYTE (R0_REGNUM)], nindy_regs.local_regs, 16*4);
- bcopy (&registers[REGISTER_BYTE (G0_REGNUM)], nindy_regs.global_regs, 16*4);
- bcopy (&registers[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2*4);
- bcopy (&registers[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1*4);
- bcopy (&registers[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw, 1*4);
- /* Float regs. Only works on IEEE_FLOAT hosts. */
- for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++) {
- ieee_extended_to_double (&ext_format_i960,
- &registers[REGISTER_BYTE (regnum)], &dub);
- /* dub now in host byte order */
- /* FIXME-someday, the arguments to unpack_double are backward.
- It expects a target double and returns a host; we pass the opposite.
- This mostly works but not quite. */
- dub = unpack_double (builtin_type_double, &dub, &inv);
- /* dub now in target byte order */
- bcopy ((char *)&dub, &nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)],
- 8);
- }
-
- immediate_quit++;
- ninRegsPut( (char *) &nindy_regs );
- immediate_quit--;
- return 0;
-}
-
-/* Read a word from remote address ADDR and return it.
- * This goes through the data cache.
- */
-int
-nindy_fetch_word (addr)
- CORE_ADDR addr;
-{
- return dcache_fetch (addr);
-}
-
-/* Write a word WORD into remote address ADDR.
- This goes through the data cache. */
-
-void
-nindy_store_word (addr, word)
- CORE_ADDR addr;
- int word;
-{
- dcache_poke (addr, word);
-}
-
-/* Copy LEN bytes to or from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. Copy to inferior if
- WRITE is nonzero. Returns the length copied.
-
- This is stolen almost directly from infptrace.c's child_xfer_memory,
- which also deals with a word-oriented memory interface. Sometime,
- FIXME, rewrite this to not use the word-oriented routines. */
-
-int
-nindy_xfer_inferior_memory(memaddr, myaddr, len, write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
- struct target_ops *target; /* ignored */
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & - sizeof (int);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
- /* Allocate buffer of that many longwords. */
- register int *buffer = (int *) alloca (count * sizeof (int));
-
- if (write)
- {
- /* Fill start and end extra bytes of buffer with existing memory data. */
-
- if (addr != memaddr || len < (int)sizeof (int)) {
- /* Need part of initial word -- fetch it. */
- buffer[0] = nindy_fetch_word (addr);
- }
-
- if (count > 1) /* FIXME, avoid if even boundary */
- {
- buffer[count - 1]
- = nindy_fetch_word (addr + (count - 1) * sizeof (int));
- }
-
- /* Copy data to be written over corresponding part of buffer */
-
- bcopy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
-
- /* Write the entire buffer. */
-
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- errno = 0;
- nindy_store_word (addr, buffer[i]);
- if (errno)
- return 0;
- }
- }
- else
- {
- /* Read all the longwords */
- for (i = 0; i < count; i++, addr += sizeof (int))
- {
- errno = 0;
- buffer[i] = nindy_fetch_word (addr);
- if (errno)
- return 0;
- QUIT;
- }
-
- /* Copy appropriate bytes out of the buffer. */
- bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
- }
- return len;
-}
-
-/* The data cache records all the data read from the remote machine
- since the last time it stopped.
-
- Each cache block holds 16 bytes of data
- starting at a multiple-of-16 address. */
-
-#define DCACHE_SIZE 64 /* Number of cache blocks */
-
-struct dcache_block {
- struct dcache_block *next, *last;
- unsigned int addr; /* Address for which data is recorded. */
- int data[4];
-};
-
-struct dcache_block dcache_free, dcache_valid;
-
-/* Free all the data cache blocks, thus discarding all cached data. */
-static
-void
-dcache_flush ()
-{
- register struct dcache_block *db;
-
- while ((db = dcache_valid.next) != &dcache_valid)
- {
- remque (db);
- insque (db, &dcache_free);
- }
-}
-
-/*
- * If addr is present in the dcache, return the address of the block
- * containing it.
- */
-static
-struct dcache_block *
-dcache_hit (addr)
- unsigned int addr;
-{
- register struct dcache_block *db;
-
- if (addr & 3)
- abort ();
-
- /* Search all cache blocks for one that is at this address. */
- db = dcache_valid.next;
- while (db != &dcache_valid)
- {
- if ((addr & 0xfffffff0) == db->addr)
- return db;
- db = db->next;
- }
- return NULL;
-}
-
-/* Return the int data at address ADDR in dcache block DC. */
-static
-int
-dcache_value (db, addr)
- struct dcache_block *db;
- unsigned int addr;
-{
- if (addr & 3)
- abort ();
- return (db->data[(addr>>2)&3]);
-}
-
-/* Get a free cache block, put or keep it on the valid list,
- and return its address. The caller should store into the block
- the address and data that it describes, then remque it from the
- free list and insert it into the valid list. This procedure
- prevents errors from creeping in if a ninMemGet is interrupted
- (which used to put garbage blocks in the valid list...). */
-static
-struct dcache_block *
-dcache_alloc ()
-{
- register struct dcache_block *db;
-
- if ((db = dcache_free.next) == &dcache_free)
- {
- /* If we can't get one from the free list, take last valid and put
- it on the free list. */
- db = dcache_valid.last;
- remque (db);
- insque (db, &dcache_free);
- }
-
- remque (db);
- insque (db, &dcache_valid);
- return (db);
-}
-
-/* Return the contents of the word at address ADDR in the remote machine,
- using the data cache. */
-static
-int
-dcache_fetch (addr)
- CORE_ADDR addr;
-{
- register struct dcache_block *db;
-
- db = dcache_hit (addr);
- if (db == 0)
- {
- db = dcache_alloc ();
- immediate_quit++;
- ninMemGet(addr & ~0xf, (unsigned char *)db->data, 16);
- immediate_quit--;
- db->addr = addr & ~0xf;
- remque (db); /* Off the free list */
- insque (db, &dcache_valid); /* On the valid list */
- }
- return (dcache_value (db, addr));
-}
-
-/* Write the word at ADDR both in the data cache and in the remote machine. */
-static void
-dcache_poke (addr, data)
- CORE_ADDR addr;
- int data;
-{
- register struct dcache_block *db;
-
- /* First make sure the word is IN the cache. DB is its cache block. */
- db = dcache_hit (addr);
- if (db == 0)
- {
- db = dcache_alloc ();
- immediate_quit++;
- ninMemGet(addr & ~0xf, (unsigned char *)db->data, 16);
- immediate_quit--;
- db->addr = addr & ~0xf;
- remque (db); /* Off the free list */
- insque (db, &dcache_valid); /* On the valid list */
- }
-
- /* Modify the word in the cache. */
- db->data[(addr>>2)&3] = data;
-
- /* Send the changed word. */
- immediate_quit++;
- ninMemPut(addr, (unsigned char *)&data, 4);
- immediate_quit--;
-}
-
-/* The cache itself. */
-struct dcache_block the_cache[DCACHE_SIZE];
-
-/* Initialize the data cache. */
-static void
-dcache_init ()
-{
- register i;
- register struct dcache_block *db;
-
- db = the_cache;
- dcache_free.next = dcache_free.last = &dcache_free;
- dcache_valid.next = dcache_valid.last = &dcache_valid;
- for (i=0;i<DCACHE_SIZE;i++,db++)
- insque (db, &dcache_free);
-}
-
-
-static void
-nindy_create_inferior (execfile, args, env)
- char *execfile;
- char *args;
- char **env;
-{
- int entry_pt;
- int pid;
-
- if (args && *args)
- error ("Can't pass arguments to remote NINDY process");
-
- if (execfile == 0 || exec_bfd == 0)
- error ("No exec file specified");
-
- entry_pt = (int) bfd_get_start_address (exec_bfd);
-
- pid = 42;
-
-#ifdef CREATE_INFERIOR_HOOK
- CREATE_INFERIOR_HOOK (pid);
-#endif
-
-/* The "process" (board) is already stopped awaiting our commands, and
- the program is already downloaded. We just set its PC and go. */
-
- inferior_pid = pid; /* Needed for wait_for_inferior below */
-
- clear_proceed_status ();
-
-#if defined (START_INFERIOR_HOOK)
- START_INFERIOR_HOOK ();
-#endif
-
- /* Tell wait_for_inferior that we've started a new process. */
- init_wait_for_inferior ();
-
- /* Set up the "saved terminal modes" of the inferior
- based on what modes we are starting it with. */
- target_terminal_init ();
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- /* remote_start(args); */
- /* trap_expected = 0; */
- /* insert_step_breakpoint (); FIXME, do we need this? */
- proceed ((CORE_ADDR)entry_pt, -1, 0); /* Let 'er rip... */
-}
-
-static void
-reset_command(args, from_tty)
- char *args;
- int from_tty;
-{
- if ( !nindy_fd ){
- error( "No target system to reset -- use 'target nindy' command.");
- }
- if ( query("Really reset the target system?",0,0) ){
- send_break( nindy_fd );
- tty_flush( nindy_fd );
- }
-}
-
-void
-nindy_kill (args, from_tty)
- char *args;
- int from_tty;
-{
- return; /* Ignore attempts to kill target system */
-}
-
-/* Clean up when a program exits.
-
- The program actually lives on in the remote processor's RAM, and may be
- run again without a download. Don't leave it full of breakpoint
- instructions. */
-
-void
-nindy_mourn_inferior ()
-{
- remove_breakpoints ();
- generic_mourn_inferior (); /* Do all the proper things now */
-}
-
-/* This routine is run as a hook, just before the main command loop is
- entered. If gdb is configured for the i960, but has not had its
- nindy target specified yet, this will loop prompting the user to do so.
-
- Unlike the loop provided by Intel, we actually let the user get out
- of this with a RETURN. This is useful when e.g. simply examining
- an i960 object file on the host system. */
-
-nindy_before_main_loop ()
-{
- char ttyname[100];
- char *p, *p2;
-
- setjmp(to_top_level);
- while (current_target != &nindy_ops) { /* remote tty not specified yet */
- if ( instream == stdin ){
- printf("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit: ");
- fflush( stdout );
- }
- fgets( ttyname, sizeof(ttyname)-1, stdin );
-
- /* Strip leading and trailing whitespace */
- for ( p = ttyname; isspace(*p); p++ ){
- ;
- }
- if ( *p == '\0' ){
- return; /* User just hit spaces or return, wants out */
- }
- for ( p2= p; !isspace(*p2) && (*p2 != '\0'); p2++ ){
- ;
- }
- *p2= '\0';
- if ( !strcmp("quit",p) ){
- exit(1);
- }
-
- nindy_open( p, 1 );
-
- /* Now that we have a tty open for talking to the remote machine,
- download the executable file if one was specified. */
- if ( !setjmp(to_top_level) && exec_bfd ) {
- target_load (bfd_get_filename (exec_bfd), 1);
- }
- }
-}
-
-/* Define the target subroutine names */
-
-struct target_ops nindy_ops = {
- "nindy", "Remote serial target in i960 NINDY-specific protocol",
- "Use a remote i960 system running NINDY connected by a serial line.\n\
-Specify the name of the device the serial line is connected to.\n\
-The speed (baud rate), whether to use the old NINDY protocol,\n\
-and whether to send a break on startup, are controlled by options\n\
-specified when you started GDB.",
- nindy_open, nindy_close,
- 0, nindy_detach, nindy_resume, nindy_wait,
- nindy_fetch_registers, nindy_store_registers,
- nindy_prepare_to_store, 0, 0, /* conv_from, conv_to */
- nindy_xfer_inferior_memory, nindy_files_info,
- 0, 0, /* insert_breakpoint, remove_breakpoint, */
- 0, 0, 0, 0, 0, /* Terminal crud */
- nindy_kill,
- nindy_load,
- call_function_by_hand,
- 0, /* lookup_symbol */
- nindy_create_inferior,
- nindy_mourn_inferior,
- process_stratum, 0, /* next */
- 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
- 0, 0, /* Section pointers */
- OPS_MAGIC, /* Always the last thing */
-};
-
-void
-_initialize_nindy ()
-{
- add_target (&nindy_ops);
- add_com ("reset", class_obscure, reset_command,
- "Send a 'break' to the remote target system.\n\
-Only useful if the target has been equipped with a circuit\n\
-to perform a hard reset when a break is detected.");
-}
diff --git a/gdb/remote-sa.m68k.shar b/gdb/remote-sa.m68k.shar
deleted file mode 100755
index aeb76e5..0000000
--- a/gdb/remote-sa.m68k.shar
+++ /dev/null
@@ -1,893 +0,0 @@
-# This is a shell archive. Remove anything before this line,
-# then unpack it by saving it in a file and typing "sh file".
-#
-# Wrapped by Glenn Engel <glenne@labgre> on Mon Jun 12 15:19:20 1989
-#
-# This archive contains:
-# remcom.c
-#
-
-LANG=""; export LANG
-PATH=/bin:/usr/bin:$PATH; export PATH
-
-echo x - remcom.c
-cat >remcom.c <<'@EOF'
-
-/****************************************************************************
-
- THIS SOFTWARE IS NOT COPYRIGHTED
-
- HP offers the following for use in the public domain. HP makes no
- warranty with regard to the software or it's performance and the
- user accepts the software "AS IS" with all faults.
-
- HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
- TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-****************************************************************************/
-
-/****************************************************************************
- * $Header$
- *
- * $Module name: remcom.c $
- * $Revision$
- * $Date$
- * $Contributor: Lake Stevens Instrument Division$
- *
- * $Description: low level support for gdb debugger. $
- *
- * $Considerations: only works on target hardware $
- *
- * $Written by: Glenn Engel $
- * $ModuleState: Experimental $
- *
- * $NOTES: See Below $
- *
- * To enable debugger support, two things need to happen. One, a
- * call to set_debug_traps() is necessary in order to allow any breakpoints
- * or error conditions to be properly intercepted and reported to gdb.
- * Two, a breakpoint needs to be generated to begin communication. This
- * is most easily accomplished by a call to breakpoint(). Breakpoint()
- * simulates a breakpoint by executing a trap #1.
- *
- * Some explanation is probably necessary to explain how exceptions are
- * handled. When an exception is encountered the 68000 pushes the current
- * program counter and status register onto the supervisor stack and then
- * transfers execution to a location specified in it's vector table.
- * The handlers for the exception vectors are hardwired to jmp to an address
- * given by the relation: (exception - 256) * 6. These are decending
- * addresses starting from -6, -12, -18, ... By allowing 6 bytes for
- * each entry, a jsr, jmp, bsr, ... can be used to enter the exception
- * handler. Using a jsr to handle an exception has an added benefit of
- * allowing a single handler to service several exceptions and use the
- * return address as the key differentiation. The vector number can be
- * computed from the return address by [ exception = (addr + 1530) / 6 ].
- * The sole purpose of the routine _catchException is to compute the
- * exception number and push it on the stack in place of the return address.
- * The external function exceptionHandler() is
- * used to attach a specific handler to a specific 68k exception.
- * For 68020 machines, the ability to have a return address around just
- * so the vector can be determined is not necessary because the '020 pushes an
- * extra word onto the stack containing the vector offset
- *
- * Because gdb will sometimes write to the stack area to execute function
- * calls, this program cannot rely on using the supervisor stack so it
- * uses it's own stack area reserved in the int array remcomStack.
- *
- *************
- *
- * The following gdb commands are supported:
- *
- * command function Return value
- *
- * g return the value of the CPU registers hex data or ENN
- * G set the value of the CPU registers OK or ENN
- *
- * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
- * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
- *
- * c Resume at current address SNN ( signal NN)
- * cAA..AA Continue at address AA..AA SNN
- *
- * s Step one instruction SNN
- * sAA..AA Step one instruction from AA..AA SNN
- *
- * k kill
- *
- * ? What was the last sigval ? SNN (signal NN)
- *
- * All commands and responses are sent with a packet which includes a
- * checksum. A packet consists of
- *
- * $<packet info>#<checksum>.
- *
- * where
- * <packet info> :: <characters representing the command or response>
- * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
- *
- * When a packet is received, it is first acknowledged with either '+' or '-'.
- * '+' indicates a successful transfer. '-' indicates a failed transfer.
- *
- * Example:
- *
- * Host: Reply:
- * $m0,10#2a +$00010203040506070809101112131415#42
- *
- ****************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-#include <setjmp.h>
-
-/************************************************************************
- *
- * external low-level support routines
- */
-typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
-typedef void (*Function)(); /* pointer to a function */
-
-extern putDebugChar(); /* write a single character */
-extern getDebugChar(); /* read and return a single char */
-
-extern Function exceptionHandler(); /* assign an exception handler */
-extern ExceptionHook exceptionHook; /* hook variable for errors/exceptions */
-
-
-/************************************************************************/
-/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
-/* at least NUMREGBYTES*2 are needed for register packets */
-#define BUFMAX 400
-
-static char initialized; /* boolean flag. != 0 means we've been initialized */
-
-int remote_debug = 0;
-/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
-
-char hexchars[]="0123456789abcdef";
-
-/* there are 180 bytes of registers on a 68020 w/68881 */
-/* many of the fpa registers are 12 byte (96 bit) registers */
-#define NUMREGBYTES 180
-enum regnames {D0,D1,D2,D3,D4,D5,D6,D7,
- A0,A1,A2,A3,A4,A5,A6,A7,
- PS,PC,
- FP0,FP1,FP2,FP3,FP4,FP5,FP6,FP7,
- FPCONTROL,FPSTATUS,FPIADDR
- };
-
-typedef struct FrameStruct
-{
- struct FrameStruct *previous;
- int exceptionPC; /* pc value when this frame created */
- int exceptionVector; /* cpu vector causing exception */
- short frameSize; /* size of cpu frame in words */
- short sr; /* for 68000, this not always sr */
- int pc;
- short format;
- int fsaveHeader;
- int morejunk[0]; /* exception frame, fp save... */
-} Frame;
-
-#define FRAMESIZE 500
-static Frame *lastFrame;
-static int frameStack[FRAMESIZE];
-
-/*
- * these should not be static cuz they can be used outside this module
- */
-int registers[NUMREGBYTES/4];
-int superStack;
-
-static int remcomStack[400];
-static int* stackPtr = &remcomStack[399];
-
-/*
- * In many cases, the system will want to continue exception processing
- * when a continue command is given.
- * oldExceptionHook is a function to invoke in this case.
- */
-
-static ExceptionHook oldExceptionHook;
-
-/* the size of the exception stack on the 68020 varies with the type of
- * exception. The following table is the number of WORDS used
- * for each exception format.
- */
-static short exceptionSize[] = { 4,4,6,4,4,4,4,4,29,10,16,46,4,4,4,4 };
-
-/************* jump buffer used for setjmp/longjmp **************************/
-jmp_buf env;
-
-/*************************** ASSEMBLY CODE MACROS *************************/
-/* */
-
-#ifdef __HAVE_68881__
-/* do an fsave, then remember the address to begin a restore from */
-#define SAVE_FP_REGS() asm(" fsave a0@-"); \
- asm(" fmovemx fp0-fp7,_registers+72"); \
- asm(" fmoveml fpcr/fpsr/fpi,_registers+168");
-#define RESTORE_FP_REGS() asm(" fmoveml _registers+168,fpcr/fpsr/fpi"); \
- asm(" fmovemx _registers+72,fp0-fp7"); \
- asm(" frestore a0@+");
-#else
-#define SAVE_FP_REGS()
-#define RESTORE_FP_REGS()
-#endif /* __HAVE_68881__ */
-
-asm("
-.text
-.globl _return_to_super
-_return_to_super:
- movel _registers+60,sp /* get new stack pointer */
- movel _lastFrame,a0 /* get last frame info */
- bra return_to_any
-
-.globl _return_to_user
-_return_to_user:
- movel _registers+60,a0 /* get usp */
- movel a0,usp /* set usp */
- movel _superStack,sp /* get original stack pointer */
-
-return_to_any:
- movel _lastFrame,a0 /* get last frame info */
- movel a0@+,_lastFrame /* link in previous frame */
- addql #8,a0 /* skip over pc, vector#*/
- movew a0@+,d0 /* get # of words in cpu frame */
- addw d0,a0 /* point to end of data */
- addw d0,a0 /* point to end of data */
- movel a0,a1
-#
-# copy the stack frame
- subql #1,d0
-copyUserLoop:
- movew a1@-,sp@-
- dbf d0,copyUserLoop
-");
- RESTORE_FP_REGS()
- asm(" moveml _registers,d0-d7/a0-a6");
- asm(" rte"); /* pop and go! */
-
-#define DISABLE_INTERRUPTS() asm(" oriw #0x0700,sr");
-#define BREAKPOINT() asm(" trap #1");
-
-/* this function is called immediately when a level 7 interrupt occurs */
-/* if the previous interrupt level was 7 then we're already servicing */
-/* this interrupt and an rte is in order to return to the debugger. */
-/* For the 68000, the offset for sr is 6 due to the jsr return address */
-asm("
-.text
-.globl __debug_level7
-__debug_level7:
- movew d0,sp@-");
-#ifdef mc68020
-asm(" movew sp@(2),d0");
-#else
-asm(" movew sp@(6),d0");
-#endif
-asm(" andiw #0x700,d0
- cmpiw #0x700,d0
- beq _already7
- movew sp@+,d0
- bra __catchException
-_already7:
- movew sp@+,d0");
-#ifndef mc68020
-asm(" lea sp@(4),sp"); /* pull off 68000 return address */
-#endif
-asm(" rte");
-
-extern void _catchException();
-
-#ifdef mc68020
-/* This function is called when a 68020 exception occurs. It saves
- * all the cpu and fpcp regs in the _registers array, creates a frame on a
- * linked list of frames which has the cpu and fpcp stack frames needed
- * to properly restore the context of these processors, and invokes
- * an exception handler (remcom_handler).
- *
- * stack on entry: stack on exit:
- * N bytes of junk exception # MSWord
- * Exception Format Word exception # MSWord
- * Program counter LSWord
- * Program counter MSWord
- * Status Register
- *
- *
- */
-asm("
-.text
-.globl __catchException
-__catchException:");
-DISABLE_INTERRUPTS();
-asm("
- moveml d0-d7/a0-a6,_registers /* save registers */
- movel _lastFrame,a0 /* last frame pointer */
-");
-SAVE_FP_REGS();
-asm("
- lea _registers,a5 /* get address of registers */
- movew sp@,d1 /* get status register */
- movew d1,a5@(66) /* save sr */
- movel sp@(2),a4 /* save pc in a4 for later use */
- movel a4,a5@(68) /* save pc in _regisers[] */
-
-#
-# figure out how many bytes in the stack frame
- movew sp@(6),d0 /* get '020 exception format */
- movew d0,d2 /* make a copy of format word */
- andiw #0xf000,d0 /* mask off format type */
- rolw #5,d0 /* rotate into the low byte *2 */
- lea _exceptionSize,a1
- addw d0,a1 /* index into the table */
- movew a1@,d0 /* get number of words in frame */
- movew d0,d3 /* save it */
- subw d0,a0 /* adjust save pointer */
- subw d0,a0 /* adjust save pointer(bytes) */
- movel a0,a1 /* copy save pointer */
- subql #1,d0 /* predecrement loop counter */
-#
-# copy the frame
-saveFrameLoop:
- movew sp@+,a1@+
- dbf d0,saveFrameLoop
-#
-# now that the stack has been clenaed,
-# save the a7 in use at time of exception
- movel sp,_superStack /* save supervisor sp */
- andiw #0x2000,d1 /* were we in supervisor mode ? */
- beq userMode
- movel a7,a5@(60) /* save a7 */
- bra a7saveDone
-userMode:
- movel usp,a1
- movel a1,a5@(60) /* save user stack pointer */
-a7saveDone:
-
-#
-# save size of frame
- movew d3,a0@-
-
-#
-# compute exception number
- andl #0xfff,d2 /* mask off vector offset */
- lsrw #2,d2 /* divide by 4 to get vect num */
- movel d2,a0@- /* save it */
-#
-# save pc causing exception
- movel a4,a0@-
-#
-# save old frame link and set the new value
- movel _lastFrame,a1 /* last frame pointer */
- movel a1,a0@- /* save pointer to prev frame */
- movel a0,_lastFrame
-
- movel d2,sp@- /* push exception num */
- movel _exceptionHook,a0 /* get address of handler */
- jbsr a0@ /* and call it */
- jmp __returnFromException /* now, return */
-");
-#else /* mc68000 */
-/* This function is called when an exception occurs. It translates the
- * return address found on the stack into an exception vector # which
- * is then handled by either handle_exception or a system handler.
- * _catchException provides a front end for both.
- *
- * stack on entry: stack on exit:
- * Program counter MSWord exception # MSWord
- * Program counter LSWord exception # MSWord
- * Status Register
- * Return Address MSWord
- * Return Address LSWord
- */
-asm("
-.text
-.globl __catchException
-__catchException:");
-DISABLE_INTERRUPTS();
-asm("
- moveml d0-d7/a0-a6,_registers /* save registers */
- movel _lastFrame,a0 /* last frame pointer */
-");
-SAVE_FP_REGS();
-asm("
- lea _registers,a5 /* get address of registers */
- movel sp@+,d2 /* pop return address */
- addl #1530,d2 /* convert return addr to */
- divs #6,d2 /* exception number */
- extl d2
-
- moveql #3,d3 /* assume a three word frame */
-
- cmpiw #3,d2 /* bus error or address error ? */
- bgt normal /* if >3 then normal error */
- movel sp@+,a0@- /* copy error info to frame buff*/
- movel sp@+,a0@- /* these are never used */
- moveql #7,d3 /* this is a 7 word frame */
-
-normal:
- movew sp@+,d1 /* pop status register */
- movel sp@+,a4 /* pop program counter */
- movew d1,a5@(66) /* save sr */
- movel a4,a5@(68) /* save pc in _regisers[] */
- movel a4,a0@- /* copy pc to frame buffer */
- movew d1,a0@- /* copy sr to frame buffer */
-
- movel sp,_superStack /* save supervisor sp */
-
- andiw #0x2000,d1 /* were we in supervisor mode ? */
- beq userMode
- movel a7,a5@(60) /* save a7 */
- bra saveDone
-userMode:
- movel usp,a1 /* save user stack pointer */
- movel a1,a5@(60) /* save user stack pointer */
-saveDone:
-
- movew d3,a0@- /* push frame size in words */
- movel d2,a0@- /* push vector number */
- movel a4,a0@- /* push exception pc */
-
-#
-# save old frame link and set the new value
- movel _lastFrame,a1 /* last frame pointer */
- movel a1,a0@- /* save pointer to prev frame */
- movel a0,_lastFrame
-
- movel d2,sp@- /* push exception num */
- movel _exceptionHook,a0 /* get address of handler */
- jbsr a0@ /* and call it */
- jmp __returnFromException /* now, return */
-");
-#endif
-
-
-/*
- * remcomHandler is a front end for handle_exception. It moves the
- * stack pointer into an area reserved for debugger use in case the
- * breakpoint happened in supervisor mode.
- */
-asm("_remcomHandler:");
-asm(" addl #4,sp"); /* pop off return address */
-asm(" movel sp@+,d0"); /* get the exception number */
-asm(" movel _stackPtr,sp"); /* move to remcom stack area */
-asm(" movel d0,sp@-"); /* push exception onto stack */
-asm(" jbsr _handle_exception"); /* this never returns */
-asm(" rts"); /* return */
-
-void _returnFromException( Frame *frame )
-{
- /* if no existing frame, dummy one up */
- if (! frame)
- {
- frame = lastFrame -1;
- frame->frameSize = 4;
- frame->format = 0;
- frame->fsaveHeader = 0;
- frame->previous = lastFrame;
- }
-
-#ifndef mc68020
- /* a 68000 cannot use the internal info pushed onto a bus error
- * or address error frame when doing an RTE so don't put this info
- * onto the stack or the stack will creep every time this happens.
- */
- frame->frameSize=3;
-#endif
-
- /* throw away any frames in the list after this frame */
- lastFrame = frame;
-
- frame->sr = registers[(int) PS];
- frame->pc = registers[(int) PC];
-
- if (registers[(int) PS] & 0x2000)
- {
- /* return to supervisor mode... */
- return_to_super();
- }
- else
- { /* return to user mode */
- return_to_user();
- }
-}
-
-int hex(ch)
-char ch;
-{
- if ((ch >= 'a') && (ch <= 'f')) return (ch-'a'+10);
- if ((ch >= '0') && (ch <= '9')) return (ch-'0');
- return (0);
-}
-
-
-/* scan for the sequence $<data>#<checksum> */
-void getpacket(buffer)
-char * buffer;
-{
- unsigned char checksum;
- unsigned char xmitcsum;
- int i;
- int count;
- char ch;
-
- do {
- /* wait around for the start character, ignore all other characters */
- while ((ch = getDebugChar()) != '$');
- checksum = 0;
- count = 0;
-
- /* now, read until a # or end of buffer is found */
- while (count < BUFMAX) {
- ch = getDebugChar();
- if (ch == '#') break;
- checksum = checksum + ch;
- buffer[count] = ch;
- count = count + 1;
- }
- buffer[count] = 0;
-
- if (ch == '#') {
- xmitcsum = hex(getDebugChar()) << 4;
- xmitcsum += hex(getDebugChar());
- if ((remote_debug ) && (checksum != xmitcsum)) {
- fprintf(stderr,"bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
- checksum,xmitcsum,buffer);
- }
-
- if (checksum != xmitcsum) putDebugChar('-'); /* failed checksum */
- else {
- putDebugChar('+'); /* successful transfer */
- /* if a sequence char is present, reply the sequence ID */
- if (buffer[2] == ':') {
- putDebugChar( buffer[0] );
- putDebugChar( buffer[1] );
- /* remove sequence chars from buffer */
- count = strlen(buffer);
- for (i=3; i <= count; i++) buffer[i-3] = buffer[i];
- }
- }
- }
- } while (checksum != xmitcsum);
-
-}
-
-/* send the packet in buffer. The host get's one chance to read it.
- This routine does not wait for a positive acknowledge. */
-
-
-void putpacket(buffer)
-char * buffer;
-{
- unsigned char checksum;
- int count;
- char ch;
-
- /* $<packet info>#<checksum>. */
- do {
- putDebugChar('$');
- checksum = 0;
- count = 0;
-
- while (ch=buffer[count]) {
- if (! putDebugChar(ch)) return;
- checksum += ch;
- count += 1;
- }
-
- putDebugChar('#');
- putDebugChar(hexchars[checksum >> 4]);
- putDebugChar(hexchars[checksum % 16]);
-
- } while (1 == 0); /* (getDebugChar() != '+'); */
-
-}
-
-static char inbuffer[BUFMAX];
-static char outbuffer[BUFMAX];
-static short error;
-
-
-void debug_error(format, parm)
-char * format;
-char * parm;
-{
- if (remote_debug) fprintf(stderr,format,parm);
-}
-
-/* convert the memory pointed to by mem into hex, placing result in buf */
-/* return a pointer to the last char put in buf (null) */
-char* mem2hex(mem, buf, count)
-char* mem;
-char* buf;
-int count;
-{
- int i;
- unsigned char ch;
- for (i=0;i<count;i++) {
- ch = *mem++;
- *buf++ = hexchars[ch >> 4];
- *buf++ = hexchars[ch % 16];
- }
- *buf = 0;
- return(buf);
-}
-
-/* convert the hex array pointed to by buf into binary to be placed in mem */
-/* return a pointer to the character AFTER the last byte written */
-char* hex2mem(buf, mem, count)
-char* buf;
-char* mem;
-int count;
-{
- int i;
- unsigned char ch;
- for (i=0;i<count;i++) {
- ch = hex(*buf++) << 4;
- ch = ch + hex(*buf++);
- *mem++ = ch;
- }
- return(mem);
-}
-
-/* a bus error has occurred, perform a longjmp
- to return execution and allow handling of the error */
-
-void handle_buserror()
-{
- longjmp(env,1);
-}
-
-/* this function takes the 68000 exception number and attempts to
- translate this number into a unix compatible signal value */
-int computeSignal( exceptionVector )
-int exceptionVector;
-{
- int sigval;
- switch (exceptionVector) {
- case 2 : sigval = 10; break; /* bus error */
- case 3 : sigval = 10; break; /* address error */
- case 4 : sigval = 4; break; /* illegal instruction */
- case 5 : sigval = 8; break; /* zero divide */
- case 6 : sigval = 16; break; /* chk instruction */
- case 7 : sigval = 16; break; /* trapv instruction */
- case 8 : sigval = 11; break; /* privilege violation */
- case 9 : sigval = 5; break; /* trace trap */
- case 10: sigval = 4; break; /* line 1010 emulator */
- case 11: sigval = 4; break; /* line 1111 emulator */
- case 31: sigval = 2; break; /* interrupt */
- case 33: sigval = 5; break; /* breakpoint */
- case 40: sigval = 8; break; /* floating point err */
- case 48: sigval = 8; break; /* floating point err */
- case 49: sigval = 8; break; /* floating point err */
- case 50: sigval = 8; break; /* zero divide */
- case 51: sigval = 8; break; /* underflow */
- case 52: sigval = 8; break; /* operand error */
- case 53: sigval = 8; break; /* overflow */
- case 54: sigval = 8; break; /* NAN */
- default:
- sigval = 7; /* "software generated"*/
- }
- return (sigval);
-}
-
-/*
- * This function does all command procesing for interfacing to gdb.
- */
-void handle_exception(int exceptionVector)
-{
- int sigval;
- int addr, length;
- char * ptr;
- int newPC;
- Frame *frame;
-
- if (remote_debug) printf("vector=%d, sr=0x%x, pc=0x%x\n",
- exceptionVector,
- registers[ PS ],
- registers[ PC ]);
-
- /* reply to host that an exception has occurred */
- sigval = computeSignal( exceptionVector );
- sprintf(outbuffer,"S%02x",sigval);
- putpacket(outbuffer);
-
- while (1==1) {
- error = 0;
- outbuffer[0] = 0;
- getpacket(inbuffer);
- switch (inbuffer[0]) {
- case '?' : sprintf(outbuffer,"S%02x",sigval);
- break;
- case 'd' : remote_debug = !(remote_debug); /* toggle debug flag */
- break;
- case 'g' : /* return the value of the CPU registers */
- mem2hex((char*) registers, outbuffer, NUMREGBYTES);
- break;
- case 'G' : /* set the value of the CPU registers - return OK */
- hex2mem(&inbuffer[1], (char*) registers, NUMREGBYTES);
- strcpy(outbuffer,"OK");
- break;
-
- /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
- case 'm' :
- if (setjmp(env) == 0) {
- exceptionHandler(2,handle_buserror);
-
- if (2 == sscanf(&inbuffer[1],"%x,%x",&addr,&length)) {
- mem2hex((char*) addr, outbuffer, length);
- }
- else {
- strcpy(outbuffer,"E01");
- debug_error("malformed read memory command: %s",inbuffer);
- }
- }
- else {
- exceptionHandler(2,_catchException);
- strcpy(outbuffer,"E03");
- debug_error("bus error");
- }
-
- /* restore handler for bus error */
- exceptionHandler(2,_catchException);
- break;
-
- /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
- case 'M' :
- if (setjmp(env) == 0) {
- exceptionHandler(2,handle_buserror);
-
- if (2 == sscanf(&inbuffer[1],"%x,%x:",&addr,&length)) {
- ptr = strchr(inbuffer,':');
- ptr += 1; /* point 1 past the colon */
- hex2mem(ptr, (char*) addr, length);
- strcpy(outbuffer,"OK");
- }
- else {
- strcpy(outbuffer,"E02");
- debug_error("malformed write memory command: %s",inbuffer);
- }
- }
- else {
- exceptionHandler(2,_catchException);
- strcpy(outbuffer,"E03");
- debug_error("bus error");
- }
- break;
-
- /* cAA..AA Continue at address AA..AA(optional) */
- /* sAA..AA Step one instruction from AA..AA(optional) */
- case 'c' :
- case 's' :
- /* try to read optional parameter, addr unchanged if no parm */
- if (1 == sscanf(&inbuffer[1],"%x",&registers[ PC ]));
- newPC = registers[ PC];
-
- /* clear the trace bit */
- registers[ PS ] &= 0x7fff;
-
- /* set the trace bit if we're stepping */
- if (inbuffer[0] == 's') registers[ PS ] |= 0x8000;
-
- /*
- * look for newPC in the linked list of exception frames.
- * if it is found, use the old frame it. otherwise,
- * fake up a dummy frame in returnFromException().
- */
- if (remote_debug) printf("new pc = 0x%x\n",newPC);
- frame = lastFrame;
- while (frame)
- {
- if (remote_debug)
- printf("frame at 0x%x has pc=0x%x, except#=%d\n",
- frame,frame->exceptionPC,
- frame->exceptionVector);
- if (frame->exceptionPC == newPC) break; /* bingo! a match */
- /*
- * for a breakpoint instruction, the saved pc may
- * be off by two due to re-executing the instruction
- * replaced by the trap instruction. Check for this.
- */
- if ((frame->exceptionVector == 33) &&
- (frame->exceptionPC == (newPC+2))) break;
- frame = frame->previous;
- }
-
- /*
- * If we found a match for the PC AND we are not returning
- * as a result of a breakpoint (33),
- * trace exception (9), nmi (31), jmp to
- * the old exception handler as if this code never ran.
- */
- if (frame)
- {
- if ((frame->exceptionVector != 9) &&
- (frame->exceptionVector != 31) &&
- (frame->exceptionVector != 33))
- {
- /*
- * invoke the previous handler.
- */
- if (oldExceptionHook)
- (*oldExceptionHook) (frame->exceptionVector);
- newPC = registers[ PC ]; /* pc may have changed */
- if (newPC != frame->exceptionPC)
- {
- if (remote_debug)
- printf("frame at 0x%x has pc=0x%x, except#=%d\n",
- frame,frame->exceptionPC,
- frame->exceptionVector);
- /* dispose of this frame, we're skipping it (longjump?)*/
- lastFrame = frame->previous;
- frame = (Frame *) 0;
- }
- }
- }
-
- _returnFromException( frame );
-
- break;
-
- /* kill the program */
- case 'k' : /* do nothing */
- break;
- } /* switch */
-
- /* reply to the request */
- putpacket(outbuffer);
- }
-}
-
-
-/* this function is used to set up exception handlers for tracing and
- breakpoints */
-void set_debug_traps()
-{
-extern void _debug_level7();
-extern void remcomHandler();
-int exception;
-
- for (exception = 2; exception <= 23; exception++)
- exceptionHandler(exception,_catchException);
-
- /* level 7 interrupt */
- exceptionHandler(31,_debug_level7);
-
- /* breakpoint exception (trap #1) */
- exceptionHandler(33,_catchException);
-
- /* floating point error (trap #8) */
- exceptionHandler(40,_catchException);
-
- /* 48 to 54 are floating point coprocessor errors */
- for (exception = 48; exception <= 54; exception++)
- exceptionHandler(exception,_catchException);
-
- if (oldExceptionHook != remcomHandler)
- {
- oldExceptionHook = exceptionHook;
- exceptionHook = remcomHandler;
- }
-
- initialized = 1;
-
- lastFrame = (Frame *) &frameStack[FRAMESIZE-1];
- lastFrame->previous = (Frame *) 0;
-}
-
-/* This function will generate a breakpoint exception. It is used at the
- beginning of a program to sync up with a debugger and can be used
- otherwise as a quick means to stop program execution and "break" into
- the debugger. */
-
-void breakpoint()
-{
- if (initialized) BREAKPOINT();
-}
-
-@EOF
-
-chmod 444 remcom.c
-
-exit 0
-
diff --git a/gdb/remote-sa.sparc.c b/gdb/remote-sa.sparc.c
deleted file mode 100644
index 686699e..0000000
--- a/gdb/remote-sa.sparc.c
+++ /dev/null
@@ -1,1146 +0,0 @@
-/* THIS FILE HAS NOT HAD ITS COPYRIGHT CHECKED...FSF SHOULD NOT
- DISTRIBUTE IT UNTIL THIS HAPPENS. */
-
-/* Memory-access and commands for inferior process, for GDB.
-*/
-
-#include <sys/errno.h>
-#include <setjmp.h>
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "value.h"
-#include "inferior.h"
-#include "symtab.h"
-
-#undef WSTOPSIG
-#undef WTERMSIG
-#include "wait.h"
-
-#ifdef USG
-#include <sys/types.h>
-#include <fcntl.h>
-#endif
-
-#include <signal.h>
-#include <sys/file.h>
-
-#include <termios.h>
-#define TERMINAL struct termios
-
-#define LONGTIMEOUT 5
-#define SHORTTIMEOUT 1
-
-#define KD_MINUTAE 1
-#define KD_LINEDISCIPLINE 2
-#define KD_RETRY 4
-#define KD_BLOCKTRANSFER 8
-
-#ifndef STDIN
-#define STDIN 0
-#endif
-
-#define GL_READING 0 /* get line is reading data */
-#define GL_OK 1 /* Getline saw the "ok" string */
-#define GL_SUCCESS 2 /* Get line got data */
-#define GL_TIMEOUT 3 /* Get line timed out */
-#define GL_OVERRUN 4 /* Get line filled up the buffer */
-#define GL_EXCEPTION 5 /* Get line saw "Exception" */
-#define GL_PROMLINE 6 /* Get line saw prom specific info */
-#define GL_BLANKLINE 7 /* Get line saw a blank line */
-
-static int kiodebug /* = KD_RETRY | KD_BLOCKTRANSFER */;
-
-static CORE_ADDR remote_pc = 0;
-static CORE_ADDR remote_next_pc = 0;
-static CORE_ADDR remove_thisbp_next_pc = 0;
-static CORE_ADDR remove_thisbp_target = 0;
-
-enum showDrainage {DONTSHOW , SHOW} ;
-
-
-/* Descriptor for I/O to remote machine. Initialize it to -1 so that
- remote_open knows that we don't have a file open when the program
- starts. */
-int remote_desc = -1;
-
-int dontskipcrs = 0;
-
-#define PBUFSIZ 400
-
-unsigned char ignorebuf[PBUFSIZ];
-#define IGNORE &ignorebuf[0]
-
-/* Maximum number of bytes to read/write at once. The value here
- is chosen to fill up a packet (the headers account for the 32). */
-#define MAXBUFBYTES ((PBUFSIZ-32)/2)
-
-static void remote_send ();
-static void putpkt ();
-static int getpkt ();
-
-
-/* Open a connection to a remote debugger.
- NAME is the filename used for communication. */
-CORE_ADDR breakpoint_regs_addr;
-
-
-void
-remote_open (name, from_tty)
- char *name;
- int from_tty;
-{
- extern int frame_file_full_name;
- unsigned char buf[PBUFSIZ];
- TERMINAL sg;
-
- remote_debugging = 0;
-
- if (remote_desc >= 0)
- close (remote_desc);
-
- breakpoint_regs_addr = parse_and_eval_address("&breakpoint_regs");
-
- dontskipcrs = !frame_file_full_name; /* if we are running inside of
- emacs, this will be true.
- then skip carriage returns */
-
- remote_desc = open (name, O_RDWR);
- if (remote_desc < 0)
- perror_with_name (name);
-
- setup_remote();
-
- if (from_tty)
- printf ("Remote debugging using %s\n", name);
- remote_debugging = 1;
-
-
-}
-static char *boot_cmd = 0;
-
-static print_boot_cmd()
-{
- fprintf(stderr, "boot command set to be \"%s\"\n", boot_cmd);
-}
-
-remote_start()
-{
- WAITTYPE ignoredWaitType;
-
- if (boot_cmd)
- {
- sendbreak();
- remote_wait (&ignoredWaitType);
- putpkt ("reset");
- sleep(10);
- sendbreak();
- remote_wait (&ignoredWaitType);
- sleep(10);
- print_boot_cmd();
- putpkt(boot_cmd);
- fprintf(stderr, "rgdb and nucleus synchronized, booting....\n");
- }
- else
- {
- error("The boot command is null. Cannot start the remote kernel/nucleus");
- }
-}
-
-/* Close the open connection to the remote debugger.
- Use this when you want to detach and do something else
- with your gdb. */
-void
-remote_close (from_tty)
- int from_tty;
-{
- if (!remote_debugging)
- error ("Can't close remote connection: not debugging remotely.");
-
- close (remote_desc); /* This should never be called if
- there isn't something valid in
- remote_desc. */
-
- /* Do not try to close remote_desc again, later in the program. */
- remote_desc = -1;
-
- if (from_tty)
- printf ("Ending remote debugging\n");
-
- remote_debugging = 0;
-}
-
-/* Convert hex digit A to a number. */
-
-static int
-fromhex (a)
- int a;
-{
- if (a >= '0' && a <= '9')
- return a - '0';
- else if (a >= 'a' && a <= 'f')
- return a - 'a' + 10;
- else
- error ("Reply contains invalid hex digit");
-}
-
-/* Convert number NIB to a hex digit. */
-
-static int
-tohex (nib)
- int nib;
-{
- if (nib < 10)
- return '0'+nib;
- else
- return 'a'+nib-10;
-}
-
-/* Tell the remote machine to resume. */
-
-extern int one_stepped; /* From machine dependent code */
-static int remote_set_one_stepped;
-
-int
-remote_resume (step, signal)
- int step, signal;
-{
- if (step)
- {
- remote_single_step();
- }
- remote_set_one_stepped = step;
- putpkt("go");
-}
-
-/* Wait until the remote machine stops, then return,
- storing status in STATUS just as `wait' would. */
-
-int
-remote_wait (status)
- WAITTYPE *status;
-{
- char last, this;
- int pend, saveTheOh = 0;
-
- user_terminal_raw();
-
- WSETEXIT ((*status), 0177);
- last = this = 0;
-
- while (1)
- {
- char buf[PBUFSIZ];
- int readUser, readProm, state;
-
- doselect(&readUser, &readProm);
- if (readProm)
- {
- switch (state = getline(buf, PBUFSIZ, SHORTTIMEOUT))
- {
- case GL_BLANKLINE:
- if (remote_set_one_stepped)
- break;
-
- /* fall through */
-
- default:
- case GL_READING:
- case GL_SUCCESS:
- case GL_OVERRUN:
- case GL_TIMEOUT:
- if (kiodebug & KD_LINEDISCIPLINE)
- fprintf(stderr, "%d<%s>\n", state, buf);
- else
- {
- fprintf(stderr, "%s", buf);
- fflush(stderr);
- }
- break;
- case GL_OK:
- remote_cleanup_after_stop();
- WSETSTOP ((*status), SIGTRAP);
- return;
- case GL_PROMLINE:
- break;
- }
- }
- if (readUser)
- shuffleFromUserToProm();
- }
-}
-static TERMINAL userterminal;
-
-user_terminal_restore()
-{
-#if 0
- int in_desc = fileno (stdin);
- ioctl (in_desc, TCSETS, &userterminal);
-#endif
-}
-static void set_term_raw();
-
-user_terminal_raw()
-{
-#if 0
- TERMINAL tempterminal;
- int in_desc = fileno (stdin);
- ioctl (in_desc, TCGETS, &userterminal);
- tempterminal = userterminal;
-
- tempterminal.c_lflag &= ~(ICANON|ISIG|IEXTEN);
- tempterminal.c_cc[VMIN] = 1;
- tempterminal.c_cc[VTIME] = 0;
- tempterminal.c_iflag &= ~(INPCK|IXON|IXOFF);
- tempterminal.c_oflag = 0;
-
- ioctl (in_desc, TCSETS, &tempterminal);
-#endif
-}
-
-doselect(pReadUser, pReadProm)
- int *pReadUser, *pReadProm;
-{
- extern FILE *instream;
- int in_desc = fileno (stdin);
- int instreammask = 1 << in_desc;
- int remotemask = 1 << remote_desc;
- int rfds = instreammask | remotemask;
-
- select (32, &rfds, 0, 0, (struct timeval *) 0); /* 0 = Block indefinitely */
- *pReadUser = (rfds & instreammask) == instreammask;
- *pReadProm = (rfds & remotemask) == remotemask;
-}
-
-
-
-/* Read the remote registers into the block pRegisters.
-implementation copied largely from fetch_inferior_registers ()
-in sparc-dep.c */
-
-void
-remote_fetch_registers(ignored)
-int *ignored;
-{
- struct regs inferior_registers;
- extern char registers[];
- CORE_ADDR breakpoint_regs_target;
-
- if (breakpoint_regs_addr == 0)
- {
- error("no address for breakpoint_regs\n");
- return;
- }
- remote_read_inferior_memory(breakpoint_regs_addr, &breakpoint_regs_target,
- sizeof(breakpoint_regs_target));
-
- bzero(registers, REGISTER_BYTES);
- registers[REGISTER_BYTE (0)] = 0;
-
- if (breakpoint_regs_target)
- {
- remote_read_inferior_memory(breakpoint_regs_target, &inferior_registers,
- sizeof(inferior_registers));
- registers[REGISTER_BYTE (0)] = 0;
- bcopy (&inferior_registers.r_g1, &registers[REGISTER_BYTE (1)], 15 * 4);
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
- *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
- *(int *)&registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
- remote_pc = inferior_registers.r_pc;
- remote_next_pc = inferior_registers.r_npc;
- remote_read_inferior_memory (inferior_registers.r_sp,
- &registers[REGISTER_BYTE (16)],
- 16*4);
- }
- else
- {
- error("breakpoint_regs == 0\n");
- }
-}
-
-
-
-
-/* Write memory data directly to the remote machine.
- This does not inform the data cache; the data cache uses this.
- MEMADDR is the address in the remote memory space.
- MYADDR is the address of the buffer in our space.
- LEN is the number of bytes. */
-
-int
-remote_write_bytes (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- unsigned char *myaddr;
- int len;
-{
- char buf[PBUFSIZ];
- int i;
-
- /* Command describes registers byte by byte,
- each byte encoded as two hex characters. */
-
- for (i = 0; i < len; i++)
- {
- sprintf(buf, "%x %x c!", myaddr[i], memaddr + i);
- remote_send (buf, buf);
- if (strstr(buf, "Exception"))
- {
- return EFAULT;
- }
- }
- return 0;
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR. Returns errno value. */
-int
-remote_write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int xfersize;
- int retval;
-
- while (len > 0)
- {
- if (len > MAXBUFBYTES)
- xfersize = MAXBUFBYTES;
- else
- xfersize = len;
-
- retval = remote_write_bytes(memaddr, myaddr, xfersize);
- if (retval)
- return retval; /* error */
-
- memaddr += xfersize;
- myaddr += xfersize;
- len -= xfersize;
- }
- return 0; /* no error */
-}
-
-
-/* read a single character */
-
-static int
-readCharFromProm ()
-{
- char buf;
-
- buf = '\0';
- /* termio does the timeout for us. */
- read (remote_desc, &buf, 1);
- return buf & 0x7f;
-}
-
-/* Send the command in BUF to the remote machine,
- and read the reply into BUF.
- Report an error if we get an error reply. */
-
-static void
-remote_send (buf, buf2)
- char *buf, *buf2;
-{
- putpkt (buf);
- getpkt (buf2);
-}
-
-/* Send a single character out over the wire */
-
-static void
-putcharacter (ch)
- char ch;
-{
-
- while (1)
- {
- int i;
-
- write(remote_desc, &ch, 1);
- for (i = 0; i < 100; i++)
- {
- char nch = 0;
-
- if (read (remote_desc, &nch, 1) == 0)
- i++;
- if ((ch == nch)
- || (ch == '\n' && nch == '\r')
- || (ch == '\r' && nch == '\n'))
- return;
- if (kiodebug & KD_MINUTAE)
- fprintf (stderr, "Sent %c(%d) Received %c(%d)\n", ch, ch, nch, nch);
- }
- }
-}
-
-/* Send a packet to the remote machine, with error checking.
- The data of the packet is in BUF. */
-
-static void
-putpkt (buf)
- char *buf;
-{
- int i;
- int cnt = strlen (buf);
- char ch;
-
- if (kiodebug & KD_LINEDISCIPLINE)
- fprintf(stderr, "putpkt(%s)\n", buf);
-
- for (i = 0; i < cnt; i++)
- putcharacter (buf[i]);
- putcharacter ('\n');
-}
-
-jmp_buf getline_jmpbuf;
-
-/* Read a line from the remote machine, and store it in BUF. */
-getline_timer()
-{
- alarm(0);
-
- if (kiodebug & KD_RETRY)
- fprintf(stderr, "getline timed out\n");
- longjmp(getline_jmpbuf, 1);
-}
-
-static int
-getline (buf, size, timeout)
- char *buf;
- int size, timeout;
-{
- int cnt = 0;
- int state;
- int isspace_state = 1;
-
- if ((void (*)) signal (SIGALRM, getline_timer) == (void (*)) -1)
- perror ("remote_open: error in signal");
-
- --size; /* back it up one so that we can read */
-
- state = GL_READING;
-
- if (setjmp(getline_jmpbuf))
- state = GL_TIMEOUT;
- else
- {
- alarm (timeout);
- do
- {
- char ch = readCharFromProm();
- isspace_state = isspace_state && isspace(ch);
- if (ch && (dontskipcrs || ch != '\r'))
- {
- buf[cnt++] = ch;
- buf[cnt] = '\0';
- }
- if (kiodebug & KD_MINUTAE)
- fprintf (stderr,"letter received :%c\n", buf[cnt - 1]);
- if (cnt >= 2 && buf[cnt - 2] == 'o' && buf[cnt - 1] == 'k')
- state = GL_OK;
- else if (buf[cnt - 1] == '\n' )
- state = isspace_state ? GL_BLANKLINE : GL_SUCCESS;
- else if (cnt == size)
- state = GL_OVERRUN;
- else if (strstr(buf, "Type 'go' to resume"))
- state = GL_PROMLINE;
- else if (strstr(buf, "Type help for more information"))
- state = GL_PROMLINE;
- else if (strstr(buf, "Exception"))
- state = GL_EXCEPTION;
- }
- while (state == GL_READING);
- }
- alarm (0);
-
- if (kiodebug & KD_LINEDISCIPLINE)
- fprintf (stderr,"Line received :%s\n", buf);
- return state;
-}
-
-
-/* Read a packet from the remote machine, and store it in BUF. */
-
-static int
-getpkt (buf)
- char *buf;
-{
- int cnt = 0;
-
- do
- {
- char ch = readCharFromProm();
- if (ch)
- buf[cnt++] = ch;
- if (kiodebug & KD_MINUTAE)
- fprintf (stderr,"letter received :%c\n", buf[cnt - 1]);
- }
- while (cnt < 2 ||
- buf[cnt - 2] != 'o' &&
- buf[cnt - 1] != 'k');
-
- buf[cnt] = '\0';
- if (kiodebug& KD_LINEDISCIPLINE)
- fprintf (stderr,"Packet received :%s\n", buf);
- return cnt;
-}
-
-void remote_fetch_word (addr)
- CORE_ADDR addr;
-{
- error ("Internal error: remote_fetch_word is obsolete.\n");
-}
-void remote_store_word (addr)
- CORE_ADDR addr;
-{
- error ("Internal error: remote_store_word is obsolete.\n");
-}
-#include <termio.h>
-
-draininput(showit)
-enum showDrainage showit;
-{
- unsigned char buf[PBUFSIZ];
- int cnt;
-
- while ((cnt = read(remote_desc, buf, PBUFSIZ)) > 0)
- {
- buf[cnt] = 0;
- if (kiodebug& KD_LINEDISCIPLINE)
- fprintf (stderr,"Draining :%s\n", buf);
- else
- if (showit == SHOW)
- fprintf (stderr,"%s", buf);
- }
- if (kiodebug& KD_LINEDISCIPLINE)
- fprintf (stderr,"Drained\n");
-}
-sendbreak()
-{
- if (kiodebug & KD_RETRY)
- fprintf (stderr,"rgdb sending break to target...\n");
- else
- {
- fprintf (stderr,"=");
- fflush(stderr);
- }
-
- ioctl (remote_desc, TCSBRK, 0);
- sleep(5);
-}
-
-
-/* shuffle a character from the user to remote debugger */
-
-int
-shuffleFromUserToProm()
-{
- char ch;
- static int escape = 0;
-
- extern FILE *instream;
-
- ch = 0;
- if (read(STDIN, &ch , 1) != 1 || ch == 0)
- return;
-
- if (escape) {
- if (ch == '#')
- sendbreak();
- else if (ch == '.')
- {
- while (ch != '\n')
- read(STDIN, &ch , 1);
- return 1;
- }
- else {
- static char tilde = '~';
-
- putcharacter(tilde);
- putcharacter(ch);
- }
- escape = 0;
- } else /* not escape */ {
- if (ch == '~')
- escape = 1;
- else
- putcharacter(ch);
- }
- return 0;
-}
-
-
-
-/* Tell the Prom put a breakpoint at memaddr */
-remote_insert_breakpoint(memaddr)
- CORE_ADDR memaddr;
-{
- char buf[PBUFSIZ];
-
- /* Command describes registers byte by byte,
- each byte encoded as two hex characters. */
-
- sprintf(buf, "%x +bp", memaddr);
- remote_send(buf, buf);
- if (strstr(buf, "Exception"))
- {
- return EFAULT;
- }
- else
- {
- return 0;
- }
-}
-
-/* Tell the Prom remove the the breakpoint at memaddr */
-remote_remove_breakpoint(memaddr)
- CORE_ADDR memaddr;
-{
- char buf[PBUFSIZ];
-
- /* Command describes registers byte by byte,
- each byte encoded as two hex characters. */
-
- sprintf(buf, "%x -bp", memaddr);
- remote_send(buf, buf);
- if (strstr(buf, "Exception"))
- {
- return EFAULT;
- }
- else
- {
- return 0;
- }
-}
-
-
-
-
-
-/* Read memory data directly from the remote machine.
- This does not use the data cache; the data cache uses this.
- MEMADDR is the address in the remote memory space.
- MYADDR is the address of the buffer in our space.
- LEN is the number of words. */
-
-long
-remote_read(memaddr, myaddr, len, increment, promcommand)
- CORE_ADDR memaddr;
- unsigned char *myaddr;
- int len, increment;
- char *promcommand;
-{
- char buf[PBUFSIZ];
- char buf2[PBUFSIZ];
- int i;
- unsigned long num;
-
- /* Command describes registers byte by byte,
- each byte encoded as two hex characters. */
-
- for (i = 0; i < len; i += increment)
- {
- sprintf(buf, promcommand, memaddr + i) ;
- remote_send(buf, buf2);
- remote_send(".", buf);
- if (strstr(buf2, "Exception"))
- {
- bzero(&myaddr[i], len - i);
- return -i;
- }
- else
- {
- char *pBuf;
- for (pBuf = &buf[0]; *pBuf == '\r' || *pBuf == '\n'; pBuf++)
- ;
- sscanf(pBuf, "%x\n", &num);
- switch (increment)
- {
- case 1: myaddr[i] = num;
- if (num > 255)
- fprintf(stderr, "number out of bounds %x truncating to %x\n",
- num, myaddr[i]);
- break;
- case 4: {unsigned long *p;
- p = (unsigned long *) &myaddr[i];
- *p = num;
- }
- break;
- default: fprintf(stderr, "unknown increment\n"); break;
- }
- }
- }
- return i;
-}
-
-
-
-/* Read LEN bytes from inferior memory at MEMADDR. Put the result
- at debugger address MYADDR. Returns errno value. */
-int
-remote_read_inferior_memory(memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int xfersize;
- while (len > 0)
- {
- int mod;
-
- if (len > MAXBUFBYTES)
- xfersize = MAXBUFBYTES;
- else
- xfersize = len;
-
- mod = memaddr % 4;
- if (mod == 0 && xfersize >= 4)
- if (mod == 0 && xfersize >= 16)
- {
- xfersize = remote_read_many(memaddr, myaddr, (len & ~3));
- getpkt(IGNORE);
- }
- else
- xfersize = remote_read(memaddr, myaddr, 4, 4, "%x @");
- else
- xfersize = remote_read(memaddr, myaddr, max(mod, 1), 1, "%x c@");
- if (xfersize <= 0)
- return EFAULT; /* error */
- memaddr += xfersize;
- myaddr += xfersize;
- len -= xfersize;
- }
- return 0; /* no error */
-}
-static int baud_rate=B38400;
-
-static void set_term_raw(pTermio)
- TERMINAL *pTermio;
-{
- pTermio->c_cflag &= (CREAD|HUPCL|CLOCAL);
- pTermio->c_cflag |= baud_rate | CS8;
- pTermio->c_iflag = ISTRIP /* | IXON | IXOFF */;
- pTermio->c_oflag = 0;
- pTermio->c_lflag = 0;
- pTermio->c_cc[VMIN] = 0;
- pTermio->c_cc[VTIME] = 1;
-}
-
-/* setup the remote termio stream */
-setup_remote()
-{
- TERMINAL temptempio;
-
- ioctl(remote_desc, TCGETS, &temptempio);
- set_term_raw(&temptempio);
- ioctl(remote_desc, TCSETS, &temptempio);
-}
-
-/* step one machine instruction */
-remote_single_step ()
-{
- CORE_ADDR next_pc, npc4, target, pc;
- typedef enum
- {
- Error, not_branch, bicc, bicca, ba, baa, ticc, ta,
- } branch_type;
- branch_type br, isannulled();
-
- npc4 = remote_next_pc + 4; /* branch not taken */
-
- /* Always set breakpoint for NPC. */
-
- remote_insert_breakpoint(remote_next_pc);
- remove_thisbp_next_pc = remote_next_pc;
-
- /* printf ("set break at %x\n",remote_next_pc); */
-
- br = isannulled (remote_pc, &target);
-
- if (br == bicca)
- {
- /* Conditional annulled branch will either end up at
- npc (if taken) or at npc+4 (if not taken).
- Trap npc+4. */
- remote_insert_breakpoint(npc4);
- remove_thisbp_target = npc4;
- }
- else if (br == baa && target != remote_next_pc)
- {
- /* Unconditional annulled branch will always end up at
- the target. */
- remote_insert_breakpoint(target);
- remove_thisbp_target = target;
- }
-}
-
-
-
-
-/* read many words of memory */
-long
-remote_read_many(memaddr, myaddr, len)
- CORE_ADDR memaddr;
- unsigned char *myaddr;
- int len;
-{
-#define BLOCKSIZE 1024
- static int max_number_of_blocks = 24;
-
- char buf[PBUFSIZ];
- char buf2[PBUFSIZ];
- int i;
- unsigned long *p;
-/* Command describes registers byte by byte,
- each byte encoded as two hex characters. */
-
- len = min(len, max_number_of_blocks * BLOCKSIZE);
-
- sprintf(buf, "%x %x do i @ . cr 4 +loop", memaddr + len, memaddr);
- putpkt(buf);
- getline(buf2, PBUFSIZ, LONGTIMEOUT); /* I don't care */
-
- p = (unsigned long *) myaddr;
- for (i = 0; i < len; i += 4, p++)
- {
- extern int InspectIt;
-
- if (!InspectIt && ((i % BLOCKSIZE) == 0))
- fprintf(stderr, "+"); /* let 'em know that we are working */
- switch (getline(buf2, PBUFSIZ, LONGTIMEOUT))
- {
- default:
- case GL_PROMLINE:
- case GL_READING:
- case GL_OK:
- case GL_OVERRUN:
- case GL_TIMEOUT:
- case GL_BLANKLINE:
- /* resync and retry */
- max_number_of_blocks = max(1, i / BLOCKSIZE);
- fprintf(stderr, "-"); /* let 'em know that we are working */
-
- if (kiodebug & KD_BLOCKTRANSFER)
- fprintf(stderr, "failed read_many %d %d/%d (%s)\n",
- max_number_of_blocks, i, len, buf2);
- sendbreak();
- return remote_read_many(memaddr, myaddr, len);
- case GL_EXCEPTION:
- return -i;
- case GL_SUCCESS:
- sscanf(buf2, "%x\n", p);
- break;
- }
- }
- if (kiodebug & KD_BLOCKTRANSFER)
- fprintf(stderr, "success read_many %d %d/%d (%s)\n", max_number_of_blocks,
- i, len, buf2);
- return i;
-}
-/*
- * allow the user to type directly to the prom !
- */
-prom_command()
-{
- int readUser, readProm;
-
- user_terminal_raw();
- fprintf(stderr, "entering prom mode...\n");
- while (1)
- {
- doselect(&readUser, &readProm);
- if (readUser)
- if (shuffleFromUserToProm())
- {
- fprintf(stderr, "exiting prom mode\n");
- user_terminal_restore();
- return;
- }
- if (readProm)
- fprintf(stderr, "%c", readCharFromProm ());
- }
-}
-static char *boot_set_msg = "boot needs a string in quotes of the form \"boot vmunix\" ";
-static char *baud_set_msg = "baud rate should be of the form \"set baud=9600\"";
-
-static void
-set_boot (arg, from_tty)
- char *arg;
- int from_tty;
-{
- int h, i;
-
- if (!arg)
- {
- print_boot_cmd();
- error_no_arg (boot_set_msg);
- }
-
- arg = tilde_expand (arg);
- make_cleanup (free, arg);
-
- i = strlen (arg) - 1;
-
- free (boot_cmd);
-
- h = 0;
- while (*arg && h < i && (arg[h] == ' ' || arg[h] == '\t'))
- {
- h++;
- arg++;
- }
- while (i > 0 && (arg[i] == ' ' || arg[i] == '\t'))
- i--;
-
- if (h >= i || !*arg || arg[h] != '"' || arg[i] != '"')
- error (boot_set_msg);
- else
- {
- boot_cmd = savestring (++arg, i);
- boot_cmd[i - 1] = '\0';
- }
- if (from_tty)
- print_boot_cmd();
-}
-
-static int bauds[] = {
- 0, 50, 75, 110, 134, 150, 200, 300, 600,
- 1200, 1800, 2400, 4800, 9600, 19200, 38400, -1
-};
-
-
-static int convert_to_baud_B(n)
- int n;
-{
- register int *p;
-
- for (p = bauds; *p != -1; p++)
- if (*p != 0 && *p == n)
- return (p - bauds);
- return (NULL);
-}
-
-static void print_acceptable_bauds()
-{
- register int *p;
-
- for (p = bauds; *p != -1; p++)
- if (*p != 0 )
- fprintf(stderr, "%d\n", *p);
-}
-
-static void print_baud()
-{
-fprintf(stderr, "the baud rate is now %d\n", bauds[baud_rate]);
-}
-
-static void
-set_baud (arg, from_tty)
- char *arg;
- int from_tty;
-{
- int temp_baud_rate;
-
- if (!arg)
- {
- print_baud();
- print_acceptable_bauds();
- error_no_arg (baud_set_msg);
- return;
- }
-
- while (*arg && !isdigit(*arg))
- arg++;
-
- if (*arg && (temp_baud_rate = convert_to_baud_B(atoi(arg))) != NULL)
- {
- baud_rate = temp_baud_rate;
- if (remote_debugging)
- setup_remote();
- }
- else
- {
- fprintf(stderr, "bad baud rate %s, acceptable values are\n", arg);
- print_acceptable_bauds();
- }
-
- print_baud();
-}
-
-
-
-
-void
-_initialize_remote()
-{
-/* Chain containing all defined set subcommands */
-
-extern struct cmd_list_element *setlist;
-
-
- add_com ("prom", class_obscure, prom_command,
- "Conduct a dialogue directly with the prom. \
-only useful after an attach\n\
-Terminate by typing ~.");
-
- add_cmd ("boot_cmd", class_support, set_boot, boot_set_msg, &setlist);
-
- add_cmd ("baud", class_support, set_baud, baud_set_msg, &setlist);
-
- set_boot ("\"boot nucleus -d\"", 0);
- }
-
-
-/* Store the remote registers from the contents of the block REGS. */
-
-void
-remote_store_registers (registers)
- char *registers;
-{
- CORE_ADDR core;
- struct regs inferior_registers;
-
- core = parse_and_eval_address("breakpoint_regs");
-
- bcopy (&registers[REGISTER_BYTE (1)],
- &inferior_registers.r_g1, 15 * 4);
-
- inferior_registers.r_ps =
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_registers.r_pc =
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
- inferior_registers.r_npc =
- *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)];
- inferior_registers.r_y =
- *(int *)&registers[REGISTER_BYTE (Y_REGNUM)];
-
- remote_write_inferior_memory (*(int *)&registers[REGISTER_BYTE (SP_REGNUM)],
- &registers[REGISTER_BYTE (16)],
- 16*4);
- remote_write_inferior_memory (core,
- &inferior_registers,
- sizeof(inferior_registers));
-}
-
-
-
-/* we have stopped. do some cleanup */
-remote_cleanup_after_stop()
-{
- if (remove_thisbp_next_pc)
- {
- remote_remove_breakpoint (remove_thisbp_next_pc);
- remove_thisbp_next_pc = 0;
- }
- if (remove_thisbp_target)
- {
- remote_remove_breakpoint (remove_thisbp_target);
- remove_thisbp_target = 0;
- }
- user_terminal_restore();
-
- one_stepped = remote_set_one_stepped;
-}
diff --git a/gdb/remote-vx.68.c b/gdb/remote-vx.68.c
deleted file mode 100644
index 32e8202..0000000
--- a/gdb/remote-vx.68.c
+++ /dev/null
@@ -1,1542 +0,0 @@
-/* Memory-access and commands for remote VxWorks processes, for GDB.
- Copyright (C) 1990 Free Software Foundation, Inc.
- Contributed by Wind River Systems and Cygnus Support.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "tm-vxworks68.h"
-#include "param-no-tm.h"
-#include "frame.h"
-#include "inferior.h"
-#include "wait.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "symtab.h"
-#include "symfile.h" /* for struct complaint */
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#define free bogon_free /* Sun claims "int free()" not void */
-#include <rpc/rpc.h>
-#undef free
-#include <netdb.h>
-#include <ptrace.h>
-#include "xdr_ptrace.h"
-#include "xdr_ld.h"
-#include "xdr_rdb.h"
-#include "dbgRpcLib.h"
-
-/* get rid of value.h if possible */
-#include <value.h>
-#include <symtab.h>
-
-extern value call_function_by_hand ();
-extern void symbol_file_command ();
-extern int stop_soon_quietly; /* for wait_for_inferior */
-
-static int net_ptrace_clnt_call (); /* Forward decl */
-static enum clnt_stat net_clnt_call (); /* Forward decl */
-extern struct target_ops vx_ops, vx_run_ops; /* Forward declaration */
-
-/* Saved name of target host and called function for "info files".
- Both malloc'd. */
-
-static char *vx_host;
-static char *vx_running;
-
-/* Nonzero means target that is being debugged remotely has a floating
- point processor. */
-
-static int target_has_fp;
-
-/* Default error message when the network is forking up. */
-
-static const char rpcerr[] = "network target debugging: rpc error";
-
-CLIENT *pClient; /* client used in net debugging */
-static int ptraceSock = RPC_ANYSOCK;
-extern int errno;
-
-enum clnt_stat net_clnt_call();
-static void parse_args ();
-
-static struct timeval rpcTimeout = { 10, 0 };
-
-static char *skip_white_space ();
-static char *find_white_space ();
-
-/* Tell the VxWorks target system to download a file.
- The load addresses of the text, data, and bss segments are
- stored in pTextAddr, pDataAddr, and *pBssAddr (respectively).
- Returns 0 for success, -1 for failure. */
-
-static int
-net_load (filename, pTextAddr, pDataAddr, pBssAddr)
- char *filename;
- CORE_ADDR *pTextAddr;
- CORE_ADDR *pDataAddr;
- CORE_ADDR *pBssAddr;
- {
- enum clnt_stat status;
- struct ldfile ldstruct;
- struct timeval load_timeout;
-
- bzero ((char *) &ldstruct, sizeof (ldstruct));
-
- /* We invoke clnt_call () here directly, instead of through
- net_clnt_call (), because we need to set a large timeout value.
- The load on the target side can take quite a while, easily
- more than 10 seconds. The user can kill this call by typing
- CTRL-C if there really is a problem with the load. */
-
- load_timeout.tv_sec = 0x7FFF7FFF; /* A large number, effectively inf. */
- load_timeout.tv_usec = 0;
-
- status = clnt_call (pClient, VX_LOAD, xdr_wrapstring, &filename, xdr_ldfile,
- &ldstruct, load_timeout);
-
- if (status == RPC_SUCCESS)
- {
- if (*ldstruct.name == NULL) /* load failed on VxWorks side */
- return -1;
- *pTextAddr = ldstruct.txt_addr;
- *pDataAddr = ldstruct.data_addr;
- *pBssAddr = ldstruct.bss_addr;
- return 0;
- }
- else
- return -1;
- }
-
-/* returns 0 if successful, errno if RPC failed or VxWorks complains. */
-
-static int
-net_break (addr, procnum)
- int addr;
- u_long procnum;
- {
- enum clnt_stat status;
- int break_status;
- Rptrace ptrace_in; /* XXX This is stupid. It doesn't need to be a ptrace
- structure. How about something smaller? */
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- break_status = 0;
-
- ptrace_in.addr = addr;
- ptrace_in.pid = inferior_pid;
-
- status = net_clnt_call (procnum, xdr_rptrace, &ptrace_in, xdr_int,
- &break_status);
-
- if (status != RPC_SUCCESS)
- return errno;
-
- if (break_status == -1)
- return ENOMEM;
- return break_status; /* probably (FIXME) zero */
- }
-
-/* returns 0 if successful, errno otherwise */
-
-int
-vx_insert_breakpoint (addr)
- int addr;
- {
- return net_break (addr, VX_BREAK_ADD);
- }
-
-/* returns 0 if successful, errno otherwise */
-
-int
-vx_remove_breakpoint (addr)
- int addr;
- {
- return net_break (addr, VX_BREAK_DELETE);
- }
-
-/* Call a function on the VxWorks target system.
- ARGS is a vector of values of arguments (NARGS of them).
- FUNCTION is a value, the function to be called.
- Returns a struct value * representing what the function returned.
- May fail to return, if a breakpoint or signal is hit
- during the execution of the function. */
-
-#ifdef FIXME
-/* FIXME, function calls are really fried. GO back to manual method. */
-value
-vx_call_function (function, nargs, args)
- value function;
- int nargs;
- value *args;
-{
- register CORE_ADDR sp;
- register int i;
- CORE_ADDR start_sp;
- static REGISTER_TYPE dummy[] = CALL_DUMMY;
- REGISTER_TYPE dummy1[sizeof dummy / sizeof (REGISTER_TYPE)];
- CORE_ADDR old_sp;
- struct type *value_type;
- unsigned char struct_return;
- CORE_ADDR struct_addr;
- struct inferior_status inf_status;
- struct cleanup *old_chain;
- CORE_ADDR funaddr;
- int using_gcc;
-
- save_inferior_status (&inf_status, 1);
- old_chain = make_cleanup (restore_inferior_status, &inf_status);
-
- /* PUSH_DUMMY_FRAME is responsible for saving the inferior registers
- (and POP_FRAME for restoring them). (At least on most machines)
- they are saved on the stack in the inferior. */
- PUSH_DUMMY_FRAME;
-
- old_sp = sp = read_register (SP_REGNUM);
-
-#if 1 INNER_THAN 2 /* Stack grows down */
- sp -= sizeof dummy;
- start_sp = sp;
-#else /* Stack grows up */
- start_sp = sp;
- sp += sizeof dummy;
-#endif
-
- funaddr = find_function_addr (function, &value_type);
-
- {
- struct block *b = block_for_pc (funaddr);
- /* If compiled without -g, assume GCC. */
- using_gcc = b == NULL || BLOCK_GCC_COMPILED (b);
- }
-
- /* Are we returning a value using a structure return or a normal
- value return? */
-
- struct_return = using_struct_return (function, funaddr, value_type,
- using_gcc);
-
- /* Create a call sequence customized for this function
- and the number of arguments for it. */
- bcopy (dummy, dummy1, sizeof dummy);
- FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
- value_type, using_gcc);
-
-#if CALL_DUMMY_LOCATION == ON_STACK
- write_memory (start_sp, dummy1, sizeof dummy);
-
-#else /* Not on stack. */
-#if CALL_DUMMY_LOCATION == BEFORE_TEXT_END
- /* Convex Unix prohibits executing in the stack segment. */
- /* Hope there is empty room at the top of the text segment. */
- {
- static checked = 0;
- if (!checked)
- for (start_sp = text_end - sizeof dummy; start_sp < text_end; ++start_sp)
- if (read_memory_integer (start_sp, 1) != 0)
- error ("text segment full -- no place to put call");
- checked = 1;
- sp = old_sp;
- start_sp = text_end - sizeof dummy;
- write_memory (start_sp, dummy1, sizeof dummy);
- }
-#else /* After text_end. */
- {
- int errcode;
- sp = old_sp;
- start_sp = text_end;
- errcode = target_write_memory (start_sp, dummy1, sizeof dummy);
- if (errcode != 0)
- error ("Cannot write text segment -- call_function failed");
- }
-#endif /* After text_end. */
-#endif /* Not on stack. */
-
-#ifdef STACK_ALIGN
- /* If stack grows down, we must leave a hole at the top. */
- {
- int len = 0;
-
- /* Reserve space for the return structure to be written on the
- stack, if necessary */
-
- if (struct_return)
- len += TYPE_LENGTH (value_type);
-
- for (i = nargs - 1; i >= 0; i--)
- len += TYPE_LENGTH (VALUE_TYPE (value_arg_coerce (args[i])));
-#ifdef CALL_DUMMY_STACK_ADJUST
- len += CALL_DUMMY_STACK_ADJUST;
-#endif
-#if 1 INNER_THAN 2
- sp -= STACK_ALIGN (len) - len;
-#else
- sp += STACK_ALIGN (len) - len;
-#endif
- }
-#endif /* STACK_ALIGN */
-
- /* Reserve space for the return structure to be written on the
- stack, if necessary */
-
- if (struct_return)
- {
-#if 1 INNER_THAN 2
- sp -= TYPE_LENGTH (value_type);
- struct_addr = sp;
-#else
- struct_addr = sp;
- sp += TYPE_LENGTH (value_type);
-#endif
- }
-
-#if defined (REG_STRUCT_HAS_ADDR)
- {
- /* This is a machine like the sparc, where we need to pass a pointer
- to the structure, not the structure itself. */
- if (REG_STRUCT_HAS_ADDR (using_gcc))
- for (i = nargs - 1; i >= 0; i--)
- if (TYPE_CODE (VALUE_TYPE (args[i])) == TYPE_CODE_STRUCT)
- {
- CORE_ADDR addr;
-#if !(1 INNER_THAN 2)
- /* The stack grows up, so the address of the thing we push
- is the stack pointer before we push it. */
- addr = sp;
-#endif
- /* Push the structure. */
- sp = value_push (sp, args[i]);
-#if 1 INNER_THAN 2
- /* The stack grows down, so the address of the thing we push
- is the stack pointer after we push it. */
- addr = sp;
-#endif
- /* The value we're going to pass is the address of the thing
- we just pushed. */
- args[i] = value_from_long (builtin_type_long, (LONGEST) addr);
- }
- }
-#endif /* REG_STRUCT_HAS_ADDR. */
-
-#ifdef PUSH_ARGUMENTS
- PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr);
-#else /* !PUSH_ARGUMENTS */
- for (i = nargs - 1; i >= 0; i--)
- sp = value_arg_push (sp, args[i]);
-#endif /* !PUSH_ARGUMENTS */
-
-#ifdef CALL_DUMMY_STACK_ADJUST
-#if 1 INNER_THAN 2
- sp -= CALL_DUMMY_STACK_ADJUST;
-#else
- sp += CALL_DUMMY_STACK_ADJUST;
-#endif
-#endif /* CALL_DUMMY_STACK_ADJUST */
-
- /* Store the address at which the structure is supposed to be
- written. Note that this (and the code which reserved the space
- above) assumes that gcc was used to compile this function. Since
- it doesn't cost us anything but space and if the function is pcc
- it will ignore this value, we will make that assumption.
-
- Also note that on some machines (like the sparc) pcc uses a
- convention like gcc's. */
-
- if (struct_return)
- STORE_STRUCT_RETURN (struct_addr, sp);
-
- /* Write the stack pointer. This is here because the statements above
- might fool with it. On SPARC, this write also stores the register
- window into the right place in the new stack frame, which otherwise
- wouldn't happen. (See write_inferior_registers in sparc-xdep.c.) */
- write_register (SP_REGNUM, sp);
-
- /* Figure out the value returned by the function. */
- {
- char retbuf[REGISTER_BYTES];
-
- /* Execute the stack dummy routine, calling FUNCTION.
- When it is done, discard the empty frame
- after storing the contents of all regs into retbuf. */
- run_stack_dummy (start_sp + CALL_DUMMY_START_OFFSET, retbuf);
-
- do_cleanups (old_chain);
-
- return value_being_returned (value_type, retbuf, struct_return);
- }
-}
-/* should return a value of some sort */
-
-value
-vx_call_function (funcAddr, nargs, args, valueType)
- char *funcAddr;
- int nargs;
- value *args;
- struct type * valueType;
-{
- int i;
- func_call funcInfo;
- arg_value *argValue;
- enum clnt_stat status;
- register int len;
- arg_value funcReturn;
- value gdbValue;
-
- argValue = (arg_value *) xmalloc (nargs * sizeof (arg_value));
-
- bzero (argValue, nargs * sizeof (arg_value));
- bzero (&funcReturn, sizeof (funcReturn));
-
- for (i = nargs - 1; i >= 0; i--)
- {
- len = TYPE_LENGTH (VALUE_TYPE (args [i]));
-
- switch (TYPE_CODE (VALUE_TYPE (args[i])))
- {
- /* XXX put other types here. Where's CHAR, etc??? */
-
- case TYPE_CODE_FLT:
- argValue[i].type = T_FLOAT;
- break;
- case TYPE_CODE_INT:
- case TYPE_CODE_PTR:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_FUNC:
- argValue[i].type = T_INT;
- break;
-
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_ARRAY:
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_VOID:
- case TYPE_CODE_SET:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_PASCAL_ARRAY:
- case TYPE_CODE_MEMBER: /* C++ */
- case TYPE_CODE_METHOD: /* C++ */
- case TYPE_CODE_REF: /* C++ */
- default:
- error ("No corresponding VxWorks type for %d. CHECK IT OUT!!!\n",
- TYPE_CODE(VALUE_TYPE(args[i])));
- } /* switch */
- if (TYPE_CODE(VALUE_TYPE(args[i])) == TYPE_CODE_FUNC)
- argValue[i].arg_value_u.v_int = VALUE_ADDRESS(args[i]);
- else
- bcopy (VALUE_CONTENTS (args[i]), (char *) &argValue[i].arg_value_u,
- len);
- }
-
- /* XXX what should the type of this function addr be?
- * XXX Both in gdb and vxWorks
- */
- funcInfo.func_addr = (int) funcAddr;
- funcInfo.args.args_len = nargs;
- funcInfo.args.args_val = argValue;
-
- status = net_clnt_call (VX_CALL_FUNC, xdr_func_call, (char *) &funcInfo,
- xdr_arg_value, &funcReturn);
-
- free ((char *) argValue);
-
- if (status == RPC_SUCCESS)
- {
- /* XXX this assumes that vxWorks ALWAYS returns an int, and that
- * XXX gdb isn't expecting anything more
- */
-
- /*******************
- if (funcReturn.type == T_UNKNOWN)
- return YYYXXX...;
- *******************/
- gdbValue = allocate_value (valueType);
- bcopy (&funcReturn.arg_value_u.v_int, VALUE_CONTENTS (gdbValue),
- sizeof (int));
- return gdbValue;
- }
- else
- error (rpcerr);
- }
-#endif /* FIXME */
-
-/* Start an inferior process and sets inferior_pid to its pid.
- EXEC_FILE is the file to run.
- ALLARGS is a string containing the arguments to the program.
- ENV is the environment vector to pass.
- Returns process id. Errors reported with error().
- On VxWorks, we ignore exec_file. */
-
-void
-vx_create_inferior (exec_file, args, env)
- char *exec_file;
- char *args;
- char **env;
-{
- enum clnt_stat status;
- arg_array passArgs;
- TASK_START taskStart;
-
- bzero ((char *) &passArgs, sizeof (passArgs));
- bzero ((char *) &taskStart, sizeof (taskStart));
-
- /* parse arguments, put them in passArgs */
-
- parse_args (args, &passArgs);
-
- if (passArgs.arg_array_len == 0)
- error ("You must specify a function name to run, and arguments if any");
-
- status = net_clnt_call (PROCESS_START, xdr_arg_array, &passArgs,
- xdr_TASK_START, &taskStart);
-
- if ((status != RPC_SUCCESS) || (taskStart.status == -1))
- error ("Can't create process on remote target machine");
-
- /* Save the name of the running function */
- if (vx_running)
- free (vx_running);
- vx_running = savestring (passArgs.arg_array_val[0],
- strlen (passArgs.arg_array_val[0]));
-
-#ifdef CREATE_INFERIOR_HOOK
- CREATE_INFERIOR_HOOK (pid);
-#endif
-
- push_target (&vx_run_ops);
- inferior_pid = taskStart.pid;
-
-#if defined (START_INFERIOR_HOOK)
- START_INFERIOR_HOOK ();
-#endif
-
- /* We will get a trace trap after one instruction.
- Insert breakpoints and continue. */
-
- init_wait_for_inferior ();
-
- /* Set up the "saved terminal modes" of the inferior
- based on what modes we are starting it with. */
- target_terminal_init ();
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- /* remote_start(args); */
- /* trap_expected = 0; */
- stop_soon_quietly = 1;
- wait_for_inferior (); /* Get the task spawn event */
- stop_soon_quietly = 0;
-
- /* insert_step_breakpoint (); FIXME, do we need this? */
- proceed(-1, -1, 0);
-}
-
-/* Fill ARGSTRUCT in argc/argv form with the arguments from the
- argument string ARGSTRING. */
-
-static void
-parse_args (arg_string, arg_struct)
- register char *arg_string;
- arg_array *arg_struct;
-{
- register int arg_count = 0; /* number of arguments */
- register int arg_index = 0;
- register char *p0;
-
- bzero ((char *) arg_struct, sizeof (arg_array));
-
- /* first count how many arguments there are */
-
- p0 = arg_string;
- while (*p0 != '\0')
- {
- if (*(p0 = skip_white_space (p0)) == '\0')
- break;
- p0 = find_white_space (p0);
- arg_count++;
- }
-
- arg_struct->arg_array_len = arg_count;
- arg_struct->arg_array_val = (char **) xmalloc ((arg_count + 1)
- * sizeof (char *));
-
- /* now copy argument strings into arg_struct. */
-
- while (*(arg_string = skip_white_space (arg_string)))
- {
- p0 = find_white_space (arg_string);
- arg_struct->arg_array_val[arg_index++] = savestring (arg_string,
- p0 - arg_string);
- arg_string = p0;
- }
-
- arg_struct->arg_array_val[arg_count] = NULL;
-}
-
-/* Advance a string pointer across whitespace and return a pointer
- to the first non-white character. */
-
-static char *
-skip_white_space (p)
- register char *p;
-{
- while (*p == ' ' || *p == '\t')
- p++;
- return p;
-}
-
-/* Search for the first unquoted whitespace character in a string.
- Returns a pointer to the character, or to the null terminator
- if no whitespace is found. */
-
-static char *
-find_white_space (p)
- register char *p;
-{
- register int c;
-
- while ((c = *p) != ' ' && c != '\t' && c)
- {
- if (c == '\'' || c == '"')
- {
- while (*++p != c && *p)
- {
- if (*p == '\\')
- p++;
- }
- if (!*p)
- break;
- }
- p++;
- }
- return p;
-}
-
-/* Poll the VxWorks target system for an event related
- to the debugged task.
- Returns -1 if remote wait failed, task status otherwise. */
-
-int
-net_wait (pEvent)
- RDB_EVENT *pEvent;
-{
- int pid;
- enum clnt_stat status;
-
- bzero ((char *) pEvent, sizeof (RDB_EVENT));
-
- pid = inferior_pid;
- status = net_clnt_call (PROCESS_WAIT, xdr_int, &pid, xdr_RDB_EVENT, pEvent);
-
- return (status == RPC_SUCCESS)? pEvent->status: -1;
-}
-
-/* Suspend the remote task.
- Returns -1 if suspend fails on target system, 0 otherwise. */
-
-int
-net_quit ()
-{
- int pid;
- int quit_status;
- enum clnt_stat status;
-
- quit_status = 0;
-
- /* don't let rdbTask suspend itself by passing a pid of 0 */
-
- if ((pid = inferior_pid) == 0)
- return -1;
-
- status = net_clnt_call (VX_TASK_SUSPEND, xdr_int, &pid, xdr_int,
- &quit_status);
-
- return (status == RPC_SUCCESS)? quit_status: -1;
-}
-
-/* Read a register or registers from the remote system. */
-
-int
-vx_read_register (regno)
- int regno;
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- extern char registers[];
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- bzero ((char *) &ptrace_out, sizeof (ptrace_out));
-
- /* FIXME, eventually only get the ones we need. */
- registers_fetched ();
-
- ptrace_in.pid = inferior_pid;
- ptrace_out.info.more_data = (caddr_t) &inferior_registers;
- status = net_ptrace_clnt_call (PTRACE_GETREGS, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- return -1;
- }
-
-#ifdef I80960
-#else /* I80960 */
- bcopy (&inferior_registers, registers, 16 * 4);
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
-
- if (target_has_fp)
- {
- ptrace_in.pid = inferior_pid;
- ptrace_out.info.more_data = (caddr_t) &inferior_fp_registers;
- status = net_ptrace_clnt_call (PTRACE_GETFPREGS, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- return -1;
- }
-
- bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.fps_regs);
- bcopy (&inferior_fp_registers.fps_control,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
- }
- else
- {
- bzero (&registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.fps_regs);
- bzero (&registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
- }
-#endif
- return 0;
-}
-
-/* Prepare to store registers. Since we will store all of them,
- read out their current values now. */
-
-void
-vx_prepare_to_store ()
-{
- vx_read_register (-1);
-}
-
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
- /* FIXME, look at REGNO to save time here */
-
-vx_write_register (regno)
- int regno;
-{
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- extern char registers[];
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- bzero ((char *) &ptrace_out, sizeof (ptrace_out));
-
- bcopy (registers, &inferior_registers, 16 * 4);
- inferior_registers.r_ps = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_registers.r_pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
- ptrace_in.pid = inferior_pid;
- ptrace_in.info.ttype = REGS;
- ptrace_in.info.more_data = (caddr_t) &inferior_registers;
-
- /* XXX change second param to be a proc number */
- status = net_ptrace_clnt_call (PTRACE_SETREGS, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- return -1;
- }
-
- if (target_has_fp)
- {
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
- sizeof inferior_fp_registers.fps_regs);
- bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &inferior_fp_registers.fps_control,
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-
- ptrace_in.pid = inferior_pid;
- ptrace_in.info.ttype = FPREGS;
- ptrace_in.info.more_data = (caddr_t) &inferior_fp_registers;
-
- status = net_ptrace_clnt_call (PTRACE_SETFPREGS, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- return -1;
- }
- }
- return 0;
-}
-
-/* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. WRITE is true if writing to the
- inferior.
- Result is the number of bytes written or read (zero if error). The
- protocol allows us to return a negative count, indicating that we can't
- handle the current address but can handle one N bytes further, but
- vxworks doesn't give us that information. */
-
-int
-vx_xfer_memory (memaddr, myaddr, len, write)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- C_bytes data;
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- bzero ((char *) &ptrace_out, sizeof (ptrace_out));
-
- ptrace_in.pid = inferior_pid; /* XXX pid unnecessary for READDATA */
- ptrace_in.addr = (int) memaddr; /* Where from */
- ptrace_in.data = len; /* How many bytes */
-
- if (write)
- {
- ptrace_in.info.ttype = DATA;
- ptrace_in.info.more_data = (caddr_t) &data;
-
- data.bytes = (caddr_t) myaddr; /* Where from */
- data.len = len; /* How many bytes (again, for XDR) */
-
- /* XXX change second param to be a proc number */
- status = net_ptrace_clnt_call (PTRACE_WRITEDATA, &ptrace_in, &ptrace_out);
- }
- else
- {
- ptrace_out.info.more_data = (caddr_t) &data;
- data.bytes = myaddr; /* Where to */
- data.len = len; /* How many (again, for XDR) */
-
- /* XXX change second param to be a proc number */
- status = net_ptrace_clnt_call (PTRACE_READDATA, &ptrace_in, &ptrace_out);
- }
-
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- return 0; /* No bytes moved */
- }
- return len; /* Moved *all* the bytes */
-}
-
-void
-vx_files_info ()
-{
- printf ("\tAttached to host `%s'", vx_host);
- printf (", which has %sfloating point", target_has_fp? "": "no ");
- printf (".\n");
-}
-
-void
-vx_run_files_info ()
-{
- printf ("\tRunning VxWorks process 0x%x, function `%s'.\n",
- inferior_pid, vx_running);
-}
-
-void
-vx_resume (step, siggnal)
- int step;
- int siggnal;
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
-
- if (siggnal != 0)
- error ("Cannot send signals to VxWorks processes");
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- bzero ((char *) &ptrace_out, sizeof (ptrace_out));
-
- ptrace_in.pid = inferior_pid;
- ptrace_in.addr = 1; /* Target side insists on this, or it panics. */
-
- /* XXX change second param to be a proc number */
- status = net_ptrace_clnt_call (step? PTRACE_SINGLESTEP: PTRACE_CONT,
- &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- perror_with_name ("Resuming remote process");
- }
-}
-
-void
-vx_mourn_inferior ()
-{
- pop_target (); /* Pop back to no-child state */
- generic_mourn_inferior ();
-}
-
-
-/* This function allows the addition of incrementally linked object files. */
-
-void
-vx_add_file_command (arg_string, from_tty)
- char* arg_string;
- int from_tty;
-{
- CORE_ADDR text_addr;
- CORE_ADDR data_addr;
- CORE_ADDR bss_addr;
-
- if (arg_string == 0)
- error ("add-file takes a file name in VxWorks");
-
- arg_string = tilde_expand (arg_string);
- make_cleanup (free, arg_string);
-
- dont_repeat ();
-
- if (net_load (arg_string, &text_addr, &data_addr, &bss_addr) == -1)
- error ("Load failed on target machine");
-
- /* FIXME, for now we ignore data_addr and bss_addr. */
- symbol_file_add (arg_string, from_tty, text_addr, 0);
-}
-
-#ifdef FIXME /* Not ready for prime time */
-/* Single step the target program at the source or machine level.
- Takes an error exit if rpc fails.
- Returns -1 if remote single-step operation fails, else 0. */
-
-static int
-net_step ()
-{
- enum clnt_stat status;
- int step_status;
- SOURCE_STEP source_step;
-
- source_step.taskId = inferior_pid;
-
- if (step_range_end)
- {
- source_step.startAddr = step_range_start;
- source_step.endAddr = step_range_end;
- }
- else
- {
- source_step.startAddr = 0;
- source_step.endAddr = 0;
- }
-
- status = net_clnt_call (VX_SOURCE_STEP, xdr_SOURCE_STEP, &source_step,
- xdr_int, &step_status);
-
- if (status == RPC_SUCCESS)
- return step_status;
- else
- error (rpcerr);
-}
-#endif
-
-/* Emulate ptrace using RPC calls to the VxWorks target system.
- Returns nonzero (-1) if RPC status to VxWorks is bad, 0 otherwise. */
-
-static int
-net_ptrace_clnt_call (request, pPtraceIn, pPtraceOut)
- enum ptracereq request;
- Rptrace *pPtraceIn;
- Ptrace_return *pPtraceOut;
-{
- enum clnt_stat status;
-
- status = net_clnt_call (request, xdr_rptrace, pPtraceIn, xdr_ptrace_return,
- pPtraceOut);
-
- if (status != RPC_SUCCESS)
- return -1;
-
- return 0;
-}
-
-/* Query the target for the name of the file from which VxWorks was
- booted. pBootFile is the address of a pointer to the buffer to
- receive the file name; if the pointer pointed to by pBootFile is
- NULL, memory for the buffer will be allocated by XDR.
- Returns -1 if rpc failed, 0 otherwise. */
-
-int
-net_get_boot_file (pBootFile)
- char **pBootFile;
-{
- enum clnt_stat status;
-
- status = net_clnt_call (VX_BOOT_FILE_INQ, xdr_void, (char *) 0,
- xdr_wrapstring, pBootFile);
- return (status == RPC_SUCCESS) ? 0 : -1;
-}
-
-/* Fetch a list of loaded object modules from the VxWorks target.
- Returns -1 if rpc failed, 0 otherwise
- There's no way to check if the returned loadTable is correct.
- VxWorks doesn't check it. */
-
-int
-net_get_symbols (pLoadTable)
- ldtabl *pLoadTable; /* return pointer to ldtabl here */
-{
- enum clnt_stat status;
-
- bzero ((char *) pLoadTable, sizeof (struct ldtabl));
-
- status = net_clnt_call (VX_STATE_INQ, xdr_void, 0, xdr_ldtabl, pLoadTable);
- return (status == RPC_SUCCESS) ? 0 : -1;
-}
-
-/* Look up a symbol in the VxWorks target's symbol table.
- Returns status of symbol read on target side (0=success, -1=fail)
- Returns -1 and complain()s if rpc fails. */
-
-struct complaint cant_contact_target =
- {"Lost contact with VxWorks target", 0, 0};
-
-int
-vx_lookup_symbol (name, pAddr)
- char *name; /* symbol name */
- CORE_ADDR *pAddr;
-{
- enum clnt_stat status;
- SYMBOL_ADDR symbolAddr;
-
- *pAddr = 0;
- bzero ((char *) &symbolAddr, sizeof (symbolAddr));
-
- status = net_clnt_call (VX_SYMBOL_INQ, xdr_wrapstring, &name,
- xdr_SYMBOL_ADDR, &symbolAddr);
- if (status != RPC_SUCCESS) {
- complain (&cant_contact_target, 0);
- return -1;
- }
-
- *pAddr = symbolAddr.addr;
- return symbolAddr.status;
-}
-
-/* Check to see if the VxWorks target has a floating point coprocessor.
- Returns 1 if target has floating point processor, 0 otherwise.
- Calls error() if rpc fails. */
-
-int
-net_check_for_fp ()
-{
- enum clnt_stat status;
- bool_t fp = 0; /* true if fp processor is present on target board */
-
- status = net_clnt_call (VX_FP_INQUIRE, xdr_void, 0, xdr_bool, &fp);
- if (status != RPC_SUCCESS)
- error (rpcerr);
-
- return (int) fp;
-}
-
-/* Establish an RPC connection with the VxWorks target system.
- Calls error () if unable to establish connection. */
-
-void
-net_connect (host)
- char *host;
-{
- struct sockaddr_in destAddr;
- struct hostent *destHost;
-
- /* get the internet address for the given host */
-
- if ((destHost = (struct hostent *) gethostbyname (host)) == NULL)
- error ("Invalid hostname. Couldn't attach remote target.");
-
- bzero (&destAddr, sizeof (destAddr));
-
- destAddr.sin_addr.s_addr = * (u_long *) destHost->h_addr;
- destAddr.sin_family = AF_INET;
- destAddr.sin_port = 0; /* set to actual port that remote
- ptrace is listening on. */
-
- /* Create a tcp client transport on which to issue
- calls to the remote ptrace server. */
-
- ptraceSock = RPC_ANYSOCK;
- pClient = clnttcp_create (&destAddr, RDBPROG, RDBVERS, &ptraceSock, 0, 0);
- /* FIXME, here is where we deal with different version numbers of the proto */
-
- if (pClient == NULL)
- {
- clnt_pcreateerror ("\tnet_connect");
- error ("Couldn't connect to remote target.");
- }
-}
-
-/* Sleep for the specified number of milliseconds
- * (assumed to be less than 1000).
- * If select () is interrupted, returns immediately;
- * takes an error exit if select () fails for some other reason.
- */
-
-static void
-sleep_ms (ms)
- long ms;
-{
- struct timeval select_timeout;
- int status;
-
- select_timeout.tv_sec = 0;
- select_timeout.tv_usec = ms * 1000;
-
- status = select (0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &select_timeout);
-
- if (status < 0 && errno != EINTR)
- perror_with_name ("select");
-}
-
-/* Wait for control to return from inferior to debugger.
- If inferior gets a signal, we may decide to start it up again
- instead of returning. That is why there is a loop in this function.
- When this function actually returns it means the inferior
- should be left stopped and GDB should read more commands. */
-
-/* For network debugging with VxWorks.
- * VxWorks knows when tasks hit breakpoints, receive signals, exit, etc,
- * so vx_wait() receives this information directly from
- * VxWorks instead of trying to figure out what happenned via a wait() call.
- */
-
-static int
-vx_wait (status)
- int *status;
-{
- register int pid;
- WAITTYPE w;
- RDB_EVENT rdbEvent;
- int quit_failed;
-
- do
- {
- /* If CTRL-C is hit during this loop,
- suspend the inferior process. */
-
- quit_failed = 0;
- if (quit_flag)
- {
- quit_failed = (net_quit () == -1);
- quit_flag = 0;
- }
-
- /* If a net_quit () or net_wait () call has failed,
- allow the user to break the connection with the target.
- We can't simply error () out of this loop, since the
- data structures representing the state of the inferior
- are in an inconsistent state. */
-
- if (quit_failed || net_wait (&rdbEvent) == -1)
- {
- terminal_ours ();
- if (query ("Can't %s. Disconnect from target system? ",
- (quit_failed) ? "suspend remote task"
- : "get status of remote task"))
- {
- target_mourn_inferior();
- error ("Use the \"target\" command to reconnect.");
- }
- else
- {
- terminal_inferior ();
- continue;
- }
- }
-
-
- if (quit_failed || net_wait (&rdbEvent) == -1)
- {
- error ("Wait on remote target failed");
- }
-
- pid = rdbEvent.taskId;
- if (pid == 0)
- {
- sleep_ms (200); /* FIXME Don't kill the network too badly */
- }
- else if (pid != inferior_pid)
- fatal ("Bad pid for debugged task: 0x%x\n", pid);
- } while (pid == 0);
-
- /* FIXME, eventually do more then SIGTRAP on everything... */
- switch (rdbEvent.eventType)
- {
- case EVENT_EXIT:
- WSETEXIT (w, 0);
- /* FIXME is it possible to distinguish between a
- XXX normal vs abnormal exit in VxWorks? */
- break;
-
- case EVENT_START:
- WSETSTOP (w, SIGTRAP);
- break;
-
- case EVENT_STOP:
- WSETSTOP (w, SIGTRAP);
- /* XXX was it stopped by a signal? act accordingly */
- break;
-
- case EVENT_BREAK:
- /* Expecting a trace trap. Stop the inferior and
- * return silently when it happens. */
- WSETSTOP (w, SIGTRAP);
- break;
-
- case EVENT_SUSPEND:
- target_terminal_ours_for_output ();
- printf ("\nRemote task suspended\n"); /* FIXME */
- fflush (stdout);
- WSETSTOP (w, SIGTRAP);
- break;
-
- case EVENT_SIGNAL:
- /* The target is not running Unix, and its
- faults/traces do not map nicely into Unix signals.
- Make sure they do not get confused with Unix signals
- by numbering them with values higher than the highest
- legal Unix signal. code in the arch-dependent PRINT_RANDOM_SIGNAL
- routine will interpret the value for wait_for_inferior. */
- WSETSTOP (w, rdbEvent.sigType + NSIG);
- break;
- } /* switch */
- *status = *(int *)&w; /* Grumble union wait crap Grumble */
- return pid;
-}
-
-static int
-symbol_stub (arg)
- int arg;
-{
- char *bootFile = (char *)arg;
- symbol_file_command (bootFile, 0);
- return 1;
-}
-
-static int
-add_symbol_stub (arg)
- int arg;
-{
- struct ldfile *pLoadFile = (struct ldfile *)arg;
-
- symbol_file_add (pLoadFile->name, 0, pLoadFile->txt_addr, 0);
- return 1;
-}
-/* Target command for VxWorks target systems.
-
- Used in vxgdb. Takes the name of a remote target machine
- running vxWorks and connects to it to initialize remote network
- debugging. */
-
-static void
-vx_open (args, from_tty)
- char *args;
- int from_tty;
-{
- extern int close ();
- char *bootFile;
- extern char *source_path;
- struct ldtabl loadTable;
- struct ldfile *pLoadFile;
- int i;
- extern CLIENT *pClient;
-
- if (!args)
- error_no_arg ("target machine name");
-
- target_preopen ();
-
- printf ("Attaching remote machine across net...\n");
- fflush (stdout);
-
- /* Allow the user to kill the connect attempt by typing ^C.
- Wait until the call to target_has_fp () completes before
- disallowing an immediate quit, since even if net_connect ()
- is successful, the remote debug server might be hung. */
-
- immediate_quit++;
-
- net_connect (args);
- target_has_fp = net_check_for_fp ();
- printf_filtered ("Connected to %s\n", args);
-
- immediate_quit--;
-
- push_target (&vx_ops);
-
- /* Save a copy of the target host's name. */
- if (vx_host)
- free (vx_host);
- vx_host = savestring (args, strlen (args));
-
- /* Find out the name of the file from which the target was booted
- and load its symbol table. */
-
- bootFile = NULL;
- if (!net_get_boot_file (&bootFile))
- {
- if (*bootFile) {
- printf_filtered ("%s: ", bootFile);
- if (catch_errors (symbol_stub, (int)bootFile,
- "Error reading symbols from boot file"))
- puts_filtered ("ok\n");
- } else if (from_tty)
- printf ("VxWorks kernel symbols not loaded.\n");
- }
- else
- error ("Can't retrieve boot file name from target machine.");
-
- clnt_freeres (pClient, xdr_wrapstring, &bootFile);
-
- if (net_get_symbols (&loadTable) != 0)
- error ("Can't read loaded modules from target machine");
-
- i = 0-1;
- while (++i < loadTable.tbl_size)
- {
- QUIT; /* FIXME, avoids clnt_freeres below: mem leak */
- pLoadFile = &loadTable.tbl_ent [i];
-#ifdef WRS_ORIG
- {
- register int desc;
- struct cleanup *old_chain;
- char *fullname = NULL;
-
- desc = openp (source_path, 0, pLoadFile->name, O_RDONLY, 0, &fullname);
- if (desc < 0)
- perror_with_name (pLoadFile->name);
- old_chain = make_cleanup (close, desc);
- add_file_at_addr (fullname, desc, pLoadFile->txt_addr, pLoadFile->data_addr,
- pLoadFile->bss_addr);
- do_cleanups (old_chain);
- }
-#else
- /* Botches, FIXME:
- (1) Searches the PATH, not the source path.
- (2) data and bss are assumed to be at the usual offsets from text. */
- catch_errors (add_symbol_stub, (int)pLoadFile,
- "Error in reading symbols from loaded module.");
-#endif
- }
-
- clnt_freeres (pClient, xdr_ldtabl, &loadTable);
-
- if (from_tty)
- {
- puts_filtered ("Success!\n");
- }
-}
-
-/* Cross-net conversion of floats to and from extended form.
- (This is needed because different target machines have different
- extended floating point formats.) */
-
-/* Convert from an extended float to a double.
-
- The extended float is stored as raw data pointed to by FROM.
- Return the converted value as raw data in the double pointed to by TO.
-*/
-
-static void
-vx_convert_to_virtual (regno, from, to)
- int regno;
- char *from;
- char *to;
-{
- enum clnt_stat status;
- ext_fp from_ext_fp;
- double to_double;
-
- if (REGISTER_CONVERTIBLE (regno))
- {
- if (!target_has_fp) {
- *(double *)to = 0.0; /* Skip the trouble if no float anyway */
- return;
- }
- bcopy (from, (char *) &from_ext_fp, sizeof (from_ext_fp));
- bzero ((char *) &to_double, sizeof (to_double));
-
- status = net_clnt_call (VX_CONV_FROM_68881, xdr_ext_fp, &from_ext_fp,
- xdr_double, &to_double);
- if (status == RPC_SUCCESS)
- bcopy ((char *) &to_double, to, sizeof (to_double));
- else
- error (rpcerr);
- }
- else
- bcopy (from, to, REGISTER_VIRTUAL_SIZE (regno));
-}
-
-
-/* The converse: convert from a double to an extended float.
-
- The double is stored as raw data pointed to by FROM.
- Return the converted value as raw data in the extended
- float pointed to by TO.
-*/
-
-static void
-vx_convert_from_virtual (regno, from, to)
- int regno;
- char *from;
- char *to;
-{
- enum clnt_stat status;
- ext_fp to_ext_fp;
- double from_double;
-
- if (REGISTER_CONVERTIBLE (regno))
- {
- if (!target_has_fp) {
- bzero (to, REGISTER_RAW_SIZE (FP0_REGNUM)); /* Shrug */
- return;
- }
- bcopy (from, (char *) &from_double, sizeof (from_double));
- bzero ((char *) &to_ext_fp, sizeof (to_ext_fp));
-
- status = net_clnt_call (VX_CONV_TO_68881, xdr_double, &from_double,
- xdr_ext_fp, &to_ext_fp);
- if (status == RPC_SUCCESS)
- bcopy ((char *) &to_ext_fp, to, sizeof (to_ext_fp));
- else
- error (rpcerr);
- }
- else
- bcopy (from, to, REGISTER_VIRTUAL_SIZE (regno));
-}
-
-/* Make an RPC call to the VxWorks target.
- Returns RPC status. */
-
-static enum clnt_stat
-net_clnt_call (procNum, inProc, in, outProc, out)
- enum ptracereq procNum;
- xdrproc_t inProc;
- char *in;
- xdrproc_t outProc;
- char *out;
-{
- enum clnt_stat status;
-
- status = clnt_call (pClient, procNum, inProc, in, outProc, out, rpcTimeout);
-
- if (status != RPC_SUCCESS)
- clnt_perrno (status);
-
- return status;
-}
-
-/* A vxprocess target should be started via "run" not "target". */
-/*ARGSUSED*/
-static void
-vx_proc_open (name, from_tty)
- char *name;
- int from_tty;
-{
- error ("Use the \"run\" command to start a VxWorks process.");
-}
-
-
-/* Target ops structure for accessing memory and such over the net */
-
-struct target_ops vx_ops = {
- "vxworks", "VxWorks target memory via RPC over TCP/IP",
- "Use VxWorks target memory. \n\
-Specify the name of the machine to connect to.",
- vx_open, 0, /* vx_detach, */
- 0, 0, /* resume, wait */
- 0, 0, /* read_reg, write_reg */
- 0, vx_convert_to_virtual, vx_convert_from_virtual, /* prep_to_store, */
- vx_xfer_memory, vx_files_info,
- 0, 0, /* insert_breakpoint, remove_breakpoint */
- 0, 0, 0, 0, 0, /* terminal stuff */
- 0, /* vx_kill, */
- vx_add_file_command,
- call_function_by_hand, /* FIXME, calling fns is maybe botched? */
- vx_lookup_symbol,
- vx_create_inferior, 0, /* mourn_inferior */
- core_stratum, 0, /* next */
- 1, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */
- OPS_MAGIC, /* Always the last thing */
-};
-
-/* Target ops structure for accessing VxWorks child processes over the net */
-
-struct target_ops vx_run_ops = {
- "vxprocess", "VxWorks process",
- "VxWorks process, started by the \"run\" command.",
- vx_proc_open, 0, /* vx_detach, */
- vx_resume, vx_wait,
- vx_read_register, vx_write_register,
- vx_prepare_to_store, vx_convert_to_virtual, vx_convert_from_virtual,
- vx_xfer_memory, vx_run_files_info,
- vx_insert_breakpoint, vx_remove_breakpoint,
- 0, 0, 0, 0, 0, /* terminal stuff */
- 0, /* vx_kill, */
- vx_add_file_command,
- call_function_by_hand, /* FIXME, calling fns is maybe botched? */
- vx_lookup_symbol,
- vx_create_inferior, vx_mourn_inferior,
- process_stratum, 0, /* next */
- 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
- OPS_MAGIC, /* Always the last thing */
-};
-/* ==> Remember when reading at end of file, there are two "ops" structs here. */
-
-void
-_initialize_vx ()
-{
- add_target (&vx_ops);
- add_target (&vx_run_ops);
-}
diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c
deleted file mode 100644
index 42090b7..0000000
--- a/gdb/remote-vx.c
+++ /dev/null
@@ -1,1487 +0,0 @@
-/* Memory-access and commands for remote VxWorks processes, for GDB.
- Copyright (C) 1990-1991 Free Software Foundation, Inc.
- Contributed by Wind River Systems and Cygnus Support.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "wait.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "symtab.h"
-#include "symfile.h" /* for struct complaint */
-
-#include <string.h>
-#include <errno.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#define free bogon_free /* Sun claims "int free()" not void */
-#include <rpc/rpc.h>
-#undef free
-#include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
-#include <netdb.h>
-#include <ptrace.h>
-#include "xdr_ptrace.h"
-#include "xdr_ld.h"
-#include "xdr_rdb.h"
-#include "dbgRpcLib.h"
-
-/* get rid of value.h if possible */
-#include <value.h>
-#include <symtab.h>
-
-extern value call_function_by_hand ();
-extern void symbol_file_command ();
-extern int stop_soon_quietly; /* for wait_for_inferior */
-
-static int net_ptrace_clnt_call (); /* Forward decl */
-static enum clnt_stat net_clnt_call (); /* Forward decl */
-extern struct target_ops vx_ops, vx_run_ops; /* Forward declaration */
-
-/* Saved name of target host and called function for "info files".
- Both malloc'd. */
-
-static char *vx_host;
-static char *vx_running; /* Called function */
-
-/* Nonzero means target that is being debugged remotely has a floating
- point processor. */
-
-static int target_has_fp;
-
-/* Default error message when the network is forking up. */
-
-static const char rpcerr[] = "network target debugging: rpc error";
-
-CLIENT *pClient; /* client used in net debugging */
-static int ptraceSock = RPC_ANYSOCK;
-
-enum clnt_stat net_clnt_call();
-static void parse_args ();
-
-static struct timeval rpcTimeout = { 10, 0 };
-
-static char *skip_white_space ();
-static char *find_white_space ();
-
-/* Tell the VxWorks target system to download a file.
- The load addresses of the text, data, and bss segments are
- stored in pTextAddr, pDataAddr, and *pBssAddr (respectively).
- Returns 0 for success, -1 for failure. */
-
-static int
-net_load (filename, pTextAddr, pDataAddr, pBssAddr)
- char *filename;
- CORE_ADDR *pTextAddr;
- CORE_ADDR *pDataAddr;
- CORE_ADDR *pBssAddr;
- {
- enum clnt_stat status;
- struct ldfile ldstruct;
- struct timeval load_timeout;
-
- bzero ((char *) &ldstruct, sizeof (ldstruct));
-
- /* We invoke clnt_call () here directly, instead of through
- net_clnt_call (), because we need to set a large timeout value.
- The load on the target side can take quite a while, easily
- more than 10 seconds. The user can kill this call by typing
- CTRL-C if there really is a problem with the load.
-
- Do not change the tv_sec value without checking -- select() imposes
- a limit of 10**8 on it for no good reason that I can see... */
-
- load_timeout.tv_sec = 99999999; /* A large number, effectively inf. */
- load_timeout.tv_usec = 0;
-
- status = clnt_call (pClient, VX_LOAD, xdr_wrapstring, &filename, xdr_ldfile,
- &ldstruct, load_timeout);
-
- if (status == RPC_SUCCESS)
- {
- if (*ldstruct.name == NULL) /* load failed on VxWorks side */
- return -1;
- *pTextAddr = ldstruct.txt_addr;
- *pDataAddr = ldstruct.data_addr;
- *pBssAddr = ldstruct.bss_addr;
- return 0;
- }
- else
- return -1;
- }
-
-/* returns 0 if successful, errno if RPC failed or VxWorks complains. */
-
-static int
-net_break (addr, procnum)
- int addr;
- u_long procnum;
- {
- enum clnt_stat status;
- int break_status;
- Rptrace ptrace_in; /* XXX This is stupid. It doesn't need to be a ptrace
- structure. How about something smaller? */
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- break_status = 0;
-
- ptrace_in.addr = addr;
- ptrace_in.pid = inferior_pid;
-
- status = net_clnt_call (procnum, xdr_rptrace, &ptrace_in, xdr_int,
- &break_status);
-
- if (status != RPC_SUCCESS)
- return errno;
-
- if (break_status == -1)
- return ENOMEM;
- return break_status; /* probably (FIXME) zero */
- }
-
-/* returns 0 if successful, errno otherwise */
-
-int
-vx_insert_breakpoint (addr)
- int addr;
- {
- return net_break (addr, VX_BREAK_ADD);
- }
-
-/* returns 0 if successful, errno otherwise */
-
-int
-vx_remove_breakpoint (addr)
- int addr;
- {
- return net_break (addr, VX_BREAK_DELETE);
- }
-
-/* Start an inferior process and sets inferior_pid to its pid.
- EXEC_FILE is the file to run.
- ALLARGS is a string containing the arguments to the program.
- ENV is the environment vector to pass.
- Returns process id. Errors reported with error().
- On VxWorks, we ignore exec_file. */
-
-void
-vx_create_inferior (exec_file, args, env)
- char *exec_file;
- char *args;
- char **env;
-{
- enum clnt_stat status;
- arg_array passArgs;
- TASK_START taskStart;
-
- bzero ((char *) &passArgs, sizeof (passArgs));
- bzero ((char *) &taskStart, sizeof (taskStart));
-
- /* parse arguments, put them in passArgs */
-
- parse_args (args, &passArgs);
-
- if (passArgs.arg_array_len == 0)
- error ("You must specify a function name to run, and arguments if any");
-
- status = net_clnt_call (PROCESS_START, xdr_arg_array, &passArgs,
- xdr_TASK_START, &taskStart);
-
- if ((status != RPC_SUCCESS) || (taskStart.status == -1))
- error ("Can't create process on remote target machine");
-
- /* Save the name of the running function */
- vx_running = savestring (passArgs.arg_array_val[0],
- strlen (passArgs.arg_array_val[0]));
-
-#ifdef CREATE_INFERIOR_HOOK
- CREATE_INFERIOR_HOOK (pid);
-#endif
-
- push_target (&vx_run_ops);
- inferior_pid = taskStart.pid;
-
-#if defined (START_INFERIOR_HOOK)
- START_INFERIOR_HOOK ();
-#endif
-
- /* We will get a trace trap after one instruction.
- Insert breakpoints and continue. */
-
- init_wait_for_inferior ();
-
- /* Set up the "saved terminal modes" of the inferior
- based on what modes we are starting it with. */
- target_terminal_init ();
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- /* remote_start(args); */
- /* trap_expected = 0; */
- stop_soon_quietly = 1;
- wait_for_inferior (); /* Get the task spawn event */
- stop_soon_quietly = 0;
-
- /* insert_step_breakpoint (); FIXME, do we need this? */
- proceed(-1, -1, 0);
-}
-
-/* Fill ARGSTRUCT in argc/argv form with the arguments from the
- argument string ARGSTRING. */
-
-static void
-parse_args (arg_string, arg_struct)
- register char *arg_string;
- arg_array *arg_struct;
-{
- register int arg_count = 0; /* number of arguments */
- register int arg_index = 0;
- register char *p0;
-
- bzero ((char *) arg_struct, sizeof (arg_array));
-
- /* first count how many arguments there are */
-
- p0 = arg_string;
- while (*p0 != '\0')
- {
- if (*(p0 = skip_white_space (p0)) == '\0')
- break;
- p0 = find_white_space (p0);
- arg_count++;
- }
-
- arg_struct->arg_array_len = arg_count;
- arg_struct->arg_array_val = (char **) xmalloc ((arg_count + 1)
- * sizeof (char *));
-
- /* now copy argument strings into arg_struct. */
-
- while (*(arg_string = skip_white_space (arg_string)))
- {
- p0 = find_white_space (arg_string);
- arg_struct->arg_array_val[arg_index++] = savestring (arg_string,
- p0 - arg_string);
- arg_string = p0;
- }
-
- arg_struct->arg_array_val[arg_count] = NULL;
-}
-
-/* Advance a string pointer across whitespace and return a pointer
- to the first non-white character. */
-
-static char *
-skip_white_space (p)
- register char *p;
-{
- while (*p == ' ' || *p == '\t')
- p++;
- return p;
-}
-
-/* Search for the first unquoted whitespace character in a string.
- Returns a pointer to the character, or to the null terminator
- if no whitespace is found. */
-
-static char *
-find_white_space (p)
- register char *p;
-{
- register int c;
-
- while ((c = *p) != ' ' && c != '\t' && c)
- {
- if (c == '\'' || c == '"')
- {
- while (*++p != c && *p)
- {
- if (*p == '\\')
- p++;
- }
- if (!*p)
- break;
- }
- p++;
- }
- return p;
-}
-
-/* Poll the VxWorks target system for an event related
- to the debugged task.
- Returns -1 if remote wait failed, task status otherwise. */
-
-int
-net_wait (pEvent)
- RDB_EVENT *pEvent;
-{
- int pid;
- enum clnt_stat status;
-
- bzero ((char *) pEvent, sizeof (RDB_EVENT));
-
- pid = inferior_pid;
- status = net_clnt_call (PROCESS_WAIT, xdr_int, &pid, xdr_RDB_EVENT, pEvent);
-
- return (status == RPC_SUCCESS)? pEvent->status: -1;
-}
-
-/* Suspend the remote task.
- Returns -1 if suspend fails on target system, 0 otherwise. */
-
-int
-net_quit ()
-{
- int pid;
- int quit_status;
- enum clnt_stat status;
-
- quit_status = 0;
-
- /* don't let rdbTask suspend itself by passing a pid of 0 */
-
- if ((pid = inferior_pid) == 0)
- return -1;
-
- status = net_clnt_call (VX_TASK_SUSPEND, xdr_int, &pid, xdr_int,
- &quit_status);
-
- return (status == RPC_SUCCESS)? quit_status: -1;
-}
-
-/* Read a register or registers from the remote system. */
-
-int
-vx_read_register (regno)
- int regno;
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- extern char registers[];
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- bzero ((char *) &ptrace_out, sizeof (ptrace_out));
-
- /* FIXME, eventually only get the ones we need. */
- registers_fetched ();
-
- ptrace_in.pid = inferior_pid;
- ptrace_out.info.more_data = (caddr_t) &inferior_registers;
- status = net_ptrace_clnt_call (PTRACE_GETREGS, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- return -1;
- }
-
-#ifdef I80960
-
- bcopy ((char *) inferior_registers.r_lreg,
- &registers[REGISTER_BYTE (R0_REGNUM)], 16 * sizeof (int));
- bcopy ((char *) inferior_registers.r_greg,
- &registers[REGISTER_BYTE (G0_REGNUM)], 16 * sizeof (int));
-
- /* Don't assume that a location in registers[] is properly aligned. */
-
- bcopy ((char *) &inferior_registers.r_pcw,
- &registers[REGISTER_BYTE (PCW_REGNUM)], sizeof (int));
- bcopy ((char *) &inferior_registers.r_acw,
- &registers[REGISTER_BYTE (ACW_REGNUM)], sizeof (int));
- bcopy ((char *) &inferior_registers.r_lreg[2], /* r2 (RIP) -> IP */
- &registers[REGISTER_BYTE (IP_REGNUM)], sizeof (int));
- bcopy ((char *) &inferior_registers.r_tcw,
- &registers[REGISTER_BYTE (TCW_REGNUM)], sizeof (int));
-
- /* If the target has floating point registers, fetch them.
- Otherwise, zero the floating point register values in
- registers[] for good measure, even though we might not
- need to. */
-
- if (target_has_fp)
- {
- ptrace_in.pid = inferior_pid;
- ptrace_out.info.more_data = (caddr_t) &inferior_fp_registers;
- status = net_ptrace_clnt_call (PTRACE_GETFPREGS, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- return -1;
- }
-
- bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
- REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
- }
- else
- {
- bzero ((char *) &registers[REGISTER_BYTE (FP0_REGNUM)],
- REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
- }
-
-#else /* not 960, thus must be 68000: FIXME! */
-
- bcopy (&inferior_registers, registers, 16 * 4);
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
-
- if (target_has_fp)
- {
- ptrace_in.pid = inferior_pid;
- ptrace_out.info.more_data = (caddr_t) &inferior_fp_registers;
- status = net_ptrace_clnt_call (PTRACE_GETFPREGS, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- return -1;
- }
-
- bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.fps_regs);
- bcopy (&inferior_fp_registers.fps_control,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
- }
- else
- {
- bzero (&registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.fps_regs);
- bzero (&registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
- }
-#endif /* various architectures */
-
- return 0;
-}
-
-/* Prepare to store registers. Since we will store all of them,
- read out their current values now. */
-
-void
-vx_prepare_to_store ()
-{
- vx_read_register (-1);
-}
-
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
- /* FIXME, look at REGNO to save time here */
-
-vx_write_register (regno)
- int regno;
-{
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- extern char registers[];
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- bzero ((char *) &ptrace_out, sizeof (ptrace_out));
-
-#ifdef I80960
-
- bcopy (&registers[REGISTER_BYTE (R0_REGNUM)],
- (char *) inferior_registers.r_lreg, 16 * sizeof (int));
- bcopy (&registers[REGISTER_BYTE (G0_REGNUM)],
- (char *) inferior_registers.r_greg, 16 * sizeof (int));
-
- /* Don't assume that a location in registers[] is properly aligned. */
-
- bcopy (&registers[REGISTER_BYTE (PCW_REGNUM)],
- (char *) &inferior_registers.r_pcw, sizeof (int));
- bcopy (&registers[REGISTER_BYTE (ACW_REGNUM)],
- (char *) &inferior_registers.r_acw, sizeof (int));
- bcopy (&registers[REGISTER_BYTE (TCW_REGNUM)],
- (char *) &inferior_registers.r_tcw, sizeof (int));
-
-#else /* not 960 -- assume 68k -- FIXME */
-
- bcopy (registers, &inferior_registers, 16 * 4);
- inferior_registers.r_ps = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_registers.r_pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
-
-#endif /* Different register sets */
-
- ptrace_in.pid = inferior_pid;
- ptrace_in.info.ttype = REGS;
- ptrace_in.info.more_data = (caddr_t) &inferior_registers;
-
- /* XXX change second param to be a proc number */
- status = net_ptrace_clnt_call (PTRACE_SETREGS, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- return -1;
- }
-
- /* Store floating point registers if the target has them. */
-
- if (target_has_fp)
- {
-#ifdef I80960
-
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
- sizeof inferior_fp_registers.fps_regs);
-
-#else /* not 960 -- assume 68k -- FIXME */
-
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
- sizeof inferior_fp_registers.fps_regs);
- bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &inferior_fp_registers.fps_control,
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-
-#endif /* Different register sets */
-
- ptrace_in.pid = inferior_pid;
- ptrace_in.info.ttype = FPREGS;
- ptrace_in.info.more_data = (caddr_t) &inferior_fp_registers;
-
- status = net_ptrace_clnt_call (PTRACE_SETFPREGS, &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- return -1;
- }
- }
- return 0;
-}
-
-/* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. WRITE is true if writing to the
- inferior.
- Result is the number of bytes written or read (zero if error). The
- protocol allows us to return a negative count, indicating that we can't
- handle the current address but can handle one N bytes further, but
- vxworks doesn't give us that information. */
-
-int
-vx_xfer_memory (memaddr, myaddr, len, write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
- struct target_ops *target; /* ignored */
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- C_bytes data;
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- bzero ((char *) &ptrace_out, sizeof (ptrace_out));
-
- ptrace_in.pid = inferior_pid; /* XXX pid unnecessary for READDATA */
- ptrace_in.addr = (int) memaddr; /* Where from */
- ptrace_in.data = len; /* How many bytes */
-
- if (write)
- {
- ptrace_in.info.ttype = DATA;
- ptrace_in.info.more_data = (caddr_t) &data;
-
- data.bytes = (caddr_t) myaddr; /* Where from */
- data.len = len; /* How many bytes (again, for XDR) */
-
- /* XXX change second param to be a proc number */
- status = net_ptrace_clnt_call (PTRACE_WRITEDATA, &ptrace_in, &ptrace_out);
- }
- else
- {
- ptrace_out.info.more_data = (caddr_t) &data;
- data.bytes = myaddr; /* Where to */
- data.len = len; /* How many (again, for XDR) */
-
- /* XXX change second param to be a proc number */
- status = net_ptrace_clnt_call (PTRACE_READDATA, &ptrace_in, &ptrace_out);
- }
-
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- return 0; /* No bytes moved */
- }
- return len; /* Moved *all* the bytes */
-}
-
-void
-vx_files_info ()
-{
- printf ("\tAttached to host `%s'", vx_host);
- printf (", which has %sfloating point", target_has_fp? "": "no ");
- printf (".\n");
-}
-
-void
-vx_run_files_info ()
-{
- printf ("\tRunning %s VxWorks process %s",
- vx_running? "child": "attached",
- local_hex_string(inferior_pid));
- if (vx_running)
- printf (", function `%s'", vx_running);
- printf(".\n");
-}
-
-void
-vx_resume (step, siggnal)
- int step;
- int siggnal;
-{
- int status;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
-
- if (siggnal != 0 && siggnal != stop_signal)
- error ("Cannot send signals to VxWorks processes");
-
- bzero ((char *) &ptrace_in, sizeof (ptrace_in));
- bzero ((char *) &ptrace_out, sizeof (ptrace_out));
-
- ptrace_in.pid = inferior_pid;
- ptrace_in.addr = 1; /* Target side insists on this, or it panics. */
-
- /* XXX change second param to be a proc number */
- status = net_ptrace_clnt_call (step? PTRACE_SINGLESTEP: PTRACE_CONT,
- &ptrace_in, &ptrace_out);
- if (status)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- perror_with_name ("Resuming remote process");
- }
-}
-
-void
-vx_mourn_inferior ()
-{
- pop_target (); /* Pop back to no-child state */
- generic_mourn_inferior ();
-}
-
-
-/* This function allows the addition of incrementally linked object files. */
-
-void
-vx_load_command (arg_string, from_tty)
- char* arg_string;
- int from_tty;
-{
- CORE_ADDR text_addr;
- CORE_ADDR data_addr;
- CORE_ADDR bss_addr;
-
- if (arg_string == 0)
- error ("The load command takes a file name");
-
- arg_string = tilde_expand (arg_string);
- make_cleanup (free, arg_string);
-
- dont_repeat ();
-
- QUIT;
- immediate_quit++;
- if (net_load (arg_string, &text_addr, &data_addr, &bss_addr) == -1)
- error ("Load failed on target machine");
- immediate_quit--;
-
- /* FIXME, for now we ignore data_addr and bss_addr. */
- symbol_file_add (arg_string, from_tty, text_addr, 0);
-}
-
-#ifdef FIXME /* Not ready for prime time */
-/* Single step the target program at the source or machine level.
- Takes an error exit if rpc fails.
- Returns -1 if remote single-step operation fails, else 0. */
-
-static int
-net_step ()
-{
- enum clnt_stat status;
- int step_status;
- SOURCE_STEP source_step;
-
- source_step.taskId = inferior_pid;
-
- if (step_range_end)
- {
- source_step.startAddr = step_range_start;
- source_step.endAddr = step_range_end;
- }
- else
- {
- source_step.startAddr = 0;
- source_step.endAddr = 0;
- }
-
- status = net_clnt_call (VX_SOURCE_STEP, xdr_SOURCE_STEP, &source_step,
- xdr_int, &step_status);
-
- if (status == RPC_SUCCESS)
- return step_status;
- else
- error (rpcerr);
-}
-#endif
-
-/* Emulate ptrace using RPC calls to the VxWorks target system.
- Returns nonzero (-1) if RPC status to VxWorks is bad, 0 otherwise. */
-
-static int
-net_ptrace_clnt_call (request, pPtraceIn, pPtraceOut)
- enum ptracereq request;
- Rptrace *pPtraceIn;
- Ptrace_return *pPtraceOut;
-{
- enum clnt_stat status;
-
- status = net_clnt_call (request, xdr_rptrace, pPtraceIn, xdr_ptrace_return,
- pPtraceOut);
-
- if (status != RPC_SUCCESS)
- return -1;
-
- return 0;
-}
-
-/* Query the target for the name of the file from which VxWorks was
- booted. pBootFile is the address of a pointer to the buffer to
- receive the file name; if the pointer pointed to by pBootFile is
- NULL, memory for the buffer will be allocated by XDR.
- Returns -1 if rpc failed, 0 otherwise. */
-
-int
-net_get_boot_file (pBootFile)
- char **pBootFile;
-{
- enum clnt_stat status;
-
- status = net_clnt_call (VX_BOOT_FILE_INQ, xdr_void, (char *) 0,
- xdr_wrapstring, pBootFile);
- return (status == RPC_SUCCESS) ? 0 : -1;
-}
-
-/* Fetch a list of loaded object modules from the VxWorks target.
- Returns -1 if rpc failed, 0 otherwise
- There's no way to check if the returned loadTable is correct.
- VxWorks doesn't check it. */
-
-int
-net_get_symbols (pLoadTable)
- ldtabl *pLoadTable; /* return pointer to ldtabl here */
-{
- enum clnt_stat status;
-
- bzero ((char *) pLoadTable, sizeof (struct ldtabl));
-
- status = net_clnt_call (VX_STATE_INQ, xdr_void, 0, xdr_ldtabl, pLoadTable);
- return (status == RPC_SUCCESS) ? 0 : -1;
-}
-
-/* Look up a symbol in the VxWorks target's symbol table.
- Returns status of symbol read on target side (0=success, -1=fail)
- Returns -1 and complain()s if rpc fails. */
-
-struct complaint cant_contact_target =
- {"Lost contact with VxWorks target", 0, 0};
-
-int
-vx_lookup_symbol (name, pAddr)
- char *name; /* symbol name */
- CORE_ADDR *pAddr;
-{
- enum clnt_stat status;
- SYMBOL_ADDR symbolAddr;
-
- *pAddr = 0;
- bzero ((char *) &symbolAddr, sizeof (symbolAddr));
-
- status = net_clnt_call (VX_SYMBOL_INQ, xdr_wrapstring, &name,
- xdr_SYMBOL_ADDR, &symbolAddr);
- if (status != RPC_SUCCESS) {
- complain (&cant_contact_target, 0);
- return -1;
- }
-
- *pAddr = symbolAddr.addr;
- return symbolAddr.status;
-}
-
-/* Check to see if the VxWorks target has a floating point coprocessor.
- Returns 1 if target has floating point processor, 0 otherwise.
- Calls error() if rpc fails. */
-
-int
-net_check_for_fp ()
-{
- enum clnt_stat status;
- bool_t fp = 0; /* true if fp processor is present on target board */
-
- status = net_clnt_call (VX_FP_INQUIRE, xdr_void, 0, xdr_bool, &fp);
- if (status != RPC_SUCCESS)
- error (rpcerr);
-
- return (int) fp;
-}
-
-/* Establish an RPC connection with the VxWorks target system.
- Calls error () if unable to establish connection. */
-
-void
-net_connect (host)
- char *host;
-{
- struct sockaddr_in destAddr;
- struct hostent *destHost;
-
- /* get the internet address for the given host */
-
- if ((destHost = (struct hostent *) gethostbyname (host)) == NULL)
- error ("Invalid hostname. Couldn't find remote host address.");
-
- bzero (&destAddr, sizeof (destAddr));
-
- destAddr.sin_addr.s_addr = * (u_long *) destHost->h_addr;
- destAddr.sin_family = AF_INET;
- destAddr.sin_port = 0; /* set to actual port that remote
- ptrace is listening on. */
-
- /* Create a tcp client transport on which to issue
- calls to the remote ptrace server. */
-
- ptraceSock = RPC_ANYSOCK;
- pClient = clnttcp_create (&destAddr, RDBPROG, RDBVERS, &ptraceSock, 0, 0);
- /* FIXME, here is where we deal with different version numbers of the proto */
-
- if (pClient == NULL)
- {
- clnt_pcreateerror ("\tnet_connect");
- error ("Couldn't connect to remote target.");
- }
-}
-
-/* Sleep for the specified number of milliseconds
- * (assumed to be less than 1000).
- * If select () is interrupted, returns immediately;
- * takes an error exit if select () fails for some other reason.
- */
-
-static void
-sleep_ms (ms)
- long ms;
-{
- struct timeval select_timeout;
- int status;
-
- select_timeout.tv_sec = 0;
- select_timeout.tv_usec = ms * 1000;
-
- status = select (0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &select_timeout);
-
- if (status < 0 && errno != EINTR)
- perror_with_name ("select");
-}
-
-/* Wait for control to return from inferior to debugger.
- If inferior gets a signal, we may decide to start it up again
- instead of returning. That is why there is a loop in this function.
- When this function actually returns it means the inferior
- should be left stopped and GDB should read more commands. */
-
-/* For network debugging with VxWorks.
- * VxWorks knows when tasks hit breakpoints, receive signals, exit, etc,
- * so vx_wait() receives this information directly from
- * VxWorks instead of trying to figure out what happenned via a wait() call.
- */
-
-static int
-vx_wait (status)
- int *status;
-{
- register int pid;
- WAITTYPE w;
- RDB_EVENT rdbEvent;
- int quit_failed;
-
- do
- {
- /* If CTRL-C is hit during this loop,
- suspend the inferior process. */
-
- quit_failed = 0;
- if (quit_flag)
- {
- quit_failed = (net_quit () == -1);
- quit_flag = 0;
- }
-
- /* If a net_quit () or net_wait () call has failed,
- allow the user to break the connection with the target.
- We can't simply error () out of this loop, since the
- data structures representing the state of the inferior
- are in an inconsistent state. */
-
- if (quit_failed || net_wait (&rdbEvent) == -1)
- {
- terminal_ours ();
- if (query ("Can't %s. Disconnect from target system? ",
- (quit_failed) ? "suspend remote task"
- : "get status of remote task"))
- {
- target_mourn_inferior();
- error ("Use the \"target\" command to reconnect.");
- }
- else
- {
- terminal_inferior ();
- continue;
- }
- }
-
- pid = rdbEvent.taskId;
- if (pid == 0)
- {
- sleep_ms (200); /* FIXME Don't kill the network too badly */
- }
- else if (pid != inferior_pid)
- fatal ("Bad pid for debugged task: %s\n", local_hex_string(pid));
- } while (pid == 0);
-
- /* FIXME, eventually do more then SIGTRAP on everything... */
- switch (rdbEvent.eventType)
- {
- case EVENT_EXIT:
- WSETEXIT (w, 0);
- /* FIXME is it possible to distinguish between a
- XXX normal vs abnormal exit in VxWorks? */
- break;
-
- case EVENT_START: /* Task was just started. */
- WSETSTOP (w, SIGTRAP);
- break;
-
- case EVENT_STOP:
- WSETSTOP (w, SIGTRAP);
- /* XXX was it stopped by a signal? act accordingly */
- break;
-
- case EVENT_BREAK: /* Breakpoint was hit. */
- WSETSTOP (w, SIGTRAP);
- break;
-
- case EVENT_SUSPEND: /* Task was suspended, probably by ^C. */
- WSETSTOP (w, SIGINT);
- break;
-
- case EVENT_BUS_ERR: /* Task made evil nasty reference. */
- WSETSTOP (w, SIGBUS);
- break;
-
- case EVENT_ZERO_DIV: /* Division by zero */
- WSETSTOP (w, SIGFPE); /* Like Unix, call it a float exception. */
-
- case EVENT_SIGNAL:
- /* The target is not running Unix, and its
- faults/traces do not map nicely into Unix signals.
- Make sure they do not get confused with Unix signals
- by numbering them with values higher than the highest
- legal Unix signal. code in the arch-dependent PRINT_RANDOM_SIGNAL
- routine will interpret the value for wait_for_inferior. */
- WSETSTOP (w, rdbEvent.sigType + NSIG);
- break;
- } /* switch */
- *status = *(int *)&w; /* Grumble union wait crap Grumble */
- return pid;
-}
-
-static int
-symbol_stub (arg)
- char *arg;
-{
- symbol_file_command (arg, 0);
- return 1;
-}
-
-static int
-add_symbol_stub (arg)
- char *arg;
-{
- struct ldfile *pLoadFile = (struct ldfile *)arg;
-
- printf("\t%s: ", pLoadFile->name);
- symbol_file_add (pLoadFile->name, 0, pLoadFile->txt_addr, 0);
- printf ("ok\n");
- return 1;
-}
-/* Target command for VxWorks target systems.
-
- Used in vxgdb. Takes the name of a remote target machine
- running vxWorks and connects to it to initialize remote network
- debugging. */
-
-static void
-vx_open (args, from_tty)
- char *args;
- int from_tty;
-{
- extern int close ();
- char *bootFile;
- extern char *source_path;
- struct ldtabl loadTable;
- struct ldfile *pLoadFile;
- int i;
- extern CLIENT *pClient;
-
- if (!args)
- error_no_arg ("target machine name");
-
- target_preopen (from_tty);
-
- unpush_target (&vx_ops);
- printf ("Attaching remote machine across net...\n");
- fflush (stdout);
-
- /* Allow the user to kill the connect attempt by typing ^C.
- Wait until the call to target_has_fp () completes before
- disallowing an immediate quit, since even if net_connect ()
- is successful, the remote debug server might be hung. */
-
- immediate_quit++;
-
- net_connect (args);
- target_has_fp = net_check_for_fp ();
- printf_filtered ("Connected to %s.\n", args);
-
- immediate_quit--;
-
- push_target (&vx_ops);
-
- /* Save a copy of the target host's name. */
- vx_host = savestring (args, strlen (args));
-
- /* Find out the name of the file from which the target was booted
- and load its symbol table. */
-
- printf_filtered ("Looking in Unix path for all loaded modules:\n");
- bootFile = NULL;
- if (!net_get_boot_file (&bootFile))
- {
- if (*bootFile) {
- printf_filtered ("\t%s: ", bootFile);
- if (catch_errors (symbol_stub, bootFile,
- "Error while reading symbols from boot file:\n"))
- puts_filtered ("ok\n");
- } else if (from_tty)
- printf ("VxWorks kernel symbols not loaded.\n");
- }
- else
- error ("Can't retrieve boot file name from target machine.");
-
- clnt_freeres (pClient, xdr_wrapstring, &bootFile);
-
- if (net_get_symbols (&loadTable) != 0)
- error ("Can't read loaded modules from target machine");
-
- i = 0-1;
- while (++i < loadTable.tbl_size)
- {
- QUIT; /* FIXME, avoids clnt_freeres below: mem leak */
- pLoadFile = &loadTable.tbl_ent [i];
-#ifdef WRS_ORIG
- {
- register int desc;
- struct cleanup *old_chain;
- char *fullname = NULL;
-
- desc = openp (source_path, 0, pLoadFile->name, O_RDONLY, 0, &fullname);
- if (desc < 0)
- perror_with_name (pLoadFile->name);
- old_chain = make_cleanup (close, desc);
- add_file_at_addr (fullname, desc, pLoadFile->txt_addr, pLoadFile->data_addr,
- pLoadFile->bss_addr);
- do_cleanups (old_chain);
- }
-#else
- /* Botches, FIXME:
- (1) Searches the PATH, not the source path.
- (2) data and bss are assumed to be at the usual offsets from text. */
- catch_errors (add_symbol_stub, (char *)pLoadFile, (char *)0);
-#endif
- }
- printf_filtered ("Done.\n");
-
- clnt_freeres (pClient, xdr_ldtabl, &loadTable);
-}
-
-/* attach_command --
- takes a task started up outside of gdb and ``attaches'' to it.
- This stops it cold in its tracks and allows us to start tracing it. */
-
-static void
-vx_attach (args, from_tty)
- char *args;
- int from_tty;
-{
- int pid;
- char *cptr = 0;
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- int status;
-
- dont_repeat();
-
- if (!args)
- error_no_arg ("process-id to attach");
-
- pid = strtol (args, &cptr, 0);
- if ((cptr == args) || (*cptr != '\0'))
- error ("Invalid process-id -- give a single number in decimal or 0xhex");
-
- if (from_tty)
- printf ("Attaching pid %s.\n", local_hex_string(pid));
-
- bzero ((char *)&ptrace_in, sizeof (ptrace_in));
- bzero ((char *)&ptrace_out, sizeof (ptrace_out));
- ptrace_in.pid = pid;
-
- status = net_ptrace_clnt_call (PTRACE_ATTACH, &ptrace_in, &ptrace_out);
- if (status == -1)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- perror_with_name ("Attaching remote process");
- }
-
- /* It worked... */
- push_target (&vx_run_ops);
- inferior_pid = pid;
- vx_running = 0;
-
-#if defined (START_INFERIOR_HOOK)
- START_INFERIOR_HOOK ();
-#endif
-
- mark_breakpoints_out ();
-
- /* Set up the "saved terminal modes" of the inferior
- based on what modes we are starting it with. */
- target_terminal_init ();
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- /* We will get a task spawn event immediately. */
- init_wait_for_inferior ();
- clear_proceed_status ();
- stop_soon_quietly = 1;
- wait_for_inferior ();
- stop_soon_quietly = 0;
- normal_stop ();
-}
-
-
-/* detach_command --
- takes a program previously attached to and detaches it.
- The program resumes execution and will no longer stop
- on signals, etc. We better not have left any breakpoints
- in the program or it'll die when it hits one. For this
- to work, it may be necessary for the process to have been
- previously attached. It *might* work if the program was
- started via the normal ptrace (PTRACE_TRACEME). */
-
-static void
-vx_detach (args, from_tty)
- char *args;
- int from_tty;
-{
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- int signal = 0;
- int status;
-
- if (args)
- error ("Argument given to VxWorks \"detach\".");
-
- if (from_tty)
- printf ("Detaching pid %s.\n", local_hex_string(inferior_pid));
-
- if (args) /* FIXME, should be possible to leave suspended */
- signal = atoi (args);
-
- bzero ((char *)&ptrace_in, sizeof (ptrace_in));
- bzero ((char *)&ptrace_out, sizeof (ptrace_out));
- ptrace_in.pid = inferior_pid;
-
- status = net_ptrace_clnt_call (PTRACE_DETACH, &ptrace_in, &ptrace_out);
- if (status == -1)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- perror_with_name ("Detaching VxWorks process");
- }
-
- inferior_pid = 0;
- pop_target (); /* go back to non-executing VxWorks connection */
-}
-
-/* vx_kill -- takes a running task and wipes it out. */
-
-static void
-vx_kill (args, from_tty)
- char *args;
- int from_tty;
-{
- Rptrace ptrace_in;
- Ptrace_return ptrace_out;
- int status;
-
- if (args)
- error ("Argument given to VxWorks \"kill\".");
-
- if (from_tty)
- printf ("Killing pid %s.\n", local_hex_string(inferior_pid));
-
- bzero ((char *)&ptrace_in, sizeof (ptrace_in));
- bzero ((char *)&ptrace_out, sizeof (ptrace_out));
- ptrace_in.pid = inferior_pid;
-
- status = net_ptrace_clnt_call (PTRACE_KILL, &ptrace_in, &ptrace_out);
- if (status == -1)
- error (rpcerr);
- if (ptrace_out.status == -1)
- {
- errno = ptrace_out.errno;
- perror_with_name ("Killing VxWorks process");
- }
-
- /* If it gives good status, the process is *gone*, no events remain. */
- inferior_pid = 0;
- pop_target (); /* go back to non-executing VxWorks connection */
-}
-
-/* Clean up from the VxWorks process target as it goes away. */
-
-void
-vx_proc_close (quitting)
- int quitting;
-{
- inferior_pid = 0; /* No longer have a process. */
- if (vx_running)
- free (vx_running);
- vx_running = 0;
-}
-
-/* Cross-net conversion of floats to and from extended form.
- (This is needed because different target machines have different
- extended floating point formats.) */
-
-/* Convert from an extended float to a double.
-
- The extended float is stored as raw data pointed to by FROM.
- Return the converted value as raw data in the double pointed to by TO.
-*/
-
-static void
-vx_convert_to_virtual (regno, from, to)
- int regno;
- char *from;
- char *to;
-{
- enum clnt_stat status;
-
- if (REGISTER_CONVERTIBLE (regno))
- {
- if (!target_has_fp) {
- *(double *)to = 0.0; /* Skip the trouble if no float anyway */
- return;
- }
-
- status = net_clnt_call (VX_CONV_FROM_68881, xdr_ext_fp, from,
- xdr_double, to);
-
- if (status == RPC_SUCCESS)
- return;
- else
- error (rpcerr);
- }
- else
- bcopy (from, to, REGISTER_VIRTUAL_SIZE (regno));
-}
-
-
-/* The converse: convert from a double to an extended float.
-
- The double is stored as raw data pointed to by FROM.
- Return the converted value as raw data in the extended
- float pointed to by TO.
-*/
-
-static void
-vx_convert_from_virtual (regno, from, to)
- int regno;
- char *from;
- char *to;
-{
- enum clnt_stat status;
-
- if (REGISTER_CONVERTIBLE (regno))
- {
- if (!target_has_fp) {
- bzero (to, REGISTER_RAW_SIZE (FP0_REGNUM)); /* Shrug */
- return;
- }
-
- status = net_clnt_call (VX_CONV_TO_68881, xdr_double, from,
- xdr_ext_fp, to);
- if (status == RPC_SUCCESS)
- return;
- else
- error (rpcerr);
- }
- else
- bcopy (from, to, REGISTER_VIRTUAL_SIZE (regno));
-}
-
-/* Make an RPC call to the VxWorks target.
- Returns RPC status. */
-
-static enum clnt_stat
-net_clnt_call (procNum, inProc, in, outProc, out)
- enum ptracereq procNum;
- xdrproc_t inProc;
- char *in;
- xdrproc_t outProc;
- char *out;
-{
- enum clnt_stat status;
-
- status = clnt_call (pClient, procNum, inProc, in, outProc, out, rpcTimeout);
-
- if (status != RPC_SUCCESS)
- clnt_perrno (status);
-
- return status;
-}
-
-/* Clean up before losing control. */
-
-void
-vx_close (quitting)
- int quitting;
-{
- if (pClient)
- clnt_destroy (pClient); /* The net connection */
- pClient = 0;
-
- if (vx_host)
- free (vx_host); /* The hostname */
- vx_host = 0;
-}
-
-/* A vxprocess target should be started via "run" not "target". */
-/*ARGSUSED*/
-static void
-vx_proc_open (name, from_tty)
- char *name;
- int from_tty;
-{
- error ("Use the \"run\" command to start a VxWorks process.");
-}
-
-/* Target ops structure for accessing memory and such over the net */
-
-struct target_ops vx_ops = {
- "vxworks", "VxWorks target memory via RPC over TCP/IP",
- "Use VxWorks target memory. \n\
-Specify the name of the machine to connect to.",
- vx_open, vx_close, vx_attach, 0, /* vx_detach, */
- 0, 0, /* resume, wait */
- 0, 0, /* read_reg, write_reg */
- 0, vx_convert_to_virtual, vx_convert_from_virtual, /* prep_to_store, */
- vx_xfer_memory, vx_files_info,
- 0, 0, /* insert_breakpoint, remove_breakpoint */
- 0, 0, 0, 0, 0, /* terminal stuff */
- 0, /* vx_kill, */
- vx_load_command,
- 0, /* call_function */
- vx_lookup_symbol,
- vx_create_inferior, 0, /* mourn_inferior */
- core_stratum, 0, /* next */
- 1, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */
- 0, 0, /* Section pointers */
- OPS_MAGIC, /* Always the last thing */
-};
-
-/* Target ops structure for accessing VxWorks child processes over the net */
-
-struct target_ops vx_run_ops = {
- "vxprocess", "VxWorks process",
- "VxWorks process, started by the \"run\" command.",
- vx_proc_open, vx_proc_close, 0, vx_detach, /* vx_attach */
- vx_resume, vx_wait,
- vx_read_register, vx_write_register,
- vx_prepare_to_store, vx_convert_to_virtual, vx_convert_from_virtual,
- vx_xfer_memory, vx_run_files_info,
- vx_insert_breakpoint, vx_remove_breakpoint,
- 0, 0, 0, 0, 0, /* terminal stuff */
- vx_kill,
- vx_load_command,
- call_function_by_hand, /* FIXME, calling fns is maybe botched? */
- vx_lookup_symbol,
- 0, vx_mourn_inferior,
- process_stratum, 0, /* next */
- 0, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
- /* all_mem is off to avoid spurious msg in "i files" */
- 0, 0, /* Section pointers */
- OPS_MAGIC, /* Always the last thing */
-};
-/* ==> Remember when reading at end of file, there are two "ops" structs here. */
-
-void
-_initialize_vx ()
-{
- add_target (&vx_ops);
- add_target (&vx_run_ops);
-}
diff --git a/gdb/remote.c b/gdb/remote.c
deleted file mode 100644
index 8215243..0000000
--- a/gdb/remote.c
+++ /dev/null
@@ -1,854 +0,0 @@
-/* Memory-access and commands for inferior process, for GDB.
- Copyright (C) 1988-1991 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Remote communication protocol.
- All values are encoded in ascii hex digits.
-
- Request Packet
-
- read registers g
- reply XX....X Each byte of register data
- is described by two hex digits.
- Registers are in the internal order
- for GDB, and the bytes in a register
- are in the same order the machine uses.
- or ENN for an error.
-
- write regs GXX..XX Each byte of register data
- is described by two hex digits.
- reply OK for success
- ENN for an error
-
- read mem mAA..AA,LLLL AA..AA is address, LLLL is length.
- reply XX..XX XX..XX is mem contents
- or ENN NN is errno
-
- write mem MAA..AA,LLLL:XX..XX
- AA..AA is address,
- LLLL is number of bytes,
- XX..XX is data
- reply OK for success
- ENN for an error
-
- cont cAA..AA AA..AA is address to resume
- If AA..AA is omitted,
- resume at same address.
-
- step sAA..AA AA..AA is address to resume
- If AA..AA is omitted,
- resume at same address.
-
- last signal ? Reply the current reason for stopping.
- This is the same reply as is generated
- for step or cont : SAA where AA is the
- signal number.
-
- There is no immediate reply to step or cont.
- The reply comes when the machine stops.
- It is SAA AA is the "signal number"
-
- kill req k
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "wait.h"
-#include "terminal.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <signal.h>
-
-extern void add_syms_addr_command ();
-extern struct value *call_function_by_hand();
-extern void start_remote ();
-
-extern struct target_ops remote_ops; /* Forward decl */
-
-static int kiodebug;
-static int timeout = 5;
-
-#if 0
-int icache;
-#endif
-
-/* Descriptor for I/O to remote machine. Initialize it to -1 so that
- remote_open knows that we don't have a file open when the program
- starts. */
-int remote_desc = -1;
-
-#define PBUFSIZ 400
-
-/* Maximum number of bytes to read/write at once. The value here
- is chosen to fill up a packet (the headers account for the 32). */
-#define MAXBUFBYTES ((PBUFSIZ-32)/2)
-
-static void remote_send ();
-static void putpkt ();
-static void getpkt ();
-#if 0
-static void dcache_flush ();
-#endif
-
-
-/* Called when SIGALRM signal sent due to alarm() timeout. */
-#ifndef HAVE_TERMIO
-void
-remote_timer ()
-{
- if (kiodebug)
- printf ("remote_timer called\n");
-
- alarm (timeout);
-}
-#endif
-
-/* Initialize remote connection */
-
-void
-remote_start()
-{
-}
-
-/* Clean up connection to a remote debugger. */
-
-/* ARGSUSED */
-void
-remote_close (quitting)
- int quitting;
-{
- if (remote_desc >= 0)
- close (remote_desc);
- remote_desc = -1;
-}
-
-/* Open a connection to a remote debugger.
- NAME is the filename used for communication. */
-
-void
-remote_open (name, from_tty)
- char *name;
- int from_tty;
-{
- TERMINAL sg;
-
- if (name == 0)
- error (
-"To open a remote debug connection, you need to specify what serial\n\
-device is attached to the remote system (e.g. /dev/ttya).");
-
- target_preopen (from_tty);
-
- remote_close (0);
-
-#if 0
- dcache_init ();
-#endif
-
- remote_desc = open (name, O_RDWR);
- if (remote_desc < 0)
- perror_with_name (name);
-
- ioctl (remote_desc, TIOCGETP, &sg);
-#ifdef HAVE_TERMIO
- sg.c_cc[VMIN] = 0; /* read with timeout. */
- sg.c_cc[VTIME] = timeout * 10;
- sg.c_lflag &= ~(ICANON | ECHO);
-#else
- sg.sg_flags = RAW;
-#endif
- ioctl (remote_desc, TIOCSETP, &sg);
-
- if (from_tty)
- printf ("Remote debugging using %s\n", name);
- push_target (&remote_ops); /* Switch to using remote target now */
-
-#ifndef HAVE_TERMIO
-#ifndef NO_SIGINTERRUPT
- /* Cause SIGALRM's to make reads fail. */
- if (siginterrupt (SIGALRM, 1) != 0)
- perror ("remote_open: error in siginterrupt");
-#endif
-
- /* Set up read timeout timer. */
- if ((void (*)()) signal (SIGALRM, remote_timer) == (void (*)()) -1)
- perror ("remote_open: error in signal");
-#endif
-
- /* Ack any packet which the remote side has already sent. */
- write (remote_desc, "+", 1);
- putpkt ("?"); /* initiate a query from remote machine */
-
- start_remote (); /* Initialize gdb process mechanisms */
-}
-
-/* remote_detach()
- takes a program previously attached to and detaches it.
- We better not have left any breakpoints
- in the program or it'll die when it hits one.
- Close the open connection to the remote debugger.
- Use this when you want to detach and do something else
- with your gdb. */
-
-static void
-remote_detach (args, from_tty)
- char *args;
- int from_tty;
-{
- if (args)
- error ("Argument given to \"detach\" when remotely debugging.");
-
- pop_target ();
- if (from_tty)
- printf ("Ending remote debugging.\n");
-}
-
-/* Convert hex digit A to a number. */
-
-static int
-fromhex (a)
- int a;
-{
- if (a >= '0' && a <= '9')
- return a - '0';
- else if (a >= 'a' && a <= 'f')
- return a - 'a' + 10;
- else
- error ("Reply contains invalid hex digit");
- return -1;
-}
-
-/* Convert number NIB to a hex digit. */
-
-static int
-tohex (nib)
- int nib;
-{
- if (nib < 10)
- return '0'+nib;
- else
- return 'a'+nib-10;
-}
-
-/* Tell the remote machine to resume. */
-
-void
-remote_resume (step, siggnal)
- int step, siggnal;
-{
- char buf[PBUFSIZ];
-
- if (siggnal)
- error ("Can't send signals to a remote system.");
-
-#if 0
- dcache_flush ();
-#endif
-
- strcpy (buf, step ? "s": "c");
-
- putpkt (buf);
-}
-
-/* Wait until the remote machine stops, then return,
- storing status in STATUS just as `wait' would.
- Returns "pid" (though it's not clear what, if anything, that
- means in the case of this target). */
-
-int
-remote_wait (status)
- WAITTYPE *status;
-{
- unsigned char buf[PBUFSIZ];
-
- WSETEXIT ((*status), 0);
- getpkt (buf);
- if (buf[0] == 'E')
- error ("Remote failure reply: %s", buf);
- if (buf[0] != 'S')
- error ("Invalid remote reply: %s", buf);
- WSETSTOP ((*status), (((fromhex (buf[1])) << 4) + (fromhex (buf[2]))));
- return 0;
-}
-
-/* Read the remote registers into the block REGS. */
-
-/* Currently we just read all the registers, so we don't use regno. */
-/* ARGSUSED */
-void
-remote_fetch_registers (regno)
- int regno;
-{
- char buf[PBUFSIZ];
- int i;
- char *p;
- char regs[REGISTER_BYTES];
-
- sprintf (buf, "g");
- remote_send (buf);
-
- /* Reply describes registers byte by byte, each byte encoded as two
- hex characters. Suck them all up, then supply them to the
- register cacheing/storage mechanism. */
-
- p = buf;
- for (i = 0; i < REGISTER_BYTES; i++)
- {
- if (p[0] == 0 || p[1] == 0)
- error ("Remote reply is too short: %s", buf);
- regs[i] = fromhex (p[0]) * 16 + fromhex (p[1]);
- p += 2;
- }
- for (i = 0; i < NUM_REGS; i++)
- supply_register (i, &regs[REGISTER_BYTE(i)]);
-}
-
-/* Prepare to store registers. Since we send them all, we have to
- read out the ones we don't want to change first. */
-
-void
-remote_prepare_to_store ()
-{
- remote_fetch_registers (-1);
-}
-
-/* Store the remote registers from the contents of the block REGISTERS.
- FIXME, eventually just store one register if that's all that is needed. */
-
-/* ARGSUSED */
-int
-remote_store_registers (regno)
- int regno;
-{
- char buf[PBUFSIZ];
- int i;
- char *p;
-
- buf[0] = 'G';
-
- /* Command describes registers byte by byte,
- each byte encoded as two hex characters. */
-
- p = buf + 1;
- for (i = 0; i < REGISTER_BYTES; i++)
- {
- *p++ = tohex ((registers[i] >> 4) & 0xf);
- *p++ = tohex (registers[i] & 0xf);
- }
- *p = '\0';
-
- remote_send (buf);
- return 0;
-}
-
-#if 0
-/* Read a word from remote address ADDR and return it.
- This goes through the data cache. */
-
-int
-remote_fetch_word (addr)
- CORE_ADDR addr;
-{
- if (icache)
- {
- extern CORE_ADDR text_start, text_end;
-
- if (addr >= text_start && addr < text_end)
- {
- int buffer;
- xfer_core_file (addr, &buffer, sizeof (int));
- return buffer;
- }
- }
- return dcache_fetch (addr);
-}
-
-/* Write a word WORD into remote address ADDR.
- This goes through the data cache. */
-
-void
-remote_store_word (addr, word)
- CORE_ADDR addr;
- int word;
-{
- dcache_poke (addr, word);
-}
-#endif /* 0 */
-
-/* Write memory data directly to the remote machine.
- This does not inform the data cache; the data cache uses this.
- MEMADDR is the address in the remote memory space.
- MYADDR is the address of the buffer in our space.
- LEN is the number of bytes. */
-
-void
-remote_write_bytes (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- char buf[PBUFSIZ];
- int i;
- char *p;
-
- if (len > PBUFSIZ / 2 - 20)
- abort ();
-
- sprintf (buf, "M%x,%x:", memaddr, len);
-
- /* Command describes registers byte by byte,
- each byte encoded as two hex characters. */
-
- p = buf + strlen (buf);
- for (i = 0; i < len; i++)
- {
- *p++ = tohex ((myaddr[i] >> 4) & 0xf);
- *p++ = tohex (myaddr[i] & 0xf);
- }
- *p = '\0';
-
- remote_send (buf);
-}
-
-/* Read memory data directly from the remote machine.
- This does not use the data cache; the data cache uses this.
- MEMADDR is the address in the remote memory space.
- MYADDR is the address of the buffer in our space.
- LEN is the number of bytes. */
-
-void
-remote_read_bytes (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- char buf[PBUFSIZ];
- int i;
- char *p;
-
- if (len > PBUFSIZ / 2 - 1)
- abort ();
-
- sprintf (buf, "m%x,%x", memaddr, len);
- remote_send (buf);
-
- /* Reply describes registers byte by byte,
- each byte encoded as two hex characters. */
-
- p = buf;
- for (i = 0; i < len; i++)
- {
- if (p[0] == 0 || p[1] == 0)
- error ("Remote reply is too short: %s", buf);
- myaddr[i] = fromhex (p[0]) * 16 + fromhex (p[1]);
- p += 2;
- }
-}
-
-/* Read or write LEN bytes from inferior memory at MEMADDR, transferring
- to or from debugger address MYADDR. Write to inferior if SHOULD_WRITE is
- nonzero. Returns length of data written or read; 0 for error. */
-
-int
-remote_xfer_inferior_memory(memaddr, myaddr, len, should_write)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int should_write;
-{
- int origlen = len;
- int xfersize;
- while (len > 0)
- {
- if (len > MAXBUFBYTES)
- xfersize = MAXBUFBYTES;
- else
- xfersize = len;
-
- if (should_write)
- remote_write_bytes(memaddr, myaddr, xfersize);
- else
- remote_read_bytes (memaddr, myaddr, xfersize);
- memaddr += xfersize;
- myaddr += xfersize;
- len -= xfersize;
- }
- return origlen; /* no error possible */
-}
-
-void
-remote_files_info ()
-{
- printf ("remote files info missing here. FIXME.\n");
-}
-
-/*
-
-A debug packet whose contents are <data>
-is encapsulated for transmission in the form:
-
- $ <data> # CSUM1 CSUM2
-
- <data> must be ASCII alphanumeric and cannot include characters
- '$' or '#'
-
- CSUM1 and CSUM2 are ascii hex representation of an 8-bit
- checksum of <data>, the most significant nibble is sent first.
- the hex digits 0-9,a-f are used.
-
-Receiver responds with:
-
- + - if CSUM is correct and ready for next packet
- - - if CSUM is incorrect
-
-*/
-
-static int
-readchar ()
-{
- char buf;
-
- buf = '\0';
-#ifdef HAVE_TERMIO
- /* termio does the timeout for us. */
- read (remote_desc, &buf, 1);
-#else
- alarm (timeout);
- read (remote_desc, &buf, 1);
- alarm (0);
-#endif
-
- return buf & 0x7f;
-}
-
-/* Send the command in BUF to the remote machine,
- and read the reply into BUF.
- Report an error if we get an error reply. */
-
-static void
-remote_send (buf)
- char *buf;
-{
-
- putpkt (buf);
- getpkt (buf);
-
- if (buf[0] == 'E')
- error ("Remote failure reply: %s", buf);
-}
-
-/* Send a packet to the remote machine, with error checking.
- The data of the packet is in BUF. */
-
-static void
-putpkt (buf)
- char *buf;
-{
- int i;
- unsigned char csum = 0;
- char buf2[500];
- int cnt = strlen (buf);
- char ch;
- char *p;
-
- /* Copy the packet into buffer BUF2, encapsulating it
- and giving it a checksum. */
-
- p = buf2;
- *p++ = '$';
-
- for (i = 0; i < cnt; i++)
- {
- csum += buf[i];
- *p++ = buf[i];
- }
- *p++ = '#';
- *p++ = tohex ((csum >> 4) & 0xf);
- *p++ = tohex (csum & 0xf);
-
- /* Send it over and over until we get a positive ack. */
-
- do {
- if (kiodebug)
- {
- *p = '\0';
- printf ("Sending packet: %s (%s)\n", buf2, buf);
- }
- write (remote_desc, buf2, p - buf2);
-
- /* read until either a timeout occurs (\0) or '+' is read */
- do {
- ch = readchar ();
- } while ((ch != '+') && (ch != '\0'));
- } while (ch != '+');
-}
-
-/* Read a packet from the remote machine, with error checking,
- and store it in BUF. */
-
-static void
-getpkt (buf)
- char *buf;
-{
- char *bp;
- unsigned char csum;
- int c;
- unsigned char c1, c2;
-
-#if 0
- /* Sorry, this will cause all hell to break loose, i.e. we'll end
- up in the command loop with an inferior, but (at least if this
- happens in remote_wait or some such place) without a current_frame,
- having set up prev_* in wait_for_inferior, etc.
-
- If it is necessary to have such an "emergency exit", seems like
- the only plausible thing to do is to say the inferior died, and
- make the user reattach if they want to. Perhaps with a prompt
- asking for confirmation. */
-
- /* allow immediate quit while reading from device, it could be hung */
- immediate_quit++;
-#endif /* 0 */
-
- while (1)
- {
- /* Force csum to be zero here because of possible error retry. */
- csum = 0;
-
- while ((c = readchar()) != '$');
-
- bp = buf;
- while (1)
- {
- c = readchar ();
- if (c == '#')
- break;
- *bp++ = c;
- csum += c;
- }
- *bp = 0;
-
- c1 = fromhex (readchar ());
- c2 = fromhex (readchar ());
- if ((csum & 0xff) == (c1 << 4) + c2)
- break;
- printf ("Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n",
- (c1 << 4) + c2, csum & 0xff, buf);
- write (remote_desc, "-", 1);
- }
-
-#if 0
- immediate_quit--;
-#endif
-
- write (remote_desc, "+", 1);
-
- if (kiodebug)
- fprintf (stderr,"Packet received :%s\n", buf);
-}
-
-/* The data cache leads to incorrect results because it doesn't know about
- volatile variables, thus making it impossible to debug functions which
- use hardware registers. Therefore it is #if 0'd out. Effect on
- performance is some, for backtraces of functions with a few
- arguments each. For functions with many arguments, the stack
- frames don't fit in the cache blocks, which makes the cache less
- helpful. Disabling the cache is a big performance win for fetching
- large structures, because the cache code fetched data in 16-byte
- chunks. */
-#if 0
-/* The data cache records all the data read from the remote machine
- since the last time it stopped.
-
- Each cache block holds 16 bytes of data
- starting at a multiple-of-16 address. */
-
-#define DCACHE_SIZE 64 /* Number of cache blocks */
-
-struct dcache_block {
- struct dcache_block *next, *last;
- unsigned int addr; /* Address for which data is recorded. */
- int data[4];
-};
-
-struct dcache_block dcache_free, dcache_valid;
-
-/* Free all the data cache blocks, thus discarding all cached data. */
-
-static void
-dcache_flush ()
-{
- register struct dcache_block *db;
-
- while ((db = dcache_valid.next) != &dcache_valid)
- {
- remque (db);
- insque (db, &dcache_free);
- }
-}
-
-/*
- * If addr is present in the dcache, return the address of the block
- * containing it.
- */
-
-struct dcache_block *
-dcache_hit (addr)
-{
- register struct dcache_block *db;
-
- if (addr & 3)
- abort ();
-
- /* Search all cache blocks for one that is at this address. */
- db = dcache_valid.next;
- while (db != &dcache_valid)
- {
- if ((addr & 0xfffffff0) == db->addr)
- return db;
- db = db->next;
- }
- return NULL;
-}
-
-/* Return the int data at address ADDR in dcache block DC. */
-
-int
-dcache_value (db, addr)
- struct dcache_block *db;
- unsigned int addr;
-{
- if (addr & 3)
- abort ();
- return (db->data[(addr>>2)&3]);
-}
-
-/* Get a free cache block, put it on the valid list,
- and return its address. The caller should store into the block
- the address and data that it describes. */
-
-struct dcache_block *
-dcache_alloc ()
-{
- register struct dcache_block *db;
-
- if ((db = dcache_free.next) == &dcache_free)
- /* If we can't get one from the free list, take last valid */
- db = dcache_valid.last;
-
- remque (db);
- insque (db, &dcache_valid);
- return (db);
-}
-
-/* Return the contents of the word at address ADDR in the remote machine,
- using the data cache. */
-
-int
-dcache_fetch (addr)
- CORE_ADDR addr;
-{
- register struct dcache_block *db;
-
- db = dcache_hit (addr);
- if (db == 0)
- {
- db = dcache_alloc ();
- remote_read_bytes (addr & ~0xf, db->data, 16);
- db->addr = addr & ~0xf;
- }
- return (dcache_value (db, addr));
-}
-
-/* Write the word at ADDR both in the data cache and in the remote machine. */
-
-dcache_poke (addr, data)
- CORE_ADDR addr;
- int data;
-{
- register struct dcache_block *db;
-
- /* First make sure the word is IN the cache. DB is its cache block. */
- db = dcache_hit (addr);
- if (db == 0)
- {
- db = dcache_alloc ();
- remote_read_bytes (addr & ~0xf, db->data, 16);
- db->addr = addr & ~0xf;
- }
-
- /* Modify the word in the cache. */
- db->data[(addr>>2)&3] = data;
-
- /* Send the changed word. */
- remote_write_bytes (addr, &data, 4);
-}
-
-/* Initialize the data cache. */
-
-dcache_init ()
-{
- register i;
- register struct dcache_block *db;
-
- db = (struct dcache_block *) xmalloc (sizeof (struct dcache_block) *
- DCACHE_SIZE);
- dcache_free.next = dcache_free.last = &dcache_free;
- dcache_valid.next = dcache_valid.last = &dcache_valid;
- for (i=0;i<DCACHE_SIZE;i++,db++)
- insque (db, &dcache_free);
-}
-#endif /* 0 */
-
-/* Define the target subroutine names */
-
-struct target_ops remote_ops = {
- "remote", "Remote serial target in gdb-specific protocol",
- "Use a remote computer via a serial line, using a gdb-specific protocol.\n\
-Specify the serial device it is connected to (e.g. /dev/ttya).",
- remote_open, remote_close,
- 0, remote_detach, remote_resume, remote_wait, /* attach */
- remote_fetch_registers, remote_store_registers,
- remote_prepare_to_store, 0, 0, /* conv_from, conv_to */
- remote_xfer_inferior_memory, remote_files_info,
- 0, 0, /* insert_breakpoint, remove_breakpoint, */
- 0, 0, 0, 0, 0, /* Terminal crud */
- 0, /* kill */
- 0, add_syms_addr_command, /* load */
- call_function_by_hand,
- 0, /* lookup_symbol */
- 0, 0, /* create_inferior FIXME, mourn_inferior FIXME */
- process_stratum, 0, /* next */
- 1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
- OPS_MAGIC, /* Always the last thing */
-};
-
-void
-_initialize_remote ()
-{
- add_target (&remote_ops);
-}
diff --git a/gdb/rs6000-pinsn.c b/gdb/rs6000-pinsn.c
deleted file mode 100644
index d1e2399..0000000
--- a/gdb/rs6000-pinsn.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/* Print rs6000 instructions for objdump.
- This file is part of the binutils.
-*/
-
-
-#include <stdio.h>
-#include "defs.h"
-#include "rs6k-opcode.h"
-
-
-/* Print the rs6k instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- int pop, eop; /* primary and extended opcodes */
- int min, max;
- int best = -1; /* found best opcode index */
- int oldbest = -1;
- unsigned int the_insn;
-
- read_memory (memaddr, &the_insn, sizeof (the_insn));
- pop = (unsigned)(the_insn >> 26);
- eop = ((the_insn) >> 1) & 0x3ff;
- min = 0, max = NOPCODES-1;
-
- while (min < max) {
- best = (min + max) / 2;
-
- /* see if we are running in loops */
- if (best == oldbest)
- goto not_found;
- oldbest = best;
-
- if (pop < rs6k_ops [best].p_opcode)
- max = best;
-
- else if (pop > rs6k_ops [best].p_opcode)
- min = best;
-
- else {
- /* opcode matched, check extended opcode. */
-
- if (rs6k_ops [best].e_opcode == -1) {
- /* there is no valid extended opcode, what we've got is
- just fine. */
- goto insn_found;
- }
-
- else if (eop < rs6k_ops [best].e_opcode) {
-
- while (pop == rs6k_ops [best].p_opcode) {
- if (eop == rs6k_ops [best].e_opcode) /* found it! */
- goto insn_found;
- --best;
- }
- goto not_found;
- }
-
- else if (eop > rs6k_ops [best].e_opcode) {
-
- while (pop == rs6k_ops [best].p_opcode) {
- if (eop == rs6k_ops [best].e_opcode) /* found it! */
- goto insn_found;
- ++best;
- }
- goto not_found;
- }
-
- else /* eop == rs6k_ops [best].e_opcode */
- goto insn_found;
- }
- }
-
- best = min;
- if (pop == rs6k_ops [best].p_opcode &&
- (rs6k_ops [best].e_opcode == -1 || rs6k_ops [best].e_opcode == eop))
- goto insn_found;
-
- else
- goto not_found;
-
-
-insn_found:
- print_operator (stream, memaddr, the_insn, best);
- return 4;
-
-not_found:
- fprintf (stream, "0x%08x", the_insn);
- return 4;
-}
-
-
-
-/* condition code names */
-static char *cond_code [] = {
- "lt", "gt", "eq", "so", "ge", "le", "ne", "ns", "nl", "ng", "z", "nz" };
-
-
-print_operator (stream, memaddr, insn_word, insn_no)
-FILE *stream;
-long memaddr;
-long insn_word;
-int insn_no;
-{
- char buf [BUFSIZ];
- char *qq = buf;
- char *pp = rs6k_ops[insn_no].opr_ext;
- int tmp;
- int nocomma = 0; /* true if no comma needed */
-
- *qq = '\0';
- if (pp) {
- while (*pp) {
-
- switch ( *pp ) {
- case '.':
- if (insn_word & 0x1)
- *qq++ = '.';
- break;
-
- case 'l':
- if (insn_word & 0x1)
- *qq++ = 'l';
- break;
-
- case 't':
- if ((insn_word & 0x03e00000) == 0x01800000)
- *qq++ = 't';
- break;
-
- case 'f':
- if ((insn_word & 0x03e00000) == 0x00800000)
- *qq++ = 'f';
- break;
-
- case 'a':
- if (insn_word & 0x2)
- *qq++ = 'a';
- break;
-
- case 'o':
- if (insn_word & 0x4000)
- *qq++ = 'o';
- break;
-
- case '1': /* exception #1 for bb/bc ambiguity */
- tmp = (insn_word >> 21) & 0x1f; /* extract BO */
- if (tmp != 0xc && tmp != 0x4) {
- /* you can't use `bb' now. switch to `bc' */
- *(qq-1) = 'c';
- ++insn_no;
- pp = rs6k_ops[insn_no].opr_ext;
- continue;
- }
- break;
-
- default:
- abort ();
- }
- ++pp;
- }
- }
-
- /* tab between orerator and operand */
- *qq++ = '\t';
-
- /* parse the operand now. */
- pp = rs6k_ops[insn_no].oprnd_format;
-
- while (1) {
- switch (*pp) {
- case TO :
- sprintf (qq, "%d", (insn_word >> 21) & 0x1f);
- break;
-
- case RT :
- case RS :
- sprintf (qq, "r%d", (insn_word >> 21) & 0x1f);
- break;
-
- case LI :
- tmp = (insn_word >> 16) & 0x1f;
- if (tmp > 11) {
- fprintf (stderr, "Internal error: unknown cond code: 0x%x\n", insn_word);
- tmp = 0;
- }
- sprintf (qq, "%s", cond_code [tmp]);
- break;
-
-#if 0
- case A2 :
- tmp = (insn_word >> 2) & 0x3fff;
- if (tmp & 0x2000)
- tmp -= 0x4000;
- sprintf (qq, "0x%x", tmp * 4 + memaddr);
- break;
-#endif
- case A2 :
- case TA14 :
- tmp = (insn_word & 0xfffc);
- if (tmp & 0x8000) /* fix sign extension */
- tmp -= 0x10000;
-
- if ((insn_word & 0x2) == 0) /* if AA not set */
- tmp += memaddr;
-
- sprintf (qq, "0x%x", tmp);
- break;
-
- case TA24 :
- tmp = insn_word & 0x03fffffc;
- if (tmp & 0x2000000)
- tmp -= 0x4000000;
-
- if ((insn_word & 0x2) == 0) /* if no AA bit set */
- tmp += memaddr;
-
- sprintf (qq, "0x%x", tmp);
- break;
-
- case LEV : /* for svc only */
- if (insn_word & 0x2) { /* SA is set */
- nocomma = 1;
- *qq = '\0';
- }
- else
- sprintf (qq, "%d", (insn_word >> 5) & 0x7f);
- break;
-
- case FL1 : /* for svc only */
- if (insn_word & 0x2) { /* SA is set */
- nocomma = 1;
- *qq = '\0';
- }
- else
- sprintf (qq, "%d", (insn_word >> 12) & 0xf);
- break;
-
- case FL2 : /* for svc only */
- nocomma = 0;
- if (insn_word & 0x2) /* SA is set */
- sprintf (qq, "%d", (insn_word >> 2) & 0x3fff);
- else
- sprintf (qq, "%d", (insn_word >> 2) & 0x7);
- break;
-
- case RA :
- if (nocomma) {
- sprintf (qq, "r%d)", (insn_word >> 16) & 0x1f);
- nocomma = 0;
- }
- else
- sprintf (qq, "r%d", (insn_word >> 16) & 0x1f);
- break;
-
- case RB :
- sprintf (qq, "r%d", (insn_word >> 11) & 0x1f);
- break;
-
- case SI :
- tmp = insn_word & 0xffff;
- if (tmp & 0x8000)
- tmp -= 0x10000;
- sprintf (qq, "%d", tmp);
- break;
-
- case UI :
- sprintf (qq, "%d", insn_word & 0xffff);
- break;
-
- case BF :
- sprintf (qq, "%d", (insn_word >> 23) & 0x7);
- break;
-
- case BFA :
- sprintf (qq, "%d", (insn_word >> 18) & 0x7);
- break;
-
- case BT :
- sprintf (qq, "%d", (insn_word >> 21) & 0x1f);
- break;
-
- case BA :
- sprintf (qq, "%d", (insn_word >> 16) & 0x1f);
- break;
-
- case BB :
- sprintf (qq, "%d", (insn_word >> 11) & 0x1f);
- break;
-
- case BO :
- sprintf (qq, "%d", (insn_word >> 21) & 0x1f);
- break;
-
- case BI :
- sprintf (qq, "%d", (insn_word >> 16) & 0x1f);
- break;
-
- case SH :
- sprintf (qq, "%d", (insn_word >> 11) & 0x1f);
- break;
-
- case MB :
- sprintf (qq, "0x%x", (insn_word >> 6) & 0x1f);
- break;
-
- case ME :
- sprintf (qq, "0x%x", (insn_word >> 1) & 0x1f);
- break;
-
- case SPR :
- sprintf (qq, "%d", (insn_word >> 16) & 0x1f);
- break;
-
- case DIS :
- nocomma = 1;
- tmp = insn_word & 0xffff;
- if (tmp & 0x8000)
- tmp -= 0x10000;
- sprintf (qq, "%d(", tmp);
- break;
-
- case FXM :
- sprintf (qq, "0x%x", (insn_word >> 12) & 0xff);
- break;
-
- case FRT :
- case FRS :
- sprintf (qq, "f%d", (insn_word >> 21) & 0x1f);
- break;
-
- case FRA :
- sprintf (qq, "f%d", (insn_word >> 16) & 0x1f);
- break;
-
- case FRB :
- sprintf (qq, "f%d", (insn_word >> 11) & 0x1f);
- break;
-
- case FRC :
- sprintf (qq, "f%d", (insn_word >> 6) & 0x1f);
- break;
-
- case FLM :
- sprintf (qq, "0x%x", (insn_word >> 17) & 0xff);
- break;
-
- case NB :
- sprintf (qq, "%d", (insn_word >> 11) & 0x1f);
- break;
-
- case I :
- sprintf (qq, "%d", (insn_word >> 12) & 0xf);
- break;
-
- default :
- sprintf (qq, "Unknown operand format identifier????");
- abort ();
- }
- while (*qq) ++qq;
- ++pp;
-
- if (*pp == '\0')
- break;
- else if (!nocomma)
- *qq++ = ',';
- }
- *qq = '\0';
-
- fprintf (stream, "0x%08x\t%s%s",
- insn_word, rs6k_ops[insn_no].operator, buf);
-}
-
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
deleted file mode 100644
index 4003de0..0000000
--- a/gdb/rs6000-tdep.c
+++ /dev/null
@@ -1,975 +0,0 @@
-/* Target-dependent code for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "target.h"
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/ptrace.h>
-#include <sys/reg.h>
-
-#include <a.out.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/core.h>
-
-extern int errno;
-extern int attach_flag;
-
-/* Nonzero if we just simulated a single step break. */
-int one_stepped;
-
-#if 0
-
-/* This is Damon's implementation of single step simulation. It suffers the
- following program:
-
- 1 main () {
- 2 char buf[10];
- 3 puts ("test");
- 4 strcmp (buf, "test"); puts ("test");
- 5 exit (0);
- 6 }
-
- You cannot `next' on line 4 in the above program. gdb puts a breakpoint
- to the return address of `strcmp', and when execution arrives that point,
- it is still in the line range and gdb attemps to resume it with single
- steps. At that point the breakpoint at step_resume_break_address (return
- address of strcmp) and single step's breakpoint mixes up and we end up
- with a breakpoint which its shadow and itself are identical.
-
- Fix that problem and use this version. FIXMEmgo.
-*/
-
-
-static struct sstep_breaks {
- int address;
- int data;
-} tbreak[2];
-
-
-/*
- * branch_dest - calculate all places the current instruction may go
- */
-static
-branch_dest(tb)
- register struct sstep_breaks *tb;
-{
- register ulong opcode, iar;
- long instr;
- int immediate, absolute;;
-
- iar = read_pc(); /* current IAR */
- target_read_memory(iar, &instr, sizeof (instr)); /* current inst */
-
- opcode = instr >> 26;
- absolute = instr & 2;
-
- tb[1].address = -1;
-
- switch (opcode) {
- case 0x10: /* branch conditional */
- immediate = ((instr & ~3) << 16) >> 16;
-
- /*
- * two possible locations for next instruction
- */
- tb[0].address = iar + 4;
- tb[1].address = immediate + (absolute ? 0 : iar);
-
- break;
-
- case 0x12: /* branch unconditional */
- immediate = ((instr & ~3) << 6) >> 6;
-
- /*
- * only one possible location for next instr
- */
- tb[0].address = immediate + (absolute ? 0 : iar);
-
- break;
-
- case 0x13: /* branch conditional register */
- /*
- * WE NEED TO CHECK THE CR HERE, TO SEE IF THIS IS
- * REALLY UNCONDITIONAL.
- */
- tb++->address = iar + 4;
-
- switch ((instr >> 1) & 0x3ff) {
- case 0x10: /* branch conditional register */
- tb->address = read_register(LR_REGNUM) & ~3;
- sigtramp_chk(tb); /* return from sig handler? */
- break;
-
- case 0x210: /* branch cond to CTR */
- tb->address = read_register(CTR_REGNUM) & ~3;
- sigtramp_chk(tb); /* return from sig handler? */
- break;
-
- default:
- /*
- * not a branch.
- */
- tb->address = iar + 4;
- break;
- }
- break;
-
- default:
- /*
- * not a branch, flow proceeds normally
- */
- tb->address = iar + 4;
- break;
- }
-}
-
-/*
- * sigtramp_chk - heuristic check to see if we think we are returning
- * from a signal handler.
- *
- * Input:
- * tb - ^ to a single step branch location
- *
- * Note:
- * When we are at the "br" instruction returning to a signal handler,
- * we return in user mode to an address in the kernel. If the
- * segment of the branch target is 0, we may very well be in a
- * signal handler. From scrounging through this code, we note that
- * register 29 has the signal context pointer, from which we can
- * determine where we will end up next.
- */
-sigtramp_chk(tb)
-register struct sstep_breaks *tb; {
- struct sigcontext sc;
-
- if (tb->address & 0xf0000000)
- return; /* can't have been sigtramp */
-
- if (target_read_memory(read_register(GPR29), &sc, sizeof (sc)))
- return; /* read fails, heuristic fails */
-
- if ((sc.sc_jmpbuf.jmp_context.iar & 0xf0000000) == 0x10000000) {
- /*
- * looks like it might be ok.....
- */
- tb->address = sc.sc_jmpbuf.jmp_context.iar;
- }
-}
-
-
-/*
- * single_step - no trace mode harware support, or software support.
- * sigh.
- */
-single_step(signal) {
- register i;
-
- if (!one_stepped) {
- /*
- * need to set breakpoints for single step.
- * figure out all places the current instruction could go.
- */
- branch_dest(&tbreak[0]);
-
- /*
- * always at least one place to go to
- */
- target_insert_breakpoint(tbreak[0].address, &tbreak[0].data);
-
- /*
- * if there is another possible location, set a breakpoint there
- * as well.
- */
- if (tbreak[1].address != -1)
- target_insert_breakpoint(tbreak[1].address, &tbreak[1].data);
-
- one_stepped = 1;
- ptrace(PT_CONTINUE, inferior_pid, 1, signal, 0);
- } else {
- /*
- * need to clear the breakpoints.
- */
- for (i = 0; i < 2; ++i)
- if (tbreak[i].address != -1)
- target_remove_breakpoint(tbreak[i].address, &tbreak[i].data);
-
- one_stepped = 0;
- }
-
- return 1;
-}
-
-#else /* !DAMON'S VERSION */
-
-/* Breakpoint shadows for the single step instructions will be kept here. */
-
-static struct sstep_breaks {
- int address;
- int data;
-} stepBreaks[2];
-
-
-/*
- * Calculate the destination of a branch/jump. Return -1 if not a branch.
- */
-static int
-branch_dest (opcode, instr, pc, safety)
- int opcode, instr, pc, safety;
-{
- register long offset;
- unsigned dest;
- int immediate;
- int absolute;
- int ext_op;
-
- absolute = (int) ((instr >> 1) & 1);
-
- switch (opcode) {
- case 18 :
- immediate = ((instr & ~3) << 6) >> 6; /* br unconditionl */
-
- case 16 :
- if (opcode != 18) /* br conditional */
- immediate = ((instr & ~3) << 16) >> 16;
- if (absolute)
- dest = immediate;
- else
- dest = pc + immediate;
- break;
-
- case 19 :
- ext_op = (instr>>1) & 0x3ff;
-
- if (ext_op == 16) /* br conditional register */
- dest = read_register (LR_REGNUM) & ~3;
-
- else if (ext_op == 528) /* br cond to count reg */
- dest = read_register (CTR_REGNUM) & ~3;
-
- else return -1;
- break;
-
- default: return -1;
- }
- return (dest < 0x10000000) ? safety : dest;
-}
-
-
-
-/* AIX does not support PT_STEP. Simulate it. */
-
-int
-single_step (signal)
-int signal;
-{
-#define INSNLEN(OPCODE) 4
-
- static char breakp[] = BREAKPOINT;
- int ii, insn, ret, loc;
- int breaks[2], opcode;
-
- if (!one_stepped) {
- extern CORE_ADDR text_start;
- loc = read_pc ();
-
- ret = read_memory (loc, &insn, sizeof (int));
- if (ret)
- printf ("Error in single_step()!!\n");
-
- breaks[0] = loc + INSNLEN(insn);
- opcode = insn >> 26;
- breaks[1] = branch_dest (opcode, insn, loc, breaks[0]);
-
- stepBreaks[1].address = -1;
-
- for (ii=0; ii < 2; ++ii) {
-
- /* ignore invalid breakpoint. */
- if ( breaks[ii] == -1)
- continue;
-
- read_memory (breaks[ii], &(stepBreaks[ii].data), sizeof(int));
-
- ret = write_memory (breaks[ii], breakp, sizeof(int));
- stepBreaks[ii].address = breaks[ii];
- }
-
- one_stepped = 1;
- ptrace (PT_CONTINUE, inferior_pid, 1, signal);
- }
- else {
-
- /* remove step breakpoints. */
- for (ii=0; ii < 2; ++ii)
- if (stepBreaks[ii].address != -1)
- write_memory
- (stepBreaks[ii].address, &(stepBreaks[ii].data), sizeof(int));
-
- one_stepped = 0;
- }
- return 1;
-}
-#endif /* !DAMON's version of single step. */
-
-
-
-/* return pc value after skipping a function prologue. */
-
-skip_prologue (pc)
-int pc;
-{
- unsigned int tmp;
- unsigned int op;
-
- if (target_read_memory (pc, (char *)&op, sizeof (op)))
- return pc; /* Can't access it -- assume no prologue. */
- SWAP_TARGET_AND_HOST (&op, sizeof (op));
-
- /* Assume that subsequent fetches can fail with low probability. */
-
- if (op == 0x7c0802a6) { /* mflr r0 */
- pc += 4;
- op = read_memory_integer (pc, 4);
- }
- else /* else, this is a frameless invocation */
- return pc;
-
- if ((op & 0xfc00003e) == 0x7c000026) { /* mfcr Rx */
- pc += 4;
- op = read_memory_integer (pc, 4);
- }
-
- if ((op & 0xfc000000) == 0x48000000) { /* bl foo, to save fprs??? */
- pc += 4;
- op = read_memory_integer (pc, 4);
- }
-
- if ((op & 0xfc1f0000) == 0xd8010000) { /* stfd Rx,NUM(r1) */
- pc += 4; /* store floating register double */
- op = read_memory_integer (pc, 4);
- }
-
- if ((op & 0xfc1f0000) == 0xbc010000) { /* stm Rx, NUM(r1) */
- pc += 4;
- op = read_memory_integer (pc, 4);
- }
-
- while (((tmp = op >> 16) == 0x9001) || /* st r0, NUM(r1) */
- (tmp == 0x9421) || /* stu r1, NUM(r1) */
- (op == 0x93e1fffc)) /* st r31,-4(r1) */
- {
- pc += 4;
- op = read_memory_integer (pc, 4);
- }
-
- while ((tmp = (op >> 22)) == 0x20f) { /* l r31, ... or */
- pc += 4; /* l r30, ... */
- op = read_memory_integer (pc, 4);
- }
-
- while ((op & 0xfc1f0000) == 0x90010000) { /* st r?, NUM(r1) */
- pc += 4;
- op = read_memory_integer (pc, 4);
- }
-
- if (op == 0x603f0000) { /* oril r31, r1, 0x0 */
- pc += 4; /* this happens if r31 is used as */
- op = read_memory_integer (pc, 4); /* frame ptr. (gcc does that) */
-
- if ((op >> 16) == 0x907f) { /* st r3, NUM(r31) */
- pc += 4;
- op = read_memory_integer (pc, 4);
- }
- }
- return pc;
-}
-
-/* text start and end addresses in virtual memory. */
-
-CORE_ADDR text_start;
-CORE_ADDR text_end;
-
-
-/*************************************************************************
- Support for creating pushind a dummy frame into the stack, and popping
- frames, etc.
-*************************************************************************/
-
-#define DUMMY_FRAME_ADDR_SIZE 10
-
-/* Make sure you initialize these in somewhere, in case gdb gives up what it
- was debugging and starts debugging something else. FIXMEmgo */
-
-static int dummy_frame_count = 0;
-static int dummy_frame_size = 0;
-static CORE_ADDR *dummy_frame_addr = 0;
-
-extern int stop_stack_dummy;
-
-/* push a dummy frame into stack, save all register. Currently we are saving
- only gpr's and fpr's, which is not good enough! FIXMEmgo */
-
-push_dummy_frame ()
-{
- int sp, pc; /* stack pointer and link register */
- int ii;
-
- if (dummy_frame_count >= dummy_frame_size) {
- dummy_frame_size += DUMMY_FRAME_ADDR_SIZE;
- if (dummy_frame_addr)
- dummy_frame_addr = (CORE_ADDR*) xrealloc
- (dummy_frame_addr, sizeof(CORE_ADDR) * (dummy_frame_size));
- else
- dummy_frame_addr = (CORE_ADDR*)
- xmalloc (sizeof(CORE_ADDR) * (dummy_frame_size));
- }
-
- sp = read_register(SP_REGNUM);
- pc = read_register(PC_REGNUM);
-
- dummy_frame_addr [dummy_frame_count++] = sp;
-
- /* Be careful! If the stack pointer is not decremented first, then kernel
- thinks he is free to use the sapce underneath it. And kernel actually
- uses that area for IPC purposes when executing ptrace(2) calls. So
- before writing register values into the new frame, decrement and update
- %sp first in order to secure your frame. */
-
- write_register (SP_REGNUM, sp-408);
-
-#if 1
- /* gdb relies on the state of current_frame. We'd better update it,
- otherwise things like do_registers_info() wouldn't work properly! */
-
- flush_cached_frames ();
- set_current_frame (create_new_frame (sp-408, pc));
-#endif /* 0 */
-
- /* save program counter in link register's space. */
- write_memory (sp+8, &pc, 4);
-
- /* save full floating point registers here. They will be from F14..F31
- for know. I am not sure if we need to save everything here! */
-
- /* fpr's, f0..f31 */
- for (ii = 0; ii < 32; ++ii)
- write_memory (sp-8-(ii*8), &registers[REGISTER_BYTE (31-ii+FP0_REGNUM)], 8);
-
- /* gpr's r0..r31 */
- for (ii=1; ii <=32; ++ii)
- write_memory (sp-256-(ii*4), &registers[REGISTER_BYTE (32-ii)], 4);
-
- /* so far, 32*2 + 32 words = 384 bytes have been written. We need 6 words
- (24 bytes) for the rest of the registers. It brings the total to 408
- bytes.
- save sp or so call back chain right here. */
- write_memory (sp-408, &sp, 4);
- sp -= 408;
-
- /* And finally, this is the back chain. */
- write_memory (sp+8, &pc, 4);
-}
-
-
-/* Pop a dummy frame.
-
- In rs6000 when we push a dummy frame, we save all of the registers. This
- is usually done before user calls a function explicitly.
-
- After a dummy frame is pushed, some instructions are copied into stack, and
- stack pointer is decremented even more. Since we don't have a frame pointer to
- get back to the parent frame of the dummy, we start having trouble poping it.
- Therefore, we keep a dummy frame stack, keeping addresses of dummy frames as
- such. When poping happens and when we detect that was a dummy frame, we pop
- it back to its parent by using dummy frame stack (`dummy_frame_addr' array).
- */
-
-pop_dummy_frame ()
-{
- CORE_ADDR sp, pc;
- int ii;
- sp = dummy_frame_addr [--dummy_frame_count];
-
- /* restore all fpr's. */
- for (ii = 1; ii <= 32; ++ii)
- read_memory (sp-(ii*8), &registers[REGISTER_BYTE (32-ii+FP0_REGNUM)], 8);
-
- /* restore all gpr's */
- for (ii=1; ii <= 32; ++ii) {
- read_memory (sp-256-(ii*4), &registers[REGISTER_BYTE (32-ii)], 4);
- }
-
- read_memory (sp-400, &registers [REGISTER_BYTE(PC_REGNUM)], 4);
-
- /* when a dummy frame was being pushed, we had to decrement %sp first, in
- order to secure astack space. Thus, saved %sp (or %r1) value, is not the
- one we should restore. Change it with the one we need. */
-
- *(int*)&registers [REGISTER_BYTE(FP_REGNUM)] = sp;
-
- /* Now we can restore all registers. */
-
- store_inferior_registers (-1);
- pc = read_pc ();
- flush_cached_frames ();
- set_current_frame (create_new_frame (sp, pc));
-}
-
-
-/* pop the innermost frame, go back to the caller. */
-
-pop_frame ()
-{
- int pc, lr, sp, prev_sp; /* %pc, %lr, %sp */
- FRAME fr = get_current_frame ();
- int offset = 0;
- int frameless = 0; /* TRUE if function is frameless */
- int addr, ii;
- int saved_gpr, saved_fpr; /* # of saved gpr's and fpr's */
-
- pc = read_pc ();
- sp = FRAME_FP (fr);
-
- if (stop_stack_dummy && dummy_frame_count) {
- pop_dummy_frame ();
- return;
- }
-
- /* figure out previous %pc value. If the function is frameless, it is
- still in the link register, otherwise walk the frames and retrieve the
- saved %pc value in the previous frame. */
-
- addr = get_pc_function_start (fr->pc) + FUNCTION_START_OFFSET;
- function_frame_info (addr, &frameless, &offset, &saved_gpr, &saved_fpr);
-
- read_memory (sp, &prev_sp, 4);
- if (frameless)
- lr = read_register (LR_REGNUM);
- else
- read_memory (prev_sp+8, &lr, 4);
-
- /* reset %pc value. */
- write_register (PC_REGNUM, lr);
-
- /* reset register values if any was saved earlier. */
- addr = prev_sp - offset;
-
- if (saved_gpr != -1)
- for (ii=saved_gpr; ii <= 31; ++ii) {
- read_memory (addr, &registers [REGISTER_BYTE (ii)], 4);
- addr += sizeof (int);
- }
-
- if (saved_fpr != -1)
- for (ii=saved_fpr; ii <= 31; ++ii) {
- read_memory (addr, &registers [REGISTER_BYTE (ii+FP0_REGNUM)], 8);
- addr += 8;
- }
-
- write_register (SP_REGNUM, prev_sp);
- store_inferior_registers (-1);
- flush_cached_frames ();
- set_current_frame (create_new_frame (prev_sp, lr));
-}
-
-
-/* fixup the call sequence of a dummy function, with the real function address.
- its argumets will be passed by gdb. */
-
-fix_call_dummy(dummyname, pc, fun, nargs, type)
- char *dummyname;
- int pc;
- int fun;
- int nargs; /* not used */
- int type; /* not used */
-
-{
-#define TOC_ADDR_OFFSET 20
-#define TARGET_ADDR_OFFSET 28
-
- int ii;
- unsigned long target_addr;
- unsigned long tocvalue;
-
- target_addr = fun;
- tocvalue = find_toc_address (target_addr);
-
- ii = *(int*)((char*)dummyname + TOC_ADDR_OFFSET);
- ii = (ii & 0xffff0000) | (tocvalue >> 16);
- *(int*)((char*)dummyname + TOC_ADDR_OFFSET) = ii;
-
- ii = *(int*)((char*)dummyname + TOC_ADDR_OFFSET+4);
- ii = (ii & 0xffff0000) | (tocvalue & 0x0000ffff);
- *(int*)((char*)dummyname + TOC_ADDR_OFFSET+4) = ii;
-
- ii = *(int*)((char*)dummyname + TARGET_ADDR_OFFSET);
- ii = (ii & 0xffff0000) | (target_addr >> 16);
- *(int*)((char*)dummyname + TARGET_ADDR_OFFSET) = ii;
-
- ii = *(int*)((char*)dummyname + TARGET_ADDR_OFFSET+4);
- ii = (ii & 0xffff0000) | (target_addr & 0x0000ffff);
- *(int*)((char*)dummyname + TARGET_ADDR_OFFSET+4) = ii;
-}
-
-
-
-/* return information about a function frame.
- - frameless is TRUE, if function does not save %pc value in its frame.
- - offset is the number of bytes used in the frame to save registers.
- - saved_gpr is the number of the first saved gpr.
- - saved_fpr is the number of the first saved fpr.
- */
-function_frame_info (pc, frameless, offset, saved_gpr, saved_fpr)
- int pc;
- int *frameless, *offset, *saved_gpr, *saved_fpr;
-{
- unsigned int tmp;
- register unsigned int op;
-
- *offset = 0;
- *saved_gpr = *saved_fpr = -1;
-
- if (!inferior_pid)
- return;
-
- op = read_memory_integer (pc, 4);
- if (op == 0x7c0802a6) { /* mflr r0 */
- pc += 4;
- op = read_memory_integer (pc, 4);
- *frameless = 0;
- }
- else /* else, this is a frameless invocation */
- *frameless = 1;
-
-
- if ((op & 0xfc00003e) == 0x7c000026) { /* mfcr Rx */
- pc += 4;
- op = read_memory_integer (pc, 4);
- }
-
- if ((op & 0xfc000000) == 0x48000000) { /* bl foo, to save fprs??? */
- pc += 4;
- op = read_memory_integer (pc, 4);
- }
-
- if ((op & 0xfc1f0000) == 0xd8010000) { /* stfd Rx,NUM(r1) */
- pc += 4; /* store floating register double */
- op = read_memory_integer (pc, 4);
- }
-
- if ((op & 0xfc1f0000) == 0xbc010000) { /* stm Rx, NUM(r1) */
- int tmp2;
- *saved_gpr = (op >> 21) & 0x1f;
- tmp2 = op & 0xffff;
- if (tmp2 > 0x7fff)
- tmp2 = 0xffff0000 | tmp2;
-
- if (tmp2 < 0) {
- tmp2 = tmp2 * -1;
- *saved_fpr = (tmp2 - ((32 - *saved_gpr) * 4)) / 8;
- if ( *saved_fpr > 0)
- *saved_fpr = 32 - *saved_fpr;
- else
- *saved_fpr = -1;
- }
- *offset = tmp2;
- }
-}
-
-
-/* Pass the arguments in either registers, or in the stack. In RS6000, the first
- eight words of the argument list (that might be less than eight parameters if
- some parameters occupy more than one word) are passed in r3..r11 registers.
- float and double parameters are passed in fpr's, in addition to that. Rest of
- the parameters if any are passed in user stack. There might be cases in which
- half of the parameter is copied into registers, the other half is pushed into
- stack.
-
- If the function is returning a structure, then the return address is passed
- in r3, then the first 7 words of the parametes can be passed in registers,
- starting from r4. */
-
-CORE_ADDR
-push_arguments (nargs, args, sp, struct_return, struct_addr)
- int nargs;
- value *args;
- CORE_ADDR sp;
- int struct_return;
- CORE_ADDR struct_addr;
-{
- int ii, len;
- int argno; /* current argument number */
- int argbytes; /* current argument byte */
- char tmp_buffer [50];
- value arg;
- int f_argno = 0; /* current floating point argno */
-
- CORE_ADDR saved_sp, pc;
-
- if ( dummy_frame_count <= 0)
- printf ("FATAL ERROR -push_arguments()! frame not found!!\n");
-
- /* The first eight words of ther arguments are passed in registers. Copy
- them appropriately.
-
- If the function is returning a `struct', then the first word (which
- will be passed in r3) is used for struct return address. In that
- case we should advance one word and start from r4 register to copy
- parameters. */
-
- ii = struct_return ? 1 : 0;
-
- for (argno=0, argbytes=0; argno < nargs && ii<8; ++ii) {
-
- arg = value_arg_coerce (args[argno]);
- len = TYPE_LENGTH (VALUE_TYPE (arg));
-
- if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FLT) {
-
- /* floating point arguments are passed in fpr's, as well as gpr's.
- There are 13 fpr's reserved for passing parameters. At this point
- there is no way we would run out of them. */
-
- if (len > 8)
- printf (
-"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
-
- bcopy (VALUE_CONTENTS (arg),
- &registers[REGISTER_BYTE(FP0_REGNUM + 1 + f_argno)], len);
- ++f_argno;
- }
-
- if (len > 4) {
-
- /* Argument takes more than one register. */
- while (argbytes < len) {
-
- *(int*)&registers[REGISTER_BYTE(ii+3)] = 0;
- bcopy ( ((char*)VALUE_CONTENTS (arg))+argbytes,
- &registers[REGISTER_BYTE(ii+3)],
- (len - argbytes) > 4 ? 4 : len - argbytes);
- ++ii, argbytes += 4;
-
- if (ii >= 8)
- goto ran_out_of_registers_for_arguments;
- }
- argbytes = 0;
- --ii;
- }
- else { /* Argument can fit in one register. No problem. */
- *(int*)&registers[REGISTER_BYTE(ii+3)] = 0;
- bcopy (VALUE_CONTENTS (arg), &registers[REGISTER_BYTE(ii+3)], len);
- }
- ++argno;
- }
-
-ran_out_of_registers_for_arguments:
-
- /* location for 8 parameters are always reserved. */
- sp -= 4 * 8;
-
- /* another six words for back chain, TOC register, link register, etc. */
- sp -= 24;
-
- /* if there are more arguments, allocate space for them in
- the stack, then push them starting from the ninth one. */
-
- if ((argno < nargs) || argbytes) {
- int space = 0, jj;
- value val;
-
- if (argbytes) {
- space += ((len - argbytes + 3) & -4);
- jj = argno + 1;
- }
- else
- jj = argno;
-
- for (; jj < nargs; ++jj) {
- val = value_arg_coerce (args[jj]);
- space += ((TYPE_LENGTH (VALUE_TYPE (val))) + 3) & -4;
- }
-
- /* add location required for the rest of the parameters */
- space = (space + 7) & -8;
- sp -= space;
-
- /* This is another instance we need to be concerned about securing our
- stack space. If we write anything underneath %sp (r1), we might conflict
- with the kernel who thinks he is free to use this area. So, update %sp
- first before doing anything else. */
-
- write_register (SP_REGNUM, sp);
-
-#if 0
- pc = read_pc ();
- flush_cached_frames ();
- set_current_frame (create_new_frame (sp, pc));
-#endif
-
- /* if the last argument copied into the registers didn't fit there
- completely, push the rest of it into stack. */
-
- if (argbytes) {
- write_memory (
- sp+24+(ii*4), ((char*)VALUE_CONTENTS (arg))+argbytes, len - argbytes);
- ++argno;
- ii += ((len - argbytes + 3) & -4) / 4;
- }
-
- /* push the rest of the arguments into stack. */
- for (; argno < nargs; ++argno) {
-
- arg = value_arg_coerce (args[argno]);
- len = TYPE_LENGTH (VALUE_TYPE (arg));
-
-
- /* float types should be passed in fpr's, as well as in the stack. */
- if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FLT && f_argno < 13) {
-
- if (len > 8)
- printf (
-"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
-
- bcopy (VALUE_CONTENTS (arg),
- &registers[REGISTER_BYTE(FP0_REGNUM + 1 + f_argno)], len);
- ++f_argno;
- }
-
- write_memory (sp+24+(ii*4), VALUE_CONTENTS (arg), len);
- ii += ((len + 3) & -4) / 4;
- }
- }
- else {
-
- /* Secure stack areas first, before doing anything else. */
- write_register (SP_REGNUM, sp);
-
-#if 0
- pc = read_pc ();
- flush_cached_frames ();
- set_current_frame (create_new_frame (sp, pc));
-#endif
- }
-
- saved_sp = dummy_frame_addr [dummy_frame_count - 1];
- read_memory (saved_sp, tmp_buffer, 24);
- write_memory (sp, tmp_buffer, 24);
-
- write_memory (sp, &saved_sp, 4); /* set back chain properly */
-
- store_inferior_registers (-1);
- return sp;
-}
-
-/* a given return value in `regbuf' with a type `valtype', extract and copy its
- value into `valbuf' */
-
-extract_return_value (valtype, regbuf, valbuf)
- struct type *valtype;
- char regbuf[REGISTER_BYTES];
- char *valbuf;
-{
-
- if (TYPE_CODE (valtype) == TYPE_CODE_FLT) {
-
- double dd; float ff;
- /* floats and doubles are returned in fpr1. fpr's have a size of 8 bytes.
- We need to truncate the return value into float size (4 byte) if
- necessary. */
-
- if (TYPE_LENGTH (valtype) > 4) /* this is a double */
- bcopy (&regbuf[REGISTER_BYTE (FP0_REGNUM + 1)], valbuf,
- TYPE_LENGTH (valtype));
- else { /* float */
- bcopy (&regbuf[REGISTER_BYTE (FP0_REGNUM + 1)], &dd, 8);
- ff = (float)dd;
- bcopy (&ff, valbuf, sizeof(float));
- }
- }
- else
- /* return value is copied starting from r3. */
- bcopy (&regbuf[REGISTER_BYTE (3)], valbuf, TYPE_LENGTH (valtype));
-}
-
-
-/* keep keep structure return address in this variable. */
-
-CORE_ADDR rs6000_struct_return_address;
-
-
-/* Throw away this debugging code. FIXMEmgo. */
-print_frame(fram)
-int fram;
-{
- int ii, val;
- for (ii=0; ii<40; ++ii) {
- if ((ii % 4) == 0)
- printf ("\n");
- val = read_memory_integer (fram + ii * 4, 4);
- printf ("0x%08x\t", val);
- }
- printf ("\n");
-}
-
-
-
-/* Indirect function calls use a piece of trampoline code do co context switching,
- i.e. to set the new TOC table. Skip such code if exists. */
-
-skip_trampoline_code (pc)
-int pc;
-{
- register unsigned int ii, op;
-
- static unsigned trampoline_code[] = {
- 0x800b0000, /* l r0,0x0(r11) */
- 0x90410014, /* st r2,0x14(r1) */
- 0x7c0903a6, /* mtctr r0 */
- 0x804b0004, /* l r2,0x4(r11) */
- 0x816b0008, /* l r11,0x8(r11) */
- 0x4e800420, /* bctr */
- 0x4e800020, /* br */
- 0
- };
-
- for (ii=0; trampoline_code[ii]; ++ii) {
- op = read_memory_integer (pc + (ii*4), 4);
- if (op != trampoline_code [ii])
- return NULL;
- }
- ii = read_register (11); /* r11 holds destination addr */
- pc = read_memory_integer (ii, 4); /* (r11) value */
- return pc;
-}
-
diff --git a/gdb/rs6000-xdep.c b/gdb/rs6000-xdep.c
deleted file mode 100644
index 7d0917b..0000000
--- a/gdb/rs6000-xdep.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/* IBM RS/6000 host-dependent code for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "target.h"
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/ptrace.h>
-#include <sys/reg.h>
-
-#include <a.out.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/core.h>
-#include <sys/ldr.h>
-
-extern int errno;
-extern int attach_flag;
-
-/* Conversion from gdb-to-system special purpose register numbers.. */
-
-static int special_regs[] = {
- IAR, /* PC_REGNUM */
- MSR, /* PS_REGNUM */
- CR, /* CR_REGNUM */
- LR, /* LR_REGNUM */
- CTR, /* CTR_REGNUM */
- XER, /* XER_REGNUM */
- MQ /* MQ_REGNUM */
-};
-
-
-/* Nonzero if we just simulated a single step break. */
-extern int one_stepped;
-
-
-fetch_inferior_registers ()
-{
- int ii;
- extern char registers[];
-
- /* read 32 general purpose registers. */
-
- for (ii=0; ii < 32; ++ii)
- *(int*)&registers[REGISTER_BYTE (ii)] =
- ptrace (PT_READ_GPR, inferior_pid, ii, 0, 0);
-
- /* read general purpose floating point registers. */
-
- for (ii=0; ii < 32; ++ii)
- ptrace (PT_READ_FPR, inferior_pid,
- (int*)&registers [REGISTER_BYTE (FP0_REGNUM+ii)], FPR0+ii, 0);
-
- /* read special registers. */
- for (ii=0; ii <= LAST_SP_REGNUM-FIRST_SP_REGNUM; ++ii)
- *(int*)&registers[REGISTER_BYTE (FIRST_SP_REGNUM+ii)] =
- ptrace (PT_READ_GPR, inferior_pid, special_regs[ii], 0, 0);
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- int regno;
-{
- extern char registers[];
-
- errno = 0;
-
- if (regno == -1) { /* for all registers.. */
- int ii;
-
- /* execute one dummy instruction (which is a breakpoint) in inferior
- process. So give kernel a chance to do internal house keeping.
- Otherwise the following ptrace(2) calls will mess up user stack
- since kernel will get confused about the bottom of the stack (%sp) */
-
- exec_one_dummy_insn ();
-
- /* write general purpose registers first! */
- for ( ii=GPR0; ii<=GPR31; ++ii) {
- ptrace (PT_WRITE_GPR, inferior_pid, ii,
- *(int*)&registers[REGISTER_BYTE (ii)], 0);
- if ( errno ) {
- perror ("ptrace write_gpr"); errno = 0;
- }
- }
-
- /* write floating point registers now. */
- for ( ii=0; ii < 32; ++ii) {
- ptrace (PT_WRITE_FPR, inferior_pid,
- (int*)&registers[REGISTER_BYTE (FP0_REGNUM+ii)], FPR0+ii, 0);
- if ( errno ) {
- perror ("ptrace write_fpr"); errno = 0;
- }
- }
-
- /* write special registers. */
- for (ii=0; ii <= LAST_SP_REGNUM-FIRST_SP_REGNUM; ++ii) {
- ptrace (PT_WRITE_GPR, inferior_pid, special_regs[ii],
- *(int*)&registers[REGISTER_BYTE (FIRST_SP_REGNUM+ii)], 0);
- if ( errno ) {
- perror ("ptrace write_gpr"); errno = 0;
- }
- }
- }
-
- /* else, a specific register number is given... */
-
- else if (regno < FP0_REGNUM) { /* a GPR */
-
- ptrace (PT_WRITE_GPR, inferior_pid, regno,
- *(int*)&registers[REGISTER_BYTE (regno)], 0);
- }
-
- else if (regno <= FPLAST_REGNUM) { /* a FPR */
- ptrace (PT_WRITE_FPR, inferior_pid,
- (int*)&registers[REGISTER_BYTE (regno)], regno-FP0_REGNUM+FPR0, 0);
- }
-
- else if (regno <= LAST_SP_REGNUM) { /* a special register */
-
- ptrace (PT_WRITE_GPR, inferior_pid, special_regs [regno-FIRST_SP_REGNUM],
- *(int*)&registers[REGISTER_BYTE (regno)], 0);
- }
-
- else
- fprintf (stderr, "Gdb error: register no %d not implemented.\n", regno);
-
- if ( errno ) {
- perror ("ptrace write"); errno = 0;
- return -1;
- }
- return 0;
-}
-
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
- char *core_reg_sect;
- unsigned core_reg_size;
- int which;
-{
- /* fetch GPRs and special registers from the first register section
- in core bfd. */
- if (which == 0) {
-
- /* copy GPRs first. */
- bcopy (core_reg_sect, registers, 32 * 4);
-
- /* gdb's internal register template and bfd's register section layout
- should share a common include file. FIXMEmgo */
- /* then comes special registes. They are supposed to be in the same
- order in gdb template and bfd `.reg' section. */
- core_reg_sect += (32 * 4);
- bcopy (core_reg_sect, &registers [REGISTER_BYTE (FIRST_SP_REGNUM)],
- (LAST_SP_REGNUM - FIRST_SP_REGNUM + 1) * 4);
- }
-
- /* fetch floating point registers from register section 2 in core bfd. */
- else if (which == 2)
- bcopy (core_reg_sect, &registers [REGISTER_BYTE (FP0_REGNUM)], 32 * 8);
-
- else
- fprintf (stderr, "Gdb error: unknown parameter to fetch_core_registers().\n");
-}
-
-
-frameless_function_invocation (fi)
-struct frame_info *fi;
-{
- int ret;
- CORE_ADDR func_start, after_prologue;
-
-#if 0
- func_start = (LOAD_ADDR (get_pc_function_start (fi->pc)) +
- FUNCTION_START_OFFSET);
-#else
- func_start = get_pc_function_start (fi->pc) + FUNCTION_START_OFFSET;
-#endif
- if (func_start)
- {
- after_prologue = func_start;
- SKIP_PROLOGUE (after_prologue);
- ret = (after_prologue == func_start);
- }
- else
- /* If we can't find the start of the function, we don't really */
- /* know whether the function is frameless, but we should be */
- /* able to get a reasonable (i.e. best we can do under the */
- /* circumstances) backtrace by saying that it isn't. */
- ret = 0;
-
- return ret;
-
-}
-
-
-/* aixcoff_relocate_symtab - hook for symbol table relocation.
- also reads shared libraries.. */
-
-aixcoff_relocate_symtab (pid)
-unsigned int pid;
-{
-#define MAX_LOAD_SEGS 64 /* maximum number of load segments */
-
- extern int compare_misc_functions ();
- struct ld_info *ldi;
- int temp;
-
- ldi = (void *) alloca(MAX_LOAD_SEGS * sizeof (*ldi));
-
- /* According to my humble theory, aixcoff has some timing problems and
- when the user stack grows, kernel doesn't update stack info in time
- and ptrace calls step on user stack. That is why we sleep here a little,
- and give kernel to update its internals. */
-
- usleep (36000);
-
- errno = 0;
- ptrace(PT_LDINFO, pid, ldi, MAX_LOAD_SEGS * sizeof(*ldi), ldi);
- if (errno)
- perror_with_name ("ptrace ldinfo");
-
- vmap_ldinfo(ldi);
-
- do {
- add_text_to_loadinfo (ldi->ldinfo_textorg, ldi->ldinfo_dataorg);
- } while (ldi->ldinfo_next
- && (ldi = (void *) (ldi->ldinfo_next + (char *) ldi)));
-
- /* Now that we've jumbled things around, re-sort them. */
- sort_misc_function_vector ();
-
- /* relocate the exec and core sections as well. */
- vmap_exec ();
-}
-
-
-/* Keep an array of load segment information and their TOC table addresses.
- This info will be useful when calling a shared library function by hand. */
-
-typedef struct {
- unsigned long textorg, dataorg, toc_offset;
-} LoadInfo;
-
-#define LOADINFOLEN 10
-
-static LoadInfo *loadInfo = NULL;
-static int loadInfoLen = 0;
-static int loadInfoTocIndex = 0;
-static int loadInfoTextIndex = 0;
-
-
-xcoff_init_loadinfo ()
-{
- loadInfoTocIndex = 0;
- loadInfoTextIndex = 0;
-
- if (loadInfoLen == 0) {
- loadInfo = (void*) xmalloc (sizeof (LoadInfo) * LOADINFOLEN);
- loadInfoLen = LOADINFOLEN;
- }
-}
-
-
-free_loadinfo ()
-{
- if (loadInfo)
- free (loadInfo);
- loadInfo = NULL;
- loadInfoLen = 0;
- loadInfoTocIndex = 0;
- loadInfoTextIndex = 0;
-}
-
-
-xcoff_add_toc_to_loadinfo (unsigned long tocaddr)
-{
- while (loadInfoTocIndex >= loadInfoLen) {
- loadInfoLen += LOADINFOLEN;
- loadInfo = (void*) xrealloc (loadInfo, sizeof(LoadInfo) * loadInfoLen);
- }
- loadInfo [loadInfoTocIndex++].toc_offset = tocaddr;
-}
-
-
-add_text_to_loadinfo (unsigned long textaddr, unsigned long dataaddr)
-{
- while (loadInfoTextIndex >= loadInfoLen) {
- loadInfoLen += LOADINFOLEN;
- loadInfo = (void*) xrealloc (loadInfo, sizeof(LoadInfo) * loadInfoLen);
- }
- loadInfo [loadInfoTextIndex].textorg = textaddr;
- loadInfo [loadInfoTextIndex].dataorg = dataaddr;
- ++loadInfoTextIndex;
-}
-
-
-unsigned long
-find_toc_address (unsigned long pc)
-{
- int ii, toc_entry;
-
- for (ii=0; ii < loadInfoTextIndex; ++ii)
- if (pc > loadInfo [ii].textorg)
- toc_entry = ii;
-
- return loadInfo [toc_entry].dataorg + loadInfo [toc_entry].toc_offset;
-}
-
-
-/* execute one dummy breakpoint instruction. This way we give kernel
- a chance to do some housekeeping and update inferior's internal data,
- including u_area. */
-
-exec_one_dummy_insn ()
-{
-#define DUMMY_INSN_ADDR 0x10000200
-
- unsigned long shadow;
- unsigned int status, pid;
-
- target_insert_breakpoint (DUMMY_INSN_ADDR, &shadow);
-
- errno = 0;
- ptrace (PT_CONTINUE, inferior_pid, DUMMY_INSN_ADDR, 0, 0);
- if (errno)
- perror ("pt_continue");
-
- do {
- pid = wait (&status);
- } while (pid != inferior_pid);
-
- target_remove_breakpoint (DUMMY_INSN_ADDR, &shadow);
-}
-
diff --git a/gdb/rs6k-opcode.def b/gdb/rs6k-opcode.def
deleted file mode 100755
index 785fd9d..0000000
--- a/gdb/rs6k-opcode.def
+++ /dev/null
@@ -1,224 +0,0 @@
-
-/* operand format specifiers. */
-
-#define TO 1
-#define RA 2
-#define SI 3
-#define RT 4
-#define UI 5
-#define BF 6
-#define BFA 7
-#define BT 8
-#define BA 9
-#define BB 10
-#define BO 11
-#define BI 12
-#define RB 13
-#define RS 14
-#define SH 15
-#define MB 16
-#define ME 17
-#define SPR 18
-#define DIS 19
-#define FXM 21
-#define FRT 22
-#define NB 23
-#define FRS 24
-#define FRA 25
-#define FRB 26
-#define FRC 27
-#define FLM 28
-#define I 29
-#define LI 30
-#define A2 31
-#define TA14 32 /* 14 bit representation of target address */
-#define TA24 33 /* 24 bit representation of target address */
-#define FL1 34
-#define FL2 35
-#define LEV 36
-
-#if 0
-
- RS6000 INSTRUCTION SET
- (sorted on first primary and second extended opcode)
-
- oprtr primary ext.
-operator ext format opcode opcode operand format
-------- ------- ------ ------- ------ ---------------
-#endif /* 0 */
-
-{"ti", 0, "d", 3, -1, {TO,RA,SI,0} },
-{"muli", 0, "d", 7, -1, {RT,RA,SI,0} },
-{"sfi", 0, "d", 8, -1, {RT,RA,SI,0} },
-{"dozi", 0, "d", 9, -1, {RT,RA,SI,0} },
-{"cmpli", 0, "d", 10, -1, {BF,RA,UI,0} },
-{"cmpi", 0, "d", 11, -1, {BF,RA,SI,0} },
-{"ai", 0, "d", 12, -1, {RT,RA,SI,0} },
-{"ai.", 0, "d", 13, -1, {RT,RA,SI,0} },
-{"lil", 0, "d", 14, -1, {RT,SI,0} }, /* same as `cal' */
-{"cal", 0, "d", 14, -1, {RT,DIS,RA,0} },
-{"liu", 0, "d", 15, -1, {RT, UI,0} }, /* same as `cau' */
-{"cau", 0, "d", 15, -1, {RT,RA,UI,0} },
-{"bb", "1tfl", "b", 16, -1, {LI,A2,0} },
-/* ^^^^^
- exception #1. Either fix this, or document what you are doing here. FIXMEmgo.
-*/
-{"bc", "la", "b", 16, -1, {BO,BI,TA14,0} },
-{"svc", "la", "sc", 17, -1, {LEV,FL1,FL2,0} },
-{"b", "la", "i", 18, -1, {TA24,0} },
-{"mcrf", 0, "xl", 19, 0, {BF,BFA,0} },
-{"bcr", "l", "xl", 19, 16, {BO,BI,0} },
-{"cror", 0, "xl", 19, 33, {BT,BA,BB,0} },
-{"crandc", 0, "xl", 19, 129, {BT,BA,BB,0} },
-{"bcc", "l", "xl", 19, 193, {BO,BI,0} },
-{"crnor", 0, "xl", 19, 225, {BT,BA,BB,0} },
-{"crand", 0, "xl", 19, 257, {BT,BA,BB,0} },
-{"creqv", 0, "xl", 19, 289, {BT,BA,BB,0} },
-{"crnand", 0, "xl", 19, 289, {BT,BA,BB,0} },
-{"crxor", 0, "xl", 19, 417, {BT,BA,BB,0} },
-{"crorc", 0, "xl", 19, 449, {BT,BA,BB,0} },
-{"bcr", "l", "xl", 19, 528, {BO,BI,0} },
-{"rlimi", ".", "m", 20, -1, {RA,RS,SH,MB,ME,0} /*??*/},
-{"rlinm", ".", "m", 21, -1, {RA,RS,SH,MB,ME,0} /*??*/},
-{"rlmi", ".", "m", 22, -1, {RA,RS,RB,MB,ME,0} /*??*/},
-{"rlnm", ".", "m", 23, -1, {RA,RS,RB,MB,ME,0} /*??*/},
-{"oril", 0, "d", 24, -1, {RA,RS,UI,0} },
-{"oriu", 0, "d", 25, -1, {RA,RS,UI,0} },
-{"xoril", 0, "d", 26, -1, {RA,RS,UI,0} },
-{"xoriu", 0, "d", 27, -1, {RA,RS,UI,0} },
-{"andil.", 0, "d", 28, -1, {RA,RS,UI,0} },
-{"andiu.", 0, "d", 29, -1, {RA,RS,UI,0} },
-{"cmp", 0, "x", 31, 0, {BF,RA,RB,0} },
-{"t", 0, "x", 31, 4, {TO,RA,RB,0} },
-{"sf", "o.", "xo", 31, 8, {RT,RA,RB,0} },
-{"a", "o.", "xo", 31, 10, {RT,RA,RB,0} },
-{"mfcr", 0, "x", 31, 19, {RT,0} },
-{"lx", 0, "x", 31, 23, {RT,RA,RB,0} },
-{"sl", ".", "x", 31, 24, {RA,RS,RB,0} },
-{"cntlz", ".", "xo", 31, 26, {RA,RS,0} },
-{"and", ".", "x", 31, 28, {RA,RS,RB,0} },
-{"maskg", ".", "x", 31, 29, {RA,RS,RB,0} },
-{"cmpl", 0, "x", 31, 32, {BF,RA,RB,0} },
-{"sfe", "o.", "xo", 31, 36, {RT,RA,RB,0} },
-{"lux", 0, "x", 31, 55, {RT,RA,RB,0} },
-{"andc", ".", "x", 31, 60, {RA,RS,RB,0} },
-{"mfmsr", 0, "x", 31, 83, {RT,0} },
-{"lbzx", 0, "x", 31, 87, {RT,RA,RB,0} },
-{"neg", "o.", "xo", 31, 104, {RT,RA,0} },
-{"mul", "o.", "xo", 31, 107, {RT,RA,RB,0} },
-{"lbzux", 0, "x", 31, 119, {RT,RA,RB,0} },
-{"nor", ".", "x", 31, 124, {RA,RS,RB,0} },
-{"ae", "o.", "xo", 31, 138, {RT,RA,RB,0} },
-{"mtcrf", 0, "xfx", 31, 144, {FXM,RS,0} },
-{"stx", 0, "x", 31, 151, {RS,RA,RB,0} },
-{"slq", ".", "x", 31, 152, {RA,RS,RB,0} },
-{"sle", ".", "x", 31, 153, {RA,RS,RB,0} },
-{"stux", 0, "x", 31, 183, {RS,RA,RB,0} },
-{"sliq", ".", "x", 31, 184, {RA,RS,SH,0} },
-{"sfze", "o.", "xo", 31, 200, {RT,RA,0} },
-{"aze", "o.", "xo", 31, 202, {RT,RA,0} },
-{"stbx", 0, "x", 31, 215, {RS,RA,RB,0} },
-{"sllq", ".", "x", 31, 216, {RA,RS,RB,0} },
-{"sleq", ".", "x", 31, 217, {RA,RS,RB,0} },
-{"sfme", "o.", "xo", 31, 232, {RT,RA,0} },
-{"ame", "o.", "xo", 31, 234, {RT,RA,0} },
-{"muls", "o.", "xo", 31, 235, {RT,RA,RB,0} },
-{"stbux", 0, "x", 31, 247, {RS,RA,RB,0} },
-{"slliq", ".", "x", 31, 248, {RA,RS,SH,0} },
-{"doz", "o.", "x", 31, 264, {RT,RA,RB,0} },
-{"cax", "o.", "xo", 31, 266, {RT,RA,RB,0} },
-{"lscbx", ".", "x", 31, 277, {RT,RA,RB,0} },
-{"lhzx", 0, "x", 31, 279, {RT,RA,RB,0} },
-{"eqv", ".", "x", 31, 284, {RA,RS,RB,0} },
-{"lhzux", 0, "x", 31, 311, {RT,RA,RB,0} },
-{"xor", ".", "x", 31, 316, {RA,RS,RB,0} },
-{"div", "o.", "xo", 31, 331, {RT,RA,RB,0} },
-{"mfspr", 0, "x", 31, 339, {RT,SPR,0} },
-{"lhax", 0, "x", 31, 343, {RT,RA,RB,0} },
-{"abs", "o.", "xo", 31, 360, {RT,RA,0} },
-{"divs", "o.", "xo", 31, 363, {RT,RA,RB,0} },
-{"lhaux", 0, "x", 31, 375, {RT,RA,RB,0} },
-{"sthx", 0, "x", 31, 407, {RS,RA,RB,0} },
-{"orc", ".", "x", 31, 412, {RA,RS,RB,0} },
-{"sthux", 0, "x", 31, 439, {RS,RA,RB,0} },
-{"or", ".", "x", 31, 444, {RA,RS,RB,0} },
-{"mtspr", 0, "x", 31, 467, {SPR,RS,0} },
-{"nand", ".", "x", 31, 476, {RA,RS,RB,0} },
-{"nabs", "o.", "xo", 31, 488, {RT,RA,0} },
-{"mcrxr", 0, "x", 31, 512, {BF,0} },
-{"lsx", 0, "x", 31, 533, {RT,RA,RB,0} },
-{"lbrx", 0, "x", 31, 534, {RT,RA,RB,0} },
-{"lfsx", 0, "x", 31, 535, {FRT,RA,RB,0} },
-{"sr", ".", "x", 31, 536, {RA,RS,RB,0} },
-{"rrib", ".", "x", 31, 537, {RA,RS,RB,0} },
-{"maskir", ".", "x", 31, 541, {RA,RS,RB,0} },
-{"lfsux", 0, "x", 31, 567, {FRT,RA,RB,0} },
-{"lsi", 0, "x", 31, 597, {RT,RA,NB,0} },
-{"lfdx", 0, "x", 31, 599, {FRT,RA,RB,0} },
-{"lfdux", 0, "x", 31, 631, {FRT,RA,RB,0} },
-{"stsx", 0, "x", 31, 661, {RS,RA,RB,0} },
-{"stbrx", 0, "x", 31, 662, {RA,RA,RB,0} },
-{"stfsx", 0, "x", 31, 663, {FRS,RA,RB,0} },
-{"srq", ".", "x", 31, 664, {RA,RS,RB,0} },
-{"sre", ".", "x", 31, 665, {RA,RS,RB,0} },
-{"stfsux", 0, "x", 31, 695, {FRS,RA,RB,0} },
-{"sriq", ".", "x", 31, 696, {RA,RS,SH,0} },
-{"stsi", 0, "x", 31, 725, {RS,RA,NB,0} },
-{"stfdx", 0, "x", 31, 727, {FRS,RA,RB,0} },
-{"srlq", ".", "x", 31, 728, {RA,RS,RB,0} },
-{"sreq", ".", "x", 31, 729, {RA,RS,RB,0} },
-{"stfdux", 0, "x", 31, 759, {FRS,RA,RB,0} },
-{"srliq", ".", "x", 31, 760, {RA,RS,SH,0} },
-{"lhbrx", 0, "x", 31, 790, {RT,RA,RB,0} },
-{"sra", ".", "x", 31, 792, {RA,RS,RB,0} },
-{"srai", ".", "x", 31, 824, {RA,RS,SH,0} },
-{"sthbrx", 0, "x", 31, 918, {RS,RA,RB,0} },
-{"sraq", ".", "x", 31, 920, {RA,RS,RB,0} },
-{"srea", ".", "x", 31, 921, {RA,RS,RB,0} },
-{"exts", ".", "x", 31, 922, {RA,RS,0} },
-{"sraiq", ".", "x", 31, 952, {RA,RS,SH,0} },
-{"l", 0, "d", 32, -1, {RT,DIS,RA,0} },
-{"lu", 0, "d", 33, -1, {RT,DIS,RA,0} },
-{"lbz", 0, "d", 34, -1, {RT,DIS,RA,0} },
-{"lbzu", 0, "d", 35, -1, {RT,DIS,RA,0} },
-{"st", 0, "d", 36, -1, {RS,DIS,RA,0} },
-{"stu", 0, "d", 37, -1, {RS,DIS,RA,0} },
-{"stb", 0, "d", 38, -1, {RS,DIS,RA,0} },
-{"stbu", 0, "d", 39, -1, {RS,DIS,RA,0} },
-{"lhz", 0, "d", 40, -1, {RT,DIS,RA,0} },
-{"lhzu", 0, "d", 41, -1, {RT,DIS,RA,0} },
-{"lha", 0, "d", 42, -1, {RT,DIS,RA,0} },
-{"lhau", 0, "d", 43, -1, {RT,DIS,RA,0} },
-{"sth", 0, "d", 44, -1, {RS,DIS,RA,0} },
-{"sthu", 0, "d", 45, -1, {RS,DIS,RA,0} },
-{"lm", 0, "d", 46, -1, {RT,DIS,RA,0} },
-{"stm", 0, "d", 47, -1, {RS,DIS,RA,0} },
-{"lfs", 0, "d", 48, -1, {FRT,DIS,RA,0} },
-{"lfsu", 0, "d", 49, -1, {FRT,DIS,RA,0} },
-{"lfd", 0, "d", 50, -1, {FRT,DIS,RA,0} },
-{"lfdu", 0, "d", 51, -1, {FRT,DIS,RA,0} },
-{"stfs", 0, "d", 52, -1, {FRS,DIS,RA,0} },
-{"stfsu", 0, "d", 53, -1, {FRS,DIS,RA,0} },
-{"stfd", 0, "d", 54, -1, {FRS,DIS,RA,0} },
-{"stfdu", 0, "d", 55, -1, {FRS,DIS,RA,0} },
-{"fcmpu", 0, "x", 63, 0, {BF,FRA,FRB,0} },
-{"fm", ".", "a", 63, 5, {FRT,FRA,FRC,0} },
-{"fd", ".", "a", 63, 8, {FRT,FRA,FRB,0} },
-{"frsp", ".", "x", 63, 12, {FRT,FRB,0} },
-{"fs", ".", "a", 63, 20, {FRT,FRA,FRB,0} },
-{"fa", ".", "a", 63, 21, {FRT,FRA,FRB,0} },
-{"fms", ".", "a", 63, 28, {FRT,FRA,FRC,FRB,0} },
-{"fma", ".", "a", 63, 29, {FRT,FRA,FRC,FRB,0} },
-{"fnms", ".", "a", 63, 30, {FRT,FRA,FRC,FRB,0} },
-{"fnma", ".", "a", 63, 31, {FRT,FRA,FRC,FRB,0} },
-{"fcmpo", 0, "x", 63, 32, {BF,FRA,FRB,0} },
-{"mtfsb1", ".", "x", 63, 38, {BT,0} },
-{"fneg", ".", "x", 63, 40, {FRT,FRB,0} },
-{"mcrfs", 0, "x", 63, 64, {BF,BFA,0} },
-{"mtfsb0", ".", "x", 63, 70, {BT,0} },
-{"fmr", ".", "x", 63, 72, {FRT,FRB,0} },
-{"mtfsfi", ".", "x", 63, 134, {BF,I,0} },
-{"fnabs", ".", "x", 63, 136, {FRT,FRB,0} },
-{"fabs", ".", "x", 63, 264, {FRT,FRB,0} },
-{"mffs", ".", "x", 63, 583, {FRT,0} },
-{"mtfsf", ".", "xfl", 63, 711, {FLM,FRB,0} },
diff --git a/gdb/rs6k-opcode.h b/gdb/rs6k-opcode.h
deleted file mode 100755
index db02a9e..0000000
--- a/gdb/rs6k-opcode.h
+++ /dev/null
@@ -1,19 +0,0 @@
-
-typedef int (*FUN)();
-
-typedef struct {
- char *operator; /* opcode name */
- char *opr_ext; /* opcode name ext. */
- char *format; /* opcode format */
- char p_opcode; /* primary opcode */
- int e_opcode; /* extended opcode */
- char oprnd_format [6]; /* operand format */
-} OPCODE;
-
-
-OPCODE rs6k_ops [] = {
-
-#include "rs6k-opcode.def"
-};
-
-#define NOPCODES (sizeof (rs6k_ops) / sizeof (OPCODE))
diff --git a/gdb/saber.suppress b/gdb/saber.suppress
deleted file mode 100644
index b1e1772..0000000
--- a/gdb/saber.suppress
+++ /dev/null
@@ -1,435 +0,0 @@
-
-
-/* Options for project */
-unsetopt ansi
-setopt auto_compile
-unsetopt auto_reload
-setopt auto_replace
-unsetopt batch_load
-unsetopt batch_run
-unsetopt cc_prog
-setopt ccargs -g
-unsetopt create_file
-unsetopt debug_child
-unsetopt echo
-setopt edit_jobs 5
-unsetopt eight_bit
-setopt line_edit
-setopt line_meta
-setopt lint_load 2
-setopt lint_run 2
-setopt list_action
-setopt load_flags -I. -g -I.. -I../vx-share
-unsetopt long_not_int
-unsetopt make_args
-setopt make_hfiles
-unsetopt make_offset
-unsetopt make_prog
-setopt make_symbol #
-setopt mem_config 16384
-unsetopt mem_trace
-setopt num_proc 1
-unsetopt page_cmds
-setopt page_list 19
-unsetopt page_load
-unsetopt path
-setopt proto_path . /s2/saber_dir30/sun4-40/proto /s2/saber_dir30/sun4-40/../common/proto
-unsetopt preprocessor
-setopt program_name a.out
-unsetopt print_custom
-setopt print_pointer
-setopt print_string 20
-unsetopt save_memory
-setopt sbrk_size 1048576
-setopt src_err 3
-setopt src_step 1
-setopt src_stop 3
-setopt sys_load_flags -L/lib -L/usr/lib -L/usr/local/lib -I/usr/include -Dunix -Dsun -Dsparc
-unsetopt tab_stop
-unsetopt terse_suppress
-unsetopt terse_where
-setopt unset_value 191
-unsetopt win_fork_nodup
-setopt win_no_raise
-unsetopt win_message_list
-unsetopt win_project_list
-/* Suppressions for project */
-suppress 6 in read_huge_number
-/* Over/underflow <plus> */
-suppress 8 in read_huge_number
-/* Over/underflow <multiply> */
-suppress 22
-/* Pointer subtraction */
-suppress 22 in free_all_psymtabs
-/* Pointer subtraction */
-suppress 22 in free_all_symtabs
-/* Pointer subtraction */
-suppress 56 in print_string
-/* Information lost <function> */
-suppress 65 "../bfd/bfd.c":379
-/* Too many function arguments */
-suppress 65 on printf_filtered
-/* Too many function arguments */
-suppress 65 on fprintf_filtered
-/* Too many function arguments */
-suppress 65 on vfprintf_filtered
-/* Too many function arguments */
-suppress 65 on query
-/* Too many function arguments */
-suppress 65 on fatal_dump_core
-/* Too many function arguments */
-suppress 65 on fatal
-/* Too many function arguments */
-suppress 65 on error
-/* Too many function arguments */
-suppress 65 on noprocess
-/* Too many function arguments */
-suppress 65
-/* Too many function arguments */
-suppress 66 on say
-/* Too few function arguments */
-suppress 66 on printf_filtered
-/* Too few function arguments */
-suppress 66 on fprintf_filtered
-/* Too few function arguments */
-suppress 66 on vfprintf_filtered
-/* Too few function arguments */
-suppress 66 on query
-/* Too few function arguments */
-suppress 66 on fatal_dump_core
-/* Too few function arguments */
-suppress 66 on fatal
-/* Too few function arguments */
-suppress 66 on error
-/* Too few function arguments */
-suppress 67 on printf_filtered
-/* Signed/unsigned argument mismatch */
-suppress 67 on fprintf_filtered
-/* Signed/unsigned argument mismatch */
-suppress 67 on vfprintf_filtered
-/* Signed/unsigned argument mismatch */
-suppress 67 on query
-/* Signed/unsigned argument mismatch */
-suppress 67 on fatal_dump_core
-/* Signed/unsigned argument mismatch */
-suppress 67 on fatal
-/* Signed/unsigned argument mismatch */
-suppress 67 on error
-/* Signed/unsigned argument mismatch */
-suppress 67
-/* Signed/unsigned argument mismatch */
-suppress 68 on bfd_get_section_contents
-/* Benign argument mismatch */
-suppress 68 on _do_getblong
-/* Benign argument mismatch */
-suppress 68 on supply_register
-/* Benign argument mismatch */
-suppress 68 on target_write_memory
-/* Benign argument mismatch */
-suppress 68 on write_register_bytes
-/* Benign argument mismatch */
-suppress 68 on read_register_bytes
-/* Benign argument mismatch */
-suppress 68 on read_memory
-/* Benign argument mismatch */
-suppress 68 on say
-/* Benign argument mismatch */
-suppress 68 on printf_filtered
-/* Benign argument mismatch */
-suppress 68 on fprintf_filtered
-/* Benign argument mismatch */
-suppress 68 on vfprintf_filtered
-/* Benign argument mismatch */
-suppress 68 on query
-/* Benign argument mismatch */
-suppress 68 on fatal_dump_core
-/* Benign argument mismatch */
-suppress 68 on fatal
-/* Benign argument mismatch */
-suppress 68 on error
-/* Benign argument mismatch */
-suppress 68 in find_solib
-/* Benign argument mismatch */
-suppress 68 on child_wait
-/* Benign argument mismatch */
-suppress 68 on xrealloc
-/* Benign argument mismatch */
-suppress 68 on myread
-/* Benign argument mismatch */
-suppress 68 in do_cleanups
-/* Benign argument mismatch */
-suppress 68 on make_cleanup
-/* Benign argument mismatch */
-suppress 68 on target_read_memory
-/* Benign argument mismatch */
-suppress 69 on printf_filtered
-/* Serious argument mismatch */
-suppress 69 on fprintf_filtered
-/* Serious argument mismatch */
-suppress 69 on vfprintf_filtered
-/* Serious argument mismatch */
-suppress 69 on query
-/* Serious argument mismatch */
-suppress 69 on fatal_dump_core
-/* Serious argument mismatch */
-suppress 69 on fatal
-/* Serious argument mismatch */
-suppress 69 on error
-/* Serious argument mismatch */
-suppress 70 on printf_filtered
-/* Passing illegal enumeration value */
-suppress 70 on fprintf_filtered
-/* Passing illegal enumeration value */
-suppress 70 on vfprintf_filtered
-/* Passing illegal enumeration value */
-suppress 70 on query
-/* Passing illegal enumeration value */
-suppress 70 on fatal_dump_core
-/* Passing illegal enumeration value */
-suppress 70 on fatal
-/* Passing illegal enumeration value */
-suppress 70 on error
-/* Passing illegal enumeration value */
-suppress 110 in printf_filtered
-/* Signed/unsigned memory retrieval */
-suppress 110 in fprintf_filtered
-/* Signed/unsigned memory retrieval */
-suppress 110 in vfprintf_filtered
-/* Signed/unsigned memory retrieval */
-suppress 110 in query
-/* Signed/unsigned memory retrieval */
-suppress 110 in fatal_dump_core
-/* Signed/unsigned memory retrieval */
-suppress 110 in fatal
-/* Signed/unsigned memory retrieval */
-suppress 110 in error
-/* Signed/unsigned memory retrieval */
-suppress 112 in printf_filtered
-/* Memory retrieval */
-suppress 112 in fprintf_filtered
-/* Memory retrieval */
-suppress 112 in vfprintf_filtered
-/* Memory retrieval */
-suppress 112 in query
-/* Memory retrieval */
-suppress 112 in fatal_dump_core
-/* Memory retrieval */
-suppress 112 in fatal
-/* Memory retrieval */
-suppress 112 in error
-/* Memory retrieval */
-suppress 112
-/* Memory retrieval */
-suppress 112 ../symtab.c
-/* Memory retrieval */
-suppress 112 in child_xfer_memory
-/* Memory retrieval */
-suppress 165 in frame_saved_pc
-/* Dereference */
-suppress 165 in get_prev_frame_info
-/* Dereference */
-suppress 167 in get_prev_frame_info
-/* Selection */
-suppress 167 in frame_saved_pc
-/* Selection */
-suppress 442 in try_baudrate
-/* Escape has null value */
-suppress 529 in read_range_type
-/* Statement not reached */
-suppress 529 in process_one_symbol
-/* Statement not reached */
-suppress 529 in unpack_double
-/* Statement not reached */
-suppress 529 in wait_for_inferior
-/* Statement not reached */
-suppress 529 in do_registers_info
-/* Statement not reached */
-suppress 529 in value_from_register
-/* Statement not reached */
-suppress 530
-/* Empty body of statement */
-suppress 546 in net_quit
-/* Function exits through bottom */
-suppress 546 in net_wait
-/* Function exits through bottom */
-suppress 546 in vx_remove_breakpoint
-/* Function exits through bottom */
-suppress 546 in vx_insert_breakpoint
-/* Function exits through bottom */
-suppress 546 in value_less
-/* Function exits through bottom */
-suppress 546 in value_equal
-/* Function exits through bottom */
-suppress 546 in unpack_long
-/* Function exits through bottom */
-suppress 558 in read_range_type
-/* Constant in conditional */
-suppress 558 in process_one_symbol
-/* Constant in conditional */
-suppress 558 in read_dbx_symtab
-/* Constant in conditional */
-suppress 558 in vx_write_register
-/* Constant in conditional */
-suppress 558 in vx_read_register
-/* Constant in conditional */
-suppress 558 in unpack_double
-/* Constant in conditional */
-suppress 558 in wait_for_inferior
-/* Constant in conditional */
-suppress 558 in do_registers_info
-/* Constant in conditional */
-suppress 558 in value_from_register
-/* Constant in conditional */
-suppress 560 in solib_address
-/* Assignment within conditional */
-suppress 560 in solib_info
-/* Assignment within conditional */
-suppress 560 in solib_add
-/* Assignment within conditional */
-suppress 560 in read_type
-/* Assignment within conditional */
-suppress 560 in type_print_base
-/* Assignment within conditional */
-suppress 560 in type_print_derivation_info
-/* Assignment within conditional */
-suppress 560 in block_depth
-/* Assignment within conditional */
-suppress 560 in select_source_symtab
-/* Assignment within conditional */
-suppress 560 in clear_value_history
-/* Assignment within conditional */
-suppress 560 in clear_displays
-/* Assignment within conditional */
-suppress 560 in initialize_main
-/* Assignment within conditional */
-suppress 560 in echo_command
-/* Assignment within conditional */
-suppress 560 in unset_in_environ
-/* Assignment within conditional */
-suppress 560 in set_in_environ
-/* Assignment within conditional */
-suppress 560 in get_in_environ
-/* Assignment within conditional */
-suppress 560 in do_setshow_command
-/* Assignment within conditional */
-suppress 560 in breakpoint_1
-/* Assignment within conditional */
-suppress 590 on sig
-/* Unused formal parameter */
-suppress 590 in nindy_create_inferior
-/* Unused formal parameter */
-suppress 590 in add_to_section_table
-/* Unused formal parameter */
-suppress 590 in vx_create_inferior
-/* Unused formal parameter */
-suppress 590 in host_convert_from_virtual
-/* Unused formal parameter */
-suppress 590 in host_convert_to_virtual
-/* Unused formal parameter */
-suppress 590 on siggnal
-/* Unused formal parameter */
-suppress 590 in init_sig
-/* Unused formal parameter */
-suppress 590 in nindy_resume
-/* Unused formal parameter */
-suppress 590 in set_history_size_command
-/* Unused formal parameter */
-suppress 590 in not_just_help_class_command
-/* Unused formal parameter */
-suppress 590 on regno
-/* Unused formal parameter */
-suppress 590 on from_tty
-/* Unused formal parameter */
-suppress 590 on args
-/* Unused formal parameter */
-suppress 590 in process_symbol_pair
-/* Unused formal parameter */
-suppress 591 in print_scalar_formatted
-/* Unused automatic variable */
-suppress 592 on rcsid
-/* Unused static */
-suppress 592 on check_break_insn_size
-/* Unused static */
-suppress 594 in call_function_by_hand
-/* Set but not used */
-suppress 594 in record_latest_value
-/* Set but not used */
-suppress 594 in bpstat_stop_status
-/* Set but not used */
-suppress 595 in coffstrip
-/* Used before set */
-suppress 652 ../include/bfd.h
-/* Declaration has no effect */
-suppress 652 /usr/include/machine/reg.h
-/* Declaration has no effect */
-suppress 652 /usr/include/sun4/reg.h
-/* Declaration has no effect */
-suppress 68 on complain
-/* Benign type mismatch */
-suppress 3 in read_range_type
-/* Over/underflow unary minus */
-suppress 442 ../bfd/archive.c
-/* \0 in string */
-suppress 558 ../bfd/b.out.c
-/* Conditional if always true */
-suppress 558 ../bfd/coffswap.c
-/* Conditional if always true -- bfd_h_put_x */
-suppress 529 ../bfd/coffswap.c
-/* Stmt unreach -- bfd_h_put_x */
-suppress 590 ../bfd/ecoff.c
-/* Formal parameter not used */
-suppress 590 on ignore
-/* Formal param not used */
-suppress 590 on ignore_exec_bfd
-/* Formal param not used */
-suppress 590 on ignore_core_bfd
-/* Formal param not used */
-suppress 590 on ignore_input_section
-/* Formal param not used */
-suppress 590 on ignore_newsect
-/* Formal param not used */
-suppress 590 on ignore_abfd
-/* Formal param not used */
-suppress 590 on ignore_symbol
-/* Formal param not used */
-suppress 590 on ignore_symbols
-/* Formal param not used */
-suppress 652 in ../bfd/libaout.h
-/* The declaration has no effect */
-suppress 442 in ../bfd/archive.c
-/* Escape sequence in string literal has null value */
-
-/* Signals caught and ignored */
-catch HUP
-catch QUIT
-catch ILL
-catch TRAP
-catch IOT
-catch EMT
-catch FPE
-catch KILL
-catch BUS
-catch SEGV
-catch SYS
-catch PIPE
-catch TERM
-catch URG
-catch STOP
-catch TSTP
-catch TTIN
-catch TTOU
-catch IO
-catch XCPU
-catch XFSZ
-catch VTALRM
-catch PROF
-catch LOST
-catch USR1
-catch USR2
-ignore INT
-ignore ALRM
-ignore CONT
-ignore CHLD
-ignore WINCH
-
-/* Status of project */
diff --git a/gdb/signals.h b/gdb/signals.h
deleted file mode 100644
index a89fc03..0000000
--- a/gdb/signals.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Signal handler definitions for GDB, the GNU Debugger.
- Copyright (C) 1986, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-/* This file is almost the same as including <signal.h> except that it
- eliminates certain signal names when job control is not supported,
- (or, on some systems, when job control is there but doesn't work
- the way GDB expects it to work). */
-
-#include <signal.h>
-
-#ifdef NO_JOB_CONTROL
-# undef SIGTSTP
-# undef SIGSTOP
-# undef SIGCONT
-# undef SIGTTIN
-# undef SIGTTOU
-#endif
diff --git a/gdb/signame.c b/gdb/signame.c
deleted file mode 100755
index 7f07893..0000000
--- a/gdb/signame.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/* Convert between signal names and numbers.
- Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <signal.h>
-#include "signame.h"
-
-/* GDB-specific, FIXME. (This is for the SYS_SIGLIST_MISSING define). */
-#include "defs.h"
-#include "param.h"
-
-#ifdef __STDC__
-#define CONST const
-#else
-#define CONST
-#endif
-
-#if SYS_SIGLIST_MISSING
-/* There is too much variation in Sys V signal numbers and names, so
- we must initialize them at runtime. */
-
-static CONST char undoc[] = "unknown signal";
-
-/* We'd like to make this const char*[], but whoever's using it might
- want to assign from it to a char*. */
-char *sys_siglist[NSIG];
-#endif /* SYS_SIGLIST_MISSING */
-
-/* Table of abbreviations for signals. Note: A given number can
- appear more than once with different abbreviations. */
-typedef struct
- {
- int number;
- CONST char *abbrev;
- } num_abbrev;
-static num_abbrev sig_table[NSIG*2];
-/* Number of elements of sig_table used. */
-static int sig_table_nelts = 0;
-
-/* Enter signal number NUMBER into the tables with ABBREV and NAME. */
-/* ARGSUSED */
-static void
-init_sig (number, abbrev, name)
- int number;
- CONST char *abbrev;
- CONST char *name;
-{
-#if SYS_SIGLIST_MISSING
- sys_siglist[number] = (char *) name;
-#endif
- sig_table[sig_table_nelts].number = number;
- sig_table[sig_table_nelts++].abbrev = abbrev;
-}
-
-static void init_sigs ()
-{
-#if SYS_SIGLIST_MISSING
- int i;
-
- /* Initialize signal names. */
- for (i = 0; i < NSIG; i++)
- sys_siglist[i] = (char *) undoc;
-#endif /* SYS_SIGLIST_MISSING */
-
- /* Initialize signal names. */
-#if defined (SIGHUP)
- init_sig (SIGHUP, "HUP", "Hangup");
-#endif
-#if defined (SIGINT)
- init_sig (SIGINT, "INT", "Interrupt");
-#endif
-#if defined (SIGQUIT)
- init_sig (SIGQUIT, "QUIT", "Quit");
-#endif
-#if defined (SIGILL)
- init_sig (SIGILL, "ILL", "Illegal Instruction");
-#endif
-#if defined (SIGTRAP)
- init_sig (SIGTRAP, "TRAP", "Trace/breakpoint trap");
-#endif
- /* If SIGIOT == SIGABRT, we want to print it as SIGABRT because
- SIGABRT is in ANSI and POSIX.1 and SIGIOT isn't. */
-#if defined (SIGABRT)
- init_sig (SIGABRT, "ABRT", "Aborted");
-#endif
-#if defined (SIGIOT)
- init_sig (SIGIOT, "IOT", "IOT trap");
-#endif
-#if defined (SIGEMT)
- init_sig (SIGEMT, "EMT", "EMT trap");
-#endif
-#if defined (SIGFPE)
- init_sig (SIGFPE, "FPE", "Floating point exception");
-#endif
-#if defined (SIGKILL)
- init_sig (SIGKILL, "KILL", "Killed");
-#endif
-#if defined (SIGBUS)
- init_sig (SIGBUS, "BUS", "Bus error");
-#endif
-#if defined (SIGSEGV)
- init_sig (SIGSEGV, "SEGV", "Segmentation fault");
-#endif
-#if defined (SIGSYS)
- init_sig (SIGSYS, "SYS", "Bad system call");
-#endif
-#if defined (SIGPIPE)
- init_sig (SIGPIPE, "PIPE", "Broken pipe");
-#endif
-#if defined (SIGALRM)
- init_sig (SIGALRM, "ALRM", "Alarm clock");
-#endif
-#if defined (SIGTERM)
- init_sig (SIGTERM, "TERM", "Terminated");
-#endif
-#if defined (SIGUSR1)
- init_sig (SIGUSR1, "USR1", "User defined signal 1");
-#endif
-#if defined (SIGUSR2)
- init_sig (SIGUSR2, "USR2", "User defined signal 2");
-#endif
- /* If SIGCLD == SIGCHLD, we want to print it as SIGCHLD because that
- is what is in POSIX.1. */
-#if defined (SIGCHLD)
- init_sig (SIGCHLD, "CHLD", "Child exited");
-#endif
-#if defined (SIGCLD)
- init_sig (SIGCLD, "CLD", "Child exited");
-#endif
-#if defined (SIGPWR)
- init_sig (SIGPWR, "PWR", "Power failure");
-#endif
-#if defined (SIGTSTP)
- init_sig (SIGTSTP, "TSTP", "Stopped");
-#endif
-#if defined (SIGTTIN)
- init_sig (SIGTTIN, "TTIN", "Stopped (tty input)");
-#endif
-#if defined (SIGTTOU)
- init_sig (SIGTTOU, "TTOU", "Stopped (tty output)");
-#endif
-#if defined (SIGSTOP)
- init_sig (SIGSTOP, "STOP", "Stopped (signal)");
-#endif
-#if defined (SIGXCPU)
- init_sig (SIGXCPU, "XCPU", "CPU time limit exceeded");
-#endif
-#if defined (SIGXFSZ)
- init_sig (SIGXFSZ, "XFSZ", "File size limit exceeded");
-#endif
-#if defined (SIGVTALRM)
- init_sig (SIGVTALRM, "VTALRM", "Virtual timer expired");
-#endif
-#if defined (SIGPROF)
- init_sig (SIGPROF, "PROF", "Profiling timer expired");
-#endif
-#if defined (SIGWINCH)
- /* "Window size changed" might be more accurate, but even if that
- is all that it means now, perhaps in the future it will be
- extended to cover other kinds of window changes. */
- init_sig (SIGWINCH, "WINCH", "Window changed");
-#endif
-#if defined (SIGCONT)
- init_sig (SIGCONT, "CONT", "Continued");
-#endif
-#if defined (SIGURG)
- init_sig (SIGURG, "URG", "Urgent I/O condition");
-#endif
-#if defined (SIGIO)
- /* "I/O pending" has also been suggested. A disadvantage is
- that signal only happens when the process has
- asked for it, not everytime I/O is pending. Another disadvantage
- is the confusion from giving it a different name than under Unix. */
- init_sig (SIGIO, "IO", "I/O possible");
-#endif
-#if defined (SIGWIND)
- init_sig (SIGWIND, "WIND", "SIGWIND");
-#endif
-#if defined (SIGPHONE)
- init_sig (SIGPHONE, "PHONE", "SIGPHONE");
-#endif
-#if defined (SIGPOLL)
- init_sig (SIGPOLL, "POLL", "I/O possible");
-#endif
-#if defined (SIGLOST)
- init_sig (SIGLOST, "LOST", "Resource lost");
-#endif
-}
-
-/* Return the abbreviation for signal NUMBER. */
-char *
-sig_abbrev (number)
- int number;
-{
- int i;
-
- for (i = 0; i < sig_table_nelts; i++)
- if (sig_table[i].number == number)
- return (char *)sig_table[i].abbrev;
- return NULL;
-}
-
-/* Return the signal number for an ABBREV, or -1 if there is no
- signal by that name. */
-int
-sig_number (abbrev)
- CONST char *abbrev;
-{
- int i;
-
- /* Skip over "SIG" if present. */
- if (abbrev[0] == 'S' && abbrev[1] == 'I' && abbrev[2] == 'G')
- abbrev += 3;
-
- for (i = 0; i < sig_table_nelts; i++)
- if (abbrev[0] == sig_table[i].abbrev[0]
- && strcmp (abbrev, sig_table[i].abbrev) == 0)
- return sig_table[i].number;
- return -1;
-}
-
-#if SYS_SIGLIST_MISSING
-/* Print to standard error the name of SIGNAL, preceded by MESSAGE and
- a colon, and followed by a newline. */
-void
-psignal (signal, message)
- unsigned signal;
- CONST char *message;
-{
- if (signal <= 0 || signal >= NSIG)
- fprintf (stderr, "%s: unknown signal", message);
- else
- fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]);
-}
-#endif /* SYS_SIGLIST_MISSING */
-
-void
-_initialize_signame ()
-{
- init_sigs ();
-}
diff --git a/gdb/signame.h b/gdb/signame.h
deleted file mode 100755
index 4b9cbf9..0000000
--- a/gdb/signame.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Convert between signal names and numbers.
- Copyright (C) 1990 Free Software Foundation, Inc.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Names for signals from 0 to NSIG-1. */
-extern char *sys_siglist[];
-
-#ifdef __STDC__
-/* Return the abbreviation (e.g. ABRT, FPE, etc.) for signal NUMBER.
- Do not return this as a const char *. The caller might want to
- assign it to a char *. */
-char *sig_abbrev (int number);
-
-/* Return the signal number for an ABBREV, or -1 if there is no
- signal by that name. */
-int sig_number (const char *abbrev);
-
-/* Print to standard error the name of SIGNAL, preceded by MESSAGE and
- a colon, and followed by a newline. */
-void psignal (unsigned signal, const char *message);
-
-#else
-
-char *sig_abbrev ();
-int sig_number ();
-void psignal ();
-
-#endif
diff --git a/gdb/solib.c b/gdb/solib.c
deleted file mode 100644
index 6995e50..0000000
--- a/gdb/solib.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/* Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
-** symbol definitions
-*/
-#include <sys/types.h>
-#include <string.h>
-#include <link.h>
-#include <sys/param.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "target.h"
-#include "frame.h"
-#include "regex.h"
-#include "inferior.h"
-
-extern char *getenv();
-
-/*
-** local data declarations
-*/
-#define MAX_PATH_SIZE 256
-struct so_list {
- struct link_map inferior_lm; /* inferior link map */
- struct link_map *inferior_lm_add;
- long ld_text;
- char inferior_so_name[MAX_PATH_SIZE]; /* Shared Object Library Name */
- struct so_list *next; /* Next Structure */
- char symbols_loaded; /* Flag: loaded? */
- char from_tty; /* Flag: print msgs? */
- bfd *so_bfd;
- struct section_table *sections;
- struct section_table *sections_end;
-};
-
-static struct so_list *so_list_head = 0;
-
-/*
-** Build a section map for a shared library, record its text size in
-** the so_list structure and set up the text section of the shared lib.
-*/
-static void
-solib_map_sections(so)
-struct so_list *so;
-{
- char *filename;
- char *scratch_pathname;
- int scratch_chan;
- struct section_table *p;
-
- filename = tilde_expand (so->inferior_so_name);
- make_cleanup (free, filename);
-
- scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
- &scratch_pathname);
- if (scratch_chan < 0)
- scratch_chan = openp (getenv ("LD_LIBRARY_PATH"), 1, filename, O_RDONLY, 0,
- &scratch_pathname);
- if (scratch_chan < 0)
- perror_with_name (filename);
-
- so->so_bfd = bfd_fdopenr (scratch_pathname, NULL, scratch_chan);
- if (!so->so_bfd)
- error ("Could not open `%s' as an executable file: %s",
- scratch_pathname, bfd_errmsg (bfd_error));
- if (!bfd_check_format (so->so_bfd, bfd_object))
- error ("\"%s\": not in executable format: %s.",
- scratch_pathname, bfd_errmsg (bfd_error));
- if (build_section_table (so->so_bfd, &so->sections, &so->sections_end))
- error ("Can't find the file sections in `%s': %s",
- exec_bfd->filename, bfd_errmsg (bfd_error));
-
- for (p = so->sections; p < so->sections_end; p++)
- {
- if (strcmp (bfd_section_name (so->so_bfd, p->sec_ptr), ".text") == 0)
- {
- /* Determine length of text section and relocate it. */
- so->ld_text = p->endaddr - p->addr;
- p->addr += (CORE_ADDR)so->inferior_lm.lm_addr;
- p->endaddr += (CORE_ADDR)so->inferior_lm.lm_addr;
- }
- else
- /* All other sections are ignored for now. */
- p->addr = p->endaddr = 0;
- }
-}
-
-/*=======================================================================*/
-
-/* find_solib
-**
-**Description:
-**
-** This module contains the routine which finds the names of any loaded
-** "images" in the current process. The argument in must be NULL on the
-** first call, and then the returned value must be passed in on
-** subsequent calls. This provides the capability to "step" down the
-** list of loaded objects. On the last object, a NULL value is returned.
-** The arg and return value are "struct link_map" pointers, as defined
-** in <link.h>.
-**
-** NOTE: This only works under SunOS4.0.
-*/
-
-struct so_list *find_solib(so_list_ptr)
-struct so_list *so_list_ptr; /* so_list_head position ptr */
-{
-struct so_list *so_list_next = 0;
-struct link_map *inferior_lm = 0;
-struct link_dynamic inferior_dynamic_cpy;
-struct link_dynamic_2 inferior_ld_2_cpy;
-struct so_list *new;
-int i;
-
- if (!so_list_ptr) {
- if (!(so_list_next = so_list_head)) {
- i = lookup_misc_func ("_DYNAMIC");
- if (i >= 0) {
- read_memory(misc_function_vector[i].address,
- &inferior_dynamic_cpy,
- sizeof(struct link_dynamic));
- if (inferior_dynamic_cpy.ld_version == 3) {
- read_memory((CORE_ADDR)inferior_dynamic_cpy.ld_un.ld_2,
- &inferior_ld_2_cpy,
- sizeof(struct link_dynamic_2));
- inferior_lm = inferior_ld_2_cpy.ld_loaded;
- }
- }
- }
- } else {
- /*
- ** Advance to next local abbreviated load_map structure
- */
- if (!(inferior_lm = so_list_ptr->inferior_lm.lm_next)) {
- /* See if any were added, but be quiet if we can't read
- from the target any more. */
- int status;
-
- status = target_read_memory (
- (CORE_ADDR)so_list_ptr->inferior_lm_add,
- (char *)&so_list_ptr->inferior_lm,
- sizeof(struct link_map));
- if (status == 0)
- inferior_lm = so_list_ptr->inferior_lm.lm_next;
- else
- inferior_lm = 0;
- }
- so_list_next = so_list_ptr->next;
- }
- if ((!so_list_next) && inferior_lm) {
- /*
- ** Get Next LM Structure from inferior image and build
- ** an local abbreviated load_map structure
- */
- new = (struct so_list *) xmalloc(sizeof(struct so_list));
- new->inferior_lm_add = inferior_lm;
- read_memory((CORE_ADDR)inferior_lm,
- &new->inferior_lm,
- sizeof(struct link_map));
-
- read_memory((CORE_ADDR)new->inferior_lm.lm_name,
- new->inferior_so_name,
- MAX_PATH_SIZE - 1);
- new->inferior_so_name[MAX_PATH_SIZE - 1] = 0;
- /* Zero everything after the first terminating null */
- strncpy(new->inferior_so_name, new->inferior_so_name, MAX_PATH_SIZE);
-
-#if 0
- /* This doesn't work for core files, so instead get ld_text
- using solib_map_sections (below). */
- read_memory((CORE_ADDR)new->inferior_lm.lm_ld,
- &inferior_dynamic_cpy,
- sizeof(struct link_dynamic));
- read_memory((CORE_ADDR)inferior_dynamic_cpy.ld_un.ld_2,
- &inferior_ld_2_cpy,
- sizeof(struct link_dynamic_2));
- new->ld_text = inferior_ld_2_cpy.ld_text;
-#endif
-
- new->next = 0;
- new->symbols_loaded = 0;
- new->so_bfd = NULL;
- new->sections = NULL;
- if (so_list_ptr)
- so_list_ptr->next = new;
- else
- so_list_head = new;
-
- solib_map_sections (new);
-
- so_list_next = new;
- }
- return(so_list_next);
-}
-
-/* A small stub to get us past the arg-passing pinhole of catch_errors. */
-
-static int
-symbol_add_stub (arg)
- char *arg;
-{
- register struct so_list *so = (struct so_list *)arg; /* catch_errs bogon */
-
- symbol_file_add (so->inferior_so_name, so->from_tty,
- (unsigned int)so->inferior_lm.lm_addr, 0);
- return 1;
-}
-
-/* The real work of adding a shared library file to the symtab and
- the section list. */
-
-void
-solib_add (arg_string, from_tty, target)
- char *arg_string;
- int from_tty;
- struct target_ops *target;
-{
- register struct so_list *so = 0; /* link map state variable */
- char *val;
- int count, old;
- struct section_table *sec;
-
- if (arg_string == 0)
- re_comp (".");
- else if (val = (char *) re_comp (arg_string)) {
- error ("Invalid regexp: %s", val);
- }
-
- /* Getting new symbols may change our opinion about what is
- frameless. */
- reinit_frame_cache ();
-
- if (from_tty) {
- printf_filtered ("Shared libraries");
- if (arg_string)
- printf_filtered (" matching regular expresion \"%s\"", arg_string);
- printf_filtered (":\n");
- }
-
- dont_repeat();
-
- while (so = find_solib(so)) {
- if (re_exec(so->inferior_so_name)) {
- if (so->symbols_loaded) {
- if (from_tty)
- printf("Symbols already loaded for %s\n", so->inferior_so_name);
- } else {
- so->symbols_loaded = 1;
- so->from_tty = from_tty;
- catch_errors (symbol_add_stub, (char *)so,
- "Error while reading shared library symbols:\n");
- }
- }
- }
-
- /* Now add the shared library sections to the section table of the
- specified target, if any. */
- if (target) {
- /* Count how many new section_table entries there are. */
- so = 0;
- count = 0;
- while (0 != (so = find_solib (so))) {
- count += so->sections_end - so->sections;
- }
-
- if (count) {
- /* Reallocate the target's section table including the new size. */
- if (target->sections) {
- old = target->sections_end - target->sections;
- target->sections = (struct section_table *)
- realloc ((char *)target->sections,
- (sizeof (struct section_table)) * (count + old));
- } else {
- old = 0;
- target->sections = (struct section_table *)
- malloc ((sizeof (struct section_table)) * count);
- }
- target->sections_end = target->sections + (count + old);
-
- /* Add these section table entries to the target's table. */
- while (0 != (so = find_solib (so))) {
- count = so->sections_end - so->sections;
- bcopy (so->sections, (char *)(target->sections + old),
- (sizeof (struct section_table)) * count);
- old += count;
- }
- }
- }
-}
-
-/*=======================================================================*/
-
-static void solib_info()
-{
-register struct so_list *so = 0; /* link map state variable */
-
- while (so = find_solib(so)) {
- if (so == so_list_head) {
- printf(" Address Range Syms Read Shared Object Library\n");
- }
- printf(" 0x%08x - 0x%08x %s %s\n",
- so->inferior_lm.lm_addr,
- so->inferior_lm.lm_addr + so->ld_text - 1,
- (so->symbols_loaded ? "Yes" : "No "),
- so->inferior_so_name);
- }
- if (!so_list_head) {
- printf("No shared libraries loaded at this time.\n");
- }
-}
-
-/*
-** Called by Insert Breakpoint to see if Address is Shared Library Address
-*/
-int
-solib_address(address)
- CORE_ADDR address;
-{
-register struct so_list *so = 0; /* link map state variable */
-
- while (so = find_solib(so)) {
- if ((address >= (CORE_ADDR) so->inferior_lm.lm_addr) &&
- (address < (CORE_ADDR) so->inferior_lm.lm_addr + so->ld_text))
- return 1;
- }
- return 0;
-}
-
-/*
-** Called by free_all_symtabs
-*/
-void
-clear_solib()
-{
-struct so_list *next;
-
- while (so_list_head) {
- if (so_list_head->sections)
- free (so_list_head->sections);
- if (so_list_head->so_bfd)
- bfd_close (so_list_head->so_bfd);
- next = so_list_head->next;
- free(so_list_head);
- so_list_head = next;
- }
-}
-
-/* Called by child_create_inferior when the inferior is stopped at its
- first instruction. */
-
-void
-solib_create_inferior_hook()
-{
- struct link_dynamic inferior_dynamic_cpy;
- CORE_ADDR inferior_debug_addr;
- struct ld_debug inferior_debug_cpy;
- int in_debugger;
- CORE_ADDR in_debugger_addr;
- CORE_ADDR breakpoint_addr;
- int i, j;
-
- /* FIXME: We should look around in the executable code to find _DYNAMIC,
- if it isn't in the symbol table. It's not that hard to find...
- Then we can debug stripped executables using shared library symbols. */
- i = lookup_misc_func ("_DYNAMIC");
- if (i < 0) /* Can't find shared lib ptr. */
- return;
- if (misc_function_vector[i].address == 0) /* statically linked program */
- return;
-
- /* Get link_dynamic structure */
- j = target_read_memory(misc_function_vector[i].address,
- &inferior_dynamic_cpy,
- sizeof(struct link_dynamic));
- if (j) /* unreadable */
- return;
-
- /* Calc address of debugger interface structure */
- inferior_debug_addr = (CORE_ADDR)inferior_dynamic_cpy.ldd;
- /* Calc address of `in_debugger' member of debugger interface structure */
- in_debugger_addr = inferior_debug_addr + (CORE_ADDR)((char *)&inferior_debug_cpy.ldd_in_debugger - (char *)&inferior_debug_cpy);
- /* Write a value of 1 to this member. */
- in_debugger = 1;
- write_memory(in_debugger_addr, &in_debugger, sizeof(in_debugger));
-
- /* Now run the target. Seeing `in_debugger' set, it will set a
- breakpoint at some convenient place, remember the original contents
- of that place, and eventually take a SIGTRAP when it runs into the
- breakpoint. We handle this by restoring the contents of the
- breakpointed location (which is only known after it stops),
- chasing around to locate the shared libraries that have been
- loaded, then resuming. */
-
- clear_proceed_status ();
- stop_soon_quietly = 1;
- target_resume (0, 0);
- wait_for_inferior ();
- while (stop_signal != SIGTRAP)
- {
- /* FIXME, what if child has exit()ed? Must exit loop somehow */
- target_resume (0, stop_signal);
- wait_for_inferior ();
- }
- stop_soon_quietly = 0;
-
- /* Set `in_debugger' to zero now. WHY, is this needed? */
- in_debugger = 0;
- write_memory(in_debugger_addr, &in_debugger, sizeof(in_debugger));
- read_memory(inferior_debug_addr, &inferior_debug_cpy, sizeof(inferior_debug_cpy));
- /* FIXME: maybe we should add the common symbols from the ldd_cp chain
- * to the misc_function_vector ?
- */
- breakpoint_addr = (CORE_ADDR)inferior_debug_cpy.ldd_bp_addr;
- if (stop_pc - DECR_PC_AFTER_BREAK == breakpoint_addr)
- {
- write_memory(breakpoint_addr, &inferior_debug_cpy.ldd_bp_inst, sizeof(inferior_debug_cpy.ldd_bp_inst));
- if (DECR_PC_AFTER_BREAK)
- {
- stop_pc -= DECR_PC_AFTER_BREAK;
- write_register (PC_REGNUM, stop_pc);
- }
- }
- solib_add ((char *)0, 0, (struct target_ops *)0);
-}
-
-void
-sharedlibrary_command (args, from_tty)
-{
- solib_add (args, from_tty, (struct target_ops *)0);
-}
-
-void
-_initialize_solib()
-{
-
- add_com("sharedlibrary", class_files, sharedlibrary_command,
- "Load shared object library symbols for files matching REGEXP.");
- add_info("sharedlibrary", solib_info,
- "Status of loaded shared object libraries");
-}
diff --git a/gdb/source.c b/gdb/source.c
deleted file mode 100644
index 369788f..0000000
--- a/gdb/source.c
+++ /dev/null
@@ -1,1212 +0,0 @@
-/* List lines of source files for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1988, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "symtab.h"
-#include "param.h"
-#include "language.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "frame.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <string.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "gdbcore.h"
-#include "regex.h"
-
-/* If we use this declaration, it breaks because of fucking ANSI "const" stuff
- on some systems. We just have to not declare it at all, have it default
- to int, and possibly botch on a few systems. Thanks, ANSIholes... */
-/* extern char *strstr(); */
-
-extern void set_next_address ();
-
-/* Path of directories to search for source files.
- Same format as the PATH environment variable's value. */
-
-char *source_path;
-
-/* Symtab of default file for listing lines of. */
-
-struct symtab *current_source_symtab;
-
-/* Default next line to list. */
-
-int current_source_line;
-
-/* Default number of lines to print with commands like "list".
- This is based on guessing how many long (i.e. more than chars_per_line
- characters) lines there will be. To be completely correct, "list"
- and friends should be rewritten to count characters and see where
- things are wrapping, but that would be a fair amount of work. */
-
-unsigned lines_to_list = 10;
-
-/* Line number of last line printed. Default for various commands.
- current_source_line is usually, but not always, the same as this. */
-
-static int last_line_listed;
-
-/* First line number listed by last listing command. */
-
-static int first_line_listed;
-
-
-/* Set the source file default for the "list" command, specifying a
- symtab. Sigh. Behavior specification: If it is called with a
- non-zero argument, that is the symtab to select. If it is not,
- first lookup "main"; if it exists, use the symtab and line it
- defines. If not, take the last symtab in the symtab_list (if it
- exists) or the last symtab in the psymtab_list (if *it* exists). If
- none of this works, report an error. */
-
-void
-select_source_symtab (s)
- register struct symtab *s;
-{
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- struct partial_symtab *ps;
- struct partial_symtab *cs_pst = 0;
-
- if (s)
- {
- current_source_symtab = s;
- current_source_line = 1;
- return;
- }
-
- /* Make the default place to list be the function `main'
- if one exists. */
- if (lookup_symbol ("main", 0, VAR_NAMESPACE, 0, NULL))
- {
- sals = decode_line_spec ("main", 1);
- sal = sals.sals[0];
- free (sals.sals);
- current_source_symtab = sal.symtab;
- current_source_line = max (sal.line - (lines_to_list - 1), 1);
- if (current_source_symtab)
- return;
- }
-
- /* All right; find the last file in the symtab list (ignoring .h's). */
-
- current_source_line = 1;
-
- for (s = symtab_list; s; s = s->next)
- {
- char *name = s->filename;
- int len = strlen (name);
- if (! (len > 2 && !strcmp (&name[len - 2], ".h")))
- current_source_symtab = s;
- }
- if (current_source_symtab)
- return;
-
- /* Howabout the partial symtab list? */
-
- if (partial_symtab_list)
- {
- ps = partial_symtab_list;
- while (ps)
- {
- char *name = ps->filename;
- int len = strlen (name);
- if (! (len > 2 && !strcmp (&name[len - 2], ".h")))
- cs_pst = ps;
- ps = ps->next;
- }
- if (cs_pst)
- if (cs_pst->readin)
- fatal ("Internal: select_source_symtab: readin pst found and no symtabs.");
- else
- current_source_symtab = PSYMTAB_TO_SYMTAB (cs_pst);
- }
- if (current_source_symtab)
- return;
-
- error ("Can't find a default source file");
-}
-
-static void
-show_directories ()
-{
- printf ("Source directories searched: %s\n", source_path);
-}
-
-/* Forget what we learned about line positions in source files,
- and which directories contain them;
- must check again now since files may be found in
- a different directory now. */
-
-void
-forget_cached_source_info ()
-{
- register struct symtab *s;
-
- for (s = symtab_list; s; s = s->next)
- {
- if (s->line_charpos != 0)
- {
- free (s->line_charpos);
- s->line_charpos = 0;
- }
- if (s->fullname != 0)
- {
- free (s->fullname);
- s->fullname = 0;
- }
- }
-}
-
-void
-init_source_path ()
-{
- source_path = savestring ("$cdir:$cwd", /* strlen of it */ 10);
- forget_cached_source_info ();
-}
-
-/* Add zero or more directories to the front of the source path. */
-
-void
-directory_command (dirname, from_tty)
- char *dirname;
- int from_tty;
-{
- dont_repeat ();
- /* FIXME, this goes to "delete dir"... */
- if (dirname == 0)
- {
- if (query ("Reinitialize source path to empty? ", ""))
- {
- free (source_path);
- init_source_path ();
- }
- }
- else
- mod_path (dirname, &source_path);
- if (from_tty)
- show_directories ();
- forget_cached_source_info ();
-}
-
-/* Add zero or more directories to the front of an arbitrary path. */
-
-void
-mod_path (dirname, which_path)
- char *dirname;
- char **which_path;
-{
- char *old = *which_path;
- int prefix = 0;
-
- if (dirname == 0)
- return;
-
- dirname = strsave (dirname);
- make_cleanup (free, dirname);
-
- do
- {
- extern char *index ();
- char *name = dirname;
- register char *p;
- struct stat st;
-
- {
- char *colon = index (name, ':');
- char *space = index (name, ' ');
- char *tab = index (name, '\t');
- if (colon == 0 && space == 0 && tab == 0)
- p = dirname = name + strlen (name);
- else
- {
- p = 0;
- if (colon != 0 && (p == 0 || colon < p))
- p = colon;
- if (space != 0 && (p == 0 || space < p))
- p = space;
- if (tab != 0 && (p == 0 || tab < p))
- p = tab;
- dirname = p + 1;
- while (*dirname == ':' || *dirname == ' ' || *dirname == '\t')
- ++dirname;
- }
- }
-
- if (p[-1] == '/')
- /* Sigh. "foo/" => "foo" */
- --p;
- *p = '\0';
-
- while (p[-1] == '.')
- {
- if (p - name == 1)
- {
- /* "." => getwd (). */
- name = current_directory;
- goto append;
- }
- else if (p[-2] == '/')
- {
- if (p - name == 2)
- {
- /* "/." => "/". */
- *--p = '\0';
- goto append;
- }
- else
- {
- /* "...foo/." => "...foo". */
- p -= 2;
- *p = '\0';
- continue;
- }
- }
- else
- break;
- }
-
- if (name[0] == '~')
- name = tilde_expand (name);
- else if (name[0] != '/' && name[0] != '$')
- name = concat (current_directory, "/", name);
- else
- name = savestring (name, p - name);
- make_cleanup (free, name);
-
- /* Unless it's a variable, check existence. */
- if (name[0] != '$') {
- if (stat (name, &st) < 0)
- perror_with_name (name);
- if ((st.st_mode & S_IFMT) != S_IFDIR)
- error ("%s is not a directory.", name);
- }
-
- append:
- {
- register unsigned int len = strlen (name);
-
- p = *which_path;
- while (1)
- {
- if (!strncmp (p, name, len)
- && (p[len] == '\0' || p[len] == ':'))
- {
- /* Found it in the search path, remove old copy */
- if (p > *which_path)
- p--; /* Back over leading colon */
- if (prefix > p - *which_path)
- goto skip_dup; /* Same dir twice in one cmd */
- strcpy (p, &p[len+1]); /* Copy from next \0 or : */
- }
- p = index (p, ':');
- if (p != 0)
- ++p;
- else
- break;
- }
- if (p == 0)
- {
- /* If we have already tacked on a name(s) in this command, be sure they stay on the front as we tack on some more. */
- if (prefix)
- {
- char *temp, c;
-
- c = old[prefix];
- old[prefix] = '\0';
- temp = concat (old, ":", name);
- old[prefix] = c;
- *which_path = concat (temp, "", &old[prefix]);
- prefix = strlen (temp);
- free (temp);
- }
- else
- {
- *which_path = concat (name, (old[0]? ":" : old), old);
- prefix = strlen (name);
- }
- free (old);
- old = *which_path;
- }
- }
- skip_dup: ;
- } while (*dirname != '\0');
-}
-
-
-static void
-source_info ()
-{
- register struct symtab *s = current_source_symtab;
-
- if (!s)
- {
- printf("No current source file.\n");
- return;
- }
- printf ("Current source file is %s\n", s->filename);
- if (s->dirname)
- printf ("Compilation directory is %s\n", s->dirname);
- if (s->fullname)
- printf ("Located in %s\n", s->fullname);
- if (s->nlines)
- printf ("Contains %d lines\n", s->nlines);
-
- printf("Source language %s.\n", language_str (s->language));
-}
-
-
-
-/* Open a file named STRING, searching path PATH (dir names sep by colons)
- using mode MODE and protection bits PROT in the calls to open.
- If TRY_CWD_FIRST, try to open ./STRING before searching PATH.
- (ie pretend the first element of PATH is ".")
- If FILENAMED_OPENED is non-null, set it to a newly allocated string naming
- the actual file opened (this string will always start with a "/". We
- have to take special pains to avoid doubling the "/" between the directory
- and the file, sigh! Emacs gets confuzzed by this when we print the
- source file name!!!
-
- If a file is found, return the descriptor.
- Otherwise, return -1, with errno set for the last name we tried to open. */
-
-/* >>>> This should only allow files of certain types,
- >>>> eg executable, non-directory */
-int
-openp (path, try_cwd_first, string, mode, prot, filename_opened)
- char *path;
- int try_cwd_first;
- char *string;
- int mode;
- int prot;
- char **filename_opened;
-{
- register int fd;
- register char *filename;
- register char *p, *p1;
- register int len;
- int alloclen;
-
- if (!path)
- path = ".";
-
- /* ./foo => foo */
- while (string[0] == '.' && string[1] == '/')
- string += 2;
-
- if (try_cwd_first || string[0] == '/')
- {
- filename = string;
- fd = open (filename, mode, prot);
- if (fd >= 0 || string[0] == '/')
- goto done;
- }
-
- alloclen = strlen (path) + strlen (string) + 2;
- filename = (char *) alloca (alloclen);
- fd = -1;
- for (p = path; p; p = p1 ? p1 + 1 : 0)
- {
- p1 = (char *) index (p, ':');
- if (p1)
- len = p1 - p;
- else
- len = strlen (p);
-
- if (len == 4 && p[0] == '$' && p[1] == 'c'
- && p[2] == 'w' && p[3] == 'd') {
- /* Name is $cwd -- insert current directory name instead. */
- int newlen;
-
- /* First, realloc the filename buffer if too short. */
- len = strlen (current_directory);
- newlen = len + strlen (string) + 2;
- if (newlen > alloclen) {
- alloclen = newlen;
- filename = (char *) alloca (alloclen);
- }
- strcpy (filename, current_directory);
- } else {
- /* Normal file name in path -- just use it. */
- strncpy (filename, p, len);
- filename[len] = 0;
- }
-
- /* Beware the // my son, the Emacs barfs, the botch that catch... */
- while (len > 1 && filename[len-1] == '/')
- filename[--len] = 0;
- strcat (filename+len, "/");
- strcat (filename, string);
-
- fd = open (filename, mode, prot);
- if (fd >= 0) break;
- }
-
- done:
- if (filename_opened)
- if (fd < 0)
- *filename_opened = (char *) 0;
- else if (filename[0] == '/')
- *filename_opened = savestring (filename, strlen (filename));
- else
- {
- /* Beware the // my son, the Emacs barfs, the botch that catch... */
-
- *filename_opened = concat (current_directory,
- '/' == current_directory[strlen(current_directory)-1]? "": "/",
- filename);
- }
-
- return fd;
-}
-
-/* Open a source file given a symtab S. Returns a file descriptor
- or negative number for error. */
-int
-open_source_file (s)
- struct symtab *s;
-{
- char *path = source_path;
- char *p;
- int result;
-
- /* Quick way out if we already know its full name */
- if (s->fullname)
- {
- result = open (s->fullname, O_RDONLY);
- if (result >= 0)
- return result;
- /* Didn't work -- free old one, try again. */
- free (s->fullname);
- s->fullname = NULL;
- }
-
- if (s->dirname != NULL)
- {
- /* Replace a path entry of $cdir with the compilation directory name */
-#define cdir_len 5
- /* We cast strstr's result in case an ANSIhole has made it const,
- which produces a "required warning" when assigned to a nonconst. */
- p = (char *)strstr (source_path, "$cdir");
- if (p && (p == path || p[-1] == ':')
- && (p[cdir_len] == ':' || p[cdir_len] == '\0')) {
- int len;
-
- path = (char *)
- alloca (strlen (source_path) + 1 + strlen (s->dirname) + 1);
- len = p - source_path;
- strncpy (path, source_path, len); /* Before $cdir */
- strcpy (path + len, s->dirname); /* new stuff */
- strcat (path + len, source_path + len + cdir_len); /* After $cdir */
- }
- }
-
- return openp (path, 0, s->filename, O_RDONLY, 0, &s->fullname);
-}
-
-
-/* Create and initialize the table S->line_charpos that records
- the positions of the lines in the source file, which is assumed
- to be open on descriptor DESC.
- All set S->nlines to the number of such lines. */
-
-static void
-find_source_lines (s, desc)
- struct symtab *s;
- int desc;
-{
- struct stat st;
- register char *data, *p, *end;
- int nlines = 0;
- int lines_allocated = 1000;
- int *line_charpos = (int *) xmalloc (lines_allocated * sizeof (int));
-
- if (fstat (desc, &st) < 0)
- perror_with_name (s->filename);
- if (exec_bfd && bfd_get_mtime(exec_bfd) < st.st_mtime)
- printf ("Source file is more recent than executable.\n");
-
-#ifdef BROKEN_LARGE_ALLOCA
- data = (char *) xmalloc (st.st_size);
- make_cleanup (free, data);
-#else
- data = (char *) alloca (st.st_size);
-#endif
- if (myread (desc, data, st.st_size) < 0)
- perror_with_name (s->filename);
- end = data + st.st_size;
- p = data;
- line_charpos[0] = 0;
- nlines = 1;
- while (p != end)
- {
- if (*p++ == '\n'
- /* A newline at the end does not start a new line. */
- && p != end)
- {
- if (nlines == lines_allocated)
- {
- lines_allocated *= 2;
- line_charpos = (int *) xrealloc (line_charpos,
- sizeof (int) * lines_allocated);
- }
- line_charpos[nlines++] = p - data;
- }
- }
- s->nlines = nlines;
- s->line_charpos = (int *) xrealloc (line_charpos, nlines * sizeof (int));
-}
-
-/* Return the character position of a line LINE in symtab S.
- Return 0 if anything is invalid. */
-
-int
-source_line_charpos (s, line)
- struct symtab *s;
- int line;
-{
- if (!s) return 0;
- if (!s->line_charpos || line <= 0) return 0;
- if (line > s->nlines)
- line = s->nlines;
- return s->line_charpos[line - 1];
-}
-
-/* Return the line number of character position POS in symtab S. */
-
-int
-source_charpos_line (s, chr)
- register struct symtab *s;
- register int chr;
-{
- register int line = 0;
- register int *lnp;
-
- if (s == 0 || s->line_charpos == 0) return 0;
- lnp = s->line_charpos;
- /* Files are usually short, so sequential search is Ok */
- while (line < s->nlines && *lnp <= chr)
- {
- line++;
- lnp++;
- }
- if (line >= s->nlines)
- line = s->nlines;
- return line;
-}
-
-/* Get full pathname and line number positions for a symtab.
- Return nonzero if line numbers may have changed.
- Set *FULLNAME to actual name of the file as found by `openp',
- or to 0 if the file is not found. */
-
-int
-get_filename_and_charpos (s, fullname)
- struct symtab *s;
- char **fullname;
-{
- register int desc, linenums_changed = 0;
-
- desc = open_source_file (s);
- if (desc < 0)
- {
- if (fullname)
- *fullname = NULL;
- return 0;
- }
- if (fullname)
- *fullname = s->fullname;
- if (s->line_charpos == 0) linenums_changed = 1;
- if (linenums_changed) find_source_lines (s, desc);
- close (desc);
- return linenums_changed;
-}
-
-/* Print text describing the full name of the source file S
- and the line number LINE and its corresponding character position.
- The text starts with two Ctrl-z so that the Emacs-GDB interface
- can easily find it.
-
- MID_STATEMENT is nonzero if the PC is not at the beginning of that line.
-
- Return 1 if successful, 0 if could not find the file. */
-
-int
-identify_source_line (s, line, mid_statement)
- struct symtab *s;
- int line;
- int mid_statement;
-{
- if (s->line_charpos == 0)
- get_filename_and_charpos (s, (char **)NULL);
- if (s->fullname == 0)
- return 0;
- printf ("\032\032%s:%d:%d:%s:0x%x\n", s->fullname,
- line, s->line_charpos[line - 1],
- mid_statement ? "middle" : "beg",
- get_frame_pc (get_current_frame()));
- current_source_line = line;
- first_line_listed = line;
- last_line_listed = line;
- current_source_symtab = s;
- return 1;
-}
-
-/* Print source lines from the file of symtab S,
- starting with line number LINE and stopping before line number STOPLINE. */
-
-void
-print_source_lines (s, line, stopline, noerror)
- struct symtab *s;
- int line, stopline;
- int noerror;
-{
- register int c;
- register int desc;
- register FILE *stream;
- int nlines = stopline - line;
-
- /* Regardless of whether we can open the file, set current_source_symtab. */
- current_source_symtab = s;
- current_source_line = line;
- first_line_listed = line;
-
- desc = open_source_file (s);
- if (desc < 0)
- {
- if (! noerror) {
- char *name = alloca (strlen (s->filename) + 100);
- sprintf (name, "%s:%d", s->filename, line);
- print_sys_errmsg (name, errno);
- }
- return;
- }
-
- if (s->line_charpos == 0)
- find_source_lines (s, desc);
-
- if (line < 1 || line > s->nlines)
- {
- close (desc);
- error ("Line number %d out of range; %s has %d lines.",
- line, s->filename, s->nlines);
- }
-
- if (lseek (desc, s->line_charpos[line - 1], 0) < 0)
- {
- close (desc);
- perror_with_name (s->filename);
- }
-
- stream = fdopen (desc, "r");
- clearerr (stream);
-
- while (nlines-- > 0)
- {
- c = fgetc (stream);
- if (c == EOF) break;
- last_line_listed = current_source_line;
- printf_filtered ("%d\t", current_source_line++);
- do
- {
- if (c < 040 && c != '\t' && c != '\n')
- printf_filtered ("^%c", c + 0100);
- else if (c == 0177)
- printf_filtered ("^?");
- else
- printf_filtered ("%c", c);
- } while (c != '\n' && (c = fgetc (stream)) >= 0);
- }
-
- fclose (stream);
-}
-
-
-
-/*
- C++
- Print a list of files and line numbers which a user may choose from
- in order to list a function which was specified ambiguously
- (as with `list classname::overloadedfuncname', for example).
- The vector in SALS provides the filenames and line numbers.
- */
-static void
-ambiguous_line_spec (sals)
- struct symtabs_and_lines *sals;
-{
- int i;
-
- for (i = 0; i < sals->nelts; ++i)
- printf("file: \"%s\", line number: %d\n",
- sals->sals[i].symtab->filename, sals->sals[i].line);
-}
-
-
-static void
-list_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- struct symtabs_and_lines sals, sals_end;
- struct symtab_and_line sal, sal_end;
- struct symbol *sym;
- char *arg1;
- int no_end = 1;
- int dummy_end = 0;
- int dummy_beg = 0;
- int linenum_beg = 0;
- char *p;
-
- if (symtab_list == 0 && partial_symtab_list == 0)
- error ("No symbol table is loaded. Use the \"file\" command.");
-
- /* Pull in a current source symtab if necessary */
- if (current_source_symtab == 0 &&
- (arg == 0 || arg[0] == '+' || arg[0] == '-'))
- select_source_symtab (0);
-
- /* "l" or "l +" lists next ten lines. */
-
- if (arg == 0 || !strcmp (arg, "+"))
- {
- if (current_source_symtab == 0)
- error ("No default source file yet. Do \"help list\".");
- print_source_lines (current_source_symtab, current_source_line,
- current_source_line + lines_to_list, 0);
- return;
- }
-
- /* "l -" lists previous ten lines, the ones before the ten just listed. */
- if (!strcmp (arg, "-"))
- {
- if (current_source_symtab == 0)
- error ("No default source file yet. Do \"help list\".");
- print_source_lines (current_source_symtab,
- max (first_line_listed - lines_to_list, 1),
- first_line_listed, 0);
- return;
- }
-
- /* Now if there is only one argument, decode it in SAL
- and set NO_END.
- If there are two arguments, decode them in SAL and SAL_END
- and clear NO_END; however, if one of the arguments is blank,
- set DUMMY_BEG or DUMMY_END to record that fact. */
-
- arg1 = arg;
- if (*arg1 == ',')
- dummy_beg = 1;
- else
- {
- sals = decode_line_1 (&arg1, 0, 0, 0);
-
- if (! sals.nelts) return; /* C++ */
- if (sals.nelts > 1)
- {
- ambiguous_line_spec (&sals);
- free (sals.sals);
- return;
- }
-
- sal = sals.sals[0];
- free (sals.sals);
- }
-
- /* Record whether the BEG arg is all digits. */
-
- for (p = arg; p != arg1 && *p >= '0' && *p <= '9'; p++);
- linenum_beg = (p == arg1);
-
- while (*arg1 == ' ' || *arg1 == '\t')
- arg1++;
- if (*arg1 == ',')
- {
- no_end = 0;
- arg1++;
- while (*arg1 == ' ' || *arg1 == '\t')
- arg1++;
- if (*arg1 == 0)
- dummy_end = 1;
- else
- {
- if (dummy_beg)
- sals_end = decode_line_1 (&arg1, 0, 0, 0);
- else
- sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line);
- if (sals_end.nelts == 0)
- return;
- if (sals_end.nelts > 1)
- {
- ambiguous_line_spec (&sals_end);
- free (sals_end.sals);
- return;
- }
- sal_end = sals_end.sals[0];
- free (sals_end.sals);
- }
- }
-
- if (*arg1)
- error ("Junk at end of line specification.");
-
- if (!no_end && !dummy_beg && !dummy_end
- && sal.symtab != sal_end.symtab)
- error ("Specified start and end are in different files.");
- if (dummy_beg && dummy_end)
- error ("Two empty args do not say what lines to list.");
-
- /* if line was specified by address,
- first print exactly which line, and which file.
- In this case, sal.symtab == 0 means address is outside
- of all known source files, not that user failed to give a filename. */
- if (*arg == '*')
- {
- if (sal.symtab == 0)
- error ("No source file for address %s.", local_hex_string(sal.pc));
- sym = find_pc_function (sal.pc);
- if (sym)
- printf ("%s is in %s (%s, line %d).\n",
- local_hex_string(sal.pc),
- SYMBOL_NAME (sym), sal.symtab->filename, sal.line);
- else
- printf ("%s is in %s, line %d.\n",
- local_hex_string(sal.pc),
- sal.symtab->filename, sal.line);
- }
-
- /* If line was not specified by just a line number,
- and it does not imply a symtab, it must be an undebuggable symbol
- which means no source code. */
-
- if (! linenum_beg && sal.symtab == 0)
- error ("No line number known for %s.", arg);
-
- /* If this command is repeated with RET,
- turn it into the no-arg variant. */
-
- if (from_tty)
- *arg = 0;
-
- if (dummy_beg && sal_end.symtab == 0)
- error ("No default source file yet. Do \"help list\".");
- if (dummy_beg)
- print_source_lines (sal_end.symtab,
- max (sal_end.line - (lines_to_list - 1), 1),
- sal_end.line + 1, 0);
- else if (sal.symtab == 0)
- error ("No default source file yet. Do \"help list\".");
- else if (no_end)
- print_source_lines (sal.symtab,
- max (sal.line - (lines_to_list / 2), 1),
- sal.line + (lines_to_list / 2), 0);
- else
- print_source_lines (sal.symtab, sal.line,
- (dummy_end
- ? sal.line + lines_to_list
- : sal_end.line + 1),
- 0);
-}
-
-/* Print info on range of pc's in a specified line. */
-
-static void
-line_info (arg, from_tty)
- char *arg;
- int from_tty;
-{
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- CORE_ADDR start_pc, end_pc;
- int i;
-
- if (arg == 0)
- {
- sal.symtab = current_source_symtab;
- sal.line = last_line_listed;
- sals.nelts = 1;
- sals.sals = (struct symtab_and_line *)
- xmalloc (sizeof (struct symtab_and_line));
- sals.sals[0] = sal;
- }
- else
- {
- sals = decode_line_spec_1 (arg, 0);
-
- /* If this command is repeated with RET,
- turn it into the no-arg variant. */
- if (from_tty)
- *arg = 0;
- }
-
- /* C++ More than one line may have been specified, as when the user
- specifies an overloaded function name. Print info on them all. */
- for (i = 0; i < sals.nelts; i++)
- {
- sal = sals.sals[i];
-
- if (sal.symtab == 0)
- error ("No source file specified.");
-
- if (sal.line > 0
- && find_line_pc_range (sal.symtab, sal.line, &start_pc, &end_pc))
- {
- if (start_pc == end_pc)
- printf ("Line %d of \"%s\" is at pc %s but contains no code.\n",
- sal.line, sal.symtab->filename, local_hex_string(start_pc));
- else
- printf ("Line %d of \"%s\" starts at pc %s",
- sal.line, sal.symtab->filename,
- local_hex_string(start_pc));
- printf (" and ends at %s.\n",
- local_hex_string(end_pc));
- /* x/i should display this line's code. */
- set_next_address (start_pc);
- /* Repeating "info line" should do the following line. */
- last_line_listed = sal.line + 1;
- }
- else
- printf ("Line number %d is out of range for \"%s\".\n",
- sal.line, sal.symtab->filename);
- }
-}
-
-/* Commands to search the source file for a regexp. */
-
-/* ARGSUSED */
-static void
-forward_search_command (regex, from_tty)
- char *regex;
- int from_tty;
-{
- register int c;
- register int desc;
- register FILE *stream;
- int line = last_line_listed + 1;
- char *msg;
-
- msg = (char *) re_comp (regex);
- if (msg)
- error (msg);
-
- if (current_source_symtab == 0)
- select_source_symtab (0);
-
- /* Search from last_line_listed+1 in current_source_symtab */
-
- desc = open_source_file (current_source_symtab);
- if (desc < 0)
- perror_with_name (current_source_symtab->filename);
-
- if (current_source_symtab->line_charpos == 0)
- find_source_lines (current_source_symtab, desc);
-
- if (line < 1 || line > current_source_symtab->nlines)
- {
- close (desc);
- error ("Expression not found");
- }
-
- if (lseek (desc, current_source_symtab->line_charpos[line - 1], 0) < 0)
- {
- close (desc);
- perror_with_name (current_source_symtab->filename);
- }
-
- stream = fdopen (desc, "r");
- clearerr (stream);
- while (1) {
-/* FIXME!!! We walk right off the end of buf if we get a long line!!! */
- char buf[4096]; /* Should be reasonable??? */
- register char *p = buf;
-
- c = getc (stream);
- if (c == EOF)
- break;
- do {
- *p++ = c;
- } while (c != '\n' && (c = getc (stream)) >= 0);
-
- /* we now have a source line in buf, null terminate and match */
- *p = 0;
- if (re_exec (buf) > 0)
- {
- /* Match! */
- fclose (stream);
- print_source_lines (current_source_symtab,
- line, line+1, 0);
- current_source_line = max (line - lines_to_list / 2, 1);
- return;
- }
- line++;
- }
-
- printf ("Expression not found\n");
- fclose (stream);
-}
-
-/* ARGSUSED */
-static void
-reverse_search_command (regex, from_tty)
- char *regex;
- int from_tty;
-{
- register int c;
- register int desc;
- register FILE *stream;
- int line = last_line_listed - 1;
- char *msg;
-
- msg = (char *) re_comp (regex);
- if (msg)
- error (msg);
-
- if (current_source_symtab == 0)
- select_source_symtab (0);
-
- /* Search from last_line_listed-1 in current_source_symtab */
-
- desc = open_source_file (current_source_symtab);
- if (desc < 0)
- perror_with_name (current_source_symtab->filename);
-
- if (current_source_symtab->line_charpos == 0)
- find_source_lines (current_source_symtab, desc);
-
- if (line < 1 || line > current_source_symtab->nlines)
- {
- close (desc);
- error ("Expression not found");
- }
-
- if (lseek (desc, current_source_symtab->line_charpos[line - 1], 0) < 0)
- {
- close (desc);
- perror_with_name (current_source_symtab->filename);
- }
-
- stream = fdopen (desc, "r");
- clearerr (stream);
- while (line > 1)
- {
-/* FIXME!!! We walk right off the end of buf if we get a long line!!! */
- char buf[4096]; /* Should be reasonable??? */
- register char *p = buf;
-
- c = getc (stream);
- if (c == EOF)
- break;
- do {
- *p++ = c;
- } while (c != '\n' && (c = getc (stream)) >= 0);
-
- /* We now have a source line in buf; null terminate and match. */
- *p = 0;
- if (re_exec (buf) > 0)
- {
- /* Match! */
- fclose (stream);
- print_source_lines (current_source_symtab,
- line, line+1, 0);
- current_source_line = max (line - lines_to_list / 2, 1);
- return;
- }
- line--;
- if (fseek (stream, current_source_symtab->line_charpos[line - 1], 0) < 0)
- {
- fclose (stream);
- perror_with_name (current_source_symtab->filename);
- }
- }
-
- printf ("Expression not found\n");
- fclose (stream);
- return;
-}
-
-void
-_initialize_source ()
-{
- current_source_symtab = 0;
- init_source_path ();
-
- add_com ("directory", class_files, directory_command,
- "Add directory DIR to beginning of search path for source files.\n\
-Forget cached info on source file locations and line positions.\n\
-DIR can also be $cwd for the current working directory, or $cdir for the\n\
-directory in which the source file was compiled into object code.\n\
-With no argument, reset the search path to $cdir:$cwd, the default.");
-
- add_cmd ("directories", no_class, show_directories,
- "Current search path for finding source files.\n\
-$cwd in the path means the current working directory.\n\
-$cdir in the path means the compilation directory of the source file.",
- &showlist);
-
- add_info ("source", source_info,
- "Information about the current source file.");
-
- add_info ("line", line_info,
- "Core addresses of the code for a source line.\n\
-Line can be specified as\n\
- LINENUM, to list around that line in current file,\n\
- FILE:LINENUM, to list around that line in that file,\n\
- FUNCTION, to list around beginning of that function,\n\
- FILE:FUNCTION, to distinguish among like-named static functions.\n\
-Default is to describe the last source line that was listed.\n\n\
-This sets the default address for \"x\" to the line's first instruction\n\
-so that \"x/i\" suffices to start examining the machine code.\n\
-The address is also stored as the value of \"$_\".");
-
- add_com ("forward-search", class_files, forward_search_command,
- "Search for regular expression (see regex(3)) from last line listed.");
- add_com_alias ("search", "forward-search", class_files, 0);
-
- add_com ("reverse-search", class_files, reverse_search_command,
- "Search backward for regular expression (see regex(3)) from last line listed.");
-
- add_com ("list", class_files, list_command,
- "List specified function or line.\n\
-With no argument, lists ten more lines after or around previous listing.\n\
-\"list -\" lists the ten lines before a previous ten-line listing.\n\
-One argument specifies a line, and ten lines are listed around that line.\n\
-Two arguments with comma between specify starting and ending lines to list.\n\
-Lines can be specified in these ways:\n\
- LINENUM, to list around that line in current file,\n\
- FILE:LINENUM, to list around that line in that file,\n\
- FUNCTION, to list around beginning of that function,\n\
- FILE:FUNCTION, to distinguish among like-named static functions.\n\
- *ADDRESS, to list around the line containing that address.\n\
-With two args if one is empty it stands for ten lines away from the other arg.");
- add_com_alias ("l", "list", class_files, 0);
-
- add_show_from_set
- (add_set_cmd ("listsize", class_support, var_uinteger,
- (char *)&lines_to_list,
- "Set number of source lines gdb will list by default.",
- &setlist),
- &showlist);
-}
diff --git a/gdb/sparc-opcode.h b/gdb/sparc-opcode.h
deleted file mode 100755
index d97c7a3..0000000
--- a/gdb/sparc-opcode.h
+++ /dev/null
@@ -1,643 +0,0 @@
-/* Table of opcodes for the sparc.
- Copyright (C) 1989 Free Software Foundation, Inc.
-
-This file is part of GAS, the GNU Assembler, and GDB, the GNU disassembler.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined(__STDC__) && !defined(const)
-#define const
-#endif
-
-/*
- * Structure of an opcode table entry.
- */
-struct sparc_opcode
-{
- const char *name;
- unsigned long int match; /* Bits that must be set. */
- unsigned long int lose; /* Bits that must not be set. */
- const char *args;
- char flags;
-};
-
-#define F_DELAYED 1 /* Delayed branch */
-#define F_ALIAS 2 /* Alias for a "real" instruction */
-
-/*
- All sparc opcodes are 32 bits, except for the `set' instruction (really
- a macro), which is 64 bits. It is handled as a special case.
-
- The match component is a mask saying which bits must match a
- particular opcode in order for an instruction to be an instance
- of that opcode.
-
- The args component is a string containing one character
- for each operand of the instruction.
-
-Kinds of operands:
- # Number used by optimizer. It is ignored.
- 1 rs1 register.
- 2 rs2 register.
- d rd register.
- e frs1 floating point register.
- f frs2 floating point register.
- g frsd floating point register.
- b crs1 coprocessor register
- c crs2 coprocessor register
- D crsd coprocessor register
- h 22 high bits.
- i 13 bit Immediate.
- l 22 bit PC relative immediate.
- L 30 bit PC relative immediate.
- a Annul. The annul bit is set.
- A Alternate address space. Stored as 8 bits.
- C Coprocessor state register.
- F floating point state register.
- p Processor state register.
- q Floating point queue.
- r Single register that is both rs1 and rsd.
- Q Coprocessor queue.
- S Special case.
- t Trap base register.
- w Window invalid mask register.
- y Y register.
-
-*/
-
-/* The order of the opcodes in this table is significant:
-
- * The assembler requires that all instances of the same mnemonic must be
- consecutive. If they aren't, the assembler will bomb at runtime.
-
- * The disassembler should not care about the order of the opcodes. */
-
-static struct sparc_opcode sparc_opcodes[] =
-{
-
-{ "ldd", 0xc1980000, 0x0060201f, "[1],D", 0 }, /* ldd [rs1+%g0],d */
-{ "ldd", 0xc1982000, 0x00601fff, "[1],D", 0 }, /* ldd [rs1+0],d */
-{ "ldd", 0xc1982000, 0x00600000, "[1+i],D", 0 },
-{ "ldd", 0xc1982000, 0x00600000, "[i+1],D", 0 },
-{ "ldd", 0xc1980000, 0x00602000, "[1+2],D", 0 },
-{ "ldd", 0xc1180000, 0x00e0201f, "[1],g", 0 }, /* ldd [rs1+%g0],d */
-{ "ldd", 0xc1182000, 0x00e01fff, "[1],g", 0 }, /* ldd [rs1+0],d */
-{ "ldd", 0xc1182000, 0x00e00000, "[1+i],g", 0 },
-{ "ldd", 0xc1182000, 0x00e00000, "[i+1],g", 0 },
-{ "ldd", 0xc1180000, 0x00e02000, "[1+2],g", 0 },
-{ "ldd", 0xc0180000, 0x01e0201f, "[1],d", 0 }, /* ldd [rs1+%g0],d */
-{ "ldd", 0xc0182000, 0x01e01fff, "[1],d", 0 }, /* ldd [rs1+0],d */
-{ "ldd", 0xc0182000, 0x01e00000, "[1+i],d", 0 },
-{ "ldd", 0xc0182000, 0x01e00000, "[i+1],d", 0 },
-{ "ldd", 0xc0180000, 0x01e02000, "[1+2],d", 0 },
-{ "ld", 0xc1880000, 0x0070201f, "[1],C", 0 }, /* ld [rs1+%g0],d */
-{ "ld", 0xc1882000, 0x00701fff, "[1],C", 0 }, /* ld [rs1+0],d */
-{ "ld", 0xc1882000, 0x00700000, "[1+i],C", 0 },
-{ "ld", 0xc1882000, 0x00700000, "[i+1],C", 0 },
-{ "ld", 0xc1880000, 0x00702000, "[1+2],C", 0 },
-{ "ld", 0xc1800000, 0x0078201f, "[1],D", 0 }, /* ld [rs1+%g0],d */
-{ "ld", 0xc1802000, 0x00781fff, "[1],D", 0 }, /* ld [rs1+0],d */
-{ "ld", 0xc1802000, 0x00780000, "[1+i],D", 0 },
-{ "ld", 0xc1802000, 0x00780000, "[i+1],D", 0 },
-{ "ld", 0xc1800000, 0x00782000, "[1+2],D", 0 },
-{ "ld", 0xc1080000, 0x00f0201f, "[1],F", 0 }, /* ld [rs1+%g0],d */
-{ "ld", 0xc1082000, 0x00f01fff, "[1],F", 0 }, /* ld [rs1+0],d */
-{ "ld", 0xc1082000, 0x00f00000, "[1+i],F", 0 },
-{ "ld", 0xc1082000, 0x00f00000, "[i+1],F", 0 },
-{ "ld", 0xc1080000, 0x00f02000, "[1+2],F", 0 },
-{ "ld", 0xc1000000, 0x00f8201f, "[1],g", 0 }, /* ld [rs1+%g0],d */
-{ "ld", 0xc1002000, 0x00f81fff, "[1],g", 0 }, /* ld [rs1+0],d */
-{ "ld", 0xc1002000, 0x00f80000, "[1+i],g", 0 },
-{ "ld", 0xc1002000, 0x00f80000, "[i+1],g", 0 },
-{ "ld", 0xc1000000, 0x00f82000, "[1+2],g", 0 },
-{ "ld", 0xc0000000, 0x01f8201f, "[1],d", 0 }, /* ld [rs1+%g0],d */
-{ "ld", 0xc0002000, 0x01f81fff, "[1],d", 0 }, /* ld [rs1+0],d */
-{ "ld", 0xc0002000, 0x01f80000, "[1+i],d", 0 },
-{ "ld", 0xc0002000, 0x01f80000, "[i+1],d", 0 },
-{ "ld", 0xc0000000, 0x01f82000, "[1+2],d", 0 },
-{ "ldstuba", 0xc0d80000, 0x0100201f, "[1]A,d", 0 }, /* ldstuba [rs1+%g0],d */
-{ "ldstuba", 0xc0d80000, 0x01002000, "[1+2]A,d", 0 },
-{ "ldsha", 0xc0d00000, 0x0128201f, "[1]A,d", 0 }, /* ldsha [rs1+%g0],d */
-{ "ldsha", 0xc0d00000, 0x01282000, "[1+2]A,d", 0 },
-{ "ldsba", 0xc0c80000, 0x0130201f, "[1]A,d", 0 }, /* ldsba [rs1+%g0],d */
-{ "ldsba", 0xc0c80000, 0x01302000, "[1+2]A,d", 0 },
-{ "ldda", 0xc0980000, 0x0160201f, "[1]A,d", 0 }, /* ldda [rs1+%g0],d */
-{ "ldda", 0xc0980000, 0x01602000, "[1+2]A,d", 0 },
-{ "lduha", 0xc0900000, 0x0168201f, "[1]A,d", 0 }, /* lduha [rs1+%g0],d */
-{ "lduha", 0xc0900000, 0x01682000, "[1+2]A,d", 0 },
-{ "ldstub", 0xc0680000, 0x0190201f, "[1],d", 0 }, /* ldstub [rs1+%g0],d */
-{ "ldstub", 0xc0682000, 0x01900000, "[1+i],d", 0 },
-{ "ldstub", 0xc0682000, 0x01900000, "[i+1],d", 0 },
-{ "ldstub", 0xc0680000, 0x01902000, "[1+2],d", 0 },
-{ "lda", 0xc0800000, 0x0178201f, "[1]A,d", 0 }, /* lda [rs1+%g0],d */
-{ "lda", 0xc0800000, 0x01782000, "[1+2]A,d", 0 },
-{ "ldsh", 0xc0500000, 0x0000000d, "[1],d", 0 }, /* ldsh [rs1+%g0],d */
-{ "ldsh", 0xc0502000, 0x01a81fff, "[1],d", 0 }, /* ldsh [rs1+0],d */
-{ "ldsh", 0xc0502000, 0x01a80000, "[1+i],d", 0 },
-{ "ldsh", 0xc0502000, 0x01a80000, "[i+1],d", 0 },
-{ "ldsh", 0xc0500000, 0x01a82000, "[1+2],d", 0 },
-{ "ldsb", 0xc0480000, 0x01b0201f, "[1],d", 0 }, /* ldsb [rs1+%g0],d */
-{ "ldsb", 0xc0482000, 0x01b01fff, "[1],d", 0 }, /* ldsb [rs1+0],d */
-{ "ldsb", 0xc0482000, 0x01b00000, "[1+i],d", 0 },
-{ "ldsb", 0xc0482000, 0x01b00000, "[i+1],d", 0 },
-{ "ldsb", 0xc0480000, 0x01b02000, "[1+2],d", 0 },
-{ "ldub", 0xc0080000, 0x01f0201f, "[1],d", 0 }, /* ldub [rs1+%g0],d */
-{ "ldub", 0xc0082000, 0x01f01fff, "[1],d", 0 }, /* ldub [rs1+0],d */
-{ "ldub", 0xc0082000, 0x01f00000, "[1+i],d", 0 },
-{ "ldub", 0xc0082000, 0x01f00000, "[i+1],d", 0 },
-{ "ldub", 0xc0080000, 0x01f02000, "[1+2],d", 0 },
-{ "lduba", 0xc0880000, 0x0170201f, "[1]A,d", 0 }, /* lduba [rs1+%g0],d */
-{ "lduba", 0xc0880000, 0x01702000, "[1+2]A,d", 0 },
-{ "lduh", 0xc0102000, 0x01e80000, "[1+i],d", 0 },
-{ "lduh", 0xc0102000, 0x01e80000, "[i+1],d", 0 },
-{ "lduh", 0xc0100000, 0x01e8201f, "[1],d", 0 }, /* lduh [rs1+%g0],d */
-{ "lduh", 0xc0102000, 0x01e81fff, "[1],d", 0 }, /* lduh [rs1+0],d */
-{ "lduh", 0xc0100000, 0x01e82000, "[1+2],d", 0 },
-
-{ "st", 0xc0200000, 0x01d8201f, "d,[1]", 0 }, /* st d,[rs1+%g0] */
-{ "st", 0xc0202000, 0x01d81fff, "d,[1]", 0 }, /* st d,[rs1+0] */
-{ "st", 0xc0202000, 0x01d80000, "d,[1+i]", 0 },
-{ "st", 0xc0202000, 0x01d80000, "d,[i+1]", 0 },
-{ "st", 0xc0200000, 0x01d82000, "d,[1+2]", 0 },
-{ "st", 0xc1200000, 0x00d8201f, "g,[1]", 0 }, /* st d[rs1+%g0] */
-{ "st", 0xc1202000, 0x00d81fff, "g,[1]", 0 }, /* st d,[rs1+0] */
-{ "st", 0xc1202000, 0x00d80000, "g,[1+i]", 0 },
-{ "st", 0xc1202000, 0x00d80000, "g,[i+1]", 0 },
-{ "st", 0xc1200000, 0x00d82000, "g,[1+2]", 0 },
-{ "st", 0xc1280000, 0x00d0201f, "F,[1]", 0 }, /* st %fsr,[rs1+%g0] */
-{ "st", 0xc1282000, 0x00d01fff, "F,[1]", 0 }, /* st %fsr,[rs1+0] */
-{ "st", 0xc1282000, 0x00d00000, "F,[1+i]", 0 },
-{ "st", 0xc1282000, 0x00d00000, "F,[i+1]", 0 },
-{ "st", 0xc1280000, 0x00d02000, "F,[1+2]", 0 },
-{ "st", 0xc1a00000, 0x0058201f, "D,[1]", 0 }, /* st d,[rs1+%g0] */
-{ "st", 0xc1a02000, 0x00581fff, "D,[1]", 0 }, /* st d,[rs1+0] */
-{ "st", 0xc1a02000, 0x00580000, "D,[1+i]", 0 },
-{ "st", 0xc1a02000, 0x00580000, "D,[i+1]", 0 },
-{ "st", 0xc1a00000, 0x00582000, "D,[1+2]", 0 },
-{ "st", 0xc1a80000, 0x0050201f, "C,[1]", 0 }, /* st d,[rs1+%g0] */
-{ "st", 0xc1a82000, 0x00501fff, "C,[1]", 0 }, /* st d,[rs1+0] */
-{ "st", 0xc1a82000, 0x00500000, "C,[1+i]", 0 },
-{ "st", 0xc1a82000, 0x00500000, "C,[i+1]", 0 },
-{ "st", 0xc1a80000, 0x00502000, "C,[1+2]", 0 },
-{ "sta", 0xc0a00000, 0x0108201f, "d,[1]A", 0 }, /* sta d,[rs1+%g0] */
-{ "sta", 0xc0a00000, 0x01082000, "d,[1+2]A", 0 },
-
-{ "stb", 0xc0280000, 0x01d0201f, "d,[1]", 0 }, /* stb d,[rs1+%g0] */
-{ "stb", 0xc0282000, 0x01d01fff, "d,[1]", 0 }, /* stb d,[rs1+0] */
-{ "stb", 0xc0282000, 0x01d00000, "d,[1+i]", 0 },
-{ "stb", 0xc0282000, 0x01d00000, "d,[i+1]", 0 },
-{ "stb", 0xc0280000, 0x01d02000, "d,[1+2]", 0 },
-{ "stba", 0xc0a80000, 0x01002000, "d,[1+2]A", 0 },
-{ "stba", 0xc0a80000, 0x0100201f, "d,[1]A", 0 }, /* stba d,[rs1+%g0] */
-
-{ "std", 0xc0380000, 0x01c0201f, "d,[1]", 0 }, /* std d,[rs1+%g0] */
-{ "std", 0xc0382000, 0x01c01fff, "d,[1]", 0 }, /* std d,[rs1+0] */
-{ "std", 0xc0382000, 0x01c00000, "d,[1+i]", 0 },
-{ "std", 0xc0382000, 0x01c00000, "d,[i+1]", 0 },
-{ "std", 0xc0380000, 0x01c02000, "d,[1+2]", 0 },
-{ "std", 0xc1380000, 0x00c0201f, "g,[1]", 0 }, /* std d,[rs1+%g0] */
-{ "std", 0xc1382000, 0x00c01fff, "g,[1]", 0 }, /* std d,[rs1+0] */
-{ "std", 0xc1382000, 0x00c00000, "g,[1+i]", 0 },
-{ "std", 0xc1382000, 0x00c00000, "g,[i+1]", 0 },
-{ "std", 0xc1380000, 0x00c02000, "g,[1+2]", 0 },
-{ "std", 0xc1300000, 0x00c8201f, "q,[1]", 0 }, /* std d,[rs1+%g0] */
-{ "std", 0xc1302000, 0x00c81fff, "q,[1]", 0 }, /* std d,[rs1+0] */
-{ "std", 0xc1302000, 0x00c80000, "q,[1+i]", 0 },
-{ "std", 0xc1302000, 0x00c80000, "q,[i+1]", 0 },
-{ "std", 0xc1300000, 0x00c82000, "q,[1+2]", 0 },
-{ "std", 0xc1b80000, 0x0040201f, "D,[1]", 0 }, /* std d,[rs1+%g0] */
-{ "std", 0xc1b82000, 0x00401fff, "D,[1]", 0 }, /* std d,[rs1+0] */
-{ "std", 0xc1b82000, 0x00400000, "D,[1+i]", 0 },
-{ "std", 0xc1b82000, 0x00400000, "D,[i+1]", 0 },
-{ "std", 0xc1b80000, 0x00402000, "D,[1+2]", 0 },
-{ "std", 0xc1b00000, 0x0048201f, "Q,[1]", 0 }, /* std d,[rs1+%g0] */
-{ "std", 0xc1b02000, 0x00481fff, "Q,[1]", 0 }, /* std d,[rs1+0] */
-{ "std", 0xc1b02000, 0x00480000, "Q,[1+i]", 0 },
-{ "std", 0xc1b02000, 0x00480000, "Q,[i+1]", 0 },
-{ "std", 0xc1b00000, 0x00482000, "Q,[1+2]", 0 },
-{ "stda", 0xc0b80000, 0x01402000, "d,[1+2]A", 0 },
-{ "stda", 0xc0b80000, 0x0140201f, "d,[1]A", 0 }, /* stda d,[rs1+%g0] */
-
-{ "sth", 0xc0300000, 0x01c8201f, "d,[1]", 0 }, /* sth d,[rs1+%g0] */
-{ "sth", 0xc0302000, 0x01c81fff, "d,[1]", 0 }, /* sth d,[rs1+0] */
-{ "sth", 0xc0300000, 0x01c82000, "d,[1+2]", 0 },
-{ "sth", 0xc0302000, 0x01c80000, "d,[1+i]", 0 },
-{ "sth", 0xc0302000, 0x01c80000, "d,[i+1]", 0 },
-{ "stha", 0xc0b00000, 0x0148201f, "d,[1]A", 0 }, /* stha d,[rs1+%g0] */
-{ "stha", 0xc0b00000, 0x01482000, "d,[1+2]A", 0 },
-
-{ "swap", 0xc0780000, 0x0180201f, "[1],d", 0 }, /* swap [rs1+%g0],d */
-{ "swap", 0xc0782000, 0x01801fff, "[1],d", 0 }, /* swap [rs1+0],d */
-{ "swap", 0xc0782000, 0x01800000, "[1+i],d", 0 },
-{ "swap", 0xc0782000, 0x01800000, "[i+1],d", 0 },
-{ "swap", 0xc0780000, 0x01802000, "[1+2],d", 0 },
-{ "swapa", 0xc0f80000, 0x01002000, "[1+2]A,d", 0 },
-{ "swapa", 0xc0f80000, 0x0100201f, "[1]A,d", 0 }, /* swapa [rs1+%g0],d */
-
-{ "restore", 0x81e80000, 0x7e17e01f, "", 0 }, /* restore %g0,%g0,%g0 */
-{ "restore", 0x81e82000, 0x7e14dfff, "", 0 }, /* restore %g0,0,%g0 */
-{ "restore", 0x81e82000, 0x00000000, "1,i,d", 0 },
-{ "restore", 0x81e80000, 0x00000000, "1,2,d", 0 },
-{ "rett", 0x81c82000, 0x40300000, "1+i", F_DELAYED },
-{ "rett", 0x81c82000, 0x40300000, "i+1", F_DELAYED },
-{ "rett", 0x81c80000, 0x40302000, "1+2", F_DELAYED },
-{ "rett", 0x81c82000, 0x40301fff, "1", F_DELAYED}, /* rett X,0 */
-{ "rett", 0x81c80000, 0x4030201f, "1", F_DELAYED}, /* rett X,%g0 */
-{ "save", 0x81e02000, 0x40180000, "1,i,d", 0 },
-{ "save", 0x81e00000, 0x40180000, "1,2,d", 0 },
-
-{ "ret", 0x81c7e008, 0x00001ff7, "", F_DELAYED }, /* jmpl %i7+8,%g0 */
-{ "retl", 0x81c3e008, 0x00001ff7, "", F_DELAYED }, /* jmpl %o7+8,%g0 */
-
-{ "jmpl", 0x81c00000, 0x4038201f, "1,d", F_DELAYED }, /* jmpl rs1+%g0,d */
-{ "jmpl", 0x81c02000, 0x4037c000, "i,d", F_DELAYED }, /* jmpl %g0+i,d */
-{ "jmpl", 0x81c02000, 0x40380000, "1+i,d", F_DELAYED },
-{ "jmpl", 0x81c02000, 0x40380000, "i+1,d", F_DELAYED },
-{ "jmpl", 0x81c00000, 0x40382000, "1+2,d", F_DELAYED },
-{ "wr", 0x81982000, 0x40600000, "1,i,t", 0 },
-{ "wr", 0x81980000, 0x40600000, "1,2,t", 0 },
-{ "wr", 0x81902000, 0x40680000, "1,i,w", 0 },
-{ "wr", 0x81900000, 0x40680000, "1,2,w", 0 },
-{ "wr", 0x81882000, 0x40700000, "1,i,p", 0 },
-{ "wr", 0x81880000, 0x40700000, "1,2,p", 0 },
-{ "wr", 0x81802000, 0x40780000, "1,i,y", 0 },
-{ "wr", 0x81800000, 0x40780000, "1,2,y", 0 },
-
-{ "rd", 0x81580000, 0x40a00000, "t,d", 0 },
-{ "rd", 0x81500000, 0x40a80000, "w,d", 0 },
-{ "rd", 0x81480000, 0x40b00000, "p,d", 0 },
-{ "rd", 0x81400000, 0x40b80000, "y,d", 0 },
-
-{ "sra", 0x81382000, 0x00000000, "1,i,d", 0 },
-{ "sra", 0x81380000, 0x00000000, "1,2,d", 0 },
-{ "srl", 0x81302000, 0x40c80000, "1,i,d", 0 },
-{ "srl", 0x81300000, 0x40c80000, "1,2,d", 0 },
-{ "sll", 0x81282000, 0x40d00000, "1,i,d", 0 },
-{ "sll", 0x81280000, 0x40d00000, "1,2,d", 0 },
-
-{ "mulscc", 0x81202000, 0x40d80000, "1,i,d", 0 },
-{ "mulscc", 0x81200000, 0x40d80000, "1,2,d", 0 },
-
-{ "clr", 0x80100000, 0x4e87e01f, "d", F_ALIAS }, /* or %g0,%g0,d */
-{ "clr", 0x80102000, 0x41efdfff, "d", F_ALIAS }, /* or %g0,0,d */
-{ "clr", 0xc0200000, 0x3fd8001f, "[1]", F_ALIAS }, /* st %g0,[rs1+%g0] */
-{ "clr", 0xc0202000, 0x3fd81fff, "[1]", F_ALIAS }, /* st %g0,[rs1+0] */
-{ "clr", 0xc0202000, 0x3fd80000, "[1+i]", F_ALIAS },
-{ "clr", 0xc0202000, 0x3fd80000, "[i+1]", F_ALIAS },
-{ "clr", 0xc0200000, 0x3fd80000, "[1+2]", F_ALIAS },
-
-{ "clrb", 0xc0280000, 0x3fd0001f, "[1]", F_ALIAS },/* stb %g0,[rs1+%g0] */
-{ "clrb", 0xc0282000, 0x3fd00000, "[1+i]", F_ALIAS },
-{ "clrb", 0xc0282000, 0x3fd00000, "[i+1]", F_ALIAS },
-{ "clrb", 0xc0280000, 0x3fd00000, "[1+2]", F_ALIAS },
-
-{ "clrh", 0xc0300000, 0x3fc8001f, "[1]", F_ALIAS },/* sth %g0,[rs1+%g0] */
-{ "clrh", 0xc0300000, 0x3fc80000, "[1+2]", F_ALIAS },
-{ "clrh", 0xc0302000, 0x3fc80000, "[1+i]", F_ALIAS },
-{ "clrh", 0xc0302000, 0x3fc80000, "[i+1]", F_ALIAS },
-
-{ "orncc", 0x80b02000, 0x04048000, "1,i,d", 0 },
-{ "orncc", 0x80b00000, 0x04048000, "1,2,d", 0 },
-
-{ "tst", 0x80900000, 0x7f6fe000, "2", 0 }, /* orcc %g0, rs2, %g0 */
-{ "tst", 0x80900000, 0x7f68201f, "1", 0 }, /* orcc rs1, %g0, %g0 */
-{ "tst", 0x80902000, 0x7f681fff, "1", 0 }, /* orcc rs1, 0, %g0 */
-
-{ "orcc", 0x80902000, 0x41680000, "1,i,d", 0 },
-{ "orcc", 0x80902000, 0x41680000, "i,1,d", 0 },
-{ "orcc", 0x80900000, 0x41680000, "1,2,d", 0 },
-{ "orn", 0x80302000, 0x41c80000, "1,i,d", 0 },
-{ "orn", 0x80300000, 0x41c80000, "1,2,d", 0 },
-
-{ "mov", 0x81800000, 0x4078201f, "1,y", F_ALIAS }, /* wr rs1,%g0,%y */
-{ "mov", 0x81802000, 0x40781fff, "1,y", F_ALIAS }, /* wr rs1,0,%y */
-{ "mov", 0x81802000, 0x40780000, "i,y", F_ALIAS },
-{ "mov", 0x81400000, 0x40b80000, "y,d", F_ALIAS }, /* rd %y,d */
-{ "mov", 0x81980000, 0x4060201f, "1,t", F_ALIAS }, /* wr rs1,%g0,%tbr */
-{ "mov", 0x81982000, 0x40601fff, "1,t", F_ALIAS }, /* wr rs1,0,%tbr */
-{ "mov", 0x81982000, 0x40600000, "i,t", F_ALIAS },
-{ "mov", 0x81580000, 0x40a00000, "t,d", F_ALIAS }, /* rd %tbr,d */
-{ "mov", 0x81900000, 0x4068201f, "1,w", F_ALIAS }, /* wr rs1,%g0,%wim */
-{ "mov", 0x81902000, 0x40681fff, "1,w", F_ALIAS }, /* wr rs1,0,%wim */
-{ "mov", 0x81902000, 0x40680000, "i,w", F_ALIAS },
-{ "mov", 0x81500000, 0x40a80000, "w,d", F_ALIAS }, /* rd %wim,d */
-{ "mov", 0x81880000, 0x4070201f, "1,p", F_ALIAS }, /* wr rs1,%g0,%psr */
-{ "mov", 0x81882000, 0x40701fff, "1,p", F_ALIAS }, /* wr rs1,0,%psr */
-{ "mov", 0x81882000, 0x40700000, "i,p", F_ALIAS },
-{ "mov", 0x81480000, 0x40b00000, "p,d", F_ALIAS }, /* rd %psr,d */
-
-{ "mov", 0x80102000, 0x41efc000, "i,d", 0 }, /* or %g0,i,d */
-{ "mov", 0x80100000, 0x41efe000, "2,d", 0 }, /* or %g0,rs2,d */
-{ "mov", 0x80102000, 0x41e81fff, "1,d", 0 }, /* or rs1,0,d */
-{ "mov", 0x80100000, 0x41e8201f, "1,d", 0 }, /* or rs1,%g0,d */
-
-{ "or", 0x80102000, 0x40800000, "1,i,d", 0 },
-{ "or", 0x80102000, 0x40800000, "i,1,d", 0 },
-{ "or", 0x80100000, 0x40800000, "1,2,d", 0 },
-
-{ "bset", 0x80102000, 0x40800000, "i,r", F_ALIAS },/* or rd,i,rd */
-{ "bset", 0x80100000, 0x40800000, "2,r", F_ALIAS },/* or rd,rs2,rd */
-
-{ "andncc", 0x80a82000, 0x41500000, "1,i,d", 0 },
-{ "andncc", 0x80a80000, 0x41500000, "1,2,d", 0 },
-{ "andn", 0x80282000, 0x41d00000, "1,i,d", 0 },
-{ "andn", 0x80280000, 0x41d00000, "1,2,d", 0 },
-
-{ "bclr", 0x80282000, 0x41d00000, "i,r", F_ALIAS },/* andn rd,i,rd */
-{ "bclr", 0x80280000, 0x41d00000, "2,r", F_ALIAS },/* andn rd,rs2,rd */
-
-{ "cmp", 0x80a02000, 0x7d580000, "1,i", 0 }, /* subcc rs1,i,%g0 */
-{ "cmp", 0x80a00000, 0x7d580000, "1,2", 0 }, /* subcc rs1,rs2,%g0 */
-
-{ "subcc", 0x80a02000, 0x41580000, "1,i,d", 0 },
-{ "subcc", 0x80a00000, 0x41580000, "1,2,d", 0 },
-{ "sub", 0x80202000, 0x41d80000, "1,i,d", 0 },
-{ "sub", 0x80200000, 0x41d80000, "1,2,d", 0 },
-{ "subx", 0x80602000, 0x41980000, "1,i,d", 0 },
-{ "subx", 0x80600000, 0x41980000, "1,2,d", 0 },
-{ "subxcc", 0x80e02000, 0x41180000, "1,i,d", 0 },
-{ "subxcc", 0x80e00000, 0x41180000, "1,2,d", 0 },
-
-{ "andcc", 0x80882000, 0x41700000, "1,i,d", 0 },
-{ "andcc", 0x80882000, 0x41700000, "i,1,d", 0 },
-{ "andcc", 0x80880000, 0x41700000, "1,2,d", 0 },
-{ "and", 0x80082000, 0x41f00000, "1,i,d", 0 },
-{ "and", 0x80082000, 0x41f00000, "i,1,d", 0 },
-{ "and", 0x80080000, 0x41f00000, "1,2,d", 0 },
-
-{ "inc", 0x80002001, 0x41f81ffe, "r", F_ALIAS }, /* add rs1,1,rsd */
-{ "inccc", 0x80802001, 0x41781ffe, "r", F_ALIAS }, /* addcc rd,1,rd */
-{ "dec", 0x80202001, 0x41d81ffe, "r", F_ALIAS }, /* sub rd,1,rd */
-{ "deccc", 0x80a02001, 0x41581ffe, "r", F_ALIAS }, /* subcc rd,1,rd */
-
-{ "btst", 0x80882000, 0x41700000, "i,1", F_ALIAS },/* andcc rs1,i,%g0 */
-{ "btst", 0x80880000, 0x41700000, "1,2", F_ALIAS },/* andcc rs1,rs2,%0 */
-
-{ "neg", 0x80200000, 0x41d80000, "r", F_ALIAS }, /* sub %0,rd,rd */
-{ "neg", 0x80200000, 0x41d80000, "2,d", F_ALIAS }, /* sub %0,rs2,rd */
-
-{ "addxcc", 0x80c02000, 0x41380000, "1,i,d", 0 },
-{ "addxcc", 0x80c02000, 0x41380000, "i,1,d", 0 },
-{ "addxcc", 0x80c00000, 0x41380000, "1,2,d", 0 },
-{ "addcc", 0x80802000, 0x41780000, "1,i,d", 0 },
-{ "addcc", 0x80802000, 0x41780000, "i,1,d", 0 },
-{ "addcc", 0x80800000, 0x41780000, "1,2,d", 0 },
-{ "addx", 0x80402000, 0x41b80000, "1,i,d", 0 },
-{ "addx", 0x80402000, 0x41b80000, "i,1,d", 0 },
-{ "addx", 0x80400000, 0x41b80000, "1,2,d", 0 },
-{ "add", 0x80002000, 0x41f80000, "1,i,d", 0 },
-{ "add", 0x80002000, 0x41f80000, "i,1,d", 0 },
-{ "add", 0x80000000, 0x41f80000, "1,2,d", 0 },
-
-{ "call", 0x9fc00000, 0x4038201f, "1", F_DELAYED }, /* jmpl rs1+%g0, %o7 */
-{ "call", 0x9fc00000, 0x4038201f, "1,#", F_DELAYED },
-{ "call", 0x40000000, 0x80000000, "L", F_DELAYED },
-{ "call", 0x40000000, 0x80000000, "L,#", F_DELAYED },
-
-{ "jmp", 0x81c00000, 0x7e38201f, "1", F_DELAYED }, /* jmpl rs1+%g0,%g0 */
-{ "jmp", 0x81c02000, 0x7e3fc000, "i", F_DELAYED }, /* jmpl %g0+i,%g0 */
-{ "jmp", 0x81c00000, 0x7e382000, "1+2", F_DELAYED }, /* jmpl rs1+rs2,%g0 */
-{ "jmp", 0x81c02000, 0x7e380000, "1+i", F_DELAYED }, /* jmpl rs1+i,%g0 */
-{ "jmp", 0x81c02000, 0x7e380000, "i+1", F_DELAYED }, /* jmpl i+rs1,%g0 */
-
-{ "nop", 0x01000000, 0xfeffffff, "", 0 }, /* sethi 0, %g0 */
-
-{ "set", 0x01000000, 0xc0c00000, "Sh,d", F_ALIAS },
-
-{ "sethi", 0x01000000, 0xc0c00000, "h,d", 0 },
-
-{ "taddcctv", 0x81102000, 0x40e00000, "1,i,d", 0 },
-{ "taddcctv", 0x81100000, 0x40e00000, "1,2,d", 0 },
-{ "taddcc", 0x81002000, 0x40f80000, "1,i,d", 0 },
-{ "taddcc", 0x81000000, 0x40f80000, "1,2,d", 0 },
-
-/* Conditional instructions.
-
- Because this part of the table was such a mess earlier, I have
- macrofied it so that all the branches and traps are generated from
- a single-line description of each condition value. */
-
-#define ANNUL 0x20000000
-#define IMMED 0x00002000
-#define RS1_G0 0x0007C000
-#define RS2_G0 0x0000001F
-
-/* Define two branches -- one annulled, one without */
-#define br(opcode, mask, lose, flags) \
- { opcode, mask+ANNUL, lose, ",al", flags }, \
- { opcode, mask , lose, "l", flags }
-
-/* Define four traps: reg+reg, reg + immediate, immediate alone, reg alone. */
-#define tr(opcode, mask, lose, flags) \
- {opcode, mask+IMMED, lose+RS1_G0 , "i", flags }, /* %g0 + imm */ \
- {opcode, mask+IMMED, lose , "1+i", flags }, /* rs1 + imm */ \
- {opcode, mask , lose+IMMED , "1+2", flags }, /* rs1 + rs2 */ \
- {opcode, mask , lose+IMMED+RS2_G0, "1", flags } /* rs1 + %g0 */
-
-/* Define both branches and traps based on condition mask */
-#ifdef __STDC__
-#define cond(bop, top, mask, flags) \
- br(#bop, 0x00800000+(mask << 25), 0xC1400000, F_DELAYED|flags), \
- tr(#top, 0x81d00000+(mask << 25), 0x40280000, flags)
-#else
-#define cond(bop, top, mask, flags) \
- br("bop", 0x00800000+(mask << 25), 0xC1400000, F_DELAYED|flags), \
- tr("top", 0x81d00000+(mask << 25), 0x40280000, flags)
-#endif
-
-/* Define all the conditions, all the branches, all the traps. */
-/* Use no extra spaces or tabs around the first two args, since cpp
- will include them in the printed strings. */
-cond (bvc,tvc, 0xF, 0),
-cond (bvs,tvs, 0x7, 0),
-cond (bpos,tpos, 0xE, 0),
-cond (bneg,tneg, 0x6, 0),
-cond (bcc,tcc, 0xD, 0),
-cond (bcs,tcs, 0x5, 0),
-cond (blu,tlu, 0x5, F_ALIAS), /* for cs */
-cond (bgeu,tgeu, 0xD, F_ALIAS), /* for cc */
-cond (bgu,tgu, 0xC, 0),
-cond (bleu,tleu, 0x4, 0),
-cond (bge,tge, 0xB, 0),
-cond (bl,tl, 0x3, 0),
-cond (bg,tg, 0xA, 0),
-cond (ble,tle, 0x2, 0),
-cond (be,te, 0x1, 0),
-cond (bz,tz, 0x1, F_ALIAS), /* for e */
-cond (bne,tne, 0x9, 0),
-cond (bnz,tnz, 0x9, F_ALIAS), /* for ne */
-cond (b,t, 0x8, 0),
-cond (ba,ta, 0x8, F_ALIAS), /* for nothing */
-cond (bn,tn, 0x0, 0),
-
-#undef cond
-#undef br
-#undef tr
-
-{ "tsubcc", 0x81080000, 0x40f00000, "1,2,d", 0 },
-{ "tsubcc", 0x81082000, 0x40f00000, "1,i,d", 0 },
-{ "tsubcctv", 0x80580000, 0x40a00000, "1,2,d", 0 },
-{ "tsubcctv", 0x80582000, 0x40a00000, "1,i,d", 0 },
-
-{ "unimp", 0x00000000, 0xFFFFFFFF, "l", 0 },
-
-{ "iflush", 0x81d80000, 0x40202000, "1+2", 0 },
-{ "iflush", 0x81d82000, 0x40200000, "1+i", 0 },
-
-{ "xnorcc", 0x80b80000, 0x41400000, "1,2,d", 0 },
-{ "xnorcc", 0x80b82000, 0x41400000, "1,i,d", 0 },
-{ "xnorcc", 0x80b82000, 0x41400000, "i,1,d", 0 },
-{ "xorcc", 0x80980000, 0x41600000, "1,2,d", 0 },
-{ "xorcc", 0x80982000, 0x41600000, "1,i,d", 0 },
-{ "xorcc", 0x80982000, 0x41600000, "i,1,d", 0 },
-{ "xnor", 0x80380000, 0x41c00000, "1,2,d", 0 },
-{ "xnor", 0x80382000, 0x41c00000, "1,i,d", 0 },
-{ "xnor", 0x80382000, 0x41c00000, "i,1,d", 0 },
-{ "xor", 0x80180000, 0x41e00000, "1,2,d", 0 },
-{ "xor", 0x80182000, 0x41e00000, "1,i,d", 0 },
-{ "xor", 0x80182000, 0x41e00000, "i,1,d", 0 },
-
-{ "not", 0x80380000, 0x41c00000, "r", F_ALIAS }, /* xnor rd,%0,rd */
-{ "not", 0x80380000, 0x41c00000, "1,d", F_ALIAS }, /* xnor rs1,%0,rd */
-
-{ "btog", 0x80180000, 0x41e02000, "2,r", F_ALIAS }, /* xor rd,rs2,rd */
-{ "btog", 0x80182000, 0x41e00000, "i,r", F_ALIAS }, /* xor rd,i,rd */
-
-{ "fpop1", 0x81a00000, 0x40580000, "[1+2],d", 0 },
-{ "fpop2", 0x81a80000, 0x40500000, "[1+2],d", 0 },
-
-/* Someday somebody should give these the same treatment as the branches
- above. FIXME someday. */
-
-{ "fb", 0x31800000, 0xc0400000, ",al", F_DELAYED },
-{ "fb", 0x11800000, 0xc0400000, "l", F_DELAYED },
-{ "fba", 0x31800000, 0xc0400000, ",al", F_DELAYED|F_ALIAS },
-{ "fba", 0x11800000, 0xc0400000, "l", F_DELAYED|F_ALIAS },
-{ "fbn", 0x21800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbn", 0x01800000, 0xc0400000, "l", F_DELAYED },
-{ "fbu", 0x2f800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbu", 0x0f800000, 0xc0400000, "l", F_DELAYED },
-{ "fbg", 0x2d800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbg", 0x0d800000, 0xc0400000, "l", F_DELAYED },
-{ "fbug", 0x2b800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbug", 0x0b800000, 0xc0400000, "l", F_DELAYED },
-{ "fbl", 0x29800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbl", 0x09800000, 0xc0400000, "l", F_DELAYED },
-{ "fbul", 0x27800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbul", 0x07800000, 0xc0400000, "l", F_DELAYED },
-{ "fblg", 0x25800000, 0xc0400000, ",al", F_DELAYED },
-{ "fblg", 0x05800000, 0xc0400000, "l", F_DELAYED },
-{ "fbne", 0x23800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbne", 0x03800000, 0xc0400000, "l", F_DELAYED },
-{ "fbe", 0x33800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbe", 0x13800000, 0xc0400000, "l", F_DELAYED },
-{ "fbue", 0x35800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbue", 0x15800000, 0xc0400000, "l", F_DELAYED },
-{ "fbge", 0x37800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbge", 0x17800000, 0xc0400000, "l", F_DELAYED },
-{ "fbuge", 0x39800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbuge", 0x19800000, 0xc0400000, "l", F_DELAYED },
-{ "fble", 0x3b800000, 0xc0400000, ",al", F_DELAYED },
-{ "fble", 0x1b800000, 0xc0400000, "l", F_DELAYED },
-{ "fbule", 0x3d800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbule", 0x1d800000, 0xc0400000, "l", F_DELAYED },
-{ "fbo", 0x3f800000, 0xc0400000, ",al", F_DELAYED },
-{ "fbo", 0x1f800000, 0xc0400000, "l", F_DELAYED },
-
-{ "cba", 0x31c00000, 0xce000000, ",al", F_DELAYED },
-{ "cba", 0x11c00000, 0xce000000, "l", F_DELAYED },
-{ "cbn", 0x21c00000, 0xde000000, ",al", F_DELAYED },
-{ "cbn", 0x01c00000, 0xde000000, "l", F_DELAYED },
-{ "cb3", 0x2fc00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb3", 0x0fc00000, 0xc0000000, "l", F_DELAYED },
-{ "cb2", 0x2dc00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb2", 0x0dc00000, 0xc0000000, "l", F_DELAYED },
-{ "cb23", 0x2bc00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb23", 0x0bc00000, 0xc0000000, "l", F_DELAYED },
-{ "cb1", 0x29c00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb1", 0x09c00000, 0xc0000000, "l", F_DELAYED },
-{ "cb13", 0x27c00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb13", 0x07c00000, 0xc0000000, "l", F_DELAYED },
-{ "cb12", 0x25c00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb12", 0x05c00000, 0xc0000000, "l", F_DELAYED },
-{ "cb123", 0x23c00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb123", 0x03c00000, 0xc0000000, "l", F_DELAYED },
-{ "cb0", 0x33c00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb0", 0x13c00000, 0xc0000000, "l", F_DELAYED },
-{ "cb03", 0x35c00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb03", 0x15c00000, 0xc0000000, "l", F_DELAYED },
-{ "cb02", 0x37c00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb02", 0x17c00000, 0xc0000000, "l", F_DELAYED },
-{ "cb023", 0x39c00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb023", 0x19c00000, 0xc0000000, "l", F_DELAYED },
-{ "cb01", 0x3bc00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb01", 0x1bc00000, 0xc0000000, "l", F_DELAYED },
-{ "cb013", 0x3dc00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb013", 0x1dc00000, 0xc0000000, "l", F_DELAYED },
-{ "cb012", 0x3fc00000, 0xc0000000, ",al", F_DELAYED },
-{ "cb012", 0x1fc00000, 0xc0000000, "l", F_DELAYED },
-
-{ "fstoi", 0x81a01a20, 0x400025c0, "f,g", 0 },
-{ "fdtoi", 0x81a01a40, 0x400025a0, "f,g", 0 },
-{ "fxtoi", 0x81a01a60, 0x40002580, "f,g", 0 },
-
-{ "fitox", 0x81a01980, 0x40002660, "f,g", 0 },
-{ "fitod", 0x81a01900, 0x400026e0, "f,g", 0 },
-{ "fitos", 0x81a01880, 0x40002660, "f,g", 0 },
-
-{ "fstod", 0x81a01920, 0x400026c0, "f,g", 0 },
-{ "fstox", 0x81a019a0, 0x40002640, "f,g", 0 },
-{ "fdtos", 0x81a018c0, 0x40002720, "f,g", 0 },
-{ "fdtox", 0x81a019c0, 0x40002620, "f,g", 0 },
-{ "fxtos", 0x81a018e0, 0x40002700, "f,g", 0 },
-{ "fxtod", 0x81a01960, 0x40002680, "f,g", 0 },
-
-{ "fdivx", 0x81a009e0, 0x40083600, "e,f,g", 0 },
-{ "fdivd", 0x81a009c0, 0x40003620, "e,f,g", 0 },
-{ "fdivs", 0x81a009a0, 0x40003640, "e,f,g", 0 },
-
-{ "fmuls", 0x81a00920, 0x400036c0, "e,f,g", 0 },
-{ "fmuld", 0x81a00940, 0x400036a0, "e,f,g", 0 },
-{ "fmulx", 0x81a00960, 0x40003680, "e,f,g", 0 },
-
-{ "fsqrts", 0x81a00520, 0x40003ac0, "f,g", 0 },
-{ "fsqrtd", 0x81a00540, 0x40003aa8, "f,g", 0 },
-{ "fsqrtx", 0x81a00560, 0x40003a80, "f,g", 0 },
-
-{ "fabss", 0x81a00120, 0x40003ec0, "f,g", 0 },
-{ "fnegs", 0x81a000a0, 0x40003f40, "f,g", 0 },
-{ "fmovs", 0x81a00020, 0x40003fc0, "f,g", 0 },
-
-{ "fsubx", 0x81a008e0, 0x40003700, "e,f,g", 0 },
-{ "fsubd", 0x81a008c0, 0x40003720, "e,f,g", 0 },
-{ "fsubs", 0x81a008a0, 0x40003740, "e,f,g", 0 },
-
-{ "faddx", 0x81a00860, 0x40003780, "e,f,g", 0 },
-{ "faddd", 0x81a00840, 0x400037a0, "e,f,g", 0 },
-{ "fadds", 0x81a00820, 0x400037c0, "e,f,g", 0 },
-
-{ "fcmpex", 0x81a80ae0, 0x40003500, "e,f", 0 },
-{ "fcmped", 0x81a80ac0, 0x40003520, "e,f", 0 },
-{ "fcmpes", 0x81a80aa0, 0x40003540, "e,f", 0 },
-{ "fcmpx", 0x81a80a60, 0x40003580, "e,f", 0 },
-{ "fcmpd", 0x81a80a40, 0x400035a0, "e,f", 0 },
-{ "fcmps", 0x81a80a20, 0x400035c0, "e,f", 0 },
-
-{ "cpop1", 0x81b00000, 0x40480000, "[1+2],d", 0 },
-{ "cpop2", 0x81b80000, 0x40400000, "[1+2],d", 0 },
-};
-
-#define NUMOPCODES ((sizeof sparc_opcodes)/(sizeof sparc_opcodes[0]))
-
diff --git a/gdb/sparc-pinsn.c b/gdb/sparc-pinsn.c
deleted file mode 100644
index 2a63772..0000000
--- a/gdb/sparc-pinsn.c
+++ /dev/null
@@ -1,465 +0,0 @@
-/* Disassembler for the sparc.
- Copyright (C) 1989 Free Software Foundation, Inc.
-
-This file is part of GDB, the GNU disassembler.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "sparc-opcode.h"
-#include "gdbcore.h"
-#include "string.h"
-#include "target.h"
-
-extern void qsort ();
-
-
-extern char *reg_names[];
-#define freg_names (&reg_names[4 * 8])
-
-union sparc_insn
- {
- unsigned long int code;
- struct
- {
- unsigned int OP:2;
-#define op ldst.OP
- unsigned int RD:5;
-#define rd ldst.RD
- unsigned int op3:6;
- unsigned int RS1:5;
-#define rs1 ldst.RS1
- unsigned int i:1;
- unsigned int ASI:8;
-#define asi ldst.ASI
- unsigned int RS2:5;
-#define rs2 ldst.RS2
-#define shcnt rs2
- } ldst;
- struct
- {
- unsigned int OP:2, RD:5, op3:6, RS1:5, i:1;
- unsigned int IMM13:13;
-#define imm13 IMM13.IMM13
- } IMM13;
- struct
- {
- unsigned int OP:2;
- unsigned int a:1;
- unsigned int cond:4;
- unsigned int op2:3;
- unsigned int DISP22:22;
-#define disp22 branch.DISP22
- } branch;
-#define imm22 disp22
- struct
- {
- unsigned int OP:2;
- unsigned int DISP30:30;
-#define disp30 call.DISP30
- } call;
- };
-
-/* Nonzero if INSN is the opcode for a delayed branch. */
-static int
-is_delayed_branch (insn)
- union sparc_insn insn;
-{
- unsigned int i;
-
- for (i = 0; i < NUMOPCODES; ++i)
- {
- const struct sparc_opcode *opcode = &sparc_opcodes[i];
- if ((opcode->match & insn.code) == opcode->match
- && (opcode->lose & insn.code) == 0)
- return (opcode->flags & F_DELAYED);
- }
- return 0;
-}
-
-static int opcodes_sorted = 0;
-
-/* Print one instruction from MEMADDR on STREAM. */
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- union sparc_insn insn;
-
- register unsigned int i;
-
- if (!opcodes_sorted)
- {
- static int compare_opcodes ();
- qsort ((char *) sparc_opcodes, NUMOPCODES,
- sizeof (sparc_opcodes[0]), compare_opcodes);
- opcodes_sorted = 1;
- }
-
- read_memory (memaddr, &insn, sizeof (insn));
-
- for (i = 0; i < NUMOPCODES; ++i)
- {
- const struct sparc_opcode *opcode = &sparc_opcodes[i];
- if ((opcode->match & insn.code) == opcode->match
- && (opcode->lose & insn.code) == 0)
- {
- /* Nonzero means that we have found an instruction which has
- the effect of adding or or'ing the imm13 field to rs1. */
- int imm_added_to_rs1 = 0;
-
- /* Nonzero means that we have found a plus sign in the args
- field of the opcode table. */
- int found_plus = 0;
-
- /* Do we have an 'or' instruction where rs1 is the same
- as rsd, and which has the i bit set? */
- if (opcode->match == 0x80102000
- && insn.rs1 == insn.rd)
- imm_added_to_rs1 = 1;
-
- if (insn.rs1 != insn.rd
- && strchr (opcode->args, 'r') != 0)
- /* Can't do simple format if source and dest are different. */
- continue;
-
- fputs_filtered (opcode->name, stream);
-
- {
- register const char *s;
-
- if (opcode->args[0] != ',')
- fputs_filtered (" ", stream);
- for (s = opcode->args; *s != '\0'; ++s)
- {
- if (*s == ',')
- {
- fputs_filtered (",", stream);
- ++s;
- if (*s == 'a')
- {
- fputs_filtered ("a", stream);
- ++s;
- }
- fputs_filtered (" ", stream);
- }
-
- switch (*s)
- {
- case '+':
- found_plus = 1;
-
- /* note fall-through */
- default:
- fprintf_filtered (stream, "%c", *s);
- break;
-
- case '#':
- fputs_filtered ("0", stream);
- break;
-
-#define reg(n) fprintf_filtered (stream, "%%%s", reg_names[n])
- case '1':
- case 'r':
- reg (insn.rs1);
- break;
-
- case '2':
- reg (insn.rs2);
- break;
-
- case 'd':
- reg (insn.rd);
- break;
-#undef reg
-
-#define freg(n) fprintf_filtered (stream, "%%%s", freg_names[n])
- case 'e':
- freg (insn.rs1);
- break;
-
- case 'f':
- freg (insn.rs2);
- break;
-
- case 'g':
- freg (insn.rd);
- break;
-#undef freg
-
-#define creg(n) fprintf_filtered (stream, "%%c%u", (unsigned int) (n))
- case 'b':
- creg (insn.rs1);
- break;
-
- case 'c':
- creg (insn.rs2);
- break;
-
- case 'D':
- creg (insn.rd);
- break;
-#undef creg
-
- case 'h':
- fprintf_filtered (stream, "%%hi(%#x)",
- (int) insn.imm22 << 10);
- break;
-
- case 'i':
- {
- /* We cannot trust the compiler to sign-extend
- when extracting the bitfield, hence the shifts. */
- int imm = ((int) insn.imm13 << 19) >> 19;
-
- /* Check to see whether we have a 1+i, and take
- note of that fact.
-
- Note: because of the way we sort the table,
- we will be matching 1+i rather than i+1,
- so it is OK to assume that i is after +,
- not before it. */
- if (found_plus)
- imm_added_to_rs1 = 1;
-
- if (imm <= 9)
- fprintf_filtered (stream, "%d", imm);
- else
- fprintf_filtered (stream, "%#x", imm);
- }
- break;
-
- case 'L':
- print_address ((CORE_ADDR) memaddr + insn.disp30 * 4,
- stream);
- break;
-
- case 'l':
- if ((insn.code >> 22) == 0)
- /* Special case for `unimp'. Don't try to turn
- it's operand into a function offset. */
- fprintf_filtered (stream, "%#x",
- (int) (((int) insn.disp22 << 10) >> 10));
- else
- /* We cannot trust the compiler to sign-extend
- when extracting the bitfield, hence the shifts. */
- print_address ((CORE_ADDR)
- (memaddr
- + (((int) insn.disp22 << 10) >> 10) * 4),
- stream);
- break;
-
- case 'A':
- fprintf_filtered (stream, "(%d)", (int) insn.asi);
- break;
-
- case 'C':
- fputs_filtered ("%csr", stream);
- break;
-
- case 'F':
- fputs_filtered ("%fsr", stream);
- break;
-
- case 'p':
- fputs_filtered ("%psr", stream);
- break;
-
- case 'q':
- fputs_filtered ("%fq", stream);
- break;
-
- case 'Q':
- fputs_filtered ("%cq", stream);
- break;
-
- case 't':
- fputs_filtered ("%tbr", stream);
- break;
-
- case 'w':
- fputs_filtered ("%wim", stream);
- break;
-
- case 'y':
- fputs_filtered ("%y", stream);
- break;
- }
- }
- }
-
- /* If we are adding or or'ing something to rs1, then
- check to see whether the previous instruction was
- a sethi to the same register as in the sethi.
- If so, attempt to print the result of the add or
- or (in this context add and or do the same thing)
- and its symbolic value. */
- if (imm_added_to_rs1)
- {
- union sparc_insn prev_insn;
- int errcode;
-
- errcode = target_read_memory (memaddr - 4,
- (char *)&prev_insn, sizeof (prev_insn));
-
- if (errcode == 0)
- {
- /* If it is a delayed branch, we need to look at the
- instruction before the delayed branch. This handles
- sequences such as
-
- sethi %o1, %hi(_foo), %o1
- call _printf
- or %o1, %lo(_foo), %o1
- */
-
- if (is_delayed_branch (prev_insn))
- errcode = target_read_memory
- (memaddr - 8, (char *)&prev_insn, sizeof (prev_insn));
- }
-
- /* If there was a problem reading memory, then assume
- the previous instruction was not sethi. */
- if (errcode == 0)
- {
- /* Is it sethi to the same register? */
- if ((prev_insn.code & 0xc1c00000) == 0x01000000
- && prev_insn.rd == insn.rs1)
- {
- fprintf_filtered (stream, "\t! ");
- /* We cannot trust the compiler to sign-extend
- when extracting the bitfield, hence the shifts. */
- print_address (((int) prev_insn.imm22 << 10)
- | (insn.imm13 << 19) >> 19, stream);
- }
- }
- }
-
- return sizeof (insn);
- }
- }
-
- printf_filtered ("%#8x", insn.code);
- return sizeof (insn);
-}
-
-
-/* Compare opcodes A and B. */
-
-static int
-compare_opcodes (a, b)
- char *a, *b;
-{
- struct sparc_opcode *op0 = (struct sparc_opcode *) a;
- struct sparc_opcode *op1 = (struct sparc_opcode *) b;
- unsigned long int match0 = op0->match, match1 = op1->match;
- unsigned long int lose0 = op0->lose, lose1 = op1->lose;
- register unsigned int i;
-
- /* If a bit is set in both match and lose, there is something
- wrong with the opcode table. */
- if (match0 & lose0)
- {
- fprintf (stderr, "Internal error: bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n",
- op0->name, match0, lose0);
- op0->lose &= ~op0->match;
- lose0 = op0->lose;
- }
-
- if (match1 & lose1)
- {
- fprintf (stderr, "Internal error: bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n",
- op1->name, match1, lose1);
- op1->lose &= ~op1->match;
- lose1 = op1->lose;
- }
-
- /* Because the bits that are variable in one opcode are constant in
- another, it is important to order the opcodes in the right order. */
- for (i = 0; i < 32; ++i)
- {
- unsigned long int x = 1 << i;
- int x0 = (match0 & x) != 0;
- int x1 = (match1 & x) != 0;
-
- if (x0 != x1)
- return x1 - x0;
- }
-
- for (i = 0; i < 32; ++i)
- {
- unsigned long int x = 1 << i;
- int x0 = (lose0 & x) != 0;
- int x1 = (lose1 & x) != 0;
-
- if (x0 != x1)
- return x1 - x0;
- }
-
- /* They are functionally equal. So as long as the opcode table is
- valid, we can put whichever one first we want, on aesthetic grounds. */
-
- /* Our first aesthetic ground is that aliases defer to real insns. */
- {
- int alias_diff = (op0->flags & F_ALIAS) - (op1->flags & F_ALIAS);
- if (alias_diff != 0)
- /* Put the one that isn't an alias first. */
- return alias_diff;
- }
-
- /* Except for the above aliases, two "identical" instructions had
- better have the same opcode. This is a sanity check on the table. */
- if (0 != strcmp (op0->name, op1->name))
- fprintf (stderr, "Internal error: bad sparc-opcode.h: \"%s\" == \"%s\"\n",
- op0->name, op1->name);
-
- /* Fewer arguments are preferred. */
- {
- int length_diff = strlen (op0->args) - strlen (op1->args);
- if (length_diff != 0)
- /* Put the one with fewer arguments first. */
- return length_diff;
- }
-
- /* Put 1+i before i+1. */
- {
- char *p0 = (char *) strchr(op0->args, '+');
- char *p1 = (char *) strchr(op1->args, '+');
-
- if (p0 && p1)
- {
- /* There is a plus in both operands. Note that a plus
- sign cannot be the first character in args,
- so the following [-1]'s are valid. */
- if (p0[-1] == 'i' && p1[1] == 'i')
- /* op0 is i+1 and op1 is 1+i, so op1 goes first. */
- return 1;
- if (p0[1] == 'i' && p1[-1] == 'i')
- /* op0 is 1+i and op1 is i+1, so op0 goes first. */
- return -1;
- }
- }
-
- /* They are, as far as we can tell, identical.
- Since qsort may have rearranged the table partially, there is
- no way to tell which one was first in the opcode table as
- written, so just say there are equal. */
- return 0;
-}
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
deleted file mode 100644
index 12ad9c5..0000000
--- a/gdb/sparc-tdep.c
+++ /dev/null
@@ -1,644 +0,0 @@
-/* Machine-dependent code which would otherwise be in inflow.c and core.c,
- for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
- This code is for the sparc cpu.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "obstack.h"
-#include "signame.h"
-#include "target.h"
-#include "ieee-float.h"
-
-#include <sys/ptrace.h>
-
-#include "gdbcore.h"
-
-/* From infrun.c */
-extern int stop_after_trap;
-
-typedef enum
-{
- Error, not_branch, bicc, bicca, ba, baa, ticc, ta,
-} branch_type;
-
-/* Simulate single-step ptrace call for sun4. Code written by Gary
- Beihl (beihl@mcc.com). */
-
-/* npc4 and next_pc describe the situation at the time that the
- step-breakpoint was set, not necessary the current value of NPC_REGNUM. */
-static CORE_ADDR next_pc, npc4, target;
-static int brknpc4, brktrg;
-typedef char binsn_quantum[BREAKPOINT_MAX];
-static binsn_quantum break_mem[3];
-
-/* Non-zero if we just simulated a single-step ptrace call. This is
- needed because we cannot remove the breakpoints in the inferior
- process until after the `wait' in `wait_for_inferior'. Used for
- sun4. */
-
-int one_stepped;
-
-/* single_step() is called just before we want to resume the inferior,
- if we want to single-step it but there is no hardware or kernel single-step
- support (as on all SPARCs). We find all the possible targets of the
- coming instruction and breakpoint them.
-
- single_step is also called just after the inferior stops. If we had
- set up a simulated single-step, we undo our damage. */
-
-void
-single_step ()
-{
- branch_type br, isannulled();
- CORE_ADDR pc;
- long pc_instruction;
-
- if (!one_stepped)
- {
- /* Always set breakpoint for NPC. */
- next_pc = read_register (NPC_REGNUM);
- npc4 = next_pc + 4; /* branch not taken */
-
- target_insert_breakpoint (next_pc, break_mem[0]);
- /* printf ("set break at %x\n",next_pc); */
-
- pc = read_register (PC_REGNUM);
- pc_instruction = read_memory_integer (pc, sizeof(pc_instruction));
- br = isannulled (pc_instruction, pc, &target);
- brknpc4 = brktrg = 0;
-
- if (br == bicca)
- {
- /* Conditional annulled branch will either end up at
- npc (if taken) or at npc+4 (if not taken).
- Trap npc+4. */
- brknpc4 = 1;
- target_insert_breakpoint (npc4, break_mem[1]);
- }
- else if (br == baa && target != next_pc)
- {
- /* Unconditional annulled branch will always end up at
- the target. */
- brktrg = 1;
- target_insert_breakpoint (target, break_mem[2]);
- }
-
- /* We are ready to let it go */
- one_stepped = 1;
- return;
- }
- else
- {
- /* Remove breakpoints */
- target_remove_breakpoint (next_pc, break_mem[0]);
-
- if (brknpc4)
- target_remove_breakpoint (npc4, break_mem[1]);
-
- if (brktrg)
- target_remove_breakpoint (target, break_mem[2]);
-
- one_stepped = 0;
- }
-}
-
-CORE_ADDR
-sparc_frame_chain (thisframe)
- FRAME thisframe;
-{
- CORE_ADDR retval;
- int err;
- err = target_read_memory
- ((CORE_ADDR)&(((struct rwindow *)(thisframe->frame))->rw_in[6]),
- &retval,
- sizeof (CORE_ADDR));
- if (err)
- return 0;
- return retval;
-}
-
-CORE_ADDR
-sparc_extract_struct_value_address (regbuf)
- char regbuf[REGISTER_BYTES];
-{
- CORE_ADDR retval;
- read_memory (((int *)(regbuf))[SP_REGNUM]+(16*4),
- &retval,
- sizeof (CORE_ADDR));
- return retval;
-}
-
-/*
- * Find the pc saved in frame FRAME.
- */
-CORE_ADDR
-frame_saved_pc (frame)
- FRAME frame;
-{
- CORE_ADDR prev_pc;
-
- /* If it's at the bottom, the return value's stored in i7/rp */
- if (get_current_frame () == frame)
- read_memory ((CORE_ADDR)&((struct rwindow *)
- (read_register (SP_REGNUM)))->rw_in[7],
- &prev_pc, sizeof (CORE_ADDR));
- else
- /* Wouldn't this always work? */
- read_memory ((CORE_ADDR)&((struct rwindow *)(frame->bottom))->rw_in[7],
- &prev_pc,
- sizeof (CORE_ADDR));
-
- return PC_ADJUST (prev_pc);
-}
-
-/*
- * Since an individual frame in the frame cache is defined by two
- * arguments (a frame pointer and a stack pointer), we need two
- * arguments to get info for an arbitrary stack frame. This routine
- * takes two arguments and makes the cached frames look as if these
- * two arguments defined a frame on the cache. This allows the rest
- * of info frame to extract the important arguments without
- * difficulty.
- */
-FRAME
-setup_arbitrary_frame (frame, stack)
- FRAME_ADDR frame, stack;
-{
- FRAME fid = create_new_frame (frame, 0);
-
- if (!fid)
- fatal ("internal: create_new_frame returned invalid frame id");
-
- fid->bottom = stack;
- fid->pc = FRAME_SAVED_PC (fid);
- return fid;
-}
-
-/* This code was written by Gary Beihl (beihl@mcc.com).
- It was modified by Michael Tiemann (tiemann@corto.inria.fr). */
-
-/*
- * This routine appears to be passed a size by which to increase the
- * stack. It then executes a save instruction in the inferior to
- * increase the stack by this amount. Only the register window system
- * should be affected by this; the program counter & etc. will not be.
- *
- * This instructions used for this purpose are:
- *
- * sethi %hi(0x0),g1 *
- * add g1,0x1ee0,g1 *
- * save sp,g1,sp
- * sethi %hi(0x0),g1 *
- * add g1,0x1ee0,g1 *
- * t g0,0x1,o0
- * sethi %hi(0x0),g0 (nop)
- *
- * I presume that these set g1 to be the negative of the size, do a
- * save (putting the stack pointer at sp - size) and restore the
- * original contents of g1. A * indicates that the actual value of
- * the instruction is modified below.
- */
-static int save_insn_opcodes[] = {
- 0x03000000, 0x82007ee0, 0x9de38001, 0x03000000,
- 0x82007ee0, 0x91d02001, 0x01000000 };
-
-/* Neither do_save_insn or do_restore_insn save stack configuration
- (current_frame, etc),
- since the stack is in an indeterminate state through the call to
- each of them. That responsibility of the routine which calls them. */
-
-static void
-do_save_insn (size)
- int size;
-{
- int g1 = read_register (G1_REGNUM);
- CORE_ADDR sp = read_register (SP_REGNUM);
- CORE_ADDR pc = read_register (PC_REGNUM);
- CORE_ADDR npc = read_register (NPC_REGNUM);
- CORE_ADDR fake_pc = sp - sizeof (save_insn_opcodes);
- struct inferior_status inf_status;
-
- save_inferior_status (&inf_status, 0); /* Don't restore stack info */
- /*
- * See above.
- */
- save_insn_opcodes[0] = 0x03000000 | ((-size >> 10) & 0x3fffff);
- save_insn_opcodes[1] = 0x82006000 | (-size & 0x3ff);
- save_insn_opcodes[3] = 0x03000000 | ((g1 >> 10) & 0x3fffff);
- save_insn_opcodes[4] = 0x82006000 | (g1 & 0x3ff);
- write_memory (fake_pc, (char *)save_insn_opcodes, sizeof (save_insn_opcodes));
-
- clear_proceed_status ();
- stop_after_trap = 1;
- proceed (fake_pc, 0, 0);
-
- write_register (PC_REGNUM, pc);
- write_register (NPC_REGNUM, npc);
- restore_inferior_status (&inf_status);
-}
-
-/*
- * This routine takes a program counter value. It restores the
- * register window system to the frame above the current one.
- * THIS ROUTINE CLOBBERS PC AND NPC IN THE TARGET!
- */
-
-/* The following insns translate to:
-
- restore %g0,%g0,%g0
- t %g0,1
- sethi %hi(0),%g0 */
-
-static int restore_insn_opcodes[] = { 0x81e80000, 0x91d02001, 0x01000000 };
-
-static void
-do_restore_insn ()
-{
- CORE_ADDR sp = read_register (SP_REGNUM);
- CORE_ADDR fake_pc = sp - sizeof (restore_insn_opcodes);
- struct inferior_status inf_status;
-
- save_inferior_status (&inf_status, 0); /* Don't restore stack info */
-
- write_memory (fake_pc, (char *)restore_insn_opcodes,
- sizeof (restore_insn_opcodes));
-
- clear_proceed_status ();
- stop_after_trap = 1;
- proceed (fake_pc, 0, 0);
-
- restore_inferior_status (&inf_status);
-}
-
-/* Given a pc value, skip it forward past the function prologue by
- disassembling instructions that appear to be a prologue.
-
- If FRAMELESS_P is set, we are only testing to see if the function
- is frameless. This allows a quicker answer.
-
- This routine should be more specific in its actions; making sure
- that it uses the same register in the initial prologue section. */
-CORE_ADDR
-skip_prologue (start_pc, frameless_p)
- CORE_ADDR start_pc;
- int frameless_p;
-{
- union
- {
- unsigned long int code;
- struct
- {
- unsigned int op:2;
- unsigned int rd:5;
- unsigned int op2:3;
- unsigned int imm22:22;
- } sethi;
- struct
- {
- unsigned int op:2;
- unsigned int rd:5;
- unsigned int op3:6;
- unsigned int rs1:5;
- unsigned int i:1;
- unsigned int simm13:13;
- } add;
- int i;
- } x;
- int dest = -1;
- CORE_ADDR pc = start_pc;
-
- x.i = read_memory_integer (pc, 4);
-
- /* Recognize the `sethi' insn and record its destination. */
- if (x.sethi.op == 0 && x.sethi.op2 == 4)
- {
- dest = x.sethi.rd;
- pc += 4;
- x.i = read_memory_integer (pc, 4);
- }
-
- /* Recognize an add immediate value to register to either %g1 or
- the destination register recorded above. Actually, this might
- well recognize several different arithmetic operations.
- It doesn't check that rs1 == rd because in theory "sub %g0, 5, %g1"
- followed by "save %sp, %g1, %sp" is a valid prologue (Not that
- I imagine any compiler really does that, however). */
- if (x.add.op == 2 && x.add.i && (x.add.rd == 1 || x.add.rd == dest))
- {
- pc += 4;
- x.i = read_memory_integer (pc, 4);
- }
-
- /* This recognizes any SAVE insn. But why do the XOR and then
- the compare? That's identical to comparing against 60 (as long
- as there isn't any sign extension). */
- if (x.add.op == 2 && (x.add.op3 ^ 32) == 28)
- {
- pc += 4;
- if (frameless_p) /* If the save is all we care about, */
- return pc; /* return before doing more work */
- x.i = read_memory_integer (pc, 4);
- }
- else
- {
- /* Without a save instruction, it's not a prologue. */
- return start_pc;
- }
-
- /* Now we need to recognize stores into the frame from the input
- registers. This recognizes all non alternate stores of input
- register, into a location offset from the frame pointer. */
- while (x.add.op == 3
- && (x.add.op3 & 0x3c) == 4 /* Store, non-alternate. */
- && (x.add.rd & 0x18) == 0x18 /* Input register. */
- && x.add.i /* Immediate mode. */
- && x.add.rs1 == 30 /* Off of frame pointer. */
- /* Into reserved stack space. */
- && x.add.simm13 >= 0x44
- && x.add.simm13 < 0x5b)
- {
- pc += 4;
- x.i = read_memory_integer (pc, 4);
- }
- return pc;
-}
-
-/* Check instruction at ADDR to see if it is an annulled branch.
- All other instructions will go to NPC or will trap.
- Set *TARGET if we find a canidate branch; set to zero if not. */
-
-branch_type
-isannulled (instruction, addr, target)
- long instruction;
- CORE_ADDR addr, *target;
-{
- branch_type val = not_branch;
- long int offset; /* Must be signed for sign-extend. */
- union
- {
- unsigned long int code;
- struct
- {
- unsigned int op:2;
- unsigned int a:1;
- unsigned int cond:4;
- unsigned int op2:3;
- unsigned int disp22:22;
- } b;
- } insn;
-
- *target = 0;
- insn.code = instruction;
-
- if (insn.b.op == 0
- && (insn.b.op2 == 2 || insn.b.op2 == 6 || insn.b.op2 == 7))
- {
- if (insn.b.cond == 8)
- val = insn.b.a ? baa : ba;
- else
- val = insn.b.a ? bicca : bicc;
- offset = 4 * ((int) (insn.b.disp22 << 10) >> 10);
- *target = addr + offset;
- }
-
- return val;
-}
-
-/* sparc_frame_find_saved_regs ()
-
- Stores, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame.
-
- Note that on register window machines, we are currently making the
- assumption that window registers are being saved somewhere in the
- frame in which they are being used. If they are stored in an
- inferior frame, find_saved_register will break.
-
- On the Sun 4, the only time all registers are saved is when
- a dummy frame is involved. Otherwise, the only saved registers
- are the LOCAL and IN registers which are saved as a result
- of the "save/restore" opcodes. This condition is determined
- by address rather than by value.
-
- The "pc" is not stored in a frame on the SPARC. (What is stored
- is a return address minus 8.) sparc_pop_frame knows how to
- deal with that. Other routines might or might not.
-
- See tm-sparc.h (PUSH_FRAME and friends) for CRITICAL information
- about how this works. */
-
-void
-sparc_frame_find_saved_regs (fi, saved_regs_addr)
- struct frame_info *fi;
- struct frame_saved_regs *saved_regs_addr;
-{
- register int regnum;
- FRAME_ADDR frame = read_register (FP_REGNUM);
- FRAME fid = FRAME_INFO_ID (fi);
-
- if (!fid)
- fatal ("Bad frame info struct in FRAME_FIND_SAVED_REGS");
-
- bzero (saved_regs_addr, sizeof (*saved_regs_addr));
-
- /* Old test.
- if (fi->pc >= frame - CALL_DUMMY_LENGTH - 0x140
- && fi->pc <= frame) */
-
- if (fi->pc >= (fi->bottom ? fi->bottom :
- read_register (SP_REGNUM))
- && fi->pc <= FRAME_FP(fi))
- {
- /* Dummy frame. All but the window regs are in there somewhere. */
- for (regnum = G1_REGNUM; regnum < G1_REGNUM+7; regnum++)
- saved_regs_addr->regs[regnum] =
- frame + (regnum - G0_REGNUM) * 4 - 0xa0;
- for (regnum = I0_REGNUM; regnum < I0_REGNUM+8; regnum++)
- saved_regs_addr->regs[regnum] =
- frame + (regnum - I0_REGNUM) * 4 - 0xc0;
- for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 32; regnum++)
- saved_regs_addr->regs[regnum] =
- frame + (regnum - FP0_REGNUM) * 4 - 0x80;
- for (regnum = Y_REGNUM; regnum < NUM_REGS; regnum++)
- saved_regs_addr->regs[regnum] =
- frame + (regnum - Y_REGNUM) * 4 - 0xe0;
- frame = fi->bottom ?
- fi->bottom : read_register (SP_REGNUM);
- }
- else
- {
- /* Normal frame. Just Local and In registers */
- frame = fi->bottom ?
- fi->bottom : read_register (SP_REGNUM);
- for (regnum = L0_REGNUM; regnum < L0_REGNUM+16; regnum++)
- saved_regs_addr->regs[regnum] = frame + (regnum-L0_REGNUM) * 4;
- }
- if (fi->next)
- {
- /* Pull off either the next frame pointer or the stack pointer */
- FRAME_ADDR next_next_frame =
- (fi->next->bottom ?
- fi->next->bottom :
- read_register (SP_REGNUM));
- for (regnum = O0_REGNUM; regnum < O0_REGNUM+8; regnum++)
- saved_regs_addr->regs[regnum] = next_next_frame + regnum * 4;
- }
- /* Otherwise, whatever we would get from ptrace(GETREGS) is accurate */
- saved_regs_addr->regs[SP_REGNUM] = FRAME_FP (fi);
-}
-
-/* Push an empty stack frame, and record in it the current PC, regs, etc.
-
- Note that the write's are of registers in the context of the newly
- pushed frame. Thus the the fp*'s, the g*'s, the i*'s, and
- the randoms, of the new frame, are being saved. The locals and outs
- are new; they don't need to be saved. The i's and l's of
- the last frame were saved by the do_save_insn in the register
- file (now on the stack, since a context switch happended imm after).
-
- The return pointer register %i7 does not have
- the pc saved into it (return from this frame will be accomplished
- by a POP_FRAME). In fact, we must leave it unclobbered, since we
- must preserve it in the calling routine except across call instructions. */
-
-/* Definitely see tm-sparc.h for more doc of the frame format here. */
-
-void
-sparc_push_dummy_frame ()
-{
- CORE_ADDR fp;
- char register_temp[REGISTER_BYTES];
-
- do_save_insn (0x140); /* FIXME where does this value come from? */
- fp = read_register (FP_REGNUM);
-
- read_register_bytes (REGISTER_BYTE (FP0_REGNUM), register_temp, 32 * 4);
- write_memory (fp - 0x80, register_temp, 32 * 4);
-
- read_register_bytes (REGISTER_BYTE (G0_REGNUM), register_temp, 8 * 4);
- write_memory (fp - 0xa0, register_temp, 8 * 4);
-
- read_register_bytes (REGISTER_BYTE (I0_REGNUM), register_temp, 8 * 4);
- write_memory (fp - 0xc0, register_temp, 8 * 4);
-
- /* Y, PS, WIM, TBR, PC, NPC, FPS, CPS regs */
- read_register_bytes (REGISTER_BYTE (Y_REGNUM), register_temp, 8 * 4);
- write_memory (fp - 0xe0, register_temp, 8 * 4);
-}
-
-/* Discard from the stack the innermost frame, restoring all saved registers.
-
- Note that the values stored in fsr by get_frame_saved_regs are *in
- the context of the called frame*. What this means is that the i
- regs of fsr must be restored into the o regs of the (calling) frame that
- we pop into. We don't care about the output regs of the calling frame,
- since unless it's a dummy frame, it won't have any output regs in it.
-
- We never have to bother with %l (local) regs, since the called routine's
- locals get tossed, and the calling routine's locals are already saved
- on its stack. */
-
-/* Definitely see tm-sparc.h for more doc of the frame format here. */
-
-void
-sparc_pop_frame ()
-{
- register FRAME frame = get_current_frame ();
- register CORE_ADDR pc;
- struct frame_saved_regs fsr;
- struct frame_info *fi;
- char raw_buffer[REGISTER_BYTES];
-
- fi = get_frame_info (frame);
- get_frame_saved_regs (fi, &fsr);
- do_restore_insn ();
- if (fsr.regs[FP0_REGNUM])
- {
- read_memory (fsr.regs[FP0_REGNUM], raw_buffer, 32 * 4);
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM), raw_buffer, 32 * 4);
- }
- if (fsr.regs[G1_REGNUM])
- {
- read_memory (fsr.regs[G1_REGNUM], raw_buffer, 7 * 4);
- write_register_bytes (REGISTER_BYTE (G1_REGNUM), raw_buffer, 7 * 4);
- }
- if (fsr.regs[I0_REGNUM])
- {
- read_memory (fsr.regs[I0_REGNUM], raw_buffer, 8 * 4);
- write_register_bytes (REGISTER_BYTE (O0_REGNUM), raw_buffer, 8 * 4);
- }
- if (fsr.regs[PS_REGNUM])
- write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4));
- if (fsr.regs[Y_REGNUM])
- write_register (Y_REGNUM, read_memory_integer (fsr.regs[Y_REGNUM], 4));
- if (fsr.regs[PC_REGNUM])
- {
- /* Explicitly specified PC (and maybe NPC) -- just restore them. */
- write_register (PC_REGNUM, read_memory_integer (fsr.regs[PC_REGNUM], 4));
- if (fsr.regs[NPC_REGNUM])
- write_register (NPC_REGNUM,
- read_memory_integer (fsr.regs[NPC_REGNUM], 4));
- }
- else if (fsr.regs[I7_REGNUM])
- {
- /* Return address in %i7 -- adjust it, then restore PC and NPC from it */
- pc = PC_ADJUST (read_memory_integer (fsr.regs[I7_REGNUM], 4));
- write_register (PC_REGNUM, pc);
- write_register (NPC_REGNUM, pc + 4);
- }
- flush_cached_frames ();
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
-}
-
-/* On the Sun 4 under SunOS, the compile will leave a fake insn which
- encodes the structure size being returned. If we detect such
- a fake insn, step past it. */
-
-CORE_ADDR
-sparc_pc_adjust(pc)
- CORE_ADDR pc;
-{
- long insn;
- int err;
-
- err = target_read_memory (pc + 8, (char *)&insn, sizeof(long));
- SWAP_TARGET_AND_HOST (&insn, sizeof(long));
- if ((err == 0) && (insn & 0xfffffe00) == 0)
- return pc+12;
- else
- return pc+8;
-}
-
-
-/* Structure of SPARC extended floating point numbers.
- This information is not currently used by GDB, since no current SPARC
- implementations support extended float. */
-
-const struct ext_format ext_format_sparc[] = {
-/* tot sbyte smask expbyte manbyte */
- { 16, 0, 0x80, 0,1, 4,8 }, /* sparc */
-};
diff --git a/gdb/sparc-xdep.c b/gdb/sparc-xdep.c
deleted file mode 100644
index b09dbe8..0000000
--- a/gdb/sparc-xdep.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/* Machine-dependent code which would otherwise be in inflow.c and core.c,
- for GDB, the GNU debugger, for SPARC host systems.
-
- Copyright (C) 1986, 1987, 1989, 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "tm-sparc.h"
-#include "param-no-tm.h"
-#include "inferior.h"
-#include "target.h"
-
-#include <sys/param.h>
-#include <sys/file.h> /* For L_SET */
-
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-
-#include "gdbcore.h"
-#include <sys/core.h>
-
-extern char register_valid[];
-
-/* We don't store all registers immediately when requested, since they
- get sent over in large chunks anyway. Instead, we accumulate most
- of the changes and send them over once. "deferred_stores" keeps
- track of which sets of registers we have locally-changed copies of,
- so we only need send the groups that have changed. */
-
-#define INT_REGS 1
-#define STACK_REGS 2
-#define FP_REGS 4
-
-int deferred_stores = 0; /* Cumulates stores we want to do eventually. */
-
-/* Fetch one or more registers from the inferior. REGNO == -1 to get
- them all. We actually fetch more than requested, when convenient,
- marking them as valid so we won't fetch them again. */
-void
-fetch_inferior_registers (regno)
- int regno;
-{
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- int i;
-
- /* We should never be called with deferred stores, because a prerequisite
- for writing regs is to have fetched them all (PREPARE_TO_STORE), sigh. */
- if (deferred_stores) abort();
-
- DO_DEFERRED_STORES;
-
- /* Global and Out regs are fetched directly, as well as the control
- registers. If we're getting one of the in or local regs,
- and the stack pointer has not yet been fetched,
- we have to do that first, since they're found in memory relative
- to the stack pointer. */
- if (regno < O7_REGNUM /* including -1 */
- || regno >= Y_REGNUM
- || (!register_valid[SP_REGNUM] && regno < I7_REGNUM))
- {
- if (0 != ptrace (PTRACE_GETREGS, inferior_pid, &inferior_registers))
- perror("ptrace_getregs");
-
- registers[REGISTER_BYTE (0)] = 0;
- bcopy (&inferior_registers.r_g1, &registers[REGISTER_BYTE (1)], 15 * REGISTER_RAW_SIZE (G0_REGNUM));
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
- *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
- *(int *)&registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
-
- for (i = G0_REGNUM; i <= O7_REGNUM; i++)
- register_valid[i] = 1;
- register_valid[Y_REGNUM] = 1;
- register_valid[PS_REGNUM] = 1;
- register_valid[PC_REGNUM] = 1;
- register_valid[NPC_REGNUM] = 1;
- /* If we don't set these valid, read_register_bytes() rereads
- all the regs every time it is called! FIXME. */
- register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */
- register_valid[TBR_REGNUM] = 1; /* Not true yet, FIXME */
- register_valid[FPS_REGNUM] = 1; /* Not true yet, FIXME */
- register_valid[CPS_REGNUM] = 1; /* Not true yet, FIXME */
- }
-
- /* Floating point registers */
- if (regno == -1 || (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31))
- {
- if (0 != ptrace (PTRACE_GETFPREGS, inferior_pid, &inferior_fp_registers))
- perror("ptrace_getfpregs");
- bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.fpu_fr);
- /* bcopy (&inferior_fp_registers.Fpu_fsr,
- &registers[REGISTER_BYTE (FPS_REGNUM)],
- sizeof (FPU_FSR_TYPE)); FIXME??? -- gnu@cyg */
- for (i = FP0_REGNUM; i <= FP0_REGNUM+31; i++)
- register_valid[i] = 1;
- register_valid[FPS_REGNUM] = 1;
- }
-
- /* These regs are saved on the stack by the kernel. Only read them
- all (16 ptrace calls!) if we really need them. */
- if (regno == -1)
- {
- target_xfer_memory (*(CORE_ADDR*)&registers[REGISTER_BYTE (SP_REGNUM)],
- &registers[REGISTER_BYTE (L0_REGNUM)],
- 16*REGISTER_RAW_SIZE (L0_REGNUM), 0);
- for (i = L0_REGNUM; i <= I7_REGNUM; i++)
- register_valid[i] = 1;
- }
- else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
- {
- CORE_ADDR sp = *(CORE_ADDR*)&registers[REGISTER_BYTE (SP_REGNUM)];
- i = REGISTER_BYTE (regno);
- if (register_valid[regno])
- printf("register %d valid and read\n", regno);
- target_xfer_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
- &registers[i], REGISTER_RAW_SIZE (regno), 0);
- register_valid[regno] = 1;
- }
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-int
-store_inferior_registers (regno)
- int regno;
-{
- struct regs inferior_registers;
- struct fp_status inferior_fp_registers;
- int wanna_store = INT_REGS + STACK_REGS + FP_REGS;
-
- /* First decide which pieces of machine-state we need to modify.
- Default for regno == -1 case is all pieces. */
- if (regno >= 0)
- if (FP0_REGNUM <= regno && regno < FP0_REGNUM + 32)
- {
- wanna_store = FP_REGS;
- }
- else
- {
- if (regno == SP_REGNUM)
- wanna_store = INT_REGS + STACK_REGS;
- else if (regno < L0_REGNUM || regno > I7_REGNUM)
- wanna_store = INT_REGS;
- else
- wanna_store = STACK_REGS;
- }
-
- /* See if we're forcing the stores to happen now, or deferring. */
- if (regno == -2)
- {
- wanna_store = deferred_stores;
- deferred_stores = 0;
- }
- else
- {
- if (wanna_store == STACK_REGS)
- {
- /* Fall through and just store one stack reg. If we deferred
- it, we'd have to store them all, or remember more info. */
- }
- else
- {
- deferred_stores |= wanna_store;
- return 0;
- }
- }
-
- if (wanna_store & STACK_REGS)
- {
- CORE_ADDR sp = *(CORE_ADDR *)&registers[REGISTER_BYTE (SP_REGNUM)];
-
- if (regno < 0 || regno == SP_REGNUM)
- {
- if (!register_valid[L0_REGNUM+5]) abort();
- target_xfer_memory (sp,
- &registers[REGISTER_BYTE (L0_REGNUM)],
- 16*REGISTER_RAW_SIZE (L0_REGNUM), 1);
- }
- else
- {
- if (!register_valid[regno]) abort();
- target_xfer_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM),
- &registers[REGISTER_BYTE (regno)],
- REGISTER_RAW_SIZE (regno), 1);
- }
-
- }
-
- if (wanna_store & INT_REGS)
- {
- if (!register_valid[G1_REGNUM]) abort();
-
- bcopy (&registers[REGISTER_BYTE (G1_REGNUM)],
- &inferior_registers.r_g1, 15 * REGISTER_RAW_SIZE (G1_REGNUM));
-
- inferior_registers.r_ps =
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_registers.r_pc =
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
- inferior_registers.r_npc =
- *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)];
- inferior_registers.r_y =
- *(int *)&registers[REGISTER_BYTE (Y_REGNUM)];
-
- if (0 != ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers))
- perror("ptrace_setregs");
- }
-
- if (wanna_store & FP_REGS)
- {
- if (!register_valid[FP0_REGNUM+9]) abort();
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],
- &inferior_fp_registers,
- sizeof inferior_fp_registers.fpu_fr);
-
-/* bcopy (&registers[REGISTER_BYTE (FPS_REGNUM)],
- &inferior_fp_registers.Fpu_fsr,
- sizeof (FPU_FSR_TYPE));
-****/
- if (0 !=
- ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers))
- perror("ptrace_setfpregs");
- }
- return 0;
-}
-
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
- char *core_reg_sect;
- unsigned core_reg_size;
- int which;
-{
-
- if (which == 0) {
-
- /* Integer registers */
-
-#define gregs ((struct regs *)core_reg_sect)
- /* G0 *always* holds 0. */
- *(int *)&registers[REGISTER_BYTE (0)] = 0;
-
- /* The globals and output registers. */
- bcopy (&gregs->r_g1,
- &registers[REGISTER_BYTE (G1_REGNUM)],
- 15 * REGISTER_RAW_SIZE (G1_REGNUM));
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
- *(int *)&registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
- *(int *)&registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
-
- /* My best guess at where to get the locals and input
- registers is exactly where they usually are, right above
- the stack pointer. If the core dump was caused by a bus error
- from blowing away the stack pointer (as is possible) then this
- won't work, but it's worth the try. */
- {
- int sp;
-
- sp = *(int *)&registers[REGISTER_BYTE (SP_REGNUM)];
- if (0 != target_read_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
- 16 * REGISTER_RAW_SIZE (L0_REGNUM)))
- {
- /* fprintf so user can still use gdb */
- fprintf (stderr,
- "Couldn't read input and local registers from core file\n");
- }
- }
- } else if (which == 2) {
-
- /* Floating point registers */
-
-#define fpuregs ((struct fpu *) core_reg_sect)
- if (core_reg_size >= sizeof (struct fpu))
- {
- bcopy (fpuregs->fpu_regs,
- &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof (fpuregs->fpu_regs));
- bcopy (&fpuregs->fpu_fsr,
- &registers[REGISTER_BYTE (FPS_REGNUM)],
- sizeof (FPU_FSR_TYPE));
- }
- else
- fprintf (stderr, "Couldn't read float regs from core file\n");
- }
-}
diff --git a/gdb/stab.def b/gdb/stab.def
deleted file mode 100755
index 58364e1..0000000
--- a/gdb/stab.def
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Table of DBX symbol codes for the GNU system.
- Copyright (C) 1988 Free Software Foundation, Inc.
-
- 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Global variable. Only the name is significant.
- To find the address, look in the corresponding external symbol. */
-__define_stab (N_GSYM, 0x20, "GSYM")
-
-/* Function name for BSD Fortran. Only the name is significant.
- To find the address, look in the corresponding external symbol. */
-__define_stab (N_FNAME, 0x22, "FNAME")
-
-/* Function name or text-segment variable for C. Value is its address.
- Desc is supposedly starting line number, but GCC doesn't set it
- and DBX seems not to miss it. */
-__define_stab (N_FUN, 0x24, "FUN")
-
-/* Data-segment variable with internal linkage. Value is its address. */
-__define_stab (N_STSYM, 0x26, "STSYM")
-
-/* BSS-segment variable with internal linkage. Value is its address. */
-__define_stab (N_LCSYM, 0x28, "LCSYM")
-
-/* Name of main routine. Only the name is significant.
- This is not used in C. */
-__define_stab (N_MAIN, 0x2a, "MAIN")
-
-/* Register variable. Value is number of register. */
-__define_stab (N_RSYM, 0x40, "RSYM")
-
-/* Structure or union element. Value is offset in the structure. */
-__define_stab (N_SSYM, 0x60, "SSYM")
-
-/* Parameter variable. Value is offset from argument pointer.
- (On most machines the argument pointer is the same as the frame pointer. */
-__define_stab (N_PSYM, 0xa0, "PSYM")
-
-/* Automatic variable in the stack. Value is offset from frame pointer.
- Also used for type descriptions. */
-__define_stab (N_LSYM, 0x80, "LSYM")
-
-/* Alternate entry point. Value is its address. */
-__define_stab (N_ENTRY, 0xa4, "ENTRY")
-
-/* Name of main source file.
- Value is starting text address of the compilation. */
-__define_stab (N_SO, 0x64, "SO")
-
-/* Name of sub-source file.
- Value is starting text address of the compilation. */
-__define_stab (N_SOL, 0x84, "SOL")
-
-/* Line number in text segment. Desc is the line number;
- value is corresponding address. */
-__define_stab (N_SLINE, 0x44, "SLINE")
-/* Similar, for data segment. */
-__define_stab (N_DSLINE, 0x66, "DSLINE")
-/* Similar, for bss segment. */
-__define_stab (N_BSLINE, 0x68, "BSLINE")
-
-/* Beginning of an include file. Only Sun uses this.
- In an object file, only the name is significant.
- The Sun linker puts data into some of the other fields. */
-__define_stab (N_BINCL, 0x82, "BINCL")
-/* End of an include file. No name.
- These two act as brackets around the file's output.
- In an object file, there is no significant data in this entry.
- The Sun linker puts data into some of the fields. */
-__define_stab (N_EINCL, 0xa2, "EINCL")
-/* Place holder for deleted include file.
- This appears only in output from the Sun linker. */
-__define_stab (N_EXCL, 0xc2, "EXCL")
-
-/* Beginning of lexical block.
- The desc is the nesting level in lexical blocks.
- The value is the address of the start of the text for the block.
- The variables declared inside the block *precede* the N_LBRAC symbol. */
-__define_stab (N_LBRAC, 0xc0, "LBRAC")
-/* End of a lexical block. Desc matches the N_LBRAC's desc.
- The value is the address of the end of the text for the block. */
-__define_stab (N_RBRAC, 0xe0, "RBRAC")
-
-/* Begin named common block. Only the name is significant. */
-__define_stab (N_BCOMM, 0xe2, "BCOMM")
-/* Begin named common block. Only the name is significant
- (and it should match the N_BCOMM). */
-__define_stab (N_ECOMM, 0xe4, "ECOMM")
-/* End common (local name): value is address.
- I'm not sure how this is used. */
-__define_stab (N_ECOML, 0xe8, "ECOML")
-/* Second symbol entry containing a length-value for the preceding entry.
- The value is the length. */
-__define_stab (N_LENG, 0xfe, "LENG")
-
-/* Global symbol in Pascal.
- Supposedly the value is its line number; I'm skeptical. */
-__define_stab (N_PC, 0x30, "PC")
-
-/* Modula-2 compilation unit. Can someone say what info it contains? */
-__define_stab (N_M2C, 0x42, "M2C")
-/* Modula-2 scope information. Can someone say what info it contains? */
-__define_stab (N_SCOPE, 0xc4, "SCOPE")
-
-/* Sun's source-code browser stabs. ?? Don't know what the fields are.
- Supposedly the field is "path to associated .cb file". */
-__define_stab (N_BROWS, 0x48, "BROWS")
-
-/* GNU C++ exception stabs. */
-
-/* GNU C++ exception variable. Name is variable name. */
-__define_stab (N_EHDECL, 0x50, "EHDECL")
-
-/* GNU C++ `catch' clause. Value is its address. Desc is nonzero if
- this entry is immediately followed by a CAUGHT stab saying what exception
- was caught. Multiple CAUGHT stabs means that multiple exceptions
- can be caught here. If Desc is 0, it means all exceptions are caught
- here. */
-__define_stab (N_CATCH, 0x54, "CATCH")
-
-/* These STAB's are used on Gould systems for Non-Base register symbols
- or something like that. FIXME. I have assigned the values at random
- since I don't have a Gould here. Fixups from Gould folk welcome... */
-__define_stab (N_NBTEXT, 0xF0, "NBTEXT")
-__define_stab (N_NBDATA, 0xF2, "NBDATA")
-__define_stab (N_NBBSS, 0xF4, "NBBSS")
-__define_stab (N_NBSTS, 0xF6, "NBSTS")
-__define_stab (N_NBLCS, 0xF8, "NBLCS")
-__define_stab (N_NSYMS, 0xFA, "NSYMS")
-
-/* The above information, in matrix format.
-
- STAB MATRIX
- _________________________________________________
- | 00 - 1F are not dbx stab symbols |
- | Entries with bits 01 set are external symbols |
- | N_UNDEF | N_ABS | N_TEXT | N_DATA |
- | N_BSS | N_COMM | | N_FN |
- |_______________________________________________|
- | 20 GSYM | 22 FNAME | 24 FUN | 26 STSYM |
- | 28 LCSYM | 2A MAIN | 2C | 2E |
- | 30 PC | 32 | 34 | 36 |
- | 38 | 3A | 3C | 3E |
- | 40 RSYM | 42 M2C | 44 SLINE | 46 |
- | 48 BROWS | 4A | 4C | 4E |
- | 50 EHDECL | 52 | 54 CATCH | 56 |
- | 58 | 5A | 5C | 5E |
- | 60 SSYM | 62 | 64 SO | 66 DSLINE |
- | 68 BSLINE | 6A | 6C | 6E |
- | 70 | 72 | 74 | 76 |
- | 78 | 7A | 7C | 7E |
- | 80 LSYM | 82 BINCL | 84 SOL | 86 |
- | 88 | 8A | 8C | 8E |
- | 90 | 92 | 94 | 96 |
- | 98 | 9A | 9C | 9E |
- | A0 PSYM | A2 EINCL | A4 ENTRY | A6 |
- | A8 | AA | AC | AE |
- | B0 | B2 | B4 | B6 |
- | B8 | BA | BC | BE |
- | C0 LBRAC | C2 EXCL | C4 SCOPE | C6 |
- | C8 | CA | CC | CE |
- | D0 | D2 | D4 | D6 |
- | D8 | DA | DC | DE |
- | E0 RBRAC | E2 BCOMM | E4 ECOMM | E6 |
- | E8 ECOML | EA | EC | EE |
- | F0 | F2 | F4 | F6 |
- | F8 | FA | FC | FE LENG |
- +-----------------------------------------------+
-
-*/
diff --git a/gdb/stack.c b/gdb/stack.c
deleted file mode 100644
index 6153650..0000000
--- a/gdb/stack.c
+++ /dev/null
@@ -1,1178 +0,0 @@
-/* Print and select stack frames for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "language.h"
-#include "symtab.h"
-#include "frame.h"
-#include "gdbcmd.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "breakpoint.h"
-
-extern int addressprint; /* Print addresses, or stay symbolic only? */
-extern int info_verbose; /* Verbosity of symbol reading msgs */
-extern int lines_to_list; /* # of lines "list" command shows by default */
-extern char *reg_names[]; /* Names of registers */
-
-/* Thie "selected" stack frame is used by default for local and arg access.
- May be zero, for no selected frame. */
-
-FRAME selected_frame;
-
-/* Level of the selected frame:
- 0 for innermost, 1 for its caller, ...
- or -1 for frame specified by address with no defined level. */
-
-int selected_frame_level;
-
-/* Nonzero means print the full filename and linenumber
- when a frame is printed, and do so in a format programs can parse. */
-
-int frame_file_full_name = 0;
-
-void print_frame_info ();
-
-/* Print a stack frame briefly. FRAME should be the frame id
- and LEVEL should be its level in the stack (or -1 for level not defined).
- This prints the level, the function executing, the arguments,
- and the file name and line number.
- If the pc is not at the beginning of the source line,
- the actual pc is printed at the beginning.
-
- If SOURCE is 1, print the source line as well.
- If SOURCE is -1, print ONLY the source line. */
-
-void
-print_stack_frame (frame, level, source)
- FRAME frame;
- int level;
- int source;
-{
- struct frame_info *fi;
-
- fi = get_frame_info (frame);
-
- print_frame_info (fi, level, source, 1);
-}
-
-void
-print_frame_info (fi, level, source, args)
- struct frame_info *fi;
- register int level;
- int source;
- int args;
-{
- struct symtab_and_line sal;
- struct symbol *func;
- register char *funname = 0;
- int numargs;
-
-#if 0 /* Symbol reading is fast enough now */
- struct partial_symtab *pst;
-
- /* Don't give very much information if we haven't readin the
- symbol table yet. */
- pst = find_pc_psymtab (fi->pc);
- if (pst && !pst->readin)
- {
- /* Abbreviated information. */
- char *fname;
-
- if (!find_pc_partial_function (fi->pc, &fname, 0))
- fname = "??";
-
- printf_filtered ("#%-2d ", level);
- if (addressprint)
- printf_filtered ("%s in ", local_hex_string(fi->pc));
-
- fputs_demangled (fname, stdout, -1);
- fputs_filtered (" (...)\n", stdout);
-
- return;
- }
-#endif
-
- sal = find_pc_line (fi->pc, fi->next_frame);
- func = find_pc_function (fi->pc);
- if (func)
- {
- /* In certain pathological cases, the symtabs give the wrong
- function (when we are in the first function in a file which
- is compiled without debugging symbols, the previous function
- is compiled with debugging symbols, and the "foo.o" symbol
- that is supposed to tell us where the file with debugging symbols
- ends has been truncated by ar because it is longer than 15
- characters).
-
- So look in the misc_function_vector as well, and if it comes
- up with a larger address for the function use that instead.
- I don't think this can ever cause any problems;
- there shouldn't be any
- misc_function_vector symbols in the middle of a function. */
- int misc_index = find_pc_misc_function (fi->pc);
- if (misc_index >= 0
- && (misc_function_vector[misc_index].address
- > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
- {
- /* In this case we have no way of knowing the source file
- and line number, so don't print them. */
- sal.symtab = 0;
- /* We also don't know anything about the function besides
- its address and name. */
- func = 0;
- funname = misc_function_vector[misc_index].name;
- }
- else
- funname = SYMBOL_NAME (func);
- }
- else
- {
- register int misc_index = find_pc_misc_function (fi->pc);
- if (misc_index >= 0)
- funname = misc_function_vector[misc_index].name;
- }
-
- if (source >= 0 || !sal.symtab)
- {
- if (level >= 0)
- printf_filtered ("#%-2d ", level);
- if (addressprint)
- if (fi->pc != sal.pc || !sal.symtab)
- printf_filtered ("%s in ", local_hex_string(fi->pc));
- fputs_demangled (funname ? funname : "??", stdout, -1);
- wrap_here (" ");
- fputs_filtered (" (", stdout);
- if (args)
- {
- FRAME_NUM_ARGS (numargs, fi);
- print_frame_args (func, fi, numargs, stdout);
- }
- printf_filtered (")");
- if (sal.symtab && sal.symtab->filename)
- {
- wrap_here (" ");
- printf_filtered (" at %s:%d", sal.symtab->filename, sal.line);
- }
- printf_filtered ("\n");
- }
-
- if ((source != 0) && sal.symtab)
- {
- int done = 0;
- int mid_statement = source < 0 && fi->pc != sal.pc;
- if (frame_file_full_name)
- done = identify_source_line (sal.symtab, sal.line, mid_statement);
- if (!done)
- {
- if (addressprint && mid_statement)
- printf_filtered ("%s\t", local_hex_string(fi->pc));
- print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
- }
- current_source_line = max (sal.line - lines_to_list/2, 1);
- }
- if (source != 0)
- set_default_breakpoint (1, fi->pc, sal.symtab, sal.line);
-
- fflush (stdout);
-}
-
-void flush_cached_frames ();
-
-#ifdef FRAME_SPECIFICATION_DYADIC
-extern FRAME setup_arbitrary_frame ();
-#endif
-
-/*
- * Read a frame specification in whatever the appropriate format is.
- * Call error() if the specification is in any way invalid (i.e.
- * this function never returns NULL).
- */
-static FRAME
-parse_frame_specification (frame_exp)
- char *frame_exp;
-{
- int numargs = 0;
- int arg1, arg2;
-
- if (frame_exp)
- {
- char *addr_string, *p;
- struct cleanup *tmp_cleanup;
-
- while (*frame_exp == ' ') frame_exp++;
- for (p = frame_exp; *p && *p != ' '; p++)
- ;
-
- if (*frame_exp)
- {
- numargs = 1;
- addr_string = savestring(frame_exp, p - frame_exp);
-
- {
- tmp_cleanup = make_cleanup (free, addr_string);
- arg1 = parse_and_eval_address (addr_string);
- do_cleanups (tmp_cleanup);
- }
-
- while (*p == ' ') p++;
-
- if (*p)
- {
- numargs = 2;
- arg2 = parse_and_eval_address (p);
- }
- }
- }
-
- switch (numargs)
- {
- case 0:
- if (selected_frame == NULL)
- error ("No selected frame.");
- return selected_frame;
- /* NOTREACHED */
- case 1:
- {
- int level = arg1;
- FRAME fid = find_relative_frame (get_current_frame (), &level);
- FRAME tfid;
-
- if (level == 0)
- /* find_relative_frame was successful */
- return fid;
-
- /* If (s)he specifies the frame with an address, he deserves what
- (s)he gets. Still, give the highest one that matches. */
-
- for (fid = get_current_frame ();
- fid && FRAME_FP (fid) != arg1;
- fid = get_prev_frame (fid))
- ;
-
- if (fid)
- while ((tfid = get_prev_frame (fid)) &&
- (FRAME_FP (tfid) == arg1))
- fid = tfid;
-
-#ifdef FRAME_SPECIFICATION_DYADIC
- if (!fid)
- error ("Incorrect number of args in frame specification");
-
- return fid;
-#else
- return create_new_frame (arg1, 0);
-#endif
- }
- /* NOTREACHED */
- case 2:
- /* Must be addresses */
-#ifndef FRAME_SPECIFICATION_DYADIC
- error ("Incorrect number of args in frame specification");
-#else
- return setup_arbitrary_frame (arg1, arg2);
-#endif
- /* NOTREACHED */
- }
- fatal ("Internal: Error in parsing in parse_frame_specification");
- /* NOTREACHED */
-}
-
-/* FRAME_ARGS_ADDRESS_CORRECT is just like FRAME_ARGS_ADDRESS except
- that if it is unsure about the answer, it returns 0
- instead of guessing (this happens on the VAX and i960, for example).
-
- On most machines, we never have to guess about the args address,
- so FRAME_ARGS_ADDRESS{,_CORRECT} are the same. */
-#if !defined (FRAME_ARGS_ADDRESS_CORRECT)
-#define FRAME_ARGS_ADDRESS_CORRECT FRAME_ARGS_ADDRESS
-#endif
-
-/* Print verbosely the selected frame or the frame at address ADDR.
- This means absolutely all information in the frame is printed. */
-
-static void
-frame_info (addr_exp)
- char *addr_exp;
-{
- FRAME frame;
- struct frame_info *fi;
- struct frame_saved_regs fsr;
- struct symtab_and_line sal;
- struct symbol *func;
- struct symtab *s;
- FRAME calling_frame;
- int i, count;
- char *funname = 0;
-
- if (!target_has_stack)
- error ("No inferior or core file.");
-
- frame = parse_frame_specification (addr_exp);
- if (!frame)
- error ("Invalid frame specified.");
-
- fi = get_frame_info (frame);
- sal = find_pc_line (fi->pc, fi->next_frame);
- func = get_frame_function (frame);
- s = find_pc_symtab(fi->pc);
- if (func)
- funname = SYMBOL_NAME (func);
- else
- {
- register int misc_index = find_pc_misc_function (fi->pc);
- if (misc_index >= 0)
- funname = misc_function_vector[misc_index].name;
- }
- calling_frame = get_prev_frame (frame);
-
- if (!addr_exp && selected_frame_level >= 0) {
- printf_filtered ("Stack level %d, frame at %s:\n",
- selected_frame_level,
- local_hex_string(FRAME_FP(frame)));
- } else {
- printf_filtered ("Stack frame at %s:\n",
- local_hex_string(FRAME_FP(frame)));
- }
- printf_filtered (" %s = %s",
- reg_names[PC_REGNUM],
- local_hex_string(fi->pc));
-
- wrap_here (" ");
- if (funname)
- {
- printf_filtered (" in ");
- fputs_demangled (funname, stdout, 1);
- }
- wrap_here (" ");
- if (sal.symtab)
- printf_filtered (" (%s:%d)", sal.symtab->filename, sal.line);
- puts_filtered ("; ");
- wrap_here (" ");
- printf_filtered ("saved %s %s\n", reg_names[PC_REGNUM],
- local_hex_string(FRAME_SAVED_PC (frame)));
- if (calling_frame)
- printf_filtered (" called by frame at %s",
- local_hex_string(FRAME_FP (calling_frame)));
- if (fi->next_frame && calling_frame)
- puts_filtered (",");
- wrap_here (" ");
- if (fi->next_frame)
- printf_filtered (" caller of frame at %s", local_hex_string(fi->next_frame));
- if (fi->next_frame || calling_frame)
- puts_filtered ("\n");
- if (s)
- printf_filtered(" source language %s.\n", language_str(s->language));
-
- {
- /* Address of the argument list for this frame, or 0. */
- CORE_ADDR arg_list = FRAME_ARGS_ADDRESS_CORRECT (fi);
- /* Number of args for this frame, or -1 if unknown. */
- int numargs;
-
- if (arg_list == 0)
- printf_filtered (" Arglist at unknown address.\n");
- else
- {
- printf_filtered (" Arglist at %s,", local_hex_string(arg_list));
-
- FRAME_NUM_ARGS (numargs, fi);
- if (numargs < 0)
- puts_filtered (" args: ");
- else if (numargs == 0)
- puts_filtered (" no args.");
- else if (numargs == 1)
- puts_filtered (" 1 arg: ");
- else
- printf_filtered (" %d args: ", numargs);
- print_frame_args (func, fi, numargs, stdout);
- puts_filtered ("\n");
- }
- }
-
-#if defined (FRAME_FIND_SAVED_REGS)
- get_frame_saved_regs (fi, &fsr);
- /* The sp is special; what's returned isn't the save address, but
- actually the value of the previous frame's sp. */
- printf_filtered (" Previous frame's sp is %s\n",
- local_hex_string(fsr.regs[SP_REGNUM]));
- count = 0;
- for (i = 0; i < NUM_REGS; i++)
- if (fsr.regs[i] && i != SP_REGNUM)
- {
- if (count == 0)
- puts_filtered (" Saved registers:\n ");
- else
- puts_filtered (",");
- wrap_here (" ");
- printf_filtered (" %s at %s", reg_names[i],
- local_hex_string(fsr.regs[i]));
- count++;
- }
- if (count)
- puts_filtered ("\n");
-#endif /* Have FRAME_FIND_SAVED_REGS. */
-}
-
-#if 0
-/* Set a limit on the number of frames printed by default in a
- backtrace. */
-
-static int backtrace_limit;
-
-static void
-set_backtrace_limit_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
-{
- int count = parse_and_eval_address (count_exp);
-
- if (count < 0)
- error ("Negative argument not meaningful as backtrace limit.");
-
- backtrace_limit = count;
-}
-
-static void
-backtrace_limit_info (arg, from_tty)
- char *arg;
- int from_tty;
-{
- if (arg)
- error ("\"Info backtrace-limit\" takes no arguments.");
-
- printf ("Backtrace limit: %d.\n", backtrace_limit);
-}
-#endif
-
-/* Print briefly all stack frames or just the innermost COUNT frames. */
-
-static void
-backtrace_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
-{
- struct frame_info *fi;
- register int count;
- register FRAME frame;
- register int i;
- register FRAME trailing;
- register int trailing_level;
-
- if (!target_has_stack)
- error ("No stack.");
-
- /* The following code must do two things. First, it must
- set the variable TRAILING to the frame from which we should start
- printing. Second, it must set the variable count to the number
- of frames which we should print, or -1 if all of them. */
- trailing = get_current_frame ();
- trailing_level = 0;
- if (count_exp)
- {
- count = parse_and_eval_address (count_exp);
- if (count < 0)
- {
- FRAME current;
-
- count = -count;
-
- current = trailing;
- while (current && count--)
- {
- QUIT;
- current = get_prev_frame (current);
- }
-
- /* Will stop when CURRENT reaches the top of the stack. TRAILING
- will be COUNT below it. */
- while (current)
- {
- QUIT;
- trailing = get_prev_frame (trailing);
- current = get_prev_frame (current);
- trailing_level++;
- }
-
- count = -1;
- }
- }
- else
- count = -1;
-
- if (info_verbose)
- {
- struct partial_symtab *ps;
-
- /* Read in symbols for all of the frames. Need to do this in
- a separate pass so that "Reading in symbols for xxx" messages
- don't screw up the appearance of the backtrace. Also
- if people have strong opinions against reading symbols for
- backtrace this may have to be an option. */
- i = count;
- for (frame = trailing;
- frame != NULL && i--;
- frame = get_prev_frame (frame))
- {
- QUIT;
- fi = get_frame_info (frame);
- ps = find_pc_psymtab (fi->pc);
- if (ps)
- (void) PSYMTAB_TO_SYMTAB (ps); /* Force syms to come in */
- }
- }
-
- for (i = 0, frame = trailing;
- frame && count--;
- i++, frame = get_prev_frame (frame))
- {
- QUIT;
- fi = get_frame_info (frame);
- print_frame_info (fi, trailing_level + i, 0, 1);
- }
-
- /* If we've stopped before the end, mention that. */
- if (frame && from_tty)
- printf_filtered ("(More stack frames follow...)\n");
-}
-
-/* Print the local variables of a block B active in FRAME.
- Return 1 if any variables were printed; 0 otherwise. */
-
-static int
-print_block_frame_locals (b, frame, stream)
- struct block *b;
- register FRAME frame;
- register FILE *stream;
-{
- int nsyms;
- register int i;
- register struct symbol *sym;
- register int values_printed = 0;
-
- nsyms = BLOCK_NSYMS (b);
-
- for (i = 0; i < nsyms; i++)
- {
- sym = BLOCK_SYM (b, i);
- if (SYMBOL_CLASS (sym) == LOC_LOCAL
- || SYMBOL_CLASS (sym) == LOC_REGISTER
- || SYMBOL_CLASS (sym) == LOC_STATIC)
- {
- values_printed = 1;
- fprint_symbol (stream, SYMBOL_NAME (sym));
- fputs_filtered (" = ", stream);
- print_variable_value (sym, frame, stream);
- fprintf_filtered (stream, "\n");
- }
- }
- return values_printed;
-}
-
-/* Same, but print labels. */
-
-static int
-print_block_frame_labels (b, have_default, stream)
- struct block *b;
- int *have_default;
- register FILE *stream;
-{
- int nsyms;
- register int i;
- register struct symbol *sym;
- register int values_printed = 0;
-
- nsyms = BLOCK_NSYMS (b);
-
- for (i = 0; i < nsyms; i++)
- {
- sym = BLOCK_SYM (b, i);
- if (! strcmp (SYMBOL_NAME (sym), "default"))
- {
- if (*have_default)
- continue;
- *have_default = 1;
- }
- if (SYMBOL_CLASS (sym) == LOC_LABEL)
- {
- struct symtab_and_line sal;
- sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0);
- values_printed = 1;
- fputs_demangled (SYMBOL_NAME (sym), stream, 1);
- if (addressprint)
- fprintf_filtered (stream, " %s",
- local_hex_string(SYMBOL_VALUE_ADDRESS (sym)));
- fprintf_filtered (stream, " in file %s, line %d\n",
- sal.symtab->filename, sal.line);
- }
- }
- return values_printed;
-}
-
-/* Print on STREAM all the local variables in frame FRAME,
- including all the blocks active in that frame
- at its current pc.
-
- Returns 1 if the job was done,
- or 0 if nothing was printed because we have no info
- on the function running in FRAME. */
-
-static void
-print_frame_local_vars (frame, stream)
- register FRAME frame;
- register FILE *stream;
-{
- register struct block *block = get_frame_block (frame);
- register int values_printed = 0;
-
- if (block == 0)
- {
- fprintf_filtered (stream, "No symbol table info available.\n");
- return;
- }
-
- while (block != 0)
- {
- if (print_block_frame_locals (block, frame, stream))
- values_printed = 1;
- /* After handling the function's top-level block, stop.
- Don't continue to its superblock, the block of
- per-file symbols. */
- if (BLOCK_FUNCTION (block))
- break;
- block = BLOCK_SUPERBLOCK (block);
- }
-
- if (!values_printed)
- {
- fprintf_filtered (stream, "No locals.\n");
- }
-}
-
-/* Same, but print labels. */
-
-static void
-print_frame_label_vars (frame, this_level_only, stream)
- register FRAME frame;
- int this_level_only;
- register FILE *stream;
-{
- extern struct blockvector *blockvector_for_pc ();
- register struct blockvector *bl;
- register struct block *block = get_frame_block (frame);
- register int values_printed = 0;
- int index, have_default = 0;
- char *blocks_printed;
- struct frame_info *fi = get_frame_info (frame);
- CORE_ADDR pc = fi->pc;
-
- if (block == 0)
- {
- fprintf_filtered (stream, "No symbol table info available.\n");
- return;
- }
-
- bl = blockvector_for_pc (BLOCK_END (block) - 4, &index);
- blocks_printed = (char *) alloca (BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
- bzero (blocks_printed, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
-
- while (block != 0)
- {
- CORE_ADDR end = BLOCK_END (block) - 4;
- int last_index;
-
- if (bl != blockvector_for_pc (end, &index))
- error ("blockvector blotch");
- if (BLOCKVECTOR_BLOCK (bl, index) != block)
- error ("blockvector botch");
- last_index = BLOCKVECTOR_NBLOCKS (bl);
- index += 1;
-
- /* Don't print out blocks that have gone by. */
- while (index < last_index
- && BLOCK_END (BLOCKVECTOR_BLOCK (bl, index)) < pc)
- index++;
-
- while (index < last_index
- && BLOCK_END (BLOCKVECTOR_BLOCK (bl, index)) < end)
- {
- if (blocks_printed[index] == 0)
- {
- if (print_block_frame_labels (BLOCKVECTOR_BLOCK (bl, index), &have_default, stream))
- values_printed = 1;
- blocks_printed[index] = 1;
- }
- index++;
- }
- if (have_default)
- return;
- if (values_printed && this_level_only)
- return;
-
- /* After handling the function's top-level block, stop.
- Don't continue to its superblock, the block of
- per-file symbols. */
- if (BLOCK_FUNCTION (block))
- break;
- block = BLOCK_SUPERBLOCK (block);
- }
-
- if (!values_printed && !this_level_only)
- {
- fprintf_filtered (stream, "No catches.\n");
- }
-}
-
-/* ARGSUSED */
-static void
-locals_info (args, from_tty)
- char *args;
- int from_tty;
-{
- if (!selected_frame)
- error ("No frame selected.");
- print_frame_local_vars (selected_frame, stdout);
-}
-
-static void
-catch_info ()
-{
- if (!selected_frame)
- error ("No frame selected.");
- print_frame_label_vars (selected_frame, 0, stdout);
-}
-
-static void
-print_frame_arg_vars (frame, stream)
- register FRAME frame;
- register FILE *stream;
-{
- struct symbol *func = get_frame_function (frame);
- register struct block *b;
- int nsyms;
- register int i;
- register struct symbol *sym, *sym2;
- register int values_printed = 0;
-
- if (func == 0)
- {
- fprintf_filtered (stream, "No symbol table info available.\n");
- return;
- }
-
- b = SYMBOL_BLOCK_VALUE (func);
- nsyms = BLOCK_NSYMS (b);
-
- for (i = 0; i < nsyms; i++)
- {
- sym = BLOCK_SYM (b, i);
- if (SYMBOL_CLASS (sym) == LOC_ARG
- || SYMBOL_CLASS (sym) == LOC_LOCAL_ARG
- || SYMBOL_CLASS (sym) == LOC_REF_ARG
- || SYMBOL_CLASS (sym) == LOC_REGPARM)
- {
- values_printed = 1;
- fprint_symbol (stream, SYMBOL_NAME (sym));
- fputs_filtered (" = ", stream);
- /* We have to look up the symbol because arguments often have
- two entries (one a parameter, one a register) and the one
- we want is the register, which lookup_symbol will find for
- us. */
- sym2 = lookup_symbol (SYMBOL_NAME (sym),
- b, VAR_NAMESPACE, (int *)NULL, (struct symtab **)NULL);
- print_variable_value (sym2, frame, stream);
- fprintf_filtered (stream, "\n");
- }
- }
-
- if (!values_printed)
- {
- fprintf_filtered (stream, "No arguments.\n");
- }
-}
-
-static void
-args_info ()
-{
- if (!selected_frame)
- error ("No frame selected.");
- print_frame_arg_vars (selected_frame, stdout);
-}
-
-/* Select frame FRAME, and note that its stack level is LEVEL.
- LEVEL may be -1 if an actual level number is not known. */
-
-void
-select_frame (frame, level)
- FRAME frame;
- int level;
-{
- register struct symtab *s;
-
- selected_frame = frame;
- selected_frame_level = level;
-
- /* Ensure that symbols for this frame are read in. Also, determine the
- source language of this frame, and switch to it if desired. */
- if (frame)
- {
- s = find_pc_symtab (get_frame_info (frame)->pc);
- if (s
- && s->language != current_language->la_language
- && s->language != language_unknown
- && language_mode == language_mode_auto) {
- set_language(s->language);
- }
- }
-}
-
-/* Store the selected frame and its level into *FRAMEP and *LEVELP.
- If there is no selected frame, *FRAMEP is set to NULL. */
-
-void
-record_selected_frame (frameaddrp, levelp)
- FRAME_ADDR *frameaddrp;
- int *levelp;
-{
- *frameaddrp = selected_frame ? FRAME_FP (selected_frame) : NULL;
- *levelp = selected_frame_level;
-}
-
-/* Return the symbol-block in which the selected frame is executing.
- Can return zero under various legitimate circumstances. */
-
-struct block *
-get_selected_block ()
-{
- if (!target_has_stack)
- return 0;
-
- if (!selected_frame)
- return get_current_block ();
- return get_frame_block (selected_frame);
-}
-
-/* Find a frame a certain number of levels away from FRAME.
- LEVEL_OFFSET_PTR points to an int containing the number of levels.
- Positive means go to earlier frames (up); negative, the reverse.
- The int that contains the number of levels is counted toward
- zero as the frames for those levels are found.
- If the top or bottom frame is reached, that frame is returned,
- but the final value of *LEVEL_OFFSET_PTR is nonzero and indicates
- how much farther the original request asked to go. */
-
-FRAME
-find_relative_frame (frame, level_offset_ptr)
- register FRAME frame;
- register int* level_offset_ptr;
-{
- register FRAME prev;
- register FRAME frame1;
-
- /* Going up is simple: just do get_prev_frame enough times
- or until initial frame is reached. */
- while (*level_offset_ptr > 0)
- {
- prev = get_prev_frame (frame);
- if (prev == 0)
- break;
- (*level_offset_ptr)--;
- frame = prev;
- }
- /* Going down is just as simple. */
- if (*level_offset_ptr < 0)
- {
- while (*level_offset_ptr < 0) {
- frame1 = get_next_frame (frame);
- if (!frame1)
- break;
- frame = frame1;
- (*level_offset_ptr)++;
- }
- }
- return frame;
-}
-
-/* The "select_frame" command. With no arg, NOP.
- With arg LEVEL_EXP, select the frame at level LEVEL if it is a
- valid level. Otherwise, treat level_exp as an address expression
- and select it. See parse_frame_specification for more info on proper
- frame expressions. */
-
-/* ARGSUSED */
-static void
-select_frame_command (level_exp, from_tty)
- char *level_exp;
- int from_tty;
-{
- register FRAME frame, frame1;
- unsigned int level = 0;
-
- if (!target_has_stack)
- error ("No stack.");
-
- frame = parse_frame_specification (level_exp);
-
- /* Try to figure out what level this frame is. But if there is
- no current stack, don't error out -- let the user set one. */
- frame1 = 0;
- if (get_current_frame()) {
- for (frame1 = get_prev_frame (0);
- frame1 && frame1 != frame;
- frame1 = get_prev_frame (frame1))
- level++;
- }
-
- if (!frame1)
- level = 0;
-
- select_frame (frame, level);
-}
-
-/* The "frame" command. With no arg, print selected frame briefly.
- With arg, behaves like select_frame and then prints the selected
- frame. */
-
-static void
-frame_command (level_exp, from_tty)
- char *level_exp;
- int from_tty;
-{
- select_frame_command (level_exp, from_tty);
- print_stack_frame (selected_frame, selected_frame_level, 1);
-}
-
-/* Select the frame up one or COUNT stack levels
- from the previously selected frame, and print it briefly. */
-
-/* ARGSUSED */
-static void
-up_silently_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
-{
- register FRAME frame;
- int count = 1, count1;
- if (count_exp)
- count = parse_and_eval_address (count_exp);
- count1 = count;
-
- if (!target_has_stack)
- error ("No stack.");
-
- frame = find_relative_frame (selected_frame, &count1);
- if (count1 != 0 && count_exp == 0)
- error ("Initial frame selected; you cannot go up.");
- select_frame (frame, selected_frame_level + count - count1);
-}
-
-static void
-up_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
-{
- up_silently_command (count_exp, from_tty);
- print_stack_frame (selected_frame, selected_frame_level, 1);
-}
-
-/* Select the frame down one or COUNT stack levels
- from the previously selected frame, and print it briefly. */
-
-/* ARGSUSED */
-static void
-down_silently_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
-{
- register FRAME frame;
- int count = -1, count1;
- if (count_exp)
- count = - parse_and_eval_address (count_exp);
- count1 = count;
-
- if (!target_has_stack)
- error ("No stack.");
-
- frame = find_relative_frame (selected_frame, &count1);
- if (count1 != 0 && count_exp == 0)
- error ("Bottom (i.e., innermost) frame selected; you cannot go down.");
- select_frame (frame, selected_frame_level + count - count1);
-}
-
-
-static void
-down_command (count_exp, from_tty)
- char *count_exp;
- int from_tty;
-{
- down_silently_command (count_exp, from_tty);
- print_stack_frame (selected_frame, selected_frame_level, 1);
-}
-
-static void
-return_command (retval_exp, from_tty)
- char *retval_exp;
- int from_tty;
-{
- struct symbol *thisfun;
- FRAME_ADDR selected_frame_addr;
- CORE_ADDR selected_frame_pc;
- FRAME frame;
-
- if (selected_frame == NULL)
- error ("No selected frame.");
- thisfun = get_frame_function (selected_frame);
- selected_frame_addr = FRAME_FP (selected_frame);
- selected_frame_pc = (get_frame_info (selected_frame))->pc;
-
- /* If interactive, require confirmation. */
-
- if (from_tty)
- {
- if (thisfun != 0)
- {
- if (!query ("Make %s return now? ", SYMBOL_NAME (thisfun)))
- error ("Not confirmed.");
- }
- else
- if (!query ("Make selected stack frame return now? "))
- error ("Not confirmed.");
- }
-
- /* Do the real work. Pop until the specified frame is current. We
- use this method because the selected_frame is not valid after
- a POP_FRAME. The pc comparison makes this work even if the
- selected frame shares its fp with another frame. */
-
- while ( selected_frame_addr != FRAME_FP (frame = get_current_frame())
- || selected_frame_pc != (get_frame_info (frame))->pc )
- POP_FRAME;
-
- /* Then pop that frame. */
-
- POP_FRAME;
-
- /* Compute the return value (if any) and store in the place
- for return values. */
-
- if (retval_exp)
- set_return_value (parse_and_eval (retval_exp));
-
- /* If interactive, print the frame that is now current. */
-
- if (from_tty)
- frame_command ("0", 1);
-}
-
-/* Gets the language of the current frame. */
-enum language
-get_frame_language()
-{
- register struct symtab *s;
- FRAME fr;
- enum language flang; /* The language of the current frame */
-
- fr = get_frame_info(selected_frame);
- if(fr)
- {
- s = find_pc_symtab(fr->pc);
- if(s)
- flang = s->language;
- else
- flang = language_unknown;
- }
- else
- flang = language_unknown;
-
- return flang;
-}
-
-void
-_initialize_stack ()
-{
-#if 0
- backtrace_limit = 30;
-#endif
-
- add_com ("return", class_stack, return_command,
- "Make selected stack frame return to its caller.\n\
-Control remains in the debugger, but when you continue\n\
-execution will resume in the frame above the one now selected.\n\
-If an argument is given, it is an expression for the value to return.");
-
- add_com ("up", class_stack, up_command,
- "Select and print stack frame that called this one.\n\
-An argument says how many frames up to go.");
- add_com ("up-silently", class_support, up_silently_command,
- "Same as the `up' command, but does not print anything.\n\
-This is useful in command scripts.");
-
- add_com ("down", class_stack, down_command,
- "Select and print stack frame called by this one.\n\
-An argument says how many frames down to go.");
- add_com_alias ("do", "down", class_stack, 1);
- add_com ("down-silently", class_support, down_silently_command,
- "Same as the `down' command, but does not print anything.\n\
-This is useful in command scripts.");
-
- add_com ("frame", class_stack, frame_command,
- "Select and print a stack frame.\n\
-With no argument, print the selected stack frame. (See also \"info frame\").\n\
-An argument specifies the frame to select.\n\
-It can be a stack frame number or the address of the frame.\n\
-With argument, nothing is printed if input is coming from\n\
-a command file or a user-defined command.");
-
- add_com_alias ("f", "frame", class_stack, 1);
-
- add_com ("select-frame", class_stack, select_frame_command,
- "Select a stack frame without printing anything.\n\
-An argument specifies the frame to select.\n\
-It can be a stack frame number or the address of the frame.\n");
-
- add_com ("backtrace", class_stack, backtrace_command,
- "Print backtrace of all stack frames, or innermost COUNT frames.\n\
-With a negative argument, print outermost -COUNT frames.");
- add_com_alias ("bt", "backtrace", class_stack, 0);
- add_com_alias ("where", "backtrace", class_alias, 0);
- add_info ("stack", backtrace_command,
- "Backtrace of the stack, or innermost COUNT frames.");
- add_info_alias ("s", "stack", 1);
- add_info ("frame", frame_info,
- "All about selected stack frame, or frame at ADDR.");
- add_info_alias ("f", "frame", 1);
- add_info ("locals", locals_info,
- "Local variables of current stack frame.");
- add_info ("args", args_info,
- "Argument variables of current stack frame.");
- add_info ("catch", catch_info,
- "Exceptions that can be caught in the current stack frame.");
-
-#if 0
- add_cmd ("backtrace-limit", class_stack, set_backtrace_limit_command,
- "Specify maximum number of frames for \"backtrace\" to print by default.",
- &setlist);
- add_info ("backtrace-limit", backtrace_limit_info,
- "The maximum number of frames for \"backtrace\" to print by default.");
-#endif
-}
diff --git a/gdb/standalone.c b/gdb/standalone.c
deleted file mode 100644
index 88c7053..0000000
--- a/gdb/standalone.c
+++ /dev/null
@@ -1,594 +0,0 @@
-/* Interface to bare machine for GDB running as kernel debugger.
- Copyright (C) 1986, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#if defined (SIGTSTP) && defined (SIGIO)
-#include <sys/time.h>
-#include <sys/resource.h>
-#endif /* SIGTSTP and SIGIO defined (must be 4.2) */
-
-#include "defs.h"
-#include "param.h"
-#include "signals.h"
-#include "symtab.h"
-#include "frame.h"
-#include "inferior.h"
-#include "wait.h"
-
-
-/* Random system calls, mostly no-ops to prevent link problems */
-
-ioctl (desc, code, arg)
-{}
-
-int (* signal ()) ()
-{}
-
-kill ()
-{}
-
-getpid ()
-{
- return 0;
-}
-
-sigsetmask ()
-{}
-
-chdir ()
-{}
-
-char *
-getwd (buf)
- char *buf;
-{
- buf[0] = '/';
- buf[1] = 0;
- return buf;
-}
-
-/* Used to check for existence of .gdbinit. Say no. */
-
-access ()
-{
- return -1;
-}
-
-exit ()
-{
- error ("Fatal error; restarting.");
-}
-
-/* Reading "files". The contents of some files are written into kdb's
- data area before it is run. These files are used to contain the
- symbol table for kdb to load, and the source files (in case the
- kdb user wants to print them). The symbols are stored in a file
- named "kdb-symbols" in a.out format (except that all the text and
- data have been stripped to save room).
-
- The files are stored in the following format:
- int number of bytes of data for this file, including these four.
- char[] name of the file, ending with a null.
- padding to multiple of 4 boundary.
- char[] file contents. The length can be deduced from what was
- specified before. There is no terminating null here.
-
- If the int at the front is zero, it means there are no more files.
-
- Opening a file in kdb returns a nonzero value to indicate success,
- but the value does not matter. Only one file can be open, and only
- for reading. All the primitives for input from the file know
- which file is open and ignore what is specified for the descriptor
- or for the stdio stream.
-
- Input with fgetc can be done either on the file that is open
- or on stdin (which reads from the terminal through tty_input () */
-
-/* Address of data for the files stored in format described above. */
-char *files_start;
-
-/* The file stream currently open: */
-
-char *sourcebeg; /* beginning of contents */
-int sourcesize; /* size of contents */
-char *sourceptr; /* current read pointer */
-int sourceleft; /* number of bytes to eof */
-
-/* "descriptor" for the file now open.
- Incremented at each close.
- If specified descriptor does not match this,
- it means the program is trying to use a closed descriptor.
- We report an error for that. */
-
-int sourcedesc;
-
-open (filename, modes)
- char *filename;
- int modes;
-{
- register char *next;
-
- if (modes)
- {
- errno = EROFS;
- return -1;
- }
-
- if (sourceptr)
- {
- errno = EMFILE;
- return -1;
- }
-
- for (next - files_start; * (int *) next;
- next += * (int *) next)
- {
- if (!strcmp (next + 4, filename))
- {
- sourcebeg = next + 4 + strlen (next + 4) + 1;
- sourcebeg = (char *) (((int) sourcebeg + 3) & (-4));
- sourceptr = sourcebeg;
- sourcesize = next + * (int *) next - sourceptr;
- sourceleft = sourcesize;
- return sourcedesc;
- }
- }
- return 0;
-}
-
-close (desc)
- int desc;
-{
- sourceptr = 0;
- sourcedesc++;
- /* Don't let sourcedesc get big enough to be confused with stdin. */
- if (sourcedesc == 100)
- sourcedesc = 5;
-}
-
-FILE *
-fopen (filename, modes)
- char *filename;
- char *modes;
-{
- return (FILE *) open (filename, *modes == 'w');
-}
-
-FILE *
-fdopen (desc)
- int desc;
-{
- return (FILE *) desc;
-}
-
-fclose (desc)
- int desc;
-{
- close (desc);
-}
-
-fstat (desc, statbuf)
- struct stat *statbuf;
-{
- if (desc != sourcedesc)
- {
- errno = EBADF;
- return -1;
- }
- statbuf->st_size = sourcesize;
-}
-
-myread (desc, destptr, size, filename)
- int desc;
- char *destptr;
- int size;
- char *filename;
-{
- int len = min (sourceleft, size);
-
- if (desc != sourcedesc)
- {
- errno = EBADF;
- return -1;
- }
-
- bcopy (sourceptr, destptr, len);
- sourceleft -= len;
- return len;
-}
-
-int
-fread (bufp, numelts, eltsize, stream)
-{
- register int elts = min (numelts, sourceleft / eltsize);
- register int len = elts * eltsize;
-
- if (stream != sourcedesc)
- {
- errno = EBADF;
- return -1;
- }
-
- bcopy (sourceptr, bufp, len);
- sourceleft -= len;
- return elts;
-}
-
-int
-fgetc (desc)
- int desc;
-{
-
- if (desc == (int) stdin)
- return tty_input ();
-
- if (desc != sourcedesc)
- {
- errno = EBADF;
- return -1;
- }
-
- if (sourceleft-- <= 0)
- return EOF;
- return *sourceptr++;
-}
-
-lseek (desc, pos)
- int desc;
- int pos;
-{
-
- if (desc != sourcedesc)
- {
- errno = EBADF;
- return -1;
- }
-
- if (pos < 0 || pos > sourcesize)
- {
- errno = EINVAL;
- return -1;
- }
-
- sourceptr = sourcebeg + pos;
- sourceleft = sourcesize - pos;
-}
-
-/* Output in kdb can go only to the terminal, so the stream
- specified may be ignored. */
-
-printf (a1, a2, a3, a4, a5, a6, a7, a8, a9)
-{
- char buffer[1024];
- sprintf (buffer, a1, a2, a3, a4, a5, a6, a7, a8, a9);
- display_string (buffer);
-}
-
-fprintf (ign, a1, a2, a3, a4, a5, a6, a7, a8, a9)
-{
- char buffer[1024];
- sprintf (buffer, a1, a2, a3, a4, a5, a6, a7, a8, a9);
- display_string (buffer);
-}
-
-fwrite (buf, numelts, size, stream)
- register char *buf;
- int numelts, size;
-{
- register int i = numelts * size;
- while (i-- > 0)
- fputc (*buf++, stream);
-}
-
-fputc (c, ign)
-{
- char buf[2];
- buf[0] = c;
- buf[1] = 0;
- display_string (buf);
-}
-
-/* sprintf refers to this, but loading this from the
- library would cause fflush to be loaded from it too.
- In fact there should be no need to call this (I hope). */
-
-_flsbuf ()
-{
- error ("_flsbuf was actually called.");
-}
-
-fflush (ign)
-{
-}
-
-/* Entries into core and inflow, needed only to make things link ok. */
-
-exec_file_command ()
-{}
-
-core_file_command ()
-{}
-
-char *
-get_exec_file (err)
- int err;
-{
- /* Makes one printout look reasonable; value does not matter otherwise. */
- return "run";
-}
-
-have_core_file_p ()
-{
- return 0;
-}
-
-kill_command ()
-{
- inferior_pid = 0;
-}
-
-terminal_inferior ()
-{}
-
-terminal_ours ()
-{}
-
-terminal_init_inferior ()
-{}
-
-write_inferior_register ()
-{}
-
-read_inferior_register ()
-{}
-
-read_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- bcopy (memaddr, myaddr, len);
-}
-
-/* Always return 0 indicating success. */
-
-write_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- bcopy (myaddr, memaddr, len);
- return 0;
-}
-
-static REGISTER_TYPE saved_regs[NUM_REGS];
-
-REGISTER_TYPE
-read_register (regno)
- int regno;
-{
- if (regno < 0 || regno >= NUM_REGS)
- error ("Register number %d out of range.", regno);
- return saved_regs[regno];
-}
-
-void
-write_register (regno, value)
- int regno;
- REGISTER_TYPE value;
-{
- if (regno < 0 || regno >= NUM_REGS)
- error ("Register number %d out of range.", regno);
- saved_regs[regno] = value;
-}
-
-/* System calls needed in relation to running the "inferior". */
-
-vfork ()
-{
- /* Just appear to "succeed". Say the inferior's pid is 1. */
- return 1;
-}
-
-/* These are called by code that normally runs in the inferior
- that has just been forked. That code never runs, when standalone,
- and these definitions are so it will link without errors. */
-
-ptrace ()
-{}
-
-setpgrp ()
-{}
-
-execle ()
-{}
-
-_exit ()
-{}
-
-/* Malloc calls these. */
-
-malloc_warning (str)
- char *str;
-{
- printf ("\n%s.\n\n", str);
-}
-
-char *next_free;
-char *memory_limit;
-
-char *
-sbrk (amount)
- int amount;
-{
- if (next_free + amount > memory_limit)
- return (char *) -1;
- next_free += amount;
- return next_free - amount;
-}
-
-/* Various ways malloc might ask where end of memory is. */
-
-char *
-ulimit ()
-{
- return memory_limit;
-}
-
-int
-vlimit ()
-{
- return memory_limit - next_free;
-}
-
-getrlimit (addr)
- struct rlimit *addr;
-{
- addr->rlim_cur = memory_limit - next_free;
-}
-
-/* Context switching to and from program being debugged. */
-
-/* GDB calls here to run the user program.
- The frame pointer for this function is saved in
- gdb_stack by save_frame_pointer; then we restore
- all of the user program's registers, including PC and PS. */
-
-static int fault_code;
-static REGISTER_TYPE gdb_stack;
-
-resume ()
-{
- REGISTER_TYPE restore[NUM_REGS];
-
- PUSH_FRAME_PTR;
- save_frame_pointer ();
-
- bcopy (saved_regs, restore, sizeof restore);
- POP_REGISTERS;
- /* Control does not drop through here! */
-}
-
-save_frame_pointer (val)
- CORE_ADDR val;
-{
- gdb_stack = val;
-}
-
-/* Fault handlers call here, running in the user program stack.
- They must first push a fault code,
- old PC, old PS, and any other info about the fault.
- The exact format is machine-dependent and is known only
- in the definition of PUSH_REGISTERS. */
-
-fault ()
-{
- /* Transfer all registers and fault code to the stack
- in canonical order: registers in order of GDB register number,
- followed by fault code. */
- PUSH_REGISTERS;
-
- /* Transfer them to saved_regs and fault_code. */
- save_registers ();
-
- restore_gdb ();
- /* Control does not reach here */
-}
-
-restore_gdb ()
-{
- CORE_ADDR new_fp = gdb_stack;
- /* Switch to GDB's stack */
- POP_FRAME_PTR;
- /* Return from the function `resume'. */
-}
-
-/* Assuming register contents and fault code have been pushed on the stack as
- arguments to this function, copy them into the standard place
- for the program's registers while GDB is running. */
-
-save_registers (firstreg)
- int firstreg;
-{
- bcopy (&firstreg, saved_regs, sizeof saved_regs);
- fault_code = (&firstreg)[NUM_REGS];
-}
-
-/* Store into the structure such as `wait' would return
- the information on why the program faulted,
- converted into a machine-independent signal number. */
-
-static int fault_table[] = FAULT_TABLE;
-
-int
-wait (w)
- WAITTYPE *w;
-{
- WSETSTOP (*w, fault_table[fault_code / FAULT_CODE_UNITS]);
- return inferior_pid;
-}
-
-/* Allocate a big space in which files for kdb to read will be stored.
- Whatever is left is where malloc can allocate storage.
-
- Initialize it, so that there will be space in the executable file
- for it. Then the files can be put into kdb by writing them into
- kdb's executable file. */
-
-/* The default size is as much space as we expect to be available
- for kdb to use! */
-
-#ifndef HEAP_SIZE
-#define HEAP_SIZE 400000
-#endif
-
-char heap[HEAP_SIZE] = {0};
-
-#ifndef STACK_SIZE
-#define STACK_SIZE 100000
-#endif
-
-int kdb_stack_beg[STACK_SIZE / sizeof (int)];
-int kdb_stack_end;
-
-_initialize_standalone ()
-{
- register char *next;
-
- /* Find start of data on files. */
-
- files_start = heap;
-
- /* Find the end of the data on files. */
-
- for (next - files_start; * (int *) next;
- next += * (int *) next)
- {}
-
- /* That is where free storage starts for sbrk to give out. */
- next_free = next;
-
- memory_limit = heap + sizeof heap;
-}
-
diff --git a/gdb/stddef.h b/gdb/stddef.h
deleted file mode 100755
index c2c396e..0000000
--- a/gdb/stddef.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef _STDDEF_H
-#define _STDDEF_H
-
-/* Signed type of difference of two pointers. */
-
-typedef long ptrdiff_t;
-
-/* Unsigned type of `sizeof' something. */
-
-/* in case <sys/types.h> has defined it. */
-/* DECstation uses _SIZE_T_. */
-#if !defined (_SIZE_T) && !defined (_SIZE_T_)
-#define _SIZE_T
-typedef unsigned long size_t;
-#endif /* _SIZE_T */
-
-/* A null pointer constant. */
-
-#undef NULL /* in case <stdio.h> has defined it. */
-#define NULL 0
-
-/* Offset of member MEMBER in a struct of type TYPE. */
-
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-
-#endif /* _STDDEF_H */
diff --git a/gdb/stdlib.h b/gdb/stdlib.h
deleted file mode 100755
index 40ce167..0000000
--- a/gdb/stdlib.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Fake stdlib.h supplying the stuff needed by malloc. */
-
-#ifndef __ONEFILE
-#include <stddef.h>
-#endif
-
-extern void EXFUN(abort, (void));
-extern void EXFUN(free, (PTR));
-extern PTR EXFUN(malloc, (size_t));
-extern PTR EXFUN(realloc, (PTR, size_t));
diff --git a/gdb/stuff.c b/gdb/stuff.c
deleted file mode 100644
index a28511d..0000000
--- a/gdb/stuff.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/* Program to stuff files into a specially prepared space in kdb.
- Copyright (C) 1986, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Written 13-Mar-86 by David Bridgham. */
-
-#include <stdio.h>
-#include <a.out.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <varargs.h>
-
-extern char *sys_errlist[];
-
-main (argc, argv)
- int argc;
- char *argv[];
-{
- register char *cp;
- char *outfile;
- register int i;
- int offset;
- int out_fd, in_fd;
- struct stat stat_buf;
- int size, pad;
- char buf[1024];
- static char zeros[4] = {0};
-
- if (argc < 4)
- err("Not enough arguments\nUsage: %s -o kdb file1 file2 ...\n",
- argv[0]);
-
- outfile = 0;
- for (i = 1; i < argc; i++)
- {
- if (strcmp (argv[i], "-o") == 0)
- outfile = argv[++i];
- }
- if (outfile == 0)
- err("Output file not specified\n");
-
- offset = get_offset (outfile, "_heap");
-
- out_fd = open (outfile, O_WRONLY);
- if (out_fd < 0)
- err ("Error opening %s for write: %s\n", outfile, sys_errlist[errno]);
- if (lseek (out_fd, offset, 0) < 0)
- err ("Error seeking to heap in %s: %s\n", outfile, sys_errlist[errno]);
-
- /* For each file listed on the command line, write it into the
- * 'heap' of the output file. Make sure to skip the arguments
- * that name the output file. */
- for (i = 1; i < argc; i++)
- {
- if (strcmp (argv[i], "-o") == 0)
- continue;
- if ((in_fd = open (argv[i], O_RDONLY)) < 0)
- err ("Error opening %s for read: %s\n", argv[i], sys_errlist[errno]);
- if (fstat (in_fd, &stat_buf) < 0)
- err ("Error stat'ing %s: %s\n", argv[i], sys_errlist[errno]);
- size = strlen (argv[i]);
- pad = 4 - (size & 3);
- size += pad + stat_buf.st_size + sizeof (int);
- write (out_fd, &size, sizeof (int));
- write (out_fd, argv[i], strlen (argv[i]));
- write (out_fd, zeros, pad);
- while ((size = read (in_fd, buf, sizeof (buf))) > 0)
- write (out_fd, buf, size);
- close (in_fd);
- }
- size = 0;
- write (out_fd, &size, sizeof (int));
- close (out_fd);
- return (0);
-}
-
-/* Read symbol table from file and returns the offset into the file
- * where symbol sym_name is located. If error, print message and
- * exit. */
-get_offset (file, sym_name)
- char *file;
- char *sym_name;
-{
- int f;
- struct exec file_hdr;
- struct nlist *symbol_table;
- int size;
- char *strings;
-
- f = open (file, O_RDONLY);
- if (f < 0)
- err ("Error opening %s: %s\n", file, sys_errlist[errno]);
- if (read (f, &file_hdr, sizeof (file_hdr)) < 0)
- err ("Error reading exec structure: %s\n", sys_errlist[errno]);
- if (N_BADMAG (file_hdr))
- err ("File %s not an a.out file\n", file);
-
- /* read in symbol table */
- if ((symbol_table = (struct nlist *)malloc (file_hdr.a_syms)) == 0)
- err ("Couldn't allocate space for symbol table\n");
- if (lseek (f, N_SYMOFF (file_hdr), 0) == -1)
- err ("lseek error: %s\n", sys_errlist[errno]);
- if (read (f, symbol_table, file_hdr.a_syms) == -1)
- err ("Error reading symbol table from %s: %s\n", file, sys_errlist[errno]);
-
- /* read in string table */
- if (read (f, &size, 4) == -1)
- err ("reading string table size: %s\n", sys_errlist[errno]);
- if ((strings = (char *)malloc (size)) == 0)
- err ("Couldn't allocate memory for string table\n");
- if (read (f, strings, size - 4) == -1)
- err ("reading string table: %s\n", sys_errlist[errno]);
-
- /* Find the core address at which the first byte of kdb text segment
- should be loaded into core when kdb is run. */
- origin = find_symbol ("_etext", symbol_table, file_hdr.a_syms, strings)
- - file_hdr.a_text;
- /* Find the core address at which the heap will appear. */
- coreaddr = find_symbol (sym_name, symbol_table, file_hdr.a_syms, strings);
- /* Return address in file of the heap data space. */
- return (N_TXTOFF (file_hdr) + core_addr - origin);
-}
-
-find_symbol (sym_name, symbol_table, length, strings)
- char *sym_name;
- struct nlist *symbol_table;
- int length;
- char *strings;
-{
- register struct nlist *sym;
-
- /* Find symbol in question */
- for (sym = symbol_table;
- sym != (struct nlist *)((char *)symbol_table + length);
- sym++)
- {
- if ((sym->n_type & N_TYPE) != N_DATA) continue;
- if (sym->n_un.n_strx == 0) continue;
- if (strcmp (sym_name, strings + sym->n_un.n_strx - 4) == 0)
- return sym->n_value;
- }
- err ("Data symbol %s not found in %s\n", sym_name, file);
-}
-
-/* VARARGS */
-void
-err (va_alist)
- va_dcl
-{
- va_list args;
- char *string;
-
- va_start (args);
- string = va_arg (args, char *);
- vfprintf (stderr, string, args);
- va_end (args);
- exit (-1);
-}
diff --git a/gdb/sun3-xdep.c b/gdb/sun3-xdep.c
deleted file mode 100644
index f6394bc..0000000
--- a/gdb/sun3-xdep.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/* Sun-3 Machine-dependent code which would otherwise be in inflow.c and core.c,
- for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "inferior.h"
-
-#include <sys/ptrace.h>
-#define KERNEL /* To get floating point reg definitions */
-#include <machine/reg.h>
-
-#include "gdbcore.h"
-
-extern int errno;
-
-#if defined (GDB_TARGET_IS_SUN3)
-/* All of this stuff is only relevant if both host and target are sun3. */
-void
-fetch_inferior_registers ()
-{
- struct regs inferior_registers;
-#ifdef FP0_REGNUM
- struct fp_status inferior_fp_registers;
-#endif
- extern char registers[];
-
- registers_fetched ();
-
- ptrace (PTRACE_GETREGS, inferior_pid, &inferior_registers);
-#ifdef FP0_REGNUM
- ptrace (PTRACE_GETFPREGS, inferior_pid, &inferior_fp_registers);
-#endif
-
- bcopy (&inferior_registers, registers, 16 * 4);
-#ifdef FP0_REGNUM
- bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.fps_regs);
-#endif
- *(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
-#ifdef FP0_REGNUM
- bcopy (&inferior_fp_registers.fps_control,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-#endif
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- int regno;
-{
- struct regs inferior_registers;
-#ifdef FP0_REGNUM
- struct fp_status inferior_fp_registers;
-#endif
- extern char registers[];
-
- bcopy (registers, &inferior_registers, 16 * 4);
-#ifdef FP0_REGNUM
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
- sizeof inferior_fp_registers.fps_regs);
-#endif
- inferior_registers.r_ps = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_registers.r_pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
-
-#ifdef FP0_REGNUM
- bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &inferior_fp_registers.fps_control,
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
-#endif
-
- ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
-#if FP0_REGNUM
- ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers);
-#endif
-}
-
-/* Machine-dependent code for pulling registers out of a Sun-3 core file. */
-
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
- char *core_reg_sect;
- unsigned core_reg_size;
- int which;
-{
- extern char registers[];
- struct regs *regs = (struct regs *) core_reg_sect;
-
- if (which == 0) {
- if (core_reg_size < sizeof (struct regs))
- error ("Can't find registers in core file");
-
- bcopy ((char *)regs, registers, 16 * 4);
- supply_register (PS_REGNUM, &regs->r_ps);
- supply_register (PC_REGNUM, &regs->r_pc);
-
- } else if (which == 2) {
-
-#define fpustruct ((struct fpu *) core_reg_sect)
-
- if (core_reg_size >= sizeof (struct fpu))
- {
-#ifdef FP0_REGNUM
- bcopy (fpustruct->f_fpstatus.fps_regs,
- &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof fpustruct->f_fpstatus.fps_regs);
- bcopy (&fpustruct->f_fpstatus.fps_control,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof fpustruct->f_fpstatus -
- sizeof fpustruct->f_fpstatus.fps_regs);
-#endif
- }
- else
- fprintf (stderr, "Couldn't read float regs from core file\n");
- }
-}
-#else /* Not sun3 target. */
-/* These functions shouldn't be called when we're cross-debugging. */
-
-void
-fetch_inferior_registers ()
-{
-}
-
-/* ARGSUSED */
-store_inferior_registers (regno)
- int regno;
-{
-}
-
-/* ARGSUSED */
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
- char *core_reg_sect;
- unsigned core_reg_size;
- int which;
-{
-}
-#endif /* Not sun3 target. */
diff --git a/gdb/sun386-xdep.c b/gdb/sun386-xdep.c
deleted file mode 100644
index 4ecb542..0000000
--- a/gdb/sun386-xdep.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/* Machine-dependent code for host Sun 386i's for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
- Changes for sun386i by Jean Daniel Fekete (jdf@litp.univ-p6-7.fr),
- C2V Paris, April 89.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if defined (GDB_TARGET_IS_SUN386)
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "signame.h"
-#include "gdbcore.h"
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/core.h>
-
-void
-fetch_inferior_registers ()
-{
- struct regs inferior_registers;
- struct fp_state inferior_fp_registers;
- extern char registers[];
-
- registers_fetched ();
-
- ptrace (PTRACE_GETREGS, inferior_pid, &inferior_registers);
- ptrace (PTRACE_GETFPREGS, inferior_pid, &inferior_fp_registers);
-
- bcopy (&inferior_registers, registers, sizeof inferior_registers);
-
- bcopy (inferior_fp_registers.f_st,&registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.f_st);
- bcopy (&inferior_fp_registers.f_ctrl,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-store_inferior_registers (regno)
- int regno;
-{
- struct regs inferior_registers;
- struct fp_state inferior_fp_registers;
- extern char registers[];
-
- bcopy (registers, &inferior_registers, 20 * 4);
-
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],inferior_fp_registers.f_st,
- sizeof inferior_fp_registers.f_st);
- bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &inferior_fp_registers.f_ctrl,
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
-
-#ifdef PTRACE_FP_BUG
- if (regno == FP_REGNUM || regno == -1)
- /* Storing the frame pointer requires a gross hack, in which an
- instruction that moves eax into ebp gets single-stepped. */
- {
- int stack = inferior_registers.r_reg[SP_REGNUM];
- int stuff = ptrace (PTRACE_PEEKDATA, inferior_pid, stack);
- int reg = inferior_registers.r_reg[EAX];
- inferior_registers.r_reg[EAX] =
- inferior_registers.r_reg[FP_REGNUM];
- ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
- ptrace (PTRACE_POKEDATA, inferior_pid, stack, 0xc589);
- ptrace (PTRACE_SINGLESTEP, inferior_pid, stack, 0);
- wait (0);
- ptrace (PTRACE_POKEDATA, inferior_pid, stack, stuff);
- inferior_registers.r_reg[EAX] = reg;
- }
-#endif
- ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
- ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers);
-}
-
-/* Machine-dependent code which would otherwise be in core.c */
-/* Work with core files, for GDB. */
-
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- extern char registers[];
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
-
- {
- struct core corestr;
-
- val = myread (corechan, &corestr, sizeof corestr);
- if (val < 0)
- perror_with_name (filename);
- if (corestr.c_magic != CORE_MAGIC)
- error ("\"%s\" does not appear to be a core dump file (magic 0x%x, expected 0x%x)",
- filename, corestr.c_magic, (int) CORE_MAGIC);
- else if (sizeof (struct core) != corestr.c_len)
- error ("\"%s\" has an invalid struct core length (%d, expected %d)",
- filename, corestr.c_len, (int) sizeof (struct core));
-
- data_start = exec_data_start;
- data_end = data_start + corestr.c_dsize;
- stack_start = stack_end - corestr.c_ssize;
- data_offset = sizeof corestr;
- stack_offset = sizeof corestr + corestr.c_dsize;
-
- bcopy (&corestr.c_regs, registers, sizeof corestr.c_regs);
-
- bcopy (corestr.c_fpu.f_fpstatus.f_st,
- &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof corestr.c_fpu.f_fpstatus.f_st);
- bcopy (&corestr.c_fpu.f_fpstatus.f_ctrl,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof corestr.c_fpu.f_fpstatus -
- sizeof corestr.c_fpu.f_fpstatus.f_st);
-
- /* the struct aouthdr of sun coff is not the struct exec stored
- in the core file. */
- bcopy (&corestr.c_aouthdr, &core_aouthdr, sizeof (struct exec));
-#ifndef COFF_ENCAPSULATE
- core_aouthdr.magic = corestr.c_aouthdr.a_info;
- core_aouthdr.vstamp = /*SUNVERSION*/ 31252;
-#endif
- printf ("Core file is from \"%s\".\n", corestr.c_cmdname);
- if (corestr.c_signo > 0)
- printf ("Program terminated with signal %d, %s.\n",
- corestr.c_signo,
- corestr.c_signo < NSIG
- ? sys_siglist[corestr.c_signo]
- : "(undocumented)");
- }
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- {
- corefile = concat (current_directory, "/", filename, NULL);
- }
-
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- select_frame (get_current_frame (), 0);
-
- validate_files ();
- }
- else if (from_tty)
- printf ("No core file now.\n");
-}
-
-i387_to_double (from, to)
- char *from;
- char *to;
-{
- long *lp;
- /* push extended mode on 387 stack, then pop in double mode
- *
- * first, set exception masks so no error is generated -
- * number will be rounded to inf or 0, if necessary
- */
- asm ("pushl %eax"); /* grab a stack slot */
- asm ("fstcw (%esp)"); /* get 387 control word */
- asm ("movl (%esp),%eax"); /* save old value */
- asm ("orl $0x3f,%eax"); /* mask all exceptions */
- asm ("pushl %eax");
- asm ("fldcw (%esp)"); /* load new value into 387 */
-
- asm ("movl 8(%ebp),%eax");
- asm ("fldt (%eax)"); /* push extended number on 387 stack */
- asm ("fwait");
- asm ("movl 12(%ebp),%eax");
- asm ("fstpl (%eax)"); /* pop double */
- asm ("fwait");
-
- asm ("popl %eax"); /* flush modified control word */
- asm ("fnclex"); /* clear exceptions */
- asm ("fldcw (%esp)"); /* restore original control word */
- asm ("popl %eax"); /* flush saved copy */
-}
-
-double_to_i387 (from, to)
- char *from;
- char *to;
-{
- /* push double mode on 387 stack, then pop in extended mode
- * no errors are possible because every 64-bit pattern
- * can be converted to an extended
- */
- asm ("movl 8(%ebp),%eax");
- asm ("fldl (%eax)");
- asm ("fwait");
- asm ("movl 12(%ebp),%eax");
- asm ("fstpt (%eax)");
- asm ("fwait");
-}
-#else /* Not sun386 target. */
-
-/* These functions shouldn't be called when we're cross-debugging. */
-
-void
-fetch_inferior_registers ()
-{
-}
-
-/* ARGSUSED */
-store_inferior_registers (regno)
- int regno;
-{
-}
-
-/* ARGSUSED */
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
- char *core_reg_sect;
- unsigned core_reg_size;
- int which;
-{
-}
-
-#endif /* Not sun386 target. */
diff --git a/gdb/symfile.c b/gdb/symfile.c
deleted file mode 100644
index cf75a17..0000000
--- a/gdb/symfile.c
+++ /dev/null
@@ -1,1077 +0,0 @@
-/* Generic symbol file reading for the GNU debugger, GDB.
- Copyright 1990, 1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support, using pieces from other GDB modules.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "symtab.h"
-#include "param.h"
-#include "gdbcore.h"
-#include "frame.h"
-#include "target.h"
-#include "value.h"
-#include "symfile.h"
-#include "gdbcmd.h"
-#include "breakpoint.h"
-
-#include <obstack.h>
-#include <assert.h>
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/stat.h>
-
-CORE_ADDR entry_point; /* Where execution starts in symfile */
-
-extern int info_verbose;
-
-extern void qsort ();
-extern char *getenv ();
-extern char *rindex ();
-
-extern CORE_ADDR startup_file_start; /* From blockframe.c */
-extern CORE_ADDR startup_file_end; /* From blockframe.c */
-
-/* Functions this file defines */
-static bfd *symfile_open();
-static struct sym_fns *symfile_init();
-static void clear_symtab_users_once();
-
-/* List of all available sym_fns. */
-
-struct sym_fns *symtab_fns = NULL;
-
-/* Saves the sym_fns of the current symbol table, so we can call
- the right XXX_new_init function when we free it. FIXME. This
- should be extended to calling the new_init function for each
- existing symtab or psymtab, since the main symbol file and
- subsequent added symbol files can have different types. */
-
-static struct sym_fns *symfile_fns;
-
-/* Allocate an obstack to hold objects that should be freed
- when we load a new symbol table.
- This includes the symbols made by dbxread
- and the types that are not permanent. */
-
-struct obstack obstack1;
-
-struct obstack *symbol_obstack = &obstack1;
-
-/* This obstack will be used for partial_symbol objects. It can
- probably actually be the same as the symbol_obstack above, but I'd
- like to keep them seperate for now. If I want to later, I'll
- replace one with the other. */
-
-struct obstack obstack2;
-
-struct obstack *psymbol_obstack = &obstack2;
-
-/* File name symbols were loaded from. */
-
-char *symfile = 0;
-
-/* The modification date of the file when they were loaded. */
-
-long /* really time_t */ symfile_mtime = 0;
-
-/* Structures with which to manage partial symbol allocation. */
-
-#include "param.h"
-struct psymbol_allocation_list global_psymbols = {0}, static_psymbols = {0};
-
-/* Flag for whether user will be reloading symbols multiple times.
- Defaults to ON for VxWorks, otherwise OFF. */
-
-#ifdef SYMBOL_RELOADING_DEFAULT
-int symbol_reloading = SYMBOL_RELOADING_DEFAULT;
-#else
-int symbol_reloading = 0;
-#endif
-
-/* Structure to manage complaints about symbol file contents. */
-
-struct complaint complaint_root[1] = {
- {(char *)0, 0, complaint_root},
-};
-
-/* Some actual complaints. */
-
-struct complaint oldsyms_complaint = {
- "Replacing old symbols for `%s'", 0, 0 };
-
-struct complaint empty_symtab_complaint = {
- "Empty symbol table found for `%s'", 0, 0 };
-
-
-/* In the following sort, we always make sure that
- register debug symbol declarations always come before regular
- debug symbol declarations (as might happen when parameters are
- then put into registers by the compiler). */
-
-static int
-compare_symbols (s1, s2)
- struct symbol **s1, **s2;
-{
- register int namediff;
-
- /* Compare the initial characters. */
- namediff = SYMBOL_NAME (*s1)[0] - SYMBOL_NAME (*s2)[0];
- if (namediff != 0) return namediff;
-
- /* If they match, compare the rest of the names. */
- namediff = strcmp (SYMBOL_NAME (*s1), SYMBOL_NAME (*s2));
- if (namediff != 0) return namediff;
-
- /* For symbols of the same name, registers should come first. */
- return ((SYMBOL_CLASS (*s2) == LOC_REGISTER)
- - (SYMBOL_CLASS (*s1) == LOC_REGISTER));
-}
-
-/* Call sort_block_syms to sort alphabetically the symbols of one block. */
-
-void
-sort_block_syms (b)
- register struct block *b;
-{
- qsort (&BLOCK_SYM (b, 0), BLOCK_NSYMS (b),
- sizeof (struct symbol *), compare_symbols);
-}
-
-/* Call sort_symtab_syms to sort alphabetically
- the symbols of each block of one symtab. */
-
-void
-sort_symtab_syms (s)
- register struct symtab *s;
-{
- register struct blockvector *bv;
- int nbl;
- int i;
- register struct block *b;
-
- if (s == 0)
- return;
- bv = BLOCKVECTOR (s);
- nbl = BLOCKVECTOR_NBLOCKS (bv);
- for (i = 0; i < nbl; i++)
- {
- b = BLOCKVECTOR_BLOCK (bv, i);
- if (BLOCK_SHOULD_SORT (b))
- sort_block_syms (b);
- }
-}
-
-void
-sort_all_symtab_syms ()
-{
- register struct symtab *s;
-
- for (s = symtab_list; s; s = s->next)
- {
- sort_symtab_syms (s);
- }
-}
-
-/* Make a copy of the string at PTR with SIZE characters in the symbol obstack
- (and add a null character at the end in the copy).
- Returns the address of the copy. */
-
-char *
-obsavestring (ptr, size)
- char *ptr;
- int size;
-{
- register char *p = (char *) obstack_alloc (symbol_obstack, size + 1);
- /* Open-coded bcopy--saves function call time.
- These strings are usually short. */
- {
- register char *p1 = ptr;
- register char *p2 = p;
- char *end = ptr + size;
- while (p1 != end)
- *p2++ = *p1++;
- }
- p[size] = 0;
- return p;
-}
-
-/* Concatenate strings S1, S2 and S3; return the new string.
- Space is found in the symbol_obstack. */
-
-char *
-obconcat (s1, s2, s3)
- char *s1, *s2, *s3;
-{
- register int len = strlen (s1) + strlen (s2) + strlen (s3) + 1;
- register char *val = (char *) obstack_alloc (symbol_obstack, len);
- strcpy (val, s1);
- strcat (val, s2);
- strcat (val, s3);
- return val;
-}
-
-/* Accumulate the misc functions in bunches of 127.
- At the end, copy them all into one newly allocated structure. */
-
-#define MISC_BUNCH_SIZE 127
-
-struct misc_bunch
-{
- struct misc_bunch *next;
- struct misc_function contents[MISC_BUNCH_SIZE];
-};
-
-/* Bunch currently being filled up.
- The next field points to chain of filled bunches. */
-
-static struct misc_bunch *misc_bunch;
-
-/* Number of slots filled in current bunch. */
-
-static int misc_bunch_index;
-
-/* Total number of misc functions recorded so far. */
-
-static int misc_count;
-
-void
-init_misc_bunches ()
-{
- misc_count = 0;
- misc_bunch = 0;
- misc_bunch_index = MISC_BUNCH_SIZE;
-}
-
-void
-prim_record_misc_function (name, address, misc_type)
- char *name;
- CORE_ADDR address;
- enum misc_function_type misc_type;
-{
- register struct misc_bunch *new;
-
- if (misc_bunch_index == MISC_BUNCH_SIZE)
- {
- new = (struct misc_bunch *) xmalloc (sizeof (struct misc_bunch));
- misc_bunch_index = 0;
- new->next = misc_bunch;
- misc_bunch = new;
- }
- misc_bunch->contents[misc_bunch_index].name = name;
- misc_bunch->contents[misc_bunch_index].address = address;
- misc_bunch->contents[misc_bunch_index].type = misc_type;
- misc_bunch->contents[misc_bunch_index].misc_info = 0;
- misc_bunch_index++;
- misc_count++;
-}
-
-static int
-compare_misc_functions (fn1, fn2)
- struct misc_function *fn1, *fn2;
-{
- /* Return a signed result based on unsigned comparisons
- so that we sort into unsigned numeric order. */
- if (fn1->address < fn2->address)
- return -1;
- if (fn1->address > fn2->address)
- return 1;
- return 0;
-}
-
-/* ARGSUSED */
-void
-discard_misc_bunches (foo)
- int foo;
-{
- register struct misc_bunch *next;
-
- while (misc_bunch)
- {
- next = misc_bunch->next;
- free (misc_bunch);
- misc_bunch = next;
- }
-}
-
-/* INCLINK nonzero means bunches are from an incrementally-linked file.
- Add them to the existing bunches.
- Otherwise INCLINK is zero, and we start from scratch. */
-void
-condense_misc_bunches (inclink)
- int inclink;
-{
- register int i, j;
- register struct misc_bunch *bunch;
-
- if (inclink)
- {
- misc_function_vector
- = (struct misc_function *)
- xrealloc (misc_function_vector, (misc_count + misc_function_count)
- * sizeof (struct misc_function));
- j = misc_function_count;
- }
- else
- {
- misc_function_vector
- = (struct misc_function *)
- xmalloc (misc_count * sizeof (struct misc_function));
- j = 0;
- }
-
- bunch = misc_bunch;
- while (bunch)
- {
- for (i = 0; i < misc_bunch_index; i++, j++)
- {
- misc_function_vector[j] = bunch->contents[i];
-#ifdef NAMES_HAVE_UNDERSCORE
- if (misc_function_vector[j].name[0] == '_')
- misc_function_vector[j].name++;
-#endif
-#ifdef SOME_NAMES_HAVE_DOT
- if (misc_function_vector[j].name[0] == '.')
- misc_function_vector[j].name++;
-#endif
-
- }
- bunch = bunch->next;
- misc_bunch_index = MISC_BUNCH_SIZE;
- }
-
- if (misc_function_count + misc_count != j) /* DEBUG */
- printf_filtered ("Function counts are off! %d + %d != %d\n",
- misc_function_count, misc_count, j);
-
- misc_function_count = j;
-
- /* Sort the misc functions by address. */
-
- qsort (misc_function_vector, misc_function_count,
- sizeof (struct misc_function),
- compare_misc_functions);
-}
-
-
-/* Get the symbol table that corresponds to a partial_symtab.
- This is fast after the first time you do it. In fact, there
- is an even faster macro PSYMTAB_TO_SYMTAB that does the fast
- case inline. */
-
-struct symtab *
-psymtab_to_symtab (pst)
- register struct partial_symtab *pst;
-{
- /* If it's been looked up before, return it. */
- if (pst->symtab)
- return pst->symtab;
-
- /* If it has not yet been read in, read it. */
- if (!pst->readin)
- {
- (*pst->read_symtab) (pst);
- }
-
- return pst->symtab;
-}
-
-/* Process a symbol file, as either the main file or as a dynamically
- loaded file.
-
- NAME is the file name (which will be tilde-expanded and made
- absolute herein) (but we don't free or modify NAME itself).
- FROM_TTY says how verbose to be. MAINLINE specifies whether this
- is the main symbol file, or whether it's an extra symbol file such
- as dynamically loaded code. If !mainline, ADDR is the address
- where the text segment was loaded. */
-
-void
-syms_from_bfd (sym_bfd, addr, mainline)
- bfd *sym_bfd;
- CORE_ADDR addr;
- int mainline;
-{
- asection *text_sect;
- struct sym_fns *sf;
- char *realname;
-
- /* There is a distinction between having no symbol table
- (we refuse to read the file, leaving the old set of symbols around)
- and having no debugging symbols in your symbol table (we read
- the file and end up with a mostly empty symbol table). */
-
- if (!(bfd_get_file_flags (sym_bfd) & HAS_SYMS))
- return;
-
- /* Save startup file's range of PC addresses to help blockframe.c
- decide where the bottom of the stack is. */
- if (bfd_get_file_flags (sym_bfd) & EXEC_P)
- {
- /* Executable file -- record its entry point so we'll recognize
- the startup file because it contains the entry point. */
- entry_point = bfd_get_start_address (sym_bfd);
- }
- else
- {
- /* Examination of non-executable.o files. Short-circuit this stuff. */
- /* ~0 will not be in any file, we hope. */
- entry_point = ~0;
- /* set the startup file to be an empty range. */
- startup_file_start = 0;
- startup_file_end = 0;
- }
-
- sf = symfile_init (sym_bfd);
- realname = bfd_get_filename (sym_bfd);
- realname = savestring (realname, strlen (realname));
- /* FIXME, this probably creates a storage leak... */
-
- if (mainline)
- {
- /* Since no error yet, throw away the old symbol table. */
-
- if (symfile)
- free (symfile);
- symfile = 0;
- free_all_symtabs ();
- free_all_psymtabs ();
-
- (*sf->sym_new_init) ();
-
- /* For mainline, caller didn't know the specified address of the
- text section. We fix that here. */
- text_sect = bfd_get_section_by_name (sym_bfd, ".text");
- addr = bfd_section_vma (sym_bfd, text_sect);
- }
-
- clear_complaints(); /* Allow complaints to appear for this new file. */
-
- (*sf->sym_read) (sf, addr, mainline);
-
- /* Don't allow char * to have a typename (else would get caddr_t.) */
- /* Ditto void *. FIXME should do this for all the builtin types. */
-
- TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
- TYPE_NAME (lookup_pointer_type (builtin_type_void)) = 0;
-
- if (mainline)
- {
- /* OK, make it the "real" symbol file. */
- symfile = realname;
- symfile_fns = sf;
- }
-
- /* If we have wiped out any old symbol tables, clean up. */
- clear_symtab_users_once ();
-}
-
-
-/* Process a symbol file, as either the main file or as a dynamically
- loaded file.
-
- NAME is the file name (which will be tilde-expanded and made
- absolute herein) (but we don't free or modify NAME itself).
- FROM_TTY says how verbose to be. MAINLINE specifies whether this
- is the main symbol file, or whether it's an extra symbol file such
- as dynamically loaded code. If !mainline, ADDR is the address
- where the text segment was loaded. */
-
-void
-symbol_file_add (name, from_tty, addr, mainline)
- char *name;
- int from_tty;
- CORE_ADDR addr;
- int mainline;
-{
- bfd *sym_bfd;
-
- sym_bfd = symfile_open (name);
-
- if (mainline)
- symfile_mtime = bfd_get_mtime (sym_bfd);
-
- /* There is a distinction between having no symbol table
- (we refuse to read the file, leaving the old set of symbols around)
- and having no debugging symbols in your symbol table (we read
- the file and end up with a mostly empty symbol table). */
-
- if (!(bfd_get_file_flags (sym_bfd) & HAS_SYMS))
- {
- error ("%s has no symbol-table", name);
- }
-
- if ((symtab_list || partial_symtab_list)
- && mainline
- && from_tty
- && !query ("Load new symbol table from \"%s\"? ", name))
- error ("Not confirmed.");
-
- if (from_tty)
- {
- printf_filtered ("Reading symbols from %s...", name);
- wrap_here ("");
- fflush (stdout);
- }
-
- syms_from_bfd (sym_bfd, addr, mainline);
-
- if (from_tty)
- {
- printf_filtered ("done.\n");
- fflush (stdout);
- }
-}
-
-/* This is the symbol-file command. Read the file, analyze its symbols,
- and add a struct symtab to symtab_list. */
-
-void
-symbol_file_command (name, from_tty)
- char *name;
- int from_tty;
-{
-
- dont_repeat ();
-
- if (name == 0)
- {
- if ((symtab_list || partial_symtab_list)
- && from_tty
- && !query ("Discard symbol table from `%s'? ", symfile))
- error ("Not confirmed.");
- if (symfile)
- free (symfile);
- symfile = 0;
- free_all_symtabs ();
- free_all_psymtabs ();
- /* FIXME, this does not account for the main file and subsequent
- files (shared libs, dynloads, etc) having different formats.
- It only calls the cleanup routine for the main file's format. */
- if (symfile_fns) {
- (*symfile_fns->sym_new_init) ();
- free (symfile_fns);
- symfile_fns = 0;
- }
- return;
- }
-
- /* Getting new symbols may change our opinion about what is
- frameless. */
- reinit_frame_cache ();
-
- symbol_file_add (name, from_tty, (CORE_ADDR)0, 1);
-}
-
-/* Open NAME and hand it off to BFD for preliminary analysis. Result
- is a BFD *, which includes a new copy of NAME dynamically allocated
- (which will be freed by the cleanup chain). In case of trouble,
- error() is called. */
-
-static bfd *
-symfile_open (name)
- char *name;
-{
- bfd *sym_bfd;
- int desc;
- char *absolute_name;
-
- name = tilde_expand (name);
- make_cleanup (free, name);
-
- desc = openp (getenv ("PATH"), 1, name, O_RDONLY, 0, &absolute_name);
- if (desc < 0)
- perror_with_name (name);
- else
- {
- make_cleanup (free, absolute_name);
- name = absolute_name;
- }
-
- sym_bfd = bfd_fdopenr (name, NULL, desc);
- if (!sym_bfd)
- {
- close (desc);
- error ("Could not open `%s' to read symbols: %s",
- name, bfd_errmsg (bfd_error));
- }
- make_cleanup (bfd_close, sym_bfd);
-
- if (!bfd_check_format (sym_bfd, bfd_object))
- error ("\"%s\": can't read symbols: %s.",
- name, bfd_errmsg (bfd_error));
-
- return sym_bfd;
-}
-
-/* Link a new symtab_fns into the global symtab_fns list.
- Called by various _initialize routines. */
-
-void
-add_symtab_fns (sf)
- struct sym_fns *sf;
-{
- sf->next = symtab_fns;
- symtab_fns = sf;
-}
-
-
-/* Initialize to read symbols from the symbol file sym_bfd. It either
- returns or calls error(). The result is a malloc'd struct sym_fns
- that contains cached information about the symbol file. */
-
-static struct sym_fns *
-symfile_init (sym_bfd)
- bfd *sym_bfd;
-{
- struct sym_fns *sf, *sf2;
-
- for (sf = symtab_fns; sf != NULL; sf = sf->next)
- {
- if (!strncmp (bfd_get_target (sym_bfd), sf->sym_name, sf->sym_namelen))
- {
- sf2 = (struct sym_fns *)xmalloc (sizeof (*sf2));
- /* FIXME, who frees this? */
- *sf2 = *sf;
- sf2->sym_bfd = sym_bfd;
- sf2->sym_private = 0; /* Not alloc'd yet */
- (*sf2->sym_init) (sf2);
- return sf2;
- }
- }
- error ("I'm sorry, Dave, I can't do that. Symbol format `%s' unknown.",
- bfd_get_target (sym_bfd));
- return 0; /* Appease lint. */
-}
-
-/* This function runs the load command of our current target. */
-
-void
-load_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- target_load (arg, from_tty);
-}
-
-/* This function allows the addition of incrementally linked object files.
- It does not modify any state in the target, only in the debugger. */
-
-/* ARGSUSED */
-void
-add_symbol_file_command (arg_string, from_tty)
- char *arg_string;
- int from_tty;
-{
- char *name;
- CORE_ADDR text_addr;
-
- /* Getting new symbols may change our opinion about what is
- frameless. */
- reinit_frame_cache ();
-
- if (arg_string == 0)
- error ("add-symbol-file takes a file name and an address");
-
- arg_string = tilde_expand (arg_string);
- make_cleanup (free, arg_string);
-
- for( ; *arg_string == ' '; arg_string++ );
- name = arg_string;
- for( ; *arg_string && *arg_string != ' ' ; arg_string++ );
- *arg_string++ = (char) 0;
-
- if (name[0] == 0)
- error ("add-symbol-file takes a file name and an address");
-
- text_addr = parse_and_eval_address (arg_string);
-
- dont_repeat ();
-
- if (!query ("add symbol table from file \"%s\" at text_addr = %s?\n",
- name, local_hex_string (text_addr)))
- error ("Not confirmed.");
-
- symbol_file_add (name, 0, text_addr, 0);
-}
-
-/* Re-read symbols if the symbol-file has changed. */
-void
-reread_symbols ()
-{
- struct stat symstat;
-
- /* With the addition of shared libraries, this should be modified,
- the load time should be saved in the partial symbol tables, since
- different tables may come from different source files. FIXME.
- This routine should then walk down each partial symbol table
- and see if the symbol table that it originates from has been changed
- */
-
- if (stat (symfile, &symstat) < 0)
- /* Can't read symbol-file. Assume it is up to date. */
- return;
-
- if (symstat.st_mtime > symfile_mtime)
- {
- printf_filtered ("Symbol file has changed; re-reading symbols.\n");
- symbol_file_command (symfile, 0);
- breakpoint_re_set ();
- }
-}
-
-/* This function is really horrible, but to avoid it, there would need
- to be more filling in of forward references. */
-void
-fill_in_vptr_fieldno (type)
- struct type *type;
-{
- if (TYPE_VPTR_FIELDNO (type) < 0)
- {
- int i;
- for (i = 1; i < TYPE_N_BASECLASSES (type); i++)
- {
- fill_in_vptr_fieldno (TYPE_BASECLASS (type, i));
- if (TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, i)) >= 0)
- {
- TYPE_VPTR_FIELDNO (type)
- = TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, i));
- TYPE_VPTR_BASETYPE (type)
- = TYPE_VPTR_BASETYPE (TYPE_BASECLASS (type, i));
- break;
- }
- }
- }
-}
-
-/* Functions to handle complaints during symbol reading. */
-
-/* How many complaints about a particular thing should be printed before
- we stop whining about it? Default is no whining at all, since so many
- systems have ill-constructed symbol files. */
-
-static unsigned stop_whining = 0;
-
-/* Print a complaint about the input symbols, and link the complaint block
- into a chain for later handling. Result is 1 if the complaint was
- printed, 0 if it was suppressed. */
-
-int
-complain (complaint, val)
- struct complaint *complaint;
- char *val;
-{
- complaint->counter++;
- if (complaint->next == 0) {
- complaint->next = complaint_root->next;
- complaint_root->next = complaint;
- }
- if (complaint->counter > stop_whining)
- return 0;
- wrap_here ("");
- if (!info_verbose) {
- puts_filtered ("During symbol reading...");
- }
- printf_filtered (complaint->message, val);
- puts_filtered ("...");
- wrap_here("");
- if (!info_verbose)
- puts_filtered ("\n");
- return 1;
-}
-
-/* Clear out all complaint counters that have ever been incremented. */
-
-void
-clear_complaints ()
-{
- struct complaint *p;
-
- for (p = complaint_root->next; p != complaint_root; p = p->next)
- p->counter = 0;
-}
-
-/* allocate_symtab:
-
- Allocate and partly initialize a new symbol table. Return a pointer
- to it. error() if no space.
-
- Caller must set these fields:
- LINETABLE(symtab)
- symtab->blockvector
- symtab->dirname
- symtab->free_code
- symtab->free_ptr
- initialize any EXTRA_SYMTAB_INFO
- possibly free_named_symtabs (symtab->filename);
- symtab->next = symtab_list;
- symtab_list = symtab;
- */
-
-struct symtab *
-allocate_symtab(name)
- char *name;
-{
- register struct symtab *symtab;
- char *c;
-
- symtab = (struct symtab *) xmalloc (sizeof (struct symtab));
- bzero (symtab, sizeof (*symtab));
- symtab->filename = name;
- symtab->fullname = NULL;
- symtab->nlines = 0;
- symtab->line_charpos = 0;
- symtab->version = 0;
- symtab->language = language_unknown; /* default */
-
- c = rindex (name, '.');
-
- if (!c) {
- ; /* Don't know language of file. */
- } else if(!strcmp(c,".mod")) {
- symtab->language = language_m2;
- } else if(!strcmp(c,".c") || !strcmp(c,".cc")) {
- symtab->language = language_c;
- }
-
- return symtab;
-}
-
-/* clear_symtab_users_once:
-
- This function is run after symbol reading, or from a cleanup.
- If an old symbol table was obsoleted, the old symbol table
- has been blown away, but the other GDB data structures that may
- reference it have not yet been cleared or re-directed. (The old
- symtab was zapped, and the cleanup queued, in free_named_symtab()
- below.)
-
- This function can be queued N times as a cleanup, or called
- directly; it will do all the work the first time, and then will be a
- no-op until the next time it is queued. This works by bumping a
- counter at queueing time. Much later when the cleanup is run, or at
- the end of symbol processing (in case the cleanup is discarded), if
- the queued count is greater than the "done-count", we do the work
- and set the done-count to the queued count. If the queued count is
- less than or equal to the done-count, we just ignore the call. This
- is needed because reading a single .o file will often replace many
- symtabs (one per .h file, for example), and we don't want to reset
- the breakpoints N times in the user's face.
-
- The reason we both queue a cleanup, and call it directly after symbol
- reading, is because the cleanup protects us in case of errors, but is
- discarded if symbol reading is successful. */
-
-static int clear_symtab_users_queued;
-static int clear_symtab_users_done;
-
-static void
-clear_symtab_users_once ()
-{
- /* Enforce once-per-`do_cleanups'-semantics */
- if (clear_symtab_users_queued <= clear_symtab_users_done)
- return;
- clear_symtab_users_done = clear_symtab_users_queued;
-
- printf ("Resetting debugger state after updating old symbol tables\n");
-
- /* Someday, we should do better than this, by only blowing away
- the things that really need to be blown. */
- clear_value_history ();
- clear_displays ();
- clear_internalvars ();
- breakpoint_re_set ();
- set_default_breakpoint (0, 0, 0, 0);
- current_source_symtab = 0;
-}
-
-/* Delete the specified psymtab, and any others that reference it. */
-
-static void
-cashier_psymtab (pst)
- struct partial_symtab *pst;
-{
- struct partial_symtab *ps, *pprev;
- int i;
-
- /* Find its previous psymtab in the chain */
- for (ps = partial_symtab_list; ps; ps = ps->next) {
- if (ps == pst)
- break;
- pprev = ps;
- }
-
- if (ps) {
- /* Unhook it from the chain. */
- if (ps == partial_symtab_list)
- partial_symtab_list = ps->next;
- else
- pprev->next = ps->next;
-
- /* FIXME, we can't conveniently deallocate the entries in the
- partial_symbol lists (global_psymbols/static_psymbols) that
- this psymtab points to. These just take up space until all
- the psymtabs are reclaimed. Ditto the dependencies list and
- filename, which are all in the psymbol_obstack. */
-
- /* We need to cashier any psymtab that has this one as a dependency... */
-again:
- for (ps = partial_symtab_list; ps; ps = ps->next) {
- for (i = 0; i < ps->number_of_dependencies; i++) {
- if (ps->dependencies[i] == pst) {
- cashier_psymtab (ps);
- goto again; /* Must restart, chain has been munged. */
- }
- }
- }
- }
-}
-
-/* If a symtab or psymtab for filename NAME is found, free it along
- with any dependent breakpoints, displays, etc.
- Used when loading new versions of object modules with the "add-file"
- command. This is only called on the top-level symtab or psymtab's name;
- it is not called for subsidiary files such as .h files.
-
- Return value is 1 if we blew away the environment, 0 if not.
-
- FIXME. I think this is not the best way to do this. We should
- work on being gentler to the environment while still cleaning up
- all stray pointers into the freed symtab. */
-
-int
-free_named_symtabs (name)
- char *name;
-{
- register struct symtab *s;
- register struct symtab *prev;
- register struct partial_symtab *ps;
- struct blockvector *bv;
- int blewit = 0;
-
- /* We only wack things if the symbol-reload switch is set. */
- if (!symbol_reloading)
- return 0;
-
- /* Some symbol formats have trouble providing file names... */
- if (name == 0 || *name == '\0')
- return 0;
-
- /* Look for a psymtab with the specified name. */
-
-again2:
- for (ps = partial_symtab_list; ps; ps = ps->next) {
- if (!strcmp (name, ps->filename)) {
- cashier_psymtab (ps); /* Blow it away...and its little dog, too. */
- goto again2; /* Must restart, chain has been munged */
- }
- }
-
- /* Look for a symtab with the specified name. */
-
- for (s = symtab_list; s; s = s->next)
- {
- if (!strcmp (name, s->filename))
- break;
- prev = s;
- }
-
- if (s)
- {
- if (s == symtab_list)
- symtab_list = s->next;
- else
- prev->next = s->next;
-
- /* For now, queue a delete for all breakpoints, displays, etc., whether
- or not they depend on the symtab being freed. This should be
- changed so that only those data structures affected are deleted. */
-
- /* But don't delete anything if the symtab is empty.
- This test is necessary due to a bug in "dbxread.c" that
- causes empty symtabs to be created for N_SO symbols that
- contain the pathname of the object file. (This problem
- has been fixed in GDB 3.9x). */
-
- bv = BLOCKVECTOR (s);
- if (BLOCKVECTOR_NBLOCKS (bv) > 2
- || BLOCK_NSYMS (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK))
- || BLOCK_NSYMS (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)))
- {
- complain (&oldsyms_complaint, name);
-
- clear_symtab_users_queued++;
- make_cleanup (clear_symtab_users_once, 0);
- blewit = 1;
- } else {
- complain (&empty_symtab_complaint, name);
- }
-
- free_symtab (s);
- }
- else
- {
- /* It is still possible that some breakpoints will be affected
- even though no symtab was found, since the file might have
- been compiled without debugging, and hence not be associated
- with a symtab. In order to handle this correctly, we would need
- to keep a list of text address ranges for undebuggable files.
- For now, we do nothing, since this is a fairly obscure case. */
- ;
- }
-
- /* FIXME, what about the misc function vector? */
- return blewit;
-}
-
-void
-_initialize_symfile ()
-{
-
- add_com ("symbol-file", class_files, symbol_file_command,
- "Load symbol table from executable file FILE.\n\
-The `file' command can also load symbol tables, as well as setting the file\n\
-to execute.");
-
- add_com ("add-symbol-file", class_files, add_symbol_file_command,
- "Load the symbols from FILE, assuming FILE has been dynamically loaded.\n\
-The second argument provides the starting address of the file's text.");
-
- add_com ("load", class_files, load_command,
- "Dynamically load FILE into the running program, and record its symbols\n\
-for access from GDB.");
-
- add_show_from_set
- (add_set_cmd ("complaints", class_support, var_uinteger,
- (char *)&stop_whining,
- "Set max number of complaints about incorrect symbols.",
- &setlist),
- &showlist);
-
- add_show_from_set
- (add_set_cmd ("symbol-reloading", class_support, var_boolean,
- (char *)&symbol_reloading,
- "Set dynamic symbol table reloading multiple times in one run.",
- &setlist),
- &showlist);
-
- obstack_init (symbol_obstack);
- obstack_init (psymbol_obstack);
-}
diff --git a/gdb/symfile.h b/gdb/symfile.h
deleted file mode 100644
index 5d1c1c6..0000000
--- a/gdb/symfile.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* Definitions for reading symbol files into GDB.
- Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This file requires that you first include "bfd.h". */
-
-/* Data structures and function definitions for dealing with
- symbol table reading from files. */
-
-/* Structure to keep track of symbol reading functions for various
- object file types. */
-
-struct sym_fns {
-
- /* sym_name
- is the name, or name prefix, of the BFD "target type" that this
- set of functions handles. E.g. "a.out" or "sunOs" or "coff" or "elf". */
-
- char *sym_name;
-
- /* sym_namelen
- counts how many bytes of sym_name should be checked against the
- BFD target type of the file being read. If an exact match is
- desired, specify the number of characters in sym_name plus 1 for the
- NUL. If a prefix match is desired, specify the number of characters in
- sym_name. */
-
- int sym_namelen;
-
- /* sym_new_init
- initializes anything that is global to the entire
- symbol table. It is called during symbol_file_add, when
- we begin debugging an entirely new program. */
-
- void (*sym_new_init) ();
-
- /* sym_init (sf)
- reads any initial information from a symbol file, and
- initializes the struct sym_fns SF in preparation for sym_read().
- It is called every time we read a symbol file for any reason. */
-
- void (*sym_init) ();
-
- /* sym_read (sf, addr, mainline)
- reads a symbol file into a psymtab (or possibly a symtab).
- SF is the struct sym_fns that sym_init initialized. ADDR
- is the offset between the file's specified start address and
- its true address in memory. MAINLINE is 1 if this is the
- main symbol table being read, and 0 if a secondary
- symbol file (e.g. shared library or dynamically loaded file)
- is being read. */
-
- void (*sym_read) ();
-
- /* sym_bfd
- is the accessor for the symbol file being read. */
-
- bfd *sym_bfd;
-
- /* sym_private
- is where information can be shared among sym_init and sym_read.
- It is typically a pointer to malloc'd memory. */
-
- char *sym_private; /* Should be void * */
-
- /* next
- finds the next struct sym_fns. They are allocated and initialized
- in whatever module implements the functions pointed to; an
- initializer calls add_symtab_fns to add them to the global chain. */
- struct sym_fns *next;
-};
-
- /* Functions */
-
-extern struct symtab *allocate_symtab ();
-extern int free_named_symtabs ();
-extern void fill_in_vptr_fieldno ();
-extern void add_symtab_fns ();
-
-/* Functions for dealing with the misc "function" vector, really a misc
- address<->symbol mapping vector for things we don't have debug symbols
- for. */
-
-extern void init_misc_bunches ();
-extern void prim_record_misc_function ();
-extern void discard_misc_bunches ();
-extern void condense_misc_bunches ();
-
-/* Sorting your symbols for fast lookup or alphabetical printing. */
-
-extern void sort_block_syms ();
-extern void sort_symtab_syms ();
-extern void sort_all_symtab_syms ();
-extern void sort_block_syms ();
-
-/* Make a copy of the string at PTR with SIZE characters in the symbol obstack
- (and add a null character at the end in the copy).
- Returns the address of the copy. */
-
-extern char *obsavestring ();
-
-/* Concatenate strings S1, S2 and S3; return the new string.
- Space is found in the symbol_obstack. */
-
-extern char *obconcat ();
-
- /* Variables */
-
-/* File name symbols were loaded from. */
-
-extern char *symfile;
-
-/* The modification date of the file when they were loaded. */
-
-extern long /* really time_t */ symfile_mtime;
-
-/* Vectors of all partial symbols read in from file. */
-
-extern struct psymbol_allocation_list {
- struct partial_symbol *list, *next;
- int size;
-} global_psymbols, static_psymbols;
-
-/* Support for complaining about things in the symbol file that aren't
- catastrophic.
-
- Each such thing gets a counter. The first time we have the problem,
- during a symbol read, we report it. At the end of symbol reading,
- if verbose, we report how many of each problem we had. */
-
-struct complaint {
- char *message;
- unsigned counter;
- struct complaint *next;
-};
-
-/* Root of the chain of complaints that have at some point been issued.
- This is used to reset the counters, and/or report the total counts. */
-
-extern struct complaint complaint_root[1];
-
-/* Functions that handle complaints. (in symfile.c) */
-
-int complain();
-void clear_complaints();
diff --git a/gdb/symm-tdep.c b/gdb/symm-tdep.c
deleted file mode 100644
index d7d5def..0000000
--- a/gdb/symm-tdep.c
+++ /dev/null
@@ -1,494 +0,0 @@
-/* Sequent Symmetry target interface, for GDB when running under Unix.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* many 387-specific items of use taken from i386-dep.c */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-
-#include <signal.h>
-#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/dir.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include "gdbcore.h"
-#include <fcntl.h>
-
-static long i386_get_frame_setup ();
-static i386_follow_jump ();
-
-#include <sgtty.h>
-#define TERMINAL struct sgttyb
-
-exec_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
-
- /* Eliminate all traces of old exec file.
- Mark text segment as empty. */
-
- if (execfile)
- free (execfile);
- execfile = 0;
- data_start = 0;
- data_end -= exec_data_start;
- text_start = 0;
- text_end = 0;
- exec_data_start = 0;
- exec_data_end = 0;
- if (execchan >= 0)
- close (execchan);
- execchan = -1;
-
- /* Now open and digest the file the user requested, if any. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
- &execfile);
- if (execchan < 0)
- perror_with_name (filename);
-
-#ifdef COFF_FORMAT
- {
- int aout_hdrsize;
- int num_sections;
-
- if (read_file_hdr (execchan, &file_hdr) < 0)
- error ("\"%s\": not in executable format.", execfile);
-
- aout_hdrsize = file_hdr.f_opthdr;
- num_sections = file_hdr.f_nscns;
-
- if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
- error ("\"%s\": can't read optional aouthdr", execfile);
-
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
- aout_hdrsize) < 0)
- error ("\"%s\": can't read text section header", execfile);
-
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
- aout_hdrsize) < 0)
- error ("\"%s\": can't read data section header", execfile);
-
- text_start = exec_aouthdr.text_start;
- text_end = text_start + exec_aouthdr.tsize;
- text_offset = text_hdr.s_scnptr;
- exec_data_start = exec_aouthdr.data_start;
- exec_data_end = exec_data_start + exec_aouthdr.dsize;
- exec_data_offset = data_hdr.s_scnptr;
- data_start = exec_data_start;
- data_end += exec_data_start;
- exec_mtime = file_hdr.f_timdat;
- }
-#else /* not COFF_FORMAT */
- {
- struct stat st_exec;
-
- val = myread (execchan, &exec_aouthdr, sizeof (AOUTHDR));
-
- if (val < 0)
- perror_with_name (filename);
-
- text_start = N_ADDRADJ(exec_aouthdr);
- exec_data_start = round(exec_aouthdr.a_text, NBPG*CLSIZE);
- text_offset = N_TXTOFF (exec_aouthdr);
- exec_data_offset = N_TXTOFF (exec_aouthdr) + exec_aouthdr.a_text;
- text_end = exec_aouthdr.a_text;
- exec_data_end = exec_data_start + exec_aouthdr.a_data;
- data_start = exec_data_start;
- data_end = data_start + exec_aouthdr.a_data;
- exec_data_offset = N_TXTOFF(exec_aouthdr);
- fstat (execchan, &st_exec);
- exec_mtime = st_exec.st_mtime;
- }
-#endif /* not COFF_FORMAT */
-
- validate_files ();
- }
- else if (from_tty)
- printf ("No exec file now.\n");
-
- /* Tell display code (if any) about the changed file name. */
- if (exec_file_display_hook)
- (*exec_file_display_hook) (filename);
-}
-
-/* rounds 'one' up to divide evenly by 'two' */
-
-int
-round(one,two)
-register int one, two;
-
-{
- register int temp;
- temp = (one/two)*two;
- if (one != temp) {
- temp += two;
- }
- return temp;
-}
-
-
-static CORE_ADDR codestream_next_addr;
-static CORE_ADDR codestream_addr;
-static unsigned char codestream_buf[sizeof (int)];
-static int codestream_off;
-static int codestream_cnt;
-
-#define codestream_tell() (codestream_addr + codestream_off)
-#define codestream_peek() (codestream_cnt == 0 ? \
- codestream_fill(1): codestream_buf[codestream_off])
-#define codestream_get() (codestream_cnt-- == 0 ? \
- codestream_fill(0) : codestream_buf[codestream_off++])
-
-
-static unsigned char
-codestream_fill (peek_flag)
-{
- codestream_addr = codestream_next_addr;
- codestream_next_addr += sizeof (int);
- codestream_off = 0;
- codestream_cnt = sizeof (int);
- read_memory (codestream_addr,
- (unsigned char *)codestream_buf,
- sizeof (int));
-
- if (peek_flag)
- return (codestream_peek());
- else
- return (codestream_get());
-}
-
-static void
-codestream_seek (place)
-{
- codestream_next_addr = place & -sizeof (int);
- codestream_cnt = 0;
- codestream_fill (1);
- while (codestream_tell() != place)
- codestream_get ();
-}
-
-static void
-codestream_read (buf, count)
- unsigned char *buf;
-{
- unsigned char *p;
- int i;
- p = buf;
- for (i = 0; i < count; i++)
- *p++ = codestream_get ();
-}
-
-/*
- * Following macro translates i386 opcode register numbers to Symmetry
- * register numbers. This is used by FRAME_FIND_SAVED_REGS.
- *
- * %eax %ecx %edx %ebx %esp %ebp %esi %edi
- * i386 0 1 2 3 4 5 6 7
- * Symmetry 0 2 1 5 14 15 6 7
- *
- */
-#define I386_REGNO_TO_SYMMETRY(n) \
-((n)==0?0 :(n)==1?2 :(n)==2?1 :(n)==3?5 :(n)==4?14 :(n)==5?15 :(n))
-
-/* from i386-dep.c */
-i386_frame_find_saved_regs (fip, fsrp)
- struct frame_info *fip;
- struct frame_saved_regs *fsrp;
-{
- unsigned long locals;
- unsigned char *p;
- unsigned char op;
- CORE_ADDR dummy_bottom;
- CORE_ADDR adr;
- int i;
-
- bzero (fsrp, sizeof *fsrp);
-
- /* if frame is the end of a dummy, compute where the
- * beginning would be
- */
- dummy_bottom = fip->frame - 4 - NUM_REGS*4 - CALL_DUMMY_LENGTH;
-
- /* check if the PC is in the stack, in a dummy frame */
- if (dummy_bottom <= fip->pc && fip->pc <= fip->frame)
- {
- /* all regs were saved by push_call_dummy () */
- adr = fip->frame - 4;
- for (i = 0; i < NUM_REGS; i++)
- {
- fsrp->regs[i] = adr;
- adr -= 4;
- }
- return;
- }
-
- locals = i386_get_frame_setup (get_pc_function_start (fip->pc));
-
- if (locals >= 0)
- {
- adr = fip->frame - 4 - locals;
- for (i = 0; i < 8; i++)
- {
- op = codestream_get ();
- if (op < 0x50 || op > 0x57)
- break;
- fsrp->regs[I386_REGNO_TO_SYMMETRY(op - 0x50)] = adr;
- adr -= 4;
- }
- }
-
- fsrp->regs[PC_REGNUM] = fip->frame + 4;
- fsrp->regs[FP_REGNUM] = fip->frame;
-}
-
-static long
-i386_get_frame_setup (pc)
-{
- unsigned char op;
-
- codestream_seek (pc);
-
- i386_follow_jump ();
-
- op = codestream_get ();
-
- if (op == 0x58) /* popl %eax */
- {
- /*
- * this function must start with
- *
- * popl %eax 0x58
- * xchgl %eax, (%esp) 0x87 0x04 0x24
- * or xchgl %eax, 0(%esp) 0x87 0x44 0x24 0x00
- *
- * (the system 5 compiler puts out the second xchg
- * inst, and the assembler doesn't try to optimize it,
- * so the 'sib' form gets generated)
- *
- * this sequence is used to get the address of the return
- * buffer for a function that returns a structure
- */
- int pos;
- unsigned char buf[4];
- static unsigned char proto1[3] = { 0x87,0x04,0x24 };
- static unsigned char proto2[4] = { 0x87,0x44,0x24,0x00 };
- pos = codestream_tell ();
- codestream_read (buf, 4);
- if (bcmp (buf, proto1, 3) == 0)
- pos += 3;
- else if (bcmp (buf, proto2, 4) == 0)
- pos += 4;
-
- codestream_seek (pos);
- op = codestream_get (); /* update next opcode */
- }
-
- if (op == 0x55) /* pushl %esp */
- {
- if (codestream_get () != 0x8b) /* movl %esp, %ebp (2bytes) */
- return (-1);
- if (codestream_get () != 0xec)
- return (-1);
- /*
- * check for stack adjustment
- *
- * subl $XXX, %esp
- *
- * note: you can't subtract a 16 bit immediate
- * from a 32 bit reg, so we don't have to worry
- * about a data16 prefix
- */
- op = codestream_peek ();
- if (op == 0x83) /* subl with 8 bit immed */
- {
- codestream_get ();
- if (codestream_get () != 0xec)
- return (-1);
- /* subl with signed byte immediate
- * (though it wouldn't make sense to be negative)
- */
- return (codestream_get());
- }
- else if (op == 0x81) /* subl with 32 bit immed */
- {
- int locals;
- if (codestream_get () != 0xec)
- return (-1);
- /* subl with 32 bit immediate */
- codestream_read ((unsigned char *)&locals, 4);
- return (locals);
- }
- else
- {
- return (0);
- }
- }
- else if (op == 0xc8)
- {
- /* enter instruction: arg is 16 unsigned immed */
- unsigned short slocals;
- codestream_read ((unsigned char *)&slocals, 2);
- codestream_get (); /* flush final byte of enter instruction */
- return (slocals);
- }
- return (-1);
-}
-
-/* next instruction is a jump, move to target */
-static
-i386_follow_jump ()
-{
- int long_delta;
- short short_delta;
- char byte_delta;
- int data16;
- int pos;
-
- pos = codestream_tell ();
-
- data16 = 0;
- if (codestream_peek () == 0x66)
- {
- codestream_get ();
- data16 = 1;
- }
-
- switch (codestream_get ())
- {
- case 0xe9:
- /* relative jump: if data16 == 0, disp32, else disp16 */
- if (data16)
- {
- codestream_read ((unsigned char *)&short_delta, 2);
- pos += short_delta + 3; /* include size of jmp inst */
- }
- else
- {
- codestream_read ((unsigned char *)&long_delta, 4);
- pos += long_delta + 5;
- }
- break;
- case 0xeb:
- /* relative jump, disp8 (ignore data16) */
- codestream_read ((unsigned char *)&byte_delta, 1);
- pos += byte_delta + 2;
- break;
- }
- codestream_seek (pos + data16);
-}
-
-/* return pc of first real instruction */
-/* from i386-dep.c */
-
-i386_skip_prologue (pc)
-{
- unsigned char op;
- int i;
-
- if (i386_get_frame_setup (pc) < 0)
- return (pc);
-
- /* found valid frame setup - codestream now points to
- * start of push instructions for saving registers
- */
-
- /* skip over register saves */
- for (i = 0; i < 8; i++)
- {
- op = codestream_peek ();
- /* break if not pushl inst */
- if (op < 0x50 || op > 0x57)
- break;
- codestream_get ();
- }
-
- i386_follow_jump ();
-
- return (codestream_tell ());
-}
-
-symmetry_extract_return_value(type, regbuf, valbuf)
- struct type *type;
- char *regbuf;
- char *valbuf;
-{
- union {
- double d;
- int l[2];
- } xd;
- int i;
- float f;
-
- if (TYPE_CODE_FLT == TYPE_CODE(type)) {
- for (i = 0; i < misc_function_count; i++) {
- if (!strcmp(misc_function_vector[i].name, "1167_flt"))
- break;
- }
- if (i < misc_function_count) {
- /* found "1167_flt" means 1167, %fp2-%fp3 */
- /* float & double; 19= %fp2, 20= %fp3 */
- /* no single precision on 1167 */
- xd.l[1] = *((int *)&regbuf[REGISTER_BYTE(19)]);
- xd.l[0] = *((int *)&regbuf[REGISTER_BYTE(20)]);
- switch (TYPE_LENGTH(type)) {
- case 4:
- f = (float) xd.d;
- bcopy(&f, valbuf, TYPE_LENGTH(type));
- break;
- case 8:
- bcopy(&xd.d, valbuf, TYPE_LENGTH(type));
- break;
- default:
- error("Unknown floating point size");
- break;
- }
- } else {
- /* 387 %st(0), gcc uses this */
- i387_to_double(((int *)&regbuf[REGISTER_BYTE(3)]),
- &xd.d);
- switch (TYPE_LENGTH(type)) {
- case 4: /* float */
- f = (float) xd.d;
- bcopy(&f, valbuf, 4);
- break;
- case 8: /* double */
- bcopy(&xd.d, valbuf, 8);
- break;
- default:
- error("Unknown floating point size");
- break;
- }
- }
- } else {
- bcopy (regbuf, valbuf, TYPE_LENGTH (type));
- }
-}
diff --git a/gdb/symm-xdep.c b/gdb/symm-xdep.c
deleted file mode 100644
index 2871307..0000000
--- a/gdb/symm-xdep.c
+++ /dev/null
@@ -1,448 +0,0 @@
-/* Sequent Symmetry host interface, for GDB when running under Unix.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* FIXME, some 387-specific items of use taken from i387-tdep.c -- ought to be
- merged back in. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-
-#include <signal.h>
-#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/dir.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include "gdbcore.h"
-#include <fcntl.h>
-#include <sgtty.h>
-#define TERMINAL struct sgttyb
-
-extern void print_387_control_word ();
-extern void print_387_status_word ();
-extern void i387_to_double (from, to);
-
-store_inferior_registers(regno)
-int regno;
-{
- struct pt_regset regs;
- int reg_tmp, i;
- extern char registers[];
-
-#if 0
- /* PREPARE_TO_STORE deals with this. */
- if (-1 == regno)
- {
-#endif
- regs.pr_eax = *(int *)&registers[REGISTER_BYTE(0)];
- regs.pr_ebx = *(int *)&registers[REGISTER_BYTE(5)];
- regs.pr_ecx = *(int *)&registers[REGISTER_BYTE(2)];
- regs.pr_edx = *(int *)&registers[REGISTER_BYTE(1)];
- regs.pr_esi = *(int *)&registers[REGISTER_BYTE(6)];
- regs.pr_edi = *(int *)&registers[REGISTER_BYTE(7)];
- regs.pr_esp = *(int *)&registers[REGISTER_BYTE(14)];
- regs.pr_ebp = *(int *)&registers[REGISTER_BYTE(15)];
- regs.pr_eip = *(int *)&registers[REGISTER_BYTE(16)];
- regs.pr_flags = *(int *)&registers[REGISTER_BYTE(17)];
- for (i = 0; i < 31; i++) {
- regs.pr_fpa.fpa_regs[i] =
- *(int *)&registers[REGISTER_BYTE(FP1_REGNUM+i)];
- }
-#if 0
- }
- else
- {
- reg_tmp = *(int *)&registers[REGISTER_BYTE(regno)];
- ptrace(XPT_RREGS, inferior_pid, &regs, 0);
- switch (regno)
- {
- case 0:
- regs.pr_eax = *(int *)&registers[REGISTER_BYTE(0)];
- break;
- case 5:
- regs.pr_ebx = *(int *)&registers[REGISTER_BYTE(5)];
- break;
- case 2:
- regs.pr_ecx = *(int *)&registers[REGISTER_BYTE(2)];
- break;
- case 1:
- regs.pr_edx = *(int *)&registers[REGISTER_BYTE(1)];
- break;
- case 6:
- regs.pr_esi = *(int *)&registers[REGISTER_BYTE(6)];
- break;
- case 7:
- regs.pr_edi = *(int *)&registers[REGISTER_BYTE(7)];
- break;
- case 15:
- regs.pr_ebp = *(int *)&registers[REGISTER_BYTE(15)];
- break;
- case 14:
- regs.pr_esp = *(int *)&registers[REGISTER_BYTE(14)];
- break;
- case 16:
- regs.pr_eip = *(int *)&registers[REGISTER_BYTE(16)];
- break;
- case 17:
- regs.pr_flags = *(int *)&registers[REGISTER_BYTE(17)];
- break;
- }
- }
-#endif /* 0 */
- ptrace(XPT_WREGS, inferior_pid, &regs, 0);
-}
-
-void
-fetch_inferior_registers()
-{
- int i;
- struct pt_regset regs;
- extern char registers[];
-
- registers_fetched ();
-
- ptrace(XPT_RREGS, inferior_pid, &regs, 0);
- *(int *)&registers[REGISTER_BYTE(0)] = regs.pr_eax;
- *(int *)&registers[REGISTER_BYTE(5)] = regs.pr_ebx;
- *(int *)&registers[REGISTER_BYTE(2)] = regs.pr_ecx;
- *(int *)&registers[REGISTER_BYTE(1)] = regs.pr_edx;
- *(int *)&registers[REGISTER_BYTE(6)] = regs.pr_esi;
- *(int *)&registers[REGISTER_BYTE(7)] = regs.pr_edi;
- *(int *)&registers[REGISTER_BYTE(15)] = regs.pr_ebp;
- *(int *)&registers[REGISTER_BYTE(14)] = regs.pr_esp;
- *(int *)&registers[REGISTER_BYTE(16)] = regs.pr_eip;
- *(int *)&registers[REGISTER_BYTE(17)] = regs.pr_flags;
- for (i = 0; i < FPA_NREGS; i++) {
- *(int *)&registers[REGISTER_BYTE(FP1_REGNUM+i)] = regs.pr_fpa.fpa_regs[i];
- }
- bcopy(regs.pr_fpu.fpu_stack[0], &registers[REGISTER_BYTE(3)], 10);
- bcopy(regs.pr_fpu.fpu_stack[1], &registers[REGISTER_BYTE(4)], 10);
- bcopy(regs.pr_fpu.fpu_stack[2], &registers[REGISTER_BYTE(8)], 10);
- bcopy(regs.pr_fpu.fpu_stack[3], &registers[REGISTER_BYTE(9)], 10);
- bcopy(regs.pr_fpu.fpu_stack[4], &registers[REGISTER_BYTE(10)], 10);
- bcopy(regs.pr_fpu.fpu_stack[5], &registers[REGISTER_BYTE(11)], 10);
- bcopy(regs.pr_fpu.fpu_stack[6], &registers[REGISTER_BYTE(12)], 10);
- bcopy(regs.pr_fpu.fpu_stack[7], &registers[REGISTER_BYTE(13)], 10);
-}
-
-
-/* Work with core dump and executable files, for GDB.
- This code would be in core.c if it weren't machine-dependent. */
-
-#include "gdbcore.h"
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- extern char registers[];
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
- /* 4.2-style (and perhaps also sysV-style) core dump file. */
- {
- struct user u;
- int reg_offset;
-
- val = myread (corechan, &u, sizeof u);
- if (val < 0)
- perror_with_name (filename);
- data_start = exec_data_start;
-
- data_end = data_start + NBPG * (u.u_dsize - u.u_tsize);
- stack_start = stack_end - NBPG * u.u_ssize;
- data_offset = NBPG * UPAGES;
- stack_offset = ctob(UPAGES + u.u_dsize - u.u_tsize);
- reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
-printf("u.u_tsize= %#x, u.u_dsize= %#x, u.u_ssize= %#x, stack_off= %#x\n",
- u.u_tsize, u.u_dsize, u.u_ssize, stack_offset);
-
- core_aouthdr.a_magic = 0;
-
- /* Read the register values out of the core file and store
- them where `read_register' will find them. */
-
- {
- register int regno;
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- char buf[MAX_REGISTER_RAW_SIZE];
-
- val = lseek (corechan, register_addr (regno, reg_offset), 0);
- if (val < 0)
- perror_with_name (filename);
-
- val = myread (corechan, buf, sizeof buf);
- if (val < 0)
- perror_with_name (filename);
- supply_register (regno, buf);
- }
- }
- }
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- {
- corefile = concat (current_directory, "/", filename, NULL);
- }
-
- set_current_frame(create_new_frame(read_register(FP_REGNUM),
- read_pc()));
-/* set_current_frame (read_register (FP_REGNUM));*/
- select_frame (get_current_frame (), 0);
- validate_files ();
- }
- else if (from_tty)
- printf ("No core file now.\n");
-}
-
-/* FIXME: This should be merged with i387-tdep.c as well. */
-static
-print_fpu_status(ep)
-struct pt_regset ep;
-{
- int i;
- int bothstatus;
- int top;
- int fpreg;
- unsigned char *p;
-
- printf("80387:");
- if (ep.pr_fpu.fpu_ip == 0) {
- printf(" not in use.\n");
- return;
- } else {
- printf("\n");
- }
- if (ep.pr_fpu.fpu_status != 0) {
- print_387_status_word (ep.pr_fpu.fpu_status);
- }
- print_387_control_word (ep.pr_fpu.fpu_control);
- printf ("last exception: ");
- printf ("opcode 0x%x; ", ep.pr_fpu.fpu_rsvd4);
- printf ("pc 0x%x:0x%x; ", ep.pr_fpu.fpu_cs, ep.pr_fpu.fpu_ip);
- printf ("operand 0x%x:0x%x\n", ep.pr_fpu.fpu_data_offset, ep.pr_fpu.fpu_op_sel);
-
- top = (ep.pr_fpu.fpu_status >> 11) & 7;
-
- printf ("regno tag msb lsb value\n");
- for (fpreg = 7; fpreg >= 0; fpreg--)
- {
- double val;
-
- printf ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
-
- switch ((ep.pr_fpu.fpu_tag >> (fpreg * 2)) & 3)
- {
- case 0: printf ("valid "); break;
- case 1: printf ("zero "); break;
- case 2: printf ("trap "); break;
- case 3: printf ("empty "); break;
- }
- for (i = 9; i >= 0; i--)
- printf ("%02x", ep.pr_fpu.fpu_stack[fpreg][i]);
-
- i387_to_double (ep.pr_fpu.fpu_stack[fpreg], (char *)&val);
- printf (" %g\n", val);
- }
- if (ep.pr_fpu.fpu_rsvd1)
- printf ("warning: rsvd1 is 0x%x\n", ep.pr_fpu.fpu_rsvd1);
- if (ep.pr_fpu.fpu_rsvd2)
- printf ("warning: rsvd2 is 0x%x\n", ep.pr_fpu.fpu_rsvd2);
- if (ep.pr_fpu.fpu_rsvd3)
- printf ("warning: rsvd3 is 0x%x\n", ep.pr_fpu.fpu_rsvd3);
- if (ep.pr_fpu.fpu_rsvd5)
- printf ("warning: rsvd5 is 0x%x\n", ep.pr_fpu.fpu_rsvd5);
-}
-
-
-print_1167_control_word(pcr)
-unsigned int pcr;
-
-{
- int pcr_tmp;
-
- pcr_tmp = pcr & FPA_PCR_MODE;
- printf("\tMODE= %#x; RND= %#x ", pcr_tmp, pcr_tmp & 12);
- switch (pcr_tmp & 12) {
- case 0:
- printf("RN (Nearest Value)");
- break;
- case 1:
- printf("RZ (Zero)");
- break;
- case 2:
- printf("RP (Positive Infinity)");
- break;
- case 3:
- printf("RM (Negative Infinity)");
- break;
- }
- printf("; IRND= %d ", pcr_tmp & 2);
- if (0 == pcr_tmp & 2) {
- printf("(same as RND)\n");
- } else {
- printf("(toward zero)\n");
- }
- pcr_tmp = pcr & FPA_PCR_EM;
- printf("\tEM= %#x", pcr_tmp);
- if (pcr_tmp & FPA_PCR_EM_DM) printf(" DM");
- if (pcr_tmp & FPA_PCR_EM_UOM) printf(" UOM");
- if (pcr_tmp & FPA_PCR_EM_PM) printf(" PM");
- if (pcr_tmp & FPA_PCR_EM_UM) printf(" UM");
- if (pcr_tmp & FPA_PCR_EM_OM) printf(" OM");
- if (pcr_tmp & FPA_PCR_EM_ZM) printf(" ZM");
- if (pcr_tmp & FPA_PCR_EM_IM) printf(" IM");
- printf("\n");
- pcr_tmp = FPA_PCR_CC;
- printf("\tCC= %#x", pcr_tmp);
- if (pcr_tmp & FPA_PCR_20MHZ) printf(" 20MHZ");
- if (pcr_tmp & FPA_PCR_CC_Z) printf(" Z");
- if (pcr_tmp & FPA_PCR_CC_C2) printf(" C2");
- if (pcr_tmp & FPA_PCR_CC_C1) printf(" C1");
- switch (pcr_tmp) {
- case FPA_PCR_CC_Z:
- printf(" (Equal)");
- break;
- case FPA_PCR_CC_C1:
- printf(" (Less than)");
- break;
- case 0:
- printf(" (Greater than)");
- break;
- case FPA_PCR_CC_Z | FPA_PCR_CC_C1 | FPA_PCR_CC_C2:
- printf(" (Unordered)");
- break;
- default:
- printf(" (Undefined)");
- break;
- }
- printf("\n");
- pcr_tmp = pcr & FPA_PCR_AE;
- printf("\tAE= %#x", pcr_tmp);
- if (pcr_tmp & FPA_PCR_AE_DE) printf(" DE");
- if (pcr_tmp & FPA_PCR_AE_UOE) printf(" UOE");
- if (pcr_tmp & FPA_PCR_AE_PE) printf(" PE");
- if (pcr_tmp & FPA_PCR_AE_UE) printf(" UE");
- if (pcr_tmp & FPA_PCR_AE_OE) printf(" OE");
- if (pcr_tmp & FPA_PCR_AE_ZE) printf(" ZE");
- if (pcr_tmp & FPA_PCR_AE_EE) printf(" EE");
- if (pcr_tmp & FPA_PCR_AE_IE) printf(" IE");
- printf("\n");
-}
-
-print_1167_regs(regs)
-long regs[FPA_NREGS];
-
-{
- int i;
-
- union {
- double d;
- long l[2];
- } xd;
- union {
- float f;
- long l;
- } xf;
-
-
- for (i = 0; i < FPA_NREGS; i++) {
- xf.l = regs[i];
- printf("%%fp%d: raw= %#x, single= %f", i+1, regs[i], xf.f);
- if (!(i & 1)) {
- printf("\n");
- } else {
- xd.l[1] = regs[i];
- xd.l[0] = regs[i+1];
- printf(", double= %f\n", xd.d);
- }
- }
-}
-
-print_fpa_status(ep)
-struct pt_regset ep;
-
-{
-
- printf("WTL 1167:");
- if (ep.pr_fpa.fpa_pcr !=0) {
- printf("\n");
- print_1167_control_word(ep.pr_fpa.fpa_pcr);
- print_1167_regs(ep.pr_fpa.fpa_regs);
- } else {
- printf(" not in use.\n");
- }
-}
-
-i386_float_info ()
-{
- char ubuf[UPAGES*NBPG];
- struct pt_regset regset;
- extern int corechan;
-
- if (have_inferior_p()) {
- call_ptrace(XPT_RREGS, inferior_pid, &regset, 0);
- } else {
- if (lseek (corechan, 0, 0) < 0) {
- perror ("seek on core file");
- }
- if (myread (corechan, ubuf, UPAGES*NBPG) < 0) {
- perror ("read on core file");
- }
- /* only interested in the floating point registers */
- regset.pr_fpu = ((struct user *) ubuf)->u_fpusave;
- regset.pr_fpa = ((struct user *) ubuf)->u_fpasave;
- }
- print_fpu_status(regset);
- print_fpa_status(regset);
-}
diff --git a/gdb/symmetry-tdep.c b/gdb/symmetry-tdep.c
deleted file mode 100755
index aba21c3..0000000
--- a/gdb/symmetry-tdep.c
+++ /dev/null
@@ -1,494 +0,0 @@
-/* Sequent Symmetry target interface, for GDB when running under Unix.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* many 387-specific items of use taken from i386-dep.c */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-
-#include <signal.h>
-#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/dir.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include "gdbcore.h"
-#include <fcntl.h>
-
-static long i386_get_frame_setup ();
-static i386_follow_jump ();
-
-#include <sgtty.h>
-#define TERMINAL struct sgttyb
-
-exec_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
-
- /* Eliminate all traces of old exec file.
- Mark text segment as empty. */
-
- if (execfile)
- free (execfile);
- execfile = 0;
- data_start = 0;
- data_end -= exec_data_start;
- text_start = 0;
- text_end = 0;
- exec_data_start = 0;
- exec_data_end = 0;
- if (execchan >= 0)
- close (execchan);
- execchan = -1;
-
- /* Now open and digest the file the user requested, if any. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
- &execfile);
- if (execchan < 0)
- perror_with_name (filename);
-
-#ifdef COFF_FORMAT
- {
- int aout_hdrsize;
- int num_sections;
-
- if (read_file_hdr (execchan, &file_hdr) < 0)
- error ("\"%s\": not in executable format.", execfile);
-
- aout_hdrsize = file_hdr.f_opthdr;
- num_sections = file_hdr.f_nscns;
-
- if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
- error ("\"%s\": can't read optional aouthdr", execfile);
-
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
- aout_hdrsize) < 0)
- error ("\"%s\": can't read text section header", execfile);
-
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
- aout_hdrsize) < 0)
- error ("\"%s\": can't read data section header", execfile);
-
- text_start = exec_aouthdr.text_start;
- text_end = text_start + exec_aouthdr.tsize;
- text_offset = text_hdr.s_scnptr;
- exec_data_start = exec_aouthdr.data_start;
- exec_data_end = exec_data_start + exec_aouthdr.dsize;
- exec_data_offset = data_hdr.s_scnptr;
- data_start = exec_data_start;
- data_end += exec_data_start;
- exec_mtime = file_hdr.f_timdat;
- }
-#else /* not COFF_FORMAT */
- {
- struct stat st_exec;
-
- val = myread (execchan, &exec_aouthdr, sizeof (AOUTHDR));
-
- if (val < 0)
- perror_with_name (filename);
-
- text_start = N_ADDRADJ(exec_aouthdr);
- exec_data_start = round(exec_aouthdr.a_text, NBPG*CLSIZE);
- text_offset = N_TXTOFF (exec_aouthdr);
- exec_data_offset = N_TXTOFF (exec_aouthdr) + exec_aouthdr.a_text;
- text_end = exec_aouthdr.a_text;
- exec_data_end = exec_data_start + exec_aouthdr.a_data;
- data_start = exec_data_start;
- data_end = data_start + exec_aouthdr.a_data;
- exec_data_offset = N_TXTOFF(exec_aouthdr);
- fstat (execchan, &st_exec);
- exec_mtime = st_exec.st_mtime;
- }
-#endif /* not COFF_FORMAT */
-
- validate_files ();
- }
- else if (from_tty)
- printf ("No exec file now.\n");
-
- /* Tell display code (if any) about the changed file name. */
- if (exec_file_display_hook)
- (*exec_file_display_hook) (filename);
-}
-
-/* rounds 'one' up to divide evenly by 'two' */
-
-int
-round(one,two)
-register int one, two;
-
-{
- register int temp;
- temp = (one/two)*two;
- if (one != temp) {
- temp += two;
- }
- return temp;
-}
-
-
-static CORE_ADDR codestream_next_addr;
-static CORE_ADDR codestream_addr;
-static unsigned char codestream_buf[sizeof (int)];
-static int codestream_off;
-static int codestream_cnt;
-
-#define codestream_tell() (codestream_addr + codestream_off)
-#define codestream_peek() (codestream_cnt == 0 ? \
- codestream_fill(1): codestream_buf[codestream_off])
-#define codestream_get() (codestream_cnt-- == 0 ? \
- codestream_fill(0) : codestream_buf[codestream_off++])
-
-
-static unsigned char
-codestream_fill (peek_flag)
-{
- codestream_addr = codestream_next_addr;
- codestream_next_addr += sizeof (int);
- codestream_off = 0;
- codestream_cnt = sizeof (int);
- read_memory (codestream_addr,
- (unsigned char *)codestream_buf,
- sizeof (int));
-
- if (peek_flag)
- return (codestream_peek());
- else
- return (codestream_get());
-}
-
-static void
-codestream_seek (place)
-{
- codestream_next_addr = place & -sizeof (int);
- codestream_cnt = 0;
- codestream_fill (1);
- while (codestream_tell() != place)
- codestream_get ();
-}
-
-static void
-codestream_read (buf, count)
- unsigned char *buf;
-{
- unsigned char *p;
- int i;
- p = buf;
- for (i = 0; i < count; i++)
- *p++ = codestream_get ();
-}
-
-/*
- * Following macro translates i386 opcode register numbers to Symmetry
- * register numbers. This is used by FRAME_FIND_SAVED_REGS.
- *
- * %eax %ecx %edx %ebx %esp %ebp %esi %edi
- * i386 0 1 2 3 4 5 6 7
- * Symmetry 0 2 1 5 14 15 6 7
- *
- */
-#define I386_REGNO_TO_SYMMETRY(n) \
-((n)==0?0 :(n)==1?2 :(n)==2?1 :(n)==3?5 :(n)==4?14 :(n)==5?15 :(n))
-
-/* from i386-dep.c */
-i386_frame_find_saved_regs (fip, fsrp)
- struct frame_info *fip;
- struct frame_saved_regs *fsrp;
-{
- unsigned long locals;
- unsigned char *p;
- unsigned char op;
- CORE_ADDR dummy_bottom;
- CORE_ADDR adr;
- int i;
-
- bzero (fsrp, sizeof *fsrp);
-
- /* if frame is the end of a dummy, compute where the
- * beginning would be
- */
- dummy_bottom = fip->frame - 4 - NUM_REGS*4 - CALL_DUMMY_LENGTH;
-
- /* check if the PC is in the stack, in a dummy frame */
- if (dummy_bottom <= fip->pc && fip->pc <= fip->frame)
- {
- /* all regs were saved by push_call_dummy () */
- adr = fip->frame - 4;
- for (i = 0; i < NUM_REGS; i++)
- {
- fsrp->regs[i] = adr;
- adr -= 4;
- }
- return;
- }
-
- locals = i386_get_frame_setup (get_pc_function_start (fip->pc));
-
- if (locals >= 0)
- {
- adr = fip->frame - 4 - locals;
- for (i = 0; i < 8; i++)
- {
- op = codestream_get ();
- if (op < 0x50 || op > 0x57)
- break;
- fsrp->regs[I386_REGNO_TO_SYMMETRY(op - 0x50)] = adr;
- adr -= 4;
- }
- }
-
- fsrp->regs[PC_REGNUM] = fip->frame + 4;
- fsrp->regs[FP_REGNUM] = fip->frame;
-}
-
-static long
-i386_get_frame_setup (pc)
-{
- unsigned char op;
-
- codestream_seek (pc);
-
- i386_follow_jump ();
-
- op = codestream_get ();
-
- if (op == 0x58) /* popl %eax */
- {
- /*
- * this function must start with
- *
- * popl %eax 0x58
- * xchgl %eax, (%esp) 0x87 0x04 0x24
- * or xchgl %eax, 0(%esp) 0x87 0x44 0x24 0x00
- *
- * (the system 5 compiler puts out the second xchg
- * inst, and the assembler doesn't try to optimize it,
- * so the 'sib' form gets generated)
- *
- * this sequence is used to get the address of the return
- * buffer for a function that returns a structure
- */
- int pos;
- unsigned char buf[4];
- static unsigned char proto1[3] = { 0x87,0x04,0x24 };
- static unsigned char proto2[4] = { 0x87,0x44,0x24,0x00 };
- pos = codestream_tell ();
- codestream_read (buf, 4);
- if (bcmp (buf, proto1, 3) == 0)
- pos += 3;
- else if (bcmp (buf, proto2, 4) == 0)
- pos += 4;
-
- codestream_seek (pos);
- op = codestream_get (); /* update next opcode */
- }
-
- if (op == 0x55) /* pushl %esp */
- {
- if (codestream_get () != 0x8b) /* movl %esp, %ebp (2bytes) */
- return (-1);
- if (codestream_get () != 0xec)
- return (-1);
- /*
- * check for stack adjustment
- *
- * subl $XXX, %esp
- *
- * note: you can't subtract a 16 bit immediate
- * from a 32 bit reg, so we don't have to worry
- * about a data16 prefix
- */
- op = codestream_peek ();
- if (op == 0x83) /* subl with 8 bit immed */
- {
- codestream_get ();
- if (codestream_get () != 0xec)
- return (-1);
- /* subl with signed byte immediate
- * (though it wouldn't make sense to be negative)
- */
- return (codestream_get());
- }
- else if (op == 0x81) /* subl with 32 bit immed */
- {
- int locals;
- if (codestream_get () != 0xec)
- return (-1);
- /* subl with 32 bit immediate */
- codestream_read ((unsigned char *)&locals, 4);
- return (locals);
- }
- else
- {
- return (0);
- }
- }
- else if (op == 0xc8)
- {
- /* enter instruction: arg is 16 unsigned immed */
- unsigned short slocals;
- codestream_read ((unsigned char *)&slocals, 2);
- codestream_get (); /* flush final byte of enter instruction */
- return (slocals);
- }
- return (-1);
-}
-
-/* next instruction is a jump, move to target */
-static
-i386_follow_jump ()
-{
- int long_delta;
- short short_delta;
- char byte_delta;
- int data16;
- int pos;
-
- pos = codestream_tell ();
-
- data16 = 0;
- if (codestream_peek () == 0x66)
- {
- codestream_get ();
- data16 = 1;
- }
-
- switch (codestream_get ())
- {
- case 0xe9:
- /* relative jump: if data16 == 0, disp32, else disp16 */
- if (data16)
- {
- codestream_read ((unsigned char *)&short_delta, 2);
- pos += short_delta + 3; /* include size of jmp inst */
- }
- else
- {
- codestream_read ((unsigned char *)&long_delta, 4);
- pos += long_delta + 5;
- }
- break;
- case 0xeb:
- /* relative jump, disp8 (ignore data16) */
- codestream_read ((unsigned char *)&byte_delta, 1);
- pos += byte_delta + 2;
- break;
- }
- codestream_seek (pos + data16);
-}
-
-/* return pc of first real instruction */
-/* from i386-dep.c */
-
-i386_skip_prologue (pc)
-{
- unsigned char op;
- int i;
-
- if (i386_get_frame_setup (pc) < 0)
- return (pc);
-
- /* found valid frame setup - codestream now points to
- * start of push instructions for saving registers
- */
-
- /* skip over register saves */
- for (i = 0; i < 8; i++)
- {
- op = codestream_peek ();
- /* break if not pushl inst */
- if (op < 0x50 || op > 0x57)
- break;
- codestream_get ();
- }
-
- i386_follow_jump ();
-
- return (codestream_tell ());
-}
-
-symmetry_extract_return_value(type, regbuf, valbuf)
- struct type *type;
- char *regbuf;
- char *valbuf;
-{
- union {
- double d;
- int l[2];
- } xd;
- int i;
- float f;
-
- if (TYPE_CODE_FLT == TYPE_CODE(type)) {
- for (i = 0; i < misc_function_count; i++) {
- if (!strcmp(misc_function_vector[i].name, "1167_flt"))
- break;
- }
- if (i < misc_function_count) {
- /* found "1167_flt" means 1167, %fp2-%fp3 */
- /* float & double; 19= %fp2, 20= %fp3 */
- /* no single precision on 1167 */
- xd.l[1] = *((int *)&regbuf[REGISTER_BYTE(19)]);
- xd.l[0] = *((int *)&regbuf[REGISTER_BYTE(20)]);
- switch (TYPE_LENGTH(type)) {
- case 4:
- f = (float) xd.d;
- bcopy(&f, valbuf, TYPE_LENGTH(type));
- break;
- case 8:
- bcopy(&xd.d, valbuf, TYPE_LENGTH(type));
- break;
- default:
- error("Unknown floating point size");
- break;
- }
- } else {
- /* 387 %st(0), gcc uses this */
- i387_to_double(((int *)&regbuf[REGISTER_BYTE(3)]),
- &xd.d);
- switch (TYPE_LENGTH(type)) {
- case 4: /* float */
- f = (float) xd.d;
- bcopy(&f, valbuf, 4);
- break;
- case 8: /* double */
- bcopy(&xd.d, valbuf, 8);
- break;
- default:
- error("Unknown floating point size");
- break;
- }
- }
- } else {
- bcopy (regbuf, valbuf, TYPE_LENGTH (type));
- }
-}
diff --git a/gdb/symmetry-xdep.c b/gdb/symmetry-xdep.c
deleted file mode 100755
index 3449678..0000000
--- a/gdb/symmetry-xdep.c
+++ /dev/null
@@ -1,557 +0,0 @@
-/* Sequent Symmetry host interface, for GDB when running under Unix.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* many 387-specific items of use taken from i386-dep.c */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-
-#include <signal.h>
-#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/dir.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include "gdbcore.h"
-#include <fcntl.h>
-
-static long i386_get_frame_setup ();
-static i386_follow_jump ();
-
-#include <sgtty.h>
-#define TERMINAL struct sgttyb
-
-store_inferior_registers(regno)
-int regno;
-{
- struct pt_regset regs;
- int reg_tmp, i;
- extern char registers[];
-
-#if 0
- /* PREPARE_TO_STORE deals with this. */
- if (-1 == regno)
- {
-#endif
- regs.pr_eax = *(int *)&registers[REGISTER_BYTE(0)];
- regs.pr_ebx = *(int *)&registers[REGISTER_BYTE(5)];
- regs.pr_ecx = *(int *)&registers[REGISTER_BYTE(2)];
- regs.pr_edx = *(int *)&registers[REGISTER_BYTE(1)];
- regs.pr_esi = *(int *)&registers[REGISTER_BYTE(6)];
- regs.pr_edi = *(int *)&registers[REGISTER_BYTE(7)];
- regs.pr_esp = *(int *)&registers[REGISTER_BYTE(14)];
- regs.pr_ebp = *(int *)&registers[REGISTER_BYTE(15)];
- regs.pr_eip = *(int *)&registers[REGISTER_BYTE(16)];
- regs.pr_flags = *(int *)&registers[REGISTER_BYTE(17)];
- for (i = 0; i < 31; i++) {
- regs.pr_fpa.fpa_regs[i] =
- *(int *)&registers[REGISTER_BYTE(FP1_REGNUM+i)];
- }
-#if 0
- }
- else
- {
- reg_tmp = *(int *)&registers[REGISTER_BYTE(regno)];
- ptrace(XPT_RREGS, inferior_pid, &regs, 0);
- switch (regno)
- {
- case 0:
- regs.pr_eax = *(int *)&registers[REGISTER_BYTE(0)];
- break;
- case 5:
- regs.pr_ebx = *(int *)&registers[REGISTER_BYTE(5)];
- break;
- case 2:
- regs.pr_ecx = *(int *)&registers[REGISTER_BYTE(2)];
- break;
- case 1:
- regs.pr_edx = *(int *)&registers[REGISTER_BYTE(1)];
- break;
- case 6:
- regs.pr_esi = *(int *)&registers[REGISTER_BYTE(6)];
- break;
- case 7:
- regs.pr_edi = *(int *)&registers[REGISTER_BYTE(7)];
- break;
- case 15:
- regs.pr_ebp = *(int *)&registers[REGISTER_BYTE(15)];
- break;
- case 14:
- regs.pr_esp = *(int *)&registers[REGISTER_BYTE(14)];
- break;
- case 16:
- regs.pr_eip = *(int *)&registers[REGISTER_BYTE(16)];
- break;
- case 17:
- regs.pr_flags = *(int *)&registers[REGISTER_BYTE(17)];
- break;
- }
- }
-#endif /* 0 */
- ptrace(XPT_WREGS, inferior_pid, &regs, 0);
-}
-
-void
-fetch_inferior_registers()
-{
- int i;
- struct pt_regset regs;
- extern char registers[];
-
- registers_fetched ();
-
- ptrace(XPT_RREGS, inferior_pid, &regs, 0);
- *(int *)&registers[REGISTER_BYTE(0)] = regs.pr_eax;
- *(int *)&registers[REGISTER_BYTE(5)] = regs.pr_ebx;
- *(int *)&registers[REGISTER_BYTE(2)] = regs.pr_ecx;
- *(int *)&registers[REGISTER_BYTE(1)] = regs.pr_edx;
- *(int *)&registers[REGISTER_BYTE(6)] = regs.pr_esi;
- *(int *)&registers[REGISTER_BYTE(7)] = regs.pr_edi;
- *(int *)&registers[REGISTER_BYTE(15)] = regs.pr_ebp;
- *(int *)&registers[REGISTER_BYTE(14)] = regs.pr_esp;
- *(int *)&registers[REGISTER_BYTE(16)] = regs.pr_eip;
- *(int *)&registers[REGISTER_BYTE(17)] = regs.pr_flags;
- for (i = 0; i < FPA_NREGS; i++) {
- *(int *)&registers[REGISTER_BYTE(FP1_REGNUM+i)] = regs.pr_fpa.fpa_regs[i];
- }
- bcopy(regs.pr_fpu.fpu_stack[0], &registers[REGISTER_BYTE(3)], 10);
- bcopy(regs.pr_fpu.fpu_stack[1], &registers[REGISTER_BYTE(4)], 10);
- bcopy(regs.pr_fpu.fpu_stack[2], &registers[REGISTER_BYTE(8)], 10);
- bcopy(regs.pr_fpu.fpu_stack[3], &registers[REGISTER_BYTE(9)], 10);
- bcopy(regs.pr_fpu.fpu_stack[4], &registers[REGISTER_BYTE(10)], 10);
- bcopy(regs.pr_fpu.fpu_stack[5], &registers[REGISTER_BYTE(11)], 10);
- bcopy(regs.pr_fpu.fpu_stack[6], &registers[REGISTER_BYTE(12)], 10);
- bcopy(regs.pr_fpu.fpu_stack[7], &registers[REGISTER_BYTE(13)], 10);
-}
-
-
-/* Work with core dump and executable files, for GDB.
- This code would be in core.c if it weren't machine-dependent. */
-
-#include "gdbcore.h"
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- extern char registers[];
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
- /* 4.2-style (and perhaps also sysV-style) core dump file. */
- {
- struct user u;
- int reg_offset;
-
- val = myread (corechan, &u, sizeof u);
- if (val < 0)
- perror_with_name (filename);
- data_start = exec_data_start;
-
- data_end = data_start + NBPG * (u.u_dsize - u.u_tsize);
- stack_start = stack_end - NBPG * u.u_ssize;
- data_offset = NBPG * UPAGES;
- stack_offset = ctob(UPAGES + u.u_dsize - u.u_tsize);
- reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
-printf("u.u_tsize= %#x, u.u_dsize= %#x, u.u_ssize= %#x, stack_off= %#x\n",
- u.u_tsize, u.u_dsize, u.u_ssize, stack_offset);
-
- core_aouthdr.a_magic = 0;
-
- /* Read the register values out of the core file and store
- them where `read_register' will find them. */
-
- {
- register int regno;
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- char buf[MAX_REGISTER_RAW_SIZE];
-
- val = lseek (corechan, register_addr (regno, reg_offset), 0);
- if (val < 0)
- perror_with_name (filename);
-
- val = myread (corechan, buf, sizeof buf);
- if (val < 0)
- perror_with_name (filename);
- supply_register (regno, buf);
- }
- }
- }
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- {
- corefile = concat (current_directory, "/", filename);
- }
-
- set_current_frame(create_new_frame(read_register(FP_REGNUM),
- read_pc()));
-/* set_current_frame (read_register (FP_REGNUM));*/
- select_frame (get_current_frame (), 0);
- validate_files ();
- }
- else if (from_tty)
- printf ("No core file now.\n");
-}
-
-/* from i386-dep.c */
-static
-print_387_control_word (control)
-unsigned short control;
-{
- printf ("control 0x%04x: ", control);
- printf ("compute to ");
- switch ((control >> 8) & 3)
- {
- case 0: printf ("24 bits; "); break;
- case 1: printf ("(bad); "); break;
- case 2: printf ("53 bits; "); break;
- case 3: printf ("64 bits; "); break;
- }
- printf ("round ");
- switch ((control >> 10) & 3)
- {
- case 0: printf ("NEAREST; "); break;
- case 1: printf ("DOWN; "); break;
- case 2: printf ("UP; "); break;
- case 3: printf ("CHOP; "); break;
- }
- if (control & 0x3f)
- {
- printf ("mask:");
- if (control & 0x0001) printf (" INVALID");
- if (control & 0x0002) printf (" DENORM");
- if (control & 0x0004) printf (" DIVZ");
- if (control & 0x0008) printf (" OVERF");
- if (control & 0x0010) printf (" UNDERF");
- if (control & 0x0020) printf (" LOS");
- printf (";");
- }
- printf ("\n");
- if (control & 0xe080) printf ("warning: reserved bits on 0x%x\n",
- control & 0xe080);
-}
-
-static
-print_387_status_word (status)
- unsigned short status;
-{
- printf ("status %#04x: ", status);
- if (status & 0xff) {
- printf ("exceptions:"); /* exception names match <machine/fpu.h> */
- if (status & 0x0001) printf (" FLTINV");
- if (status & 0x0002) printf (" FLTDEN");
- if (status & 0x0004) printf (" FLTDIV");
- if (status & 0x0008) printf (" FLTOVF");
- if (status & 0x0010) printf (" FLTUND");
- if (status & 0x0020) printf (" FLTPRE");
- if (status & 0x0040) printf (" FLTSTK");
- printf ("; ");
- }
- printf ("flags: %d%d%d%d; ",
- (status & 0x4000) != 0,
- (status & 0x0400) != 0,
- (status & 0x0200) != 0,
- (status & 0x0100) != 0);
-
- printf ("top %d\n", (status >> 11) & 7);
-}
-
-static
-print_fpu_status(ep)
-struct pt_regset ep;
-
-{
- int i;
- int bothstatus;
- int top;
- int fpreg;
- unsigned char *p;
-
- printf("80387:");
- if (ep.pr_fpu.fpu_ip == 0) {
- printf(" not in use.\n");
- return;
- } else {
- printf("\n");
- }
- if (ep.pr_fpu.fpu_status != 0) {
- print_387_status_word (ep.pr_fpu.fpu_status);
- }
- print_387_control_word (ep.pr_fpu.fpu_control);
- printf ("last exception: ");
- printf ("opcode 0x%x; ", ep.pr_fpu.fpu_rsvd4);
- printf ("pc 0x%x:0x%x; ", ep.pr_fpu.fpu_cs, ep.pr_fpu.fpu_ip);
- printf ("operand 0x%x:0x%x\n", ep.pr_fpu.fpu_data_offset, ep.pr_fpu.fpu_op_sel);
-
- top = (ep.pr_fpu.fpu_status >> 11) & 7;
-
- printf ("regno tag msb lsb value\n");
- for (fpreg = 7; fpreg >= 0; fpreg--)
- {
- double val;
-
- printf ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
-
- switch ((ep.pr_fpu.fpu_tag >> (fpreg * 2)) & 3)
- {
- case 0: printf ("valid "); break;
- case 1: printf ("zero "); break;
- case 2: printf ("trap "); break;
- case 3: printf ("empty "); break;
- }
- for (i = 9; i >= 0; i--)
- printf ("%02x", ep.pr_fpu.fpu_stack[fpreg][i]);
-
- i387_to_double (ep.pr_fpu.fpu_stack[fpreg], (char *)&val);
- printf (" %g\n", val);
- }
- if (ep.pr_fpu.fpu_rsvd1)
- printf ("warning: rsvd1 is 0x%x\n", ep.pr_fpu.fpu_rsvd1);
- if (ep.pr_fpu.fpu_rsvd2)
- printf ("warning: rsvd2 is 0x%x\n", ep.pr_fpu.fpu_rsvd2);
- if (ep.pr_fpu.fpu_rsvd3)
- printf ("warning: rsvd3 is 0x%x\n", ep.pr_fpu.fpu_rsvd3);
- if (ep.pr_fpu.fpu_rsvd5)
- printf ("warning: rsvd5 is 0x%x\n", ep.pr_fpu.fpu_rsvd5);
-}
-
-
-print_1167_control_word(pcr)
-unsigned int pcr;
-
-{
- int pcr_tmp;
-
- pcr_tmp = pcr & FPA_PCR_MODE;
- printf("\tMODE= %#x; RND= %#x ", pcr_tmp, pcr_tmp & 12);
- switch (pcr_tmp & 12) {
- case 0:
- printf("RN (Nearest Value)");
- break;
- case 1:
- printf("RZ (Zero)");
- break;
- case 2:
- printf("RP (Positive Infinity)");
- break;
- case 3:
- printf("RM (Negative Infinity)");
- break;
- }
- printf("; IRND= %d ", pcr_tmp & 2);
- if (0 == pcr_tmp & 2) {
- printf("(same as RND)\n");
- } else {
- printf("(toward zero)\n");
- }
- pcr_tmp = pcr & FPA_PCR_EM;
- printf("\tEM= %#x", pcr_tmp);
- if (pcr_tmp & FPA_PCR_EM_DM) printf(" DM");
- if (pcr_tmp & FPA_PCR_EM_UOM) printf(" UOM");
- if (pcr_tmp & FPA_PCR_EM_PM) printf(" PM");
- if (pcr_tmp & FPA_PCR_EM_UM) printf(" UM");
- if (pcr_tmp & FPA_PCR_EM_OM) printf(" OM");
- if (pcr_tmp & FPA_PCR_EM_ZM) printf(" ZM");
- if (pcr_tmp & FPA_PCR_EM_IM) printf(" IM");
- printf("\n");
- pcr_tmp = FPA_PCR_CC;
- printf("\tCC= %#x", pcr_tmp);
- if (pcr_tmp & FPA_PCR_20MHZ) printf(" 20MHZ");
- if (pcr_tmp & FPA_PCR_CC_Z) printf(" Z");
- if (pcr_tmp & FPA_PCR_CC_C2) printf(" C2");
- if (pcr_tmp & FPA_PCR_CC_C1) printf(" C1");
- switch (pcr_tmp) {
- case FPA_PCR_CC_Z:
- printf(" (Equal)");
- break;
- case FPA_PCR_CC_C1:
- printf(" (Less than)");
- break;
- case 0:
- printf(" (Greater than)");
- break;
- case FPA_PCR_CC_Z | FPA_PCR_CC_C1 | FPA_PCR_CC_C2:
- printf(" (Unordered)");
- break;
- default:
- printf(" (Undefined)");
- break;
- }
- printf("\n");
- pcr_tmp = pcr & FPA_PCR_AE;
- printf("\tAE= %#x", pcr_tmp);
- if (pcr_tmp & FPA_PCR_AE_DE) printf(" DE");
- if (pcr_tmp & FPA_PCR_AE_UOE) printf(" UOE");
- if (pcr_tmp & FPA_PCR_AE_PE) printf(" PE");
- if (pcr_tmp & FPA_PCR_AE_UE) printf(" UE");
- if (pcr_tmp & FPA_PCR_AE_OE) printf(" OE");
- if (pcr_tmp & FPA_PCR_AE_ZE) printf(" ZE");
- if (pcr_tmp & FPA_PCR_AE_EE) printf(" EE");
- if (pcr_tmp & FPA_PCR_AE_IE) printf(" IE");
- printf("\n");
-}
-
-print_1167_regs(regs)
-long regs[FPA_NREGS];
-
-{
- int i;
-
- union {
- double d;
- long l[2];
- } xd;
- union {
- float f;
- long l;
- } xf;
-
-
- for (i = 0; i < FPA_NREGS; i++) {
- xf.l = regs[i];
- printf("%%fp%d: raw= %#x, single= %f", i+1, regs[i], xf.f);
- if (!(i & 1)) {
- printf("\n");
- } else {
- xd.l[1] = regs[i];
- xd.l[0] = regs[i+1];
- printf(", double= %f\n", xd.d);
- }
- }
-}
-
-print_fpa_status(ep)
-struct pt_regset ep;
-
-{
-
- printf("WTL 1167:");
- if (ep.pr_fpa.fpa_pcr !=0) {
- printf("\n");
- print_1167_control_word(ep.pr_fpa.fpa_pcr);
- print_1167_regs(ep.pr_fpa.fpa_regs);
- } else {
- printf(" not in use.\n");
- }
-}
-
-i386_float_info ()
-
-{
- char ubuf[UPAGES*NBPG];
- struct pt_regset regset;
- extern int corechan;
-
- if (have_inferior_p()) {
- call_ptrace(XPT_RREGS, inferior_pid, &regset, 0);
- } else {
- if (lseek (corechan, 0, 0) < 0) {
- perror ("seek on core file");
- }
- if (myread (corechan, ubuf, UPAGES*NBPG) < 0) {
- perror ("read on core file");
- }
- /* only interested in the floating point registers */
- regset.pr_fpu = ((struct user *) ubuf)->u_fpusave;
- regset.pr_fpa = ((struct user *) ubuf)->u_fpasave;
- }
- print_fpu_status(regset);
- print_fpa_status(regset);
-}
-
-i387_to_double (from, to)
- char *from;
- char *to;
-{
- long *lp;
- /* push extended mode on 387 stack, then pop in double mode
- *
- * first, set exception masks so no error is generated -
- * number will be rounded to inf or 0, if necessary
- */
- asm ("pushl %eax"); /* grab a stack slot */
- asm ("fstcw (%esp)"); /* get 387 control word */
- asm ("movl (%esp),%eax"); /* save old value */
- asm ("orl $0x3f,%eax"); /* mask all exceptions */
- asm ("pushl %eax");
- asm ("fldcw (%esp)"); /* load new value into 387 */
-
- asm ("movl 8(%ebp),%eax");
- asm ("fldt (%eax)"); /* push extended number on 387 stack */
- asm ("fwait");
- asm ("movl 12(%ebp),%eax");
- asm ("fstpl (%eax)"); /* pop double */
- asm ("fwait");
-
- asm ("popl %eax"); /* flush modified control word */
- asm ("fnclex"); /* clear exceptions */
- asm ("fldcw (%esp)"); /* restore original control word */
- asm ("popl %eax"); /* flush saved copy */
-}
-
-double_to_i387 (from, to)
- char *from;
- char *to;
-{
- /* push double mode on 387 stack, then pop in extended mode
- * no errors are possible because every 64-bit pattern
- * can be converted to an extended
- */
- asm ("movl 8(%ebp),%eax");
- asm ("fldl (%eax)");
- asm ("fwait");
- asm ("movl 12(%ebp),%eax");
- asm ("fstpt (%eax)");
- asm ("fwait");
-}
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
deleted file mode 100644
index 04d3759..0000000
--- a/gdb/symmisc.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/* Do various things to symbol tables (other than lookup)), for GDB.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "bfd.h"
-#include "symfile.h"
-#include "breakpoint.h"
-#include "command.h"
-
-#include <obstack.h>
-
-/* Free all the symtabs that are currently installed,
- and all storage associated with them.
- Leaves us in a consistent state with no symtabs installed. */
-
-void
-free_all_symtabs ()
-{
- register struct symtab *s, *snext;
-
- /* All values will be invalid because their types will be! */
-
- clear_value_history ();
- clear_displays ();
- clear_internalvars ();
-#if defined (CLEAR_SOLIB)
- CLEAR_SOLIB ();
-#endif
- set_default_breakpoint (0, 0, 0, 0);
-
- current_source_symtab = 0;
-
- for (s = symtab_list; s; s = snext)
- {
- snext = s->next;
- free_symtab (s);
- }
- symtab_list = 0;
- obstack_free (symbol_obstack, 0);
- obstack_init (symbol_obstack);
-
- if (misc_function_vector)
- free (misc_function_vector);
- misc_function_count = 0;
- misc_function_vector = 0;
- clear_pc_function_cache();
-}
-
-/* Free a struct block <- B and all the symbols defined in that block. */
-
-static void
-free_symtab_block (b)
- struct block *b;
-{
- register int i, n;
- n = BLOCK_NSYMS (b);
- for (i = 0; i < n; i++)
- {
- free (SYMBOL_NAME (BLOCK_SYM (b, i)));
- free (BLOCK_SYM (b, i));
- }
- free (b);
-}
-
-/* Free all the storage associated with the struct symtab <- S.
- Note that some symtabs have contents malloc'ed structure by structure,
- while some have contents that all live inside one big block of memory,
- and some share the contents of another symbol table and so you should
- not free the contents on their behalf (except sometimes the linetable,
- which maybe per symtab even when the rest is not).
- It is s->free_code that says which alternative to use. */
-
-void
-free_symtab (s)
- register struct symtab *s;
-{
- register int i, n;
- register struct blockvector *bv;
-
- switch (s->free_code)
- {
- case free_nothing:
- /* All the contents are part of a big block of memory (an obstack),
- and some other symtab is in charge of freeing that block.
- Therefore, do nothing. */
- break;
-
- case free_contents:
- /* Here all the contents were malloc'ed structure by structure
- and must be freed that way. */
- /* First free the blocks (and their symbols. */
- bv = BLOCKVECTOR (s);
- n = BLOCKVECTOR_NBLOCKS (bv);
- for (i = 0; i < n; i++)
- free_symtab_block (BLOCKVECTOR_BLOCK (bv, i));
- /* Free the blockvector itself. */
- free (bv);
- /* Also free the linetable. */
-
- case free_linetable:
- /* Everything will be freed either by our `free_ptr'
- or by some other symbatb, except for our linetable.
- Free that now. */
- free (LINETABLE (s));
- break;
- }
-
- /* If there is a single block of memory to free, free it. */
- if (s->free_ptr)
- free (s->free_ptr);
-
- /* Free source-related stuff */
- if (s->line_charpos)
- free (s->line_charpos);
- if (s->fullname)
- free (s->fullname);
- free (s);
-}
-
-static int block_depth ();
-static void print_symbol ();
-static void print_partial_symbol ();
-
-void
-print_symtabs (filename)
- char *filename;
-{
- FILE *outfile;
- register struct symtab *s;
- register int i, j;
- int len, blen;
- register struct linetable *l;
- struct blockvector *bv;
- register struct block *b;
- int depth;
- struct cleanup *cleanups;
- extern int fclose();
-
- if (filename == 0)
- error_no_arg ("file to write symbol data in");
-
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- outfile = fopen (filename, "w");
- if (outfile == 0)
- perror_with_name (filename);
-
- cleanups = make_cleanup (fclose, outfile);
- immediate_quit++;
-
- for (s = symtab_list; s; s = s->next)
- {
- /* First print the line table. */
- fprintf (outfile, "Symtab for file %s\n", s->filename);
- l = LINETABLE (s);
- if (l) {
- fprintf (outfile, "\nLine table:\n\n");
- len = l->nitems;
- for (i = 0; i < len; i++)
- fprintf (outfile, " line %d at %x\n", l->item[i].line,
- l->item[i].pc);
- }
- /* Now print the block info. */
- fprintf (outfile, "\nBlockvector:\n\n");
- bv = BLOCKVECTOR (s);
- len = BLOCKVECTOR_NBLOCKS (bv);
- for (i = 0; i < len; i++)
- {
- b = BLOCKVECTOR_BLOCK (bv, i);
- depth = block_depth (b) * 2;
- print_spaces (depth, outfile);
- fprintf (outfile, "block #%03d (object 0x%x) ", i, b);
- fprintf (outfile, "[0x%x..0x%x]", BLOCK_START (b), BLOCK_END (b));
- if (BLOCK_SUPERBLOCK (b))
- fprintf (outfile, " (under 0x%x)", BLOCK_SUPERBLOCK (b));
- if (BLOCK_FUNCTION (b))
- fprintf (outfile, " %s", SYMBOL_NAME (BLOCK_FUNCTION (b)));
- fputc ('\n', outfile);
- blen = BLOCK_NSYMS (b);
- for (j = 0; j < blen; j++)
- {
- print_symbol (BLOCK_SYM (b, j), depth + 1, outfile);
- }
- }
-
- fprintf (outfile, "\n\n");
- }
-
- immediate_quit--;
- do_cleanups (cleanups);
-}
-
-static void
-print_symbol (symbol, depth, outfile)
- struct symbol *symbol;
- int depth;
- FILE *outfile;
-{
- print_spaces (depth, outfile);
- if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
- {
- fprintf (outfile, "label %s at 0x%x\n", SYMBOL_NAME (symbol),
- SYMBOL_VALUE_ADDRESS (symbol));
- return;
- }
- if (SYMBOL_NAMESPACE (symbol) == STRUCT_NAMESPACE)
- {
- if (TYPE_NAME (SYMBOL_TYPE (symbol)))
- {
- type_print_1 (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
- }
- else
- {
- fprintf (outfile, "%s %s = ",
- (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_ENUM
- ? "enum"
- : (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
- ? "struct" : "union")),
- SYMBOL_NAME (symbol));
- type_print_1 (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
- }
- fprintf (outfile, ";\n");
- }
- else
- {
- if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
- fprintf (outfile, "typedef ");
- if (SYMBOL_TYPE (symbol))
- {
- type_print_1 (SYMBOL_TYPE (symbol), SYMBOL_NAME (symbol),
- outfile, 1, depth);
- fprintf (outfile, "; ");
- }
- else
- fprintf (outfile, "%s ", SYMBOL_NAME (symbol));
-
- switch (SYMBOL_CLASS (symbol))
- {
- case LOC_CONST:
- fprintf (outfile, "const %ld (0x%lx),",
- SYMBOL_VALUE (symbol), SYMBOL_VALUE (symbol));
- break;
-
- case LOC_CONST_BYTES:
- fprintf (outfile, "const %u hex bytes:",
- TYPE_LENGTH (SYMBOL_TYPE (symbol)));
- {
- unsigned i;
- for (i = 0; i < TYPE_LENGTH (SYMBOL_TYPE (symbol)); i++)
- fprintf (outfile, " %2x",
- (unsigned)SYMBOL_VALUE_BYTES (symbol) [i]);
- fprintf (outfile, ",");
- }
- break;
-
- case LOC_STATIC:
- fprintf (outfile, "static at 0x%x,", SYMBOL_VALUE_ADDRESS (symbol));
- break;
-
- case LOC_REGISTER:
- fprintf (outfile, "register %ld,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_ARG:
- fprintf (outfile, "arg at 0x%lx,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_LOCAL_ARG:
- fprintf (outfile, "arg at offset 0x%x from fp,",
- SYMBOL_VALUE (symbol));
-
- case LOC_REF_ARG:
- fprintf (outfile, "reference arg at 0x%lx,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_REGPARM:
- fprintf (outfile, "parameter register %ld,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_LOCAL:
- fprintf (outfile, "local at 0x%lx,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_TYPEDEF:
- break;
-
- case LOC_LABEL:
- fprintf (outfile, "label at 0x%lx", SYMBOL_VALUE_ADDRESS (symbol));
- break;
-
- case LOC_BLOCK:
- fprintf (outfile, "block (object 0x%x) starting at 0x%x,",
- SYMBOL_BLOCK_VALUE (symbol),
- BLOCK_START (SYMBOL_BLOCK_VALUE (symbol)));
- break;
-
- default:
- fprintf (outfile, "botched symbol class %x", SYMBOL_CLASS (symbol));
- break;
- }
- }
- fprintf (outfile, "\n");
-}
-
-void
-print_partial_symtabs (filename)
- char *filename;
-{
- FILE *outfile;
- struct partial_symtab *p;
- struct cleanup *cleanups;
- extern int fclose();
-
- if (filename == 0)
- error_no_arg ("file to write partial symbol data in");
-
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- outfile = fopen (filename, "w");
- if (outfile == 0)
- perror_with_name (filename);
-
- cleanups = make_cleanup (fclose, outfile);
- immediate_quit++;
-
- for (p = partial_symtab_list; p; p = p->next)
- {
- fprintf_filtered (outfile, "Partial symtab for source file %s ",
- p->filename);
- fprintf_filtered (outfile, "(object 0x%x)\n\n", p);
- fprintf_filtered (outfile, " Full symbol table %s been read from %s\n",
- p->readin ? "has" : "has not yet",
- p->symfile_name);
- if (p->readin)
- fprintf_filtered (outfile, " Was read into symtab at 0x%x by function at 0x%x\n",
- p->symtab, p->read_symtab);
- fprintf_filtered (outfile, " Relocate symbols by 0x%x\n", p->addr);
- fprintf_filtered (outfile, " Symbols cover text addresses 0x%x-0x%x\n",
- p->textlow, p->texthigh);
- fprintf_filtered (outfile, " Depends on %d other partial symtabs.\n",
- p->number_of_dependencies);
- if (p->n_global_syms > 0)
- print_partial_symbol (global_psymbols.list + p->globals_offset,
- p->n_global_syms, "Global", outfile);
- if (p->n_static_syms > 0)
- print_partial_symbol (static_psymbols.list + p->statics_offset,
- p->n_static_syms, "Static", outfile);
- fprintf_filtered (outfile, "\n\n");
- }
-
- immediate_quit--;
- do_cleanups (cleanups);
-}
-
-static void
-print_partial_symbol (p, count, what, outfile)
-struct partial_symbol *p;
-int count;
-char *what;
-FILE *outfile;
-{
- char *space;
- char *class;
-
- fprintf_filtered (outfile, " %s partial symbols:\n", what);
- while (count-- > 0)
- {
- fprintf_filtered (outfile, " `%s', ", SYMBOL_NAME(p));
- switch (SYMBOL_NAMESPACE (p))
- {
- case UNDEF_NAMESPACE:
- fputs_filtered ("undefined namespace, ", outfile);
- break;
- case VAR_NAMESPACE:
- /* This is the usual thing -- don't print it */
- break;
- case STRUCT_NAMESPACE:
- fputs_filtered ("struct namespace, ", outfile);
- break;
- case LABEL_NAMESPACE:
- fputs_filtered ("label namespace, ", outfile);
- break;
- default:
- fputs_filtered ("<invalid namespace>, ", outfile);
- break;
- }
- switch (SYMBOL_CLASS (p))
- {
- case LOC_UNDEF:
- fputs_filtered ("undefined", outfile);
- break;
- case LOC_CONST:
- fputs_filtered ("constant int", outfile);
- break;
- case LOC_STATIC:
- fputs_filtered ("static", outfile);
- break;
- case LOC_REGISTER:
- fputs_filtered ("register", outfile);
- break;
- case LOC_ARG:
- fputs_filtered ("pass by value", outfile);
- break;
- case LOC_REF_ARG:
- fputs_filtered ("pass by reference", outfile);
- break;
- case LOC_REGPARM:
- fputs_filtered ("register parameter", outfile);
- break;
- case LOC_LOCAL:
- fputs_filtered ("stack parameter", outfile);
- break;
- case LOC_TYPEDEF:
- fputs_filtered ("type", outfile);
- break;
- case LOC_LABEL:
- fputs_filtered ("label", outfile);
- break;
- case LOC_BLOCK:
- fputs_filtered ("function", outfile);
- break;
- case LOC_CONST_BYTES:
- fputs_filtered ("constant bytes", outfile);
- break;
- case LOC_LOCAL_ARG:
- fputs_filtered ("shuffled arg", outfile);
- break;
- default:
- fputs_filtered ("<invalid location>", outfile);
- break;
- }
- fputs_filtered (", ", outfile);
- fprintf_filtered (outfile, "0x%x\n", SYMBOL_VALUE (p));
- p++;
- }
-}
-
-/* Return the nexting depth of a block within other blocks in its symtab. */
-
-static int
-block_depth (block)
- struct block *block;
-{
- register int i = 0;
- while (block = BLOCK_SUPERBLOCK (block)) i++;
- return i;
-}
-
-/*
- * Free all partial_symtab storage.
- */
-void
-free_all_psymtabs()
-{
- obstack_free (psymbol_obstack, 0);
- obstack_init (psymbol_obstack);
- partial_symtab_list = (struct partial_symtab *) 0;
-}
-
-void
-_initialize_symmisc ()
-{
- symtab_list = (struct symtab *) 0;
- partial_symtab_list = (struct partial_symtab *) 0;
-
- add_com ("printsyms", class_obscure, print_symtabs,
- "Print dump of current symbol definitions to file OUTFILE.");
- add_com ("printpsyms", class_obscure, print_partial_symtabs,
- "Print dump of current partial symbol definitions to file OUTFILE.");
-}
-
diff --git a/gdb/symtab.c b/gdb/symtab.c
deleted file mode 100644
index 27d4952..0000000
--- a/gdb/symtab.c
+++ /dev/null
@@ -1,3020 +0,0 @@
-/* Symbol table lookup for the GNU debugger, GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "symtab.h"
-#include "param.h"
-#include "gdbcore.h"
-#include "frame.h"
-#include "target.h"
-#include "value.h"
-#include "symfile.h"
-#include "gdbcmd.h"
-#include "regex.h"
-#include "language.h"
-
-#include <obstack.h>
-#include <assert.h>
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/stat.h>
-
-extern char *getenv ();
-
-extern char *cplus_demangle ();
-extern char *cplus_mangle_opname ();
-extern struct value *value_of_this ();
-extern void break_command ();
-extern void select_source_symtab ();
-
-/* Functions this file defines */
-static int find_line_common ();
-struct partial_symtab *lookup_partial_symtab ();
-static struct partial_symbol *lookup_partial_symbol ();
-static struct partial_symbol *lookup_demangled_partial_symbol ();
-static struct symbol *lookup_demangled_block_symbol ();
-
-/* The single non-language-specific builtin type */
-struct type *builtin_type_error;
-
-/* Block in which the most recently searched-for symbol was found.
- Might be better to make this a parameter to lookup_symbol and
- value_of_this. */
-struct block *block_found;
-
-char no_symtab_msg[] = "No symbol table is loaded. Use the \"file\" command.";
-
-/* Check for a symtab of a specific name; first in symtabs, then in
- psymtabs. *If* there is no '/' in the name, a match after a '/'
- in the symtab filename will also work. */
-
-static struct symtab *
-lookup_symtab_1 (name)
- char *name;
-{
- register struct symtab *s;
- register struct partial_symtab *ps;
- register char *slash = strchr (name, '/');
- register int len = strlen (name);
-
- for (s = symtab_list; s; s = s->next)
- if (!strcmp (name, s->filename))
- return s;
-
- for (ps = partial_symtab_list; ps; ps = ps->next)
- if (!strcmp (name, ps->filename))
- {
- if (ps->readin)
- error ("Internal: readin pst for `%s' found when no symtab found.", name);
- return PSYMTAB_TO_SYMTAB (ps);
- }
-
- if (!slash)
- {
- for (s = symtab_list; s; s = s->next)
- {
- int l = strlen (s->filename);
-
- if (s->filename[l - len -1] == '/'
- && !strcmp (s->filename + l - len, name))
- return s;
- }
-
- for (ps = partial_symtab_list; ps; ps = ps->next)
- {
- int l = strlen (ps->filename);
-
- if (ps->filename[l - len - 1] == '/'
- && !strcmp (ps->filename + l - len, name))
- {
- if (ps->readin)
- error ("Internal: readin pst for `%s' found when no symtab found.", name);
- return PSYMTAB_TO_SYMTAB (ps);
- }
- }
- }
- return 0;
-}
-
-/* Lookup the symbol table of a source file named NAME. Try a couple
- of variations if the first lookup doesn't work. */
-
-struct symtab *
-lookup_symtab (name)
- char *name;
-{
- register struct symtab *s;
- register char *copy;
-
- s = lookup_symtab_1 (name);
- if (s) return s;
-
- /* If name not found as specified, see if adding ".c" helps. */
-
- copy = (char *) alloca (strlen (name) + 3);
- strcpy (copy, name);
- strcat (copy, ".c");
- s = lookup_symtab_1 (copy);
- if (s) return s;
-
- /* We didn't find anything; die. */
- return 0;
-}
-
-/* Lookup the partial symbol table of a source file named NAME. This
- only returns true on an exact match (ie. this semantics are
- different from lookup_symtab. */
-
-struct partial_symtab *
-lookup_partial_symtab (name)
-char *name;
-{
- register struct partial_symtab *s;
-
- for (s = partial_symtab_list; s; s = s->next)
- if (!strcmp (name, s->filename))
- return s;
-
- return 0;
-}
-
-/* Return a typename for a struct/union/enum type
- without the tag qualifier. If the type has a NULL name,
- NULL is returned. */
-char *
-type_name_no_tag (type)
- register struct type *type;
-{
- register char *name = TYPE_NAME (type);
-
- if (name == 0)
- return 0;
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_STRUCT:
- if(!strncmp(name,"struct ",7))
- return name + 7;
- else return name;
- case TYPE_CODE_UNION:
- if(!strncmp(name,"union ",6))
- return name + 6;
- else return name;
- case TYPE_CODE_ENUM:
- if(!strncmp(name,"enum ",5))
- return name + 5;
- else return name;
- }
-
- return TYPE_NAME (type);
-}
-
-/* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989.
-
- If this is a stubbed struct (i.e. declared as struct foo *), see if
- we can find a full definition in some other file. If so, copy this
- definition, so we can use it in future. If not, set a flag so we
- don't waste too much time in future. (FIXME, this doesn't seem
- to be happening...)
-
- This used to be coded as a macro, but I don't think it is called
- often enough to merit such treatment.
-*/
-
-struct complaint stub_noname_complaint =
- {"stub type has NULL name", 0, 0};
-
-void
-check_stub_type(type)
- struct type *type;
-{
- if (TYPE_FLAGS(type) & TYPE_FLAG_STUB)
- {
- char* name= type_name_no_tag (type);
- struct symbol *sym;
- if (name == 0)
- {
- complain (&stub_noname_complaint, 0);
- return;
- }
- sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0,
- (struct symtab **)NULL);
- if (sym)
- bcopy (SYMBOL_TYPE(sym), type, sizeof (struct type));
- }
-}
-
-/* Demangle a GDB method stub type. */
-char *
-gdb_mangle_name (type, i, j)
- struct type *type;
- int i, j;
-{
- int mangled_name_len;
- char *mangled_name;
- struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
- struct fn_field *method = &f[j];
- char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
-
- /* Need a new type prefix. */
- char *strchr ();
- char *const_prefix = method->is_const ? "C" : "";
- char *volatile_prefix = method->is_volatile ? "V" : "";
- char *newname = type_name_no_tag (type);
- char buf[20];
- int len = strlen (newname);
-
- sprintf (buf, "__%s%s%d", const_prefix, volatile_prefix, len);
- mangled_name_len = (strlen (field_name)
- + strlen (buf) + len
- + strlen (TYPE_FN_FIELD_PHYSNAME (f, j))
- + 1);
-
- if (OPNAME_PREFIX_P (field_name))
- {
- char *opname = cplus_mangle_opname (field_name + 3);
- if (opname == NULL)
- error ("No mangling for \"%s\"", field_name);
- mangled_name_len += strlen (opname);
- mangled_name = (char *)xmalloc (mangled_name_len);
-
- strncpy (mangled_name, field_name, 3);
- mangled_name[3] = '\0';
- strcat (mangled_name, opname);
- }
- else
- {
- mangled_name = (char *)xmalloc (mangled_name_len);
- strcpy (mangled_name, TYPE_FN_FIELDLIST_NAME (type, i));
- }
- strcat (mangled_name, buf);
- strcat (mangled_name, newname);
- strcat (mangled_name, TYPE_FN_FIELD_PHYSNAME (f, j));
-
- return mangled_name;
-}
-
-/* Lookup a primitive type named NAME.
- Return zero if NAME is not a primitive type.*/
-
-struct type *
-lookup_primitive_typename (name)
- char *name;
-{
- struct type ** const *p;
-
- for (p = current_language->la_builtin_type_vector; *p; p++)
- if(!strcmp((**p)->name, name))
- return **p;
- return 0;
-}
-
-/* Lookup a typedef or primitive type named NAME,
- visible in lexical block BLOCK.
- If NOERR is nonzero, return zero if NAME is not suitably defined. */
-
-struct type *
-lookup_typename (name, block, noerr)
- char *name;
- struct block *block;
- int noerr;
-{
- register struct symbol *sym =
- lookup_symbol (name, block, VAR_NAMESPACE, 0, (struct symtab **)NULL);
- if (sym == 0 || SYMBOL_CLASS (sym) != LOC_TYPEDEF)
- {
- struct type *tmp;
- tmp = lookup_primitive_typename (name);
- if(tmp)
- return tmp;
- else if (!tmp && noerr)
- return 0;
- else
- error ("No type named %s.", name);
- }
- return SYMBOL_TYPE (sym);
-}
-
-struct type *
-lookup_unsigned_typename (name)
- char *name;
-{
- char *uns = alloca (strlen(name) + 10);
-
- strcpy (uns, "unsigned ");
- strcpy (uns+9, name);
- return lookup_typename (uns, (struct block *)0, 0);
-}
-
-/* Lookup a structure type named "struct NAME",
- visible in lexical block BLOCK. */
-
-struct type *
-lookup_struct (name, block)
- char *name;
- struct block *block;
-{
- register struct symbol *sym
- = lookup_symbol (name, block, STRUCT_NAMESPACE, 0, (struct symtab **)NULL);
-
- if (sym == 0)
- error ("No struct type named %s.", name);
- if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
- error ("This context has class, union or enum %s, not a struct.", name);
- return SYMBOL_TYPE (sym);
-}
-
-/* Lookup a union type named "union NAME",
- visible in lexical block BLOCK. */
-
-struct type *
-lookup_union (name, block)
- char *name;
- struct block *block;
-{
- register struct symbol *sym
- = lookup_symbol (name, block, STRUCT_NAMESPACE, 0, (struct symtab **)NULL);
-
- if (sym == 0)
- error ("No union type named %s.", name);
- if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_UNION)
- error ("This context has class, struct or enum %s, not a union.", name);
- return SYMBOL_TYPE (sym);
-}
-
-/* Lookup an enum type named "enum NAME",
- visible in lexical block BLOCK. */
-
-struct type *
-lookup_enum (name, block)
- char *name;
- struct block *block;
-{
- register struct symbol *sym
- = lookup_symbol (name, block, STRUCT_NAMESPACE, 0, (struct symtab **)NULL);
- if (sym == 0)
- error ("No enum type named %s.", name);
- if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_ENUM)
- error ("This context has class, struct or union %s, not an enum.", name);
- return SYMBOL_TYPE (sym);
-}
-
-/* Lookup a template type named "template NAME<TYPE>",
- visible in lexical block BLOCK. */
-
-struct type *
-lookup_template_type (name, type, block)
- char *name;
- struct type *type;
- struct block *block;
-{
- struct symbol *sym ;
- char *nam = (char*) alloca(strlen(name) + strlen(type->name) + 4);
- strcpy(nam, name);
- strcat(nam, "<");
- strcat(nam, type->name);
- strcat(nam, " >"); /* extra space still introduced in gcc? */
-
- sym = lookup_symbol (nam, block, VAR_NAMESPACE, 0, (struct symtab **)NULL);
-
- if (sym == 0)
- error ("No template type named %s.", name);
- if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
- error ("This context has class, union or enum %s, not a struct.", name);
- return SYMBOL_TYPE (sym);
-}
-
-/* Given a type TYPE, lookup the type of the component of type named
- NAME.
- If NOERR is nonzero, return zero if NAME is not suitably defined. */
-
-struct type *
-lookup_struct_elt_type (type, name, noerr)
- struct type *type;
- char *name;
- int noerr;
-{
- int i;
-
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_UNION)
- {
- target_terminal_ours ();
- fflush (stdout);
- fprintf (stderr, "Type ");
- type_print (type, "", stderr, -1);
- error (" is not a structure or union type.");
- }
-
- check_stub_type (type);
-
- for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
- {
- char *t_field_name = TYPE_FIELD_NAME (type, i);
-
- if (t_field_name && !strcmp (t_field_name, name))
- return TYPE_FIELD_TYPE (type, i);
- }
- /* OK, it's not in this class. Recursively check the baseclasses. */
- for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
- {
- struct type *t = lookup_struct_elt_type (TYPE_BASECLASS (type, i),
- name, 0);
- if (t != NULL)
- return t;
- }
-
- if (noerr)
- return NULL;
-
- target_terminal_ours ();
- fflush (stdout);
- fprintf (stderr, "Type ");
- type_print (type, "", stderr, -1);
- fprintf (stderr, " has no component named ");
- fputs_filtered (name, stderr);
- error (".");
- return (struct type *)-1; /* For lint */
-}
-
-/* Given a type TYPE, return a type of pointers to that type.
- May need to construct such a type if this is the first use.
-
- C++: use TYPE_MAIN_VARIANT and TYPE_CHAIN to keep pointer
- to member types under control. */
-
-struct type *
-lookup_pointer_type (type)
- struct type *type;
-{
- register struct type *ptype = TYPE_POINTER_TYPE (type);
- if (ptype) return TYPE_MAIN_VARIANT (ptype);
-
- /* This is the first time anyone wanted a pointer to a TYPE. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- ptype = (struct type *) xmalloc (sizeof (struct type));
- else
- ptype = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
-
- bzero (ptype, sizeof (struct type));
- TYPE_MAIN_VARIANT (ptype) = ptype;
- TYPE_TARGET_TYPE (ptype) = type;
- TYPE_POINTER_TYPE (type) = ptype;
- /* New type is permanent if type pointed to is permanent. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- TYPE_FLAGS (ptype) |= TYPE_FLAG_PERM;
- /* We assume the machine has only one representation for pointers! */
- /* FIXME: This confuses host<->target data representations, and is a
- poor assumption besides. */
- TYPE_LENGTH (ptype) = sizeof (char *);
- TYPE_CODE (ptype) = TYPE_CODE_PTR;
- return ptype;
-}
-
-struct type *
-lookup_reference_type (type)
- struct type *type;
-{
- register struct type *rtype = TYPE_REFERENCE_TYPE (type);
- if (rtype) return TYPE_MAIN_VARIANT (rtype);
-
- /* This is the first time anyone wanted a pointer to a TYPE. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- rtype = (struct type *) xmalloc (sizeof (struct type));
- else
- rtype = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
-
- bzero (rtype, sizeof (struct type));
- TYPE_MAIN_VARIANT (rtype) = rtype;
- TYPE_TARGET_TYPE (rtype) = type;
- TYPE_REFERENCE_TYPE (type) = rtype;
- /* New type is permanent if type pointed to is permanent. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- TYPE_FLAGS (rtype) |= TYPE_FLAG_PERM;
- /* We assume the machine has only one representation for pointers! */
- TYPE_LENGTH (rtype) = sizeof (char *);
- TYPE_CODE (rtype) = TYPE_CODE_REF;
- return rtype;
-}
-
-
-/* Implement direct support for MEMBER_TYPE in GNU C++.
- May need to construct such a type if this is the first use.
- The TYPE is the type of the member. The DOMAIN is the type
- of the aggregate that the member belongs to. */
-
-struct type *
-lookup_member_type (type, domain)
- struct type *type, *domain;
-{
- register struct type *mtype = TYPE_MAIN_VARIANT (type);
- struct type *main_type;
-
- main_type = mtype;
- while (mtype)
- {
- if (TYPE_DOMAIN_TYPE (mtype) == domain)
- return mtype;
- mtype = TYPE_NEXT_VARIANT (mtype);
- }
-
- /* This is the first time anyone wanted this member type. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- mtype = (struct type *) xmalloc (sizeof (struct type));
- else
- mtype = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
-
- bzero (mtype, sizeof (struct type));
- if (main_type == 0)
- main_type = mtype;
- else
- {
- TYPE_NEXT_VARIANT (mtype) = TYPE_NEXT_VARIANT (main_type);
- TYPE_NEXT_VARIANT (main_type) = mtype;
- }
- TYPE_MAIN_VARIANT (mtype) = main_type;
- TYPE_TARGET_TYPE (mtype) = type;
- TYPE_DOMAIN_TYPE (mtype) = domain;
- /* New type is permanent if type pointed to is permanent. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- TYPE_FLAGS (mtype) |= TYPE_FLAG_PERM;
-
- /* In practice, this is never used. */
- TYPE_LENGTH (mtype) = 1;
- TYPE_CODE (mtype) = TYPE_CODE_MEMBER;
-
-#if 0
- /* Now splice in the new member pointer type. */
- if (main_type)
- {
- /* This type was not "smashed". */
- TYPE_CHAIN (mtype) = TYPE_CHAIN (main_type);
- TYPE_CHAIN (main_type) = mtype;
- }
-#endif
-
- return mtype;
-}
-
-/* Allocate a stub method whose return type is
- TYPE. We will fill in arguments later. This always
- returns a fresh type. If we unify this type with
- an existing type later, the storage allocated
- here can be freed. */
-struct type *
-allocate_stub_method (type)
- struct type *type;
-{
- struct type *mtype = (struct type *)xmalloc (sizeof (struct type));
- bzero (mtype, sizeof (struct type));
- TYPE_MAIN_VARIANT (mtype) = mtype;
- TYPE_TARGET_TYPE (mtype) = type;
- TYPE_FLAGS (mtype) = TYPE_FLAG_STUB;
- TYPE_CODE (mtype) = TYPE_CODE_METHOD;
- TYPE_LENGTH (mtype) = 1;
- return mtype;
-}
-
-/* Lookup a method type belonging to class DOMAIN, returning type TYPE,
- and taking a list of arguments ARGS.
- If one is not found, allocate a new one. */
-
-struct type *
-lookup_method_type (domain, type, args)
- struct type *domain, *type, **args;
-{
- register struct type *mtype = TYPE_MAIN_VARIANT (type);
- struct type *main_type;
-
- main_type = mtype;
- while (mtype)
- {
- if (TYPE_DOMAIN_TYPE (mtype) == domain)
- {
- struct type **t1 = args;
- struct type **t2 = TYPE_ARG_TYPES (mtype);
- if (t2)
- {
- int i;
- for (i = 0; t1[i] != 0 && t1[i]->code != TYPE_CODE_VOID; i++)
- if (t1[i] != t2[i])
- break;
- if (t1[i] == t2[i])
- return mtype;
- }
- }
- mtype = TYPE_NEXT_VARIANT (mtype);
- }
-
- /* This is the first time anyone wanted this member type. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- mtype = (struct type *) xmalloc (sizeof (struct type));
- else
- mtype = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
-
- bzero (mtype, sizeof (struct type));
- if (main_type == 0)
- main_type = mtype;
- else
- {
- TYPE_NEXT_VARIANT (mtype) = TYPE_NEXT_VARIANT (main_type);
- TYPE_NEXT_VARIANT (main_type) = mtype;
- }
- TYPE_MAIN_VARIANT (mtype) = main_type;
- TYPE_TARGET_TYPE (mtype) = type;
- TYPE_DOMAIN_TYPE (mtype) = domain;
- TYPE_ARG_TYPES (mtype) = args;
- /* New type is permanent if type pointed to is permanent. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- TYPE_FLAGS (mtype) |= TYPE_FLAG_PERM;
-
- /* In practice, this is never used. */
- TYPE_LENGTH (mtype) = 1;
- TYPE_CODE (mtype) = TYPE_CODE_METHOD;
-
-#if 0
- /* Now splice in the new member pointer type. */
- if (main_type)
- {
- /* This type was not "smashed". */
- TYPE_CHAIN (mtype) = TYPE_CHAIN (main_type);
- TYPE_CHAIN (main_type) = mtype;
- }
-#endif
-
- return mtype;
-}
-
-#if 0
-/* Given a type TYPE, return a type which has offset OFFSET,
- via_virtual VIA_VIRTUAL, and via_public VIA_PUBLIC.
- May need to construct such a type if none exists. */
-struct type *
-lookup_basetype_type (type, offset, via_virtual, via_public)
- struct type *type;
- int offset;
- int via_virtual, via_public;
-{
- register struct type *btype = TYPE_MAIN_VARIANT (type);
- struct type *main_type;
-
- if (offset != 0)
- {
- printf ("Internal error: type offset non-zero in lookup_basetype_type");
- offset = 0;
- }
-
- main_type = btype;
- while (btype)
- {
- if (/* TYPE_OFFSET (btype) == offset
- && */ TYPE_VIA_PUBLIC (btype) == via_public
- && TYPE_VIA_VIRTUAL (btype) == via_virtual)
- return btype;
- btype = TYPE_NEXT_VARIANT (btype);
- }
-
- /* This is the first time anyone wanted this member type. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- btype = (struct type *) xmalloc (sizeof (struct type));
- else
- btype = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
-
- if (main_type == 0)
- {
- main_type = btype;
- bzero (btype, sizeof (struct type));
- TYPE_MAIN_VARIANT (btype) = main_type;
- }
- else
- {
- bcopy (main_type, btype, sizeof (struct type));
- TYPE_NEXT_VARIANT (main_type) = btype;
- }
-/* TYPE_OFFSET (btype) = offset; */
- if (via_public)
- TYPE_FLAGS (btype) |= TYPE_FLAG_VIA_PUBLIC;
- if (via_virtual)
- TYPE_FLAGS (btype) |= TYPE_FLAG_VIA_VIRTUAL;
- /* New type is permanent if type pointed to is permanent. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- TYPE_FLAGS (btype) |= TYPE_FLAG_PERM;
-
- /* In practice, this is never used. */
- TYPE_LENGTH (btype) = 1;
- TYPE_CODE (btype) = TYPE_CODE_STRUCT;
-
- return btype;
-}
-#endif
-
-/* Given a type TYPE, return a type of functions that return that type.
- May need to construct such a type if this is the first use. */
-
-struct type *
-lookup_function_type (type)
- struct type *type;
-{
- register struct type *ptype = TYPE_FUNCTION_TYPE (type);
- if (ptype) return ptype;
-
- /* This is the first time anyone wanted a function returning a TYPE. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- ptype = (struct type *) xmalloc (sizeof (struct type));
- else
- ptype = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
-
- bzero (ptype, sizeof (struct type));
- TYPE_TARGET_TYPE (ptype) = type;
- TYPE_FUNCTION_TYPE (type) = ptype;
- /* New type is permanent if type returned is permanent. */
- if (TYPE_FLAGS (type) & TYPE_FLAG_PERM)
- TYPE_FLAGS (ptype) |= TYPE_FLAG_PERM;
- TYPE_LENGTH (ptype) = 1;
- TYPE_CODE (ptype) = TYPE_CODE_FUNC;
- TYPE_NFIELDS (ptype) = 0;
- return ptype;
-}
-
-/* Create an array type. Elements will be of type TYPE, and there will
- be NUM of them.
-
- Eventually this should be extended to take two more arguments which
- specify the bounds of the array and the type of the index.
- It should also be changed to be a "lookup" function, with the
- appropriate data structures added to the type field.
- Then read array type should call here. */
-
-struct type *
-create_array_type (element_type, number)
- struct type *element_type;
- int number;
-{
- struct type *result_type = (struct type *)
- obstack_alloc (symbol_obstack, sizeof (struct type));
- struct type *range_type;
-
- bzero (result_type, sizeof (struct type));
-
- TYPE_CODE (result_type) = TYPE_CODE_ARRAY;
- TYPE_TARGET_TYPE (result_type) = element_type;
- TYPE_LENGTH (result_type) = number * TYPE_LENGTH (element_type);
- TYPE_NFIELDS (result_type) = 1;
- TYPE_FIELDS (result_type) =
- (struct field *) obstack_alloc (symbol_obstack, sizeof (struct field));
-
- {
- /* Create range type. */
- range_type = (struct type *) obstack_alloc (symbol_obstack,
- sizeof (struct type));
- TYPE_CODE (range_type) = TYPE_CODE_RANGE;
- TYPE_TARGET_TYPE (range_type) = builtin_type_int; /* FIXME */
-
- /* This should never be needed. */
- TYPE_LENGTH (range_type) = sizeof (int);
-
- TYPE_NFIELDS (range_type) = 2;
- TYPE_FIELDS (range_type) =
- (struct field *) obstack_alloc (symbol_obstack,
- 2 * sizeof (struct field));
- TYPE_FIELD_BITPOS (range_type, 0) = 0; /* FIXME */
- TYPE_FIELD_BITPOS (range_type, 1) = number-1; /* FIXME */
- TYPE_FIELD_TYPE (range_type, 0) = builtin_type_int; /* FIXME */
- TYPE_FIELD_TYPE (range_type, 1) = builtin_type_int; /* FIXME */
- }
- TYPE_FIELD_TYPE(result_type,0)=range_type;
- TYPE_VPTR_FIELDNO (result_type) = -1;
-
- return result_type;
-}
-
-
-/* Smash TYPE to be a type of members of DOMAIN with type TO_TYPE. */
-
-void
-smash_to_member_type (type, domain, to_type)
- struct type *type, *domain, *to_type;
-{
- bzero (type, sizeof (struct type));
- TYPE_TARGET_TYPE (type) = to_type;
- TYPE_DOMAIN_TYPE (type) = domain;
-
- /* In practice, this is never needed. */
- TYPE_LENGTH (type) = 1;
- TYPE_CODE (type) = TYPE_CODE_MEMBER;
-
- TYPE_MAIN_VARIANT (type) = lookup_member_type (domain, to_type);
-}
-
-/* Smash TYPE to be a type of method of DOMAIN with type TO_TYPE. */
-
-void
-smash_to_method_type (type, domain, to_type, args)
- struct type *type, *domain, *to_type, **args;
-{
- bzero (type, sizeof (struct type));
- TYPE_TARGET_TYPE (type) = to_type;
- TYPE_DOMAIN_TYPE (type) = domain;
- TYPE_ARG_TYPES (type) = args;
-
- /* In practice, this is never needed. */
- TYPE_LENGTH (type) = 1;
- TYPE_CODE (type) = TYPE_CODE_METHOD;
-
- TYPE_MAIN_VARIANT (type) = lookup_method_type (domain, to_type, args);
-}
-
-/* Find which partial symtab on the partial_symtab_list contains
- PC. Return 0 if none. */
-
-struct partial_symtab *
-find_pc_psymtab (pc)
- register CORE_ADDR pc;
-{
- register struct partial_symtab *ps;
-
- for (ps = partial_symtab_list; ps; ps = ps->next)
- if (pc >= ps->textlow && pc < ps->texthigh)
- return ps;
-
- return 0;
-}
-
-/* Find which partial symbol within a psymtab contains PC. Return 0
- if none. Check all psymtabs if PSYMTAB is 0. */
-struct partial_symbol *
-find_pc_psymbol (psymtab, pc)
- struct partial_symtab *psymtab;
- CORE_ADDR pc;
-{
- struct partial_symbol *best, *p;
- CORE_ADDR best_pc;
-
- if (!psymtab)
- psymtab = find_pc_psymtab (pc);
- if (!psymtab)
- return 0;
-
- best_pc = psymtab->textlow - 1;
-
- for (p = static_psymbols.list + psymtab->statics_offset;
- (p - (static_psymbols.list + psymtab->statics_offset)
- < psymtab->n_static_syms);
- p++)
- if (SYMBOL_NAMESPACE (p) == VAR_NAMESPACE
- && SYMBOL_CLASS (p) == LOC_BLOCK
- && pc >= SYMBOL_VALUE_ADDRESS (p)
- && SYMBOL_VALUE_ADDRESS (p) > best_pc)
- {
- best_pc = SYMBOL_VALUE_ADDRESS (p);
- best = p;
- }
- if (best_pc == psymtab->textlow - 1)
- return 0;
- return best;
-}
-
-
-/* Find the definition for a specified symbol name NAME
- in namespace NAMESPACE, visible from lexical block BLOCK.
- Returns the struct symbol pointer, or zero if no symbol is found.
- If SYMTAB is non-NULL, store the symbol table in which the
- symbol was found there, or NULL if not found.
- C++: if IS_A_FIELD_OF_THIS is nonzero on entry, check to see if
- NAME is a field of the current implied argument `this'. If so set
- *IS_A_FIELD_OF_THIS to 1, otherwise set it to zero.
- BLOCK_FOUND is set to the block in which NAME is found (in the case of
- a field of `this', value_of_this sets BLOCK_FOUND to the proper value.) */
-
-struct symbol *
-lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
- char *name;
- register struct block *block;
- enum namespace namespace;
- int *is_a_field_of_this;
- struct symtab **symtab;
-{
- register struct symbol *sym;
- register struct symtab *s;
- register struct partial_symtab *ps;
- struct blockvector *bv;
-
- /* Search specified block and its superiors. */
-
- while (block != 0)
- {
- sym = lookup_block_symbol (block, name, namespace);
- if (sym)
- {
- block_found = block;
- if (symtab != NULL)
- {
- /* Search the list of symtabs for one which contains the
- address of the start of this block. */
- struct block *b;
- for (s = symtab_list; s; s = s->next)
- {
- bv = BLOCKVECTOR (s);
- b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- if (BLOCK_START (b) <= BLOCK_START (block)
- && BLOCK_END (b) > BLOCK_START (block))
- break;
- }
- *symtab = s;
- }
-
- return sym;
- }
- block = BLOCK_SUPERBLOCK (block);
- }
-
- /* But that doesn't do any demangling for the STATIC_BLOCK.
- I'm not sure whether demangling is needed in the case of
- nested function in inner blocks; if so this needs to be changed.
-
- Don't need to mess with the psymtabs; if we have a block,
- that file is read in. If we don't, then we deal later with
- all the psymtab stuff that needs checking. */
- if (namespace == VAR_NAMESPACE && block != NULL)
- {
- struct block *b;
- /* Find the right symtab. */
- for (s = symtab_list; s; s = s->next)
- {
- bv = BLOCKVECTOR (s);
- b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- if (BLOCK_START (b) <= BLOCK_START (block)
- && BLOCK_END (b) > BLOCK_START (block))
- {
- sym = lookup_demangled_block_symbol (b, name);
- if (sym)
- {
- block_found = b;
- if (symtab != NULL)
- *symtab = s;
- return sym;
- }
- }
- }
- }
-
-
- /* C++: If requested to do so by the caller,
- check to see if NAME is a field of `this'. */
- if (is_a_field_of_this)
- {
- struct value *v = value_of_this (0);
-
- *is_a_field_of_this = 0;
- if (v && check_field (v, name))
- {
- *is_a_field_of_this = 1;
- if (symtab != NULL)
- *symtab = NULL;
- return 0;
- }
- }
-
- /* Now search all global blocks. Do the symtab's first, then
- check the psymtab's */
-
- for (s = symtab_list; s; s = s->next)
- {
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
- if (sym)
- {
- block_found = block;
- if (symtab != NULL)
- *symtab = s;
- return sym;
- }
- }
-
- /* Check for the possibility of the symbol being a global function
- that is stored on the misc function vector. Eventually, all
- global symbols might be resolved in this way. */
-
- if (namespace == VAR_NAMESPACE)
- {
- int ind = lookup_misc_func (name);
-
- /* Look for a mangled C++ name for NAME. */
- if (ind == -1)
- {
- int name_len = strlen (name);
-
- for (ind = misc_function_count; --ind >= 0; )
- /* Assume orginal name is prefix of mangled name. */
- if (!strncmp (misc_function_vector[ind].name, name, name_len))
- {
- char *demangled =
- cplus_demangle(misc_function_vector[ind].name, -1);
- if (demangled != NULL)
- {
- int cond = strcmp (demangled, name);
- free (demangled);
- if (!cond)
- break;
- }
- }
- /* Loop terminates on no match with ind == -1. */
- }
-
- if (ind != -1)
- {
- s = find_pc_symtab (misc_function_vector[ind].address);
- /* If S is zero, there are no debug symbols for this file.
- Skip this stuff and check for matching static symbols below. */
- if (s)
- {
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, misc_function_vector[ind].name,
- namespace);
- /* sym == 0 if symbol was found in the misc_function_vector
- but not in the symtab.
- Return 0 to use the misc_function definition of "foo_".
-
- This happens for Fortran "foo_" symbols,
- which are "foo" in the symtab.
-
- This can also happen if "asm" is used to make a
- regular symbol but not a debugging symbol, e.g.
- asm(".globl _main");
- asm("_main:");
- */
-
- if (symtab != NULL)
- *symtab = s;
- return sym;
- }
- }
- }
-
- for (ps = partial_symtab_list; ps; ps = ps->next)
- if (!ps->readin && lookup_partial_symbol (ps, name, 1, namespace))
- {
- s = PSYMTAB_TO_SYMTAB(ps);
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
- if (!sym)
- error ("Internal: global symbol `%s' found in psymtab but not in symtab", name);
- if (symtab != NULL)
- *symtab = s;
- return sym;
- }
-
- /* Now search all per-file blocks.
- Not strictly correct, but more useful than an error.
- Do the symtabs first, then check the psymtabs */
-
- for (s = symtab_list; s; s = s->next)
- {
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
- if (sym)
- {
- block_found = block;
- if (symtab != NULL)
- *symtab = s;
- return sym;
- }
- }
-
- for (ps = partial_symtab_list; ps; ps = ps->next)
- if (!ps->readin && lookup_partial_symbol (ps, name, 0, namespace))
- {
- s = PSYMTAB_TO_SYMTAB(ps);
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
- if (!sym)
- error ("Internal: static symbol `%s' found in psymtab but not in symtab", name);
- if (symtab != NULL)
- *symtab = s;
- return sym;
- }
-
- /* Now search all per-file blocks for static mangled symbols.
- Do the symtabs first, then check the psymtabs. */
-
- if (namespace == VAR_NAMESPACE)
- {
- for (s = symtab_list; s; s = s->next)
- {
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_demangled_block_symbol (block, name);
- if (sym)
- {
- block_found = block;
- if (symtab != NULL)
- *symtab = s;
- return sym;
- }
- }
-
- for (ps = partial_symtab_list; ps; ps = ps->next)
- if (!ps->readin && lookup_demangled_partial_symbol (ps, name))
- {
- s = PSYMTAB_TO_SYMTAB(ps);
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_demangled_block_symbol (block, name);
- if (!sym)
- error ("Internal: mangled static symbol `%s' found in psymtab but not in symtab", name);
- if (symtab != NULL)
- *symtab = s;
- return sym;
- }
- }
-
- if (symtab != NULL)
- *symtab = NULL;
- return 0;
-}
-
-/* Look for a static demangled symbol in block BLOCK. */
-
-static struct symbol *
-lookup_demangled_block_symbol (block, name)
- register struct block *block;
- char *name;
-{
- register int bot, top, inc;
- register struct symbol *sym;
-
- bot = 0;
- top = BLOCK_NSYMS (block);
- inc = name[0];
-
- while (bot < top)
- {
- sym = BLOCK_SYM (block, bot);
- if (SYMBOL_NAME (sym)[0] == inc
- && SYMBOL_NAMESPACE (sym) == VAR_NAMESPACE)
- {
- char *demangled = cplus_demangle(SYMBOL_NAME (sym), -1);
- if (demangled != NULL)
- {
- int cond = strcmp (demangled, name);
- free (demangled);
- if (!cond)
- return sym;
- }
- }
- bot++;
- }
-
- return 0;
-}
-
-/* Look, in partial_symtab PST, for static mangled symbol NAME. */
-
-static struct partial_symbol *
-lookup_demangled_partial_symbol (pst, name)
- struct partial_symtab *pst;
- char *name;
-{
- struct partial_symbol *start, *psym;
- int length = pst->n_static_syms;
- register int inc = name[0];
-
- if (!length)
- return (struct partial_symbol *) 0;
-
- start = static_psymbols.list + pst->statics_offset;
- for (psym = start; psym < start + length; psym++)
- {
- if (SYMBOL_NAME (psym)[0] == inc
- && SYMBOL_NAMESPACE (psym) == VAR_NAMESPACE)
- {
- char *demangled = cplus_demangle(SYMBOL_NAME (psym), -1);
- if (demangled != NULL)
- {
- int cond = strcmp (demangled, name);
- free (demangled);
- if (!cond)
- return psym;
- }
- }
- }
-
- return (struct partial_symbol *) 0;
-}
-
-/* Look, in partial_symtab PST, for symbol NAME. Check the global
- symbols if GLOBAL, the static symbols if not */
-
-static struct partial_symbol *
-lookup_partial_symbol (pst, name, global, namespace)
- struct partial_symtab *pst;
- char *name;
- int global;
- enum namespace namespace;
-{
- struct partial_symbol *start, *psym;
- int length = (global ? pst->n_global_syms : pst->n_static_syms);
-
- if (!length)
- return (struct partial_symbol *) 0;
-
- start = (global ?
- global_psymbols.list + pst->globals_offset :
- static_psymbols.list + pst->statics_offset );
-
- if (global) /* This means we can use a binary */
- /* search. */
- {
- struct partial_symbol *top, *bottom, *center;
-
- /* Binary search. This search is guaranteed to end with center
- pointing at the earliest partial symbol with the correct
- name. At that point *all* partial symbols with that name
- will be checked against the correct namespace. */
- bottom = start;
- top = start + length - 1;
- while (top > bottom)
- {
- center = bottom + (top - bottom) / 2;
-
- assert (center < top);
-
- if (strcmp (SYMBOL_NAME (center), name) >= 0)
- top = center;
- else
- bottom = center + 1;
- }
- assert (top == bottom);
-
- while (!strcmp (SYMBOL_NAME (top), name))
- {
- if (SYMBOL_NAMESPACE (top) == namespace)
- return top;
- top ++;
- }
- }
- else
- {
- /* Can't use a binary search */
- for (psym = start; psym < start + length; psym++)
- if (namespace == SYMBOL_NAMESPACE (psym)
- && !strcmp (name, SYMBOL_NAME (psym)))
- return psym;
- }
-
- return (struct partial_symbol *) 0;
-}
-
-/* Find the psymtab containing main(). */
-
-struct partial_symtab *
-find_main_psymtab ()
-{
- register struct partial_symtab *pst;
- for (pst = partial_symtab_list; pst; pst = pst->next)
- if (lookup_partial_symbol (pst, "main", 1, VAR_NAMESPACE))
- return pst;
- return NULL;
-}
-
-/* Look for a symbol in block BLOCK. */
-
-struct symbol *
-lookup_block_symbol (block, name, namespace)
- register struct block *block;
- char *name;
- enum namespace namespace;
-{
- register int bot, top, inc;
- register struct symbol *sym, *parameter_sym;
-
- top = BLOCK_NSYMS (block);
- bot = 0;
-
- /* If the blocks's symbols were sorted, start with a binary search. */
-
- if (BLOCK_SHOULD_SORT (block))
- {
- /* First, advance BOT to not far before
- the first symbol whose name is NAME. */
-
- while (1)
- {
- inc = (top - bot + 1);
- /* No need to keep binary searching for the last few bits worth. */
- if (inc < 4)
- break;
- inc = (inc >> 1) + bot;
- sym = BLOCK_SYM (block, inc);
- if (SYMBOL_NAME (sym)[0] < name[0])
- bot = inc;
- else if (SYMBOL_NAME (sym)[0] > name[0])
- top = inc;
- else if (strcmp (SYMBOL_NAME (sym), name) < 0)
- bot = inc;
- else
- top = inc;
- }
-
- /* Now scan forward until we run out of symbols,
- find one whose name is greater than NAME,
- or find one we want.
- If there is more than one symbol with the right name and namespace,
- we return the first one. dbxread.c is careful to make sure
- that if one is a register then it comes first. */
-
- top = BLOCK_NSYMS (block);
- while (bot < top)
- {
- sym = BLOCK_SYM (block, bot);
- inc = SYMBOL_NAME (sym)[0] - name[0];
- if (inc == 0)
- inc = strcmp (SYMBOL_NAME (sym), name);
- if (inc == 0 && SYMBOL_NAMESPACE (sym) == namespace)
- return sym;
- if (inc > 0)
- return 0;
- bot++;
- }
- return 0;
- }
-
- /* Here if block isn't sorted.
- This loop is equivalent to the loop above,
- but hacked greatly for speed.
-
- Note that parameter symbols do not always show up last in the
- list; this loop makes sure to take anything else other than
- parameter symbols first; it only uses parameter symbols as a
- last resort. Note that this only takes up extra computation
- time on a match. */
-
- parameter_sym = (struct symbol *) 0;
- top = BLOCK_NSYMS (block);
- inc = name[0];
- while (bot < top)
- {
- sym = BLOCK_SYM (block, bot);
- if (SYMBOL_NAME (sym)[0] == inc
- && !strcmp (SYMBOL_NAME (sym), name)
- && SYMBOL_NAMESPACE (sym) == namespace)
- {
- if (SYMBOL_CLASS (sym) == LOC_ARG
- || SYMBOL_CLASS (sym) == LOC_LOCAL_ARG
- || SYMBOL_CLASS (sym) == LOC_REF_ARG
- || SYMBOL_CLASS (sym) == LOC_REGPARM)
- parameter_sym = sym;
- else
- return sym;
- }
- bot++;
- }
- return parameter_sym; /* Will be 0 if not found. */
-}
-
-/* Return the symbol for the function which contains a specified
- lexical block, described by a struct block BL. */
-
-struct symbol *
-block_function (bl)
- struct block *bl;
-{
- while (BLOCK_FUNCTION (bl) == 0 && BLOCK_SUPERBLOCK (bl) != 0)
- bl = BLOCK_SUPERBLOCK (bl);
-
- return BLOCK_FUNCTION (bl);
-}
-
-/* Subroutine of find_pc_line */
-
-struct symtab *
-find_pc_symtab (pc)
- register CORE_ADDR pc;
-{
- register struct block *b;
- struct blockvector *bv;
- register struct symtab *s;
- register struct partial_symtab *ps;
-
- /* Search all symtabs for one whose file contains our pc */
-
- for (s = symtab_list; s; s = s->next)
- {
- bv = BLOCKVECTOR (s);
- b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- if (BLOCK_START (b) <= pc
- && BLOCK_END (b) > pc)
- break;
- }
-
- if (!s)
- {
- ps = find_pc_psymtab (pc);
- if (ps && ps->readin)
- printf_filtered (
- "(Internal error: pc 0x%x in read in psymtab, but not in symtab.)\n", pc);
-
- if (ps)
- s = PSYMTAB_TO_SYMTAB (ps);
- }
-
- return s;
-}
-
-/* Find the source file and line number for a given PC value.
- Return a structure containing a symtab pointer, a line number,
- and a pc range for the entire source line.
- The value's .pc field is NOT the specified pc.
- NOTCURRENT nonzero means, if specified pc is on a line boundary,
- use the line that ends there. Otherwise, in that case, the line
- that begins there is used. */
-
-struct symtab_and_line
-find_pc_line (pc, notcurrent)
- CORE_ADDR pc;
- int notcurrent;
-{
- struct symtab *s;
- register struct linetable *l;
- register int len;
- register int i;
- register struct linetable_entry *item;
- struct symtab_and_line val;
- struct blockvector *bv;
-
- /* Info on best line seen so far, and where it starts, and its file. */
-
- int best_line = 0;
- CORE_ADDR best_pc = 0;
- CORE_ADDR best_end = 0;
- struct symtab *best_symtab = 0;
-
- /* Store here the first line number
- of a file which contains the line at the smallest pc after PC.
- If we don't find a line whose range contains PC,
- we will use a line one less than this,
- with a range from the start of that file to the first line's pc. */
- int alt_line = 0;
- CORE_ADDR alt_pc = 0;
- struct symtab *alt_symtab = 0;
-
- /* Info on best line seen in this file. */
-
- int prev_line;
- CORE_ADDR prev_pc;
-
- /* Info on first line of this file. */
-
- int first_line;
- CORE_ADDR first_pc;
-
- /* If this pc is not from the current frame,
- it is the address of the end of a call instruction.
- Quite likely that is the start of the following statement.
- But what we want is the statement containing the instruction.
- Fudge the pc to make sure we get that. */
-
- if (notcurrent) pc -= 1;
-
- s = find_pc_symtab (pc);
- if (s == 0)
- {
- val.symtab = 0;
- val.line = 0;
- val.pc = pc;
- val.end = 0;
- return val;
- }
-
- bv = BLOCKVECTOR (s);
-
- /* Look at all the symtabs that share this blockvector.
- They all have the same apriori range, that we found was right;
- but they have different line tables. */
-
- for (; s && BLOCKVECTOR (s) == bv; s = s->next)
- {
- /* Find the best line in this symtab. */
- l = LINETABLE (s);
- if (!l)
- continue;
- len = l->nitems;
- prev_line = -1;
- first_line = -1;
- for (i = 0; i < len; i++)
- {
- item = &(l->item[i]);
-
- if (first_line < 0)
- {
- first_line = item->line;
- first_pc = item->pc;
- }
- /* Return the last line that did not start after PC. */
- if (pc >= item->pc)
- {
- prev_line = item->line;
- prev_pc = item->pc;
- }
- else
- break;
- }
-
- /* Is this file's best line closer than the best in the other files?
- If so, record this file, and its best line, as best so far. */
- if (prev_line >= 0 && prev_pc > best_pc)
- {
- best_pc = prev_pc;
- best_line = prev_line;
- best_symtab = s;
- if (i < len)
- best_end = item->pc;
- else
- best_end = 0;
- }
- /* Is this file's first line closer than the first lines of other files?
- If so, record this file, and its first line, as best alternate. */
- if (first_line >= 0 && first_pc > pc
- && (alt_pc == 0 || first_pc < alt_pc))
- {
- alt_pc = first_pc;
- alt_line = first_line;
- alt_symtab = s;
- }
- }
- if (best_symtab == 0)
- {
- val.symtab = alt_symtab;
- val.line = alt_line - 1;
- val.pc = BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK));
- val.end = alt_pc;
- }
- else
- {
- val.symtab = best_symtab;
- val.line = best_line;
- val.pc = best_pc;
- val.end = (best_end ? best_end
- : (alt_pc ? alt_pc
- : BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK))));
- }
- return val;
-}
-
-/* Find the PC value for a given source file and line number.
- Returns zero for invalid line number.
- The source file is specified with a struct symtab. */
-
-CORE_ADDR
-find_line_pc (symtab, line)
- struct symtab *symtab;
- int line;
-{
- register struct linetable *l;
- register int ind;
- int dummy;
-
- if (symtab == 0)
- return 0;
- l = LINETABLE (symtab);
- ind = find_line_common(l, line, &dummy);
- return (ind >= 0) ? l->item[ind].pc : 0;
-}
-
-/* Find the range of pc values in a line.
- Store the starting pc of the line into *STARTPTR
- and the ending pc (start of next line) into *ENDPTR.
- Returns 1 to indicate success.
- Returns 0 if could not find the specified line. */
-
-int
-find_line_pc_range (symtab, thisline, startptr, endptr)
- struct symtab *symtab;
- int thisline;
- CORE_ADDR *startptr, *endptr;
-{
- register struct linetable *l;
- register int ind;
- int exact_match; /* did we get an exact linenumber match */
-
- if (symtab == 0)
- return 0;
-
- l = LINETABLE (symtab);
- ind = find_line_common (l, thisline, &exact_match);
- if (ind >= 0)
- {
- *startptr = l->item[ind].pc;
- /* If we have not seen an entry for the specified line,
- assume that means the specified line has zero bytes. */
- if (!exact_match || ind == l->nitems-1)
- *endptr = *startptr;
- else
- /* Perhaps the following entry is for the following line.
- It's worth a try. */
- if (ind+1 < l->nitems
- && l->item[ind+1].line == thisline + 1)
- *endptr = l->item[ind+1].pc;
- else
- *endptr = find_line_pc (symtab, thisline+1);
- return 1;
- }
-
- return 0;
-}
-
-/* Given a line table and a line number, return the index into the line
- table for the pc of the nearest line whose number is >= the specified one.
- Return -1 if none is found. The value is >= 0 if it is an index.
-
- Set *EXACT_MATCH nonzero if the value returned is an exact match. */
-
-static int
-find_line_common (l, lineno, exact_match)
- register struct linetable *l;
- register int lineno;
- int *exact_match;
-{
- register int i;
- register int len;
-
- /* BEST is the smallest linenumber > LINENO so far seen,
- or 0 if none has been seen so far.
- BEST_INDEX identifies the item for it. */
-
- int best_index = -1;
- int best = 0;
-
- if (lineno <= 0)
- return -1;
- if (l == 0)
- return -1;
-
- len = l->nitems;
- for (i = 0; i < len; i++)
- {
- register struct linetable_entry *item = &(l->item[i]);
-
- if (item->line == lineno)
- {
- *exact_match = 1;
- return i;
- }
-
- if (item->line > lineno && (best == 0 || item->line < best))
- {
- best = item->line;
- best_index = i;
- }
- }
-
- /* If we got here, we didn't get an exact match. */
-
- *exact_match = 0;
- return best_index;
-}
-
-int
-find_pc_line_pc_range (pc, startptr, endptr)
- CORE_ADDR pc;
- CORE_ADDR *startptr, *endptr;
-{
- struct symtab_and_line sal;
- sal = find_pc_line (pc, 0);
- *startptr = sal.pc;
- *endptr = sal.end;
- return sal.symtab != 0;
-}
-
-/* If P is of the form "operator[ \t]+..." where `...' is
- some legitimate operator text, return a pointer to the
- beginning of the substring of the operator text.
- Otherwise, return "". */
-static char *
-operator_chars (p, end)
- char *p;
- char **end;
-{
- *end = "";
- if (strncmp (p, "operator", 8))
- return *end;
- p += 8;
-
- /* Don't get faked out by `operator' being part of a longer
- identifier. */
- if ((*p >= 'A' && *p <= 'Z') || (*p >= 'a' && *p <= 'z')
- || *p == '_' || *p == '$' || *p == '\0')
- return *end;
-
- /* Allow some whitespace between `operator' and the operator symbol. */
- while (*p == ' ' || *p == '\t')
- p++;
-
- switch (*p)
- {
- case '!':
- case '=':
- case '*':
- case '/':
- case '%':
- case '^':
- if (p[1] == '=')
- *end = p+2;
- else
- *end = p+1;
- return p;
- case '<':
- case '>':
- case '+':
- case '-':
- case '&':
- case '|':
- if (p[1] == '=' || p[1] == p[0])
- *end = p+2;
- else
- *end = p+1;
- return p;
- case '~':
- case ',':
- *end = p+1;
- return p;
- case '(':
- if (p[1] != ')')
- error ("`operator ()' must be specified without whitespace in `()'");
- *end = p+2;
- return p;
- case '?':
- if (p[1] != ':')
- error ("`operator ?:' must be specified without whitespace in `?:'");
- *end = p+2;
- return p;
- case '[':
- if (p[1] != ']')
- error ("`operator []' must be specified without whitespace in `[]'");
- *end = p+2;
- return p;
- default:
- error ("`operator %s' not supported", p);
- break;
- }
- *end = "";
- return *end;
-}
-
-/* Recursive helper function for decode_line_1.
- * Look for methods named NAME in type T.
- * Return number of matches.
- * Put matches in PHYSNAMES and SYM_ARR (which better be big enough!).
- * These allocations seem to define "big enough":
- * sym_arr = (struct symbol **) alloca(TYPE_NFN_FIELDS_TOTAL (t) * sizeof(struct symbol*));
- * physnames = (char **) alloca (TYPE_NFN_FIELDS_TOTAL (t) * sizeof(char*));
- */
-
-int
-find_methods(t, name, physnames, sym_arr)
- struct type *t;
- char *name;
- char **physnames;
- struct symbol **sym_arr;
-{
- int i1 = 0;
- int ibase;
- struct symbol *sym_class;
- char *class_name = type_name_no_tag (t);
- /* Ignore this class if it doesn't have a name.
- This prevents core dumps, but is just a workaround
- because we might not find the function in
- certain cases, such as
- struct D {virtual int f();}
- struct C : D {virtual int g();}
- (in this case g++ 1.35.1- does not put out a name
- for D as such, it defines type 19 (for example) in
- the same stab as C, and then does a
- .stabs "D:T19" and a .stabs "D:t19".
- Thus
- "break C::f" should not be looking for field f in
- the class named D,
- but just for the field f in the baseclasses of C
- (no matter what their names).
-
- However, I don't know how to replace the code below
- that depends on knowing the name of D. */
- if (class_name
- && (sym_class = lookup_symbol (class_name,
- (struct block *)NULL,
- STRUCT_NAMESPACE,
- (int *)NULL,
- (struct symtab **)NULL)))
- {
- int method_counter;
- t = SYMBOL_TYPE (sym_class);
- for (method_counter = TYPE_NFN_FIELDS (t) - 1;
- method_counter >= 0;
- --method_counter)
- {
- int field_counter;
- struct fn_field *f = TYPE_FN_FIELDLIST1 (t, method_counter);
-
- char *method_name = TYPE_FN_FIELDLIST_NAME (t, method_counter);
- if (!strcmp (name, method_name))
- /* Find all the fields with that name. */
- for (field_counter = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1;
- field_counter >= 0;
- --field_counter)
- {
- char *phys_name;
- if (TYPE_FLAGS (TYPE_FN_FIELD_TYPE (f, field_counter)) & TYPE_FLAG_STUB)
- check_stub_method (t, method_counter, field_counter);
- phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter);
- physnames[i1] = (char*) alloca (strlen (phys_name) + 1);
- strcpy (physnames[i1], phys_name);
- sym_arr[i1] = lookup_symbol (phys_name,
- SYMBOL_BLOCK_VALUE (sym_class),
- VAR_NAMESPACE,
- (int *) NULL,
- (struct symtab **) NULL);
- if (sym_arr[i1]) i1++;
- }
- }
- }
- /* Only search baseclasses if there is no match yet,
- * since names in derived classes override those in baseclasses.
- */
- if (i1)
- return i1;
- for (ibase = 0; ibase < TYPE_N_BASECLASSES (t); ibase++)
- i1 += find_methods(TYPE_BASECLASS(t, ibase), name,
- physnames + i1, sym_arr + i1);
- return i1;
-}
-
-/* Parse a string that specifies a line number.
- Pass the address of a char * variable; that variable will be
- advanced over the characters actually parsed.
-
- The string can be:
-
- LINENUM -- that line number in current file. PC returned is 0.
- FILE:LINENUM -- that line in that file. PC returned is 0.
- FUNCTION -- line number of openbrace of that function.
- PC returned is the start of the function.
- VARIABLE -- line number of definition of that variable.
- PC returned is 0.
- FILE:FUNCTION -- likewise, but prefer functions in that file.
- *EXPR -- line in which address EXPR appears.
-
- FUNCTION may be an undebuggable function found in misc_function_vector.
-
- If the argument FUNFIRSTLINE is nonzero, we want the first line
- of real code inside a function when a function is specified.
-
- DEFAULT_SYMTAB specifies the file to use if none is specified.
- It defaults to current_source_symtab.
- DEFAULT_LINE specifies the line number to use for relative
- line numbers (that start with signs). Defaults to current_source_line.
-
- Note that it is possible to return zero for the symtab
- if no file is validly specified. Callers must check that.
- Also, the line number returned may be invalid. */
-
-struct symtabs_and_lines
-decode_line_1 (argptr, funfirstline, default_symtab, default_line)
- char **argptr;
- int funfirstline;
- struct symtab *default_symtab;
- int default_line;
-{
- struct symtabs_and_lines decode_line_2 ();
- struct symtabs_and_lines values;
- struct symtab_and_line val;
- register char *p, *p1;
- char *q, *q1;
- register struct symtab *s;
-
- register struct symbol *sym;
- /* The symtab that SYM was found in. */
- struct symtab *sym_symtab;
-
- register CORE_ADDR pc;
- register int i;
- char *copy;
- struct symbol *sym_class;
- int i1;
- struct symbol **sym_arr;
- struct type *t;
- char **physnames;
-
- /* Defaults have defaults. */
-
- if (default_symtab == 0)
- {
- default_symtab = current_source_symtab;
- default_line = current_source_line;
- }
-
- /* See if arg is *PC */
-
- if (**argptr == '*')
- {
- (*argptr)++;
- pc = parse_and_eval_address_1 (argptr);
- values.sals = (struct symtab_and_line *)
- xmalloc (sizeof (struct symtab_and_line));
- values.nelts = 1;
- values.sals[0] = find_pc_line (pc, 0);
- values.sals[0].pc = pc;
- return values;
- }
-
- /* Maybe arg is FILE : LINENUM or FILE : FUNCTION */
-
- s = 0;
-
- for (p = *argptr; *p; p++)
- {
- if (p[0] == ':' || p[0] == ' ' || p[0] == '\t')
- break;
- }
- while (p[0] == ' ' || p[0] == '\t') p++;
-
- if (p[0] == ':')
- {
-
- /* C++ */
- if (p[1] ==':')
- {
- /* Extract the class name. */
- p1 = p;
- while (p != *argptr && p[-1] == ' ') --p;
- copy = (char *) alloca (p - *argptr + 1);
- bcopy (*argptr, copy, p - *argptr);
- copy[p - *argptr] = 0;
-
- /* Discard the class name from the arg. */
- p = p1 + 2;
- while (*p == ' ' || *p == '\t') p++;
- *argptr = p;
-
- sym_class = lookup_symbol (copy, 0, STRUCT_NAMESPACE, 0,
- (struct symtab **)NULL);
-
- if (sym_class &&
- (TYPE_CODE (SYMBOL_TYPE (sym_class)) == TYPE_CODE_STRUCT
- || TYPE_CODE (SYMBOL_TYPE (sym_class)) == TYPE_CODE_UNION))
- {
- /* Arg token is not digits => try it as a function name
- Find the next token (everything up to end or next whitespace). */
- p = *argptr;
- while (*p && *p != ' ' && *p != '\t' && *p != ',' && *p !=':') p++;
- q = operator_chars (*argptr, &q1);
-
- copy = (char *) alloca (p - *argptr + 1 + (q1 - q));
- if (q1 - q)
- {
- copy[0] = 'o';
- copy[1] = 'p';
- copy[2] = CPLUS_MARKER;
- bcopy (q, copy + 3, q1 - q);
- copy[3 + (q1 - q)] = '\0';
- p = q1;
- }
- else
- {
- bcopy (*argptr, copy, p - *argptr);
- copy[p - *argptr] = '\0';
- }
-
- /* no line number may be specified */
- while (*p == ' ' || *p == '\t') p++;
- *argptr = p;
-
- sym = 0;
- i1 = 0; /* counter for the symbol array */
- t = SYMBOL_TYPE (sym_class);
- sym_arr = (struct symbol **) alloca(TYPE_NFN_FIELDS_TOTAL (t) * sizeof(struct symbol*));
- physnames = (char **) alloca (TYPE_NFN_FIELDS_TOTAL (t) * sizeof(char*));
-
- if (destructor_name_p (copy, t))
- {
- /* destructors are a special case. */
- struct fn_field *f = TYPE_FN_FIELDLIST1 (t, 0);
- int len = TYPE_FN_FIELDLIST_LENGTH (t, 0) - 1;
- char *phys_name = TYPE_FN_FIELD_PHYSNAME (f, len);
- physnames[i1] = (char *)alloca (strlen (phys_name) + 1);
- strcpy (physnames[i1], phys_name);
- sym_arr[i1] =
- lookup_symbol (phys_name, SYMBOL_BLOCK_VALUE (sym_class),
- VAR_NAMESPACE, 0, (struct symtab **)NULL);
- if (sym_arr[i1]) i1++;
- }
- else
- i1 = find_methods (t, copy, physnames, sym_arr);
- if (i1 == 1)
- {
- /* There is exactly one field with that name. */
- sym = sym_arr[0];
-
- if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
- {
- /* Arg is the name of a function */
- pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) + FUNCTION_START_OFFSET;
- if (funfirstline)
- SKIP_PROLOGUE (pc);
- values.sals = (struct symtab_and_line *)xmalloc (sizeof (struct symtab_and_line));
- values.nelts = 1;
- values.sals[0] = find_pc_line (pc, 0);
- values.sals[0].pc = (values.sals[0].end && values.sals[0].pc != pc) ? values.sals[0].end : pc;
- }
- else
- {
- values.nelts = 0;
- }
- return values;
- }
- if (i1 > 0)
- {
- /* There is more than one field with that name
- (overloaded). Ask the user which one to use. */
- return decode_line_2 (sym_arr, i1, funfirstline);
- }
- else
- {
- char *tmp;
-
- if (OPNAME_PREFIX_P (copy))
- {
- tmp = (char *)alloca (strlen (copy+3) + 9);
- strcpy (tmp, "operator ");
- strcat (tmp, copy+3);
- }
- else
- tmp = copy;
- if (tmp[0] == '~')
- error ("The class `%s' does not have destructor defined",
- sym_class->name);
- else
- error ("The class %s does not have any method named %s",
- sym_class->name, tmp);
- }
- }
- else
- /* The quotes are important if copy is empty. */
- error("No class, struct, or union named \"%s\"", copy );
- }
- /* end of C++ */
-
-
- /* Extract the file name. */
- p1 = p;
- while (p != *argptr && p[-1] == ' ') --p;
- copy = (char *) alloca (p - *argptr + 1);
- bcopy (*argptr, copy, p - *argptr);
- copy[p - *argptr] = 0;
-
- /* Find that file's data. */
- s = lookup_symtab (copy);
- if (s == 0)
- {
- if (symtab_list == 0 && partial_symtab_list == 0)
- error (no_symtab_msg);
- error ("No source file named %s.", copy);
- }
-
- /* Discard the file name from the arg. */
- p = p1 + 1;
- while (*p == ' ' || *p == '\t') p++;
- *argptr = p;
- }
-
- /* S is specified file's symtab, or 0 if no file specified.
- arg no longer contains the file name. */
-
- /* Check whether arg is all digits (and sign) */
-
- p = *argptr;
- if (*p == '-' || *p == '+') p++;
- while (*p >= '0' && *p <= '9')
- p++;
-
- if (p != *argptr && (*p == 0 || *p == ' ' || *p == '\t' || *p == ','))
- {
- /* We found a token consisting of all digits -- at least one digit. */
- enum sign {none, plus, minus} sign = none;
-
- /* This is where we need to make sure that we have good defaults.
- We must guarantee that this section of code is never executed
- when we are called with just a function name, since
- select_source_symtab calls us with such an argument */
-
- if (s == 0 && default_symtab == 0)
- {
- select_source_symtab (0);
- default_symtab = current_source_symtab;
- default_line = current_source_line;
- }
-
- if (**argptr == '+')
- sign = plus, (*argptr)++;
- else if (**argptr == '-')
- sign = minus, (*argptr)++;
- val.line = atoi (*argptr);
- switch (sign)
- {
- case plus:
- if (p == *argptr)
- val.line = 5;
- if (s == 0)
- val.line = default_line + val.line;
- break;
- case minus:
- if (p == *argptr)
- val.line = 15;
- if (s == 0)
- val.line = default_line - val.line;
- else
- val.line = 1;
- break;
- case none:
- break; /* No need to adjust val.line. */
- }
-
- while (*p == ' ' || *p == '\t') p++;
- *argptr = p;
- if (s == 0)
- s = default_symtab;
- val.symtab = s;
- val.pc = 0;
- values.sals = (struct symtab_and_line *)xmalloc (sizeof (struct symtab_and_line));
- values.sals[0] = val;
- values.nelts = 1;
- return values;
- }
-
- /* Arg token is not digits => try it as a variable name
- Find the next token (everything up to end or next whitespace). */
- p = *argptr;
- while (*p && *p != ' ' && *p != '\t' && *p != ',') p++;
- copy = (char *) alloca (p - *argptr + 1);
- bcopy (*argptr, copy, p - *argptr);
- copy[p - *argptr] = 0;
- while (*p == ' ' || *p == '\t') p++;
- *argptr = p;
-
- /* Look up that token as a variable.
- If file specified, use that file's per-file block to start with. */
-
- sym = lookup_symbol (copy,
- (s ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)
- : get_selected_block ()),
- VAR_NAMESPACE, 0, &sym_symtab);
-
- if (sym != NULL)
- {
- if (SYMBOL_CLASS (sym) == LOC_BLOCK)
- {
- /* Arg is the name of a function */
- pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) + FUNCTION_START_OFFSET;
- if (funfirstline)
- SKIP_PROLOGUE (pc);
- val = find_pc_line (pc, 0);
-#ifdef PROLOGUE_FIRSTLINE_OVERLAP
- /* Convex: no need to suppress code on first line, if any */
- val.pc = pc;
-#else
- val.pc = (val.end && val.pc != pc) ? val.end : pc;
-#endif
- values.sals = (struct symtab_and_line *)xmalloc (sizeof (struct symtab_and_line));
- values.sals[0] = val;
- values.nelts = 1;
-
- /* I think this is always the same as the line that
- we calculate above, but the general principle is
- "trust the symbols more than stuff like
- SKIP_PROLOGUE". */
- if (SYMBOL_LINE (sym) != 0)
- values.sals[0].line = SYMBOL_LINE (sym);
-
- return values;
- }
- else if (SYMBOL_LINE (sym) != 0)
- {
- /* We know its line number. */
- values.sals = (struct symtab_and_line *)
- xmalloc (sizeof (struct symtab_and_line));
- values.nelts = 1;
- bzero (&values.sals[0], sizeof (values.sals[0]));
- values.sals[0].symtab = sym_symtab;
- values.sals[0].line = SYMBOL_LINE (sym);
- return values;
- }
- else
- /* This can happen if it is compiled with a compiler which doesn't
- put out line numbers for variables. */
- error ("Line number not known for symbol \"%s\"", copy);
- }
-
- if ((i = lookup_misc_func (copy)) >= 0)
- {
- val.symtab = 0;
- val.line = 0;
- val.pc = misc_function_vector[i].address + FUNCTION_START_OFFSET;
- if (funfirstline)
- SKIP_PROLOGUE (val.pc);
- values.sals = (struct symtab_and_line *)xmalloc (sizeof (struct symtab_and_line));
- values.sals[0] = val;
- values.nelts = 1;
- return values;
- }
-
- if (symtab_list == 0 && partial_symtab_list == 0 && misc_function_count == 0)
- error (no_symtab_msg);
-
- error ("Function %s not defined.", copy);
- return values; /* for lint */
-}
-
-struct symtabs_and_lines
-decode_line_spec (string, funfirstline)
- char *string;
- int funfirstline;
-{
- struct symtabs_and_lines sals;
- if (string == 0)
- error ("Empty line specification.");
- sals = decode_line_1 (&string, funfirstline,
- current_source_symtab, current_source_line);
- if (*string)
- error ("Junk at end of line specification: %s", string);
- return sals;
-}
-
-/* Given a list of NELTS symbols in sym_arr (with corresponding
- mangled names in physnames), return a list of lines to operate on
- (ask user if necessary). */
-struct symtabs_and_lines
-decode_line_2 (sym_arr, nelts, funfirstline)
- struct symbol *sym_arr[];
- int nelts;
- int funfirstline;
-{
- struct symtabs_and_lines values, return_values;
- register CORE_ADDR pc;
- char *args, *arg1, *command_line_input ();
- int i;
- char *prompt;
-
- values.sals = (struct symtab_and_line *) alloca (nelts * sizeof(struct symtab_and_line));
- return_values.sals = (struct symtab_and_line *) xmalloc (nelts * sizeof(struct symtab_and_line));
-
- i = 0;
- printf("[0] cancel\n[1] all\n");
- while (i < nelts)
- {
- if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK)
- {
- /* Arg is the name of a function */
- pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym_arr[i]))
- + FUNCTION_START_OFFSET;
- if (funfirstline)
- SKIP_PROLOGUE (pc);
- values.sals[i] = find_pc_line (pc, 0);
- values.sals[i].pc = (values.sals[i].end && values.sals[i].pc != pc) ?
- values.sals[i].end : pc;
- printf("[%d] file:%s; line number:%d\n",
- (i+2), values.sals[i].symtab->filename, values.sals[i].line);
- }
- else printf ("?HERE\n");
- i++;
- }
-
- if ((prompt = getenv ("PS2")) == NULL)
- {
- prompt = ">";
- }
- printf("%s ",prompt);
- fflush(stdout);
-
- args = command_line_input (0, 0);
-
- if (args == 0)
- error_no_arg ("one or more choice numbers");
-
- i = 0;
- while (*args)
- {
- int num;
-
- arg1 = args;
- while (*arg1 >= '0' && *arg1 <= '9') arg1++;
- if (*arg1 && *arg1 != ' ' && *arg1 != '\t')
- error ("Arguments must be choice numbers.");
-
- num = atoi (args);
-
- if (num == 0)
- error ("cancelled");
- else if (num == 1)
- {
- bcopy (values.sals, return_values.sals, (nelts * sizeof(struct symtab_and_line)));
- return_values.nelts = nelts;
- return return_values;
- }
-
- if (num > nelts + 2)
- {
- printf ("No choice number %d.\n", num);
- }
- else
- {
- num -= 2;
- if (values.sals[num].pc)
- {
- return_values.sals[i++] = values.sals[num];
- values.sals[num].pc = 0;
- }
- else
- {
- printf ("duplicate request for %d ignored.\n", num);
- }
- }
-
- args = arg1;
- while (*args == ' ' || *args == '\t') args++;
- }
- return_values.nelts = i;
- return return_values;
-}
-
-/* Return the index of misc function named NAME. */
-
-int
-lookup_misc_func (name)
- register char *name;
-{
- register int i;
-
- for (i = 0; i < misc_function_count; i++)
- if (!strcmp (misc_function_vector[i].name, name))
- return i;
- return -1; /* not found */
-}
-
-/* Slave routine for sources_info. Force line breaks at ,'s.
- NAME is the name to print and *FIRST is nonzero if this is the first
- name printed. Set *FIRST to zero. */
-static void
-output_source_filename (name, first)
- char *name;
- int *first;
-{
- static int column;
- /* Table of files printed so far. Since a single source file can
- result in several partial symbol tables, we need to avoid printing
- it more than once. Note: if some of the psymtabs are read in and
- some are not, it gets printed both under "Source files for which
- symbols have been read" and "Source files for which symbols will
- be read in on demand". I consider this a reasonable way to deal
- with the situation. I'm not sure whether this can also happen for
- symtabs; it doesn't hurt to check. */
- static char **tab = NULL;
- /* Allocated size of tab in elements.
- Start with one 256-byte block (when using GNU malloc.c).
- 24 is the malloc overhead when range checking is in effect. */
- static int tab_alloc_size = (256 - 24) / sizeof (char *);
- /* Current size of tab in elements. */
- static int tab_cur_size;
-
- char **p;
-
- if (*first)
- {
- if (tab == NULL)
- tab = (char **) xmalloc (tab_alloc_size * sizeof (*tab));
- tab_cur_size = 0;
- }
-
- /* Is NAME in tab? */
- for (p = tab; p < tab + tab_cur_size; p++)
- if (strcmp (*p, name) == 0)
- /* Yes; don't print it again. */
- return;
- /* No; add it to tab. */
- if (tab_cur_size == tab_alloc_size)
- {
- tab_alloc_size *= 2;
- tab = (char **) xrealloc (tab, tab_alloc_size * sizeof (*tab));
- }
- tab[tab_cur_size++] = name;
-
- if (*first)
- {
- column = 0;
- *first = 0;
- }
- else
- {
- printf_filtered (",");
- column++;
- }
-
- if (column != 0 && column + strlen (name) >= 70)
- {
- printf_filtered ("\n");
- column = 0;
- }
- else if (column != 0)
- {
- printf_filtered (" ");
- column++;
- }
- fputs_filtered (name, stdout);
- column += strlen (name);
-}
-
-static void
-sources_info ()
-{
- register struct symtab *s;
- register struct partial_symtab *ps;
- int first;
-
- if (symtab_list == 0 && partial_symtab_list == 0)
- {
- printf (no_symtab_msg);
- return;
- }
-
- printf_filtered ("Source files for which symbols have been read in:\n\n");
-
- first = 1;
- for (s = symtab_list; s; s = s->next)
- output_source_filename (s->filename, &first);
- printf_filtered ("\n\n");
-
- printf_filtered ("Source files for which symbols will be read in on demand:\n\n");
-
- first = 1;
- for (ps = partial_symtab_list; ps; ps = ps->next)
- if (!ps->readin)
- output_source_filename (ps->filename, &first);
- printf_filtered ("\n");
-}
-
-/* List all symbols (if REGEXP is 0) or all symbols matching REGEXP.
- If CLASS is zero, list all symbols except functions and type names.
- If CLASS is 1, list only functions.
- If CLASS is 2, list only type names.
- If CLASS is 3, list only method names.
-
- BPT is non-zero if we should set a breakpoint at the functions
- we find. */
-
-static void
-list_symbols (regexp, class, bpt)
- char *regexp;
- int class;
- int bpt;
-{
- register struct symtab *s;
- register struct partial_symtab *ps;
- register struct blockvector *bv;
- struct blockvector *prev_bv = 0;
- register struct block *b;
- register int i, j;
- register struct symbol *sym;
- struct partial_symbol *psym;
- char *val;
- static char *classnames[]
- = {"variable", "function", "type", "method"};
- int found_in_file = 0;
- int found_misc = 0;
- static enum misc_function_type types[]
- = {mf_data, mf_text, mf_abs, mf_unknown};
- static enum misc_function_type types2[]
- = {mf_bss, mf_text, mf_abs, mf_unknown};
- enum misc_function_type ourtype = types[class];
- enum misc_function_type ourtype2 = types2[class];
-
- if (regexp)
- if (0 != (val = re_comp (regexp)))
- error ("Invalid regexp (%s): %s", val, regexp);
-
- /* Search through the partial_symtab_list *first* for all symbols
- matching the regexp. That way we don't have to reproduce all of
- the machinery below. */
- for (ps = partial_symtab_list; ps; ps = ps->next)
- {
- struct partial_symbol *bound, *gbound, *sbound;
- int keep_going = 1;
-
- if (ps->readin) continue;
-
- gbound = global_psymbols.list + ps->globals_offset + ps->n_global_syms;
- sbound = static_psymbols.list + ps->statics_offset + ps->n_static_syms;
- bound = gbound;
-
- /* Go through all of the symbols stored in a partial
- symtab in one loop. */
- psym = global_psymbols.list + ps->globals_offset;
- while (keep_going)
- {
- if (psym >= bound)
- {
- if (bound == gbound && ps->n_static_syms != 0)
- {
- psym = static_psymbols.list + ps->statics_offset;
- bound = sbound;
- }
- else
- keep_going = 0;
- continue;
- }
- else
- {
- QUIT;
-
- /* If it would match (logic taken from loop below)
- load the file and go on to the next one */
- if ((regexp == 0 || re_exec (SYMBOL_NAME (psym)))
- && ((class == 0 && SYMBOL_CLASS (psym) != LOC_TYPEDEF
- && SYMBOL_CLASS (psym) != LOC_BLOCK)
- || (class == 1 && SYMBOL_CLASS (psym) == LOC_BLOCK)
- || (class == 2 && SYMBOL_CLASS (psym) == LOC_TYPEDEF)
- || (class == 3 && SYMBOL_CLASS (psym) == LOC_BLOCK)))
- {
- (void) PSYMTAB_TO_SYMTAB(ps);
- keep_going = 0;
- }
- }
- psym++;
- }
- }
-
- /* Here, we search through the misc function vector for functions that
- match, and call find_pc_symtab on them to force their symbols to
- be read. The symbol will then be found during the scan of symtabs
- below. If find_pc_symtab fails, set found_misc so that we will
- rescan to print any matching symbols without debug info. */
-
- if (class == 1) {
- for (i = 0; i < misc_function_count; i++) {
- if (misc_function_vector[i].type != ourtype
- && misc_function_vector[i].type != ourtype2)
- continue;
- if (regexp == 0 || re_exec (misc_function_vector[i].name)) {
- if (0 == find_pc_symtab (misc_function_vector[i].address))
- found_misc = 1;
- }
- }
- }
-
- /* Printout here so as to get after the "Reading in symbols"
- messages which will be generated above. */
- if (!bpt)
- printf_filtered (regexp
- ? "All %ss matching regular expression \"%s\":\n"
- : "All defined %ss:\n",
- classnames[class],
- regexp);
-
- for (s = symtab_list; s; s = s->next)
- {
- found_in_file = 0;
- bv = BLOCKVECTOR (s);
- /* Often many files share a blockvector.
- Scan each blockvector only once so that
- we don't get every symbol many times.
- It happens that the first symtab in the list
- for any given blockvector is the main file. */
- if (bv != prev_bv)
- for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
- {
- b = BLOCKVECTOR_BLOCK (bv, i);
- /* Skip the sort if this block is always sorted. */
- if (!BLOCK_SHOULD_SORT (b))
- sort_block_syms (b);
- for (j = 0; j < BLOCK_NSYMS (b); j++)
- {
- QUIT;
- sym = BLOCK_SYM (b, j);
- if ((regexp == 0 || re_exec (SYMBOL_NAME (sym)))
- && ((class == 0 && SYMBOL_CLASS (sym) != LOC_TYPEDEF
- && SYMBOL_CLASS (sym) != LOC_BLOCK)
- || (class == 1 && SYMBOL_CLASS (sym) == LOC_BLOCK)
- || (class == 2 && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
- || (class == 3 && SYMBOL_CLASS (sym) == LOC_BLOCK)))
- {
- if (bpt)
- {
- /* Set a breakpoint here, if it's a function */
- if (class == 1)
- break_command (SYMBOL_NAME(sym), 0);
- }
- else if (!found_in_file)
- {
- fputs_filtered ("\nFile ", stdout);
- fputs_filtered (s->filename, stdout);
- fputs_filtered (":\n", stdout);
- }
- found_in_file = 1;
-
- if (class != 2 && i == STATIC_BLOCK)
- printf_filtered ("static ");
-
- /* Typedef that is not a C++ class */
- if (class == 2
- && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE)
- typedef_print (SYMBOL_TYPE(sym), sym, stdout);
- /* variable, func, or typedef-that-is-c++-class */
- else if (class < 2 ||
- (class == 2 &&
- SYMBOL_NAMESPACE(sym) == STRUCT_NAMESPACE))
- {
- type_print (SYMBOL_TYPE (sym),
- (SYMBOL_CLASS (sym) == LOC_TYPEDEF
- ? "" : SYMBOL_NAME (sym)),
- stdout, 0);
-
- printf_filtered (";\n");
- }
- else
- {
-# if 0
- char buf[1024];
- type_print_base (TYPE_FN_FIELD_TYPE(t, i), stdout, 0, 0);
- type_print_varspec_prefix (TYPE_FN_FIELD_TYPE(t, i), stdout, 0);
- sprintf (buf, " %s::", type_name_no_tag (t));
- type_print_method_args (TYPE_FN_FIELD_ARGS (t, i), buf, name, stdout);
-# endif
- }
- }
- }
- }
- prev_bv = bv;
- }
-
-
- /* If there are no eyes, avoid all contact. I mean, if there are
- no debug symbols, then print directly from the misc_function_vector. */
-
- if (found_misc || class != 1) {
- found_in_file = 0;
- for (i = 0; i < misc_function_count; i++) {
- if (misc_function_vector[i].type != ourtype
- && misc_function_vector[i].type != ourtype2)
- continue;
- if (regexp == 0 || re_exec (misc_function_vector[i].name)) {
- /* Functions: Look up by address. */
- if (class == 1)
- if (0 != find_pc_symtab (misc_function_vector[i].address))
- continue;
- /* Variables/Absolutes: Look up by name */
- if (0 != lookup_symbol (misc_function_vector[i].name,
- (struct block *)0, VAR_NAMESPACE, 0, (struct symtab **)0))
- continue;
- if (!found_in_file) {
- printf_filtered ("\nNon-debugging symbols:\n");
- found_in_file = 1;
- }
- printf_filtered (" %08x %s\n",
- misc_function_vector[i].address,
- misc_function_vector[i].name);
- }
- }
- }
-}
-
-static void
-variables_info (regexp)
- char *regexp;
-{
- list_symbols (regexp, 0, 0);
-}
-
-static void
-functions_info (regexp)
- char *regexp;
-{
- list_symbols (regexp, 1, 0);
-}
-
-static void
-types_info (regexp)
- char *regexp;
-{
- list_symbols (regexp, 2, 0);
-}
-
-#if 0
-/* Tiemann says: "info methods was never implemented." */
-static void
-methods_info (regexp)
- char *regexp;
-{
- list_symbols (regexp, 3, 0);
-}
-#endif /* 0 */
-
-/* Breakpoint all functions matching regular expression. */
-static void
-rbreak_command (regexp)
- char *regexp;
-{
- list_symbols (regexp, 1, 1);
-}
-
-/* Helper function to initialize the standard scalar types. */
-
-struct type *
-init_type (code, length, uns, name)
- enum type_code code;
- int length, uns;
- char *name;
-{
- register struct type *type;
-
- type = (struct type *) xmalloc (sizeof (struct type));
- bzero (type, sizeof *type);
- TYPE_MAIN_VARIANT (type) = type;
- TYPE_CODE (type) = code;
- TYPE_LENGTH (type) = length;
- TYPE_FLAGS (type) = uns ? TYPE_FLAG_UNSIGNED : 0;
- TYPE_FLAGS (type) |= TYPE_FLAG_PERM;
- TYPE_NFIELDS (type) = 0;
- TYPE_NAME (type) = name;
-
- /* C++ fancies. */
- TYPE_NFN_FIELDS (type) = 0;
- TYPE_N_BASECLASSES (type) = 0;
- return type;
-}
-
-/* Return Nonzero if block a is lexically nested within block b,
- or if a and b have the same pc range.
- Return zero otherwise. */
-int
-contained_in (a, b)
- struct block *a, *b;
-{
- if (!a || !b)
- return 0;
- return BLOCK_START (a) >= BLOCK_START (b)
- && BLOCK_END (a) <= BLOCK_END (b);
-}
-
-
-/* Helper routine for make_symbol_completion_list. */
-
-int return_val_size, return_val_index;
-char **return_val;
-
-void
-completion_list_add_symbol (symname)
- char *symname;
-{
- if (return_val_index + 3 > return_val_size)
- return_val =
- (char **)xrealloc (return_val,
- (return_val_size *= 2) * sizeof (char *));
-
- return_val[return_val_index] =
- (char *)xmalloc (1 + strlen (symname));
-
- strcpy (return_val[return_val_index], symname);
-
- return_val[++return_val_index] = (char *)NULL;
-}
-
-/* Return a NULL terminated array of all symbols (regardless of class) which
- begin by matching TEXT. If the answer is no symbols, then the return value
- is an array which contains only a NULL pointer.
-
- Problem: All of the symbols have to be copied because readline
- frees them. I'm not going to worry about this; hopefully there
- won't be that many. */
-
-char **
-make_symbol_completion_list (text)
- char *text;
-{
- register struct symtab *s;
- register struct partial_symtab *ps;
- register struct block *b, *surrounding_static_block = 0;
- extern struct block *get_selected_block ();
- register int i, j;
- struct partial_symbol *psym;
-
- int text_len = strlen (text);
- return_val_size = 100;
- return_val_index = 0;
- return_val =
- (char **)xmalloc ((1 + return_val_size) *sizeof (char *));
- return_val[0] = (char *)NULL;
-
- /* Look through the partial symtabs for all symbols which begin
- by matching TEXT. Add each one that you find to the list. */
-
- for (ps = partial_symtab_list; ps; ps = ps->next)
- {
- /* If the psymtab's been read in we'll get it when we search
- through the blockvector. */
- if (ps->readin) continue;
-
- for (psym = global_psymbols.list + ps->globals_offset;
- psym < (global_psymbols.list + ps->globals_offset
- + ps->n_global_syms);
- psym++)
- {
- QUIT; /* If interrupted, then quit. */
- if ((strncmp (SYMBOL_NAME (psym), text, text_len) == 0))
- completion_list_add_symbol (SYMBOL_NAME (psym));
- }
-
- for (psym = static_psymbols.list + ps->statics_offset;
- psym < (static_psymbols.list + ps->statics_offset
- + ps->n_static_syms);
- psym++)
- {
- QUIT;
- if ((strncmp (SYMBOL_NAME (psym), text, text_len) == 0))
- completion_list_add_symbol (SYMBOL_NAME (psym));
- }
- }
-
- /* At this point scan through the misc function vector and add each
- symbol you find to the list. Eventually we want to ignore
- anything that isn't a text symbol (everything else will be
- handled by the psymtab code above). */
-
- for (i = 0; i < misc_function_count; i++)
- if (!strncmp (text, misc_function_vector[i].name, text_len))
- completion_list_add_symbol (misc_function_vector[i].name);
-
- /* Search upwards from currently selected frame (so that we can
- complete on local vars. */
- for (b = get_selected_block (); b; b = BLOCK_SUPERBLOCK (b))
- {
- if (!BLOCK_SUPERBLOCK (b))
- surrounding_static_block = b; /* For elmin of dups */
-
- /* Also catch fields of types defined in this places which
- match our text string. Only complete on types visible
- from current context. */
- for (i = 0; i < BLOCK_NSYMS (b); i++)
- {
- register struct symbol *sym = BLOCK_SYM (b, i);
-
- if (!strncmp (SYMBOL_NAME (sym), text, text_len))
- completion_list_add_symbol (SYMBOL_NAME (sym));
-
- if (SYMBOL_CLASS (sym) == LOC_TYPEDEF)
- {
- struct type *t = SYMBOL_TYPE (sym);
- enum type_code c = TYPE_CODE (t);
-
- if (c == TYPE_CODE_UNION || c == TYPE_CODE_STRUCT)
- for (j = TYPE_N_BASECLASSES (t); j < TYPE_NFIELDS (t); j++)
- if (TYPE_FIELD_NAME (t, j) &&
- !strncmp (TYPE_FIELD_NAME (t, j), text, text_len))
- completion_list_add_symbol (TYPE_FIELD_NAME (t, j));
- }
- }
- }
-
- /* Go through the symtabs and check the externs and statics for
- symbols which match. */
-
- for (s = symtab_list; s; s = s->next)
- {
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
-
- for (i = 0; i < BLOCK_NSYMS (b); i++)
- if (!strncmp (SYMBOL_NAME (BLOCK_SYM (b, i)), text, text_len))
- completion_list_add_symbol (SYMBOL_NAME (BLOCK_SYM (b, i)));
- }
-
- for (s = symtab_list; s; s = s->next)
- {
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
-
- /* Don't do this block twice. */
- if (b == surrounding_static_block) continue;
-
- for (i = 0; i < BLOCK_NSYMS (b); i++)
- if (!strncmp (SYMBOL_NAME (BLOCK_SYM (b, i)), text, text_len))
- completion_list_add_symbol (SYMBOL_NAME (BLOCK_SYM (b, i)));
- }
-
- return (return_val);
-}
-
-#if 0
-/* Add the type of the symbol sym to the type of the current
- function whose block we are in (assumed). The type of
- this current function is contained in *TYPE.
-
- This basically works as follows: When we find a function
- symbol (N_FUNC with a 'f' or 'F' in the symbol name), we record
- a pointer to its type in the global in_function_type. Every
- time we come across a parameter symbol ('p' in its name), then
- this procedure adds the name and type of that parameter
- to the function type pointed to by *TYPE. (Which should correspond
- to in_function_type if it was called correctly).
-
- Note that since we are modifying a type, the result of
- lookup_function_type() should be bcopy()ed before calling
- this. When not in strict typing mode, the expression
- evaluator can choose to ignore this.
-
- Assumption: All of a function's parameter symbols will
- appear before another function symbol is found. The parameters
- appear in the same order in the argument list as they do in the
- symbol table. */
-
-void
-add_param_to_type (type,sym)
- struct type **type;
- struct symbol *sym;
-{
- int num = ++(TYPE_NFIELDS(*type));
-
- if(TYPE_NFIELDS(*type)-1)
- TYPE_FIELDS(*type) =
- (struct field *)xrealloc((char *)(TYPE_FIELDS(*type)),
- num*sizeof(struct field));
- else
- TYPE_FIELDS(*type) =
- (struct field *)xmalloc(num*sizeof(struct field));
-
- TYPE_FIELD_BITPOS(*type,num-1) = num-1;
- TYPE_FIELD_BITSIZE(*type,num-1) = 0;
- TYPE_FIELD_TYPE(*type,num-1) = SYMBOL_TYPE(sym);
- TYPE_FIELD_NAME(*type,num-1) = SYMBOL_NAME(sym);
-}
-#endif
-
-void
-_initialize_symtab ()
-{
- add_info ("variables", variables_info,
- "All global and static variable names, or those matching REGEXP.");
- add_info ("functions", functions_info,
- "All function names, or those matching REGEXP.");
-
- /* FIXME: This command has at least the following problems:
- 1. It prints builtin types (in a very strange and confusing fashion).
- 2. It doesn't print right, e.g. with
- typedef struct foo *FOO
- type_print prints "FOO" when we want to make it (in this situation)
- print "struct foo *".
- I also think "ptype" or "whatis" is more likely to be useful (but if
- there is much disagreement "info types" can be fixed). */
- add_info ("types", types_info,
- "All types names, or those matching REGEXP.");
-
-#if 0
- add_info ("methods", methods_info,
- "All method names, or those matching REGEXP::REGEXP.\n\
-If the class qualifier is ommited, it is assumed to be the current scope.\n\
-If the first REGEXP is ommited, then all methods matching the second REGEXP\n\
-are listed.");
-#endif
- add_info ("sources", sources_info,
- "Source files in the program.");
-
- add_com ("rbreak", no_class, rbreak_command,
- "Set a breakpoint for all functions matching REGEXP.");
-
- /* Initialize the one built-in type that isn't language dependent... */
- builtin_type_error = init_type (TYPE_CODE_ERROR, 0, 0, "<unknown type>");
-}
diff --git a/gdb/symtab.h b/gdb/symtab.h
deleted file mode 100644
index c97c22a..0000000
--- a/gdb/symtab.h
+++ /dev/null
@@ -1,922 +0,0 @@
-/* Symbol table definitions for GDB.
- Copyright (C) 1986, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined (SYMTAB_H)
-#define SYMTAB_H 1
-#include <obstack.h>
-
-/* An obstack to hold objects that should be freed
- when we load a new symbol table.
- This includes the symbols made by dbxread
- and the types that are not permanent. */
-
-extern struct obstack *symbol_obstack;
-extern struct obstack *psymbol_obstack;
-
-/* Some definitions and declarations to go with use of obstacks. */
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
-#ifdef __STDC__
-extern void *xmalloc ();
-#else
-extern char *xmalloc ();
-#endif
-extern void free ();
-
-/* Some macros for char-based bitfields. */
-#define B_SET(a,x) (a[x>>3] |= (1 << (x&7)))
-#define B_CLR(a,x) (a[x>>3] &= ~(1 << (x&7)))
-#define B_TST(a,x) (a[x>>3] & (1 << (x&7)))
-#define B_TYPE unsigned char
-#define B_BYTES(x) ( 1 + ((x)>>3) )
-#define B_CLRALL(a,x) bzero (a, B_BYTES(x))
-
-/* gdb can know one or several symbol tables at the same time;
- the ultimate intent is to have one for each separately-compiled module.
- Each such symbol table is recorded by a struct symtab, and they
- are all chained together. */
-
-/* In addition, gdb can record any number of miscellaneous undebuggable
- functions' addresses. In a system that appends _ to function names,
- the _'s are removed from the names stored in this table. */
-
-/* Actually, the misc function list is used to store *all* of the
- global symbols (text, data, bss, and abs). It is sometimes used
- to figure out what symtabs to read in. The "type" field is used
- occasionally. Calling it the misc "function" vector is now a misnomer.
-
- The misc_info field is available for machine-specific information
- that can be cached along with a misc function vector entry. The
- AMD 29000 tdep.c uses it to remember things it has decoded from the
- instructions in the function header, so it doesn't have to rederive
- the info constantly (over a serial line). It is initialized to zero
- and stays that way until target-dependent code sets it. */
-
-enum misc_function_type {mf_unknown = 0, mf_text, mf_data, mf_bss, mf_abs};
-
-struct misc_function
-{
- char *name;
- CORE_ADDR address;
- char *misc_info; /* Random pointer to misc info. void * but for old C */
- enum misc_function_type type;
-};
-
-/* Address and length of the vector recording all misc function names/addresses. */
-
-struct misc_function *misc_function_vector;
-int misc_function_count;
-
-/* Different kinds of data types are distinguished by the `code' field. */
-
-enum type_code
-{
- TYPE_CODE_UNDEF, /* Not used; catches errors */
- TYPE_CODE_PTR, /* Pointer type */
- TYPE_CODE_ARRAY, /* Array type, lower bound zero */
- TYPE_CODE_STRUCT, /* C struct or Pascal record */
- TYPE_CODE_UNION, /* C union or Pascal variant part */
- TYPE_CODE_ENUM, /* Enumeration type */
- TYPE_CODE_FUNC, /* Function type */
- TYPE_CODE_INT, /* Integer type */
- TYPE_CODE_FLT, /* Floating type */
- TYPE_CODE_VOID, /* Void type (values zero length) */
- TYPE_CODE_SET, /* Pascal sets */
- TYPE_CODE_RANGE, /* Range (integers within spec'd bounds) */
- TYPE_CODE_PASCAL_ARRAY, /* Array with explicit type of index */
- TYPE_CODE_ERROR, /* Unknown type */
-
- /* C++ */
- TYPE_CODE_MEMBER, /* Member type */
- TYPE_CODE_METHOD, /* Method type */
- TYPE_CODE_REF, /* C++ Reference types */
-
- /* Modula-2 */
- TYPE_CODE_CHAR, /* *real* character type */
- TYPE_CODE_BOOL, /* Builtin Modula-2 BOOLEAN */
-};
-
-/* This appears in a type's flags word for an unsigned integer type. */
-#define TYPE_FLAG_UNSIGNED 1
-/* This appears in a type's flags word
- if it is a (pointer to a|function returning a)* built in scalar type.
- These types are never freed. */
-#define TYPE_FLAG_PERM 4
-/* This appears in a type's flags word if it is a stub type (eg. if
- someone referenced a type that wasn't definined in a source file
- via (struct sir_not_appearing_in_this_film *)). */
-#define TYPE_FLAG_STUB 8
-/* Set when a class has a constructor defined */
-#define TYPE_FLAG_HAS_CONSTRUCTOR 256
-/* Set when a class has a destructor defined */
-#define TYPE_FLAG_HAS_DESTRUCTOR 512
-
-struct type
-{
- /* Code for kind of type */
- enum type_code code;
- /* Name of this type, or zero if none.
- This is used for printing only, except by poorly designed C++ code.
- Type names specified as input are defined by symbols. */
- char *name;
- /* Length in bytes of storage for a value of this type */
- unsigned length;
- /* For a pointer type, describes the type of object pointed to.
- For an array type, describes the type of the elements.
- For a function or method type, describes the type of the value.
- For a range type, describes the type of the full range.
- Unused otherwise. */
- struct type *target_type;
- /* Type that is a pointer to this type.
- Zero if no such pointer-to type is known yet.
- The debugger may add the address of such a type
- if it has to construct one later. */
- struct type *pointer_type;
- /* C++: also need a reference type. */
- struct type *reference_type;
- struct type **arg_types;
-
- /* Type that is a function returning this type.
- Zero if no such function type is known here.
- The debugger may add the address of such a type
- if it has to construct one later. */
- struct type *function_type;
-
-/* Handling of pointers to members:
- TYPE_MAIN_VARIANT is used for pointer and pointer
- to member types. Normally it the value of the address of its
- containing type. However, for pointers to members, we must be
- able to allocate pointer to member types and look them up
- from some place of reference.
- NEXT_VARIANT is the next element in the chain.
-
- A long time ago (Jul 88; GDB 2.5) Tiemann said that main_variant
- may no longer be necessary and that he might eliminate it. I don't
- know whether this is still true (or ever was). */
- struct type *main_variant, *next_variant;
-
- /* Flags about this type. */
- short flags;
- /* Number of fields described for this type */
- short nfields;
- /* For structure and union types, a description of each field.
- For set and pascal array types, there is one "field",
- whose type is the domain type of the set or array.
- For range types, there are two "fields",
- the minimum and maximum values (both inclusive).
- For enum types, each possible value is described by one "field".
-
- Using a pointer to a separate array of fields
- allows all types to have the same size, which is useful
- because we can allocate the space for a type before
- we know what to put in it. */
- struct field
- {
- /* Position of this field, counting in bits from start of
- containing structure. For a function type, this is the
- position in the argument list of this argument.
- For a range bound or enum value, this is the value itself. */
- int bitpos;
- /* Size of this field, in bits, or zero if not packed.
- For an unpacked field, the field's type's length
- says how many bytes the field occupies. */
- int bitsize;
- /* In a struct or enum type, type of this field.
- In a function type, type of this argument.
- In an array type, the domain-type of the array. */
- struct type *type;
- /* Name of field, value or argument.
- Zero for range bounds and array domains. */
- char *name;
- } *fields;
-
- /* C++ */
- B_TYPE *virtual_field_bits; /* if base class is virtual */
- B_TYPE *private_field_bits;
- B_TYPE *protected_field_bits;
-
- /* Number of methods described for this type */
- short nfn_fields;
- /* Number of base classes this type derives from. */
- short n_baseclasses;
-
- /* Number of methods described for this type plus all the
- methods that it derives from. */
- int nfn_fields_total;
-
- /* For classes, structures, and unions, a description of each field,
- which consists of an overloaded name, followed by the types of
- arguments that the method expects, and then the name after it
- has been renamed to make it distinct. */
- struct fn_fieldlist
- {
- /* The overloaded name. */
- char *name;
- /* The number of methods with this name. */
- int length;
- /* The list of methods. */
- struct fn_field
- {
- /* The return value of the method */
- struct type *type;
- /* The argument list */
- struct type **args;
- /* The name after it has been processed */
- char *physname;
-
- /* For virtual functions. */
- /* First baseclass that defines this virtual function. */
- struct type *fcontext;
- unsigned int is_const : 1;
- unsigned int is_volatile : 1;
- /* Index into that baseclass's virtual function table,
- minus 2; else if static: VOFFSET_STATIC; else: 0. */
- unsigned voffset : 30;
-# define VOFFSET_STATIC 1
- } *fn_fields;
-
- B_TYPE *private_fn_field_bits;
- B_TYPE *protected_fn_field_bits;
-
- } *fn_fieldlists;
-
- unsigned char via_protected;
- unsigned char via_public;
-
- /* For types with virtual functions, VPTR_BASETYPE is the base class which
- defined the virtual function table pointer. VPTR_FIELDNO is
- the field number of that pointer in the structure.
-
- For types that are pointer to member types, VPTR_BASETYPE
- ifs the type that this pointer is a member of.
-
- Unused otherwise. */
- struct type *vptr_basetype;
-
- int vptr_fieldno;
-};
-
-/* All of the name-scope contours of the program
- are represented by `struct block' objects.
- All of these objects are pointed to by the blockvector.
-
- Each block represents one name scope.
- Each lexical context has its own block.
-
- The first two blocks in the blockvector are special.
- The first one contains all the symbols defined in this compilation
- whose scope is the entire program linked together.
- The second one contains all the symbols whose scope is the
- entire compilation excluding other separate compilations.
- In C, these correspond to global symbols and static symbols.
-
- Each block records a range of core addresses for the code that
- is in the scope of the block. The first two special blocks
- give, for the range of code, the entire range of code produced
- by the compilation that the symbol segment belongs to.
-
- The blocks appear in the blockvector
- in order of increasing starting-address,
- and, within that, in order of decreasing ending-address.
-
- This implies that within the body of one function
- the blocks appear in the order of a depth-first tree walk. */
-
-struct blockvector
-{
- /* Number of blocks in the list. */
- int nblocks;
- /* The blocks themselves. */
- struct block *block[1];
-};
-
-/* Special block numbers */
-#define GLOBAL_BLOCK 0
-#define STATIC_BLOCK 1
-#define FIRST_LOCAL_BLOCK 2
-
-struct block
-{
- /* Addresses in the executable code that are in this block.
- Note: in an unrelocated symbol segment in a file,
- these are always zero. They can be filled in from the
- N_LBRAC and N_RBRAC symbols in the loader symbol table. */
- CORE_ADDR startaddr, endaddr;
- /* The symbol that names this block,
- if the block is the body of a function;
- otherwise, zero.
- Note: In an unrelocated symbol segment in an object file,
- this field may be zero even when the block has a name.
- That is because the block is output before the name
- (since the name resides in a higher block).
- Since the symbol does point to the block (as its value),
- it is possible to find the block and set its name properly. */
- struct symbol *function;
- /* The `struct block' for the containing block, or 0 if none. */
- /* Note that in an unrelocated symbol segment in an object file
- this pointer may be zero when the correct value should be
- the second special block (for symbols whose scope is one compilation).
- This is because the compiler ouptuts the special blocks at the
- very end, after the other blocks. */
- struct block *superblock;
- /* A flag indicating whether or not the fucntion corresponding
- to this block was compiled with gcc or not. If there is no
- function corresponding to this block, this meaning of this flag
- is undefined. (In practice it will be 1 if the block was created
- while processing a file compiled with gcc and 0 when not). */
- unsigned char gcc_compile_flag;
- /* Number of local symbols. */
- int nsyms;
- /* The symbols. */
- struct symbol *sym[1];
-};
-
-/* Represent one symbol name; a variable, constant, function or typedef. */
-
-/* Different name spaces for symbols. Looking up a symbol specifies
- a namespace and ignores symbol definitions in other name spaces.
-
- VAR_NAMESPACE is the usual namespace.
- In C, this contains variables, function names, typedef names
- and enum type values.
-
- STRUCT_NAMESPACE is used in C to hold struct, union and enum type names.
- Thus, if `struct foo' is used in a C program,
- it produces a symbol named `foo' in the STRUCT_NAMESPACE.
-
- LABEL_NAMESPACE may be used for names of labels (for gotos);
- currently it is not used and labels are not recorded at all. */
-
-/* For a non-global symbol allocated statically,
- the correct core address cannot be determined by the compiler.
- The compiler puts an index number into the symbol's value field.
- This index number can be matched with the "desc" field of
- an entry in the loader symbol table. */
-
-enum namespace
-{
- UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE, LABEL_NAMESPACE,
-};
-
-/* An address-class says where to find the value of a symbol. */
-
-enum address_class
-{
- LOC_UNDEF, /* Not used; catches errors */
- LOC_CONST, /* Value is constant int SYMBOL_VALUE, host byteorder */
- LOC_STATIC, /* Value is at fixed address SYMBOL_VALUE_ADDRESS */
- LOC_REGISTER, /* Value is in register */
- LOC_ARG, /* Value is at spec'd offset in arglist */
- LOC_REF_ARG, /* Value address is at spec'd offset in arglist. */
- LOC_REGPARM, /* Value is at spec'd offset in register window */
- LOC_LOCAL, /* Value is at spec'd offset in stack frame */
- LOC_TYPEDEF, /* Value not used; definition in SYMBOL_TYPE
- Symbols in the namespace STRUCT_NAMESPACE
- all have this class. */
- LOC_LABEL, /* Value is address SYMBOL_VALUE_ADDRESS in the code */
- LOC_BLOCK, /* Value is address SYMBOL_VALUE_BLOCK of a
- `struct block'. Function names have this class. */
- LOC_CONST_BYTES, /* Value is a constant byte-sequence pointed to by
- SYMBOL_VALUE_ADDRESS, in target byte order. */
- LOC_LOCAL_ARG, /* Value is arg at spec'd offset in stack frame.
- Differs from LOC_LOCAL in that symbol is an
- argument; differs from LOC_ARG in that we find it
- in the frame (FRAME_LOCALS_ADDRESS), not in the
- arglist (FRAME_ARGS_ADDRESS). Added for i960,
- which passes args in regs then copies to frame. */
-};
-
-struct symbol
-{
- /* Symbol name */
- char *name;
- /* Name space code. */
- enum namespace namespace;
- /* Address class */
- enum address_class class;
- /* Data type of value */
- struct type *type;
-
- /* Line number of definition. */
- unsigned short line;
-
- /* constant value, or address if static, or register number,
- or offset in arguments, or offset in stack frame. All of
- these are in host byte order (though what they point to might
- be in target byte order, e.g. LOC_CONST_BYTES). */
- union
- {
- long value; /* for LOC_CONST, LOC_REGISTER, LOC_ARG,
- LOC_REF_ARG, LOC_REGPARM, LOC_LOCAL */
- struct block *block; /* for LOC_BLOCK */
- char *bytes; /* for LOC_CONST_BYTES */
- CORE_ADDR address; /* for LOC_STATIC, LOC_LABEL */
- struct symbol *chain; /* for opaque typedef struct chain */
- }
- value;
-};
-
-
-/* A partial_symbol records the name, namespace, and address class of
- symbols whose types we have not parsed yet. For functions, it also
- contains their memory address, so we can find them from a PC value.
- Each partial_symbol sits in a partial_symtab, all of which are chained
- on the partial_symtab_list and which points to the corresponding
- normal symtab once the partial_symtab has been referenced. */
-
-struct partial_symbol
-{
- /* Symbol name */
- char *name;
- /* Name space code. */
- enum namespace namespace;
- /* Address class (for info_symbols) */
- enum address_class class;
- /* Value (only used for static functions currently). Done this
- way so that we can use the struct symbol macros.
- Note that the address of a function is SYMBOL_VALUE_ADDRESS (pst)
- in a partial symbol table, but BLOCK_START (SYMBOL_BLOCK_VALUE (st))
- in a symbol table. */
- union
- {
- long value;
- CORE_ADDR address;
- }
- value;
-};
-
-/* Source-file information.
- This describes the relation between source files and line numbers
- and addresses in the program text. */
-
-struct sourcevector
-{
- int length; /* Number of source files described */
- struct source *source[1]; /* Descriptions of the files */
-};
-
-/* Each item represents a line-->pc (or the reverse) mapping. This is
- somewhat more wasteful of space than one might wish, but since only
- the files which are actually debugged are read in to core, we don't
- waste much space.
-
- Each item used to be an int; either minus a line number, or a
- program counter. If it represents a line number, that is the line
- described by the next program counter value. If it is positive, it
- is the program counter at which the code for the next line starts. */
-
-struct linetable_entry
-{
- int line;
- CORE_ADDR pc;
-};
-
-struct linetable
-{
- int nitems;
- struct linetable_entry item[1];
-};
-
-/* All the information on one source file. */
-
-struct source
-{
- char *name; /* Name of file */
- struct linetable contents;
-};
-
-/* Each source file is represented by a struct symtab.
- These objects are chained through the `next' field. */
-
-struct symtab
- {
- /* Chain of all existing symtabs. */
- struct symtab *next;
- /* List of all symbol scope blocks for this symtab. */
- struct blockvector *blockvector;
- /* Table mapping core addresses to line numbers for this file.
- Can be NULL if none. */
- struct linetable *linetable;
- /* Name of this source file. */
- char *filename;
- /* Directory in which it was compiled, or NULL if we don't know. */
- char *dirname;
- /* This component says how to free the data we point to:
- free_contents => do a tree walk and free each object.
- free_nothing => do nothing; some other symtab will free
- the data this one uses.
- free_linetable => free just the linetable. */
- enum free_code {free_nothing, free_contents, free_linetable}
- free_code;
- /* Pointer to one block of storage to be freed, if nonzero. */
- /* This is IN ADDITION to the action indicated by free_code. */
- char *free_ptr;
- /* Total number of lines found in source file. */
- int nlines;
- /* Array mapping line number to character position. */
- int *line_charpos;
- /* Language of this source file. */
- enum language language;
- /* String of version information. May be zero. */
- char *version;
- /* Full name of file as found by searching the source path.
- 0 if not yet known. */
- char *fullname;
-
- /* Object file from which this symbol information was read. */
- struct objfile *objfile;
- /* Chain of all symtabs owned by that objfile. */
- struct symtab *objfile_chain;
-
- /* Anything extra for this symtab. This is for target machines
- with special debugging info of some sort (which cannot just
- be represented in a normal symtab). */
-#if defined (EXTRA_SYMTAB_INFO)
- EXTRA_SYMTAB_INFO
-#endif
- };
-
-/* Each source file that has not been fully read in is represented by
- a partial_symtab. This contains the information on where in the
- executable the debugging symbols for a specific file are, and a
- list of names of global symbols which are located in this file.
- They are all chained on partial_symtab_list.
-
- Even after the source file has been read into a symtab, the
- partial_symtab remains around. They are allocated on an obstack,
- psymbol_obstack. FIXME, this is bad for dynamic linking or VxWorks-
- style execution of a bunch of .o's. */
-struct partial_symtab
-{
- /* Chain of all existing partial symtabs. */
- struct partial_symtab *next;
- /* Name of the source file which this partial_symtab defines */
- char *filename;
-
- /* Information about the object file from which symbols should be read. */
- struct objfile *objfile;
- /* Chain of psymtabs owned by this objfile */
- struct partial_symtab *objfile_chain;
-
- /* Address relative to which the symbols in this file are. Need to
- relocate by this amount when reading in symbols from the symbol
- file. */
- CORE_ADDR addr;
- /* Range of text addresses covered by this file; texthigh is the
- beginning of the next section. */
- CORE_ADDR textlow, texthigh;
- /* Array of pointers to all of the partial_symtab's which this one
- depends on. Since this array can only be set to previous or
- the current (?) psymtab, this dependency tree is guaranteed not
- to have any loops. */
- struct partial_symtab **dependencies;
- int number_of_dependencies;
- /* Global symbol list. This list will be sorted after readin to
- improve access. Binary search will be the usual method of
- finding a symbol within it. globals_offset is an integer offset
- within global_psymbols[]. */
- int globals_offset, n_global_syms;
- /* Static symbol list. This list will *not* be sorted after readin;
- to find a symbol in it, exhaustive search must be used. This is
- reasonable because searches through this list will eventually
- lead to either the read in of a files symbols for real (assumed
- to take a *lot* of time; check) or an error (and we don't care
- how long errors take). This is an offset and size within
- static_psymbols[]. */
- int statics_offset, n_static_syms;
- /* Pointer to symtab eventually allocated for this source file, 0 if
- !readin or if we haven't looked for the symtab after it was readin. */
- struct symtab *symtab;
- /* Pointer to function which will read in the symtab corresponding to
- this psymtab. */
- void (*read_symtab) ();
- /* Information that lets read_symtab() locate the part of the symbol table
- that this psymtab corresponds to. This information is private to the
- format-dependent symbol reading routines. For further detail examine
- the various symbol reading modules. Should really be (void *) but is
- (char *) as with other such gdb variables. (FIXME) */
- char *read_symtab_private;
- /* Non-zero if the symtab corresponding to this psymtab has been
- readin */
- unsigned char readin;
-};
-
-/* A fast way to get from a psymtab to its symtab (after the first time). */
-#define PSYMTAB_TO_SYMTAB(pst) ((pst)->symtab? \
- (pst)->symtab: \
- psymtab_to_symtab (pst) )
-
-/* This is the list of struct symtab's that gdb considers current. */
-
-struct symtab *symtab_list;
-
-/* This is the list of struct partial_symtab's that gdb may need to access */
-
-struct partial_symtab *partial_symtab_list;
-
-/* This symtab variable specifies the current file for printing source lines */
-
-struct symtab *current_source_symtab;
-
-/* This is the next line to print for listing source lines. */
-
-int current_source_line;
-
-#define BLOCKVECTOR(symtab) (symtab)->blockvector
-
-#define LINETABLE(symtab) (symtab)->linetable
-
-/* Macros normally used to access components of symbol table structures. */
-
-#define BLOCKVECTOR_NBLOCKS(blocklist) (blocklist)->nblocks
-#define BLOCKVECTOR_BLOCK(blocklist,n) (blocklist)->block[n]
-
-#define BLOCK_START(bl) (bl)->startaddr
-#define BLOCK_END(bl) (bl)->endaddr
-#define BLOCK_NSYMS(bl) (bl)->nsyms
-#define BLOCK_SYM(bl, n) (bl)->sym[n]
-#define BLOCK_FUNCTION(bl) (bl)->function
-#define BLOCK_SUPERBLOCK(bl) (bl)->superblock
-#define BLOCK_GCC_COMPILED(bl) (bl)->gcc_compile_flag
-
-/* Nonzero if symbols of block BL should be sorted alphabetically. */
-#define BLOCK_SHOULD_SORT(bl) ((bl)->nsyms >= 40)
-
-#define SYMBOL_NAME(symbol) (symbol)->name
-#define SYMBOL_NAMESPACE(symbol) (symbol)->namespace
-#define SYMBOL_CLASS(symbol) (symbol)->class
-#define SYMBOL_VALUE(symbol) (symbol)->value.value
-#define SYMBOL_VALUE_ADDRESS(symbol) (symbol)->value.address
-#define SYMBOL_VALUE_BYTES(symbol) (symbol)->value.bytes
-#define SYMBOL_BLOCK_VALUE(symbol) (symbol)->value.block
-#define SYMBOL_VALUE_CHAIN(symbol) (symbol)->value.chain
-#define SYMBOL_TYPE(symbol) (symbol)->type
-#define SYMBOL_LINE(symbol) (symbol)->line
-
-#define TYPE_NAME(thistype) (thistype)->name
-#define TYPE_TARGET_TYPE(thistype) (thistype)->target_type
-#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
-#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
-#define TYPE_FUNCTION_TYPE(thistype) (thistype)->function_type
-#define TYPE_MAIN_VARIANT(thistype) (thistype)->main_variant
-#define TYPE_NEXT_VARIANT(thistype) (thistype)->next_variant
-#define TYPE_LENGTH(thistype) (thistype)->length
-#define TYPE_FLAGS(thistype) (thistype)->flags
-#define TYPE_UNSIGNED(thistype) ((thistype)->flags & TYPE_FLAG_UNSIGNED)
-#define TYPE_CODE(thistype) (thistype)->code
-#define TYPE_NFIELDS(thistype) (thistype)->nfields
-#define TYPE_FIELDS(thistype) (thistype)->fields
-/* C++ */
-#define TYPE_VPTR_BASETYPE(thistype) (thistype)->vptr_basetype
-#define TYPE_DOMAIN_TYPE(thistype) (thistype)->vptr_basetype
-#define TYPE_VPTR_FIELDNO(thistype) (thistype)->vptr_fieldno
-#define TYPE_FN_FIELDS(thistype) (thistype)->fn_fields
-#define TYPE_NFN_FIELDS(thistype) (thistype)->nfn_fields
-#define TYPE_NFN_FIELDS_TOTAL(thistype) (thistype)->nfn_fields_total
-#define TYPE_ARG_TYPES(thistype) (thistype)->arg_types
-#define TYPE_BASECLASS(thistype,index) (thistype)->fields[index].type
-#define TYPE_N_BASECLASSES(thistype) (thistype)->n_baseclasses
-#define TYPE_BASECLASS_NAME(thistype,index) (thistype)->fields[index].name
-#define TYPE_BASECLASS_BITPOS(thistype,index) (thistype)->fields[index].bitpos
-#define BASETYPE_VIA_PUBLIC(thistype, index) (!TYPE_FIELD_PRIVATE(thistype, index))
-#define BASETYPE_VIA_VIRTUAL(thistype, index) B_TST((thistype)->virtual_field_bits, (index))
-
-#define TYPE_FIELD(thistype, n) (thistype)->fields[n]
-#define TYPE_FIELD_TYPE(thistype, n) (thistype)->fields[n].type
-#define TYPE_FIELD_NAME(thistype, n) (thistype)->fields[n].name
-#define TYPE_FIELD_VALUE(thistype, n) (* (int*) &(thistype)->fields[n].type)
-#define TYPE_FIELD_BITPOS(thistype, n) (thistype)->fields[n].bitpos
-#define TYPE_FIELD_BITSIZE(thistype, n) (thistype)->fields[n].bitsize
-#define TYPE_FIELD_PACKED(thistype, n) (thistype)->fields[n].bitsize
-
-#define TYPE_FIELD_PRIVATE_BITS(thistype) (thistype)->private_field_bits
-#define TYPE_FIELD_PROTECTED_BITS(thistype) (thistype)->protected_field_bits
-#define TYPE_FIELD_VIRTUAL_BITS(thistype) (thistype)->virtual_field_bits
-#define SET_TYPE_FIELD_PRIVATE(thistype, n) B_SET ((thistype)->private_field_bits, (n))
-#define SET_TYPE_FIELD_PROTECTED(thistype, n) B_SET ((thistype)->protected_field_bits, (n))
-#define SET_TYPE_FIELD_VIRTUAL(thistype, n) B_SET ((thistype)->virtual_field_bits, (n))
-#define TYPE_FIELD_PRIVATE(thistype, n) B_TST((thistype)->private_field_bits, (n))
-#define TYPE_FIELD_PROTECTED(thistype, n) B_TST((thistype)->protected_field_bits, (n))
-#define TYPE_FIELD_VIRTUAL(thistype, n) B_TST((thistype)->virtual_field_bits, (n))
-
-#define TYPE_HAS_DESTRUCTOR(thistype) ((thistype)->flags & TYPE_FLAG_HAS_DESTRUCTOR)
-#define TYPE_HAS_CONSTRUCTOR(thistype) ((thistype)->flags & TYPE_FLAG_HAS_CONSTRUCTOR)
-
-#define TYPE_FIELD_STATIC(thistype, n) ((thistype)->fields[n].bitpos == -1)
-#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) ((char *)(thistype)->fields[n].bitsize)
-
-#define TYPE_FN_FIELDLISTS(thistype) (thistype)->fn_fieldlists
-#define TYPE_FN_FIELDLIST(thistype, n) (thistype)->fn_fieldlists[n]
-#define TYPE_FN_FIELDLIST1(thistype, n) (thistype)->fn_fieldlists[n].fn_fields
-#define TYPE_FN_FIELDLIST_NAME(thistype, n) (thistype)->fn_fieldlists[n].name
-#define TYPE_FN_FIELDLIST_LENGTH(thistype, n) (thistype)->fn_fieldlists[n].length
-
-#define TYPE_FN_FIELD(thistype, n) (thistype)[n]
-#define TYPE_FN_FIELD_NAME(thistype, n) (thistype)[n].name
-#define TYPE_FN_FIELD_TYPE(thistype, n) (thistype)[n].type
-#define TYPE_FN_FIELD_ARGS(thistype, n) TYPE_ARG_TYPES ((thistype)[n].type)
-#define TYPE_FN_FIELD_PHYSNAME(thistype, n) (thistype)[n].physname
-#define TYPE_FN_FIELD_VIRTUAL_P(thistype, n) ((thistype)[n].voffset > 1)
-#define TYPE_FN_FIELD_STATIC_P(thistype, n) ((thistype)[n].voffset == VOFFSET_STATIC)
-#define TYPE_FN_FIELD_VOFFSET(thistype, n) ((thistype)[n].voffset-2)
-#define TYPE_FN_FIELD_FCONTEXT(thistype, n) ((thistype)[n].fcontext)
-
-#define TYPE_FN_PRIVATE_BITS(thistype) (thistype).private_fn_field_bits
-#define TYPE_FN_PROTECTED_BITS(thistype) (thistype).protected_fn_field_bits
-#define SET_TYPE_FN_PRIVATE(thistype, n) B_SET ((thistype).private_fn_field_bits, n)
-#define SET_TYPE_FN_PROTECTED(thistype, n) B_SET ((thistype).protected_fn_field_bits, n)
-#define TYPE_FN_PRIVATE(thistype, n) B_TST ((thistype).private_fn_field_bits, n)
-#define TYPE_FN_PROTECTED(thistype, n) B_TST ((thistype).protected_fn_field_bits, n)
-
-/* The virtual function table is now an array of structures
- which have the form { int16 offset, delta; void *pfn; }.
-
- In normal virtual function tables, OFFSET is unused.
- DELTA is the amount which is added to the apparent object's base
- address in order to point to the actual object to which the
- virtual function should be applied.
- PFN is a pointer to the virtual function. */
-
-#define VTBL_FNADDR_OFFSET 2
-
-/* Macro that yields non-zero value iff NAME is the prefix
- for C++ operator names. If you leave out the parenthesis
- here you will lose!
-
- Currently 'o' 'p' CPLUS_MARKER is used for both the symbol in the
- symbol-file and the names in gdb's symbol table. */
-#define OPNAME_PREFIX_P(NAME) ((NAME)[0] == 'o' && (NAME)[1] == 'p' \
- && (NAME)[2] == CPLUS_MARKER)
-
-#define VTBL_PREFIX_P(NAME) ((NAME)[3] == CPLUS_MARKER \
- && !strncmp ((NAME), "_vt", 3))
-
-/* Functions that work on the objects described above */
-
-extern struct symtab *lookup_symtab ();
-extern struct symbol *lookup_symbol ();
-extern struct symbol *lookup_block_symbol ();
-extern int lookup_misc_func ();
-extern void check_stub_type ();
-extern void check_stub_method ();
-extern struct type *lookup_primitive_typename ();
-extern struct type *lookup_typename ();
-extern struct type *lookup_unsigned_typename ();
-extern struct type *lookup_struct ();
-extern struct type *lookup_union ();
-extern struct type *lookup_enum ();
-extern struct type *lookup_struct_elt_type ();
-extern struct type *lookup_pointer_type ();
-extern struct type *lookup_function_type ();
-extern struct type *create_array_type ();
-extern struct symbol *block_function ();
-extern struct symbol *find_pc_function ();
-extern int find_pc_partial_function ();
-extern void clear_pc_function_cache ();
-extern struct partial_symtab *lookup_partial_symtab ();
-extern struct partial_symtab *find_pc_psymtab ();
-extern struct symtab *find_pc_symtab ();
-extern struct partial_symbol *find_pc_psymbol ();
-extern int find_pc_misc_function ();
-extern int find_pc_line_pc_range ();
-extern char *type_name_no_tag ();
-extern int contained_in();
-
-/* C++ stuff. */
-extern struct type *lookup_reference_type ();
-extern struct type *lookup_member_type ();
-extern struct type *lookup_method_type ();
-extern void smash_to_method_type ();
-void smash_to_member_type (
-#ifdef __STDC__
- struct type *, struct type *, struct type *
-#endif
- );
-extern struct type *allocate_stub_method ();
-/* end of C++ stuff. */
-
-extern void reread_symbols ();
-
-extern struct type *builtin_type_void;
-extern struct type *builtin_type_char;
-extern struct type *builtin_type_short;
-extern struct type *builtin_type_int;
-extern struct type *builtin_type_long;
-extern struct type *builtin_type_unsigned_char;
-extern struct type *builtin_type_unsigned_short;
-extern struct type *builtin_type_unsigned_int;
-extern struct type *builtin_type_unsigned_long;
-extern struct type *builtin_type_float;
-extern struct type *builtin_type_double;
-extern struct type *builtin_type_long_double;
-extern struct type *builtin_type_complex;
-extern struct type *builtin_type_double_complex;
-/* This type represents a type that was unrecognized in symbol
- read-in. */
-extern struct type *builtin_type_error;
-
-extern struct type *builtin_type_long_long;
-extern struct type *builtin_type_unsigned_long_long;
-
-/* Modula-2 types */
-extern struct type *builtin_type_m2_char;
-extern struct type *builtin_type_m2_int;
-extern struct type *builtin_type_m2_card;
-extern struct type *builtin_type_m2_real;
-extern struct type *builtin_type_m2_bool;
-
-/* LONG_LONG is defined if the host has "long long". */
-#ifdef LONG_LONG
-#define BUILTIN_TYPE_LONGEST builtin_type_long_long
-#define BUILTIN_TYPE_UNSIGNED_LONGEST builtin_type_unsigned_long_long
-/* This should not be a typedef, because "unsigned LONGEST" needs
- to work. */
-#define LONGEST long long
-
-#else /* not LONG_LONG. */
-
-#define BUILTIN_TYPE_LONGEST builtin_type_long
-#define BUILTIN_TYPE_UNSIGNED_LONGEST builtin_type_unsigned_long
-#define LONGEST long
-
-#endif /* not LONG_LONG. */
-
-struct symtab_and_line
-{
- struct symtab *symtab;
- int line;
- CORE_ADDR pc;
- CORE_ADDR end;
-};
-
-struct symtabs_and_lines
-{
- struct symtab_and_line *sals;
- int nelts;
-};
-
-/* Given a pc value, return line number it is in.
- Second arg nonzero means if pc is on the boundary
- use the previous statement's line number. */
-
-struct symtab_and_line find_pc_line ();
-
-/* Given a symtab and line number, return the pc there. */
-extern CORE_ADDR find_line_pc ();
-extern int find_line_pc_range ();
-
-/* Given a string, return the line specified by it.
- For commands like "list" and "breakpoint". */
-
-struct symtabs_and_lines decode_line_spec ();
-struct symtabs_and_lines decode_line_spec_1 ();
-struct symtabs_and_lines decode_line_1 ();
-
-/* Symmisc.c */
-void free_symtab ();
-
-/* Symbol-reading stuff in symfile.c and solib.c. */
-struct symtab *psymtab_to_symtab ();
-void clear_solib ();
-void symbol_file_add ();
-
-/* source.c */
-int identify_source_line ();
-void print_source_lines ();
-void forget_cached_source_info (
-#ifdef __STDC__
- void
-#endif
- );
-void select_source_symtab (
-#ifdef __STDC__
- struct symtab *
-#endif
- );
-
-char **make_symbol_completion_list ();
-
-/* Maximum and minimum values of built-in types */
-#define MAX_OF_TYPE(t) \
- TYPE_UNSIGNED(t) ? UMAX_OF_SIZE(TYPE_LENGTH(t)) : MAX_OF_SIZE(TYPE_LENGTH(t))
-
-#define MIN_OF_TYPE(t) \
- TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) : MIN_OF_SIZE(TYPE_LENGTH(t))
-
-#endif /* symtab.h not already included. */
diff --git a/gdb/tahoe-opcode.h b/gdb/tahoe-opcode.h
deleted file mode 100755
index b5cee24..0000000
--- a/gdb/tahoe-opcode.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Ported by the State University of New York at Buffalo by the Distributed
- * Computer Systems Lab, Department of Computer Science, 1991.
- */
-
-#ifndef tahoe_opcodeT
-#define tahoe_opcodeT int
-#endif /* no tahoe_opcodeT */
-
-struct vot_wot /* tahoe opcode table: wot to do with this */
- /* particular opcode */
-{
- char * args; /* how to compile said opcode */
- tahoe_opcodeT code; /* op-code (may be > 8 bits!) */
-};
-
-struct vot /* tahoe opcode text */
-{
- char * name; /* opcode name: lowercase string [key] */
- struct vot_wot detail; /* rest of opcode table [datum] */
-};
-
-#define vot_how args
-#define vot_code code
-#define vot_detail detail
-#define vot_name name
-
-static struct vot
-votstrs[] =
-{
-{ "halt", {"", 0x00 } },
-{ "sinf", {"", 0x05 } },
-{ "ldf", {"rl", 0x06 } },
-{ "ldd", {"rq", 0x07 } },
-{ "addb2", {"rbmb", 0x08 } },
-{ "movb", {"rbwb", 0x09 } },
-{ "addw2", {"rwmw", 0x0a } },
-{ "movw", {"rwww", 0x0b } },
-{ "addl2", {"rlml", 0x0c } },
-{ "movl", {"rlwl", 0x0d } },
-{ "bbs", {"rlvlbw", 0x0e } },
-{ "nop", {"", 0x10 } },
-{ "brb", {"bb", 0x11 } },
-{ "brw", {"bw", 0x13 } },
-{ "cosf", {"", 0x15 } },
-{ "lnf", {"rl", 0x16 } },
-{ "lnd", {"rq", 0x17 } },
-{ "addb3", {"rbrbwb", 0x18 } },
-{ "cmpb", {"rbwb", 0x19 } },
-{ "addw3", {"rwrwww", 0x1a } },
-{ "cmpw", {"rwww", 0x1b } },
-{ "addl3", {"rlrlwl", 0x1c } },
-{ "cmpl", {"rlwl", 0x1d } },
-{ "bbc", {"rlvlbw", 0x1e } },
-{ "rei", {"", 0x20 } },
-{ "bneq", {"bb", 0x21 } },
-{ "bnequ", {"bb", 0x21 } },
-{ "cvtwl", {"rwwl", 0x23 } },
-{ "stf", {"wl", 0x26 } },
-{ "std", {"wq", 0x27 } },
-{ "subb2", {"rbmb", 0x28 } },
-{ "mcomb", {"rbwb", 0x29 } },
-{ "subw2", {"rwmw", 0x2a } },
-{ "mcomw", {"rwww", 0x2b } },
-{ "subl2", {"rlml", 0x2c } },
-{ "mcoml", {"rlwl", 0x2d } },
-{ "emul", {"rlrlrlwq", 0x2e } },
-{ "aoblss", {"rlmlbw", 0x2f } },
-{ "bpt", {"", 0x30 } },
-{ "beql", {"bb", 0x31 } },
-{ "beqlu", {"bb", 0x31 } },
-{ "cvtwb", {"rwwb", 0x33 } },
-{ "logf", {"", 0x35 } },
-{ "cmpf", {"rl", 0x36 } },
-{ "cmpd", {"rq", 0x37 } },
-{ "subb3", {"rbrbwb", 0x38 } },
-{ "bitb", {"rbrb", 0x39 } },
-{ "subw3", {"rwrwww", 0x3a } },
-{ "bitw", {"rwrw", 0x3b } },
-{ "subl3", {"rlrlwl", 0x3c } },
-{ "bitl", {"rlrl", 0x3d } },
-{ "ediv", {"rlrqwlwl", 0x3e } },
-{ "aobleq", {"rlmlbw", 0x3f } },
-{ "ret", {"", 0x40 } },
-{ "bgtr", {"bb", 0x41 } },
-{ "sqrtf", {"", 0x45 } },
-{ "cmpf2", {"rl", 0x46 } },
-{ "cmpd2", {"rqrq", 0x47 } },
-{ "shll", {"rbrlwl", 0x48 } },
-{ "clrb", {"wb", 0x49 } },
-{ "shlq", {"rbrqwq", 0x4a } },
-{ "clrw", {"ww", 0x4b } },
-{ "mull2", {"rlml", 0x4c } },
-{ "clrl", {"wl", 0x4d } },
-{ "shal", {"rbrlwl", 0x4e } },
-{ "bleq", {"bb", 0x51 } },
-{ "expf", {"", 0x55 } },
-{ "tstf", {"", 0x56 } },
-{ "tstd", {"", 0x57 } },
-{ "shrl", {"rbrlwl", 0x58 } },
-{ "tstb", {"rb", 0x59 } },
-{ "shrq", {"rbrqwq", 0x5a } },
-{ "tstw", {"rw", 0x5b } },
-{ "mull3", {"rlrlwl", 0x5c } },
-{ "tstl", {"rl", 0x5d } },
-{ "shar", {"rbrlwl", 0x5e } },
-{ "bbssi", {"rlmlbw", 0x5f } },
-{ "ldpctx", {"", 0x60 } },
-{ "pushd", {"", 0x67 } },
-{ "incb", {"mb", 0x69 } },
-{ "incw", {"mw", 0x6b } },
-{ "divl2", {"rlml", 0x6c } },
-{ "incl", {"ml", 0x6d } },
-{ "cvtlb", {"rlwb", 0x6f } },
-{ "svpctx", {"", 0x70 } },
-{ "jmp", {"ab", 0x71 } },
-{ "cvlf", {"rl", 0x76 } },
-{ "cvld", {"rl", 0x77 } },
-{ "decb", {"mb", 0x79 } },
-{ "decw", {"mw", 0x7b } },
-{ "divl3", {"rlrlwl", 0x7c } },
-{ "decl", {"ml", 0x7d } },
-{ "cvtlw", {"rlww", 0x7f } },
-{ "bgeq", {"bb", 0x81 } },
-{ "movs2", {"abab", 0x82 } },
-{ "cvfl", {"wl", 0x86 } },
-{ "cvdl", {"wl", 0x87 } },
-{ "orb2", {"rbmb", 0x88 } },
-{ "cvtbl", {"rbwl", 0x89 } },
-{ "orw2", {"rwmw", 0x8a } },
-{ "bispsw", {"rw", 0x8b } },
-{ "orl2", {"rlml", 0x8c } },
-{ "adwc", {"rlml", 0x8d } },
-{ "adda", {"rlml", 0x8e } },
-{ "blss", {"bb", 0x91 } },
-{ "cmps2", {"abab", 0x92 } },
-{ "ldfd", {"rl", 0x97 } },
-{ "orb3", {"rbrbwb", 0x98 } },
-{ "cvtbw", {"rbww", 0x99 } },
-{ "orw3", {"rwrwww", 0x9a } },
-{ "bicpsw", {"rw", 0x9b } },
-{ "orl3", {"rlrlwl", 0x9c } },
-{ "sbwc", {"rlml", 0x9d } },
-{ "suba", {"rlml", 0x9e } },
-{ "bgtru", {"bb", 0xa1 } },
-{ "cvdf", {"", 0xa6 } },
-{ "andb2", {"rbmb", 0xa8 } },
-{ "movzbl", {"rbwl", 0xa9 } },
-{ "andw2", {"rwmw", 0xaa } },
-{ "loadr", {"rwal", 0xab } },
-{ "andl2", {"rlml", 0xac } },
-{ "mtpr", {"rlrl", 0xad } },
-{ "ffs", {"rlwl", 0xae } },
-{ "blequ", {"bb", 0xb1 } },
-{ "negf", {"", 0xb6 } },
-{ "negd", {"", 0xb7 } },
-{ "andb3", {"rbrbwb", 0xb8 } },
-{ "movzbw", {"rbww", 0xb9 } },
-{ "andw3", {"rwrwww", 0xba } },
-{ "storer", {"rwal", 0xbb } },
-{ "andl3", {"rlrlwl", 0xbc } },
-{ "mfpr", {"rlwl", 0xbd } },
-{ "ffc", {"rlwl", 0xbe } },
-{ "calls", {"rbab", 0xbf } },
-{ "prober", {"rbabrl", 0xc0 } },
-{ "bvc", {"bb", 0xc1 } },
-{ "movs3", {"ababrw", 0xc2 } },
-{ "movzwl", {"rwwl", 0xc3 } },
-{ "addf", {"rl", 0xc6 } },
-{ "addd", {"rq", 0xc7 } },
-{ "xorb2", {"rbmb", 0xc8 } },
-{ "movob", {"rbwb", 0xc9 } },
-{ "xorw2", {"rwmw", 0xca } },
-{ "movow", {"rwww", 0xcb } },
-{ "xorl2", {"rlml", 0xcc } },
-{ "movpsl", {"wl", 0xcd } },
-{ "kcall", {"rw", 0xcf } },
-{ "probew", {"rbabrl", 0xd0 } },
-{ "bvs", {"bb", 0xd1 } },
-{ "cmps3", {"ababrw", 0xd2 } },
-{ "subf", {"rq", 0xd6 } },
-{ "subd", {"rq", 0xd7 } },
-{ "xorb3", {"rbrbwb", 0xd8 } },
-{ "pushb", {"rb", 0xd9 } },
-{ "xorw3", {"rwrwww", 0xda } },
-{ "pushw", {"rw", 0xdb } },
-{ "xorl3", {"rlrlwl", 0xdc } },
-{ "pushl", {"rl", 0xdd } },
-{ "insque", {"abab", 0xe0 } },
-{ "bcs", {"bb", 0xe1 } },
-{ "bgequ", {"bb", 0xe1 } },
-{ "mulf", {"rq", 0xe6 } },
-{ "muld", {"rq", 0xe7 } },
-{ "mnegb", {"rbwb", 0xe8 } },
-{ "movab", {"abwl", 0xe9 } },
-{ "mnegw", {"rwww", 0xea } },
-{ "movaw", {"awwl", 0xeb } },
-{ "mnegl", {"rlwl", 0xec } },
-{ "moval", {"alwl", 0xed } },
-{ "remque", {"ab", 0xf0 } },
-{ "bcc", {"bb", 0xf1 } },
-{ "blssu", {"bb", 0xf1 } },
-{ "divf", {"rq", 0xf6 } },
-{ "divd", {"rq", 0xf7 } },
-{ "movblk", {"alalrw", 0xf8 } },
-{ "pushab", {"ab", 0xf9 } },
-{ "pushaw", {"aw", 0xfb } },
-{ "casel", {"rlrlrl", 0xfc } },
-{ "pushal", {"al", 0xfd } },
-{ "callf", {"rbab", 0xfe } },
-{ "" , "" } /* empty is end sentinel */
-
-};
diff --git a/gdb/tahoe-pinsn.c b/gdb/tahoe-pinsn.c
deleted file mode 100644
index c3c675c..0000000
--- a/gdb/tahoe-pinsn.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Ported by the State University of New York at Buffalo by the Distributed
- * Computer Systems Lab, Department of Computer Science, 1991.
- */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "tahoe-opcode.h"
-
-/* Tahoe instructions are never longer than this. */
-#define MAXLEN 62
-
-/* Number of elements in the opcode table. */
-#define NOPCODES (sizeof votstrs / sizeof votstrs[0])
-
-extern char *reg_names[];
-
-static unsigned char *print_insn_arg ();
-
-/* Print the Tahoe instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned char buffer[MAXLEN];
- register int i;
- register unsigned char *p;
- register char *d;
-
- read_memory (memaddr, buffer, MAXLEN);
-
- for (i = 0; i < NOPCODES; i++)
- if (votstrs[i].detail.code == buffer[0]
- || votstrs[i].detail.code == *(unsigned short *)buffer)
- break;
-
- /* Handle undefined instructions. */
- if (i == NOPCODES)
- {
- fprintf (stream, "0%o", buffer[0]);
- return 1;
- }
-
- fprintf (stream, "%s", votstrs[i].name);
-
- /* Point at first byte of argument data,
- and at descriptor for first argument. */
- p = buffer + 1 + (votstrs[i].detail.code >= 0x100);
- d = votstrs[i].detail.args;
-
- if (*d)
- fputc ('\t', stream);
-
- while (*d)
- {
- p = print_insn_arg (d, p, memaddr + (p - buffer), stream);
- d += 2;
- if (*d)
- fprintf (stream, ",");
- }
- return p - buffer;
-}
-/*******************************************************************/
-static unsigned char *
-print_insn_arg (d, p, addr, stream)
- char *d;
- register char *p;
- CORE_ADDR addr;
- FILE *stream;
-{
- int temp1 = 0;
- register int regnum = *p & 0xf;
- float floatlitbuf;
-
- if (*d == 'b')
- {
- if (d[1] == 'b')
- fprintf (stream, "0x%x", addr + *p++ + 1);
- else
- {
-
- temp1 = *p;
- temp1 <<= 8;
- temp1 |= *(p + 1);
- fprintf (stream, "0x%x", addr + temp1 + 2);
- p += 2;
- }
- }
- else
- switch ((*p++ >> 4) & 0xf)
- {
- case 0:
- case 1:
- case 2:
- case 3: /* Liter>al(short immediate byte) mode */
- if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h')
- {
- *(int *)&floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4);
- fprintf (stream, "$%f", floatlitbuf);
- }
- else
- fprintf (stream, "$%d", p[-1] & 0x3f);
- break;
-
- case 4: /* Indexed */
- p = (char *) print_insn_arg (d, p, addr + 1, stream);
- fprintf (stream, "[%s]", reg_names[regnum]);
- break;
-
- case 5: /* Register */
- fprintf (stream, reg_names[regnum]);
- break;
-
- case 7: /* Autodecrement */
- fputc ('-', stream);
- case 6: /* Register deferred */
- fprintf (stream, "(%s)", reg_names[regnum]);
- break;
-
- case 9: /* Absolute Address & Autoincrement deferred */
- fputc ('*', stream);
- if (regnum == PC_REGNUM)
- {
- temp1 = *p;
- temp1 <<= 8;
- temp1 |= *(p +1);
-
- fputc ('$', stream);
- print_address (temp1, stream);
- p += 4;
- break;
- }
- case 8: /*Immediate & Autoincrement SP */
- if (regnum == 8) /*88 is Immediate Byte Mode*/
- fprintf (stream, "$%d", *p++);
-
- else if (regnum == 9) /*89 is Immediate Word Mode*/
- {
- temp1 = *p;
- temp1 <<= 8;
- temp1 |= *(p +1);
- fprintf (stream, "$%d", temp1);
- p += 2;
- }
-
- else if (regnum == PC_REGNUM) /*8F is Immediate Long Mode*/
- {
- temp1 = *p;
- temp1 <<=8;
- temp1 |= *(p +1);
- temp1 <<=8;
- temp1 |= *(p +2);
- temp1 <<= 8;
- temp1 |= *(p +3);
- fprintf (stream, "$%d", temp1);
- p += 4;
- }
-
- else /*8E is Autoincrement SP Mode*/
- fprintf (stream, "(%s)+", reg_names[regnum]);
- break;
-
- case 11: /* Register + Byte Displacement Deferred Mode*/
- fputc ('*', stream);
- case 10: /* Register + Byte Displacement Mode*/
- if (regnum == PC_REGNUM)
- print_address (addr + *p + 2, stream);
- else
- fprintf (stream, "%d(%s)", *p, reg_names[regnum]);
- p += 1;
- break;
-
- case 13: /* Register + Word Displacement Deferred Mode*/
- fputc ('*', stream);
- case 12: /* Register + Word Displacement Mode*/
- temp1 = *p;
- temp1 <<= 8;
- temp1 |= *(p +1);
- if (regnum == PC_REGNUM)
- print_address (addr + temp1 + 3, stream);
- else
- fprintf (stream, "%d(%s)", temp1, reg_names[regnum]);
- p += 2;
- break;
-
- case 15: /* Register + Long Displacement Deferred Mode*/
- fputc ('*', stream);
- case 14: /* Register + Long Displacement Mode*/
- temp1 = *p;
- temp1 <<= 8;
- temp1 |= *(p +1);
- temp1 <<= 8;
- temp1 |= *(p +2);
- temp1 <<= 8;
- temp1 |= *(p +3);
- if (regnum == PC_REGNUM)
- print_address (addr + temp1 + 5, stream);
- else
- fprintf (stream, "%d(%s)", temp1, reg_names[regnum]);
- p += 4;
- }
-
- return (unsigned char *) p;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gdb/target.c b/gdb/target.c
deleted file mode 100644
index a23c910..0000000
--- a/gdb/target.c
+++ /dev/null
@@ -1,532 +0,0 @@
-/* Select target systems and architectures at runtime for GDB.
- Copyright (C) 1990 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <errno.h>
-#include <ctype.h>
-#include "defs.h"
-#include "target.h"
-#include "gdbcmd.h"
-#include "symtab.h"
-#include "inferior.h"
-#include "bfd.h"
-#include "symfile.h"
-
-extern int memory_insert_breakpoint(), memory_remove_breakpoint();
-extern void host_convert_to_virtual(), host_convert_from_virtual();
-extern void add_syms_addr_command();
-
-static void cleanup_target ();
-
-/* Pointer to array of target architecture structures; the size of the
- array; the current index into the array; the allocated size of the
- array. */
-struct target_ops **target_structs;
-unsigned target_struct_size;
-unsigned target_struct_index;
-unsigned target_struct_allocsize;
-#define DEFAULT_ALLOCSIZE 10
-
-/* The initial current target, so that there is always a semi-valid
- current target. */
-
-struct target_ops dummy_target = {"None", "None", "",
- 0, 0, 0, 0, /* open, close, attach, detach */
- 0, 0, /* resume, wait */
- 0, 0, 0, 0, 0, /* registers */
- 0, 0, /* memory */
- 0, 0, /* bkpts */
- 0, 0, 0, 0, 0, /* terminal */
- 0, 0, /* kill, load */
- add_syms_addr_command, /* add_syms */
- 0, 0, /* call_function, lookup_symbol */
- 0, 0, /* create_inferior, mourn_inferior */
- dummy_stratum, 0, /* stratum, next */
- 0, 0, 0, 0, 0, /* all mem, mem, stack, regs, exec */
- OPS_MAGIC,
-};
-
-/* The target structure we are currently using to talk to a process
- or file or whatever "inferior" we have. */
-
-struct target_ops *current_target;
-
-/* The stack of target structures that have been pushed. */
-
-struct target_ops **current_target_stack;
-
-/* Command list for target. */
-
-static struct cmd_list_element *targetlist = NULL;
-
-/* The user just typed 'target' without the name of a target. */
-
-/* ARGSUSED */
-static void
-target_command (arg, from_tty)
- char *arg;
- int from_tty;
-{
- fputs_filtered ("Argument required (target name).\n", stdout);
-}
-
-/* Add a possible target architecture to the list. */
-
-void
-add_target (t)
- struct target_ops *t;
-{
- if (t->to_magic != OPS_MAGIC)
- {
- fprintf(stderr, "Magic number of %s target struct wrong\n",
- t->to_shortname);
- abort();
- }
-
- if (!target_structs)
- {
- target_struct_allocsize = DEFAULT_ALLOCSIZE;
- target_structs = (struct target_ops **) xmalloc
- (target_struct_allocsize * sizeof (*target_structs));
- }
- if (target_struct_size >= target_struct_allocsize)
- {
- target_struct_allocsize *= 2;
- target_structs = (struct target_ops **) xrealloc (target_structs,
- target_struct_allocsize * sizeof (*target_structs));
- }
- target_structs[target_struct_size++] = t;
- cleanup_target (t);
-
- if (targetlist == NULL)
- add_prefix_cmd ("target", class_run, target_command,
- "Connect to a target machine or process.\n\
-The first argument is the type or protocol of the target machine.\n\
-Remaining arguments are interpreted by the target protocol. For more\n\
-information on the arguments for a particular protocol, type\n\
-`help target ' followed by the protocol name.",
- &targetlist, "target ", 0, &cmdlist);
- add_cmd (t->to_shortname, no_class, t->to_open, t->to_doc, &targetlist);
-}
-
-/* Stub functions */
-
-static void
-ignore ()
-{
-}
-
-/* ARGSUSED */
-static int
-nomemory (memaddr, myaddr, len, write)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
-{
- return 0; /* No bytes handled */
-}
-
-static void
-tcomplain ()
-{
- error ("You can't do that when your target is `%s'",
- current_target->to_shortname);
-}
-
-static int
-noprocess ()
-{
- error ("You can't do that without a process to debug");
-}
-
-/* ARGSUSED */
-static int
-nosymbol (name, addrp)
- char *name;
- CORE_ADDR *addrp;
-{
- return 1; /* Symbol does not exist in target env */
-}
-
-/* ARGSUSED */
-static void
-default_terminal_info (args, from_tty)
- char *args;
- int from_tty;
-{
- printf("No saved terminal information.\n");
-}
-
-#if 0
-/* With strata, this function is no longer needed. FIXME. */
-/* This is the default target_create_inferior function. It looks up
- the stack for some target that cares to create inferiors, then
- calls it -- or complains if not found. */
-
-static void
-upstack_create_inferior (exec, args, env)
- char *exec;
- char *args;
- char **env;
-{
- struct target_ops *t;
-
- for (t = current_target;
- t;
- t = t->to_next)
- {
- if (t->to_create_inferior != upstack_create_inferior)
- {
- t->to_create_inferior (exec, args, env);
- return;
- }
-
- }
- tcomplain();
-}
-#endif
-
-/* This is the default target_create_inferior and target_attach function.
- If the current target is executing, it asks whether to kill it off.
- If this function returns without calling error(), it has killed off
- the target, and the operation should be attempted. */
-
-static void
-kill_or_be_killed (from_tty)
- int from_tty;
-{
- /* FIXME: What is savecur for? Why isn't it used? */
- struct target_ops *savecur;
-
- if (target_has_execution)
- {
- printf ("You are already running a program:\n");
- target_files_info ();
- if (query ("Kill it? ")) {
- savecur = current_target;
- target_kill (0, from_tty);
- if (target_has_execution)
- error ("Killing the program did not help.");
- return;
- } else {
- error ("Program not killed.");
- }
- }
- tcomplain();
-}
-
-static void
-maybe_kill_then_attach (args, from_tty)
- char *args;
- int from_tty;
-{
- kill_or_be_killed (from_tty);
- target_attach (args, from_tty);
-}
-
-static void
-maybe_kill_then_create_inferior (exec, args, env)
- char *exec;
- char *args;
- char **env;
-{
- kill_or_be_killed (0);
- target_create_inferior (exec, args, env);
-}
-
-/* Clean up a target struct so it no longer has any zero pointers in it.
- We default entries, at least to stubs that print error messages. */
-
-static void
-cleanup_target (t)
- struct target_ops *t;
-{
-
- /* Check magic number. If wrong, it probably means someone changed
- the struct definition, but not all the places that initialize one. */
- if (t->to_magic != OPS_MAGIC)
- {
- fprintf(stderr, "Magic number of %s target struct wrong\n",
- t->to_shortname);
- abort();
- }
-
-#define de_fault(field, value) \
- if (!t->field) t->field = value
-
- /* FIELD DEFAULT VALUE */
-
- de_fault (to_open, tcomplain);
- de_fault (to_close, (void (*)())ignore);
- de_fault (to_attach, maybe_kill_then_attach);
- de_fault (to_detach, (void (*)())ignore);
- de_fault (to_resume, (void (*)())noprocess);
- de_fault (to_wait, noprocess);
- de_fault (to_fetch_registers, noprocess);
- de_fault (to_store_registers, noprocess);
- de_fault (to_prepare_to_store, (void (*)())noprocess);
- de_fault (to_convert_to_virtual, host_convert_to_virtual);
- de_fault (to_convert_from_virtual, host_convert_from_virtual);
- de_fault (to_xfer_memory, nomemory);
- de_fault (to_files_info, ignore);
- de_fault (to_insert_breakpoint, memory_insert_breakpoint);
- de_fault (to_remove_breakpoint, memory_remove_breakpoint);
- de_fault (to_terminal_init, ignore);
- de_fault (to_terminal_inferior, ignore);
- de_fault (to_terminal_ours_for_output,ignore);
- de_fault (to_terminal_ours, ignore);
- de_fault (to_terminal_info, default_terminal_info);
- de_fault (to_kill, (void (*)())noprocess);
- de_fault (to_load, tcomplain);
- de_fault (to_add_syms, tcomplain);
- de_fault (to_call_function, (struct value *(*)())noprocess);
- de_fault (to_lookup_symbol, nosymbol);
- de_fault (to_create_inferior, maybe_kill_then_create_inferior);
- de_fault (to_mourn_inferior, (void (*)())noprocess);
- de_fault (to_next, 0);
- de_fault (to_has_all_memory, 0);
- de_fault (to_has_memory, 0);
- de_fault (to_has_stack, 0);
- de_fault (to_has_registers, 0);
- de_fault (to_has_execution, 0);
-
-#undef de_fault
-}
-
-/* Push a new target type into the stack of the existing target accessors,
- possibly superseding some of the existing accessors.
-
- Result is zero if the pushed target ended up on top of the stack,
- nonzero if at least one target is on top of it.
-
- Rather than allow an empty stack, we always have the dummy target at
- the bottom stratum, so we can call the function vectors without
- checking them. */
-
-int
-push_target (t)
- struct target_ops *t;
-{
- struct target_ops *st, *prev;
-
- for (prev = 0, st = current_target;
- st;
- prev = st, st = st->to_next) {
- if ((int)(t->to_stratum) >= (int)(st->to_stratum))
- break;
- }
-
- while (t->to_stratum == st->to_stratum) {
- /* There's already something on this stratum. Close it off. */
- (st->to_close) (0);
- if (prev)
- prev->to_next = st->to_next; /* Unchain old target_ops */
- else
- current_target = st->to_next; /* Unchain first on list */
- st = st->to_next;
- }
-
- /* We have removed all targets in our stratum, now add ourself. */
- t->to_next = st;
- if (prev)
- prev->to_next = t;
- else
- current_target = t;
-
- cleanup_target (current_target);
- return prev != 0;
-}
-
-/* Remove a target_ops vector from the stack, wherever it may be.
- Return how many times it was removed (0 or 1 unless bug). */
-
-int
-unpush_target (t)
- struct target_ops *t;
-{
- struct target_ops *u, *v;
- int result = 0;
-
- for (u = current_target, v = 0;
- u;
- v = u, u = u->to_next)
- if (u == t)
- {
- if (v == 0)
- pop_target(); /* unchain top copy */
- else {
- (t->to_close)(0); /* Let it clean up */
- v->to_next = t->to_next; /* unchain middle copy */
- }
- result++;
- }
- return result;
-}
-
-void
-pop_target ()
-{
- (current_target->to_close)(0); /* Let it clean up */
- current_target = current_target->to_next;
- if (!current_target) /* At bottom, push dummy. */
- push_target (&dummy_target);
-}
-
-/* Move memory to or from the targets. Iterate until all of it has
- been moved, if necessary. The top target gets priority; anything
- it doesn't want, is offered to the next one down, etc. Note the
- business with curlen: if an early target says "no, but I have a
- boundary overlapping this xfer" then we shorten what we offer to
- the subsequent targets so the early guy will get a chance at the
- tail before the subsequent ones do.
-
- Result is 0 or errno value. */
-
-int
-target_read_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- return target_xfer_memory (memaddr, myaddr, len, 0);
-}
-
-int
-target_write_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
-{
- return target_xfer_memory (memaddr, myaddr, len, 1);
-}
-
-int
-target_xfer_memory (memaddr, myaddr, len, write)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
-{
- int curlen;
- int res;
- struct target_ops *t;
-
- /* The quick case is that the top target does it all. */
- res = current_target->to_xfer_memory(memaddr, myaddr, len, write);
- if (res == len)
- return 0;
-
- if (res > 0)
- goto bump;
- /* If res <= 0 then we call it again in the loop. Ah well. */
-
- for (; len > 0;)
- {
- curlen = len; /* Want to do it all */
- for (t = current_target;
- t;
- t = t->to_has_all_memory? 0: t->to_next)
- {
- res = t->to_xfer_memory(memaddr, myaddr, curlen, write);
- if (res > 0) break; /* Handled all or part of xfer */
- if (res == 0) continue; /* Handled none */
- curlen = -res; /* Could handle once we get past res bytes */
- }
- if (res <= 0)
- {
- /* If this address is for nonexistent memory,
- read zeros if reading, or do nothing if writing. Return error. */
- if (!write)
- bzero (myaddr, len);
- return EIO;
- }
-bump:
- memaddr += res;
- myaddr += res;
- len -= res;
- }
- return 0; /* We managed to cover it all somehow. */
-}
-
-
-/* ARGSUSED */
-static void
-target_info (args, from_tty)
- char *args;
- int from_tty;
-{
- struct target_ops *t;
- int has_all_mem = 0;
-
- if (symfile != 0)
- printf ("Symbols from \"%s\".\n", symfile);
-
-#ifdef FILES_INFO_HOOK
- if (FILES_INFO_HOOK ())
- return;
-#endif
-
- for (t = current_target;
- t;
- t = t->to_next)
- {
- if ((int)(t->to_stratum) <= (int)dummy_stratum)
- continue;
- if (has_all_mem)
- printf("\tWhile running this, gdb does not access memory from...\n");
- printf("%s:\n", t->to_longname);
- (t->to_files_info)();
- has_all_mem = t->to_has_all_memory;
- }
-}
-
-/* This is to be called by the open routine before it does
- anything. */
-
-void
-target_preopen (from_tty)
- int from_tty;
-{
- dont_repeat();
-
- if (target_has_execution)
- {
- if (query ("A program is being debugged already. Kill it? "))
- target_kill ((char *)0, from_tty);
- else
- error ("Program not killed.");
- }
-}
-
-static char targ_desc[] =
- "Names of targets and files being debugged.\n\
-Shows the entire stack of targets currently in use (including the exec-file,\n\
-core-file, and process, if any), as well as the symbol file name.";
-
-void
-_initialize_targets ()
-{
- current_target = &dummy_target;
- cleanup_target (current_target);
-
- add_info ("target", target_info, targ_desc);
- add_info ("files", target_info, targ_desc);
-}
diff --git a/gdb/target.h b/gdb/target.h
deleted file mode 100644
index 7bc64f0..0000000
--- a/gdb/target.h
+++ /dev/null
@@ -1,415 +0,0 @@
-/* Interface between GDB and target environments, including files and processes
- Copyright 1990, 1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support. Written by John Gilmore.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This include file defines the interface between the main part
- of the debugger, and the part which is target-specific, or
- specific to the communications interface between us and the
- target.
-
- A TARGET is an interface between the debugger and a particular
- kind of file or process. Targets can be STACKED in STRATA,
- so that more than one target can potentially respond to a request.
- In particular, memory accesses will walk down the stack of targets
- until they find a target that is interested in handling that particular
- address. STRATA are artificial boundaries on the stack, within
- which particular kinds of targets live. Strata exist so that
- people don't get confused by pushing e.g. a process target and then
- a file target, and wondering why they can't see the current values
- of variables any more (the file target is handling them and they
- never get to the process target). So when you push a file target,
- it goes into the file stratum, which is always below the process
- stratum. */
-
-enum strata {
- dummy_stratum, /* The lowest of the low */
- file_stratum, /* Executable files, etc */
- core_stratum, /* Core dump files */
- process_stratum, /* Executing processes */
-};
-
-struct target_ops {
- char *to_shortname; /* Name this target type */
- char *to_longname; /* Name for printing */
- /* Documentation. Does not include trailing newline, and
- starts with a one-line description (probably similar to
- to_longname). */
- char *to_doc;
-#ifdef __STDC__
- void (*to_open) (char *name, int from_tty);
- void (*to_close) (int quitting);
- void (*to_attach) (char *name, int from_tty);
- void (*to_detach) (char *args, int from_tty);
- void (*to_resume) (int step, int siggnal);
- int (*to_wait) (int *status);
- int (*to_fetch_registers) (int regno);
- int (*to_store_registers) (int regno);
- void (*to_prepare_to_store) ();
- void (*to_convert_to_virtual) (int regnum, char *from, char *to);
- void (*to_convert_from_virtual) (int regnum, char *from, char *to);
- int (*to_xfer_memory) (CORE_ADDR memaddr, char *myaddr, int len, int w);
- void (*to_files_info) ();
- int (*to_insert_breakpoint) (CORE_ADDR addr, char *save);
- int (*to_remove_breakpoint) (CORE_ADDR addr, char *save);
- void (*to_terminal_init) ();
- void (*to_terminal_inferior) ();
- void (*to_terminal_ours_for_output) ();
- void (*to_terminal_ours) ();
- void (*to_terminal_info) (char *arg, int from_tty);
- void (*to_kill) (char *arg, int from_tty);
- void (*to_load) (char *arg, int from_tty);
- void (*to_add_syms) (char *arg, int from_tty);
-struct value *(*to_call_function) (struct value *function,
- int nargs, struct value **args);
- int (*to_lookup_symbol) (char *name, CORE_ADDR *addrp);
- void (*to_create_inferior) (char *exec, char *args, char **env);
- void (*to_mourn_inferior) ();
- enum strata to_stratum;
-struct target_ops *to_next;
- int to_has_all_memory;
- int to_has_memory;
- int to_has_stack;
- int to_has_registers;
- int to_has_execution;
- int to_magic;
-/* Need sub-structure for target machine related rather than comm related? */
-#else /* STDC */
- void (*to_open) ();
- void (*to_close) ();
- void (*to_attach) ();
- void (*to_detach) ();
- void (*to_resume) ();
- int (*to_wait) ();
- int (*to_fetch_registers) ();
- int (*to_store_registers) ();
- void (*to_prepare_to_store) ();
- void (*to_convert_to_virtual) ();
- void (*to_convert_from_virtual) ();
- int (*to_xfer_memory) ();
- void (*to_files_info) ();
- int (*to_insert_breakpoint) ();
- int (*to_remove_breakpoint) ();
- void (*to_terminal_init) ();
- void (*to_terminal_inferior) ();
- void (*to_terminal_ours_for_output) ();
- void (*to_terminal_ours) ();
- void (*to_terminal_info) ();
- void (*to_kill) ();
- void (*to_load) ();
- void (*to_add_syms) ();
-struct value *(*to_call_function) ();
- int (*to_lookup_symbol) ();
- void (*to_create_inferior) ();
- void (*to_mourn_inferior) ();
- enum strata to_stratum;
-struct target_ops *to_next;
- int to_has_all_memory;
- int to_has_memory;
- int to_has_stack;
- int to_has_registers;
- int to_has_execution;
- int to_magic;
-/* Need sub-structure for target machine related rather than comm related? */
-#endif
-};
-
-/* Magic number for checking ops size. If a struct doesn't end with this
- number, somebody changed the declaration but didn't change all the
- places that initialize one. */
-
-#define OPS_MAGIC 3840
-
-/* The ops structure for our "current" target process. */
-
-extern struct target_ops *current_target;
-
-/* Define easy words for doing these operations on our current target. */
-
-#define target_shortname (current_target->to_shortname)
-#define target_longname (current_target->to_longname)
-
-/* The open routine takes the rest of the parameters from the command,
- and (if successful) pushes a new target onto the stack.
- Targets should supply this routine, if only to provide an error message. */
-#define target_open(name, from_tty) \
- (*current_target->to_open) (name, from_tty)
-
-/* Does whatever cleanup is required for a target that we are no longer
- going to be calling. Argument says whether we are quitting gdb and
- should not get hung in case of errors, or whether we want a clean
- termination even if it takes a while. This routine is automatically
- always called just before a routine is popped off the target stack.
- Closing file descriptors and freeing memory are typical things it should
- do. */
-
-#define target_close(quitting) \
- (*current_target->to_close) (quitting)
-
-/* Attaches to a process on the target side. */
-
-#define target_attach(args, from_tty) \
- (*current_target->to_attach) (args, from_tty)
-
-/* Takes a program previously attached to and detaches it.
- The program may resume execution (some targets do, some don't) and will
- no longer stop on signals, etc. We better not have left any breakpoints
- in the program or it'll die when it hits one. ARGS is arguments
- typed by the user (e.g. a signal to send the process). FROM_TTY
- says whether to be verbose or not. */
-
-#define target_detach(args, from_tty) \
- (*current_target->to_detach) (args, from_tty)
-
-/* Resume execution of the target process. STEP says whether to single-step
- or to run free; SIGGNAL is the signal value (e.g. SIGINT) to be given
- to the target, or zero for no signal. */
-
-#define target_resume(step, siggnal) \
- (*current_target->to_resume) (step, siggnal)
-
-/* Wait for inferior process to do something. Return pid of child,
- or -1 in case of error; store status through argument pointer STATUS. */
-
-#define target_wait(status) \
- (*current_target->to_wait) (status)
-
-/* Fetch register REGNO, or all regs if regno == -1. Result is 0
- for success, -1 for problems. */
-
-#define target_fetch_registers(regno) \
- (*current_target->to_fetch_registers) (regno)
-
-/* Store at least register REGNO, or all regs if REGNO == -1.
- It can store as many registers as it wants to, so the entire registers
- array must be valid. Result is 0 for success, -1 for problems. */
-
-#define target_store_registers(regs) \
- (*current_target->to_store_registers) (regs)
-
-/* Get ready to modify the registers array. On machines which store
- individual registers, this doesn't need to do anything. On machines
- which store all the registers in one fell swoop, this makes sure
- that REGISTERS contains all the registers from the program being
- debugged. */
-
-#define target_prepare_to_store() \
- (*current_target->to_prepare_to_store) ()
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define target_convert_to_virtual(regnum, from, to) \
- (*current_target->to_convert_to_virtual) (regnum, from, to)
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define target_convert_from_virtual(regnum, from, to) \
- (*current_target->to_convert_from_virtual) (regnum, from, to)
-
-/* Reading and writing memory actually happens through a glue
- function which iterates across the various targets. Result is
- 0 for success, or an errno value. */
-
-#ifdef __STDC__
-/* Needs defs.h for CORE_ADDR */
-extern int target_read_memory(CORE_ADDR memaddr, char *myaddr, int len);
-extern int target_write_memory(CORE_ADDR memaddr, char *myaddr, int len);
-extern int target_xfer_memory(CORE_ADDR memaddr, char *myaddr, int len,
- int write);
-#else
-extern int target_read_memory();
-extern int target_write_memory();
-extern int target_xfer_memory();
-#endif
-
-/* Print a line about the current target. */
-
-#define target_files_info() \
- (*current_target->to_files_info) ()
-
-/* Insert a breakpoint at address ADDR in the target machine.
- SAVE is a pointer to memory allocated for saving the
- target contents. It is guaranteed by the caller to be long enough
- to save "sizeof BREAKPOINT" bytes. Result is 0 for success, or
- an errno value. */
-
-#define target_insert_breakpoint(addr, save) \
- (*current_target->to_insert_breakpoint) (addr, save)
-
-/* Remove a breakpoint at address ADDR in the target machine.
- SAVE is a pointer to the same save area
- that was previously passed to target_insert_breakpoint.
- Result is 0 for success, or an errno value. */
-
-#define target_remove_breakpoint(addr, save) \
- (*current_target->to_remove_breakpoint) (addr, save)
-
-/* Initialize the terminal settings we record for the inferior,
- before we actually run the inferior. */
-
-#define target_terminal_init() \
- (*current_target->to_terminal_init) ()
-
-/* Put the inferior's terminal settings into effect.
- This is preparation for starting or resuming the inferior. */
-
-#define target_terminal_inferior() \
- (*current_target->to_terminal_inferior) ()
-
-/* Put some of our terminal settings into effect,
- enough to get proper results from our output,
- but do not change into or out of RAW mode
- so that no input is discarded.
-
- After doing this, either terminal_ours or terminal_inferior
- should be called to get back to a normal state of affairs. */
-
-#define target_terminal_ours_for_output() \
- (*current_target->to_terminal_ours_for_output) ()
-
-/* Put our terminal settings into effect.
- First record the inferior's terminal settings
- so they can be restored properly later. */
-
-#define target_terminal_ours() \
- (*current_target->to_terminal_ours) ()
-
-/* Print useful information about our terminal status, if such a thing
- exists. */
-
-#define target_terminal_info(arg, from_tty) \
- (*current_target->to_terminal_info) (arg, from_tty)
-
-/* Kill the inferior process. Make it go away. */
-
-#define target_kill(arg, from_tty) \
- (*current_target->to_kill) (arg, from_tty)
-
-/* Load an executable file into the target process. This is expected to
- not only bring new code into the target process, but also to update
- GDB's symbol tables to match. */
-
-#define target_load(arg, from_tty) \
- (*current_target->to_load) (arg, from_tty)
-
-/* Add the symbols from an executable file into GDB's symbol table, as if
- the file had been loaded at a particular address (or set of addresses).
- This does not change any state in the target system, only in GDB. */
-
-#define target_add_syms(arg, from_tty) \
- (*current_target->to_add_syms) (arg, from_tty)
-
-/* Perform a function call in the inferior.
- ARGS is a vector of values of arguments (NARGS of them).
- FUNCTION is a value, the function to be called.
- Returns a value representing what the function returned.
- May fail to return, if a breakpoint or signal is hit
- during the execution of the function. */
-
-#define target_call_function(function, nargs, args) \
- (*current_target->to_call_function) (function, nargs, args)
-
-/* Look up a symbol in the target's symbol table. NAME is the symbol
- name. ADDRP is a CORE_ADDR * pointing to where the value of the symbol
- should be returned. The result is 0 if successful, nonzero if the
- symbol does not exist in the target environment. This function should
- not call error() if communication with the target is interrupted, since
- it is called from symbol reading, but should return nonzero, possibly
- doing a complain(). */
-
-#define target_lookup_symbol(name, addrp) \
- (*current_target->to_lookup_symbol) (name, addrp)
-
-/* Start an inferior process and set inferior_pid to its pid.
- EXEC_FILE is the file to run.
- ALLARGS is a string containing the arguments to the program.
- ENV is the environment vector to pass. Errors reported with error().
- On VxWorks and various standalone systems, we ignore exec_file. */
-
-#define target_create_inferior(exec_file, args, env) \
- (*current_target->to_create_inferior) (exec_file, args, env)
-
-/* The inferior process has died. Do what is right. */
-
-#define target_mourn_inferior() \
- (*current_target->to_mourn_inferior) ()
-
-/* Pointer to next target in the chain, e.g. a core file and an exec file. */
-
-#define target_next \
- (current_target->to_next)
-
-/* Does the target include all of memory, or only part of it? This
- determines whether we look up the target chain for other parts of
- memory if this target can't satisfy a request. */
-
-#define target_has_all_memory \
- (current_target->to_has_all_memory)
-
-/* Does the target include memory? (Dummy targets don't.) */
-
-#define target_has_memory \
- (current_target->to_has_memory)
-
-/* Does the target have a stack? (Exec files don't, VxWorks doesn't, until
- we start a process.) */
-
-#define target_has_stack \
- (current_target->to_has_stack)
-
-/* Does the target have registers? (Exec files don't.) */
-
-#define target_has_registers \
- (current_target->to_has_registers)
-
-/* Does the target have execution? Can we make it jump (through hoops),
- or pop its stack a few times, or set breakpoints? */
-
-#define target_has_execution \
- (current_target->to_has_execution)
-
-/* Routines for maintenance of the target structures...
-
- add_target: Add a target to the list of all possible targets.
-
- push_target: Make this target the top of the stack of currently used
- targets, within its particular stratum of the stack. Result
- is 0 if now atop the stack, nonzero if not on top (maybe
- should warn user).
-
- unpush_target: Remove this from the stack of currently used targets,
- no matter where it is on the list. Returns 0 if no
- change, 1 if removed from stack.
-
- pop_target: Remove the top thing on the stack of current targets. */
-
-#ifdef __STDC__
-void add_target (struct target_ops *);
-int push_target (struct target_ops *);
-int unpush_target (struct target_ops *);
-void target_preopen (int);
-void pop_target (void);
-#else
-void add_target ();
-int push_target ();
-int unpush_target ();
-void target_preopen ();
-void pop_target ();
-#endif
diff --git a/gdb/tdesc.c b/gdb/tdesc.c
deleted file mode 100755
index 4a38649..0000000
--- a/gdb/tdesc.c
+++ /dev/null
@@ -1,1650 +0,0 @@
-/* This file has been modified by Data General Corporation, November 1989. */
-
-/*
-This file provides an abstract interface to "tdesc" information.
- It is designed to be used in a uniform manner by several kinds
- of debuggers:
- (1) code in live debugged process (e.g., a traceback routine)
- (2) a separate-process debugger debugging a live process
- (3) a separate-process debugger debugging a memory dump
-
- Dcontext model notes
- * captures machine context
- * partial: excludes memory
- * frames
- * kinds
- * make one for starters, chain in reverse order to previous ones
- * representation: pointer to opaque
- * alloc/free protocol
-
- Overall model
- * access functions
- * handle
- * error handling
-*/
-
-
-
-typedef int dc_boolean_t; /* range 0 .. 1 */
-#define DC_FALSE 0
-#define DC_TRUE 1
-
-
-typedef int dc_tristate_t; /* range 0 .. 2 */
-#define DC_NO 0
-#define DC_YES 1
-#define DC_MAYBE 2
-
-
-/*
- A word is 32 bits of information. In memory, a word is word-aligned.
-
- A common and important use of dc_word_t is to represent values in the
- target process, including (byte) addresses in the target process.
- In this case, C arithmetic can be used to simulate machine address
- arithmetic on the target. (Unsigned arithmetic is actually modulus
- arithmetic.)
-*/
-typedef unsigned int dc_word_t;
-
-
-/* These bit operations number bits from 0 at the least significant end. */
-#define bit_test(word,bit) ((word) & (1 << (bit))) /* returns 0 or other */
-#define bit_value(word,bit) (((word) >> (bit)) & 1) /* returns 0 or 1 */
-#define bit_set(word,bit) ((word) |= (1 << (bit)))
-#define bit_clear(word,bit) ((word) &= ~(1 << (bit)))
-#define bit_assign(word, bit, bool) \
- if (bool) bit_set(word, bit); else bit_clear(word, bit)
-
-
-/*----------------*/
-
-
-/* The exactness of locations may not be certainly known. */
-typedef dc_tristate_t dc_exactness_t;
-
-
-/*
- The model includes five kinds of contexts. Because each context
- has an associated region and frame, these describe region kinds
- and frame kinds as well.
- [more description needed]
- Currently, only call contexts exist.
-*/
-
-typedef int dc_kind_t; /* range 0 .. 4 */
-#define DC_CALL_KIND 0
-#define DC_SAVE_KIND 1
-#define DC_EXCEPTION_KIND 2
-#define DC_PROTECTION_KIND 3
-#define DC_SPECIAL_KIND 4
-#define DC_NUM_KINDS 5
-
-#define DC_MIO_ENTRY_POINT (1<< 0)
-#define DC_MIO_PROLOGUE_END (1<< 1)
-#define DC_MIO_EPILOGUE_START (1<< 2)
-#define DC_MIO_IMPLICIT_PROLOGUE_END (1<<16)
-#define DC_MIO_LITERAL_ENTRY_POINT (1<<17)
-#define DC_MIO_LITERAL_EPILOGUE_START (1<<18)
-
-#define DC_MII_PRECEDING_TDESC_END (1<<0)
-#define DC_MII_FOLLOWING_TDESC_START (1<<1)
-
-typedef struct dc_debug_info {
- unsigned int protocol; /* 1 for this structure */
- dc_word_t tdesc_ptr;
- unsigned int text_words_count;
- dc_word_t text_words_ptr;
- unsigned int data_words_count;
- dc_word_t data_words_ptr;
-} dc_debug_info_t;
-
-
-typedef struct tdesc_hdr {
- unsigned int map_protocol; /* 1 for this structure */
- unsigned int end; /* address beyond end */
-} tdesc_hdr_t;
-
-
-typedef struct tdesc_chunk_hdr {
- int zeroes : 8;
- int info_length : 22;
- int info_alignment : 2;
- unsigned int info_protocol;
- dc_word_t start_address;
- dc_word_t end_address;
-} tdesc_chunk_hdr_t;
-
-
-typedef struct tdesc_chunk_info1 {
- int variant : 8; /* 1 for this structure */
- int register_save_mask : 17;
- int pad1 : 1;
- int return_address_info_discriminant : 1;
- int frame_address_register : 5;
- unsigned int frame_address_offset;
- unsigned int return_address_info;
- unsigned int register_save_offset;
-} tdesc_chunk_info1_t;
-
-
-typedef struct tdesc_chunk1 {
- tdesc_chunk_hdr_t hdr;
- tdesc_chunk_info1_t info;
-} tdesc_chunk1_t;
-
-
-typedef struct dc_mstate {
- dc_word_t reg[32]; /* general registers */
- dc_word_t xip;
- dc_word_t nip;
- dc_word_t fip;
- dc_word_t fpsr;
- dc_word_t fpcr;
- dc_word_t psr;
-} dc_mstate_t;
-
-
-typedef struct dc_map_info_in {
- dc_word_t flags;
- dc_word_t preceding_tdesc_end;
- dc_word_t following_tdesc_start;
-} dc_map_info_in_t;
-
-
-typedef struct dc_map_info_out {
- dc_word_t flags;
- dc_word_t entry_point;
- dc_word_t prologue_end;
- dc_word_t epilogue_start;
-} dc_map_info_out_t;
-
-
-#if 0
-
- void error_fcn (env, continuable, message)
- dc_word_t env; /* environment (arbitrary datum) */
- dc_boolean_t continuable; /* whether error function may return */
- char *message; /* string (no trailing newline) */
-
- /* In the future, we probably want the error_fcn to be: */
- void error_fcn (env, continuable, code, ...)
- dc_word_t env; /* environment (arbitrary datum) */
- dc_boolean_t continuable; /* whether error function may return */
- int code; /* error code */
- ... /* parameters to message associated
- with the code */
-
- void read_fcn (env, memory, length, buffer)
- dc_word_t env; /* environment (arbitrary datum) */
- dc_word_t memory; /* start address in image */
- int length; /* in bytes */
- char *buffer; /* start address of buffer */
- /* There are no alignment assumptions for the read function. */
-
- void write_fcn (env, memory, length, buffer)
- dc_word_t env; /* environment (arbitrary datum) */
- dc_word_t memory; /* start address in image */
- int length; /* in bytes */
- char *buffer; /* start address of buffer */
- /* There are no alignment assumptions for the write function. */
- /* The write function is optional. It must be provided if changes
- to writable registers are to be made. */
-
- void exec_fcn (env, mstate)
- dc_word_t env; /* environment (arbitrary datum) */
- dc_mstate_t *mstate; /* machine state (read-write) */
- /* The execute function is optional. It would be used (in the future)
- by the implementation of a procedurally specified tdesc mechanism. */
-
-#endif
-
-/*----------------*/
-
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-extern char *malloc();
-extern char *calloc();
-extern void qsort();
-
-
-/*
- At initialization, create a tdesc table from the tdesc info.
- A tdesc table is simply a sorted array of tdesc elements.
- A tdesc element is the last 6 words of the tdesc chunk.
- We require that all tdesc chunks have info protocol 1.
-*/
-
-typedef struct tdesc_elem {
- dc_word_t start_address;
- dc_word_t end_address;
- tdesc_chunk_info1_t info;
-} tdesc_elem_t;
-
-typedef tdesc_elem_t *tdesc_table_t;
-
-void dc_correct_cr_data();
-
-int dc_compare_tdesc_elems (elem1, elem2)
- char *elem1, *elem2;
-{
- dc_word_t s1, s2, e1, e2;
- s1 = ((tdesc_elem_t *) elem1)->start_address;
- s2 = ((tdesc_elem_t *) elem2)->start_address;
- if (s1 < s2) return -1;
- if (s1 > s2) return 1;
- e1 = ((tdesc_elem_t *) elem1)->end_address;
- e2 = ((tdesc_elem_t *) elem2)->end_address;
- if (e1 < e2) return -1;
- if (e1 > e2) return 1;
- return 0;
-}
-
-
-typedef struct handle_info {
- dc_word_t debug_info_ptr;
- void (*error_fcn)();
- dc_word_t error_env;
- void (*read_fcn)();
- dc_word_t read_env;
- void (*write_fcn)(); /* NULL => absent */
- dc_word_t write_env;
- void (*exec_fcn)(); /* NULL => absent */
- dc_word_t exec_env;
- void (*map_fcn)(); /* NULL => absent */
- dc_word_t map_env;
- tdesc_table_t tdesc_table;
- int tdesc_table_size;
-} handle_info_t;
-
-typedef handle_info_t *dc_handle_t;
-
-
-/*
- Errors detected in this module are funnelled through dc_error or dc_warn,
- as appropriate. Both routines call dc_exception, which invokes the error
- handler supplied by the user.
-
- Currently, dc_exception substitutes parameters into the message given
- it and passes the resulting string to the user error handler.
- In the future, dc_exception should simply pass an error code and
- the parameters on to the user error handler.
-*/
-
-#include <varargs.h>
-extern int vsprintf();
-
-/* Exit status for exception-processing machinery failure */
-#define DC_EXCEPTION_FAILURE 250
-
-void dc_exception(continuable, args)
- dc_boolean_t continuable;
- va_list args;
-{
- dc_handle_t handle;
- char *format;
- char buffer[1024];
-
- handle = va_arg(args, dc_handle_t);
- format = va_arg(args, char *);
- (void) vsprintf(buffer, format, args);
- (*(handle->error_fcn)) (handle->error_env, continuable, buffer);
- if (!continuable)
- exit(DC_EXCEPTION_FAILURE); /* User error handler should never return in this case. */
-}
-
-
-void dc_error(va_alist) /* (handle, format, args... ) */
- va_dcl
-{
- va_list args;
-
- va_start(args);
- dc_exception(DC_FALSE, args);
- va_end(args);
-}
-
-
-void dc_warn(va_alist) /* (handle, format, args... ) */
- va_dcl
-{
- va_list args;
-
- va_start(args);
- dc_exception(DC_TRUE, args);
- va_end(args);
-}
-
-
-
-#define MALLOC_FAILURE_MESSAGE "Heap space exhausted (malloc failed)."
-#define CALLOC_FAILURE_MESSAGE "Heap space exhausted (Calloc failed)."
-
-
-/* Commonize memory allocation call so failure diagnosis is easier */
-
-char* dc_malloc( handle, size )
- dc_handle_t handle;
- int size;
-{
- char* space = malloc( size );
- if (space == (char *)NULL)
- dc_error( handle, MALLOC_FAILURE_MESSAGE );
-
- return space;
-}
-
-
-/* Commonize memory allocation call so failure diagnosis is easier */
-
-char* dc_calloc( handle,nelem, size )
- dc_handle_t handle;
- int nelem;
- int size;
-{
- char* space = calloc( nelem, size );
- if (space == (char *)NULL)
- dc_error( handle, CALLOC_FAILURE_MESSAGE );
-
- return space;
-}
-
-
-dc_word_t dc_read_word (handle, address)
- dc_handle_t handle;
- dc_word_t address;
-{
- dc_word_t word;
- (*(handle->read_fcn)) (handle->read_env, address,
- sizeof(dc_word_t), (char *)(&(word)));
- return word;
-}
-
-
-void dc_write_word (handle, address, value)
- dc_handle_t handle;
- dc_word_t address;
- dc_word_t value;
-{
- dc_word_t word;
- word = value;
- if (handle->write_fcn) {
- (*(handle->write_fcn)) (handle->write_env, address,
- sizeof(dc_word_t), (char *)(&(word)));
- } else {
- dc_error (handle, "Writing is disabled.");
- }
-}
-
-
-void dc_write_masked_word (handle, address, mask, value)
- dc_handle_t handle;
- dc_word_t address;
- dc_word_t mask;
- dc_word_t value;
-{
- dc_write_word (handle, address,
- (value & mask) | (dc_read_word(handle, address) & ~mask));
-}
-
-
-dc_handle_t dc_initiate (debug_info_ptr,
- error_fcn, error_env,
- read_fcn, read_env,
- write_fcn, write_env,
- exec_fcn, exec_env,
- map_fcn, map_env)
- dc_word_t debug_info_ptr;
- void (*error_fcn)();
- dc_word_t error_env;
- void (*read_fcn)();
- dc_word_t read_env;
- void (*write_fcn)(); /* NULL => absent */
- dc_word_t write_env;
- void (*exec_fcn)(); /* NULL => absent */
- dc_word_t exec_env;
- void (*map_fcn)(); /* NULL => absent */
- dc_word_t map_env;
- /* write_fcn may be given as NULL if no writing is required. */
- /* exec_fcn may be given as NULL if no execution is required.
- Currently, no execution is required. It would be if the
- implementation needed to invoke procedures in the debugged process. */
-{
- dc_handle_t handle;
- unsigned int debug_info_protocol;
- dc_debug_info_t debug_info;
- unsigned int tdesc_map_protocol;
- tdesc_hdr_t tdesc_hdr;
- dc_word_t tdesc_info_start;
- dc_word_t tdesc_info_end;
- dc_word_t tdesc_info_length;
-
- /* Set up handle enough for dc_error. */
- handle = (dc_handle_t) malloc(sizeof(handle_info_t));
- /* Cant use dc_malloc() as handle is being created ... */
- /* if (handle == NULL) (*error_fcn)( error_env, MALLOC_FAILURE_MESSAGE ) */
- handle->error_fcn = error_fcn;
- handle->error_env = error_env;
- handle->read_fcn = read_fcn;
- handle->read_env = read_env;
- handle->write_fcn = write_fcn;
- handle->write_env = write_env;
- handle->exec_fcn = exec_fcn;
- handle->exec_env = exec_env;
-/****************************************************************/
-/* BUG 9/19/89 Found by hls. Map functions not initialized. */
-/****************************************************************/
- handle->map_fcn = map_fcn;
- handle->map_env = map_env;
- handle->debug_info_ptr = debug_info_ptr;
- handle->tdesc_table = (tdesc_table_t)NULL;
-
- /* Find tdesc info. */
- if (debug_info_ptr) {
- (*read_fcn) (read_env, debug_info_ptr, sizeof(unsigned int),
- (char *)(&debug_info_protocol));
- if (debug_info_protocol != 1)
- dc_error (handle, "Unrecognized debug info protocol: %d",
- debug_info_protocol);
- (*read_fcn) (read_env, debug_info_ptr, sizeof(dc_debug_info_t),
- (char *)(&debug_info));
- (*read_fcn) (read_env, debug_info.tdesc_ptr, sizeof(unsigned int),
- (char *)(&tdesc_map_protocol));
- if (tdesc_map_protocol != 1)
- dc_error (handle, "Unrecognized tdesc map protocol: %d",
- tdesc_map_protocol);
- (*read_fcn) (read_env, debug_info.tdesc_ptr, sizeof(tdesc_hdr_t),
- (char *)(&tdesc_hdr));
- tdesc_info_start = debug_info.tdesc_ptr + sizeof(tdesc_hdr_t);
- tdesc_info_end = tdesc_hdr.end;
- tdesc_info_length = tdesc_info_end - tdesc_info_start;
-
- /* Create tdesc table from tdesc info. */
- {
- /* Over-allocate in order to avoid second pass over tdesc info. */
- tdesc_table_t tt = (tdesc_table_t) dc_malloc(handle, tdesc_info_length);
- dc_word_t p = tdesc_info_start;
- dc_word_t q = tdesc_info_end - sizeof(tdesc_chunk1_t);
- int n = 0;
- tdesc_chunk1_t chunk;
- dc_word_t start_address, end_address;
- int i;
-
- for (; p <= q; ) {
- (*read_fcn) (read_env, p, sizeof(tdesc_chunk1_t), (char *)(&chunk));
- if (chunk.hdr.zeroes != 0) {
- /* Skip padding. */
- p += sizeof(dc_word_t);
- continue;
- }
- if (chunk.hdr.info_protocol != 1) {
- dc_warn (handle, "Unrecognized tdesc info protocol: %d",
- chunk.hdr.info_protocol);
- goto next_chunk;
- }
- if (chunk.hdr.info_length != 16) {
- dc_warn (handle, "Incorrect tdesc info length: %d",
- chunk.hdr.info_length);
- goto next_chunk;
- }
- if (chunk.hdr.info_alignment > 2) {
- dc_warn (handle, "Incorrect tdesc info alignment: %d",
- chunk.hdr.info_alignment);
- goto next_chunk;
- }
- start_address = chunk.hdr.start_address;
- end_address = chunk.hdr.end_address;
- if ((start_address&3)!=0) {
- dc_warn (handle,
- "Tdesc start address is not word-aligned: %#.8X",
- start_address);
- goto next_chunk;
- }
- if ((end_address&3)!=0) {
- dc_warn (handle,
- "Tdesc end address is not word-aligned: %#.8X",
- end_address);
- goto next_chunk;
- }
- if (start_address > end_address) {
- /* Note that the range may be null. */
- dc_warn (handle,
- "Tdesc start address (%#.8X) follows end address (%#.8X).",
- start_address, end_address);
- goto next_chunk;
- }
- if (chunk.info.variant != 1) {
- dc_warn (handle, "Invalid tdesc chunk variant: %d",
- chunk.info.variant);
- goto next_chunk;
- }
- if (chunk.info.pad1 != 0) {
- dc_warn (handle, "Tdesc chunk padding is not zero.");
- goto next_chunk;
- }
- if (chunk.info.return_address_info_discriminant != 0) {
- if ((chunk.info.return_address_info & 3) != 0) {
- dc_warn (handle,
- "Tdesc return address offset is not word-aligned: %#.8X",
- chunk.info.return_address_info);
- goto next_chunk;
- }
- } else {
- if ((chunk.info.return_address_info & ~31) != 0) {
- dc_warn (handle,
- "Invalid tdesc return address register: %d",
- chunk.info.return_address_info);
- goto next_chunk;
- }
- }
- if ((chunk.info.register_save_offset & 3) != 0) {
- dc_warn (handle,
- "Tdesc register save offset is not word-aligned: %#.8X",
- chunk.info.register_save_offset);
- goto next_chunk;
- }
-
- tt[n].start_address = start_address;
- tt[n].end_address = end_address;
- tt[n].info = chunk.info;
- n++;
-
- next_chunk:
- p += sizeof(tdesc_chunk1_t);
- }
- /* Leftover (less than a tdesc_chunk1_t in size) is padding or
- in error. Ignore it in either case. */
-
- if (n != 0) {
-
- /* Sort table by start address. */
- qsort ((char *)tt, n, sizeof(tdesc_elem_t), dc_compare_tdesc_elems);
-
- /* Check for overlap among tdesc chunks. */
- for (i=0; i<(n-1); i++) {
- if (tt[i].end_address > tt[i+1].start_address)
- dc_error (handle, "Text chunks overlap.");
- }
- }
-
- /* Finish setting up handle. */
- handle->tdesc_table = tt;
- handle->tdesc_table_size = n;
- }
- } else {
- handle->tdesc_table_size = 0;
- }
-
- return (dc_handle_t) handle;
-}
-
-
-void dc_terminate (handle)
- dc_handle_t handle;
-{
- if (((dc_handle_t)handle)->tdesc_table) {
- free((char *)(((dc_handle_t)handle)->tdesc_table));
- }
- free((char *)handle);
-}
-
-
-
-/*
-
- Dcontext Model
-
- For each interesting register (word-sized piece of machine state),
- a word of value information is kept. This word may
- be either the value of the register, or the address in
- subject memory where the value can be found (and changed). In
- addition, the register may be invalid (in which case the value
- information is undefined). These three cases are encoded for
- a given register in the same-numbered bit of two words of flags:
-
- flags[0] bit flags[1] bit meaning
- ------------ ------------ -------
- 0 0 register is invalid; info is undefined
- 0 1 register is readable; info is value
- 1 0 register is writable; info is address
- 1 1 (reserved)
-
- The general registers (r0-r31) are handled by reg_info and
- reg_flags. The bit number for a register is that register's number.
- The other registers are grouped together for convenience and are
- handled by aux_info and aux_flags. The bit numbers for these
- registers are:
-
- bit number register
- ---------- --------
- 0 location
- 1 SXIP
- 2 SNIP
- 3 SFIP
- 4 FPSR
- 5 FPCR
-
- The SXIP, SNIP, and SFIP are the exception-time values of the
- XIP, NIP, and FIP registers. They are valid only in the topmost frame.
- (That is, in any context obtained from dc_previous_context, they
- are invalid.)
-
- "location" is a pseudo-register of this model and represents the
- location of the context. It is always valid. It also has an
- exactness associated with it. The location and its exactness of a
- context obtained from dc_previous_context are taken from the
- return address and its exactness of the context given as an argument
- to dc_previous_context.
-
- The following model is recommended for dealing with the partial
- redundancy between location and the SXIP, SNIP, and SFIP values
- in the topmost frame. The location should be set to either the
- SNIP or SXIP value, and its exactness should be set to DC_NO. A
- change to the register whose value the location is set to should
- be accompanied by an identical change to the location.
-
- The PSR is handled separately, because it is a diverse collection
- of flags. The PSR, as a whole, is always valid. A separate
- psr_ind flag tells whether the psr_info data is a value or
- an address. Each bit of the PSR has its own pair of flag bits to
- mark validity and writability.
-
-*/
-
-
-/* The following value means "other", because state is stored in 2 bits. */
-#define DC_RESERVED 3
-
-
-#define RSTATE(flags, bit) \
- ((bit_value((flags)[0], bit) << 1) + bit_value((flags)[1], bit))
-
-#define REG_STATE(dcontext, reg) RSTATE(dcontext->reg_flags, reg)
-#define AUX_STATE(dcontext, reg) RSTATE(dcontext->aux_flags, reg)
-#define PSR_STATE(dcontext, reg) RSTATE(dcontext->psr_flags, reg)
-
-
-#define SET_INVALID(flags, bit) \
- { bit_clear ((flags)[0], bit); bit_clear ((flags)[1], bit); }
-
-#define SET_READABLE(flags, bit) \
- { bit_clear ((flags)[0], bit); bit_set ((flags)[1], bit); }
-
-#define SET_WRITABLE(flags, bit) \
- { bit_set ((flags)[0], bit); bit_clear ((flags)[1], bit); }
-
-#define ASSIGN_RSTATE(to_flags, to_bit, from_flags, from_bit) \
- { bit_assign ((to_flags)[0], to_bit, bit_value((from_flags)[0], from_bit));\
- bit_assign ((to_flags)[1], to_bit, bit_value((from_flags)[1], from_bit));}
-
-
-#define CHECK_REG_READ(dcontext, reg) \
- if (REG_STATE(dcontext, reg) == DC_INVALID) \
- dc_error (dcontext->handle, \
- "General register %d is not readable.", reg)
-
-#define CHECK_REG_WRITE(dcontext, reg) \
- if (REG_STATE(dcontext, reg) != DC_WRITABLE) \
- dc_error (dcontext->handle, \
- "General register %d is not writable.", reg)
-
-#define CHECK_AUX_READ(dcontext, reg) \
- if (AUX_STATE(dcontext, reg) == DC_INVALID) \
- dc_error (dcontext->handle, \
- "Auxiliary register %d is not readable.", reg)
-
-#define CHECK_AUX_WRITE(dcontext, reg) \
- if (AUX_STATE(dcontext, reg) != DC_WRITABLE) \
- dc_error (dcontext->handle, \
- "Auxiliary register %d is not writable.", reg)
-
-
-
-#define DC_REG_RA 1
-#define DC_REG_FP 30
-#define DC_REG_SP 31
-#define DC_NUM_REG 32
-
-#define DC_AUX_LOC 0
- /* DC_AUX_LOC must be first, with value 0 */
-#define DC_AUX_SXIP 1
-#define DC_AUX_SNIP 2
-#define DC_AUX_SFIP 3
-#define DC_AUX_FPSR 4
-#define DC_AUX_FPCR 5
-#define DC_NUM_AUX 6
-
-
-
-#define CHECK_REG(dcontext, reg) \
- if ((reg < 0) || (reg >= DC_NUM_REG)) \
- dc_error (dcontext->handle, \
- "Bad general register number: %d", reg)
-
-#define CHECK_AUX(dcontext, reg) \
- if ((reg < 1) || (reg >= DC_NUM_AUX)) \
- dc_error (dcontext->handle, \
- "Bad auxiliary register number: %d", reg)
- /* CHECK_AUX is not used for location pseudo-register. */
-
-#define CHECK_BIT(dcontext, bit) \
- if ((bit < 0) || (bit >= 32)) \
- dc_error (dcontext->handle, \
- "Bad bit number: %d", bit)
-
-
-
-typedef struct cr_value {
- int reg;
- unsigned int off;
- } dc_cr_value_t;
-
-#define DC_UNDEF 32
-
-/*
- A "dc_cr_value" represents an execution-time value symbolically, in
- terms of the initial value of a register (the value on entry to
- the procedure being analyzed) and a known offset. A value with
- a 'reg' field value of 0 through 31 represents the value obtained
- by summing (using 32-bit modulus arithmetic) the initial value of
- register 'reg' and the value 'off'. Note that the value (0,k)
- represents the constant value k, that (31,0) represents the CFA, and
- that (1,0) represents the return address. A value with a 'reg' field
- of DC_UNDEF represents an indeterminable value; in this case the
- 'off' field is undefined. Other values of 'reg' are erroneous.
-*/
-
-typedef struct cr_data {
- dc_cr_value_t reg_val[DC_NUM_REG];
- dc_word_t saved;
- dc_word_t how;
- unsigned int where[DC_NUM_REG];
-} dc_cr_data_t;
-
-/*
- 'cr_data' collects all the information needed to represent the
- symbolic machine state during code reading.
-
- The 'reg_val' array gives the current dc_cr_value for each register.
-
- The 'saved', 'how', and 'where' fields combine to describe what
- registers have been saved, and where. The 'saved' and 'how' fields
- are implicitly bit arrays over 0..31, where the numbering is from
- 0 on the right. (Hence, 1<<r gives the mask for register r.)
- If saved[r] is 0, the register is not saved, and how[r] and where[r]
- are undefined. If saved[r] is 1, then how[r] tells whether register r
- was saved in another register (how[r]==0) or in the frame (how[r]==1).
- In the former case, where[r] gives the register number; in the latter
- case, where[r] gives the frame position.
-*/
-
-
-typedef int dc_register_state_t; /* range 0 to 2 */
-
-#define DC_INVALID 0
-#define DC_READABLE 1
-#define DC_WRITABLE 2
-
-
-
-
-typedef struct dcontext_info {
- dc_handle_t handle; /* environment of context */
- dc_word_t reg_info[DC_NUM_REG];
- dc_word_t reg_flags[2];
- dc_word_t aux_info[DC_NUM_AUX];
- dc_word_t aux_flags[2];
- dc_exactness_t loc_exact;
- dc_word_t psr_info; /* value or address */
- dc_word_t psr_ind; /* DC_TRUE iff address */
- dc_word_t psr_flags[2]; /* per-PSR-bit flags */
- unsigned int code_reading; /* no tdesc therefore must read code*/
- union {
- tdesc_elem_t *tdesc_elem_ptr; /* locates tdesc chunk */
- dc_cr_data_t *cr_data_ptr; /* or code reading data */
- } info_ptr;
-} dcontext_info_t;
-
-typedef dcontext_info_t *dc_dcontext_t;
-
-dc_word_t dc_get_value (handle, info, flags, pos)
- dc_handle_t handle;
- dc_word_t info[];
- dc_word_t flags[2];
- int pos;
- /* Assumes either DC_READABLE or DC_WRITABLE. */
-{
- if (bit_test(flags[0], pos)) {
- /* DC_WRITABLE case */
- return dc_read_word(handle, info[pos]);
- } else {
- /* DC_READABLE case */
- return info[pos];
- }
-}
-
-void dc_set_value (handle, info, flags, pos, value)
- dc_handle_t handle;
- dc_word_t info[];
- dc_word_t flags[2];
- int pos;
- dc_word_t value;
- /* Assumes DC_WRITABLE. */
-{
- dc_write_word(handle, info[pos], value);
-}
-
-
-#define GET_REG_VALUE(dcontext, reg) \
- dc_get_value(dcontext->handle, dcontext->reg_info, dcontext->reg_flags, reg)
-
-#define SET_REG_VALUE(dcontext, reg, value) \
- dc_set_value(dcontext->handle, dcontext->reg_info, dcontext->reg_flags, reg, \
- value)
-
-#define GET_AUX_VALUE(dcontext, reg) \
- dc_get_value(dcontext->handle, dcontext->aux_info, dcontext->aux_flags, reg)
-
-#define SET_AUX_VALUE(dcontext, reg, value) \
- dc_set_value(dcontext->handle, dcontext->aux_info, dcontext->aux_flags, reg, \
- value)
-
-
-
-void dc_check_dcontext (dc)
- dc_dcontext_t dc;
- /* Check consistency of information supplied to make a dcontext. */
-{
- int i;
-
- if ((REG_STATE(dc, 0) != DC_READABLE) || (dc->reg_info[0] != 0))
- dc_error (dc->handle, "Register 0 is misspecified");
- for (i = 1; i < DC_NUM_REG; i++)
- if (REG_STATE(dc, i) == DC_RESERVED)
- dc_error (dc->handle,
- "State for general register %d is incorrect", i);
- for (i = 0; i < DC_NUM_AUX; i++)
- if (AUX_STATE(dc, i) == DC_RESERVED)
- dc_error (dc->handle,
- "State for auxiliary register %d is incorrect", i);
- if (AUX_STATE(dc, DC_AUX_LOC) == DC_INVALID)
- dc_error (dc->handle, "Location is specified as invalid");
- if (GET_AUX_VALUE(dc, DC_AUX_LOC) == 0)
- dc_error (dc->handle, "Location is zero.");
- if (dc->loc_exact >= 3)
- dc_error (dc->handle, "Location exactness is incorrectly specified: %d",
- dc->loc_exact);
- if (dc->psr_ind >= 2)
- dc_error (dc->handle,
- "PSR indirection flag is incorrectly specified: %d",
- dc->psr_ind);
- for (i = 0; i < 32; i++)
- if (PSR_STATE(dc, i) == DC_RESERVED)
- dc_error (dc->handle, "State for PSR bit %d is incorrect", i);
-}
-
-
-
-tdesc_elem_t * dc_tdesc_lookup (loc, tt, tt_size, map_info_in_ptr)
- dc_word_t loc;
- tdesc_table_t tt;
- int tt_size;
- dc_map_info_in_t *map_info_in_ptr;
- /* Return address of tdesc_elem_t for given location, or NULL if
- there is no tdesc chunk for the location.
- */
-{
- int l = 0;
- int h = tt_size;
- int m;
-
- if (tt_size == 0) {
- map_info_in_ptr->flags = 0;
- return (tdesc_elem_t *)NULL;
- }
- for (;;) {
- m = (l + h) / 2;
- if (m == l) break;
- if (loc >= tt[m].start_address)
- l = m;
- else
- h = m;
- }
- if (loc >= tt[m].end_address) {
- map_info_in_ptr->preceding_tdesc_end = tt[m].end_address;
- if (m+1 < tt_size) {
- map_info_in_ptr->following_tdesc_start = tt[m+1].start_address;
- map_info_in_ptr->flags = DC_MII_PRECEDING_TDESC_END |
- DC_MII_FOLLOWING_TDESC_START;
- } else {
- map_info_in_ptr->flags = DC_MII_PRECEDING_TDESC_END;
- }
- return (tdesc_elem_t *)NULL;
- } else if (loc < tt[m].start_address) {
- map_info_in_ptr->following_tdesc_start = tt[m].start_address;
- map_info_in_ptr->flags = DC_MII_FOLLOWING_TDESC_START;
- return (tdesc_elem_t *)NULL;
- } else {
- return (&tt[m]);
- }
-}
-
-
-
-dc_dcontext_t dc_make_dcontext (handle,
- reg_info, reg_flags,
- aux_info, aux_flags, loc_exact,
- psr_info, psr_ind, psr_flags)
- dc_handle_t handle;
- dc_word_t reg_info[DC_NUM_REG];
- dc_word_t reg_flags[2];
- dc_word_t aux_info[DC_NUM_AUX];
- dc_word_t aux_flags[2];
- dc_exactness_t loc_exact;
- dc_word_t psr_info;
- dc_boolean_t psr_ind;
- dc_word_t psr_flags[2];
-{
- dc_dcontext_t dc = (dc_dcontext_t) dc_malloc (handle, sizeof(dcontext_info_t));
- int i;
- dc_map_info_in_t map_info_in;
-
- /* Fill in supplied content. */
- dc->handle = ((dc_handle_t)handle);
- for (i = 0; i < DC_NUM_REG; i++) dc->reg_info[i] = reg_info[i];
- for (i = 0; i < 2; i++) dc->reg_flags[i] = reg_flags[i];
- for (i = 0; i < DC_NUM_AUX; i++) dc->aux_info[i] = aux_info[i];
- for (i = 0; i < 2; i++) dc->aux_flags[i] = aux_flags[i];
- dc->loc_exact = loc_exact;
- dc->psr_info = psr_info;
- dc->psr_ind = psr_ind;
- for (i = 0; i < 2; i++) dc->psr_flags[i] = psr_flags[i];
-
- dc_check_dcontext(dc);
-
- /* Find tdesc information for the text chunk. */
- {
-/***************************************************************/
-/* BUG 8/16/89 Found by hls. Not zeroing EV bits of location. */
-/* SHOULD USE dc_location()! */
-/* dc_word_t loc = GET_AUX_VALUE(dc, DC_AUX_LOC); */
-/***************************************************************/
- dc_word_t loc = GET_AUX_VALUE(dc, DC_AUX_LOC) & ~3;
- tdesc_elem_t *tep =
- dc_tdesc_lookup(loc, ((dc_handle_t)handle)->tdesc_table,
- ((dc_handle_t)handle)->tdesc_table_size,&map_info_in);
- if (tep) {
- dc->code_reading = 0;
- dc->info_ptr.tdesc_elem_ptr = tep;
- } else {
- dc->code_reading = 1;
- if (!dc->handle->map_fcn) {
- dc_error (dc->handle, "No tdesc information for %#.8X and no map function supplied.",loc);
- }
-/****************************************************************/
-/* BUG 9/18/89 Found by hls. Not using dc_malloc() */
-/* dc->info_ptr.cr_data_ptr= (dc_cr_data_t *)malloc(sizeof(dc_cr_data_t )); */
-/****************************************************************/
- dc->info_ptr.cr_data_ptr= (dc_cr_data_t *)dc_calloc(dc->handle,1,sizeof(dc_cr_data_t ));
- dc_read_code(loc,dc,map_info_in,dc->info_ptr.cr_data_ptr);
- }
- }
-
- return (dc_dcontext_t) dc;
-}
-
-
-
-void dc_free_dcontext (dcontext)
- dc_dcontext_t dcontext;
-{
-/****************************************************************/
-/* BUG 9/19/89 Found by hls. Freeing non-pointer value. */
-/* free((char *)dcontext->code_reading); */
-/****************************************************************/
- if (dcontext->code_reading)
- free((char *)dcontext->info_ptr.cr_data_ptr);
- free((char *)dcontext);
-}
-
-
-
-dc_register_state_t dc_location_state (dcontext)
- dc_dcontext_t dcontext;
-{
- return AUX_STATE(((dc_dcontext_t)dcontext), DC_AUX_LOC);
-}
-
-
-dc_exactness_t dc_location_exactness (dcontext)
- dc_dcontext_t dcontext;
-{
- return ((dc_dcontext_t)dcontext)->loc_exact;
-}
-
-
-dc_word_t dc_location (dcontext)
- dc_dcontext_t dcontext;
- /* Return high 30 bits only. */
-{
- /* Don't need: CHECK_AUX_READ (((dc_dcontext_t)dcontext), DC_AUX_LOC); */
- return GET_AUX_VALUE (((dc_dcontext_t)dcontext), DC_AUX_LOC) & ~3;
-}
-
-
-dc_boolean_t dc_location_in_text_chunk( dcontext, value )
- dc_dcontext_t dcontext;
- dc_word_t value;
-{
- /* Check that new location is still within same text chunk. */
- tdesc_elem_t *tep = ((dc_dcontext_t)dcontext)->info_ptr.tdesc_elem_ptr;
-/********************************************************************/
-/* Bug in predicate -- LS adjusted according to OCS documentation.. */
-/* if ((value < tep->start_address) || (value >= tep->end_address))*/
-/********************************************************************/
- if ((value >= tep->start_address) && (value < tep->end_address))
- return DC_TRUE;
- else
- return DC_FALSE;
-
-}
-
-
-void dc_set_location (dcontext, value)
- dc_dcontext_t dcontext;
- dc_word_t value;
- /* Set high 30 bits only. */
-{
- if (dc_location_in_text_chunk( dcontext, value ) != DC_TRUE)
- dc_warn (((dc_dcontext_t)dcontext)->handle,
- "New location is not in same text chunk.");
-
- CHECK_AUX_WRITE (((dc_dcontext_t)dcontext), DC_AUX_LOC);
- dc_write_masked_word (((dc_dcontext_t)dcontext)->handle,
- ((dc_dcontext_t)dcontext)->aux_info[DC_AUX_LOC], ~3, value);
-}
-
-
-
-dc_register_state_t dc_general_register_state (dcontext, reg)
- dc_dcontext_t dcontext;
- int reg;
-{
- CHECK_REG (((dc_dcontext_t)dcontext), reg);
- return REG_STATE(((dc_dcontext_t)dcontext), reg);
-}
-
-
-dc_word_t dc_general_register (dcontext, reg)
- dc_dcontext_t dcontext;
- int reg;
-{
- CHECK_REG (((dc_dcontext_t)dcontext), reg);
- CHECK_REG_READ (((dc_dcontext_t)dcontext), reg);
- return GET_REG_VALUE(((dc_dcontext_t)dcontext), reg);
-}
-
-
-void dc_set_general_register (dcontext, reg, value)
- dc_dcontext_t dcontext;
- int reg;
- dc_word_t value;
-{
- CHECK_REG (((dc_dcontext_t)dcontext), reg);
- CHECK_REG_WRITE (((dc_dcontext_t)dcontext), reg);
- SET_REG_VALUE (((dc_dcontext_t)dcontext), reg, value);
-}
-
-
-
-dc_register_state_t dc_auxiliary_register_state (dcontext, reg)
- dc_dcontext_t dcontext;
- int reg;
-{
- CHECK_AUX (((dc_dcontext_t)dcontext), reg);
- return AUX_STATE(((dc_dcontext_t)dcontext), reg);
-}
-
-
-dc_word_t dc_auxiliary_register (dcontext, reg)
- dc_dcontext_t dcontext;
- int reg;
-{
- CHECK_AUX (((dc_dcontext_t)dcontext), reg);
- CHECK_AUX_READ (((dc_dcontext_t)dcontext), reg);
- return GET_AUX_VALUE(((dc_dcontext_t)dcontext), reg);
-}
-
-
-void dc_set_auxiliary_register (dcontext, reg, value)
- dc_dcontext_t dcontext;
- int reg;
- dc_word_t value;
-{
- CHECK_AUX (((dc_dcontext_t)dcontext), reg);
- CHECK_AUX_WRITE (((dc_dcontext_t)dcontext), reg);
- SET_AUX_VALUE (((dc_dcontext_t)dcontext), reg, value);
-}
-
-
-
-dc_register_state_t dc_psr_register_bit_state (dcontext, bit)
- dc_dcontext_t dcontext;
- int bit;
-{
- CHECK_BIT (((dc_dcontext_t)dcontext), bit);
- return PSR_STATE(((dc_dcontext_t)dcontext), bit);
-}
-
-
-dc_word_t dc_psr_register (dcontext)
- dc_dcontext_t dcontext;
-{
- if (((dc_dcontext_t)dcontext)->psr_ind) {
- return dc_read_word(((dc_dcontext_t)dcontext)->handle,
- ((dc_dcontext_t)dcontext)->psr_info);
- } else {
- return ((dc_dcontext_t)dcontext)->psr_info;
- }
-}
-
-
-void dc_set_psr_register (dcontext, mask, value)
- dc_dcontext_t dcontext;
- dc_word_t mask;
- dc_word_t value;
- /* Set bits of PSR corresponding to 1 bits in mask. */
-{
- if (((dc_dcontext_t)dcontext)->psr_ind) {
- if (((((dc_dcontext_t)dcontext)->psr_flags[0] & mask) != mask) ||
- ((((dc_dcontext_t)dcontext)->psr_flags[1] & mask) != 0))
- dc_error (((dc_dcontext_t)dcontext)->handle,
- "Some PSR bits specified are not writable.");
- dc_write_masked_word (((dc_dcontext_t)dcontext)->handle,
- ((dc_dcontext_t)dcontext)->psr_info, mask, value);
- } else {
- dc_error (((dc_dcontext_t)dcontext)->handle, "PSR is not writable.");
- }
-}
-
-
-
-dc_word_t dc_frame_address (dcontext)
- dc_dcontext_t dcontext;
-{
- if (!dcontext->code_reading) {
- tdesc_elem_t *tep = ((dc_dcontext_t)dcontext)->info_ptr.tdesc_elem_ptr;
- return dc_general_register(dcontext,
- tep->info.frame_address_register) + tep->info.frame_address_offset;
- } else {
- if (dcontext->info_ptr.cr_data_ptr->reg_val[DC_REG_FP].reg == DC_REG_SP) {
- return (dc_general_register(dcontext,DC_REG_FP)
- - dcontext->info_ptr.cr_data_ptr->reg_val[DC_REG_FP].off);
- }
- if (dcontext->info_ptr.cr_data_ptr->reg_val[DC_REG_SP].reg == DC_REG_SP) {
- return (dc_general_register(dcontext,DC_REG_SP)
- - dcontext->info_ptr.cr_data_ptr->reg_val[DC_REG_SP].off);
- }
- dc_error (((dc_dcontext_t)dcontext)->handle, "Cannot locate frame pointer.");
- }
-}
-
-
-
-dc_kind_t dc_context_kind (dcontext)
- dc_dcontext_t dcontext;
-{
- return DC_CALL_KIND;
-}
-
-
-
-
-/* operations valid for call contexts only */
-
-
-dc_register_state_t dc_return_address_state (dcontext)
- dc_dcontext_t dcontext;
-{
- tdesc_elem_t *tep = ((dc_dcontext_t)dcontext)->info_ptr.tdesc_elem_ptr;
- int reg;
-
- if (!dcontext->code_reading) {
- if (tep->info.return_address_info_discriminant) {
- return DC_WRITABLE;
- } else {
- return REG_STATE(((dc_dcontext_t)dcontext), tep->info.return_address_info);
- }
- } else {
- reg= DC_REG_RA;
- if (bit_test(dcontext->info_ptr.cr_data_ptr->saved,DC_REG_RA)) {
- if (bit_test(dcontext->info_ptr.cr_data_ptr->how,DC_REG_RA)) {
- return DC_WRITABLE;
- } else {
- reg= dcontext->info_ptr.cr_data_ptr->where[DC_REG_RA];
- }
- }
- return REG_STATE(((dc_dcontext_t)dcontext),reg);
-
-
- }
-}
-
-
-dc_exactness_t dc_return_address_exactness (dcontext)
- dc_dcontext_t dcontext;
-{
- return DC_MAYBE;
-}
-
-
-dc_word_t dc_return_address (dcontext)
- dc_dcontext_t dcontext;
- /* Return high 30 bits only. */
-{
- tdesc_elem_t *tep = ((dc_dcontext_t)dcontext)->info_ptr.tdesc_elem_ptr;
- dc_word_t rai = tep->info.return_address_info;
- dc_word_t val;
- int reg;
-
- if (!dcontext->code_reading) {
- if (tep->info.return_address_info_discriminant) {
- val = dc_read_word (((dc_dcontext_t)dcontext)->handle,
- dc_frame_address(dcontext) + rai);
- } else {
- val = dc_general_register (dcontext, rai);
- }
- } else {
- reg=DC_REG_RA;
- if (bit_test(dcontext->info_ptr.cr_data_ptr->saved,reg)) {
- if (bit_test(dcontext->info_ptr.cr_data_ptr->how,reg)) {
- val = dc_read_word (((dc_dcontext_t)dcontext)->handle,
- dc_frame_address(dcontext) +
- (dcontext->info_ptr.cr_data_ptr->where[reg]));
- } else {
- reg= dcontext->info_ptr.cr_data_ptr->where[DC_REG_RA];
- val = dc_general_register (dcontext, reg);
- }
- } else {
- val = dc_general_register (dcontext, reg);
- }
- }
- return val & ~3;
-}
-
-
-void dc_set_return_address (dcontext, value)
- dc_dcontext_t dcontext;
- dc_word_t value;
- /* Set high 30 bits only. */
-{
- if (!dcontext->code_reading) {
- tdesc_elem_t *tep = ((dc_dcontext_t)dcontext)->info_ptr.tdesc_elem_ptr;
- dc_word_t rai = tep->info.return_address_info;
-
- if (tep->info.return_address_info_discriminant) {
- dc_write_masked_word (((dc_dcontext_t)dcontext)->handle,
- dc_frame_address(dcontext) + rai, ~3, value);
- } else {
- dc_set_general_register (dcontext, rai,
- (value & ~3) | (dc_general_register(dcontext, rai) & 3));
- }
- } else {
- if (bit_test(dcontext->info_ptr.cr_data_ptr->saved,DC_REG_RA)) {
- if (bit_test(dcontext->info_ptr.cr_data_ptr->how,DC_REG_RA)) {
- dc_write_masked_word (((dc_dcontext_t)dcontext)->handle,
- dc_frame_address(dcontext)
- + dcontext->info_ptr.cr_data_ptr->where[DC_REG_RA], ~3, value);
- } else {
- dc_set_general_register( dcontext,
- dcontext->info_ptr.cr_data_ptr->where[DC_REG_RA]);
- }
- } else {
- dc_set_general_register( dcontext,
- dcontext->info_ptr.cr_data_ptr->where[DC_REG_RA]);
- }
- }
-}
-
-
-
-/* operations valid for save contexts only */
-
-/* (none) */
-
-
-
-/* operations valid for exception contexts only */
-
-
-void dc_get_exception_info (dcontext, handler, datum)
- dc_dcontext_t dcontext;
- dc_word_t *handler;
- dc_word_t *datum;
-{
- dc_error (((dc_dcontext_t)dcontext)->handle,
- "dc_get_exception_info is not yet implemented.");
-}
-
-
-
-/* operations valid for protection contexts only */
-
-
-void dc_get_protection_info (dcontext, handler, datum)
- dc_dcontext_t dcontext;
- dc_word_t *handler;
- dc_word_t *datum;
-{
- dc_error (((dc_dcontext_t)dcontext)->handle,
- "dc_get_protection_info is not yet implemented.");
-}
-
-
-
-/* operations valid for special contexts only */
-
-
-void dc_get_special_info (dcontext, kind, datum)
- dc_dcontext_t dcontext;
- dc_word_t *kind;
- dc_word_t *datum;
-{
- dc_error (((dc_dcontext_t)dcontext)->handle,
- "dc_get_special_info is not yet implemented.");
-}
-
-
-
-/* operations valid for all contexts (again) */
-
-
-dc_dcontext_t dc_previous_dcontext (dcontext)
- dc_dcontext_t dcontext;
- /* Return NULL if there is no previous context. */
-{
- dc_dcontext_t old = (dc_dcontext_t) dcontext;
- dcontext_info_t new; /* to serve as temporary storage only */
- tdesc_elem_t *tep;
- dc_cr_data_t *cdp;
- dc_word_t cfa;
- int rsm;
- dc_word_t offset;
- dc_word_t rai;
- int r;
-
- if (dc_return_address_state((dc_dcontext_t)old) == DC_INVALID)
- dc_error (old->handle, "Return address is invalid.");
-
- if (dc_return_address((dc_dcontext_t)old) == 0)
- return (dc_dcontext_t)NULL; /* end of the chain */
-
- /* Copy over old contents. */
- new = *old;
-
- cfa = dc_frame_address(old);
- /* Restore stack pointer. */
- new.reg_info[DC_REG_SP] = cfa;
- SET_READABLE (new.reg_flags, DC_REG_SP);
-
- /* Invalidate temporary registers. */
- for (r = 1; r <= 13; r++) SET_INVALID (new.reg_flags, r);
-
- if (!old->code_reading) {
- tep = old->info_ptr.tdesc_elem_ptr;
- /* Restore preserved registers. */
- rsm = tep->info.register_save_mask;
- offset = cfa + tep->info.register_save_offset;
- for (r = 14; r <= 30; r++) {
- if (bit_test(rsm, 30-r)) {
- new.reg_info[r] = offset;
- SET_WRITABLE (new.reg_flags, r);
- offset += sizeof(dc_word_t);
- }
- }
-
- /* Set location from old return address. */
- rai = tep->info.return_address_info;
- if (tep->info.return_address_info_discriminant) {
- new.aux_info[DC_AUX_LOC] = cfa + rai;
- SET_WRITABLE (new.aux_flags, DC_AUX_LOC);
- } else {
- new.aux_info[DC_AUX_LOC] = old->reg_info[rai];
- ASSIGN_RSTATE (new.aux_flags, DC_AUX_LOC, old->reg_flags, rai);
- }
- } else {
- cdp = old->info_ptr.cr_data_ptr;
-
- /* Restore preserved registers. */
- for (r = 14; r <= 30; r++) {
- if (bit_test(cdp->saved,r)) {
- if (bit_test(cdp->how,r)){ /* saved in the frame */
- new.reg_info[r] = cfa+cdp->where[r];
- SET_WRITABLE (new.reg_flags, r);
- } else { /* saved in the in a register */
- new.reg_info[r] = dc_general_register(old,cdp->where[r]);
- ASSIGN_RSTATE (new.aux_flags, r, old->reg_flags, cdp->where[r]);
- }
- } /* not saved, therefore, already valid , no else*/
- }
-
- /* Set location from old return address. */
- if (bit_test(cdp->saved,DC_REG_RA)) {
- if (bit_test(cdp->how,DC_REG_RA)){ /* saved in the frame */
- new.aux_info[DC_AUX_LOC] =
- new.reg_info[DC_REG_RA] = cfa+cdp->where[DC_REG_RA];
- SET_WRITABLE (new.reg_flags, DC_REG_RA);
- SET_WRITABLE (new.aux_flags, DC_AUX_LOC);
- } else { /* saved in the in a register */
- new.reg_info[DC_REG_RA] =
- new.aux_info[DC_AUX_LOC] =
- dc_general_register(old,cdp->where[DC_REG_RA]);
- ASSIGN_RSTATE (new.aux_flags, DC_AUX_LOC,
- old->reg_flags, cdp->where[DC_REG_RA]);
- }
- } else { /* not saved, therefore, already valid , set DC_AUX_LOC only*/
- new.aux_info[DC_AUX_LOC] =
- dc_general_register(old,DC_REG_RA);
- ASSIGN_RSTATE (new.aux_flags, DC_AUX_LOC,
- old->reg_flags, DC_REG_RA);
- }
- }
-
- /* Invalidate instruction pointers. */
- SET_INVALID (new.aux_flags, DC_AUX_SXIP);
- SET_INVALID (new.aux_flags, DC_AUX_SNIP);
- SET_INVALID (new.aux_flags, DC_AUX_SFIP);
-
- /* No change to FCR registers. */
-
- /* No change to PSR register. */
-
- return dc_make_dcontext ((dc_handle_t)new.handle,
- new.reg_info, new.reg_flags,
- new.aux_info, new.aux_flags, new.loc_exact,
- new.psr_info, new.psr_ind, new.psr_flags);
-}
-
-
-
-/* extensions for nonlocal goto */
-
-#if 0
-
-typedef
- struct label {
- ???
- } label_t;
-
-
-label_t dc_make_label (dcontext, location)
- dc_dcontext_t dcontext;
- dc_word_t location;
-{
-}
-
-#endif
-
-/* procedure for reading code */
-
-dc_read_code(loc,dc,map_info_in,cdp)
-dc_word_t loc;
-dc_dcontext_t dc;
-dc_cr_data_t *cdp;
-dc_map_info_in_t map_info_in;
-{
-dc_map_info_out_t map_info_out;
-dc_word_t pc;
-dc_boolean_t found_branch=DC_FALSE;
-dc_word_t instr;
-
- (*dc->handle->map_fcn)(dc->handle->map_env,loc,map_info_in,&map_info_out);
- if (map_info_out.flags & DC_MIO_ENTRY_POINT
- && (!(map_info_in.flags & DC_MII_PRECEDING_TDESC_END)
- || map_info_out.entry_point >= map_info_in.preceding_tdesc_end
- || map_info_out.flags & DC_MIO_LITERAL_ENTRY_POINT)) {
- dc_init_cr_data(cdp,(tdesc_elem_t *)NULL);
- pc= map_info_out.entry_point;
- } else if (map_info_in.flags & DC_MII_PRECEDING_TDESC_END) {
- /**/
- /* tdesc_lookup gets the tep for the preceeding tdesc information
- /* so we call it with one less than the preceding tdesc end since
- /* tdesc information is exclusive of the ending address
- /**/
- dc_init_cr_data(cdp,
- dc_tdesc_lookup(map_info_in.preceding_tdesc_end-1,
- ((dc_handle_t)dc->handle)->tdesc_table,
- ((dc_handle_t)dc->handle)->tdesc_table_size,
- &map_info_in));
- pc= map_info_in.preceding_tdesc_end;
- } else {
- dc_error (dc->handle, "Insufficient information for code reading.");
- }
- for (;;pc+=4) {
- if (pc==loc) {
- return (DC_TRUE);
- }
- instr= dc_read_word(dc->handle,pc);
- found_branch= dc_decode_finds_branch(dc,instr);
- if ((map_info_out.flags & DC_MIO_PROLOGUE_END)
- && (pc==map_info_out.prologue_end)) {
- break;
- }
- if (found_branch) {
- if (DC_MIO_IMPLICIT_PROLOGUE_END & map_info_out.flags) {
- break;
- } else {
- dc_error (dc->handle, "Found branch before end of prologue.");
- }
- }
- }
- if (!(map_info_out.flags & DC_MIO_LITERAL_EPILOGUE_START)
- && (map_info_out.epilogue_start >= loc
- || !(map_info_out.flags & DC_MIO_EPILOGUE_START))) {
- return (DC_TRUE);
- }
- dc_correct_cr_data(cdp,dc->handle);
- for (pc=map_info_out.epilogue_start;pc<loc;pc+=4) {
- instr= dc_read_word(dc->handle,pc);
- if (dc_decode_finds_branch(dc,instr)) {
- return (DC_FALSE);
- }
- }
- return (DC_TRUE);
-
-}
-
-
-
-dc_init_cr_data(cdp,tep)
-dc_cr_data_t *cdp;
-tdesc_elem_t *tep;
-{
-int reg;
-dc_word_t rai;
-dc_word_t raid;
-dc_word_t rsm;
-dc_word_t frpos;
-
- if (tep){
-
- /* Start off with all registers undefined and none saved. */
- for (reg = 0; reg < DC_NUM_REG; reg++) {
- cdp->reg_val[reg].reg = DC_UNDEF;
- }
- cdp->saved = 0;
-
- /* Overwrite with what tdesc element says. */
-
- cdp->reg_val[tep->info.frame_address_register].reg = DC_REG_SP;
- cdp->reg_val[tep->info.frame_address_register].off =
- - tep->info.frame_address_offset;
-
- rai = tep->info.return_address_info;
- raid = tep->info.return_address_info_discriminant;
- if (raid || rai != DC_REG_RA) {
- bit_set(cdp->saved,DC_REG_RA);
- bit_assign(cdp->how,DC_REG_RA,raid);
- cdp->where[DC_REG_RA] = rai;
- }
-
- rsm = tep->info.register_save_mask;
- frpos = tep->info.register_save_offset;
- for (reg = 14; reg <= 30; reg++) {
- if (bit_test(rsm, 30-reg)) {
- bit_set(cdp->saved,reg);
- bit_set(cdp->how,reg);
- cdp->where[reg] = frpos;
- frpos += sizeof(dc_word_t);
- } else {
- cdp->reg_val[reg].reg = reg;
- cdp->reg_val[reg].off = 0;
- }
- }
-
- cdp->reg_val[0].reg = 0; /* guarantee what hardware does */
- cdp->reg_val[0].off = 0;
-
- } else {
- /* Each register has its own initial value. */
- for (reg = 0; reg < DC_NUM_REG; reg++) {
- cdp->reg_val[reg].reg = reg;
- cdp->reg_val[reg].off = 0;
- }
- /* No register is yet saved. */
- cdp->saved = 0;
- cdp->how = 0;
- }
-}
-void dc_correct_cr_data(cdp,handle)
-dc_cr_data_t *cdp;
-dc_handle_t handle;
-{
-long sr,r;
-dc_word_t save_regs = 0; /* registers used to save others */
- for (r = 1; r < DC_REG_SP; r++) {
- if (bit_test(cdp->saved,r) && !bit_test(cdp->how,r)) {
- sr = cdp->where[r];
- if (bit_test(save_regs,sr)) {
- dc_error(handle, "Same register used to save two others.");
- }
- bit_set(save_regs,sr);
- }
- }
- for (r = 1; r < DC_REG_FP; r++) {
- if ((r < 14 || bit_test(cdp->saved,r)) && !bit_test(save_regs,r)) {
- cdp->reg_val[r].reg = DC_UNDEF;
- }
- }
- if (bit_test(cdp->saved,DC_REG_FP) &&
- cdp->reg_val[DC_REG_FP].reg == DC_REG_SP) { /* is r30 the far? */
- cdp->reg_val[DC_REG_SP].reg = DC_UNDEF; /* trash sp */
- } else if (cdp->reg_val[DC_REG_SP].reg == DC_REG_SP) { /* is r31 the far? */
- if (bit_test(cdp->saved,DC_REG_FP) && !bit_test(save_regs,DC_REG_FP)) {
- cdp->reg_val[DC_REG_FP].reg = DC_UNDEF; /* trash r30 */
- }
- }
-}
diff --git a/gdb/tdesc.h b/gdb/tdesc.h
deleted file mode 100755
index 3936330..0000000
--- a/gdb/tdesc.h
+++ /dev/null
@@ -1,329 +0,0 @@
-/* This file has been modified by Data General Corporation, November 1989. */
-
-#ifndef _tdesc_h
-#define _tdesc_h
-#ifdef __STDC__
-#define _ARGS(x) x
-#else
-#define _ARGS(x) ()
-#endif
-
-/*
- This file provides an abstract interface to "tdesc" information.
- It is designed to be used in a uniform manner by several kinds
- of debuggers:
- (1) code in live debugged process (e.g., a traceback routine)
- (2) a separate-process debugger debugging a live process
- (3) a separate-process debugger debugging a memory dump
-
- Dcontext model notes
- * captures machine context
- * partial: excludes memory
- * frames
- * kinds
- * make one for starters, chain in reverse order to previous ones
- * representation: pointer to opaque
- * alloc/free protocol
-
- Overall model
- * access functions
- * handle
- * error handling
-*/
-
-
-
-typedef int dc_boolean_t; /* range 0 .. 1 */
-#define DC_FALSE 0
-#define DC_TRUE 1
-
-
-typedef int dc_tristate_t; /* range 0 .. 2 */
-#define DC_NO 0
-#define DC_YES 1
-#define DC_MAYBE 2
-
-
-#define DC_MII_PRECEDING_TDESC_END (1<<0)
-#define DC_MII_FOLLOWING_TDESC_START (1<<1)
-
-#define DC_MIO_ENTRY_POINT (1<< 0)
-#define DC_MIO_PROLOGUE_END (1<< 1)
-#define DC_MIO_EPILOGUE_START (1<< 2)
-#define DC_MIO_IMPLICIT_PROLOGUE_END (1<<16)
-#define DC_MIO_LITERAL_ENTRY_POINT (1<<17)
-#define DC_MIO_LITERAL_EPILOGUE_START (1<<18)
-
-
-/*
- A word is 32 bits of information. In memory, a word is word-aligned.
-
- A common and important use of word_t is to represent values in the
- target process, including (byte) addresses in the target process.
- In this case, C arithmetic can be used to simulate machine address
- arithmetic on the target. (Unsigned arithmetic is actually modulus
- arithmetic.)
-*/
-typedef unsigned int dc_word_t;
-
-
-/*----------------*/
-
-
-/* The exactness of locations may not be certainly known. */
-typedef dc_tristate_t dc_exactness_t;
-
-
-/*
- The model includes five kinds of contexts. Because each context
- has an associated region and frame, these describe region kinds
- and frame kinds as well.
- [more description needed]
- Currently, only call contexts exist.
-*/
-
-typedef int dc_kind_t; /* range 0 .. 4 */
-#define DC_CALL_KIND 0
-#define DC_SAVE_KIND 1
-#define DC_EXCEPTION_KIND 2
-#define DC_PROTECTION_KIND 3
-#define DC_SPECIAL_KIND 4
-#define DC_NUM_KINDS 5
-
-
-typedef struct dc_debug_info {
- unsigned int protocol; /* 1 for this structure */
- dc_word_t tdesc_ptr;
- unsigned int text_words_count;
- dc_word_t text_words_ptr;
- unsigned int data_words_count;
- dc_word_t data_words_ptr;
-} dc_debug_info_t;
-
-
-typedef struct dc_mstate {
- dc_word_t reg[32]; /* general registers */
- dc_word_t xip;
- dc_word_t nip;
- dc_word_t fip;
- dc_word_t fpsr;
- dc_word_t fpcr;
- dc_word_t psr;
-} dc_mstate_t;
-
-
-
-#if 0
-
- void error_fcn (env, continuable, message)
- dc_word_t env; /* environment (arbitrary datum) */
- boolean_t continuable; /* whether error function may return */
- char *message; /* string (no trailing newline) */
-
- /* In the future, we probably want the error_fcn to be: */
- void error_fcn (env, continuable, code, ...)
- dc_word_t env; /* environment (arbitrary datum) */
- boolean_t continuable; /* whether error function may return */
- int code; /* error code */
- ... /* parameters to message associated
- with the code */
-
- void read_fcn (env, memory, length, buffer)
- dc_word_t env; /* environment (arbitrary datum) */
- dc_word_t memory; /* start address in image */
- int length; /* in bytes */
- char *buffer; /* start address of buffer */
- /* There are no alignment assumptions for the read function. */
-
- void write_fcn (env, memory, length, buffer)
- dc_word_t env; /* environment (arbitrary datum) */
- dc_word_t memory; /* start address in image */
- int length; /* in bytes */
- char *buffer; /* start address of buffer */
- /* There are no alignment assumptions for the write function. */
- /* The write function is optional. It must be provided if changes
- to writable registers are to be made. */
-
- void exec_fcn (env, mstate)
- dc_word_t env; /* environment (arbitrary datum) */
- dc_mstate_t *mstate; /* machine state (read-write) */
- /* The execute function is optional. It would be used (in the future)
- by the implementation of a procedurally specified tdesc mechanism. */
-
-#endif
-
-/*----------------*/
-
-
-typedef struct dc_map_info_in {
- dc_word_t flags;
- dc_word_t preceding_tdesc_end;
- dc_word_t following_tdesc_start;
-} dc_map_info_in_t;
-
-
-typedef struct dc_map_info_out {
- dc_word_t flags;
- dc_word_t entry_point;
- dc_word_t prologue_end;
- dc_word_t epilogue_start;
-} dc_map_info_out_t;
-
-
-typedef void *dc_handle_t;
-
-typedef void (*tdesc_error_fcn_type) _ARGS((
- dc_word_t env, /* environment (arbitrary datum) */
- dc_boolean_t continuable, /* whether error function may return */
- const char *message /* string (no trailing newline) */
-));
-typedef void (*tdesc_io_fcn_type) _ARGS((
- dc_word_t env, /* environment (arbitrary datum) */
- dc_word_t memory, /* start address in image */
- int length, /* in bytes */
- void *buffer /* start address of buffer */
-));
-typedef void (*tdesc_exec_fcn_type) _ARGS((
- dc_word_t env, /* environment (arbitrary datum) */
- dc_mstate_t *mstate /* machine state (read-write) */
-));
-typedef void (*tdesc_map_fcn_type) _ARGS((
- dc_word_t map_env,
- dc_word_t loc,
- dc_map_info_in_t map_info_in,
- dc_map_info_out_t *map_info_out
-));
-
-
-extern dc_handle_t dc_initiate _ARGS((
- dc_word_t debug_info_ptr,
- tdesc_error_fcn_type error_fcn,
- dc_word_t error_env,
- tdesc_io_fcn_type read_fcn,
- dc_word_t read_env,
- tdesc_io_fcn_type write_fcn, /* NULL => absent */
- dc_word_t write_env,
- tdesc_exec_fcn_type exec_fcn, /* NULL => absent */
- dc_word_t exec_env,
- tdesc_map_fcn_type map_fcn, /* NULL => absent */
- dc_word_t map_env
-));
-extern void dc_terminate _ARGS((
- dc_handle_t handle
-));
-
-typedef int dc_register_state_t; /* range 0 to 2 */
-
-#define DC_INVALID 0
-#define DC_READABLE 1
-#define DC_WRITABLE 2
-
-#define DC_NUM_REG 32
-
-#define DC_AUX_LOC 0
-#define DC_AUX_SXIP 1
-#define DC_AUX_SNIP 2
-#define DC_AUX_SFIP 3
-#define DC_AUX_FPSR 4
-#define DC_AUX_FPCR 5
-#define DC_NUM_AUX 6
-
-
-typedef void *dc_dcontext_t;
-
-extern dc_dcontext_t dc_make_dcontext _ARGS((
- dc_handle_t handle,
- dc_word_t reg_info[DC_NUM_REG],
- dc_word_t reg_flags[2],
- dc_word_t aux_info[DC_NUM_AUX],
- dc_word_t aux_flags[2],
- dc_exactness_t loc_exact,
- dc_word_t psr_info,
- dc_boolean_t psr_ind,
- dc_word_t psr_flags[2]
-));
-extern void dc_free_dcontext _ARGS((
- dc_dcontext_t dcontext
-));
-extern dc_register_state_t dc_location_state _ARGS((
- dc_dcontext_t dcontext
-));
-extern dc_exactness_t dc_location_exactness _ARGS((
- dc_dcontext_t dcontext
-));
-extern dc_word_t dc_location _ARGS((
- dc_dcontext_t dcontext
-));
-extern void dc_set_location _ARGS((
- dc_dcontext_t dcontext,
- dc_word_t value
-));
-extern dc_register_state_t dc_general_register_state _ARGS((
- dc_dcontext_t dcontext,
- int reg
-));
-extern dc_word_t dc_general_register _ARGS((
- dc_dcontext_t dcontext,
- int reg
-));
-extern void dc_set_general_register _ARGS((
- dc_dcontext_t dcontext,
- int reg,
- dc_word_t value
-));
-extern dc_register_state_t dc_auxiliary_register_state _ARGS((
- dc_dcontext_t dcontext,
- int reg
-));
-extern dc_word_t dc_auxiliary_register _ARGS((
- dc_dcontext_t dcontext,
- int reg
-));
-extern void dc_set_auxiliary_register _ARGS((
- dc_dcontext_t dcontext,
- int reg,
- dc_word_t value
-));
-extern dc_register_state_t dc_psr_register_bit_state _ARGS((
- dc_dcontext_t dcontext,
- int bit
-));
-extern dc_word_t dc_psr_register _ARGS((
- dc_dcontext_t dcontext
-));
-extern void dc_set_psr_register _ARGS((
- dc_dcontext_t dcontext,
- dc_word_t mask,
- dc_word_t value
-));
-extern dc_word_t dc_frame_address _ARGS((
- dc_dcontext_t dcontext
-));
-extern dc_kind_t dc_context_kind _ARGS((
- dc_dcontext_t dcontext
-));
-extern dc_register_state_t dc_return_address_state _ARGS((
- dc_dcontext_t dcontext
-));
-extern dc_exactness_t dc_return_address_exactness _ARGS((
- dc_dcontext_t dcontext
-));
-extern dc_word_t dc_return_address _ARGS((
- dc_dcontext_t dcontext
-));
-extern void dc_set_return_address _ARGS((
- dc_dcontext_t dcontext,
- dc_word_t value
-));
-extern void dc_get_exception_info();
-extern void dc_get_protection_info();
-extern void dc_get_special_info();
-extern dc_dcontext_t dc_previous_dcontext _ARGS((
- dc_dcontext_t dcontext
-));
-extern dc_boolean_t dc_location_in_text_chunk _ARGS((
- dc_dcontext_t dcontext,
- dc_word_t value
-));
-
-#endif
diff --git a/gdb/terminal.h b/gdb/terminal.h
deleted file mode 100644
index 4658c7a..0000000
--- a/gdb/terminal.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Terminal interface definitions for GDB, the GNU Debugger.
- Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-/* Define a common set of macros -- BSD based -- and redefine whatever
- the system offers to make it look like that. */
-
-#ifdef HAVE_TERMIO
-
-#include <termio.h>
-
-#undef TIOCGETP
-#define TIOCGETP TCGETA
-#undef TIOCSETN
-#define TIOCSETN TCSETA
-#undef TIOCSETP
-#define TIOCSETP TCSETAF
-#define TERMINAL struct termio
-
-#ifdef NO_JOB_CONTROL
-# undef TIOCGPGRP
-# undef TIOCGPGRP
-#endif
-
-#else /* no termio */
-
-#include <fcntl.h>
-#include <sgtty.h>
-#include <sys/ioctl.h>
-#define TERMINAL struct sgttyb
-
-#endif /* no termio */
-
-extern void new_tty ();
diff --git a/gdb/tm-29k.h b/gdb/tm-29k.h
deleted file mode 100644
index 8e970d0..0000000
--- a/gdb/tm-29k.h
+++ /dev/null
@@ -1,666 +0,0 @@
-/* Parameters for target machine of AMD 29000, for GDB, the GNU debugger.
- Copyright 1990, 1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support. Written by Jim Kingdon.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Parameters for an EB29K (a board which plugs into a PC and is
- accessed through EBMON software running on the PC, which we
- use as we'd use a remote stub (see remote-eb.c).
-
- If gdb is ported to other 29k machines/systems, the
- machine/system-specific parts should be removed from this file (a
- la tm-68k.h). */
-
-/* Byte order is configurable, but this machine runs big-endian. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* Floating point uses IEEE representations. */
-#define IEEE_FLOAT
-
-/* Recognize our magic number. */
-#define BADMAG(x) ((x).f_magic != 0572)
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) \
- { pc = skip_prologue (pc); }
-CORE_ADDR skip_prologue ();
-
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) (read_register (LR0_REGNUM))
-
-/* I'm not sure about the exact value of this, but based on looking
- at the stack pointer when we get to main this seems to be right.
-
- This is the register stack; We call it "CONTROL" in GDB for consistency
- with Pyramid. */
-#define CONTROL_END_ADDR 0x80200000
-
-/* Memory stack. This is for the default register stack size, which is
- only 0x800 bytes. Perhaps we should let the user specify stack sizes
- (and tell EBMON with the "ZS" command). */
-#define STACK_END_ADDR 0x801ff800
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Stack must be aligned on 32-bit word boundaries. */
-#define STACK_ALIGN(ADDR) (((ADDR) + 3) & ~3)
-
-/* Sequence of bytes for breakpoint instruction. */
-/* ASNEQ 0x50, gr1, gr1
- The trap number 0x50 is chosen arbitrarily. */
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
-#define BREAKPOINT {0x72, 0x50, 0x01, 0x01}
-#else /* Target is little-endian. */
-#define BREAKPOINT {0x01, 0x01, 0x50, 0x72}
-#endif /* Target is little-endian. */
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 4
-
-/* Nonzero if instruction at PC is a return instruction.
- On the 29k, this is a "jmpi l0" instruction. */
-
-#define ABOUT_TO_RETURN(pc) \
- ((read_memory_integer (pc, 4) & 0xff0000ff) == 0xc0000080)
-
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Allow the register declarations here to be overridden for remote
- kernel debugging. */
-#if !defined (REGISTER_NAMES)
-
-/* Number of machine registers */
-
-#define NUM_REGS 205
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer.
-
- FIXME, add floating point registers and support here.
-
- Also note that this list does not attempt to deal with kernel
- debugging (in which the first 32 registers are gr64-gr95). */
-
-#define REGISTER_NAMES \
-{"gr96", "gr97", "gr98", "gr99", "gr100", "gr101", "gr102", "gr103", "gr104", \
- "gr105", "gr106", "gr107", "gr108", "gr109", "gr110", "gr111", "gr112", \
- "gr113", "gr114", "gr115", "gr116", "gr117", "gr118", "gr119", "gr120", \
- "gr121", "gr122", "gr123", "gr124", "gr125", "gr126", "gr127", \
- "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", "lr8", "lr9", \
- "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", "lr16", "lr17", "lr18", \
- "lr19", "lr20", "lr21", "lr22", "lr23", "lr24", "lr25", "lr26", "lr27", \
- "lr28", "lr29", "lr30", "lr31", "lr32", "lr33", "lr34", "lr35", "lr36", \
- "lr37", "lr38", "lr39", "lr40", "lr41", "lr42", "lr43", "lr44", "lr45", \
- "lr46", "lr47", "lr48", "lr49", "lr50", "lr51", "lr52", "lr53", "lr54", \
- "lr55", "lr56", "lr57", "lr58", "lr59", "lr60", "lr61", "lr62", "lr63", \
- "lr64", "lr65", "lr66", "lr67", "lr68", "lr69", "lr70", "lr71", "lr72", \
- "lr73", "lr74", "lr75", "lr76", "lr77", "lr78", "lr79", "lr80", "lr81", \
- "lr82", "lr83", "lr84", "lr85", "lr86", "lr87", "lr88", "lr89", "lr90", \
- "lr91", "lr92", "lr93", "lr94", "lr95", "lr96", "lr97", "lr98", "lr99", \
- "lr100", "lr101", "lr102", "lr103", "lr104", "lr105", "lr106", "lr107", \
- "lr108", "lr109", "lr110", "lr111", "lr112", "lr113", "lr114", "lr115", \
- "lr116", "lr117", "lr118", "lr119", "lr120", "lr121", "lr122", "lr123", \
- "lr124", "lr125", "lr126", "lr127", \
- "AI0", "AI1", "AI2", "AI3", "AI4", "AI5", "AI6", "AI7", "AI8", "AI9", \
- "AI10", "AI11", "AI12", "AI13", "AI14", "AI15", "FP", \
- "bp", "fc", "cr", "q", \
- "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \
- "pc0", "pc1", "pc2", "mmu", "lru", "fpe", "int", "fps", "exo", "gr1", \
- "alu", "ipc", "ipa", "ipb" }
-
-/* Convert Processor Special register #x to REGISTER_NAMES register # */
-#define SR_REGNUM(x) \
- ((x) < 15 ? VAB_REGNUM + (x) \
- : (x) >= 128 && (x) < 131 ? IPC_REGNUM + (x) - 128 \
- : (x) == 131 ? Q_REGNUM \
- : (x) == 132 ? ALU_REGNUM \
- : (x) >= 133 && (x) < 136 ? BP_REGNUM + (x) - 133 \
- : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x) - 160 \
- : (x) == 164 ? EXO_REGNUM \
- : (error ("Internal error in SR_REGNUM"), 0))
-#define GR96_REGNUM 0
-/* Define the return register separately, so it can be overridden for
- kernel procedure calling conventions. */
-#define RETURN_REGNUM GR96_REGNUM
-#define GR1_REGNUM 200
-/* This needs to be the memory stack pointer, not the register stack pointer,
- to make call_function work right. */
-#define SP_REGNUM MSP_REGNUM
-#define FP_REGNUM 33 /* lr1 */
-/* Large Return Pointer (gr123). */
-#define LRP_REGNUM (123 - 96 + GR96_REGNUM)
-/* Static link pointer (gr124). */
-#define SLP_REGNUM (124 - 96 + GR96_REGNUM)
-/* Memory Stack Pointer (gr125). */
-#define MSP_REGNUM (125 - 96 + GR96_REGNUM)
-/* Register allocate bound (gr126). */
-#define RAB_REGNUM (126 - 96 + GR96_REGNUM)
-/* Register Free Bound (gr127). */
-#define RFB_REGNUM (127 - 96 + GR96_REGNUM)
-/* Register Stack Pointer. */
-#define RSP_REGNUM GR1_REGNUM
-#define LR0_REGNUM 32
-#define BP_REGNUM 177
-#define FC_REGNUM 178
-#define CR_REGNUM 179
-#define Q_REGNUM 180
-#define VAB_REGNUM 181
-#define OPS_REGNUM (VAB_REGNUM + 1)
-#define CPS_REGNUM (VAB_REGNUM + 2)
-#define CFG_REGNUM (VAB_REGNUM + 3)
-#define CHA_REGNUM (VAB_REGNUM + 4)
-#define CHD_REGNUM (VAB_REGNUM + 5)
-#define CHC_REGNUM (VAB_REGNUM + 6)
-#define RBP_REGNUM (VAB_REGNUM + 7)
-#define TMC_REGNUM (VAB_REGNUM + 8)
-#define TMR_REGNUM (VAB_REGNUM + 9)
-#define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */
-#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */
-#define PC2_REGNUM (VAB_REGNUM + 12)
-#define MMU_REGNUM (VAB_REGNUM + 13)
-#define LRU_REGNUM (VAB_REGNUM + 14)
-#define FPE_REGNUM (VAB_REGNUM + 15)
-#define INT_REGNUM (VAB_REGNUM + 16)
-#define FPS_REGNUM (VAB_REGNUM + 17)
-#define EXO_REGNUM (VAB_REGNUM + 18)
-/* gr1 is defined above as 200 = VAB_REGNUM + 19 */
-#define ALU_REGNUM (VAB_REGNUM + 20)
-#define PS_REGNUM ALU_REGNUM
-#define IPC_REGNUM (VAB_REGNUM + 21)
-#define IPA_REGNUM (VAB_REGNUM + 22)
-#define IPB_REGNUM (VAB_REGNUM + 23)
-
-#endif /* !defined(REGISTER_NAMES) */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (NUM_REGS * 4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-#define REGISTER_BYTE(N) ((N)*4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-/* All regs are 4 bytes. */
-
-#define REGISTER_RAW_SIZE(N) (4)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-/* All regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE (4)
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE (4)
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) (0)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
-{ bcopy ((FROM), (TO), 4); }
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
-{ bcopy ((FROM), (TO), 4); }
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((N) == PC_REGNUM || (N) == LRP_REGNUM || (N) == SLP_REGNUM \
- || (N) == MSP_REGNUM || (N) == RAB_REGNUM || (N) == RFB_REGNUM \
- || (N) == GR1_REGNUM || (N) == FP_REGNUM || (N) == LR0_REGNUM \
- || (N) == NPC_REGNUM || (N) == PC2_REGNUM) \
- ? lookup_pointer_type (builtin_type_void) : builtin_type_int)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-/* On the 29k the LRP points to the part of the structure beyond the first
- 16 words. */
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- write_register (LRP_REGNUM, (ADDR) + 16 * 4);
-
-/* Should call_function allocate stack space for a struct return? */
-/* On the 29k objects over 16 words require the caller to allocate space. */
-#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH (type) > 16 * 4)
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- { \
- int reg_length = TYPE_LENGTH (TYPE); \
- if (reg_length > 16 * 4) \
- { \
- reg_length = 16 * 4; \
- read_memory (*((int *)(REGBUF) + LRP_REGNUM), (VALBUF) + 16 * 4, \
- TYPE_LENGTH (TYPE) - 16 * 4); \
- } \
- bcopy (((int *)(REGBUF))+RETURN_REGNUM, (VALBUF), reg_length); \
- }
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- { \
- int reg_length = TYPE_LENGTH (TYPE); \
- if (reg_length > 16 * 4) \
- { \
- reg_length = 16 * 4; \
- write_memory (read_register (LRP_REGNUM), \
- (char *)(VALBUF) + 16 * 4, \
- TYPE_LENGTH (TYPE) - 16 * 4); \
- } \
- write_register_bytes (REGISTER_BYTE (RETURN_REGNUM), (char *)(VALBUF), \
- TYPE_LENGTH (TYPE)); \
- }
-
-/* The am29k user's guide documents well what the stacks look like.
- But what isn't so clear there is how this interracts with the
- symbols, or with GDB.
- In the following saved_msp, saved memory stack pointer (which functions
- as a memory frame pointer), means either
- a register containing the memory frame pointer or, in the case of
- functions with fixed size memory frames (i.e. those who don't use
- alloca()), the result of the calculation msp + msize.
-
- LOC_ARG, LOC_LOCAL - For GCC, these are relative to saved_msp.
- For high C, these are relative to msp (making alloca impossible).
- LOC_REGISTER, LOC_REGPARM - The register number is the number at the
- time the function is running (after the prologue), or in the case
- of LOC_REGPARM, may be a register number in the range 160-175.
-
- The compilers do things like store an argument into memory, and then put out
- a LOC_ARG for it, or put it into global registers and put out a
- LOC_REGPARM. Thus is it important to execute the first line of
- code (i.e. the line of the open brace, i.e. the prologue) of a function
- before trying to print arguments or anything.
-
- The following diagram attempts to depict what is going on in memory
- (see also the _am29k user's guide_) and also how that interacts with
- GDB frames. We arbitrarily pick fci->frame to point the same place
- as the register stack pointer; since we set it ourself in
- INIT_EXTRA_FRAME_INFO, and access it only through the FRAME_*
- macros, it doesn't really matter exactly how we
- do it. However, note that FRAME_FP is used in two ways in GDB:
- (1) as a "magic cookie" which uniquely identifies frames (even over
- calls to the inferior), (2) (in PC_IN_CALL_DUMMY [ON_STACK])
- as the value of SP_REGNUM before the dummy frame was pushed. These
- two meanings would be incompatible for the 29k if we defined
- CALL_DUMMY_LOCATION == ON_STACK (but we don't, so don't worry about it).
- Also note that "lr1" below, while called a frame pointer
- in the user's guide, has only one function: To determine whether
- registers need to be filled in the function epilogue.
-
- Consider the code:
- < call bar>
- loc1: . . .
- bar: sub gr1,gr1,rsize_b
- . . .
- add mfp,msp,0
- sub msp,msp,msize_b
- . . .
- < call foo >
- loc2: . . .
- foo: sub gr1,gr1,rsize_f
- . . .
- add mfp,msp,0
- sub msp,msp,msize_f
- . . .
- loc3: < suppose the inferior stops here >
-
- memory stack register stack
- | | |____________|
- | | |____loc1____|
- +------->|___________| | | ^
- | | ^ | | locals_b | |
- | | | | |____________| |
- | | | | | | | rsize_b
- | | | msize_b | | args_to_f | |
- | | | | |____________| |
- | | | | |____lr1_____| V
- | | V | |____loc2____|<----------------+
- | +--->|___________|<---------mfp | ^ |
- | | | ^ | | locals_f | | |
- | | | | msize_f | |____________| | |
- | | | | | | | | rsize_f |
- | | | V | | args | | |
- | | |___________|<msp |____________| | |
- | | |_____lr1____| V |
- | | |___garbage__| <- gr1 <----+ |
- | | | |
- | | | |
- | | pc=loc3 | |
- | | | |
- | | | |
- | | frame cache | |
- | | |_________________| | |
- | | |rsize=rsize_b | | |
- | | |msize=msize_b | | |
- +---|--------saved_msp | | |
- | |frame------------------------------------|---+
- | |pc=loc2 | |
- | |_________________| |
- | |rsize=rsize_f | |
- | |msize=msize_f | |
- +--------saved_msp | |
- |frame------------------------------------+
- |pc=loc3 |
- |_________________|
-
- So, is that sufficiently confusing? Welcome to the 29000.
- Notes:
- * The frame for foo uses a memory frame pointer but the frame for
- bar does not. In the latter case the saved_msp is
- computed by adding msize to the saved_msp of the
- next frame.
- * msize is in the frame cache only for high C's sake. */
-
-void read_register_stack ();
-long read_register_stack_integer ();
-
-#define EXTRA_FRAME_INFO \
- CORE_ADDR saved_msp; \
- unsigned int rsize; \
- unsigned int msize;
-
-/* Because INIT_FRAME_PC gets passed fromleaf, that's where we init
- not only ->pc and ->frame, but all the extra stuff, when called from
- get_prev_frame_info, that is. */
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
- init_extra_frame_info(fci);
-void init_extra_frame_info ();
-#define INIT_FRAME_PC(fromleaf, fci) \
- init_frame_pc(fromleaf, fci);
-void init_frame_pc ();
-
-/* FRAME_CHAIN takes a FRAME
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* On the 29k, the nominal address of a frame is the address on the
- register stack of the return address (the one next to the incoming
- arguments, not down at the bottom so nominal address == stack pointer).
-
- GDB expects "nominal address" to equal contents of FP_REGNUM,
- at least when it comes time to create the innermost frame.
- However, that doesn't work for us, so when creating the innermost
- frame we set ->frame ourselves in INIT_EXTRA_FRAME_INFO. */
-
-/* These are mostly dummies for the 29k because INIT_FRAME_PC
- sets prev->frame instead. */
-#define FRAME_CHAIN(thisframe) (0)
-
-/* Not sure how to figure out where the bottom frame is. There is
- no frame for start. In my tests so far the
- pc has been outside the text segment, though, so check for that.
- FIXME!!!
- However, allow a pc in a call dummy. */
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (outside_startup_file (FRAME_SAVED_PC (thisframe)))
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- (FRAMELESS) = frameless_look_for_prologue(FI)
-
-/* Saved pc (i.e. return address). */
-#define FRAME_SAVED_PC(fraim) \
- (read_register_stack_integer ((fraim)->frame + (fraim)->rsize, 4))
-
-/* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their
- offsets being relative to the memory stack pointer (high C) or
- saved_msp (gcc). */
-
-#define FRAME_LOCALS_ADDRESS(fi) frame_locals_address (fi)
-extern CORE_ADDR frame_locals_address ();
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-/* While we could go the effort of finding the tags word and getting
- the argcount field from it,
- (1) It only counts arguments in registers, i.e. the first 16 words
- of arguments
- (2) It gives the number of arguments the function was declared with
- not how many it was called with (or some variation, like all 16
- words for varadic functions). This makes argcount pretty much
- redundant with -g info, even for varadic functions.
- So don't bother. */
-#define FRAME_NUM_ARGS(numargs, fi) ((numargs) = -1)
-
-#define FRAME_ARGS_ADDRESS(fi) FRAME_LOCALS_ADDRESS (fi)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Provide our own get_saved_register. HAVE_REGISTER_WINDOWS is insufficient
- because registers get renumbered on the 29k without getting saved. */
-
-#define GET_SAVED_REGISTER
-
-/* Call function stuff. */
-
-/* The dummy frame looks like this (see also the general frame picture
- above):
-
- register stack
-
- | | frame for function
- | locals_sproc | executing at time
- |________________| of call_function.
- | | We must not disturb
- | args_out_sproc | it.
- memory stack |________________|
- |____lr1_sproc___|
- | | |__retaddr_sproc_| <- gr1 (at start)
- |____________|<-msp 0 <-----------mfp_dummy_____|
- | | (at start) | |
- | arg_slop | | saved regs |
- | (16 words) | | gr96-gr124 |
- |____________|<-msp 1--after | sr128-sr135 |
- | | PUSH_DUMMY_FRAME| |
- | struct ret | |________________|
- | 17+ | | |
- |____________|<- lrp | args_out_dummy |
- | struct ret | | (16 words) |
- | 16 | |________________|
- | (16 words) | |____lr1_dummy___|
- |____________|<- msp 2--after |_retaddr_dummy__|<- gr1 after
- | | struct ret | | PUSH_DUMMY_FRAME
- | margs17+ | area allocated | locals_inf |
- | | |________________| called
- |____________|<- msp 4--when | | function's
- | | inf called | args_out_inf | frame (set up
- | margs16 | |________________| by called
- | (16 words) | |_____lr1_inf____| function).
- |____________|<- msp 3--after | . |
- | | args pushed | . |
- | | | . |
- | |
-
- arg_slop: This area is so that when the call dummy adds 16 words to
- the msp, it won't end up larger than mfp_dummy (it is needed in the
- case where margs and struct_ret do not add up to at least 16 words).
- struct ret: This area is allocated by GDB if the return value is more
- than 16 words. struct ret_16 is not used on the 29k.
- margs: Pushed by GDB. The call dummy copies the first 16 words to
- args_out_dummy.
- retaddr_sproc: Contains the PC at the time we call the function.
- set by PUSH_DUMMY_FRAME and read by POP_FRAME.
- retaddr_dummy: This points to a breakpoint instruction in the dummy. */
-
-/* Rsize for dummy frame, in bytes. */
-
-/* Bytes for outgoing args, lr1, and retaddr. */
-#define DUMMY_ARG (2 * 4 + 16 * 4)
-
-/* Number of special registers (sr128-) to save. */
-#define DUMMY_SAVE_SR128 8
-/* Number of general (gr96- or gr64-) registers to save. */
-#define DUMMY_SAVE_GREGS 29
-
-#define DUMMY_FRAME_RSIZE \
-(4 /* mfp_dummy */ \
- + DUMMY_SAVE_GREGS * 4 \
- + DUMMY_SAVE_SR128 * 4 \
- + DUMMY_ARG \
- )
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME push_dummy_frame();
-extern void push_dummy_frame ();
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-
-#define POP_FRAME pop_frame ();
-extern void pop_frame ();
-
-/* This sequence of words is the instructions
- mtsrim cr, 15
- loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers
- add msp, msp, 16 * 4 ; point to the remaining arguments
- CONST_INSN:
- const gr96,inf
- consth gr96,inf
- calli lr0, gr96
- aseq 0x40,gr1,gr1 ; nop
- asneq 0x50,gr1,gr1 ; breakpoint
- */
-
-/* Position of the "const" instruction within CALL_DUMMY in bytes. */
-#define CONST_INSN (3 * 4)
-#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
-#define CALL_DUMMY {0x0400870f, 0x3600827d, 0x157d7d40, 0x03ff60ff, \
- 0x02ff60ff, 0xc8008060, 0x70400101, 0x72500101}
-#else /* Byte order differs. */
- you lose
-#endif /* Byte order differs. */
-#define CALL_DUMMY_LENGTH (8 * 4)
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-/* Helper macro for FIX_CALL_DUMMY. WORDP is a long * which points to a
- word in target byte order; bits 0-7 and 16-23 of *WORDP are replaced with
- bits 0-7 and 8-15 of DATA (which is in host byte order). */
-
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
-#define STUFF_I16(WORDP, DATA) \
- { \
- *((char *)(WORDP) + 3) = ((DATA) & 0xff);\
- *((char *)(WORDP) + 1) = (((DATA) >> 8) & 0xff);\
- }
-#else /* Target is little endian. */
-#define STUFF_I16(WORDP, DATA) \
- {
- *(char *)(WORDP) = ((DATA) & 0xff);
- *((char *)(WORDP) + 2) = (((DATA) >> 8) & 0xff);
- }
-#endif /* Target is little endian. */
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-/* Currently this stuffs in the address of the function that we are calling.
- If different 29k systems use different breakpoint instructions, it
- could also stuff BREAKPOINT in the right place (to avoid having to
- duplicate CALL_DUMMY in each tm-*.h file). */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
- {\
- STUFF_I16((char *)dummyname + CONST_INSN, fun);\
- STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16);\
- }
-
-/* 29k architecture has separate data & instruction memories -- wired to
- different pins on the chip -- and can't execute the data memory.
- Also, there should be space after text_end;
- we won't get a SIGSEGV or scribble on data space. */
-
-#define CALL_DUMMY_LOCATION AFTER_TEXT_END
-
-/* Because of this, we need (as a kludge) to know the addresses of the
- text section. */
-
-#define NEED_TEXT_START_END
-
-/* How to translate register numbers in the .stab's into gdb's internal register
- numbers. We don't translate them, but we warn if an invalid register
- number is seen. Note that FIXME, we use the value "sym" as an implicit
- argument in printing the error message. It happens to be available where
- this macro is used. (This macro definition appeared in a late revision
- of gdb-3.91.6 and is not well tested. Also, it should be a "complaint".) */
-
-#define STAB_REG_TO_REGNUM(num) \
- (((num) > LR0_REGNUM + 127) \
- ? fprintf(stderr, \
- "Invalid register number %d in symbol table entry for %s\n", \
- (num), SYMBOL_NAME (sym)), (num) \
- : (num))
diff --git a/gdb/tm-3b1.h b/gdb/tm-3b1.h
deleted file mode 100644
index 4bcf01f..0000000
--- a/gdb/tm-3b1.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Parameters for targeting to a 3b1.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Define BPT_VECTOR if it is different than the default.
- This is the vector number used by traps to indicate a breakpoint. */
-
-#define BPT_VECTOR 0x1
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Debugger information will be in COFF format, without long filenames. */
-
-#define COFF_NO_LONG_FILE_NAMES
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR 0x300000
-
-#include "tm-68k.h"
diff --git a/gdb/tm-68k.h b/gdb/tm-68k.h
deleted file mode 100644
index 8464263..0000000
--- a/gdb/tm-68k.h
+++ /dev/null
@@ -1,538 +0,0 @@
-/* Parameters for execution on a 68000 series machine.
- Copyright (C) 1986, 1987, 1989, 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Generic 68000 stuff, to be included by other tm-*.h files.
- Define HAVE_68881 if that is the case. */
-
-#if defined (HAVE_68881)
-#define IEEE_FLOAT 1
-#endif
-
-/* Define the bit, byte, and word ordering of the machine. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#if !defined(SKIP_PROLOGUE)
-#define SKIP_PROLOGUE(ip) {(ip) = m68k_skip_prologue(ip);}
-extern CORE_ADDR m68k_skip_prologue ();
-#endif
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) \
-read_memory_integer (read_register (SP_REGNUM), 4)
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction.
- This is a TRAP instruction. The last 4 bits (0xf below) is the
- vector. Systems which don't use 0xf should define BPT_VECTOR
- themselves before including this file. */
-
-#if !defined (BPT_VECTOR)
-#define BPT_VECTOR 0xf
-#endif
-
-#if !defined (BREAKPOINT)
-#define BREAKPOINT {0x4e, (0x40 | BPT_VECTOR)}
-#endif
-
-/* If your kernel resets the pc after the trap happens you may need to
- define this before including this file. */
-
-#if !defined (DECR_PC_AFTER_BREAK)
-#define DECR_PC_AFTER_BREAK 2
-#endif
-
-/* Nonzero if instruction at PC is a return instruction. */
-/* Allow any of the return instructions, including a trapv and a return
- from interupt. */
-
-#define ABOUT_TO_RETURN(pc) ((read_memory_integer (pc, 2) & ~0x3) == 0x4e74)
-
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
-/* Say how long registers are. */
-
-#define REGISTER_TYPE long
-
-#if defined (HAVE_68881)
-# if defined (GDB_TARGET_IS_SUN3)
- /* Sun3 status includes fpflags, which shows whether the FPU has been used
- by the process, and whether the FPU was done with an instruction or
- was interrupted in the middle of a long instruction. See
- <machine/reg.h>. */
- /* a&d, pc,sr, fp, fpstat, fpflags */
-# define NUM_REGS 31
-# define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4)
-# else /* Not sun3. */
-# define NUM_REGS 29
-# define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4)
-# endif /* Not sun3. */
-#else /* No 68881. */
-# define NUM_REGS 18
-# define REGISTER_BYTES (16*4 + 8)
-#endif /* No 68881. */
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#if defined (HAVE_68881)
-#define REGISTER_BYTE(N) \
- ((N) >= FPC_REGNUM ? (((N) - FPC_REGNUM) * 4) + 168 \
- : (N) >= FP0_REGNUM ? (((N) - FP0_REGNUM) * 12) + 72 \
- : (N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the 68000, all regs are 4 bytes
- except the floating point regs which are 12 bytes. */
-/* Note that the unsigned cast here forces the result of the
- subtraction to very high positive values if N < FP0_REGNUM */
-
-#define REGISTER_RAW_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 8 ? 12 : 4)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the 68000, all regs are 4 bytes
- except the floating point regs which are 8-byte doubles. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 8 ? 8 : 4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 12
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) (((unsigned)(N) - FP0_REGNUM) < 8)
-
-/* Put the declaration out here because if it's in the macros, PCC
- will complain. */
-extern struct ext_format ext_format_68881;
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
-{ \
- if ((REGNUM) >= FP0_REGNUM && (REGNUM) < FPC_REGNUM) \
- ieee_extended_to_double (&ext_format_68881, (FROM), (double *)(TO)); \
- else \
- bcopy ((FROM), (TO), 4); \
-}
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
-{ \
- if ((REGNUM) >= FP0_REGNUM && (REGNUM) < FPC_REGNUM) \
- double_to_ieee_extended (&ext_format_68881, (double *)(FROM), (TO)); \
- else \
- bcopy ((FROM), (TO), 4); \
-}
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-/* Note, for registers which contain addresses return
- pointer to void, not pointer to char, because we don't
- want to attempt to print the string after printing the address. */
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((unsigned)(N) - FP0_REGNUM) < 8 ? builtin_type_double : \
- (N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM ? \
- lookup_pointer_type (builtin_type_void) : builtin_type_int)
-
-#else /* no 68881. */
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the 68000, all regs are 4 bytes. */
-
-#define REGISTER_RAW_SIZE(N) 4
-
-/* Number of bytes of storage in the program's representation
- for register N. On the 68000, all regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) 4
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) bcopy ((FROM), (TO), 4);
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) bcopy ((FROM), (TO), 4);
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
-
-#endif /* No 68881. */
-
-/* Initializer for an array of names of registers.
- Entries beyond the first NUM_REGS are ignored. */
-
-#define REGISTER_NAMES \
- {"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", \
- "a0", "a1", "a2", "a3", "a4", "a5", "fp", "sp", \
- "ps", "pc", \
- "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7", \
- "fpcontrol", "fpstatus", "fpiaddr", "fpcode", "fpflags" }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define A1_REGNUM 9
-#define FP_REGNUM 14 /* Contains address of executing stack frame */
-#define SP_REGNUM 15 /* Contains address of top of stack */
-#define PS_REGNUM 16 /* Contains processor status */
-#define PC_REGNUM 17 /* Contains program counter */
-#if defined (HAVE_68881)
-#define FP0_REGNUM 18 /* Floating point register 0 */
-#define FPC_REGNUM 26 /* 68881 control register */
-#define FPS_REGNUM 27 /* 68881 status register */
-#define FPI_REGNUM 28 /* 68881 iaddr register */
-#endif /* 68881. */
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (A1_REGNUM, (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. This is assuming that floating point values are returned
- as doubles in d0/d1. */
-
-#if !defined (EXTRACT_RETURN_VALUE)
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy ((char *)(REGBUF) + \
- (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)), \
- VALBUF, TYPE_LENGTH(TYPE))
-#endif
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. Assumes floats are passed
- in d0/d1. */
-
-#if !defined (STORE_RETURN_VALUE)
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-#endif
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF))
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the 68000, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's address. */
-
-#define FRAME_CHAIN(thisframe) \
- (outside_startup_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
-
-#if defined (FRAME_CHAIN_VALID_ALTERNATE)
-
-/* Use the alternate method of avoiding running up off the end of
- the frame chain or following frames back into the startup code.
- See the comments in blockframe.c */
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 \
- && !(inside_main_scope ((thisframe)->pc)) \
- && !(inside_entry_scope ((thisframe)->pc)))
-
-#else
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && outside_startup_file (FRAME_SAVED_PC (thisframe)))
-
-#endif /* FRAME_CHAIN_VALID_ALTERNATE */
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- (FRAMELESS) = frameless_look_for_prologue(FI)
-
-#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
-
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Set VAL to the number of args passed to frame described by FI.
- Can set VAL to -1, meaning no way to tell. */
-
-/* We can't tell how many args there are
- now that the C compiler delays popping them. */
-#if !defined (FRAME_NUM_ARGS)
-#define FRAME_NUM_ARGS(val,fi) (val = -1)
-#endif
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#if !defined (FRAME_FIND_SAVED_REGS)
-#if defined (HAVE_68881)
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ register int regnum; \
- register int regmask; \
- register CORE_ADDR next_addr; \
- register CORE_ADDR pc; \
- int nextinsn; \
- bzero (&frame_saved_regs, sizeof frame_saved_regs); \
- if ((frame_info)->pc >= (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM*4 - 8*12 - 4 \
- && (frame_info)->pc <= (frame_info)->frame) \
- { next_addr = (frame_info)->frame; \
- pc = (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 8*12 - 4; }\
- else \
- { pc = get_pc_function_start ((frame_info)->pc); \
- /* Verify we have a link a6 instruction next; \
- if not we lose. If we win, find the address above the saved \
- regs using the amount of storage from the link instruction. */\
- if (044016 == read_memory_integer (pc, 2)) \
- next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 4), pc+=4; \
- else if (047126 == read_memory_integer (pc, 2)) \
- next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 2), pc+=2; \
- else goto lose; \
- /* If have an addal #-n, sp next, adjust next_addr. */ \
- if ((0177777 & read_memory_integer (pc, 2)) == 0157774) \
- next_addr += read_memory_integer (pc += 2, 4), pc += 4; \
- } \
- /* next should be a moveml to (sp) or -(sp) or a movl r,-(sp) */ \
- regmask = read_memory_integer (pc + 2, 2); \
- /* But before that can come an fmovem. Check for it. */ \
- nextinsn = 0xffff & read_memory_integer (pc, 2); \
- if (0xf227 == nextinsn \
- && (regmask & 0xff00) == 0xe000) \
- { pc += 4; /* Regmask's low bit is for register fp7, the first pushed */ \
- for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--, regmask >>= 1) \
- if (regmask & 1) \
- (frame_saved_regs).regs[regnum] = (next_addr -= 12); \
- regmask = read_memory_integer (pc + 2, 2); } \
- if (0044327 == read_memory_integer (pc, 2)) \
- { pc += 4; /* Regmask's low bit is for register 0, the first written */ \
- for (regnum = 0; regnum < 16; regnum++, regmask >>= 1) \
- if (regmask & 1) \
- (frame_saved_regs).regs[regnum] = (next_addr += 4) - 4; } \
- else if (0044347 == read_memory_integer (pc, 2)) \
- { pc += 4; /* Regmask's low bit is for register 15, the first pushed */ \
- for (regnum = 15; regnum >= 0; regnum--, regmask >>= 1) \
- if (regmask & 1) \
- (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \
- else if (0x2f00 == (0xfff0 & read_memory_integer (pc, 2))) \
- { regnum = 0xf & read_memory_integer (pc, 2); pc += 2; \
- (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \
- /* fmovemx to index of sp may follow. */ \
- regmask = read_memory_integer (pc + 2, 2); \
- nextinsn = 0xffff & read_memory_integer (pc, 2); \
- if (0xf236 == nextinsn \
- && (regmask & 0xff00) == 0xf000) \
- { pc += 10; /* Regmask's low bit is for register fp0, the first written */ \
- for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--, regmask >>= 1) \
- if (regmask & 1) \
- (frame_saved_regs).regs[regnum] = (next_addr += 12) - 12; \
- regmask = read_memory_integer (pc + 2, 2); } \
- /* clrw -(sp); movw ccr,-(sp) may follow. */ \
- if (0x426742e7 == read_memory_integer (pc, 4)) \
- (frame_saved_regs).regs[PS_REGNUM] = (next_addr -= 4); \
- lose: ; \
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 8; \
- (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4; \
-}
-#else /* no 68881. */
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ register int regnum; \
- register int regmask; \
- register CORE_ADDR next_addr; \
- register CORE_ADDR pc; \
- bzero (&frame_saved_regs, sizeof frame_saved_regs); \
- if ((frame_info)->pc >= (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM*4 - 4 \
- && (frame_info)->pc <= (frame_info)->frame) \
- { next_addr = (frame_info)->frame; \
- pc = (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4; }\
- else \
- { pc = get_pc_function_start ((frame_info)->pc); \
- /* Verify we have a link a6 instruction next; \
- if not we lose. If we win, find the address above the saved \
- regs using the amount of storage from the link instruction. */\
- if (044016 == read_memory_integer (pc, 2)) \
- next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 4), pc+=4; \
- else if (047126 == read_memory_integer (pc, 2)) \
- next_addr = (frame_info)->frame + read_memory_integer (pc += 2, 2), pc+=2; \
- else goto lose; \
- /* If have an addal #-n, sp next, adjust next_addr. */ \
- if ((0177777 & read_memory_integer (pc, 2)) == 0157774) \
- next_addr += read_memory_integer (pc += 2, 4), pc += 4; \
- } \
- /* next should be a moveml to (sp) or -(sp) or a movl r,-(sp) */ \
- regmask = read_memory_integer (pc + 2, 2); \
- if (0044327 == read_memory_integer (pc, 2)) \
- { pc += 4; /* Regmask's low bit is for register 0, the first written */ \
- for (regnum = 0; regnum < 16; regnum++, regmask >>= 1) \
- if (regmask & 1) \
- (frame_saved_regs).regs[regnum] = (next_addr += 4) - 4; } \
- else if (0044347 == read_memory_integer (pc, 2)) \
- { pc += 4; /* Regmask's low bit is for register 15, the first pushed */ \
- for (regnum = 15; regnum >= 0; regnum--, regmask >>= 1) \
- if (regmask & 1) \
- (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \
- else if (0x2f00 == 0xfff0 & read_memory_integer (pc, 2)) \
- { regnum = 0xf & read_memory_integer (pc, 2); pc += 2; \
- (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \
- /* clrw -(sp); movw ccr,-(sp) may follow. */ \
- if (0x426742e7 == read_memory_integer (pc, 4)) \
- (frame_saved_regs).regs[PS_REGNUM] = (next_addr -= 4); \
- lose: ; \
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 8; \
- (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4; \
-}
-#endif /* no 68881. */
-#endif /* no FIND_FRAME_SAVED_REGS. */
-
-
-/* Things needed for making the inferior call functions.
- It seems like every m68k based machine has almost identical definitions
- in the individual machine's configuration files. Most other cpu types
- (mips, i386, etc) have routines in their *-tdep.c files to handle this
- for most configurations. The m68k family should be able to do this as
- well. These macros can still be overridden when necessary. */
-
-/* The CALL_DUMMY macro is the sequence of instructions, as disassembled
- by gdb itself:
-
- fmovemx fp0-fp7,sp@- 0xf227 0xe0ff
- moveml d0-a5,sp@- 0x48e7 0xfffc
- clrw sp@- 0x4267
- movew ccr,sp@- 0x42e7
-
- /..* The arguments are pushed at this point by GDB;
- no code is needed in the dummy for this.
- The CALL_DUMMY_START_OFFSET gives the position of
- the following jsr instruction. *../
-
- jsr @#0x32323232 0x4eb9 0x3232 0x3232
- addal #0x69696969,sp 0xdffc 0x6969 0x6969
- trap #<your BPT_VECTOR number here> 0x4e4?
- nop 0x4e71
-
- Note this is CALL_DUMMY_LENGTH bytes (28 for the above example).
- We actually start executing at the jsr, since the pushing of the
- registers is done by PUSH_DUMMY_FRAME. If this were real code,
- the arguments for the function called by the jsr would be pushed
- between the moveml and the jsr, and we could allow it to execute through.
- But the arguments have to be pushed by GDB after the PUSH_DUMMY_FRAME is
- done, and we cannot allow the moveml to push the registers again lest
- they be taken for the arguments. */
-
-#if defined (HAVE_68881)
-
-#define CALL_DUMMY {0xf227e0ff, 0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, (0x4e404e71 | (BPT_VECTOR << 16))}
-#define CALL_DUMMY_LENGTH 28 /* Size of CALL_DUMMY */
-#define CALL_DUMMY_START_OFFSET 12 /* Offset to jsr instruction*/
-
-#else
-
-#define CALL_DUMMY {0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, (0x4e404e71 | (BPT_VECTOR << 16))}
-#define CALL_DUMMY_LENGTH 24 /* Size of CALL_DUMMY */
-#define CALL_DUMMY_START_OFFSET 8 /* Offset to jsr instruction*/
-
-#endif /* HAVE_68881 */
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ *(int *)((char *) dummyname + CALL_DUMMY_START_OFFSET + 2) = fun; \
- *(int *)((char *) dummyname + CALL_DUMMY_START_OFFSET + 8) = nargs * 4; }
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME { m68k_push_dummy_frame (); }
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME { m68k_pop_frame (); }
-
diff --git a/gdb/tm-altos.h b/gdb/tm-altos.h
deleted file mode 100644
index f3cc306..0000000
--- a/gdb/tm-altos.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Definitions to make GDB run on an Altos 3068 (m68k running SVR2)
- Copyright (C) 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Define BPT_VECTOR if it is different than the default.
- This is the vector number used by traps to indicate a breakpoint. */
-
-#define BPT_VECTOR 0xe
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#undef NAMES_HAVE_UNDERSCORE
-
-/* COFF files don't have long filenames. */
-
-#define COFF_NO_LONG_FILE_NAMES
-
-/* Address of end of stack space. */
-
-/*#define STACK_END_ADDR (0xffffff)*/
-#define STACK_END_ADDR (0x1000000)
-
-/* Amount PC must be decremented by after a breakpoint.
- On the Altos, the kernel resets the pc to the trap instr */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* The only reason this is here is the tm-altos.h reference below. It
- was moved back here from tm-68k.h. FIXME? */
-
-#define SKIP_PROLOGUE(pc) \
-{ register int op = read_memory_integer (pc, 2); \
- if (op == 0047126) \
- pc += 4; /* Skip link #word */ \
- else if (op == 0044016) \
- pc += 6; /* Skip link #long */ \
- /* Not sure why branches are here. */ \
- /* From tm-isi.h, tm-altos.h */ \
- else if (op == 0060000) \
- pc += 4; /* Skip bra #word */ \
- else if (op == 00600377) \
- pc += 6; /* skip bra #long */ \
- else if ((op & 0177400) == 0060000) \
- pc += 2; /* skip bra #char */ \
-}
-
-#include "tm-68k.h"
diff --git a/gdb/tm-altosgas.h b/gdb/tm-altosgas.h
deleted file mode 100644
index c20030c..0000000
--- a/gdb/tm-altosgas.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Definitions to make GDB run on an Altos 3068 using COFF encapsulation.
- Copyright (C) 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define COFF_ENCAPSULATE
-
-#include "m-altos.h"
-
-#define NAMES_HAVE_UNDERSCORE
diff --git a/gdb/tm-amix.h b/gdb/tm-amix.h
deleted file mode 100644
index 635d3b3..0000000
--- a/gdb/tm-amix.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Macro definitions for GDB on a Commodore Amiga running SVR4 (amix).
- Copyright (C) 1991, Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support (fnf@cygint)
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* All Amiga's (so far) running UNIX have come standard with the floating
- point coprocessor. */
-
-#define HAVE_68881
-
-/* Define BPT_VECTOR if it is different than the default.
- This is the vector number used by traps to indicate a breakpoint. */
-
-#define BPT_VECTOR 0x1
-
-/* How much to decrement the PC after a trap. Depends on kernel. */
-
-#define DECR_PC_AFTER_BREAK 0 /* No decrement required */
-
-/* Address of end of stack space. Actually one byte past it.
- This value is typically very OS dependent.
- FIXME: Check to see if SVR4 offers some machine independent way
- of discovering this value and use it if so, and if we need it. */
-
-/* #define STACK_END_ADDR 0xc0800000 */
-
-/* Use the alternate method of determining valid frame chains. */
-
-#define FRAME_CHAIN_VALID_ALTERNATE
-
-#include "tm-svr4.h"
-#include "tm-68k.h"
diff --git a/gdb/tm-arm.h b/gdb/tm-arm.h
deleted file mode 100644
index 8715195..0000000
--- a/gdb/tm-arm.h
+++ /dev/null
@@ -1,405 +0,0 @@
-/* Definitions to make GDB target for an ARM under RISCiX (4.3bsd).
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
-
-/* IEEE format floating point */
-
-#define IEEE_FLOAT
-
-/* I provide my own xfer_core_file to cope with shared libraries */
-
-#define XFER_CORE_FILE
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) pc = skip_prologue(pc)
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) (read_register (LR_REGNUM) & 0x03fffffc)
-
-/* I don't know the real values for these. */
-#define TARGET_UPAGES UPAGES
-#define TARGET_NBPG NBPG
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR (0x01000000 - (TARGET_UPAGES * TARGET_NBPG))
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0x00,0x00,0x18,0xef} /* BKPT_SWI from <sys/ptrace.h> */
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. */
-
-#define ABOUT_TO_RETURN(pc) \
- ((read_memory_integer(pc, 4) & 0x0fffffff == 0x01b0f00e) || \
- (read_memory_integer(pc, 4) & 0x0ffff800 == 0x09eba800))
-
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes. */
-
-#define INVALID_FLOAT(p, len) 0
-
-/* code to execute to print interesting information about the
- * floating point processor (if any)
- * No need to define if there is nothing to do.
- */
-#define FLOAT_INFO { arm_float_info (); }
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-/* Note: I make a fake copy of the pc in register 25 (calling it ps) so
- that I can clear the status bits from pc (register 15) */
-
-#define NUM_REGS 26
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES \
- { "a1", "a2", "a3", "a4", \
- "v1", "v2", "v3", "v4", "v5", "v6", \
- "sl", "fp", "ip", "sp", "lr", "pc", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "fps", "ps" }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define AP_REGNUM 11
-#define FP_REGNUM 11 /* Contains address of executing stack frame */
-#define SP_REGNUM 13 /* Contains address of top of stack */
-#define LR_REGNUM 14 /* address to return to from a function call */
-#define PC_REGNUM 15 /* Contains program counter */
-#define F0_REGNUM 16 /* first floating point register */
-#define FPS_REGNUM 24 /* floating point status register */
-#define PS_REGNUM 25 /* Contains processor status */
-
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (16*4 + 12*8 + 4 + 4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) (((N) < F0_REGNUM) ? (N)*4 : \
- (((N) < PS_REGNUM) ? 16*4 + ((N) - 16)*12 : \
- 16*4 + 8*12 + ((N) - FPS_REGNUM) * 4))
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the vax, all regs are 4 bytes. */
-
-#define REGISTER_RAW_SIZE(N) (((N) < F0_REGNUM || (N) >= FPS_REGNUM) ? 4 : 12)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the vax, all regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (((N) < F0_REGNUM || (N) >= FPS_REGNUM) ? 4 : 8)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 12
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) ((unsigned)(N) - F0_REGNUM < 8)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- if (REGISTER_CONVERTIBLE(REGNUM)) \
- convert_from_extended((FROM), (TO)); \
- else \
- bcopy ((FROM), (TO), 4);
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- if (REGISTER_CONVERTIBLE(REGNUM)) \
- convert_to_extended((FROM), (TO)); \
- else \
- bcopy ((FROM), (TO), 4);
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((unsigned)(N) - F0_REGNUM) < 8 ? builtin_type_double : builtin_type_int)
-
-/* The system C compiler uses a similar structure return convention to gcc */
-
-#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH (type) > 4)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (0, (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- convert_from_extended(REGBUF + REGISTER_BYTE (F0_REGNUM), VALBUF); \
- else \
- bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) { \
- char _buf[MAX_REGISTER_RAW_SIZE]; \
- convert_to_extended(VALBUF, _buf); \
- write_register_bytes (REGISTER_BYTE (F0_REGNUM), _buf, MAX_REGISTER_RAW_SIZE); \
- } else \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-/* Specify that for the native compiler variables for a particular
- lexical context are listed after the beginning LBRAC instead of
- before in the executables list of symbols. */
-#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (!(gcc_p))
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the ARM, the frame's nominal address is the FP value,
- and 12 bytes before comes the saved previous FP value as a 4-byte word. */
-
-#define FRAME_CHAIN(thisframe) \
- ((thisframe)->pc >= first_object_file_end ? \
- read_memory_integer ((thisframe)->frame - 12, 4) :\
- 0)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (FRAME_SAVED_PC (thisframe) >= first_object_file_end))
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
-{ \
- CORE_ADDR func_start, after_prologue; \
- func_start = (get_pc_function_start ((FI)->pc) + \
- FUNCTION_START_OFFSET); \
- after_prologue = func_start; \
- SKIP_PROLOGUE (after_prologue); \
- (FRAMELESS) = (after_prologue == func_start); \
-}
-
-/* Saved Pc. */
-
-#define FRAME_SAVED_PC(FRAME) \
- (read_memory_integer ((FRAME)->frame - 4, 4) & 0x03fffffc)
-
-#define FRAME_ARGS_ADDRESS(fi) (fi->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ \
- register int regnum; \
- register int frame; \
- register int next_addr; \
- register int return_data_save; \
- register int saved_register_mask; \
- bzero (&frame_saved_regs, sizeof frame_saved_regs); \
- frame = (frame_info)->frame; \
- return_data_save = read_memory_integer(frame, 4) & 0x03fffffc - 12; \
- saved_register_mask = \
- read_memory_integer(return_data_save, 4); \
- next_addr = frame - 12; \
- for (regnum = 4; regnum < 10; regnum++) \
- if (saved_register_mask & (1<<regnum)) { \
- next_addr -= 4; \
- (frame_saved_regs).regs[regnum] = next_addr; \
- } \
- if (read_memory_integer(return_data_save + 4, 4) == 0xed6d7103) { \
- next_addr -= 12; \
- (frame_saved_regs).regs[F0_REGNUM + 7] = next_addr; \
- } \
- if (read_memory_integer(return_data_save + 8, 4) == 0xed6d6103) { \
- next_addr -= 12; \
- (frame_saved_regs).regs[F0_REGNUM + 6] = next_addr; \
- } \
- if (read_memory_integer(return_data_save + 12, 4) == 0xed6d5103) { \
- next_addr -= 12; \
- (frame_saved_regs).regs[F0_REGNUM + 5] = next_addr; \
- } \
- if (read_memory_integer(return_data_save + 16, 4) == 0xed6d4103) { \
- next_addr -= 12; \
- (frame_saved_regs).regs[F0_REGNUM + 4] = next_addr; \
- } \
- (frame_saved_regs).regs[SP_REGNUM] = next_addr; \
- (frame_saved_regs).regs[PC_REGNUM] = frame - 4; \
- (frame_saved_regs).regs[PS_REGNUM] = frame - 4; \
- (frame_saved_regs).regs[FP_REGNUM] = frame - 12; \
-}
-
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ \
- register CORE_ADDR sp = read_register (SP_REGNUM); \
- register int regnum; \
- /* opcode for ldmdb fp,{v1-v6,fp,ip,lr,pc}^ */ \
- sp = push_word(sp, 0xe92dbf0); /* dummy return_data_save ins */ \
- /* push a pointer to the dummy instruction minus 12 */ \
- sp = push_word(sp, read_register (SP_REGNUM) - 16); \
- sp = push_word(sp, read_register (PS_REGNUM)); \
- sp = push_word(sp, read_register (SP_REGNUM)); \
- sp = push_word(sp, read_register (FP_REGNUM)); \
- for (regnum = 9; regnum >= 4; regnum --) \
- sp = push_word(sp, read_register (regnum)); \
- write_register (FP_REGNUM, read_register (SP_REGNUM) - 8); \
- write_register (SP_REGNUM, sp); }
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME \
-{ \
- register CORE_ADDR fp = read_register (FP_REGNUM); \
- register unsigned long return_data_save = \
- read_memory_integer ( (read_memory_integer (fp, 4) & \
- 0x03fffffc) - 12, 4); \
- register int regnum; \
- write_register (PS_REGNUM, read_memory_integer (fp - 4, 4)); \
- write_register (PC_REGNUM, read_register (PS_REGNUM) & 0x03fffffc); \
- write_register (SP_REGNUM, read_memory_integer (fp - 8, 4)); \
- write_register (FP_REGNUM, read_memory_integer (fp - 12, 4)); \
- fp -= 12; \
- for (regnum = 9; regnum >= 4; regnum--) \
- if (return_data_save & (1<<regnum)) { \
- fp -= 4; \
- write_register (regnum, read_memory_integer(fp, 4)); \
- } \
- flush_cached_frames (); \
- set_current_frame (create_new_frame (read_register (FP_REGNUM), \
- read_pc ())); \
-}
-
-/* This sequence of words is the instructions
-
- ldmia sp!,{a1-a4}
- mov lk,pc
- bl *+8
- swi bkpt_swi
-
- Note this is 16 bytes. */
-
-#define CALL_DUMMY {0xe8bd000f, 0xe1a0e00f, 0xeb000000, 0xef180000}
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ \
- register enum type_code code = TYPE_CODE (type); \
- register nargs_in_registers, struct_return = 0; \
- /* fix the load-arguments mask to move the first 4 or less arguments \
- into a1-a4 but make sure the structure return address in a1 is \
- not disturbed if the function is returning a structure */ \
- if ((code == TYPE_CODE_STRUCT || \
- code == TYPE_CODE_UNION || \
- code == TYPE_CODE_ARRAY) && \
- TYPE_LENGTH (type) > 4) { \
- nargs_in_registers = min(nargs + 1, 4); \
- struct_return = 1; \
- } else \
- nargs_in_registers = min(nargs, 4); \
- *(char *) dummyname = (1 << nargs_in_registers) - 1 - struct_return; \
- *(int *)((char *) dummyname + 8) = \
- (((fun - (pc + 16)) / 4) & 0x00ffffff) | 0xeb000000; }
diff --git a/gdb/tm-bigmips.h b/gdb/tm-bigmips.h
deleted file mode 100644
index da13404..0000000
--- a/gdb/tm-bigmips.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-#include "tm-mips.h"
diff --git a/gdb/tm-convex.h b/gdb/tm-convex.h
deleted file mode 100644
index 1ada10b..0000000
--- a/gdb/tm-convex.h
+++ /dev/null
@@ -1,557 +0,0 @@
-/* Definitions to make GDB run on Convex Unix (4bsd)
- Copyright (C) 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* I don't know if this will work for cross-debugging, even if you do get
- the right files. */
-/* Include certain files for dbxread.c */
-#include <convex/filehdr.h>
-#include <convex/opthdr.h>
-#include <convex/scnhdr.h>
-#include <nlist.h>
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* There is come problem with the debugging symbols generated by the
- compiler such that the debugging symbol for the first line of a
- function overlap with the function prologue. */
-#define PROLOGUE_FIRSTLINE_OVERLAP
-
-/* When convex pcc says CHAR or SHORT, it provides the correct address. */
-
-#define BELIEVE_PCC_PROMOTION 1
-
-/* Symbol types to ignore. */
-/* 0xc4 is N_MONPT. Use the numeric value for the benefit of people
- with (rather) old OS's. */
-#define IGNORE_SYMBOL(TYPE) \
- (((TYPE) & ~N_EXT) == N_TBSS \
- || ((TYPE) & ~N_EXT) == N_TDATA \
- || ((TYPE) & ~N_EXT) == 0xc4)
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code.
- Convex prolog is:
- [sub.w #-,sp] in one of 3 possible sizes
- [mov psw,- fc/vc main program prolog
- and #-,- (skip it because the "mov psw" saves the
- mov -,psw] T bit, so continue gets a surprise trap)
- [and #-,sp] fc/vc O2 main program prolog
- [ld.- -(ap),-] pcc/gcc register arg loads
-*/
-
-#define SKIP_PROLOGUE(pc) \
-{ int op, ix; \
- op = read_memory_integer (pc, 2); \
- if ((op & 0xffc7) == 0x5ac0) pc += 2; \
- else if (op == 0x1580) pc += 4; \
- else if (op == 0x15c0) pc += 6; \
- if ((read_memory_integer (pc, 2) & 0xfff8) == 0x7c40 \
- && (read_memory_integer (pc + 2, 2) & 0xfff8) == 0x1240 \
- && (read_memory_integer (pc + 8, 2) & 0xfff8) == 0x7c48) \
- pc += 10; \
- if (read_memory_integer (pc, 2) == 0x1240) pc += 6; \
- for (;;) { \
- op = read_memory_integer (pc, 2); \
- ix = (op >> 3) & 7; \
- if (ix != 6) break; \
- if ((op & 0xfcc0) == 0x3000) pc += 4; \
- else if ((op & 0xfcc0) == 0x3040) pc += 6; \
- else if ((op & 0xfcc0) == 0x2800) pc += 4; \
- else if ((op & 0xfcc0) == 0x2840) pc += 6; \
- else break;}}
-
-/* Immediately after a function call, return the saved pc.
- (ignore frame and return *$sp so we can handle both calls and callq) */
-
-#define SAVED_PC_AFTER_CALL(frame) \
- read_memory_integer (read_register (SP_REGNUM), 4)
-
-/* Address of end of stack space.
- This is ((USRSTACK + 0xfff) & -0x1000)) from <convex/vmparam.h> but
- that expression depends on the kernel version; instead, fetch a
- page-zero pointer and get it from that. This will be invalid if
- they ever change the way bkpt signals are delivered. */
-
-#define STACK_END_ADDR (0xfffff000 & *(unsigned *) 0x80000050)
-
-/* User-mode traps push an extended rtn block,
- then fault with one of the following PCs */
-
-#define is_trace_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000040)) <= 4)
-#define is_arith_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000044)) <= 4)
-#define is_break_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000050)) <= 4)
-
-/* We need to manipulate trap bits in the psw */
-
-#define PSW_TRAP_FLAGS 0x69670000
-#define PSW_T_BIT 0x08000000
-#define PSW_S_BIT 0x01000000
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. (bkpt) */
-
-#define BREAKPOINT {0x7d,0x50}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT but not always.
- (The break PC needs to be decremented by 2, but we do it when the
- break frame is recognized and popped. That way gdb can tell breaks
- from trace traps with certainty.) */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. (rtn or rtnq) */
-
-#define ABOUT_TO_RETURN(pc) \
- ((read_memory_integer (pc, 2) & 0xffe0) == 0x7c80)
-
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p,len) 0
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long long
-
-/* Number of machine registers */
-
-#define NUM_REGS 26
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES {"pc","psw","fp","ap","a5","a4","a3","a2","a1","sp",\
- "s7","s6","s5","s4","s3","s2","s1","s0",\
- "S7","S6","S5","S4","S3","S2","S1","S0"}
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define S0_REGNUM 25 /* the real S regs */
-#define S7_REGNUM 18
-#define s0_REGNUM 17 /* low-order halves of S regs */
-#define s7_REGNUM 10
-#define SP_REGNUM 9 /* A regs */
-#define A1_REGNUM 8
-#define A5_REGNUM 4
-#define AP_REGNUM 3
-#define FP_REGNUM 2 /* Contains address of executing stack frame */
-#define PS_REGNUM 1 /* Contains processor status */
-#define PC_REGNUM 0 /* Contains program counter */
-
-/* convert dbx stab register number (from `r' declaration) to a gdb REGNUM */
-
-#define STAB_REG_TO_REGNUM(value) \
- ((value) < 8 ? S0_REGNUM - (value) : SP_REGNUM - ((value) - 8))
-
-/* Vector register numbers, not handled as ordinary regs.
- They are treated as convenience variables whose values are read
- from the inferior when needed. */
-
-#define V0_REGNUM 0
-#define V7_REGNUM 7
-#define VM_REGNUM 8
-#define VS_REGNUM 9
-#define VL_REGNUM 10
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (4*10 + 8*8)
-
-/* Index within `registers' of the first byte of the space for
- register N.
- NB: must match structure of struct syscall_context for correct operation */
-
-#define REGISTER_BYTE(N) ((N) < s7_REGNUM ? 4*(N) : \
- (N) < S7_REGNUM ? 44 + 8 * ((N)-s7_REGNUM) : \
- 40 + 8 * ((N)-S7_REGNUM))
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-#define REGISTER_RAW_SIZE(N) ((N) < S7_REGNUM ? 4 : 8)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM));
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM));
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) < S7_REGNUM ? builtin_type_int : builtin_type_long_long)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (A1_REGNUM, (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (&((char *) REGBUF) [REGISTER_BYTE (S0_REGNUM) + \
- 8 - TYPE_LENGTH (TYPE)],\
- VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (REGISTER_BYTE (S0_REGNUM), VALBUF, 8)
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- (*(int *) & ((char *) REGBUF) [REGISTER_BYTE (s0_REGNUM)])
-
-/* Define trapped internal variable hooks to read and write
- vector and communication registers. */
-
-#define IS_TRAPPED_INTERNALVAR is_trapped_internalvar
-#define VALUE_OF_TRAPPED_INTERNALVAR value_of_trapped_internalvar
-#define SET_TRAPPED_INTERNALVAR set_trapped_internalvar
-
-extern struct value *value_of_trapped_internalvar ();
-
-/* Hooks to read data from soff exec and core files,
- and to describe the files. */
-
-#define XFER_CORE_FILE
-#define FILES_INFO_HOOK print_maps
-
-/* Hook to call to print a typeless integer value, normally printed in decimal.
- For convex, use hex instead if the number looks like an address. */
-
-#define PRINT_TYPELESS_INTEGER decout
-
-/* For the native compiler, variables for a particular lexical context
- are listed after the beginning LBRAC instead of before in the
- executables list of symbols. Using "gcc_compiled." to distinguish
- between GCC and native compiler doesn't work on Convex because the
- linker sorts the symbols to put "gcc_compiled." in the wrong place.
- desc is nonzero for native, zero for gcc. */
-#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (desc != 0)
-
-/* Pcc occaisionally puts an SO where there should be an SOL. */
-#define PCC_SOL_BROKEN
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame_info with a frame's nominal address in fi->frame,
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* (caller fp is saved at 8(fp)) */
-
-#define FRAME_CHAIN(fi) (read_memory_integer ((fi)->frame + 8, 4))
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-/* We need the boundaries of the text in the exec file, as a kludge,
- for FRAMELESS_FUNCTION_INVOCATION and CALL_DUMMY_LOCATION. */
-
-#define NEED_TEXT_START_END
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0.
- On convex, check at the return address for `callq' -- if so, frameless,
- otherwise, not. */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
-{ \
- extern CORE_ADDR text_start, text_end; \
- CORE_ADDR call_addr = SAVED_PC_AFTER_CALL (FI); \
- (FRAMELESS) = (call_addr >= text_start && call_addr < text_end \
- && read_memory_integer (call_addr - 6, 1) == 0x22); \
-}
-
-#define FRAME_SAVED_PC(fi) (read_memory_integer ((fi)->frame, 4))
-
-#define FRAME_ARGS_ADDRESS(fi) (read_memory_integer ((fi)->frame + 12, 4))
-
-#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(numargs, fi) \
-{ numargs = read_memory_integer (FRAME_ARGS_ADDRESS (fi) - 4, 4); \
- if (numargs < 0 || numargs >= 256) numargs = -1;}
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-/* Normal (short) frames save only PC, FP, (callee's) AP. To reasonably
- handle gcc and pcc register variables, scan the code following the
- call for the instructions the compiler inserts to reload register
- variables from stack slots and record the stack slots as the saved
- locations of those registers. This will occasionally identify some
- random load as a saved register; this is harmless. vc does not
- declare its register allocation actions in the stabs. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ register int regnum; \
- register int frame_length = /* 3 short, 2 long, 1 extended, 0 context */\
- (read_memory_integer ((frame_info)->frame + 4, 4) >> 25) & 3; \
- register CORE_ADDR frame_fp = \
- read_memory_integer ((frame_info)->frame + 8, 4); \
- register CORE_ADDR next_addr; \
- bzero (&frame_saved_regs, sizeof frame_saved_regs); \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 0; \
- (frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4; \
- (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 8; \
- (frame_saved_regs).regs[AP_REGNUM] = frame_fp + 12; \
- next_addr = (frame_info)->frame + 12; \
- if (frame_length < 3) \
- for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \
- (frame_saved_regs).regs[regnum] = (next_addr += 4); \
- if (frame_length < 2) \
- (frame_saved_regs).regs[SP_REGNUM] = (next_addr += 4); \
- next_addr -= 4; \
- if (frame_length < 3) \
- for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) \
- (frame_saved_regs).regs[regnum] = (next_addr += 8); \
- if (frame_length < 2) \
- (frame_saved_regs).regs[S0_REGNUM] = (next_addr += 8); \
- else \
- (frame_saved_regs).regs[SP_REGNUM] = next_addr + 8; \
- if (frame_length == 3) { \
- CORE_ADDR pc = read_memory_integer ((frame_info)->frame, 4); \
- int op, ix, disp; \
- op = read_memory_integer (pc, 2); \
- if ((op & 0xffc7) == 0x1480) pc += 4; /* add.w #-,sp */ \
- else if ((op & 0xffc7) == 0x58c0) pc += 2; /* add.w #-,sp */ \
- op = read_memory_integer (pc, 2); \
- if ((op & 0xffc7) == 0x2a06) pc += 4; /* ld.w -,ap */ \
- for (;;) { \
- op = read_memory_integer (pc, 2); \
- ix = (op >> 3) & 7; \
- if ((op & 0xfcc0) == 0x2800) { /* ld.- -,ak */ \
- regnum = SP_REGNUM - (op & 7); \
- disp = read_memory_integer (pc + 2, 2); \
- pc += 4;} \
- else if ((op & 0xfcc0) == 0x2840) { /* ld.- -,ak */ \
- regnum = SP_REGNUM - (op & 7); \
- disp = read_memory_integer (pc + 2, 4); \
- pc += 6;} \
- if ((op & 0xfcc0) == 0x3000) { /* ld.- -,sk */ \
- regnum = S0_REGNUM - (op & 7); \
- disp = read_memory_integer (pc + 2, 2); \
- pc += 4;} \
- else if ((op & 0xfcc0) == 0x3040) { /* ld.- -,sk */ \
- regnum = S0_REGNUM - (op & 7); \
- disp = read_memory_integer (pc + 2, 4); \
- pc += 6;} \
- else if ((op & 0xff00) == 0x7100) { /* br crossjump */ \
- pc += 2 * (char) op; \
- continue;} \
- else if (op == 0x0140) { /* jmp crossjump */ \
- pc = read_memory_integer (pc + 2, 4); \
- continue;} \
- else break; \
- if ((frame_saved_regs).regs[regnum]) \
- break; \
- if (ix == 7) disp += frame_fp; \
- else if (ix == 6) disp += read_memory_integer (frame_fp + 12, 4); \
- else if (ix != 0) break; \
- (frame_saved_regs).regs[regnum] = \
- disp - 8 + (1 << ((op >> 8) & 3)); \
- if (regnum >= S7_REGNUM) \
- (frame_saved_regs).regs[regnum - S0_REGNUM + s0_REGNUM] = \
- disp - 4 + (1 << ((op >> 8) & 3)); \
- } \
- } \
-}
-
-/* Things needed for making the inferior call functions. */
-
-#define CALL_DUMMY_LOCATION BEFORE_TEXT_END
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ register CORE_ADDR sp = read_register (SP_REGNUM); \
- register int regnum; \
- char buf[8]; \
- long word; \
- for (regnum = S0_REGNUM; regnum >= S7_REGNUM; --regnum) { \
- read_register_bytes (REGISTER_BYTE (regnum), buf, 8); \
- sp = push_bytes (sp, buf, 8);} \
- for (regnum = SP_REGNUM; regnum >= FP_REGNUM; --regnum) { \
- word = read_register (regnum); \
- sp = push_bytes (sp, &word, 4);} \
- word = (read_register (PS_REGNUM) &~ (3<<25)) | (1<<25); \
- sp = push_bytes (sp, &word, 4); \
- word = read_register (PC_REGNUM); \
- sp = push_bytes (sp, &word, 4); \
- write_register (SP_REGNUM, sp); \
- write_register (FP_REGNUM, sp); \
- write_register (AP_REGNUM, sp);}
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME do {\
- register CORE_ADDR fp = read_register (FP_REGNUM); \
- register int regnum; \
- register int frame_length = /* 3 short, 2 long, 1 extended, 0 context */ \
- (read_memory_integer (fp + 4, 4) >> 25) & 3; \
- char buf[8]; \
- write_register (PC_REGNUM, read_memory_integer (fp, 4)); \
- write_register (PS_REGNUM, read_memory_integer (fp += 4, 4)); \
- write_register (FP_REGNUM, read_memory_integer (fp += 4, 4)); \
- write_register (AP_REGNUM, read_memory_integer (fp += 4, 4)); \
- if (frame_length < 3) \
- for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \
- write_register (regnum, read_memory_integer (fp += 4, 4)); \
- if (frame_length < 2) \
- write_register (SP_REGNUM, read_memory_integer (fp += 4, 4)); \
- fp -= 4; \
- if (frame_length < 3) \
- for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) { \
- read_memory (fp += 8, buf, 8); \
- write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \
- if (frame_length < 2) { \
- read_memory (fp += 8, buf, 8); \
- write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \
- else write_register (SP_REGNUM, fp + 8); \
- flush_cached_frames (); \
- set_current_frame (create_new_frame (read_register (FP_REGNUM), \
- read_pc ())); \
-} while (0)
-
-/* This sequence of words is the instructions
- mov sp,ap
- pshea 69696969
- calls 32323232
- bkpt
- Note this is 16 bytes. */
-
-#define CALL_DUMMY {0x50860d4069696969LL,0x2140323232327d50LL}
-
-#define CALL_DUMMY_LENGTH 16
-
-#define CALL_DUMMY_START_OFFSET 0
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ *(int *)((char *) dummyname + 4) = nargs; \
- *(int *)((char *) dummyname + 10) = fun; }
-
-/* Defs to read soff symbol tables, see dbxread.c */
-
-#define NUMBER_OF_SYMBOLS ((long) opthdr.o_nsyms)
-#define STRING_TABLE_OFFSET ((long) filehdr.h_strptr)
-#define SYMBOL_TABLE_OFFSET ((long) opthdr.o_symptr)
-#define STRING_TABLE_SIZE ((long) filehdr.h_strsiz)
-#define SIZE_OF_TEXT_SEGMENT ((long) txthdr.s_size)
-#define ENTRY_POINT ((long) opthdr.o_entry)
-
-#define READ_STRING_TABLE_SIZE(BUFFER) \
- (BUFFER = STRING_TABLE_SIZE)
-
-#define DECLARE_FILE_HEADERS \
- FILEHDR filehdr; \
- OPTHDR opthdr; \
- SCNHDR txthdr
-
-#define READ_FILE_HEADERS(DESC,NAME) \
-{ \
- int n; \
- val = myread (DESC, &filehdr, sizeof filehdr); \
- if (val < 0) \
- perror_with_name (NAME); \
- if (! IS_SOFF_MAGIC (filehdr.h_magic)) \
- error ("%s: not an executable file.", NAME); \
- lseek (DESC, 0L, 0); \
- if (myread (DESC, &filehdr, sizeof filehdr) < 0) \
- perror_with_name (NAME); \
- if (myread (DESC, &opthdr, filehdr.h_opthdr) <= 0) \
- perror_with_name (NAME); \
- for (n = 0; n < filehdr.h_nscns; n++) \
- { \
- if (myread (DESC, &txthdr, sizeof txthdr) < 0) \
- perror_with_name (NAME); \
- if ((txthdr.s_flags & S_TYPMASK) == S_TEXT) \
- break; \
- } \
-}
diff --git a/gdb/tm-delta88.h b/gdb/tm-delta88.h
deleted file mode 100644
index 7474b3e..0000000
--- a/gdb/tm-delta88.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Target machine description for Motorola Delta 88 box, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "tm-m88k.h"
-
-/* BCS is a standard for binary compatibility. This machine uses it. */
-#if !defined (BCS)
-#define BCS 1
-#endif
-
-#define DELTA88
diff --git a/gdb/tm-hp300bsd.h b/gdb/tm-hp300bsd.h
deleted file mode 100644
index 4edcbd3..0000000
--- a/gdb/tm-hp300bsd.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Parameters for target machine Hewlett-Packard 9000/300, running bsd.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * Configuration file for HP9000/300 series machine running
- * University of Utah's 4.3bsd port. This is NOT for HP-UX.
- * Problems to hpbsd-bugs@cs.utah.edu
- */
-
-#define HAVE_68881
-
-/* Define BPT_VECTOR if it is different than the default.
- This is the vector number used by traps to indicate a breakpoint. */
-
-#define BPT_VECTOR 0x2
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-#define TARGET_NBPG 4096
-#define TARGET_UPAGES 3
-
-/* On the HP300, sigtramp is in the u area. Gak! User struct is not
- mapped to the same virtual address in user/kernel address space
- (hence STACK_END_ADDR as opposed to KERNEL_U_ADDR). This tests
- for the whole u area, since we don't necessarily have hp300bsd
- include files around. */
-#define IN_SIGTRAMP(pc, name) \
- ((pc) >= STACK_END_ADDR \
- && (pc) < STACK_END_ADDR + TARGET_UPAGES * TARGET_NBPG \
- )
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR 0xfff00000
-
-#include "tm-68k.h"
diff --git a/gdb/tm-hp300hpux.h b/gdb/tm-hp300hpux.h
deleted file mode 100644
index f1926a1..0000000
--- a/gdb/tm-hp300hpux.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Parameters for execution on an HP 9000 model 320, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include HAVE_68881
-
-/* Define BPT_VECTOR if it is different than the default.
- This is the vector number used by traps to indicate a breakpoint. */
-
-#define BPT_VECTOR 0x1
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR 0xFFF00000
-
-#include "tm-68k.h"
diff --git a/gdb/tm-i386v-g.h b/gdb/tm-i386v-g.h
deleted file mode 100644
index 669284a..0000000
--- a/gdb/tm-i386v-g.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Macro definitions for i386 using the GNU object file format.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu)
- * July 1988
- *
- * i386gnu: COFF_ENCAPSULATE
- */
-
-
-#define COFF_ENCAPSULATE
-
-#include "tm-i386v.h"
-
-#define NAMES_HAVE_UNDERSCORE
diff --git a/gdb/tm-i386v.h b/gdb/tm-i386v.h
deleted file mode 100644
index 409cc53..0000000
--- a/gdb/tm-i386v.h
+++ /dev/null
@@ -1,299 +0,0 @@
-/* Macro defintions for i386.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu)
- * July 1988
- */
-
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
-
-/* define this if you don't have the extension to coff that allows
- * file names to appear in the string table
- * (aux.x_file.x_foff)
- */
-#define COFF_NO_LONG_FILE_NAMES
-
-/* turn this on when rest of gdb is ready */
-#define IEEE_FLOAT
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-/* #define NAMES_HAVE_UNDERSCORE */
-
-/* number of traps that happen between exec'ing the shell
- * to run an inferior, and when we finally get to
- * the inferior code. This is 2 on most implementations.
- */
-#define START_INFERIOR_TRAPS_EXPECTED 4
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) \
- (read_memory_integer (read_register (SP_REGNUM), 4))
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR 0x80000000
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0xcc}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 1
-
-/* Nonzero if instruction at PC is a return instruction. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc3)
-
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes -- not relevant on the 386. */
-
-#define INVALID_FLOAT(p, len) (0)
-
-#if 0
-/* code to execute to print interesting information about the
- floating point processor (if any)
- No need to define if there is nothing to do.
- On the 386, unfortunately this code is host-dependent (and lives
- in the i386-xdep.c file), so we can't
- do this unless we *know* we aren't cross-debugging. FIXME.
- */
-#define FLOAT_INFO { i386_float_info (); }
-#endif /*0*/
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 16
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-/* the order of the first 8 registers must match the compiler's
- * numbering scheme (which is the same as the 386 scheme)
- * also, this table must match regmap in i386-pinsn.c.
- */
-#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
- "esp", "ebp", "esi", "edi", \
- "eip", "ps", "cs", "ss", \
- "ds", "es", "fs", "gs", \
- }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define FP_REGNUM 5 /* Contains address of executing stack frame */
-#define SP_REGNUM 4 /* Contains address of top of stack */
-
-#define PC_REGNUM 8
-#define PS_REGNUM 9
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (NUM_REGS * 4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N)*4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-#define REGISTER_RAW_SIZE(N) (4)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) (0)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) {bcopy ((FROM), (TO), 4);}
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) {bcopy ((FROM), (TO), 4);}
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-/* Perhaps si and di should go here, but potentially they could be
- used for things other than address. */
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM ? \
- lookup_pointer_type (builtin_type_void) : builtin_type_int)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { (SP) -= sizeof (ADDR); \
- write_memory ((SP), &(ADDR), sizeof (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-#define FRAME_CHAIN(thisframe) \
- (outside_startup_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- (FRAMELESS) = frameless_look_for_prologue(FI)
-
-#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
-
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
-
-
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); }
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME { i386_pop_frame (); }
-
-/* this is
- * call 11223344 (32 bit relative)
- * int3
- */
-
-#define CALL_DUMMY { 0x223344e8, 0xcc11 }
-
-#define CALL_DUMMY_LENGTH 8
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ \
- int from, to, delta, loc; \
- loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
- from = loc + 5; \
- to = (int)(fun); \
- delta = to - from; \
- *((char *)(dummyname) + 1) = (delta & 0xff); \
- *((char *)(dummyname) + 2) = ((delta >> 8) & 0xff); \
- *((char *)(dummyname) + 3) = ((delta >> 16) & 0xff); \
- *((char *)(dummyname) + 4) = ((delta >> 24) & 0xff); \
-}
diff --git a/gdb/tm-i960.h b/gdb/tm-i960.h
deleted file mode 100644
index 7dba1de..0000000
--- a/gdb/tm-i960.h
+++ /dev/null
@@ -1,394 +0,0 @@
-/* Parameters for target machine Intel 960, for GDB, the GNU debugger.
- Copyright (C) 1990-1991 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Definitions to target GDB to any i960. */
-
-#ifndef I80960
-#define I80960
-#endif
-
-/* Hook for the SYMBOL_CLASS of a parameter when decoding DBX symbol
- information. In the i960, parameters can be stored as locals or as
- args, depending on the type of the debug record.
-
- From empirical observation, gcc960 uses N_LSYM to indicate
- arguments passed in registers and then copied immediately
- to the frame, and N_PSYM to indicate arguments passed in a
- g14-relative argument block. */
-
-#define DBX_PARM_SYMBOL_CLASS(type) ((type == N_LSYM)? LOC_LOCAL_ARG: LOC_ARG)
-
-/* Byte order is configurable, but this machine runs little-endian. */
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
-
-/* We have IEEE floating point, if we have any float at all. */
-
-#define IEEE_FLOAT
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance ip across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(ip) { ip = skip_prologue (ip); }
-extern CORE_ADDR skip_prologue ();
-
-/* Immediately after a function call, return the saved ip.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function
- executes some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) (saved_pc_after_call (frame))
-extern CORE_ADDR saved_pc_after_call ();
-
-/* Stack grows upward */
-
-#define INNER_THAN >
-
-/* Nonzero if instruction at ip is a return instruction. */
-
-#define ABOUT_TO_RETURN(ip) (read_memory_integer(ip,4) == 0x0a000000)
-
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes. */
-
-#define INVALID_FLOAT(p, len) (0)
-
-/* How long (ordinary) registers are */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-#define NUM_REGS 40
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES { \
- /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \
- /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\
- /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
- /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \
- /* 32 */ "pc", "ac", "ip", "tc", "fp0", "fp1", "fp2", "fp3", \
-}
-
-/* Register numbers of various important registers (used to index
- into arrays of register names and register values). */
-
-#define R0_REGNUM 0 /* First local register */
-#define SP_REGNUM 1 /* Contains address of top of stack */
-#define RIP_REGNUM 2 /* Return instruction pointer (local r2) */
-#define R15_REGNUM 15 /* Last local register */
-#define G0_REGNUM 16 /* First global register */
-#define G13_REGNUM 29 /* g13 - holds struct return address */
-#define G14_REGNUM 30 /* g14 - ptr to arg block / leafproc return address */
-#define FP_REGNUM 31 /* Contains address of executing stack frame */
-#define PCW_REGNUM 32 /* process control word */
-#define ACW_REGNUM 33 /* arithmetic control word */
-#define IP_REGNUM 34 /* instruction pointer */
-#define TCW_REGNUM 35 /* trace control word */
-#define FP0_REGNUM 36 /* First floating point register */
-
-/* Some registers have more than one name */
-
-#define PC_REGNUM IP_REGNUM /* GDB refers to ip as the Program Counter */
-#define PFP_REGNUM R0_REGNUM /* Previous frame pointer */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES ((36*4) + (4*10))
-
-/* Index within `registers' of the first byte of the space for register N. */
-
-#define REGISTER_BYTE(N) ( (N) < FP0_REGNUM ? \
- (4*(N)) : ((10*(N)) - (6*FP0_REGNUM)) )
-
-/* The i960 has register windows, sort of. */
-
-#define HAVE_REGISTER_WINDOWS
-
-/* Is this register part of the register window system? A yes answer
- implies that 1) The name of this register will not be the same in
- other frames, and 2) This register is automatically "saved" upon
- subroutine calls and thus there is no need to search more than one
- stack frame for it.
-
- On the i960, in fact, the name of this register in another frame is
- "mud" -- there is no overlap between the windows. Each window is
- simply saved into the stack (true for our purposes, after having been
- flushed; normally they reside on-chip and are restored from on-chip
- without ever going to memory). */
-
-#define REGISTER_IN_WINDOW_P(regnum) ((regnum) <= R15_REGNUM)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the i960, all regs are 4 bytes except for floating
- point, which are 10. NINDY only sends us 8 byte values for these,
- which is a pain, but VxWorks handles this correctly, so we must. */
-
-#define REGISTER_RAW_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 10 )
-
-/* Number of bytes of storage in the program's representation for register N. */
-
-#define REGISTER_VIRTUAL_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 8 )
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 10
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion from raw format to virtual
- format. */
-
-#define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
-{ \
- extern struct ext_format ext_format_i960; \
- \
- if ((REGNUM) >= FP0_REGNUM) \
- ieee_extended_to_double (&ext_format_i960, (FROM), (double *)(TO)); \
- else \
- bcopy ((FROM), (TO), 4); \
-}
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
-{ \
- extern struct ext_format ext_format_i960; \
- \
- if ((REGNUM) >= FP0_REGNUM) \
- double_to_ieee_extended (&ext_format_i960, (double *)(FROM), (TO)); \
- else \
- bcopy ((FROM), (TO), 4); \
-}
-
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) ((N) < FP0_REGNUM ? \
- builtin_type_int : builtin_type_double)
-
-/* Macros for understanding function return values... */
-
-/* Does the specified function use the "struct returning" convention
- or the "value returning" convention? The "value returning" convention
- almost invariably returns the entire value in registers. The
- "struct returning" convention often returns the entire value in
- memory, and passes a pointer (out of or into the function) saying
- where the value (is or should go).
-
- Since this sometimes depends on whether it was compiled with GCC,
- this is also an argument. This is used in call_function to build a
- stack, and in value_being_returned to print return values.
-
- On i960, a structure is returned in registers g0-g3, if it will fit.
- If it's more than 16 bytes long, g13 pointed to it on entry. */
-
-#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH (type) > 16)
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. This is only called if USE_STRUCT_CONVENTION for this
- type is 0.
-
- On the i960 we just take as many bytes as we need from G0 through G3. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy(REGBUF+REGISTER_BYTE(G0_REGNUM), VALBUF, TYPE_LENGTH (TYPE))
-
-/* If USE_STRUCT_CONVENTION produces a 1,
- extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one).
-
- Address of where to put structure was passed in in global
- register g13 on entry. God knows what's in g13 now. The
- (..., 0) below is to make it appear to return a value, though
- actually all it does is call error(). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- (error("Don't know where large structure is returned on i960"), 0)
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format, for "value returning" functions.
-
- For 'return' command: not (yet) implemented for i960. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- error ("Returning values from functions is not implemented in i960 gdb")
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- error ("Returning values from functions is not implemented in i960 gdb")
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* We cache information about saved registers in the frame structure,
- to save us from having to re-scan function prologues every time
- a register in a non-current frame is accessed. */
-
-#define EXTRA_FRAME_INFO \
- struct frame_saved_regs *fsr; \
- CORE_ADDR arg_pointer;
-
-/* Zero the frame_saved_regs pointer when the frame is initialized,
- so that FRAME_FIND_SAVED_REGS () will know to allocate and
- initialize a frame_saved_regs struct the first time it is called.
- Set the arg_pointer to -1, which is not valid; 0 and other values
- indicate real, cached values. */
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
- ((fi)->fsr = 0, (fi)->arg_pointer = -1)
-
-/* On the i960, we get the chain pointer by reading the PFP saved
- on the stack and clearing the status bits. */
-
-#define FRAME_CHAIN(thisframe) \
- (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf)
-
-/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
- and has no caller.
-
- On the i960, each various target system type must define FRAME_CHAIN_VALID,
- since it differs between NINDY and VxWorks, the two currently supported
- targets types. We leave it undefined here. */
-
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- { (FRAMELESS) = (leafproc_return ((FI)->pc) != 0); }
-
-/* Note that in the i960 architecture the return pointer is saved in the
- *caller's* stack frame.
-
- Make sure to zero low-order bits because of bug in 960CA A-step part
- (instruction addresses should always be word-aligned anyway). */
-
-#define FRAME_SAVED_PC(frame) \
- ((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3)
-
-/* On the i960, FRAME_ARGS_ADDRESS should return the value of
- g14 as passed into the frame, if known. We need a function for this.
- We cache this value in the frame info if we've already looked it up. */
-
-#define FRAME_ARGS_ADDRESS(fi) \
- (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0))
-extern CORE_ADDR frame_args_address (); /* i960-tdep.c */
-
-/* This is the same except it should return 0 when
- it does not really know where the args are, rather than guessing.
- This value is not cached since it is only used infrequently. */
-
-#define FRAME_ARGS_ADDRESS_CORRECT(fi) (frame_args_address (fi, 1))
-
-#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
-
-/* Set NUMARGS to the number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Produce the positions of the saved registers in a stack frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \
- frame_find_saved_regs (frame_info_addr, &sr)
-extern void frame_find_saved_regs(); /* See i960-tdep.c */
-
-
-/* Print status when we get a random unexpected signal. We have more
- kinds of signals than Unix does... */
-
-#define PRINT_RANDOM_SIGNAL(stop_signal) print_fault (stop_signal)
-
-/* Things needed for making calls to functions in the inferior process */
-
-/* Push an empty stack frame, to record the current ip, etc.
-
- Not (yet?) implemented for i960. */
-
-#define PUSH_DUMMY_FRAME \
-error("Function calls into the inferior process are not supported on the i960")
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME \
- pop_frame ()
-
-
-/* This sequence of words is the instructions
-
- callx 0x00000000
- fmark
- */
-
-/* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */
-
-/* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */
-
-/* Indicate that we don't support calling inferior child functions. */
-
-#undef CALL_DUMMY
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at 'dummyname'.
-
- Ignore arg count on i960. */
-
-/* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */
-
-#undef FIX_CALL_DUMMY
-
-
-/* Interface definitions for kernel debugger KDB */
-/* (Not relevant to i960.) */
diff --git a/gdb/tm-irix3.h b/gdb/tm-irix3.h
deleted file mode 100644
index f62a39e..0000000
--- a/gdb/tm-irix3.h
+++ /dev/null
@@ -1,325 +0,0 @@
-/* Target machine description for SGI Iris under Irix, for GDB.
- Copyright 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* Floating point is IEEE compliant */
-#define IEEE_FLOAT
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-/*#define NAMES_HAVE_UNDERSCORE*/
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) pc = mips_skip_prologue(pc)
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) read_register(RA_REGNUM)
-
-/* Are we currently handling a signal */
-
-#define IN_SIGTRAMP(pc, name) in_sigtramp(pc, name)
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR (0x7ffff000)
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-#define BREAKPOINT {0, 0x5, 0, 0xd}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. "j ra" on mips. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 4) == 0x3e00008)
-
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p,l) isa_NAN(p,l)
-
-/* Say how long (all) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 71
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES \
- { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \
- "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \
- "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
- "t8", "t9", "k0", "k1", "gp", "sp", "fp", "ra", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\
- "pc", "cause", "bad", "hi", "lo", "fsr", "fir" \
- }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define SP_REGNUM 29 /* Contains address of top of stack */
-#define FP_REGNUM 30 /* Pseudo register that contains true address of executing stack frame */
-#define RA_REGNUM 31 /* Contains return address value */
-#define FP0_REGNUM 32 /* Floating point register 0 (single float) */
-#define PC_REGNUM 64 /* Contains program counter */
-#define PS_REGNUM 65 /* Contains processor status */
-#define HI_REGNUM 67 /* Multiple/divide temp */
-#define LO_REGNUM 68 /* ... */
-#define FCRCS_REGNUM 69 /* FP control/status */
-#define FCRIR_REGNUM 70 /* FP implementation/revision */
-
-/* Define DO_REGISTERS_INFO() to do machine-specific formatting
- of register dumps. */
-
-#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp)
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (NUM_REGS*4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On mips, all regs are 4 bytes. */
-
-#define REGISTER_RAW_SIZE(N) 4
-
-/* Number of bytes of storage in the program's representation
- for register N. On mips, all regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) 4
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(addr, sp) \
- { sp = push_word(sp, addr);}
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. XXX floats */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF+REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 2), VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 2), VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF+16))
-
-/* Structures are returned by ref in extra arg0 */
-#define USE_STRUCT_CONVENTION(gcc_p, type) 1
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-#define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-/* We handle this differently for mips, and maybe we should not */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
-
-/* Saved Pc. */
-
-#define FRAME_SAVED_PC(FRAME) (mips_frame_saved_pc(FRAME))
-
-#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
-
-#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(num, fi) (num = mips_frame_num_args(fi))
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) ( \
- (frame_saved_regs) = *(frame_info)->saved_regs, \
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame)
-
-
-/* Things needed for making the inferior call functions. */
-
-/* Stack has strict alignment. However, use PUSH_ARGUMENTS
- to take care of it. */
-/*#define STACK_ALIGN(addr) (((addr)+3)&~3)*/
-
-#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
- sp = mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME mips_push_dummy_frame()
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME mips_pop_frame()
-
-#define MK_OP(op,rs,rt,offset) (((op)<<26)|((rs)<<21)|((rt)<<16)|(offset))
-#define CALL_DUMMY_SIZE (16*4)
-#define Dest_Reg 2
-#define CALL_DUMMY {\
- MK_OP(0,RA_REGNUM,0,8), /* jr $ra # Fake ABOUT_TO_RETURN ...*/\
- 0, /* nop # ... to stop raw backtrace*/\
- 0x27bd0000, /* addu sp,?0 # Pseudo prologue */\
-/* Start here: */\
- MK_OP(061,SP_REGNUM,12,0), /* lwc1 $f12,0(sp) # Reload first 4 args*/\
- MK_OP(061,SP_REGNUM,13,4), /* lwc1 $f13,4(sp) */\
- MK_OP(061,SP_REGNUM,14,8), /* lwc1 $f14,8(sp) */\
- MK_OP(061,SP_REGNUM,15,12), /* lwc1 $f15,12(sp) */\
- MK_OP(043,SP_REGNUM,4,0), /* lw $r4,0(sp) # Re-load FP regs*/\
- MK_OP(043,SP_REGNUM,5,4), /* lw $r5,4(sp) */\
- MK_OP(043,SP_REGNUM,6,8), /* lw $r6,8(sp) */\
- MK_OP(043,SP_REGNUM,7,12), /* lw $r7,12(sp) */\
- (017<<26)| (Dest_Reg << 16), /* lui $r31,<target upper 16 bits>*/\
- MK_OP(13,Dest_Reg,Dest_Reg,0), /* ori $r31,$r31,<lower 16 bits>*/ \
- (Dest_Reg<<21) | (31<<11) | 9, /* jalr $r31 */\
- MK_OP(043,SP_REGNUM,7,12), /* lw $r7,12(sp) */\
- 0x5000d, /* bpt */\
-}
-
-#define CALL_DUMMY_START_OFFSET 12
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, start_sp, fun, nargs, args, rettype, gcc_p)\
- (((int*)dummyname)[11] |= (((unsigned long)(fun)) >> 16), \
- ((int*)dummyname)[12] |= (unsigned short)(fun))
-
-/* Specific information about a procedure.
- This overlays the MIPS's PDR records,
- mipsread.c (ab)uses this to save memory */
-
-typedef struct mips_extra_func_info {
- unsigned long adr; /* memory address of start of procedure */
- long isym; /* pointer to procedure symbol */
- long pad2; /* iline: start of line number entries*/
- long regmask; /* save register mask */
- long regoffset; /* save register offset */
- long numargs; /* number of args to procedure (was iopt) */
- long fregmask; /* save floating point register mask */
- long fregoffset; /* save floating point register offset */
- long framesize; /* frameoffset: frame size */
- short framereg; /* frame pointer register */
- short pcreg; /* offset or reg of return pc */
- long lnLow; /* lowest line in the procedure */
- long lnHigh; /* highest line in the procedure */
- long pad3; /* cbLineOffset: byte offset for this procedure from the fd base */
-} *mips_extra_func_info_t;
-
-#define EXTRA_FRAME_INFO \
- char *proc_desc; /* actually, a mips_extra_func_info_t */\
- int num_args;\
- struct frame_saved_regs *saved_regs;
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
diff --git a/gdb/tm-isi.h b/gdb/tm-isi.h
deleted file mode 100644
index e4e6492..0000000
--- a/gdb/tm-isi.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* Definitions to target GDB on an ISI Optimum V (3.05) under 4.3bsd.
- Copyright (C) 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This has not been tested on ISI's running BSD 4.2, but it will probably
- work. */
-
-#define HAVE_68881
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR 0xfffe000
-
-/* Data segment starts at etext rounded up to DATAROUND in {N,Z}MAGIC files */
-
-#define DATAROUND 0x20000
-#define N_DATADDR(hdr) (hdr.a_magic != OMAGIC ? \
- (hdr.a_text + DATAROUND) & ~(DATAROUND-1) : hdr.a_text)
-
-/* Text segment starts at sizeof (struct exec) in {N,Z}MAGIC files */
-
-#define N_TXTADDR(hdr) (hdr.a_magic != OMAGIC ? sizeof (struct exec) : 0)
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always.
- On the ISI, the kernel resets the pc to the trap instr */
-
-#define DECR_PC_AFTER_BREAK 0
-
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(val, fi) \
-{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \
- register int insn = 0177777 & read_memory_integer (pc, 2); \
- val = 0; \
- if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \
- val = read_memory_integer (pc + 2, 2); \
- else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \
- || (insn & 0170777) == 0050117) /* addqw */ \
- { val = (insn >> 9) & 7; if (val == 0) val = 8; } \
- else if (insn == 0157774) /* addal #WW, sp */ \
- val = read_memory_integer (pc + 2, 4); \
- val >>= 2; }
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ register int regnum; \
- register int regmask; \
- register CORE_ADDR next_addr; \
- register CORE_ADDR pc; \
- register int insn; \
- register int offset; \
- bzero (&frame_saved_regs, sizeof frame_saved_regs); \
- if ((frame_info)->pc >= (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM*4 - 8*12 - 4 \
- && (frame_info)->pc <= (frame_info)->frame) \
- { next_addr = (frame_info)->frame; \
- pc = (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 8*12 - 4; }\
- else \
- { pc = get_pc_function_start ((frame_info)->pc); \
- /* Verify we have a link a6 instruction next, \
- or a branch followed by a link a6 instruction; \
- if not we lose. If we win, find the address above the saved \
- regs using the amount of storage from the link instruction. */\
-retry: \
- insn = read_memory_integer (pc, 2); \
- if (insn == 044016) \
- next_addr = (frame_info)->frame - read_memory_integer (pc += 2, 4), pc+=4; \
- else if (insn == 047126) \
- next_addr = (frame_info)->frame - read_memory_integer (pc += 2, 2), pc+=2; \
- else if ((insn & 0177400) == 060000) /* bra insn */ \
- { offset = insn & 0377; \
- pc += 2; /* advance past bra */ \
- if (offset == 0) /* bra #word */ \
- offset = read_memory_integer (pc, 2), pc += 2; \
- else if (offset == 0377) /* bra #long */ \
- offset = read_memory_integer (pc, 4), pc += 4; \
- pc += offset; \
- goto retry; \
- } else goto lose; \
- /* If have an addal #-n, sp next, adjust next_addr. */ \
- if ((0177777 & read_memory_integer (pc, 2)) == 0157774) \
- next_addr += read_memory_integer (pc += 2, 4), pc += 4; \
- } \
- /* next should be a moveml to (sp) or -(sp) or a movl r,-(sp) */ \
- insn = read_memory_integer (pc, 2), pc += 2; \
- regmask = read_memory_integer (pc, 2); \
- if ((insn & 0177760) == 022700) /* movl rn, (sp) */ \
- (frame_saved_regs).regs[(insn&7) + ((insn&010)?8:0)] = next_addr; \
- else if ((insn & 0177760) == 024700) /* movl rn, -(sp) */ \
- (frame_saved_regs).regs[(insn&7) + ((insn&010)?8:0)] = next_addr-=4; \
- else if (insn == 0044327) /* moveml mask, (sp) */ \
- { pc += 2; \
- /* Regmask's low bit is for register 0, the first written */ \
- next_addr -= 4; \
- for (regnum = 0; regnum < 16; regnum++, regmask >>= 1) \
- if (regmask & 1) \
- (frame_saved_regs).regs[regnum] = (next_addr += 4); \
- } else if (insn == 0044347) /* moveml mask, -(sp) */ \
- { pc += 2; \
- /* Regmask's low bit is for register 15, the first pushed */ \
- for (regnum = 15; regnum >= 0; regnum--, regmask >>= 1) \
- if (regmask & 1) \
- (frame_saved_regs).regs[regnum] = (next_addr -= 4); } \
- /* clrw -(sp); movw ccr,-(sp) may follow. */ \
- if (read_memory_integer (pc, 2) == 041147 \
- && read_memory_integer (pc+2, 2) == 042347) \
- (frame_saved_regs).regs[PS_REGNUM] = (next_addr -= 4); \
- lose: ; \
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 8; \
- (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4; \
-}
-
-/* The only reason this is here is the tm-isi.h reference below. It
- was moved back here from tm-68k.h. FIXME? */
-
-#define SKIP_PROLOGUE(pc) \
-{ register int op = read_memory_integer (pc, 2); \
- if (op == 0047126) \
- pc += 4; /* Skip link #word */ \
- else if (op == 0044016) \
- pc += 6; /* Skip link #long */ \
- /* Not sure why branches are here. */ \
- /* From tm-isi.h, tm-altos.h */ \
- else if (op == 0060000) \
- pc += 4; /* Skip bra #word */ \
- else if (op == 00600377) \
- pc += 6; /* skip bra #long */ \
- else if ((op & 0177400) == 0060000) \
- pc += 2; /* skip bra #char */ \
-}
-
-#include "tm-68k.h"
diff --git a/gdb/tm-m88k.h b/gdb/tm-m88k.h
deleted file mode 100644
index f562f86..0000000
--- a/gdb/tm-m88k.h
+++ /dev/null
@@ -1,400 +0,0 @@
-/* Target machine description for generic Motorola 88000, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* g++ support is not yet included. */
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* We cache information about saved registers in the frame structure,
- to save us from having to re-scan function prologues every time
- a register in a non-current frame is accessed. */
-
-#define EXTRA_FRAME_INFO \
- struct frame_saved_regs *fsr; \
- CORE_ADDR locals_pointer; \
- CORE_ADDR args_pointer;
-
-/* Zero the frame_saved_regs pointer when the frame is initialized,
- so that FRAME_FIND_SAVED_REGS () will know to allocate and
- initialize a frame_saved_regs struct the first time it is called.
- Set the arg_pointer to -1, which is not valid; 0 and other values
- indicate real, cached values. */
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
- init_extra_frame_info (fromleaf, fi)
-extern void init_extra_frame_info ();
-
-#define IEEE_FLOAT
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(frompc) \
- skip_prologue (frompc)
-extern CORE_ADDR skip_prologue ();
-
-/* The m88k kernel aligns all instructions on 4-byte boundaries. The
- kernel also uses the least significant two bits for its own hocus
- pocus. When gdb receives an address from the kernel, it needs to
- preserve those right-most two bits, but gdb also needs to be careful
- to realize that those two bits are not really a part of the address
- of an instruction. Shrug. */
-
-#define ADDR_BITS_REMOVE(addr) ((addr) & ~3)
-#define ADDR_BITS_SET(addr) (((addr) | 0x00000002) - 4)
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) \
- (ADDR_BITS_REMOVE (read_register (SRP_REGNUM)))
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-
-/* instruction 0xF000D1FF is 'tb0 0,r0,511'
- If Bit bit 0 of r0 is clear (always true),
- initiate exception processing (trap).
- */
-#define BREAKPOINT {0xF0, 0x00, 0xD1, 0xFF}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. */
-/* 'jmp r1' or 'jmp.n r1' is used to return from a subroutine. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 2) == 0xF800)
-
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes. */
-
-#define INVALID_FLOAT(p, len) IEEE_isNAN(p,len)
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 38
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES {\
- "r0",\
- "r1",\
- "r2",\
- "r3",\
- "r4",\
- "r5",\
- "r6",\
- "r7",\
- "r8",\
- "r9",\
- "r10",\
- "r11",\
- "r12",\
- "r13",\
- "r14",\
- "r15",\
- "r16",\
- "r17",\
- "r18",\
- "r19",\
- "r20",\
- "r21",\
- "r22",\
- "r23",\
- "r24",\
- "r25",\
- "r26",\
- "r27",\
- "r28",\
- "r29",\
- "r30",\
- "r31",\
- "psr",\
- "fpsr",\
- "fpcr",\
- "sxip",\
- "snip",\
- "sfip",\
- "vbr",\
- "dmt0",\
- "dmd0",\
- "dma0",\
- "dmt1",\
- "dmd1",\
- "dma1",\
- "dmt2",\
- "dmd2",\
- "dma2",\
- "sr0",\
- "sr1",\
- "sr2",\
- "sr3",\
- "fpecr",\
- "fphs1",\
- "fpls1",\
- "fphs2",\
- "fpls2",\
- "fppt",\
- "fprh",\
- "fprl",\
- "fpit",\
- "fpsr",\
- "fpcr",\
- };
-
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define SRP_REGNUM 1 /* Contains subroutine return pointer */
-#define RV_REGNUM 2 /* Contains simple return values */
-#define SRA_REGNUM 12 /* Contains address of struct return values */
-#define FP_REGNUM 31 /* Reg fetched to locate frame when pgm stops */
-#define SP_REGNUM 31 /* Contains address of top of stack */
-#define SXIP_REGNUM 35 /* Contains Shadow Execute Instruction Pointer */
-#define SNIP_REGNUM 36 /* Contains Shadow Next Instruction Pointer */
-#define PC_REGNUM SXIP_REGNUM /* Program Counter */
-#define NPC_REGNUM SNIP_REGNUM /* Next Program Counter */
-#define PSR_REGNUM 32 /* Processor Status Register */
-#define FPSR_REGNUM 33 /* Floating Point Status Register */
-#define FPCR_REGNUM 34 /* Floating Point Control Register */
-#define SFIP_REGNUM 37 /* Contains Shadow Fetched Intruction pointer */
-#define NNPC_REGNUM SFIP_REGNUM /* Next Next Program Counter */
-
-/* PSR status bit definitions. */
-
-#define PSR_MODE 0x80000000
-#define PSR_BYTE_ORDER 0x40000000
-#define PSR_SERIAL_MODE 0x20000000
-#define PSR_CARRY 0x10000000
-#define PSR_SFU_DISABLE 0x000003f0
-#define PSR_SFU1_DISABLE 0x00000008
-#define PSR_MXM 0x00000004
-#define PSR_IND 0x00000002
-#define PSR_SFRZ 0x00000001
-
-/* BCS requires that the SXIP_REGNUM (or PC_REGNUM) contain the address
- of the next instr to be executed when a breakpoint occurs. Because
- the kernel gets the next instr (SNIP_REGNUM), the instr in SNIP needs
- to be put back into SFIP, and the instr in SXIP should be shifted
- to SNIP */
-
-/* Are you sitting down? It turns out that the 88K BCS (binary compatibility
- standard) folks originally felt that the debugger should be responsible
- for backing up the IPs, not the kernel (as is usually done). Well, they
- have reversed their decision, and in future releases our kernel will be
- handling the backing up of the IPs. So, eventually, we won't need to
- do the SHIFT_INST_REGS stuff. But, for now, since there are 88K systems out
- there that do need the debugger to do the IP shifting, and since there
- will be systems where the kernel does the shifting, the code is a little
- more complex than perhaps it needs to be (we still go inside SHIFT_INST_REGS,
- and if the shifting hasn't occurred then gdb goes ahead and shifts). */
-
-#define SHIFT_INST_REGS
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-
-#define REGISTER_BYTES (NUM_REGS * sizeof(REGISTER_TYPE))
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N)*sizeof(REGISTER_TYPE))
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-#define REGISTER_RAW_SIZE(N) (sizeof(REGISTER_TYPE))
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (sizeof(REGISTER_TYPE))
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE (sizeof(REGISTER_TYPE))
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have.
-/* Are FPS1, FPS2, FPR "virtual" regisers? */
-
-#define MAX_REGISTER_VIRTUAL_SIZE (sizeof(REGISTER_TYPE))
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) (0)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) {bcopy ((FROM), (TO), (sizeof(REGISTER_TYPE)));}
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) {bcopy ((FROM), (TO), (sizeof(REGISTER_TYPE)));}
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)
-
-/* The 88k call/return conventions call for "small" values to be returned
- into consecutive registers starting from r2. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (&(((char *)REGBUF)[REGISTER_BYTE(RV_REGNUM)]), (VALBUF), TYPE_LENGTH (TYPE))
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (2*sizeof(void*), (VALBUF), TYPE_LENGTH (TYPE))
-
-/* In COFF, if PCC says a parameter is a short or a char, do not
- change it to int (it seems the convention is to change it). */
-
-#define BELIEVE_PCC_PROMOTION 1
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-extern CORE_ADDR frame_chain ();
-extern int frame_chain_valid ();
-extern int frameless_function_invocation ();
-
-#define FRAME_CHAIN(thisframe) \
- frame_chain (thisframe)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- frame_chain_valid (chain, thisframe)
-
-#define FRAMELESS_FUNCTION_INVOCATION(frame, fromleaf) \
- fromleaf = frameless_function_invocation (frame)
-
-/* Define other aspects of the stack frame. */
-
-#define FRAME_SAVED_PC(FRAME) \
- frame_saved_pc (FRAME)
-extern CORE_ADDR frame_saved_pc ();
-
-#define FRAME_ARGS_ADDRESS(fi) \
- frame_args_address (fi)
-extern CORE_ADDR frame_args_address ();
-
-#define FRAME_LOCALS_ADDRESS(fi) \
- frame_locals_address (fi)
-extern CORE_ADDR frame_locals_address ();
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(numargs, fi) ((numargs) = -1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-/* On the 88k, parameter registers get stored into the so called "homing"
- area. This *always* happens when you compiled with GCC and use -g.
- Also, (with GCC and -g) the saving of the parameter register values
- always happens right within the function prologue code, so these register
- values can generally be relied upon to be already copied into their
- respective homing slots by the time you will normally try to look at
- them (we hope).
-
- Note that homing area stack slots are always at *positive* offsets from
- the frame pointer. Thus, the homing area stack slots for the parameter
- registers (passed values) for a given function are actually part of the
- frame area of the caller. This is unusual, but it should not present
- any special problems for GDB.
-
- Note also that on the 88k, we are only interested in finding the
- registers that might have been saved in memory. This is a subset of
- the whole set of registers because the standard calling sequence allows
- the called routine to clobber many registers.
-
- We could manage to locate values for all of the so called "preserved"
- registers (some of which may get saved within any particular frame) but
- that would require decoding all of the tdesc information. Tht would be
- nice information for GDB to have, but it is not strictly manditory if we
- can live without the ability to look at values within (or backup to)
- previous frames.
-*/
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
- frame_find_saved_regs (frame_info, &frame_saved_regs)
-
-
-/* There is not currently a functioning way to call functions in the
- inferior. */
-
-/* But if there was this is where we'd put the call dummy. */
-/* #define CALL_DUMMY_LOCATION AFTER_TEXT_END */
-
-/* When popping a frame on the 88k (say when doing a return command), the
- calling function only expects to have the "preserved" registers restored.
- Thus, those are the only ones that we even try to restore here. */
-
-#define POP_FRAME pop_frame ()
-extern void pop_frame ();
diff --git a/gdb/tm-merlin.h b/gdb/tm-merlin.h
deleted file mode 100644
index f782dd0..0000000
--- a/gdb/tm-merlin.h
+++ /dev/null
@@ -1,354 +0,0 @@
-/* Definitions to target GDB to a merlin under utek 2.1
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
-
-/* I don't know if this will work for cross-debugging, even if you do get
- a copy of the right include file. */
-#include <machine/reg.h>
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) \
-{ register int op = read_memory_integer (pc, 1); \
- if (op == 0x82) \
- { op = read_memory_integer (pc+2,1); \
- if ((op & 0x80) == 0) pc += 3; \
- else if ((op & 0xc0) == 0x80) pc += 4; \
- else pc += 6; \
- }}
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) \
- read_memory_integer (read_register (SP_REGNUM), 4)
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR (0x800000)
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0xf2}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0x12)
-
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0
-
-/* Define this to say that the "svc" insn is followed by
- codes in memory saying which kind of system call it is. */
-
-#define NS32K_SVC_IMMED_OPERANDS
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 25
-
-#define NUM_GENERAL_REGS 8
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "pc", "sp", "fp", "ps", \
- "fsr", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "l0", "l1", "l2", "l3", "l4", \
- }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define AP_REGNUM FP_REGNUM
-#define FP_REGNUM 10 /* Contains address of executing stack frame */
-#define SP_REGNUM 9 /* Contains address of top of stack */
-#define PC_REGNUM 8 /* Contains program counter */
-#define PS_REGNUM 11 /* Contains processor status */
-#define FPS_REGNUM 12 /* Floating point status register */
-#define FP0_REGNUM 13 /* Floating point register 0 */
-#define LP0_REGNUM 21 /* Double register 0 (same as FP0) */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES ((NUM_REGS - 4) * sizeof (int) + 4 * sizeof (double))
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N) >= LP0_REGNUM ? \
- LP0_REGNUM * 4 + ((N) - LP0_REGNUM) * 8 : (N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the 32000, all regs are 4 bytes
- except for the doubled floating registers. */
-
-#define REGISTER_RAW_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the 32000, all regs are 4 bytes
- except for the doubled floating registers. */
-
-#define REGISTER_VIRTUAL_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) >= FP0_REGNUM ? \
- ((N) >= LP0_REGNUM ? \
- builtin_type_double \
- : builtin_type_float) \
- : builtin_type_int)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function.
-
- On this machine this is a no-op, as gcc doesn't run on it yet.
- This calling convention is not used. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP)
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the Merlin, the frame's nominal address is the FP value,
- and at that address is saved previous FP value as a 4-byte word. */
-
-#define FRAME_CHAIN(thisframe) \
- (outside_startup_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
-
-/* compute base of arguments */
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(numargs, fi) \
-{ CORE_ADDR pc; \
- int insn; \
- int addr_mode; \
- int width; \
- \
- pc = FRAME_SAVED_PC (fi); \
- insn = read_memory_integer (pc,2); \
- addr_mode = (insn >> 11) & 0x1f; \
- insn = insn & 0x7ff; \
- if ((insn & 0x7fc) == 0x57c \
- && addr_mode == 0x14) /* immediate */ \
- { if (insn == 0x57c) /* adjspb */ \
- width = 1; \
- else if (insn == 0x57d) /* adjspw */ \
- width = 2; \
- else if (insn == 0x57f) /* adjspd */ \
- width = 4; \
- numargs = read_memory_integer (pc+2,width); \
- if (width > 1) \
- flip_bytes (&numargs, width); \
- numargs = - sign_extend (numargs, width*8) / 4; } \
- else numargs = -1; \
-}
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ int regmask,regnum; \
- int localcount; \
- CORE_ADDR enter_addr; \
- CORE_ADDR next_addr; \
- \
- enter_addr = get_pc_function_start ((frame_info)->pc); \
- regmask = read_memory_integer (enter_addr+1, 1); \
- localcount = ns32k_localcount (enter_addr); \
- next_addr = (frame_info)->frame + localcount; \
- for (regnum = 0; regnum < 8; regnum++, regmask >>= 1) \
- (frame_saved_regs).regs[regnum] \
- = (regmask & 1) ? (next_addr -= 4) : 0; \
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 4; \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4; \
- (frame_saved_regs).regs[FP_REGNUM] \
- = read_memory_integer ((frame_info)->frame, 4); }
-
-
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ register CORE_ADDR sp = read_register (SP_REGNUM); \
- register int regnum; \
- sp = push_word (sp, read_register (PC_REGNUM)); \
- sp = push_word (sp, read_register (FP_REGNUM)); \
- write_register (FP_REGNUM, sp); \
- for (regnum = 0; regnum < 8; regnum++) \
- sp = push_word (sp, read_register (regnum)); \
- write_register (SP_REGNUM, sp); \
-}
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME \
-{ register FRAME frame = get_current_frame (); \
- register CORE_ADDR fp; \
- register int regnum; \
- struct frame_saved_regs fsr; \
- struct frame_info *fi; \
- fi = get_frame_info (frame); \
- fp = fi->frame; \
- get_frame_saved_regs (fi, &fsr); \
- for (regnum = 0; regnum < 8; regnum++) \
- if (fsr.regs[regnum]) \
- write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
- write_register (FP_REGNUM, read_memory_integer (fp, 4)); \
- write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \
- write_register (SP_REGNUM, fp + 8); \
- flush_cached_frames (); \
- set_current_frame (create_new_frame (read_register (FP_REGNUM),\
- read_pc ())); \
-}
-
-/* This sequence of words is the instructions
- enter 0xff,0 82 ff 00
- jsr @0x00010203 7f ae c0 01 02 03
- adjspd 0x69696969 7f a5 01 02 03 04
- bpt f2
- Note this is 16 bytes. */
-
-#define CALL_DUMMY { 0x7f00ff82, 0x0201c0ae, 0x01a57f03, 0xf2040302 }
-
-#define CALL_DUMMY_START_OFFSET 3
-#define CALL_DUMMY_LENGTH 16
-#define CALL_DUMMY_ADDR 5
-#define CALL_DUMMY_NARGS 11
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ int flipped = fun | 0xc0000000; \
- flip_bytes (&flipped, 4); \
- *((int *) (((char *) dummyname)+CALL_DUMMY_ADDR)) = flipped; \
- flipped = - nargs * 4; \
- flip_bytes (&flipped, 4); \
- *((int *) (((char *) dummyname)+CALL_DUMMY_NARGS)) = flipped; \
-}
diff --git a/gdb/tm-mips.h b/gdb/tm-mips.h
deleted file mode 100644
index dc5af0d..0000000
--- a/gdb/tm-mips.h
+++ /dev/null
@@ -1,346 +0,0 @@
-/* Definitions to make GDB run on a mips box under 4.3bsd.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
- Contributed by Per Bothner (bothner@cs.wisc.edu) at U.Wisconsin
- and by Alessandro Forin (af@cs.cmu.edu) at CMU.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined (TARGET_BYTE_ORDER)
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
-#endif
-
-/* Floating point is IEEE compliant */
-#define IEEE_FLOAT
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-/*#define NAMES_HAVE_UNDERSCORE*/
-
-/* Debugger information will be in mips' format */
-
-#define READ_MIPS_FORMAT
-
-/* File format is coff, but with additions */
-
-#define COFF_FORMAT
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) pc = mips_skip_prologue(pc)
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) read_register(RA_REGNUM)
-
-/* Are we currently handling a signal */
-
-#define IN_SIGTRAMP(pc, name) in_sigtramp(pc, name)
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR (0x7ffff000)
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-#define BIG_ENDIAN 4321
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
-#define BREAKPOINT {0, 0x5, 0, 0xd}
-#else
-#define BREAKPOINT {0xd, 0, 0x5, 0}
-#endif
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. "j ra" on mips. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 4) == 0x3e00008)
-
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p,l) isa_NAN(p,l)
-
-/* Say how long (all) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 73
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES \
- { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \
- "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \
- "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
- "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", \
- "sr", "lo", "hi", "bad", "cause","pc", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\
- "fsr", "fir", "fp" \
- }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define ZERO_REGNUM 0 /* read-only register, always 0 */
-#define SP_REGNUM 29 /* Contains address of top of stack */
-#define RA_REGNUM 31 /* Contains return address value */
-#define PS_REGNUM 32 /* Contains processor status */
-#define HI_REGNUM 34 /* Multiple/divide temp */
-#define LO_REGNUM 33 /* ... */
-#define BADVADDR_REGNUM 35 /* bad vaddr for addressing exception */
-#define CAUSE_REGNUM 36 /* describes last exception */
-#define PC_REGNUM 37 /* Contains program counter */
-#define FP0_REGNUM 38 /* Floating point register 0 (single float) */
-#define FCRCS_REGNUM 70 /* FP control/status */
-#define FCRIR_REGNUM 71 /* FP implementation/revision */
-#define FP_REGNUM 72 /* Pseudo register that contains true address of executing stack frame */
-
-/* Define DO_REGISTERS_INFO() to do machine-specific formatting
- of register dumps. */
-
-#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp)
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (NUM_REGS*4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On mips, all regs are 4 bytes. */
-
-#define REGISTER_RAW_SIZE(N) 4
-
-/* Number of bytes of storage in the program's representation
- for register N. On mips, all regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) 4
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(addr, sp) \
- { sp = push_word(sp, addr);}
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. XXX floats */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF+REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 2), VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 2), VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF+16))
-
-/* Structures are returned by ref in extra arg0 */
-#define USE_STRUCT_CONVENTION(gcc_p, type) 1
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-#define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-/* We handle this differently for mips, and maybe we should not */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
-
-/* Saved Pc. */
-
-#define FRAME_SAVED_PC(FRAME) (mips_frame_saved_pc(FRAME))
-
-#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
-
-#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(num, fi) (num = mips_frame_num_args(fi))
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) ( \
- (frame_saved_regs) = *(frame_info)->saved_regs, \
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame)
-
-
-/* Things needed for making the inferior call functions. */
-
-/* Stack has strict alignment. However, use PUSH_ARGUMENTS
- to take care of it. */
-/*#define STACK_ALIGN(addr) (((addr)+3)&~3)*/
-
-#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
- sp = mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME mips_push_dummy_frame()
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME mips_pop_frame()
-
-#define MK_OP(op,rs,rt,offset) (((op)<<26)|((rs)<<21)|((rt)<<16)|(offset))
-#define CALL_DUMMY_SIZE (16*4)
-#define Dest_Reg 2
-#define CALL_DUMMY {\
- MK_OP(0,RA_REGNUM,0,8), /* jr $ra # Fake ABOUT_TO_RETURN ...*/\
- 0, /* nop # ... to stop raw backtrace*/\
- 0x27bd0000, /* addu sp,?0 # Pseudo prologue */\
-/* Start here: */\
- MK_OP(061,SP_REGNUM,12,0), /* lwc1 $f12,0(sp) # Reload first 4 args*/\
- MK_OP(061,SP_REGNUM,13,4), /* lwc1 $f13,4(sp) */\
- MK_OP(061,SP_REGNUM,14,8), /* lwc1 $f14,8(sp) */\
- MK_OP(061,SP_REGNUM,15,12), /* lwc1 $f15,12(sp) */\
- MK_OP(043,SP_REGNUM,4,0), /* lw $r4,0(sp) # Re-load FP regs*/\
- MK_OP(043,SP_REGNUM,5,4), /* lw $r5,4(sp) */\
- MK_OP(043,SP_REGNUM,6,8), /* lw $r6,8(sp) */\
- MK_OP(043,SP_REGNUM,7,12), /* lw $r7,12(sp) */\
- (017<<26)| (Dest_Reg << 16), /* lui $r31,<target upper 16 bits>*/\
- MK_OP(13,Dest_Reg,Dest_Reg,0), /* ori $r31,$r31,<lower 16 bits>*/ \
- (Dest_Reg<<21) | (31<<11) | 9, /* jalr $r31 */\
- MK_OP(043,SP_REGNUM,7,12), /* lw $r7,12(sp) */\
- 0x5000d, /* bpt */\
-}
-
-#define CALL_DUMMY_START_OFFSET 12
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, start_sp, fun, nargs, args, rettype, gcc_p)\
- (((int*)dummyname)[11] |= (((unsigned long)(fun)) >> 16), \
- ((int*)dummyname)[12] |= (unsigned short)(fun))
-
-/* Specific information about a procedure.
- This overlays the MIPS's PDR records,
- mipsread.c (ab)uses this to save memory */
-
-typedef struct mips_extra_func_info {
- unsigned long adr; /* memory address of start of procedure */
- long isym; /* pointer to procedure symbol */
- long pad2; /* iline: start of line number entries*/
- long regmask; /* save register mask */
- long regoffset; /* save register offset */
- long numargs; /* number of args to procedure (was iopt) */
- long fregmask; /* save floating point register mask */
- long fregoffset; /* save floating point register offset */
- long framesize; /* frameoffset: frame size */
- short framereg; /* frame pointer register */
- short pcreg; /* offset or reg of return pc */
- long lnLow; /* lowest line in the procedure */
- long lnHigh; /* highest line in the procedure */
- long pad3; /* cbLineOffset: byte offset for this procedure from the fd base */
-} *mips_extra_func_info_t;
-
-#define EXTRA_FRAME_INFO \
- char *proc_desc; /* actually, a mips_extra_func_info_t */\
- int num_args;\
- struct frame_saved_regs *saved_regs;
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
diff --git a/gdb/tm-news.h b/gdb/tm-news.h
deleted file mode 100644
index 6ec1fab..0000000
--- a/gdb/tm-news.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
- Copyright (C) 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* See following cpu type determination macro to get the machine type.
-
-Here is an m-news.h file for gdb. It supports the 68881 registers.
- by hikichi@srava.sra.junet
-
-* Support Sun assembly format instead of Motorola one.
-* Ptrace for handling floating register has a bug(before NEWS OS version 2.2),
-* After NEWS OS version 3.2, some of ptrace's bug is fixed.
- But we cannot change the floating register(see adb(1) in OS 3.2) yet. */
-
-#define HAVE_68881
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Use to compute STACK_END_ADDR. */
-#define TARGET_UPAGES 2
-#define TARGET_NBPG 4096
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR (0x80000000 - TARGET_UPAGES * TARGET_NBPG)
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-/* when it return the floating value, use the FP0 in NEWS. */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- { \
- REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, \
- &REGBUF[REGISTER_BYTE (FP0_REGNUM)], VALBUF); \
- } \
- else \
- bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE)); }
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-/* when it return the floating value, use the FP0 in NEWS. */
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- { \
- char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
- REGISTER_CONVERT_TO_RAW (FP0_REGNUM, VALBUF, raw_buf); \
- write_register_bytes (FP0_REGNUM, \
- raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
- } \
- else \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); }
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(val, fi) \
-{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \
- register int insn = 0177777 & read_memory_integer (pc, 2); \
- val = 0; \
- if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \
- val = read_memory_integer (pc + 2, 2); \
- else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \
- || (insn & 0170777) == 0050117) /* addqw */ \
- { val = (insn >> 9) & 7; if (val == 0) val = 8; } \
- else if (insn == 0157774) /* addal #WW, sp */ \
- val = read_memory_integer (pc + 2, 4); \
- val >>= 2; }
-
-#include "tm-68k.h"
diff --git a/gdb/tm-nindy960.h b/gdb/tm-nindy960.h
deleted file mode 100644
index 520eb6b..0000000
--- a/gdb/tm-nindy960.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Parameters for Intel 960 running NINDY monitor, for GDB, the GNU debugger.
- Copyright (C) 1990-1991 Free Software Foundation, Inc.
- Contributed by Intel Corporation and Cygnus Support.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*****************************************************************************
- * Definitions to target GDB to an i960 debugged over a serial line.
- ******************************************************************************/
-
-#include "tm-i960.h"
-
-/* Override the standard gdb prompt when compiled for this target. */
-
-#define DEFAULT_PROMPT "(gdb960) "
-
-/* Additional command line options accepted by nindy gdb's, for handling
- the remote-nindy.c interface. These should really be target-specific
- rather than architecture-specific. */
-
-extern int nindy_old_protocol; /* nonzero if old NINDY serial protocol */
-extern int nindy_initial_brk; /* Send a BREAK to reset board first */
-extern char *nindy_ttyname; /* Name of serial port to talk to nindy */
-
-#define ADDITIONAL_OPTIONS \
- {"O", 0, &nindy_old_protocol, 1}, \
- {"brk", 0, &nindy_initial_brk, 1}, \
- {"r", 1, 0, 1004}, /* 1004 is magic cookie for ADDL_CASES */
-
-#define ADDITIONAL_OPTION_CASES \
- case 1004: /* -r option: remote nindy auto-start */ \
- nindy_ttyname = optarg; \
- break;
-
-#define ADDITIONAL_OPTION_HELP \
- "\
- -O Use old protocol to talk to a Nindy target\n\
- -brk Send a break to a Nindy target to reset it.\n\
- -r SERIAL Open remote Nindy session to SERIAL port.\n\
-"
-
-/* If specified on the command line, open tty for talking to nindy,
- and download the executable file if one was specified. */
-
-#define ADDITIONAL_OPTION_HANDLER \
- if (!setjmp (to_top_level) && nindy_ttyname) { \
- nindy_open (nindy_ttyname, !batch); \
- if ( !setjmp(to_top_level) && execarg ) { \
- target_load (execarg, !batch); \
- } \
- }
-
-/* If configured for i960 target, we take control before main loop
- and demand that we configure for a nindy target. */
-
-#define BEFORE_MAIN_LOOP_HOOK \
- nindy_before_main_loop();
-
-/* Address of end of stack space.
- * This probably doesn't matter for nindy, because it's only used
- * in manipulation of core files, which we don't support.
- */
-
-#define STACK_END_ADDR (0xfe000000)
-
-/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
- and has no caller.
-
- On the i960, each various target system type defines FRAME_CHAIN_VALID,
- since it differs between NINDY and VxWorks, the two currently supported
- targets types. */
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- nindy_frame_chain_valid (chain, thisframe)
-
-extern int nindy_frame_chain_valid(); /* See nindy-tdep.c */
-
-/* Sequence of bytes for breakpoint instruction */
-
-#define BREAKPOINT {0x00, 0x3e, 0x00, 0x66}
-
-/* Amount ip must be decremented by after a breakpoint.
- * This is often the number of bytes in BREAKPOINT but not always.
- */
-
-#define DECR_PC_AFTER_BREAK 0
diff --git a/gdb/tm-np1.h b/gdb/tm-np1.h
deleted file mode 100644
index 75a36af..0000000
--- a/gdb/tm-np1.h
+++ /dev/null
@@ -1,506 +0,0 @@
-/* Parameters for targeting on a Gould NP1, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define GOULD_NPL
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* N_ENTRY appears in libraries on Gould machines.
- Don't know what 0xa4 is; it's mentioned in stab.h
- but only in the sdb symbol list. */
-#define IGNORE_SYMBOL(type) (type == N_ENTRY || type == 0xa4)
-
-/* We don't want the extra gnu symbols on the machine;
- they will interfere with the shared segment symbols. */
-#define NO_GNU_STABS
-
-/* Macro for text-offset and data info (in NPL a.out format). */
-#define TEXTINFO \
- text_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr); \
- exec_data_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr)\
- + exec_aouthdr.a_text
-
-/* Macro for number of symbol table entries */
-#define NUMBER_OF_SYMBOLS \
- (coffhdr.f_nsyms)
-
-/* Macro for file-offset of symbol table (in NPL a.out format). */
-#define SYMBOL_TABLE_OFFSET \
- N_SYMOFF (coffhdr)
-
-/* Macro for file-offset of string table (in NPL a.out format). */
-#define STRING_TABLE_OFFSET \
- (N_STROFF (coffhdr))
-
-/* Macro to store the length of the string table data in INTO. */
-#define READ_STRING_TABLE_SIZE(INTO) \
- { INTO = hdr.a_stsize; }
-
-/* Macro to declare variables to hold the file's header data. */
-#define DECLARE_FILE_HEADERS struct exec hdr; \
- FILHDR coffhdr
-
-/* Macro to read the header data from descriptor DESC and validate it.
- NAME is the file name, for error messages. */
-#define READ_FILE_HEADERS(DESC, NAME) \
-{ val = myread (DESC, &coffhdr, sizeof coffhdr); \
- if (val < 0) \
- perror_with_name (NAME); \
- val = myread (DESC, &hdr, sizeof hdr); \
- if (val < 0) \
- perror_with_name (NAME); \
- if (coffhdr.f_magic != GNP1MAGIC) \
- error ("File \"%s\" not in coff executable format.", NAME); \
- if (N_BADMAG (hdr)) \
- error ("File \"%s\" not in executable format.", NAME); }
-
-/* Define COFF and other symbolic names needed on NP1 */
-#define NS32GMAGIC GNP1MAGIC
-#define NS32SMAGIC GPNMAGIC
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-#define NAMES_HAVE_UNDERSCORE
-
-/* Address of blocks in N_LBRAC and N_RBRAC symbols are absolute addresses,
- not relative to start of source address. */
-#define BLOCK_ADDRESS_ABSOLUTE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-#define FUNCTION_START_OFFSET 8
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. One NPL we can have one two startup
- sequences depending on the size of the local stack:
-
- Either:
- "suabr b2, #"
- of
- "lil r4, #", "suabr b2, #(r4)"
-
- "lwbr b6, #", "stw r1, 8(b2)"
- Optional "stwbr b3, c(b2)"
- Optional "trr r2,r7" (Gould first argument register passing)
- or
- Optional "stw r2,8(b3)" (Gould first argument register passing)
- */
-#define SKIP_PROLOGUE(pc) { \
- register int op = read_memory_integer ((pc), 4); \
- if ((op & 0xffff0000) == 0xFA0B0000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if ((op & 0xffff0000) == 0x59400000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if ((op & 0xffff0000) == 0x5F000000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if (op == 0xD4820008) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if (op == 0x5582000C) { \
- pc += 4; \
- op = read_memory_integer ((pc), 2); \
- if (op == 0x2fa0) { \
- pc += 2; \
- } else { \
- op = read_memory_integer ((pc), 4); \
- if (op == 0xd5030008) { \
- pc += 4; \
- } \
- } \
- } else { \
- op = read_memory_integer ((pc), 2); \
- if (op == 0x2fa0) { \
- pc += 2; \
- } \
- } \
- } \
- } \
- } \
- } \
- if ((op & 0xffff0000) == 0x59000000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if ((op & 0xffff0000) == 0x5F000000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if (op == 0xD4820008) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if (op == 0x5582000C) { \
- pc += 4; \
- op = read_memory_integer ((pc), 2); \
- if (op == 0x2fa0) { \
- pc += 2; \
- } else { \
- op = read_memory_integer ((pc), 4); \
- if (op == 0xd5030008) { \
- pc += 4; \
- } \
- } \
- } else { \
- op = read_memory_integer ((pc), 2); \
- if (op == 0x2fa0) { \
- pc += 2; \
- } \
- } \
- } \
- } \
- } \
-}
-
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. True on NPL! Return address is in R1.
- The true return address is REALLY 4 past that location! */
-#define SAVED_PC_AFTER_CALL(frame) \
- (read_register(R1_REGNUM) + 4)
-
-/* Address of end of stack space. */
-#define STACK_END_ADDR 0x7fffc000
-
-/* Stack grows downward. */
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction.
- This is padded out to the size of a machine word. When it was just
- {0x28, 0x09} it gave problems if hit breakpoint on returning from a
- function call. */
-#define BREAKPOINT {0x28, 0x09, 0x0, 0x0}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-#define DECR_PC_AFTER_BREAK 2
-
-/* Nonzero if instruction at PC is a return instruction. "bu 4(r1)" */
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 4) == 0x40100004)
-
-/* Return 1 if P points to an invalid floating point value. */
-#define INVALID_FLOAT(p, len) ((*(short *)p & 0xff80) == 0x8000)
-
-/* Say how long (ordinary) registers are. */
-#define REGISTER_TYPE long
-
-/* Size of bytes of vector register (NP1 only), 32 elements * sizeof(int) */
-#define VR_SIZE 128
-
-/* Number of machine registers */
-#define NUM_REGS 27
-#define NUM_GEN_REGS 16
-#define NUM_CPU_REGS 4
-#define NUM_VECTOR_REGS 7
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-#define REGISTER_NAMES { \
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", \
- "sp", "ps", "pc", "ve", \
- "v1", "v2", "v3", "v4", "v5", "v6", "v7", \
-}
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-#define R1_REGNUM 1 /* Gr1 => return address of caller */
-#define R2_REGNUM 2 /* Gr2 => return value from function */
-#define R4_REGNUM 4 /* Gr4 => register save area */
-#define R5_REGNUM 5 /* Gr5 => register save area */
-#define R6_REGNUM 6 /* Gr6 => register save area */
-#define R7_REGNUM 7 /* Gr7 => register save area */
-#define B1_REGNUM 9 /* Br1 => start of this code routine */
-#define SP_REGNUM 10 /* Br2 == (sp) */
-#define AP_REGNUM 11 /* Br3 == (ap) */
-#define FP_REGNUM 16 /* A copy of Br2 saved in trap */
-#define PS_REGNUM 17 /* Contains processor status */
-#define PC_REGNUM 18 /* Contains program counter */
-#define VE_REGNUM 19 /* Vector end (user setup) register */
-#define V1_REGNUM 20 /* First vector register */
-#define V7_REGNUM 26 /* First vector register */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES \
- (NUM_GEN_REGS*4 + NUM_VECTOR_REGS*VR_SIZE + NUM_CPU_REGS*4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-#define REGISTER_BYTE(N) \
- (((N) < V1_REGNUM) ? ((N) * 4) : (((N) - V1_REGNUM) * VR_SIZE) + 80)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the NP1, all normal regs are 4 bytes, but
- the vector registers are VR_SIZE*4 bytes long. */
-#define REGISTER_RAW_SIZE(N) \
- (((N) < V1_REGNUM) ? 4 : VR_SIZE)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the NP1, all regs are 4 bytes. */
-#define REGISTER_VIRTUAL_SIZE(N) \
- (((N) < V1_REGNUM) ? 4 : VR_SIZE)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-#define MAX_REGISTER_RAW_SIZE VR_SIZE
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-#define MAX_REGISTER_VIRTUAL_SIZE VR_SIZE
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-#define REGISTER_CONVERTIBLE(N) (0)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_RAW_SIZE(REGNUM));
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) > VE_REGNUM ? builtin_type_np1_vector : builtin_type_int)
-extern struct type *builtin_type_np1_vector;
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function.
-
- On this machine this is a no-op, because gcc isn't used on it
- yet. So this calling convention is not used. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) push_word(SP + 8, ADDR)
-
-/* Extract from an arrary REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (((int *)(REGBUF)) + 2, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (REGISTER_BYTE (R2_REGNUM), VALBUF, \
- TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*((int *)(REGBUF) + 2))
-
-/* Both gcc and cc return small structs in registers (i.e. in GDB
- terminology, small structs don't use the struct return convention). */
-#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH(type) > 8)
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the NPL, the frame's norminal address is Br2 and the
- previous routines frame is up the stack X bytes, where X is the
- value stored in the code function header xA(Br1). */
-#define FRAME_CHAIN(thisframe) (findframe(thisframe))
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && chain != (thisframe)->frame)
-
-/* Define other aspects of the stack frame on NPL. */
-#define FRAME_SAVED_PC(FRAME) \
- (read_memory_integer ((FRAME)->frame + 8, 4))
-
-#define FRAME_ARGS_ADDRESS(fi) \
- ((fi)->next_frame ? \
- read_memory_integer ((fi)->frame + 12, 4) : \
- read_register (AP_REGNUM))
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Set VAL to the number of args passed to frame described by FI.
- Can set VAL to -1, meaning no way to tell. */
-
-/* We can check the stab info to see how
- many arg we have. No info in stack will tell us */
-#define FRAME_NUM_ARGS(val,fi) (val = findarg(fi))
-
-/* Return number of bytes at start of arglist that are not really args. */
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ \
- bzero (&frame_saved_regs, sizeof frame_saved_regs); \
- (frame_saved_regs).regs[SP_REGNUM] = framechain (frame_info); \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8; \
- (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \
- (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \
- (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \
- (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \
-}
-
-/* Things needed for making the inferior call functions. */
-
-#define CALL_DUMMY_LOCATION BEFORE_TEXT_END
-#define NEED_TEXT_START_END
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ register CORE_ADDR sp = read_register (SP_REGNUM); \
- register int regnum; \
- for (regnum = 0; regnum < FP_REGNUM; regnum++) \
- sp = push_word (sp, read_register (regnum)); \
- sp = push_word (sp, read_register (PS_REGNUM)); \
- sp = push_word (sp, read_register (PC_REGNUM)); \
- write_register (SP_REGNUM, sp);}
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-
-#define POP_FRAME \
-{ CORE_ADDR sp = read_register(SP_REGNUM); \
- REGISTER_TYPE reg; \
- int regnum; \
- for(regnum = 0;regnum < FP_REGNUM;regnum++){ \
- sp-=sizeof(REGISTER_TYPE); \
- read_memory(sp,&reg,sizeof(REGISTER_TYPE)); \
- write_register(regnum,reg);} \
- sp-=sizeof(REGISTER_TYPE); \
- read_memory(sp,&reg,sizeof(REGISTER_TYPE)); \
- write_register(PS_REGNUM,reg); \
- sp-=sizeof(REGISTER_TYPE); \
- read_memory(sp,&reg,sizeof(REGISTER_TYPE)); \
- write_register(PC_REGNUM,reg);}
-
-/* MJD - Size of dummy frame pushed onto stack by PUSH_DUMMY_FRAME */
-
-#define DUMMY_FRAME_SIZE (0x48)
-
-/* MJD - The sequence of words in the instructions is
- halt
- halt
- halt
- halt
- subr b2,stack size,0 grab stack space for dummy call
- labr b3,x0(b2),0 set AP_REGNUM to point at arguments
- lw r2,x8(b3),0 load r2 with first argument
- lwbr b1,arguments size(b2),0 load address of function to be called
- brlnk r1,x8(b1),0 call function
- halt
- halt
- labr b2,stack size(b2),0 give back stack
- break break
- */
-
-#define CALL_DUMMY {0x00000000, \
- 0x00000000, \
- 0x59000000, \
- 0x598a0000, \
- 0xb5030008, \
- 0x5c820000, \
- 0x44810008, \
- 0x00000000, \
- 0x590a0000, \
- 0x28090000 }
-
-#define CALL_DUMMY_LENGTH 40
-
-#define CALL_DUMMY_START_OFFSET 8
-
-#define CALL_DUMMY_STACK_ADJUST 8
-
-/* MJD - Fixup CALL_DUMMY for the specific function call.
- OK heres the problems
- 1) On a trap there are two copies of the stack pointer, one in SP_REGNUM
- which is read/write and one in FP_REGNUM which is only read. It seems
- that when restarting the GOULD NP1 uses FP_REGNUM's value.
- 2) Loading function address into b1 looks a bit difficult if bigger than
- 0x0000fffc, infact from what I can tell the compiler sets up table of
- function address in base3 through which function calls are referenced.
-
- OK my solutions
- Calculate the size of the dummy stack frame and do adjustments of
- SP_REGNUM in the dummy call.
- Push function address onto the stack and load it in the dummy call
- */
-
-#define FIX_CALL_DUMMY(dummyname, sp, fun, nargs, args, type, gcc_p) \
- { int i;\
- int arg_len = 0, total_len;\
- old_sp = push_word(old_sp,fun);\
- for(i = nargs - 1;i >= 0;i--)\
- arg_len += TYPE_LENGTH (VALUE_TYPE (value_arg_coerce (args[i])));\
- if(struct_return)\
- arg_len += TYPE_LENGTH(value_type);\
- total_len = DUMMY_FRAME_SIZE+CALL_DUMMY_STACK_ADJUST+4+arg_len;\
- dummyname[0] += total_len;\
- dummyname[2] += total_len;\
- dummyname[5] += arg_len+CALL_DUMMY_STACK_ADJUST;\
- dummyname[8] += total_len;}
-
-/* MJD - So the stack should end up looking like this
-
- | Normal stack frame |
- | from normal program |
- | flow |
- +---------------------+ <- Final sp - 0x08 - argument size
- | | - 0x4 - dummy_frame_size
- | Pushed dummy frame |
- | b0-b7, r0-r7 |
- | pc and ps |
- | |
- +---------------------+
- | Function address |
- +---------------------+ <- Final sp - 0x8 - arguments size
- | |
- | |
- | |
- | Arguments to |
- | Function |
- | |
- | |
- | |
- +---------------------+ <- Final sp - 0x8
- | Dummy_stack_adjust |
- +---------------------+ <- Final sp
- | |
- | where call will |
- | build frame |
-*/
diff --git a/gdb/tm-pn.h b/gdb/tm-pn.h
deleted file mode 100644
index 3300c8c..0000000
--- a/gdb/tm-pn.h
+++ /dev/null
@@ -1,426 +0,0 @@
-/* Parameters for targe of a Gould Powernode, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define GOULD_PN
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* This code appears in libraries on Gould machines. Ignore it. */
-#define IGNORE_SYMBOL(type) (type == N_ENTRY)
-
-/* We don't want the extra gnu symbols on the machine;
- they will interfere with the shared segment symbols. */
-#define NO_GNU_STABS
-
-/* Macro for text-offset and data info (in PN a.out format). */
-#define TEXTINFO \
- text_offset = N_TXTOFF (exec_coffhdr); \
- exec_data_offset = N_TXTOFF (exec_coffhdr) \
- + exec_aouthdr.a_text
-
-/* Macro for number of symbol table entries */
-#define END_OF_TEXT_DEFAULT \
- (0xffffff)
-
-/* Macro for number of symbol table entries */
-#define NUMBER_OF_SYMBOLS \
- (coffhdr.f_nsyms)
-
-/* Macro for file-offset of symbol table (in usual a.out format). */
-#define SYMBOL_TABLE_OFFSET \
- N_SYMOFF (coffhdr)
-
-/* Macro for file-offset of string table (in usual a.out format). */
-#define STRING_TABLE_OFFSET \
- (N_STROFF (coffhdr) + sizeof(int))
-
-/* Macro to store the length of the string table data in INTO. */
-#define READ_STRING_TABLE_SIZE(INTO) \
- { INTO = hdr.a_stsize; }
-
-/* Macro to declare variables to hold the file's header data. */
-#define DECLARE_FILE_HEADERS struct old_exec hdr; \
- FILHDR coffhdr
-
-/* Macro to read the header data from descriptor DESC and validate it.
- NAME is the file name, for error messages. */
-#define READ_FILE_HEADERS(DESC, NAME) \
-{ val = myread (DESC, &coffhdr, sizeof coffhdr); \
- if (val < 0) \
- perror_with_name (NAME); \
- val = myread (DESC, &hdr, sizeof hdr); \
- if (val < 0) \
- perror_with_name (NAME); \
- if (coffhdr.f_magic != GNP1MAGIC) \
- error ("File \"%s\" not in coff executable format.", NAME); \
- if (N_BADMAG (hdr)) \
- error ("File \"%s\" not in executable format.", NAME); }
-
-/* Define COFF and other symbolic names needed on NP1 */
-#define NS32GMAGIC GDPMAGIC
-#define NS32SMAGIC PN_MAGIC
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-#define NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-#define FUNCTION_START_OFFSET 4
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. One PN we can have one or two startup
- sequences depending on the size of the local stack:
-
- Either:
- "suabr b2, #"
- of
- "lil r4, #", "suabr b2, #(r4)"
-
- "lwbr b6, #", "stw r1, 8(b2)"
- Optional "stwbr b3, c(b2)"
- Optional "trr r2,r7" (Gould first argument register passing)
- or
- Optional "stw r2,8(b3)" (Gould first argument register passing)
- */
-#define SKIP_PROLOGUE(pc) { \
- register int op = read_memory_integer ((pc), 4); \
- if ((op & 0xffff0000) == 0x580B0000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if ((op & 0xffff0000) == 0x59400000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if ((op & 0xffff0000) == 0x5F000000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if (op == 0xD4820008) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if (op == 0x5582000C) { \
- pc += 4; \
- op = read_memory_integer ((pc), 2); \
- if (op == 0x2fa0) { \
- pc += 2; \
- } else { \
- op = read_memory_integer ((pc), 4); \
- if (op == 0xd5030008) { \
- pc += 4; \
- } \
- } \
- } else { \
- op = read_memory_integer ((pc), 2); \
- if (op == 0x2fa0) { \
- pc += 2; \
- } \
- } \
- } \
- } \
- } \
- } \
- if ((op & 0xffff0000) == 0x59000000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if ((op & 0xffff0000) == 0x5F000000) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if (op == 0xD4820008) { \
- pc += 4; \
- op = read_memory_integer ((pc), 4); \
- if (op == 0x5582000C) { \
- pc += 4; \
- op = read_memory_integer ((pc), 2); \
- if (op == 0x2fa0) { \
- pc += 2; \
- } else { \
- op = read_memory_integer ((pc), 4); \
- if (op == 0xd5030008) { \
- pc += 4; \
- } \
- } \
- } else { \
- op = read_memory_integer ((pc), 2); \
- if (op == 0x2fa0) { \
- pc += 2; \
- } \
- } \
- } \
- } \
- } \
-}
-
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. True on PN! Return address is in R1.
- Note: true return location is 4 bytes past R1! */
-#define SAVED_PC_AFTER_CALL(frame) \
- (read_register(R1_REGNUM) + 4)
-
-/* Address of end of stack space. */
-#define STACK_END_ADDR 0x480000
-
-/* Stack grows downward. */
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-#define BREAKPOINT {0x28, 0x09}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-#define DECR_PC_AFTER_BREAK 2
-
-/* Nonzero if instruction at PC is a return instruction. "bu 4(r1)" */
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 4) == 0xEC100004)
-
-/* Return 1 if P points to an invalid floating point value. */
-#define INVALID_FLOAT(p, len) ((*(short *)p & 0xff80) == 0x8000)
-
-/* Say how long (ordinary) registers are. */
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-#define NUM_REGS 19
-#define NUM_GEN_REGS 16
-#define NUM_CPU_REGS 3
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-#define REGISTER_NAMES { \
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", \
- "sp", "ps", "pc", \
-}
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-#define R1_REGNUM 1 /* Gr1 => return address of caller */
-#define R4_REGNUM 4 /* Gr4 => register save area */
-#define R5_REGNUM 5 /* Gr5 => register save area */
-#define R6_REGNUM 6 /* Gr6 => register save area */
-#define R7_REGNUM 7 /* Gr7 => register save area */
-#define B1_REGNUM 9 /* Br1 => start of this code routine */
-#define FP_REGNUM 10 /* Br2 == (sp) */
-#define AP_REGNUM 11 /* Br3 == (ap) */
-#define SP_REGNUM 16 /* A copy of Br2 saved in trap */
-#define PS_REGNUM 17 /* Contains processor status */
-#define PC_REGNUM 18 /* Contains program counter */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (NUM_GEN_REGS*4 + NUM_CPU_REGS*4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-#define REGISTER_BYTE(N) ((N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the PN, all normal regs are 4 bytes. */
-#define REGISTER_RAW_SIZE(N) (4)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the PN, all regs are 4 bytes. */
-#define REGISTER_VIRTUAL_SIZE(N) (4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-#define MAX_REGISTER_RAW_SIZE (4)
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-#define MAX_REGISTER_VIRTUAL_SIZE (4)
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-#define REGISTER_CONVERTIBLE(N) (0)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_RAW_SIZE(REGNUM));
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-#define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function.
-
- On this machine this is a no-op, because gcc isn't used on it
- yet. So this calling convention is not used. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP)
-
-/* Extract from an arrary REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the NPL, the frame's norminal address is Br2 and the
- previous routines frame is up the stack X bytes, where X is the
- value stored in the code function header xA(Br1). */
-#define FRAME_CHAIN(thisframe) (findframe(thisframe))
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && chain != (thisframe)->frame)
-
-/* Define other aspects of the stack frame on NPL. */
-#define FRAME_SAVED_PC(frame) \
- (read_memory_integer ((frame)->frame + 8, 4))
-
-#define FRAME_ARGS_ADDRESS(fi) \
- ((fi)->next_frame ? \
- read_memory_integer ((fi)->frame + 12, 4) : \
- read_register (AP_REGNUM))
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame + 80)
-
-/* Set VAL to the number of args passed to frame described by FI.
- Can set VAL to -1, meaning no way to tell. */
-
-/* We can check the stab info to see how
- many arg we have. No info in stack will tell us */
-#define FRAME_NUM_ARGS(val,fi) (val = findarg(fi))
-
-/* Return number of bytes at start of arglist that are not really args. */
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ \
- bzero (&frame_saved_regs, sizeof frame_saved_regs); \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8; \
- (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \
- (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \
- (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \
- (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \
-}
-
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ register CORE_ADDR sp = read_register (SP_REGNUM); \
- register int regnum; \
- sp = push_word (sp, read_register (PC_REGNUM)); \
- sp = push_word (sp, read_register (FP_REGNUM)); \
- write_register (FP_REGNUM, sp); \
- for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \
- sp = push_word (sp, read_register (regnum)); \
- sp = push_word (sp, read_register (PS_REGNUM)); \
- write_register (SP_REGNUM, sp); }
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-
-#define POP_FRAME \
-{ register FRAME frame = get_current_frame (); \
- register CORE_ADDR fp; \
- register int regnum; \
- struct frame_saved_regs fsr; \
- struct frame_info *fi; \
- fi = get_frame_info (frame); \
- fp = fi->frame; \
- get_frame_saved_regs (fi, &fsr); \
- for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \
- if (fsr.regs[regnum]) \
- write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
- if (fsr.regs[PS_REGNUM]) \
- write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4)); \
- write_register (FP_REGNUM, read_memory_integer (fp, 4)); \
- write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \
- write_register (SP_REGNUM, fp + 8); \
- flush_cached_frames (); \
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),\
- read_pc ())); }
-
-/* This sequence of words is the instructions:
- halt
- halt
- halt
- halt
- suabr b2, #<stacksize>
- lwbr b6, #con
- stw r1, 8(b2) - save caller address, do we care?
- lw r2, 60(b2) - arg1
- labr b3, 50(b2)
- std r4, 30(b2) - save r4-r7
- std r6, 38(b2)
- lwbr b1, #<func> - load function call address
- brlnk r1, 8(b1) - call function
- halt
- halt
- ld r4, 30(b2) - restore r4-r7
- ld r6, 38(b2)
-
- Setup our stack frame, load argumemts, call and then restore registers.
-*/
-
-/* FIXME: The below defines an m68k CALL_DUMMY, which looks nothing like what
- is documented above. */
-
-#define CALL_DUMMY {0xf227e0ff, 0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, 0x4e4f4e71}
-
-#define CALL_DUMMY_LENGTH 28
-
-#define CALL_DUMMY_START_OFFSET 12
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ *(int *)((char *) dummyname + 20) = nargs * 4; \
- *(int *)((char *) dummyname + 14) = fun; }
diff --git a/gdb/tm-pyr.h b/gdb/tm-pyr.h
deleted file mode 100644
index a977a52..0000000
--- a/gdb/tm-pyr.h
+++ /dev/null
@@ -1,520 +0,0 @@
-/* Definitions to make GDB run on a Pyramid under OSx 4.0 (4.2bsd).
- Copyright (C) 1988, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* Traditional Unix virtual address spaces have thre regions: text,
- data and stack. The text, initialised data, and uninitialised data
- are represented in separate segments of the a.out file.
- When a process dumps core, the data and stack regions are written
- to a core file. This gives a debugger enough information to
- reconstruct (and debug) the virtual address space at the time of
- the coredump.
- Pyramids have an distinct fourth region of the virtual address
- space, in which the contents of the windowed registers are stacked
- in fixed-size frames. Pyramid refer to this region as the control
- stack. Each call (or trap) automatically allocates a new register
- frame; each return deallocates the current frame and restores the
- windowed registers to their values before the call.
-
- When dumping core, the control stack is written to a core files as
- a third segment. The core-handling functions need to know to deal
- with it. */
-/* Tell core.c there is an extra segment. */
-#define REG_STACK_SEGMENT
-
-/* Floating point is IEEE compatible on most Pyramid hardware
- (Older processors do not have IEEE NaNs). */
-#define IEEE_FLOAT
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-/* FIXME -- do we want to skip insns to allocate the local frame?
- If so, what do they look like?
- This is becoming harder, since tege@sics.SE wants to change
- gcc to not output a prologue when no frame is needed. */
-#define SKIP_PROLOGUE(pc) do {} while (0)
-
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) FRAME_SAVED_PC(frame)
-
-/* Address of end of stack space. */
-/* This seems to be right for the 90x comp.vuw.ac.nz.
- The correct value at any site may be a function of the configured
- maximum control stack depth. If so, I don't know where the
- control-stack depth is configured, so I can't #include it here. */
-#define STACK_END_ADDR (0xc00cc000)
-
-/* Register window stack (Control stack) stack definitions
- - Address of beginning of control stack.
- - size of control stack frame
- (Note that since crts0 is usually the first function called,
- main()'s control stack is one frame (0x80 bytes) beyond this value. */
-
-#define CONTROL_STACK_ADDR (0xc00cd000)
-
-/* Bytes in a register window -- 16 parameter regs, 16 local regs
- for each call, is 32 regs * 4 bytes */
-
-#define CONTROL_STACK_FRAME_SIZE (32*4)
-
-/* FIXME. On a pyr, Data Stack grows downward; control stack goes upwards.
- Which direction should we use for INNER_THAN, PC_INNER_THAN ?? */
-
-#define INNER_THAN <
-#define PC_INNER_THAN >
-
-/* Stack has strict alignment. */
-
-#define STACK_ALIGN(ADDR) (((ADDR)+3)&-4)
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0xf0, 00, 00, 00}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction.
- On a pyr, this is either "ret" or "retd".
- It would be friendly to check that any "retd" always had an
- argument of 0, since anything else is invalid. */
-
-#define ABOUT_TO_RETURN(pc) \
-(((read_memory_integer (pc, 2) & 0x3ff0) == 0x3090) || \
- ((read_memory_integer (pc, 2) & 0x0ff0) == 0x00a0))
-
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes -- not relevant on the Vax. */
-/* FIXME -- this is ok for a vax, bad for big-endian ieee format.
- I would use the definition for a Sun; but it is no better! */
-
-#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-/* pyramids have 64, plus one for the PSW; plus perhaps one more for the
- kernel stack pointer (ksp) and control-stack pointer (CSP) */
-
-#define NUM_REGS 67
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES \
-{"gr0", "gr1", "gr2", "gr3", "gr4", "gr5", "gr6", "gr7", \
- "gr8", "gr9", "gr10", "gr11", "logpsw", "cfp", "sp", "pc", \
- "pr0", "pr1", "pr2", "pr3", "pr4", "pr5", "pr6", "pr7", \
- "pr8", "pr9", "pr10", "pr11", "pr12", "pr13", "pr14", "pr15", \
- "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", \
- "lr8", "lr9", "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", \
- "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7", \
- "tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15", \
- "psw", "ksp", "csp"}
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-/* pseudo-registers: */
-#define PS_REGNUM 64 /* Contains processor status */
-#define PSW_REGNUM 64 /* Contains current psw, whatever it is.*/
-#define CSP_REGNUM 65 /* address of this control stack frame*/
-#define KSP_REGNUM 66 /* Contains process's Kernel Stack Pointer */
-
-#define CFP_REGNUM 13 /* Current data-stack frame ptr */
-#define TR0_REGNUM 48 /* After function call, contains
- function result */
-
-/* Registers interesting to the machine-independent part of gdb*/
-
-#define FP_REGNUM CSP_REGNUM /* Contains address of executing (control)
- stack frame */
-#define SP_REGNUM 14 /* Contains address of top of stack -??*/
-#define PC_REGNUM 15 /* Contains program counter */
-
-/* Define DO_REGISTERS_INFO() to do machine-specific formatting
- of register dumps. */
-
-#define DO_REGISTERS_INFO(_regnum, fp) pyr_do_registers_info(_regnum, fp)
-
-/* need this so we can find the global registers: they never get saved. */
-extern unsigned int global_reg_offset;
-extern unsigned int last_frame_offset;
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (NUM_REGS*4)
-
-/* the Pyramid has register windows. */
-
-#define HAVE_REGISTER_WINDOWS
-
-/* Is this register part of the register window system? A yes answer
- implies that 1) The name of this register will not be the same in
- other frames, and 2) This register is automatically "saved" (out
- registers shifting into ins counts) upon subroutine calls and thus
- there is no need to search more than one stack frame for it. */
-
-#define REGISTER_IN_WINDOW_P(regnum) \
- ((regnum) >= 16 && (regnum) < 64)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the Pyramid, all regs are 4 bytes. */
-
-#define REGISTER_RAW_SIZE(N) 4
-
-/* Number of bytes of storage in the program's representation
- for register N. On the Pyramid, all regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) 4
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
-
-/* FIXME: It seems impossible for both EXTRACT_RETURN_VALUE and
- STORE_RETURN_VALUE to be correct. */
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-/****FIXME****/
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (TR0_REGNUM, (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-/* Note that on a register-windowing machine (eg, Pyr, SPARC), this is
- where the value is found after the function call -- ie, it should
- correspond to GNU CC's FUNCTION_VALUE rather than FUNCTION_OUTGOING_VALUE.*/
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (((int *)(REGBUF))+TR0_REGNUM, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-/* on pyrs, values are returned in */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (REGISTER_BYTE(TR0_REGNUM), VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-/* FIXME */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- ( ((int *)(REGBUF)) [TR0_REGNUM])
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-#define EXTRA_FRAME_INFO \
- FRAME_ADDR bottom; \
- CORE_ADDR frame_cfp; \
- CORE_ADDR frame_window_addr;
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
-do { \
- (fci)->frame_window_addr = (fci)->frame; \
- (fci)->bottom = \
- ((fci)->next ? \
- ((fci)->frame == (fci)->next_frame ? \
- (fci)->next->bottom : (fci)->next->frame) : \
- read_register (SP_REGNUM)); \
- (fci)->frame_cfp = \
- read_register (CFP_REGNUM); \
- /***fprintf (stderr, \
- "[[creating new frame for %0x,pc=%0x,csp=%0x]]\n", \
- (fci)->frame, (fci)->pc,(fci)->frame_cfp);*/ \
-} while (0);
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the pyr, the frame's nominal address is the address
- of parameter register 0. The previous frame is found 32 words up. */
-
-#define FRAME_CHAIN(thisframe) \
- ( (thisframe) -> frame - CONTROL_STACK_FRAME_SIZE)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
- /*((thisframe) >= CONTROL_STACK_ADDR))*/
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0.
-
- I do not understand what this means on a Pyramid, where functions
- *always* have a control-stack frame, but may or may not have a
- frame on the data stack. Since GBD uses the value of the
- control stack pointer as its "address" of a frame, FRAMELESS
- is always 1, so does not need to be defined. */
-
-
-/* Where is the PC for a specific frame */
-
-#define FRAME_SAVED_PC(fi) \
- ((CORE_ADDR) (read_memory_integer ( (fi) -> frame + 60, 4)))
-
-/* There may be bugs in FRAME_ARGS_ADDRESS and FRAME_LOCALS_ADDRESS;
- or there may be bugs in accessing the registers that break
- their definitions.
- Having the macros expand into functions makes them easier to debug.
- When the bug is finally located, the inline macro defintions can
- be un-#if 0ed, and frame_args_addr and frame_locals_address can
- be deleted from pyr-dep.c */
-
-/* If the argument is on the stack, it will be here. */
-#define FRAME_ARGS_ADDRESS(fi) \
- frame_args_addr(fi)
-
-#define FRAME_LOCALS_ADDRESS(fi) \
- frame_locals_address(fi)
-
-/* The following definitions doesn't seem to work.
- I don't understand why. */
-#if 0
-#define FRAME_ARGS_ADDRESS(fi) \
- /*(FRAME_FP(fi) + (13*4))*/ (read_register (CFP_REGNUM))
-
-#define FRAME_LOCALS_ADDRESS(fi) \
- ((fi)->frame +(16*4))
-
-#endif /* 0 */
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(val, fi) (val = -1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame.
-
- Note that on register window machines, we are currently making the
- assumption that window registers are being saved somewhere in the
- frame in which they are being used. If they are stored in an
- inferior frame, find_saved_register will break.
-
- On pyrs, frames of window registers are stored contiguously on a
- separate stack. All window registers are always stored.
- The pc and psw (gr15 and gr14) are also always saved: the call
- insn saves them in pr15 and pr14 of the new frame (tr15,tr14 of the
- old frame).
- The data-stack frame pointer (CFP) is only saved in functions which
- allocate a (data)stack frame (with "adsf"). We detect them by
- looking at the first insn of the procedure.
-
- Other non-window registers (gr0-gr11) are never saved. Pyramid's C
- compiler and gcc currently ignore them, so it's not an issue. */
-
-#define FRAME_FIND_SAVED_REGS(fi_p, frame_saved_regs) \
-{ register int regnum; \
- register CORE_ADDR pc; \
- register CORE_ADDR fn_start_pc; \
- register int first_insn; \
- register CORE_ADDR prev_cf_addr; \
- register int window_ptr; \
- FRAME fid = FRAME_INFO_ID (fi_p); \
- if (!fid) fatal ("Bad frame info struct in FRAME_FIND_SAVED_REGS"); \
- bzero (&(frame_saved_regs), sizeof (frame_saved_regs)); \
- \
- window_ptr = prev_cf_addr = FRAME_FP(fi_p); \
- \
- for (regnum = 16 ; regnum < 64; regnum++,window_ptr+=4) \
- { \
- (frame_saved_regs).regs[regnum] = window_ptr; \
- } \
- \
- /* In each window, psw, and pc are "saved" in tr14,tr15. */ \
- /*** psw is sometimes saved in gr12 (so sez <sys/pcb.h>) */ \
- (frame_saved_regs).regs[PS_REGNUM] = FRAME_FP(fi_p) + (14*4); \
- \
-/*(frame_saved_regs).regs[PC_REGNUM] = (frame_saved_regs).regs[31];*/ \
- (frame_saved_regs).regs[PC_REGNUM] = FRAME_FP(fi_p) + ((15+32)*4); \
- \
- /* Functions that allocate a frame save sp *where*? */ \
-/*first_insn = read_memory_integer (get_pc_function_start ((fi_p)->pc),4); */ \
- \
- fn_start_pc = (get_pc_function_start ((fi_p)->pc)); \
- first_insn = read_memory_integer(fn_start_pc, 4); \
- \
- if (0x08 == ((first_insn >> 20) &0x0ff)) { \
- /* NB: because WINDOW_REGISTER_P(cfp) is false, a saved cfp \
- in this frame is only visible in this frame's callers. \
- That means the cfp we mark saved is my caller's cfp, ie pr13. \
- I don't understand why we don't have to do that for pc, too. */ \
- \
- (frame_saved_regs).regs[CFP_REGNUM] = FRAME_FP(fi_p)+(13*4); \
- \
- (frame_saved_regs).regs[SP_REGNUM] = \
- read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4); \
- } \
- \
-/* \
- *(frame_saved_regs).regs[CFP_REGNUM] = (frame_saved_regs).regs[61]; \
- * (frame_saved_regs).regs[SP_REGNUM] = \
- * read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4); \
- */ \
- \
- (frame_saved_regs).regs[CSP_REGNUM] = prev_cf_addr; \
-}
-
-/* Things needed for making the inferior call functions. */
-#if 0
-/* These are all lies. These macro definitions are appropriate for a
- SPARC. On a pyramid, pushing a dummy frame will
- surely involve writing the control stack pointer,
- then saving the pc. This requires a privileged instruction.
- Maybe one day Pyramid can be persuaded to add a syscall to do this.
- Until then, we are out of luck. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ register CORE_ADDR sp = read_register (SP_REGNUM);\
- register int regnum; \
- sp = push_word (sp, 0); /* arglist */ \
- for (regnum = 11; regnum >= 0; regnum--) \
- sp = push_word (sp, read_register (regnum)); \
- sp = push_word (sp, read_register (PC_REGNUM)); \
- sp = push_word (sp, read_register (FP_REGNUM)); \
-/* sp = push_word (sp, read_register (AP_REGNUM));*/ \
- sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) \
- + 0x2fff0000); \
- sp = push_word (sp, 0); \
- write_register (SP_REGNUM, sp); \
- write_register (FP_REGNUM, sp); \
-/* write_register (AP_REGNUM, sp + 17 * sizeof (int));*/ }
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME \
-{ register CORE_ADDR fp = read_register (FP_REGNUM); \
- register int regnum; \
- register int regmask = read_memory_integer (fp + 4, 4); \
- write_register (PS_REGNUM, \
- (regmask & 0xffff) \
- | (read_register (PS_REGNUM) & 0xffff0000)); \
- write_register (PC_REGNUM, read_memory_integer (fp + 16, 4)); \
- write_register (FP_REGNUM, read_memory_integer (fp + 12, 4)); \
-/* write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));*/ \
- fp += 16; \
- for (regnum = 0; regnum < 12; regnum++) \
- if (regmask & (0x10000 << regnum)) \
- write_register (regnum, read_memory_integer (fp += 4, 4)); \
- fp = fp + 4 + ((regmask >> 30) & 3); \
- if (regmask & 0x20000000) \
- { regnum = read_memory_integer (fp, 4); \
- fp += (regnum + 1) * 4; } \
- write_register (SP_REGNUM, fp); \
- set_current_frame (read_register (FP_REGNUM)); }
-
-/* This sequence of words is the instructions
- calls #69, @#32323232
- bpt
- Note this is 8 bytes. */
-
-#define CALL_DUMMY {0x329f69fb, 0x03323232}
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ *((char *) dummyname + 1) = nargs; \
- *(int *)((char *) dummyname + 3) = fun; }
-#endif /* 0 */
-
-#define POP_FRAME \
- { error ("The return command is not supported on this machine."); }
diff --git a/gdb/tm-rs6000.h b/gdb/tm-rs6000.h
deleted file mode 100644
index 3b90fe3..0000000
--- a/gdb/tm-rs6000.h
+++ /dev/null
@@ -1,455 +0,0 @@
-/* Parameters for target execution on an RS6000, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
- Contributed by IBM Corporation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-extern int symtab_relocated;
-
-/* text addresses in a core file does not necessarily match to symbol table,
- if symbol table relocation wasn't done yet. */
-
-#define CORE_NEEDS_RELOCATION(PC) \
- if (!symtab_relocated && !inferior_pid && (PC) > 0x10000000) \
- (PC) -= (0x10000000 + text_adjustment (exec_bfd));
-
-/* Conversion between a register number in stab string to actual register num. */
-
-#define STAB_REG_TO_REGNUM(value) (value)
-
-/* return true if a given `pc' value is in `call dummy' function. */
-
-#define PC_IN_CALL_DUMMY(STOP_PC, STOP_SP, STOP_FRAME_ADDR) \
- (STOP_SP < STOP_PC && STOP_PC < STACK_END_ADDR)
-
-/* For each symtab, we keep track of which BFD it came from. */
-#define EXTRA_SYMTAB_INFO \
- unsigned nonreloc:1; /* TRUE if non relocatable */
-
-#define INIT_EXTRA_SYMTAB_INFO(symtab) \
- symtab->nonreloc = 0; \
-
-extern unsigned int text_start, data_start;
-extern int inferior_pid;
-extern char *corefile;
-
-/* setpgrp() messes up controling terminal. The other version of it
- requires libbsd.a. */
-#define setpgrp(XX,YY) setpgid (XX, YY)
-
-/* We are missing register descriptions in the system header files. Sigh! */
-
-struct regs {
- int gregs [32]; /* general purpose registers */
- int pc; /* program conter */
- int ps; /* processor status, or machine state */
-};
-
-struct fp_status {
- double fpregs [32]; /* floating GP registers */
-};
-
-/* Define the byte order of the machine. */
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#undef NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) pc = skip_prologue (pc)
-
-/* If PC is in some function-call trampoline code, return the PC
- where the function itself actually starts. If not, return NULL. */
-
-#define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc)
-
-/* When a child process is just starting, we sneak in and relocate
- the symbol table (and other stuff) after the dynamic linker has
- figured out where they go. */
-
-#define SOLIB_CREATE_INFERIOR_HOOK(PID) aixcoff_relocate_symtab (PID)
-
-/* When a target process or core-file has been attached, we sneak in
- and figure out where the shared libraries have got to. */
-
-#define SOLIB_ADD(a, b, c) aixcoff_relocate_symtab (inferior_pid)
-
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-extern char registers[];
-
-#define SAVED_PC_AFTER_CALL(frame) \
- (*(int*)&registers[REGISTER_BYTE (LR_REGNUM)])
-
-/*#define SAVED_PC_AFTER_CALL(frame) saved_pc_after_call(frame) */
-
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR 0x2ff80000
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-#if 0
-/* No, we shouldn't use this. push_arguments() should leave stack in a
- proper alignment! */
-/* Stack has strict alignment. */
-
-#define STACK_ALIGN(ADDR) (((ADDR)+7)&-8)
-#endif
-
-/* This is how argumets pushed onto stack or passed in registers. */
-
-#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
- sp = push_arguments(nargs, args, sp, struct_return, struct_addr)
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0x7d, 0x82, 0x10, 0x08}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. */
-/* Allow any of the return instructions, including a trapv and a return
- from interrupt. */
-
-#define ABOUT_TO_RETURN(pc) \
- ((read_memory_integer (pc, 4) & 0xfe8007ff) == 0x4e800020)
-
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
-/* Largest integer type */
-
-#define LONGEST long
-
-/* Name of the builtin type for the LONGEST type above. */
-
-#define BUILTIN_TYPE_LONGEST builtin_type_long
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 71
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES \
- {"r0", "sp", "toc", "r3", "r4", "r5", "r6", "r7", \
- "r8", "r9", "r10","r11","r12","r13","r14","r15", \
- "r16","r17","r18","r19","r20","r21","r22","r23", \
- "r24","r25","r26","r27","r28","r29","r30","r31", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10","f11","f12","f13","f14","f15", \
- "f16","f17","f18","f19","f20","f21","f22","f23", \
- "f24","f25","f26","f27","f28","f29","f30","f31", \
- "pc", "ps", "cnd", "lr", "cnt", "xer", "mq" }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define FP_REGNUM 1 /* Contains address of executing stack frame */
-#define SP_REGNUM 1 /* Contains address of top of stack */
-#define TOC_REGNUM 2 /* TOC register */
-#define FP0_REGNUM 32 /* Floating point register 0 */
-#define FPLAST_REGNUM 63 /* Last floating point register */
-
-/* Special purpose registers... */
-/* P.S. keep these in the same order as in /usr/mstsave.h `mstsave' structure, for
- easier processing */
-
-#define PC_REGNUM 64 /* Program counter (instruction address %iar) */
-#define PS_REGNUM 65 /* Processor (or machine) status (%msr) */
-#define CR_REGNUM 66 /* Condition register */
-#define LR_REGNUM 67 /* Link register */
-#define CTR_REGNUM 68 /* Count register */
-#define XER_REGNUM 69 /* Fixed point exception registers */
-#define MQ_REGNUM 70 /* Multiply/quotient register */
-
-#define FIRST_SP_REGNUM 64 /* first special register number */
-#define LAST_SP_REGNUM 70 /* last special register number */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'.
-
- 32 4-byte gpr's
- 32 8-byte fpr's
- 7 4-byte special purpose registers,
-
- total 416 bytes. Keep some extra space for now, in case to add more. */
-
-#define REGISTER_BYTES 420
-
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) \
- ( \
- ((N) > FPLAST_REGNUM) ? ((((N) - FPLAST_REGNUM -1) * 4) + 384)\
- :((N) >= FP0_REGNUM) ? ((((N) - FP0_REGNUM) * 8) + 128) \
- :((N) * 4) )
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-/* Note that the unsigned cast here forces the result of the
- subtractiion to very high positive values if N < FP0_REGNUM */
-
-#define REGISTER_RAW_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 32 ? 8 : 4)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the RS6000, all regs are 4 bytes
- except the floating point regs which are 8-byte doubles. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 32 ? 8 : 4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* convert a dbx stab register number (from `r' declaration) to a gdb REGNUM */
-
-#define STAB_REG_TO_REGNUM(value) (value)
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM && (N) <= FPLAST_REGNUM)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM))
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_RAW_SIZE (REGNUM))
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((unsigned)(N) - FP0_REGNUM) < 32 ? builtin_type_double : builtin_type_int)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-/* in RS6000, struct return addresses are passed as an extra parameter in r3.
- In function return, callee is not responsible of returning this address back.
- Since gdb needs to find it, we will store in a designated variable
- `rs6000_struct_return_address'. */
-
-extern unsigned int rs6000_struct_return_address;
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (3, (ADDR)); \
- rs6000_struct_return_address = (unsigned int)(ADDR); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-/* #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE)) */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- extract_return_value(TYPE,REGBUF,VALBUF)
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- printf ("FIXMEmgo! STORE_RETURN_VALUE not implemented yet!\n")
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) rs6000_struct_return_address
-
-
-/* Do implement the attach and detach commands. */
-
-#define ATTACH_DETACH /* FIXMEmgo! Not implemented yet! */
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the RS6000, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's address. */
-
-#define FRAME_CHAIN(thisframe) \
- (outside_startup_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- FRAMELESS = frameless_function_invocation (FI)
-
-/* Frameless function invocation in IBM RS/6000 is half-done. It perfectly
- sets up a new frame, e.g. a new frame (in fact stack) pointer, etc, but it
- doesn't save the %pc. In the following, even though it is considered a
- frameless invocation, we still need to walk one frame up. */
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
- if (fromleaf) { \
- int tmp = 0; \
- read_memory ((fi)->frame, &tmp, sizeof (int)); \
- (fi)->frame = tmp; \
- }
-
-#define FRAME_SAVED_PC(FRAME) \
- read_memory_integer (read_memory_integer ((FRAME)->frame, 4)+8, 4)
-
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Set VAL to the number of args passed to frame described by FI.
- Can set VAL to -1, meaning no way to tell. */
-
-/* We can't tell how many args there are
- now that the C compiler delays popping them. */
-
-#define FRAME_NUM_ARGS(val,fi) (val = -1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 8 /* Not sure on this. FIXMEmgo */
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
- printf ("FIXMEmgo! FRAME_FIND_SAVED_REGS() not implemented!\n")
-
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-/* Change these names into rs6k_{push, pop}_frame(). FIXMEmgo. */
-
-#define PUSH_DUMMY_FRAME push_dummy_frame ()
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-
-#define POP_FRAME pop_frame ()
-
-/* This sequence of words is the instructions:
-
- mflr r0 // 0x7c0802a6
- // save fpr's
- stfd r?, num(r1) // 0xd8010000 there should be 32 of this??
- // save gpr's
- stm r0, num(r1) // 0xbc010000
- stu r1, num(r1) // 0x94210000
-
- // the function we want to branch might be in a different load
- // segment. reset the toc register. Note that the actual toc address
- // will be fix by fix_call_dummy () along with function address.
-
- st r2, 0x14(r1) // 0x90410014 save toc register
- liu r2, 0x1234 // 0x3c401234 reset a new toc value 0x12345678
- oril r2, r2,0x5678 // 0x60425678
-
- // load absolute address 0x12345678 to r0
- liu r0, 0x1234 // 0x3c001234
- oril r0, r0,0x5678 // 0x60005678
- mtctr r0 // 0x7c0903a6 ctr <- r0
- bctrl // 0x4e800421 jump subroutine 0x12345678 (%ctr)
- cror 0xf, 0xf, 0xf // 0x4def7b82
- brpt // 0x7d821008, breakpoint
- cror 0xf, 0xf, 0xf // 0x4def7b82 (for 8 byte alignment)
-
-
- We actually start executing by saving the toc register first, since the pushing
- of the registers is done by PUSH_DUMMY_FRAME. If this were real code,
- the arguments for the function called by the `bctrl' would be pushed
- between the `stu' and the `bctrl', and we could allow it to execute through.
- But the arguments have to be pushed by GDB after the PUSH_DUMMY_FRAME is done,
- and we cannot allow to push the registers again.
-*/
-
-#define CALL_DUMMY {0x7c0802a6, 0xd8010000, 0xbc010000, 0x94210000, \
- 0x90410014, 0x3c401234, 0x60425678, \
- 0x3c001234, 0x60005678, 0x7c0903a6, 0x4e800421, \
- 0x4def7b82, 0x7d821008, 0x4def7b82 }
-
-
-/* keep this as multiple of 8 (%sp requires 8 byte alignment) */
-#define CALL_DUMMY_LENGTH 56
-
-#define CALL_DUMMY_START_OFFSET 16
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, using_gcc) \
- fix_call_dummy(dummyname, pc, fun, nargs, type)
diff --git a/gdb/tm-sparc.h b/gdb/tm-sparc.h
deleted file mode 100644
index 15d214b..0000000
--- a/gdb/tm-sparc.h
+++ /dev/null
@@ -1,588 +0,0 @@
-/* Parameters for target machine of Sun 4, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
- Contributed by Michael Tiemann (tiemann@mcc.com)
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* Floating point is IEEE compatible. */
-#define IEEE_FLOAT
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* When passing a structure to a function, Sun cc passes the address
- in a register, not the structure itself. It (under SunOS4) creates
- two symbols, so we get a LOC_ARG saying the address is on the stack
- (a lie, and a serious one since we don't know which register to
- use), and a LOC_REGISTER saying that the struct is in a register
- (sort of a lie, but fixable with REG_STRUCT_HAS_ADDR). Gcc version
- two (as of 1.92) behaves like sun cc, but I don't know how we can
- distinguish between gcc version 1 and gcc version 2.
-
- This still doesn't work if the argument is not one passed in a
- register (i.e. it's the 7th or later argument). */
-#define REG_STRUCT_HAS_ADDR(gcc_p) (!(gcc_p))
-#define STRUCT_ARG_SYM_GARBAGE(gcc_p) (!(gcc_p))
-
-/* If Pcc says that a parameter is a short, it's a short. This is
- because the parameter does get passed in in a register as an int,
- but pcc puts it onto the stack frame as a short (not nailing
- whatever else might be there. I'm not sure that I consider this
- swift. Sigh.)
-
- No, don't do this. The problem here is that pcc says that the
- argument is in the upper half of the word reserved on the stack,
- but puts it in the lower half. */
-/* #define BELIEVE_PCC_PROMOTION 1 */
-/* OK, I've added code to dbxread.c to deal with this case. */
-#define BELIEVE_PCC_PROMOTION_TYPE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances
- the PC past some of the prologue, but stops as soon as it
- knows that the function has a frame. Its result is equal
- to its input PC if the function is frameless, unequal otherwise. */
-
-#define SKIP_PROLOGUE(pc) \
- { pc = skip_prologue (pc, 0); }
-#define SKIP_PROLOGUE_FRAMELESS_P(pc) \
- { pc = skip_prologue (pc, 1); }
-extern CORE_ADDR skip_prologue ();
-
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-/* On the Sun 4 under SunOS, the compile will leave a fake insn which
- encodes the structure size being returned. If we detect such
- a fake insn, step past it. */
-
-#define PC_ADJUST(pc) sparc_pc_adjust(pc)
-extern CORE_ADDR sparc_pc_adjust();
-
-#define SAVED_PC_AFTER_CALL(frame) PC_ADJUST (read_register (RP_REGNUM))
-
-/* Address of the end of stack space. We get this from the system
- include files. */
-#include <sys/types.h>
-#include <machine/vmparam.h>
-#define STACK_END_ADDR USRSTACK
-
-#define INNER_THAN <
-
-/* Stack has strict alignment. */
-
-#define STACK_ALIGN(ADDR) (((ADDR)+7)&-8)
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. */
-/* For SPARC, this is either a "jmpl %o7+8,%g0" or "jmpl %i7+8,%g0".
-
- Note: this does not work for functions returning structures under SunOS. */
-#define ABOUT_TO_RETURN(pc) \
- ((read_memory_integer (pc, 4)|0x00040000) == 0x81c7e008)
-
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 72
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES \
-{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
- "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", \
- "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
- "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", \
- \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
- \
- "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" };
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define G0_REGNUM 0 /* %g0 */
-#define G1_REGNUM 1 /* %g1 */
-#define O0_REGNUM 8 /* %o0 */
-#define SP_REGNUM 14 /* Contains address of top of stack, \
- which is also the bottom of the frame. */
-#define RP_REGNUM 15 /* Contains return address value, *before* \
- any windows get switched. */
-#define O7_REGNUM 15 /* Last local reg not saved on stack frame */
-#define L0_REGNUM 16 /* First local reg that's saved on stack frame
- rather than in machine registers */
-#define I0_REGNUM 24 /* %i0 */
-#define FP_REGNUM 30 /* Contains address of executing stack frame */
-#define I7_REGNUM 31 /* Last local reg saved on stack frame */
-#define FP0_REGNUM 32 /* Floating point register 0 */
-#define Y_REGNUM 64 /* Temp register for multiplication, etc. */
-#define PS_REGNUM 65 /* Contains processor status */
-#define WIM_REGNUM 66 /* Window Invalid Mask (not really supported) */
-#define TBR_REGNUM 67 /* Trap Base Register (not really supported) */
-#define PC_REGNUM 68 /* Contains program counter */
-#define NPC_REGNUM 69 /* Contains next PC */
-#define FPS_REGNUM 70 /* Floating point status register */
-#define CPS_REGNUM 71 /* Coprocessor status register */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (32*4+32*4+8*4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-/* ?? */
-#define REGISTER_BYTE(N) ((N)*4)
-
-/* The SPARC processor has register windows. */
-
-#define HAVE_REGISTER_WINDOWS
-
-/* Is this register part of the register window system? A yes answer
- implies that 1) The name of this register will not be the same in
- other frames, and 2) This register is automatically "saved" (out
- registers shifting into ins counts) upon subroutine calls and thus
- there is no need to search more than one stack frame for it. */
-
-#define REGISTER_IN_WINDOW_P(regnum) \
- ((regnum) >= 8 && (regnum) < 32)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-/* On the SPARC, all regs are 4 bytes. */
-
-#define REGISTER_RAW_SIZE(N) (4)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-/* On the SPARC, all regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) (0)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
-{ bcopy ((FROM), (TO), 4); }
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
-{ bcopy ((FROM), (TO), 4); }
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) < 32 ? builtin_type_int : (N) < 64 ? builtin_type_float : \
- builtin_type_int)
-
-/* Writing to %g0 is a noop (not an error or exception or anything like
- that, however). */
-
-#define CANNOT_STORE_REGISTER(regno) ((regno) == G0_REGNUM)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { target_write_memory ((SP)+(16*4), (char *)&(ADDR), 4); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- { \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- { \
- bcopy (((int *)(REGBUF))+FP0_REGNUM, \
- (VALBUF), TYPE_LENGTH(TYPE)); \
- } \
- else \
- bcopy ((char *)(REGBUF) + 4 * 8 + \
- (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)), \
- (VALBUF), TYPE_LENGTH(TYPE)); \
- }
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-/* On sparc, values are returned in register %o0. */
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- { \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- /* Floating-point values are returned in the register pair */ \
- /* formed by %f0 and %f1 (doubles are, anyway). */ \
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM), (VALBUF), \
- TYPE_LENGTH (TYPE)); \
- else \
- /* Other values are returned in register %o0. */ \
- write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
- TYPE_LENGTH (TYPE)); \
- }
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- (sparc_extract_struct_value_address (REGBUF))
-CORE_ADDR sparc_extract_struct_value_address (
-#ifdef __STDC__
- char [REGISTER_BYTES]
-#endif
- );
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* If you're not compiling this on a sun, you'll have to get a copy
- of <sun4/reg.h> (also known as <machine/reg.h>). */
-#include <sun4/reg.h>
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the Sun 4, the frame-chain's nominal address
- is held in the frame pointer register.
-
- On the Sun4, the frame (in %fp) is %sp for the previous frame.
- From the previous frame's %sp, we can find the previous frame's
- %fp: it is in the save area just above the previous frame's %sp.
-
- If we are setting up an arbitrary frame, we'll need to know where
- it ends. Hence the following. This part of the frame cache
- structure should be checked before it is assumed that this frame's
- bottom is in the stack pointer.
-
- If there isn't a frame below this one, the bottom of this frame is
- in the stack pointer.
-
- If there is a frame below this one, and the frame pointers are
- identical, it's a leaf frame and the bottoms are the same also.
-
- Otherwise the bottom of this frame is the top of the next frame. */
-
-#define EXTRA_FRAME_INFO FRAME_ADDR bottom;
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
- (fci)->bottom = \
- ((fci)->next ? \
- ((fci)->frame == (fci)->next_frame ? \
- (fci)->next->bottom : (fci)->next->frame) : \
- read_register (SP_REGNUM));
-
-#define FRAME_CHAIN(thisframe) (sparc_frame_chain (thisframe))
-CORE_ADDR sparc_frame_chain ();
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- (FRAMELESS) = frameless_look_for_prologue(FI)
-
-/* Where is the PC for a specific frame */
-
-#define FRAME_SAVED_PC(FRAME) frame_saved_pc (FRAME)
-CORE_ADDR frame_saved_pc ();
-
-/* If the argument is on the stack, it will be here. */
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_STRUCT_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Set VAL to the number of args passed to frame described by FI.
- Can set VAL to -1, meaning no way to tell. */
-
-/* We can't tell how many args there are
- now that the C compiler delays popping them. */
-#define FRAME_NUM_ARGS(val,fi) (val = -1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 68
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- The actual code is in sparc-tdep.c so we can debug it sanely. */
-
-#define FRAME_FIND_SAVED_REGS(fi, frame_saved_regs) \
- sparc_frame_find_saved_regs ((fi), &(frame_saved_regs))
-extern void sparc_frame_find_saved_regs ();
-
-/* Things needed for making the inferior call functions. */
-/*
- * First of all, let me give my opinion of what the DUMMY_FRAME
- * actually looks like.
- *
- * | |
- * | |
- * + - - - - - - - - - - - - - - - - +<-- fp (level 0)
- * | |
- * | |
- * | |
- * | |
- * | Frame of innermost program |
- * | function |
- * | |
- * | |
- * | |
- * | |
- * | |
- * |---------------------------------|<-- sp (level 0), fp (c)
- * | |
- * DUMMY | fp0-31 |
- * | |
- * | ------ |<-- fp - 0x80
- * FRAME | g0-7 |<-- fp - 0xa0
- * | i0-7 |<-- fp - 0xc0
- * | other |<-- fp - 0xe0
- * | ? |
- * | ? |
- * |---------------------------------|<-- sp' = fp - 0x140
- * | |
- * xcution start | |
- * sp' + 0x94 -->| CALL_DUMMY (x code) |
- * | |
- * | |
- * |---------------------------------|<-- sp'' = fp - 0x200
- * | align sp to 8 byte boundary |
- * | ==> args to fn <== |
- * Room for | |
- * i & l's + agg | CALL_DUMMY_STACK_ADJUST = 0x0x44|
- * |---------------------------------|<-- final sp (variable)
- * | |
- * | Where function called will |
- * | build frame. |
- * | |
- * | |
- *
- * I understand everything in this picture except what the space
- * between fp - 0xe0 and fp - 0x140 is used for. Oh, and I don't
- * understand why there's a large chunk of CALL_DUMMY that never gets
- * executed (its function is superceeded by PUSH_DUMMY_FRAME; they
- * are designed to do the same thing).
- *
- * PUSH_DUMMY_FRAME saves the registers above sp' and pushes the
- * register file stack down one.
- *
- * call_function then writes CALL_DUMMY, pushes the args onto the
- * stack, and adjusts the stack pointer.
- *
- * run_stack_dummy then starts execution (in the middle of
- * CALL_DUMMY, as directed by call_function).
- */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME sparc_push_dummy_frame ()
-#define POP_FRAME sparc_pop_frame ()
-
-void sparc_push_dummy_frame (), sparc_pop_frame ();
-/* This sequence of words is the instructions
-
- save %sp,-0x140,%sp
- std %f30,[%fp-0x08]
- std %f28,[%fp-0x10]
- std %f26,[%fp-0x18]
- std %f24,[%fp-0x20]
- std %f22,[%fp-0x28]
- std %f20,[%fp-0x30]
- std %f18,[%fp-0x38]
- std %f16,[%fp-0x40]
- std %f14,[%fp-0x48]
- std %f12,[%fp-0x50]
- std %f10,[%fp-0x58]
- std %f8,[%fp-0x60]
- std %f6,[%fp-0x68]
- std %f4,[%fp-0x70]
- std %f2,[%fp-0x78]
- std %f0,[%fp-0x80]
- std %g6,[%fp-0x88]
- std %g4,[%fp-0x90]
- std %g2,[%fp-0x98]
- std %g0,[%fp-0xa0]
- std %i6,[%fp-0xa8]
- std %i4,[%fp-0xb0]
- std %i2,[%fp-0xb8]
- std %i0,[%fp-0xc0]
- nop ! stcsr [%fp-0xc4]
- nop ! stfsr [%fp-0xc8]
- nop ! wr %npc,[%fp-0xcc]
- nop ! wr %pc,[%fp-0xd0]
- rd %tbr,%o0
- st %o0,[%fp-0xd4]
- rd %wim,%o1
- st %o0,[%fp-0xd8]
- rd %psr,%o0
- st %o0,[%fp-0xdc]
- rd %y,%o0
- st %o0,[%fp-0xe0]
-
- /..* The arguments are pushed at this point by GDB;
- no code is needed in the dummy for this.
- The CALL_DUMMY_START_OFFSET gives the position of
- the following ld instruction. *../
-
- ld [%sp+0x58],%o5
- ld [%sp+0x54],%o4
- ld [%sp+0x50],%o3
- ld [%sp+0x4c],%o2
- ld [%sp+0x48],%o1
- call 0x00000000
- ld [%sp+0x44],%o0
- nop
- ta 1
- nop
-
- note that this is 192 bytes, which is a multiple of 8 (not only 4) bytes.
- note that the `call' insn is a relative, not an absolute call.
- note that the `nop' at the end is needed to keep the trap from
- clobbering things (if NPC pointed to garbage instead).
-
-We actually start executing at the `sethi', since the pushing of the
-registers (as arguments) is done by PUSH_DUMMY_FRAME. If this were
-real code, the arguments for the function called by the CALL would be
-pushed between the list of ST insns and the CALL, and we could allow
-it to execute through. But the arguments have to be pushed by GDB
-after the PUSH_DUMMY_FRAME is done, and we cannot allow these ST
-insns to be performed again, lest the registers saved be taken for
-arguments. */
-
-#define CALL_DUMMY { 0x9de3bee0, 0xfd3fbff8, 0xf93fbff0, 0xf53fbfe8, \
- 0xf13fbfe0, 0xed3fbfd8, 0xe93fbfd0, 0xe53fbfc8, \
- 0xe13fbfc0, 0xdd3fbfb8, 0xd93fbfb0, 0xd53fbfa8, \
- 0xd13fbfa0, 0xcd3fbf98, 0xc93fbf90, 0xc53fbf88, \
- 0xc13fbf80, 0xcc3fbf78, 0xc83fbf70, 0xc43fbf68, \
- 0xc03fbf60, 0xfc3fbf58, 0xf83fbf50, 0xf43fbf48, \
- 0xf03fbf40, 0x01000000, 0x01000000, 0x01000000, \
- 0x01000000, 0x91580000, 0xd027bf50, 0x93500000, \
- 0xd027bf4c, 0x91480000, 0xd027bf48, 0x91400000, \
- 0xd027bf44, 0xda03a058, 0xd803a054, 0xd603a050, \
- 0xd403a04c, 0xd203a048, 0x40000000, 0xd003a044, \
- 0x01000000, 0x91d02001, 0x01000000, 0x01000000}
-
-#define CALL_DUMMY_LENGTH 192
-
-#define CALL_DUMMY_START_OFFSET 148
-
-#define CALL_DUMMY_STACK_ADJUST 68
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME.
-
- For structs and unions, if the function was compiled with Sun cc,
- it expects 'unimp' after the call. But gcc doesn't use that
- (twisted) convention. So leave a nop there for gcc (FIX_CALL_DUMMY
- can assume it is operating on a pristine CALL_DUMMY, not one that
- has already been customized for a different function). */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ \
- *(int *)((char *) dummyname+168) = (0x40000000|((fun-(pc+168))>>2)); \
- if (!gcc_p \
- && (TYPE_CODE (type) == TYPE_CODE_STRUCT \
- || TYPE_CODE (type) == TYPE_CODE_UNION)) \
- *(int *)((char *) dummyname+176) = (TYPE_LENGTH (type) & 0x1fff); \
-}
-
-
-/* Sparc has no reliable single step ptrace call */
-
-#define NO_SINGLE_STEP 1
-extern void single_step ();
-
-/* We need two arguments (in general) to the "info frame" command.
- Note that the definition of this macro implies that there exists a
- function "setup_arbitrary_frame" in sparc-tdep.c */
-
-#define FRAME_SPECIFICATION_DYADIC
-
-/* To print every pair of float registers as a double, we use this hook. */
-
-#define PRINT_REGISTER_HOOK(regno) \
- if (((regno) >= FP0_REGNUM) \
- && ((regno) < FP0_REGNUM + 32) \
- && (0 == (regno & 1))) { \
- char doublereg[8]; /* two float regs */ \
- if (!read_relative_register_raw_bytes (i , doublereg ) \
- && !read_relative_register_raw_bytes (i+1, doublereg+4)) { \
- printf("\t"); \
- print_floating (doublereg, builtin_type_double, stdout); \
- } \
- }
-
diff --git a/gdb/tm-sun2.h b/gdb/tm-sun2.h
deleted file mode 100644
index 38ce53a..0000000
--- a/gdb/tm-sun2.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Parameters for execution on a Sun, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 199 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Address of the end of stack space. We get this from the system
- include files. */
-
-#include <sys/types.h>
-#include <machine/vmparam.h>
-#define STACK_END_ADDR USRSTACK
-
-#include "tm-68k.h"
diff --git a/gdb/tm-sun2os4.h b/gdb/tm-sun2os4.h
deleted file mode 100644
index 236ee5c..0000000
--- a/gdb/tm-sun2os4.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (C) 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "tm-sun2.h"
-#include "tm-sunos.h"
diff --git a/gdb/tm-sun3.h b/gdb/tm-sun3.h
deleted file mode 100644
index d7e403f..0000000
--- a/gdb/tm-sun3.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Parameters for execution on a Sun, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HAVE_68881
-
-/* Let native-versus-cross support code know we are targeting sun3,
- and modify registers to include sun3 fpustate register. */
-
-#define GDB_TARGET_IS_SUN3 1
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Address of the end of stack space. We get this from the system
- include files. */
-
-#include <sys/types.h>
-#include <machine/vmparam.h>
-#define STACK_END_ADDR USRSTACK
-
-#include "tm-68k.h"
diff --git a/gdb/tm-sun386.h b/gdb/tm-sun386.h
deleted file mode 100644
index 0af69c0..0000000
--- a/gdb/tm-sun386.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/* Parameters for execution on a Sun 386i, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
-
-#ifndef sun386
-#define sun386
-#endif
-#define GDB_TARGET_IS_SUN386 1
-#define SUNOS4
-#define USE_MACHINE_REG_H
-
-/* Perhaps some day this will work even without the following #define */
-#define COFF_ENCAPSULATE
-
-#ifdef COFF_ENCAPSULATE
-#define NAMES_HAVE_UNDERSCORE
-/* Avoid conflicts between "a.out.gnu.h" and <sys/exec.h> */
-#define _EXEC_
-#endif
-
-/* sun386 ptrace seems unable to change the frame pointer */
-#define PTRACE_FP_BUG
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) \
- (read_memory_integer (read_register (SP_REGNUM), 4))
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR 0xfc000000
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0xcc}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 1
-
-/* Nonzero if instruction at PC is a return instruction. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc3)
-
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes -- not relevant on the 386. */
-
-#define INVALID_FLOAT(p, len) (0)
-
-/* Largest integer type */
-#define LONGEST long
-
-/* Name of the builtin type for the LONGEST type above. */
-#define BUILTIN_TYPE_LONGEST builtin_type_long
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 35
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-/* the order of the first 8 registers must match the compiler's
- * numbering scheme (which is the same as the 386 scheme)
- * also, this table must match regmap in i386-pinsn.c.
- */
-#define REGISTER_NAMES { "gs", "fs", "es", "ds", \
- "edi", "esi", "ebp", "esp", \
- "ebx", "edx", "ecx", "eax", \
- "retaddr", "trapnum", "errcode", "ip", \
- "cs", "ps", "sp", "ss", \
- "fst0", "fst1", "fst2", "fst3", \
- "fst4", "fst5", "fst6", "fst7", \
- "fctrl", "fstat", "ftag", "fip", \
- "fcs", "fopoff", "fopsel" \
- }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define FP_REGNUM 6 /* Contains address of executing stack frame */
-#define SP_REGNUM 18 /* Contains address of top of stack */
-#define PS_REGNUM 17 /* Contains processor status */
-#define PC_REGNUM 15 /* Contains program counter */
-#define FP0_REGNUM 20 /* Floating point register 0 */
-#define FPC_REGNUM 28 /* 80387 control register */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (20*4+8*10+7*4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) \
- ((N) >= FPC_REGNUM ? (((N) - FPC_REGNUM) * 4) + 160 \
- : (N) >= FP0_REGNUM ? (((N) - FP0_REGNUM) * 10) + 80 \
- : (N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-#define REGISTER_RAW_SIZE(N) (((unsigned)((N) - FP0_REGNUM)) < 8 ? 10 : 4)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (((unsigned)((N) - FP0_REGNUM)) < 8 ? 8 : 4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 10
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) (((unsigned)((N) - FP0_REGNUM)) < 8)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
-{ if ((REGNUM) >= FP0_REGNUM && (REGNUM) < FPC_REGNUM) \
- i387_to_double ((FROM), (TO)); \
- else \
- bcopy ((FROM), (TO), 4); }
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
-{ if ((REGNUM) >= FP0_REGNUM && (REGNUM) < FPC_REGNUM) \
- double_to_i387 ((FROM), (TO)); \
- else \
- bcopy ((FROM), (TO), 4); }
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((unsigned)((N) - FP0_REGNUM)) < 8 ? builtin_type_double : builtin_type_int)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { (SP) -= sizeof (ADDR); \
- write_memory ((SP), &(ADDR), sizeof (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF + REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 11), VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 11), VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-#define FRAME_CHAIN(thisframe) \
- (outside_startup_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
-{ (FRAMELESS) = frameless_look_for_prologue (FI); }
-
-#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
-
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
-
-
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); }
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME { i386_pop_frame (); }
-
-/* this is
- * call 11223344 (32 bit relative)
- * int3
- */
-
-#define CALL_DUMMY { 0x223344e8, 0xcc11 }
-
-#define CALL_DUMMY_LENGTH 8
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ \
- *(int *)((char *)(dummyname) + 1) = (int)(fun) - (pc) - 5; \
-}
diff --git a/gdb/tm-sun3os4.h b/gdb/tm-sun3os4.h
deleted file mode 100644
index ab1f4fe..0000000
--- a/gdb/tm-sun3os4.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (C) 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "tm-sun3.h"
-#include "tm-sunos.h"
diff --git a/gdb/tm-sun4os4.h b/gdb/tm-sun4os4.h
deleted file mode 100644
index 6a5ad19..0000000
--- a/gdb/tm-sun4os4.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Macro definitions for GDB for a Sun 4 running sunos 4.
- Copyright (C) 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "tm-sparc.h"
-#include "tm-sunos.h"
-
-#undef STACK_END_ADDRESS
-#define STACK_END_ADDRESS 0xf8000000
diff --git a/gdb/tm-sunos.h b/gdb/tm-sunos.h
deleted file mode 100644
index 3abfe9b..0000000
--- a/gdb/tm-sunos.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This is for SunOS version 4, not for earlier versions. */
-
-#define CLEAR_SOLIB clear_solib
-extern void clear_solib ();
-
-#define SOLIB_ADD(filename, from_tty, targ) solib_add (filename, from_tty, targ)
-extern void solib_add ();
-
-#define SOLIB_CREATE_INFERIOR_HOOK solib_create_inferior_hook
-extern void solib_create_inferior_hook();
-
-/* If we can't set a breakpoint, and it's in a shared library, just
- disable it. */
-#define DISABLE_UNSETTABLE_BREAK(addr) solib_address(addr)
-extern int solib_address (); /* solib.c */
diff --git a/gdb/tm-svr4.h b/gdb/tm-svr4.h
deleted file mode 100755
index ed14214..0000000
--- a/gdb/tm-svr4.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Macro definitions for GDB on all SVR4 target systems.
- Copyright (C) 1991, Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support (fnf@cygint)
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Currently empty */
diff --git a/gdb/tm-symmetry.h b/gdb/tm-symmetry.h
deleted file mode 100644
index cf5af29..0000000
--- a/gdb/tm-symmetry.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/* Definitions to make GDB run on a Sequent Symmetry under dynix 3.0,
- with Weitek 1167 and i387 support.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Symmetry version by Jay Vosburgh (uunet!sequent!fubar) */
-
-/* I don't know if this will work for cross-debugging, even if you do get
- a copy of the right include file. */
-#include <machine/reg.h>
-
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. From m-i386.h */
-
-#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) \
- read_memory_integer(read_register(SP_REGNUM), 4)
-
-/* I don't know the real values for these. */
-#define TARGET_UPAGES UPAGES
-#define TARGET_NBPG NBPG
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR (0x40000000 - (TARGET_UPAGES * TARGET_NBPG))
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0xcc}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. */
-/* For Symmetry, this is really the 'leave' instruction, which */
-/* is right before the ret */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc9)
-
-/* Return 1 if P points to an invalid floating point value.
-*/
-
-#define INVALID_FLOAT(p, len) (0)
-
-/* code for 80387 fpu. Functions are from i386-dep.c, copied into
- * symm-dep.c.
- */
-#define FLOAT_INFO { i386_float_info(); }
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-#define NUM_REGS 49
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-/* Symmetry registers are in this weird order to match the register
- numbers in the symbol table entries. If you change the order,
- things will probably break mysteriously for no apparent reason.
- Also note that the st(0)...st(7) 387 registers are represented as
- st0...st7. */
-
-#define REGISTER_NAMES { "eax", "edx", "ecx", "st0", "st1", \
- "ebx", "esi", "edi", "st2", "st3", \
- "st4", "st5", "st6", "st7", "esp", \
- "ebp", "eip", "eflags", "fp1", "fp2", \
- "fp3", "fp4", "fp5", "fp6", "fp7", \
- "fp8", "fp9", "fp10", "fp11", "fp12", \
- "fp13", "fp14", "fp15", "fp16", "fp17", \
- "fp18", "fp19", "fp20", "fp21", "fp22", \
- "fp23", "fp24", "fp25", "fp26", "fp27", \
- "fp28", "fp29", "fp30", "fp31" }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define FP1_REGNUM 18 /* first 1167 register */
-#define SP_REGNUM 14 /* Contains address of top of stack */
-#define FP_REGNUM 15 /* Contains address of executing stack frame */
-#define PC_REGNUM 16 /* Contains program counter */
-#define PS_REGNUM 17 /* Contains processor status */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-/* 10 i386 registers, 8 i387 registers, and 31 Weitek 1167 registers */
-#define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) \
-((N < 3) ? (N * 4) : \
-(N < 5) ? (((N - 2) * 10) + 2) : \
-(N < 8) ? (((N - 5) * 4) + 32) : \
-(N < 14) ? (((N - 8) * 10) + 44) : \
- (((N - 14) * 4) + 104))
-
-/* Number of bytes of storage in the actual machine representation
- * for register N. All registers are 4 bytes, except 387 st(0) - st(7),
- * which are 80 bits each.
- */
-
-#define REGISTER_RAW_SIZE(N) \
-((N < 3) ? 4 : \
-(N < 5) ? 10 : \
-(N < 8) ? 4 : \
-(N < 14) ? 10 : \
- 4)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the vax, all regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) 4
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 10
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) \
-((N < 3) ? 0 : \
-(N < 5) ? 1 : \
-(N < 8) ? 0 : \
-(N < 14) ? 1 : \
- 0)
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
-((REGNUM < 3) ? bcopy ((FROM), (TO), 4) : \
-(REGNUM < 5) ? i387_to_double((FROM), (TO)) : \
-(REGNUM < 8) ? bcopy ((FROM), (TO), 4) : \
-(REGNUM < 14) ? i387_to_double((FROM), (TO)) : \
- bcopy ((FROM), (TO), 4))
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
-((REGNUM < 3) ? bcopy ((FROM), (TO), 4) : \
-(REGNUM < 5) ? double_to_i387((FROM), (TO)) : \
-(REGNUM < 8) ? bcopy ((FROM), (TO), 4) : \
-(REGNUM < 14) ? double_to_i387((FROM), (TO)) : \
- bcopy ((FROM), (TO), 4))
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
-((N < 3) ? builtin_type_int : \
-(N < 5) ? builtin_type_double : \
-(N < 8) ? builtin_type_int : \
-(N < 14) ? builtin_type_double : \
- builtin_type_int)
-
-/* from m-i386.h */
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { (SP) -= sizeof (ADDR); \
- write_memory ((SP), &(ADDR), sizeof (ADDR)); \
- write_register(0, (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* On Symmetry, %ebp points to caller's %ebp, and the return address
- is right on top of that. */
-
-#define FRAME_CHAIN(thisframe) \
- (outside_startup_file ((thisframe)->pc) ? \
- read_memory_integer((thisframe)->frame, 4) :\
- 0)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0)
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
- (FRAMELESS) = frameless_look_for_prologue(FI)
-
-#define FRAME_SAVED_PC(fi) (read_memory_integer((fi)->frame + 4, 4))
-
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell.
-
- The weirdness in the "addl $imm8" case is due to gcc sometimes
- issuing "addl $-int" after function call returns; this would
- produce ridiculously huge arg counts. */
-
-#define FRAME_NUM_ARGS(numargs, fi) \
-{ \
- int op = read_memory_integer(FRAME_SAVED_PC((fi)), 4); \
- int narg; \
- if ((op & 0xff) == 0x59) /* 0x59 'popl %ecx' */ \
- { \
- numargs = 1; \
- } \
- else if ((op & 0xffff) == 0xc483) /* 0xc483 'addl $imm8' */ \
- { \
- narg = ((op >> 16) & 0xff); \
- numargs = (narg >= 128) ? -1 : narg / 4; \
- } \
- else if ((op & 0xffff) == 0xc481) /* 0xc481 'addl $imm32' */ \
- { \
- narg = read_memory_integer(FRAME_SAVED_PC((fi))+2,4); \
- numargs = (narg < 0) ? -1 : narg / 4; \
- } \
- else \
- { \
- numargs = -1; \
- } \
-}
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
-
-
-/* Things needed for making the inferior call functions. */
-
-#define PUSH_DUMMY_FRAME \
-{ CORE_ADDR sp = read_register (SP_REGNUM); \
- int regnum; \
- sp = push_word (sp, read_register (PC_REGNUM)); \
- sp = push_word (sp, read_register (FP_REGNUM)); \
- write_register (FP_REGNUM, sp); \
- for (regnum = 0; regnum < NUM_REGS; regnum++) \
- sp = push_word (sp, read_register (regnum)); \
- write_register (SP_REGNUM, sp); \
-}
-
-#define POP_FRAME \
-{ \
- FRAME frame = get_current_frame (); \
- CORE_ADDR fp; \
- int regnum; \
- struct frame_saved_regs fsr; \
- struct frame_info *fi; \
- fi = get_frame_info (frame); \
- fp = fi->frame; \
- get_frame_saved_regs (fi, &fsr); \
- for (regnum = 0; regnum < NUM_REGS; regnum++) { \
- CORE_ADDR adr; \
- adr = fsr.regs[regnum]; \
- if (adr) \
- write_register (regnum, read_memory_integer (adr, 4)); \
- } \
- write_register (FP_REGNUM, read_memory_integer (fp, 4)); \
- write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \
- write_register (SP_REGNUM, fp + 8); \
- flush_cached_frames (); \
- set_current_frame ( create_new_frame (read_register (FP_REGNUM), \
- read_pc ())); \
-}
-
-/* from i386-dep.c, worked better than my original... */
-/* This sequence of words is the instructions
- * call (32-bit offset)
- * int 3
- * This is 6 bytes.
- */
-
-#define CALL_DUMMY { 0x223344e8, 0xcc11 }
-
-#define CALL_DUMMY_LENGTH 8
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ \
- int from, to, delta, loc; \
- loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
- from = loc + 5; \
- to = (int)(fun); \
- delta = to - from; \
- *(int *)((char *)(dummyname) + 1) = delta; \
-}
diff --git a/gdb/tm-tahoe.h b/gdb/tm-tahoe.h
deleted file mode 100644
index 9456808..0000000
--- a/gdb/tm-tahoe.h
+++ /dev/null
@@ -1,325 +0,0 @@
-/* Definitions to make GDB target for a tahoe running 4.3-Reno.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * Ported by the State University of New York at Buffalo by the Distributed
- * Computer Systems Lab, Department of Computer Science, 1991.
- */
-
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-#define BITS_BIG_ENDIAN 0
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 2
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) \
-{ register int op = (unsigned char) read_memory_integer (pc, 1); \
- if (op == 0x11) pc += 2; /* skip brb */ \
- if (op == 0x13) pc += 3; /* skip brw */ \
- if (op == 0x2c && \
- ((unsigned char) read_memory_integer (pc+2, 1)) == 0x5e) \
- pc += 3; /* skip subl2 */ \
- if (op == 0xe9 && \
- ((unsigned char) read_memory_integer (pc+1, 1)) == 0xae && \
- ((unsigned char) read_memory_integer(pc+3, 1)) == 0x5e) \
- pc += 4; /* skip movab */ \
- if (op == 0xe9 && \
- ((unsigned char) read_memory_integer (pc+1, 1)) == 0xce && \
- ((unsigned char) read_memory_integer(pc+4, 1)) == 0x5e) \
- pc += 5; /* skip movab */ \
- if (op == 0xe9 && \
- ((unsigned char) read_memory_integer (pc+1, 1)) == 0xee && \
- ((unsigned char) read_memory_integer(pc+6, 1)) == 0x5e) \
- pc += 7; /* skip movab */ \
-}
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) FRAME_SAVED_PC(frame)
-
-/* Wrong for cross-debugging. I don't know the real values. */
-#include <machine/param.h>
-#define TARGET_UPAGES UPAGES
-#define TARGET_NBPG NBPG
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR (0xc0000000 - (TARGET_UPAGES * TARGET_NBPG))
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR (0xc0000000 - (TARGET_UPAGES * TARGET_NBPG))
-
-/* On BSD, sigtramp is in the u area. Can't check the exact
- addresses because for cross-debugging we don't have target include
- files around. This should be close enough. */
-#define IN_SIGTRAMP(pc, name) ((pc) >= STACK_END_ADDR && (pc < 0xc0000000))
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0x30}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0x40)
-
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes -- not relevant on the Tahoe. */
-
-#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 19
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "fp", "sp", "pc", "ps", "al", "ah"}
-
-#define FP_REGNUM 13 /* Contains address of executing stack frame */
-#define SP_REGNUM 14 /* Contains address of top of stack */
-#define PC_REGNUM 15 /* Contains program counter */
-#define PS_REGNUM 16 /* Contains processor status */
-
-#define AL_REGNUM 17 /* Contains accumulator */
-#define AH_REGNUM 18
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-
-#define REGISTER_BYTES (19*4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the tahoe, all regs are 4 bytes. */
-
-#define REGISTER_RAW_SIZE(N) 4
-
-/* Number of bytes of storage in the program's representation
- for register N. On the tahoe, all regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) 4
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (1, (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller).
-
- FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the Tahoe, the frame's nominal address is the FP value,
- and it points to the old FP */
-
-#define FRAME_CHAIN(thisframe) \
- (outside_startup_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-/* Saved PC */
-
-#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame - 8, 4))
-
-/* In most of GDB, getting the args address is too important to
- just say "I don't know". */
-
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame+4)
-
-/* Address to use as an anchor for finding local variables */
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(numargs, fi) \
-{ numargs = ((0xffff & read_memory_integer(((fi)->frame-4),4)) - 4) >> 2; }
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ register int regnum; \
- register int rmask = read_memory_integer ((frame_info)->frame-4, 4) >> 16;\
- register CORE_ADDR next_addr; \
- bzero (&frame_saved_regs, sizeof frame_saved_regs); \
- next_addr = (frame_info)->frame - 8; \
- for (regnum = 12; regnum >= 0; regnum--, rmask <<= 1) \
- (frame_saved_regs).regs[regnum] = (rmask & 0x1000) ? (next_addr -= 4) : 0;\
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 4; \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame - 8; \
- (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \
-}
-
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ register CORE_ADDR sp = read_register (SP_REGNUM); \
- register int regnum; \
-printf("PUSH_DUMMY_FRAME\n"); \
- sp = push_word (sp, read_register (FP_REGNUM)); \
- write_register (FP_REGNUM, sp); \
- sp = push_word (sp, 0x1fff0004); /*SAVE MASK*/ \
- sp = push_word (sp, read_register (PC_REGNUM)); \
- for (regnum = 12; regnum >= 0; regnum--) \
- sp = push_word (sp, read_register (regnum)); \
- write_register (SP_REGNUM, sp); \
-}
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME \
-{ register CORE_ADDR fp = read_register (FP_REGNUM); \
- register int regnum; \
- register int regmask = read_memory_integer (fp-4, 4); \
-printf("POP_FRAME\n"); \
- regmask >>= 16; \
- write_register (SP_REGNUM, fp+4); \
- write_register (PC_REGNUM, read_memory_integer(fp-8, 4)); \
- write_register (FP_REGNUM, read_memory_integer(fp, 4)); \
- fp -= 8; \
- for (regnum = 12; regnum >= 0; regnum--, regmask <<= 1) \
- if (regmask & 0x1000) \
- write_register (regnum, read_memory_integer (fp-=4, 4)); \
- flush_cached_frames (); \
- set_current_frame (create_new_frame (read_register (FP_REGNUM), \
- read_pc ())); }
-
-/* This sequence of words is the instructions
- calls #69, @#32323232
- bpt
- Note this is 8 bytes. */
-
-#define CALL_DUMMY {0xbf699f32, 0x32323230}
-
-/* Start execution at beginning of dummy */
-
-#define CALL_DUMMY_START_OFFSET 0
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, valtype, using_gcc) \
-{ int temp = (int) fun; \
- *((char *) dummyname + 1) = nargs; \
- bcopy(&temp,(char *)dummyname+3,4); }
-
diff --git a/gdb/tm-ultra3.h b/gdb/tm-ultra3.h
deleted file mode 100644
index 59dcaa3..0000000
--- a/gdb/tm-ultra3.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/* Parameters for NYU Ultracomputer 29000 target, for GDB, the GNU debugger.
- Copyright 1990, 1991 Free Software Foundation, Inc.
- Contributed by David Wood @ New York University (wood@nyu.edu).
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This file includes tm-29k.h, but predefines REGISTER_NAMES and
- related macros. The file supports a 29k running our flavor of
- Unix on our Ultra3 PE Boards. */
-
-/* Byte order is configurable, but this machine runs big-endian. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer.
- */
-#define NUM_REGS (EXO_REGNUM + 1)
-
-#define REGISTER_NAMES { \
- "gr1", \
- "gr64", "gr65", "gr66", "gr67", "gr68", "gr69", "gr70", "gr71", "gr72", \
- "gr73", "gr74", "gr75", "gr76", "gr77", "gr78", "gr79", "gr80", "gr81", \
- "gr82", "gr83", "gr84", "gr85", "gr86", "gr87", "gr88", "gr89", "gr90", \
- "gr91", "gr92", "gr93", "gr94", "gr95", \
- "gr96", "gr97", "gr98", "gr99", "gr100", "gr101", "gr102", "gr103", "gr104", \
- "gr105", "gr106", "gr107", "gr108", "gr109", "gr110", "gr111", "gr112", \
- "gr113", "gr114", "gr115", "gr116", "gr117", "gr118", "gr119", "gr120", \
- "gr121", "gr122", "gr123", "gr124", "gr125", "gr126", "gr127", \
- "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", "lr8", "lr9", \
- "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", "lr16", "lr17", "lr18", \
- "lr19", "lr20", "lr21", "lr22", "lr23", "lr24", "lr25", "lr26", "lr27", \
- "lr28", "lr29", "lr30", "lr31", "lr32", "lr33", "lr34", "lr35", "lr36", \
- "lr37", "lr38", "lr39", "lr40", "lr41", "lr42", "lr43", "lr44", "lr45", \
- "lr46", "lr47", "lr48", "lr49", "lr50", "lr51", "lr52", "lr53", "lr54", \
- "lr55", "lr56", "lr57", "lr58", "lr59", "lr60", "lr61", "lr62", "lr63", \
- "lr64", "lr65", "lr66", "lr67", "lr68", "lr69", "lr70", "lr71", "lr72", \
- "lr73", "lr74", "lr75", "lr76", "lr77", "lr78", "lr79", "lr80", "lr81", \
- "lr82", "lr83", "lr84", "lr85", "lr86", "lr87", "lr88", "lr89", "lr90", \
- "lr91", "lr92", "lr93", "lr94", "lr95", "lr96", "lr97", "lr98", "lr99", \
- "lr100", "lr101", "lr102", "lr103", "lr104", "lr105", "lr106", "lr107", \
- "lr108", "lr109", "lr110", "lr111", "lr112", "lr113", "lr114", "lr115", \
- "lr116", "lr117", "lr118", "lr119", "lr120", "lr121", "lr122", "lr123", \
- "lr124", "lr125", "lr126", "lr127", \
- "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \
- "pc0", "pc1", "pc2", "mmu", "lru", \
- "ipc", "ipa", "ipb", "q", "alu", "bp", "fc", "cr", \
- "fpe", "int", "fps", "exo" }
-
-
-#ifdef KERNEL_DEBUGGING
-# define PADDR_U_REGNUM 22 /* gr86 */
-# define RETURN_REGNUM GR64_REGNUM
-#else
-# define RETURN_REGNUM GR96_REGNUM
-#endif /* KERNEL_DEBUGGING */
-
-
-/* Should rename all GR96_REGNUM to RETURN_REGNUM */
-#define GR1_REGNUM (0)
-#define GR64_REGNUM 1
-#define GR96_REGNUM (GR64_REGNUM + 32)
-/* This needs to be the memory stack pointer, not the register stack pointer,
- to make call_function work right. */
-#define SP_REGNUM MSP_REGNUM
-
-#define FP_REGNUM (LR0_REGNUM + 1) /* lr1 */
-/* Large Return Pointer */
-#define LRP_REGNUM (123 - 96 + RETURN_REGNUM)
-/* Static link pointer */
-#define SLP_REGNUM (124 - 96 + RETURN_REGNUM)
-/* Memory Stack Pointer. */
-#define MSP_REGNUM (125 - 96 + RETURN_REGNUM)
-/* Register allocate bound. */
-#define RAB_REGNUM (126 - 96 + RETURN_REGNUM)
-/* Register Free Bound. */
-#define RFB_REGNUM (127 - 96 + RETURN_REGNUM)
-/* Register Stack Pointer. */
-#define RSP_REGNUM GR1_REGNUM
-#define LR0_REGNUM ( 32 + GR96_REGNUM)
-
-/* Protected Special registers */
-#define VAB_REGNUM (LR0_REGNUM + 128)
-#define OPS_REGNUM (VAB_REGNUM + 1)
-#define CPS_REGNUM (VAB_REGNUM + 2)
-#define CFG_REGNUM (VAB_REGNUM + 3)
-#define CHA_REGNUM (VAB_REGNUM + 4)
-#define CHD_REGNUM (VAB_REGNUM + 5)
-#define CHC_REGNUM (VAB_REGNUM + 6)
-#define RBP_REGNUM (VAB_REGNUM + 7)
-#define TMC_REGNUM (VAB_REGNUM + 8)
-#define TMR_REGNUM (VAB_REGNUM + 9)
-#define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */
-#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */
-#define PC2_REGNUM (VAB_REGNUM + 12) /* pc2 */
-#define MMU_REGNUM (VAB_REGNUM + 13)
-#define LRU_REGNUM (VAB_REGNUM + 14)
- /* Register sequence gap */
-/* Unprotected Special registers */
-#define IPC_REGNUM (LRU_REGNUM + 1)
-#define IPA_REGNUM (IPC_REGNUM + 1)
-#define IPB_REGNUM (IPC_REGNUM + 2)
-#define Q_REGNUM (IPC_REGNUM + 3)
-#define ALU_REGNUM (IPC_REGNUM + 4)
-#define PS_REGNUM ALU_REGNUM
-#define BP_REGNUM (IPC_REGNUM + 5)
-#define FC_REGNUM (IPC_REGNUM + 6)
-#define CR_REGNUM (IPC_REGNUM + 7)
- /* Register sequence gap */
-#define FPE_REGNUM (CR_REGNUM + 1)
-#define INT_REGNUM (FPE_REGNUM + 1)
-#define FPS_REGNUM (FPE_REGNUM + 2)
- /* Register sequence gap */
-#define EXO_REGNUM (FPS_REGNUM + 1)
-
-/* Special register #x. */
-#define SR_REGNUM(x) \
- ((x) < 15 ? VAB_REGNUM + (x) \
- : (x) >= 128 && (x) < 136 ? IPC_REGNUM + (x-128) \
- : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x-160) \
- : (x) == 164 ? EXO_REGNUM \
- : (error ("Internal error in SR_REGNUM"), 0))
-
-#ifndef KERNEL_DEBUGGING
-/*
- * This macro defines the register numbers (from REGISTER_NAMES) that
- * are effectively unavailable to the user through ptrace(). It allows
- * us to include the whole register set in REGISTER_NAMES (inorder to
- * better support remote debugging). If it is used in
- * fetch/store_inferior_registers() gdb will not complain about I/O errors
- * on fetching these registers. If all registers in REGISTER_NAMES
- * are available, then return false (0).
- */
-#define CANNOT_STORE_REGISTER(regno) \
- (((regno)>=GR64_REGNUM && (regno)<GR64_REGNUM+32) || \
- ((regno)==VAB_REGNUM) || \
- ((regno)==OPS_REGNUM) || \
- ((regno)>=CFG_REGNUM && (regno)<=TMR_REGNUM) || \
- ((regno)==MMU_REGNUM) || \
- ((regno)==LRU_REGNUM) || \
- ((regno)>=ALU_REGNUM) || \
- ((regno)==CR_REGNUM) || \
- ((regno)==EXO_REGNUM))
-#define CANNOT_FETCH_REGISTER(regno) CANNOT_STORE_REGISTER(regno)
-#endif /* KERNEL_DEBUGGING */
-
-/*
- * Converts an sdb register number to an internal gdb register number.
- * Currently under gcc, gr96->0...gr128->31...lr0->32...lr127->159, or...
- * gr64->0...gr95->31, lr0->32...lr127->159.
- */
-#define SDB_REG_TO_REGNUM(value) (((value)<32) ? ((value)+RETURN_REGNUM) : \
- ((value)-32+LR0_REGNUM))
-
-#ifdef KERNEL_DEBUGGING
- /* ublock virtual address as defined in our sys/param.h */
- /* FIXME: Should get this from sys/param.h */
-# define UVADDR ((32*0x100000)-8192)
-#endif
-
-/*
- * Are we in sigtramp(), needed in infrun.c. Specific to ultra3, because
- * we take off the leading '_'.
- */
-#if !defined(KERNEL_DEBUGGING)
-#ifdef SYM1
-# define IN_SIGTRAMP(pc, name) (name && !strcmp ("sigtramp", name))
-#else
- Need to define IN_SIGTRAMP() for sym2.
-#endif
-#endif /* !KERNEL_DEBUGGING */
-
-#include "tm-29k.h"
-
-/**** The following are definitions that override those in tm-29k.h ****/
-
-/* This sequence of words is the instructions
- mtsrim cr, 15
- loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers
- add msp, msp, 16 * 4 ; point to the remaining arguments
- CONST_INSN:
- const gr96,inf
- consth gr96,inf
- calli lr0, gr96
- aseq 0x40,gr1,gr1 ; nop
- asneq 0x50,gr1,gr1 ; breakpoint
- When KERNEL_DEBUGGIN is defined, msp -> gr93, gr96 -> gr64,
- 7d -> 5d, 60 -> 40
- */
-
-/* Position of the "const" instruction within CALL_DUMMY in bytes. */
-#undef CALL_DUMMY
-#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
-#ifdef KERNEL_DEBUGGING /* gr96 -> gr64 */
-# define CALL_DUMMY {0x0400870f, 0x3600825d, 0x155d5d40, 0x03ff40ff, \
- 0x02ff40ff, 0xc8008040, 0x70400101, 0x72500101}
-#else
-# define CALL_DUMMY {0x0400870f, 0x3600827d, 0x157d7d40, 0x03ff60ff, \
- 0x02ff60ff, 0xc8008060, 0x70400101, 0x72500101}
-#endif /* KERNEL_DEBUGGING */
-#else /* Byte order differs. */
- you lose
-#endif /* Byte order differs. */
-
-#if !defined(KERNEL_DEBUGGING)
-# ifdef SYM1
-# undef DECR_PC_AFTER_BREAK
-# define DECR_PC_AFTER_BREAK 0 /* Sym1 kernel does the decrement */
-# else
- ->"ULTRA3 running other than sym1 OS"!;
-# endif
-#endif /* !KERNEL_DEBUGGING */
-
diff --git a/gdb/tm-umax.h b/gdb/tm-umax.h
deleted file mode 100644
index 727ffcf..0000000
--- a/gdb/tm-umax.h
+++ /dev/null
@@ -1,395 +0,0 @@
-/* Definitions to make GDB run on an encore under umax 4.2
- Copyright (C) 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Need to get function ends by adding this to epilogue address from .bf
- record, not using x_fsize field. */
-#define FUNCTION_EPILOGUE_SIZE 4
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) \
-{ register unsigned char op = read_memory_integer (pc, 1); \
- if (op == 0x82) { op = read_memory_integer (pc+2,1); \
- if ((op & 0x80) == 0) pc += 3; \
- else if ((op & 0xc0) == 0x80) pc += 4; \
- else pc += 6; \
- } \
-}
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) \
- read_memory_integer (read_register (SP_REGNUM), 4)
-
-/* Address of end of stack space. */
-
-#define STACK_END_ADDR (0xfffff000)
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0xf2}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0x12)
-
-#ifndef NaN
-#include <nan.h>
-#endif NaN
-
-/* Return 1 if P points to an invalid floating point value. */
-/* Surely wrong for cross-debugging. */
-#define INVALID_FLOAT(p, s) \
- ((s == sizeof (float))? \
- NaF (*(float *) p) : \
- NaD (*(double *) p))
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 25
-
-#define NUM_GENERAL_REGS 8
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "sp", "fp", "pc", "ps", \
- "fsr", \
- "l0", "l1", "l2", "l3", "xx", \
- }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define FP0_REGNUM 8 /* Floating point register 0 */
-#define SP_REGNUM 16 /* Contains address of top of stack */
-#define AP_REGNUM FP_REGNUM
-#define FP_REGNUM 17 /* Contains address of executing stack frame */
-#define PC_REGNUM 18 /* Contains program counter */
-#define PS_REGNUM 19 /* Contains processor status */
-#define FPS_REGNUM 20 /* Floating point status register */
-#define LP0_REGNUM 21 /* Double register 0 (same as FP0) */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES ((NUM_REGS - 4) * sizeof (int) + 4 * sizeof (double))
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N) >= LP0_REGNUM ? \
- LP0_REGNUM * 4 + ((N) - LP0_REGNUM) * 8 : (N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the 32000, all regs are 4 bytes
- except for the doubled floating registers. */
-
-#define REGISTER_RAW_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the 32000, all regs are 4 bytes
- except for the doubled floating registers. */
-
-#define REGISTER_VIRTUAL_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), REGISTER_VIRTUAL_SIZE(REGNUM));
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((N) < FP0_REGNUM) ? \
- builtin_type_int : \
- ((N) < FP0_REGNUM + 8) ? \
- builtin_type_float : \
- ((N) < LP0_REGNUM) ? \
- builtin_type_int : \
- builtin_type_double)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function.
-
- On this machine this is a no-op, because gcc isn't used on it
- yet. So this calling convention is not used. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP)
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF+REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 0), VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (REGISTER_BYTE (TYPE_CODE (TYPE) == TYPE_CODE_FLT ? FP0_REGNUM : 0), VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the ns32000 series, the frame's nominal address is the FP
- value, and at that address is saved previous FP value as a 4-byte word. */
-
-#define FRAME_CHAIN(thisframe) \
- (outside_startup_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
-
-/* Compute base of arguments. */
-
-#define FRAME_ARGS_ADDRESS(fi) \
- ((ns32k_get_enter_addr ((fi)->pc) > 1) ? \
- ((fi)->frame) : (read_register (SP_REGNUM) - 4))
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Get the address of the enter opcode for this function, if it is active.
- Returns positive address > 1 if pc is between enter/exit,
- 1 if pc before enter or after exit, 0 otherwise. */
-
-#ifndef CORE_ADDR
-#include "defs.h" /* Make sure CORE_ADDR is defined. */
-#endif
-
-extern CORE_ADDR ns32k_get_enter_addr ();
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell.
- Encore's C compiler often reuses same area on stack for args,
- so this will often not work properly. If the arg names
- are known, it's likely most of them will be printed. */
-
-#define FRAME_NUM_ARGS(numargs, fi) \
-{ CORE_ADDR pc; \
- CORE_ADDR enter_addr; \
- unsigned int insn; \
- unsigned int addr_mode; \
- int width; \
- \
- numargs = -1; \
- enter_addr = ns32k_get_enter_addr ((fi)->pc); \
- if (enter_addr > 0) \
- { \
- pc = (enter_addr == 1) ? \
- SAVED_PC_AFTER_CALL (fi) : \
- FRAME_SAVED_PC (fi); \
- insn = read_memory_integer (pc,2); \
- addr_mode = (insn >> 11) & 0x1f; \
- insn = insn & 0x7ff; \
- if ((insn & 0x7fc) == 0x57c && \
- addr_mode == 0x14) /* immediate */ \
- { \
- if (insn == 0x57c) /* adjspb */ \
- width = 1; \
- else if (insn == 0x57d) /* adjspw */ \
- width = 2; \
- else if (insn == 0x57f) /* adjspd */ \
- width = 4; \
- numargs = read_memory_integer (pc+2,width); \
- if (width > 1) \
- flip_bytes (&numargs, width); \
- numargs = - sign_extend (numargs, width*8) / 4;\
- } \
- } \
-}
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ \
- register int regmask, regnum; \
- int localcount; \
- register CORE_ADDR enter_addr; \
- register CORE_ADDR next_addr; \
- \
- bzero (&(frame_saved_regs), sizeof (frame_saved_regs)); \
- enter_addr = ns32k_get_enter_addr ((frame_info)->pc); \
- if (enter_addr > 1) \
- { \
- regmask = read_memory_integer (enter_addr+1, 1) & 0xff; \
- localcount = ns32k_localcount (enter_addr); \
- next_addr = (frame_info)->frame + localcount; \
- for (regnum = 0; regnum < 8; regnum++, regmask >>= 1) \
- (frame_saved_regs).regs[regnum] = (regmask & 1) ? \
- (next_addr -= 4) : 0; \
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 4;\
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4;\
- (frame_saved_regs).regs[FP_REGNUM] = \
- (read_memory_integer ((frame_info)->frame, 4));\
- } \
- else if (enter_addr == 1) \
- { \
- CORE_ADDR sp = read_register (SP_REGNUM); \
- (frame_saved_regs).regs[PC_REGNUM] = sp; \
- (frame_saved_regs).regs[SP_REGNUM] = sp + 4; \
- } \
-}
-
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ register CORE_ADDR sp = read_register (SP_REGNUM);\
- register int regnum; \
- sp = push_word (sp, read_register (PC_REGNUM)); \
- sp = push_word (sp, read_register (FP_REGNUM)); \
- write_register (FP_REGNUM, sp); \
- for (regnum = 0; regnum < 8; regnum++) \
- sp = push_word (sp, read_register (regnum)); \
- write_register (SP_REGNUM, sp); \
-}
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME \
-{ register FRAME frame = get_current_frame (); \
- register CORE_ADDR fp; \
- register int regnum; \
- struct frame_saved_regs fsr; \
- struct frame_info *fi; \
- fi = get_frame_info (frame); \
- fp = fi->frame; \
- get_frame_saved_regs (fi, &fsr); \
- for (regnum = 0; regnum < 8; regnum++) \
- if (fsr.regs[regnum]) \
- write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
- write_register (FP_REGNUM, read_memory_integer (fp, 4)); \
- write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \
- write_register (SP_REGNUM, fp + 8); \
- flush_cached_frames (); \
- set_current_frame (create_new_frame (read_register (FP_REGNUM),\
- read_pc ())); }
-
-/* This sequence of words is the instructions
- enter 0xff,0 82 ff 00
- jsr @0x00010203 7f ae c0 01 02 03
- adjspd 0x69696969 7f a5 01 02 03 04
- bpt f2
- Note this is 16 bytes. */
-
-#define CALL_DUMMY { 0x7f00ff82, 0x0201c0ae, 0x01a57f03, 0xf2040302 }
-
-#define CALL_DUMMY_START_OFFSET 3
-#define CALL_DUMMY_LENGTH 16
-#define CALL_DUMMY_ADDR 5
-#define CALL_DUMMY_NARGS 11
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ \
- int flipped; \
- flipped = fun | 0xc0000000; \
- flip_bytes (&flipped, 4); \
- *((int *) (((char *) dummyname)+CALL_DUMMY_ADDR)) = flipped; \
- flipped = - nargs * 4; \
- flip_bytes (&flipped, 4); \
- *((int *) (((char *) dummyname)+CALL_DUMMY_NARGS)) = flipped; \
-}
diff --git a/gdb/tm-vax.h b/gdb/tm-vax.h
deleted file mode 100644
index a91a3c7..0000000
--- a/gdb/tm-vax.h
+++ /dev/null
@@ -1,367 +0,0 @@
-/* Definitions to make GDB run on a vax under 4.2bsd.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* There is one known bug with VAX support that I don't know how to
- fix: if you do a backtrace from a signal handler, you get something
- like:
-#0 0xbc in kill (592, 3)
-#1 0x7f in hand (...) (...)
-#2 0x7fffec7e in ?? (2, 0, 2147478112, 94)
- ^^ GDB doesn't know about sigtramp
-#3 0x7fffec70 in ?? (592, 2)
- ^^^^^^^^^^ wrong address
-#4 0xae in main (...) (...)
-
-when the correct backtrace (as given by adb) is:
-_kill(250,3) from _hand+21
-_hand(2,0,7fffea60,5e) from 7fffec7e
-sigtramp(2,0,7fffea60,5e) from _kill+4
-_kill(250,2) from _main+2e
-_main(1,7fffeac4,7fffeacc) from start+3d
-
-If anyone knows enough about VAX BSD to fix this, please send the
-fix to bug-gdb@prep.ai.mit.edu. */
-
-#define TARGET_BYTE_ORDER LITTLE_ENDIAN
-
-/* Define this if the C compiler puts an underscore at the front
- of external names before giving them to the linker. */
-
-#define NAMES_HAVE_UNDERSCORE
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 2
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) \
-{ register int op = (unsigned char) read_memory_integer (pc, 1); \
- if (op == 0x11) pc += 2; /* skip brb */ \
- if (op == 0x31) pc += 3; /* skip brw */ \
- if (op == 0xC2 && \
- ((unsigned char) read_memory_integer (pc+2, 1)) == 0x5E) \
- pc += 3; /* skip subl2 */ \
- if (op == 0x9E && \
- ((unsigned char) read_memory_integer (pc+1, 1)) == 0xAE && \
- ((unsigned char) read_memory_integer(pc+3, 1)) == 0x5E) \
- pc += 4; /* skip movab */ \
- if (op == 0x9E && \
- ((unsigned char) read_memory_integer (pc+1, 1)) == 0xCE && \
- ((unsigned char) read_memory_integer(pc+4, 1)) == 0x5E) \
- pc += 5; /* skip movab */ \
- if (op == 0x9E && \
- ((unsigned char) read_memory_integer (pc+1, 1)) == 0xEE && \
- ((unsigned char) read_memory_integer(pc+6, 1)) == 0x5E) \
- pc += 7; /* skip movab */ \
-}
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) FRAME_SAVED_PC(frame)
-
-#define TARGET_UPAGES 10
-#define TARGET_NBPG 512
-#define STACK_END_ADDR (0x80000000 - (TARGET_UPAGES * TARGET_NBPG))
-
-/* On the VAX, sigtramp is in the u area. Can't check the exact
- addresses because for cross-debugging we don't have VAX include
- files around. This should be close enough. */
-#define IN_SIGTRAMP(pc, name) ((pc) >= STACK_END_ADDR && (pc < 0x80000000))
-
-/* Stack grows downward. */
-
-#define INNER_THAN <
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {3}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Nonzero if instruction at PC is a return instruction. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 04)
-
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes -- not relevant on the Vax. */
-
-#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
-
-/* Say how long (ordinary) registers are. */
-
-#define REGISTER_TYPE long
-
-/* Number of machine registers */
-
-#define NUM_REGS 17
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc", "ps"}
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define AP_REGNUM 12
-#define FP_REGNUM 13 /* Contains address of executing stack frame */
-#define SP_REGNUM 14 /* Contains address of top of stack */
-#define PC_REGNUM 15 /* Contains program counter */
-#define PS_REGNUM 16 /* Contains processor status */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (17*4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the vax, all regs are 4 bytes. */
-
-#define REGISTER_RAW_SIZE(N) 4
-
-/* Number of bytes of storage in the program's representation
- for register N. On the vax, all regs are 4 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) 4
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format. */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
- to virtual format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Convert data from virtual format for register REGNUM
- to raw format for register REGNUM. */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
- bcopy ((FROM), (TO), 4);
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (1, (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* In the case of the Vax, the frame's nominal address is the FP value,
- and 12 bytes later comes the saved previous FP value as a 4-byte word. */
-
-#define FRAME_CHAIN(thisframe) \
- (outside_startup_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame + 12, 4) :\
- 0)
-
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-/* On the vax, all functions have frames. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
-
-/* Saved Pc. */
-
-#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 16, 4))
-
-/* Cannot find the AP register value directly from the FP value. Must
- find it saved in the frame called by this one, or in the AP
- register for the innermost frame. However, there is no way to tell
- the difference between the innermost frame and a frame for which we
- just don't know the frame that it called (e.g. "info frame
- 0x7ffec789"). For the sake of argument suppose that the stack is
- somewhat trashed (which is one reason that "info frame" exists).
- So return 0 (indicating we don't know the address of
- the arglist) if we don't know what frame this frame calls. */
-#define FRAME_ARGS_ADDRESS_CORRECT(fi) \
- (((fi)->next_frame \
- ? read_memory_integer ((fi)->next_frame + 8, 4) \
- : /* read_register (AP_REGNUM) */ 0))
-
-/* In most of GDB, getting the args address is too important to
- just say "I don't know". This is sometimes wrong for functions
- that aren't on top of the stack, but c'est la vie. */
-#define FRAME_ARGS_ADDRESS(fi) \
- (((fi)->next_frame \
- ? read_memory_integer ((fi)->next_frame + 8, 4) \
- : read_register (AP_REGNUM) /* 0 */))
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(numargs, fi) \
-{ numargs = (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1)); }
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 4
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ register int regnum; \
- register int regmask = read_memory_integer ((frame_info)->frame+4, 4) >> 16; \
- register CORE_ADDR next_addr; \
- bzero (&frame_saved_regs, sizeof frame_saved_regs); \
- next_addr = (frame_info)->frame + 16; \
- /* Regmask's low bit is for register 0, \
- which is the first one that would be pushed. */ \
- for (regnum = 0; regnum < 12; regnum++, regmask >>= 1) \
- (frame_saved_regs).regs[regnum] = (regmask & 1) ? (next_addr += 4) : 0; \
- (frame_saved_regs).regs[SP_REGNUM] = next_addr + 4; \
- if (read_memory_integer ((frame_info)->frame + 4, 4) & 0x20000000) \
- (frame_saved_regs).regs[SP_REGNUM] += 4 + 4 * read_memory_integer (next_addr + 4, 4); \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 16; \
- (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 12; \
- (frame_saved_regs).regs[AP_REGNUM] = (frame_info)->frame + 8; \
- (frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4; \
-}
-
-/* Things needed for making the inferior call functions. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME \
-{ register CORE_ADDR sp = read_register (SP_REGNUM);\
- register int regnum; \
- sp = push_word (sp, 0); /* arglist */ \
- for (regnum = 11; regnum >= 0; regnum--) \
- sp = push_word (sp, read_register (regnum)); \
- sp = push_word (sp, read_register (PC_REGNUM)); \
- sp = push_word (sp, read_register (FP_REGNUM)); \
- sp = push_word (sp, read_register (AP_REGNUM)); \
- sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) \
- + 0x2fff0000); \
- sp = push_word (sp, 0); \
- write_register (SP_REGNUM, sp); \
- write_register (FP_REGNUM, sp); \
- write_register (AP_REGNUM, sp + 17 * sizeof (int)); }
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME \
-{ register CORE_ADDR fp = read_register (FP_REGNUM); \
- register int regnum; \
- register int regmask = read_memory_integer (fp + 4, 4); \
- write_register (PS_REGNUM, \
- (regmask & 0xffff) \
- | (read_register (PS_REGNUM) & 0xffff0000)); \
- write_register (PC_REGNUM, read_memory_integer (fp + 16, 4)); \
- write_register (FP_REGNUM, read_memory_integer (fp + 12, 4)); \
- write_register (AP_REGNUM, read_memory_integer (fp + 8, 4)); \
- fp += 16; \
- for (regnum = 0; regnum < 12; regnum++) \
- if (regmask & (0x10000 << regnum)) \
- write_register (regnum, read_memory_integer (fp += 4, 4)); \
- fp = fp + 4 + ((regmask >> 30) & 3); \
- if (regmask & 0x20000000) \
- { regnum = read_memory_integer (fp, 4); \
- fp += (regnum + 1) * 4; } \
- write_register (SP_REGNUM, fp); \
- flush_cached_frames (); \
- set_current_frame (create_new_frame (read_register (FP_REGNUM),\
- read_pc ())); }
-
-/* This sequence of words is the instructions
- calls #69, @#32323232
- bpt
- Note this is 8 bytes. */
-
-#define CALL_DUMMY {0x329f69fb, 0x03323232}
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ *((char *) dummyname + 1) = nargs; \
- *(int *)((char *) dummyname + 3) = fun; }
diff --git a/gdb/tm-vx68.h b/gdb/tm-vx68.h
deleted file mode 100644
index 106080e..0000000
--- a/gdb/tm-vx68.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Parameters for execution on VxWorks 68k's, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
-
-/* Kludge... */
-#include "tm-sun3.h"
-
-/* We have more complex, useful breakpoints on the target. */
-#undef DECR_PC_AFTER_BREAK
-#define DECR_PC_AFTER_BREAK 0
-
-/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
-#undef FRAME_CHAIN
-#undef FRAME_CHAIN_VALID
-
-/* Takes the current frame-struct pointer and returns the chain-pointer
- to get to the calling frame.
-
- If our current frame pointer is zero, we're at the top; else read out
- the saved FP from memory pointed to by the current FP. */
-
-#define FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0)
-
-/* If the chain pointer is zero (either because the saved value fetched
- by FRAME_CHAIN was zero, or because the current FP was zero so FRAME_CHAIN
- never fetched anything), we are at the top of the stack. */
-
-#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0)
diff --git a/gdb/tm-vx960.h b/gdb/tm-vx960.h
deleted file mode 100644
index f6a5e1f..0000000
--- a/gdb/tm-vx960.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger.
- Copyright (C) 1986-1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "tm-i960.h"
-
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
-
-/* We have more complex, useful breakpoints on the target.
- Amount ip must be decremented by after a breakpoint. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
-
-#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0)
-
-/* Breakpoint patching is handled at the target end in VxWorks. */
-/* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */
diff --git a/gdb/tm-vxworks68.h b/gdb/tm-vxworks68.h
deleted file mode 100755
index a3cd7c2..0000000
--- a/gdb/tm-vxworks68.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Parameters for execution on VxWorks 68k's, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
-
-/* Kludge... */
-#include "tm-sun3.h"
-
-/* We have more complex, useful breakpoints on the target. */
-#undef DECR_PC_AFTER_BREAK
-#define DECR_PC_AFTER_BREAK 0
-
-/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
-#undef FRAME_CHAIN
-#undef FRAME_CHAIN_VALID
-
-/* Takes the current frame-struct pointer and returns the chain-pointer
- to get to the calling frame.
-
- If our current frame pointer is zero, we're at the top; else read out
- the saved FP from memory pointed to by the current FP. */
-
-#define FRAME_CHAIN(thisframe) ((thisframe)->frame? read_memory_integer ((thisframe)->frame, 4): 0)
-
-/* If the chain pointer is zero (either because the saved value fetched
- by FRAME_CHAIN was zero, or because the current FP was zero so FRAME_CHAIN
- never fetched anything), we are at the top of the stack. */
-
-#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0)
diff --git a/gdb/tm-vxworks960.h b/gdb/tm-vxworks960.h
deleted file mode 100755
index fc5c214..0000000
--- a/gdb/tm-vxworks960.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger.
- Copyright (C) 1986-1991 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "tm-i960.h"
-
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
-
-/* We have more complex, useful breakpoints on the target.
- Amount ip must be decremented by after a breakpoint. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
-
-#define FRAME_CHAIN_VALID(chain, thisframe) (chain != 0)
-
-/* Breakpoint patching is handled at the target end in VxWorks. */
-/* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */
-
-/* Not needed, because we don't support core files:
- #define KERNEL_U_ADDR
- #define REGISTER_U_ADDR(addr, blockend, regno)
- */
-
-/* Address of end of stack space.
- This doesn't matter for VxWorks, because it's only used
- in manipulation of core files, which we don't support. */
-
-/* #define STACK_END_ADDR (0xfe000000) */
diff --git a/gdb/ultra3-xdep.c b/gdb/ultra3-xdep.c
deleted file mode 100644
index c910e3d..0000000
--- a/gdb/ultra3-xdep.c
+++ /dev/null
@@ -1,393 +0,0 @@
-/* Host-dependent code for GDB, for NYU Ultra3 running Sym1 OS.
- Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
- Contributed by David Wood (wood@nyu.edu) at New York University.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define DEBUG
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "value.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include "gdbcore.h"
-
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/ptrace.h>
-
-/* Assumes support for AMD's Binary Compatibility Standard
- for ptrace(). If you define ULTRA3, the ultra3 extensions to
- ptrace() are used allowing the reading of more than one register
- at a time.
-
- This file assumes KERNEL_DEBUGGING is turned off. This means
- that if the user/gdb tries to read gr64-gr95 or any of the
- protected special registers we silently return -1 (see the
- CANNOT_STORE/FETCH_REGISTER macros). */
-#define ULTRA3
-
-#if !defined (offsetof)
-# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
-#endif
-
-extern int errno;
-struct ptrace_user pt_struct;
-
-/*
- * Fetch an individual register (and supply it).
- * return 0 on success, -1 on failure.
- * NOTE: Assumes AMD's Binary Compatibility Standard for ptrace().
- */
-static void
-fetch_register (regno)
- int regno;
-{
- char buf[128];
- int val;
-
- if (CANNOT_FETCH_REGISTER(regno)) {
- val = -1;
- supply_register (regno, &val);
- } else {
- errno = 0;
- val = ptrace (PT_READ_U, inferior_pid, (int*)register_addr(regno,0), 0);
- if (errno != 0) {
- sprintf(buf,"reading register %s (#%d)",reg_names[regno],regno);
- perror_with_name (buf);
- } else {
- supply_register (regno, &val);
- }
- }
-}
-
-/* Get all available registers from the inferior. Registers that are
- * defined in REGISTER_NAMES, but not available to the user/gdb are
- * supplied as -1. This may include gr64-gr95 and the protected special
- * purpose registers.
- */
-
-void
-fetch_inferior_registers (regno)
- int regno;
-{
- register int i,j,ret_val=0;
- char buf[128];
-
- if (regno != -1) {
- fetch_register (regno);
- return;
- }
-
-/* Global Registers */
-#ifdef ULTRA3
- errno = 0;
- ptrace (PT_READ_STRUCT, inferior_pid, (int*)register_addr(GR96_REGNUM,0),
- (int)&pt_struct.pt_gr[0], 32*4);
- if (errno != 0) {
- perror_with_name ("reading global registers");
- ret_val = -1;
- } else for (regno=GR96_REGNUM, j=0 ; j<32 ; regno++, j++) {
- supply_register (regno, &pt_struct.pt_gr[j]);
- }
-#else
- for (regno=GR96_REGNUM ; !ret_val && regno < GR96_REGNUM+32 ; regno++)
- fetch_register(regno);
-#endif
-
-/* Local Registers */
-#ifdef ULTRA3
- errno = 0;
- ptrace (PT_READ_STRUCT, inferior_pid, (int*)register_addr(LR0_REGNUM,0),
- (int)&pt_struct.pt_lr[0], 128*4);
- if (errno != 0) {
- perror_with_name ("reading local registers");
- ret_val = -1;
- } else for (regno=LR0_REGNUM, j=0 ; j<128 ; regno++, j++) {
- supply_register (regno, &pt_struct.pt_lr[j]);
- }
-#else
- for (regno=LR0_REGNUM ; !ret_val && regno < LR0_REGNUM+128 ; regno++)
- fetch_register(regno);
-#endif
-
-/* Special Registers */
- fetch_register(GR1_REGNUM);
- fetch_register(CPS_REGNUM);
- fetch_register(PC_REGNUM);
- fetch_register(NPC_REGNUM);
- fetch_register(PC2_REGNUM);
- fetch_register(IPC_REGNUM);
- fetch_register(IPA_REGNUM);
- fetch_register(IPB_REGNUM);
- fetch_register(Q_REGNUM);
- fetch_register(BP_REGNUM);
- fetch_register(FC_REGNUM);
-
-/* Fake any registers that are in REGISTER_NAMES, but not available to gdb */
- registers_fetched();
-}
-
-/* Store our register values back into the inferior.
- * If REGNO is -1, do this for all registers.
- * Otherwise, REGNO specifies which register (so we can save time).
- * NOTE: Assumes AMD's binary compatibility standard.
- */
-
-int
-store_inferior_registers (regno)
- int regno;
-{
- register unsigned int regaddr;
- char buf[80];
-
- if (regno >= 0)
- {
- if (CANNOT_STORE_REGISTER(regno))
- return 0; /* Pretend success */
- regaddr = register_addr (regno, 0);
- errno = 0;
- ptrace (PT_WRITE_U, inferior_pid,(int*)regaddr,read_register(regno));
- if (errno != 0)
- {
- sprintf (buf, "writing register %s (#%d)", reg_names[regno],regno);
- perror_with_name (buf);
- }
- }
- else
- {
-#ifdef ULTRA3
- pt_struct.pt_gr1 = read_register(GR1_REGNUM);
- for (regno = GR96_REGNUM; regno < GR96_REGNUM+32; regno++)
- pt_struct.pt_gr[regno] = read_register(regno);
- for (regno = LR0_REGNUM; regno < LR0_REGNUM+128; regno++)
- pt_struct.pt_gr[regno] = read_register(regno);
- errno = 0;
- ptrace (PT_WRITE_STRUCT, inferior_pid, (int*)register_addr(GR1_REGNUM,0),
- (int)&pt_struct.pt_gr1,(1*32*128)*4);
- if (errno != 0)
- {
- sprintf (buf, "writing all local/global registers");
- perror_with_name (buf);
- }
- pt_struct.pt_psr = read_register(CPS_REGNUM);
- pt_struct.pt_pc0 = read_register(NPC_REGNUM);
- pt_struct.pt_pc1 = read_register(PC_REGNUM);
- pt_struct.pt_pc2 = read_register(PC2_REGNUM);
- pt_struct.pt_ipc = read_register(IPC_REGNUM);
- pt_struct.pt_ipa = read_register(IPA_REGNUM);
- pt_struct.pt_ipb = read_register(IPB_REGNUM);
- pt_struct.pt_q = read_register(Q_REGNUM);
- pt_struct.pt_bp = read_register(BP_REGNUM);
- pt_struct.pt_fc = read_register(FC_REGNUM);
- errno = 0;
- ptrace (PT_WRITE_STRUCT, inferior_pid, (int*)register_addr(CPS_REGNUM,0),
- (int)&pt_struct.pt_psr,(10)*4);
- if (errno != 0)
- {
- sprintf (buf, "writing all special registers");
- perror_with_name (buf);
- return -1;
- }
-#else
- store_inferior_registers(GR1_REGNUM);
- for (regno=GR96_REGNUM ; regno<GR96_REGNUM+32 ; regno++)
- store_inferior_registers(regno);
- for (regno=LR0_REGNUM ; regno<LR0_REGNUM+128 ; regno++)
- store_inferior_registers(regno);
- store_inferior_registers(CPS_REGNUM);
- store_inferior_registers(PC_REGNUM);
- store_inferior_registers(NPC_REGNUM);
- store_inferior_registers(PC2_REGNUM);
- store_inferior_registers(IPC_REGNUM);
- store_inferior_registers(IPA_REGNUM);
- store_inferior_registers(IPB_REGNUM);
- store_inferior_registers(Q_REGNUM);
- store_inferior_registers(BP_REGNUM);
- store_inferior_registers(FC_REGNUM);
-#endif /* ULTRA3 */
- }
- return 0;
-}
-
-/*
- * Read AMD's Binary Compatibilty Standard conforming core file.
- * struct ptrace_user is the first thing in the core file
- */
-void
-fetch_core_registers ()
-{
- register int regno;
- int val;
- char buf[4];
-
- for (regno = 0 ; regno < NUM_REGS; regno++) {
- if (!CANNOT_FETCH_REGISTER(regno)) {
- val = bfd_seek (core_bfd, register_addr (regno, 0), 0);
- if (val < 0 || (val = bfd_read (buf, sizeof buf, 1, core_bfd)) < 0) {
- char * buffer = (char *) alloca (strlen (reg_names[regno]) + 35);
- strcpy (buffer, "Reading core register ");
- strcat (buffer, reg_names[regno]);
- perror_with_name (buffer);
- }
- supply_register (regno, buf);
- }
- }
-
- /* Fake any registers that are in REGISTER_NAMES, but not available to gdb */
- registers_fetched();
-}
-
-
-/*
- * Takes a register number as defined in tm.h via REGISTER_NAMES, and maps
- * it to an offset in a struct ptrace_user defined by AMD's BCS.
- * That is, it defines the mapping between gdb register numbers and items in
- * a struct ptrace_user.
- * A register protection scheme is set up here. If a register not
- * available to the user is specified in 'regno', then an address that
- * will cause ptrace() to fail is returned.
- */
-unsigned int
-register_addr (regno,blockend)
- unsigned int regno;
- char *blockend;
-{
- if ((regno >= LR0_REGNUM) && (regno < LR0_REGNUM + 128)) {
- return(offsetof(struct ptrace_user,pt_lr[regno-LR0_REGNUM]));
- } else if ((regno >= GR96_REGNUM) && (regno < GR96_REGNUM + 32)) {
- return(offsetof(struct ptrace_user,pt_gr[regno-GR96_REGNUM]));
- } else {
- switch (regno) {
- case GR1_REGNUM: return(offsetof(struct ptrace_user,pt_gr1));
- case CPS_REGNUM: return(offsetof(struct ptrace_user,pt_psr));
- case NPC_REGNUM: return(offsetof(struct ptrace_user,pt_pc0));
- case PC_REGNUM: return(offsetof(struct ptrace_user,pt_pc1));
- case PC2_REGNUM: return(offsetof(struct ptrace_user,pt_pc2));
- case IPC_REGNUM: return(offsetof(struct ptrace_user,pt_ipc));
- case IPA_REGNUM: return(offsetof(struct ptrace_user,pt_ipa));
- case IPB_REGNUM: return(offsetof(struct ptrace_user,pt_ipb));
- case Q_REGNUM: return(offsetof(struct ptrace_user,pt_q));
- case BP_REGNUM: return(offsetof(struct ptrace_user,pt_bp));
- case FC_REGNUM: return(offsetof(struct ptrace_user,pt_fc));
- default:
- fprintf_filtered(stderr,"register_addr():Bad register %s (%d)\n",
- reg_names[regno],regno);
- return(0xffffffff); /* Should make ptrace() fail */
- }
- }
-}
-
-
-/* Assorted operating system circumventions */
-
-#ifdef SYM1
-
-/* FIXME: Kludge this for now. It really should be system call. */
-int
-getpagesize()
-{ return(8192); }
-
-/* FIXME: Fake out the fcntl() call, which we don't have. */
-fcntl(fd, cmd, arg)
-int fd, cmd, arg;
-{
-
- switch (cmd) {
- case F_GETFL: return(O_RDONLY); break;
- default:
- printf("Ultra3's fcntl() failing, cmd = %d.\n",cmd);
- return(-1);
- }
-}
-
-
-/*
- * 4.2 Signal support, requires linking with libjobs.
- */
-static int _SigMask;
-#define sigbit(s) (1L << ((s)-1))
-
-init_SigMask()
-{
- /* Taken from the sym1 kernel in machdep.c:startup() */
- _SigMask = sigbit (SIGTSTP) | sigbit (SIGTTOU) | sigbit (SIGTTIN) |
- sigbit (SIGCHLD) | sigbit (SIGTINT);
-}
-
-sigmask(signo)
- int signo;
-{
- return (1 << (signo-1));
-}
-
-sigsetmask(sigmask)
-unsigned int sigmask;
-{
- int i, mask = 1;
- int lastmask = _SigMask;
-
- for (i=0 ; i<NSIG ; i++) {
- if (sigmask & mask) {
- if (!(_SigMask & mask)) {
- sighold(i+1);
- _SigMask |= mask;
- }
- } else if (_SigMask & mask) {
- sigrelse(i+1);
- _SigMask &= ~mask;
- }
- mask <<= 1;
- }
- return (lastmask);
-}
-
-sigblock(sigmask)
-unsigned int sigmask;
-{
- int i, mask = 1;
- int lastmask = _SigMask;
-
- for (i=0 ; i<NSIG ; i++) {
- if ((sigmask & mask) && !(_SigMask & mask)) {
- sighold(i+1);
- _SigMask |= mask;
- }
- mask <<= 1;
- }
- return (lastmask);
-}
-#endif /* SYM1 */
-
-
-/* Initialization code for this module. */
-
-_initialize_ultra3 ()
-{
-#ifdef SYM1
- init_SigMask();
-#endif
-}
diff --git a/gdb/umax-xdep.c b/gdb/umax-xdep.c
deleted file mode 100644
index 8118376..0000000
--- a/gdb/umax-xdep.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/* umax host stuff.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include "gdbcore.h"
-#include <sys/ptrace.h>
-#define PTRACE_ATTACH PT_ATTACH
-#define PTRACE_DETACH PT_FREEPROC
-
-#include <sys/file.h>
-#include <sys/stat.h>
-
-/* Work with core dump and executable files, for GDB.
- This code would be in core.c if it weren't machine-dependent. */
-
-void
-core_file_command (filename, from_tty)
- char *filename;
- int from_tty;
-{
- int val;
- extern char registers[];
-
- /* Discard all vestiges of any previous core file
- and mark data and stack spaces as empty. */
-
- if (corefile)
- free (corefile);
- corefile = 0;
-
- if (corechan >= 0)
- close (corechan);
- corechan = -1;
-
- data_start = 0;
- data_end = 0;
- stack_start = STACK_END_ADDR;
- stack_end = STACK_END_ADDR;
-
- /* Now, if a new core file was specified, open it and digest it. */
-
- if (filename)
- {
- filename = tilde_expand (filename);
- make_cleanup (free, filename);
-
- if (have_inferior_p ())
- error ("To look at a core file, you must kill the inferior with \"kill\".");
- corechan = open (filename, O_RDONLY, 0);
- if (corechan < 0)
- perror_with_name (filename);
- /* 4.2-style (and perhaps also sysV-style) core dump file. */
- {
- struct ptrace_user u;
- int reg_offset;
-
- val = myread (corechan, &u, sizeof u);
- if (val < 0)
- perror_with_name (filename);
- data_start = exec_data_start;
-
- data_end = data_start + u.pt_dsize;
- stack_start = stack_end - u.pt_ssize;
- data_offset = sizeof u;
- stack_offset = data_offset + u.pt_dsize;
- reg_offset = 0;
-
- bcopy (&u.pt_aouthdr, &core_aouthdr, sizeof (AOUTHDR));
- printf ("Core file is from \"%s\".\n", u.pt_comm);
- if (u.pt_signal > 0)
- printf ("Program terminated with signal %d, %s.\n",
- u.pt_signal,
- u.pt_signal < NSIG
- ? sys_siglist[u.pt_signal]
- : "(undocumented)");
-
- /* Read the register values out of the core file and store
- them where `read_register' will find them. */
-
- {
- register int regno;
-
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- char buf[MAX_REGISTER_RAW_SIZE];
-
- val = lseek (corechan, register_addr (regno, reg_offset), 0);
- if (val < 0)
- perror_with_name (filename);
-
- val = myread (corechan, buf, sizeof buf);
- if (val < 0)
- perror_with_name (filename);
- supply_register (regno, buf);
- }
- }
- }
- if (filename[0] == '/')
- corefile = savestring (filename, strlen (filename));
- else
- {
- corefile = concat (current_directory, "/", filename, NULL);
- }
-
- set_current_frame ( create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
- select_frame (get_current_frame (), 0);
- validate_files ();
- }
- else if (from_tty)
- printf ("No core file now.\n");
-}
diff --git a/gdb/utils.c b/gdb/utils.c
deleted file mode 100644
index 36645eb..0000000
--- a/gdb/utils.c
+++ /dev/null
@@ -1,1269 +0,0 @@
-/* General utility routines for GDB, the GNU debugger.
- Copyright (C) 1986, 1989, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/param.h>
-#include <pwd.h>
-#include <varargs.h>
-#include <ctype.h>
-#include <string.h>
-
-#include "defs.h"
-#include "param.h"
-#include "signals.h"
-#include "gdbcmd.h"
-#include "terminal.h"
-#include "bfd.h"
-#include "target.h"
-
-extern volatile void return_to_top_level ();
-extern volatile void exit ();
-extern char *gdb_readline ();
-extern char *getenv();
-extern char *malloc();
-extern char *realloc();
-
-/* If this definition isn't overridden by the header files, assume
- that isatty and fileno exist on this system. */
-#ifndef ISATTY
-#define ISATTY(FP) (isatty (fileno (FP)))
-#endif
-
-#ifdef MISSING_VPRINTF
-#ifdef __GNU_LIBRARY
-#undef MISSING_VPRINTF
-#else /* !__GNU_LIBRARY */
-
-#ifndef vfprintf
-/* Can't #define it since language.c needs it (though FIXME it shouldn't) */
-void
-vfprintf (file, format, ap)
- FILE *file;
- char *format;
- va_list ap;
-{
- _doprnt (format, ap, file);
-}
-#endif /* vfprintf */
-
-#ifndef vprintf
-/* Can't #define it since printcmd.c needs it */
-void
-vprintf (format, ap)
- char *format;
- va_list ap;
-{
- vfprintf (stdout, format, ap);
-}
-#endif /* vprintf */
-
-#endif /* GNU_LIBRARY */
-#endif /* MISSING_VPRINTF */
-
-void error ();
-void fatal ();
-
-/* Chain of cleanup actions established with make_cleanup,
- to be executed if an error happens. */
-
-static struct cleanup *cleanup_chain;
-
-/* Nonzero means a quit has been requested. */
-
-int quit_flag;
-
-/* Nonzero means quit immediately if Control-C is typed now,
- rather than waiting until QUIT is executed. */
-
-int immediate_quit;
-
-/* Nonzero means that encoded C++ names should be printed out in their
- C++ form rather than raw. */
-
-int demangle = 1;
-
-/* Nonzero means that encoded C++ names should be printed out in their
- C++ form even in assembler language displays. If this is set, but
- DEMANGLE is zero, names are printed raw, i.e. DEMANGLE controls. */
-
-int asm_demangle = 0;
-
-/* Nonzero means that strings with character values >0x7F should be printed
- as octal escapes. Zero means just print the value (e.g. it's an
- international character, and the terminal or window can cope.) */
-
-int sevenbit_strings = 0;
-
-/* String to be printed before error messages, if any. */
-
-char *error_pre_print;
-char *warning_pre_print;
-
-/* Add a new cleanup to the cleanup_chain,
- and return the previous chain pointer
- to be passed later to do_cleanups or discard_cleanups.
- Args are FUNCTION to clean up with, and ARG to pass to it. */
-
-struct cleanup *
-make_cleanup (function, arg)
- void (*function) ();
- int arg;
-{
- register struct cleanup *new
- = (struct cleanup *) xmalloc (sizeof (struct cleanup));
- register struct cleanup *old_chain = cleanup_chain;
-
- new->next = cleanup_chain;
- new->function = function;
- new->arg = arg;
- cleanup_chain = new;
-
- return old_chain;
-}
-
-/* Discard cleanups and do the actions they describe
- until we get back to the point OLD_CHAIN in the cleanup_chain. */
-
-void
-do_cleanups (old_chain)
- register struct cleanup *old_chain;
-{
- register struct cleanup *ptr;
- while ((ptr = cleanup_chain) != old_chain)
- {
- cleanup_chain = ptr->next; /* Do this first incase recursion */
- (*ptr->function) (ptr->arg);
- free (ptr);
- }
-}
-
-/* Discard cleanups, not doing the actions they describe,
- until we get back to the point OLD_CHAIN in the cleanup_chain. */
-
-void
-discard_cleanups (old_chain)
- register struct cleanup *old_chain;
-{
- register struct cleanup *ptr;
- while ((ptr = cleanup_chain) != old_chain)
- {
- cleanup_chain = ptr->next;
- free (ptr);
- }
-}
-
-/* Set the cleanup_chain to 0, and return the old cleanup chain. */
-struct cleanup *
-save_cleanups ()
-{
- struct cleanup *old_chain = cleanup_chain;
-
- cleanup_chain = 0;
- return old_chain;
-}
-
-/* Restore the cleanup chain from a previously saved chain. */
-void
-restore_cleanups (chain)
- struct cleanup *chain;
-{
- cleanup_chain = chain;
-}
-
-/* This function is useful for cleanups.
- Do
-
- foo = xmalloc (...);
- old_chain = make_cleanup (free_current_contents, &foo);
-
- to arrange to free the object thus allocated. */
-
-void
-free_current_contents (location)
- char **location;
-{
- free (*location);
-}
-
-/* Provide a hook for modules wishing to print their own warning messages
- to set up the terminal state in a compatible way, without them having
- to import all the target_<...> macros. */
-
-void
-warning_setup ()
-{
- target_terminal_ours ();
- wrap_here(""); /* Force out any buffered output */
- fflush (stdout);
-}
-
-/* Print a warning message.
- The first argument STRING is the warning message, used as a fprintf string,
- and the remaining args are passed as arguments to it.
- The primary difference between warnings and errors is that a warning
- does not force the return to command level. */
-
-/* VARARGS */
-void
-warning (va_alist)
- va_dcl
-{
- va_list args;
- char *string;
-
- va_start (args);
- target_terminal_ours ();
- wrap_here(""); /* Force out any buffered output */
- fflush (stdout);
- if (warning_pre_print)
- fprintf (stderr, warning_pre_print);
- string = va_arg (args, char *);
- vfprintf (stderr, string, args);
- fprintf (stderr, "\n");
- va_end (args);
-}
-
-/* Print an error message and return to command level.
- The first argument STRING is the error message, used as a fprintf string,
- and the remaining args are passed as arguments to it. */
-
-/* VARARGS */
-void
-error (va_alist)
- va_dcl
-{
- va_list args;
- char *string;
-
- va_start (args);
- target_terminal_ours ();
- wrap_here(""); /* Force out any buffered output */
- fflush (stdout);
- if (error_pre_print)
- fprintf (stderr, error_pre_print);
- string = va_arg (args, char *);
- vfprintf (stderr, string, args);
- fprintf (stderr, "\n");
- va_end (args);
- return_to_top_level ();
-}
-
-/* Print an error message and exit reporting failure.
- This is for a error that we cannot continue from.
- The arguments are printed a la printf. */
-
-/* VARARGS */
-void
-fatal (va_alist)
- va_dcl
-{
- va_list args;
- char *string;
-
- va_start (args);
- string = va_arg (args, char *);
- fprintf (stderr, "gdb: ");
- vfprintf (stderr, string, args);
- fprintf (stderr, "\n");
- va_end (args);
- exit (1);
-}
-
-/* Print an error message and exit, dumping core.
- The arguments are printed a la printf (). */
-/* VARARGS */
-void
-fatal_dump_core (va_alist)
- va_dcl
-{
- va_list args;
- char *string;
-
- va_start (args);
- string = va_arg (args, char *);
- /* "internal error" is always correct, since GDB should never dump
- core, no matter what the input. */
- fprintf (stderr, "gdb internal error: ");
- vfprintf (stderr, string, args);
- fprintf (stderr, "\n");
- va_end (args);
-
- signal (SIGQUIT, SIG_DFL);
- kill (getpid (), SIGQUIT);
- /* We should never get here, but just in case... */
- exit (1);
-}
-
-/* Memory management stuff (malloc friends). */
-
-#if defined (NO_MALLOC_CHECK)
-void
-init_malloc ()
-{}
-#else /* Have mcheck(). */
-static void
-malloc_botch ()
-{
- fatal_dump_core ("Memory corruption");
-}
-
-void
-init_malloc ()
-{
- mcheck (malloc_botch);
- mtrace ();
-}
-#endif /* Have mcheck(). */
-
-/* Like malloc but get error if no storage available. */
-
-#ifdef __STDC__
-void *
-#else
-char *
-#endif
-xmalloc (size)
- long size;
-{
- register char *val;
-
- /* At least one place (dbxread.c:condense_misc_bunches where misc_count == 0)
- GDB wants to allocate zero bytes. */
- if (size == 0)
- return NULL;
-
- val = (char *) malloc (size);
- if (!val)
- fatal ("virtual memory exhausted.", 0);
- return val;
-}
-
-/* Like realloc but get error if no storage available. */
-
-#ifdef __STDC__
-void *
-#else
-char *
-#endif
-xrealloc (ptr, size)
- char *ptr;
- long size;
-{
- register char *val = (char *) realloc (ptr, size);
- if (!val)
- fatal ("virtual memory exhausted.", 0);
- return val;
-}
-
-/* Print the system error message for errno, and also mention STRING
- as the file name for which the error was encountered.
- Then return to command level. */
-
-void
-perror_with_name (string)
- char *string;
-{
- extern int sys_nerr;
- extern char *sys_errlist[];
- char *err;
- char *combined;
-
- if (errno < sys_nerr)
- err = sys_errlist[errno];
- else
- err = "unknown error";
-
- combined = (char *) alloca (strlen (err) + strlen (string) + 3);
- strcpy (combined, string);
- strcat (combined, ": ");
- strcat (combined, err);
-
- /* I understand setting these is a matter of taste. Still, some people
- may clear errno but not know about bfd_error. Doing this here is not
- unreasonable. */
- bfd_error = no_error;
- errno = 0;
-
- error ("%s.", combined);
-}
-
-/* Print the system error message for ERRCODE, and also mention STRING
- as the file name for which the error was encountered. */
-
-void
-print_sys_errmsg (string, errcode)
- char *string;
- int errcode;
-{
- extern int sys_nerr;
- extern char *sys_errlist[];
- char *err;
- char *combined;
-
- if (errcode < sys_nerr)
- err = sys_errlist[errcode];
- else
- err = "unknown error";
-
- combined = (char *) alloca (strlen (err) + strlen (string) + 3);
- strcpy (combined, string);
- strcat (combined, ": ");
- strcat (combined, err);
-
- printf ("%s.\n", combined);
-}
-
-/* Control C eventually causes this to be called, at a convenient time. */
-
-void
-quit ()
-{
- target_terminal_ours ();
- wrap_here ((char *)0); /* Force out any pending output */
-#ifdef HAVE_TERMIO
- ioctl (fileno (stdout), TCFLSH, 1);
-#else /* not HAVE_TERMIO */
- ioctl (fileno (stdout), TIOCFLUSH, 0);
-#endif /* not HAVE_TERMIO */
-#ifdef TIOCGPGRP
- error ("Quit");
-#else
- error ("Quit (expect signal %d when inferior is resumed)", SIGINT);
-#endif /* TIOCGPGRP */
-}
-
-/* Control C comes here */
-
-void
-request_quit ()
-{
- quit_flag = 1;
-
-#ifdef USG
- /* Restore the signal handler. */
- signal (SIGINT, request_quit);
-#endif
-
- if (immediate_quit)
- quit ();
-}
-
-/* My replacement for the read system call.
- Used like `read' but keeps going if `read' returns too soon. */
-
-int
-myread (desc, addr, len)
- int desc;
- char *addr;
- int len;
-{
- register int val;
- int orglen = len;
-
- while (len > 0)
- {
- val = read (desc, addr, len);
- if (val < 0)
- return val;
- if (val == 0)
- return orglen - len;
- len -= val;
- addr += val;
- }
- return orglen;
-}
-
-/* Make a copy of the string at PTR with SIZE characters
- (and add a null character at the end in the copy).
- Uses malloc to get the space. Returns the address of the copy. */
-
-char *
-savestring (ptr, size)
- char *ptr;
- int size;
-{
- register char *p = (char *) xmalloc (size + 1);
- bcopy (ptr, p, size);
- p[size] = 0;
- return p;
-}
-
-/* The "const" is so it compiles under DGUX (which prototypes strsave
- in <string.h>. FIXME: This should be named "xstrsave", shouldn't it?
- Doesn't real strsave return NULL if out of memory? */
-char *
-strsave (ptr)
- const char *ptr;
-{
- return savestring (ptr, strlen (ptr));
-}
-
-char *
-concat (s1, s2, s3)
- char *s1, *s2, *s3;
-{
- register int len = strlen (s1) + strlen (s2) + strlen (s3) + 1;
- register char *val = (char *) xmalloc (len);
- strcpy (val, s1);
- strcat (val, s2);
- strcat (val, s3);
- return val;
-}
-
-void
-print_spaces (n, file)
- register int n;
- register FILE *file;
-{
- while (n-- > 0)
- fputc (' ', file);
-}
-
-/* Ask user a y-or-n question and return 1 iff answer is yes.
- Takes three args which are given to printf to print the question.
- The first, a control string, should end in "? ".
- It should not say how to answer, because we do that. */
-
-/* VARARGS */
-int
-query (va_alist)
- va_dcl
-{
- va_list args;
- char *ctlstr;
- register int answer;
- register int ans2;
-
- /* Automatically answer "yes" if input is not from a terminal. */
- if (!input_from_terminal_p ())
- return 1;
-
- while (1)
- {
- va_start (args);
- ctlstr = va_arg (args, char *);
- vfprintf (stdout, ctlstr, args);
- va_end (args);
- printf ("(y or n) ");
- fflush (stdout);
- answer = fgetc (stdin);
- clearerr (stdin); /* in case of C-d */
- if (answer == EOF) /* C-d */
- return 1;
- if (answer != '\n') /* Eat rest of input line, to EOF or newline */
- do
- {
- ans2 = fgetc (stdin);
- clearerr (stdin);
- }
- while (ans2 != EOF && ans2 != '\n');
- if (answer >= 'a')
- answer -= 040;
- if (answer == 'Y')
- return 1;
- if (answer == 'N')
- return 0;
- printf ("Please answer y or n.\n");
- }
-}
-
-/* Parse a C escape sequence. STRING_PTR points to a variable
- containing a pointer to the string to parse. That pointer
- should point to the character after the \. That pointer
- is updated past the characters we use. The value of the
- escape sequence is returned.
-
- A negative value means the sequence \ newline was seen,
- which is supposed to be equivalent to nothing at all.
-
- If \ is followed by a null character, we return a negative
- value and leave the string pointer pointing at the null character.
-
- If \ is followed by 000, we return 0 and leave the string pointer
- after the zeros. A value of 0 does not mean end of string. */
-
-int
-parse_escape (string_ptr)
- char **string_ptr;
-{
- register int c = *(*string_ptr)++;
- switch (c)
- {
- case 'a':
- return 007; /* Bell (alert) char */
- case 'b':
- return '\b';
- case 'e': /* Escape character */
- return 033;
- case 'f':
- return '\f';
- case 'n':
- return '\n';
- case 'r':
- return '\r';
- case 't':
- return '\t';
- case 'v':
- return '\v';
- case '\n':
- return -2;
- case 0:
- (*string_ptr)--;
- return 0;
- case '^':
- c = *(*string_ptr)++;
- if (c == '\\')
- c = parse_escape (string_ptr);
- if (c == '?')
- return 0177;
- return (c & 0200) | (c & 037);
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- {
- register int i = c - '0';
- register int count = 0;
- while (++count < 3)
- {
- if ((c = *(*string_ptr)++) >= '0' && c <= '7')
- {
- i *= 8;
- i += c - '0';
- }
- else
- {
- (*string_ptr)--;
- break;
- }
- }
- return i;
- }
- default:
- return c;
- }
-}
-
-/* Print the character CH on STREAM as part of the contents
- of a literal string whose delimiter is QUOTER. */
-
-void
-printchar (ch, stream, quoter)
- unsigned char ch;
- FILE *stream;
- int quoter;
-{
- register int c = ch;
-
- if (c < 040 || (sevenbit_strings && c >= 0177)) {
- switch (c)
- {
- case '\n':
- fputs_filtered ("\\n", stream);
- break;
- case '\b':
- fputs_filtered ("\\b", stream);
- break;
- case '\t':
- fputs_filtered ("\\t", stream);
- break;
- case '\f':
- fputs_filtered ("\\f", stream);
- break;
- case '\r':
- fputs_filtered ("\\r", stream);
- break;
- case '\033':
- fputs_filtered ("\\e", stream);
- break;
- case '\007':
- fputs_filtered ("\\a", stream);
- break;
- default:
- fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
- break;
- }
- } else {
- if (c == '\\' || c == quoter)
- fputs_filtered ("\\", stream);
- fprintf_filtered (stream, "%c", c);
- }
-}
-
-/* Number of lines per page or UINT_MAX if paging is disabled. */
-static unsigned int lines_per_page;
-/* Number of chars per line or UNIT_MAX is line folding is disabled. */
-static unsigned int chars_per_line;
-/* Current count of lines printed on this page, chars on this line. */
-static unsigned int lines_printed, chars_printed;
-
-/* Buffer and start column of buffered text, for doing smarter word-
- wrapping. When someone calls wrap_here(), we start buffering output
- that comes through fputs_filtered(). If we see a newline, we just
- spit it out and forget about the wrap_here(). If we see another
- wrap_here(), we spit it out and remember the newer one. If we see
- the end of the line, we spit out a newline, the indent, and then
- the buffered output.
-
- wrap_column is the column number on the screen where wrap_buffer begins.
- When wrap_column is zero, wrapping is not in effect.
- wrap_buffer is malloc'd with chars_per_line+2 bytes.
- When wrap_buffer[0] is null, the buffer is empty.
- wrap_pointer points into it at the next character to fill.
- wrap_indent is the string that should be used as indentation if the
- wrap occurs. */
-
-static char *wrap_buffer, *wrap_pointer, *wrap_indent;
-static int wrap_column;
-
-/* ARGSUSED */
-static void
-set_width_command (args, from_tty, c)
- char *args;
- int from_tty;
- struct cmd_list_element *c;
-{
- if (!wrap_buffer)
- {
- wrap_buffer = (char *) xmalloc (chars_per_line + 2);
- wrap_buffer[0] = '\0';
- }
- else
- wrap_buffer = (char *) xrealloc (wrap_buffer, chars_per_line + 2);
- wrap_pointer = wrap_buffer; /* Start it at the beginning */
-}
-
-static void
-prompt_for_continue ()
-{
- char *ignore;
-
- immediate_quit++;
- ignore = gdb_readline ("---Type <return> to continue---");
- if (ignore)
- free (ignore);
- chars_printed = lines_printed = 0;
- immediate_quit--;
- dont_repeat (); /* Forget prev cmd -- CR won't repeat it. */
-}
-
-/* Reinitialize filter; ie. tell it to reset to original values. */
-
-void
-reinitialize_more_filter ()
-{
- lines_printed = 0;
- chars_printed = 0;
-}
-
-/* Indicate that if the next sequence of characters overflows the line,
- a newline should be inserted here rather than when it hits the end.
- If INDENT is nonzero, it is a string to be printed to indent the
- wrapped part on the next line. INDENT must remain accessible until
- the next call to wrap_here() or until a newline is printed through
- fputs_filtered().
-
- If the line is already overfull, we immediately print a newline and
- the indentation, and disable further wrapping.
-
- If we don't know the width of lines, but we know the page height,
- we must not wrap words, but should still keep track of newlines
- that were explicitly printed.
-
- INDENT should not contain tabs, as that
- will mess up the char count on the next line. FIXME. */
-
-void
-wrap_here(indent)
- char *indent;
-{
- if (wrap_buffer[0])
- {
- *wrap_pointer = '\0';
- fputs (wrap_buffer, stdout);
- }
- wrap_pointer = wrap_buffer;
- wrap_buffer[0] = '\0';
- if (chars_per_line == UINT_MAX) /* No line overflow checking */
- {
- wrap_column = 0;
- }
- else if (chars_printed >= chars_per_line)
- {
- puts_filtered ("\n");
- puts_filtered (indent);
- wrap_column = 0;
- }
- else
- {
- wrap_column = chars_printed;
- wrap_indent = indent;
- }
-}
-
-/* Like fputs but pause after every screenful, and can wrap at points
- other than the final character of a line.
- Unlike fputs, fputs_filtered does not return a value.
- It is OK for LINEBUFFER to be NULL, in which case just don't print
- anything.
-
- Note that a longjmp to top level may occur in this routine
- (since prompt_for_continue may do so) so this routine should not be
- called when cleanups are not in place. */
-
-void
-fputs_filtered (linebuffer, stream)
- char *linebuffer;
- FILE *stream;
-{
- char *lineptr;
-
- if (linebuffer == 0)
- return;
-
- /* Don't do any filtering if it is disabled. */
- if (stream != stdout
- || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX))
- {
- fputs (linebuffer, stream);
- return;
- }
-
- /* Go through and output each character. Show line extension
- when this is necessary; prompt user for new page when this is
- necessary. */
-
- lineptr = linebuffer;
- while (*lineptr)
- {
- /* Possible new page. */
- if (lines_printed >= lines_per_page - 1)
- prompt_for_continue ();
-
- while (*lineptr && *lineptr != '\n')
- {
- /* Print a single line. */
- if (*lineptr == '\t')
- {
- if (wrap_column)
- *wrap_pointer++ = '\t';
- else
- putc ('\t', stream);
- /* Shifting right by 3 produces the number of tab stops
- we have already passed, and then adding one and
- shifting left 3 advances to the next tab stop. */
- chars_printed = ((chars_printed >> 3) + 1) << 3;
- lineptr++;
- }
- else
- {
- if (wrap_column)
- *wrap_pointer++ = *lineptr;
- else
- putc (*lineptr, stream);
- chars_printed++;
- lineptr++;
- }
-
- if (chars_printed >= chars_per_line)
- {
- unsigned int save_chars = chars_printed;
-
- chars_printed = 0;
- lines_printed++;
- /* If we aren't actually wrapping, don't output newline --
- if chars_per_line is right, we probably just overflowed
- anyway; if it's wrong, let us keep going. */
- if (wrap_column)
- putc ('\n', stream);
-
- /* Possible new page. */
- if (lines_printed >= lines_per_page - 1)
- prompt_for_continue ();
-
- /* Now output indentation and wrapped string */
- if (wrap_column)
- {
- if (wrap_indent)
- fputs (wrap_indent, stream);
- *wrap_pointer = '\0'; /* Null-terminate saved stuff */
- fputs (wrap_buffer, stream); /* and eject it */
- /* FIXME, this strlen is what prevents wrap_indent from
- containing tabs. However, if we recurse to print it
- and count its chars, we risk trouble if wrap_indent is
- longer than (the user settable) chars_per_line.
- Note also that this can set chars_printed > chars_per_line
- if we are printing a long string. */
- chars_printed = strlen (wrap_indent)
- + (save_chars - wrap_column);
- wrap_pointer = wrap_buffer; /* Reset buffer */
- wrap_buffer[0] = '\0';
- wrap_column = 0; /* And disable fancy wrap */
- }
- }
- }
-
- if (*lineptr == '\n')
- {
- chars_printed = 0;
- wrap_here ((char *)0); /* Spit out chars, cancel further wraps */
- lines_printed++;
- putc ('\n', stream);
- lineptr++;
- }
- }
-}
-
-
-/* fputs_demangled is a variant of fputs_filtered that
- demangles g++ names.*/
-
-void
-fputs_demangled (linebuffer, stream, arg_mode)
- char *linebuffer;
- FILE *stream;
- int arg_mode;
-{
-#ifdef __STDC__
- extern char *cplus_demangle (const char *, int);
-#else
- extern char *cplus_demangle ();
-#endif
-#define SYMBOL_MAX 1024
-
-#define SYMBOL_CHAR(c) (isascii(c) \
- && (isalnum(c) || (c) == '_' || (c) == CPLUS_MARKER))
-
- char buf[SYMBOL_MAX+1];
-# define SLOP 5 /* How much room to leave in buf */
- char *p;
-
- if (linebuffer == NULL)
- return;
-
- /* If user wants to see raw output, no problem. */
- if (!demangle) {
- fputs_filtered (linebuffer, stream);
- return;
- }
-
- p = linebuffer;
-
- while ( *p != (char) 0 ) {
- int i = 0;
-
- /* collect non-interesting characters into buf */
- while ( *p != (char) 0 && !SYMBOL_CHAR(*p) && i < (int)sizeof(buf)-SLOP ) {
- buf[i++] = *p;
- p++;
- }
- if (i > 0) {
- /* output the non-interesting characters without demangling */
- buf[i] = (char) 0;
- fputs_filtered(buf, stream);
- i = 0; /* reset buf */
- }
-
- /* and now the interesting characters */
- while (i < SYMBOL_MAX
- && *p != (char) 0
- && SYMBOL_CHAR(*p)
- && i < (int)sizeof(buf) - SLOP) {
- buf[i++] = *p;
- p++;
- }
- buf[i] = (char) 0;
- if (i > 0) {
- char * result;
-
- if ( (result = cplus_demangle(buf, arg_mode)) != NULL ) {
- fputs_filtered(result, stream);
- free(result);
- }
- else {
- fputs_filtered(buf, stream);
- }
- }
- }
-}
-
-/* Print a variable number of ARGS using format FORMAT. If this
- information is going to put the amount written (since the last call
- to INITIALIZE_MORE_FILTER or the last page break) over the page size,
- print out a pause message and do a gdb_readline to get the users
- permision to continue.
-
- Unlike fprintf, this function does not return a value.
-
- We implement three variants, vfprintf (takes a vararg list and stream),
- fprintf (takes a stream to write on), and printf (the usual).
-
- Note that this routine has a restriction that the length of the
- final output line must be less than 255 characters *or* it must be
- less than twice the size of the format string. This is a very
- arbitrary restriction, but it is an internal restriction, so I'll
- put it in. This means that the %s format specifier is almost
- useless; unless the caller can GUARANTEE that the string is short
- enough, fputs_filtered should be used instead.
-
- Note also that a longjmp to top level may occur in this routine
- (since prompt_for_continue may do so) so this routine should not be
- called when cleanups are not in place. */
-
-#if !defined(MISSING_VPRINTF) || defined (vsprintf)
-/* VARARGS */
-void
-vfprintf_filtered (stream, format, args)
- va_list args;
-#else
-void fprintf_filtered (stream, format, arg1, arg2, arg3, arg4, arg5, arg6)
-#endif
- FILE *stream;
- char *format;
-{
- static char *linebuffer = (char *) 0;
- static int line_size;
- int format_length;
-
- format_length = strlen (format);
-
- /* Allocated linebuffer for the first time. */
- if (!linebuffer)
- {
- linebuffer = (char *) xmalloc (255);
- line_size = 255;
- }
-
- /* Reallocate buffer to a larger size if this is necessary. */
- if (format_length * 2 > line_size)
- {
- line_size = format_length * 2;
-
- /* You don't have to copy. */
- free (linebuffer);
- linebuffer = (char *) xmalloc (line_size);
- }
-
-
- /* This won't blow up if the restrictions described above are
- followed. */
-#if !defined(MISSING_VPRINTF) || defined (vsprintf)
- (void) vsprintf (linebuffer, format, args);
-#else
- (void) sprintf (linebuffer, format, arg1, arg2, arg3, arg4, arg5, arg6);
-#endif
-
- fputs_filtered (linebuffer, stream);
-}
-
-#if !defined(MISSING_VPRINTF) || defined (vsprintf)
-/* VARARGS */
-void
-fprintf_filtered (va_alist)
- va_dcl
-{
- va_list args;
- FILE *stream;
- char *format;
-
- va_start (args);
- stream = va_arg (args, FILE *);
- format = va_arg (args, char *);
-
- /* This won't blow up if the restrictions described above are
- followed. */
- (void) vfprintf_filtered (stream, format, args);
- va_end (args);
-}
-
-/* VARARGS */
-void
-printf_filtered (va_alist)
- va_dcl
-{
- va_list args;
- char *format;
-
- va_start (args);
- format = va_arg (args, char *);
-
- (void) vfprintf_filtered (stdout, format, args);
- va_end (args);
-}
-#else
-void
-printf_filtered (format, arg1, arg2, arg3, arg4, arg5, arg6)
- char *format;
- int arg1, arg2, arg3, arg4, arg5, arg6;
-{
- fprintf_filtered (stdout, format, arg1, arg2, arg3, arg4, arg5, arg6);
-}
-#endif
-
-/* Easy */
-
-void
-puts_filtered (string)
- char *string;
-{
- fputs_filtered (string, stdout);
-}
-
-/* Return a pointer to N spaces and a null. The pointer is good
- until the next call to here. */
-char *
-n_spaces (n)
- int n;
-{
- register char *t;
- static char *spaces;
- static int max_spaces;
-
- if (n > max_spaces)
- {
- if (spaces)
- free (spaces);
- spaces = malloc (n+1);
- for (t = spaces+n; t != spaces;)
- *--t = ' ';
- spaces[n] = '\0';
- max_spaces = n;
- }
-
- return spaces + max_spaces - n;
-}
-
-/* Print N spaces. */
-void
-print_spaces_filtered (n, stream)
- int n;
- FILE *stream;
-{
- fputs_filtered (n_spaces (n), stream);
-}
-
-/* C++ demangler stuff. */
-char *cplus_demangle ();
-
-/* Print NAME on STREAM, demangling if necessary. */
-void
-fprint_symbol (stream, name)
- FILE *stream;
- char *name;
-{
- char *demangled;
- if ((!demangle) || NULL == (demangled = cplus_demangle (name, 1)))
- fputs_filtered (name, stream);
- else
- {
- fputs_filtered (demangled, stream);
- free (demangled);
- }
-}
-
-void
-_initialize_utils ()
-{
- struct cmd_list_element *c;
-
- c = add_set_cmd ("width", class_support, var_uinteger,
- (char *)&chars_per_line,
- "Set number of characters gdb thinks are in a line.",
- &setlist);
- add_show_from_set (c, &showlist);
- c->function = set_width_command;
-
- add_show_from_set
- (add_set_cmd ("height", class_support,
- var_uinteger, (char *)&lines_per_page,
- "Set number of lines gdb thinks are in a page.", &setlist),
- &showlist);
-
- /* These defaults will be used if we are unable to get the correct
- values from termcap. */
- lines_per_page = 24;
- chars_per_line = 80;
- /* Initialize the screen height and width from termcap. */
- {
- char *termtype = getenv ("TERM");
-
- /* Positive means success, nonpositive means failure. */
- int status;
-
- /* 2048 is large enough for all known terminals, according to the
- GNU termcap manual. */
- char term_buffer[2048];
-
- if (termtype)
- {
- status = tgetent (term_buffer, termtype);
- if (status > 0)
- {
- int val;
-
- val = tgetnum ("li");
- if (val >= 0)
- lines_per_page = val;
- else
- /* The number of lines per page is not mentioned
- in the terminal description. This probably means
- that paging is not useful (e.g. emacs shell window),
- so disable paging. */
- lines_per_page = UINT_MAX;
-
- val = tgetnum ("co");
- if (val >= 0)
- chars_per_line = val;
- }
- }
- }
-
- /* If the output is not a terminal, don't paginate it. */
- if (!ISATTY (stdout))
- lines_per_page = UINT_MAX;
-
- set_width_command ((char *)NULL, 0, c);
-
- add_show_from_set
- (add_set_cmd ("demangle", class_support, var_boolean,
- (char *)&demangle,
- "Set demangling of encoded C++ names when displaying symbols.",
- &setprintlist),
- &showprintlist);
-
- add_show_from_set
- (add_set_cmd ("sevenbit-strings", class_support, var_boolean,
- (char *)&sevenbit_strings,
- "Set printing of 8-bit characters in strings as \\nnn.",
- &setprintlist),
- &showprintlist);
-
- add_show_from_set
- (add_set_cmd ("asm-demangle", class_support, var_boolean,
- (char *)&asm_demangle,
- "Set demangling of C++ names in disassembly listings.",
- &setprintlist),
- &showprintlist);
-}
diff --git a/gdb/valarith.c b/gdb/valarith.c
deleted file mode 100644
index 6269def..0000000
--- a/gdb/valarith.c
+++ /dev/null
@@ -1,694 +0,0 @@
-/* Perform arithmetic and other operations on values, for GDB.
- Copyright (C) 1986, 1989 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "param.h"
-#include "value.h"
-#include "expression.h"
-#include "target.h"
-#include <string.h>
-
-
-value value_x_binop ();
-value value_subscripted_rvalue ();
-
-value
-value_add (arg1, arg2)
- value arg1, arg2;
-{
- register value val, valint, valptr;
- register int len;
-
- COERCE_ARRAY (arg1);
- COERCE_ARRAY (arg2);
-
- if ((TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR
- || TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_PTR)
- &&
- (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_INT
- || TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_INT))
- /* Exactly one argument is a pointer, and one is an integer. */
- {
- if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR)
- {
- valptr = arg1;
- valint = arg2;
- }
- else
- {
- valptr = arg2;
- valint = arg1;
- }
- len = TYPE_LENGTH (TYPE_TARGET_TYPE (VALUE_TYPE (valptr)));
- if (len == 0) len = 1; /* For (void *) */
- val = value_from_long (builtin_type_long,
- value_as_long (valptr)
- + (len * value_as_long (valint)));
- VALUE_TYPE (val) = VALUE_TYPE (valptr);
- return val;
- }
-
- return value_binop (arg1, arg2, BINOP_ADD);
-}
-
-value
-value_sub (arg1, arg2)
- value arg1, arg2;
-{
- register value val;
-
- COERCE_ARRAY (arg1);
- COERCE_ARRAY (arg2);
-
- if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR)
- {
- if (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_INT)
- {
- /* pointer - integer. */
- val = value_from_long
- (builtin_type_long,
- value_as_long (arg1)
- - (TYPE_LENGTH (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)))
- * value_as_long (arg2)));
- VALUE_TYPE (val) = VALUE_TYPE (arg1);
- return val;
- }
- else if (VALUE_TYPE (arg1) == VALUE_TYPE (arg2))
- {
- /* pointer to <type x> - pointer to <type x>. */
- val = value_from_long
- (builtin_type_long,
- (value_as_long (arg1) - value_as_long (arg2))
- / TYPE_LENGTH (TYPE_TARGET_TYPE (VALUE_TYPE (arg1))));
- return val;
- }
- else
- {
- error ("\
-First argument of `-' is a pointer and second argument is neither\n\
-an integer nor a pointer of the same type.");
- }
- }
-
- return value_binop (arg1, arg2, BINOP_SUB);
-}
-
-/* Return the value of ARRAY[IDX]. */
-
-value
-value_subscript (array, idx)
- value array, idx;
-{
- if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_ARRAY
- && VALUE_LVAL (array) != lval_memory)
- return value_subscripted_rvalue (array, idx);
- else
- return value_ind (value_add (array, idx));
-}
-
-/* Return the value of EXPR[IDX], expr an aggregate rvalue
- (eg, a vector register). This routine used to promote floats
- to doubles, but no longer does. */
-
-value
-value_subscripted_rvalue (array, idx)
- value array, idx;
-{
- struct type *elt_type = TYPE_TARGET_TYPE (VALUE_TYPE (array));
- int elt_size = TYPE_LENGTH (elt_type);
- int elt_offs = elt_size * value_as_long (idx);
- value v;
-
- if (elt_offs >= TYPE_LENGTH (VALUE_TYPE (array)))
- error ("no such vector element");
-
- v = allocate_value (elt_type);
- bcopy (VALUE_CONTENTS (array) + elt_offs, VALUE_CONTENTS (v), elt_size);
-
- if (VALUE_LVAL (array) == lval_internalvar)
- VALUE_LVAL (v) = lval_internalvar_component;
- else
- VALUE_LVAL (v) = not_lval;
- VALUE_ADDRESS (v) = VALUE_ADDRESS (array);
- VALUE_OFFSET (v) = VALUE_OFFSET (array) + elt_offs;
- VALUE_BITSIZE (v) = elt_size * 8;
- return v;
-}
-
-/* Check to see if either argument is a structure. This is called so
- we know whether to go ahead with the normal binop or look for a
- user defined function instead.
-
- For now, we do not overload the `=' operator. */
-
-int
-binop_user_defined_p (op, arg1, arg2)
- enum exp_opcode op;
- value arg1, arg2;
-{
- if (op == BINOP_ASSIGN)
- return 0;
- return (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_STRUCT
- || TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_STRUCT
- || (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_REF
- && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1))) == TYPE_CODE_STRUCT)
- || (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_REF
- && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) == TYPE_CODE_STRUCT));
-}
-
-/* Check to see if argument is a structure. This is called so
- we know whether to go ahead with the normal unop or look for a
- user defined function instead.
-
- For now, we do not overload the `&' operator. */
-
-int unop_user_defined_p (op, arg1)
- enum exp_opcode op;
- value arg1;
-{
- if (op == UNOP_ADDR)
- return 0;
- return (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_STRUCT
- || (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_REF
- && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1))) == TYPE_CODE_STRUCT));
-}
-
-/* We know either arg1 or arg2 is a structure, so try to find the right
- user defined function. Create an argument vector that calls
- arg1.operator @ (arg1,arg2) and return that value (where '@' is any
- binary operator which is legal for GNU C++). */
-
-value
-value_x_binop (arg1, arg2, op, otherop)
- value arg1, arg2;
- enum exp_opcode op, otherop;
-{
- value * argvec;
- char *ptr;
- char tstr[13];
- int static_memfuncp;
-
- COERCE_ENUM (arg1);
- COERCE_ENUM (arg2);
-
- /* now we know that what we have to do is construct our
- arg vector and find the right function to call it with. */
-
- if (TYPE_CODE (VALUE_TYPE (arg1)) != TYPE_CODE_STRUCT)
- error ("Can't do that binary op on that type"); /* FIXME be explicit */
-
- argvec = (value *) alloca (sizeof (value) * 4);
- argvec[1] = value_addr (arg1);
- argvec[2] = arg2;
- argvec[3] = 0;
-
- /* make the right function name up */
- strcpy(tstr, "operator__");
- ptr = tstr+8;
- switch (op)
- {
- case BINOP_ADD: strcpy(ptr,"+"); break;
- case BINOP_SUB: strcpy(ptr,"-"); break;
- case BINOP_MUL: strcpy(ptr,"*"); break;
- case BINOP_DIV: strcpy(ptr,"/"); break;
- case BINOP_REM: strcpy(ptr,"%"); break;
- case BINOP_LSH: strcpy(ptr,"<<"); break;
- case BINOP_RSH: strcpy(ptr,">>"); break;
- case BINOP_LOGAND: strcpy(ptr,"&"); break;
- case BINOP_LOGIOR: strcpy(ptr,"|"); break;
- case BINOP_LOGXOR: strcpy(ptr,"^"); break;
- case BINOP_AND: strcpy(ptr,"&&"); break;
- case BINOP_OR: strcpy(ptr,"||"); break;
- case BINOP_MIN: strcpy(ptr,"<?"); break;
- case BINOP_MAX: strcpy(ptr,">?"); break;
- case BINOP_ASSIGN: strcpy(ptr,"="); break;
- case BINOP_ASSIGN_MODIFY:
- switch (otherop)
- {
- case BINOP_ADD: strcpy(ptr,"+="); break;
- case BINOP_SUB: strcpy(ptr,"-="); break;
- case BINOP_MUL: strcpy(ptr,"*="); break;
- case BINOP_DIV: strcpy(ptr,"/="); break;
- case BINOP_REM: strcpy(ptr,"%="); break;
- case BINOP_LOGAND: strcpy(ptr,"&="); break;
- case BINOP_LOGIOR: strcpy(ptr,"|="); break;
- case BINOP_LOGXOR: strcpy(ptr,"^="); break;
- default:
- error ("Invalid binary operation specified.");
- }
- break;
- case BINOP_SUBSCRIPT: strcpy(ptr,"[]"); break;
- case BINOP_EQUAL: strcpy(ptr,"=="); break;
- case BINOP_NOTEQUAL: strcpy(ptr,"!="); break;
- case BINOP_LESS: strcpy(ptr,"<"); break;
- case BINOP_GTR: strcpy(ptr,">"); break;
- case BINOP_GEQ: strcpy(ptr,">="); break;
- case BINOP_LEQ: strcpy(ptr,"<="); break;
- default:
- error ("Invalid binary operation specified.");
- }
- argvec[0] = value_struct_elt (&arg1, argvec+1, tstr, &static_memfuncp, "structure");
- if (argvec[0])
- {
- if (static_memfuncp)
- {
- argvec[1] = argvec[0];
- argvec++;
- }
- return target_call_function (argvec[0], 2 - static_memfuncp, argvec + 1);
- }
- error ("member function %s not found", tstr);
-#ifdef lint
- return target_call_function (argvec[0], 2 - static_memfuncp, argvec + 1);
-#endif
-}
-
-/* We know that arg1 is a structure, so try to find a unary user
- defined operator that matches the operator in question.
- Create an argument vector that calls arg1.operator @ (arg1)
- and return that value (where '@' is (almost) any unary operator which
- is legal for GNU C++). */
-
-value
-value_x_unop (arg1, op)
- value arg1;
- enum exp_opcode op;
-{
- value * argvec;
- char *ptr;
- char tstr[13];
- int static_memfuncp;
-
- COERCE_ENUM (arg1);
-
- /* now we know that what we have to do is construct our
- arg vector and find the right function to call it with. */
-
- if (TYPE_CODE (VALUE_TYPE (arg1)) != TYPE_CODE_STRUCT)
- error ("Can't do that unary op on that type"); /* FIXME be explicit */
-
- argvec = (value *) alloca (sizeof (value) * 3);
- argvec[1] = value_addr (arg1);
- argvec[2] = 0;
-
- /* make the right function name up */
- strcpy(tstr,"operator__");
- ptr = tstr+8;
- switch (op)
- {
- case UNOP_PREINCREMENT: strcpy(ptr,"++"); break;
- case UNOP_PREDECREMENT: strcpy(ptr,"++"); break;
- case UNOP_POSTINCREMENT: strcpy(ptr,"++"); break;
- case UNOP_POSTDECREMENT: strcpy(ptr,"++"); break;
- case UNOP_ZEROP: strcpy(ptr,"!"); break;
- case UNOP_LOGNOT: strcpy(ptr,"~"); break;
- case UNOP_NEG: strcpy(ptr,"-"); break;
- default:
- error ("Invalid binary operation specified.");
- }
- argvec[0] = value_struct_elt (&arg1, argvec+1, tstr, &static_memfuncp, "structure");
- if (argvec[0])
- {
- if (static_memfuncp)
- {
- argvec[1] = argvec[0];
- argvec++;
- }
- return target_call_function (argvec[0], 1 - static_memfuncp, argvec + 1);
- }
- error ("member function %s not found", tstr);
- return 0; /* For lint -- never reached */
-}
-
-/* Perform a binary operation on two integers or two floats.
- Does not support addition and subtraction on pointers;
- use value_add or value_sub if you want to handle those possibilities. */
-
-value
-value_binop (arg1, arg2, op)
- value arg1, arg2;
- int op;
-{
- register value val;
-
- COERCE_ENUM (arg1);
- COERCE_ENUM (arg2);
-
- if ((TYPE_CODE (VALUE_TYPE (arg1)) != TYPE_CODE_FLT
- &&
- TYPE_CODE (VALUE_TYPE (arg1)) != TYPE_CODE_INT)
- ||
- (TYPE_CODE (VALUE_TYPE (arg2)) != TYPE_CODE_FLT
- &&
- TYPE_CODE (VALUE_TYPE (arg2)) != TYPE_CODE_INT))
- error ("Argument to arithmetic operation not a number.");
-
- if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_FLT
- ||
- TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_FLT)
- {
- double v1, v2, v;
- v1 = value_as_double (arg1);
- v2 = value_as_double (arg2);
- switch (op)
- {
- case BINOP_ADD:
- v = v1 + v2;
- break;
-
- case BINOP_SUB:
- v = v1 - v2;
- break;
-
- case BINOP_MUL:
- v = v1 * v2;
- break;
-
- case BINOP_DIV:
- v = v1 / v2;
- break;
-
- default:
- error ("Integer-only operation on floating point number.");
- }
-
- val = allocate_value (builtin_type_double);
- SWAP_TARGET_AND_HOST (&v, sizeof (v));
- *(double *) VALUE_CONTENTS_RAW (val) = v;
- }
- else
- /* Integral operations here. */
- {
- /* Should we promote to unsigned longest? */
- if ((TYPE_UNSIGNED (VALUE_TYPE (arg1))
- || TYPE_UNSIGNED (VALUE_TYPE (arg2)))
- && (TYPE_LENGTH (VALUE_TYPE (arg1)) >= sizeof (unsigned LONGEST)
- || TYPE_LENGTH (VALUE_TYPE (arg1)) >= sizeof (unsigned LONGEST)))
- {
- unsigned LONGEST v1, v2, v;
- v1 = (unsigned LONGEST) value_as_long (arg1);
- v2 = (unsigned LONGEST) value_as_long (arg2);
-
- switch (op)
- {
- case BINOP_ADD:
- v = v1 + v2;
- break;
-
- case BINOP_SUB:
- v = v1 - v2;
- break;
-
- case BINOP_MUL:
- v = v1 * v2;
- break;
-
- case BINOP_DIV:
- v = v1 / v2;
- break;
-
- case BINOP_REM:
- v = v1 % v2;
- break;
-
- case BINOP_LSH:
- v = v1 << v2;
- break;
-
- case BINOP_RSH:
- v = v1 >> v2;
- break;
-
- case BINOP_LOGAND:
- v = v1 & v2;
- break;
-
- case BINOP_LOGIOR:
- v = v1 | v2;
- break;
-
- case BINOP_LOGXOR:
- v = v1 ^ v2;
- break;
-
- case BINOP_AND:
- v = v1 && v2;
- break;
-
- case BINOP_OR:
- v = v1 || v2;
- break;
-
- case BINOP_MIN:
- v = v1 < v2 ? v1 : v2;
- break;
-
- case BINOP_MAX:
- v = v1 > v2 ? v1 : v2;
- break;
-
- default:
- error ("Invalid binary operation on numbers.");
- }
-
- val = allocate_value (BUILTIN_TYPE_UNSIGNED_LONGEST);
- SWAP_TARGET_AND_HOST (&v, sizeof (v));
- *(unsigned LONGEST *) VALUE_CONTENTS_RAW (val) = v;
- }
- else
- {
- LONGEST v1, v2, v;
- v1 = value_as_long (arg1);
- v2 = value_as_long (arg2);
-
- switch (op)
- {
- case BINOP_ADD:
- v = v1 + v2;
- break;
-
- case BINOP_SUB:
- v = v1 - v2;
- break;
-
- case BINOP_MUL:
- v = v1 * v2;
- break;
-
- case BINOP_DIV:
- v = v1 / v2;
- break;
-
- case BINOP_REM:
- v = v1 % v2;
- break;
-
- case BINOP_LSH:
- v = v1 << v2;
- break;
-
- case BINOP_RSH:
- v = v1 >> v2;
- break;
-
- case BINOP_LOGAND:
- v = v1 & v2;
- break;
-
- case BINOP_LOGIOR:
- v = v1 | v2;
- break;
-
- case BINOP_LOGXOR:
- v = v1 ^ v2;
- break;
-
- case BINOP_AND:
- v = v1 && v2;
- break;
-
- case BINOP_OR:
- v = v1 || v2;
- break;
-
- case BINOP_MIN:
- v = v1 < v2 ? v1 : v2;
- break;
-
- case BINOP_MAX:
- v = v1 > v2 ? v1 : v2;
- break;
-
- default:
- error ("Invalid binary operation on numbers.");
- }
-
- val = allocate_value (BUILTIN_TYPE_LONGEST);
- SWAP_TARGET_AND_HOST (&v, sizeof (v));
- *(LONGEST *) VALUE_CONTENTS_RAW (val) = v;
- }
- }
-
- return val;
-}
-
-/* Simulate the C operator ! -- return 1 if ARG1 contains zeros. */
-
-int
-value_zerop (arg1)
- value arg1;
-{
- register int len;
- register char *p;
-
- COERCE_ARRAY (arg1);
-
- len = TYPE_LENGTH (VALUE_TYPE (arg1));
- p = VALUE_CONTENTS (arg1);
-
- while (--len >= 0)
- {
- if (*p++)
- break;
- }
-
- return len < 0;
-}
-
-/* Simulate the C operator == by returning a 1
- iff ARG1 and ARG2 have equal contents. */
-
-int
-value_equal (arg1, arg2)
- register value arg1, arg2;
-
-{
- register int len;
- register char *p1, *p2;
- enum type_code code1;
- enum type_code code2;
-
- COERCE_ARRAY (arg1);
- COERCE_ARRAY (arg2);
-
- code1 = TYPE_CODE (VALUE_TYPE (arg1));
- code2 = TYPE_CODE (VALUE_TYPE (arg2));
-
- if (code1 == TYPE_CODE_INT && code2 == TYPE_CODE_INT)
- return value_as_long (arg1) == value_as_long (arg2);
- else if ((code1 == TYPE_CODE_FLT || code1 == TYPE_CODE_INT)
- && (code2 == TYPE_CODE_FLT || code2 == TYPE_CODE_INT))
- return value_as_double (arg1) == value_as_double (arg2);
- else if ((code1 == TYPE_CODE_PTR && code2 == TYPE_CODE_INT)
- || (code2 == TYPE_CODE_PTR && code1 == TYPE_CODE_INT))
- return (char *) value_as_long (arg1) == (char *) value_as_long (arg2);
- else if (code1 == code2
- && ((len = TYPE_LENGTH (VALUE_TYPE (arg1)))
- == TYPE_LENGTH (VALUE_TYPE (arg2))))
- {
- p1 = VALUE_CONTENTS (arg1);
- p2 = VALUE_CONTENTS (arg2);
- while (--len >= 0)
- {
- if (*p1++ != *p2++)
- break;
- }
- return len < 0;
- }
- else
- {
- error ("Invalid type combination in equality test.");
- return 0; /* For lint -- never reached */
- }
-}
-
-/* Simulate the C operator < by returning 1
- iff ARG1's contents are less than ARG2's. */
-
-int
-value_less (arg1, arg2)
- register value arg1, arg2;
-{
- register enum type_code code1;
- register enum type_code code2;
-
- COERCE_ARRAY (arg1);
- COERCE_ARRAY (arg2);
-
- code1 = TYPE_CODE (VALUE_TYPE (arg1));
- code2 = TYPE_CODE (VALUE_TYPE (arg2));
-
- if (code1 == TYPE_CODE_INT && code2 == TYPE_CODE_INT)
- {
- if (TYPE_UNSIGNED (VALUE_TYPE (arg1))
- || TYPE_UNSIGNED (VALUE_TYPE (arg2)))
- return (unsigned)value_as_long (arg1) < (unsigned)value_as_long (arg2);
- else
- return value_as_long (arg1) < value_as_long (arg2);
- }
- else if ((code1 == TYPE_CODE_FLT || code1 == TYPE_CODE_INT)
- && (code2 == TYPE_CODE_FLT || code2 == TYPE_CODE_INT))
- return value_as_double (arg1) < value_as_double (arg2);
- else if ((code1 == TYPE_CODE_PTR || code1 == TYPE_CODE_INT)
- && (code2 == TYPE_CODE_PTR || code2 == TYPE_CODE_INT))
- {
- /* FIXME, this assumes that host and target char *'s are the same! */
- return (char *) value_as_long (arg1) < (char *) value_as_long (arg2);
- }
- else
- {
- error ("Invalid type combination in ordering comparison.");
- return 0;
- }
-}
-
-/* The unary operators - and ~. Both free the argument ARG1. */
-
-value
-value_neg (arg1)
- register value arg1;
-{
- register struct type *type;
-
- COERCE_ENUM (arg1);
-
- type = VALUE_TYPE (arg1);
-
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
- return value_from_double (type, - value_as_double (arg1));
- else if (TYPE_CODE (type) == TYPE_CODE_INT)
- return value_from_long (type, - value_as_long (arg1));
- else {
- error ("Argument to negate operation not a number.");
- return 0; /* For lint -- never reached */
- }
-}
-
-value
-value_lognot (arg1)
- register value arg1;
-{
- COERCE_ENUM (arg1);
-
- if (TYPE_CODE (VALUE_TYPE (arg1)) != TYPE_CODE_INT)
- error ("Argument to complement operation not an integer.");
-
- return value_from_long (VALUE_TYPE (arg1), ~ value_as_long (arg1));
-}
-
diff --git a/gdb/valops.c b/gdb/valops.c
deleted file mode 100644
index 07c96af..0000000
--- a/gdb/valops.c
+++ /dev/null
@@ -1,1498 +0,0 @@
-/* Perform non-arithmetic operations on values, for GDB.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "value.h"
-#include "frame.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "target.h"
-
-#include <errno.h>
-
-/* Local functions. */
-static value search_struct_field ();
-
-/* Cast value ARG2 to type TYPE and return as a value.
- More general than a C cast: accepts any two types of the same length,
- and if ARG2 is an lvalue it can be cast into anything at all. */
-/* In C++, casts may change pointer representations. */
-
-value
-value_cast (type, arg2)
- struct type *type;
- register value arg2;
-{
- register enum type_code code1;
- register enum type_code code2;
- register int scalar;
-
- /* Coerce arrays but not enums. Enums will work as-is
- and coercing them would cause an infinite recursion. */
- if (TYPE_CODE (VALUE_TYPE (arg2)) != TYPE_CODE_ENUM)
- COERCE_ARRAY (arg2);
-
- code1 = TYPE_CODE (type);
- code2 = TYPE_CODE (VALUE_TYPE (arg2));
- scalar = (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_FLT
- || code2 == TYPE_CODE_ENUM);
-
- if (code1 == TYPE_CODE_FLT && scalar)
- return value_from_double (type, value_as_double (arg2));
- else if ((code1 == TYPE_CODE_INT || code1 == TYPE_CODE_ENUM)
- && (scalar || code2 == TYPE_CODE_PTR))
- return value_from_longest (type, value_as_long (arg2));
- else if (TYPE_LENGTH (type) == TYPE_LENGTH (VALUE_TYPE (arg2)))
- {
- if (code1 == TYPE_CODE_PTR && code2 == TYPE_CODE_PTR)
- {
- /* Look in the type of the source to see if it contains the
- type of the target as a superclass. If so, we'll need to
- offset the pointer rather than just change its type. */
- struct type *t1 = TYPE_TARGET_TYPE (type);
- struct type *t2 = TYPE_TARGET_TYPE (VALUE_TYPE (arg2));
- if (TYPE_CODE (t1) == TYPE_CODE_STRUCT
- && TYPE_CODE (t2) == TYPE_CODE_STRUCT
- && TYPE_NAME (t1) != 0) /* if name unknown, can't have supercl */
- {
- value v = search_struct_field (type_name_no_tag (t1),
- value_ind (arg2), 0, t2, 1);
- if (v)
- {
- v = value_addr (v);
- VALUE_TYPE (v) = type;
- return v;
- }
- }
- /* No superclass found, just fall through to change ptr type. */
- }
- VALUE_TYPE (arg2) = type;
- return arg2;
- }
- else if (VALUE_LVAL (arg2) == lval_memory)
- {
- return value_at_lazy (type, VALUE_ADDRESS (arg2) + VALUE_OFFSET (arg2));
- }
- else if (code1 == TYPE_CODE_VOID)
- {
- return value_zero (builtin_type_void, not_lval);
- }
- else
- {
- error ("Invalid cast.");
- return 0;
- }
-}
-
-/* Create a value of type TYPE that is zero, and return it. */
-
-value
-value_zero (type, lv)
- struct type *type;
- enum lval_type lv;
-{
- register value val = allocate_value (type);
-
- bzero (VALUE_CONTENTS (val), TYPE_LENGTH (type));
- VALUE_LVAL (val) = lv;
-
- return val;
-}
-
-/* Return a value with type TYPE located at ADDR.
-
- Call value_at only if the data needs to be fetched immediately;
- if we can be 'lazy' and defer the fetch, perhaps indefinately, call
- value_at_lazy instead. value_at_lazy simply records the address of
- the data and sets the lazy-evaluation-required flag. The lazy flag
- is tested in the VALUE_CONTENTS macro, which is used if and when
- the contents are actually required. */
-
-value
-value_at (type, addr)
- struct type *type;
- CORE_ADDR addr;
-{
- register value val = allocate_value (type);
-
- read_memory (addr, VALUE_CONTENTS_RAW (val), TYPE_LENGTH (type));
-
- VALUE_LVAL (val) = lval_memory;
- VALUE_ADDRESS (val) = addr;
-
- return val;
-}
-
-/* Return a lazy value with type TYPE located at ADDR (cf. value_at). */
-
-value
-value_at_lazy (type, addr)
- struct type *type;
- CORE_ADDR addr;
-{
- register value val = allocate_value (type);
-
- VALUE_LVAL (val) = lval_memory;
- VALUE_ADDRESS (val) = addr;
- VALUE_LAZY (val) = 1;
-
- return val;
-}
-
-/* Called only from the VALUE_CONTENTS macro, if the current data for
- a variable needs to be loaded into VALUE_CONTENTS(VAL). Fetches the
- data from the user's process, and clears the lazy flag to indicate
- that the data in the buffer is valid.
-
- If the value is zero-length, we avoid calling read_memory, which would
- abort. We mark the value as fetched anyway -- all 0 bytes of it.
-
- This function returns a value because it is used in the VALUE_CONTENTS
- macro as part of an expression, where a void would not work. The
- value is ignored. */
-
-int
-value_fetch_lazy (val)
- register value val;
-{
- CORE_ADDR addr = VALUE_ADDRESS (val) + VALUE_OFFSET (val);
-
- if (TYPE_LENGTH (VALUE_TYPE (val)))
- read_memory (addr, VALUE_CONTENTS_RAW (val),
- TYPE_LENGTH (VALUE_TYPE (val)));
- VALUE_LAZY (val) = 0;
- return 0;
-}
-
-
-/* Store the contents of FROMVAL into the location of TOVAL.
- Return a new value with the location of TOVAL and contents of FROMVAL. */
-
-value
-value_assign (toval, fromval)
- register value toval, fromval;
-{
- register struct type *type = VALUE_TYPE (toval);
- register value val;
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
- char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
- int use_buffer = 0;
-
- COERCE_ARRAY (fromval);
-
- if (VALUE_LVAL (toval) != lval_internalvar)
- fromval = value_cast (type, fromval);
-
- /* If TOVAL is a special machine register requiring conversion
- of program values to a special raw format,
- convert FROMVAL's contents now, with result in `raw_buffer',
- and set USE_BUFFER to the number of bytes to write. */
-
- if (VALUE_REGNO (toval) >= 0
- && REGISTER_CONVERTIBLE (VALUE_REGNO (toval)))
- {
- int regno = VALUE_REGNO (toval);
- if (VALUE_TYPE (fromval) != REGISTER_VIRTUAL_TYPE (regno))
- fromval = value_cast (REGISTER_VIRTUAL_TYPE (regno), fromval);
- bcopy (VALUE_CONTENTS (fromval), virtual_buffer,
- REGISTER_VIRTUAL_SIZE (regno));
- target_convert_from_virtual (regno, virtual_buffer, raw_buffer);
- use_buffer = REGISTER_RAW_SIZE (regno);
- }
-
- switch (VALUE_LVAL (toval))
- {
- case lval_internalvar:
- set_internalvar (VALUE_INTERNALVAR (toval), fromval);
- break;
-
- case lval_internalvar_component:
- set_internalvar_component (VALUE_INTERNALVAR (toval),
- VALUE_OFFSET (toval),
- VALUE_BITPOS (toval),
- VALUE_BITSIZE (toval),
- fromval);
- break;
-
- case lval_memory:
- if (VALUE_BITSIZE (toval))
- {
- int v; /* FIXME, this won't work for large bitfields */
- read_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- &v, sizeof v);
- modify_field (&v, (int) value_as_long (fromval),
- VALUE_BITPOS (toval), VALUE_BITSIZE (toval));
- write_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- (char *)&v, sizeof v);
- }
- else if (use_buffer)
- write_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- raw_buffer, use_buffer);
- else
- write_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
- break;
-
- case lval_register:
- if (VALUE_BITSIZE (toval))
- {
- int v;
-
- read_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- &v, sizeof v);
- modify_field (&v, (int) value_as_long (fromval),
- VALUE_BITPOS (toval), VALUE_BITSIZE (toval));
- write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- &v, sizeof v);
- }
- else if (use_buffer)
- write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- raw_buffer, use_buffer);
- else
- write_register_bytes (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
- VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
- break;
-
- case lval_reg_frame_relative:
- {
- /* value is stored in a series of registers in the frame
- specified by the structure. Copy that value out, modify
- it, and copy it back in. */
- int amount_to_copy = (VALUE_BITSIZE (toval) ? 1 : TYPE_LENGTH (type));
- int reg_size = REGISTER_RAW_SIZE (VALUE_FRAME_REGNUM (toval));
- int byte_offset = VALUE_OFFSET (toval) % reg_size;
- int reg_offset = VALUE_OFFSET (toval) / reg_size;
- int amount_copied;
- char *buffer = (char *) alloca (amount_to_copy);
- int regno;
- FRAME frame;
-
- /* Figure out which frame this is in currently. */
- for (frame = get_current_frame ();
- frame && FRAME_FP (frame) != VALUE_FRAME (toval);
- frame = get_prev_frame (frame))
- ;
-
- if (!frame)
- error ("Value being assigned to is no longer active.");
-
- amount_to_copy += (reg_size - amount_to_copy % reg_size);
-
- /* Copy it out. */
- for ((regno = VALUE_FRAME_REGNUM (toval) + reg_offset,
- amount_copied = 0);
- amount_copied < amount_to_copy;
- amount_copied += reg_size, regno++)
- {
- get_saved_register (buffer + amount_copied,
- (int *)NULL, (CORE_ADDR)NULL,
- frame, regno, (enum lval_type *)NULL);
- }
-
- /* Modify what needs to be modified. */
- if (VALUE_BITSIZE (toval))
- modify_field (buffer + byte_offset,
- (int) value_as_long (fromval),
- VALUE_BITPOS (toval), VALUE_BITSIZE (toval));
- else if (use_buffer)
- bcopy (raw_buffer, buffer + byte_offset, use_buffer);
- else
- bcopy (VALUE_CONTENTS (fromval), buffer + byte_offset,
- TYPE_LENGTH (type));
-
- /* Copy it back. */
- for ((regno = VALUE_FRAME_REGNUM (toval) + reg_offset,
- amount_copied = 0);
- amount_copied < amount_to_copy;
- amount_copied += reg_size, regno++)
- {
- enum lval_type lval;
- CORE_ADDR addr;
- int optim;
-
- /* Just find out where to put it. */
- get_saved_register ((char *)NULL,
- &optim, &addr, frame, regno, &lval);
-
- if (optim)
- error ("Attempt to assign to a value that was optimized out.");
- if (lval == lval_memory)
- write_memory (addr, buffer + amount_copied, reg_size);
- else if (lval == lval_register)
- write_register_bytes (addr, buffer + amount_copied, reg_size);
- else
- error ("Attempt to assign to an unmodifiable value.");
- }
- }
- break;
-
-
- default:
- error ("Left side of = operation is not an lvalue.");
- }
-
- /* Return a value just like TOVAL except with the contents of FROMVAL
- (except in the case of the type if TOVAL is an internalvar). */
-
- if (VALUE_LVAL (toval) == lval_internalvar
- || VALUE_LVAL (toval) == lval_internalvar_component)
- {
- type = VALUE_TYPE (fromval);
- }
-
- val = allocate_value (type);
- bcopy (toval, val, VALUE_CONTENTS_RAW (val) - (char *) val);
- bcopy (VALUE_CONTENTS (fromval), VALUE_CONTENTS_RAW (val), TYPE_LENGTH (type));
- VALUE_TYPE (val) = type;
-
- return val;
-}
-
-/* Extend a value VAL to COUNT repetitions of its type. */
-
-value
-value_repeat (arg1, count)
- value arg1;
- int count;
-{
- register value val;
-
- if (VALUE_LVAL (arg1) != lval_memory)
- error ("Only values in memory can be extended with '@'.");
- if (count < 1)
- error ("Invalid number %d of repetitions.", count);
-
- val = allocate_repeat_value (VALUE_TYPE (arg1), count);
-
- read_memory (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1),
- VALUE_CONTENTS_RAW (val),
- TYPE_LENGTH (VALUE_TYPE (val)) * count);
- VALUE_LVAL (val) = lval_memory;
- VALUE_ADDRESS (val) = VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1);
-
- return val;
-}
-
-value
-value_of_variable (var)
- struct symbol *var;
-{
- value val;
-
- val = read_var_value (var, (FRAME) 0);
- if (val == 0)
- error ("Address of symbol \"%s\" is unknown.", SYMBOL_NAME (var));
- return val;
-}
-
-/* Given a value which is an array, return a value which is
- a pointer to its first (actually, zeroth) element.
- FIXME, this should be subtracting the array's lower bound. */
-
-value
-value_coerce_array (arg1)
- value arg1;
-{
- register struct type *type;
-
- if (VALUE_LVAL (arg1) != lval_memory)
- error ("Attempt to take address of value not located in memory.");
-
- /* Get type of elements. */
- if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_ARRAY)
- type = TYPE_TARGET_TYPE (VALUE_TYPE (arg1));
- else
- /* A phony array made by value_repeat.
- Its type is the type of the elements, not an array type. */
- type = VALUE_TYPE (arg1);
-
- return value_from_longest (lookup_pointer_type (type),
- (LONGEST) (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
-}
-
-/* Given a value which is a function, return a value which is a pointer
- to it. */
-
-value
-value_coerce_function (arg1)
- value arg1;
-{
-
- if (VALUE_LVAL (arg1) != lval_memory)
- error ("Attempt to take address of value not located in memory.");
-
- return value_from_longest (lookup_pointer_type (VALUE_TYPE (arg1)),
- (LONGEST) (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
-}
-
-/* Return a pointer value for the object for which ARG1 is the contents. */
-
-value
-value_addr (arg1)
- value arg1;
-{
-
- COERCE_REF(arg1);
- if (VALUE_REPEATED (arg1)
- || TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_ARRAY)
- return value_coerce_array (arg1);
- if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_FUNC)
- return value_coerce_function (arg1);
-
- if (VALUE_LVAL (arg1) != lval_memory)
- error ("Attempt to take address of value not located in memory.");
-
- return value_from_longest (lookup_pointer_type (VALUE_TYPE (arg1)),
- (LONGEST) (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
-}
-
-/* Given a value of a pointer type, apply the C unary * operator to it. */
-
-value
-value_ind (arg1)
- value arg1;
-{
- COERCE_ARRAY (arg1);
-
- if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_MEMBER)
- error ("not implemented: member types in value_ind");
-
- /* Allow * on an integer so we can cast it to whatever we want.
- This returns an int, which seems like the most C-like thing
- to do. "long long" variables are rare enough that
- BUILTIN_TYPE_LONGEST would seem to be a mistake. */
- if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_INT)
- return value_at (builtin_type_int,
- (CORE_ADDR) value_as_long (arg1));
- else if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR)
- return value_at_lazy (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)),
- value_as_pointer (arg1));
- error ("Attempt to take contents of a non-pointer value.");
- return 0; /* For lint -- never reached */
-}
-
-/* Pushing small parts of stack frames. */
-
-/* Push one word (the size of object that a register holds). */
-
-CORE_ADDR
-push_word (sp, buffer)
- CORE_ADDR sp;
- REGISTER_TYPE buffer;
-{
- register int len = sizeof (REGISTER_TYPE);
-
- SWAP_TARGET_AND_HOST (&buffer, len);
-#if 1 INNER_THAN 2
- sp -= len;
- write_memory (sp, (char *)&buffer, len);
-#else /* stack grows upward */
- write_memory (sp, (char *)&buffer, len);
- sp += len;
-#endif /* stack grows upward */
-
- return sp;
-}
-
-/* Push LEN bytes with data at BUFFER. */
-
-CORE_ADDR
-push_bytes (sp, buffer, len)
- CORE_ADDR sp;
- char *buffer;
- int len;
-{
-#if 1 INNER_THAN 2
- sp -= len;
- write_memory (sp, buffer, len);
-#else /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
-#endif /* stack grows upward */
-
- return sp;
-}
-
-/* Push onto the stack the specified value VALUE. */
-
-CORE_ADDR
-value_push (sp, arg)
- register CORE_ADDR sp;
- value arg;
-{
- register int len = TYPE_LENGTH (VALUE_TYPE (arg));
-
-#if 1 INNER_THAN 2
- sp -= len;
- write_memory (sp, VALUE_CONTENTS (arg), len);
-#else /* stack grows upward */
- write_memory (sp, VALUE_CONTENTS (arg), len);
- sp += len;
-#endif /* stack grows upward */
-
- return sp;
-}
-
-/* Perform the standard coercions that are specified
- for arguments to be passed to C functions. */
-
-value
-value_arg_coerce (arg)
- value arg;
-{
- register struct type *type;
-
- COERCE_ENUM (arg);
-
- type = VALUE_TYPE (arg);
-
- if (TYPE_CODE (type) == TYPE_CODE_INT
- && TYPE_LENGTH (type) < sizeof (int))
- return value_cast (builtin_type_int, arg);
-
- if (type == builtin_type_float)
- return value_cast (builtin_type_double, arg);
-
- return arg;
-}
-
-/* Push the value ARG, first coercing it as an argument
- to a C function. */
-
-CORE_ADDR
-value_arg_push (sp, arg)
- register CORE_ADDR sp;
- value arg;
-{
- return value_push (sp, value_arg_coerce (arg));
-}
-
-/* Determine a function's address and its return type from its value.
- Calls error() if the function is not valid for calling. */
-
-CORE_ADDR
-find_function_addr (function, retval_type)
- value function;
- struct type **retval_type;
-{
- register struct type *ftype = VALUE_TYPE (function);
- register enum type_code code = TYPE_CODE (ftype);
- struct type *value_type;
- CORE_ADDR funaddr;
-
- /* If it's a member function, just look at the function
- part of it. */
-
- /* Determine address to call. */
- if (code == TYPE_CODE_FUNC || code == TYPE_CODE_METHOD)
- {
- funaddr = VALUE_ADDRESS (function);
- value_type = TYPE_TARGET_TYPE (ftype);
- }
- else if (code == TYPE_CODE_PTR)
- {
- funaddr = value_as_pointer (function);
- if (TYPE_CODE (TYPE_TARGET_TYPE (ftype)) == TYPE_CODE_FUNC
- || TYPE_CODE (TYPE_TARGET_TYPE (ftype)) == TYPE_CODE_METHOD)
- value_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (ftype));
- else
- value_type = builtin_type_int;
- }
- else if (code == TYPE_CODE_INT)
- {
- /* Handle the case of functions lacking debugging info.
- Their values are characters since their addresses are char */
- if (TYPE_LENGTH (ftype) == 1)
- funaddr = value_as_pointer (value_addr (function));
- else
- /* Handle integer used as address of a function. */
- funaddr = (CORE_ADDR) value_as_long (function);
-
- value_type = builtin_type_int;
- }
- else
- error ("Invalid data type for function to be called.");
-
- *retval_type = value_type;
- return funaddr;
-}
-
-#if defined (CALL_DUMMY)
-/* All this stuff with a dummy frame may seem unnecessarily complicated
- (why not just save registers in GDB?). The purpose of pushing a dummy
- frame which looks just like a real frame is so that if you call a
- function and then hit a breakpoint (get a signal, etc), "backtrace"
- will look right. Whether the backtrace needs to actually show the
- stack at the time the inferior function was called is debatable, but
- it certainly needs to not display garbage. So if you are contemplating
- making dummy frames be different from normal frames, consider that. */
-
-/* Perform a function call in the inferior.
- ARGS is a vector of values of arguments (NARGS of them).
- FUNCTION is a value, the function to be called.
- Returns a value representing what the function returned.
- May fail to return, if a breakpoint or signal is hit
- during the execution of the function. */
-
-value
-call_function_by_hand (function, nargs, args)
- value function;
- int nargs;
- value *args;
-{
- register CORE_ADDR sp;
- register int i;
- CORE_ADDR start_sp;
- /* CALL_DUMMY is an array of words (REGISTER_TYPE), but each word
- is in host byte order. It is switched to target byte order before calling
- FIX_CALL_DUMMY. */
- static REGISTER_TYPE dummy[] = CALL_DUMMY;
- REGISTER_TYPE dummy1[sizeof dummy / sizeof (REGISTER_TYPE)];
- CORE_ADDR old_sp;
- struct type *value_type;
- unsigned char struct_return;
- CORE_ADDR struct_addr;
- struct inferior_status inf_status;
- struct cleanup *old_chain;
- CORE_ADDR funaddr;
- int using_gcc;
-
- save_inferior_status (&inf_status, 1);
- old_chain = make_cleanup (restore_inferior_status, &inf_status);
-
- /* PUSH_DUMMY_FRAME is responsible for saving the inferior registers
- (and POP_FRAME for restoring them). (At least on most machines)
- they are saved on the stack in the inferior. */
- PUSH_DUMMY_FRAME;
-
- old_sp = sp = read_register (SP_REGNUM);
-
-#if 1 INNER_THAN 2 /* Stack grows down */
- sp -= sizeof dummy;
- start_sp = sp;
-#else /* Stack grows up */
- start_sp = sp;
- sp += sizeof dummy;
-#endif
-
- funaddr = find_function_addr (function, &value_type);
-
- {
- struct block *b = block_for_pc (funaddr);
- /* If compiled without -g, assume GCC. */
- using_gcc = b == NULL || BLOCK_GCC_COMPILED (b);
- }
-
- /* Are we returning a value using a structure return or a normal
- value return? */
-
- struct_return = using_struct_return (function, funaddr, value_type,
- using_gcc);
-
- /* Create a call sequence customized for this function
- and the number of arguments for it. */
- bcopy (dummy, dummy1, sizeof dummy);
- for (i = 0; i < sizeof dummy / sizeof (REGISTER_TYPE); i++)
- SWAP_TARGET_AND_HOST (&dummy1[i], sizeof (REGISTER_TYPE));
- FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
- value_type, using_gcc);
-
-#if CALL_DUMMY_LOCATION == ON_STACK
- write_memory (start_sp, (char *)dummy1, sizeof dummy);
-
-#else /* Not on stack. */
-#if CALL_DUMMY_LOCATION == BEFORE_TEXT_END
- /* Convex Unix prohibits executing in the stack segment. */
- /* Hope there is empty room at the top of the text segment. */
- {
- extern CORE_ADDR text_end;
- static checked = 0;
- if (!checked)
- for (start_sp = text_end - sizeof dummy; start_sp < text_end; ++start_sp)
- if (read_memory_integer (start_sp, 1) != 0)
- error ("text segment full -- no place to put call");
- checked = 1;
- sp = old_sp;
- start_sp = text_end - sizeof dummy;
- write_memory (start_sp, (char *)dummy1, sizeof dummy);
- }
-#else /* After text_end. */
- {
- extern CORE_ADDR text_end;
- int errcode;
- sp = old_sp;
- start_sp = text_end;
- errcode = target_write_memory (start_sp, (char *)dummy1, sizeof dummy);
- if (errcode != 0)
- error ("Cannot write text segment -- call_function failed");
- }
-#endif /* After text_end. */
-#endif /* Not on stack. */
-
-#ifdef lint
- sp = old_sp; /* It really is used, for some ifdef's... */
-#endif
-
-#ifdef STACK_ALIGN
- /* If stack grows down, we must leave a hole at the top. */
- {
- int len = 0;
-
- /* Reserve space for the return structure to be written on the
- stack, if necessary */
-
- if (struct_return)
- len += TYPE_LENGTH (value_type);
-
- for (i = nargs - 1; i >= 0; i--)
- len += TYPE_LENGTH (VALUE_TYPE (value_arg_coerce (args[i])));
-#ifdef CALL_DUMMY_STACK_ADJUST
- len += CALL_DUMMY_STACK_ADJUST;
-#endif
-#if 1 INNER_THAN 2
- sp -= STACK_ALIGN (len) - len;
-#else
- sp += STACK_ALIGN (len) - len;
-#endif
- }
-#endif /* STACK_ALIGN */
-
- /* Reserve space for the return structure to be written on the
- stack, if necessary */
-
- if (struct_return)
- {
-#if 1 INNER_THAN 2
- sp -= TYPE_LENGTH (value_type);
- struct_addr = sp;
-#else
- struct_addr = sp;
- sp += TYPE_LENGTH (value_type);
-#endif
- }
-
-#if defined (REG_STRUCT_HAS_ADDR)
- {
- /* This is a machine like the sparc, where we need to pass a pointer
- to the structure, not the structure itself. */
- if (REG_STRUCT_HAS_ADDR (using_gcc))
- for (i = nargs - 1; i >= 0; i--)
- if (TYPE_CODE (VALUE_TYPE (args[i])) == TYPE_CODE_STRUCT)
- {
- CORE_ADDR addr;
-#if !(1 INNER_THAN 2)
- /* The stack grows up, so the address of the thing we push
- is the stack pointer before we push it. */
- addr = sp;
-#endif
- /* Push the structure. */
- sp = value_push (sp, args[i]);
-#if 1 INNER_THAN 2
- /* The stack grows down, so the address of the thing we push
- is the stack pointer after we push it. */
- addr = sp;
-#endif
- /* The value we're going to pass is the address of the thing
- we just pushed. */
- args[i] = value_from_longest (lookup_pointer_type (value_type),
- (LONGEST) addr);
- }
- }
-#endif /* REG_STRUCT_HAS_ADDR. */
-
-#ifdef PUSH_ARGUMENTS
- PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr);
-#else /* !PUSH_ARGUMENTS */
- for (i = nargs - 1; i >= 0; i--)
- sp = value_arg_push (sp, args[i]);
-#endif /* !PUSH_ARGUMENTS */
-
-#ifdef CALL_DUMMY_STACK_ADJUST
-#if 1 INNER_THAN 2
- sp -= CALL_DUMMY_STACK_ADJUST;
-#else
- sp += CALL_DUMMY_STACK_ADJUST;
-#endif
-#endif /* CALL_DUMMY_STACK_ADJUST */
-
- /* Store the address at which the structure is supposed to be
- written. Note that this (and the code which reserved the space
- above) assumes that gcc was used to compile this function. Since
- it doesn't cost us anything but space and if the function is pcc
- it will ignore this value, we will make that assumption.
-
- Also note that on some machines (like the sparc) pcc uses a
- convention like gcc's. */
-
- if (struct_return)
- STORE_STRUCT_RETURN (struct_addr, sp);
-
- /* Write the stack pointer. This is here because the statements above
- might fool with it. On SPARC, this write also stores the register
- window into the right place in the new stack frame, which otherwise
- wouldn't happen. (See write_inferior_registers in sparc-xdep.c.) */
- write_register (SP_REGNUM, sp);
-
- /* Figure out the value returned by the function. */
- {
- char retbuf[REGISTER_BYTES];
-
- /* Execute the stack dummy routine, calling FUNCTION.
- When it is done, discard the empty frame
- after storing the contents of all regs into retbuf. */
- run_stack_dummy (start_sp + CALL_DUMMY_START_OFFSET, retbuf);
-
- do_cleanups (old_chain);
-
- return value_being_returned (value_type, retbuf, struct_return);
- }
-}
-#else /* no CALL_DUMMY. */
-value
-call_function_by_hand (function, nargs, args)
- value function;
- int nargs;
- value *args;
-{
- error ("Cannot invoke functions on this machine.");
-}
-#endif /* no CALL_DUMMY. */
-
-/* Create a value for a string constant:
- Call the function malloc in the inferior to get space for it,
- then copy the data into that space
- and then return the address with type char *.
- PTR points to the string constant data; LEN is number of characters. */
-
-value
-value_string (ptr, len)
- char *ptr;
- int len;
-{
- register value val;
- register struct symbol *sym;
- value blocklen;
- register char *copy = (char *) alloca (len + 1);
- char *i = ptr;
- register char *o = copy, *ibeg = ptr;
- register int c;
-
- /* Copy the string into COPY, processing escapes.
- We could not conveniently process them in the parser
- because the string there wants to be a substring of the input. */
-
- while (i - ibeg < len)
- {
- c = *i++;
- if (c == '\\')
- {
- c = parse_escape (&i);
- if (c == -1)
- continue;
- }
- *o++ = c;
- }
- *o = 0;
-
- /* Get the length of the string after escapes are processed. */
-
- len = o - copy;
-
- /* Find the address of malloc in the inferior. */
-
- sym = lookup_symbol ("malloc", 0, VAR_NAMESPACE, 0, NULL);
- if (sym != 0)
- {
- if (SYMBOL_CLASS (sym) != LOC_BLOCK)
- error ("\"malloc\" exists in this program but is not a function.");
- val = value_of_variable (sym);
- }
- else
- {
- register int j;
- j = lookup_misc_func ("malloc");
- if (j >= 0)
- val = value_from_longest (
- lookup_pointer_type (lookup_function_type (
- lookup_pointer_type (builtin_type_char))),
- (LONGEST) misc_function_vector[j].address);
- else
- error ("String constants require the program to have a function \"malloc\".");
- }
-
- blocklen = value_from_longest (builtin_type_int, (LONGEST) (len + 1));
- val = target_call_function (val, 1, &blocklen);
- if (value_zerop (val))
- error ("No memory available for string constant.");
- write_memory (value_as_pointer (val), copy, len + 1);
- VALUE_TYPE (val) = lookup_pointer_type (builtin_type_char);
- return val;
-}
-
-/* Helper function used by value_struct_elt to recurse through baseclasses.
- Look for a field NAME in ARG1. Adjust the address of ARG1 by OFFSET bytes,
- and treat the result as having type TYPE.
- If found, return value, else return NULL.
-
- If LOOKING_FOR_BASECLASS, then instead of looking for struct fields,
- look for a baseclass named NAME. */
-
-static value
-search_struct_field (name, arg1, offset, type, looking_for_baseclass)
- char *name;
- register value arg1;
- int offset;
- register struct type *type;
- int looking_for_baseclass;
-{
- int i;
-
- check_stub_type (type);
-
- if (! looking_for_baseclass)
- for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
- {
- char *t_field_name = TYPE_FIELD_NAME (type, i);
-
- if (t_field_name && !strcmp (t_field_name, name))
- {
- value v = (TYPE_FIELD_STATIC (type, i)
- ? value_static_field (type, name, i)
- : value_primitive_field (arg1, offset, i, type));
- if (v == 0)
- error("there is no field named %s", name);
- return v;
- }
- }
-
- for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
- {
- value v;
- /* If we are looking for baseclasses, this is what we get when we
- hit them. */
- int found_baseclass = (looking_for_baseclass
- && !strcmp (name, TYPE_BASECLASS_NAME (type, i)));
-
- if (BASETYPE_VIA_VIRTUAL (type, i))
- {
- value v2;
- baseclass_addr (type, i, VALUE_CONTENTS (arg1) + offset,
- &v2, (int *)NULL);
- if (v2 == 0)
- error ("virtual baseclass botch");
- if (found_baseclass)
- return v2;
- v = search_struct_field (name, v2, 0, TYPE_BASECLASS (type, i),
- looking_for_baseclass);
- if (v) return v;
- else continue;
- }
- if (found_baseclass)
- v = value_primitive_field (arg1, offset, i, type);
- else
- v = search_struct_field (name, arg1,
- offset + TYPE_BASECLASS_BITPOS (type, i) / 8,
- TYPE_BASECLASS (type, i),
- looking_for_baseclass);
- if (v) return v;
- }
- return NULL;
-}
-
-/* Helper function used by value_struct_elt to recurse through baseclasses.
- Look for a field NAME in ARG1. Adjust the address of ARG1 by OFFSET bytes,
- and treat the result as having type TYPE.
- If found, return value, else return NULL. */
-
-static value
-search_struct_method (name, arg1, args, offset, static_memfuncp, type)
- char *name;
- register value arg1, *args;
- int offset, *static_memfuncp;
- register struct type *type;
-{
- int i;
-
- check_stub_type (type);
- for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--)
- {
- char *t_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
- if (t_field_name && !strcmp (t_field_name, name))
- {
- int j = TYPE_FN_FIELDLIST_LENGTH (type, i) - 1;
- struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
-
- if (j > 0 && args == 0)
- error ("cannot resolve overloaded method `%s'", name);
- while (j >= 0)
- {
- if (TYPE_FLAGS (TYPE_FN_FIELD_TYPE (f, j)) & TYPE_FLAG_STUB)
- check_stub_method (type, i, j);
- if (!typecmp (TYPE_FN_FIELD_STATIC_P (f, j),
- TYPE_FN_FIELD_ARGS (f, j), args))
- {
- if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
- return (value)value_virtual_fn_field (arg1, f, j, type);
- if (TYPE_FN_FIELD_STATIC_P (f, j) && static_memfuncp)
- *static_memfuncp = 1;
- return (value)value_fn_field (arg1, i, j);
- }
- j--;
- }
- }
- }
-
- for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
- {
- value v;
-
- if (BASETYPE_VIA_VIRTUAL (type, i))
- {
- value v2;
- baseclass_addr (type, i, VALUE_CONTENTS (arg1) + offset,
- &v2, (int *)NULL);
- if (v2 == 0)
- error ("virtual baseclass botch");
- v = search_struct_method (name, v2, args, 0,
- static_memfuncp, TYPE_BASECLASS (type, i));
- if (v) return v;
- else continue;
- }
-
- v = search_struct_method (name, arg1, args,
- TYPE_BASECLASS_BITPOS (type, i) / 8,
- static_memfuncp, TYPE_BASECLASS (type, i));
- if (v) return v;
- }
- return NULL;
-}
-
-/* Given *ARGP, a value of type (pointer to a)* structure/union,
- extract the component named NAME from the ultimate target structure/union
- and return it as a value with its appropriate type.
- ERR is used in the error message if *ARGP's type is wrong.
-
- C++: ARGS is a list of argument types to aid in the selection of
- an appropriate method. Also, handle derived types.
-
- STATIC_MEMFUNCP, if non-NULL, points to a caller-supplied location
- where the truthvalue of whether the function that was resolved was
- a static member function or not is stored.
-
- ERR is an error message to be printed in case the field is not found. */
-
-value
-value_struct_elt (argp, args, name, static_memfuncp, err)
- register value *argp, *args;
- char *name;
- int *static_memfuncp;
- char *err;
-{
- register struct type *t;
- value v;
-
- COERCE_ARRAY (*argp);
-
- t = VALUE_TYPE (*argp);
-
- /* Follow pointers until we get to a non-pointer. */
-
- while (TYPE_CODE (t) == TYPE_CODE_PTR || TYPE_CODE (t) == TYPE_CODE_REF)
- {
- *argp = value_ind (*argp);
- /* Don't coerce fn pointer to fn and then back again! */
- if (TYPE_CODE (VALUE_TYPE (*argp)) != TYPE_CODE_FUNC)
- COERCE_ARRAY (*argp);
- t = VALUE_TYPE (*argp);
- }
-
- if (TYPE_CODE (t) == TYPE_CODE_MEMBER)
- error ("not implemented: member type in value_struct_elt");
-
- if (TYPE_CODE (t) != TYPE_CODE_STRUCT
- && TYPE_CODE (t) != TYPE_CODE_UNION)
- error ("Attempt to extract a component of a value that is not a %s.", err);
-
- /* Assume it's not, unless we see that it is. */
- if (static_memfuncp)
- *static_memfuncp =0;
-
- if (!args)
- {
- /* if there are no arguments ...do this... */
-
- /* Try as a field first, because if we succeed, there
- is less work to be done. */
- v = search_struct_field (name, *argp, 0, t, 0);
- if (v)
- return v;
-
- /* C++: If it was not found as a data field, then try to
- return it as a pointer to a method. */
-
- if (destructor_name_p (name, t))
- error ("Cannot get value of destructor");
-
- v = search_struct_method (name, *argp, args, 0, static_memfuncp, t);
-
- if (v == 0)
- {
- if (TYPE_NFN_FIELDS (t))
- error ("There is no member or method named %s.", name);
- else
- error ("There is no member named %s.", name);
- }
- return v;
- }
-
- if (destructor_name_p (name, t))
- {
- if (!args[1])
- {
- /* destructors are a special case. */
- return (value)value_fn_field (*argp, 0,
- TYPE_FN_FIELDLIST_LENGTH (t, 0));
- }
- else
- {
- error ("destructor should not have any argument");
- }
- }
- else
- v = search_struct_method (name, *argp, args, 0, static_memfuncp, t);
-
- if (v == 0)
- {
- /* See if user tried to invoke data as function. If so,
- hand it back. If it's not callable (i.e., a pointer to function),
- gdb should give an error. */
- v = search_struct_field (name, *argp, 0, t, 0);
- }
-
- if (!v)
- error ("Structure has no component named %s.", name);
- return v;
-}
-
-/* C++: return 1 is NAME is a legitimate name for the destructor
- of type TYPE. If TYPE does not have a destructor, or
- if NAME is inappropriate for TYPE, an error is signaled. */
-int
-destructor_name_p (name, type)
- char *name;
- struct type *type;
-{
- /* destructors are a special case. */
-
- if (name[0] == '~')
- {
- char *dname = type_name_no_tag (type);
-
- if (! TYPE_HAS_DESTRUCTOR (type))
- error ("type `%s' does not have destructor defined", dname);
- if (strcmp (dname, name+1))
- error ("name of destructor must equal name of class");
- else
- return 1;
- }
- return 0;
-}
-
-/* Helper function for check_field: Given TYPE, a structure/union,
- return 1 if the component named NAME from the ultimate
- target structure/union is defined, otherwise, return 0. */
-
-static int
-check_field_in (type, name)
- register struct type *type;
- char *name;
-{
- register int i;
-
- for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
- {
- char *t_field_name = TYPE_FIELD_NAME (type, i);
- if (t_field_name && !strcmp (t_field_name, name))
- return 1;
- }
-
- /* C++: If it was not found as a data field, then try to
- return it as a pointer to a method. */
-
- /* Destructors are a special case. */
- if (destructor_name_p (name, type))
- return 1;
-
- for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
- {
- if (!strcmp (TYPE_FN_FIELDLIST_NAME (type, i), name))
- return 1;
- }
-
- for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
- if (check_field_in (TYPE_BASECLASS (type, i), name))
- return 1;
-
- return 0;
-}
-
-
-/* C++: Given ARG1, a value of type (pointer to a)* structure/union,
- return 1 if the component named NAME from the ultimate
- target structure/union is defined, otherwise, return 0. */
-
-int
-check_field (arg1, name)
- register value arg1;
- char *name;
-{
- register struct type *t;
-
- COERCE_ARRAY (arg1);
-
- t = VALUE_TYPE (arg1);
-
- /* Follow pointers until we get to a non-pointer. */
-
- while (TYPE_CODE (t) == TYPE_CODE_PTR || TYPE_CODE (t) == TYPE_CODE_REF)
- t = TYPE_TARGET_TYPE (t);
-
- if (TYPE_CODE (t) == TYPE_CODE_MEMBER)
- error ("not implemented: member type in check_field");
-
- if (TYPE_CODE (t) != TYPE_CODE_STRUCT
- && TYPE_CODE (t) != TYPE_CODE_UNION)
- error ("Internal error: `this' is not an aggregate");
-
- return check_field_in (t, name);
-}
-
-/* C++: Given an aggregate type DOMAIN, and a member name NAME,
- return the address of this member as a pointer to member
- type. If INTYPE is non-null, then it will be the type
- of the member we are looking for. This will help us resolve
- pointers to member functions. */
-
-value
-value_struct_elt_for_address (domain, intype, name)
- struct type *domain, *intype;
- char *name;
-{
- register struct type *t = domain;
- register int i;
- value v;
-
- struct type *baseclass;
-
- if (TYPE_CODE (t) != TYPE_CODE_STRUCT
- && TYPE_CODE (t) != TYPE_CODE_UNION)
- error ("Internal error: non-aggregate type to value_struct_elt_for_address");
-
- baseclass = t;
-
- while (t)
- {
- for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); i--)
- {
- char *t_field_name = TYPE_FIELD_NAME (t, i);
- if (t_field_name && !strcmp (t_field_name, name))
- {
- if (TYPE_FIELD_STATIC (t, i))
- {
- char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (t, i);
- struct symbol *sym =
- lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL);
- if (! sym) error ("Internal error: could not find physical static variable named %s", phys_name);
- return value_from_longest (
- lookup_pointer_type (TYPE_FIELD_TYPE (t, i)),
- (LONGEST)SYMBOL_BLOCK_VALUE (sym));
- }
- if (TYPE_FIELD_PACKED (t, i))
- error ("pointers to bitfield members not allowed");
-
- return value_from_longest (
- lookup_pointer_type (
- lookup_member_type (TYPE_FIELD_TYPE (t, i), baseclass)),
- (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3));
- }
- }
-
- if (TYPE_N_BASECLASSES (t) == 0)
- break;
-
- t = TYPE_BASECLASS (t, 0);
- }
-
- /* C++: If it was not found as a data field, then try to
- return it as a pointer to a method. */
- t = baseclass;
-
- /* Destructors are a special case. */
- if (destructor_name_p (name, t))
- {
- error ("pointers to destructors not implemented yet");
- }
-
- /* Perform all necessary dereferencing. */
- while (intype && TYPE_CODE (intype) == TYPE_CODE_PTR)
- intype = TYPE_TARGET_TYPE (intype);
-
- while (t)
- {
- for (i = TYPE_NFN_FIELDS (t) - 1; i >= 0; --i)
- {
- if (!strcmp (TYPE_FN_FIELDLIST_NAME (t, i), name))
- {
- int j = TYPE_FN_FIELDLIST_LENGTH (t, i);
- struct fn_field *f = TYPE_FN_FIELDLIST1 (t, i);
-
- if (intype == 0 && j > 1)
- error ("non-unique member `%s' requires type instantiation", name);
- if (intype)
- {
- while (j--)
- if (TYPE_FN_FIELD_TYPE (f, j) == intype)
- break;
- if (j < 0)
- error ("no member function matches that type instantiation");
- }
- else
- j = 0;
-
- check_stub_method (t, i, j);
- if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
- {
- return value_from_longest (
- lookup_pointer_type (
- lookup_member_type (TYPE_FN_FIELD_TYPE (f, j),
- baseclass)),
- (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
- }
- else
- {
- struct symbol *s = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
- 0, VAR_NAMESPACE, 0, NULL);
- v = locate_var_value (s, 0);
- VALUE_TYPE (v) = lookup_pointer_type (lookup_member_type (TYPE_FN_FIELD_TYPE (f, j), baseclass));
- return v;
- }
- }
- }
-
- if (TYPE_N_BASECLASSES (t) == 0)
- break;
-
- t = TYPE_BASECLASS (t, 0);
- }
- return 0;
-}
-
-/* Compare two argument lists and return the position in which they differ,
- or zero if equal.
-
- STATICP is nonzero if the T1 argument list came from a
- static member function.
-
- For non-static member functions, we ignore the first argument,
- which is the type of the instance variable. This is because we want
- to handle calls with objects from derived classes. This is not
- entirely correct: we should actually check to make sure that a
- requested operation is type secure, shouldn't we? FIXME. */
-
-int
-typecmp (staticp, t1, t2)
- int staticp;
- struct type *t1[];
- value t2[];
-{
- int i;
-
- if (t2 == 0)
- return 1;
- if (staticp && t1 == 0)
- return t2[1] != 0;
- if (t1 == 0)
- return 1;
- if (t1[0]->code == TYPE_CODE_VOID) return 0;
- if (t1[!staticp] == 0) return 0;
- for (i = !staticp; t1[i] && t1[i]->code != TYPE_CODE_VOID; i++)
- {
- if (! t2[i]
- || t1[i]->code != t2[i]->type->code
-/* Too pessimistic: || t1[i]->target_type != t2[i]->type->target_type */
- )
- return i+1;
- }
- if (!t1[i]) return 0;
- return t2[i] ? i+1 : 0;
-}
-
-/* C++: return the value of the class instance variable, if one exists.
- Flag COMPLAIN signals an error if the request is made in an
- inappropriate context. */
-value
-value_of_this (complain)
- int complain;
-{
- extern FRAME selected_frame;
- struct symbol *func, *sym;
- struct block *b;
- int i;
- static const char funny_this[] = "this";
- value this;
-
- if (selected_frame == 0)
- if (complain)
- error ("no frame selected");
- else return 0;
-
- func = get_frame_function (selected_frame);
- if (!func)
- {
- if (complain)
- error ("no `this' in nameless context");
- else return 0;
- }
-
- b = SYMBOL_BLOCK_VALUE (func);
- i = BLOCK_NSYMS (b);
- if (i <= 0)
- if (complain)
- error ("no args, no `this'");
- else return 0;
-
- /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
- symbol instead of the LOC_ARG one (if both exist). */
- sym = lookup_block_symbol (b, funny_this, VAR_NAMESPACE);
- if (sym == NULL)
- {
- if (complain)
- error ("current stack frame not in method");
- else
- return NULL;
- }
-
- this = read_var_value (sym, selected_frame);
- if (this == 0 && complain)
- error ("`this' argument at unknown address");
- return this;
-}
diff --git a/gdb/valprint.c b/gdb/valprint.c
deleted file mode 100644
index 1baf698..0000000
--- a/gdb/valprint.c
+++ /dev/null
@@ -1,2053 +0,0 @@
-/* Print values for GNU debugger gdb.
- Copyright (C) 1986, 1988, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "target.h"
-#include "obstack.h"
-#include "language.h"
-
-#include <errno.h>
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-extern void print_scalar_formatted(); /* printcmd.c */
-extern void print_address_demangle(); /* printcmd.c */
-extern int demangle; /* whether to print C++ syms raw or source-form */
-
-/* Maximum number of chars to print for a string pointer value
- or vector contents, or UINT_MAX for no limit. */
-
-static unsigned int print_max;
-
-static void type_print_varspec_suffix ();
-static void type_print_varspec_prefix ();
-static void type_print_base ();
-static void type_print_method_args ();
-
-/* Default input and output radixes, and output format letter. */
-
-unsigned input_radix = 10;
-unsigned output_radix = 10;
-int output_format = 0;
-
-
-char **unsigned_type_table;
-char **signed_type_table;
-char **float_type_table;
-
-
-/* Print repeat counts if there are more than this
- many repetitions of an element in an array. */
-#define REPEAT_COUNT_THRESHOLD 10
-
-/* Define a mess of print controls. */
-
-int prettyprint; /* Controls pretty printing of structures */
-int vtblprint; /* Controls printing of vtbl's */
-int unionprint; /* Controls printing of nested unions. */
-int arrayprint; /* Controls pretty printing of arrays. */
-int addressprint; /* Controls pretty printing of addresses. */
-int objectprint; /* Controls looking up an object's derived type
- using what we find in its vtables. */
-
-struct obstack dont_print_obstack;
-
-static void cplus_val_print ();
-
-/* Print the character string STRING, printing at most LENGTH characters.
- Printing stops early if the number hits print_max; repeat counts
- are printed as appropriate. Print ellipses at the end if we
- had to stop before printing LENGTH characters, or if FORCE_ELLIPSES. */
-
-void
-print_string (stream, string, length, force_ellipses)
- FILE *stream;
- char *string;
- unsigned int length;
- int force_ellipses;
-{
- register unsigned int i;
- unsigned int things_printed = 0;
- int in_quotes = 0;
- int need_comma = 0;
- extern int inspect_it;
-
- if (length == 0)
- {
- fputs_filtered ("\"\"", stdout);
- return;
- }
-
- for (i = 0; i < length && things_printed < print_max; ++i)
- {
- /* Position of the character we are examining
- to see whether it is repeated. */
- unsigned int rep1;
- /* Number of repetitions we have detected so far. */
- unsigned int reps;
-
- QUIT;
-
- if (need_comma)
- {
- fputs_filtered (", ", stream);
- need_comma = 0;
- }
-
- rep1 = i + 1;
- reps = 1;
- while (rep1 < length && string[rep1] == string[i])
- {
- ++rep1;
- ++reps;
- }
-
- if (reps > REPEAT_COUNT_THRESHOLD)
- {
- if (in_quotes)
- {
- if (inspect_it)
- fputs_filtered ("\\\", ", stream);
- else
- fputs_filtered ("\", ", stream);
- in_quotes = 0;
- }
- fputs_filtered ("'", stream);
- printchar (string[i], stream, '\'');
- fprintf_filtered (stream, "' <repeats %u times>", reps);
- i = rep1 - 1;
- things_printed += REPEAT_COUNT_THRESHOLD;
- need_comma = 1;
- }
- else
- {
- if (!in_quotes)
- {
- if (inspect_it)
- fputs_filtered ("\\\"", stream);
- else
- fputs_filtered ("\"", stream);
- in_quotes = 1;
- }
- printchar (string[i], stream, '"');
- ++things_printed;
- }
- }
-
- /* Terminate the quotes if necessary. */
- if (in_quotes)
- {
- if (inspect_it)
- fputs_filtered ("\\\"", stream);
- else
- fputs_filtered ("\"", stream);
- }
-
- if (force_ellipses || i < length)
- fputs_filtered ("...", stream);
-}
-
-/* Print a floating point value of type TYPE, pointed to in GDB by VALADDR,
- on STREAM. */
-
-void
-print_floating (valaddr, type, stream)
- char *valaddr;
- struct type *type;
- FILE *stream;
-{
- double doub;
- int inv;
- unsigned len = TYPE_LENGTH (type);
-
-#if defined (IEEE_FLOAT)
-
- /* Check for NaN's. Note that this code does not depend on us being
- on an IEEE conforming system. It only depends on the target
- machine using IEEE representation. This means (a)
- cross-debugging works right, and (2) IEEE_FLOAT can (and should)
- be defined for systems like the 68881, which uses IEEE
- representation, but is not IEEE conforming. */
-
- {
- long low, high;
- /* Is the sign bit 0? */
- int nonnegative;
- /* Is it is a NaN (i.e. the exponent is all ones and
- the fraction is nonzero)? */
- int is_nan;
-
- if (len == sizeof (float))
- {
- /* It's single precision. */
- bcopy (valaddr, &low, sizeof (low));
- /* target -> host. */
- SWAP_TARGET_AND_HOST (&low, sizeof (float));
- nonnegative = low >= 0;
- is_nan = ((((low >> 23) & 0xFF) == 0xFF)
- && 0 != (low & 0x7FFFFF));
- low &= 0x7fffff;
- high = 0;
- }
- else
- {
- /* It's double precision. Get the high and low words. */
-
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
- bcopy (valaddr+4, &low, sizeof (low));
- bcopy (valaddr+0, &high, sizeof (high));
-#else
- bcopy (valaddr+0, &low, sizeof (low));
- bcopy (valaddr+4, &high, sizeof (high));
-#endif
- SWAP_TARGET_AND_HOST (&low, sizeof (low));
- SWAP_TARGET_AND_HOST (&high, sizeof (high));
- nonnegative = high >= 0;
- is_nan = (((high >> 20) & 0x7ff) == 0x7ff
- && ! ((((high & 0xfffff) == 0)) && (low == 0)));
- high &= 0xfffff;
- }
-
- if (is_nan)
- {
- /* The meaning of the sign and fraction is not defined by IEEE.
- But the user might know what they mean. For example, they
- (in an implementation-defined manner) distinguish between
- signaling and quiet NaN's. */
- if (high)
- fprintf_filtered (stream, "-NaN(0x%lx%.8lx)" + nonnegative,
- high, low);
- else
- fprintf_filtered (stream, "-NaN(0x%lx)" + nonnegative, low);
- return;
- }
- }
-#endif /* IEEE_FLOAT. */
-
- doub = unpack_double (type, valaddr, &inv);
- if (inv)
- fprintf_filtered (stream, "<invalid float value>");
- else
- fprintf_filtered (stream, len <= sizeof(float) ? "%.9g" : "%.17g", doub);
-}
-
-/* VALADDR points to an integer of LEN bytes. Print it in hex on stream. */
-static void
-print_hex_chars (stream, valaddr, len)
- FILE *stream;
- unsigned char *valaddr;
- unsigned len;
-{
- unsigned char *p;
-
- fprintf_filtered (stream, "0x");
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
- for (p = valaddr;
- p < valaddr + len;
- p++)
-#else /* Little endian. */
- for (p = valaddr + len - 1;
- p >= valaddr;
- p--)
-#endif
- {
- fprintf_filtered (stream, "%02x", *p);
- }
-}
-
-/* Print the value VAL in C-ish syntax on stream STREAM.
- FORMAT is a format-letter, or 0 for print in natural format of data type.
- If the object printed is a string pointer, returns
- the number of string bytes printed. */
-
-int
-value_print (val, stream, format, pretty)
- value val;
- FILE *stream;
- char format;
- enum val_prettyprint pretty;
-{
- register unsigned int i, n, typelen;
-
- if (val == 0)
- {
- printf_filtered ("<address of value unknown>");
- return 0;
- }
- if (VALUE_OPTIMIZED_OUT (val))
- {
- printf_filtered ("<value optimized out>");
- return 0;
- }
-
- /* A "repeated" value really contains several values in a row.
- They are made by the @ operator.
- Print such values as if they were arrays. */
-
- else if (VALUE_REPEATED (val))
- {
- n = VALUE_REPETITIONS (val);
- typelen = TYPE_LENGTH (VALUE_TYPE (val));
- fprintf_filtered (stream, "{");
- /* Print arrays of characters using string syntax. */
- if (typelen == 1 && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT
- && format == 0)
- print_string (stream, VALUE_CONTENTS (val), n, 0);
- else
- {
- unsigned int things_printed = 0;
-
- for (i = 0; i < n && things_printed < print_max; i++)
- {
- /* Position of the array element we are examining to see
- whether it is repeated. */
- unsigned int rep1;
- /* Number of repetitions we have detected so far. */
- unsigned int reps;
-
- if (i != 0)
- fprintf_filtered (stream, ", ");
- wrap_here ("");
-
- rep1 = i + 1;
- reps = 1;
- while (rep1 < n
- && !bcmp (VALUE_CONTENTS (val) + typelen * i,
- VALUE_CONTENTS (val) + typelen * rep1, typelen))
- {
- ++reps;
- ++rep1;
- }
-
- if (reps > REPEAT_COUNT_THRESHOLD)
- {
- val_print (VALUE_TYPE (val),
- VALUE_CONTENTS (val) + typelen * i,
- VALUE_ADDRESS (val) + typelen * i,
- stream, format, 1, 0, pretty);
- fprintf (stream, " <repeats %u times>", reps);
- i = rep1 - 1;
- things_printed += REPEAT_COUNT_THRESHOLD;
- }
- else
- {
- val_print (VALUE_TYPE (val),
- VALUE_CONTENTS (val) + typelen * i,
- VALUE_ADDRESS (val) + typelen * i,
- stream, format, 1, 0, pretty);
- things_printed++;
- }
- }
- if (i < n)
- fprintf_filtered (stream, "...");
- }
- fprintf_filtered (stream, "}");
- return n * typelen;
- }
- else
- {
- struct type *type = VALUE_TYPE (val);
-
- /* If it is a pointer, indicate what it points to.
-
- Print type also if it is a reference.
-
- C++: if it is a member pointer, we will take care
- of that when we print it. */
- if (TYPE_CODE (type) == TYPE_CODE_PTR
- || TYPE_CODE (type) == TYPE_CODE_REF)
- {
- /* Hack: remove (char *) for char strings. Their
- type is indicated by the quoted string anyway. */
- if (TYPE_CODE (type) == TYPE_CODE_PTR
- && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == sizeof(char)
- && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_INT
- && !TYPE_UNSIGNED (TYPE_TARGET_TYPE (type)))
- {
- /* Print nothing */
- }
- else
- {
- fprintf_filtered (stream, "(");
- type_print (type, "", stream, -1);
- fprintf_filtered (stream, ") ");
- }
- }
- return val_print (type, VALUE_CONTENTS (val),
- VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
- }
-}
-
-/* Return truth value for assertion that TYPE is of the type
- "pointer to virtual function". */
-static int
-is_vtbl_ptr_type(type)
- struct type *type;
-{
- char *typename = type_name_no_tag (type);
- static const char vtbl_ptr_name[] =
- { CPLUS_MARKER,'v','t','b','l','_','p','t','r','_','t','y','p','e', 0 };
-
- return (typename != NULL && !strcmp(typename, vtbl_ptr_name));
-}
-
-/* Return truth value for the assertion that TYPE is of the type
- "pointer to virtual function table". */
-static int
-is_vtbl_member(type)
- struct type *type;
-{
- if (TYPE_CODE (type) == TYPE_CODE_PTR)
- type = TYPE_TARGET_TYPE (type);
- else
- return 0;
-
- if (TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT)
- /* Virtual functions tables are full of pointers to virtual functions. */
- return is_vtbl_ptr_type (TYPE_TARGET_TYPE (type));
- return 0;
-}
-
-/* Mutually recursive subroutines of cplus_val_print and val_print to print out
- a structure's fields: val_print_fields and cplus_val_print.
-
- TYPE, VALADDR, STREAM, RECURSE, and PRETTY have the
- same meanings as in cplus_val_print and val_print.
-
- DONT_PRINT is an array of baseclass types that we
- should not print, or zero if called from top level. */
-static void
-val_print_fields (type, valaddr, stream, format, recurse, pretty, dont_print)
- struct type *type;
- char *valaddr;
- FILE *stream;
- char format;
- int recurse;
- enum val_prettyprint pretty;
- struct type **dont_print;
-{
- int i, len, n_baseclasses;
-
- check_stub_type (type);
-
- fprintf_filtered (stream, "{");
- len = TYPE_NFIELDS (type);
- n_baseclasses = TYPE_N_BASECLASSES (type);
-
- /* Print out baseclasses such that we don't print
- duplicates of virtual baseclasses. */
- if (n_baseclasses > 0)
- cplus_val_print (type, valaddr, stream, format, recurse+1, pretty, dont_print);
-
- if (!len && n_baseclasses == 1)
- fprintf_filtered (stream, "<No data fields>");
- else
- {
- extern int inspect_it;
- int fields_seen = 0;
-
- for (i = n_baseclasses; i < len; i++)
- {
- /* Check if static field */
- if (TYPE_FIELD_STATIC (type, i))
- continue;
- if (fields_seen)
- fprintf_filtered (stream, ", ");
- else if (n_baseclasses > 0)
- {
- fprintf_filtered (stream, "\n");
- print_spaces_filtered (2 + 2 * recurse, stream);
- fputs_filtered ("members of ", stream);
- fputs_filtered (type_name_no_tag (type), stream);
- fputs_filtered (": ", stream);
- }
- fields_seen = 1;
-
- if (pretty)
- {
- fprintf_filtered (stream, "\n");
- print_spaces_filtered (2 + 2 * recurse, stream);
- }
- else
- {
- wrap_here (n_spaces (2 + 2 * recurse));
- }
- if (inspect_it)
- {
- if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR)
- fputs_filtered ("\"( ptr \"", stream);
- else
- fputs_filtered ("\"( nodef \"", stream);
- fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
- fputs_filtered ("\" \"", stream);
- fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
- fputs_filtered ("\") \"", stream);
- }
- else
- {
- fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
- fputs_filtered (" = ", stream);
- }
- if (TYPE_FIELD_PACKED (type, i))
- {
- value v;
-
- /* Bitfields require special handling, especially due to byte
- order problems. */
- v = value_from_longest (TYPE_FIELD_TYPE (type, i),
- unpack_field_as_long (type, valaddr, i));
-
- val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0,
- stream, format, 0, recurse + 1, pretty);
- }
- else
- {
- val_print (TYPE_FIELD_TYPE (type, i),
- valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
- 0, stream, format, 0, recurse + 1, pretty);
- }
- }
- if (pretty)
- {
- fprintf_filtered (stream, "\n");
- print_spaces_filtered (2 * recurse, stream);
- }
- }
- fprintf_filtered (stream, "}");
-}
-
-/* Special val_print routine to avoid printing multiple copies of virtual
- baseclasses. */
-
-static void
-cplus_val_print (type, valaddr, stream, format, recurse, pretty, dont_print)
- struct type *type;
- char *valaddr;
- FILE *stream;
- char format;
- int recurse;
- enum val_prettyprint pretty;
- struct type **dont_print;
-{
- struct obstack tmp_obstack;
- struct type **last_dont_print
- = (struct type **)obstack_next_free (&dont_print_obstack);
- int i, n_baseclasses = TYPE_N_BASECLASSES (type);
-
- if (dont_print == 0)
- {
- /* If we're at top level, carve out a completely fresh
- chunk of the obstack and use that until this particular
- invocation returns. */
- tmp_obstack = dont_print_obstack;
- /* Bump up the high-water mark. Now alpha is omega. */
- obstack_finish (&dont_print_obstack);
- }
-
- for (i = 0; i < n_baseclasses; i++)
- {
- char *baddr;
- int err;
-
- if (BASETYPE_VIA_VIRTUAL (type, i))
- {
- struct type **first_dont_print
- = (struct type **)obstack_base (&dont_print_obstack);
-
- int j = (struct type **)obstack_next_free (&dont_print_obstack)
- - first_dont_print;
-
- while (--j >= 0)
- if (TYPE_BASECLASS (type, i) == first_dont_print[j])
- goto flush_it;
-
- obstack_ptr_grow (&dont_print_obstack, TYPE_BASECLASS (type, i));
- }
-
- baddr = baseclass_addr (type, i, valaddr, 0, &err);
- if (err == 0 && baddr == 0)
- error ("could not find virtual baseclass `%s'\n",
- type_name_no_tag (TYPE_BASECLASS (type, i)));
-
- fprintf_filtered (stream, "\n");
- if (pretty)
- print_spaces_filtered (2 + 2 * recurse, stream);
- fputs_filtered ("<", stream);
- fputs_filtered (type_name_no_tag (TYPE_BASECLASS (type, i)), stream);
- fputs_filtered ("> = ", stream);
- if (err != 0)
- fprintf_filtered (stream, "<invalid address 0x%x>", baddr);
- else
- val_print_fields (TYPE_BASECLASS (type, i), baddr, stream, format,
- recurse, pretty,
- (struct type **)obstack_base (&dont_print_obstack));
- flush_it:
- ;
- }
-
- if (dont_print == 0)
- {
- /* Free the space used to deal with the printing
- of this type from top level. */
- obstack_free (&dont_print_obstack, last_dont_print);
- /* Reset watermark so that we can continue protecting
- ourselves from whatever we were protecting ourselves. */
- dont_print_obstack = tmp_obstack;
- }
-}
-
-/* Print data of type TYPE located at VALADDR (within GDB),
- which came from the inferior at address ADDRESS,
- onto stdio stream STREAM according to FORMAT
- (a letter or 0 for natural format). The data at VALADDR
- is in target byte order.
-
- If the data are a string pointer, returns the number of
- sting characters printed.
-
- if DEREF_REF is nonzero, then dereference references,
- otherwise just print them like pointers.
-
- The PRETTY parameter controls prettyprinting. */
-
-int
-val_print (type, valaddr, address, stream, format,
- deref_ref, recurse, pretty)
- struct type *type;
- char *valaddr;
- CORE_ADDR address;
- FILE *stream;
- char format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
-{
- register unsigned int i;
- unsigned len;
- struct type *elttype;
- unsigned eltlen;
- LONGEST val;
- unsigned char c;
-
- if (pretty == Val_pretty_default)
- {
- pretty = prettyprint ? Val_prettyprint : Val_no_prettyprint;
- }
-
- QUIT;
-
- check_stub_type (type);
-
- if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
- {
- fprintf_filtered (stream, "<unknown struct>");
- fflush (stream);
- return 0;
- }
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_ARRAY:
- /* FIXME: TYPE_LENGTH (type) is unsigned and therefore always
- >= 0. Is "> 0" meant? I'm not sure what an "array of
- unspecified length" (mentioned in the comment for the else-part
- of this if) is. */
- if (TYPE_LENGTH (type) >= 0
- && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
- {
- elttype = TYPE_TARGET_TYPE (type);
- eltlen = TYPE_LENGTH (elttype);
- len = TYPE_LENGTH (type) / eltlen;
- if (arrayprint)
- print_spaces_filtered (2 + 2 * recurse, stream);
- fprintf_filtered (stream, "{");
- /* For an array of chars, print with string syntax. */
- if (eltlen == 1 && TYPE_CODE (elttype) == TYPE_CODE_INT
- && (format == 0 || format == 's') )
- print_string (stream, valaddr, len, 0);
- else
- {
- unsigned int things_printed = 0;
-
- /* If this is a virtual function table, print the 0th
- entry specially, and the rest of the members normally. */
- if (is_vtbl_ptr_type (elttype))
- {
- fprintf_filtered (stream, "%d vtable entries", len-1);
- i = 1;
- }
- else
- i = 0;
-
- for (; i < len && things_printed < print_max; i++)
- {
- /* Position of the array element we are examining to see
- whether it is repeated. */
- unsigned int rep1;
- /* Number of repetitions we have detected so far. */
- unsigned int reps;
-
- if (i != 0)
- if (arrayprint)
- {
- fprintf_filtered (stream, ",\n");
- print_spaces_filtered (2 + 2 * recurse, stream);
- }
- else
- fprintf_filtered (stream, ", ");
- wrap_here (n_spaces (2 + 2 * recurse));
-
- rep1 = i + 1;
- reps = 1;
- while (rep1 < len
- && !bcmp (valaddr + i * eltlen,
- valaddr + rep1 * eltlen, eltlen))
- {
- ++reps;
- ++rep1;
- }
-
- if (reps > REPEAT_COUNT_THRESHOLD)
- {
- val_print (elttype, valaddr + i * eltlen,
- 0, stream, format, deref_ref,
- recurse + 1, pretty);
- fprintf_filtered (stream, " <repeats %u times>", reps);
- i = rep1 - 1;
- things_printed += REPEAT_COUNT_THRESHOLD;
- }
- else
- {
- val_print (elttype, valaddr + i * eltlen,
- 0, stream, format, deref_ref,
- recurse + 1, pretty);
- things_printed++;
- }
- }
- if (i < len)
- fprintf_filtered (stream, "...");
- }
- fprintf_filtered (stream, "}");
- break;
- }
- /* Array of unspecified length: treat like pointer to first elt. */
- valaddr = (char *) &address;
-
- case TYPE_CODE_PTR:
- if (format && format != 's')
- {
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD)
- {
- struct type *domain = TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (type));
- struct fn_field *f;
- int j, len2;
- char *kind = "";
- CORE_ADDR addr;
-
- addr = unpack_pointer (lookup_pointer_type (builtin_type_void),
- valaddr);
- if (addr < 128)
- {
- len = TYPE_NFN_FIELDS (domain);
- for (i = 0; i < len; i++)
- {
- f = TYPE_FN_FIELDLIST1 (domain, i);
- len2 = TYPE_FN_FIELDLIST_LENGTH (domain, i);
-
- for (j = 0; j < len2; j++)
- {
- QUIT;
- if (TYPE_FN_FIELD_VOFFSET (f, j) == addr)
- {
- kind = "virtual";
- goto common;
- }
- }
- }
- }
- else
- {
- struct symbol *sym = find_pc_function (addr);
- if (sym == 0)
- error ("invalid pointer to member function");
- len = TYPE_NFN_FIELDS (domain);
- for (i = 0; i < len; i++)
- {
- f = TYPE_FN_FIELDLIST1 (domain, i);
- len2 = TYPE_FN_FIELDLIST_LENGTH (domain, i);
-
- for (j = 0; j < len2; j++)
- {
- QUIT;
- if (!strcmp (SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j)))
- goto common;
- }
- }
- }
- common:
- if (i < len)
- {
- fprintf_filtered (stream, "&");
- type_print_varspec_prefix (TYPE_FN_FIELD_TYPE (f, j), stream, 0, 0);
- fprintf (stream, kind);
- if (TYPE_FN_FIELD_PHYSNAME (f, j)[0] == '_'
- && TYPE_FN_FIELD_PHYSNAME (f, j)[1] == CPLUS_MARKER)
- type_print_method_args
- (TYPE_FN_FIELD_ARGS (f, j) + 1, "~",
- TYPE_FN_FIELDLIST_NAME (domain, i), 0, stream);
- else
- type_print_method_args
- (TYPE_FN_FIELD_ARGS (f, j), "",
- TYPE_FN_FIELDLIST_NAME (domain, i), 0, stream);
- break;
- }
- fprintf_filtered (stream, "(");
- type_print (type, "", stream, -1);
- fprintf_filtered (stream, ") %d", (int) addr >> 3);
- }
- else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_MEMBER)
- {
- struct type *domain = TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (type));
-
- /* VAL is a byte offset into the structure type DOMAIN.
- Find the name of the field for that offset and
- print it. */
- int extra = 0;
- int bits = 0;
- len = TYPE_NFIELDS (domain);
- /* @@ Make VAL into bit offset */
- val = unpack_long (builtin_type_int, valaddr) << 3;
- for (i = TYPE_N_BASECLASSES (domain); i < len; i++)
- {
- int bitpos = TYPE_FIELD_BITPOS (domain, i);
- QUIT;
- if (val == bitpos)
- break;
- if (val < bitpos && i != 0)
- {
- /* Somehow pointing into a field. */
- i -= 1;
- extra = (val - TYPE_FIELD_BITPOS (domain, i));
- if (extra & 0x3)
- bits = 1;
- else
- extra >>= 3;
- break;
- }
- }
- if (i < len)
- {
- fprintf_filtered (stream, "&");
- type_print_base (domain, stream, 0, 0);
- fprintf_filtered (stream, "::");
- fputs_filtered (TYPE_FIELD_NAME (domain, i), stream);
- if (extra)
- fprintf_filtered (stream, " + %d bytes", extra);
- if (bits)
- fprintf_filtered (stream, " (offset in bits)");
- break;
- }
- fprintf_filtered (stream, "%d", val >> 3);
- }
- else
- {
- CORE_ADDR addr = unpack_pointer (type, valaddr);
- elttype = TYPE_TARGET_TYPE (type);
-
- if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
- {
- /* Try to print what function it points to. */
- print_address_demangle (addr, stream, demangle);
- /* Return value is irrelevant except for string pointers. */
- return 0;
- }
-
- if (addressprint && format != 's')
- fprintf_filtered (stream, "0x%x", addr);
-
- /* For a pointer to char or unsigned char,
- also print the string pointed to, unless pointer is null. */
- i = 0; /* Number of characters printed. */
- if (TYPE_LENGTH (elttype) == 1
- && TYPE_CODE (elttype) == TYPE_CODE_INT
- && (format == 0 || format == 's')
- && addr != 0
- /* If print_max is UINT_MAX, the alloca below will fail.
- In that case don't try to print the string. */
- && print_max < UINT_MAX)
- {
- int first_addr_err = 0;
- int errcode = 0;
-
- /* Get first character. */
- errcode = target_read_memory (addr, (char *)&c, 1);
- if (errcode != 0)
- {
- /* First address out of bounds. */
- first_addr_err = 1;
- }
- else
- {
- /* A real string. */
- char *string = (char *) alloca (print_max);
-
- /* If the loop ends by us hitting print_max characters,
- we need to have elipses at the end. */
- int force_ellipses = 1;
-
- /* This loop always fetches print_max characters, even
- though print_string might want to print more or fewer
- (with repeated characters). This is so that
- we don't spend forever fetching if we print
- a long string consisting of the same character
- repeated. Also so we can do it all in one memory
- operation, which is faster. However, this will be
- slower if print_max is set high, e.g. if you set
- print_max to 1000, not only will it take a long
- time to fetch short strings, but if you are near
- the end of the address space, it might not work.
- FIXME. */
- QUIT;
- errcode = target_read_memory (addr, string, print_max);
- if (errcode != 0)
- force_ellipses = 0;
- else
- for (i = 0; i < print_max; i++)
- if (string[i] == '\0')
- {
- force_ellipses = 0;
- break;
- }
- QUIT;
-
- if (addressprint)
- fputs_filtered (" ", stream);
- print_string (stream, string, i, force_ellipses);
- }
-
- if (errcode != 0)
- {
- if (errcode == EIO)
- {
- fprintf_filtered (stream,
- (" <Address 0x%x out of bounds>"
- + first_addr_err),
- addr + i);
- }
- else
- {
- if (errcode >= sys_nerr || errcode < 0)
- error ("Error reading memory address 0x%x: unknown error (%d).",
- addr + i, errcode);
- else
- error ("Error reading memory address 0x%x: %s.",
- addr + i, sys_errlist[errcode]);
- }
- }
-
- fflush (stream);
- }
- else /* print vtbl's nicely */
- if (is_vtbl_member(type))
- {
- CORE_ADDR vt_address = unpack_pointer (type, valaddr);
-
- int vt_index = find_pc_misc_function (vt_address);
- if (vt_index >= 0
- && vt_address == misc_function_vector[vt_index].address)
- {
- fputs_filtered (" <", stream);
- fputs_demangled (misc_function_vector[vt_index].name,
- stream, 1);
- fputs_filtered (">", stream);
- }
- if (vtblprint)
- {
- value vt_val;
-
- vt_val = value_at (TYPE_TARGET_TYPE (type), vt_address);
- val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val),
- VALUE_ADDRESS (vt_val), stream, format,
- deref_ref, recurse + 1, pretty);
- if (pretty)
- {
- fprintf_filtered (stream, "\n");
- print_spaces_filtered (2 + 2 * recurse, stream);
- }
- }
- }
-
- /* Return number of characters printed, plus one for the
- terminating null if we have "reached the end". */
- return i + (print_max && i != print_max);
- }
- break;
-
- case TYPE_CODE_MEMBER:
- error ("not implemented: member type in val_print");
- break;
-
- case TYPE_CODE_REF:
- if (addressprint)
- {
- fprintf_filtered (stream, "@0x%lx",
- unpack_long (builtin_type_int, valaddr));
- if (deref_ref)
- fputs_filtered (": ", stream);
- }
- /* De-reference the reference. */
- if (deref_ref)
- {
- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_UNDEF)
- {
- value deref_val =
- value_at
- (TYPE_TARGET_TYPE (type),
- unpack_pointer (lookup_pointer_type (builtin_type_void),
- valaddr));
- val_print (VALUE_TYPE (deref_val), VALUE_CONTENTS (deref_val),
- VALUE_ADDRESS (deref_val), stream, format,
- deref_ref, recurse + 1, pretty);
- }
- else
- fputs_filtered ("???", stream);
- }
- break;
-
- case TYPE_CODE_UNION:
- if (recurse && !unionprint)
- {
- fprintf_filtered (stream, "{...}");
- break;
- }
- /* Fall through. */
- case TYPE_CODE_STRUCT:
- if (vtblprint && is_vtbl_ptr_type(type))
- {
- /* Print the unmangled name if desired. */
- print_address_demangle(*((int *) (valaddr + /* FIXME bytesex */
- TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8)),
- stream, demangle);
- break;
- }
- val_print_fields (type, valaddr, stream, format, recurse, pretty, 0);
- break;
-
- case TYPE_CODE_ENUM:
- if (format)
- {
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- len = TYPE_NFIELDS (type);
- val = unpack_long (builtin_type_int, valaddr);
- for (i = 0; i < len; i++)
- {
- QUIT;
- if (val == TYPE_FIELD_BITPOS (type, i))
- break;
- }
- if (i < len)
- fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
- else
-#ifdef LONG_LONG
- fprintf_filtered (stream, "%lld", val);
-#else
- fprintf_filtered (stream, "%ld", val);
-#endif
- break;
-
- case TYPE_CODE_FUNC:
- if (format)
- {
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- /* FIXME, we should consider, at least for ANSI C language, eliminating
- the distinction made between FUNCs and POINTERs to FUNCs. */
- fprintf_filtered (stream, "{");
- type_print (type, "", stream, -1);
- fprintf_filtered (stream, "} ");
- /* Try to print what function it points to, and its address. */
- print_address_demangle (address, stream, demangle);
- break;
-
- case TYPE_CODE_INT:
- if (format || output_format)
- {
- print_scalar_formatted (valaddr, type,
- format? format: output_format,
- 0, stream);
- break;
- }
- if (TYPE_LENGTH (type) > sizeof (LONGEST))
- {
- if (TYPE_UNSIGNED (type))
- {
- /* First figure out whether the number in fact has zeros
- in all its bytes more significant than least significant
- sizeof (LONGEST) ones. */
- char *p;
- /* Pointer to first (i.e. lowest address) nonzero character. */
- char *first_addr;
- len = TYPE_LENGTH (type);
-
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
- for (p = valaddr;
- len > sizeof (LONGEST)
- && p < valaddr + TYPE_LENGTH (type);
- p++)
-#else /* Little endian. */
- first_addr = valaddr;
- for (p = valaddr + TYPE_LENGTH (type);
- len > sizeof (LONGEST) && p >= valaddr;
- p--)
-#endif /* Little endian. */
- {
- if (*p == 0)
- len--;
- else
- break;
- }
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
- first_addr = p;
-#endif
-
- if (len <= sizeof (LONGEST))
- {
- /* We can print it in decimal. */
- fprintf_filtered
- (stream,
-#if defined (LONG_LONG)
- "%llu",
-#else
- "%lu",
-#endif
- unpack_long (BUILTIN_TYPE_LONGEST, first_addr));
- }
- else
- {
- /* It is big, so print it in hex. */
- print_hex_chars (stream, (unsigned char *)first_addr, len);
- }
- }
- else
- {
- /* Signed. One could assume two's complement (a reasonable
- assumption, I think) and do better than this. */
- print_hex_chars (stream, (unsigned char *)valaddr,
- TYPE_LENGTH (type));
- }
- break;
- }
-#ifdef PRINT_TYPELESS_INTEGER
- PRINT_TYPELESS_INTEGER (stream, type, unpack_long (type, valaddr));
-#else
-#ifndef LONG_LONG
- fprintf_filtered (stream,
- TYPE_UNSIGNED (type) ? "%u" : "%d",
- unpack_long (type, valaddr));
-#else
- fprintf_filtered (stream,
- TYPE_UNSIGNED (type) ? "%llu" : "%lld",
- unpack_long (type, valaddr));
-#endif
-#endif
-
- if (TYPE_LENGTH (type) == 1)
- {
- fprintf_filtered (stream, " '");
- printchar ((unsigned char) unpack_long (type, valaddr),
- stream, '\'');
- fprintf_filtered (stream, "'");
- }
- break;
-
- case TYPE_CODE_FLT:
- if (format)
- print_scalar_formatted (valaddr, type, format, 0, stream);
- else
- print_floating (valaddr, type, stream);
- break;
-
- case TYPE_CODE_VOID:
- fprintf_filtered (stream, "void");
- break;
-
- case TYPE_CODE_UNDEF:
- /* This happens (without TYPE_FLAG_STUB set) on systems which don't use
- dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
- and no complete type for struct foo in that file. */
- fprintf_filtered (stream, "<unknown struct>");
- break;
-
- case TYPE_CODE_ERROR:
- fprintf_filtered (stream, "?");
- break;
-
- case TYPE_CODE_RANGE:
- /* FIXME, we should not ever have to print one of these yet. */
- fprintf_filtered (stream, "<range type>");
- break;
-
- default:
- error ("Invalid type code in symbol table.");
- }
- fflush (stream);
- return 0;
-}
-
-/* Print a description of a type in the format of a
- typedef for the current language.
- NEW is the new name for a type TYPE. */
-void
-typedef_print (type, new, stream)
- struct type *type;
- struct symbol *new;
- FILE *stream;
-{
- switch (current_language->la_language)
- {
-#ifdef _LANG_c
- case language_c:
- fprintf_filtered(stream, "typedef ");
- type_print(type,"",stream,0);
- if(TYPE_NAME ((SYMBOL_TYPE (new))) == 0
- || 0 != strcmp (TYPE_NAME ((SYMBOL_TYPE (new))),
- SYMBOL_NAME (new)))
- fprintf_filtered(stream, " %s", SYMBOL_NAME(new));
- break;
-#endif
-#ifdef _LANG_m2
- case language_m2:
- fprintf_filtered(stream, "TYPE ");
- if(!TYPE_NAME(SYMBOL_TYPE(new)) ||
- strcmp (TYPE_NAME(SYMBOL_TYPE(new)),
- SYMBOL_NAME(new)))
- fprintf_filtered(stream, "%s = ", SYMBOL_NAME(new));
- else
- fprintf_filtered(stream, "<builtin> = ");
- type_print(type,"",stream,0);
- break;
-#endif
- default:
- error("Language not supported.");
- }
- fprintf_filtered(stream, ";\n");
-}
-
-
-/* Print a description of a type TYPE
- in the form of a declaration of a variable named VARSTRING.
- (VARSTRING is demangled if necessary.)
- Output goes to STREAM (via stdio).
- If SHOW is positive, we show the contents of the outermost level
- of structure even if there is a type name that could be used instead.
- If SHOW is negative, we never show the details of elements' types. */
-
-void
-type_print (type, varstring, stream, show)
- struct type *type;
- char *varstring;
- FILE *stream;
- int show;
-{
- type_print_1 (type, varstring, stream, show, 0);
-}
-
-/* LEVEL is the depth to indent lines by. */
-
-void
-type_print_1 (type, varstring, stream, show, level)
- struct type *type;
- char *varstring;
- FILE *stream;
- int show;
- int level;
-{
- register enum type_code code;
- type_print_base (type, stream, show, level);
- code = TYPE_CODE (type);
- if ((varstring && *varstring)
- ||
- /* Need a space if going to print stars or brackets;
- but not if we will print just a type name. */
- ((show > 0 || TYPE_NAME (type) == 0)
- &&
- (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
- || code == TYPE_CODE_METHOD
- || code == TYPE_CODE_ARRAY
- || code == TYPE_CODE_MEMBER
- || code == TYPE_CODE_REF)))
- fprintf_filtered (stream, " ");
- type_print_varspec_prefix (type, stream, show, 0);
- fputs_demangled (varstring, stream, -1); /* Print demangled name
- without arguments */
- type_print_varspec_suffix (type, stream, show, 0);
-}
-
-/* Print the method arguments ARGS to the file STREAM. */
-static void
-type_print_method_args (args, prefix, varstring, staticp, stream)
- struct type **args;
- char *prefix, *varstring;
- int staticp;
- FILE *stream;
-{
- int i;
-
- fputs_filtered (" ", stream);
- fputs_demangled (prefix, stream, 1);
- fputs_demangled (varstring, stream, 1);
- fputs_filtered (" (", stream);
- if (args && args[!staticp] && args[!staticp]->code != TYPE_CODE_VOID)
- {
- i = !staticp; /* skip the class variable */
- while (1)
- {
- type_print (args[i++], "", stream, 0);
- if (!args[i])
- {
- fprintf_filtered (stream, " ...");
- break;
- }
- else if (args[i]->code != TYPE_CODE_VOID)
- {
- fprintf_filtered (stream, ", ");
- }
- else break;
- }
- }
- fprintf_filtered (stream, ")");
-}
-
-/* If TYPE is a derived type, then print out derivation
- information. Print out all layers of the type heirarchy
- until we encounter one with multiple inheritance.
- At that point, print out that ply, and return. */
-static void
-type_print_derivation_info (stream, type)
- FILE *stream;
- struct type *type;
-{
- char *name;
- int i, n_baseclasses = TYPE_N_BASECLASSES (type);
- struct type *basetype = 0;
-
- while (type && n_baseclasses > 0)
- {
- /* Not actually sure about this one -- Bryan. */
- check_stub_type (type);
-
- fprintf_filtered (stream, ": ");
- for (i = 0; ;)
- {
- basetype = TYPE_BASECLASS (type, i);
- if (name = type_name_no_tag (basetype))
- {
- fprintf_filtered (stream, "%s%s ",
- BASETYPE_VIA_PUBLIC(type, i) ? "public" : "private",
- BASETYPE_VIA_VIRTUAL(type, i) ? " virtual" : "");
- fputs_filtered (name, stream);
- }
- i++;
- if (i >= n_baseclasses)
- break;
- fprintf_filtered (stream, ", ");
- }
-
- fprintf_filtered (stream, " ");
- if (n_baseclasses != 1)
- break;
- n_baseclasses = TYPE_N_BASECLASSES (basetype);
- type = basetype;
- }
-}
-
-/* Print any asterisks or open-parentheses needed before the
- variable name (to describe its type).
-
- On outermost call, pass 0 for PASSED_A_PTR.
- On outermost call, SHOW > 0 means should ignore
- any typename for TYPE and show its details.
- SHOW is always zero on recursive calls. */
-
-static void
-type_print_varspec_prefix (type, stream, show, passed_a_ptr)
- struct type *type;
- FILE *stream;
- int show;
- int passed_a_ptr;
-{
- if (type == 0)
- return;
-
- if (TYPE_NAME (type) && show <= 0)
- return;
-
- QUIT;
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_PTR:
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
- fprintf_filtered (stream, "*");
- break;
-
- case TYPE_CODE_MEMBER:
- if (passed_a_ptr)
- fprintf_filtered (stream, "(");
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0,
- 0);
- fprintf_filtered (stream, " ");
- type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0,
- passed_a_ptr);
- fprintf_filtered (stream, "::");
- break;
-
- case TYPE_CODE_METHOD:
- if (passed_a_ptr)
- fprintf (stream, "(");
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0,
- 0);
- if (passed_a_ptr)
- {
- fprintf_filtered (stream, " ");
- type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0,
- passed_a_ptr);
- fprintf_filtered (stream, "::");
- }
- break;
-
- case TYPE_CODE_REF:
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
- fprintf_filtered (stream, "&");
- break;
-
- case TYPE_CODE_FUNC:
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0,
- 0);
- if (passed_a_ptr)
- fprintf_filtered (stream, "(");
- break;
-
- case TYPE_CODE_ARRAY:
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0,
- 0);
- if (passed_a_ptr)
- fprintf_filtered (stream, "(");
-
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_INT:
- case TYPE_CODE_FLT:
- case TYPE_CODE_VOID:
- case TYPE_CODE_ERROR:
- /* These types need no prefix. They are listed here so that
- gcc -Wall will reveal any types that haven't been handled. */
- break;
- }
-}
-
-/* Print any array sizes, function arguments or close parentheses
- needed after the variable name (to describe its type).
- Args work like type_print_varspec_prefix. */
-
-static void
-type_print_varspec_suffix (type, stream, show, passed_a_ptr)
- struct type *type;
- FILE *stream;
- int show;
- int passed_a_ptr;
-{
- if (type == 0)
- return;
-
- if (TYPE_NAME (type) && show <= 0)
- return;
-
- QUIT;
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_ARRAY:
- if (passed_a_ptr)
- fprintf_filtered (stream, ")");
-
- fprintf_filtered (stream, "[");
- if (TYPE_LENGTH (type) > 0
- && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
- fprintf_filtered (stream, "%d",
- (TYPE_LENGTH (type)
- / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
- fprintf_filtered (stream, "]");
-
- type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
- 0);
- break;
-
- case TYPE_CODE_MEMBER:
- if (passed_a_ptr)
- fprintf_filtered (stream, ")");
- type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0);
- break;
-
- case TYPE_CODE_METHOD:
- if (passed_a_ptr)
- fprintf_filtered (stream, ")");
- type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0);
- if (passed_a_ptr)
- {
- int i;
- struct type **args = TYPE_ARG_TYPES (type);
-
- fprintf_filtered (stream, "(");
- if (args[1] == 0)
- fprintf_filtered (stream, "...");
- else for (i = 1; args[i] != 0 && args[i]->code != TYPE_CODE_VOID; i++)
- {
- type_print_1 (args[i], "", stream, -1, 0);
- if (args[i+1] == 0)
- fprintf_filtered (stream, "...");
- else if (args[i+1]->code != TYPE_CODE_VOID) {
- fprintf_filtered (stream, ",");
- wrap_here (" ");
- }
- }
- fprintf_filtered (stream, ")");
- }
- break;
-
- case TYPE_CODE_PTR:
- case TYPE_CODE_REF:
- type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1);
- break;
-
- case TYPE_CODE_FUNC:
- type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
- passed_a_ptr);
- if (passed_a_ptr)
- fprintf_filtered (stream, ")");
- fprintf_filtered (stream, "()");
- break;
-
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_INT:
- case TYPE_CODE_FLT:
- case TYPE_CODE_VOID:
- case TYPE_CODE_ERROR:
- /* These types do not need a suffix. They are listed so that
- gcc -Wall will report types that may not have been considered. */
- break;
- }
-}
-
-/* Print the name of the type (or the ultimate pointer target,
- function value or array element), or the description of a
- structure or union.
-
- SHOW nonzero means don't print this type as just its name;
- show its real definition even if it has a name.
- SHOW zero means print just typename or struct tag if there is one
- SHOW negative means abbreviate structure elements.
- SHOW is decremented for printing of structure elements.
-
- LEVEL is the depth to indent by.
- We increase it for some recursive calls. */
-
-static void
-type_print_base (type, stream, show, level)
- struct type *type;
- FILE *stream;
- int show;
- int level;
-{
- char *name;
- register int i;
- register int len;
- register int lastval;
-
- QUIT;
-
- wrap_here (" ");
- if (type == 0)
- {
- fprintf_filtered (stream, "<type unknown>");
- return;
- }
-
- if (TYPE_NAME (type) && show <= 0)
- {
- fputs_filtered (TYPE_NAME (type), stream);
- return;
- }
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_ARRAY:
- case TYPE_CODE_PTR:
- case TYPE_CODE_MEMBER:
- case TYPE_CODE_REF:
- case TYPE_CODE_FUNC:
- case TYPE_CODE_METHOD:
- type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
- break;
-
- case TYPE_CODE_STRUCT:
- fprintf_filtered (stream, "struct ");
- goto struct_union;
-
- case TYPE_CODE_UNION:
- fprintf_filtered (stream, "union ");
- struct_union:
- if (name = type_name_no_tag (type))
- {
- fputs_filtered (name, stream);
- fputs_filtered (" ", stream);
- wrap_here (" ");
- }
- if (show < 0)
- fprintf_filtered (stream, "{...}");
- else
- {
- check_stub_type (type);
-
- type_print_derivation_info (stream, type);
-
- fprintf_filtered (stream, "{");
- len = TYPE_NFIELDS (type);
- if (len)
- fprintf_filtered (stream, "\n");
- else
- {
- if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
- fprintf_filtered (stream, "<incomplete type>\n");
- else
- fprintf_filtered (stream, "<no data fields>\n");
- }
-
- /* If there is a base class for this type,
- do not print the field that it occupies. */
- for (i = TYPE_N_BASECLASSES (type); i < len; i++)
- {
- QUIT;
- /* Don't print out virtual function table. */
- if ((TYPE_FIELD_NAME (type, i))[5] == CPLUS_MARKER &&
- !strncmp (TYPE_FIELD_NAME (type, i), "_vptr", 5))
- continue;
-
- print_spaces_filtered (level + 4, stream);
- if (TYPE_FIELD_STATIC (type, i))
- {
- fprintf_filtered (stream, "static ");
- }
- type_print_1 (TYPE_FIELD_TYPE (type, i),
- TYPE_FIELD_NAME (type, i),
- stream, show - 1, level + 4);
- if (!TYPE_FIELD_STATIC (type, i)
- && TYPE_FIELD_PACKED (type, i))
- {
- /* It is a bitfield. This code does not attempt
- to look at the bitpos and reconstruct filler,
- unnamed fields. This would lead to misleading
- results if the compiler does not put out fields
- for such things (I don't know what it does). */
- fprintf_filtered (stream, " : %d",
- TYPE_FIELD_BITSIZE (type, i));
- }
- fprintf_filtered (stream, ";\n");
- }
-
- /* C++: print out the methods */
- len = TYPE_NFN_FIELDS (type);
- if (len) fprintf_filtered (stream, "\n");
- for (i = 0; i < len; i++)
- {
- struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
- int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
-
- for (j = 0; j < len2; j++)
- {
- QUIT;
- print_spaces_filtered (level + 4, stream);
- if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
- fprintf_filtered (stream, "virtual ");
- else if (TYPE_FN_FIELD_STATIC_P (f, j))
- fprintf_filtered (stream, "static ");
- if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0)
- {
- /* Keep GDB from crashing here. */
- fprintf (stream, "<undefined type> %s;\n",
- TYPE_FN_FIELD_PHYSNAME (f, j));
- break;
- }
- else
- type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)), "", stream, 0);
- if (TYPE_FLAGS (TYPE_FN_FIELD_TYPE (f, j)) & TYPE_FLAG_STUB)
- {
- /* Build something we can demangle. */
- char *strchr (), *gdb_mangle_name (), *cplus_demangle ();
- char *mangled_name = gdb_mangle_name (type, i, j);
- char *demangled_name = cplus_demangle (mangled_name, 1);
- if (demangled_name == 0)
- fprintf_filtered (stream, " <badly mangled name %s>",
- mangled_name);
- else
- {
- fprintf_filtered (stream, " %s",
- strchr (demangled_name, ':') + 2);
- free (demangled_name);
- }
- free (mangled_name);
- }
- else if (TYPE_FN_FIELD_PHYSNAME (f, j)[0] == '_'
- && TYPE_FN_FIELD_PHYSNAME (f, j)[1] == CPLUS_MARKER)
- type_print_method_args
- (TYPE_FN_FIELD_ARGS (f, j) + 1, "~",
- TYPE_FN_FIELDLIST_NAME (type, i), 0, stream);
- else
- type_print_method_args
- (TYPE_FN_FIELD_ARGS (f, j), "",
- TYPE_FN_FIELDLIST_NAME (type, i),
- TYPE_FN_FIELD_STATIC_P (f, j), stream);
-
- fprintf_filtered (stream, ";\n");
- }
- }
-
- print_spaces_filtered (level, stream);
- fprintf_filtered (stream, "}");
- }
- break;
-
- case TYPE_CODE_ENUM:
- fprintf_filtered (stream, "enum ");
- if (name = type_name_no_tag (type))
- {
- fputs_filtered (name, stream);
- fputs_filtered (" ", stream);
- }
- wrap_here (" ");
- if (show < 0)
- fprintf_filtered (stream, "{...}");
- else
- {
- fprintf_filtered (stream, "{");
- len = TYPE_NFIELDS (type);
- lastval = 0;
- for (i = 0; i < len; i++)
- {
- QUIT;
- if (i) fprintf_filtered (stream, ", ");
- wrap_here (" ");
- fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
- if (lastval != TYPE_FIELD_BITPOS (type, i))
- {
- fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i));
- lastval = TYPE_FIELD_BITPOS (type, i);
- }
- lastval++;
- }
- fprintf_filtered (stream, "}");
- }
- break;
-
- case TYPE_CODE_INT:
- name = 0;
- if (TYPE_LENGTH (type) <= sizeof (LONGEST))
- {
- if (TYPE_UNSIGNED (type))
- name = unsigned_type_table[TYPE_LENGTH (type)];
- else
- name = signed_type_table[TYPE_LENGTH (type)];
- }
- if (name)
- fputs_filtered (name, stream);
- else
- fprintf_filtered (stream, "<%d bit integer>",
- TYPE_LENGTH (type) * TARGET_CHAR_BIT);
- break;
-
- case TYPE_CODE_FLT:
- name = float_type_table[TYPE_LENGTH (type)];
- fputs_filtered (name, stream);
- break;
-
- case TYPE_CODE_VOID:
- fprintf_filtered (stream, "void");
- break;
-
- case TYPE_CODE_UNDEF:
- fprintf_filtered (stream, "struct <unknown>");
- break;
-
- case TYPE_CODE_ERROR:
- fprintf_filtered (stream, "<unknown type>");
- break;
-
- case TYPE_CODE_RANGE:
- /* This should not occur */
- fprintf_filtered (stream, "<range type>");
- break;
-
- default:
- error ("Invalid type code in symbol table.");
- }
-}
-
-#if 0
-/* Validate an input or output radix setting, and make sure the user
- knows what they really did here. Radix setting is confusing, e.g.
- setting the input radix to "10" never changes it! */
-
-/* ARGSUSED */
-static void
-set_input_radix (args, from_tty, c)
- char *args;
- int from_tty;
- struct cmd_list_element *c;
-{
- unsigned radix = *(unsigned *)c->var;
-
- if (from_tty)
- printf_filtered ("Input radix set to decimal %d, hex %x, octal %o\n",
- radix, radix, radix);
-}
-#endif
-
-/* ARGSUSED */
-static void
-set_output_radix (args, from_tty, c)
- char *args;
- int from_tty;
- struct cmd_list_element *c;
-{
- unsigned radix = *(unsigned *)c->var;
-
- if (from_tty)
- printf_filtered ("Output radix set to decimal %d, hex %x, octal %o\n",
- radix, radix, radix);
-
- /* FIXME, we really should be able to validate the setting BEFORE
- it takes effect. */
- switch (radix)
- {
- case 16:
- output_format = 'x';
- break;
- case 10:
- output_format = 0;
- break;
- case 8:
- output_format = 'o'; /* octal */
- break;
- default:
- output_format = 0;
- error ("Unsupported radix ``decimal %d''; using decimal output",
- radix);
- }
-}
-
-/* Both at once */
-static void
-set_radix (arg, from_tty, c)
- char *arg;
- int from_tty;
- struct cmd_list_element *c;
-{
- unsigned radix = *(unsigned *)c->var;
-
- if (from_tty)
- printf_filtered ("Radix set to decimal %d, hex %x, octal %o\n",
- radix, radix, radix);
-
- input_radix = radix;
- output_radix = radix;
-
- set_output_radix (arg, 0, c);
-}
-
-struct cmd_list_element *setprintlist = NULL;
-struct cmd_list_element *showprintlist = NULL;
-
-/*ARGSUSED*/
-static void
-set_print (arg, from_tty)
- char *arg;
- int from_tty;
-{
- printf (
-"\"set print\" must be followed by the name of a print subcommand.\n");
- help_list (setprintlist, "set print ", -1, stdout);
-}
-
-/*ARGSUSED*/
-static void
-show_print (args, from_tty)
- char *args;
- int from_tty;
-{
- cmd_show_list (showprintlist, from_tty, "");
-}
-
-void
-_initialize_valprint ()
-{
- struct cmd_list_element *c;
-
- add_prefix_cmd ("print", no_class, set_print,
- "Generic command for setting how things print.",
- &setprintlist, "set print ", 0, &setlist);
- add_alias_cmd ("p", "print", no_class, 1, &setlist);
- add_alias_cmd ("pr", "print", no_class, 1, &setlist); /* prefer set print
- to set prompt */
- add_prefix_cmd ("print", no_class, show_print,
- "Generic command for showing print settings.",
- &showprintlist, "show print ", 0, &showlist);
- add_alias_cmd ("p", "print", no_class, 1, &showlist);
- add_alias_cmd ("pr", "print", no_class, 1, &showlist);
-
- add_show_from_set
- (add_set_cmd ("elements", no_class, var_uinteger, (char *)&print_max,
- "Set limit on string chars or array elements to print.\n\
-\"set print elements 0\" causes there to be no limit.",
- &setprintlist),
- &showprintlist);
-
- add_show_from_set
- (add_set_cmd ("pretty", class_support, var_boolean, (char *)&prettyprint,
- "Set prettyprinting of structures.",
- &setprintlist),
- &showprintlist);
-
- add_show_from_set
- (add_set_cmd ("union", class_support, var_boolean, (char *)&unionprint,
- "Set printing of unions interior to structures.",
- &setprintlist),
- &showprintlist);
-
- add_show_from_set
- (add_set_cmd ("vtbl", class_support, var_boolean, (char *)&vtblprint,
- "Set printing of C++ virtual function tables.",
- &setprintlist),
- &showprintlist);
-
- add_show_from_set
- (add_set_cmd ("array", class_support, var_boolean, (char *)&arrayprint,
- "Set prettyprinting of arrays.",
- &setprintlist),
- &showprintlist);
-
- add_show_from_set
- (add_set_cmd ("object", class_support, var_boolean, (char *)&objectprint,
- "Set printing of object's derived type based on vtable info.",
- &setprintlist),
- &showprintlist);
-
- add_show_from_set
- (add_set_cmd ("address", class_support, var_boolean, (char *)&addressprint,
- "Set printing of addresses.",
- &setprintlist),
- &showprintlist);
-
-#if 0
- /* The "show radix" cmd isn't good enough to show two separate values.
- The rest of the code works, but the show part is confusing, so don't
- let them be set separately 'til we work out "show". */
- c = add_set_cmd ("input-radix", class_support, var_uinteger,
- (char *)&input_radix,
- "Set default input radix for entering numbers.",
- &setlist);
- add_show_from_set (c, &showlist);
- c->function = set_input_radix;
-
- c = add_set_cmd ("output-radix", class_support, var_uinteger,
- (char *)&output_radix,
- "Set default output radix for printing of values.",
- &setlist);
- add_show_from_set (c, &showlist);
- c->function = set_output_radix;
-#endif
-
- c = add_set_cmd ("radix", class_support, var_uinteger,
- (char *)&output_radix,
- "Set default input and output number radix.",
- &setlist);
- add_show_from_set (c, &showlist);
- c->function = set_radix;
-
- /* Give people the defaults which they are used to. */
- prettyprint = 0;
- unionprint = 1;
- vtblprint = 0;
- arrayprint = 0;
- addressprint = 1;
- objectprint = 0;
-
- print_max = 200;
-
- /* Initialize the names of the various types based on their lengths on
- the target, in bits. Note that ordering is important, so that for example,
- if ints and longs are the same size, that size will default to "int". */
-
- unsigned_type_table = (char **)
- xmalloc ((1 + (TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT)) * sizeof (char *));
- bzero (unsigned_type_table, (1 + (TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT)));
- unsigned_type_table[TARGET_CHAR_BIT/TARGET_CHAR_BIT] = "unsigned char";
- unsigned_type_table[TARGET_SHORT_BIT/TARGET_CHAR_BIT] = "unsigned short";
- unsigned_type_table[TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT] = "unsigned long long";
- unsigned_type_table[TARGET_LONG_BIT/TARGET_CHAR_BIT] = "unsigned long";
- unsigned_type_table[TARGET_INT_BIT/TARGET_CHAR_BIT] = "unsigned int";
-
- signed_type_table = (char **)
- xmalloc ((1 + (TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT)) * sizeof (char *));
- bzero (signed_type_table, (1 + (TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT)));
- signed_type_table[TARGET_CHAR_BIT/TARGET_CHAR_BIT] = "char";
- signed_type_table[TARGET_SHORT_BIT/TARGET_CHAR_BIT] = "short";
- signed_type_table[TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT] = "long long";
- signed_type_table[TARGET_LONG_BIT/TARGET_CHAR_BIT] = "long";
- signed_type_table[TARGET_INT_BIT/TARGET_CHAR_BIT] = "int";
-
- float_type_table = (char **)
- xmalloc ((1 + (TARGET_LONG_DOUBLE_BIT/TARGET_CHAR_BIT)) * sizeof (char *));
- bzero (float_type_table, (1 + (TARGET_LONG_DOUBLE_BIT/TARGET_CHAR_BIT)));
- float_type_table[TARGET_FLOAT_BIT/TARGET_CHAR_BIT] = "float";
- float_type_table[TARGET_DOUBLE_COMPLEX_BIT/TARGET_CHAR_BIT] = "double complex";
- float_type_table[TARGET_COMPLEX_BIT/TARGET_CHAR_BIT] = "complex";
- float_type_table[TARGET_LONG_DOUBLE_BIT/TARGET_CHAR_BIT] = "long double";
- float_type_table[TARGET_DOUBLE_BIT/TARGET_CHAR_BIT] = "double";
-
- obstack_begin (&dont_print_obstack, 32 * sizeof (struct type *));
-}
diff --git a/gdb/value.h b/gdb/value.h
deleted file mode 100644
index e0cc0d4..0000000
--- a/gdb/value.h
+++ /dev/null
@@ -1,291 +0,0 @@
-/* Definitions for values of C expressions, for GDB.
- Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-GDB 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 1, or (at your option)
-any later version.
-
-GDB 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 GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined (VALUE_H)
-#define VALUE_H 1
-/*
- * The structure which defines the type of a value. It should never
- * be possible for a program lval value to survive over a call to the inferior
- * (ie to be put into the history list or an internal variable).
- */
-enum lval_type {
- /* Not an lval. */
- not_lval,
- /* In memory. Could be a saved register. */
- lval_memory,
- /* In a register. */
- lval_register,
- /* In a gdb internal variable. */
- lval_internalvar,
- /* Part of a gdb internal variable (structure field). */
- lval_internalvar_component,
- /* In a register series in a frame not the current one, which may have been
- partially saved or saved in different places (otherwise would be
- lval_register or lval_memory). */
- lval_reg_frame_relative,
-};
-
-struct value
- {
- /* Type of value; either not an lval, or one of the various
- different possible kinds of lval. */
- enum lval_type lval;
- /* Location of value (if lval). */
- union
- {
- /* Address in inferior or byte of registers structure. */
- CORE_ADDR address;
- /* Pointer to interrnal variable. */
- struct internalvar *internalvar;
- /* Number of register. Only used with
- lval_reg_frame_relative. */
- int regnum;
- } location;
- /* Describes offset of a value within lval a structure in bytes. */
- int offset;
- /* Only used for bitfields; number of bits contained in them. */
- int bitsize;
- /* Only used for bitfields; position of start of field. */
- int bitpos;
- /* Frame value is relative to. In practice, this address is only
- used if the value is stored in several registers in other than
- the current frame, and these registers have not all been saved
- at the same place in memory. This will be described in the
- lval enum above as "lval_reg_frame_relative". */
- CORE_ADDR frame_addr;
- /* Type of the value. */
- struct type *type;
- /* Values are stored in a chain, so that they can be deleted
- easily over calls to the inferior. Values assigned to internal
- variables or put into the value history are taken off this
- list. */
- struct value *next;
- /* If an lval is forced to repeat, a new value is created with
- these fields set. The new value is not an lval. */
- short repeated;
- short repetitions;
- /* Register number if the value is from a register. Is not kept
- if you take a field of a structure that is stored in a
- register. Shouldn't it be? */
- short regno;
- /* If zero, contents of this value are in the contents field.
- If nonzero, contents are in inferior memory at address
- in the location.address field plus the offset field
- (and the lval field should be lval_memory). */
- char lazy;
- /* If nonzero, this is the value of a variable which does not
- actually exist in the program. */
- char optimized_out;
- /* Actual contents of the value. For use of this value; setting
- it uses the stuff above. Not valid if lazy is nonzero.
- Target byte-order. We force it to be aligned properly for any
- possible value. */
- union {
- long contents[1];
- double force_double_align;
-#ifdef LONG_LONG
- long long force_longlong_align;
-#endif
- } aligner;
-
- };
-
-typedef struct value *value;
-
-#define VALUE_TYPE(val) (val)->type
-#define VALUE_LAZY(val) (val)->lazy
-/* VALUE_CONTENTS and VALUE_CONTENTS_RAW both return the address of
- the gdb buffer used to hold a copy of the contents of the lval.
- VALUE_CONTENTS is used when the contents of the buffer are needed --
- it uses value_fetch_lazy() to load the buffer from the process being
- debugged if it hasn't already been loaded. VALUE_CONTENTS_RAW is
- used when data is being stored into the buffer, or when it is
- certain that the contents of the buffer are valid. */
-#define VALUE_CONTENTS_RAW(val) ((char *) (val)->aligner.contents)
-#define VALUE_CONTENTS(val) ((void)(VALUE_LAZY(val) && value_fetch_lazy(val)),\
- VALUE_CONTENTS_RAW(val))
-extern int value_fetch_lazy ();
-#define VALUE_LVAL(val) (val)->lval
-#define VALUE_ADDRESS(val) (val)->location.address
-#define VALUE_INTERNALVAR(val) (val)->location.internalvar
-#define VALUE_FRAME_REGNUM(val) ((val)->location.regnum)
-#define VALUE_FRAME(val) ((val)->frame_addr)
-#define VALUE_OFFSET(val) (val)->offset
-#define VALUE_BITSIZE(val) (val)->bitsize
-#define VALUE_BITPOS(val) (val)->bitpos
-#define VALUE_NEXT(val) (val)->next
-#define VALUE_REPEATED(val) (val)->repeated
-#define VALUE_REPETITIONS(val) (val)->repetitions
-#define VALUE_REGNO(val) (val)->regno
-#define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out)
-
-/* Convert a REF to the object referenced. */
-
-#define COERCE_REF(arg) \
-{ if (TYPE_CODE ( VALUE_TYPE (arg)) == TYPE_CODE_REF) \
- arg = value_at_lazy (TYPE_TARGET_TYPE (VALUE_TYPE (arg)), \
- unpack_long (VALUE_TYPE (arg), \
- VALUE_CONTENTS (arg)));}
-
-/* If ARG is an array, convert it to a pointer.
- If ARG is an enum, convert it to an integer.
- If ARG is a function, convert it to a function pointer.
-
- References are dereferenced. */
-
-#define COERCE_ARRAY(arg) \
-{ COERCE_REF(arg); \
- if (VALUE_REPEATED (arg) \
- || TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY) \
- arg = value_coerce_array (arg); \
- if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FUNC) \
- arg = value_coerce_function (arg); \
- if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ENUM) \
- arg = value_cast (builtin_type_unsigned_int, arg); \
-}
-
-/* If ARG is an enum, convert it to an integer. */
-
-#define COERCE_ENUM(arg) \
-{ if (TYPE_CODE ( VALUE_TYPE (arg)) == TYPE_CODE_REF) \
- arg = value_ind (arg); \
- if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ENUM) \
- arg = value_cast (builtin_type_unsigned_int, arg); \
-}
-
-/* Internal variables (variables for convenience of use of debugger)
- are recorded as a chain of these structures. */
-
-struct internalvar
-{
- struct internalvar *next;
- char *name;
- value value;
-};
-
-#include "symtab.h"
-LONGEST value_as_long ();
-double value_as_double ();
-LONGEST unpack_long ();
-double unpack_double ();
-long unpack_field_as_long ();
-value value_from_long ();
-value value_from_double ();
-value value_at ();
-value value_at_lazy ();
-value value_from_register ();
-value value_of_variable ();
-value value_of_register ();
-value read_var_value ();
-value locate_var_value ();
-value allocate_value ();
-value allocate_repeat_value ();
-value value_mark ();
-void value_free_to_mark ();
-value value_string ();
-
-value value_binop ();
-value value_add ();
-value value_sub ();
-value value_coerce_array ();
-value value_coerce_function ();
-value value_ind ();
-value value_addr ();
-value value_assign ();
-value value_neg ();
-value value_lognot ();
-value value_struct_elt (), value_struct_elt_for_address ();
-value value_field (), value_primitive_field ();
-value value_cast ();
-value value_zero ();
-value value_repeat ();
-value value_subscript ();
-value value_from_vtable_info ();
-
-value value_being_returned ();
-int using_struct_return ();
-void set_return_value ();
-
-value evaluate_expression ();
-value evaluate_type ();
-value parse_and_eval ();
-value parse_to_comma_and_eval ();
-extern CORE_ADDR parse_and_eval_address ();
-extern CORE_ADDR parse_and_eval_address_1 ();
-
-value access_value_history ();
-value value_of_internalvar ();
-void set_internalvar ();
-void set_internalvar_component ();
-struct internalvar *lookup_internalvar ();
-
-int value_equal ();
-int value_less ();
-int value_zerop ();
-
-/* C++ */
-value value_of_this ();
-value value_static_field ();
-value value_x_binop ();
-value value_x_unop ();
-value value_fn_field ();
-value value_virtual_fn_field ();
-int binop_user_defined_p ();
-int unop_user_defined_p ();
-int typecmp ();
-void fill_in_vptr_fieldno ();
-int destructor_name_p ();
-
-#define value_free(val) free (val)
-void free_all_values ();
-void release_value ();
-int record_latest_value ();
-
-void registers_changed ();
-void read_register_bytes ();
-void write_register_bytes ();
-void read_register_gen ();
-CORE_ADDR read_register ();
-void write_register ();
-void supply_register ();
-void get_saved_register ();
-
-void modify_field ();
-void type_print ();
-void type_print_1 ();
-
-/* Possibilities for prettyprint parameters to routines which print
- things. */
-enum val_prettyprint {
- Val_no_prettyprint = 0,
- Val_prettyprint,
- /* Use the default setting which the user has specified. */
- Val_pretty_default
- };
-
-char *baseclass_addr ();
-void print_floating ();
-int value_print ();
-int val_print ();
-void print_variable_value ();
-char *internalvar_name ();
-void clear_value_history ();
-void clear_internalvars ();
-
-#endif /* value.h not already included. */
diff --git a/gdb/values.c b/gdb/values.c
deleted file mode 100644
index 810e00b..0000000
--- a/gdb/values.c
+++ /dev/null
@@ -1,1586 +0,0 @@
-/* Low level packing and unpacking of values for GDB.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <string.h>
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "frame.h"
-#include "command.h"
-#include "gdbcmd.h"
-
-extern char *cplus_demangle ();
-
-/* The value-history records all the values printed
- by print commands during this session. Each chunk
- records 60 consecutive values. The first chunk on
- the chain records the most recent values.
- The total number of values is in value_history_count. */
-
-#define VALUE_HISTORY_CHUNK 60
-
-struct value_history_chunk
-{
- struct value_history_chunk *next;
- value values[VALUE_HISTORY_CHUNK];
-};
-
-/* Chain of chunks now in use. */
-
-static struct value_history_chunk *value_history_chain;
-
-static int value_history_count; /* Abs number of last entry stored */
-
-/* List of all value objects currently allocated
- (except for those released by calls to release_value)
- This is so they can be freed after each command. */
-
-static value all_values;
-
-/* Allocate a value that has the correct length for type TYPE. */
-
-value
-allocate_value (type)
- struct type *type;
-{
- register value val;
-
- check_stub_type (type);
-
- val = (value) xmalloc (sizeof (struct value) + TYPE_LENGTH (type));
- VALUE_NEXT (val) = all_values;
- all_values = val;
- VALUE_TYPE (val) = type;
- VALUE_LVAL (val) = not_lval;
- VALUE_ADDRESS (val) = 0;
- VALUE_FRAME (val) = 0;
- VALUE_OFFSET (val) = 0;
- VALUE_BITPOS (val) = 0;
- VALUE_BITSIZE (val) = 0;
- VALUE_REPEATED (val) = 0;
- VALUE_REPETITIONS (val) = 0;
- VALUE_REGNO (val) = -1;
- VALUE_LAZY (val) = 0;
- VALUE_OPTIMIZED_OUT (val) = 0;
- return val;
-}
-
-/* Allocate a value that has the correct length
- for COUNT repetitions type TYPE. */
-
-value
-allocate_repeat_value (type, count)
- struct type *type;
- int count;
-{
- register value val;
-
- val = (value) xmalloc (sizeof (struct value) + TYPE_LENGTH (type) * count);
- VALUE_NEXT (val) = all_values;
- all_values = val;
- VALUE_TYPE (val) = type;
- VALUE_LVAL (val) = not_lval;
- VALUE_ADDRESS (val) = 0;
- VALUE_FRAME (val) = 0;
- VALUE_OFFSET (val) = 0;
- VALUE_BITPOS (val) = 0;
- VALUE_BITSIZE (val) = 0;
- VALUE_REPEATED (val) = 1;
- VALUE_REPETITIONS (val) = count;
- VALUE_REGNO (val) = -1;
- VALUE_LAZY (val) = 0;
- VALUE_OPTIMIZED_OUT (val) = 0;
- return val;
-}
-
-/* Return a mark in the value chain. All values allocated after the
- mark is obtained (except for those released) are subject to being freed
- if a subsequent value_free_to_mark is passed the mark. */
-value
-value_mark ()
-{
- return all_values;
-}
-
-/* Free all values allocated since MARK was obtained by value_mark
- (except for those released). */
-void
-value_free_to_mark (mark)
- value mark;
-{
- value val, next;
-
- for (val = all_values; val && val != mark; val = next)
- {
- next = VALUE_NEXT (val);
- value_free (val);
- }
- all_values = val;
-}
-
-/* Free all the values that have been allocated (except for those released).
- Called after each command, successful or not. */
-
-void
-free_all_values ()
-{
- register value val, next;
-
- for (val = all_values; val; val = next)
- {
- next = VALUE_NEXT (val);
- value_free (val);
- }
-
- all_values = 0;
-}
-
-/* Remove VAL from the chain all_values
- so it will not be freed automatically. */
-
-void
-release_value (val)
- register value val;
-{
- register value v;
-
- if (all_values == val)
- {
- all_values = val->next;
- return;
- }
-
- for (v = all_values; v; v = v->next)
- {
- if (v->next == val)
- {
- v->next = val->next;
- break;
- }
- }
-}
-
-/* Return a copy of the value ARG.
- It contains the same contents, for same memory address,
- but it's a different block of storage. */
-
-static value
-value_copy (arg)
- value arg;
-{
- register value val;
- register struct type *type = VALUE_TYPE (arg);
- if (VALUE_REPEATED (arg))
- val = allocate_repeat_value (type, VALUE_REPETITIONS (arg));
- else
- val = allocate_value (type);
- VALUE_LVAL (val) = VALUE_LVAL (arg);
- VALUE_ADDRESS (val) = VALUE_ADDRESS (arg);
- VALUE_OFFSET (val) = VALUE_OFFSET (arg);
- VALUE_BITPOS (val) = VALUE_BITPOS (arg);
- VALUE_BITSIZE (val) = VALUE_BITSIZE (arg);
- VALUE_REGNO (val) = VALUE_REGNO (arg);
- VALUE_LAZY (val) = VALUE_LAZY (arg);
- if (!VALUE_LAZY (val))
- {
- bcopy (VALUE_CONTENTS_RAW (arg), VALUE_CONTENTS_RAW (val),
- TYPE_LENGTH (VALUE_TYPE (arg))
- * (VALUE_REPEATED (arg) ? VALUE_REPETITIONS (arg) : 1));
- }
- return val;
-}
-
-/* Access to the value history. */
-
-/* Record a new value in the value history.
- Returns the absolute history index of the entry.
- Result of -1 indicates the value was not saved; otherwise it is the
- value history index of this new item. */
-
-int
-record_latest_value (val)
- value val;
-{
- int i;
-
- /* Check error now if about to store an invalid float. We return -1
- to the caller, but allow them to continue, e.g. to print it as "Nan". */
- if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FLT) {
- (void) unpack_double (VALUE_TYPE (val), VALUE_CONTENTS (val), &i);
- if (i) return -1; /* Indicate value not saved in history */
- }
-
- /* Here we treat value_history_count as origin-zero
- and applying to the value being stored now. */
-
- i = value_history_count % VALUE_HISTORY_CHUNK;
- if (i == 0)
- {
- register struct value_history_chunk *new
- = (struct value_history_chunk *)
- xmalloc (sizeof (struct value_history_chunk));
- bzero (new->values, sizeof new->values);
- new->next = value_history_chain;
- value_history_chain = new;
- }
-
- value_history_chain->values[i] = val;
- release_value (val);
-
- /* Now we regard value_history_count as origin-one
- and applying to the value just stored. */
-
- return ++value_history_count;
-}
-
-/* Return a copy of the value in the history with sequence number NUM. */
-
-value
-access_value_history (num)
- int num;
-{
- register struct value_history_chunk *chunk;
- register int i;
- register int absnum = num;
-
- if (absnum <= 0)
- absnum += value_history_count;
-
- if (absnum <= 0)
- {
- if (num == 0)
- error ("The history is empty.");
- else if (num == 1)
- error ("There is only one value in the history.");
- else
- error ("History does not go back to $$%d.", -num);
- }
- if (absnum > value_history_count)
- error ("History has not yet reached $%d.", absnum);
-
- absnum--;
-
- /* Now absnum is always absolute and origin zero. */
-
- chunk = value_history_chain;
- for (i = (value_history_count - 1) / VALUE_HISTORY_CHUNK - absnum / VALUE_HISTORY_CHUNK;
- i > 0; i--)
- chunk = chunk->next;
-
- return value_copy (chunk->values[absnum % VALUE_HISTORY_CHUNK]);
-}
-
-/* Clear the value history entirely.
- Must be done when new symbol tables are loaded,
- because the type pointers become invalid. */
-
-void
-clear_value_history ()
-{
- register struct value_history_chunk *next;
- register int i;
- register value val;
-
- while (value_history_chain)
- {
- for (i = 0; i < VALUE_HISTORY_CHUNK; i++)
- if (val = value_history_chain->values[i])
- free (val);
- next = value_history_chain->next;
- free (value_history_chain);
- value_history_chain = next;
- }
- value_history_count = 0;
-}
-
-static void
-show_values (num_exp, from_tty)
- char *num_exp;
- int from_tty;
-{
- register int i;
- register value val;
- static int num = 1;
-
- if (num_exp)
- {
- if (num_exp[0] == '+' && num_exp[1] == '\0')
- /* "info history +" should print from the stored position. */
- ;
- else
- /* "info history <exp>" should print around value number <exp>. */
- num = parse_and_eval_address (num_exp) - 5;
- }
- else
- {
- /* "info history" means print the last 10 values. */
- num = value_history_count - 9;
- }
-
- if (num <= 0)
- num = 1;
-
- for (i = num; i < num + 10 && i <= value_history_count; i++)
- {
- val = access_value_history (i);
- printf_filtered ("$%d = ", i);
- value_print (val, stdout, 0, Val_pretty_default);
- printf_filtered ("\n");
- }
-
- /* The next "info history +" should start after what we just printed. */
- num += 10;
-
- /* Hitting just return after this command should do the same thing as
- "info history +". If num_exp is null, this is unnecessary, since
- "info history +" is not useful after "info history". */
- if (from_tty && num_exp)
- {
- num_exp[0] = '+';
- num_exp[1] = '\0';
- }
-}
-
-/* Internal variables. These are variables within the debugger
- that hold values assigned by debugger commands.
- The user refers to them with a '$' prefix
- that does not appear in the variable names stored internally. */
-
-static struct internalvar *internalvars;
-
-/* Look up an internal variable with name NAME. NAME should not
- normally include a dollar sign.
-
- If the specified internal variable does not exist,
- one is created, with a void value. */
-
-struct internalvar *
-lookup_internalvar (name)
- char *name;
-{
- register struct internalvar *var;
-
- for (var = internalvars; var; var = var->next)
- if (!strcmp (var->name, name))
- return var;
-
- var = (struct internalvar *) xmalloc (sizeof (struct internalvar));
- var->name = concat (name, NULL);
- var->value = allocate_value (builtin_type_void);
- release_value (var->value);
- var->next = internalvars;
- internalvars = var;
- return var;
-}
-
-value
-value_of_internalvar (var)
- struct internalvar *var;
-{
- register value val;
-
-#ifdef IS_TRAPPED_INTERNALVAR
- if (IS_TRAPPED_INTERNALVAR (var->name))
- return VALUE_OF_TRAPPED_INTERNALVAR (var);
-#endif
-
- val = value_copy (var->value);
- if (VALUE_LAZY (val))
- value_fetch_lazy (val);
- VALUE_LVAL (val) = lval_internalvar;
- VALUE_INTERNALVAR (val) = var;
- return val;
-}
-
-void
-set_internalvar_component (var, offset, bitpos, bitsize, newval)
- struct internalvar *var;
- int offset, bitpos, bitsize;
- value newval;
-{
- register char *addr = VALUE_CONTENTS (var->value) + offset;
-
-#ifdef IS_TRAPPED_INTERNALVAR
- if (IS_TRAPPED_INTERNALVAR (var->name))
- SET_TRAPPED_INTERNALVAR (var, newval, bitpos, bitsize, offset);
-#endif
-
- if (bitsize)
- modify_field (addr, (int) value_as_long (newval),
- bitpos, bitsize);
- else
- bcopy (VALUE_CONTENTS (newval), addr,
- TYPE_LENGTH (VALUE_TYPE (newval)));
-}
-
-void
-set_internalvar (var, val)
- struct internalvar *var;
- value val;
-{
-#ifdef IS_TRAPPED_INTERNALVAR
- if (IS_TRAPPED_INTERNALVAR (var->name))
- SET_TRAPPED_INTERNALVAR (var, val, 0, 0, 0);
-#endif
-
- free (var->value);
- var->value = value_copy (val);
- release_value (var->value);
-}
-
-char *
-internalvar_name (var)
- struct internalvar *var;
-{
- return var->name;
-}
-
-/* Free all internalvars. Done when new symtabs are loaded,
- because that makes the values invalid. */
-
-void
-clear_internalvars ()
-{
- register struct internalvar *var;
-
- while (internalvars)
- {
- var = internalvars;
- internalvars = var->next;
- free (var->name);
- free (var->value);
- free (var);
- }
-}
-
-static void
-show_convenience ()
-{
- register struct internalvar *var;
- int varseen = 0;
-
- for (var = internalvars; var; var = var->next)
- {
-#ifdef IS_TRAPPED_INTERNALVAR
- if (IS_TRAPPED_INTERNALVAR (var->name))
- continue;
-#endif
- if (!varseen)
- {
-#if 0
- /* Useless noise. */
- printf ("Debugger convenience variables:\n\n");
-#endif
- varseen = 1;
- }
- printf_filtered ("$%s = ", var->name);
- value_print (var->value, stdout, 0, Val_pretty_default);
- printf_filtered ("\n");
- }
- if (!varseen)
- printf ("No debugger convenience variables now defined.\n\
-Convenience variables have names starting with \"$\";\n\
-use \"set\" as in \"set $foo = 5\" to define them.\n");
-}
-
-/* Extract a value as a C number (either long or double).
- Knows how to convert fixed values to double, or
- floating values to long.
- Does not deallocate the value. */
-
-LONGEST
-value_as_long (val)
- register value val;
-{
- /* This coerces arrays and functions, which is necessary (e.g.
- in disassemble_command). It also dereferences references, which
- I suspect is the most logical thing to do. */
- if (TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_ENUM)
- COERCE_ARRAY (val);
- return unpack_long (VALUE_TYPE (val), VALUE_CONTENTS (val));
-}
-
-double
-value_as_double (val)
- register value val;
-{
- double foo;
- int inv;
-
- foo = unpack_double (VALUE_TYPE (val), VALUE_CONTENTS (val), &inv);
- if (inv)
- error ("Invalid floating value found in program.");
- return foo;
-}
-/* Extract a value as a C pointer.
- Does not deallocate the value. */
-CORE_ADDR
-value_as_pointer (val)
- value val;
-{
- /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
- whether we want this to be true eventually. */
- return value_as_long (val);
-}
-
-/* Unpack raw data (copied from debugee, target byte order) at VALADDR
- as a long, or as a double, assuming the raw data is described
- by type TYPE. Knows how to convert different sizes of values
- and can convert between fixed and floating point. We don't assume
- any alignment for the raw data. Return value is in host byte order.
-
- If you want functions and arrays to be coerced to pointers, and
- references to be dereferenced, call value_as_long() instead.
-
- C++: It is assumed that the front-end has taken care of
- all matters concerning pointers to members. A pointer
- to member which reaches here is considered to be equivalent
- to an INT (or some size). After all, it is only an offset. */
-
-/* FIXME: This should be rewritten as a switch statement for speed and
- ease of comprehension. */
-
-LONGEST
-unpack_long (type, valaddr)
- struct type *type;
- char *valaddr;
-{
- register enum type_code code = TYPE_CODE (type);
- register int len = TYPE_LENGTH (type);
- register int nosign = TYPE_UNSIGNED (type);
-
- if (code == TYPE_CODE_ENUM || code == TYPE_CODE_BOOL)
- code = TYPE_CODE_INT;
- if (code == TYPE_CODE_FLT)
- {
- if (len == sizeof (float))
- {
- float retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-
- if (len == sizeof (double))
- {
- double retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
- else
- {
- error ("Unexpected type of floating point number.");
- }
- }
- else if (code == TYPE_CODE_INT && nosign)
- {
- if (len == sizeof (char))
- {
- unsigned char retval = * (unsigned char *) valaddr;
- /* SWAP_TARGET_AND_HOST (&retval, sizeof (unsigned char)); */
- return retval;
- }
-
- if (len == sizeof (short))
- {
- unsigned short retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-
- if (len == sizeof (int))
- {
- unsigned int retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-
- if (len == sizeof (long))
- {
- unsigned long retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-#ifdef LONG_LONG
- if (len == sizeof (long long))
- {
- unsigned long long retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-#endif
- else
- {
- error ("That operation is not possible on an integer of that size.");
- }
- }
- else if (code == TYPE_CODE_INT)
- {
- if (len == sizeof (char))
- {
- char retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-
- if (len == sizeof (short))
- {
- short retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-
- if (len == sizeof (int))
- {
- int retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-
- if (len == sizeof (long))
- {
- long retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-
-#ifdef LONG_LONG
- if (len == sizeof (long long))
- {
- long long retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-#endif
- else
- {
- error ("That operation is not possible on an integer of that size.");
- }
- }
- /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
- whether we want this to be true eventually. */
- else if (code == TYPE_CODE_PTR
- || code == TYPE_CODE_REF)
- {
- if (len == sizeof (CORE_ADDR))
- {
- CORE_ADDR retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
- }
- else if (code == TYPE_CODE_MEMBER)
- error ("not implemented: member types in unpack_long");
- else if (code == TYPE_CODE_CHAR)
- return *(unsigned char *)valaddr;
-
- error ("Value not integer or pointer.");
- return 0; /* For lint -- never reached */
-}
-
-/* Return a double value from the specified type and address.
- INVP points to an int which is set to 0 for valid value,
- 1 for invalid value (bad float format). In either case,
- the returned double is OK to use. Argument is in target
- format, result is in host format. */
-
-double
-unpack_double (type, valaddr, invp)
- struct type *type;
- char *valaddr;
- int *invp;
-{
- register enum type_code code = TYPE_CODE (type);
- register int len = TYPE_LENGTH (type);
- register int nosign = TYPE_UNSIGNED (type);
-
- *invp = 0; /* Assume valid. */
- if (code == TYPE_CODE_FLT)
- {
- if (INVALID_FLOAT (valaddr, len))
- {
- *invp = 1;
- return 1.234567891011121314;
- }
-
- if (len == sizeof (float))
- {
- float retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
-
- if (len == sizeof (double))
- {
- double retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
- else
- {
- error ("Unexpected type of floating point number.");
- return 0; /* Placate lint. */
- }
- }
- else if (nosign) {
- /* Unsigned -- be sure we compensate for signed LONGEST. */
-#ifdef LONG_LONG
- return (unsigned long long) unpack_long (type, valaddr);
-#else
- return (unsigned long ) unpack_long (type, valaddr);
-#endif
- } else {
- /* Signed -- we are OK with unpack_long. */
- return unpack_long (type, valaddr);
- }
-}
-
-/* Unpack raw data (copied from debugee, target byte order) at VALADDR
- as a CORE_ADDR, assuming the raw data is described by type TYPE.
- We don't assume any alignment for the raw data. Return value is in
- host byte order.
-
- If you want functions and arrays to be coerced to pointers, and
- references to be dereferenced, call value_as_pointer() instead.
-
- C++: It is assumed that the front-end has taken care of
- all matters concerning pointers to members. A pointer
- to member which reaches here is considered to be equivalent
- to an INT (or some size). After all, it is only an offset. */
-
-CORE_ADDR
-unpack_pointer (type, valaddr)
- struct type *type;
- char *valaddr;
-{
-#if 0
- /* The user should be able to use an int (e.g. 0x7892) in contexts
- where a pointer is expected. So this doesn't do enough. */
- register enum type_code code = TYPE_CODE (type);
- register int len = TYPE_LENGTH (type);
-
- if (code == TYPE_CODE_PTR
- || code == TYPE_CODE_REF)
- {
- if (len == sizeof (CORE_ADDR))
- {
- CORE_ADDR retval;
- bcopy (valaddr, &retval, sizeof (retval));
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
- }
- error ("Unrecognized pointer size.");
- }
- else if (code == TYPE_CODE_MEMBER)
- error ("not implemented: member types in unpack_pointer");
-
- error ("Value is not a pointer.");
- return 0; /* For lint -- never reached */
-#else
- /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
- whether we want this to be true eventually. */
- return unpack_long (type, valaddr);
-#endif
-}
-
-/* Given a value ARG1 (offset by OFFSET bytes)
- of a struct or union type ARG_TYPE,
- extract and return the value of one of its fields.
- FIELDNO says which field.
-
- For C++, must also be able to return values from static fields */
-
-value
-value_primitive_field (arg1, offset, fieldno, arg_type)
- register value arg1;
- int offset;
- register int fieldno;
- register struct type *arg_type;
-{
- register value v;
- register struct type *type;
-
- check_stub_type (arg_type);
- type = TYPE_FIELD_TYPE (arg_type, fieldno);
-
- /* Handle packed fields */
-
- offset += TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
- if (TYPE_FIELD_BITSIZE (arg_type, fieldno))
- {
- v = value_from_longest (type,
- unpack_field_as_long (arg_type,
- VALUE_CONTENTS (arg1),
- fieldno));
- VALUE_BITPOS (v) = TYPE_FIELD_BITPOS (arg_type, fieldno) % 8;
- VALUE_BITSIZE (v) = TYPE_FIELD_BITSIZE (arg_type, fieldno);
- }
- else
- {
- v = allocate_value (type);
- if (VALUE_LAZY (arg1))
- VALUE_LAZY (v) = 1;
- else
- bcopy (VALUE_CONTENTS_RAW (arg1) + offset,
- VALUE_CONTENTS_RAW (v),
- TYPE_LENGTH (type));
- }
- VALUE_LVAL (v) = VALUE_LVAL (arg1);
- if (VALUE_LVAL (arg1) == lval_internalvar)
- VALUE_LVAL (v) = lval_internalvar_component;
- VALUE_ADDRESS (v) = VALUE_ADDRESS (arg1);
- VALUE_OFFSET (v) = offset + VALUE_OFFSET (arg1);
- return v;
-}
-
-/* Given a value ARG1 of a struct or union type,
- extract and return the value of one of its fields.
- FIELDNO says which field.
-
- For C++, must also be able to return values from static fields */
-
-value
-value_field (arg1, fieldno)
- register value arg1;
- register int fieldno;
-{
- return value_primitive_field (arg1, 0, fieldno, VALUE_TYPE (arg1));
-}
-
-/* Return a non-virtual function as a value.
- F is the list of member functions which contains the desired method.
- J is an index into F which provides the desired method. */
-
-value
-value_fn_field (f, j)
- struct fn_field *f;
- int j;
-{
- register value v;
- register struct type *type = TYPE_FN_FIELD_TYPE (f, j);
- struct symbol *sym;
-
- sym = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
- 0, VAR_NAMESPACE, 0, NULL);
- if (! sym) error ("Internal error: could not find physical method named %s",
- TYPE_FN_FIELD_PHYSNAME (f, j));
-
- v = allocate_value (type);
- VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
- VALUE_TYPE (v) = type;
- return v;
-}
-
-/* Return a virtual function as a value.
- ARG1 is the object which provides the virtual function
- table pointer. ARG1 is side-effected in calling this function.
- F is the list of member functions which contains the desired virtual
- function.
- J is an index into F which provides the desired virtual function.
-
- TYPE is the type in which F is located. */
-value
-value_virtual_fn_field (arg1, f, j, type)
- value arg1;
- struct fn_field *f;
- int j;
- struct type *type;
-{
- /* First, get the virtual function table pointer. That comes
- with a strange type, so cast it to type `pointer to long' (which
- should serve just fine as a function type). Then, index into
- the table, and convert final value to appropriate function type. */
- value entry, vfn, vtbl;
- value vi = value_from_longest (builtin_type_int,
- (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
- struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
- struct type *context;
- if (fcontext == NULL)
- /* We don't have an fcontext (e.g. the program was compiled with
- g++ version 1). Try to get the vtbl from the TYPE_VPTR_BASETYPE.
- This won't work right for multiple inheritance, but at least we
- should do as well as GDB 3.x did. */
- fcontext = TYPE_VPTR_BASETYPE (type);
- context = lookup_pointer_type (fcontext);
- /* Now context is a pointer to the basetype containing the vtbl. */
- if (TYPE_TARGET_TYPE (context) != VALUE_TYPE (arg1))
- arg1 = value_ind (value_cast (context, value_addr (arg1)));
-
- context = VALUE_TYPE (arg1);
- /* Now context is the basetype containing the vtbl. */
-
- /* This type may have been defined before its virtual function table
- was. If so, fill in the virtual function table entry for the
- type now. */
- if (TYPE_VPTR_FIELDNO (context) < 0)
- fill_in_vptr_fieldno (context);
-
- /* The virtual function table is now an array of structures
- which have the form { int16 offset, delta; void *pfn; }. */
- vtbl = value_ind (value_field (arg1, TYPE_VPTR_FIELDNO (context)));
-
- /* Index into the virtual function table. This is hard-coded because
- looking up a field is not cheap, and it may be important to save
- time, e.g. if the user has set a conditional breakpoint calling
- a virtual function. */
- entry = value_subscript (vtbl, vi);
-
- /* Move the `this' pointer according to the virtual function table. */
- VALUE_OFFSET (arg1) += value_as_long (value_field (entry, 0));
- if (! VALUE_LAZY (arg1))
- {
- VALUE_LAZY (arg1) = 1;
- value_fetch_lazy (arg1);
- }
-
- vfn = value_field (entry, 2);
- /* Reinstantiate the function pointer with the correct type. */
- VALUE_TYPE (vfn) = lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j));
-
- return vfn;
-}
-
-/* ARG is a pointer to an object we know to be at least
- a DTYPE. BTYPE is the most derived basetype that has
- already been searched (and need not be searched again).
- After looking at the vtables between BTYPE and DTYPE,
- return the most derived type we find. The caller must
- be satisfied when the return value == DTYPE.
-
- FIXME-tiemann: should work with dossier entries as well. */
-
-static value
-value_headof (arg, btype, dtype)
- value arg;
- struct type *btype, *dtype;
-{
- /* First collect the vtables we must look at for this object. */
- /* FIXME-tiemann: right now, just look at top-most vtable. */
- value vtbl, entry, best_entry = 0;
- /* FIXME: entry_type is never used. */
- struct type *entry_type;
- int i, nelems;
- int offset, best_offset = 0;
- struct symbol *sym;
- CORE_ADDR pc_for_sym;
- char *demangled_name;
- btype = TYPE_VPTR_BASETYPE (dtype);
- check_stub_type (btype);
- if (btype != dtype)
- vtbl = value_cast (lookup_pointer_type (btype), arg);
- else
- vtbl = arg;
- vtbl = value_ind (value_field (value_ind (vtbl), TYPE_VPTR_FIELDNO (btype)));
-
- /* Check that VTBL looks like it points to a virtual function table. */
- i = find_pc_misc_function (VALUE_ADDRESS (vtbl));
- if (i < 0 || ! VTBL_PREFIX_P (demangled_name = misc_function_vector[i].name))
- {
- /* If we expected to find a vtable, but did not, let the user
- know that we aren't happy, but don't throw an error.
- FIXME: there has to be a better way to do this. */
- struct type *error_type = (struct type *)xmalloc (sizeof (struct type));
- bcopy (VALUE_TYPE (arg), error_type, sizeof (struct type));
- TYPE_NAME (error_type) = savestring ("suspicious *", sizeof ("suspicious *"));
- VALUE_TYPE (arg) = error_type;
- return arg;
- }
-
- /* Now search through the virtual function table. */
- entry = value_ind (vtbl);
- nelems = longest_to_int (value_as_long (value_field (entry, 2)));
- for (i = 1; i <= nelems; i++)
- {
- entry = value_subscript (vtbl, value_from_longest (builtin_type_int,
- (LONGEST) i));
- offset = longest_to_int (value_as_long (value_field (entry, 0)));
- /* If we use '<=' we can handle single inheritance
- * where all offsets are zero - just use the first entry found. */
- if (offset <= best_offset)
- {
- best_offset = offset;
- best_entry = entry;
- }
- }
- /* Move the pointer according to BEST_ENTRY's offset, and figure
- out what type we should return as the new pointer. */
- if (best_entry == 0)
- {
- /* An alternative method (which should no longer be necessary).
- * But we leave it in for future use, when we will hopefully
- * have optimizes the vtable to use thunks instead of offsets. */
- /* Use the name of vtable itself to extract a base type. */
- demangled_name += 4; /* Skip _vt$ prefix. */
- }
- else
- {
- pc_for_sym = value_as_pointer (value_field (best_entry, 2));
- sym = find_pc_function (pc_for_sym);
- demangled_name = cplus_demangle (SYMBOL_NAME (sym), -1);
- *(strchr (demangled_name, ':')) = '\0';
- }
- sym = lookup_symbol (demangled_name, 0, VAR_NAMESPACE, 0, 0);
- if (sym == 0)
- error ("could not find type declaration for `%s'", SYMBOL_NAME (sym));
- if (best_entry)
- {
- free (demangled_name);
- arg = value_add (value_cast (builtin_type_int, arg),
- value_field (best_entry, 0));
- }
- VALUE_TYPE (arg) = lookup_pointer_type (SYMBOL_TYPE (sym));
- return arg;
-}
-
-/* ARG is a pointer object of type TYPE. If TYPE has virtual
- function tables, probe ARG's tables (including the vtables
- of its baseclasses) to figure out the most derived type that ARG
- could actually be a pointer to. */
-
-value
-value_from_vtable_info (arg, type)
- value arg;
- struct type *type;
-{
- /* Take care of preliminaries. */
- if (TYPE_VPTR_FIELDNO (type) < 0)
- fill_in_vptr_fieldno (type);
- if (TYPE_VPTR_FIELDNO (type) < 0 || VALUE_REPEATED (arg))
- return 0;
-
- return value_headof (arg, 0, type);
-}
-
-/* The value of a static class member does not depend
- on its instance, only on its type. If FIELDNO >= 0,
- then fieldno is a valid field number and is used directly.
- Otherwise, FIELDNAME is the name of the field we are
- searching for. If it is not a static field name, an
- error is signaled. TYPE is the type in which we look for the
- static field member.
-
- Return zero if we couldn't find anything; the caller may signal
- an error in that case. */
-
-value
-value_static_field (type, fieldname, fieldno)
- register struct type *type;
- char *fieldname;
- register int fieldno;
-{
- register value v;
- struct symbol *sym;
- char *phys_name;
-
- if (fieldno < 0)
- {
- /* Look for static field. */
- int i;
- for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
- if (! strcmp (TYPE_FIELD_NAME (type, i), fieldname))
- {
- if (TYPE_FIELD_STATIC (type, i))
- {
- fieldno = i;
- goto found;
- }
- else
- error ("field `%s' is not static", fieldname);
- }
- for (; i > 0; i--)
- {
- v = value_static_field (TYPE_BASECLASS (type, i), fieldname, -1);
- if (v != 0)
- return v;
- }
-
- if (destructor_name_p (fieldname, type))
- error ("Cannot get value of destructor");
-
- for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--)
- {
- if (! strcmp (TYPE_FN_FIELDLIST_NAME (type, i), fieldname))
- error ("Cannot get value of method \"%s\"", fieldname);
- }
- error("there is no field named %s", fieldname);
- }
-
- found:
- phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
- sym = lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL);
- if (! sym) error ("Internal error: could not find physical static variable named %s", phys_name);
-
- type = TYPE_FIELD_TYPE (type, fieldno);
- v = value_at (type, (CORE_ADDR)SYMBOL_BLOCK_VALUE (sym));
- return v;
-}
-
-/* Compute the address of the baseclass which is
- the INDEXth baseclass of TYPE. The TYPE base
- of the object is at VALADDR.
-
- If ERRP is non-NULL, set *ERRP to be the errno code of any error,
- or 0 if no error. In that case the return value is not the address
- of the baseclasss, but the address which could not be read
- successfully. */
-
-char *
-baseclass_addr (type, index, valaddr, valuep, errp)
- struct type *type;
- int index;
- char *valaddr;
- value *valuep;
- int *errp;
-{
- struct type *basetype = TYPE_BASECLASS (type, index);
-
- if (errp)
- *errp = 0;
-
- if (BASETYPE_VIA_VIRTUAL (type, index))
- {
- /* Must hunt for the pointer to this virtual baseclass. */
- register int i, len = TYPE_NFIELDS (type);
- register int n_baseclasses = TYPE_N_BASECLASSES (type);
- char *vbase_name, *type_name = type_name_no_tag (basetype);
-
- if (TYPE_MAIN_VARIANT (basetype))
- basetype = TYPE_MAIN_VARIANT (basetype);
-
- vbase_name = (char *)alloca (strlen (type_name) + 8);
- sprintf (vbase_name, "_vb$%s", type_name);
- /* First look for the virtual baseclass pointer
- in the fields. */
- for (i = n_baseclasses; i < len; i++)
- {
- if (! strcmp (vbase_name, TYPE_FIELD_NAME (type, i)))
- {
- value val = allocate_value (basetype);
- CORE_ADDR addr;
- int status;
-
- addr
- = unpack_pointer (TYPE_FIELD_TYPE (type, i),
- valaddr + (TYPE_FIELD_BITPOS (type, i) / 8));
-
- status = target_read_memory (addr,
- VALUE_CONTENTS_RAW (val),
- TYPE_LENGTH (basetype));
- VALUE_LVAL (val) = lval_memory;
- VALUE_ADDRESS (val) = addr;
-
- if (status != 0)
- {
- if (valuep)
- *valuep = NULL;
- release_value (val);
- value_free (val);
- if (errp)
- *errp = status;
- return (char *)addr;
- }
- else
- {
- if (valuep)
- *valuep = val;
- return (char *) VALUE_CONTENTS (val);
- }
- }
- }
- /* Not in the fields, so try looking through the baseclasses. */
- for (i = index+1; i < n_baseclasses; i++)
- {
- char *baddr;
-
- baddr = baseclass_addr (type, i, valaddr, valuep, errp);
- if (baddr)
- return baddr;
- }
- /* Not found. */
- if (valuep)
- *valuep = 0;
- return 0;
- }
-
- /* Baseclass is easily computed. */
- if (valuep)
- *valuep = 0;
- return valaddr + TYPE_BASECLASS_BITPOS (type, index) / 8;
-}
-
-/* Ugly hack to convert method stubs into method types.
-
- He ain't kiddin'. This demangles the name of the method into a string
- including argument types, parses out each argument type, generates
- a string casting a zero to that type, evaluates the string, and stuffs
- the resulting type into an argtype vector!!! Then it knows the type
- of the whole function (including argument types for overloading),
- which info used to be in the stab's but was removed to hack back
- the space required for them. */
-void
-check_stub_method (type, i, j)
- struct type *type;
- int i, j;
-{
- extern char *gdb_mangle_name (), *strchr ();
- struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
- char *mangled_name = gdb_mangle_name (type, i, j);
- char *demangled_name = cplus_demangle (mangled_name, 0);
- char *argtypetext, *p;
- int depth = 0, argcount = 1;
- struct type **argtypes;
-
- /* Now, read in the parameters that define this type. */
- argtypetext = strchr (demangled_name, '(') + 1;
- p = argtypetext;
- while (*p)
- {
- if (*p == '(')
- depth += 1;
- else if (*p == ')')
- depth -= 1;
- else if (*p == ',' && depth == 0)
- argcount += 1;
-
- p += 1;
- }
- /* We need one more slot for the void [...] or NULL [end of arglist] */
- argtypes = (struct type **)xmalloc ((argcount+1) * sizeof (struct type *));
- p = argtypetext;
- argtypes[0] = lookup_pointer_type (type);
- argcount = 1;
-
- if (*p != ')') /* () means no args, skip while */
- {
- depth = 0;
- while (*p)
- {
- if (depth <= 0 && (*p == ',' || *p == ')'))
- {
- argtypes[argcount] =
- parse_and_eval_type (argtypetext, p - argtypetext);
- argcount += 1;
- argtypetext = p + 1;
- }
-
- if (*p == '(')
- depth += 1;
- else if (*p == ')')
- depth -= 1;
-
- p += 1;
- }
- }
-
- if (p[-2] != '.') /* ... */
- argtypes[argcount] = builtin_type_void; /* Ellist terminator */
- else
- argtypes[argcount] = NULL; /* List terminator */
-
- free (demangled_name);
-
- type = lookup_method_type (type, TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)), argtypes);
- /* Free the stub type...it's no longer needed. */
- free (TYPE_FN_FIELD_TYPE (f, j));
- TYPE_FN_FIELD_PHYSNAME (f, j) = mangled_name;
- TYPE_FN_FIELD_TYPE (f, j) = type;
-}
-
-long
-unpack_field_as_long (type, valaddr, fieldno)
- struct type *type;
- char *valaddr;
- int fieldno;
-{
- long val;
- int bitpos = TYPE_FIELD_BITPOS (type, fieldno);
- int bitsize = TYPE_FIELD_BITSIZE (type, fieldno);
-
- bcopy (valaddr + bitpos / 8, &val, sizeof val);
- SWAP_TARGET_AND_HOST (&val, sizeof val);
-
- /* Extracting bits depends on endianness of the machine. */
-#if BITS_BIG_ENDIAN
- val = val >> (sizeof val * 8 - bitpos % 8 - bitsize);
-#else
- val = val >> (bitpos % 8);
-#endif
-
- if (bitsize < 8 * sizeof (val))
- val &= (((unsigned long)1) << bitsize) - 1;
- return val;
-}
-
-/* Modify the value of a bitfield. ADDR points to a block of memory in
- target byte order; the bitfield starts in the byte pointed to. FIELDVAL
- is the desired value of the field, in host byte order. BITPOS and BITSIZE
- indicate which bits (in target bit order) comprise the bitfield. */
-
-void
-modify_field (addr, fieldval, bitpos, bitsize)
- char *addr;
- int fieldval;
- int bitpos, bitsize;
-{
- long oword;
-
- /* Reject values too big to fit in the field in question,
- otherwise adjoining fields may be corrupted. */
- if (bitsize < (8 * sizeof (fieldval))
- && 0 != (fieldval & ~((1<<bitsize)-1)))
- error ("Value %d does not fit in %d bits.", fieldval, bitsize);
-
- bcopy (addr, &oword, sizeof oword);
- SWAP_TARGET_AND_HOST (&oword, sizeof oword); /* To host format */
-
- /* Shifting for bit field depends on endianness of the target machine. */
-#if BITS_BIG_ENDIAN
- bitpos = sizeof (oword) * 8 - bitpos - bitsize;
-#endif
-
- /* Mask out old value, while avoiding shifts >= longword size */
- if (bitsize < 8 * sizeof (oword))
- oword &= ~(((((unsigned long)1) << bitsize) - 1) << bitpos);
- else
- oword &= ~((-1) << bitpos);
- oword |= fieldval << bitpos;
-
- SWAP_TARGET_AND_HOST (&oword, sizeof oword); /* To target format */
- bcopy (&oword, addr, sizeof oword);
-}
-
-/* Convert C numbers into newly allocated values */
-
-value
-value_from_longest (type, num)
- struct type *type;
- register LONGEST num;
-{
- register value val = allocate_value (type);
- register enum type_code code = TYPE_CODE (type);
- register int len = TYPE_LENGTH (type);
-
- /* FIXME, we assume that pointers have the same form and byte order as
- integers, and that all pointers have the same form. */
- if (code == TYPE_CODE_INT || code == TYPE_CODE_ENUM ||
- code == TYPE_CODE_CHAR || code == TYPE_CODE_PTR)
- {
- if (len == sizeof (char))
- * (char *) VALUE_CONTENTS_RAW (val) = num;
- else if (len == sizeof (short))
- * (short *) VALUE_CONTENTS_RAW (val) = num;
- else if (len == sizeof (int))
- * (int *) VALUE_CONTENTS_RAW (val) = num;
- else if (len == sizeof (long))
- * (long *) VALUE_CONTENTS_RAW (val) = num;
-#ifdef LONG_LONG
- else if (len == sizeof (long long))
- * (long long *) VALUE_CONTENTS_RAW (val) = num;
-#endif
- else
- error ("Integer type encountered with unexpected data length.");
- }
- else
- error ("Unexpected type encountered for integer constant.");
-
- /* num was in host byte order. So now put the value's contents
- into target byte order. */
- SWAP_TARGET_AND_HOST (VALUE_CONTENTS_RAW (val), len);
-
- return val;
-}
-
-value
-value_from_double (type, num)
- struct type *type;
- double num;
-{
- register value val = allocate_value (type);
- register enum type_code code = TYPE_CODE (type);
- register int len = TYPE_LENGTH (type);
-
- if (code == TYPE_CODE_FLT)
- {
- if (len == sizeof (float))
- * (float *) VALUE_CONTENTS_RAW (val) = num;
- else if (len == sizeof (double))
- * (double *) VALUE_CONTENTS_RAW (val) = num;
- else
- error ("Floating type encountered with unexpected data length.");
- }
- else
- error ("Unexpected type encountered for floating constant.");
-
- /* num was in host byte order. So now put the value's contents
- into target byte order. */
- SWAP_TARGET_AND_HOST (VALUE_CONTENTS_RAW (val), len);
-
- return val;
-}
-
-/* Deal with the value that is "about to be returned". */
-
-/* Return the value that a function returning now
- would be returning to its caller, assuming its type is VALTYPE.
- RETBUF is where we look for what ought to be the contents
- of the registers (in raw form). This is because it is often
- desirable to restore old values to those registers
- after saving the contents of interest, and then call
- this function using the saved values.
- struct_return is non-zero when the function in question is
- using the structure return conventions on the machine in question;
- 0 when it is using the value returning conventions (this often
- means returning pointer to where structure is vs. returning value). */
-
-value
-value_being_returned (valtype, retbuf, struct_return)
- register struct type *valtype;
- char retbuf[REGISTER_BYTES];
- int struct_return;
- /*ARGSUSED*/
-{
- register value val;
- CORE_ADDR addr;
-
-#if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
- /* If this is not defined, just use EXTRACT_RETURN_VALUE instead. */
- if (struct_return) {
- addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
- if (!addr)
- error ("Function return value unknown");
- return value_at (valtype, addr);
- }
-#endif
-
- val = allocate_value (valtype);
- EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val));
-
- return val;
-}
-
-/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
- EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
- and TYPE is the type (which is known to be struct, union or array).
-
- On most machines, the struct convention is used unless we are
- using gcc and the type is of a special size. */
-#if !defined (USE_STRUCT_CONVENTION)
-#define USE_STRUCT_CONVENTION(gcc_p, type)\
- (!((gcc_p) && (TYPE_LENGTH (value_type) == 1 \
- || TYPE_LENGTH (value_type) == 2 \
- || TYPE_LENGTH (value_type) == 4 \
- || TYPE_LENGTH (value_type) == 8 \
- ) \
- ))
-#endif
-
-/* Return true if the function specified is using the structure returning
- convention on this machine to return arguments, or 0 if it is using
- the value returning convention. FUNCTION is the value representing
- the function, FUNCADDR is the address of the function, and VALUE_TYPE
- is the type returned by the function. GCC_P is nonzero if compiled
- with GCC. */
-
-int
-using_struct_return (function, funcaddr, value_type, gcc_p)
- value function;
- CORE_ADDR funcaddr;
- struct type *value_type;
- int gcc_p;
- /*ARGSUSED*/
-{
- register enum type_code code = TYPE_CODE (value_type);
-
- if (code == TYPE_CODE_ERROR)
- error ("Function return type unknown.");
-
- if (code == TYPE_CODE_STRUCT ||
- code == TYPE_CODE_UNION ||
- code == TYPE_CODE_ARRAY)
- return USE_STRUCT_CONVENTION (gcc_p, value_type);
-
- return 0;
-}
-
-/* Store VAL so it will be returned if a function returns now.
- Does not verify that VAL's type matches what the current
- function wants to return. */
-
-void
-set_return_value (val)
- value val;
-{
- register enum type_code code = TYPE_CODE (VALUE_TYPE (val));
- double dbuf;
- LONGEST lbuf;
-
- if (code == TYPE_CODE_ERROR)
- error ("Function return type unknown.");
-
- if (code == TYPE_CODE_STRUCT
- || code == TYPE_CODE_UNION)
- error ("Specifying a struct or union return value is not supported.");
-
- /* FIXME, this is bogus. We don't know what the return conventions
- are, or how values should be promoted.... */
- if (code == TYPE_CODE_FLT)
- {
- dbuf = value_as_double (val);
-
- STORE_RETURN_VALUE (VALUE_TYPE (val), (char *)&dbuf);
- }
- else
- {
- lbuf = value_as_long (val);
- STORE_RETURN_VALUE (VALUE_TYPE (val), (char *)&lbuf);
- }
-}
-
-void
-_initialize_values ()
-{
- add_cmd ("convenience", no_class, show_convenience,
- "Debugger convenience (\"$foo\") variables.\n\
-These variables are created when you assign them values;\n\
-thus, \"print $foo=1\" gives \"$foo\" the value 1. Values may be any type.\n\n\
-A few convenience variables are given values automatically:\n\
-\"$_\"holds the last address examined with \"x\" or \"info lines\",\n\
-\"$__\" holds the contents of the last address examined with \"x\".",
- &showlist);
-
- add_cmd ("values", no_class, show_values,
- "Elements of value history around item number IDX (or last ten).",
- &showlist);
-}
diff --git a/gdb/vax-opcode.h b/gdb/vax-opcode.h
deleted file mode 100755
index 594e635..0000000
--- a/gdb/vax-opcode.h
+++ /dev/null
@@ -1,382 +0,0 @@
-/* Vax opcde list.
- Copyright (C) 1989, Free Software Foundation, Inc.
-
-This file is part of GDB and GAS.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifndef vax_opcodeT
-#define vax_opcodeT int
-#endif /* no vax_opcodeT */
-
-struct vot_wot /* vax opcode table: wot to do with this */
- /* particular opcode */
-{
- char * args; /* how to compile said opcode */
- vax_opcodeT code; /* op-code (may be > 8 bits!) */
-};
-
-struct vot /* vax opcode text */
-{
- char * name; /* opcode name: lowercase string [key] */
- struct vot_wot detail; /* rest of opcode table [datum] */
-};
-
-#define vot_how args
-#define vot_code code
-#define vot_detail detail
-#define vot_name name
-
-const static struct vot
-votstrs[] =
-{
-{ "halt", {"", 0x00 } },
-{ "nop", {"", 0x01 } },
-{ "rei", {"", 0x02 } },
-{ "bpt", {"", 0x03 } },
-{ "ret", {"", 0x04 } },
-{ "rsb", {"", 0x05 } },
-{ "ldpctx", {"", 0x06 } },
-{ "svpctx", {"", 0x07 } },
-{ "cvtps", {"rwabrwab", 0x08 } },
-{ "cvtsp", {"rwabrwab", 0x09 } },
-{ "index", {"rlrlrlrlrlwl", 0x0a } },
-{ "crc", {"abrlrwab", 0x0b } },
-{ "prober", {"rbrwab", 0x0c } },
-{ "probew", {"rbrwab", 0x0d } },
-{ "insque", {"abab", 0x0e } },
-{ "remque", {"abwl", 0x0f } },
-{ "bsbb", {"bb", 0x10 } },
-{ "brb", {"bb", 0x11 } },
-{ "bneq", {"bb", 0x12 } },
-{ "bnequ", {"bb", 0x12 } },
-{ "beql", {"bb", 0x13 } },
-{ "beqlu", {"bb", 0x13 } },
-{ "bgtr", {"bb", 0x14 } },
-{ "bleq", {"bb", 0x15 } },
-{ "jsb", {"ab", 0x16 } },
-{ "jmp", {"ab", 0x17 } },
-{ "bgeq", {"bb", 0x18 } },
-{ "blss", {"bb", 0x19 } },
-{ "bgtru", {"bb", 0x1a } },
-{ "blequ", {"bb", 0x1b } },
-{ "bvc", {"bb", 0x1c } },
-{ "bvs", {"bb", 0x1d } },
-{ "bcc", {"bb", 0x1e } },
-{ "bgequ", {"bb", 0x1e } },
-{ "blssu", {"bb", 0x1f } },
-{ "bcs", {"bb", 0x1f } },
-{ "addp4", {"rwabrwab", 0x20 } },
-{ "addp6", {"rwabrwabrwab", 0x21 } },
-{ "subp4", {"rwabrwab", 0x22 } },
-{ "subp6", {"rwabrwabrwab", 0x23 } },
-{ "cvtpt", {"rwababrwab", 0x24 } },
-{ "mulp", {"rwabrwabrwab", 0x25 } },
-{ "cvttp", {"rwababrwab", 0x26 } },
-{ "divp", {"rwabrwabrwab", 0x27 } },
-{ "movc3", {"rwabab", 0x28 } },
-{ "cmpc3", {"rwabab", 0x29 } },
-{ "scanc", {"rwababrb", 0x2a } },
-{ "spanc", {"rwababrb", 0x2b } },
-{ "movc5", {"rwabrbrwab", 0x2c } },
-{ "cmpc5", {"rwabrbrwab", 0x2d } },
-{ "movtc", {"rwabrbabrwab", 0x2e } },
-{ "movtuc", {"rwabrbabrwab", 0x2f } },
-{ "bsbw", {"bw", 0x30 } },
-{ "brw", {"bw", 0x31 } },
-{ "cvtwl", {"rwwl", 0x32 } },
-{ "cvtwb", {"rwwb", 0x33 } },
-{ "movp", {"rwabab", 0x34 } },
-{ "cmpp3", {"rwabab", 0x35 } },
-{ "cvtpl", {"rwabwl", 0x36 } },
-{ "cmpp4", {"rwabrwab", 0x37 } },
-{ "editpc", {"rwababab", 0x38 } },
-{ "matchc", {"rwabrwab", 0x39 } },
-{ "locc", {"rbrwab", 0x3a } },
-{ "skpc", {"rbrwab", 0x3b } },
-{ "movzwl", {"rwwl", 0x3c } },
-{ "acbw", {"rwrwmwbw", 0x3d } },
-{ "movaw", {"awwl", 0x3e } },
-{ "pushaw", {"aw", 0x3f } },
-{ "addf2", {"rfmf", 0x40 } },
-{ "addf3", {"rfrfwf", 0x41 } },
-{ "subf2", {"rfmf", 0x42 } },
-{ "subf3", {"rfrfwf", 0x43 } },
-{ "mulf2", {"rfmf", 0x44 } },
-{ "mulf3", {"rfrfwf", 0x45 } },
-{ "divf2", {"rfmf", 0x46 } },
-{ "divf3", {"rfrfwf", 0x47 } },
-{ "cvtfb", {"rfwb", 0x48 } },
-{ "cvtfw", {"rfww", 0x49 } },
-{ "cvtfl", {"rfwl", 0x4a } },
-{ "cvtrfl", {"rfwl", 0x4b } },
-{ "cvtbf", {"rbwf", 0x4c } },
-{ "cvtwf", {"rwwf", 0x4d } },
-{ "cvtlf", {"rlwf", 0x4e } },
-{ "acbf", {"rfrfmfbw", 0x4f } },
-{ "movf", {"rfwf", 0x50 } },
-{ "cmpf", {"rfrf", 0x51 } },
-{ "mnegf", {"rfwf", 0x52 } },
-{ "tstf", {"rf", 0x53 } },
-{ "emodf", {"rfrbrfwlwf", 0x54 } },
-{ "polyf", {"rfrwab", 0x55 } },
-{ "cvtfd", {"rfwd", 0x56 } },
- /* opcode 57 is not defined yet */
-{ "adawi", {"rwmw", 0x58 } },
- /* opcode 59 is not defined yet */
- /* opcode 5a is not defined yet */
- /* opcode 5b is not defined yet */
-{ "insqhi", {"abaq", 0x5c } },
-{ "insqti", {"abaq", 0x5d } },
-{ "remqhi", {"aqwl", 0x5e } },
-{ "remqti", {"aqwl", 0x5f } },
-{ "addd2", {"rdmd", 0x60 } },
-{ "addd3", {"rdrdwd", 0x61 } },
-{ "subd2", {"rdmd", 0x62 } },
-{ "subd3", {"rdrdwd", 0x63 } },
-{ "muld2", {"rdmd", 0x64 } },
-{ "muld3", {"rdrdwd", 0x65 } },
-{ "divd2", {"rdmd", 0x66 } },
-{ "divd3", {"rdrdwd", 0x67 } },
-{ "cvtdb", {"rdwb", 0x68 } },
-{ "cvtdw", {"rdww", 0x69 } },
-{ "cvtdl", {"rdwl", 0x6a } },
-{ "cvtrdl", {"rdwl", 0x6b } },
-{ "cvtbd", {"rbwd", 0x6c } },
-{ "cvtwd", {"rwwd", 0x6d } },
-{ "cvtld", {"rlwd", 0x6e } },
-{ "acbd", {"rdrdmdbw", 0x6f } },
-{ "movd", {"rdwd", 0x70 } },
-{ "cmpd", {"rdrd", 0x71 } },
-{ "mnegd", {"rdwd", 0x72 } },
-{ "tstd", {"rd", 0x73 } },
-{ "emodd", {"rdrbrdwlwd", 0x74 } },
-{ "polyd", {"rdrwab", 0x75 } },
-{ "cvtdf", {"rdwf", 0x76 } },
- /* opcode 77 is not defined yet */
-{ "ashl", {"rbrlwl", 0x78 } },
-{ "ashq", {"rbrqwq", 0x79 } },
-{ "emul", {"rlrlrlwq", 0x7a } },
-{ "ediv", {"rlrqwlwl", 0x7b } },
-{ "clrd", {"wd", 0x7c } },
-{ "clrg", {"wg", 0x7c } },
-{ "clrq", {"wd", 0x7c } },
-{ "movq", {"rqwq", 0x7d } },
-{ "movaq", {"aqwl", 0x7e } },
-{ "movad", {"adwl", 0x7e } },
-{ "pushaq", {"aq", 0x7f } },
-{ "pushad", {"ad", 0x7f } },
-{ "addb2", {"rbmb", 0x80 } },
-{ "addb3", {"rbrbwb", 0x81 } },
-{ "subb2", {"rbmb", 0x82 } },
-{ "subb3", {"rbrbwb", 0x83 } },
-{ "mulb2", {"rbmb", 0x84 } },
-{ "mulb3", {"rbrbwb", 0x85 } },
-{ "divb2", {"rbmb", 0x86 } },
-{ "divb3", {"rbrbwb", 0x87 } },
-{ "bisb2", {"rbmb", 0x88 } },
-{ "bisb3", {"rbrbwb", 0x89 } },
-{ "bicb2", {"rbmb", 0x8a } },
-{ "bicb3", {"rbrbwb", 0x8b } },
-{ "xorb2", {"rbmb", 0x8c } },
-{ "xorb3", {"rbrbwb", 0x8d } },
-{ "mnegb", {"rbwb", 0x8e } },
-{ "caseb", {"rbrbrb", 0x8f } },
-{ "movb", {"rbwb", 0x90 } },
-{ "cmpb", {"rbrb", 0x91 } },
-{ "mcomb", {"rbwb", 0x92 } },
-{ "bitb", {"rbrb", 0x93 } },
-{ "clrb", {"wb", 0x94 } },
-{ "tstb", {"rb", 0x95 } },
-{ "incb", {"mb", 0x96 } },
-{ "decb", {"mb", 0x97 } },
-{ "cvtbl", {"rbwl", 0x98 } },
-{ "cvtbw", {"rbww", 0x99 } },
-{ "movzbl", {"rbwl", 0x9a } },
-{ "movzbw", {"rbww", 0x9b } },
-{ "rotl", {"rbrlwl", 0x9c } },
-{ "acbb", {"rbrbmbbw", 0x9d } },
-{ "movab", {"abwl", 0x9e } },
-{ "pushab", {"ab", 0x9f } },
-{ "addw2", {"rwmw", 0xa0 } },
-{ "addw3", {"rwrwww", 0xa1 } },
-{ "subw2", {"rwmw", 0xa2 } },
-{ "subw3", {"rwrwww", 0xa3 } },
-{ "mulw2", {"rwmw", 0xa4 } },
-{ "mulw3", {"rwrwww", 0xa5 } },
-{ "divw2", {"rwmw", 0xa6 } },
-{ "divw3", {"rwrwww", 0xa7 } },
-{ "bisw2", {"rwmw", 0xa8 } },
-{ "bisw3", {"rwrwww", 0xa9 } },
-{ "bicw2", {"rwmw", 0xaa } },
-{ "bicw3", {"rwrwww", 0xab } },
-{ "xorw2", {"rwmw", 0xac } },
-{ "xorw3", {"rwrwww", 0xad } },
-{ "mnegw", {"rwww", 0xae } },
-{ "casew", {"rwrwrw", 0xaf } },
-{ "movw", {"rwww", 0xb0 } },
-{ "cmpw", {"rwrw", 0xb1 } },
-{ "mcomw", {"rwww", 0xb2 } },
-{ "bitw", {"rwrw", 0xb3 } },
-{ "clrw", {"ww", 0xb4 } },
-{ "tstw", {"rw", 0xb5 } },
-{ "incw", {"mw", 0xb6 } },
-{ "decw", {"mw", 0xb7 } },
-{ "bispsw", {"rw", 0xb8 } },
-{ "bicpsw", {"rw", 0xb9 } },
-{ "popr", {"rw", 0xba } },
-{ "pushr", {"rw", 0xbb } },
-{ "chmk", {"rw", 0xbc } },
-{ "chme", {"rw", 0xbd } },
-{ "chms", {"rw", 0xbe } },
-{ "chmu", {"rw", 0xbf } },
-{ "addl2", {"rlml", 0xc0 } },
-{ "addl3", {"rlrlwl", 0xc1 } },
-{ "subl2", {"rlml", 0xc2 } },
-{ "subl3", {"rlrlwl", 0xc3 } },
-{ "mull2", {"rlml", 0xc4 } },
-{ "mull3", {"rlrlwl", 0xc5 } },
-{ "divl2", {"rlml", 0xc6 } },
-{ "divl3", {"rlrlwl", 0xc7 } },
-{ "bisl2", {"rlml", 0xc8 } },
-{ "bisl3", {"rlrlwl", 0xc9 } },
-{ "bicl2", {"rlml", 0xca } },
-{ "bicl3", {"rlrlwl", 0xcb } },
-{ "xorl2", {"rlml", 0xcc } },
-{ "xorl3", {"rlrlwl", 0xcd } },
-{ "mnegl", {"rlwl", 0xce } },
-{ "casel", {"rlrlrl", 0xcf } },
-{ "movl", {"rlwl", 0xd0 } },
-{ "cmpl", {"rlrl", 0xd1 } },
-{ "mcoml", {"rlwl", 0xd2 } },
-{ "bitl", {"rlrl", 0xd3 } },
-{ "clrf", {"wf", 0xd4 } },
-{ "clrl", {"wl", 0xd4 } },
-{ "tstl", {"rl", 0xd5 } },
-{ "incl", {"ml", 0xd6 } },
-{ "decl", {"ml", 0xd7 } },
-{ "adwc", {"rlml", 0xd8 } },
-{ "sbwc", {"rlml", 0xd9 } },
-{ "mtpr", {"rlrl", 0xda } },
-{ "mfpr", {"rlwl", 0xdb } },
-{ "movpsl", {"wl", 0xdc } },
-{ "pushl", {"rl", 0xdd } },
-{ "moval", {"alwl", 0xde } },
-{ "movaf", {"afwl", 0xde } },
-{ "pushal", {"al", 0xdf } },
-{ "pushaf", {"af", 0xdf } },
-{ "bbs", {"rlabbb", 0xe0 } },
-{ "bbc", {"rlabbb", 0xe1 } },
-{ "bbss", {"rlabbb", 0xe2 } },
-{ "bbcs", {"rlabbb", 0xe3 } },
-{ "bbsc", {"rlabbb", 0xe4 } },
-{ "bbcc", {"rlabbb", 0xe5 } },
-{ "bbssi", {"rlabbb", 0xe6 } },
-{ "bbcci", {"rlabbb", 0xe7 } },
-{ "blbs", {"rlbb", 0xe8 } },
-{ "blbc", {"rlbb", 0xe9 } },
-{ "ffs", {"rlrbvbwl", 0xea } },
-{ "ffc", {"rlrbvbwl", 0xeb } },
-{ "cmpv", {"rlrbvbrl", 0xec } },
-{ "cmpzv", {"rlrbvbrl", 0xed } },
-{ "extv", {"rlrbvbwl", 0xee } },
-{ "extzv", {"rlrbvbwl", 0xef } },
-{ "insv", {"rlrlrbvb", 0xf0 } },
-{ "acbl", {"rlrlmlbw", 0xf1 } },
-{ "aoblss", {"rlmlbb", 0xf2 } },
-{ "aobleq", {"rlmlbb", 0xf3 } },
-{ "sobgeq", {"mlbb", 0xf4 } },
-{ "sobgtr", {"mlbb", 0xf5 } },
-{ "cvtlb", {"rlwb", 0xf6 } },
-{ "cvtlw", {"rlww", 0xf7 } },
-{ "ashp", {"rbrwabrbrwab", 0xf8 } },
-{ "cvtlp", {"rlrwab", 0xf9 } },
-{ "callg", {"abab", 0xfa } },
-{ "calls", {"rlab", 0xfb } },
-{ "xfc", {"", 0xfc } },
- /* undefined opcodes here */
-{ "cvtdh", {"rdwh", 0x32fd } },
-{ "cvtgf", {"rgwh", 0x33fd } },
-{ "addg2", {"rgmg", 0x40fd } },
-{ "addg3", {"rgrgwg", 0x41fd } },
-{ "subg2", {"rgmg", 0x42fd } },
-{ "subg3", {"rgrgwg", 0x43fd } },
-{ "mulg2", {"rgmg", 0x44fd } },
-{ "mulg3", {"rgrgwg", 0x45fd } },
-{ "divg2", {"rgmg", 0x46fd } },
-{ "divg3", {"rgrgwg", 0x47fd } },
-{ "cvtgb", {"rgwb", 0x48fd } },
-{ "cvtgw", {"rgww", 0x49fd } },
-{ "cvtgl", {"rgwl", 0x4afd } },
-{ "cvtrgl", {"rgwl", 0x4bfd } },
-{ "cvtbg", {"rbwg", 0x4cfd } },
-{ "cvtwg", {"rwwg", 0x4dfd } },
-{ "cvtlg", {"rlwg", 0x4efd } },
-{ "acbg", {"rgrgmgbw", 0x4ffd } },
-{ "movg", {"rgwg", 0x50fd } },
-{ "cmpg", {"rgrg", 0x51fd } },
-{ "mnegg", {"rgwg", 0x52fd } },
-{ "tstg", {"rg", 0x53fd } },
-{ "emodg", {"rgrwrgwlwg", 0x54fd } },
-{ "polyg", {"rgrwab", 0x55fd } },
-{ "cvtgh", {"rgwh", 0x56fd } },
- /* undefined opcodes here */
-{ "addh2", {"rhmh", 0x60fd } },
-{ "addh3", {"rhrhwh", 0x61fd } },
-{ "subh2", {"rhmh", 0x62fd } },
-{ "subh3", {"rhrhwh", 0x63fd } },
-{ "mulh2", {"rhmh", 0x64fd } },
-{ "mulh3", {"rhrhwh", 0x65fd } },
-{ "divh2", {"rhmh", 0x66fd } },
-{ "divh3", {"rhrhwh", 0x67fd } },
-{ "cvthb", {"rhwb", 0x68fd } },
-{ "cvthw", {"rhww", 0x69fd } },
-{ "cvthl", {"rhwl", 0x6afd } },
-{ "cvtrhl", {"rhwl", 0x6bfd } },
-{ "cvtbh", {"rbwh", 0x6cfd } },
-{ "cvtwh", {"rwwh", 0x6dfd } },
-{ "cvtlh", {"rlwh", 0x6efd } },
-{ "acbh", {"rhrhmhbw", 0x6ffd } },
-{ "movh", {"rhwh", 0x70fd } },
-{ "cmph", {"rhrh", 0x71fd } },
-{ "mnegh", {"rhwh", 0x72fd } },
-{ "tsth", {"rh", 0x73fd } },
-{ "emodh", {"rhrwrhwlwh", 0x74fd } },
-{ "polyh", {"rhrwab", 0x75fd } },
-{ "cvthg", {"rhwg", 0x76fd } },
- /* undefined opcodes here */
-{ "clrh", {"wh", 0x7cfd } },
-{ "clro", {"wo", 0x7cfd } },
-{ "movo", {"rowo", 0x7dfd } },
-{ "movah", {"ahwl", 0x7efd } },
-{ "movao", {"aowl", 0x7efd } },
-{ "pushah", {"ah", 0x7ffd } },
-{ "pushao", {"ao", 0x7ffd } },
- /* undefined opcodes here */
-{ "cvtfh", {"rfwh", 0x98fd } },
-{ "cvtfg", {"rfwg", 0x99fd } },
- /* undefined opcodes here */
-{ "cvthf", {"rhwf", 0xf6fd } },
-{ "cvthd", {"rhwd", 0xf7fd } },
- /* undefined opcodes here */
-{ "bugl", {"rl", 0xfdff } },
-{ "bugw", {"rw", 0xfeff } },
- /* undefined opcodes here */
-
-{ "" , "" } /* empty is end sentinel */
-
-}; /* votstrs */
-
-/* end: vax.opcode.h */
diff --git a/gdb/vax-pinsn.c b/gdb/vax-pinsn.c
deleted file mode 100644
index 011cd95..0000000
--- a/gdb/vax-pinsn.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/* Print vax instructions for GDB, the GNU debugger.
- Copyright (C) 1986, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-
-#include "defs.h"
-#include "param.h"
-#include "symtab.h"
-#include "vax-opcode.h"
-
-/* Vax instructions are never longer than this. */
-#define MAXLEN 62
-
-/* Number of elements in the opcode table. */
-#define NOPCODES (sizeof votstrs / sizeof votstrs[0])
-
-extern char *reg_names[];
-
-static unsigned char *print_insn_arg ();
-
-/* Print the vax instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
-{
- unsigned char buffer[MAXLEN];
- register int i;
- register unsigned char *p;
- register char *d;
-
- read_memory (memaddr, buffer, MAXLEN);
-
- for (i = 0; i < NOPCODES; i++)
- if (votstrs[i].detail.code == buffer[0]
- || votstrs[i].detail.code == *(unsigned short *)buffer)
- break;
-
- /* Handle undefined instructions. */
- if (i == NOPCODES)
- {
- fprintf (stream, "0%o", buffer[0]);
- return 1;
- }
-
- fprintf (stream, "%s", votstrs[i].name);
-
- /* Point at first byte of argument data,
- and at descriptor for first argument. */
- p = buffer + 1 + (votstrs[i].detail.code >= 0x100);
- d = votstrs[i].detail.args;
-
- if (*d)
- fputc (' ', stream);
-
- while (*d)
- {
- p = print_insn_arg (d, p, memaddr + (p - buffer), stream);
- d += 2;
- if (*d)
- fprintf (stream, ",");
- }
- return p - buffer;
-}
-
-static unsigned char *
-print_insn_arg (d, p, addr, stream)
- char *d;
- register char *p;
- CORE_ADDR addr;
- FILE *stream;
-{
- register int regnum = *p & 0xf;
- float floatlitbuf;
-
- if (*d == 'b')
- {
- if (d[1] == 'b')
- fprintf (stream, "0x%x", addr + *p++ + 1);
- else
- {
- fprintf (stream, "0x%x", addr + *(short *)p + 2);
- p += 2;
- }
- }
- else
- switch ((*p++ >> 4) & 0xf)
- {
- case 0:
- case 1:
- case 2:
- case 3: /* Literal mode */
- if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h')
- {
- *(int *)&floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4);
- fprintf (stream, "$%f", floatlitbuf);
- }
- else
- fprintf (stream, "$%d", p[-1] & 0x3f);
- break;
-
- case 4: /* Indexed */
- p = (char *) print_insn_arg (d, p, addr + 1, stream);
- fprintf (stream, "[%s]", reg_names[regnum]);
- break;
-
- case 5: /* Register */
- fprintf (stream, reg_names[regnum]);
- break;
-
- case 7: /* Autodecrement */
- fputc ('-', stream);
- case 6: /* Register deferred */
- fprintf (stream, "(%s)", reg_names[regnum]);
- break;
-
- case 9: /* Autoincrement deferred */
- fputc ('@', stream);
- if (regnum == PC_REGNUM)
- {
- fputc ('#', stream);
- print_address (*(long *)p, stream);
- p += 4;
- break;
- }
- case 8: /* Autoincrement */
- if (regnum == PC_REGNUM)
- {
- fputc ('#', stream);
- switch (d[1])
- {
- case 'b':
- fprintf (stream, "%d", *p++);
- break;
-
- case 'w':
- fprintf (stream, "%d", *(short *)p);
- p += 2;
- break;
-
- case 'l':
- fprintf (stream, "%d", *(long *)p);
- p += 4;
- break;
-
- case 'q':
- fprintf (stream, "0x%x%08x", ((long *)p)[1], ((long *)p)[0]);
- p += 8;
- break;
-
- case 'o':
- fprintf (stream, "0x%x%08x%08x%08x",
- ((long *)p)[3], ((long *)p)[2],
- ((long *)p)[1], ((long *)p)[0]);
- p += 16;
- break;
-
- case 'f':
- if (INVALID_FLOAT (p, 4))
- fprintf (stream, "<<invalid float 0x%x>>", *(int *) p);
- else
- fprintf (stream, "%f", *(float *) p);
- p += 4;
- break;
-
- case 'd':
- if (INVALID_FLOAT (p, 8))
- fprintf (stream, "<<invalid float 0x%x%08x>>",
- ((long *)p)[1], ((long *)p)[0]);
- else
- fprintf (stream, "%f", *(double *) p);
- p += 8;
- break;
-
- case 'g':
- fprintf (stream, "g-float");
- p += 8;
- break;
-
- case 'h':
- fprintf (stream, "h-float");
- p += 16;
- break;
-
- }
- }
- else
- fprintf (stream, "(%s)+", reg_names[regnum]);
- break;
-
- case 11: /* Byte displacement deferred */
- fputc ('@', stream);
- case 10: /* Byte displacement */
- if (regnum == PC_REGNUM)
- print_address (addr + *p + 2, stream);
- else
- fprintf (stream, "%d(%s)", *p, reg_names[regnum]);
- p += 1;
- break;
-
- case 13: /* Word displacement deferred */
- fputc ('@', stream);
- case 12: /* Word displacement */
- if (regnum == PC_REGNUM)
- print_address (addr + *(short *)p + 3, stream);
- else
- fprintf (stream, "%d(%s)", *(short *)p, reg_names[regnum]);
- p += 2;
- break;
-
- case 15: /* Long displacement deferred */
- fputc ('@', stream);
- case 14: /* Long displacement */
- if (regnum == PC_REGNUM)
- print_address (addr + *(long *)p + 5, stream);
- else
- fprintf (stream, "%d(%s)", *(long *)p, reg_names[regnum]);
- p += 4;
- }
-
- return (unsigned char *) p;
-}
diff --git a/gdb/vx-share/.Sanitize b/gdb/vx-share/.Sanitize
deleted file mode 100644
index 39d6664..0000000
--- a/gdb/vx-share/.Sanitize
+++ /dev/null
@@ -1,58 +0,0 @@
-# Sanitize.in for devo.
-# $Id$
-#
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-echo Sanitizing `pwd`...
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-dbgRpcLib.h
-ptrace.h
-reg.h
-vxTypes.h
-vxWorks.h
-wait.h
-xdr_ld.c
-xdr_ld.h
-xdr_ptrace.c
-xdr_ptrace.h
-xdr_rdb.c
-xdr_rdb.h
-xdr_regs.c
-xdr_regs.h
-
-Do-last:
-
-echo Done in `pwd`.
-
-#
-#
-# $Log$
-# Revision 1.1 1991/05/23 22:05:02 rich
-# Initial revision
-#
-#
-#
-
-# End of file.
diff --git a/gdb/vx-share/dbgRpcLib.h b/gdb/vx-share/dbgRpcLib.h
deleted file mode 100644
index c420075..0000000
--- a/gdb/vx-share/dbgRpcLib.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* dbgRpcLib.h - header file for remote debugging via rpc */
-
-/*
-modification history
---------------------
-01b,04oct90,maf added VX_BOOT_FILE_INQ.
-01a,05jun90,llk extracted from xdr_dbx.h.
-*/
-
-#ifndef INCdbxRpcLibh
-#define INCdbxRpcLibh 1
-
-#define PROCESS_START 50
-#define PROCESS_WAIT 51
-#define VX_STATE_INQ 60
-#define VX_LOAD 61
-#define VX_SYMBOL_INQ 62
-#define VX_BREAK_ADD 63
-#define VX_BREAK_DELETE 64
-#define VX_FP_INQUIRE 65
-#define VX_TASK_SUSPEND 66
-#define VX_CALL_FUNC 67
-#define VX_CONV_FROM_68881 68
-#define VX_CONV_TO_68881 69
-#define VX_BOOT_FILE_INQ 70
-#define VX_SOURCE_STEP 71
-
-#endif INCdbxRpcLibh
diff --git a/gdb/vx-share/ptrace.h b/gdb/vx-share/ptrace.h
deleted file mode 100644
index 34801c7..0000000
--- a/gdb/vx-share/ptrace.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* @(#)ptrace.h 1.1 86/07/07 SMI */
-
-/*
- * Copyright (c) 1985 by Sun Microsystems, Inc.
- */
-
-/*
-modification history
---------------------
-01a,05jun90,llk borrowed.
-*/
-
-#ifndef _PTRACE_
-#define _PTRACE_
-
-/*
- * Request values for the ptrace system call
- */
-enum ptracereq {
- PTRACE_TRACEME = 0, /* 0, by tracee to begin tracing */
- PTRACE_CHILDDONE = 0, /* 0, tracee is done with his half */
- PTRACE_PEEKTEXT, /* 1, read word from text segment */
- PTRACE_PEEKDATA, /* 2, read word from data segment */
- PTRACE_PEEKUSER, /* 3, read word from user struct */
- PTRACE_POKETEXT, /* 4, write word into text segment */
- PTRACE_POKEDATA, /* 5, write word into data segment */
- PTRACE_POKEUSER, /* 6, write word into user struct */
- PTRACE_CONT, /* 7, continue process */
- PTRACE_KILL, /* 8, terminate process */
- PTRACE_SINGLESTEP, /* 9, single step process */
- PTRACE_ATTACH, /* 10, attach to an existing process */
- PTRACE_DETACH, /* 11, detach from a process */
- PTRACE_GETREGS, /* 12, get all registers */
- PTRACE_SETREGS, /* 13, set all registers */
- PTRACE_GETFPREGS, /* 14, get all floating point regs */
- PTRACE_SETFPREGS, /* 15, set all floating point regs */
- PTRACE_READDATA, /* 16, read data segment */
- PTRACE_WRITEDATA, /* 17, write data segment */
- PTRACE_READTEXT, /* 18, read text segment */
- PTRACE_WRITETEXT, /* 19, write text segment */
- PTRACE_GETFPAREGS, /* 20, get all fpa regs */
- PTRACE_SETFPAREGS, /* 21, set all fpa regs */
-};
-#endif !_PTRACE
diff --git a/gdb/vx-share/reg.h b/gdb/vx-share/reg.h
deleted file mode 100644
index 84658b7..0000000
--- a/gdb/vx-share/reg.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/* @(#)reg.h 1.1 86/07/07 SMI */
-
-/*
- * Copyright (c) 1986 by Sun Microsystems, Inc.
- */
-
-/*
-modification history
---------------------
-01a,05jun90,llk borrowed.
-*/
-
-#ifndef _REG_
-#define _REG_
-
-#ifdef I80960
-
-/* Intel 960 register values passed over the wire by RPC: */
-
-struct regs
-{
- int r_lreg[16]; /* local registers */
- int r_greg[16]; /* global registers */
- int r_pcw; /* process control word */
- int r_acw; /* arithmetic control word */
- int r_tcw; /* trace control word */
-};
-
-#define FP_REG_SIZE 12
-
-struct fp_status {
- char fps_regs[4][FP_REG_SIZE]; /* floating point regs */
-};
-
-#else /* For now, just 68000 */
-
-/*
- * Location of the users' stored
- * registers relative to R0.
- * Usage is u.u_ar0[XX].
- */
-#define R0 (0)
-#define R1 (1)
-#define R2 (2)
-#define R3 (3)
-#define R4 (4)
-#define R5 (5)
-#define R6 (6)
-#define R7 (7)
-#define AR0 (8)
-#define AR1 (9)
-#define AR2 (10)
-#define AR3 (11)
-#define AR4 (12)
-#define AR5 (13)
-#define AR6 (14)
-#define AR7 (15)
-#define SP (15)
-#define PS (16)
-#define PC (17)
-
-/*
- * And now for something completely the same...
- */
-#ifndef LOCORE
-struct regs {
- int r_dreg[8]; /* data registers */
-#define r_r0 r_dreg[0] /* r0 for portability */
- int r_areg[8]; /* address registers */
-#define r_sp r_areg[7] /* user stack pointer */
- int r_sr; /* status register (actually a short) */
-#define r_ps r_sr
- int r_pc; /* program counter */
-};
-
-struct stkfmt {
- int f_stkfmt : 4; /* stack format */
- int : 2;
- int f_vector : 10; /* vector offset */
- short f_beibase; /* start of bus error info (if any) */
-};
-
-
-/*
- * Struct for floating point registers and general state
- * for the MC68881 (the sky fpp has no user visible state).
- * If fps_flags == FPS_UNUSED, the other 68881 fields have no meaning.
- * fps_code and fps_flags are software implemented fields.
- * fps_flags is not used when set by user level programs,
- * but changing fps_code has the side effect of changing u.u_code.
- */
-
-typedef struct ext_fp {
- int fp[3];
-} ext_fp; /* extended 96-bit 68881 fp registers */
-
-struct fp_status {
- ext_fp fps_regs[8]; /* 68881 floating point regs */
- int fps_control; /* 68881 control reg */
- int fps_status; /* 68881 status reg */
- int fps_iaddr; /* 68881 instruction address reg */
- int fps_code; /* additional word for signals */
- int fps_flags; /* r/o - unused, idle or busy */
-};
-#endif !LOCORE
-
-/*
- * Values defined for `fps_flags'.
- */
-#define FPS_UNUSED 0 /* 68881 never used yet */
-#define FPS_IDLE 1 /* 68881 instruction completed */
-#define FPS_BUSY 2 /* 68881 instruction interrupted */
-
-/*
- * The EXT_FPS_FLAGS() macro is used to convert a pointer to an
- * fp_istate into a value to be used for the user visible state
- * found in fps_flags. As a speed optimization, this convertion
- * is only done is required (e.g. the PTRACE_GETFPREGS ptrace
- * call or when dumping core) instead of on each context switch.
- * The tests that we base the state on are that a fpis_vers of
- * FPIS_VERSNULL means NULL state, else a fpis_bufsiz of FPIS_IDLESZ
- * means IDLE state, else we assume BUSY state.
- */
-#define FPIS_VERSNULL 0x0
-#define FPIS_IDLESIZE 0x18
-
-#define EXT_FPS_FLAGS(istatep) \
- ((istatep)->fpis_vers == FPIS_VERSNULL ? FPS_UNUSED : \
- (istatep)->fpis_bufsiz == FPIS_IDLESIZE ? FPS_IDLE : FPS_BUSY)
-
-#ifndef LOCORE
-/*
- * Struct for the internal state of the MC68881
- * Although the MC68881 can have a smaller maximum for
- * internal state, we allow for more to allow for expansion.
- */
-#define FPIS_BUFSIZ 0xc0
-
-struct fp_istate {
- unsigned char fpis_vers; /* version number */
- unsigned char fpis_bufsiz; /* size of info in fpis_buf */
- unsigned short fpis_reserved; /* reserved word */
- unsigned char fpis_buf[FPIS_BUFSIZ]; /* fpp internal state buffer */
-};
-
-/*
- * Structures for the status and data registers are defined here.
- * Struct fpa_status are included in the u area.
- * Struct fpa_regs is included in struct core.
- */
-
-/* struct fpa_status is saved/restored during context switch */
-struct fpa_status {
- unsigned int fpas_state; /* STATE, supervisor privileged reg */
- unsigned int fpas_imask; /* IMASK */
- unsigned int fpas_load_ptr; /* LOAD_PTR */
- unsigned int fpas_ierr; /* IERR */
- unsigned int fpas_act_instr; /* pipe active instruction halves */
- unsigned int fpas_nxt_instr; /* pipe next instruction halves */
- unsigned int fpas_act_d1half;/* pipe active data first half */
- unsigned int fpas_act_d2half;/* pipe active data second half */
- unsigned int fpas_nxt_d1half;/* pipe next data first half */
- unsigned int fpas_nxt_d2half;/* pipe next data second half */
- unsigned int fpas_mode3_0; /* FPA MODE3_0 register */
- unsigned int fpas_wstatus; /* FPA WSTATUS register */
-};
-
-/*
- * Since there are 32 contexts supported by the FPA hardware,
- * when we do context switch on the FPA, we don't save/restore
- * the data registers between the FPA and the u area.
- * If there are already 32 processes using the fpa concurrently,
- * we give an error message to the 33rd process trying to use the fpa.
- * (Hopefully there will not be this many processes using FPA concurrently.)
- */
-
-#define FPA_NCONTEXTS 32
-#define FPA_NDATA_REGS 32
-
-typedef struct fpa_long {
- int fpl_data[2];
-} fpa_long; /* 64 bit double precision registers */
-
-/* Struct fpa_regs is included in struct core. */
-struct fpa_regs {
- unsigned int fpar_flags; /* if zero, other fields are meaningless */
- struct fpa_status fpar_status;
- fpa_long fpar_data[FPA_NDATA_REGS];
-};
-
-/*
- * The size of struct fpa_regs is changed from 141 ints in 3.0 to
- * 77 ints in 3.x. A pad of this size difference is added to struct core.
- */
-#define CORE_PADLEN 64
-
-/*
- * If there is going to be external FPU state then we must define the FPU
- * variable
- */
-struct fpu {
- struct fp_status f_fpstatus; /* External FPP state, if any */
- struct fpa_regs f_fparegs; /* FPA registers, if any */
- int f_pad[CORE_PADLEN]; /* see comment above */
-};
-
-#endif !LOCORE
-#endif /* !I80960 */
-#endif !_REG_
diff --git a/gdb/vx-share/vxTypes.h b/gdb/vx-share/vxTypes.h
deleted file mode 100644
index 3ebd7c6..0000000
--- a/gdb/vx-share/vxTypes.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* vxTypes.h - VxWorks type definition header */
-
-/* Copyright 1984-1990 Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01c,05oct90,shl added copyright notice.
- made #endif ANSI style.
-01b,10aug90,dnw added VOIDFUNCPTR
-01a,29may90,del written.
-*/
-
-#ifndef INCvxTypesh
-#define INCvxTypesh
-
-/* The following stuff must NOT be included if this include file is used
- * from assembly language. Just #define ASMLANGUAGE before the include,
- * to get rid of it.
- */
-
-#ifndef ASMLANGUAGE
-
-/* vxWorks types */
-
-typedef char INT8;
-typedef short INT16;
-typedef int INT32;
-
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-
-typedef unsigned char UCHAR;
-typedef unsigned short USHORT;
-typedef unsigned int UINT;
-typedef unsigned long ULONG;
-
-typedef int BOOL;
-typedef int VOID;
-typedef int STATUS;
-typedef int ARGINT;
-
-typedef int (*FUNCPTR) (); /* ptr to function returning int */
-typedef VOID (*VOIDFUNCPTR) (); /* ptr to function returning VOID */
-
-
-/* historical definitions - now obsolete */
-
-typedef char TINY; /* obsolete */
-typedef char TBOOL; /* obsolete */
-typedef unsigned char UTINY; /* obsolete */
-
-
-/* architecture dependent typedefs */
-
-#ifdef CPU_FAMILY
-
-#if CPU_FAMILY==MC680X0
-typedef unsigned short INSTR; /* word-aligned instructions */
-#endif /* CPU_FAMILY==MC680X0 */
-
-#if CPU_FAMILY==SPARC
-typedef unsigned long INSTR; /* 32 bit word-aligned instructions */
-#endif /* CPU_FAMILY==SPARC */
-
-#endif
-
-#endif /* ASMLANGUAGE */
-#endif /* INCvxTypesh */
diff --git a/gdb/vx-share/vxWorks.h b/gdb/vx-share/vxWorks.h
deleted file mode 100644
index 483313e..0000000
--- a/gdb/vx-share/vxWorks.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/* vxWorks.h - VxWorks standard definitions header */
-
-/* Copyright 1984-1990 Wind River Systems, Inc. */
-
-/*
-modification history
---------------------
-01z,05oct90,shl added copyright notice.
- made #endif ANSI style.
-01y,28sep90,del added I960 defines.
-01x,29may90,del moved types to vxTypes.h
-01w,09apr90,jcf added timeout definitions.
-01v,24jan90,gae moved network configuration flags here from makefile's.
-01u,01sep88,mcl definition of INSTR dependent on processor family; added SPARC.
- +gae added MC680X0 and defined CPU_FAMILY.
-01t,08apr89,dnw added ifdef to prevent inclusion of vxWorks.h more than once.
-01s,22jun88,dnw moved READ, WRITE, and UPDATE back here from ioLib.h.
-01r,22apr88,gae oops! forgot some #endif's in 01q.
-01q,12apr88,gae removed QUICK & WAIT; added STD_{IN,OUT,ERR}.
- fixed #define's of FALSE, TRUE, etc.
- moved READ, WRITE, and UPDATE to ioLib.h.
-01p,04dec87,dnw added undefine of MC68000 to get around Green Hills bug that
- pre-defines MC68000.
-01o,12nov87,ecs added type ULONG.
-01n,08feb86,dnw added types INSTR, UINT, USHORT.
-01m,14oct85,rdc added BUS types.
-01l,16jul85,jlf added conditional for NULL and EOF.
-01k,24jun85,rdc installed condtional compile so we can include in
- assembly language files. See instructions below.
- Added System type macro and CPU type macro.
-01j,13jun85,dnw cleaned-up, removed more obsolete stuff to wrs.h
-01i,11sep84,jlf changed name from wrs.h to vxWorks.h. removed GLOBAL.
-01h,03jun84,dnw removed IGNORE declaration.
-01g,09apr84,jlf added MEMBER_SIZE macro.
-01f,14dec83,dnw added MSB, LSB macros
-01e,17nov83,jlf added STATUS type, for routines which return a status.
-01d,13jul83,dnw added NELEMENTS macro
-01c,14May83,dnw added OFFSET macro
-01b,17Feb83,dnw added stuff from Whitesmiths std.h
-01a,15Feb83,dnw written
-*/
-
-#ifndef INCvxWorksh
-#define INCvxWorksh
-
-#if !defined(NULL) || (NULL!=0)
-#define NULL 0
-#endif
-
-#if !defined(EOF) || (EOF!=(-1))
-#define EOF (-1)
-#endif
-
-#if !defined(FALSE) || (FALSE!=0)
-#define FALSE 0
-#endif
-
-#if !defined(TRUE) || (TRUE!=1)
-#define TRUE 1
-#endif
-
-
-#define NONE (-1) /* for times when NULL won't do */
-#define EOS '\0' /* C string terminator */
-
-
-/* return status values */
-
-#define OK 0
-#define ERROR (-1)
-
-/* timeout defines */
-
-#define NO_WAIT 0
-#define WAIT_FOREVER (-1)
-
-/* low-level I/O input, output, error fd's */
-
-#define STD_IN 0
-#define STD_OUT 1
-#define STD_ERR 2
-
-/* modes - must match O_RDONLY/O_WRONLY/O_RDWR in ioLib.h! */
-
-#define READ 0
-#define WRITE 1
-#define UPDATE 2
-
-/* SYSTEM types */
-
-#define V7 1 /* ATT version 7 */
-#define SYS_V 2 /* ATT System 5 */
-#define BSD_4_2 3 /* Berkeley BSD 4.2 */
-
-/* CPU types */
-
-/* The Green Hills compiler pre-defines "MC68000"!! */
-#ifdef MC68000
-#undef MC68000
-#endif
-
-#define MC68000 1
-#define MC68010 2
-#define MC68020 3
-#define MC68030 4
-#define MC68040 5
-#define MC680X0 9
-
-#define SPARC 10
-
-#ifndef I960
-#define I960 20
-#endif
-
-#define I960KB 21
-#define I960CA 22
-
-#if CPU==MC68000 || CPU==MC68010 || CPU==MC68020 || CPU==MC68030
-#define CPU_FAMILY MC680X0
-#endif /* CPU==MC68000 || CPU==MC68010 || CPU==MC68020 || CPU==MC68030 */
-
-#if CPU==SPARC
-#define CPU_FAMILY SPARC
-#endif /* CPU==SPARC */
-
-#if CPU==I960KB
-#define CPU_FAMILY I960
-#endif /* CPU==I960KB */
-
-#if CPU==I960CA
-#define CPU_FAMILY I960
-#endif /* CPU==I960CA */
-
-/* BUS types */
-
-#define VME_BUS 1
-#define MULTI_BUS 2
-
-/* network configuration parameters */
-
-#define INET /* include internet protocols */
-#define BSD 43 /* BSD 4.3 -like OS */
-#define BSDDEBUG /* turn on debug */
-#define GATEWAY /* tables to be initialized for gateway routing */
-
-/* common macros */
-
-#define MSB(x) (((x) >> 8) & 0xff) /* most signif byte of 2-byte integer */
-#define LSB(x) ((x) & 0xff) /* least signif byte of 2-byte integer*/
-
-#define OFFSET(structure, member) /* byte offset of member in structure*/\
- ((int) &(((structure *) 0) -> member))
-
-#define MEMBER_SIZE(structure, member) /* size of a member of a structure */\
- (sizeof (((structure *) 0) -> member))
-
-#define NELEMENTS(array) /* number of elements in an array */ \
- (sizeof (array) / sizeof ((array) [0]))
-
-#define FOREVER for (;;)
-
-#define max(x, y) (((x) < (y)) ? (y) : (x))
-#define min(x, y) (((x) < (y)) ? (x) : (y))
-
-
-/* storage class specifier definitions */
-
-#define FAST register
-#define IMPORT extern
-#define LOCAL static
-
-
-/* include typedefs - must come after CPU_FAMILY definitions above */
-
-#include "vxTypes.h"
-
-#endif /* INCvxWorksh */
diff --git a/gdb/vx-share/wait.h b/gdb/vx-share/wait.h
deleted file mode 100644
index bb81f5b..0000000
--- a/gdb/vx-share/wait.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* wait.h - header file for remote wait call */
-
-/*
-modification history
---------------------
-01a,05jun90,llk borrowed.
-*/
-
-/* Define how to access the structure that the wait system call stores.
- On many systems, there is a structure defined for this.
- But on vanilla-ish USG systems there is not. */
-
-#ifndef HAVE_WAIT_STRUCT
-#define WAITTYPE int
-#define WIFSTOPPED(w) (((w)&0377) == 0177)
-#define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0)
-#define WIFEXITED(w) (((w)&0377) == 0)
-#define WRETCODE(w) ((w) >> 8)
-#define WSTOPSIG(w) ((w) >> 8)
-#define WCOREDUMP(w) (((w)&0200) != 0)
-#define WTERMSIG(w) ((w) & 0177)
-#define WSETEXIT(w, status) ((w) = (status))
-#define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8)))
-#else
-#if FALSE
-#ifndef ORIG
-
-/* don't include sys/wait.h */
-
-#else ORIG
-#include <sys/wait.h>
-#endif ORIG
-#endif FALSE
-#define WAITTYPE union wait
-#define WRETCODE(w) (w).w_retcode
-#define WSTOPSIG(w) (w).w_stopsig
-#define WCOREDUMP(w) (w).w_coredump
-#define WTERMSIG(w) (w).w_termsig
-#define WSETEXIT(w, status) ((w).w_status = (status))
-#define WSETSTOP(w,sig) \
- ((w).w_stopsig = (sig), (w).w_coredump = 0, (w).w_termsig = 0177)
-#endif
diff --git a/gdb/vx-share/xdr_ld.c b/gdb/vx-share/xdr_ld.c
deleted file mode 100644
index 4935c34..0000000
--- a/gdb/vx-share/xdr_ld.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* xdr_ld.c - xdr routines for remote dbx interface to VxWorks */
-
-/* Copyright 1984,1985,1986,1987,1988,1989 Wind River Systems, Inc. */
-/*extern char copyright_wind_river[]; static char *copyright=copyright_wind_river;*/
-
-/*
-modification history
---------------------
-01a,05jun90,llk extracted from xdr_dbx.c.
-*/
-
-/*
-DESCRIPTION
-This module contains the eXternal Data Representation (XDR) routines
-for object files that are downloaded to VxWorks. They are used by
-remote debuggers that use RPC (such as dbxWorks and vxGdb).
-*/
-
-#include "vxWorks.h"
-#include "rpc/rpc.h"
-#include "xdr_ld.h"
-
-/* forward declarations */
-
-bool_t xdr_String(); /* xdr routine for argument list */
-
-
-/*******************************************************************************
-*
-* xdr_String - xdr routine for strings.
-*
-* Used by xdr_arg_info to handle the actual argument
-* strings. normally calls xdr_string - but does something
-* reasonable encode of null pointer.
-*/
-
-bool_t xdr_String (xdrs, strp)
- XDR *xdrs;
- char **strp;
-
- {
- if ((*strp == NULL) & (xdrs->x_op == XDR_ENCODE))
- return(FALSE);
- else
- return(xdr_string(xdrs, strp, MAXSTRLEN));
- }
-/*******************************************************************************
-*
-* xdr_ldfile - xdr routine for a single element in the load table
-*/
-
-bool_t xdr_ldfile (xdrs, objp)
- XDR *xdrs;
- ldfile *objp;
-
- {
- if (! xdr_String(xdrs, &objp->name))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->txt_addr))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->data_addr))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->bss_addr))
- return(FALSE);
-
- return(TRUE);
- }
-/*******************************************************************************
-*
-* xdr_ldtabl -
-*
-* xdr routine for a list of files and load addresses loaded into VxWorks.
-*/
-
-bool_t xdr_ldtabl (xdrs,objp)
- XDR *xdrs;
- ldtabl *objp;
-
- {
- return (xdr_array (xdrs, (char *) &objp->tbl_ent, (UINT *) &objp->tbl_size,
- MAXTBLSZ, sizeof(ldfile), xdr_ldfile));
- }
diff --git a/gdb/vx-share/xdr_ld.h b/gdb/vx-share/xdr_ld.h
deleted file mode 100644
index 8021ccf..0000000
--- a/gdb/vx-share/xdr_ld.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* xdr_ld.h - xdr for additional dbxWorks structures */
-
-/*
-modification history
---------------------
-01a,05jun90,llk extracted from xdr_dbx.h.
-*/
-
-#ifndef INCxdrldh
-#define INCxdrldh
-
-#define MAXSTRLEN 256
-#define MAXTBLSZ 100
-
-/*
- * structure used to pass back the information for a single file
- * loaded in VxWorks
- */
-struct ldfile {
- char *name;
- int txt_addr;
- int data_addr;
- int bss_addr;
-};
-typedef struct ldfile ldfile;
-
-/*
- * structure used to return a list of all files loaded over to
- * VxWorks. (VX_STATE_INQ return)
- */
-struct ldtabl {
- u_int tbl_size;
- ldfile *tbl_ent;
-};
-typedef struct ldtabl ldtabl;
-
-
-bool_t xdr_ldfile();
-bool_t xdr_ldtabl();
-
-#endif INCxdrldh
diff --git a/gdb/vx-share/xdr_ptrace.c b/gdb/vx-share/xdr_ptrace.c
deleted file mode 100644
index 08813fc..0000000
--- a/gdb/vx-share/xdr_ptrace.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* xdr_ptrace.c - xdr routines for remote ptrace calls */
-
-/* Copyright 1984,1985,1986,1987,1988,1989 Wind River Systems, Inc. */
-/* extern char copyright_wind_river[]; static char *copyright=copyright_wind_river;*/
-
-/*
-modification history
---------------------
-01a,05jun90,llk extracted from xdr_ptrace.h, version 01c.
-*/
-
-#include <vxWorks.h>
-#include <rpc/rpc.h>
-#include <xdr_ptrace.h>
-
-#define MAX_LEN 32000
-
-/********************************************************************
-*
-* xdr_regs_ptr -
-*
-* xdr routine to get regs* branch of discriminated union ptrace_info
-*
-*/
-
-LOCAL bool_t xdr_regs_ptr(xdrs,objp)
- XDR *xdrs;
- struct regs **objp;
- {
- return (xdr_pointer(xdrs, (char **) objp, sizeof(struct regs), xdr_regs));
- } /* xdr_regs_ptr */
-
-/********************************************************************
-*
-* xdr_fp_status_ptr -
-*
-* xdr routine for fp_status * branch of discrimanated union
-*
-*/
-
-LOCAL bool_t xdr_fp_status_ptr(xdrs,objp)
- XDR *xdrs;
- struct fp_status **objp;
- {
- return(xdr_pointer(xdrs, (char **) objp, sizeof(struct fp_status),
- xdr_fp_status));
- } /* xdr_fp_status_ptr */
-
-#ifndef I80960
-/********************************************************************
-*
-* xdr_fpa_regs_ptr -
-*
-* xdr routine for fpa_regs* branch of ptrace_info
-*
-*/
-
-LOCAL bool_t xdr_fpa_regs_ptr(xdrs,objp)
- XDR *xdrs;
- struct fpa_regs **objp;
- {
- if (! xdr_pointer(xdrs, (char **) objp, sizeof(struct fpa_regs),
- xdr_fpa_regs))
- return(FALSE);
- else
- return(TRUE);
- } /* xdr_fpa_regs_ptr */
-#endif
-
-/********************************************************************
-*
-* xdr_c_bytes_ptr -
-*
-* xdr routine for counted bytes branch of ptrace_info
-*
-*/
-
-LOCAL bool_t xdr_c_bytes_ptr(xdrs,objp)
- XDR *xdrs;
- C_bytes **objp;
- {
- return(xdr_pointer(xdrs, (char **) objp, sizeof(C_bytes), xdr_c_bytes));
- } /* xdr_c_bytes_ptr */
-
-/********************************************************************
-*
-* xdr_ptrace_info -
-*
-* xdr routine for discriminated union ptrace_info
-*
-*/
-
-bool_t xdr_ptrace_info(xdrs,objp)
- XDR *xdrs;
- Ptrace_info *objp;
- {
- static struct xdr_discrim choices[] =
- {
- { (int) REGS, xdr_regs_ptr },
- { (int) FPREGS, xdr_fp_status_ptr },
-#ifndef I80960
- { (int) FPAREGS, xdr_fpa_regs_ptr },
-#endif
- { (int) DATA, xdr_c_bytes_ptr },
- { __dontcare__, NULL }
- };
-
- return(xdr_union(xdrs, (enum_t *) &objp->ttype,
- (char *) &objp->more_data, choices, xdr_void));
- } /* xdr_ptrace_info */
-
-/********************************************************************
-*
-* xdr_rptrace -
-*
-* xdr routine for remote ptrace data into server
-*
-*/
-
-bool_t xdr_rptrace(xdrs,objp)
- XDR *xdrs;
- Rptrace *objp;
- {
- if (! xdr_int(xdrs, &objp->pid))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->data))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->addr))
- return(FALSE);
- if (! xdr_ptrace_info(xdrs, &objp->info))
- return(FALSE);
-
- return(TRUE);
- } /* xdr_rptrace */
-
-/********************************************************************
-*
-* xdr_ptrace_return -
-*
-* xdr routine for remote ptrace data returned by server
-*
-*/
-
-bool_t xdr_ptrace_return(xdrs, objp)
- XDR *xdrs;
- Ptrace_return *objp;
- {
- if (! xdr_int(xdrs, &objp->status))
- return(FALSE);
- if (! xdr_int(xdrs, &objp->errno))
- return(FALSE);
- if (! xdr_ptrace_info(xdrs, &objp->info))
- return(FALSE);
-
- return(TRUE);
- } /* xdr_ptrace_return */
-
-/********************************************************************
-*
-* xdr_c_bytes -
-*
-* xdr routine for counted bytes
-*
-*/
-bool_t xdr_c_bytes(xdrs,objp)
- XDR *xdrs;
- C_bytes *objp;
- {
- return(xdr_bytes(xdrs, &objp->bytes, (u_int *) &objp->len, MAX_LEN));
- } /* xdr_c_bytes */
-
diff --git a/gdb/vx-share/xdr_ptrace.h b/gdb/vx-share/xdr_ptrace.h
deleted file mode 100644
index 1fe7ab4..0000000
--- a/gdb/vx-share/xdr_ptrace.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* xdr_ptrace.h - xdr header for remote ptrace structures */
-
-/*
-modification history
---------------------
-01a,05jun90,llk extracted from xdr_ptrace.h.
-*/
-
-
-#include "xdr_regs.h"
-#include "reg.h"
-
-/*
- * Counted byte structure used by READ/WRITE TEXT/DATA
- */
-struct c_bytes {
- u_int len;
- caddr_t bytes;
-};
-typedef struct c_bytes C_bytes;
-
-/*
- * enum for discriminated union ptrace_info
- */
-enum ptype {
- NOINFO = 0, /* no additional infomation */
- REGS = 1, /* regs (SETREGS) */
- FPREGS = 2, /* fp_status (SETFPREGS) */
- FPAREGS = 3, /* fpa_regs (SETFPAREGS) */
- DATA = 4, /* c_bytes (WRITETEXT/DATA)*/
-};
-typedef enum ptype ptype;
-
-/*
- * discrimnated union for passing additional data to be
- * written to the debugged process. With the exception of
- * c_bytes, the structures are defined in <machine/reg.h>
- */
-struct ptrace_info {
- ptype ttype;
- caddr_t more_data;
-};
-typedef struct ptrace_info Ptrace_info;
-
-/*
- * structure passed to server on all remote ptrace calls
- */
-struct rptrace {
- int pid;
- int data;
- int addr; /* FIX! this really should be caddr_t or something */
- Ptrace_info info;
-};
-typedef struct rptrace Rptrace;
-/*
- * structure returned by server on all remote ptrace calls
- */
-struct ptrace_return {
- int status;
- int errno;
- Ptrace_info info;
-};
-typedef struct ptrace_return Ptrace_return;
-
-bool_t xdr_c_bytes();
-bool_t xdr_ptrace_info();
-bool_t xdr_rptrace();
-bool_t xdr_ptrace_return();
diff --git a/gdb/vx-share/xdr_rdb.c b/gdb/vx-share/xdr_rdb.c
deleted file mode 100644
index 3c70fbf..0000000
--- a/gdb/vx-share/xdr_rdb.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* xdr_rdb.c - xdr routines for Remote Debug interface to VxWorks */
-
-/*
-modification history
---------------------
-01a,21mar90,llk created using modification 01d of xdr_dbx.c.
-*/
-
-/*
-DESCRIPTION
-This module contains the eXternal Data Representation (XDR) routines
-for the RDB interface for VxWorks.
-*/
-
-#include "vxWorks.h"
-#include <rpc/rpc.h>
-#include "xdr_rdb.h"
-
-/* forward declarations */
-
-bool_t
-xdr_arg_type(xdrs, objp)
- XDR *xdrs;
- arg_type *objp;
-{
- if (!xdr_enum(xdrs, (enum_t *)objp)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-bool_t
-xdr_arg_value(xdrs, objp)
- XDR *xdrs;
- arg_value *objp;
-{
- if (!xdr_arg_type(xdrs, &objp->type)) {
- return (FALSE);
- }
- switch (objp->type) {
- case T_BYTE:
- if (!xdr_char(xdrs, &objp->arg_value_u.v_byte)) {
- return (FALSE);
- }
- break;
- case T_WORD:
- if (!xdr_short(xdrs, &objp->arg_value_u.v_word)) {
- return (FALSE);
- }
- break;
- case T_INT:
- if (!xdr_int(xdrs, &objp->arg_value_u.v_int)) {
- return (FALSE);
- }
- break;
- case T_FLOAT:
- if (!xdr_float(xdrs, &objp->arg_value_u.v_fp)) {
- return (FALSE);
- }
- break;
- case T_DOUBLE:
- if (!xdr_double(xdrs, &objp->arg_value_u.v_dp)) {
- return (FALSE);
- }
- break;
- case T_UNKNOWN:
- break;
- }
- return (TRUE);
-}
-
-bool_t
-xdr_func_call(xdrs, objp)
- XDR *xdrs;
- func_call *objp;
-{
- if (!xdr_int(xdrs, &objp->func_addr)) {
- return (FALSE);
- }
- if (!xdr_array(xdrs, (char **)&objp->args.args_val, (u_int *)&objp->args.args_len, MAX_FUNC_ARGS, sizeof(arg_value), xdr_arg_value)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-bool_t
-xdr_arg_one(xdrs, objp)
- XDR *xdrs;
- arg_one *objp;
-{
- if (!xdr_string(xdrs, objp, MAX_ARG_LEN)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-
-
-
-bool_t
-xdr_arg_array(xdrs, objp)
- XDR *xdrs;
- arg_array *objp;
-{
- if (!xdr_array(xdrs, (char **)&objp->arg_array_val, (u_int *)&objp->arg_array_len, MAX_ARG_CNT, sizeof(arg_one), xdr_arg_one)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-/*********************************************************************
-*
-* xdr_EVENT_TYPE -
-*
-*/
-
-bool_t xdr_EVENT_TYPE(xdrs, objp)
- XDR *xdrs;
- EVENT_TYPE *objp;
-
- {
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return (FALSE);
- return (TRUE);
- }
-
-/*********************************************************************
-*
-* xdr_RDB_EVENT -
-*
-*/
-
-bool_t xdr_RDB_EVENT (xdrs, objp)
- XDR *xdrs;
- RDB_EVENT *objp;
-
- {
- if (!xdr_int (xdrs, &objp->status))
- return (FALSE);
- if (!xdr_int (xdrs, &objp->taskId))
- return (FALSE);
- if (!xdr_EVENT_TYPE (xdrs, &objp->eventType))
- return (FALSE);
- if (!xdr_int (xdrs, &objp->sigType))
- return (FALSE);
- return (TRUE);
- }
-
-/*********************************************************************
-*
-* xdr_TASK_START -
-*
-*/
-
-bool_t
-xdr_TASK_START (xdrs, objp)
- XDR *xdrs;
- TASK_START *objp;
-
- {
- if (!xdr_int (xdrs, &objp->status))
- return (FALSE);
- if (!xdr_int (xdrs, &objp->pid))
- return (FALSE);
- return (TRUE);
- }
-
-
-/*********************************************************************
-*
-* xdr_SYMBOL_ADDR -
-*
-*/
-
-bool_t
-xdr_SYMBOL_ADDR (xdrs, objp)
- XDR *xdrs;
- SYMBOL_ADDR *objp;
-
- {
- if (!xdr_int (xdrs, &objp->status))
- return (FALSE);
- if (!xdr_u_int (xdrs, &objp->addr))
- return (FALSE);
- return (TRUE);
- }
-
-/*********************************************************************
-*
-* xdr_SOURCE_STEP -
-*
-*/
-
-bool_t
-xdr_SOURCE_STEP (xdrs, objp)
- XDR *xdrs;
- SOURCE_STEP *objp;
-
- {
- if (!xdr_int (xdrs, &objp->taskId))
- return (FALSE);
- if (!xdr_u_int (xdrs, &objp->startAddr))
- return (FALSE);
- if (!xdr_u_int (xdrs, &objp->endAddr))
- return (FALSE);
- return (TRUE);
- }
diff --git a/gdb/vx-share/xdr_rdb.h b/gdb/vx-share/xdr_rdb.h
deleted file mode 100644
index eebec43..0000000
--- a/gdb/vx-share/xdr_rdb.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* xdr_rdb.h - xdr for additional rdb structures */
-
-/*
-modification history
---------------------
-01a,23may90,llk created using xdr_dbx.h.
- added arg_array to replace arg_info. arg_info had
- MAXNCMDARGS (= 100) as the max limit of char strings,
- but it should be MAX_TASK_ARGS (= 10).
-*/
-
-#ifndef INCxdrrdbh
-#define INCxdrrdbh
-
-enum arg_type {
- T_UNKNOWN = 0,
- T_BYTE = 1,
- T_WORD = 2,
- T_INT = 3,
- T_FLOAT = 4,
- T_DOUBLE = 5,
-};
-typedef enum arg_type arg_type;
-bool_t xdr_arg_type();
-
-
-struct arg_value {
- arg_type type;
- union {
- char v_byte;
- short v_word;
- int v_int;
- float v_fp;
- double v_dp;
- } arg_value_u;
-};
-typedef struct arg_value arg_value;
-bool_t xdr_arg_value();
-
-struct func_call {
- int func_addr;
- struct {
- u_int args_len;
- arg_value *args_val;
- } args;
-};
-typedef struct func_call func_call;
-bool_t xdr_func_call();
-
-
-typedef char *arg_one;
-bool_t xdr_arg_one();
-
-
-typedef struct {
- u_int arg_array_len;
- arg_one *arg_array_val;
-} arg_array;
-bool_t xdr_arg_array();
-
-
-/*
- * Structures used to pass structures required for
- * process control but not part of the standard ptrace interface
- */
-
-/*
- * arg_info is used to pass arguments into process start
- */
-struct arg_info {
- int rargc;
- char **rargv;
-};
-typedef struct arg_info Arg_info;
-
-
-enum EVENT_TYPE {
- EVENT_BREAK = 0,
- EVENT_STOP = 1,
- EVENT_EXIT = 2,
- EVENT_BUS_ERR = 3,
- EVENT_SUSPEND = 4,
- EVENT_ZERO_DIV = 5,
- EVENT_SIGNAL = 6,
- EVENT_START = 7,
-};
-typedef enum EVENT_TYPE EVENT_TYPE;
-
-
-struct RDB_EVENT {
- int status;
- int taskId;
- EVENT_TYPE eventType;
- int sigType;
-};
-typedef struct RDB_EVENT RDB_EVENT;
-
-
-struct TASK_START {
- int status;
- int pid;
-};
-typedef struct TASK_START TASK_START;
-
-
-struct SYMBOL_ADDR {
- int status;
- u_int addr;
-};
-typedef struct SYMBOL_ADDR SYMBOL_ADDR;
-
-struct SOURCE_STEP {
- int taskId;
- u_int startAddr;
- u_int endAddr;
-};
-typedef struct SOURCE_STEP SOURCE_STEP;
-
-#define MAX_ARG_CNT 10
-#define MAX_FUNC_ARGS 100
-#define MAX_ARG_LEN 100
-
-bool_t xdr_arg_info();
-bool_t xdr_EVENT_TYPE();
-bool_t xdr_RDB_EVENT();
-bool_t xdr_TASK_START();
-bool_t xdr_SYMBOL_ADDR();
-bool_t xdr_SOURCE_STEP();
-
-#define RDBPROG (u_long) 0x44444444
-#define RDBVERS (u_long) 1
-#endif INCxdrrdbh
diff --git a/gdb/vx-share/xdr_regs.c b/gdb/vx-share/xdr_regs.c
deleted file mode 100644
index 9152423..0000000
--- a/gdb/vx-share/xdr_regs.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/* xdr_regs.c - xdr routines for 68k registers */
-
-/* Copyright 1984,1985,1986,1987,1988,1989 Wind River Systems, Inc. */
-
-/*
-DESCRIPTION
-This module contains the eXternal Data Representation (XDR) routines
-for the GDB interface for VxWorks.
-*/
-
-#include <vxWorks.h>
-#include <rpc/rpc.h>
-#include <reg.h>
-#include <xdr_regs.h>
-
-
-#ifdef I80960
-/*******************************************************************************
-*
-* xdr_regs - xdr routine for i960 registers
-*/
-
-bool_t xdr_regs (xdrs, objp)
- XDR *xdrs;
- struct regs *objp;
-
- {
- if (! xdr_opaque(xdrs, (char *) objp->r_lreg, 16 * sizeof(int)))
- return(FALSE);
- if (! xdr_opaque(xdrs, (char *) objp->r_greg, 16 * sizeof(int)))
- return(FALSE);
- if (! xdr_opaque(xdrs, (char *) &objp->r_pcw, sizeof(int)))
- return(FALSE);
- if (! xdr_opaque(xdrs, (char *) &objp->r_acw, sizeof(int)))
- return(FALSE);
- if (! xdr_opaque(xdrs, (char *) &objp->r_tcw, sizeof(int)))
- return(FALSE);
-
- return(TRUE);
- }
-
-/*******************************************************************************
-*
-* xdr_fp_status - xdr routine for i960 floating point registers
-*/
-
-bool_t xdr_fp_status (xdrs, objp)
- XDR *xdrs;
- struct fp_status *objp;
-
- {
- unsigned int size = 4 * FP_REG_SIZE;
-
- /* We use xdr_bytes to indicate how many bytes of FP regs there are! */
- if (! xdr_bytes (xdrs, (char *) objp->fps_regs, &size, 4 * FP_REG_SIZE))
- return (FALSE);
- return (TRUE);
- }
-
-/*******************************************************************************
-*
-* xdr_ext_fp - xdr for a single fp register
-*/
-
-bool_t xdr_ext_fp (xdrs, objp)
- XDR *xdrs;
- char *objp;
-
- {
- unsigned int size = FP_REG_SIZE;
-
- if (! xdr_bytes (xdrs, objp, &size, FP_REG_SIZE))
- return(FALSE);
-
- return(TRUE);
- }
-#else /* Must be 68K if it isn't i960 -- for now. FIXME! */
-
-/*******************************************************************************
-*
-* xdr_regs - xdr routine for 68k registers
-*/
-
-bool_t xdr_regs (xdrs, objp)
- XDR *xdrs;
- struct regs *objp;
-
- {
- if (! xdr_opaque(xdrs, (char *) objp->r_dreg, 8 * sizeof(int)))
- return(FALSE);
- if (! xdr_opaque(xdrs, (char *) objp->r_areg, 8 * sizeof(int)))
- return(FALSE);
- if (! xdr_opaque(xdrs, (char *) &objp->r_sr, sizeof(int)))
- return(FALSE);
- if (! xdr_opaque(xdrs, (char *) &objp->r_pc, sizeof(int)))
- return(FALSE);
-
- return(TRUE);
- }
-
-/*******************************************************************************
-*
-* xdr_ext_fp - xdr for a single fp register
-*/
-
-bool_t xdr_ext_fp (xdrs, objp)
- XDR *xdrs;
- ext_fp *objp;
-
- {
- if (! xdr_vector(xdrs, (char *) objp->fp, 3, sizeof(int), xdr_int))
- return(FALSE);
-
- return(TRUE);
- }
-/*******************************************************************************
-*
-* xdr_fp_status - xdr routine for floating point registers
-*/
-
-bool_t xdr_fp_status (xdrs, objp)
- XDR *xdrs;
- struct fp_status *objp;
-
- {
- if (! xdr_vector (xdrs, (char *) objp->fps_regs, 8,
- sizeof(ext_fp), xdr_ext_fp))
- return (FALSE);
- if (! xdr_int (xdrs, &objp->fps_control))
- return (FALSE);
- if (! xdr_int (xdrs, &objp->fps_status))
- return (FALSE);
- if (! xdr_int (xdrs, &objp->fps_iaddr))
- return (FALSE);
- if (! xdr_int (xdrs, &objp->fps_code))
- return (FALSE);
- if (! xdr_int (xdrs, &objp->fps_flags))
- return (FALSE);
-
- return (TRUE);
- }
-/*******************************************************************************
-*
-* xdr_fpa_status - xdr for fpa status
-*/
-
-bool_t xdr_fpa_status (xdrs, objp)
- XDR *xdrs;
- struct fpa_status *objp;
-
- {
- if (! xdr_u_int (xdrs, &objp->fpas_state))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_imask))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_load_ptr))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_ierr))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_act_instr))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_nxt_instr))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_act_d1half))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_act_d2half))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_nxt_d1half))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_nxt_d2half))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_mode3_0))
- return (FALSE);
- if (! xdr_u_int (xdrs, &objp->fpas_wstatus))
- return (FALSE);
-
- return (TRUE);
- }
-/*******************************************************************************
-*
-* xdr_fpa_long - xdr for fpa data register
-*/
-
-bool_t xdr_fpa_long (xdrs,objp)
- XDR *xdrs;
- fpa_long *objp;
-
- {
- if (! xdr_vector (xdrs, (char *) objp->fpl_data, 2, sizeof(int), xdr_int))
- return (FALSE);
-
- return (TRUE);
- }
-/*******************************************************************************
-*
-* xdr_fpa_regs - xdr for fpa_regs
-*/
-
-bool_t xdr_fpa_regs (xdrs, objp)
- XDR *xdrs;
- struct fpa_regs *objp;
-
- {
- if (! xdr_u_int (xdrs, &objp->fpar_flags))
- return (FALSE);
- if (! xdr_fpa_status (xdrs, &objp->fpar_status))
- return (FALSE);
- if (! xdr_vector (xdrs, (char *) objp->fpar_data,
- FPA_NDATA_REGS, sizeof(fpa_long), xdr_fpa_long))
- return (FALSE);
-
- return (TRUE);
- }
-
-#endif /* I80960 */
-
diff --git a/gdb/vx-share/xdr_regs.h b/gdb/vx-share/xdr_regs.h
deleted file mode 100644
index c829d64..0000000
--- a/gdb/vx-share/xdr_regs.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* xdr_regs.h - xdr header for 68k registers */
-
-/*
-modification history
---------------------
-01a,05jun90,llk extracted from xdr_regs.h.
-*/
-
-/* xdr structures are defined in reg.h (a bad place for them, i might add) */
-
-bool_t xdr_regs();
-bool_t xdr_ext_fp();
-bool_t xdr_fp_status();
-bool_t xdr_fpa_status();
-bool_t xdr_fpa_long();
-bool_t xdr_fpa_regs();
diff --git a/gdb/xcoffexec.c b/gdb/xcoffexec.c
deleted file mode 100644
index f1bd3d8..0000000
--- a/gdb/xcoffexec.c
+++ /dev/null
@@ -1,932 +0,0 @@
-/* Execute AIXcoff files, for GDB.
- Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
- Derived from exec.c. Modified by IBM Corporation.
- Donated by IBM Corporation and Cygnus Support.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* xcoff-exec - deal with executing XCOFF files. */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <fcntl.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/ldr.h>
-
-#include "defs.h"
-#include "param.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
-#include "symfile.h"
-
-#include "libbfd.h" /* BFD internals (sigh!) FIXME */
-
-struct section_table *exec_sections, *exec_sections_end;
-
-#define eq(s0, s1) !strcmp(s0, s1)
-
-/* Whether to open exec and core files read-only or read-write. */
-
-int write_files = 0;
-
-bfd *exec_bfd; /* needed by core.c */
-
-extern char *getenv();
-extern void child_create_inferior (), child_attach ();
-extern void add_syms_addr_command ();
-extern void symbol_file_command ();
-static void exec_files_info();
-
-/*
- * the vmap struct is used to describe the virtual address space of
- * the target we are manipulating. The first entry is always the "exec"
- * file. Subsequent entries correspond to other objects that are
- * mapped into the address space of a process created from the "exec" file.
- * These are either in response to exec()ing the file, in which case all
- * shared libraries are loaded, or a "load" system call, followed by the
- * user's issuance of a "load" command.
- */
-struct vmap {
- struct vmap *nxt; /* ^ to next in chain */
- bfd *bfd; /* BFD for mappable object library */
- char *name; /* ^ to object file name */
- char *member; /* ^ to member name */
- CORE_ADDR tstart; /* virtual addr where member is mapped */
- CORE_ADDR tend; /* virtual upper bound of member */
- CORE_ADDR tadj; /* heuristically derived adjustment */
- CORE_ADDR dstart; /* virtual address of data start */
- CORE_ADDR dend; /* vitrual address of data end */
-};
-
-
-struct vmap_and_bfd {
- bfd *pbfd;
- struct vmap *pvmap;
-};
-
-static struct vmap *vmap; /* current vmap */
-
-extern struct target_ops exec_ops;
-
-
-/* exec_close - done with exec file, clean up all resources. */
-
-void
-exec_close(quitting) {
- register struct vmap *vp, *nxt;
-
- for (nxt = vmap; vp = nxt; ) {
- nxt = vp->nxt;
- bfd_close(vp->bfd);
- free_named_symtabs(vp->name, vp->member); /* XXX */
- free(vp);
- }
-
- vmap = 0;
- exec_bfd = 0;
-}
-
-/*
- * exec_file_command - handle the "exec" command, &c.
- */
-void
-exec_file_command(filename, from_tty)
-char *filename;
-{
- bfd *bfd;
-
- target_preopen(from_tty);
- unpush_target(&exec_ops);
-
- /* Now open and digest the file the user requested, if any. */
-
- if (filename) {
- char *scratch_pathname;
- int scratch_chan;
-
- filename = tilde_expand(filename);
- make_cleanup(free, filename);
-
- scratch_chan = openp(getenv("PATH"), 1, filename, O_RDONLY, 0
- , &scratch_pathname);
- if (scratch_chan < 0)
- perror_with_name(filename);
-
- bfd = bfd_fdopenr(scratch_pathname, NULL, scratch_chan);
- if (!bfd)
- error("Could not open `%s' as an executable file: %s"
- , scratch_pathname, bfd_errmsg(bfd_error));
-
- /* make sure we have an object file */
-
- if (!bfd_check_format(bfd, bfd_object))
- error("\"%s\": not in executable format: %s."
- , scratch_pathname, bfd_errmsg(bfd_error));
-
-
- /* setup initial vmap */
-
- map_vmap (bfd, 0);
- if (!vmap)
- error("Can't find the file sections in `%s': %s"
- , bfd->filename, bfd_errmsg(bfd_error));
-
- exec_bfd = bfd;
-
- if (build_section_table (exec_bfd, &exec_sections, &exec_sections_end))
- error ("Can't find the file sections in `%s': %s",
- exec_bfd->filename, bfd_errmsg (bfd_error));
-
- /* make sure core, if present, matches */
- validate_files();
-
- push_target(&exec_ops);
-
- /* Tell display code(if any) about the changed file name. */
-
- if (exec_file_display_hook)
- (*exec_file_display_hook)(filename);
- }
- else {
- exec_close(0); /* just in case */
- if (from_tty)
- printf("No exec file now.\n");
- }
-}
-
-/* Set both the exec file and the symbol file, in one command. What a
- * novelty. Why did GDB go through four major releases before this
- * command was added?
- */
-void
-file_command(arg, from_tty)
-char *arg; {
-
- exec_file_command(arg, from_tty);
- symbol_file_command(arg, from_tty);
-}
-
-/* Locate all mappable sections of a BFD file.
- table_pp_char is a char * to get it through bfd_map_over_sections;
- we cast it back to its proper type. */
-
-void
-add_to_section_table (abfd, asect, table_pp_char)
- bfd *abfd;
- sec_ptr asect;
- char *table_pp_char;
-{
- struct section_table **table_pp = (struct section_table **)table_pp_char;
- flagword aflag;
-
- aflag = bfd_get_section_flags (abfd, asect);
- /* FIXME, we need to handle BSS segment here...it alloc's but doesn't load */
- if (!(aflag & SEC_LOAD))
- return;
- (*table_pp)->sec_ptr = asect;
- (*table_pp)->addr = bfd_section_vma (abfd, asect);
- (*table_pp)->endaddr = (*table_pp)->addr + bfd_section_size (abfd, asect);
- (*table_pp)++;
-}
-
-int
-build_section_table (some_bfd, start, end)
- bfd *some_bfd;
- struct section_table **start, **end;
-{
- unsigned count;
-
- count = bfd_count_sections (some_bfd);
- if (count == 0)
- abort(); /* return 1? */
- if (*start)
- free (*start);
- *start = (struct section_table *) xmalloc (count * sizeof (**start));
- *end = *start;
- bfd_map_over_sections (some_bfd, add_to_section_table, (char *)end);
- if (*end > *start + count)
- abort();
- /* We could realloc the table, but it probably loses for most files. */
- return 0;
-}
-
-/*
- * lookup_symtab_bfd - find if we currently have any symbol tables from bfd
- */
-struct objfile *
-lookup_objfile_bfd(bfd *bfd) {
- register struct objfile *s;
-
- for (s = object_files; s; s = s->next)
- if (s->obfd == bfd)
- return s;
- return 0;
-}
-
-
-void
-sex_to_vmap(bfd *bf, sec_ptr sex, struct vmap_and_bfd *vmap_bfd)
-{
- register struct vmap *vp, **vpp;
- register struct symtab *syms;
- bfd *arch = vmap_bfd->pbfd;
- vp = vmap_bfd->pvmap;
-
- if ((bfd_get_section_flags(bf, sex) & SEC_LOAD) == 0)
- return;
-
- if (!strcmp(bfd_section_name(bf, sex), ".text")) {
- vp->tstart = 0;
- vp->tend = vp->tstart + bfd_section_size(bf, sex);
-
- /* This is quite a tacky way to recognize the `exec' load segment (rather
- than shared libraries. You should use `arch' instead. FIXMEmgo */
- if (!vmap)
- vp->tadj = sex->filepos - bfd_section_vma(bf, sex);
- else
- vp->tadj = 0;
- }
-
- else if (!strcmp(bfd_section_name(bf, sex), ".data")) {
- vp->dstart = 0;
- vp->dend = vp->dstart + bfd_section_size(bf, sex);
- }
-
- else if (!strcmp(bfd_section_name(bf, sex), ".bss")) /* FIXMEmgo */
- printf ("bss section in exec! Don't know what the heck to do!\n");
-}
-
-/* Make a vmap for the BFD "bf", which might be a member of the archive
- BFD "arch". If we have not yet read in symbols for this file, do so. */
-
-map_vmap (bfd *bf, bfd *arch)
-{
- struct vmap_and_bfd vmap_bfd;
- struct vmap *vp, **vpp;
- struct objfile *obj;
- char *name;
-
- vp = (void*) xmalloc (sizeof (*vp));
- vp->nxt = 0;
- vp->bfd = bf;
- vp->name = bfd_get_filename(arch ? arch : bf);
- vp->member = arch ? bfd_get_filename(bf) : "";
-
- vmap_bfd.pbfd = arch;
- vmap_bfd.pvmap = vp;
- bfd_map_over_sections (bf, sex_to_vmap, &vmap_bfd);
-
- obj = lookup_objfile_bfd (bf);
- if (exec_bfd && !obj) {
- name = savestring (bfd_get_filename (bf), strlen (bfd_get_filename (bf)));
- obj = allocate_objfile (bf, name);
- syms_from_objfile (obj, 0, 0);
- }
-
- /* find the end of the list, and append. */
- for (vpp = &vmap; *vpp; vpp = &(*vpp)->nxt)
- ;
- *vpp = vp;
-}
-
-
-/* true, if symbol table and misc_function_vector is relocated. */
-
-int symtab_relocated = 0;
-
-
-/* vmap_symtab - handle symbol translation on vmapping */
-
-vmap_symtab(vp, old_start, vip)
-register struct vmap *vp;
-CORE_ADDR old_start;
-struct stat *vip;
-{
- register struct symtab *s;
-
- /*
- * for each symbol table generated from the vp->bfd
- */
- for (s = symtab_list; s; s = s->next) {
-
- /* skip over if this is not relocatable and doesn't have a line table */
- if (s->nonreloc && !LINETABLE (s))
- continue;
-
- /* matching the symbol table's BFD and the *vp's BFD is hairy.
- exec_file creates a seperate BFD for possibly the
- same file as symbol_file.FIXME ALL THIS MUST BE RECTIFIED. */
-
- if (s->objfile->obfd == vp->bfd) {
- /* if they match, we luck out. */
- ;
- } else if (vp->member[0]) {
- /* no match, and member present, not this one. */
- continue;
- } else {
- struct stat si;
- FILE *io;
-
- /*
- * no match, and no member. need to be sure.
- */
- io = bfd_cache_lookup(s->objfile->obfd);
- if (!io)
- fatal("cannot find BFD's iostream for sym");
- /*
- * see if we are referring to the same file
- */
- if (fstat(fileno(io), &si) < 0)
- fatal("cannot fstat BFD for sym");
-
- if (si.st_dev != vip->st_dev
- || si.st_ino != vip->st_ino)
- continue;
- }
-
- if (vp->tstart != old_start)
- vmap_symtab_1(s, vp, old_start);
- }
-
- if (vp->tstart != old_start)
- fixup_misc_vector (vp->tstart - old_start);
-
- symtab_relocated = 1;
-}
-
-
-fixup_misc_vector (int disp)
-{
- int ii;
- for (ii=0; ii < misc_function_count; ++ii)
- if (misc_function_vector[ii].address < 0x10000000)
- misc_function_vector[ii].address += disp;
-}
-
-
-vmap_symtab_1(s, vp, old_start)
-register struct symtab *s;
-register struct vmap *vp;
-CORE_ADDR old_start;
-{
- register int i, j;
- int len, blen;
- register struct linetable *l;
- struct blockvector *bv;
- register struct block *b;
- int depth;
- register ulong reloc, dreloc;
-
- if ((reloc = vp->tstart - old_start) == 0)
- return;
-
- dreloc = vp->dstart; /* data relocation */
-
- /*
- * The line table must be relocated. This is only present for
- * b.text sections, so only vp->text type maps need be considered.
- */
- l = LINETABLE (s);
- len = l->nitems;
- for (i = 0; i < len; i++)
- l->item[i].pc += reloc;
-
- /* if this symbol table is not relocatable, only line table should
- be relocated and the rest ignored. */
- if (s->nonreloc)
- return;
-
- bv = BLOCKVECTOR(s);
- len = BLOCKVECTOR_NBLOCKS(bv);
-
- for (i = 0; i < len; i++) {
- b = BLOCKVECTOR_BLOCK(bv, i);
-
- BLOCK_START(b) += reloc;
- BLOCK_END(b) += reloc;
-
- blen = BLOCK_NSYMS(b);
- for (j = 0; j < blen; j++) {
- register struct symbol *sym;
-
- sym = BLOCK_SYM(b, j);
- switch (SYMBOL_NAMESPACE(sym)) {
- case STRUCT_NAMESPACE:
- case UNDEF_NAMESPACE:
- continue;
-
- case LABEL_NAMESPACE:
- case VAR_NAMESPACE:
- break;
- }
-
- switch (SYMBOL_CLASS(sym)) {
- case LOC_CONST:
- case LOC_CONST_BYTES:
- case LOC_LOCAL:
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_LOCAL_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_TYPEDEF:
- continue;
-
-#ifdef FIXME
- case LOC_EXTERNAL:
-#endif
- case LOC_LABEL:
- SYMBOL_VALUE_ADDRESS(sym) += reloc;
- break;
-
- case LOC_STATIC:
- SYMBOL_VALUE_ADDRESS(sym) += dreloc;
- break;
-
- case LOC_BLOCK:
- break;
-
- default:
- fatal("botched symbol class %x"
- , SYMBOL_CLASS(sym));
- break;
- }
- }
- }
-}
-
-/*
- * add_vmap - add a new vmap entry based on ldinfo() information
- */
-add_vmap(ldi)
-register struct ld_info *ldi; {
- bfd *bfd, *last;
- register char *mem;
-
- mem = ldi->ldinfo_filename + strlen(ldi->ldinfo_filename) + 1;
- bfd = bfd_fdopenr(ldi->ldinfo_filename, NULL, ldi->ldinfo_fd);
- if (!bfd)
- error("Could not open `%s' as an executable file: %s"
- , ldi->ldinfo_filename, bfd_errmsg(bfd_error));
-
-
- /* make sure we have an object file */
-
- if (bfd_check_format(bfd, bfd_object))
- map_vmap (bfd, 0);
-
- else if (bfd_check_format(bfd, bfd_archive)) {
- last = 0;
- /*
- * FIXME??? am I tossing BFDs? bfd?
- */
- while (last = bfd_openr_next_archived_file(bfd, last))
- if (eq(mem, last->filename))
- break;
-
- if (!last) {
- bfd_close(bfd);
-/* FIXME -- should be error */
- warning("\"%s\": member \"%s\" missing.",
- bfd->filename, mem);
- return;
- }
-
- if (!bfd_check_format(last, bfd_object)) {
- bfd_close(last); /* XXX??? */
- goto obj_err;
- }
-
- map_vmap (last, bfd);
- }
- else {
- obj_err:
- bfd_close(bfd);
-/* FIXME -- should be error */
- warning("\"%s\": not in executable format: %s."
- , ldi->ldinfo_filename, bfd_errmsg(bfd_error));
- return;
- }
-}
-
-
-/* As well as symbol tables, exec_sections need relocation. Otherwise after
- the inferior process terminates, symbol table is relocated but there is
- no inferior process. Thus, we have to use `exec' bfd, rather than the inferior
- process's memory space, when lookipng at symbols.
- `exec_sections' need to be relocated only once though, as long as the exec
- file was not changed.
-*/
-vmap_exec ()
-{
- static bfd *execbfd;
- if (execbfd == exec_bfd)
- return;
-
- execbfd = exec_bfd;
-
- if (!vmap || !exec_sections) {
- printf ("WARNING: vmap not found in vmap_exec()!\n");
- return;
- }
- /* First exec section is `.text', second is `.data'. If this is changed,
- then this routine will choke. Better you should check section names,
- FIXMEmgo. */
- exec_sections [0].addr += vmap->tstart;
- exec_sections [0].endaddr += vmap->tstart;
- exec_sections [1].addr += vmap->dstart;
- exec_sections [1].endaddr += vmap->dstart;
-}
-
-
-int
-text_adjustment (abfd)
-bfd *abfd;
-{
- static bfd *execbfd;
- static int adjustment;
- sec_ptr sect;
-
- if (exec_bfd == execbfd)
- return adjustment;
-
- sect = bfd_get_section_by_name (abfd, ".text");
- if (sect)
- adjustment = sect->filepos - sect->vma;
- else
- adjustment = 0x200; /* just a wild assumption */
-
- return adjustment;
-}
-
-
-/*
- * vmap_ldinfo - update VMAP info with ldinfo() information
- *
- * Input:
- * ldi - ^ to ldinfo() results.
- */
-vmap_ldinfo(ldi)
-register struct ld_info *ldi;
-{
- struct stat ii, vi;
- register struct vmap *vp;
- register got_one, retried;
- CORE_ADDR ostart;
-
- /*
- * for each *ldi, see if we have a corresponding *vp
- * if so, update the mapping, and symbol table.
- * if not, add an entry and symbol table.
- */
- do {
- char *name = ldi->ldinfo_filename;
- char *memb = name + strlen(name) + 1;
-
- retried = 0;
-
- if (fstat(ldi->ldinfo_fd, &ii) < 0)
- fatal("cannot fstat(%d) on %s"
- , ldi->ldinfo_fd
- , name);
-retry:
- for (got_one = 0, vp = vmap; vp; vp = vp->nxt) {
- FILE *io;
-
- /* The filenames are not always sufficient to match on. */
- if ((name[0] == "/"
- && !eq(name, vp->name))
- || (memb[0] && !eq(memb, vp->member)))
- continue;
-
- /* totally opaque! */
- io = bfd_cache_lookup(vp->bfd);
- if (!io)
- fatal("cannot find BFD's iostream for %s"
- , vp->name);
-
- /* see if we are referring to the same file */
- if (fstat(fileno(io), &vi) < 0)
- fatal("cannot fstat BFD for %s", vp->name);
-
- if (ii.st_dev != vi.st_dev || ii.st_ino != vi.st_ino)
- continue;
-
- if (!retried)
- close(ldi->ldinfo_fd);
-
- ++got_one;
-
- /* found a corresponding VMAP. remap! */
- ostart = vp->tstart;
-
- vp->tstart = ldi->ldinfo_textorg;
- vp->tend = vp->tstart + ldi->ldinfo_textsize;
- vp->dstart = ldi->ldinfo_dataorg;
- vp->dend = vp->dstart + ldi->ldinfo_datasize;
-
- if (vp->tadj) {
- vp->tstart += vp->tadj;
- vp->tend += vp->tadj;
- }
-
- /* relocate symbol table(s). */
- vmap_symtab(vp, ostart, &vi);
-
- /* there may be more, so we don't break out of the loop. */
- }
-
- /*
- * if there was no matching *vp, we must perforce create
- * the sucker(s)
- */
- if (!got_one && !retried) {
- add_vmap(ldi);
- ++retried;
- goto retry;
- }
- } while (ldi->ldinfo_next
- && (ldi = (void *) (ldi->ldinfo_next + (char *) ldi)));
-
- breakpoint_re_set();
-}
-
-/*
- * vmap_inferior - print VMAP info for inferior
- */
-vmap_inferior() {
-
- if (inferior_pid == 0)
- return 0; /* normal processing */
-
- exec_files_info();
-
- return 1;
-}
-
-/* Read or write the exec file.
-
- Args are address within exec file, address within gdb address-space,
- length, and a flag indicating whether to read or write.
-
- Result is a length:
-
- 0: We cannot handle this address and length.
- > 0: We have handled N bytes starting at this address.
- (If N == length, we did it all.) We might be able
- to handle more bytes beyond this length, but no
- promises.
- < 0: We cannot handle this address, but if somebody
- else handles (-N) bytes, we can start from there.
-
- The same routine is used to handle both core and exec files;
- we just tail-call it with more arguments to select between them. */
-
-int
-xfer_memory (memaddr, myaddr, len, write, abfd, sections, sections_end)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
- bfd *abfd;
- struct section_table *sections, *sections_end;
-{
- boolean res;
- struct section_table *p;
- CORE_ADDR nextsectaddr, memend;
- boolean (*xfer_fn) ();
-
- if (len <= 0)
- abort();
-
- memend = memaddr + len;
- xfer_fn = write? bfd_set_section_contents: bfd_get_section_contents;
- nextsectaddr = memend;
-
- for (p = sections; p < sections_end; p++)
- {
- if (p->addr <= memaddr)
- if (p->endaddr >= memend)
- {
- /* Entire transfer is within this section. */
- res = xfer_fn (abfd, p->sec_ptr, myaddr, memaddr - p->addr, len);
- return (res != false)? len: 0;
- }
- else if (p->endaddr <= memaddr)
- {
- /* This section ends before the transfer starts. */
- continue;
- }
- else
- {
- /* This section overlaps the transfer. Just do half. */
- len = p->endaddr - memaddr;
- res = xfer_fn (abfd, p->sec_ptr, myaddr, memaddr - p->addr, len);
- return (res != false)? len: 0;
- }
- else if (p->addr < nextsectaddr)
- nextsectaddr = p->addr;
- }
-
- if (nextsectaddr >= memend)
- return 0; /* We can't help */
- else
- return - (nextsectaddr - memaddr); /* Next boundary where we can help */
-}
-
-/* The function called by target_xfer_memory via our target_ops */
-
-int
-exec_xfer_memory (memaddr, myaddr, len, write)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
-{
- return xfer_memory (memaddr, myaddr, len, write,
- exec_bfd, exec_sections, exec_sections_end);
-}
-
-/*
- * exec_files_info - "info files" command processor
- */
-static void
-exec_files_info() {
- register struct vmap *vp = vmap;
-
- if (!vp)
- return;
-
- printf("\tMapping info for file `%s'.\n", vp->name);
- printf("\t %8.8s %8.8s %8.8s %s\n"
- , "start", "end", "section", "file(member)");
-
- for (; vp; vp = vp->nxt)
- printf("\t0x%8.8x 0x%8.8x %s%s%s%s\n"
- , vp->tstart
- , vp->tend
- , vp->name
- , *vp->member ? "(" : ""
- , vp->member
- , *vp->member ? ")" : "");
-}
-
-#ifdef DAMON
- Damon's implementation of set_section_command! It is based on the sex member
- (which is a section pointer from vmap) of vmap.
- We will not have multiple vmap entries (one for each section), rather transmit
- text and data base offsets and fix them at the same time. Elimination of sex
- entry in vmap make this function obsolute, use the one from exec.c.
- Need further testing!! FIXMEmgo.
-
-static void
-set_section_command(args, from_tty)
-char *args;
-{
- register struct vmap *vp = vmap;
- char *secname;
- unsigned seclen;
- unsigned long secaddr;
- char secprint[100];
- long offset;
-
- if (args == 0)
- error("Must specify section name and its virtual address");
-
- /* Parse out section name */
- for (secname = args; !isspace(*args); args++)
- ;
- seclen = args - secname;
-
- /* Parse out new virtual address */
- secaddr = parse_and_eval_address(args);
-
- for (vp = vmap; vp; vp = vp->nxt) {
- if (!strncmp(secname
- , bfd_section_name(vp->bfd, vp->sex), seclen)
- && bfd_section_name(vp->bfd, vp->sex)[seclen] == '\0') {
- offset = secaddr - vp->tstart;
- vp->tstart += offset;
- vp->tend += offset;
- exec_files_info();
- return;
- }
- }
-
- if (seclen >= sizeof(secprint))
- seclen = sizeof(secprint) - 1;
- strncpy(secprint, secname, seclen);
- secprint[seclen] = '\0';
- error("Section %s not found", secprint);
-}
-#else
-static void
-set_section_command (args, from_tty)
- char *args;
- int from_tty;
-{
- struct section_table *p;
- char *secname;
- unsigned seclen;
- unsigned long secaddr;
- char secprint[100];
- long offset;
-
- if (args == 0)
- error ("Must specify section name and its virtual address");
-
- /* Parse out section name */
- for (secname = args; !isspace(*args); args++) ;
- seclen = args - secname;
-
- /* Parse out new virtual address */
- secaddr = parse_and_eval_address (args);
-
- for (p = exec_sections; p < exec_sections_end; p++) {
- if (!strncmp (secname, bfd_section_name (exec_bfd, p->sec_ptr), seclen)
- && bfd_section_name (exec_bfd, p->sec_ptr)[seclen] == '\0') {
- offset = secaddr - p->addr;
- p->addr += offset;
- p->endaddr += offset;
- exec_files_info();
- return;
- }
- }
- if (seclen >= sizeof (secprint))
- seclen = sizeof (secprint) - 1;
- strncpy (secprint, secname, seclen);
- secprint[seclen] = '\0';
- error ("Section %s not found", secprint);
-}
-
-#endif /* !DAMON */
-
-struct target_ops exec_ops = {
- "exec", "Local exec file",
- "Use an executable file as a target.\n\
-Specify the filename of the executable file.",
- exec_file_command, exec_close, /* open, close */
- child_attach, 0, 0, 0, /* attach, detach, resume, wait, */
- 0, 0, /* fetch_registers, store_registers, */
- 0, 0, 0, /* prepare_to_store, conv_to, conv_from, */
- exec_xfer_memory, exec_files_info,
- 0, 0, /* insert_breakpoint, remove_breakpoint, */
- 0, 0, 0, 0, 0, /* terminal stuff */
- 0, 0, /* kill, load */
- 0, 0, /* call fn, lookup sym */
- child_create_inferior,
- 0, /* mourn_inferior */
- file_stratum, 0, /* next */
- 0, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */
- 0, 0, /* section pointers */
- OPS_MAGIC, /* Always the last thing */
-};
-
-
-void
-_initialize_exec()
-{
-
- add_com("file", class_files, file_command,
- "Use FILE as program to be debugged.\n\
-It is read for its symbols, for getting the contents of pure memory,\n\
-and it is the program executed when you use the `run' command.\n\
-If FILE cannot be found as specified, your execution directory path\n\
-($PATH) is searched for a command of that name.\n\
-No arg means to have no executable file and no symbols.");
-
- add_com("exec-file", class_files, exec_file_command,
- "Use FILE as program for getting contents of pure memory.\n\
-If FILE cannot be found as specified, your execution directory path\n\
-is searched for a command of that name.\n\
-No arg means have no executable file.");
-
- add_com("section", class_files, set_section_command,
- "Change the base address of section SECTION of the exec file to ADDR.\n\
-This can be used if the exec file does not contain section addresses,\n\
-(such as in the a.out format), or when the addresses specified in the\n\
-file itself are wrong. Each section must be changed separately. The\n\
-``info files'' command lists all the sections and their addresses.");
-
- add_target(&exec_ops);
-}
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
deleted file mode 100644
index 912c9d1..0000000
--- a/gdb/xcoffread.c
+++ /dev/null
@@ -1,1506 +0,0 @@
-/* Read AIXcoff symbol tables and convert to internal format, for GDB.
- Copyright (C) 1986-1991 Free Software Foundation, Inc.
- Derived from coffread.c, dbxread.c, and a lot of hacking.
- Contributed by IBM Corporation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "defs.h"
-#include "bfd.h"
-#include "param.h"
-
-#include <stdio.h>
-
-/* AIX COFF names have a preceeding dot `.' */
-#define NAMES_HAVE_DOT 1
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <ctype.h>
-
-#include "obstack.h"
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include "symtab.h"
-#include "symfile.h"
-#include "buildsym.h"
-
-#include "internalcoff.h" /* FIXME, internal data from BFD */
-#include "libcoff.h" /* FIXME, internal data from BFD */
-#include "coff-rs6000.h" /* FIXME, raw file-format guts of xcoff */
-
-extern char *index();
-
-static void enter_line_range ();
-static struct symbol *process_xcoff_symbol ();
-static int read_symbol_nvalue ();
-static int read_symbol_lineno ();
-
-
-/* Simplified internal version of coff symbol table information */
-
-struct coff_symbol {
- char *c_name;
- int c_symnum; /* symbol number of this entry */
- int c_nsyms; /* 0 if syment only, 1 if syment + auxent */
- long c_value;
- int c_sclass;
- int c_secnum;
- unsigned int c_type;
-};
-
-/* The COFF line table, in raw form. */
-static char *linetab = NULL; /* Its actual contents */
-static long linetab_offset; /* Its offset in the file */
-static unsigned long linetab_size; /* Its size */
-
-/* last function's saved coff symbol `cs' */
-
-static struct coff_symbol fcn_cs_saved;
-
-static bfd *symfile_bfd;
-
-/* Core address of start and end of text of current source file.
- This is calculated from the first function seen after a C_FILE
- symbol. */
-
-static CORE_ADDR cur_src_start_addr;
-static CORE_ADDR cur_src_end_addr;
-
-/* Core address of the end of the first object file. */
-
-static CORE_ADDR first_object_file_end;
-
-/* pointer to the string table */
-static char *strtbl;
-
-/* length of the string table */
-static int strtbl_len;
-
-/* pointer to debug section */
-static char *debugsec;
-
-/* pointer to the a.out symbol table */
-static char *symtbl;
-
-/* initial symbol-table-debug-string vector length */
-
-#define INITIAL_STABVECTOR_LENGTH 40
-
-struct pending_stabs *global_stabs;
-struct pending_stabs *file_stabs;
-
-/* Nonzero if within a function (so symbols should be local,
- if nothing says specifically). */
-
-int within_function;
-
-/* Local variables that hold the shift and mask values for the
- COFF file that we are currently reading. These come back to us
- from BFD, and are referenced by their macro names, as well as
- internally to the BTYPE, ISPTR, ISFCN, ISARY, ISTAG, and DECREF
- macros from ../internalcoff.h . */
-
-static unsigned local_n_btshft;
-static unsigned local_n_tmask;
-
-#undef N_BTSHFT
-#define N_BTSHFT local_n_btshft
-#undef N_TMASK
-#define N_TMASK local_n_tmask
-
-/* Local variables that hold the sizes in the file of various COFF structures.
- (We only need to know this to read them from the file -- BFD will then
- translate the data in them, into `internal_xxx' structs in the right
- byte order, alignment, etc.) */
-
-static unsigned local_symesz;
-
-/* coff_symfile_init()
- is the coff-specific initialization routine for reading symbols.
- It is passed a struct sym_fns which contains, among other things,
- the BFD for the file whose symbols are being read, and a slot for
- a pointer to "private data" which we fill with cookies and other
- treats for coff_symfile_read().
-
- We will only be called if this is a COFF or COFF-like file.
- BFD handles figuring out the format of the file, and code in symtab.c
- uses BFD's determination to vector to us.
-
- The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */
-
-struct coff_symfile_info {
- file_ptr min_lineno_offset; /* Where in file lowest line#s are */
- file_ptr max_lineno_offset; /* 1+last byte of line#s in file */
-};
-
-
-/* Call sort_syms to sort alphabetically
- the symbols of each block of each symtab. */
-
-static int
-compare_symbols (s1, s2)
-struct symbol **s1, **s2;
-{
- /* Names that are less should come first. */
- register int namediff = strcmp (SYMBOL_NAME (*s1), SYMBOL_NAME (*s2));
- if (namediff != 0)
- return namediff;
-
- /* For symbols of the same name, registers should come first. */
- return ((SYMBOL_CLASS (*s2) == LOC_REGISTER)
- - (SYMBOL_CLASS (*s1) == LOC_REGISTER));
-}
-
-
-/* Sort a vector of symbols by their value. */
-
-static void
-sort_syms ()
-{
- register struct symtab *s;
- register int i, nbl;
- register struct blockvector *bv;
- register struct block *b;
-
- for (s = symtab_list; s; s = s->next)
- {
- bv = BLOCKVECTOR (s);
- nbl = BLOCKVECTOR_NBLOCKS (bv);
- for (i = 0; i < nbl; i++)
- {
- b = BLOCKVECTOR_BLOCK (bv, i);
- if (BLOCK_SHOULD_SORT (b))
- qsort (&BLOCK_SYM (b, 0), BLOCK_NSYMS (b),
- sizeof (struct symbol *), compare_symbols);
- }
- }
-}
-
-
-/* add a given stab string into given stab vector. */
-
-static void
-add_stab_to_list (stabname, stabvector)
-char *stabname;
-struct pending_stabs **stabvector;
-{
- if ( *stabvector == NULL) {
- *stabvector = (struct pending_stabs *)
- xmalloc (sizeof (struct pending_stabs) +
- INITIAL_STABVECTOR_LENGTH * sizeof (char*));
- (*stabvector)->count = 0;
- (*stabvector)->length = INITIAL_STABVECTOR_LENGTH;
- }
- else if ((*stabvector)->count >= (*stabvector)->length) {
- (*stabvector)->length += INITIAL_STABVECTOR_LENGTH;
- *stabvector = (struct pending_stabs *)
- xrealloc (*stabvector, sizeof (struct pending_stabs) +
- (*stabvector)->length * sizeof (char*));
- }
- (*stabvector)->stab [(*stabvector)->count++] = stabname;
-}
-
-
-/* for all the stabs in a given stab vector, build appropriate types
- and fix their symbols in given symbol vector. */
-
-void
-patch_block_stabs (symbols, stabs)
-struct pending *symbols;
-struct pending_stabs *stabs;
-{
- int ii;
-
- if (!stabs)
- return;
-
- /* for all the stab entries, find their corresponding symbols and
- patch their types! */
-
- for (ii=0; ii < stabs->count; ++ii) {
- char *name = stabs->stab[ii];
- char *pp = (char*) index (name, ':');
- struct symbol *sym = find_symbol_in_list (symbols, name, pp-name);
- if (!sym) {
- printf ("ERROR! stab symbol not found!\n"); /* FIXME */
- }
- else {
- pp += 2;
-
- if (*(pp-1) == 'F' || *(pp-1) == 'f')
- SYMBOL_TYPE (sym) = lookup_function_type (read_type (&pp));
- else
- SYMBOL_TYPE (sym) = read_type (&pp);
- }
- }
-}
-
-/* Enter a given range of lines into the line vector.
- can be called in the following two ways:
- enter_line_range (subfile, beginoffset, endoffset, 0, firstLine) or
- enter_line_range (subfile, beginoffset, 0, endaddr, firstLine) */
-
-static void
-enter_line_range (subfile, beginoffset, endoffset, endaddr, firstLine)
- struct subfile *subfile; /* which sub-file to put line#s in */
- unsigned beginoffset, endoffset; /* offsets to line table */
- CORE_ADDR endaddr;
- unsigned *firstLine;
-{
- char *pp, *limit;
- CORE_ADDR addr;
- struct internal_lineno lptr;
- unsigned local_linesz = coff_data (symfile_bfd)->local_linesz;
-
- pp = &linetab [beginoffset - linetab_offset];
- limit = endoffset ? &linetab [endoffset - linetab_offset]
- : &linetab [linetab_size -1];
-
- while (pp <= limit) {
-
- /* Swap and align this lineno entry into lptr. */
- bfd_coff_swap_lineno_in (symfile_bfd, pp, &lptr);
-
- /* find the address this line represents */
- addr = lptr.l_lnno ?
- lptr.l_addr.l_paddr : read_symbol_nvalue (symtbl, lptr.l_addr.l_symndx);
-
- if (endaddr && addr >= endaddr)
- return;
-
- if (lptr.l_lnno == 0) {
- *firstLine = read_symbol_lineno (symtbl, lptr.l_addr.l_symndx);
- --(*firstLine);
- }
- else
- record_line (subfile, *firstLine + lptr.l_lnno, addr);
-
- pp += local_linesz;
- }
-}
-
-
-/* Save the vital information for use when closing off the current file.
- NAME is the file name the symbols came from, START_ADDR is the first
- text address for the file, and SIZE is the number of bytes of text. */
-
-#define complete_symtab(name, start_addr) { \
- last_source_file = savestring (name, strlen (name)); \
- cur_src_start_addr = start_addr; \
-}
-
-
-/* Refill the symbol table input buffer
- and set the variables that control fetching entries from it.
- Reports an error if no data available.
- This function can read past the end of the symbol table
- (into the string table) but this does no harm. */
-
-/* Reading symbol table has to be fast! Keep the followings as macros, rather
- than functions. */
-
-#define RECORD_MISC_FUNCTION(NAME, ADDR, TYPE, ALLOCED) \
-{ \
- char *namestr; \
- if (ALLOCED) \
- namestr = (NAME) + 1; \
- else { \
- namestr = obstack_copy0 (symbol_obstack, (NAME) + 1, strlen ((NAME)+1)); \
- (ALLOCED) = 1; \
- } \
- prim_record_misc_function (namestr, (ADDR), (TYPE)); \
- last_recorded_fun = (ADDR); \
-}
-
-
-
-/* aixcoff has static blocks marked in `.bs', `.es' pairs. They cannot be
- nested. At any given time, a symbol can only be in one static block.
- This is the base address of current static block, zero if non exists. */
-
-static int static_block_base = 0;
-
-/* true if space for symbol name has been allocated. */
-
-static int symname_alloced = 0;
-
-/* read the whole symbol table of a given bfd. */
-
-void
-read_xcoff_symtab (objfile, nsyms)
- struct objfile *objfile; /* Object file we're reading from */
- int nsyms; /* # of symbols */
-{
- bfd *abfd = objfile->obfd;
- /* char *symtbl; */ /* Raw symbol table base */
- char *raw_symbol; /* Pointer into raw seething symbol table */
- char *raw_auxptr; /* Pointer to first raw aux entry for sym */
- struct internal_syment symbol[1];
- union internal_auxent main_aux[1];
- struct coff_symbol cs[1];
- CORE_ADDR file_start_addr = 0;
- CORE_ADDR file_end_addr = 0;
-
- int next_file_symnum = -1;
- int just_started = 1;
- int depth = 0;
- int val;
- int fcn_first_line;
- int fcn_last_line;
- int fcn_start_addr;
- long fcn_line_offset;
- size_t size;
-
- /* fcn_cs_saved is global because process_xcoff_symbol needs it. */
- union internal_auxent fcn_aux_saved;
- struct context_stack *new;
-
- char *filestring = " _start_ "; /* Name of the current file. */
- char *last_seen_csect;
- int last_recorded_fun = 0; /* last recorded fun. value */
-
- /* Get the appropriate COFF "constants" related to the file we're handling. */
- N_TMASK = coff_data (abfd)->local_n_tmask;
- N_BTSHFT = coff_data (abfd)->local_n_btshft;
- local_symesz = coff_data (abfd)->local_symesz;
-
- last_source_file = 0;
- last_seen_csect = 0;
- last_recorded_fun = 0;
-
- start_symtab (filestring, (char *)NULL, file_start_addr);
- symnum = 0;
- first_object_file_end = 0;
-
- /* Allocate space for the entire symbol table at once, and read it
- all in. The bfd is already positioned at the beginning of
- the symbol table. */
-
- size = coff_data (abfd)->local_symesz * nsyms;
- symtbl = xmalloc (size);
-
- val = bfd_read (symtbl, size, 1, abfd);
- if (val != size)
- perror_with_name ("reading symbol table");
-
- raw_symbol = symtbl;
-
- while (symnum < nsyms) {
-
- QUIT; /* make this command interruptable. */
-
- /* READ_ONE_SYMBOL (symbol, cs, symname_alloced); */
- /* read one symbol into `cs' structure. After processing the whole symbol
- table, only string table will be kept in memory, symbol table and debug
- section of aixcoff will be freed. Thus we can mark symbols with names
- in string table as `alloced'. */
- {
- int ii;
-
- /* Swap and align the symbol into a reasonable C structure. */
- bfd_coff_swap_sym_in (abfd, raw_symbol, symbol);
-
- cs->c_symnum = symnum;
- cs->c_nsyms = symbol->n_numaux;
- if (symbol->n_zeroes) {
- symname_alloced = 0;
- /* We must use the original, unswapped, name here so the name field
- pointed to by cs->c_name will persist throughout xcoffread. If
- we use the new field, it gets overwritten for each symbol. */
- cs->c_name = ((struct external_syment *)raw_symbol)->e.e_name;
- } else if (symbol->n_sclass & 0x80) {
- cs->c_name = debugsec + symbol->n_offset;
- symname_alloced = 0;
- } else { /* in string table */
- cs->c_name = strtbl + (int)symbol->n_offset;
- symname_alloced = 1;
- }
- cs->c_value = symbol->n_value;
- cs->c_sclass = symbol->n_sclass & 0xff;
- cs->c_secnum = symbol->n_scnum;
- cs->c_type = (unsigned)symbol->n_type;
-
- raw_symbol += coff_data (abfd)->local_symesz;
- ++symnum;
-
- raw_auxptr = raw_symbol; /* Save addr of first aux entry */
-
- /* Skip all the auxents associated with this symbol. */
- for (ii = symbol->n_numaux; ii; --ii ) {
- raw_symbol += coff_data (abfd)->local_auxesz;
- ++symnum;
- }
- }
-
- /* if symbol name starts with ".$" or "$", ignore it. */
- if (cs->c_name[0] == '$' || (cs->c_name[1] == '$' && cs->c_name[0] == '.'))
- continue;
-
- if (cs->c_symnum == next_file_symnum && cs->c_sclass != C_FILE) {
- if (last_source_file)
- end_symtab (cur_src_end_addr, 1, 1, objfile);
-
- start_symtab ("_globals_", (char *)NULL, (CORE_ADDR)0);
- cur_src_end_addr = first_object_file_end;
- /* done with all files, everything from here on is globals */
- }
-
- /* if explicitly specified as a function, treat is as one. */
- if (ISFCN(cs->c_type) && cs->c_sclass != C_TPDEF) {
- bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
- main_aux);
- goto function_entry_point;
- }
-
- if ((cs->c_sclass == C_EXT || cs->c_sclass == C_HIDEXT) && cs->c_nsyms == 1)
- {
- /* dealing with a symbol with a csect entry. */
-
-# define CSECT(PP) ((PP)->x_csect)
-# define CSECT_LEN(PP) (CSECT(PP).x_scnlen)
-# define CSECT_ALIGN(PP) (SMTYP_ALIGN(CSECT(PP).x_smtyp))
-# define CSECT_SMTYP(PP) (SMTYP_SMTYP(CSECT(PP).x_smtyp))
-# define CSECT_SCLAS(PP) (CSECT(PP).x_smclas)
-
- /* Convert the auxent to something we can access. */
- bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
- main_aux);
-
- switch (CSECT_SMTYP (main_aux)) {
-
- case XTY_ER :
- continue; /* ignore all external references. */
-
- case XTY_SD : /* a section description. */
- {
- switch (CSECT_SCLAS (main_aux)) {
-
- case XMC_PR : /* a `.text' csect. */
- {
-
- /* A program csect is seen.
-
- We have to allocate one symbol table for each program csect. Normally
- gdb prefers one symtab for each compilation unit (CU). In case of AIX, one
- CU might include more than one prog csect, and they don't have to be
- adjacent in terms of the space they occupy in memory. Thus, one single
- CU might get fragmented in the memory and gdb's file start and end address
- approach does not work! */
-
- if (last_seen_csect) {
- complete_symtab (filestring, file_start_addr);
- cur_src_end_addr = file_end_addr;
- end_symtab (file_end_addr, 1, 1, objfile);
- start_symtab ((char *)NULL, (char *)NULL, (CORE_ADDR)0);
- }
-
- /* If this is the very first csect seen, basically `__start'. */
- if (just_started) {
- first_object_file_end = cs->c_value + CSECT_LEN (main_aux);
- just_started = 0;
- }
-
- file_start_addr = cs->c_value;
- file_end_addr = cs->c_value + CSECT_LEN (main_aux);
-
- if (cs->c_name && cs->c_name[0] == '.') {
- last_seen_csect = cs->c_name;
- RECORD_MISC_FUNCTION (cs->c_name, cs->c_value, mf_text, symname_alloced);
- }
- }
- continue;
-
- case XMC_RW :
- break;
-
- /* If the section is not a data description, ignore it. Note that
- uninitialized data will show up as XTY_CM/XMC_RW pair. */
-
- case XMC_TC0:
-#ifdef XCOFF_ADD_TOC_TO_LOADINFO
- XCOFF_ADD_TOC_TO_LOADINFO (cs->c_value);
-#endif
- /* fall down to default case. */
-
- case XMC_TC : /* ignore toc entries */
- default : /* any other XMC_XXX */
- continue;
- }
- }
- break; /* switch CSECT_SCLAS() */
-
- case XTY_LD :
-
- /* a function entry point. */
- if (CSECT_SCLAS (main_aux) == XMC_PR) {
-
-function_entry_point:
- if (cs->c_value != last_recorded_fun)
- RECORD_MISC_FUNCTION (cs->c_name, cs->c_value, mf_text,
- symname_alloced);
-
- fcn_line_offset = main_aux->x_sym.x_fcnary.x_fcn.x_lnnoptr;
- fcn_start_addr = cs->c_value;
-
- /* save the function header info, which will be used
- when `.bf' is seen. */
- fcn_cs_saved = *cs;
- fcn_aux_saved = *main_aux;
- continue;
- }
-
- /* shared library function entry point. */
- else if (CSECT_SCLAS (main_aux) == XMC_GL) {
- if (last_recorded_fun != cs->c_value)
- RECORD_MISC_FUNCTION (cs->c_name, cs->c_value, mf_text,
- symname_alloced);
- continue;
- }
- break;
-
- default : /* all other XTY_XXXs */
- break;
- } /* switch CSECT_SMTYP() */
- }
-
- switch (cs->c_sclass) {
-
- case C_FILE:
-
- /* c_value field contains symnum of next .file entry in table
- or symnum of first global after last .file. */
-
- next_file_symnum = cs->c_value;
-
- /* complete symbol table for last object file containing
- debugging information. */
-
- /* Whether or not there was a csect in the previous file, we have
- to call `end_symtab' and `start_symtab' to reset type_vector,
- line_vector, etc. structures. */
- complete_symtab (filestring, file_start_addr);
- cur_src_end_addr = file_end_addr;
- end_symtab (file_end_addr, 1, 1, objfile);
- start_symtab (cs->c_name, (char *)NULL, (CORE_ADDR)0);
- last_seen_csect = 0;
-
- /* reset file start and end addresses. A compilation unit with no text
- (only data) should have zero file boundaries. */
- file_start_addr = file_end_addr = 0;
-
- filestring = cs->c_name;
- break;
-
-
- case C_FCN:
- if (strcmp (cs->c_name, ".bf") == 0) {
-
- bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
- main_aux);
-
- within_function = 1;
-
- /* value contains address of first non-init type code */
- /* main_aux.x_sym.x_misc.x_lnsz.x_lnno
- contains line number of '{' } */
- fcn_first_line = main_aux->x_sym.x_misc.x_lnsz.x_lnno;
-
- /* Linenos are now processed on a file-by-file, not fn-by-fn, basis.
- Metin did it, I'm not sure why. FIXME. -- gnu@cygnus.com */
- /* mark_first_line (fcn_line_offset, cs->c_symnum); */
-
- new = push_context (0, fcn_start_addr);
- new->name = process_xcoff_symbol (&fcn_cs_saved);
- }
- else if (strcmp (cs->c_name, ".ef") == 0) {
-
- bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
- main_aux);
-
- /* the value of .ef is the address of epilogue code;
- not useful for gdb */
- /* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
- contains number of lines to '}' */
-
- fcn_last_line = main_aux->x_sym.x_misc.x_lnsz.x_lnno;
-#if 0
- enter_linenos (fcn_line_offset, fcn_first_line,
- fcn_first_line + fcn_last_line);
-#endif
-
- new = pop_context ();
- if (context_stack_depth != 0)
- error ("invalid symbol data; .bf/.ef/.bb/.eb symbol mismatch, at symbol %d.",
- symnum);
-
- finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr,
- fcn_cs_saved.c_value +
- fcn_aux_saved.x_sym.x_misc.x_fsize);
- within_function = 0;
- }
- break;
-
- case C_BSTAT : /* begin static block */
- static_block_base = read_symbol_nvalue (symtbl, cs->c_value);
- break;
-
- case C_ESTAT : /* end of static block */
- static_block_base = 0;
- break;
-
- case C_ARG : /* These are not implemented. */
- case C_REGPARM :
- case C_TPDEF :
- case C_STRTAG :
- case C_UNTAG :
- case C_ENTAG :
- printf ("ERROR: Unimplemented storage class: %d.\n", cs->c_sclass);
- break;
-
- case C_HIDEXT : /* ignore these.. */
- case C_LABEL :
- case C_NULL :
- break;
-
- case C_BINCL : /* beginning of include file */
- push_subfile ();
- start_subfile (cs->c_name, (char *)0);
- fcn_first_line = cs->c_value; /* Offset to first lineno of file */
- break;
-
- case C_EINCL : /* end of include file */
- fcn_last_line = cs->c_value; /* Offset to last line number */
- { long dummy = 0;
- enter_line_range (current_subfile, fcn_first_line, cs->c_value, 0,
- &dummy);
- }
- start_subfile (pop_subfile (), (char *)0);
- break;
-
- case C_BLOCK :
- if (strcmp (cs->c_name, ".bb") == 0) {
- depth++;
- new = push_context (depth, cs->c_value);
- }
- else if (strcmp (cs->c_name, ".eb") == 0) {
- new = pop_context ();
- if (depth != new->depth)
- error ("Invalid symbol data: .bb/.eb symbol mismatch at symbol %d.",
- symnum);
-
- depth--;
- if (local_symbols && context_stack_depth > 0) {
- /* Make a block for the local symbols within. */
- finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr, cs->c_value);
- }
- local_symbols = new->locals;
- }
- break;
-
- default :
- (void) process_xcoff_symbol (cs);
- break;
- }
-
- } /* while */
-
- if (last_source_file)
- end_symtab (cur_src_end_addr, 1, 1, objfile);
-
- free (symtbl);
-}
-
-#define SYMBOL_DUP(SYMBOL1, SYMBOL2) \
- (SYMBOL2) = (struct symbol *) \
- obstack_alloc (symbol_obstack, sizeof (struct symbol)); \
- *(SYMBOL2) = *(SYMBOL1);
-
-
-#define SYMNAME_ALLOC(NAME, ALLOCED) \
- (ALLOCED) ? (NAME) : obstack_copy0 (symbol_obstack, (NAME), strlen (NAME));
-
-
-
-/* process one xcoff symbol. */
-
-static struct symbol *
-process_xcoff_symbol (cs)
- register struct coff_symbol *cs;
-{
- struct symbol onesymbol;
- register struct symbol *sym = &onesymbol;
- struct symbol *sym2 = NULL;
- struct type *ttype;
- char *name, *pp, *qq;
-
- name = cs->c_name;
- if (name[0] == '.')
- ++name;
-
- bzero (sym, sizeof (struct symbol));
-
- /* default assumptions */
- SYMBOL_VALUE (sym) = cs->c_value;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
-
- if (ISFCN (cs->c_type)) {
-
- /* At this point, we don't know the type of the function and assume it
- is int. This will be patched with the type from its stab entry later
- on in patch_block_stabs () */
-
- SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced);
- SYMBOL_TYPE (sym) = lookup_function_type (builtin_type_int);
-
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_DUP (sym, sym2);
-
- if (cs->c_sclass == C_EXT)
- add_symbol_to_list (sym2, &global_symbols);
- else if (cs->c_sclass == C_HIDEXT || cs->c_sclass == C_STAT)
- add_symbol_to_list (sym2, &file_symbols);
- }
-
- else {
-
- /* in case we can't figure out the type, default is `int'. */
- SYMBOL_TYPE (sym) = builtin_type_int;
-
- switch (cs->c_sclass)
- {
- case C_FUN:
- if (fcn_cs_saved.c_sclass == C_EXT)
- add_stab_to_list (name, &global_stabs);
- else
- add_stab_to_list (name, &file_stabs);
- break;
-
- case C_DECL: /* a type decleration?? */
- qq = (char*) index (name, ':');
- if (!qq) /* skip if there is no ':' */
- return NULL;
-
- pp = qq + 2;
- ttype = SYMBOL_TYPE (sym) = read_type (&pp);
-
- /* read_type() will return null if type (or tag) definition was
- unnnecessarily duplicated. Also, if the symbol doesn't have a name,
- there is no need to keep it in symbol table. */
-
- if (!ttype || name == qq)
- return NULL;
-
- if (qq[1] == 'T')
- SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
- else if (qq[1] == 't')
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- else {
- printf ("ERROR: Unrecognized stab string.\n");
- return NULL;
- }
-
- SYMBOL_CLASS (sym) = LOC_TYPEDEF;
- SYMBOL_NAME (sym) = obsavestring (name, qq-name);
-
- if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE)
- TYPE_NAME (ttype) = concat (
- TYPE_CODE (ttype) == TYPE_CODE_UNION ? "union " :
- TYPE_CODE (ttype) == TYPE_CODE_STRUCT? "struct " : "enum ",
- SYMBOL_NAME (sym), NULL);
-
- else if (!TYPE_NAME (ttype)) /* else, regular typedef. */
- TYPE_NAME (ttype) = SYMBOL_NAME (sym);
-
- SYMBOL_DUP (sym, sym2);
- add_symbol_to_list
- (sym2, within_function ? &local_symbols : &file_symbols);
- break;
-
- case C_GSYM:
- add_stab_to_list (name, &global_stabs);
- break;
-
- case C_PSYM:
- if (*name == ':' || (pp = (char *) index (name, ':')) == NULL)
- return NULL;
- SYMBOL_NAME (sym) = obsavestring (name, pp-name);
- SYMBOL_CLASS (sym) = LOC_ARG;
- pp += 2;
- SYMBOL_TYPE (sym) = read_type (&pp);
- SYMBOL_DUP (sym, sym2);
- add_symbol_to_list (sym2, &local_symbols);
- break;
-
- case C_STSYM:
- if (*name == ':' || (pp = (char *) index (name, ':')) == NULL)
- return NULL;
- SYMBOL_NAME (sym) = obsavestring (name, pp-name);
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_VALUE (sym) += static_block_base;
- pp += 2;
- SYMBOL_TYPE (sym) = read_type (&pp);
- SYMBOL_DUP (sym, sym2);
- add_symbol_to_list
- (sym2, within_function ? &local_symbols : &file_symbols);
- break;
-
- case C_LSYM:
- if (*name == ':' || (pp = (char *) index (name, ':')) == NULL)
- return NULL;
- SYMBOL_NAME (sym) = obsavestring (name, pp-name);
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- pp += 1;
- SYMBOL_TYPE (sym) = read_type (&pp);
- SYMBOL_DUP (sym, sym2);
- add_symbol_to_list (sym2, &local_symbols);
- break;
-
- case C_AUTO:
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced);
- SYMBOL_DUP (sym, sym2);
- add_symbol_to_list (sym2, &local_symbols);
- break;
-
- case C_EXT:
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced);
- SYMBOL_DUP (sym, sym2);
- add_symbol_to_list (sym2, &global_symbols);
- break;
-
- case C_STAT:
- SYMBOL_CLASS (sym) = LOC_STATIC;
- SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced);
- SYMBOL_DUP (sym, sym2);
- add_symbol_to_list
- (sym2, within_function ? &local_symbols : &file_symbols);
- break;
-
- case C_REG:
- printf ("ERROR! C_REG is not fully implemented!\n");
- SYMBOL_CLASS (sym) = LOC_REGISTER;
- SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced);
- SYMBOL_DUP (sym, sym2);
- add_symbol_to_list (sym2, &local_symbols);
- break;
-
- case C_RSYM:
- pp = (char*) index (name, ':');
- SYMBOL_CLASS (sym) = LOC_REGISTER;
- SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (cs->c_value);
- if (pp) {
- SYMBOL_NAME (sym) = obsavestring (name, pp-name);
- pp += 2;
- if (*pp)
- SYMBOL_TYPE (sym) = read_type (&pp);
- }
- else
- /* else this is not a stab entry, suppose the type is either
- `int' or `float', depending on the register class. */
-
- SYMBOL_TYPE (sym) = (SYMBOL_VALUE (sym) < 32) ?
- builtin_type_int : builtin_type_float;
-
- SYMBOL_DUP (sym, sym2);
- add_symbol_to_list (sym2, &local_symbols);
- break;
-
- default :
- printf ("ERROR: Unexpected storage class: %d.\n", cs->c_sclass);
- return NULL;
- }
- }
- return sym2;
-}
-
-
-static int
-read_symbol_nvalue (symtable, symno)
- char *symtable;
- int symno;
-{
- struct internal_syment symbol[1];
-
- bfd_coff_swap_sym_in (symfile_bfd, symtable + (symno*local_symesz), symbol);
- return symbol->n_value;
-}
-
-
-static int
-read_symbol_lineno (symtable, symno)
- char *symtable;
- int symno;
-{
- struct internal_syment symbol[1];
- union internal_auxent main_aux[1];
-
- int ii;
-
- for (ii = 0; ii < 50; ii++) {
- bfd_coff_swap_sym_in (symfile_bfd,
- symtable + (symno*local_symesz), symbol);
- if (symbol->n_sclass == C_FCN && 0 == strcmp (symbol->n_name, ".bf"))
- goto gotit;
- symno += 1 + symbol->n_numaux+1;
- }
-
- printf ("GDB Error: `.bf' not found.\n");
- return 0;
-
-gotit:
- /* take aux entry and return its lineno */
- symno++;
- bfd_coff_swap_aux_in (symfile_bfd, symtable+(symno*local_symesz),
- symbol->n_type, symbol->n_sclass, main_aux);
-
- return main_aux->x_sym.x_misc.x_lnsz.x_lnno;
-}
-
-/* Support for line number handling */
-
-/* This function is called for every section; it finds the outer limits
- * of the line table (minimum and maximum file offset) so that the
- * mainline code can read the whole thing for efficiency.
- */
-static void
-find_linenos(abfd, asect, vpinfo)
-bfd *abfd;
-sec_ptr asect;
-void *vpinfo;
-{
- struct coff_symfile_info *info;
- int size, count;
- file_ptr offset, maxoff;
-
- count = asect->lineno_count;
-
- if (count == 0)
- return;
-
- size = count * coff_data (symfile_bfd)->local_linesz;
- info = (struct coff_symfile_info *)vpinfo;
- offset = asect->line_filepos;
- maxoff = offset + size;
-
- if (offset < info->min_lineno_offset || info->min_lineno_offset == 0)
- info->min_lineno_offset = offset;
-
- if (maxoff > info->max_lineno_offset)
- info->max_lineno_offset = maxoff;
-}
-
-
-/* Read in all the line numbers for fast lookups later. Leave them in
- external (unswapped) format in memory; we'll swap them as we enter
- them into GDB's data structures. */
-
-static int
-init_lineno (abfd, offset, size)
- bfd *abfd;
- long offset;
- int size;
-{
- int val;
-
- if (bfd_seek(abfd, offset, 0) < 0)
- return -1;
-
- linetab = (char *) xmalloc(size);
-
- val = bfd_read(linetab, 1, size, abfd);
- if (val != size)
- return -1;
-
- linetab_offset = offset;
- linetab_size = size;
- make_cleanup(free, linetab); /* Be sure it gets de-allocated. */
- return 0;
-}
-
-
-void
-dump_strtbl ()
-{
- int ii;
- printf ("===STRING TABLE DUMP...\n\n");
- for ( ii=0; ii < strtbl_len; ++ii )
- printf ("%c", isprint (*(strtbl+ii)) ? *(strtbl+ii) : ' ');
- printf ("\n");
-}
-
-void
-dump_linetable (ltb)
- struct linetable *ltb;
-{
- int ii;
- for (ii=0; ii < ltb->nitems; ++ii)
- printf ("line: %d, addr: 0x%x\n", ltb->item[ii].line, ltb->item[ii].pc);
-}
-
-void
-dump_type (typeP)
- struct type *typeP;
-{
- printf ("0x%x: name: %s\n", typeP, typeP->name ? typeP->name : "(nil)");
-}
-
-char *dump_namespace ();
-char *dump_addrclass ();
-
-void
-dump_symbol (pp)
- struct symbol *pp;
-{
- printf (" sym: %s\t%s,\t%s\ttype: 0x%x, val: 0x%x end: 0x%x\n",
- pp->name, dump_namespace (pp->namespace),
- dump_addrclass (pp->class), pp->type,
- SYMBOL_CLASS(pp) == LOC_BLOCK ? BLOCK_START(SYMBOL_BLOCK_VALUE(pp))
- : pp->value.value,
- SYMBOL_CLASS(pp) == LOC_BLOCK ? BLOCK_END(SYMBOL_BLOCK_VALUE(pp)) : 0);
-}
-
-
-char *
-dump_namespace (ns)
-int ns;
-{
- static char *ns_name [] = {
- "UNDEF_NS", "VAR_NS", "STRUCT_NS", "LABEL_NS"};
-
- switch (ns) {
- case UNDEF_NAMESPACE:
- case VAR_NAMESPACE:
- case STRUCT_NAMESPACE:
- case LABEL_NAMESPACE:
- return ns_name[ns];
- }
-
- return "***ERROR***";
-}
-
-
-char *
-dump_addrclass (ac)
-int ac; /* address class */
-{
- static char *ac_name [] = {
- "LOC_UNDEF",
- "LOC_CONST",
- "LOC_STATIC",
- "LOC_REGISTER",
- "LOC_ARG",
- "LOC_REF_ARG",
- "LOC_REGPARM",
- "LOC_LOCAL",
- "LOC_TYPEDEF",
- "LOC_LABEL",
- "LOC_BLOCK",
- "LOC_CONST_BYTES",
- "LOC_LOCAL_ARG",
- };
- switch (ac) {
- case LOC_UNDEF:
- case LOC_CONST:
- case LOC_STATIC:
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_LOCAL:
- case LOC_TYPEDEF:
- case LOC_LABEL:
- case LOC_BLOCK:
- case LOC_CONST_BYTES:
- case LOC_LOCAL_ARG:
- return ac_name [ac];
- }
- return "***ERROR***";
-}
-
-void
-dump_block (pp)
- struct block *pp;
-{
- int ii;
- printf ("BLOCK..: start: 0x%x, end: 0x%x\n", pp->startaddr, pp->endaddr);
- for (ii=0; ii < pp->nsyms; ++ii)
- dump_symbol (pp->sym[ii]);
-}
-
-void
-dump_blockvector (pp)
- struct blockvector *pp;
-{
- int ii;
- for (ii=0; ii < pp->nblocks; ++ii)
- dump_block (pp->block [ii]);
-}
-
-
-void
-dump_last_symtab (pp)
- struct symtab *pp;
-{
- for ( ; pp; pp = pp->next) {
- if ( pp->next == 0 ) {
- printf ("SYMTAB NAME: %s\n", pp->filename);
- dump_blockvector (pp->blockvector);
- }
- }
-}
-
-void
-dump_symtabs (pp)
- struct symtab *pp;
-{
- for ( ; pp; pp = pp->next) {
- printf ("SYMTAB NAME: %s\n", pp->filename ? pp->filename : "(nil)");
-/* if (pp->linetable)
- dump_linetable (pp->linetable); */
- dump_blockvector (pp->blockvector);
- }
-}
-
-void
-dump_symtab_lines (pp)
- struct symtab *pp;
-{
- for ( ; pp; pp = pp->next) {
- printf ("SYMTAB NAME: %s\n", pp->filename ? pp->filename : "(nil)");
- if (pp->linetable)
- dump_linetable (pp->linetable);
- /* dump_blockvector (pp->blockvector); */
- }
-}
-
-void
-dump_misc_funcs ()
-{
- int ii;
- for (ii=0; ii < misc_function_count; ++ii)
- printf ("name: %s, addr: 0x%x\n",
- misc_function_vector[ii].name,
- misc_function_vector[ii].address);
-}
-
-
-/* dbx allows the text of a symbol name to be continued into the
- next symbol name! When such a continuation is encountered
- (a \ at the end of the text of a name)
- call this function to get the continuation. */
-/* So far, I haven't seen this happenning xlc output. I doubt we'll need this
- for aixcoff. */
-
-#define next_symbol_text() \
- printf ("Gdb Error: symbol names on multiple lines not implemented.\n")
-
-
-/* xlc/dbx combination uses a set of builtin types, starting from -1. return
- the proper type node fora given builtin type #. */
-
-struct type *
-builtin_type (pp)
-char **pp;
-{
- int typenums[2];
-
- if (**pp != '-') {
- printf ("ERROR!, unknown built-in type!\n");
- return NULL;
- }
- *pp += 1;
- read_type_number (pp, typenums);
-
- /* default types are defined in dbxstclass.h. */
- switch ( typenums[1] ) {
- case 1:
- return builtin_type_int;
- case 2:
- return builtin_type_char;
- case 3:
- return builtin_type_short;
- case 4:
- return builtin_type_long;
- case 5:
- return builtin_type_unsigned_char;
- case 6:
- return builtin_type_char; /* requires a builtin `signed char' */
- case 7:
- return builtin_type_unsigned_short;
- case 8:
- return builtin_type_unsigned_int;
- case 9:
- return builtin_type_unsigned_int;
- case 10:
- return builtin_type_unsigned_long;
- case 11:
- return builtin_type_void;
- case 12:
- return builtin_type_float;
- case 13:
- return builtin_type_double;
- case 14:
- return builtin_type_double; /* requires a builtin `long double' */
- case 15:
- return builtin_type_int; /* requires a builtin `integer' */
- case 16:
- return builtin_type_int; /* requires builtin `boolean' */
- case 17:
- return builtin_type_float; /* requires builtin `short real' */
- case 18:
- return builtin_type_float; /* requires builtin `real' */
- default :
- printf ("ERROR! Unknown builtin type -%d\n", typenums[1]);
- return NULL;
- }
-}
-
-/* if we now nothing about a function but its address, make a function symbol
- out of it with the limited knowladge you have. This will be used when
- somebody refers to a function, which doesn't exist in the symbol table,
- but in misc_function_vector. */
-
-struct symbol *
-build_function_symbol (ind)
- int ind;
-{
- struct symbol *sym =
- (struct symbol *) obstack_alloc (symbol_obstack, sizeof (struct symbol));
- SYMBOL_NAME (sym) = misc_function_vector[ind].name;
- /* SYMBOL_VALUE (sym) = misc_function_vector[ind].address; */
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_TYPE (sym) = lookup_function_type (builtin_type_int);
- SYMBOL_BLOCK_VALUE (sym) = (struct block *)
- obstack_alloc (symbol_obstack, sizeof (struct block));
- BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) = misc_function_vector[ind].address;
- return sym;
-}
-
-
-void
-aixcoff_new_init ()
-{
- /* Nothin' to do. */
-}
-
-void
-aixcoff_symfile_init (sf)
-struct sym_fns *sf;
-{
- bfd *abfd = sf->sym_bfd;
-
- /* Allocate struct to keep track of the symfile */
- /* FIXME memory leak */
- sf->sym_private = xmalloc(sizeof (struct coff_symfile_info));
-
- /*
- * Save startup file's range of PC addresses to help
- * blockframe.c decide where the bottom of the stack is.
- */
- if (bfd_get_file_flags(abfd) & EXEC_P) {
- entry_point = bfd_get_start_address(abfd);
- } else {
- entry_point = ~0;
- /* set the startup file to be an empty range. */
- startup_file_start = 0;
- startup_file_end = 0;
- }
-}
-
-
-static int
-init_stringtab(abfd, offset)
- bfd *abfd;
- long offset;
-{
- long length;
- int val;
- unsigned char lengthbuf[4];
-
- if (bfd_seek(abfd, offset, 0) < 0)
- return -1;
-
- val = bfd_read((char *)lengthbuf, 1, sizeof lengthbuf, abfd);
- length = bfd_h_get_32(abfd, lengthbuf);
-
- /* If no string table is needed, then the file may end immediately
- after the symbols. Just return with `strtbl' set to null. */
-
- if (val != sizeof length || length < sizeof length)
- return 0;
-
- /* Allocate string table from symbol_obstack. We will need this table
- as long as we have its symbol table around. */
-
- strtbl = (char*) obstack_alloc (symbol_obstack, length);
- if (strtbl == NULL)
- return -1;
-
- bcopy(&length, strtbl, sizeof length);
- if (length == sizeof length)
- return 0;
-
- val = bfd_read(strtbl + sizeof length, 1, length - sizeof length, abfd);
-
- if (val != length - sizeof length || strtbl[length - 1] != '\0')
- return -1;
-
- return 0;
-}
-
-static int
-init_debugsection(abfd)
- bfd *abfd;
-{
- register sec_ptr secp;
- bfd_size_type length;
-
- if (debugsec) {
- free(debugsec);
- debugsec = NULL;
- }
-
- secp = bfd_get_section_by_name(abfd, ".debug");
- if (!secp)
- return 0;
-
- if (!(length = bfd_section_size(abfd, secp)))
- return 0;
-
- debugsec = (void *) xmalloc ((unsigned)length);
- if (debugsec == NULL)
- return -1;
-
- if (!bfd_get_section_contents(abfd, secp, debugsec, (file_ptr) 0, length)) {
- printf ("Can't read .debug section from symbol file\n");
- return -1;
- }
- return 0;
-}
-
-static void
-free_debugsection()
-{
- if (debugsec)
- free(debugsec);
- debugsec = NULL;
-}
-
-
-/* aixcoff version of symbol file read. */
-
-void
-aixcoff_symfile_read (sf, addr, mainline)
- struct sym_fns *sf;
- CORE_ADDR addr;
- int mainline;
-{
- int num_symbols; /* # of symbols */
- int symtab_offset; /* symbol table and */
- int stringtab_offset; /* string table file offsets */
- int val;
- bfd *abfd;
- struct coff_symfile_info *info = (void*) sf->sym_private;
- char *name;
-
- symfile_bfd = abfd = sf->objfile->obfd;
- name = sf->objfile->name;
-
- num_symbols = bfd_get_symcount (abfd); /* # of symbols */
- symtab_offset = obj_sym_filepos (abfd); /* symbol table file offset */
- stringtab_offset = symtab_offset +
- num_symbols * coff_data(abfd)->local_symesz;
-
- info->min_lineno_offset = 0;
- info->max_lineno_offset = 0;
- bfd_map_over_sections (abfd, find_linenos, info);
-
- /* FIXME! This stuff should move into symfile_init */
- if (info->min_lineno_offset != 0
- && info->max_lineno_offset > info->min_lineno_offset) {
-
- /* only read in the line # table if one exists */
- val = init_lineno(abfd, info->min_lineno_offset,
- info->max_lineno_offset - info->min_lineno_offset);
-
- if (val < 0)
- error("\"%s\": error reading line numbers\n", name);
- }
-
- val = init_stringtab(abfd, stringtab_offset);
- if (val < 0) {
- error ("\"%s\": can't get string table", name);
- }
-
- if (init_debugsection(abfd) < 0) {
- error ("Error reading .debug section of `%s'\n", name);
- }
-
- /* Position to read the symbol table. Do not read it all at once. */
- val = bfd_seek(abfd, (long)symtab_offset, 0);
- if (val < 0)
- perror_with_name(name);
-
- if (bfd_tell(abfd) != symtab_offset)
- fatal("bfd? BFD!");
-
- init_misc_bunches ();
- make_cleanup(discard_misc_bunches, 0);
-
-#ifdef XCOFF_INIT_LOADINFO
- if (mainline)
- XCOFF_INIT_LOADINFO ();
-#endif
-
- /* Now that the executable file is positioned at symbol table,
- process it and define symbols accordingly. */
-
- read_xcoff_symtab(sf->objfile, num_symbols);
-
- make_cleanup(free_debugsection, 0);
-
- /* Sort symbols alphabetically within each block. */
- sort_syms ();
-
- /* Go over the misc functions and install them in vector. */
- condense_misc_bunches (!mainline);
-
- /* Make a default for file to list. */
- select_source_symtab (0);
-}
-
-/* Register our ability to parse symbols for aixcoff BFD files. */
-
-static struct sym_fns aixcoff_sym_fns =
-{
- "aixcoff-rs6000", 15,
- aixcoff_new_init, aixcoff_symfile_init,
- aixcoff_symfile_read,
-};
-
-void
-_initialize_xcoffread ()
-{
- add_symtab_fns(&aixcoff_sym_fns);
-}
diff --git a/gdb/xm-3b1.h b/gdb/xm-3b1.h
deleted file mode 100644
index e31e86f..0000000
--- a/gdb/xm-3b1.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Parameters for execution on a 3b1.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-#define HAVE_TERMIO
-#define USG
-
-#define MAXPATHLEN 200
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR 0x70000
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ addr = blockend + regno * 4; }
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel fp, -(sp)");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea 10(sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
-
-#endif
diff --git a/gdb/xm-altos.h b/gdb/xm-altos.h
deleted file mode 100644
index cc501c0..0000000
--- a/gdb/xm-altos.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/* Definitions to make GDB run on an Altos 3068 (m68k running SVR2)
- Copyright (C) 1987,1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* The altos support would make a good base for a port to other USGR2 systems
- (like the 3b1 and the Convergent miniframe). */
-
-/* This is only needed in one file, but it's cleaner to put it here than
- putting in more #ifdef's. */
-#include <sys/page.h>
-#include <sys/net.h>
-
-#define USG
-
-#define HAVE_TERMIO
-
-#define CBREAK XTABS /* It takes all kinds... */
-
-#ifndef R_OK
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#define F_OK 0
-#endif
-
-#ifndef MAXPATHLEN
-#define MAXPATHLEN (1024)
-#endif
-
-/* Get sys/wait.h ie. from a Sun and edit it a little (mc68000 to m68k) */
-/* Why bother? */
-#if 0
-#define HAVE_WAIT_STRUCT
-#endif
-
-#define vfork fork
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR 0x1fbf000
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ if (regno <= SP_REGNUM) \
- addr = blockend + regno * 4; \
- else if (regno == PS_REGNUM) \
- addr = blockend + regno * 4 + 4; \
- else if (regno == PC_REGNUM) \
- addr = blockend + regno * 4 + 2; \
-}
-
-#define REGISTER_ADDR(u_ar0, regno) \
- (((regno) < PS_REGNUM) \
- ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \
- : (((regno) == PS_REGNUM) \
- ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \
- : (&((struct exception_stack *) (u_ar0))->e_PC)))
-
-#define FP_REGISTER_ADDR(u, regno) \
- (((char *) \
- (((regno) < FPC_REGNUM) \
- ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \
- : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \
- - ((char *) (& u)))
-
-
-#ifndef __GNUC__
-#undef USE_GAS
-#define ALTOS_AS
-#else
-#define USE_GAS
-#endif
-
-/* Motorola assembly format */
-#if !defined(USE_GAS) && !defined(ALTOS)
-#define MOTOROLA
-#endif
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#ifdef MOTOROLA
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("move.l $ end, sp"); \
- asm ("clr.l fp"); }
-#else
-#ifdef ALTOS_AS
-#define INIT_STACK(beg, end) \
-{ asm ("global end"); \
- asm ("mov.l &end,%sp"); \
- asm ("clr.l %fp"); }
-#else
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel $ end, sp"); \
- asm ("clrl fp"); }
-#endif
-#endif
-
-/* Push the frame pointer register on the stack. */
-#ifdef MOTOROLA
-#define PUSH_FRAME_PTR \
- asm ("move.l fp, -(sp)");
-#else
-#ifdef ALTOS_AS
-#define PUSH_FRAME_PTR \
- asm ("mov.l %fp, -(%sp)");
-#else
-#define PUSH_FRAME_PTR \
- asm ("movel fp, -(sp)");
-#endif
-#endif
-
-/* Copy the top-of-stack to the frame pointer register. */
-#ifdef MOTOROLA
-#define POP_FRAME_PTR \
- asm ("move.l (sp), fp");
-#else
-#ifdef ALTOS_AS
-#define POP_FRAME_PTR \
- asm ("mov.l (%sp), %fp");
-#else
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-#endif
-#endif
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#ifdef MOTOROLA
-#define PUSH_REGISTERS \
-{ asm ("clr.w -(sp)"); \
- asm ("pea (10,sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-#else
-#ifdef ALTOS_AS
-#define PUSH_REGISTERS \
-{ asm ("clr.w -(%sp)"); \
- asm ("pea (10,%sp)"); \
- asm ("movm.l &0xfffe,-(%sp)"); }
-#else
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea 10(sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-#endif
-#endif
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#ifdef MOTOROLA
-#define POP_REGISTERS \
-{ asm ("subi.l $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
-#else
-#ifdef ALTOS_AS
-#define POP_REGISTERS \
-{ asm ("sub.l &8,28(%sp)"); \
- asm ("movem (%sp),&0xffff"); \
- asm ("rte"); }
-#else
-#define POP_REGISTERS \
-{ asm ("subil $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
-#endif
-#endif
diff --git a/gdb/xm-amix.h b/gdb/xm-amix.h
deleted file mode 100644
index cf55ce1..0000000
--- a/gdb/xm-amix.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Macro definitions for GDB on a Commodore Amiga running SVR4 (amix)
- Copyright (C) 1991, Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support (fnf@cygint)
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Pick up most of what we need from the generic m68k host include file. */
-
-#include "xm-m68k.h"
-
-/* Pick up more stuff from the generic SVR4 host include file. */
-
-#include "xm-svr4.h"
-
diff --git a/gdb/xm-arm.h b/gdb/xm-arm.h
deleted file mode 100644
index 70953c8..0000000
--- a/gdb/xm-arm.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Definitions to make GDB run on an ARM under RISCiX (4.3bsd).
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR (0x01000000 - (UPAGES * NBPG))
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-
-#if 0
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
- 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0}
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movl $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("pushl fp");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("pushl 8(sp)"); \
- asm ("pushl 8(sp)"); \
- asm ("pushal 0x14(sp)"); \
- asm ("pushr $037777"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("popr $037777"); \
- asm ("subl2 $8,(sp)"); \
- asm ("movl (sp),sp"); \
- asm ("rei"); }
-#endif /* 0 */
diff --git a/gdb/xm-bigmips.h b/gdb/xm-bigmips.h
deleted file mode 100644
index 85f314f..0000000
--- a/gdb/xm-bigmips.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-#include "xm-mips.h"
diff --git a/gdb/xm-convex.h b/gdb/xm-convex.h
deleted file mode 100644
index 156214c..0000000
--- a/gdb/xm-convex.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Definitions to make GDB run on Convex Unix (4bsd)
- Copyright (C) 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-#define LONG_LONG
-#define ATTACH_DETACH
-#define HAVE_WAIT_STRUCT
-#define NO_SIGINTERRUPT
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* Use SIGCONT rather than SIGTSTP because convex Unix occasionally
- turkeys SIGTSTP. I think. */
-
-#define STOP_SIGNAL SIGCONT
-
-/* Use csh to do argument expansion so we get ~ and such. */
-
-/* Doesn't work. */
-/* #define SHELL_FILE "/bin/csh" */
-
-/* Compensate for lack of `vprintf' function. */
-#define MISSING_VPRINTF
-
-/* Hook to call after creating inferior process. */
-
-#define CREATE_INFERIOR_HOOK create_inferior_hook
-
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* (no kdb) */
diff --git a/gdb/xm-delta88.h b/gdb/xm-delta88.h
deleted file mode 100644
index f408c8b..0000000
--- a/gdb/xm-delta88.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Host machine description for Motorola Delta 88 system, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-#if !defined (USG)
-#define USG 1
-#endif
-
-#define MAXPATHLEN 1024
-
-#include <sys/param.h>
-#include <sys/time.h>
-
-#define HAVE_TERMIO
-
-/*#define USIZE 2048*/
-#define NBPG NBPC
-#define UPAGES USIZE
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-/*#define SET_STACK_LIMIT_HUGE*/
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-/* Since registers r0 through r31 are stored directly in the struct ptrace_user,
- (for m88k BCS)
- the ptrace_user offsets are sufficient and KERNEL_U_ADDRESS can be 0 */
-
-#define KERNEL_U_ADDR 0
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- (addr) = m88k_register_u_addr ((blockend),(regno));
-
-#define FETCH_INFERIOR_REGISTERS
-
-/* Address of end of stack space (in core files). */
-
-#define STACK_END_ADDR 0xF0000000
diff --git a/gdb/xm-hp300bsd.h b/gdb/xm-hp300bsd.h
deleted file mode 100644
index db06dbc..0000000
--- a/gdb/xm-hp300bsd.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Parameters for hosting on a Hewlett-Packard 9000/300, running bsd.
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * Configuration file for HP9000/300 series machine running
- * University of Utah's 4.3bsd port. This is NOT for HP-UX.
- * Problems to hpbsd-bugs@cs.utah.edu
- */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* Avoid "INT_MIN redefined" warnings -- by defining it here, exactly
- the same as in the system <machine/machtypes.h> file. */
-#undef INT_MIN
-#define INT_MIN 0x80000000
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* Get kernel u area address at run-time using BSD style nlist (). */
-#define KERNEL_U_ADDR_BSD
-
-/* This is a piece of magic that is given a register number REGNO
- and as BLOCKEND the address in the system of the end of the user structure
- and stores in ADDR the address in the kernel or core dump
- of that register. */
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ \
- if (regno < PS_REGNUM) \
- addr = (int) &((struct frame *)(blockend))->f_regs[regno]; \
- else if (regno == PS_REGNUM) \
- addr = (int) &((struct frame *)(blockend))->f_stackadj; \
- else if (regno == PC_REGNUM) \
- addr = (int) &((struct frame *)(blockend))->f_pc; \
- else if (regno < FPC_REGNUM) \
- addr = (int) \
- &((struct user *)0)->u_pcb.pcb_fpregs.fpf_regs[((regno)-FP0_REGNUM)*3];\
- else if (regno == FPC_REGNUM) \
- addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpcr; \
- else if (regno == FPS_REGNUM) \
- addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpsr; \
- else \
- addr = (int) &((struct user *)0)->u_pcb.pcb_fpregs.fpf_fpiar; \
-}
-
-/* Compensate for lack of `vprintf' function. */
-#define MISSING_VPRINTF
-
-/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */
-#define ONE_PROCESS_WRITETEXT
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel #end, sp"); \
- asm ("movel #0,a6"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel a6,sp@-");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl sp@,a6");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea sp@(10)"); \
- asm ("movem #0xfffe,sp@-"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil #8,sp@(28)"); \
- asm ("movem sp@,#0xffff"); \
- asm ("rte"); }
diff --git a/gdb/xm-hp300hpux.h b/gdb/xm-hp300hpux.h
deleted file mode 100644
index 79bc6da..0000000
--- a/gdb/xm-hp300hpux.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/* Parameters for execution on an HP 9000 model 320, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* Define this to indicate problems with traps after continuing. */
-#define HP_OS_BUG
-
-/* fetch_inferior_registers is in hp300hpux-dep.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-/* Set flag to indicate whether HP's assembler is in use. */
-#ifdef __GNUC__
-#ifdef __HPUX_ASM__
-#define HPUX_ASM
-#endif
-#else /* not GNU C. */
-#define HPUX_ASM
-#endif /* not GNU C. */
-
-/* Define this for versions of hp-ux older than 6.0 */
-/* #define HPUX_VERSION_5 */
-
-/* define USG if you are using sys5 /usr/include's */
-#undef USG /* In case it was defined in the Makefile for cplus-dem.c */
-#define USG
-
-#define HAVE_TERMIO
-
-/* Get rid of any system-imposed stack limit if possible. */
-/* The hp9k320.h doesn't seem to have this feature. */
-/* #define SET_STACK_LIMIT_HUGE */
-/* So we'll just have to avoid big alloca's. */
-#define BROKEN_LARGE_ALLOCA
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#ifdef HPUX_VERSION_5
-#define KERNEL_U_ADDR 0x00979000
-#else /* Not HPUX version 5. */
-/* Use HPUX-style nlist() to get kernel_u_addr. */
-#define KERNEL_U_ADDR_HPUX
-#endif /* Not HPUX version 5. */
-
-#define REGISTER_ADDR(u_ar0, regno) \
- (unsigned int) \
- (((regno) < PS_REGNUM) \
- ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \
- : (((regno) == PS_REGNUM) \
- ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \
- : (&((struct exception_stack *) (u_ar0))->e_PC)))
-
-#define FP_REGISTER_ADDR(u, regno) \
- (((char *) \
- (((regno) < FPC_REGNUM) \
- ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \
- : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \
- - ((char *) (& u)))
-
-/* Do implement the attach and detach commands. */
-
-#define ATTACH_DETACH
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-#ifndef HPUX_ASM
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel fp, -(sp)");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea 10(sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
-
-#else /* HPUX_ASM */
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm ("global end"); \
- asm ("mov.l &end,%sp"); \
- asm ("clr.l %a6"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("mov.l %fp,-(%sp)");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("mov.l (%sp),%fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clr.w -(%sp)"); \
- asm ("pea 10(%sp)"); \
- asm ("movm.l &0xfffe,-(%sp)"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subi.l &8,28(%sp)"); \
- asm ("mov.m (%sp),&0xffff"); \
- asm ("rte"); }
-
-#endif /* HPUX_ASM */
diff --git a/gdb/xm-i386mach.h b/gdb/xm-i386mach.h
deleted file mode 100644
index 244361b..0000000
--- a/gdb/xm-i386mach.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Definitions to make GDB run on Mach on an Intel 386
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-/* Avoid "INT_MIN redefined" warnings -- by defining it here, exactly
- the same as in the system <machine/machtypes.h> file. */
-#undef INT_MIN
-#define INT_MIN 0x80000000
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
-
-#define BROKEN_LARGE_ALLOCA
-
-/* Do implement the attach and detach commands. */
-/* #define ATTACH_DETACH 1 */
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-#define PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
diff --git a/gdb/xm-i386sco.h b/gdb/xm-i386sco.h
deleted file mode 100644
index d9d2b9e..0000000
--- a/gdb/xm-i386sco.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Macro defintions for i386, running SCO Unix System V/386 3.2.
- Copyright (C) 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "xm-i386v.h"
-
-/* Apparently there is inconsistency among various System V's about what
- the name of this field is. */
-#define U_FPSTATE(u) u.u_fps.u_fpstate
-
-/* TIOCGETC is defined in System V 3.2 termio.h, but struct tchars
- is not. This makes problems for inflow.c. */
-#define TIOCGETC_BROKEN
-
-/* All the job control definitions exist in SCO Unix, but the standard
- shells don't use them. So we must disable job control. */
-/* This is no longer true with 3.2v2 and later */
-/* #define NO_JOB_CONTROL */
-
-/* SCO's assembler doesn't grok dollar signs in identifiers.
- So we use dots instead. This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-#define HAVE_STRSTR
diff --git a/gdb/xm-i386v.h b/gdb/xm-i386v.h
deleted file mode 100644
index 589d709..0000000
--- a/gdb/xm-i386v.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Macro defintions for i386.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu)
- * July 1988
- */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-/* I'm running gdb 3.4 under 386/ix 2.0.2, which is a derivative of AT&T's
-Sys V/386 3.2.
-
-On some machines, gdb crashes when it's starting up while calling the
-vendor's termio tgetent() routine. It always works when run under
-itself (actually, under 3.2, it's not an infinitely recursive bug.)
-After some poking around, it appears that depending on the environment
-size, or whether you're running YP, or the phase of the moon or something,
-the stack is not always long-aligned when main() is called, and tgetent()
-takes strong offense at that. On some machines this bug never appears, but
-on those where it does, it occurs quite reliably. */
-#define ALIGN_STACK_ON_STARTUP
-
-/* define USG if you are using sys5 /usr/include's */
-#define USG
-
-/* USG systems need these */
-#define vfork() fork()
-#define MAXPATHLEN 500
-
-#define HAVE_TERMIO
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-/* #define SET_STACK_LIMIT_HUGE not in sys5 */
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR 0xe0000000
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- (addr) = i386_register_u_addr ((blockend),(regno));
-
-#if 0
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0}
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) {}
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR {}
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR {}
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS {}
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS {}
-#endif /* 0 */
diff --git a/gdb/xm-i386v32.h b/gdb/xm-i386v32.h
deleted file mode 100644
index 4a6932a..0000000
--- a/gdb/xm-i386v32.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Macro defintions for i386, running System V 3.2.
- Copyright (C) 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "xm-i386v.h"
-
-/* Apparently there is inconsistency among various System V's about what
- the name of this field is. */
-#define U_FPSTATE(u) u.u_fps.u_fpstate
-
-/* TIOCGETC is defined in System V 3.2 termio.h, but struct tchars
- is not. This makes problems for inflow.c. */
-#define TIOCGETC_BROKEN
diff --git a/gdb/xm-irix3.h b/gdb/xm-irix3.h
deleted file mode 100644
index e155a41..0000000
--- a/gdb/xm-irix3.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This is for the iris. */
-
-#define HAVE_TERMIO
-
-#define U_REGS_OFFSET 0
-
-#include "xm-bigmips.h"
-
-/* Override register locations in upage for SGI machines */
-#undef REGISTER_U_ADDR
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- if (regno < PC_REGNUM) \
- addr = regno; \
- else \
- addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */
-
-/* Don't need special routines for the SGI -- we can use infptrace.c */
-#undef FETCH_INFERIOR_REGISTERS
diff --git a/gdb/xm-isi.h b/gdb/xm-isi.h
deleted file mode 100644
index e26cb95..0000000
--- a/gdb/xm-isi.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Definitions to make GDB run on an ISI Optimum V (3.05) under 4.3bsd.
- Copyright (C) 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* This has not been tested on ISI's running BSD 4.2, but it will probably
- work. */
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-/*#define KERNEL_U_ADDR 0x10800000*/
-#define KERNEL_U_ADDR 0
-
-/* expects blockend to be u.u_ar0 */
-extern int rloc[]; /* Defined in isi-dep.c */
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ blockend &= UPAGES*NBPG - 1; \
- if (regno < 18) addr = (int)blockend + rloc[regno]*4; \
- else if (regno < 26) addr = (int) &((struct user *)0)->u_68881_regs \
- + (regno - 18) * 12; \
- else if (regno < 29) addr = (int) &((struct user *)0)->u_68881_regs \
- + 8 * 12 + (regno - 26) * 4; \
-}
-
-/* Compensate for lack of `vprintf' function. */
-#define MISSING_VPRINTF
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movl $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel fp, -(sp)");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea 10(sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
diff --git a/gdb/xm-m68k.h b/gdb/xm-m68k.h
deleted file mode 100644
index f417e97..0000000
--- a/gdb/xm-m68k.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Macro definitions for running gdb on host machines with m68k cpu's.
- Copyright (C) 1991, Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support (fnf@cygint)
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
diff --git a/gdb/xm-m88k.h b/gdb/xm-m88k.h
deleted file mode 100644
index bad91f8..0000000
--- a/gdb/xm-m88k.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Host-machine dependent parameters for Motorola 88000, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-#if !defined (USG)
-#define USG 1
-#endif
-
-#include <sys/param.h>
-
-#ifdef __GNUC__
-#define memcpy __builtin_memcpy
-/* gcc doesn't have this, at least not gcc 1.92. */
-/* #define memset __builtin_memset */
-#define strcmp __builtin_strcmp
-#endif
-
-#ifdef DGUX
-#define x_foff _x_x._x_offset
-#define x_fname _x_name
-#define USER ptrace_user
-#define _BSD_WAIT_FLAVOR
-#endif
-
-#define HAVE_TERMIO
-
-#ifndef USIZE
-#define USIZE 2048
-#endif
-#define NBPG NBPC
-#define UPAGES USIZE
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-/* Since registers r0 through r31 are stored directly in the struct ptrace_user,
- (for m88k BCS)
- the ptrace_user offsets are sufficient and KERNEL_U_ADDRESS can be 0 */
-
-#define KERNEL_U_ADDR 0
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- (addr) = m88k_register_u_addr ((blockend),(regno));
-
-#define FETCH_INFERIOR_REGISTERS
diff --git a/gdb/xm-merlin.h b/gdb/xm-merlin.h
deleted file mode 100644
index 0564f0d..0000000
--- a/gdb/xm-merlin.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Definitions to make GDB run on a merlin under utek 2.1
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This machine doesn't have the siginterrupt call. */
-#define NO_SIGINTERRUPT
-
-/* Under Utek, a ptrace'd process can be the only active process for
- an executable. Therefore instead of /bin/sh use gdb-sh (which should
- just be a copy of /bin/sh which is world readable and writeable). */
-#define SHELL_FILE "/usr/gnu/lib/gdb-sh"
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR (0xfef000)
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ \
- switch (regno) { \
- case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: \
- addr = blockend + (R0 - regno) * sizeof (int); break; \
- case PC_REGNUM: \
- addr = blockend + PC * sizeof (int); break; \
- case SP_REGNUM: \
- addr = blockend + SP * sizeof (int); break; \
- case FP_REGNUM: \
- addr = blockend + FP * sizeof (int); break; \
- case PS_REGNUM: \
- addr = blockend + 12 * sizeof (int); break; \
- case FPS_REGNUM: \
- addr = 108; break; \
- case FP0_REGNUM + 0: case FP0_REGNUM + 1: \
- case FP0_REGNUM + 2: case FP0_REGNUM + 3: \
- case FP0_REGNUM + 4: case FP0_REGNUM + 5: \
- case FP0_REGNUM + 6: case FP0_REGNUM + 7: \
- addr = 76 + (regno - FP0_REGNUM) * sizeof (float); break; \
- case LP0_REGNUM + 0: case LP0_REGNUM + 1: \
- case LP0_REGNUM + 2: case LP0_REGNUM + 3: \
- addr = 76 + (regno - LP0_REGNUM) * sizeof (double); break; \
- default: \
- printf ("bad argument to REGISTER_U_ADDR %d\n", regno); \
- abort (); \
- } \
-}
-
-/* Compensate for lack of `vprintf' function. */
-#define MISSING_VPRINTF
-
-#if 0
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
- 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0}
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movl $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("pushl fp");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("pushl 8(sp)"); \
- asm ("pushl 8(sp)"); \
- asm ("pushal 0x14(sp)"); \
- asm ("pushr $037777"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("popr $037777"); \
- asm ("subl2 $8,(sp)"); \
- asm ("movl (sp),sp"); \
- asm ("rei"); }
-#endif /* 0 */
diff --git a/gdb/xm-mips.h b/gdb/xm-mips.h
deleted file mode 100644
index ff2bebf..0000000
--- a/gdb/xm-mips.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Definitions to make GDB run on a mips box under 4.3bsd.
- Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
- Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
- and by Alessandro Forin(af@cs.cmu.edu) at CMU
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#if !defined (HOST_BYTE_ORDER)
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-#endif
-
-/* Get rid of any system-imposed stack limit if possible */
-
-#define SET_STACK_LIMIT_HUGE
-
-#define KERNEL_U_ADDR 0 /* Not needed. */
-
-/* Only used for core files on DECstations. */
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\
- else addr = 0; /* ..somewhere in the pcb */
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */
-#define ONE_PROCESS_WRITETEXT
diff --git a/gdb/xm-news.h b/gdb/xm-news.h
deleted file mode 100644
index eae0248..0000000
--- a/gdb/xm-news.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
- Copyright (C) 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-#define HAVE_WAIT_STRUCT
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* We can't use "isatty" or "fileno" on this machine. This isn't good,
- but it will have to do. */
-#define ISATTY(FP) ((FP) == stdin || (FP) == stdout)
-
-/* THis is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR UADDR
-
-/* The offsets in this macro are from /usr/include/machine/reg.h */
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ static char offsets[] = { \
- /*d0-d7:*/1,2,3,4,5,6,7,8, \
- /*a0-a6:*/9,10,11,12,13,14,15, /*sp:*/-4, /*ps:*/0, /*pc:*/-1, \
- /*fp0-fp7:*/19,22,25,28,31,34,37,40, /*fpc:*/16,17,18 }; \
- addr = blockend + 4 * offsets[regno]; \
-}
-
-/* Compensate for lack of `vprintf' function. */
-#define MISSING_VPRINTF
-
-/* NewsOS 3 apparently dies on large alloca's -- roland@ai.mit.edu. */
-#define BROKEN_LARGE_ALLOCA
-
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Use GNU assembler instead of standard assembler */
-#define USE_GAS
-
-/* Motorola assembly format */
-#ifndef USE_GAS
-#define MOTOROLA
-#endif
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#ifdef MOTOROLA
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("move.l $ end, sp"); \
- asm ("clr.l fp"); }
-#else
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel $ end, sp"); \
- asm ("clrl fp"); }
-#endif
-
-/* Push the frame pointer register on the stack. */
-#ifdef MOTOROLA
-#define PUSH_FRAME_PTR \
- asm ("move.l fp, -(sp)");
-#else
-#define PUSH_FRAME_PTR \
- asm ("movel fp, -(sp)");
-#endif
-
-/* Copy the top-of-stack to the frame pointer register. */
-#ifdef MOTOROLA
-#define POP_FRAME_PTR \
- asm ("move.l (sp), fp");
-#else
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-#endif
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#ifdef MOTOROLA
-#define PUSH_REGISTERS \
-{ asm ("clr.w -(sp)"); \
- asm ("pea (10,sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-#else
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea 10(sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-#endif
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#ifdef MOTOROLA
-#define POP_REGISTERS \
-{ asm ("subi.l $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
-#else
-#define POP_REGISTERS \
-{ asm ("subil $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
-#endif
diff --git a/gdb/xm-news1000.h b/gdb/xm-news1000.h
deleted file mode 100644
index 58671c5..0000000
--- a/gdb/xm-news1000.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Parameters for a Sony/NEWS series 1000 with News-OS version 3,
- for GDB, the GNU debugger.
- Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* This is required by Sony include files like <sys/user.h> so we
- get the right offset into the u area. Relying on the compiler
- to define this only works for cc, not gcc. */
-#undef mc68030
-#define mc68030
-#include "xm-news.h"
diff --git a/gdb/xm-np1.h b/gdb/xm-np1.h
deleted file mode 100644
index 8d3bf40..0000000
--- a/gdb/xm-np1.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Parameters for execution on a Gould NP1, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* Get rid of any system-imposed stack limit if possible. */
-#define SET_STACK_LIMIT_HUGE
-
-/* Address of U in kernel space */
-#define KERNEL_U_ADDR 0x7fffc000
-
-/* This is a piece of magic that is given a register number REGNO
- and as BLOCKEND the address in the system of the end of the user structure
- and stores in ADDR the address in the kernel or core dump
- of that register. */
-#define REGISTER_U_ADDR(addr, blockend, regno) { \
- addr = blockend + regno * 4; \
- if (regno == VE_REGNUM) addr = blockend - 9 * 4; \
- if (regno == PC_REGNUM) addr = blockend - 8 * 4; \
- if (regno == PS_REGNUM) addr = blockend - 7 * 4; \
- if (regno == FP_REGNUM) addr = blockend - 6 * 4; \
- if (regno >= V1_REGNUM) \
- addr = blockend + 16 * 4 + (regno - V1_REGNUM) * VR_SIZE; \
-}
-
-/* Don't try to write the frame pointer. */
-#define CANNOT_STORE_REGISTER(regno) ((regno) == FP_REGNUM)
-
-#define MISSING_VPRINTF
-
-/*
- * No KDB support, Yet! */
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel fp, -(sp)");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea 10(sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
diff --git a/gdb/xm-pn.h b/gdb/xm-pn.h
deleted file mode 100644
index d180b6e..0000000
--- a/gdb/xm-pn.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Parameters for execution on a Gould PN, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* Get rid of any system-imposed stack limit if possible. */
-#define SET_STACK_LIMIT_HUGE
-
-#define MISSING_VPRINTF
-
-/* Address of U in kernel space */
-#define KERNEL_U_ADDR 0x3fc000
-
-/* This is a piece of magic that is given a register number REGNO
- and as BLOCKEND the address in the system of the end of the user structure
- and stores in ADDR the address in the kernel or core dump
- of that register. */
-#define REGISTER_U_ADDR(addr, blockend, regno) { \
- addr = blockend + regno * 4; \
- if (regno == PC_REGNUM) addr = blockend - 8 * 4; \
- if (regno == PS_REGNUM) addr = blockend - 7 * 4; \
- if (regno == SP_REGNUM) addr = blockend - 6 * 4; \
-}
-
-/* No KDB support, Yet! */
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel fp, -(sp)");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea 10(sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
diff --git a/gdb/xm-pyr.h b/gdb/xm-pyr.h
deleted file mode 100644
index 21924df..0000000
--- a/gdb/xm-pyr.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Definitions to make GDB run on a Pyramidax under OSx 4.0 (4.2bsd).
- Copyright (C) 1988, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* Define PYRAMID_CONTROL_FRAME_DEBUGGING to get copious messages
- about reading the control stack on standard output. This
- makes gdb unusable as a debugger. */
-
-/* #define PYRAMID_CONTROL_FRAME_DEBUGGING */
-
-/* Define PYRAMID_FRAME_DEBUGGING for ? */
-
-/* use Pyramid's slightly strange ptrace */
-#define PYRAMID_PTRACE
-
-/* Traditional Unix virtual address spaces have thre regions: text,
- data and stack. The text, initialised data, and uninitialised data
- are represented in separate segments of the a.out file.
- When a process dumps core, the data and stack regions are written
- to a core file. This gives a debugger enough information to
- reconstruct (and debug) the virtual address space at the time of
- the coredump.
- Pyramids have an distinct fourth region of the virtual address
- space, in which the contents of the windowed registers are stacked
- in fixed-size frames. Pyramid refer to this region as the control
- stack. Each call (or trap) automatically allocates a new register
- frame; each return deallocates the current frame and restores the
- windowed registers to their values before the call.
-
- When dumping core, the control stack is written to a core files as
- a third segment. The core-handling functions need to know to deal
- with it. */
-
-/* Tell dep.c what the extra segment is. */
-#define PYRAMID_CORE
-
-#define NO_SIGINTERRUPT
-
-#define HAVE_WAIT_STRUCT
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
-
-/* Define offsets of registers in the core file (or maybe u area) */
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ struct user __u; \
- addr = blockend + (regno - 16 ) * 4; \
- if (regno == 67) { \
- printf("\\geting reg 67\\"); \
- addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \
- } else if (regno == KSP_REGNUM) { \
- printf("\\geting KSP (reg %d)\\", KSP_REGNUM); \
- addr = (int)(&__u.u_pcb.pcb_ksp) - (int) &__u; \
- } else if (regno == CSP_REGNUM) { \
- printf("\\geting CSP (reg %d\\",CSP_REGNUM); \
- addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \
- } else if (regno == 64) { \
- printf("\\geting reg 64\\"); \
- addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \
- } else if (regno == PS_REGNUM) \
- addr = blockend - 4; \
- else if (1 && ((16 > regno) && (regno > 11))) \
- addr = last_frame_offset + (4 *(regno+32)); \
- else if (0 && (12 > regno)) \
- addr = global_reg_offset + (4 *regno); \
- else if (16 > regno) \
- addr = global_reg_offset + (4 *regno); \
- else \
- addr = blockend + (regno - 16 ) * 4; \
-}
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-/* Compensate for lack of `vprintf' function. */
-#define MISSING_VPRINTF
-
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* I have *no idea* how to debug OSx kernels, so this
- is flushed, possible forever. */
diff --git a/gdb/xm-rs6000.h b/gdb/xm-rs6000.h
deleted file mode 100644
index 2c0c101..0000000
--- a/gdb/xm-rs6000.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Parameters for hosting on an RS6000, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
- Contributed by IBM Corporation.
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Big end is at the low address */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-#define HAVE_TERMIO 1
-#define USG 1
-#define HAVE_SIGSETMASK 1
-
-/* This system requires that we open a terminal with O_NOCTTY for it to
- not become our controlling terminal. */
-
-#define USE_O_NOCTTY
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* Brain death inherited from PC's pervades. */
-#undef NULL
-#define NULL 0
-
-/* The IBM compiler requires this in order to properly compile alloca(). */
-#pragma alloca
-
-#define vfork fork
-
-/* Do implement the attach and detach commands. */
-
-#define ATTACH_DETACH
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-
-#define FETCH_INFERIOR_REGISTERS
-
-/* Setpgrp() takes arguments, unlike ordinary Sys V's. */
-
-#define SETPGRP_ARGS
-
-/* RS6000/AIXCOFF does not support PT_STEP. Has to be simulated. */
-
-#define NO_SINGLE_STEP
-
-/* Interface between xcoff symbol reading code and AIX shared library
- handling code. FIXME, this probably needs generalizing. */
-
-#define XCOFF_INIT_LOADINFO() xcoff_init_loadinfo()
-#define XCOFF_ADD_TOC_TO_LOADINFO(x) xcoff_add_toc_to_loadinfo (x)
diff --git a/gdb/xm-rtbsd.h b/gdb/xm-rtbsd.h
deleted file mode 100644
index 109d0ad..0000000
--- a/gdb/xm-rtbsd.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Definitions to host GDB on an IBM RT/PC running BSD Unix.
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
- Contributed by David Wood @ New York University (wood@lab.ultra.nyu.edu).
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Get rid of any system-imposed stack limit if possible. */
-#define SET_STACK_LIMIT_HUGE
-
-/* This machine is most significant byte first */
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* This OS has the wait structure */
-#define HAVE_WAIT_STRUCT
-
-/* This unix does not have a libc with vprintf */
-#define MISSING_VPRINTF
-
-#ifdef HOSTING_ONLY
-/*
- * This next two defines are to get GDB up and running as a host to
- * do remote debugging. I know there is a gdb for the RT, but there wasn't
- * an xconfig/rt* file.
- */
-#define KERNEL_U_ADDR_BSD /* This may be correct, but hasn't been tested */
-#define REGISTER_U_ADDR(a,b,c) \
- (printf("GDB can not debug IBM RT/PC BSD executables (yet)\n"),\
- quit(),0)
-#else
-# include "GDB for the RT is not included in the distribution"
-#endif
-
diff --git a/gdb/xm-sparc.h b/gdb/xm-sparc.h
deleted file mode 100644
index cbdac01..0000000
--- a/gdb/xm-sparc.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Parameters for execution on a Sun 4, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
- Contributed by Michael Tiemann (tiemann@mcc.com)
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* Enable use of alternate code for Sun's format of core dump file. */
-
-#define NEW_SUN_CORE
-
-/* Do implement the attach and detach commands. */
-
-#define ATTACH_DETACH
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-
-#define FETCH_INFERIOR_REGISTERS
-
-/* Before storing, we need to read all the registers. */
-
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
-
-/* It does have a wait structure, and it might help things out . . . */
-
-#define HAVE_WAIT_STRUCT
-
-/* Optimization for storing registers to the inferior. The hook
- DO_DEFERRED_STORES
- actually executes any deferred stores. It is called any time
- we are going to proceed the child, or read its registers.
- The hook CLEAR_DEFERRED_STORES is called when we want to throw
- away the inferior process, e.g. when it dies or we kill it.
- FIXME, this does not handle remote debugging cleanly. */
-
-extern int deferred_stores;
-extern int store_inferior_registers ();
-#define DO_DEFERRED_STORES \
- if (deferred_stores) \
- store_inferior_registers (-2);
-#define CLEAR_DEFERRED_STORES \
- deferred_stores = 0;
diff --git a/gdb/xm-sun2.h b/gdb/xm-sun2.h
deleted file mode 100644
index aac1cb8..0000000
--- a/gdb/xm-sun2.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Parameters for execution on a Sun, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR 0x2800
-
-/* Enable use of alternate code for Sun's format of core dump file. */
-
-#define NEW_SUN_CORE
-
-/* Do implement the attach and detach commands. */
-
-#define ATTACH_DETACH
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-/* This is a piece of magic that is given a register number REGNO
- and as BLOCKEND the address in the system of the end of the user structure
- and stores in ADDR the address in the kernel or core dump
- of that register. */
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ addr = blockend + regno * 4; }
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel fp, -(sp)");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea 10(sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
diff --git a/gdb/xm-sun3.h b/gdb/xm-sun3.h
deleted file mode 100644
index bd5eeaa..0000000
--- a/gdb/xm-sun3.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Parameters for execution on a Sun, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* Enable use of alternate code for Sun's format of core dump file. */
-
-#define NEW_SUN_CORE
-
-/* Do implement the attach and detach commands. */
-
-#define ATTACH_DETACH
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-
-#define FETCH_INFERIOR_REGISTERS
-
-/* We have to grab the regs since we store all regs at once. */
-
-#define CHILD_PREPARE_TO_STORE() \
- read_register_bytes (0, (char *)NULL, REGISTER_BYTES)
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel #end, sp"); \
- asm ("movel #0,a6"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel a6,sp@-");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl sp@,a6");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea sp@(10)"); \
- asm ("movem #0xfffe,sp@-"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil #8,sp@(28)"); \
- asm ("movem sp@,#0xffff"); \
- asm ("rte"); }
diff --git a/gdb/xm-sun386.h b/gdb/xm-sun386.h
deleted file mode 100644
index aea5763..0000000
--- a/gdb/xm-sun386.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Parameters for execution on a Sun 386i, for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-/* If I do this on SunOS 4.0.1, I get SIGSEGV's on (some) instructions which
- try to access the stack. */
-/* #define SET_STACK_LIMIT_HUGE */
-
-#define BROKEN_LARGE_ALLOCA
-
-/* Enable use of alternate code for Sun's format of core dump file. */
-
-#define NEW_SUN_CORE
-
-/* Do implement the attach and detach commands. */
-
-#define ATTACH_DETACH
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-#define PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
diff --git a/gdb/xm-sun3os4.h b/gdb/xm-sun3os4.h
deleted file mode 100644
index d7d1c95..0000000
--- a/gdb/xm-sun3os4.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Macro definitions for a sun 3 running os 4.
- Copyright (C) 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "xm-sun3.h"
-#define FPU
-
-/* Large alloca's fail because the attempt to increase the stack limit in
- main() fails because shared libraries are allocated just below the initial
- stack limit. The SunOS kernel will not allow the stack to grow into
- the area occupied by the shared libraries. Sun knows about this bug
- but has no obvious fix for it. */
-#define BROKEN_LARGE_ALLOCA
diff --git a/gdb/xm-sun4os4.h b/gdb/xm-sun4os4.h
deleted file mode 100644
index 75f1037..0000000
--- a/gdb/xm-sun4os4.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Macro definitions for running gdb on a Sun 4 running sunos 4.
- Copyright (C) 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "xm-sparc.h"
-#define FPU
-
-/* Large alloca's fail because the attempt to increase the stack limit in
- main() fails because shared libraries are allocated just below the initial
- stack limit. The SunOS kernel will not allow the stack to grow into
- the area occupied by the shared libraries. Sun knows about this bug
- but has no obvious fix for it. */
-#define BROKEN_LARGE_ALLOCA
diff --git a/gdb/xm-svr4.h b/gdb/xm-svr4.h
deleted file mode 100755
index f4c4a53..0000000
--- a/gdb/xm-svr4.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Definitions for running gdb on a host machine running any flavor of SVR4.
- Copyright (C) 1991, Free Software Foundation, Inc.
- Written by Fred Fish at Cygnus Support (fnf@cygint)
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* SVR4 has /proc support, so use it instead of ptrace. */
-
-#define USE_PROC_FS
-
-/* SVR4 has termio facilities. */
-
-#define HAVE_TERMIO
-
-/* TIOCGETC and TIOCGLTC are picked up somewhere, but struct tchars
- and struct ltchars are not. This makes problems for inflow.c.
- It is unknown at this time if this is a generic SVR4 problem or
- one just limited to the initial SVR4 port host machine. */
-
-#define TIOCGETC_BROKEN
-#define TIOCGLTC_BROKEN
-
-/* SVR4 is a derivative of System V Release 3 (USG) */
-
-#define USG
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-/* #define SET_STACK_LIMIT_HUGE */
-
-/* SVR4 machines can easily do attach and detach via /proc (procfs.c)
- support */
-
-#define ATTACH_DETACH
-
-/* If we are using SVR4 /proc instead of ptrace, use CREATE_INFERIOR_HOOK
- to do internal /proc initialization. */
-
-#ifdef USE_PROC_FS
-#define CREATE_INFERIOR_HOOK(pid) inferior_proc_init(pid)
-#endif
-
diff --git a/gdb/xm-symmetry.h b/gdb/xm-symmetry.h
deleted file mode 100644
index 4e1aeac..0000000
--- a/gdb/xm-symmetry.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/* Definitions to make GDB run on a Sequent Symmetry under dynix 3.0,
- with Weitek 1167 and i387 support.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Symmetry version by Jay Vosburgh (uunet!sequent!fubar) */
-
-/* This machine doesn't have the siginterrupt call. */
-#define NO_SIGINTERRUPT
-
-#define HAVE_WAIT_STRUCT
-
-/* XPT_DEBUG doesn't work yet under Dynix 3.0.12, but UNDEBUG does... */
-/* #define PTRACE_ATTACH XPT_DEBUG
-#define PTRACE_DETACH XPT_UNDEBUG
-#define ATTACH_DETACH */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
-
-/* The magic numbers below are offsets into u_ar0 in the user struct.
- They live in <machine/reg.h>. Gdb calls this macro with blockend
- holding u.u_ar0 - KERNEL_U_ADDR. Only the registers listed are
- saved in the u area (along with a few others that aren't useful
- here. See <machine/reg.h>). */
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ struct user foo; /* needed for finding fpu regs */ \
-switch (regno) { \
- case 0: \
- addr = blockend + EAX * sizeof(int); break; \
- case 1: \
- addr = blockend + EDX * sizeof(int); break; \
- case 2: \
- addr = blockend + ECX * sizeof(int); break; \
- case 3: /* st(0) */ \
- addr = blockend - \
- ((int)&foo.u_fpusave.fpu_stack[0][0] - (int)&foo); \
- break; \
- case 4: /* st(1) */ \
- addr = blockend - \
- ((int) &foo.u_fpusave.fpu_stack[1][0] - (int)&foo); \
- break; \
- case 5: \
- addr = blockend + EBX * sizeof(int); break; \
- case 6: \
- addr = blockend + ESI * sizeof(int); break; \
- case 7: \
- addr = blockend + EDI * sizeof(int); break; \
- case 8: /* st(2) */ \
- addr = blockend - \
- ((int) &foo.u_fpusave.fpu_stack[2][0] - (int)&foo); \
- break; \
- case 9: /* st(3) */ \
- addr = blockend - \
- ((int) &foo.u_fpusave.fpu_stack[3][0] - (int)&foo); \
- break; \
- case 10: /* st(4) */ \
- addr = blockend - \
- ((int) &foo.u_fpusave.fpu_stack[4][0] - (int)&foo); \
- break; \
- case 11: /* st(5) */ \
- addr = blockend - \
- ((int) &foo.u_fpusave.fpu_stack[5][0] - (int)&foo); \
- break; \
- case 12: /* st(6) */ \
- addr = blockend - \
- ((int) &foo.u_fpusave.fpu_stack[6][0] - (int)&foo); \
- break; \
- case 13: /* st(7) */ \
- addr = blockend - \
- ((int) &foo.u_fpusave.fpu_stack[7][0] - (int)&foo); \
- break; \
- case 14: \
- addr = blockend + ESP * sizeof(int); break; \
- case 15: \
- addr = blockend + EBP * sizeof(int); break; \
- case 16: \
- addr = blockend + EIP * sizeof(int); break; \
- case 17: \
- addr = blockend + FLAGS * sizeof(int); break; \
- case 18: /* fp1 */ \
- case 19: /* fp2 */ \
- case 20: /* fp3 */ \
- case 21: /* fp4 */ \
- case 22: /* fp5 */ \
- case 23: /* fp6 */ \
- case 24: /* fp7 */ \
- case 25: /* fp8 */ \
- case 26: /* fp9 */ \
- case 27: /* fp10 */ \
- case 28: /* fp11 */ \
- case 29: /* fp12 */ \
- case 30: /* fp13 */ \
- case 31: /* fp14 */ \
- case 32: /* fp15 */ \
- case 33: /* fp16 */ \
- case 34: /* fp17 */ \
- case 35: /* fp18 */ \
- case 36: /* fp19 */ \
- case 37: /* fp20 */ \
- case 38: /* fp21 */ \
- case 39: /* fp22 */ \
- case 40: /* fp23 */ \
- case 41: /* fp24 */ \
- case 42: /* fp25 */ \
- case 43: /* fp26 */ \
- case 44: /* fp27 */ \
- case 45: /* fp28 */ \
- case 46: /* fp29 */ \
- case 47: /* fp30 */ \
- case 48: /* fp31 */ \
- addr = blockend - \
- ((int) &foo.u_fpasave.fpa_regs[(regno)-18] - (int)&foo); \
- } \
-}
-
-/* Compensate for lack of `vprintf' function. */
-
-#define MISSING_VPRINTF
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-
-#define FETCH_INFERIOR_REGISTERS
-
-/* We must fetch all the regs before storing, since we store all at once. */
-
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
-
-/* Interface definitions for kernel debugger KDB. */
-/* This doesn't work... */
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
- 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0}
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movl $ end, %esp"); \
- asm ("movl %ebp, $0"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("pushl %ebp");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (%esp), %ebp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm("pushad"); }
-/*
-{ asm("pushl %eax"); \
- asm("pushl %edx"); \
- asm("pushl %ecx"); \
- asm("pushl %st(0)"); \
- asm("pushl %st(1)"); \
- asm("pushl %ebx"); \
- asm("pushl %esi"); \
- asm("pushl %edi"); \
- asm("pushl %st(2)"); \
- asm("pushl %st(3)"); \
- asm("pushl %st(4)"); \
- asm("pushl %st(5)"); \
- asm("pushl %st(6)"); \
- asm("pushl %st(7)"); \
- asm("pushl %esp"); \
- asm("pushl %ebp"); \
- asm("pushl %eip"); \
- asm("pushl %eflags"); \
- asm("pushl %fp1"); \
- asm("pushl %fp2"); \
- asm("pushl %fp3"); \
- asm("pushl %fp4"); \
- asm("pushl %fp5"); \
- asm("pushl %fp6"); \
- asm("pushl %fp7"); \
- asm("pushl %fp8"); \
- asm("pushl %fp9"); \
- asm("pushl %fp10"); \
- asm("pushl %fp11"); \
- asm("pushl %fp12"); \
- asm("pushl %fp13"); \
- asm("pushl %fp14"); \
- asm("pushl %fp15"); \
- asm("pushl %fp16"); \
- asm("pushl %fp17"); \
- asm("pushl %fp18"); \
- asm("pushl %fp19"); \
- asm("pushl %fp20"); \
- asm("pushl %fp21"); \
- asm("pushl %fp22"); \
- asm("pushl %fp23"); \
- asm("pushl %fp24"); \
- asm("pushl %fp25"); \
- asm("pushl %fp26"); \
- asm("pushl %fp27"); \
- asm("pushl %fp28"); \
- asm("pushl %fp29"); \
- asm("pushl %fp30"); \
- asm("pushl %fp31"); \
-}
-*/
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("popad"); }
diff --git a/gdb/xm-tahoe.h b/gdb/xm-tahoe.h
deleted file mode 100644
index d18d683..0000000
--- a/gdb/xm-tahoe.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Definitions to make GDB hosted on a tahoe running 4.3-Reno
- Copyright (C) 1986, 1987, 1989, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/*
- * Ported by the State University of New York at Buffalo by the Distributed
- * Computer Systems Lab, Department of Computer Science, 1991.
- */
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ addr = blockend - 100 + regno * 4; \
- if (regno == PC_REGNUM) addr = blockend - 8; \
- if (regno == PS_REGNUM) addr = blockend - 4; \
- if (regno == FP_REGNUM) addr = blockend - 40; \
- if (regno == SP_REGNUM) addr = blockend - 36; \
- if (regno == AL_REGNUM) addr = blockend - 20; \
- if (regno == AH_REGNUM) addr = blockend - 24;}
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
- 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0}
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movl $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-
-#define PUSH_FRAME_PTR \
- asm ("pushl fp");
-
-/* Copy the top-of-stack to the frame pointer register. */
-
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("pushl 8(sp)"); \
- asm ("pushl 8(sp)"); \
- asm ("pushal 0x41(sp)"); \
- asm ("pushl r0" ); \
- asm ("pushl r1" ); \
- asm ("pushl r2" ); \
- asm ("pushl r3" ); \
- asm ("pushl r4" ); \
- asm ("pushl r5" ); \
- asm ("pushl r6" ); \
- asm ("pushl r7" ); \
- asm ("pushl r8" ); \
- asm ("pushl r9" ); \
- asm ("pushl r10" ); \
- asm ("pushl r11" ); \
- asm ("pushl r12" ); \
- asm ("pushl fp" ); \
- asm ("pushl sp" ); \
- asm ("pushl pc" ); \
- asm ("pushl ps" ); \
- asm ("pushl aclo" ); \
- asm ("pushl achi" ); \
-}
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ \
- asm ("movl (sp)+, achi"); \
- asm ("movl (sp)+, aclo"); \
- asm ("movl (sp)+, ps"); \
- asm ("movl (sp)+, pc"); \
- asm ("movl (sp)+, sp"); \
- asm ("movl (sp)+, fp"); \
- asm ("movl (sp)+, r12"); \
- asm ("movl (sp)+, r11"); \
- asm ("movl (sp)+, r10"); \
- asm ("movl (sp)+, r9"); \
- asm ("movl (sp)+, r8"); \
- asm ("movl (sp)+, r7"); \
- asm ("movl (sp)+, r6"); \
- asm ("movl (sp)+, r5"); \
- asm ("movl (sp)+, r4"); \
- asm ("movl (sp)+, r3"); \
- asm ("movl (sp)+, r2"); \
- asm ("movl (sp)+, r1"); \
- asm ("movl (sp)+, r0"); \
- asm ("subl2 $8,(sp)"); \
- asm ("movl (sp),sp"); \
- asm ("rei"); }
diff --git a/gdb/xm-ultra3.h b/gdb/xm-ultra3.h
deleted file mode 100644
index 34bd2d2..0000000
--- a/gdb/xm-ultra3.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Host definitions for GDB running on a 29k NYU Ultracomputer
- Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
- Contributed by David Wood (wood@lab.ultra.nyu.edu).
-
-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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Here at NYU we have what we call an ULTRA3 PE board. So
- ifdefs for ULTRA3 are my doing. At this point in time,
- I don't know of any other Unixi running on the 29k. */
-
-#define HOST_BYTE_ORDER BIG_ENDIAN
-
-#define HAVE_WAIT_STRUCT
-
-#ifndef L_SET
-# define L_SET 0 /* set the seek pointer */
-# define L_INCR 1 /* increment the seek pointer */
-# define L_XTND 2 /* extend the file size */
-#endif
-
-#ifndef O_RDONLY
-# define O_RDONLY 0
-# define O_WRONLY 1
-# define O_RDWR 2
-#endif
-
-#ifndef F_OK
-# define R_OK 4
-# define W_OK 2
-# define X_OK 1
-# define F_OK 0
-#endif
-
-/* For dirbuf[] in main.c */
-#ifndef MAXPATHLEN
-#define MAXPATHLEN (1024)
-#endif
-
-/* Get rid of any system-imposed stack limit if possible */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-/* If we ever *do* end up using the standard fetch_inferior_registers,
- this is the right value for U_REGS_OFFSET. */
-#define U_REGS_OFFSET 0
-
-/* System doesn't provide a list of signal names. */
-#define SYS_SIGLIST_MISSING 1
-
-/* System doesn't provide siginterrupt(). */
-#define NO_SIGINTERRUPT
-
-/* System uses a `short' to hold a process group ID. */
-#define SHORT_PGRP
-
-/* No vfork in this system. */
-#define vfork() fork()
diff --git a/gdb/xm-umax.h b/gdb/xm-umax.h
deleted file mode 100644
index 263ac79..0000000
--- a/gdb/xm-umax.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Definitions to make GDB run on an encore under umax 4.2
- Copyright (C) 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-#define HAVE_WAIT_STRUCT
-
-/* Offset of registers within u area. */
-#define U_REGS_OFFSET 0
-
-/* Do implement the attach and detach commands... */
-#define ATTACH_DETACH
-
-/* Doesn't have siginterupt. */
-#define NO_SIGINTERRUPT
-
-/* called from register_addr() -- blockend not used for now */
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ \
- switch (regno) { \
- case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: \
- addr = PU_R0 - (regno * sizeof (int)); break; \
- case SP_REGNUM: \
- addr = PU_SP; break; \
- case PC_REGNUM: \
- addr = PU_PC; break; \
- case FP_REGNUM: \
- addr = PU_FP; break; \
- case PS_REGNUM: \
- addr = PU_PSL; break; \
- case FPS_REGNUM: \
- addr = PU_FSR; break; \
- case FP0_REGNUM + 0: case FP0_REGNUM + 1: \
- case FP0_REGNUM + 2: case FP0_REGNUM + 3: \
- case FP0_REGNUM + 4: case FP0_REGNUM + 5: \
- case FP0_REGNUM + 6: case FP0_REGNUM + 7: \
- addr = PU_F0 + (regno - FP0_REGNUM) * sizeof (float); break; \
- case LP0_REGNUM + 0: case LP0_REGNUM + 1: \
- case LP0_REGNUM + 2: case LP0_REGNUM + 3: \
- addr = PU_F0 + (regno - LP0_REGNUM) * sizeof (double); break; \
- default: \
- printf ("bad argument to REGISTER_U_ADDR %d\n", regno); \
- abort (); \
- } \
-}
-
-/* Compensate for lack of `vprintf' function. */
-#define MISSING_VPRINTF
diff --git a/gdb/xm-vax.h b/gdb/xm-vax.h
deleted file mode 100644
index 9da7306..0000000
--- a/gdb/xm-vax.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Definitions to make GDB run on a vax under 4.2bsd.
- Copyright (C) 1986, 1987, 1989 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define HOST_BYTE_ORDER LITTLE_ENDIAN
-
-/* Get rid of any system-imposed stack limit if possible. */
-
-#define SET_STACK_LIMIT_HUGE
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ addr = blockend - 0110 + regno * 4; \
- if (regno == PC_REGNUM) addr = blockend - 8; \
- if (regno == PS_REGNUM) addr = blockend - 4; \
- if (regno == FP_REGNUM) addr = blockend - 0120; \
- if (regno == AP_REGNUM) addr = blockend - 0124; \
- if (regno == SP_REGNUM) addr = blockend - 20; }
-
-/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */
-#define ONE_PROCESS_WRITETEXT
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
- 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0, 0, 0, 0}
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movl $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("pushl fp");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("pushl 8(sp)"); \
- asm ("pushl 8(sp)"); \
- asm ("pushal 0x14(sp)"); \
- asm ("pushr $037777"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("popr $037777"); \
- asm ("subl2 $8,(sp)"); \
- asm ("movl (sp),sp"); \
- asm ("rei"); }