From 43bbd567f2d928b2628e508ee9c75a3920e26b4d Mon Sep 17 00:00:00 2001 From: "K. Richard Pixley" Date: Tue, 8 Dec 1992 04:59:31 +0000 Subject: [PATCH 1/1] recording file death --- bfd/Makefile | 149 - bfd/aout.c | 1500 ------ bfd/aoutx.c | 0 bfd/archures.h | 35 - bfd/awkscan | 12 - bfd/awkscan-ip | 8 - bfd/awkscan-p | 8 - bfd/bfd.doc | 705 --- bfd/bfd.doc.ps | 4564 ------------------ bfd/bfd.texinfo | 492 -- bfd/blins-p | 8 - bfd/coff-code.h | 2608 ---------- bfd/coffish.h | 601 --- bfd/coffswap.c | 123 - bfd/config.sub | 446 -- bfd/configdos.bat | 6 - bfd/configure | 774 --- bfd/cplus-dem.c | 942 ---- bfd/doc/Makefile | 82 - bfd/doc/awkscan | 12 - bfd/doc/awkscan-ip | 8 - bfd/doc/awkscan-p | 8 - bfd/doc/bfd.info | 67 - bfd/doc/bfdinfo | 1281 ----- bfd/doc/blins-p | 8 - bfd/doc/exfil1-p | 5 - bfd/doc/exfil3-p | 16 - bfd/doc/exfilter | 14 - bfd/doc/exfilter-p | 12 - bfd/doc/exfiltst | 8 - bfd/doc/exmerge | 4 - bfd/doc/intobfd | 13 - bfd/doc/mergecom-p | 5 - bfd/doc/movecom-p | 8 - bfd/doc/scanit | 25 - bfd/doc/scanph | 25 - bfd/doc/sedscript | 85 - bfd/doc/sedscript-p | 63 - bfd/doc/startcom-p | 12 - bfd/doc/tolibbfd | 10 - bfd/doc/tolibcoff | 1 - bfd/doc/unPROTO | 18 - bfd/exfilter | 14 - bfd/exmerge | 4 - bfd/hosts/h-m68kv.h | 51 - bfd/hosts/hp9000.h | 70 - bfd/howto.c | 85 - bfd/intobfd | 11 - bfd/makefile.dos | 334 -- bfd/mergecom-p | 5 - bfd/misc.c | 98 - bfd/misc.h | 93 - bfd/movecom-p | 8 - bfd/obstack.c | 330 -- bfd/obstack.h | 413 -- bfd/opc-sparc.c | 1811 ------- bfd/scanit | 24 - bfd/scanph | 25 - bfd/sedscript | 85 - bfd/sedscript-p | 63 - bfd/sparc-opc.c | 1870 -------- bfd/startcom-p | 12 - bfd/tolibbfd | 4 - bfd/tolibcoff | 1 - bfd/trad-core.h | 28 - bfd/unPROTO | 18 - binutils/binutils.texinfo | 730 --- binutils/config.sub | 446 -- binutils/configdos.bat | 6 - binutils/cplus-dem.c | 934 ---- binutils/makefile.dos | Bin 11006 -> 0 bytes binutils/ostrip.c | 417 -- binutils/strip.c | 362 -- config/mh-solaris2 | 5 - config/mh-svr4 | 6 - config/mt-OSE68000 | 2 - config/mt-OSE68k | 2 - gas/GNUmakefile-host | 6 - gas/Makefile-intel | 146 - gas/Makefile.generic | 586 --- gas/Makefile.loic | 203 - gas/VERSION | 1 - gas/a.out.gnu.h | 351 -- gas/config.sub | 446 -- gas/config/ChangeLog | 289 -- gas/config/a.out.gnu.h | 431 -- gas/config/a.out.h | 150 - gas/config/coff.gnu.h | 783 --- gas/config/ho-a29k.h | 26 - gas/config/ho-cygnus.h | 31 - gas/config/mh-a29k | 1 - gas/config/mh-cygnus | 8 - gas/config/obj-coff-bfd.c | 2114 --------- gas/config/obj-coff-bfd.h | 512 -- gas/config/ranlib.h | 36 - gas/config/signame.h | 43 - gas/config/stab.h | 37 - gas/config/tc-m68kmote.c | 4519 ------------------ gas/config/tc-m68kmote.h | 64 - gas/config/te-motor.h | 4 - gas/config/te-sparc.h | 52 - gas/config/te-unisoft.h | 4 - gas/config/tmake-sun3 | 1 - gas/configdos.bat | 14 - gas/configure | 687 --- gas/configure.was | 340 -- gas/doc/Makefile | 94 - gas/flonum-const.c | 157 - gas/gas-format.el | 79 - gas/makefile.dos | 593 --- gas/objdump.c | 2232 --------- gas/obstack.c | 380 -- gas/obstack.h | 444 -- gas/strerror.c | 61 - gas/strstr.c | 55 - gas/xrealloc.c | 69 - gdb/Makefile | 963 ---- gdb/Makefile.dist | 575 --- gdb/Makefile.sdir | 1 - gdb/Makefile.srcdir | 1 - gdb/WHATS.NEW | 596 --- gdb/a68v-xdep.c | 158 - gdb/ansidecl.h | 93 - gdb/arm-opcode.h | 294 -- gdb/cadillac-patches | 1021 ---- gdb/cadillac.c | 1474 ------ gdb/config.gdb | 180 - gdb/config.status | 1 - gdb/config.sub | 446 -- gdb/config/altosgas.mh | 9 - gdb/config/altosgas.mt | 7 - gdb/config/am29k | 5 - gdb/config/go32.mt | 10 - gdb/config/i386sco.mt | 3 - gdb/config/i386v-g.mh | 7 - gdb/config/i386v-g.mt | 7 - gdb/config/i386v32-g.mh | 7 - gdb/config/i386v32-g.mt | 7 - gdb/config/i386v32.mt | 4 - gdb/config/i960.mt | 5 - gdb/config/mh-vax | 12 - gdb/config/mt-h8300hds | 4 - gdb/config/news1000.mt | 3 - gdb/config/sun3.mh | 3 - gdb/config/sun3.mt | 8 - gdb/config/sun4.mh | 3 - gdb/config/sun4.mt | 3 - gdb/config/sun4os3.mh | 3 - gdb/config/sun4os3.mt | 8 - gdb/config/sun4os5.mh | 29 - gdb/config/sun4os5.mt | 3 - gdb/configure | 882 ---- gdb/convex-opcode.h | 1677 ------- gdb/cplus-dem.c | 2280 --------- gdb/demangle.h | 54 - gdb/doc/Makefile | 111 - gdb/doc/gdb-all.texi | 8437 --------------------------------- gdb/doc/gdb.alter-m4 | 205 - gdb/doc/gdb.bugs-m4 | 221 - gdb/doc/gdb.canned-m4 | 178 - gdb/doc/gdb.cmds-m4 | 160 - gdb/doc/gdb.ctl-m4 | 306 -- gdb/doc/gdb.data-m4 | 926 ---- gdb/doc/gdb.emacs-m4 | 166 - gdb/doc/gdb.files-m4 | 300 -- gdb/doc/gdb.gpl-m4 | 308 -- gdb/doc/gdb.install-m4 | 57 - gdb/doc/gdb.invoc-m4 | 207 - gdb/doc/gdb.rdln-m4 | 7 - gdb/doc/gdb.rename-m4 | 112 - gdb/doc/gdb.run-m4 | 390 -- gdb/doc/gdb.sample-m4 | 263 - gdb/doc/gdb.src-m4 | 288 -- gdb/doc/gdb.stack-m4 | 279 -- gdb/doc/gdb.stop-m4 | 920 ---- gdb/doc/gdb.symb-m4 | 132 - gdb/doc/gdb.tgts-m4 | 192 - gdb/doc/gdb.top-m4 | 451 -- gdb/doc/gdbinv-m.m4 | 13 - gdb/doc/gdbinv-s.m4 | 427 -- gdb/doc/interim-gdb.texinfo | 7901 ------------------------------ gdb/doc/interim-gdbinv-m.m4 | 13 - gdb/doc/interim-gdbinv-s.m4 | 427 -- gdb/doc/rc-cm.tex | 22 - gdb/doc/rc-ps.tex | 30 - gdb/doc/rc-pslong.tex | 30 - gdb/doc/rdl-apps.texi | 2 - gdb/doc/threecol.tex | 46 - gdb/ecoff.c | 336 -- gdb/expread.tab.c | 2948 ------------ gdb/expread.y | 1989 -------- gdb/gdb-int.texinfo | 242 - gdb/getpagesize.h | 25 - gdb/gmalloc.c | 1161 ----- gdb/gmalloc.h | 161 - gdb/go32-nat.c | 35 - gdb/hds-tdep.c | 2 - gdb/hp300hpux-xdep.c | 230 - gdb/hp300ux-xdep.c | 233 - gdb/hppa-coredep.c | 121 - gdb/hppab-xdep.c | 406 -- gdb/hppabsd-core.c | 251 - gdb/hppabsd-tdep.c | 1422 ------ gdb/hppabsd-xdep.c | 413 -- gdb/hppah-xdep.c | 417 -- gdb/hppahpux-tdep.c | 1427 ------ gdb/hppahpux-xdep.c | 424 -- gdb/i386-xdep.c | 250 - gdb/m68k-opcode.h | 1679 ------- gdb/m88k-opcode.h | 585 --- gdb/m88k-xdep.c | 342 -- gdb/mach386-xdep.c | 164 - gdb/mcheck.c | 124 - gdb/mips-opcode.h | 363 -- gdb/mips-xdep.c | 163 - gdb/mmap-alloc.c | 159 - gdb/mmap-sbrk.c | 144 - gdb/mtrace.awk | 36 - gdb/mtrace.c | 146 - gdb/nat-sparc.c | 297 -- gdb/nat-sun4os4.h | 27 - gdb/nat-trash.h | 2 - gdb/np1-opcode.h | 422 -- gdb/obstack.c | 333 -- gdb/obstack.h | 416 -- gdb/param-no-tm.h | 82 - gdb/param.h | 32 - gdb/pn-opcode.h | 282 -- gdb/pyr-opcode.h | 287 -- gdb/rem-m68k.shar | 893 ---- gdb/remote-multi.shar | 1313 ----- gdb/remote-sa.m68k.shar | 893 ---- gdb/remote-ser.c | 794 ---- gdb/remote-vx.68.c | 1539 ------ gdb/rs6000-xdep.c | 281 -- gdb/rs6k-opcode.def | 224 - gdb/rs6k-opcode.h | 236 - gdb/signame.c | 260 - gdb/signame.h | 45 - gdb/sparc-opcode.h | 643 --- gdb/sparc-xdep.c | 302 -- gdb/stab.def | 182 - gdb/stddef.h | 26 - gdb/stdlib.h | 10 - gdb/sun3-xdep.c | 167 - gdb/sun386-xdep.c | 289 -- gdb/symmetry-tdep.c | 494 -- gdb/symmetry-xdep.c | 557 --- gdb/tahoe-opcode.h | 213 - gdb/tdesc.c | 1650 ------- gdb/tdesc.h | 329 -- gdb/tm-altosgas.h | 24 - gdb/tm-hppabsd.h | 6 - gdb/tm-hppahpux.h | 39 - gdb/tm-i386v-g.h | 32 - gdb/tm-sun4os5.h | 54 - gdb/tm-svr4.h | 37 - gdb/tm-vxworks68.h | 48 - gdb/tm-vxworks960.h | 48 - gdb/vax-opcode.h | 382 -- gdb/xm-hppabsd.h | 52 - gdb/xm-hppahpux.h | 46 - gdb/xm-sun4os5.h | 61 - gdb/xm-svr4.h | 56 - ld/Makefile | 201 - ld/PORTING | 152 - ld/config.sub | 446 -- ld/config/OSE68.mt | 1 - ld/config/decstation.mh | 1 - ld/config/h-i386v | 3 - ld/config/h-m68kv | 3 - ld/config/hmake-dec3100 | 2 - ld/config/hmake-dgux | 9 - ld/config/hmake-rtbsd | 7 - ld/config/hmake-sun3 | 9 - ld/config/hmake-sun4 | 8 - ld/config/hmake-sun4-64 | 8 - ld/config/hp300bsd.mh | 8 - ld/config/hp9000.mh | 4 - ld/config/news.mh | 8 - ld/config/sparc.mh | 7 - ld/config/tmake-coff-a29k | 1 - ld/config/tmake-m88k-bcs | 1 - ld/config/tmake-sun4 | 1 - ld/configdos.bat | 6 - ld/cplus-dem.c | 1370 ------ ld/descrip.mms | 83 - ld/ebmon29k.sc | 27 - ld/gld.1 | 1044 ---- ld/h8300hds.c | 135 - ld/h8300hds.sc | 22 - ld/h8300hms.c | 135 - ld/h8300hms.sc | 30 - ld/i386aout.c | 159 - ld/i386aout.sc | 25 - ld/ld-emul.c | 135 - ld/ld-gld-Ur.script | 31 - ld/ld-gld-r.script | 20 - ld/ld-gld.c | 145 - ld/ld-gld.script | 28 - ld/ld-gld68k-Ur.script | 21 - ld/ld-gld68k-r.script | 22 - ld/ld-gld68k.c | 143 - ld/ld-gld68k.script | 28 - ld/ld-gld960.c | 171 - ld/ld-gld960.script | 23 - ld/ld-gldm88kbcs-Ur.script | 31 - ld/ld-gldm88kbcs-r.script | 20 - ld/ld-gldm88kbcs.c | 141 - ld/ld-gldm88kbcs.script | 36 - ld/ld-lnk960-r.script | 17 - ld/ld-lnk960.c | 288 -- ld/ld-lnk960.script | 21 - ld/ld-vanilla.c | 124 - ld/ld.tex | 1014 ---- ld/ldgld.c | 145 - ld/ldgld.sc | 30 - ld/ldgld.script | 30 - ld/ldgld68k.c | 143 - ld/ldgld68k.sc | 30 - ld/ldgld68k.script | 28 - ld/ldgld68kUr.sc | 21 - ld/ldgld68kUr.script | 21 - ld/ldgld68kr.sc | 22 - ld/ldgld68kr.script | 22 - ld/ldgld960.c | 169 - ld/ldgld960.sc | 23 - ld/ldgld960.script | 23 - ld/ldgldUr.sc | 24 - ld/ldgldUr.script | 24 - ld/ldglda29k.c | 144 - ld/ldglda29k.sc | 38 - ld/ldglda29k.script | 38 - ld/ldglda29kUr.sc | 32 - ld/ldglda29kUr.script | 32 - ld/ldglda29kr.sc | 32 - ld/ldglda29kr.script | 32 - ld/ldgldi386v.c | 144 - ld/ldgldi386v.sc | 26 - ld/ldgldi386vUr.sc | 26 - ld/ldgldi386vr.sc | 26 - ld/ldgldm68kv.c | 144 - ld/ldgldm68kv.sc | 24 - ld/ldgldm68kvUr.sc | 24 - ld/ldgldm68kvr.sc | 24 - ld/ldgldm88kbcs.c | 142 - ld/ldgldm88kbcs.sc | 40 - ld/ldgldm88kbcs.script | 40 - ld/ldgldm88kbcsUr.sc | 31 - ld/ldgldm88kbcsUr.script | 31 - ld/ldgldm88kbcsr.sc | 20 - ld/ldgldm88kbcsr.script | 20 - ld/ldgldr.sc | 20 - ld/ldgldr.script | 20 - ld/ldlnk960.c | 287 -- ld/ldlnk960.sc | 21 - ld/ldlnk960.script | 21 - ld/ldlnk960r.sc | 17 - ld/ldlnk960r.script | 17 - ld/ldm88k.c | 142 - ld/ldm88k.sc | 52 - ld/ldm88kUr.sc | 31 - ld/ldm88kr.sc | 20 - ld/ldtemplate | 159 - ld/ldvanilla.c | 118 - ld/makefile.dos | 527 -- ld/news.sc | 30 - ld/saber | 80 - readline/config.sub | 446 -- readline/configure | 623 --- readline/doc/history.info | 514 -- readline/doc/readline.info | 1720 ------- readline/history.texi | 202 - readline/history.texinfo | 194 - readline/inc-hist.texi | 188 - readline/inc-history.texinfo | 188 - readline/inc-read.texi | 490 -- readline/inc-readline.texinfo | 494 -- readline/readline.texi | 442 -- readline/readline.texinfo | 434 -- readline/sysdep-newsos.h | 10 - readline/sysdep-oldbsd.h | 11 - 382 files changed, 120121 deletions(-) delete mode 100755 bfd/Makefile delete mode 100755 bfd/aout.c delete mode 100755 bfd/aoutx.c delete mode 100755 bfd/archures.h delete mode 100755 bfd/awkscan delete mode 100755 bfd/awkscan-ip delete mode 100755 bfd/awkscan-p delete mode 100755 bfd/bfd.doc delete mode 100755 bfd/bfd.doc.ps delete mode 100755 bfd/bfd.texinfo delete mode 100755 bfd/blins-p delete mode 100755 bfd/coff-code.h delete mode 100755 bfd/coffish.h delete mode 100755 bfd/coffswap.c delete mode 100755 bfd/config.sub delete mode 100755 bfd/configdos.bat delete mode 100755 bfd/configure delete mode 100755 bfd/cplus-dem.c delete mode 100755 bfd/doc/Makefile delete mode 100755 bfd/doc/awkscan delete mode 100755 bfd/doc/awkscan-ip delete mode 100755 bfd/doc/awkscan-p delete mode 100644 bfd/doc/bfd.info delete mode 100755 bfd/doc/bfdinfo delete mode 100755 bfd/doc/blins-p delete mode 100755 bfd/doc/exfil1-p delete mode 100755 bfd/doc/exfil3-p delete mode 100755 bfd/doc/exfilter delete mode 100755 bfd/doc/exfilter-p delete mode 100755 bfd/doc/exfiltst delete mode 100755 bfd/doc/exmerge delete mode 100755 bfd/doc/intobfd delete mode 100755 bfd/doc/mergecom-p delete mode 100755 bfd/doc/movecom-p delete mode 100755 bfd/doc/scanit delete mode 100755 bfd/doc/scanph delete mode 100755 bfd/doc/sedscript delete mode 100755 bfd/doc/sedscript-p delete mode 100755 bfd/doc/startcom-p delete mode 100755 bfd/doc/tolibbfd delete mode 100755 bfd/doc/tolibcoff delete mode 100755 bfd/doc/unPROTO delete mode 100755 bfd/exfilter delete mode 100755 bfd/exmerge delete mode 100644 bfd/hosts/h-m68kv.h delete mode 100644 bfd/hosts/hp9000.h delete mode 100755 bfd/howto.c delete mode 100755 bfd/intobfd delete mode 100644 bfd/makefile.dos delete mode 100755 bfd/mergecom-p delete mode 100755 bfd/misc.c delete mode 100755 bfd/misc.h delete mode 100755 bfd/movecom-p delete mode 100755 bfd/obstack.c delete mode 100755 bfd/obstack.h delete mode 100644 bfd/opc-sparc.c delete mode 100755 bfd/scanit delete mode 100755 bfd/scanph delete mode 100755 bfd/sedscript delete mode 100755 bfd/sedscript-p delete mode 100644 bfd/sparc-opc.c delete mode 100755 bfd/startcom-p delete mode 100755 bfd/tolibbfd delete mode 100755 bfd/tolibcoff delete mode 100644 bfd/trad-core.h delete mode 100755 bfd/unPROTO delete mode 100755 binutils/binutils.texinfo delete mode 100755 binutils/config.sub delete mode 100755 binutils/configdos.bat delete mode 100644 binutils/cplus-dem.c delete mode 100755 binutils/makefile.dos delete mode 100755 binutils/ostrip.c delete mode 100755 binutils/strip.c delete mode 100755 config/mh-solaris2 delete mode 100755 config/mh-svr4 delete mode 100755 config/mt-OSE68000 delete mode 100755 config/mt-OSE68k delete mode 100755 gas/GNUmakefile-host delete mode 100755 gas/Makefile-intel delete mode 100755 gas/Makefile.generic delete mode 100755 gas/Makefile.loic delete mode 100755 gas/VERSION delete mode 100755 gas/a.out.gnu.h delete mode 100755 gas/config.sub delete mode 100644 gas/config/ChangeLog delete mode 100755 gas/config/a.out.gnu.h delete mode 100755 gas/config/a.out.h delete mode 100755 gas/config/coff.gnu.h delete mode 100755 gas/config/ho-a29k.h delete mode 100755 gas/config/ho-cygnus.h delete mode 100755 gas/config/mh-a29k delete mode 100755 gas/config/mh-cygnus delete mode 100755 gas/config/obj-coff-bfd.c delete mode 100755 gas/config/obj-coff-bfd.h delete mode 100755 gas/config/ranlib.h delete mode 100755 gas/config/signame.h delete mode 100755 gas/config/stab.h delete mode 100644 gas/config/tc-m68kmote.c delete mode 100644 gas/config/tc-m68kmote.h delete mode 100755 gas/config/te-motor.h delete mode 100755 gas/config/te-sparc.h delete mode 100755 gas/config/te-unisoft.h delete mode 100755 gas/config/tmake-sun3 delete mode 100755 gas/configdos.bat delete mode 100755 gas/configure delete mode 100755 gas/configure.was delete mode 100755 gas/doc/Makefile delete mode 100755 gas/flonum-const.c delete mode 100644 gas/gas-format.el delete mode 100755 gas/makefile.dos delete mode 100755 gas/objdump.c delete mode 100644 gas/obstack.c delete mode 100644 gas/obstack.h delete mode 100644 gas/strerror.c delete mode 100644 gas/strstr.c delete mode 100644 gas/xrealloc.c delete mode 100755 gdb/Makefile.dist delete mode 100755 gdb/Makefile.sdir delete mode 100755 gdb/Makefile.srcdir delete mode 100755 gdb/WHATS.NEW delete mode 100755 gdb/ansidecl.h delete mode 100755 gdb/arm-opcode.h delete mode 100755 gdb/config.gdb delete mode 100755 gdb/config.status delete mode 100644 gdb/config/altosgas.mh delete mode 100644 gdb/config/altosgas.mt delete mode 100755 gdb/config/am29k delete mode 100644 gdb/config/go32.mt delete mode 100644 gdb/config/i386sco.mt delete mode 100644 gdb/config/i386v-g.mh delete mode 100644 gdb/config/i386v-g.mt delete mode 100644 gdb/config/i386v32-g.mh delete mode 100644 gdb/config/i386v32-g.mt delete mode 100644 gdb/config/i386v32.mt delete mode 100644 gdb/config/i960.mt delete mode 100755 gdb/config/mh-vax delete mode 100755 gdb/config/mt-h8300hds delete mode 100644 gdb/config/news1000.mt delete mode 100644 gdb/config/sun3.mh delete mode 100644 gdb/config/sun3.mt delete mode 100644 gdb/config/sun4.mh delete mode 100644 gdb/config/sun4.mt delete mode 100644 gdb/config/sun4os3.mh delete mode 100644 gdb/config/sun4os3.mt delete mode 100755 gdb/config/sun4os5.mh delete mode 100755 gdb/config/sun4os5.mt delete mode 100755 gdb/configure delete mode 100755 gdb/convex-opcode.h delete mode 100644 gdb/cplus-dem.c delete mode 100755 gdb/doc/threecol.tex delete mode 100755 gdb/expread.tab.c delete mode 100755 gdb/expread.y delete mode 100755 gdb/gdb-int.texinfo delete mode 100755 gdb/getpagesize.h delete mode 100755 gdb/gmalloc.c delete mode 100755 gdb/gmalloc.h delete mode 100644 gdb/go32-nat.c delete mode 100755 gdb/hp300hpux-xdep.c delete mode 100644 gdb/hp300ux-xdep.c delete mode 100644 gdb/hppabsd-tdep.c delete mode 100644 gdb/i386-xdep.c delete mode 100755 gdb/m68k-opcode.h delete mode 100755 gdb/mcheck.c delete mode 100755 gdb/mips-opcode.h delete mode 100644 gdb/mips-xdep.c delete mode 100755 gdb/mtrace.awk delete mode 100755 gdb/mtrace.c delete mode 100755 gdb/np1-opcode.h delete mode 100755 gdb/obstack.c delete mode 100755 gdb/obstack.h delete mode 100755 gdb/param-no-tm.h delete mode 100755 gdb/param.h delete mode 100755 gdb/pn-opcode.h delete mode 100755 gdb/pyr-opcode.h delete mode 100755 gdb/rem-m68k.shar delete mode 100755 gdb/remote-multi.shar delete mode 100755 gdb/remote-sa.m68k.shar delete mode 100644 gdb/remote-vx.68.c delete mode 100755 gdb/signame.c delete mode 100755 gdb/signame.h delete mode 100755 gdb/sparc-opcode.h delete mode 100644 gdb/sparc-xdep.c delete mode 100755 gdb/stab.def delete mode 100755 gdb/stddef.h delete mode 100755 gdb/stdlib.h delete mode 100644 gdb/sun3-xdep.c delete mode 100644 gdb/sun386-xdep.c delete mode 100755 gdb/symmetry-tdep.c delete mode 100755 gdb/symmetry-xdep.c delete mode 100755 gdb/tahoe-opcode.h delete mode 100755 gdb/tdesc.c delete mode 100755 gdb/tdesc.h delete mode 100644 gdb/tm-altosgas.h delete mode 100644 gdb/tm-i386v-g.h delete mode 100755 gdb/tm-vxworks68.h delete mode 100755 gdb/tm-vxworks960.h delete mode 100755 gdb/vax-opcode.h delete mode 100755 ld/Makefile delete mode 100644 ld/PORTING delete mode 100755 ld/config.sub delete mode 100755 ld/config/OSE68.mt delete mode 100755 ld/config/decstation.mh delete mode 100755 ld/config/h-i386v delete mode 100755 ld/config/h-m68kv delete mode 100755 ld/config/hmake-dec3100 delete mode 100755 ld/config/hmake-dgux delete mode 100755 ld/config/hmake-rtbsd delete mode 100755 ld/config/hmake-sun3 delete mode 100755 ld/config/hmake-sun4 delete mode 100755 ld/config/hmake-sun4-64 delete mode 100755 ld/config/hp300bsd.mh delete mode 100644 ld/config/hp9000.mh delete mode 100755 ld/config/news.mh delete mode 100755 ld/config/sparc.mh delete mode 100755 ld/config/tmake-coff-a29k delete mode 100755 ld/config/tmake-m88k-bcs delete mode 100755 ld/config/tmake-sun4 delete mode 100755 ld/configdos.bat delete mode 100644 ld/cplus-dem.c delete mode 100644 ld/descrip.mms delete mode 100755 ld/ebmon29k.sc delete mode 100644 ld/gld.1 delete mode 100755 ld/h8300hds.c delete mode 100755 ld/h8300hds.sc delete mode 100755 ld/h8300hms.c delete mode 100755 ld/h8300hms.sc delete mode 100755 ld/i386aout.c delete mode 100755 ld/i386aout.sc delete mode 100755 ld/ld-emul.c delete mode 100755 ld/ld-gld-Ur.script delete mode 100755 ld/ld-gld-r.script delete mode 100755 ld/ld-gld.c delete mode 100755 ld/ld-gld.script delete mode 100755 ld/ld-gld68k-Ur.script delete mode 100755 ld/ld-gld68k-r.script delete mode 100755 ld/ld-gld68k.c delete mode 100755 ld/ld-gld68k.script delete mode 100755 ld/ld-gld960.c delete mode 100755 ld/ld-gld960.script delete mode 100755 ld/ld-gldm88kbcs-Ur.script delete mode 100755 ld/ld-gldm88kbcs-r.script delete mode 100755 ld/ld-gldm88kbcs.c delete mode 100755 ld/ld-gldm88kbcs.script delete mode 100755 ld/ld-lnk960-r.script delete mode 100755 ld/ld-lnk960.c delete mode 100755 ld/ld-lnk960.script delete mode 100755 ld/ld-vanilla.c delete mode 100755 ld/ld.tex delete mode 100755 ld/ldgld.c delete mode 100755 ld/ldgld.sc delete mode 100755 ld/ldgld.script delete mode 100755 ld/ldgld68k.c delete mode 100755 ld/ldgld68k.sc delete mode 100755 ld/ldgld68k.script delete mode 100755 ld/ldgld68kUr.sc delete mode 100755 ld/ldgld68kUr.script delete mode 100755 ld/ldgld68kr.sc delete mode 100755 ld/ldgld68kr.script delete mode 100755 ld/ldgld960.c delete mode 100755 ld/ldgld960.sc delete mode 100755 ld/ldgld960.script delete mode 100755 ld/ldgldUr.sc delete mode 100755 ld/ldgldUr.script delete mode 100755 ld/ldglda29k.c delete mode 100755 ld/ldglda29k.sc delete mode 100755 ld/ldglda29k.script delete mode 100755 ld/ldglda29kUr.sc delete mode 100755 ld/ldglda29kUr.script delete mode 100755 ld/ldglda29kr.sc delete mode 100755 ld/ldglda29kr.script delete mode 100755 ld/ldgldi386v.c delete mode 100755 ld/ldgldi386v.sc delete mode 100755 ld/ldgldi386vUr.sc delete mode 100755 ld/ldgldi386vr.sc delete mode 100755 ld/ldgldm68kv.c delete mode 100755 ld/ldgldm68kv.sc delete mode 100755 ld/ldgldm68kvUr.sc delete mode 100755 ld/ldgldm68kvr.sc delete mode 100755 ld/ldgldm88kbcs.c delete mode 100755 ld/ldgldm88kbcs.sc delete mode 100755 ld/ldgldm88kbcs.script delete mode 100755 ld/ldgldm88kbcsUr.sc delete mode 100755 ld/ldgldm88kbcsUr.script delete mode 100755 ld/ldgldm88kbcsr.sc delete mode 100755 ld/ldgldm88kbcsr.script delete mode 100755 ld/ldgldr.sc delete mode 100755 ld/ldgldr.script delete mode 100755 ld/ldlnk960.c delete mode 100755 ld/ldlnk960.sc delete mode 100755 ld/ldlnk960.script delete mode 100755 ld/ldlnk960r.sc delete mode 100755 ld/ldlnk960r.script delete mode 100755 ld/ldm88k.c delete mode 100755 ld/ldm88k.sc delete mode 100755 ld/ldm88kUr.sc delete mode 100755 ld/ldm88kr.sc delete mode 100755 ld/ldtemplate delete mode 100755 ld/ldvanilla.c delete mode 100755 ld/makefile.dos delete mode 100755 ld/news.sc delete mode 100755 ld/saber delete mode 100755 readline/config.sub delete mode 100755 readline/configure delete mode 100644 readline/doc/history.info delete mode 100644 readline/doc/readline.info delete mode 100755 readline/history.texi delete mode 100755 readline/history.texinfo delete mode 100755 readline/inc-hist.texi delete mode 100755 readline/inc-history.texinfo delete mode 100755 readline/inc-read.texi delete mode 100755 readline/inc-readline.texinfo delete mode 100755 readline/readline.texi delete mode 100755 readline/readline.texinfo delete mode 100755 readline/sysdep-newsos.h delete mode 100755 readline/sysdep-oldbsd.h diff --git a/bfd/Makefile b/bfd/Makefile deleted file mode 100755 index b20e954087..0000000000 --- a/bfd/Makefile +++ /dev/null @@ -1,149 +0,0 @@ -# -# Copyright (C) 1990, 1991 Free Software Foundation, Inc. -# -# This file is part of BFD, the Binary File Diddler. -# -# BFD is free software; you can 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. -# -# BFD is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with BFD; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -# $Id$ - -srcdir=../common -VPATH=../common -RANLIB = ranlib -CSWITCHES = -g # -Wall -CC=gcc -Wall -#__sun4__#CDEFINES=-DHOST_SYS=SUN4_SYS -#__sun3__#CDEFINES=-DHOST_SYS=SUN3_SYS -#__dgux__#CDEFINES=-DHOST_SYS=DGUX_SYS -#__dgux__#RANLIB=echo -INCDIR = ${srcdir}/../../include-cygnus -CSEARCH = -I$(INCDIR) - -TARG = libbfd.a -CFLAGS = $(CDEFINES) $(CSEARCH) $(CSWITCHES) - - -BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o archures.o obstack.o - -BFD_BACKENDS = oasys.o ieee.o srec.o sunos.o icoff.o b.out.o m88k-bcs.o - -BFD_H=$(INCDIR)/bfd.h -SYSDEP_H=$(INCDIR)/sysdep.h - -# C source files that correspond to .o's. -CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c archures.c \ - sunos.c icoff.c b.out.c srec.c oasys.c ieee.c m88k-bcs.c - -all: $(TARG) - -POINTOS = $(BFD_LIBS) $(BFD_BACKENDS) - -$(TARG): $(POINTOS) - rm -f $(TARG) - ar clq $(TARG) $(BFD_LIBS) $(BFD_BACKENDS) - $(RANLIB) $(TARG) - -tags etags: TAGS - -TAGS: .force - etags $(INCDIR)/*.h *.h *.c - -clean: - rm -f $(BFD_LIBS) $(BFD_BACKENDS) *~ core libbfd.a - -clobber realclean: clean - rm -f libbfd.a TAGS - -$(BFD_LIBS) $(BFD_BACKENDS): libbfd.h $(BFD_H) - -archive.o : archive.c libbfd.h $(BFD_H) $(SYSDEP_H) -archures.o : archures.c $(BFD_H) $(SYSDEP_H) archures.h -b.out.o : b.out.c libbfd.h $(BFD_H) $(SYSDEP_H) liba.out.h archures.h -m88k-bcs.o: m88k-bcs.c libbfd.h $(BFD_H) $(SYSDEP_H) libcoff.h coff-code.h archures.h -bfd.o : bfd.c libbfd.h $(BFD_H) $(SYSDEP_H) -cache.o : cache.c libbfd.h $(BFD_H) $(SYSDEP_H) -coff.o : coff.c -cplus-dem.o : cplus-dem.c -filemode.o : filemode.c -icoff.o : icoff.c libbfd.h $(BFD_H) $(SYSDEP_H) libcoff.h coff-code.h archures.h -libbfd.o : libbfd.c libbfd.h $(BFD_H) $(SYSDEP_H) -misc.o : misc.c -opncls.o : opncls.c libbfd.h $(BFD_H) $(SYSDEP_H) -sunos.o : sunos.c libbfd.h $(BFD_H) $(SYSDEP_H) liba.out.h -targets.o : targets.c libbfd.h $(BFD_H) $(SYSDEP_H) -obstack.o:obstack.c -ieee.o:ieee.c -oasys.o:oasys.c -srec.o:srec.c - - - -version.c: FORCE - rm -f version.c - echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > version.c - - -# This target should be invoked before building a new release. -# 'VERSION' file must be present and contain a string of the form "x.y" -# -roll: - @V=`cat VERSION` ; \ - MAJ=`sed 's/\..*//' VERSION` ; \ - MIN=`sed 's/.*\.//' VERSION` ; \ - V=$$MAJ.`expr $$MIN + 1` ; \ - rm -f VERSION ; \ - echo $$V >VERSION ; \ - echo Version $$V - -# Dummy target to force execution of dependent targets. -# -.force: -FORCE: - -# 'G960BASE' will be defined at invocation -install: - make ${TARG} OPT=-O - -# Target to uncomment host-specific lines in this makefile. Such lines must -# have the following string beginning in column 1: #____# -# Original Makefile is backed up as 'Makefile.old'. -# -# Invoke with: make make HOST=xxx -# -make: - -@if test $(HOST)x = x ; then \ - echo 'Specify "make make HOST=???"'; \ - exit 1; \ - fi ; \ - grep -s "^#The next line was generated by 'make make'" Makefile; \ - if test $$? = 0 ; then \ - echo "Makefile has already been processed with 'make make'";\ - exit 1; \ - fi ; \ - mv -f Makefile Makefile.old; \ - echo "# " >Makefile ;\ - echo "# " >>Makefile ;\ - echo "# D A N G E R" >>Makefile ;\ - echo "# " >>Makefile ;\ - echo "# This file was created by make make, change the source in ../common" >>Makefile ; \ - echo "#The next line was generated by 'make make'" >>Makefile ; \ - echo "HOST=$(HOST)" >>Makefile ; \ - echo >>Makefile ; \ - sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile - -Makefile: ../common/Makefile - mv Makefile Makefile.backup - cp ../common/Makefile . - $(MAKE) "HOST=$(HOST)" make diff --git a/bfd/aout.c b/bfd/aout.c deleted file mode 100755 index 8a795e28df..0000000000 --- a/bfd/aout.c +++ /dev/null @@ -1,1500 +0,0 @@ -/* BFD semi-generic back-end for a.out binaries */ - -/* Copyright (C) 1990, 1991 Free Software Foundation, Inc. - -This file is part of BFD, the Binary File Diddler. - -BFD is free software; you can 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. - -BFD is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with BFD; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - - -#include -#include -#include "bfd.h" -#include "libbfd.h" - -#include "a.out.gnu.h" -#include "stab.gnu.h" -#include "ar.h" -#include "liba.out.h" /* BFD a.out internal data structures */ - -void (*bfd_error_trap)(); - -/*SUPPRESS558*/ -/*SUPPRESS529*/ - -#define CTOR_TABLE_RELOC_IDX 2 -static reloc_howto_type howto_table_ext[] = -{ - HOWTO(RELOC_8, 0, 0, 8, false, 0, true, true,0,"8", false, 0,0x000000ff, false), - HOWTO(RELOC_16, 0, 1, 16, false, 0, true, true,0,"16", false, 0,0x0000ffff, false), - HOWTO(RELOC_32, 0, 2, 32, false, 0, true, true,0,"32", false, 0,0xffffffff, false), - HOWTO(RELOC_DISP8, 0, 0, 8, true, 0, false, true,0,"DISP8", false, 0,0x000000ff, false), - HOWTO(RELOC_DISP16, 0, 1, 16, true, 0, false, true,0,"DISP16", false, 0,0x0000ffff, false), - HOWTO(RELOC_DISP32, 0, 2, 32, true, 0, false, true,0,"DISP32", false, 0,0xffffffff, false), - HOWTO(RELOC_WDISP30,2, 2, 30, true, 0, false, true,0,"WDISP30", false, 0,0x3fffffff, false), - HOWTO(RELOC_WDISP22,2, 2, 22, true, 0, false, true,0,"WDISP22", false, 0,0x003fffff, false), - HOWTO(RELOC_HI22, 10, 2, 22, false, 0, false, true,0,"HI22", false, 0,0x003fffff, false), - HOWTO(RELOC_22, 0, 2, 22, false, 0, false, true,0,"22", false, 0,0x003fffff, false), - HOWTO(RELOC_13, 0, 2, 13, false, 0, false, true,0,"13", false, 0,0x00001fff, false), - HOWTO(RELOC_LO10, 0, 2, 10, false, 0, false, true,0,"LO10", false, 0,0x000003ff, false), - HOWTO(RELOC_SFA_BASE,0, 2, 32, false, 0, false, true,0,"SFA_BASE", false, 0,0xffffffff, false), - HOWTO(RELOC_SFA_OFF13,0,2, 32, false, 0, false, true,0,"SFA_OFF13",false, 0,0xffffffff, false), - HOWTO(RELOC_BASE10, 0, 2, 16, false, 0, false, true,0,"BASE10", false, 0,0x0000ffff, false), - HOWTO(RELOC_BASE13, 0, 2, 13, false, 0, false, true,0,"BASE13", false, 0,0x00001fff, false), - HOWTO(RELOC_BASE22, 0, 2, 0, false, 0, false, true,0,"BASE22", false, 0,0x00000000, false), - HOWTO(RELOC_PC10, 0, 2, 10, false, 0, false, true,0,"PC10", false, 0,0x000003ff, false), - HOWTO(RELOC_PC22, 0, 2, 22, false, 0, false, true,0,"PC22", false, 0,0x003fffff, false), - HOWTO(RELOC_JMP_TBL,0, 2, 32, false, 0, false, true,0,"JMP_TBL", false, 0,0xffffffff, false), - HOWTO(RELOC_SEGOFF16,0, 2, 0, false, 0, false, true,0,"SEGOFF16", false, 0,0x00000000, false), - HOWTO(RELOC_GLOB_DAT,0, 2, 0, false, 0, false, true,0,"GLOB_DAT", false, 0,0x00000000, false), - HOWTO(RELOC_JMP_SLOT,0, 2, 0, false, 0, false, true,0,"JMP_SLOT", false, 0,0x00000000, false), - HOWTO(RELOC_RELATIVE,0, 2, 0, false, 0, false, true,0,"RELATIVE", false, 0,0x00000000, false), - HOWTO(RELOC_JUMPTARG,2, 13, 16, true, 0, false, true,0,"JUMPTARG", false, 0,0x0000ffff, false), - HOWTO(RELOC_CONST, 0, 13, 16, false, 0, false, true,0,"CONST", false, 0,0x0000ffff, false), - HOWTO(RELOC_CONSTH, 16, 13, 16, false, 0, false, true,0,"CONSTH", false, 0,0x0000ffff, false), -}; - -/* Convert standard reloc records to "arelent" format (incl byte swap). */ - -static reloc_howto_type howto_table_std[] = { - /* type rs size bsz pcrel bitpos abs ovrf sf name part_inpl readmask setmask pcdone */ -HOWTO( 0, 0, 0, 8, false, 0, true, true,0,"8", true, 0x000000ff,0x000000ff, false), -HOWTO( 1, 0, 1, 16, false, 0, true, true,0,"16", true, 0x0000ffff,0x0000ffff, false), -HOWTO( 2, 0, 2, 32, false, 0, true, true,0,"32", true, 0xffffffff,0xffffffff, false), -HOWTO( 3, 0, 3, 64, false, 0, true, true,0,"64", true, 0xdeaddead,0xdeaddead, false), -HOWTO( 4, 0, 0, 8, true, 0, false, true,0,"DISP8", true, 0x000000ff,0x000000ff, false), -HOWTO( 5, 0, 1, 16, true, 0, false, true,0,"DISP16", true, 0x0000ffff,0x0000ffff, false), -HOWTO( 6, 0, 2, 32, true, 0, false, true,0,"DISP32", true, 0xffffffff,0xffffffff, false), -HOWTO( 7, 0, 3, 64, true, 0, false, true,0,"DISP64", true, 0xfeedface,0xfeedface, false), -}; - - -bfd_error_vector_type bfd_error_vector; - -void -DEFUN(bfd_aout_swap_exec_header_in,(abfd, raw_bytes, execp), - bfd *abfd AND - unsigned char *raw_bytes AND - struct exec *execp) -{ - struct exec_bytes *bytes = (struct exec_bytes *)raw_bytes; - - /* Now fill in fields in the execp, from the bytes in the raw data. */ - execp->a_info = bfd_h_getlong (abfd, bytes->a_info); - execp->a_text = bfd_h_getlong (abfd, bytes->a_text); - execp->a_data = bfd_h_getlong (abfd, bytes->a_data); - execp->a_bss = bfd_h_getlong (abfd, bytes->a_bss); - execp->a_syms = bfd_h_getlong (abfd, bytes->a_syms); - execp->a_entry = bfd_h_getlong (abfd, bytes->a_entry); - execp->a_trsize = bfd_h_getlong (abfd, bytes->a_trsize); - execp->a_drsize = bfd_h_getlong (abfd, bytes->a_drsize); -} - -void -DEFUN(bfd_aout_swap_exec_header_out,(abfd, execp, raw_bytes), - bfd *abfd AND - struct exec *execp AND - unsigned char *raw_bytes) -{ - struct exec_bytes *bytes = (struct exec_bytes *)raw_bytes; - - /* Now fill in fields in the raw data, from the fields in the exec struct. */ - bfd_h_putlong (abfd, execp->a_info , bytes->a_info); - bfd_h_putlong (abfd, execp->a_text , bytes->a_text); - bfd_h_putlong (abfd, execp->a_data , bytes->a_data); - bfd_h_putlong (abfd, execp->a_bss , bytes->a_bss); - bfd_h_putlong (abfd, execp->a_syms , bytes->a_syms); - bfd_h_putlong (abfd, execp->a_entry , bytes->a_entry); - bfd_h_putlong (abfd, execp->a_trsize, bytes->a_trsize); - bfd_h_putlong (abfd, execp->a_drsize, bytes->a_drsize); -} - -/* Some A.OUT variant thinks that the file whose format we're checking - is an a.out file. Do some more checking, and set up for access if - it really is. Call back to the calling environment's "finish up" - function just before returning, to handle any last-minute setup. */ - -bfd_target * -some_aout_object_p (abfd, callback_to_real_object_p) - bfd *abfd; - bfd_target *(*callback_to_real_object_p) (); -{ - unsigned char exec_bytes[EXEC_BYTES_SIZE]; /* Raw bytes of exec hdr */ - struct exec *execp; - PTR rawptr; - - if (bfd_seek (abfd, 0L, false) < 0) { - bfd_error = system_call_error; - return 0; - } - - if (bfd_read ((PTR) exec_bytes, 1, EXEC_BYTES_SIZE, abfd) - != EXEC_BYTES_SIZE) { - bfd_error = wrong_format; - return 0; - } - - /* Use an intermediate variable for clarity */ - rawptr = (PTR) bfd_zalloc (abfd, sizeof (struct aoutdata) + sizeof (struct exec)); - - if (rawptr == NULL) { - bfd_error = no_memory; - return 0; - } - - set_tdata (abfd, ((struct aoutdata *) rawptr)); - exec_hdr (abfd) = execp = - (struct exec *) ((char *)rawptr + sizeof (struct aoutdata)); - - bfd_aout_swap_exec_header_in (abfd, exec_bytes, execp); - - /* Set the file flags */ - abfd->flags = NO_FLAGS; - if (execp->a_drsize || execp->a_trsize) - abfd->flags |= HAS_RELOC; - if (execp->a_entry) - abfd->flags |= EXEC_P; - if (execp->a_syms) - abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS; - - if (N_MAGIC (*execp) == ZMAGIC) abfd->flags |= D_PAGED; - if (N_MAGIC (*execp) == NMAGIC) abfd->flags |= WP_TEXT; - - bfd_get_start_address (abfd) = execp->a_entry; - - obj_aout_symbols (abfd) = (aout_symbol_type *)NULL; - bfd_get_symcount (abfd) = execp->a_syms / sizeof (struct nlist); - - /* Set the default architecture and machine type. These can be - overridden in the callback routine. */ - abfd->obj_arch = bfd_arch_unknown; - abfd->obj_machine = 0; - - /* The default relocation entry size is that of traditional V7 Unix. */ - obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; - - /* create the sections. This is raunchy, but bfd_close wants to reclaim - them */ - obj_textsec (abfd) = (asection *)NULL; - obj_datasec (abfd) = (asection *)NULL; - obj_bsssec (abfd) = (asection *)NULL; - (void)bfd_make_section(abfd, ".text"); - (void)bfd_make_section(abfd, ".data"); - (void)bfd_make_section(abfd, ".bss"); - - abfd->sections = obj_textsec (abfd); - obj_textsec (abfd)->next = obj_datasec (abfd); - obj_datasec (abfd)->next = obj_bsssec (abfd); - - obj_datasec (abfd)->size = execp->a_data; - obj_bsssec (abfd)->size = execp->a_bss; - obj_textsec (abfd)->size = execp->a_text; - - if (abfd->flags & D_PAGED) { - obj_textsec (abfd)->size -= EXEC_BYTES_SIZE; - } - - - obj_textsec (abfd)->flags = (execp->a_trsize != 0 ? - (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_HAS_CONTENTS) : - (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS)); - obj_datasec (abfd)->flags = (execp->a_drsize != 0 ? - (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_HAS_CONTENTS) : - (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS)); - obj_bsssec (abfd)->flags = SEC_ALLOC; - -#ifdef THIS_IS_ONLY_DOCUMENTATION - /* Call back to the format-dependent code to fill in the rest of the - fields and do any further cleanup. Things that should be filled - in by the callback: */ - - struct exec *execp = exec_hdr (abfd); - - /* The virtual memory addresses of the sections */ - obj_datasec (abfd)->vma = N_DATADDR(*execp); - obj_bsssec (abfd)->vma = N_BSSADDR(*execp); - obj_textsec (abfd)->vma = N_TXTADDR(*execp); - - /* The file offsets of the sections */ - obj_textsec (abfd)->filepos = N_TXTOFF(*execp); - obj_datasec (abfd)->filepos = N_DATOFF(*execp); - - /* The file offsets of the relocation info */ - obj_textsec (abfd)->rel_filepos = N_TRELOFF(*execp); - obj_datasec (abfd)->rel_filepos = N_DRELOFF(*execp); - - /* The file offsets of the string table and symbol table. */ - obj_str_filepos (abfd) = N_STROFF (*execp); - obj_sym_filepos (abfd) = N_SYMOFF (*execp); - - /* This common code can't fill in those things because they depend - on either the start address of the text segment, the rounding - up of virtual addersses between segments, or the starting file - position of the text segment -- all of which varies among different - versions of a.out. */ - - /* Determine the architecture and machine type of the object file. */ - switch (N_MACHTYPE (*exec_hdr (abfd))) { - default: - abfd->obj_arch = bfd_arch_obscure; - break; - } - - /* Determine the size of a relocation entry */ - switch (abfd->obj_arch) { - case bfd_arch_sparc: - case bfd_arch_a29k: - obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; - default: - obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; - } - - return abfd->xvec; - - /* The architecture is encoded in various ways in various a.out variants, - or is not encoded at all in some of them. The relocation size depends - on the architecture and the a.out variant. Finally, the return value - is the bfd_target vector in use. If an error occurs, return zero and - set bfd_error to the appropriate error code. - - Formats such as b.out, which have additional fields in the a.out - header, should cope with them in this callback as well. */ -#endif /* DOCUMENTATION */ - - - return (*callback_to_real_object_p)(abfd); -} - - -boolean -aout_mkobject (abfd) - bfd *abfd; -{ - char *rawptr; - - bfd_error = system_call_error; - - /* Use an intermediate variable for clarity */ - rawptr = bfd_zalloc (abfd, sizeof (struct aoutdata) + sizeof (struct exec)); - - if (rawptr == NULL) { - bfd_error = no_memory; - return false; - } - - set_tdata (abfd, (struct aoutdata *) rawptr); - exec_hdr (abfd) = (struct exec *) (rawptr + sizeof (struct aoutdata)); - - /* For simplicity's sake we just make all the sections right here. */ - - obj_textsec (abfd) = (asection *)NULL; - obj_datasec (abfd) = (asection *)NULL; - obj_bsssec (abfd) = (asection *)NULL; - bfd_make_section (abfd, ".text"); - bfd_make_section (abfd, ".data"); - bfd_make_section (abfd, ".bss"); - - return true; -} - -/* Keep track of machine architecture and machine type for a.out's. - Return the machine_type for a particular arch&machine, or M_UNKNOWN - if that exact arch&machine can't be represented in a.out format. - - If the architecture is understood, machine type 0 (default) should - always be understood. */ - -enum machine_type -aout_machine_type (arch, machine) - enum bfd_architecture arch; - unsigned long machine; -{ - enum machine_type arch_flags; - - arch_flags = M_UNKNOWN; - - switch (arch) { - case bfd_arch_sparc: - if (machine == 0) arch_flags = M_SPARC; - break; - - case bfd_arch_m68k: - switch (machine) { - case 0: arch_flags = M_68010; break; - case 68000: arch_flags = M_UNKNOWN; break; - case 68010: arch_flags = M_68010; break; - case 68020: arch_flags = M_68020; break; - default: arch_flags = M_UNKNOWN; break; - } - break; - - case bfd_arch_i386: - if (machine == 0) arch_flags = M_386; - break; - - case bfd_arch_a29k: - if (machine == 0) arch_flags = M_29K; - break; - - default: - arch_flags = M_UNKNOWN; - break; - } - return arch_flags; -} - -boolean -aout_set_arch_mach (abfd, arch, machine) - bfd *abfd; - enum bfd_architecture arch; - unsigned long machine; -{ - abfd->obj_arch = arch; - abfd->obj_machine = machine; - if (arch != bfd_arch_unknown && - aout_machine_type (arch, machine) == M_UNKNOWN) - return false; /* We can't represent this type */ - return true; /* We're easy ... */ -} - -/* exec and core file sections */ - -boolean -aout_new_section_hook (abfd, newsect) - bfd *abfd; - asection *newsect; -{ - /* align to double at least */ - newsect->alignment_power = 3; - - if (bfd_get_format (abfd) == bfd_object) { - if (obj_textsec(abfd) == NULL && !strcmp(newsect->name, ".text")) { - obj_textsec(abfd)= newsect; - return true; - } - - if (obj_datasec(abfd) == NULL && !strcmp(newsect->name, ".data")) { - obj_datasec(abfd) = newsect; - return true; - } - - if (obj_bsssec(abfd) == NULL && !strcmp(newsect->name, ".bss")) { - obj_bsssec(abfd) = newsect; - return true; - } - } - - /* We allow more than three sections internally */ - return true; -} - -boolean -aout_set_section_contents (abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - PTR location; - file_ptr offset; - int count; -{ - if (abfd->output_has_begun == false) - { /* set by bfd.c handler */ - if ((obj_textsec (abfd) == NULL) || (obj_datasec (abfd) == NULL)) - { - bfd_error = invalid_operation; - return false; - } - - obj_textsec(abfd)->filepos = sizeof(struct exec); - obj_textsec(abfd)->size = align_power(obj_textsec(abfd)->size, - obj_textsec(abfd)->alignment_power); - obj_datasec(abfd)->filepos = obj_textsec (abfd)->size + EXEC_BYTES_SIZE; - obj_datasec(abfd)->size = align_power(obj_datasec(abfd)->size, - obj_datasec(abfd)->alignment_power); - - - } - /* regardless, once we know what we're doing, we might as well get going */ - if (section != obj_bsssec(abfd)) - { - bfd_seek (abfd, section->filepos + offset, SEEK_SET); - - if (count) { - return (bfd_write ((PTR)location, 1, count, abfd) == count) ? - true : false; - } - return false; - } - return true; -} - -/* Classify stabs symbols */ - -#define sym_in_text_section(sym) \ - (((sym)->n_type & (N_ABS | N_TEXT | N_DATA | N_BSS))== N_TEXT) - -#define sym_in_data_section(sym) \ - (((sym)->n_type & (N_ABS | N_TEXT | N_DATA | N_BSS))== N_DATA) - -#define sym_in_bss_section(sym) \ - (((sym)->n_type & (N_ABS | N_TEXT | N_DATA | N_BSS))== N_BSS) - -/* Symbol is undefined if type is N_UNDF|N_EXT and if it has - zero in the "value" field. Nonzeroes there are fortrancommon - symbols. */ -#define sym_is_undefined(sym) \ - ((sym)->n_type == (N_UNDF | N_EXT) && (sym)->n_value == 0) - -/* Symbol is a global definition if N_EXT is on and if it has - a nonzero type field. */ -#define sym_is_global_defn(sym) \ - (((sym)->n_type & N_EXT) && (sym)->n_type & N_TYPE) - -/* Symbol is debugger info if any bits outside N_TYPE or N_EXT - are on. */ -#define sym_is_debugger_info(sym) \ - ((sym)->n_type & ~(N_EXT | N_TYPE)) - -#define sym_is_fortrancommon(sym) \ - (((sym)->n_type == (N_EXT)) && (sym)->n_value != 0) - -/* Symbol is absolute if it has N_ABS set */ -#define sym_is_absolute(sym) \ - (((sym)->n_type & N_TYPE)== N_ABS) - - -#define sym_is_indirect(sym) \ - (((sym)->n_type & N_ABS)== N_ABS) - -/* Only in their own functions for ease of debugging; when sym flags have - stabilised these should be inlined into their (single) caller */ - -static void -translate_from_native_sym_flags (sym_pointer, cache_ptr, abfd) - struct nlist *sym_pointer; - aout_symbol_type *cache_ptr; - bfd *abfd; -{ - switch (cache_ptr->type & N_TYPE) { - case N_SETA: - case N_SETT: - case N_SETD: - case N_SETB: - { - asection *section = bfd_make_section(abfd, - cache_ptr->symbol.name); - arelent_chain *reloc = (arelent_chain *)bfd_alloc(abfd, sizeof(arelent_chain)); - - switch ( (cache_ptr->type & N_TYPE) ) { - case N_SETA: - reloc->relent.section = (asection *)NULL; - cache_ptr->symbol.section = (asection *)NULL; - break; - case N_SETT: - reloc->relent.section = (asection *)obj_textsec(abfd); - cache_ptr->symbol.value -= reloc->relent.section->vma; - break; - case N_SETD: - reloc->relent.section = (asection *)obj_datasec(abfd); - cache_ptr->symbol.value -= reloc->relent.section->vma; - break; - case N_SETB: - reloc->relent.section = (asection *)obj_bsssec(abfd); - cache_ptr->symbol.value -= reloc->relent.section->vma; - break; - } - cache_ptr->symbol.section = reloc->relent.section; - reloc->relent.addend = cache_ptr->symbol.value ; - - /* We modify the symbol to belong to a section depending upon the - name of the symbol - probably __CTOR__ or __DTOR__ but we don't - really care, and add to the size of the section to contain a - pointer to the symbol. Build a reloc entry to relocate to this - symbol attached to this section. */ - - section->flags = SEC_CONSTRUCTOR; - section->reloc_count++; - section->alignment_power = 2; - reloc->relent.sym_ptr_ptr = (asymbol **)NULL; - reloc->next = section->constructor_chain; - section->constructor_chain = reloc; - reloc->relent.address = section->size; - section->size += sizeof(int *); - - reloc->relent.howto = howto_table_ext +CTOR_TABLE_RELOC_IDX; - cache_ptr->symbol.flags |= BSF_DEBUGGING ; - } - break; - default: - - if (sym_is_debugger_info (sym_pointer)) { - cache_ptr->symbol.flags = BSF_DEBUGGING ; - /* Work out the section correct for this symbol */ - switch (sym_pointer->n_type & N_TYPE) - { - case N_TEXT: - case N_FN: - cache_ptr->symbol.section = obj_textsec (abfd); - cache_ptr->symbol.value -= obj_textsec(abfd)->vma; - break; - case N_DATA: - cache_ptr->symbol.value -= obj_datasec(abfd)->vma; - cache_ptr->symbol.section = obj_datasec (abfd); - break; - case N_BSS : - cache_ptr->symbol.section = obj_bsssec (abfd); - cache_ptr->symbol.value -= obj_bsssec(abfd)->vma; - break; - case N_ABS: - default: - cache_ptr->symbol.section = 0; - break; - } - } - else { - if (sym_is_fortrancommon (sym_pointer)) - { - cache_ptr->symbol.flags = BSF_FORT_COMM; - cache_ptr->symbol.section = (asection *)NULL; - } - else { - if (sym_is_undefined (sym_pointer)) { - cache_ptr->symbol.flags = BSF_UNDEFINED; - } - else if (sym_is_global_defn (sym_pointer)) { - cache_ptr->symbol.flags = BSF_GLOBAL | BSF_EXPORT; - } - - else if (sym_is_absolute (sym_pointer)) { - cache_ptr->symbol.flags = BSF_ABSOLUTE; - } - else { - cache_ptr->symbol.flags = BSF_LOCAL; - } - - /* In a.out, the value of a symbol is always relative to the - * start of the file, if this is a data symbol we'll subtract - * the size of the text section to get the section relative - * value. If this is a bss symbol (which would be strange) - * we'll subtract the size of the previous two sections - * to find the section relative address. - */ - - if (sym_in_text_section (sym_pointer)) { - cache_ptr->symbol.value -= obj_textsec(abfd)->vma; - cache_ptr->symbol.section = obj_textsec (abfd); - } - else if (sym_in_data_section (sym_pointer)){ - cache_ptr->symbol.value -= obj_datasec(abfd)->vma; - cache_ptr->symbol.section = obj_datasec (abfd); - } - else if (sym_in_bss_section(sym_pointer)) { - cache_ptr->symbol.section = obj_bsssec (abfd); - cache_ptr->symbol.value -= obj_bsssec(abfd)->vma; - } - else { - cache_ptr->symbol.section = (asection *)NULL; - cache_ptr->symbol.flags |= BSF_ABSOLUTE; - } - } - } - } -} - -void -translate_to_native_sym_flags (sym_pointer, cache_ptr_g, abfd) - struct nlist *sym_pointer; - PTR cache_ptr_g; - bfd *abfd; -{ - asymbol *cache_ptr = (asymbol *)cache_ptr_g; - - /* FIXME check for writing bss */ - if (bfd_get_section(cache_ptr)) { - if (bfd_get_output_section(cache_ptr) == obj_bsssec (abfd)) { - sym_pointer->n_type |= N_BSS; - } - else if (bfd_get_output_section(cache_ptr) == obj_datasec (abfd)) { - sym_pointer->n_type |= N_DATA; - } - else if (bfd_get_output_section(cache_ptr) == obj_textsec (abfd)) { - sym_pointer->n_type |= N_TEXT; - } - else { - bfd_error_vector.nonrepresentable_section(abfd, - bfd_get_output_section(cache_ptr)->name); - } - /* Turn the symbol from section relative to absolute again */ - sym_pointer->n_value += - cache_ptr->section->output_section->vma - + cache_ptr->section->output_offset ; - } - else { - sym_pointer->n_type |= N_ABS; - } - - if (cache_ptr->flags & (BSF_FORT_COMM | BSF_UNDEFINED)) { - sym_pointer->n_type = (N_UNDF | N_EXT); - return; - } - - if (cache_ptr->flags & BSF_ABSOLUTE) { - sym_pointer->n_type |= N_ABS; - } - - if (cache_ptr->flags & (BSF_GLOBAL | BSF_EXPORT)) { - sym_pointer->n_type |= N_EXT; - } - if (cache_ptr->flags & BSF_DEBUGGING) { - sym_pointer->n_type = ((aout_symbol_type *)cache_ptr)->type; - } -} - -/* Native-level interface to symbols. */ - -/* We read the symbols into a buffer, which is discarded when this - function exits. We read the strings into a buffer large enough to - hold them all plus all the cached symbol entries. */ - -asymbol * -aout_make_empty_symbol (abfd) -bfd *abfd; -{ - aout_symbol_type *new = - (aout_symbol_type *)bfd_zalloc (abfd, sizeof (aout_symbol_type)); - new->symbol.the_bfd = abfd; - - return &new->symbol; -} - -boolean -DEFUN(aout_slurp_symbol_table, (abfd), - bfd *abfd) -{ - size_t symbol_size; - size_t string_size; - unsigned char string_chars[LONG_SIZE]; - struct nlist *syms; - char *strings; - aout_symbol_type *cached; - - /* If there's no work to be done, don't do any */ - if (obj_aout_symbols (abfd) != (aout_symbol_type *)NULL) return true; - symbol_size = exec_hdr(abfd)->a_syms; - if (symbol_size == 0) { - bfd_error = no_symbols; - return false; - } - - bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET); - if (bfd_read ((PTR)string_chars, LONG_SIZE, 1, abfd) != LONG_SIZE) - return false; - string_size = bfd_h_getlong (abfd, string_chars); - - strings = bfd_alloc(abfd, string_size + 1); - cached = (aout_symbol_type *) - bfd_zalloc(abfd, bfd_get_symcount (abfd) * sizeof(aout_symbol_type)); - /* Alloc this last, so we can free it if obstack is in use. */ - syms = (struct nlist *) bfd_alloc(abfd, symbol_size); - - bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET); - if (bfd_read ((PTR)syms, 1, symbol_size, abfd) != symbol_size) { - bailout: - if (syms) bfd_release (abfd, syms); - if (cached) bfd_release (abfd, cached); - if (strings)bfd_release (abfd, strings); - return false; - } - - bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET); - if (bfd_read ((PTR)strings, 1, string_size, abfd) != string_size) { - goto bailout; - } - - /* OK, now walk the new symtable, cacheing symbol properties */ - { - register struct nlist *sym_pointer; - register struct nlist *sym_end = syms + bfd_get_symcount (abfd); - register aout_symbol_type *cache_ptr = cached; - - /* run through the table and byte swap if needed */ - for (sym_pointer = syms; sym_pointer < sym_end; sym_pointer++) { - sym_pointer->n_un.n_strx = - bfd_h_getlong (abfd, &sym_pointer->n_un.n_strx); - sym_pointer->n_desc = - bfd_h_getshort (abfd, &sym_pointer->n_desc); - sym_pointer->n_value = - bfd_h_getlong (abfd, &sym_pointer->n_value); - sym_pointer->n_other = (char) - bfd_h_getchar(abfd, &sym_pointer->n_other); - sym_pointer->n_type = (char) - bfd_h_getchar(abfd, &sym_pointer->n_type); - } - - /* Run through table and copy values */ - for (sym_pointer = syms, cache_ptr = cached; - sym_pointer < sym_end; sym_pointer++, cache_ptr++) - { - cache_ptr->symbol.the_bfd = abfd; - if (sym_pointer->n_un.n_strx) - cache_ptr->symbol.name = sym_pointer->n_un.n_strx + strings; - else - cache_ptr->symbol.name = (char *)NULL; - cache_ptr->symbol.value = sym_pointer->n_value; - cache_ptr->desc = sym_pointer->n_desc; - cache_ptr->other = sym_pointer->n_other; - cache_ptr->type = sym_pointer->n_type; - cache_ptr->symbol.udata = 0; - translate_from_native_sym_flags (sym_pointer, cache_ptr, abfd); - - } - } - - obj_aout_symbols (abfd) = cached; - bfd_release (abfd, (PTR)syms); - - return true; -} - - -void -DEFUN(aout_write_syms,(abfd), - bfd *abfd) -{ - unsigned int count ; - asymbol **generic = bfd_get_outsymbols (abfd); - - unsigned int stindex = sizeof(stindex); /* initial string length */ - - for (count = 0; count < bfd_get_symcount (abfd); count++) { - asymbol *g = generic[count]; - struct nlist nsp; - - if (g->name) { - unsigned int length = strlen(g->name) +1; - bfd_h_putlong (abfd, stindex, (unsigned char *)&nsp.n_un.n_strx); - stindex += length; - } - else { - bfd_h_putlong (abfd, 0, (unsigned char *)&nsp.n_un.n_strx); - } - - if (g->the_bfd->xvec->flavour == abfd->xvec->flavour) - { - nsp.n_desc = aout_symbol( g)->desc; - nsp.n_other = aout_symbol(g)->other; - nsp.n_type = aout_symbol(g)->type; - } - else - { - nsp.n_desc = 0; - nsp.n_other = 0; - nsp.n_type = 0; - } - - - nsp.n_value = g->value; - translate_to_native_sym_flags (&nsp, (PTR)g, abfd); - - - bfd_h_putshort (abfd, nsp.n_desc, (unsigned char *)&nsp.n_desc); - bfd_h_putlong (abfd, nsp.n_value, (unsigned char *)&nsp.n_value); - bfd_write((PTR)&nsp,1, sizeof(nsp), abfd); - } - - - /* Now output the strings. Be sure to put string length into correct - * byte ordering before writing it. - */ - bfd_h_putlong (abfd, stindex, (unsigned char *)&stindex); - - bfd_write((PTR)&stindex, 1, sizeof(stindex), abfd); - - generic = bfd_get_outsymbols(abfd); - for (count = 0; count < bfd_get_symcount(abfd); count++) - { - asymbol *g = *(generic++); - - if (g->name) - { - size_t length = strlen(g->name)+1; - bfd_write((PTR)g->name, 1, length, abfd); - } - if ((g->flags & BSF_FAKE)==0) { - g->name = itos(count); /* smash the generic symbol */ - } - } -} - - -void -DEFUN(aout_reclaim_symbol_table,(abfd), - bfd *abfd) -{ - -} - -unsigned int -aout_get_symtab_upper_bound (abfd) - bfd *abfd; -{ - if (!aout_slurp_symbol_table (abfd)) return 0; - - return (bfd_get_symcount (abfd)+1) * (sizeof (aout_symbol_type *)); -} - -unsigned int -aout_get_symtab (abfd, location) - bfd *abfd; - asymbol **location; -{ - unsigned int counter = 0; - aout_symbol_type *symbase; - - if (!aout_slurp_symbol_table (abfd)) return 0; - - for (symbase = obj_aout_symbols(abfd); counter++ < bfd_get_symcount (abfd);) - *(location++) = (asymbol *)( symbase++); - *location++ =0; - return bfd_get_symcount(abfd); -} - - -/* Standard reloc stuff */ -/* Output standard relocation information to a file in target byte order. */ - -void -swap_std_reloc_out (abfd, g, natptr) - bfd *abfd; - arelent *g; /* Generic relocation struct */ - struct reloc_std_bytes *natptr; -{ - int r_index; - int r_extern; - unsigned int r_length; - int r_pcrel; - int r_baserel, r_jmptable, r_relative; - unsigned int r_addend; - - bfd_h_putlong (abfd, g->address, natptr->r_address); - - r_length = g->howto->size ; /* Size as a power of two */ - r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */ - /* r_baserel, r_jmptable, r_relative??? FIXME-soon */ - r_baserel = 0; - r_jmptable = 0; - r_relative = 0; - - r_addend = g->addend; /* Start here, see how it goes */ - - /* name was clobbered by aout_write_syms to be symbol index */ - - if (g->sym_ptr_ptr != NULL) - { - if ((*(g->sym_ptr_ptr))->section) { - /* put the section offset into the addend for output */ - r_addend += (*(g->sym_ptr_ptr))->section->vma; - } - - r_index = stoi((*(g->sym_ptr_ptr))->name); - r_extern = 1; - } - else { - r_extern = 0; - if (g->section == NULL) { - /* It is possible to have a reloc with nothing, we generate an - abs + 0 */ - r_addend = 0; - r_index = N_ABS | N_EXT; - } - else if(g->section->output_section == obj_textsec(abfd)) { - r_index = N_TEXT | N_EXT; - r_addend += g->section->output_section->vma; - } - else if (g->section->output_section == obj_datasec(abfd)) { - r_index = N_DATA | N_EXT; - r_addend += g->section->output_section->vma; - } - else if (g->section->output_section == obj_bsssec(abfd)) { - r_index = N_BSS | N_EXT ; - r_addend += g->section->output_section->vma; - } - else { - BFD_ASSERT(0); - } - } - - /* now the fun stuff */ - if (abfd->xvec->header_byteorder_big_p != false) { - natptr->r_index[0] = r_index >> 16; - natptr->r_index[1] = r_index >> 8; - natptr->r_index[2] = r_index; - natptr->r_bits[0] = - (r_extern? RELOC_STD_BITS_EXTERN_BIG: 0) - | (r_pcrel? RELOC_STD_BITS_PCREL_BIG: 0) - | (r_baserel? RELOC_STD_BITS_BASEREL_BIG: 0) - | (r_jmptable? RELOC_STD_BITS_JMPTABLE_BIG: 0) - | (r_relative? RELOC_STD_BITS_RELATIVE_BIG: 0) - | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG); - } else { - natptr->r_index[2] = r_index >> 16; - natptr->r_index[1] = r_index >> 8; - natptr->r_index[0] = r_index; - natptr->r_bits[0] = - (r_extern? RELOC_STD_BITS_EXTERN_LITTLE: 0) - | (r_pcrel? RELOC_STD_BITS_PCREL_LITTLE: 0) - | (r_baserel? RELOC_STD_BITS_BASEREL_LITTLE: 0) - | (r_jmptable? RELOC_STD_BITS_JMPTABLE_LITTLE: 0) - | (r_relative? RELOC_STD_BITS_RELATIVE_LITTLE: 0) - | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE); - } -} - - -/* Extended stuff */ -/* Output extended relocation information to a file in target byte order. */ - -void -swap_ext_reloc_out (abfd, g, natptr) - bfd *abfd; - arelent *g; /* Generic relocation struct */ - register struct reloc_ext_bytes *natptr; -{ - int r_index; - int r_extern; - unsigned int r_type; - unsigned int r_addend; - - bfd_h_putlong (abfd, g->address, natptr->r_address); - - /* Find a type in the output format which matches the input howto - - at the moment we assume input format == output format FIXME!! */ - r_type = (enum reloc_type) g->howto->type; - - r_addend = g->addend; /* Start here, see how it goes */ - - /* name was clobbered by aout_write_syms to be symbol index*/ - - if (g->sym_ptr_ptr != NULL) - { - if ((*(g->sym_ptr_ptr))->section) { - /* put the section offset into the addend for output */ - r_addend += (*(g->sym_ptr_ptr))->section->vma; - } - - r_index = stoi((*(g->sym_ptr_ptr))->name); - r_extern = 1; - } - else { - r_extern = 0; - if (g->section == NULL) { - BFD_ASSERT(0); - r_index = N_ABS | N_EXT; - } - else if(g->section->output_section == obj_textsec(abfd)) { - r_index = N_TEXT | N_EXT; - r_addend += g->section->output_section->vma; - } - else if (g->section->output_section == obj_datasec(abfd)) { - r_index = N_DATA | N_EXT; - r_addend += g->section->output_section->vma; - } - else if (g->section->output_section == obj_bsssec(abfd)) { - r_index = N_BSS | N_EXT ; - r_addend += g->section->output_section->vma; - } - else { - BFD_ASSERT(0); - } - } - - /* now the fun stuff */ - if (abfd->xvec->header_byteorder_big_p != false) { - natptr->r_index[0] = r_index >> 16; - natptr->r_index[1] = r_index >> 8; - natptr->r_index[2] = r_index; - natptr->r_bits[0] = - (r_extern? RELOC_EXT_BITS_EXTERN_BIG: 0) - | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG); - } else { - natptr->r_index[2] = r_index >> 16; - natptr->r_index[1] = r_index >> 8; - natptr->r_index[0] = r_index; - natptr->r_bits[0] = - (r_extern? RELOC_EXT_BITS_EXTERN_LITTLE: 0) - | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE); - } - - bfd_h_putlong (abfd, r_addend, natptr->r_addend); -} - -#define MOVE_ADDRESS(ad) \ - if (r_extern) { \ - cache_ptr->sym_ptr_ptr = symbols + r_index; \ - cache_ptr->section = (asection *)NULL; \ - cache_ptr->addend = ad; \ - } else { \ - cache_ptr->sym_ptr_ptr = (asymbol **)NULL; \ - switch (r_index) { \ - case N_TEXT: \ - case N_TEXT | N_EXT: \ - cache_ptr->section = obj_textsec(abfd); \ - cache_ptr->addend = ad - su->textsec->vma; \ - break; \ - case N_DATA: \ - case N_DATA | N_EXT: \ - cache_ptr->section = obj_datasec(abfd); \ - cache_ptr->addend = ad - su->datasec->vma; \ - break; \ - case N_BSS: \ - case N_BSS | N_EXT: \ - cache_ptr->section = obj_bsssec(abfd); \ - cache_ptr->addend = ad - su->bsssec->vma; \ - break; \ - case N_ABS: \ - case N_ABS | N_EXT: \ - cache_ptr->section = NULL; /* No section */ \ - cache_ptr->addend = ad; /* FIXME, is this right? */ \ - BFD_ASSERT(1); \ - break; \ - default: \ - cache_ptr->section = NULL; /* No section */ \ - cache_ptr->addend = ad; /* FIXME, is this right? */ \ - BFD_ASSERT(1); \ - break; \ - } \ - } \ - -void -swap_ext_reloc_in (abfd, bytes, cache_ptr, symbols) - bfd *abfd; - struct reloc_ext_bytes *bytes; - arelent *cache_ptr; - asymbol **symbols; -{ - int r_index; - int r_extern; - unsigned int r_type; - struct aoutdata *su = (struct aoutdata *)(abfd->tdata); - - cache_ptr->address = bfd_h_getlong (abfd, bytes->r_address); - - /* now the fun stuff */ - if (abfd->xvec->header_byteorder_big_p != false) { - r_index = (bytes->r_index[0] << 16) - | (bytes->r_index[1] << 8) - | bytes->r_index[2]; - r_extern = (0 != (bytes->r_bits[0] & RELOC_EXT_BITS_EXTERN_BIG)); - r_type = (bytes->r_bits[0] & RELOC_EXT_BITS_TYPE_BIG) - >> RELOC_EXT_BITS_TYPE_SH_BIG; - } else { - r_index = (bytes->r_index[2] << 16) - | (bytes->r_index[1] << 8) - | bytes->r_index[0]; - r_extern = (0 != (bytes->r_bits[0] & RELOC_EXT_BITS_EXTERN_LITTLE)); - r_type = (bytes->r_bits[0] & RELOC_EXT_BITS_TYPE_LITTLE) - >> RELOC_EXT_BITS_TYPE_SH_LITTLE; - } - - cache_ptr->howto = howto_table_ext + r_type; - MOVE_ADDRESS(bfd_h_getlong(abfd,bytes->r_addend)); -} - -void -swap_std_reloc_in (abfd, bytes, cache_ptr, symbols) - bfd *abfd; - struct reloc_std_bytes *bytes; - arelent *cache_ptr; - asymbol **symbols; -{ - int r_index; - int r_extern; - unsigned int r_length; - int r_pcrel; - int r_baserel, r_jmptable, r_relative; - struct aoutdata *su = (struct aoutdata *)(abfd->tdata); - - cache_ptr->address = bfd_h_getlong (abfd, bytes->r_address); - - /* now the fun stuff */ - if (abfd->xvec->header_byteorder_big_p != false) { - r_index = (bytes->r_index[0] << 16) - | (bytes->r_index[1] << 8) - | bytes->r_index[2]; - r_extern = (0 != (bytes->r_bits[0] & RELOC_STD_BITS_EXTERN_BIG)); - r_pcrel = (0 != (bytes->r_bits[0] & RELOC_STD_BITS_PCREL_BIG)); - r_baserel = (0 != (bytes->r_bits[0] & RELOC_STD_BITS_BASEREL_BIG)); - r_jmptable= (0 != (bytes->r_bits[0] & RELOC_STD_BITS_JMPTABLE_BIG)); - r_relative= (0 != (bytes->r_bits[0] & RELOC_STD_BITS_RELATIVE_BIG)); - r_length = (bytes->r_bits[0] & RELOC_STD_BITS_LENGTH_BIG) - >> RELOC_STD_BITS_LENGTH_SH_BIG; - } else { - r_index = (bytes->r_index[2] << 16) - | (bytes->r_index[1] << 8) - | bytes->r_index[0]; - r_extern = (0 != (bytes->r_bits[0] & RELOC_STD_BITS_EXTERN_LITTLE)); - r_pcrel = (0 != (bytes->r_bits[0] & RELOC_STD_BITS_PCREL_LITTLE)); - r_baserel = (0 != (bytes->r_bits[0] & RELOC_STD_BITS_BASEREL_LITTLE)); - r_jmptable= (0 != (bytes->r_bits[0] & RELOC_STD_BITS_JMPTABLE_LITTLE)); - r_relative= (0 != (bytes->r_bits[0] & RELOC_STD_BITS_RELATIVE_LITTLE)); - r_length = (bytes->r_bits[0] & RELOC_STD_BITS_LENGTH_LITTLE) - >> RELOC_STD_BITS_LENGTH_SH_LITTLE; - } - - cache_ptr->howto = howto_table_std + r_length + 4 * r_pcrel; - /* FIXME-soon: Roll baserel, jmptable, relative bits into howto setting */ - - MOVE_ADDRESS(0); -} - -/* Reloc hackery */ - -boolean -aout_slurp_reloc_table (abfd, asect, symbols) - bfd *abfd; - sec_ptr asect; - asymbol **symbols; -{ - unsigned int count; - size_t reloc_size; - PTR relocs; - arelent *reloc_cache; - size_t each_size; - - if (asect->relocation) return true; - - if (asect->flags & SEC_CONSTRUCTOR) return true; - - if (asect == obj_datasec (abfd)) { - reloc_size = exec_hdr(abfd)->a_drsize; - goto doit; - } - - if (asect == obj_textsec (abfd)) { - reloc_size = exec_hdr(abfd)->a_trsize; - goto doit; - } - - bfd_error = invalid_operation; - return false; - - doit: - bfd_seek (abfd, asect->rel_filepos, SEEK_SET); - each_size = obj_reloc_entry_size (abfd); - - count = reloc_size / each_size; - - - reloc_cache = (arelent *) bfd_zalloc (abfd, (size_t)(count * sizeof - (arelent))); - if (!reloc_cache) { -nomem: - bfd_error = no_memory; - return false; - } - - relocs = bfd_alloc (abfd, reloc_size); - if (!relocs) { - bfd_release (abfd, reloc_cache); - goto nomem; - } - - if (bfd_read (relocs, 1, reloc_size, abfd) != reloc_size) { - bfd_release (abfd, relocs); - bfd_release (abfd, reloc_cache); - bfd_error = system_call_error; - return false; - } - - if (each_size == RELOC_EXT_SIZE) { - register struct reloc_ext_bytes *rptr = (struct reloc_ext_bytes *) relocs; - unsigned int counter = 0; - arelent *cache_ptr = reloc_cache; - - for (; counter < count; counter++, rptr++, cache_ptr++) { - swap_ext_reloc_in(abfd, rptr, cache_ptr, symbols); - } - } else { - register struct reloc_std_bytes *rptr = (struct reloc_std_bytes *) relocs; - unsigned int counter = 0; - arelent *cache_ptr = reloc_cache; - - for (; counter < count; counter++, rptr++, cache_ptr++) { - swap_std_reloc_in(abfd, rptr, cache_ptr, symbols); - } - - } - - bfd_release (abfd,relocs); - asect->relocation = reloc_cache; - asect->reloc_count = count; - return true; -} - - - -/* Write out a relocation section into an object file. */ - -boolean -aout_squirt_out_relocs (abfd, section) - bfd *abfd; - asection *section; -{ - arelent **generic; - unsigned char *native, *natptr; - size_t each_size; - - unsigned int count = section->reloc_count; - size_t natsize; - - if (count == 0) return true; - - each_size = obj_reloc_entry_size (abfd); - natsize = each_size * count; - native = (unsigned char *) bfd_zalloc (abfd, natsize); - if (!native) { - bfd_error = no_memory; - return false; - } - - generic = section->orelocation; - - if (each_size == RELOC_EXT_SIZE) - { - for (natptr = native; - count != 0; - --count, natptr += each_size, ++generic) - swap_ext_reloc_out (abfd, *generic, (struct reloc_ext_bytes *)natptr); - } - else - { - for (natptr = native; - count != 0; - --count, natptr += each_size, ++generic) - swap_std_reloc_out(abfd, *generic, (struct reloc_std_bytes *)natptr); - } - - if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) { - bfd_release(abfd, native); - return false; - } - bfd_release (abfd, native); - - return true; -} - -/* This is stupid. This function should be a boolean predicate */ -unsigned int -aout_canonicalize_reloc (abfd, section, relptr, symbols) - bfd *abfd; - sec_ptr section; - arelent **relptr; - asymbol **symbols; -{ - arelent *tblptr = section->relocation; - unsigned int count; - - if (!(tblptr || aout_slurp_reloc_table (abfd, section, symbols))) - return 0; - - if (section->flags & SEC_CONSTRUCTOR) { - arelent_chain *chain = section->constructor_chain; - for (count = 0; count < section->reloc_count; count ++) { - *relptr ++ = &chain->relent; - chain = chain->next; - } - } - else { - tblptr = section->relocation; - if (!tblptr) return 0; - - for (count = 0; count++ < section->reloc_count;) - { - *relptr++ = tblptr++; - } - } - *relptr = 0; - - return section->reloc_count; -} - -unsigned int -aout_get_reloc_upper_bound (abfd, asect) - bfd *abfd; - sec_ptr asect; -{ - if (bfd_get_format (abfd) != bfd_object) { - bfd_error = invalid_operation; - return 0; - } - if (asect->flags & SEC_CONSTRUCTOR) { - return (sizeof (arelent *) * (asect->reloc_count+1)); - } - - - if (asect == obj_datasec (abfd)) - return (sizeof (arelent *) * - ((exec_hdr(abfd)->a_drsize / obj_reloc_entry_size (abfd)) - +1)); - - if (asect == obj_textsec (abfd)) - return (sizeof (arelent *) * - ((exec_hdr(abfd)->a_trsize / obj_reloc_entry_size (abfd)) - +1)); - - bfd_error = invalid_operation; - return 0; -} - -void -aout_reclaim_reloc (ignore_abfd, ignore) - bfd *ignore_abfd; - sec_ptr ignore; -{ - -} - - -alent * -aout_get_lineno(ignore_abfd, ignore_symbol) -bfd *ignore_abfd; -asymbol *ignore_symbol; -{ -return (alent *)NULL; -} - -void -aout_print_symbol(ignore_abfd, afile, symbol, how) -bfd *ignore_abfd; -PTR afile; -asymbol *symbol; -bfd_print_symbol_enum_type how; -{ - FILE *file = (FILE *)afile; - - switch (how) { - case bfd_print_symbol_name_enum: - fprintf(file,"%s", symbol->name); - break; - case bfd_print_symbol_type_enum: - fprintf(file,"%4x %2x %2x",(unsigned)(aout_symbol(symbol)->desc & 0xffff), - (unsigned)(aout_symbol(symbol)->other & 0xff), - (unsigned)(aout_symbol(symbol)->type)); - break; - case bfd_print_symbol_all_enum: - { - CONST char *section_name = symbol->section == (asection *)NULL ? - "*abs" : symbol->section->name; - - bfd_print_symbol_vandf((PTR)file,symbol); - - fprintf(file," %-5s %04x %02x %02x %s", - section_name, - (unsigned)(aout_symbol(symbol)->desc & 0xffff), - (unsigned)(aout_symbol(symbol)->other & 0xff), - (unsigned)(aout_symbol(symbol)->type & 0xff), - symbol->name); - } - break; - } -} - -/* - provided a bfd, a section and an offset into the section, calculate - and return the name of the source file and the line nearest to the - wanted location. -*/ - -boolean -DEFUN(aout_find_nearest_line,(abfd, - section, - symbols, - offset, - filename_ptr, - functionname_ptr, - line_ptr), - bfd *abfd AND - asection *section AND - asymbol **symbols AND - bfd_vma offset AND - CONST char **filename_ptr AND - CONST char **functionname_ptr AND - unsigned int *line_ptr) -{ - /* Run down the file looking for the filename, function and linenumber */ - asymbol **p; - static char buffer[100]; - bfd_vma high_line_vma = ~0; - bfd_vma low_func_vma = 0; - asymbol *func = 0; - *filename_ptr = abfd->filename; - *functionname_ptr = 0; - *line_ptr = 0; - if (symbols != (asymbol **)NULL) { - for (p = symbols; *p; p++) { - aout_symbol_type *q = (aout_symbol_type *)(*p); - switch (q->type){ - case N_SO: - *filename_ptr = q->symbol.name; - if (obj_textsec(abfd) != section) { - return true; - } - break; - case N_SLINE: - - case N_DSLINE: - case N_BSLINE: - /* We'll keep this if it resolves nearer than the one we have already */ - if (q->symbol.value >= offset && - q->symbol.value < high_line_vma) { - *line_ptr = q->desc; - high_line_vma = q->symbol.value; - } - break; - case N_FUN: - { - /* We'll keep this if it is nearer than the one we have already */ - if (q->symbol.value >= low_func_vma && - q->symbol.value <= offset) { - low_func_vma = q->symbol.value; - func = (asymbol *)q; - } - if (*line_ptr && func) { - CONST char *function = func->name; - char *p; - strncpy(buffer, function, sizeof(buffer)-1); - buffer[sizeof(buffer)-1] = 0; - /* Have to remove : stuff */ - p = strchr(buffer,':'); - if (p != NULL) {*p = NULL; } - *functionname_ptr = buffer; - return true; - - } - } - break; - } - } - } - - return true; - -} - -int -DEFUN(aout_sizeof_headers,(ignore_abfd), - bfd *ignore_abfd) -{ - return 0; /* FIXME, this is the wrong value! */ -} diff --git a/bfd/aoutx.c b/bfd/aoutx.c deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/bfd/archures.h b/bfd/archures.h deleted file mode 100755 index db14d1d228..0000000000 --- a/bfd/archures.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Intel 960 machine types */ - -/* Copyright (C) 1990, 1991 Free Software Foundation, Inc. - -This file is part of BFD, the Binary File Diddler. - -BFD is free software; you can 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. - -BFD is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with BFD; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* - Machine architecture and type definitions for BFD. - - These definitions are only used inside the BFD package. External programs - access them by calling bfd_scan_arch_mach() and bfd_arch_mach_string(). - - The architectures themselves are defined in bfd.h since they are an - enum needed for BFD structs. Numeric machine types are simply used - as-is, e.g. 68020. Non-numeric machine types like "i960CA" have - names in this file. */ - - -/* $Id$ */ - - diff --git a/bfd/awkscan b/bfd/awkscan deleted file mode 100755 index 69b0ceaa3b..0000000000 --- a/bfd/awkscan +++ /dev/null @@ -1,12 +0,0 @@ -# NOTE: BEGIN pattern gives errors if other than 1st line; -# END ditto if other than last. -BEGIN { print "@c ------------------------------START TEXT FROM " FILENAME } -# -# Keep /*doc* blocks (terminated by either */ or *-*/) -/^\/\*doc\*/,/^\*\/|^\*-\*\// -# -# Also keep two kinds of /*proto blocks -/^\/\*proto\*/,/^\*\/|^\*-\*\// -/^\/\*proto-internal\*/,/^\*\/|^\*-\*\// -# -END { print "@c ------------------------------END TEXT FROM " FILENAME } diff --git a/bfd/awkscan-ip b/bfd/awkscan-ip deleted file mode 100755 index 73bd61fa95..0000000000 --- a/bfd/awkscan-ip +++ /dev/null @@ -1,8 +0,0 @@ -# Awk filter, 1st filter for BFD internal prototype file extraction -# -# keep /*proto-internal blocks -/^\/\*proto-internal\*/,/^\*\/|^\*-\*\// -# -# Apparent bug in sed can discard last line in some situations; therefore -# make last line harmless. -END { print "\n" } diff --git a/bfd/awkscan-p b/bfd/awkscan-p deleted file mode 100755 index c7fe79fb34..0000000000 --- a/bfd/awkscan-p +++ /dev/null @@ -1,8 +0,0 @@ -# Awk filter, 1st filter for BFD prototype file extraction -# -# keep /*proto blocks -/^\/\*proto\*/,/^\*\/|^\*-\*\// -# -# Apparent bug in sed can discard last line in some situations; therefore -# make last line harmless. -END { print "\n" } diff --git a/bfd/bfd.doc b/bfd/bfd.doc deleted file mode 100755 index c74c8ce48e..0000000000 --- a/bfd/bfd.doc +++ /dev/null @@ -1,705 +0,0 @@ -This file contains -*- Text -*-. - -BFD is a set of routines for reading and writing binary files. - -The user should call only the interface routines at the end of bfd.h. -The one I'm working out of is /4/gumby/bfd/bfd.h - - Sample "strip" program using BFD: - - #include "bfd.h" - - doit () - { - ibfd = bfd_openr(...) - obfd = bfd_openw(...) - bfd_check_format (ibfd, object); - bfd_set_format (obfd, object); - - bfd_set_arch_mach (obfd, ...) - bfd_set_start_address (obfd, ...) - etc... - - [optionally: - asymbol * foo = malloc (get_symtab_upper_bound (ibfd)); - bfd_canonicalize_symtab (ibfd, foo); - - bfd_set_symtab (obfd, foo, updated_symbol_count); - ] - - bfd_map_over_sections (abfd, setup, NULL); - bfd_map_over_sections (abfd, cleaner, NULL); - - bfd_close (obfd); - bfd_close (ibfd); - } - - setup (ibfd, sect) - { - osect = make_section (obfd, bfd_section_name (ibfd, sect)); - bfd_set_section_size (obfd, osect, bfd_section_size (ibfd, sect)); - ... - } - - cleaner (ibfd, sect) - { - osect = bfd_get_section_by_name (obfd, - bfd_section_name (ibfd, sect)); - bfd_copy_section (ibfd, sect, obfd, osect); - [perhaps: bfd_set_reloc (osect, NULL, 0); ] - } - - - -BFD is a package for manipulating binary files required for developing -programs. It implements a group of structured operations designed to -shield the programmer from the underlying representation of these -binary files. It understands object (compiled) files, archive -libraries, and core files. It is designed to work in a variety of -target environments. - -To use the library, include bfd.h and link with libbfd.a. - -A bfd iteself is a representation for a particular file. It is opened -in a manner similar to a file; code then manipulates it rather than -the raw files. - -BFD makes a distinction between TARGETS (families of file formats) and -FORMATS (individual file formats). For instance, the "sun4os4" target -can handle core, object and archive formats of files. The exact -layout of the different formats depends on the target environment. - -The target "default" means the first one known (usually used for -environments that only support one format, or where the common format -is known at compile or link time). The target NULL means the one -specified at runtime in the environment variable GNUTARGET; if that is -null or not defined then the first entry in the target list is chosen -(on output), or all targets are searched (on input) to find a matching -one.. - -Most programs should use the target NULL. - -There is a way to get a list of the names of all the targets: -char** bfd_target_list () - This function returns a freshly-malloced list of all the - defined targets (or NULL if it could not malloc). The names - are read-only. You could use this to prompt the user, or - perhaps to error-check. - -char * bfd_format_string (bfd_format format) - This function will give you a printable, single-word description - (like "core" or "archive") for a bfd format. - -Error handling - -General rules: -functions which are boolean return true on success and false on failure -(unless they're a predicate). Functions which return pointers to -objects return NULL on error. The specifics are documented with each -function. - -If a function fails, you should check the variable bfd_error. If the -value is no_error, then check the C variable errno just as you would -with any other program. The other values bfd_error may take on are -documented in bfd.h. - -If you would prefer a comprehensible string for the error message, use -the function bfd_errmsg: - char * bfd_errmsg (error_tag) -This function returns a read-only string which documents the error -code. If the error code is no_error then it will return a string -depending on the value of errno. - -bfd_perror() is like the perror() function except it understands -bfd_error. - -Operations on bfds themselves - -bfd * bfd_openr (char *filename, char *target); -bfd * bfd_fdopenr (int fd, char *target, char *filename); - - Open a binary file for reading. TARGET is the type of the file, - a char string like "sun4os4" or "elf". (Note this is not the - "function" of the file, e.g. an object versus a core file - versus an archive, but instead describes how all these files - are encoded.) Returns a new bfd or NULL upon failure. - -bfd * bfd_openw (char *filename, char *target); - - Open a file named `filename' for writing. If an existing - file has the same name, then it will be overwritten by a - successful bfd_close on the returned bfd. Will return either - a new bfd or NULL upon failure. - -boolean bfd_close (bfd *abfd); - - Close a BFD opened for either reading or writing. May involve - several filesystem operations, depending on the data format; - some things may not be known to the system until file-closing - time. Returns true if it successfully wrote the file, false - if not. A false return will not leave a partially-written - file behind with the name supplied to bfd_openw. - - On a bfd open for reading will generally successfully - complete. - - It is an error to call this on a file opened from inside an - archive. - - FIXME -- show which error codes may be recoverable and - followed by another call to bfd_close! - - -The defined formats are specified by the enumeration bfd_format. - -boolean bfd_check_format (bfd *abfd, bfd_format format); - - This routine must be called after a bfd_openr. It sets up - internal data structures based on the contents of the file. - It returns FALSE if the file is not really in the specified - format. - -boolean bfd_set_format (bfd *abfd, bfd_format format); - - This routine must be called after a bfd_openw. It sets up - internal data structures for the proper format of file. - It returns FALSE if that format is not supported for output - (e.g. core files). - -The following macros may be used to obtain information about a bfd: - -bfd_get_filename -- returns a pointer to a null-terminated string - which names the bfd's file, or NULL if that is not known. - Don't side-effect this string! -bfd_get_format -- returns the format code for the bfd. -bfd_get_target -- returns the string which names the bfd's target. -bfd_get_mtime -- returns an time_t indicating the modification time of an - input bfd, if that could be determined, or 0 of not. - -Object files have certain properties. For input bfds, these -properties may be read at any time. For output bfds you should set -them before you begin building any sections. - -bfd_vma bfd_get_start_address (bfd *abfd); - - Returns the address in an object file where execution will begin. - -boolean bfd_set_start_address (bfd *abfd, int vma); - - Set the address where execution will start in an object file. - - If the address you select is incorrect for your architecture - (for instance, if it's required to be on a page_boundary and - your supplied starting address is not, then you may get the - invalid_operation error. It is not always possible to - generate an error in this case. - -An object file has an architecture, which is the general instruction -set of the instructions that it contains. Architectures are defined in -enum bfd_architecture in bfd.h. New architectures can be added by -putting them in the enum, updating architectures.c, and adding code to -handle them for the object files that know that architecture. The -bfd_architecture values are not stored in files, but are only used -within the BFD library and its callers. - -An object file also has a machine type, which is the specific machine -within the architecture. For example, if the architecture is bfd_arch_m68k, -the Motorola 68000 series, then the machine type might be 68010, the mc68010 -chip. For architectures such as the SPARC where specific versions of -the architecture exist, the version number should probably be used. - -Particular object file formats may or may not store the machine architecture -and type. When copying an object file, you should copy these fields. -Most callers of BFD will not need to know the particular values that -these fields contain, but will instead propagate them from file to file, -or compare the architectures from two files. - -enum bfd_architecture bfd_get_architecture (bfd *abfd); -unsigned long bfd_get_machine (bfd *abfd); - - Get the machine type and architecture. - -boolean bfd_set_arch_mach (bfd *abfd, enum bfd_architecture arch, - unsigned long machine); - - Set the architecture and machine type. The result is true - if the object file can exactly represent the specified type. - The result is false otherwise. - -boolean bfd_arch_compatible (bfd *abfd, bfd *bbfd, - enum bfd_architecture *res_arch, - unsigned long *res_machine); - - Decides whether two BFD's contain compatible architectures and - machine types. If the result is TRUE and the res_arch and - res_machine pointers are non-NULL, the resulting "merged" - architecture and machine type are returned through the pointers. - A linker could call this to decide whether two object files - can be linked, and to deterine the arch and machine type of - the resulting file. - -char * bfd_printable_arch_mach (enum bfd_architecture arch, - unsigned long machine); - - Returns a printable string that represents the particular - combination of architecture and machine type. - -boolean bfd_scan_arch_mach (char *string, enum bfd_architecture *archp, - unsigned long *machinep); - - Examines a printable string and tries to extract an - architecture and machine type from it. The intended use is for - parsing specifications from the user, e.g. command line - arguments. The result is true if a known architecture was - found, and the resulting architecture and machine type are - stored through the argument pointers. Note that an - architecture scannable by this function might not be - representable by the particular object file format in use. - (i.e. bfd_set_arch_mach might return false). - - -There are also a number of boolean flags which apply to object bfds. - -flagword bfd_get_file_flags (bfd *abfd); - - returns a flagword containing the bfd's flags. - -boolean bfd_set_file_flags (bfd *abfd, flagword flags, - boolean on_or_off); - - sets (on_or_off == true) or clears (on_or_off == false) the flags - specified by flagword. All other flags are unaffected. - Some flag combinations don't make sense; It is not always - possible to detect them (since they may depend on other information). - Returns true if the flags could be modified as requested, - false if not. Upon a false return, no flags will have been - altered. - - -flagword bfd_applicable_file_flags (bfd *abfd); - - returns a flagword with bits set for all the flags which are - meaningful for the bfd. - -The flags are: - HAS_RELOC -- file contains unresolved relocation information. - EXEC_P -- file can be executed. These two may both be on in the - case of some dynamically-linked binaries. - HAS_LINENO -- has line number information. - HAS_DEBUG -- has debugging information. - HAS_SYMS -- has any symbols. - HAS_LOCALS -- has local symbols. - DYNAMIC -- binary is dynamically linked. - WP_TEXT -- text is write-protected - D_PAGED -- binary should be demand-paged - -These flags are one bit wide and may be OR-ed together with |. - -If you are building a large application with bfd there may be data -specific to your program that you may wish to associate with a bfd. -Rather than require you to build a parallel table structure, bfd -provides a void* pointer in each bfd for arbitrary user data. The -macro bfd_usrdata (bfd *abfd) extracts these data; you may set them -with = (ie bfd_usrdata (my_bfd) = frob_it (my_bfd, moon_phase);). - -Object and core files have sections. - -File sections are represented by opaque pointers. You may map over -the sections of a file or you may ask for one by name. Note that not -all files may have all the possible sections. - -Section pointers are valid from the time you get them until the bfd -to which they refer is closed. - -When doing output, you must set up all the file's sections before -outputting to any. All that means is that all the file's sections -must have already been created and their size set before output -commences. - -Each section contains some small information, plus three chunks of -data in the object file: contents, relocation, and line numbers. -In some file formats (e.g. a.out), the line number part is always -empty, and line number information (if any) is instead recorded in -the symbol table. - -sec_ptr bfd_get_section_by_name (bfd *abfd, char *name); - Returns a section named NAME, or NULL if none by that name - exists. Works on input and output bfds. - -sec_ptr bfd_make_section (bfd *abfd, char *name); - Creates a section named name in the output bfd abfd. - returns NULL if it cannot create the section (if, for instance, - the output format does not permit such a section). If a - section with that name already exists, it is returned; a new - one with the same name is NOT created. - -unsigned int bfd_count_sections (bfd *abfd) - - This function returns the number of sections in the bfd abfd. - -void bfd_map_over_sections (bfd *abfd, void (*operation)(), - void *user_storage); - - This is how you operate on all sections of an input file. - Pass in a function pointer. The function will be called for each - section of the file, in random order. It will be passed - three arguments: the bfd, the sec_ptr for the section, and - whatever was passed in as user_storage. - -char * bfd_section_name (bfd *abfd, sec_ptr ptr); - - Produces the name of a section, e.g. ".text" or ".data". - This will produce arbitrary names for files with extensible - section names (e.g. COFF, ELF) so don't assume that you will - only see a few values here. - -long bfd_section_size (bfd *abfd, sec_ptr ptr); - - The size of a section in bytes. Result == -1 for error. - -boolean bfd_set_section_size (bfd *abfd, sec_ptr section unsigned long size); - - Set the size of a section. This must be done before any data - transfer is done for the section. - -bfd_vma bfd_section_vma (bfd *abfd, sec_ptr ptr); - - Virtual memory address where a section "belongs". - -boolean bfd_set_section_vma (bfd *abfd, bfd_vma vma); - - Set the virtual memory address of a section. - -int bfd_get_section_alignment (bfd *abfd, sec_ptr ptr); - - returns the alignment of a section. If alignment is not - possible, return value is undefined. - -boolean bfd_set_section_alignment (bfd *abfd, sec_ptr ptr, int alignment) - - returns true if it can set the section to the requested value. - Alignment is an integer; it refers to the power of two - specifying the byte boundary we want (ie 0 is byte-aligned; 4 - is word aligned). If the requested alignment is not available - any existing value is unchanged. - -Sections have properties just as object files may: - -flagword bfd_get_section_flags (bfd *abfd, sec_ptr section); - - returns a flagword containing the section's flags. - -boolean bfd_set_section_flags (bfd *abfd, sec_ptr section, - flagword flags, boolean on_or_off); - - sets (on_or_off == true) or clears (on_or_off == false) the flags - specified by flagword. All other flags are unaffected. - Some flag combinations don't make sense; It is not always - possible to detect them (since they may depend on other information). - Returns true if the flags could me modified as requested, - false if not. Unpon a false return, no flags will have been - altered. - -flagword bfd_applicable_section_flags (bfd *abfd); - - returns a flagword with bits set for all the flags which are - meaningful for a section. - -The flags are: - - SEC_BALIGN -- segment can be byte-aligned. - SEC_RELOC -- segment should be relocated. - SEC_ALLOC -- when converted into a memory image with the intent of - constructing a runable process, memory space will be - allocated for this section. - SEC_LOAD -- when converted into a memory image with the intent of - constructing a runable process, section contents will be - copied from the object file into memory. When this flag - is set, SEC_ALLOC is guaranteed to also be set. - SEC_HAS_CONTENTS -- The contents of this section exist in the - object file. Sections whose contents do not exist in the - object file may still have their contents read. On read, - a segment filled with zeroes will be invented to satisfy - the read request. It is an error to attempt to set the - contents of a section that has no contents. - -These last three probably need some explanation. In a traditional, -native unix object format, there are three real sections, text, data, -and bss. The text section will be allocated memory on exec, and will -be loaded from file into memory on exec. So the flags for a -traditional unix text section would typically be at least (SEC_ALLOC | -SEC_LOAD | SEC_HAS_CONTENTS). The data section has basically these -same traits. The bss section, however is a little different. It is -not relocated, and it is not loaded from file on exec, but it is -allocated memory on exec. Thus, its flags would be more like -(SEC_ALLOC). It is possible to have a section which is the converse -of the bss section. That is, (SEC_HAS_CONTENTS & ~SEC_ALLOC). This -could be anything from profiling information or notes from one pass of -a toolchain to another to time and version stamp information. - -Note that the section flags currently lack information on position -dependance. - -boolean bfd_get_section_contents (bfd *abfd, sec_ptr section, - unsigned char *location, - int offset, int count); - - Stores count bytes from the section's contents starting at - offset from within those contents. The values are stored into - location. Returns true if it could do so. Supplying invalid - values for offset and count will produce unpredictable results. - -boolean bfd_set_section_contents (bfd *abfd, sec_ptr section, - unsigned char *location, - int offset, int count); - Stores count bytes from location into offset within the - section contents. You need not write all the contents contiguously - (that is, you may write words 5-7 followed by 0-4 if you - wish). However once you start writing into a section, any - other sections into which you have previously written are - considered finished, and you may not write in them any more. - -*** Line numbers *** - -bfd_get_section_lineno_size (bfd *abfd, sec_ptr section); - Returns how many bytes of line numbers are associated with this - section. - -bfd_set_section_lineno_size (bfd *abfd, sec_ptr section, unsigned long val); - Sets the number of bytes of line numbers that this section should - contain. - -boolean bfd_get_section_linenos (bfd *abfd, sec_ptr section, - unsigned char *location, - int offset, int count); - Same as get_section_contents, except that it works on the linenos - for this section. - -boolean bfd_set_section_linenos (bfd *abfd, sec_ptr section, - unsigned char *location, - int offset, int count); - Same as set_section_contents, except that it works on the linenos - for this section. - -As with files, you may associate arbitrary program-specific data with -a section of a bfd. The following two functions are provided for -manipulating these data: - -void * bfd_get_section_userdata (bfd *abfd, sec_ptr section) - Returns whatever was stored in section's user data, or NULL if nothing. - -boolean bfd_set_section_userdata (bfd *abfd, sec_ptr section, void *contents) - Set the section contents. Returns true if it can, false if not. - -Core files - -Core files are currently only supported for reading. - -Apart from opening them, looking at the various sections (generally -the .data, .stack, and .regs sections; maybe a .user_struct section -eventually), you can make some queries about the status of the core -file, detailed below. The ".regs" section contains the general and -floating point registers of the process that died, in some machine- -specific order and format "intended to be unsurprising to someone who -knows the machine". - -char * bfd_core_file_failing_command (bfd *abfd); - - The command name of the program that failed, creating the core file. - The result is NULL if BFD can't figure out what the failing command was. - -int bfd_core_file_failing_signal (bfd *abfd); - - The signal number which caused the program to die, causing the - core file to be created. It will be positive if valid. - -boolean core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd); - - For debuggers, checks whether a core file "matches" (is likely to - have come from) an executable file. This will not be perfect on - most systems, but will just provide a way to reject gross mismatches. - -Archives. - -An archive is a special file which can contain other files. -Originally it was intended to be a general way to group files, the way -tar is today. But now it is used almost exclusively to hold object -files. - -An archive may be opened for reading or writing just like any other -bfd. Once it is open for reading you may obtain bfds for each of the -files contained within it with the following function: - -bfd * bfd_openr_next_archived_file (bfd *arch_bfd, bfd *last_file); - - If called with NULL as the second argument, returns the first - file contained in the archive arch_bfd. If called with a file - contained within arch_bfd, returns the one which follows that - one, or NULL if it was the last. Returns NULL also if the - bfd supplied as last_file did not come from the archive arch_bfd. - -Any bfd open for read may be placed in an output archive. When the -output archive is closed, the contents will be placed into the -archive. - -You control the order of files in an archive. You set the first one -with the following function: - -boolean bfd_set_archive_head (bfd *output_archive, bfd *new_head) - - This function sets the first file in the archive - output_archive to be the bfd new_head. - -bfd's contain a pointer called next, which is bfd *. It is used by -bfd_close when an archive is closed to decide which file should next -go into the archive. So to place a group of files into an archive, -open bfds for each of them, chain them together using the next pointer -in the order you desire (be sure to store NULL into the final one's -next pointer), then do bfd_set_archive_head with the head of the -chain. The next pointer may be freely smashed at any time; it is only -looked at when closing an output archive. - -bfds for files contained within archives are normal bfds; you can do -any input operations on them that you can do with a normal bfd. - -bfd_my_archive is a macro which takes an input bfd and returns NULL if -it lives in the filesystem and a bfd if it is contained in an archive. -In the latter case, the returned bfd is the archive itself. - -Archives containing only object files may have a "map" -- a table in -the front which maps external symbols to the files which contain them. - -Archive maps will refer only to object files; if an archive contains a -file which is not an archive that file will of course not appear in -the map. - -boolean bfd_has_map (bfd *archive_bfd) - - This macro takes a bfd of an archive and returns true or - false depending on whether the bfd has a map. For output - bfds this may be set to true or false, depending on whether - you want the map to be maintained or not. For some targets, - setting this to false will cause no map to be generated; for - others it will merely cause an empty map to be created, since - a map is required by that target. - -For archives with maps you may use the following function: - -int bfd_get_next_mapent (bfd *abfd, int prev, char **name) - - You may use this to step through all the entries in the archive - map. Supply BFD_NO_MORE_SYMBOLS as the 'prev' entry to get the - first entry; then use successive returned values from this - function to get the succeeding ones. The name of the next entry - will be stored through the pointer name. - - This function returns BFD_NO_MORE_SYMBOLS when there are no more - entries or on error. - -bfd * bfd_get_elt_at_index (abfd, int index) - - This function takes an index as returned by bfd_get_next_mapent - and returns the bfd which corresponds to that entry. Returns NULL - on error. - -Symbol and relocation information. - -Symbol-table information is the area of greatest incompatibility. -bfd has a canonical symbol representation; all formats are parsed into -and out of it. - -Note that canonicalize_symtab takes a pointer to an array of pointers -to canonical symbols. This is necessary so that the end of the array -can be marked with NULL. You may shuffle the pointers and you may -clobber the symbol contents. But don't move the symbols themselves. - -unsigned int bfd_get_symtab_upper_bound (bfd *abfd); - - Returns the maximum number of bytes that would be taken by - the output of canonicalize_symtab. Returns 0 on error. - -unsigned int bfd_canonicalize_symtab (bfd *abfd, asymbol **location); - - Produces a symbol table in canonical format at LOCATION, which - must be of size specified by get_symtab_upper_bound bytes. - Not all those bytes may be used. Returns the number of - symbol pointers written. Returns 0 upon error. - -boolean bfd_set_symtab (bfd *outbfd, asymbol **location, - unsigned int symcount); - - Takes a generic symbol table and an output bfd. Used to set - the symbol table for an output bfd. Do not change the table - after using this function (although the storage may be - reclaimed once the bfd has been closed). - -If you're done with the symbol table you can tell bfd about it by -calling bfd_reclaim_symbol_table, which takes a bfd. Calling this -function will also reclaim any relocation entries you may have -requested. If you don't use this function, bfd will keep around all -symbol information until the bfd is closed. - -Similarly, relocations have a canonical format. See the file bfd.h for -the exact definition. It is similar to the sun-4 relocation format. -Please note that: -o - Each relocation has a pointer to a generic symbol. -o - Not all values of reloc_type are supported for all targets. There - is a bitvector which explains which are; you can index into it by - relocation type. The macro which extracts it is bfd_valid_reloc_types. - -Since relocation information is saved on a per-section basis, the -interface is slightly different from that of the symbol table: - -unsigned int get_reloc_upper_bound (bfd *abfd, sec_ptr asect); - - Returns the maximum number of bytes that would be taken by - the output of canonicalize_reloc. Returns 0 on error. - -unsigned int canonicalize_reloc (bfd *abfd, sec_ptr asect, arelent *location); - - Produces a relocation table in canonical format at LOCATION, - which must be of size specified by get_reloc_upper_bound - bytes. Not all those bytes may be used. Returns the number - of entries written. Returns 0 upon error. - -boolean bfd_set_reloc (bfd *outbfd, sec_ptr asect, arelent *location, - unsigned int count); - - Takes a generic reloc table and an output bfd. Used to set - the reloc table for an output bfd. Do not change the table - after using this function (although the storage may be - reclaimed once the bfd has been closed). - -Byte-swapping - -Unfortunately, not all machines have the same byte order. Worse, -storage layout is in general highly machine-dependent. Although bfd -can hide that from you in most cases, it cannot do so with the section -contents, since they are totally uninterpreted. Hence you must -byte-swap those data yourself. This is not usually much of an issue -since you should just generate your data in the correct byte order. - -[THIS IS WRONG AND ALSO DOES NOT REFLECT THE CODE WHICH IS CORRECT] - -Fortunately, bfd can tell if byte-swapping or realignment is required -at all! The macro bfd_bit_twiddle_required takes a pointer to a bfd -and returns true if byte-swapping is required, false if not. - -However if you don't wish to check this you may just use the following -functions which will do the conversions required: - - -long bfd_getlong (bfd *abfd, unsigned char *ptr); - bfd_putlong (bfd *abfd, unsigned char *ptr, long time); - -short bfd_getshort (bfd *abfd, unsigned char *ptr); - bfd_putshort (bfd *abfd, unsigned char *ptr, short stop); - - These functions take a pointer that points to data which is, - or will be, part of a section contents. They extract numbers - from the data, or insert numbers into the data. The argument - or result is in the host's number format; the data stored at - the pointer or retrieved from it is in the target's number format. - Typically this transfer is either a no-op or is a byte-swap; - sometimes it involves an access to a "misaligned" location from - the host's point of view.. diff --git a/bfd/bfd.doc.ps b/bfd/bfd.doc.ps deleted file mode 100755 index 70638d5d77..0000000000 --- a/bfd/bfd.doc.ps +++ /dev/null @@ -1,4564 +0,0 @@ -%!PS-Adobe-2.0 -%%Creator: dvips 5.47 Copyright 1986-91 Radical Eye Software -%%Title: bfd.dvi -%%Pages: 61 1 -%%BoundingBox: 0 0 612 792 -%%EndComments -%%BeginProcSet: tex.pro -/TeXDict 200 dict def TeXDict begin /N /def load def /B{bind def}N /S /exch -load def /X{S N}B /TR /translate load N /isls false N /vsize 10 N /@rigin{ -isls{[0 1 -1 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale -Resolution VResolution vsize neg mul TR matrix currentmatrix dup dup 4 get -round 4 exch put dup dup 5 get round 5 exch put setmatrix}N /@letter{/vsize 10 -N}B /@landscape{/isls true N /vsize -1 N}B /@a4{/vsize 10.6929133858 N}B /@a3{ -/vsize 15.5531 N}B /@ledger{/vsize 16 N}B /@legal{/vsize 13 N}B /@manualfeed{ -statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N -/FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{/nn 8 dict N nn begin -/FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array -/BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 -array copy cvx N load 0 nn put /ctr 0 N[}B /df{/sf 1 N /fntrx FMat N df-tail} -B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]N df-tail}B /E{pop nn dup definefont -setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup -length 4 sub get}B /ch-xoff{128 ch-data dup length 3 sub get sub}B /ch-yoff{ -ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B -/ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 -N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S -dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 -ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice -ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 add]{ch-image} -imagemask restore}B /D{/cc X dup type /stringtype ne{]}if nn /base get cc ctr -put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf -div put}if put /ctr ctr 1 add N}B /I{cc 1 add D}B /bop{userdict /bop-hook -known{bop-hook}if /SI save N @rigin 0 0 moveto}N /eop{clear SI restore -showpage userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook -known{start-hook}if /VResolution X /Resolution X 1000 div /DVImag X /IE 256 -array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for}N /p /show load N -/RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X -/rulex X V}B /V statusdict begin /product where{pop product dup length 7 ge{0 -7 getinterval(Display)eq}{pop false}ifelse}{false}ifelse end{{gsave TR -.1 -.1 -TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 --.1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /a{ -moveto}B /delta 0 N /tail{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{ -S p tail}B /c{-4 M}B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B -/j{3 M}B /k{4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w -}B /q{p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p -a}B /bos{/SS save N}B /eos{clear SS restore}B end -%%EndProcSet -%%BeginProcSet: special.pro -TeXDict begin /SDict 200 dict N SDict begin /@SpecialDefaults{/hs 612 N /vs -792 N /ho 0 N /vo 0 N /hsc 1 N /vsc 1 N /ang 0 N /CLIP false N /BBcalc false N -/p 3 def}B /@scaleunit 100 N /@hscale{@scaleunit div /hsc X}B /@vscale{ -@scaleunit div /vsc X}B /@hsize{/hs X /CLIP true N}B /@vsize{/vs X /CLIP true -N}B /@hoffset{/ho X}B /@voffset{/vo X}B /@angle{/ang X}B /@rwi{10 div /rwi X} -B /@llx{/llx X}B /@lly{/lly X}B /@urx{/urx X}B /@ury{/ury X /BBcalc true N}B -/magscale true def end /@MacSetUp{userdict /md known{userdict /md get type -/dicttype eq{md begin /letter{}N /note{}N /legal{}N /od{txpose 1 0 mtx -defaultmatrix dtransform S atan/pa X newpath clippath mark{transform{ -itransform moveto}}{transform{itransform lineto}}{6 -2 roll transform 6 -2 -roll transform 6 -2 roll transform{itransform 6 2 roll itransform 6 2 roll -itransform 6 2 roll curveto}}{{closepath}}pathforall newpath counttomark array -astore /gc xdf pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{ -PaintBlack}if}N /txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR -pop 1 -1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3 -get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip -not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if -yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{noflips{TR pop pop 270 -rotate 1 -1 scale}if xflip yflip and{TR pop pop 90 rotate 1 -1 scale ppr 3 get -ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not -and{TR pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip -not and{TR pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 S TR}if} -ifelse scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy -TR .96 dup scale neg S neg S TR}if}N /cp{pop pop showpage pm restore}N end}if} -if}N /normalscale{Resolution 72 div VResolution 72 div neg scale magscale{ -DVImag dup scale}if}N /psfts{S 65536 div N}N /startTexFig{/psf$SavedState save -N userdict maxlength dict begin /magscale false def normalscale currentpoint -TR /psf$ury psfts /psf$urx psfts /psf$lly psfts /psf$llx psfts /psf$y psfts -/psf$x psfts currentpoint /psf$cy X /psf$cx X /psf$sx psf$x psf$urx psf$llx -sub div N /psf$sy psf$y psf$ury psf$lly sub div N psf$sx psf$sy scale psf$cx -psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub TR /showpage{}N -/erasepage{}N /copypage{}N /p 3 def @MacSetUp}N /doclip{psf$llx psf$lly -psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll -S lineto S lineto S lineto closepath clip newpath moveto}N /endTexFig{end -psf$SavedState restore}N /@beginspecial{SDict begin /SpecialSave save N gsave -normalscale currentpoint TR @SpecialDefaults}N /@setspecial{CLIP{newpath 0 0 -moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto closepath clip}if ho vo TR -hsc vsc scale ang rotate BBcalc{rwi urx llx sub div dup scale llx neg lly neg -TR}if /showpage{}N /erasepage{}N /copypage{}N newpath}N /@endspecial{grestore -clear SpecialSave restore end}N /@defspecial{SDict begin}N /@fedspecial{end}B -/li{lineto}B /rl{rlineto}B /rc{rcurveto}B /np{/SaveX currentpoint /SaveY X N 1 -setlinecap newpath}N /st{stroke SaveX SaveY moveto}N /fil{fill SaveX SaveY -moveto}N /ellipse{/endangle X /startangle X /yrad X /xrad X /savematrix matrix -currentmatrix N TR xrad yrad scale 0 0 1 startangle endangle arc savematrix -setmatrix}N end -%%EndProcSet -TeXDict begin 1000 300 300 @start /Fa 1 59 df<70F8F8F87005057C840D>58 -D E /Fb 1 59 df<78FCFCFCFC7806067B8510>58 D E /Fc 32 120 df<00FC00018200070300 -0607000E02000E00000E00000E00000E00000E0000FFFF000E07000E07000E07000E07000E0700 -0E07000E07000E07000E07000E07000E07000E07000E07000E07007F0FE0131A809915>12 -D45 D<078018603030303060186018E01CE01CE01CE01CE01CE01CE01C -E01CE01CE01CE01CE01C6018601870383030186007800E187E9713>48 D<03000700FF00070007 -00070007000700070007000700070007000700070007000700070007000700070007000700FFF0 -0C187D9713>I<0F80106020304038803CC01CE01C401C003C003800380070006000C001800100 -020004040804100430083FF87FF8FFF80E187E9713>I<0F8010E0207060787038203800780070 -0070006000C00F8000E000700038003C003CE03CE03CC03C4038407030E00F800E187E9713>I< -00300030007000F000F001700370027004700C7008701070307020704070C070FFFF0070007000 -7000700070007007FF10187F9713>I<30183FF03FE03FC02000200020002000200027C0386020 -3000380018001C001C401CE01CE01C80184038403030E00F800E187E9713>I<01E006100C1818 -383038300070006000E000E7C0E860F030F018E018E01CE01CE01C601C601C7018301830301860 -07C00E187E9713>I<40007FFE7FFC7FFC40088010801080200040004000800180018001000300 -03000300030007000700070007000700070002000F197E9813>I<078018603030201860186018 -601870103C303E600F8007C019F030F86038401CC00CC00CC00CC00C6008201018600FC00E187E -9713>I<07801860303070306018E018E018E01CE01CE01C601C603C303C185C0F9C001C001800 -18003870307060604021801F000E187E9713>I<1FC020604030C038E038E0380038007000E001 -8001000300020002000200020002000200000000000000000006000F000F0006000D1A7E9912> -63 D66 D68 D70 D<3F8070C070E0207000700070 -07F01C7030707070E070E071E071E0F171FB1E3C10107E8F13>97 DI<07F80C1C -381C30087000E000E000E000E000E000E0007000300438080C1807E00E107F8F11>I<07C01C30 -30187018600CE00CFFFCE000E000E000E0006000300438080C1807E00E107F8F11>101 -D<01F0031807380E100E000E000E000E000E000E00FFC00E000E000E000E000E000E000E000E00 -0E000E000E000E000E000E007FE00D1A80990C>I104 D<18003C003C00180000 -0000000000000000000000FC001C001C001C001C001C001C001C001C001C001C001C001C001C00 -1C00FF80091A80990A>I<018003C003C001800000000000000000000000000FC001C001C001C0 -01C001C001C001C001C001C001C001C001C001C001C001C001C001C001C041C0E180E3007E000A -2182990C>I108 DII<07E0 -1C38300C700E6006E007E007E007E007E007E0076006700E381C1C3807E010107F8F13>I114 -D<1F2060E04020C020C020F0007F003FC01FE000F080708030C030C020F0408F800C107F8F0F> -I<0400040004000C000C001C003C00FFC01C001C001C001C001C001C001C001C001C201C201C20 -1C201C200E4003800B177F960F>I119 D E /Fd 1 59 df<60F0F06004047D830B>58 D E -/Fe 42 123 df<0FC01FF03838701CE00EE00EE00E400E000E001C001C00380030007000E001C0 -030006000C00180E300E7FFE7FFE0F177E9614>50 D<000E003E007C00F003E007C01F003E00F8 -00F000F8003E001F0007C003E000F0007C003E000E0F137E9414>60 D<4000E000F8007C001E00 -0F8007C001F000F8003E001E003E00F801F007C00F801E007C00F800E00040000F157E9514>62 -D<01C00003E00003E0000360000360000770000770000770000770000630000E38000E38000E38 -000E38000E38001FFC001FFC001C1C001C1C003C1E00380E00FE3F80FE3F8011177F9614>65 -DI<03C60FFE1C3E181E381E700E700E600EE000E000E000E000 -E000E000E000600E700E700E380C181C1C380FF003C00F177E9614>IIII< -FE3F80FE3F80380E00380E00380E00380E00380E00380E00380E00380E003FFE003FFE00380E00 -380E00380E00380E00380E00380E00380E00380E00380E00FE3F80FE3F8011177F9614>72 -D77 -DI<1F -F07FFC783C701CE00EE00EE00EE00EE00EE00EE00EE00EE00EE00EE00EE00EE00EE00EE00E701C -783C7FFC1FF00F177E9614>II<7FFF80FFFF80E1C380E1C380 -E1C380E1C38001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C000 -01C00001C00001C00001C0000FF8000FF80011177F9614>84 D87 D<7E3E007E3E001C38001E38000E78 -000F700007F00007E00003E00003C00001C00003C00003E00003E0000770000770000E78000E38 -001C3C001C1C003C1E00FE3F80FE3F8011177F9614>I<1FC0007FF000707800201800001C0000 -1C0007FC001FFC003C1C00701C00E01C00E01C00E01C00707C003FFF800F8F8011107E8F14>97 -DI<03 -F80FFC1C1C380870006000E000E000E000E00060007000380E1C1E0FFC03F00F107E8F14>I<00 -7E00007E00000E00000E00000E00000E00000E0007CE000FFE001C3E00301E00700E00E00E00E0 -0E00E00E00E00E00E00E00E00E00700E00301E00383E001FEFC007CFC012177F9614>I<07E00F -F01C38301C700CE00EE00EFFFEFFFEE00060007000380E1C1E0FFC03F00F107E8F14>I<007C00 -FE01CE03840380038003807FFEFFFE038003800380038003800380038003800380038003800380 -7FFC7FFC0F177F9614>I<07CF001FFF80383B80301800701C00701C00701C003018003838003F -F00037C0007000007000003FF8001FFC003FFE00700F00E00380E00380E00380E003807007003C -1E001FFC0007F00011197F8F14>II<030007800780030000000000000000007F807F80038003800380 -038003800380038003800380038003800380FFFCFFFC0E187D9714>I<006000F000F000600000 -0000000000001FF01FF00070007000700070007000700070007000700070007000700070007000 -7000700070007040E0E0C07F803F000C207E9714>IIIII<07C01FF03C78701C701CE00E -E00EE00EE00EE00EE00E701C783C3C781FF007C00F107E8F14>II114 D<0FD83FF86038C038C038F0007F803FF007F8001C6006E006F006F81CFFF8CFE0 -0F107E8F14>I<030007000700070007007FFCFFFC07000700070007000700070007000700070E -070E070E070C03FC00F00F157F9414>IIII<7E3F007E3F001E38000E780007 -700007E00003E00001C00003C00003E0000770000E78000E38001C1C00FE3F80FE3F8011107F8F -14>II<3FFF7FFF700E701C7038007000E001C0038007000E001C0738077007FFFFFFFF10107F -8F14>I E /Ff 70 123 df<0003F07C001E0DC600380F0F00701E0F00E01E0E00E00C0001C01C -0001C01C0001C01C0001C01C0001C01C00038038007FFFFFC00380380003803800038038000380 -38000700700007007000070070000700700007007000070070000E00E0000E00E0000E00E0000E -00E0000E00E0000E00E0001C01C0001E01E000FF8FFE0020207E9F1B>11 -D<0003E0001C1800381800703C00E03C00E03801C00001C00001C00001C00001C0000380007FFF -F00380700380700380700380700700E00700E00700E00700E00700E00700E00E01C00E01C00E01 -C00E01C00E01C00E01C01C03801E03C0FF0FF816207E9F19>I<0003F4001C1C00383C00703C00 -E03C00E03801C03801C03801C03801C03801C0380380707FFFF003807003807003807003807007 -00E00700E00700E00700E00700E00700E00E01C00E01C00E01C00E01C00E01C00E01C01C03801E -03C0FF9FF816207E9F19>I<0003F03F00001E09E08000380F80C000701F01E000E03E01E000E0 -1E01C001C01C000001C01C000001C01C000001C01C000001C01C000003803800007FFFFFFF8003 -803803800380380380038038038003803803800700700700070070070007007007000700700700 -070070070007007007000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E -001C01C01C001E01E01E00FF8FF8FFC023207E9F26>I<387C7C7E3A040404080810204080070E -789F0D>39 D<00030004000800100020006000C0018001000300060006000C000C001C00180018 -00380030003000700070006000600060006000E000E000E000E000E000E0006000600060006000 -6000300030001000180008000C00040002000100102E7CA112>I<008000C00060002000300018 -0018000C000C000C000E00060006000600060006000600060006000600060006000E000E000E00 -0C000C001C001800180038003000300060006000C000C001800100030006000C00180030006000 -80000F2E7FA112>I<0020000060000060000060000060007061C03843800E4E0007580001E000 -01E00006B8001C9C00708700E0838001800001800001800001800001000012147AA117>I<1C3E -7E7E3A0202040408081020C0070E7D840D>44 DI<3078F8787005057C -840D>I<007E0001C3000301800701C00E00C00E00E01C00E01C00E03C01E03801E07801E07801 -E07801E07801E07801E0F003C0F003C0F003C0F003C0F003C0F00380F00780E00780E00700E007 -00E00E00600E00701C003038003870000FC000131F7C9D17>48 D<000C001C00FC0F3800380038 -00380038003800700070007000700070007000E000E000E000E000E000E001C001C001C001C001 -C001C0038003C0FFFE0F1E7C9D17>I<003F8000C1E00100F00200780400780400780F007C0F80 -7C0F807C0F00780600780000F80000F00001E00001C0000380000700000E00001C000038000060 -0000C0000180000300200600200800401000403FFFC07FFF80FFFF80161E7E9D17>I<007F0001 -83C00201E00400F00700F00F00F00F01F00F01F00001E00001E00003C0000380000700000E0000 -F800000E000007000007800007C00003C00007C03007C07807C0F807C0F807C0F00780800F0040 -0E00201C0018780007E000141F7D9D17>I<0000600000600000E00001C00003C00005C0000DC0 -0009C00011C000238000438000C380008380010380020380040700080700180700100700200700 -400700FFFFF0000E00000E00000E00000E00000E00001C00001E0001FFE0141E7E9D17>I<0180 -3001FFE003FFC003FF0003FC00020000020000020000040000040000040000047C000587000603 -800C01800801C00001C00001E00001E00001E00001E07003C0F803C0F003C0E003808007804007 -00400E00201C0018700007C000141F7D9D17>I<000F8000704000C0200180E00301E00701E00E -00C01E00001C00003C000038000078F800790E007A07007C0300F80380F80380F003C0F003C0F0 -03C0F003C0F00780E00780E00780E00700E00F00600E00701C0030180018700007C000131F7C9D -17>I<003F0000C1C00100600200600400300C00300C00300C00300C00600E00600F80C00FC180 -07F60003FC0001FC0001FF00063F800C0F801007C03003C06001C06000C0C000C0C000C0C000C0 -C00080C0010060030030040018180007E000141F7D9D17>56 D<007E0001C3000301800601C00E -01C01C00C03C00E03C00E03C01E07801E07801E07801E07801E07803E07803E03803C03807C01C -0BC00C13C003E380000780000780000700000E00600E00F01C00F01800E0300080600041C0003F -0000131F7C9D17>I<0E1F1F1E0C000000000000000000003078F8787008147C930D>I<07000F80 -0F800F000600000000000000000000000000000000000000000018003C007C007C003C00040004 -000800080010001000200040008000091D7D930D>I<1FFFFFF83FFFFFFC000000000000000000 -0000000000000000000000000000000000000000000000FFFFFFF07FFFFFE01E0C7C9023>61 -D<07E01838201C401C701CF03CF03C603C0038007000E001C00180030002000600040004000800 -0800080008000000000000000000000030007800F800780070000E20799F15>63 -D<0000100000001800000038000000380000007800000078000000FC000001BC0000013C000003 -3C0000023C0000063C0000043E0000081E0000081E0000101E0000101E0000201E0000200F0000 -400F0000400F0000FFFF0000800F0001000F800100078002000780020007800400078004000780 -0C0007C03E0007C0FF807FFC1E207E9F22>65 D<07FFFF00007C01C0003C01E0003C00F0007800 -F8007800F8007800F8007800F8007800F8007800F000F001F000F001E000F003C000F00F8000FF -FE0000F00F0001E007C001E003C001E003E001E001E001E001E001E001E003C001E003C003E003 -C003E003C003C003C007C003C00F8007800F0007803E00FFFFF0001D1F7E9E20>I<0001F80800 -0E061800380138007000F801E0007803C0007007800030078000300F0000301F0000301E000030 -3E0000203C0000007C0000007C0000007C0000007C000000F8000000F8000000F8000000F80000 -00F80000007800004078000080780000803C0000803C0001001C0002000E00020006000C000300 -100001C0E000003F00001D217B9F21>I<07FFFF00007C01E0003C00F0003C00780078003C0078 -003C0078001E0078001E0078001E0078001F00F0001F00F0001F00F0001F00F0001F00F0001F00 -F0001F01E0001E01E0003E01E0003E01E0003E01E0003C01E0007C03C0007803C000F003C000F0 -03C001E003C003C003C0078007800F0007803C00FFFFE000201F7E9E23>I<07FFFFF8007C0078 -003C0038003C001800780018007800080078000800780008007800080078080800F0100000F010 -0000F0100000F0300000FFF00000F0700001E0200001E0200001E0200001E0200001E0000801E0 -001003C0001003C0001003C0002003C0002003C0006003C000C0078001C0078007C0FFFFFF801D -1F7E9E1F>I<07FFFFF8007C0078003C0038003C00180078001800780008007800080078000800 -7800080078000800F0100000F0100000F0100000F0300000F0700000FFF00001E0600001E02000 -01E0200001E0200001E0200001E0000003C0000003C0000003C0000003C0000003C0000003C000 -000780000007C00000FFFE00001D1F7E9E1E>I<0001FC04000F030C003C009C0070007C00E000 -3C01C0003803800018078000180F0000181F0000181E0000183E0000103C0000007C0000007C00 -00007C0000007C000000F8000000F8000000F8007FFCF80003E0780001E0780001E0780003C078 -0003C03C0003C03C0003C01C0003C00E0007C007000B800380118001E06080003F80001E217B9F -24>I<07FFE0007C00003C00003C0000780000780000780000780000780000780000F00000F000 -00F00000F00000F00000F00001E00001E00001E00001E00001E00001E00003C00003C00003C000 -03C00003C00003C00007800007C000FFFC00131F7F9E10>73 D<07FFF000007E0000003C000000 -3C000000780000007800000078000000780000007800000078000000F0000000F0000000F00000 -00F0000000F0000000F0000001E0000001E0000001E0000001E0000001E0008001E0010003C001 -0003C0010003C0030003C0020003C0060003C0060007801E0007807C00FFFFFC00191F7E9E1C> -76 D<07FC0000FFC0007C0000F800003C00017800003C00017800004E0002F000004E0002F000 -004E0004F000004E0004F000004E0008F000004E0008F00000870011E00000870011E000008700 -21E00000870021E00000870041E00000838041E00001038083C00001038083C00001038103C000 -01038203C0000101C203C0000101C403C0000201C40780000201C80780000201C80780000201D0 -0780000200F00780000600E00780000600E00F00000F00C00F8000FFE0C1FFF8002A1F7E9E2A> -I<07FC01FFC0003E003E00003E001800003E001800004F001000004F0010000047801000004780 -10000043C010000043C010000083C020000081E020000081E020000080F020000080F020000080 -782000010078400001007C400001003C400001003C400001001E400001001E400002000F800002 -000F800002000F800002000780000200078000060003800006000300000F00010000FFE0010000 -221F7E9E22>I<0003F800001E0E000038070000E0038001C001C003C001E0078000E00F0000F0 -0F0000F01E0000F01E0000F83E0000F83C0000F87C0000F87C0000F87C0000F87C0000F8F80001 -F0F80001F0F80001F0F80001F0F80003E0780003E0780003C0780007C07C0007803C000F003C00 -1E001E001C000E0038000700F00003C3C00000FE00001D217B9F23>I<07FFFF00007C03C0003C -01E0003C00F0007800F0007800F8007800F8007800F8007800F8007800F000F001F000F001E000 -F003C000F0078000F00F0000FFF80001E0000001E0000001E0000001E0000001E0000001E00000 -03C0000003C0000003C0000003C0000003C0000003C000000780000007C00000FFFC00001D1F7E -9E1F>I<07FFFC00007C0700003C03C0003C01E0007801E0007801F0007801F0007801F0007801 -F0007801E000F003E000F003C000F0078000F00F0000F03C0000FFF00001E0300001E0380001E0 -1C0001E01C0001E01C0001E01E0003C03E0003C03E0003C03E0003C03E0003C03E0003C03E0207 -803E0407C01F04FFFC0F18000003E01F207E9E21>82 D<003F040060CC01803C03801C03001C07 -00180600080E00080E00080E00080E00000F00000F80000FE00007FE0003FF8001FFC0007FE000 -07E00001E00000E00000F00000F04000E04000E04000E04000E06000C0600180E00380F80300C6 -0C0081F80016217D9F19>I<3FFFFFF03C0780F03007803060078030400F0010400F0010C00F00 -10800F0010800F0010800F0010001E0000001E0000001E0000001E0000001E0000001E0000003C -0000003C0000003C0000003C0000003C0000003C00000078000000780000007800000078000000 -7800000078000000F0000001F800007FFFE0001C1F7A9E21>II87 D<00FE01FC01800180018001800180030003000300030003000300060006 -0006000600060006000C000C000C000C000C000C00180018001800180018001800300030003000 -300030003000600060006000600060006000FE00FE000F2D7EA10D>91 D<00FE01FC000C000C00 -0C000C000C00180018001800180018001800300030003000300030003000600060006000600060 -006000C000C000C000C000C000C0018001800180018001800180030003000300030003000300FE -00FE000F2D81A10D>93 D<07F8000C0C001E06001E07001C070000070000070000070000FF0007 -C7001E07003C0E00780E00F00E10F00E10F00E10F01E10F02E20784F401F878014147D9317>97 -D<0700003F00000F00000700000700000E00000E00000E00000E00000E00000E00001C00001C7C -001D87001E03801C01C01C01C03801C03801E03801E03801E03801E03801E07003C07003C07003 -80700780700700700E00E81C00C4380083E00013207B9F19>I<01FC07060E0F1C0F380E780070 -00F000F000F000F000E000E000E000E000F0027004300818300FC010147C9314>I<0000700003 -F00000F00000700000700000E00000E00000E00000E00000E00000E00001C000F9C00305C00E03 -C01C03C03801C0780380700380F00380F00380F00380F00380E00700E00700E00700E00700E007 -00700F00301E00186F000F8FE014207C9F19>I<00F800070E000E07001C070038038078038070 -0380F00380F00380FFFF80F00000E00000E00000E00000E00000F001007002003004001C180007 -E00011147D9314>I<0007800018C00031E00061E000E1C000C00001C00001C00001C00001C000 -01C0000380007FF800038000038000038000038000070000070000070000070000070000070000 -0E00000E00000E00000E00000E00000E00001C00001E0000FFE00013207E9F0E>I<00000E003E -1100E1A301C1C20381E00780E00701E00F01E00F01E00F01E00703C007038007870004FC000800 -000800001800001C00000FFF000FFFC007FFE01800F0300030600030C00030C00030C000306000 -603000C01C070007FC00181F809417>I<00E00007E00001E00000E00000E00001C00001C00001 -C00001C00001C00001C000038000038F800390E003A0E003C0600380600780E00700E00700E007 -00E00700E00700E00E01C00E01C00E01C00E01C00E01C00E01C01C03801E03C0FFCFF815207E9F -19>I<01C003E003E003E001C000000000000000000000000003801F8007800380038007000700 -07000700070007000E000E000E000E000E000E001C001E00FF800B1F7F9E0C>I<0003800007C0 -0007C0000780000300000000000000000000000000000000000000000700007F00000F00000700 -000700000E00000E00000E00000E00000E00000E00001C00001C00001C00001C00001C00001C00 -003800003800003800003800003800003800007000607000F06000F0C0006180003F0000122883 -9E0E>I<00E00007E00001E00000E00000E00001C00001C00001C00001C00001C00001C0000380 -000383FC0380F00380C0038180038100070400070800071800073800077C00071C000E1C000E0E -000E0E000E0F000E07000E07801C03801E07C0FF8FF016207E9F18>I<00E007E001E000E000E0 -01C001C001C001C001C001C00380038003800380038003800700070007000700070007000E000E -000E000E000E000E001C001E00FFC00B207F9F0C>I<0387C07C001F9861860007A072070003C0 -34030003803803000780780700070070070007007007000700700700070070070007007007000E -00E00E000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E001C01C01C001E01E01E00 -FFCFFCFFC022147E9326>I<038F801F90E007A0E003C0600380600780E00700E00700E00700E0 -0700E00700E00E01C00E01C00E01C00E01C00E01C00E01C01C03801E03C0FFCFF815147E9319> -I<00FC000387000E01801C00C03800E03800E07000F0F000F0F000F0F000F0F000F0E001E0E001 -E0E001C0E003C0F00380700700380E001C1C0007E00014147D9317>I<00E3E007EC3800F01C00 -E01E00E00E01C00E01C00F01C00F01C00F01C00F01C00F03801E03801E03801C03803C03803803 -80700740E00721C0071F000700000700000700000E00000E00000E00000E00001E0000FFC00018 -1D809319>I<00F040038CC00E04C01C03C03C03C0780380780380F00380F00380F00380F00380 -E00700E00700E00700F00700F00F00700F00301E00186E000F8E00000E00000E00000E00001C00 -001C00001C00001C00003C0001FF80121D7C9318>I<038E001FB38007C78003C7800383000780 -000700000700000700000700000700000E00000E00000E00000E00000E00000E00001C00001E00 -00FFE00011147E9312>I<01F2060E080618061802380438001E001FE00FF003F8003C401C400C -400C600C6018E010D0608FC00F147E9312>I<0080010001000100030007000F001E00FFF80E00 -0E000E000E001C001C001C001C001C001C00380038203820382038203840384018800F000D1C7C -9B12>I<1C0380FC1F803C07801C03801C0380380700380700380700380700380700380700700E -00700E00700E00700E00701E00701E00703C00305E001F9FC012147B9319>III<1FF0FF03C07801C060 -01C04000E08000E180007300007600003C00003C00001C00002E00004E00008700010700020380 -0603800C01C03E03E0FF07FC18147F9318>I<0FF83F8001E00E0001C00C0001C0080000E01800 -00E0100000E0200000E0200000F040000070400000708000007080000071000000390000003A00 -00003E0000003C00000038000000180000001000000010000000200000002000000040000070C0 -0000F0800000F1000000E20000007C000000191D809318>I<07FFE00701E00401C00C03800807 -00080E00101C0000380000700000700000E00001C0000380800700800E00801C01001C01003803 -00700E00FFFE0013147F9314>I E /Fg 4 12 df8 D<00000040000000C0000000C0000000C0000000 -C0000000C000000180000001800000018000000180000003000000030000000600000006000000 -0C00000018000000180000003000000060000000C0000003800000070000001C00000078000007 -E00000FF800000F80000001A1B989A32>I<40000000C0000000C0000000C0000000C0000000C0 -000000600000006000000060000000300000003000000018000000180000000C00000006000000 -06000000030000000180000000C000000060000000380000001C0000000700000003C0000000F8 -0000003FE0000007E01B1B809A32>I<000007E000003FE00000F8000003C00000070000001C00 -00003800000060000000C00000018000000300000006000000060000000C000000180000001800 -00003000000030000000600000006000000060000000C0000000C0000000C0000000C0000000C0 -000000400000001B1B808132>I E /Fh 87 126 df<70F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8 -70000000000070F8F8F870051C779B18>33 D<4010E038F078E038E038E038E038E038E038E038 -E038E038E03860300D0E7B9C18>I<030600078F00078F00078F00078F00078F00078F007FFFC0 -FFFFE0FFFFE07FFFC00F1E000F1E000F1E000F1E000F1E000F1E007FFFC0FFFFE0FFFFE07FFFC0 -1E3C001E3C001E3C001E3C001E3C001E3C000C1800131C7E9B18>I<3803007C07807C0780EE0F -80EE0F00EE0F00EE1F00EE1E00EE1E00EE3E007C3C007C3C00387C0000780000780000F80000F0 -0001F00001E00001E00003E00003C00003C00007C0000783800787C00F87C00F0EE00F0EE01F0E -E01E0EE01E0EE03E0EE03C07C03C07C018038013247E9F18>37 D<007000F001E003C007800F00 -1E001C00380038007000700070007000E000E000E000E000E000E000E000E00070007000700070 -00380038001C001E000F00078003C001F000F000700C24799F18>40 D<6000F00078003C001E00 -0F000780038001C001C000E000E000E000E00070007000700070007000700070007000E000E000 -E000E001C001C0038007800F001E003C007800F00060000C247C9F18>I<01C00001C00001C000 -01C000C1C180F1C780F9CF807FFF001FFC0007F00007F0001FFC007FFF00F9CF80F1C780C1C180 -01C00001C00001C00001C00011147D9718>I<00600000F00000F00000F00000F00000F00000F0 -0000F0007FFFC0FFFFE0FFFFE07FFFC000F00000F00000F00000F00000F00000F00000F0000060 -0013147E9718>I<1C3E7E7F3F1F070E1E7CF860080C788518>I<7FFF00FFFF80FFFF807FFF0011 -047D8F18>I<3078FCFC78300606778518>I<000300000780000780000F80000F00001F00001E00 -001E00003E00003C00007C0000780000780000F80000F00001F00001E00003E00003C00003C000 -07C0000780000F80000F00000F00001F00001E00003E00003C00003C00007C0000780000F80000 -F00000F0000060000011247D9F18>I<01F00007FC000FFE001F1F001C07003803807803C07001 -C07001C0E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0F001E07001C07001 -C07803C03803801C07001F1F000FFE0007FC0001F000131C7E9B18>I<01800380038007800F80 -3F80FF80FB80438003800380038003800380038003800380038003800380038003800380038003 -807FFCFFFE7FFC0F1C7B9B18>I<03F0000FFE003FFF007C0F807003C0E001C0F000E0F000E060 -00E00000E00000E00001C00001C00003C0000780000F00001E00003C0000780000F00001E00007 -C0000F80001E00E03C00E07FFFE0FFFFE07FFFE0131C7E9B18>I<07F8001FFE003FFF00780780 -7803C07801C03001C00001C00003C0000380000F0003FF0003FE0003FF000007800003C00001C0 -0000E00000E00000E0F000E0F000E0F001C0F003C07C07803FFF001FFE0003F800131C7E9B18> -I<001F00003F0000770000770000E70001E70001C7000387000787000707000E07001E07003C07 -00380700780700F00700FFFFF8FFFFF8FFFFF8000700000700000700000700000700000700007F -F000FFF8007FF0151C7F9B18>I<1FFF803FFF803FFF8038000038000038000038000038000038 -00003800003800003BF8003FFE003FFF003C07801803C00001C00000E00000E06000E0F000E0F0 -00E0E001C07003C07C0F803FFF001FFC0003F000131C7E9B18>I<007E0001FF0007FF800F83C0 -1E03C01C03C0380180380000700000700000E1F800E7FE00FFFF00FE0780F803C0F001C0F000E0 -E000E0F000E07000E07000E07000E03801C03C03C01E07800FFF0007FE0001F800131C7E9B18> -II<03F8000FFE001FFF003E0F803803807001C07001C070 -01C07001C03803803C07801FFF0007FC000FFE001F1F003C07807001C0F001E0E000E0E000E0E0 -00E0E000E07001C07803C03E0F801FFF000FFE0003F800131C7E9B18>I<03F0000FFC001FFE00 -3C0F00780780700380E001C0E001C0E001C0E001E0E001E07001E07803E03C0FE01FFFE00FFEE0 -03F0E00000E00001C00001C00001C0300380780780780F00783E003FFC001FF00007C000131C7E -9B18>I<3078FCFC783000000000000000003078FCFC78300614779318>I<183C7E7E3C18000000 -0000000000183C7E7E3E1E0E1C3C78F060071A789318>I<000300000780001F80003F00007E00 -01FC0003F00007E0001FC0003F00007E0000FC0000FC00007E00003F00001FC00007E00003F000 -01FC00007E00003F00001F8000078000030011187D9918>I<7FFFC0FFFFE0FFFFE0FFFFE00000 -00000000000000000000FFFFE0FFFFE0FFFFE07FFFC0130C7E9318>I<600000F00000FC00007E -00003F00001FC00007E00003F00001FC00007E00003F00001F80001F80003F00007E0001FC0003 -F00007E0001FC0003F00007E0000FC0000F0000060000011187D9918>I<0FF0003FFC007FFF00 -700F00F00380F00380600780000F00003E00007C0001F00001E00003C00003C00003C00003C000 -03C00003800000000000000000000000000000000003800007C00007C00007C000038000111C7D -9B18>I<007C0001FE0007FF000F87801E03C03C1DC0387FC070FFE071E3E071C1E0E1C1E0E380 -E0E380E0E380E0E380E0E380E0E380E0E1C1C071C1C071E3C070FF80387F003C1C001E00E00F83 -E007FFC001FF80007E00131C7E9B18>I<00700000F80000F80000D80000D80001DC0001DC0001 -DC00018C00038E00038E00038E00038E000306000707000707000707000707000FFF800FFF800F -FF800E03800E03801C01C01C01C07F07F0FF8FF87F07F0151C7F9B18>II<00F8E003FEE007FFE00F07E01E03E03C01E03800E07000E07000E0700000E00000E000 -00E00000E00000E00000E00000E00000E000007000007000E07000E03800E03C00E01E01C00F07 -C007FF8003FE0000F800131C7E9B18>I<7FF800FFFE007FFF001C0F801C03C01C03C01C01E01C -00E01C00E01C00F01C00701C00701C00701C00701C00701C00701C00701C00701C00F01C00E01C -00E01C01E01C01C01C03C01C0F807FFF00FFFE007FF800141C7F9B18>III<01F1C003FDC00FFFC01F0FC01C03C03803C03801C070 -01C07001C0700000E00000E00000E00000E00000E00000E00FF0E01FF0E00FF07001C07001C070 -03C03803C03803C01C07C01F0FC00FFFC003FDC001F1C0141C7E9B18>I<7F07F0FF8FF87F07F0 -1C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01FFFC01FFFC01FFFC01C01C0 -1C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C07F07F0FF8FF87F07F0151C7F -9B18>I<7FFF00FFFF807FFF0001C00001C00001C00001C00001C00001C00001C00001C00001C0 -0001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C0 -007FFF00FFFF807FFF00111C7D9B18>I<01FFC003FFC001FFC0000E00000E00000E00000E0000 -0E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E0000 -0E00000E00F00E00F00E00F03C007FFC003FF0000FC000121C7D9B18>I<7F07F0FF87F87F07F0 -1C03C01C07801C07001C0E001C1E001C3C001C38001C70001CF0001DF0001DF0001FB8001FB800 -1F1C001E1C001C0E001C0E001C07001C07001C03801C03801C01C07F03F0FF87F87F03F0151C7F -9B18>I<7FE000FFE0007FE0000E00000E00000E00000E00000E00000E00000E00000E00000E00 -000E00000E00000E00000E00000E00000E00000E00000E00000E00700E00700E00700E00700E00 -707FFFF0FFFFF07FFFF0141C7F9B18>II<7E07F0FF0FF87F07F0 -1D81C01D81C01D81C01DC1C01CC1C01CC1C01CE1C01CE1C01CE1C01C61C01C71C01C71C01C31C0 -1C39C01C39C01C39C01C19C01C19C01C1DC01C0DC01C0DC01C0DC07F07C0FF87C07F03C0151C7F -9B18>I<0FF8003FFE007FFF00780F00700700F00780E00380E00380E00380E00380E00380E003 -80E00380E00380E00380E00380E00380E00380E00380E00380E00380E00380F00780700700780F -007FFF003FFE000FF800111C7D9B18>II<7FF800FFFE007FFF00 -1C0F801C03801C03C01C01C01C01C01C01C01C03C01C03801C0F801FFF001FFE001FFE001C0F00 -1C07001C03801C03801C03801C03801C03801C039C1C039C1C039C7F01F8FF81F87F00F0161C7F -9B18>82 D<03F3801FFF803FFF807C0F80700780E00380E00380E00380E000007000007800003F -00001FF00007FE0000FF00000F800003C00001C00000E00000E06000E0E000E0E001E0F001C0F8 -0780FFFF80FFFE00E7F800131C7E9B18>I<7FFFF8FFFFF8FFFFF8E07038E07038E07038E07038 -007000007000007000007000007000007000007000007000007000007000007000007000007000 -00700000700000700000700000700007FF0007FF0007FF00151C7F9B18>IIII<7F8FE07F9FE07F8F -E00E07000F0700070E00078E00039C0003DC0001F80001F80000F00000F00000700000F00000F8 -0001F80001DC00039E00038E00070F000707000E07800E03801E03C07F07F0FF8FF87F07F0151C -7F9B18>II<3FFFE07FFFE07FFFE07001C07003C0700780700700 -000F00001E00001C00003C0000780000700000F00001E00001C00003C0000780000700000F0000 -1E00E01C00E03C00E07800E07000E0FFFFE0FFFFE0FFFFE0131C7E9B18>II<600000F00000F0 -0000F800007800007C00003C00003C00003E00001E00001F00000F00000F00000F800007800007 -C00003C00003C00003E00001E00001F00000F00000F800007800007800007C00003C00003E0000 -1E00001E00001F00000F00000F8000078000078000030011247D9F18>II<018007C01FF07EFC -F83EE00E0F067C9B18>I<7FFF00FFFF80FFFF807FFF0011047D7F18>I<1FE0003FF8007FFC0078 -1E00300E0000070000070000FF0007FF001FFF007F0700780700E00700E00700E00700F00F0078 -1F003FFFF01FFBF007E1F014147D9318>97 D<7E0000FE00007E00000E00000E00000E00000E00 -000E00000E3E000EFF800FFFC00FC1E00F80E00F00700E00700E00380E00380E00380E00380E00 -380E00380F00700F00700F80E00FC1E00FFFC00EFF80063E00151C809B18>I<01FE0007FF001F -FF803E0780380300700000700000E00000E00000E00000E00000E00000E000007000007001C038 -01C03E03C01FFF8007FF0001FC0012147D9318>I<001F80003F80001F80000380000380000380 -00038000038003E3800FFB801FFF803C1F80380F80700780700380E00380E00380E00380E00380 -E00380E00380700780700780380F803C1F801FFFF00FFBF803E3F0151C7E9B18>I<01F00007FC -001FFE003E0F00380780700380700380E001C0E001C0FFFFC0FFFFC0FFFFC0E000007000007001 -C03801C03E03C01FFF8007FF0001FC0012147D9318>I<001F80007FC000FFE000E1E001C0C001 -C00001C00001C0007FFFC0FFFFC0FFFFC001C00001C00001C00001C00001C00001C00001C00001 -C00001C00001C00001C00001C00001C00001C0007FFF007FFF007FFF00131C7F9B18>I<01E1F0 -07FFF80FFFF81E1E301C0E003807003807003807003807003807001C0E001E1E001FFC001FF800 -39E0003800001C00001FFE001FFFC03FFFE07801F0700070E00038E00038E00038E000387800F0 -7E03F01FFFC00FFF8001FC00151F7F9318>I<7E0000FE00007E00000E00000E00000E00000E00 -000E00000E3E000EFF800FFFC00FC1C00F80E00F00E00E00E00E00E00E00E00E00E00E00E00E00 -E00E00E00E00E00E00E00E00E00E00E07FC3FCFFE7FE7FC3FC171C809B18>I<03800007C00007 -C00007C0000380000000000000000000000000007FC000FFC0007FC00001C00001C00001C00001 -C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C000FFFF00FFFF80FF -FF00111D7C9C18>I<0038007C007C007C003800000000000000000FFC1FFC0FFC001C001C001C -001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C60 -38F078FFF07FE03F800E277E9C18>II<7FE000FFE0007FE00000 -E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000 -E00000E00000E00000E00000E00000E00000E00000E00000E0007FFFC0FFFFE07FFFC0131C7E9B -18>I<7CE0E000FFFBF8007FFFF8001F1F1C001E1E1C001E1E1C001C1C1C001C1C1C001C1C1C00 -1C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C007F1F1F00FFBFBF -807F1F1F001914819318>I<7E3E00FEFF807FFFC00FC1C00F80E00F00E00E00E00E00E00E00E0 -0E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E07FC3FCFFE7FE7FC3FC1714809318> -I<01F0000FFE001FFF003E0F803803807001C07001C0E000E0E000E0E000E0E000E0E000E0F001 -E07001C07803C03C07803E0F801FFF000FFE0001F00013147E9318>I<7E3E00FEFF807FFFC00F -C1E00F80E00F00700E00700E00380E00380E00380E00380E00380E00380F00700F00700F80E00F -C1E00FFFC00EFF800E3E000E00000E00000E00000E00000E00000E00000E00007FC000FFE0007F -C000151E809318>I<7F87E0FF9FF07FBFF803F87803F03003E00003C00003C000038000038000 -0380000380000380000380000380000380000380007FFE00FFFF007FFE0015147F9318>114 -D<07F7003FFF007FFF00780F00E00700E00700E007007C00007FE0001FFC0003FE00001F006007 -80E00380E00380F00380F80F00FFFF00FFFC00E7F00011147D9318>I<01800003800003800003 -80000380007FFFC0FFFFC0FFFFC003800003800003800003800003800003800003800003800003 -80000380400380E00380E00380E001C1C001FFC000FF80003E0013197F9818>I<7E07E0FE0FE0 -7E07E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E0 -0E01E00F03E007FFFC03FFFE01FCFC1714809318>I<7F8FF0FF8FF87F8FF01E03C00E03800E03 -800E0380070700070700070700038E00038E00038E00038E0001DC0001DC0001DC0000F80000F8 -0000700015147F9318>II< -7F8FF07F9FF07F8FF0070700078E00039E0001DC0001F80000F80000700000F00000F80001DC00 -039E00038E000707000F07807F8FF0FF8FF87F8FF015147F9318>I<7F8FF0FF8FF87F8FF00E01 -C00E03800E0380070380070700070700038700038600038E0001CE0001CE0000CC0000CC0000DC -0000780000780000780000700000700000700000F00000E00079E0007BC0007F80003F00001E00 -00151E7F9318>I<3FFFF07FFFF07FFFF07001E07003C0700780000F00001E00003C0000F80001 -F00003C0000780000F00701E00703C0070780070FFFFF0FFFFF0FFFFF014147F9318>I<0007E0 -001FE0007FE000780000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000 -00E00001E0007FC000FF8000FF80007FC00001E00000E00000E00000E00000E00000E00000E000 -00E00000E00000E00000E00000E000007800007FE0001FE00007E013247E9F18>I<60F0F0F0F0 -F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0600424769F18>I<7C -0000FF0000FFC00003C00000E00000E00000E00000E00000E00000E00000E00000E00000E00000 -E00000E00000F000007FC0003FE0003FE0007FC000F00000E00000E00000E00000E00000E00000 -E00000E00000E00000E00000E00000E00003C000FFC000FF00007C000013247E9F18>I -E /Fi 25 121 df<0001C0000003C000000FC000007FC0001FFFC000FFFFC000FFBFC000E03FC0 -00003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003F -C000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC00000 -3FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000 -003FC000003FC000003FC000003FC000003FC000003FC0007FFFFFE07FFFFFE07FFFFFE01B2E7A -AD28>49 D<003FE00001FFFE0007FFFF800F80FFC01E003FE038001FF07C000FF87E0007FCFF00 -07FCFF8007FEFF8007FEFF8003FEFF8003FE7F0003FE3E0007FE000007FE000007FC000007FC00 -000FF800000FF800000FF000001FE000001FC000003F8000007F0000007E000000F8000001F000 -0003E0000007C000000F0000001E000E003C000E0038000E0070001E00E0001C01C0001C030000 -3C07FFFFFC0FFFFFFC1FFFFFFC3FFFFFFC7FFFFFF8FFFFFFF8FFFFFFF8FFFFFFF81F2E7CAD28> -I<001FF80000007FFF000001FFFFC00003E03FE00007800FF0000FC00FF8001FE007F8001FE007 -FC001FE007FC001FE007FC001FE007FC000FC007FC00078007FC0000000FF80000000FF8000000 -0FF00000001FE00000001FC00000003F80000000FE0000003FF80000003FFF800000001FE00000 -0007F000000007F800000003FC00000003FE00000001FF00000001FF00000001FF80000001FF80 -000001FF801C0001FF803E0001FF807F0001FF80FF8001FF80FF8001FF00FF8001FF00FF8003FE -007F0003FE007E0007FC003C0007F8001FC01FF0000FFFFFC00003FFFF0000003FF80000212E7D -AD28>I66 D<000003FF80018000003FFFF003800001FFFFFC07800007FF003F0F80001FF800079F80 -003FC00001FF8000FF800000FF8001FE0000007F8003FC0000003F8007FC0000001F8007F80000 -000F800FF00000000F801FF000000007801FF000000007803FE000000007803FE000000003807F -E000000003807FE000000003807FC000000000007FC00000000000FFC00000000000FFC0000000 -0000FFC00000000000FFC00000000000FFC00000000000FFC00000000000FFC00000000000FFC0 -0000000000FFC000000000007FC000000000007FC000000000007FE000000000007FE000000003 -803FE000000003803FE000000003801FF000000003801FF000000007800FF0000000070007F800 -0000070007FC0000000E0003FC0000001E0001FE0000001C0000FF8000007800003FC00000F000 -001FF80003E0000007FF003F80000001FFFFFE000000003FFFF80000000003FF80000031317CB0 -3A>II70 -D73 D<7FFFFFFFFFFF007FFFFFFFFFFF007FFFFFFFFFFF007FC00FF801FF007E -000FF8003F007C000FF8001F0078000FF8000F0078000FF8000F0070000FF8000700F0000FF800 -0780F0000FF8000780F0000FF8000780E0000FF8000380E0000FF8000380E0000FF8000380E000 -0FF8000380E0000FF800038000000FF800000000000FF800000000000FF800000000000FF80000 -0000000FF800000000000FF800000000000FF800000000000FF800000000000FF800000000000F -F800000000000FF800000000000FF800000000000FF800000000000FF800000000000FF8000000 -00000FF800000000000FF800000000000FF800000000000FF800000000000FF800000000000FF8 -00000000000FF800000000000FF800000000000FF800000000000FF800000000000FF800000000 -000FF800000000000FF8000000007FFFFFFF0000007FFFFFFF0000007FFFFFFF000031307DAF38 ->84 D<00FFF0000003FFFE00000F803F80000FC00FE0001FE007F0001FE007F0001FE003F8000F -C003FC00078003FC00000003FC00000003FC00000003FC00000003FC000000FFFC00001FFFFC00 -00FFE3FC0003FC03FC000FF003FC001FC003FC003FC003FC007F8003FC007F8003FC00FF0003FC -00FF0003FC00FF0003FC00FF0007FC00FF0007FC007F800DFC003FC019FE001FE070FFF007FFE0 -7FF000FF803FF024207E9F27>97 D<01F8000000FFF8000000FFF8000000FFF80000000FF80000 -0007F800000007F800000007F800000007F800000007F800000007F800000007F800000007F800 -000007F800000007F800000007F800000007F800000007F800000007F83FE00007F8FFFC0007FB -E07F0007FF001F8007FE000FC007FC000FE007F80007F007F80007F807F80007F807F80003FC07 -F80003FC07F80003FC07F80003FE07F80003FE07F80003FE07F80003FE07F80003FE07F80003FE -07F80003FE07F80003FE07F80003FC07F80003FC07F80003FC07F80007F807F80007F807F80007 -F007FC000FE007FE000FC007E7003F8007C3C0FE000780FFF80007003FC00027327EB12D>I<00 -0FFF00007FFFC001FC01F003F003F007E007F80FE007F81FC007F83FC003F03FC001E07F800000 -7F8000007F800000FF800000FF800000FF800000FF800000FF800000FF800000FF800000FF8000 -007F8000007F8000007F8000003FC0001C3FC0001C1FC000380FE0003807E0007003F001E001FC -07C0007FFF00000FF8001E207D9F24>I<0000000FC0000007FFC0000007FFC0000007FFC00000 -007FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC000 -00003FC00000003FC00000003FC00000003FC00000003FC00000003FC00007F83FC0003FFF3FC0 -00FE07BFC003F801FFC007E0007FC00FE0007FC01FC0003FC03FC0003FC03FC0003FC07F80003F -C07F80003FC07F80003FC0FF80003FC0FF80003FC0FF80003FC0FF80003FC0FF80003FC0FF8000 -3FC0FF80003FC0FF80003FC07F80003FC07F80003FC07F80003FC03FC0003FC03FC0003FC01FC0 -003FC00FE0007FC007E000FFC003F003FFE001FC0F3FFE007FFE3FFE000FF03FFE27327DB12D> -I<000FFC00007FFF8001FC0FC003F003E007E001F00FE001F81FC000FC3FC000FE3FC000FE7F80 -007E7F80007F7F80007FFF80007FFF80007FFFFFFFFFFFFFFFFFFF800000FF800000FF800000FF -8000007F8000007F8000007F8000003FC000071FC000071FC0000E0FE0000E07F0001C03F80078 -00FE03E0003FFFC00007FE0020207E9F25>I<0001FE00000FFF80001FC3C0007F07E000FE0FF0 -01FE0FF001FC0FF003FC0FF003FC07E003FC018003FC000003FC000003FC000003FC000003FC00 -0003FC000003FC000003FC0000FFFFFC00FFFFFC00FFFFFC0003FC000003FC000003FC000003FC -000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003 -FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC0000 -03FC000003FC000003FC00007FFFF0007FFFF0007FFFF0001C327EB119>I<03C00007E0000FF0 -001FF8001FF8001FF8001FF8000FF00007E00003C0000000000000000000000000000000000000 -0000000000000000000001F800FFF800FFF800FFF8000FF80007F80007F80007F80007F80007F8 -0007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F8 -0007F80007F80007F80007F80007F80007F800FFFF80FFFF80FFFF8011337DB217>105 -D<01F8000000FFF8000000FFF8000000FFF80000000FF800000007F800000007F800000007F800 -000007F800000007F800000007F800000007F800000007F800000007F800000007F800000007F8 -00000007F800000007F800000007F801FFF807F801FFF807F801FFF807F8003F0007F8003C0007 -F800780007F800F00007F803C00007F807800007F80F000007F81E000007F878000007F8FC0000 -07F9FE000007FBFE000007FFFF000007FE7F800007FC7FC00007F83FC00007F01FE00007F00FF0 -0007F00FF80007F007FC0007F003FC0007F001FE0007F000FF0007F000FF8007F0007F8007F000 -7FC0FFFF81FFFEFFFF81FFFEFFFF81FFFE27327EB12B>107 D<01F800FFF800FFF800FFF8000F -F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007 -F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007 -F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007F80007 -F80007F80007F80007F800FFFFC0FFFFC0FFFFC012327DB117>I<03F007F800FFF03FFE00FFF0 -783F00FFF0C03F800FF1801FC007F3001FC007F6001FE007FC001FE007FC001FE007FC001FE007 -F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE0 -07F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001F -E007F8001FE007F8001FE007F8001FE0FFFFC3FFFFFFFFC3FFFFFFFFC3FFFF28207D9F2D>110 -D<0007FC0000007FFFC00001FC07F00003F001F80007E000FC000FC0007E001FC0007F003FC000 -7F803F80003F807F80003FC07F80003FC07F80003FC0FF80003FE0FF80003FE0FF80003FE0FF80 -003FE0FF80003FE0FF80003FE0FF80003FE0FF80003FE07F80003FC07F80003FC07F80003FC03F -C0007F803FC0007F801FC0007F000FE000FE0007E000FC0003F803F80001FE0FF000007FFFC000 -0007FC000023207E9F28>I<03F03F00FFF07FC0FFF1C3E0FFF187E00FF30FF007F60FF007F60F -F007FC07E007FC03C007FC000007FC000007F8000007F8000007F8000007F8000007F8000007F8 -000007F8000007F8000007F8000007F8000007F8000007F8000007F8000007F8000007F8000007 -F8000007F8000007F80000FFFFE000FFFFE000FFFFE0001C207E9F21>114 -D<01FF860007FFFE001F00FE003C003E0078001E0078000E00F8000E00F8000E00F8000E00FC00 -0000FF800000FFFC00007FFFC0007FFFF0003FFFF8001FFFFC0007FFFE0001FFFF00003FFF0000 -00FF8000003F8060001F80E0000F80E0000F80F0000F80F0000F00F8000F00FC001E00FE001C00 -FF807800F3FFF000C07F800019207D9F20>I<001C0000001C0000001C0000001C0000001C0000 -003C0000003C0000003C0000007C0000007C000000FC000001FC000003FC000007FC00001FFFFE -00FFFFFE00FFFFFE0003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC -000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC000003FC038003 -FC038003FC038003FC038003FC038003FC038003FC038001FC038001FC070000FE0700007F0E00 -003FFC000007F000192E7FAD1F>I<01F80007E0FFF803FFE0FFF803FFE0FFF803FFE00FF8003F -E007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F800 -1FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8001FE007F8 -001FE007F8001FE007F8001FE007F8001FE007F8003FE007F8003FE003F8007FE003F8007FE001 -FC00DFF000FE039FFF007FFF1FFF000FFC1FFF28207D9F2D>I<7FFF807FFC7FFF807FFC7FFF80 -7FFC03FE000F0001FE001E0000FF003C0000FF807800007FC07800003FE0F000001FE1E000000F -F3C000000FFF80000007FF00000003FE00000001FE00000000FF00000000FF80000000FFC00000 -01FFC0000003DFE00000078FF00000078FF800000F07FC00001E03FC00003C01FE00007800FF00 -00F000FF8000E0007FC001E0003FC0FFFC01FFFFFFFC01FFFFFFFC01FFFF28207F9F2B>120 -D E /Fj 18 117 df<387CFEFEFE7C3807077D860D>46 D<03F0000FFC001F3E003E1F003C0F00 -7C0F807C0F807C0F80FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0 -FC0FC0FC0FC0FC0FC07C0F807C0F807C0F803C0F003E1F001F3E000FFC0003F000121D7E9C17> -48 D<00E001E00FE0FFE0F3E003E003E003E003E003E003E003E003E003E003E003E003E003E0 -03E003E003E003E003E003E003E003E003E07FFF7FFF101D7D9C17>I<07F0001FFC00387E007C -3F00FE1F80FE1F80FE1FC0FE0FC07C0FC0380FC0001FC0001F80001F80003F00003E00007C0000 -780000E00001C0000380000700C00600C00C00C01801C03FFF803FFF807FFF80FFFF80FFFF8012 -1D7E9C17>I<07F0000FFC001C3E003C3F007E1F807E1F807E1F807E1F803C3F00003F00003E00 -007C0003F80003F000003C00003F00001F80001F80001FC0381FC07C1FC0FE1FC0FE1FC0FE1F80 -FC1F80783F00383E001FFC0007F000121D7E9C17>I<000700000F00000F00001F00003F00003F -00006F0000EF0001CF00018F00038F00070F00060F000C0F001C0F00380F00300F00700F00E00F -00FFFFF0FFFFF0001F00001F00001F00001F00001F00001F0001FFF001FFF0141D7F9C17>I<38 -03003FFF003FFE003FFC003FF8003FE0003F000030000030000030000030000033F00037FC003C -1E00380F00100F80000F80000FC0000FC0780FC0FC0FC0FC0FC0FC0FC0FC0F80780F80601F0038 -3E001FFC0007E000121D7E9C17>I<00FC0003FE000783000F0F801E1F803E1F803C1F807C1F80 -7C0F007C0000FC0000FDFC00FFFE00FE0F00FE0F80FC0F80FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0 -7C0FC07C0FC07C0F803C0F803E0F001E1E000FFC0003F000121D7E9C17>I<6000007FFFC07FFF -C07FFF807FFF007FFE00E00600C00C00C01800C0180000300000600000E00000E00001E00001C0 -0003C00003C00003C00007C00007C00007C0000FC0000FC0000FC0000FC0000FC0000FC0000780 -00030000121E7D9D17>I<03F0000FFC001E1E00380F003807807807807807807C07807E07807F -0F003FCE003FFC001FF8000FFE000FFF001FFF003C7F80783FC0700FC0F007C0F003C0F003C0F0 -03C0F003807803807807003E0E001FFC0007F000121D7E9C17>I<03F0000FFC001E1E003C1F00 -7C0F007C0F80FC0F80FC0F80FC0FC0FC0FC0FC0FC0FC0FC0FC0FC07C0FC07C1FC03C1FC01FFFC0 -0FEFC0000FC0000F803C0F807E0F807E0F007E1F007E1E007C3C003878001FF0000FC000121D7E -9C17>I<07F0001FFC003F1E003F1F003F0F803F0F800C0F80000F8000FF800FFF801F0F807C0F -807C0F80F80F80F80F80F80F80F817807C37803FE3F00F81F014147F9316>97 -DI<03F00FFC1E7E3E7E7C7E7C7EFC -18FC00FC00FC00FC00FC00FC00FC007C007E033E031F0E0FFC03F010147E9314>I<1C003E007F -007F007F003E001C00000000000000000000000000FF00FF001F001F001F001F001F001F001F00 -1F001F001F001F001F001F001F001F001F00FFE0FFE00B217FA00C>105 -D109 -D112 D<0300030003000300070007000F000F003F00FFF8 -FFF81F001F001F001F001F001F001F001F001F001F001F181F181F181F181F180F3007F003E00D -1D7F9C12>116 D E /Fk 34 122 df46 D<01800780FF80FF800F800F -800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F807FE07FE00B177D96 -12>49 D<1F803FC07FE0F1F0F0F860F820F800F800F800F001F001E003C0078007000E001E001C -0038007000FFF8FFF87FF80D177E9612>I<1F803FC07FE0F1F061F041F001F001F001E003C00F -800FC001E000F000F800F800F880F8C0F8E1F07FF03FE01F800D177E9612>I<3FF83FF83FF83E -003E003E003E003E003E003FE03FF03C783878007C007C007C007C407C607CF0F87FF03FE00FC0 -0E177F9612>53 D58 -D<01FC0001FC0003FE0003FE0003DE0007DF0007DF00079F00078F000F8F800F8F800F0F801F07 -C01F07C01F07C03FFFE03FFFE03FFFE07C03F07C01F07C01F0F801F8F800F815177F9618>65 -D<7FF800FFFE00FFFF00F81F00F80F80F80F80F80F80F80F80F80F80F81F00FFFE00FFFE00F81F -80F80F80F807C0F807C0F807C0F807C0F807C0F81F80FFFF80FFFF007FFC0012177D9618>I<01 -FF0007FFC00FFFC01F83C03E00807C00007C0000F80000F80000F80000F80000F80000F80000F8 -0000F80000F800007C00007C00403E00C01F81C00FFFC007FF8001FE0012177E9617>I<7FF800 -FFFF00FFFF80F81FC0F807C0F803E0F803E0F801F0F801F0F801F0F801F0F801F0F801F0F801F0 -F801F0F801F0F803E0F803E0F807E0F80FC0FFFF80FFFF007FF80014177D961A>I<7FFCFFFCFF -FCF800F800F800F800F800F800F800FFF8FFF8FFF8F800F800F800F800F800F800F800F800F800 -78000E177D9614>70 D<78F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F87805177D960B> -73 D<7FF800FFFE00FFFF00F81F00F80F80F80F80F80F80F80F80F80F80F81F00FFFE00FFF800 -F8F800F8F800F87C00F87C00F83E00F83E00F81F00F81F00F80F80F80F807807C012177D9617> -82 D<7FFFF8FFFFF8FFFFF800F80000F80000F80000F80000F80000F80000F80000F80000F800 -00F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000780015177F9618> -84 D<0FC03FF030F820F800F800F81FF83EF878F8F8F8F8F8F8F879F87FF81EF80D0F7F8E11> -97 D<7800F800F800F800F800F800F800F800FBE0FFF8F87CF83CF83EF83EF83EF83EF83EF83E -F83EF83CF878FFF07BE00F177E9613>I<0FE01FF83C387808F800F800F800F800F800F800F800 -78083C381FF80FE00D0F7F8E10>I<003E003E003E003E003E003E003E003E0FBE1FFE3C3E783E -F83EF83EF83EF83EF83EF83EF83E783E7C3E3FFE0FBE0F177F9613>I<0FC01FF03C787878F83C -F83CFFFCFFFCF800F800780078043C1C1FFC07F00E0F7F8E11>I<03F00FF00F101F001F001F00 -1F001F007F80FF801F001F001F001F001F001F001F001F001F001F001F001F000F000C1780960B ->I<1FCE3FFE78F0F8F8F8F8F8F8F8F878F03FE07FC0600060007FF07FF83FFC7FFEE00EE00EE0 -0E701C3FF81FF00F167F8E12>I<7800F800F800F800F800F800F800F800F9F0FBF8FE7CFC7CF8 -7CF87CF87CF87CF87CF87CF87CF87CF87CF87C787C0E177E9613>II<7000F000F000F000F000F000F000F000F078F0 -F8F3E0F7C0FF80FF00FF00FF80FFC0F3E0F1E0F0F0F0F8F07C703C0E177E9612>107 -D<79F0FBF8FE7CFC7CF87CF87CF87CF87CF87CF87CF87CF87CF87CF87C787C0E0F7E8E13>110 -D<0FE03FF87C7C783CF83EF83EF83EF83EF83EF83EF83E783C7C7C3FF80FE00F0F7F8E12>I<7B -E0FFF8F87CF87CF83EF83EF83EF83EF83EF83EF83EF87CF878FFF0FBE0F800F800F800F800F800 -78000F157E8E13>I<7BFFFFFCF8F8F8F8F8F8F8F8F8F878080F7E8E0C>114 -D<1F007FC0E0C0E040E000FE00FF807FC03FE007E0C0E0C0E0F0E07FC01F000B0F7F8E0E>I<1E -003E003E003E003E007F80FF803E003E003E003E003E003E003E003E003E003E003E403FC01F00 -0A147F930D>I<787CF87CF87CF87CF87CF87CF87CF87CF87CF87CF87CF87CF8FC7FFC3E7C0E0F -7E8E13>II -120 DI E /Fl 14 117 df<70F8F8F0E005057B840E>46 -D<000F800030E000E07001C0700380300380380700380F00780F00780E00781E00781E00703C00 -F03C00F03C00F03C00F07801E07801E07801E07801C07003C0F003C0F00380F00780F007007007 -00700E00701C003038001870000FC000151F7C9D17>48 D<000200020006000E003C00DC031C00 -1C0038003800380038007000700070007000E000E000E000E001C001C001C001C0038003800380 -03800780FFF80F1E7B9D17>I<00C06000FFC001FF8001FE000100000100000200000200000200 -00020000040000047800058C000606000C0700080700000780000780000780000780000F00700F -00F00F00F00E00E01E00801C0080380080300040600061C0001F0000131F7B9D17>53 -D<001F0000718000C0C00180C00380E00700E00F00E00F01E01E01E01E01E01E01E01E01C01C03 -C01C03C01C03C01C07C01C0F800C0F8006378003C700000F00000E00000E00001C00601C00F038 -00F07000E0600080C0004380003E0000131F7B9D17>57 D<01FFFFC0001E00F0001E0078001E00 -38001E003C003C003C003C003C003C003C003C003C0078007800780078007800F0007801E000F0 -078000FFFE0000F00F8000F003C001E001C001E001E001E001E001E001E003C001E003C001E003 -C001E003C001C0078003C00780078007800F0007801E000F007800FFFFE0001E1F7D9E20>66 -D<01FFFF80001E00E0001E0070001E0038001E001C003C001C003C000E003C000E003C000E0078 -000E0078000E0078000E0078000E00F0001E00F0001E00F0001E00F0001E01E0003C01E0003C01 -E0003C01E0007803C0007003C0007003C000E003C001C0078001C00780038007800E0007801C00 -0F007000FFFFC0001F1F7D9E22>68 D<01FFFFFC001E0038001E0018001E0008001E0008003C00 -08003C0008003C0008003C00080078001000780800007808000078080000F0100000F0300000FF -F00000F0300001E0200001E0200001E0200001E0200003C0000003C0000003C0000003C0000007 -8000000780000007800000078000000F800000FFF800001E1F7D9E1E>70 -D<00F1800389C00707800E03801C03803C0380380700780700780700780700F00E00F00E00F00E -00F00E20F01C40F01C40703C40705C40308C800F070013147C9317>97 D<007E0001C100030080 -0E07801E07801C07003C0200780000780000780000F00000F00000F00000F00000F00000700100 -70020030040018380007C00011147C9315>99 D<00C001E001E001C00000000000000000000000 -0000000E003300230043804300470087000E000E000E001C001C001C0038403880308070803100 -33001C000B1F7C9E0E>105 D<1C0F80F0002630C318004740640C004780680E004700700E0047 -00700E008E00E01C000E00E01C000E00E01C000E00E01C001C01C038001C01C038001C01C03800 -1C01C0708038038071003803806100380380E10038038062007007006600300300380021147C93 -25>109 D<01C1E002621804741C04781C04701E04701E08E01E00E01E00E01E00E01E01C03C01 -C03C01C03C01C0380380780380700380E003C1C0072380071E000700000700000E00000E00000E -00000E00001C00001C0000FFC000171D809317>112 D<018001C0038003800380038007000700 -FFF007000E000E000E000E001C001C001C001C003800380038003820704070407080708031001E -000C1C7C9B0F>116 D E /Fm 81 125 df<001F83E000F06E3001C078780380F8780300F03007 -007000070070000700700007007000070070000700700007007000FFFFFF800700700007007000 -070070000700700007007000070070000700700007007000070070000700700007007000070070 -000700700007007000070070000700700007007000070070007FE3FF001D20809F1B>11 -D<003F0000E0C001C0C00381E00701E00701E0070000070000070000070000070000070000FFFF -E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700 -E00700E00700E00700E00700E00700E07FC3FE1720809F19>I<003FE000E0E001C1E00381E007 -00E00700E00700E00700E00700E00700E00700E00700E0FFFFE00700E00700E00700E00700E007 -00E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E007 -00E07FE7FE1720809F19>I<001F81F80000F04F040001C07C06000380F80F000300F00F000700 -F00F00070070000007007000000700700000070070000007007000000700700000FFFFFFFF0007 -007007000700700700070070070007007007000700700700070070070007007007000700700700 -070070070007007007000700700700070070070007007007000700700700070070070007007007 -00070070070007007007007FE3FE3FF02420809F26>I<70F8F8F8F8F8F8F87070707070707070 -70702020202020000000000070F8F8F87005217CA00D>33 D<0078000000840000018400000302 -000007020000070200000702000007020000070400000704000007080000070800000310000003 -A00FFC03C003E0038001C001C0008001C0010003E0010004E0020008F002001870040030780800 -70380800701C1000F01E1000F00E2000F0074000F003C0087003C0087801C010380670301C1838 -6007E00F801E227EA023>38 D<70F8FCFC74040404080810102040060E7C9F0D>I<0020004000 -800100020006000C000C00180018003000300030007000600060006000E000E000E000E000E000 -E000E000E000E000E000E000E0006000600060007000300030003000180018000C000C00060002 -0001000080004000200B2E7DA112>I<800040002000100008000C000600060003000300018001 -80018001C000C000C000C000E000E000E000E000E000E000E000E000E000E000E000E000C000C0 -00C001C001800180018003000300060006000C00080010002000400080000B2E7DA112>I<0180 -0180018001800180C183F18F399C0FF003C003C00FF0399CF18FC1830180018001800180018010 -147DA117>I<70F8FCFC74040404080810102040060E7C840D>44 DI<70 -F8F8F87005057C840D>I<03F0000E1C001C0E00180600380700700380700380700380700380F0 -03C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C070 -03807003807003807807803807001806001C0E000E1C0003F000121F7E9D17>48 -D<018003800F80F380038003800380038003800380038003800380038003800380038003800380 -03800380038003800380038003800380038007C0FFFE0F1E7C9D17>I<03F0000C1C00100E0020 -0700400780800780F007C0F803C0F803C0F803C02007C00007C0000780000780000F00000E0000 -1C0000380000700000600000C0000180000300000600400C00401800401000803FFF807FFF80FF -FF80121E7E9D17>I<03F0000C1C00100E00200F00780F80780780780780380F80000F80000F00 -000F00000E00001C0000380003F000003C00000E00000F000007800007800007C02007C0F807C0 -F807C0F807C0F00780400780400F00200E001C3C0003F000121F7E9D17>I<000600000600000E -00000E00001E00002E00002E00004E00008E00008E00010E00020E00020E00040E00080E00080E -00100E00200E00200E00400E00C00E00FFFFF0000E00000E00000E00000E00000E00000E00000E -0000FFE0141E7F9D17>I<1803001FFE001FFC001FF8001FE00010000010000010000010000010 -000010000011F000161C00180E001007001007800003800003800003C00003C00003C07003C0F0 -03C0F003C0E00380400380400700200600100E000C380003E000121F7E9D17>I<007C00018200 -0701000E03800C07801C0780380300380000780000700000700000F1F000F21C00F40600F80700 -F80380F80380F003C0F003C0F003C0F003C0F003C07003C07003C0700380380380380700180700 -0C0E00061C0001F000121F7E9D17>I<4000007FFFC07FFF807FFF804001008002008002008004 -0000080000080000100000200000200000400000400000C00000C00001C0000180000380000380 -00038000038000078000078000078000078000078000078000078000030000121F7D9D17>I<03 -F0000C0C001006003003002001806001806001806001807001807803003E03003F06001FC8000F -F00003F80007FC000C7E00103F00300F806003804001C0C001C0C000C0C000C0C000C0C0008060 -01802001001002000C0C0003F000121F7E9D17>I<03F0000E18001C0C00380600380700700700 -700380F00380F00380F003C0F003C0F003C0F003C0F003C07007C07007C03807C0180BC00E13C0 -03E3C0000380000380000380000700300700780600780E00700C002018001070000FC000121F7E -9D17>I<70F8F8F8700000000000000000000070F8F8F87005147C930D>I<70F8F8F87000000000 -00000000000070F0F8F878080808101010202040051D7C930D>I<0FC0307040384038E03CF03C -F03C603C0038007000E000C0018001800100030002000200020002000200020000000000000000 -00000007000F800F800F8007000E207D9F15>63 D<001F800000E0700001000800060006000800 -010008000100100F00802030C0402060404040C0202041C01C2041C01C2081801C1083801C1083 -801C1083801C1083801C1083801C1083801C1081801C1041C01C1041C01C1040C03C2020605C20 -2030CC40100F0780080000000800000006000070010001C000E01F00001FF0001C207D9F23>I< -000100000003800000038000000380000007C0000007C0000007C0000009E0000009E0000009E0 -000010F0000010F0000010F00000207800002078000020780000403C0000403C0000403C000080 -1E0000801E0000FFFE0001000F0001000F0001000F00020007800200078002000780040003C00E -0003C01F0007E0FFC03FFE1F207F9F22>II<000FC040007030 -C001C009C0038005C0070003C00E0001C01E0000C01C0000C03C0000C07C0000407C0000407800 -0040F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800000078 -0000007C0000407C0000403C0000401C0000401E0000800E000080070001000380020001C00400 -00703800000FC0001A217D9F21>IIII<000FE0200078186000E004E0038002E0070001E00F -0000E01E0000601E0000603C0000603C0000207C00002078000020F8000000F8000000F8000000 -F8000000F8000000F8000000F8000000F8007FFCF80003E0780001E07C0001E03C0001E03C0001 -E01E0001E01E0001E00F0001E0070001E0038002E000E0046000781820000FE0001E217D9F24> -III<0FFFC0007C00003C00003C00003C00003C00003C00003C00003C00003C00003C00 -003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00203C00 -F83C00F83C00F83C00F0380040780040700030E0000F800012207E9E17>IIIII<001F800000F0F00001C0380007801E000F000F000E0007001E0007803C00 -03C03C0003C07C0003E0780001E0780001E0F80001F0F80001F0F80001F0F80001F0F80001F0F8 -0001F0F80001F0F80001F0F80001F0780001E07C0003E07C0003E03C0003C03C0003C01E000780 -0E0007000F000F0007801E0001C0380000F0F000001F80001C217D9F23>II82 D<07E0800C19801007803003806001 -80600180E00180E00080E00080E00080F00000F000007800007F00003FF0001FFC000FFE0003FF -00001F800007800003C00003C00001C08001C08001C08001C08001C0C00180C00380E00300F006 -00CE0C0081F80012217D9F19>I<7FFFFFE0780F01E0600F0060400F0020400F0020C00F003080 -0F0010800F0010800F0010800F0010000F0000000F0000000F0000000F0000000F0000000F0000 -000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F00 -00000F0000000F0000000F0000001F800007FFFE001C1F7E9E21>IIII<7FF83FF80FE00FC007C0 -070003C0020001E0040001F00C0000F0080000781000007C1000003C2000003E4000001E400000 -0F8000000F8000000780000003C0000007E0000005E0000009F0000018F8000010780000207C00 -00603C0000401E0000801F0001800F0001000780020007C0070003C01F8007E0FFE01FFE1F1F7F -9E22>II<7FFFF87C00F87000F06001E04001E0C003C0C003C0 -800780800F80800F00001E00001E00003C00003C0000780000F80000F00001E00001E00003C004 -03C0040780040F80040F000C1E000C1E00083C00183C0018780038F801F8FFFFF8161F7D9E1C> -II93 D<1FE000303000781800781C -00300E00000E00000E00000E0000FE00078E001E0E00380E00780E00F00E10F00E10F00E10F01E -10781E103867200F83C014147E9317>97 D<0E0000FE00000E00000E00000E00000E00000E0000 -0E00000E00000E00000E00000E00000E3E000EC3800F01C00F00E00E00E00E00700E00700E0078 -0E00780E00780E00780E00780E00780E00700E00700E00E00F00E00D01C00CC300083E0015207F -9F19>I<03F80E0C1C1E381E380C70007000F000F000F000F000F000F00070007000380138011C -020E0C03F010147E9314>I<000380003F80000380000380000380000380000380000380000380 -00038000038000038003E380061B801C0780380380380380700380700380F00380F00380F00380 -F00380F00380F003807003807003803803803807801C07800E1B8003E3F815207E9F19>I<03F0 -000E1C001C0E00380700380700700700700380F00380F00380FFFF80F00000F00000F000007000 -007000003800801800800C010007060001F80011147F9314>I<007C00C6018F038F0706070007 -0007000700070007000700FFF00700070007000700070007000700070007000700070007000700 -070007000700070007007FF01020809F0E>I<0000E003E3300E3C301C1C30380E00780F00780F -00780F00780F00780F00380E001C1C001E380033E0002000002000003000003000003FFE001FFF -800FFFC03001E0600070C00030C00030C00030C000306000603000C01C038003FC00141F7F9417 ->I<0E0000FE00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E -3E000E43000E81800F01C00F01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E -01C00E01C00E01C00E01C00E01C00E01C0FFE7FC16207F9F19>I<1C001E003E001E001C000000 -000000000000000000000E007E000E000E000E000E000E000E000E000E000E000E000E000E000E -000E000E000E000E00FFC00A1F809E0C>I<00E001F001F001F000E00000000000000000000000 -00007007F000F00070007000700070007000700070007000700070007000700070007000700070 -007000700070007000706070F060F0C061803F000C28829E0E>I<0E0000FE00000E00000E0000 -0E00000E00000E00000E00000E00000E00000E00000E00000E0FF00E03C00E03000E02000E0400 -0E08000E10000E30000E70000EF8000F38000E1C000E1E000E0E000E07000E07800E03800E03C0 -0E03E0FFCFF815207F9F18>I<0E00FE000E000E000E000E000E000E000E000E000E000E000E00 -0E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E00FFE00B -20809F0C>I<0E1F01F000FE618618000E81C81C000F00F00E000F00F00E000E00E00E000E00E0 -0E000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E000E00 -E00E000E00E00E000E00E00E000E00E00E000E00E00E00FFE7FE7FE023147F9326>I<0E3E00FE -43000E81800F01C00F01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E -01C00E01C00E01C00E01C00E01C0FFE7FC16147F9319>I<01F800070E001C03803801C03801C0 -7000E07000E0F000F0F000F0F000F0F000F0F000F0F000F07000E07000E03801C03801C01C0380 -070E0001F80014147F9317>I<0E3E00FEC3800F01C00F00E00E00E00E00F00E00700E00780E00 -780E00780E00780E00780E00780E00700E00F00E00E00F01E00F01C00EC3000E3E000E00000E00 -000E00000E00000E00000E00000E00000E0000FFE000151D7F9319>I<03E0800619801C05803C -0780380380780380700380F00380F00380F00380F00380F00380F0038070038078038038038038 -07801C0B800E138003E380000380000380000380000380000380000380000380000380003FF815 -1D7E9318>I<0E78FE8C0F1E0F1E0F0C0E000E000E000E000E000E000E000E000E000E000E000E -000E000E00FFE00F147F9312>I<1F9030704030C010C010C010E00078007F803FE00FF0007080 -3880188018C018C018E030D0608F800D147E9312>I<020002000200060006000E000E003E00FF -F80E000E000E000E000E000E000E000E000E000E000E000E080E080E080E080E080610031001E0 -0D1C7F9B12>I<0E01C0FE1FC00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01 -C00E01C00E01C00E01C00E01C00E01C00E03C00603C0030DC001F1FC16147F9319>III<7FC3FC0F01E0 -0701C007018003810001C20000E40000EC00007800003800003C00007C00004E00008700010700 -0303800201C00601E01E01E0FF07FE1714809318>II<3F -FF380E200E201C40384078407000E001E001C00380078007010E011E011C0338027006700EFFFE -10147F9314>I124 D E /Fn 53 122 df<0001FF01FE00001FFFCF -FF00007F01FF0F8000FC03FE1FC001F807FC1FC003F807FC1FC007F007F81FC007F007F80F8007 -F003F8000007F003F8000007F003F8000007F003F8000007F003F8000007F003F8000007F003F8 -0000FFFFFFFFF000FFFFFFFFF000FFFFFFFFF00007F003F8000007F003F8000007F003F8000007 -F003F8000007F003F8000007F003F8000007F003F8000007F003F8000007F003F8000007F003F8 -000007F003F8000007F003F8000007F003F8000007F003F8000007F003F8000007F003F8000007 -F003F8000007F003F8000007F003F8000007F003F8000007F003F800007FFF3FFFC0007FFF3FFF -C0007FFF3FFFC0002A2A7FA927>11 D<0001FF0000001FFFC000007F81E00000FC01E00001F807 -F00003F807F00007F007F00007F007F00007F007F00007F007F00007F001C00007F000000007F0 -00000007F000000007F03FF800FFFFFFF800FFFFFFF800FFFFFFF80007F003F80007F003F80007 -F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F800 -07F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F8 -0007F003F80007F003F80007F003F8007FFF3FFF807FFF3FFF807FFF3FFF80212A7FA925>I<3C -007F00FF80FF80FFC0FFC0FFC07FC03EC000C000C00180018001800300030006000E001C003800 -30000A157BA913>39 D<1C007F007F00FF80FF80FF807F007F001C0009097B8813>46 -D<003F800001FFF00007E0FC000FC07E001F803F001F001F003F001F803E000F807E000FC07E00 -0FC07E000FC07E000FC0FE000FE0FE000FE0FE000FE0FE000FE0FE000FE0FE000FE0FE000FE0FE -000FE0FE000FE0FE000FE0FE000FE0FE000FE0FE000FE0FE000FE0FE000FE07E000FC07E000FC0 -7E000FC07E000FC03F001F803F001F801F001F001F803F000FC07E0007E0FC0001FFF000003F80 -001B277DA622>48 D<000E00001E00007E0007FE00FFFE00FFFE00F8FE0000FE0000FE0000FE00 -00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00 -00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00 -7FFFFE7FFFFE7FFFFE17277BA622>I<00FF800007FFF0000FFFFC001E03FE003800FF807C003F -80FE003FC0FF001FC0FF001FE0FF000FE0FF000FE07E000FE03C001FE000001FE000001FC00000 -1FC000003F8000003F0000007E000000FC000000F8000001F0000003E00000078000000F000000 -1E0000003C00E0007000E000E000E001C001C0038001C0060001C00FFFFFC01FFFFFC03FFFFFC0 -7FFFFFC0FFFFFF80FFFFFF80FFFFFF801B277DA622>I<007F800003FFF00007FFFC000F80FE00 -1F007F003F807F003F803F803F803F803F803F801F803F801F003F8000007F0000007F0000007E -000000FC000001F8000007F00000FFC00000FFC0000001F80000007E0000003F0000003F800000 -1FC000001FC000001FE000001FE03C001FE07E001FE0FF001FE0FF001FE0FF001FC0FF003FC0FE -003F807C007F003F00FE001FFFFC0007FFF00000FF80001B277DA622>I<00000E0000001E0000 -003E0000007E000000FE000000FE000001FE000003FE0000077E00000E7E00000E7E00001C7E00 -00387E0000707E0000E07E0000E07E0001C07E0003807E0007007E000E007E000E007E001C007E -0038007E0070007E00E0007E00FFFFFFF8FFFFFFF8FFFFFFF80000FE000000FE000000FE000000 -FE000000FE000000FE000000FE000000FE00007FFFF8007FFFF8007FFFF81D277EA622>I<1800 -03001F801F001FFFFE001FFFFC001FFFF8001FFFF0001FFFC0001FFF00001C0000001C0000001C -0000001C0000001C0000001C0000001C0000001C7FC0001DFFF8001F80FC001E003F0008003F00 -00001F8000001FC000001FC000001FE000001FE018001FE07C001FE0FE001FE0FE001FE0FE001F -E0FE001FC0FC001FC078003F8078003F803C007F001F01FE000FFFFC0003FFF00000FF80001B27 -7DA622>I<0007F800003FFE0000FFFF0001FC078003F00FC007C01FC00F801FC01F801FC01F00 -1FC03F000F803F0000007E0000007E0000007E000000FE020000FE1FF000FE3FFC00FE603E00FE -801F00FF801F80FF000FC0FF000FC0FE000FE0FE000FE0FE000FE0FE000FE07E000FE07E000FE0 -7E000FE07E000FE03E000FE03F000FC01F000FC01F001F800F801F0007E07E0003FFFC0001FFF8 -00003FC0001B277DA622>I<380000003E0000003FFFFFF03FFFFFF03FFFFFF07FFFFFE07FFFFF -C07FFFFF807FFFFF0070000E0070000E0070001C00E0003800E0007000E000E0000001E0000001 -C000000380000007800000070000000F0000001F0000001E0000003E0000003E0000007E000000 -7C0000007C000000FC000000FC000000FC000000FC000001FC000001FC000001FC000001FC0000 -01FC000001FC000001FC000000F80000007000001C297CA822>I<003FC00001FFF00003FFFC00 -07C07E000F003F001E001F001E000F803E000F803E000F803F000F803F800F803FC00F803FF01F -001FFC1E001FFE3C000FFFF8000FFFE00007FFF80001FFFC0001FFFE0007FFFF000F0FFF801E03 -FFC03E01FFC07C007FE07C001FE0F8000FE0F80007E0F80003E0F80003E0F80003E0F80003C07C -0003C07E0007803F000F001FC03F000FFFFC0003FFF800007FC0001B277DA622>I<007F800001 -FFF00007FFF8000FC0FC001F803E003F001F007E001F807E001F807E000F80FE000FC0FE000FC0 -FE000FC0FE000FE0FE000FE0FE000FE0FE000FE0FE000FE07E001FE07E001FE03F003FE01F002F -E00F80CFE007FF8FE001FF0FE000080FE000000FC000000FC000000FC000001F803E001F807F00 -1F807F003F007F003E007F007E007E00FC003E03F8001FFFE0000FFF800001FE00001B277DA622 ->I<00000780000000000780000000000FC0000000000FC0000000000FC0000000001FE0000000 -001FE0000000003FF0000000003FF0000000003FF00000000077F80000000077F800000000F7FC -00000000E3FC00000000E3FC00000001C1FE00000001C1FE00000003C1FF0000000380FF000000 -0380FF00000007007F80000007007F8000000F007FC000000E003FC000000E003FC000001C001F -E000001C001FE000003FFFFFF000003FFFFFF000003FFFFFF00000700007F80000700007F80000 -F00007FC0000E00003FC0000E00003FC0001C00001FE0001C00001FE0003C00001FF00FFFE003F -FFFCFFFE003FFFFCFFFE003FFFFC2E297EA833>65 DI< -00007FE0030007FFFC07001FFFFF0F007FF00F9F00FF0001FF01FC0000FF03F800007F07F00000 -3F0FE000001F1FC000001F1FC000000F3F8000000F3F800000077F800000077F800000077F0000 -0000FF00000000FF00000000FF00000000FF00000000FF00000000FF00000000FF00000000FF00 -000000FF000000007F000000007F800000007F800000073F800000073F800000071FC00000071F -C000000E0FE000000E07F000001C03F800003C01FC00007800FF0001F0007FF007C0001FFFFF80 -0007FFFE0000007FF00028297CA831>II70 D<00007FE003000007FFFC0700001FFFFF0F00007FF00F9F00 -00FF0001FF0001FC0000FF0003F800007F0007F000003F000FE000001F001FC000001F001FC000 -000F003F8000000F003F80000007007F80000007007F80000007007F0000000000FF0000000000 -FF0000000000FF0000000000FF0000000000FF0000000000FF0000000000FF0000000000FF0000 -000000FF0000FFFFF87F0000FFFFF87F8000FFFFF87F800000FF003F800000FF003F800000FF00 -1FC00000FF001FC00000FF000FE00000FF0007F00000FF0003F80000FF0001FC0000FF0000FF00 -01FF00007FF007FF00001FFFFF9F000007FFFE0F0000007FF003002D297CA835>III77 D<0000FFC00000000FFFFC0000003F807F000000FE001FC00001F800 -07E00003F00003F00007E00001F8000FE00001FC001FC00000FE001FC00000FE003F8000007F00 -3F8000007F007F8000007F807F0000003F807F0000003F807F0000003F80FF0000003FC0FF0000 -003FC0FF0000003FC0FF0000003FC0FF0000003FC0FF0000003FC0FF0000003FC0FF0000003FC0 -FF0000003FC0FF0000003FC07F0000003F807F8000007F807F8000007F803F8000007F003F8000 -007F001FC00000FE001FC00000FE000FE00001FC0007F00003F80003F80007F00001FC000FE000 -00FE001FC000003FC0FF0000000FFFFC00000000FFC000002A297CA833>79 -D82 D<00FF00C003FFE1C00FFFF9C01F80FFC03F00 -3FC03E000FC07C0007C07C0007C0FC0003C0FC0003C0FC0001C0FE0001C0FE0001C0FF000000FF -C000007FFC00007FFFE0003FFFF8001FFFFE001FFFFF0007FFFF8003FFFFC000FFFFC0000FFFE0 -00007FE000001FF000000FF0000007F0E00003F0E00003F0E00003F0E00003F0F00003E0F00003 -E0F80007E0FC0007C0FF000F80FFE01F80E3FFFF00E1FFFC00C01FF0001C297CA825>I<7FFFFF -FFFF807FFFFFFFFF807FFFFFFFFF807F807F807F807C007F800F8078007F80078078007F800780 -70007F800380F0007F8003C0F0007F8003C0E0007F8001C0E0007F8001C0E0007F8001C0E0007F -8001C0E0007F8001C000007F80000000007F80000000007F80000000007F80000000007F800000 -00007F80000000007F80000000007F80000000007F80000000007F80000000007F80000000007F -80000000007F80000000007F80000000007F80000000007F80000000007F80000000007F800000 -00007F80000000007F80000000007F80000000007F80000000FFFFFFC00000FFFFFFC00000FFFF -FFC0002A287EA72F>IIII<03FF80000F -FFF0001F01FC003F80FE003F807F003F803F003F803F801F003F8000003F8000003F8000003F80 -00003F80003FFF8001FC3F800FE03F801F803F803F003F807E003F80FC003F80FC003F80FC003F -80FC003F80FC005F807E00DF803F839FFC1FFE0FFC03F803FC1E1B7E9A21>97 -DI<003FF00001FFFC0003F03E000FC07F001F807F -003F007F003F007F007F003E007E0000007E000000FE000000FE000000FE000000FE000000FE00 -0000FE000000FE0000007E0000007E0000007F0000003F0003803F8003801F8007000FE00E0003 -F83C0001FFF800003FC000191B7E9A1E>I<00007FF000007FF000007FF0000007F0000007F000 -0007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0 -003F87F001FFF7F007F03FF00FC00FF01F8007F03F0007F03F0007F07E0007F07E0007F07E0007 -F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F07E0007F07E00 -07F03F0007F03F0007F01F800FF00FC01FF007E07FFF01FFE7FF007F87FF202A7EA925>I<003F -C00001FFF00003E07C000F803E001F801F001F001F003F000F807E000F807E000FC07E000FC0FE -0007C0FE0007C0FFFFFFC0FFFFFFC0FE000000FE000000FE0000007E0000007E0000007F000000 -3F0001C01F0001C00F80038007C0070003F01E0000FFFC00003FE0001A1B7E9A1F>I<0007F800 -3FFC007E3E01FC7F03F87F03F07F07F07F07F03E07F00007F00007F00007F00007F00007F00007 -F000FFFFC0FFFFC0FFFFC007F00007F00007F00007F00007F00007F00007F00007F00007F00007 -F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F0007FFF807F -FF807FFF80182A7EA915>I<007F80F001FFE3F807C0FE1C0F807C7C1F003E7C1F003E103F003F -003F003F003F003F003F003F003F003F003F003F001F003E001F003E000F807C0007C0F80005FF -E0000C7F8000180000001C0000001C0000001E0000001FFFF8001FFFFF000FFFFFC007FFFFE003 -FFFFF00FFFFFF03E0007F07C0001F8F80000F8F80000F8F80000F8F80000F87C0001F07C0001F0 -3F0007E00FC01F8007FFFF00007FF0001E287E9A22>II<07000F801FC03FE03FE03FE01FC00F8007000000000000000000000000000000FFE0FFE0 -FFE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00F -E00FE00FE0FFFEFFFEFFFE0F2B7EAA12>I107 -DIII<003FE00001FFFC0003F07E000FC01F801F800FC03F0007E03F00 -07E07E0003F07E0003F07E0003F0FE0003F8FE0003F8FE0003F8FE0003F8FE0003F8FE0003F8FE -0003F8FE0003F87E0003F07E0003F03F0007E03F0007E01F800FC00FC01F8007F07F0001FFFC00 -003FE0001D1B7E9A22>II114 D<03FE300FFFF03E03F0 -7800F07000F0F00070F00070F80070FE0000FFE0007FFF007FFFC03FFFE01FFFF007FFF800FFF8 -0007FC0000FCE0007CE0003CF0003CF00038F80038FC0070FF01E0E7FFC0C1FF00161B7E9A1B> -I<00700000700000700000700000F00000F00000F00001F00003F00003F00007F0001FFFE0FFFF -E0FFFFE007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F0 -0007F00007F07007F07007F07007F07007F07007F07007F07003F0E001F8C000FFC0003F001426 -7FA51A>II -IIII E /Fo 5 103 df<0000300000F80001F80003F000 -0FE0001F80007F0000FE0003F80007F0000FC0003F80007E0000FC0000FC00007E00003F80000F -C00007F00003F80000FE00007F00001F80000FE00003F00001F80000F8000030151C7D9E1C>60 -D<600000F80000FC00007E00003F80000FC00007F00003F80000FE00007F00001F80000FE00003 -F00001F80001F80003F0000FE0001F80007F0000FE0003F80007F0000FC0003F80007E0000FC00 -00F80000600000151C7D9E1C>62 D98 D<000FF0000FF0000FF00000F00000F00000F00000F00000F00000F00000F000F8F003 -FEF00FFFF01F07F03E03F03C01F07800F07800F0F000F0F000F0F000F0F000F0F000F0F000F0F0 -00F07800F07801F03C01F03E03F01F07F00FFFFF07FEFF01F8FF18217EA01C>100 -D<0003F8000FFC001FFE003E1E003C0C0078000078000078000078000078007FFFF8FFFFF8FFFF -F80078000078000078000078000078000078000078000078000078000078000078000078000078 -000078000078000078000078003FFFF03FFFF03FFFF017217FA01C>102 -D E /Fp 10 109 df<00000001E00000000000000003F00000000000000003F000000000000000 -07F80000000000000007F80000000000000007F8000000000000000FFC000000000000000FFC00 -0000000000001FFE000000000000001FFE000000000000001FFE000000000000003FFF00000000 -0000003FFF000000000000007FFF800000000000007BFF800000000000007BFF80000000000000 -F3FFC0000000000000F1FFC0000000000001F1FFE0000000000001E0FFE0000000000001E0FFE0 -000000000003C0FFF0000000000003C07FF0000000000007C07FF8000000000007803FF8000000 -000007803FF800000000000F003FFC00000000000F001FFC00000000001F001FFE00000000001E -000FFE00000000001E000FFE00000000003C000FFF00000000003C0007FF00000000007C0007FF -8000000000780003FF8000000000780003FF8000000000F00003FFC000000000F00001FFC00000 -0001FFFFFFFFE000000001FFFFFFFFE000000003FFFFFFFFF000000003FFFFFFFFF000000003C0 -00007FF000000007C000007FF8000000078000003FF80000000F8000003FFC0000000F0000003F -FC0000000F0000001FFC0000001F0000001FFE0000001E0000000FFE0000003E0000000FFF0000 -003C00000007FF0000003C00000007FF0000007C00000007FF800000FC00000003FF8000FFFFF8 -0003FFFFFFC0FFFFF80003FFFFFFC0FFFFF80003FFFFFFC0FFFFF80003FFFFFFC0423B7DBA49> -65 D68 D70 D82 D<3FFFFFFFFFFFFFC03FFFFFFFFFFFFFC03FFFFFFFFFFFFFC03FFFFFFFFFFF -FFC03FF8007FF001FFC07FC0007FF0003FE07F80007FF0001FE07F00007FF0000FE07E00007FF0 -0007E07C00007FF00003E07C00007FF00003E07C00007FF00003E07800007FF00001E07800007F -F00001E07800007FF00001E07800007FF00001E0F000007FF00000F0F000007FF00000F0F00000 -7FF00000F0F000007FF00000F0F000007FF00000F00000007FF00000000000007FF00000000000 -007FF00000000000007FF00000000000007FF00000000000007FF00000000000007FF000000000 -00007FF00000000000007FF00000000000007FF00000000000007FF00000000000007FF0000000 -0000007FF00000000000007FF00000000000007FF00000000000007FF00000000000007FF00000 -000000007FF00000000000007FF00000000000007FF00000000000007FF00000000000007FF000 -00000000007FF00000000000007FF00000000000007FF00000000000007FF00000000000007FF0 -0000000000007FF00000000000007FF00000000000007FF00000000000007FF00000000000007F -F00000000000007FF0000000000FFFFFFFFF8000000FFFFFFFFF8000000FFFFFFFFF8000000FFF -FFFFFF80003C3A7DB943>84 D<00FE00000000FFFE00000000FFFE00000000FFFE00000000FFFE -0000000007FE0000000003FE0000000003FE0000000003FE0000000003FE0000000003FE000000 -0003FE0000000003FE0000000003FE0000000003FE0000000003FE0000000003FE0000000003FE -0000000003FE0000000003FE0000000003FE0000000003FE0000000003FE01FF000003FE1FFFF0 -0003FE7FFFFC0003FEFC03FE0003FFF000FF0003FFC0003F8003FF00001FC003FE00001FE003FE -00000FF003FE00000FF803FE00000FF803FE000007FC03FE000007FC03FE000007FC03FE000007 -FE03FE000007FE03FE000007FE03FE000007FE03FE000007FE03FE000007FE03FE000007FE03FE -000007FE03FE000007FE03FE000007FC03FE000007FC03FE000007FC03FE00000FFC03FE00000F -F803FE00000FF003FE00001FF003FF00001FE003FF80003FC003FFC0007F8003F9E000FF0003F0 -FC07FE0003F07FFFF80003E01FFFE00003C003FE00002F3C7DBB36>98 D<000000003F80000000 -3FFF800000003FFF800000003FFF800000003FFF8000000001FF8000000000FF8000000000FF80 -00000000FF8000000000FF8000000000FF8000000000FF8000000000FF8000000000FF80000000 -00FF8000000000FF8000000000FF8000000000FF8000000000FF8000000000FF8000000000FF80 -00000000FF800000FF80FF80000FFFF0FF80003FFFFCFF8000FFC03FFF8001FE000FFF8003FC00 -03FF8007F80001FF800FF00000FF801FF00000FF803FE00000FF803FE00000FF807FE00000FF80 -7FC00000FF807FC00000FF807FC00000FF80FFC00000FF80FFC00000FF80FFC00000FF80FFC000 -00FF80FFC00000FF80FFC00000FF80FFC00000FF80FFC00000FF80FFC00000FF807FC00000FF80 -7FC00000FF807FC00000FF803FE00000FF803FE00000FF801FE00000FF800FF00001FF8007F000 -03FF8003F80007FF8001FE001FFFC000FF807EFFFE007FFFF8FFFE000FFFE0FFFE0001FF00FFFE -2F3C7DBB36>100 D<00001FF0000000FFF8000003FFFE00000FF87F00001FE0FF00003FC1FF80 -007F81FF8000FF81FF8000FF81FF8001FF00FF0001FF007E0001FF003C0001FF00000001FF0000 -0001FF00000001FF00000001FF00000001FF00000001FF00000001FF00000001FF00000001FF00 -0000FFFFFF8000FFFFFF8000FFFFFF8000FFFFFF800001FF00000001FF00000001FF00000001FF -00000001FF00000001FF00000001FF00000001FF00000001FF00000001FF00000001FF00000001 -FF00000001FF00000001FF00000001FF00000001FF00000001FF00000001FF00000001FF000000 -01FF00000001FF00000001FF00000001FF00000001FF00000001FF00000001FF00000001FF0000 -0001FF00000001FF00000001FF0000007FFFFE00007FFFFE00007FFFFE00007FFFFE0000213C7D -BB1E>102 D<01E00007F80007FC000FFE000FFE001FFE001FFE000FFE000FFE0007FC0007F800 -01E00000000000000000000000000000000000000000000000000000000000000000000000FE00 -FFFE00FFFE00FFFE00FFFE0007FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE00 -03FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE00 -03FE0003FE0003FE0003FE0003FE0003FE0003FE00FFFFF0FFFFF0FFFFF0FFFFF0143D7DBC1A> -105 D<00FE00FFFE00FFFE00FFFE00FFFE0007FE0003FE0003FE0003FE0003FE0003FE0003FE00 -03FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE00 -03FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE00 -03FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE0003FE00 -03FE0003FE0003FE0003FE0003FE00FFFFF8FFFFF8FFFFF8FFFFF8153C7DBB1A>108 -D E /Fq 4 106 df<0001FE00000007FF8000001E01E000007800780000E0001C000180000600 -030000030006000001800C000000C00C000000C018000000603000000030300000003030000000 -30600000001860000000186000000018C00000000CC00000000CC00000000CC00000000CC00000 -000CC00000000CC00000000CC00000000CC00000000C6000000018600000001860000000183000 -0000303000000030300000003018000000600C000000C00C000000C00600000180030000030001 -8000060000E0001C000078007800001E01E0000007FF80000001FE0000262B7DA02D>13 -D<03C00FF01FF83FFC7FFE7FFEFFFFFFFFFFFFFFFFFFFFFFFF7FFE7FFE3FFC1FF80FF003C01012 -7D9317>15 D<004000C00180018001800300030003000600060006000C000C0018001800180030 -0030003000600060006000C000C0006000600060003000300030001800180018000C000C000600 -0600060003000300030001800180018000C000400A2E7CA112>104 DI E /Fr 60 125 df<0003FC0FE0001FFF3FF8007E03FC7801F807F0FC -03F00FF0FC03F00FE0FC07E00FE07807E007E00007E007E00007E007E00007E007E00007E007E0 -0007E007E00007E007E000FFFFFFFF80FFFFFFFF8007E007E00007E007E00007E007E00007E007 -E00007E007E00007E007E00007E007E00007E007E00007E007E00007E007E00007E007E00007E0 -07E00007E007E00007E007E00007E007E00007E007E00007E007E00007E007E00007E007E00007 -E007E0007FFE7FFF007FFE7FFF0026267FA524>11 D<0003FC00003FFE00007E070001F80F8003 -F01F8003E01F8007E01F8007E01F8007E01F8007E0060007E0000007E0000007E0000007E0FFC0 -FFFFFFC0FFFFFFC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00F -C007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E0 -0FC007E00FC007E00FC07FFC7FFC7FFC7FFC1E267FA522>I<0003FFC0003FFFC000FE0FC001F8 -1FC003F01FC003E01FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007 -E00FC0FFFFFFC0FFFFFFC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC0 -07E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00FC007E00F -C007E00FC007E00FC007E00FC07FFEFFFC7FFEFFFC1E267FA522>I<3C7EFFFFFFFF7E3C08087C -8711>46 D<007F800003FFF00007E1F8000F807C001F003E003F003F003E001F007E001F807E00 -1F807E001F807E001F80FE001FC0FE001FC0FE001FC0FE001FC0FE001FC0FE001FC0FE001FC0FE -001FC0FE001FC0FE001FC0FE001FC0FE001FC0FE001FC07E001F807E001F807E001F807E001F80 -3F003F003F003F001F003E000F807C0007E1F80003FFF000007F80001A237EA21F>48 -D<001C00003C0000FC00FFFC00FFFC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC007FFFFC7FFFFC16237CA21F>I<01FF0007 -FFC01E07F03803F86001FC7C00FEFE00FEFE00FFFE007FFE007F7C007F3800FF0000FF0000FE00 -00FE0001FC0001F80003F00007E0000780000F00001E00003C0000700000E00301C00303800707 -00060600060FFFFE1FFFFE3FFFFE7FFFFCFFFFFCFFFFFC18237DA21F>I<01FF0007FFE01E03F0 -3801F83C01FC7E00FE7E00FE7E00FE3E00FE1C01FE0001FC0001FC0003F80007F0000FC001FF00 -01FF000007E00001F00001F80000FC0000FE0000FF0000FF1000FF7C00FFFE00FFFE00FFFE00FE -FE00FE7C01FC7001F83E07F00FFFC001FF0018237DA21F>I<0000380000007800000078000000 -F8000001F8000003F8000007F8000006F800000CF800001CF8000038F8000030F8000060F80000 -E0F80001C0F8000180F8000300F8000700F8000E00F8001C00F8001800F8003000F8007000F800 -E000F800FFFFFFC0FFFFFFC00001F8000001F8000001F8000001F8000001F8000001F8000001F8 -00007FFFC0007FFFC01A237EA21F>I<18000C1F007C1FFFF81FFFF01FFFE01FFFC01FFF801FFE -0018000018000018000018000018000018FF001BFFE01F01F01C00F80800FC00007E00007E0000 -7E00007F00007F78007FFC007FFC007FFC007FFC007EF8007E6000FC7000FC3801F81E07E007FF -C001FE0018237DA21F>I<001FC0007FF001F83803E00C07803E0F807E1F007E3F007E3F007E7E -003C7E00007E00007E0000FE3FC0FE7FF0FE80F8FF80FCFF007CFF007EFE007EFE007FFE007FFE -007FFE007F7E007F7E007F7E007F7E007F3E007E3F007E1F007C0F80F807C1F003FFC0007F0018 -237DA21F>I<300000003C0000003FFFFFC03FFFFFC03FFFFF807FFFFF007FFFFE007FFFFC0060 -00180060001800E0003000C0006000C000C0000001800000018000000300000007000000060000 -000E0000001E0000001E0000001E0000003C0000003C0000007C0000007C0000007C0000007C00 -0000FC000000FC000000FC000000FC000000FC000000FC000000FC000000780000003000001A25 -7DA41F>I<00FF8003FFE00F01F81C007C38003C38001E78001E78001E7C001E7E001E7F803C7F -E03C3FF8781FFCF01FFFC00FFFC003FFE003FFF80FFFFC1E1FFC3C07FE7801FE7800FFF0003FF0 -001FF0000FF0000FF0000FF0000E78000E78001C3E00381F80F007FFE000FF0018237DA21F>I< -00FF0003FFC00F83E01F00F03F00F87E007C7E007C7E007EFE007EFE007EFE007EFE007FFE007F -FE007FFE007F7E007F7E00FF3E00FF3F01FF1F017F0FFE7F03FC7F00007F00007E00007E3C007E -7E00FC7E00FC7E00F87E00F07C01F03003E01C0F800FFF0003F80018237DA21F>I<00001C0000 -0000001C00000000003E00000000003E00000000003E00000000007F00000000007F0000000000 -FF8000000000FF8000000000FF80000000019FC0000000019FC0000000031FE0000000030FE000 -0000030FE00000000607F00000000607F00000000C07F80000000C03F80000001C03FC00000018 -01FC0000001801FC0000003001FE0000003000FE0000007FFFFF0000007FFFFF00000060007F00 -0000C0007F800000C0003F800001C0003FC0000180001FC0000180001FC0000300000FE0000300 -000FE0000780000FF000FFF801FFFF80FFF801FFFF8029257EA42E>65 DI<0000FF8008000FFFF018003F -C03C7800FE0006F801F80003F803F00001F807E00000F80FC00000781FC00000783F800000383F -800000387F800000187F000000187F00000018FF00000000FF00000000FF00000000FF00000000 -FF00000000FF00000000FF00000000FF00000000FF000000007F000000007F000000187F800000 -183F800000183F800000181FC00000300FC000003007E000006003F00000C001F800018000FE00 -0700003FC01E00000FFFF8000000FFC00025257DA42C>IIII72 DI76 DII<0003 -FF8000001FFFF000007F01FC0001FC007F0003F0001F8007E0000FC00FE0000FE01FC00007F01F -800003F03F800003F83F800003F87F800003FC7F000001FC7F000001FCFF000001FEFF000001FE -FF000001FEFF000001FEFF000001FEFF000001FEFF000001FEFF000001FEFF000001FE7F000001 -FC7F000001FC7F800003FC3F800003F83F800003F81FC00007F01FC00007F00FE0000FE007F000 -1FC003F8003F8001FC007F00007F01FC00001FFFF0000003FF800027257DA42E>II82 D<00FF008007FFE3800F80F780 -1E001F803C000F807800078078000380F8000380F8000180F8000180FC000180FC000000FF0000 -007FE000007FFF00003FFFE0003FFFF8001FFFFE0007FFFF0003FFFF80007FFF800003FFC00000 -3FC000000FE0000007E0000007E0C00003E0C00003E0C00003E0C00003C0E00003C0F00007C0F8 -000780FC000F00FFC03E00E3FFF800803FE0001B257DA422>I<7FFFFFFFF87FFFFFFFF87E00FE -01F87800FE00787000FE00386000FE00186000FE0018E000FE001CE000FE000CC000FE000CC000 -FE000CC000FE000CC000FE000C0000FE00000000FE00000000FE00000000FE00000000FE000000 -00FE00000000FE00000000FE00000000FE00000000FE00000000FE00000000FE00000000FE0000 -0000FE00000000FE00000000FE00000000FE00000000FE00000000FE00000000FE00000000FE00 -0000FFFFFE0000FFFFFE0026247EA32B>I86 DI<7FFFC0FFFE007FFFC0FFFE0003FC000F800001FC0007000001FE000E000000FF000C -0000007F80180000007F80380000003FC0700000001FE0600000001FE0C00000000FF1C0000000 -07FB8000000007FB0000000003FE0000000001FE0000000000FE0000000000FF00000000007F80 -000000007FC0000000007FC000000000DFE000000001CFF0000000038FF00000000307F8000000 -0603FC0000000E01FC0000001C01FE0000001800FF00000030007F80000070007F800000E0003F -C00000C0001FE0000180001FE00003C0000FF000FFFC00FFFF80FFFC00FFFF8029257EA42E>I< -07FF00001FFFC0003E03E0003F01F0003F01F8003F00FC001E00FC000000FC000000FC000000FC -00003FFC0003FCFC000FC0FC003F00FC007E00FC007E00FC00FC00FC00FC00FC00FC00FC00FC01 -7C007E017C003F067C001FFC3FE007F01FE01B187E971E>97 DI<007FE003FFF807C07C1F -80FC1F00FC3F00FC7E00787E0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00007E -00007F00003F000C1F800C1FC01807E07003FFE0007F0016187E971B>I<0001FF800001FF8000 -001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F80 -00001F8000001F80007F1F8003FFDF8007E0FF801F803F803F001F803F001F807E001F807E001F -80FE001F80FE001F80FE001F80FE001F80FE001F80FE001F80FE001F80FE001F807E001F807E00 -1F803F001F803F003F801F807F800FC0FF8003FF9FF800FE1FF81D267EA522>I<007F0003FFC0 -07C1F00F80F81F00F83F007C7E007C7E007EFE007EFE007EFFFFFEFFFFFEFE0000FE0000FE0000 -7E00007E00007E00063F00061F000C0F801807E07003FFE0007F8017187E971C>I<000FC0007F -F000F8F001F1F803F1F803E1F807E0F007E00007E00007E00007E00007E00007E00007E000FFFF -00FFFF0007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00007E0 -0007E00007E00007E00007E00007E00007E00007E00007E0007FFF007FFF0015267EA513>I<01 -FF07C007FFDFE00F83F1E01F01F1E03E00F8007E00FC007E00FC007E00FC007E00FC007E00FC00 -7E00FC003E00F8001F01F0000F83E0000FFFC00011FF00003000000030000000380000003C0000 -003FFFE0001FFFFC001FFFFE000FFFFF001FFFFF803C003F8078000FC0F80007C0F80007C0F800 -07C0F80007C07C000F803E001F001F807E0007FFF80000FFC0001B247E971F>II<0F001F -803FC03FC03FC03FC01F800F000000000000000000000000000000FFC0FFC00FC00FC00FC00FC0 -0FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC0FFF8FFF80D277E -A611>I<001E00003F00007F80007F80007F80007F80003F00001E000000000000000000000000 -0000000000000000000001FF8001FF80001F80001F80001F80001F80001F80001F80001F80001F -80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F -80001F80001F80001F80001F80001F80781F80FC1F00FC3F00FC3E00787C003FF8000FE0001132 -83A613>IIIII<007F800003FF -F00007C0F8001F807E003F003F003F003F007E001F807E001F80FE001FC0FE001FC0FE001FC0FE -001FC0FE001FC0FE001FC0FE001FC0FE001FC07E001F807E001F803F003F003F003F001F807E00 -0FC0FC0003FFF000007F80001A187E971F>II114 D<07F9801FFF803C0F80700380F00180F00180F00180FC0000FF80 -007FFC007FFE003FFF800FFFC003FFC0001FE00003E0C001E0C001E0E001E0E001C0F003C0FC07 -80EFFF00C3FC0013187E9718>I<00600000600000600000600000E00000E00001E00001E00003 -E00007E0001FE000FFFFC0FFFFC007E00007E00007E00007E00007E00007E00007E00007E00007 -E00007E00007E00007E00007E06007E06007E06007E06007E06007E06003E0C003F0C001FF8000 -7E0013237FA218>IIII -II<3FFFF83FFFF83E03 -F03807F0300FE0700FC0701F80603F80603F00607E0000FE0000FC0001F80003F81803F01807E0 -180FE0180FC0381F80303F80707F00707E01F0FFFFF0FFFFF015187E971B>III -E end -%%EndProlog -%%BeginSetup -%%Feature: *Resolution 300 -TeXDict begin -%%EndSetup -%%Page: 1 1 -bop 0 2617 a @beginspecial 72 @llx 72 @lly 504 @urx 700 @ury -4320 @rwi @setspecial -%%BeginDocument: ctrcover.ps - -gsave - /inch { 72 mul} def - .9 setgray - /Helvetica-Bold findfont 130 scalefont setfont - gsave - 6.5 inch 7.5 inch moveto - -90 rotate - (cygnus) true charpath fill - grestore - - gsave - 5 inch 7.5 inch moveto - -90 rotate - (reports) true charpath fill - grestore -grestore -%%EndDocument - @endspecial 1696 350 a Fr(CTR)p Fq(\017\017)p Fr({)p Fq(\017\017)0 -563 y Fp(libbfd)p 277 542 1326 9 v 1359 w(DRAFT)0 870 y Fr(The)20 -b(Binary)h(File)f(Descriptor)h(Library)0 978 y(First)f(Edition|)p -Fo(bfd)h Fr(v)n(ersion)h Fo(<)e Fr(2.0)0 1036 y(April)h(1991)0 -1850 y Fn(Stev)n(e)i(Cham)n(b)r(erlain)0 1916 y(Cygn)n(us)f(Supp)r(ort)300 -2659 y Fr(1)e(August)h(1991)p eop -%%Page: 2 2 -bop 1328 233 a Fm(Cygn)o(us)15 b(Supp)q(ort)1288 283 y(stev)o(e@cygn)o -(us.com)1267 333 y Fl(BFD)p Fm(,)f(Revision:)22 b(1.5)849 382 -y(T)874 392 y(E)899 382 y(Xinfo)16 b(2.50,)e(Cygn)o(us)h(TR)30 -b(Revision:)22 b(1.6)300 2085 y(Cop)o(yrigh)o(t)526 2084 y(c)514 -2085 y Fq(\015)15 b Fm(1991)f(F)l(ree)h(Soft)o(w)o(are)f(F)l(oundation,)h -(Inc.)300 2147 y(P)o(ermission)g(is)f(gran)o(ted)f(to)h(mak)o(e)f(and)h -(distribute)h(v)o(erbatim)f(copies)h(of)f(this)300 2197 y(man)o(ual)g(pro)o -(vided)h(the)g(cop)o(yrigh)o(t)f(notice)h(and)f(this)h(p)q(ermission)g -(notice)g(are)300 2247 y(preserv)o(ed)h(on)f(all)h(copies.)300 -2309 y(P)o(ermission)22 b(is)g(gran)o(ted)f(to)g(cop)o(y)g(and)h(distribute)h -(mo)q(di\014ed)g(v)o(ersions)e(of)300 2359 y(this)f(man)o(ual)f(under)h(the)f -(conditions)i(for)d(v)o(erbatim)h(cop)o(ying,)i(sub)s(ject)e(to)300 -2408 y(the)h(terms)f(of)g(the)g(GNU)g(General)h(Public)i(License,)g(whic)o(h) -e(includes)i(the)300 2458 y(pro)o(vision)16 b(that)f(the)g(en)o(tire)h -(resulting)g(deriv)o(ed)g(w)o(ork)f(is)g(distributed)i(under)300 -2508 y(the)e(terms)g(of)g(a)g(p)q(ermission)h(notice)g(iden)o(tical)h(to)e -(this)g(one.)300 2570 y(P)o(ermission)d(is)g(gran)o(ted)f(to)f(cop)o(y)i(and) -f(distribute)i(translations)e(of)g(this)h(man-)300 2620 y(ual)18 -b(in)o(to)f(another)g(language,)h(under)g(the)f(ab)q(o)o(v)o(e)g(conditions)i -(for)e(mo)q(di\014ed)300 2670 y(v)o(ersions.)p eop -%%Page: 1 3 -bop 0 -58 a Fk(Chapter)13 b(1:)k(Intro)q(duction)p 377 -66 -698 3 v 723 w(DRAFT)p 1217 -66 V 723 w Fj(1)0 183 y Fi(1)41 -b(In)n(tro)r(duction)300 299 y Fm(Simply)13 b(put,)e Fh(bfd)g -Fm(is)g(a)g(pac)o(k)m(age)g(whic)o(h)h(allo)o(w)f(applications)i(to)d(use)h -(the)g(same)300 349 y(routines)19 b(to)f(op)q(erate)h(on)g(ob)s(ject)f -(\014les)i(whatev)o(er)e(the)h(ob)s(ject)f(\014le)i(format.)300 -399 y(A)15 b(di\013eren)o(t)g(ob)s(ject)g(\014le)h(format)d(can)j(b)q(e)f -(supp)q(orted)h(simply)g(b)o(y)f(creating)g(a)300 449 y(new)g(BFD)g(bac)o(k)g -(end)h(and)f(adding)h(it)g(to)e(the)i(library)l(.)300 512 y(BFD)f(is)g(split) -i(in)o(to)e(t)o(w)o(o)f(parts;)g(the)h(fron)o(t)f(end)i(and)g(the)f(man)o(y)g -(bac)o(k)g(ends.)337 575 y Fq(\017)30 b Fm(The)15 b(fron)o(t)f(end)i(of)e -(bfd)i(pro)o(vides)f(the)g(in)o(terface)h(to)e(the)h(user.)20 -b(It)15 b(man-)390 625 y(ages)h(memory)l(,)f(and)i(v)m(arious)f(canonical)i -(data)d(structures.)23 b(The)16 b(fron)o(t)390 675 y(end)i(also)e(decides)j -(whic)o(h)f(bac)o(k)e(end)i(to)e(use,)h(and)g(when)h(to)e(call)i(bac)o(k)390 -725 y(end)e(routines.)337 788 y Fq(\017)30 b Fm(The)22 b(bac)o(k)g(ends)h -(pro)o(vide)f(bfd)g(its)h(view)f(of)g(the)g(real)g(w)o(orld.)40 -b(Eac)o(h)390 837 y(bac)o(k)15 b(end)g(pro)o(vides)g(a)g(set)f(of)h(calls)h -(whic)o(h)f(the)g(bfd)g(fron)o(t)f(end)i(can)f(use)390 887 -y(to)j(main)o(tain)i(its)f(canonical)h(form.)30 b(The)19 b(bac)o(k)g(ends)h -(also)e(ma)o(y)h(k)o(eep)390 937 y(around)c(information)h(for)e(their)i(o)o -(wn)e(use,)i(for)e(greater)h(e\016ciency)l(.)0 1099 y Fn(1.1)33 -b(History)300 1191 y Fm(One)12 b(spur)g(b)q(ehind)h Fh(bfd)e -Fm(w)o(as)g(the)g(In)o(tel)i(Oregon's)e(GNU)g(960)f(team)h(desire)i(for)300 -1241 y(in)o(terop)q(erabilit)o(y)g(of)e(applications)i(on)f(their)g(COFF)f -(and)g(b.out)g(\014le)i(formats.)300 1290 y(Cygn)o(us)i(w)o(as)f(pro)o -(viding)i(GNU)e(supp)q(ort)h(for)g(the)g(team,)f(and)h(Cygn)o(us)f(w)o(ere) -300 1340 y(con)o(tracted)h(to)f(pro)o(vid)i(the)f(required)h(functionalit)o -(y)l(.)300 1403 y(The)11 b(name)h(came)f(from)f(a)h(con)o(v)o(ersation)g(Gum) -o(b)o(y)g(W)l(allace)h(w)o(as)e(ha)o(ving)i(with)300 1453 y(Ric)o(hard)i -(Stallman)f(ab)q(out)g(the)g(library)l(,)h(RMS)f(said)g(that)f(it)i(w)o(ould) -f(b)q(e)g(quite)300 1503 y(hard,)i(Gum)o(b)o(y)f(said)i(BFD.)f(\(Stallman)g -(w)o(as)g(righ)o(t,)f(but)h(the)h(name)f(stuc)o(k\).)300 1566 -y(A)o(t)f(the)g(same)g(time,)g(Ready)h(Systems)f(w)o(an)o(ted)g(m)o(uc)o(h)g -(the)g(same)g(thing,)h(but)300 1616 y(for)20 b(di\013eren)o(t)h(ob)s(ject)f -(\014le)i(formats,)e(IEEE-695,)i(Oasys,)f(Srecords,)h(a.out)300 -1666 y(and)15 b(68k)g(co\013.)300 1729 y(BFD)10 b(w)o(as)f(\014rst)h -(implemen)o(ted)i(b)o(y)e(Stev)o(e)g(Cham)o(b)q(erlain)h(\(stev)o(e)p -Fh(@)p Fm(cygn)o(us.com\),)p 1979 1740 21 46 v 300 1779 a(John)g(Gilmore)f -(\(gn)o(u)p Fh(@)p Fm(cygn)o(us.com\),)g(K.)g(Ric)o(hard)h(Pixley)g(\(ric)o -(h)p Fh(@)p Fm(cygn)o(us.com\))p 1979 1790 V 300 1828 a(and)g(Gum)o(b)o(y)f -(W)l(allace)i(\(gum)o(b)o(y)p Fh(@)p Fm(cygn)o(us.com\))c(at)i(Cygn)o(us)h -(Supp)q(ort)g(in)g(P)o(alo)300 1878 y(Alto,)k(California.)0 -2040 y Fn(1.2)33 b(Ho)n(w)21 b(It)h(W)-6 b(orks)300 2132 y -Fm(T)l(o)15 b(use)g(the)h(library)l(,)g(include)h Fh(bfd.h)e -Fm(and)g(link)i(with)e Fh(libbfd.a)p Fm(.)308 2195 y Fh(bfd)h -Fm(pro)o(vides)h(a)f(common)g(in)o(terface)h(to)f(the)h(parts)e(of)h(an)h(ob) -s(ject)f(\014le)h(to)f(a)300 2245 y(calling)h(application.)300 -2308 y(When)g(an)g(application)i(sucessfully)f(op)q(ens)g(a)e(target)g -(\014le)i(\(ob)s(ject,)e(arc)o(hiv)o(e)300 2358 y(or)k(whatev)o(er\))g(a)h(p) -q(oin)o(ter)h(to)e(an)h(in)o(ternal)h(structure)e(is)i(returned.)37 -b(This)300 2408 y(p)q(oin)o(ter)16 b(p)q(oin)o(ts)f(to)g(structure)g(describ) -q(ed)i(in)g Fh(include/bfd.h)p Fm(,)c(called)k Fh(bfd)p Fm(.)300 -2457 y(Con)o(v)o(en)o(tionally)c(this)h(p)q(oin)o(ter)f(is)g(called)i(a)d -Fh(bfd)p Fm(,)h(and)g(instances)g(of)g(it)g(within)300 2507 -y(co)q(de)19 b(are)g(called)42 b Fh(abfd)p Fm(.)31 b(All)20 -b(op)q(erations)f(on)g(the)f(target)g(ob)s(ject)g(\014le)i(are)300 -2557 y(applied)c(as)e(metho)q(ds)h(to)e(the)i Fh(bfd)p Fm(,)e(the)i(mapping)g -(is)f(de\014ned)i(within)g Fh(bfd.h)300 2607 y Fm(in)g(a)f(set)g(of)g -(macros,)f(all)i(b)q(eginning)h Fh(bfd)p 1027 2607 14 2 v 16 -w Fm(something.)300 2670 y(F)l(or)e(example,)g(this)h(sequence)g(w)o(ould)g -(do)f(what)g(y)o(ou)f(exp)q(ect:)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 2 4 -bop 0 -58 a Fk(Chapter)13 b(1:)k(Intro)q(duction)p 377 -66 -698 3 v 723 w(DRAFT)p 1217 -66 V 723 w Fj(2)300 26 y Fg(\013)p -325 26 1326 2 v 1325 w(\010)p 300 473 2 424 v 314 112 a Fh(#include)23 -b("bfd.h")314 212 y(unsigned)g(int)g(number_of_sections\(abfd\))314 -262 y(bfd)h(*abfd;)314 311 y({)362 361 y(return)f -(bfd_count_sections\(abfd\);)314 411 y(})p 1677 473 V 300 499 -a Fg(\012)p 325 499 1326 2 v 1325 w(\011)300 613 y Fm(The)18 -b(metaphor)e(used)i(within)32 b Fh(bfd)17 b Fm(is)h(that)e(an)i(ob)s(ject)e -(\014le)j(has)e(a)g(header,)300 663 y(a)f(n)o(um)o(bb)q(er)h(of)f(sections)h -(con)o(taining)g(ra)o(w)e(data,)h(a)g(set)g(of)g(relo)q(cations)h(and)300 -712 y(some)i(sym)o(b)q(ol)g(information.)32 b(Also,)43 b Fh(bfd)p -Fm(s)19 b(op)q(ened)h(up)q(on)g(arc)o(hiv)o(es)f(ha)o(v)o(e)300 -762 y(the)g(additional)i(attribute)d(of)h(an)g(index)h(and)g(con)o(tained)f -(sub)h(bfds.)31 b(This)300 812 y(approac)o(h)12 b(is)i(\014nd)f(for)f(a.out)g -(and)h(co\013,)f(but)h(lo)q(oses)g(e\016ciency)i(when)e(applied)300 -862 y(to)i(formats)e(suc)o(h)j(as)f(S-records)g(and)h(IEEE-695.)0 -1027 y Fn(1.3)33 b(What)23 b(BFD)f(V)-6 b(ersion)23 b(1)f(Can't)g(Do)300 -1120 y Fm(As)c(di\013eren)o(t)h(information)f(from)g(the)g(the)g(ob)s(ject)g -(\014les)h(is)g(required,)g(BFD)300 1169 y(reads)j(from)g(di\013eren)o(t)g -(sections)h(of)f(the)h(\014le)g(and)g(pro)q(cesses)f(them.)42 -b(F)l(or)300 1219 y(example)13 b(a)f(v)o(ery)g(common)f(op)q(eration)i(for)e -(the)i(link)o(er)g(is)g(pro)q(cessing)g(sym)o(b)q(ol)300 1269 -y(tables.)19 b(Eac)o(h)10 b(BFD)h(bac)o(k)f(end)i(pro)o(vides)f(a)g(routine)g -(for)f(con)o(v)o(erting)h(b)q(et)o(w)o(een)300 1319 y(the)16 -b(ob)s(ject)f(\014le's)h(represen)o(tation)g(of)f(sym)o(b)q(ols)h(and)g(an)f -(in)o(ternal)i(canonical)300 1369 y(format.)k(When)16 b(the)g(link)o(er)h -(asks)e(for)g(the)h(sym)o(b)q(ol)g(table)h(of)e(an)h(ob)s(ject)f(\014le,)300 -1418 y(it)j(calls)h(through)e(the)h(memory)f(p)q(oin)o(ter)h(to)f(the)g -(relev)m(an)o(t)i(BFD)e(bac)o(k)g(end)300 1468 y(routine)k(whic)o(h)g(reads)f -(and)h(con)o(v)o(erts)e(the)h(table)h(in)o(to)f(a)g(canonical)i(form.)300 -1518 y(The)e(link)o(er)i(then)e(op)q(erates)g(up)q(on)h(the)g(common)e(form.) -35 b(When)20 b(the)h(link)300 1568 y(is)c(\014nished)h(and)e(the)h(link)o(er) -g(writes)f(the)h(sym)o(b)q(ol)f(table)h(of)f(the)g(output)g(\014le,)300 -1618 y(another)10 b(BFD)g(bac)o(k)h(end)g(routine)g(is)g(called)i(whic)o(h)e -(tak)o(es)f(the)g(newly)i(created)300 1668 y(sym)o(b)q(ol)k(table)f(and)h -(con)o(v)o(erts)e(it)h(in)o(to)h(the)f(c)o(hosen)g(output)g(format.)0 -1816 y Fr(1.3.1)30 b(Information)19 b(Loss)300 1909 y Ff(Some)f(information)g -(is)h(lost)f(due)g(to)g(the)g(nature)g(of)f(the)i(\014le)g(format.)27 -b Fm(The)300 1958 y(output)15 b(targets)e(supp)q(orted)i(b)o(y)g(BFD)f(do)h -(not)f(pro)o(vide)i(iden)o(tical)g(facilities,)300 2008 y(and)e(information)f -(whic)o(h)h(ma)o(y)f(b)q(e)h(describ)q(ed)i(in)e(one)f(form)g(has)g(no)o -(where)h(to)300 2058 y(go)h(in)h(another)f(format.)k(One)d(example)g(of)f -(this)h(is)g(alignmen)o(t)g(information)300 2108 y(in)62 b -Fh(b.out)p Fm(.)40 b(There)22 b(is)g(no)o(where)g(in)g(an)62 -b Fh(a.out)21 b Fm(format)g(\014le)h(to)g(store)300 2158 y(alignmen)o(t)14 -b(information)f(on)h(the)f(con)o(tained)h(data,)f(so)f(when)i(a)f(\014le)i -(is)e(link)o(ed)300 2208 y(from)h Fh(b.out)f Fm(and)i(an)f -Fh(a.out)f Fm(image)i(is)g(pro)q(duced,)g(alignmen)o(t)g(information)300 -2257 y(will)20 b(not)e(propagate)f(to)h(the)g(output)g(\014le.)31 -b(\(The)18 b(link)o(er)h(will)h(still)g(use)f(the)300 2307 -y(alignmen)o(t)14 b(information)g(in)o(ternally)l(,)i(so)d(the)h(link)h(is)f -(p)q(erformed)g(correctly\).)300 2371 y(Another)j(example)h(is)f(COFF)g -(section)g(names.)25 b(COFF)17 b(\014les)h(ma)o(y)e(con)o(tain)300 -2421 y(an)21 b(unlimited)j(n)o(um)o(b)q(er)e(of)f(sections,)i(eac)o(h)e(one)h -(with)g(a)f(textual)g(section)300 2471 y(name.)e(If)14 b(the)f(target)f(of)h -(the)h(link)h(is)f(a)f(format)f(whic)o(h)i(do)q(es)f(not)g(ha)o(v)o(e)g(man)o -(y)300 2521 y(sections)20 b(\(eg)43 b Fh(a.out)p Fm(\))19 b(or)f(has)h -(sections)h(without)g(names)f(\(eg)g(the)g(Oasys)300 2570 y(format\))f(the)i -(link)h(cannot)f(b)q(e)g(done)g(simply)l(.)36 b(Y)l(ou)20 b(can)f(circum)o(v) -o(en)o(t)i(this)300 2620 y(problem)d(b)o(y)f(describing)i(the)e(desired)h -(input-to-output)g(section)f(mapping)300 2670 y(with)f(the)f(link)o(er)h -(command)f(language.)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 3 5 -bop 0 -58 a Fk(Chapter)13 b(1:)k(Intro)q(duction)p 377 -66 -698 3 v 723 w(DRAFT)p 1217 -66 V 723 w Fj(3)300 183 y Ff(Information)g(can)g -(b)q(e)g(lost)g(during)g(canonicalization.)27 b Fm(The)17 b(BFD)f(in)o -(ternal)300 233 y(canonical)k(form)d(of)h(the)g(external)h(formats)e(is)h -(not)g(exhaustiv)o(e;)i(there)e(are)300 283 y(structures)11 -b(in)h(input)h(formats)c(for)i(whic)o(h)h(there)g(is)g(no)f(direct)h -(represen)o(tation)300 333 y(in)o(ternally)l(.)22 b(This)16 -b(means)g(that)e(the)i(BFD)f(bac)o(k)g(ends)h(cannot)f(main)o(tain)h(all)300 -382 y(p)q(ossible)i(data)e(ric)o(hness)h(through)f(the)h(transformation)e(b)q -(et)o(w)o(een)i(external)300 432 y(to)e(in)o(ternal)h(and)f(bac)o(k)g(to)g -(external)g(formats.)300 495 y(This)i(limitation)g(is)f(only)h(a)f(problem)g -(when)h(using)f(the)g(link)o(er)i(to)d(read)h(one)300 545 y(format)j(and)i -(write)f(another.)35 b(Eac)o(h)20 b(BFD)g(bac)o(k)g(end)h(is)g(resp)q -(onsible)i(for)300 595 y(main)o(taining)16 b(as)f(m)o(uc)o(h)h(data)e(as)h(p) -q(ossible,)i(and)e(the)h(in)o(ternal)g(BFD)f(canon-)300 645 -y(ical)23 b(form)e(has)h(structures)g(whic)o(h)h(are)e(opaque)i(to)e(the)h -(BFD)g(core,)h(and)300 694 y(exp)q(orted)17 b(only)h(to)e(the)h(bac)o(k)g -(ends.)26 b(When)17 b(a)g(\014le)h(is)g(read)f(in)h(one)f(format,)300 -744 y(the)c(canonical)i(form)d(is)i(generated)f(for)g(BFD)f(and)i(the)f(link) -o(er.)20 b(A)o(t)13 b(the)g(same)300 794 y(time,)h(the)g(bac)o(k)g(end)g(sa)o -(v)o(es)f(a)o(w)o(a)o(y)f(an)o(y)i(information)g(whic)o(h)h(ma)o(y)e -(otherwise)300 844 y(b)q(e)g(lost.)19 b(If)13 b(the)g(data)f(is)i(then)f -(written)f(bac)o(k)h(in)h(the)e(same)h(format,)e(the)i(bac)o(k)300 -894 y(end)18 b(routine)h(will)g(b)q(e)g(able)f(to)f(use)i(the)e(canonical)i -(form)f(pro)o(vided)g(b)o(y)g(the)300 943 y(BFD)d(core)g(as)g(w)o(ell)h(as)f -(the)h(information)f(it)h(prepared)g(earlier.)21 b(Since)c(there)300 -993 y(is)d(a)f(great)g(deal)h(of)f(commonalit)o(y)g(b)q(et)o(w)o(een)h(bac)o -(k)f(ends,)h(this)g(mec)o(hanism)g(is)300 1043 y(v)o(ery)f(useful.)20 -b(There)13 b(is)g(no)g(information)g(lost)g(for)f(this)h(reason)g(when)g -(linking)300 1093 y(big)k(endian)h(COFF)e(to)g(little)i(endian)g(COFF,)e(or)g -(from)25 b Fh(a.out)16 b Fm(to)25 b Fh(b.out)p Fm(.)300 1143 -y(When)c(a)f(mixture)h(of)e(formats)g(is)i(link)o(ed,)i(the)e(information)f -(is)h(only)g(lost)300 1193 y(from)14 b(the)i(\014les)g(whose)f(format)f -(di\013ers)h(from)g(the)g(destination.)0 1330 y Fr(1.3.2)30 -b(Mec)n(hanism)300 1422 y Fm(The)17 b(greatest)f(p)q(oten)o(tial)i(for)f -(loss)g(of)g(information)g(is)g(when)h(there)f(is)h(least)300 -1472 y(o)o(v)o(erlap)13 b(b)q(et)o(w)o(een)g(the)g(information)g(pro)o(vided) -h(b)o(y)f(the)g(source)g(format,)f(that)300 1522 y(stored)17 -b(b)o(y)g(the)g(canonical)i(format,)d(and)h(the)h(information)f(needed)i(b)o -(y)e(the)300 1572 y(destination)j(format.)30 b(A)19 b(brief)h(description)g -(of)f(the)g(canonical)h(form)f(ma)o(y)300 1622 y(help)d(y)o(ou)f(appreciate)g -(what)f(kinds)i(of)e(data)g(y)o(ou)h(can)g(coun)o(t)f(on)h(preserving)300 -1671 y(across)f(con)o(v)o(ersions.)300 1734 y Ff(\014les)75 -b Fm(Information)21 b(on)f(target)g(mac)o(hine)i(arc)o(hitecture,)g -(particular)f(im-)450 1784 y(plemen)o(tation)h(and)g(format)f(t)o(yp)q(e)g -(are)h(stored)f(on)g(a)h(p)q(er-\014le)h(ba-)450 1834 y(sis.)28 -b(Other)18 b(information)g(includes)i(a)e(demand)g(pageable)g(bit)h(and)450 -1884 y(a)14 b(write)g(protected)g(bit.)20 b(Note)13 b(that)h(information)g -(lik)o(e)h(Unix)g(magic)450 1934 y(n)o(um)o(b)q(ers)g(is)h(not)e(stored)h -(here|only)h(the)f(magic)g(n)o(um)o(b)q(ers')g(mean-)450 1983 -y(ing,)i(so)f(a)23 b Fh(ZMAGIC)16 b Fm(\014le)h(w)o(ould)g(ha)o(v)o(e)f(b)q -(oth)h(the)f(demand)h(pageable)450 2033 y(bit)f(and)f(the)g(write)h -(protected)f(text)g(bit)g(set.)450 2096 y(The)i(b)o(yte)g(order)g(of)f(the)h -(target)f(is)h(stored)g(on)g(a)f(p)q(er-\014le)j(basis,)e(so)450 -2146 y(that)12 b(big-)h(and)g(little-endian)i(ob)s(ject)d(\014les)h(ma)o(y)f -(b)q(e)h(link)o(ed)h(with)f(one)450 2196 y(another.)300 2258 -y Ff(sections)450 2308 y Fm(Eac)o(h)18 b(section)g(in)g(the)g(input)h(\014le) -g(con)o(tains)f(the)g(name)f(of)h(the)g(sec-)450 2358 y(tion,)c(the)h -(original)g(address)f(in)h(the)g(ob)s(ject)e(\014le,)j(v)m(arious)e(\015ags,) -g(size)450 2408 y(and)f(alignmen)o(t)g(information)g(and)g(p)q(oin)o(ters)g -(in)o(to)g(other)f(BFD)h(data)450 2458 y(structures.)300 2521 -y Ff(sym)o(b)q(ols)450 2570 y Fm(Eac)o(h)h(sym)o(b)q(ol)h(con)o(tains)g(a)f -(p)q(oin)o(ter)h(to)f(the)g(ob)s(ject)g(\014le)i(whic)o(h)f(orig-)450 -2620 y(inally)22 b(de\014ned)g(it,)f(its)f(name,)h(its)g(v)m(alue,)h(and)e(v) -m(arious)h(\015ag)f(bits.)450 2670 y(When)14 b(a)f(BFD)g(bac)o(k)g(end)h -(reads)g(in)g(a)f(sym)o(b)q(ol)h(table,)g(the)f(bac)o(k)g(end)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 4 6 -bop 0 -58 a Fk(Chapter)13 b(1:)k(Intro)q(duction)p 377 -66 -698 3 v 723 w(DRAFT)p 1217 -66 V 723 w Fj(4)450 183 y Fm(relo)q(cates)k(all)g -(sym)o(b)q(ols)f(to)g(mak)o(e)g(them)g(relativ)o(e)h(to)f(the)g(base)g(of)450 -233 y(the)c(section)g(where)h(they)f(w)o(ere)f(de\014ned.)24 -b(This)16 b(ensures)h(that)e(eac)o(h)450 283 y(sym)o(b)q(ol)d(p)q(oin)o(ts)h -(to)e(its)h(con)o(taining)h(section.)19 b(Eac)o(h)12 b(sym)o(b)q(ol)g(also)g -(has)450 333 y(a)j(v)m(arying)h(amoun)o(t)f(of)g(hidden)j(data)d(to)g(con)o -(tain)g(priv)m(ate)i(data)e(for)450 382 y(the)j(BFD)f(bac)o(k)g(end.)28 -b(Since)19 b(the)e(sym)o(b)q(ol)h(p)q(oin)o(ts)g(to)f(the)h(original)450 -432 y(\014le,)i(the)e(priv)m(ate)i(data)d(format)g(for)h(that)g(sym)o(b)q(ol) -h(is)g(accessible.)450 482 y Fh(gld)13 b Fm(can)i(op)q(erate)e(on)h(a)g -(collection)i(of)d(sym)o(b)q(ols)h(of)g(wildly)i(di\013eren)o(t)450 -532 y(formats)e(without)h(problems.)450 590 y(Normal)k(global)h(and)f(simple) -i(lo)q(cal)f(sym)o(b)q(ols)g(are)f(main)o(tained)h(on)450 640 -y(output,)f(so)f(an)h(output)g(\014le)g(\(no)g(matter)e(its)i(format\))e -(will)k(retain)450 690 y(sym)o(b)q(ols)14 b(p)q(oin)o(ting)g(to)f(functions)h -(and)g(to)e(global,)i(static,)f(and)h(com-)450 740 y(mon)e(v)m(ariables.)21 -b(Some)13 b(sym)o(b)q(ol)g(information)f(is)i(not)e(w)o(orth)g(retain-)450 -789 y(ing;)k(in)j Fh(a.out)c Fm(t)o(yp)q(e)h(information)g(is)g(stored)f(in)i -(the)e(sym)o(b)q(ol)i(table)450 839 y(as)e(long)g(sym)o(b)q(ol)h(names.)k -(This)c(information)g(w)o(ould)f(b)q(e)h(useless)h(to)450 889 -y(most)12 b(COFF)h(debuggers)h(and)f(ma)o(y)g(b)q(e)h(thro)o(wn)f(a)o(w)o(a)o -(y)e(with)j(appro-)450 939 y(priate)f(command)f(line)i(switc)o(hes.)20 -b(\(The)12 b(GNU)h(debugger)g Fh(gdb)f Fm(do)q(es)450 989 y(supp)q(ort)j -Fh(a.out)g Fm(st)o(yle)g(debugging)h(information)g(in)g(COFF\).)450 -1047 y(There)21 b(is)h(one)f(w)o(ord)g(of)g(t)o(yp)q(e)g(information)g -(within)i(the)e(sym)o(b)q(ol,)450 1097 y(so)h(if)h(the)g(format)e(supp)q -(orts)i(sym)o(b)q(ol)g(t)o(yp)q(e)g(information)g(within)450 -1146 y(sym)o(b)q(ols)18 b(\(for)e(example)i(COFF,)e(IEEE,)h(Oasys\))g(and)h -(the)f(t)o(yp)q(e)g(is)450 1196 y(simple)g(enough)f(to)f(\014t)g(within)i -(one)f(w)o(ord)f(\(nearly)h(ev)o(erything)g(but)450 1246 y(aggregates\))d -(the)j(information)f(will)i(b)q(e)f(preserv)o(ed.)300 1304 -y Ff(relo)q(cation)g(lev)o(el)450 1354 y Fm(Eac)o(h)h(canonical)h(BFD)e(relo) -q(cation)h(record)g(con)o(tains)g(a)f(p)q(oin)o(ter)i(to)450 -1404 y(the)f(sym)o(b)q(ol)g(to)f(relo)q(cate)h(to,)f(the)g(o\013set)g(of)g -(the)h(data)f(to)g(relo)q(cate,)450 1454 y(the)h(section)g(the)f(data)g(is)h -(in)g(and)g(a)f(p)q(oin)o(ter)h(to)f(a)g(relo)q(cation)h(t)o(yp)q(e)450 -1503 y(descriptor.)37 b(Relo)q(cation)22 b(is)g(p)q(erformed)f(e\013ectiv)o -(ely)h(b)o(y)e(message)450 1553 y(passing)h(through)f(the)g(relo)q(cation)h -(t)o(yp)q(e)f(descriptor)h(and)g(sym)o(b)q(ol)450 1603 y(p)q(oin)o(ter.)44 -b(It)24 b(allo)o(ws)f(relo)q(cations)h(to)f(b)q(e)h(p)q(erformed)f(on)g -(output)450 1653 y(data)17 b(using)i(a)e(relo)q(cation)h(metho)q(d)g(only)h -(a)o(v)m(ailable)g(in)g(one)f(of)f(the)450 1703 y(input)j(formats.)30 -b(F)l(or)19 b(instance,)h(Oasys)f(pro)o(vides)h(a)e(b)o(yte)h(relo)q(ca-)450 -1753 y(tion)h(format.)31 b(A)20 b(relo)q(cation)g(record)f(requesting)h(this) -g(relo)q(cation)450 1802 y(t)o(yp)q(e)e(w)o(ould)f(p)q(oin)o(t)h(indirectly)i -(to)d(a)g(routine)h(to)f(p)q(erform)g(this,)h(so)450 1852 y(the)e(relo)q -(cation)h(ma)o(y)e(b)q(e)i(p)q(erformed)f(on)g(a)g(b)o(yte)g(b)q(eing)h -(written)g(to)450 1902 y(a)e(COFF)h(\014le,)g(ev)o(en)h(though)e(68k)g(COFF)h -(has)f(no)h(suc)o(h)g(relo)q(cation)450 1952 y(t)o(yp)q(e.)300 -2010 y Ff(line)h(n)o(um)o(b)q(ers)450 2060 y Fm(Ob)s(ject)k(formats)e(can)i -(con)o(tain,)g(for)f(debugging)i(purp)q(oses,)g(some)450 2110 -y(form)14 b(of)h(mapping)g(b)q(et)o(w)o(een)g(sym)o(b)q(ols,)g(source)g(line) -i(n)o(um)o(b)q(ers,)e(and)450 2159 y(addresses)f(in)g(the)g(output)g(\014le.) -20 b(These)14 b(addresses)g(ha)o(v)o(e)f(to)g(b)q(e)h(relo-)450 -2209 y(cated)h(along)g(with)h(the)f(sym)o(b)q(ol)g(information.)20 -b(Eac)o(h)15 b(sym)o(b)q(ol)h(with)450 2259 y(an)j(asso)q(ciated)g(list)g(of) -f(line)j(n)o(um)o(b)q(er)e(records)f(p)q(oin)o(ts)h(to)g(the)f(\014rst)450 -2309 y(record)13 b(of)g(the)g(list.)20 b(The)14 b(head)g(of)e(a)h(line)i(n)o -(um)o(b)q(er)f(list)g(consists)f(of)g(a)450 2359 y(p)q(oin)o(ter)h(to)e(the)i -(sym)o(b)q(ol,)f(whic)o(h)h(allo)o(ws)g(divination)h(of)e(the)g(address)450 -2408 y(of)19 b(the)g(function)g(whose)g(line)i(n)o(um)o(b)q(er)e(is)g(b)q -(eing)i(describ)q(ed.)33 b(The)450 2458 y(rest)18 b(of)h(the)g(list)g(is)g -(made)g(up)g(of)g(pairs:)27 b(o\013sets)18 b(in)o(to)h(the)f(section)450 -2508 y(and)f(line)h(n)o(um)o(b)q(ers.)23 b(An)o(y)17 b(format)e(whic)o(h)i -(can)g(simply)g(deriv)o(e)h(this)450 2558 y(information)13 -b(can)g(pass)g(it)g(successfully)i(b)q(et)o(w)o(een)e(formats)e(\(COFF,)450 -2608 y(IEEE)k(and)h(Oasys\).)300 2670 y(What)f(is)g(a)g(bac)o(k)o(end)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 5 7 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -680 3 v 703 w(DRAFT)p 1236 -66 V 705 w Fj(5)0 183 y Fi(2)41 -b(BFD)27 b(fron)n(t)f(end)0 396 y Fn(2.1)33 b(t)n(yp)r(edef)22 -b(bfd)300 488 y Fm(P)o(oin)o(ters)16 b(to)g(bfd)h(structs)f(are)g(the)h -(cornerstone)f(of)h(an)o(y)f(application)i(using)300 538 y(libbfd.)33 -b(References)20 b(though)e(the)h(bfd)h(and)f(to)f(data)g(in)i(the)f(bfd)g -(giv)o(e)g(the)300 588 y(en)o(tire)d(bfd)f(functionalit)o(y)l(.)300 -651 y(Finally!)22 b(The)15 b(BFD)g(struct)g(itself.)21 b(This)16 -b(con)o(tains)f(the)h(ma)s(jor)d(data)i(ab)q(out)300 701 y(the)g(\014le,)h -(and)g(con)o(tains)f(p)q(oin)o(ters)g(to)g(the)g(rest)g(of)g(the)g(data.)390 -751 y Fh(struct)23 b(_bfd)390 801 y({)300 864 y Ff(The)15 b(\014lename)i(the) -e(application)i(op)q(ened)f(the)f(bfd)h(with.)438 914 y Fh(CONST)23 -b(char)g(*filename;)300 977 y Ff(A)15 b(p)q(oin)o(ter)h(to)e(the)i(target)e -(jump)h(table.)438 1027 y Fh(struct)23 b(bfd_target)f(*xvec;)300 -1090 y Ff(T)l(o)14 b(a)o(v)o(oid)g(dragging)g(to)q(o)g(man)o(y)g(header)h -(\014les)g(in)o(to)f(ev)o(ery)h(\014le)g(that)g(includes)300 -1140 y(bfd.h,)f(IOSTREAM)h(has)e(b)q(een)i(declared)g(as)f(a)f -Fh(")p Ff(c)o(har)g(*)p Fh(")p Ff(,)h(and)f(MTIME)j(as)300 -1190 y(a)e Fh(")p Ff(long)p Fh(")p Ff(.)19 b(Their)c(correct)e(t)o(yp)q(es,)h -(to)f(whic)o(h)i(they)f(are)g(cast)f(when)i(used,)f(are)300 -1240 y Fh(")p Ff(FILE)h(*)p Fh(")g Ff(and)h Fh(")p Ff(time)p -710 1240 14 2 v 16 w(t)p Fh(")p Ff(.)300 1303 y(The)f(iostream)g(is)h(the)f -(result)h(of)f(an)g(fop)q(en)g(on)h(the)f(\014lename.)438 1353 -y Fh(char)23 b(*iostream;)300 1416 y Ff(Is)15 b(the)h(\014le)g(b)q(eing)g -(cac)o(hed)g(See)g(Chapter)f(3)g([File)h(Cac)o(hing],)e(page)i(45.)438 -1466 y Fh(boolean)23 b(cacheable;)300 1529 y Ff(Marks)12 b(whether)h(there)g -(w)o(as)g(a)f(default)i(target)e(sp)q(eci\014ed)j(when)e(the)g(bfd)h(w)o(as) -300 1579 y(op)q(ened.)33 b(This)19 b(is)h(used)g(to)e(select)i(what)e(matc)o -(hing)i(algorithm)f(to)f(use)i(to)300 1629 y(c)o(hose)e(the)d(bac)o(k)g(end.) -438 1679 y Fh(boolean)23 b(target_defaulted;)300 1742 y Ff(The)15 -b(cac)o(hing)h(routines)g(use)f(these)h(to)e(main)o(tain)i(an)f(LR)o(U)h -(list)g(of)f(bfds.)438 1792 y Fh(struct)23 b(_bfd)g(*lru_prev,)g(*lru_next;) -300 1855 y Ff(When)e(a)f(\014le)i(is)f(closed)g(b)o(y)g(the)f(cac)o(hing)i -(routines,)g(it)e(retains)h(the)g(state)300 1905 y(here:)438 -1955 y Fh(file_ptr)h(where;)300 2018 y Ff(and)15 b(here:)438 -2068 y Fh(boolean)23 b(opened_once;)438 2118 y(boolean)g(mtime_set;)300 -2181 y Ff(File)16 b(mo)q(di\014ed)h(time)438 2231 y Fh(long)23 -b(mtime;)300 2294 y Ff(F)l(or)15 b(output)g(\014les,)g(c)o(hannel)i(w)o(e)e -(lo)q(c)o(k)o(ed)h(\(is)f(this)h(used?\).)390 2344 y Fh(int)23 -b(ifd;)300 2407 y Ff(The)15 b(format)f(whic)o(h)i(b)q(elongs)g(to)f(the)g -(bfd.)438 2457 y Fh(bfd_format)22 b(format;)300 2521 y Ff(The)15 -b(direction)i(the)e(bfd)h(w)o(as)e(op)q(ened)i(with)438 2570 -y Fh(enum)23 b(bfd_direction)f({no_direction)g(=)i(0,)939 2620 -y(read_direction)e(=)i(1,)939 2670 y(write_direction)e(=)h(2,)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 6 8 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -680 3 v 703 w(DRAFT)p 1236 -66 V 705 w Fj(6)939 183 y Fh(both_direction)22 -b(=)i(3})f(direction;)300 246 y Ff(F)l(ormat)p 449 246 14 2 -v 15 w(sp)q(eci\014c)17 b(\015ags)438 296 y Fh(flagword)22 -b(flags;)300 359 y Ff(Curren)o(tly)d(m)o(y)p 575 359 V 16 w(arc)o(hiv)o(e)f -(is)i(tested)e(b)q(efore)h(adding)g(origin)g(to)f(an)o(ything.)31 -b(I)300 409 y(b)q(eliev)o(e)16 b(that)e(this)g(can)h(b)q(ecome)f(alw)o(a)o -(ys)g(an)g(add)g(of)g(origin,)h(with)f(origin)h(set)300 458 -y(to)g(0)f(for)h(non)g(arc)o(hiv)o(e)h(\014les.)438 508 y Fh(file_ptr)22 -b(origin;)300 571 y Ff(Remem)o(b)q(er)11 b(when)g(output)f(has)g(b)q(egun,)i -(to)e(stop)f(strange)h(things)h(happ)q(ening.)438 621 y Fh(boolean)23 -b(output_has_begun;)300 684 y Ff(P)o(oin)o(ter)15 b(to)f(link)o(ed)j(list)f -(of)f(sections)438 734 y Fh(struct)23 b(sec)47 b(*sections;)300 -797 y Ff(The)15 b(n)o(um)o(b)q(er)h(of)f(sections)438 846 y -Fh(unsigned)22 b(int)i(section_count;)300 909 y Ff(Stu\013)15 -b(only)h(usefull)h(for)d(ob)s(ject)h(\014les:)21 b(The)16 b(start)e(address.) -438 959 y Fh(bfd_vma)23 b(start_address;)300 1022 y Ff(Used)16 -b(for)e(input)i(and)g(output)438 1072 y Fh(unsigned)22 b(int)i(symcount;)300 -1135 y Ff(Sym)o(tab)15 b(for)f(output)h(bfd)438 1184 y Fh(struct)23 -b(symbol_cache_entry)45 b(**outsymbols;)300 1247 y Ff(Arc)o(hitecture)16 -b(of)f(ob)s(ject)f(mac)o(hine,)i(eg)f(m68k)438 1297 y Fh(enum)23 -b(bfd_architecture)f(obj_arch;)300 1360 y Ff(P)o(articular)15 -b(mac)o(hine)h(within)h(arc)o(h,)d(e.g.)20 b(68010)438 1410 -y Fh(unsigned)i(long)i(obj_machine;)300 1473 y Ff(Stu\013)15 -b(only)h(usefull)h(for)d(arc)o(hiv)o(es:)438 1523 y Fh(PTR)23 -b(arelt_data;)438 1572 y(struct)g(_bfd)g(*my_archive;)438 1622 -y(struct)g(_bfd)g(*next;)438 1672 y(struct)g(_bfd)g(*archive_head;)438 -1722 y(boolean)g(has_armap;)300 1785 y Ff(Used)16 b(b)o(y)f(the)g(bac)o(k)g -(end)h(to)f(hold)h(priv)m(ate)f(data.)438 1834 y Fh(PTR)23 -b(tdata;)300 1897 y Ff(Used)16 b(b)o(y)f(the)g(application)i(to)d(hold)i -(priv)m(ate)g(data)438 1947 y Fh(PTR)23 b(usrdata;)300 2010 -y Ff(Where)15 b(all)h(the)g(allo)q(cated)g(stu\013)e(under)i(this)g(BFD)f(go) -q(es)438 2060 y Fh(struct)23 b(obstack)g(memory;)390 2110 y(};)0 -2248 y Fr(2.1.0.1)30 b(bfd)p 296 2248 19 3 v 22 w(set)p 394 -2248 V 22 w(start)p 543 2248 V 22 w(address)300 2340 y Fm(Marks)15 -b(the)i(en)o(try)e(p)q(oin)o(t)i(of)f(an)g(output)g(bfd.)23 -b(Returns)g Fh(true)15 b Fm(on)h(success,)300 2390 y Fh(false)e -Fm(otherwise.)390 2440 y Fh(PROTO\(boolean,)22 b(bfd_set_start_address,\(bfd) -e(*,)k(bfd_vma\)\);)p 2002 2446 21 38 v 0 2578 a Fr(2.1.0.2)30 -b(bfd)p 296 2578 19 3 v 22 w(get)p 401 2578 V 21 w(m)n(time)300 -2670 y Fm(Return)25 b(cac)o(hed)f(\014le)i(mo)q(di\014cation)f(time)f(\(e.g.) -46 b(as)24 b(read)g(from)g(arc)o(hiv)o(e)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s) -36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 7 9 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -680 3 v 703 w(DRAFT)p 1236 -66 V 705 w Fj(7)300 183 y Fm(header)23 -b(for)f(arc)o(hiv)o(e)g(mem)o(b)q(ers,)i(or)e(from)g(\014le)h(system)f(if)h -(w)o(e)f(ha)o(v)o(e)g(b)q(een)300 233 y(called)17 b(b)q(efore\);)e(else)h -(determine)g(mo)q(dify)g(time,)f(cac)o(he)g(it,)g(and)h(return)f(it.)390 -283 y Fh(PROTO\(long,)22 b(bfd_get_mtime,)g(\(bfd)i(*\)\);)0 -416 y Fr(2.1.0.3)30 b(stu\013)300 475 y Fg(\013)p 325 475 1326 -2 v 1325 w(\010)p 300 2068 2 1570 v 314 611 a Fh(#define)23 -b(bfd_sizeof_headers\(abfd,)e(reloc\))i(\\)433 661 y(BFD_SEND)g(\(abfd,)g -(_bfd_sizeof_headers,)e(\(abfd,)i(reloc\)\))314 760 y(#define)g -(bfd_find_nearest_line\(abfd)o(,)e(section,)i(symbols,)g(off-)314 -810 y(set,)g(filename_ptr,)g(func,)g(line_ptr\))f(\\)433 860 -y(BFD_SEND)h(\(abfd,)g(_bfd_find_nearest_line,)45 b(\(abfd,)23 -b(sec-)314 910 y(tion,)g(symbols,)g(offset,)g(filename_ptr,)f(func,)h -(line_ptr\)\))314 1009 y(#define)g(bfd_debug_info_start\(abfd\))d(\\)505 -1059 y(BFD_SEND)j(\(abfd,)g(_bfd_debug_info_start,)e(\(abfd\)\))314 -1159 y(#define)i(bfd_debug_info_end\(abfd\))e(\\)505 1209 y(BFD_SEND)i -(\(abfd,)g(_bfd_debug_info_end,)e(\(abfd\)\))314 1308 y(#define)i -(bfd_debug_info_accumulate\()o(abfd,)e(section\))h(\\)505 1358 -y(BFD_SEND)h(\(abfd,)g(_bfd_debug_info_accumulat)o(e,)e(\(abfd,)314 -1408 y(section\)\))314 1507 y(#define)i(bfd_stat_arch_elt\(abfd,)e(stat\))i -(\\)505 1557 y(BFD_SEND)g(\(abfd,)g(_bfd_stat_arch_elt,\(abfd,)d(stat\)\))314 -1657 y(#define)j(bfd_coff_swap_aux_in\(a,e,t)o(,c,i\))e(\\)505 -1707 y(BFD_SEND)i(\(a,)g(_bfd_coff_swap_aux_in,)e(\(a,e,t,c,i\)\))314 -1806 y(#define)i(bfd_coff_swap_sym_in\(a,e,i)o(\))e(\\)505 -1856 y(BFD_SEND)i(\(a,)g(_bfd_coff_swap_sym_in,)e(\(a,e,i\)\))314 -1956 y(#define)i(bfd_coff_swap_lineno_in\(a,)o(e,i\))e(\\)505 -2006 y(BFD_SEND)i(\()h(a,)f(_bfd_coff_swap_lineno_in,)e(\(a,e,i\)\))p -1677 2068 V 300 2094 a Fg(\012)p 325 2094 1326 2 v 1325 w(\011)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 8 10 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -680 3 v 703 w(DRAFT)p 1236 -66 V 705 w Fj(8)0 183 y Fn(2.2)33 -b(Memory)22 b(Usage)300 277 y Fm(BFD)17 b(k)o(eeps)h(all)h(its)f(in)o(ternal) -g(structures)g(in)g(obstac)o(ks.)27 b(There)18 b(is)g(one)g(ob-)300 -327 y(stac)o(k)c(p)q(er)g(op)q(en)i(bfd)e(\014le,)i(in)o(to)e(whic)o(h)h(the) -g(curren)o(t)f(state)g(is)g(stored.)20 b(When)300 376 y(a)c(bfd)h(is)h -(closed,)f(the)g(obstac)o(k)f(is)h(deleted,)h(and)f(so)f(ev)o(erything)i -(whic)o(h)f(has)300 426 y(b)q(een)f(allo)q(cated)h(b)o(y)e(libbfd)i(for)d -(the)i(closing)g(\014le)g(will)h(b)q(e)f(thro)o(wn)e(a)o(w)o(a)o(y)l(.)300 -491 y(BFD)j(will)h(not)f(free)g(an)o(ything)g(created)h(b)o(y)f(an)g -(application,)h(but)g(p)q(oin)o(ters)300 540 y(in)o(to)d(bfd)g(structures)g -(will)h(b)q(e)g(in)o(v)m(alidated)h(on)d(a)h Fh(bfd_close)p -Fm(;)e(for)h(example,)300 590 y(after)h(a)k Fh(bfd_close)c -Fm(the)g(v)o(ector)g(passed)h(to)j Fh(bfd_canonicalize_symtab)300 -640 y Fm(will)h(still)g(b)q(e)f(around,)f(since)i(it)e(has)g(b)q(een)i(allo)q -(cated)f(b)o(y)f(the)h(application,)300 690 y(but)c(the)h(data)e(that)h(it)g -(p)q(oin)o(ted)h(to)f(will)i(b)q(e)f(lost.)300 754 y(The)g(general)g(rule)g -(is)g(not)f(to)g(close)i(a)e(bfd)h(un)o(til)g(all)h(op)q(erations)e(dep)q -(enden)o(t)300 804 y(up)q(on)j(data)g(from)f(the)g(bfd)i(ha)o(v)o(e)e(b)q -(een)i(completed,)g(or)e(all)i(the)f(data)f(from)300 854 y(within)k(the)f -(\014le)h(has)e(b)q(een)i(copied.)35 b(T)l(o)19 b(help)i(with)g(the)e -(managemen)o(t)g(of)300 904 y(memory)l(,)g(there)g(is)h(a)e(function)i(\()i -Fh(bfd_alloc_size)p Fm(\))16 b(whic)o(h)k(returns)f(the)300 -953 y(n)o(um)o(b)q(er)e(of)f(b)o(ytes)g(in)h(obstac)o(ks)f(asso)q(ciated)g -(with)h(the)g(supplied)h(bfd.)24 b(This)300 1003 y(could)15 -b(b)q(e)f(used)g(to)g(select)g(the)g(greediest)g(op)q(en)h(bfd,)f(close)g(it) -g(to)f(reclaim)i(the)300 1053 y(memory)l(,)f(p)q(erform)g(some)h(op)q -(eration)g(and)g(reop)q(en)g(the)g(bfd)g(again,)f(to)g(get)g(a)300 -1103 y(fresh)h(cop)o(y)g(of)g(the)g(data)g(structures.)0 1276 -y Fn(2.3)33 b(Sections)300 1370 y Fm(Sections)16 b(are)f(supp)q(orted)h(in)g -(bfd)f(in)h Fh(section.c)p Fm(.)300 1434 y(The)f(ra)o(w)f(data)g(con)o -(tained)h(within)h(a)f(bfd)g(is)g(main)o(tained)h(through)f(the)g(sec-)300 -1484 y(tion)f(abstraction.)19 b(A)13 b(single)i(bfd)f(ma)o(y)f(ha)o(v)o(e)g -(an)o(y)h(n)o(um)o(b)q(er)g(of)f(sections,)h(and)300 1534 y(k)o(eeps)k(hold)h -(of)e(them)h(b)o(y)g(p)q(oin)o(ting)h(to)e(the)h(\014rst,)g(eac)o(h)g(one)g -(p)q(oin)o(ts)h(to)e(the)300 1584 y(next)e(in)h(the)g(list.)0 -1736 y Fr(2.3.1)30 b(Section)20 b(Input)300 1829 y Fm(When)15 -b(a)f(bfd)h(is)g(op)q(ened)g(for)f(reading,)h(the)g(section)g(structures)f -(are)g(created)300 1879 y(and)h(attatc)o(hed)g(to)f(the)i(bfd.)300 -1943 y(Eac)o(h)h(section)g(has)g(a)f(name)h(whic)o(h)h(describ)q(es)g(the)f -(section)h(in)f(the)g(outside)300 1993 y(w)o(orld)i(-)g(for)f(example,)44 -b Fh(a.out)18 b Fm(w)o(ould)h(con)o(tain)g(at)g(least)g(three)g(sections,)300 -2043 y(called)e Fh(.text)p Fm(,)d Fh(.data)g Fm(and)i Fh(.bss)p -Fm(.)300 2107 y(Sometimes)e(a)g(bfd)g(will)i(con)o(tain)e(more)f(than)h(the)g -('natural')f(n)o(um)o(b)q(er)h(of)g(sec-)300 2157 y(tions.)20 -b(A)13 b(bac)o(k)h(end)h(ma)o(y)e(attatc)o(h)f(other)i(sections)g(con)o -(taining)h(constructor)300 2207 y(data,)h(or)g(an)g(application)i(ma)o(y)e -(add)h(a)f(section)h(\(using)g(bfd)p 1362 2207 14 2 v 17 w(mak)o(e)p -1483 2207 V 16 w(section\))300 2257 y(to)f(the)h(sections)g(attatc)o(hed)f -(to)h(an)f(already)h(op)q(en)h(bfd.)25 b(F)l(or)16 b(example,)i(the)300 -2307 y(link)o(er)d(creates)f(a)g(sup)q(ern)o(umary)g(section)g -Fh(COMMON)g Fm(for)f(eac)o(h)h(input)h(\014le's)g(bfd)300 2357 -y(to)g(hold)h(information)f(ab)q(out)g(common)g(storage.)300 -2421 y(The)22 b(ra)o(w)f(data)h(is)g(not)g(necessarily)h(read)f(in)h(at)e -(the)h(same)g(time)g(as)g(the)300 2471 y(section)f(descriptor)f(is)h -(created.)35 b(Some)20 b(targets)f(ma)o(y)g(lea)o(v)o(e)h(the)h(data)e(in)300 -2521 y(place)e(un)o(til)g(a)i Fh(bfd_get_section_contents)13 -b Fm(call)k(is)f(made.)22 b(Other)16 b(bac)o(k)300 2570 y(ends)f(ma)o(y)e -(read)h(in)h(all)h(the)e(data)f(at)h(once)g(-)h(F)l(or)e(example;)i(an)f -(S-record)h(\014le)300 2620 y(has)g(to)f(b)q(e)i(read)e(once)i(to)e -(determine)i(the)f(size)h(of)e(the)h(data.)k(An)c(IEEE-695)300 -2670 y(\014le)22 b(do)q(esn't)f(con)o(tain)h(ra)o(w)e(data)g(in)i(sections,)h -(but)e(data)g(and)g(relo)q(cation)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 9 11 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -680 3 v 703 w(DRAFT)p 1236 -66 V 705 w Fj(9)300 183 y Fm(expressions)j(in)o -(termixed,)g(so)e(the)h(data)f(area)h(has)g(to)f(b)q(e)h(parsed)h(to)e(get)g -(out)300 233 y(the)h(data)g(and)g(relo)q(cations.)0 368 y Fr(2.3.2)30 -b(Section)20 b(Output)300 459 y Fm(T)l(o)i(write)g(a)f(new)h(ob)s(ject)g(st)o -(yle)g(bfd,)h(the)f(v)m(arious)h(sections)f(to)f(b)q(e)i(writ-)300 -509 y(ten)j(ha)o(v)o(e)f(to)g(b)q(e)h(created.)52 b(They)26 -b(are)f(attatc)o(hed)g(to)g(the)g(bfd)h(in)h(the)300 559 y(same)19 -b(w)o(a)o(y)g(as)g(input)i(sections,)f(data)f(is)h(written)g(to)f(the)h -(sections)g(using)300 608 y Fh(bfd_set_section_contents)p Fm(.)300 -671 y(The)d(link)o(er)h(uses)g(the)f(\014elds)29 b Fh(output_section)15 -b Fm(and)27 b Fh(output_offset)16 b Fm(to)300 721 y(create)f(an)g(output)g -(\014le.)300 783 y(The)i(data)g(to)g(b)q(e)g(written)h(comes)f(from)f(input)i -(sections)g(attatc)o(hed)e(to)h(the)300 833 y(output)h(sections.)30 -b(The)18 b(output)g(section)h(structure)f(can)h(b)q(e)g(considered)g(a)300 -883 y(\014lter)14 b(for)f(the)h(input)h(section,)f(the)g(output)f(section)i -(determines)f(the)g(vma)f(of)300 933 y(the)h(output)h(data)e(and)i(the)f -(name,)g(but)h(the)f(input)i(section)f(determines)g(the)300 -982 y(o\013set)f(in)o(to)h(the)h(output)f(section)g(of)g(the)g(data)g(to)g(b) -q(e)g(written.)300 1045 y(Eg)e(to)f(create)h(a)f(section)i -Fh(")p Fm(O)p Fh(")p Fm(,)f(starting)f(at)g(0x100,)g(0x123)g(long,)h(con)o -(taining)300 1095 y(t)o(w)o(o)19 b(subsections,)j Fh(")p Fm(A)p -Fh(")e Fm(at)g(o\013set)g(0x0)f(\(ie)i(at)f(vma)g(0x100\))f(and)h -Fh(")p Fm(B)p Fh(")h Fm(at)300 1144 y(o\013set)14 b(0x20)h(\(ie)g(at)g(vma)f -(0x120\))g(the)h(structures)g(w)o(ould)h(lo)q(ok)f(lik)o(e:)300 -1186 y Fg(\013)p 325 1186 1326 2 v 1325 w(\010)p 300 1832 2 -623 v 386 1322 a Fh(section)23 b(name)238 b("A")433 1372 y(output_offset)70 -b(0x00)433 1422 y(size)286 b(0x20)433 1471 y(output_section)22 -b(----------->)46 b(section)23 b(name)95 b("O")1006 1521 y(|)g(vma)310 -b(0x100)386 1571 y(section)23 b(name)238 b("B")23 b(|)95 b(size)286 -b(0x123)433 1621 y(output_offset)70 b(0x20)95 b(|)433 1671 -y(size)286 b(0x103)71 b(|)433 1720 y(output_section)46 b(--------|)p -1677 1832 V 300 1858 a Fg(\012)p 325 1858 1326 2 v 1325 w(\011)0 -2042 y Fr(2.3.3)30 b(t)n(yp)r(edef)20 b(asection)300 2134 y -Fm(The)15 b(shap)q(e)h(of)f(a)g(section)h(struct:)390 2184 -y Fh(typedef)23 b(struct)g(sec)g({)300 2246 y Ff(The)c(name)f(of)g(the)g -(section,)h(the)g(name)f(isn't)g(a)g(cop)o(y)l(,)h(the)f(p)q(oin)o(ter)h(is)i -(the)300 2296 y(same)15 b(as)g(that)f(passed)i(to)e(bfd)p 835 -2296 14 2 v 17 w(mak)o(e)p 956 2296 V 16 w(section.)485 2346 -y Fh(CONST)24 b(char)f(*name;)300 2408 y Ff(The)15 b(next)h(section)f(in)i -(the)e(list)h(b)q(elonging)h(to)d(the)h(bfd,)h(or)e(NULL.)485 -2458 y Fh(struct)23 b(sec)h(*next;)300 2521 y Ff(The)14 b(\014eld)h(\015ags)f -(con)o(tains)g(attributes)f(of)h(the)g(section.)19 b(Some)14 -b(of)g(these)i(\015ags)300 2570 y(are)d(read)h(in)g(from)f(the)h(ob)s(ject)f -(\014le,)h(and)g(some)f(are)h(syn)o(thesized)g(from)f(other)300 -2620 y(information.)390 2670 y Fh(flagword)23 b(flags;)0 2770 -y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 10 12 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(10)390 183 y Fh(#define)23 -b(SEC_NO_FLAGS)70 b(0x000)300 246 y Ff(T)l(ells)22 b(the)e(OS)h(to)e(allo)q -(cate)i(space)f(for)g(this)g(section)h(when)g(loaded.)35 b(This)300 -296 y(w)o(ould)16 b(clear)f(for)g(a)g(section)h(con)o(taining)f(debug)h -(information)g(only)l(.)390 346 y Fh(#define)23 b(SEC_ALLOC)142 -b(0x001)300 409 y Ff(T)l(ells)21 b(the)f(OS)g(to)f(load)h(the)f(section)h -(from)f(the)h(\014le)g(when)g(loading.)34 b(This)300 458 y(w)o(ould)16 -b(b)q(e)f(clear)h(for)f(a)g(.bss)f(section)390 508 y Fh(#define)23 -b(SEC_LOAD)166 b(0x002)300 571 y Ff(The)15 b(section)f(con)o(tains)h(data)f -(still)h(to)f(b)q(e)h(relo)q(cated,)g(so)f(there)g(will)i(b)q(e)f(some)300 -621 y(relo)q(cation)h(information)f(to)q(o.)390 671 y Fh(#define)23 -b(SEC_RELOC)142 b(0x004)300 733 y Ff(Obsolete)16 b(?)390 783 -y Fh(#define)23 b(SEC_BALIGN)118 b(0x008)300 846 y Ff(A)15 -b(signal)h(to)f(the)g(OS)h(that)e(the)i(section)f(con)o(tains)h(read)f(only)h -(data.)390 896 y Fh(#define)23 b(SEC_READONLY)70 b(0x010)300 -959 y Ff(The)15 b(section)h(con)o(tains)f(co)q(de)h(only)l(.)390 -1009 y Fh(#define)23 b(SEC_CODE)166 b(0x020)300 1071 y Ff(The)15 -b(section)h(con)o(tains)f(data)g(only)l(.)390 1121 y Fh(#define)23 -b(SEC_DATA)190 b(0x040)300 1184 y Ff(The)15 b(section)h(will)h(reside)f(in)g -(R)o(OM.)390 1234 y Fh(#define)23 b(SEC_ROM)190 b(0x080)300 -1297 y Ff(The)19 b(section)g(con)o(tains)g(constructor)e(information.)31 -b(This)19 b(section)g(t)o(yp)q(e)f(is)300 1347 y(used)13 b(b)o(y)g(the)f -(link)o(er)i(to)e(create)g(lists)h(of)f(constructors)g(and)h(destructors)g -(used)300 1396 y(b)o(y)34 b Fh(g++)p Ff(.)27 b(When)18 b(a)g(bac)o(k)g(end)g -(sees)g(a)g(sym)o(b)q(ol)g(whic)o(h)h(should)f(b)q(e)h(used)h(in)300 -1446 y(a)15 b(constructor)f(list,)i(it)g(creates)f(a)g(new)g(section)h(for)f -(the)g(t)o(yp)q(e)g(of)g(name)j(\(eg)300 1496 y Fh(__CTOR_LIST__)p -Ff(\),)12 b(attatc)o(hes)i(the)g(sym)o(b)q(ol)h(to)f(it)h(and)g(builds)h(a)f -(relo)q(cation.)300 1546 y(T)l(o)g(build)i(the)e(lists)g(of)g(constructors,)f -(all)i(the)f(link)o(er)h(has)f(to)h(to)f(is)g(catenate)300 -1596 y(all)e(the)g(sections)g(called)g Fh(__CTOR_LIST__)e Ff(and)j(relo)q -(cte)f(the)g(data)e(con)o(tained)300 1645 y(within)16 b(-)g(exactly)f(the)h -(op)q(erations)f(it)g(w)o(ould)j(p)q(eform)d(on)g(standard)g(data.)390 -1695 y Fh(#define)23 b(SEC_CONSTRUCTOR)f(0x100)300 1758 y Ff(The)17 -b(section)g(is)f(a)g(constuctor,)g(and)h(should)g(b)q(e)g(placed)h(at)d(the)i -(end)g(of)f(the)300 1808 y(..)390 1858 y Fh(#define)23 b -(SEC_CONSTRUCTOR_TEXT)e(0x1100)390 1907 y(#define)i(SEC_CONSTRUCTOR_DATA)e -(0x2100)390 1957 y(#define)i(SEC_CONSTRUCTOR_BSS)45 b(0x3100)300 -2020 y Ff(The)21 b(section)g(has)f(con)o(ten)o(ts)g(-)g(a)g(bss)h(section)g -(could)g(b)q(e)55 b Fh(SEC_ALLOC)19 b(|)300 2070 y(SEC_HAS_CONTENTS)p -Ff(,)13 b(a)h(debug)i(section)g(could)g(b)q(e)j Fh(SEC_HAS_CONTENTS)390 -2120 y(#define)k(SEC_HAS_CONTENTS)f(0x200)300 2183 y Ff(An)d(instruction)g -(to)f(the)g(link)o(er)i(not)e(to)f(output)i(sections)f(con)o(taining)24 -b(this)300 2232 y(\015ag)14 b(ev)o(en)h(if)g(they)g(ha)o(v)o(e)f(information) -h(whic)o(h)g(w)o(ould)g(normally)g(b)q(e)g(written.)390 2282 -y Fh(#define)23 b(SEC_NEVER_LOAD)f(0x400)300 2345 y Ff(The)15 -b(base)h(address)f(of)g(the)g(section)h(in)g(the)f(address)g(space)h(of)f -(the)g(target.)462 2395 y Fh(bfd_vma)22 b(vma;)300 2458 y Ff(The)16 -b(size)g(of)g(the)f(section)i(in)f(b)o(ytes)f(of)h(the)f(loaded)i(section.)22 -b(This)16 b(con)o(tains)300 2508 y(a)f(v)m(alue)h(ev)o(en)g(if)g(the)f -(section)h(has)f(no)g(con)o(ten)o(ts)f(\(eg,)h(the)g(size)h(of)f -Fh(.bss)p Ff(\).)462 2557 y Fh(bfd_size_type)22 b(size;)300 -2620 y Ff(If)14 b(this)h(section)g(is)f(going)g(to)g(b)q(e)h(output,)e(then)i -(this)f(v)m(alue)i(is)e(the)j(o\013set)c(in)o(to)300 2670 y(the)k(output)g -(section)g(of)g(the)g(\014rst)f(b)o(yte)h(in)h(the)f(input)i(section.)25 -b(Eg,)17 b(if)h(this)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 11 13 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(11)300 183 y Ff(w)o(as)g(going)g -(to)g(start)f(at)h(the)g(100th)g(b)o(yte)g(in)i(the)h(output)d(section,)h -(this)g(v)m(alue)300 233 y(w)o(ould)i(b)q(e)f(100.)462 283 -y Fh(bfd_vma)22 b(output_offset;)300 350 y Ff(The)15 b(output)g(section)h -(through)f(whic)o(h)h(to)f(map)g(on)g(output.)462 400 y Fh(struct)23 -b(sec)g(*output_section;)300 467 y Ff(The)f(alignmen)o(t)g(requiremen)o(t)g -(of)g(the)f(section,)j(as)d(an)h(exp)q(onen)o(t)g(-)g(eg)f(3)300 -517 y(aligns)16 b(to)f(2)p Fh(^)p Ff(3)f(\(or)g(8\))462 567 -y Fh(unsigned)22 b(int)i(alignment_power;)300 634 y Ff(If)14 -b(an)f(input)h(section,)g(a)f(p)q(oin)o(ter)h(to)e(a)h(v)o(ector)g(of)g(relo) -q(cation)h(records)f(for)j(the)300 684 y(data)f(in)h(this)f(section.)462 -733 y Fh(struct)23 b(reloc_cache_entry)e(*relocation;)300 801 -y Ff(If)c(an)g(output)g(section,)h(a)f(p)q(oin)o(ter)h(to)e(a)h(v)o(ector)f -(of)h(p)q(oin)o(ters)g(to)i(relo)q(cation)300 850 y(records)c(for)g(the)g -(data)f(in)i(this)g(section.)462 900 y Fh(struct)23 b(reloc_cache_entry)e -(**orelocation;)300 967 y Ff(The)15 b(n)o(um)o(b)q(er)h(of)f(relo)q(cation)h -(records)f(in)h(one)f(of)g(the)g(ab)q(o)o(v)o(e)462 1017 y -Fh(unsigned)22 b(reloc_count;)300 1084 y Ff(Whic)o(h)16 b(section)g(is)f(it)h -(0..n)o(th)462 1134 y Fh(int)23 b(index;)300 1201 y Ff(Information)15 -b(b)q(elo)o(w)h(is)g(bac)o(k)f(end)h(sp)q(eci\014c)i(-)d(and)h(not)f(alw)o(a) -o(ys)f(used)i(or)i(up-)300 1251 y(dated)300 1318 y(File)e(p)q(osition)h(of)d -(section)i(data)462 1368 y Fh(file_ptr)22 b(filepos;)300 1435 -y Ff(File)16 b(p)q(osition)h(of)d(relo)q(cation)i(info)462 -1485 y Fh(file_ptr)22 b(rel_filepos;)300 1552 y Ff(File)16 -b(p)q(osition)h(of)d(line)j(data)462 1602 y Fh(file_ptr)22 -b(line_filepos;)300 1669 y Ff(P)o(oin)o(ter)15 b(to)f(data)h(for)g -(applications)462 1719 y Fh(PTR)23 b(userdata;)462 1769 y(struct)g -(lang_output_section)e(*otheruserdata;)300 1836 y Ff(A)o(ttac)o(hed)15 -b(line)i(n)o(um)o(b)q(er)e(information)462 1886 y Fh(alent)23 -b(*lineno;)300 1953 y Ff(Num)o(b)q(er)16 b(of)e(line)j(n)o(um)o(b)q(er)f -(records)462 2003 y Fh(unsigned)22 b(int)i(lineno_count;)300 -2070 y Ff(When)14 b(a)e(section)i(is)g(b)q(eing)h(output,)e(this)g(v)m(alue)i -(c)o(hanges)e(as)g(more)i(linen)o(um-)300 2120 y(b)q(ers)h(are)e(written)i -(out)462 2170 y Fh(file_ptr)22 b(moving_line_filepos;)300 2237 -y Ff(what)15 b(the)g(section)h(n)o(um)o(b)q(er)f(is)h(in)g(the)f(target)f(w)o -(orld)462 2287 y Fh(unsigned)22 b(int)i(target_index;)462 2336 -y(PTR)f(used_by_bfd;)300 2404 y Ff(If)18 b(this)g(is)g(a)g(constructor)e -(section)j(then)f(here)g(is)g(a)f(list)i(of)e(the)j(relo)q(cations)300 -2453 y(created)15 b(to)g(relo)q(cate)g(items)h(within)g(it.)462 -2503 y Fh(struct)23 b(relent_chain)f(*constructor_chain;)300 -2570 y Ff(The)15 b(bfd)h(whic)o(h)g(o)o(wns)f(the)g(section.)462 -2620 y Fh(bfd)23 b(*owner;)390 2670 y(})h(asection)e(;)0 2770 -y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 12 14 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(12)0 183 y Fr(2.3.4)30 -b(section)20 b(protot)n(yp)r(es)0 346 y(2.3.4.1)30 b(bfd)p -296 346 19 3 v 22 w(get)p 401 346 V 21 w(section)p 607 346 -V 22 w(b)n(y)p 693 346 V 23 w(name)300 437 y Fm(Runs)19 b(through)g(the)f -(pro)o(vided)i Ff(abfd)g Fm(and)f(returns)f(the)39 b Fh(asection)18 -b Fm(who's)300 487 y(name)c(matc)o(hes)g(that)g(pro)o(vided,)h(otherwise)g -(NULL.)g(See)g(Section)g(2.3)f([Sec-)300 537 y(tions],)h(page)g(8,)f(for)h -(more)g(information.)390 587 y Fh(PROTO\(asection)22 b(*,)i -(bfd_get_section_by_name)o(,)485 637 y(\(bfd)g(*abfd,)f(CONST)g(char)g -(*name\)\);)0 770 y Fr(2.3.4.2)30 b(bfd)p 296 770 V 22 w(mak)n(e)p -457 770 V 22 w(section)300 862 y Fm(This)13 b(function)g(creates)f(a)h(new)f -(empt)o(y)g(section)h(called)i Ff(name)g Fm(and)d(attatc)o(hes)300 -912 y(it)i(to)g(the)g(end)h(of)f(the)g(c)o(hain)h(of)f(sections)h(for)e -Ff(bfd)p Fm(.)20 b(An)15 b(attempt)e(to)g(create)h(a)300 961 -y(section)i(with)h(a)e(name)h(whic)o(h)g(is)h(already)f(in)h(use,)e(returns)h -(the)g(old)g(section)300 1011 y(b)o(y)f(that)g(name)g(instead.)300 -1074 y(P)o(ossible)h(errors)f(are:)300 1136 y Fh(invalid_operation)450 -1186 y Fm(If)g(output)g(has)h(already)f(started)f(for)h(this)h(bfd.)300 -1248 y Fh(no_memory)450 1298 y Fm(If)f(obstac)o(k)g(allo)q(c)h(fails.)390 -1348 y Fh(PROTO\(asection)22 b(*,)i(bfd_make_section,)d(\(bfd)i(*,)h(CONST)f -(char)390 1398 y(*name\)\);)0 1531 y Fr(2.3.4.3)30 b(bfd)p -296 1531 V 22 w(set)p 394 1531 V 22 w(section)p 601 1531 V -22 w(\015ags)300 1623 y Fm(A)o(ttempts)15 b(to)h(set)f(the)h(attributes)g(of) -g(the)g(section)h(named)f(in)h(the)f(bfd)g(sup-)300 1673 y(plied)i(to)e(the)g -(v)m(alue.)25 b(Returns)16 b(true)h(on)f(success,)h(false)f(on)h(error.)22 -b(P)o(ossible)300 1722 y(error)14 b(returns)i(are:)300 1785 -y Fh(invalid)e(operation)450 1835 y Fm(The)21 b(section)g(cannot)g(ha)o(v)o -(e)f(one)h(or)f(more)g(of)h(the)f(attributes)h(re-)450 1884 -y(quested.)h(F)l(or)15 b(example,)h(a)g(.bss)f(section)h(in)k -Fh(a.out)15 b Fm(ma)o(y)g(not)g(ha)o(v)o(e)450 1934 y(the)g -Fh(SEC_HAS_CONTENTS)e Fm(\014eld)k(set.)390 1984 y Fh(PROTO\(boolean,)22 -b(bfd_set_section_flags,)557 2034 y(\(bfd)h(*,)h(asection)f(*,)g -(flagword\)\);)0 2168 y Fr(2.3.4.4)30 b(bfd)p 296 2168 V 22 -w(map)p 433 2168 V 22 w(o)n(v)n(er)p 567 2168 V 23 w(sections)300 -2259 y Fm(Calls)20 b(the)g(pro)o(vided)h(function)f Ff(func)j -Fm(for)c(eac)o(h)h(section)g(attatc)o(hed)f(to)g(the)300 2309 -y(bfd)14 b Ff(abfd)p Fm(,)g(passing)h Ff(ob)s(j)f Fm(as)g(an)g(argumen)o(t.) -19 b(The)14 b(function)h(will)g(b)q(e)g(called)g(as)300 2359 -y(if)h(b)o(y)438 2408 y Fh(func\(abfd,)22 b(the_section,)g(obj\);)390 -2458 y(PROTO\(void,)g(bfd_map_over_sections,)676 2508 y(\(bfd)i(*abfd,)f -(void)g(\(*func\)\(\),)g(PTR)g(obj\)\);)300 2570 y Fm(This)13 -b(is)g(the)f(prefered)h(metho)q(d)g(for)e(iterating)i(o)o(v)o(er)e(sections,) -i(an)g(alternativ)o(e)300 2620 y(w)o(ould)j(b)q(e)f(to)g(use)h(a)e(lo)q(op:) -462 2670 y Fh(section)22 b(*p;)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 13 15 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(13)462 183 y Fh(for)23 -b(\(p)h(=)f(abfd->sections;)f(p)i(!=)f(NULL;)h(p)f(=)h(p->next\))533 -233 y(func\(abfd,)f(p,)g(...\))0 366 y Fr(2.3.4.5)30 b(bfd)p -296 366 19 3 v 22 w(set)p 394 366 V 22 w(section)p 601 366 -V 22 w(size)300 457 y Fm(Sets)20 b Ff(section)g Fm(to)g(the)g(size)h -Ff(v)m(al)p Fm(.)34 b(If)21 b(the)f(op)q(eration)g(is)g(ok,)h(then)48 -b Fh(true)19 b Fm(is)300 507 y(returned,)c(else)h Fh(false)p -Fm(.)300 569 y(P)o(ossible)g(error)f(returns:)300 632 y Fh(invalid_operation) -450 681 y Fm(W)l(riting)h(has)f(started)f(to)h(the)g(bfd,)g(so)g(setting)g -(the)h(size)g(is)f(in)o(v)m(alid)390 731 y Fh(PROTO\(boolean,)22 -b(bfd_set_section_size,)509 781 y(\(bfd)i(*,)f(asection)g(*,)h(bfd_size_type) -e(val\)\);)0 914 y Fr(2.3.4.6)30 b(bfd)p 296 914 V 22 w(set)p -394 914 V 22 w(section)p 601 914 V 22 w(con)n(ten)n(ts)300 -1005 y Fm(Sets)14 b(the)f(con)o(ten)o(ts)g(of)g(the)h(section)g -Ff(section)h Fm(in)f(bfd)g Ff(abfd)h Fm(to)e(the)h(data)f(start-)300 -1055 y(ing)19 b(in)h(memory)e(at)g Ff(data)p Fm(.)29 b(The)19 -b(data)f(is)h(written)f(to)g(the)h(output)f(section)300 1105 -y(starting)d(at)f(o\013set)g Ff(o\013set)i Fm(for)e Ff(coun)o(t)i -Fm(b)o(ytes.)300 1167 y(Normally)g Fh(true)e Fm(is)i(returned,)f(else)h -Fh(false)p Fm(.)j(P)o(ossible)e(error)d(returns)h(are:)300 -1229 y Fh(no_contents)450 1279 y Fm(The)20 b(output)f(section)h(do)q(es)g -(not)g(ha)o(v)o(e)f(the)46 b Fh(SEC_HAS_CONTENTS)450 1329 y -Fm(attribute,)15 b(so)f(nothing)i(can)f(b)q(e)h(written)g(to)e(it.)300 -1391 y Fh(and)h(some)f(more)h(too)300 1454 y Fm(This)c(routine)f(is)h(fron)o -(t)e(end)i(to)f(the)g(bac)o(k)g(end)h(function)g Fh(_bfd_set_section_conten)o -(ts)p Fm(.)p 2166 1458 21 36 v 390 1503 a Fh(PROTO\(boolean,)22 -b(bfd_set_section_contents,)605 1553 y(\(bfd)h(*abfd,)605 1603 -y(asection)g(*section,)605 1653 y(PTR)g(data,)605 1703 y(file_ptr)g(offset,) -605 1753 y(bfd_size_type)f(count\)\);)0 1885 y Fr(2.3.4.7)30 -b(bfd)p 296 1885 19 3 v 22 w(get)p 401 1885 V 21 w(section)p -607 1885 V 22 w(con)n(ten)n(ts)300 1977 y Fm(This)13 b(function)h(reads)f -(data)f(from)g Ff(section)h Fm(in)g(bfd)h Ff(abfd)g Fm(in)o(to)f(memory)f -(start-)300 2027 y(ing)j(at)f Ff(lo)q(cation)p Fm(.)21 b(The)15 -b(data)f(is)h(read)f(at)g(an)h(o\013set)f(of)g Ff(o\013set)h -Fm(from)e(the)i(start)300 2076 y(of)g(the)g(input)h(section,)g(and)f(is)h -(read)f(for)f Ff(coun)o(t)i Fm(b)o(ytes.)300 2139 y(If)e(the)g(con)o(ten)o -(ts)f(of)h(a)g(constuctor)f(with)h(the)g Fh(SEC_CONSTUCTOR)e -Fm(\015ag)i(set)f(are)300 2188 y(requested,)i(then)h(the)f -Ff(lo)q(cation)h Fm(is)g(\014lled)h(with)e(zero)q(es.)300 2251 -y(If)g(no)h(errors)e(o)q(ccur,)h Fh(true)g Fm(is)h(returned,)f(else)h -Fh(false)p Fm(.)j(P)o(ossible)d(errors)f(are:)300 2313 y Fh(unknown)f(yet)390 -2363 y(PROTO\(boolean,)22 b(bfd_get_section_contents,)581 2413 -y(\(bfd)h(*abfd,)g(asection)g(*section,)g(PTR)g(location,)605 -2463 y(file_ptr)g(offset,)f(bfd_size_type)h(count\)\);)0 2770 -y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 14 16 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(14)0 183 y Fn(2.4)33 -b(Sym)n(b)r(ols)300 352 y Fm(*bfd*)17 b(trys)f(to)g(main)o(tain)i(as)e(m)o -(uc)o(h)h(sym)o(b)q(ol)h(information)f(as)f(it)h(can)g(when)300 -401 y(it)i(mo)o(v)o(es)g(information)g(from)f(\014le)i(to)f(\014le.)32 -b(*bfd*)19 b(passes)g(information)h(to)300 451 y(applications)f(though)f(the) -34 b Fh(asymbol)17 b Fm(structure.)27 b(When)18 b(the)g(application)300 -501 y(requests)g(the)g(sym)o(b)q(ol)g(table,)h(BFD)e(reads)h(the)g(table)h -(in)g(the)f(nativ)o(e)g(form)300 551 y(and)13 b(translates)g(parts)g(of)g(it) -g(in)o(to)g(the)h(in)o(ternal)g(format.)k(T)l(o)13 b(main)o(tain)g(more)300 -601 y(than)k(the)g(infomation)g(passed)h(to)e(applications)j(some)d(targets)g -(k)o(eep)h(some)300 650 y(information)j('b)q(ehind)h(the)e(sceans',)h(in)g(a) -g(structure)f(only)h(the)f(particular)300 700 y(bac)o(k)h(end)g(kno)o(ws)g -(ab)q(out.)33 b(F)l(or)20 b(example,)h(the)f(co\013)f(bac)o(k)h(end)h(k)o -(eeps)f(the)300 750 y(original)j(sym)o(b)q(ol)f(table)h(structure)e(as)h(w)o -(ell)h(as)e(the)h(canonical)h(structure)300 800 y(when)c(a)g(*bfd*)f(is)h -(read)g(in.)31 b(On)20 b(output,)f(the)g(co\013)f(bac)o(k)g(end)i(can)f -(recon-)300 850 y(struct)e(the)g(output)h(sym)o(b)q(ol)f(table)h(so)f(that)g -(no)h(information)f(is)h(lost,)g(ev)o(en)300 899 y(information)d(unique)h(to) -d(co\013)h(whic)o(h)h(*bfd*)g(do)q(esn't)f(kno)o(w)g(or)g(understand.)300 -949 y(If)19 b(a)g(co\013)f(sym)o(b)q(ol)h(table)h(w)o(as)e(read,)h(but)g(w)o -(as)g(written)g(through)f(an)h(a.out)300 999 y(bac)o(k)g(end,)i(all)f(the)f -(co\013)g(sp)q(eci\014c)i(information)e(w)o(ould)h(b)q(e)g(lost.)32 -b(\(..)f(un)o(til)300 1049 y(BFD)15 b(2)g(:\).)300 1188 y(The)e(sym)o(b)q(ol) -g(table)g(of)f(a)g(bfd)h(is)g(not)g(necessarily)h(read)e(in)i(un)o(til)f(a)g -(canonical-)300 1238 y(ize)k(request)f(is)g(made.)22 b(Then)17 -b(the)f(bfd)g(bac)o(k)g(end)g(\014lls)h(in)g(a)f(table)g(pro)o(vided)300 -1288 y(b)o(y)f(the)g(application)i(with)f(p)q(oin)o(ters)f(to)g(the)g -(canonical)i(information.)300 1427 y(T)l(o)j(output)g(sym)o(b)q(ols,)h(the)g -(application)h(pro)o(vides)e(BFD)g(with)h(a)f(table)g(of)300 -1477 y(p)q(oin)o(ters)j(to)e(p)q(oin)o(ters)i(to)63 b Fh(asymbol)p -Fm(s.)40 b(This)23 b(allo)o(ws)f(applications)i(lik)o(e)300 -1527 y(the)16 b(link)o(er)i(to)d(output)h(a)g(sym)o(b)q(ol)h(as)f(read,)g -(since)h(the)f('b)q(ehind)i(the)f(sceens')300 1576 y(information)e(will)i(b)q -(e)f(still)h(a)o(v)m(ailable.)0 2402 y Fr(2.4.1)30 b(Reading)20 -b(Sym)n(b)r(ols)300 2570 y Fm(There)13 b(are)f(t)o(w)o(o)f(stages)g(to)h -(reading)h(a)f(sym)o(b)q(ol)h(table)g(from)e(a)i(bfd;)g(allo)q(cating)300 -2620 y(storage,)i(and)h(the)g(actual)g(reading)h(pro)q(cess.)22 -b(This)17 b(is)f(an)g(excerpt)h(from)e(an)300 2670 y(appliction)i(whic)o(h)f -(reads)f(the)h(sym)o(b)q(ol)f(table:)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 15 17 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(15)300 26 y Fg(\013)p -325 26 1326 2 v 1325 w(\010)p 300 1021 2 972 v 362 112 a Fh(unsigned)23 -b(int)g(storage_needed;)362 162 y(asymbol)g(**symbol_table;)362 -212 y(unsigned)g(int)g(number_of_symbols;)362 262 y(unsigned)g(int)g(i;)362 -361 y(storage_needed)f(=)i(get_symtab_upper_bound)c(\(abfd\);)362 -461 y(if)j(\(storage_needed)f(==)i(0\))f({)433 511 y(return)g(;)362 -560 y(})362 610 y(symbol_table)f(=)i(\(asymbol)f(**\))g(malloc)g -(\(storage_needed\);)410 660 y(...)362 710 y(number_of_symbols)e(=)433 -760 y(bfd_canonicalize_symtab)g(\(abfd,)i(symbol_table\);)362 -859 y(for)g(\(i)h(=)g(0;)f(i)h(<)g(number_of_symbols;)d(i++\))i({)433 -909 y(process_symbol)f(\(symbol_table[i]\);)362 959 y(})p 1677 -1021 V 300 1047 a Fg(\012)p 325 1047 1326 2 v 1325 w(\011)300 -1228 y Fm(All)16 b(storage)d(for)g(the)i(sym)o(b)q(ols)g(themselv)o(es)f(is)h -(in)g(an)g(obstac)o(k)e(connected)j(to)300 1278 y(the)f(bfd,)g(and)h(is)g -(freed)f(when)h(the)f(bfd)h(is)f(closed.)0 2030 y Fr(2.4.2)30 -b(W)-5 b(riting)20 b(Sym)n(b)r(ols)300 2190 y Fm(W)l(riting)13 -b(of)f(a)f(sym)o(b)q(ol)i(table)g(is)f(automatic)g(when)h(a)f(bfd)g(op)q(en)h -(for)f(writing)g(is)300 2240 y(closed.)21 b(The)16 b(application)h(attatc)o -(hes)d(a)h(v)o(ector)g(of)g(p)q(oin)o(ters)h(to)f(p)q(oin)o(ters)h(to)300 -2290 y(sym)o(b)q(ols)e(to)g(the)g(bfd)h(b)q(eing)g(written,)f(and)h(\014lls)g -(in)h(the)e(sym)o(b)q(ol)g(coun)o(t.)20 b(The)300 2340 y(close)11 -b(and)f(clean)o(up)i(co)q(de)e(reads)g(through)g(the)g(table)h(pro)o(vided)g -(and)f(p)q(erforms)300 2389 y(all)21 b(the)g(necessary)f(op)q(erations.)35 -b(The)21 b(outputing)f(co)q(de)h(m)o(ust)f(alw)o(a)o(ys)f(b)q(e)300 -2439 y(pro)o(vided)c(with)g(an)g('o)o(wned')e(sym)o(b)q(ol;)i(one)g(whic)o(h) -g(has)f(come)h(from)e(another)300 2489 y(bfd,)i(or)g(one)g(whic)o(h)h(has)f -(b)q(een)i(created)e(using)h Fh(bfd_make_empty_symbol)p Fm(.)300 -2620 y(An)j(example)h(sho)o(wing)f(the)g(creation)g(of)g(a)f(sym)o(b)q(ol)i -(table)f(with)g(only)h(one)300 2670 y(elemen)o(t:)0 2770 y -Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 16 18 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(16)300 26 y Fg(\013)p -325 26 1326 2 v 1325 w(\010)p 300 1469 2 1420 v 314 112 a Fh(#include)23 -b("bfd.h")314 162 y(main\(\))314 212 y({)362 262 y(bfd)g(*abfd;)362 -311 y(asymbol)g(*ptrs[2];)362 361 y(asymbol)g(*new;)362 461 -y(abfd)g(=)h(bfd_openw\("foo","a.out-su)o(nos-big")o(\);)362 -511 y(bfd_set_format\(abfd,)d(bfd_object\);)362 560 y(new)i(=)h -(bfd_make_empty_symbol\(abfd)o(\);)362 610 y(new->name)e(=)i("dummy_symbol";) -362 660 y(new->section)e(=)i(\(asection)e(*\)0;)362 710 y(new->flags)g(=)i -(BSF_ABSOLUTE)e(|)i(BSF_GLOBAL;)362 760 y(new->value)e(=)i(0x12345;)362 -859 y(ptrs[0])f(=)g(new;)362 909 y(ptrs[1])g(=)g(\(asymbol)g(*\)0;)362 -1009 y(bfd_set_symtab\(abfd,)e(ptrs,)i(1\);)362 1059 y(bfd_close\(abfd\);)314 -1108 y(})314 1208 y(./makesym)314 1258 y(nm)h(foo)314 1308 -y(00012345)f(A)h(dummy_symbol)p 1677 1469 V 300 1495 a Fg(\012)p -325 1495 1326 2 v 1325 w(\011)300 1607 y Fm(Man)o(y)14 b(formats)g(cannot)h -(represen)o(t)g(arbitary)f(sym)o(b)q(ol)i(information;)f(for)f(in-)300 -1657 y(stance)e(the)h Fh(a.out)f Fm(ob)s(ject)g(format)f(do)q(es)i(not)f -(allo)o(w)h(an)f(arbitary)h(n)o(um)o(b)q(er)f(of)300 1707 y(sections.)20 -b(A)15 b(sym)o(b)q(ol)g(p)q(oin)o(ting)h(to)e(a)h(section)g(whic)o(h)g(is)h -(not)e(one)h(of)f Fh(.text)p Fm(,)300 1757 y Fh(.data)g Fm(or)h -Fh(.bss)g Fm(cannot)g(b)q(e)h(describ)q(ed.)0 1881 y Fr(2.4.3)30 -b(t)n(yp)r(edef)20 b(asym)n(b)r(ol)300 1973 y Fm(An)15 b Fh(asymbol)g -Fm(has)g(the)g(form:)390 2022 y Fh(typedef)23 b(struct)g(symbol_cache_entry) -390 2072 y({)300 2135 y Ff(A)d(p)q(oin)o(ter)g(to)e(the)i(bfd)g(whic)o(h)g(o) -o(wns)f(the)h(sym)o(b)q(ol.)33 b(This)20 b(information)f(is)300 -2184 y(necessary)14 b(so)f(that)g(a)g(bac)o(k)g(end)h(can)g(w)o(ork)e(out)i -(what)f(additional)h(\(in)o(visible)300 2234 y(to)j(the)e(application)i -(writer\))e(information)g(is)h(carried)g(with)f(the)g(sym)o(b)q(ol.)438 -2284 y Fh(struct)23 b(_bfd)g(*the_bfd;)300 2346 y Ff(The)14 -b(text)g(of)f(the)h(sym)o(b)q(ol.)20 b(The)14 b(name)g(is)g(left)h(alone,)f -(and)g(not)g(copied)h(-)f(the)300 2396 y(application)j(ma)o(y)d(not)h(alter)g -(it.)462 2446 y Fh(CONST)23 b(char)g(*name;)300 2508 y Ff(The)15 -b(v)m(alue)i(of)e(the)g(sym)o(b)q(ol.)462 2558 y Fh(symvalue)22 -b(value;)300 2620 y Ff(A)o(ttributes)15 b(of)g(a)g(sym)o(b)q(ol:)390 -2670 y Fh(#define)23 b(BSF_NO_FLAGS)94 b(0x00)0 2770 y Fk(c)6 -b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 -2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 17 19 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(17)300 183 y Ff(The)18 -b(sym)o(b)q(ol)g(has)g(lo)q(cal)h(scop)q(e;)34 b Fh(static)17 -b Ff(in)34 b Fh(C)p Ff(.)27 b(The)18 b(v)m(alue)h(is)h(the)e(o\013set)300 -233 y(in)o(to)d(the)g(section)h(of)f(the)g(data.)390 283 y -Fh(#define)23 b(BSF_LOCAL)g(0x01)300 349 y Ff(The)16 b(sym)o(b)q(ol)g(has)f -(global)h(scop)q(e;)g(initialized)j(data)14 b(in)k Fh(C)p Ff(.)j(The)16 -b(v)m(alue)j(is)d(the)300 399 y(o\013set)e(in)o(to)h(the)h(section)f(of)g -(the)g(data.)390 449 y Fh(#define)23 b(BSF_GLOBAL)f(0x02)300 -515 y Ff(Obsolete)390 565 y Fh(#define)h(BSF_IMPORT)f(0x04)300 -631 y Ff(The)13 b(sym)o(b)q(ol)g(has)f(global)h(scop)q(e,)g(and)g(is)g(exp)q -(orted.)19 b(The)13 b(v)m(alue)g(is)g(the)g(o\013set)300 681 -y(in)o(to)i(the)g(section)h(of)f(the)g(data.)390 730 y Fh(#define)23 -b(BSF_EXPORT)f(0x08)300 797 y Ff(The)15 b(sym)o(b)q(ol)h(is)g(unde\014ned.)21 -b Fh(extern)15 b Ff(in)h Fh(C)p Ff(.)j(The)d(v)m(alue)g(has)f(no)h(meaning.) -390 846 y Fh(#define)23 b(BSF_UNDEFINED)f(0x10)300 913 y Ff(The)17 -b(sym)o(b)q(ol)g(is)g(common,)f(initialized)k(to)c(zero;)g(default)h(in)26 -b Fh(C)p Ff(.)d(The)d(v)m(alue)300 962 y(is)c(the)f(size)h(of)f(the)g(ob)s -(ject)g(in)h(b)o(ytes.)390 1012 y Fh(#define)23 b(BSF_FORT_COMM)f(0x20)300 -1078 y Ff(A)16 b(normal)21 b Fh(C)16 b Ff(sym)o(b)q(ol)g(w)o(ould)g(b)q(e)h -(one)f(of:)27 b Fh(BSF_LOCAL)p Ff(,)19 b Fh(BSF_FORT_COMM)p -Ff(,)300 1128 y Fh(BSF_UNDEFINED)13 b Ff(or)i Fh(BSF_EXPORT|BSD_GLOBAL)300 -1194 y Ff(The)g(sym)o(b)q(ol)f(is)h(a)f(debugging)i(record.)j(The)c(v)m(alue) -g(has)g(an)f(arbitary)g(mean-)300 1244 y(ing.)390 1294 y Fh(#define)23 -b(BSF_DEBUGGING)f(0x40)300 1360 y Ff(The)d(sym)o(b)q(ol)g(has)g(no)g(section) -g(attac)o(hed,)g(an)o(y)f(v)m(alue)i(is)g(the)f(actual)g(v)m(alue)300 -1410 y(and)e(is)f(not)f(a)g(relativ)o(e)g(o\013set)g(to)f(a)h(section.)390 -1460 y Fh(#define)23 b(BSF_ABSOLUTE)f(0x80)300 1526 y Ff(Used)16 -b(b)o(y)f(the)g(link)o(er)390 1576 y Fh(#define)23 b(BSF_KEEP)190 -b(0x10000)390 1625 y(#define)23 b(BSF_WARNING)118 b(0x20000)390 -1675 y(#define)23 b(BSF_KEEP_G)142 b(0x80000)300 1741 y Ff(Un)o(used)390 -1791 y Fh(#define)23 b(BSF_WEAK)190 b(0x100000)390 1841 y(#define)23 -b(BSF_CTOR)190 b(0x200000)390 1891 y(#define)23 b(BSF_FAKE)190 -b(0x400000)300 1957 y Ff(The)15 b(sym)o(b)q(ol)h(used)g(to)e(b)q(e)i(a)f -(common)g(sym)o(b)q(ol,)g(but)g(no)o(w)g(it)h(is)f(allo)q(cated.)390 -2007 y Fh(#define)23 b(BSF_OLD_COMMON)46 b(0x800000)300 2073 -y Ff(The)15 b(default)h(v)m(alue)h(for)d(common)h(data.)390 -2123 y Fh(#define)23 b(BFD_FORT_COMM_DEFAULT_VAL)o(UE)e(0)300 -2189 y Ff(In)14 b(some)g(\014les)g(the)g(t)o(yp)q(e)g(of)f(a)h(sym)o(b)q(ol)g -(sometimes)f(alters)h(its)g(lo)q(cation)g(in)h(an)300 2239 -y(output)i(\014le)h(-)f(ie)g(in)h(co\013)e(a)27 b Fh(ISFCN)16 -b Ff(sym)o(b)q(ol)h(whic)o(h)h(is)f(also)27 b Fh(C_EXT)17 b -Ff(sym)o(b)q(ol)300 2289 y(app)q(ears)d(where)g(it)g(w)o(as)f(declared)i(and) -e(not)h(at)f(the)h(end)g(of)f(a)h(section.)39 b(This)300 2338 -y(bit)16 b(is)f(set)g(b)o(y)h(the)f(target)f(bfd)h(part)g(to)f(con)o(v)o(ey)h -(this)h(information.)390 2388 y Fh(#define)23 b(BSF_NOT_AT_END)93 -b(0x40000)300 2454 y Ff(Signal)16 b(that)f(the)g(sym)o(b)q(ol)h(is)f(the)h -(lab)q(el)h(of)d(constructor)h(section.)390 2504 y Fh(#define)23 -b(BSF_CONSTRUCTOR)69 b(0x1000000)438 2554 y(flagword)22 b(flags;)300 -2620 y Ff(Aoin)o(ter)11 b(to)f(the)h(section)g(to)f(whic)o(h)i(this)f(sym)o -(b)q(ol)g(is)h(relativ)o(e,)g(or)e(0)g(if)i(the)h(sym-)300 -2670 y(b)q(ol)j(is)f(absolute)g(or)f(unde\014ned.)22 b(Note)14 -b(that)h(it)g(is)g(not)f(su\016cien)o(t)i(to)e(set)i(this)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 18 20 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(18)300 183 y Ff(lo)q(cation)j(to)e -(0)h(to)f(mark)g(a)h(sym)o(b)q(ol)g(as)g(absolute)g(-)g(the)g(\015ag)k -Fh(BSF_ABSOLUTE)300 233 y Ff(m)o(ust)c(b)q(e)g(set)g(also.)438 -283 y Fh(struct)23 b(sec)g(*section;)300 351 y Ff(Bac)o(k)14 -b(end)h(sp)q(ecial)h(data.)j(This)14 b(is)h(b)q(eing)h(phased)e(out)g(in)h -(fa)o(v)o(our)e(of)h(making)300 400 y(this)i(a)f(union.)438 -450 y Fh(PTR)23 b(udata;)390 500 y(})h(asymbol;)0 682 y Fr(2.4.4)30 -b(Sym)n(b)r(ol)21 b(Handling)f(F)-5 b(unctions)0 893 y(2.4.4.1)30 -b(get)p 292 893 19 3 v 21 w(sym)n(tab)p 506 893 V 23 w(upp)r(er)p -686 893 V 22 w(b)r(ound)300 989 y Fm(Returns)22 b(the)g(n)o(um)o(b)q(er)f(of) -g(b)o(ytes)h(required)g(in)g(a)g(v)o(ector)e(of)h(p)q(oin)o(ters)h(to)300 -1039 y Fh(asymbols)10 b Fm(for)g(all)i(the)f(sym)o(b)q(ols)h(in)f(the)h -(supplied)h(bfd,)f(including)i(a)c(terminal)300 1089 y(NULL)k(p)q(oin)o(ter.) -19 b(If)13 b(there)g(are)f(no)g(sym)o(b)q(ols)h(in)h(the)e(bfd,)i(then)f(0)f -(is)h(returned.)300 1128 y Fg(\013)p 325 1128 1326 2 v 1325 -w(\010)p 300 1326 2 175 v 314 1214 a Fh(#define)23 b -(get_symtab_upper_bound\(abf)o(d\))e(\\)433 1264 y(BFD_SEND)i(\(abfd,)g -(_get_symtab_upper_bound,)e(\(abfd\)\))p 1677 1326 V 300 1352 -a Fg(\012)p 325 1352 1326 2 v 1325 w(\011)0 1583 y Fr(2.4.4.2)30 -b(bfd)p 296 1583 19 3 v 22 w(canonicalize)p 637 1583 V 22 w(sym)n(tab)300 -1680 y Fm(Supplied)20 b(a)d(bfd)h(and)f(a)g(p)q(oin)o(ter)h(to)f(an)g -(uninitializ)q(ed)j(v)o(ector)d(of)g(p)q(oin)o(ters.)300 1730 -y(This)i(reads)f(in)h(the)f(sym)o(b)q(ols)g(from)g(the)g(bfd,)h(and)f -(\014lls)i(in)f(the)f(table)h(with)300 1780 y(p)q(oin)o(ters)f(to)f(the)h -(sym)o(b)q(ols,)g(and)g(a)f(trailing)i(NULL.)f(The)g(routine)g(returns)300 -1830 y(the)d(actual)h(n)o(um)o(b)q(er)f(of)g(sym)o(b)q(ol)h(p)q(oin)o(ters)f -(not)g(including)j(the)d(NULL.)300 1868 y Fg(\013)p 325 1868 -1326 2 v 1325 w(\010)p 300 2166 2 274 v 314 1955 a Fh(#define)23 -b(bfd_canonicalize_symtab\(ab)o(fd,)e(location\))i(\\)433 2005 -y(BFD_SEND)g(\(abfd,)g(_bfd_canonicalize_symtab,\\)744 2054 -y(\(abfd,)g(location\)\))p 1677 2166 V 300 2192 a Fg(\012)p -325 2192 1326 2 v 1325 w(\011)0 2424 y Fr(2.4.4.3)30 b(bfd)p -296 2424 19 3 v 22 w(set)p 394 2424 V 22 w(sym)n(tab)300 2521 -y Fm(Pro)o(vided)14 b(a)f(table)h(of)f(p)q(oin)o(ters)h(to)f(to)g(sym)o(b)q -(ols)g(and)h(a)f(coun)o(t,)h(writes)f(to)g(the)300 2570 y(output)i(bfd)h(the) -f(sym)o(b)q(ols)g(when)h(closed.)390 2620 y Fh(PROTO\(boolean,)22 -b(bfd_set_symtab,)g(\(bfd)h(*,)h(asymbol)f(**,)390 2670 y(unsigned)g(int)g -(\)\);)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 19 21 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(19)0 183 y Fr(2.4.4.4)30 -b(bfd)p 296 183 19 3 v 22 w(prin)n(t)p 450 183 V 22 w(sym)n(b)r(ol)p -661 183 V 23 w(v)m(andf)300 275 y Fm(Prin)o(ts)15 b(the)g(v)m(alue)i(and)e -(\015ags)g(of)g(the)g(sym)o(b)q(ol)h(supplied)h(to)e(the)g(stream)f(\014le.) -390 324 y Fh(PROTO\(void,)22 b(bfd_print_symbol_vandf,)f(\(PTR)i(file,)h -(asym-)390 374 y(bol)f(*symbol\)\);)0 507 y Fr(2.4.4.5)30 b(bfd)p -296 507 V 22 w(mak)n(e)p 457 507 V 22 w(empt)n(y)p 646 507 -V 23 w(sym)n(b)r(ol)300 598 y Fm(This)22 b(function)f(creates)g(a)g(new)56 -b Fh(asymbol)20 b Fm(structure)h(for)f(the)h(bfd,)i(and)300 -648 y(returns)15 b(a)g(p)q(oin)o(ter)h(to)e(it.)300 710 y(This)e(routine)g -(is)g(necessary)l(,)g(since)h(eac)o(h)e(bac)o(k)g(end)h(has)g(priv)m(ate)g -(information)300 760 y(surrounding)k(the)g Fh(asymbol)p Fm(.)j(Building)f(y)o -(our)d(o)o(wn)g Fh(asymbol)f Fm(and)i(p)q(oin)o(ting)300 810 -y(to)d(it)h(will)h(not)e(create)h(the)f(priv)m(ate)i(information,)e(and)h -(will)h(cause)f(problems)300 860 y(later)h(on.)300 890 y Fg(\013)p -325 890 1326 2 v 1325 w(\010)p 300 1088 2 175 v 314 976 a Fh(#define)23 -b(bfd_make_empty_symbol\(abfd)o(\))e(\\)433 1026 y(BFD_SEND)i(\(abfd,)g -(_bfd_make_empty_symbol,)e(\(abfd\)\))p 1677 1088 V 300 1114 -a Fg(\012)p 325 1114 1326 2 v 1325 w(\011)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g -(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 -w(Revision:)17 b(1.5)p eop -%%Page: 20 22 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(20)0 183 y Fn(2.5)33 -b(Arc)n(hiv)n(es)300 275 y Fm(Gum)o(b)o(y)l(,)15 b(y)o(ou)f(promised)i(to)f -(write)g(this)h(bit...)300 337 y(Arc)o(hiv)o(es)g(are)f(supp)q(orted)g(in)h -(bfd)g(in)g Fh(archive.c)p Fm(.)300 399 y(An)22 b(arc)o(hiv)o(e)g(is)h -(represen)o(ted)f(in)o(ternally)i(just)e(lik)o(e)h(another)e(bfd,)j(with)e(a) -300 449 y(p)q(oin)o(ter)f(to)f(a)g(c)o(hain)i(of)e(con)o(tained)h(bfds.)36 -b(Arc)o(hiv)o(es)21 b(can)g(b)q(e)g(created)g(b)o(y)300 499 -y(op)q(ening)15 b(bfds,)f(linking)i(them)d(together)g(and)h(attatc)o(hing)f -(them)h(as)f(c)o(hildren)300 549 y(to)i(another)f(bfd)i(and)f(then)h(closing) -g(the)f(paren)o(t)g(bfd.)0 681 y Fr(2.5.0.1)30 b(bfd)p 296 -681 19 3 v 22 w(get)p 401 681 V 21 w(next)p 540 681 V 23 w(map)r(en)n(t)300 -773 y Fm(What)15 b(this)g(do)q(es)390 823 y Fh(PROTO\(symindex,)22 -b(bfd_get_next_mapent,)f(\(bfd)i(*,)h(symin-)390 872 y(dex,)f(carsym)g -(**\)\);)0 1005 y Fr(2.5.0.2)30 b(bfd)p 296 1005 V 22 w(set)p -394 1005 V 22 w(arc)n(hiv)n(e)p 605 1005 V 23 w(head)300 1096 -y Fm(Used)18 b(whilst)g(pro)q(cessing)g(arc)o(hiv)o(es.)26 -b(Sets)17 b(the)g(head)h(of)f(the)g(c)o(hain)h(of)f(bfds)300 -1146 y(con)o(tained)f(in)g(an)f(arc)o(hiv)o(e)g(to)g Ff(new)p -914 1146 14 2 v 17 w(head)p Fm(.)20 b(\(see)15 b(c)o(hapter)g(on)g(arc)o(hiv) -o(es\))390 1196 y Fh(PROTO\(boolean,)22 b(bfd_set_archive_head,)f(\(bfd)i -(*output,)390 1246 y(bfd)g(*new_head\)\);)0 1379 y Fr(2.5.0.3)30 -b(bfd)p 296 1379 19 3 v 22 w(get)p 401 1379 V 21 w(elt)p 491 -1379 V 22 w(at)p 567 1379 V 22 w(index)390 1458 y Fh(PROTO\(bfd)23 -b(*,)g(bfd_get_elt_at_index,)e(\(bfd)j(*,)f(int\)\);)0 1590 -y Fr(2.5.0.4)30 b(bfd)p 296 1590 V 22 w(op)r(enr)p 472 1590 -V 21 w(next)p 611 1590 V 23 w(arc)n(hiv)n(ed)p 857 1590 V 23 -w(\014le)300 1682 y Fm(Initially)14 b(pro)o(vided)f(a)f(bfd)g(con)o(taining)g -(an)g(arc)o(hiv)o(e)g(and)g(NULL,)h(op)q(ens)f(a)g(bfd)300 -1732 y(on)j(the)g(\014rst)f(con)o(tained)i(elemen)o(t)g(and)f(returns)g -(that.)k(Subsequen)o(t)d(calls)g(to)300 1781 y(bfd)p 367 1781 -14 2 v 17 w(op)q(enr)p 496 1781 V 17 w(next)p 600 1781 V 16 -w(arc)o(hiv)o(ed)p 781 1781 V 17 w(\014le)c(should)h(pass)e(the)g(arc)o(hiv)o -(e)g(and)h(the)f(previous)300 1831 y(return)16 b(v)m(alue)i(to)e(return)h(a)f -(created)g(bfd)h(to)f(the)h(next)f(con)o(tained)i(elemen)o(t.)300 -1881 y(NULL)e(is)g(returned)f(when)h(there)f(are)g(no)g(more.)390 -1931 y Fh(PROTO\(bfd*,)22 b(bfd_openr_next_archived_file,)748 -1981 y(\(bfd)h(*archive,)g(bfd)g(*previous\)\);)0 2770 y Fk(c)6 -b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 -2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 21 23 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(21)0 183 y Fn(2.6)33 -b(File)23 b(F)-6 b(ormats)300 275 y Fm(A)17 b(format)g(is)h(a)30 -b Fh(bfd)17 b Fm(concept)h(of)f(high)h(lev)o(el)h(\014le)g(con)o(ten)o(ts.)26 -b(The)17 b(formats)300 324 y(supp)q(orted)f(b)o(y)f Fh(bfd)g -Fm(are:)300 387 y Fh(bfd_object)450 437 y Fm(The)k(bfd)g(ma)o(y)f(con)o(tain) -h(data,)f(sym)o(b)q(ols,)i(relo)q(cations)f(and)g(debug)450 -486 y(info.)300 547 y Fh(bfd_archive)450 596 y Fm(The)c(bfd)h(con)o(tains)f -(other)g(bfds)h(and)f(an)g(optional)h(index.)300 657 y Fh(bfd_core)450 -707 y Fm(The)f(bfd)h(con)o(tains)f(the)h(result)f(of)g(an)g(executable)i -(core)e(dump.)0 832 y Fr(2.6.0.1)30 b(bfd)p 296 832 19 3 v -22 w(c)n(hec)n(k)p 462 832 V 23 w(format)300 923 y Fm(This)19 -b(routine)g(is)g(supplied)i(a)d(bfd)h(and)g(a)f(format.)29 -b(It)18 b(attempts)g(to)g(v)o(erify)300 973 y(if)e(the)g(\014le)g(attatc)o -(hed)f(to)g(the)g(bfd)h(is)g(indeed)h(compatible)g(with)f(the)f(format)300 -1023 y(sp)q(eci\014ed)i(\(ie,)f(one)f(of)g Fh(bfd_object)p -Fm(,)e Fh(bfd_archive)h Fm(or)g Fh(bfd_core)p Fm(\).)300 1085 -y(If)j(the)h(bfd)f(has)g(b)q(een)h(set)f(to)g(a)f(sp)q(eci\014c)j -Ff(target)e Fm(b)q(efore)h(the)f(call,)h(only)g(the)300 1135 -y(named)d(target)f(and)i(format)e(com)o(bination)h(will)i(b)q(e)f(c)o(hec)o -(k)o(ed.)k(If)c(the)f(target)300 1184 y(has)k(not)f(b)q(een)i(set,)f(or)g -(has)f(b)q(een)i(set)f(to)40 b Fh(default)18 b Fm(then)h(all)h(the)f(kno)o -(wn)300 1234 y(target)14 b(bac)o(k)o(ends)h(will)i(b)q(e)f(in)o(terrogated)f -(to)f(determine)i(a)f(matc)o(h.)300 1297 y(The)h(function)h(returns)22 -b Fh(true)15 b Fm(on)h(success,)h(otherwise)k Fh(false)16 b -Fm(with)g(one)g(of)300 1346 y(the)f(follo)o(wing)h(error)f(co)q(des:)450 -1409 y(in)o(v)m(alid)p 582 1409 14 2 v 19 w(op)q(eration)21 -b(if)58 b Fh(format)20 b Fm(is)h(not)g(one)h(of)56 b Fh(bfd_object)p -Fm(,)450 1458 y Fh(bfd_archive)14 b Fm(or)g Fh(bfd_core)p Fm(.)300 -1519 y Fh(system_call_error)450 1569 y Fm(if)g(an)g(error)f(o)q(ccured)h -(during)g(a)g(read)f(-)h(ev)o(en)g(some)f(\014le)i(mismatc)o(hes)450 -1618 y(can)g(cause)h(system)p 794 1618 V 16 w(call)p 877 1618 -V 17 w(errros)300 1679 y Fh(file_not_recognised)450 1729 y -Fm(none)g(of)e(the)i(bac)o(k)o(ends)f(recognised)h(the)f(\014le)i(format)300 -1789 y Fh(file_ambiguously_recognize)o(d)450 1839 y Fm(more)e(than)g(one)g -(bac)o(k)o(end)h(recognised)g(the)f(\014le)h(format.)390 1889 -y Fh(PROTO\(boolean,)22 b(bfd_check_format,)f(\(bfd)j(*abfd,)f(bfd_format)p -2002 1895 21 38 v 390 1938 a(format\)\);)0 2063 y Fr(2.6.0.2)30 -b(bfd)p 296 2063 19 3 v 22 w(set)p 394 2063 V 22 w(format)300 -2155 y Fm(This)18 b(function)g(sets)f(the)g(\014le)h(format)e(of)h(the)g -(supplied)j(bfd)d(to)g(the)g(format)300 2205 y(requested.)26 -b(If)17 b(the)h(target)d(set)i(in)h(the)f(bfd)h(do)q(es)f(not)g(supp)q(ort)g -(the)g(format)300 2254 y(requested,)c(the)f(format)f(is)i(illegal)i(or)d(the) -g(bfd)h(is)g(not)f(op)q(en)h(for)e(writing)i(than)300 2304 -y(an)i(error)g(o)q(ccurs.)390 2354 y Fh(PROTO\(boolean,bfd_set_form)o -(at,\(bfd)20 b(*,)k(bfd_format\)\);)0 2479 y Fr(2.6.0.3)30 -b(bfd)p 296 2479 V 22 w(format)p 498 2479 V 21 w(string)300 -2570 y Fm(This)12 b(function)f(tak)o(es)f(one)h(argumen)o(t,)g(and)g(en)o -(umerated)g(t)o(yp)q(e)g(\(bfd)p 1486 2570 14 2 v 17 w(format\))300 -2620 y(and)h(returns)f(a)g(p)q(oin)o(ter)h(to)e(a)h(const)g(string)h -Fh(")p Fm(in)o(v)m(alid)p Fh(")p Fm(,)h Fh(")p Fm(ob)s(ject)p -Fh(")p Fm(,)e Fh(")p Fm(arc)o(hiv)o(e)p Fh(")p Fm(,)300 2670 -y Fh(")p Fm(core)p Fh(")j Fm(or)f Fh(")p Fm(unkno)o(wn)p Fh(")h -Fm(dep)q(ending)j(up)q(on)e(the)f(v)m(alue)h(of)f(the)g(en)o(umeration.)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 22 24 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(22)390 183 y Fh(PROTO\(CONST)22 -b(char)i(*,)f(bfd_format_string,)f(\(bfd_format\)\);)0 2770 -y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 23 25 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(23)0 183 y Fn(2.7)33 -b(Relo)r(cations)300 275 y Fm(Bfd)23 b(main)o(tains)h(relo)q(cations)f(in)h -(m)o(uc)o(h)f(the)g(same)g(w)o(as)f(as)g(it)i(main)o(tains)300 -324 y(sym)o(b)q(ols;)i(they)c(are)g(left)g(alone)h(un)o(til)g(required,)h -(then)f(read)f(in)h(en-mass)300 374 y(and)e(traslated)f(in)o(to)g(an)h(in)o -(ternal)g(form.)36 b(There)20 b(is)h(a)g(common)f(routine)300 -424 y Fh(bfd_perform_relocation)11 b Fm(whic)o(h)k(acts)e(up)q(on)i(the)f -(canonical)h(form)e(to)h(to)300 474 y(the)h(actual)h(\014xup.)300 -536 y(Note)h(that)g(relo)q(cations)i(are)e(main)o(tained)h(on)g(a)f(p)q(er)i -(section)f(basis,)g(whilst)300 586 y(sym)o(b)q(ols)d(are)g(main)o(tained)h -(on)g(a)e(p)q(er)i(bfd)g(basis.)300 648 y(All)g(a)e(bac)o(k)h(end)g(has)f(to) -g(do)h(to)f(\014t)g(the)h(bfd)g(in)o(terface)g(is)g(to)f(create)g(as)g(man)o -(y)300 698 y Fh(struct)g(reloc_cache_entry)i Fm(as)i(there)g(are)g(relo)q -(cations)h(in)g(a)f(particuar)300 748 y(section,)d(and)h(\014ll)g(in)g(the)g -(righ)o(t)f(bits:)0 873 y Fr(2.7.0.1)30 b(bfd)p 296 873 19 -3 v 22 w(p)r(erform)p 533 873 V 21 w(relo)r(cation)300 964 -y Fm(The)15 b(relo)q(cation)h(routine)g(returns)f(as)g(a)g(status)f(an)h(en)o -(umerated)h(t)o(yp)q(e:)390 1014 y Fh(typedef)23 b(enum)g(bfd_reloc_status)f -({)300 1076 y Ff(No)15 b(errors)f(detected)438 1126 y Fh(bfd_reloc_ok,)300 -1188 y Ff(The)h(relo)q(cation)h(w)o(as)f(p)q(erformed,)g(but)g(there)g(w)o -(as)g(an)g(o)o(v)o(er\015o)o(w.)438 1238 y Fh(bfd_reloc_overflow,)300 -1300 y Ff(The)g(address)h(to)e(relo)q(cate)i(w)o(as)e(not)h(within)h(the)g -(section)f(supplied)438 1350 y Fh(bfd_reloc_outofrange,)300 -1412 y Ff(Used)h(b)o(y)f(sp)q(ecial)i(functions)438 1462 y -Fh(bfd_reloc_continue,)300 1524 y Ff(Un)o(used)438 1574 y Fh -(bfd_reloc_notsupported,)300 1636 y Ff(Unsupp)q(orted)f(relo)q(cation)g(size) -g(requested.)438 1686 y Fh(bfd_reloc_other,)300 1748 y Ff(The)f(sym)o(b)q(ol) -h(to)f(relo)q(cate)g(against)g(w)o(as)f(unde\014ned.)438 1798 -y Fh(bfd_reloc_undefined,)300 1861 y Ff(The)j(relo)q(caction)g(w)o(as)e(p)q -(erformed,)i(but)g(ma)o(y)e(not)h(b)q(e)h(ok)f(-)h(presen)o(tly)g(gen-)300 -1910 y(erated)g(only)f(when)f(linking)i(i960)e(co\013)g(\014les)h(with)g -(i960)f(b.out)f(sym)o(b)q(ols.)438 1960 y Fh(bfd_reloc_dangerous)462 -2010 y(})414 2060 y(bfd_reloc_status_enum_typ)o(e;)390 2110 -y(typedef)23 b(struct)g(reloc_cache_entry)390 2159 y({)300 -2222 y Ff(A)15 b(p)q(oin)o(ter)h(in)o(to)f(the)g(canonical)i(table)f(of)e(p)q -(oin)o(ters)438 2271 y Fh(struct)23 b(symbol_cache_entry)e(**sym_ptr_ptr;)300 -2334 y Ff(o\013set)14 b(in)i(section)438 2384 y Fh(rawdata_offset)22 -b(address;)300 2446 y Ff(addend)16 b(for)f(relo)q(cation)h(v)m(alue)438 -2496 y Fh(bfd_vma)23 b(addend;)300 2558 y Ff(if)16 b(sym)f(is)g(n)o(ull)i -(this)f(is)f(the)h(section)438 2608 y Fh(struct)23 b(sec)g(*section;)300 -2670 y Ff(P)o(oin)o(ter)15 b(to)f(ho)o(w)h(to)g(p)q(erform)g(the)g(required)h -(relo)q(cation)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 -b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 24 26 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(24)438 183 y Fh(CONST)23 -b(struct)g(reloc_howto_struct)e(*howto;)390 233 y(})j(arelent;)300 -326 y(sym_ptr_ptr)450 376 y Fm(The)e(sym)o(b)q(ol)g(table)g(p)q(oin)o(ter)g -(p)q(oin)o(ts)h(to)e(a)g(p)q(oin)o(ter)h(to)f(the)h(sym-)450 -426 y(b)q(ol)15 b(asco)q(ciated)g(with)f(the)h(relo)q(cation)g(request.)k -(This)c(w)o(ould)g(natu-)450 476 y(raly)g(b)q(e)g(the)g(p)q(oin)o(ter)g(in)o -(to)f(the)h(table)g(returned)g(b)o(y)g(the)f(bac)o(k)h(end's)450 -526 y(get)p 514 526 14 2 v 16 w(sym)o(tab)h(action.)23 b(See)17 -b(Section)h(2.4)d([Sym)o(b)q(ols],)h(page)h(14.)23 b(The)450 -575 y(sym)o(b)q(ol)18 b(is)h(referenced)f(through)g(a)g(p)q(oin)o(ter)g(to)f -(a)h(p)q(oin)o(ter)g(so)g(that)450 625 y(to)q(ols)j(lik)o(e)g(the)g(link)o -(er)h(can)f(\014xup)g(all)h(the)e(sym)o(b)q(ols)h(of)g(the)f(same)450 -675 y(name)h(b)o(y)g(mo)q(difying)i(only)e(one)h(p)q(oin)o(ter.)38 -b(The)21 b(relo)q(cation)h(rou-)450 725 y(tine)16 b(lo)q(oks)f(in)g(the)g -(sym)o(b)q(ol)h(and)f(uses)g(the)g(base)g(of)f(the)h(section)h(the)450 -775 y(sym)o(b)q(ol)k(is)h(attatc)o(hed)e(to)g(and)h(the)g(v)m(alue)h(of)e -(the)h(sym)o(b)q(ol)g(as)g(the)450 825 y(initial)h(relo)q(cation)f(o\013set.) -29 b(If)20 b(the)e(sym)o(b)q(ol)i(p)q(oin)o(ter)f(is)g(zero,)h(then)450 -874 y(the)15 b(section)h(pro)o(vided)g(is)g(lo)q(ok)o(ed)f(up.)300 -968 y Fh(address)450 1017 y Fm(The)d(address)g(\014eld)i(giv)o(es)e(the)g -(o\013set)f(in)i(b)o(ytes)f(from)f(the)h(base)g(of)g(the)450 -1067 y(section)g(data)e(whic)o(h)i(o)o(wns)f(the)g(relo)q(cation)h(record)f -(to)g(the)g(\014rst)g(b)o(yte)450 1117 y(of)j(relo)q(catable)h(information.)k -(The)14 b(actual)h(data)e(relo)q(cated)i(will)g(b)q(e)450 1167 -y(relativ)o(e)j(to)e(this)h(p)q(oin)o(t)h(-)f(for)g(example,)g(a)g(relo)q -(cation)h(t)o(yp)q(e)f(whic)o(h)450 1217 y(mo)q(di\014es)e(the)e(b)q(ottom)g -(t)o(w)o(o)f(b)o(ytes)i(of)f(a)g(four)g(b)o(yte)h(w)o(ord)e(w)o(ould)i(not) -450 1267 y(touc)o(h)h(the)g(\014rst)g(b)o(yte)g(p)q(oin)o(ted)h(to)f(in)h(a)f -(big)g(endian)i(w)o(orld.)300 1360 y Fh(addend)450 1410 y Fm(The)e(addend)g -(is)g(a)f(v)m(alue)h(pro)o(vided)h(b)o(y)e(the)g(bac)o(k)h(end)g(to)e(b)q(e)i -(added)450 1459 y(\(!\))27 b(to)17 b(the)g(relo)q(cation)i(o\013set.)26 -b(It's)17 b(in)o(terpretation)h(is)g(dep)q(enden)o(t)450 1509 -y(up)q(on)e(the)f(ho)o(wto.)k(F)l(or)c(example,)g(on)g(the)h(68k)e(the)h(co)q -(de:)450 1548 y Fg(\013)p 475 1548 1176 2 v 1175 w(\010)p 450 -1896 2 324 v 655 1634 a Fh(char)23 b(foo[];)655 1684 y(main\(\))846 -1734 y({)846 1784 y(return)g(foo[0x12345678];)846 1834 y(})p -1677 1896 V 450 1922 a Fg(\012)p 475 1922 1176 2 v 1175 w(\011)450 -2065 y Fm(Could)16 b(b)q(e)g(compiled)h(in)o(to:)450 2103 y -Fg(\013)p 475 2103 V 1175 w(\010)p 450 2451 2 324 v 655 2190 -a Fh(linkw)23 b(fp,#-4)655 2240 y(moveb)g(@#12345678,d0)655 -2289 y(extbl)g(d0)655 2339 y(unlk)g(fp)655 2389 y(rts)p 1677 -2451 V 450 2477 a Fg(\012)p 475 2477 1176 2 v 1175 w(\011)450 -2620 y Fm(This)15 b(could)g(create)f(a)g(relo)q(c)i(p)q(oin)o(ting)f(to)f(fo) -q(o,)f(but)i(lea)o(v)o(e)g(the)f(o\013set)450 2670 y(in)i(the)f(data)g -(\(something)g(lik)o(e\))0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 25 27 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(25)450 26 y Fg(\013)p -475 26 1176 2 v 1175 w(\010)p 450 573 2 524 v 464 112 a Fh(RELOCATION)23 -b(RECORDS)g(FOR)g([.text]:)464 162 y(OFFSET)71 b(TYPE)143 b(VALUE)464 -212 y(00000006)23 b(32)191 b(_foo)464 311 y(00000000)23 b(4e56)g(fffc)238 -b(;)24 b(linkw)f(fp,#-4)464 361 y(00000004)g(1039)g(1234)h(5678)118 -b(;)24 b(moveb)f(@#12345678,d0)464 411 y(0000000a)g(49c0)357 -b(;)24 b(extbl)f(d0)464 461 y(0000000c)g(4e5e)357 b(;)24 b(unlk)f(fp)464 -511 y(0000000e)g(4e75)357 b(;)24 b(rts)p 1677 573 V 450 599 -a Fg(\012)p 475 599 1176 2 v 1175 w(\011)450 751 y Fm(Using)17 -b(co\013)f(and)h(an)f(88k,)g(some)g(instructions)i(don't)d(ha)o(v)o(e)i -(enough)450 800 y(space)11 b(in)g(them)f(to)g(represen)o(t)h(the)f(full)i -(address)e(range,)h(and)g(p)q(oin)o(ters)450 850 y(ha)o(v)o(e)k(to)f(b)q(e)i -(loaded)g(in)g(t)o(w)o(o)e(parts.)19 b(So)c(y)o(ou'd)g(get)g(something)g(lik) -o(e:)450 889 y Fg(\013)p 475 889 V 1175 w(\010)p 450 1137 2 -225 v 655 975 a Fh(or.u)119 b(r13,r0,hi16\(_foo+0x123456)o(78\))655 -1025 y(ld.b)g(r2,r13,lo16\(_foo+0x123456)o(78\))655 1075 y(jmp)143 -b(r1)p 1677 1137 V 450 1163 a Fg(\012)p 475 1163 1176 2 v 1175 -w(\011)450 1315 y Fm(This)11 b(whould)g(create)f(t)o(w)o(o)f(relo)q(cs,)j(b)q -(oth)e(p)q(oin)o(ting)i(to)p 1380 1315 14 2 v 26 w(fo)q(o,)e(and)h(with)450 -1365 y(0x12340000)h(in)j(their)f(addend)h(\014eld.)21 b(The)14 -b(data)g(w)o(ould)g(consist)h(of:)450 1395 y Fg(\013)p 475 -1395 1176 2 v 1175 w(\010)p 450 1942 2 524 v 464 1531 a Fh(RELOCATION)23 -b(RECORDS)g(FOR)g([.text]:)464 1581 y(OFFSET)71 b(TYPE)143 -b(VALUE)464 1630 y(00000002)23 b(HVRT16)95 b(_foo+0x12340000)464 -1680 y(00000006)23 b(LVRT16)95 b(_foo+0x12340000)464 1780 y(00000000)23 -b(5da05678)261 b(;)24 b(or.u)f(r13,r0,0x5678)464 1830 y(00000004)g(1c4d5678) -261 b(;)24 b(ld.b)f(r2,r13,0x5678)464 1879 y(00000008)g(f400c001)261 -b(;)24 b(jmp)f(r1)p 1677 1942 V 450 1967 a Fg(\012)p 475 1967 -1176 2 v 1175 w(\011)450 2119 y Fm(The)13 b(relo)q(cation)g(routine)h(digs)f -(out)f(the)h(v)m(alue)h(from)e(the)h(data,)f(adds)450 2169 -y(it)k(to)f(the)h(addend)g(to)g(get)f(the)h(original)g(o\013set)f(and)h(then) -g(adds)g(the)450 2219 y(v)m(alue)j(of)p 627 2219 14 2 v 34 -w(fo)q(o.)28 b(Note)17 b(that)g(all)i(32)f(bits)g(ha)o(v)o(e)f(to)h(b)q(e)g -(k)o(ept)g(around)450 2269 y(somewhere,)d(to)f(cop)q(e)i(with)g(carry)e(from) -h(bit)h(15)e(to)h(bit)g(16.)450 2371 y(On)j(further)f(example)h(is)f(the)h -(sparc)f(and)g(the)g(a.out)f(format.)25 b(The)450 2421 y(sparc)14 -b(has)g(a)f(similar)j(problem)e(to)g(the)g(88k,)f(in)i(that)e(some)h -(instruc-)450 2471 y(tions)k(don't)f(ha)o(v)o(e)g(ro)q(om)g(for)f(an)i(en)o -(tire)g(o\013set,)e(but)i(on)g(the)f(sparc)450 2521 y(the)f(parts)g(are)g -(created)h(o)q(dd)f(sized)i(lumps.)24 b(The)17 b(designers)g(of)f(the)450 -2570 y(a.out)e(format)f(c)o(hose)h(not)h(to)e(use)i(the)g(data)f(within)i -(the)e(section)i(for)450 2620 y(storing)11 b(part)f(of)h(the)g(o\013set;)g -(all)h(the)f(o\013set)f(is)h(k)o(ept)g(within)h(the)g(relo)q(c.)450 -2670 y(An)o(y)j(thing)h(in)g(the)f(data)g(should)h(b)q(e)g(ignored.)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 26 28 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(26)450 26 y Fg(\013)p -475 26 1176 2 v 1175 w(\010)p 450 374 2 324 v 655 112 a Fh(save)23 -b(\045sp,-112,\045sp)655 162 y(sethi)g(\045hi\(_foo+0x12345678\),\045g2)655 -212 y(ldsb)g([\045g2+\045lo\(_foo+0x12345678\)],\045i)o(0)655 -262 y(ret)655 311 y(restore)p 1677 374 V 450 399 a Fg(\012)p -475 399 1176 2 v 1175 w(\011)450 510 y Fm(Both)17 b(relo)q(cs)h(con)o(tains)f -(a)g(p)q(oin)o(ter)h(to)e(fo)q(o,)h(and)g(the)g(o\013sets)g(w)o(ould)450 -560 y(con)o(tain)e(junk.)450 599 y Fg(\013)p 475 599 V 1175 -w(\010)p 450 1196 2 573 v 464 685 a Fh(RELOCATION)23 b(RECORDS)g(FOR)g -([.text]:)464 735 y(OFFSET)71 b(TYPE)143 b(VALUE)464 785 y(00000004)23 -b(HI22)143 b(_foo+0x12345678)464 835 y(00000008)23 b(LO10)143 -b(_foo+0x12345678)464 934 y(00000000)23 b(9de3bf90)118 b(;)24 -b(save)f(\045sp,-112,\045sp)464 984 y(00000004)g(05000000)118 -b(;)24 b(sethi)f(\045hi\(_foo+0\),\045g2)464 1034 y(00000008)g(f048a000)118 -b(;)24 b(ldsb)f([\045g2+\045lo\(_foo+0\)],\045i0)464 1084 y(0000000c)g -(81c7e008)118 b(;)24 b(ret)464 1133 y(00000010)f(81e80000)118 -b(;)24 b(restore)p 1677 1196 V 450 1221 a Fg(\012)p 475 1221 -1176 2 v 1175 w(\011)300 1332 y Fh(section)450 1382 y Fm(The)17 -b(section)g(\014eld)h(is)f(only)g(used)h(when)f(the)g(sym)o(b)q(ol)g(p)q(oin) -o(ter)g(\014eld)450 1432 y(is)f(n)o(ull.)21 b(It)15 b(supplies)j(the)d -(section)h(in)o(to)f(whic)o(h)h(the)f(data)g(should)h(b)q(e)450 -1482 y(relo)q(cated.)k(The)14 b(\014eld's)h(main)g(use)f(comes)g(from)f -(assem)o(blers)h(whic)o(h)450 1532 y(do)j(most)e(of)i(the)f(sym)o(b)q(ol)h -(\014xups)h(themselv)o(es;)f(an)g(assem)o(bler)g(ma)o(y)450 -1581 y(tak)o(e)12 b(an)g(in)o(ternal)h(reference)h(to)d(a)i(lab)q(el,)h(but)e -(since)i(it)f(kno)o(ws)f(where)450 1631 y(the)18 b(lab)q(el)j(is,)e(it)f(can) -h(turn)f(the)h(relo)q(cation)g(request)f(from)g(a)g(sym-)450 -1681 y(b)q(ol)g(lo)q(okup)f(in)o(to)g(a)g(section)g(relativ)o(e)h(relo)q -(cation)f(-)g(the)g(relo)q(cation)450 1731 y(emitted)f(has)f(no)g(sym)o(b)q -(ol,)g(just)g(a)g(section)h(to)e(relo)q(cate)i(against.)450 -1792 y(I'm)h(not)f(sure)h(what)g(it)g(means)g(when)g(b)q(oth)g(a)f(sym)o(b)q -(ol)i(p)q(oin)o(ter)f(an)450 1842 y(a)g(section)g(p)q(oin)o(ter)g(are)g -(presen)o(t.)25 b(Some)17 b(formats)e(use)i(this)g(sort)f(of)450 -1891 y(mec)o(hanism)e(to)e(describ)q(e)j(PIC)f(relo)q(cations,)g(but)f(bfd)g -(can't)g(to)g(that)450 1941 y(sort)h(of)h(thing)h(y)o(et.)300 -2002 y Fh(howto)30 b Fm(The)16 b(ho)o(wto)e(\014eld)i(can)g(b)q(e)g(imagined) -g(as)f(a)g(relo)q(cation)h(instruction.)450 2052 y(It)c(is)h(a)f(p)q(oin)o -(ter)h(to)f(a)g(struct)g(whic)o(h)h(con)o(tains)g(information)f(on)h(what)450 -2102 y(to)j(do)h(with)g(all)h(the)f(other)f(information)h(in)h(the)e(relo)q -(c)i(record)f(and)450 2152 y(data)g(section.)27 b(A)17 b(bac)o(k)g(end)h(w)o -(ould)g(normally)g(ha)o(v)o(e)f(a)g(relo)q(cation)450 2202 -y(instruction)g(set)e(and)h(turn)f(relo)q(cations)i(in)o(to)e(p)q(oin)o(ters) -h(to)f(the)h(cor-)450 2251 y(rect)i(structure)g(on)g(input)h(-)f(but)g(it)g -(w)o(ould)g(b)q(e)h(p)q(ossible)h(to)d(create)450 2301 y(eac)o(h)e(ho)o(wto)f -(\014eld)j(on)e(demand.)0 2429 y Fr(2.7.0.2)30 b(relo)r(c)p -339 2429 19 3 v 21 w(ho)n(wto)p 522 2429 V 22 w(t)n(yp)r(e)300 -2521 y Fm(The)d Fh(reloc_howto_type)14 b Fm(is)j(a)g(structure)f(whic)o(h)i -(con)o(tains)f(all)h(the)f(infor-)300 2570 y(mation)e(that)g(bfd)g(needs)h -(to)f(kno)o(w)f(to)h(tie)h(up)f(a)g(bac)o(k)g(end's)h(data.)390 -2620 y Fh(typedef)23 b(CONST)g(struct)g(reloc_howto_struct)390 -2670 y({)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g -(t)p 332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 27 29 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(27)300 183 y Ff(The)18 -b(t)o(yp)q(e)g(\014eld)h(has)f(mainly)g(a)g(do)q(cumetary)g(use)g(-)g(the)g -(bac)o(k)f(end)i(can)f(to)300 233 y(what)f(it)g(w)o(an)o(ts)e(with)i(it,)g -(though)f(the)h(normally)g(the)f(bac)o(k)h(end's)g(external)300 -283 y(idea)f(of)24 b(what)15 b(a)g(relo)q(c)h(n)o(um)o(b)q(er)g(w)o(ould)g(b) -q(e)g(w)o(ould)g(b)q(e)g(stored)f(in)h(this)g(\014eld.)300 -333 y(F)l(or)f(example,)f(the)f(a)f(PC)g(relativ)o(e)h(w)o(ord)f(relo)q -(cation)i(in)f(a)g(co\013)f(en)o(vironmen)o(t)300 382 y(w)o(ould)i(ha)o(v)o -(e)d(the)h(t)o(yp)q(e)g(023)f(-)h(b)q(ecause)h(that's)e(what)g(the)h(outside) -g(w)o(orld)g(calls)300 432 y(a)j(R)p 374 432 14 2 v 17 w(PCR)-5 -b(W)o(ORD)15 b(relo)q(c.)438 482 y Fh(unsigned)22 b(int)i(type;)300 -548 y Ff(The)d(v)m(alue)h(the)f(\014nal)h(relo)q(cation)f(is)g(shifted)h -(righ)o(t)f(b)o(y)l(.)36 b(This)22 b(drops)g(un-)300 598 y(w)o(an)o(ted)15 -b(data)f(from)h(the)g(relo)q(cation.)438 648 y Fh(unsigned)22 -b(int)i(rightshift;)300 714 y Ff(The)17 b(size)g(of)f(the)h(item)g(to)f(b)q -(e)h(relo)q(cated)g(-)g(0,)f(is)h(one)g(b)o(yte,)f(1)h(is)g(2)f(b)o(ytes,)g -(3)300 764 y(is)g(four)f(b)o(ytes.)438 814 y Fh(unsigned)22 -b(int)i(size;)300 880 y Ff(No)o(w)15 b(obsolete)438 929 y Fh(unsigned)22 -b(int)i(bitsize;)300 996 y Ff(Notes)16 b(that)f(the)i(relo)q(cation)f(is)h -(relativ)o(e)g(to)e(the)i(lo)q(cation)g(in)g(the)f(data)g(sec-)300 -1045 y(tion)i(of)f(the)h(addend.)29 b(The)18 b(relo)q(cation)g(function)h -(will)h(subtract)d(from)g(the)300 1095 y(relo)q(cation)f(v)m(alue)g(the)g -(address)f(of)g(the)g(lo)q(cation)h(b)q(eing)g(relo)q(cated.)438 -1145 y Fh(boolean)23 b(pc_relative;)300 1211 y Ff(No)o(w)15 -b(obsolete)438 1261 y Fh(unsigned)22 b(int)i(bitpos;)300 1327 -y Ff(No)o(w)15 b(obsolete)438 1377 y Fh(boolean)23 b(absolute;)300 -1443 y Ff(Causes)10 b(the)h(relo)q(cation)h(routine)f(to)f(return)g(an)h -(error)f(if)h(o)o(v)o(er\015o)o(w)e(is)k(detected)300 1493 -y(when)j(relo)q(cating.)438 1543 y Fh(boolean)23 b(complain_on_overflow;)300 -1609 y Ff(If)10 b(this)h(\014eld)h(is)e(non)h(n)o(ull,)h(then)f(the)f -(supplied)j(function)e(is)f(called)i(rather)h(than)300 1658 -y(the)k(normal)g(function.)27 b(This)17 b(allo)o(ws)h(really)g(strange)e -(relo)q(cation)i(metho)q(ds)300 1708 y(to)d(b)q(e)g(accomo)q(dated)g(\(eg,)g -(i960)g(callj)h(instructions\).)438 1758 y Fh(bfd_reloc_status_enum_ty)o(pe) -21 b(\(*special_function\)\(\);)300 1824 y Ff(The)15 b(textual)h(name)f(of)g -(the)g(relo)q(cation)h(t)o(yp)q(e.)438 1874 y Fh(char)23 b(*name;)300 -1940 y Ff(When)17 b(p)q(erforming)h(a)f(partial)g(link,)i(some)d(formats)g(m) -o(ust)h(mo)q(dify)g(the)j(re-)300 1990 y(lo)q(cations)c(rather)f(than)g(the)g -(data)f(-)i(this)f(\015ag)g(signals)h(this.)438 2040 y Fh(boolean)23 -b(partial_inplace;)300 2106 y Ff(The)16 b(src)p 453 2106 V -16 w(mask)f(is)h(used)g(to)f(select)h(what)f(parts)g(of)g(the)g(read)g(in)i -(data)d(are)i(to)300 2156 y(b)q(e)j(used)f(in)h(the)f(relo)q(cation)g(sum.)28 -b(Eg,)18 b(if)h(this)f(w)o(as)f(an)h(8)f(bit)i(bit)f(of)g(data)300 -2205 y(whic)o(h)i(w)o(e)e(read)h(and)g(relo)q(cated,)h(this)g(w)o(ould)f(b)q -(e)g(0x000000\013.)29 b(When)19 b(w)o(e)300 2255 y(ha)o(v)o(e)d(relo)q(cs)e -(whic)o(h)h(ha)o(v)o(e)e(an)g(addend,)i(suc)o(h)f(as)f(sun4)h(extended)h -(relo)q(cs,)f(the)300 2305 y(v)m(alue)22 b(in)d(the)f(o\013set)f(part)g(of)h -(a)g(relo)q(cating)g(\014eld)i(is)e(garbage)f(so)h(w)o(e)g(nev)o(er)300 -2355 y(use)g(it.)i(In)c(this)g(case)f(the)g(mask)g(w)o(ould)g(b)q(e)h -(0x00000000.)438 2405 y Fh(bfd_word)22 b(src_mask;)300 2471 -y Ff(The)11 b(dst)p 453 2471 V 16 w(mask)f(is)h(what)f(parts)g(of)g(the)h -(instruction)g(are)f(replaced)i(in)o(to)f(the)i(in-)300 2521 -y(struction.)19 b(In)c(most)e(cases)g(src)p 846 2521 V 17 w(mask)g(==)h(dst)p -1124 2521 V 17 w(mask,)f(except)h(in)h(the)e(ab)q(o)o(v)o(e)300 -2570 y(sp)q(ecial)25 b(case,)h(where)e(dst)p 780 2570 V 16 -w(mask)f(w)o(ould)h(b)q(e)g(0x000000\013,)f(and)h(src)p 1534 -2570 V 16 w(mask)300 2620 y(w)o(ould)17 b(b)q(e)f(0x00000000.)438 -2670 y Fh(bfd_word)22 b(dst_mask;)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 28 30 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(28)300 183 y Ff(When)18 -b(some)g(formats)e(create)i(PC)f(relativ)o(e)i(instructions,)g(they)f(lea)o -(v)o(e)g(the)300 233 y(v)m(alue)g(of)f(the)g(p)q(c)g(of)g(the)g(place)g(b)q -(eing)i(relo)q(cated)e(in)h(the)f(o\013set)f(slot)g(of)h(the)300 -283 y(instruction,)22 b(so)e(that)g(a)g(PC)g(relativ)o(e)h(relo)q(cation)h -(can)e(b)q(e)h(made)g(just)f(b)o(y)300 333 y(adding)15 b(in)f(an)g(ordinary)g -(o\013set)f(\(eg)g(sun3)h(a.out\).)k(Some)c(formats)e(lea)o(v)o(e)i(the)300 -382 y(displacemen)o(t)19 b(part)f(of)f(an)h(instruction)h(empt)o(y)f(\(eg)f -(m88k)g(b)q(cs\),)i(this)f(\015ag)300 432 y(signals)e(the)f(fact.)438 -482 y Fh(boolean)23 b(pcrel_offset;)390 532 y(})h(reloc_howto_type;)0 -677 y Fr(2.7.0.3)30 b(HO)n(WTO)300 770 y Fm(The)15 b(HO)o(WTO)h(de\014ne)g -(is)g(horrible)g(and)g(will)g(go)f(a)o(w)o(a)o(y)l(.)300 808 -y Fg(\013)p 325 808 1326 2 v 1325 w(\010)p 300 1057 2 225 v -314 895 a Fh(#define)23 b(HOWTO\(C,)g(R,S,B,)g(P,)g(BI,)h(ABS,)f(O,)h(SF,)f -(NAME,)g(INPLACE,)314 945 y(MASKSRC,)g(MASKDST,)g(PC\))g(\\)362 -994 y({\(unsigned\)C,R,S,B,)e(P,)j(BI,)f(ABS,O,SF,NAME,INPLACE,MASKS)o -(RC,MASKD)o(ST,PC})p 1988 1004 21 42 v 1677 1057 2 225 v 300 -1082 a Fg(\012)p 325 1082 1326 2 v 1325 w(\011)0 1277 y Fr(2.7.0.4)30 -b(relo)r(c)p 339 1277 19 3 v 21 w(c)n(hain)300 1336 y Fg(\013)p -325 1336 1326 2 v 1325 w(\010)p 300 1784 2 424 v 314 1422 a -Fh(typedef)23 b(unsigned)g(char)g(bfd_byte;)314 1522 y(typedef)g(struct)g -(relent_chain)f({)362 1572 y(arelent)h(relent;)362 1622 y(struct)71 -b(relent_chain)22 b(*next;)314 1672 y(})i(arelent_chain;)p -1677 1784 V 300 1809 a Fg(\012)p 325 1809 1326 2 v 1325 w(\011)300 -1923 y Fm(If)e(an)f(output)p 558 1923 14 2 v 16 w(bfd)h(is)g(supplied)i(to)d -(this)h(function)g(the)f(generated)h(image)300 1973 y(will)16 -b(b)q(e)e(relo)q(catable,)h(the)f(relo)q(cations)g(are)g(copied)h(to)e(the)h -(output)g(\014le)h(after)300 2022 y(they)g(ha)o(v)o(e)f(b)q(een)i(c)o(hanged) -f(to)g(re\015ect)g(the)g(new)g(state)f(of)g(the)h(w)o(orld.)20 -b(There)300 2072 y(are)15 b(t)o(w)o(o)g(w)o(a)o(ys)f(of)h(re\015ecting)i(the) -f(results)g(of)f(partial)h(link)m(age)h(in)g(an)e(output)300 -2122 y(\014le;)22 b(b)o(y)d(mo)q(difying)h(the)g(output)f(data)f(in)i(place,) -h(and)e(b)o(y)g(mo)q(difying)i(the)300 2172 y(relo)q(cation)h(record.)38 -b(Some)21 b(nativ)o(e)g(formats)f(\(eg)h(basic)h(a.out)e(and)h(basic)300 -2222 y(co\013)t(\))14 b(ha)o(v)o(e)h(no)g(w)o(a)o(y)f(of)h(sp)q(ecifying)i -(an)f(addend)g(in)g(the)f(relo)q(cation)h(t)o(yp)q(e,)f(so)300 -2271 y(the)f(addend)h(has)e(to)g(go)h(in)g(the)g(output)g(data.)19 -b(This)14 b(is)g(no)g(big)h(deal)f(since)h(in)300 2321 y(these)g(formats)e -(the)i(output)f(data)g(slot)g(will)j(alw)o(a)o(ys)d(b)q(e)h(big)g(enough)g -(for)f(the)300 2371 y(addend.)30 b(Complex)19 b(relo)q(c)g(t)o(yp)q(es)f -(with)g(addends)h(w)o(ere)f(in)o(v)o(en)o(ted)h(to)f(solv)o(e)300 -2421 y(just)d(this)h(problem.)390 2471 y Fh(PROTO\(bfd_reloc_status_enu)o -(m_type,)772 2521 y(bfd_perform_relocation,)963 2570 y(\(bfd)23 -b(*)h(abfd,)963 2620 y(arelent)f(*reloc_entry,)963 2670 y(PTR)g(data,)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 29 31 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(29)963 183 y Fh(asection)22 -b(*input_section,)963 233 y(bfd)h(*output_bfd\)\);)0 2770 y -Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 30 32 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(30)0 183 y Fn(2.8)33 -b(Core)21 b(\014les)300 275 y Fm(Bu\013)15 b(output)g(this)h(facinating)g -(topic)0 407 y Fr(2.8.0.1)30 b(bfd)p 296 407 19 3 v 22 w(core)p -429 407 V 22 w(\014le)p 530 407 V 22 w(failing)p 717 407 V -21 w(command)300 499 y Fm(Returns)22 b(a)g(read-only)h(string)e(explaining)k -(what)c(program)g(w)o(as)g(running)300 549 y(when)16 b(it)f(failed)i(and)e -(pro)q(duced)h(the)g(core)f(\014le)h(b)q(eing)g(read)390 598 -y Fh(PROTO\(CONST)22 b(char)i(*,)f(bfd_core_file_failing_comman)o(d,)390 -648 y(\(bfd)g(*\)\);)0 781 y Fr(2.8.0.2)30 b(bfd)p 296 781 -V 22 w(core)p 429 781 V 22 w(\014le)p 530 781 V 22 w(failing)p -717 781 V 21 w(signal)300 872 y Fm(Returns)17 b(the)f(signal)h(n)o(um)o(b)q -(er)g(whic)o(h)g(caused)g(the)f(core)h(dump)g(whic)o(h)g(gen-)300 -922 y(erated)e(the)g(\014le)i(the)e(bfd)g(is)h(attatc)o(hed)e(to.)390 -972 y Fh(PROTO\(int,)22 b(bfd_core_file_failing_signal,)e(\(bfd)k(*\)\);)0 -1105 y Fr(2.8.0.3)30 b(core)p 320 1105 V 22 w(\014le)p 421 -1105 V 22 w(matc)n(hes)p 659 1105 V 23 w(executable)p 964 1105 -V 22 w(p)300 1196 y Fm(Returns)15 b Fh(true)g Fm(if)g(the)g(core)g(\014le)h -(attatc)o(hed)e(to)h Ff(core)p 1214 1196 14 2 v 16 w(bfd)i -Fm(w)o(as)d(generated)h(b)o(y)300 1246 y(a)g(run)g(of)g(the)g(executable)i -(\014le)f(attatc)o(hed)e(to)h Ff(exec)p 1194 1246 V 17 w(bfd)p -Fm(,)g(or)g(else)h Fh(false)p Fm(.)390 1296 y Fh(PROTO\(boolean,)22 -b(core_file_matches_executab)o(le_p,)485 1346 y(\(bfd)i(*core_bfd,)e(bfd)i -(*exec_bfd\)\);)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 -b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 31 33 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(31)0 183 y Fn(2.9)33 -b(T)-6 b(argets)300 276 y Fm(Eac)o(h)17 b(p)q(ort)g(of)g(BFD)g(to)f(a)h -(di\013eren)o(t)h(mac)o(hine)g(requries)g(the)f(creation)g(of)g(a)300 -325 y(target)11 b(bac)o(k)g(end.)20 b(All)13 b(the)f(bac)o(k)g(end)g(pro)o -(vides)h(to)e(the)h(ro)q(ot)f(part)g(of)h(bfd)g(is)g(a)300 -375 y(structure)h(con)o(taining)i(p)q(oin)o(ters)f(to)f(functions)h(whic)o(h) -h(p)q(erform)e(certain)h(lo)o(w)300 425 y(lev)o(el)k(op)q(erations)e(on)g -(\014les.)25 b(BFD)15 b(translates)h(the)h(applications's)g(requests)300 -475 y(through)e(a)g(p)q(oin)o(ter)g(in)o(to)h(calls)g(to)e(the)i(bac)o(k)f -(end)h(routines.)300 538 y(When)e(a)g(\014le)h(is)f(op)q(ened)h(with)f -Fh(bfd_openr)p Fm(,)f(its)h(format)e(and)i(target)f(are)g(un-)300 -588 y(kno)o(wn.)19 b(BFD)12 b(uses)i(v)m(arious)f(mec)o(hanisms)h(to)e -(determine)i(ho)o(w)e(to)h(in)o(terpret)300 638 y(the)i(\014le.)21 -b(The)16 b(op)q(eratios)f(p)q(erformed)g(are:)337 701 y Fq(\017)30 -b Fm(First)17 b(a)g(bfd)h(is)g(created)g(b)o(y)f(calling)i(the)f(in)o(ternal) -g(routine)32 b Fh(new_bfd)p Fm(,)390 751 y(then)15 b Fh(bfd_find_target)f -Fm(is)h(called)i(with)e(the)h(target)d(string)j(supplied)390 -800 y(to)f Fh(bfd_openr)e Fm(and)j(the)f(new)h(bfd)f(p)q(oin)o(ter.)337 -864 y Fq(\017)30 b Fm(If)21 b(a)f(n)o(ull)h(target)e(string)i(w)o(as)e(pro)o -(vided)i(to)51 b Fh(bfd_find_target)p Fm(,)19 b(it)390 914 -y(lo)q(oks)d(up)h(the)f(en)o(vironmen)o(t)g(v)m(ariable)23 -b Fh(GNUTARGET)15 b Fm(and)i(uses)f(that)f(as)390 963 y(the)g(target)f -(string.)337 1027 y Fq(\017)30 b Fm(If)12 b(the)h(target)e(string)h(is)g -(still)i(NULL,)f(or)e(the)i(target)e(string)h(is)g Fh(default)p -Fm(,)390 1076 y(then)h(the)f(\014rst)g(item)g(in)h(the)g(target)e(v)o(ector)g -(is)i(used)g(as)f(the)g(target)f(t)o(yp)q(e.)390 1126 y(See)16 -b Fq(h)p Fm(unde\014ned)p Fq(i)g Fm([targets],)d(page)i Fq(h)p -Fm(unde\014ned)p Fq(i)p Fm(.)337 1189 y Fq(\017)30 b Fm(Otherwise,)19 -b(the)e(elemen)o(ts)h(in)h(the)e(target)g(v)o(ector)f(are)h(insp)q(ected)j -(one)390 1239 y(b)o(y)f(one,)h(un)o(til)g(a)f(matc)o(h)f(on)h(target)f(name)h -(is)h(found.)32 b(When)19 b(found,)390 1289 y(that)14 b(is)i(used.)337 -1352 y Fq(\017)30 b Fm(Otherwise)15 b(the)f(error)g Fh(invalid_target)e -Fm(is)j(returned)f(to)g Fh(bfd_openr)p Fm(.)337 1415 y Fq(\017)30 -b Fh(bfd_openr)13 b Fm(attempts)g(to)g(op)q(en)i(the)f(\014le)h(using)g -Fh(bfd_open_file)p Fm(,)d(and)390 1465 y(returns)j(the)g(bfd.)300 -1528 y(Once)e(the)g(bfd)f(has)g(b)q(een)i(op)q(ened)f(and)g(the)f(target)f -(selected,)j(the)e(\014le)h(format)300 1578 y(ma)o(y)j(b)q(e)h(determined.)26 -b(This)17 b(is)g(done)g(b)o(y)g(calling)27 b Fh(bfd_check_format)14 -b Fm(on)300 1628 y(the)f(bfd)h(with)g(a)f(suggested)g(format.)18 -b(The)13 b(routine)h(returns)f Fh(true)g Fm(when)h(the)300 -1678 y(application)j(guesses)e(righ)o(t.)0 1819 y Fr(2.9.0.1)30 -b(bfd)p 296 1819 19 3 v 22 w(target)0 1990 y(2.9.1)g(bfd)p -248 1990 V 22 w(target)300 2082 y Fm(This)16 b(structure)f(con)o(tains)h(ev)o -(erything)g(that)f(BFD)g(kno)o(ws)g(ab)q(out)g(a)h(target.)300 -2132 y(It)g(includes)i(things)f(lik)o(e)g(its)f(b)o(yte)f(order,)h(name,)g -(what)f(routines)h(to)g(call)h(to)300 2181 y(do)e(v)m(arious)h(op)q -(erations,)f(etc.)300 2245 y(Ev)o(ery)g(BFD)g(p)q(oin)o(ts)g(to)g(a)g(target) -f(structure)h(with)g(its)g Fh(")p Fm(xv)o(ec)p Fh(")g Fm(mem)o(b)q(er.)300 -2308 y(Shortcut)f(for)g(declaring)h(\014elds)h(whic)o(h)f(are)f(protot)o(yp)q -(ed)g(function)h(p)q(oin)o(ters,)300 2358 y(while)i(a)o(v)o(oiding)e(anguish) -h(on)f(compilers)i(that)d(don't)h(supp)q(ort)g(protos.)390 -2408 y Fh(#define)23 b(SDEF\(ret,)g(name,)g(arglist\))f(\\)772 -2457 y(PROTO\(ret,\(*name\),arglist)o(\))390 2507 y(#define)h(SDEF_FMT\(ret,) -f(name,)h(arglist\))g(\\)772 2557 y(PROTO\(ret,\(*name[bfd_type)o(_end]\),)o -(arglist)o(\))p 2026 2567 21 42 v 300 2620 a Fm(These)34 b(macros)e(are)h -(used)g(to)g(dispatc)o(h)h(to)e(functions)i(through)f(the)300 -2670 y(bfd)p 367 2670 14 2 v 17 w(target)21 b(v)o(ector.)40 -b(They)22 b(are)g(used)h(in)g(a)f(n)o(um)o(b)q(er)g(of)g(macros)f(further)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 32 34 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(32)300 183 y Fm(do)o(wn)19 -b(in)h(bfd.h,)h(and)e(are)g(also)g(used)h(when)g(calling)h(v)m(arious)f -(routines)g(b)o(y)300 233 y(hand)e(inside)i(the)e(bfd)g(implemen)o(tation.)29 -b(The)18 b Fh(")p Fm(arglist)p Fh(")g Fm(argumen)o(t)f(m)o(ust)300 -283 y(b)q(e)12 b(paren)o(thesized;)i(it)e(con)o(tains)g(all)h(the)e(argumen)o -(ts)g(to)g(the)h(called)h(function.)390 333 y Fh(#define)23 -b(BFD_SEND\(bfd,)f(message,)h(arglist\))g(\\)748 382 y -(\(\(*\(\(bfd\)->xvec->message\)\))d(arglist\))300 447 y Fm(F)l(or)15 -b(op)q(erations)g(whic)o(h)h(index)g(on)g(the)f(bfd)g(format)390 -497 y Fh(#define)23 b(BFD_SEND_FMT\(bfd,)e(message,)i(arglist\))g(\\)676 -547 y(\(\(\(bfd\)->xvec->message[\(int\)\()o(\(bfd\)->)o(format\))o(]\))p -2050 557 21 42 v 390 597 a(arglist\))300 662 y Fm(This)15 b(is)f(the)h -(struct)e(whic)o(h)i(de\014nes)g(the)g(t)o(yp)q(e)f(of)g(BFD)f(this)i(is.)20 -b(The)14 b Fh(")p Fm(xv)o(ec)p Fh(")300 711 y Fm(mem)o(b)q(er)f(of)f(the)h -(struct)g(bfd)g(itself)h(p)q(oin)o(ts)f(here.)19 b(Eac)o(h)13 -b(mo)q(dule)h(that)e(imple-)300 761 y(men)o(ts)j(access)g(to)g(a)g -(di\013eren)o(t)g(target)f(under)i(BFD,)e(de\014nes)j(one)e(of)g(these.)300 -826 y(FIXME,)i(these)h(names)g(should)h(b)q(e)f(rationalised)h(with)g(the)f -(names)f(of)h(the)300 876 y(en)o(try)e(p)q(oin)o(ts)i(whic)o(h)f(call)h -(them.)25 b(T)l(o)q(o)16 b(bad)h(w)o(e)g(can't)f(ha)o(v)o(e)h(one)g(macro)f -(to)300 926 y(de\014ne)g(them)f(b)q(oth!)390 976 y Fh(typedef)23 -b(struct)g(bfd_target)390 1025 y({)300 1090 y Ff(iden)o(ti\014es)17 -b(the)e(kind)h(of)f(target,)f(eg)h(SunOS4,)h(Ultrix,)f(etc)438 -1140 y Fh(char)23 b(*name;)300 1205 y Ff(The)11 b Fh(")p Ff(\015a)o(v)o(our)p -Fh(")g Ff(of)f(a)h(bac)o(k)g(end)h(is)g(a)f(general)g(indication)i(ab)q(out)e -(the)h(con)o(ten)o(ts)300 1255 y(of)j(a)g(\014le.)438 1304 -y Fh(enum)23 b(target_flavour_enum)e({)485 1354 y -(bfd_target_aout_flavour_enum,)485 1404 y(bfd_target_coff_flavour_enum,)485 -1454 y(bfd_target_ieee_flavour_enum,)485 1504 y -(bfd_target_oasys_flavour_enum)o(,)485 1554 y(bfd_target_srec_flavour_enum})f -(flavour;)300 1618 y Ff(The)15 b(order)g(of)g(b)o(ytes)g(within)h(the)g(data) -e(area)h(of)g(a)g(\014le.)438 1668 y Fh(boolean)23 b(byteorder_big_p;)300 -1733 y Ff(The)15 b(order)g(of)g(b)o(ytes)g(within)h(the)g(header)f(parts)g -(of)g(a)g(\014le.)438 1783 y Fh(boolean)23 b(header_byteorder_big_p;)300 -1848 y Ff(This)c(is)f(a)g(mask)g(of)g(all)h(the)f(\015ags)g(whic)o(h)h(an)f -(executable)i(ma)o(y)d(ha)o(v)o(e)h(set)g(-)300 1897 y(from)c(the)i(set)f -Fh(NO_FLAGS)p Ff(,)e Fh(HAS_RELOC)p Ff(,)h(...)p Fh(D_PAGED)p -Ff(.)438 1947 y Fh(flagword)22 b(object_flags;)300 2012 y Ff(This)c(is)g(a)f -(mask)f(of)h(all)i(the)e(\015ags)g(whic)o(h)h(a)f(section)h(ma)o(y)e(ha)o(v)o -(e)h(set)g(-)h(from)300 2062 y(the)d(set)g Fh(SEC_NO_FLAGS)p -Ff(,)e Fh(SEC_ALLOC)p Ff(,)h(...)p Fh(SET_NEVER_LOAD)p Ff(.)438 -2112 y Fh(flagword)22 b(section_flags;)300 2177 y Ff(The)15 -b(pad)h(c)o(haracter)e(for)h(\014lenames)h(within)h(an)e(arc)o(hiv)o(e)g -(header.)438 2226 y Fh(char)23 b(ar_pad_char;)300 2291 y Ff(The)15 -b(maxim)o(um)h(n)o(um)o(b)q(er)f(of)g(c)o(haracters)f(in)i(an)f(arc)o(hiv)o -(e)h(header.)414 2341 y Fh(unsigned)23 b(short)g(ar_max_namelen;)300 -2406 y Ff(The)15 b(minim)o(um)i(alignmen)o(t)f(restriction)f(for)g(an)o(y)g -(section.)438 2456 y Fh(unsigned)22 b(int)i(align_power_min;)300 -2521 y Ff(En)o(tries)16 b(for)f(b)o(yte)h(sw)o(apping)g(for)g(data.)21 -b(These)16 b(are)g(di\013eren)o(t)g(to)f(the)h(other)300 2570 -y(en)o(try)j(p)q(oin)o(ts,)i(since)g(they)e(don't)g(tak)o(e)g(bfd)h(as)f -(\014rst)g(arg.)33 b(Certain)19 b(other)300 2620 y(handlers)f(could)e(do)f -(the)h(same.)438 2670 y Fh(SDEF)23 b(\(bfd_vma,)142 b(bfd_getx64,)22 -b(\(bfd_byte)h(*\)\);)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 33 35 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(33)438 183 y Fh(SDEF)23 -b(\(void,)214 b(bfd_putx64,)22 b(\(bfd_vma,)h(bfd_byte)390 -233 y(*\)\);)438 283 y(SDEF)g(\(bfd_vma,)g(bfd_getx32,)f(\(bfd_byte)h(*\)\);) -438 333 y(SDEF)g(\(void,)214 b(bfd_putx32,)22 b(\(bfd_vma,)h(bfd_byte)390 -382 y(*\)\);)438 432 y(SDEF)g(\(bfd_vma,)g(bfd_getx16,)f(\(bfd_byte)h(*\)\);) -438 482 y(SDEF)g(\(void,)214 b(bfd_putx16,)22 b(\(bfd_vma,)h(bfd_byte)390 -532 y(*\)\);)300 600 y Ff(Byte)15 b(sw)o(apping)h(for)e(the)i(headers)438 -650 y Fh(SDEF)23 b(\(bfd_vma,)70 b(bfd_h_getx64,)22 b(\(bfd_byte)h(*\)\);)438 -700 y(SDEF)g(\(void,)238 b(bfd_h_putx64,)22 b(\(bfd_vma,)h(bfd_byte)p -2002 710 21 42 v 390 749 a(*\)\);)438 799 y(SDEF)g(\(bfd_vma,)47 -b(bfd_h_getx32,)22 b(\(bfd_byte)g(*\)\);)438 849 y(SDEF)h(\(void,)238 -b(bfd_h_putx32,)22 b(\(bfd_vma,)h(bfd_byte)p 2002 859 V 390 -899 a(*\)\);)438 949 y(SDEF)g(\(bfd_vma,)47 b(bfd_h_getx16,)22 -b(\(bfd_byte)g(*\)\);)438 998 y(SDEF)h(\(void,)238 b(bfd_h_putx16,)22 -b(\(bfd_vma,)h(bfd_byte)p 2002 1009 V 390 1048 a(*\)\);)300 -1116 y Ff(F)l(ormat)17 b(dep)q(enden)o(t)i(routines,)g(these)g(turn)f(in)o -(to)g(v)o(ectors)f(of)h(en)o(try)g(p)q(oin)o(ts)300 1166 y(within)e(the)g -(target)e(v)o(ector)g(structure;)h(one)g(for)g(eac)o(h)g(format)f(to)g(c)o -(hec)o(k.)300 1234 y(Chec)o(k)h(the)h(format)e(of)g(a)h(\014le)h(b)q(eing)h -(read.)j(Return)15 b(bfd)p 1288 1234 14 2 v 17 w(target)f(*)h(or)g(zero.)438 -1284 y Fh(SDEF_FMT)22 b(\(struct)h(bfd_target)g(*,)g(_bfd_check_format,)390 -1334 y(\(bfd)g(*\)\);)300 1402 y Ff(Set)15 b(the)h(format)d(of)i(a)g(\014le)h -(b)q(eing)h(written.)438 1452 y Fh(SDEF_FMT)22 b(\(boolean,)286 -b(_bfd_set_format,)21 b(\(bfd)390 1501 y(*\)\);)300 1569 y -Ff(W)l(rite)15 b(cac)o(hed)h(information)f(in)o(to)h(a)f(\014le)h(b)q(eing)g -(written,)f(at)g(bfd)p 1441 1569 V 16 w(close.)438 1619 y Fh(SDEF_FMT)22 -b(\(boolean,)286 b(_bfd_write_contents,)390 1669 y(\(bfd)23 -b(*\)\);)300 1737 y Ff(The)15 b(follo)o(wing)g(functions)g(are)f(de\014ned)h -(in)g Fh(JUMP_TABLE)p Ff(.)j(The)d(idea)g(is)i(that)300 1787 -y(the)e(bac)o(k)h(end)g(writer)f(of)h Fh(foo)f Ff(names)g(all)h(the)g -(routines)i Fh(foo_)p Ff(en)o(try)p 1506 1787 V 16 w(p)q(oin)o(t,)300 -1837 y Fh(JUMP_TABLE)12 b Ff(will)j(built)g(the)f(en)o(tries)i(in)e(this)g -(structure)f(in)i(the)e(righ)o(t)h(order.)300 1905 y(Core)h(\014le)h(en)o -(try)f(p)q(oin)o(ts)438 1954 y Fh(SDEF)23 b(\(char)g(*,)h -(_core_file_failing_comman)o(d,)d(\(bfd)i(*\)\);)438 2004 y(SDEF)g(\(int,)95 -b(_core_file_failing_signal)o(,)21 b(\(bfd)i(*\)\);)438 2054 -y(SDEF)g(\(boolean,)g(_core_file_matches_execu)o(table_p)o(,)e(\(bfd)390 -2104 y(*,)j(bfd)f(*\)\);)300 2172 y Ff(Arc)o(hiv)o(e)16 b(en)o(try)f(p)q(oin) -o(ts)414 2222 y Fh(SDEF)23 b(\(boolean,)g(_bfd_slurp_armap,)e(\(bfd)j(*\)\);) -414 2271 y(SDEF)f(\(boolean,)g(_bfd_slurp_extended_name_)o(table,)d(\(bfd)390 -2321 y(*\)\);)414 2371 y(SDEF)j(\(void,)71 b(_bfd_truncate_arname,)21 -b(\(bfd)i(*,)h(CONST)390 2421 y(char)f(*,)h(char)f(*\)\);)414 -2471 y(SDEF)g(\(boolean,)g(write_armap,)f(\(bfd)h(*arch,)1106 -2521 y(unsigned)g(int)g(elength,)1106 2570 y(struct)g(orl)g(*map,)1106 -2620 y(int)g(orl_count,)1106 2670 y(int)g(stridx\)\);)0 2770 -y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 34 36 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(34)300 183 y Ff(Standard)i -(stu\013.)438 233 y Fh(SDEF)23 b(\(boolean,)g(_close_and_cleanup,)e(\(bfd)i -(*\)\);)438 283 y(SDEF)g(\(boolean,)g(_bfd_set_section_content)o(s,)e(\(bfd)i -(*,)390 333 y(sec_ptr,)g(PTR,)1440 382 y(file_ptr,)390 432 -y(bfd_size_type\)\);)438 482 y(SDEF)g(\(boolean,)g(_bfd_get_section_content)o -(s,)e(\(bfd)i(*,)390 532 y(sec_ptr,)g(PTR,)1440 582 y(file_ptr,)390 -632 y(bfd_size_type\)\);)438 681 y(SDEF)g(\(boolean,)g(_new_section_hook,)e -(\(bfd)i(*,)h(sec_ptr\)\);)300 777 y Ff(Sym)o(b)q(ols)16 b(and)f(relo)q -(ctions)414 827 y Fh(SDEF)23 b(\(unsigned)g(int,)g(_get_symtab_upper_bound,)e -(\(bfd)390 877 y(*\)\);)438 927 y(SDEF)i(\(unsigned)g(int,)g -(_bfd_canonicalize_symtab,)652 976 y(\(bfd)h(*,)f(struct)g -(symbol_cache_entry)f(**\)\);)438 1026 y(SDEF)h(\(unsigned)g(int,)g -(_get_reloc_upper_bound,)e(\(bfd)390 1076 y(*,)j(sec_ptr\)\);)438 -1126 y(SDEF)f(\(unsigned)g(int,)g(_bfd_canonicalize_reloc,)e(\(bfd)390 -1176 y(*,)j(sec_ptr,)e(arelent)h(**,)1512 1225 y(struct)390 -1275 y(symbol_cache_entry**\)\);)438 1325 y(SDEF)g(\(struct)g -(symbol_cache_entry)45 b(*,)24 b(_bfd_make_empty_symbol,)p -2146 1335 21 42 v 390 1375 a(\(bfd)f(*\)\);)438 1425 y(SDEF)g(\(void,)119 -b(_bfd_print_symbol,)21 b(\(bfd)i(*,)h(PTR,)f(struct)p 2026 -1435 V 390 1474 a(symbol_cache_entry)45 b(*,)1297 1524 y -(bfd_print_symbol_enum_typ)o(e\)\);)p 2289 1534 V 390 1574 -a(#define)23 b(bfd_print_symbol\(b,p,s,e\))d(BFD_SEND\(b,)j -(_bfd_print_symbol,)p 2217 1584 V 390 1624 a(\(b,p,s,e\)\))438 -1674 y(SDEF)g(\(alent)g(*,)71 b(_get_lineno,)23 b(\(bfd)g(*,)h(struct)f(sym-) -390 1724 y(bol_cache_entry)46 b(*\)\);)438 1823 y(SDEF)23 b(\(boolean,)70 -b(_bfd_set_arch_mach,)22 b(\(bfd)h(*,)h(enum)390 1873 y(bfd_architecture,) -1321 1923 y(unsigned)e(long\)\);)p 2002 1933 V 438 2022 a(SDEF)h(\(bfd)g(*,) -48 b(openr_next_archived_file,)20 b(\(bfd)k(*arch,)390 2072 -y(bfd)f(*prev\)\);)438 2122 y(SDEF)g(\(boolean,)g(_bfd_find_nearest_line,)581 -2172 y(\(bfd)g(*abfd,)g(struct)g(sec)48 b(*section,)605 2222 -y(struct)23 b(symbol_cache_entry)45 b(**symbols,bfd_vma)390 -2271 y(offset,)581 2321 y(CONST)23 b(char)g(**file,)g(CONST)g(char)h(**func,) -f(unsigned)390 2371 y(int)g(*line\)\);)438 2421 y(SDEF)g(\(int,)95 -b(_bfd_stat_arch_elt,)21 b(\(bfd)i(*,)h(struct)390 2471 y(stat)f(*\)\);)438 -2570 y(SDEF)g(\(int,)95 b(_bfd_sizeof_headers,)21 b(\(bfd)i(*,)h -(boolean\)\);)p 2002 2576 21 38 v 438 2670 a(SDEF)f(\(void,)g -(_bfd_debug_info_start,)e(\(bfd)i(*\)\);)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s) -36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 35 37 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(35)438 183 y Fh(SDEF)23 -b(\(void,)g(_bfd_debug_info_end,)e(\(bfd)j(*\)\);)438 233 y(SDEF)f(\(void,)g -(_bfd_debug_info_accumulate,)d(\(bfd)k(*,)f(struct)p 2026 243 -21 42 v 390 283 a(sec)47 b(*\)\);)300 345 y Ff(Sp)q(ecial)17 -b(en)o(try)e(p)q(oin)o(ts)h(for)e(gdb)i(to)e(sw)o(ap)h(in)h(co\013)e(sym)o(b) -q(ol)i(table)g(parts)438 395 y Fh(SDEF\(void,)22 b(_bfd_coff_swap_aux_in,\() -557 445 y(bfd)286 b(*abfd)23 b(,)557 495 y(PTR)310 b(ext,)557 -544 y(int)g(type,)557 594 y(int)g(class)23 b(,)557 644 y(PTR)310 -b(in\)\);)438 744 y(SDEF\(void,)22 b(_bfd_coff_swap_sym_in,\()557 -793 y(bfd)286 b(*abfd)23 b(,)557 843 y(PTR)310 b(ext,)557 893 -y(PTR)g(in\)\);)438 993 y(SDEF\(void,)22 b(_bfd_coff_swap_lineno_in,)45 -b(\()557 1043 y(bfd)286 b(*abfd,)557 1092 y(PTR)g(ext,)557 -1142 y(PTR)310 b(in\)\);)390 1242 y(})24 b(bfd_target;)0 1375 -y Fr(2.9.1.1)30 b(bfd)p 296 1375 19 3 v 22 w(\014nd)p 420 1375 -V 22 w(target)300 1466 y Fm(Returns)15 b(a)f(p)q(oin)o(ter)h(to)f(the)h -(transfer)f(v)o(ector)g(for)g(the)g(ob)s(ject)g(target)g(named)300 -1516 y(target)p 423 1516 14 2 v 15 w(name.)26 b(If)18 b(target)p -751 1516 V 15 w(name)f(is)h(NULL,)g(c)o(ho)q(oses)f(the)g(one)h(in)g(the)f -(en)o(vi-)300 1566 y(ronmen)o(t)f(v)m(ariable)i(GNUT)l(AR)o(GET;)e(if)h(that) -g(is)g(n)o(ull)h(or)e(not)h(de\014ned)h(then)300 1615 y(the)d(\014rst)g(en)o -(try)g(in)h(the)f(target)f(list)i(is)g(c)o(hosen.)k(P)o(assing)15 -b(in)h(the)f(string)h Fh(")p Fm(de-)300 1665 y(fault)p Fh(")d -Fm(or)f(setting)h(the)g(en)o(vironmen)o(t)g(v)m(ariable)i(to)d -Fh(")p Fm(default)p Fh(")h Fm(will)i(cause)e(the)300 1715 y(\014rst)k(en)o -(try)h(in)h(the)f(target)e(list)j(to)e(b)q(e)h(returned,)h(and)f -Fh(")p Fm(target)p 1431 1715 V 15 w(defaulted)p Fh(")300 1765 -y Fm(will)f(b)q(e)g(set)e(in)i(the)e(bfd.)22 b(This)16 b(causes)g(bfd)p -1062 1765 V 17 w(c)o(hec)o(k)p 1186 1765 V 17 w(format)e(to)h(lo)q(op)h(o)o -(v)o(er)f(all)300 1815 y(the)g(targets)f(to)h(\014nd)h(the)f(one)g(that)g -(matc)o(hes)g(the)g(\014le)h(b)q(eing)g(read.)390 1864 y Fh -(PROTO\(bfd_target)22 b(*,)h(bfd_find_target,\(CONST)e(char)i(*,)390 -1914 y(bfd)g(*\)\);)0 2047 y Fr(2.9.1.2)30 b(bfd)p 296 2047 -19 3 v 22 w(target)p 480 2047 V 21 w(list)300 2138 y Fm(This)15 -b(function)f(returns)g(a)g(freshly)g(mallo)q(ced)i(NULL-terminated)f(v)o -(ector)e(of)300 2188 y(the)i(names)g(of)g(all)h(the)g(v)m(alid)g(bfd)g -(targets.)j(Do)14 b(not)h(mo)q(dify)h(the)f(names)390 2238 -y Fh(PROTO\(CONST)22 b(char)i(**,bfd_target_list,\(\)\);)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 36 38 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(36)0 183 y Fn(2.10)32 -b(Arc)n(hitectures)300 436 y Fm(BFD's)15 b(idea)i(of)f(an)g(arc)o(hitecture)h -(is)f(implimen)o(ted)j(in)k Fh(archures.c)p Fm(.)e(BFD)300 -486 y(k)o(eeps)h(t)o(w)o(o)f(atoms)g(in)i(a)e(bfd)i(describing)h(the)e(arc)o -(hitecture)g(of)g(the)g(data)300 535 y(attatc)o(hed)c(to)h(the)g(bfd,)h(the) -43 b Fh(enum)15 b(bfd_architecture)e(arch)18 b Fm(\014eld)j(and)300 -585 y(the)15 b Fh(unsigned)f(long)h(machine)f Fm(\014eld.)0 -2168 y Fr(2.10.0.1)29 b(bfd)p 326 2168 19 3 v 22 w(arc)n(hitecture)300 -2421 y Fm(This)14 b(en)o(um)f(giv)o(es)g(the)g(ob)s(ject)g(\014le's)g(CPU)g -(arc)o(hitecture,)h(in)f(a)g(global)h(sense.)300 2471 y(E.g.)40 -b(what)21 b(pro)q(cessor)h(family)g(do)q(es)h(it)f(b)q(elong)h(to?)41 -b(There)22 b(is)g(another)300 2521 y(\014eld,)14 b(whic)o(h)g(indicates)g -(what)e(pro)q(cessor)g(within)i(the)f(family)h(is)f(in)g(use.)20 -b(The)300 2570 y(mac)o(hine)d(giv)o(es)e(a)h(n)o(um)o(b)q(er)g(whic)o(h)g -(distingushes)i(di\013eren)o(t)e(v)o(ersions)g(of)f(the)300 -2620 y(arc)o(hitecture,)j(con)o(taining)g(for)f(example)h(2)f(and)g(3)g(for)g -(In)o(tel)h(i960)f(KA)h(and)300 2670 y(i960)d(KB,)g(and)h(68020)d(and)j -(68030)e(for)g(Motorola)g(68020)g(and)h(68030.)0 2770 y Fk(c)6 -b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 -2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 37 39 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(37)300 26 y Fg(\013)p -325 26 1326 2 v 1325 w(\010)p 300 1968 2 1918 v 314 112 a Fh(enum)23 -b(bfd_architecture)314 162 y({)362 212 y(bfd_arch_unknown,)69 -b(/*)24 b(File)f(arch)g(not)h(known)f(*/)362 262 y(bfd_arch_obscure,)69 -b(/*)24 b(Arch)f(known,)g(not)h(one)f(of)h(these)f(*/)362 311 -y(bfd_arch_m68k,)141 b(/*)24 b(Motorola)e(68xxx)i(*/)362 361 -y(bfd_arch_vax,)165 b(/*)24 b(DEC)f(Vax)h(*/)362 411 y(bfd_arch_i960,)141 -b(/*)24 b(Intel)f(960)g(*/)410 461 y(/*)g(The)h(order)f(of)g(the)h(following) -e(is)i(important.)481 511 y(lower)f(number)g(indicates)g(a)h(machine)f(type)g -(that)481 560 y(only)g(accepts)g(a)h(subset)f(of)h(the)f(instructions)481 -610 y(available)g(to)g(machines)g(with)g(higher)h(numbers.)481 -660 y(The)g(exception)e(is)i(the)f("ca",)g(which)h(is)481 710 -y(incompatible)e(with)i(all)f(other)g(machines)g(except)481 -760 y("core".)g(*/)314 859 y(#define)g(bfd_mach_i960_core)141 -b(1)314 909 y(#define)23 b(bfd_mach_i960_ka_sa)117 b(2)314 -959 y(#define)23 b(bfd_mach_i960_kb_sb)117 b(3)314 1009 y(#define)23 -b(bfd_mach_i960_mc)189 b(4)314 1059 y(#define)23 b(bfd_mach_i960_xa)189 -b(5)314 1108 y(#define)23 b(bfd_mach_i960_ca)189 b(6)362 1208 -y(bfd_arch_a29k,)141 b(/*)24 b(AMD)f(29000)g(*/)362 1258 y(bfd_arch_sparc,) -117 b(/*)24 b(SPARC)f(*/)362 1308 y(bfd_arch_mips,)141 b(/*)24 -b(MIPS)f(Rxxxx)g(*/)362 1357 y(bfd_arch_i386,)141 b(/*)24 b(Intel)f(386)g(*/) -362 1407 y(bfd_arch_ns32k,)117 b(/*)24 b(National)e(Semiconductor)h(32xxx)g -(*/)362 1457 y(bfd_arch_tahoe,)117 b(/*)24 b(CCI/Harris)e(Tahoe)h(*/)362 -1507 y(bfd_arch_i860,)141 b(/*)24 b(Intel)f(860)g(*/)362 1557 -y(bfd_arch_romp,)141 b(/*)24 b(IBM)f(ROMP)g(RS/6000)g(*/)362 -1606 y(bfd_arch_alliant,)69 b(/*)24 b(Alliant)f(*/)362 1656 -y(bfd_arch_convex,)93 b(/*)24 b(Convex)f(*/)362 1706 y(bfd_arch_m88k,)141 -b(/*)24 b(Motorola)e(88xxx)i(*/)362 1756 y(bfd_arch_pyramid,)69 -b(/*)24 b(Pyramid)f(Technology)f(*/)362 1806 y(bfd_arch_h8_300,)93 -b(/*)24 b(Hitachi)f(H8/300)g(*/)362 1856 y(bfd_arch_last)362 -1905 y(};)p 1677 1968 V 300 1993 a Fg(\012)p 325 1993 1326 -2 v 1325 w(\011)300 2118 y Fm(stu\013)0 2367 y Fr(2.10.0.2)29 -b(bfd)p 326 2367 19 3 v 22 w(prinable)p 567 2367 V 23 w(arc)n(h)p -704 2367 V 22 w(mac)n(h)300 2471 y Fm(Return)d(a)g(prin)o(table)h(string)e -(represen)o(ting)i(the)e(arc)o(hitecture)h(and)g(ma-)300 2521 -y(c)o(hine)34 b(t)o(yp)q(e.)71 b(The)33 b(result)g(is)g(only)g(go)q(o)q(d)f -(un)o(til)i(the)e(next)h(call)h(to)300 2570 y(bfd)p 367 2570 -14 2 v 17 w(prin)o(table)p 561 2570 V 17 w(arc)o(h)p 663 2570 -V 16 w(mac)o(h.)390 2620 y Fh(PROTO\(CONST)22 b(char)i -(*,bfd_printable_arch_mac)o(h,)485 2670 y(\(enum)g(bfd_architecture)d(arch,)i -(unsigned)g(long)h(machine\)\);)p 2050 2680 21 42 v 0 2770 -a Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 38 40 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(38)0 183 y Fr(2.10.0.3)29 -b(bfd)p 326 183 19 3 v 22 w(scan)p 463 183 V 23 w(arc)n(h)p -600 183 V 22 w(mac)n(h)300 275 y Fm(Scan)20 b(a)e(string)i(and)f(attempt)f -(to)h(turn)g(it)g(in)o(to)g(an)g(arc)o(hiv)o(e)h(and)f(mac)o(hine)300 -324 y(t)o(yp)q(e)c(com)o(bination.)390 374 y Fh(PROTO\(boolean,)22 -b(bfd_scan_arch_mach,)485 424 y(\(CONST)h(char)h(*,)f(enum)h -(bfd_architecture)d(*,)j(unsigned)390 474 y(long)f(*\)\);)0 -607 y Fr(2.10.0.4)29 b(bfd)p 326 607 V 22 w(arc)n(h)p 462 607 -V 23 w(compatible)300 698 y Fm(This)17 b(routine)h(is)f(used)h(to)e -(determine)i(whether)f(t)o(w)o(o)f(BFDs')g(arc)o(hitectures)300 -748 y(and)22 b(mac)o(hine)g(t)o(yp)q(es)g(are)f(compatible.)40 -b(It)22 b(calculates)g(the)g(lo)o(w)o(est)f(com-)300 798 y(mon)15 -b(denominator)h(b)q(et)o(w)o(een)g(the)g(t)o(w)o(o)e(arc)o(hitectures)i(and)g -(mac)o(hine)g(t)o(yp)q(es)300 847 y(implied)22 b(b)o(y)e(the)g(bfds)g(and)g -(sets)g(the)g(ob)s(jects)f(p)q(oin)o(ted)i(at)e(b)o(y)h Ff(arc)o(hp)h -Fm(and)300 897 y Ff(mac)o(hine)e Fm(if)c(non)h(NULL.)300 959 -y(This)g(routine)h(returns)i Fh(true)c Fm(if)i(the)f(bfds)g(are)f(of)h -(compatible)h(t)o(yp)q(e,)e(other-)300 1009 y(wise)h Fh(false)p -Fm(.)390 1059 y Fh(PROTO\(boolean,)22 b(bfd_arch_compatible,)509 -1109 y(\(bfd)i(*abfd,)509 1159 y(bfd)g(*bbfd,)509 1209 y(enum)g -(bfd_architecture)d(*archp,)509 1258 y(unsigned)i(long)g(*machinep\)\);)0 -1391 y Fr(2.10.0.5)29 b(bfd)p 326 1391 V 22 w(set)p 424 1391 -V 22 w(arc)n(h)p 560 1391 V 23 w(mac)n(h)300 1483 y Fm(Set)15 -b(atc)o(h)g(mac)o(h)300 1512 y Fg(\013)p 325 1512 1326 2 v -1325 w(\010)p 300 1761 2 225 v 314 1599 a Fh(#define)23 b -(bfd_set_arch_mach\(abfd,)e(arch,)i(mach\))g(\\)433 1649 y(BFD_SEND)g -(\(abfd,)g(_bfd_set_arch_mach,\\)791 1698 y(\(abfd,)g(arch,)h(mach\)\))p -1677 1761 V 300 1786 a Fg(\012)p 325 1786 1326 2 v 1325 w(\011)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 39 41 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(39)0 183 y Fn(2.11)32 -b(Op)r(ening)23 b(and)g(Closing)f(BFDs)0 358 y Fr(2.11.0.1)29 -b(bfd)p 326 358 19 3 v 22 w(op)r(enr)300 451 y Fm(Op)q(ens)22 -b(the)g(\014le)g(supplied)i(\(using)d(fop)q(en\))h(with)g(the)f(target)f -(supplied,)25 b(it)300 501 y(returns)15 b(a)g(p)q(oin)o(ter)h(to)e(the)h -(created)h(bfd.)300 564 y(If)h(NULL)h(is)g(returned)g(then)f(an)g(error)f -(has)h(o)q(ccured.)27 b(P)o(ossible)18 b(errors)e(are)300 614 -y(no)p 351 614 14 2 v 16 w(memory)l(,)f(in)o(v)m(alid)p 681 -614 V 18 w(target)f(or)h(system)p 1025 614 V 16 w(call)h(error.)390 -664 y Fh(PROTO\(bfd*,)22 b(bfd_openr,)h(\(CONST)g(char)g(*filename,CONST)390 -714 y(char*target\)\);)0 860 y Fr(2.11.0.2)29 b(bfd)p 326 860 -19 3 v 22 w(fdop)r(enr)300 952 y Fm(bfd)p 367 952 14 2 v 17 -w(fdop)q(enr)17 b(is)g(to)g(bfd)p 721 952 V 16 w(fop)q(enr)h(m)o(uc)o(h)e -(lik)o(e)i(fdop)q(en)g(is)f(to)f(fop)q(en.)26 b(It)16 b(op)q(ens)300 -1002 y(a)f(bfd)g(on)h(a)e(\014le)j(already)e(describ)q(ed)i(b)o(y)e(the)h -Ff(fd)h Fm(supplied.)300 1066 y(P)o(ossible)f(errors)f(are)f(no)p -730 1066 V 17 w(memory)l(,)g(in)o(v)m(alid)p 1060 1066 V 19 -w(target)g(and)h(system)p 1437 1066 V 16 w(call)i(error.)414 -1116 y Fh(PROTO\(bfd)22 b(*,)i(bfd_fdopenr,)485 1165 y(\(CONST)f(char)h -(*filename,)e(CONST)h(char)h(*target,)f(int)390 1215 y(fd\)\);)0 -1361 y Fr(2.11.0.3)29 b(bfd)p 326 1361 19 3 v 22 w(op)r(en)n(w)300 -1454 y Fm(Creates)21 b(a)g(bfd,)i(asso)q(ciated)f(with)g(\014le)h -Ff(\014lename)p Fm(,)h(using)e(the)g(\014le)g(format)300 1504 -y Ff(target)p Fm(,)14 b(and)h(returns)g(a)g(p)q(oin)o(ter)h(to)e(it.)300 -1567 y(P)o(ossible)i(errors)f(are)f(system)p 818 1567 14 2 -v 16 w(call)p 901 1567 V 18 w(error,)g(no)p 1091 1567 V 16 -w(memory)l(,)h(in)o(v)m(alid)p 1421 1567 V 19 w(target.)390 -1617 y Fh(PROTO\(bfd)23 b(*,)g(bfd_openw,)g(\(CONST)g(char)g(*filename,)g -(CONST)390 1667 y(char)g(*target\)\);)0 1813 y Fr(2.11.0.4)29 -b(bfd)p 326 1813 19 3 v 22 w(close)300 1906 y Fm(This)21 b(function)h(closes) -f(a)g(bfd.)36 b(If)21 b(the)g(bfd)g(w)o(as)f(op)q(en)h(for)f(writing,)j(then) -300 1955 y(p)q(ending)13 b(op)q(erations)f(are)f(completed)h(and)g(the)g -(\014le)g(written)g(out)f(and)g(closed.)300 2005 y(If)18 b(the)f(created)g -(\014le)i(is)e(executable,)i(then)30 b Fh(chmod)17 b Fm(is)h(called)h(to)d -(mark)h(it)g(as)300 2055 y(suc)o(h.)300 2119 y(All)f(memory)f(attatc)o(hed)f -(to)h(the)g(bfd's)g(obstac)o(ks)g(is)g(released.)300 2182 y -Fh(true)g Fm(is)g(returned)h(if)g(all)g(is)f(ok,)g(otherwise)g -Fh(false)p Fm(.)390 2232 y Fh(PROTO\(boolean,)22 b(bfd_close,\(bfd)g(*\)\);)0 -2378 y Fr(2.11.0.5)29 b(bfd)p 326 2378 V 22 w(create)300 2471 -y Fm(This)23 b(routine)f(creates)g(a)f(new)i(bfd)f(in)h(the)f(manner)g(of)g -(bfd)p 1406 2471 14 2 v 16 w(op)q(en)o(w,)i(but)300 2521 y(without)14 -b(op)q(ening)g(a)g(\014le.)20 b(The)14 b(new)g(bfd)g(tak)o(es)f(the)g(target) -g(from)f(the)i(target)300 2570 y(used)i(b)o(y)f Ff(template)p -Fm(.)20 b(The)15 b(format)f(is)i(alw)o(a)o(ys)e(set)h(to)g -Fh(bfd_object)p Fm(.)390 2620 y Fh(PROTO\(bfd)23 b(*,)g(bfd_create,)g -(\(CONST)g(char)g(*filename,)f(bfd)390 2670 y(*template\)\);)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 40 42 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(40)0 183 y Fr(2.11.0.6)29 -b(bfd)p 326 183 19 3 v 22 w(allo)r(c)p 472 183 V 22 w(size)300 -275 y Fm(Return)12 b(the)f(n)o(um)o(b)q(er)h(of)f(b)o(ytes)g(in)h(the)f -(obstac)o(ks)f(connected)j(to)d(the)i(supplied)300 324 y(bfd.)390 -374 y Fh(PROTO\(bfd_size_type,bfd_al)o(loc_siz)o(e,\(bfd)21 -b(*abfd\)\);)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g -(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 41 43 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(41)0 183 y Fr(2.11.1.7)29 -b(bfd)p 326 183 19 3 v 22 w(put)p 440 183 V 22 w(size)0 497 -y(2.11.1.8)g(bfd)p 326 497 V 22 w(get)p 431 497 V 22 w(size)300 -605 y Fm(These)17 b(macros)f(as)g(used)i(for)e(reading)h(and)g(writing)g(ra)o -(w)f(data)g(in)i(sections;)300 655 y(eac)o(h)e(access)f(\(except)h(for)e(b)o -(ytes\))h(is)h(v)o(ectored)f(through)h(the)f(target)f(format)300 -705 y(of)21 b(the)g(bfd)g(and)g(mangled)h(accordingly)l(.)39 -b(The)21 b(mangling)h(p)q(erforms)e(an)o(y)300 754 y(necessary)15 -b(endian)i(translations)e(and)g(remo)o(v)o(es)g(alignmen)o(t)h(restrictions.) -300 793 y Fg(\013)p 325 793 1326 2 v 1325 w(\010)p 300 1689 -2 872 v 314 879 a Fh(#define)23 b(bfd_put_8\(abfd,)f(val,)h(ptr\))g(\\)696 -929 y(\(*\(\(char)g(*\)ptr\))g(=)g(\(char\)val\))314 979 y(#define)g -(bfd_get_8\(abfd,)f(ptr\))h(\\)696 1029 y(\(*\(\(char)g(*\)ptr\)\))314 -1079 y(#define)g(bfd_put_16\(abfd,)f(val,)h(ptr\))g(\\)696 -1129 y(BFD_SEND\(abfd,)f(bfd_putx16,)g(\(val,ptr\)\))314 1178 -y(#define)h(bfd_get_16\(abfd,)f(ptr\))h(\\)696 1228 y(BFD_SEND\(abfd,)f -(bfd_getx16,)g(\(ptr\)\))314 1278 y(#define)h(bfd_put_32\(abfd,)f(val,)h -(ptr\))g(\\)696 1328 y(BFD_SEND\(abfd,)f(bfd_putx32,)g(\(val,ptr\)\))314 -1378 y(#define)h(bfd_get_32\(abfd,)f(ptr\))h(\\)696 1427 y(BFD_SEND\(abfd,)f -(bfd_getx32,)g(\(ptr\)\))314 1477 y(#define)h(bfd_put_64\(abfd,)f(val,)h -(ptr\))g(\\)696 1527 y(BFD_SEND\(abfd,)f(bfd_putx64,)g(\(val,)h(ptr\)\))314 -1577 y(#define)g(bfd_get_64\(abfd,)f(ptr\))h(\\)696 1627 y(BFD_SEND\(abfd,)f -(bfd_getx64,)g(\(ptr\)\))p 1677 1689 V 300 1715 a Fg(\012)p -325 1715 1326 2 v 1325 w(\011)0 2049 y Fr(2.11.1.9)29 b(bfd)p -326 2049 19 3 v 22 w(h)p 382 2049 V 22 w(put)p 496 2049 V 23 -w(size)0 2363 y(2.11.1.10)g(bfd)p 357 2363 V 22 w(h)p 413 2363 -V 22 w(get)p 518 2363 V 22 w(size)300 2471 y Fm(These)16 b(macros)e(ha)o(v)o -(e)h(the)g(same)g(function)h(as)f(their)g Fh(bfd_get_x)f Fm(bretherin,)300 -2521 y(except)19 b(that)f(they)h(are)f(used)h(for)f(remo)o(ving)h -(information)g(for)f(the)h(header)300 2570 y(records)c(of)g(ob)s(ject)g -(\014les.)22 b(Believ)o(e)17 b(it)f(or)f(not,)g(some)g(ob)s(ject)g(\014les)i -(k)o(eep)e(their)300 2620 y(header)21 b(records)f(in)h(big)g(endian)h(order,) -f(and)g(their)g(data)e(in)j(little)f(endan)300 2670 y(order.)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 42 44 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(42)300 26 y Fg(\013)p -325 26 1326 2 v 1325 w(\010)p 300 922 2 872 v 314 112 a Fh(#define)23 -b(bfd_h_put_8\(abfd,)f(val,)h(ptr\))g(\\)696 162 y(\(*\(\(char)g(*\)ptr\))g -(=)g(\(char\)val\))314 212 y(#define)g(bfd_h_get_8\(abfd,)f(ptr\))h(\\)696 -262 y(\(*\(\(char)g(*\)ptr\)\))314 311 y(#define)g(bfd_h_put_16\(abfd,)e -(val,)j(ptr\))f(\\)696 361 y(BFD_SEND\(abfd,)f(bfd_h_putx16,\(val,ptr\)\))314 -411 y(#define)h(bfd_h_get_16\(abfd,)e(ptr\))j(\\)696 461 y(BFD_SEND\(abfd,)e -(bfd_h_getx16,\(ptr\)\))314 511 y(#define)h(bfd_h_put_32\(abfd,)e(val,)j -(ptr\))f(\\)696 560 y(BFD_SEND\(abfd,)f(bfd_h_putx32,\(val,ptr\)\))314 -610 y(#define)h(bfd_h_get_32\(abfd,)e(ptr\))j(\\)696 660 y(BFD_SEND\(abfd,)e -(bfd_h_getx32,\(ptr\)\))314 710 y(#define)h(bfd_h_put_64\(abfd,)e(val,)j -(ptr\))f(\\)696 760 y(BFD_SEND\(abfd,)f(bfd_h_putx64,\(val,)f(ptr\)\))314 -809 y(#define)i(bfd_h_get_64\(abfd,)e(ptr\))j(\\)696 859 y(BFD_SEND\(abfd,)e -(bfd_h_getx64,\(ptr\)\))p 1677 922 V 300 947 a Fg(\012)p 325 -947 1326 2 v 1325 w(\011)0 1130 y Fr(2.11.1.11)29 b(bfd)p 357 -1130 19 3 v 22 w(log2)300 1221 y Fm(Return)17 b(the)g(log)f(base)h(2)f(of)g -(the)h(v)m(alue)h(supplied,)g(rounded)g(up.)24 b(eg)16 b(an)h(arg)300 -1271 y(of)e(1025)f(w)o(ould)h(return)h(11.)390 1321 y Fh(PROTO\(bfd_vma,)22 -b(bfd_log2,\(bfd_vma)f(x\)\);)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 43 45 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(43)0 183 y Fn(2.12)32 -b(File)24 b(Cac)n(hing)300 276 y Fm(The)14 b(\014le)h(cac)o(hing)f(mec)o -(hanism)h(is)f(em)o(b)q(edded)h(within)h(BFD)d(and)h(allo)o(ws)g(the)300 -326 y(application)k(to)e(op)q(en)g(as)g(man)o(y)g(bfds)h(as)f(it)g(w)o(an)o -(ts)f(without)h(regard)g(to)g(the)300 376 y(underlying)21 b(op)q(erating)e -(system's)f(\014le)i(descriptor)f(limit)i(\(often)d(as)h(lo)o(w)f(as)300 -425 y(20)d(op)q(en)g(\014les\).)300 489 y(The)33 b(mo)q(dule)h(in)140 -b Fh(cache.c)32 b Fm(main)o(tains)h(a)g(least)g(recen)o(tly)g(used)300 -539 y(list)f(of)124 b Fh(BFD_CACHE_MAX_OPEN)29 b Fm(\014les,)35 -b(and)c(exp)q(orts)g(the)g(name)300 589 y Fh(bfd_cache_lookup)24 -b Fm(whic)o(h)i(runs)g(around)g(and)g(mak)o(es)f(sure)h(that)f(the)300 -638 y(required)18 b(bfd)f(is)g(op)q(en.)25 b(If)17 b(not,)f(then)h(it)g(c)o -(ho)q(oses)f(a)h(\014le)g(to)f(close,)h(closes)h(it)300 688 -y(and)d(op)q(ens)h(the)f(one)h(w)o(an)o(ted,)e(returning)i(its)f(\014le)h -(handle.)0 833 y Fr(2.12.0.1)29 b(BFD)p 369 833 19 3 v 22 w(CA)n(CHE)p -611 833 V 23 w(MAX)p 784 833 V 23 w(OPEN)300 926 y Fm(The)19 -b(maxium)o(um)g(n)o(um)o(b)q(er)g(of)g(\014les)h(whic)o(h)f(the)g(cac)o(he)g -(will)i(k)o(eep)e(op)q(en)h(at)300 976 y(one)15 b(time.)300 -1005 y Fg(\013)p 325 1005 1326 2 v 1325 w(\010)p 300 1154 2 -125 v 314 1092 a Fh(#define)23 b(BFD_CACHE_MAX_OPEN)e(10)p -1677 1154 V 300 1180 a Fg(\012)p 325 1180 1326 2 v 1325 w(\011)0 -1375 y Fr(2.12.0.2)29 b(bfd)p 326 1375 19 3 v 22 w(last)p 443 -1375 V 22 w(cac)n(he)300 1467 y Fm(Zero,)15 b(or)h(a)f(p)q(oin)o(ter)i(to)e -(the)h(topmost)f(bfd)h(on)g(the)g(c)o(hain.)23 b(This)17 b(is)f(used)h(b)o(y) -300 1517 y(the)h(bfd)p 448 1517 14 2 v 17 w(cac)o(he)p 572 -1517 V 17 w(lo)q(okup\(\))g(macro)f(in)i(libbfd.h)h(to)d(determine)i(when)g -(it)f(can)300 1567 y(a)o(v)o(oid)d(a)g(function)h(call.)300 -1597 y Fg(\013)p 325 1597 1326 2 v 1325 w(\010)p 300 1745 2 -125 v 314 1683 a Fh(extern)23 b(bfd)h(*bfd_last_cache;)p 1677 -1745 V 300 1771 a Fg(\012)p 325 1771 1326 2 v 1325 w(\011)0 -1966 y Fr(2.12.0.3)29 b(bfd)p 326 1966 19 3 v 22 w(cac)n(he)p -492 1966 V 23 w(lo)r(okup)300 2058 y Fm(Chec)o(ks)11 b(to)g(see)h(if)f(the)h -(required)g(bfd)g(is)g(the)f(same)g(as)g(the)g(last)h(one)f(lo)q(ok)o(ed)h -(up.)300 2108 y(If)17 b(so)e(then)i(it)g(can)f(use)h(the)f(iostream)g(in)h -(the)f(bfd)h(with)g(impunit)o(y)l(,)g(since)h(it)300 2158 y(can't)13 -b(ha)o(v)o(e)f(c)o(hanged)i(since)g(the)f(last)g(lo)q(okup,)h(otherwise)f(it) -h(has)f(to)f(p)q(erform)300 2208 y(the)j(complicated)i(lo)q(okup)f(function) -300 2247 y Fg(\013)p 325 2247 1326 2 v 1325 w(\010)p 300 2594 -2 324 v 314 2333 a Fh(#define)23 b(bfd_cache_lookup\(x\))e(\\)433 -2383 y(\(\(x\)==bfd_last_cache?)g(\\)505 2433 y -(\(FILE*\)\(bfd_last_cache->io)o(stream\):)f(\\)529 2482 y -(bfd_cache_lookup_worker\(x)o(\)\))p 1677 2594 V 300 2620 a -Fg(\012)p 325 2620 1326 2 v 1325 w(\011)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s) -36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 44 46 -bop 0 -58 a Fk(Chapter)13 b(2:)k(BFD)c(front)g(end)p 413 -66 -669 3 v 691 w(DRAFT)p 1224 -66 V 695 w Fj(44)0 183 y Fr(2.12.0.4)29 -b(bfd)p 326 183 19 3 v 22 w(cac)n(he)p 492 183 V 23 w(init)300 -275 y Fm(Initialize)18 b(a)d(BFD)g(b)o(y)g(putting)h(it)f(on)g(the)g(cac)o -(he)h(LR)o(U.)390 324 y Fh(PROTO\(void,)22 b(bfd_cache_init,)g(\(bfd)h -(*\)\);)0 457 y Fr(2.12.0.5)29 b(bfd)p 326 457 V 22 w(cac)n(he)p -492 457 V 23 w(close)300 549 y Fm(Remo)o(v)o(e)18 b(the)g(bfd)g(from)f(the)h -(cac)o(he.)28 b(If)18 b(the)g(attatc)o(hed)f(\014le)i(is)g(op)q(en,)g(then) -300 598 y(close)d(it)f(to)q(o.)390 648 y Fh(PROTO\(void,)22 -b(bfd_cache_close,)g(\(bfd)h(*\)\);)0 781 y Fr(2.12.0.6)29 -b(bfd)p 326 781 V 22 w(op)r(en)p 477 781 V 22 w(\014le)300 -872 y Fm(Call)13 b(the)f(OS)g(to)f(op)q(en)i(a)f(\014le)h(for)e(this)h(BFD.)f -(Returns)i(the)f(FILE)g(*)g(\(p)q(ossibly)300 922 y(n)o(ull\))g(that)f -(results)h(from)e(this)i(op)q(eration.)19 b(Sets)11 b(up)h(the)f(BFD)g(so)g -(that)g(future)300 972 y(accesses)18 b(kno)o(w)e(the)i(\014le)g(is)g(op)q -(en.)26 b(If)18 b(the)f(FILE)h(*)e(returned)i(is)g(n)o(ull,)h(then)300 -1022 y(there)h(is)h(w)o(on't)d(ha)o(v)o(e)i(b)q(een)h(put)f(in)h(the)f(cac)o -(he,)h(so)e(it)i(w)o(on't)d(ha)o(v)o(e)i(to)f(b)q(e)300 1072 -y(remo)o(v)o(ed)c(from)f(it.)390 1121 y Fh(PROTO\(FILE)22 b(*,)i -(bfd_open_file,)e(\(bfd)h(*\)\);)0 1254 y Fr(2.12.0.7)29 b(bfd)p -326 1254 V 22 w(cac)n(he)p 492 1254 V 23 w(lo)r(okup)p 696 -1254 V 22 w(w)n(ork)n(er)300 1346 y Fm(Called)23 b(when)f(the)f(macro)59 -b Fh(bfd_cache_lookup)19 b Fm(fails)j(to)f(\014nd)h(a)f(quic)o(k)300 -1395 y(answ)o(er.)31 b(Finds)20 b(a)f(\014le)i(descriptor)e(for)g(this)h -(BFD.)e(If)i(necessary)l(,)g(it)f(op)q(en)300 1445 y(it.)28 -b(If)19 b(there)f(are)f(already)h(more)g(than)g(BFD)p 1106 -1445 14 2 v 16 w(CA)o(CHE)p 1286 1445 V 16 w(MAX)p 1412 1445 -V 16 w(OPEN)g(\014les)300 1495 y(op)q(en,)13 b(it)f(trys)f(to)g(close)h(one)g -(\014rst,)g(to)f(a)o(v)o(oid)h(running)g(out)g(of)f(\014le)i(descriptors.)390 -1545 y Fh(PROTO\(FILE)22 b(*,)i(bfd_cache_lookup_worker,)d(\(bfd)i(*\)\);)0 -2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 45 47 -bop 0 -58 a Fk(Chapter)13 b(3:)k(BFD)c(back)f(end)p 409 -66 -670 3 v 693 w(DRAFT)p 1222 -66 V 697 w Fj(45)0 183 y Fi(3)41 -b(BFD)27 b(bac)n(k)f(end)300 295 y Fm(All)16 b(of)f(bfd)h(liv)o(es)g(in)g -(one)f(directory)l(.)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 46 48 -bop 0 -58 a Fk(Chapter)13 b(3:)k(BFD)c(back)f(end)p 409 -66 -670 3 v 693 w(DRAFT)p 1222 -66 V 697 w Fj(46)0 183 y Fn(3.1)33 -b(a.out)21 b(bac)n(k)n(ends)300 278 y Fm(BFD)13 b(supp)q(orts)g(a)g(n)o(um)o -(b)q(er)h(of)f(di\013eren)o(t)g(\015a)o(v)o(ours)g(of)g(a.out)f(format,)g -(though)300 328 y(the)h(ma)s(jor)e(di\013erences)j(are)f(only)g(the)g(sizes)h -(of)f(the)g(structures)f(on)h(disk,)h(and)300 378 y(the)h(shap)q(e)h(of)f -(the)g(relo)q(cation)h(information.)300 444 y(The)f(supp)q(ort)f(is)h(split)h -(in)o(to)e(a)g(basic)h(supp)q(ort)g(\014le)g Fh(aoutx.h)e Fm(and)i(other)f -(\014les)300 494 y(whic)o(h)e(deriv)o(e)h(functions)f(from)f(the)h(base.)18 -b(One)13 b(deriv)m(ation)f(\014le)h(is)f Fh(aoutf1.h)300 544 -y Fm(\(for)k(a.out)g(\015a)o(v)o(our)g(1\),)h(and)g(adds)g(to)f(the)h(basic)h -(a.out)e(functions)i(supp)q(ort)300 593 y(for)12 b(sun3,)h(sun4,)f(386)g(and) -h(29k)e(a.out)h(\014les,)i(to)d(create)i(a)f(target)f(jump)i(v)o(ector)300 -643 y(for)i(a)f(sp)q(eci\014c)k(target.)300 709 y(This)e(information)g(is)h -(further)e(split)i(out)f(in)o(to)g(more)f(sp)q(eci\014c)j(\014les)f(for)e -(eac)o(h)300 759 y(mac)o(hine,)j(including)30 b Fh(sunos.c)16 -b Fm(-)h(for)f(sun3)h(and)g(sun4)g(and)28 b Fh(demo64)16 b -Fm(for)g(a)300 809 y(demonstration)f(of)g(a)g(64)f(bit)i(a.out)e(format.)300 -875 y(The)k(base)g(\014le)34 b Fh(aoutx.h)16 b Fm(de\014nes)j(general)f(mec)o -(hanisms)g(for)g(reading)g(and)300 925 y(writing)f(records)g(to)f(and)h(from) -f(disk,)i(and)f(v)m(arious)g(other)f(metho)q(ds)h(whic)o(h)300 -975 y(bfd)f(requires.)23 b(It)15 b(is)i(included)h(b)o(y)i -Fh(aout32.c)14 b Fm(and)20 b Fh(aout64.c)15 b Fm(to)g(form)g(the)300 -1024 y(names)31 b(aout)p 547 1024 14 2 v 16 w(32)p 609 1024 -V 16 w(sw)o(ap)p 723 1024 V 16 w(exec)p 823 1024 V 17 w(header)p -971 1024 V 16 w(in,)36 b(aout)p 1162 1024 V 16 w(64)p 1224 -1024 V 16 w(sw)o(ap)p 1338 1024 V 16 w(exec)p 1438 1024 V 17 -w(header)p 1586 1024 V 16 w(in,)300 1074 y(etc.)300 1140 y(As)13 -b(an)f(example,)i(this)f(is)g(what)f(go)q(es)h(on)f(to)g(mak)o(e)g(the)h(bac) -o(k)g(end)g(for)f(a)g(sun4,)300 1190 y(from)i(aout32.c)462 -1240 y Fh(#define)22 b(ARCH_SIZE)h(32)462 1290 y(#include)f("aoutx.h")390 -1356 y Fm(Whic)o(h)16 b(exp)q(orts)f(names:)115 b Fh(...)462 -1406 y(aout_32_canonicalize_re)o(loc)462 1455 y(aout_32_find_nearest_li)o(ne) -462 1505 y(aout_32_get_lineno)462 1555 y(aout_32_get_reloc_upper)o(_bound)509 -1605 y(...)300 1671 y Fm(from)14 b(sunos.c)485 1721 y Fh(#define)23 -b(ARCH)h(32)485 1771 y(#define)f(TARGET_NAME)g("a.out-sunos-big")485 -1820 y(#define)g(VECNAME)95 b(sunos_big_vec)485 1870 y(#include)23 -b("aoutf1.h")300 1936 y Fm(requires)16 b(all)g(the)f(names)h(from)e -(aout32.c,)f(and)j(pro)q(duces)g(the)f(jump)h(v)o(ector)485 -1986 y Fh(sunos_big_vec)0 2153 y Fr(3.1.1)30 b(relo)r(cations)300 -2248 y Fm(The)17 b(\014le)29 b Fh(aoutx.h)16 b Fm(caters)h(for)f(b)q(oth)h -(the)g Ff(standard)i Fm(and)e Ff(extended)j Fm(forms)300 2298 -y(of)15 b(a.out)f(relo)q(cation)i(records.)300 2364 y(The)21 -b(standard)f(records)h(are)f(c)o(haracterised)h(b)o(y)g(con)o(taining)g(only) -g(an)g(ad-)300 2414 y(dress,)16 b(a)g(sym)o(b)q(ol)g(index)i(and)e(a)g(t)o -(yp)q(e)g(\014eld.)24 b(The)17 b(extended)g(records)f(\(used)300 -2463 y(on)f(29ks)g(and)g(sparcs\))g(also)g(ha)o(v)o(e)g(a)g(full)h(in)o -(teger)f(for)g(an)g(addend.)0 2630 y Fr(3.1.2)30 b(In)n(ternal)20 -b(En)n(try)i(P)n(oin)n(ts)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 47 49 -bop 0 -58 a Fk(Chapter)13 b(3:)k(BFD)c(back)f(end)p 409 -66 -670 3 v 693 w(DRAFT)p 1222 -66 V 697 w Fj(47)324 183 y Fh(aoutx.h)18 -b Fm(exp)q(orts)h(sev)o(eral)g(routines)h(for)f(accessing)g(the)h(con)o(ten)o -(ts)e(of)h(an)300 233 y(a.out)12 b(\014le,)h(whic)o(h)h(are)e(gathered)g(and) -h(exp)q(orted)g(in)g(turn)g(b)o(y)f(v)m(arious)h(format)300 -283 y(sp)q(eci\014c)k(\014les)f(\(eg)f(sunos.c\).)0 417 y Fr(3.1.2.1)30 -b(aout)p 328 417 19 3 v 21 w Fo(<)p Fr(size)p Fo(>)p 501 417 -V 23 w Fr(sw)n(ap)p 654 417 V 23 w(exec)p 792 417 V 22 w(header)p -993 417 V 23 w(in)300 509 y Fm(Sw)o(aps)11 b(the)h(information)f(in)i(an)e -(executable)i(header)f(tak)o(en)f(from)f(a)i(ra)o(w)e(b)o(yte)300 -559 y(stream)k(memory)h(image,)g(in)o(to)g(the)g(in)o(ternal)h(exec)p -1194 559 14 2 v 17 w(header)g(structure.)390 608 y Fh(PROTO\(void,)22 -b(aout__swap_exec_header_)o(in,)533 658 y(\(bfd)h(*abfd,)533 -708 y(struct)g(external_exec)f(*raw_bytes,)533 758 y(struct)h(internal_exec)f -(*execp\)\);)0 892 y Fr(3.1.2.2)30 b(aout)p 328 892 19 3 v -21 w Fo(<)p Fr(size)p Fo(>)p 501 892 V 23 w Fr(sw)n(ap)p 654 -892 V 23 w(exec)p 792 892 V 22 w(header)p 993 892 V 23 w(out)300 -984 y Fm(Sw)o(aps)16 b(the)f(information)i(in)f(an)g(in)o(ternal)h(exec)f -(header)g(structure)g(in)o(to)g(the)300 1033 y(supplied)i(bu\013er)d(ready)g -(for)f(writing)i(to)f(disk.)390 1083 y Fh(PROTO\(void,)22 b -(aout__swap_exec_header_)o(out,)438 1133 y(\(bfd)h(*abfd,)462 -1183 y(struct)g(internal_exec)f(*execp,)462 1233 y(struct)h(external_exec)f -(*raw_bytes\)\);)0 1367 y Fr(3.1.2.3)30 b(aout)p 328 1367 V -21 w Fo(<)p Fr(size)p Fo(>)p 501 1367 V 23 w Fr(some)p 658 -1367 V 22 w(aout)p 799 1367 V 22 w(ob)s(ject)p 987 1367 V 22 -w(p)300 1459 y Fm(Some)11 b(A.OUT)f(v)m(arian)o(t)h(thinks)g(that)f(the)h -(\014le)h(whose)f(format)e(w)o(e're)h(c)o(hec)o(king)300 1508 -y(is)18 b(an)f(a.out)g(\014le.)28 b(Do)17 b(some)g(more)g(c)o(hec)o(king,)h -(and)g(set)f(up)h(for)f(access)h(if)g(it)300 1558 y(really)f(is.)k(Call)16 -b(bac)o(k)g(to)f(the)g(calling)j(en)o(vironmen)o(ts)e Fh(")p -Fm(\014nish)g(up)p Fh(")g Fm(function)300 1608 y(just)f(b)q(efore)g -(returning,)h(to)e(handle)j(an)o(y)e(last-min)o(ute)h(setup.)390 -1658 y Fh(PROTO\(bfd_target)22 b(*,)h(aout__some_aout_object)o(_p,)414 -1708 y(\(bfd)g(*abfd,)438 1757 y(bfd_target)f(*\(*callback_to_real_object_p)o -(\)\(\)\)\);)0 1892 y Fr(3.1.2.4)30 b(aout)p 328 1892 V 21 -w Fo(<)p Fr(size)p Fo(>)p 501 1892 V 23 w Fr(mk)n(ob)s(ject)300 -1983 y Fm(This)16 b(routine)f(initialize)q(s)j(a)d(bfd)g(for)g(use)g(with)h -(a.out)e(\014les.)390 2033 y Fh(PROTO\(boolean,)22 b(aout__mkobject,)f -(\(bfd)i(*\)\);)0 2167 y Fr(3.1.2.5)30 b(aout)p 328 2167 V -21 w Fo(<)p Fr(size)p Fo(>)p 501 2167 V 23 w Fr(mac)n(hine)p -743 2167 V 23 w(t)n(yp)r(e)300 2259 y Fm(Keep)22 b(trac)o(k)e(of)h(mac)o -(hine)h(arc)o(hitecture)g(and)f(mac)o(hine)h(t)o(yp)q(e)f(for)g(a.out's.)300 -2309 y(Return)39 b(the)f(mac)o(hine)p 744 2309 14 2 v 17 w(t)o(yp)q(e)h(for)e -(a)h(particular)h(arc)o(h&mac)o(hine,)44 b(or)300 2358 y(M)p -345 2358 V 16 w(UNKNO)o(WN)25 b(if)g(that)e(exact)h(arc)o(h&mac)o(hine)i -(can't)d(b)q(e)i(represen)o(ted)300 2408 y(in)16 b(a.out)e(format.)300 -2471 y(If)20 b(the)g(arc)o(hitecture)g(is)h(understo)q(o)q(d,)g(mac)o(hine)g -(t)o(yp)q(e)f(0)f(\(default\))h(should)300 2521 y(alw)o(a)o(ys)14 -b(b)q(e)i(understo)q(o)q(d.)390 2570 y Fh(PROTO\(enum)22 b(machine_type,)h -(aout__machine_typ)o(e,)414 2620 y(\(enum)g(bfd_architecture)f(arch,) -438 2670 y(unsigned)g(long)i(machine\)\);)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g -(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 -w(Revision:)17 b(1.5)p eop -%%Page: 48 50 -bop 0 -58 a Fk(Chapter)13 b(3:)k(BFD)c(back)f(end)p 409 -66 -670 3 v 693 w(DRAFT)p 1222 -66 V 697 w Fj(48)0 183 y Fr(3.1.2.6)30 -b(aout)p 328 183 19 3 v 21 w Fo(<)p Fr(size)p Fo(>)p 501 183 -V 23 w Fr(set)p 600 183 V 22 w(arc)n(h)p 736 183 V 23 w(mac)n(h)300 -275 y Fm(Sets)13 b(the)h(arc)o(hitecture)f(and)g(the)h(mac)o(hine)g(of)f(the) -g(bfd)h(to)e(those)h(v)m(alues)h(sup-)300 324 y(plied.)21 b(V)l(eri\014es)14 -b(that)e(the)h(format)e(can)i(supp)q(ort)g(the)g(arc)o(hitecture)g(required.) -390 374 y Fh(PROTO\(boolean,)22 b(aout__set_arch_mach,)414 -424 y(\(bfd)h(*,)438 474 y(enum)g(bfd_architecture,)438 524 -y(unsigned)f(long)i(machine\)\);)0 656 y Fr(3.1.2.7)30 b(aout)p -328 656 V 21 w Fo(<)p Fr(size)p Fo(>)p Fr(new)p 607 656 V 23 -w(section)p 815 656 V 23 w(ho)r(ok)300 748 y Fm(Called)16 b(b)o(y)g(the)f -(bfd)g(in)h(resp)q(onse)g(to)f(a)g Fh(bfd_make_section)e Fm(request.)390 -798 y Fh(PROTO\(boolean,)22 b(aout__new_section_ho)o(ok,)605 -847 y(\(bfd)h(*abfd,)438 897 y(asection)f(*newsect\)\);)0 2770 -y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 49 51 -bop 0 -58 a Fk(Chapter)13 b(3:)k(BFD)c(back)f(end)p 409 -66 -670 3 v 693 w(DRAFT)p 1222 -66 V 697 w Fj(49)0 183 y Fn(3.2)33 -b(co\013)22 b(bac)n(k)n(ends)300 275 y Fm(BFD)e(supp)q(orts)h(a)g(n)o(um)o(b) -q(er)g(of)g(di\013eren)o(t)g(\015a)o(v)o(ours)f(of)h(co\013)f(format.)36 -b(The)300 325 y(ma)s(jor)20 b(di\013erence)k(b)q(et)o(w)o(een)e(formats)e -(are)i(the)g(sizes)h(and)f(alignmen)o(ts)g(of)300 375 y(\014elds)16 -b(in)g(structures)f(on)g(disk,)h(and)f(the)h(o)q(ccasional)g(extra)e -(\014eld.)300 438 y(Co\013)i(in)h(all)h(its)f(v)m(arieties)h(is)f(implimen)o -(ted)i(with)e(a)f(few)h(common)f(\014les)i(and)300 488 y(a)j(n)o(um)o(b)q(er) -h(of)e(implemen)o(tation)j(sp)q(eci\014c)g(\014les.)39 b(F)l(or)21 -b(example,)i(The)f(88k)300 538 y(b)q(cs)d(co\013)g(format)e(is)j(implemen)o -(ted)g(in)g(the)f(\014le)42 b Fh(m88k-bcs.c)p Fm(.)30 b(This)19 -b(\014le)300 588 y Fh(#include)p Fm(s)29 b Fh(m88k-bcs.h)15 -b Fm(whic)o(h)k(de\014nes)f(the)f(external)h(structure)f(of)g(the)300 -637 y(co\013)k(format)f(for)g(the)i(88k,)f(and)58 b Fh(internalcoff.h)19 -b Fm(whic)o(h)k(de\014nes)f(the)300 687 y(in)o(ternal)f(structure.)68 -b Fh(m88k-bcs.c)19 b Fm(also)h(de\014nes)i(the)e(relo)q(cations)h(used)300 -737 y(b)o(y)16 b(the)h(88k)e(format)g(See)i(Section)g(2.7)f([Relo)q -(cations],)g(page)h(28.)22 b(Then)17 b(the)300 787 y(ma)s(jor)f(p)q(ortion)i -(of)f(co\013)g(co)q(de)h(is)g(included)i(\()14 b Fh(coffcode.h)p -Fm(\))i(whic)o(h)i(de\014nes)300 837 y(the)d(metho)q(ds)h(used)g(to)f(act)g -(up)q(on)h(the)f(t)o(yp)q(es)h(de\014ned)g(in)i Fh(m88k-bcs.h)c -Fm(and)300 886 y Fh(internalcoff.h)p Fm(.)300 950 y(The)j(In)o(tel)g(i960)f -(pro)q(cessor)g(v)o(ersion)g(of)g(co\013)g(is)h(implemen)o(ted)h(in)23 -b Fh(icoff.c)p Fm(.)300 999 y(This)g(\014le)g(has)f(the)g(same)f(structure)h -(as)63 b Fh(m88k-bcs.c)p Fm(,)22 b(except)g(that)g(it)300 1049 -y(includes)17 b Fh(intel-coff.h)d Fm(rather)h(than)g Fh(m88k-bcs.h)p -Fm(.)0 1190 y Fr(3.2.1)30 b(P)n(orting)20 b(T)-5 b(o)20 b(A)g(New)h(V)-5 -b(ersion)21 b(of)f(Co\013)300 1282 y Fm(The)14 b(recommended)g(metho)q(d)g -(is)g(to)f(select)h(from)f(the)h(existing)g(implimen)o(ta-)300 -1332 y(tions)d(the)g(v)o(ersion)h(of)e(co\013)h(whic)o(h)h(is)g(most)e(lik)o -(e)i(the)f(one)g(y)o(ou)g(w)o(an)o(t)f(to)h(use,)h(for)300 -1381 y(our)j(purp)q(oses,)h(w)o(e'll)g(sa)o(y)f(that)g(i386)g(co\013)g(is)h -(the)f(one)h(y)o(ou)f(select,)h(and)g(that)300 1431 y(y)o(our)f(co\013)g -(\015a)o(v)o(our)g(is)h(called)h(fo)q(o.)k(Cop)o(y)15 b(the)j -Fh(i386coff.c)c Fm(to)k Fh(foocoff.c)p Fm(,)300 1481 y(cop)o(y)k -Fh(../include/i386coff.h)14 b Fm(to)22 b Fh(../include/foocoff.h)13 -b Fm(and)k(add)300 1531 y(the)d(lines)i(to)d Fh(targets.c)g -Fm(and)i Fh(Makefile.in)d Fm(so)i(that)f(y)o(our)h(new)g(bac)o(k)g(end)300 -1581 y(is)i(used.)300 1644 y(Alter)d(the)h(shap)q(es)f(of)g(the)g(structures) -g(in)h Fh(../include/foocoff.h)c Fm(so)j(that)300 1694 y(they)21 -b(matc)o(h)f(what)g(y)o(ou)g(need.)38 b(Y)l(ou)21 b(will)h(probably)f(also)g -(ha)o(v)o(e)f(to)g(add)300 1743 y Fh(#ifdef)p Fm(s)d(to)h(the)g(co)q(de)g(in) -37 b Fh(internalcoff.h)16 b Fm(and)35 b Fh(coffcode.h)17 b -Fm(if)h(y)o(our)300 1793 y(v)o(ersion)d(of)g(co\013)g(is)g(to)q(o)g(wild.)300 -1856 y(Y)l(ou)21 b(can)f(v)o(erify)h(that)f(y)o(our)g(new)h(bfd)g(bac)o(k)o -(end)f(w)o(orks)g(quite)h(simply)h(b)o(y)300 1906 y(building)14 -b Fh(objdump)d Fm(from)g(the)g Fh(binutils)g Fm(directory)l(,)h(and)g(making) -g(sure)g(that)300 1956 y(its)i(v)o(ersion)g(of)g(what's)e(going)i(on)g(at)f -(y)o(our)h(host)f(systems)g(idea)i(\(assuming)f(it)300 2006 -y(has)j(the)f(prett)o(y)g(standard)g(co\013)g(dump)i(utilit)o(y)f(\(usually)h -(called)27 b Fh(att-dump)300 2055 y Fm(or)15 b(just)g Fh(dump)p -Fm(\)\))f(are)g(the)i(same.)300 2119 y(Then)21 b(clean)g(up)g(y)o(our)f(co)q -(de,)i(and)e(send)h(what)f(y)o(ou'v)o(e)f(done)i(to)f(Cygn)o(us.)300 -2168 y(Then)f(y)o(our)e(stu\013)h(will)i(b)q(e)f(in)g(the)f(next)g(release,)i -(and)e(y)o(ou)g(w)o(on't)f(ha)o(v)o(e)h(to)300 2218 y(k)o(eep)e(in)o -(tegrating)f(it.)0 2359 y Fr(3.2.2)30 b(Ho)n(w)21 b(The)f(Co\013)g(Bac)n(k)n -(end)h(W)-5 b(orks)0 2528 y(3.2.2.1)30 b(Bit)20 b(Twiddling)300 -2620 y Fm(Eac)o(h)c(\015a)o(v)o(our)f(of)g(co\013)h(supp)q(orted)g(in)h(bfd)f -(has)g(its)g(o)o(wn)f(header)h(\014le)h(descib-)300 2670 y(ing)i(the)f -(external)g(la)o(y)o(out)g(of)g(the)g(structures.)28 b(There)18 -b(is)h(also)f(an)g(in)o(ternal)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 50 52 -bop 0 -58 a Fk(Chapter)13 b(3:)k(BFD)c(back)f(end)p 409 -66 -670 3 v 693 w(DRAFT)p 1222 -66 V 697 w Fj(50)300 183 y Fm(description)18 -b(of)d(the)h(co\013)g(la)o(y)o(out)f(\(in)21 b Fh(internalcoff.h)p -Fm(\))14 b(\014le)j(\()5 b(\).)21 b(A)16 b(ma)s(jor)300 233 -y(function)f(of)f(the)g(co\013)f(bac)o(k)o(end)i(is)f(sw)o(apping)h(the)f(b)o -(ytes)g(and)g(t)o(widdling)i(the)300 283 y(bits)g(to)f(translate)g(the)g -(external)h(form)f(of)g(the)g(structures)g(in)o(to)g(the)h(normal)300 -333 y(in)o(ternal)f(form.)j(This)d(is)f(all)h(p)q(erformed)f(in)h(the)f -Fh(bfd_swap)p 1340 333 14 2 v 15 w Ff(thing)p 1462 333 V 21 -w(direction)300 382 y Fm(routines.)19 b(Some)13 b(elemen)o(ts)g(are)f -(di\013eren)o(t)g(sizes)i(b)q(et)o(w)o(een)e(di\013eren)o(t)h(v)o(ersions)300 -432 y(of)f(co\013,)f(it)h(is)h(the)f(dut)o(y)g(of)f(the)h(co\013)f(v)o -(ersion)i(sp)q(eci\014c)g(include)i(\014le)e(to)e(o)o(v)o(erride)300 -482 y(the)18 b(de\014nitions)i(of)d(v)m(arious)i(pac)o(king)f(routines)g(in) -36 b Fh(coffcode.h)p Fm(.)26 b(Eg)18 b(the)300 532 y(size)d(of)e(line)i(n)o -(um)o(b)q(er)g(en)o(try)e(in)i(co\013)e(is)h(sometimes)g(16)f(bits,)h(and)g -(sometimes)300 582 y(32)h(bits.)22 b Fh(#define)p Fm(ing)17 -b Fh(PUT_LNSZ_LNNO)c Fm(and)k Fh(GET_LNSZ_LNNO)d Fm(will)j(select)300 -632 y(the)f(correct)g(one.)24 b(No)16 b(doubt,)g(some)g(da)o(y)g(someone)g -(will)i(\014nd)f(a)f(v)o(ersion)g(of)300 681 y(co\013)d(whic)o(h)i(has)e(a)h -(v)m(arying)g(\014eld)h(size)g(not)e(catered)h(for)f(at)g(the)h(momen)o(t.)k -(T)l(o)300 731 y(p)q(ort)d(bfd,)g(that)g(p)q(erson)g(will)i(ha)o(v)o(e)e(to)f -(add)i(more)e Fh(#defines)p Fm(.)300 793 y(Three)29 b(of)f(the)h(bit)g(t)o -(widdling)h(routines)f(are)g(exp)q(orted)g(to)108 b Fh(gdb)p -Fm(;)300 843 y Fh(coff_swap_aux_in)p Fm(,)19 b Fh(coff_swap_sym_in)14 -b Fm(and)21 b Fh(coff_swap_linno_in)p Fm(.)300 893 y Fh(GDB)14 -b Fm(reads)f(the)i(sym)o(b)q(ol)f(table)g(on)g(its)h(o)o(wn,)e(but)h(uses)g -(bfd)h(to)e(\014x)h(things)h(up.)0 1022 y Fr(3.2.2.2)30 b(Sym)n(b)r(ol)20 -b(Reading)300 1113 y Fm(The)12 b(simple)i(canonical)f(form)e(for)g(sym)o(b)q -(ols)h(used)h(b)o(y)f(bfd)g(is)h(not)e(ric)o(h)i(enough)300 -1163 y(to)f(k)o(eep)h(all)g(the)g(information)f(a)o(v)m(ailable)j(in)e(a)f -(co\013)g(sym)o(b)q(ol)h(table.)19 b(The)13 b(bac)o(k)300 1213 -y(end)20 b(gets)e(around)h(this)g(b)o(y)g(k)o(eeping)h(the)f(original)h(sym)o -(b)q(ol)f(table)g(around,)300 1263 y Fh(")p Fm(b)q(ehind)e(the)e(sceens)p -Fh(")p Fm(.)300 1325 y(When)c(a)e(sym)o(b)q(ol)i(table)f(is)h(requested)g -(\(through)e(a)h(call)h(to)f Fh(bfd_canonicalize_symtab)p Fm(,)p -2166 1336 21 46 v 300 1375 a(a)16 b(request)g(gets)f(through)h(to)k -Fh(get_normalized_symtab)p Fm(.)f(This)e(reads)f(the)300 1425 -y(sym)o(b)q(ol)k(table)g(from)f(the)h(co\013)f(\014le)i(and)f(sw)o(aps)f(all) -i(the)f(structures)f(inside)300 1474 y(in)o(to)e(the)h(in)o(ternal)g(form.)25 -b(It)18 b(also)f(\014xes)h(up)g(all)g(the)f(p)q(oin)o(ters)h(in)g(the)g -(table)300 1524 y(\(represen)o(ted)e(in)g(the)f(\014le)i(b)o(y)e(o\013sets)f -(from)h(the)g(\014rst)g(sym)o(b)q(ol)h(in)g(the)g(table\))300 -1574 y(in)o(to)k(ph)o(ysical)h(p)q(oin)o(ters)f(to)f(elemen)o(ts)h(in)h(the)f -(new)g(in)o(ternal)g(table.)34 b(This)300 1624 y(in)o(v)o(olv)o(es)18 -b(some)g(w)o(ork)f(since)i(the)f(meanings)h(of)f(\014elds)h(c)o(hanges)f(dep) -q(ending)300 1674 y(up)q(on)i(con)o(text;)h(a)e(\014eld)h(that)f(is)h(a)f(p)q -(oin)o(ter)h(to)f(another)g(structure)g(in)h(the)300 1724 y(sym)o(b)q(ol)c -(table)f(at)g(one)g(momen)o(t)g(ma)o(y)f(b)q(e)i(the)f(size)i(in)f(b)o(ytes)f -(of)f(a)h(structure)300 1773 y(in)h(the)f(next.)300 1836 y(Another)k(pass)f -(is)h(made)g(o)o(v)o(er)f(the)h(table.)30 b(All)20 b(sym)o(b)q(ols)f(whic)o -(h)h(mark)e(\014le)300 1885 y(names)i(\()26 b Fh(C_FILE)19 -b Fm(sym)o(b)q(ols\))h(are)f(mo)q(di\014ed)i(so)f(that)f(the)g(in)o(ternal)i -(string)300 1935 y(p)q(oin)o(ts)15 b(to)f(the)h(v)m(alue)h(in)g(the)e(auxen)o -(t)h(\(the)g(real)g(\014lename\))g(rather)f(than)h(the)300 -1985 y(normal)g(text)g(asso)q(ciated)g(with)h(the)f(sym)o(b)q(ol)h(\()p -Fh(".file")p Fm(\).)300 2047 y(A)o(t)j(this)h(time)f(the)h(sym)o(b)q(ol)f -(names)h(are)f(mo)o(v)o(ed)g(around.)32 b(Co\013)18 b(stores)h(all)300 -2097 y(sym)o(b)q(ols)d(less)g(than)f(nine)i(c)o(haracters)d(long)i(ph)o -(ysically)h(within)g(the)f(sym)o(b)q(ol)300 2147 y(table,)d(longer)h(strings) -e(are)h(k)o(ept)g(at)f(the)h(end)h(of)e(the)h(\014le)h(in)g(the)f(string)g -(table.)300 2197 y(This)22 b(pass)e(mo)o(v)o(es)h(all)h(strings)f(in)o(to)g -(memory)l(,)g(and)h(replaces)g(them)f(with)300 2247 y(p)q(oin)o(ters)16 -b(to)e(the)h(strings.)300 2309 y(The)20 b(sym)o(b)q(ol)h(table)g(is)g -(massaged)e(once)i(again,)g(this)g(time)f(to)g(create)g(the)300 -2359 y(canonical)12 b(table)f(used)h(b)o(y)f(the)g(bfd)g(application.)20 -b(Eac)o(h)11 b(sym)o(b)q(ol)g(is)g(insp)q(ected)300 2408 y(in)21 -b(turn,)f(and)g(a)g(decision)i(made)e(\(using)g(the)48 b Fh(sclass)19 -b Fm(\014eld\))i(ab)q(out)f(the)300 2458 y(v)m(arious)12 b(\015ags)f(to)f -(set)i(in)g(the)f Fh(asymbol)g Fm(See)g(Section)i(2.4)d([Sym)o(b)q(ols],)i -(page)f(14.)300 2508 y(The)h(generated)g(canonical)h(table)f(shares)f -(strings)h(with)g(the)g(hidden)h(in)o(ternal)300 2558 y(sym)o(b)q(ol)j -(table.)300 2620 y(An)o(y)d(linen)o(um)o(b)q(ers)i(are)e(read)g(from)f(the)i -(co\013)e(\014le)i(to)q(o,)f(and)g(attatc)o(hed)f(to)h(the)300 -2670 y(sym)o(b)q(ols)i(whic)o(h)i(o)o(wn)d(the)i(functions)f(the)h(linen)o -(um)o(b)q(ers)h(b)q(elong)f(to.)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 51 53 -bop 0 -58 a Fk(Chapter)13 b(3:)k(BFD)c(back)f(end)p 409 -66 -670 3 v 693 w(DRAFT)p 1222 -66 V 697 w Fj(51)0 183 y Fr(3.2.2.3)30 -b(Sym)n(b)r(ol)20 b(W)-5 b(riting)300 277 y Fm(W)l(riting)15 -b(a)e(sym)o(b)q(ol)i(to)e(a)h(co\013)g(\014le)h(whic)o(h)g(didn't)f(come)h -(from)e(a)h(co\013)f(\014le)i(will)300 327 y(lose)h(an)o(y)g(debugging)g -(information.)22 b(The)e Fh(asymbol)14 b Fm(structure)i(remem)o(b)q(ers)300 -377 y(the)k(bfd)g(from)f(whic)o(h)h(w)o(as)f(b)q(orn,)i(and)f(on)f(output)h -(the)g(bac)o(k)f(end)i(mak)o(es)300 427 y(sure)15 b(that)g(the)g(same)g -(destination)h(target)e(as)h(source)g(target)f(is)i(presen)o(t.)300 -492 y(When)f(the)g(sym)o(b)q(ols)g(ha)o(v)o(e)f(come)h(from)f(a)g(co\013)h -(\014le)g(then)g(all)h(the)f(debugging)300 541 y(information)g(is)h(preserv)o -(ed.)300 606 y(Sym)o(b)q(ol)i(tables)g(are)f(pro)o(vided)i(for)e(writing)h -(to)f(the)g(bac)o(k)h(end)g(in)g(a)g(v)o(ector)300 656 y(of)h(p)q(oin)o(ters) -i(to)e(p)q(oin)o(ters.)34 b(This)20 b(allo)o(ws)g(applications)i(lik)o(e)f -(the)f(link)o(er)h(to)300 706 y(accum)o(ulate)13 b(and)g(output)g(large)g -(sym)o(b)q(ol)g(tables)h(without)e(ha)o(ving)i(to)e(do)h(to)q(o)300 -756 y(m)o(uc)o(h)i(b)o(yte)g(cop)o(ying.)300 821 y(The)j(sym)o(b)q(ol)g -(table)g(is)g(not)f(output)h(to)f(a)g(writable)i(bfd)f(un)o(til)g(it)g(is)g -(closed.)300 870 y(The)d(order)g(of)f(op)q(erations)h(on)g(the)g(canonical)h -(sym)o(b)q(ol)g(table)f(at)f(that)g(p)q(oin)o(t)300 920 y(are:)300 -985 y Fh(coff_renumber_symbols)450 1035 y Fm(This)20 b(function)h(runs)f -(through)g(the)g(pro)o(vided)g(sym)o(b)q(ol)g(table)h(and)450 -1085 y(patc)o(hes)16 b(eac)o(h)h(sym)o(b)q(ol)f(mark)o(ed)g(as)g(a)g(\014le)h -(place)h(holder)f(\()7 b Fh(C_FILE)p Fm(\))450 1135 y(to)13 -b(p)q(oin)o(t)g(to)g(the)g(next)g(\014le)i(place)f(holder)g(in)g(the)f(list.) -20 b(It)13 b(also)h(marks)450 1185 y(eac)o(h)43 b Fh(offset)18 -b Fm(\014eld)j(in)f(the)f(list)h(with)f(the)h(o\013set)e(from)g(the)h -(\014rst)450 1234 y(sym)o(b)q(ol)d(of)e(the)i(curren)o(t)f(sym)o(b)q(ol.)450 -1299 y(Another)j(function)h(of)f(this)h(pro)q(cedure)g(is)g(to)e(turn)h(the)h -(canonical)450 1349 y(v)m(alue)f(form)d(of)h(bfd)h(in)o(to)f(the)g(form)g -(used)h(b)o(y)f(co\013.)23 b(In)o(ternally)l(,)18 b(bfd)450 -1399 y(exp)q(ects)e(sym)o(b)q(ol)g(v)m(alues)g(to)f(b)q(e)h(o\013sets)e(from) -h(a)g(section)h(base;)f(so)g(a)450 1449 y(sym)o(b)q(ol)c(ph)o(ysically)i(at)d -(0x120,)g(but)h(in)g(a)g(section)g(starting)f(at)g(0x100,)450 -1499 y(w)o(ould)16 b(ha)o(v)o(e)g(the)g(v)m(alue)h(0x20.)22 -b(Co\013)15 b(exp)q(ects)h(sym)o(b)q(ols)g(to)g(con)o(tain)450 -1548 y(their)d(\014nal)h(v)m(alue,)g(so)f(sym)o(b)q(ols)g(ha)o(v)o(e)g(their) -g(v)m(alues)h(c)o(hanged)f(at)g(this)450 1598 y(p)q(oin)o(t)20 -b(to)g(re\015ect)g(their)h(sum)f(with)g(their)g(o)o(wning)g(section.)35 -b(Note)450 1648 y(that)18 b(this)h(transformation)e(uses)i(the)39 -b Fh(output_section)17 b Fm(\014eld)i(of)450 1698 y(the)c Fh(asymbol)p -Fm('s)f Fh(asection)g Fm(See)i(Section)g(2.3)e([Sections],)h(page)g(8.)300 -1763 y Fh(coff_mangle_symbols)450 1813 y Fm(This)f(routine)f(runs)g(though)g -(the)g(pro)o(vided)h(sym)o(b)q(ol)f(table)h(and)f(uses)450 -1862 y(the)18 b(o\013sets)g(generated)g(b)o(y)h(the)f(previous)h(pass)f(and)h -(the)g(p)q(oin)o(ters)450 1912 y(generated)f(when)h(the)g(sym)o(b)q(ol)g -(table)g(w)o(as)e(read)i(in)g(to)f(create)g(the)450 1962 y(structured)c -(hierac)o(h)o(y)h(required)h(b)o(y)e(co\013.)19 b(It)c(c)o(hanges)f(eac)o(h)g -(p)q(oin)o(ter)450 2012 y(to)h(a)f(sym)o(b)q(ol)i(to)e(an)i(index)g(in)o(to)f -(the)g(sym)o(b)q(ol)h(table)g(of)e(the)i(sym)o(b)q(ol)450 2062 -y(b)q(eing)g(referenced.)300 2126 y Fh(coff_write_symbols)450 -2176 y Fm(This)i(routine)f(runs)g(through)g(the)g(sym)o(b)q(ol)h(table)f(and) -g(patc)o(hes)g(up)450 2226 y(the)g(sym)o(b)q(ols)g(from)e(their)j(in)o -(ternal)f(form)f(in)o(to)g(the)h(co\013)f(w)o(a)o(y)l(,)g(calls)450 -2276 y(the)f(bit)h(t)o(widdlers)g(and)f(writes)h(out)e(the)i(tab)q(el)g(to)e -(the)i(\014le.)300 2341 y(The)f(hidden)i(information)f(for)e(an)h(asym)o(b)q -(ol)h(is:)414 2391 y Fh(typedef)23 b(struct)g(coff_ptr_struct)414 -2441 y({)300 2505 y Ff(Remem)o(b)q(ers)12 b(the)f(o\013set)g(from)f(the)i -(\014rst)e(sym)o(b)q(ol)i(in)g(the)f(\014le)i(for)d(this)k(sym)o(b)q(ol.)300 -2555 y(Generated)h(b)o(y)g Fh(coff_renumber_symbols)p Ff(.)462 -2605 y Fh(unsigned)22 b(int)i(offset;)300 2670 y Ff(Should)f(the)f(tag)e -(\014eld)j(of)f(this)g(sym)o(b)q(ol)g(b)q(e)g(ren)o(um)o(b)q(ered.)40 -b(Created)21 b(b)o(y)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 52 54 -bop 0 -58 a Fk(Chapter)13 b(3:)k(BFD)c(back)f(end)p 409 -66 -670 3 v 693 w(DRAFT)p 1222 -66 V 697 w Fj(52)300 183 y Fh -(coff_pointerize_aux)p Ff(.)462 233 y Fh(char)23 b(fix_tag;)300 -296 y Ff(Should)18 b(the)e(endidx)i(\014eld)f(of)f(this)h(sym)o(b)q(ol)g(b)q -(e)g(ren)o(um)o(b)q(ered.)24 b(Created)16 b(b)o(y)300 346 y -Fh(coff_pointerize_aux)p Ff(.)462 396 y Fh(char)23 b(fix_end;)300 -459 y Ff(The)16 b(con)o(tainer)g(for)g(the)g(sym)o(b)q(ol)g(structure)f(as)h -(read)g(and)g(translated)g(from)300 508 y(the)f(\014le.)462 -558 y Fh(union)23 b({)509 608 y(union)g(internal_auxent)f(auxent;)509 -658 y(struct)h(internal_syment)f(syment;)462 708 y(})h(u;)414 -757 y(})h(combined_entry_type;)300 870 y Fm(Eac)o(h)15 b(canonical)i(asym)o -(b)q(ol)e(really)h(lo)q(oks)f(lik)o(e)i(this:)414 920 y Fh(typedef)23 -b(struct)g(coff_symbol_struct)414 970 y({)300 1033 y Ff(The)15 -b(actual)h(sym)o(b)q(ol)f(whic)o(h)h(the)g(rest)e(of)h(bfd)h(w)o(orks)e(with) -462 1083 y Fh(asymbol)22 b(symbol;)300 1146 y Ff(A)15 b(p)q(oin)o(ter)h(to)e -(the)i(hidden)h(information)e(for)g(this)g(sym)o(b)q(ol)462 -1195 y Fh(combined_entry_type)21 b(*native;)300 1258 y Ff(A)15 -b(p)q(oin)o(ter)h(to)e(the)i(linen)o(um)o(b)q(er)h(information)e(for)g(this)h -(sym)o(b)q(ol)462 1308 y Fh(struct)23 b(lineno_cache_entry)e(*lineno;)414 -1358 y(})j(coff_symbol_type;)0 1497 y Fr(3.2.2.4)30 b(W)-5 -b(riting)20 b(Relo)r(cations)300 1589 y Fm(T)l(o)i(write)h(a)g(relo)q -(cations,)i(all)e(the)g(bac)o(k)g(end)g(do)q(es)g(is)h(step)e(though)h(the) -300 1639 y(canonical)f(relo)q(cation)f(table,)h(and)f(create)g(an)53 -b Fh(internal_reloc)p Fm(.)34 b(The)300 1689 y(sym)o(b)q(ol)15 -b(index)i(to)d(use)h(is)h(remo)o(v)o(ed)e(from)g(the)h Fh(offset)f -Fm(\014eld)j(in)f(the)f(sym)o(b)q(ol)300 1739 y(table)d(supplied,)h(the)f -(address)f(comes)g(directly)h(from)e(the)i(sum)f(of)f(the)h(section)300 -1788 y(base)18 b(address)h(and)g(the)f(relo)q(cation)h(o\013set)f(and)g(the)h -(t)o(yp)q(e)f(is)h(dug)g(directly)300 1838 y(from)14 b(the)i(ho)o(wto)e -(\014eld.)300 1901 y(Then)26 b(the)85 b Fh(internal_reloc)23 -b Fm(is)j(sw)o(app)q(ed)g(in)o(to)f(the)g(shap)q(e)h(of)f(an)300 -1951 y Fh(external_reloc)13 b Fm(and)j(written)f(out)g(to)f(disk.)0 -2090 y Fr(3.2.2.5)30 b(Reading)20 b(Linen)n(um)n(b)r(ers)300 -2182 y Fm(Createing)c(the)g(linen)o(um)o(b)q(er)i(table)e(is)g(done)h(b)o(y)e -(reading)i(in)f(the)g(en)o(tire)h(co\013)300 2232 y(linen)o(um)o(b)q(er)g -(table,)f(and)f(creating)g(another)g(table)h(for)e(in)o(ternal)i(use.)300 -2295 y(A)c(co\013)f(line)i(n)o(um)o(b)q(er)f(table)h(is)f(structured)f(so)h -(that)f(eac)o(h)h(function)g(is)g(mark)o(ed)300 2345 y(as)19 -b(ha)o(ving)g(a)g(line)i(n)o(um)o(b)q(er)f(of)f(0.)31 b(Eac)o(h)19 -b(line)i(within)g(the)e(function)h(is)g(an)300 2395 y(o\013set)12 -b(from)h(the)g(\014rst)g(line)i(in)f(the)g(function.)20 b(The)13 -b(base)g(of)g(the)h(line)h(n)o(um)o(b)q(er)300 2444 y(information)f(for)g -(the)g(table)h(is)g(stored)f(in)h(the)f(sym)o(b)q(ol)h(asso)q(ciated)f(with)h -(the)300 2494 y(function.)300 2557 y(The)20 b(information)h(is)f(copied)h -(from)f(the)g(external)g(to)g(the)g(in)o(ternal)h(table,)300 -2607 y(and)14 b(eac)o(h)g(sym)o(b)q(ol)g(whic)o(h)h(marks)f(a)f(function)i -(is)f(mark)o(ed)g(b)o(y)g(p)q(oin)o(ting)h(its...)300 2670 -y(**Ho)o(w)f(do)q(es)i(this)f(w)o(ork)f(?**)0 2770 y Fk(c)6 -b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 -2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 53 55 -bop 0 -58 a Fk(Chapter)13 b(3:)k(BFD)c(back)f(end)p 409 -66 -670 3 v 693 w(DRAFT)p 1222 -66 V 697 w Fj(53)0 183 y Fr(3.2.2.6)30 -b(Reading)20 b(Relo)r(cations)300 275 y Fm(Co\013)d(relo)q(cations)h(are)g -(easily)g(transformed)f(in)o(to)h(the)g(in)o(ternal)g(bfd)g(form)f(\()300 -324 y Fh(arelent)p Fm(\).)300 387 y(Reading)f(a)f(co\013)g(relo)q(cation)h -(table)f(is)h(done)g(in)g(the)f(follo)o(wing)h(stages:)337 -449 y Fq(\017)30 b Fm(The)15 b(en)o(tire)h(co\013)f(relo)q(cation)h(table)f -(is)h(read)f(in)o(to)g(memory)l(.)337 511 y Fq(\017)30 b Fm(Eac)o(h)13 -b(relo)q(cation)h(is)g(pro)q(cessed)g(in)g(turn,)f(\014rst)g(it)h(is)g(sw)o -(app)q(ed)f(from)g(the)390 561 y(external)j(to)e(the)h(in)o(ternal)i(form.) -337 623 y Fq(\017)30 b Fm(The)g(sym)o(b)q(ol)f(referenced)i(in)f(the)f(relo)q -(cation's)h(sym)o(b)q(ol)g(index)g(is)390 673 y(turned)22 b(in)o(to)g(a)g(p)q -(oin)o(ter)h(in)o(to)f(the)g(canonical)h(sym)o(b)q(ol)f(table.)41 -b(Note)390 723 y(that)20 b(this)h(table)h(is)f(the)g(same)g(as)f(the)h(one)g -(returned)g(b)o(y)g(a)g(call)h(to)390 773 y Fh(bfd_canonicalize_symtab)p -Fm(.)c(The)e(bac)o(k)f(end)i(will)g(call)g(the)e(routine)390 -823 y(and)g(sa)o(v)o(e)g(the)g(result)h(if)f(a)g(canonicalization)j(hasn't)c -(b)q(een)j(done.)337 885 y Fq(\017)30 b Fm(The)14 b(relo)q(c)g(index)h(is)f -(turned)g(in)o(to)g(a)f(p)q(oin)o(ter)h(to)f(a)g(ho)o(wto)g(structure,)g(in) -390 935 y(a)i(bac)o(k)h(end)g(sp)q(eci\014c)h(w)o(a)o(y)l(.)j(F)l(or)15 -b(instance,)h(the)g(386)e(and)i(960)f(use)g(the)390 984 y Fh(r_type)g -Fm(to)h(directly)h(pro)q(duce)g(an)f(index)i(in)o(to)e(a)f(ho)o(wto)g(table)i -(v)o(ector;)390 1034 y(the)g(88k)f(subtracts)h(a)f(n)o(um)o(b)q(er)i(from)e -(the)28 b Fh(r_type)16 b Fm(\014eld)i(and)f(creates)390 1084 -y(an)e(addend)h(\014eld.)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 54 56 -bop 0 -58 a Fk(F)o(unction)13 b(Index)p 238 -66 756 3 v 779 -w(DRAFT)p 1137 -66 V 782 w Fj(54)0 183 y Fi(F)-7 b(unction)26 -b(Index)0 403 y Fn(A)0 457 y Fe(aout)p 82 457 12 2 v 13 w()p -215 457 V 11 w(machine)p 366 457 V 12 w(type)t Fd(:)6 b(:)g(:)g(:)g(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)g Fc(47)0 503 y Fe(aout)p 82 503 -V 13 w()p 215 503 V 11 w(mkobject)f Fd(:)h(:)h(:)f(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)j Fc(47)0 549 y Fe(aout)p -82 549 V 13 w()p 215 549 V 11 w(set)p 286 549 V 13 w(arch)p -379 549 V 13 w(mach)d Fd(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)i -Fc(48)0 594 y Fe(aout)p 82 594 V 13 w()p 215 594 V 11 -w(some)p 306 594 V 13 w(aout)p 399 594 V 13 w(object)p 532 -594 V 11 w(p)t Fd(:)e(:)g(:)g(:)g(:)g(:)g(:)t Fc(47)0 640 y -Fe(aout)p 82 640 V 13 w()p 215 640 V 11 w(swap)p 306 -640 V 13 w(exec)p 399 640 V 13 w(header)p 532 640 V 11 w(in)k -Fd(:)c(:)h(:)f(:)g(:)11 b Fc(47)0 686 y Fe(aout)p 82 686 V -13 w()p 215 686 V 11 w(swap)p 306 686 V 13 w(exec)p 399 -686 V 13 w(header)p 532 686 V 11 w(out)e Fd(:)d(:)g(:)g(:)k -Fc(47)0 731 y Fe(aout)p 82 731 V 13 w(ne)o(w)p 274 731 -V 11 w(section)p 425 731 V 12 w(hook)f Fd(:)d(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:) -11 b Fc(48)0 857 y Fn(B)0 911 y Fe(bfd)p 62 911 V 13 w(alloc)p -175 911 V 12 w(size)6 b Fd(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) -g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)i Fc(40)0 956 y -Fe(bfd)p 62 956 V 13 w(arch)p 155 956 V 13 w(compatib)o(le)e -Fd(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)k -Fc(38)0 1002 y Fe(bfd)p 62 1002 V 13 w(architect)o(ure)d Fd(:)f(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)11 -b Fc(36)0 1048 y Fe(bfd)p 62 1048 V 13 w(cache)p 175 1048 V -12 w(close)t Fd(:)6 b(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g Fc(44)0 1093 y Fe(bfd)p 62 -1093 V 13 w(cache)p 175 1093 V 12 w(init)g Fd(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)i -Fc(44)0 1139 y Fe(bfd)p 62 1139 V 13 w(cache)p 175 1139 V 12 -w(lookup)r Fd(:)f(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)g(:)f Fc(43)0 1185 y Fe(bfd)p 62 1185 V -13 w(cache)p 175 1185 V 12 w(lookup)p 307 1185 V 12 w(worker)g -Fd(:)h(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)g -Fc(44)0 1230 y Fe(BFD)p 62 1230 V 13 w(CACHE)p 175 1230 V 12 -w(MAX)p 247 1230 V 13 w(OPEN)s Fd(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)f Fc(43)0 1276 y Fe(bfd)p -62 1276 V 13 w(canonical)o(ize)p 313 1276 V 10 w(symtab)r Fd(:)h(:)h(:)f(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)f Fc(18)0 1322 y Fe(bfd)p -62 1322 V 13 w(check)p 175 1322 V 12 w(format)r Fd(:)i(:)f(:)g(:)g(:)g(:)g(:) -g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)f -Fc(21)0 1367 y Fe(bfd)p 62 1367 V 13 w(close)k Fd(:)d(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)11 b Fc(39)0 1413 y Fe(bfd)p 62 1413 V 13 w(core)p -155 1413 V 13 w(file)p 248 1413 V 12 w(failing)p 400 1413 V -12 w(command)c Fd(:)g(:)f(:)g(:)g(:)g(:)g(:)11 b Fc(30)0 1459 -y Fe(bfd)p 62 1459 V 13 w(core)p 155 1459 V 13 w(file)p 248 -1459 V 12 w(failing)p 400 1459 V 12 w(signal)q Fd(:)6 b(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)t Fc(30)0 1504 y Fe(bfd)p 62 1504 V 13 w(create)h -Fd(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:) -g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)k Fc(39)0 1550 y Fe(bfd)p -62 1550 V 13 w(fdopenr)c Fd(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)j -Fc(39)0 1596 y Fe(bfd)p 62 1596 V 13 w(find)p 155 1596 V 13 -w(target)s Fd(:)d(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)h(:)f(:)g Fc(35)0 1641 y Fe(bfd)p 62 1641 -V 13 w(format)p 195 1641 V 12 w(string)q Fd(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)t Fc(21)0 -1687 y Fe(bfd)p 62 1687 V 13 w(get)p 135 1687 V 13 w(elt)p -208 1687 V 13 w(at)p 261 1687 V 13 w(index)s Fd(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g Fc(20)0 1733 y -Fe(bfd)p 62 1733 V 13 w(get)p 135 1733 V 13 w(mtime)i Fd(:)e(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)k Fc(6)0 1778 y Fe(bfd)p 62 1778 V 13 w(get)p 135 1778 -V 13 w(next)p 228 1778 V 13 w(mapent)q Fd(:)c(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)t Fc(20)0 1824 y Fe(bfd)p -62 1824 V 13 w(get)p 135 1824 V 13 w(section)p 288 1824 V 11 -w(by)p 339 1824 V 14 w(name)i Fd(:)e(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)k Fc(12)0 1870 y Fe(bfd)p 62 1870 V 13 w(get)p 135 -1870 V 13 w(section)p 288 1870 V 11 w(contents)s Fd(:)c(:)g(:)g(:)g(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)g Fc(13)0 1915 y Fe(bfd)p 62 1915 -V 13 w(get)p 135 1915 V 13 w(size)i Fd(:)e(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) -g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)k -Fc(41)0 1961 y Fe(bfd)p 62 1961 V 13 w(h)p 95 1961 V 14 w(get)p -169 1961 V 13 w(size)e Fd(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)k Fc(41)0 2007 y -Fe(bfd)p 62 2007 V 13 w(h)p 95 2007 V 14 w(put)p 169 2007 V -13 w(size)e Fd(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:) -g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)k Fc(41)0 2052 y Fe(bfd)p 62 -2052 V 13 w(last)p 155 2052 V 13 w(cache)5 b Fd(:)h(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)i -Fc(43)0 2098 y Fe(bfd)p 62 2098 V 13 w(log2)r Fd(:)e(:)g(:)g(:)g(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)g(:)g(:)g(:)t Fc(42)0 2144 y Fe(bfd)p 62 2144 V 13 w(make)p -155 2144 V 13 w(empty)p 268 2144 V 12 w(symbol)h Fd(:)f(:)g(:)g(:)g(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)k Fc(19)1230 403 y Fe(bfd)p -1292 403 V 13 w(make)p 1385 403 V 13 w(section)q Fd(:)d(:)f(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)f -Fc(12)1230 449 y Fe(bfd)p 1292 449 V 13 w(map)p 1365 449 V -13 w(over)p 1458 449 V 13 w(sections)h Fd(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)g(:)g(:)g(:)k Fc(12)1230 495 y Fe(bfd)p 1292 -495 V 13 w(open)p 1385 495 V 13 w(file)c Fd(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)j -Fc(44)1230 540 y Fe(bfd)p 1292 540 V 13 w(openr)g Fd(:)d(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)11 b Fc(39)1230 586 y Fe(bfd)p 1292 586 V 13 -w(openr)p 1405 586 V 12 w(next)p 1497 586 V 13 w(archived)p -1670 586 V 11 w(file)r Fd(:)6 b(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)t -Fc(20)1230 632 y Fe(bfd)p 1292 632 V 13 w(openw)j Fd(:)d(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)11 b Fc(39)1230 677 y Fe(bfd)p 1292 677 V 13 -w(perform)p 1445 677 V 11 w(relocation)r Fd(:)6 b(:)g(:)g(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)g(:)g(:)g(:)g Fc(23)1230 723 y Fe(bfd)p 1292 -723 V 13 w(prinable)p 1465 723 V 11 w(arch)p 1556 723 V 13 -w(mach)g Fd(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)j -Fc(37)1230 769 y Fe(bfd)p 1292 769 V 13 w(print)p 1405 769 -V 12 w(symbol)p 1537 769 V 12 w(vandf)d Fd(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) -g(:)g(:)g(:)g(:)g(:)g(:)j Fc(19)1230 814 y Fe(bfd)p 1292 814 -V 13 w(put)p 1365 814 V 13 w(size)f Fd(:)e(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) -g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)k -Fc(41)1230 860 y Fe(bfd)p 1292 860 V 13 w(scan)p 1385 860 V -13 w(arch)p 1478 860 V 12 w(mach)s Fd(:)c(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)f Fc(38)1230 906 y Fe(bfd)p -1292 906 V 13 w(set)p 1365 906 V 13 w(arch)p 1458 906 V 13 -w(mach)t Fd(:)h(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)h Fc(38)1230 951 y Fe(bfd)p 1292 951 V 13 -w(set)p 1365 951 V 13 w(archive)p 1518 951 V 11 w(head)j Fd(:)c(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)11 b Fc(20)1230 -997 y Fe(bfd)p 1292 997 V 13 w(set)p 1365 997 V 13 w(format)5 -b Fd(:)h(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)i Fc(21)1230 1043 y Fe(bfd)p 1292 1043 -V 13 w(set)p 1365 1043 V 13 w(section)p 1518 1043 V 11 w(contents)s -Fd(:)e(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g Fc(13)1230 -1088 y Fe(bfd)p 1292 1088 V 13 w(set)p 1365 1088 V 13 w(section)p -1518 1088 V 11 w(flags)i Fd(:)e(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)g(:)g(:)g(:)k Fc(12)1230 1134 y Fe(bfd)p 1292 1134 V 13 -w(set)p 1365 1134 V 13 w(section)p 1518 1134 V 11 w(size)g -Fd(:)c(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)11 -b Fc(13)1230 1180 y Fe(bfd)p 1292 1180 V 13 w(set)p 1365 1180 -V 13 w(start)p 1478 1180 V 12 w(address)d Fd(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)11 b Fc(6)1230 1225 y Fe(bfd)p -1292 1225 V 13 w(set)p 1365 1225 V 13 w(symtab)5 b Fd(:)h(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)i -Fc(18)1230 1271 y Fe(bfd)p 1292 1271 V 13 w(target)f Fd(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)g(:)g(:)g(:)k Fc(31)1230 1316 y Fe(bfd)p 1292 1316 V 13 -w(target)p 1425 1316 V 12 w(list)t Fd(:)c(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g Fc(35)1230 -1420 y Fn(C)1230 1474 y Fe(core)p 1312 1474 V 13 w(file)p 1405 -1474 V 12 w(matches)p 1557 1474 V 12 w(executab)o(le)p 1768 -1474 V 11 w(p)j Fd(:)d(:)g(:)g(:)g(:)g(:)k Fc(30)1230 1578 -y Fn(G)1230 1632 y Fe(get)p 1292 1632 V 13 w(symtab)p 1425 -1632 V 12 w(upper)p 1537 1632 V 12 w(bound)c Fd(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)j Fc(18)1230 1736 y Fn(H)1230 -1790 y Fe(HOWTO)s Fd(:)d(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g -(:)f Fc(28)1230 1886 y Fn(R)1230 1940 y Fe(reloc)p 1332 1940 -V 12 w(chain)i Fd(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)j Fc(28)1230 -1986 y Fe(reloc)p 1332 1986 V 12 w(howto)p 1444 1986 V 12 w(type)s -Fd(:)e(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) -g(:)g(:)g(:)f Fc(26)1230 2090 y Fn(S)1230 2144 y Fe(stuff)t -Fd(:)h(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:) -g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g -Fc(7)0 2770 y Fk(c)g(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: 55 57 -bop 0 -58 a Fk(Index)p 94 -66 828 3 v 851 w(DRAFT)p 1065 -66 -V 854 w Fj(55)0 183 y Fi(Index)0 403 y Fn(B)0 457 y Fc(BFD)6 -b Fd(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -Fc(1)0 503 y(BFD)13 b(canonical)j(format)t Fd(:)6 b(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)t Fc(3)1230 -403 y Fn(I)1230 457 y Fc(in)o(ternal)15 b(ob)r(ject-\014le)f(format)c -Fd(:)c(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)k -Fc(3)1230 562 y Fn(W)1230 616 y Fc(what)j(is)h(it?)9 b Fd(:)d(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)g -(:)g(:)g(:)g(:)g(:)g(:)j Fc(1)0 2770 y Fk(c)d(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: 56 58 -bop 0 -58 a Fk(Index)p 94 -66 828 3 v 851 w(DRAFT)p 1065 -66 -V 854 w Fj(56)643 943 y Fm(The)16 b(b)q(o)q(dy)g(of)e(this)i(man)o(ual)f(is)h -(set)f(in)799 993 y(cmr10)g(at)f(10.95pt,)631 1042 y(with)i(headings)g(in)g -Fj(cm)o(b10)e(at)h(10.95pt)597 1092 y Fm(and)h(examples)g(in)g -Fh(cmtt10)23 b(at)g(10.95pt)p Fm(.)754 1142 y Fl(cmti10)17 -b(at)f(10.95pt)21 b Fm(and)799 1192 y Ff(cmsl10)15 b(at)g(10.95pt)754 -1242 y Fm(are)g(used)h(for)e(emphasis.)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 -b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p 332 2761 1396 3 v 1421 w(Revision:)17 -b(1.5)p eop -%%Page: -1 59 -bop 12 -66 885 3 v 909 -58 a Fk(DRAFT)p 1040 -66 V 911 w Fj(i)0 -183 y Fi(T)-7 b(able)27 b(of)f(Con)n(ten)n(ts)0 333 y Fn(1)67 -b(In)n(tro)r(duction)14 b Fb(:)e(:)e(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)k Fn(1)149 395 -y Fm(1.1)45 b(History)11 b Fa(:)d(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)k Fm(1)149 445 y(1.2)45 -b(Ho)o(w)15 b(It)g(W)l(orks)7 b Fa(:)f(:)h(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:) -g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)f Fm(1)149 495 y(1.3)45 b(What)15 b(BFD)f(V)l(ersion)i(1)f -(Can't)f(Do)6 b Fa(:)h(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:) -f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)e Fm(2)299 544 y(1.3.1)44 b(Information)15 b(Loss)6 -b Fa(:)h(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)e Fm(2)299 594 y(1.3.2)44 b(Mec)o(hanism)13 -b Fa(:)7 b(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) -h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)12 b Fm(3)0 694 y Fn(2)67 -b(BFD)22 b(fron)n(t)h(end)8 b Fb(:)i(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)e Fn(5)149 756 y -Fm(2.1)45 b(t)o(yp)q(edef)16 b(bfd)c Fa(:)c(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)j Fm(5)448 806 y(2.1.0.1)44 -b(bfd)p 690 806 14 2 v 16 w(set)p 762 806 V 16 w(start)p 873 -806 V 16 w(address)8 b Fa(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -Fm(6)448 856 y(2.1.0.2)44 b(bfd)p 690 856 V 16 w(get)p 767 -856 V 16 w(m)o(time)11 b Fa(:)d(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)i Fm(6)448 906 y(2.1.0.3)44 b(stu\013)8 b Fa(:)e(:)h(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g Fm(7)149 955 y(2.2)45 b(Memory)14 b(Usage)7 b -Fa(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:) -g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)f -Fm(8)149 1005 y(2.3)45 b(Sections)t Fa(:)8 b(:)f(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)s Fm(8)299 -1055 y(2.3.1)44 b(Section)16 b(Input)10 b Fa(:)e(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)i -Fm(8)299 1105 y(2.3.2)44 b(Section)16 b(Output)c Fa(:)7 b(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)k -Fm(9)299 1155 y(2.3.3)44 b(t)o(yp)q(edef)15 b(asection)g Fa(:)7 -b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)13 b Fm(9)299 1204 y(2.3.4)44 b(section)16 b(protot)o(yp)q(es)11 -b Fa(:)c(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)12 b Fm(12)448 1254 y(2.3.4.1)44 b(bfd)p 690 1254 V -16 w(get)p 767 1254 V 16 w(section)p 919 1254 V 17 w(b)o(y)p -984 1254 V 17 w(name)12 b Fa(:)7 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:) -g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)12 b Fm(12)448 -1304 y(2.3.4.2)44 b(bfd)p 690 1304 V 16 w(mak)o(e)p 810 1304 -V 16 w(section)14 b Fa(:)7 b(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)13 -b Fm(12)448 1354 y(2.3.4.3)44 b(bfd)p 690 1354 V 16 w(set)p -762 1354 V 16 w(section)p 914 1354 V 17 w(\015ags)5 b Fa(:)i(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)t Fm(12)448 1404 y(2.3.4.4)44 b(bfd)p 690 -1404 V 16 w(map)p 792 1404 V 17 w(o)o(v)o(er)p 892 1404 V 15 -w(sections)t Fa(:)8 b(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)t Fm(12)448 -1453 y(2.3.4.5)44 b(bfd)p 690 1453 V 16 w(set)p 762 1453 V -16 w(section)p 914 1453 V 17 w(size)15 b Fa(:)7 b(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)13 b Fm(13)448 1503 y(2.3.4.6)44 b(bfd)p 690 1503 V -16 w(set)p 762 1503 V 16 w(section)p 914 1503 V 17 w(con)o(ten)o(ts)7 -b Fa(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g Fm(13)448 1553 y(2.3.4.7)44 b(bfd)p -690 1553 V 16 w(get)p 767 1553 V 16 w(section)p 919 1553 V -17 w(con)o(ten)o(ts)5 b Fa(:)i(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:) -g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)e Fm(13)149 -1603 y(2.4)45 b(Sym)o(b)q(ols)11 b Fa(:)d(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)k Fm(14)299 1653 y(2.4.1)44 -b(Reading)16 b(Sym)o(b)q(ols)d Fa(:)7 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)j Fm(14)299 1703 -y(2.4.2)44 b(W)l(riting)16 b(Sym)o(b)q(ols)7 b Fa(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g -Fm(15)299 1752 y(2.4.3)44 b(t)o(yp)q(edef)15 b(asym)o(b)q(ol)c -Fa(:)d(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:) -g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)k Fm(16)299 1802 y(2.4.4)44 b(Sym)o(b)q(ol)16 b(Handling)g(F)l -(unctions)9 b Fa(:)f(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)g -Fm(18)448 1852 y(2.4.4.1)44 b(get)p 687 1852 V 16 w(sym)o(tab)p -848 1852 V 15 w(upp)q(er)p 977 1852 V 17 w(b)q(ound)6 b Fa(:)i(:)f(:)h(:)f(:) -g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)e -Fm(18)448 1902 y(2.4.4.2)44 b(bfd)p 690 1902 V 16 w(canonicalize)p -941 1902 V 19 w(sym)o(tab)12 b Fa(:)c(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)13 b Fm(18)448 -1952 y(2.4.4.3)44 b(bfd)p 690 1952 V 16 w(set)p 762 1952 V -16 w(sym)o(tab)13 b Fa(:)7 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)13 b Fm(18)448 2001 y(2.4.4.4)44 b(bfd)p 690 2001 V 16 w(prin)o(t)p -803 2001 V 17 w(sym)o(b)q(ol)p 960 2001 V 17 w(v)m(andf)13 -b Fa(:)7 b(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) -h(:)f(:)g(:)g(:)g(:)h(:)f(:)12 b Fm(19)448 2051 y(2.4.4.5)44 -b(bfd)p 690 2051 V 16 w(mak)o(e)p 810 2051 V 16 w(empt)o(y)p -950 2051 V 16 w(sym)o(b)q(ol)13 b Fa(:)7 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:) -f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)12 -b Fm(19)149 2101 y(2.5)45 b(Arc)o(hiv)o(es)9 b Fa(:)f(:)f(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)i Fm(20)448 -2151 y(2.5.0.1)44 b(bfd)p 690 2151 V 16 w(get)p 767 2151 V -16 w(next)p 870 2151 V 17 w(map)q(en)o(t)7 b Fa(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g Fm(20)448 2201 y(2.5.0.2)44 b(bfd)p 690 2201 V 16 -w(set)p 762 2201 V 16 w(arc)o(hiv)o(e)p 918 2201 V 17 w(head)11 -b Fa(:)c(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)i Fm(20)448 2250 y(2.5.0.3)44 -b(bfd)p 690 2250 V 16 w(get)p 767 2250 V 16 w(elt)p 833 2250 -V 17 w(at)p 891 2250 V 16 w(index)8 b Fa(:)g(:)f(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f Fm(20)448 2300 y(2.5.0.4)44 b(bfd)p 690 2300 V 16 w(op)q(enr)p -818 2300 V 17 w(next)p 922 2300 V 17 w(arc)o(hiv)o(ed)p 1104 -2300 V 17 w(\014le)6 b Fa(:)i(:)f(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)f Fm(20)149 2350 y(2.6)45 b(File)16 -b(F)l(ormats)8 b Fa(:)e(:)h(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h Fm(21)448 2400 y(2.6.0.1)44 b(bfd)p 690 2400 V 16 -w(c)o(hec)o(k)p 813 2400 V 17 w(format)12 b Fa(:)7 b(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)13 b Fm(21)448 2450 y(2.6.0.2)44 b(bfd)p -690 2450 V 16 w(set)p 762 2450 V 16 w(format)9 b Fa(:)d(:)h(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)g Fm(21)448 2500 y(2.6.0.3)44 -b(bfd)p 690 2500 V 16 w(format)p 840 2500 V 15 w(string)10 -b Fa(:)e(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)j Fm(21)149 -2549 y(2.7)45 b(Relo)q(cations)10 b Fa(:)e(:)f(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:) -g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)i Fm(23)448 2599 y(2.7.0.1)44 b(bfd)p -690 2599 V 16 w(p)q(erform)p 863 2599 V 17 w(relo)q(cation)7 -b Fa(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g Fm(23)448 2649 y(2.7.0.2)44 -b(relo)q(c)p 720 2649 V 17 w(ho)o(wto)p 858 2649 V 15 w(t)o(yp)q(e)t -Fa(:)8 b(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)t Fm(26)0 -2770 y Fk(c)f(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: -2 60 -bop 12 -66 879 3 v 903 -58 a Fk(DRAFT)p 1034 -66 V 905 w Fj(ii)448 -42 y Fm(2.7.0.3)44 b(HO)o(WTO)10 b Fa(:)c(:)i(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)i Fm(28)448 91 y(2.7.0.4)44 -b(relo)q(c)p 720 91 14 2 v 17 w(c)o(hain)14 b Fa(:)7 b(:)g(:)g(:)h(:)f(:)g(:) -g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)13 b Fm(28)149 141 -y(2.8)45 b(Core)15 b(\014les)d Fa(:)c(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)j Fm(30)448 191 y(2.8.0.1)44 -b(bfd)p 690 191 V 16 w(core)p 787 191 V 17 w(\014le)p 861 191 -V 17 w(failing)p 999 191 V 18 w(command)11 b Fa(:)c(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)k Fm(30)448 -241 y(2.8.0.2)44 b(bfd)p 690 241 V 16 w(core)p 787 241 V 17 -w(\014le)p 861 241 V 17 w(failing)p 999 241 V 18 w(signal)10 -b Fa(:)e(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)j Fm(30)448 291 y(2.8.0.3)44 b(core)p 707 -291 V 16 w(\014le)p 780 291 V 17 w(matc)o(hes)p 958 291 V 16 -w(executable)p 1181 291 V 18 w(p)14 b Fa(:)7 b(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:) -f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)14 b Fm(30)149 340 y(2.9)45 -b(T)l(argets)10 b Fa(:)c(:)h(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)h Fm(31)448 390 y(2.9.0.1)44 b(bfd)p -690 390 V 16 w(target)11 b Fa(:)c(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)k Fm(31)299 440 y(2.9.1)44 b(bfd)p -505 440 V 17 w(target)11 b Fa(:)c(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)13 -b Fm(31)448 490 y(2.9.1.1)44 b(bfd)p 690 490 V 16 w(\014nd)p -781 490 V 17 w(target)6 b Fa(:)g(:)h(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)d Fm(35)448 540 y(2.9.1.2)44 b(bfd)p 690 540 V 16 -w(target)p 826 540 V 15 w(list)15 b Fa(:)7 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)13 b Fm(35)149 589 y(2.10)45 b(Arc)o(hitectures)10 -b Fa(:)e(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)j -Fm(36)448 639 y(2.10.0.1)43 b(bfd)p 712 639 V 17 w(arc)o(hitecture)12 -b Fa(:)c(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)12 b Fm(36)448 -689 y(2.10.0.2)43 b(bfd)p 712 689 V 17 w(prinable)p 889 689 -V 18 w(arc)o(h)p 992 689 V 16 w(mac)o(h)9 b Fa(:)e(:)g(:)g(:)h(:)f(:)g(:)g(:) -g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)g -Fm(37)448 739 y(2.10.0.3)43 b(bfd)p 712 739 V 17 w(scan)p 815 -739 V 17 w(arc)o(h)p 917 739 V 16 w(mac)o(h)6 b Fa(:)h(:)g(:)g(:)g(:)h(:)f(:) -g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)f Fm(38)448 789 y(2.10.0.4)43 b(bfd)p 712 789 V 17 w(arc)o(h)p -814 789 V 16 w(compatible)11 b Fa(:)e(:)e(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)k -Fm(38)448 839 y(2.10.0.5)43 b(bfd)p 712 839 V 17 w(set)p 785 -839 V 16 w(arc)o(h)p 886 839 V 16 w(mac)o(h)11 b Fa(:)d(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)k Fm(38)149 888 y(2.11)45 b(Op)q(ening)17 b(and)e(Closing)h -(BFDs)11 b Fa(:)6 b(:)i(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)i Fm(39)448 938 y(2.11.0.1)43 b(bfd)p 712 938 -V 17 w(op)q(enr)14 b Fa(:)7 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)13 b Fm(39)448 988 y(2.11.0.2)43 b(bfd)p -712 988 V 17 w(fdop)q(enr)15 b Fa(:)7 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)14 b Fm(39)448 1038 y(2.11.0.3)43 b(bfd)p -712 1038 V 17 w(op)q(en)o(w)6 b Fa(:)i(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:) -g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)f Fm(39)448 1088 y(2.11.0.4)43 b(bfd)p -712 1088 V 17 w(close)13 b Fa(:)8 b(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)12 b Fm(39)448 1137 y(2.11.0.5)43 -b(bfd)p 712 1137 V 17 w(create)10 b Fa(:)d(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:) -g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)j Fm(39)448 1187 y(2.11.0.6)43 -b(bfd)p 712 1187 V 17 w(allo)q(c)p 820 1187 V 18 w(size)10 -b Fa(:)e(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)j -Fm(40)448 1237 y(2.11.1.7)43 b(bfd)p 712 1237 V 17 w(put)p -797 1237 V 17 w(size)13 b Fa(:)7 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:) -g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)12 b Fm(41)448 1287 y(2.11.1.8)43 b(bfd)p 712 -1287 V 17 w(get)p 790 1287 V 16 w(size)6 b Fa(:)i(:)f(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)d Fm(41)448 1337 y(2.11.1.9)43 -b(bfd)p 712 1337 V 17 w(h)p 754 1337 V 17 w(put)p 839 1337 -V 16 w(size)11 b Fa(:)e(:)e(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)k -Fm(41)448 1386 y(2.11.1.10)43 b(bfd)p 735 1386 V 17 w(h)p 777 -1386 V 16 w(get)p 854 1386 V 16 w(size)15 b Fa(:)7 b(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)14 b Fm(41)448 1436 y(2.11.1.11)43 b(bfd)p -735 1436 V 17 w(log2)8 b Fa(:)e(:)i(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f Fm(42)149 1486 y(2.12)45 b(File)16 -b(Cac)o(hing)8 b Fa(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f Fm(43)448 1536 y(2.12.0.1)43 b(BFD)p 745 1536 V 16 w(CA)o(CHE)p -925 1536 V 16 w(MAX)p 1051 1536 V 16 w(OPEN)6 b Fa(:)i(:)f(:)h(:)f(:)g(:)g(:) -g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)f Fm(43)448 -1586 y(2.12.0.2)43 b(bfd)p 712 1586 V 17 w(last)p 800 1586 -V 16 w(cac)o(he)13 b Fa(:)7 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)12 b Fm(43)448 1636 y(2.12.0.3)43 b(bfd)p 712 1636 V 17 -w(cac)o(he)p 836 1636 V 17 w(lo)q(okup)11 b Fa(:)d(:)f(:)h(:)f(:)g(:)g(:)g(:) -h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)k Fm(43)448 1685 y(2.12.0.4)43 b(bfd)p 712 1685 -V 17 w(cac)o(he)p 836 1685 V 17 w(init)15 b Fa(:)7 b(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)14 b Fm(44)448 1735 y(2.12.0.5)43 -b(bfd)p 712 1735 V 17 w(cac)o(he)p 836 1735 V 17 w(close)11 -b Fa(:)d(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)k Fm(44)448 -1785 y(2.12.0.6)43 b(bfd)p 712 1785 V 17 w(op)q(en)p 823 1785 -V 17 w(\014le)5 b Fa(:)k(:)e(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)e Fm(44)448 1835 y(2.12.0.7)43 b(bfd)p 712 1835 V 17 -w(cac)o(he)p 836 1835 V 17 w(lo)q(okup)p 986 1835 V 17 w(w)o(ork)o(er)8 -b Fa(:)e(:)h(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g Fm(44)0 1939 y Fn(3)67 b(BFD)22 b(bac)n(k)h(end)9 -b Fb(:)h(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)e Fn(45)149 2001 y Fm(3.1)45 b(a.out)14 b(bac)o(k)o(ends)7 -b Fa(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g -Fm(46)299 2051 y(3.1.1)44 b(relo)q(cations)6 b Fa(:)h(:)h(:)f(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)d Fm(46)299 2101 y(3.1.2)44 b(In)o(ternal)16 b(En)o(try)e(P)o(oin)o -(ts)d Fa(:)c(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)i -Fm(46)448 2151 y(3.1.2.1)44 b(aout)p 715 2151 V 15 w Fh(<)p -Fm(size)p Fh(>)p 848 2151 V 17 w Fm(sw)o(ap)p 963 2151 V 16 -w(exec)p 1063 2151 V 17 w(header)p 1211 2151 V 17 w(in)14 b -Fa(:)7 b(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)13 -b Fm(47)448 2201 y(3.1.2.2)44 b(aout)p 715 2201 V 15 w Fh(<)p -Fm(size)p Fh(>)p 848 2201 V 17 w Fm(sw)o(ap)p 963 2201 V 16 -w(exec)p 1063 2201 V 17 w(header)p 1211 2201 V 17 w(out)9 b -Fa(:)e(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)i -Fm(47)448 2250 y(3.1.2.3)44 b(aout)p 715 2250 V 15 w Fh(<)p -Fm(size)p Fh(>)p 848 2250 V 17 w Fm(some)p 964 2250 V 16 w(aout)p -1069 2250 V 16 w(ob)s(ject)p 1208 2250 V 16 w(p)11 b Fa(:)d(:)f(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)k Fm(47)448 -2300 y(3.1.2.4)44 b(aout)p 715 2300 V 15 w Fh(<)p Fm(size)p -Fh(>)p 848 2300 V 17 w Fm(mk)o(ob)s(ject)11 b Fa(:)6 b(:)i(:)f(:)g(:)g(:)g(:) -h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)i Fm(47)448 2350 y(3.1.2.5)44 b(aout)p 715 2350 V 15 w Fh(<)p -Fm(size)p Fh(>)p 848 2350 V 17 w Fm(mac)o(hine)p 1027 2350 -V 18 w(t)o(yp)q(e)10 b Fa(:)d(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)i Fm(47)448 2400 y(3.1.2.6)44 -b(aout)p 715 2400 V 15 w Fh(<)p Fm(size)p Fh(>)p 848 2400 V -17 w Fm(set)p 921 2400 V 17 w(arc)o(h)p 1023 2400 V 16 w(mac)o(h)13 -b Fa(:)7 b(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:) -f(:)g(:)g(:)g(:)14 b Fm(48)448 2450 y(3.1.2.7)44 b(aout)p 715 -2450 V 15 w Fh(<)p Fm(size)p Fh(>)p Fm(new)p 926 2450 V 18 -w(section)p 1080 2450 V 17 w(ho)q(ok)9 b Fa(:)e(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)i Fm(48)149 -2499 y(3.2)45 b(co\013)15 b(bac)o(k)o(ends)e Fa(:)7 b(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)13 b Fm(49)299 2549 y(3.2.1)44 -b(P)o(orting)14 b(T)l(o)h(A)h(New)f(V)l(ersion)h(of)f(Co\013)6 -b Fa(:)g(:)h(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)f Fm(49)299 2599 y(3.2.2)44 b(Ho)o(w)14 -b(The)i(Co\013)e(Bac)o(k)o(end)h(W)l(orks)e Fa(:)8 b(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)13 b Fm(49)448 2649 y(3.2.2.1)44 b(Bit)15 b(Twiddling)f -Fa(:)7 b(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)j -Fm(49)0 2770 y Fk(c)6 b(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g(t)p -332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Page: -3 61 -bop 12 -66 873 3 v 897 -58 a Fk(DRAFT)p 1028 -66 V 898 w Fj(iii)448 -42 y Fm(3.2.2.2)44 b(Sym)o(b)q(ol)15 b(Reading)9 b Fa(:)g(:)e(:)g(:)h(:)f(:)g -(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)i Fm(50)448 91 y(3.2.2.3)44 b(Sym)o(b)q(ol)15 -b(W)l(riting)t Fa(:)9 b(:)e(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)t -Fm(51)448 141 y(3.2.2.4)44 b(W)l(riting)15 b(Relo)q(cations)h -Fa(:)7 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g -(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)14 b Fm(52)448 191 y(3.2.2.5)44 -b(Reading)16 b(Linen)o(um)o(b)q(ers)6 b Fa(:)j(:)e(:)h(:)f(:)g(:)g(:)g(:)h(:) -f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)f -Fm(52)448 241 y(3.2.2.6)44 b(Reading)16 b(Relo)q(cations)9 -b Fa(:)f(:)g(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)g Fm(53)0 345 y Fn(F)-6 -b(unction)25 b(Index)10 b Fb(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g -(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g -(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f Fn(54)0 457 -y(Index)5 b Fb(:)12 b(:)e(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h -(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f -(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g -(:)c Fn(55)0 2770 y Fk(c)g(y)g(g)g(n)g(u)g(s)36 b(s)6 b(u)g(p)g(p)g(o)g(r)g -(t)p 332 2761 1396 3 v 1421 w(Revision:)17 b(1.5)p eop -%%Trailer -end -userdict /end-hook known{end-hook}if -%%EOF diff --git a/bfd/bfd.texinfo b/bfd/bfd.texinfo deleted file mode 100755 index 2320387b3f..0000000000 --- a/bfd/bfd.texinfo +++ /dev/null @@ -1,492 +0,0 @@ -\input texinfo -@setfilename bfdinfo -@c $Id$ -@syncodeindex fn cp -@ifinfo -This file documents the BFD library. - -Copyright (C) 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, subject to the terms -of the GNU General Public License, which includes the provision 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. -@end ifinfo -@iftex -@c@finalout -@setchapternewpage on -@c@setchapternewpage odd -@settitle LIB BFD, the Binary File Descriptor Library -@titlepage -@title{libbfd} -@subtitle{The Binary File Descriptor Library} -@sp 1 -@subtitle First Edition---BFD version < 2.0 -@subtitle April 1991 -@author {Steve Chamberlain} -@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 steve\@cygnus.com\par -\hfill {\it BFD}, \manvers\par -\hfill \TeX{}info \texinfoversion\par -} -\global\parindent=0pt % Steve likes it this way -@end tex - -@vskip 0pt plus 1filll -Copyright @copyright{} 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, subject to the terms -of the GNU General Public License, which includes the provision 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. -@end titlepage -@end iftex - -@node Top, Overview, (dir), (dir) -@ifinfo -This file documents the binary file descriptor library libbfd. -@end ifinfo - -@menu -* Overview:: Overview of BFD -* History:: History of BFD -* Backends:: Backends -* Porting:: Porting -* Future:: Future -* Index:: Index - -BFD body: -* Memory usage:: -* Sections:: -* Symbols:: -* Archives:: -* Formats:: -* Relocations:: -* Core Files:: -* Targets:: -* Architecturs:: -* Opening and Closing:: -* Internal:: -* File Caching:: - -BFD backends: -* a.out backends:: -* coff backends:: -@end menu - -@node Overview, History, Top, Top -@chapter Introduction -@cindex BFD -@cindex what is it? -BFD is a package for manipulating binary files required for developing -programs. It implements a group of structured operations designed to -shield the programmer from the underlying representation of these -binary files. It understands object (compiled) files, archive -libraries, and core files. It is designed to work in a variety of -target environments. - -Most simply put, BFD is a package which allows applications to use the -same routines to operate on object files whatever the object file -format. - -BFD is split into two parts; the front end and the many back ends. -@itemize @bullet -@item -The front end of BFD provides the interface to the user. It manages -memory, and various canonical data structures. The front end also -decides which back end to use, and when to call back end routines. -@item -The back ends provide BFD its view of the real world. A different -object file format can be supported simply by creating a new BFD back -end and adding it to the library. Each back end provides a set of calls -which the BFD front end can use to maintain its canonical form. The back -ends also may keep around information for their own use, for greater -efficiency. -@end itemize -@node History, How It Works, Overview,Top -@section History - -One spur behind BFD was the desire, on the part of the GNU 960 team at -Intel Oregon, for interoperability of applications on their COFF and -b.out file formats. Cygnus was providing GNU support for the team, and -Cygnus was contracted to provide the required functionality. - -The name came from a conversation David Wallace was having with Richard -Stallman about the library: RMS said that it would be quite hard---David -said ``BFD''. Stallman was right, but the name stuck. - -At the same time, Ready Systems wanted much the same thing, but for -different object file formats: IEEE-695, Oasys, Srecords, a.out and 68k -coff. - -BFD was first implemented by Steve Chamberlain (steve@@cygnus.com), -John Gilmore (gnu@@cygnus.com), K. Richard Pixley (rich@@cygnus.com) and -David Wallace (gumby@@cygnus.com) at Cygnus Support in Palo Alto, -California. - -@node How It Works, History, Porting, Top -@section How It Works - -To use the library, include @code{bfd.h} and link with @code{libbfd.a}. - -BFD provides a common interface to the parts of an object file -for a calling application. - -When an application sucessfully opens a target file (object, archive or -whatever) a pointer to an internal structure is returned. This pointer -points to a structure called @code{bfd}, described in -@code{include/bfd.h}. Our convention is to call this pointer a BFD, and -instances of it within code @code{abfd}. All operations on -the target object file are applied as methods to the BFD. The mapping is -defined within @code{bfd.h} in a set of macros, all beginning -@samp{bfd_}. - -In short, a BFD is a representation for a particular file. It is opened -in a manner similar to a file; code then manipulates it rather than the -raw files. - -For example, this sequence would do what you would probably expect: -return the number of sections in an object file attached to a BFD -@code{abfd}. - -@lisp -@cartouche -#include "bfd.h" - -unsigned int number_of_sections(abfd) -bfd *abfd; -@{ - return bfd_count_sections(abfd); -@} -@end cartouche -@end lisp - -The abstraction used within BFD is that an object file has a header, -a number of sections containing raw data, a set of relocations, and some -symbol information. Also, BFDs opened for archives have the -additional attribute of an index and contain subordinate BFDs. This approach is -fine for a.out and coff, but loses efficiency when applied to formats -such as S-records and IEEE-695. - -@cindex targets -@cindex formats -BFD makes a distinction between @dfn{targets} (families of file -formats) and @dfn{formats} (individual file formats). For instance, -the @code{"sun4os4"} target can handle core, object and archive formats of -files. The exact layout of the different formats depends on the target -environment. - -The target @code{"default"} means the first one known (usually used for -environments that only support one format, or where the common format -is known at compile or link time). The target @code{NULL} means the one -specified at runtime in the environment variable @code{GNUTARGET}; if that is -null or not defined then, on output, the first entry in the target list -is chosen; or, on input, all targets are searched to find a matching -one. - -Most programs should use the target @code{NULL}. See the descriptions -of @code{bfd_target_list} and @code{bfd_format_string} for functions to -inquire on targets and formats. - -@section What BFD Version 1 Can Do -As different information from the the object files is required, -BFD reads from different sections of the file and processes them. -For example a very common operation for the linker is processing symbol -tables. Each BFD back end provides a routine for converting -between the object file's representation of symbols and an internal -canonical format. When the linker asks for the symbol table of an object -file, it calls through the memory pointer to the relevant BFD -back end routine which reads and converts the table into a canonical -form. The linker then operates upon the canonical form. When the link is -finished and the linker writes the output file's symbol table, -another BFD back end routine is called which takes the newly -created symbol table and converts it into the chosen output format. - -@node BFD information loss, Mechanism, BFD outline, BFD -@subsection Information Loss -@emph{Some information is lost due to the nature of the file format.} The output targets -supported by BFD do not provide identical facilities, and -information which may be described in one form has nowhere to go in -another format. One example of this is alignment information in -@code{b.out}. There is nowhere in an @code{a.out} format file to store -alignment information on the contained data, so when a file is linked -from @code{b.out} and an @code{a.out} image is produced, alignment -information will not propagate to the output file. (The linker will -still use the alignment information internally, so the link is performed -correctly). - -Another example is COFF section names. COFF files may contain an -unlimited number of sections, each one with a textual section name. If -the target of the link is a format which does not have many sections (eg -@code{a.out}) or has sections without names (eg the Oasys format) the -link cannot be done simply. You can circumvent this problem by -describing the desired input-to-output section mapping with the linker command -language. - -@emph{Information can be lost during canonicalization.} The BFD -internal canonical form of the external formats is not exhaustive; there -are structures in input formats for which there is no direct -representation internally. This means that the BFD back ends -cannot maintain all possible data richness through the transformation -between external to internal and back to external formats. - -This limitation is only a problem when an application reads one -format and writes another. Each BFD back end is responsible for -maintaining as much data as possible, and the internal BFD -canonical form has structures which are opaque to the BFD core, -and exported only to the back ends. When a file is read in one format, -the canonical form is generated for BFD and the application. At the -same time, the back end saves away any information which may otherwise -be lost. If the data is then written back in the same format, the back -end routine will be able to use the canonical form provided by the -BFD core as well as the information it prepared earlier. Since -there is a great deal of commonality between back ends, this mechanism -is very useful. There is no information lost for this reason when -linking or copying big endian COFF to little endian COFF, or @code{a.out} to -@code{b.out}. When a mixture of formats is linked, the information is -only lost from the files whose format differs from the destination. - -@node Mechanism, , BFD information loss, BFD -@subsection Mechanism -The greatest potential for loss of information is when there is least -overlap between the information provided by the source format, that -stored by the canonical format, and the information needed by the -destination format. A brief description of the canonical form may help -you appreciate what kinds of data you can count on preserving across -conversions. -@cindex BFD canonical format -@cindex internal object-file format - -@table @emph -@item files -Information on target machine architecture, particular implementation -and format type are stored on a per-file basis. Other information -includes a demand pageable bit and a write protected bit. Note that -information like Unix magic numbers is not stored here---only the magic -numbers' meaning, so a @code{ZMAGIC} file would have both the demand -pageable bit and the write protected text bit set. The byte order of -the target is stored on a per-file basis, so that big- and little-endian -object files may be linked with one another. -@c FIXME: generalize above from "link"? - -@item sections -Each section in the input file contains the name of the section, the -original address in the object file, various flags, size and alignment -information and pointers into other BFD data structures. - -@item symbols -Each symbol contains a pointer to the object file which originally -defined it, its name, its value, and various flag bits. When a -BFD back end reads in a symbol table, the back end relocates all -symbols to make them relative to the base of the section where they were -defined. This ensures that each symbol points to its containing -section. Each symbol also has a varying amount of hidden data to contain -private data for the BFD back end. Since the symbol points to the -original file, the private data format for that symbol is accessible. -@code{gld} can operate on a collection of symbols of wildly different -formats without problems. - -Normal global and simple local symbols are maintained on output, so an -output file (no matter its format) will retain symbols pointing to -functions and to global, static, and common variables. Some symbol -information is not worth retaining; in @code{a.out} type information is -stored in the symbol table as long symbol names. This information would -be useless to most COFF debuggers; the linker has command line switches -to allow users to throw it away. - -There is one word of type information within the symbol, so if the -format supports symbol type information within symbols (for example COFF, -IEEE, Oasys) and the type is simple enough to fit within one word -(nearly everything but aggregates) the information will be preserved. - -@item relocation level -Each canonical BFD relocation record contains a pointer to the symbol to -relocate to, the offset of the data to relocate, the section the data -is in and a pointer to a relocation type descriptor. Relocation is -performed effectively by message passing through the relocation type -descriptor and symbol pointer. It allows relocations to be performed -on output data using a relocation method only available in one of the -input formats. For instance, Oasys provides a byte relocation format. -A relocation record requesting this relocation type would point -indirectly to a routine to perform this, so the relocation may be -performed on a byte being written to a COFF file, even though 68k COFF -has no such relocation type. - -@item line numbers -Object formats can contain, for debugging purposes, some form of mapping -between symbols, source line numbers, and addresses in the output file. -These addresses have to be relocated along with the symbol information. -Each symbol with an associated list of line number records points to the -first record of the list. The head of a line number list consists of a -pointer to the symbol, which allows divination of the address of the -function whose line number is being described. The rest of the list is -made up of pairs: offsets into the section and line numbers. Any format -which can simply derive this information can pass it successfully -between formats (COFF, IEEE and Oasys). -@end table - -@c FIXME: what is this line about? Do we want introductory remarks -@c FIXME... on back ends? commented out for now. -@c What is a backend -@node BFD front end, BFD back end, Mechanism, Top -@chapter BFD front end -@include bfd.texi - -@node Memory Usage, Errors, bfd, Top -@section Memory Usage -BFD keeps all its internal structures in obstacks. There is one obstack -per open BFD file, into which the current state is stored. When a BFD is -closed, the obstack is deleted, and so everything which has been -allocated by libbfd for the closing file will be thrown away. - -BFD will not free anything created by an application, but pointers into -@code{bfd} structures will be invalidated on a @code{bfd_close}; for example, -after a @code{bfd_close} the vector passed to -@code{bfd_canonicalize_symtab} will still be around, since it has been -allocated by the application, but the data that it pointed to will be -lost. - -The general rule is not to close a BFD until all operations dependent -upon data from the BFD have been completed, or all the data from within -the file has been copied. To help with the management of memory, there is a function -(@code{bfd_alloc_size}) which returns the number of bytes in obstacks -associated with the supplied BFD. This could be used to select the -greediest open BFD, close it to reclaim the memory, perform some -operation and reopen the BFD again, to get a fresh copy of the data -structures. - -@node Errors, Sections, Memory Usage, Top -@section Error Handling - -@cindex errors -In general, a boolean function returns true on success and false on failure -(unless it's a predicate). Functions which return pointers to -objects return @code{NULL} on error. The specifics are documented with each -function. - -If a function fails, you should check the variable @code{bfd_error}. If -the value is @code{no_error}, then check the C variable @code{errno} -just as you would with any other program. Other values for -@code{bfd_error} are documented in @file{bfd.h}. - -@findex bfd_errmsg -If you would prefer a comprehensible string for the error message, use -the function @code{bfd_errmsg}: -@example -char * bfd_errmsg (error_tag) -@end example -This function returns a read-only string which documents the error -code. If the error code is @code{no_error} then it will return a string -depending on the value of @code{errno}. - -@findex bfd_perror -@code{bfd_perror()} is like the @code{perror()} function except it understands -@code{bfd_error}. - - -@node Sections, Symbols, Errors, Top -@include section.texi - -@node Symbols, Archives ,Sections, To -@include syms.texi - -@node Archives, Formats, Symbols, Top -@include archive.texi - -@node Formats, Relocations, Archives, Top -@include format.texi - -@node Relocations, Core Files,Formats, Top -@include reloc.texi - -@node Core Files, Targets, Relocations, Top -@include core.texi - -@node Targets, Architectures, Core Files, Top -@include targets.texi - -@node Architectures, Opening and Closing, Targets, Top -@include archures.texi - -@node Opening and Closing, Internal, Architectures, Top -@include opncls.texi - -@node Internal, File Caching, Opening and Closing, Top -@include libbfd.texi - -@node File Caching, Top, Internal, Top -@include cache.texi - -@chapter BFD back end -@node BFD back end, ,BFD front end, Top -@menu -* What to put where -* a.out backends:: -* coff backends:: -* oasys backend:: -* ieee backend:: -* srecord backend:: -@end menu -@node What to Put Where, aout backends, BFD back end, BFD back end -All of BFD lives in one directory. - -@node aout backends, coff backends, What to Put Where, BFD back end -@include aoutx.texi - -@node coff backends, oasys backends, aout backends, BFD back end -@include coffcode.texi - -@node Index, , BFD, 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/bfd/blins-p b/bfd/blins-p deleted file mode 100755 index 858dcd7ecd..0000000000 --- a/bfd/blins-p +++ /dev/null @@ -1,8 +0,0 @@ -# sed script for BFD header files -# Merge adjacent blank lines. Loop til no change. -:blin -/^$/,/^ *[^ ]*.*$/{ -/^$/N -s/^ *\n *$// -} -t blin diff --git a/bfd/coff-code.h b/bfd/coff-code.h deleted file mode 100755 index 9040236526..0000000000 --- a/bfd/coff-code.h +++ /dev/null @@ -1,2608 +0,0 @@ -/* Support for Intel 960 COFF and Motorola 88k BCS COFF (and maybe others) */ - -/* Copyright (C) 1990, 1991 Free Software Foundation, Inc. - -This file is part of BFD, the Binary File Diddler. - -BFD is free software; you can 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. - -BFD is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - -You should have received a copy of the GNU General Public License along with - BFD; see the file COPYING. If not, write to the Free Software Foundation, - 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* $Id$ */ -/* Most of this hacked by Steve Chamberlain, steve@cygnus.com */ - -#include "archures.h" /* Machine architectures and types */ - -/* SUPPRESS 558 */ -/* SUPPRESS 590 */ -/* SUPPRESS 529 */ -/* SUPPRESS 530 */ - -/* Align an address upward to a boundary, expressed as a number of bytes. - E.g. align to an 8-byte boundary with argument of 8. */ -#define ALIGN(this, boundary) \ - ((( (this) + ((boundary) -1)) & (~((boundary)-1)))) - -/* Align an address upward to a power of two. Argument is the power - of two, e.g. 8-byte alignment uses argument of 3 (8 == 2^3). */ -#define i960_align(addr, align) \ - ( ((addr) + ((1<<(align))-1)) & (-1 << (align))) - -#define sp(x) bfd_h_put_x(abfd, x, &x) - -#ifndef I960 -#define GDB_EXPORT static -#else -#define GDB_EXPORT /* nothing */ -#endif - -PROTO(static void,force_indices_file_symbol_relative,(bfd *abfd, - struct internal_syment *symtab)); - - -/* void warning(); */ -extern asection abs_section; - -static int -DEFUN(get_index,(symbol), - asymbol *symbol) -{ - return (int) symbol->value; -} - -static void -DEFUN(set_index,(symbol, idx), - asymbol *symbol AND - unsigned int idx) -{ - symbol->value = idx; -} - - - - - -/* All the swapping routines: -*/ - - -GDB_EXPORT -void -DEFUN(bfd_swap_reloc_in,(abfd, reloc_src, reloc_dst), - bfd *abfd AND - RELOC *reloc_src AND - struct internal_reloc *reloc_dst) -{ - reloc_dst->r_vaddr = bfd_h_getlong(abfd, reloc_src->r_vaddr); - reloc_dst->r_symndx = bfd_h_getlong(abfd, reloc_src->r_symndx); - reloc_dst->r_type = bfd_h_getshort(abfd, reloc_src->r_type); -#if M88 - reloc_dst->r_offset = bfd_h_getshort(abfd, reloc_src->r_offset); -#endif -} - -GDB_EXPORT - void -DEFUN(bfd_swap_reloc_out,(abfd, reloc_src, reloc_dst), - bfd *abfd AND - struct internal_reloc *reloc_src AND - struct external_reloc *reloc_dst) -{ - bfd_h_putlong(abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr); - bfd_h_putlong(abfd, reloc_src->r_symndx, reloc_dst->r_symndx); - bfd_h_putshort(abfd, reloc_src->r_type, reloc_dst->r_type); -#if M88 - bfd_h_putshort(abfd, reloc_src->r_offset, reloc_dst->r_offset); -#endif - -} - -GDB_EXPORT void -DEFUN(bfd_swap_filehdr_in,(abfd, filehdr_src, filehdr_dst), - bfd *abfd AND - FILHDR *filehdr_src AND - struct internal_filehdr *filehdr_dst) -{ - filehdr_dst->f_magic = bfd_h_get_x(abfd, filehdr_src->f_magic); - filehdr_dst->f_nscns = bfd_h_get_x(abfd,filehdr_src-> f_nscns); - filehdr_dst->f_timdat = bfd_h_get_x(abfd,filehdr_src-> f_timdat); - filehdr_dst->f_symptr = bfd_h_get_x(abfd,filehdr_src-> f_symptr); - filehdr_dst->f_nsyms = bfd_h_get_x(abfd,filehdr_src-> f_nsyms); - filehdr_dst->f_opthdr = bfd_h_get_x(abfd,filehdr_src-> f_opthdr); - filehdr_dst->f_flags = bfd_h_get_x(abfd,filehdr_src-> f_flags); -} - -GDB_EXPORT void -DEFUN(bfd_swap_filehdr_out,(abfd, filehdr_in, filehdr_out), - bfd *abfd AND - struct internal_filehdr *filehdr_in AND - FILHDR *filehdr_out) -{ - bfd_h_put_x(abfd, filehdr_in->f_magic, filehdr_out->f_magic); - bfd_h_put_x(abfd, filehdr_in->f_nscns, filehdr_out->f_nscns); - bfd_h_put_x(abfd, filehdr_in->f_timdat, filehdr_out->f_timdat); - bfd_h_put_x(abfd, filehdr_in->f_symptr, filehdr_out->f_symptr); - bfd_h_put_x(abfd, filehdr_in->f_nsyms, filehdr_out->f_nsyms); - bfd_h_put_x(abfd, filehdr_in->f_opthdr, filehdr_out->f_opthdr); - bfd_h_put_x(abfd, filehdr_in->f_flags, filehdr_out->f_flags); -} - - -GDB_EXPORT -void -DEFUN(bfd_coff_swap_sym_in,(abfd, ext, in), - bfd *abfd AND - SYMENT *ext AND - struct internal_syment *in) -{ - if( ext->e.e_name[0] == 0) { - in->_n._n_n._n_zeroes = 0; - in->_n._n_n._n_offset = bfd_h_getlong(abfd, ext->e.e.e_offset); - } - else { - memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); - } - in->n_value = bfd_h_get_x(abfd, ext->e_value); - in->n_scnum = bfd_h_get_x(abfd, ext->e_scnum); - in->n_type = bfd_h_get_x(abfd, ext->e_type); - in->n_sclass = bfd_h_get_x(abfd, ext->e_sclass); - in->n_numaux = bfd_h_get_x(abfd, ext->e_numaux); -} - -GDB_EXPORT void -DEFUN(bfd_coff_swap_sym_out,(abfd,in, ext), - bfd *abfd AND - struct internal_syment *in AND - SYMENT *ext) -{ - if(in->_n._n_name[0] == 0) { - bfd_h_putlong(abfd, 0, ext->e.e.e_zeroes); - bfd_h_putlong(abfd, in->_n._n_n._n_offset, ext->e.e.e_offset); - } - else { - memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); - } - bfd_h_put_x(abfd, in->n_value , ext->e_value); - bfd_h_put_x(abfd, in->n_scnum , ext->e_scnum); - bfd_h_put_x(abfd, in->n_type , ext->e_type); - bfd_h_put_x(abfd, in->n_sclass , ext->e_sclass); - bfd_h_put_x(abfd, in->n_numaux , ext->e_numaux); -} - -GDB_EXPORT void -DEFUN(bfd_coff_swap_aux_in,(abfd, ext, type, class, in), - bfd *abfd AND - AUXENT *ext AND - int type AND - int class AND - union internal_auxent *in) -{ - switch (class) { - case C_FILE: - if (ext->x_file.x_fname[0] == 0) { - in->x_file.x_n.x_zeroes = 0; - in->x_file.x_n.x_offset = bfd_h_getlong(abfd, ext->x_file.x_n.x_offset); - } - - break; - case C_STAT: -#ifdef C_LEAFSTAT - case C_LEAFSTAT: -#endif - case C_HIDDEN: - if (type == T_NULL) { - in->x_scn.x_scnlen = bfd_h_get_x(abfd, ext->x_scn.x_scnlen); - in->x_scn.x_nreloc = bfd_h_get_x(abfd, ext->x_scn.x_nreloc); - in->x_scn.x_nlinno = bfd_h_get_x(abfd, ext->x_scn.x_nlinno); - break; - } - default: - in->x_sym.x_tagndx = bfd_h_get_x(abfd, ext->x_sym.x_tagndx); - in->x_sym.x_tvndx = bfd_h_get_x(abfd, ext->x_sym.x_tvndx); - - if (ISARY(type) || class == C_BLOCK) { - in->x_sym.x_fcnary.x_ary.x_dimen[0] = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[0]); - in->x_sym.x_fcnary.x_ary.x_dimen[1] = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[1]); - in->x_sym.x_fcnary.x_ary.x_dimen[2] = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[2]); - in->x_sym.x_fcnary.x_ary.x_dimen[3] = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[3]); - } - else { - in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); - in->x_sym.x_fcnary.x_fcn.x_endndx = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx); - } - if (ISFCN(type)) { - in->x_sym.x_misc.x_fsize = bfd_h_get_x(abfd, ext->x_sym.x_misc.x_fsize); - } - else { - in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_x(abfd, ext->x_sym.x_misc.x_lnsz.x_lnno); - in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_x(abfd, ext->x_sym.x_misc.x_lnsz.x_size); - } - } -} - -GDB_EXPORT void -DEFUN(bfd_coff_swap_aux_out,(abfd, in, type, class, ext), - bfd *abfd AND - union internal_auxent *in AND - int type AND - int class AND - AUXENT *ext) -{ - switch (class) { - case C_FILE: - if (in->x_file.x_fname[0] == 0) { - bfd_h_put_x(abfd, 0, ext->x_file.x_n.x_zeroes ); - bfd_h_put_x(abfd, in->x_file.x_n.x_offset, ext->x_file.x_n.x_offset); - } - - break; - case C_STAT: -#ifdef C_LEAFSTAT - case C_LEAFSTAT: -#endif - case C_HIDDEN: - if (type == T_NULL) { - bfd_h_put_x(abfd, in->x_scn.x_scnlen, ext->x_scn.x_scnlen); - bfd_h_put_x(abfd, in->x_scn.x_nreloc, ext->x_scn.x_nreloc); - bfd_h_put_x(abfd, in->x_scn.x_nlinno, ext->x_scn.x_nlinno); - break; - } - default: - bfd_h_put_x(abfd, in->x_sym.x_tagndx, ext->x_sym.x_tagndx); - bfd_h_put_x(abfd, in->x_sym.x_tvndx , ext->x_sym.x_tvndx); - - if (ISARY(type) || class == C_BLOCK) { - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0],ext->x_sym.x_fcnary.x_ary.x_dimen[0]); - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1],ext->x_sym.x_fcnary.x_ary.x_dimen[1]); - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2],ext->x_sym.x_fcnary.x_ary.x_dimen[2]); - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3],ext->x_sym.x_fcnary.x_ary.x_dimen[3]); - } - else { - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx, ext->x_sym.x_fcnary.x_fcn.x_endndx); - } - if (ISFCN(type)) { - bfd_h_put_x(abfd, in->x_sym.x_misc.x_fsize, ext->x_sym.x_misc.x_fsize); - } - else { - bfd_h_put_x(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, ext->x_sym.x_misc.x_lnsz.x_lnno); - bfd_h_put_x(abfd, in->x_sym.x_misc.x_lnsz.x_size, ext->x_sym.x_misc.x_lnsz.x_size); - } - } -} - -GDB_EXPORT void -DEFUN(bfd_coff_swap_lineno_in,(abfd, ext, in), - bfd *abfd AND - LINENO *ext AND - struct internal_lineno *in) -{ - in->l_addr.l_symndx = bfd_h_get_x(abfd, ext->l_addr.l_symndx); - in->l_lnno = bfd_h_get_x(abfd, ext->l_lnno); -} - -GDB_EXPORT void -DEFUN(bfd_coff_swap_lineno_out,(abfd, in, ext), - bfd *abfd AND - struct internal_lineno *in AND - struct external_lineno *ext) -{ - bfd_h_put_x(abfd, in->l_addr.l_symndx, ext->l_addr.l_symndx); - bfd_h_put_x(abfd, in->l_lnno, ext->l_lnno); -} - - - - -GDB_EXPORT void -DEFUN(bfd_swap_aouthdr_in,(abfd, aouthdr_ext, aouthdr_int), - bfd *abfd AND - AOUTHDR *aouthdr_ext AND - struct internal_aouthdr *aouthdr_int) -{ - aouthdr_int->magic = bfd_h_get_x(abfd, aouthdr_ext->magic); - aouthdr_int->vstamp = bfd_h_get_x(abfd, aouthdr_ext->vstamp); - aouthdr_int->tsize = bfd_h_get_x(abfd, aouthdr_ext->tsize); - aouthdr_int->dsize = bfd_h_get_x(abfd, aouthdr_ext->dsize); - aouthdr_int->bsize = bfd_h_get_x(abfd, aouthdr_ext->bsize); - aouthdr_int->entry = bfd_h_get_x(abfd, aouthdr_ext->entry); - aouthdr_int->text_start = bfd_h_get_x(abfd, aouthdr_ext->text_start); - aouthdr_int->data_start = bfd_h_get_x(abfd, aouthdr_ext->data_start); -#ifdef I960 - aouthdr_int->tagentries = bfd_h_get_x(abfd, aouthdr_ext->tagentries); -#endif -} - -GDB_EXPORT void -DEFUN(bfd_swap_aouthdr_out,(abfd, aouthdr_in, aouthdr_out), - bfd *abfd AND - struct internal_aouthdr *aouthdr_in AND - AOUTHDR *aouthdr_out) -{ - bfd_h_put_x(abfd, aouthdr_in->magic, aouthdr_out->magic); - bfd_h_put_x(abfd, aouthdr_in->vstamp, aouthdr_out->vstamp); - bfd_h_put_x(abfd, aouthdr_in->tsize, aouthdr_out->tsize); - bfd_h_put_x(abfd, aouthdr_in->dsize, aouthdr_out->dsize); - bfd_h_put_x(abfd, aouthdr_in->bsize, aouthdr_out->bsize); - bfd_h_put_x(abfd, aouthdr_in->entry, aouthdr_out->entry); - bfd_h_put_x(abfd, aouthdr_in->text_start, aouthdr_out->text_start); - bfd_h_put_x(abfd, aouthdr_in->data_start, aouthdr_out->data_start); -#ifdef I960 - bfd_h_put_x(abfd, aouthdr_in->tagentries, aouthdr_out->tagentries); -#endif -} - -GDB_EXPORT void -DEFUN(bfd_coff_swap_scnhdr_in,(abfd, scnhdr_ext, scnhdr_int), - bfd *abfd AND - SCNHDR *scnhdr_ext AND - struct internal_scnhdr *scnhdr_int) -{ - memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof(scnhdr_int->s_name)); - scnhdr_int->s_vaddr = bfd_h_get_x(abfd, scnhdr_ext->s_vaddr); - scnhdr_int->s_paddr = bfd_h_get_x(abfd, scnhdr_ext->s_paddr); - scnhdr_int->s_size = bfd_h_get_x(abfd, scnhdr_ext->s_size); - scnhdr_int->s_scnptr = bfd_h_get_x(abfd, scnhdr_ext->s_scnptr); - scnhdr_int->s_relptr = bfd_h_get_x(abfd, scnhdr_ext->s_relptr); - scnhdr_int->s_lnnoptr = bfd_h_get_x(abfd, scnhdr_ext->s_lnnoptr); - scnhdr_int->s_nreloc = bfd_h_get_x(abfd, scnhdr_ext->s_nreloc); - scnhdr_int->s_nlnno = bfd_h_get_x(abfd, scnhdr_ext->s_nlnno); - scnhdr_int->s_flags = bfd_h_get_x(abfd, scnhdr_ext->s_flags); -#ifdef I960 - scnhdr_int->s_align = bfd_h_get_x(abfd, scnhdr_ext->s_align); -#endif -} - -static void -DEFUN(swap_scnhdr_out,(abfd, scnhdr_int, scnhdr_ext), - bfd *abfd AND - struct internal_scnhdr *scnhdr_int AND - SCNHDR *scnhdr_ext) -{ - memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof(scnhdr_int->s_name)); - bfd_h_put_x(abfd, scnhdr_int->s_vaddr, scnhdr_ext->s_vaddr); - bfd_h_put_x(abfd, scnhdr_int->s_paddr, scnhdr_ext->s_paddr); - bfd_h_put_x(abfd, scnhdr_int->s_size, scnhdr_ext->s_size); - bfd_h_put_x(abfd, scnhdr_int->s_scnptr, scnhdr_ext->s_scnptr); - bfd_h_put_x(abfd, scnhdr_int->s_relptr, scnhdr_ext->s_relptr); - bfd_h_put_x(abfd, scnhdr_int->s_lnnoptr, scnhdr_ext->s_lnnoptr); - bfd_h_put_x(abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc); - bfd_h_put_x(abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno); - bfd_h_put_x(abfd, scnhdr_int->s_flags, scnhdr_ext->s_flags); -#ifdef I960 - bfd_h_put_x(abfd, scnhdr_int->s_align, scnhdr_ext->s_align); -#endif -} - -/* - initialize a section structure with information peculiar to this - particular implementation of coff -*/ - -static boolean -DEFUN(coff_new_section_hook,(abfd_ignore, section_ignore), - bfd *abfd_ignore AND - asection *section_ignore) -{ -#ifdef MC88MAGIC - /* FIXME, shouldn't this ifdef be on something that says we are - actually COMPILING FOR an 88K coff file, rather than simply - knowing its magic number? */ - /* Align to at least 16 bytes */ - section_ignore->alignment_power = 4; -#endif -#if M68 - section_ignore->alignment_power = 3; -#endif - return true; -} - -/* Take a section header read from a coff file (in HOST byte order), - and make a BFD "section" out of it. */ -static boolean -DEFUN(make_a_section_from_file,(abfd, hdr), - bfd *abfd AND - struct internal_scnhdr *hdr) -{ - asection *return_section; - - { - /* Assorted wastage to null-terminate the name, thanks AT&T! */ - char *name = bfd_alloc(abfd, sizeof (hdr->s_name)+1); - if (name == NULL) { - bfd_error = no_memory; - return false; - } - strncpy(name, (char *) &hdr->s_name[0], sizeof (hdr->s_name)); - name[sizeof (hdr->s_name)] = 0; - - return_section = bfd_make_section(abfd, name); - } - - /* s_paddr is presumed to be = to s_vaddr */ -#define assign(to, from) return_section->to = hdr->from - assign(vma, s_vaddr); - /* assign (vma, s_vaddr); */ - assign(size, s_size); - assign(filepos, s_scnptr); - assign(rel_filepos, s_relptr); - assign(reloc_count, s_nreloc); -#ifdef I960 - { - /* FIXME, use a temp var rather than alignment_power */ - assign(alignment_power, s_align); - { - unsigned int i; - for (i = 0; i < 32; i++) { - if ((1 << i) >= (int) (return_section->alignment_power)) { - return_section->alignment_power = i; - break; - } - } - } - } -#endif - assign(line_filepos, s_lnnoptr); - /* - return_section->linesize = hdr->s_nlnno * sizeof (struct lineno); - */ - -#undef assign - return_section->lineno_count = hdr->s_nlnno; - return_section->userdata = NULL; - return_section->next = (asection *) NULL; - return_section->flags = 0; - if ((hdr->s_flags & STYP_TEXT) || (hdr->s_flags & STYP_DATA)) - return_section->flags = (SEC_LOAD | SEC_ALLOC); - else if (hdr->s_flags & STYP_BSS) - return_section->flags = SEC_ALLOC; - - if (hdr->s_nreloc != 0) - return_section->flags |= SEC_RELOC; - if (hdr->s_scnptr != 0) - return_section->flags |= SEC_HAS_CONTENTS; - return true; -} -static boolean -DEFUN(coff_mkobject,(abfd), - bfd *abfd) -{ - set_tdata (abfd, bfd_zalloc (abfd,sizeof(coff_data_type))); - if (coff_data(abfd) == 0) { - bfd_error = no_memory; - return false; - } - coff_data(abfd)->relocbase = 0; - return true; -} - -static -bfd_target * -DEFUN(coff_real_object_p,(abfd, nscns, internal_f, internal_a), - bfd *abfd AND - unsigned nscns AND - struct internal_filehdr *internal_f AND - struct internal_aouthdr *internal_a) -{ - coff_data_type *coff; - - size_t readsize; /* length of file_info */ - SCNHDR *external_sections; - - /* Build a play area */ - if (coff_mkobject(abfd) != true) - return 0; - coff = coff_data(abfd); - - - external_sections = (SCNHDR *)bfd_alloc(abfd, readsize = (nscns * SCNHSZ)); - if (bfd_read((PTR)external_sections, 1, readsize, abfd) != readsize) { - goto fail; - } - - - - /* Now copy data as required; construct all asections etc */ - coff->symbol_index_slew = 0; - coff->relocbase =0; - coff->raw_syment_count = 0; - coff->raw_linenos = 0; - coff->raw_syments = 0; - coff->sym_filepos =0; - coff->flags = internal_f->f_flags; - if (nscns != 0) { - unsigned int i; - for (i = 0; i < nscns; i++) { - struct internal_scnhdr tmp; - bfd_coff_swap_scnhdr_in(abfd, external_sections + i, &tmp); - make_a_section_from_file(abfd,&tmp); - } - } - /* Determine the machine architecture and type. */ - abfd->obj_machine = 0; - switch (internal_f->f_magic) { -#ifdef MIPS -case MIPS_MAGIC_1: -case MIPS_MAGIC_2: -case MIPS_MAGIC_3: - abfd->obj_arch = bfd_arch_mips; - abfd->obj_machine = 0; - break; -#endif - -#ifdef MC68MAGIC - case MC68MAGIC: - case M68MAGIC: - abfd->obj_arch = bfd_arch_m68k; - abfd->obj_machine = 68020; - break; -#endif -#ifdef MC88MAGIC - case MC88MAGIC: - case MC88DMAGIC: - case MC88OMAGIC: - abfd->obj_arch = bfd_arch_m88k; - abfd->obj_machine = 88100; - break; -#endif -#ifdef I960 -#ifdef I960ROMAGIC - case I960ROMAGIC: - case I960RWMAGIC: - abfd->obj_arch = bfd_arch_i960; - switch (F_I960TYPE & internal_f->f_flags) - { - default: - case F_I960CORE: - abfd->obj_machine = bfd_mach_i960_core; - break; - case F_I960KB: - abfd->obj_machine = bfd_mach_i960_kb_sb; - break; - case F_I960MC: - abfd->obj_machine = bfd_mach_i960_mc; - break; - case F_I960XA: - abfd->obj_machine = bfd_mach_i960_xa; - break; - case F_I960CA: - abfd->obj_machine = bfd_mach_i960_ca; - break; - case F_I960KA: - abfd->obj_machine = bfd_mach_i960_ka_sa; - break; - - } - break; -#endif -#endif - - default: /* Unreadable input file type */ - abfd->obj_arch = bfd_arch_obscure; - break; - } - - if (!(internal_f->f_flags & F_RELFLG)) - abfd->flags |= HAS_RELOC; - if ((internal_f->f_flags & F_EXEC)) - abfd->flags |= EXEC_P; - if (!(internal_f->f_flags & F_LNNO)) - abfd->flags |= HAS_LINENO; - if (!(internal_f->f_flags & F_LSYMS)) - abfd->flags |= HAS_LOCALS; - - - bfd_get_symcount(abfd) = internal_f->f_nsyms; - if (internal_f->f_nsyms) - abfd->flags |= HAS_SYMS; - - coff->sym_filepos = internal_f->f_symptr; - - - - coff->symbols = (coff_symbol_type *) NULL; - bfd_get_start_address(abfd) = internal_f->f_opthdr ? internal_a->entry : 0; - - return abfd->xvec; - fail: - bfd_release(abfd, coff); - return (bfd_target *)NULL; -} - -static bfd_target * -DEFUN(coff_object_p,(abfd), - bfd *abfd) - { - int nscns; - FILHDR filehdr; - AOUTHDR opthdr; - struct internal_filehdr internal_f; - struct internal_aouthdr internal_a; - - bfd_error = system_call_error; - - /* figure out how much to read */ - if (bfd_read((PTR) &filehdr, 1, FILHSZ, abfd) != FILHSZ) - return 0; - - bfd_swap_filehdr_in(abfd, &filehdr, &internal_f); - - if (BADMAG(internal_f)) { - bfd_error = wrong_format; - return 0; - } - nscns =internal_f.f_nscns; - - if (internal_f.f_opthdr) { - if (bfd_read((PTR) &opthdr, 1,AOUTSZ, abfd) != AOUTSZ) { - return 0; - } - bfd_swap_aouthdr_in(abfd, &opthdr, &internal_a); - } - - /* Seek past the opt hdr stuff */ - bfd_seek(abfd, internal_f.f_opthdr + FILHSZ, SEEK_SET); - - /* if the optional header is NULL or not the correct size then - quit; the only difference I can see between m88k dgux headers (MC88DMAGIC) - and Intel 960 readwrite headers (I960WRMAGIC) is that the - optional header is of a different size. - - But the mips keeps extra stuff in it's opthdr, so dont check - when doing that - */ - -#ifndef MIPS - if (internal_f.f_opthdr != 0 && AOUTSZ != internal_f.f_opthdr) - return (bfd_target *)NULL; -#endif - - return coff_real_object_p(abfd, nscns, &internal_f, &internal_a); - } - - - - -/* -Takes a bfd and a symbol, returns a pointer to the coff specific area -of the symbol if there is one. -*/ -static coff_symbol_type * -DEFUN(coff_symbol_from,(abfd, symbol), - bfd *abfd AND - asymbol *symbol) -{ - if (symbol->the_bfd->xvec->flavour != bfd_target_coff_flavour_enum) - return (coff_symbol_type *)NULL; - - if (symbol->the_bfd->tdata == (PTR)NULL) - return (coff_symbol_type *)NULL; - - return (coff_symbol_type *) symbol; -} - - - - - - - -static void -DEFUN(coff_count_linenumbers,(abfd), - bfd *abfd) -{ - unsigned int limit = bfd_get_symcount(abfd); - unsigned int i; - asymbol **p; - { - asection *s = abfd->sections->output_section; - while (s) { - BFD_ASSERT(s->lineno_count == 0); - s = s->next; - } - } - - - for (p = abfd->outsymbols, i = 0; i < limit; i++, p++) { - asymbol *q_maybe = *p; - if (q_maybe->the_bfd->xvec->flavour == bfd_target_coff_flavour_enum) { - coff_symbol_type *q = coffsymbol(q_maybe); - if (q->lineno) { - /* - This symbol has a linenumber, increment the owning - section's linenumber count - */ - alent *l = q->lineno; - q->symbol.section->output_section->lineno_count++; - l++; - while (l->line_number) { - q->symbol.section->output_section->lineno_count++; - l++; - } - } - } - } -} - -/* - This function returns true if the supplied SYMENT has an AUXENT with - a tagndx field which should be relocated. - - The coff book says that all auxents have this and should be moved, - but all the actual implementations I've looked at do this .. - (sac@cygnus.com) - -*/ -static boolean -DEFUN(uses_x_sym_x_tagndx_p,(abfd, native), - bfd *abfd AND - struct internal_syment *native) -{ - if (BTYPE(native->n_type) == T_STRUCT) return true; - if (BTYPE(native->n_type) == T_UNION) return true; - if (BTYPE(native->n_type) == T_ENUM) return true; - return false; -} - - -/* -This procedure runs through the native entries in a coff symbol table -and links up all the elements which should point to one another, in -particular these are: - -strtag, entag and untags have an auxent endindex which points to the -first syment after the .eos. This is simple to do, we just keep a -pointer to the symbol with the most recent pending strtag and patch it -when we see the eos. This works since coff structs are never nested. - -ISFCN type entries have an endindex which points to the next static or -extern in the table, thereby skipping the function contents. -The coff book says that an ISFCN's tagindex -points to the first .bf for the function, so far I havn't seen it -used. We do this using the same mechanism as strtags. - -Each file entry has a value which points to the next file entry, -the last file entry points to the first extern symbol in the table -which is not an ISFCN. - -Each .bb entry points to the matching .eb entry, but these are nested -so we keep a stack of them. - -The tagndx of .eos items points to the strtag attached to them, this -is simply the last_tagndx again. - -The tagndx of items with type strtag point to the defining struct. -This bit is complicated; We know that a struct ref and def must be -within the same file, so all the natives will be in the same vector. -This means that we can subtracts two pointers and get the index -differences between to items, used to work out the true index of the -target. - -We store in the name field of each syment the actual native index -applied so we can dig it out through a pointer. */ - -static void -DEFUN(coff_mangle_symbols,(bfd_ptr), - bfd *bfd_ptr) -{ - unsigned int symbol_count = bfd_get_symcount(bfd_ptr); - asymbol **symbol_ptr_ptr = bfd_ptr->outsymbols; - struct internal_syment *last_tagndx = (struct internal_syment *)NULL; - struct internal_syment *last_file = (struct internal_syment *)NULL; - struct internal_syment *last_fcn = (struct internal_syment *)NULL; - struct internal_syment *block_stack[50]; - struct internal_syment **last_block = &block_stack[0]; - boolean first_time = true; - unsigned int symbol_index; - unsigned int native_index = 0; - - for (symbol_index = 0; symbol_index < symbol_count; symbol_index++) { - coff_symbol_type *coff_symbol_ptr = - coff_symbol_from(bfd_ptr, symbol_ptr_ptr[symbol_index]); - if (coff_symbol_ptr == (coff_symbol_type *)NULL) { - /* - This symbol has no coff information in it, it will take up - only one slot in the output symbol table - */ - native_index++; - } - else { - struct internal_syment *syment = coff_symbol_ptr->native; - if (syment == (struct internal_syment *)NULL) { - native_index++; - } - else { - /* Normalize the symbol flags */ - if (coff_symbol_ptr->symbol.flags & BSF_FORT_COMM) { - /* a common symbol is undefined with a value */ - syment->n_scnum = N_UNDEF; - syment->n_value = coff_symbol_ptr->symbol.value; - } - else if (coff_symbol_ptr->symbol.flags & BSF_DEBUGGING) { - syment->n_value = coff_symbol_ptr->symbol.value; - } - else if (coff_symbol_ptr->symbol.flags & BSF_UNDEFINED) { - syment->n_scnum = N_UNDEF; - syment->n_value = 0; - } - else if (coff_symbol_ptr->symbol.flags & BSF_ABSOLUTE) { - syment->n_scnum = N_ABS; - syment->n_value = coff_symbol_ptr->symbol.value; - } - else { - syment->n_scnum = - coff_symbol_ptr->symbol.section->output_section->index+1; - - syment->n_value = - coff_symbol_ptr->symbol.value + - coff_symbol_ptr->symbol.section->output_offset + - coff_symbol_ptr->symbol.section->output_section->vma; - } - - - /* If this symbol ties up something then do it */ - - if (syment->n_sclass == C_FILE && last_file != (struct internal_syment *)NULL) - { - last_file->n_value = native_index; - } - else if ((syment->n_sclass == C_EXT - || syment->n_sclass == C_STAT -#ifdef C_LEAFEXT - || syment->n_sclass == C_LEAFEXT - || syment->n_sclass == C_LEAFSTAT -#endif - ) - && last_fcn != (struct internal_syment *)NULL) - { - union internal_auxent *auxent = (union internal_auxent *)(last_fcn+1); - auxent->x_sym.x_fcnary.x_fcn.x_endndx = native_index; - last_fcn = (struct internal_syment *)NULL; - - } - else if (syment->n_sclass == C_EOS && last_tagndx != (struct internal_syment*)NULL) - { - union internal_auxent *auxent = (union internal_auxent *)(last_tagndx+1); - /* Remember that we keep the native index in the offset - so patch the beginning of the struct to point to this - */ - auxent->x_sym.x_tagndx = last_tagndx->_n._n_n._n_offset; - auxent->x_sym.x_fcnary.x_fcn.x_endndx = syment->n_numaux + 1 + native_index; - /* Now point the eos to the structure */ - auxent = (union internal_auxent *)(syment+1); - auxent->x_sym.x_tagndx = last_tagndx->_n._n_n._n_offset; - } - else if (syment->n_sclass == C_BLOCK - && coff_symbol_ptr->symbol.name[1] == 'e') - { - union internal_auxent *auxent = (union internal_auxent *)((*(--last_block))+1); - auxent->x_sym.x_fcnary.x_fcn.x_endndx = native_index + syment->n_numaux + 1; - } - if (syment->n_sclass == C_EXT - && !ISFCN(syment->n_type) - && first_time == true - && last_file != (struct internal_syment *)NULL) { - /* This is the first external symbol seen which isn't a - function place it in the last .file entry */ - last_file->n_value = native_index; - first_time = false; - } -#ifdef C_LEAFPROC - if (syment->n_sclass == C_LEAFPROC && - syment->n_numaux == 2) { - union internal_auxent *auxent = (union internal_auxent *)(syment+2); - /* This is the definition of a leaf proc, we'll relocate the - address */ - auxent->x_bal.x_balntry = - coff_symbol_ptr->symbol.section->output_offset + - coff_symbol_ptr->symbol.section->output_section->vma + - auxent->x_bal.x_balntry ; - } -#endif - /* If this symbol needs to be tied up then remember some facts */ - if (syment->n_sclass == C_FILE) - { - last_file = syment; - } - if (syment->n_numaux != 0) { - /* - If this symbol would like to point to something in the - future then remember where it is - */ - if (uses_x_sym_x_tagndx_p(bfd_ptr, syment)) { - /* - If this is a ref to a structure then we'll tie it up - now - there are never any forward refs for one - */ - if (syment->n_sclass == C_STRTAG || - syment->n_sclass == C_ENTAG || - syment->n_sclass == C_UNTAG) { - last_tagndx = syment; - } - else { - /* - This is a ref to a structure - the structure must - have been defined within the same file, and previous - to this point, so we can deduce the new tagndx - directly. - */ - union internal_auxent *auxent = (union internal_auxent *)(syment+1); - bfd *bfd_ptr = coff_symbol_ptr->symbol.the_bfd; - struct internal_syment *base = obj_raw_syments(bfd_ptr); - auxent->x_sym.x_tagndx = base[auxent->x_sym.x_tagndx]._n._n_n._n_offset; - - - } - } - if (ISFCN(syment->n_type)) { - last_fcn = syment; - } - if (syment->n_sclass == C_BLOCK - && coff_symbol_ptr->symbol.name[1] == 'b') - { - *last_block++ = syment; - } - } - syment->_n._n_n._n_offset = native_index; - native_index = native_index + 1 + syment->n_numaux; - } - } - } -} - - -static void -DEFUN(coff_write_symbols,(abfd), -bfd *abfd) -{ - unsigned int i; - unsigned int limit = bfd_get_symcount(abfd); - unsigned int written = 0; - struct internal_syment dummy; - asymbol **p; - unsigned int string_size = 0; - - - /* Seek to the right place */ - bfd_seek(abfd, obj_sym_filepos(abfd), SEEK_SET); - - /* Output all the symbols we have */ - - written = 0; - for (p = abfd->outsymbols, i = 0; i < limit; i++, p++) { - asymbol *symbol = *p; - coff_symbol_type *c_symbol = coff_symbol_from(abfd, symbol); - - unsigned int j; - struct internal_syment *native; - if (c_symbol == (coff_symbol_type *) NULL || - c_symbol->native == (struct internal_syment *) NULL) { - /* - This symbol has been created by the loader, or come from a non - coff format. It has no native element to inherit, make our - own - */ - - native = &dummy; - native->n_type = T_NULL; -#ifdef I960 - native->n_flags = 0; -#endif - if (symbol->flags & BSF_ABSOLUTE) { - native->n_scnum = N_ABS; - native->n_value = symbol->value; - } - else if (symbol->flags & (BSF_UNDEFINED | BSF_FORT_COMM)) { - native->n_scnum = N_UNDEF; - native->n_value = symbol->value; - } - else if (symbol->flags & BSF_DEBUGGING) { - /* - remove name so it doesn't take up any space - */ - symbol->name = ""; - continue; - } - else { - native->n_scnum = symbol->section->output_section->index + - 1; - native->n_value = symbol->value + - symbol->section->output_section->vma + - symbol->section->output_offset; -#ifdef I960 - /* Copy the any flags from the the file hdr into the symbol */ - { - coff_symbol_type *c = coff_symbol_from(abfd, symbol); - if (c != (coff_symbol_type *)NULL) { - native->n_flags = c->symbol.the_bfd->flags; - } - } -#endif - } - -#ifdef HASPAD1 - native->pad1[0] = 0; - native->pad1[0] = 0; -#endif - - native->n_type = 0; - if (symbol->flags & BSF_LOCAL) - native->n_sclass = C_STAT; - else - native->n_sclass = C_EXT; - native->n_numaux = 0; - } - else - /* - Does this symbol have an ascociated line number - if so then - make it remember this symbol index. Also tag the auxent of - this symbol to point to the right place in the lineno table - */ - { - alent *lineno = c_symbol->lineno; - native = c_symbol->native; - if (lineno) { - unsigned int count = 0; - lineno[count].u.offset = written; - if (native->n_numaux) { - union internal_auxent *a = (union internal_auxent *) (native + 1); - - a->x_sym.x_fcnary.x_fcn.x_lnnoptr = - c_symbol->symbol.section->output_section->moving_line_filepos; - } - /* - And count and relocate all other linenumbers - */ - count++; - while (lineno[count].line_number) { - lineno[count].u.offset += - c_symbol->symbol.section->output_section->vma + - c_symbol->symbol.section->output_offset; - count++; - } - c_symbol->symbol.section->output_section->moving_line_filepos += - count * LINESZ; - - } - } /* if symbol new to coff */ - - /* Fix the symbol names */ - { - unsigned int name_length; - if (symbol->name == (char *) NULL) { - /* - coff symbols always have names, so we'll make one up - */ - symbol->name = "strange"; - } - name_length = strlen(symbol->name); - if (name_length <= SYMNMLEN) { - /* This name will fit into the symbol neatly */ - strncpy(native->_n._n_name, symbol->name, SYMNMLEN); - } - else { - native->_n._n_n._n_offset = string_size + 4; - native->_n._n_n._n_zeroes = 0; - string_size += name_length + 1; - } - { - unsigned int numaux = native->n_numaux; - int type = native->n_type; - int class = native->n_sclass; - SYMENT buf; - bfd_coff_swap_sym_out(abfd, native, &buf); - bfd_write((PTR)& buf, 1, SYMESZ, abfd); - for (j = 0; j != native->n_numaux; - j++) { - AUXENT buf1; - bfd_coff_swap_aux_out(abfd, - (union internal_auxent *)(native + j + 1), type, class, &buf1); - bfd_write((PTR) (native + j + 1), 1, AUXESZ, abfd); - } - /* - Reuse somewhere in the symbol to keep the index - */ - set_index(symbol, written); - written += 1 + numaux; - } - } - } /* for each out symbol */ - - bfd_get_symcount(abfd) = written; - /* Now write out strings */ - - if (string_size) { - unsigned int size = string_size + 4; - size = size; - bfd_write((PTR) &size, 1, sizeof(size), abfd); - for (p = abfd->outsymbols, i = 0; i < limit; i++, p++) { - asymbol *q = *p; - size_t name_length = strlen(q->name); - if (name_length > SYMNMLEN) { - bfd_write((PTR) (q->name), 1, name_length + 1, abfd); - } - } - } - else { - /* We would normally not write anything here, but we'll write - out 4 so that any stupid coff reader which tries to read - the string table even when there isn't one won't croak. - */ - - uint32e_type size = 4; - size = size; - bfd_write((PTR)&size, 1, sizeof(size), abfd); - - } - -} - -static void -coff_write_relocs(abfd) -bfd *abfd; - { - asection *s; - for (s = abfd->sections; s != (asection *) NULL; s = s->next) { - unsigned int i; - struct external_reloc dst; - - arelent **p = s->orelocation; - bfd_seek(abfd, s->rel_filepos, SEEK_SET); - for (i = 0; i < s->reloc_count; i++) { - struct internal_reloc n; - arelent *q = p[i]; - memset((PTR)&n, 0, sizeof(n)); - n.r_vaddr = q->address + s->vma; - if (q->sym_ptr_ptr) { - n.r_symndx = get_index((*(q->sym_ptr_ptr))); - } -#ifdef SELECT_RELOC - /* Work out reloc type from what is required */ - SELECT_RELOC(n.r_type, q->howto); -#else - n.r_type = q->howto->type; -#endif - bfd_swap_reloc_out(abfd, &n, &dst); - bfd_write((PTR) &n, 1, RELSZ, abfd); - } - } - } - -static void -DEFUN(coff_write_linenumbers,(abfd), - bfd *abfd) - { - asection *s; - for (s = abfd->sections; s != (asection *) NULL; s = s->next) { - if (s->lineno_count) { - asymbol **q = abfd->outsymbols; - bfd_seek(abfd, s->line_filepos, SEEK_SET); - /* Find all the linenumbers in this section */ - while (*q) { - asymbol *p = *q; - alent *l = BFD_SEND(p->the_bfd, _get_lineno, (p->the_bfd, p)); - if (l) { - /* Found a linenumber entry, output */ - struct internal_lineno out; - LINENO buff; - bzero( (PTR)&out, sizeof(out)); - out.l_lnno = 0; - out.l_addr.l_symndx = l->u.offset; - bfd_coff_swap_lineno_out(abfd, &out, &buff); - bfd_write((PTR) &buff, 1, LINESZ, abfd); - l++; - while (l->line_number) { - out.l_lnno = l->line_number; - out.l_addr.l_symndx = l->u.offset; - bfd_coff_swap_lineno_out(abfd, &out, &buff); - bfd_write((PTR) &buff, 1, LINESZ, abfd); - l++; - } - } - q++; - } - } - } - } - - -static asymbol * -coff_make_empty_symbol(abfd) -bfd *abfd; - { - coff_symbol_type *new = (coff_symbol_type *) bfd_alloc(abfd, sizeof(coff_symbol_type)); - if (new == NULL) { - bfd_error = no_memory; - return (NULL); - } /* on error */ - new->native = 0; - new->lineno = (alent *) NULL; - new->symbol.the_bfd = abfd; - return &new->symbol; - } - -static void -coff_print_symbol(ignore_abfd, file, symbol, how) -bfd *ignore_abfd; -FILE *file; -asymbol *symbol; -bfd_print_symbol_enum_type how; - { - switch (how) { - case bfd_print_symbol_name_enum: - fprintf(file, "%s", symbol->name); - break; - case bfd_print_symbol_type_enum: - fprintf(file, "coff %lx %lx", (unsigned long) coffsymbol(symbol)->native, - (unsigned long) coffsymbol(symbol)->lineno); - break; - case bfd_print_symbol_all_enum: - { - CONST char *section_name = symbol->section == (asection *) NULL ? - "*abs" : symbol->section->name; - bfd_print_symbol_vandf((PTR) file, symbol); - - fprintf(file, " %-5s %s %s %s", - section_name, - coffsymbol(symbol)->native ? "n" : "g", - coffsymbol(symbol)->lineno ? "l" : " ", - symbol->name); - } - - - break; - } - } - -static alent * -coff_get_lineno(ignore_abfd, symbol) -bfd *ignore_abfd; -asymbol *symbol; - { - return coffsymbol(symbol)->lineno; - } - -/* -Set flags and magic number of a coff file from architecture and machine -type. Result is true if we can represent the arch&type, false if not. -*/ -static boolean -coff_set_flags(abfd, magicp, flagsp) -bfd *abfd; -unsigned *magicp, -*flagsp; - { - - switch (abfd->obj_arch) { - -#ifdef I960ROMAGIC - - case bfd_arch_i960: - - { - unsigned flags; - *magicp = I960ROMAGIC; - /* - ((bfd_get_file_flags(abfd) & WP_TEXT) ? I960ROMAGIC : - I960RWMAGIC); FIXME??? - */ - switch (abfd->obj_machine) { - case bfd_mach_i960_core: - flags = F_I960CORE; - break; - case bfd_mach_i960_kb_sb: - flags = F_I960KB; - break; - case bfd_mach_i960_mc: - flags = F_I960MC; - break; - case bfd_mach_i960_xa: - flags = F_I960XA; - break; - case bfd_mach_i960_ca: - flags = F_I960CA; - break; - case bfd_mach_i960_ka_sa: - flags = F_I960KA; - break; - default: - return false; - } - *flagsp = flags; - return true; - } - break; -#endif -#ifdef MIPS - case bfd_arch_mips: - *magicp = MIPS_MAGIC_2; - return true; - break; -#endif -#ifdef MC68MAGIC - case bfd_arch_m68k: - *magicp = MC68MAGIC; - return true; -#endif - -#ifdef MC88MAGIC - case bfd_arch_m88k: - *magicp = MC88OMAGIC; - return true; - break; -#endif - - default: /* Unknown architecture */ - return false; - } - - return false; - } - - -static boolean -coff_set_arch_mach(abfd, arch, machine) -bfd *abfd; -enum bfd_architecture arch; -unsigned long machine; - { - unsigned dummy1, - dummy2; - abfd->obj_arch = arch; - abfd->obj_machine = machine; - if (arch != bfd_arch_unknown && - coff_set_flags(abfd, &dummy1, &dummy2) != true) - return false; /* We can't represent this type */ - return true; /* We're easy ... */ - } - - -/* Calculate the file position for each section. */ - -static void -coff_compute_section_file_positions(abfd) -bfd *abfd; - { - asection *current; - file_ptr sofar = FILHSZ; - if (bfd_get_start_address(abfd)) { - /* - A start address may have been added to the original file. In this - case it will need an optional header to record it. - */ - abfd->flags |= EXEC_P; - } - if (abfd->flags & EXEC_P) - sofar += AOUTSZ; - - - sofar += abfd->section_count * SCNHSZ; - - for (current = abfd->sections; current != NULL; current = - current->next) { - /* Only deal with sections which have contents */ - if (!(current->flags & SEC_HAS_CONTENTS)) - continue; - - /* Align the sections in the file to the same boundary on - which they are aligned in virtual memory. I960 doesn't - do this (FIXME) so we can stay in sync with Intel. 960 - doesn't yet page from files... */ -#ifndef I960 - sofar = ALIGN(sofar, 1 << current->alignment_power); -#endif - /* FIXME, in demand paged files, the low order bits of the file - offset must match the low order bits of the virtual address. - "Low order" is apparently implementation defined. Add code - here to round sofar up to match the virtual address. */ - - current->filepos = sofar; - sofar += current->size; - } - obj_relocbase(abfd) = sofar; - } - - - - -/* SUPPRESS 558 */ -/* SUPPRESS 529 */ -static boolean -DEFUN(coff_write_object_contents,(abfd), -bfd *abfd) -{ - asection *current; - boolean hasrelocs = false; - boolean haslinno = false; - file_ptr reloc_base; - file_ptr lineno_base; - file_ptr sym_base; - file_ptr scn_base; - file_ptr data_base; - unsigned long reloc_size = 0; - unsigned long lnno_size = 0; - asection *text_sec = NULL; - asection *data_sec = NULL; - asection *bss_sec = NULL; - - struct internal_filehdr internal_f; - struct internal_aouthdr internal_a; - - struct icofdata *coff = obj_icof(abfd); - - - bfd_error = system_call_error; - - - if(abfd->output_has_begun == false) { - coff_compute_section_file_positions(abfd); - } - - if (abfd->sections != (asection *)NULL) { - scn_base = abfd->sections->filepos; - } - else { - scn_base = 0; - } - if (bfd_seek(abfd, scn_base, SEEK_SET) != 0) - return false; - reloc_base = obj_relocbase(abfd); - - /* Make a pass through the symbol table to count line number entries and - put them into the correct asections */ - - coff_count_linenumbers(abfd); - data_base = scn_base; - - /* Work out the size of the reloc and linno areas */ - - for (current = abfd->sections; current != NULL; current = current->next) { - reloc_size += current->reloc_count * RELSZ; - lnno_size += current->lineno_count * LINESZ; - data_base += SCNHSZ; - } - - lineno_base = reloc_base + reloc_size; - sym_base = lineno_base + lnno_size; - - /* Indicate in each section->line_filepos its actual file address */ - for (current = abfd->sections; current != NULL; current = current->next) { - if (current->lineno_count) { - current->line_filepos = lineno_base; - current->moving_line_filepos = lineno_base; - lineno_base += current->lineno_count * LINESZ; - } - else { - current->line_filepos = 0; - } - if (current->reloc_count) { - current->rel_filepos = reloc_base; - reloc_base += current->reloc_count * sizeof(struct internal_reloc); - } - else { - current->rel_filepos = 0; - } - } - - /* Write section headers to the file. */ - - bfd_seek(abfd, - (file_ptr) ((abfd->flags & EXEC_P) ? - (FILHSZ + AOUTSZ) : FILHSZ), - SEEK_SET); - - { -#if 0 - unsigned int pad = abfd->flags & D_PAGED ? data_base : 0; -#endif - unsigned int pad = 0; - - for (current = abfd->sections; current != NULL; current = current->next) { - struct internal_scnhdr section; - strncpy(&(section.s_name[0]), current->name, 8); - section.s_vaddr = current->vma + pad; - section.s_paddr = current->vma + pad; - section.s_size = current->size - pad; - /* - If this section has no size or is unloadable then the scnptr - will be 0 too - */ - if (current->size - pad == 0 || - (current->flags & SEC_LOAD) == 0) { - section.s_scnptr = 0; - - } - else { - section.s_scnptr = current->filepos; - } - section.s_relptr = current->rel_filepos; - section.s_lnnoptr = current->line_filepos; - section.s_nreloc = current->reloc_count; - section.s_nlnno = current->lineno_count; - if (current->reloc_count != 0) - hasrelocs = true; - if (current->lineno_count != 0) - haslinno = true; - - if (!strcmp(current->name, _TEXT)) { - text_sec = current; - section.s_flags = STYP_TEXT; /* kinda stupid */ - } - else if (!strcmp(current->name, _DATA)) { - data_sec = current; - section.s_flags = STYP_DATA; /* kinda stupid */ - } - else if (!strcmp(current->name, _BSS)) { - bss_sec = current; - section.s_flags = STYP_BSS; /* kinda stupid */ - } - - -#ifdef I960 - section.s_align = (current->alignment_power - ? 1 << current->alignment_power - : 0); - -#endif - { - SCNHDR buff; - - swap_scnhdr_out(abfd, §ion, &buff); - bfd_write((PTR) (&buff), 1, SCNHSZ, abfd); - - } - pad = 0; - } - } - - /* OK, now set up the filehdr... */ - internal_f.f_nscns = abfd->section_count; - /* - We will NOT put a fucking timestamp in the header here. Every time you - put it back, I will come in and take it out again. I'm sorry. This - field does not belong here. We fill it with a 0 so it compares the - same but is not a reasonable time. -- gnu@cygnus.com - */ - /* - Well, I like it, so I'm conditionally compiling it in. - steve@cygnus.com - */ -#ifdef COFF_TIMESTAMP - internal_f.f_timdat = time(0); -#else - internal_f.f_timdat = 0; -#endif - - if (bfd_get_symcount(abfd) != 0) - internal_f.f_symptr = sym_base; - else - internal_f.f_symptr = 0; - - internal_f.f_flags = 0; - - if (abfd->flags & EXEC_P) - internal_f.f_opthdr = AOUTSZ; - else - internal_f.f_opthdr = 0; - - if (!hasrelocs) - internal_f.f_flags |= F_RELFLG; - if (!haslinno) - internal_f.f_flags |= F_LNNO; - if (0 == bfd_get_symcount(abfd)) - internal_f.f_flags |= F_LSYMS; - if (abfd->flags & EXEC_P) - internal_f.f_flags |= F_EXEC; -#if M88 - internal_f.f_flags |= F_AR32W; -#else - if (!abfd->xvec->byteorder_big_p) - internal_f.f_flags |= F_AR32WR; -#endif - /* - FIXME, should do something about the other byte orders and - architectures. - */ - - /* Set up architecture-dependent stuff */ - - { int magic = 0; - int flags = 0; - coff_set_flags(abfd, &magic, &flags); - internal_f.f_magic = magic; - internal_f.f_flags = flags; - - /* ...and the "opt"hdr... */ - -#ifdef I960 - internal_a.magic = (magic == I960ROMAGIC ? NMAGIC : OMAGIC); -#endif -#if M88 - internal_a.magic = PAGEMAGICBCS; -#endif - } - /* Now should write relocs, strings, syms */ - obj_sym_filepos(abfd) = sym_base; - - if (bfd_get_symcount(abfd) != 0) { - coff_mangle_symbols(abfd); - coff_write_symbols(abfd); - coff_write_linenumbers(abfd); - coff_write_relocs(abfd); - } - if (text_sec) { - internal_a.tsize = text_sec->size; - internal_a.text_start =text_sec->size ? text_sec->vma : 0; - } - if (data_sec) { - internal_a.dsize = data_sec->size; - internal_a.data_start = data_sec->size ? data_sec->vma : 0; - } - if (bss_sec) { - internal_a.bsize = bss_sec->size; - } - - internal_a.entry = bfd_get_start_address(abfd); - internal_f.f_nsyms = bfd_get_symcount(abfd); - - /* now write them */ - if (bfd_seek(abfd, 0L, SEEK_SET) != 0) - return false; - { - FILHDR buff; - bfd_swap_filehdr_out(abfd, &internal_f, &buff); - bfd_write((PTR) &buff, 1, FILHSZ, abfd); - } - if (abfd->flags & EXEC_P) { - AOUTHDR buff; - bfd_swap_aouthdr_out(abfd, &internal_a, &buff); - bfd_write((PTR) &buff, 1, AOUTSZ, abfd); - } - return true; -} - -static boolean -coff_set_section_contents(abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - PTR location; - file_ptr offset; - size_t count; -{ - if (abfd->output_has_begun == false) /* set by bfd.c handler */ - coff_compute_section_file_positions(abfd); - - bfd_seek(abfd, (file_ptr) (section->filepos + offset), SEEK_SET); - - if (count != 0) { - return (bfd_write(location, 1, count, abfd) == count) ? true : false; - } - return true; -} - -static boolean -coff_close_and_cleanup(abfd) - bfd *abfd; -{ - if (!bfd_read_p(abfd)) - switch (abfd->format) { - case bfd_archive: - if (!_bfd_write_archive_contents(abfd)) - return false; - break; - case bfd_object: - if (!coff_write_object_contents(abfd)) - return false; - break; - default: - bfd_error = invalid_operation; - return false; - } - - /* We depend on bfd_close to free all the memory on the obstack. */ - /* FIXME if bfd_release is not using obstacks! */ - return true; -} - - -static PTR -buy_and_read(abfd, where, seek_direction, size) - bfd *abfd; - file_ptr where; - int seek_direction; - size_t size; -{ - PTR area = (PTR) bfd_alloc(abfd, size); - if (!area) { - bfd_error = no_memory; - return (NULL); - } - bfd_seek(abfd, where, seek_direction); - if (bfd_read(area, 1, size, abfd) != size) { - bfd_error = system_call_error; - return (NULL); - } /* on error */ - return (area); -} /* buy_and_read() */ - -static void -DEFUN(offset_symbol_indices,(abfd, symtab, count, offset), - bfd *abfd AND - struct internal_syment *symtab AND - unsigned long count AND - long offset) -{ - struct internal_syment *end = symtab + count; - for (; symtab < end; ++symtab) { - if (symtab->n_sclass == C_FILE) { - symtab->n_value = 0; - } - else if (symtab->n_sclass == C_ALIAS) { - /* - These guys have indices in their values. - */ - symtab->n_value = symtab->n_value + offset; - } - else if (symtab->n_numaux) { - /* - anybody else without an aux, has no indices. - */ - - if (symtab->n_sclass == C_EOS - || (BTYPE(symtab->n_type) == T_STRUCT - && symtab->n_sclass != C_STRTAG) - || BTYPE(symtab->n_type) == T_UNION - || BTYPE(symtab->n_type) == T_ENUM) { - /* If the tagndx is 0 then the struct hasn't really been - defined, so leave it alone */ - - if(((union internal_auxent *) (symtab + 1))->x_sym.x_tagndx != 0) { - ((union internal_auxent *) (symtab + 1))->x_sym.x_tagndx += offset; - } - - } /* These guys have a tagndx */ - if (symtab->n_sclass == C_STRTAG - || symtab->n_sclass == C_UNTAG - || symtab->n_sclass == C_ENTAG - || symtab->n_sclass == C_BLOCK - || symtab->n_sclass == C_FCN - || ISFCN(symtab->n_type)) { - - ((union internal_auxent *) (symtab + - 1))->x_sym.x_fcnary.x_fcn.x_endndx - += offset; - - } /* These guys have an endndx */ -#ifndef I960 - if (ISFCN(symtab->n_type)) { - ((union internal_auxent *) (symtab + 1))->x_sym.x_tvndx += offset; - } /* These guys have a tvndx. I think... - (FIXME) */ -#endif /* Not I960 */ - - } /* if value, else if aux */ - symtab += symtab->n_numaux; - } /* walk the symtab */ - - return; -} /* offset_symbol_indices() */ - -#if 0 -/* swap the entire symbol table - we c*/ -static void -swap_raw_symtab(abfd, raw_symtab) -bfd *abfd; -SYMENT *raw_symtab; - { - long i; - SYMENT *end = raw_symtab + bfd_get_symcount(abfd); - for (; raw_symtab < end; ++raw_symtab) { - bfd_coff_swap_sym(abfd, raw_symtab); - - for (i = raw_symtab->n_numaux; i; --i, ++raw_symtab) { - bfd_coff_swap_aux(abfd, - (AUXENT *)(raw_symtab + 1), - raw_symtab->n_type, - raw_symtab->n_sclass); - } /* swap all the aux entries */ - } /* walk the symbol table */ - - return; - } /* swap_raw_symtab() */ -#endif -/* -read a symbol table into freshly mallocated memory, swap it, and knit the -symbol names into a normalized form. By normalized here I mean that all -symbols have an n_offset pointer that points to a NULL terminated string. -Oh, and the first symbol MUST be a C_FILE. If there wasn't one there -before, put one there. -*/ - -static struct internal_syment * -DEFUN(get_normalized_symtab,(abfd), -bfd *abfd) -{ - - struct internal_syment *internal; - struct internal_syment *internal_ptr; - struct internal_syment *internal_end; - SYMENT *raw; - SYMENT *raw_src; - SYMENT *raw_end; - char *string_table = NULL; - unsigned long size; - char string_table_size_buffer[4]; - unsigned long string_table_size = 0; - unsigned int raw_size; - if (obj_raw_syments(abfd) != (struct internal_syment *)NULL) { - return obj_raw_syments(abfd); - } - if ((size = bfd_get_symcount(abfd) * sizeof(struct internal_syment)) == 0) { - bfd_error = no_symbols; - return (NULL); - } - - internal = (struct internal_syment *)bfd_alloc(abfd, size); - internal_end = internal + bfd_get_symcount(abfd); - - raw_size = bfd_get_symcount(abfd) * SYMESZ; - raw = (SYMENT *)bfd_alloc(abfd,raw_size); - - if (bfd_seek(abfd, obj_sym_filepos(abfd), SEEK_SET) == -1 - || bfd_read((PTR)raw, raw_size, 1, abfd) != raw_size) { - bfd_error = system_call_error; - return (NULL); - } - /* mark the end of the symbols */ - raw_end = raw + bfd_get_symcount(abfd); - /* - FIXME SOMEDAY. A string table size of zero is very weird, but - probably possible. If one shows up, it will probably kill us. - */ - - /* Swap all the raw entries */ - for (raw_src = raw, internal_ptr = internal; raw_src < raw_end; raw_src++, internal_ptr++) { - unsigned int i; - bfd_coff_swap_sym_in(abfd, raw_src,internal_ptr); - for (i = internal_ptr->n_numaux; i; --i, raw_src++, internal_ptr++) { - bfd_coff_swap_aux_in(abfd, (AUXENT *)(raw_src +1), internal_ptr->n_type, - internal_ptr->n_sclass, (union - internal_auxent *)(internal_ptr +1)); - } - } - - /* Free all the raw stuff */ - bfd_release(abfd, raw_src); - - for (internal_ptr = internal; internal_ptr < internal_end; internal_ptr ++) { - - if (internal_ptr->_n._n_n._n_zeroes != 0) { - /* - This is a "short" name. Make it long. - */ - unsigned long i = 0; - char *newstring = NULL; - /* - find the length of this string without walking into memory - that isn't ours. - */ - - for (i = 0; i < 8; ++i) { - if (internal_ptr->_n._n_name[i] == '\0') { - break; - } /* if end of string */ - } /* possible lengths of this string. */ - - if ((newstring = (PTR) bfd_alloc(abfd, ++i)) == NULL) { - bfd_error = no_memory; - return (NULL); - } /* on error */ - bzero(newstring, i); - strncpy(newstring, internal_ptr->_n._n_name, i-1); - internal_ptr->_n._n_n._n_offset = (int) newstring; - internal_ptr->_n._n_n._n_zeroes = 0; - - } - else { - if (string_table == NULL) { - /* - NOTE: we don't read the string table until now because we - don't necessarily know that we have one until now. - */ - /* - At this point we should be "seek"'d to the end of the - symbols === the symbol table size. - */ - - if (bfd_read((char *) string_table_size_buffer, - sizeof(string_table_size_buffer), - 1, abfd) != sizeof(string_table_size)) { - bfd_error = system_call_error; - return (NULL); - } /* on error */ - - string_table_size = bfd_h_getlong(abfd, string_table_size_buffer); - - if ((string_table = (PTR) bfd_alloc(abfd, string_table_size -= 4)) == NULL) { - bfd_error = no_memory; - return (NULL); - } /* on mallocation error */ - if (bfd_read(string_table, string_table_size, 1, abfd) != string_table_size) { - bfd_error = system_call_error; - return (NULL); - } /* on error */ - } /* have not yet read the string table. */ - /* - This is a long name already. Just point it at the string in - memory. - */ - internal_ptr->_n._n_n._n_offset = (int) (string_table - 4 + internal_ptr->_n._n_n._n_offset); - - } /* switch on type of symbol name */ - - internal_ptr += internal_ptr->n_numaux; - } /* for each symbol */ -#if 0 -#ifndef GNU960 - /* I'm not sure of the repercussions of this, so the Intel - folks will always do the force - */ - if (obj_symbol_slew(abfd) > 0) - force_indices_file_symbol_relative(abfd, internal); -#else - force_indices_file_symbol_relative(abfd, internal); -#endif -#endif - obj_raw_syments(abfd) = internal; - obj_string_table(abfd) = string_table; - - return (internal); -} /* get_normalized_symtab() */ - -static -struct sec * -DEFUN(section_from_bfd_index,(abfd, index), - bfd *abfd AND - int index) -{ - if (index > 0) { - struct sec *answer = abfd->sections; - while (--index) { - answer = answer->next; - } - return answer; - } - return 0; -} - - - - -static boolean -coff_slurp_line_table(abfd, asect) -bfd *abfd; -asection *asect; - { - LINENO *native_lineno; - alent *lineno_cache; - - BFD_ASSERT(asect->lineno == (alent *) NULL); - - native_lineno = (LINENO *) buy_and_read(abfd, - asect->line_filepos, - SEEK_SET, - (size_t) (LINESZ * - asect->lineno_count)); - lineno_cache = - (alent *) bfd_alloc(abfd, (size_t) ((asect->lineno_count + 1) * sizeof(alent))); - if (lineno_cache == NULL) { - bfd_error = no_memory; - return false; - } else { - unsigned int counter = 0; - alent *cache_ptr = lineno_cache; - LINENO *src = native_lineno; - - while (counter < asect->lineno_count) { - struct internal_lineno dst; - bfd_coff_swap_lineno_in(abfd, src, &dst); - cache_ptr->line_number = dst.l_lnno; - - if (cache_ptr->line_number == 0) { - coff_symbol_type *sym = - (coff_symbol_type *) (dst.l_addr.l_symndx - + obj_symbol_slew(abfd) - + obj_raw_syments(abfd))->_n._n_n._n_zeroes; - cache_ptr->u.sym = (asymbol *) sym; - sym->lineno = cache_ptr; - } - else { - cache_ptr->u.offset = dst.l_addr.l_paddr - - bfd_section_vma(abfd, asect); - } /* If no linenumber expect a symbol index */ - - cache_ptr++; - src++; - counter++; - } - cache_ptr->line_number = 0; - - } - asect->lineno = lineno_cache; - /* FIXME, free native_lineno here, or use alloca or something. */ - return true; - } /* coff_slurp_line_table() */ - -static struct internal_syment * -DEFUN(find_next_file_symbol,(abfd, current, end), - bfd *abfd AND - struct internal_syment *current AND - struct internal_syment *end) -{ - current += current->n_numaux + 1; - - while (current < end) { - if (current->n_sclass== C_FILE) { - return (current); - } - current += current->n_numaux + 1; - } - return end; -} - - -/* -Note that C_FILE symbols can, and some do, have more than 1 aux entry. -*/ - -static void -DEFUN(force_indices_file_symbol_relative,(abfd, symtab), - bfd *abfd AND - struct internal_syment *symtab) -{ - struct internal_syment *end = symtab + bfd_get_symcount(abfd); - struct internal_syment *current; - struct internal_syment *next; - /* the first symbol had damn well better be a C_FILE. */ - BFD_ASSERT(symtab->n_sclass == C_FILE); - - for (current = find_next_file_symbol(abfd, symtab, end); - current < end; - current = next) { - offset_symbol_indices(abfd, current, - ((next = - find_next_file_symbol(abfd, current, - end)) - current), - symtab - current); - } - return; -} - -static boolean -DEFUN(coff_slurp_symbol_table,(abfd), - bfd *abfd) - { - struct internal_syment *native_symbols; - coff_symbol_type *cached_area; - unsigned int *table_ptr; - - unsigned int number_of_symbols = 0; - if (obj_symbols(abfd)) - return true; - bfd_seek(abfd, obj_sym_filepos(abfd), SEEK_SET); - - /* Read in the symbol table */ - if ((native_symbols = get_normalized_symtab(abfd)) == NULL) { - return (false); - } /* on error */ - - - /* Allocate enough room for all the symbols in cached form */ - cached_area = - (coff_symbol_type *) - bfd_alloc(abfd, (size_t) (bfd_get_symcount(abfd) * sizeof(coff_symbol_type))); - - if (cached_area == NULL) { - bfd_error = no_memory; - return false; - } /* on error */ - table_ptr = - (unsigned int *) - bfd_alloc(abfd, (size_t) (bfd_get_symcount(abfd) * sizeof(unsigned int))); - - if (table_ptr == NULL) { - bfd_error = no_memory; - return false; - } else { - coff_symbol_type *dst = cached_area; - unsigned int last_native_index = bfd_get_symcount(abfd); - unsigned int this_index = 0; - while (this_index < last_native_index) { - struct internal_syment *src = native_symbols + this_index; - table_ptr[this_index] = number_of_symbols; - dst->symbol.the_bfd = abfd; - - dst->symbol.name = (char *)(src->_n._n_n._n_offset); - /* - We use the native name field to point to the cached field - */ - src->_n._n_n._n_zeroes = (int) dst; - dst->symbol.section = section_from_bfd_index(abfd, - src->n_scnum); - switch (src->n_sclass) { -#ifdef I960 - case C_LEAFEXT: -#if 0 - dst->symbol.value = src->n_value - dst->symbol.section->vma; - dst->symbol.flags = BSF_EXPORT | BSF_GLOBAL; - dst->symbol.flags |= BSF_NOT_AT_END; -#endif - /* Fall through to next case */ - -#endif - - case C_EXT: - if ((src->n_scnum) == 0) { - if ((src->n_value) == 0) { - dst->symbol.flags = BSF_UNDEFINED; - dst->symbol.value= 0; - } - else { - dst->symbol.flags = BSF_FORT_COMM; - dst->symbol.value = (src->n_value); - } - } - else { - /* - Base the value as an index from the base of the - section - */ - if (dst->symbol.section == (asection *) NULL) { - dst->symbol.flags = BSF_EXPORT | BSF_GLOBAL | BSF_ABSOLUTE; - dst->symbol.value = src->n_value; - } - else { - dst->symbol.flags = BSF_EXPORT | BSF_GLOBAL; - dst->symbol.value = src->n_value - dst->symbol.section->vma; - } - if (ISFCN((src->n_type))) { - /* - A function ext does not go at the end of a file - */ - dst->symbol.flags |= BSF_NOT_AT_END; - } - } - - break; - case C_STAT: /* static */ -#ifdef I960 - case C_LEAFSTAT: /* static leaf procedure */ -#endif - case C_LABEL: /* label */ - dst->symbol.flags = BSF_LOCAL; - /* - Base the value as an index from the base of the section - */ - dst->symbol.value = (src->n_value) - dst->symbol.section->vma; - break; - - case C_MOS: /* member of structure */ - case C_EOS: /* end of structure */ - case C_REGPARM: /* register parameter */ - case C_REG: /* register variable */ -#ifdef C_AUTOARG - case C_AUTOARG: /* 960-specific storage class */ -#endif - case C_TPDEF: /* type definition */ - - case C_ARG: - case C_AUTO: /* automatic variable */ - case C_FIELD: /* bit field */ - case C_ENTAG: /* enumeration tag */ - case C_MOE: /* member of enumeration */ - case C_MOU: /* member of union */ - case C_UNTAG: /* union tag */ - - dst->symbol.flags = BSF_DEBUGGING; - dst->symbol.value = (src->n_value); - break; - - case C_FILE: /* file name */ - case C_STRTAG: /* structure tag */ - dst->symbol.flags = BSF_DEBUGGING; - dst->symbol.value = (src->n_value); - - break; - case C_BLOCK: /* ".bb" or ".eb" */ - case C_FCN: /* ".bf" or ".ef" */ - dst->symbol.flags = BSF_LOCAL; - /* - Base the value as an index from the base of the section - */ - dst->symbol.value = (src->n_value) - dst->symbol.section->vma; - - break; - case C_EFCN: /* physical end of function */ - case C_NULL: - case C_EXTDEF: /* external definition */ - case C_ULABEL: /* undefined label */ - case C_USTATIC: /* undefined static */ - case C_LINE: /* line # reformatted as symbol table entry */ - case C_ALIAS: /* duplicate tag */ - case C_HIDDEN: /* ext symbol in dmert public lib */ - - default: - - abort(); - dst->symbol.flags = BSF_DEBUGGING; - dst->symbol.value = (src->n_value); - - break; - } - - BFD_ASSERT(dst->symbol.flags != 0); - - dst->native = src; - - dst->symbol.udata = 0; - dst->lineno = (alent *) NULL; - this_index += (src->n_numaux) + 1; - dst++; - number_of_symbols++; - } /* walk the native symtab */ - } /* bfdize the native symtab */ - - obj_symbols(abfd) = cached_area; - obj_raw_syments(abfd) = native_symbols; - - bfd_get_symcount(abfd) = number_of_symbols; - obj_convert(abfd) = table_ptr; - /* Slurp the line tables for each section too */ - { - asection *p; - p = abfd->sections; - while (p) { - coff_slurp_line_table(abfd, p); - p = p->next; - } - } - return true; - } /* coff_slurp_symbol_table() */ - -static unsigned int -coff_get_symtab_upper_bound(abfd) -bfd *abfd; - { - if (!coff_slurp_symbol_table(abfd)) - return 0; - - return (bfd_get_symcount(abfd) + 1) * (sizeof(coff_symbol_type *)); - } - - -static unsigned int -coff_get_symtab(abfd, alocation) -bfd *abfd; -asymbol **alocation; - { - unsigned int counter = 0; - coff_symbol_type *symbase; - coff_symbol_type **location = (coff_symbol_type **) (alocation); - if (!coff_slurp_symbol_table(abfd)) - return 0; - - for (symbase = obj_symbols(abfd); counter++ < bfd_get_symcount(abfd);) - *(location++) = symbase++; - *location++ = 0; - return bfd_get_symcount(abfd); - } - -static unsigned int -coff_get_reloc_upper_bound(abfd, asect) -bfd *abfd; -sec_ptr asect; - { - if (bfd_get_format(abfd) != bfd_object) { - bfd_error = invalid_operation; - return 0; - } - return (asect->reloc_count + 1) * sizeof(arelent *); - } - -static boolean -DEFUN(coff_slurp_reloc_table,(abfd, asect, symbols), - bfd *abfd AND - sec_ptr asect AND - asymbol **symbols) - { - RELOC *native_relocs; - arelent *reloc_cache; - if (asect->relocation) - return true; - if (asect->reloc_count == 0) - return true; - if (!coff_slurp_symbol_table(abfd)) - return false; - native_relocs = - (RELOC *) buy_and_read(abfd, - asect->rel_filepos, - SEEK_SET, - (size_t) (RELSZ * - asect->reloc_count)); - reloc_cache = (arelent *) - bfd_alloc(abfd, (size_t) (asect->reloc_count * sizeof(arelent))); - - if (reloc_cache == NULL) { - bfd_error = no_memory; - return false; - } { /* on error */ - arelent *cache_ptr; - RELOC *src; - for (cache_ptr = reloc_cache, - src = native_relocs; - cache_ptr < reloc_cache + asect->reloc_count; - cache_ptr++, - src++) { - struct internal_reloc dst; - asymbol *ptr; - bfd_swap_reloc_in(abfd, src, &dst); - dst.r_symndx += obj_symbol_slew(abfd); - cache_ptr->sym_ptr_ptr = symbols + obj_convert(abfd)[dst.r_symndx]; - - ptr = *(cache_ptr->sym_ptr_ptr); - cache_ptr->address = dst.r_vaddr; - /* - The symbols definitions that we have read in have been - relocated as if their sections started at 0. But the offsets - refering to the symbols in the raw data have not been - modified, so we have to have a negative addend to compensate. - - Note that symbols which used to be common must be left alone - */ - - if (ptr->the_bfd == abfd - && ptr->section != (asection *) NULL - && ((ptr->flags & BSF_OLD_COMMON)== 0)) - { - cache_ptr->addend = -(ptr->section->vma + ptr->value); - } - else { - cache_ptr->addend = 0; - } - - cache_ptr->address -= asect->vma; - - cache_ptr->section = (asection *) NULL; - -#if I960 - cache_ptr->howto = howto_table + dst.r_type; -#endif -#if M68 - cache_ptr->howto = howto_table + dst.r_type - R_RELBYTE; -#endif -#if M88 - if (dst.r_type >= R_PCR16L && dst.r_type <= R_VRT32) { - cache_ptr->howto = howto_table + dst.r_type - R_PCR16L; - cache_ptr->addend += dst.r_offset << 16; - } - else { - BFD_ASSERT(0); - } -#endif - - } - - } - - asect->relocation = reloc_cache; - return true; - } - - -/* This is stupid. This function should be a boolean predicate */ -static unsigned int -coff_canonicalize_reloc(abfd, section, relptr, symbols) -bfd *abfd; -sec_ptr section; -arelent **relptr; -asymbol **symbols; - { - arelent *tblptr = section->relocation; - unsigned int count = 0; - if (!(tblptr || coff_slurp_reloc_table(abfd, section, symbols))) - return 0; - tblptr = section->relocation; - if (!tblptr) - return 0; - - for (; count++ < section->reloc_count;) - *relptr++ = tblptr++; - - *relptr = 0; - - return section->reloc_count; - } - - -/* -provided a bfd, a section and an offset into the section, calculate and -return the name of the source file and the line nearest to the wanted -location. -*/ - -static boolean -DEFUN(coff_find_nearest_line,(abfd, - section, - symbols, - offset, - filename_ptr, - functionname_ptr, - line_ptr), - bfd *abfd AND - asection *section AND - asymbol **symbols AND - bfd_vma offset AND - CONST char **filename_ptr AND - CONST char **functionname_ptr AND - unsigned int *line_ptr) -{ - static bfd *cache_abfd; - static asection *cache_section; - static bfd_vma cache_offset; - static unsigned int cache_i; - static alent *cache_l; - - unsigned int i = 0; - struct icofdata *cof = obj_icof(abfd); - /* Run through the raw syments if available */ - struct internal_syment *p; - alent *l; - unsigned int line_base = 0; - - - *filename_ptr = 0; - *functionname_ptr = 0; - *line_ptr = 0; - - /* Don't try and find line numbers in a non coff file */ - if (abfd->xvec->flavour != bfd_target_coff_flavour_enum) - return false; - - if (cof == (struct icofdata *)NULL) - return false; - - p = cof->raw_syments; - /* - I don't know for sure what's right, but this isn't it. First off, an - object file may not have any C_FILE's in it. After - get_normalized_symtab(), it should have at least 1, the one I put - there, but otherwise, all bets are off. Point #2, the first C_FILE - isn't necessarily the right C_FILE because any given object may have - many. I think you'll have to track sections as they coelesce in order - to find the C_STAT symbol for this section. Then you'll have to work - backwards to find the previous C_FILE, or choke if you get to a C_STAT - for the same kind of section. That will mean that the original object - file didn't have a C_FILE. xoxorich. - */ - -#ifdef WEREBEINGPEDANTIC - return false; -#endif - - for (i = 0; i < cof->raw_syment_count; i++) { - if (p->n_sclass == C_FILE) { - /* File name is embeded in auxent */ - /* - This isn't right. The fname should probably be normalized - during get_normalized_symtab(). In any case, what was here - wasn't right because a SYMENT.n_name isn't an - AUXENT.x_file.x_fname. xoxorich. - */ - - *filename_ptr = ((AUXENT *) (p + 1))->x_file.x_fname; - break; - } - p += 1 + p->n_numaux; - } - /* Now wander though the raw linenumbers of the section */ - /* - If this is the same bfd as we were previously called with and this is - the same section, and the offset we want is further down then we can - prime the lookup loop - */ - if (abfd == cache_abfd && - section == cache_section && - offset >= cache_offset) { - i = cache_i; - l = cache_l; - } - else { - i = 0; - l = section->lineno; - } - - for (; i < section->lineno_count; i++) { - if (l->line_number == 0) { - /* Get the symbol this line number points at */ - coff_symbol_type *coff = (coff_symbol_type *) (l->u.sym); - *functionname_ptr = coff->symbol.name; - if (coff->native) { - struct internal_syment *s = coff->native; - s = s + 1 + s->n_numaux; - /* - S should now point to the .bf of the function - */ - if (s->n_numaux) { - /* - The linenumber is stored in the auxent - */ - union internal_auxent *a = (union internal_auxent *) (s + 1); - line_base = a->x_sym.x_misc.x_lnsz.x_lnno; - } - } - } - else { - if (l->u.offset > offset) - break; - *line_ptr = l->line_number + line_base + 1; - } - l++; - } - - cache_abfd = abfd; - cache_section = section; - cache_offset = offset; - cache_i = i; - cache_l = l; - return true; -} - -#ifdef GNU960 -file_ptr -coff_sym_filepos(abfd) -bfd *abfd; - { - return obj_sym_filepos(abfd); - } -#endif - - -static int -DEFUN(coff_sizeof_headers,(abfd, reloc), - bfd *abfd AND - boolean reloc) - { - size_t size; - - if (reloc == false) { - size = FILHSZ + AOUTSZ; - } - else { - size = FILHSZ; - } - - size += abfd->section_count * SCNHSZ; - return size; - } - - -#define coff_core_file_failing_command _bfd_dummy_core_file_failing_command -#define coff_core_file_failing_signal _bfd_dummy_core_file_failing_signal -#define coff_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p -#define coff_slurp_armap bfd_slurp_coff_armap -#define coff_slurp_extended_name_table _bfd_slurp_extended_name_table -#define coff_truncate_arname bfd_dont_truncate_arname -#define coff_openr_next_archived_file bfd_generic_openr_next_archived_file -#define coff_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define coff_get_section_contents bfd_generic_get_section_contents -#define coff_close_and_cleanup bfd_generic_close_and_cleanup diff --git a/bfd/coffish.h b/bfd/coffish.h deleted file mode 100755 index 77e40c8713..0000000000 --- a/bfd/coffish.h +++ /dev/null @@ -1,601 +0,0 @@ - -/* All the swapping routines: -*/ - - - -static void -DEFUN(swap_reloc_in,(abfd, reloc_src, reloc_dst), - bfd *abfd AND - RELOC *reloc_src AND - struct internal_reloc *reloc_dst) -{ - reloc_dst->r_vaddr = bfd_h_getlong(abfd, reloc_src->r_vaddr); - reloc_dst->r_symndx = bfd_h_getlong(abfd, reloc_src->r_symndx); - reloc_dst->r_type = bfd_h_getshort(abfd, reloc_src->r_type); -#if M88 - reloc_dst->r_offset = bfd_h_getshort(abfd, reloc_src->r_offset); -#endif -} - -static void -DEFUN(swap_reloc_out,(abfd, reloc_src, reloc_dst), - bfd *abfd AND - struct internal_reloc *reloc_src AND - struct external_reloc *reloc_dst) -{ - bfd_h_putlong(abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr); - bfd_h_putlong(abfd, reloc_src->r_symndx, reloc_dst->r_symndx); - bfd_h_putshort(abfd, reloc_src->r_type, reloc_dst->r_type); -#if M88 - bfd_h_putshort(abfd, reloc_src->r_offset, reloc_dst->r_offset); -#endif - -} - -static void -DEFUN(swap_filehdr_in,(abfd, filehdr_src, filehdr_dst), - bfd *abfd AND - FILHDR *filehdr_src AND - struct internal_filehdr *filehdr_dst) -{ - filehdr_dst->f_magic = bfd_h_get_x(abfd, filehdr_src->f_magic); - filehdr_dst->f_nscns = bfd_h_get_x(abfd,filehdr_src-> f_nscns); - filehdr_dst->f_timdat = bfd_h_get_x(abfd,filehdr_src-> f_timdat); - filehdr_dst->f_symptr = bfd_h_get_x(abfd,filehdr_src-> f_symptr); - filehdr_dst->f_nsyms = bfd_h_get_x(abfd,filehdr_src-> f_nsyms); - filehdr_dst->f_opthdr = bfd_h_get_x(abfd,filehdr_src-> f_opthdr); - filehdr_dst->f_flags = bfd_h_get_x(abfd,filehdr_src-> f_flags); -} - -static void -DEFUN(swap_filehdr_out,(abfd, filehdr_in, filehdr_out), - bfd *abfd AND - struct internal_filehdr *filehdr_in AND - FILHDR *filehdr_out) -{ - bfd_h_put_x(abfd, filehdr_in->f_magic, filehdr_out->f_magic); - bfd_h_put_x(abfd, filehdr_in->f_nscns, filehdr_out->f_nscns); - bfd_h_put_x(abfd, filehdr_in->f_timdat, filehdr_out->f_timdat); - bfd_h_put_x(abfd, filehdr_in->f_symptr, filehdr_out->f_symptr); - bfd_h_put_x(abfd, filehdr_in->f_nsyms, filehdr_out->f_nsyms); - bfd_h_put_x(abfd, filehdr_in->f_opthdr, filehdr_out->f_opthdr); - bfd_h_put_x(abfd, filehdr_in->f_flags, filehdr_out->f_flags); -} - - -static void -DEFUN(bfd_coff_swap_sym_in,(abfd, ext, in), - bfd *abfd AND - SYMENT *ext AND - struct internal_syment *in) -{ - if( ext->e.e_name[0] == 0) { - in->_n._n_n._n_zeroes = 0; - in->_n._n_n._n_offset = bfd_h_getlong(abfd, ext->e.e.e_offset); - } - else { - memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); - } - in->n_value = bfd_h_get_x(abfd, ext->e_value); - in->n_scnum = bfd_h_get_x(abfd, ext->e_scnum); - in->n_type = bfd_h_get_x(abfd, ext->e_type); - in->n_sclass = bfd_h_get_x(abfd, ext->e_sclass); - in->n_numaux = bfd_h_get_x(abfd, ext->e_numaux); -} - -static void -DEFUN(bfd_coff_swap_sym_out,(abfd,in, ext), - bfd *abfd AND - struct internal_syment *in AND - SYMENT *ext) -{ - if(in->_n._n_name[0] == 0) { - bfd_h_putlong(abfd, 0, ext->e.e.e_zeroes); - bfd_h_putlong(abfd, in->_n._n_n._n_offset, ext->e.e.e_offset); - } - else { - memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); - } - bfd_h_put_x(abfd, in->n_value , ext->e_value); - bfd_h_put_x(abfd, in->n_scnum , ext->e_scnum); - bfd_h_put_x(abfd, in->n_type , ext->e_type); - bfd_h_put_x(abfd, in->n_sclass , ext->e_sclass); - bfd_h_put_x(abfd, in->n_numaux , ext->e_numaux); -} - -static void -DEFUN(bfd_coff_swap_aux_in,(abfd, ext, type, class, in), - bfd *abfd AND - AUXENT *ext AND - int type AND - int class AND - union internal_auxent *in) -{ - switch (class) { - case C_FILE: - if (ext->x_file.x_fname[0] == 0) { - in->x_file.x_n.x_zeroes = 0; - in->x_file.x_n.x_offset = bfd_h_getlong(abfd, ext->x_file.x_n.x_offset); - } - - break; - case C_STAT: -#ifdef C_LEAFSTAT - case C_LEAFSTAT: -#endif - case C_HIDDEN: - if (type == T_NULL) { - in->x_scn.x_scnlen = bfd_h_get_x(abfd, ext->x_scn.x_scnlen); - in->x_scn.x_nreloc = bfd_h_get_x(abfd, ext->x_scn.x_nreloc); - in->x_scn.x_nlinno = bfd_h_get_x(abfd, ext->x_scn.x_nlinno); - break; - } - default: - in->x_sym.x_tagndx = bfd_h_get_x(abfd, ext->x_sym.x_tagndx); - in->x_sym.x_tvndx = bfd_h_get_x(abfd, ext->x_sym.x_tvndx); - - if (ISARY(type) || class == C_BLOCK) { - in->x_sym.x_fcnary.x_ary.x_dimen[0] = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[0]); - in->x_sym.x_fcnary.x_ary.x_dimen[1] = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[1]); - in->x_sym.x_fcnary.x_ary.x_dimen[2] = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[2]); - in->x_sym.x_fcnary.x_ary.x_dimen[3] = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[3]); - } - else { - in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); - in->x_sym.x_fcnary.x_fcn.x_endndx = bfd_h_get_x(abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx); - } - if (ISFCN(type)) { - in->x_sym.x_misc.x_fsize = bfd_h_get_x(abfd, ext->x_sym.x_misc.x_fsize); - } - else { - in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_x(abfd, ext->x_sym.x_misc.x_lnsz.x_lnno); - in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_x(abfd, ext->x_sym.x_misc.x_lnsz.x_size); - } - } -} - -static void -DEFUN(bfd_coff_swap_aux_out,(abfd, in, type, class, ext), - bfd *abfd AND - union internal_auxent *in AND - int type AND - int class AND - AUXENT *ext) -{ - switch (class) { - case C_FILE: - if (in->x_file.x_fname[0] == 0) { - bfd_h_put_x(abfd, 0, ext->x_file.x_n.x_zeroes ); - bfd_h_put_x(abfd, in->x_file.x_n.x_offset, ext->x_file.x_n.x_offset); - } - - break; - case C_STAT: -#ifdef C_LEAFSTAT - case C_LEAFSTAT: -#endif - case C_HIDDEN: - if (type == T_NULL) { - bfd_h_put_x(abfd, in->x_scn.x_scnlen, ext->x_scn.x_scnlen); - bfd_h_put_x(abfd, in->x_scn.x_nreloc, ext->x_scn.x_nreloc); - bfd_h_put_x(abfd, in->x_scn.x_nlinno, ext->x_scn.x_nlinno); - break; - } - default: - bfd_h_put_x(abfd, in->x_sym.x_tagndx, ext->x_sym.x_tagndx); - bfd_h_put_x(abfd, in->x_sym.x_tvndx , ext->x_sym.x_tvndx); - - if (ISARY(type) || class == C_BLOCK) { - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0],ext->x_sym.x_fcnary.x_ary.x_dimen[0]); - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1],ext->x_sym.x_fcnary.x_ary.x_dimen[1]); - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2],ext->x_sym.x_fcnary.x_ary.x_dimen[2]); - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3],ext->x_sym.x_fcnary.x_ary.x_dimen[3]); - } - else { - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); - bfd_h_put_x(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx, ext->x_sym.x_fcnary.x_fcn.x_endndx); - } - if (ISFCN(type)) { - bfd_h_put_x(abfd, in->x_sym.x_misc.x_fsize, ext->x_sym.x_misc.x_fsize); - } - else { - bfd_h_put_x(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, ext->x_sym.x_misc.x_lnsz.x_lnno); - bfd_h_put_x(abfd, in->x_sym.x_misc.x_lnsz.x_size, ext->x_sym.x_misc.x_lnsz.x_size); - } - } -} - -static void -DEFUN(bfd_coff_swap_lineno_in,(abfd, ext, in), - bfd *abfd AND - LINENO *ext AND - struct internal_lineno *in) -{ - in->l_addr.l_symndx = bfd_h_get_x(abfd, ext->l_addr.l_symndx); - in->l_lnno = bfd_h_get_x(abfd, ext->l_lnno); -} - -static void -DEFUN(bfd_coff_swap_lineno_out,(abfd, in, ext), - bfd *abfd AND - struct internal_lineno *in AND - struct external_lineno *ext) -{ - bfd_h_put_x(abfd, in->l_addr.l_symndx, ext->l_addr.l_symndx); - bfd_h_put_x(abfd, in->l_lnno, ext->l_lnno); -} - - - - -static void -DEFUN(swap_aouthdr_in,(abfd, aouthdr_ext, aouthdr_int), - bfd *abfd AND - AOUTHDR *aouthdr_ext AND - struct internal_aouthdr *aouthdr_int) -{ - aouthdr_int->magic = bfd_h_get_x(abfd, aouthdr_ext->magic); - aouthdr_int->vstamp = bfd_h_get_x(abfd, aouthdr_ext->vstamp); - aouthdr_int->tsize = bfd_h_get_x(abfd, aouthdr_ext->tsize); - aouthdr_int->dsize = bfd_h_get_x(abfd, aouthdr_ext->dsize); - aouthdr_int->bsize = bfd_h_get_x(abfd, aouthdr_ext->bsize); - aouthdr_int->entry = bfd_h_get_x(abfd, aouthdr_ext->entry); - aouthdr_int->text_start = bfd_h_get_x(abfd, aouthdr_ext->text_start); - aouthdr_int->data_start = bfd_h_get_x(abfd, aouthdr_ext->data_start); -#ifdef I960 - aouthdr_int->tagentries = bfd_h_get_x(abfd, aouthdr_ext->tagentries); -#endif -} - -static void -DEFUN(swap_aouthdr_out,(abfd, aouthdr_in, aouthdr_out), - bfd *abfd AND - struct internal_aouthdr *aouthdr_in AND - AOUTHDR *aouthdr_out) -{ - bfd_h_put_x(abfd, aouthdr_in->magic, aouthdr_out->magic); - bfd_h_put_x(abfd, aouthdr_in->vstamp, aouthdr_out->vstamp); - bfd_h_put_x(abfd, aouthdr_in->tsize, aouthdr_out->tsize); - bfd_h_put_x(abfd, aouthdr_in->dsize, aouthdr_out->dsize); - bfd_h_put_x(abfd, aouthdr_in->bsize, aouthdr_out->bsize); - bfd_h_put_x(abfd, aouthdr_in->entry, aouthdr_out->entry); - bfd_h_put_x(abfd, aouthdr_in->text_start, aouthdr_out->text_start); - bfd_h_put_x(abfd, aouthdr_in->data_start, aouthdr_out->data_start); -#ifdef I960 - bfd_h_put_x(abfd, aouthdr_in->tagentries, aouthdr_out->tagentries); -#endif -} - -static void -DEFUN(swap_scnhdr_in,(abfd, scnhdr_ext, scnhdr_int), - bfd *abfd AND - SCNHDR *scnhdr_ext AND - struct internal_scnhdr *scnhdr_int) -{ - memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof(scnhdr_int->s_name)); - scnhdr_int->s_vaddr = bfd_h_get_x(abfd, scnhdr_ext->s_vaddr); - scnhdr_int->s_paddr = bfd_h_get_x(abfd, scnhdr_ext->s_paddr); - scnhdr_int->s_size = bfd_h_get_x(abfd, scnhdr_ext->s_size); - scnhdr_int->s_scnptr = bfd_h_get_x(abfd, scnhdr_ext->s_scnptr); - scnhdr_int->s_relptr = bfd_h_get_x(abfd, scnhdr_ext->s_relptr); - scnhdr_int->s_lnnoptr = bfd_h_get_x(abfd, scnhdr_ext->s_lnnoptr); - scnhdr_int->s_nreloc = bfd_h_get_x(abfd, scnhdr_ext->s_nreloc); - scnhdr_int->s_nlnno = bfd_h_get_x(abfd, scnhdr_ext->s_nlnno); - scnhdr_int->s_flags = bfd_h_get_x(abfd, scnhdr_ext->s_flags); -#ifdef I960 - scnhdr_int->s_align = bfd_h_get_x(abfd, scnhdr_ext->s_align); -#endif -} - -static void -DEFUN(swap_scnhdr_out,(abfd, scnhdr_int, scnhdr_ext), - bfd *abfd AND - struct internal_scnhdr *scnhdr_int AND - SCNHDR *scnhdr_ext) -{ - memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof(scnhdr_int->s_name)); - bfd_h_put_x(abfd, scnhdr_int->s_vaddr, scnhdr_ext->s_vaddr); - bfd_h_put_x(abfd, scnhdr_int->s_paddr, scnhdr_ext->s_paddr); - bfd_h_put_x(abfd, scnhdr_int->s_size, scnhdr_ext->s_size); - bfd_h_put_x(abfd, scnhdr_int->s_scnptr, scnhdr_ext->s_scnptr); - bfd_h_put_x(abfd, scnhdr_int->s_relptr, scnhdr_ext->s_relptr); - bfd_h_put_x(abfd, scnhdr_int->s_lnnoptr, scnhdr_ext->s_lnnoptr); - bfd_h_put_x(abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc); - bfd_h_put_x(abfd, scnhdr_int->s_nlnno, scnhdr_ext->s_nlnno); - bfd_h_put_x(abfd, scnhdr_int->s_flags, scnhdr_ext->s_flags); -#ifdef I960 - bfd_h_put_x(abfd, scnhdr_int->s_align, scnhdr_ext->s_align); -#endif -} - -/* - initialize a section structure with information peculiar to this - particular implementation of coff -*/ - -static boolean -DEFUN(coff_new_section_hook,(abfd_ignore, section_ignore), - bfd *abfd_ignore AND - asection *section_ignore) -{ -#ifdef MC88MAGIC - /* FIXME, shouldn't this ifdef be on something that says we are - actually COMPILING FOR an 88K coff file, rather than simply - knowing its magic number? */ - /* Align to at least 16 bytes */ - section_ignore->alignment_power = 4; -#endif -#if M68 - section_ignore->alignment_power = 3; -#endif - return true; -} - -/* Take a section header read from a coff file (in HOST byte order), - and make a BFD "section" out of it. */ -static boolean -DEFUN(make_a_section_from_file,(abfd, hdr), - bfd *abfd AND - struct internal_scnhdr *hdr) -{ - asection *return_section; - - { - /* Assorted wastage to null-terminate the name, thanks AT&T! */ - char *name = bfd_alloc(abfd, sizeof (hdr->s_name)+1); - if (name == NULL) { - bfd_error = no_memory; - return false; - } - strncpy(name, (char *) &hdr->s_name[0], sizeof (hdr->s_name)); - name[sizeof (hdr->s_name)] = 0; - - return_section = bfd_make_section(abfd, name); - } - - /* s_paddr is presumed to be = to s_vaddr */ -#define assign(to, from) return_section->to = hdr->from - assign(vma, s_vaddr); - /* assign (vma, s_vaddr); */ - assign(size, s_size); - assign(filepos, s_scnptr); - assign(rel_filepos, s_relptr); - assign(reloc_count, s_nreloc); -#ifdef I960 - { - /* FIXME, use a temp var rather than alignment_power */ - assign(alignment_power, s_align); - { - unsigned int i; - for (i = 0; i < 32; i++) { - if ((1 << i) >= (int) (return_section->alignment_power)) { - return_section->alignment_power = i; - break; - } - } - } - } -#endif - assign(line_filepos, s_lnnoptr); - /* - return_section->linesize = hdr->s_nlnno * sizeof (struct lineno); - */ - -#undef assign - return_section->lineno_count = hdr->s_nlnno; - return_section->userdata = NULL; - return_section->next = (asection *) NULL; - if ((hdr->s_flags & STYP_TEXT) || (hdr->s_flags & STYP_DATA)) - return_section->flags = (SEC_LOAD | SEC_ALLOC); - else if (hdr->s_flags & STYP_BSS) - return_section->flags = SEC_ALLOC; - - if (hdr->s_nreloc != 0) - return_section->flags |= SEC_RELOC; - if (hdr->s_scnptr != 0) - return_section->flags |= SEC_HAS_CONTENTS; - return true; -} -static boolean -DEFUN(coff_mkobject,(abfd), - bfd *abfd) -{ - set_tdata (abfd, bfd_zalloc (abfd,sizeof(coff_data_type))); - if (coff_data(abfd) == 0) { - bfd_error = no_memory; - return false; - } - coff_data(abfd)->relocbase = 0; - return true; -} - -static -bfd_target * -DEFUN(coff_real_object_p,(abfd, nscns, internal_f, internal_a), - bfd *abfd AND - unsigned nscns AND - struct internal_filehdr *internal_f AND - struct internal_aouthdr *internal_a) -{ - coff_data_type *coff; - - size_t readsize; /* length of file_info */ - SCNHDR *external_sections; - - /* Build a play area */ - if (coff_mkobject(abfd) != true) - return 0; - coff = coff_data(abfd); - - - external_sections = (SCNHDR *)bfd_alloc(abfd, readsize = (nscns * SCNHSZ)); - if (bfd_read((PTR)external_sections, 1, readsize, abfd) != readsize) { - goto fail; - } - - - - /* Now copy data as required; construct all asections etc */ - coff->symbol_index_slew = 0; - coff->relocbase =0; - coff->raw_syment_count = 0; - coff->raw_linenos = 0; - coff->raw_syments = 0; - coff->sym_filepos =0; - coff->flags = internal_f->f_flags; - if (nscns != 0) { - unsigned int i; - for (i = 0; i < nscns; i++) { - struct internal_scnhdr tmp; - swap_scnhdr_in(abfd, external_sections + i, &tmp); - make_a_section_from_file(abfd,&tmp); - } - } - /* Determine the machine architecture and type. */ - abfd->obj_machine = 0; - switch (internal_f->f_magic) { -#ifdef MIPS -#ifdef MIPSEBMAGIC - case SMIPSEBMAGIC: - case SMIPSELMAGIC: - case MIPSEBUMAGIC: - case MIPSELUMAGIC: - case MIPSEBMAGIC: - case MIPSELMAGIC: - abfd->obj_arch = bfd_arch_mips; - abfd->obj_machine = 0; - break; -#endif -#endif -#ifdef MC68MAGIC - case MC68MAGIC: - case M68MAGIC: - abfd->obj_arch = bfd_arch_m68k; - abfd->obj_machine = 68020; - break; -#endif -#ifdef MC88MAGIC - case MC88MAGIC: - case MC88DMAGIC: - case MC88OMAGIC: - abfd->obj_arch = bfd_arch_m88k; - abfd->obj_machine = 88100; - break; -#endif -#ifdef I960 -#ifdef I960ROMAGIC - case I960ROMAGIC: - case I960RWMAGIC: - abfd->obj_arch = bfd_arch_i960; - switch (F_I960TYPE & internal_f->f_flags) - { - default: - case F_I960CORE: - abfd->obj_machine = bfd_mach_i960_core; - break; - case F_I960KB: - abfd->obj_machine = bfd_mach_i960_kb_sb; - break; - case F_I960MC: - abfd->obj_machine = bfd_mach_i960_mc; - break; - case F_I960XA: - abfd->obj_machine = bfd_mach_i960_xa; - break; - case F_I960CA: - abfd->obj_machine = bfd_mach_i960_ca; - break; - case F_I960KA: - abfd->obj_machine = bfd_mach_i960_ka_sa; - break; - - } - break; -#endif -#endif - - default: /* Unreadable input file type */ - abfd->obj_arch = bfd_arch_obscure; - break; - } - - if (!(internal_f->f_flags & F_RELFLG)) - abfd->flags |= HAS_RELOC; - if ((internal_f->f_flags & F_EXEC)) - abfd->flags |= EXEC_P; - if (!(internal_f->f_flags & F_LNNO)) - abfd->flags |= HAS_LINENO; - if (!(internal_f->f_flags & F_LSYMS)) - abfd->flags |= HAS_LOCALS; - - - bfd_get_symcount(abfd) = internal_f->f_nsyms; - if (internal_f->f_nsyms) - abfd->flags |= HAS_SYMS; - - coff->sym_filepos = internal_f->f_symptr; - - - - coff->symbols = (coff_symbol_type *) NULL; - bfd_get_start_address(abfd) = internal_f->f_opthdr ? internal_a->entry : 0; - - return abfd->xvec; - fail: - bfd_release(abfd, coff); - return (bfd_target *)NULL; -} - -static bfd_target * -DEFUN(coff_object_p,(abfd), - bfd *abfd) - { - int nscns; - FILHDR filehdr; - AOUTHDR opthdr; - struct internal_filehdr internal_f; - struct internal_aouthdr internal_a; - - bfd_error = system_call_error; - - /* figure out how much to read */ - if (bfd_read((PTR) &filehdr, 1, FILHSZ, abfd) != FILHSZ) - return 0; - - swap_filehdr_in(abfd, &filehdr, &internal_f); - - if (BADMAG(internal_f)) { - bfd_error = wrong_format; - return 0; - } - nscns =internal_f.f_nscns; - - if (internal_f.f_opthdr) { - if (bfd_read((PTR) &opthdr, 1,AOUTSZ, abfd) != AOUTSZ) { - return 0; - } - swap_aouthdr_in(abfd, &opthdr, &internal_a); - } - - /* Seek past the opt hdr stuff */ - bfd_seek(abfd, internal_f.f_opthdr + FILHSZ, SEEK_SET); - - /* if the optional header is NULL or not the correct size then - quit; the only difference I can see between m88k dgux headers (MC88DMAGIC) - and Intel 960 readwrite headers (I960WRMAGIC) is that the - optional header is of a different size. - - But the mips keeps extra stuff in it's opthdr, so dont check - when doing that - */ - -#ifndef MIPS - if (internal_f.f_opthdr != 0 && AOUTSZ != internal_f.f_opthdr) - return (bfd_target *)NULL; -#endif - - return coff_real_object_p(abfd, nscns, &internal_f, &internal_a); - } - - diff --git a/bfd/coffswap.c b/bfd/coffswap.c deleted file mode 100755 index b1f74517ee..0000000000 --- a/bfd/coffswap.c +++ /dev/null @@ -1,123 +0,0 @@ -/* Byte-swapping routines for COFF files */ - -/* Copyright (C) 1990, 1991 Free Software Foundation, Inc. - -This file is part of BFD, the Binary File Diddler. - -BFD is free software; you can 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. - -BFD is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - -You should have received a copy of the GNU General Public License along with - BFD; see the file COPYING. If not, write to the Free Software Foundation, - 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* Most of this hacked by Steve Chamberlain, steve@cygnus.com */ -#if 0 -#include -#include "intel-coff.h" -#include "bfd.h" -#include "libcoff.h" /* to allow easier abstraction-breaking */ - -#define sp(x) bfd_h_put_x(abfd, x, &x) - -/* All the generic swapping routines: - -FIXME - These routines cater for the sizes and alignments and offsets of - all the contained fields. Because of this, the fields can change - size, so these should be phased out to use the ones specific to the - file format. - */ - -void -DEFUN(bfd_coff_swap_name,(abfd, ptr), - bfd *abfd AND - long *ptr) -{ - if (ptr[0] == 0) { - /* There is an index which needs to be swapped */ - bfd_h_put_x(abfd, ptr[1], (ptr + 1)); - } - else { - /* This is a string .. leave it alone */ - } -} - -void -DEFUN(bfd_coff_swap_sym,(abfd, se), - bfd *abfd AND - struct internal_syment *se) -{ - bfd_coff_swap_name(abfd, (long*)(se->n_name)); - bfd_h_put_x(abfd, se->n_value, &se->n_value); - bfd_h_put_x(abfd, se->n_scnum, &se->n_scnum); - bfd_h_put_x(abfd, se->n_type, &se->n_type); - bfd_h_put_x(abfd, se->n_sclass, &se->n_sclass); - bfd_h_put_x(abfd, se->n_numaux, &se->n_numaux); -} - -void -DEFUN(bfd_coff_swap_aux,(abfd, au, type, class), - bfd *abfd AND - struct internal_auxent *au AND - int type AND - int class) -{ - switch (class) { - case C_FILE: - bfd_coff_swap_name(abfd, (long *)(&au->x_file.x_n)); - break; - case C_STAT: -#ifdef C_LEAFSTAT - case C_LEAFSTAT: -#endif - case C_HIDDEN: - if (type == T_NULL) { - sp(au->x_scn.x_scnlen); - sp(au->x_scn.x_nreloc); - sp(au->x_scn.x_nlinno); - break; - } - default: - sp(au->x_sym.x_tagndx); - sp(au->x_sym.x_tvndx); - - if (ISARY(type) || class == C_BLOCK) { - sp(au->x_sym.x_fcnary.x_ary.x_dimen[0]); - sp(au->x_sym.x_fcnary.x_ary.x_dimen[1]); - sp(au->x_sym.x_fcnary.x_ary.x_dimen[2]); - sp(au->x_sym.x_fcnary.x_ary.x_dimen[3]); - } - else { - sp(au->x_sym.x_fcnary.x_fcn.x_lnnoptr); - sp(au->x_sym.x_fcnary.x_fcn.x_endndx); - } - if (ISFCN(type)) { - sp(au->x_sym.x_misc.x_fsize); - } - else { - sp(au->x_sym.x_misc.x_lnsz.x_lnno); - sp(au->x_sym.x_misc.x_lnsz.x_size); - } - } -} - -void -DEFUN(bfd_coff_swap_lineno,(abfd, lineno), - bfd *abfd AND - struct internal_lineno *lineno) -{ - sp(lineno->l_addr.l_symndx); - sp(lineno->l_lnno); -} - - - -#endif diff --git a/bfd/config.sub b/bfd/config.sub deleted file mode 100755 index dac9ab89d4..0000000000 --- a/bfd/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/bfd/configdos.bat b/bfd/configdos.bat deleted file mode 100755 index 46cdb940c8..0000000000 --- a/bfd/configdos.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off -echo Configuring BFD for H8/300 - -copy hosts\h-go32.h sysdep.h -copy makefile.dos makefile - diff --git a/bfd/configure b/bfd/configure deleted file mode 100755 index e7e05e8ea8..0000000000 --- a/bfd/configure +++ /dev/null @@ -1,774 +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. -# This file is a shell script that supplies the information necessary -# to tailor a template configure script into the configure script -# appropriate for this directory. For more information, check any -# existing configure script. - -srctrigger=libbfd.c -srcname="bfd" - -## 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. - -if [ "${host_os}" = "posix" ] ; then - bfd_host=posix -else - case "${host_cpu}" in - rs6000) bfd_host=aix ;; - mips) - case "${host_vendor}" in - dec) bfd_host=dec3100 ;; - sgi) bfd_host=irix3 ;; - esac - ;; - m88k) - case "${host_vendor}" in - *) - case "${host_os}" in - dgux) bfd_host=dgux ;; - esac - ;; - esac - ;; - m68k) - case "${host_vendor}" in - cbm) - case ${host_os} in - amigados) bfd_host=amigados ;; - svr4) bfd_host=amix ;; - esac - ;; - hp) - case "${host_os}" in - hpux) bfd_host=hp9000 ;; - bsd) bfd_host=hp300bsd ;; - esac - ;; - sony) bfd_host=news ;; - sun) bfd_host=sun3 ;; - esac - ;; - - i386) - case "${host_vendor}" in - *) - case "${host_os}" in - sysv) bfd_host=i386v ;; - esac - ;; - esac - ;; - - sparc) - case "${host_vendor}" in - sun) bfd_host=sun4 ;; - esac - ;; - - rtpc) bfd_host=rtbsd - ;; - - a29k) bfd_host=ultra3 - ;; - - tahoe) - bfd_host=${host_cpu} - ;; - vax) - case "${host_os}" in - ultrix) bfd_host=vaxult ;; - *) bfd_host=vax ;; - esac - ;; - esac -fi - -if [ ! -f config/h-${bfd_host} ] ; then - echo '***' BFD does not support host ${host}: no file config/h-${bfd_host} - exit 1 -fi - -host_makefile_frag=config/h-${bfd_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_vendor}" in -aout | coff | bout | elf) bfd_target=${target_cpu}-${target_vendor} ;; -sony) bfd_target=news ;; -intel) bfd_target=${target_cpu}-coff ;; -cbm) bfd_target=${target_cpu}-elf ;; - -hitachi) - case "${target_cpu}" in - h8300) bfd_target=h8300-ieee ;; - *) echo "bad hitachi cpu" ;; - esac - ;; - - -wrs) - case "${target_cpu}" in - i960) bfd_target=i960-bout ;; - m68k) bfd_target=m68k-aout ;; - esac - ;; -sun) - case "${target_cpu}" in - m68k) bfd_target=m68k-aout ;; - sparc) bfd_target=sparc-aout ;; - esac - ;; -dec) - case "${target_cpu}" in - mips) bfd_target=dec3100 ;; - vax) bfd_target=vax ;; - esac - ;; -hp) - case "${target_cpu}" in - m68k) - case "${target_os}" in - hpux) bfd_target=hp9000 ;; - bsd) bfd_target=hp300bsd ;; - esac - ;; - esac - ;; -sgi) - case "${target_cpu}" in - mips) - bfd_target=irix3 ;; - esac - ;; -none|nyu) - case "${target_cpu}" in - i386) bfd_target=i386-coff ;; - a29k) case "${target_os}" in - aout) bfd_target=a29k-aout ;; - coff) bfd_target=a29k-coff ;; - sym1) bfd_target=a29k-coff ;; - esac - ;; - tahoe | vax) bfd_target=${target_cpu} ;; - esac - ;; -*) - case "${target_cpu}" in - tahoe | vax) bfd_target=${target_cpu} ;; - esac - ;; -esac - -if [ ! -f config/t-${bfd_target} ] ; then - echo '***' BFD does not support target ${target}: no file config/t-${bfd_target} - exit 1 -fi - -target_makefile_frag=config/t-${bfd_target} - -files= -links= -## 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. - -## 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/bfd/cplus-dem.c b/bfd/cplus-dem.c deleted file mode 100755 index edb9e39089..0000000000 --- a/bfd/cplus-dem.c +++ /dev/null @@ -1,942 +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 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. */ - -/* 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). */ - -/* This file exports one function - - char *cplus_demangle (const char *name) - - If `name' is a mangled function name produced by g++, 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. - - For example, - - cplus_demangle ("_foo__1Ai") - - returns - - "A::foo(int)" - - 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 nounderscore 1 /* define this is names don't start with _ */ - -#include -#include -#include - -/* #include "misc.h" */ - -#ifdef USG -#include -#else -#define memcpy(s1, s2, n) strncpy(s1, s2, n) -#define memcmp(s1, s2, n) strncmp(s1, s2, n) -#define strchr(s, c) index(s, c) -#endif - -#ifndef __STDC__ -#define const -#endif - -#ifdef __STDC__ -extern char *cplus_demangle (const char *type); -#else -extern char *cplus_demangle (); -#endif - -static char **typevec = 0; -static int ntypes = 0; -static int typevec_size = 0; - -static struct { - const char *in; - const char *out; -} optable[] = { - "new", " new", - "delete", " delete", - "ne", "!=", - "eq", "==", - "ge", ">=", - "gt", ">", - "le", "<=", - "lt", "<", - "plus", "+", - "minus", "-", - "mult", "*", - "convert", "+", /* unary + */ - "negate", "-", /* unary - */ - "trunc_mod", "%", - "trunc_div", "/", - "truth_andif", "&&", - "truth_orif", "||", - "truth_not", "!", - "postincrement", "++", - "postdecrement", "--", - "bit_ior", "|", - "bit_xor", "^", - "bit_and", "&", - "bit_not", "~", - "call", "()", - "cond", "?:", - "alshift", "<<", - "arshift", ">>", - "component", "->", - "indirect", "*", - "method_call", "->()", - "addr", "&", /* unary & */ - "array", "[]", - "nop", "", /* for operator= */ -}; - -/* Beware: these aren't '\0' terminated. */ - -typedef struct { - 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); -static int do_type (const char **type, string *result); -static int do_arg (const char **type, string *result); -static int do_args (const char **type, string *decl); -static void munge_function_name (string *name); -#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 (); -static void string_prepends (); -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 (); -#endif - -char * -cplus_demangle (type) - const char *type; -{ - string decl; - int n; - int success = 0; - int constructor = 0; - int const_flag = 0; - int i; - const char *p, *premangle; - - 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] == '$' && type[2] == '_') - { - unsigned int l = (strlen (type) - 3)*2 + 3 + 2 + 1; - char *tem = (char *) zalloc (l); - strcpy (tem, type + 3); - strcat (tem, "::~"); - strcat (tem, type + 3); - strcat (tem, "()"); - return tem; - } - /* static data member */ - if (*type != '_' && (p = (char *) strchr (type, '$')) != 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 */ - if (type[0] == '_' && type[1] == 'v' && type[2] == 't' && type[3] == '$') - { - 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 (p == type) - { - if (!isdigit (p[2])) - { - string_delete (&decl); - return NULL; - } - constructor = 1; - } - else - { - string_appendn (&decl, type, p - type); - munge_function_name (&decl); - } - p += 2; - - premangle = p; - 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) - { - string_appendn (&decl, p, n); - string_append (&decl, "::"); - string_appendn (&decl, p, n); - } - else - { - string_prepend (&decl, "::"); - string_prependn (&decl, p, n); - } -#ifndef LONGERNAMES - p = premangle; -#else - p += n; -#endif - success = do_args (&p, &decl); - if (const_flag) - string_append (&decl, " const"); - break; - case 'F': - p += 1; - success = do_args (&p, &decl); - 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) - const char **type; - string *result; -{ - 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 '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) || **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)) || **type != '_') - { - success = 0; - break; - } - *type += 1; - 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, "volatilep"); - } - break; - } - - case 'C': - if ((*type)[1] == 'P') - { - *type += 1; - 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 (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 (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 '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) - const char **type; - string *result; -{ - char *tem; - int len; - const char *start; - const char *end; - - start = *type; - if (!do_type (type, result)) - return 0; - end = *type; - if (ntypes >= typevec_size) - { - if (typevec_size == 0) - { - typevec_size = 3; - typevec = (char **) xmalloc (sizeof (char*)*typevec_size); - } - else - { - typevec_size *= 2; - typevec = (char **) realloc ((char *)typevec, sizeof (char*)*typevec_size); - } - } - len = end - start; - tem = (char *) xmalloc (len + 1); - memcpy (tem, start, len); - tem[len] = '\0'; - typevec[ntypes++] = tem; - return 1; -} - -/* `decl' must be already initialised, usually non-empty; - it won't be freed on failure */ - -static int -do_args (type, decl) - const char **type; - string *decl; -{ - string arg; - int need_comma = 0; - int dont_want_first; - -#ifndef LONGERNAMES - dont_want_first = 1; -#else - dont_want_first = 0; -#endif - - 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) - string_append (decl, ", "); - if (!do_arg (&tem, &arg)) - return 0; - string_appends (decl, &arg); - string_delete (&arg); - need_comma = 1; - } - } - else - { - if (need_comma) - string_append (decl, ", "); - if (!do_arg (type, &arg)) - return 0; - if (dont_want_first) - dont_want_first = 0; - else - { - string_appends (decl, &arg); - need_comma = 1; - } - string_delete (&arg); - } - } - - if (**type == 'v') - *type += 1; - else if (**type == 'e') - { - *type += 1; - if (need_comma) - string_append (decl, ","); - string_append (decl, "..."); - } - - string_append (decl, ")"); - return 1; -} - -static void -munge_function_name (name) - string *name; -{ - if (!string_empty (name) && name->p - name->b >= 3 - && name->b[0] == 'o' && name->b[1] == 'p' && name->b[2] == '$') - { - 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 (!string_empty (name) && 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)) - { - string_clear (name); - string_append (name, "operator "); - string_appends (name, &type); - string_delete (&type); - 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 *) realloc (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)); -} - -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/bfd/doc/Makefile b/bfd/doc/Makefile deleted file mode 100755 index 2ac5d438d4..0000000000 --- a/bfd/doc/Makefile +++ /dev/null @@ -1,82 +0,0 @@ -.SUFFIXES: .texi .o .c .h .p .ip -VPATH=.. -.c.texi: - ./scanit $< $@ - -.h.texi: - ./scanit $< $@ - -.c.p: - ./scanph $< $@ - -.h.p: - ./scanph $< $@ - -.c.ip: - ./scanph -i $< $@ - -# main GDB source directory -srcdir = .. - -TEXIDIR=${srcdir}/../texinfo/fsf - -DOCFILES = aoutx.texi archive.texi archures.texi \ - bfd.texi cache.texi coffcode.texi \ - core.texi format.texi libbfd.texi \ - opncls.texi reloc.texi section.texi \ - syms.texi targets.texi init.texi ctor.texi - - -PROTOS = archive.p archures.p bfd.p \ - coffcode.p core.p format.p \ - libbfd.p opncls.p reloc.p \ - section.p syms.p targets.p \ - format.p coffcode.p core.p machines.p init.p - -IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip ctor.ip - -# SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction -# between VPATH and suffix rules. If you use GNU Make, perhaps other Makes, -# you don't need these three: -SRCDOC = aoutx.h archive.c archures.c \ - bfd.c cache.c coffcode.h \ - core.c format.c libbfd.c \ - opncls.c reloc.c section.c \ - syms.c targets.c init.c - -SRCPROT = archive.c archures.c bfd.c \ - coffcode.h core.c format.c \ - libbfd.c opncls.c reloc.c \ - section.c syms.c targets.c init.c - -SRCIPROT = cache.c libbfd.c reloc.c cpu-h8300.c cpu-i960.c archures.c init.c ctor.c - - -docs: protos bfd.info bfd.dvi bfd.ps - -protos: $(PROTOS) $(IPROTOS) - sed -f intobfd bfd-in.h > bfd.h - sed -f tolibbfd libbfd-in.h > libbfd.h - sed -f tolibcoff libcoff-in.h > libcoff.h - -# Following three rules only for the benefit of Sun Make; see comment above -$(DOCFILES) : $(SRCDOC) -$(PROTOS) : $(SRCPROT) -$(IPROTOS) : $(SRCIPROT) - -clean: - rm -f $(PROTOS) *.p *.ip *.h bfd.?? $(DOCFILES) bfd.dvi bfd.ps *~* *# bfd.??? - -bfd.info: $(DOCFILES) bfd.texinfo - makeinfo bfd.texinfo - -bfd.dvi: $(DOCFILES) bfd.texinfo - TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex bfd.texinfo - texindex bfd.?? - TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex bfd.texinfo - -bfd.ps: bfd.dvi - dvips bfd -o - -quickdoc: $(DOCFILES) bfd.texinfo - TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex bfd.texinfo diff --git a/bfd/doc/awkscan b/bfd/doc/awkscan deleted file mode 100755 index 69b0ceaa3b..0000000000 --- a/bfd/doc/awkscan +++ /dev/null @@ -1,12 +0,0 @@ -# NOTE: BEGIN pattern gives errors if other than 1st line; -# END ditto if other than last. -BEGIN { print "@c ------------------------------START TEXT FROM " FILENAME } -# -# Keep /*doc* blocks (terminated by either */ or *-*/) -/^\/\*doc\*/,/^\*\/|^\*-\*\// -# -# Also keep two kinds of /*proto blocks -/^\/\*proto\*/,/^\*\/|^\*-\*\// -/^\/\*proto-internal\*/,/^\*\/|^\*-\*\// -# -END { print "@c ------------------------------END TEXT FROM " FILENAME } diff --git a/bfd/doc/awkscan-ip b/bfd/doc/awkscan-ip deleted file mode 100755 index 73bd61fa95..0000000000 --- a/bfd/doc/awkscan-ip +++ /dev/null @@ -1,8 +0,0 @@ -# Awk filter, 1st filter for BFD internal prototype file extraction -# -# keep /*proto-internal blocks -/^\/\*proto-internal\*/,/^\*\/|^\*-\*\// -# -# Apparent bug in sed can discard last line in some situations; therefore -# make last line harmless. -END { print "\n" } diff --git a/bfd/doc/awkscan-p b/bfd/doc/awkscan-p deleted file mode 100755 index c7fe79fb34..0000000000 --- a/bfd/doc/awkscan-p +++ /dev/null @@ -1,8 +0,0 @@ -# Awk filter, 1st filter for BFD prototype file extraction -# -# keep /*proto blocks -/^\/\*proto\*/,/^\*\/|^\*-\*\// -# -# Apparent bug in sed can discard last line in some situations; therefore -# make last line harmless. -END { print "\n" } diff --git a/bfd/doc/bfd.info b/bfd/doc/bfd.info deleted file mode 100644 index 529d69d322..0000000000 --- a/bfd/doc/bfd.info +++ /dev/null @@ -1,67 +0,0 @@ -Info file bfd.info, produced by Makeinfo, -*- Text -*- from input file -bfd.texinfo. - - This file documents the BFD library. - - Copyright (C) 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, subject to the -terms of the GNU General Public License, which includes the provision -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. - -Indirect: -bfd.info-1: 821 -bfd.info-2: 44533 -bfd.info-3: 89652 - -Tag Table: -(Indirect) -Node: Top823 -Node: Overview1086 -Node: History1985 -Node: How It Works2937 -Node: What BFD Version 1 Can Do4363 -Node: BFD information loss5388 -Node: Mechanism8002 -Node: BFD front end12332 -Node: Memory Usage17576 -Node: Initialization18818 -Node: Sections19432 -Node: Section Input19910 -Node: Section Output21190 -Node: typedef asection22559 -Node: section prototypes27347 -Node: Symbols30865 -Node: Reading Symbols32454 -Node: Writing Symbols33410 -Node: typedef asymbol34939 -Node: symbol handling functions38386 -Node: Archives40232 -Node: Formats41678 -Node: Relocations43795 -Node: typedef arelent44535 -Node: howto manager56584 -Node: Core Files57569 -Node: Targets58466 -Node: bfd_target60218 -Node: Architectures68923 -Node: Opening and Closing76770 -Node: Internal78654 -Node: File Caching81129 -Node: BFD back end83617 -Node: What to Put Where83810 -Node: aout83946 -Node: coff89654 -Node: Index100603 - -End Tag Table diff --git a/bfd/doc/bfdinfo b/bfd/doc/bfdinfo deleted file mode 100755 index 5bb06ff489..0000000000 --- a/bfd/doc/bfdinfo +++ /dev/null @@ -1,1281 +0,0 @@ -Info file bfdinfo, produced by Makeinfo, -*- Text -*- from input file -bfd.texinfo. - - This file documents the BFD library. - - Copyright (C) 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, subject to the -terms of the GNU General Public License, which includes the provision -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. - - -File: bfdinfo, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - - This file documents the binary file descriptor library libbfd. - -* Menu: - -* Overview:: Overview of BFD -* History:: History of BFD -* Backends:: Backends -* Porting:: Porting -* Future:: Future -* Index:: Index - -BFD body: -* Memory usage:: -* Sections:: -* Symbols:: -* Archives:: -* Formats:: -* Relocations:: -* Core Files:: -* Targets:: -* Architecturs:: -* Opening and Closing:: -* Internal:: -* File Caching:: - -BFD backends: -* a.out backends:: -* coff backends:: - - -File: bfdinfo, Node: Overview, Next: History, Prev: Top, Up: Top - -Introduction -************ - - Simply put, BFD is a package which allows applications to use the -same routines to operate on object files whatever the object file -format. A different object file format can be supported simply by -creating a new BFD back end and adding it to the library. - - BFD is split into two parts; the front end and the many back ends. - - * memory, and various canonical data structures. The front end also - decides which back end to use, and when to call back end routines. - - * end provides a set of calls which the BFD front end can use to - maintain its canonical form. The back ends also may keep around - information for their own use, for greater efficiency. - - -File: bfdinfo, Node: History, Next: How It Works, Prev: Overview, Up: Top - -History -======= - - One spur behind BFD was the desire, on the part of the GNU 960 team -at Intel Oregon, for interoperability of applications on their COFF and -b.out file formats. Cygnus was providing GNU support for the team, and -Cygnus was contracted to provide the required functionality. - - The name came from a conversation David Wallace was having with -Richard Stallman about the library: RMS said that it would be quite -hard--David said "BFD". Stallman was right, but the name stuck. - - At the same time, Ready Systems wanted much the same thing, but for -different object file formats: IEEE-695, Oasys, Srecords, a.out and 68k -coff. - - BFD was first implemented by Steve Chamberlain (steve@cygnus.com), -John Gilmore (gnu@cygnus.com), K. Richard Pixley (rich@cygnus.com) and -David Wallace (gumby@cygnus.com) at Cygnus Support in Palo Alto, -California. - - -File: bfdinfo, Node: How It Works, Next: History, Prev: Porting, Up: Top - -How It Works -============ - - To use the library, include `bfd.h' and link with `libbfd.a'. - - BFD provides a common interface to the parts of an object file for -a calling application. - - When an application sucessfully opens a target file (object, -archive or whatever) a pointer to an internal structure is returned. -This pointer points to a structure called `bfd', described in -`include/bfd.h'. Our convention is to call this pointer a BFD, and -instances of it within code `abfd'. All operations on the target -object file are applied as methods to the BFD. The mapping is defined -within `bfd.h' in a set of macros, all beginning `bfd'_. - - For example, this sequence would do what you would probably expect: -return the number of sections in an object file attached to a BFD -`abfd'. - - - #include "bfd.h" - - unsigned int number_of_sections(abfd) - bfd *abfd; - { - return bfd_count_sections(abfd); - } - - lisp - - The abstraction used within BFD is that an object file has a header, -a number of sections containing raw data, a set of relocations, and -some symbol information. Also, BFDs opened for archives have the -additional attribute of an index and contain subordinate BFDs. This -approach is fine for a.out and coff, but loses efficiency when applied -to formats such as S-records and IEEE-695. - -What BFD Version 1 Can Do -========================= - - As different information from the the object files is required, BFD -reads from different sections of the file and processes them. For -example a very common operation for the linker is processing symbol -tables. Each BFD back end provides a routine for converting between -the object file's representation of symbols and an internal canonical -format. When the linker asks for the symbol table of an object file, -it calls through the memory pointer to the relevant BFD back end -routine which reads and converts the table into a canonical form. The -linker then operates upon the canonical form. When the link is -finished and the linker writes the output file's symbol table, another -BFD back end routine is called which takes the newly created symbol -table and converts it into the chosen output format. - - -File: bfdinfo, Node: BFD information loss, Next: Mechanism, Prev: BFD outline, Up: BFD - -Information Loss ----------------- - - *Some information is lost due to the nature of the file format.* -The output targets supported by BFD do not provide identical -facilities, and information which may be described in one form has -nowhere to go in another format. One example of this is alignment -information in `b.out'. There is nowhere in an `a.out' format file to -store alignment information on the contained data, so when a file is -linked from `b.out' and an `a.out' image is produced, alignment -information will not propagate to the output file. (The linker will -still use the alignment information internally, so the link is -performed correctly). - - Another example is COFF section names. COFF files may contain an -unlimited number of sections, each one with a textual section name. If -the target of the link is a format which does not have many sections -(eg `a.out') or has sections without names (eg the Oasys format) the -link cannot be done simply. You can circumvent this problem by -describing the desired input-to-output section mapping with the linker -command language. - - *Information can be lost during canonicalization.* The BFD internal -canonical form of the external formats is not exhaustive; there are -structures in input formats for which there is no direct -representation internally. This means that the BFD back ends cannot -maintain all possible data richness through the transformation between -external to internal and back to external formats. - - This limitation is only a problem when an application reads one -format and writes another. Each BFD back end is responsible for -maintaining as much data as possible, and the internal BFD canonical -form has structures which are opaque to the BFD core, and exported -only to the back ends. When a file is read in one format, the -canonical form is generated for BFD and the application. At the same -time, the back end saves away any information which may otherwise be -lost. If the data is then written back in the same format, the back -end routine will be able to use the canonical form provided by the BFD -core as well as the information it prepared earlier. Since there is a -great deal of commonality between back ends, this mechanism is very -useful. There is no information lost for this reason when linking or -copying big endian COFF to little endian COFF, or `a.out' to `b.out'. -When a mixture of formats is linked, the information is only lost from -the files whose format differs from the destination. - - -File: bfdinfo, Node: Mechanism, Prev: BFD information loss, Up: BFD - -Mechanism ---------- - - The greatest potential for loss of information is when there is -least overlap between the information provided by the source format, -that stored by the canonical format, and the information needed by the -destination format. A brief description of the canonical form may help -you appreciate what kinds of data you can count on preserving across -conversions. - -*files* - Information on target machine architecture, particular - implementation and format type are stored on a per-file basis. - Other information includes a demand pageable bit and a write - protected bit. Note that information like Unix magic numbers is - not stored here--only the magic numbers' meaning, so a `ZMAGIC' - file would have both the demand pageable bit and the write - protected text bit set. The byte order of the target is stored - on a per-file basis, so that big- and little-endian object files - may be linked with one another. - -*sections* - Each section in the input file contains the name of the section, - the original address in the object file, various flags, size and - alignment information and pointers into other BFD data structures. - -*symbols* - Each symbol contains a pointer to the object file which originally - defined it, its name, its value, and various flag bits. When a - BFD back end reads in a symbol table, the back end relocates all - symbols to make them relative to the base of the section where - they were defined. This ensures that each symbol points to its - containing section. Each symbol also has a varying amount of - hidden data to contain private data for the BFD back end. Since - the symbol points to the original file, the private data format - for that symbol is accessible. `gld' can operate on a collection - of symbols of wildly different formats without problems. - - Normal global and simple local symbols are maintained on output, - so an output file (no matter its format) will retain symbols - pointing to functions and to global, static, and common - variables. Some symbol information is not worth retaining; in - `a.out' type information is stored in the symbol table as long - symbol names. This information would be useless to most COFF - debuggers; the linker has command line switches to allow users to - throw it away. - - There is one word of type information within the symbol, so if the - format supports symbol type information within symbols (for - example COFF, IEEE, Oasys) and the type is simple enough to fit - within one word (nearly everything but aggregates) the - information will be preserved. - -*relocation level* - Each canonical BFD relocation record contains a pointer to the - symbol to relocate to, the offset of the data to relocate, the - section the data is in and a pointer to a relocation type - descriptor. Relocation is performed effectively by message - passing through the relocation type descriptor and symbol - pointer. It allows relocations to be performed on output data - using a relocation method only available in one of the input - formats. For instance, Oasys provides a byte relocation format. - A relocation record requesting this relocation type would point - indirectly to a routine to perform this, so the relocation may be - performed on a byte being written to a COFF file, even though 68k - COFF has no such relocation type. - -*line numbers* - Object formats can contain, for debugging purposes, some form of - mapping between symbols, source line numbers, and addresses in - the output file. These addresses have to be relocated along with - the symbol information. Each symbol with an associated list of - line number records points to the first record of the list. The - head of a line number list consists of a pointer to the symbol, - which allows divination of the address of the function whose line - number is being described. The rest of the list is made up of - pairs: offsets into the section and line numbers. Any format - which can simply derive this information can pass it successfully - between formats (COFF, IEEE and Oasys). - - -File: bfdinfo, Node: BFD front end, Next: BFD back end, Prev: Mechanism, Up: Top - -BFD front end -************* - -typedef bfd -=========== - - Pointers to bfd structs are the cornerstone of any application using -`libbfd'. References though the BFD and to data in the BFD give the -entire BFD functionality. - - Here is the BFD struct itself. This contains the major data about -the file, and contains pointers to the rest of the data. - - struct _bfd - { - - The filename the application opened the BFD with. - - CONST char *filename; - - A pointer to the target jump table. - - struct bfd_target *xvec; - - To avoid dragging too many header files into every file that -includes `bfd.h', IOSTREAM has been declared as a "char *", and MTIME -as a "long". Their correct types, to which they are cast when used, -are "FILE *" and "time_t". - - The iostream is the result of an fopen on the filename. - - char *iostream; - - Is the file being cached *Note File Caching::. - - boolean cacheable; - - Marks whether there was a default target specified when the BFD was -opened. This is used to select what matching algorithm to use to chose -the back end. - - boolean target_defaulted; - - The caching routines use these to maintain a least-recently-used -list of BFDs (*note File Caching::.). - - struct _bfd *lru_prev, *lru_next; - - When a file is closed by the caching routines, BFD retains state -information on the file here: - - file_ptr where; - - and here: - - boolean opened_once; - - boolean mtime_set; - - File modified time - - long mtime; - - Reserved for an unimplemented file locking extension. - - int ifd; - - The format which belongs to the BFD. - - bfd_format format; - - The direction the BFD was opened with - - enum bfd_direction {no_direction = 0, - read_direction = 1, - write_direction = 2, - both_direction = 3} direction; - - Format_specific flags - - flagword flags; - - Currently my_archive is tested before adding origin to anything. I -believe that this can become always an add of origin, with origin set -to 0 for non archive files. - - file_ptr origin; - - Remember when output has begun, to stop strange things happening. - - boolean output_has_begun; - - Pointer to linked list of sections - - struct sec *sections; - - The number of sections - - unsigned int section_count; - - Stuff only useful for object files: The start address. - - bfd_vma start_address; - - Used for input and output - - unsigned int symcount; - - Symbol table for output BFD - - struct symbol_cache_entry **outsymbols; - - Architecture of object machine, eg m68k - - enum bfd_architecture obj_arch; - - Particular machine within arch, e.g. 68010 - - unsigned long obj_machine; - - Stuff only useful for archives: - - PTR arelt_data; - struct _bfd *my_archive; - struct _bfd *next; - struct _bfd *archive_head; - boolean has_armap; - - Used by the back end to hold private data. - - PTR tdata; - - Used by the application to hold private data - - PTR usrdata; - - Where all the allocated stuff under this BFD goes (*note Memory -Usage::.). - - struct obstack memory; - }; - -`bfd_set_start_address' -....................... - - Marks the entry point of an output BFD. Returns `true' on success, -`false' otherwise. - - boolean bfd_set_start_address(bfd *, bfd_vma); - -`bfd_get_mtime' -............... - - Return cached file modification time (e.g. as read from archive -header for archive members, or from file system if we have been called -before); else determine modify time, cache it, and return it. - - long bfd_get_mtime(bfd *); - -`stuff' -....... - - - - #define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) - - #define bfd_find_nearest_line(abfd, section, symbols, offset, filename_ptr, func, line_ptr) \ - BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, section, symbols, offset, filename_ptr, func, line_ptr)) - - #define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) - - #define bfd_debug_info_end(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) - - #define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) - - #define bfd_stat_arch_elt(abfd, stat) \ - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) - - #define bfd_coff_swap_aux_in(a,e,t,c,i) \ - BFD_SEND (a, _bfd_coff_swap_aux_in, (a,e,t,c,i)) - - #define bfd_coff_swap_sym_in(a,e,i) \ - BFD_SEND (a, _bfd_coff_swap_sym_in, (a,e,i)) - - #define bfd_coff_swap_lineno_in(a,e,i) \ - BFD_SEND ( a, _bfd_coff_swap_lineno_in, (a,e,i)) - - lisp - - -File: bfdinfo, Node: Memory Usage, Next: Sections, Prev: bfd, Up: Top - -Memory Usage -============ - - BFD keeps all its internal structures in obstacks. There is one -obstack per open BFD file, into which the current state is stored. -When a BFD is closed, the obstack is deleted, and so everything which -has been allocated by libbfd for the closing file will be thrown away. - - BFD will not free anything created by an application, but pointers -into `bfd' structures will be invalidated on a `bfd_close'; for -example, after a `bfd_close' the vector passed to -`bfd_canonicalize_symtab' will still be around, since it has been -allocated by the application, but the data that it pointed to will be -lost. - - The general rule is not to close a BFD until all operations -dependent upon data from the BFD have been completed, or all the data -from within the file has been copied. To help with the management of -memory, there is a function (`bfd_alloc_size') which returns the -number of bytes in obstacks associated with the supplied BFD. This -could be used to select the greediest open BFD, close it to reclaim -the memory, perform some operation and reopen the BFD again, to get a -fresh copy of the data structures. - - -File: bfdinfo, Node: Sections, Next: Symbols, Prev: Memory Usage, Up: Top - -Sections -======== - - Sections are supported in BFD in `section.c'. - - The raw data contained within a BFD is maintained through the -section abstraction. A single BFD may have any number of sections, -and keeps hold of them by pointing to the first, each one points to -the next in the list. - -* Menu: - -* Section Input:: -* Section Output:: -* typedef asection:: -* section prototypes:: - - -File: bfdinfo, Node: Section Input, Next: Section Output, Up: Sections - -Section Input -------------- - - When a BFD is opened for reading, the section structures are created -and attached to the BFD. - - Each section has a name which describes the section in the outside -world - for example, `a.out' would contain at least three sections, -called `.text', `.data' and `.bss'. - - Sometimes a BFD will contain more than the 'natural' number of -sections. A back end may attach other sections containing constructor -data, or an application may add a section (using bfd_make_section) to -the sections attached to an already open BFD. For example, the linker -creates a supernumary section `COMMON' for each input file's BFD to -hold information about common storage. - - The raw data is not necessarily read in at the same time as the -section descriptor is created. Some targets may leave the data in -place until a `bfd_get_section_contents' call is made. Other back ends -may read in all the data at once - For example; an S-record file has -to be read once to determine the size of the data. An IEEE-695 file -doesn't contain raw data in sections, but data and relocation -expressions intermixed, so the data area has to be parsed to get out -the data and relocations. - - -File: bfdinfo, Node: Section Output, Next: typedef asection, Prev: Section Input, Up: Sections - -Section Output --------------- - - To write a new object style BFD, the various sections to be written -have to be created. They are attached to the BFD in the same way as -input sections, data is written to the sections using -`bfd_set_section_contents'. - - The linker uses the fields `output_section' and `output_offset' to -create an output file. - - The data to be written comes from input sections attached to the -output sections. The output section structure can be considered a -filter for the input section, the output section determines the vma of -the output data and the name, but the input section determines the -offset into the output section of the data to be written. - - Eg to create a section "O", starting at 0x100, 0x123 long, -containing two subsections, "A" at offset 0x0 (ie at vma 0x100) and -"B" at offset 0x20 (ie at vma 0x120) the structures would look like: - - - - section name "A" - output_offset 0x00 - size 0x20 - output_section -----------> section name "O" - | vma 0x100 - section name "B" | size 0x123 - output_offset 0x20 | - size 0x103 | - output_section --------| - - lisp - - -File: bfdinfo, Node: typedef asection, Next: section prototypes, Prev: Section Output, Up: Sections - -typedef asection ----------------- - - The shape of a section struct: - - typedef struct sec { - - The name of the section, the name isn't a copy, the pointer is the -same as that passed to bfd_make_section. - - CONST char *name; - - The next section in the list belonging to the BFD, or NULL. - - struct sec *next; - - The field flags contains attributes of the section. Some of these -flags are read in from the object file, and some are synthesized from -other information. - - flagword flags; - - #define SEC_NO_FLAGS 0x000 - - Tells the OS to allocate space for this section when loaded. This -would clear for a section containing debug information only. - - #define SEC_ALLOC 0x001 - - Tells the OS to load the section from the file when loading. This -would be clear for a .bss section - - #define SEC_LOAD 0x002 - - The section contains data still to be relocated, so there will be -some relocation information too. - - #define SEC_RELOC 0x004 - - Obsolete - - #define SEC_BALIGN 0x008 - - A signal to the OS that the section contains read only data. - - #define SEC_READONLY 0x010 - - The section contains code only. - - #define SEC_CODE 0x020 - - The section contains data only. - - #define SEC_DATA 0x040 - - The section will reside in ROM. - - #define SEC_ROM 0x080 - - The section contains constructor information. This section type is -used by the linker to create lists of constructors and destructors -used by `g++'. When a back end sees a symbol which should be used in a -constructor list, it creates a new section for the type of name (eg -`__CTOR_LIST__'), attaches the symbol to it and builds a relocation. -To build the lists of constructors, all the linker has to to is -catenate all the sections called `__CTOR_LIST__' and relocte the data -contained within - exactly the operations it would peform on standard -data. - - #define SEC_CONSTRUCTOR 0x100 - - The section is a constuctor, and should be placed at the end of the -.. - - #define SEC_CONSTRUCTOR_TEXT 0x1100 - - #define SEC_CONSTRUCTOR_DATA 0x2100 - - #define SEC_CONSTRUCTOR_BSS 0x3100 - - The section has contents - a bss section could be `SEC_ALLOC' | -`SEC_HAS_CONTENTS', a debug section could be `SEC_HAS_CONTENTS' - - #define SEC_HAS_CONTENTS 0x200 - - An instruction to the linker not to output sections containing this -flag even if they have information which would normally be written. - - #define SEC_NEVER_LOAD 0x400 - - The base address of the section in the address space of the target. - - bfd_vma vma; - - The size of the section in bytes of the loaded section. This -contains a value even if the section has no contents (eg, the size of -`.bss'). - - bfd_size_type size; - - If this section is going to be output, then this value is the -offset into the output section of the first byte in the input section. -Eg, if this was going to start at the 100th byte in the output -section, this value would be 100. - - bfd_vma output_offset; - - The output section through which to map on output. - - struct sec *output_section; - - The alignment requirement of the section, as an exponent - eg 3 -aligns to 2^3 (or 8) - - unsigned int alignment_power; - - If an input section, a pointer to a vector of relocation records for -the data in this section. - - struct reloc_cache_entry *relocation; - - If an output section, a pointer to a vector of pointers to -relocation records for the data in this section. - - struct reloc_cache_entry **orelocation; - - The number of relocation records in one of the above - - unsigned reloc_count; - - Which section is it 0..nth - - int index; - - Information below is back end specific - and not always used or -updated - - File position of section data - - file_ptr filepos; - - File position of relocation info - - file_ptr rel_filepos; - - File position of line data - - file_ptr line_filepos; - - Pointer to data for applications - - PTR userdata; - - struct lang_output_section *otheruserdata; - - Attached line number information - - alent *lineno; - - Number of line number records - - unsigned int lineno_count; - - When a section is being output, this value changes as more -linenumbers are written out - - file_ptr moving_line_filepos; - - what the section number is in the target world - - unsigned int target_index; - - PTR used_by_bfd; - - If this is a constructor section then here is a list of the -relocations created to relocate items within it. - - struct relent_chain *constructor_chain; - - The BFD which owns the section. - - bfd *owner; - - } asection ; - - -File: bfdinfo, Node: section prototypes, Next: Section, Prev: typedef section, Up: Sections - -section prototypes ------------------- - -`bfd_get_section_by_name' -......................... - - Runs through the provided ABFD and returns the `asection' who's -name matches that provided, otherwise NULL. *Note Sections::, for more -information. - - asection * bfd_get_section_by_name(bfd *abfd, CONST char *name); - -`bfd_make_section' -.................. - - This function creates a new empty section called NAME and attaches -it to the end of the chain of sections for the BFD supplied. An -attempt to create a section with a name which is already in use, -returns the old section by that name instead. - - Possible errors are: - -`invalid_operation' - If output has already started for this BFD. - -`no_memory' - If obstack alloc fails. - - asection * bfd_make_section(bfd *, CONST char *name); - -`bfd_set_section_flags' -....................... - - Attempts to set the attributes of the section named in the BFD -supplied to the value. Returns true on success, false on error. -Possible error returns are: - -`invalid operation' - The section cannot have one or more of the attributes requested. - For example, a .bss section in `a.out' may not have the - `SEC_HAS_CONTENTS' field set. - - boolean bfd_set_section_flags(bfd *, asection *, flagword); - -`bfd_map_over_sections' -....................... - - Calls the provided function FUNC for each section attached to the -BFD ABFD, passing OBJ as an argument. The function will be called as -if by - - func(abfd, the_section, obj); - - void bfd_map_over_sections(bfd *abfd, void (*func)(), PTR obj); - - This is the prefered method for iterating over sections, an -alternative would be to use a loop: - - section *p; - for (p = abfd->sections; p != NULL; p = p->next) - func(abfd, p, ...) - -`bfd_set_section_size' -...................... - - Sets SECTION to the size VAL. If the operation is ok, then `true' -is returned, else `false'. - - Possible error returns: - -`invalid_operation' - Writing has started to the BFD, so setting the size is invalid - - boolean bfd_set_section_size(bfd *, asection *, bfd_size_type val); - -`bfd_set_section_contents' -.......................... - - Sets the contents of the section SECTION in BFD ABFD to the data -starting in memory at DATA. The data is written to the output section -starting at offset OFFSET for COUNT bytes. - - Normally `true' is returned, else `false'. Possible error returns -are: - -`no_contents' - The output section does not have the `SEC_HAS_CONTENTS' - attribute, so nothing can be written to it. - -`and some more too' - This routine is front end to the back end function -`_bfd_set_section_contents'. - - boolean bfd_set_section_contents(bfd *abfd, - asection *section, - PTR data, - file_ptr offset, - bfd_size_type count); - -`bfd_get_section_contents' -.......................... - - This function reads data from SECTION in BFD ABFD into memory -starting at LOCATION. The data is read at an offset of OFFSET from the -start of the input section, and is read for COUNT bytes. - - If the contents of a constuctor with the `SEC_CONSTUCTOR' flag set -are requested, then the LOCATION is filled with zeroes. - - If no errors occur, `true' is returned, else `false'. Possible -errors are: - -`unknown yet' - boolean bfd_get_section_contents(bfd *abfd, asection *section, PTR location, - file_ptr offset, bfd_size_type count); - - -File: bfdinfo, Node: Symbols, Next: Archives, Prev: Sections, Up: To - -Symbols -======= - - BFD trys to maintain as much symbol information as it can when it -moves information from file to file. BFD passes information to -applications though the `asymbol' structure. When the application -requests the symbol table, BFD reads the table in the native form and -translates parts of it into the internal format. To maintain more than -the infomation passed to applications some targets keep some -information 'behind the sceans', in a structure only the particular -back end knows about. For example, the coff back end keeps the -original symbol table structure as well as the canonical structure -when a BFD is read in. On output, the coff back end can reconstruct -the output symbol table so that no information is lost, even -information unique to coff which BFD doesn't know or understand. If a -coff symbol table was read, but was written through an a.out back end, -all the coff specific information would be lost. (.. until BFD 2 :). - - The symbol table of a BFD is not necessarily read in until a -canonicalize request is made. Then the BFD back end fills in a table -provided by the application with pointers to the canonical information. - - To output symbols, the application provides BFD with a table of -pointers to pointers to `asymbol's. This allows applications like the -linker to output a symbol as read, since the 'behind the sceens' -information will be still available. - -* Menu: - -* Reading Symbols:: -* Writing Symbols:: -* typedef asymbol:: -* symbol handling functions:: - - -File: bfdinfo, Node: Reading Symbols, Next: Writing Symbols, Prev: Symbols, Up: Symbols - -Reading Symbols ---------------- - - There are two stages to reading a symbol table from a BFD; -allocating storage, and the actual reading process. This is an excerpt -from an appliction which reads the symbol table: - - - unsigned int storage_needed; - asymbol **symbol_table; - unsigned int number_of_symbols; - unsigned int i; - - storage_needed = get_symtab_upper_bound (abfd); - - if (storage_needed == 0) { - return ; - } - symbol_table = (asymbol **) malloc (storage_needed); - ... - number_of_symbols = - bfd_canonicalize_symtab (abfd, symbol_table); - - for (i = 0; i < number_of_symbols; i++) { - process_symbol (symbol_table[i]); - } - - lisp - - All storage for the symbols themselves is in an obstack connected to -the BFD, and is freed when the BFD is closed. - - -File: bfdinfo, Node: Writing Symbols, Next: typedef asymbol, Prev: Reading Symbols, Up: Symbols - -Writing Symbols ---------------- - - Writing of a symbol table is automatic when a BFD open for writing -is closed. The application attaches a vector of pointers to pointers -to symbols to the BFD being written, and fills in the symbol count. -The close and cleanup code reads through the table provided and -performs all the necessary operations. The outputing code must always -be provided with an 'owned' symbol; one which has come from another -BFD, or one which has been created using `bfd_make_empty_symbol'. - - An example showing the creation of a symbol table with only one -element: - - - #include "bfd.h" - main() - { - bfd *abfd; - asymbol *ptrs[2]; - asymbol *new; - - abfd = bfd_openw("foo","a.out-sunos-big"); - bfd_set_format(abfd, bfd_object); - new = bfd_make_empty_symbol(abfd); - new->name = "dummy_symbol"; - new->section = (asection *)0; - new->flags = BSF_ABSOLUTE | BSF_GLOBAL; - new->value = 0x12345; - - ptrs[0] = new; - ptrs[1] = (asymbol *)0; - - bfd_set_symtab(abfd, ptrs, 1); - bfd_close(abfd); - } - - ./makesym - nm foo - 00012345 A dummy_symbol - - lisp - - Many formats cannot represent arbitary symbol information; for -instance the `a.out' object format does not allow an arbitary number -of sections. A symbol pointing to a section which is not one of -`.text', `.data' or `.bss' cannot be described. - - -File: bfdinfo, Node: typedef asymbol, Next: symbol handling functions, Prev: Writing Symbols, Up: Symbols - -typedef asymbol ---------------- - - An `asymbol' has the form: - - typedef struct symbol_cache_entry - { - - A pointer to the BFD which owns the symbol. This information is -necessary so that a back end can work out what additional (invisible to -the application writer) information is carried with the symbol. - - struct _bfd *the_bfd; - - The text of the symbol. The name is left alone, and not copied - the -application may not alter it. - - CONST char *name; - - The value of the symbol. - - symvalue value; - - Attributes of a symbol: - - #define BSF_NO_FLAGS 0x00 - - The symbol has local scope; `static' in `C'. The value is the -offset into the section of the data. - - #define BSF_LOCAL 0x01 - - The symbol has global scope; initialized data in `C'. The value is -the offset into the section of the data. - - #define BSF_GLOBAL 0x02 - - Obsolete - - #define BSF_IMPORT 0x04 - - The symbol has global scope, and is exported. The value is the -offset into the section of the data. - - #define BSF_EXPORT 0x08 - - The symbol is undefined. `extern' in `C'. The value has no meaning. - - #define BSF_UNDEFINED 0x10 - - The symbol is common, initialized to zero; default in `C'. The -value is the size of the object in bytes. - - #define BSF_FORT_COMM 0x20 - - A normal `C' symbol would be one of: `BSF_LOCAL', `BSF_FORT_COMM', -`BSF_UNDEFINED' or `BSF_EXPORT|BSD_GLOBAL' - - The symbol is a debugging record. The value has an arbitary meaning. - - #define BSF_DEBUGGING 0x40 - - The symbol has no section attached, any value is the actual value -and is not a relative offset to a section. - - #define BSF_ABSOLUTE 0x80 - - Used by the linker - - #define BSF_KEEP 0x10000 - #define BSF_KEEP_G 0x80000 - - Unused - - #define BSF_WEAK 0x100000 - #define BSF_CTOR 0x200000 - #define BSF_FAKE 0x400000 - - The symbol used to be a common symbol, but now it is allocated. - - #define BSF_OLD_COMMON 0x800000 - - The default value for common data. - - #define BFD_FORT_COMM_DEFAULT_VALUE 0 - - In some files the type of a symbol sometimes alters its location in -an output file - ie in coff a `ISFCN' symbol which is also `C_EXT' -symbol appears where it was declared and not at the end of a section. -This bit is set by the target BFD part to convey this information. - - #define BSF_NOT_AT_END 0x40000 - - Signal that the symbol is the label of constructor section. - - #define BSF_CONSTRUCTOR 0x1000000 - - Signal that the symbol is a warning symbol. If the symbol is a -warning symbol, then the value field (I know this is tacky) will point -to the asymbol which when referenced will cause the warning. - - #define BSF_WARNING 0x2000000 - - Signal that the symbol is indirect. The value of the symbol is a -pointer to an undefined asymbol which contains the name to use instead. - - #define BSF_INDIRECT 0x4000000 - - flagword flags; - - A pointer to the section to which this symbol is relative, or 0 if -the symbol is absolute or undefined. Note that it is not sufficient to -set this location to 0 to mark a symbol as absolute - the flag -`BSF_ABSOLUTE' must be set also. - - struct sec *section; - - Back end special data. This is being phased out in favour of making -this a union. - - PTR udata; - } asymbol; - - -File: bfdinfo, Node: symbol handling functions, Next: Symbols, Prev: typedef asymbol, Up: Symbols - -Symbol Handling Functions -------------------------- - -`get_symtab_upper_bound' -........................ - - Returns the number of bytes required in a vector of pointers to -`asymbols' for all the symbols in the supplied BFD, including a -terminal NULL pointer. If there are no symbols in the BFD, then 0 is -returned. - - - #define get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _get_symtab_upper_bound, (abfd)) - - lisp - -`bfd_canonicalize_symtab' -......................... - - Supplied a BFD and a pointer to an uninitialized vector of pointers. -This reads in the symbols from the BFD, and fills in the table with -pointers to the symbols, and a trailing NULL. The routine returns the -actual number of symbol pointers not including the NULL. - - - #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab,\ - (abfd, location)) - - lisp - -`bfd_set_symtab' -................ - - Provided a table of pointers to to symbols and a count, writes to -the output BFD the symbols when closed. - - boolean bfd_set_symtab(bfd *, asymbol **, unsigned int ); - -`bfd_print_symbol_vandf' -........................ - - Prints the value and flags of the symbol supplied to the stream -file. - - void bfd_print_symbol_vandf(PTR file, asymbol *symbol); - -`bfd_make_empty_symbol' -....................... - - This function creates a new `asymbol' structure for the BFD, and -returns a pointer to it. - - This routine is necessary, since each back end has private -information surrounding the `asymbol'. Building your own `asymbol' and -pointing to it will not create the private information, and will cause -problems later on. - - - #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) - - lisp - - -File: bfdinfo, Node: Archives, Next: Formats, Prev: Symbols, Up: Top - -Archives -======== - - Gumby, you promised to write this bit... - - Archives are supported in BFD in `archive.c'. - - An archive is represented internally just like another BFD, with a -pointer to a chain of contained BFDs. Archives can be created by -opening BFDs, linking them together and attaching them as children to -another BFD and then closing the parent BFD. - -`bfd_get_next_mapent' -..................... - - What this does - - symindex bfd_get_next_mapent(bfd *, symindex, carsym **); - -`bfd_set_archive_head' -...................... - - Used whilst processing archives. Sets the head of the chain of BFDs -contained in an archive to NEW_HEAD. (see chapter on archives) - - boolean bfd_set_archive_head(bfd *output, bfd *new_head); - -`bfd_get_elt_at_index' -...................... - - Return the sub bfd contained within the archive at archive index n. - - bfd * bfd_get_elt_at_index(bfd *, int); - -`bfd_openr_next_archived_file' -.............................. - - Initially provided a BFD containing an archive and NULL, opens a BFD -on the first contained element and returns that. Subsequent calls to -bfd_openr_next_archived_file should pass the archive and the previous -return value to return a created BFD to the next contained element. -NULL is returned when there are no more. - - bfd* bfd_openr_next_archived_file(bfd *archive, bfd *previous); - - -File: bfdinfo, Node: Formats, Next: Relocations, Prev: Archives, Up: Top - -File Formats -============ - - A format is a BFD concept of high level file contents. The formats -supported by BFD are: - -`bfd_object' - The BFD may contain data, symbols, relocations and debug info. - -`bfd_archive' - The \ No newline at end of file diff --git a/bfd/doc/blins-p b/bfd/doc/blins-p deleted file mode 100755 index 858dcd7ecd..0000000000 --- a/bfd/doc/blins-p +++ /dev/null @@ -1,8 +0,0 @@ -# sed script for BFD header files -# Merge adjacent blank lines. Loop til no change. -:blin -/^$/,/^ *[^ ]*.*$/{ -/^$/N -s/^ *\n *$// -} -t blin diff --git a/bfd/doc/exfil1-p b/bfd/doc/exfil1-p deleted file mode 100755 index a57fc957ad..0000000000 --- a/bfd/doc/exfil1-p +++ /dev/null @@ -1,5 +0,0 @@ -# -# Locate and coalesce adjacent comments -/\*\/$/N -s/\*\/\n\/\*/\ -/ diff --git a/bfd/doc/exfil3-p b/bfd/doc/exfil3-p deleted file mode 100755 index c557a163ac..0000000000 --- a/bfd/doc/exfil3-p +++ /dev/null @@ -1,16 +0,0 @@ -# blank-line activity: -# Merge adjacent blank lines. Loop til no change. -:blin -/^$/,/^ *[^ ]*.*$/{ -/^$/N -s/^ *\n *$// -} -t blin -# -/^$/,/^ *[^ ]*.*$/{ -/^$/N -# Transpose -/^ *\n\*\/$/c\ -*\/\ - -} diff --git a/bfd/doc/exfilter b/bfd/doc/exfilter deleted file mode 100755 index 7551607763..0000000000 --- a/bfd/doc/exfilter +++ /dev/null @@ -1,14 +0,0 @@ -# SED script for preprocessing embedded doc from source (S. Chamberlain markup) -# Final pass; cleanup work is done here. -# -# Within examples, make '{' and '}' printable: -/^@lisp$/,/^@end lisp$/s/{/@{/ -/^@lisp$/,/^@end lisp$/s/}/@}/ -/^@example$/,/^@end example$/s/{/@{/ -/^@example$/,/^@end example$/s/}/@}/ -# -# Delete empty @findex and @subsubsection entries (resulting from *proto* -# with no further text on same line, in middle pass) -/^@findex $/d -/^@subsubsection @code{}/d -# diff --git a/bfd/doc/exfilter-p b/bfd/doc/exfilter-p deleted file mode 100755 index 27a1d05a72..0000000000 --- a/bfd/doc/exfilter-p +++ /dev/null @@ -1,12 +0,0 @@ -# SED script for preprocessing embedded headers from C source comments -# (S. Chamberlain markup) -# beginning of many passes of cleanup work -# -# Delete empty comment blocks -/^\/\*$/N -/^\/\*\n\*\/ *$/d -# -# Locate and coalesce adjacent comments -/\*\/$/N -s/\*\/\n\/\*/\ -/ diff --git a/bfd/doc/exfiltst b/bfd/doc/exfiltst deleted file mode 100755 index 18bab5acfe..0000000000 --- a/bfd/doc/exfiltst +++ /dev/null @@ -1,8 +0,0 @@ -# Merge adjacent blank lines. Loop til no change. -:blin -/^$/,/^ *[^ ]*.*$/{ -/^$/N -s/^ *\n *$// -} -t blin - diff --git a/bfd/doc/exmerge b/bfd/doc/exmerge deleted file mode 100755 index dafa4244df..0000000000 --- a/bfd/doc/exmerge +++ /dev/null @@ -1,4 +0,0 @@ -# SED script for preprocessing embedded doc from source (S. Chamberlain markup) -# Locate and coalesce adjacent @example blocks -/^@end example/N -/^@end example\n@example$/d diff --git a/bfd/doc/intobfd b/bfd/doc/intobfd deleted file mode 100755 index f72d8e91e5..0000000000 --- a/bfd/doc/intobfd +++ /dev/null @@ -1,13 +0,0 @@ -/\/\*:init.c\*\//r init.p -/\/\*:archive.c\*\//r archive.p -/\/\*:archures.c\*\//r archures.p -/\/\*:bfd.c\*\//r bfd.p -/\/\*:core.c\*\//r core.p -/\/\*:format.c\*\//r format.p -/\/\*:libbfd.c\*\//r libbfd.p -/\/\*:opncls.c\*\//r opncls.p -/\/\*:reloc.c\*\//r reloc.p -/\/\*:section.c\*\//r section.p -/\/\*:syms.c\*\//r syms.p -/\/\*:targets.c\*\//r targets.p - diff --git a/bfd/doc/mergecom-p b/bfd/doc/mergecom-p deleted file mode 100755 index 456478b7c4..0000000000 --- a/bfd/doc/mergecom-p +++ /dev/null @@ -1,5 +0,0 @@ -# SED script for preprocessing embedded headers from C source comments -# Locate and coalesce adjacent comments -/\*\/$/N -s/\*\/\n\/\*/\ -/ diff --git a/bfd/doc/movecom-p b/bfd/doc/movecom-p deleted file mode 100755 index 7ed04c7b11..0000000000 --- a/bfd/doc/movecom-p +++ /dev/null @@ -1,8 +0,0 @@ -# sed script for BFD header files: -# Transpose -/^$/,/^ *[^ ]*.*$/{ -/^$/N -/^ *\n\*\/$/c\ -*\/\ - -} diff --git a/bfd/doc/scanit b/bfd/doc/scanit deleted file mode 100755 index a989c786dc..0000000000 --- a/bfd/doc/scanit +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# Script to coordinate parsing of S. Chamberlain source-embedded -# documentation markup language. - -# Four passes: -# 1) awk discards lines not intended for docn, and marks blocks of -# text with comments identifying source file; -# 2) first sed pass interprets Chamberlain markup; -# 3) second sed pass does cleanup that involves merging lines -# 4) third sed pass does remaining cleans up---making {} -# printable within examples, and eliminating empty index entries and -# headings. -#Third and second sed passes are separate because order of execution is hard -#to control otherwise, making one or another of the things involving @example -#inoperative. - -base=`echo $1 | cut -d '.' -f 1` -out=`echo $2 | cut -d '.' -f 1` - -awk -f $3/awkscan $1 | \ -sed -f $3/sedscript | \ -sed -f $3/unPROTO | \ -sed -f $3/exmerge | \ -sed -f $3/exfilter >$out.texi - diff --git a/bfd/doc/scanph b/bfd/doc/scanph deleted file mode 100755 index 956c2e9b5f..0000000000 --- a/bfd/doc/scanph +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# Script to coordinate parsing of S. Chamberlain source-embedded -# header-file markup language. - -# '-i' option means use *proto-internal* segments, else just *proto* -SFX=p -if [ $1 = "-i" ]; then - SFX=ip - shift -fi - -out=`echo $2 | cut -d '.' -f 1` - -# passes: -# 1) awk discards lines not intended for header, and marks blocks of -# text with comments identifying source file; -# 2) first sed pass interprets Chamberlain markup; -# 3) further sed passes clean up---merging adjacent comments etc. - -awk -f $3/awkscan-$SFX $1 |\ -sed -f $3/sedscript-p |\ -sed -f $3/mergecom-p |\ -sed -f $3/startcom-p |\ -sed -f $3/blins-p |\ -sed -f $3/movecom-p >$out.$SFX diff --git a/bfd/doc/sedscript b/bfd/doc/sedscript deleted file mode 100755 index cc2022ce68..0000000000 --- a/bfd/doc/sedscript +++ /dev/null @@ -1,85 +0,0 @@ -# SED script for preprocessing embedded doc from source (S. Chamberlain markup) -# middle pass; most of the work is done here. -# -# First, get rid of /*doc* markers; they've done their job in the first pass. -/^\/\*doc\*/d -# -# /*proto* markers may be optionally followed by a *i-style subsubsec, findex -# entry. This will generate empty @findex and @subsubsection entries if -# the *proto* is on a line by itself; third pass removes them. -/^\/\*proto\*/s/^\/\*proto\* *\(.*\)$/@findex \1\ -@subsubsection @code{\1}/ -# -# /*proto-internal* is just like /*proto* from doc point of view. -/^\/\*proto-internal\*/s/^\/\*proto-internal\* *\(.*\)$/@findex \1\ -@subsubsection @code{\1}/ -# -# *i at beginning of line: rest of line is both a subsubsection heading -# and an entry in function index. -/^\*i/s/^\*i *\(.*\)$/@findex \1\ -@subsubsection @code{\1}/ -# -# Two alternative docn block ends, '*/' and '*-*/' on lines by themselves; -# replace by blank lines (for texinfo source readability). -/^\*\/$/c\ - -/^\*-\*\/$/c\ - -# {* and *} are standins for comment markers (originally embedded in .c -# comments)---turn into real comment markers: -s/{\*/\/\*/ -s/\*}/\*\// -# -# '*+++' and '*---' span a block of text that includes both example lines -# (marked by leading '$') and explanatory text (to be italicized). -# Italicize lines lacking '$': -/\*\+\+\+/,/\*---/s/^\([^$].*\)$/@i{\1}/ -# -# We don't need *+++ and *--- markers any more; kill them (trailing marker -# becomes blank line for readability) -/\*\+\+\+/d -/\*---/c\ - -# Any line beginning with '$' is made an example line; third pass later -# coalesces adjacent example blocks. *DO NOT* introduce extra space after -# @end example, so we can spot adjacent ones in third pass. -/^\$/i\ -@example -/^\$/a\ -@end example -# -# In any example line, turn '{' and '}' into '@{' and '@}' -###/^\$/s/{/@{/g -###/^\$/s/}/@}/g -# -# Now delete the '$' markers themselves: -/^\$/s/\$// -# -# *+ and *- delimit large examples to be enclosed in cartouches. -/^\*\+$/c\ -@lisp\ -@c @cartouche -/^\*-$/c\ -@c @end cartouche\ -@end lisp\ - -# '*;' introduces an example which may have a single line or multiple lines; -# it extends until the next semicolon (which is also printed). -# One-line case: (do this first; else second line address for multi-line case -# will include random text til we happen to end a line in a doc comment with -# a semicolon) -/^\*;.*;$/{ -s/^\*;/@example\ -/ -s/;$/;\ -@end example\ -/ -} -# Multi-line case: -/^\*;/,/.*;$/{ -s/^\*;/@example\ -/ -s/;$/;\ -@end example\ -/ -} diff --git a/bfd/doc/sedscript-p b/bfd/doc/sedscript-p deleted file mode 100755 index 1f24900b4c..0000000000 --- a/bfd/doc/sedscript-p +++ /dev/null @@ -1,63 +0,0 @@ -# SED script for preprocessing embedded headers from source -# (S. Chamberlain markup) -# middle pass; most of the work is done here. -# -# First, get rid of /*proto* markers; they've done their job in the first pass. -# (They remain comment-introducers) -/^\/\*proto\*/s/^\/\*proto\*/\/*/ -/^\/\*proto-internal\*/s/^\/\*proto-internal\*/\/*/ -# -# *-*/ is an alternative (older) comment-block end. Remap for uniformity: -s/^\*-\*\//\*\// -# -# {* and *} are standins for comment markers (originally embedded in .c -# comments)---turn into real comment markers: -s/{\*/\/\*/ -s/\*}/\*\// -# -# '*+++' and '*---' span a block of text that includes both header lines -# (marked by leading '$') and explanatory text (to be comments). -# No need to start comment at "*+++", or end it at "*---", since we're -# already in a *proto* comment block. Just delete. -/\*\+\+\+/d -/\*---/d -# -# Any line beginning with '$' is made a line of code in the header; -# stuff in between is comments, so *precede* each '$' line with -# END-comment, *follow* each '$' line with START-comment; third pass later -# eliminates empty comment blocks. -/^\$/i\ -*/ -/^\$/a\ -/* -# -# Now delete the '$' markers themselves: -/^\$/s/\$// -# -# *+ and *- delimit larger blocks of code, treated the same as '$' lines -/^\*\+$/c\ -*/ -/^\*-$/c\ -/* -# -# '*;' introduces code which may have a single line or multiple lines; -# it extends until the next semicolon (which is also printed). -# -# One-line case: (do this first; else second line address for multi-line case -# will include random text til we happen to end a line in a proto comment with -# a semicolon) -/^\*;.*;$/{ -s/^\*;/*\/\ -/ -s/;$/;\ -\/*\ -/ -} -# Multi-line case: -/^\*;/,/.*;$/{ -s/^\*;/*\/\ -/ -s/;$/;\ -\/*\ -/ -} diff --git a/bfd/doc/startcom-p b/bfd/doc/startcom-p deleted file mode 100755 index 0748faddbf..0000000000 --- a/bfd/doc/startcom-p +++ /dev/null @@ -1,12 +0,0 @@ -# sed script for preprocessing BFD header files -# activity: -/^\/\*$/{ -N -# Delete empty comment blocks -/^\/\*\n\*\/ *$/d -# Transpose -s/^\/\*\n *$/\ -\/*/ -# merge on line by itself with following line -s/^\/\*\n\(.*\)/\/* \1/ -} diff --git a/bfd/doc/tolibbfd b/bfd/doc/tolibbfd deleted file mode 100755 index 3caa5eb219..0000000000 --- a/bfd/doc/tolibbfd +++ /dev/null @@ -1,10 +0,0 @@ -/---------------START FROM/,/---------------END FROM/d -/\/\*:init.c\*\//r init.ip -/\/\*:libbfd.c\*\//r libbfd.ip -/\/\*:cache.c\*\//r cache.ip -/\/\*:cpu-h8300.c\*\//r cpu-h8300.ip -/\/\*:cpu-i960.c\*\//r cpu-i960.ip -/\/\*:cpu-empty.c\*\//r cpu-empty.ip -/\/\*:archures.c\*\//r archures.ip -/\/\*:reloc.c\*\//r reloc.ip -/\/\*:ctor.c\*\//r ctor.ip diff --git a/bfd/doc/tolibcoff b/bfd/doc/tolibcoff deleted file mode 100755 index 548c8baa59..0000000000 --- a/bfd/doc/tolibcoff +++ /dev/null @@ -1 +0,0 @@ -/\/\*:coffcode.h\*\//r coffcode.p diff --git a/bfd/doc/unPROTO b/bfd/doc/unPROTO deleted file mode 100755 index a6f95207db..0000000000 --- a/bfd/doc/unPROTO +++ /dev/null @@ -1,18 +0,0 @@ -# -# The PROTO macro is a subterfuge to be compatible with both ANSI and K&R -# declaration syntax. It's not widely known, so for the docn just map the -# thing to ANSI declaration syntax. -# -# First, join up defns broken across multiple lines in source---but leave -# any linebreaks, to prettify our examples -:pbegn -/PROTO(.*, *$/N -s/\n/?/ -t pbegn -s/?/\ -/g -# Now actually do the PROTO interpretation. -# A PROTO invocation looks like -# PROTO( resulttype, function, (arglist)); -s/[ ]*PROTO(\(.*\),[\n ]*\(.*\),[\n ]*\((.*)\));/\1 \2\3;/ - diff --git a/bfd/exfilter b/bfd/exfilter deleted file mode 100755 index 7551607763..0000000000 --- a/bfd/exfilter +++ /dev/null @@ -1,14 +0,0 @@ -# SED script for preprocessing embedded doc from source (S. Chamberlain markup) -# Final pass; cleanup work is done here. -# -# Within examples, make '{' and '}' printable: -/^@lisp$/,/^@end lisp$/s/{/@{/ -/^@lisp$/,/^@end lisp$/s/}/@}/ -/^@example$/,/^@end example$/s/{/@{/ -/^@example$/,/^@end example$/s/}/@}/ -# -# Delete empty @findex and @subsubsection entries (resulting from *proto* -# with no further text on same line, in middle pass) -/^@findex $/d -/^@subsubsection @code{}/d -# diff --git a/bfd/exmerge b/bfd/exmerge deleted file mode 100755 index dafa4244df..0000000000 --- a/bfd/exmerge +++ /dev/null @@ -1,4 +0,0 @@ -# SED script for preprocessing embedded doc from source (S. Chamberlain markup) -# Locate and coalesce adjacent @example blocks -/^@end example/N -/^@end example\n@example$/d diff --git a/bfd/hosts/h-m68kv.h b/bfd/hosts/h-m68kv.h deleted file mode 100644 index e667283f16..0000000000 --- a/bfd/hosts/h-m68kv.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define USG - -#ifdef __GNUC__ -#define alloca __builtin_alloca -#endif - - -#ifndef O_ACCMODE -#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) -#endif -#define SEEK_SET 0 -#define SEEK_CUR 1 - -#include -#define bcmp(b1,b2,len) memcmp(b1,b2,len) -#define bcopy(src,dst,len) memcpy(dst,src,len) -#define bzero(s,n) memset(s,0,n) - -#include -#define index(s,c) strchr(s,c) -#define rindex(s,c) strrchr(s,c) - - -/* EXACT TYPES */ -typedef char int8e_type; -typedef unsigned char uint8e_type; -typedef short int16e_type; -typedef unsigned short uint16e_type; -typedef int int32e_type; -typedef unsigned int uint32e_type; - -/* CORRECT SIZE OR GREATER */ -typedef char int8_type; -typedef unsigned char uint8_type; -typedef short int16_type; -typedef unsigned short uint16_type; -typedef int int32_type; -typedef unsigned int uint32_type; - diff --git a/bfd/hosts/hp9000.h b/bfd/hosts/hp9000.h deleted file mode 100644 index 9e5c4a3308..0000000000 --- a/bfd/hosts/hp9000.h +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef O_ACCMODE -#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) -#endif -#define SEEK_SET 0 -#define SEEK_CUR 1 - -void free(); - -/* Some things that need to be defined in order to make code written for - BSD Unix compile under System V Unix. */ - -#include -#define bcmp(b1,b2,len) memcmp(b1,b2,len) -#define bcopy(src,dst,len) memcpy(dst,src,len) -#define bzero(s,n) memset(s,0,n) - -#if 0 -static int -rename(from, to) -{ - unlink(to); - return(link(from, to)); -} -#endif - -/* - * Might not need these. Leave them out for now. - * -#include -#define index(s,c) strchr(s,c) -#define rindex(s,c) strrchr(s,c) - -#ifdef SEEK_SET -# ifndef L_SET -# define L_SET SEEK_SET -# endif -# endif - -#ifdef SEEK_CUR -# ifndef L_INCR -# define L_INCR SEEK_CUR -# endif -# endif - */ - -/* EXACT TYPES */ -typedef char int8e_type; -typedef unsigned char uint8e_type; -typedef short int16e_type; -typedef unsigned short uint16e_type; -typedef int int32e_type; -typedef unsigned int uint32e_type; - -/* CORRECT SIZE OR GREATER */ -typedef char int8_type; -typedef unsigned char uint8_type; -typedef short int16_type; -typedef unsigned short uint16_type; -typedef int int32_type; -typedef unsigned int uint32_type; - -#include "fopen-same.h" diff --git a/bfd/howto.c b/bfd/howto.c deleted file mode 100755 index 0be2261f09..0000000000 --- a/bfd/howto.c +++ /dev/null @@ -1,85 +0,0 @@ -/* bfd howto manager. - Copyright (C) 1990-1991 Free Software Foundation, Inc. - Written by Steve Chamberlain of Cygnus Support. - -This file is part of BFD, the Binary File Descriptor 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. */ - -/* The howto manager - - -When an application wants to create a relocation, but doesn't know -what the target machine might call it, it can find out by using this -bit of code. - -*/ - -#include -#include -#include "libbfd.h" -/*proto* bfd_reloc_code_enum_type - -*+++ - -$typedef enum -${ - -16 bits wide, simple reloc - -$ BFD_RELOC_16, - -8 bits wide, but used to form an address like 0xffnn - -$ BFD_RELOC_8_FFnn, - -8 bits wide, simple - -$ BFD_RELOC_8, - -8 bits wide, pc relative - -$ BFD_RELOC_8_PCREL -$ } bfd_reloc_code_enum_real_type; - -*--- - -*/ - - - -/*proto* bfd_reloc_type_lookup -This routine returns a pointer to a howto struct which when invoked, -will perform the supplied relocation on data from the architecture -noted. - -[Note] This function will go away. - -*; PROTO(struct reloc_howto_struct *, - bfd_reloc_type_lookup, - (enum bfd_architecture arch, bfd_reloc_code_enum_type code)); -*/ - - -struct reloc_howto_struct * -DEFUN(bfd_reloc_type_lookup,(arch, code), - enum bfd_architecture arch AND - bfd_reloc_code_enum_type code) -{ - return arch_functions(arch,0)->reloc_type_lookup(code); -} - - - diff --git a/bfd/intobfd b/bfd/intobfd deleted file mode 100755 index b256f4bcca..0000000000 --- a/bfd/intobfd +++ /dev/null @@ -1,11 +0,0 @@ -/\/\*:archive.c\*\//r archive.p -/\/\*:archures.c\*\//r archures.p -/\/\*:bfd.c\*\//r bfd.p -/\/\*:core.c\*\//r core.p -/\/\*:format.c\*\//r format.p -/\/\*:libbfd.c\*\//r libbfd.p -/\/\*:opncls.c\*\//r opncls.p -/\/\*:reloc.c\*\//r reloc.p -/\/\*:section.c\*\//r section.p -/\/\*:syms.c\*\//r syms.p -/\/\*:targets.c\*\//r targets.p diff --git a/bfd/makefile.dos b/bfd/makefile.dos deleted file mode 100644 index 60b213b71c..0000000000 --- a/bfd/makefile.dos +++ /dev/null @@ -1,334 +0,0 @@ -# Makefile template for Configure for the BFD library. -# Copyright (C) 1990, 1991 Free Software Foundation, Inc. -# Written by Cygnus Support. -# -# This file is part of BFD, the Binary File Descriptor 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. - -# $Id$ - -HDEPFILES= -TDEPFILES= -HDEFINES=-D__MSDOS__ -TDEFINES= -CSWITCHES= - -srcdir = . -ddestdir = /usr/local -libdir = $(ddestdir)/lib -docdir = $(srcdir)$(subdir)/doc -includedir= $(ddestdir)/include -RANLIB = ar rvs -AR = ar -AR_FLAGS = clq -INCDIR = $(srcdir)/../include -CSEARCH = -I. -I$(srcdir) -I$(INCDIR) -DEP = mkdep -MINUS_G=-O - -SUBDIRS = doc - -#### host and target dependent Makefile fragments come in here. -# Target: Hitachi H8/300 using IEEE-695 object file format -# Avoid dragging in a lot of other architectures and formats. -TDEFAULTS=-DSELECT_ARCHITECTURES=bfd_h8300_arch -DSELECT_VECS=&ieee_vec\,&srec_vec\,&h8300coff_vec - - -# Change this (to MINIMIZE=1) to save space in executables. -# Currently, all this does is control the target_vector in targets.c. -MINIMIZE=0 - -TARGETLIB = libbfd.a -CFLAGS = $(MINUS_G) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # -DINTEL960VERSION - - -BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o \ - archures.o core.o section.o format.o syms.o reloc.o init.o ctor.o - -BFD_MACHINES = cpu-h8300.o cpu-i960.o cpu-sparc.o cpu-m68k.o cpu-m88k.o \ - cpu-vax.o cpu-mips.o cpu-a29k.o cpu-i386.o cpu-rs6000.o - -BFD_BACKENDS = oasys.o ieee.o srec.o elf.o stab-syms.o\ - aout64.o aout32.o demo64.o sunos.o newsos3.o i386aout.o bout.o \ - coff-i960.o coff-a29k.o coff-m68k.o coff-i386.o coff-m88k.o \ - coff-mips.o coff-rs6000.o coff-h8300.o - -OPTIONAL_BACKENDS = trad-core.o - -BFD_H=$(INCDIR)/bfd.h - -# C source files that correspond to .o's. -CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c archures.c \ - coff-i386.c aout64.c aout32.c sunos.c demo64.c coff-i960.c srec.c \ - oasys.c ieee.c coff-m68k.c coff-a29k.c coff-rs6000.c \ - format.c section.c core.c syms.c stabs-syms.c reloc.c init.c ctor.c \ - coff-m88k.c coff-mips.c trad-core.c newsos3.c i386aout.c bout.c elf.c \ - cpu-h8300.c cpu-i960.c cpu-sparc.c cpu-m68k.c cpu-m88k.c \ - cpu-vax.c cpu-mips.c cpu-a29k.c cpu-i386.c cpu-rs6000.c coff-h8300.c - -STAGESTUFF = $(TARGETLIB) $(OFILES) - -all: $(TARGETLIB) -# $(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-info "DODIRS=$(SUBDIRS)" - -# HDEPFILES comes from the host config; TDEPFILES from the target config. -OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES) - -$(TARGETLIB): $(OFILES) - -rm -f $(TARGETLIB) - >target.rf $(AR_FLAGS) $(TARGETLIB) $(OFILES) - $(AR) @target.rf - $(RANLIB) $(TARGETLIB) - -# When compiling targets.c, supply the default target info from configure. -targets.o: targets.c - >targets.rf $(CFLAGS) -c -DMINIMIZE=$(MINIMIZE) $(TDEFAULTS) targets.c - $(CC) @targets.rf - -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 - -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 *.o ; do cmp $$i $(against)/$$i || exit 1 ; done - $(MAKE) subdir_do DO=comparison "DODIRS=$(SUBDIRS)" - -de-stage1: force - - (cd stage1 ; mv -f $(STAGESTUFF) ..) - - rmdir stage1 - $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)" - -de-stage2: force - - (cd stage2 ; mv -f $(STAGESTUFF) ..) - - rmdir stage2 - $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)" - -de-stage3: force - - (cd stage3 ; mv -f $(STAGESTUFF) ..) - - rmdir stage3 - $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)" - -tags etags: TAGS - -TAGS: force - etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c - -clean: - rm -f *.[oa] *~ core *.E *.p *.ip - $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)" - -clobber realclean: clean - rm -f libbfd.a TAGS - $(MAKE) subdir_do DO=clobber "DODIRS=$(SUBDIRS)" - -# Mark everything as depending on config.status, since the timestamp on -# sysdep.h might actually move backwards if we reconfig and relink it -# to a different hosts/h-xxx.h file. This will force a recompile anyway. -RECONFIG = # config.status -$(BFD_LIBS): libbfd.h $(BFD_H) $(RECONFIG) -$(BFD_MACHINES): libbfd.h $(BFD_H) $(RECONFIG) -$(BFD_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG) -$(OPTIONAL_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG) - -# Get around a Sun Make bug in SunOS 4.1.1 with VPATH -cpu-i386.o: cpu-i386.c - -saber: - #suppress 65 on bfd_map_over_sections - #suppress 66 on bfd_map_over_sections - #suppress 67 on bfd_map_over_sections - #suppress 68 on bfd_map_over_sections - #suppress 69 on bfd_map_over_sections - #suppress 70 on bfd_map_over_sections - #suppress 110 in bfd_map_over_sections - #suppress 112 in bfd_map_over_sections - #suppress 530 - #suppress 590 in swap_exec_header - #suppress 590 in _bfd_dummy_core_file_matches_executable_p - #suppress 590 in bfd_dont_truncate_arname - #suppress 590 on ignore - #suppress 590 on abfd - #setopt load_flags $(CFLAGS) - #load $(CFILES) - - -#----------------------------------------------------------------------------- -# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT -# -# 'VERSION' file must be present and contain a string of the form "x.y" -#----------------------------------------------------------------------------- - -ver960.c: FORCE - rm -f ver960.c - echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c - - -# This target should be invoked before building a new release. -# 'VERSION' file must be present and contain a string of the form "x.y" -# -roll: - @V=`cat VERSION` ; \ - MAJ=`sed 's/\..*//' VERSION` ; \ - MIN=`sed 's/.*\.//' VERSION` ; \ - V=$$MAJ.`expr $$MIN 1` ; \ - rm -f VERSION ; \ - echo $$V >VERSION ; \ - echo Version $$V - -# Dummy target to force execution of dependent targets. -# -force: - -install: - cp libbfd.a $(libdir)/libbfd.a.new - $(RANLIB) $(libdir)/libbfd.a.new - mv -f $(libdir)/libbfd.a.new $(libdir)/libbfd.a - cp $(INCDIR)/bfd.h $(includedir)/bfd.h - $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)" - -# Target to uncomment host-specific lines in this makefile. Such lines must -# have the following string beginning in column 1: #____# -# Original Makefile is backed up as 'Makefile.old'. -# -# Invoke with: make make HOST=xxx -# -make: - -@if test $(HOST)x = x ; then \ - echo 'Specify "make make HOST=???"'; \ - exit 1; \ - fi ; \ - grep -s "^#The next line was generated by 'make make'" Makefile; \ - if test $$? = 0 ; then \ - echo "Makefile has already been processed with 'make make'";\ - exit 1; \ - fi ; \ - mv -f Makefile Makefile.old; \ - echo "#The next line was generated by 'make make'" >Makefile ; \ - echo "HOST=$(HOST)" >>Makefile ; \ - echo >>Makefile ; \ - sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile - -Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) - $(SHELL) ./config.status - -dep: $(CFILES) - mkdep $(CFLAGS) $? - - - -headers: - (cd $(docdir); $(MAKE) protos) - # Rebuild prototypes in bfd.h - cp $(docdir)/bfd.h $(BFD_H) - cp $(docdir)/libbfd.h $(srcdir)/libbfd.h - cp $(docdir)/libcoff.h $(srcdir)/libcoff.h - -bfd.info: - ( cd $(docdir); $(MAKE) bfd.info) - -bfd.dvi: - (cd $(docdir); $(MAKE) bfd.dvi) - -bfd.ps: - (cd $(docdir); $(MAKE) bfd.ps) - -# What appears below is generated by a hacked mkdep using gcc -MM. - -# DO NOT DELETE THIS LINE -- mkdep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -libbfd.o : libbfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h -opncls.o : opncls.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h -bfd.o : bfd.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h -archive.o : archive.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ - $(INCDIR)/ar.h $(INCDIR)/ranlib.h -targets.o : targets.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h -cache.o : cache.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h -archures.o : archures.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h -aout64.o : aout64.c -aout32.o : aout32.c aoutx.h $(INCDIR)/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/obstack.h libaout.h libbfd.h $(INCDIR)/aout64.h \ - $(INCDIR)/stabgnu.h $(INCDIR)/stab.def $(INCDIR)/ar.h -sunos.o : sunos.c aoutf1.h $(INCDIR)/bfd.h $(INCDIR)/obstack.h \ - libaout.h libbfd.h $(INCDIR)/aout64.h $(INCDIR)/stabgnu.h \ - $(INCDIR)/stab.def $(INCDIR)/ar.h -demo64.o : demo64.c - -srec.o : srec.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h -oasys.o : oasys.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ - $(INCDIR)/oasys.h liboasys.h -ieee.o : ieee.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ - $(INCDIR)/ieee.h libieee.h -coff-h8300.o: coff-h8300.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ - $(INCDIR)/coff-h8300.h $(INCDIR)/internalcoff.h libcoff.h coffcode.h -format.o : format.c $(INCDIR)/bfd.h \ - $(INCDIR)/obstack.h libbfd.h -section.o : section.c $(INCDIR)/bfd.h \ - $(INCDIR)/obstack.h libbfd.h -core.o : core.c $(INCDIR)/bfd.h \ - $(INCDIR)/obstack.h libbfd.h -syms.o : syms.c $(INCDIR)/bfd.h \ - $(INCDIR)/obstack.h libbfd.h -syms.o : stab-syms.c -reloc.o : reloc.c $(INCDIR)/bfd.h \ - $(INCDIR)/obstack.h libbfd.h - -trad-core.o : trad-core.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h \ - libbfd.h libaout.h -newsos3.o : newsos3.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ - $(INCDIR)/aout64.h $(INCDIR)/stabgnu.h $(INCDIR)/stab.def \ - $(INCDIR)/ar.h libaout.h -i386aout.o : i386aout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ - $(INCDIR)/aout64.h $(INCDIR)/stabgnu.h $(INCDIR)/stab.def \ - $(INCDIR)/ar.h libaout.h -bout.o : bout.c $(INCDIR)/bfd.h $(INCDIR)/obstack.h libbfd.h \ - $(INCDIR)/bout.h $(INCDIR)/stabgnu.h $(INCDIR)/stab.def libaout.h - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/bfd/mergecom-p b/bfd/mergecom-p deleted file mode 100755 index 456478b7c4..0000000000 --- a/bfd/mergecom-p +++ /dev/null @@ -1,5 +0,0 @@ -# SED script for preprocessing embedded headers from C source comments -# Locate and coalesce adjacent comments -/\*\/$/N -s/\*\/\n\/\*/\ -/ diff --git a/bfd/misc.c b/bfd/misc.c deleted file mode 100755 index 041fcde862..0000000000 --- a/bfd/misc.c +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (C) 1990, 1991 Free Software Foundation, Inc. - -This file is part of BFD, the Binary File Diddler. - -BFD is free software; you can 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. - -BFD is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with BFD; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* $Id$ */ - -#if 0 - /* xoxorich. coelesced from other binutils. */ -/* This crap should all be bundled with the binutils, or else be in its - own library, but for expediency we are doing it this way right now. */ - -/* - * Last Mod Mon Feb 18 14:49:39 PST 1991, by rich@cygint.cygnus.com - */ - -#include -#include "misc.h" -#if __STDC__ -extern char *realloc (char * ptr, int size); -extern char *malloc (int size); -#else -extern char *realloc (); -extern char *malloc (); -#endif - -/* Print the filename of the current file on 'outfile' (a stdio stream). */ - -/* Current file's name */ - -char *input_name; - -/* Current member's name, or 0 if processing a non-library file. */ - -char *input_member; - -void print_file_name (outfile) - FILE *outfile; -{ - fprintf (outfile, "%s", input_name); - if (input_member) - fprintf (outfile, "(%s)", input_member); -} - -/* process one input file */ -void scan_library (); - -char *program_name; - -/* Report a nonfatal error. - STRING is a format for printf, and ARG1 ... ARG3 are args for it. */ -/*VARARGS*/ -void -error (string, arg1, arg2, arg3) - char *string, *arg1, *arg2, *arg3; -{ - fprintf (stderr, "%s: ", program_name); - fprintf (stderr, string, arg1, arg2, arg3); - fprintf (stderr, "\n"); -} - - - -/* Report a nonfatal error. - STRING is printed, followed by the current file name. */ - -void -error_with_file (string) - char *string; -{ - fprintf (stderr, "%s: ", program_name); - print_file_name (stderr); - fprintf (stderr, ": "); - fprintf (stderr, string); - fprintf (stderr, "\n"); -} - -/* Like malloc but get fatal error if memory is exhausted. */ - - -/* Like realloc but get fatal error if memory is exhausted. */ - - -/* end of misc.c */ -#endif diff --git a/bfd/misc.h b/bfd/misc.h deleted file mode 100755 index 05935c28f6..0000000000 --- a/bfd/misc.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright (C) 1990, 1991 Free Software Foundation, Inc. - -This file is part of BFD, the Binary File Diddler. - -BFD is free software; you can 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. - -BFD is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with BFD; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* $Id$ */ - -/* xoxorich. coelesced from binutils. - * - * Last Mod Mon Feb 18 14:49:51 PST 1991, by rich@cygint.cygnus.com - */ - -#ifndef MISC_H -#define MISC_H 1 - -#include "ranlib.h" - -#ifdef USG -#include -#else -#include -#endif /* USG */ - -#ifdef never -#ifdef LOCKS -#undef LOCKS -#endif /* LOCKS */ -#endif /* never */ - - /* used for masking system io calls into stdio. */ - -/* the name, ie, argv[0], of this program. */ - -extern char *program_name; - -/* Current file's name */ - -extern char *input_name; - -/* Current member's name, or 0 if processing a non-library file. */ - -extern char *input_member; - -/* Report an error using the message for the last failed system call, - followed by the string NAME. */ - -#define perror_name(name) perror(concat(program_name, ": error on ", name)) -#define pfatal_with_name(name) {perror_name(name);exit(-1);} - -#ifdef __STDC__ - -extern char *concat(char *a, char *b, char *c); -extern void *xmalloc(unsigned int size); -extern void * xrealloc(char *ptr, int size); -extern void error(char *string, char *arg1, char *arg2, char *arg3); -extern void error_with_file(char *string); -extern void fatal(char *string, char*a1, char*a2, char*a3); -extern void print_file_name(FILE *outfile); -extern void swap_symdef_table(struct symdef *sym, int count); -#else -extern char *alloca(); -extern char *concat(); -extern void * xmalloc(); -extern void *xrealloc(); -extern void error(); -extern void error_with_file(); -extern void fatal(); -extern void print_file_name(); -extern void swap_symdef_table(); -#endif /* __STDC__ */ - -#endif /* MISC_H */ - -/* - * Local Variables: - * comment-column: 0 - * End: - */ - -/* end of misc.h */ diff --git a/bfd/movecom-p b/bfd/movecom-p deleted file mode 100755 index 7ed04c7b11..0000000000 --- a/bfd/movecom-p +++ /dev/null @@ -1,8 +0,0 @@ -# sed script for BFD header files: -# Transpose -/^$/,/^ *[^ ]*.*$/{ -/^$/N -/^ *\n\*\/$/c\ -*\/\ - -} diff --git a/bfd/obstack.c b/bfd/obstack.c deleted file mode 100755 index bbed70b66f..0000000000 --- a/bfd/obstack.c +++ /dev/null @@ -1,330 +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 -#include -#include "obstack.h" - - -/* 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 DEFUN(_obstack_begin,(h, size, alignment, chunkfun, freefun), - struct obstack *h AND - int size AND - int alignment AND - PTR (*chunkfun) () AND - 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 -DEFUN(_obstack_newchunk,(h, length), - struct obstack *h AND - 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 0; -} - -/* 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 -DEFUN(_obstack_allocated_p, (h, obj), - struct obstack *h AND - PTR 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 && ((PTR)lp > obj || (PTR)(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, PTR obj) -#else -int -_obstack_free (h, obj) - struct obstack *h; - PTR 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 && ((PTR)lp >= obj || (PTR)(lp)->limit < obj)) - { - plp = lp -> prev; - (*h->freefun) ((PTR) 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; - PTR obj; -{ - obstack_free (h, obj); - return 0; -} -#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. */ - -PTR (obstack_base) (obstack) - struct obstack *obstack; -{ - return obstack_base (obstack); -} - -PTR (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, ptr, length) - struct obstack *obstack; - PTR ptr; - int length; -{ -(void) obstack_grow (obstack, ptr, length); -} - -void (obstack_grow0) (obstack, ptr, length) - struct obstack *obstack; - PTR ptr; - int length; -{ -(void) obstack_grow0 (obstack, ptr, length); -} - -void (obstack_1grow) (obstack, character) - struct obstack *obstack; - int character; -{ -(void) obstack_1grow (obstack, character); -} - -void (obstack_blank) (obstack, length) - struct obstack *obstack; - int length; -{ -(void) 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); -} - -PTR (obstack_finish) (obstack) - struct obstack *obstack; -{ - return obstack_finish (obstack); -} - -PTR (obstack_alloc) (obstack, length) - struct obstack *obstack; - int length; -{ - return obstack_alloc (obstack, length); -} - -PTR (obstack_copy) (obstack, ptr, length) - struct obstack *obstack; - PTR ptr; - int length; -{ - return obstack_copy (obstack, ptr, length); -} - -PTR (obstack_copy0) (obstack, ptr, length) - struct obstack *obstack; - PTR ptr; - int length; -{ - return obstack_copy0 (obstack, ptr, length); -} - -#endif /* __STDC__ */ - - diff --git a/bfd/obstack.h b/bfd/obstack.h deleted file mode 100755 index a4898ec1a0..0000000000 --- a/bfd/obstack.h +++ /dev/null @@ -1,413 +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. */ - - PTR(*chunkfun) (); /* User's fcn to allocate a chunk. */ - 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/bfd/opc-sparc.c b/bfd/opc-sparc.c deleted file mode 100644 index a0c54ab3c6..0000000000 --- a/bfd/opc-sparc.c +++ /dev/null @@ -1,1811 +0,0 @@ -/* to sanitize this file, grep -v v9 < sparc.h > clean-sparc.h */ - -/* Table of opcodes for the sparc. - Copyright 1989, 1991, 1992 Free Software Foundation, Inc. - -This file is part of the BFD library. - -BFD is free software; you can 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. - -BFD is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR 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 software; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* FIXME-someday: perhaps the ,a's and such should be embedded in the - instruction's name rather than the args. This would make gas faster, pinsn - slower, but would mess up some macros a bit. xoxorich. */ - -#include -#include "ansidecl.h" -#define BFD_EMIT_TABLE -#include "opcode/sparc.h" - -const char *architecture_pname[] = { - "v6", - "v7", - "v8", - "sparclite", - "v9", - NULL, -}; - - -#define COND(x) (((x)&0xf)<<25) -#define MCOND(x,i_or_f) ((((i_or_f)&1)<<18)|(((x)>>11)&(0xf<<14))) /* v9 */ - -#define CONDA (COND(0x8)) -#define CONDCC (COND(0xd)) -#define CONDCS (COND(0x5)) -#define CONDE (COND(0x1)) -#define CONDG (COND(0xa)) -#define CONDGE (COND(0xb)) -#define CONDGU (COND(0xc)) -#define CONDL (COND(0x3)) -#define CONDLE (COND(0x2)) -#define CONDLEU (COND(0x4)) -#define CONDN (COND(0x0)) -#define CONDNE (COND(0x9)) -#define CONDNEG (COND(0x6)) -#define CONDPOS (COND(0xe)) -#define CONDVC (COND(0xf)) -#define CONDVS (COND(0x7)) - -#define CONDNZ CONDNE -#define CONDZ CONDE -#define CONDGEU CONDCC -#define CONDLU CONDCS - -#define FCONDA (COND(0x8)) -#define FCONDE (COND(0x9)) -#define FCONDG (COND(0x6)) -#define FCONDGE (COND(0xb)) -#define FCONDL (COND(0x4)) -#define FCONDLE (COND(0xd)) -#define FCONDLG (COND(0x2)) -#define FCONDN (COND(0x0)) -#define FCONDNE (COND(0x1)) -#define FCONDO (COND(0xf)) -#define FCONDU (COND(0x7)) -#define FCONDUE (COND(0xa)) -#define FCONDUG (COND(0x5)) -#define FCONDUGE (COND(0xc)) -#define FCONDUL (COND(0x3)) -#define FCONDULE (COND(0xe)) - -#define FCONDNZ FCONDNE -#define FCONDZ FCONDE - -#define ICC (0) /* v9 */ -#define XCC (1<<11) /* v9 */ -#define FCC(x) (((x)&0x3)<<11) /* v9 */ -#define FBFCC(x) (((x)&0x3)<<20) /* v9 */ - -/* The order of the opcodes in the 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. - -*/ - -struct sparc_opcode sparc_opcodes[] = { - -{ "ld", F3(3, 0x00, 0), F3(~3, ~0x00, ~0), "[1+2],d", 0, v6 }, -{ "ld", F3(3, 0x00, 0), F3(~3, ~0x00, ~0)|RS2_G0, "[1],d", 0, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[1+i],d", 0, v6 }, -{ "ld", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[i+1],d", 0, v6 }, -{ "ld", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ld", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ld [rs1+0],d */ -{ "ld", F3(3, 0x20, 0), F3(~3, ~0x20, ~0), "[1+2],g", 0, v6 }, -{ "ld", F3(3, 0x20, 0), F3(~3, ~0x20, ~0)|RS2_G0, "[1],g", 0, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x20, 1), F3(~3, ~0x20, ~1), "[1+i],g", 0, v6 }, -{ "ld", F3(3, 0x20, 1), F3(~3, ~0x20, ~1), "[i+1],g", 0, v6 }, -{ "ld", F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|RS1_G0, "[i],g", 0, v6 }, -{ "ld", F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|SIMM13(~0), "[1],g", 0, v6 }, /* ld [rs1+0],d */ -{ "ld", F3(3, 0x21, 0), F3(~3, ~0x21, ~0), "[1+2],F", 0, v6 }, -{ "ld", F3(3, 0x21, 0), F3(~3, ~0x21, ~0)|RS2_G0, "[1],F", 0, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x21, 1), F3(~3, ~0x21, ~1), "[1+i],F", 0, v6 }, -{ "ld", F3(3, 0x21, 1), F3(~3, ~0x21, ~1), "[i+1],F", 0, v6 }, -{ "ld", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|RS1_G0, "[i],F", 0, v6 }, -{ "ld", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|SIMM13(~0), "[1],F", 0, v6 }, /* ld [rs1+0],d */ -{ "ld", F3(3, 0x30, 0), F3(~3, ~0x30, ~0), "[1+2],D", 0, v6 }, -{ "ld", F3(3, 0x30, 0), F3(~3, ~0x30, ~0)|RS2_G0, "[1],D", 0, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[1+i],D", 0, v6 }, -{ "ld", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[i+1],D", 0, v6 }, -{ "ld", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|RS1_G0, "[i],D", 0, v6 }, -{ "ld", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|SIMM13(~0), "[1],D", 0, v6 }, /* ld [rs1+0],d */ -{ "ld", F3(3, 0x31, 0), F3(~3, ~0x31, ~0), "[1+2],C", 0, v6 }, -{ "ld", F3(3, 0x31, 0), F3(~3, ~0x31, ~0)|RS2_G0, "[1],C", 0, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x31, 1), F3(~3, ~0x31, ~1), "[1+i],C", 0, v6 }, -{ "ld", F3(3, 0x31, 1), F3(~3, ~0x31, ~1), "[i+1],C", 0, v6 }, -{ "ld", F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|RS1_G0, "[i],C", 0, v6 }, -{ "ld", F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|SIMM13(~0), "[1],C", 0, v6 }, /* ld [rs1+0],d */ - - /* FIXME-v9: combine ld, lduw, & ldw in macros. */ -{ "ldw", F3(3, 0x00, 0), F3(~3, ~0x00, ~0), "[1+2],d", F_ALIAS, v9 }, /* ldw === ld */ -{ "ldw", F3(3, 0x00, 0), F3(~3, ~0x00, ~0)|RS2_G0, "[1],d", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "ldw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[1+i],d", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[i+1],d", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|RS1_G0, "[i],d", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|SIMM13(~0), "[1],d", F_ALIAS, v9 }, /* ld [rs1+0],d */ -{ "ldw", F3(3, 0x20, 0), F3(~3, ~0x20, ~0), "[1+2],g", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x20, 0), F3(~3, ~0x20, ~0)|RS2_G0, "[1],g", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "ldw", F3(3, 0x20, 1), F3(~3, ~0x20, ~1), "[1+i],g", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x20, 1), F3(~3, ~0x20, ~1), "[i+1],g", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|RS1_G0, "[i],g", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|SIMM13(~0), "[1],g", F_ALIAS, v9 }, /* ld [rs1+0],d */ -{ "ldw", F3(3, 0x21, 0), F3(~3, ~0x21, ~0), "[1+2],F", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x21, 0), F3(~3, ~0x21, ~0)|RS2_G0, "[1],F", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "ldw", F3(3, 0x21, 1), F3(~3, ~0x21, ~1), "[1+i],F", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x21, 1), F3(~3, ~0x21, ~1), "[i+1],F", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|RS1_G0, "[i],F", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|SIMM13(~0), "[1],F", F_ALIAS, v9 }, /* ld [rs1+0],d */ -{ "ldw", F3(3, 0x30, 0), F3(~3, ~0x30, ~0), "[1+2],D", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x30, 0), F3(~3, ~0x30, ~0)|RS2_G0, "[1],D", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "ldw", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[1+i],D", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[i+1],D", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|RS1_G0, "[i],D", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|SIMM13(~0), "[1],D", F_ALIAS, v9 }, /* ld [rs1+0],d */ -{ "ldw", F3(3, 0x31, 0), F3(~3, ~0x31, ~0), "[1+2],C", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x31, 0), F3(~3, ~0x31, ~0)|RS2_G0, "[1],C", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "ldw", F3(3, 0x31, 1), F3(~3, ~0x31, ~1), "[1+i],C", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x31, 1), F3(~3, ~0x31, ~1), "[i+1],C", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|RS1_G0, "[i],C", F_ALIAS, v9 }, -{ "ldw", F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|SIMM13(~0), "[1],C", F_ALIAS, v9 }, /* ld [rs1+0],d */ - -{ "lduw", F3(3, 0x00, 0), F3(~3, ~0x00, ~0), "[1+2],d", F_ALIAS, v9 }, /* lduw === ld */ -{ "lduw", F3(3, 0x00, 0), F3(~3, ~0x00, ~0)|RS2_G0, "[1],d", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "lduw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[1+i],d", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[i+1],d", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|RS1_G0, "[i],d", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|SIMM13(~0), "[1],d", F_ALIAS, v9 }, /* ld [rs1+0],d */ -{ "lduw", F3(3, 0x20, 0), F3(~3, ~0x20, ~0), "[1+2],g", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x20, 0), F3(~3, ~0x20, ~0)|RS2_G0, "[1],g", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "lduw", F3(3, 0x20, 1), F3(~3, ~0x20, ~1), "[1+i],g", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x20, 1), F3(~3, ~0x20, ~1), "[i+1],g", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|RS1_G0, "[i],g", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|SIMM13(~0), "[1],g", F_ALIAS, v9 }, /* ld [rs1+0],d */ -{ "lduw", F3(3, 0x21, 0), F3(~3, ~0x21, ~0), "[1+2],F", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x21, 0), F3(~3, ~0x21, ~0)|RS2_G0, "[1],F", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "lduw", F3(3, 0x21, 1), F3(~3, ~0x21, ~1), "[1+i],F", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x21, 1), F3(~3, ~0x21, ~1), "[i+1],F", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|RS1_G0, "[i],F", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|SIMM13(~0), "[1],F", F_ALIAS, v9 }, /* ld [rs1+0],d */ -{ "lduw", F3(3, 0x30, 0), F3(~3, ~0x30, ~0), "[1+2],D", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x30, 0), F3(~3, ~0x30, ~0)|RS2_G0, "[1],D", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "lduw", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[1+i],D", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[i+1],D", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|RS1_G0, "[i],D", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|SIMM13(~0), "[1],D", F_ALIAS, v9 }, /* ld [rs1+0],d */ -{ "lduw", F3(3, 0x31, 0), F3(~3, ~0x31, ~0), "[1+2],C", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x31, 0), F3(~3, ~0x31, ~0)|RS2_G0, "[1],C", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "lduw", F3(3, 0x31, 1), F3(~3, ~0x31, ~1), "[1+i],C", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x31, 1), F3(~3, ~0x31, ~1), "[i+1],C", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|RS1_G0, "[i],C", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|SIMM13(~0), "[1],C", F_ALIAS, v9 }, /* ld [rs1+0],d */ - -{ "lda", F3(3, 0x10, 0), F3(~3, ~0x10, ~0), "[1+2]A,d", 0, v6 }, -{ "lda", F3(3, 0x10, 0), F3(~3, ~0x10, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* lda [rs1+%g0],d */ - -{ "ldd", F3(3, 0x03, 0), F3(~3, ~0x03, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldd", F3(3, 0x03, 0), F3(~3, ~0x03, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldd [rs1+%g0],d */ -{ "ldd", F3(3, 0x03, 1), F3(~3, ~0x03, ~1), "[1+i],d", 0, v6 }, -{ "ldd", F3(3, 0x03, 1), F3(~3, ~0x03, ~1), "[i+1],d", 0, v6 }, -{ "ldd", F3(3, 0x03, 1), F3(~3, ~0x03, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldd", F3(3, 0x03, 1), F3(~3, ~0x03, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ldd [rs1+0],d */ -{ "ldd", F3(3, 0x23, 0), F3(~3, ~0x23, ~0)|ASI(~0), "[1+2],g", 0, v6 }, -{ "ldd", F3(3, 0x23, 0), F3(~3, ~0x23, ~0)|ASI_RS2(~0), "[1],g", 0, v6 }, /* ldd [rs1+%g0],d */ -{ "ldd", F3(3, 0x23, 1), F3(~3, ~0x23, ~1), "[1+i],g", 0, v6 }, -{ "ldd", F3(3, 0x23, 1), F3(~3, ~0x23, ~1), "[i+1],g", 0, v6 }, -{ "ldd", F3(3, 0x23, 1), F3(~3, ~0x23, ~1)|RS1_G0, "[i],g", 0, v6 }, -{ "ldd", F3(3, 0x23, 1), F3(~3, ~0x23, ~1)|SIMM13(~0), "[1],g", 0, v6 }, /* ldd [rs1+0],d */ -{ "ldd", F3(3, 0x33, 0), F3(~3, ~0x33, ~0)|ASI(~0), "[1+2],D", 0, v6 }, -{ "ldd", F3(3, 0x33, 0), F3(~3, ~0x33, ~0)|ASI_RS2(~0), "[1],D", 0, v6 }, /* ldd [rs1+%g0],d */ -{ "ldd", F3(3, 0x33, 1), F3(~3, ~0x33, ~1), "[1+i],D", 0, v6 }, -{ "ldd", F3(3, 0x33, 1), F3(~3, ~0x33, ~1), "[i+1],D", 0, v6 }, -{ "ldd", F3(3, 0x33, 1), F3(~3, ~0x33, ~1)|RS1_G0, "[i],D", 0, v6 }, -{ "ldd", F3(3, 0x33, 1), F3(~3, ~0x33, ~1)|SIMM13(~0), "[1],D", 0, v6 }, /* ldd [rs1+0],d */ -{ "ldsb", F3(3, 0x09, 0), F3(~3, ~0x09, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldsb", F3(3, 0x09, 0), F3(~3, ~0x09, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldsb [rs1+%g0],d */ -{ "ldsb", F3(3, 0x09, 1), F3(~3, ~0x09, ~1), "[1+i],d", 0, v6 }, -{ "ldsb", F3(3, 0x09, 1), F3(~3, ~0x09, ~1), "[i+1],d", 0, v6 }, -{ "ldsb", F3(3, 0x09, 1), F3(~3, ~0x09, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldsb", F3(3, 0x09, 1), F3(~3, ~0x09, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ldsb [rs1+0],d */ -{ "ldsh", F3(3, 0x0a, 0), F3(~3, ~0x0a, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldsh [rs1+%g0],d */ -{ "ldsh", F3(3, 0x0a, 0), F3(~3, ~0x0a, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldsh", F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1), "[1+i],d", 0, v6 }, -{ "ldsh", F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1), "[i+1],d", 0, v6 }, -{ "ldsh", F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldsh", F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ldsh [rs1+0],d */ -{ "ldstub", F3(3, 0x0d, 0), F3(~3, ~0x0d, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldstub", F3(3, 0x0d, 0), F3(~3, ~0x0d, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldstub [rs1+%g0],d */ -{ "ldstub", F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1), "[1+i],d", 0, v6 }, -{ "ldstub", F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1), "[i+1],d", 0, v6 }, -{ "ldstub", F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldsw", F3(3, 0x08, 0), F3(~3, ~0x08, ~0)|ASI(~0), "[1+2],d", 0, v9 }, -{ "ldsw", F3(3, 0x08, 0), F3(~3, ~0x08, ~0)|ASI_RS2(~0), "[1],d", 0, v9 }, /* ldsw [rs1+%g0],d */ -{ "ldsw", F3(3, 0x08, 1), F3(~3, ~0x08, ~1), "[1+i],d", 0, v9 }, -{ "ldsw", F3(3, 0x08, 1), F3(~3, ~0x08, ~1), "[i+1],d", 0, v9 }, -{ "ldsw", F3(3, 0x08, 1), F3(~3, ~0x08, ~1)|RS1_G0, "[i],d", 0, v9 }, -{ "ldsw", F3(3, 0x08, 1), F3(~3, ~0x08, ~1)|SIMM13(~0), "[1],d", 0, v9 }, /* ldsw [rs1+0],d */ -{ "ldub", F3(3, 0x01, 0), F3(~3, ~0x01, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldub", F3(3, 0x01, 0), F3(~3, ~0x01, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldub [rs1+%g0],d */ -{ "ldub", F3(3, 0x01, 1), F3(~3, ~0x01, ~1), "[1+i],d", 0, v6 }, -{ "ldub", F3(3, 0x01, 1), F3(~3, ~0x01, ~1), "[i+1],d", 0, v6 }, -{ "ldub", F3(3, 0x01, 1), F3(~3, ~0x01, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldub", F3(3, 0x01, 1), F3(~3, ~0x01, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ldub [rs1+0],d */ -{ "lduh", F3(3, 0x02, 0), F3(~3, ~0x02, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "lduh", F3(3, 0x02, 0), F3(~3, ~0x02, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* lduh [rs1+%g0],d */ -{ "lduh", F3(3, 0x02, 1), F3(~3, ~0x02, ~1), "[1+i],d", 0, v6 }, -{ "lduh", F3(3, 0x02, 1), F3(~3, ~0x02, ~1), "[i+1],d", 0, v6 }, -{ "lduh", F3(3, 0x02, 1), F3(~3, ~0x02, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "lduh", F3(3, 0x02, 1), F3(~3, ~0x02, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* lduh [rs1+0],d */ - -{ "ldx", F3(3, 0x0b, 0), F3(~3, ~0x0b, ~0)|ASI(~0), "[1+2],d", 0, v9 }, -{ "ldx", F3(3, 0x0b, 0), F3(~3, ~0x0b, ~0)|ASI_RS2(~0), "[1],d", 0, v9 }, /* ldx [rs1+%g0],d */ -{ "ldx", F3(3, 0x0b, 1), F3(~3, ~0x0b, ~1), "[1+i],d", 0, v9 }, -{ "ldx", F3(3, 0x0b, 1), F3(~3, ~0x0b, ~1), "[i+1],d", 0, v9 }, -{ "ldx", F3(3, 0x0b, 1), F3(~3, ~0x0b, ~1)|RS1_G0, "[i],d", 0, v9 }, -{ "ldx", F3(3, 0x0b, 1), F3(~3, ~0x0b, ~1)|SIMM13(~0), "[1],d", 0, v9 }, /* ldx [rs1+0],d */ -{ "ldx", F3(3, 0x29, 0), F3(~3, ~0x29, ~0), "[1+2],F", 0, v9 }, -{ "ldx", F3(3, 0x29, 0), F3(~3, ~0x29, ~0)|RS2_G0, "[1],F", 0, v9 }, /* ld [rs1+%g0],d */ -{ "ldx", F3(3, 0x29, 1), F3(~3, ~0x29, ~1), "[1+i],F", 0, v9 }, -{ "ldx", F3(3, 0x29, 1), F3(~3, ~0x29, ~1), "[i+1],F", 0, v9 }, -{ "ldx", F3(3, 0x29, 1), F3(~3, ~0x29, ~1)|RS1_G0, "[i],F", 0, v9 }, -{ "ldx", F3(3, 0x29, 1), F3(~3, ~0x29, ~1)|SIMM13(~0), "[1],F", 0, v9 }, /* ld [rs1+0],d */ - -{ "ldda", F3(3, 0x13, 0), F3(~3, ~0x13, ~0), "[1+2]A,d", 0, v6 }, -{ "ldda", F3(3, 0x13, 0), F3(~3, ~0x13, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* ldda [rs1+%g0],d */ -{ "ldsba", F3(3, 0x19, 0), F3(~3, ~0x19, ~0), "[1+2]A,d", 0, v6 }, -{ "ldsba", F3(3, 0x19, 0), F3(~3, ~0x19, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* ldsba [rs1+%g0],d */ -{ "ldsha", F3(3, 0x1a, 0), F3(~3, ~0x1a, ~0), "[1+2]A,d", 0, v6 }, -{ "ldsha", F3(3, 0x1a, 0), F3(~3, ~0x1a, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* ldsha [rs1+%g0],d */ -{ "ldstuba", F3(3, 0x1d, 0), F3(~3, ~0x1d, ~0), "[1+2]A,d", 0, v6 }, -{ "ldstuba", F3(3, 0x1d, 0), F3(~3, ~0x1d, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* ldstuba [rs1+%g0],d */ -{ "ldswa", F3(3, 0x18, 0), F3(~3, ~0x18, ~0), "[1+2]A,d", 0, v9 }, /* lduwa === lda */ -{ "ldswa", F3(3, 0x18, 0), F3(~3, ~0x18, ~0)|RS2_G0, "[1]A,d", 0, v9 }, /* lda [rs1+%g0],d */ -{ "lduba", F3(3, 0x11, 0), F3(~3, ~0x11, ~0), "[1+2]A,d", 0, v6 }, -{ "lduba", F3(3, 0x11, 0), F3(~3, ~0x11, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* lduba [rs1+%g0],d */ -{ "lduha", F3(3, 0x12, 0), F3(~3, ~0x12, ~0), "[1+2]A,d", 0, v6 }, -{ "lduha", F3(3, 0x12, 0), F3(~3, ~0x12, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* lduha [rs1+%g0],d */ -{ "lduwa", F3(3, 0x10, 0), F3(~3, ~0x10, ~0), "[1+2]A,d", F_ALIAS, v9 }, /* lduwa === lda */ -{ "lduwa", F3(3, 0x10, 0), F3(~3, ~0x10, ~0)|RS2_G0, "[1]A,d", F_ALIAS, v9 }, /* lda [rs1+%g0],d */ -{ "ldxa", F3(3, 0x1b, 0), F3(~3, ~0x1b, ~0), "[1+2]A,d", 0, v9 }, /* lduwa === lda */ -{ "ldxa", F3(3, 0x1b, 0), F3(~3, ~0x1b, ~0)|RS2_G0, "[1]A,d", 0, v9 }, /* lda [rs1+%g0],d */ - -{ "st", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0), "d,[1+2]", 0, v6 }, -{ "st", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0), "d,[1]", 0, v6 }, /* st d,[rs1+%g0] */ -{ "st", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[1+i]", 0, v6 }, -{ "st", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[i+1]", 0, v6 }, -{ "st", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0, "d,[i]", 0, v6 }, -{ "st", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0), "d,[1]", 0, v6 }, /* st d,[rs1+0] */ -{ "st", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI(~0), "g,[1+2]", 0, v6 }, -{ "st", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI_RS2(~0), "g,[1]", 0, v6 }, /* st d[rs1+%g0] */ -{ "st", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[1+i]", 0, v6 }, -{ "st", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[i+1]", 0, v6 }, -{ "st", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|RS1_G0, "g,[i]", 0, v6 }, -{ "st", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|SIMM13(~0), "g,[1]", 0, v6 }, /* st d,[rs1+0] */ -{ "st", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI(~0), "D,[1+2]", 0, v6 }, -{ "st", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI_RS2(~0), "D,[1]", 0, v6 }, /* st d,[rs1+%g0] */ -{ "st", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[1+i]", 0, v6 }, -{ "st", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[i+1]", 0, v6 }, -{ "st", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|RS1_G0, "D,[i]", 0, v6 }, -{ "st", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|SIMM13(~0), "D,[1]", 0, v6 }, /* st d,[rs1+0] */ -{ "st", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI(~0), "C,[1+2]", 0, v6 }, -{ "st", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI_RS2(~0), "C,[1]", 0, v6 }, /* st d,[rs1+%g0] */ -{ "st", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[1+i]", 0, v6 }, -{ "st", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[i+1]", 0, v6 }, -{ "st", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|RS1_G0, "C,[i]", 0, v6 }, -{ "st", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|SIMM13(~0), "C,[1]", 0, v6 }, /* st d,[rs1+0] */ - -{ "st", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI(~0), "F,[1+2]", 0, v6 }, -{ "st", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI_RS2(~0), "F,[1]", 0, v6 }, /* st d,[rs1+%g0] */ -{ "st", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[1+i]", 0, v6 }, -{ "st", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[i+1]", 0, v6 }, -{ "st", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0|RS1_G0, "F,[i]", 0, v6 }, -{ "st", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|SIMM13(~0), "F,[1]", 0, v6 }, /* st d,[rs1+0] */ - - /* FIXME-v9: combine st, stw, stuw, stsw, in macros. */ -{ "stw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, /* stw === st */ -{ "stw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stw", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI(~0), "g,[1+2]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI_RS2(~0), "g,[1]", F_ALIAS, v9 }, /* st d[rs1+%g0] */ -{ "stw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[1+i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[i+1]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|RS1_G0, "g,[i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|SIMM13(~0), "g,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stw", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI(~0), "D,[1+2]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI_RS2(~0), "D,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[1+i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[i+1]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|RS1_G0, "D,[i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|SIMM13(~0), "D,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stw", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI(~0), "C,[1+2]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI_RS2(~0), "C,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[1+i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[i+1]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|RS1_G0, "C,[i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|SIMM13(~0), "C,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stw", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI(~0), "F,[1+2]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI_RS2(~0), "F,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[1+i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[i+1]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0|RS1_G0, "F,[i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|SIMM13(~0), "F,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "stuw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, /* stuw === st */ -{ "stuw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stuw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stuw", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI(~0), "g,[1+2]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI_RS2(~0), "g,[1]", F_ALIAS, v9 }, /* st d[rs1+%g0] */ -{ "stuw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[1+i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[i+1]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|RS1_G0, "g,[i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|SIMM13(~0), "g,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stuw", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI(~0), "D,[1+2]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI_RS2(~0), "D,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stuw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[1+i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[i+1]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|RS1_G0, "D,[i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|SIMM13(~0), "D,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stuw", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI(~0), "C,[1+2]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI_RS2(~0), "C,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stuw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[1+i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[i+1]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|RS1_G0, "C,[i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|SIMM13(~0), "C,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stuw", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI(~0), "F,[1+2]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI_RS2(~0), "F,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stuw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[1+i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[i+1]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0|RS1_G0, "F,[i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|SIMM13(~0), "F,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "stsw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, /* stsw === st */ -{ "stsw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stsw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stsw", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI(~0), "g,[1+2]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI_RS2(~0), "g,[1]", F_ALIAS, v9 }, /* st d[rs1+%g0] */ -{ "stsw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[1+i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[i+1]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|RS1_G0, "g,[i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|SIMM13(~0), "g,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stsw", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI(~0), "D,[1+2]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI_RS2(~0), "D,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stsw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[1+i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[i+1]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|RS1_G0, "D,[i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|SIMM13(~0), "D,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stsw", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI(~0), "C,[1+2]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI_RS2(~0), "C,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stsw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[1+i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[i+1]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|RS1_G0, "C,[i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|SIMM13(~0), "C,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ -{ "stsw", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI(~0), "F,[1+2]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI_RS2(~0), "F,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stsw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[1+i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[i+1]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0|RS1_G0, "F,[i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|SIMM13(~0), "F,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "sta", F3(3, 0x14, 0), F3(~3, ~0x14, ~0), "d,[1+2]A", 0, v6 }, -{ "sta", F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0), "d,[1]A", 0, v6 }, /* sta d,[rs1+%g0] */ - -{ "stwa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stwa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* sta d,[rs1+%g0] */ - -{ "stswa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stswa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* sta d,[rs1+%g0] */ - -{ "stuwa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stuwa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* sta d,[rs1+%g0] */ - -{ "stb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0), "d,[1+2]", 0, v6 }, -{ "stb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0), "d,[1]", 0, v6 }, /* stb d,[rs1+%g0] */ -{ "stb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[1+i]", 0, v6 }, -{ "stb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[i+1]", 0, v6 }, -{ "stb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0, "d,[i]", 0, v6 }, -{ "stb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0), "d,[1]", 0, v6 }, /* stb d,[rs1+0] */ - -{ "stub", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stub", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* stb d,[rs1+%g0] */ -{ "stub", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stub", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stub", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stub", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* stb d,[rs1+0] */ - -{ "stsb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stsb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* stb d,[rs1+%g0] */ -{ "stsb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stsb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stsb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stsb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* stb d,[rs1+0] */ - -{ "stba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0), "d,[1+2]A", 0, v6 }, -{ "stba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0), "d,[1]A", 0, v6 }, /* stba d,[rs1+%g0] */ - -{ "stsba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stsba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* stba d,[rs1+%g0] */ - -{ "stuba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stuba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* stba d,[rs1+%g0] */ - -{ "std", F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI(~0), "d,[1+2]", 0, v6 }, -{ "std", F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI_RS2(~0), "d,[1]", 0, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x07, 1), F3(~3, ~0x07, ~1), "d,[1+i]", 0, v6 }, -{ "std", F3(3, 0x07, 1), F3(~3, ~0x07, ~1), "d,[i+1]", 0, v6 }, -{ "std", F3(3, 0x07, 1), F3(~3, ~0x07, ~1)|RS1_G0, "d,[i]", 0, v6 }, -{ "std", F3(3, 0x07, 1), F3(~3, ~0x07, ~1)|SIMM13(~0), "d,[1]", 0, v6 }, /* std d,[rs1+0] */ -{ "std", F3(3, 0x26, 0), F3(~3, ~0x26, ~0)|ASI(~0), "q,[1+2]", 0, v6 }, -{ "std", F3(3, 0x26, 0), F3(~3, ~0x26, ~0)|ASI_RS2(~0), "q,[1]", 0, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x26, 1), F3(~3, ~0x26, ~1), "q,[1+i]", 0, v6 }, -{ "std", F3(3, 0x26, 1), F3(~3, ~0x26, ~1), "q,[i+1]", 0, v6 }, -{ "std", F3(3, 0x26, 1), F3(~3, ~0x26, ~1)|RS1_G0, "q,[i]", 0, v6 }, -{ "std", F3(3, 0x26, 1), F3(~3, ~0x26, ~1)|SIMM13(~0), "q,[1]", 0, v6 }, /* std d,[rs1+0] */ -{ "std", F3(3, 0x27, 0), F3(~3, ~0x27, ~0)|ASI(~0), "g,[1+2]", 0, v6 }, -{ "std", F3(3, 0x27, 0), F3(~3, ~0x27, ~0)|ASI_RS2(~0), "g,[1]", 0, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x27, 1), F3(~3, ~0x27, ~1), "g,[1+i]", 0, v6 }, -{ "std", F3(3, 0x27, 1), F3(~3, ~0x27, ~1), "g,[i+1]", 0, v6 }, -{ "std", F3(3, 0x27, 1), F3(~3, ~0x27, ~1)|RS1_G0, "g,[i]", 0, v6 }, -{ "std", F3(3, 0x27, 1), F3(~3, ~0x27, ~1)|SIMM13(~0), "g,[1]", 0, v6 }, /* std d,[rs1+0] */ -{ "std", F3(3, 0x36, 0), F3(~3, ~0x36, ~0)|ASI(~0), "Q,[1+2]", 0, v6 }, -{ "std", F3(3, 0x36, 0), F3(~3, ~0x36, ~0)|ASI_RS2(~0), "Q,[1]", 0, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x36, 1), F3(~3, ~0x36, ~1), "Q,[1+i]", 0, v6 }, -{ "std", F3(3, 0x36, 1), F3(~3, ~0x36, ~1), "Q,[i+1]", 0, v6 }, -{ "std", F3(3, 0x36, 1), F3(~3, ~0x36, ~1)|RS1_G0, "Q,[i]", 0, v6 }, -{ "std", F3(3, 0x36, 1), F3(~3, ~0x36, ~1)|SIMM13(~0), "Q,[1]", 0, v6 }, /* std d,[rs1+0] */ -{ "std", F3(3, 0x37, 0), F3(~3, ~0x37, ~0)|ASI(~0), "D,[1+2]", 0, v6 }, -{ "std", F3(3, 0x37, 0), F3(~3, ~0x37, ~0)|ASI_RS2(~0), "D,[1]", 0, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x37, 1), F3(~3, ~0x37, ~1), "D,[1+i]", 0, v6 }, -{ "std", F3(3, 0x37, 1), F3(~3, ~0x37, ~1), "D,[i+1]", 0, v6 }, -{ "std", F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|RS1_G0, "D,[i]", 0, v6 }, -{ "std", F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|SIMM13(~0), "D,[1]", 0, v6 }, /* std d,[rs1+0] */ - -{ "stda", F3(3, 0x17, 0), F3(~3, ~0x17, ~0), "d,[1+2]A", 0, v6 }, -{ "stda", F3(3, 0x17, 0), F3(~3, ~0x17, ~0)|RS2(~0), "d,[1]A", 0, v6 }, /* stda d,[rs1+%g0] */ - -{ "sth", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI(~0), "d,[1+2]", 0, v6 }, -{ "sth", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI_RS2(~0), "d,[1]", 0, v6 }, /* sth d,[rs1+%g0] */ -{ "sth", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[1+i]", 0, v6 }, -{ "sth", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[i+1]", 0, v6 }, -{ "sth", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0, "d,[i]", 0, v6 }, -{ "sth", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0), "d,[1]", 0, v6 }, /* sth d,[+] */ - -{ "stsh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stsh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* sth d,[rs1+%g0] */ -{ "stsh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stsh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stsh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stsh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* sth d,[rs1+0] */ - -{ "stuh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stuh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* sth d,[rs1+%g0] */ -{ "stuh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stuh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stuh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stuh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* sth d,[rs1+0] */ - -{ "stha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0), "d,[1+2]A", 0, v6 }, -{ "stha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0), "d,[1]A", 0, v6 }, /* stha ,[+%] */ - -{ "stsha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stsha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* stha d,[rs1+%g0] */ - -{ "stuha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stuha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* stha d,[rs1+%g0] */ - -{ "stx", F3(3, 0x0e, 0), F3(~3, ~0x0e, ~0)|ASI(~0), "d,[1+2]", 0, v9 }, -{ "stx", F3(3, 0x0e, 0), F3(~3, ~0x0e, ~0)|ASI_RS2(~0), "d,[1]", 0, v9 }, /* stx d,[rs1+%g0] */ -{ "stx", F3(3, 0x0e, 1), F3(~3, ~0x0e, ~1), "d,[1+i]", 0, v9 }, -{ "stx", F3(3, 0x0e, 1), F3(~3, ~0x0e, ~1), "d,[i+1]", 0, v9 }, -{ "stx", F3(3, 0x0e, 1), F3(~3, ~0x0e, ~1)|RS1_G0, "d,[i]", 0, v9 }, -{ "stx", F3(3, 0x0e, 1), F3(~3, ~0x0e, ~1)|SIMM13(~0), "d,[1]", 0, v9 }, /* stx d,[rs1+0] */ -{ "stx", F3(3, 0x2d, 0), F3(~3, ~0x2d, ~0)|RD_G0|ASI(~0), "F,[1+2]", F_ALIAS, v9 }, -{ "stx", F3(3, 0x2d, 0), F3(~3, ~0x2d, ~0)|RD_G0|ASI_RS2(~0), "F,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stx", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1)|RD_G0, "F,[1+i]", F_ALIAS, v9 }, -{ "stx", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1)|RD_G0, "F,[i+1]", F_ALIAS, v9 }, -{ "stx", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1)|RD_G0|RS1_G0, "F,[i]", F_ALIAS, v9 }, -{ "stx", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1)|SIMM13(~0), "F,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "stxa", F3(3, 0x1e, 0), F3(~3, ~0x1e, ~0), "d,[1+2]A", 0, v9 }, -{ "stxa", F3(3, 0x1e, 0), F3(~3, ~0x1e, ~0)|RS2(~0), "d,[1]A", 0, v9 }, /* stha d,[rs1+%g0] */ - -{ "swap", F3(3, 0x0f, 0), F3(~3, ~0x0f, ~0)|ASI(~0), "[1+2],d", 0, v7 }, -{ "swap", F3(3, 0x0f, 0), F3(~3, ~0x0f, ~0)|ASI_RS2(~0), "[1],d", 0, v7 }, /* swap [rs1+%g0],d */ -{ "swap", F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1), "[1+i],d", 0, v7 }, -{ "swap", F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1), "[i+1],d", 0, v7 }, -{ "swap", F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1)|RS1_G0, "[i],d", 0, v7 }, -{ "swap", F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1)|SIMM13(~0), "[1],d", 0, v7 }, /* swap [rs1+0],d */ - -{ "swapa", F3(3, 0x1f, 0), F3(~3, ~0x1f, ~0), "[1+2]A,d", 0, v7 }, -{ "swapa", F3(3, 0x1f, 0), F3(~3, ~0x1f, ~0)|RS2(~0), "[1]A,d", 0, v7 }, /* swapa [rs1+%g0],d */ - -{ "restore", F3(2, 0x3d, 0), F3(~2, ~0x3d, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "restore", F3(2, 0x3d, 0), F3(~2, ~0x3d, ~0)|RD_G0|RS1_G0|ASI_RS2(~0), "", 0, v6 }, /* restore %g0,%g0,%g0 */ -{ "restore", F3(2, 0x3d, 1), F3(~2, ~0x3d, ~1), "1,i,d", 0, v6 }, -{ "restore", F3(2, 0x3d, 1), F3(~2, ~0x3d, ~1)|RD_G0|RS1_G0|SIMM13(~0), "", 0, v6 }, /* restore %g0,0,%g0 */ - -{ "rett", F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|RD_G0|ASI(~0), "1+2", F_DELAYED, v6 }, /* rett rs1+rs2 */ -{ "rett", F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|RD_G0|ASI_RS2(~0), "1", F_DELAYED, v6 }, /* rett rs1,%g0 */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0, "1+i", F_DELAYED, v6 }, /* rett rs1+X */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0, "i+1", F_DELAYED, v6 }, /* rett X+rs1 */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0|RS1_G0,"i", F_DELAYED, v6 }, /* rett X+rs1 */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0|RS1_G0, "i", F_DELAYED, v6 }, /* rett X */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0|SIMM13(~0), "1", F_DELAYED, v6 }, /* rett rs1+0 */ - -{ "save", F3(2, 0x3c, 0), F3(~2, ~0x3c, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "save", F3(2, 0x3c, 1), F3(~2, ~0x3c, ~1), "1,i,d", 0, v6 }, -{ "save", 0x81e00000, ~0x81e00000, "", F_ALIAS, v6 }, - -{ "ret", F3(2, 0x38, 1)|RS1(0x1f)|SIMM13(8), F3(~2, ~0x38, ~1)|SIMM13(~8), "", F_DELAYED, v6 }, /* jmpl %i7+8,%g0 */ -{ "retl", F3(2, 0x38, 1)|RS1(0x0f)|SIMM13(8), F3(~2, ~0x38, ~1)|RS1(~0x0f)|SIMM13(~8), "", F_DELAYED, v6 }, /* jmpl %o7+8,%g0 */ - -{ "jmpl", F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|ASI(~0), "1+2,d", F_DELAYED, v6 }, -{ "jmpl", F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|ASI_RS2(~0), "1,d", F_DELAYED, v6 }, /* jmpl rs1+%g0,d */ -{ "jmpl", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|SIMM13(~0), "1,d", F_DELAYED, v6 }, /* jmpl rs1+0,d */ -{ "jmpl", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RS1_G0, "i,d", F_DELAYED, v6 }, /* jmpl %g0+i,d */ -{ "jmpl", F3(2, 0x38, 1), F3(~2, ~0x38, ~1), "1+i,d", F_DELAYED, v6 }, -{ "jmpl", F3(2, 0x38, 1), F3(~2, ~0x38, ~1), "i+1,d", F_DELAYED, v6 }, - -{ "done", F3(2, 0x3e, 1)|RD(0), F3(~2, ~0x3e, ~1)|RD(~0)|RS1_G0|SIMM13(~0), "", 0, v9 }, -{ "retry", F3(2, 0x3e, 1)|RD(1), F3(~2, ~0x3e, ~1)|RD(~1)|RS1_G0|SIMM13(~0), "", 0, v9 }, -{ "saved", F3(2, 0x31, 1)|RD(0), F3(~2, ~0x31, ~1)|RD(~0)|RS1_G0|SIMM13(~0), "", 0, v9 }, -{ "restored", F3(2, 0x31, 1)|RD(1), F3(~2, ~0x31, ~1)|RD(~1)|RS1_G0|SIMM13(~0), "", 0, v9 }, -{ "sigm", F3(2, 0x30, 0)|RD(0xf), F3(~2, ~0x30, ~0)|RD(~0xf)|RS1_G0|SIMM13(~0), "", 0, v9 }, - -{ "flush", F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI(~0), "1+2", F_ALIAS, v9 }, -{ "flush", F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI_RS2(~0), "1", 0, v9 }, /* flush rs1+%g0 */ -{ "flush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|SIMM13(~0), "1", 0, v9 }, /* flush rs1+0 */ -{ "flush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|RS1_G0, "i", F_ALIAS, v9 }, /* flush %g0+i */ -{ "flush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1), "1+i", F_ALIAS, v9 }, -{ "flush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1), "i+1", F_ALIAS, v9 }, - -{ "return", F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|ASI(~0), "1+2", 0, v9 }, -{ "return", F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|ASI_RS2(~0), "1", 0, v9 }, /* return rs1+%g0 */ -{ "return", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|SIMM13(~0), "1", 0, v9 }, /* return rs1+0 */ -{ "return", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RS1_G0, "i", 0, v9 }, /* return %g0+i */ -{ "return", F3(2, 0x39, 1), F3(~2, ~0x39, ~1), "1+i", 0, v9 }, -{ "return", F3(2, 0x39, 1), F3(~2, ~0x39, ~1), "i+1", 0, v9 }, - -{ "flushw", F3(2, 0x2b, 0), F3(~2, ~0x2b, ~0)|RD_G0|RS1_G0|ASI_RS2(~0), "", 0, v9 }, - -{ "membar", F3(2, 0x28, 1)|RS1(0xf), F3(~2, ~0x28, ~1)|RD_G0|RS1(~0xf)|ASI(~0), "K", 0, v9 }, -{ "stbar", F3(2, 0x28, 0)|RS1(0xf), F3(~2, ~0x28, ~0)|RD_G0|RS1(~0xf)|SIMM13(~0), "", 0, v9 }, /* maybe v8? */ - -{ "prefetch", F3(3, 0x2d, 0), F3(~3, ~0x2d, ~0), "[1+2],*", 0, v9 }, -{ "prefetch", F3(3, 0x2d, 0), F3(~3, ~0x2d, ~0)|RS2_G0, "[1],*", 0, v9 }, /* prefetch [rs1+%g0],prefetch_fcn */ -{ "prefetch", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1), "[1+i],*", 0, v9 }, -{ "prefetch", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1), "[i+1],*", 0, v9 }, -{ "prefetch", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1)|RS1_G0, "[i],*", 0, v9 }, -{ "prefetch", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1)|SIMM13(~0), "[1],*", 0, v9 }, /* prefetch [rs1+0],prefetch_fcn */ -{ "prefetcha", F3(3, 0x3d, 0), F3(~3, ~0x3d, ~0), "[1+2]A,*", 0, v9 }, -{ "prefetcha", F3(3, 0x3d, 0), F3(~3, ~0x3d, ~0)|RS2_G0, "[1]A,*", 0, v9 }, /* prefetcha [rs1+%g0],prefetch_fcn */ - - /* The 1<<12 is a long story. It is necessary. For more info, please contact rich@cygnus.com */ -{ "sll", F3(2, 0x25, 0), F3(~2, ~0x25, ~0)|(1<<12)|ASI(~0), "1,2,d", 0, v6 }, -{ "sll", F3(2, 0x25, 1), F3(~2, ~0x25, ~1)|(1<<12), "1,i,d", 0, v6 }, -{ "sra", F3(2, 0x27, 0), F3(~2, ~0x27, ~0)|(1<<12)|ASI(~0), "1,2,d", 0, v6 }, -{ "sra", F3(2, 0x27, 1), F3(~2, ~0x27, ~1)|(1<<12), "1,i,d", 0, v6 }, -{ "srl", F3(2, 0x26, 0), F3(~2, ~0x26, ~0)|(1<<12)|ASI(~0), "1,2,d", 0, v6 }, -{ "srl", F3(2, 0x26, 1), F3(~2, ~0x26, ~1)|(1<<12), "1,i,d", 0, v6 }, - -{ "sllw", F3(2, 0x25, 0), F3(~2, ~0x25, ~0)|(1<<12)|ASI(~0), "1,2,d", F_ALIAS, v9 }, /* sllw === sll */ -{ "sllw", F3(2, 0x25, 1), F3(~2, ~0x25, ~1)|(1<<12), "1,i,d", F_ALIAS, v9 }, -{ "sraw", F3(2, 0x27, 0), F3(~2, ~0x27, ~0)|(1<<12)|ASI(~0), "1,2,d", F_ALIAS, v9 }, /* sraw === sra */ -{ "sraw", F3(2, 0x27, 1), F3(~2, ~0x27, ~1)|(1<<12), "1,i,d", F_ALIAS, v9 }, -{ "srlw", F3(2, 0x26, 0), F3(~2, ~0x26, ~0)|(1<<12)|ASI(~0), "1,2,d", F_ALIAS, v9 }, /* srlw === srl */ -{ "srlw", F3(2, 0x26, 1), F3(~2, ~0x26, ~1)|(1<<12), "1,i,d", F_ALIAS, v9 }, - -{ "sllx", F3(2, 0x25, 0)|(1<<12), F3(~2, ~0x25, ~0)|(ASI(~0)^(1<<12)), "1,2,d", 0, v9 }, -{ "sllx", F3(2, 0x25, 1)|(1<<12), F3(~2, ~0x25, ~1), "1,i,d", 0, v9 }, -{ "srax", F3(2, 0x27, 0)|(1<<12), F3(~2, ~0x27, ~0)|(ASI(~0)^(1<<12)), "1,2,d", 0, v9 }, -{ "srax", F3(2, 0x27, 1)|(1<<12), F3(~2, ~0x27, ~1), "1,i,d", 0, v9 }, -{ "srlx", F3(2, 0x26, 0)|(1<<12), F3(~2, ~0x26, ~0)|(ASI(~0)^(1<<12)), "1,2,d", 0, v9 }, -{ "srlx", F3(2, 0x26, 1)|(1<<12), F3(~2, ~0x26, ~1), "1,i,d", 0, v9 }, - -{ "mulscc", F3(2, 0x24, 0), F3(~2, ~0x24, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "mulscc", F3(2, 0x24, 1), F3(~2, ~0x24, ~1), "1,i,d", 0, v6 }, - -{ "divscc", F3(2, 0x1d, 0), F3(~2, ~0x1d, ~0)|ASI(~0), "1,2,d", 0, sparclite }, -{ "divscc", F3(2, 0x1d, 1), F3(~2, ~0x1d, ~1), "1,i,d", 0, sparclite }, - -{ "scan", F3(2, 0x2c, 0), F3(~2, ~0x2c, ~0)|ASI(~0), "1,2,d", 0, sparclite }, -{ "scan", F3(2, 0x2c, 1), F3(~2, ~0x2c, ~1), "1,i,d", 0, sparclite }, - -{ "clr", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|RD_G0|RS1_G0|ASI_RS2(~0), "d", F_ALIAS, v6 }, /* or %g0,%g0,d */ -{ "clr", F3(2, 0x02, 1), F3(~2, ~0x02, ~1)|RS1_G0|SIMM13(~0), "d", F_ALIAS, v6 }, /* or %g0,0,d */ -{ "clr", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|RD_G0|ASI(~0), "[1+2]", F_ALIAS, v6 }, -{ "clr", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|RD_G0|ASI_RS2(~0), "[1]", F_ALIAS, v6 }, /* st %g0,[rs1+%g0] */ -{ "clr", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0, "[1+i]", F_ALIAS, v6 }, -{ "clr", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0, "[i+1]", F_ALIAS, v6 }, -{ "clr", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0|RS1_G0, "[i]", F_ALIAS, v6 }, -{ "clr", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0|SIMM13(~0), "[1]", F_ALIAS, v6 }, /* st %g0,[rs1+0] */ - -{ "clrb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|RD_G0|ASI(~0), "[1+2]", F_ALIAS, v6 }, -{ "clrb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|RD_G0|ASI_RS2(~0), "[1]", F_ALIAS, v6 }, /* stb %g0,[rs1+%g0] */ -{ "clrb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0, "[1+i]", F_ALIAS, v6 }, -{ "clrb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0, "[i+1]", F_ALIAS, v6 }, -{ "clrb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0|RS1_G0, "[i]", F_ALIAS, v6 }, - -{ "clrh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|RD_G0|ASI(~0), "[1+2]", F_ALIAS, v6 }, -{ "clrh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|RD_G0|ASI_RS2(~0), "[1]", F_ALIAS, v6 }, /* sth %g0,[rs1+%g0] */ -{ "clrh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0, "[1+i]", F_ALIAS, v6 }, -{ "clrh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0, "[i+1]", F_ALIAS, v6 }, -{ "clrh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0|RS1_G0, "[i]", F_ALIAS, v6 }, - -{ "orcc", F3(2, 0x12, 0), F3(~2, ~0x12, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "orcc", F3(2, 0x12, 1), F3(~2, ~0x12, ~1), "1,i,d", 0, v6 }, -{ "orcc", F3(2, 0x12, 1), F3(~2, ~0x12, ~1), "i,1,d", 0, v6 }, - -{ "orncc", F3(2, 0x16, 0), F3(~2, ~0x16, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "orncc", F3(2, 0x16, 1), F3(~2, ~0x16, ~1), "1,i,d", 0, v6 }, -{ "orncc", F3(2, 0x16, 1), F3(~2, ~0x16, ~1), "i,1,d", 0, v6 }, - -{ "orn", F3(2, 0x06, 0), F3(~2, ~0x06, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "orn", F3(2, 0x06, 1), F3(~2, ~0x06, ~1), "1,i,d", 0, v6 }, -{ "orn", F3(2, 0x06, 1), F3(~2, ~0x06, ~1), "i,1,d", 0, v6 }, - -{ "tst", F3(2, 0x12, 0), F3(~2, ~0x12, ~0)|RD_G0|ASI_RS2(~0), "1", 0, v6 }, /* orcc rs1, %g0, %g0 */ -{ "tst", F3(2, 0x12, 0), F3(~2, ~0x12, ~0)|RD_G0|RS1_G0|ASI(~0), "2", 0, v6 }, /* orcc %g0, rs2, %g0 */ -{ "tst", F3(2, 0x12, 1), F3(~2, ~0x12, ~1)|RD_G0|SIMM13(~0), "1", 0, v6 }, /* orcc rs1, 0, %g0 */ - -{ "wr", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|ASI(~0), "1,2,m", 0, v8 }, /* wr r,r,%asrX */ -{ "wr", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|RD_G0|ASI(~0), "1,2,y", 0, v6 }, /* wr r,r,%y */ -{ "wr", F3(2, 0x30, 1), F3(~2, ~0x30, ~1), "1,i,m", 0, v8 }, /* wr r,i,%asrX */ -{ "wr", F3(2, 0x30, 1), F3(~2, ~0x30, ~1)|RD_G0, "1,i,y", 0, v6 }, /* wr r,i,%y */ -{ "wr", F3(2, 0x31, 0), F3(~2, ~0x31, ~0)|RD_G0|ASI(~0), "1,2,p", 0, v6 }, /* wr r,r,%psr */ -{ "wr", F3(2, 0x31, 1), F3(~2, ~0x31, ~1)|RD_G0, "1,i,p", 0, v6 }, /* wr r,i,%psr */ -{ "wr", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|RD_G0|ASI(~0), "1,2,w", 0, v6 }, /* wr r,r,%wim */ -{ "wr", F3(2, 0x32, 1), F3(~2, ~0x32, ~1)|RD_G0, "1,i,w", 0, v6 }, /* wr r,i,%wim */ -{ "wr", F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|RD_G0|ASI(~0), "1,2,t", 0, v6 }, /* wr r,r,%tbr */ -{ "wr", F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|RD_G0|ASI(~0), "1,2,s", 0, v9 }, /* wr r,r,%usr */ -{ "wr", F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|RD_G0|ASI(~0), "1,2,o", 0, v9 }, /* wr r,r,%asi */ -{ "wr", F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|RD_G0, "1,i,t", 0, v6 }, /* wr r,i,%tbr */ -{ "wr", F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|RD_G0, "1,i,s", 0, v9 }, /* wr r,i,%usr */ -{ "wr", F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|RD_G0, "1,i,o", 0, v9 }, /* wr r,i,%asi */ - -{ "wr", F3(2, 0x30, 0)|RD(0), F3(~2, ~0x30, ~0)|RD(~0)|ASI(~0), "1,2,y", 0, v9 }, -{ "wr", F3(2, 0x30, 1)|RD(0), F3(~2, ~0x30, ~1)|RD(~0), "1,i,y", 0, v9 }, -{ "wr", F3(2, 0x30, 0)|RD(1), F3(~2, ~0x30, ~0)|RD(~1)|ASI(~0), "1,2,E", 0, v9 }, -{ "wr", F3(2, 0x30, 1)|RD(1), F3(~2, ~0x30, ~1)|RD(~1), "1,i,E", 0, v9 }, -{ "wr", F3(2, 0x30, 0)|RD(3), F3(~2, ~0x30, ~0)|RD(~3)|ASI(~0), "1,2,W", 0, v9 }, -{ "wr", F3(2, 0x30, 1)|RD(3), F3(~2, ~0x30, ~1)|RD(~3), "1,i,W", 0, v9 }, -{ "wr", F3(2, 0x30, 0)|RD(4), F3(~2, ~0x30, ~0)|RD(~4)|ASI(~0), "1,2,p", 0, v9 }, -{ "wr", F3(2, 0x30, 1)|RD(4), F3(~2, ~0x30, ~1)|RD(~4), "1,i,p", 0, v9 }, -{ "wr", F3(2, 0x30, 0)|RD(5), F3(~2, ~0x30, ~0)|RD(~5)|ASI(~0), "1,2,w", 0, v9 }, -{ "wr", F3(2, 0x30, 1)|RD(5), F3(~2, ~0x30, ~1)|RD(~5), "1,i,w", 0, v9 }, - -{ "rd", F3(2, 0x28, 0), F3(~2, ~0x28, ~0)|SIMM13(~0), "M,d", 0, v8 }, /* rd %asr1,r */ -{ "rd", F3(2, 0x28, 0), F3(~2, ~0x28, ~0)|RS1_G0|SIMM13(~0), "y,d", 0, v6 }, /* rd %y,r */ -{ "rd", F3(2, 0x28, 0)|RS1(1), F3(~2, ~0x28, ~0)|RS1(~1)|SIMM13(~0), "E,d", 0, v9 }, /* rd %modes,r */ -{ "rd", F3(2, 0x28, 0)|RS1(2), F3(~2, ~0x28, ~0)|RS1(~2)|SIMM13(~0), "P,d", 0, v9 }, /* rd %pc,r */ -{ "rd", F3(2, 0x28, 0)|RS1(3), F3(~2, ~0x28, ~0)|RS1(~3)|SIMM13(~0), "W,d", 0, v9 }, /* rd %tick,r */ -{ "rd", F3(2, 0x28, 0)|RS1(4), F3(~2, ~0x28, ~0)|RS1(~4)|SIMM13(~0), "p,d", 0, v9 }, /* rd %psr,r */ -{ "rd", F3(2, 0x28, 0)|RS1(5), F3(~2, ~0x28, ~0)|RS1(~5)|SIMM13(~0), "w,d", 0, v9 }, /* rd %wim,r */ -{ "rd", F3(2, 0x2b, 0), F3(~2, ~0x2b, ~0)|RS1_G0|SIMM13(~0), "t,d", 0, v6 }, /* rd %tbr,r */ -{ "rd", F3(2, 0x2b, 0), F3(~2, ~0x2b, ~0)|RS1_G0|SIMM13(~0), "s,d", 0, v9 }, /* rd %usr,r */ -{ "rd", F3(2, 0x2b, 0), F3(~2, ~0x2b, ~0)|RS1_G0|SIMM13(~0), "o,d", 0, v9 }, /* rd %asi,r */ - - /* FIXME-now: the v9 (ie, 0.5) definitions of these conflict with the older ones. These are the older ones. */ -{ "rd", F3(2, 0x29, 0), F3(~2, ~0x29, ~0)|RS1_G0|SIMM13(~0), "p,d", 0, v6 }, /* rd %psr,r */ -{ "rd", F3(2, 0x2a, 0), F3(~2, ~0x2a, ~0)|RS1_G0|SIMM13(~0), "w,d", 0, v6 }, /* rd %wim,r */ - -{ "rdpr", F3(2, 0x2a, 0), F3(~2, ~0x2a, ~0)|SIMM13(~0), "?,d", 0, v9 }, /* rdpr %priv_reg,r */ -{ "wrpr", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|SIMM13(~0), "1,2,!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|SIMM13(~0), "1,!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|SIMM13(~0), "!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 1), F3(~2, ~0x32, ~1), "1,i,!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 1), F3(~2, ~0x32, ~1), "i,1,!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 1), F3(~2, ~0x32, ~1), "i,!", 0, v9 }, - -{ "mov", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|ASI(~0), "1,2,m", F_ALIAS, v8 }, /* wr r,r,%asrX */ -{ "mov", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|RD_G0|ASI(~0), "1,2,y", F_ALIAS, v6 }, /* wr r,r,%y */ -{ "mov", F3(2, 0x30, 0)|RD(0xe), F3(~2, ~0x30, ~0)|RD(~0xe)|ASI(~0), "1,2,Y", F_ALIAS, v9 }, /* wr r,r,%amr */ -{ "mov", F3(2, 0x30, 1), F3(~2, ~0x30, ~1), "1,i,m", F_ALIAS, v8 }, /* wr r,i,%asrX */ -{ "mov", F3(2, 0x30, 1), F3(~2, ~0x30, ~1)|RD_G0, "1,i,y", F_ALIAS, v6 }, /* wr r,i,%y */ -{ "mov", F3(2, 0x30, 1)|RD(0xe), F3(~2, ~0x30, ~1)|RD(~0xe), "1,i,Y", F_ALIAS, v9 }, /* wr r,i,%amr */ -{ "mov", F3(2, 0x31, 0), F3(~2, ~0x31, ~0)|RD_G0|ASI(~0), "1,2,p", F_ALIAS, v6 }, /* wr r,r,%psr */ -{ "mov", F3(2, 0x31, 1), F3(~2, ~0x31, ~1)|RD_G0, "1,i,p", F_ALIAS, v6 }, /* wr r,i,%psr */ -{ "mov", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|RD_G0|ASI(~0), "1,2,w", F_ALIAS, v6 }, /* wr r,r,%wim */ -{ "mov", F3(2, 0x32, 1), F3(~2, ~0x32, ~1)|RD_G0, "1,i,w", F_ALIAS, v6 }, /* wr r,i,%wim */ -{ "mov", F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|RD_G0|ASI(~0), "1,2,t", F_ALIAS, v6 }, /* wr r,r,%tbr */ -{ "mov", F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|RD_G0, "1,i,t", F_ALIAS, v6 }, /* wr r,i,%tbr */ - -{ "mov", F3(2, 0x28, 0), F3(~2, ~0x28, ~0)|SIMM13(~0), "M,d", F_ALIAS, v8 }, /* rd %asr1,r */ -{ "mov", F3(2, 0x28, 0), F3(~2, ~0x28, ~0)|RS1_G0|SIMM13(~0), "y,d", F_ALIAS, v6 }, /* rd %y,r */ -{ "mov", F3(2, 0x28, 0)|RS1(0xe), F3(~2, ~0x28, ~0)|RS1(~0xe)|SIMM13(~0), "Y,d", F_ALIAS, v9 }, /* rd %amr,r */ -{ "mov", F3(2, 0x29, 0), F3(~2, ~0x29, ~0)|RS1_G0|SIMM13(~0), "p,d", F_ALIAS, v6 }, /* rd %psr,r */ -{ "mov", F3(2, 0x2a, 0), F3(~2, ~0x2a, ~0)|RS1_G0|SIMM13(~0), "w,d", F_ALIAS, v6 }, /* rd %wim,r */ -{ "mov", F3(2, 0x2b, 0), F3(~2, ~0x2b, ~0)|RS1_G0|SIMM13(~0), "t,d", F_ALIAS, v6 }, /* rd %tbr,r */ - -{ "mov", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|ASI_RS2(~0), "1,y", F_ALIAS, v6 }, /* wr rs1,%g0,%y */ -{ "mov", F3(2, 0x30, 1), F3(~2, ~0x30, ~1), "i,y", F_ALIAS, v6 }, -{ "mov", F3(2, 0x30, 1), F3(~2, ~0x30, ~1)|SIMM13(~0), "1,y", F_ALIAS, v6 }, /* wr rs1,0,%y */ -{ "mov", F3(2, 0x31, 0), F3(~2, ~0x31, ~0)|ASI_RS2(~0), "1,p", F_ALIAS, v6 }, /* wr rs1,%g0,%psr */ -{ "mov", F3(2, 0x31, 1), F3(~2, ~0x31, ~1), "i,p", F_ALIAS, v6 }, -{ "mov", F3(2, 0x31, 1), F3(~2, ~0x31, ~1)|SIMM13(~0), "1,p", F_ALIAS, v6 }, /* wr rs1,0,%psr */ -{ "mov", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|ASI_RS2(~0), "1,w", F_ALIAS, v6 }, /* wr rs1,%g0,%wim */ -{ "mov", F3(2, 0x32, 1), F3(~2, ~0x32, ~1), "i,w", F_ALIAS, v6 }, -{ "mov", F3(2, 0x32, 1), F3(~2, ~0x32, ~1)|SIMM13(~0), "1,w", F_ALIAS, v6 }, /* wr rs1,0,%wim */ -{ "mov", F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|ASI_RS2(~0), "1,t", F_ALIAS, v6 }, /* wr rs1,%g0,%tbr */ -{ "mov", F3(2, 0x33, 1), F3(~2, ~0x33, ~1), "i,t", F_ALIAS, v6 }, -{ "mov", F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|SIMM13(~0), "1,t", F_ALIAS, v6 }, /* wr rs1,0,%tbr */ - -{ "mov", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|RS1_G0|ASI(~0), "2,d", 0, v6 }, /* or %g0,rs2,d */ -{ "mov", F3(2, 0x02, 1), F3(~2, ~0x02, ~1)|RS1_G0, "i,d", 0, v6 }, /* or %g0,i,d */ -{ "mov", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|ASI_RS2(~0), "1,d", 0, v6 }, /* or rs1,%g0,d */ -{ "mov", F3(2, 0x02, 1), F3(~2, ~0x02, ~1)|SIMM13(~0), "1,d", 0, v6 }, /* or rs1,0,d */ - -{ "or", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "or", F3(2, 0x02, 1), F3(~2, ~0x02, ~1), "1,i,d", 0, v6 }, -{ "or", F3(2, 0x02, 1), F3(~2, ~0x02, ~1), "i,1,d", 0, v6 }, - -{ "bset", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|ASI(~0), "2,r", F_ALIAS, v6 }, /* or rd,rs2,rd */ -{ "bset", F3(2, 0x02, 1), F3(~2, ~0x02, ~1), "i,r", F_ALIAS, v6 }, /* or rd,i,rd */ - -{ "andn", F3(2, 0x05, 0), F3(~2, ~0x05, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "andn", F3(2, 0x05, 1), F3(~2, ~0x05, ~1), "1,i,d", 0, v6 }, -{ "andn", F3(2, 0x05, 1), F3(~2, ~0x05, ~1), "i,1,d", 0, v6 }, - -{ "andncc", F3(2, 0x15, 0), F3(~2, ~0x15, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "andncc", F3(2, 0x15, 1), F3(~2, ~0x15, ~1), "1,i,d", 0, v6 }, -{ "andncc", F3(2, 0x15, 1), F3(~2, ~0x15, ~1), "i,1,d", 0, v6 }, - -{ "bclr", F3(2, 0x05, 0), F3(~2, ~0x05, ~0)|ASI(~0), "2,r", F_ALIAS, v6 }, /* andn rd,rs2,rd */ -{ "bclr", F3(2, 0x05, 1), F3(~2, ~0x05, ~1), "i,r", F_ALIAS, v6 }, /* andn rd,i,rd */ - -{ "cmp", F3(2, 0x14, 0), F3(~2, ~0x14, ~0)|RD_G0|ASI(~0), "1,2", 0, v6 }, /* subcc rs1,rs2,%g0 */ -{ "cmp", F3(2, 0x14, 1), F3(~2, ~0x14, ~1)|RD_G0, "1,i", 0, v6 }, /* subcc rs1,i,%g0 */ - -{ "sub", F3(2, 0x04, 0), F3(~2, ~0x04, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "sub", F3(2, 0x04, 1), F3(~2, ~0x04, ~1), "1,i,d", 0, v6 }, - -{ "subcc", F3(2, 0x14, 0), F3(~2, ~0x14, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "subcc", F3(2, 0x14, 1), F3(~2, ~0x14, ~1), "1,i,d", 0, v6 }, - -{ "subx", F3(2, 0x0c, 0), F3(~2, ~0x0c, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "subx", F3(2, 0x0c, 1), F3(~2, ~0x0c, ~1), "1,i,d", 0, v6 }, - -{ "subxcc", F3(2, 0x1c, 0), F3(~2, ~0x1c, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "subxcc", F3(2, 0x1c, 1), F3(~2, ~0x1c, ~1), "1,i,d", 0, v6 }, - -{ "and", F3(2, 0x01, 0), F3(~2, ~0x01, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "and", F3(2, 0x01, 1), F3(~2, ~0x01, ~1), "1,i,d", 0, v6 }, -{ "and", F3(2, 0x01, 1), F3(~2, ~0x01, ~1), "i,1,d", 0, v6 }, - -{ "andcc", F3(2, 0x11, 0), F3(~2, ~0x11, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "andcc", F3(2, 0x11, 1), F3(~2, ~0x11, ~1), "1,i,d", 0, v6 }, -{ "andcc", F3(2, 0x11, 1), F3(~2, ~0x11, ~1), "i,1,d", 0, v6 }, - -{ "dec", F3(2, 0x04, 1)|SIMM13(0x1), F3(~2, ~0x04, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 }, /* sub rd,1,rd */ -{ "dec", F3(2, 0x04, 1), F3(~2, ~0x04, ~1), "i,r", F_ALIAS, v8 }, /* sub rd,imm,rd */ -{ "deccc", F3(2, 0x14, 1)|SIMM13(0x1), F3(~2, ~0x14, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 }, /* subcc rd,1,rd */ -{ "deccc", F3(2, 0x14, 1), F3(~2, ~0x14, ~1), "i,r", F_ALIAS, v8 }, /* subcc rd,imm,rd */ -{ "inc", F3(2, 0x00, 1)|SIMM13(0x1), F3(~2, ~0x00, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 }, /* add rd,1,rd */ -{ "inc", F3(2, 0x00, 1), F3(~2, ~0x00, ~1), "i,r", F_ALIAS, v8 }, /* add rd,imm,rd */ -{ "inccc", F3(2, 0x10, 1)|SIMM13(0x1), F3(~2, ~0x10, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 }, /* addcc rd,1,rd */ -{ "inccc", F3(2, 0x10, 1), F3(~2, ~0x10, ~1), "i,r", F_ALIAS, v8 }, /* addcc rd,imm,rd */ - -{ "btst", F3(2, 0x11, 0), F3(~2, ~0x11, ~0)|RD_G0|ASI(~0), "1,2", F_ALIAS, v6 }, /* andcc rs1,rs2,%g0 */ -{ "btst", F3(2, 0x11, 1), F3(~2, ~0x11, ~1)|RD_G0, "i,1", F_ALIAS, v6 }, /* andcc rs1,i,%g0 */ - -{ "neg", F3(2, 0x04, 0), F3(~2, ~0x04, ~0)|RS1_G0|ASI(~0), "2,d", F_ALIAS, v6 }, /* sub %g0,rs2,rd */ -{ "neg", F3(2, 0x04, 0), F3(~2, ~0x04, ~0)|RS1_G0|ASI(~0), "r", F_ALIAS, v6 }, /* sub %g0,rd,rd */ - -{ "add", F3(2, 0x00, 0), F3(~2, ~0x00, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "add", F3(2, 0x00, 1), F3(~2, ~0x00, ~1), "1,i,d", 0, v6 }, -{ "add", F3(2, 0x00, 1), F3(~2, ~0x00, ~1), "i,1,d", 0, v6 }, -{ "addcc", F3(2, 0x10, 0), F3(~2, ~0x10, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "addcc", F3(2, 0x10, 1), F3(~2, ~0x10, ~1), "1,i,d", 0, v6 }, -{ "addcc", F3(2, 0x10, 1), F3(~2, ~0x10, ~1), "i,1,d", 0, v6 }, -{ "addx", F3(2, 0x08, 0), F3(~2, ~0x08, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "addx", F3(2, 0x08, 1), F3(~2, ~0x08, ~1), "1,i,d", 0, v6 }, -{ "addx", F3(2, 0x08, 1), F3(~2, ~0x08, ~1), "i,1,d", 0, v6 }, -{ "addxcc", F3(2, 0x18, 0), F3(~2, ~0x18, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "addxcc", F3(2, 0x18, 1), F3(~2, ~0x18, ~1), "1,i,d", 0, v6 }, -{ "addxcc", F3(2, 0x18, 1), F3(~2, ~0x18, ~1), "i,1,d", 0, v6 }, - -{ "smul", F3(2, 0x0b, 0), F3(~2, ~0x0b, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "smul", F3(2, 0x0b, 1), F3(~2, ~0x0b, ~1), "1,i,d", 0, v8 }, -{ "smul", F3(2, 0x0b, 1), F3(~2, ~0x0b, ~1), "i,1,d", 0, v8 }, -{ "smulcc", F3(2, 0x1b, 0), F3(~2, ~0x1b, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "smulcc", F3(2, 0x1b, 1), F3(~2, ~0x1b, ~1), "1,i,d", 0, v8 }, -{ "smulcc", F3(2, 0x1b, 1), F3(~2, ~0x1b, ~1), "i,1,d", 0, v8 }, -{ "umul", F3(2, 0x0a, 0), F3(~2, ~0x0a, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "umul", F3(2, 0x0a, 1), F3(~2, ~0x0a, ~1), "1,i,d", 0, v8 }, -{ "umul", F3(2, 0x0a, 1), F3(~2, ~0x0a, ~1), "i,1,d", 0, v8 }, -{ "umulcc", F3(2, 0x1a, 0), F3(~2, ~0x1a, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "umulcc", F3(2, 0x1a, 1), F3(~2, ~0x1a, ~1), "1,i,d", 0, v8 }, -{ "umulcc", F3(2, 0x1a, 1), F3(~2, ~0x1a, ~1), "i,1,d", 0, v8 }, -{ "sdiv", F3(2, 0x0f, 0), F3(~2, ~0x0f, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "sdiv", F3(2, 0x0f, 1), F3(~2, ~0x0f, ~1), "1,i,d", 0, v8 }, -{ "sdiv", F3(2, 0x0f, 1), F3(~2, ~0x0f, ~1), "i,1,d", 0, v8 }, -{ "sdivcc", F3(2, 0x1f, 0), F3(~2, ~0x1f, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "sdivcc", F3(2, 0x1f, 1), F3(~2, ~0x1f, ~1), "1,i,d", 0, v8 }, -{ "sdivcc", F3(2, 0x1f, 1), F3(~2, ~0x1f, ~1), "i,1,d", 0, v8 }, -{ "udiv", F3(2, 0x0e, 0), F3(~2, ~0x0e, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "udiv", F3(2, 0x0e, 1), F3(~2, ~0x0e, ~1), "1,i,d", 0, v8 }, -{ "udiv", F3(2, 0x0e, 1), F3(~2, ~0x0e, ~1), "i,1,d", 0, v8 }, -{ "udivcc", F3(2, 0x1e, 0), F3(~2, ~0x1e, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "udivcc", F3(2, 0x1e, 1), F3(~2, ~0x1e, ~1), "1,i,d", 0, v8 }, -{ "udivcc", F3(2, 0x1e, 1), F3(~2, ~0x1e, ~1), "i,1,d", 0, v8 }, - -{ "mulx", F3(2, 0x09, 0), F3(~2, ~0x09, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "mulx", F3(2, 0x09, 1), F3(~2, ~0x09, ~1), "1,i,d", 0, v9 }, -{ "umulxcc", F3(2, 0x19, 0), F3(~2, ~0x19, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "umulxcc", F3(2, 0x19, 1), F3(~2, ~0x19, ~1), "1,i,d", 0, v9 }, -{ "sdivxcc", F3(2, 0x1d, 0), F3(~2, ~0x1d, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "sdivxcc", F3(2, 0x1d, 1), F3(~2, ~0x1d, ~1), "1,i,d", 0, v9 }, -{ "udivx", F3(2, 0x0d, 0), F3(~2, ~0x0d, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "udivx", F3(2, 0x0d, 1), F3(~2, ~0x0d, ~1), "1,i,d", 0, v9 }, - -{ "call", F1(0x1), F1(~0x1), "L", F_DELAYED, v6 }, -{ "call", F1(0x1), F1(~0x1), "L,#", F_DELAYED, v6 }, -{ "call", F3(2, 0x38, 0)|RD(0xf), F3(~2, ~0x38, ~0)|RD(~0xf)|ASI_RS2(~0), "1", F_DELAYED, v6 }, /* jmpl rs1+%g0, %o7 */ -{ "call", F3(2, 0x38, 0)|RD(0xf), F3(~2, ~0x38, ~0)|RD(~0xf)|ASI_RS2(~0), "1,#", F_DELAYED, v6 }, - -/* 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. John Gilmore. */ - -/* Define branches -- one annulled, one without, etc. */ -#define br(opcode, mask, lose, flags) \ - { opcode, (mask)|ANNUL, (lose), ",a l", (flags), v6 }, \ - { opcode, (mask) , (lose)|ANNUL, "l", (flags), v6 } - -#define brx(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose)|ANNUL|BPRED, "Z,G", (flags), v9 }, \ - { opcode, (mask), (lose)|ANNUL|BPRED, ",N Z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a Z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a,N Z,G", (flags), v9 }, \ - { opcode, (mask)|BPRED, (lose)|ANNUL, ",T Z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL|BPRED, (lose), ",a,T Z,G", (flags), v9 }, \ - { opcode, (mask), (lose)|ANNUL|BPRED, "z,G", (flags), v9 }, \ - { opcode, (mask), (lose)|ANNUL|BPRED, ",N z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a,N z,G", (flags), v9 }, \ - { opcode, (mask)|BPRED, (lose)|ANNUL, ",T z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL|BPRED, (lose), ",a,T z,G", (flags), v9 } - -/* 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), v6 }, /* %g0 + imm */ \ - { opcode, (mask)|IMMED, (lose), "1+i", (flags), v6 }, /* rs1 + imm */ \ - { opcode, (mask), IMMED|(lose), "1+2", (flags), v6 }, /* rs1 + rs2 */ \ - { opcode, (mask)|(2<<11)|IMMED, (lose)|RS1_G0, "Z,i", (flags), v9 }, /* %g0 + imm */ \ - { opcode, (mask)|(2<<11)|IMMED, (lose), "Z,1+i", (flags), v9 }, /* rs1 + imm */ \ - { opcode, (mask)|(2<<11), IMMED|(lose), "Z,1+2", (flags), v9 }, /* rs1 + rs2 */ \ - { opcode, (mask)|(2<<11), IMMED|(lose)|RS2_G0, "Z,1", (flags), v9 }, /* rs1 + %g0 */ \ - { opcode, (mask)|IMMED, (lose)|RS1_G0, "z,i", (flags)|F_ALIAS, v9 }, /* %g0 + imm */ \ - { opcode, (mask)|IMMED, (lose), "z,1+i", (flags)|F_ALIAS, v9 }, /* rs1 + imm */ \ - { opcode, (mask), IMMED|(lose), "z,1+2", (flags)|F_ALIAS, v9 }, /* rs1 + rs2 */ \ - { opcode, (mask), IMMED|(lose)|RS2_G0, "z,1", (flags)|F_ALIAS, v9 }, /* rs1 + %g0 */ \ - { opcode, (mask), IMMED|(lose)|RS2_G0, "1", (flags), v6 } /* rs1 + %g0 */ - -/* Define both branches and traps based on condition mask */ -#define cond(bop, top, mask, flags) \ - br(bop, F2(0, 2)|(mask), F2(~0, ~2)|((~mask)&COND(~0)), F_DELAYED|(flags)), \ - brx(bop, F2(0, 1)|(mask), F2(~0, ~1)|((~mask)&COND(~0)), F_DELAYED|(flags)), /* v9 */ \ - tr(top, F3(2, 0x3a, 0)|(mask), F3(~2, ~0x3a, 0)|((~mask)&COND(~0)), (flags)) - -/* Define all the conditions, all the branches, all the traps. */ - -cond ("b", "t", CONDA, 0), -cond ("ba", "ta", CONDA, F_ALIAS), /* for nothing */ -cond ("bcc", "tcc", CONDCC, 0), -cond ("bcs", "tcs", CONDCS, 0), -cond ("be", "te", CONDE, 0), -cond ("bg", "tg", CONDG, 0), -cond ("bgt", "tgt", CONDG, F_ALIAS), -cond ("bge", "tge", CONDGE, 0), -cond ("bgeu", "tgeu", CONDGEU, F_ALIAS), /* for cc */ -cond ("bgu", "tgu", CONDGU, 0), -cond ("bl", "tl", CONDL, 0), -cond ("blt", "tlt", CONDL, F_ALIAS), -cond ("ble", "tle", CONDLE, 0), -cond ("bleu", "tleu", CONDLEU, 0), -cond ("blu", "tlu", CONDLU, F_ALIAS), /* for cs */ -cond ("bn", "tn", CONDN, 0), -cond ("bne", "tne", CONDNE, 0), -cond ("bneg", "tneg", CONDNEG, 0), -cond ("bnz", "tnz", CONDNZ, F_ALIAS), /* for ne */ -cond ("bpos", "tpos", CONDPOS, 0), -cond ("bvc", "tvc", CONDVC, 0), -cond ("bvs", "tvs", CONDVS, 0), -cond ("bz", "tz", CONDZ, F_ALIAS), /* for e */ - -#undef cond -#undef br -#undef tr - -#define brr(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose)|ANNUL|BPRED, "1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask), (lose)|ANNUL|BPRED, ",N 1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a 1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a,N 1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask)|BPRED, (lose)|ANNUL, ",T 1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask)|ANNUL|BPRED, (lose), ",a,T 1,k", F_DELAYED|(flags), v9 } - -#define condr(bop, mask, flags) /* v9 */ \ - brr(bop, F2(0, 3)|COND(mask), F2(~0, ~3)|COND(~(mask)), (flags)) /* v9 */ \ - -/* v9 */ condr("bre", 0x1, 0), -/* v9 */ condr("brne", 0x5, 0), -/* v9 */ condr("brneg", 0x3, 0), -/* v9 */ condr("brnegz", 0x2, 0), -/* v9 */ condr("brposnz", 0x6, 0), -/* v9 */ condr("brnz", 0x5, F_ALIAS), -/* v9 */ condr("brpos", 0x7, 0), -/* v9 */ condr("brz", 0x1, F_ALIAS), - -#undef condr /* v9 */ -#undef brr /* v9 */ - -#define mrr(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose), "1,2,d", (flags), v9 }, \ - { opcode, (mask), (lose), "1,i,d", (flags), v9 } - -#define movr(mop, mask, flags) /* v9 */ \ - mrr(mop, F3(2, 0x2f, 0)|COND(mask), F3(~2, ~0x2f, ~0)|COND(~(mask)), (flags)), /* v9 */ \ - mrr(mop, F3(2, 0x2f, 1)|COND(mask), F3(~2, ~0x2f, ~1)|COND(~(mask)), (flags)) /* v9 */ - -#define fmrrs(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose), "1,f,g", (flags), v9 } -#define fmrrd(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose), "1,B,H", (flags), v9 } -#define fmrrq(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose), "1,R,J", (flags), v9 } - -#define fmovrs(mop, mask, flags) /* v9 */ \ - fmrrs(mop, F3(2, 0x25, 0)|OPF_LOW(5)|COND(mask), F3(~2, ~0x25, 0)|OPF_LOW(~5)|COND(~(mask)), (flags)) /* v9 */ -#define fmovrd(mop, mask, flags) /* v9 */ \ - fmrrd(mop, F3(2, 0x25, 0)|OPF_LOW(6)|COND(mask), F3(~2, ~0x25, 0)|OPF_LOW(~6)|COND(~(mask)), (flags)) /* v9 */ -#define fmovrq(mop, mask, flags) /* v9 */ \ - fmrrq(mop, F3(2, 0x25, 0)|OPF_LOW(7)|COND(mask), F3(~2, ~0x25, 0)|OPF_LOW(~7)|COND(~(mask)), (flags)) /* v9 */ - -/* v9 */ movr("movrne", 0x5, 0), -/* v9 */ movr("movre", 0x1, 0), -/* v9 */ movr("movrpos", 0x7, 0), -/* v9 */ movr("movrneg", 0x3, 0), -/* v9 */ movr("movrnegz", 0x2, 0), -/* v9 */ movr("movrposnz", 0x6, 0), -/* v9 */ movr("movrnz", 0x5, F_ALIAS), -/* v9 */ movr("movrz", 0x1, F_ALIAS), - -/* v9 */ fmovrs("fmovrnes", 0x5, 0), -/* v9 */ fmovrs("fmovres", 0x1, 0), -/* v9 */ fmovrs("fmovrposs", 0x7, 0), -/* v9 */ fmovrs("fmovrnegs", 0x3, 0), -/* v9 */ fmovrs("fmovrnegzs", 0x2, 0), -/* v9 */ fmovrs("fmovrposnzs", 0x6, 0), -/* v9 */ fmovrs("fmovrnzs", 0x5, F_ALIAS), -/* v9 */ fmovrs("fmovrzs", 0x1, F_ALIAS), - -/* v9 */ fmovrd("fmovrned", 0x5, 0), -/* v9 */ fmovrd("fmovred", 0x1, 0), -/* v9 */ fmovrd("fmovrposd", 0x7, 0), -/* v9 */ fmovrd("fmovrnegd", 0x3, 0), -/* v9 */ fmovrd("fmovrnegzd", 0x2, 0), -/* v9 */ fmovrd("fmovrposnzd", 0x6, 0), -/* v9 */ fmovrd("fmovrnzd", 0x5, F_ALIAS), -/* v9 */ fmovrd("fmovrzd", 0x1, F_ALIAS), - -/* v9 */ fmovrq("fmovrneq", 0x5, 0), -/* v9 */ fmovrq("fmovreq", 0x1, 0), -/* v9 */ fmovrq("fmovrposq", 0x7, 0), -/* v9 */ fmovrq("fmovrnegq", 0x3, 0), -/* v9 */ fmovrq("fmovrnegzq", 0x2, 0), -/* v9 */ fmovrq("fmovrposnzq", 0x6, 0), -/* v9 */ fmovrq("fmovrnzq", 0x5, F_ALIAS), -/* v9 */ fmovrq("fmovrzq", 0x1, F_ALIAS), - -#undef movr /* v9 */ -#undef mrr /* v9 */ -#undef fmovr /* v9 */ -#undef fmrr /* v9 */ - -{ "mova", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~0)|F3(~2, ~0x2c,~1), "6,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|MCOND(CONDA,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDA,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|MCOND(CONDA,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDA,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|MCOND(CONDA,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDA,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|MCOND(CONDA,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDA,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movcc", F3(2, 0x2c, 0)|MCOND(CONDCC,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDCC,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movcc", F3(2, 0x2c, 1)|MCOND(CONDCC,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDCC,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movcc", F3(2, 0x2c, 0)|MCOND(CONDCC,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDCC,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movcc", F3(2, 0x2c, 1)|MCOND(CONDCC,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDCC,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movgeu", F3(2, 0x2c, 0)|MCOND(CONDGEU,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGEU,~1)|XCC|(1<<12), "z,2,d", F_ALIAS, v9 }, -{ "movgeu", F3(2, 0x2c, 1)|MCOND(CONDGEU,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGEU,~1)|XCC|(1<<12), "z,I,d", F_ALIAS, v9 }, -{ "movgeu", F3(2, 0x2c, 0)|MCOND(CONDGEU,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGEU,~1)|(1<<12), "Z,2,d", F_ALIAS, v9 }, -{ "movgeu", F3(2, 0x2c, 1)|MCOND(CONDGEU,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGEU,~1)|(1<<12), "Z,I,d", F_ALIAS, v9 }, -{ "movcs", F3(2, 0x2c, 0)|MCOND(CONDCS,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDCS,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movcs", F3(2, 0x2c, 1)|MCOND(CONDCS,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDCS,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movcs", F3(2, 0x2c, 0)|MCOND(CONDCS,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDCS,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movcs", F3(2, 0x2c, 1)|MCOND(CONDCS,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDCS,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movlu", F3(2, 0x2c, 0)|MCOND(CONDLU,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLU,~1)|XCC|(1<<12), "z,2,d", F_ALIAS, v9 }, -{ "movlu", F3(2, 0x2c, 1)|MCOND(CONDLU,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLU,~1)|XCC|(1<<12), "z,I,d", F_ALIAS, v9 }, -{ "movlu", F3(2, 0x2c, 0)|MCOND(CONDLU,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLU,~1)|(1<<12), "Z,2,d", F_ALIAS, v9 }, -{ "movlu", F3(2, 0x2c, 1)|MCOND(CONDLU,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLU,~1)|(1<<12), "Z,I,d", F_ALIAS, v9 }, -{ "move", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|MCOND(CONDE,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDE,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|MCOND(CONDE,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDE,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|MCOND(CONDE,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDE,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|MCOND(CONDE,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDE,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|MCOND(CONDG,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDG,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|MCOND(CONDG,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDG,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|MCOND(CONDG,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDG,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|MCOND(CONDG,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDG,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|MCOND(CONDGE,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGE,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|MCOND(CONDGE,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGE,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|MCOND(CONDGE,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGE,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|MCOND(CONDGE,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGE,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movgu", F3(2, 0x2c, 0)|MCOND(CONDGU,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGU,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movgu", F3(2, 0x2c, 1)|MCOND(CONDGU,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGU,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movgu", F3(2, 0x2c, 0)|MCOND(CONDGU,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGU,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movgu", F3(2, 0x2c, 1)|MCOND(CONDGU,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGU,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|MCOND(CONDL,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDL,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|MCOND(CONDL,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDL,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|MCOND(CONDL,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDL,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|MCOND(CONDL,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDL,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|MCOND(CONDLE,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLE,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|MCOND(CONDLE,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLE,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|MCOND(CONDLE,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLE,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|MCOND(CONDLE,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLE,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movleu", F3(2, 0x2c, 0)|MCOND(CONDLEU,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLEU,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movleu", F3(2, 0x2c, 1)|MCOND(CONDLEU,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLEU,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movleu", F3(2, 0x2c, 0)|MCOND(CONDLEU,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLEU,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movleu", F3(2, 0x2c, 1)|MCOND(CONDLEU,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLEU,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|MCOND(CONDN,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDN,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|MCOND(CONDN,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDN,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|MCOND(CONDN,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDN,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|MCOND(CONDN,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDN,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|MCOND(CONDNE,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNE,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|MCOND(CONDNE,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNE,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|MCOND(CONDNE,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNE,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|MCOND(CONDNE,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNE,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movneg", F3(2, 0x2c, 0)|MCOND(CONDNEG,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNEG,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movneg", F3(2, 0x2c, 1)|MCOND(CONDNEG,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNEG,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movneg", F3(2, 0x2c, 0)|MCOND(CONDNEG,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNEG,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movneg", F3(2, 0x2c, 1)|MCOND(CONDNEG,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNEG,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movnz", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", F_ALIAS, v9 }, -{ "movo", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movpos", F3(2, 0x2c, 0)|MCOND(CONDPOS,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDPOS,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movpos", F3(2, 0x2c, 1)|MCOND(CONDPOS,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDPOS,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movpos", F3(2, 0x2c, 0)|MCOND(CONDPOS,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDPOS,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movpos", F3(2, 0x2c, 1)|MCOND(CONDPOS,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDPOS,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movvc", F3(2, 0x2c, 0)|MCOND(CONDVC,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDVC,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movvc", F3(2, 0x2c, 1)|MCOND(CONDVC,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDVC,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movvc", F3(2, 0x2c, 0)|MCOND(CONDVC,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDVC,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movvc", F3(2, 0x2c, 1)|MCOND(CONDVC,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDVC,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movvs", F3(2, 0x2c, 0)|MCOND(CONDVS,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDVS,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movvs", F3(2, 0x2c, 1)|MCOND(CONDVS,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDVS,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movvs", F3(2, 0x2c, 0)|MCOND(CONDVS,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDVS,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movvs", F3(2, 0x2c, 1)|MCOND(CONDVS,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDVS,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movz", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", F_ALIAS, v9 }, - -{ "fmovad", F3F(2, 0x35, 0x102)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDA,~0), "z,f,g", 0, v9 }, -{ "fmovad", F3F(2, 0x35, 0x082)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDA,~0), "6,f,g", 0, v9 }, -{ "fmovad", F3F(2, 0x35, 0x182)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDA,~0), "Z,f,g", 0, v9 }, -{ "fmovad", F3F(2, 0x35, 0x0a2)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDA,~0), "7,f,g", 0, v9 }, -{ "fmovad", F3F(2, 0x35, 0x0c2)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDA,~0), "8,f,g", 0, v9 }, -{ "fmovad", F3F(2, 0x35, 0x0e2)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDA,~0), "9,f,g", 0, v9 }, -{ "fmovaq", F3F(2, 0x35, 0x103)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDA,~0), "z,f,g", 0, v9 }, -{ "fmovaq", F3F(2, 0x35, 0x083)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDA,~0), "6,f,g", 0, v9 }, -{ "fmovaq", F3F(2, 0x35, 0x183)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDA,~0), "Z,f,g", 0, v9 }, -{ "fmovaq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDA,~0), "7,f,g", 0, v9 }, -{ "fmovaq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDA,~0), "8,f,g", 0, v9 }, -{ "fmovaq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDA,~0), "9,f,g", 0, v9 }, -{ "fmovas", F3F(2, 0x35, 0x101)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDA,~0), "z,f,g", 0, v9 }, -{ "fmovas", F3F(2, 0x35, 0x081)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDA,~0), "6,f,g", 0, v9 }, -{ "fmovas", F3F(2, 0x35, 0x181)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDA,~0), "Z,f,g", 0, v9 }, -{ "fmovas", F3F(2, 0x35, 0x0a1)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDA,~0), "7,f,g", 0, v9 }, -{ "fmovas", F3F(2, 0x35, 0x0c1)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDA,~0), "8,f,g", 0, v9 }, -{ "fmovas", F3F(2, 0x35, 0x0e1)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDA,~0), "9,f,g", 0, v9 }, -{ "fmovccd", F3F(2, 0x35, 0x102)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDCC,~0), "z,f,g", 0, v9 }, -{ "fmovccd", F3F(2, 0x35, 0x182)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDCC,~0), "Z,f,g", 0, v9 }, -{ "fmovccq", F3F(2, 0x35, 0x103)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDCC,~0), "z,f,g", 0, v9 }, -{ "fmovccq", F3F(2, 0x35, 0x183)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDCC,~0), "Z,f,g", 0, v9 }, -{ "fmovccs", F3F(2, 0x35, 0x101)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDCC,~0), "z,f,g", 0, v9 }, -{ "fmovccs", F3F(2, 0x35, 0x181)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDCC,~0), "Z,f,g", 0, v9 }, -{ "fmovcsd", F3F(2, 0x35, 0x102)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDCS,~0), "z,f,g", 0, v9 }, -{ "fmovcsd", F3F(2, 0x35, 0x182)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDCS,~0), "Z,f,g", 0, v9 }, -{ "fmovcsq", F3F(2, 0x35, 0x103)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDCS,~0), "z,f,g", 0, v9 }, -{ "fmovcsq", F3F(2, 0x35, 0x183)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDCS,~0), "Z,f,g", 0, v9 }, -{ "fmovcss", F3F(2, 0x35, 0x101)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDCS,~0), "z,f,g", 0, v9 }, -{ "fmovcss", F3F(2, 0x35, 0x181)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDCS,~0), "Z,f,g", 0, v9 }, -{ "fmoved", F3F(2, 0x35, 0x102)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDE,~0), "z,f,g", 0, v9 }, -{ "fmoved", F3F(2, 0x35, 0x082)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDE,~0), "6,f,g", 0, v9 }, -{ "fmoved", F3F(2, 0x35, 0x182)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDE,~0), "Z,f,g", 0, v9 }, -{ "fmoved", F3F(2, 0x35, 0x0a2)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDE,~0), "7,f,g", 0, v9 }, -{ "fmoved", F3F(2, 0x35, 0x0c2)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDE,~0), "8,f,g", 0, v9 }, -{ "fmoved", F3F(2, 0x35, 0x0e2)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDE,~0), "9,f,g", 0, v9 }, -{ "fmoveq", F3F(2, 0x35, 0x103)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDE,~0), "z,f,g", 0, v9 }, -{ "fmoveq", F3F(2, 0x35, 0x083)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDE,~0), "6,f,g", 0, v9 }, -{ "fmoveq", F3F(2, 0x35, 0x183)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDE,~0), "Z,f,g", 0, v9 }, -{ "fmoveq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDE,~0), "7,f,g", 0, v9 }, -{ "fmoveq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDE,~0), "8,f,g", 0, v9 }, -{ "fmoveq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDE,~0), "9,f,g", 0, v9 }, -{ "fmoves", F3F(2, 0x35, 0x101)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDE,~0), "z,f,g", 0, v9 }, -{ "fmoves", F3F(2, 0x35, 0x081)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDE,~0), "6,f,g", 0, v9 }, -{ "fmoves", F3F(2, 0x35, 0x181)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDE,~0), "Z,f,g", 0, v9 }, -{ "fmoves", F3F(2, 0x35, 0x0a1)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDE,~0), "7,f,g", 0, v9 }, -{ "fmoves", F3F(2, 0x35, 0x0c1)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDE,~0), "8,f,g", 0, v9 }, -{ "fmoves", F3F(2, 0x35, 0x0e1)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDE,~0), "9,f,g", 0, v9 }, -{ "fmovgd", F3F(2, 0x35, 0x102)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDG,~0), "z,f,g", 0, v9 }, -{ "fmovgd", F3F(2, 0x35, 0x082)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDG,~0), "6,f,g", 0, v9 }, -{ "fmovgd", F3F(2, 0x35, 0x182)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDG,~0), "Z,f,g", 0, v9 }, -{ "fmovgd", F3F(2, 0x35, 0x0a2)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDG,~0), "7,f,g", 0, v9 }, -{ "fmovgd", F3F(2, 0x35, 0x0c2)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDG,~0), "8,f,g", 0, v9 }, -{ "fmovgd", F3F(2, 0x35, 0x0e2)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDG,~0), "9,f,g", 0, v9 }, -{ "fmovged", F3F(2, 0x35, 0x102)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDGE,~0), "z,f,g", 0, v9 }, -{ "fmovged", F3F(2, 0x35, 0x082)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDGE,~0), "6,f,g", 0, v9 }, -{ "fmovged", F3F(2, 0x35, 0x182)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDGE,~0), "Z,f,g", 0, v9 }, -{ "fmovged", F3F(2, 0x35, 0x0a2)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDGE,~0), "7,f,g", 0, v9 }, -{ "fmovged", F3F(2, 0x35, 0x0c2)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDGE,~0), "8,f,g", 0, v9 }, -{ "fmovged", F3F(2, 0x35, 0x0e2)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDGE,~0), "9,f,g", 0, v9 }, -{ "fmovgeq", F3F(2, 0x35, 0x103)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDGE,~0), "z,f,g", 0, v9 }, -{ "fmovgeq", F3F(2, 0x35, 0x083)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDGE,~0), "6,f,g", 0, v9 }, -{ "fmovgeq", F3F(2, 0x35, 0x183)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDGE,~0), "Z,f,g", 0, v9 }, -{ "fmovgeq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDGE,~0), "7,f,g", 0, v9 }, -{ "fmovgeq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDGE,~0), "8,f,g", 0, v9 }, -{ "fmovgeq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDGE,~0), "9,f,g", 0, v9 }, -{ "fmovges", F3F(2, 0x35, 0x101)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDGE,~0), "z,f,g", 0, v9 }, -{ "fmovges", F3F(2, 0x35, 0x081)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDGE,~0), "6,f,g", 0, v9 }, -{ "fmovges", F3F(2, 0x35, 0x181)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDGE,~0), "Z,f,g", 0, v9 }, -{ "fmovges", F3F(2, 0x35, 0x0a1)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDGE,~0), "7,f,g", 0, v9 }, -{ "fmovges", F3F(2, 0x35, 0x0c1)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDGE,~0), "8,f,g", 0, v9 }, -{ "fmovges", F3F(2, 0x35, 0x0e1)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDGE,~0), "9,f,g", 0, v9 }, -{ "fmovgeud", F3F(2, 0x35, 0x102)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDGEU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovgeud", F3F(2, 0x35, 0x182)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDGEU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovgeuq", F3F(2, 0x35, 0x103)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDGEU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovgeuq", F3F(2, 0x35, 0x183)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDGEU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovgeus", F3F(2, 0x35, 0x101)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDGEU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovgeus", F3F(2, 0x35, 0x181)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDGEU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovgq", F3F(2, 0x35, 0x103)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDG,~0), "z,f,g", 0, v9 }, -{ "fmovgq", F3F(2, 0x35, 0x083)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDG,~0), "6,f,g", 0, v9 }, -{ "fmovgq", F3F(2, 0x35, 0x183)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDG,~0), "Z,f,g", 0, v9 }, -{ "fmovgq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDG,~0), "7,f,g", 0, v9 }, -{ "fmovgq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDG,~0), "8,f,g", 0, v9 }, -{ "fmovgq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDG,~0), "9,f,g", 0, v9 }, -{ "fmovgs", F3F(2, 0x35, 0x101)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDG,~0), "z,f,g", 0, v9 }, -{ "fmovgs", F3F(2, 0x35, 0x081)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDG,~0), "6,f,g", 0, v9 }, -{ "fmovgs", F3F(2, 0x35, 0x181)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDG,~0), "Z,f,g", 0, v9 }, -{ "fmovgs", F3F(2, 0x35, 0x0a1)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDG,~0), "7,f,g", 0, v9 }, -{ "fmovgs", F3F(2, 0x35, 0x0c1)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDG,~0), "8,f,g", 0, v9 }, -{ "fmovgs", F3F(2, 0x35, 0x0e1)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDG,~0), "9,f,g", 0, v9 }, -{ "fmovgud", F3F(2, 0x35, 0x102)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDGU,~0), "z,f,g", 0, v9 }, -{ "fmovgud", F3F(2, 0x35, 0x182)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDGU,~0), "Z,f,g", 0, v9 }, -{ "fmovguq", F3F(2, 0x35, 0x103)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDGU,~0), "z,f,g", 0, v9 }, -{ "fmovguq", F3F(2, 0x35, 0x183)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDGU,~0), "Z,f,g", 0, v9 }, -{ "fmovgus", F3F(2, 0x35, 0x101)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDGU,~0), "z,f,g", 0, v9 }, -{ "fmovgus", F3F(2, 0x35, 0x181)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDGU,~0), "Z,f,g", 0, v9 }, -{ "fmovld", F3F(2, 0x35, 0x102)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDL,~0), "z,f,g", 0, v9 }, -{ "fmovld", F3F(2, 0x35, 0x082)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDL,~0), "6,f,g", 0, v9 }, -{ "fmovld", F3F(2, 0x35, 0x182)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDL,~0), "Z,f,g", 0, v9 }, -{ "fmovld", F3F(2, 0x35, 0x0a2)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDL,~0), "7,f,g", 0, v9 }, -{ "fmovld", F3F(2, 0x35, 0x0c2)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDL,~0), "8,f,g", 0, v9 }, -{ "fmovld", F3F(2, 0x35, 0x0e2)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDL,~0), "9,f,g", 0, v9 }, -{ "fmovled", F3F(2, 0x35, 0x102)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDLE,~0), "z,f,g", 0, v9 }, -{ "fmovled", F3F(2, 0x35, 0x082)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDLE,~0), "6,f,g", 0, v9 }, -{ "fmovled", F3F(2, 0x35, 0x182)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDLE,~0), "Z,f,g", 0, v9 }, -{ "fmovled", F3F(2, 0x35, 0x0a2)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDLE,~0), "7,f,g", 0, v9 }, -{ "fmovled", F3F(2, 0x35, 0x0c2)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDLE,~0), "8,f,g", 0, v9 }, -{ "fmovled", F3F(2, 0x35, 0x0e2)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDLE,~0), "9,f,g", 0, v9 }, -{ "fmovleq", F3F(2, 0x35, 0x103)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDLE,~0), "z,f,g", 0, v9 }, -{ "fmovleq", F3F(2, 0x35, 0x083)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDLE,~0), "6,f,g", 0, v9 }, -{ "fmovleq", F3F(2, 0x35, 0x183)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDLE,~0), "Z,f,g", 0, v9 }, -{ "fmovleq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDLE,~0), "7,f,g", 0, v9 }, -{ "fmovleq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDLE,~0), "8,f,g", 0, v9 }, -{ "fmovleq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDLE,~0), "9,f,g", 0, v9 }, -{ "fmovles", F3F(2, 0x35, 0x101)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDLE,~0), "z,f,g", 0, v9 }, -{ "fmovles", F3F(2, 0x35, 0x081)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDLE,~0), "6,f,g", 0, v9 }, -{ "fmovles", F3F(2, 0x35, 0x181)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDLE,~0), "Z,f,g", 0, v9 }, -{ "fmovles", F3F(2, 0x35, 0x0a1)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDLE,~0), "7,f,g", 0, v9 }, -{ "fmovles", F3F(2, 0x35, 0x0c1)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDLE,~0), "8,f,g", 0, v9 }, -{ "fmovles", F3F(2, 0x35, 0x0e1)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDLE,~0), "9,f,g", 0, v9 }, -{ "fmovleud", F3F(2, 0x35, 0x102)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDLEU,~0), "z,f,g", 0, v9 }, -{ "fmovleud", F3F(2, 0x35, 0x182)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDLEU,~0), "Z,f,g", 0, v9 }, -{ "fmovleuq", F3F(2, 0x35, 0x103)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDLEU,~0), "z,f,g", 0, v9 }, -{ "fmovleuq", F3F(2, 0x35, 0x183)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDLEU,~0), "Z,f,g", 0, v9 }, -{ "fmovleus", F3F(2, 0x35, 0x101)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDLEU,~0), "z,f,g", 0, v9 }, -{ "fmovleus", F3F(2, 0x35, 0x181)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDLEU,~0), "Z,f,g", 0, v9 }, -{ "fmovlgd", F3F(2, 0x35, 0x082)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDLG,~0), "6,f,g", 0, v9 }, -{ "fmovlgd", F3F(2, 0x35, 0x0a2)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDLG,~0), "7,f,g", 0, v9 }, -{ "fmovlgd", F3F(2, 0x35, 0x0c2)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDLG,~0), "8,f,g", 0, v9 }, -{ "fmovlgd", F3F(2, 0x35, 0x0e2)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDLG,~0), "9,f,g", 0, v9 }, -{ "fmovlgq", F3F(2, 0x35, 0x083)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDLG,~0), "6,f,g", 0, v9 }, -{ "fmovlgq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDLG,~0), "7,f,g", 0, v9 }, -{ "fmovlgq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDLG,~0), "8,f,g", 0, v9 }, -{ "fmovlgq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDLG,~0), "9,f,g", 0, v9 }, -{ "fmovlgs", F3F(2, 0x35, 0x081)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDLG,~0), "6,f,g", 0, v9 }, -{ "fmovlgs", F3F(2, 0x35, 0x0a1)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDLG,~0), "7,f,g", 0, v9 }, -{ "fmovlgs", F3F(2, 0x35, 0x0c1)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDLG,~0), "8,f,g", 0, v9 }, -{ "fmovlgs", F3F(2, 0x35, 0x0e1)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDLG,~0), "9,f,g", 0, v9 }, -{ "fmovlq", F3F(2, 0x35, 0x103)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDL,~0), "z,f,g", 0, v9 }, -{ "fmovlq", F3F(2, 0x35, 0x083)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDL,~0), "6,f,g", 0, v9 }, -{ "fmovlq", F3F(2, 0x35, 0x183)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDL,~0), "Z,f,g", 0, v9 }, -{ "fmovlq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDL,~0), "7,f,g", 0, v9 }, -{ "fmovlq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDL,~0), "8,f,g", 0, v9 }, -{ "fmovlq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDL,~0), "9,f,g", 0, v9 }, -{ "fmovls", F3F(2, 0x35, 0x101)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDL,~0), "z,f,g", 0, v9 }, -{ "fmovls", F3F(2, 0x35, 0x081)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDL,~0), "6,f,g", 0, v9 }, -{ "fmovls", F3F(2, 0x35, 0x181)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDL,~0), "Z,f,g", 0, v9 }, -{ "fmovls", F3F(2, 0x35, 0x0a1)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDL,~0), "7,f,g", 0, v9 }, -{ "fmovls", F3F(2, 0x35, 0x0c1)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDL,~0), "8,f,g", 0, v9 }, -{ "fmovls", F3F(2, 0x35, 0x0e1)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDL,~0), "9,f,g", 0, v9 }, -{ "fmovlud", F3F(2, 0x35, 0x102)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDLU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovlud", F3F(2, 0x35, 0x182)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDLU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovluq", F3F(2, 0x35, 0x103)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDLU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovluq", F3F(2, 0x35, 0x183)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDLU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovlus", F3F(2, 0x35, 0x101)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDLU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovlus", F3F(2, 0x35, 0x181)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDLU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovnd", F3F(2, 0x35, 0x102)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDN,~0), "z,f,g", 0, v9 }, -{ "fmovnd", F3F(2, 0x35, 0x082)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDN,~0), "6,f,g", 0, v9 }, -{ "fmovnd", F3F(2, 0x35, 0x182)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDN,~0), "Z,f,g", 0, v9 }, -{ "fmovnd", F3F(2, 0x35, 0x0a2)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDN,~0), "7,f,g", 0, v9 }, -{ "fmovnd", F3F(2, 0x35, 0x0c2)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDN,~0), "8,f,g", 0, v9 }, -{ "fmovnd", F3F(2, 0x35, 0x0e2)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDN,~0), "9,f,g", 0, v9 }, -{ "fmovned", F3F(2, 0x35, 0x102)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDNE,~0), "z,f,g", 0, v9 }, -{ "fmovned", F3F(2, 0x35, 0x082)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDNE,~0), "6,f,g", 0, v9 }, -{ "fmovned", F3F(2, 0x35, 0x182)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDNE,~0), "Z,f,g", 0, v9 }, -{ "fmovned", F3F(2, 0x35, 0x0a2)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDNE,~0), "7,f,g", 0, v9 }, -{ "fmovned", F3F(2, 0x35, 0x0c2)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDNE,~0), "8,f,g", 0, v9 }, -{ "fmovned", F3F(2, 0x35, 0x0e2)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDNE,~0), "9,f,g", 0, v9 }, -{ "fmovnegd", F3F(2, 0x35, 0x102)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDNEG,~0), "z,f,g", 0, v9 }, -{ "fmovnegd", F3F(2, 0x35, 0x182)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDNEG,~0), "Z,f,g", 0, v9 }, -{ "fmovnegq", F3F(2, 0x35, 0x103)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDNEG,~0), "z,f,g", 0, v9 }, -{ "fmovnegq", F3F(2, 0x35, 0x183)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDNEG,~0), "Z,f,g", 0, v9 }, -{ "fmovnegs", F3F(2, 0x35, 0x101)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDNEG,~0), "z,f,g", 0, v9 }, -{ "fmovnegs", F3F(2, 0x35, 0x181)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDNEG,~0), "Z,f,g", 0, v9 }, -{ "fmovneq", F3F(2, 0x35, 0x103)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDNE,~0), "z,f,g", 0, v9 }, -{ "fmovneq", F3F(2, 0x35, 0x083)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDNE,~0), "6,f,g", 0, v9 }, -{ "fmovneq", F3F(2, 0x35, 0x183)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDNE,~0), "Z,f,g", 0, v9 }, -{ "fmovneq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDNE,~0), "7,f,g", 0, v9 }, -{ "fmovneq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDNE,~0), "8,f,g", 0, v9 }, -{ "fmovneq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDNE,~0), "9,f,g", 0, v9 }, -{ "fmovnes", F3F(2, 0x35, 0x101)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDNE,~0), "z,f,g", 0, v9 }, -{ "fmovnes", F3F(2, 0x35, 0x081)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDNE,~0), "6,f,g", 0, v9 }, -{ "fmovnes", F3F(2, 0x35, 0x181)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDNE,~0), "Z,f,g", 0, v9 }, -{ "fmovnes", F3F(2, 0x35, 0x0a1)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDNE,~0), "7,f,g", 0, v9 }, -{ "fmovnes", F3F(2, 0x35, 0x0c1)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDNE,~0), "8,f,g", 0, v9 }, -{ "fmovnes", F3F(2, 0x35, 0x0e1)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDNE,~0), "9,f,g", 0, v9 }, -{ "fmovnq", F3F(2, 0x35, 0x103)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDN,~0), "z,f,g", 0, v9 }, -{ "fmovnq", F3F(2, 0x35, 0x083)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDN,~0), "6,f,g", 0, v9 }, -{ "fmovnq", F3F(2, 0x35, 0x183)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDN,~0), "Z,f,g", 0, v9 }, -{ "fmovnq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDN,~0), "7,f,g", 0, v9 }, -{ "fmovnq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDN,~0), "8,f,g", 0, v9 }, -{ "fmovnq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDN,~0), "9,f,g", 0, v9 }, -{ "fmovns", F3F(2, 0x35, 0x101)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDN,~0), "z,f,g", 0, v9 }, -{ "fmovns", F3F(2, 0x35, 0x081)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDN,~0), "6,f,g", 0, v9 }, -{ "fmovns", F3F(2, 0x35, 0x181)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDN,~0), "Z,f,g", 0, v9 }, -{ "fmovns", F3F(2, 0x35, 0x0a1)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDN,~0), "7,f,g", 0, v9 }, -{ "fmovns", F3F(2, 0x35, 0x0c1)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDN,~0), "8,f,g", 0, v9 }, -{ "fmovns", F3F(2, 0x35, 0x0e1)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDN,~0), "9,f,g", 0, v9 }, -{ "fmovnzd", F3F(2, 0x35, 0x102)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDNZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovnzd", F3F(2, 0x35, 0x082)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDNZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovnzd", F3F(2, 0x35, 0x182)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDNZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovnzd", F3F(2, 0x35, 0x0a2)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDNZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovnzd", F3F(2, 0x35, 0x0c2)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDNZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovnzd", F3F(2, 0x35, 0x0e2)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDNZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovnzq", F3F(2, 0x35, 0x103)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDNZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovnzq", F3F(2, 0x35, 0x083)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDNZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovnzq", F3F(2, 0x35, 0x183)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDNZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovnzq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDNZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovnzq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDNZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovnzq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDNZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovnzs", F3F(2, 0x35, 0x101)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDNZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovnzs", F3F(2, 0x35, 0x081)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDNZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovnzs", F3F(2, 0x35, 0x181)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDNZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovnzs", F3F(2, 0x35, 0x0a1)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDNZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovnzs", F3F(2, 0x35, 0x0c1)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDNZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovnzs", F3F(2, 0x35, 0x0e1)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDNZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovod", F3F(2, 0x35, 0x082)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDO,~0), "6,f,g", 0, v9 }, -{ "fmovod", F3F(2, 0x35, 0x0a2)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDO,~0), "7,f,g", 0, v9 }, -{ "fmovod", F3F(2, 0x35, 0x0c2)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDO,~0), "8,f,g", 0, v9 }, -{ "fmovod", F3F(2, 0x35, 0x0e2)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDO,~0), "9,f,g", 0, v9 }, -{ "fmovoq", F3F(2, 0x35, 0x083)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDO,~0), "6,f,g", 0, v9 }, -{ "fmovoq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDO,~0), "7,f,g", 0, v9 }, -{ "fmovoq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDO,~0), "8,f,g", 0, v9 }, -{ "fmovoq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDO,~0), "9,f,g", 0, v9 }, -{ "fmovos", F3F(2, 0x35, 0x081)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDO,~0), "6,f,g", 0, v9 }, -{ "fmovos", F3F(2, 0x35, 0x0a1)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDO,~0), "7,f,g", 0, v9 }, -{ "fmovos", F3F(2, 0x35, 0x0c1)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDO,~0), "8,f,g", 0, v9 }, -{ "fmovos", F3F(2, 0x35, 0x0e1)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDO,~0), "9,f,g", 0, v9 }, -{ "fmovposd", F3F(2, 0x35, 0x102)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDPOS,~0), "z,f,g", 0, v9 }, -{ "fmovposd", F3F(2, 0x35, 0x182)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDPOS,~0), "Z,f,g", 0, v9 }, -{ "fmovposq", F3F(2, 0x35, 0x103)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDPOS,~0), "z,f,g", 0, v9 }, -{ "fmovposq", F3F(2, 0x35, 0x183)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDPOS,~0), "Z,f,g", 0, v9 }, -{ "fmovposs", F3F(2, 0x35, 0x101)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDPOS,~0), "z,f,g", 0, v9 }, -{ "fmovposs", F3F(2, 0x35, 0x181)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDPOS,~0), "Z,f,g", 0, v9 }, -{ "fmovud", F3F(2, 0x35, 0x082)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDU,~0), "6,f,g", 0, v9 }, -{ "fmovud", F3F(2, 0x35, 0x0a2)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDU,~0), "7,f,g", 0, v9 }, -{ "fmovud", F3F(2, 0x35, 0x0c2)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDU,~0), "8,f,g", 0, v9 }, -{ "fmovud", F3F(2, 0x35, 0x0e2)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDU,~0), "9,f,g", 0, v9 }, -{ "fmovued", F3F(2, 0x35, 0x082)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDUE,~0), "6,f,g", 0, v9 }, -{ "fmovued", F3F(2, 0x35, 0x0a2)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDUE,~0), "7,f,g", 0, v9 }, -{ "fmovued", F3F(2, 0x35, 0x0c2)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDUE,~0), "8,f,g", 0, v9 }, -{ "fmovued", F3F(2, 0x35, 0x0e2)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDUE,~0), "9,f,g", 0, v9 }, -{ "fmovueq", F3F(2, 0x35, 0x083)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDUE,~0), "6,f,g", 0, v9 }, -{ "fmovueq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDUE,~0), "7,f,g", 0, v9 }, -{ "fmovueq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDUE,~0), "8,f,g", 0, v9 }, -{ "fmovueq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDUE,~0), "9,f,g", 0, v9 }, -{ "fmovues", F3F(2, 0x35, 0x081)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDUE,~0), "6,f,g", 0, v9 }, -{ "fmovues", F3F(2, 0x35, 0x0a1)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDUE,~0), "7,f,g", 0, v9 }, -{ "fmovues", F3F(2, 0x35, 0x0c1)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDUE,~0), "8,f,g", 0, v9 }, -{ "fmovues", F3F(2, 0x35, 0x0e1)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDUE,~0), "9,f,g", 0, v9 }, -{ "fmovugd", F3F(2, 0x35, 0x082)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDUG,~0), "6,f,g", 0, v9 }, -{ "fmovugd", F3F(2, 0x35, 0x0a2)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDUG,~0), "7,f,g", 0, v9 }, -{ "fmovugd", F3F(2, 0x35, 0x0c2)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDUG,~0), "8,f,g", 0, v9 }, -{ "fmovugd", F3F(2, 0x35, 0x0e2)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDUG,~0), "9,f,g", 0, v9 }, -{ "fmovuged", F3F(2, 0x35, 0x082)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDUGE,~0), "6,f,g", 0, v9 }, -{ "fmovuged", F3F(2, 0x35, 0x0a2)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDUGE,~0), "7,f,g", 0, v9 }, -{ "fmovuged", F3F(2, 0x35, 0x0c2)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDUGE,~0), "8,f,g", 0, v9 }, -{ "fmovuged", F3F(2, 0x35, 0x0e2)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDUGE,~0), "9,f,g", 0, v9 }, -{ "fmovugeq", F3F(2, 0x35, 0x083)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDUGE,~0), "6,f,g", 0, v9 }, -{ "fmovugeq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDUGE,~0), "7,f,g", 0, v9 }, -{ "fmovugeq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDUGE,~0), "8,f,g", 0, v9 }, -{ "fmovugeq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDUGE,~0), "9,f,g", 0, v9 }, -{ "fmovuges", F3F(2, 0x35, 0x081)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDUGE,~0), "6,f,g", 0, v9 }, -{ "fmovuges", F3F(2, 0x35, 0x0a1)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDUGE,~0), "7,f,g", 0, v9 }, -{ "fmovuges", F3F(2, 0x35, 0x0c1)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDUGE,~0), "8,f,g", 0, v9 }, -{ "fmovuges", F3F(2, 0x35, 0x0e1)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDUGE,~0), "9,f,g", 0, v9 }, -{ "fmovugq", F3F(2, 0x35, 0x083)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDUG,~0), "6,f,g", 0, v9 }, -{ "fmovugq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDUG,~0), "7,f,g", 0, v9 }, -{ "fmovugq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDUG,~0), "8,f,g", 0, v9 }, -{ "fmovugq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDUG,~0), "9,f,g", 0, v9 }, -{ "fmovugs", F3F(2, 0x35, 0x081)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDUG,~0), "6,f,g", 0, v9 }, -{ "fmovugs", F3F(2, 0x35, 0x0a1)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDUG,~0), "7,f,g", 0, v9 }, -{ "fmovugs", F3F(2, 0x35, 0x0c1)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDUG,~0), "8,f,g", 0, v9 }, -{ "fmovugs", F3F(2, 0x35, 0x0e1)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDUG,~0), "9,f,g", 0, v9 }, -{ "fmovuld", F3F(2, 0x35, 0x082)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDUL,~0), "6,f,g", 0, v9 }, -{ "fmovuld", F3F(2, 0x35, 0x0a2)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDUL,~0), "7,f,g", 0, v9 }, -{ "fmovuld", F3F(2, 0x35, 0x0c2)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDUL,~0), "8,f,g", 0, v9 }, -{ "fmovuld", F3F(2, 0x35, 0x0e2)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDUL,~0), "9,f,g", 0, v9 }, -{ "fmovuled", F3F(2, 0x35, 0x082)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDULE,~0), "6,f,g", 0, v9 }, -{ "fmovuled", F3F(2, 0x35, 0x0a2)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDULE,~0), "7,f,g", 0, v9 }, -{ "fmovuled", F3F(2, 0x35, 0x0c2)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDULE,~0), "8,f,g", 0, v9 }, -{ "fmovuled", F3F(2, 0x35, 0x0e2)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDULE,~0), "9,f,g", 0, v9 }, -{ "fmovuleq", F3F(2, 0x35, 0x083)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDULE,~0), "6,f,g", 0, v9 }, -{ "fmovuleq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDULE,~0), "7,f,g", 0, v9 }, -{ "fmovuleq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDULE,~0), "8,f,g", 0, v9 }, -{ "fmovuleq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDULE,~0), "9,f,g", 0, v9 }, -{ "fmovules", F3F(2, 0x35, 0x081)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDULE,~0), "6,f,g", 0, v9 }, -{ "fmovules", F3F(2, 0x35, 0x0a1)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDULE,~0), "7,f,g", 0, v9 }, -{ "fmovules", F3F(2, 0x35, 0x0c1)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDULE,~0), "8,f,g", 0, v9 }, -{ "fmovules", F3F(2, 0x35, 0x0e1)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDULE,~0), "9,f,g", 0, v9 }, -{ "fmovulq", F3F(2, 0x35, 0x083)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDUL,~0), "6,f,g", 0, v9 }, -{ "fmovulq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDUL,~0), "7,f,g", 0, v9 }, -{ "fmovulq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDUL,~0), "8,f,g", 0, v9 }, -{ "fmovulq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDUL,~0), "9,f,g", 0, v9 }, -{ "fmovuls", F3F(2, 0x35, 0x081)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDUL,~0), "6,f,g", 0, v9 }, -{ "fmovuls", F3F(2, 0x35, 0x0a1)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDUL,~0), "7,f,g", 0, v9 }, -{ "fmovuls", F3F(2, 0x35, 0x0c1)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDUL,~0), "8,f,g", 0, v9 }, -{ "fmovuls", F3F(2, 0x35, 0x0e1)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDUL,~0), "9,f,g", 0, v9 }, -{ "fmovuq", F3F(2, 0x35, 0x083)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDU,~0), "6,f,g", 0, v9 }, -{ "fmovuq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDU,~0), "7,f,g", 0, v9 }, -{ "fmovuq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDU,~0), "8,f,g", 0, v9 }, -{ "fmovuq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDU,~0), "9,f,g", 0, v9 }, -{ "fmovus", F3F(2, 0x35, 0x081)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDU,~0), "6,f,g", 0, v9 }, -{ "fmovus", F3F(2, 0x35, 0x0a1)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDU,~0), "7,f,g", 0, v9 }, -{ "fmovus", F3F(2, 0x35, 0x0c1)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDU,~0), "8,f,g", 0, v9 }, -{ "fmovus", F3F(2, 0x35, 0x0e1)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDU,~0), "9,f,g", 0, v9 }, -{ "fmovvcd", F3F(2, 0x35, 0x102)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDVC,~0), "z,f,g", 0, v9 }, -{ "fmovvcd", F3F(2, 0x35, 0x182)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDVC,~0), "Z,f,g", 0, v9 }, -{ "fmovvcq", F3F(2, 0x35, 0x103)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDVC,~0), "z,f,g", 0, v9 }, -{ "fmovvcq", F3F(2, 0x35, 0x183)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDVC,~0), "Z,f,g", 0, v9 }, -{ "fmovvcs", F3F(2, 0x35, 0x101)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDVC,~0), "z,f,g", 0, v9 }, -{ "fmovvcs", F3F(2, 0x35, 0x181)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDVC,~0), "Z,f,g", 0, v9 }, -{ "fmovvsd", F3F(2, 0x35, 0x102)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDVS,~0), "z,f,g", 0, v9 }, -{ "fmovvsd", F3F(2, 0x35, 0x182)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDVS,~0), "Z,f,g", 0, v9 }, -{ "fmovvsq", F3F(2, 0x35, 0x103)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDVS,~0), "z,f,g", 0, v9 }, -{ "fmovvsq", F3F(2, 0x35, 0x183)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDVS,~0), "Z,f,g", 0, v9 }, -{ "fmovvss", F3F(2, 0x35, 0x101)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDVS,~0), "z,f,g", 0, v9 }, -{ "fmovvss", F3F(2, 0x35, 0x181)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDVS,~0), "Z,f,g", 0, v9 }, -{ "fmovzd", F3F(2, 0x35, 0x102)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovzd", F3F(2, 0x35, 0x082)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovzd", F3F(2, 0x35, 0x182)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovzd", F3F(2, 0x35, 0x0a2)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovzd", F3F(2, 0x35, 0x0c2)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovzd", F3F(2, 0x35, 0x0e2)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovzq", F3F(2, 0x35, 0x103)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovzq", F3F(2, 0x35, 0x083)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovzq", F3F(2, 0x35, 0x183)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovzq", F3F(2, 0x35, 0x0a3)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovzq", F3F(2, 0x35, 0x0c3)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovzq", F3F(2, 0x35, 0x0e3)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovzs", F3F(2, 0x35, 0x101)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovzs", F3F(2, 0x35, 0x081)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovzs", F3F(2, 0x35, 0x181)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovzs", F3F(2, 0x35, 0x0a1)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovzs", F3F(2, 0x35, 0x0c1)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovzs", F3F(2, 0x35, 0x0e1)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDZ,~0), "9,f,g", F_ALIAS, v9 }, - -#define brfc(opcode, mask, lose, flags) \ - { opcode, (mask), ANNUL|(lose), "l", flags|F_DELAYED, v6 }, \ - { opcode, (mask)|ANNUL, (lose), ",a l", flags|F_DELAYED, v6 } - -#define brfcx(opcode, mask, lose, flags) /* v9 */ \ - { opcode, FBFCC(0)|(mask), ANNUL|BPRED|FBFCC(~0)|(lose), "6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask)|ANNUL, BPRED|FBFCC(~0)|(lose), ",a 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask), ANNUL|BPRED|FBFCC(~0)|(lose), ",N 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask)|ANNUL, BPRED|FBFCC(~0)|(lose), ",a,N 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask)|BPRED, ANNUL|FBFCC(~0)|(lose), ",T 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask)|BPRED|ANNUL, FBFCC(~0)|(lose), ",a,T 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask), ANNUL|BPRED|FBFCC(~1)|(lose), "7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask)|ANNUL, BPRED|FBFCC(~1)|(lose), ",a 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask), ANNUL|BPRED|FBFCC(~1)|(lose), ",N 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask)|ANNUL, BPRED|FBFCC(~1)|(lose), ",a,N 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask)|BPRED, ANNUL|FBFCC(~1)|(lose), ",T 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask)|BPRED|ANNUL, FBFCC(~1)|(lose), ",a,T 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask), ANNUL|BPRED|FBFCC(~2)|(lose), "8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask)|ANNUL, BPRED|FBFCC(~2)|(lose), ",a 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask), ANNUL|BPRED|FBFCC(~2)|(lose), ",N 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask)|ANNUL, BPRED|FBFCC(~2)|(lose), ",a,N 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask)|BPRED, ANNUL|FBFCC(~2)|(lose), ",T 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask)|BPRED|ANNUL, FBFCC(~2)|(lose), ",a,T 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask), ANNUL|BPRED|FBFCC(~3)|(lose), "9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask)|ANNUL, BPRED|FBFCC(~3)|(lose), ",a 9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask), ANNUL|BPRED|FBFCC(~3)|(lose), ",N 9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask)|ANNUL, BPRED|FBFCC(~3)|(lose), ",a,N 9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask)|BPRED, ANNUL|FBFCC(~3)|(lose), ",T 9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask)|BPRED|ANNUL, FBFCC(~3)|(lose), ",a,T 9,G", flags|F_DELAYED, v9 } - -#define condfc(fop, cop, mask, flags) \ - brfc(fop, F2(0, 6)|COND(mask), F2(~0, ~6)|COND(~(mask)), flags), \ - brfcx(fop, F2(0, 5)|COND(mask), F2(~0, ~5)|COND(~(mask)), flags), /* v9 */ \ - brfc(cop, F2(0, 7)|COND(mask), F2(~0, ~7)|COND(~(mask)), flags) \ - -condfc("fb", "cb", 0x8, 0), -condfc("fba", "cba", 0x8, F_ALIAS), -condfc("fbe", "cb0", 0x9, 0), -condfc("fbg", "cb2", 0x6, 0), -condfc("fbge", "cb02", 0xb, 0), -condfc("fbl", "cb1", 0x4, 0), -condfc("fble", "cb01", 0xd, 0), -condfc("fblg", "cb12", 0x2, 0), -condfc("fbn", "cbn", 0x0, 0), -condfc("fbne", "cb123", 0x1, 0), -condfc("fbo", "cb012", 0xf, 0), -condfc("fbu", "cb3", 0x7, 0), -condfc("fbue", "cb03", 0xa, 0), -condfc("fbug", "cb23", 0x5, 0), -condfc("fbuge", "cb023", 0xc, 0), -condfc("fbul", "cb13", 0x3, 0), -condfc("fbule", "cb013", 0xe, 0), - -#undef condfc -#undef brfc - -{ "jmp", F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|RD_G0|ASI(~0), "1+2", F_DELAYED, v6 }, /* jmpl rs1+rs2,%g0 */ -{ "jmp", F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|RD_G0|ASI_RS2(~0), "1", F_DELAYED, v6 }, /* jmpl rs1+%g0,%g0 */ -{ "jmp", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0, "1+i", F_DELAYED, v6 }, /* jmpl rs1+i,%g0 */ -{ "jmp", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0, "i+1", F_DELAYED, v6 }, /* jmpl i+rs1,%g0 */ -{ "jmp", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0|RS1_G0, "i", F_DELAYED, v6 }, /* jmpl %g0+i,%g0 */ - -{ "nop", F2(0, 4), 0xfeffffff, "", 0, v6 }, /* sethi 0, %g0 */ - -{ "set", F2(0x0, 0x4), F2(~0x0, ~0x4), "Sh,d", F_ALIAS, v6 }, - -{ "sethi", F2(0x0, 0x4), F2(~0x0, ~0x4), "h,d", 0, v6 }, - -{ "taddcc", F3(2, 0x20, 0), F3(~2, ~0x20, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "taddcc", F3(2, 0x20, 1), F3(~2, ~0x20, ~1), "1,i,d", 0, v6 }, -{ "taddcc", F3(2, 0x20, 1), F3(~2, ~0x20, ~1), "i,1,d", 0, v6 }, -{ "taddcctv", F3(2, 0x22, 0), F3(~2, ~0x22, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "taddcctv", F3(2, 0x22, 1), F3(~2, ~0x22, ~1), "1,i,d", 0, v6 }, -{ "taddcctv", F3(2, 0x22, 1), F3(~2, ~0x22, ~1), "i,1,d", 0, v6 }, - -{ "tsubcc", F3(2, 0x21, 0), F3(~2, ~0x21, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "tsubcc", F3(2, 0x21, 1), F3(~2, ~0x21, ~1), "1,i,d", 0, v6 }, -{ "tsubcctv", F3(2, 0x23, 0), F3(~2, ~0x23, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "tsubcctv", F3(2, 0x23, 1), F3(~2, ~0x23, ~1), "1,i,d", 0, v6 }, - -/* These two are identical, except in name (v9). */ -{ "unimp", F2(0x0, 0x0), 0xffc00000, "n", 0, v6 }, -{ "illegal", F2(0, 0), F2(~0, ~0), "n", 0, v9 }, - -{ "iflush", F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI(~0), "1+2", 0, v6 }, -{ "iflush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1), "1+i", 0, v6 }, -{ "iflush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1), "i+1", 0, v6 }, -{ "iflush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|RS1_G0, "i", 0, v6 }, - -{ "xnor", F3(2, 0x07, 0), F3(~2, ~0x07, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "xnor", F3(2, 0x07, 1), F3(~2, ~0x07, ~1), "1,i,d", 0, v6 }, -{ "xnor", F3(2, 0x07, 1), F3(~2, ~0x07, ~1), "i,1,d", 0, v6 }, -{ "xnorcc", F3(2, 0x17, 0), F3(~2, ~0x17, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "xnorcc", F3(2, 0x17, 1), F3(~2, ~0x17, ~1), "1,i,d", 0, v6 }, -{ "xnorcc", F3(2, 0x17, 1), F3(~2, ~0x17, ~1), "i,1,d", 0, v6 }, -{ "xor", F3(2, 0x03, 0), F3(~2, ~0x03, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "xor", F3(2, 0x03, 1), F3(~2, ~0x03, ~1), "1,i,d", 0, v6 }, -{ "xor", F3(2, 0x03, 1), F3(~2, ~0x03, ~1), "i,1,d", 0, v6 }, -{ "xorcc", F3(2, 0x13, 0), F3(~2, ~0x13, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "xorcc", F3(2, 0x13, 1), F3(~2, ~0x13, ~1), "1,i,d", 0, v6 }, -{ "xorcc", F3(2, 0x13, 1), F3(~2, ~0x13, ~1), "i,1,d", 0, v6 }, - -{ "not", F3(2, 0x07, 0), F3(~2, ~0x07, ~0)|ASI(~0), "1,d", F_ALIAS, v6 }, /* xnor rs1,%0,rd */ -{ "not", F3(2, 0x07, 0), F3(~2, ~0x07, ~0)|ASI(~0), "r", F_ALIAS, v6 }, /* xnor rd,%0,rd */ - -{ "btog", F3(2, 0x03, 0), F3(~2, ~0x03, ~0)|ASI(~0), "2,r", F_ALIAS, v6 }, /* xor rd,rs2,rd */ -{ "btog", F3(2, 0x03, 1), F3(~2, ~0x03, ~1), "i,r", F_ALIAS, v6 }, /* xor rd,i,rd */ - -{ "fpop1", F3F(2, 0x34, 0), F3F(~2, ~0x34, ~1), "[1+2],d", 0, v6 }, -{ "fpop2", F3F(2, 0x35, 0), F3F(~2, ~0x35, ~1), "[1+2],d", 0, v6 }, - -/* float-start */ -{ "fdtoi", F3F(2, 0x34, 0x0d2), F3F(~2, ~0x34, ~0x0d2)|RS1_G0, "B,g", 0, v6 }, -{ "fstoi", F3F(2, 0x34, 0x0d1), F3F(~2, ~0x34, ~0x0d1)|RS1_G0, "f,g", 0, v6 }, - - /* all of these conversions are confused and probably wrong. */ -{ "fitod", F3F(2, 0x34, 0x0c8), F3F(~2, ~0x34, ~0x0c8)|RS1_G0, "f,H", 0, v6 }, -{ "fitos", F3F(2, 0x34, 0x0c4), F3F(~2, ~0x34, ~0x0c4)|RS1_G0, "f,g", 0, v6 }, - -{ "fitoq", F3F(2, 0x34, 0x0cc), F3F(~2, ~0x34, ~0x0cc)|RS1_G0, "f,J", 0, v8 }, - -{ "fxtoq", F3F(2, 0x34, 0x08c), F3F(~2, ~0x34, ~0x08c)|RS1_G0, "f,J", 0, v9 }, - -{ "fdtoq", F3F(2, 0x34, 0x0ce), F3F(~2, ~0x34, ~0x0ce)|RS1_G0, "B,J", 0, v8 }, -{ "fdtos", F3F(2, 0x34, 0x0c6), F3F(~2, ~0x34, ~0x0c6)|RS1_G0, "B,g", 0, v6 }, -{ "fqtod", F3F(2, 0x34, 0x0cb), F3F(~2, ~0x34, ~0x0cb)|RS1_G0, "R,H", 0, v8 }, -{ "fqtos", F3F(2, 0x34, 0x0c7), F3F(~2, ~0x34, ~0x0c7)|RS1_G0, "R,g", 0, v8 }, -{ "fstod", F3F(2, 0x34, 0x0c9), F3F(~2, ~0x34, ~0x0c9)|RS1_G0, "f,H", 0, v6 }, -{ "fstoq", F3F(2, 0x34, 0x0cd), F3F(~2, ~0x34, ~0x0cd)|RS1_G0, "f,J", 0, v8 }, - -{ "fqtox", F3F(2, 0x34, 0x083), F3F(~2, ~0x34, ~0x083)|RS1_G0, "R,g", 0, v9 }, - -{ "fxtos", F3F(2, 0x34, 0x084), F3F(~2, ~0x34, ~0x084)|RS1_G0, "f,g", 0, v9 }, - -{ "fdtox", F3F(2, 0x34, 0x082), F3F(~2, ~0x34, ~0x082)|RS1_G0, "B,g", 0, v9 }, - -{ "fstox", F3F(2, 0x34, 0x081), F3F(~2, ~0x34, ~0x081)|RS1_G0, "f,g", 0, v9 }, - -{ "fqtoi", F3F(2, 0x34, 0x0d3), F3F(~2, ~0x34, ~0x0d3)|RS1_G0, "R,g", 0, v8 }, - -{ "fxtod", F3F(2, 0x34, 0x088), F3F(~2, ~0x34, ~0x088)|RS1_G0, "f,H", 0, v9 }, - -{ "fdivd", F3F(2, 0x34, 0x04e), F3F(~2, ~0x34, ~0x04e), "v,B,H", 0, v6 }, -{ "fdivq", F3F(2, 0x34, 0x04f), F3F(~2, ~0x34, ~0x04f), "V,R,J", 0, v8 }, -{ "fdivs", F3F(2, 0x34, 0x04d), F3F(~2, ~0x34, ~0x04d), "e,f,g", 0, v6 }, -{ "fmuld", F3F(2, 0x34, 0x04a), F3F(~2, ~0x34, ~0x04a), "v,B,H", 0, v6 }, -{ "fmulq", F3F(2, 0x34, 0x04b), F3F(~2, ~0x34, ~0x04b), "V,R,J", 0, v8 }, -{ "fmuls", F3F(2, 0x34, 0x049), F3F(~2, ~0x34, ~0x049), "e,f,g", 0, v6 }, - -{ "fdmulq", F3F(2, 0x34, 0x06e), F3F(~2, ~0x34, ~0x06e), "v,B,J", 0, v8 }, -{ "fsmuld", F3F(2, 0x34, 0x069), F3F(~2, ~0x34, ~0x069), "e,f,H", 0, v8 }, - -{ "fsqrtd", F3F(2, 0x34, 0x02a), F3F(~2, ~0x34, ~0x02a)|RS1_G0, "B,H", 0, v7 }, -{ "fsqrtq", F3F(2, 0x34, 0x02b), F3F(~2, ~0x34, ~0x02b)|RS1_G0, "R,J", 0, v8 }, -{ "fsqrts", F3F(2, 0x34, 0x029), F3F(~2, ~0x34, ~0x029)|RS1_G0, "f,g", 0, v7 }, - -{ "fabsd", F3F(2, 0x34, 0x00a), F3F(~2, ~0x34, ~0x00a)|RS1_G0, "B,H", 0, v9 }, -{ "fabsq", F3F(2, 0x34, 0x00b), F3F(~2, ~0x34, ~0x00b)|RS1_G0, "R,J", 0, v6 }, -{ "fabss", F3F(2, 0x34, 0x009), F3F(~2, ~0x34, ~0x009)|RS1_G0, "f,g", 0, v6 }, -{ "fmovd", F3F(2, 0x34, 0x002), F3F(~2, ~0x34, ~0x002)|RS1_G0, "B,H", 0, v9 }, -{ "fmovq", F3F(2, 0x34, 0x003), F3F(~2, ~0x34, ~0x003)|RS1_G0, "R,J", 0, v6 }, -{ "fmovs", F3F(2, 0x34, 0x001), F3F(~2, ~0x34, ~0x001)|RS1_G0, "f,g", 0, v6 }, -{ "fnegd", F3F(2, 0x34, 0x006), F3F(~2, ~0x34, ~0x006)|RS1_G0, "B,H", 0, v9 }, -{ "fnegq", F3F(2, 0x34, 0x007), F3F(~2, ~0x34, ~0x007)|RS1_G0, "R,J", 0, v6 }, -{ "fnegs", F3F(2, 0x34, 0x005), F3F(~2, ~0x34, ~0x005)|RS1_G0, "f,g", 0, v6 }, - -{ "popc", F3(2, 0x2d, 0), F3(~2, ~0x2d, ~0)|(0x3fff<<5), "2,d", 0, v9 }, - -{ "faddd", F3F(2, 0x34, 0x042), F3F(~2, ~0x34, ~0x042), "v,B,H", 0, v6 }, -{ "faddq", F3F(2, 0x34, 0x043), F3F(~2, ~0x34, ~0x043), "V,R,J", 0, v8 }, -{ "fadds", F3F(2, 0x34, 0x041), F3F(~2, ~0x34, ~0x041), "e,f,g", 0, v6 }, -{ "fsubd", F3F(2, 0x34, 0x046), F3F(~2, ~0x34, ~0x046), "v,B,H", 0, v6 }, -{ "fsubq", F3F(2, 0x34, 0x047), F3F(~2, ~0x34, ~0x047), "V,R,J", 0, v8 }, -{ "fsubs", F3F(2, 0x34, 0x045), F3F(~2, ~0x34, ~0x045), "e,f,g", 0, v6 }, - -#define CMPFCC(x) (((x)&0x3)<<25) - -{ "fcmpd", F3F(2, 0x35, 0x052), F3F(~2, ~0x35, ~0x052)|RS1_G0, "v,B", 0, v6 }, -{ "fcmpd", CMPFCC(0)|F3F(2, 0x35, 0x052), CMPFCC(~0)|F3F(~2, ~0x35, ~0x052), "6,v,B", 0, v9 }, -{ "fcmpd", CMPFCC(1)|F3F(2, 0x35, 0x052), CMPFCC(~1)|F3F(~2, ~0x35, ~0x052), "7,v,B", 0, v9 }, -{ "fcmpd", CMPFCC(2)|F3F(2, 0x35, 0x052), CMPFCC(~2)|F3F(~2, ~0x35, ~0x052), "8,v,B", 0, v9 }, -{ "fcmpd", CMPFCC(3)|F3F(2, 0x35, 0x052), CMPFCC(~3)|F3F(~2, ~0x35, ~0x052), "9,v,B", 0, v9 }, -{ "fcmped", F3F(2, 0x35, 0x056), F3F(~2, ~0x35, ~0x056)|RS1_G0, "v,B", 0, v6 }, -{ "fcmped", CMPFCC(0)|F3F(2, 0x35, 0x056), CMPFCC(~0)|F3F(~2, ~0x35, ~0x056), "6,v,B", 0, v9 }, -{ "fcmped", CMPFCC(1)|F3F(2, 0x35, 0x056), CMPFCC(~1)|F3F(~2, ~0x35, ~0x056), "7,v,B", 0, v9 }, -{ "fcmped", CMPFCC(2)|F3F(2, 0x35, 0x056), CMPFCC(~2)|F3F(~2, ~0x35, ~0x056), "8,v,B", 0, v9 }, -{ "fcmped", CMPFCC(3)|F3F(2, 0x35, 0x056), CMPFCC(~3)|F3F(~2, ~0x35, ~0x056), "9,v,B", 0, v9 }, -{ "fcmpeq", F3F(2, 0x34, 0x057), F3F(~2, ~0x34, ~0x057), "V,R", 0, v8 }, -{ "fcmpeq", CMPFCC(0)|F3F(2, 0x35, 0x057), CMPFCC(~0)|F3F(~2, ~0x35, ~0x057), "6,V,R", 0, v9 }, -{ "fcmpeq", CMPFCC(1)|F3F(2, 0x35, 0x057), CMPFCC(~1)|F3F(~2, ~0x35, ~0x057), "7,V,R", 0, v9 }, -{ "fcmpeq", CMPFCC(2)|F3F(2, 0x35, 0x057), CMPFCC(~2)|F3F(~2, ~0x35, ~0x057), "8,V,R", 0, v9 }, -{ "fcmpeq", CMPFCC(3)|F3F(2, 0x35, 0x057), CMPFCC(~3)|F3F(~2, ~0x35, ~0x057), "9,V,R", 0, v9 }, -{ "fcmpes", F3F(2, 0x35, 0x055), F3F(~2, ~0x35, ~0x055)|RS1_G0, "e,f", 0, v6 }, -{ "fcmpes", CMPFCC(0)|F3F(2, 0x35, 0x055), CMPFCC(~0)|F3F(~2, ~0x35, ~0x055), "6,e,f", 0, v9 }, -{ "fcmpes", CMPFCC(1)|F3F(2, 0x35, 0x055), CMPFCC(~1)|F3F(~2, ~0x35, ~0x055), "7,e,f", 0, v9 }, -{ "fcmpes", CMPFCC(2)|F3F(2, 0x35, 0x055), CMPFCC(~2)|F3F(~2, ~0x35, ~0x055), "8,e,f", 0, v9 }, -{ "fcmpes", CMPFCC(3)|F3F(2, 0x35, 0x055), CMPFCC(~3)|F3F(~2, ~0x35, ~0x055), "9,e,f", 0, v9 }, -{ "fcmpq", F3F(2, 0x34, 0x053), F3F(~2, ~0x34, ~0x053), "V,R", 0, v8 }, -{ "fcmpq", CMPFCC(0)|F3F(2, 0x35, 0x053), CMPFCC(~0)|F3F(~2, ~0x35, ~0x053), "6,V,R", 0, v9 }, -{ "fcmpq", CMPFCC(1)|F3F(2, 0x35, 0x053), CMPFCC(~1)|F3F(~2, ~0x35, ~0x053), "7,V,R", 0, v9 }, -{ "fcmpq", CMPFCC(2)|F3F(2, 0x35, 0x053), CMPFCC(~2)|F3F(~2, ~0x35, ~0x053), "8,V,R", 0, v9 }, -{ "fcmpq", CMPFCC(3)|F3F(2, 0x35, 0x053), CMPFCC(~3)|F3F(~2, ~0x35, ~0x053), "9,V,R", 0, v9 }, -{ "fcmps", F3F(2, 0x35, 0x051), F3F(~2, ~0x35, ~0x051)|RS1_G0, "e,f", 0, v6 }, -{ "fcmps", CMPFCC(0)|F3F(2, 0x35, 0x051), CMPFCC(~0)|F3F(~2, ~0x35, ~0x051), "6,e,f", 0, v9 }, -{ "fcmps", CMPFCC(1)|F3F(2, 0x35, 0x051), CMPFCC(~1)|F3F(~2, ~0x35, ~0x051), "7,e,f", 0, v9 }, -{ "fcmps", CMPFCC(2)|F3F(2, 0x35, 0x051), CMPFCC(~2)|F3F(~2, ~0x35, ~0x051), "8,e,f", 0, v9 }, -{ "fcmps", CMPFCC(3)|F3F(2, 0x35, 0x051), CMPFCC(~3)|F3F(~2, ~0x35, ~0x051), "9,e,f", 0, v9 }, - -/* IMPDEP* is a v9 replacement for cpop*. */ -{ "cpop1", F3(2, 0x36, 0), F3(~2, ~0x36, ~1), "[1+2],d", 0, v6 }, -{ "cpop2", F3(2, 0x37, 0), F3(~2, ~0x37, ~1), "[1+2],d", 0, v6 }, -{ "impdep1", F3(2, 0x36, 0), F3(~2, ~0x36, ~1), "[1+2],d", F_ALIAS, v9 }, -{ "impdep2", F3(2, 0x37, 0), F3(~2, ~0x37, ~1), "[1+2],d", F_ALIAS, v9 }, - -{ "casx", F3(3, 0x0c, 1), F3(~3, ~0x0c, ~1), "[1],2,d", 0, v9 }, -{ "casxa", F3(3, 0x1c, 1), F3(~3, ~0x1c, ~1), "[1]A,2,d", 0, v9 }, -{ "cas", F3(3, 0x0c, 0), F3(~3, ~0x0c, ~0), "[1],2,d", 0, v9 }, -{ "casa", F3(3, 0x1c, 0), F3(~3, ~0x1c, ~0), "[1]A,2,d", 0, v9 }, - -{ "fmaddd", F3(2, 0x35, 0)|OPF_LOW(0xa), F3(~2, ~0x35, ~0)|OPF_LOW(~0xa), "v,B,u,H", 0, v9 }, -{ "fmaddq", F3(2, 0x35, 0)|OPF_LOW(0xb), F3(~2, ~0x35, ~0)|OPF_LOW(~0xb), "V,R,U,J", 0, v9 }, -{ "fmadds", F3(2, 0x35, 0)|OPF_LOW(0x9), F3(~2, ~0x35, ~0)|OPF_LOW(~0x9), "e,f,j,g", 0, v9 }, -{ "fmsubd", F3(2, 0x35, 0)|OPF_LOW(0xe), F3(~2, ~0x35, ~0)|OPF_LOW(~0xe), "v,B,u,H", 0, v9 }, -{ "fmsubq", F3(2, 0x35, 0)|OPF_LOW(0xf), F3(~2, ~0x35, ~0)|OPF_LOW(~0xf), "V,R,U,J", 0, v9 }, -{ "fmsubs", F3(2, 0x35, 0)|OPF_LOW(0xd), F3(~2, ~0x35, ~0)|OPF_LOW(~0xd), "e,f,j,g", 0, v9 }, - -}; - -const int bfd_sparc_num_opcodes = ((sizeof sparc_opcodes)/(sizeof sparc_opcodes[0])); diff --git a/bfd/scanit b/bfd/scanit deleted file mode 100755 index 27eee02082..0000000000 --- a/bfd/scanit +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# Script to coordinate parsing of S. Chamberlain source-embedded -# documentation markup language. - -# Four passes: -# 1) awk discards lines not intended for docn, and marks blocks of -# text with comments identifying source file; -# 2) first sed pass interprets Chamberlain markup; -# 3) second sed pass does cleanup that involves merging lines -# 4) third sed pass does remaining cleans up---making {} -# printable within examples, and eliminating empty index entries and -# headings. -#Third and second sed passes are separate because order of execution is hard -#to control otherwise, making one or another of the things involving @example -#inoperative. - -base=`echo $1 | cut -d '.' -f 1` - -awk -f awkscan $1 | \ -sed -f sedscript | \ -sed -f unPROTO | \ -sed -f exmerge | \ -sed -f exfilter >$base.texi - diff --git a/bfd/scanph b/bfd/scanph deleted file mode 100755 index 46912c3635..0000000000 --- a/bfd/scanph +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# Script to coordinate parsing of S. Chamberlain source-embedded -# header-file markup language. - -# '-i' option means use *proto-internal* segments, else just *proto* -SFX=p -if [ $1 = "-i" ]; then - SFX=ip - shift -fi - -base=`echo $1 | cut -d '.' -f 1` - -# passes: -# 1) awk discards lines not intended for header, and marks blocks of -# text with comments identifying source file; -# 2) first sed pass interprets Chamberlain markup; -# 3) further sed passes clean up---merging adjacent comments etc. - -awk -f awkscan-$SFX $1 |\ -sed -f sedscript-p |\ -sed -f mergecom-p |\ -sed -f startcom-p |\ -sed -f blins-p |\ -sed -f movecom-p >$base.$SFX diff --git a/bfd/sedscript b/bfd/sedscript deleted file mode 100755 index e8e225daec..0000000000 --- a/bfd/sedscript +++ /dev/null @@ -1,85 +0,0 @@ -# SED script for preprocessing embedded doc from source (S. Chamberlain markup) -# middle pass; most of the work is done here. -# -# First, get rid of /*doc* markers; they've done their job in the first pass. -/^\/\*doc\*/d -# -# /*proto* markers may be optionally followed by a *i-style subsubsec, findex -# entry. This will generate empty @findex and @subsubsection entries if -# the *proto* is on a line by itself; third pass removes them. -/^\/\*proto\*/s/^\/\*proto\* *\(.*\)$/@findex \1\ -@subsubsection @code{\1}/ -# -# /*proto-internal* is just like /*proto* from doc point of view. -/^\/\*proto-internal\*/s/^\/\*proto-internal\* *\(.*\)$/@findex \1\ -@subsubsection @code{\1}/ -# -# *i at beginning of line: rest of line is both a subsubsection heading -# and an entry in function index. -/^\*i/s/^\*i *\(.*\)$/@findex \1\ -@subsubsection @code{\1}/ -# -# Two alternative docn block ends, '*/' and '*-*/' on lines by themselves; -# replace by blank lines (for texinfo source readability). -/^\*\/$/c\ - -/^\*-\*\/$/c\ - -# {* and *} are standins for comment markers (originally embedded in .c -# comments)---turn into real comment markers: -s/{\*/\/\*/ -s/\*}/\*\// -# -# '*+++' and '*---' span a block of text that includes both example lines -# (marked by leading '$') and explanatory text (to be italicized). -# Italicize lines lacking '$': -/\*\+\+\+/,/\*---/s/^\([^$].*\)$/@i{\1}/ -# -# We don't need *+++ and *--- markers any more; kill them (trailing marker -# becomes blank line for readability) -/\*\+\+\+/d -/\*---/c\ - -# Any line beginning with '$' is made an example line; third pass later -# coalesces adjacent example blocks. *DO NOT* introduce extra space after -# @end example, so we can spot adjacent ones in third pass. -/^\$/i\ -@example -/^\$/a\ -@end example -# -# In any example line, turn '{' and '}' into '@{' and '@}' -###/^\$/s/{/@{/g -###/^\$/s/}/@}/g -# -# Now delete the '$' markers themselves: -/^\$/s/\$// -# -# *+ and *- delimit large examples to be enclosed in cartouches. -/^\*\+$/c\ -@lisp\ -@cartouche -/^\*-$/c\ -@end cartouche\ -@end lisp\ - -# '*;' introduces an example which may have a single line or multiple lines; -# it extends until the next semicolon (which is also printed). -# One-line case: (do this first; else second line address for multi-line case -# will include random text til we happen to end a line in a doc comment with -# a semicolon) -/^\*;.*;$/{ -s/^\*;/@example\ -/ -s/;$/;\ -@end example\ -/ -} -# Multi-line case: -/^\*;/,/.*;$/{ -s/^\*;/@example\ -/ -s/;$/;\ -@end example\ -/ -} diff --git a/bfd/sedscript-p b/bfd/sedscript-p deleted file mode 100755 index 1f24900b4c..0000000000 --- a/bfd/sedscript-p +++ /dev/null @@ -1,63 +0,0 @@ -# SED script for preprocessing embedded headers from source -# (S. Chamberlain markup) -# middle pass; most of the work is done here. -# -# First, get rid of /*proto* markers; they've done their job in the first pass. -# (They remain comment-introducers) -/^\/\*proto\*/s/^\/\*proto\*/\/*/ -/^\/\*proto-internal\*/s/^\/\*proto-internal\*/\/*/ -# -# *-*/ is an alternative (older) comment-block end. Remap for uniformity: -s/^\*-\*\//\*\// -# -# {* and *} are standins for comment markers (originally embedded in .c -# comments)---turn into real comment markers: -s/{\*/\/\*/ -s/\*}/\*\// -# -# '*+++' and '*---' span a block of text that includes both header lines -# (marked by leading '$') and explanatory text (to be comments). -# No need to start comment at "*+++", or end it at "*---", since we're -# already in a *proto* comment block. Just delete. -/\*\+\+\+/d -/\*---/d -# -# Any line beginning with '$' is made a line of code in the header; -# stuff in between is comments, so *precede* each '$' line with -# END-comment, *follow* each '$' line with START-comment; third pass later -# eliminates empty comment blocks. -/^\$/i\ -*/ -/^\$/a\ -/* -# -# Now delete the '$' markers themselves: -/^\$/s/\$// -# -# *+ and *- delimit larger blocks of code, treated the same as '$' lines -/^\*\+$/c\ -*/ -/^\*-$/c\ -/* -# -# '*;' introduces code which may have a single line or multiple lines; -# it extends until the next semicolon (which is also printed). -# -# One-line case: (do this first; else second line address for multi-line case -# will include random text til we happen to end a line in a proto comment with -# a semicolon) -/^\*;.*;$/{ -s/^\*;/*\/\ -/ -s/;$/;\ -\/*\ -/ -} -# Multi-line case: -/^\*;/,/.*;$/{ -s/^\*;/*\/\ -/ -s/;$/;\ -\/*\ -/ -} diff --git a/bfd/sparc-opc.c b/bfd/sparc-opc.c deleted file mode 100644 index 86405f133c..0000000000 --- a/bfd/sparc-opc.c +++ /dev/null @@ -1,1870 +0,0 @@ -/* to sanitize this file, grep -v v9 < sparc.h > clean-sparc.h */ - -/* Table of opcodes for the sparc. - Copyright 1989, 1991, 1992 Free Software Foundation, Inc. - -This file is part of the BFD library. - -BFD is free software; you can 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. - -BFD is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR 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 software; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* FIXME-someday: perhaps the ,a's and such should be embedded in the - instruction's name rather than the args. This would make gas faster, pinsn - slower, but would mess up some macros a bit. xoxorich. */ - -#include -#include "ansidecl.h" -#define BFD_EMIT_TABLE -#include "opcode/sparc.h" - -const char *architecture_pname[] = { - "v6", - "v7", - "v8", - "sparclite", - "v9", - NULL, -}; - -/* v9: This file is correct for SPARC Version 9 Draft 1.0.4. */ - -#define COND(x) (((x)&0xf)<<25) -#define MCOND(x,i_or_f) ((((i_or_f)&1)<<18)|(((x)>>11)&(0xf<<14))) /* v9 */ - -#define CONDA (COND(0x8)) -#define CONDCC (COND(0xd)) -#define CONDCS (COND(0x5)) -#define CONDE (COND(0x1)) -#define CONDG (COND(0xa)) -#define CONDGE (COND(0xb)) -#define CONDGU (COND(0xc)) -#define CONDL (COND(0x3)) -#define CONDLE (COND(0x2)) -#define CONDLEU (COND(0x4)) -#define CONDN (COND(0x0)) -#define CONDNE (COND(0x9)) -#define CONDNEG (COND(0x6)) -#define CONDPOS (COND(0xe)) -#define CONDVC (COND(0xf)) -#define CONDVS (COND(0x7)) - -#define CONDNZ CONDNE -#define CONDZ CONDE -#define CONDGEU CONDCC -#define CONDLU CONDCS - -#define FCONDA (COND(0x8)) -#define FCONDE (COND(0x9)) -#define FCONDG (COND(0x6)) -#define FCONDGE (COND(0xb)) -#define FCONDL (COND(0x4)) -#define FCONDLE (COND(0xd)) -#define FCONDLG (COND(0x2)) -#define FCONDN (COND(0x0)) -#define FCONDNE (COND(0x1)) -#define FCONDO (COND(0xf)) -#define FCONDU (COND(0x7)) -#define FCONDUE (COND(0xa)) -#define FCONDUG (COND(0x5)) -#define FCONDUGE (COND(0xc)) -#define FCONDUL (COND(0x3)) -#define FCONDULE (COND(0xe)) - -#define FCONDNZ FCONDNE -#define FCONDZ FCONDE - -#define ICC (0) /* v9 */ -#define XCC (1<<11) /* v9 */ -#define FCC(x) (((x)&0x3)<<11) /* v9 */ -#define FBFCC(x) (((x)&0x3)<<20) /* v9 */ - -/* The order of the opcodes in the 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. - -*/ - -struct sparc_opcode sparc_opcodes[] = { - -{ "ld", F3(3, 0x00, 0), F3(~3, ~0x00, ~0), "[1+2],d", 0, v6 }, -{ "ld", F3(3, 0x00, 0), F3(~3, ~0x00, ~0)|RS2_G0, "[1],d", 0, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[1+i],d", 0, v6 }, -{ "ld", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[i+1],d", 0, v6 }, -{ "ld", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ld", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ld [rs1+0],d */ -{ "ld", F3(3, 0x20, 0), F3(~3, ~0x20, ~0), "[1+2],g", 0, v6 }, -{ "ld", F3(3, 0x20, 0), F3(~3, ~0x20, ~0)|RS2_G0, "[1],g", 0, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x20, 1), F3(~3, ~0x20, ~1), "[1+i],g", 0, v6 }, -{ "ld", F3(3, 0x20, 1), F3(~3, ~0x20, ~1), "[i+1],g", 0, v6 }, -{ "ld", F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|RS1_G0, "[i],g", 0, v6 }, -{ "ld", F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|SIMM13(~0), "[1],g", 0, v6 }, /* ld [rs1+0],d */ - -{ "ld", F3(3, 0x21, 0), F3(~3, ~0x21, ~0)|RD(~0), "[1+2],F", 0, v6 }, -{ "ld", F3(3, 0x21, 0), F3(~3, ~0x21, ~0)|RS2_G0|RD(~0),"[1],F", 0, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|RD(~0), "[1+i],F", 0, v6 }, -{ "ld", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|RD(~0), "[i+1],F", 0, v6 }, -{ "ld", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|RS1_G0|RD(~0),"[i],F", 0, v6 }, -{ "ld", F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|SIMM13(~0)|RD(~0),"[1],F", 0, v6 }, /* ld [rs1+0],d */ - -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "ld", F3(3, 0x30, 0), F3(~3, ~0x30, ~0), "[1+2],D", F_ALIAS, v6 }, -{ "ld", F3(3, 0x30, 0), F3(~3, ~0x30, ~0)|RS2_G0, "[1],D", F_ALIAS, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[1+i],D", F_ALIAS, v6 }, -{ "ld", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[i+1],D", F_ALIAS, v6 }, -{ "ld", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|RS1_G0, "[i],D", F_ALIAS, v6 }, -{ "ld", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|SIMM13(~0), "[1],D", F_ALIAS, v6 }, /* ld [rs1+0],d */ -{ "ld", F3(3, 0x31, 0), F3(~3, ~0x31, ~0), "[1+2],C", 0, v6 }, -{ "ld", F3(3, 0x31, 0), F3(~3, ~0x31, ~0)|RS2_G0, "[1],C", 0, v6 }, /* ld [rs1+%g0],d */ -{ "ld", F3(3, 0x31, 1), F3(~3, ~0x31, ~1), "[1+i],C", 0, v6 }, -{ "ld", F3(3, 0x31, 1), F3(~3, ~0x31, ~1), "[i+1],C", 0, v6 }, -{ "ld", F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|RS1_G0, "[i],C", 0, v6 }, -{ "ld", F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|SIMM13(~0), "[1],C", 0, v6 }, /* ld [rs1+0],d */ - -/* The v9 LDUW is the same as the old 'ld' opcode, it is not the same as the - 'ld' pseudo-op in v9. */ -{ "lduw", F3(3, 0x00, 0), F3(~3, ~0x00, ~0), "[1+2],d", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x00, 0), F3(~3, ~0x00, ~0)|RS2_G0, "[1],d", F_ALIAS, v9 }, /* ld [rs1+%g0],d */ -{ "lduw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[1+i],d", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1), "[i+1],d", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|RS1_G0, "[i],d", F_ALIAS, v9 }, -{ "lduw", F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|SIMM13(~0), "[1],d", F_ALIAS, v9 }, /* ld [rs1+0],d */ - -{ "ldd", F3(3, 0x03, 0), F3(~3, ~0x03, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldd", F3(3, 0x03, 0), F3(~3, ~0x03, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldd [rs1+%g0],d */ -{ "ldd", F3(3, 0x03, 1), F3(~3, ~0x03, ~1), "[1+i],d", 0, v6 }, -{ "ldd", F3(3, 0x03, 1), F3(~3, ~0x03, ~1), "[i+1],d", 0, v6 }, -{ "ldd", F3(3, 0x03, 1), F3(~3, ~0x03, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldd", F3(3, 0x03, 1), F3(~3, ~0x03, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ldd [rs1+0],d */ -{ "ldd", F3(3, 0x23, 0), F3(~3, ~0x23, ~0)|ASI(~0), "[1+2],H", 0, v6 }, -{ "ldd", F3(3, 0x23, 0), F3(~3, ~0x23, ~0)|ASI_RS2(~0), "[1],H", 0, v6 }, /* ldd [rs1+%g0],d */ -{ "ldd", F3(3, 0x23, 1), F3(~3, ~0x23, ~1), "[1+i],H", 0, v6 }, -{ "ldd", F3(3, 0x23, 1), F3(~3, ~0x23, ~1), "[i+1],H", 0, v6 }, -{ "ldd", F3(3, 0x23, 1), F3(~3, ~0x23, ~1)|RS1_G0, "[i],H", 0, v6 }, -{ "ldd", F3(3, 0x23, 1), F3(~3, ~0x23, ~1)|SIMM13(~0), "[1],H", 0, v6 }, /* ldd [rs1+0],d */ -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "ldd", F3(3, 0x33, 0), F3(~3, ~0x33, ~0)|ASI(~0), "[1+2],D", F_ALIAS, v6 }, -{ "ldd", F3(3, 0x33, 0), F3(~3, ~0x33, ~0)|ASI_RS2(~0), "[1],D", F_ALIAS, v6 }, /* ldd [rs1+%g0],d */ -{ "ldd", F3(3, 0x33, 1), F3(~3, ~0x33, ~1), "[1+i],D", F_ALIAS, v6 }, -{ "ldd", F3(3, 0x33, 1), F3(~3, ~0x33, ~1), "[i+1],D", F_ALIAS, v6 }, -{ "ldd", F3(3, 0x33, 1), F3(~3, ~0x33, ~1)|RS1_G0, "[i],D", F_ALIAS, v6 }, -{ "ldd", F3(3, 0x33, 1), F3(~3, ~0x33, ~1)|SIMM13(~0), "[1],D", F_ALIAS, v6 }, /* ldd [rs1+0],d */ - -{ "ldq", F3(3, 0x22, 0), F3(~3, ~0x22, ~0)|ASI(~0), "[1+2],J", 0, v9 }, -{ "ldq", F3(3, 0x22, 0), F3(~3, ~0x22, ~0)|ASI_RS2(~0), "[1],J", 0, v9 }, /* ldd [rs1+%g0],d */ -{ "ldq", F3(3, 0x22, 1), F3(~3, ~0x22, ~1), "[1+i],J", 0, v9 }, -{ "ldq", F3(3, 0x22, 1), F3(~3, ~0x22, ~1), "[i+1],J", 0, v9 }, -{ "ldq", F3(3, 0x22, 1), F3(~3, ~0x22, ~1)|RS1_G0, "[i],J", 0, v9 }, -{ "ldq", F3(3, 0x22, 1), F3(~3, ~0x22, ~1)|SIMM13(~0), "[1],J", 0, v9 }, /* ldd [rs1+0],d */ - -{ "ldsb", F3(3, 0x09, 0), F3(~3, ~0x09, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldsb", F3(3, 0x09, 0), F3(~3, ~0x09, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldsb [rs1+%g0],d */ -{ "ldsb", F3(3, 0x09, 1), F3(~3, ~0x09, ~1), "[1+i],d", 0, v6 }, -{ "ldsb", F3(3, 0x09, 1), F3(~3, ~0x09, ~1), "[i+1],d", 0, v6 }, -{ "ldsb", F3(3, 0x09, 1), F3(~3, ~0x09, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldsb", F3(3, 0x09, 1), F3(~3, ~0x09, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ldsb [rs1+0],d */ - -{ "ldsh", F3(3, 0x0a, 0), F3(~3, ~0x0a, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldsh [rs1+%g0],d */ -{ "ldsh", F3(3, 0x0a, 0), F3(~3, ~0x0a, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldsh", F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1), "[1+i],d", 0, v6 }, -{ "ldsh", F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1), "[i+1],d", 0, v6 }, -{ "ldsh", F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldsh", F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ldsh [rs1+0],d */ - -{ "ldstub", F3(3, 0x0d, 0), F3(~3, ~0x0d, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldstub", F3(3, 0x0d, 0), F3(~3, ~0x0d, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldstub [rs1+%g0],d */ -{ "ldstub", F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1), "[1+i],d", 0, v6 }, -{ "ldstub", F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1), "[i+1],d", 0, v6 }, -{ "ldstub", F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldstub", F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ldstub [rs1+0],d */ - -{ "ldsw", F3(3, 0x08, 0), F3(~3, ~0x08, ~0)|ASI(~0), "[1+2],d", 0, v9 }, -{ "ldsw", F3(3, 0x08, 0), F3(~3, ~0x08, ~0)|ASI_RS2(~0), "[1],d", 0, v9 }, /* ldsw [rs1+%g0],d */ -{ "ldsw", F3(3, 0x08, 1), F3(~3, ~0x08, ~1), "[1+i],d", 0, v9 }, -{ "ldsw", F3(3, 0x08, 1), F3(~3, ~0x08, ~1), "[i+1],d", 0, v9 }, -{ "ldsw", F3(3, 0x08, 1), F3(~3, ~0x08, ~1)|RS1_G0, "[i],d", 0, v9 }, -{ "ldsw", F3(3, 0x08, 1), F3(~3, ~0x08, ~1)|SIMM13(~0), "[1],d", 0, v9 }, /* ldsw [rs1+0],d */ - -{ "ldub", F3(3, 0x01, 0), F3(~3, ~0x01, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "ldub", F3(3, 0x01, 0), F3(~3, ~0x01, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* ldub [rs1+%g0],d */ -{ "ldub", F3(3, 0x01, 1), F3(~3, ~0x01, ~1), "[1+i],d", 0, v6 }, -{ "ldub", F3(3, 0x01, 1), F3(~3, ~0x01, ~1), "[i+1],d", 0, v6 }, -{ "ldub", F3(3, 0x01, 1), F3(~3, ~0x01, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "ldub", F3(3, 0x01, 1), F3(~3, ~0x01, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* ldub [rs1+0],d */ - -{ "lduh", F3(3, 0x02, 0), F3(~3, ~0x02, ~0)|ASI(~0), "[1+2],d", 0, v6 }, -{ "lduh", F3(3, 0x02, 0), F3(~3, ~0x02, ~0)|ASI_RS2(~0), "[1],d", 0, v6 }, /* lduh [rs1+%g0],d */ -{ "lduh", F3(3, 0x02, 1), F3(~3, ~0x02, ~1), "[1+i],d", 0, v6 }, -{ "lduh", F3(3, 0x02, 1), F3(~3, ~0x02, ~1), "[i+1],d", 0, v6 }, -{ "lduh", F3(3, 0x02, 1), F3(~3, ~0x02, ~1)|RS1_G0, "[i],d", 0, v6 }, -{ "lduh", F3(3, 0x02, 1), F3(~3, ~0x02, ~1)|SIMM13(~0), "[1],d", 0, v6 }, /* lduh [rs1+0],d */ - -{ "ldx", F3(3, 0x0b, 0), F3(~3, ~0x0b, ~0)|ASI(~0), "[1+2],d", 0, v9 }, -{ "ldx", F3(3, 0x0b, 0), F3(~3, ~0x0b, ~0)|ASI_RS2(~0), "[1],d", 0, v9 }, /* ldx [rs1+%g0],d */ -{ "ldx", F3(3, 0x0b, 1), F3(~3, ~0x0b, ~1), "[1+i],d", 0, v9 }, -{ "ldx", F3(3, 0x0b, 1), F3(~3, ~0x0b, ~1), "[i+1],d", 0, v9 }, -{ "ldx", F3(3, 0x0b, 1), F3(~3, ~0x0b, ~1)|RS1_G0, "[i],d", 0, v9 }, -{ "ldx", F3(3, 0x0b, 1), F3(~3, ~0x0b, ~1)|SIMM13(~0), "[1],d", 0, v9 }, /* ldx [rs1+0],d */ - -{ "ldx", F3(3, 0x21, 0)|RD(1), F3(~3, ~0x21, ~0)|RD(~1), "[1+2],F", 0, v9 }, -{ "ldx", F3(3, 0x21, 0)|RD(1), F3(~3, ~0x21, ~0)|RS2_G0|RD(~1), "[1],F", 0, v9 }, /* ld [rs1+%g0],d */ -{ "ldx", F3(3, 0x21, 1)|RD(1), F3(~3, ~0x21, ~1)|RD(~1), "[1+i],F", 0, v9 }, -{ "ldx", F3(3, 0x21, 1)|RD(1), F3(~3, ~0x21, ~1)|RD(~1), "[i+1],F", 0, v9 }, -{ "ldx", F3(3, 0x21, 1)|RD(1), F3(~3, ~0x21, ~1)|RS1_G0|RD(~1), "[i],F", 0, v9 }, -{ "ldx", F3(3, 0x21, 1)|RD(1), F3(~3, ~0x21, ~1)|SIMM13(~0)|RD(~1),"[1],F", 0, v9 }, /* ld [rs1+0],d */ - -{ "lda", F3(3, 0x10, 0), F3(~3, ~0x10, ~0), "[1+2]A,d", 0, v6 }, -{ "lda", F3(3, 0x10, 0), F3(~3, ~0x10, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* lda [rs1+%g0],d */ -{ "lda", F3(3, 0x10, 1), F3(~3, ~0x10, ~1), "[1+i]o,d", 0, v9 }, -{ "lda", F3(3, 0x10, 1), F3(~3, ~0x10, ~1), "[i+1]o,d", 0, v9 }, -{ "lda", F3(3, 0x10, 1), F3(~3, ~0x10, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "lda", F3(3, 0x10, 1), F3(~3, ~0x10, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* ld [rs1+0],d */ -{ "lda", F3(3, 0x30, 0), F3(~3, ~0x30, ~0), "[1+2]A,g", 0, v9 }, -{ "lda", F3(3, 0x30, 0), F3(~3, ~0x30, ~0)|RS2_G0, "[1]A,g", 0, v9 }, /* lda [rs1+%g0],d */ -{ "lda", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[1+i]o,g", 0, v9 }, -{ "lda", F3(3, 0x30, 1), F3(~3, ~0x30, ~1), "[i+1]o,g", 0, v9 }, -{ "lda", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|RS1_G0, "[i]o,g", 0, v9 }, -{ "lda", F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|SIMM13(~0), "[1]o,g", 0, v9 }, /* ld [rs1+0],d */ - -{ "ldda", F3(3, 0x13, 0), F3(~3, ~0x13, ~0), "[1+2]A,d", 0, v6 }, -{ "ldda", F3(3, 0x13, 0), F3(~3, ~0x13, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* ldda [rs1+%g0],d */ -{ "ldda", F3(3, 0x13, 1), F3(~3, ~0x13, ~1), "[1+i]o,d", 0, v9 }, -{ "ldda", F3(3, 0x13, 1), F3(~3, ~0x13, ~1), "[i+1]o,d", 0, v9 }, -{ "ldda", F3(3, 0x13, 1), F3(~3, ~0x13, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "ldda", F3(3, 0x13, 1), F3(~3, ~0x13, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* ld [rs1+0],d */ - -{ "ldda", F3(3, 0x33, 0), F3(~3, ~0x33, ~0), "[1+2]A,H", 0, v9 }, -{ "ldda", F3(3, 0x33, 0), F3(~3, ~0x33, ~0)|RS2_G0, "[1]A,H", 0, v9 }, /* ldda [rs1+%g0],d */ -{ "ldda", F3(3, 0x33, 1), F3(~3, ~0x33, ~1), "[1+i]o,H", 0, v9 }, -{ "ldda", F3(3, 0x33, 1), F3(~3, ~0x33, ~1), "[i+1]o,H", 0, v9 }, -{ "ldda", F3(3, 0x33, 1), F3(~3, ~0x33, ~1)|RS1_G0, "[i]o,H", 0, v9 }, -{ "ldda", F3(3, 0x33, 1), F3(~3, ~0x33, ~1)|SIMM13(~0), "[1]o,H", 0, v9 }, /* ld [rs1+0],d */ - -{ "ldqa", F3(3, 0x32, 0), F3(~3, ~0x32, ~0), "[1+2]A,J", 0, v9 }, -{ "ldqa", F3(3, 0x32, 0), F3(~3, ~0x32, ~0)|RS2_G0, "[1]A,J", 0, v9 }, /* ldd [rs1+%g0],d */ -{ "ldqa", F3(3, 0x32, 1), F3(~3, ~0x32, ~1), "[1+i]o,J", 0, v9 }, -{ "ldqa", F3(3, 0x32, 1), F3(~3, ~0x32, ~1), "[i+1]o,J", 0, v9 }, -{ "ldqa", F3(3, 0x32, 1), F3(~3, ~0x32, ~1)|RS1_G0, "[i]o,J", 0, v9 }, -{ "ldqa", F3(3, 0x32, 1), F3(~3, ~0x32, ~1)|SIMM13(~0), "[1]o,J", 0, v9 }, /* ldd [rs1+0],d */ - -{ "ldsba", F3(3, 0x19, 0), F3(~3, ~0x19, ~0), "[1+2]A,d", 0, v6 }, -{ "ldsba", F3(3, 0x19, 0), F3(~3, ~0x19, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* ldsba [rs1+%g0],d */ -{ "ldsba", F3(3, 0x19, 1), F3(~3, ~0x19, ~1), "[1+i]o,d", 0, v9 }, -{ "ldsba", F3(3, 0x19, 1), F3(~3, ~0x19, ~1), "[i+1]o,d", 0, v9 }, -{ "ldsba", F3(3, 0x19, 1), F3(~3, ~0x19, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "ldsba", F3(3, 0x19, 1), F3(~3, ~0x19, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* ld [rs1+0],d */ - -{ "ldsha", F3(3, 0x1a, 0), F3(~3, ~0x1a, ~0), "[1+2]A,d", 0, v6 }, -{ "ldsha", F3(3, 0x1a, 0), F3(~3, ~0x1a, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* ldsha [rs1+%g0],d */ -{ "ldsha", F3(3, 0x1a, 1), F3(~3, ~0x1a, ~1), "[1+i]o,d", 0, v9 }, -{ "ldsha", F3(3, 0x1a, 1), F3(~3, ~0x1a, ~1), "[i+1]o,d", 0, v9 }, -{ "ldsha", F3(3, 0x1a, 1), F3(~3, ~0x1a, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "ldsha", F3(3, 0x1a, 1), F3(~3, ~0x1a, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* ld [rs1+0],d */ - -{ "ldstuba", F3(3, 0x1d, 0), F3(~3, ~0x1d, ~0), "[1+2]A,d", 0, v6 }, -{ "ldstuba", F3(3, 0x1d, 0), F3(~3, ~0x1d, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* ldstuba [rs1+%g0],d */ -{ "ldstuba", F3(3, 0x1d, 1), F3(~3, ~0x1d, ~1), "[1+i]o,d", 0, v9 }, -{ "ldstuba", F3(3, 0x1d, 1), F3(~3, ~0x1d, ~1), "[i+1]o,d", 0, v9 }, -{ "ldstuba", F3(3, 0x1d, 1), F3(~3, ~0x1d, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "ldstuba", F3(3, 0x1d, 1), F3(~3, ~0x1d, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* ld [rs1+0],d */ - -{ "ldswa", F3(3, 0x18, 0), F3(~3, ~0x18, ~0), "[1+2]A,d", 0, v9 }, -{ "ldswa", F3(3, 0x18, 0), F3(~3, ~0x18, ~0)|RS2_G0, "[1]A,d", 0, v9 }, /* lda [rs1+%g0],d */ -{ "ldswa", F3(3, 0x18, 1), F3(~3, ~0x18, ~1), "[1+i]o,d", 0, v9 }, -{ "ldswa", F3(3, 0x18, 1), F3(~3, ~0x18, ~1), "[i+1]o,d", 0, v9 }, -{ "ldswa", F3(3, 0x18, 1), F3(~3, ~0x18, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "ldswa", F3(3, 0x18, 1), F3(~3, ~0x18, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* ld [rs1+0],d */ - -{ "lduba", F3(3, 0x11, 0), F3(~3, ~0x11, ~0), "[1+2]A,d", 0, v6 }, -{ "lduba", F3(3, 0x11, 0), F3(~3, ~0x11, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* lduba [rs1+%g0],d */ -{ "lduba", F3(3, 0x11, 1), F3(~3, ~0x11, ~1), "[1+i]o,d", 0, v9 }, -{ "lduba", F3(3, 0x11, 1), F3(~3, ~0x11, ~1), "[i+1]o,d", 0, v9 }, -{ "lduba", F3(3, 0x11, 1), F3(~3, ~0x11, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "lduba", F3(3, 0x11, 1), F3(~3, ~0x11, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* ld [rs1+0],d */ - -{ "lduha", F3(3, 0x12, 0), F3(~3, ~0x12, ~0), "[1+2]A,d", 0, v6 }, -{ "lduha", F3(3, 0x12, 0), F3(~3, ~0x12, ~0)|RS2_G0, "[1]A,d", 0, v6 }, /* lduha [rs1+%g0],d */ -{ "lduha", F3(3, 0x12, 1), F3(~3, ~0x12, ~1), "[1+i]o,d", 0, v9 }, -{ "lduha", F3(3, 0x12, 1), F3(~3, ~0x12, ~1), "[i+1]o,d", 0, v9 }, -{ "lduha", F3(3, 0x12, 1), F3(~3, ~0x12, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "lduha", F3(3, 0x12, 1), F3(~3, ~0x12, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* ld [rs1+0],d */ - -{ "lduwa", F3(3, 0x10, 0), F3(~3, ~0x10, ~0), "[1+2]A,d", F_ALIAS, v9 }, /* lduwa === lda */ -{ "lduwa", F3(3, 0x10, 0), F3(~3, ~0x10, ~0)|RS2_G0, "[1]A,d", F_ALIAS, v9 }, /* lda [rs1+%g0],d */ -{ "lduwa", F3(3, 0x10, 1), F3(~3, ~0x10, ~1), "[1+i]o,d", F_ALIAS, v9 }, -{ "lduwa", F3(3, 0x10, 1), F3(~3, ~0x10, ~1), "[i+1]o,d", F_ALIAS, v9 }, -{ "lduwa", F3(3, 0x10, 1), F3(~3, ~0x10, ~1)|RS1_G0, "[i]o,d", F_ALIAS, v9 }, -{ "lduwa", F3(3, 0x10, 1), F3(~3, ~0x10, ~1)|SIMM13(~0), "[1]o,d", F_ALIAS, v9 }, /* ld [rs1+0],d */ - -{ "ldxa", F3(3, 0x1b, 0), F3(~3, ~0x1b, ~0), "[1+2]A,d", 0, v9 }, /* lduwa === lda */ -{ "ldxa", F3(3, 0x1b, 0), F3(~3, ~0x1b, ~0)|RS2_G0, "[1]A,d", 0, v9 }, /* lda [rs1+%g0],d */ -{ "ldxa", F3(3, 0x1b, 1), F3(~3, ~0x1b, ~1), "[1+i]o,d", 0, v9 }, -{ "ldxa", F3(3, 0x1b, 1), F3(~3, ~0x1b, ~1), "[i+1]o,d", 0, v9 }, -{ "ldxa", F3(3, 0x1b, 1), F3(~3, ~0x1b, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "ldxa", F3(3, 0x1b, 1), F3(~3, ~0x1b, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* ld [rs1+0],d */ - -{ "st", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0), "d,[1+2]", 0, v6 }, -{ "st", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0), "d,[1]", 0, v6 }, /* st d,[rs1+%g0] */ -{ "st", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[1+i]", 0, v6 }, -{ "st", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[i+1]", 0, v6 }, -{ "st", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0, "d,[i]", 0, v6 }, -{ "st", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0), "d,[1]", 0, v6 }, /* st d,[rs1+0] */ -{ "st", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI(~0), "g,[1+2]", 0, v6 }, -{ "st", F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI_RS2(~0), "g,[1]", 0, v6 }, /* st d[rs1+%g0] */ -{ "st", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[1+i]", 0, v6 }, -{ "st", F3(3, 0x24, 1), F3(~3, ~0x24, ~1), "g,[i+1]", 0, v6 }, -{ "st", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|RS1_G0, "g,[i]", 0, v6 }, -{ "st", F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|SIMM13(~0), "g,[1]", 0, v6 }, /* st d,[rs1+0] */ -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "st", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI(~0), "D,[1+2]", F_ALIAS, v6 }, -{ "st", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI_RS2(~0), "D,[1]", F_ALIAS, v6 }, /* st d,[rs1+%g0] */ -{ "st", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[1+i]", F_ALIAS, v6 }, -{ "st", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "D,[i+1]", F_ALIAS, v6 }, -{ "st", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|RS1_G0, "D,[i]", F_ALIAS, v6 }, -{ "st", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|SIMM13(~0), "D,[1]", F_ALIAS, v6 }, /* st d,[rs1+0] */ -{ "st", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI(~0), "C,[1+2]", 0, v6 }, -{ "st", F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI_RS2(~0), "C,[1]", 0, v6 }, /* st d,[rs1+%g0] */ -{ "st", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[1+i]", 0, v6 }, -{ "st", F3(3, 0x35, 1), F3(~3, ~0x35, ~1), "C,[i+1]", 0, v6 }, -{ "st", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|RS1_G0, "C,[i]", 0, v6 }, -{ "st", F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|SIMM13(~0), "C,[1]", 0, v6 }, /* st d,[rs1+0] */ - -{ "st", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI(~0), "F,[1+2]", 0, v6 }, -{ "st", F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI_RS2(~0), "F,[1]", 0, v6 }, /* st d,[rs1+%g0] */ -{ "st", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[1+i]", 0, v6 }, -{ "st", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0, "F,[i+1]", 0, v6 }, -{ "st", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0|RS1_G0, "F,[i]", 0, v6 }, -{ "st", F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0|SIMM13(~0), "F,[1]", 0, v6 }, /* st d,[rs1+0] */ - - /* The v9 STW/STUW/STSW are the same as the old 'st' opcode, they are not - the same as the 'st' psuedo-op in v9. */ -{ "stw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "stuw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stuw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stuw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "stsw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, /* stsw === st */ -{ "stsw", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+%g0] */ -{ "stsw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stsw", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "sta", F3(3, 0x14, 0), F3(~3, ~0x14, ~0), "d,[1+2]A", 0, v6 }, -{ "sta", F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0), "d,[1]A", 0, v6 }, /* sta d,[rs1+%g0] */ -{ "sta", F3(3, 0x14, 1), F3(~3, ~0x14, ~1), "d,[1+i]o", 0, v9 }, -{ "sta", F3(3, 0x14, 1), F3(~3, ~0x14, ~1), "d,[i+1]o", 0, v9 }, -{ "sta", F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|RS1_G0, "d,[i]o", 0, v9 }, -{ "sta", F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|SIMM13(~0), "d,[1]o", 0, v9 }, /* st d,[rs1+0] */ - -{ "sta", F3(3, 0x34, 0), F3(~3, ~0x34, ~0), "g,[1+2]A", 0, v9 }, -{ "sta", F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|RS2(~0), "g,[1]A", 0, v9 }, /* sta d,[rs1+%g0] */ -{ "sta", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "g,[1+i]o", 0, v9 }, -{ "sta", F3(3, 0x34, 1), F3(~3, ~0x34, ~1), "g,[i+1]o", 0, v9 }, -{ "sta", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|RS1_G0, "g,[i]o", 0, v9 }, -{ "sta", F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|SIMM13(~0), "g,[1]o", 0, v9 }, /* st d,[rs1+0] */ - -{ "stwa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stwa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* sta d,[rs1+%g0] */ -{ "stwa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1), "d,[1+i]o", F_ALIAS, v9 }, -{ "stwa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1), "d,[i+1]o", F_ALIAS, v9 }, -{ "stwa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|RS1_G0, "d,[i]o", F_ALIAS, v9 }, -{ "stwa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|SIMM13(~0), "d,[1]o", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "stswa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stswa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* sta d,[rs1+%g0] */ -{ "stswa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1), "d,[1+i]o", F_ALIAS, v9 }, -{ "stswa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1), "d,[i+1]o", F_ALIAS, v9 }, -{ "stswa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|RS1_G0, "d,[i]o", F_ALIAS, v9 }, -{ "stswa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|SIMM13(~0), "d,[1]o", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "stuwa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stuwa", F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* sta d,[rs1+%g0] */ -{ "stuwa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1), "d,[1+i]o", F_ALIAS, v9 }, -{ "stuwa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1), "d,[i+1]o", F_ALIAS, v9 }, -{ "stuwa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|RS1_G0, "d,[i]o", F_ALIAS, v9 }, -{ "stuwa", F3(3, 0x14, 1), F3(~3, ~0x14, ~1)|SIMM13(~0), "d,[1]o", F_ALIAS, v9 }, /* st d,[rs1+0] */ - -{ "stb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0), "d,[1+2]", 0, v6 }, -{ "stb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0), "d,[1]", 0, v6 }, /* stb d,[rs1+%g0] */ -{ "stb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[1+i]", 0, v6 }, -{ "stb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[i+1]", 0, v6 }, -{ "stb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0, "d,[i]", 0, v6 }, -{ "stb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0), "d,[1]", 0, v6 }, /* stb d,[rs1+0] */ - -{ "stub", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stub", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* stb d,[rs1+%g0] */ -{ "stub", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stub", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stub", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stub", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* stb d,[rs1+0] */ - -{ "stsb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stsb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* stb d,[rs1+%g0] */ -{ "stsb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stsb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stsb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stsb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* stb d,[rs1+0] */ - -{ "stba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0), "d,[1+2]A", 0, v6 }, -{ "stba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0), "d,[1]A", 0, v6 }, /* stba d,[rs1+%g0] */ -{ "stba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1), "d,[1+i]o", 0, v9 }, -{ "stba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1), "d,[i+1]o", 0, v9 }, -{ "stba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|RS1_G0, "d,[i]o", 0, v9 }, -{ "stba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|SIMM13(~0), "d,[1]o", 0, v9 }, /* stb d,[rs1+0] */ - -{ "stsba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stsba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* stba d,[rs1+%g0] */ -{ "stsba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1), "d,[1+i]o", F_ALIAS, v9 }, -{ "stsba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1), "d,[i+1]o", F_ALIAS, v9 }, -{ "stsba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|RS1_G0, "d,[i]o", F_ALIAS, v9 }, -{ "stsba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|SIMM13(~0), "d,[1]o", F_ALIAS, v9 }, /* stb d,[rs1+0] */ - -{ "stuba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stuba", F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* stba d,[rs1+%g0] */ -{ "stuba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1), "d,[1+i]o", F_ALIAS, v9 }, -{ "stuba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1), "d,[i+1]o", F_ALIAS, v9 }, -{ "stuba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|RS1_G0, "d,[i]o", F_ALIAS, v9 }, -{ "stuba", F3(3, 0x15, 1), F3(~3, ~0x15, ~1)|SIMM13(~0), "d,[1]o", F_ALIAS, v9 }, /* stb d,[rs1+0] */ - -{ "std", F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI(~0), "d,[1+2]", 0, v6 }, -{ "std", F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI_RS2(~0), "d,[1]", 0, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x07, 1), F3(~3, ~0x07, ~1), "d,[1+i]", 0, v6 }, -{ "std", F3(3, 0x07, 1), F3(~3, ~0x07, ~1), "d,[i+1]", 0, v6 }, -{ "std", F3(3, 0x07, 1), F3(~3, ~0x07, ~1)|RS1_G0, "d,[i]", 0, v6 }, -{ "std", F3(3, 0x07, 1), F3(~3, ~0x07, ~1)|SIMM13(~0), "d,[1]", 0, v6 }, /* std d,[rs1+0] */ -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "std", F3(3, 0x26, 0), F3(~3, ~0x26, ~0)|ASI(~0), "q,[1+2]", F_ALIAS, v6 }, -{ "std", F3(3, 0x26, 0), F3(~3, ~0x26, ~0)|ASI_RS2(~0), "q,[1]", F_ALIAS, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x26, 1), F3(~3, ~0x26, ~1), "q,[1+i]", F_ALIAS, v6 }, -{ "std", F3(3, 0x26, 1), F3(~3, ~0x26, ~1), "q,[i+1]", F_ALIAS, v6 }, -{ "std", F3(3, 0x26, 1), F3(~3, ~0x26, ~1)|RS1_G0, "q,[i]", F_ALIAS, v6 }, -{ "std", F3(3, 0x26, 1), F3(~3, ~0x26, ~1)|SIMM13(~0), "q,[1]", F_ALIAS, v6 }, /* std d,[rs1+0] */ -{ "std", F3(3, 0x27, 0), F3(~3, ~0x27, ~0)|ASI(~0), "H,[1+2]", 0, v6 }, -{ "std", F3(3, 0x27, 0), F3(~3, ~0x27, ~0)|ASI_RS2(~0), "H,[1]", 0, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x27, 1), F3(~3, ~0x27, ~1), "H,[1+i]", 0, v6 }, -{ "std", F3(3, 0x27, 1), F3(~3, ~0x27, ~1), "H,[i+1]", 0, v6 }, -{ "std", F3(3, 0x27, 1), F3(~3, ~0x27, ~1)|RS1_G0, "H,[i]", 0, v6 }, -{ "std", F3(3, 0x27, 1), F3(~3, ~0x27, ~1)|SIMM13(~0), "H,[1]", 0, v6 }, /* std d,[rs1+0] */ -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "std", F3(3, 0x36, 0), F3(~3, ~0x36, ~0)|ASI(~0), "Q,[1+2]", F_ALIAS, v6 }, -{ "std", F3(3, 0x36, 0), F3(~3, ~0x36, ~0)|ASI_RS2(~0), "Q,[1]", F_ALIAS, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x36, 1), F3(~3, ~0x36, ~1), "Q,[1+i]", F_ALIAS, v6 }, -{ "std", F3(3, 0x36, 1), F3(~3, ~0x36, ~1), "Q,[i+1]", F_ALIAS, v6 }, -{ "std", F3(3, 0x36, 1), F3(~3, ~0x36, ~1)|RS1_G0, "Q,[i]", F_ALIAS, v6 }, -{ "std", F3(3, 0x36, 1), F3(~3, ~0x36, ~1)|SIMM13(~0), "Q,[1]", F_ALIAS, v6 }, /* std d,[rs1+0] */ -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "std", F3(3, 0x37, 0), F3(~3, ~0x37, ~0)|ASI(~0), "D,[1+2]", F_ALIAS, v6 }, -{ "std", F3(3, 0x37, 0), F3(~3, ~0x37, ~0)|ASI_RS2(~0), "D,[1]", F_ALIAS, v6 }, /* std d,[rs1+%g0] */ -{ "std", F3(3, 0x37, 1), F3(~3, ~0x37, ~1), "D,[1+i]", F_ALIAS, v6 }, -{ "std", F3(3, 0x37, 1), F3(~3, ~0x37, ~1), "D,[i+1]", F_ALIAS, v6 }, -{ "std", F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|RS1_G0, "D,[i]", F_ALIAS, v6 }, -{ "std", F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|SIMM13(~0), "D,[1]", F_ALIAS, v6 }, /* std d,[rs1+0] */ - -{ "stda", F3(3, 0x17, 0), F3(~3, ~0x17, ~0), "d,[1+2]A", 0, v6 }, -{ "stda", F3(3, 0x17, 0), F3(~3, ~0x17, ~0)|RS2(~0), "d,[1]A", 0, v6 }, /* stda d,[rs1+%g0] */ -{ "stda", F3(3, 0x17, 1), F3(~3, ~0x17, ~1), "d,[1+i]o", 0, v9 }, -{ "stda", F3(3, 0x17, 1), F3(~3, ~0x17, ~1), "d,[i+1]o", 0, v9 }, -{ "stda", F3(3, 0x17, 1), F3(~3, ~0x17, ~1)|RS1_G0, "d,[i]o", 0, v9 }, -{ "stda", F3(3, 0x17, 1), F3(~3, ~0x17, ~1)|SIMM13(~0), "d,[1]o", 0, v9 }, /* std d,[rs1+0] */ -{ "stda", F3(3, 0x37, 0), F3(~3, ~0x37, ~0), "H,[1+2]A", 0, v9 }, -{ "stda", F3(3, 0x37, 0), F3(~3, ~0x37, ~0)|RS2(~0), "H,[1]A", 0, v9 }, /* stda d,[rs1+%g0] */ -{ "stda", F3(3, 0x37, 1), F3(~3, ~0x37, ~1), "H,[1+i]o", 0, v9 }, -{ "stda", F3(3, 0x37, 1), F3(~3, ~0x37, ~1), "H,[i+1]o", 0, v9 }, -{ "stda", F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|RS1_G0, "H,[i]o", 0, v9 }, -{ "stda", F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|SIMM13(~0), "H,[1]o", 0, v9 }, /* std d,[rs1+0] */ - -{ "sth", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI(~0), "d,[1+2]", 0, v6 }, -{ "sth", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI_RS2(~0), "d,[1]", 0, v6 }, /* sth d,[rs1+%g0] */ -{ "sth", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[1+i]", 0, v6 }, -{ "sth", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[i+1]", 0, v6 }, -{ "sth", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0, "d,[i]", 0, v6 }, -{ "sth", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0), "d,[1]", 0, v6 }, /* sth d,[+] */ - -{ "stsh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stsh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* sth d,[rs1+%g0] */ -{ "stsh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stsh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stsh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stsh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* sth d,[rs1+0] */ - -{ "stuh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI(~0), "d,[1+2]", F_ALIAS, v9 }, -{ "stuh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI_RS2(~0), "d,[1]", F_ALIAS, v9 }, /* sth d,[rs1+%g0] */ -{ "stuh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[1+i]", F_ALIAS, v9 }, -{ "stuh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1), "d,[i+1]", F_ALIAS, v9 }, -{ "stuh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0, "d,[i]", F_ALIAS, v9 }, -{ "stuh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0), "d,[1]", F_ALIAS, v9 }, /* sth d,[rs1+0] */ - -{ "stha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0), "d,[1+2]A", 0, v6 }, -{ "stha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0), "d,[1]A", 0, v6 }, /* stha ,[+%] */ -{ "stha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1), "d,[1+i]o", 0, v9 }, -{ "stha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1), "d,[i+1]o", 0, v9 }, -{ "stha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|RS1_G0, "d,[i]o", 0, v9 }, -{ "stha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|SIMM13(~0), "d,[1]o", 0, v9 }, /* sth d,[+] */ - -{ "stsha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stsha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* stha d,[rs1+%g0] */ -{ "stsha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1), "d,[1+i]o", F_ALIAS, v9 }, -{ "stsha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1), "d,[i+1]o", F_ALIAS, v9 }, -{ "stsha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|RS1_G0, "d,[i]o", F_ALIAS, v9 }, -{ "stsha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|SIMM13(~0), "d,[1]o", F_ALIAS, v9 }, /* sth d,[+] */ - -{ "stuha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0), "d,[1+2]A", F_ALIAS, v9 }, -{ "stuha", F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0), "d,[1]A", F_ALIAS, v9 }, /* stha d,[rs1+%g0] */ -{ "stuha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1), "d,[1+i]o", F_ALIAS, v9 }, -{ "stuha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1), "d,[i+1]o", F_ALIAS, v9 }, -{ "stuha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|RS1_G0, "d,[i]o", F_ALIAS, v9 }, -{ "stuha", F3(3, 0x16, 1), F3(~3, ~0x16, ~1)|SIMM13(~0), "d,[1]o", F_ALIAS, v9 }, /* sth d,[+] */ - -{ "stx", F3(3, 0x0e, 0), F3(~3, ~0x0e, ~0)|ASI(~0), "d,[1+2]", 0, v9 }, -{ "stx", F3(3, 0x0e, 0), F3(~3, ~0x0e, ~0)|ASI_RS2(~0), "d,[1]", 0, v9 }, /* stx d,[rs1+%g0] */ -{ "stx", F3(3, 0x0e, 1), F3(~3, ~0x0e, ~1), "d,[1+i]", 0, v9 }, -{ "stx", F3(3, 0x0e, 1), F3(~3, ~0x0e, ~1), "d,[i+1]", 0, v9 }, -{ "stx", F3(3, 0x0e, 1), F3(~3, ~0x0e, ~1)|RS1_G0, "d,[i]", 0, v9 }, -{ "stx", F3(3, 0x0e, 1), F3(~3, ~0x0e, ~1)|SIMM13(~0), "d,[1]", 0, v9 }, /* stx d,[rs1+0] */ - -{ "stx", F3(3, 0x25, 0)|RD(1), F3(~3, ~0x25, ~0)|ASI(~0)|RD(~1), "F,[1+2]", 0, v9 }, -{ "stx", F3(3, 0x25, 0)|RD(1), F3(~3, ~0x25, ~0)|ASI_RS2(~0)|RD(~1),"F,[1]", 0, v9 }, /* st d,[rs1+%g0] */ -{ "stx", F3(3, 0x25, 1)|RD(1), F3(~3, ~0x25, ~1)|RD(~1), "F,[1+i]", 0, v9 }, -{ "stx", F3(3, 0x25, 1)|RD(1), F3(~3, ~0x25, ~1)|RD(~1), "F,[i+1]", 0, v9 }, -{ "stx", F3(3, 0x25, 1)|RD(1), F3(~3, ~0x25, ~1)|RS1_G0|RD(~1), "F,[i]", 0, v9 }, -{ "stx", F3(3, 0x25, 1)|RD(1), F3(~3, ~0x25, ~1)|SIMM13(~0)|RD(~1),"F,[1]", 0, v9 }, /* st d,[rs1+0] */ - -{ "stxa", F3(3, 0x1e, 0), F3(~3, ~0x1e, ~0), "d,[1+2]A", 0, v9 }, -{ "stxa", F3(3, 0x1e, 0), F3(~3, ~0x1e, ~0)|RS2(~0), "d,[1]A", 0, v9 }, /* stha d,[rs1+%g0] */ -{ "stxa", F3(3, 0x1e, 1), F3(~3, ~0x1e, ~1), "d,[1+i]o", 0, v9 }, -{ "stxa", F3(3, 0x1e, 1), F3(~3, ~0x1e, ~1), "d,[i+1]o", 0, v9 }, -{ "stxa", F3(3, 0x1e, 1), F3(~3, ~0x1e, ~1)|RS1_G0, "d,[i]o", 0, v9 }, -{ "stxa", F3(3, 0x1e, 1), F3(~3, ~0x1e, ~1)|SIMM13(~0), "d,[1]o", 0, v9 }, /* stx d,[rs1+0] */ - -{ "stq", F3(3, 0x26, 0), F3(~3, ~0x26, ~0)|ASI(~0), "J,[1+2]", 0, v9 }, -{ "stq", F3(3, 0x26, 0), F3(~3, ~0x26, ~0)|ASI_RS2(~0), "J,[1]", 0, v9 }, /* st d[rs1+%g0] */ -{ "stq", F3(3, 0x26, 1), F3(~3, ~0x26, ~1), "J,[1+i]", 0, v9 }, -{ "stq", F3(3, 0x26, 1), F3(~3, ~0x26, ~1), "J,[i+1]", 0, v9 }, -{ "stq", F3(3, 0x26, 1), F3(~3, ~0x26, ~1)|RS1_G0, "J,[i]", 0, v9 }, -{ "stq", F3(3, 0x26, 1), F3(~3, ~0x26, ~1)|SIMM13(~0), "J,[1]", 0, v9 }, /* st d,[rs1+0] */ - -{ "stqa", F3(3, 0x36, 0), F3(~3, ~0x36, ~0)|ASI(~0), "J,[1+2]A", 0, v9 }, -{ "stqa", F3(3, 0x36, 0), F3(~3, ~0x36, ~0)|ASI_RS2(~0), "J,[1]A", 0, v9 }, /* st d[rs1+%g0] */ -{ "stqa", F3(3, 0x36, 1), F3(~3, ~0x36, ~1), "J,[1+i]o", 0, v9 }, -{ "stqa", F3(3, 0x36, 1), F3(~3, ~0x36, ~1), "J,[i+1]o", 0, v9 }, -{ "stqa", F3(3, 0x36, 1), F3(~3, ~0x36, ~1)|RS1_G0, "J,[i]o", 0, v9 }, -{ "stqa", F3(3, 0x36, 1), F3(~3, ~0x36, ~1)|SIMM13(~0), "J,[1]o", 0, v9 }, /* st d,[rs1+0] */ - -{ "swap", F3(3, 0x0f, 0), F3(~3, ~0x0f, ~0)|ASI(~0), "[1+2],d", 0, v7 }, -{ "swap", F3(3, 0x0f, 0), F3(~3, ~0x0f, ~0)|ASI_RS2(~0), "[1],d", 0, v7 }, /* swap [rs1+%g0],d */ -{ "swap", F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1), "[1+i],d", 0, v7 }, -{ "swap", F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1), "[i+1],d", 0, v7 }, -{ "swap", F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1)|RS1_G0, "[i],d", 0, v7 }, -{ "swap", F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1)|SIMM13(~0), "[1],d", 0, v7 }, /* swap [rs1+0],d */ - -{ "swapa", F3(3, 0x1f, 0), F3(~3, ~0x1f, ~0), "[1+2]A,d", 0, v7 }, -{ "swapa", F3(3, 0x1f, 0), F3(~3, ~0x1f, ~0)|RS2(~0), "[1]A,d", 0, v7 }, /* swapa [rs1+%g0],d */ -{ "swapa", F3(3, 0x1f, 1), F3(~3, ~0x1f, ~1), "[1+i]o,d", 0, v9 }, -{ "swapa", F3(3, 0x1f, 1), F3(~3, ~0x1f, ~1), "[i+1]o,d", 0, v9 }, -{ "swapa", F3(3, 0x1f, 1), F3(~3, ~0x1f, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "swapa", F3(3, 0x1f, 1), F3(~3, ~0x1f, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* swap [rs1+0],d */ - -{ "restore", F3(2, 0x3d, 0), F3(~2, ~0x3d, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "restore", F3(2, 0x3d, 0), F3(~2, ~0x3d, ~0)|RD_G0|RS1_G0|ASI_RS2(~0), "", 0, v6 }, /* restore %g0,%g0,%g0 */ -{ "restore", F3(2, 0x3d, 1), F3(~2, ~0x3d, ~1), "1,i,d", 0, v6 }, -{ "restore", F3(2, 0x3d, 1), F3(~2, ~0x3d, ~1)|RD_G0|RS1_G0|SIMM13(~0), "", 0, v6 }, /* restore %g0,0,%g0 */ - -{ "rett", F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|RD_G0|ASI(~0), "1+2", F_DELAYED, v6 }, /* rett rs1+rs2 */ -{ "rett", F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|RD_G0|ASI_RS2(~0), "1", F_DELAYED, v6 }, /* rett rs1,%g0 */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0, "1+i", F_DELAYED, v6 }, /* rett rs1+X */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0, "i+1", F_DELAYED, v6 }, /* rett X+rs1 */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0|RS1_G0,"i", F_DELAYED, v6 }, /* rett X+rs1 */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0|RS1_G0, "i", F_DELAYED, v6 }, /* rett X */ -{ "rett", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0|SIMM13(~0), "1", F_DELAYED, v6 }, /* rett rs1+0 */ - -{ "save", F3(2, 0x3c, 0), F3(~2, ~0x3c, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "save", F3(2, 0x3c, 1), F3(~2, ~0x3c, ~1), "1,i,d", 0, v6 }, -{ "save", 0x81e00000, ~0x81e00000, "", F_ALIAS, v6 }, - -{ "ret", F3(2, 0x38, 1)|RS1(0x1f)|SIMM13(8), F3(~2, ~0x38, ~1)|SIMM13(~8), "", F_DELAYED, v6 }, /* jmpl %i7+8,%g0 */ -{ "retl", F3(2, 0x38, 1)|RS1(0x0f)|SIMM13(8), F3(~2, ~0x38, ~1)|RS1(~0x0f)|SIMM13(~8), "", F_DELAYED, v6 }, /* jmpl %o7+8,%g0 */ - -{ "jmpl", F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|ASI(~0), "1+2,d", F_DELAYED, v6 }, -{ "jmpl", F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|ASI_RS2(~0), "1,d", F_DELAYED, v6 }, /* jmpl rs1+%g0,d */ -{ "jmpl", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|SIMM13(~0), "1,d", F_DELAYED, v6 }, /* jmpl rs1+0,d */ -{ "jmpl", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RS1_G0, "i,d", F_DELAYED, v6 }, /* jmpl %g0+i,d */ -{ "jmpl", F3(2, 0x38, 1), F3(~2, ~0x38, ~1), "1+i,d", F_DELAYED, v6 }, -{ "jmpl", F3(2, 0x38, 1), F3(~2, ~0x38, ~1), "i+1,d", F_DELAYED, v6 }, - -{ "done", F3(2, 0x3e, 1)|RD(0), F3(~2, ~0x3e, ~1)|RD(~0)|RS1_G0|SIMM13(~0), "", 0, v9 }, -{ "retry", F3(2, 0x3e, 1)|RD(1), F3(~2, ~0x3e, ~1)|RD(~1)|RS1_G0|SIMM13(~0), "", 0, v9 }, -{ "saved", F3(2, 0x31, 1)|RD(0), F3(~2, ~0x31, ~1)|RD(~0)|RS1_G0|SIMM13(~0), "", 0, v9 }, -{ "restored", F3(2, 0x31, 1)|RD(1), F3(~2, ~0x31, ~1)|RD(~1)|RS1_G0|SIMM13(~0), "", 0, v9 }, -{ "sigm", F3(2, 0x30, 0)|RD(0xf), F3(~2, ~0x30, ~0)|RD(~0xf)|RS1_G0|SIMM13(~0), "", 0, v9 }, - -{ "flush", F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI(~0), "1+2", 0, v8 }, -{ "flush", F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI_RS2(~0), "1", 0, v8 }, /* flush rs1+%g0 */ -{ "flush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|SIMM13(~0), "1", 0, v8 }, /* flush rs1+0 */ -{ "flush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|RS1_G0, "i", 0, v8 }, /* flush %g0+i */ -{ "flush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1), "1+i", 0, v8 }, -{ "flush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1), "i+1", 0, v8 }, - -/* IFLUSH was renamed to FLUSH in v8. */ -{ "iflush", F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI(~0), "1+2", F_ALIAS, v6 }, -{ "iflush", F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI_RS2(~0), "1", F_ALIAS, v6 }, /* flush rs1+%g0 */ -{ "iflush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|SIMM13(~0), "1", F_ALIAS, v6 }, /* flush rs1+0 */ -{ "iflush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|RS1_G0, "i", F_ALIAS, v6 }, -{ "iflush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1), "1+i", F_ALIAS, v6 }, -{ "iflush", F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1), "i+1", F_ALIAS, v6 }, - -{ "return", F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|ASI(~0), "1+2", 0, v9 }, -{ "return", F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|ASI_RS2(~0), "1", 0, v9 }, /* return rs1+%g0 */ -{ "return", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|SIMM13(~0), "1", 0, v9 }, /* return rs1+0 */ -{ "return", F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RS1_G0, "i", 0, v9 }, /* return %g0+i */ -{ "return", F3(2, 0x39, 1), F3(~2, ~0x39, ~1), "1+i", 0, v9 }, -{ "return", F3(2, 0x39, 1), F3(~2, ~0x39, ~1), "i+1", 0, v9 }, - -{ "flushw", F3(2, 0x2b, 0), F3(~2, ~0x2b, ~0)|RD_G0|RS1_G0|ASI_RS2(~0), "", 0, v9 }, - -{ "membar", F3(2, 0x28, 1)|RS1(0xf), F3(~2, ~0x28, ~1)|RD_G0|RS1(~0xf)|ASI(~0), "K", 0, v9 }, -{ "stbar", F3(2, 0x28, 0)|RS1(0xf), F3(~2, ~0x28, ~0)|RD_G0|RS1(~0xf)|SIMM13(~0), "", 0, v8 }, - -{ "prefetch", F3(3, 0x2d, 0), F3(~3, ~0x2d, ~0), "[1+2],*", 0, v9 }, -{ "prefetch", F3(3, 0x2d, 0), F3(~3, ~0x2d, ~0)|RS2_G0, "[1],*", 0, v9 }, /* prefetch [rs1+%g0],prefetch_fcn */ -{ "prefetch", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1), "[1+i],*", 0, v9 }, -{ "prefetch", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1), "[i+1],*", 0, v9 }, -{ "prefetch", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1)|RS1_G0, "[i],*", 0, v9 }, -{ "prefetch", F3(3, 0x2d, 1), F3(~3, ~0x2d, ~1)|SIMM13(~0), "[1],*", 0, v9 }, /* prefetch [rs1+0],prefetch_fcn */ -{ "prefetcha", F3(3, 0x3d, 0), F3(~3, ~0x3d, ~0), "[1+2]A,*", 0, v9 }, -{ "prefetcha", F3(3, 0x3d, 0), F3(~3, ~0x3d, ~0)|RS2_G0, "[1]A,*", 0, v9 }, /* prefetcha [rs1+%g0],prefetch_fcn */ -{ "prefetcha", F3(3, 0x3d, 1), F3(~3, ~0x3d, ~1), "[1+i]o,d", 0, v9 }, -{ "prefetcha", F3(3, 0x3d, 1), F3(~3, ~0x3d, ~1), "[i+1]o,d", 0, v9 }, -{ "prefetcha", F3(3, 0x3d, 1), F3(~3, ~0x3d, ~1)|RS1_G0, "[i]o,d", 0, v9 }, -{ "prefetcha", F3(3, 0x3d, 1), F3(~3, ~0x3d, ~1)|SIMM13(~0), "[1]o,d", 0, v9 }, /* prefetcha [rs1+0],d */ - - /* The 1<<12 is a long story. It is necessary. For more info, please contact rich@cygnus.com */ -{ "sll", F3(2, 0x25, 0), F3(~2, ~0x25, ~0)|(1<<12)|ASI(~0), "1,2,d", 0, v6 }, -{ "sll", F3(2, 0x25, 1), F3(~2, ~0x25, ~1)|(1<<12), "1,i,d", 0, v6 }, -{ "sra", F3(2, 0x27, 0), F3(~2, ~0x27, ~0)|(1<<12)|ASI(~0), "1,2,d", 0, v6 }, -{ "sra", F3(2, 0x27, 1), F3(~2, ~0x27, ~1)|(1<<12), "1,i,d", 0, v6 }, -{ "srl", F3(2, 0x26, 0), F3(~2, ~0x26, ~0)|(1<<12)|ASI(~0), "1,2,d", 0, v6 }, -{ "srl", F3(2, 0x26, 1), F3(~2, ~0x26, ~1)|(1<<12), "1,i,d", 0, v6 }, - -{ "sllx", F3(2, 0x25, 0)|(1<<12), F3(~2, ~0x25, ~0)|(ASI(~0)^(1<<12)), "1,2,d", 0, v9 }, -{ "sllx", F3(2, 0x25, 1)|(1<<12), F3(~2, ~0x25, ~1), "1,i,d", 0, v9 }, -{ "srax", F3(2, 0x27, 0)|(1<<12), F3(~2, ~0x27, ~0)|(ASI(~0)^(1<<12)), "1,2,d", 0, v9 }, -{ "srax", F3(2, 0x27, 1)|(1<<12), F3(~2, ~0x27, ~1), "1,i,d", 0, v9 }, -{ "srlx", F3(2, 0x26, 0)|(1<<12), F3(~2, ~0x26, ~0)|(ASI(~0)^(1<<12)), "1,2,d", 0, v9 }, -{ "srlx", F3(2, 0x26, 1)|(1<<12), F3(~2, ~0x26, ~1), "1,i,d", 0, v9 }, - -{ "mulscc", F3(2, 0x24, 0), F3(~2, ~0x24, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "mulscc", F3(2, 0x24, 1), F3(~2, ~0x24, ~1), "1,i,d", 0, v6 }, - -{ "divscc", F3(2, 0x1d, 0), F3(~2, ~0x1d, ~0)|ASI(~0), "1,2,d", 0, sparclite }, -{ "divscc", F3(2, 0x1d, 1), F3(~2, ~0x1d, ~1), "1,i,d", 0, sparclite }, - -{ "scan", F3(2, 0x2c, 0), F3(~2, ~0x2c, ~0)|ASI(~0), "1,2,d", 0, sparclite }, -{ "scan", F3(2, 0x2c, 1), F3(~2, ~0x2c, ~1), "1,i,d", 0, sparclite }, - -{ "popc", F3(2, 0x2e, 0), F3(~2, ~0x2e, ~0)|RS2_G0|ASI(~0),"2,d", 0, v9 }, -{ "popc", F3(2, 0x2e, 1), F3(~2, ~0x2e, ~1)|RS2_G0, "i,d", 0, v9 }, - -{ "clr", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|RD_G0|RS1_G0|ASI_RS2(~0), "d", F_ALIAS, v6 }, /* or %g0,%g0,d */ -{ "clr", F3(2, 0x02, 1), F3(~2, ~0x02, ~1)|RS1_G0|SIMM13(~0), "d", F_ALIAS, v6 }, /* or %g0,0,d */ -{ "clr", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|RD_G0|ASI(~0), "[1+2]", F_ALIAS, v6 }, -{ "clr", F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|RD_G0|ASI_RS2(~0), "[1]", F_ALIAS, v6 }, /* st %g0,[rs1+%g0] */ -{ "clr", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0, "[1+i]", F_ALIAS, v6 }, -{ "clr", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0, "[i+1]", F_ALIAS, v6 }, -{ "clr", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0|RS1_G0, "[i]", F_ALIAS, v6 }, -{ "clr", F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0|SIMM13(~0), "[1]", F_ALIAS, v6 }, /* st %g0,[rs1+0] */ - -{ "clrb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|RD_G0|ASI(~0), "[1+2]", F_ALIAS, v6 }, -{ "clrb", F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|RD_G0|ASI_RS2(~0), "[1]", F_ALIAS, v6 }, /* stb %g0,[rs1+%g0] */ -{ "clrb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0, "[1+i]", F_ALIAS, v6 }, -{ "clrb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0, "[i+1]", F_ALIAS, v6 }, -{ "clrb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0|RS1_G0, "[i]", F_ALIAS, v6 }, -{ "clrb", F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0|SIMM13(~0), "[1]", F_ALIAS, v6 }, /* clrb [rs1+0],d */ - -{ "clrh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|RD_G0|ASI(~0), "[1+2]", F_ALIAS, v6 }, -{ "clrh", F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|RD_G0|ASI_RS2(~0), "[1]", F_ALIAS, v6 }, /* sth %g0,[rs1+%g0] */ -{ "clrh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0, "[1+i]", F_ALIAS, v6 }, -{ "clrh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0, "[i+1]", F_ALIAS, v6 }, -{ "clrh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0|RS1_G0, "[i]", F_ALIAS, v6 }, -{ "clrh", F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0|SIMM13(~0), "[1]", F_ALIAS, v6 }, /* clrb [rs1+0],d */ - -{ "orcc", F3(2, 0x12, 0), F3(~2, ~0x12, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "orcc", F3(2, 0x12, 1), F3(~2, ~0x12, ~1), "1,i,d", 0, v6 }, -{ "orcc", F3(2, 0x12, 1), F3(~2, ~0x12, ~1), "i,1,d", 0, v6 }, - -/* This is not a commutative instruction. */ -{ "orncc", F3(2, 0x16, 0), F3(~2, ~0x16, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "orncc", F3(2, 0x16, 1), F3(~2, ~0x16, ~1), "1,i,d", 0, v6 }, - -/* This is not a commutative instruction. */ -{ "orn", F3(2, 0x06, 0), F3(~2, ~0x06, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "orn", F3(2, 0x06, 1), F3(~2, ~0x06, ~1), "1,i,d", 0, v6 }, - -{ "tst", F3(2, 0x12, 0), F3(~2, ~0x12, ~0)|RD_G0|ASI_RS2(~0), "1", 0, v6 }, /* orcc rs1, %g0, %g0 */ -{ "tst", F3(2, 0x12, 0), F3(~2, ~0x12, ~0)|RD_G0|RS1_G0|ASI(~0), "2", 0, v6 }, /* orcc %g0, rs2, %g0 */ -{ "tst", F3(2, 0x12, 1), F3(~2, ~0x12, ~1)|RD_G0|SIMM13(~0), "1", 0, v6 }, /* orcc rs1, 0, %g0 */ - -{ "wr", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|ASI(~0), "1,2,m", 0, v8 }, /* wr r,r,%asrX */ -{ "wr", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|RD_G0|ASI(~0), "1,2,y", 0, v6 }, /* wr r,r,%y */ -{ "wr", F3(2, 0x30, 1), F3(~2, ~0x30, ~1), "1,i,m", 0, v8 }, /* wr r,i,%asrX */ -{ "wr", F3(2, 0x30, 1), F3(~2, ~0x30, ~1)|RD_G0, "1,i,y", 0, v6 }, /* wr r,i,%y */ -{ "wr", F3(2, 0x31, 0), F3(~2, ~0x31, ~0)|RD_G0|ASI(~0), "1,2,p", 0, v6 }, /* wr r,r,%psr */ -{ "wr", F3(2, 0x31, 1), F3(~2, ~0x31, ~1)|RD_G0, "1,i,p", 0, v6 }, /* wr r,i,%psr */ -{ "wr", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|RD_G0|ASI(~0), "1,2,w", 0, v6 }, /* wr r,r,%wim */ -{ "wr", F3(2, 0x32, 1), F3(~2, ~0x32, ~1)|RD_G0, "1,i,w", 0, v6 }, /* wr r,i,%wim */ -{ "wr", F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|RD_G0|ASI(~0), "1,2,t", 0, v6 }, /* wr r,r,%tbr */ -{ "wr", F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|RD_G0|ASI(~0), "1,2,o", 0, v9 }, /* wr r,r,%asi */ -{ "wr", F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|RD_G0, "1,i,t", 0, v6 }, /* wr r,i,%tbr */ -{ "wr", F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|RD_G0, "1,i,o", 0, v9 }, /* wr r,i,%asi */ - -{ "wr", F3(2, 0x30, 0)|RD(0), F3(~2, ~0x30, ~0)|RD(~0)|ASI(~0), "1,2,y", 0, v9 }, -{ "wr", F3(2, 0x30, 1)|RD(0), F3(~2, ~0x30, ~1)|RD(~0), "1,i,y", 0, v9 }, -{ "wr", F3(2, 0x30, 0)|RD(2), F3(~2, ~0x30, ~0)|RD(~2)|ASI(~0), "1,2,E", 0, v9 }, -{ "wr", F3(2, 0x30, 1)|RD(2), F3(~2, ~0x30, ~1)|RD(~2), "1,i,E", 0, v9 }, -{ "wr", F3(2, 0x30, 0)|RD(3), F3(~2, ~0x30, ~0)|RD(~3)|ASI(~0), "1,2,o", 0, v9 }, -{ "wr", F3(2, 0x30, 1)|RD(3), F3(~2, ~0x30, ~1)|RD(~3), "1,i,o", 0, v9 }, -{ "wr", F3(2, 0x30, 0)|RD(6), F3(~2, ~0x30, ~0)|RD(~6)|ASI(~0), "1,2,s", 0, v9 }, -{ "wr", F3(2, 0x30, 1)|RD(6), F3(~2, ~0x30, ~1)|RD(~6), "1,i,s", 0, v9 }, - -{ "rd", F3(2, 0x28, 0), F3(~2, ~0x28, ~0)|SIMM13(~0), "M,d", 0, v8 }, /* rd %asr1,r */ -{ "rd", F3(2, 0x28, 0), F3(~2, ~0x28, ~0)|RS1_G0|SIMM13(~0), "y,d", 0, v6 }, /* rd %y,r */ -{ "rd", F3(2, 0x29, 0), F3(~2, ~0x29, ~0)|RS1_G0|SIMM13(~0), "p,d", 0, v6 }, /* rd %psr,r */ -{ "rd", F3(2, 0x2a, 0), F3(~2, ~0x2a, ~0)|RS1_G0|SIMM13(~0), "w,d", 0, v6 }, /* rd %wim,r */ -{ "rd", F3(2, 0x2b, 0), F3(~2, ~0x2b, ~0)|RS1_G0|SIMM13(~0), "t,d", 0, v6 }, /* rd %tbr,r */ - -{ "rd", F3(2, 0x28, 0)|RS1(2), F3(~2, ~0x28, ~0)|RS1(~2)|SIMM13(~0), "E,d", 0, v9 }, /* rd %ccr,r */ -{ "rd", F3(2, 0x28, 0)|RS1(3), F3(~2, ~0x28, ~0)|RS1(~3)|SIMM13(~0), "o,d", 0, v9 }, /* rd %asi,r */ -{ "rd", F3(2, 0x28, 0)|RS1(4), F3(~2, ~0x28, ~0)|RS1(~4)|SIMM13(~0), "W,d", 0, v9 }, /* rd %tick,r */ -{ "rd", F3(2, 0x28, 0)|RS1(5), F3(~2, ~0x28, ~0)|RS1(~5)|SIMM13(~0), "P,d", 0, v9 }, /* rd %pc,r */ -{ "rd", F3(2, 0x2b, 0)|RS1(6), F3(~2, ~0x2b, ~0)|RS1(~6)|SIMM13(~0), "s,d", 0, v9 }, /* rd %fprs,r */ - -{ "rdpr", F3(2, 0x2a, 0), F3(~2, ~0x2a, ~0)|SIMM13(~0), "?,d", 0, v9 }, /* rdpr %priv_reg,r */ -{ "wrpr", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|SIMM13(~0), "1,2,!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|SIMM13(~0), "1,!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|SIMM13(~0), "!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 1), F3(~2, ~0x32, ~1), "1,i,!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 1), F3(~2, ~0x32, ~1), "i,1,!", 0, v9 }, -{ "wrpr", F3(2, 0x32, 1), F3(~2, ~0x32, ~1), "i,!", 0, v9 }, - -{ "mov", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|ASI(~0), "1,2,m", F_ALIAS, v8 }, /* wr r,r,%asrX */ -{ "mov", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|RD_G0|ASI(~0), "1,2,y", F_ALIAS, v6 }, /* wr r,r,%y */ -{ "mov", F3(2, 0x30, 1), F3(~2, ~0x30, ~1), "1,i,m", F_ALIAS, v8 }, /* wr r,i,%asrX */ -{ "mov", F3(2, 0x30, 1), F3(~2, ~0x30, ~1)|RD_G0, "1,i,y", F_ALIAS, v6 }, /* wr r,i,%y */ -{ "mov", F3(2, 0x31, 0), F3(~2, ~0x31, ~0)|RD_G0|ASI(~0), "1,2,p", F_ALIAS, v6 }, /* wr r,r,%psr */ -{ "mov", F3(2, 0x31, 1), F3(~2, ~0x31, ~1)|RD_G0, "1,i,p", F_ALIAS, v6 }, /* wr r,i,%psr */ -{ "mov", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|RD_G0|ASI(~0), "1,2,w", F_ALIAS, v6 }, /* wr r,r,%wim */ -{ "mov", F3(2, 0x32, 1), F3(~2, ~0x32, ~1)|RD_G0, "1,i,w", F_ALIAS, v6 }, /* wr r,i,%wim */ -{ "mov", F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|RD_G0|ASI(~0), "1,2,t", F_ALIAS, v6 }, /* wr r,r,%tbr */ -{ "mov", F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|RD_G0, "1,i,t", F_ALIAS, v6 }, /* wr r,i,%tbr */ - -{ "mov", F3(2, 0x28, 0), F3(~2, ~0x28, ~0)|SIMM13(~0), "M,d", F_ALIAS, v8 }, /* rd %asr1,r */ -{ "mov", F3(2, 0x28, 0), F3(~2, ~0x28, ~0)|RS1_G0|SIMM13(~0), "y,d", F_ALIAS, v6 }, /* rd %y,r */ -{ "mov", F3(2, 0x29, 0), F3(~2, ~0x29, ~0)|RS1_G0|SIMM13(~0), "p,d", F_ALIAS, v6 }, /* rd %psr,r */ -{ "mov", F3(2, 0x2a, 0), F3(~2, ~0x2a, ~0)|RS1_G0|SIMM13(~0), "w,d", F_ALIAS, v6 }, /* rd %wim,r */ -{ "mov", F3(2, 0x2b, 0), F3(~2, ~0x2b, ~0)|RS1_G0|SIMM13(~0), "t,d", F_ALIAS, v6 }, /* rd %tbr,r */ - -{ "mov", F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|ASI_RS2(~0), "1,y", F_ALIAS, v6 }, /* wr rs1,%g0,%y */ -{ "mov", F3(2, 0x30, 1), F3(~2, ~0x30, ~1), "i,y", F_ALIAS, v6 }, -{ "mov", F3(2, 0x30, 1), F3(~2, ~0x30, ~1)|SIMM13(~0), "1,y", F_ALIAS, v6 }, /* wr rs1,0,%y */ -{ "mov", F3(2, 0x31, 0), F3(~2, ~0x31, ~0)|ASI_RS2(~0), "1,p", F_ALIAS, v6 }, /* wr rs1,%g0,%psr */ -{ "mov", F3(2, 0x31, 1), F3(~2, ~0x31, ~1), "i,p", F_ALIAS, v6 }, -{ "mov", F3(2, 0x31, 1), F3(~2, ~0x31, ~1)|SIMM13(~0), "1,p", F_ALIAS, v6 }, /* wr rs1,0,%psr */ -{ "mov", F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|ASI_RS2(~0), "1,w", F_ALIAS, v6 }, /* wr rs1,%g0,%wim */ -{ "mov", F3(2, 0x32, 1), F3(~2, ~0x32, ~1), "i,w", F_ALIAS, v6 }, -{ "mov", F3(2, 0x32, 1), F3(~2, ~0x32, ~1)|SIMM13(~0), "1,w", F_ALIAS, v6 }, /* wr rs1,0,%wim */ -{ "mov", F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|ASI_RS2(~0), "1,t", F_ALIAS, v6 }, /* wr rs1,%g0,%tbr */ -{ "mov", F3(2, 0x33, 1), F3(~2, ~0x33, ~1), "i,t", F_ALIAS, v6 }, -{ "mov", F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|SIMM13(~0), "1,t", F_ALIAS, v6 }, /* wr rs1,0,%tbr */ - -{ "mov", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|RS1_G0|ASI(~0), "2,d", 0, v6 }, /* or %g0,rs2,d */ -{ "mov", F3(2, 0x02, 1), F3(~2, ~0x02, ~1)|RS1_G0, "i,d", 0, v6 }, /* or %g0,i,d */ -{ "mov", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|ASI_RS2(~0), "1,d", 0, v6 }, /* or rs1,%g0,d */ -{ "mov", F3(2, 0x02, 1), F3(~2, ~0x02, ~1)|SIMM13(~0), "1,d", 0, v6 }, /* or rs1,0,d */ - -{ "or", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "or", F3(2, 0x02, 1), F3(~2, ~0x02, ~1), "1,i,d", 0, v6 }, -{ "or", F3(2, 0x02, 1), F3(~2, ~0x02, ~1), "i,1,d", 0, v6 }, - -{ "bset", F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|ASI(~0), "2,r", F_ALIAS, v6 }, /* or rd,rs2,rd */ -{ "bset", F3(2, 0x02, 1), F3(~2, ~0x02, ~1), "i,r", F_ALIAS, v6 }, /* or rd,i,rd */ - -/* This is not a commutative instruction. */ -{ "andn", F3(2, 0x05, 0), F3(~2, ~0x05, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "andn", F3(2, 0x05, 1), F3(~2, ~0x05, ~1), "1,i,d", 0, v6 }, - -/* This is not a commutative instruction. */ -{ "andncc", F3(2, 0x15, 0), F3(~2, ~0x15, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "andncc", F3(2, 0x15, 1), F3(~2, ~0x15, ~1), "1,i,d", 0, v6 }, - -{ "bclr", F3(2, 0x05, 0), F3(~2, ~0x05, ~0)|ASI(~0), "2,r", F_ALIAS, v6 }, /* andn rd,rs2,rd */ -{ "bclr", F3(2, 0x05, 1), F3(~2, ~0x05, ~1), "i,r", F_ALIAS, v6 }, /* andn rd,i,rd */ - -{ "cmp", F3(2, 0x14, 0), F3(~2, ~0x14, ~0)|RD_G0|ASI(~0), "1,2", 0, v6 }, /* subcc rs1,rs2,%g0 */ -{ "cmp", F3(2, 0x14, 1), F3(~2, ~0x14, ~1)|RD_G0, "1,i", 0, v6 }, /* subcc rs1,i,%g0 */ - -{ "sub", F3(2, 0x04, 0), F3(~2, ~0x04, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "sub", F3(2, 0x04, 1), F3(~2, ~0x04, ~1), "1,i,d", 0, v6 }, - -{ "subcc", F3(2, 0x14, 0), F3(~2, ~0x14, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "subcc", F3(2, 0x14, 1), F3(~2, ~0x14, ~1), "1,i,d", 0, v6 }, - -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "subx", F3(2, 0x0c, 0), F3(~2, ~0x0c, ~0)|ASI(~0), "1,2,d", F_ALIAS, v6 }, -{ "subx", F3(2, 0x0c, 1), F3(~2, ~0x0c, ~1), "1,i,d", F_ALIAS, v6 }, -{ "subc", F3(2, 0x0c, 0), F3(~2, ~0x0c, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "subc", F3(2, 0x0c, 1), F3(~2, ~0x0c, ~1), "1,i,d", 0, v9 }, - -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "subxcc", F3(2, 0x1c, 0), F3(~2, ~0x1c, ~0)|ASI(~0), "1,2,d", F_ALIAS, v6 }, -{ "subxcc", F3(2, 0x1c, 1), F3(~2, ~0x1c, ~1), "1,i,d", F_ALIAS, v6 }, -{ "subccc", F3(2, 0x1c, 0), F3(~2, ~0x1c, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "subccc", F3(2, 0x1c, 1), F3(~2, ~0x1c, ~1), "1,i,d", 0, v9 }, - -{ "and", F3(2, 0x01, 0), F3(~2, ~0x01, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "and", F3(2, 0x01, 1), F3(~2, ~0x01, ~1), "1,i,d", 0, v6 }, -{ "and", F3(2, 0x01, 1), F3(~2, ~0x01, ~1), "i,1,d", 0, v6 }, - -{ "andcc", F3(2, 0x11, 0), F3(~2, ~0x11, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "andcc", F3(2, 0x11, 1), F3(~2, ~0x11, ~1), "1,i,d", 0, v6 }, -{ "andcc", F3(2, 0x11, 1), F3(~2, ~0x11, ~1), "i,1,d", 0, v6 }, - -{ "dec", F3(2, 0x04, 1)|SIMM13(0x1), F3(~2, ~0x04, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 }, /* sub rd,1,rd */ -{ "dec", F3(2, 0x04, 1), F3(~2, ~0x04, ~1), "i,r", F_ALIAS, v8 }, /* sub rd,imm,rd */ -{ "deccc", F3(2, 0x14, 1)|SIMM13(0x1), F3(~2, ~0x14, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 }, /* subcc rd,1,rd */ -{ "deccc", F3(2, 0x14, 1), F3(~2, ~0x14, ~1), "i,r", F_ALIAS, v8 }, /* subcc rd,imm,rd */ -{ "inc", F3(2, 0x00, 1)|SIMM13(0x1), F3(~2, ~0x00, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 }, /* add rd,1,rd */ -{ "inc", F3(2, 0x00, 1), F3(~2, ~0x00, ~1), "i,r", F_ALIAS, v8 }, /* add rd,imm,rd */ -{ "inccc", F3(2, 0x10, 1)|SIMM13(0x1), F3(~2, ~0x10, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 }, /* addcc rd,1,rd */ -{ "inccc", F3(2, 0x10, 1), F3(~2, ~0x10, ~1), "i,r", F_ALIAS, v8 }, /* addcc rd,imm,rd */ - -{ "btst", F3(2, 0x11, 0), F3(~2, ~0x11, ~0)|RD_G0|ASI(~0), "1,2", F_ALIAS, v6 }, /* andcc rs1,rs2,%g0 */ -{ "btst", F3(2, 0x11, 1), F3(~2, ~0x11, ~1)|RD_G0, "i,1", F_ALIAS, v6 }, /* andcc rs1,i,%g0 */ - -{ "neg", F3(2, 0x04, 0), F3(~2, ~0x04, ~0)|RS1_G0|ASI(~0), "2,d", F_ALIAS, v6 }, /* sub %g0,rs2,rd */ -{ "neg", F3(2, 0x04, 0), F3(~2, ~0x04, ~0)|RS1_G0|ASI(~0), "r", F_ALIAS, v6 }, /* sub %g0,rd,rd */ - -{ "add", F3(2, 0x00, 0), F3(~2, ~0x00, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "add", F3(2, 0x00, 1), F3(~2, ~0x00, ~1), "1,i,d", 0, v6 }, -{ "add", F3(2, 0x00, 1), F3(~2, ~0x00, ~1), "i,1,d", 0, v6 }, -{ "addcc", F3(2, 0x10, 0), F3(~2, ~0x10, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "addcc", F3(2, 0x10, 1), F3(~2, ~0x10, ~1), "1,i,d", 0, v6 }, -{ "addcc", F3(2, 0x10, 1), F3(~2, ~0x10, ~1), "i,1,d", 0, v6 }, -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "addx", F3(2, 0x08, 0), F3(~2, ~0x08, ~0)|ASI(~0), "1,2,d", F_ALIAS, v6 }, -{ "addx", F3(2, 0x08, 1), F3(~2, ~0x08, ~1), "1,i,d", F_ALIAS, v6 }, -{ "addx", F3(2, 0x08, 1), F3(~2, ~0x08, ~1), "i,1,d", F_ALIAS, v6 }, -{ "addc", F3(2, 0x08, 0), F3(~2, ~0x08, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "addc", F3(2, 0x08, 1), F3(~2, ~0x08, ~1), "1,i,d", 0, v9 }, -{ "addc", F3(2, 0x08, 1), F3(~2, ~0x08, ~1), "i,1,d", 0, v9 }, -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "addxcc", F3(2, 0x18, 0), F3(~2, ~0x18, ~0)|ASI(~0), "1,2,d", F_ALIAS, v6 }, -{ "addxcc", F3(2, 0x18, 1), F3(~2, ~0x18, ~1), "1,i,d", F_ALIAS, v6 }, -{ "addxcc", F3(2, 0x18, 1), F3(~2, ~0x18, ~1), "i,1,d", F_ALIAS, v6 }, -{ "addccc", F3(2, 0x18, 0), F3(~2, ~0x18, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "addccc", F3(2, 0x18, 1), F3(~2, ~0x18, ~1), "1,i,d", 0, v9 }, -{ "addccc", F3(2, 0x18, 1), F3(~2, ~0x18, ~1), "i,1,d", 0, v9 }, - -{ "smul", F3(2, 0x0b, 0), F3(~2, ~0x0b, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "smul", F3(2, 0x0b, 1), F3(~2, ~0x0b, ~1), "1,i,d", 0, v8 }, -{ "smul", F3(2, 0x0b, 1), F3(~2, ~0x0b, ~1), "i,1,d", 0, v8 }, -{ "smulcc", F3(2, 0x1b, 0), F3(~2, ~0x1b, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "smulcc", F3(2, 0x1b, 1), F3(~2, ~0x1b, ~1), "1,i,d", 0, v8 }, -{ "smulcc", F3(2, 0x1b, 1), F3(~2, ~0x1b, ~1), "i,1,d", 0, v8 }, -{ "umul", F3(2, 0x0a, 0), F3(~2, ~0x0a, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "umul", F3(2, 0x0a, 1), F3(~2, ~0x0a, ~1), "1,i,d", 0, v8 }, -{ "umul", F3(2, 0x0a, 1), F3(~2, ~0x0a, ~1), "i,1,d", 0, v8 }, -{ "umulcc", F3(2, 0x1a, 0), F3(~2, ~0x1a, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "umulcc", F3(2, 0x1a, 1), F3(~2, ~0x1a, ~1), "1,i,d", 0, v8 }, -{ "umulcc", F3(2, 0x1a, 1), F3(~2, ~0x1a, ~1), "i,1,d", 0, v8 }, -{ "sdiv", F3(2, 0x0f, 0), F3(~2, ~0x0f, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "sdiv", F3(2, 0x0f, 1), F3(~2, ~0x0f, ~1), "1,i,d", 0, v8 }, -{ "sdiv", F3(2, 0x0f, 1), F3(~2, ~0x0f, ~1), "i,1,d", 0, v8 }, -{ "sdivcc", F3(2, 0x1f, 0), F3(~2, ~0x1f, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "sdivcc", F3(2, 0x1f, 1), F3(~2, ~0x1f, ~1), "1,i,d", 0, v8 }, -{ "sdivcc", F3(2, 0x1f, 1), F3(~2, ~0x1f, ~1), "i,1,d", 0, v8 }, -{ "udiv", F3(2, 0x0e, 0), F3(~2, ~0x0e, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "udiv", F3(2, 0x0e, 1), F3(~2, ~0x0e, ~1), "1,i,d", 0, v8 }, -{ "udiv", F3(2, 0x0e, 1), F3(~2, ~0x0e, ~1), "i,1,d", 0, v8 }, -{ "udivcc", F3(2, 0x1e, 0), F3(~2, ~0x1e, ~0)|ASI(~0), "1,2,d", 0, v8 }, -{ "udivcc", F3(2, 0x1e, 1), F3(~2, ~0x1e, ~1), "1,i,d", 0, v8 }, -{ "udivcc", F3(2, 0x1e, 1), F3(~2, ~0x1e, ~1), "i,1,d", 0, v8 }, - -{ "mulx", F3(2, 0x09, 0), F3(~2, ~0x09, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "mulx", F3(2, 0x09, 1), F3(~2, ~0x09, ~1), "1,i,d", 0, v9 }, -{ "sdivx", F3(2, 0x2d, 0), F3(~2, ~0x2d, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "sdivx", F3(2, 0x2d, 1), F3(~2, ~0x2d, ~1), "1,i,d", 0, v9 }, -{ "udivx", F3(2, 0x0d, 0), F3(~2, ~0x0d, ~0)|ASI(~0), "1,2,d", 0, v9 }, -{ "udivx", F3(2, 0x0d, 1), F3(~2, ~0x0d, ~1), "1,i,d", 0, v9 }, - -{ "call", F1(0x1), F1(~0x1), "L", F_DELAYED, v6 }, -{ "call", F1(0x1), F1(~0x1), "L,#", F_DELAYED, v6 }, -{ "call", F3(2, 0x38, 0)|RD(0xf), F3(~2, ~0x38, ~0)|RD(~0xf)|ASI_RS2(~0), "1", F_DELAYED, v6 }, /* jmpl rs1+%g0, %o7 */ -{ "call", F3(2, 0x38, 0)|RD(0xf), F3(~2, ~0x38, ~0)|RD(~0xf)|ASI_RS2(~0), "1,#", F_DELAYED, v6 }, - -/* 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. John Gilmore. */ - -/* Define branches -- one annulled, one without, etc. */ -#define br(opcode, mask, lose, flags) \ - { opcode, (mask)|ANNUL, (lose), ",a l", (flags), v6 }, \ - { opcode, (mask) , (lose)|ANNUL, "l", (flags), v6 } - -#define brx(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose)|ANNUL|BPRED, "Z,G", (flags), v9 }, \ - { opcode, (mask), (lose)|ANNUL|BPRED, ",N Z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a Z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a,N Z,G", (flags), v9 }, \ - { opcode, (mask)|BPRED, (lose)|ANNUL, ",T Z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL|BPRED, (lose), ",a,T Z,G", (flags), v9 }, \ - { opcode, (mask), (lose)|ANNUL|BPRED, "z,G", (flags), v9 }, \ - { opcode, (mask), (lose)|ANNUL|BPRED, ",N z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a,N z,G", (flags), v9 }, \ - { opcode, (mask)|BPRED, (lose)|ANNUL, ",T z,G", (flags), v9 }, \ - { opcode, (mask)|ANNUL|BPRED, (lose), ",a,T z,G", (flags), v9 } - -/* Define four traps: reg+reg, reg + immediate, immediate alone, reg alone. */ -#define tr(opcode, mask, lose, flags) \ - { opcode, (mask)|(2<<11)|IMMED, (lose)|RS1_G0, "Z,i", (flags), v9 }, /* %g0 + imm */ \ - { opcode, (mask)|(2<<11)|IMMED, (lose), "Z,1+i", (flags), v9 }, /* rs1 + imm */ \ - { opcode, (mask)|(2<<11), IMMED|(lose), "Z,1+2", (flags), v9 }, /* rs1 + rs2 */ \ - { opcode, (mask)|(2<<11), IMMED|(lose)|RS2_G0, "Z,1", (flags), v9 }, /* rs1 + %g0 */ \ - { opcode, (mask)|IMMED, (lose)|RS1_G0, "z,i", (flags)|F_ALIAS, v9 }, /* %g0 + imm */ \ - { opcode, (mask)|IMMED, (lose), "z,1+i", (flags)|F_ALIAS, v9 }, /* rs1 + imm */ \ - { opcode, (mask), IMMED|(lose), "z,1+2", (flags)|F_ALIAS, v9 }, /* rs1 + rs2 */ \ - { opcode, (mask), IMMED|(lose)|RS2_G0, "z,1", (flags)|F_ALIAS, v9 }, /* rs1 + %g0 */ \ - { opcode, (mask)|IMMED, (lose)|RS1_G0, "i", (flags), v6 }, /* %g0 + imm */ \ - { opcode, (mask)|IMMED, (lose), "1+i", (flags), v6 }, /* rs1 + imm */ \ - { opcode, (mask), IMMED|(lose), "1+2", (flags), v6 }, /* rs1 + rs2 */ \ - { opcode, (mask), IMMED|(lose)|RS2_G0, "1", (flags), v6 } /* rs1 + %g0 */ - -/* Define both branches and traps based on condition mask */ -#define cond(bop, top, mask, flags) \ - br(bop, F2(0, 2)|(mask), F2(~0, ~2)|((~mask)&COND(~0)), F_DELAYED|(flags)), \ - brx(bop, F2(0, 1)|(mask), F2(~0, ~1)|((~mask)&COND(~0)), F_DELAYED|(flags)), /* v9 */ \ - tr(top, F3(2, 0x3a, 0)|(mask), F3(~2, ~0x3a, 0)|((~mask)&COND(~0)), (flags)) - -/* Define all the conditions, all the branches, all the traps. */ - -cond ("b", "t", CONDA, 0), -cond ("ba", "ta", CONDA, F_ALIAS), /* for nothing */ -cond ("bcc", "tcc", CONDCC, 0), -cond ("bcs", "tcs", CONDCS, 0), -cond ("be", "te", CONDE, 0), -cond ("bg", "tg", CONDG, 0), -cond ("bgt", "tgt", CONDG, F_ALIAS), -cond ("bge", "tge", CONDGE, 0), -cond ("bgeu", "tgeu", CONDGEU, F_ALIAS), /* for cc */ -cond ("bgu", "tgu", CONDGU, 0), -cond ("bl", "tl", CONDL, 0), -cond ("blt", "tlt", CONDL, F_ALIAS), -cond ("ble", "tle", CONDLE, 0), -cond ("bleu", "tleu", CONDLEU, 0), -cond ("blu", "tlu", CONDLU, F_ALIAS), /* for cs */ -cond ("bn", "tn", CONDN, 0), -cond ("bne", "tne", CONDNE, 0), -cond ("bneg", "tneg", CONDNEG, 0), -cond ("bnz", "tnz", CONDNZ, F_ALIAS), /* for ne */ -cond ("bpos", "tpos", CONDPOS, 0), -cond ("bvc", "tvc", CONDVC, 0), -cond ("bvs", "tvs", CONDVS, 0), -cond ("bz", "tz", CONDZ, F_ALIAS), /* for e */ - -#undef cond -#undef br -#undef brr /* v9 */ -#undef tr - -#define brr(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose)|ANNUL|BPRED, "1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask), (lose)|ANNUL|BPRED, ",N 1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a 1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask)|ANNUL, (lose)|BPRED, ",a,N 1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask)|BPRED, (lose)|ANNUL, ",T 1,k", F_DELAYED|(flags), v9 }, \ - { opcode, (mask)|ANNUL|BPRED, (lose), ",a,T 1,k", F_DELAYED|(flags), v9 } - -#define condr(bop, mask, flags) /* v9 */ \ - brr(bop, F2(0, 3)|COND(mask), F2(~0, ~3)|COND(~(mask)), (flags)) /* v9 */ - -/* v9 */ condr("brnz", 0x5, 0), -/* v9 */ condr("brz", 0x1, 0), -/* v9 */ condr("brgez", 0x7, 0), -/* v9 */ condr("brlz", 0x3, 0), -/* v9 */ condr("brlez", 0x2, 0), -/* v9 */ condr("brgz", 0x6, 0), - -#undef condr /* v9 */ -#undef brr /* v9 */ - -#define movr(opcode, mask, flags) /* v9 */ \ - { opcode, F3(2, 0x2f, 0)|COND(mask), F3(~2, ~0x2f, ~0)|COND(~(mask)), "1,2,d", (flags), v9 }, \ - { opcode, F3(2, 0x2f, 1)|COND(mask), F3(~2, ~0x2f, ~1)|COND(~(mask)), "1,j,d", (flags), v9 } - -#define fmrrs(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose), "1,f,g", (flags), v9 } -#define fmrrd(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose), "1,B,H", (flags), v9 } -#define fmrrq(opcode, mask, lose, flags) /* v9 */ \ - { opcode, (mask), (lose), "1,R,J", (flags), v9 } - -#define fmovrs(mop, mask, flags) /* v9 */ \ - fmrrs(mop, F3(2, 0x35, 0)|OPF_LOW5(5)|COND(mask), F3(~2, ~0x35, 0)|OPF_LOW5(~5)|COND(~(mask)), (flags)) /* v9 */ -#define fmovrd(mop, mask, flags) /* v9 */ \ - fmrrd(mop, F3(2, 0x35, 0)|OPF_LOW5(6)|COND(mask), F3(~2, ~0x35, 0)|OPF_LOW5(~6)|COND(~(mask)), (flags)) /* v9 */ -#define fmovrq(mop, mask, flags) /* v9 */ \ - fmrrq(mop, F3(2, 0x35, 0)|OPF_LOW5(7)|COND(mask), F3(~2, ~0x35, 0)|OPF_LOW5(~7)|COND(~(mask)), (flags)) /* v9 */ - -/* v9 */ movr("movrne", 0x5, 0), -/* v9 */ movr("movre", 0x1, 0), -/* v9 */ movr("movrgez", 0x7, 0), -/* v9 */ movr("movrlz", 0x3, 0), -/* v9 */ movr("movrlez", 0x2, 0), -/* v9 */ movr("movrgz", 0x6, 0), -/* v9 */ movr("movrnz", 0x5, F_ALIAS), -/* v9 */ movr("movrz", 0x1, F_ALIAS), - -/* v9 */ fmovrs("fmovrsne", 0x5, 0), -/* v9 */ fmovrs("fmovrse", 0x1, 0), -/* v9 */ fmovrs("fmovrsgez", 0x7, 0), -/* v9 */ fmovrs("fmovrslz", 0x3, 0), -/* v9 */ fmovrs("fmovrslez", 0x2, 0), -/* v9 */ fmovrs("fmovrsgz", 0x6, 0), -/* v9 */ fmovrs("fmovrsnz", 0x5, F_ALIAS), -/* v9 */ fmovrs("fmovrsz", 0x1, F_ALIAS), - -/* v9 */ fmovrd("fmovrdne", 0x5, 0), -/* v9 */ fmovrd("fmovrde", 0x1, 0), -/* v9 */ fmovrd("fmovrdgez", 0x7, 0), -/* v9 */ fmovrd("fmovrdlz", 0x3, 0), -/* v9 */ fmovrd("fmovrdlez", 0x2, 0), -/* v9 */ fmovrd("fmovrdgz", 0x6, 0), -/* v9 */ fmovrd("fmovrdnz", 0x5, F_ALIAS), -/* v9 */ fmovrd("fmovrdz", 0x1, F_ALIAS), - -/* v9 */ fmovrq("fmovrqne", 0x5, 0), -/* v9 */ fmovrq("fmovrqe", 0x1, 0), -/* v9 */ fmovrq("fmovrqgez", 0x7, 0), -/* v9 */ fmovrq("fmovrqlz", 0x3, 0), -/* v9 */ fmovrq("fmovrqlez", 0x2, 0), -/* v9 */ fmovrq("fmovrqgz", 0x6, 0), -/* v9 */ fmovrq("fmovrqnz", 0x5, F_ALIAS), -/* v9 */ fmovrq("fmovrqz", 0x1, F_ALIAS), - -#undef movr /* v9 */ -#undef fmovr /* v9 */ -#undef fmrr /* v9 */ - -{ "mova", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~0)|F3(~2, ~0x2c,~1), "6,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDA,0), MCOND(~FCONDA,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|MCOND(CONDA,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDA,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|MCOND(CONDA,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDA,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 0)|MCOND(CONDA,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDA,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "mova", F3(2, 0x2c, 1)|MCOND(CONDA,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDA,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movcc", F3(2, 0x2c, 0)|MCOND(CONDCC,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDCC,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movcc", F3(2, 0x2c, 1)|MCOND(CONDCC,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDCC,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movcc", F3(2, 0x2c, 0)|MCOND(CONDCC,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDCC,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movcc", F3(2, 0x2c, 1)|MCOND(CONDCC,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDCC,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movgeu", F3(2, 0x2c, 0)|MCOND(CONDGEU,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGEU,~1)|XCC|(1<<12), "z,2,d", F_ALIAS, v9 }, -{ "movgeu", F3(2, 0x2c, 1)|MCOND(CONDGEU,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGEU,~1)|XCC|(1<<12), "z,I,d", F_ALIAS, v9 }, -{ "movgeu", F3(2, 0x2c, 0)|MCOND(CONDGEU,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGEU,~1)|(1<<12), "Z,2,d", F_ALIAS, v9 }, -{ "movgeu", F3(2, 0x2c, 1)|MCOND(CONDGEU,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGEU,~1)|(1<<12), "Z,I,d", F_ALIAS, v9 }, -{ "movcs", F3(2, 0x2c, 0)|MCOND(CONDCS,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDCS,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movcs", F3(2, 0x2c, 1)|MCOND(CONDCS,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDCS,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movcs", F3(2, 0x2c, 0)|MCOND(CONDCS,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDCS,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movcs", F3(2, 0x2c, 1)|MCOND(CONDCS,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDCS,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movlu", F3(2, 0x2c, 0)|MCOND(CONDLU,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLU,~1)|XCC|(1<<12), "z,2,d", F_ALIAS, v9 }, -{ "movlu", F3(2, 0x2c, 1)|MCOND(CONDLU,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLU,~1)|XCC|(1<<12), "z,I,d", F_ALIAS, v9 }, -{ "movlu", F3(2, 0x2c, 0)|MCOND(CONDLU,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLU,~1)|(1<<12), "Z,2,d", F_ALIAS, v9 }, -{ "movlu", F3(2, 0x2c, 1)|MCOND(CONDLU,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLU,~1)|(1<<12), "Z,I,d", F_ALIAS, v9 }, -{ "move", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDE,0), MCOND(~FCONDE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|MCOND(CONDE,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDE,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|MCOND(CONDE,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDE,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "move", F3(2, 0x2c, 0)|MCOND(CONDE,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDE,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "move", F3(2, 0x2c, 1)|MCOND(CONDE,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDE,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDG,0), MCOND(~FCONDG,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|MCOND(CONDG,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDG,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|MCOND(CONDG,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDG,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 0)|MCOND(CONDG,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDG,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movg", F3(2, 0x2c, 1)|MCOND(CONDG,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDG,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDGE,0), MCOND(~FCONDGE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|MCOND(CONDGE,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGE,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|MCOND(CONDGE,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGE,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 0)|MCOND(CONDGE,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGE,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movge", F3(2, 0x2c, 1)|MCOND(CONDGE,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGE,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movgu", F3(2, 0x2c, 0)|MCOND(CONDGU,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGU,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movgu", F3(2, 0x2c, 1)|MCOND(CONDGU,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGU,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movgu", F3(2, 0x2c, 0)|MCOND(CONDGU,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDGU,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movgu", F3(2, 0x2c, 1)|MCOND(CONDGU,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDGU,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDL,0), MCOND(~FCONDL,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|MCOND(CONDL,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDL,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|MCOND(CONDL,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDL,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 0)|MCOND(CONDL,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDL,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movl", F3(2, 0x2c, 1)|MCOND(CONDL,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDL,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDLE,0), MCOND(~FCONDLE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|MCOND(CONDLE,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLE,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|MCOND(CONDLE,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLE,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 0)|MCOND(CONDLE,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLE,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movle", F3(2, 0x2c, 1)|MCOND(CONDLE,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLE,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movleu", F3(2, 0x2c, 0)|MCOND(CONDLEU,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLEU,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movleu", F3(2, 0x2c, 1)|MCOND(CONDLEU,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLEU,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movleu", F3(2, 0x2c, 0)|MCOND(CONDLEU,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDLEU,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movleu", F3(2, 0x2c, 1)|MCOND(CONDLEU,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDLEU,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movlg", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDLG,0), MCOND(~FCONDLG,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDN,0), MCOND(~FCONDN,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|MCOND(CONDN,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDN,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|MCOND(CONDN,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDN,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 0)|MCOND(CONDN,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDN,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movn", F3(2, 0x2c, 1)|MCOND(CONDN,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDN,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDNE,0), MCOND(~FCONDNE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|MCOND(CONDNE,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNE,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|MCOND(CONDNE,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNE,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 0)|MCOND(CONDNE,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNE,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movne", F3(2, 0x2c, 1)|MCOND(CONDNE,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNE,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movneg", F3(2, 0x2c, 0)|MCOND(CONDNEG,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNEG,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movneg", F3(2, 0x2c, 1)|MCOND(CONDNEG,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNEG,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movneg", F3(2, 0x2c, 0)|MCOND(CONDNEG,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNEG,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movneg", F3(2, 0x2c, 1)|MCOND(CONDNEG,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNEG,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movnz", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDNZ,0), MCOND(~FCONDNZ,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 0)|MCOND(CONDNZ,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNZ,~1)|XCC|(1<<12), "z,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|MCOND(CONDNZ,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNZ,~1)|XCC|(1<<12), "z,I,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 0)|MCOND(CONDNZ,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDNZ,~1)|(1<<12), "Z,2,d", F_ALIAS, v9 }, -{ "movnz", F3(2, 0x2c, 1)|MCOND(CONDNZ,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDNZ,~1)|(1<<12), "Z,I,d", F_ALIAS, v9 }, -{ "movo", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movo", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDO,0), MCOND(~FCONDO,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movpos", F3(2, 0x2c, 0)|MCOND(CONDPOS,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDPOS,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movpos", F3(2, 0x2c, 1)|MCOND(CONDPOS,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDPOS,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movpos", F3(2, 0x2c, 0)|MCOND(CONDPOS,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDPOS,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movpos", F3(2, 0x2c, 1)|MCOND(CONDPOS,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDPOS,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movu", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDU,0), MCOND(~FCONDU,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movue", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDUE,0), MCOND(~FCONDUE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movug", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDUG,0), MCOND(~FCONDUG,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movuge", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDUGE,0), MCOND(~FCONDUGE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movul", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDUL,0), MCOND(~FCONDUL,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", 0, v9 }, -{ "movule", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDULE,0), MCOND(~FCONDULE,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", 0, v9 }, -{ "movvc", F3(2, 0x2c, 0)|MCOND(CONDVC,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDVC,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movvc", F3(2, 0x2c, 1)|MCOND(CONDVC,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDVC,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movvc", F3(2, 0x2c, 0)|MCOND(CONDVC,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDVC,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movvc", F3(2, 0x2c, 1)|MCOND(CONDVC,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDVC,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movvs", F3(2, 0x2c, 0)|MCOND(CONDVS,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDVS,~1)|XCC|(1<<12), "z,2,d", 0, v9 }, -{ "movvs", F3(2, 0x2c, 1)|MCOND(CONDVS,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDVS,~1)|XCC|(1<<12), "z,I,d", 0, v9 }, -{ "movvs", F3(2, 0x2c, 0)|MCOND(CONDVS,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDVS,~1)|(1<<12), "Z,2,d", 0, v9 }, -{ "movvs", F3(2, 0x2c, 1)|MCOND(CONDVS,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDVS,~1)|(1<<12), "Z,I,d", 0, v9 }, -{ "movz", F3(2, 0x2c, 0)|FCC(0)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~0)|F3(~2, ~0x2c, ~0), "6,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|FCC(0)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~0)|F3(~2, ~0x2c, ~1), "6,I,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 0)|FCC(1)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~1)|F3(~2, ~0x2c, ~0), "7,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|FCC(1)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~1)|F3(~2, ~0x2c, ~1), "7,I,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 0)|FCC(2)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~2)|F3(~2, ~0x2c, ~0), "8,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|FCC(2)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~2)|F3(~2, ~0x2c, ~1), "8,I,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 0)|FCC(3)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~3)|F3(~2, ~0x2c, ~0), "9,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|FCC(3)|MCOND(FCONDZ,0), MCOND(~FCONDZ,~0)|FCC(~3)|F3(~2, ~0x2c, ~1), "9,I,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 0)|MCOND(CONDZ,1)|ICC, F3(~2, ~0x2c, ~0)|MCOND(~CONDZ,~1)|XCC|(1<<12), "z,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|MCOND(CONDZ,1)|ICC, F3(~2, ~0x2c, ~1)|MCOND(~CONDZ,~1)|XCC|(1<<12), "z,I,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 0)|MCOND(CONDZ,1)|XCC, F3(~2, ~0x2c, ~0)|MCOND(~CONDZ,~1)|(1<<12), "Z,2,d", F_ALIAS, v9 }, -{ "movz", F3(2, 0x2c, 1)|MCOND(CONDZ,1)|XCC, F3(~2, ~0x2c, ~1)|MCOND(~CONDZ,~1)|(1<<12), "Z,I,d", F_ALIAS, v9 }, - -{ "fmovda", F3F(2, 0x35, 0x102)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDA,~0), "z,f,g", 0, v9 }, -{ "fmovda", F3F(2, 0x35, 0x082)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDA,~0), "6,f,g", 0, v9 }, -{ "fmovda", F3F(2, 0x35, 0x182)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDA,~0), "Z,f,g", 0, v9 }, -{ "fmovda", F3F(2, 0x35, 0x0a2)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDA,~0), "7,f,g", 0, v9 }, -{ "fmovda", F3F(2, 0x35, 0x0c2)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDA,~0), "8,f,g", 0, v9 }, -{ "fmovda", F3F(2, 0x35, 0x0e2)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDA,~0), "9,f,g", 0, v9 }, -{ "fmovqa", F3F(2, 0x35, 0x103)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDA,~0), "z,f,g", 0, v9 }, -{ "fmovqa", F3F(2, 0x35, 0x083)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDA,~0), "6,f,g", 0, v9 }, -{ "fmovqa", F3F(2, 0x35, 0x183)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDA,~0), "Z,f,g", 0, v9 }, -{ "fmovqa", F3F(2, 0x35, 0x0a3)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDA,~0), "7,f,g", 0, v9 }, -{ "fmovqa", F3F(2, 0x35, 0x0c3)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDA,~0), "8,f,g", 0, v9 }, -{ "fmovqa", F3F(2, 0x35, 0x0e3)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDA,~0), "9,f,g", 0, v9 }, -{ "fmovsa", F3F(2, 0x35, 0x101)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDA,~0), "z,f,g", 0, v9 }, -{ "fmovsa", F3F(2, 0x35, 0x081)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDA,~0), "6,f,g", 0, v9 }, -{ "fmovsa", F3F(2, 0x35, 0x181)|MCOND(CONDA,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDA,~0), "Z,f,g", 0, v9 }, -{ "fmovsa", F3F(2, 0x35, 0x0a1)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDA,~0), "7,f,g", 0, v9 }, -{ "fmovsa", F3F(2, 0x35, 0x0c1)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDA,~0), "8,f,g", 0, v9 }, -{ "fmovsa", F3F(2, 0x35, 0x0e1)|MCOND(FCONDA,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDA,~0), "9,f,g", 0, v9 }, -{ "fmovdcc", F3F(2, 0x35, 0x102)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDCC,~0), "z,f,g", 0, v9 }, -{ "fmovdcc", F3F(2, 0x35, 0x182)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDCC,~0), "Z,f,g", 0, v9 }, -{ "fmovqcc", F3F(2, 0x35, 0x103)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDCC,~0), "z,f,g", 0, v9 }, -{ "fmovqcc", F3F(2, 0x35, 0x183)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDCC,~0), "Z,f,g", 0, v9 }, -{ "fmovscc", F3F(2, 0x35, 0x101)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDCC,~0), "z,f,g", 0, v9 }, -{ "fmovscc", F3F(2, 0x35, 0x181)|MCOND(CONDCC,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDCC,~0), "Z,f,g", 0, v9 }, -{ "fmovdcs", F3F(2, 0x35, 0x102)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDCS,~0), "z,f,g", 0, v9 }, -{ "fmovdcs", F3F(2, 0x35, 0x182)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDCS,~0), "Z,f,g", 0, v9 }, -{ "fmovqcs", F3F(2, 0x35, 0x103)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDCS,~0), "z,f,g", 0, v9 }, -{ "fmovqcs", F3F(2, 0x35, 0x183)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDCS,~0), "Z,f,g", 0, v9 }, -{ "fmovscs", F3F(2, 0x35, 0x101)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDCS,~0), "z,f,g", 0, v9 }, -{ "fmovscs", F3F(2, 0x35, 0x181)|MCOND(CONDCS,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDCS,~0), "Z,f,g", 0, v9 }, -{ "fmovde", F3F(2, 0x35, 0x102)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDE,~0), "z,f,g", 0, v9 }, -{ "fmovde", F3F(2, 0x35, 0x082)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDE,~0), "6,f,g", 0, v9 }, -{ "fmovde", F3F(2, 0x35, 0x182)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDE,~0), "Z,f,g", 0, v9 }, -{ "fmovde", F3F(2, 0x35, 0x0a2)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDE,~0), "7,f,g", 0, v9 }, -{ "fmovde", F3F(2, 0x35, 0x0c2)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDE,~0), "8,f,g", 0, v9 }, -{ "fmovde", F3F(2, 0x35, 0x0e2)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDE,~0), "9,f,g", 0, v9 }, -{ "fmovqe", F3F(2, 0x35, 0x103)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDE,~0), "z,f,g", 0, v9 }, -{ "fmovqe", F3F(2, 0x35, 0x083)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDE,~0), "6,f,g", 0, v9 }, -{ "fmovqe", F3F(2, 0x35, 0x183)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDE,~0), "Z,f,g", 0, v9 }, -{ "fmovqe", F3F(2, 0x35, 0x0a3)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDE,~0), "7,f,g", 0, v9 }, -{ "fmovqe", F3F(2, 0x35, 0x0c3)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDE,~0), "8,f,g", 0, v9 }, -{ "fmovqe", F3F(2, 0x35, 0x0e3)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDE,~0), "9,f,g", 0, v9 }, -{ "fmovse", F3F(2, 0x35, 0x101)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDE,~0), "z,f,g", 0, v9 }, -{ "fmovse", F3F(2, 0x35, 0x081)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDE,~0), "6,f,g", 0, v9 }, -{ "fmovse", F3F(2, 0x35, 0x181)|MCOND(CONDE,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDE,~0), "Z,f,g", 0, v9 }, -{ "fmovse", F3F(2, 0x35, 0x0a1)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDE,~0), "7,f,g", 0, v9 }, -{ "fmovse", F3F(2, 0x35, 0x0c1)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDE,~0), "8,f,g", 0, v9 }, -{ "fmovse", F3F(2, 0x35, 0x0e1)|MCOND(FCONDE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDE,~0), "9,f,g", 0, v9 }, -{ "fmovdg", F3F(2, 0x35, 0x102)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDG,~0), "z,f,g", 0, v9 }, -{ "fmovdg", F3F(2, 0x35, 0x082)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDG,~0), "6,f,g", 0, v9 }, -{ "fmovdg", F3F(2, 0x35, 0x182)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDG,~0), "Z,f,g", 0, v9 }, -{ "fmovdg", F3F(2, 0x35, 0x0a2)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDG,~0), "7,f,g", 0, v9 }, -{ "fmovdg", F3F(2, 0x35, 0x0c2)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDG,~0), "8,f,g", 0, v9 }, -{ "fmovdg", F3F(2, 0x35, 0x0e2)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDG,~0), "9,f,g", 0, v9 }, -{ "fmovqg", F3F(2, 0x35, 0x103)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDG,~0), "z,f,g", 0, v9 }, -{ "fmovqg", F3F(2, 0x35, 0x083)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDG,~0), "6,f,g", 0, v9 }, -{ "fmovqg", F3F(2, 0x35, 0x183)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDG,~0), "Z,f,g", 0, v9 }, -{ "fmovqg", F3F(2, 0x35, 0x0a3)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDG,~0), "7,f,g", 0, v9 }, -{ "fmovqg", F3F(2, 0x35, 0x0c3)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDG,~0), "8,f,g", 0, v9 }, -{ "fmovqg", F3F(2, 0x35, 0x0e3)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDG,~0), "9,f,g", 0, v9 }, -{ "fmovsg", F3F(2, 0x35, 0x101)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDG,~0), "z,f,g", 0, v9 }, -{ "fmovsg", F3F(2, 0x35, 0x081)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDG,~0), "6,f,g", 0, v9 }, -{ "fmovsg", F3F(2, 0x35, 0x181)|MCOND(CONDG,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDG,~0), "Z,f,g", 0, v9 }, -{ "fmovsg", F3F(2, 0x35, 0x0a1)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDG,~0), "7,f,g", 0, v9 }, -{ "fmovsg", F3F(2, 0x35, 0x0c1)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDG,~0), "8,f,g", 0, v9 }, -{ "fmovsg", F3F(2, 0x35, 0x0e1)|MCOND(FCONDG,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDG,~0), "9,f,g", 0, v9 }, -{ "fmovdge", F3F(2, 0x35, 0x102)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDGE,~0), "z,f,g", 0, v9 }, -{ "fmovdge", F3F(2, 0x35, 0x082)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDGE,~0), "6,f,g", 0, v9 }, -{ "fmovdge", F3F(2, 0x35, 0x182)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDGE,~0), "Z,f,g", 0, v9 }, -{ "fmovdge", F3F(2, 0x35, 0x0a2)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDGE,~0), "7,f,g", 0, v9 }, -{ "fmovdge", F3F(2, 0x35, 0x0c2)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDGE,~0), "8,f,g", 0, v9 }, -{ "fmovdge", F3F(2, 0x35, 0x0e2)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDGE,~0), "9,f,g", 0, v9 }, -{ "fmovqge", F3F(2, 0x35, 0x103)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDGE,~0), "z,f,g", 0, v9 }, -{ "fmovqge", F3F(2, 0x35, 0x083)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDGE,~0), "6,f,g", 0, v9 }, -{ "fmovqge", F3F(2, 0x35, 0x183)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDGE,~0), "Z,f,g", 0, v9 }, -{ "fmovqge", F3F(2, 0x35, 0x0a3)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDGE,~0), "7,f,g", 0, v9 }, -{ "fmovqge", F3F(2, 0x35, 0x0c3)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDGE,~0), "8,f,g", 0, v9 }, -{ "fmovqge", F3F(2, 0x35, 0x0e3)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDGE,~0), "9,f,g", 0, v9 }, -{ "fmovsge", F3F(2, 0x35, 0x101)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDGE,~0), "z,f,g", 0, v9 }, -{ "fmovsge", F3F(2, 0x35, 0x081)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDGE,~0), "6,f,g", 0, v9 }, -{ "fmovsge", F3F(2, 0x35, 0x181)|MCOND(CONDGE,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDGE,~0), "Z,f,g", 0, v9 }, -{ "fmovsge", F3F(2, 0x35, 0x0a1)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDGE,~0), "7,f,g", 0, v9 }, -{ "fmovsge", F3F(2, 0x35, 0x0c1)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDGE,~0), "8,f,g", 0, v9 }, -{ "fmovsge", F3F(2, 0x35, 0x0e1)|MCOND(FCONDGE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDGE,~0), "9,f,g", 0, v9 }, -{ "fmovdgeu", F3F(2, 0x35, 0x102)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDGEU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovdgeu", F3F(2, 0x35, 0x182)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDGEU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovqgeu", F3F(2, 0x35, 0x103)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDGEU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovqgeu", F3F(2, 0x35, 0x183)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDGEU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovsgeu", F3F(2, 0x35, 0x101)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDGEU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovsgeu", F3F(2, 0x35, 0x181)|MCOND(CONDGEU,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDGEU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovdgu", F3F(2, 0x35, 0x102)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDGU,~0), "z,f,g", 0, v9 }, -{ "fmovdgu", F3F(2, 0x35, 0x182)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDGU,~0), "Z,f,g", 0, v9 }, -{ "fmovqgu", F3F(2, 0x35, 0x103)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDGU,~0), "z,f,g", 0, v9 }, -{ "fmovqgu", F3F(2, 0x35, 0x183)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDGU,~0), "Z,f,g", 0, v9 }, -{ "fmovsgu", F3F(2, 0x35, 0x101)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDGU,~0), "z,f,g", 0, v9 }, -{ "fmovsgu", F3F(2, 0x35, 0x181)|MCOND(CONDGU,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDGU,~0), "Z,f,g", 0, v9 }, -{ "fmovdl", F3F(2, 0x35, 0x102)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDL,~0), "z,f,g", 0, v9 }, -{ "fmovdl", F3F(2, 0x35, 0x082)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDL,~0), "6,f,g", 0, v9 }, -{ "fmovdl", F3F(2, 0x35, 0x182)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDL,~0), "Z,f,g", 0, v9 }, -{ "fmovdl", F3F(2, 0x35, 0x0a2)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDL,~0), "7,f,g", 0, v9 }, -{ "fmovdl", F3F(2, 0x35, 0x0c2)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDL,~0), "8,f,g", 0, v9 }, -{ "fmovdl", F3F(2, 0x35, 0x0e2)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDL,~0), "9,f,g", 0, v9 }, -{ "fmovql", F3F(2, 0x35, 0x103)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDL,~0), "z,f,g", 0, v9 }, -{ "fmovql", F3F(2, 0x35, 0x083)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDL,~0), "6,f,g", 0, v9 }, -{ "fmovql", F3F(2, 0x35, 0x183)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDL,~0), "Z,f,g", 0, v9 }, -{ "fmovql", F3F(2, 0x35, 0x0a3)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDL,~0), "7,f,g", 0, v9 }, -{ "fmovql", F3F(2, 0x35, 0x0c3)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDL,~0), "8,f,g", 0, v9 }, -{ "fmovql", F3F(2, 0x35, 0x0e3)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDL,~0), "9,f,g", 0, v9 }, -{ "fmovsl", F3F(2, 0x35, 0x101)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDL,~0), "z,f,g", 0, v9 }, -{ "fmovsl", F3F(2, 0x35, 0x081)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDL,~0), "6,f,g", 0, v9 }, -{ "fmovsl", F3F(2, 0x35, 0x181)|MCOND(CONDL,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDL,~0), "Z,f,g", 0, v9 }, -{ "fmovsl", F3F(2, 0x35, 0x0a1)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDL,~0), "7,f,g", 0, v9 }, -{ "fmovsl", F3F(2, 0x35, 0x0c1)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDL,~0), "8,f,g", 0, v9 }, -{ "fmovsl", F3F(2, 0x35, 0x0e1)|MCOND(FCONDL,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDL,~0), "9,f,g", 0, v9 }, -{ "fmovdle", F3F(2, 0x35, 0x102)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDLE,~0), "z,f,g", 0, v9 }, -{ "fmovdle", F3F(2, 0x35, 0x082)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDLE,~0), "6,f,g", 0, v9 }, -{ "fmovdle", F3F(2, 0x35, 0x182)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDLE,~0), "Z,f,g", 0, v9 }, -{ "fmovdle", F3F(2, 0x35, 0x0a2)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDLE,~0), "7,f,g", 0, v9 }, -{ "fmovdle", F3F(2, 0x35, 0x0c2)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDLE,~0), "8,f,g", 0, v9 }, -{ "fmovdle", F3F(2, 0x35, 0x0e2)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDLE,~0), "9,f,g", 0, v9 }, -{ "fmovqle", F3F(2, 0x35, 0x103)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDLE,~0), "z,f,g", 0, v9 }, -{ "fmovqle", F3F(2, 0x35, 0x083)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDLE,~0), "6,f,g", 0, v9 }, -{ "fmovqle", F3F(2, 0x35, 0x183)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDLE,~0), "Z,f,g", 0, v9 }, -{ "fmovqle", F3F(2, 0x35, 0x0a3)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDLE,~0), "7,f,g", 0, v9 }, -{ "fmovqle", F3F(2, 0x35, 0x0c3)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDLE,~0), "8,f,g", 0, v9 }, -{ "fmovqle", F3F(2, 0x35, 0x0e3)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDLE,~0), "9,f,g", 0, v9 }, -{ "fmovsle", F3F(2, 0x35, 0x101)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDLE,~0), "z,f,g", 0, v9 }, -{ "fmovsle", F3F(2, 0x35, 0x081)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDLE,~0), "6,f,g", 0, v9 }, -{ "fmovsle", F3F(2, 0x35, 0x181)|MCOND(CONDLE,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDLE,~0), "Z,f,g", 0, v9 }, -{ "fmovsle", F3F(2, 0x35, 0x0a1)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDLE,~0), "7,f,g", 0, v9 }, -{ "fmovsle", F3F(2, 0x35, 0x0c1)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDLE,~0), "8,f,g", 0, v9 }, -{ "fmovsle", F3F(2, 0x35, 0x0e1)|MCOND(FCONDLE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDLE,~0), "9,f,g", 0, v9 }, -{ "fmovdleu", F3F(2, 0x35, 0x102)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDLEU,~0), "z,f,g", 0, v9 }, -{ "fmovdleu", F3F(2, 0x35, 0x182)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDLEU,~0), "Z,f,g", 0, v9 }, -{ "fmovqleu", F3F(2, 0x35, 0x103)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDLEU,~0), "z,f,g", 0, v9 }, -{ "fmovqleu", F3F(2, 0x35, 0x183)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDLEU,~0), "Z,f,g", 0, v9 }, -{ "fmovsleu", F3F(2, 0x35, 0x101)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDLEU,~0), "z,f,g", 0, v9 }, -{ "fmovsleu", F3F(2, 0x35, 0x181)|MCOND(CONDLEU,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDLEU,~0), "Z,f,g", 0, v9 }, -{ "fmovdlg", F3F(2, 0x35, 0x082)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDLG,~0), "6,f,g", 0, v9 }, -{ "fmovdlg", F3F(2, 0x35, 0x0a2)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDLG,~0), "7,f,g", 0, v9 }, -{ "fmovdlg", F3F(2, 0x35, 0x0c2)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDLG,~0), "8,f,g", 0, v9 }, -{ "fmovdlg", F3F(2, 0x35, 0x0e2)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDLG,~0), "9,f,g", 0, v9 }, -{ "fmovqlg", F3F(2, 0x35, 0x083)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDLG,~0), "6,f,g", 0, v9 }, -{ "fmovqlg", F3F(2, 0x35, 0x0a3)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDLG,~0), "7,f,g", 0, v9 }, -{ "fmovqlg", F3F(2, 0x35, 0x0c3)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDLG,~0), "8,f,g", 0, v9 }, -{ "fmovqlg", F3F(2, 0x35, 0x0e3)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDLG,~0), "9,f,g", 0, v9 }, -{ "fmovslg", F3F(2, 0x35, 0x081)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDLG,~0), "6,f,g", 0, v9 }, -{ "fmovslg", F3F(2, 0x35, 0x0a1)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDLG,~0), "7,f,g", 0, v9 }, -{ "fmovslg", F3F(2, 0x35, 0x0c1)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDLG,~0), "8,f,g", 0, v9 }, -{ "fmovslg", F3F(2, 0x35, 0x0e1)|MCOND(FCONDLG,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDLG,~0), "9,f,g", 0, v9 }, -{ "fmovdlu", F3F(2, 0x35, 0x102)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDLU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovdlu", F3F(2, 0x35, 0x182)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDLU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovqlu", F3F(2, 0x35, 0x103)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDLU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovqlu", F3F(2, 0x35, 0x183)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDLU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovslu", F3F(2, 0x35, 0x101)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDLU,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovslu", F3F(2, 0x35, 0x181)|MCOND(CONDLU,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDLU,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovdn", F3F(2, 0x35, 0x102)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDN,~0), "z,f,g", 0, v9 }, -{ "fmovdn", F3F(2, 0x35, 0x082)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDN,~0), "6,f,g", 0, v9 }, -{ "fmovdn", F3F(2, 0x35, 0x182)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDN,~0), "Z,f,g", 0, v9 }, -{ "fmovdn", F3F(2, 0x35, 0x0a2)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDN,~0), "7,f,g", 0, v9 }, -{ "fmovdn", F3F(2, 0x35, 0x0c2)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDN,~0), "8,f,g", 0, v9 }, -{ "fmovdn", F3F(2, 0x35, 0x0e2)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDN,~0), "9,f,g", 0, v9 }, -{ "fmovqn", F3F(2, 0x35, 0x103)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDN,~0), "z,f,g", 0, v9 }, -{ "fmovqn", F3F(2, 0x35, 0x083)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDN,~0), "6,f,g", 0, v9 }, -{ "fmovqn", F3F(2, 0x35, 0x183)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDN,~0), "Z,f,g", 0, v9 }, -{ "fmovqn", F3F(2, 0x35, 0x0a3)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDN,~0), "7,f,g", 0, v9 }, -{ "fmovqn", F3F(2, 0x35, 0x0c3)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDN,~0), "8,f,g", 0, v9 }, -{ "fmovqn", F3F(2, 0x35, 0x0e3)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDN,~0), "9,f,g", 0, v9 }, -{ "fmovsn", F3F(2, 0x35, 0x101)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDN,~0), "z,f,g", 0, v9 }, -{ "fmovsn", F3F(2, 0x35, 0x081)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDN,~0), "6,f,g", 0, v9 }, -{ "fmovsn", F3F(2, 0x35, 0x181)|MCOND(CONDN,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDN,~0), "Z,f,g", 0, v9 }, -{ "fmovsn", F3F(2, 0x35, 0x0a1)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDN,~0), "7,f,g", 0, v9 }, -{ "fmovsn", F3F(2, 0x35, 0x0c1)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDN,~0), "8,f,g", 0, v9 }, -{ "fmovsn", F3F(2, 0x35, 0x0e1)|MCOND(FCONDN,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDN,~0), "9,f,g", 0, v9 }, -{ "fmovdne", F3F(2, 0x35, 0x102)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDNE,~0), "z,f,g", 0, v9 }, -{ "fmovdne", F3F(2, 0x35, 0x082)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDNE,~0), "6,f,g", 0, v9 }, -{ "fmovdne", F3F(2, 0x35, 0x182)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDNE,~0), "Z,f,g", 0, v9 }, -{ "fmovdne", F3F(2, 0x35, 0x0a2)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDNE,~0), "7,f,g", 0, v9 }, -{ "fmovdne", F3F(2, 0x35, 0x0c2)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDNE,~0), "8,f,g", 0, v9 }, -{ "fmovdne", F3F(2, 0x35, 0x0e2)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDNE,~0), "9,f,g", 0, v9 }, -{ "fmovqne", F3F(2, 0x35, 0x103)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDNE,~0), "z,f,g", 0, v9 }, -{ "fmovqne", F3F(2, 0x35, 0x083)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDNE,~0), "6,f,g", 0, v9 }, -{ "fmovqne", F3F(2, 0x35, 0x183)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDNE,~0), "Z,f,g", 0, v9 }, -{ "fmovqne", F3F(2, 0x35, 0x0a3)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDNE,~0), "7,f,g", 0, v9 }, -{ "fmovqne", F3F(2, 0x35, 0x0c3)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDNE,~0), "8,f,g", 0, v9 }, -{ "fmovqne", F3F(2, 0x35, 0x0e3)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDNE,~0), "9,f,g", 0, v9 }, -{ "fmovsne", F3F(2, 0x35, 0x101)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDNE,~0), "z,f,g", 0, v9 }, -{ "fmovsne", F3F(2, 0x35, 0x081)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDNE,~0), "6,f,g", 0, v9 }, -{ "fmovsne", F3F(2, 0x35, 0x181)|MCOND(CONDNE,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDNE,~0), "Z,f,g", 0, v9 }, -{ "fmovsne", F3F(2, 0x35, 0x0a1)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDNE,~0), "7,f,g", 0, v9 }, -{ "fmovsne", F3F(2, 0x35, 0x0c1)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDNE,~0), "8,f,g", 0, v9 }, -{ "fmovsne", F3F(2, 0x35, 0x0e1)|MCOND(FCONDNE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDNE,~0), "9,f,g", 0, v9 }, -{ "fmovdneg", F3F(2, 0x35, 0x102)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDNEG,~0), "z,f,g", 0, v9 }, -{ "fmovdneg", F3F(2, 0x35, 0x182)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDNEG,~0), "Z,f,g", 0, v9 }, -{ "fmovqneg", F3F(2, 0x35, 0x103)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDNEG,~0), "z,f,g", 0, v9 }, -{ "fmovqneg", F3F(2, 0x35, 0x183)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDNEG,~0), "Z,f,g", 0, v9 }, -{ "fmovsneg", F3F(2, 0x35, 0x101)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDNEG,~0), "z,f,g", 0, v9 }, -{ "fmovsneg", F3F(2, 0x35, 0x181)|MCOND(CONDNEG,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDNEG,~0), "Z,f,g", 0, v9 }, -{ "fmovdnz", F3F(2, 0x35, 0x102)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDNZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovdnz", F3F(2, 0x35, 0x082)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDNZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovdnz", F3F(2, 0x35, 0x182)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDNZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovdnz", F3F(2, 0x35, 0x0a2)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDNZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovdnz", F3F(2, 0x35, 0x0c2)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDNZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovdnz", F3F(2, 0x35, 0x0e2)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDNZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovqnz", F3F(2, 0x35, 0x103)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDNZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovqnz", F3F(2, 0x35, 0x083)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDNZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovqnz", F3F(2, 0x35, 0x183)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDNZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovqnz", F3F(2, 0x35, 0x0a3)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDNZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovqnz", F3F(2, 0x35, 0x0c3)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDNZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovqnz", F3F(2, 0x35, 0x0e3)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDNZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovsnz", F3F(2, 0x35, 0x101)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDNZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovsnz", F3F(2, 0x35, 0x081)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDNZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovsnz", F3F(2, 0x35, 0x181)|MCOND(CONDNZ,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDNZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovsnz", F3F(2, 0x35, 0x0a1)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDNZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovsnz", F3F(2, 0x35, 0x0c1)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDNZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovsnz", F3F(2, 0x35, 0x0e1)|MCOND(FCONDNZ,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDNZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovdo", F3F(2, 0x35, 0x082)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDO,~0), "6,f,g", 0, v9 }, -{ "fmovdo", F3F(2, 0x35, 0x0a2)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDO,~0), "7,f,g", 0, v9 }, -{ "fmovdo", F3F(2, 0x35, 0x0c2)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDO,~0), "8,f,g", 0, v9 }, -{ "fmovdo", F3F(2, 0x35, 0x0e2)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDO,~0), "9,f,g", 0, v9 }, -{ "fmovqo", F3F(2, 0x35, 0x083)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDO,~0), "6,f,g", 0, v9 }, -{ "fmovqo", F3F(2, 0x35, 0x0a3)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDO,~0), "7,f,g", 0, v9 }, -{ "fmovqo", F3F(2, 0x35, 0x0c3)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDO,~0), "8,f,g", 0, v9 }, -{ "fmovqo", F3F(2, 0x35, 0x0e3)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDO,~0), "9,f,g", 0, v9 }, -{ "fmovso", F3F(2, 0x35, 0x081)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDO,~0), "6,f,g", 0, v9 }, -{ "fmovso", F3F(2, 0x35, 0x0a1)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDO,~0), "7,f,g", 0, v9 }, -{ "fmovso", F3F(2, 0x35, 0x0c1)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDO,~0), "8,f,g", 0, v9 }, -{ "fmovso", F3F(2, 0x35, 0x0e1)|MCOND(FCONDO,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDO,~0), "9,f,g", 0, v9 }, -{ "fmovdpos", F3F(2, 0x35, 0x102)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDPOS,~0), "z,f,g", 0, v9 }, -{ "fmovdpos", F3F(2, 0x35, 0x182)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDPOS,~0), "Z,f,g", 0, v9 }, -{ "fmovqpos", F3F(2, 0x35, 0x103)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDPOS,~0), "z,f,g", 0, v9 }, -{ "fmovqpos", F3F(2, 0x35, 0x183)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDPOS,~0), "Z,f,g", 0, v9 }, -{ "fmovspos", F3F(2, 0x35, 0x101)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDPOS,~0), "z,f,g", 0, v9 }, -{ "fmovspos", F3F(2, 0x35, 0x181)|MCOND(CONDPOS,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDPOS,~0), "Z,f,g", 0, v9 }, -{ "fmovdu", F3F(2, 0x35, 0x082)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDU,~0), "6,f,g", 0, v9 }, -{ "fmovdu", F3F(2, 0x35, 0x0a2)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDU,~0), "7,f,g", 0, v9 }, -{ "fmovdu", F3F(2, 0x35, 0x0c2)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDU,~0), "8,f,g", 0, v9 }, -{ "fmovdu", F3F(2, 0x35, 0x0e2)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDU,~0), "9,f,g", 0, v9 }, -{ "fmovqu", F3F(2, 0x35, 0x083)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDU,~0), "6,f,g", 0, v9 }, -{ "fmovqu", F3F(2, 0x35, 0x0a3)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDU,~0), "7,f,g", 0, v9 }, -{ "fmovqu", F3F(2, 0x35, 0x0c3)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDU,~0), "8,f,g", 0, v9 }, -{ "fmovqu", F3F(2, 0x35, 0x0e3)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDU,~0), "9,f,g", 0, v9 }, -{ "fmovsu", F3F(2, 0x35, 0x081)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDU,~0), "6,f,g", 0, v9 }, -{ "fmovsu", F3F(2, 0x35, 0x0a1)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDU,~0), "7,f,g", 0, v9 }, -{ "fmovsu", F3F(2, 0x35, 0x0c1)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDU,~0), "8,f,g", 0, v9 }, -{ "fmovsu", F3F(2, 0x35, 0x0e1)|MCOND(FCONDU,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDU,~0), "9,f,g", 0, v9 }, -{ "fmovdue", F3F(2, 0x35, 0x082)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDUE,~0), "6,f,g", 0, v9 }, -{ "fmovdue", F3F(2, 0x35, 0x0a2)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDUE,~0), "7,f,g", 0, v9 }, -{ "fmovdue", F3F(2, 0x35, 0x0c2)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDUE,~0), "8,f,g", 0, v9 }, -{ "fmovdue", F3F(2, 0x35, 0x0e2)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDUE,~0), "9,f,g", 0, v9 }, -{ "fmovque", F3F(2, 0x35, 0x083)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDUE,~0), "6,f,g", 0, v9 }, -{ "fmovque", F3F(2, 0x35, 0x0a3)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDUE,~0), "7,f,g", 0, v9 }, -{ "fmovque", F3F(2, 0x35, 0x0c3)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDUE,~0), "8,f,g", 0, v9 }, -{ "fmovque", F3F(2, 0x35, 0x0e3)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDUE,~0), "9,f,g", 0, v9 }, -{ "fmovsue", F3F(2, 0x35, 0x081)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDUE,~0), "6,f,g", 0, v9 }, -{ "fmovsue", F3F(2, 0x35, 0x0a1)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDUE,~0), "7,f,g", 0, v9 }, -{ "fmovsue", F3F(2, 0x35, 0x0c1)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDUE,~0), "8,f,g", 0, v9 }, -{ "fmovsue", F3F(2, 0x35, 0x0e1)|MCOND(FCONDUE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDUE,~0), "9,f,g", 0, v9 }, -{ "fmovdug", F3F(2, 0x35, 0x082)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDUG,~0), "6,f,g", 0, v9 }, -{ "fmovdug", F3F(2, 0x35, 0x0a2)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDUG,~0), "7,f,g", 0, v9 }, -{ "fmovdug", F3F(2, 0x35, 0x0c2)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDUG,~0), "8,f,g", 0, v9 }, -{ "fmovdug", F3F(2, 0x35, 0x0e2)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDUG,~0), "9,f,g", 0, v9 }, -{ "fmovqug", F3F(2, 0x35, 0x083)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDUG,~0), "6,f,g", 0, v9 }, -{ "fmovqug", F3F(2, 0x35, 0x0a3)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDUG,~0), "7,f,g", 0, v9 }, -{ "fmovqug", F3F(2, 0x35, 0x0c3)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDUG,~0), "8,f,g", 0, v9 }, -{ "fmovqug", F3F(2, 0x35, 0x0e3)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDUG,~0), "9,f,g", 0, v9 }, -{ "fmovsug", F3F(2, 0x35, 0x081)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDUG,~0), "6,f,g", 0, v9 }, -{ "fmovsug", F3F(2, 0x35, 0x0a1)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDUG,~0), "7,f,g", 0, v9 }, -{ "fmovsug", F3F(2, 0x35, 0x0c1)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDUG,~0), "8,f,g", 0, v9 }, -{ "fmovsug", F3F(2, 0x35, 0x0e1)|MCOND(FCONDUG,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDUG,~0), "9,f,g", 0, v9 }, -{ "fmovduge", F3F(2, 0x35, 0x082)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDUGE,~0), "6,f,g", 0, v9 }, -{ "fmovduge", F3F(2, 0x35, 0x0a2)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDUGE,~0), "7,f,g", 0, v9 }, -{ "fmovduge", F3F(2, 0x35, 0x0c2)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDUGE,~0), "8,f,g", 0, v9 }, -{ "fmovduge", F3F(2, 0x35, 0x0e2)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDUGE,~0), "9,f,g", 0, v9 }, -{ "fmovquge", F3F(2, 0x35, 0x083)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDUGE,~0), "6,f,g", 0, v9 }, -{ "fmovquge", F3F(2, 0x35, 0x0a3)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDUGE,~0), "7,f,g", 0, v9 }, -{ "fmovquge", F3F(2, 0x35, 0x0c3)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDUGE,~0), "8,f,g", 0, v9 }, -{ "fmovquge", F3F(2, 0x35, 0x0e3)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDUGE,~0), "9,f,g", 0, v9 }, -{ "fmovsuge", F3F(2, 0x35, 0x081)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDUGE,~0), "6,f,g", 0, v9 }, -{ "fmovsuge", F3F(2, 0x35, 0x0a1)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDUGE,~0), "7,f,g", 0, v9 }, -{ "fmovsuge", F3F(2, 0x35, 0x0c1)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDUGE,~0), "8,f,g", 0, v9 }, -{ "fmovsuge", F3F(2, 0x35, 0x0e1)|MCOND(FCONDUGE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDUGE,~0), "9,f,g", 0, v9 }, -{ "fmovdul", F3F(2, 0x35, 0x082)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDUL,~0), "6,f,g", 0, v9 }, -{ "fmovdul", F3F(2, 0x35, 0x0a2)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDUL,~0), "7,f,g", 0, v9 }, -{ "fmovdul", F3F(2, 0x35, 0x0c2)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDUL,~0), "8,f,g", 0, v9 }, -{ "fmovdul", F3F(2, 0x35, 0x0e2)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDUL,~0), "9,f,g", 0, v9 }, -{ "fmovqul", F3F(2, 0x35, 0x083)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDUL,~0), "6,f,g", 0, v9 }, -{ "fmovqul", F3F(2, 0x35, 0x0a3)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDUL,~0), "7,f,g", 0, v9 }, -{ "fmovqul", F3F(2, 0x35, 0x0c3)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDUL,~0), "8,f,g", 0, v9 }, -{ "fmovqul", F3F(2, 0x35, 0x0e3)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDUL,~0), "9,f,g", 0, v9 }, -{ "fmovsul", F3F(2, 0x35, 0x081)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDUL,~0), "6,f,g", 0, v9 }, -{ "fmovsul", F3F(2, 0x35, 0x0a1)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDUL,~0), "7,f,g", 0, v9 }, -{ "fmovsul", F3F(2, 0x35, 0x0c1)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDUL,~0), "8,f,g", 0, v9 }, -{ "fmovsul", F3F(2, 0x35, 0x0e1)|MCOND(FCONDUL,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDUL,~0), "9,f,g", 0, v9 }, -{ "fmovdule", F3F(2, 0x35, 0x082)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDULE,~0), "6,f,g", 0, v9 }, -{ "fmovdule", F3F(2, 0x35, 0x0a2)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDULE,~0), "7,f,g", 0, v9 }, -{ "fmovdule", F3F(2, 0x35, 0x0c2)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDULE,~0), "8,f,g", 0, v9 }, -{ "fmovdule", F3F(2, 0x35, 0x0e2)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDULE,~0), "9,f,g", 0, v9 }, -{ "fmovqule", F3F(2, 0x35, 0x083)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDULE,~0), "6,f,g", 0, v9 }, -{ "fmovqule", F3F(2, 0x35, 0x0a3)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDULE,~0), "7,f,g", 0, v9 }, -{ "fmovqule", F3F(2, 0x35, 0x0c3)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDULE,~0), "8,f,g", 0, v9 }, -{ "fmovqule", F3F(2, 0x35, 0x0e3)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDULE,~0), "9,f,g", 0, v9 }, -{ "fmovsule", F3F(2, 0x35, 0x081)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDULE,~0), "6,f,g", 0, v9 }, -{ "fmovsule", F3F(2, 0x35, 0x0a1)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDULE,~0), "7,f,g", 0, v9 }, -{ "fmovsule", F3F(2, 0x35, 0x0c1)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDULE,~0), "8,f,g", 0, v9 }, -{ "fmovsule", F3F(2, 0x35, 0x0e1)|MCOND(FCONDULE,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDULE,~0), "9,f,g", 0, v9 }, -{ "fmovdvc", F3F(2, 0x35, 0x102)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDVC,~0), "z,f,g", 0, v9 }, -{ "fmovdvc", F3F(2, 0x35, 0x182)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDVC,~0), "Z,f,g", 0, v9 }, -{ "fmovqvc", F3F(2, 0x35, 0x103)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDVC,~0), "z,f,g", 0, v9 }, -{ "fmovqvc", F3F(2, 0x35, 0x183)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDVC,~0), "Z,f,g", 0, v9 }, -{ "fmovsvc", F3F(2, 0x35, 0x101)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDVC,~0), "z,f,g", 0, v9 }, -{ "fmovsvc", F3F(2, 0x35, 0x181)|MCOND(CONDVC,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDVC,~0), "Z,f,g", 0, v9 }, -{ "fmovdvs", F3F(2, 0x35, 0x102)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDVS,~0), "z,f,g", 0, v9 }, -{ "fmovdvs", F3F(2, 0x35, 0x182)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDVS,~0), "Z,f,g", 0, v9 }, -{ "fmovqvs", F3F(2, 0x35, 0x103)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDVS,~0), "z,f,g", 0, v9 }, -{ "fmovqvs", F3F(2, 0x35, 0x183)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDVS,~0), "Z,f,g", 0, v9 }, -{ "fmovsvs", F3F(2, 0x35, 0x101)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDVS,~0), "z,f,g", 0, v9 }, -{ "fmovsvs", F3F(2, 0x35, 0x181)|MCOND(CONDVS,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDVS,~0), "Z,f,g", 0, v9 }, -{ "fmovdz", F3F(2, 0x35, 0x102)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x102)|MCOND(~CONDZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovdz", F3F(2, 0x35, 0x082)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x082)|MCOND(~FCONDZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovdz", F3F(2, 0x35, 0x182)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x182)|MCOND(~CONDZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovdz", F3F(2, 0x35, 0x0a2)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0a2)|MCOND(~FCONDZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovdz", F3F(2, 0x35, 0x0c2)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0c2)|MCOND(~FCONDZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovdz", F3F(2, 0x35, 0x0e2)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0e2)|MCOND(~FCONDZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovqz", F3F(2, 0x35, 0x103)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x103)|MCOND(~CONDZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovqz", F3F(2, 0x35, 0x083)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x083)|MCOND(~FCONDZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovqz", F3F(2, 0x35, 0x183)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x183)|MCOND(~CONDZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovqz", F3F(2, 0x35, 0x0a3)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0a3)|MCOND(~FCONDZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovqz", F3F(2, 0x35, 0x0c3)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0c3)|MCOND(~FCONDZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovqz", F3F(2, 0x35, 0x0e3)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0e3)|MCOND(~FCONDZ,~0), "9,f,g", F_ALIAS, v9 }, -{ "fmovsz", F3F(2, 0x35, 0x101)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x101)|MCOND(~CONDZ,~0), "z,f,g", F_ALIAS, v9 }, -{ "fmovsz", F3F(2, 0x35, 0x081)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x081)|MCOND(~FCONDZ,~0), "6,f,g", F_ALIAS, v9 }, -{ "fmovsz", F3F(2, 0x35, 0x181)|MCOND(CONDZ,0), F3F(~2, ~0x35, ~0x181)|MCOND(~CONDZ,~0), "Z,f,g", F_ALIAS, v9 }, -{ "fmovsz", F3F(2, 0x35, 0x0a1)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0a1)|MCOND(~FCONDZ,~0), "7,f,g", F_ALIAS, v9 }, -{ "fmovsz", F3F(2, 0x35, 0x0c1)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0c1)|MCOND(~FCONDZ,~0), "8,f,g", F_ALIAS, v9 }, -{ "fmovsz", F3F(2, 0x35, 0x0e1)|MCOND(FCONDZ,0), F3F(~2, ~0x35, ~0x0e1)|MCOND(~FCONDZ,~0), "9,f,g", F_ALIAS, v9 }, - -#define brfc(opcode, mask, lose, flags) \ - { opcode, (mask), ANNUL|(lose), "l", flags|F_DELAYED, v6 }, \ - { opcode, (mask)|ANNUL, (lose), ",a l", flags|F_DELAYED, v6 } - -#define brfcx(opcode, mask, lose, flags) /* v9 */ \ - { opcode, FBFCC(0)|(mask), ANNUL|BPRED|FBFCC(~0)|(lose), "6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask)|ANNUL, BPRED|FBFCC(~0)|(lose), ",a 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask), ANNUL|BPRED|FBFCC(~0)|(lose), ",N 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask)|ANNUL, BPRED|FBFCC(~0)|(lose), ",a,N 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask)|BPRED, ANNUL|FBFCC(~0)|(lose), ",T 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(0)|(mask)|BPRED|ANNUL, FBFCC(~0)|(lose), ",a,T 6,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask), ANNUL|BPRED|FBFCC(~1)|(lose), "7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask)|ANNUL, BPRED|FBFCC(~1)|(lose), ",a 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask), ANNUL|BPRED|FBFCC(~1)|(lose), ",N 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask)|ANNUL, BPRED|FBFCC(~1)|(lose), ",a,N 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask)|BPRED, ANNUL|FBFCC(~1)|(lose), ",T 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(1)|(mask)|BPRED|ANNUL, FBFCC(~1)|(lose), ",a,T 7,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask), ANNUL|BPRED|FBFCC(~2)|(lose), "8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask)|ANNUL, BPRED|FBFCC(~2)|(lose), ",a 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask), ANNUL|BPRED|FBFCC(~2)|(lose), ",N 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask)|ANNUL, BPRED|FBFCC(~2)|(lose), ",a,N 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask)|BPRED, ANNUL|FBFCC(~2)|(lose), ",T 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(2)|(mask)|BPRED|ANNUL, FBFCC(~2)|(lose), ",a,T 8,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask), ANNUL|BPRED|FBFCC(~3)|(lose), "9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask)|ANNUL, BPRED|FBFCC(~3)|(lose), ",a 9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask), ANNUL|BPRED|FBFCC(~3)|(lose), ",N 9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask)|ANNUL, BPRED|FBFCC(~3)|(lose), ",a,N 9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask)|BPRED, ANNUL|FBFCC(~3)|(lose), ",T 9,G", flags|F_DELAYED, v9 }, \ - { opcode, FBFCC(3)|(mask)|BPRED|ANNUL, FBFCC(~3)|(lose), ",a,T 9,G", flags|F_DELAYED, v9 } - -#define condfc(fop, cop, mask, flags) \ - brfc(fop, F2(0, 6)|COND(mask), F2(~0, ~6)|COND(~(mask)), flags), \ - brfcx(fop, F2(0, 5)|COND(mask), F2(~0, ~5)|COND(~(mask)), flags), /* v9 */ \ - brfc(cop, F2(0, 7)|COND(mask), F2(~0, ~7)|COND(~(mask)), flags) \ - -#define condf(fop, mask, flags) \ - brfcx(fop, F2(0, 5)|COND(mask), F2(~0, ~5)|COND(~(mask)), flags), /* v9 */ \ - brfc(fop, F2(0, 6)|COND(mask), F2(~0, ~6)|COND(~(mask)), flags) - -condfc("fb", "cb", 0x8, 0), -condfc("fba", "cba", 0x8, F_ALIAS), -condfc("fbe", "cb0", 0x9, 0), -condf("fbz", 0x9, F_ALIAS), -condfc("fbg", "cb2", 0x6, 0), -condfc("fbge", "cb02", 0xb, 0), -condfc("fbl", "cb1", 0x4, 0), -condfc("fble", "cb01", 0xd, 0), -condfc("fblg", "cb12", 0x2, 0), -condfc("fbn", "cbn", 0x0, 0), -condfc("fbne", "cb123", 0x1, 0), -condf("fbnz", 0x1, F_ALIAS), -condfc("fbo", "cb012", 0xf, 0), -condfc("fbu", "cb3", 0x7, 0), -condfc("fbue", "cb03", 0xa, 0), -condfc("fbug", "cb23", 0x5, 0), -condfc("fbuge", "cb023", 0xc, 0), -condfc("fbul", "cb13", 0x3, 0), -condfc("fbule", "cb013", 0xe, 0), - -#undef condfc -#undef brfc -#undef brfcx /* v9 */ - -{ "jmp", F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|RD_G0|ASI(~0), "1+2", F_DELAYED, v6 }, /* jmpl rs1+rs2,%g0 */ -{ "jmp", F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|RD_G0|ASI_RS2(~0), "1", F_DELAYED, v6 }, /* jmpl rs1+%g0,%g0 */ -{ "jmp", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0, "1+i", F_DELAYED, v6 }, /* jmpl rs1+i,%g0 */ -{ "jmp", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0, "i+1", F_DELAYED, v6 }, /* jmpl i+rs1,%g0 */ -{ "jmp", F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0|RS1_G0, "i", F_DELAYED, v6 }, /* jmpl %g0+i,%g0 */ - -{ "nop", F2(0, 4), 0xfeffffff, "", 0, v6 }, /* sethi 0, %g0 */ - -{ "set", F2(0x0, 0x4), F2(~0x0, ~0x4), "Sh,d", F_ALIAS, v6 }, - -{ "sethi", F2(0x0, 0x4), F2(~0x0, ~0x4), "h,d", 0, v6 }, - -{ "taddcc", F3(2, 0x20, 0), F3(~2, ~0x20, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "taddcc", F3(2, 0x20, 1), F3(~2, ~0x20, ~1), "1,i,d", 0, v6 }, -{ "taddcc", F3(2, 0x20, 1), F3(~2, ~0x20, ~1), "i,1,d", 0, v6 }, -{ "taddcctv", F3(2, 0x22, 0), F3(~2, ~0x22, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "taddcctv", F3(2, 0x22, 1), F3(~2, ~0x22, ~1), "1,i,d", 0, v6 }, -{ "taddcctv", F3(2, 0x22, 1), F3(~2, ~0x22, ~1), "i,1,d", 0, v6 }, - -{ "tsubcc", F3(2, 0x21, 0), F3(~2, ~0x21, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "tsubcc", F3(2, 0x21, 1), F3(~2, ~0x21, ~1), "1,i,d", 0, v6 }, -{ "tsubcctv", F3(2, 0x23, 0), F3(~2, ~0x23, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "tsubcctv", F3(2, 0x23, 1), F3(~2, ~0x23, ~1), "1,i,d", 0, v6 }, - -/* FIXME Thise is marked F_ALIAS, so that it won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "unimp", F2(0x0, 0x0), 0xffc00000, "n", F_ALIAS, v6 }, -{ "illtrap", F2(0, 0), F2(~0, ~0)|RD_G0, "n", 0, v9 }, - -/* This *is* a commutative instruction. */ -{ "xnor", F3(2, 0x07, 0), F3(~2, ~0x07, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "xnor", F3(2, 0x07, 1), F3(~2, ~0x07, ~1), "1,i,d", 0, v6 }, -{ "xnor", F3(2, 0x07, 1), F3(~2, ~0x07, ~1), "i,1,d", 0, v6 }, -/* This *is* a commutative instruction. */ -{ "xnorcc", F3(2, 0x17, 0), F3(~2, ~0x17, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "xnorcc", F3(2, 0x17, 1), F3(~2, ~0x17, ~1), "1,i,d", 0, v6 }, -{ "xnorcc", F3(2, 0x17, 1), F3(~2, ~0x17, ~1), "i,1,d", 0, v6 }, -{ "xor", F3(2, 0x03, 0), F3(~2, ~0x03, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "xor", F3(2, 0x03, 1), F3(~2, ~0x03, ~1), "1,i,d", 0, v6 }, -{ "xor", F3(2, 0x03, 1), F3(~2, ~0x03, ~1), "i,1,d", 0, v6 }, -{ "xorcc", F3(2, 0x13, 0), F3(~2, ~0x13, ~0)|ASI(~0), "1,2,d", 0, v6 }, -{ "xorcc", F3(2, 0x13, 1), F3(~2, ~0x13, ~1), "1,i,d", 0, v6 }, -{ "xorcc", F3(2, 0x13, 1), F3(~2, ~0x13, ~1), "i,1,d", 0, v6 }, - -{ "not", F3(2, 0x07, 0), F3(~2, ~0x07, ~0)|ASI(~0), "1,d", F_ALIAS, v6 }, /* xnor rs1,%0,rd */ -{ "not", F3(2, 0x07, 0), F3(~2, ~0x07, ~0)|ASI(~0), "r", F_ALIAS, v6 }, /* xnor rd,%0,rd */ - -{ "btog", F3(2, 0x03, 0), F3(~2, ~0x03, ~0)|ASI(~0), "2,r", F_ALIAS, v6 }, /* xor rd,rs2,rd */ -{ "btog", F3(2, 0x03, 1), F3(~2, ~0x03, ~1), "i,r", F_ALIAS, v6 }, /* xor rd,i,rd */ - -/* FPop1 and FPop2 are not instructions. Don't accept them. */ - -{ "fdtoi", F3F(2, 0x34, 0x0d2), F3F(~2, ~0x34, ~0x0d2)|RS1_G0, "B,g", 0, v6 }, -{ "fstoi", F3F(2, 0x34, 0x0d1), F3F(~2, ~0x34, ~0x0d1)|RS1_G0, "f,g", 0, v6 }, -{ "fqtoi", F3F(2, 0x34, 0x0d3), F3F(~2, ~0x34, ~0x0d3)|RS1_G0, "R,g", 0, v8 }, - -{ "fdtox", F3F(2, 0x34, 0x082), F3F(~2, ~0x34, ~0x082)|RS1_G0, "B,g", 0, v9 }, -{ "fstox", F3F(2, 0x34, 0x081), F3F(~2, ~0x34, ~0x081)|RS1_G0, "f,g", 0, v9 }, -{ "fqtox", F3F(2, 0x34, 0x083), F3F(~2, ~0x34, ~0x083)|RS1_G0, "R,g", 0, v9 }, - -{ "fitod", F3F(2, 0x34, 0x0c8), F3F(~2, ~0x34, ~0x0c8)|RS1_G0, "f,H", 0, v6 }, -{ "fitos", F3F(2, 0x34, 0x0c4), F3F(~2, ~0x34, ~0x0c4)|RS1_G0, "f,g", 0, v6 }, -{ "fitoq", F3F(2, 0x34, 0x0cc), F3F(~2, ~0x34, ~0x0cc)|RS1_G0, "f,J", 0, v8 }, - -{ "fxtod", F3F(2, 0x34, 0x088), F3F(~2, ~0x34, ~0x088)|RS1_G0, "f,H", 0, v9 }, -{ "fxtos", F3F(2, 0x34, 0x084), F3F(~2, ~0x34, ~0x084)|RS1_G0, "f,g", 0, v9 }, -{ "fxtoq", F3F(2, 0x34, 0x08c), F3F(~2, ~0x34, ~0x08c)|RS1_G0, "f,J", 0, v9 }, - -{ "fdtoq", F3F(2, 0x34, 0x0ce), F3F(~2, ~0x34, ~0x0ce)|RS1_G0, "B,J", 0, v8 }, -{ "fdtos", F3F(2, 0x34, 0x0c6), F3F(~2, ~0x34, ~0x0c6)|RS1_G0, "B,g", 0, v6 }, -{ "fqtod", F3F(2, 0x34, 0x0cb), F3F(~2, ~0x34, ~0x0cb)|RS1_G0, "R,H", 0, v8 }, -{ "fqtos", F3F(2, 0x34, 0x0c7), F3F(~2, ~0x34, ~0x0c7)|RS1_G0, "R,g", 0, v8 }, -{ "fstod", F3F(2, 0x34, 0x0c9), F3F(~2, ~0x34, ~0x0c9)|RS1_G0, "f,H", 0, v6 }, -{ "fstoq", F3F(2, 0x34, 0x0cd), F3F(~2, ~0x34, ~0x0cd)|RS1_G0, "f,J", 0, v8 }, - -{ "fdivd", F3F(2, 0x34, 0x04e), F3F(~2, ~0x34, ~0x04e), "v,B,H", 0, v6 }, -{ "fdivq", F3F(2, 0x34, 0x04f), F3F(~2, ~0x34, ~0x04f), "V,R,J", 0, v8 }, -{ "fdivs", F3F(2, 0x34, 0x04d), F3F(~2, ~0x34, ~0x04d), "e,f,g", 0, v6 }, -{ "fmuld", F3F(2, 0x34, 0x04a), F3F(~2, ~0x34, ~0x04a), "v,B,H", 0, v6 }, -{ "fmulq", F3F(2, 0x34, 0x04b), F3F(~2, ~0x34, ~0x04b), "V,R,J", 0, v8 }, -{ "fmuls", F3F(2, 0x34, 0x049), F3F(~2, ~0x34, ~0x049), "e,f,g", 0, v6 }, - -{ "fdmulq", F3F(2, 0x34, 0x06e), F3F(~2, ~0x34, ~0x06e), "v,B,J", 0, v8 }, -{ "fsmuld", F3F(2, 0x34, 0x069), F3F(~2, ~0x34, ~0x069), "e,f,H", 0, v8 }, - -{ "fsqrtd", F3F(2, 0x34, 0x02a), F3F(~2, ~0x34, ~0x02a)|RS1_G0, "B,H", 0, v7 }, -{ "fsqrtq", F3F(2, 0x34, 0x02b), F3F(~2, ~0x34, ~0x02b)|RS1_G0, "R,J", 0, v8 }, -{ "fsqrts", F3F(2, 0x34, 0x029), F3F(~2, ~0x34, ~0x029)|RS1_G0, "f,g", 0, v7 }, - -{ "fabsd", F3F(2, 0x34, 0x00a), F3F(~2, ~0x34, ~0x00a)|RS1_G0, "B,H", 0, v9 }, -{ "fabsq", F3F(2, 0x34, 0x00b), F3F(~2, ~0x34, ~0x00b)|RS1_G0, "R,J", 0, v9 }, -{ "fabss", F3F(2, 0x34, 0x009), F3F(~2, ~0x34, ~0x009)|RS1_G0, "f,g", 0, v6 }, -{ "fmovd", F3F(2, 0x34, 0x002), F3F(~2, ~0x34, ~0x002)|RS1_G0, "B,H", 0, v9 }, -{ "fmovq", F3F(2, 0x34, 0x003), F3F(~2, ~0x34, ~0x003)|RS1_G0, "R,J", 0, v9 }, -{ "fmovs", F3F(2, 0x34, 0x001), F3F(~2, ~0x34, ~0x001)|RS1_G0, "f,g", 0, v6 }, -{ "fnegd", F3F(2, 0x34, 0x006), F3F(~2, ~0x34, ~0x006)|RS1_G0, "B,H", 0, v9 }, -{ "fnegq", F3F(2, 0x34, 0x007), F3F(~2, ~0x34, ~0x007)|RS1_G0, "R,J", 0, v9 }, -{ "fnegs", F3F(2, 0x34, 0x005), F3F(~2, ~0x34, ~0x005)|RS1_G0, "f,g", 0, v6 }, - -{ "faddd", F3F(2, 0x34, 0x042), F3F(~2, ~0x34, ~0x042), "v,B,H", 0, v6 }, -{ "faddq", F3F(2, 0x34, 0x043), F3F(~2, ~0x34, ~0x043), "V,R,J", 0, v8 }, -{ "fadds", F3F(2, 0x34, 0x041), F3F(~2, ~0x34, ~0x041), "e,f,g", 0, v6 }, -{ "fsubd", F3F(2, 0x34, 0x046), F3F(~2, ~0x34, ~0x046), "v,B,H", 0, v6 }, -{ "fsubq", F3F(2, 0x34, 0x047), F3F(~2, ~0x34, ~0x047), "V,R,J", 0, v8 }, -{ "fsubs", F3F(2, 0x34, 0x045), F3F(~2, ~0x34, ~0x045), "e,f,g", 0, v6 }, - -#define CMPFCC(x) (((x)&0x3)<<25) - -{ "fcmpd", F3F(2, 0x35, 0x052), F3F(~2, ~0x35, ~0x052)|RD_G0, "v,B", 0, v6 }, -{ "fcmpd", CMPFCC(0)|F3F(2, 0x35, 0x052), CMPFCC(~0)|F3F(~2, ~0x35, ~0x052), "6,v,B", 0, v9 }, -{ "fcmpd", CMPFCC(1)|F3F(2, 0x35, 0x052), CMPFCC(~1)|F3F(~2, ~0x35, ~0x052), "7,v,B", 0, v9 }, -{ "fcmpd", CMPFCC(2)|F3F(2, 0x35, 0x052), CMPFCC(~2)|F3F(~2, ~0x35, ~0x052), "8,v,B", 0, v9 }, -{ "fcmpd", CMPFCC(3)|F3F(2, 0x35, 0x052), CMPFCC(~3)|F3F(~2, ~0x35, ~0x052), "9,v,B", 0, v9 }, -{ "fcmped", F3F(2, 0x35, 0x056), F3F(~2, ~0x35, ~0x056)|RD_G0, "v,B", 0, v6 }, -{ "fcmped", CMPFCC(0)|F3F(2, 0x35, 0x056), CMPFCC(~0)|F3F(~2, ~0x35, ~0x056), "6,v,B", 0, v9 }, -{ "fcmped", CMPFCC(1)|F3F(2, 0x35, 0x056), CMPFCC(~1)|F3F(~2, ~0x35, ~0x056), "7,v,B", 0, v9 }, -{ "fcmped", CMPFCC(2)|F3F(2, 0x35, 0x056), CMPFCC(~2)|F3F(~2, ~0x35, ~0x056), "8,v,B", 0, v9 }, -{ "fcmped", CMPFCC(3)|F3F(2, 0x35, 0x056), CMPFCC(~3)|F3F(~2, ~0x35, ~0x056), "9,v,B", 0, v9 }, -{ "fcmpq", F3F(2, 0x34, 0x053), F3F(~2, ~0x34, ~0x053)|RD_G0, "V,R", 0, v8 }, -{ "fcmpq", CMPFCC(0)|F3F(2, 0x35, 0x053), CMPFCC(~0)|F3F(~2, ~0x35, ~0x053), "6,V,R", 0, v9 }, -{ "fcmpq", CMPFCC(1)|F3F(2, 0x35, 0x053), CMPFCC(~1)|F3F(~2, ~0x35, ~0x053), "7,V,R", 0, v9 }, -{ "fcmpq", CMPFCC(2)|F3F(2, 0x35, 0x053), CMPFCC(~2)|F3F(~2, ~0x35, ~0x053), "8,V,R", 0, v9 }, -{ "fcmpq", CMPFCC(3)|F3F(2, 0x35, 0x053), CMPFCC(~3)|F3F(~2, ~0x35, ~0x053), "9,V,R", 0, v9 }, -{ "fcmpeq", F3F(2, 0x34, 0x057), F3F(~2, ~0x34, ~0x057)|RD_G0, "V,R", 0, v8 }, -{ "fcmpeq", CMPFCC(0)|F3F(2, 0x35, 0x057), CMPFCC(~0)|F3F(~2, ~0x35, ~0x057), "6,V,R", 0, v9 }, -{ "fcmpeq", CMPFCC(1)|F3F(2, 0x35, 0x057), CMPFCC(~1)|F3F(~2, ~0x35, ~0x057), "7,V,R", 0, v9 }, -{ "fcmpeq", CMPFCC(2)|F3F(2, 0x35, 0x057), CMPFCC(~2)|F3F(~2, ~0x35, ~0x057), "8,V,R", 0, v9 }, -{ "fcmpeq", CMPFCC(3)|F3F(2, 0x35, 0x057), CMPFCC(~3)|F3F(~2, ~0x35, ~0x057), "9,V,R", 0, v9 }, -{ "fcmps", F3F(2, 0x35, 0x051), F3F(~2, ~0x35, ~0x051)|RD_G0, "e,f", 0, v6 }, -{ "fcmps", CMPFCC(0)|F3F(2, 0x35, 0x051), CMPFCC(~0)|F3F(~2, ~0x35, ~0x051), "6,e,f", 0, v9 }, -{ "fcmps", CMPFCC(1)|F3F(2, 0x35, 0x051), CMPFCC(~1)|F3F(~2, ~0x35, ~0x051), "7,e,f", 0, v9 }, -{ "fcmps", CMPFCC(2)|F3F(2, 0x35, 0x051), CMPFCC(~2)|F3F(~2, ~0x35, ~0x051), "8,e,f", 0, v9 }, -{ "fcmps", CMPFCC(3)|F3F(2, 0x35, 0x051), CMPFCC(~3)|F3F(~2, ~0x35, ~0x051), "9,e,f", 0, v9 }, -{ "fcmpes", F3F(2, 0x35, 0x055), F3F(~2, ~0x35, ~0x055)|RD_G0, "e,f", 0, v6 }, -{ "fcmpes", CMPFCC(0)|F3F(2, 0x35, 0x055), CMPFCC(~0)|F3F(~2, ~0x35, ~0x055), "6,e,f", 0, v9 }, -{ "fcmpes", CMPFCC(1)|F3F(2, 0x35, 0x055), CMPFCC(~1)|F3F(~2, ~0x35, ~0x055), "7,e,f", 0, v9 }, -{ "fcmpes", CMPFCC(2)|F3F(2, 0x35, 0x055), CMPFCC(~2)|F3F(~2, ~0x35, ~0x055), "8,e,f", 0, v9 }, -{ "fcmpes", CMPFCC(3)|F3F(2, 0x35, 0x055), CMPFCC(~3)|F3F(~2, ~0x35, ~0x055), "9,e,f", 0, v9 }, - -/* FIXME These are marked F_ALIAS, so that they won't conflict with new v9 - insns when v9 is present. Otherwise, the F_ALIAS flag is ignored. */ -{ "cpop1", F3(2, 0x36, 0), F3(~2, ~0x36, ~1), "[1+2],d", F_ALIAS, v6 }, -{ "cpop2", F3(2, 0x37, 0), F3(~2, ~0x37, ~1), "[1+2],d", F_ALIAS, v6 }, -{ "impdep1", F3(2, 0x36, 0), F3(~2, ~0x36, ~1), "[1+2],d", 0, v9 }, -{ "impdep2", F3(2, 0x37, 0), F3(~2, ~0x37, ~1), "[1+2],d", 0, v9 }, - -{ "casa", F3(3, 0x3c, 0), F3(~3, ~0x3c, ~0), "[1]A,2,d", 0, v9 }, -{ "casa", F3(3, 0x3c, 1), F3(~3, ~0x3c, ~1), "[1]o,2,d", 0, v9 }, -{ "casxa", F3(3, 0x3e, 0), F3(~3, ~0x3e, ~0), "[1]A,2,d", 0, v9 }, -{ "casxa", F3(3, 0x3e, 1), F3(~3, ~0x3e, ~1), "[1]o,2,d", 0, v9 }, - -}; - -const int bfd_sparc_num_opcodes = ((sizeof sparc_opcodes)/(sizeof sparc_opcodes[0])); diff --git a/bfd/startcom-p b/bfd/startcom-p deleted file mode 100755 index 0748faddbf..0000000000 --- a/bfd/startcom-p +++ /dev/null @@ -1,12 +0,0 @@ -# sed script for preprocessing BFD header files -# activity: -/^\/\*$/{ -N -# Delete empty comment blocks -/^\/\*\n\*\/ *$/d -# Transpose -s/^\/\*\n *$/\ -\/*/ -# merge on line by itself with following line -s/^\/\*\n\(.*\)/\/* \1/ -} diff --git a/bfd/tolibbfd b/bfd/tolibbfd deleted file mode 100755 index ef9531ef88..0000000000 --- a/bfd/tolibbfd +++ /dev/null @@ -1,4 +0,0 @@ -/---------------START FROM/,/---------------END FROM/d -/\/\*:libbfd.c\*\//r libbfd.ip -/\/\*:cache.c\*\//r cache.ip -/\/\*:reloc.c\*\//r reloc.ip diff --git a/bfd/tolibcoff b/bfd/tolibcoff deleted file mode 100755 index 548c8baa59..0000000000 --- a/bfd/tolibcoff +++ /dev/null @@ -1 +0,0 @@ -/\/\*:coffcode.h\*\//r coffcode.p diff --git a/bfd/trad-core.h b/bfd/trad-core.h deleted file mode 100644 index b86f485ec3..0000000000 --- a/bfd/trad-core.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Declarations of BFD back end for traditional Unix core files - Copyright (C) 1990-1991 Free Software Foundation, Inc. - Written by Cygnus Support. Mostly John Gilmore's fault. - -This file is part of BFD, the Binary File Descriptor 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. */ - -#include "ansidecl.h" - -/* forward declaration */ -PROTO (bfd_target *, trad_unix_core_file_p, (bfd *abfd)); -PROTO (char *, trad_unix_core_file_failing_command, (bfd *abfd)); -PROTO (int, trad_unix_core_file_failing_signal, (bfd *abfd)); -PROTO (boolean, trad_unix_core_file_matches_executable_p, - (bfd *core_bfd, bfd *exec_bfd)); diff --git a/bfd/unPROTO b/bfd/unPROTO deleted file mode 100755 index a6f95207db..0000000000 --- a/bfd/unPROTO +++ /dev/null @@ -1,18 +0,0 @@ -# -# The PROTO macro is a subterfuge to be compatible with both ANSI and K&R -# declaration syntax. It's not widely known, so for the docn just map the -# thing to ANSI declaration syntax. -# -# First, join up defns broken across multiple lines in source---but leave -# any linebreaks, to prettify our examples -:pbegn -/PROTO(.*, *$/N -s/\n/?/ -t pbegn -s/?/\ -/g -# Now actually do the PROTO interpretation. -# A PROTO invocation looks like -# PROTO( resulttype, function, (arglist)); -s/[ ]*PROTO(\(.*\),[\n ]*\(.*\),[\n ]*\((.*)\));/\1 \2\3;/ - diff --git a/binutils/binutils.texinfo b/binutils/binutils.texinfo deleted file mode 100755 index 37167e56c8..0000000000 --- a/binutils/binutils.texinfo +++ /dev/null @@ -1,730 +0,0 @@ -\input texinfo -@setfilename binutils.info -@synindex ky cp -@c -@c This file documents the GNU binary utilities "ar", "ld", "objdump", "nm", -@c "size", "strip", and "ranlib". -@c -@c Copyright (C) 1991 Free Software Foundation, Inc. -@c -@c This text may be freely distributed under the terms of the GNU -@c General Public License. -@c -@c $Id$ -@iftex -@finalout -@c @smallbook -@end iftex -@c @cropmarks -@setchapternewpage odd -@settitle GNU Binary Utilities -@titlepage -@title The GNU Binary Utilities -@subtitle Version 1.90 -@sp 1 -@subtitle October 1991 -@author Roland H. Pesch -@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{} 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 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. -@end titlepage - -@node Top, ar, (dir), (dir) -@chapter Introduction - -@cindex version -This brief manual contains preliminary documentation for the GNU binary -utilities (collectively version 1.90): -@table @code -@item ar -Create, modify, and extract from archives - -@item nm -List symbols from object files - -@item objdump -Display information from object files - -@item ranlib -Generate index to archive contents - -@item size -List section sizes and total size - -@item strip -Discard symbols -@end table - -@ifinfo -Copyright @copyright{} 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 a 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 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. -@end ifinfo - -@menu -* ar:: Create, modify, and extract from archives -* ld:: See ld.info -* nm:: List symbols from object files -* objdump:: Display information from object files -* ranlib:: Generate index to archive contents -* size:: List section sizes and total size -* strip:: Discard symbols -* Index:: -@end menu - -@node ar, ld, Top, Top -@chapter ar - -@kindex ar -@cindex archives -@cindex collections of files -@smallexample - ar [-]@var{p}@var{mod} [ @var{membername} ] @var{archive} @var{files}@dots{} -@end smallexample - -The GNU @code{ar} program creates, modifies, and extracts from -archives. An @dfn{archive} is a single file holding a collection of -other files in a structure that makes it possible to retrieve -the original individual files (called @dfn{members} of the archive). - -The original files' contents, mode (permissions), timestamp, owner, and -group are preserved in the archive, and may be reconstituted on -extraction. - -@cindex name length -GNU @code{ar} can maintain archives whose members have names of any -length; however, depending on how @code{ar} is configured on your -system, a limit on member-name length may be imposed (for compatibility -with archive formats maintained with other tools). If it exists, the -limit is often 15 characters (typical of formats related to a.out) or 16 -characters (typical of formats related to coff). - -@cindex libraries -@code{ar} is considered a binary utility because archives of this sort -are most often used as @dfn{libraries} holding commonly needed -subroutines. - -@cindex symbol index -@code{ar} will create an index to the symbols defined in relocatable -object modules in the archive when you specify the modifier @samp{s}. -Once created, this index is updated in the archive whenever @code{ar} -makes a change to its contents (save for the @samp{q} update operation). -An archive with such an index speeds up linking to the library, and -allows routines in the library to call each other without regard to -their placement in the archive. - -You may use @samp{nm -s} or @samp{nm +print-armap} to list this index -table. If an archive lacks the table, another form of @code{ar} called -@code{ranlib} can be used to add just the table. - -@code{ar} insists on at least two arguments to execute: one -keyletter specifying the @emph{operation} (optionally accompanied by other -keyletters specifying @emph{modifiers}), and the archive name to act on. - -Most operations can also accept further @var{files} arguments, -specifying particular files to operate on. - -GNU @code{ar} allows you to mix the operation code @var{p} and modifier -flags @var{mod} in any order, within the first command-line argument. - -If you wish, you may begin the first command-line argument with a -dash. - -@cindex operations on archive -The @var{p} keyletter specifies what operation to execute; it may be -any of the following, but you must specify only one of them: - -@table @code -@item d -@cindex deleting from archive -@emph{Delete} modules from the archive. Specify the names of modules to -be deleted as @var{files}; the archive is untouched if you -specify no files to delete. - -If you specify the @samp{v} modifier, @code{ar} will list each module -as it is deleted. - -@item m -@cindex moving in archive -Use this operation to @emph{move} members in an archive. - -The ordering of members in an archive can make a difference in how -programs are linked using the library, if a symbol is defined in more -than one member. - -If no modifiers are used with @code{m}, any members you name in the -@var{files} arguments are moved to the @emph{end} of the archive; -you can use the @samp{a}, @samp{b}, or @samp{i} modifiers to move them to a -specified place instead. - -@item p -@cindex printing from archive -@emph{Print} the specified members of the archive, to the standard -output file. If the @samp{v} modifier is specified, show the member -name before copying its contents to standard output. - -If you specify no @var{files}, all the files in the archive are printed. - -@item q -@cindex quick append to archive -@emph{Quick append}; add @var{files} to the end of @var{archive}, -without checking for replacement. - -The modifiers @samp{a}, @samp{b}, and @samp{i} do @emph{not} affect this -operation; new members are always placed at the end of the archive. - -The modifier @samp{v} makes @code{ar} list each file as it is appended. - -Since the point of this operation is speed, the archive's symbol table -index is not updated, even if it already existed; you can use @samp{ar s} or -@code{ranlib} explicitly to update the symbol table index. - -@item r -@cindex replacement in archive -Insert @var{files} into @var{archive} (with @emph{replacement}). This -operation differs from @samp{q} in that any previously existing members -are deleted if their names match those being added. - -If one of the files named in @var{files} doesn't exist, @code{ar} -displays an error message, and leaves undisturbed any existing members -of the archive matching that name. - -By default, new members are added at the end of the file; but you may -use one of the modifiers @samp{a}, @samp{b}, or @samp{i} to request -placement relative to some existing member. - -The modifier @samp{v} used with this operation elicits a line of -output for each file inserted, along with one of the letters @samp{a} or -@samp{r} to indicate whether the file was appended (no old member -deleted) or replaced. - -@item t -@cindex contents of archive -Display a @emph{table} listing the contents of @var{archive}, or those -of the files listed in @var{files} that are present in the -archive. Normally only the member name is shown; if you also want to -see the modes (permissions), timestamp, owner, group, and size, you can -request that by also specifying the @samp{v} modifier. - -If you do not specify any @var{files}, all files in the archive -are listed. - -@cindex repeated names in archive -@cindex name duplication in archive -If there is more than one file with the same name (say, @samp{fie}) in -an archive (say @samp{b.a}), @samp{ar t b.a fie} will list only the -first instance; to see them all, you must ask for a complete -listing---in our example, @samp{ar t b.a}. -@c WRS only; per Gumby, this is implementation-dependent, and in a more -@c recent case in fact works the other way. - -@item x -@cindex extract from archive -@emph{Extract} members (named @var{files}) from the archive. You can -use the @samp{v} modifier with this operation, to request that -@code{ar} list each name as it extracts it. - -If you do not specify any @var{files}, all files in the archive -are extracted. - -@end table - -A number of modifiers (@var{mod}) may immediately follow the @var{p} -keyletter, to specify variations on an operation's behavior: - -@table @code -@item a -@cindex relative placement in archive -Add new files @emph{after} an existing member of the -archive. If you use the modifier @code{a}, the name of an existing archive -member must be present as the @var{membername} argument, before the -@var{archive} specification. - -@item b -Add new files @emph{before} an existing member of the -archive. If you use the modifier @code{b}, the name of an existing archive -member must be present as the @var{membername} argument, before the -@var{archive} specification. (same as @samp{i}). - -@item c -@cindex creating archives -@emph{Create} the archive. The specified @var{archive} is always -created if it didn't exist, when you request an update. But a warning is -issued unless you specify in advance that you expect to create it, by -using this modifier. - -@item i -Insert new files @emph{before} an existing member of the -archive. If you use the modifier @code{i}, the name of an existing archive -member must be present as the @var{membername} argument, before the -@var{archive} specification. (same as @samp{b}). - -@item l -This modifier is accepted but not used. -@c whaffor ar l modifier??? presumably compat; with -@c what???---pesch@@cygnus.com, 25jan91 - -@item o -@cindex dates in archive -Preserve the @emph{original} dates of members when extracting them. If -you do not specify this modifier, files extracted from the archive -will be stamped with the time of extraction. - -@item s -@cindex writing archive index -Write an object-file index into the archive, or update an existing one, -even if no other change is made to the archive. You may use this modifier -flag either with any operation, or alone. Running @samp{ar s} on an -archive is equivalent to running @samp{ranlib} on it. - -@item u -@cindex updating an archive -Normally, @code{ar r}@dots{} inserts all files -listed into the archive. If you would like to insert @emph{only} those -of the files you list that are newer than existing members of the same -names, use this modifier. The @samp{u} modifier is allowed only for the -operation @samp{r} (replace). In particular, the combination @samp{qu} is -not allowed, since checking the timestamps would lose any speed -advantage from the operation @samp{q}. - -@item v -This modifier requests the @emph{verbose} version of an operation. Many -operations display additional information, such as filenames processed, -when the modifier @samp{v} is appended. - -@end table - -@node ld, nm, ar, Top -@chapter ld -@cindex linker -@kindex ld -The GNU linker @code{ld} is now described in a separate manual. -@xref{Top,, Overview,, GLD: the GNU linker}. - -@node nm, objdump, ld, Top -@chapter nm -@cindex symbols -@kindex nm - -@smallexample - nm [ -a | +debug-syms ] [ -g | +extern-only ] - [ -s | +print-armap ] [ -o | +print-file-name ] - [ -n | +numeric-sort ] [ -p | +no-sort ] - [ -r | +reverse-sort ] [ -u | +undefined-only ] - [ +target @var{bfdname} ] - [ @var{objfiles}@dots{} ] -@end smallexample - -GNU @code{nm} will list the symbols from object files @var{objfiles}. - -The long and short forms of options, shown here as alternatives, are -equivalent. - -@table @code -@item @var{objfiles}@dots{} -@kindex a.out -Object files whose symbols are to be listed. If no object files are -listed as arguments, @code{nm} assumes @samp{a.out}. - -@item -a -@itemx +debug-syms -@cindex debugging symbols -Display debugger-only symbols; normally these are not listed. - -@item -g -@itemx +extern-only -@cindex external symbols -Display only external symbols. - -@item -p -@itemx +no-sort -@cindex sorting symbols -Don't bother to sort the symbols in any order; just print them in the -order encountered. - -@item -n -@itemx +numeric-sort -Sort symbols numerically by their addresses, not alphabetically by their -names. - -@item -s -@itemx +print-armap -@cindex symbol index, listing -When listing symbols from archive members, include the index: a mapping -(stored in the archive by @code{ar} or @code{ranlib}) of what modules -contain definitions for what names. - -@item -o -@itemx +print-file-name -@cindex input file name -@cindex file name -@cindex source file name -Precede each symbol by the name of the input file where it was found, -rather than identifying the input file once only before all of its -symbols. - -@item -r -@itemx +reverse-sort -Reverse the sense of the sort (whether numeric or alphabetic); let the -last come first. - -@item +target @var{bfdname} -@c @item +target -@cindex object code format -Specify an object code format other than your system's default format. -@xref{objdump}, for information on listing available formats. -@c FIXME what *does* +target/no arg do? - -@item -u -@itemx +undefined-only -@cindex external symbols -@cindex undefined symbols -Display only undefined symbols (those external to each object file). - -@end table - -@node objdump, ranlib, nm, Top -@chapter objdump - -@cindex object file information -@kindex objdump - -@smallexample - objdump [ -a ] [ -b @var{bfdname} ] [ -d ] [ -f ] - [ -h | +header ] [ -i ] [ -j @var{section} ] [ -l ] - [ -m @var{machine} ] [ -r | +reloc ] [ -s ] - [ -t | +syms ] [ -x ] - @var{objfiles}@dots{} -@end smallexample - -@code{objdump} displays information about one or more object files. -The options control what particular information to display. This -information is mostly useful to programmers who are working on the -compilation tools, as opposed to programmers who just want their -program to compile and work. - -The long and short forms of options, shown here as alternatives, are -equivalent. - -@table @code -@item @var{objfiles}@dots{} -The object files to be examined. When you specify archives, -@code{objdump} shows information on each of the member object files. - -@item -a -@c print_arelt_descr -@cindex archive headers -If any files from @var{objfiles} are archives, display the archive -header information (in a format similar to @samp{ls -l}). Besides the -information you could list with @samp{ar tv}, @samp{objdump -a} shows -the object file format of each archive member. - -@c suggest longname +target or +format or +bfd -@item -b @var{bfdname} -@cindex object code format -You can specify a particular object-code format for your object files as -@var{bfdname}. This may not be necessary; @var{objdump} can -automatically recognize many formats. For example, -@example -objdump -b oasys -m vax -h fu.o -@end example -@noindent -Displays summary information from the section headers (@samp{-h}) of -@file{fu.o}, which is explicitly identified (@samp{-m}) as a Vax object -file in the format produced by Oasys compilers. You can list the -formats available with the @samp{-i} option. - -@item -d -@cindex disassembling object code -@cindex machine instructions -Disassemble. Display the assembler mnemonics for the machine -instructions from @var{objfiles}. - -@item -f -@cindex object file header -File header. Display summary information from the overall header of -each file in @var{objfiles}. - -@item -h -@itemx +header -@cindex section headers -Header. Display summary information from the section headers of the -object file. - -@item -i -@cindex architectures available -@cindex object formats available -Display a list showing all architectures and object formats available -for specification with @code{-b} or @code{-m}. - -@c suggest longname +section -@item -j @var{name} -@cindex section information -Display information only for section @var{name} - -@c suggest longname +label or +linespec -@item -l -@cindex source filenames for object files -Label the display (using debugging information) with the source filename -and line numbers corresponding to the object code shown. - -@c suggest longname +architecture -@item -m @var{machine} -@cindex architecture -Specify the object files @var{objfiles} are for architecture -@var{machine}. You can list available architectures using the @samp{-i} -option. - -@item -r -@itemx +reloc -@cindex relocation entries, in object file -Relocation. Print the relocation entries of the file. - -@item -s -@cindex sections, full contents -@cindex object file sections -Display the full contents of any sections requested. - -@item -t -@itemx +syms -@cindex symbol table entries, printing -Symbol Table. Print the symbol table entries of the file. -This is similar to the information provided by the @samp{nm} program. - -@item -x -@cindex all header information, object file -@cindex header information, all -Display all available header information, including the symbol table and -relocation entries. Using @samp{-x} is equivalent to specifying all of -@samp{-a -f -h -r -t}. - -@end table - -@node ranlib, size, objdump, Top -@chapter ranlib - -@kindex ranlib -@cindex archive contents -@cindex symbol index - -@smallexample - ranlib @var{archive} -@end smallexample - -@code{ranlib} generates an index to the contents of an archive, and -stores it in the archive. The index lists each symbol defined by a -member of an archive that is a relocatable object file. - -You may use @samp{nm -s} or @samp{nm +print-armap} to list this index. - -An archive with such an index speeds up linking to the library, and -allows routines in the library to call each other without regard to -their placement in the archive. - -The GNU @code{ranlib} program is another form of GNU @code{ar}; running -@code{ranlib} is completely equivalent to executing @samp{ar -s}. -@xref{ar}. - -@node size, strip, ranlib, Top -@chapter size - -@kindex size -@cindex section sizes - -@smallexample - size [ -A | -B | +format @var{compatibility} ] - [ +help ] [ -d | -o | -x | +radix @var{number} ] - [ +target @var{bfdname} ] [ -V | +version ] - @var{objfiles}@dots{} -@end smallexample - -The GNU @code{size} utility lists the section sizes---and the total -size---for each of the object files @var{objfiles} in its argument list. -By default, one line of output is generated for each object file or each -module in an archive. - -The command line options have the following meanings: -@table @code -@item @var{objfiles}@dots{} -The object files to be examined. - -@item -A -@itemx -B -@itemx +format @var{compatibility} -@cindex size display format -Using one of these options, you can choose whether the output from GNU -@code{size} resembles output from System V @code{size} (using @samp{-A}, -or @samp{+format sysv}), or Berkeley @code{size} (using @samp{-B}, or -@samp{+format berkeley}). The default is the one-line format similar to -Berkeley's. -@c Bonus for doc-source readers: you can also say +format=strange (or -@c anything else that starts with 's') for sysv, and +format=boring (or -@c anything else that starts with 'b') for Berkeley. - -Here is an example of the Berkeley (default) format of output from -@code{size}: -@smallexample - eg$ size +format Berkeley ranlib size -text data bss dec hex filename -294880 81920 11592 388392 5ed28 ranlib -294880 81920 11888 388688 5ee50 size -@end smallexample - -@noindent -This is the same data, but displayed closer to System V conventions: - -@smallexample - eg$ size +format SysV ranlib size -ranlib : -section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11592 385024 -Total 388392 - - -size : -section size addr -.text 294880 8192 -.data 81920 303104 -.bss 11888 385024 -Total 388688 -@end smallexample - -@item +help -Show a summary of acceptable arguments and options. - -@item -d -@itemx -o -@itemx -x -@itemx +radix @var{number} -@cindex size number format -@cindex radix for section sizes -Using one of these options, you can control whether the size of each -section is given in decimal (@samp{-d}, or @samp{+radix 10}); octal -(@samp{-o}, or @samp{+radix 8}); or hexadecimal (@samp{-x}, or -@samp{+radix 16}). In @samp{+radix @var{number}}, only the three -values (8, 10, 16) are supported. The total size is always given in two -radices; decimal and hexadecimal for @samp{-d} or @samp{-x} output, or -octal and hexadecimal if you're using @samp{-o}. - -@item +target @var{bfdname} -@cindex object code format -You can specify a particular object-code format for @var{objfiles} as -@var{bfdname}. This may not be necessary; @var{size} can -automatically recognize many formats. @xref{objdump}, for information -on listing available formats. - -@item -V -@itemx +version -Display version number information on @code{size} itself. - -@end table - -@node strip, Index, size, Top -@chapter strip - -@kindex strip -@cindex removing symbols -@cindex discarding symbols - -@smallexample - strip [ -s | +strip-all ] [ -g | -S | +strip-debug ] - [ -x | +discard-all ] [ -X | +discard-locals ] - [ -T @var{bfdname} ] - @var{objfiles}@dots{} -@end smallexample - -GNU @code{strip} will discard all symbols from object files -@var{objfiles}, if no options are specified; or only certain symbols, -depending on its command-line options. - -@code{strip} will not execute unless at least one object file is listed. - -@quotation -@emph{WARNING:} @code{strip} modifies the files named in its argument, -rather than writing modified copies under different names. -@end quotation - -The long and short forms of options, shown here as alternatives, are -equivalent. - -@table @code -@item -s -@itemx +strip-all -@cindex all symbols, discarding -This is the default case: strip all symbol entries from @var{objfiles}. - -@item -g -@itemx -S -@itemx +strip-debug -@cindex debugging symbols, discarding -Discard only debugging symbol information from @var{objfiles}. - -@item -x -@itemx +discard-all -@cindex local symbols, discarding -Discard all symbols local to each file in @var{objfiles}. -@emph{WARNING:} Note that @code{+discard-all} discards only @emph{local} -symbols, in spite of its name. - -@item -X -@itemx +discard-locals -Discard local symbols starting with @samp{L} from each file in -@var{objfiles}. (Some compilers produce internally-used symbols that -begin with @samp{L}.) - -@item -T @var{bfdname} -@cindex object code format -You can specify a particular object-code format @var{bfdname} for -@var{objfiles}. This may not be necessary; @var{strip} can automatically -recognize many formats. @xref{objdump}, for information on listing -available formats. -@end table - -@node Index, , strip, Top -@unnumbered Index - -@printindex cp - -@contents -@bye diff --git a/binutils/config.sub b/binutils/config.sub deleted file mode 100755 index dac9ab89d4..0000000000 --- a/binutils/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/binutils/configdos.bat b/binutils/configdos.bat deleted file mode 100755 index 2702dd0c5c..0000000000 --- a/binutils/configdos.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off -@echo Configuring binutils for H8/300, hosted on MS-DOS - -copy ..\bfd\hosts\h-go32.h sysdep.h - -copy makefile.dos makefile diff --git a/binutils/cplus-dem.c b/binutils/cplus-dem.c deleted file mode 100644 index 22a38bac2c..0000000000 --- a/binutils/cplus-dem.c +++ /dev/null @@ -1,934 +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). */ - -/* This file exports one function - - char *cplus_demangle (const char *name) - - If `name' is a mangled function name produced by g++, 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. - - For example, - - cplus_demangle ("_foo__1Ai") - - returns - - "A::foo(int)" - - 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. */ - -#if 0 /* Should really be part of BFD */ -#define nounderscore 1 /* define this is names don't start with _ */ -#endif -#include "bfd.h" -#include "sysdep.h" - -#include - -#ifndef __STDC__ -#define const -#endif - -#ifdef __STDC__ -extern char *cplus_demangle (const char *type); -#else -extern char *cplus_demangle (); -#endif - -static char **typevec = 0; -static int ntypes = 0; -static int typevec_size = 0; - -static struct { - const char *in; - const char *out; -} optable[] = { - "new", " new", - "delete", " delete", - "ne", "!=", - "eq", "==", - "ge", ">=", - "gt", ">", - "le", "<=", - "lt", "<", - "plus", "+", - "minus", "-", - "mult", "*", - "convert", "+", /* unary + */ - "negate", "-", /* unary - */ - "trunc_mod", "%", - "trunc_div", "/", - "truth_andif", "&&", - "truth_orif", "||", - "truth_not", "!", - "postincrement", "++", - "postdecrement", "--", - "bit_ior", "|", - "bit_xor", "^", - "bit_and", "&", - "bit_not", "~", - "call", "()", - "cond", "?:", - "alshift", "<<", - "arshift", ">>", - "component", "->", - "indirect", "*", - "method_call", "->()", - "addr", "&", /* unary & */ - "array", "[]", - "nop", "", /* for operator= */ -}; - -/* Beware: these aren't '\0' terminated. */ - -typedef struct { - 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); -static int do_type (const char **type, string *result); -static int do_arg (const char **type, string *result); -static int do_args (const char **type, string *decl); -static void munge_function_name (string *name); -#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 (); -static void string_prepends (); -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 (); -#endif - -char * -cplus_demangle (type) - const char *type; -{ - string decl; - int n; - int success = 0; - int constructor = 0; - int const_flag = 0; - int i; - const char *p, *premangle; - - 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] == '$' && type[2] == '_') - { - unsigned int l = (strlen (type) - 3)*2 + 3 + 2 + 1; - char *tem = (char *) xmalloc (l); - strcpy (tem, type + 3); - strcat (tem, "::~"); - strcat (tem, type + 3); - strcat (tem, "()"); - return tem; - } - /* static data member */ - if (*type != '_' && (p = (char *) strchr (type, '$')) != 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 */ - if (type[0] == '_' && type[1] == 'v' && type[2] == 't' && type[3] == '$') - { - 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 (p == type) - { - if (!isdigit (p[2])) - { - string_delete (&decl); - return NULL; - } - constructor = 1; - } - else - { - string_appendn (&decl, type, p - type); - munge_function_name (&decl); - } - p += 2; - - premangle = p; - 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) - { - string_appendn (&decl, p, n); - string_append (&decl, "::"); - string_appendn (&decl, p, n); - } - else - { - string_prepend (&decl, "::"); - string_prependn (&decl, p, n); - } -#ifndef LONGERNAMES - p = premangle; -#else - p += n; -#endif - success = do_args (&p, &decl); - if (const_flag) - string_append (&decl, " const"); - break; - case 'F': - p += 1; - success = do_args (&p, &decl); - 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) - const char **type; - string *result; -{ - 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 '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) || **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)) || **type != '_') - { - success = 0; - break; - } - *type += 1; - 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, "volatilep"); - } - break; - } - - case 'C': - if ((*type)[1] == 'P') - { - *type += 1; - 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 (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 (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 '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) - const char **type; - string *result; -{ - char *tem; - int len; - const char *start; - const char *end; - - start = *type; - if (!do_type (type, result)) - return 0; - end = *type; - 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); - } - } - len = end - start; - tem = (char *) xmalloc (len + 1); - memcpy (tem, start, len); - tem[len] = '\0'; - typevec[ntypes++] = tem; - return 1; -} - -/* `decl' must be already initialised, usually non-empty; - it won't be freed on failure */ - -static int -do_args (type, decl) - const char **type; - string *decl; -{ - string arg; - int need_comma = 0; - int dont_want_first; - -#ifndef LONGERNAMES - dont_want_first = 1; -#else - dont_want_first = 0; -#endif - - 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) - string_append (decl, ", "); - if (!do_arg (&tem, &arg)) - return 0; - string_appends (decl, &arg); - string_delete (&arg); - need_comma = 1; - } - } - else - { - if (need_comma) - string_append (decl, ", "); - if (!do_arg (type, &arg)) - return 0; - if (dont_want_first) - dont_want_first = 0; - else - { - string_appends (decl, &arg); - need_comma = 1; - } - string_delete (&arg); - } - } - - if (**type == 'v') - *type += 1; - else if (**type == 'e') - { - *type += 1; - if (need_comma) - string_append (decl, ","); - string_append (decl, "..."); - } - - string_append (decl, ")"); - return 1; -} - -static void -munge_function_name (name) - string *name; -{ - if (!string_empty (name) && name->p - name->b >= 3 - && name->b[0] == 'o' && name->b[1] == 'p' && name->b[2] == '$') - { - unsigned 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 (!string_empty (name) && 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)) - { - string_clear (name); - string_append (name, "operator "); - string_appends (name, &type); - string_delete (&type); - 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)); -} - -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/binutils/makefile.dos b/binutils/makefile.dos deleted file mode 100755 index dfda6e642a6d3288c6ad8a140f671d6866e7309b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11006 zcmdT~Yj+w)65Ve(%*l_al{gD%VTk12Y=k1)NFa+10v$kcoH)kAOarr;2WK97Y?A%$ zd#k%=7?9-HyZMm#Bx0r?)z#J2Rkx~UmoBVpF?T&d^Dv@UgDaZ3ffe01WLuiJo}0KL zHg@SWT-`_RVwq6&v_|`fUmZ5~4-fb0EE0mo;XJvuB0*vosOpCS(Op6P){@ zCAI&>btfGVnG)8;+A+R9GWp1p77Mp zj!3xZkLX53F?LD^*%F#wox%t-s#d~mM-;ADAT{uMPo4#)vY94E;Xf&$!q(S2bjS@P zFUxR+?JPkN8@zQrk7k0>SjRIJS+V>Oy5We#lBX><{RRgbgEh~grFA24u(oh-z?elgR4o(f z(}c0A<%PjQZV_y-aw+vWB6m(fnAGVua-k+kC}p^Do|wI@t9APFAAiS%h+}Hsh&r8G z{w#8x1s*Tj^u@vcv%@-FjoYlQ<(^YEj5x9#H=<)gljDduQE$yOj+$O*Tb|*rTg%mK zNX;024}-#ANSD>=Akj^e%Ct~4bRSw6LIGrMB#kSm#LF! zKP#SAK;zr)XxtkPj`z*OgY7Ya&ZLUnBg=U<)8G_UqD+^JAPlT zra_#}u$fxZG@A?CE?2X6yimhQ{god5-dII2Aa~eHaf4V!$)a3U{WadH;p4hWft9P7 zWNJ+`^3Go4O3AaDV=k`l9gD%lFP|Tj$cOSfp&h96o`~B{ z`CSv`M=b_^T=UIu1)I=Ju@_nllHj#P*DsBlv^I@oL0W79bAbkBM)pvR3N zH9FJj#keyZPp9(v)$rNDbZShpA<)u(e|UP#iyB66aGEiz8Lu_n!1hu{7{=*YzYST+ zEoyFS)aaS`AD2|xBYrPe6&03J#tA=XOTq-n8yAq}I4+E+i8}@u5ZC#(u@RzgFWZxI zx(%ai-qbh^FkbQ?_u;uhGL+W;^nk*EaoVaF*9Kr0Z! zfq!Cu7T?E-0JOMWy7m$?f=Z&im_j6Ihqr~L{PQv4*0Y5KbWqVqD8Cl7GQ(% z4-8FJmbEg?+H3)Lnq27K*eI z)s-I4d&ZdoQh`P2YrNJ+cz?);PX(9GY?1Xt}CH z$M;;#mrrLM{>eGR%|AKofU<0Zp{X%*uzui7T`87XltQ+~pA2YM3nTMon3S@t2KP1C zN4M5|OXLD{RK*gt)_MilSKdY#H1|xn(NfiR*6SZhdjq~;-ZRHi+gern=MZz4uu*!> zw2tmx?I!vGz<`e6aJx5dd5^ z6jt~Yp4L>Q<9?JHW3`5m-irVcVx2 z;0Bu5VnXXuh60(e_D0!#`4|P;SRsd$Tf{zIU>U~Q;uWA(X`4o>pCY}CBqQGkL_VIg zBFK7-J7~!Nz+924VsMkr$MUD6XSP>lM*`7x496G4kfQi8)}EE)b#mwQ|<%ZO-9u zVW&4R62Oy+AK;mT1(v@DQV1L#UY*E*9t_VpDNvEHOAoKq5fQIEMgi<;bSvD2;#YbN z23gnA(?_NRbZrlG0>GFX;oU1PIA@Y^ppPkDa>7Huz>G&zc63wK@Yo3hI?cqxLsnMv zX%oDue-DT}dBTmzrv}^hqK+7)h8M66S0NGK)QxV4b1N7EXbpiui#h<%0b#3?Ww|-R zMi>gHfL5EqBQPIRQ38<$eoG$O{;SPwdw^dP$V2(0wm-o5^Ev$ z8Inh~z;N=fIs8`5^8H3hdL28}vR*a$;PJ@^ADn!kSAO>RY|Hm-vn7B znzTo+x|1>5kyIfh3s-4kcq1le=R?t@3gbRpvZO z>QBwW>O{y!&k_6}QJ^vh2#>%=!$*AG@O}QnSG6Bltvuqz+&&>hSw49qp z${aB%90IHSzpUVJpZ!N~E`y(2&PPZy4?)%m@!6UPbl#RruaL<=)WabidpOMIv<3(6 z4VQVym&FP<2zg~F4PWVnx4hJAqya1)V)9P%;f(`AhEGRR$OFPdfkl<&&IeVnZAW+_ z;Z5V89Y&FeS0R#tV7(z^wt%B)xa9{^VX)!aQ_KhwB-!Y%^wLGJKMxUeDxwaFJ0!Jj zH$g<_q|!y_YlFdAiX<_@cf{-t)`n?`QaeG}K@zhcr-LZjl0j;A9xPbI*D5awGCn6W zW8N(sw6ADkZ&gMcAZaCylYV>fO^t&EKHP8-AXz5ky_`8@Thb_yGQ%0nJS(_Xge-5h zv_z2lC|7Wy1OD1|Ts!r`G?uA|+s&yj^RXOWaD6@||MY@nB z4lXW10b{5(@;r6E)P#f*aICOy_?EL`LO~0s@Bg7sznRNuQ%`<>I^qACPLv8t;Xk4i zqIhS;ANtgOk9Su5+W8cYN8rx>R@lq1aW{h&aHR@zP@bT@|IpjrJ$8y>3(f-Bj*G~s z`24~!P{CWkBjHaAAnw)JF!*ndkyUqI2|(&?3HnH&jYp?7y#27We?)zRe+&bmv!{3? z`IB?F39!{NI-qQE;?gJ;u(&R|NEprzqiSbR93~JjS|V|ibH3bL`paK5*e+MM`!`x@ za`?|b!_OmEyAPa<=@QKs7tcz4It<9y&#|it3RDeJmL2ywFnE-mM+cRw+s#iiW@s7d z3~81tEl6w6WDv85%^+sUnU!(Nx;Dx~o@DZgVa3{NHva>R^4A7zU-BAp%>-sOzvn#Y zb{iBIkrJ}Grg?k751h9i*sL|gu18*^09Q~>~YJ$tqdRTkmF`YCJLU$^aJ<-D$ffx5(E8^yv~ zt5}9Z*E+$6p8Q32=oE--SI@RlEapkYG^^Xfw< z`x@izPPwX|Yj1ZjB#WWf1dLr^#oz89Dl4T5@*#sxd(^3LU9E|FY8K$rNw+_IO_Ot! z!!C!t!Nk~Q+^JctsBqa&QSnBdlP2?-9n5-roB< zy~l@X;{Ds5qaAv_ro&gPJ>E*C>nl#o>~3m@#L>N>K%^APssmXSOw zBz|UM;RXRe;W+HjOZ|Y5-`kx|zvk8WTc79CDIe<)-|8Xz?dA59DwQBqMP$#boT67(YO9^i zru_b`MqC!=Z!b(FUz0SJFq``P -#include -#include -#include - -enum strip_action { - strip_undef, - strip_all, /* strip all symbols */ - strip_debug, /* strip all debugger symbols */ -}; - -/* Which symbols to remove. */ -enum strip_action strip_symbols; - -enum locals_action { - locals_undef, - locals_start_L, /* discard locals starting with L */ - locals_all, /* discard all locals */ -}; - -/* Which local symbols to remove. */ -enum locals_action discard_locals; - -/* The name this program was run with. */ -char *program_name; - -struct option long_options[] = { - {"strip-all", 0, 0, 's'}, - {"strip-debug", 0, 0, 'S'}, - {"discard-all", 0, 0, 'x'}, - {"discard-locals", 0, 0, 'X'}, - {0, 0, 0, 0}, -}; - -static char *target = NULL; - -static int fatal_error; - -extern char *malloc(); -extern char *mktemp(); -extern char *realloc(); -extern char *strcpy(); -extern int exit(); -extern int fprintf(); -extern int free(); -extern int getpid(); -extern int kill(); -extern int perror(); -extern int sprintf(); -extern int unlink(); - -#ifdef __STDC__ -static int strip_bfd(bfd *ibfd, bfd *obfd); -static int strip_file(char *filetostrip); -static void usage(void); -#else -static int strip_bfd(); -static int strip_file(); -static void usage(); -#endif /* __STDC__ */ -static void copy_sections (); -static void setup_sections (); - -int main(argc, argv) -char **argv; -int argc; -{ - int ind; - int c; - program_name = argv[0]; - - strip_symbols = strip_undef; /* default is to strip everything. */ - discard_locals = locals_undef; - - while ((c = getopt_long (argc, argv, "gsST:xX", long_options, &ind)) != EOF) { - switch (c) { - case 0: - break; - case 's': - strip_symbols = strip_all; - break; - case 'g': - case 'S': - strip_symbols = strip_debug; - break; - case 'T': - target = optarg; - break; - case 'x': - discard_locals = locals_all; - break; - case 'X': - discard_locals = locals_start_L; - break; - default: - usage (); - } /* switch on option */ - } /* for each option */ - - if (strip_symbols == strip_undef && discard_locals == locals_undef) { - strip_symbols = strip_all; - } /* Default is to strip all symbols. */ - - - if (argc == optind) { - return(strip_file("a.out")); - } else { - int retval = 0; - - for ( ; optind < argc; ++optind) { - retval &= strip_file(argv[optind]); - } /* for each file to strip */ - - return(retval); - } /* if no arguments given */ - -} /* main() */ - -static int delayed_signal; - -void delay_signal(signo) -int signo; -{ - delayed_signal = signo; - signal(signo, delay_signal); -} /* delay_signal() */ - -static int sigint_handled = 0; -static int sighup_handled = 0; -static int sigterm_handled = 0; - -void handle_sigs() { - /* Effectively defer handling of asynchronous kill signals. */ - delayed_signal = 0; - - if (signal (SIGINT, SIG_IGN) != SIG_IGN) { - sigint_handled = 1; - signal(SIGINT, delay_signal); - } /* if not ignored */ - - if (signal (SIGHUP, SIG_IGN) != SIG_IGN) { - sighup_handled = 1; - signal(SIGHUP, delay_signal); - } /* if not ignored */ - - if (signal (SIGTERM, SIG_IGN) != SIG_IGN) { - sigterm_handled = 1; - signal(SIGTERM, delay_signal); - } /* if not ignored */ - - return; -} /* handle_sigs() */ - -void unhandle_sigs() { - /* Effectively undefer handling. */ - if (sigint_handled) - signal (SIGINT, SIG_DFL); - if (sighup_handled) - signal (SIGHUP, SIG_DFL); - if (sigterm_handled) - signal (SIGTERM, SIG_DFL); - - /* Handle any signal that came in while they were deferred. */ - if (delayed_signal) - kill (getpid (), delayed_signal); - - return; -} /* unhandle_sigs() */ - -static int strip_file(filetostrip) -char *filetostrip; -{ - bfd *ibfd; - bfd *obfd; - char tmpfilename[] = "stXXXXXX"; - - if ((ibfd = bfd_openr(filetostrip, (char *)NULL)) == NULL) { - bfd_perror(filetostrip); - return(1); - } /* on error opening input */ - - obfd = bfd_openw(mktemp(tmpfilename), - target? target: bfd_get_target (ibfd)); - if (obfd == NULL) { - bfd_perror(tmpfilename); - - if (bfd_close(ibfd) == false) { - bfd_perror(bfd_get_filename(ibfd)); - } /* on close error */ - - return(1); - } /* on error opening output */ - - handle_sigs(); - - if (bfd_check_format(ibfd, bfd_object) != false) { - if (bfd_set_format(obfd, bfd_get_format(ibfd)) != false) { - if (!strip_bfd(ibfd, obfd)) { - /* success */ - - if (bfd_close(ibfd) == false) { - bfd_perror(bfd_get_filename(ibfd)); - } /* on close error */ - - if (bfd_close(obfd) == false) { - bfd_perror(bfd_get_filename(obfd)); - } /* on close error */ - - rename(tmpfilename, filetostrip); - unhandle_sigs(); - return(0); - } /* strip_bfd prints it's own failing messages */ - } else { - bfd_perror(filetostrip); - } /* can't set format */ - } else { - /* not an object file */ - (void) fprintf(stderr, "File %s has format 0x%x that will not be stripped.\n", - filetostrip, (unsigned) bfd_get_format(ibfd)); - } /* if anything fails along the way */ - - - if (bfd_close(ibfd) == false) { - bfd_perror(bfd_get_filename(ibfd)); - } /* on close error */ - - if (bfd_close(obfd) == false) { - bfd_perror(bfd_get_filename(obfd)); - } /* on close error */ - - if (unlink(tmpfilename)) { - perror(tmpfilename); - } /* on error */ - - unhandle_sigs(); - - return(1); -} /* strip_file() */ - - -boolean -bfd_set_start_address (abfd, new_address) - bfd *abfd; - bfd_vma new_address; -{ - bfd_get_start_address (abfd) = new_address; - return true; -} - - - -static int -strip_bfd(ibfd, obfd) - bfd *ibfd; - bfd *obfd; -{ - if (bfd_set_start_address(obfd, bfd_get_start_address(ibfd)) == false - || bfd_set_file_flags(obfd, bfd_get_file_flags(ibfd) & ~(HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS)) == false - || bfd_set_start_address(obfd, bfd_get_start_address(ibfd)) == false) { - bfd_perror(bfd_get_filename(ibfd)); - return(1); - } /* on error setting file attributes */ - - /* bfd mandates that all output sections be created and sizes set before - any output is done. Thus, we traverse all sections twice. */ - - fatal_error = 0; - bfd_map_over_sections (ibfd, setup_sections, (void *)obfd); - if (!fatal_error) - bfd_map_over_sections (ibfd, copy_sections, (void *)obfd); - return fatal_error; -} - -static void -setup_sections(ibfd, isection, obfd) -bfd *ibfd; -sec_ptr isection; -bfd *obfd; -{ - sec_ptr osection; - char *err; - - do { - err = "making"; - osection = bfd_make_section(obfd, bfd_section_name(ibfd, isection)); - if (osection == NULL) - break; - err = "size"; - if (!bfd_set_section_size(obfd, osection, - bfd_section_size(ibfd, isection))) - break; - err = "vma"; - if (!bfd_set_section_vma(obfd, osection, - bfd_section_vma(ibfd, isection))) - break; - err = "alignment"; - if (!bfd_set_section_alignment(obfd, osection, - bfd_section_alignment(ibfd, isection))) - break; - err = "flags"; - if (!bfd_set_section_flags(obfd, osection, - bfd_get_section_flags(ibfd, isection))) - break; - return; - } while (0); - - (void) fprintf(stderr, "file \"%s\", section \"%s\": error in %s: ", - bfd_get_filename(ibfd), - bfd_section_name(ibfd, isection), - err); - - bfd_perror(""); - fatal_error = 1; -} - -static void -copy_sections(ibfd, isection, obfd) -bfd *ibfd; -sec_ptr isection; -bfd *obfd; -{ - static char *memhunk = NULL; - static unsigned memhunksize = 0; - - sec_ptr osection; - unsigned long size; - flagword iflg; - char *temp; - - osection = bfd_get_section_by_name (obfd, - bfd_section_name(ibfd, isection)); - - size = bfd_section_size(ibfd, isection); - iflg = bfd_get_section_flags(ibfd, isection); - - /* either: - we don't need any memory because there's nothing in this section, - we had no memory so we got some, - we had some memory but not enough so we got more, - or we fail to allocat. */ - - if (size == 0) - return; - - if (memhunk == NULL) { - memhunk = malloc (size); - memhunksize = size; - } - - if (size > memhunksize) { - temp = realloc (memhunk, size); - memhunksize = size; - if (!temp) /* If realloc failed, blow away our mem */ - free (memhunk); - memhunk = temp; - } - - if (memhunk == NULL) { - /* failed to allocate or reallocate */ - /* FIXME, we should just copy in pieces. */ - (void) fprintf(stderr, - "Could not allocate %lu bytes in which to copy section.\n", size); - return; - } - - /* now we have enough memory */ - - if (!bfd_get_section_contents(ibfd, isection, memhunk, 0, size)) { - bfd_perror(bfd_get_filename(ibfd)); - fatal_error = 1; - return; - } - if (!bfd_set_section_contents(obfd, osection, memhunk, 0, size)) { - bfd_perror(bfd_get_filename(obfd)); - fatal_error = 1; - return; - } -} - -void -usage () -{ - fprintf (stderr, "\ -Usage: %s [-gsxSX] [+strip-all] [+strip-debug] [+discard-all]\n\ - [+discard-locals] file...\n", program_name); - exit (1); -} - -/* - * Local Variables: - * comment-column: 0 - * fill-column: 131 - * End: - */ - -/* end of strip.c */ diff --git a/binutils/strip.c b/binutils/strip.c deleted file mode 100755 index 156b3eb211..0000000000 --- a/binutils/strip.c +++ /dev/null @@ -1,362 +0,0 @@ -/* strip.c -- strip certain symbols from a rel file. - Copyright (C) 1986, 1990, 1991 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, 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. */ - -/* BUGS: When there's not enough memory, this should do the copy - in pieces rather than just fail as it does now */ - -#include "bfd.h" -#include "sysdep.h" -#include "getopt.h" -#include - -/* Various program options */ - -int show_version = 0; - -/* Which symbols to remove. */ -enum strip_action { - strip_undef, - strip_all, /* strip all symbols */ - strip_debug, /* strip all debugger symbols */ -} strip_symbols; - -/* Which local symbols to remove. */ -enum { - locals_undef, - locals_start_L, /* discard locals starting with L */ - locals_all, /* discard all locals */ -} discard_locals; - -extern char *mktemp(); - -/* IMPORTS */ -extern char *program_version; -extern char *program_name; -extern char *target; -extern char *xmalloc(); - -PROTO(static boolean, strip_file, (char *filetostrip)); -PROTO(static void, copy_sections, (bfd *ibfd, sec_ptr isection, bfd *obfd)); -PROTO(static void, setup_sections, (bfd *ibfd, sec_ptr isection, bfd *obfd)); - -/** main, etc */ - -static void -usage () -{ - fprintf (stderr, "strip %s\nUsage: %s [-gsxSX] files ...\n", - program_version, program_name); - exit (1); -} - -struct option long_options[] = {{"strip-all", 0, 0, 's'}, - {"strip-debug", 0, 0, 'S'}, - {"discard-all", 0, 0, 'x'}, - {"discard-locals", 0, 0, 'X'}, - {0, 0, 0, 0} - }; - -int -main (argc, argv) - char **argv; - int argc; -{ - int ind; - int c; - program_name = argv[0]; - - bfd_init(); - - strip_symbols = strip_undef; /* default is to strip everything. */ - discard_locals = locals_undef; - - while ((c = getopt_long (argc, argv, "gsST:xX", long_options, &ind)) != EOF) { - switch (c) { - case 0: - break; - case 's': - strip_symbols = strip_all; - break; - case 'g': - case 'S': - strip_symbols = strip_debug; - break; - case 'T': - target = optarg; - break; - case 'x': - discard_locals = locals_all; - break; - case 'X': - discard_locals = locals_start_L; - break; - default: - usage (); - } - } - - /* Default is to strip all symbols: */ - if (strip_symbols == strip_undef && discard_locals == locals_undef) { - strip_symbols = strip_all; - } - - /* OK, all options now parsed. If no filename specified, do a.out. */ - if (optind == argc) return !strip_file ("a.out"); - - /* We were given several filenames to do: */ - while (optind < argc) - if (!strip_file (argv[optind++])) return 1; - - return 0; -} - -/** Hack signals */ - -/* Why does strip need to do this, and anyway, if it does shouldn't this be - handled by bfd? */ - -static int delayed_signal; - -static int sigint_handled = 0; -static int sighup_handled = 0; -static int sigterm_handled = 0; - -void -delay_signal (signo) - int signo; -{ - delayed_signal = signo; - signal (signo, delay_signal); -} - -/* Effectively defer handling of asynchronous kill signals. */ -void -handle_sigs () /* puff puff */ -{ - delayed_signal = 0; - - if (signal (SIGINT, SIG_IGN) != SIG_IGN) { - sigint_handled = 1; - signal (SIGINT, delay_signal); - } - - if (signal (SIGHUP, SIG_IGN) != SIG_IGN) { - sighup_handled = 1; - signal (SIGHUP, delay_signal); - } - - if (signal (SIGTERM, SIG_IGN) != SIG_IGN) { - sigterm_handled = 1; - signal (SIGTERM, delay_signal); - } - - return; -} - -/* Effectively undefer handling. */ -void -unhandle_sigs () /* put them down */ -{ - if (sigint_handled) signal (SIGINT, SIG_DFL); - - if (sighup_handled) signal (SIGHUP, SIG_DFL); - - if (sigterm_handled) signal (SIGTERM, SIG_DFL); - - /* Handle any signal that came in while they were deferred. */ - if (delayed_signal) - kill (getpid (), delayed_signal); - - return; -} - - -static boolean -strip_file (filetostrip) - char *filetostrip; -{ - static char template[] = "stXXXXXX"; - char *slash; - char *tmpname; - bfd *ibfd; - bfd *obfd; - - ibfd = bfd_openr (filetostrip, target); - - if (ibfd == NULL) bfd_fatal (filetostrip); - - handle_sigs (); /* light up */ - - if (!bfd_check_format (ibfd, bfd_object)) { - fprintf (stderr, "Can't strip %s file %s.\n", - bfd_format_string (bfd_get_format (ibfd)), filetostrip); - exit (1); - } - - slash = strrchr( filetostrip, '/' ); - if ( slash ){ - *slash = 0; - tmpname = xmalloc( strlen(filetostrip) + sizeof(template) + 1 ); - strcpy( tmpname, filetostrip ); - strcat( tmpname, "/" ); - strcat( tmpname, template ); - mktemp( tmpname ); - *slash = '/'; - } else { - tmpname = xmalloc( sizeof(template) ); - strcpy( tmpname, template ); - mktemp( tmpname ); - } - - obfd = bfd_openw (mktemp(tmpname), (target ? target : bfd_get_target (ibfd))); - if (obfd == NULL) bfd_fatal (tmpname); - - if (!bfd_set_format (obfd, bfd_get_format (ibfd))) - bfd_fatal (tmpname); - - - if ((bfd_set_start_address (obfd, bfd_get_start_address (ibfd)) == false) || - (bfd_set_file_flags (obfd, (bfd_get_file_flags (ibfd) & - ~(HAS_LINENO | HAS_DEBUG | HAS_SYMS | - HAS_LOCALS))) == false) || - bfd_set_start_address (obfd, bfd_get_start_address (ibfd)) == false) - bfd_fatal (bfd_get_filename (ibfd)); - - /* Copy architecture of input file to output file */ - if (!bfd_set_arch_mach (obfd, bfd_get_architecture (ibfd), - bfd_get_machine (ibfd))) { - fprintf(stderr, "Output file cannot represent architecture %s", - bfd_printable_arch_mach (bfd_get_architecture(ibfd), - bfd_get_machine (ibfd))); - } - - - /* bfd mandates that all output sections be created and sizes set before - any output is done. Thus, we traverse all sections twice. */ - bfd_map_over_sections (ibfd, setup_sections, (void *)obfd); - bfd_map_over_sections (ibfd, copy_sections, (void *)obfd); - - if (!bfd_close (obfd)) bfd_fatal (filetostrip); - if (!bfd_close (ibfd)) bfd_fatal (filetostrip); - - rename(tmpname, filetostrip); - free(tmpname); - - unhandle_sigs(); - - return true; -} - -/** Actually do the work */ -static void -setup_sections (ibfd, isection, obfd) - bfd *ibfd; - sec_ptr isection; - bfd *obfd; -{ - sec_ptr osection; - char *err; - - osection = bfd_make_section (obfd, bfd_section_name (ibfd, isection)); - if (osection == NULL) { - err = "making"; - goto loser; - } - - if (!bfd_set_section_size(obfd, osection, bfd_section_size(ibfd, isection))) { - err = "size"; - goto loser; - } - - if (!bfd_set_section_vma (obfd, osection, bfd_section_vma (ibfd, isection))) { - err = "vma"; - goto loser; - } - - if (bfd_set_section_alignment (obfd, osection, - bfd_section_alignment (ibfd, isection)) - != true) { - err = "alignment"; - goto loser; - } /* on error, I presume. */ - - if (!bfd_set_section_flags (obfd, osection, - bfd_get_section_flags (ibfd, isection))) { - err = "flags"; - goto loser; - } - - /* All went well */ - return; - - loser: - fprintf (stderr, "%s: file \"%s\", section \"%s\": error in %s: %s\n", - program_name, - bfd_get_filename (ibfd), bfd_section_name (ibfd, isection), - err, bfd_errmsg (bfd_error)); - exit (1); -} - -static void -copy_sections (ibfd, isection, obfd) - bfd *ibfd; - sec_ptr isection; - bfd *obfd; -{ - static unsigned char *memhunk = NULL; - static unsigned memhunksize = 0; - - sec_ptr osection; - unsigned long size; - flagword iflg; - unsigned char *temp; - - osection = bfd_get_section_by_name (obfd, bfd_section_name (ibfd, isection)); - - size = bfd_section_size (ibfd, isection); - iflg = bfd_get_section_flags (ibfd, isection); - - /* either: - we don't need any memory because there's nothing in this section, - we had no memory so we got some, - we had some memory but not enough so we got more, - or we fail to allocat. */ - - if (size == 0) - return; - - if ((iflg & SEC_HAS_CONTENTS) == 0) - return; - - if (memhunk == NULL) { - memhunk = (unsigned char *) xmalloc (size); - memhunksize = size; - } - - if (size > memhunksize) { - temp = (unsigned char *) xrealloc ((char *) memhunk, size); - memhunksize = size; - memhunk = temp; - } - - /* now we have enough memory, just do it: */ - if (!bfd_get_section_contents (ibfd, isection, memhunk, 0, size)) - bfd_fatal (bfd_get_filename (ibfd)); - - if (!bfd_set_section_contents (obfd, osection, memhunk, 0, size)) - bfd_fatal (bfd_get_filename (obfd)); -} diff --git a/config/mh-solaris2 b/config/mh-solaris2 deleted file mode 100755 index 4bf0246606..0000000000 --- a/config/mh-solaris2 +++ /dev/null @@ -1,5 +0,0 @@ -# Makefile changes for Suns running Solaris 2 - -SYSV = -DSYSV -RANLIB = echo >/dev/null -INSTALL = cp diff --git a/config/mh-svr4 b/config/mh-svr4 deleted file mode 100755 index 0208c2dc1a..0000000000 --- a/config/mh-svr4 +++ /dev/null @@ -1,6 +0,0 @@ -# Define SYSV as -DSYSV if you are using a System V operating system. -SYSV = -DSYSV -DSVR4 -RANLIB = echo >/dev/null - -# The l flag generates a warning from the SVR4 archiver, remove it. -AR_FLAGS = cq diff --git a/config/mt-OSE68000 b/config/mt-OSE68000 deleted file mode 100755 index aa125affb2..0000000000 --- a/config/mt-OSE68000 +++ /dev/null @@ -1,2 +0,0 @@ -ALL= all.cross -INSTALL_TARGET= install.cross diff --git a/config/mt-OSE68k b/config/mt-OSE68k deleted file mode 100755 index aa125affb2..0000000000 --- a/config/mt-OSE68k +++ /dev/null @@ -1,2 +0,0 @@ -ALL= all.cross -INSTALL_TARGET= install.cross diff --git a/gas/GNUmakefile-host b/gas/GNUmakefile-host deleted file mode 100755 index 386c869b3a..0000000000 --- a/gas/GNUmakefile-host +++ /dev/null @@ -1,6 +0,0 @@ -ALL := $(shell ls -d =*) - -%: - $(foreach subdir,$(ALL),$(MAKE) -C $(subdir) $@ &&) true - -gas: diff --git a/gas/Makefile-intel b/gas/Makefile-intel deleted file mode 100755 index 54487c217d..0000000000 --- a/gas/Makefile-intel +++ /dev/null @@ -1,146 +0,0 @@ -#----------------------------------------------------------------------------- -# Makefile for gas960 -# -# $Id$ -#----------------------------------------------------------------------------- - -# The following two lines should be uncommented for system V (i386v). -#__i386v__#USG = -DUSG -#__i386v__#LIBS = -lmalloc -lPW - -# The following two lines should be uncommented for HP-UX -#__hp9000__#USG = -DUSG - -# The following line should be uncommented for Macintosh A/UX. -#__mac-aux__#USG = -DUSG - -#Always build with static libraries on Sun systems -#__sun3__#LDFLAGS = -Bstatic -#__sun386i__#LDFLAGS = -Bstatic -#__sun4__#LDFLAGS = -Bstatic - -# Essential under System V, harmless elsewhere -SHELL = /bin/sh - -TARG = gas960 -OPT = -g -IPATH = ../../include -CFLAGS = ${OPT} ${USG} -DI80960 -I${IPATH} - - -OBJS = app.o append.o as.o atof-generic.o bignum-copy.o expr.o \ - flonum-const.o flonum-copy.o flonum-mult.o frags.o gdb-blocks.o \ - gdb-file.o gdb-lines.o gdb-symbols.o gdb.o hash.o hex-value.o \ - input-file.o input-scrub.o messages.o obstack.o output-file.o read.o \ - strstr.o subsegs.o symbols.o version.o write.o xmalloc.o xrealloc.o - -# Note that we use the 386 floating-point support for the i80960 -I960OBJ = i960.o i960-opcode.o atof-i386.o - -gas960: ${OBJS} ${I960OBJ} VERSION - make ver960.o - ${CC} -o gas960 ${LDFLAGS} ${OBJS} ${I960OBJ} ver960.o ${LIBS} - -hash.o: hash.c - ${CC} -c ${CFLAGS} -Derror=as_fatal hash.c - -xmalloc.o: xmalloc.c - ${CC} -c ${CFLAGS} -Derror=as_fatal xmalloc.c - -xrealloc.o: xrealloc.c - ${CC} -c ${CFLAGS} -Derror=as_fatal xrealloc.c - -app.o: as.h - -as.o: ${IPATH}/b.out.h as.h read.h struc-symbol.h write.h -atof-generic.o: flonum.h -bignum-copy.o: bignum.h -expr.o: ${IPATH}/b.out.h as.h expr.h flonum.h obstack.h read.h -expr.o: struc-symbol.h symbols.h -flonum-const.o: flonum.h -flonum-copy.o: flonum.h -flonum-mult.o: flonum.h -flonum-normal.o:flonum.h -flonum-print.o: flonum.h -frags.o: ${IPATH}/b.out.h as.h frags.h obstack.h struc-symbol.h subsegs.h -gdb.o: as.h -gdb-blocks.o: as.h -gdb-lines.o: as.h frags.h obstack.h -gdb-symbols.o: ${IPATH}/b.out.h as.h struc-symbol.h -hash.o: hash.h -i960.o: as.h ${IPATH}/b.out.h expr.h flonum.h frags.h hash.h -i960.o: i960-opcode.h md.h obstack.h struc-symbol.h write.h -i960-opcode.o: i960-opcode.h -input-file.o: input-file.h -input-scrub.o: as.h input-file.h read.h -messages.o: as.h -obstack.o: obstack.h -read.o: ${IPATH}/b.out.h as.h expr.h flonum.h frags.h hash.h md.h -read.o: obstack.h read.h struc-symbol.h symbols.h -subsegs.o: ${IPATH}/b.out.h as.h frags.h obstack.h struc-symbol.h subsegs.h -subsegs.o: write.h -symbols.o: ${IPATH}/b.out.h as.h frags.h hash.h obstack.h struc-symbol.h -symbols.o: symbols.h -write.o: ${IPATH}/b.out.h as.h md.h obstack.h struc-symbol.h subsegs.h -write.o: symbols.h write.h - -flonum.h: bignum.h - -#----------------------------------------------------------------------------- -# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT -# -# 'VERSION' file must be present and contain a string of the form "x.y" -#----------------------------------------------------------------------------- - -ver960.c: FORCE - rm -f ver960.c - echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c - - -# This target should be invoked before building a new release. -# 'VERSION' file must be present and contain a string of the form "x.y" -# -roll: - @V=`cat VERSION` ; \ - MAJ=`sed 's/\..*//' VERSION` ; \ - MIN=`sed 's/.*\.//' VERSION` ; \ - V=$$MAJ.`expr $$MIN + 1` ; \ - rm -f VERSION ; \ - echo $$V >VERSION ; \ - echo Version $$V - -# Dummy target to force execution of dependent targets. -# -FORCE: - -# 'G960BASE' will be defined at invocation -install: - make ${TARG} OPT=-O - strip ${TARG} - rm -f ${G960BASE}/bin/${TARG} - mv ${TARG} ${G960BASE}/bin/${TARG} - -clean: - rm -f ${TARG} *.o core - -# Target to uncomment host-specific lines in this makefile. Such lines must -# have the following string beginning in column 1: #____# -# Original Makefile is backed up as 'Makefile.old'. -# -# Invoke with: make make HOST=xxx -# -make: - -@if test $(HOST)x = x ; then \ - echo 'Specify "make make HOST=???"'; \ - exit 1; \ - fi ; \ - grep -s "^#The next line was generated by 'make make'" Makefile; \ - if test $$? = 0 ; then \ - echo "Makefile has already been processed with 'make make'";\ - exit 1; \ - fi ; \ - mv -f Makefile Makefile.old; \ - echo "#The next line was generated by 'make make'" >Makefile ; \ - echo "HOST=$(HOST)" >>Makefile ; \ - echo >>Makefile ; \ - sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile diff --git a/gas/Makefile.generic b/gas/Makefile.generic deleted file mode 100755 index 1bf57a3266..0000000000 --- a/gas/Makefile.generic +++ /dev/null @@ -1,586 +0,0 @@ -host = generic -target = generic -# Makefile for GNU Assembler -# Copyright (C) 1987, 1988, 1990, 1991 Free Software Foundation, Inc. - -#This file is part of GNU GAS. - -#GNU GAS is free software; you can 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. - -#GNU GAS is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. - -#You should have received a copy of the GNU General Public License -#along with GNU GAS; see the file COPYING. If not, write to -#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -# $Id$ - -# The targets for external use include: -# all, doc, proto, install, uninstall, includes, TAGS, -# clean, cleanconfig, realclean, stage1, stage2, stage3, stage4. - -# Variables that exist for you to override. -# See below for how to change them for certain systems. - -ALLOCA = -CFLAGS = -g $(XCFLAGS) # -I$(srcdir)/../include -INTERNAL_CFLAGS = $(CROSS) -OLDCC = cc -BISON = bison -BISONFLAGS = -v -AR = ar -OLDAR_FLAGS = qc -AR_FLAGS = rc -SHELL = /bin/sh -# on sysV, define this as cp. -INSTALL = install -c -# These permit overriding just for certain files. -INSTALL_PROGRAM = $(INSTALL) -INSTALL_FILE = $(INSTALL) - -# Define this as & to perform parallel make on a Sequent. -# Note that this has some bugs, and it seems currently necessary -# to compile all the gen* files first by hand to avoid erroneous results. -P = - -# How to invoke ranlib. -RANLIB = ranlib -# Test to use to see whether ranlib exists on the system. -RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ] - -# CFLAGS for use with OLDCC, for compiling gnulib. -# NOTE: -O does not work on some Unix systems! -CCLIBFLAGS = -O - -# Version of ar to use when compiling gnulib. -OLDAR = ar - -version=`./gcc -dumpversion` - -# Directory where sources are, from where we are. -srcdir = . -# Common prefix for installation directories. -# NOTE: This directory must exist when you start installation. -prefix = /usr/local -# Directory in which to put the executable for the command `gcc' -bindir = $(prefix)/bin -# Directory in which to put the directories used by the compiler. -libdir = $(prefix)/lib -# Directory in which the compiler finds executables, libraries, etc. -libsubdir = $(libdir)/gcc/$(target)/$(version) -# Number to put in man-page filename. -manext = 1 -# Directory in which to put man pages. -mandir = $(prefix)/man/man$(manext) - -# Additional system libraries to link with. -CLIB= - -# Change this to a null string if obstacks are installed in the -# system library. -OBSTACK=obstack.o - -# Specify the rule for actually making gnulib. -GNULIB = gnulib.portable - -# Specify the rule for actually making gnulib2. -GNULIB2 = gnulib2.portable - -# List of extra C and assembler files to add to gnulib. -# Assembler files should have names ending in `.asm'. -LIBFUNCS_EXTRA = - -# Program to convert libraries. -LIBCONVERT = - -# Control whether header files are installed. -INSTALL_HEADERS=install-headers - -# Change this to empty to prevent installing limits.h -LIMITS_H = limits.h - -# Directory to link to, when using the target `maketest'. -DIR = ../gcc - -# For better debugging under COFF, define SEPARATE_AUX_OUTPUT in config.h -# and define the following variable as `aux-output2.c' in make-... -AUX_OUTPUT2 = - -# Flags to use when cross-building GCC. -# Prefix to apply to names of object files when using them -# to run on the machine we are compiling on. -HOST_PREFIX= -# Prefix to apply to names of object files when compiling them -# to run on the machine we are compiling on. -# The default for this variable is chosen to keep these rules -# out of the way of the other rules for compiling the same source files. -HOST_PREFIX_1=loser- -HOST_CC=$(CC) -HOST_CFLAGS=$(ALL_CFLAGS) -HOST_LDFLAGS=$(LDFLAGS) -HOST_CPPFLAGS=$(CPPFLAGS) - -# Choose the real default target. -ALL=bootstrap - -# End of variables for you to override. - -# Lists of files for various purposes. - -REAL_SOURCES = \ - $(srcdir)/app.c \ - $(srcdir)/as.c \ - $(srcdir)/atof-generic.c \ - $(srcdir)/bignum-copy.c \ - $(srcdir)/cond.c \ - $(srcdir)/expr.c \ - $(srcdir)/flonum-const.c \ - $(srcdir)/flonum-copy.c \ - $(srcdir)/flonum-mult.c \ - $(srcdir)/frags.c \ - $(srcdir)/hash.c \ - $(srcdir)/hex-value.c \ - $(srcdir)/input-file.c \ - $(srcdir)/input-scrub.c \ - $(srcdir)/messages.c \ - $(srcdir)/output-file.c \ - $(srcdir)/read.c \ - $(srcdir)/strstr.c \ - $(srcdir)/subsegs.c \ - $(srcdir)/symbols.c \ - $(srcdir)/version.c \ - $(srcdir)/write.c \ - $(srcdir)/xmalloc.c \ - $(srcdir)/xrealloc.c - -# in an expedient order -LINKED_SOURCES = \ - targ-cpu.c \ - obj-format.c \ - atof-targ.c - -SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES) - -REAL_HEADERS = \ - $(srcdir)/as.h \ - $(srcdir)/bignum.h \ - $(srcdir)/expr.h \ - $(srcdir)/flonum.h \ - $(srcdir)/frags.h \ - $(srcdir)/hash.h \ - $(srcdir)/input-file.h \ - $(srcdir)/tc.h \ - $(srcdir)/obj.h \ - $(srcdir)/read.h \ - $(srcdir)/reloc.h \ - $(srcdir)/struc-symbol.h \ - $(srcdir)/subsegs.h \ - $(srcdir)/symbols.h \ - $(srcdir)/syscalls.h \ - $(srcdir)/write.h - -LINKED_HEADERS = \ - a.out.gnu.h \ - a.out.h \ - host.h \ - targ-env.h \ - targ-cpu.h \ - obj-format.h \ - atof-targ.h - -HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS) - -OBJS = \ - targ-cpu.o \ - obj-format.o \ - atof-targ.o \ - app.o \ - as.o \ - atof-generic.o \ - bignum-copy.o \ - cond.o \ - expr.o \ - flonum-const.o \ - flonum-copy.o \ - flonum-mult.o \ - frags.o \ - hash.o \ - hex-value.o \ - input-file.o \ - input-scrub.o \ - messages.o \ - output-file.o \ - read.o \ - strstr.o \ - subsegs.o \ - symbols.o \ - version.o \ - write.o \ - xmalloc.o \ - xrealloc.o - -# Definition of `all' is here so that new rules inserted by sed -# do not specify the default target. -# The real definition is under `all.internal'. - -all: $(ALL) - -# sed inserts variable overrides after the following line. -#### - -# Now figure out from those variables how to compile and link. - -# This is the variable actually used when we compile. -ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CFLAGS) - -# Even if ALLOCA is set, don't use it if compiling with GCC. -USE_ALLOCA= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${ALLOCA}; else true; fi` -USE_HOST_ALLOCA= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${HOST_PREFIX}${ALLOCA}; else true; fi` - -# Dependency on obstack, alloca, malloc or whatever library facilities -# are not installed in the system libraries. -# We don't use USE_ALLOCA because backquote expansion doesn't work in deps. -LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC) - -# Likewise, for use in the tools that must run on this machine -# even if we are cross-building GCC. -# We don't use USE_ALLOCA because backquote expansion doesn't work in deps. -HOST_LIBDEPS= $(HOST_PREFIX)$(OBSTACK) $(HOST_PREFIX)$(ALLOCA) $(HOST_PREFIX)$(MALLOC) - -# How to link with both our special library facilities -# and the system's installed libraries. -LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB) - -# Likewise, for use in the tools that must run on this machine -# even if we are cross-building GCC. -HOST_LIBS = $(HOST_PREFIX)$(OBSTACK) $(USE_HOST_ALLOCA) $(HOST_PREFIX)$(MALLOC) $(CLIB) - -# Specify the directories to be searched for header files. -# Both . and srcdir are used, in that order, -# so that tm.h and config.h will be found in the compilation -# subdirectory rather than in the source directory. -INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config - -# Always use -I$(srcdir)/config when compiling. -.c.o: - $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $< - -# This tells GNU make version 3 not to export all the variables -# defined in this file into the environment. -.NOEXPORT: - -# Files to be copied away after each stage in building. -STAGE_GCC=gcc -STAGESTUFF = *.o gas - -# The files that "belong" in CONFIG_H are deliberately omitted -# because having them there would not be useful in actual practice. -# All they would do is cause complete recompilation every time -# one of the machine description files is edited. -# That may or may not be what one wants to do. -# If it is, rm *.o is an easy way to do it. -# CONFIG_H = config.h tm.h -CONFIG_H = - -gas: $(OBJS) $(LIBDEPS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gas $(OBJS) $(LIBS) - -all.internal: native -# This is what is made with the host's compiler if making a cross assembler. -native: config.status gas - -config.status: - @echo You must configure gas. Look at the INSTALL file for details. - @false - -compilations: ${OBJS} - -# Compiling object files from source files. - -# Note that dependencies on obstack.h are not written -# because that file is not part of GAS. - -app.o : app.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -as.o : as.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -atof-generic.o : atof-generic.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -bignum-copy.o : bignum-copy.c as.h host.h \ - targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -cond.o : cond.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - obstack.h -debug.o : debug.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - subsegs.h -expr.o : expr.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - obstack.h -flonum-const.o : flonum-const.c flonum.h bignum.h -flonum-copy.o : flonum-copy.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -flonum-mult.o : flonum-mult.c flonum.h bignum.h -frags.o : frags.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - subsegs.h obstack.h -hash.o : hash.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -hex-value.o : hex-value.c -input-file.o : input-file.c as.h host.h \ - targ-env.h obj-format.h targ-cpu.h \ - struc-symbol.h reloc.h write.h flonum.h bignum.h expr.h \ - frags.h hash.h read.h symbols.h tc.h obj.h input-file.h -input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \ - as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - input-file.h -messages.o : messages.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -obstack.o : obstack.c obstack.h -output-file.o : output-file.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - output-file.h -read.o : read.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - obstack.h -strstr.o : strstr.c -subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - subsegs.h obstack.h -symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - obstack.h subsegs.h -version.o : version.c -write.o : write.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - subsegs.h obstack.h output-file.h -xmalloc.o : xmalloc.c -xrealloc.o : xrealloc.c -atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ - symbols.h tc.h obj.h -obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ - symbols.h tc.h obj.h obstack.h -targ-cpu.o : targ-cpu.c targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h reloc.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ - symbols.h tc.h obj.h obstack.h - -# Normally this target is not used; but it is used if you -# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c -# from the GNU Emacs distribution. -# Note some machines won't allow $(CC) without -S on this source file. -alloca.o: alloca.c - $(CC) $(ALL_CFLAGS) $(CPPFLAGS) -S `echo $(srcdir)/alloca.c | sed 's,^\./,,'` - as alloca.s -o alloca.o - -# Compile the libraries to be used by gen*. -# If we are not cross-building, gen* use the same .o's that cc1 will use, -# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict -# with the rules for rtl.o, alloca.o, etc. -$(HOST_PREFIX_1)alloca.o: alloca.c - rm -f $(HOST_PREFIX)alloca.c - cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c - $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c - -$(HOST_PREFIX_1)obstack.o: obstack.c - rm -f $(HOST_PREFIX)obstack.c - cp $(srcdir)/obstack.c $(HOST_PREFIX)obstack.c - $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c - -$(HOST_PREFIX_1)malloc.o: malloc.c - rm -f $(HOST_PREFIX)malloc.c - cp $(srcdir)/malloc.c $(HOST_PREFIX)malloc.c - $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c - -# Remake the info files. - -doc: $(srcdir)/gas.info - -$(srcdir)/gas.info: $(srcdir)/gas.texinfo - makeinfo `echo $(srcdir)/gas.texinfo | sed 's,^\./,,'` - - -# Deletion of files made during compilation. -# There are three levels of this: `clean', `cleanconfig' and `realclean'. -# `clean' deletes what you want to delete ordinarily to save space. -# This is most, but not all, of the files made by compilation. -# `cleanconfig' also deletes everything depending -# on the choice of config files. -# `realclean' also deletes everything that could be regenerated automatically. - -clean: - -rm -f $(STAGESTUFF) -# Delete the temporary source copies for cross compilation. - -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c - -rm -f $(HOST_PREFIX_1)obstack.c -# Delete the stamp files except stamp-gnulib2. - -rm -f core - -# Like clean but also delete the links made to configure gas. -cleanconfig: clean - -rm -f config.status Makefile host.h targ-env.h - -rm -f targ-cpu.h targ-cpu.c - -rm -f obj-format.h obj-format.c - -rm -f atof-targ.c - -# Get rid of every file that's generated from some other file (except INSTALL). -realclean: cleanconfig - -rm -f gas.aux gas.cps gas.fns gas.info gas.kys gas.pgs gas.tps gas.vrs - -rm -f TAGS - -rm -f gas.info* gas.?? gas.??s gas.log gas.toc gas.*aux - -rm -f *.dvi - -# Entry points `install', `includes' and `uninstall'. - -# Copy the files into directories where they will be run. -install: - $(INSTALL_PROGRAM) gas $(bindir)/as - -# Create the installation directory. -install-dir: - -mkdir $(libdir) - -mkdir $(libdir)/gcc - -mkdir $(libdir)/gcc/$(target) - -mkdir $(libdir)/gcc/$(target)/$(version) - -# Install the compiler executables built during cross compilation. -install-cross: native install-dir - -if [ -f cc1 ] ; then $(INSTALL_PROGRAM) cc1 $(libsubdir)/cc1; else true; fi - -if [ -f cc1plus ] ; then $(INSTALL_PROGRAM) cc1plus $(libsubdir)/cc1plus; else true; fi - $(INSTALL_PROGRAM) cpp $(libsubdir)/cpp - ./gcc -dumpspecs > $(libsubdir)/specs - $(INSTALL_PROGRAM) gcc $(bindir)/gcc - -# Install the man pages. -install-man: install-dir $(srcdir)/gcc.1 protoize.1 unprotoize.1 - $(INSTALL_FILE) $(srcdir)/gcc.1 $(mandir)/gcc.$(manext) - chmod a-x $(mandir)/gcc.$(manext) - $(INSTALL_FILE) $(srcdir)/protoize.1 $(mandir)/protoize.$(manext) - chmod a-x $(mandir)/protoize.$(manext) - $(INSTALL_FILE) $(srcdir)/unprotoize.1 $(mandir)/unprotoize.$(manext) - chmod a-x $(mandir)/unprotoize.$(manext) - -# Cancel installation by deleting the installed files. -uninstall: - -rm -rf $(libsubdir) - -rm -rf $(bindir)/gas - -rm -rf $(mandir)/gas.$(manext) - - -# These exist for maintenance purposes. - -tags TAGS: force - etags $(REAL_SOURCES) $(REAL_HEADERS) README Makefile config/*.[hc] - -bootstrap: gas force - $(MAKE) stage1 - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas - $(MAKE) stage2 - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas - for i in *.o; do cmp $$i stage2/$$i; done - -bootstrap2: force - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas - $(MAKE) stage2 - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas - for i in *.o; do cmp $$i stage2/$$i; done - -bootstrap3: force - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas - for i in *.o; do cmp $$i stage2/$$i; done - -# Copy the object files from a particular stage into a subdirectory. -stage1: force - -mkdir stage1 - -mv $(STAGESTUFF) stage1 - -(cd stage1 ; ln -s gas as) - -stage2: force - -mkdir stage2 - -mv $(STAGESTUFF) stage2 - -(cd stage2 ; ln -s gas as) - - -stage3: force - -mkdir stage3 - -mv $(STAGESTUFF) $(STAGE_GCC) stage3 - -rm -f stage3/gnulib - -cp gnulib stage3 - -if $(RANLIB_TEST) ; then $(RANLIB) stage3/gnulib; else true; fi - -stage4: force - -mkdir stage4 - -mv $(STAGESTUFF) $(STAGE_GCC) stage4 - -rm -f stage4/gnulib - -cp gnulib stage4 - -if $(RANLIB_TEST) ; then $(RANLIB) stage4/gnulib; else true; fi - -# Copy just the executable files from a particular stage into a subdirectory, -# and delete the object files. Use this if you're just verifying a version -# that is pretty sure to work, and you are short of disk space. -risky-stage1: force - -mkdir stage1 - -mv cc1 cpp cccp gcc stage1 - -rm -f stage1/gnulib - -cp gnulib stage1 && $(RANLIB) stage1/gnulib - -make clean - -risky-stage2: force - -mkdir stage2 - -mv cc1 cpp cccp gcc stage2 - -rm -f stage2/gnulib - -cp gnulib stage2 && $(RANLIB) stage2/gnulib - -make clean - -risky-stage3: force - -mkdir stage3 - -mv cc1 cpp cccp gcc stage3 - -rm -f stage3/gnulib - -cp gnulib stage3 && $(RANLIB) stage3/gnulib - -make clean - -risky-stage4: force - -mkdir stage4 - -mv cc1 cpp cccp gcc stage4 - -rm -f stage4/gnulib - -cp gnulib stage4 && $(RANLIB) stage4/gnulib - -make clean - -#In GNU Make, ignore whether `stage*' exists. -.PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap -.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4 - -force: - -Makefile: $(srcdir)/Makefile.in $(srcdir)/configure - $(srcdir)/configure.was -srcdir=$(srcdir) -host=$(host) $(target) diff --git a/gas/Makefile.loic b/gas/Makefile.loic deleted file mode 100755 index 4de7da125c..0000000000 --- a/gas/Makefile.loic +++ /dev/null @@ -1,203 +0,0 @@ -# Makefile for GAS. -# Copyright (C) 1989, Free Software Foundation -# -# This file is part of GAS, the GNU Assembler. -# -# GAS is free software; you can 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. -# -# GAS is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GAS; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -BINDIR = /usr/local/bin - -BINARY = gas - -# -# Add these flags to XCFLAGS below for specific use. -# -# If you machine does not have vfprintf, but does have _doprnt(), -# -DNO_VARARGS -# -# If the return-type of a signal-hander is void (instead of int), -# -DSIGTY -# -# To include the mc68851 mmu coprocessor instructions in the 68020 assembler, -# -Dm68851 -# -# If you want the 80386 assembler to correctly handle fsub/fsubr and fdiv/fdivr -# opcodes (unlike most 80386 assemblers) -# -DNON_BROKEN_WORDS -# -XCFLAGS = - -# Your favorite compiler -CC = gcc - -# Uncomment the following lines if you use USG - -INCLUDE_DIRS = -I. -COFF_OBJECTS = stack.o -CPPFLAGS = -DUSG -CFLAGS = -g $(CPPFLAGS) $(XCFLAGS) -LDFLAGS = -#LOADLIBES = -lPW - -# Uncomment the following lines if you use BSD -#INCLUDE_DIRS = -I. -#CPPFLAGS = -#CFLAGS = -g $(CPPFLAGS) $(XCFLAGS) -#LDFLAGS = -#LOADLIBES = - -CONFIG_FILES = \ - machine.c machine.h atof.c obj-format.c obj-format.h opcode.h - -OBJECTS = \ - as.o xrealloc.o xmalloc.o hash.o hex-value.o \ - atof-generic.o append.o messages.o expr.o app.o \ - frags.o input-file.o input-scrub.o output-file.o \ - subsegs.o symbols.o version.o flonum-const.o flonum-copy.o \ - flonum-mult.o strstr.o bignum-copy.o obstack.o write.o read.o \ - obj-format.o machine.o atof.o $(COFF_OBJECTS) - -SOURCES = $(OBJECTS:.o=.c) - -all : $(BINARY) - -install : all - cp $(BINARY) $(BINDIR) - -clean : - rm -f $(OBJECTS) - -clobber : clean - rm -f $(BINARY) $(CONFIG_FILES) dependencies TAGS m68k.h - -$(BINARY) : $(OBJECTS) - $(CC) -o $(BINARY) $(LDFLAGS) $(OBJECTS) $(LOADLIBES) - -TAGS : $(SOURCES) - etags $(SOURCES) *.h - -CXREF : $(SOURCES) - cxref -c $(INCLUDE_DIRS) $(SOURCES) - -stack.o: stack.c - $(CC) $(CFLAGS) -c stack.c - -atof.o: \ - flonum.h \ - bignum.h -obj-format.o: \ - as.h \ - md.h \ - aout.h \ - a.out.gnu.h \ - struc-symbol.h \ - write.h \ - append.h -read.o: \ - obj-format.h \ - a.out.gnu.h \ - as.h \ - read.h \ - md.h \ - hash.h \ - obstack.h \ - frags.h \ - flonum.h \ - bignum.h \ - struc-symbol.h \ - expr.h \ - symbols.h \ - sparc.h -write.o: \ - obj-format.h \ - a.out.gnu.h \ - as.h \ - md.h \ - subsegs.h \ - obstack.h \ - struc-symbol.h \ - write.h \ - symbols.h \ - append.h \ - sparc.h -obstack.o: \ - obstack.h -bignum-copy.o: \ - bignum.h -flonum-mult.o: \ - flonum.h \ - bignum.h -flonum-copy.o: \ - flonum.h \ - bignum.h -flonum-const.o: \ - flonum.h \ - bignum.h -symbols.o: \ - obj-format.h \ - a.out.gnu.h \ - as.h \ - hash.h \ - obstack.h \ - struc-symbol.h \ - symbols.h \ - frags.h -subsegs.o: \ - obj-format.h \ - a.out.gnu.h \ - as.h \ - subsegs.h \ - obstack.h \ - frags.h \ - struc-symbol.h \ - write.h -input-scrub.o: \ - as.h \ - read.h \ - input-file.h -input-file.o: \ - input-file.h -frags.o: \ - obj-format.h \ - a.out.gnu.h \ - as.h \ - subsegs.h \ - obstack.h \ - frags.h \ - struc-symbol.h -expr.o: \ - obj-format.h \ - a.out.gnu.h \ - as.h \ - flonum.h \ - bignum.h \ - read.h \ - struc-symbol.h \ - expr.h \ - obstack.h \ - symbols.h -messages.o: \ - as.h -atof-generic.o: \ - flonum.h \ - bignum.h -hash.o: \ - hash.h -as.o: \ - obj-format.h \ - a.out.gnu.h \ - as.h \ - struc-symbol.h \ - write.h diff --git a/gas/VERSION b/gas/VERSION deleted file mode 100755 index 5625e59da8..0000000000 --- a/gas/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.2 diff --git a/gas/a.out.gnu.h b/gas/a.out.gnu.h deleted file mode 100755 index fe777f9acb..0000000000 --- a/gas/a.out.gnu.h +++ /dev/null @@ -1,351 +0,0 @@ -/* This file is a.out.gnu.h - - Copyright (C) 1987-1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef __A_OUT_GNU_H__ -#define __A_OUT_GNU_H__ - -#include "aout/reloc.h" - -#define __GNU_EXEC_MACROS__ - -#ifndef __STRUCT_EXEC_OVERRIDE__ - -/* This is the layout on disk of a Unix V7, Berkeley, SunOS, Vax Ultrix - "struct exec". Don't assume that on this machine, the "struct exec" - will lay out the same sizes or alignments. */ - -struct exec_bytes { - unsigned char a_info[4]; - unsigned char a_text[4]; - unsigned char a_data[4]; - unsigned char a_bss[4]; - unsigned char a_syms[4]; - unsigned char a_entry[4]; - unsigned char a_trsize[4]; - unsigned char a_drsize[4]; -}; - -/* How big the "struct exec" is on disk */ -#define EXEC_BYTES_SIZE (8 * 4) - -/* This is the layout in memory of a "struct exec" while we process it. */ - -struct exec -{ - unsigned long a_info; /* Use macros N_MAGIC, etc for access */ - unsigned a_text; /* length of text, in bytes */ - unsigned a_data; /* length of data, in bytes */ - unsigned a_bss; /* length of uninitialized data area for file, in bytes */ - unsigned a_syms; /* length of symbol table data in file, in bytes */ - unsigned a_entry; /* start address */ - unsigned a_trsize; /* length of relocation info for text, in bytes */ - unsigned a_drsize; /* length of relocation info for data, in bytes */ -}; - -#endif /* __STRUCT_EXEC_OVERRIDE__ */ - -/* these go in the N_MACHTYPE field */ -/* These symbols could be defined by code from Suns...punt 'em */ -#undef M_UNKNOWN -#undef M_68010 -#undef M_68020 -#undef M_SPARC -enum machine_type { - M_UNKNOWN = 0, - M_68010 = 1, - M_68020 = 2, - M_SPARC = 3, - /* skip a bunch so we don't run into any of sun's numbers */ - M_386 = 100, - M_29K = 101, - M_RS6000 = 102, /* IBM RS/6000 */ - /* HP/BSD formats */ - M_HP200 = 200, /* hp200 (68010) BSD binary */ - M_HP300 = 300, /* hp300 (68020+68881) BSD binary */ - M_HPUX23 = 0x020C, /* hp200/300 HPUX binary */ -}; - -#define N_MAGIC(exec) ((exec).a_info & 0xffff) -#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) -#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) -#define N_SET_INFO(exec, magic, type, flags) \ - ((exec).a_info = ((magic) & 0xffff) \ - | (((int)(type) & 0xff) << 16) \ - | (((flags) & 0xff) << 24)) -#define N_SET_MAGIC(exec, magic) \ - ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff))) - -#define N_SET_MACHTYPE(exec, machtype) \ - ((exec).a_info = \ - ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) - -#define N_SET_FLAGS(exec, flags) \ - ((exec).a_info = \ - ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) - -/* Code indicating object file or impure executable. */ -#define OMAGIC 0407 -/* Code indicating pure executable. */ -#define NMAGIC 0410 -/* Code indicating demand-paged executable. */ -#define ZMAGIC 0413 - -/* Virtual Address of text segment from the a.out file. For OMAGIC, - (almost always "unlinked .o's" these days), should be zero. - For linked files, should reflect reality if we know it. */ - -#ifndef N_TXTADDR -#define N_TXTADDR(x) (N_MAGIC(x)==OMAGIC? 0 : TEXT_START_ADDR) -#endif - -#ifndef N_BADMAG -#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \ - && N_MAGIC(x) != NMAGIC \ - && N_MAGIC(x) != ZMAGIC) -#endif - -/* By default, segment size is constant. But on some machines, it can - be a function of the a.out header (e.g. machine type). */ -#ifndef N_SEGSIZE -#define N_SEGSIZE(x) SEGMENT_SIZE -#endif - - /* This complexity is for encapsulated COFF support */ -#ifndef _N_HDROFF -#define _N_HDROFF(x) (N_SEGSIZE(x) - sizeof (struct exec)) -#endif - -#ifndef N_TXTOFF -#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? \ - _N_HDROFF((x)) + sizeof (struct exec) : \ - sizeof (struct exec)) -#endif - - -#ifndef N_DATOFF -#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text ) -#endif - -#ifndef N_TRELOFF -#define N_TRELOFF(x) ( N_DATOFF(x) + (x).a_data ) -#endif - -#ifndef N_DRELOFF -#define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize ) -#endif - -#ifndef N_SYMOFF -#define N_SYMOFF(x) ( N_DRELOFF(x) + (x).a_drsize ) -#endif - -#ifndef N_STROFF -#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms ) -#endif - -/* Address of text segment in memory after it is loaded. */ -#ifndef N_TXTADDR -#define N_TXTADDR(x) 0 -#endif - -#ifndef N_DATADDR -#define N_DATADDR(x) \ - (N_MAGIC(x)==OMAGIC? (N_TXTADDR(x)+(x).a_text) \ - : (N_SEGSIZE(x) + ((N_TXTADDR(x)+(x).a_text-1) & ~(N_SEGSIZE(x)-1)))) -#endif - -/* Address of bss segment in memory after it is loaded. */ -#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) - -struct nlist { - union { - char *n_name; - struct nlist *n_next; - long n_strx; - } n_un; - unsigned char n_type; - char n_other; - short n_desc; - unsigned long n_value; -}; - -#define N_UNDF 0 -#define N_ABS 2 -#define N_TEXT 4 -#define N_DATA 6 -#define N_BSS 8 -#define N_COMM 0x12 /* common (visible in shared lib commons) */ -#define N_FN 0x1F /* File name of a .o file */ - -/* Note: N_EXT can only usefully be OR-ed with N_UNDF, N_ABS, N_TEXT, - N_DATA, or N_BSS. When the low-order bit of other types is set, - (e.g. N_WARNING versus N_FN), they are two different types. */ -#define N_EXT 1 -#define N_TYPE 036 -#define N_STAB 0340 - -/* The following type indicates the definition of a symbol as being - an indirect reference to another symbol. The other symbol - appears as an undefined reference, immediately following this symbol. - - Indirection is asymmetrical. The other symbol's value will be used - to satisfy requests for the indirect symbol, but not vice versa. - If the other symbol does not have a definition, libraries will - be searched to find a definition. */ - -#define N_INDR 0xa - -/* The following symbols refer to set elements. - All the N_SET[ATDB] symbols with the same name form one set. - Space is allocated for the set in the text section, and each set - element's value is stored into one word of the space. - The first word of the space is the length of the set (number of elements). - - The address of the set is made into an N_SETV symbol - whose name is the same as the name of the set. - This symbol acts like a N_DATA global symbol - in that it can satisfy undefined external references. */ - -/* These appear as input to LD, in a .o file. */ -#define N_SETA 0x14 /* Absolute set element symbol */ -#define N_SETT 0x16 /* Text set element symbol */ -#define N_SETD 0x18 /* Data set element symbol */ -#define N_SETB 0x1A /* Bss set element symbol */ - -/* This is output from LD. */ -#define N_SETV 0x1C /* Pointer to set vector in data area. */ - -/* Warning symbol. The text gives a warning message, the next symbol - in the table will be undefined. When the symbol is referenced, the - message is printed. */ - -#define N_WARNING 0x1e - -/* This structure describes a single relocation to be performed. - The text-relocation section of the file is a vector of these structures, - all of which apply to the text section. - Likewise, the data-relocation section applies to the data section. */ - -/* The following enum and struct were borrowed from SunOS's - /usr/include/sun4/a.out.h and extended to handle - other machines. It is currently used on SPARC and AMD 29000. - - reloc_ext_bytes is how it looks on disk. reloc_info_extended is - how we might process it on a native host. */ - -struct reloc_ext_bytes { - unsigned char r_address[4]; - unsigned char r_index[3]; - unsigned char r_bits[1]; - unsigned char r_addend[4]; -}; - -#define RELOC_EXT_BITS_EXTERN_BIG 0x80 -#define RELOC_EXT_BITS_EXTERN_LITTLE 0x01 - -#define RELOC_EXT_BITS_TYPE_BIG 0x1F -#define RELOC_EXT_BITS_TYPE_SH_BIG 0 -#define RELOC_EXT_BITS_TYPE_LITTLE 0xF8 -#define RELOC_EXT_BITS_TYPE_SH_LITTLE 3 - -#define RELOC_EXT_SIZE 12 /* Bytes per relocation entry */ - -struct reloc_info_extended -{ - unsigned long r_address; - unsigned int r_index:24; -# define r_symbolnum r_index - unsigned r_extern:1; - unsigned :2; - /* RS/6000 compiler does not support enum bitfield - enum reloc_type r_type:5; */ - enum reloc_type r_type; - long int r_addend; -}; - -/* The standard, old-fashioned, Berkeley compatible relocation struct */ - -struct reloc_std_bytes { - unsigned char r_address[4]; - unsigned char r_index[3]; - unsigned char r_bits[1]; -}; - -#define RELOC_STD_BITS_PCREL_BIG 0x80 -#define RELOC_STD_BITS_PCREL_LITTLE 0x01 - -#define RELOC_STD_BITS_LENGTH_BIG 0x60 -#define RELOC_STD_BITS_LENGTH_SH_BIG 5 /* To shift to units place */ -#define RELOC_STD_BITS_LENGTH_LITTLE 0x06 -#define RELOC_STD_BITS_LENGTH_SH_LITTLE 1 - -#define RELOC_STD_BITS_EXTERN_BIG 0x10 -#define RELOC_STD_BITS_EXTERN_LITTLE 0x08 - -#define RELOC_STD_BITS_BASEREL_BIG 0x08 -#define RELOC_STD_BITS_BASEREL_LITTLE 0x08 - -#define RELOC_STD_BITS_JMPTABLE_BIG 0x04 -#define RELOC_STD_BITS_JMPTABLE_LITTLE 0x04 - -#define RELOC_STD_BITS_RELATIVE_BIG 0x02 -#define RELOC_STD_BITS_RELATIVE_LITTLE 0x02 - -#define RELOC_STD_SIZE 8 /* Bytes per relocation entry */ - -#ifndef CUSTOM_RELOC_FORMAT -struct relocation_info -{ - /* Address (within segment) to be relocated. */ - int r_address; - /* The meaning of r_symbolnum depends on r_extern. */ - unsigned int r_symbolnum:24; - /* Nonzero means value is a pc-relative offset - and it should be relocated for changes in its own address - as well as for changes in the symbol or section specified. */ - unsigned int r_pcrel:1; - /* Length (as exponent of 2) of the field to be relocated. - Thus, a value of 2 indicates 1<<2 bytes. */ - unsigned int r_length:2; - /* 1 => relocate with value of symbol. - r_symbolnum is the index of the symbol - in file's the symbol table. - 0 => relocate with the address of a segment. - r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS - (the N_EXT bit may be set also, but signifies nothing). */ - unsigned int r_extern:1; - /* The next three bits are for SunOS shared libraries, and seem to - be undocumented. */ - unsigned int r_baserel:1; /* Linkage table relative */ - unsigned int r_jmptable:1; /* pc-relative to jump table */ - -#ifdef TC_NS32K -#define r_bsr r_baserel -#define r_disp r_jmptable -#endif /* TC_NS32K */ - - unsigned int r_relative:1; /* "relative relocation" */ - /* unused */ - unsigned int r_pad:1; /* Padding -- set to zero */ -}; -#endif /* CUSTOM_RELOC_FORMAT */ - -#endif /* __A_OUT_GNU_H__ */ - -/* end of a.out.gnu.h */ diff --git a/gas/config.sub b/gas/config.sub deleted file mode 100755 index dac9ab89d4..0000000000 --- a/gas/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/gas/config/ChangeLog b/gas/config/ChangeLog deleted file mode 100644 index f81fe411fe..0000000000 --- a/gas/config/ChangeLog +++ /dev/null @@ -1,289 +0,0 @@ -Mon Nov 23 11:50:00 1992 Ken Raeburn (raeburn@cygnus.com) - - * obj-coff.c (obj_coff_endef): Use as_warn, not fprintf. - - * tc-m68k.c (md_assemble): Don't complain about 68000 with 68881; - could be doing emulation. - -Tue Nov 10 09:50:25 1992 Ian Lance Taylor (ian@cygnus.com) - - * tc-m68k.c (m68k_reg_parse): If REGISTER_PREFIX isn't defined, - still accept (but don't require) OPTIONAL_REGISTER_PREFIX before - the register name. - (insert_reg): put REGISTER_PREFIX before register names before - putting them in the symbol table. - * tc-m68k.h (OPTIONAL_REGISTER_PREFIX): Define to be "%", if not - M68KCOFF. - - * obj-coffbfd.c (fill_section): set STYP_NOLOAD bit for .bss - section. - - * atof-ieee.c, atof-ns32k.c, tc-*.c: made EXP_CHARS, FLT_CHARS, - comment_chars, line_comment_chars and line_seperator_chars - consistently const, and always initialized them. Included read.h. - -Thu Nov 5 17:55:41 1992 Jim Wilson (wilson@sphagnum.cygnus.com) - - * tc-sparc.c (sparc_ip): Add code to flag error if an absolute - constant will not fit in an immediate field. - (md_apply_fix, RELOC_BASE13 case): Check for relocation overflow. - -Wed Nov 4 07:50:46 1992 Ken Raeburn (raeburn@cygnus.com) - - * obj-coff.c (callj_table): Delete global variable. - (obj_emit_relocations): Define it locally here, and only if - TC_I960 is defined. - - * tc-m68k.c (m68k_reg_parse): Underscore is part of a symbol name. - (m68k_ip): Don't warn about bignum used as float bit-pattern. - - * obj-coff.c: Replaced ANSI and non-ANSI function declarations - with a single set using PARAMS macro. - - * tc-i960.c (tc_bout_fix_to_chars): Bit-field fixups want a length - of 2. - - * tc-i960.c: Missed a couple of 0->NO_RELOC conversions. - - * tc-i960.h (N_BALNAME, N_CALLNAME): Define as char-type values, - so widening works consistently. - -Fri Oct 23 14:40:38 1992 Ian Lance Taylor (ian@cygnus.com) - - * obj-coffbfd.c (write_object_file): check return value of - bfd_close_all_done. - -Tue Oct 20 13:02:25 1992 Ian Lance Taylor (ian@cygnus.com) - - * Support for i386-sysv. - obj-coffbfd.c (do_relocs_for, write_object_file): set segment - addresses to reasonable sizes. New define ZERO_BASED_SEGMENTS can - be used to set them all to zero as was done before. - (fill_section): segment addresses now set in write_object_file. - (fill_section): Don't set STYP_NOLOAD for .bss section. - (fixup_segment): 386 uses strange common symbol format. - tc-i386.c (tc_coff_fix2rtype): use R_DIR32, not R_RELLONG, for - compatibility with SVR3.2 linker. - -Mon Oct 5 09:28:57 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - fix i960+non-bfd coff bit rot. - * obj-coff.c (c_dot_file_symbol, obj_coff_ln, obj_coff_line): - support for C source listings. (obj_coff_endef): look in the right - part of the symbol for the symbol name - - * tc-m68k.c (get_num): make it work for all segments, not just the - first three. - -Tue Sep 29 12:22:52 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * obj-coffbfd.c (write_object_file): don't fixup for the z8k - * tc-z8k.c: lots of bug fixes - -Tue Sep 29 10:51:55 1992 Ian Lance Taylor (ian@cygnus.com) - - * tc-i960.h, tc-i960.c: avoid the ANSI preprocessor addition - #elif, since it is not supported by old compilers. - ho-rs6000.h, tc-m68k.c: the native RS/6000 compiler miscompiles a - couple of expressions in tc-m68k.c. - -Mon Sep 28 21:16:51 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * tc-i960.c (get_cdisp): Use NO_RELOC, not 0, in call to fix_new. - -Fri Sep 25 18:18:52 1992 Ian Lance Taylor (ian@cygnus.com) - - * tc-m68k.h: if M68KCOFF, define DOT_LABEL_PREFIX (to require - local labels to start with a .) and set REGISTER_PREFIX to %. - tc-m68k.c (m68k_reg_parse): accept REGISTER_PREFIX if defined. - -Tue Sep 22 13:02:07 1992 Sean Eric Fagan (sef@cygnus.com) - - * obj-coffbfd.c (do_relocs_for,fill_section): now allocate all - sections starting from zero, rather than making them consecutive. - This makes subsequent reloc calculations easier, esp if the object - format doesn't understand addends. (obj_coff_lcomm): (maybe temporarily) - allocate lcomm in .data rather than in .bss. It seems that some - tools can't cope with a non-zero sized bss before linkage. - -Tue Sep 22 15:10:51 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * tc-m68k.c: Replace "enum m68k_architecture" with "int" - throughout. That enum no longer means what we thought it meant. - - * tc-m68k.c (md_assemble, md_parse_option): Handle new - "-mno-688[58]1" options. - - * tc-m68k.c: Added CPU32 support. - -Fri Sep 18 08:02:18 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * tc-m68k.c (m68k_ip): An(disp) is not pc relative. - -Sun Sep 13 20:29:39 1992 Ian Lance Taylor (ian@cygnus.com) - - * obj-coffbfd.h: define WARN_SIGNED_OVERFLOW_WORD. - obj-coffbfd.c (fixup_segment): check for signed .word overflow if - WARN_SIGNED_OVERFLOW_WORD. - - * obj-coffbfd.c (fixup_segment): fixed missing parens in - expression checking for byte or word overflow. - -Fri Sep 11 10:21:04 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - Support for i386 coff - * obj-coffbfd.h : added stuff - * tc-i386.c (tc_coff_fix2rtype): new function - * tc-i386.h : new coff defines - -Wed Sep 9 11:10:24 1992 Ian Lance Taylor (ian@cygnus.com) - - * tc-m68k.c (m68k_ip, m68k_ip_op, get_num, try_moto_index): merge - Motorola and MIT syntax; gas can now assemble either type of - file. - tc-m68kmote.c, tc-m68kmote.h: removed now superfluous files. - From Steve Chamberlain: - m68kcoff.mt: for m68k COFF. - obj-coffbfd.c: (fixup_mdeps) added - (size_section) removed bad sanity check - (fill_section) added rs_machine_dependent case - (write_object_file) call fixup_mdeps - (fixup_segment) set fx_subsy to 0. - obj-coffbfd.h: define WORKING_DOT_WORD (too hard to support) and - handle m68k. - tc-m68k.c, config/tc-m68k.h: added m68k COFF support and Motorala - pseudo ops. - -Fri Aug 28 16:25:22 1992 Ian Lance Taylor (ian@cygnus.com) - - * obj-bout.h, obj-bout.c (obj_header_append, obj_symbol_to_chars), - tc-i960.c (md_ri_to_chars): Always output bout object file in - little endian byte order (used to use endianness of host). - -Tue Aug 25 15:11:08 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * z8k.c, z8k.h, z8k.mt: z8000 support stuff - -Mon Aug 24 12:45:12 1992 Ian Lance Taylor (ian@cygnus.com) - - * tc-m68k.c: use TARGET_CPU to choose default cpu type. - - * te-generic.h: default to LOCAL_LABELS_DOLLAR and LOCAL_LABELS_FB - so that we can assemble hand-written libgcc code. - -Wed Aug 19 11:20:59 1992 Ian Lance Taylor (ian@cygnus.com) - - * tc-m68k.c, tc-m68kmote.c: the cas2 instruction is supposed to be - written with indirection on the last two operands, which can be - either data or address registers. Added a new operand type 'r' - which accepts either register type. Added '(' to notend stuff in - tc-m68kmote.c to accept (a0):(a2) in cas2 instruction. - -Tue Aug 11 12:58:14 1992 Ken Raeburn (raeburn@cygnus.com) - - * sparc.mt: New file. - -Mon Aug 10 14:37:08 1992 Per Bothner (bothner@cygnus.com) - - * tc-m68k.c: ".align N" means align to N-byte boundary *only* - if TN_SUN3; otherwise align to 2**N-byte bounary. - -Thu Aug 6 12:08:42 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * config/tc-h8300.c: if a :8 is seen after an operand, fill top - two bytes of any constant with 0xff: - -Wed Aug 5 01:54:34 1992 John Gilmore (gnu at cygnus.com) - - * tc-m68k.c (try_index): Error if index scaling specified and - assembling for an older CPU than a 68020. - -Mon Jul 6 17:09:32 1992 Steve Chamberlain (sac@cygnus.com) - - * obj-coffbfd.c (fill_section): mark .lit sections as STYP_LIT - -Tue Jun 9 07:50:46 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * tc-m68k.c (m68kip): Fix typo so that only arch's >=68020 do - pcrel data stuff. (md_estimate_size_before_relax): when relaxing a - 68010 bxx into a bra+6 jmpxx, put the bytes of the jmp opcode into - the right place. (s_bss): Don't put .bss stuff into SEG_DATA, put - it into SEG_BSS - -Thu May 28 11:20:27 1992 Jim Wilson (wilson@sphagnum.cygnus.com) - - * tc-sparc.c: Use new ARCHITECTURES_CONFLICT_P macro. Mention new - -Asparclite flag. - -Mon May 4 18:56:19 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * obj-coffbfd.c: use is a synonym for section, (do_relocs_for): - calc the base of relocs correctly. - * tc-a29k.c (parse_operand): allow expressions to be in any section. - -Thu Mar 12 04:42:38 1992 K. Richard Pixley (rich@cygnus.com) - - * tc-m68k.h, te-sun3.h: moved LOCAL_LABELS_FB definition from - tc-m68k.h to te-sun3.h. - -Wed Mar 11 23:34:46 1992 K. Richard Pixley (rich@cygnus.com) - - * te-sun3.h: add LOCAL_LABELS_DOLLAR. - -Fri Feb 21 06:22:15 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * obj-aout.c: do not include stab.gnu.h if NO_LISTING. - - * tc-i860.c, a.out.gnu.h: move i860 relocs to a proper place. - - * a.out.h: removed. - -Fri Feb 21 02:17:22 1992 Minh Tran-Le (TRANLE@INTELLICORP.COM) - - * tc-i386.c: tc-i386.c: added handling of the following opcodes: - i/o opcodes - inb, inw, outb and outw. string manipulation with - att syntax - scmp, slod, smov, ssca, ssto. - -Fri Feb 21 01:53:50 1992 Minh Tran-Le (TRANLE@INTELLICORP.COM) - - * obj-coff.c: (for aix386) Moved the symbols .text, .data and .bss - to just after .file . - - In obj_crawl_symbol_chain() where it tries to put the external - symbols apart, with the condition: - (!S_IS_DEFINED(symbolP) && - !S_IS_DEBUG(symbolP) && - !SF_GET_STATICS(symbolP)) - it was moving too many symbols out. So I switch it back to the - condition: - (S_GET_STORAGE_CLASS(symbolP) == C_EXT && !SF_GET_FUNCTION(symbolP)) - - In obj_emit_relocations() added the conditional on KEEP_RELOC_INFO - so that we don't use the F_RELFLG which make the linker complain - that somebody has stripped the relocation info. - - Also, the AIX ld program require that the relocation table - is sorted by r_vaddr like the standard ATT assembler does. - - [he also changed the sizeof(struct ...)'s into the coff - style FOOSZ macros. I'm not sure this is right, but I can't - remember why. xoxorich.] - -Tue Feb 18 02:11:10 1992 K. Richard Pixley (rich at cygnus.com) - - * tc-m88k.[hc]: pulled in from hack's unfinished work. These - aren't yet integrated. - - * tc-i860.[hc]: blew off the dust. Something must still be done - about conflicting relocation types. - - * tc-ns32k.c: Replaced previous tc_aout_fix_to_chars stub with the - real thing. - - * tc-i960.c, tc-sparc.c: white space and comments only. - - * tc-a29k.h: delete duplicate macro definition. - - * new file atof-ns32k.c copied from hack's last unreleased gas. - - diff --git a/gas/config/a.out.gnu.h b/gas/config/a.out.gnu.h deleted file mode 100755 index 5f3927525e..0000000000 --- a/gas/config/a.out.gnu.h +++ /dev/null @@ -1,431 +0,0 @@ -/* This file is a.out.gnu.h - - Copyright (C) 1987-1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef __A_OUT_GNU_H__ -#define __A_OUT_GNU_H__ - -/* There are two main flavours of a.out, one which uses the standard - relocations, and one which uses extended relocations. - - Today, the extended reloc uses are - TC_SPARC, TC_A29K - - each must define the enum reloc_type - -*/ - -#define USE_EXTENDED_RELOC (defined(TC_SPARC) || defined(TC_A29K)) - -#if defined(TC_SPARC) || defined(TC_A29K) -enum reloc_type { - RELOC_8, RELOC_16, RELOC_32, /* simple relocations */ - RELOC_DISP8, RELOC_DISP16, RELOC_DISP32, /* pc-rel displacement */ - RELOC_WDISP30, RELOC_WDISP22, - RELOC_HI22, RELOC_22, - RELOC_13, RELOC_LO10, - RELOC_SFA_BASE, RELOC_SFA_OFF13, - RELOC_BASE10, RELOC_BASE13, RELOC_BASE22, /* P.I.C. (base-relative) */ - RELOC_PC10, RELOC_PC22, /* for some sort of pc-rel P.I.C. (?) */ - RELOC_JMP_TBL, /* P.I.C. jump table */ - RELOC_SEGOFF16, /* reputedly for shared libraries somehow */ - RELOC_GLOB_DAT, RELOC_JMP_SLOT, RELOC_RELATIVE, - RELOC_11, - RELOC_WDISP2_14, - RELOC_WDISP19, - RELOC_HHI22, - RELOC_HLO10, - - /* 29K relocation types */ - RELOC_JUMPTARG, RELOC_CONST, RELOC_CONSTH, - - RELOC_WDISP14, RELOC_WDISP21, - - NO_RELOC, -}; -#endif /* TC_SPARC or TC_A29K */ - - -#define __GNU_EXEC_MACROS__ - -#ifndef __STRUCT_EXEC_OVERRIDE__ - -/* This is the layout on disk of a Unix V7, Berkeley, SunOS, Vax Ultrix - "struct exec". Don't assume that on this machine, the "struct exec" - will lay out the same sizes or alignments. */ - -struct exec_bytes { - unsigned char a_info[4]; - unsigned char a_text[4]; - unsigned char a_data[4]; - unsigned char a_bss[4]; - unsigned char a_syms[4]; - unsigned char a_entry[4]; - unsigned char a_trsize[4]; - unsigned char a_drsize[4]; -}; - -/* How big the "struct exec" is on disk */ -#define EXEC_BYTES_SIZE (8 * 4) - -/* This is the layout in memory of a "struct exec" while we process it. */ - -struct exec -{ - unsigned long a_info; /* Use macros N_MAGIC, etc for access */ - unsigned a_text; /* length of text, in bytes */ - unsigned a_data; /* length of data, in bytes */ - unsigned a_bss; /* length of uninitialized data area for file, in bytes */ - unsigned a_syms; /* length of symbol table data in file, in bytes */ - unsigned a_entry; /* start address */ - unsigned a_trsize; /* length of relocation info for text, in bytes */ - unsigned a_drsize; /* length of relocation info for data, in bytes */ -}; - -#endif /* __STRUCT_EXEC_OVERRIDE__ */ - -/* these go in the N_MACHTYPE field */ -/* These symbols could be defined by code from Suns...punt 'em */ -#undef M_UNKNOWN -#undef M_68010 -#undef M_68020 -#undef M_SPARC -enum machine_type { - M_UNKNOWN = 0, - M_68010 = 1, - M_68020 = 2, - M_SPARC = 3, - /* skip a bunch so we don't run into any of sun's numbers */ - M_386 = 100, - M_29K = 101, - M_RS6000 = 102, /* IBM RS/6000 */ - /* HP/BSD formats */ - M_HP200 = 200, /* hp200 (68010) BSD binary */ - M_HP300 = 300, /* hp300 (68020+68881) BSD binary */ - M_HPUX23 = 0x020C, /* hp200/300 HPUX binary */ -}; - -#define N_MAGIC(exec) ((exec).a_info & 0xffff) -#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) -#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) -#define N_SET_INFO(exec, magic, type, flags) \ - ((exec).a_info = ((magic) & 0xffff) \ - | (((int)(type) & 0xff) << 16) \ - | (((flags) & 0xff) << 24)) -#define N_SET_MAGIC(exec, magic) \ - ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff))) - -#define N_SET_MACHTYPE(exec, machtype) \ - ((exec).a_info = \ - ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) - -#define N_SET_FLAGS(exec, flags) \ - ((exec).a_info = \ - ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) - -/* Code indicating object file or impure executable. */ -#define OMAGIC 0407 -/* Code indicating pure executable. */ -#define NMAGIC 0410 -/* Code indicating demand-paged executable. */ -#define ZMAGIC 0413 - -/* Virtual Address of text segment from the a.out file. For OMAGIC, - (almost always "unlinked .o's" these days), should be zero. - For linked files, should reflect reality if we know it. */ - -#ifndef N_TXTADDR -#define N_TXTADDR(x) (N_MAGIC(x)==OMAGIC? 0 : TEXT_START_ADDR) -#endif - -#ifndef N_BADMAG -#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \ - && N_MAGIC(x) != NMAGIC \ - && N_MAGIC(x) != ZMAGIC) -#endif - -/* By default, segment size is constant. But on some machines, it can - be a function of the a.out header (e.g. machine type). */ -#ifndef N_SEGSIZE -#define N_SEGSIZE(x) SEGMENT_SIZE -#endif - - /* This complexity is for encapsulated COFF support */ -#ifndef _N_HDROFF -#define _N_HDROFF(x) (N_SEGSIZE(x) - sizeof (struct exec)) -#endif - -#ifndef N_TXTOFF -#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? \ - _N_HDROFF((x)) + sizeof (struct exec) : \ - sizeof (struct exec)) -#endif - - -#ifndef N_DATOFF -#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text ) -#endif - -#ifndef N_TRELOFF -#define N_TRELOFF(x) ( N_DATOFF(x) + (x).a_data ) -#endif - -#ifndef N_DRELOFF -#define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize ) -#endif - -#ifndef N_SYMOFF -#define N_SYMOFF(x) ( N_DRELOFF(x) + (x).a_drsize ) -#endif - -#ifndef N_STROFF -#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms ) -#endif - -/* Address of text segment in memory after it is loaded. */ -#ifndef N_TXTADDR -#define N_TXTADDR(x) 0 -#endif - -#ifndef N_DATADDR -#define N_DATADDR(x) \ - (N_MAGIC(x)==OMAGIC? (N_TXTADDR(x)+(x).a_text) \ - : (N_SEGSIZE(x) + ((N_TXTADDR(x)+(x).a_text-1) & ~(N_SEGSIZE(x)-1)))) -#endif - -/* Address of bss segment in memory after it is loaded. */ -#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) - -struct nlist { - union { - char *n_name; - struct nlist *n_next; - long n_strx; - } n_un; - unsigned char n_type; - char n_other; - short n_desc; - unsigned long n_value; -}; - -#define N_UNDF 0 -#define N_ABS 2 -#define N_TEXT 4 -#define N_DATA 6 -#define N_BSS 8 -#define N_COMM 0x12 /* common (visible in shared lib commons) */ -#define N_FN 0x1F /* File name of a .o file */ - -/* Note: N_EXT can only usefully be OR-ed with N_UNDF, N_ABS, N_TEXT, - N_DATA, or N_BSS. When the low-order bit of other types is set, - (e.g. N_WARNING versus N_FN), they are two different types. */ -#define N_EXT 1 -#define N_TYPE 036 -#define N_STAB 0340 - -/* The following type indicates the definition of a symbol as being - an indirect reference to another symbol. The other symbol - appears as an undefined reference, immediately following this symbol. - - Indirection is asymmetrical. The other symbol's value will be used - to satisfy requests for the indirect symbol, but not vice versa. - If the other symbol does not have a definition, libraries will - be searched to find a definition. */ - -#define N_INDR 0xa - -/* The following symbols refer to set elements. - All the N_SET[ATDB] symbols with the same name form one set. - Space is allocated for the set in the text section, and each set - element's value is stored into one word of the space. - The first word of the space is the length of the set (number of elements). - - The address of the set is made into an N_SETV symbol - whose name is the same as the name of the set. - This symbol acts like a N_DATA global symbol - in that it can satisfy undefined external references. */ - -/* These appear as input to LD, in a .o file. */ -#define N_SETA 0x14 /* Absolute set element symbol */ -#define N_SETT 0x16 /* Text set element symbol */ -#define N_SETD 0x18 /* Data set element symbol */ -#define N_SETB 0x1A /* Bss set element symbol */ - -/* This is output from LD. */ -#define N_SETV 0x1C /* Pointer to set vector in data area. */ - -/* Warning symbol. The text gives a warning message, the next symbol - in the table will be undefined. When the symbol is referenced, the - message is printed. */ - -#define N_WARNING 0x1e - -/* This structure describes a single relocation to be performed. - The text-relocation section of the file is a vector of these structures, - all of which apply to the text section. - Likewise, the data-relocation section applies to the data section. */ - -/* The following enum and struct were borrowed from SunOS's - /usr/include/sun4/a.out.h and extended to handle - other machines. It is currently used on SPARC and AMD 29000. - - reloc_ext_bytes is how it looks on disk. reloc_info_extended is - how we might process it on a native host. */ -#if USE_EXTENDED_RELOC - -struct reloc_ext_bytes { - unsigned char r_address[4]; - unsigned char r_index[3]; - unsigned char r_bits[1]; - unsigned char r_addend[4]; -}; - - -#define RELOC_EXT_BITS_EXTERN_BIG 0x80 -#define RELOC_EXT_BITS_EXTERN_LITTLE 0x01 - -#define RELOC_EXT_BITS_TYPE_BIG 0x1F -#define RELOC_EXT_BITS_TYPE_SH_BIG 0 -#define RELOC_EXT_BITS_TYPE_LITTLE 0xF8 -#define RELOC_EXT_BITS_TYPE_SH_LITTLE 3 - -#define RELOC_EXT_SIZE 12 /* Bytes per relocation entry */ - -struct reloc_info_extended -{ - unsigned long r_address; - unsigned int r_index:24; -# define r_symbolnum r_index - unsigned r_extern:1; - unsigned :2; - /* RS/6000 compiler does not support enum bitfield - enum reloc_type r_type:5; */ - enum reloc_type r_type; - long int r_addend; -}; - -#else - -/* The standard, old-fashioned, Berkeley compatible relocation struct */ - - - -#ifdef TC_I860 -/* NOTE: three bits max, see struct reloc_info_i860.r_type */ -enum i860_reloc_type { - NO_RELOC = 0, BRADDR, LOW0, LOW1, LOW2, LOW3, LOW4, SPLIT0, SPLIT1, SPLIT2, RELOC_32, -}; - -typedef enum i860_reloc_type reloc_type; - - /* NOTE: two bits max, see reloc_info_i860.r_type */ -enum highlow_type { - NO_SPEC = 0, PAIR, HIGH, HIGHADJ, -}; - - -struct reloc_info_i860 -{ - unsigned long r_address; - /* - * Using bit fields here is a bad idea because the order is not portable. :-( - */ - unsigned int r_symbolnum: 24; - unsigned int r_pcrel : 1; - unsigned int r_extern : 1; - /* combining the two field simplifies the argument passing in "new_fix()" */ - /* and is compatible with the existing Sparc #ifdef's */ - /* r_type: highlow_type - bits 5,4; reloc_type - bits 3-0 */ - unsigned int r_type : 6; - long r_addend; -}; - -#endif /* TC_I860 */ - - -struct reloc_std_bytes { - unsigned char r_address[4]; - unsigned char r_index[3]; - unsigned char r_bits[1]; -}; - -#define RELOC_STD_BITS_PCREL_BIG 0x80 -#define RELOC_STD_BITS_PCREL_LITTLE 0x01 - -#define RELOC_STD_BITS_LENGTH_BIG 0x60 -#define RELOC_STD_BITS_LENGTH_SH_BIG 5 /* To shift to units place */ -#define RELOC_STD_BITS_LENGTH_LITTLE 0x06 -#define RELOC_STD_BITS_LENGTH_SH_LITTLE 1 - -#define RELOC_STD_BITS_EXTERN_BIG 0x10 -#define RELOC_STD_BITS_EXTERN_LITTLE 0x08 - -#define RELOC_STD_BITS_BASEREL_BIG 0x08 -#define RELOC_STD_BITS_BASEREL_LITTLE 0x08 - -#define RELOC_STD_BITS_JMPTABLE_BIG 0x04 -#define RELOC_STD_BITS_JMPTABLE_LITTLE 0x04 - -#define RELOC_STD_BITS_RELATIVE_BIG 0x02 -#define RELOC_STD_BITS_RELATIVE_LITTLE 0x02 - -#define RELOC_STD_SIZE 8 /* Bytes per relocation entry */ - -#endif /* USE_EXTENDED_RELOC */ - -#ifndef CUSTOM_RELOC_FORMAT -struct relocation_info -{ - /* Address (within segment) to be relocated. */ - int r_address; - /* The meaning of r_symbolnum depends on r_extern. */ - unsigned int r_symbolnum:24; - /* Nonzero means value is a pc-relative offset - and it should be relocated for changes in its own address - as well as for changes in the symbol or section specified. */ - unsigned int r_pcrel:1; - /* Length (as exponent of 2) of the field to be relocated. - Thus, a value of 2 indicates 1<<2 bytes. */ - unsigned int r_length:2; - /* 1 => relocate with value of symbol. - r_symbolnum is the index of the symbol - in file's the symbol table. - 0 => relocate with the address of a segment. - r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS - (the N_EXT bit may be set also, but signifies nothing). */ - unsigned int r_extern:1; - /* The next three bits are for SunOS shared libraries, and seem to - be undocumented. */ - unsigned int r_baserel:1; /* Linkage table relative */ - unsigned int r_jmptable:1; /* pc-relative to jump table */ - -#ifdef TC_NS32K -#define r_bsr r_baserel -#define r_disp r_jmptable -#endif /* TC_NS32K */ - - unsigned int r_relative:1; /* "relative relocation" */ - /* unused */ - unsigned int r_pad:1; /* Padding -- set to zero */ -}; -#endif /* CUSTOM_RELOC_FORMAT */ - -#endif /* __A_OUT_GNU_H__ */ - -/* end of a.out.gnu.h */ diff --git a/gas/config/a.out.h b/gas/config/a.out.h deleted file mode 100755 index 25c619533a..0000000000 --- a/gas/config/a.out.h +++ /dev/null @@ -1,150 +0,0 @@ -/* This file describes the a.out file format - Copyright (C) 1987, 1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifdef USE_HP_INC_HDR -#include "../binutils/hp-include/a.out.h" -#else - -#ifdef USE_SYSTEM_HDR -#include "/usr/include/a.out.h" -#else - -#ifdef USE_HP_HDR -/* The `exec' structure and overall layout must be close to HP's when - we are running on an HP system, otherwise we will not be able to - execute the resulting file. */ - -struct exec -{ - unsigned short a_machtype; /* machine type */ - unsigned short a_magic; /* magic number */ - unsigned long a_spare1; - unsigned long a_spare2; - unsigned long a_text; /* length of text, in bytes */ - unsigned long a_data; /* length of data, in bytes */ - unsigned long a_bss; /* length of uninitialized data area for file, in bytes */ - unsigned long a_trsize; /* length of relocation info for text, in bytes */ - unsigned long a_drsize; /* length of relocation info for data, in bytes */ - unsigned long a_spare3; /* HP = pascal interface size */ - unsigned long a_spare4; /* HP = symbol table size */ - unsigned long a_spare5; /* HP = debug name table size */ - unsigned long a_entry; /* start address */ - unsigned long a_spare6; /* HP = source line table size */ - unsigned long a_spare7; /* HP = value table size */ - unsigned long a_syms; /* length of symbol table data in file, in bytes */ - unsigned long a_spare8; -}; - -#define N_MAGIC(exec) ((exec) . a_magic) -#define N_MACHTYPE(exec) ((exec) . a_machtype) -#define N_SET_MAGIC(exec, magic) (((exec) . a_magic) = (magic)) -#define N_SET_MACHTYPE(exec, machtype) (((exec) . a_machtype) = (machtype)) - -#define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x))) - -#define _N_BADMACH(x) \ - (((N_MACHTYPE (x)) != HP9000S200_ID) \ - && ((N_MACHTYPE (x)) != HP98x6_ID)) - -#define _N_BADMAG(x) \ - (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC) - -#define HP98x6_ID 0x20A -#define HP9000S200_ID 0x20C - -#else - -/* A Generic machine. . . */ - -/* JF I'm not sure where this file came from. I put the permit.text message in - it anyway. This file came to me as part of the original VAX assembler, but had - no copyright notices in it. */ - -struct exec { - long a_magic; /* number identifies as .o file and gives type of such. */ - unsigned a_text; /* length of text, in bytes */ - unsigned a_data; /* length of data, in bytes */ - unsigned a_bss; /* length of uninitialized data area for file, in bytes */ - unsigned a_syms; /* length of symbol table data in file, in bytes */ - unsigned a_entry; /* start address */ - unsigned a_trsize; /* length of relocation info for text, in bytes */ - unsigned a_drsize; /* length of relocation info for data, in bytes */ -}; - -#define N_BADMAG(x) \ - (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC) - -#endif - -/* From here down is common to both the HP and the generic machine */ -#define OMAGIC 0407 -#define NMAGIC 0410 -#define ZMAGIC 0413 - - -#define N_TXTOFF(x) \ - ((x).a_magic == ZMAGIC ? 1024 : sizeof(struct exec)) - -#define N_SYMOFF(x) \ - (N_TXTOFF(x) + (x).a_text + (x).a_data + (x).a_trsize + (x).a_drsize) - -#define N_STROFF(x) \ - (N_SYMOFF(x) + (x).a_syms) - -struct nlist { - union { - char *n_name; - struct nlist *n_next; - long n_strx; - } n_un; - char n_type; - char n_other; - short n_desc; - unsigned n_value; -}; - -#define N_UNDF 0 -#define N_ABS 2 -#define N_TEXT 4 -#define N_DATA 6 -#define N_BSS 8 -#define N_FN 31 /* JF: Someone claims this should be 31 instead of - 15. I just inherited this file; I didn't write - it. Who is right? */ - - -#define N_EXT 1 -#define N_TYPE 036 -#define N_STAB 0340 - -struct relocation_info { - int r_address; - unsigned r_symbolnum:24; - unsigned r_pcrel:1; - unsigned r_length:2; - unsigned r_extern:1; - unsigned r_bsr:1; /* OVE: used on ns32k based systems, if you want */ - unsigned r_disp:1; /* OVE: used on ns32k based systems, if you want */ - unsigned nuthin:2; -}; - -#endif -#endif - -/* end of a.out.h */ diff --git a/gas/config/coff.gnu.h b/gas/config/coff.gnu.h deleted file mode 100755 index fd21e1a722..0000000000 --- a/gas/config/coff.gnu.h +++ /dev/null @@ -1,783 +0,0 @@ -/* coff.gnu.h - Copyright (C) 1987, 1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* - * At this point I'm sure this file is right for i960 and I'm pretty sure it's - * right for a29k, although it hasn't been tested rigorously. Please feel free - * to add your own machine's description here. Without that info, it isn't - * possible to build cross development tools from elsewhere nor is it easy to - * continue to support your machines format. - * - * The TC_foo ifdef's are mine. They are what gas uses. The other ifdef's - * remain for documentation from other scavenged files. xoxorich. - */ - -/********************** FILE HEADER **********************/ - -struct filehdr { - unsigned short f_magic; /* magic number */ - unsigned short f_nscns; /* number of sections */ - long f_timdat; /* time & date stamp */ - long f_symptr; /* file pointer to symtab */ - long f_nsyms; /* number of symtab entries */ - unsigned short f_opthdr; /* sizeof(optional hdr) */ - unsigned short f_flags; /* flags */ -}; - -/* Bits for f_flags: - * F_RELFLG relocation info stripped from file - * F_EXEC file is executable (no unresolved externel references) - * F_LNNO line nunbers stripped from file - * F_LSYMS local symbols stripped from file - * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax) - */ -#define F_RELFLG (0x0001) -#define F_EXEC (0x0002) -#define F_LNNO (0x0004) -#define F_LSYMS (0x0008) - -#ifdef TC_I960 -#define F_AR32WR (0x0010) /* File has 32 bits per word, least - significant byte first. */ -#else /* TC_I960 */ -#define F_AR32WR (0x0100) -#endif /* TC_I960 */ - -#define F_MINMAL (0x0010) /* ??? */ -#define F_UPDATE (0x0020) /* ??? */ -#define F_SWABD (0x0040) /* ??? */ -#define F_AR16WR (0x0080) /* File has the byte ordering used by - the PDP*-11/70 processor. */ -#define F_AR32W (0x0200) /* File has 32 bits per word, most - significant byte first. */ - -/* - * Intel 80960 (I960) processor flags. - * F_I960TYPE == mask for processor type field. - */ - -#define F_I960TYPE (0xf000) -#define F_I960CORE (0x1000) -#define F_I960KB (0x2000) -#define F_I960SB (0x2000) -#define F_I960MC (0x3000) -#define F_I960XA (0x4000) -#define F_I960CA (0x5000) -#define F_I960KA (0x6000) -#define F_I960SA (0x6000) - -/* - * i80960 Magic Numbers - */ - -#define I960ROMAGIC (0x160) /* read-only text segments */ -#define I960RWMAGIC (0x161) /* read-write text segments */ - -#define I960BADMAG(x) (((x).f_magic != I960ROMAGIC) && ((x).f_magic != I960RWMAGIC)) - -#define SIPFBOMAGIC (0x17a) /* Am29000 (Byte 0 is MSB - Big Endian) */ -#define SIPRBOMAGIC (0x17b) /* Am29000 (Byte 0 is LSB - Little Endian) */ - -#define A29KBADMAG(x) (((x).f_magic != SIPFBOMAGIC) && ((x).f_magic != SIPRBOMAGIC)) - -#ifdef TE_I386AIX -# define I386MAGIC (0x175) /* Danbury AIX C compiler */ -# define I386SVMAGIC (0x14c) /* System V C Compiler */ -# define I386BADMAG(x) (((x).f_magic!=I386MAGIC) && \ - ((x).f_magic!=I386SVMAGIC)) -#else /* not TE_I386AIX */ -# define I386MAGIC 0x14c -# define I386BADMAG(x) (((x).f_magic!=I386MAGIC)) -#endif /* not TE_I386AIX */ - - -#define FILHDR struct filehdr -#define FILHSZ sizeof(FILHDR) - - -/********************** AOUT "OPTIONAL HEADER" **********************/ - -typedef struct { - unsigned long phys_addr; - unsigned long bitarray; -} TAGBITS; - -/* These appear to be used only by exec(2). I don't know who cares - about them in a cross development environment. In any case, this - is my collection after researching the issue for a few hours. - Apparently, most have these have remained essentially unchanged - since v7 days, although a few new ones have been added. xoxorich. */ - -#define BAD0MAGIC (0401) /* (?) "lpd (UNIX/RT)" */ -#define BAD1MAGIC (0405) /* (?) overlay */ -#define OMAGIC (0407) /* old impure format. data immediately - follows text. both sections are rw. */ -#define NMAGIC (0410) /* split i&d, read-only text */ -#define A_MAGIC3 (0411) /* (?) "separated I&D" */ -#define ZMAGIC (0413) /* like NMAGIC, but demand loaded */ -#define PAGEMAGIC2 (0414) /* (?) like ZMAGIC, but address zero - explicitly unmapped. */ -#define REGMAGIC (0414) /* (?) a PAGEMAGIC2 alias? */ -#define PAGEMAGIC3 (0415) /* (?) like ZMAGIC, but address zero mapped. */ -#define A_MAGIC5 (0437) /* (?) "system overlay, separated I&D" */ -/* intended for non-unix cross development */ -#define SASMAGIC (010000) /* Single Address Space */ -#define MASMAGIC (020000) /* (?) "Multiple (separate I & D) Address Spaces" */ - -typedef struct aouthdr { - short magic; /* type of file */ - short vstamp; /* version stamp */ - unsigned long tsize; /* text size in bytes, padded to FW bdry*/ - unsigned long dsize; /* initialized data " " */ - unsigned long bsize; /* uninitialized data " " */ -#if U3B - unsigned long dum1; - unsigned long dum2; /* pad to entry point */ -#endif - unsigned long entry; /* entry pt. */ - unsigned long text_start; /* base of text used for this file */ - unsigned long data_start; /* base of data used for this file */ - /* CAREFUL: some formats omit the tagentries member. */ - unsigned long tagentries; /* number of tag entries to - follow (always zero for i960) */ -} AOUTHDR; - -/* return a pointer to the tag bits array */ - -#define TAGPTR(aout) ((TAGBITS *) (&(aout.tagentries)+1)) - -/* compute size of a header */ - -/*#define AOUTSZ(aout) (sizeof(AOUTHDR)+(aout.tagentries*sizeof(TAGBITS)))*/ -#define AOUTSZ (sizeof(AOUTHDR)) - - -/********************** STORAGE CLASSES **********************/ - -#define C_EFCN -1 /* physical end of function */ -#define C_NULL 0 -#define C_AUTO 1 /* automatic variable */ -#define C_EXT 2 /* external symbol */ -#define C_STAT 3 /* static */ -#define C_REG 4 /* register variable */ -#define C_EXTDEF 5 /* external definition */ -#define C_LABEL 6 /* label */ -#define C_ULABEL 7 /* undefined label */ -#define C_MOS 8 /* member of structure */ -#define C_ARG 9 /* function argument */ -#define C_STRTAG 10 /* structure tag */ -#define C_MOU 11 /* member of union */ -#define C_UNTAG 12 /* union tag */ -#define C_TPDEF 13 /* type definition */ -#define C_USTATIC 14 /* undefined static */ -#define C_ENTAG 15 /* enumeration tag */ -#define C_MOE 16 /* member of enumeration */ -#define C_REGPARM 17 /* register parameter */ -#define C_FIELD 18 /* bit field */ - -#ifdef TC_I960 -#define C_AUTOARG 19 /* auto argument */ -#define C_LASTENT 20 /* dummy entry (end of block) */ -#endif /* TC_I960 */ - -#ifdef TC_A29K -#define C_GLBLREG 19 /* global register */ -#define C_EXTREG 20 /* external global register */ -#define C_DEFREG 21 /* ext. def. of global register */ -#define C_STARTOF 22 /* as29 $SIZEOF and $STARTOF symbols */ -#endif /* TC_A29K */ - -#define C_BLOCK 100 /* ".bb" or ".eb" */ -#define C_FCN 101 /* ".bf" or ".ef" */ -#define C_EOS 102 /* end of structure */ -#define C_FILE 103 /* file name */ -#define C_LINE 104 /* line # reformatted as symbol table entry */ -#define C_ALIAS 105 /* duplicate tag */ -#define C_HIDDEN 106 /* ext symbol in dmert public lib. like static, - used to avoid name conflicts. */ - -#ifdef TC_I960 -/* New storage classes for 80960 */ -#define C_SCALL 107 /* Procedure reachable via system call */ -/* C_LEAFPROC is obsolete. Use C_LEAFEXT or C_LEAFSTAT */ -#define C_LEAFPROC 108 /* Leaf procedure, "call" via BAL */ -#define C_LEAFEXT 108 -#define C_OPTVAR 109 /* Optimized variable */ -#define C_DEFINE 110 /* Preprocessor #define */ -#define C_PRAGMA 111 /* Advice to compiler or linker */ -#define C_SEGMENT 112 /* 80960 segment name */ -#define C_LEAFSTAT 113 /* Static leaf */ -#endif /* TC_I960 */ - -#ifdef TC_A29K -#define C_SHADOW 107 /* shadow symbol */ -#endif /* TC_A29K */ - -/********************** SECTION HEADER **********************/ - -struct scnhdr { - char s_name[8]; /* section name */ - long s_paddr; /* physical address, aliased s_nlib */ - long s_vaddr; /* virtual address */ - long s_size; /* section size */ - long s_scnptr; /* file ptr to raw data for section */ - long s_relptr; /* file ptr to relocation */ - long s_lnnoptr; /* file ptr to line numbers */ - unsigned short s_nreloc; /* number of relocation entries */ - unsigned short s_nlnno; /* number of line number entries */ - long s_flags; /* flags */ - -#ifdef TC_I960 - unsigned long s_align; /* section alignment */ -#endif /* TC_I960 */ -}; - -#define SCNHDR struct scnhdr -#define SCNHSZ sizeof(SCNHDR) - -/* - * names of "special" sections - */ -#define _TEXT ".text" /* executable code section */ -#define _DATA ".data" /* initialized data */ -#define _BSS ".bss" /* un-initialized data */ -#define _DEBUG ".debug" /* special section used by dbx */ -#define _COMMENT ".comment" /* version info */ -#define _LIB ".lib" /* shared lib info section */ -#define _TV ".tv" - -/* - * s_flags "type" - */ - -/* - * In instances where it is necessary for a linker to - * produce an output file which contains text or data not - * based at virtual address 0, e.g. for a ROM, then the - * linker should accept address base information as command - * input and use PAD sections to skip over unused addresses. - * (at least for a29k. Maybe others.) - */ - -#define STYP_REG (0x0000) /* "regular" section: allocated, relocated, loaded */ -#define STYP_DSECT (0x0001) /* "dummy" section: not allocated, relocated, not loaded */ -#define STYP_NOLOAD (0x0002) /* "noload" section: allocated, relocated, not loaded */ -#define STYP_GROUP (0x0004) /* "grouped" section: formed of input sections */ -#define STYP_PAD (0x0008) /* "padding" section: not allocated, not relocated, loaded */ -#define STYP_COPY (0x0010) /* "copy" section: for decision function used by field update; not allocated, not relocated, - loaded; reloc & lineno entries processed normally */ -#define STYP_TEXT (0x0020) /* section contains text only */ -#define S_SHRSEG (0x0020) /* In 3b Update files (output of ogen), sections which appear in SHARED segments of the Pfile - will have the S_SHRSEG flag set by ogen, to inform dufr that updating 1 copy of the proc. will - update all process invocations. */ -#define STYP_DATA (0x0040) /* section contains data only */ -#define STYP_BSS (0x0080) /* section contains bss only */ -#define S_NEWFCN (0x0100) /* In a minimal file or an update file, a new function (as compared with a replaced function) */ -#define STYP_INFO (0x0200) /* comment section : not allocated not relocated, not loaded */ -#define STYP_OVER (0x0400) /* overlay section : relocated not allocated or loaded */ -#define STYP_LIB (0x0800) /* for .lib section : same as INFO */ -#define STYP_MERGE (0x2000) /* merge section -- combines with text, data or bss sections only */ -#define STYP_REVERSE_PAD (0x4000) /* section will be padded with no-op instructions wherever padding is necessary and there is a - word of contiguous bytes beginning on a word boundary. */ - -#ifdef TC_A29K -/* NOTE: The use of STYP_BSSREG for relocation is not yet defined. */ -#define STYP_BSSREG 0x1200 /* Global register area (like STYP_INFO) */ -#define STYP_ENVIR 0x2200 /* Environment (like STYP_INFO) */ -#define STYP_ABS 0x4000 /* Absolute (allocated, not reloc, loaded) */ -#define STYP_LIT 0x8020 /* Literal data (like STYP_TEXT) */ -#endif /* TC_A29K */ - -/********************** LINE NUMBERS **********************/ - -/* 1 line number entry for every "breakpointable" source line in a section. - * Line numbers are grouped on a per function basis; first entry in a function - * grouping will have l_lnno = 0 and in place of physical address will be the - * symbol table index of the function name. - */ -struct lineno { - union { - long l_symndx; /* symbol index of function name, iff l_lnno == 0*/ - long l_paddr; /* (physical) address of line number */ - } l_addr; - unsigned short l_lnno; /* line number */ -#ifdef TC_I960 - /* not used on a29k */ - char padding[2]; /* force alignment */ -#endif /* TC_I960 */ -}; - -#define LINENO struct lineno -#define LINESZ sizeof(LINENO) - - -/********************** SYMBOLS **********************/ - -#define SYMNMLEN 8 /* # characters in a symbol name */ -#define FILNMLEN 14 /* # characters in a file name */ -#define DIMNUM 4 /* # array dimensions in auxiliary entry */ - -struct syment { - union { - char _n_name[SYMNMLEN]; /* old COFF version */ - struct { - long _n_zeroes; /* new == 0 */ - long _n_offset; /* offset into string table */ - } _n_n; - char *_n_nptr[2]; /* allows for overlaying */ - } _n; - long n_value; /* value of symbol */ - short n_scnum; /* section number */ - -#ifdef TC_I960 - /* This isn't yet used on the i960. In some formats this - is two bytes of padding. In others, it is missing entirely. */ - unsigned short n_flags; /* copy of flags from filhdr */ -#endif /* TC_I960 */ - -#ifdef TC_A29K - unsigned short n_type; /* type and derived type */ -#else /* TC_A29K */ - /* at least i960 uses long */ - unsigned long n_type; /* type and derived type */ -#endif /* TC_A29K */ - - char n_sclass; /* storage class */ - char n_numaux; /* number of aux. entries */ - -#ifndef TC_A29K - char pad2[2]; /* force alignment */ -#endif /* TC_A29K */ -}; - -#define SYMENT struct syment -#define SYMESZ sizeof(SYMENT) /* This had better also be sizeof(AUXENT) */ - -#define n_name _n._n_name -#define n_ptr _n._n_nptr[1] -#define n_zeroes _n._n_n._n_zeroes -#define n_offset _n._n_n._n_offset - - /* - * Relocatable symbols have number of the section in which they are defined, - * or one of the following: - */ - -#define N_SCNUM ((short) 1-65535) /* section num where symbol defined */ -#define N_UNDEF ((short)0) /* undefined symbol */ -#define N_ABS ((short)-1) /* value of symbol is absolute */ -#define N_DEBUG ((short)-2) /* debugging symbol -- symbol value is meaningless */ -#define N_TV ((short)-3) /* indicates symbol needs preload transfer vector */ -#define P_TV ((short)-4) /* indicates symbol needs transfer vector (postload) */ - -/* - * Type of a symbol, in low 4 bits of the word - */ -#define T_NULL 0 /* type not assigned */ -#define T_VOID 1 /* function argument (only used by compiler) (but now real void). */ -#define T_CHAR 2 /* character */ -#define T_SHORT 3 /* short integer */ -#define T_INT 4 /* integer */ -#define T_LONG 5 /* long integer */ -#define T_FLOAT 6 /* floating point */ -#define T_DOUBLE 7 /* double word */ -#define T_STRUCT 8 /* structure */ -#define T_UNION 9 /* union */ -#define T_ENUM 10 /* enumeration */ -#define T_MOE 11 /* member of enumeration */ -#define T_UCHAR 12 /* unsigned character */ -#define T_USHORT 13 /* unsigned short */ -#define T_UINT 14 /* unsigned integer */ -#define T_ULONG 15 /* unsigned long */ - -#ifdef TC_I960 -#define T_LNGDBL 16 /* long double */ -#endif /* TC_I960 */ - -/* - * derived types, in n_type - */ -#define DT_NON (0) /* no derived type */ -#define DT_PTR (1) /* pointer */ -#define DT_FCN (2) /* function */ -#define DT_ARY (3) /* array */ - -#ifndef TC_I960 - -#define N_BTMASK (0x0f) -#define N_TMASK (0x30) -#define N_BTSHFT (4) -#define N_TSHIFT (2) - -#else /* TC_I960 */ - -#define N_BTMASK (0x1f) -#define N_TMASK (0x60) -#define N_BTSHFT (5) -#define N_TSHIFT (2) - -#endif /* TC_I960 */ - -#define BTYPE(x) ((x) & N_BTMASK) - -#define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT)) -#define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT)) -#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT)) - -#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK)) - -union auxent { - struct { - long x_tagndx; /* str, un, or enum tag indx */ - union { - struct { - unsigned short x_lnno; /* declaration line number */ - unsigned short x_size; /* str/union/array size */ - } x_lnsz; - long x_fsize; /* size of function */ - } x_misc; - union { - struct { /* if ISFCN, tag, or .bb */ - long x_lnnoptr; /* ptr to fcn line # */ - long x_endndx; /* entry ndx past block end */ - } x_fcn; - struct { /* if ISARY, up to 4 dimen. */ - unsigned short x_dimen[DIMNUM]; - } x_ary; - } x_fcnary; - unsigned short x_tvndx; /* tv index */ - } x_sym; - - /* This was just a struct x_file with x_fname only in a29k. xoxorich. */ - union { - char x_fname[FILNMLEN]; - struct { - long x_zeroes; - long x_offset; - } x_n; - } x_file; - - struct { - long x_scnlen; /* section length */ - unsigned short x_nreloc; /* # relocation entries */ - unsigned short x_nlinno; /* # line numbers */ - } x_scn; - - struct { - long x_tvfill; /* tv fill value */ - unsigned short x_tvlen; /* length of .tv */ - - /* This field was typo'd x_tvrna on a29k. xoxorich. */ - unsigned short x_tvran[2]; /* tv range */ - } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ - -#ifdef TC_I960 - /****************************************** - * I960-specific *2nd* aux. entry formats - ******************************************/ - struct { - /* This is a very old typo that keeps getting propogated. */ -#define x_stdindx x_stindx - long x_stindx; /* sys. table entry */ - } x_sc; /* system call entry */ - - struct { - unsigned long x_balntry; /* BAL entry point */ - } x_bal; /* BAL-callable function */ - - struct { - unsigned long x_timestamp; /* time stamp */ - char x_idstring[20]; /* producer identity string */ - } x_ident; /* Producer ident info */ - - char a[sizeof(struct syment)]; /* force auxent/syment sizes to match */ -#endif /* TC_I960 */ -}; - -#define AUXENT union auxent -#define AUXESZ sizeof(AUXENT) /* This had better also be sizeof(SYMENT) */ - -#if VAX || I960 -# define _ETEXT "_etext" -#else -# define _ETEXT "etext" -#endif - -/********************** RELOCATION DIRECTIVES **********************/ - -struct reloc { - long r_vaddr; /* Virtual address of reference */ - long r_symndx; /* Index into symbol table */ - unsigned short r_type; /* Relocation type */ -#ifdef TC_I960 - /* not used for a29k */ - char pad[2]; /* Unused */ -#endif /* TC_I960 */ -}; - -#define RELOC struct reloc -#define RELSZ sizeof(RELOC) - -#define R_ABS (0x00) /* reference is absolute */ - -#ifdef TC_I960 -#define R_RELLONG (0x11) /* Direct 32-bit relocation */ -#define R_IPRSHORT (0x18) -#define R_IPRMED (0x19) /* 24-bit ip-relative relocation */ -#define R_IPRLONG (0x1a) -#define R_OPTCALL (0x1b) /* 32-bit optimizable call (leafproc/sysproc) */ -#define R_OPTCALLX (0x1c) /* 64-bit optimizable call (leafproc/sysproc) */ -#define R_GETSEG (0x1d) -#define R_GETPA (0x1e) -#define R_TAGWORD (0x1f) -#endif /* TC_I960 */ - -#ifdef TC_A29K -/* - * NOTE: All the "I" forms refer to Am29000 instruction - * formats. The linker is expected to know how the numeric - * information is split and/or aligned within the - * instruction word(s). R_BYTE works for instructions, too. - * - * If the parameter to a CONSTH instruction is a relocatable - * type, two relocation records are written. The first has - * an r_type of R_IHIHALF (33 octal) and a normal r_vaddr - * and r_symndx. The second relocation record has an r_type - * of R_IHCONST (34 octal), a normal r_vaddr (which is - * redundant), and an r_symndx containing the 32-bit - * constant offset to the relocation instead of the actual - * symbol table index. This second record is always - * written, even if the constant offset is zero. The - * constant fields of the instruction are set to zero. - */ - -#define R_IREL (0x18) /* instruction relative (jmp/call) */ -#define R_IABS (0x19) /* instruction absolute (jmp/call) */ -#define R_ILOHALF (0x1a) /* instruction low half (const) */ -#define R_IHIHALF (0x1b) /* instruction high half (consth) part 1 */ -#define R_IHCONST (0x1c) /* instruction high half (consth) part 2 - constant offset of R_IHIHALF relocation */ -#define R_BYTE (0x1d) /* relocatable byte value */ -#define R_HWORD (0x1e) /* relocatable halfword value */ -#define R_WORD (0x1f) /* relocatable word value */ -#define R_IGLBLRC (0x20) /* instruction global register RC */ -#define R_IGLBLRA (0x21) /* instruction global register RA */ -#define R_IGLBLRB (0x22) /* instruction global register RB */ -#endif /* TC_A29K */ - - -#define DEFAULT_DATA_SECTION_ALIGNMENT 4 -#define DEFAULT_BSS_SECTION_ALIGNMENT 4 -#define DEFAULT_TEXT_SECTION_ALIGNMENT 16 -/* For new sections we haven't heard of before */ -#define DEFAULT_SECTION_ALIGNMENT 4 - -#if defined(TC_I386) -/* - * X86 generic - * 8-bit offset reference in 8-bits - * 8-bit offset reference in 16-bits - * 12-bit segment reference - * auxiliary relocation entry - */ -#define R_OFF8 07 -#define R_OFF16 010 -#define R_SEG12 011 -#define R_AUX 013 - -/* - * B16 and X86 generics - * 16-bit direct reference - * 16-bit "relative" reference - * 16-bit "indirect" (TV) reference - */ -#define R_DIR16 01 -#define R_REL16 02 -#define R_IND16 03 - -/* - * 3B generic - * 24-bit direct reference - * 24-bit "relative" reference - * 16-bit optimized "indirect" TV reference - * 24-bit "indirect" TV reference - * 32-bit "indirect" TV reference - */ -#define R_DIR24 04 -#define R_REL24 05 -#define R_OPT16 014 -#define R_IND24 015 -#define R_IND32 016 - -/* - * XL generics - * 10-bit direct reference - * 10-bit "relative" reference - * 32-bit "relative" reference - */ -#define R_DIR10 025 -#define R_REL10 026 -#define R_REL32 027 - -/* - * 3B and M32 generics - * 32-bit direct reference - */ -#define R_DIR32 06 - -/* - * M32 generic - * 32-bit direct reference with bytes swapped - */ -#define R_DIR32S 012 - -#endif /* TC_I386 */ - -#if defined(TE_I386AIX) - -#define UINFOSIZ 64 /* size of user info buffer */ -typedef char uinfo_t[UINFOSIZ]; - -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]; -}; - -#define CD_NAMELEN 16 /* length of most names in this header */ -#define CORHDRSIZ 2048 /* size to which header is padded out */ -#define MAX_CORE_SEGS 32 /* maximum segments in a core dump */ -#define NUM_FREGS 1 /* # of saved FP regs */ - -/* - * These are defined such that 286 and 386 kernels can produce - * compatible dumps. - */ -#define CD_AX 0 -#define CD_BX 1 -#define CD_CX 2 -#define CD_DX 3 -#define CD_SI 4 -#define CD_DI 5 -#define CD_BP 6 -#define CD_SP 7 -#define CD_FL 8 -#define CD_IP 9 -#define CD_CS 10 -#define CD_DS 11 -#define CD_ES 12 -#define CD_FS 13 -#define CD_GS 14 -#define CD_SS 15 -#define NUM_REGS 16 - -#ifndef SPATHLEN -# define SPATHLEN 16 /* sys/param.h */ -#endif -#ifndef NSIG -# define NSIG 63 /* sys/signal.h */ -# define SIGSETSZ ((NSIG+31)/32) -typedef struct ksigmask { - unsigned long sigs[SIGSETSZ]; -} ksigmask_t; -#endif - -struct corehdr { - char cd_magic[4]; /* COR_MAGIC = "core" */ - - /* general information about the dump itself */ - struct dumpseg { /* table of contents for dump */ - long cs_type; /* seg. type; see below */ - long cs_len; /* length (in bytes) of segment */ - long cs_offset; /* offset (in dump) of segment */ - long cs_address; /* address segment had in mem */ - } cd_segs[MAX_CORE_SEGS]; - - /* general information about the process */ - char cd_comm[CD_NAMELEN]; /* command being run */ - char cd_mach[CD_NAMELEN]; /* type of machine it ran on */ - char cd_site[CD_NAMELEN]; /* name of site it ran on */ - long cd_ldtype; /* type of load module running */ - char cd_intsize; /* sizeof(int) */ - char cd_dptrsize; /* sizeof(char *) */ - char cd_tptrsize; /* sizeof(int (*)()) */ - char cd_unused; - - /* user-mode program state */ - long cd_regs[NUM_REGS]; /* user-mode general registers */ - struct env387 cd_fpregs; /* user-mode floating-point state */ - - /* kernel-mode program state */ - int (*cd_sig[NSIG])(); /* disposition of signals */ - ksigmask_t cd_sigmask; /* signals to be blocked */ - ksigmask_t cd_sigpend; /* signals currently pending */ - long cd_cursig; /* signal that caused the dump */ - - long cd_pid; /* process ID of the corpse */ - long cd_ppid; /* parent process ID of corpse */ - short cd_uid; /* process effective user ID */ - short cd_ruid; /* process real user ID */ - short cd_gid; /* process effective group ID */ - short cd_rgid; /* process real group ID */ - - uinfo_t cd_uinfo; /* buffer of user information */ - char cd_locname[32]; /* name of /local */ - char cd_uvers[CD_NAMELEN]; /* user version string */ - unsigned short cd_spath[SPATHLEN]; /* sitepath */ -}; - -#ifndef NOCHECKS -/* this will generate an error if sizeof(struct corehdr) > CORHDRSIZ */ -struct { char xxcdxx[CORHDRSIZ+1-sizeof(struct corehdr)]; }; -#endif /* ! NOCHECKS */ - -/* - * segment types (in cs_type) - * each segment in the address space appears here, whether or not it - * is actually dumped. Read/only segments will not actually be dumped. - * A segment that is not in the dump will have a cs_offset of zero. - */ -#define COR_TYPE_CODE 'x' /* process code - NOT IN DUMP */ -#define COR_TYPE_DATA 'd' /* process data segment */ -#define COR_TYPE_STACK 's' /* process stack segment */ -#define COR_TYPE_LIBCODE 'X' /* shared lib code - NOT IN DUMP*/ -#define COR_TYPE_LIBDATA 'D' /* shared lib data */ -#define COR_TYPE_READ 'r' /* other read/only - NOT IN DUMP*/ -#define COR_TYPE_WRITE 'w' /* other writeable */ -#define COR_TYPE_MSC '?' /* other, mapped in segment */ - -#endif /* TE_I386AIX */ - -/* - * Local Variables: - * comment-column: 0 - * End: - */ - -/* end of coff.gnu.h */ diff --git a/gas/config/ho-a29k.h b/gas/config/ho-a29k.h deleted file mode 100755 index 683c4f7da4..0000000000 --- a/gas/config/ho-a29k.h +++ /dev/null @@ -1,26 +0,0 @@ -/* ho-a29k.h Host-specific header file intended for "eb" board with - HIF. - - Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#define HO_A29K 1 - -#include - -/* end of ho-a29k.h */ diff --git a/gas/config/ho-cygnus.h b/gas/config/ho-cygnus.h deleted file mode 100755 index ad408d2a59..0000000000 --- a/gas/config/ho-cygnus.h +++ /dev/null @@ -1,31 +0,0 @@ -/* ho-ansi.h Host-specific header file for generic ansi environments. - Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#define M_ANSI 1 - -#include -#include -#include -#include - -#define sys_nerr _sys_nerr -#define sys_errlist _sys_errlist -#define bzero(s,l) (memset((s),0,(l))) - -/* end of ho-cygnus.h */ diff --git a/gas/config/mh-a29k b/gas/config/mh-a29k deleted file mode 100755 index f8de0b93b4..0000000000 --- a/gas/config/mh-a29k +++ /dev/null @@ -1 +0,0 @@ -CC = gcc -ba29k diff --git a/gas/config/mh-cygnus b/gas/config/mh-cygnus deleted file mode 100755 index 774d20502c..0000000000 --- a/gas/config/mh-cygnus +++ /dev/null @@ -1,8 +0,0 @@ -CC = gcc -b$(target) -Wall -nostdinc -nostdlib \ - -I$(srcdir)/../clib/ansi/include -I$(srcdir)/../os-layer/include - -CLIB = $(srcdir)/../clib/Host-$(host)/Target-$(target)/libc.a \ - $(srcdir)/../gcc/Host-sun4/Target-$(target)/gnulib - -LDFLAGS = /lib/crt0.o - diff --git a/gas/config/obj-coff-bfd.c b/gas/config/obj-coff-bfd.c deleted file mode 100755 index b2cb0351ad..0000000000 --- a/gas/config/obj-coff-bfd.c +++ /dev/null @@ -1,2114 +0,0 @@ -/* coff object file format with bfd - Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc. - -This file is part of GAS. - -GAS is free software; you can 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. - -GAS is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GAS; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* - - How does this releate to the rest of GAS ? - - Well, all the other files in gas are more or less a black box. It - takes care of opening files, parsing command lines, stripping blanks - etc etc. This module gets a chance to register what it wants to do by - saying that it is interested in various pseduo ops. The other big - change is write_object_file. This runs through all the data - structures that gas builds, and outputs the file in the format of our - choice. - - Hacked for BFDness by steve chamberlain - - This object module now supports the Hitachi H8/300 and the AMD 29k - - sac@cygnus.com -*/ - -#include "as.h" -#include "obstack.h" -#include "subsegs.h" -#include "frags.h" -#include "../bfd/libbfd.h" - - -/* This vector is used to turn an internal segment into a section # - suitable for insertion into a coff symbol table - */ - -const short seg_N_TYPE[] = { /* in: segT out: N_TYPE bits */ - C_ABS_SECTION, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - C_UNDEF_SECTION, /* SEG_UNKNOWN */ - C_UNDEF_SECTION, /* SEG_ABSENT */ - C_UNDEF_SECTION, /* SEG_PASS1 */ - C_UNDEF_SECTION, /* SEG_GOOF */ - C_UNDEF_SECTION, /* SEG_BIG */ - C_UNDEF_SECTION, /* SEG_DIFFERENCE */ - C_DEBUG_SECTION, /* SEG_DEBUG */ - C_NTV_SECTION, /* SEG_NTV */ - C_PTV_SECTION, /* SEG_PTV */ - C_REGISTER_SECTION, /* SEG_REGISTER */ -}; - - -int function_lineoff = -1; /* Offset in line#s where the last function - started (the odd entry for line #0) */ - -int our_lineno_number = 0; /* we use this to build pointers from .bf's - into the linetable. It should match - exactly the values that are later - assigned in text_lineno_number by - write.c. */ - -int text_lineno_number = 0; - -/* Add 4 to the real value to get the index and compensate the - negatives. This vector is used by S_GET_SEGMENT to turn a coff - section number into a segment number -*/ -static symbolS *previous_file_symbol = NULL; -void c_symbol_merge(); - -symbolS *c_section_symbol(); -bfd *abfd; -void EXFUN(bfd_as_write_hook,(struct internal_filehdr *, - bfd *abfd)); - -static void EXFUN(fixup_segment,(fixS * fixP, - segT this_segment_type)); - -static void EXFUN(fill_section,(bfd *abfd , - struct internal_filehdr *f, unsigned - long *)); - - -char *EXFUN(s_get_name,(symbolS *s)); -static symbolS *EXFUN(tag_find_or_make,(char *name)); -static symbolS* EXFUN(tag_find,(char *name)); - - -static int -EXFUN(c_line_new,( - symbolS *symbol, - long paddr, - unsigned short line_number, - fragS* frag)); - - -static void EXFUN(w_symbols, - (bfd *abfd , - char *where , - symbolS *symbol_rootP)); - - - -static void EXFUN( obj_coff_def,(int what)); -static void EXFUN( obj_coff_lcomm,(void)); -static void EXFUN( obj_coff_dim,(void)); -static void EXFUN( obj_coff_text,(void)); -static void EXFUN( obj_coff_data,(void)); -static void EXFUN( obj_coff_endef,(void)); -static void EXFUN( obj_coff_line,(void)); -static void EXFUN( obj_coff_ln,(void)); -static void EXFUN( obj_coff_scl,(void)); -static void EXFUN( obj_coff_size,(void)); -static void EXFUN( obj_coff_tag,(void)); -static void EXFUN( obj_coff_type,(void)); -static void EXFUN( obj_coff_val,(void)); -static void EXFUN( obj_coff_section,(void)); -static void EXFUN( tag_init,(void)); -static void EXFUN( tag_insert,(char *name, symbolS *symbolP)); - - -static struct hash_control *tag_hash; -static symbolS *def_symbol_in_progress = NULL; - -const pseudo_typeS obj_pseudo_table[] = { - { "def", obj_coff_def, 0 }, - { "dim", obj_coff_dim, 0 }, - { "endef", obj_coff_endef, 0 }, - { "line", obj_coff_line, 0 }, - { "ln", obj_coff_ln, 0 }, - { "scl", obj_coff_scl, 0 }, - { "size", obj_coff_size, 0 }, - { "tag", obj_coff_tag, 0 }, - { "type", obj_coff_type, 0 }, - { "val", obj_coff_val, 0 }, - { "section", obj_coff_section, 0 }, - { "text", obj_coff_text, 0 }, - { "data", obj_coff_data, 0 }, - /* we don't yet handle this. */ - { "ident", s_ignore, 0 }, - { "ABORT", s_abort, 0 }, - { "lcomm", obj_coff_lcomm, 0}, - { NULL} /* end sentinel */ -}; /* obj_pseudo_table */ - - - -/* Section stuff - - We allow more than just the standard 3 sections, infact, we allow - 10 sections, (though the usual three have to be there). - - This structure performs the mappings for us: - -*/ - -/* OBS stuff -static struct internal_scnhdr bss_section_header; -struct internal_scnhdr data_section_header; -struct internal_scnhdr text_section_header; - -const segT N_TYPE_seg [32] = -{ - -}; - -*/ - -#define N_SEG 32 -typedef struct -{ - segT seg_t; -int i; -} seg_info_type; - -seg_info_type seg_info_off_by_4[N_SEG] = -{ -{SEG_PTV, }, -{SEG_NTV, }, -{SEG_DEBUG, }, -{SEG_ABSOLUTE, }, -{SEG_UNKNOWN, }, -{SEG_E0}, -{SEG_E1}, -{SEG_E2}, -{SEG_E3}, -{SEG_E4}, -{SEG_E5}, -{SEG_E6}, -{SEG_E7}, -{SEG_E8}, -{SEG_E9}, -{15}, -{16}, -{17}, -{18}, -{19}, -{20}, -{0}, -{0}, -{0}, -{SEG_REGISTER},0,0,0,0}; - -#define SEG_INFO_FROM_SECTION_NUMBER(x) (seg_info_off_by_4[(x)+4]) -#define SEG_INFO_FROM_SEG_NUMBER(x) (seg_info_off_by_4[(x)]) - - -static relax_addressT -DEFUN(relax_align,(address, alignment), -register relax_addressT address AND -register long alignment ) -{ - relax_addressT mask; - relax_addressT new_address; - - mask = ~ ( (~0) << alignment ); - new_address = (address + mask) & (~ mask); - return (new_address - address); -} /* relax_align() */ - - -segT -DEFUN(s_get_segment,(x) , -symbolS* x) -{ - return SEG_INFO_FROM_SECTION_NUMBER(x->sy_symbol.ost_entry.n_scnum).seg_t; -} - - - -/* calculate the size of the frag chain and fill in the section header - to contain all of it, also fill in the addr of the sections */ -static unsigned int DEFUN(size_section,(abfd, idx), - bfd *abfd AND - unsigned int idx) -{ - - unsigned int size = 0; - fragS *frag = segment_info[idx].frchainP->frch_root; - while (frag) { - if (frag->fr_address != size) { - printf("Out of step\n"); - size = frag->fr_address; - } - size += frag->fr_fix; - switch (frag->fr_type) { - case rs_fill: - case rs_org: - size += frag->fr_offset * frag->fr_var; - break; - case rs_align: - size += relax_align(size, frag->fr_offset); - } - frag = frag->fr_next; - } - segment_info[idx].scnhdr.s_size = size; - return size; -} - - -static unsigned int DEFUN(count_entries_in_chain,(idx), - unsigned int idx) -{ - unsigned int nrelocs; - fixS *fixup_ptr; - - /* Count the relocations */ - fixup_ptr = segment_info[idx].fix_root; - nrelocs = 0; - while (fixup_ptr != (fixS *)NULL) - { - if (TC_COUNT_RELOC(fixup_ptr)) - { - -#ifdef TC_A29K - - if (fixup_ptr->fx_r_type == RELOC_CONSTH) - nrelocs+=2; - else - nrelocs++; -#else - nrelocs++; -#endif - } - - fixup_ptr = fixup_ptr->fx_next; - } - return nrelocs; -} - -/* output all the relocations for a section */ -void DEFUN(do_relocs_for,(abfd, file_cursor), - bfd *abfd AND - unsigned long *file_cursor) -{ - unsigned int nrelocs; - - - - unsigned int idx; - - - - - for (idx = SEG_E0; idx < SEG_E9; idx++) - { - if (segment_info[idx].scnhdr.s_name[0]) - { - - struct external_reloc *ext_ptr; - struct external_reloc *external_reloc_vec; - unsigned int external_reloc_size; - unsigned int count = 0; - unsigned int base = segment_info[idx].scnhdr.s_paddr; - fixS * fix_ptr = segment_info[idx].fix_root; - nrelocs = count_entries_in_chain(idx); - external_reloc_size = nrelocs * RELSZ; - external_reloc_vec = - (struct external_reloc*)malloc(external_reloc_size); - - - - ext_ptr = external_reloc_vec; - - /* Fill in the internal coff style reloc struct from the - internal fix list */ - while (fix_ptr) - { - symbolS *symbol_ptr; - struct internal_reloc intr; - - /* Only output some of the relocations */ - if (TC_COUNT_RELOC(fix_ptr)) - { - symbolS *dot; - symbol_ptr = fix_ptr->fx_addsy; - - intr.r_type = TC_COFF_FIX2RTYPE(fix_ptr); - intr.r_vaddr = base + fix_ptr->fx_frag->fr_address + fix_ptr->fx_where ; - - - /* Turn the segment of the symbol into an offset - */ - dot = - segment_info[S_GET_SEGMENT(symbol_ptr)].dot; - - if (dot) - { - intr.r_symndx = dot->sy_number; - } - else - { - intr.r_symndx = symbol_ptr->sy_number; - } - - - (void)bfd_coff_swap_reloc_out(abfd, &intr, ext_ptr); - ext_ptr++; - -#if defined(TC_A29K) - /* The 29k has a special kludge for the high 16 bit reloc. - Two relocations are emmited, R_IHIHALF, and - R_IHCONST. The second one doesn't contain a symbol, - but uses the value for offset */ - - if (intr.r_type == R_IHIHALF) - { - /* now emit the second bit */ - intr.r_type = R_IHCONST; - intr.r_symndx = fix_ptr->fx_addnumber; - (void)bfd_coff_swap_reloc_out(abfd,&intr,ext_ptr); - ext_ptr++; - } -#endif - } - - fix_ptr = fix_ptr->fx_next; - } - - /* Write out the reloc table */ - segment_info[idx].scnhdr.s_relptr = *file_cursor; - segment_info[idx].scnhdr.s_nreloc = nrelocs; - bfd_write((PTR)external_reloc_vec, 1, external_reloc_size, abfd); - *file_cursor += external_reloc_size; - free( external_reloc_vec); - } - } -} - - -/* run through a frag chain and write out the data to go with it, fill - in the scnhdrs with the info on the file postions -*/ -static void DEFUN(fill_section,(abfd, filehdr, file_cursor), - bfd *abfd AND - struct internal_filehdr *filehdr AND - unsigned long *file_cursor) -{ - - unsigned int i; - unsigned int paddr = 0; - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - unsigned int offset = 0; - - struct internal_scnhdr *s = &( segment_info[i].scnhdr); - - if (s->s_name[0]) - { - fragS *frag = segment_info[i].frchainP->frch_root; - char *buffer = malloc(s->s_size); - s->s_scnptr = *file_cursor; - s->s_paddr = paddr; - s->s_vaddr = paddr; - - s->s_flags = STYP_REG; - if (strcmp(s->s_name,".text")==0) - s->s_flags |= STYP_TEXT; - else if (strcmp(s->s_name,".data")==0) - s->s_flags |= STYP_DATA; - else if (strcmp(s->s_name,".bss")==0) - s->s_flags |= STYP_BSS | STYP_NOLOAD; - - while (frag) { - unsigned int fill_size; - switch (frag->fr_type) { - - case rs_fill: - case rs_align: - case rs_org: - if(frag->fr_fix) - { - memcpy(buffer + frag->fr_address, - frag->fr_literal, - frag->fr_fix); - offset += frag->fr_fix; - } - - fill_size = frag->fr_var; - if (fill_size) - { - unsigned int count ; - unsigned int off = frag->fr_fix; - for (count = frag->fr_offset; count; count--) - { - memcpy(buffer + frag->fr_address + off, - frag->fr_literal + frag->fr_fix, - fill_size); - off += fill_size; - offset += fill_size; - - } - - } - break; - default: - abort(); - } - frag = frag->fr_next; - } - - - bfd_write(buffer, s->s_size,1,abfd); - free(buffer); - - *file_cursor += s->s_size; - paddr += s->s_size; - } - } - -} - - - -/* Coff file generation & utilities */ - - -static void -DEFUN(coff_header_append,(abfd, filehdr, aouthdr), - bfd *abfd AND - struct internal_filehdr *filehdr AND - struct internal_aouthdr *aouthdr) -{ - unsigned int i; - char buffer[1000]; - char buffero[1000]; - - bfd_seek(abfd, 0, 0); -#if 0 - filehdr.f_opthdr = bfd_coff_swap_aouthdr_out(abfd, aouthdr, - buffero); -#else - filehdr->f_opthdr = 0; -#endif - i = bfd_coff_swap_filehdr_out(abfd, filehdr, buffer); - - bfd_write(buffer, i ,1, abfd); - bfd_write(buffero, filehdr->f_opthdr, 1, abfd); - - for (i = SEG_E0; i < SEG_E9; i++) - { - if (segment_info[i].scnhdr.s_name[0]) - { - unsigned int size = - bfd_coff_swap_scnhdr_out(abfd, - &(segment_info[i].scnhdr), - buffer); - bfd_write(buffer, size, 1, abfd); - } - } -} - - -char * -DEFUN(symbol_to_chars,(abfd, where, symbolP), - bfd*abfd AND - char *where AND - symbolS *symbolP) -{ - unsigned int numaux = symbolP->sy_symbol.ost_entry.n_numaux; - unsigned int i; - - /* Turn any symbols with register attributes into abs symbols */ - if (S_GET_SEGMENT(symbolP) == SEG_REGISTER) - { - S_SET_SEGMENT(symbolP, SEG_ABSOLUTE); - } - /* At the same time, relocate all symbols to their output value */ - - S_SET_VALUE(symbolP, - segment_info[S_GET_SEGMENT(symbolP)].scnhdr.s_paddr - + S_GET_VALUE(symbolP)); - - where += bfd_coff_swap_sym_out(abfd, &symbolP->sy_symbol.ost_entry, - where); - - for (i = 0; i < numaux; i++) - { - where += bfd_coff_swap_aux_out(abfd, - &symbolP->sy_symbol.ost_auxent[i], - S_GET_DATA_TYPE(symbolP), - S_GET_STORAGE_CLASS(symbolP), - where); - } - return where; - -} - - - - -void obj_symbol_new_hook(symbolP) -symbolS *symbolP; -{ - char underscore = 0; /* Symbol has leading _ */ - - /* Effective symbol */ - /* Store the pointer in the offset. */ - S_SET_ZEROES(symbolP, 0L); - S_SET_DATA_TYPE(symbolP, T_NULL); - S_SET_STORAGE_CLASS(symbolP, 0); - S_SET_NUMBER_AUXILIARY(symbolP, 0); - /* Additional information */ - symbolP->sy_symbol.ost_flags = 0; - /* Auxiliary entries */ - bzero((char*)&symbolP->sy_symbol.ost_auxent[0], AUXESZ); - -#ifdef STRIP_UNDERSCORE - /* Remove leading underscore at the beginning of the symbol. - * This is to be compatible with the standard librairies. - */ - if (*S_GET_NAME(symbolP) == '_') { - underscore = 1; - S_SET_NAME(symbolP, S_GET_NAME(symbolP) + 1); - } /* strip underscore */ -#endif /* STRIP_UNDERSCORE */ - - if (S_IS_STRING(symbolP)) - SF_SET_STRING(symbolP); - if (!underscore && S_IS_LOCAL(symbolP)) - SF_SET_LOCAL(symbolP); - - return; -} /* obj_symbol_new_hook() */ - - /* stack stuff */ -stack* stack_init(chunk_size, element_size) -unsigned long chunk_size; -unsigned long element_size; -{ - stack* st; - - if ((st = (stack*)malloc(sizeof(stack))) == (stack*)0) - return (stack*)0; - if ((st->data = malloc(chunk_size)) == (char*)0) { - free(st); - return (stack*)0; - } - st->pointer = 0; - st->size = chunk_size; - st->chunk_size = chunk_size; - st->element_size = element_size; - return st; -} /* stack_init() */ - -void stack_delete(st) -stack* st; -{ - free(st->data); - free(st); -} - -char *stack_push(st, element) -stack *st; -char *element; -{ - if (st->pointer + st->element_size >= st->size) { - st->size += st->chunk_size; - if ((st->data = xrealloc(st->data, st->size)) == (char*)0) - return (char*)0; - } - memcpy(st->data + st->pointer, element, st->element_size); - st->pointer += st->element_size; - return st->data + st->pointer; -} /* stack_push() */ - -char* stack_pop(st) -stack* st; -{ - if ((st->pointer -= st->element_size) < 0) { - st->pointer = 0; - return (char*)0; - } - - return st->data + st->pointer; -} - -char* stack_top(st) -stack* st; -{ - return st->data + st->pointer - st->element_size; -} - - -/* - * Handle .ln directives. - */ - -static void obj_coff_ln() { - if (def_symbol_in_progress != NULL) { - as_warn(".ln pseudo-op inside .def/.endef: ignored."); - demand_empty_rest_of_line(); - return; - } /* wrong context */ - - c_line_new(0, - obstack_next_free(&frags) - frag_now->fr_literal, - get_absolute_expression(), - frag_now); - - demand_empty_rest_of_line(); - return; -} /* obj_coff_line() */ - -/* - * def() - * - * Handle .def directives. - * - * One might ask : why can't we symbol_new if the symbol does not - * already exist and fill it with debug information. Because of - * the C_EFCN special symbol. It would clobber the value of the - * function symbol before we have a chance to notice that it is - * a C_EFCN. And a second reason is that the code is more clear this - * way. (at least I think it is :-). - * - */ - -#define SKIP_SEMI_COLON() while (*input_line_pointer++ != ';') -#define SKIP_WHITESPACES() while (*input_line_pointer == ' ' || \ - *input_line_pointer == '\t') \ - input_line_pointer++; - -static void -DEFUN(obj_coff_def,(what), - int what) -{ - char name_end; /* Char after the end of name */ - char *symbol_name; /* Name of the debug symbol */ - char *symbol_name_copy; /* Temporary copy of the name */ - unsigned int symbol_name_length; - /*$char* directiveP;$ */ /* Name of the pseudo opcode */ - /*$char directive[MAX_DIRECTIVE];$ */ /* Backup of the directive */ - /*$char end = 0;$ */ /* If 1, stop parsing */ - - if (def_symbol_in_progress != NULL) { - as_warn(".def pseudo-op used inside of .def/.endef: ignored."); - demand_empty_rest_of_line(); - return; - } /* if not inside .def/.endef */ - - SKIP_WHITESPACES(); - - def_symbol_in_progress = (symbolS *) obstack_alloc(¬es, sizeof(*def_symbol_in_progress)); - bzero(def_symbol_in_progress, sizeof(*def_symbol_in_progress)); - - symbol_name = input_line_pointer; - name_end = get_symbol_end(); - symbol_name_length = strlen(symbol_name); - symbol_name_copy = xmalloc(symbol_name_length + 1); - strcpy(symbol_name_copy, symbol_name); - - /* Initialize the new symbol */ -#ifdef STRIP_UNDERSCORE - S_SET_NAME(def_symbol_in_progress, (*symbol_name_copy == '_' - ? symbol_name_copy + 1 - : symbol_name_copy)); -#else /* STRIP_UNDERSCORE */ - S_SET_NAME(def_symbol_in_progress, symbol_name_copy); -#endif /* STRIP_UNDERSCORE */ - /* free(symbol_name_copy); */ - def_symbol_in_progress->sy_name_offset = ~0; - def_symbol_in_progress->sy_number = ~0; - def_symbol_in_progress->sy_frag = &zero_address_frag; - - if (S_IS_STRING(def_symbol_in_progress)) { - SF_SET_STRING(def_symbol_in_progress); - } /* "long" name */ - - *input_line_pointer = name_end; - - demand_empty_rest_of_line(); - return; -} /* obj_coff_def() */ - -unsigned int dim_index; -static void -DEFUN_VOID(obj_coff_endef) -{ - symbolS *symbolP = 0; - /* DIM BUG FIX sac@cygnus.com */ - dim_index =0; - if (def_symbol_in_progress == NULL) { - as_warn(".endef pseudo-op used outside of .def/.endef: ignored."); - demand_empty_rest_of_line(); - return; - } /* if not inside .def/.endef */ - - /* Set the section number according to storage class. */ - switch (S_GET_STORAGE_CLASS(def_symbol_in_progress)) { - case C_STRTAG: - case C_ENTAG: - case C_UNTAG: - SF_SET_TAG(def_symbol_in_progress); - /* intentional fallthrough */ - case C_FILE: - case C_TPDEF: - SF_SET_DEBUG(def_symbol_in_progress); - S_SET_SEGMENT(def_symbol_in_progress, SEG_DEBUG); - break; - - case C_EFCN: - SF_SET_LOCAL(def_symbol_in_progress); /* Do not emit this symbol. */ - /* intentional fallthrough */ - case C_BLOCK: - SF_SET_PROCESS(def_symbol_in_progress); /* Will need processing before writing */ - /* intentional fallthrough */ - case C_FCN: - S_SET_SEGMENT(def_symbol_in_progress, SEG_E0); - - if (def_symbol_in_progress->sy_symbol.ost_entry.n_name[1] == 'b') { /* .bf */ - if (function_lineoff < 0) { - fprintf(stderr, "`.bf' symbol without preceding function\n"); - } /* missing function symbol */ - SA_GET_SYM_LNNOPTR(def_symbol_in_progress) = function_lineoff; - SF_SET_PROCESS(def_symbol_in_progress); /* Will need relocating */ - function_lineoff = -1; - } - break; - -#ifdef C_AUTOARG - case C_AUTOARG: -#endif /* C_AUTOARG */ - case C_AUTO: - case C_REG: - case C_MOS: - case C_MOE: - case C_MOU: - case C_ARG: - case C_REGPARM: - case C_FIELD: - case C_EOS: - SF_SET_DEBUG(def_symbol_in_progress); - S_SET_SEGMENT(def_symbol_in_progress, SEG_ABSOLUTE); - break; - - case C_EXT: - case C_STAT: - case C_LABEL: - /* Valid but set somewhere else (s_comm, s_lcomm, colon) */ - break; - - case C_USTATIC: - case C_EXTDEF: - case C_ULABEL: - as_warn("unexpected storage class %d", S_GET_STORAGE_CLASS(def_symbol_in_progress)); - break; - } /* switch on storage class */ - - /* Now that we have built a debug symbol, try to - find if we should merge with an existing symbol - or not. If a symbol is C_EFCN or SEG_ABSOLUTE or - untagged SEG_DEBUG it never merges. */ - - /* Two cases for functions. Either debug followed - by definition or definition followed by debug. - For definition first, we will merge the debug - symbol into the definition. For debug first, the - lineno entry MUST point to the definition - function or else it will point off into space - when crawl_symbols() merges the debug - symbol into the real symbol. Therefor, let's - presume the debug symbol is a real function - reference. */ - - /* FIXME-SOON If for some reason the definition - label/symbol is never seen, this will probably - leave an undefined symbol at link time. */ - - if (S_GET_STORAGE_CLASS(def_symbol_in_progress) == C_EFCN - || (S_GET_SEGMENT(def_symbol_in_progress) == SEG_DEBUG - && !SF_GET_TAG(def_symbol_in_progress)) - || S_GET_SEGMENT(def_symbol_in_progress) == SEG_ABSOLUTE - || (symbolP = symbol_find_base(S_GET_NAME(def_symbol_in_progress), DO_NOT_STRIP)) == NULL) { - - symbol_append(def_symbol_in_progress, symbol_lastP, &symbol_rootP, &symbol_lastP); - - } else { - /* This symbol already exists, merge the - newly created symbol into the old one. - This is not mandatory. The linker can - handle duplicate symbols correctly. But I - guess that it save a *lot* of space if - the assembly file defines a lot of - symbols. [loic] */ - - /* The debug entry (def_symbol_in_progress) - is merged into the previous definition. */ - - c_symbol_merge(def_symbol_in_progress, symbolP); - /* FIXME-SOON Should *def_symbol_in_progress be free'd? xoxorich. */ - def_symbol_in_progress = symbolP; - - if (SF_GET_FUNCTION(def_symbol_in_progress) - || SF_GET_TAG(def_symbol_in_progress)) { - /* For functions, and tags, the symbol *must* be where the debug symbol - appears. Move the existing symbol to the current place. */ - /* If it already is at the end of the symbol list, do nothing */ - if (def_symbol_in_progress != symbol_lastP) { - symbol_remove(def_symbol_in_progress, &symbol_rootP, &symbol_lastP); - symbol_append(def_symbol_in_progress, symbol_lastP, &symbol_rootP, &symbol_lastP); - } /* if not already in place */ - } /* if function */ - } /* normal or mergable */ - - if (SF_GET_TAG(def_symbol_in_progress) - && symbol_find_base(S_GET_NAME(def_symbol_in_progress), DO_NOT_STRIP) == NULL) { - tag_insert(S_GET_NAME(def_symbol_in_progress), def_symbol_in_progress); - } /* If symbol is a {structure,union} tag, associate symbol to its name. */ - - if (SF_GET_FUNCTION(def_symbol_in_progress)) { - know(sizeof(def_symbol_in_progress) <= sizeof(long)); - function_lineoff - = c_line_new((long) - def_symbol_in_progress,0, 0, &zero_address_frag); - - - - SF_SET_PROCESS(def_symbol_in_progress); - - if (symbolP == NULL) { - /* That is, if this is the first - time we've seen the function... */ - symbol_table_insert(def_symbol_in_progress); - } /* definition follows debug */ - } /* Create the line number entry pointing to the function being defined */ - - def_symbol_in_progress = NULL; - demand_empty_rest_of_line(); - return; -} /* obj_coff_endef() */ - -static void -DEFUN_VOID(obj_coff_dim) -{ - register int dim_index; - - if (def_symbol_in_progress == NULL) - { - as_warn(".dim pseudo-op used outside of .def/.endef: ignored."); - demand_empty_rest_of_line(); - return; - } /* if not inside .def/.endef */ - - S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1); - - for (dim_index = 0; dim_index < DIMNUM; dim_index++) - { - SKIP_WHITESPACES(); - SA_SET_SYM_DIMEN(def_symbol_in_progress, dim_index, get_absolute_expression()); - - switch (*input_line_pointer) - { - - case ',': - input_line_pointer++; - break; - - default: - as_warn("badly formed .dim directive ignored"); - /* intentional fallthrough */ - case '\n': - case ';': - dim_index = DIMNUM; - break; - } /* switch on following character */ - } /* for each dimension */ - - demand_empty_rest_of_line(); - return; -} /* obj_coff_dim() */ - -static void obj_coff_line() { - if (def_symbol_in_progress == NULL) { - obj_coff_ln(); - return; - } /* if it looks like a stabs style line */ - - S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1); - SA_SET_SYM_LNNO(def_symbol_in_progress, get_absolute_expression()); - - demand_empty_rest_of_line(); - return; -} /* obj_coff_line() */ - -static void obj_coff_size() { - if (def_symbol_in_progress == NULL) { - as_warn(".size pseudo-op used outside of .def/.endef ignored."); - demand_empty_rest_of_line(); - return; - } /* if not inside .def/.endef */ - - S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1); - SA_SET_SYM_SIZE(def_symbol_in_progress, get_absolute_expression()); - demand_empty_rest_of_line(); - return; -} /* obj_coff_size() */ - -static void obj_coff_scl() { - if (def_symbol_in_progress == NULL) { - as_warn(".scl pseudo-op used outside of .def/.endef ignored."); - demand_empty_rest_of_line(); - return; - } /* if not inside .def/.endef */ - - S_SET_STORAGE_CLASS(def_symbol_in_progress, get_absolute_expression()); - demand_empty_rest_of_line(); - return; -} /* obj_coff_scl() */ - -static void obj_coff_tag() { - char *symbol_name; - char name_end; - - if (def_symbol_in_progress == NULL) { - as_warn(".tag pseudo-op used outside of .def/.endef ignored."); - demand_empty_rest_of_line(); - return; - } /* if not inside .def/.endef */ - - S_SET_NUMBER_AUXILIARY(def_symbol_in_progress, 1); - symbol_name = input_line_pointer; - name_end = get_symbol_end(); - - /* Assume that the symbol referred to by .tag is always defined. */ - /* This was a bad assumption. I've added find_or_make. xoxorich. */ - SA_SET_SYM_TAGNDX(def_symbol_in_progress, (long) tag_find_or_make(symbol_name)); - if (SA_GET_SYM_TAGNDX(def_symbol_in_progress) == 0L) { - as_warn("tag not found for .tag %s", symbol_name); - } /* not defined */ - - SF_SET_TAGGED(def_symbol_in_progress); - *input_line_pointer = name_end; - - demand_empty_rest_of_line(); - return; -} /* obj_coff_tag() */ - -static void obj_coff_type() { - if (def_symbol_in_progress == NULL) { - as_warn(".type pseudo-op used outside of .def/.endef ignored."); - demand_empty_rest_of_line(); - return; - } /* if not inside .def/.endef */ - - S_SET_DATA_TYPE(def_symbol_in_progress, get_absolute_expression()); - - if (ISFCN(S_GET_DATA_TYPE(def_symbol_in_progress)) && - S_GET_STORAGE_CLASS(def_symbol_in_progress) != C_TPDEF) { - SF_SET_FUNCTION(def_symbol_in_progress); - } /* is a function */ - - demand_empty_rest_of_line(); - return; -} /* obj_coff_type() */ - -static void obj_coff_val() { - if (def_symbol_in_progress == NULL) { - as_warn(".val pseudo-op used outside of .def/.endef ignored."); - demand_empty_rest_of_line(); - return; - } /* if not inside .def/.endef */ - - if (is_name_beginner(*input_line_pointer)) { - char *symbol_name = input_line_pointer; - char name_end = get_symbol_end(); - - if (!strcmp(symbol_name, ".")) { - def_symbol_in_progress->sy_frag = frag_now; - S_SET_VALUE(def_symbol_in_progress, obstack_next_free(&frags) - frag_now->fr_literal); - /* If the .val is != from the .def (e.g. statics) */ - } else if (strcmp(S_GET_NAME(def_symbol_in_progress), symbol_name)) { - def_symbol_in_progress->sy_forward = symbol_find_or_make(symbol_name); - - /* If the segment is undefined when the forward - reference is solved, then copy the segment id - from the forward symbol. */ - SF_SET_GET_SEGMENT(def_symbol_in_progress); - } - /* Otherwise, it is the name of a non debug symbol and its value will be calculated later. */ - *input_line_pointer = name_end; - } else { - S_SET_VALUE(def_symbol_in_progress, get_absolute_expression()); - } /* if symbol based */ - - demand_empty_rest_of_line(); - return; -} /* obj_coff_val() */ - -/* - * Maintain a list of the tagnames of the structres. - */ - -static void tag_init() { - tag_hash = hash_new(); - return ; -} /* tag_init() */ - -static void tag_insert(name, symbolP) -char *name; -symbolS *symbolP; -{ - register char * error_string; - - if (*(error_string = hash_jam(tag_hash, name, (char *)symbolP))) { - as_fatal("Inserting \"%s\" into structure table failed: %s", - name, error_string); - } - return ; -} /* tag_insert() */ - -static symbolS *tag_find_or_make(name) -char *name; -{ - symbolS *symbolP; - - if ((symbolP = tag_find(name)) == NULL) { - symbolP = symbol_new(name, - SEG_UNKNOWN, - 0, - &zero_address_frag); - - tag_insert(S_GET_NAME(symbolP), symbolP); - symbol_table_insert(symbolP); - } /* not found */ - - return(symbolP); -} /* tag_find_or_make() */ - -static symbolS *tag_find(name) -char *name; -{ -#ifdef STRIP_UNDERSCORE - if (*name == '_') name++; -#endif /* STRIP_UNDERSCORE */ - return((symbolS*)hash_find(tag_hash, name)); -} /* tag_find() */ - -void obj_read_begin_hook() { - /* These had better be the same. Usually 18 bytes. */ -#ifndef BFD_HEADERS - know(sizeof(SYMENT) == sizeof(AUXENT)); - know(SYMESZ == AUXESZ); -#endif - tag_init(); - - return; -} /* obj_read_begin_hook() */ - -/* This function runs through the symbol table and puts all the - externals onto another chain */ - -/* The chain of externals */ -symbolS *symbol_externP = NULL; -symbolS *symbol_extern_lastP = NULL; - -stack*block_stack; - symbolS *last_functionP = NULL; - symbolS *last_tagP; - - -static unsigned int DEFUN_VOID(yank_symbols) -{ - symbolS *symbolP; - unsigned int symbol_number =0; - - for (symbolP = symbol_rootP; - symbolP; - symbolP = symbolP ? symbol_next(symbolP) : symbol_rootP) { - if (!SF_GET_DEBUG(symbolP)) { - /* Debug symbols do not need all this rubbish */ - symbolS* real_symbolP; - - /* L* and C_EFCN symbols never merge. */ - if (!SF_GET_LOCAL(symbolP) - && (real_symbolP = symbol_find_base(S_GET_NAME(symbolP), DO_NOT_STRIP)) - && real_symbolP != symbolP) { - /* FIXME-SOON: where do dups come from? - Maybe tag references before definitions? xoxorich. */ - /* Move the debug data from the debug symbol to the - real symbol. Do NOT do the oposite (i.e. move from - real symbol to debug symbol and remove real symbol from the - list.) Because some pointers refer to the real symbol - whereas no pointers refer to the debug symbol. */ - c_symbol_merge(symbolP, real_symbolP); - /* Replace the current symbol by the real one */ - /* The symbols will never be the last or the first - because : 1st symbol is .file and 3 last symbols are - .text, .data, .bss */ - symbol_remove(real_symbolP, &symbol_rootP, &symbol_lastP); - symbol_insert(real_symbolP, symbolP, &symbol_rootP, &symbol_lastP); - symbol_remove(symbolP, &symbol_rootP, &symbol_lastP); - symbolP = real_symbolP; - } /* if not local but dup'd */ - - if (flagseen['R'] && (S_GET_SEGMENT(symbolP) == SEG_E1)) { - S_SET_SEGMENT(symbolP, SEG_E0); - } /* push data into text */ - - S_SET_VALUE(symbolP, - S_GET_VALUE(symbolP) + symbolP->sy_frag->fr_address); - - if (!S_IS_DEFINED(symbolP) && !SF_GET_LOCAL(symbolP)) - { - S_SET_EXTERNAL(symbolP); - } - else if (S_GET_STORAGE_CLASS(symbolP) == C_NULL) - { - if (S_GET_SEGMENT(symbolP) == SEG_E0) - { - S_SET_STORAGE_CLASS(symbolP, C_LABEL); - } - else - { - S_SET_STORAGE_CLASS(symbolP, C_STAT); - } - } - - /* Mainly to speed up if not -g */ - if (SF_GET_PROCESS(symbolP)) - { - /* Handle the nested blocks auxiliary info. */ - if (S_GET_STORAGE_CLASS(symbolP) == C_BLOCK) { - if (!strcmp(S_GET_NAME(symbolP), ".bb")) - stack_push(block_stack, (char *) &symbolP); - else { /* .eb */ - register symbolS* begin_symbolP; - begin_symbolP = *(symbolS**)stack_pop(block_stack); - if (begin_symbolP == (symbolS*)0) - as_warn("mismatched .eb"); - else - SA_SET_SYM_ENDNDX(begin_symbolP, symbol_number+2); - } - } - /* If we are able to identify the type of a function, and we - are out of a function (last_functionP == 0) then, the - function symbol will be associated with an auxiliary - entry. */ - if (last_functionP == (symbolS*)0 && - SF_GET_FUNCTION(symbolP)) { - last_functionP = symbolP; - - if (S_GET_NUMBER_AUXILIARY(symbolP) < 1) { - S_SET_NUMBER_AUXILIARY(symbolP, 1); - } /* make it at least 1 */ - - /* Clobber possible stale .dim information. */ - bzero(symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen, - sizeof(symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen)); - } - /* The C_FCN doesn't need any additional information. - I don't even know if this is needed for sdb. But the - standard assembler generates it, so... - */ - if (S_GET_STORAGE_CLASS(symbolP) == C_EFCN) { - if (last_functionP == (symbolS*)0) - as_fatal("C_EFCN symbol out of scope"); - SA_SET_SYM_FSIZE(last_functionP, - (long)(S_GET_VALUE(symbolP) - - S_GET_VALUE(last_functionP))); - SA_SET_SYM_ENDNDX(last_functionP, symbol_number); - last_functionP = (symbolS*)0; - } - } - } else if (SF_GET_TAG(symbolP)) { - /* First descriptor of a structure must point to - the first slot after the structure description. */ - last_tagP = symbolP; - - } else if (S_GET_STORAGE_CLASS(symbolP) == C_EOS) { - /* +2 take in account the current symbol */ - SA_SET_SYM_ENDNDX(last_tagP, symbol_number + 2); - } else if (S_GET_STORAGE_CLASS(symbolP) == C_FILE) { - if (S_GET_VALUE(symbolP)) { - S_SET_VALUE((symbolS *) S_GET_VALUE(symbolP), symbol_number); - S_SET_VALUE(symbolP, 0); - } /* no one points at the first .file symbol */ - } /* if debug or tag or eos or file */ - - /* We must put the external symbols apart. The loader - does not bomb if we do not. But the references in - the endndx field for a .bb symbol are not corrected - if an external symbol is removed between .bb and .be. - I.e in the following case : - [20] .bb endndx = 22 - [21] foo external - [22] .be - ld will move the symbol 21 to the end of the list but - endndx will still be 22 instead of 21. */ - - - if (SF_GET_LOCAL(symbolP)) { - /* remove C_EFCN and LOCAL (L...) symbols */ - /* next pointer remains valid */ - symbol_remove(symbolP, &symbol_rootP, &symbol_lastP); - - } - else if (!S_IS_DEFINED(symbolP) - && !S_IS_DEBUG(symbolP) - && !SF_GET_STATICS(symbolP) && - S_GET_STORAGE_CLASS(symbolP) == C_EXT) - { /* C_EXT && !SF_GET_FUNCTION(symbolP)) */ - /* if external, Remove from the list */ - symbolS *hold = symbol_previous(symbolP); - - symbol_remove(symbolP, &symbol_rootP, &symbol_lastP); - symbol_clear_list_pointers(symbolP); - symbol_append(symbolP, symbol_extern_lastP, &symbol_externP, &symbol_extern_lastP); - symbolP = hold; - } else { - if (SF_GET_STRING(symbolP)) { - symbolP->sy_name_offset = string_byte_count; - string_byte_count += strlen(S_GET_NAME(symbolP)) + 1; - } else { - symbolP->sy_name_offset = 0; - } /* fix "long" names */ - - symbolP->sy_number = symbol_number; - symbol_number += 1 + S_GET_NUMBER_AUXILIARY(symbolP); - } /* if local symbol */ - } /* traverse the symbol list */ - return symbol_number; - -} - - -static unsigned int DEFUN_VOID(glue_symbols) -{ - unsigned int symbol_number = 0; - symbolS *symbolP; - for (symbolP = symbol_externP; symbol_externP;) { - symbolS *tmp = symbol_externP; - - /* append */ - symbol_remove(tmp, &symbol_externP, &symbol_extern_lastP); - symbol_append(tmp, symbol_lastP, &symbol_rootP, &symbol_lastP); - - /* and process */ - if (SF_GET_STRING(tmp)) { - tmp->sy_name_offset = string_byte_count; - string_byte_count += strlen(S_GET_NAME(tmp)) + 1; - } else { - tmp->sy_name_offset = 0; - } /* fix "long" names */ - - tmp->sy_number = symbol_number; - symbol_number += 1 + S_GET_NUMBER_AUXILIARY(tmp); - } /* append the entire extern chain */ - return symbol_number; - -} - -static unsigned int DEFUN_VOID(tie_tags) -{ - unsigned int symbol_number = 0; - - symbolS*symbolP; - for (symbolP = symbol_rootP; symbolP; symbolP = - symbol_next(symbolP)) - { - symbolP->sy_number = symbol_number; - - - - if (SF_GET_TAGGED(symbolP)) - { - SA_SET_SYM_TAGNDX - (symbolP, - ((symbolS*) SA_GET_SYM_TAGNDX(symbolP))->sy_number); - } - - symbol_number += 1 + S_GET_NUMBER_AUXILIARY(symbolP); - } - return symbol_number; - -} - -static void -DEFUN(crawl_symbols,(headers, abfd), - struct internal_filehdr *headers AND - bfd *abfd) -{ - - unsigned int i; - unsigned int ptr = 0; - - - symbolS *symbolP; - - /* Initialize the stack used to keep track of the matching .bb .be */ - - block_stack = stack_init(512, sizeof(symbolS*)); - /* JF deal with forward references first... */ - for (symbolP = symbol_rootP; - symbolP; - symbolP = symbol_next(symbolP)) - { - - if (symbolP->sy_forward) { - S_SET_VALUE(symbolP, (S_GET_VALUE(symbolP) - + S_GET_VALUE(symbolP->sy_forward) - + symbolP->sy_forward->sy_frag->fr_address)); - - if (SF_GET_GET_SEGMENT(symbolP)) { - S_SET_SEGMENT(symbolP, S_GET_SEGMENT(symbolP->sy_forward)); - } /* forward segment also */ - - symbolP->sy_forward=0; - } /* if it has a forward reference */ - } /* walk the symbol chain */ - - - /* The symbol list should be ordered according to the following sequence - * order : - * . .file symbol - * . debug entries for functions - * . fake symbols for the sections, including.text .data and .bss - * . defined symbols - * . undefined symbols - * But this is not mandatory. The only important point is to put the - * undefined symbols at the end of the list. - */ - - if (symbol_rootP == NULL - || S_GET_STORAGE_CLASS(symbol_rootP) != C_FILE) { - c_dot_file_symbol("fake"); - } - /* Is there a .file symbol ? If not insert one at the beginning. */ - - /* - * Build up static symbols for the sections, they are filled in later - */ - - - for (i = SEG_E0; i < SEG_E9; i++) - { - if (segment_info[i].scnhdr.s_name[0]) - { - segment_info[i].dot = - c_section_symbol(segment_info[i].scnhdr.s_name, - i-SEG_E0+1); - - } - } - - - /* Take all the externals out and put them into another chain */ - headers->f_nsyms = yank_symbols(); - /* Take the externals and glue them onto the end.*/ - headers->f_nsyms += glue_symbols(); - - headers->f_nsyms = tie_tags(); - know(symbol_externP == NULL); - know(symbol_extern_lastP == NULL); - - return; -} - -/* - * Find strings by crawling along symbol table chain. - */ - -void DEFUN(w_strings,(where), - char *where) -{ - symbolS *symbolP; - - /* Gotta do md_ byte-ordering stuff for string_byte_count first - KWK */ - md_number_to_chars(where, string_byte_count, sizeof(string_byte_count)); - where += sizeof(string_byte_count); - for (symbolP = symbol_rootP; - symbolP; - symbolP = symbol_next(symbolP)) - { - unsigned int size; - - if (SF_GET_STRING(symbolP)) { - size = strlen(S_GET_NAME(symbolP)) + 1; - - memcpy(where, S_GET_NAME(symbolP),size); - where += size; - - } - } - -} - - - - - -static void -DEFUN(do_linenos_for,(abfd, file_cursor), - bfd *abfd AND - unsigned long *file_cursor) -{ - unsigned int idx; - - for (idx = SEG_E0; idx < SEG_E9; idx++) - { - segment_info_type *s = segment_info + idx; - - if (s->scnhdr.s_nlnno != 0) - { - struct lineno_list *line_ptr ; - - struct external_lineno *buffer = - (struct external_lineno *)xmalloc(s->scnhdr.s_nlnno * LINESZ); - - struct external_lineno *dst= buffer; - - /* Run through the table we've built and turn it into its external - form */ - - for (line_ptr = s->lineno_list_head; - line_ptr != (struct lineno_list *)NULL; - line_ptr = line_ptr->next) - { - if (line_ptr->line.l_lnno == 0) - { - /* Turn a pointer to a symbol into the symbols' index */ - line_ptr->line.l_addr.l_symndx = - ( (symbolS *)line_ptr->line.l_addr.l_symndx)->sy_number; - } - (void) bfd_coff_swap_lineno_out(abfd, &(line_ptr->line), dst); - dst++; - } - - s->scnhdr.s_lnnoptr = *file_cursor; - - bfd_write(buffer, 1, s->scnhdr.s_nlnno* LINESZ, abfd); - free(buffer); - - *file_cursor += s->scnhdr.s_nlnno * LINESZ; - } - } -} - - -/* Now we run through the list of frag chains in a segment and - make all the subsegment frags appear at the end of the - list, as if the seg 0 was extra long */ - -static void DEFUN_VOID(remove_subsegs) -{ - unsigned int i; - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - frchainS *head = segment_info[i].frchainP; - fragS dummy; - fragS * prev_frag = &dummy; - - while (head && head->frch_seg == i) - { - prev_frag->fr_next = head->frch_root; - prev_frag = head->frch_last; - head = head->frch_next; - } - prev_frag->fr_next = 0; - } -} - - -extern void DEFUN_VOID(write_object_file) -{ - int i; - struct frchain *frchain_ptr; - - struct internal_filehdr filehdr; - struct internal_aouthdr aouthdr; - unsigned long file_cursor; - bfd *abfd; - unsigned int addr = 0; - abfd = bfd_openw(out_file_name, TARGET_FORMAT); - - - if (abfd == 0) { - as_perror ("FATAL: Can't create %s", out_file_name); - exit(42); - } - bfd_set_format(abfd, bfd_object); - bfd_set_arch_mach(abfd, BFD_ARCH, 0); - - - - string_byte_count = 4; - - for (frchain_ptr = frchain_root; - frchain_ptr != (struct frchain *)NULL; - frchain_ptr = frchain_ptr->frch_next) { - /* Run through all the sub-segments and align them up. Also close any - open frags. We tack a .fill onto the end of the frag chain so - that any .align's size can be worked by looking at the next - frag */ - - subseg_new(frchain_ptr->frch_seg, frchain_ptr->frch_subseg); -#define SUB_SEGMENT_ALIGN 1 - frag_align(SUB_SEGMENT_ALIGN,0); - frag_wane(frag_now); - frag_now->fr_fix = 0; - know( frag_now->fr_next == NULL ); - } - - - remove_subsegs(); - - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - relax_segment(segment_info[i].frchainP->frch_root, i); - } - - - - - - filehdr.f_nscns = 0; - - /* Find out how big the sections are */ - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - - if (segment_info[i].scnhdr.s_name[0]) - { - filehdr.f_nscns++; - } - segment_info[i].scnhdr.s_paddr = addr; - if (i == SEG_E2) { - /* THis is a special case, we leave the size alone, which will have */ - /* been made up from all and any lcomms seen */ - } - else { - addr += size_section(abfd, i); - } - } - - - - /* Turn the gas native symbol table shape into a coff symbol table */ - crawl_symbols(&filehdr, abfd); - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - fixup_segment(segment_info[i].fix_root, i); - } - - file_cursor = FILHSZ + SCNHSZ * filehdr.f_nscns ; - - bfd_seek(abfd, file_cursor, 0); - - - do_relocs_for(abfd, &file_cursor); - - do_linenos_for(abfd, &file_cursor); - - - /* Plant the data */ - - fill_section(abfd,&filehdr, &file_cursor); - - filehdr.f_magic = COFF_MAGIC; - filehdr.f_timdat = 0; - filehdr.f_flags = 0; - - - - { - - unsigned int symtable_size = filehdr.f_nsyms * SYMESZ; - char *buffer1 = malloc(symtable_size + string_byte_count + 4); - char *ptr = buffer1; - filehdr.f_symptr = bfd_tell(abfd); - w_symbols(abfd, buffer1, symbol_rootP); - w_strings(buffer1 + symtable_size); - bfd_write(buffer1, 1,symtable_size + string_byte_count + 4, abfd); - free(buffer1); - - } - coff_header_append(abfd, &filehdr, &aouthdr); - - bfd_close_all_done(abfd); -} - - -static void DEFUN(change_to_section,(name, len, exp), - char *name AND - unsigned int len AND - unsigned int exp) -{ - unsigned int i; - /* Find out if we've already got a section of this name etc */ - for(i = SEG_E0; i < SEG_E9 && segment_info[i].scnhdr.s_name[0] ; i++) - { - if (strncmp(segment_info[i].scnhdr.s_name, name, len) == 0) - { - subseg_new(i, exp); - return; - - } - } - /* No section, add one */ - strncpy(segment_info[i].scnhdr.s_name, name, 8); - subseg_new(i, exp); -} - -static void -DEFUN_VOID(obj_coff_section) -{ - /* Strip out the section name */ - char *section_name ; - char *section_name_end; - char c; - - unsigned int len; - unsigned int exp; - - section_name = input_line_pointer; - c = get_symbol_end(); - section_name_end = input_line_pointer; - - len = section_name_end - section_name ; - input_line_pointer++; - SKIP_WHITESPACE(); - if (c == ',') - { - exp = get_absolute_expression(); - } - else if ( *input_line_pointer == ',') - { - - input_line_pointer++; - exp = get_absolute_expression(); - } - else - { - exp = 0; - } - - change_to_section(section_name, len,exp); - -} - - -static void obj_coff_text() -{ - change_to_section(".text",5, get_absolute_expression()); -} - - -static void obj_coff_data() -{ - change_to_section(".data",5, get_absolute_expression()); -} - -void c_symbol_merge(debug, normal) -symbolS *debug; -symbolS *normal; -{ - S_SET_DATA_TYPE(normal, S_GET_DATA_TYPE(debug)); - S_SET_STORAGE_CLASS(normal, S_GET_STORAGE_CLASS(debug)); - - if (S_GET_NUMBER_AUXILIARY(debug) > S_GET_NUMBER_AUXILIARY(normal)) { - S_SET_NUMBER_AUXILIARY(normal, S_GET_NUMBER_AUXILIARY(debug)); - } /* take the most we have */ - - if (S_GET_NUMBER_AUXILIARY(debug) > 0) { - memcpy((char*)&normal->sy_symbol.ost_auxent[0], (char*)&debug->sy_symbol.ost_auxent[0], S_GET_NUMBER_AUXILIARY(debug) * AUXESZ); - } /* Move all the auxiliary information */ - - /* Move the debug flags. */ - SF_SET_DEBUG_FIELD(normal, SF_GET_DEBUG_FIELD(debug)); -} /* c_symbol_merge() */ - -static int -DEFUN(c_line_new,(symbol, paddr, line_number, frag), - symbolS *symbol AND - long paddr AND - unsigned short line_number AND - fragS* frag) -{ - struct lineno_list* new_line = - (struct lineno_list *)xmalloc(sizeof(struct lineno_list)); - - segment_info_type *s = segment_info + now_seg; - new_line->line.l_lnno = line_number; - if (line_number == 0) - { - new_line->line.l_addr.l_symndx = (long)symbol; - } - else - { - new_line->line.l_addr.l_paddr = paddr; - } - - new_line->frag = (char*)frag; - new_line->next = (struct lineno_list*)NULL; - - - if (s->lineno_list_head == (struct lineno_list *)NULL) - { - s->lineno_list_head = new_line; - } - else - { - s->lineno_list_tail->next = new_line; - } - s->lineno_list_tail = new_line; - return LINESZ * s->scnhdr.s_nlnno ++; -} - -void c_dot_file_symbol(filename) -char *filename; -{ - symbolS* symbolP; - - symbolP = symbol_new(".file", - SEG_DEBUG, - 0, - &zero_address_frag); - - S_SET_STORAGE_CLASS(symbolP, C_FILE); - S_SET_NUMBER_AUXILIARY(symbolP, 1); - SA_SET_FILE_FNAME(symbolP, filename); - SF_SET_DEBUG(symbolP); - S_SET_VALUE(symbolP, (long) previous_file_symbol); - - previous_file_symbol = symbolP; - - /* Make sure that the symbol is first on the symbol chain */ - if (symbol_rootP != symbolP) { - if (symbolP == symbol_lastP) { - symbol_lastP = symbol_lastP->sy_previous; - } /* if it was the last thing on the list */ - - symbol_remove(symbolP, &symbol_rootP, &symbol_lastP); - symbol_insert(symbolP, symbol_rootP, &symbol_rootP, &symbol_lastP); - symbol_rootP = symbolP; - } /* if not first on the list */ - -} /* c_dot_file_symbol() */ - -/* - * Build a 'section static' symbol. - */ - -symbolS *c_section_symbol(name,idx) -char *name; -int idx; -{ - symbolS *symbolP; - - symbolP = symbol_new(name,idx, - 0, - &zero_address_frag); - - S_SET_STORAGE_CLASS(symbolP, C_STAT); - S_SET_NUMBER_AUXILIARY(symbolP, 1); - - SF_SET_STATICS(symbolP); - - return symbolP; -} /* c_section_symbol() */ - -static void -DEFUN(w_symbols,(abfd, where, symbol_rootP), -bfd *abfd AND -char *where AND -symbolS *symbol_rootP) -{ - symbolS *symbolP; - unsigned int i; - - /* First fill in those values we have only just worked out */ - for (i = SEG_E0; i < SEG_E9; i++) - { - symbolP = segment_info[i].dot; - if (symbolP) - { - - SA_SET_SCN_SCNLEN(symbolP, segment_info[i].scnhdr.s_size); - SA_SET_SCN_NRELOC(symbolP, segment_info[i].scnhdr.s_nreloc); - SA_SET_SCN_NLINNO(symbolP, segment_info[i].scnhdr.s_nlnno); - - } - } - - /* - * Emit all symbols left in the symbol chain. - */ - for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) { - /* Used to save the offset of the name. It is used to point - to the string in memory but must be a file offset. */ - register char * temp; - - tc_coff_symbol_emit_hook(symbolP); - - temp = S_GET_NAME(symbolP); - if (SF_GET_STRING(symbolP)) { - S_SET_OFFSET(symbolP, symbolP->sy_name_offset); - S_SET_ZEROES(symbolP, 0); - } else { - bzero(symbolP->sy_symbol.ost_entry.n_name, SYMNMLEN); - strncpy(symbolP->sy_symbol.ost_entry.n_name, temp, SYMNMLEN); - } - where = symbol_to_chars(abfd, where, symbolP); - S_SET_NAME(symbolP,temp); - } - -} /* w_symbols() */ - -static void DEFUN_VOID(obj_coff_lcomm) -{ - char *name; - char c; - int temp; - char *p; - symbolS *symbolP; - name = input_line_pointer; - - - - c = get_symbol_end(); - p = input_line_pointer; - *p = c; - SKIP_WHITESPACE(); - if (*input_line_pointer != ',') { - as_bad("Expected comma after name"); - ignore_rest_of_line(); - return; - } - if (*input_line_pointer == '\n') { - as_bad("Missing size expression"); - return; - } - input_line_pointer++; - if ((temp = get_absolute_expression ()) < 0) { - as_warn("lcomm length (%d.) <0! Ignored.", temp); - ignore_rest_of_line(); - return; - } - *p = 0; - symbolP = symbol_find_or_make(name); - S_SET_VALUE(symbolP, segment_info[SEG_E2].scnhdr.s_size); - S_SET_SEGMENT(symbolP, SEG_E2); - segment_info[SEG_E2].scnhdr.s_size += temp; - S_SET_STORAGE_CLASS(symbolP, C_STAT); - demand_empty_rest_of_line(); -} - - -#if 1 -static void DEFUN(fixup_segment,(fixP, this_segment_type), -register fixS * fixP AND -segT this_segment_type) -{ - register symbolS *add_symbolP; - register symbolS *sub_symbolP; - register long add_number; - register int size; - register char *place; - register long where; - register char pcrel; - register fragS *fragP; - register segT add_symbol_segment = SEG_ABSOLUTE; - - - for ( ; fixP; fixP = fixP->fx_next) - { - fragP = fixP->fx_frag; - know(fragP); - where = fixP->fx_where; - place = fragP->fr_literal + where; - size = fixP->fx_size; - add_symbolP = fixP->fx_addsy; -#ifdef TC_I960 - if (fixP->fx_callj && TC_S_IS_CALLNAME(add_symbolP)) { - /* Relocation should be done via the - associated 'bal' entry point - symbol. */ - - if (!TC_S_IS_BALNAME(tc_get_bal_of_call(add_symbolP))) { - as_bad("No 'bal' entry point for leafproc %s", - S_GET_NAME(add_symbolP)); - continue; - } - fixP->fx_addsy = add_symbolP = tc_get_bal_of_call(add_symbolP); - } /* callj relocation */ -#endif - sub_symbolP = fixP->fx_subsy; - add_number = fixP->fx_offset; - pcrel = fixP->fx_pcrel; - - if (add_symbolP) { - add_symbol_segment = S_GET_SEGMENT(add_symbolP); - } /* if there is an addend */ - - if (sub_symbolP) { - if (!add_symbolP) { - /* Its just -sym */ - if (S_GET_SEGMENT(sub_symbolP) != SEG_ABSOLUTE) { - as_bad("Negative of non-absolute symbol %s", S_GET_NAME(sub_symbolP)); - } /* not absolute */ - - add_number -= S_GET_VALUE(sub_symbolP); - - /* if sub_symbol is in the same segment that add_symbol - and add_symbol is either in DATA, TEXT, BSS or ABSOLUTE */ - } else if ((S_GET_SEGMENT(sub_symbolP) == add_symbol_segment) - && (SEG_NORMAL(add_symbol_segment) - || (add_symbol_segment == SEG_ABSOLUTE))) { - /* Difference of 2 symbols from same segment. */ - /* Can't make difference of 2 undefineds: 'value' means */ - /* something different for N_UNDF. */ -#ifdef TC_I960 - /* Makes no sense to use the difference of 2 arbitrary symbols - * as the target of a call instruction. - */ - if (fixP->fx_callj) { - as_bad("callj to difference of 2 symbols"); - } -#endif /* TC_I960 */ - add_number += S_GET_VALUE(add_symbolP) - - S_GET_VALUE(sub_symbolP); - - add_symbolP = NULL; - fixP->fx_addsy = NULL; - } else { - /* Different segments in subtraction. */ - know(!(S_IS_EXTERNAL(sub_symbolP) && (S_GET_SEGMENT(sub_symbolP) == SEG_ABSOLUTE))); - - if ((S_GET_SEGMENT(sub_symbolP) == SEG_ABSOLUTE)) { - add_number -= S_GET_VALUE(sub_symbolP); - } else { - as_bad("Can't emit reloc {- %s-seg symbol \"%s\"} @ file address %d.", - segment_name(S_GET_SEGMENT(sub_symbolP)), - S_GET_NAME(sub_symbolP), fragP->fr_address + where); - } /* if absolute */ - } - } /* if sub_symbolP */ - - if (add_symbolP) { - if (add_symbol_segment == this_segment_type && pcrel) { - /* - * This fixup was made when the symbol's segment was - * SEG_UNKNOWN, but it is now in the local segment. - * So we know how to do the address without relocation. - */ -#ifdef TC_I960 - /* reloc_callj() may replace a 'call' with a 'calls' or a 'bal', - * in which cases it modifies *fixP as appropriate. In the case - * of a 'calls', no further work is required, and *fixP has been - * set up to make the rest of the code below a no-op. - */ - reloc_callj(fixP); -#endif /* TC_I960 */ - - add_number += S_GET_VALUE(add_symbolP); - add_number -= md_pcrel_from (fixP); - pcrel = 0; /* Lie. Don't want further pcrel processing. */ - fixP->fx_addsy = NULL; /* No relocations please. */ - } else - { - switch (add_symbol_segment) - { - case SEG_ABSOLUTE: -#ifdef TC_I960 - reloc_callj(fixP); /* See comment about reloc_callj() above*/ -#endif /* TC_I960 */ - add_number += S_GET_VALUE(add_symbolP); - fixP->fx_addsy = NULL; - add_symbolP = NULL; - break; - default: - - add_number += S_GET_VALUE(add_symbolP) + - segment_info[S_GET_SEGMENT(add_symbolP)].scnhdr.s_paddr ; - break; - - case SEG_UNKNOWN: -#ifdef TC_I960 - if ((int)fixP->fx_bit_fixP == 13) { - /* This is a COBR instruction. They have only a - * 13-bit displacement and are only to be used - * for local branches: flag as error, don't generate - * relocation. - */ - as_bad("can't use COBR format with external label"); - fixP->fx_addsy = NULL; /* No relocations please. */ - continue; - } /* COBR */ -#endif /* TC_I960 */ - - - - break; - - - } /* switch on symbol seg */ - } /* if not in local seg */ - } /* if there was a + symbol */ - - if (pcrel) { - add_number -= md_pcrel_from(fixP); - if (add_symbolP == 0) { - fixP->fx_addsy = & abs_symbol; - } /* if there's an add_symbol */ - } /* if pcrel */ - - if (!fixP->fx_bit_fixP) { - if ((size==1 && - (add_number& ~0xFF) && (add_number&~0xFF!=(-1&~0xFF))) || - (size==2 && - (add_number& ~0xFFFF) && (add_number&~0xFFFF!=(-1&~0xFFFF)))) { - as_bad("Value of %d too large for field of %d bytes at 0x%x", - add_number, size, fragP->fr_address + where); - } /* generic error checking */ - } /* not a bit fix */ - /* once this fix has been applied, we don't have to output anything - nothing more need be done -*/ - md_apply_fix(fixP, add_number); - - } /* For each fixS in this segment. */ - - -} /* fixup_segment() */ -#endif - - - - diff --git a/gas/config/obj-coff-bfd.h b/gas/config/obj-coff-bfd.h deleted file mode 100755 index 16393cd57d..0000000000 --- a/gas/config/obj-coff-bfd.h +++ /dev/null @@ -1,512 +0,0 @@ -/* coff object file format - Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc. - -This file is part of GAS. - -GAS is free software; you can 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. - -GAS is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GAS; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* $Id$ */ - -#define OBJ_COFF 1 - -#include "targ-cpu.h" - -#include "bfd.h" - -/*extern bfd *stdoutput;*/ -/* This internal_lineno crap is to stop namespace pollution from the - bfd internal coff headerfile. */ - -#define internal_lineno bfd_internal_lineno -#include "coff/internal.h" -#undef internal_lineno - -#if defined(TC_H8300) -#include "coff/h8300.h" -#define TARGET_FORMAT "coff-h8300" -#elif defined(TC_A29K) -#include "coff/a29k.h" -#define TARGET_FORMAT "coff-a29k-big" -#else -help me -#endif - -#if 0 -/* Define some processor dependent values according to the processor we are - on. */ -#if defined(TC_H8300) -#define BYTE_ORDERING 0 -#define FILE_HEADER_MAGIC H8300MAGIC -#elif defined(TC_M68K) - -#define BYTE_ORDERING F_AR32W /* See filehdr.h for more info. */ -#ifndef FILE_HEADER_MAGIC -#define FILE_HEADER_MAGIC MC68MAGIC /* ... */ -#endif /* FILE_HEADER_MAGIC */ - -#elif defined(TC_I386) - -#define BYTE_ORDERING F_AR32WR /* See filehdr.h for more info. */ -#ifndef FILE_HEADER_MAGIC -#define FILE_HEADER_MAGIC I386MAGIC /* ... */ -#endif /* FILE_HEADER_MAGIC */ - -#elif defined(TC_I960) - -#define BYTE_ORDERING F_AR32WR /* See filehdr.h for more info. */ -#ifndef FILE_HEADER_MAGIC -#define FILE_HEADER_MAGIC I960ROMAGIC /* ... */ -#endif /* FILE_HEADER_MAGIC */ - -#elif defined(TC_A29K) - -#define BYTE_ORDERING F_AR32W /* big endian. */ -#ifndef FILE_HEADER_MAGIC -#define FILE_HEADER_MAGIC SIPFBOMAGIC -#endif /* FILE_HEADER_MAGIC */ - -#else -you lose -#endif - -#endif - -#ifndef OBJ_COFF_MAX_AUXENTRIES -#define OBJ_COFF_MAX_AUXENTRIES 1 -#endif /* OBJ_COFF_MAX_AUXENTRIES */ - - -extern const segT N_TYPE_seg[]; - -/* Magic number of paged executable. */ -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 0x8300 - - -/* SYMBOL TABLE */ - - /* targets may also set this */ -#ifndef SYMBOLS_NEED_BACKPOINTERS -#define SYMBOLS_NEED_BACKPOINTERS 1 -#endif /* SYMBOLS_NEED_BACKPOINTERS */ - -/* Symbol table entry data type */ - -typedef struct -{ - struct internal_syment ost_entry; /* Basic symbol */ - union internal_auxent ost_auxent[OBJ_COFF_MAX_AUXENTRIES]; /* Auxiliary entry. */ - - unsigned int ost_flags; /* obj_coff internal use only flags */ -} obj_symbol_type; - -#define DO_NOT_STRIP 0 -#define DO_STRIP 1 - -/* Symbol table macros and constants */ - -/* Possible and usefull section number in symbol table - * The values of TEXT, DATA and BSS may not be portable. - */ - -#define C_ABS_SECTION N_ABS -#define C_UNDEF_SECTION N_UNDEF -#define C_DEBUG_SECTION N_DEBUG -#define C_NTV_SECTION N_TV -#define C_PTV_SECTION P_TV -#define C_REGISTER_SECTION 20 - -/* - * Macros to extract information from a symbol table entry. - * This syntaxic indirection allows independence regarding a.out or coff. - * The argument (s) of all these macros is a pointer to a symbol table entry. - */ - -/* Predicates */ -/* True if the symbol is external */ -#define S_IS_EXTERNAL(s) ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION) -/* True if symbol has been defined, ie : - section > 0 (DATA, TEXT or BSS) - section == 0 and value > 0 (external bss symbol) */ -#define S_IS_DEFINED(s) ((s)->sy_symbol.ost_entry.n_scnum > C_UNDEF_SECTION || \ - ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION && \ - (s)->sy_symbol.ost_entry.n_value > 0)) -/* True if a debug special symbol entry */ -#define S_IS_DEBUG(s) ((s)->sy_symbol.ost_entry.n_scnum == C_DEBUG_SECTION) -/* True if a symbol is local symbol name */ -/* A symbol name whose name begin with ^A is a gas internal pseudo symbol */ -#define S_IS_LOCAL(s) (S_GET_NAME(s)[0] == '\001' || \ - (s)->sy_symbol.ost_entry.n_scnum == C_REGISTER_SECTION || \ - (S_LOCAL_NAME(s) && !flagseen['L'])) -/* True if a symbol is not defined in this file */ -#define S_IS_EXTERN(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 && (s)->sy_symbol.ost_entry.n_value == 0) -/* - * True if a symbol can be multiply defined (bss symbols have this def - * though it is bad practice) - */ -#define S_IS_COMMON(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 && (s)->sy_symbol.ost_entry.n_value != 0) -/* True if a symbol name is in the string table, i.e. its length is > 8. */ -#define S_IS_STRING(s) (strlen(S_GET_NAME(s)) > 8 ? 1 : 0) - -/* Accessors */ -/* The name of the symbol */ -#define S_GET_NAME(s) ((char*)(s)->sy_symbol.ost_entry.n_offset) -/* The pointer to the string table */ -#define S_GET_OFFSET(s) ((s)->sy_symbol.ost_entry.n_offset) -/* The zeroes if symbol name is longer than 8 chars */ -#define S_GET_ZEROES(s) ((s)->sy_symbol.ost_entry.n_zeroes) -/* The value of the symbol */ -#define S_GET_VALUE(s) ((unsigned) ((s)->sy_symbol.ost_entry.n_value)) -/* The numeric value of the segment */ -#define S_GET_SEGMENT(s) s_get_segment(s) -/* The data type */ -#define S_GET_DATA_TYPE(s) ((s)->sy_symbol.ost_entry.n_type) -/* The storage class */ -#define S_GET_STORAGE_CLASS(s) ((s)->sy_symbol.ost_entry.n_sclass) -/* The number of auxiliary entries */ -#define S_GET_NUMBER_AUXILIARY(s) ((s)->sy_symbol.ost_entry.n_numaux) - -/* Modifiers */ -/* Set the name of the symbol */ -#define S_SET_NAME(s,v) ((s)->sy_symbol.ost_entry.n_offset = (unsigned long)(v)) -/* Set the offset of the symbol */ -#define S_SET_OFFSET(s,v) ((s)->sy_symbol.ost_entry.n_offset = (v)) -/* The zeroes if symbol name is longer than 8 chars */ -#define S_SET_ZEROES(s,v) ((s)->sy_symbol.ost_entry.n_zeroes = (v)) -/* Set the value of the symbol */ -#define S_SET_VALUE(s,v) ((s)->sy_symbol.ost_entry.n_value = (v)) -/* The numeric value of the segment */ -#define S_SET_SEGMENT(s,v) ((s)->sy_symbol.ost_entry.n_scnum = SEGMENT_TO_SYMBOL_TYPE(v)) -/* The data type */ -#define S_SET_DATA_TYPE(s,v) ((s)->sy_symbol.ost_entry.n_type = (v)) -/* The storage class */ -#define S_SET_STORAGE_CLASS(s,v) ((s)->sy_symbol.ost_entry.n_sclass = (v)) -/* The number of auxiliary entries */ -#define S_SET_NUMBER_AUXILIARY(s,v) ((s)->sy_symbol.ost_entry.n_numaux = (v)) - -/* Additional modifiers */ -/* The symbol is external (does not mean undefined) */ -#define S_SET_EXTERNAL(s) { S_SET_STORAGE_CLASS(s, C_EXT) ; SF_CLEAR_LOCAL(s); } - -/* Auxiliary entry macros. SA_ stands for symbol auxiliary */ -/* Omit the tv related fields */ -/* Accessors */ -#ifdef BFD_HEADERS -#define SA_GET_SYM_TAGNDX(s) ((s)->sy_symbol.ost_auxent[0].x_sym.x_tagndx.l) -#else -#define SA_GET_SYM_TAGNDX(s) ((s)->sy_symbol.ost_auxent[0].x_sym.x_tagndx) -#endif -#define SA_GET_SYM_LNNO(s) ((s)->sy_symbol.ost_auxent[0].x_sym.x_misc.x_lnsz.x_lnno) -#define SA_GET_SYM_SIZE(s) ((s)->sy_symbol.ost_auxent[0].x_sym.x_misc.x_lnsz.x_size) -#define SA_GET_SYM_FSIZE(s) ((s)->sy_symbol.ost_auxent[0].x_sym.x_misc.x_fsize) -#define SA_GET_SYM_LNNOPTR(s) ((s)->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_fcn.x_lnnoptr) -#ifdef BFD_HEADERS -#define SA_GET_SYM_ENDNDX(s) ((s)->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_fcn.x_endndx.l) -#else -#define SA_GET_SYM_ENDNDX(s) ((s)->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_fcn.x_endndx) -#endif -#define SA_GET_SYM_DIMEN(s,i) ((s)->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen[(i)]) -#define SA_GET_FILE_FNAME(s) ((s)->sy_symbol.ost_auxent[0].x_file.x_fname) -#define SA_GET_SCN_SCNLEN(s) ((s)->sy_symbol.ost_auxent[0].x_scn.x_scnlen) -#define SA_GET_SCN_NRELOC(s) ((s)->sy_symbol.ost_auxent[0].x_scn.x_nreloc) -#define SA_GET_SCN_NLINNO(s) ((s)->sy_symbol.ost_auxent[0].x_scn.x_nlinno) - -/* Modifiers */ -#ifdef BFD_HEADERS -#define SA_SET_SYM_TAGNDX(s,v) ((s)->sy_symbol.ost_auxent[0].x_sym.x_tagndx.l=(v)) -#else -#define SA_SET_SYM_TAGNDX(s,v) ((s)->sy_symbol.ost_auxent[0].x_sym.x_tagndx=(v)) -#endif -#define SA_SET_SYM_LNNO(s,v) ((s)->sy_symbol.ost_auxent[0].x_sym.x_misc.x_lnsz.x_lnno=(v)) -#define SA_SET_SYM_SIZE(s,v) ((s)->sy_symbol.ost_auxent[0].x_sym.x_misc.x_lnsz.x_size=(v)) -#define SA_SET_SYM_FSIZE(s,v) ((s)->sy_symbol.ost_auxent[0].x_sym.x_misc.x_fsize=(v)) -#define SA_SET_SYM_LNNOPTR(s,v) ((s)->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_fcn.x_lnnoptr=(v)) -#ifdef BFD_HEADERS -#define SA_SET_SYM_ENDNDX(s,v) ((s)->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_fcn.x_endndx.l=(v)) -#else -#define SA_SET_SYM_ENDNDX(s,v) ((s)->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_fcn.x_endndx=(v)) -#endif -#define SA_SET_SYM_DIMEN(s,i,v) ((s)->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen[(i)]=(v)) -#define SA_SET_FILE_FNAME(s,v) strncpy((s)->sy_symbol.ost_auxent[0].x_file.x_fname,(v),FILNMLEN) -#define SA_SET_SCN_SCNLEN(s,v) ((s)->sy_symbol.ost_auxent[0].x_scn.x_scnlen=(v)) -#define SA_SET_SCN_NRELOC(s,v) ((s)->sy_symbol.ost_auxent[0].x_scn.x_nreloc=(v)) -#define SA_SET_SCN_NLINNO(s,v) ((s)->sy_symbol.ost_auxent[0].x_scn.x_nlinno=(v)) - -/* - * Internal use only definitions. SF_ stands for symbol flags. - * - * These values can be assigned to sy_symbol.ost_flags field of a symbolS. - * - * You'll break i960 if you shift the SYSPROC bits anywhere else. for - * more on the balname/callname hack, see tc-i960.h. b.out is done - * differently. - */ - -#define SF_I960_MASK (0x000001ff) /* Bits 0-8 are used by the i960 port. */ -#define SF_SYSPROC (0x0000003f) /* bits 0-5 are used to store the sysproc number */ -#define SF_IS_SYSPROC (0x00000040) /* bit 6 marks symbols that are sysprocs */ -#define SF_BALNAME (0x00000080) /* bit 7 marks BALNAME symbols */ -#define SF_CALLNAME (0x00000100) /* bit 8 marks CALLNAME symbols */ - -#define SF_NORMAL_MASK (0x0000ffff) /* bits 12-15 are general purpose. */ - -#define SF_STATICS (0x00001000) /* Mark the .text & all symbols */ -#define SF_DEFINED (0x00002000) /* Symbol is defined in this file */ -#define SF_STRING (0x00004000) /* Symbol name length > 8 */ -#define SF_LOCAL (0x00008000) /* Symbol must not be emitted */ - -#define SF_DEBUG_MASK (0xffff0000) /* bits 16-31 are debug info */ - -#define SF_FUNCTION (0x00010000) /* The symbol is a function */ -#define SF_PROCESS (0x00020000) /* Process symbol before write */ -#define SF_TAGGED (0x00040000) /* Is associated with a tag */ -#define SF_TAG (0x00080000) /* Is a tag */ -#define SF_DEBUG (0x00100000) /* Is in debug or abs section */ -#define SF_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */ - /* All other bits are unused. */ - -/* Accessors */ -#define SF_GET(s) ((s)->sy_symbol.ost_flags) -#define SF_GET_NORMAL_FIELD(s) ((s)->sy_symbol.ost_flags & SF_NORMAL_MASK) -#define SF_GET_DEBUG_FIELD(s) ((s)->sy_symbol.ost_flags & SF_DEBUG_MASK) -#define SF_GET_FILE(s) ((s)->sy_symbol.ost_flags & SF_FILE) -#define SF_GET_STATICS(s) ((s)->sy_symbol.ost_flags & SF_STATICS) -#define SF_GET_DEFINED(s) ((s)->sy_symbol.ost_flags & SF_DEFINED) -#define SF_GET_STRING(s) ((s)->sy_symbol.ost_flags & SF_STRING) -#define SF_GET_LOCAL(s) ((s)->sy_symbol.ost_flags & SF_LOCAL) -#define SF_GET_FUNCTION(s) ((s)->sy_symbol.ost_flags & SF_FUNCTION) -#define SF_GET_PROCESS(s) ((s)->sy_symbol.ost_flags & SF_PROCESS) -#define SF_GET_DEBUG(s) ((s)->sy_symbol.ost_flags & SF_DEBUG) -#define SF_GET_TAGGED(s) ((s)->sy_symbol.ost_flags & SF_TAGGED) -#define SF_GET_TAG(s) ((s)->sy_symbol.ost_flags & SF_TAG) -#define SF_GET_GET_SEGMENT(s) ((s)->sy_symbol.ost_flags & SF_GET_SEGMENT) -#define SF_GET_I960(s) ((s)->sy_symbol.ost_flags & SF_I960_MASK) /* used by i960 */ -#define SF_GET_BALNAME(s) ((s)->sy_symbol.ost_flags & SF_BALNAME) /* used by i960 */ -#define SF_GET_CALLNAME(s) ((s)->sy_symbol.ost_flags & SF_CALLNAME) /* used by i960 */ -#define SF_GET_IS_SYSPROC(s) ((s)->sy_symbol.ost_flags & SF_IS_SYSPROC) /* used by i960 */ -#define SF_GET_SYSPROC(s) ((s)->sy_symbol.ost_flags & SF_SYSPROC) /* used by i960 */ - -/* Modifiers */ -#define SF_SET(s,v) ((s)->sy_symbol.ost_flags = (v)) -#define SF_SET_NORMAL_FIELD(s,v)((s)->sy_symbol.ost_flags |= ((v) & SF_NORMAL_MASK)) -#define SF_SET_DEBUG_FIELD(s,v) ((s)->sy_symbol.ost_flags |= ((v) & SF_DEBUG_MASK)) -#define SF_SET_FILE(s) ((s)->sy_symbol.ost_flags |= SF_FILE) -#define SF_SET_STATICS(s) ((s)->sy_symbol.ost_flags |= SF_STATICS) -#define SF_SET_DEFINED(s) ((s)->sy_symbol.ost_flags |= SF_DEFINED) -#define SF_SET_STRING(s) ((s)->sy_symbol.ost_flags |= SF_STRING) -#define SF_SET_LOCAL(s) ((s)->sy_symbol.ost_flags |= SF_LOCAL) -#define SF_CLEAR_LOCAL(s) ((s)->sy_symbol.ost_flags &= ~SF_LOCAL) -#define SF_SET_FUNCTION(s) ((s)->sy_symbol.ost_flags |= SF_FUNCTION) -#define SF_SET_PROCESS(s) ((s)->sy_symbol.ost_flags |= SF_PROCESS) -#define SF_SET_DEBUG(s) ((s)->sy_symbol.ost_flags |= SF_DEBUG) -#define SF_SET_TAGGED(s) ((s)->sy_symbol.ost_flags |= SF_TAGGED) -#define SF_SET_TAG(s) ((s)->sy_symbol.ost_flags |= SF_TAG) -#define SF_SET_GET_SEGMENT(s) ((s)->sy_symbol.ost_flags |= SF_GET_SEGMENT) -#define SF_SET_I960(s,v) ((s)->sy_symbol.ost_flags |= ((v) & SF_I960_MASK)) /* used by i960 */ -#define SF_SET_BALNAME(s) ((s)->sy_symbol.ost_flags |= SF_BALNAME) /* used by i960 */ -#define SF_SET_CALLNAME(s) ((s)->sy_symbol.ost_flags |= SF_CALLNAME) /* used by i960 */ -#define SF_SET_IS_SYSPROC(s) ((s)->sy_symbol.ost_flags |= SF_IS_SYSPROC) /* used by i960 */ -#define SF_SET_SYSPROC(s,v) ((s)->sy_symbol.ost_flags |= ((v) & SF_SYSPROC)) /* used by i960 */ - -/* File header macro and type definition */ - -/* - * File position calculators. Beware to use them when all the - * appropriate fields are set in the header. - */ - -#ifdef OBJ_COFF_OMIT_OPTIONAL_HEADER -#define OBJ_COFF_AOUTHDRSZ (0) -#else -#define OBJ_COFF_AOUTHDRSZ (AOUTHDRSZ) -#endif /* OBJ_COFF_OMIT_OPTIONAL_HEADER */ - -#define H_GET_FILE_SIZE(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ - H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ - H_GET_TEXT_SIZE(h) + H_GET_DATA_SIZE(h) + \ - H_GET_RELOCATION_SIZE(h) + H_GET_LINENO_SIZE(h) + \ - H_GET_SYMBOL_TABLE_SIZE(h) + \ - (h)->string_table_size) -#define H_GET_TEXT_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ - H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ) -#define H_GET_DATA_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ - H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ - H_GET_TEXT_SIZE(h)) -#define H_GET_BSS_FILE_OFFSET(h) 0 -#define H_GET_RELOCATION_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ - H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ - H_GET_TEXT_SIZE(h) + H_GET_DATA_SIZE(h)) -#define H_GET_LINENO_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ - H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ - H_GET_TEXT_SIZE(h) + H_GET_DATA_SIZE(h) + \ - H_GET_RELOCATION_SIZE(h)) -#define H_GET_SYMBOL_TABLE_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ - H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ - H_GET_TEXT_SIZE(h) + H_GET_DATA_SIZE(h) + \ - H_GET_RELOCATION_SIZE(h) + H_GET_LINENO_SIZE(h)) - -/* Accessors */ -/* aouthdr */ -#define H_GET_MAGIC_NUMBER(h) ((h)->aouthdr.magic) -#define H_GET_VERSION_STAMP(h) ((h)->aouthdr.vstamp) -#define H_GET_TEXT_SIZE(h) ((h)->aouthdr.tsize) -#define H_GET_DATA_SIZE(h) ((h)->aouthdr.dsize) -#define H_GET_BSS_SIZE(h) ((h)->aouthdr.bsize) -#define H_GET_ENTRY_POINT(h) ((h)->aouthdr.entry) -#define H_GET_TEXT_START(h) ((h)->aouthdr.text_start) -#define H_GET_DATA_START(h) ((h)->aouthdr.data_start) -/* filehdr */ -#define H_GET_FILE_MAGIC_NUMBER(h) ((h)->filehdr.f_magic) -#define H_GET_NUMBER_OF_SECTIONS(h) ((h)->filehdr.f_nscns) -#define H_GET_TIME_STAMP(h) ((h)->filehdr.f_timdat) -#define H_GET_SYMBOL_TABLE_POINTER(h) ((h)->filehdr.f_symptr) -#define H_GET_SYMBOL_COUNT(h) ((h)->filehdr.f_nsyms) -#define H_GET_SYMBOL_TABLE_SIZE(h) (H_GET_SYMBOL_COUNT(h) * SYMESZ) -#define H_GET_SIZEOF_OPTIONAL_HEADER(h) ((h)->filehdr.f_opthdr) -#define H_GET_FLAGS(h) ((h)->filehdr.f_flags) -/* Extra fields to achieve bsd a.out compatibility and for convenience */ -#define H_GET_RELOCATION_SIZE(h) ((h)->relocation_size) -#define H_GET_STRING_SIZE(h) ((h)->string_table_size) -#define H_GET_LINENO_SIZE(h) ((h)->lineno_size) - -#ifndef OBJ_COFF_OMIT_OPTIONAL_HEADER -#define H_GET_HEADER_SIZE(h) (sizeof(FILHDR) \ - + sizeof(AOUTHDR)\ - + (H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ)) -#else /* OBJ_COFF_OMIT_OPTIONAL_HEADER */ -#define H_GET_HEADER_SIZE(h) (sizeof(FILHDR) \ - + (H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ)) -#endif /* OBJ_COFF_OMIT_OPTIONAL_HEADER */ - -#define H_GET_TEXT_RELOCATION_SIZE(h) (text_section_header.s_nreloc * RELSZ) -#define H_GET_DATA_RELOCATION_SIZE(h) (data_section_header.s_nreloc * RELSZ) - -/* Modifiers */ -/* aouthdr */ -#define H_SET_MAGIC_NUMBER(h,v) ((h)->aouthdr.magic = (v)) -#define H_SET_VERSION_STAMP(h,v) ((h)->aouthdr.vstamp = (v)) -#define H_SET_TEXT_SIZE(h,v) ((h)->aouthdr.tsize = (v)) -#define H_SET_DATA_SIZE(h,v) ((h)->aouthdr.dsize = (v)) -#define H_SET_BSS_SIZE(h,v) ((h)->aouthdr.bsize = (v)) -#define H_SET_ENTRY_POINT(h,v) ((h)->aouthdr.entry = (v)) -#define H_SET_TEXT_START(h,v) ((h)->aouthdr.text_start = (v)) -#define H_SET_DATA_START(h,v) ((h)->aouthdr.data_start = (v)) -/* filehdr */ -#define H_SET_FILE_MAGIC_NUMBER(h,v) ((h)->filehdr.f_magic = (v)) -#define H_SET_NUMBER_OF_SECTIONS(h,v) ((h)->filehdr.f_nscns = (v)) -#define H_SET_TIME_STAMP(h,v) ((h)->filehdr.f_timdat = (v)) -#define H_SET_SYMBOL_TABLE_POINTER(h,v) ((h)->filehdr.f_symptr = (v)) -#define H_SET_SYMBOL_TABLE_SIZE(h,v) ((h)->filehdr.f_nsyms = (v)) -#define H_SET_SIZEOF_OPTIONAL_HEADER(h,v) ((h)->filehdr.f_opthdr = (v)) -#define H_SET_FLAGS(h,v) ((h)->filehdr.f_flags = (v)) -/* Extra fields to achieve bsd a.out compatibility and for convinience */ -#define H_SET_RELOCATION_SIZE(h,t,d) ((h)->relocation_size = (t)+(d)) -#define H_SET_STRING_SIZE(h,v) ((h)->string_table_size = (v)) -#define H_SET_LINENO_SIZE(h,v) ((h)->lineno_size = (v)) - - /* Segment flipping */ -#define segment_name(v) (seg_name[(int) (v)]) - -typedef struct { -#ifdef BFD_HEADERS - struct internal_aouthdr aouthdr; /* a.out header */ - struct internal_filehdr filehdr; /* File header, not machine dep. */ -#else - AOUTHDR aouthdr; /* a.out header */ - FILHDR filehdr; /* File header, not machine dep. */ -#endif - long string_table_size; /* names + '\0' + sizeof(int) */ - long relocation_size; /* Cumulated size of relocation - information for all sections in - bytes. */ - long lineno_size; /* Size of the line number information - table in bytes */ -} object_headers; - - - -struct lineno_list -{ - - struct bfd_internal_lineno line; - char* frag; /* Frag to which the line number is related */ - struct lineno_list* next; /* Forward chain pointer */ -} ; - - - - - /* stack stuff */ -typedef struct { - unsigned long chunk_size; - unsigned long element_size; - unsigned long size; - char* data; - unsigned long pointer; -} stack; - - - -char *EXFUN(stack_pop,(stack *st)); -char *EXFUN(stack_push,(stack *st, char *element)); -char *EXFUN(stack_top,(stack *st)); -stack *EXFUN(stack_init,(unsigned long chunk_size, unsigned long element_size)); -void EXFUN(c_dot_file_symbol,(char *filename)); -void EXFUN(obj_extra_stuff,(object_headers *headers)); -void EXFUN(stack_delete,(stack *st)); - - - -void EXFUN(c_section_header,( - - struct internal_scnhdr *header, - char *name, - long core_address, - long size, - long data_ptr, - long reloc_ptr, - long lineno_ptr, - long reloc_number, - long lineno_number, - long alignment)); - - - /* sanity check */ - -#ifdef TC_I960 -#ifndef C_LEAFSTAT -hey! Where is the C_LEAFSTAT definition? i960-coff support is depending on it. -#endif /* no C_LEAFSTAT */ -#endif /* TC_I960 */ -#ifdef BFD_HEADERS -extern struct internal_scnhdr data_section_header; -extern struct internal_scnhdr text_section_header; -#else -extern SCNHDR data_section_header; -extern SCNHDR text_section_header; -#endif -/* - * Local Variables: - * comment-column: 0 - * fill-column: 131 - * End: - */ - -/* end of obj-coff.h */ diff --git a/gas/config/ranlib.h b/gas/config/ranlib.h deleted file mode 100755 index d7fda4519d..0000000000 --- a/gas/config/ranlib.h +++ /dev/null @@ -1,36 +0,0 @@ -/* This file is ranlib.h - Copyright (C) 1987-1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* - * Structure of the __.SYMDEF table of contents for an archive. - * __.SYMDEF begins with a word giving the number of ranlib structures - * which immediately follow, and then continues with a string - * table consisting of a word giving the number of bytes of strings - * which follow and then the strings themselves. - * The ran_strx fields index the string table whose first byte is numbered 0. - */ -struct ranlib { - union { - off_t ran_strx; /* string table index of */ - char *ran_name; /* symbol defined by */ - } ran_un; - off_t ran_off; /* library member at this offset */ -}; - -/* end of ranlib.h */ diff --git a/gas/config/signame.h b/gas/config/signame.h deleted file mode 100755 index 8eb08897db..0000000000 --- a/gas/config/signame.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Convert between signal names and numbers. - Copyright (C) 1990, 1992 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, 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; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Names for signals from 0 to NSIG-1. */ -extern char *sys_siglist[]; - -#if __STDC__ == 1 -/* 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 (int signal, const char *message); - -#else /* not __STDC__ */ - -char *sig_abbrev (); -int sig_number (); -void psignal (); - -#endif /* not __STDC__ */ - -/* end of signame.h */ diff --git a/gas/config/stab.h b/gas/config/stab.h deleted file mode 100755 index efeee1edad..0000000000 --- a/gas/config/stab.h +++ /dev/null @@ -1,37 +0,0 @@ -/* This file is stab.h - Copyright (C) 1987-1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef __GNU_STAB__ - -/* Indicate the GNU stab.h is in use. */ - -#define __GNU_STAB__ - -#define __define_stab(NAME, CODE, STRING) NAME=CODE, - - enum __stab_debug_code -{ -#include "stab.def" -}; - -#undef __define_stab - -#endif /* __GNU_STAB_ */ - -/* end of stab.h */ diff --git a/gas/config/tc-m68kmote.c b/gas/config/tc-m68kmote.c deleted file mode 100644 index d8e93b07b4..0000000000 --- a/gas/config/tc-m68kmote.c +++ /dev/null @@ -1,4519 +0,0 @@ -/* tc-m68kmote.c All the m68020 specific stuff in one convenient, huge, - slow to compile, easy to find file. - Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#define MRI -#include - -#include "as.h" -#include "bfd.h" -#include "obstack.h" - -/* note that this file includes real declarations and thus can only be included by one source file per executable. */ -#include "opcode/m68k.h" -#ifdef TE_SUN -/* This variable contains the value to write out at the beginning of - the a.out file. The 2<<16 means that this is a 68020 file instead - of an old-style 68000 file */ - -long omagic = 2<<16|OMAGIC; /* Magic byte for header file */ -#else -long omagic = OMAGIC; -#endif - -/* This array holds the chars that always start a comment. If the - pre-processor is disabled, these aren't very useful */ -const char comment_chars[] = "|"; - -/* This array holds the chars that only start a comment at the beginning of - a line. If the line seems to have the form '# 123 filename' - .line and .file directives will appear in the pre-processed output */ -/* Note that input_file.c hand checks for '#' at the beginning of the - first line of the input file. This is because the compiler outputs - #NO_APP at the beginning of its output. */ -/* Also note that comments like this one will always work. */ -#ifdef MRI -const char line_comment_chars[] = "*"; -#else -const char line_comment_chars[] = "#"; -#endif - -#define NO_RELOC 0 - -/* Chars that can be used to separate mant from exp in floating point nums */ -const char EXP_CHARS[] = "eE"; - -/* Chars that mean this number is a floating point constant */ -/* As in 0f12.456 */ -/* or 0d1.2345e12 */ - -const char FLT_CHARS[] = "rRsSfFdDxXeEpP"; - -/* Also be aware that MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT may have to be - changed in read.c . Ideally it shouldn't have to know about it at all, - but nothing is ideal around here. - */ - -int md_reloc_size = 8; /* Size of relocation record */ - -/* Its an arbitrary name: This means I don't approve of it */ -/* See flames below */ -static struct obstack robyn; - -#define TAB(x,y) (((x)<<2)+(y)) -#define TABTYPE(xy) ((xy) >> 2) -#define BYTE 0 -#define SHORT 1 -#define LONG 2 -#define SZ_UNDEF 3 - -#define BRANCH 1 -#define FBRANCH 2 -#define PCREL 3 -#define BCC68000 4 -#define DBCC 5 -#define PCLEA 6 - -/* Operands we can parse: (And associated modes) - - numb: 8 bit num - numw: 16 bit num - numl: 32 bit num - dreg: data reg 0-7 - reg: address or data register - areg: address register - apc: address register, PC, ZPC or empty string - num: 16 or 32 bit num - num2: like num - sz: w or l if omitted, l assumed - scale: 1 2 4 or 8 if omitted, 1 assumed - - 7.4 IMMED #num --> NUM - 0.? DREG dreg --> dreg - 1.? AREG areg --> areg - 2.? AINDR areg@ --> *(areg) - 3.? AINC areg@+ --> *(areg++) - 4.? ADEC areg@- --> *(--areg) - 5.? AOFF apc@(numw) --> *(apc+numw) -- empty string and ZPC not allowed here - 6.? AINDX apc@(num,reg:sz:scale) --> *(apc+num+reg*scale) - 6.? AINDX apc@(reg:sz:scale) --> same, with num=0 - 6.? APODX apc@(num)@(num2,reg:sz:scale) --> *(*(apc+num)+num2+reg*scale) - 6.? APODX apc@(num)@(reg:sz:scale) --> same, with num2=0 - 6.? AMIND apc@(num)@(num2) --> *(*(apc+num)+num2) (previous mode without an index reg) - 6.? APRDX apc@(num,reg:sz:scale)@(num2) --> *(*(apc+num+reg*scale)+num2) - 6.? APRDX apc@(reg:sz:scale)@(num2) --> same, with num=0 - 7.0 ABSL num:sz --> *(num) - num --> *(num) (sz L assumed) - *** MSCR otherreg --> Magic - With -l option - 5.? AOFF apc@(num) --> *(apc+num) -- empty string and ZPC not allowed here still - ?.? DINDR dreg@ --> (dreg) -- cas2 only - - examples: - #foo #0x35 #12 - d2 - a4 - a3@ - a5@+ - a6@- - a2@(12) pc@(14) - a1@(5,d2:w:1) @(45,d6:l:4) - pc@(a2) @(d4) - etc . . . - - - #name@(numw) -->turn into PC rel mode - apc@(num8,reg:sz:scale) --> *(apc+num8+reg*scale) - - */ - -enum operand_type { - IMMED = 1, - DREG, - AREG, - AINDR, - ADEC, - AINC, - AOFF, - AINDX, - APODX, - AMIND, - APRDX, - ABSL, - MSCR, - REGLST, - DINDR -}; - - -struct m68k_exp { - char *e_beg; - char *e_end; - expressionS e_exp; - short e_siz; /* 0== default 1==short/byte 2==word 3==long */ -}; - -/* DATA and ADDR have to be contiguous, so that reg-DATA gives 0-7==data reg, - 8-15==addr reg for operands that take both types */ - -enum _register { - DATA = 1, /* 1- 8 == data registers 0-7 */ - DATA0 = DATA, - DATA1, - DATA2, - DATA3, - DATA4, - DATA5, - DATA6, - DATA7, - - ADDR, - ADDR0 = ADDR, - ADDR1, - ADDR2, - ADDR3, - ADDR4, - ADDR5, - ADDR6, - ADDR7, - - /* Note that COPNUM==processor #1 -- COPNUM+7==#8, which stores as 000 */ - /* I think. . . */ - - SP = ADDR7, - - FPREG, /* Eight FP registers */ - FP0 = FPREG, - FP1, - FP2, - FP3, - FP4, - FP5, - FP6, - FP7, - COPNUM = (FPREG+8), /* Co-processor #1-#8 */ - COP0 = COPNUM, - COP1, - COP2, - COP3, - COP4, - COP5, - COP6, - COP7, - PC, /* Program counter */ - ZPC, /* Hack for Program space, but 0 addressing */ - SR, /* Status Reg */ - CCR, /* Condition code Reg */ - - /* These have to be in order for the movec instruction to work. */ - USP, /* User Stack Pointer */ - ISP, /* Interrupt stack pointer */ - SFC, - DFC, - CACR, - VBR, - CAAR, - MSP, - ITT0, - ITT1, - DTT0, - DTT1, - MMUSR, - TC, - SRP, - URP, - /* end of movec ordering constraints */ - - FPI, - FPS, - FPC, - - DRP, - CRP, - CAL, - VAL, - SCC, - AC, - BAD, - BAD0 = BAD, - BAD1, - BAD2, - BAD3, - BAD4, - BAD5, - BAD6, - BAD7, - BAC, - BAC0 = BAC, - BAC1, - BAC2, - BAC3, - BAC4, - BAC5, - BAC6, - BAC7, - PSR, - PCSR, - - IC, /* instruction cache token */ - DC, /* data cache token */ - NC, /* no cache token */ - BC, /* both caches token */ - -}; - -/* Internal form of an operand. */ -struct m68k_op { - char *error; /* Couldn't parse it */ - enum operand_type mode; /* What mode this instruction is in. */ - enum _register reg; /* Base register */ - struct m68k_exp *con1; - int ireg; /* Index register */ - int isiz; /* 0==unspec 1==byte(?) 2==short 3==long */ - int imul; /* Multipy ireg by this (1,2,4,or 8) */ - struct m68k_exp *con2; -}; - -/* internal form of a 68020 instruction */ -struct m68k_it { - char *error; - char *args; /* list of opcode info */ - int numargs; - - int numo; /* Number of shorts in opcode */ - short opcode[11]; - - struct m68k_op operands[6]; - - int nexp; /* number of exprs in use */ - struct m68k_exp exprs[4]; - - int nfrag; /* Number of frags we have to produce */ - struct { - int fragoff; /* Where in the current opcode[] the frag ends */ - symbolS *fadd; - long foff; - int fragty; - } fragb[4]; - - int nrel; /* Num of reloc strucs in use */ - struct { - int n; - symbolS *add, - *sub; - long off; - char wid; - char pcrel; - } reloc[5]; /* Five is enough??? */ -}; - -#define cpu_of_arch(x) ((x) & m68000up) -#define float_of_arch(x) ((x) & mfloat) -#define mmu_of_arch(x) ((x) & mmmu) - -static struct m68k_it the_ins; /* the instruction being assembled */ - -/* Macros for adding things to the m68k_it struct */ - -#define addword(w) the_ins.opcode[the_ins.numo++]=(w) - -/* Like addword, but goes BEFORE general operands */ -#define insop(w) {int z;\ - for(z=the_ins.numo;z>opcode->m_codenum;--z)\ - the_ins.opcode[z]=the_ins.opcode[z-1];\ - for(z=0;zm_codenum]=w;\ - the_ins.numo++;\ - } - - -#define add_exp(beg,end) (\ - the_ins.exprs[the_ins.nexp].e_beg=beg,\ - the_ins.exprs[the_ins.nexp].e_end=end,\ - &the_ins.exprs[the_ins.nexp++]\ - ) - - -/* The numo+1 kludge is so we can hit the low order byte of the prev word. Blecch*/ -#define add_fix(width,exp,pc_rel) {\ - the_ins.reloc[the_ins.nrel].n= ((width)=='B') ? (the_ins.numo*2-1) : \ - (((width)=='b') ? ((the_ins.numo-1)*2) : (the_ins.numo*2));\ - the_ins.reloc[the_ins.nrel].add=adds((exp));\ - the_ins.reloc[the_ins.nrel].sub=subs((exp));\ - the_ins.reloc[the_ins.nrel].off=offs((exp));\ - the_ins.reloc[the_ins.nrel].wid=width;\ - the_ins.reloc[the_ins.nrel++].pcrel=pc_rel;\ - } - -#define add_frag(add,off,type) {\ - the_ins.fragb[the_ins.nfrag].fragoff=the_ins.numo;\ - the_ins.fragb[the_ins.nfrag].fadd=add;\ - the_ins.fragb[the_ins.nfrag].foff=off;\ - the_ins.fragb[the_ins.nfrag++].fragty=type;\ - } - -#define isvar(exp) ((exp) && (adds(exp) || subs(exp))) - -#define seg(exp) ((exp)->e_exp.X_seg) -#define adds(exp) ((exp)->e_exp.X_add_symbol) -#define subs(exp) ((exp)->e_exp.X_subtract_symbol) -#define offs(exp) ((exp)->e_exp.X_add_number) - - -struct m68k_incant { - char *m_operands; - unsigned long m_opcode; - short m_opnum; - short m_codenum; - enum m68k_architecture m_arch; - struct m68k_incant *m_next; -}; - -#define getone(x) ((((x)->m_opcode)>>16)&0xffff) -#define gettwo(x) (((x)->m_opcode)&0xffff) - - -#if __STDC__ == 1 - -static char *crack_operand(char *str, struct m68k_op *opP); -static int get_num(struct m68k_exp *exp, int ok); -static int get_regs(int i, char *str, struct m68k_op *opP); -static int reverse_16_bits(int in); -static int reverse_8_bits(int in); -static int try_index(char **s, struct m68k_op *opP); -static void install_gen_operand(int mode, int val); -static void install_operand(int mode, int val); -static void s_bss(void); -static void s_data1(void); -static void s_data2(void); -static void s_even(void); -static void s_proc(void); - -#else /* not __STDC__ */ - -static char *crack_operand(); -static int get_num(); -static int get_regs(); -static int reverse_16_bits(); -static int reverse_8_bits(); -static int try_index(); -static void install_gen_operand(); -static void install_operand(); -static void s_bss(); -static void s_data1(); -static void s_data2(); -static void s_even(); -static void s_proc(); - -#endif /* not __STDC__ */ - -static enum m68k_architecture current_architecture = _m68k_undef; - -/* BCC68000 is for patching in an extra jmp instruction for long offsets - on the 68000. The 68000 doesn't support long branches with branchs */ - -/* This table desribes how you change sizes for the various types of variable - size expressions. This version only supports two kinds. */ - -/* Note that calls to frag_var need to specify the maximum expansion needed */ -/* This is currently 10 bytes for DBCC */ - -/* The fields are: - How far Forward this mode will reach: - How far Backward this mode will reach: - How many bytes this mode will add to the size of the frag - Which mode to go to if the offset won't fit in this one - */ -const relax_typeS - md_relax_table[] = { - { 1, 1, 0, 0 }, /* First entries aren't used */ - { 1, 1, 0, 0 }, /* For no good reason except */ - { 1, 1, 0, 0 }, /* that the VAX doesn't either */ - { 1, 1, 0, 0 }, - - { (127), (-128), 0, TAB(BRANCH,SHORT)}, - { (32767), (-32768), 2, TAB(BRANCH,LONG) }, - { 0, 0, 4, 0 }, - { 1, 1, 0, 0 }, - - { 1, 1, 0, 0 }, /* FBRANCH doesn't come BYTE */ - { (32767), (-32768), 2, TAB(FBRANCH,LONG)}, - { 0, 0, 4, 0 }, - { 1, 1, 0, 0 }, - - { 1, 1, 0, 0 }, /* PCREL doesn't come BYTE */ - { (32767), (-32768), 2, TAB(PCREL,LONG)}, - { 0, 0, 4, 0 }, - { 1, 1, 0, 0 }, - - { (127), (-128), 0, TAB(BCC68000,SHORT)}, - { (32767), (-32768), 2, TAB(BCC68000,LONG) }, - { 0, 0, 6, 0 }, /* jmp long space */ - { 1, 1, 0, 0 }, - - { 1, 1, 0, 0 }, /* DBCC doesn't come BYTE */ - { (32767), (-32768), 2, TAB(DBCC,LONG) }, - { 0, 0, 10, 0 }, /* bra/jmp long space */ - { 1, 1, 0, 0 }, - - { 1, 1, 0, 0 }, /* PCLEA doesn't come BYTE */ - { 32767, -32768, 2, TAB(PCLEA,LONG) }, - { 0, 0, 6, 0 }, - { 1, 1, 0, 0 }, - - }; - -/* These are the machine dependent pseudo-ops. These are included so - the assembler can work on the output from the SUN C compiler, which - generates these. - */ - -/* This table describes all the machine specific pseudo-ops the assembler - has to support. The fields are: - pseudo-op name without dot - function to call to execute this pseudo-op - Integer arg to pass to the function - */ -#ifdef MRI - -void cons(); -void s_sect(); -void float_cons(); -void s_align_bytes(); -void s_chip(); -void s_ds(); -void s_dcb(); -void s_dc(); -const pseudo_typeS md_pseudo_table[] = { - { "xdef", s_globl, 0 }, - { "sect", s_sect, 0 }, - { "dc", s_dc, 2 }, - { "dc.d", float_cons, 'd' }, - { "dc.s", float_cons, 'f' }, - { "dc.l", s_dc, 4 }, - { "dc.w", s_dc, 2 }, - { "dc.b", s_dc, 1 }, - { "comline", s_ds, 1 }, - { "ds.b", s_ds, 1 }, - { "ds.w", s_ds, 2 }, - { "ds", s_ds, 2 }, - { "ds.l", s_ds, 4 }, - { "ds.d", s_ds, 8 }, - { "ds.s", s_ds, 4 }, - { "dcb", s_dcb, 2 }, - { "dcb.b", s_dcb, 1 }, - { "dcb.w", s_dcb, 2 }, - { "dcb.l", s_dcb, 4 }, - { "xcom", s_comm, 0 }, - { "align", s_align_bytes, 0 }, - { "chip", s_chip, 0 }, - { 0, 0, 0 } -}; -#else - -const pseudo_typeS md_pseudo_table[] = { - { "data1", s_data1, 0 }, - { "data2", s_data2, 0 }, - { "bss", s_bss, 0 }, - { "even", s_even, 0 }, - { "skip", s_space, 0 }, - { "proc", s_proc, 0 }, - { 0, 0, 0 } -} - - - - -#endif - -/* #define isbyte(x) ((x)>=-128 && (x)<=127) */ -/* #define isword(x) ((x)>=-32768 && (x)<=32767) */ - -#define issbyte(x) ((x)>=-128 && (x)<=127) -#define isubyte(x) ((x)>=0 && (x)<=255) -#define issword(x) ((x)>=-32768 && (x)<=32767) -#define isuword(x) ((x)>=0 && (x)<=65535) - -#define isbyte(x) ((x)>=-128 && (x)<=255) -#define isword(x) ((x)>=-32768 && (x)<=65535) -#define islong(x) (1) - -extern char *input_line_pointer; - -enum { - FAIL = 0, - OK = 1, -}; - -/* JF these tables here are for speed at the expense of size */ -/* You can replace them with the #if 0 versions if you really - need space and don't mind it running a bit slower */ - -static char mklower_table[256]; -#define mklower(c) (mklower_table[(unsigned char)(c)]) -static char notend_table[256]; -static char alt_notend_table[256]; -#define notend(s) ( !(notend_table[(unsigned char)(*s)] || (*s==':' &&\ - alt_notend_table[(unsigned char)(s[1])]))) - -#if 0 -#define mklower(c) (isupper(c) ? tolower(c) : c) -#endif - -#define ISSPACE(x) ((x) == ' ' || (x) == '\t') -#ifdef MRI -#define MULTIPLIER '*' -#define SIZER '.' -#else -#define MULTIPLIER ':' -#define SIZER ':' -#endif - - -/* JF modified this to handle cases where the first part of a symbol name - looks like a register */ - -/* - * m68k_reg_parse() := if it looks like a register, return it's token & - * advance the pointer. - */ - -enum _register m68k_reg_parse(ccp) -register char **ccp; -{ -#ifndef MAX_REG_NAME_LEN -#define MAX_REG_NAME_LEN (6) -#endif /* MAX_REG_NAME_LEN */ - register char c[MAX_REG_NAME_LEN]; - char *p, *q; - register int n = 0, - ret = FAIL; - - c[0] = mklower(ccp[0][0]); -#ifdef REGISTER_PREFIX - if (c[0] != REGISTER_PREFIX) { - return(FAIL); - } /* need prefix */ -#endif - - for (p = c, q = ccp[0]; p < c + MAX_REG_NAME_LEN; ++p, ++q) - { - if (*q == 0) - { - *p = 0; - break; - } - else - *p = mklower(*q); - } /* downcase */ - - switch(c[0]) { - case 'a': - if(c[1]>='0' && c[1]<='7') { - n=2; - ret=ADDR+c[1]-'0'; - } -#ifndef NO_68851 - else if (c[1] == 'c') { - n = 2; - ret = AC; - } -#endif - break; -#ifndef NO_68851 - case 'b': - if (c[1] == 'a') { - if (c[2] == 'd') { - if (c[3] >= '0' && c[3] <= '7') { - n = 4; - ret = BAD + c[3] - '0'; - } - } /* BAD */ - if (c[2] == 'c') { - if (c[3] >= '0' && c[3] <= '7') { - n = 4; - ret = BAC + c[3] - '0'; - } - } /* BAC */ - } else if (c[1] == 'c') { - n = 2; - ret = BC; - } /* BC */ - break; -#endif - case 'c': -#ifndef NO_68851 - if (c[1] == 'a' && c[2] == 'l') { - n = 3; - ret = CAL; - } else -#endif - /* This supports both CCR and CC as the ccr reg. */ - if(c[1]=='c' && c[2]=='r') { - n=3; - ret = CCR; - } else if(c[1]=='c') { - n=2; - ret = CCR; - } else if(c[1]=='a' && (c[2]=='a' || c[2]=='c') && c[3]=='r') { - n=4; - ret = c[2]=='a' ? CAAR : CACR; - } -#ifndef NO_68851 - else if (c[1] == 'r' && c[2] == 'p') { - n = 3; - ret = (CRP); - } -#endif - break; - case 'd': - if (c[1] >= '0' && c[1] <= '7') { - n = 2; - ret = DATA + c[1] - '0'; - } else if (c[1] == 'f' && c[2] == 'c') { - n = 3; - ret = DFC; - } else if (c[1] == 'c') { - n = 2; - ret = DC; - } else if (c[1] == 't' && c[2] == 't') { - if ('0' <= c[3] && c[3] <= '1') { - n = 4; - ret = DTT0 + (c[3] - '0'); - } /* DTT[01] */ - } -#ifndef NO_68851 - else if (c[1] == 'r' && c[2] == 'p') { - n = 3; - ret = (DRP); - } -#endif - break; - case 'f': - if(c[1]=='p') { - if(c[2]>='0' && c[2]<='7') { - n=3; - ret = FPREG+c[2]-'0'; - if(c[3]==':') - ccp[0][3]=','; - } else if(c[2]=='i') { - n=3; - ret = FPI; - } else if(c[2]=='s') { - n= (c[3] == 'r' ? 4 : 3); - ret = FPS; - } else if(c[2]=='c') { - n= (c[3] == 'r' ? 4 : 3); - ret = FPC; - } else if (!isalpha(c[2]) && !isdigit(c[2])) { - n = 2; - ret = ADDR + 6; - } - - - } - break; - case 'i': - if (c[1] == 's' && c[2] == 'p') { - n = 3; - ret = ISP; - } else if (c[1] == 'c') { - n = 2; - ret = IC; - } else if (c[1] == 't' && c[2] == 't') { - if ('0' <= c[3] && c[3] <= '1') { - n = 4; - ret = ITT0 + (c[3] - '0'); - } /* ITT[01] */ - } - break; - case 'm': - if (c[1] == 's' && c[2] == 'p') { - n = 3; - ret = MSP; - } else if (c[1] == 'm' && c[2] == 'u' && c[3] == 's' && c[4] == 'r') { - n = 5; - ret = MMUSR; - } - break; - case 'n': - if (c[1] == 'c') { - n = 2; - ret = NC; - } - break; - case 'p': - if(c[1]=='c') { -#ifndef NO_68851 - if(c[2] == 's' && c[3]=='r') { - n=4; - ret = (PCSR); - } else -#endif - { - n=2; - ret = PC; - } - } -#ifndef NO_68851 - else if (c[1] == 's' && c[2] == 'r') { - n = 3; - ret = (PSR); - } -#endif - break; - case 's': -#ifndef NO_68851 - if (c[1] == 'c' && c[2] == 'c') { - n = 3; - ret = (SCC); - } else -#endif - if (c[1] == 'r') { - if (c[2] == 'p') { - n = 3; - ret = SRP; - } else { - n = 2; - ret = SR; - } /* srp else sr */ - } else if (c[1] == 'p') { - n = 2; - ret = SP; - } else if (c[1] == 'f' && c[2] == 'c') { - n = 3; - ret = SFC; - } - break; - case 't': - if (c[1] == 'c') { - n = 2; - ret = TC; - } - break; - case 'u': - if (c[1] == 's' && c[2] == 'p') { - n=3; - ret = USP; - } else if (c[1] == 'r' && c[2] == 'p') { - n = 3; - ret = URP; - } - break; - case 'v': -#ifndef NO_68851 - if (c[1] == 'a' && c[2] == 'l') { - n = 3; - ret = (VAL); - } else -#endif - if(c[1]=='b' && c[2]=='r') { - n=3; - ret = VBR; - } - break; - case 'z': - if(c[1]=='p' && c[2]=='c') { - n=3; - ret = ZPC; - } - break; - default: - break; - } - if(n) { -#ifdef REGISTER_PREFIX - n++; -#endif - if(isalnum(ccp[0][n]) || ccp[0][n]=='_') - ret=FAIL; - else - ccp[0]+=n; - } else - ret = FAIL; - return ret; -} - -#define SKIP_WHITE() { str++; if(ISSPACE(*str)) str++;} - -#ifdef MRI - - -/* Parse an operand from the text *str into the operand struct *opP. */ -int - m68k_ip_op(str,opP) -char *str; -register struct m68k_op *opP; -{ - char *strend; - long i; - char *parse_index(); - - /* Skip leading blank */ - if(ISSPACE(*str)) - str++; - if(!*str) { - opP->error="Missing operand"; - return FAIL; - } - /* *strend = last character of string */ - for(strend=str;*strend;strend++) - ; - --strend; - - /* Logic of the parsing switch(*str): - case opP->mode = - ---- ----------- - #anything IMMED 1 - REG AREG or DREG or MSCR 3 or 2 or 13 - REG- or REG/ REGLST 14 - (REG) AINDR 4 - (REG)+ AINC 6 - (REG,INDX) AINDX 8 - (EXPR,REG) AOFF 7 - (EXPR,REG,INDX) AINDX 8 - -(REG) ADEC 5 - EXP2(REG) AOFF 7 - EXP2(REG,INDX) AINDX 8 - EXP2 ABSL 12 - - REG means truth(m68k_reg_parse(&str)) - INDX means truth(try_index(&str,opP)) - EXPR means not REG - EXP2 means not REG and not '(' and not '-(' - */ - - if(*str=='#') { - /* "#" Immediate mode */ - str++; - opP->con1=add_exp(str,strend); - opP->mode=IMMED; - return OK; - } - - i=m68k_reg_parse(&str); - if (i!=FAIL) { - if(*str=='\0') { - /* "Rn" Register Direct mode */ - opP->reg=i; - if(i>=DATA+0 && i<=DATA+7) - opP->mode=DREG; - else if(i>=ADDR+0 && i<=ADDR+7) - opP->mode=AREG; - else - opP->mode=MSCR; - return OK; - } - else if(*str=='/' || *str=='-') { - /* "Rm-Rn/Ro-Rp" Register list for MOVEM instruction */ - opP->mode=REGLST; - return get_regs(i,str,opP); - } - else { - opP->error="Junk after register name"; - return FAIL; - } - } - - if(*str=='(') { - str++; - i=m68k_reg_parse(&str); - if((iADDR+7) && i!=PC && i!=ZPC && i!=FAIL - && (*str != ')' || str[1] != '\0' || iDATA+7)) { - /* Can't indirect off non address regs, - but (dx) is OK for cas2. */ - opP->error="Invalid indirect register"; - return FAIL; - } - if(i!=FAIL) { - opP->reg=i; - if(*str==')') { - str++; - if(*str=='\0') { - /* "(An)" Address Register Indirect mode - or "(Dn)" for cas2 instruction. */ - if (i < DATA + 0 || i > DATA + 7) - opP->mode=AINDR; - else - opP->mode=DINDR; - return OK; - } - if(*str=='+') { - if(str[1]=='\0') { - /* "(An)+" Register Indirect w Postincrement */ - opP->mode=AINC; - return OK; - } - } - opP->error="Junk after indirect"; - return FAIL; - } - if(*str==',') { - str++; - i=try_index(&str,opP); - if(i==FAIL) return FAIL; - /* "(An,Rn)" Register Indirect with Index mode*/ - opP->mode=AINDX; - return OK; - } - else { - opP->error="Bad indirect syntax"; - return FAIL; - } - } - else { - /* "(EXPR,..." , a displacement */ - char *stmp; - char *index(); - - if(stmp=index(str,',')) { - opP->con1=add_exp(str,stmp-1); - str=stmp; - SKIP_WHITE(); - i=m68k_reg_parse(&str); - if((iADDR+7) && i!=PC && i!=ZPC) { - /* Can't indirect off non address regs */ - opP->error="Invalid indirect register"; - return FAIL; - } - if(i!=FAIL) { - opP->reg=i; - if(*str==')') { - /* "(d,An)" Register Indirect w Displacement */ - opP->mode=AOFF; - return OK; - } - if(*str==',') { - str++; - i=try_index(&str,opP); - if(i==FAIL) return FAIL; - /* "(d,An,Rn)" Register Indirect with Index */ - opP->mode=AINDX; - return OK; - } - else { - opP->error="Bad indirect syntax"; - return FAIL; - } - } - else { - opP->error="Invalid register"; - return FAIL; - } - } - else { - opP->error="Missing register for indirect"; - return FAIL; - } - } - } - - if(*str=='-') { - if(str[1]=='(') { - str = str+2; - i=m68k_reg_parse(&str); - if((iADDR+7) && i!=PC && i!=ZPC && i!=FAIL) { - /* Can't indirect off non address regs */ - opP->error="Invalid indirect register"; - return FAIL; - } - if(i!=FAIL) { - opP->reg=i; - if(*str==')') { - str++; - if(*str=='\0') { - /* "-(An)" Register Indirect with Predecrement */ - opP->mode=ADEC; - return OK; - } - opP->error="Junk after indirect"; - return FAIL; - } - opP->error="Bad indirect syntax"; - return FAIL; - } - opP->error="Invalid register"; - return FAIL; - } - /* if '-' but not "-(', do nothing */ - } - - /* whether *str=='-' or not */ - { - /* "EXP2" or "EXP2(REG..." */ - char *stmp; - char *index(); - if(stmp=index(str,'(')) { - opP->con1=add_exp(str,stmp-1); - str=stmp+1; - i=m68k_reg_parse(&str); - if((iADDR+7) && i!=PC && i!=ZPC) { - /* Can't indirect off non address regs */ - opP->error="Invalid indirect register"; - return FAIL; - } - if(i!=FAIL) { - opP->reg=i; - if(*str==')') { - /* "d(An)" Register Indirect w Displacement */ - opP->mode=AOFF; - return OK; - } - if(*str==',') { - str++; - i=try_index(&str,opP); - if(i==FAIL) return FAIL; - /* "d(An,Rn)" Register Indirect with Index */ - opP->mode=AINDX; - return OK; - } - else { - opP->error="Bad indirect syntax"; - return FAIL; - } - } - else { - opP->error="Invalid register"; - return FAIL; - } - } - else { - /* "EXP2" Absolute */ - opP->mode=ABSL; - if(strend[-1]=='.') { /* mode ==foo.[wl] */ - switch(*strend) { - case 'w': - case 'W': - opP->isiz=2; - break; - case 'l': - case 'L': - opP->isiz=3; - break; - default: - opP->error="Size spec not .W or .L"; - return FAIL; - } - strend-=2; - } - else opP->isiz=0; - - - opP->con1=add_exp(str,strend); - return OK; - } - } -} -/* end of m68k_ip_op () */ -#else -/* - * m68k_ip_op := '#' + - * | + range_sep + get_regs - * ; - * - * range_sep := '/' | '-' ; - * - * SKIP_WHITE := | ' ' ; - * - */ - -int - m68k_ip_op(str,opP) -char *str; -register struct m68k_op *opP; -{ - char *strend; - long i; - char *parse_index(); - - if (ISSPACE(*str)) { - str++; - } /* Find the beginning of the string */ - - if(!*str) { - opP->error="Missing operand"; - return FAIL; - } /* Out of gas */ - - for(strend = str; *strend; strend++) ;; - - --strend; - - if(*str=='#') { - str++; - opP->con1=add_exp(str,strend); - opP->mode=IMMED; - return OK; - } /* Guess what: A constant. Shar and enjoy */ - - i = m68k_reg_parse(&str); - - /* is a register, is exactly a register, and is followed by '@' */ - - if((i==FAIL || *str!='\0') && *str!='@') { - char *stmp; - - if(i!=FAIL && (*str=='/' || *str=='-')) { - opP->mode=REGLST; - return(get_regs(i,str,opP)); - } - if ((stmp=strchr(str,'@')) != '\0') { - opP->con1=add_exp(str,stmp-1); - if(stmp==strend) { - opP->mode=AINDX; - return(OK); - } - - if ((current_architecture & m68020up) == 0) { - return(FAIL); - } /* if target is not a '20 or better */ - - stmp++; - if(*stmp++!='(' || *strend--!=')') { - opP->error="Malformed operand"; - return(FAIL); - } - i=try_index(&stmp,opP); - opP->con2=add_exp(stmp,strend); - - if (i == FAIL) { - opP->mode=AMIND; - } else { - opP->mode=APODX; - } - return(OK); - } /* if there's an '@' */ - opP->mode = ABSL; - opP->con1 = add_exp(str,strend); - return(OK); - } /* not a register, not exactly a register, or no '@' */ - - opP->reg=i; - - if (*str=='\0') { - if(i>=DATA+0 && i<=DATA+7) - opP->mode=DREG; - else if(i>=ADDR+0 && i<=ADDR+7) - opP->mode=AREG; - else - opP->mode=MSCR; - return OK; - } - - /* Can't indirect off non address regs, but Dx@ is OK for cas2 */ - if((iADDR+7) && i!=PC && i!=ZPC && i!=FAIL - && (str[1] != '\0' || iDATA+7)) { - opP->error="Invalid indirect register"; - return FAIL; - } - know(*str == '@'); - - str++; - switch(*str) { - case '\0': - if (i < DATA + 0 || i > DATA + 7) - opP->mode=AINDR; - else - opP->mode=DINDR; - return OK; - case '-': - opP->mode=ADEC; - return OK; - case '+': - opP->mode=AINC; - return OK; - case '(': - str++; - break; - default: - opP->error="Junk after indirect"; - return FAIL; - } - /* Some kind of indexing involved. Lets find out how bad it is */ - i=try_index(&str,opP); - /* Didn't start with an index reg, maybe its offset or offset,reg */ - if(i==FAIL) { - char *beg_str; - - beg_str=str; - for(i=1;i;) { - switch(*str++) { - case '\0': - opP->error="Missing )"; - return FAIL; - case ',': i=0; break; - case '(': i++; break; - case ')': --i; break; - } - } - /* if(str[-3]==':') { - int siz; - - switch(str[-2]) { - case 'b': - case 'B': - siz=1; - break; - case 'w': - case 'W': - siz=2; - break; - case 'l': - case 'L': - siz=3; - break; - default: - opP->error="Specified size isn't :w or :l"; - return FAIL; - } - opP->con1=add_exp(beg_str,str-4); - opP->con1->e_siz=siz; - } else */ - opP->con1=add_exp(beg_str,str-2); - /* Should be offset,reg */ - if(str[-1]==',') { - i=try_index(&str,opP); - if(i==FAIL) { - opP->error="Malformed index reg"; - return FAIL; - } - } - } - /* We've now got offset) offset,reg) or reg) */ - - if (*str == '\0') { - /* Th-the-thats all folks */ - if (opP->reg == FAIL) opP->mode = AINDX; /* Other form of indirect */ - else if(opP->ireg == FAIL) opP->mode = AOFF; - else opP->mode = AINDX; - return(OK); - } - /* Next thing had better be another @ */ - if(*str!='@' || str[1]!='(') { - opP->error = "junk after indirect"; - return(FAIL); - } - - if ((current_architecture & m68020up) == 0) { - return(FAIL); - } /* if target is not a '20 or better */ - - str+=2; - - if(opP->ireg != FAIL) { - opP->mode = APRDX; - - i = try_index(&str, opP); - if (i != FAIL) { - opP->error = "Two index registers! not allowed!"; - return(FAIL); - } - } else { - i = try_index(&str, opP); - } - - if (i == FAIL) { - char *beg_str; - - beg_str = str; - - for (i = 1; i; ) { - switch(*str++) { - case '\0': - opP->error="Missing )"; - return(FAIL); - case ',': i=0; break; - case '(': i++; break; - case ')': --i; break; - } - } - - opP->con2=add_exp(beg_str,str-2); - - if (str[-1] == ',') { - if (opP->ireg != FAIL) { - opP->error = "Can't have two index regs"; - return(FAIL); - } - - i = try_index(&str, opP); - - if (i == FAIL) { - opP->error = "malformed index reg"; - return(FAIL); - } - - opP->mode = APODX; - } else if (opP->ireg != FAIL) { - opP->mode = APRDX; - } else { - opP->mode = AMIND; - } - } else { - opP->mode = APODX; - } - - if(*str!='\0') { - opP->error="Junk after indirect"; - return FAIL; - } - return(OK); -} /* m68k_ip_op() */ -#endif -/* - * - * try_index := data_or_address_register + ')' + SKIP_W - * | data_or_address_register + ':' + SKIP_W + size_spec + SKIP_W + multiplier + ')' + SKIP_W - * - * multiplier := - * | ':' + multiplier_number - * ; - * - * multiplier_number := '1' | '2' | '4' | '8' ; - * - * size_spec := 'l' | 'L' | 'w' | 'W' ; - * - * SKIP_W := | ' ' ; - * - */ - -static int try_index(s,opP) -char **s; -struct m68k_op *opP; -{ - register int i; - char *ss; -#define SKIP_W() { ss++; if (ISSPACE(*ss)) ss++;} - - ss= *s; - /* SKIP_W(); */ - i=m68k_reg_parse(&ss); - if(!(i>=DATA+0 && i<=ADDR+7)) { /* if i is not DATA or ADDR reg */ - *s=ss; - return FAIL; - } - opP->ireg=i; - /* SKIP_W(); */ - if(*ss==')') { - opP->isiz=0; - opP->imul=1; - SKIP_W(); - *s=ss; - return OK; - } - if(*ss!=SIZER) - { - opP->error="Missing : in index register"; - *s=ss; - return FAIL; - } - SKIP_W(); - switch(*ss) { - case 'w': - case 'W': - opP->isiz=2; - break; - case 'l': - case 'L': - opP->isiz=3; - break; - default: - opP->error="Index register size spec not :w or :l"; - *s=ss; - return FAIL; - } - SKIP_W(); - if(*ss==MULTIPLIER) - { - SKIP_W(); - switch(*ss) { - case '1': - case '2': - case '4': - case '8': - opP->imul= *ss-'0'; - break; - default: - opP->error="index multiplier not 1, 2, 4 or 8"; - *s=ss; - return FAIL; - } - SKIP_W(); - } else opP->imul=1; - if(*ss!=')') { - opP->error="Missing )"; - *s=ss; - return FAIL; - } - SKIP_W(); - *s=ss; - return OK; -} /* try_index() */ - -#ifdef TEST1 /* TEST1 tests m68k_ip_op(), which parses operands */ -main() -{ - char buf[128]; - struct m68k_op thark; - - for(;;) { - if(!gets(buf)) - break; - memset(&thark, '\0', sizeof(thark)); - if(!m68k_ip_op(buf,&thark)) printf("FAIL:"); - if(thark.error) - printf("op1 error %s in %s\n",thark.error,buf); - printf("mode %d, reg %d, ",thark.mode,thark.reg); - if(thark.b_const) - printf("Constant: '%.*s',",1+thark.e_const-thark.b_const,thark.b_const); - printf("ireg %d, isiz %d, imul %d ",thark.ireg,thark.isiz,thark.imul); - if(thark.b_iadd) - printf("Iadd: '%.*s'",1+thark.e_iadd-thark.b_iadd,thark.b_iadd); - printf("\n"); - } - exit(0); -} - -#endif - - -static struct hash_control* op_hash = NULL; /* handle of the OPCODE hash table - NULL means any use before m68k_ip_begin() - will crash */ - - -/* - * m 6 8 k _ i p ( ) - * - * This converts a string into a 68k instruction. - * The string must be a bare single instruction in sun format - * with RMS-style 68020 indirects - * (example: ) - * - * It provides some error messages: at most one fatal error message (which - * stops the scan) and at most one warning message for each operand. - * The 68k instruction is returned in exploded form, since we have no - * knowledge of how you parse (or evaluate) your expressions. - * We do however strip off and decode addressing modes and operation - * mnemonic. - * - * This function's value is a string. If it is not "" then an internal - * logic error was found: read this code to assign meaning to the string. - * No argument string should generate such an error string: - * it means a bug in our code, not in the user's text. - * - * You MUST have called m68k_ip_begin() once and m86_ip_end() never before using - * this function. - */ - -/* JF this function no longer returns a useful value. Sorry */ -void m68k_ip (instring) -char *instring; -{ - register char *p; - register struct m68k_op *opP; - register struct m68k_incant *opcode, prev_opcode; - register char *s; - register int tmpreg = 0, - baseo = 0, - outro = 0, - nextword; - int siz1, - siz2; - char c; - int losing; - int opsfound; - char *crack_operand(); - - LITTLENUM_TYPE words[6]; - LITTLENUM_TYPE *wordp; - - if (ISSPACE(*instring)) - instring++; /* skip leading whitespace */ - - /* Scan up to end of operation-code, which MUST end in end-of-string - or exactly 1 space. */ - for (p = instring; *p != '\0'; p++) - if (ISSPACE(*p)) - break; - - - if (p == instring) { - the_ins.error = "No operator"; - the_ins.opcode[0] = NULL; - /* the_ins.numo=1; */ - return; - } - - /* p now points to the end of the opcode name, probably whitespace. - make sure the name is null terminated by clobbering the whitespace, - look it up in the hash table, then fix it back. */ - c = *p; - *p = '\0'; -#ifdef MRI - /* Copy from input line to our private buffer, and drop any dots */ - { - char our_copy[100]; - char *dst = our_copy; - char *src = instring; - while (*src) - { - if (*src != '.') - *dst++ = *src; - src++; - } - *dst = 0; - - - opcode = (struct m68k_incant *)hash_find (op_hash, our_copy); - - /* If no match, try again with a w suffix */ - if (!opcode) - { - *dst++ = 'w'; - *dst = 0; - opcode = (struct m68k_incant *)hash_find (op_hash, our_copy); - } - - - - } - -#else - opcode = (struct m68k_incant *)hash_find (op_hash, instring); -#endif - *p = c; - - if (opcode == NULL) { - the_ins.error = "Unknown opcode"; - the_ins.opcode[0] = NULL; - /* the_ins.numo=1; */ - return; - } - - /* found a legitimate opcode, start matching operands */ - while (ISSPACE(*p)) ++p; - - for(opP = &the_ins.operands[0]; *p; opP++) { - - p = crack_operand(p, opP); - - if (opP->error) { - the_ins.error=opP->error; - return; - } - } - - opsfound = opP - &the_ins.operands[0]; - - /* This ugly hack is to support the floating pt opcodes in their standard form */ - /* Essentially, we fake a first enty of type COP#1 */ - if (opcode->m_operands[0]=='I') { - int n; - - for(n=opsfound;n>0;--n) - the_ins.operands[n]=the_ins.operands[n-1]; - - /* memcpy((char *)(&the_ins.operands[1]), (char *)(&the_ins.operands[0]), opsfound*sizeof(the_ins.operands[0])); */ - memset((char *)(&the_ins.operands[0]), '\0', sizeof(the_ins.operands[0])); - the_ins.operands[0].mode=MSCR; - the_ins.operands[0].reg=COPNUM; /* COP #1 */ - opsfound++; - } - - /* We've got the operands. Find an opcode that'll accept them */ - for (losing = 0; ; ) { - /* if we didn't get the right number of ops, - or we have no common model with this pattern - then reject this pattern. */ - - if (opsfound != opcode->m_opnum - || ((opcode->m_arch & current_architecture) == 0)) { - - ++losing; - - } else { - for (s=opcode->m_operands, opP = &the_ins.operands[0]; *s && !losing; s += 2, opP++) { - /* Warning: this switch is huge! */ - /* I've tried to organize the cases into this order: - non-alpha first, then alpha by letter. lower-case goes directly - before uppercase counterpart. */ - /* Code with multiple case ...: gets sorted by the lowest case ... - it belongs to. I hope this makes sense. */ - switch(*s) { - case '!': - if (opP->mode == MSCR || opP->mode == IMMED - || opP->mode == DREG || opP->mode == AREG - || opP->mode == AINC || opP->mode == ADEC - || opP->mode == REGLST) - losing++; - break; - - case '#': - if(opP->mode!=IMMED) - losing++; - else { - long t; - - t=get_num(opP->con1,80); - if(s[1]=='b' && !isbyte(t)) - losing++; - else if(s[1]=='w' && !isword(t)) - losing++; - } - break; - - case '^': - case 'T': - if(opP->mode!=IMMED) - losing++; - break; - - case '$': - if(opP->mode==MSCR || opP->mode==AREG || - opP->mode==IMMED || opP->reg==PC || opP->reg==ZPC || opP->mode==REGLST) - losing++; - break; - - case '%': - if(opP->mode==MSCR || opP->reg==PC || - opP->reg==ZPC || opP->mode==REGLST) - losing++; - break; - - - case '&': - if(opP->mode==MSCR || opP->mode==DREG || - opP->mode==AREG || opP->mode==IMMED || opP->reg==PC || opP->reg==ZPC || - opP->mode==AINC || opP->mode==ADEC || opP->mode==REGLST) - losing++; - break; - - case '*': - if(opP->mode==MSCR || opP->mode==REGLST) - losing++; - break; - - case '+': - if(opP->mode!=AINC) - losing++; - break; - - case '-': - if(opP->mode!=ADEC) - losing++; - break; - - case '/': - if(opP->mode==MSCR || opP->mode==AREG || - opP->mode==AINC || opP->mode==ADEC || opP->mode==IMMED || opP->mode==REGLST) - losing++; - break; - - case ';': - if(opP->mode==MSCR || opP->mode==AREG || opP->mode==REGLST) - losing++; - break; - - case '?': - if(opP->mode==MSCR || opP->mode==AREG || - opP->mode==AINC || opP->mode==ADEC || opP->mode==IMMED || opP->reg==PC || - opP->reg==ZPC || opP->mode==REGLST) - losing++; - break; - - case '@': - if(opP->mode==MSCR || opP->mode==AREG || - opP->mode==IMMED || opP->mode==REGLST) - losing++; - break; - - case '~': /* For now! (JF FOO is this right?) */ - if(opP->mode==MSCR || opP->mode==DREG || - opP->mode==AREG || opP->mode==IMMED || opP->reg==PC || opP->reg==ZPC || opP->mode==REGLST) - losing++; - break; - - case 'A': - if(opP->mode!=AREG) - losing++; - break; - case 'a': - if (opP->mode != AINDR) { - ++losing; - } /* if not address register indirect */ - break; - case 'B': /* FOO */ - if(opP->mode!=ABSL || (flagseen['S'] && instring[0] == 'j' - && instring[1] == 'b' - && instring[2] == 's' - && instring[3] == 'r')) - losing++; - break; - - case 'C': - if(opP->mode!=MSCR || opP->reg!=CCR) - losing++; - break; - - case 'd': /* FOO This mode is a KLUDGE!! */ - if(opP->mode!=AOFF && (opP->mode!=ABSL || - opP->con1->e_beg[0]!='(' || opP->con1->e_end[0]!=')')) - losing++; - break; - - case 'D': - if(opP->mode!=DREG) - losing++; - break; - - case 'F': - if(opP->mode!=MSCR || opP->reg<(FPREG+0) || opP->reg>(FPREG+7)) - losing++; - break; - - case 'I': - if(opP->mode!=MSCR || opP->regreg>=COPNUM+7) - losing++; - break; - - case 'J': - if (opP->mode != MSCR - || opP->reg < USP - || opP->reg > URP - || cpu_of_arch(current_architecture) < m68010 /* before 68010 had none */ - || (cpu_of_arch(current_architecture) < m68020 - && opP->reg != SFC - && opP->reg != DFC - && opP->reg != USP - && opP->reg != VBR) /* 68010's had only these */ - || (cpu_of_arch(current_architecture) < m68040 - && opP->reg != SFC - && opP->reg != DFC - && opP->reg != USP - && opP->reg != VBR - && opP->reg != CACR - && opP->reg != CAAR - && opP->reg != MSP - && opP->reg != ISP) /* 680[23]0's have only these */ - || (cpu_of_arch(current_architecture) == m68040 /* 68040 has all but this */ - && opP->reg == CAAR)) { - losing++; - } /* doesn't cut it */ - break; - - case 'k': - if(opP->mode!=IMMED) - losing++; - break; - - case 'l': - case 'L': - if(opP->mode==DREG || opP->mode==AREG || opP->mode==FPREG) { - if(s[1]=='8') - losing++; - else { - opP->mode=REGLST; - opP->reg=1<<(opP->reg-DATA); - } - } else if(opP->mode!=REGLST) { - losing++; - } else if(s[1]=='8' && opP->reg&0x0FFffFF) - losing++; - else if(s[1]=='3' && opP->reg&0x7000000) - losing++; - break; - - case 'M': - if(opP->mode!=IMMED) - losing++; - else { - long t; - - t=get_num(opP->con1,80); - if(!issbyte(t) || isvar(opP->con1)) - losing++; - } - break; - - case 'O': - if(opP->mode!=DREG && opP->mode!=IMMED) - losing++; - break; - - case 'Q': - if(opP->mode!=IMMED) - losing++; - else { - long t; - - t=get_num(opP->con1,80); - if(t<1 || t>8 || isvar(opP->con1)) - losing++; - } - break; - - case 'R': - if(opP->mode!=DREG && opP->mode!=AREG) - losing++; - break; - - case 'r': - if(opP->mode!=AINDR && opP->mode!=DINDR) - losing++; - break; - - case 's': - if(opP->mode!=MSCR || !(opP->reg==FPI || opP->reg==FPS || opP->reg==FPC)) - losing++; - break; - - case 'S': - if(opP->mode!=MSCR || opP->reg!=SR) - losing++; - break; - - case 'U': - if(opP->mode!=MSCR || opP->reg!=USP) - losing++; - break; - - /* JF these are out of order. We could put them - in order if we were willing to put up with - bunches of #ifdef m68851s in the code */ -#ifndef NO_68851 - /* Memory addressing mode used by pflushr */ - case '|': - if(opP->mode==MSCR || opP->mode==DREG || - opP->mode==AREG || opP->mode==REGLST) - losing++; - break; - - case 'f': - if (opP->mode != MSCR || (opP->reg != SFC && opP->reg != DFC)) - losing++; - break; - - case 'P': - if (opP->mode != MSCR || (opP->reg != TC && opP->reg != CAL && - opP->reg != VAL && opP->reg != SCC && opP->reg != AC)) - losing++; - break; - - case 'V': - if (opP->reg != VAL) - losing++; - break; - - case 'W': - if (opP->mode != MSCR || (opP->reg != DRP && opP->reg != SRP && - opP->reg != CRP)) - losing++; - break; - - case 'X': - if (opP->mode != MSCR || - (!(opP->reg >= BAD && opP->reg <= BAD+7) && - !(opP->reg >= BAC && opP->reg <= BAC+7))) - losing++; - break; - - case 'Y': - if (opP->reg != PSR) - losing++; - break; - - case 'Z': - if (opP->reg != PCSR) - losing++; - break; -#endif - case 'c': - if (opP->reg != NC - && opP->reg != IC - && opP->reg != DC - && opP->reg != BC) { - losing++; - } /* not a cache specifier. */ - break; - - case '_': - if (opP->mode != ABSL) { - ++losing; - } /* not absolute */ - break; - - default: - as_fatal("Internal error: Operand mode %c unknown in line %s of file \"%s\"", - *s, __LINE__, __FILE__); - } /* switch on type of operand */ - - if (losing) break; - } /* for each operand */ - } /* if immediately wrong */ - - if (!losing) { - break; - } /* got it. */ - - - if (!opcode->m_next) - { - if ((opcode->m_arch & current_architecture) == 0) - { - the_ins.error = "Opcode not available on architecture specified"; - addword(0); - - } - else - { - the_ins.error = "instruction/operands mismatch"; - } - - return; - } /* Fell off the end */ - opcode = opcode->m_next; - losing = 0; - } - - /* now assemble it */ - - the_ins.args=opcode->m_operands; - the_ins.numargs=opcode->m_opnum; - the_ins.numo=opcode->m_codenum; - the_ins.opcode[0]=getone(opcode); - the_ins.opcode[1]=gettwo(opcode); - - for (s = the_ins.args, opP = &the_ins.operands[0]; *s; s += 2, opP++) { - /* This switch is a doozy. - Watch the first step; its a big one! */ - switch(s[0]) { - - case '*': - case '~': - case '%': - case ';': - case '@': - case '!': - case '&': - case '$': - case '?': - case '/': -#ifndef NO_68851 - case '|': -#endif - switch(opP->mode) { - case IMMED: - tmpreg=0x3c; /* 7.4 */ - if (strchr("bwl",s[1])) nextword=get_num(opP->con1,80); - else nextword=nextword=get_num(opP->con1,0); - if(isvar(opP->con1)) - add_fix(s[1],opP->con1,0); - switch(s[1]) { - case 'b': - if(!isbyte(nextword)) - opP->error="operand out of range"; - addword(nextword); - baseo=0; - break; - case 'w': - if(!isword(nextword)) - opP->error="operand out of range"; - addword(nextword); - baseo=0; - break; - case 'l': - addword(nextword>>16); - addword(nextword); - baseo=0; - break; - - case 'f': - baseo=2; - outro=8; - break; - case 'F': - baseo=4; - outro=11; - break; - case 'x': - baseo=6; - outro=15; - break; - case 'p': - baseo=6; - outro= -1; - break; - default: - as_fatal("Internal error: Can't decode %c%c in line %s of file \"%s\"", - *s, s[1], __LINE__, __FILE__); - } - if(!baseo) - break; - - /* We gotta put out some float */ - if(seg(opP->con1)!=SEG_BIG) { - int_to_gen(nextword); - gen_to_words(words,baseo,(long int)outro); - for(wordp=words;baseo--;wordp++) - addword(*wordp); - break; - } /* Its BIG */ - if(offs(opP->con1)>0) { - as_warn("Bignum assumed to be binary bit-pattern"); - if(offs(opP->con1)>baseo) { - as_warn("Bignum too big for %c format; truncated",s[1]); - offs(opP->con1)=baseo; - } - baseo-=offs(opP->con1); - for(wordp=generic_bignum+offs(opP->con1)-1;offs(opP->con1)--;--wordp) - addword(*wordp); - while(baseo--) - addword(0); - break; - } - gen_to_words(words,baseo,(long)outro); - for (wordp=words;baseo--;wordp++) - addword(*wordp); - break; - case DREG: - tmpreg=opP->reg-DATA; /* 0.dreg */ - break; - case AREG: - tmpreg=0x08+opP->reg-ADDR; /* 1.areg */ - break; - case AINDR: - tmpreg=0x10+opP->reg-ADDR; /* 2.areg */ - break; - case ADEC: - tmpreg=0x20+opP->reg-ADDR; /* 4.areg */ - break; - case AINC: - tmpreg=0x18+opP->reg-ADDR; /* 3.areg */ - break; - case AOFF: - - nextword=get_num(opP->con1,80); - /* Force into index mode. Hope this works */ - - /* We do the first bit for 32-bit displacements, - and the second bit for 16 bit ones. It is - possible that we should make the default be - WORD instead of LONG, but I think that'd - break GCC, so we put up with a little - inefficiency for the sake of working output. - */ - - if( !issword(nextword) - || ( isvar(opP->con1) - && ( ( opP->con1->e_siz==0 - && flagseen['l']==0) - || opP->con1->e_siz==3))) { - - if(opP->reg==PC) - tmpreg=0x3B; /* 7.3 */ - else - tmpreg=0x30+opP->reg-ADDR; /* 6.areg */ - if(isvar(opP->con1)) { - if(opP->reg==PC) { - add_frag(adds(opP->con1), - offs(opP->con1), - TAB(PCLEA,SZ_UNDEF)); - break; - } else { - addword(0x0170); - add_fix('l',opP->con1,1); - } - } else - addword(0x0170); - addword(nextword>>16); - } else { - if(opP->reg==PC) - tmpreg=0x3A; /* 7.2 */ - else - tmpreg=0x28+opP->reg-ADDR; /* 5.areg */ - - if(isvar(opP->con1)) { - if(opP->reg==PC) { - add_fix('w',opP->con1,1); - } else - add_fix('w',opP->con1,0); - } - } - addword(nextword); - break; - - case APODX: - case AMIND: - case APRDX: - know(current_architecture & m68020up); - /* intentional fall-through */ - case AINDX: - nextword=0; - baseo=get_num(opP->con1,80); - outro=get_num(opP->con2,80); - /* Figure out the 'addressing mode' */ - /* Also turn on the BASE_DISABLE bit, if needed */ - if(opP->reg==PC || opP->reg==ZPC) { - tmpreg=0x3b; /* 7.3 */ - if(opP->reg==ZPC) - nextword|=0x80; - } else if(opP->reg==FAIL) { - nextword|=0x80; - tmpreg=0x30; /* 6.garbage */ - } else tmpreg=0x30+opP->reg-ADDR; /* 6.areg */ - - siz1= (opP->con1) ? opP->con1->e_siz : 0; - siz2= (opP->con2) ? opP->con2->e_siz : 0; - - /* Index register stuff */ - if(opP->ireg>=DATA+0 && opP->ireg<=ADDR+7) { - nextword|=(opP->ireg-DATA)<<12; - - if(opP->isiz==0 || opP->isiz==3) - nextword|=0x800; - switch(opP->imul) { - case 1: break; - case 2: nextword|=0x200; break; - case 4: nextword|=0x400; break; - case 8: nextword|=0x600; break; - default: as_fatal("failed sanity check."); - } - /* IF its simple, - GET US OUT OF HERE! */ - - /* Must be INDEX, with an index - register. Address register - cannot be ZERO-PC, and either - :b was forced, or we know - it will fit */ - if( opP->mode==AINDX - && opP->reg!=FAIL - && opP->reg!=ZPC - && ( siz1==1 - || ( issbyte(baseo) - && !isvar(opP->con1)))) { - nextword +=baseo&0xff; - addword(nextword); - if(isvar(opP->con1)) - add_fix('B',opP->con1,0); - break; - } - } else - nextword|=0x40; /* No index reg */ - - /* It aint simple */ - nextword|=0x100; - /* If the guy specified a width, we assume that - it is wide enough. Maybe it isn't. If so, we lose - */ - switch(siz1) { - case 0: - if(isvar(opP->con1) || !issword(baseo)) { - siz1=3; - nextword|=0x30; - } else if(baseo==0) - nextword|=0x10; - else { - nextword|=0x20; - siz1=2; - } - break; - case 1: - as_warn("Byte dispacement won't work. Defaulting to :w"); - case 2: - nextword|=0x20; - break; - case 3: - nextword|=0x30; - break; - } - - /* Figure out innner displacement stuff */ - if(opP->mode!=AINDX) { - switch(siz2) { - case 0: - if(isvar(opP->con2) || !issword(outro)) { - siz2=3; - nextword|=0x3; - } else if(outro==0) - nextword|=0x1; - else { - nextword|=0x2; - siz2=2; - } - break; - case 1: - as_warn("Byte dispacement won't work. Defaulting to :w"); - case 2: - nextword|=0x2; - break; - case 3: - nextword|=0x3; - break; - } - if(opP->mode==APODX) nextword|=0x04; - else if(opP->mode==AMIND) nextword|=0x40; - } - addword(nextword); - - if(isvar(opP->con1)) { - if(opP->reg==PC || opP->reg==ZPC) { - add_fix(siz1==3 ? 'l' : 'w',opP->con1,1); - opP->con1->e_exp.X_add_number+=6; - } else - add_fix(siz1==3 ? 'l' : 'w',opP->con1,0); - } - if(siz1==3) - addword(baseo>>16); - if(siz1) - addword(baseo); - - if(isvar(opP->con2)) { - if(opP->reg==PC || opP->reg==ZPC) { - add_fix(siz2==3 ? 'l' : 'w',opP->con2,1); - opP->con1->e_exp.X_add_number+=6; - } else - add_fix(siz2==3 ? 'l' : 'w',opP->con2,0); - } - if(siz2==3) - addword(outro>>16); - if(siz2) - addword(outro); - - break; - - case ABSL: - nextword=get_num(opP->con1,80); - switch(opP->con1->e_siz) { - default: - as_warn("Unknown size for absolute reference"); - case 0: - if(!isvar(opP->con1) && issword(offs(opP->con1))) { - tmpreg=0x38; /* 7.0 */ - addword(nextword); - break; - } - /* Don't generate pc relative code - on 68010 and 68000 */ - if(isvar(opP->con1) - && !subs(opP->con1) - && seg(opP->con1) == SEG_TEXT - && now_seg == SEG_TEXT - && cpu_of_arch(current_architecture) < m68020 - && !flagseen['S'] - && !strchr("~%&$?", s[0])) { - tmpreg=0x3A; /* 7.2 */ - add_frag(adds(opP->con1), - offs(opP->con1), - TAB(PCREL,SZ_UNDEF)); - break; - } - case 3: /* Fall through into long */ - if(isvar(opP->con1)) - add_fix('l',opP->con1,0); - - tmpreg=0x39; /* 7.1 mode */ - addword(nextword>>16); - addword(nextword); - break; - - case 2: /* Word */ - if(isvar(opP->con1)) - add_fix('w',opP->con1,0); - - tmpreg=0x38; /* 7.0 mode */ - addword(nextword); - break; - } - break; - case DINDR: - as_bad("invalid indirect register"); - break; - case MSCR: - default: - as_bad("unknown/incorrect operand"); - /* abort(); */ - } - install_gen_operand(s[1],tmpreg); - break; - - case '#': - case '^': - switch(s[1]) { /* JF: I hate floating point! */ - case 'j': - tmpreg=70; - break; - case '8': - tmpreg=20; - break; - case 'C': - tmpreg=50; - break; - case '3': - default: - tmpreg=80; - break; - } - tmpreg=get_num(opP->con1,tmpreg); - if(isvar(opP->con1)) - add_fix(s[1],opP->con1,0); - switch(s[1]) { - case 'b': /* Danger: These do no check for - certain types of overflow. - user beware! */ - if(!isbyte(tmpreg)) - opP->error="out of range"; - insop(tmpreg); - if(isvar(opP->con1)) - the_ins.reloc[the_ins.nrel-1].n=(opcode->m_codenum)*2; - break; - case 'w': - if(!isword(tmpreg)) - opP->error="out of range"; - insop(tmpreg); - if(isvar(opP->con1)) - the_ins.reloc[the_ins.nrel-1].n=(opcode->m_codenum)*2; - break; - case 'l': - insop(tmpreg); /* Because of the way insop works, we put these two out backwards */ - insop(tmpreg>>16); - if(isvar(opP->con1)) - the_ins.reloc[the_ins.nrel-1].n=(opcode->m_codenum)*2; - break; - case '3': - tmpreg&=0xFF; - case '8': - case 'C': - install_operand(s[1],tmpreg); - break; - default: - as_fatal("Internal error: Unknown mode #%c in line %s of file \"%s\"", s[1], __LINE__, __FILE__); - } - break; - - case '+': - case '-': - case 'A': - case 'a': - install_operand(s[1],opP->reg-ADDR); - break; - - case 'B': - tmpreg=get_num(opP->con1,80); - switch(s[1]) { - case 'B': - /* Needs no offsetting */ - add_fix('B',opP->con1,1); - break; - case 'W': - /* Offset the displacement to be relative to byte disp location */ - opP->con1->e_exp.X_add_number+=2; - add_fix('w',opP->con1,1); - addword(0); - break; - case 'L': - long_branch: - if (cpu_of_arch(current_architecture) < m68020) /* 68000 or 010 */ - as_warn("Can't use long branches on 68000/68010"); - the_ins.opcode[the_ins.numo-1]|=0xff; - /* Offset the displacement to be relative to byte disp location */ - opP->con1->e_exp.X_add_number+=4; - add_fix('l',opP->con1,1); - addword(0); - addword(0); - break; - case 'g': - if(subs(opP->con1)) /* We can't relax it */ - goto long_branch; - - /* This could either be a symbol, or an - absolute address. No matter, the - frag hacking will finger it out. - Not quite: it can't switch from - BRANCH to BCC68000 for the case - where opnd is absolute (it needs - to use the 68000 hack since no - conditional abs jumps). */ - if (((cpu_of_arch(current_architecture) < m68020) || (0==adds(opP->con1))) - && (the_ins.opcode[0] >= 0x6200) - && (the_ins.opcode[0] <= 0x6f00)) { - add_frag(adds(opP->con1),offs(opP->con1),TAB(BCC68000,SZ_UNDEF)); - } else { - add_frag(adds(opP->con1),offs(opP->con1),TAB(BRANCH,SZ_UNDEF)); - } - break; - case 'w': - if(isvar(opP->con1)) { - /* check for DBcc instruction */ - if ((the_ins.opcode[0] & 0xf0f8) ==0x50c8) { - /* size varies if patch */ - /* needed for long form */ - add_frag(adds(opP->con1),offs(opP->con1),TAB(DBCC,SZ_UNDEF)); - break; - } - - /* Don't ask! */ - opP->con1->e_exp.X_add_number+=2; - add_fix('w',opP->con1,1); - } - addword(0); - break; - case 'C': /* Fixed size LONG coproc branches */ - the_ins.opcode[the_ins.numo-1]|=0x40; - /* Offset the displacement to be relative to byte disp location */ - /* Coproc branches don't have a byte disp option, but they are - compatible with the ordinary branches, which do... */ - opP->con1->e_exp.X_add_number+=4; - add_fix('l',opP->con1,1); - addword(0); - addword(0); - break; - case 'c': /* Var size Coprocesssor branches */ - if(subs(opP->con1)) { - add_fix('l',opP->con1,1); - add_frag((symbolS *)0,(long)0,TAB(FBRANCH,LONG)); - } else if(adds(opP->con1)) { - add_frag(adds(opP->con1),offs(opP->con1),TAB(FBRANCH,SZ_UNDEF)); - } else { - /* add_frag((symbolS *)0,offs(opP->con1),TAB(FBRANCH,SHORT)); */ - the_ins.opcode[the_ins.numo-1]|=0x40; - add_fix('l',opP->con1,1); - addword(0); - addword(4); - } - break; - default: - as_fatal("Internal error: operand type B%c unknown in line %s of file \"%s\"", - s[1], __LINE__, __FILE__); - } - break; - - case 'C': /* Ignore it */ - break; - - case 'd': /* JF this is a kludge */ - if(opP->mode==AOFF) { - install_operand('s',opP->reg-ADDR); - } else { - char *tmpP; - - tmpP=opP->con1->e_end-2; - opP->con1->e_beg++; - opP->con1->e_end-=4; /* point to the , */ - baseo=m68k_reg_parse(&tmpP); - if(baseoADDR+7) { - as_bad("Unknown address reg, using A0"); - baseo=0; - } else baseo-=ADDR; - install_operand('s',baseo); - } - tmpreg=get_num(opP->con1,80); - if(!issword(tmpreg)) { - as_warn("Expression out of range, using 0"); - tmpreg=0; - } - addword(tmpreg); - break; - - case 'D': - install_operand(s[1],opP->reg-DATA); - break; - - case 'F': - install_operand(s[1],opP->reg-FPREG); - break; - - case 'I': - tmpreg=1+opP->reg-COPNUM; - if(tmpreg==8) - tmpreg=0; - install_operand(s[1],tmpreg); - break; - - case 'J': /* JF foo */ - switch(opP->reg) { - case SFC: tmpreg=0x000; break; - case DFC: tmpreg=0x001; break; - case CACR: tmpreg=0x002; break; - case TC: tmpreg=0x003; break; - case ITT0: tmpreg=0x004; break; - case ITT1: tmpreg=0x005; break; - case DTT0: tmpreg=0x006; break; - case DTT1: tmpreg=0x007; break; - - case USP: tmpreg=0x800; break; - case VBR: tmpreg=0x801; break; - case CAAR: tmpreg=0x802; break; - case MSP: tmpreg=0x803; break; - case ISP: tmpreg=0x804; break; - case MMUSR: tmpreg=0x805; break; - case URP: tmpreg=0x806; break; - case SRP: tmpreg=0x807; break; - default: - as_fatal("failed sanity check."); - } - install_operand(s[1],tmpreg); - break; - - case 'k': - tmpreg=get_num(opP->con1,55); - install_operand(s[1],tmpreg&0x7f); - break; - - case 'l': - tmpreg=opP->reg; - if(s[1]=='w') { - if(tmpreg&0x7FF0000) - as_bad("Floating point register in register list"); - insop(reverse_16_bits(tmpreg)); - } else { - if(tmpreg&0x700FFFF) - as_bad("Wrong register in floating-point reglist"); - install_operand(s[1],reverse_8_bits(tmpreg>>16)); - } - break; - - case 'L': - tmpreg=opP->reg; - if(s[1]=='w') { - if(tmpreg&0x7FF0000) - as_bad("Floating point register in register list"); - insop(tmpreg); - } else if(s[1]=='8') { - if(tmpreg&0x0FFFFFF) - as_bad("incorrect register in reglist"); - install_operand(s[1],tmpreg>>24); - } else { - if(tmpreg&0x700FFFF) - as_bad("wrong register in floating-point reglist"); - else - install_operand(s[1],tmpreg>>16); - } - break; - - case 'M': - install_operand(s[1],get_num(opP->con1,60)); - break; - - case 'O': - tmpreg= (opP->mode==DREG) - ? 0x20+opP->reg-DATA - : (get_num(opP->con1,40)&0x1F); - install_operand(s[1],tmpreg); - break; - - case 'Q': - tmpreg=get_num(opP->con1,10); - if(tmpreg==8) - tmpreg=0; - install_operand(s[1],tmpreg); - break; - - case 'R': - case 'r': - /* This depends on the fact that ADDR registers are - eight more than their corresponding DATA regs, so - the result will have the ADDR_REG bit set */ - install_operand(s[1],opP->reg-DATA); - break; - - case 's': - if(opP->reg==FPI) tmpreg=0x1; - else if(opP->reg==FPS) tmpreg=0x2; - else if(opP->reg==FPC) tmpreg=0x4; - else as_fatal("failed sanity check."); - install_operand(s[1],tmpreg); - break; - - case 'S': /* Ignore it */ - break; - - case 'T': - install_operand(s[1],get_num(opP->con1,30)); - break; - - case 'U': /* Ignore it */ - break; - - case 'c': - switch (opP->reg) { - case NC: tmpreg = 0; break; - case DC: tmpreg = 1; break; - case IC: tmpreg = 2; break; - case BC: tmpreg = 3; break; - default: - as_fatal("failed sanity check"); - } /* switch on cache token */ - install_operand(s[1], tmpreg); - break; -#ifndef NO_68851 - /* JF: These are out of order, I fear. */ - case 'f': - switch (opP->reg) { - case SFC: - tmpreg=0; - break; - case DFC: - tmpreg=1; - break; - default: - as_fatal("failed sanity check."); - } - install_operand(s[1],tmpreg); - break; - - case 'P': - switch(opP->reg) { - case TC: - tmpreg=0; - break; - case CAL: - tmpreg=4; - break; - case VAL: - tmpreg=5; - break; - case SCC: - tmpreg=6; - break; - case AC: - tmpreg=7; - break; - default: - as_fatal("failed sanity check."); - } - install_operand(s[1],tmpreg); - break; - - case 'V': - if (opP->reg == VAL) - break; - as_fatal("failed sanity check."); - - case 'W': - switch(opP->reg) { - - case DRP: - tmpreg=1; - break; - case SRP: - tmpreg=2; - break; - case CRP: - tmpreg=3; - break; - default: - as_fatal("failed sanity check."); - } - install_operand(s[1],tmpreg); - break; - - case 'X': - switch (opP->reg) { - case BAD: case BAD+1: case BAD+2: case BAD+3: - case BAD+4: case BAD+5: case BAD+6: case BAD+7: - tmpreg = (4 << 10) | ((opP->reg - BAD) << 2); - break; - - case BAC: case BAC+1: case BAC+2: case BAC+3: - case BAC+4: case BAC+5: case BAC+6: case BAC+7: - tmpreg = (5 << 10) | ((opP->reg - BAC) << 2); - break; - - default: - as_fatal("failed sanity check."); - } - install_operand(s[1], tmpreg); - break; - case 'Y': - know(opP->reg == PSR); - break; - case 'Z': - know(opP->reg == PCSR); - break; -#endif /* m68851 */ - case '_': - tmpreg=get_num(opP->con1,80); - install_operand(s[1], tmpreg); - break; - default: - as_fatal("Internal error: Operand type %c unknown in line %s of file \"%s\"", s[0], __LINE__, __FILE__); - } - } - /* By the time whe get here (FINALLY) the_ins contains the complete - instruction, ready to be emitted. . . */ -} /* m68k_ip() */ - -/* - * get_regs := '/' + ? - * | '-' + - * | '-' + + ? - * | - * ; - * - - * The idea here must be to scan in a set of registers but I don't - * understand it. Looks awfully sloppy to me but I don't have any doc on - * this format so... - - * - * - */ - -static int get_regs(i,str,opP) -int i; -struct m68k_op *opP; -char *str; -{ - /* 26, 25, 24, 23-16, 15-8, 0-7 */ - /* Low order 24 bits encoded fpc,fps,fpi,fp7-fp0,a7-a0,d7-d0 */ - unsigned long cur_regs = 0; - int reg1, - reg2; - -#define ADD_REG(x) { if(x==FPI) cur_regs|=(1<<24);\ -else if(x==FPS) cur_regs|=(1<<25);\ -else if(x==FPC) cur_regs|=(1<<26);\ -else cur_regs|=(1<<(x-1)); } - - reg1=i; - for(;;) { - if(*str=='/') { - ADD_REG(reg1); - str++; - } else if(*str=='-') { - str++; - reg2=m68k_reg_parse(&str); - if(reg2=FPREG+8 || reg1==FPI || reg1==FPS || reg1==FPC) { - opP->error="unknown register in register list"; - return FAIL; - } - while(reg1<=reg2) { - ADD_REG(reg1); - reg1++; - } - if(*str=='\0') - break; - } else if(*str=='\0') { - ADD_REG(reg1); - break; - } else { - opP->error="unknow character in register list"; - return FAIL; - } - /* DJA -- Bug Fix. Did't handle d1-d2/a1 until the following instruction was added */ - if (*str=='/') - str ++; - reg1=m68k_reg_parse(&str); - if((reg1=FPREG+8) && !(reg1==FPI || reg1==FPS || reg1==FPC)) { - opP->error="unknown register in register list"; - return FAIL; - } - } - opP->reg=cur_regs; - return OK; -} /* get_regs() */ - -static int reverse_16_bits(in) -int in; -{ - int out=0; - int n; - - static int mask[16] = { - 0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080, - 0x0100,0x0200,0x0400,0x0800,0x1000,0x2000,0x4000,0x8000 - }; - for(n=0;n<16;n++) { - if(in&mask[n]) - out|=mask[15-n]; - } - return out; -} /* reverse_16_bits() */ - -static int reverse_8_bits(in) -int in; -{ - int out=0; - int n; - - static int mask[8] = { - 0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080, - }; - - for(n=0;n<8;n++) { - if(in&mask[n]) - out|=mask[7-n]; - } - return out; -} /* reverse_8_bits() */ - -static void install_operand(mode,val) -int mode; -int val; -{ - switch(mode) { - case 's': - the_ins.opcode[0]|=val & 0xFF; /* JF FF is for M kludge */ - break; - case 'd': - the_ins.opcode[0]|=val<<9; - break; - case '1': - the_ins.opcode[1]|=val<<12; - break; - case '2': - the_ins.opcode[1]|=val<<6; - break; - case '3': - the_ins.opcode[1]|=val; - break; - case '4': - the_ins.opcode[2]|=val<<12; - break; - case '5': - the_ins.opcode[2]|=val<<6; - break; - case '6': - /* DANGER! This is a hack to force cas2l and cas2w cmds - to be three words long! */ - the_ins.numo++; - the_ins.opcode[2]|=val; - break; - case '7': - the_ins.opcode[1]|=val<<7; - break; - case '8': - the_ins.opcode[1]|=val<<10; - break; -#ifndef NO_68851 - case '9': - the_ins.opcode[1]|=val<<5; - break; -#endif - - case 't': - the_ins.opcode[1]|=(val<<10)|(val<<7); - break; - case 'D': - the_ins.opcode[1]|=(val<<12)|val; - break; - case 'g': - the_ins.opcode[0]|=val=0xff; - break; - case 'i': - the_ins.opcode[0]|=val<<9; - break; - case 'C': - the_ins.opcode[1]|=val; - break; - case 'j': - the_ins.opcode[1]|=val; - the_ins.numo++; /* What a hack */ - break; - case 'k': - the_ins.opcode[1]|=val<<4; - break; - case 'b': - case 'w': - case 'l': - break; - case 'e': - the_ins.opcode[0] |= (val << 6); - break; - case 'L': - the_ins.opcode[1] = (val >> 16); - the_ins.opcode[2] = val & 0xffff; - break; - case 'c': - default: - as_fatal("failed sanity check."); - } -} /* install_operand() */ - -static void install_gen_operand(mode,val) -int mode; -int val; -{ - switch(mode) { - case 's': - the_ins.opcode[0]|=val; - break; - case 'd': - /* This is a kludge!!! */ - the_ins.opcode[0]|=(val&0x07)<<9|(val&0x38)<<3; - break; - case 'b': - case 'w': - case 'l': - case 'f': - case 'F': - case 'x': - case 'p': - the_ins.opcode[0]|=val; - break; - /* more stuff goes here */ - default: - as_fatal("failed sanity check."); - } -} /* install_gen_operand() */ - -/* - * verify that we have some number of paren pairs, do m68k_ip_op(), and - * then deal with the bitfield hack. - */ - -static char *crack_operand(str,opP) -register char *str; -register struct m68k_op *opP; -{ - register int parens; - register int c; - register char *beg_str; - - if(!str) { - return str; - } - beg_str=str; - for(parens=0;*str && (parens>0 || notend(str));str++) { - if(*str=='(') parens++; - else if(*str==')') { - if(!parens) { /* ERROR */ - opP->error="Extra )"; - return str; - } - --parens; - } - } - if(!*str && parens) { /* ERROR */ - opP->error="Missing )"; - return str; - } - c= *str; - *str='\0'; - if(m68k_ip_op(beg_str,opP)==FAIL) { - *str=c; - return str; - } - *str=c; - - if(c=='}') - c= *++str; /* JF bitfield hack */ - - if(c) { - c= *++str; - if(!c) - as_bad("Missing operand"); - } - return str; -} - -/* See the comment up above where the #define notend(... is */ -#if 0 -notend(s) -char *s; -{ - if(*s==',') return 0; - if(*s=='{' || *s=='}') - return 0; - if(*s!=':') return 1; - /* This kludge here is for the division cmd, which is a kludge */ - if(index("aAdD#(",s[1])) return 0; - return 1; -} -#endif - - -int done_pseudo(str) -char *str; -{ - extern struct hash_control * po_hash; - char *ptr = str; - char *null_ptr; - pseudo_typeS * pop; - - char c; - - is_end_of_line[0] = 1; - /* Skip over name of pseudo, change to lower case */ - while (isalpha(*ptr) || *ptr == '.') - { - if (isupper(*ptr)) { - *ptr = tolower(*ptr); - } - ptr++; - } - null_ptr = ptr; - c = *null_ptr; - *null_ptr = 0; - - - pop = (pseudo_typeS *)hash_find(po_hash, str); - - *null_ptr = c; - if (pop != (pseudo_typeS *)NULL) - { - input_line_pointer = null_ptr+1; - SKIP_WHITESPACE(); - /* Now we point to first non-blank char after pseudo op */ - (*pop->poc_handler)(pop->poc_val); - input_line_pointer--; - - return 1; - - } - /* Just put back the char where the null was put and return as if nothing had happened */ - - *null_ptr = c; - return 0; - -} - - -/* This is the guts of the machine-dependent assembler. STR points to a - machine dependent instruction. This function is supposed to emit - the frags/bytes it assembles to. - */ -void - md_assemble(str) -char *str; -{ - char *er; - short *fromP; - char *toP = NULL; - int m,n = 0; - char *to_beg_P; - int shorts_this_frag; - - /* if (done_pseudo(str)) return ;*/ - - - - if (current_architecture == 0) { - current_architecture = (m68020 -#ifndef NO_68881 - | m68881 -#endif -#ifndef NO_68851 - | m68851 -#endif - ); - } /* default current_architecture */ - - memset((char *)(&the_ins), '\0', sizeof(the_ins)); /* JF for paranoia sake */ - - m68k_ip(str); - er=the_ins.error; - if(!er) { - for(n=the_ins.numargs;n;--n) - if(the_ins.operands[n].error) { - er=the_ins.operands[n].error; - break; - } - } - if(er) { - as_bad("\"%s\" -- Statement '%s' ignored",er,str); - return; - } - - if(the_ins.nfrag==0) { /* No frag hacking involved; just put it out */ - toP=frag_more(2*the_ins.numo); - fromP= &the_ins.opcode[0]; - for(m=the_ins.numo;m;--m) { - md_number_to_chars(toP,(long)(*fromP),2); - toP+=2; - fromP++; - } - /* put out symbol-dependent info */ - for(m=0;mfr_literal)-the_ins.numo*2+the_ins.reloc[m].n, - n, - the_ins.reloc[m].add, - the_ins.reloc[m].sub, - the_ins.reloc[m].off, - the_ins.reloc[m].pcrel, - NO_RELOC); - } - return; - } - - /* There's some frag hacking */ - for(n=0,fromP= &the_ins.opcode[0];n= 2*shorts_this_frag /* 2*the_ins.fragb[n].fragoff */) { - the_ins.reloc[m].n-= 2*shorts_this_frag /* 2*the_ins.fragb[n].fragoff */; - break; - } - wid=the_ins.reloc[m].wid; - if(wid==0) - continue; - the_ins.reloc[m].wid=0; - wid = (wid=='b') ? 1 : (wid=='w') ? 2 : (wid=='l') ? 4 : 4000; - - fix_new(frag_now, - (toP-frag_now->fr_literal)-the_ins.numo*2+the_ins.reloc[m].n, - wid, - the_ins.reloc[m].add, - the_ins.reloc[m].sub, - the_ins.reloc[m].off, - the_ins.reloc[m].pcrel, - NO_RELOC); - } - /* know(the_ins.fragb[n].fadd); */ - (void)frag_var(rs_machine_dependent,10,0,(relax_substateT)(the_ins.fragb[n].fragty), - the_ins.fragb[n].fadd,the_ins.fragb[n].foff,to_beg_P); - } - n=(the_ins.numo-the_ins.fragb[n-1].fragoff); - shorts_this_frag=0; - if(n) { - toP=frag_more(n*sizeof(short)); - while(n--) { - md_number_to_chars(toP,(long)(*fromP),2); - toP+=2; - fromP++; - shorts_this_frag++; - } - } - for(m=0;mfr_literal)- /* the_ins.numo */ shorts_this_frag*2, - wid, - the_ins.reloc[m].add, - the_ins.reloc[m].sub, - the_ins.reloc[m].off, - the_ins.reloc[m].pcrel, - NO_RELOC); - } -} - -/* This function is called once, at assembler startup time. This should - set up all the tables, etc that the MD part of the assembler needs - */ -void - md_begin() -{ - /* - * md_begin -- set up hash tables with 68000 instructions. - * similar to what the vax assembler does. ---phr - */ - /* RMS claims the thing to do is take the m68k-opcode.h table, and make - a copy of it at runtime, adding in the information we want but isn't - there. I think it'd be better to have an awk script hack the table - at compile time. Or even just xstr the table and use it as-is. But - my lord ghod hath spoken, so we do it this way. Excuse the ugly var - names. */ - - register const struct m68k_opcode *ins; - register struct m68k_incant *hack, - *slak; - register char *retval = 0; /* empty string, or error msg text */ - register unsigned int i; - register char c; - - if ((op_hash = hash_new()) == NULL) - as_fatal("Virtual memory exhausted"); - - obstack_begin(&robyn,4000); - for (ins = m68k_opcodes; ins < endop; ins++) { - hack=slak=(struct m68k_incant *)obstack_alloc(&robyn,sizeof(struct m68k_incant)); - do { - /* we *could* ignore insns that don't match our - arch here but just leaving them out of the - hash. */ - slak->m_operands=ins->args; - slak->m_opnum=strlen(slak->m_operands)/2; - slak->m_arch = ins->arch; - slak->m_opcode=ins->opcode; - /* This is kludgey */ - slak->m_codenum=((ins->match)&0xffffL) ? 2 : 1; - if((ins+1)!=endop && !strcmp(ins->name,(ins+1)->name)) { - slak->m_next=(struct m68k_incant *) obstack_alloc(&robyn,sizeof(struct m68k_incant)); - ins++; - } else - slak->m_next=0; - slak=slak->m_next; - } while(slak); - - retval = hash_insert (op_hash, ins->name,(char *)hack); - /* Didn't his mommy tell him about null pointers? */ - if(retval && *retval) - as_fatal("Internal Error: Can't hash %s: %s",ins->name,retval); - } - - for (i = 0; i < sizeof(mklower_table) ; i++) - mklower_table[i] = (isupper(c = (char) i)) ? tolower(c) : c; - - for (i = 0 ; i < sizeof(notend_table) ; i++) { - notend_table[i] = 0; - alt_notend_table[i] = 0; - } - notend_table[','] = 1; - notend_table['{'] = 1; - notend_table['}'] = 1; - alt_notend_table['a'] = 1; - alt_notend_table['A'] = 1; - alt_notend_table['d'] = 1; - alt_notend_table['D'] = 1; - alt_notend_table['#'] = 1; - alt_notend_table['f'] = 1; - alt_notend_table['F'] = 1; - alt_notend_table['('] = 1; - -#ifdef REGISTER_PREFIX - alt_notend_table[REGISTER_PREFIX] = 1; -#endif - - -} - -#if 0 -#define notend(s) ((*s == ',' || *s == '}' || *s == '{' \ - || (*s == ':' && strchr("aAdD#(", s[1]))) \ - ? 0 : 1) -#endif - -/* This funciton is called once, before the assembler exits. It is - supposed to do any final cleanup for this part of the assembler. - */ -void - md_end() -{ -} - -/* Equal to MAX_PRECISION in atof-ieee.c */ -#define MAX_LITTLENUMS 6 - -/* Turn a string in str into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP . An error message is returned, or NULL on OK. - */ -char * - md_atof(type,litP,sizeP) -char type; -char *litP; -int *sizeP; -{ - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *wordP; - char *t; - char *atof_ieee(); - - switch(type) { - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - case 'x': - case 'X': - prec = 6; - break; - - case 'p': - case 'P': - prec = 6; - break; - - default: - *sizeP=0; - return "Bad call to MD_ATOF()"; - } - t=atof_ieee(input_line_pointer,type,words); - if(t) - input_line_pointer=t; - - *sizeP=prec * sizeof(LITTLENUM_TYPE); - for(wordP=words;prec--;) { - md_number_to_chars(litP,(long)(*wordP++),sizeof(LITTLENUM_TYPE)); - litP+=sizeof(LITTLENUM_TYPE); - } - return ""; /* Someone should teach Dean about null pointers */ -} - -/* Turn an integer of n bytes (in val) into a stream of bytes appropriate - for use in the a.out file, and stores them in the array pointed to by buf. - This knows about the endian-ness of the target machine and does - THE RIGHT THING, whatever it is. Possible values for n are 1 (byte) - 2 (short) and 4 (long) Floating numbers are put out as a series of - LITTLENUMS (shorts, here at least) - */ -void - md_number_to_chars(buf,val,n) -char *buf; -long val; -int n; -{ - switch(n) { - case 1: - *buf++=val; - break; - case 2: - *buf++=(val>>8); - *buf++=val; - break; - case 4: - *buf++=(val>>24); - *buf++=(val>>16); - *buf++=(val>>8); - *buf++=val; - break; - default: - as_fatal("failed sanity check."); - } -} - -void - md_apply_fix(fixP, val) -fixS *fixP; -long val; -{ - char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; - - switch(fixP->fx_size) { - case 1: - *buf++=val; - break; - case 2: - *buf++=(val>>8); - *buf++=val; - break; - case 4: - *buf++=(val>>24); - *buf++=(val>>16); - *buf++=(val>>8); - *buf++=val; - break; - default: - BAD_CASE (fixP->fx_size); - } -} - - -/* *fragP has been relaxed to its final size, and now needs to have - the bytes inside it modified to conform to the new size There is UGLY - MAGIC here. .. - */ -void - md_convert_frag(headers, fragP) -object_headers *headers; -register fragS *fragP; -{ - long disp; - long ext = 0; - - /* Address in object code of the displacement. */ - register int object_address = fragP -> fr_fix + fragP -> fr_address; - -#ifdef IBM_COMPILER_SUX - /* This is wrong but it convinces the native rs6000 compiler to - generate the code we want. */ - register char *buffer_address = fragP -> fr_literal; - buffer_address += fragP -> fr_fix; -#else /* IBM_COMPILER_SUX */ - /* Address in gas core of the place to store the displacement. */ - register char *buffer_address = fragP->fr_fix + fragP->fr_literal; -#endif /* IBM_COMPILER_SUX */ - - /* No longer true: know(fragP->fr_symbol); */ - - /* The displacement of the address, from current location. */ - disp = fragP->fr_symbol ? S_GET_VALUE(fragP->fr_symbol) : 0; - disp = (disp + fragP->fr_offset) - object_address; - - switch(fragP->fr_subtype) { - case TAB(BCC68000,BYTE): - case TAB(BRANCH,BYTE): - know(issbyte(disp)); - if(disp==0) - as_bad("short branch with zero offset: use :w"); - fragP->fr_opcode[1]=disp; - ext=0; - break; - case TAB(DBCC,SHORT): - know(issword(disp)); - ext=2; - break; - case TAB(BCC68000,SHORT): - case TAB(BRANCH,SHORT): - know(issword(disp)); - fragP->fr_opcode[1]=0x00; - ext=2; - break; - case TAB(BRANCH,LONG): - if (cpu_of_arch(current_architecture) < m68020) { - if (fragP->fr_opcode[0]==0x61) { - fragP->fr_opcode[0]= 0x4E; - fragP->fr_opcode[1]= 0xB9; /* JBSR with ABSL LONG offset */ - subseg_change(SEG_TEXT, 0); - - fix_new(fragP, - fragP->fr_fix, - 4, - fragP->fr_symbol, - 0, - fragP->fr_offset, - 0, - NO_RELOC); - - fragP->fr_fix+=4; - ext=0; - } else if (fragP->fr_opcode[0]==0x60) { - fragP->fr_opcode[0]= 0x4E; - fragP->fr_opcode[1]= 0xF9; /* JMP with ABSL LONG offset */ - subseg_change(SEG_TEXT, 0); - fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0, fragP->fr_offset,0, - NO_RELOC); - fragP->fr_fix+=4; - ext=0; - } else { - as_bad("Long branch offset not supported."); - } - } else { - fragP->fr_opcode[1]=0xff; - ext=4; - } - break; - case TAB(BCC68000,LONG): - /* only Bcc 68000 instructions can come here */ - /* change bcc into b!cc/jmp absl long */ - fragP->fr_opcode[0] ^= 0x01; /* invert bcc */ - fragP->fr_opcode[1] = 0x6; /* branch offset = 6 */ - - /* JF: these used to be fr_opcode[2,3], but they may be in a - different frag, in which case refering to them is a no-no. - Only fr_opcode[0,1] are guaranteed to work. */ - *buffer_address++ = 0x4e; /* put in jmp long (0x4ef9) */ - *buffer_address++ = 0xf9; - fragP->fr_fix += 2; /* account for jmp instruction */ - subseg_change(SEG_TEXT,0); - fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0, - fragP->fr_offset,0, - NO_RELOC); - fragP->fr_fix += 4; - ext=0; - break; - case TAB(DBCC,LONG): - /* only DBcc 68000 instructions can come here */ - /* change dbcc into dbcc/jmp absl long */ - /* JF: these used to be fr_opcode[2-7], but that's wrong */ - *buffer_address++ = 0x00; /* branch offset = 4 */ - *buffer_address++ = 0x04; - *buffer_address++ = 0x60; /* put in bra pc+6 */ - *buffer_address++ = 0x06; - *buffer_address++ = 0x4e; /* put in jmp long (0x4ef9) */ - *buffer_address++ = 0xf9; - - fragP->fr_fix += 6; /* account for bra/jmp instructions */ - subseg_change(SEG_TEXT,0); - fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0, - fragP->fr_offset,0, - NO_RELOC); - fragP->fr_fix += 4; - ext=0; - break; - case TAB(FBRANCH,SHORT): - know((fragP->fr_opcode[1]&0x40)==0); - ext=2; - break; - case TAB(FBRANCH,LONG): - fragP->fr_opcode[1]|=0x40; /* Turn on LONG bit */ - ext=4; - break; - case TAB(PCREL,SHORT): - ext=2; - break; - case TAB(PCREL,LONG): - /* The thing to do here is force it to ABSOLUTE LONG, since - PCREL is really trying to shorten an ABSOLUTE address anyway */ - /* JF FOO This code has not been tested */ - subseg_change(SEG_TEXT,0); - fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0, fragP->fr_offset, 0, NO_RELOC); - if((fragP->fr_opcode[1] & 0x3F) != 0x3A) - as_bad("Internal error (long PC-relative operand) for insn 0x%04lx at 0x%lx", - fragP->fr_opcode[0],fragP->fr_address); - fragP->fr_opcode[1]&= ~0x3F; - fragP->fr_opcode[1]|=0x39; /* Mode 7.1 */ - fragP->fr_fix+=4; - /* md_number_to_chars(buffer_address, - (long)(fragP->fr_symbol->sy_value + fragP->fr_offset), - 4); */ - ext=0; - break; - case TAB(PCLEA,SHORT): - subseg_change(SEG_TEXT,0); - fix_new(fragP,(int)(fragP->fr_fix),2,fragP->fr_symbol,(symbolS *)0,fragP->fr_offset,1, - NO_RELOC); - fragP->fr_opcode[1] &= ~0x3F; - fragP->fr_opcode[1] |= 0x3A; - ext=2; - break; - case TAB(PCLEA,LONG): - subseg_change(SEG_TEXT,0); - fix_new(fragP,(int)(fragP->fr_fix)+2,4,fragP->fr_symbol,(symbolS *)0,fragP->fr_offset+2,1, - NO_RELOC); - *buffer_address++ = 0x01; - *buffer_address++ = 0x70; - fragP->fr_fix+=2; - /* buffer_address+=2; */ - ext=4; - break; - -} /* switch on subtype */ - - if (ext) { - md_number_to_chars(buffer_address, (long) disp, (int) ext); - fragP->fr_fix += ext; - /* H_SET_TEXT_SIZE(headers, H_GET_TEXT_SIZE(headers) + ext); */ - } /* if extending */ - - return; -} /* md_convert_frag() */ - -/* Force truly undefined symbols to their maximum size, and generally set up - the frag list to be relaxed - */ -int md_estimate_size_before_relax(fragP, segment) -register fragS *fragP; -segT segment; -{ - int old_fix; - register char *buffer_address = fragP->fr_fix + fragP->fr_literal; - - old_fix = fragP->fr_fix; - - /* handle SZ_UNDEF first, it can be changed to BYTE or SHORT */ - switch(fragP->fr_subtype) { - - case TAB(BRANCH,SZ_UNDEF): { - if((fragP->fr_symbol != NULL) /* Not absolute */ - && S_GET_SEGMENT(fragP->fr_symbol) == segment) { - fragP->fr_subtype=TAB(TABTYPE(fragP->fr_subtype),BYTE); - break; - } else if((fragP->fr_symbol == 0) || (cpu_of_arch(current_architecture) < m68020)) { - /* On 68000, or for absolute value, switch to abs long */ - /* FIXME, we should check abs val, pick short or long */ - if(fragP->fr_opcode[0]==0x61) { - fragP->fr_opcode[0]= 0x4E; - fragP->fr_opcode[1]= 0xB9; /* JBSR with ABSL LONG offset */ - subseg_change(SEG_TEXT, 0); - fix_new(fragP, fragP->fr_fix, 4, - fragP->fr_symbol, 0, fragP->fr_offset, 0, NO_RELOC); - fragP->fr_fix+=4; - frag_wane(fragP); - } else if(fragP->fr_opcode[0]==0x60) { - fragP->fr_opcode[0]= 0x4E; - fragP->fr_opcode[1]= 0xF9; /* JMP with ABSL LONG offset */ - subseg_change(SEG_TEXT, 0); - fix_new(fragP, fragP->fr_fix, 4, - fragP->fr_symbol, 0, fragP->fr_offset, 0, NO_RELOC); - fragP->fr_fix+=4; - frag_wane(fragP); - } else { - as_warn("Long branch offset to extern symbol not supported."); - } - } else { /* Symbol is still undefined. Make it simple */ - fix_new(fragP, (int)(fragP->fr_fix), 4, fragP->fr_symbol, - (symbolS *)0, fragP->fr_offset+4, 1, NO_RELOC); - fragP->fr_fix+=4; - fragP->fr_opcode[1]=0xff; - frag_wane(fragP); - break; - } - - break; - } /* case TAB(BRANCH,SZ_UNDEF) */ - - case TAB(FBRANCH,SZ_UNDEF): { - if(S_GET_SEGMENT(fragP->fr_symbol) == segment || flagseen['l']) { - fragP->fr_subtype = TAB(FBRANCH,SHORT); - fragP->fr_var += 2; - } else { - fragP->fr_subtype = TAB(FBRANCH,LONG); - fragP->fr_var += 4; - } - break; - } /* TAB(FBRANCH,SZ_UNDEF) */ - - case TAB(PCREL,SZ_UNDEF): { - if(S_GET_SEGMENT(fragP->fr_symbol) == segment || flagseen['l']) { - fragP->fr_subtype = TAB(PCREL,SHORT); - fragP->fr_var += 2; - } else { - fragP->fr_subtype = TAB(PCREL,LONG); - fragP->fr_var += 4; - } - break; - } /* TAB(PCREL,SZ_UNDEF) */ - - case TAB(BCC68000,SZ_UNDEF): { - if((fragP->fr_symbol != NULL) - && S_GET_SEGMENT(fragP->fr_symbol) == segment) { - fragP->fr_subtype=TAB(BCC68000,BYTE); - break; - } - /* only Bcc 68000 instructions can come here */ - /* change bcc into b!cc/jmp absl long */ - fragP->fr_opcode[0] ^= 0x01; /* invert bcc */ - if(flagseen['l']) { - fragP->fr_opcode[1] = 0x04; /* branch offset = 6 */ - /* JF: these were fr_opcode[2,3] */ - buffer_address[0] = 0x4e; /* put in jmp long (0x4ef9) */ - buffer_address[1] = 0xf8; - fragP->fr_fix += 2; /* account for jmp instruction */ - subseg_change(SEG_TEXT,0); - fix_new(fragP, fragP->fr_fix, 2, fragP->fr_symbol, 0, - fragP->fr_offset, 0, NO_RELOC); - fragP->fr_fix += 2; - } else { - fragP->fr_opcode[1] = 0x06; /* branch offset = 6 */ - /* JF: these were fr_opcode[2,3] */ - buffer_address[2] = 0x4e; /* put in jmp long (0x4ef9) */ - buffer_address[3] = 0xf9; - fragP->fr_fix += 2; /* account for jmp instruction */ - subseg_change(SEG_TEXT,0); - fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0, - fragP->fr_offset, 0, NO_RELOC); - fragP->fr_fix += 4; - } - frag_wane(fragP); - break; - } /* case TAB(BCC68000,SZ_UNDEF) */ - - case TAB(DBCC,SZ_UNDEF): { - if (fragP->fr_symbol != NULL && S_GET_SEGMENT(fragP->fr_symbol) == segment) { - fragP->fr_subtype=TAB(DBCC,SHORT); - fragP->fr_var+=2; - break; - } - /* only DBcc 68000 instructions can come here */ - /* change dbcc into dbcc/jmp absl long */ - /* JF: these used to be fr_opcode[2-4], which is wrong. */ - buffer_address[0] = 0x00; /* branch offset = 4 */ - buffer_address[1] = 0x04; - buffer_address[2] = 0x60; /* put in bra pc + ... */ - - if(flagseen['l']) { - /* JF: these were fr_opcode[5-7] */ - buffer_address[3] = 0x04; /* plus 4 */ - buffer_address[4] = 0x4e;/* Put in Jump Word */ - buffer_address[5] = 0xf8; - fragP->fr_fix += 6; /* account for bra/jmp instruction */ - subseg_change(SEG_TEXT,0); - fix_new(fragP, fragP->fr_fix, 2, fragP->fr_symbol, 0, - fragP->fr_offset, 0, NO_RELOC); - fragP->fr_fix += 2; - } else { - /* JF: these were fr_opcode[5-7] */ - buffer_address[3] = 0x06; /* Plus 6 */ - buffer_address[4] = 0x4e; /* put in jmp long (0x4ef9) */ - buffer_address[5] = 0xf9; - fragP->fr_fix += 6; /* account for bra/jmp instruction */ - subseg_change(SEG_TEXT,0); - fix_new(fragP, fragP->fr_fix, 4, fragP->fr_symbol, 0, - fragP->fr_offset, 0, NO_RELOC); - fragP->fr_fix += 4; - } - - frag_wane(fragP); - break; - } /* case TAB(DBCC,SZ_UNDEF) */ - - case TAB(PCLEA,SZ_UNDEF): { - if ((S_GET_SEGMENT(fragP->fr_symbol))==segment || flagseen['l']) { - fragP->fr_subtype=TAB(PCLEA,SHORT); - fragP->fr_var+=2; - } else { - fragP->fr_subtype=TAB(PCLEA,LONG); - fragP->fr_var+=6; - } - break; - } /* TAB(PCLEA,SZ_UNDEF) */ - - default: - break; - - } /* switch on subtype looking for SZ_UNDEF's. */ - - /* now that SZ_UNDEF are taken care of, check others */ - switch(fragP->fr_subtype) { - case TAB(BCC68000,BYTE): - case TAB(BRANCH,BYTE): - /* We can't do a short jump to the next instruction, - so we force word mode. */ - if (fragP->fr_symbol && S_GET_VALUE(fragP->fr_symbol)==0 && - fragP->fr_symbol->sy_frag==fragP->fr_next) { - fragP->fr_subtype=TAB(TABTYPE(fragP->fr_subtype),SHORT); - fragP->fr_var+=2; - } - break; - default: - break; -} - return fragP->fr_var + fragP->fr_fix - old_fix; -} - -#if defined(OBJ_AOUT) | defined(OBJ_BOUT) -/* the bit-field entries in the relocation_info struct plays hell - with the byte-order problems of cross-assembly. So as a hack, - I added this mach. dependent ri twiddler. Ugly, but it gets - you there. -KWK */ -/* on m68k: first 4 bytes are normal unsigned long, next three bytes - are symbolnum, most sig. byte first. Last byte is broken up with - bit 7 as pcrel, bits 6 & 5 as length, bit 4 as pcrel, and the lower - nibble as nuthin. (on Sun 3 at least) */ -/* Translate the internal relocation information into target-specific - format. */ -#ifdef comment -void - md_ri_to_chars(the_bytes, ri) -char *the_bytes; -struct reloc_info_generic *ri; -{ - /* this is easy */ - md_number_to_chars(the_bytes, ri->r_address, 4); - /* now the fun stuff */ - the_bytes[4] = (ri->r_symbolnum >> 16) & 0x0ff; - the_bytes[5] = (ri->r_symbolnum >> 8) & 0x0ff; - the_bytes[6] = ri->r_symbolnum & 0x0ff; - the_bytes[7] = (((ri->r_pcrel << 7) & 0x80) | ((ri->r_length << 5) & 0x60) | - ((ri->r_extern << 4) & 0x10)); -} -#endif /* comment */ - -void tc_aout_fix_to_chars(where, fixP, segment_address_in_file) -char *where; -fixS *fixP; -relax_addressT segment_address_in_file; -{ - /* - * In: length of relocation (or of address) in chars: 1, 2 or 4. - * Out: GNU LD relocation length code: 0, 1, or 2. - */ - - static unsigned char nbytes_r_length [] = { 42, 0, 1, 42, 2 }; - - long r_extern; - long r_symbolnum; - - /* this is easy */ - md_number_to_chars(where, - fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file, - 4); - - /* now the fun stuff */ - if (S_GET_TYPE(fixP->fx_addsy) == N_UNDF) { - r_extern = 1; - r_symbolnum = fixP->fx_addsy->sy_number; - } else { - r_extern = 0; - r_symbolnum = S_GET_TYPE(fixP->fx_addsy); - } - - where[4] = (r_symbolnum >> 16) & 0x0ff; - where[5] = (r_symbolnum >> 8) & 0x0ff; - where[6] = r_symbolnum & 0x0ff; - where[7] = (((fixP->fx_pcrel << 7) & 0x80) | ((nbytes_r_length[fixP->fx_size] << 5) & 0x60) | - ((r_extern << 4) & 0x10)); - - return; -} /* tc_aout_fix_to_chars() */ - -#endif /* OBJ_AOUT or OBJ_BOUT */ - -#ifndef WORKING_DOT_WORD -const int md_short_jump_size = 4; -const int md_long_jump_size = 6; - -void - md_create_short_jump(ptr,from_addr,to_addr,frag,to_symbol) -char *ptr; -long from_addr, - to_addr; -fragS *frag; -symbolS *to_symbol; -{ - long offset; - - offset = to_addr - (from_addr+2); - - md_number_to_chars(ptr ,(long)0x6000,2); - md_number_to_chars(ptr+2,(long)offset,2); -} - -void - md_create_long_jump(ptr,from_addr,to_addr,frag,to_symbol) -char *ptr; -long from_addr, - to_addr; -fragS *frag; -symbolS *to_symbol; -{ - long offset; - - if (cpu_of_arch(current_architecture) < m68020) { - offset=to_addr-S_GET_VALUE(to_symbol); - md_number_to_chars(ptr ,(long)0x4EF9,2); - md_number_to_chars(ptr+2,(long)offset,4); - fix_new(frag,(ptr+2)-frag->fr_literal,4,to_symbol,(symbolS *)0,(long)0,0, - NO_RELOC); - } else { - offset=to_addr - (from_addr+2); - md_number_to_chars(ptr ,(long)0x60ff,2); - md_number_to_chars(ptr+2,(long)offset,4); - } -} - -#endif -/* Different values of OK tell what its OK to return. Things that aren't OK are an error (what a shock, no?) - - 0: Everything is OK - 10: Absolute 1:8 only - 20: Absolute 0:7 only - 30: absolute 0:15 only - 40: Absolute 0:31 only - 50: absolute 0:127 only - 55: absolute -64:63 only - 60: absolute -128:127 only - 70: absolute 0:4095 only - 80: No bignums - - */ - -static int get_num(exp,ok) -struct m68k_exp *exp; -int ok; -{ -#ifdef TEST2 - long l = 0; - - if(!exp->e_beg) - return 0; - if(*exp->e_beg=='0') { - if(exp->e_beg[1]=='x') - sscanf(exp->e_beg+2,"%x",&l); - else - sscanf(exp->e_beg+1,"%O",&l); - return l; - } - return atol(exp->e_beg); -#else - char *save_in; - char c_save; - - if(!exp) { - /* Can't do anything */ - return 0; - } - if(!exp->e_beg || !exp->e_end) { - seg(exp)=SEG_ABSOLUTE; - adds(exp)=0; - subs(exp)=0; - offs(exp)= (ok==10) ? 1 : 0; - as_warn("Null expression defaults to %ld",offs(exp)); - return 0; - } - - exp->e_siz=0; - if(/* ok!=80 && */exp->e_end[-1]==SIZER && (exp->e_end-exp->e_beg)>=2) { - switch(exp->e_end[0]) { - case 's': - case 'S': - case 'b': - case 'B': - exp->e_siz=1; - break; - case 'w': - case 'W': - exp->e_siz=2; - break; - case 'l': - case 'L': - exp->e_siz=3; - break; - default: - as_bad("Unknown size for expression \"%c\"",exp->e_end[0]); - } - exp->e_end-=2; - } - c_save=exp->e_end[1]; - exp->e_end[1]='\0'; - save_in=input_line_pointer; - input_line_pointer=exp->e_beg; - switch(expression(&(exp->e_exp))) { - case SEG_PASS1: - seg(exp)=SEG_ABSOLUTE; - adds(exp)=0; - subs(exp)=0; - offs(exp)= (ok==10) ? 1 : 0; - as_warn("Unknown expression: '%s' defaulting to %d",exp->e_beg,offs(exp)); - break; - - case SEG_ABSENT: - /* Do the same thing the VAX asm does */ - seg(exp)=SEG_ABSOLUTE; - adds(exp)=0; - subs(exp)=0; - offs(exp)=0; - if(ok==10) { - as_warn("expression out of range: defaulting to 1"); - offs(exp)=1; - } - break; - case SEG_ABSOLUTE: - switch(ok) { - case 10: - if(offs(exp)<1 || offs(exp)>8) { - as_warn("expression out of range: defaulting to 1"); - offs(exp)=1; - } - break; - case 20: - if(offs(exp)<0 || offs(exp)>7) - goto outrange; - break; - case 30: - if(offs(exp)<0 || offs(exp)>15) - goto outrange; - break; - case 40: - if(offs(exp)<0 || offs(exp)>32) - goto outrange; - break; - case 50: - if(offs(exp)<0 || offs(exp)>127) - goto outrange; - break; - case 55: - if(offs(exp)<-64 || offs(exp)>63) - goto outrange; - break; - case 60: - if(offs(exp)<-128 || offs(exp)>127) - goto outrange; - break; - case 70: - if(offs(exp)<0 || offs(exp)>4095) { - outrange: - as_warn("expression out of range: defaulting to 0"); - offs(exp)=0; - } - break; - default: - break; - } - break; - case SEG_TEXT: - case SEG_DATA: - case SEG_BSS: - case SEG_UNKNOWN: - case SEG_DIFFERENCE: - if(ok>=10 && ok<=70) { - seg(exp)=SEG_ABSOLUTE; - adds(exp)=0; - subs(exp)=0; - offs(exp)= (ok==10) ? 1 : 0; - as_warn("Can't deal with expression \"%s\": defaulting to %ld",exp->e_beg,offs(exp)); - } - break; - case SEG_BIG: - if(ok==80 && offs(exp)<0) { /* HACK! Turn it into a long */ - LITTLENUM_TYPE words[6]; - - gen_to_words(words,2,8L);/* These numbers are magic! */ - seg(exp)=SEG_ABSOLUTE; - adds(exp)=0; - subs(exp)=0; - offs(exp)=words[1]|(words[0]<<16); - } else if(ok!=0) { - seg(exp)=SEG_ABSOLUTE; - adds(exp)=0; - subs(exp)=0; - offs(exp)= (ok==10) ? 1 : 0; - as_warn("Can't deal with expression \"%s\": defaulting to %ld",exp->e_beg,offs(exp)); - } - break; - default: - as_fatal("failed sanity check."); - } - if(input_line_pointer!=exp->e_end+1) - as_bad("Ignoring junk after expression"); - exp->e_end[1]=c_save; - input_line_pointer=save_in; - if(exp->e_siz) { - switch(exp->e_siz) { - case 1: - if(!isbyte(offs(exp))) - as_warn("expression doesn't fit in BYTE"); - break; - case 2: - if(!isword(offs(exp))) - as_warn("expression doesn't fit in WORD"); - break; - } - } - return offs(exp); -#endif -} /* get_num() */ - -/* These are the back-ends for the various machine dependent pseudo-ops. */ -void demand_empty_rest_of_line(); /* Hate those extra verbose names */ - -static void s_data1() { - subseg_new(SEG_DATA,1); - demand_empty_rest_of_line(); -} /* s_data1() */ - -static void s_data2() { - subseg_new(SEG_DATA,2); - demand_empty_rest_of_line(); -} /* s_data2() */ - -static void s_bss() { - /* We don't support putting frags in the BSS segment, but we - can put them into initialized data for now... */ - subseg_new(SEG_DATA,255); /* FIXME-SOON */ - demand_empty_rest_of_line(); -} /* s_bss() */ - -static void s_even() { - register int temp; - register long temp_fill; - - temp = 1; /* JF should be 2? */ - temp_fill = get_absolute_expression (); - if ( ! need_pass_2 ) /* Never make frag if expect extra pass. */ - frag_align (temp, (int)temp_fill); - demand_empty_rest_of_line(); -} /* s_even() */ - -static void s_proc() { - demand_empty_rest_of_line(); -} /* s_proc() */ - -/* s_space is defined in read.c .skip is simply an alias to it. */ - -/* - * md_parse_option - * Invocation line includes a switch not recognized by the base assembler. - * See if it's a processor-specific option. These are: - * - * -[A]m[c]68000, -[A]m[c]68008, -[A]m[c]68010, -[A]m[c]68020, -[A]m[c]68030, -[A]m[c]68040 - * -[A]m[c]68881, -[A]m[c]68882, -[A]m[c]68851 - * Select the architecture. Instructions or features not - * supported by the selected architecture cause fatal - * errors. More than one may be specified. The default is - * -m68020 -m68851 -m68881. Note that -m68008 is a synonym - * for -m68000, and -m68882 is a synonym for -m68881. - * - * MAYBE_FLOAT_TOO is defined below so that specifying a processor type - * (e.g. m68020) also requests that float instructions be included. This - * is the default setup, mostly to avoid hassling users. A better - * rearrangement of this structure would be to add an option to DENY - * floating point opcodes, for people who want to really know there's none - * of that funny floaty stuff going on. FIXME-later. - */ -#ifndef MAYBE_FLOAT_TOO -#define MAYBE_FLOAT_TOO m68881 -#endif - -int md_parse_option(argP,cntP,vecP) -char **argP; -int *cntP; -char ***vecP; -{ - switch(**argP) { - case 'l': /* -l means keep external to 2 bit offset - rather than 16 bit one */ - break; - - case 'S': /* -S means that jbsr's always turn into jsr's. */ - break; - - case 'A': - (*argP)++; - /* intentional fall-through */ - case 'm': - (*argP)++; - - if (**argP=='c') { - (*argP)++; - } /* allow an optional "c" */ - - if (!strcmp(*argP, "68000") - || !strcmp(*argP, "68008")) { - current_architecture |= m68000; - } else if (!strcmp(*argP, "68010")) { -#ifdef TE_SUN - omagic= 1<<16|OMAGIC; -#endif - current_architecture |= m68010; - - } else if (!strcmp(*argP, "68020")) { - current_architecture |= m68020 | MAYBE_FLOAT_TOO; - - } else if (!strcmp(*argP, "68030")) { - current_architecture |= m68030 | MAYBE_FLOAT_TOO; - - } else if (!strcmp(*argP, "68040")) { - current_architecture |= m68040 | MAYBE_FLOAT_TOO; - -#ifndef NO_68881 - } else if (!strcmp(*argP, "68881")) { - current_architecture |= m68881; - - } else if (!strcmp(*argP, "68882")) { - current_architecture |= m68882; - -#endif /* NO_68881 */ -#ifndef NO_68851 - } else if (!strcmp(*argP,"68851")) { - current_architecture |= m68851; - -#endif /* NO_68851 */ - } else { - as_warn("Unknown architecture, \"%s\". option ignored", *argP); - } /* switch on architecture */ - - while(**argP) (*argP)++; - - break; - - case 'p': - if (!strcmp(*argP,"pic")) { - (*argP) += 3; - break; /* -pic, Position Independent Code */ - } else { - return(0); - } /* pic or not */ - - default: - return 0; - } - return 1; -} - - -#ifdef TEST2 - -/* TEST2: Test md_assemble() */ -/* Warning, this routine probably doesn't work anymore */ - -main() -{ - struct m68k_it the_ins; - char buf[120]; - char *cp; - int n; - - m68k_ip_begin(); - for(;;) { - if(!gets(buf) || !*buf) - break; - if(buf[0]=='|' || buf[1]=='.') - continue; - for(cp=buf;*cp;cp++) - if(*cp=='\t') - *cp=' '; - if(is_label(buf)) - continue; - memset(&the_ins, '\0', sizeof(the_ins)); - m68k_ip(&the_ins,buf); - if(the_ins.error) { - printf("Error %s in %s\n",the_ins.error,buf); - } else { - printf("Opcode(%d.%s): ",the_ins.numo,the_ins.args); - for(n=0;nfr_next) { - printf("addr %lu next 0x%x fix %ld var %ld symbol 0x%x offset %ld\n", - fragP->fr_address,fragP->fr_next,fragP->fr_fix,fragP->fr_var,fragP->fr_symbol,fragP->fr_offset); - printf("opcode 0x%x type %d subtype %d\n\n",fragP->fr_opcode,fragP->fr_type,fragP->fr_subtype); - } - fflush(stdout); - return 0; -} -#endif - -#ifdef DONTDEF -/*VARARGS1*/ -panic(format,args) -char *format; -{ - fputs("Internal error:",stderr); - _doprnt(format,&args,stderr); - (void)putc('\n',stderr); - as_where(); - abort(); -} -#endif - -/* We have no need to default values of symbols. */ - -/* ARGSUSED */ -symbolS * - md_undefined_symbol (name) -char *name; -{ - return 0; -} - -/* Parse an operand that is machine-specific. - We just return without modifying the expression if we have nothing - to do. */ - -/* ARGSUSED */ -void - md_operand (expressionP) -expressionS *expressionP; -{ -} - -/* Round up a section size to the appropriate boundary. */ -long - md_section_align (segment, size) -segT segment; -long size; -{ - return size; /* Byte alignment is fine */ -} - -/* Exactly what point is a PC-relative offset relative TO? - On the 68k, they're relative to the address of the offset, plus - its size. (??? Is this right? FIXME-SOON!) */ -long - md_pcrel_from (fixP) -fixS *fixP; -{ - return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; -} - -#ifdef MRI -void s_ds(size) -{ - unsigned int fill = get_absolute_expression() * size; - char *p = frag_var (rs_fill, fill, fill, (relax_substateT)0, (symbolS *)0, - 1, (char *)0); - * p = 0; - demand_empty_rest_of_line(); -} - -void s_dc(size) -{ - - cons(size); - - -} - -void s_dcb(size) -{ - int repeat = get_absolute_expression(); - int fill; - - if (*input_line_pointer == ',') - { - char *p; - input_line_pointer++; - - fill = get_absolute_expression(); - p = frag_var(rs_fill, - size, - size, - (relax_substateT)0, - (symbolS *)0, - repeat, - 0); - md_number_to_chars(p, fill, size); - } - demand_empty_rest_of_line(); - - -} - -void s_chip() -{ - unsigned int target = get_absolute_expression(); -#define MACHINE_MASK (m68000 | m68008 | m68010 | m68020 | m68040) - switch (target) - { - case 68000: - case 68008: - current_architecture = (current_architecture & ~ MACHINE_MASK) | m68000; - break; - case 68010: - current_architecture = (current_architecture & ~ MACHINE_MASK) | m68010; - break; - case 68020: - current_architecture = (current_architecture & ~ MACHINE_MASK) | m68020; - break; - case 68030: - current_architecture = (current_architecture & ~ MACHINE_MASK) | m68030; - break; - case 68040: - current_architecture = (current_architecture & ~ MACHINE_MASK) | m68040; - break; - case 68881: - current_architecture |= m68881; - break; - case 68882: - current_architecture |= m68882; - break; - case 68851: - current_architecture |= m68851; - break; - - default: - as_bad("Unrecognised CHIP %d\n", target); - - } - demand_empty_rest_of_line(); -} - -#endif - -/* - * Local Variables: - * comment-column: 0 - * fill-column: 131 - * End: - */ - -/* end of tc-m68kmote.c */ diff --git a/gas/config/tc-m68kmote.h b/gas/config/tc-m68kmote.h deleted file mode 100644 index 95e0c1540a..0000000000 --- a/gas/config/tc-m68kmote.h +++ /dev/null @@ -1,64 +0,0 @@ -/* This file is tc-m68kmote.h - - Copyright (C) 1987-1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* - * This file is tp-generic.h and is intended to be a template for - * target processor specific header files. - */ - -#define TC_M68K 1 - -#ifdef TE_SUN3 -/* This variable contains the value to write out at the beginning of - the a.out file. The 2<<16 means that this is a 68020 file instead - of an old-style 68000 file */ - -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC); /* Magic byte for file header */ -#endif /* TE_SUN3 */ - -#define AOUT_MACHTYPE 0x2 -#define REVERSE_SORT_RELOCS /* FIXME-NOW: this line can be removed. */ -#define LOCAL_LABELS_FB - -#define tc_crawl_symbol_chain(a) {;} /* not used */ -#define tc_headers_hook(a) {;} /* not used */ -#define tc_aout_pre_write_hook(x) {;} /* not used */ - -#define LISTING_WORD_SIZE 2 /* A word is 2 bytes */ -#define LISTING_LHS_WIDTH 3 /* 3 word on the first line */ -#define LISTING_LHS_WIDTH_SECOND 3 /* One word on the second line */ -#define LISTING_LHS_CONT_LINES 4 /* And 4 lines max */ -#define LISTING_HEADER "68K GAS " - -/* Copied from write.c */ -#define M68K_AIM_KLUDGE(aim, this_state,this_type) \ - if (aim==0 && this_state== 4) { /* hard encoded from tc-m68k.c */ \ - aim=this_type->rlx_forward+1; /* Force relaxation into word mode */ \ - } -#define MRI - -/* - * Local Variables: - * comment-column: 0 - * fill-column: 131 - * End: - */ - -/* end of tc-m68kmote.h */ diff --git a/gas/config/te-motor.h b/gas/config/te-motor.h deleted file mode 100755 index 22548416bf..0000000000 --- a/gas/config/te-motor.h +++ /dev/null @@ -1,4 +0,0 @@ -/* Machine specific defines for the unisoft 680x0 V.3.2 version 1.3 */ - -/* Remove leading underscore from the gcc generated symbol names */ -#define STRIP_UNDERSCORE 1 diff --git a/gas/config/te-sparc.h b/gas/config/te-sparc.h deleted file mode 100755 index c1a374392b..0000000000 --- a/gas/config/te-sparc.h +++ /dev/null @@ -1,52 +0,0 @@ -/* sparc.h -- Header file for the SPARC - Copyright (C) 1989 Free Software Foundation, Inc. - -This file is part of GAS, the GNU Assembler. - -GAS is free software; you can 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. - -GAS is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GAS; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* - * The following enum and struct were borrowed from - * sunOS /usr/include/sun4/a.out.h - * - */ - -enum reloc_type -{ - RELOC_8, RELOC_16, RELOC_32, RELOC_DISP8, - RELOC_DISP16, RELOC_DISP32, RELOC_WDISP30, RELOC_WDISP22, - RELOC_HI22, RELOC_22, RELOC_13, RELOC_LO10, - RELOC_SFA_BASE, RELOC_SFA_OFF13, RELOC_BASE10, RELOC_BASE13, - RELOC_BASE22, RELOC_PC10, RELOC_PC22, RELOC_JMP_TBL, - RELOC_SEGOFF16, RELOC_GLOB_DAT, RELOC_JMP_SLOT, RELOC_RELATIVE, - - NO_RELOC -}; - -struct reloc_info_sparc -{ - unsigned long r_address; -/* - * Using bit fields here is a bad idea because the order is not portable. :-( - */ - unsigned int r_index : 24; - unsigned int r_extern : 1; - unsigned int unused : 2; - enum reloc_type r_type : 5; - long r_addend; -}; - -#define relocation_info reloc_info_sparc - diff --git a/gas/config/te-unisoft.h b/gas/config/te-unisoft.h deleted file mode 100755 index 22548416bf..0000000000 --- a/gas/config/te-unisoft.h +++ /dev/null @@ -1,4 +0,0 @@ -/* Machine specific defines for the unisoft 680x0 V.3.2 version 1.3 */ - -/* Remove leading underscore from the gcc generated symbol names */ -#define STRIP_UNDERSCORE 1 diff --git a/gas/config/tmake-sun3 b/gas/config/tmake-sun3 deleted file mode 100755 index 9681e6db87..0000000000 --- a/gas/config/tmake-sun3 +++ /dev/null @@ -1 +0,0 @@ -# This line from make-sun3. diff --git a/gas/configdos.bat b/gas/configdos.bat deleted file mode 100755 index 18331cd3da..0000000000 --- a/gas/configdos.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -echo Configuring GAS for H8/300 - -copy config\ho-go32.h host.h -copy config\tc-h8300.c targ-cpu.c -copy config\tc-h8300.h targ-cpu.h -copy config\te-generic.h targ-env.h -copy config\objcoff-bfd.h obj-format.h -copy config\objcoff-bfd.c obj-format.c -copy config\atof-ieee.c atof-targ.c - -copy Makefile.dos Makefile - - diff --git a/gas/configure b/gas/configure deleted file mode 100755 index 3cdccfe501..0000000000 --- a/gas/configure +++ /dev/null @@ -1,687 +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. -# This file is a shell script that supplies the information necessary -# to tailor a template configure script into the configure script -# appropriate for this directory. For more information, check any -# existing configure script. - -srctrigger=as.c -srcname="gas" -targetdependent=true - -## 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. - -gas_host=generic - -case "${host_cpu}" in -a29k | rs6000 | vax) gas_host=${host_cpu} ;; -mips) - case "${host_os}" in - ultrix) gas_host=decstation ;; - esac - ;; -*) - case "${host_os}" in - ansi | ultrix | hpux | sysv*) gas_host=${host_os} ;; - *) - case "${host_vendor}" in - sun) - case "${host_cpu}" in - m68k) gas_host=sun3 ;; - i386) gas_host=sun386 ;; - sparc) gas_host=sun4 ;; - esac - ;; - esac - ;; - esac - ;; -esac - -## 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. - -# assign cpu type -emulation=generic - -cpu_type=${target_cpu} - -# assign object format -case ${target_os} in -sysv* | -coff*) - obj_format=coff - ;; -bout*) - obj_format=bout - ;; -bsd* | sunos* | *) - obj_format=aout - ;; -generic) - obj_format=generic - ;; -esac - -# assign floating point type -case ${target_cpu} in -vax) - atof=vax - ;; -*) - atof=ieee - ;; -esac - -# and target makefile frag - -target_makefile_frag=config/tmake-${target_cpu} - -files="config/ho-${gas_host}.h config/tc-${cpu_type}.c \ - config/tc-${cpu_type}.h config/te-${emulation}.h \ - config/obj-${obj_format}.h config/obj-${obj_format}.c \ - config/atof-${atof}.c" - -links="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c" -## 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. - -## 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/gas/configure.was b/gas/configure.was deleted file mode 100755 index 24859272f0..0000000000 --- a/gas/configure.was +++ /dev/null @@ -1,340 +0,0 @@ -#!/bin/sh -# Configuration script for GNU GAS -# Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc. - -#This file is not yet part of GNU GAS. - -#GNU GAS is free software; you can 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. - -#GNU GAS is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. - -#You should have received a copy of the GNU General Public License -#along with GNU GAS; see the file COPYING. If not, write to -#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -# $Id$ - -# -# Shell script to create proper links to machine-dependent files in -# preparation for compiling gas. -# -# Usage: configure [-srcdir=DIR] [-host=HOST] TARGET -# -# If configure succeeds, it leaves its status in config.status. -# If configure fails after disturbing the status quo, -# config.status is removed. -# - -progname=$0 - -remove=rm -hard_link=ln -symbolic_link='ln -s' - -host= -target= - -#for Test -#remove="echo rm" -#hard_link="echo ln" -#symbolic_link="echo ln -s" - -for arg in $*; -do - case $arg in - -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*) - srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'` - ;; - -host=* | +host=* | +hos=* | +ho=* | +h=*) - host=`echo $arg | sed 's/[+-]h[a-z]*=//'` - ;; - *) -# Allow configure HOST TARGET - if [ x$host = x ] - then - host=$target - fi - target=$arg - ;; - esac -done - -# Complain if an arg is missing -if [ x$target = x ] -then - echo "Usage: $progname [+srcdir=DIR] [+host=HOST] TARGET" - echo -n "Where HOST and TARGET are something like " - echo "\`vax', \`sun3', \`encore', etc." - if [ -r config.status ] - then - cat config.status - fi - exit 1 -fi - -# Default other arg -if [ x$host = x ] -then - host=$target -fi - -# Find the source files, if location was not specified. -if [ x$srcdir = x ] -then - srcdirdefaulted=1 - srcdir=. - if [ ! -r as.c ] - then - srcdir=.. - fi -fi - -if [ ! -r ${srcdir}/as.c ] -then - if [ x$srcdirdefaulted = x ] - then - echo "$progname: Can't find assembler sources in \`${srcdir}'." 1>&2 - else - echo "$progname: Can't find assembler sources in \`.' or \`..'." 1>&2 - fi - exit 1 -fi - -# Decode the host machine, then the target machine. -# For the host machine, we save the ho variable as host_ho; -# then we decode the target machine and forget everything else -# that came from the host machine. -for machine in $host $target; do - tc= - obj= - - host_header= - obj_header= - obj_source= - te_header= - tc_header= - tc_source= - - make_var_file= - - case $machine in - generic) - ;; - i860) - tc=i860 - obj=aout - ;; - pmax | dec3100) - ho=pmax - ;; - sun386) - ho=sun386 - ;; - sun4 | sun4-aout | sun-4 | sun4-os4 | sun-4-os4) - ho=sun4 - tc=sparc - obj=aout - ;; - sun4-bout) - tc=sparc - obj=bout - ;; - sun4-bfd-sunos) - tc=sparc - obj=bfd-sunos - ;; - i960 | i960-coff) - tc=i960 - obj=coff - te=ic960 - ;; - i960-bout) - tc=i960 - obj=bout - ;; - i960-aout) - tc=i960 - obj=aout - ;; - sun3 | sun3-aout) - ho=sun3 - tc=m68k - obj=aout - te=sun3 - ;; - a29k | a29k-aout) - tc=a29k - obj=aout - ;; - a29k-coff) - tc=a29k - obj=coff - ;; - i386) - tc=i386 - obj=aout - ;; - ns32k) - tc=ns32k - obj=aout - ;; - vax) - tc=vax - obj=aout - ;; - rs6000) - ;; - esac - if [ x$pass1done = x ] - then - if [ x$ho = x ]; then ho=$host; fi - if [ x$ho_header = x ]; then ho_ho_header=ho-$ho.h - else ho_ho_header=$ho_header - fi - if [ x$make_var_file = x ] - then make_var_file=make-$ho; fi - ho_make_var_file=$make_var_file - pass1done=yes - else - host_make_var_file=$ho_make_var_file - ho_header=$ho_ho_header - fi -done - - -# Default the machine-specific variables that were not explicitly set. -if [ x$te = x ] -then te=generic; fi - -if [ x$te_header = x ] -then te_header=te-$te.h; fi - - -if [ x$tc = x ] -then tc=generic; fi - -if [ x$tc_header = x ] -then tc_header=tc-$tc.h; fi - -if [ x$tc_source = x ] -then tc_source=tc-$tc.c; fi - - -if [ x$obj = x ] -then obj=generic; fi - -if [ x$obj_header = x ] -then obj_header=obj-$obj.h; fi - -if [ x$obj_source = x ] -then obj_source=obj-$obj.c; fi - - -if [ x$atof_source = x ] -then atof_source=atof-ieee.c; 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. -files="$ho_header $te_header $tc_header $tc_source $obj_header $obj_source $atof_source" -links="host.h targ-env.h targ-cpu.h targ-cpu.c obj-format.h obj-format.c atof-targ.c" - -# 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}/config/$file ] - then - echo "$progname: cannot create a link \`$link'," 1>&2 - echo "since the file \`config/$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}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link - - if [ ! -r $link ] - then - echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'." 1>&2 - exit 1 - fi - echo "Linked \`$link' to \`${srcdir}/config/$file'." -done - -# Build a Makefile - -# Install a makefile, and make it set srcdir -# if necessary so that the sources are found. -# Also change its value of srcdir. -# Also create a .gdbinit file which runs the one in srcdir -# and tells GDB to look there for source files. -case $srcdir in -.) - ;; -*) - echo "VPATH = ${srcdir}" > x - cat x ${srcdir}/Makefile.in | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.in - rm x - echo "dir ." > .gdbinit - echo "dir ${srcdir}" >> .gdbinit - echo "source ${srcdir}/.gdbinit" >> .gdbinit - ;; -esac - -# Conditionalize the makefile for this machine. -if [ -f ${srcdir}/config/${host_make_var_file} ] -then - sed -e "/####/ r ${srcdir}/config/${host_make_var_file}" Makefile.in > Makefile.tem -else - cp Makefile.in Makefile.tem -fi - -# Remove all formfeeds, since some Makes get confused by them. -sed "s/ //" Makefile.tem > Makefile.tem1 - -# Delete the intermediate files -rm Makefile.tem -if [ x$srcdir != x. ] -then - rm Makefile.in -fi - - -# actual Makefile starts here. - -echo "host = $host" > Makefile -echo "target = $target" >> Makefile - -# Define macro CROSS_ASSEMBLE in compilation if this is a cross-assembler. -if [ x$host = x$target ] -then - sed "/^ALL=gas/s//ALL=bootstrap/" < Makefile.tem1 >> Makefile -else - echo "CROSS=-DCROSS_ASSEMBLE" >> Makefile - cat Makefile.tem1 >> Makefile -fi - -rm Makefile.tem1 - -echo "Edited the makefile" - -if [ x$host = x$target ] -then - echo "Links are now set up for use with a $target." \ - | tee config.status -else - echo "Links are now set up for host $host and target $target." \ - | tee config.status -fi - -exit 0 diff --git a/gas/doc/Makefile b/gas/doc/Makefile deleted file mode 100755 index 521f47340b..0000000000 --- a/gas/doc/Makefile +++ /dev/null @@ -1,94 +0,0 @@ -# Makefile for as.texinfo preprocessing and TeXing -# $Id$ -# see pretex.m4 for discussion of preprocessor definitions - -# What version of the manual you want (see *.m4); "all" includes everything -CONFIG=all - -# Sun/Berkeley m4 doesn't have all the things we need; use GNU or sV -M4=gm4 -#M4=/usr/5bin/m4 - -# Directory for gas source -srcdir=.. - -# Where to find texinfo.tex to format docn with TeX -TEXIDIR = $(srcdir)/../texinfo/fsf - -as.info: as-${CONFIG}.texinfo - makeinfo -o as.info as-${CONFIG}.texinfo - -as.dvi: as-${CONFIG}.texinfo - TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex as-${CONFIG}.texinfo - texindex as-${CONFIG}.?? - TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex as-${CONFIG}.texinfo - mv as-${CONFIG}.dvi as.dvi - rm as-${CONFIG}.?? as-${CONFIG}.??? - -# ROFF doc targets as.ms, as.mm, as.me -# (we don't use a variable because we don't trust all makes to handle -# a var in the target name right). -# roff output (-ms) -as.ms: as-${CONFIG}.texinfo - sed -e '/\\input texinfo/d' \ - -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ - -e 's/{.*,,/{/' \ - as-${CONFIG}.texinfo | \ - texi2roff -ms >as.ms - -# roff output (-mm) -as.mm: as-${CONFIG}.texinfo - sed -e '/\\input texinfo/d' \ - -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ - -e 's/{.*,,/{/' \ - -e '/@noindent/d' \ - as-${CONFIG}.texinfo | \ - texi2roff -mm | \ - sed -e 's/---/\\(em/g' \ - >as.mm - -# roff output (-me) -as.me: as-${CONFIG}.texinfo - sed -e '/\\input texinfo/d' \ - -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ - -e 's/{.*,,/{/' \ - as-${CONFIG}.texinfo | \ - texi2roff -me >as.me - - - -as-all.texinfo: as.texinfo pretex.m4 none.m4 all.m4 - ${M4} pretex.m4 none.m4 all.m4 as.texinfo >as-all.texinfo - -as-a29k.texinfo: as.texinfo pretex.m4 none.m4 a29k.m4 - ${M4} pretex.m4 none.m4 a29k.m4 as.texinfo >as-a29k.texinfo - -as-a29k-coff.texinfo: as.texinfo pretex.m4 none.m4 a29k-coff.m4 - ${M4} pretex.m4 none.m4 a29k-coff.m4 as.texinfo >as-a29k-coff.texinfo - -as-gen.texinfo: as.texinfo pretex.m4 none.m4 gen.m4 - ${M4} pretex.m4 none.m4 gen.m4 as.texinfo >as-gen.texinfo - -as-h8.texinfo: as.texinfo pretex.m4 none.m4 h8.m4 - ${M4} pretex.m4 none.m4 h8.m4 as.texinfo >as-h8.texinfo - -as-i80386.texinfo: as.texinfo pretex.m4 none.m4 i80386.m4 - ${M4} pretex.m4 none.m4 i80386.m4 as.texinfo >as-i80386.texinfo - -as-i960.texinfo: as.texinfo pretex.m4 none.m4 i960.m4 - ${M4} pretex.m4 none.m4 i960.m4 as.texinfo >as-i960.texinfo - -as-m680x0.texinfo: as.texinfo pretex.m4 none.m4 m680x0.m4 - ${M4} pretex.m4 none.m4 m680x0.m4 as.texinfo >as-m680x0.texinfo - -as-sparc.texinfo: as.texinfo pretex.m4 none.m4 sparc.m4 - ${M4} pretex.m4 none.m4 sparc.m4 as.texinfo >as-sparc.texinfo - -as-vax.texinfo: as.texinfo pretex.m4 none.m4 vax.m4 - ${M4} pretex.m4 none.m4 vax.m4 as.texinfo >as-vax.texinfo - -as-vintage.texinfo: as.texinfo pretex.m4 none.m4 vintage.m4 - ${M4} pretex.m4 none.m4 vintage.m4 as.texinfo >as-vintage.texinfo - -clean: - rm -f as-${CONFIG}.* as.dvi diff --git a/gas/flonum-const.c b/gas/flonum-const.c deleted file mode 100755 index 6be9fde8ef..0000000000 --- a/gas/flonum-const.c +++ /dev/null @@ -1,157 +0,0 @@ -/* flonum_const.c - Useful Flonum constants - Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "flonum.h" -/* JF: I added the last entry to this table, and I'm not - sure if its right or not. Could go either way. I wish - I really understood this stuff. */ - - -const int table_size_of_flonum_powers_of_ten = 11; - -static const LITTLENUM_TYPE zero[] = { 1 }; - -/***********************************************************************\ - * * - * Warning: the low order bits may be WRONG here. * - * I took this from a suspect bc(1) script. * - * "minus_X"[] is supposed to be 10^(2^-X) expressed in base 2^16. * - * The radix point is just AFTER the highest element of the [] * - * * - * Because bc rounds DOWN for printing (I think), the lowest * - * significance littlenums should probably have 1 added to them. * - * * - \***********************************************************************/ - -/* JF: If this equals 6553/(2^16)+39321/(2^32)+... it approaches .1 */ -static const LITTLENUM_TYPE minus_1 [] = { - 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, - 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 6553 }; -static const LITTLENUM_TYPE plus_1 [] = { 10 }; - -/* JF: If this equals 655/(2^16) + 23592/(2^32) + ... it approaches .01 */ -static const LITTLENUM_TYPE minus_2 [] = { - 10485, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 49807, - 10485, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 655 }; -static const LITTLENUM_TYPE plus_2 [] = { 100 }; - -/* This approaches .0001 */ -static const LITTLENUM_TYPE minus_3 [] = { - 52533, 20027, 37329, 65116, 64067, 60397, 14784, 18979, 33659, 19503, - 2726, 9542, 629, 2202, 40475, 10590, 4299, 47815, 36280, 6 }; -static const LITTLENUM_TYPE plus_3 [] = { 10000 }; - -/* JF: this approaches 1e-8 */ -static const LITTLENUM_TYPE minus_4 [] = { - 22516, 49501, 54293, 19424, 60699, 6716, 24348, 22618, 23904, 21327, - 3919, 44703, 19149, 28803, 48959, 6259, 50273, 62237, 42 }; -/* This equals 1525 * 2^16 + 57600 */ -static const LITTLENUM_TYPE plus_4 [] = { 57600, 1525 }; - -/* This approaches 1e-16 */ -static const LITTLENUM_TYPE minus_5 [] = { - 22199, 45957, 17005, 26266, 10526, 16260, 55017, 35680, 40443, 19789, - 17356, 30195, 55905, 28426, 63010, 44197, 1844 }; -static const LITTLENUM_TYPE plus_5 [] = { 28609, 34546, 35 }; - -static const LITTLENUM_TYPE minus_6 [] = { - 30926, 26518, 13110, 43018, 54982, 48258, 24658, 15209, 63366, 11929, - 20069, 43857, 60487, 51 }; -static const LITTLENUM_TYPE plus_6 [] = { 61313, 34220, 16731, 11629, 1262 }; - -static const LITTLENUM_TYPE minus_7 [] = { - 29819, 14733, 21490, 40602, 31315, 65186, 2695 }; -static const LITTLENUM_TYPE plus_7 [] = { - 7937, 49002, 60772, 28216, 38893, 55975, 63988, 59711, 20227, 24 }; - -static const LITTLENUM_TYPE minus_8 [] = { - 45849, 19069, 18068, 36324, 37948, 48745, 10873, 64360, 15961, 20566, - 24178, 15922, 59427, 110 }; -static const LITTLENUM_TYPE plus_8 [] = { - 15873, 11925, 39177, 991, 14589, 19735, 25347, 65086, 53853, 938, - 37209, 47086, 33626, 23253, 32586, 42547, 9731, 59679, 590 }; - -static const LITTLENUM_TYPE minus_9 [] = { - 63601, 55221, 43562, 33661, 29067, 28203, 65417, 64352, 22462, 41110, - 12570, 28635, 23199, 50572, 28471, 27074, 46375, 64028, 13106, 63700, - 32698, 17493, 32420, 34382, 22750, 20681, 12300 }; -static const LITTLENUM_TYPE plus_9 [] = { - 63564, 61556, 29377, 54467, 18621, 28141, 36415, 61241, 47119, 30026, - 19740, 46002, 13541, 61413, 30480, 38664, 32205, 50593, 51112, 48904, - 48263, 43814, 286, 30826, 52813, 62575, 61390, 24540, 21495, 5 }; - -static const LITTLENUM_TYPE minus_10 [] = { - 50313, 34681, 1464, 25889, 19575, 41125, 17635, 4598, 49708, 13427, - 17287, 56115, 53783, 38255, 32415, 17778, 31596, 7557, 20951, 18477, - 40353, 1178, 44405, 11837, 11571, 50963, 15649, 11698, 40675, 2308, }; -static const LITTLENUM_TYPE plus_10[] = { - 18520, 53764, 54535, 61910, 61962, 59843, 46270, 58053, 12473, 63785, - 2449, 43230, 50044, 47595, 10403, 35766, 32607, 1124, 24966, 35044, - 25524, 23631, 18826, 14518, 58448, 14562, 49618, 5588, 25396, 28 }; - -static const LITTLENUM_TYPE minus_11 [] = { - 6223, 59909, 62437, 59960, 14652, 45336, 48800, 7647, 51962, 37982, - 60436, 58176, 26767, 8440, 9831, 48556, 20994, 14148, 6757, 17221, - 60624, 46129, 53210, 44085, 54016, 24259, 11232, 21229, 21313, 81, }; -static const LITTLENUM_TYPE plus_11 [] = { - 36159, 2055, 33615, 61362, 23581, 62454, 9748, 15275, 39284, 58636, - 16269, 42793, 47240, 45774, 50861, 48400, 9413, 40281, 4030, 9572, - 7984, 33038, 59522, 19450, 40593, 24486, 54320, 6661, 55766, 805, }; - -/* Shut up complaints about differing pointer types. They only differ - in the const attribute, but there isn't any easy way to do this - */ -#define X (LITTLENUM_TYPE *) - -const FLONUM_TYPE flonum_negative_powers_of_ten [] = { - {X zero, X zero, X zero, 0, '+'}, - {X minus_1, X minus_1 +19, X minus_1 + 19, -20, '+'}, - {X minus_2, X minus_2 +19, X minus_2 + 19, -20, '+'}, - {X minus_3, X minus_3 +19, X minus_3 + 19, -20, '+'}, - {X minus_4, X minus_4 +18, X minus_4 + 18, -20, '+'}, - {X minus_5, X minus_5 +16, X minus_5 + 16, -20, '+'}, - {X minus_6, X minus_6 +13, X minus_6 + 13, -20, '+'}, - {X minus_7, X minus_7 + 6, X minus_7 + 6, -20, '+'}, - {X minus_8, X minus_8 +13, X minus_8 + 13, -40, '+'}, - {X minus_9, X minus_9 +26, X minus_9 + 26, -80, '+'}, - {X minus_10, X minus_10+29, X minus_10 + 29,-136, '+'}, - {X minus_11, X minus_11+29, X minus_11 + 29,-242, '+'}, -}; - -const FLONUM_TYPE flonum_positive_powers_of_ten [] = { - {X zero, X zero, X zero, 0, '+'}, - {X plus_1, X plus_1 + 0, X plus_1 + 0, 0, '+'}, - {X plus_2, X plus_2 + 0, X plus_2 + 0, 0, '+'}, - {X plus_3, X plus_3 + 0, X plus_3 + 0, 0, '+'}, - {X plus_4, X plus_4 + 1, X plus_4 + 1, 0, '+'}, - {X plus_5, X plus_5 + 2, X plus_5 + 2, 1, '+'}, - {X plus_6, X plus_6 + 4, X plus_6 + 4, 2, '+'}, - {X plus_7, X plus_7 + 9, X plus_7 + 9, 4, '+'}, - {X plus_8, X plus_8 + 18, X plus_8 + 18, 8, '+'}, - {X plus_9, X plus_9 + 29, X plus_9 + 29, 24, '+'}, - {X plus_10, X plus_10 + 29, X plus_10 + 29, 77, '+'}, - {X plus_11, X plus_11 + 29, X plus_11 + 29, 183, '+'}, -}; - -#ifdef VMS -dummy1() -{ -} -#endif -/* end of flonum_const.c */ diff --git a/gas/gas-format.el b/gas/gas-format.el deleted file mode 100644 index 32c6426170..0000000000 --- a/gas/gas-format.el +++ /dev/null @@ -1,79 +0,0 @@ -;; -*- lisp-interaction -*- -;; -*- emacs-lisp -*- -;; -;; -;; originally from... -;; Rich's personal .emacs file. feel free to copy. -;; -;; this file sets emacs up for the type of C source code formatting used within -;; gas. I don't use gnu indent. If you do, and find a setup that approximates -;; these settings, please send it to me. -;; -;; Last Mod Thu Feb 13 00:59:16 PST 1992, by rich@sendai -;; - -;; -;; -;; This section sets constants used by c-mode for formating -;; -;; - - -;; If `c-auto-newline' is non-`nil', newlines are inserted both -;;before and after braces that you insert, and after colons and semicolons. -;;Correct C indentation is done on all the lines that are made this way. - -(setq c-auto-newline nil) - - -;; If `c-tab-always-indent' is non-`nil', the TAB command -;;in C mode does indentation only if point is at the left margin or within -;;the line's indentation. If there is non-whitespace to the left of point, -;;then TAB just inserts a tab character in the buffer. Normally, -;;this variable is `nil', and TAB always reindents the current line. - -(setq c-tab-always-indent nil) - -;; C does not have anything analogous to particular function names for which -;;special forms of indentation are desirable. However, it has a different -;;need for customization facilities: many different styles of C indentation -;;are in common use. -;; -;; There are six variables you can set to control the style that Emacs C -;;mode will use. -;; -;;`c-indent-level' -;; Indentation of C statements within surrounding block. The surrounding -;; block's indentation is the indentation of the line on which the -;; open-brace appears. - -(setq c-indent-level 8) - -;;`c-continued-statement-offset' -;; Extra indentation given to a substatement, such as the then-clause of -;; an if or body of a while. - -(setq c-continued-statement-offset 4) - -;;`c-brace-offset' -;; Extra indentation for line if it starts with an open brace. - -(setq c-brace-offset 0) - -;;`c-brace-imaginary-offset' -;; An open brace following other text is treated as if it were this far -;; to the right of the start of its line. - -(setq c-brace-imaginary-offset 0) - -;;`c-argdecl-indent' -;; Indentation level of declarations of C function arguments. - -(setq c-argdecl-indent 0) - -;;`c-label-offset' -;; Extra indentation for line that is a label, or case or default. - -(setq c-label-offset -8) - -;; end of gas-format.el diff --git a/gas/makefile.dos b/gas/makefile.dos deleted file mode 100755 index c146e197f3..0000000000 --- a/gas/makefile.dos +++ /dev/null @@ -1,593 +0,0 @@ -# Makefile for GNU Assembler -# Copyright (C) 1987, 1988, 1990, 1991 Free Software Foundation, Inc. - -#This file is part of GNU GAS. - -#GNU GAS is free software; you can 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. - -#GNU GAS is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. - -#You should have received a copy of the GNU General Public License -#along with GNU GAS; see the file COPYING. If not, write to -#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -# $Id$ - -# The targets for external use include: -# all, doc, proto, install, uninstall, includes, TAGS, -# clean, cleanconfig, realclean, stage1, stage2, stage3, stage4. - -# Variables that exist for you to override. -# See below for how to change them for certain systems. - -LIBDEPS= -CROSS= -HDEFINES= -CPPFLAGS= - -ALLOCA = -CFLAGS = -g -D__MSDOS__ -D__GO32__ -I../include -INTERNAL_CFLAGS = $(CROSS) -OLDCC = cc -BISON = bison -BISONFLAGS = -v -AR = ar -OLDAR_FLAGS = qc -AR_FLAGS = rc -SHELL = /bin/sh -# on sysV, define this as cp. -INSTALL = install -c -# These permit overriding just for certain files. -INSTALL_PROGRAM = $(INSTALL) -INSTALL_FILE = $(INSTALL) - -# Define this as & to perform parallel make on a Sequent. -# Note that this has some bugs, and it seems currently necessary -# to compile all the gen* files first by hand to avoid erroneous results. -P = - -# How to invoke ranlib. -RANLIB = ranlib -# Test to use to see whether ranlib exists on the system. -RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ] - -# CFLAGS for use with OLDCC, for compiling gnulib. -# NOTE: -O does not work on some Unix systems! -CCLIBFLAGS = -O - -# Version of ar to use when compiling gnulib. -OLDAR = ar - -version=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion` - -# Directory where sources are, from where we are. -srcdir = . -# Common prefix for installation directories. -# NOTE: This directory must exist when you start installation. -ddestdir = /usr/local -# Directory in which to put the executable for the command `gcc' -bindir = $(ddestdir)/bin -# Directory in which to put the directories used by the compiler. -libdir = $(ddestdir)/lib -# Directory in which the compiler finds executables, libraries, etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) -# Number to put in man-page filename. -manext = 1 -# Directory in which to put man pages. -mandir = $(destdir)/H-independent/man/man$(manext) - -# Additional system libraries to link with. -CLIB= - -# Specify the rule for actually making gnulib. -GNULIB = gnulib.portable - -# Specify the rule for actually making gnulib2. -GNULIB2 = gnulib2.portable - -# List of extra C and assembler files to add to gnulib. -# Assembler files should have names ending in `.asm'. -LIBFUNCS_EXTRA = - -# Program to convert libraries. -LIBCONVERT = - -# Control whether header files are installed. -INSTALL_HEADERS=install-headers - -# Change this to empty to prevent installing limits.h -LIMITS_H = limits.h - -# Directory to link to, when using the target `maketest'. -DIR = ../gcc - -# For better debugging under COFF, define SEPARATE_AUX_OUTPUT in config.h -# and define the following variable as `aux-output2.c' in make-... -AUX_OUTPUT2 = - -# Flags to use when cross-building GCC. -# Prefix to apply to names of object files when using them -# to run on the machine we are compiling on. -HOST_PREFIX= -# Prefix to apply to names of object files when compiling them -# to run on the machine we are compiling on. -# The default for this variable is chosen to keep these rules -# out of the way of the other rules for compiling the same source files. -HOST_PREFIX_1=loser- -HOST_CC=$(CC) -HOST_CFLAGS=$(ALL_CFLAGS) -HOST_LDFLAGS=$(LDFLAGS) -HOST_CPPFLAGS=$(CPPFLAGS) - -# Choose the real default target. -ALL=as.new - -# End of variables for you to override. - -# Lists of files for various purposes. - -REAL_SOURCES = \ - app.c \ - as.c \ - atof-generic.c \ - bignum-copy.c \ - cond.c \ - expr.c \ - fn-const.c \ - fn-copy.c \ - flonum-mult.c \ - frags.c \ - hash.c \ - hex-value.c \ - input-file.c \ - input-scrub.c \ - messages.c \ - output-file.c \ - read.c \ - strstr.c \ - subsegs.c \ - symbols.c \ - version.c \ - write.c \ - xmalloc.c \ - xrealloc.c - -# in an expedient order -LINKED_SOURCES = \ - targ-cpu.c \ - obj-format.c \ - atof-targ.c - -SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES) - -REAL_HEADERS = \ - as.h \ - bignum.h \ - expr.h \ - flonum.h \ - frags.h \ - hash.h \ - input-file.h \ - tc.h \ - obj.h \ - read.h \ - struc-symbol.h \ - subsegs.h \ - symbols.h \ - syscalls.h \ - write.h - -LINKED_HEADERS = \ - a.out.gnu.h \ - a.out.h \ - host.h \ - targ-env.h \ - targ-cpu.h \ - obj-format.h \ - atof-targ.h - -HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS) - -OBJS = \ - targ-cpu.o \ - obj-format.o \ - atof-targ.o \ - app.o \ - as.o \ - atof-generic.o \ - bignum-copy.o \ - cond.o \ - expr.o \ - fn-const.o \ - fn-copy.o \ - flonum-mult.o \ - frags.o \ - hash.o \ - hex-value.o \ - input-file.o \ - input-scrub.o \ - messages.o \ - output-file.o \ - read.o \ - strstr.o \ - subsegs.o \ - symbols.o \ - version.o \ - write.o \ - xmalloc.o \ - xrealloc.o - -#### host, target, and site specific Makefile frags come in here. -TARG_CPU_DEPENDENTS=../include/h8300-opcode.h -LOCAL_LOADLIBES=../bfd/libbfd.a -TDEFINES=-DBFD -DBFD_HEADERS -DMANY_SEGMENTS - - -# Definition of `all' is here so that new rules inserted by sed -# do not specify the default target. -# The real definition is under `all.internal'. - -all: $(ALL) -all-info: -install-info: - -fake-as: force - - rm -f ./as.new - cp /bin/as ./fake-as - -# Now figure out from those variables how to compile and link. - -# This is the variable actually used when we compile. -ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CFLAGS) $(HDEFINES) $(TDEFINES) - -# Even if ALLOCA is set, don't use it if compiling with GCC. -USE_ALLOCA= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${ALLOCA}; else true; fi` -USE_HOST_ALLOCA= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${HOST_PREFIX}${ALLOCA}; else true; fi` - -# Likewise, for use in the tools that must run on this machine -# even if we are cross-building GCC. -# We don't use USE_ALLOCA because backquote expansion doesn't work in deps. -HOST_LIBDEPS= $(HOST_PREFIX)$(OBSTACK) $(HOST_PREFIX)$(ALLOCA) $(HOST_PREFIX)$(MALLOC) - -# How to link with both our special library facilities -# and the system's installed libraries. - -LIBS = $(LOCAL_LOADLIBES) $(CLIB) $(unsubdir)/../libiberty$(subdir)/libiberty.a - -# Likewise, for use in the tools that must run on this machine -# even if we are cross-building GCC. -HOST_LIBS = $(HOST_PREFIX)$(OBSTACK) $(USE_HOST_ALLOCA) $(HOST_PREFIX)$(MALLOC) $(CLIB) - -# Specify the directories to be searched for header files. -# Both . and srcdir are used, in that order, -# so that tm.h and config.h will be found in the compilation -# subdirectory rather than in the source directory. -INCLUDES = -I. -I$(srcdir) -Iconfig -SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../config - -# Always use -Iconfig when compiling. -.c.o: - $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $< - -# This tells GNU make version 3 not to export all the variables -# defined in this file into the environment. -.NOEXPORT: - -# Files to be copied away after each stage in building. -STAGE_GCC=gcc -STAGESTUFF = *.o as.new - -# The files that "belong" in CONFIG_H are deliberately omitted -# because having them there would not be useful in actual practice. -# All they would do is cause complete recompilation every time -# one of the machine description files is edited. -# That may or may not be what one wants to do. -# If it is, rm *.o is an easy way to do it. -# CONFIG_H = config.h tm.h -CONFIG_H = - -as.new: $(OBJS) $(LIBDEPS) - -mv -f as.new as.old - >as.rf $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES) - $(CC) @as.rf - -objdump: - -all.internal: native -# This is what is made with the host's compiler if making a cross assembler. -native: config.status as - -config.status: - @echo You must configure gas. Look at the INSTALL file for details. - @false - -compilations: ${OBJS} - -# Compiling object files from source files. - -app.o : app.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -as.o : as.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -atof-generic.o : atof-generic.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -bignum-copy.o : bignum-copy.c as.h host.h \ - targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -cond.o : cond.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - -debug.o : debug.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - subsegs.h -expr.o : expr.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - -fn-const.o : fn-const.c flonum.h bignum.h -fn-copy.o : fn-copy.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -flonum-mult.o : flonum-mult.c flonum.h bignum.h -frags.o : frags.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - subsegs.h -hash.o : hash.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -hex-value.o : hex-value.c -input-file.o : input-file.c as.h host.h \ - targ-env.h obj-format.h targ-cpu.h \ - struc-symbol.h write.h flonum.h bignum.h expr.h \ - frags.h hash.h read.h symbols.h tc.h obj.h input-file.h -input-scrub.o : input-scrub.c \ - as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - input-file.h -messages.o : messages.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h -obstack.o : obstack.c -output-file.o : output-file.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - output-file.h -read.o : read.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - -strstr.o : strstr.c -subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - subsegs.h -symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - subsegs.h -version.o : version.c -write.o : write.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \ - subsegs.h output-file.h -xmalloc.o : xmalloc.c -xrealloc.o : xrealloc.c -atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ - symbols.h tc.h obj.h -obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ - symbols.h tc.h obj.h -targ-cpu.o : targ-cpu.c targ-env.h obj-format.h \ - targ-cpu.h struc-symbol.h \ - write.h flonum.h bignum.h expr.h frags.h hash.h read.h \ - symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS) - - -# Compile the libraries to be used by gen*. -# If we are not cross-building, gen* use the same .o's that cc1 will use, -# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict -# with the rules for rtl.o, alloca.o, etc. -$(HOST_PREFIX_1)alloca.o: alloca.c - rm -f $(HOST_PREFIX)alloca.c - cp alloca.c $(HOST_PREFIX)alloca.c - $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c - -$(HOST_PREFIX_1)obstack.o: obstack.c - rm -f $(HOST_PREFIX)obstack.c - cp obstack.c $(HOST_PREFIX)obstack.c - $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c - -$(HOST_PREFIX_1)malloc.o: malloc.c - rm -f $(HOST_PREFIX)malloc.c - cp malloc.c $(HOST_PREFIX)malloc.c - $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c - -# Remake the info files. - -doc: as.info - -as.info: doc/as.texinfo - (cd doc; make as.info; mv as.info $srcdir) - - -# Deletion of files made during compilation. -# There are three levels of this: `clean', `cleanconfig' and `realclean'. -# `clean' deletes what you want to delete ordinarily to save space. -# This is most, but not all, of the files made by compilation. -# `cleanconfig' also deletes everything depending -# on the choice of config files. -# `realclean' also deletes everything that could be regenerated automatically. - -clean: - -rm -f $(STAGESTUFF) -# Delete the temporary source copies for cross compilation. - -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c - -rm -f $(HOST_PREFIX_1)obstack.c -# Delete the stamp files except stamp-gnulib2. - -rm -f core - -# Like clean but also delete the links made to configure gas. -cleanconfig: clean - -rm -f config.status Makefile host.h targ-env.h - -rm -f targ-cpu.h targ-cpu.c - -rm -f obj-format.h obj-format.c - -rm -f atof-targ.c - -# Get rid of every file that's generated from some other file (except INSTALL). -realclean: cleanconfig - -rm -f gas.aux gas.cps gas.fns gas.info gas.kys gas.pgs gas.tps gas.vrs - -rm -f TAGS - -rm -f gas.info* gas.?? gas.??s gas.log gas.toc gas.*aux - -rm -f *.dvi - -# Entry points `install', `includes' and `uninstall'. - -# Copy the files into directories where they will be run. -install: $(ALL) - $(INSTALL_PROGRAM) $(ALL) $(libsubdir)/as -# cp $(ALL) $(bindir)/as.new -# mv -f $(bindir)/as.new $(bindir)/as - -# Create the installation directory. -install-dir: - -mkdir $(libdir) - -mkdir $(libdir)/gcc - -mkdir $(libdir)/gcc/$(target) - -mkdir $(libdir)/gcc/$(target)/$(version) - -# Install the compiler executables built during cross compilation. -install-cross: native install-dir - -if [ -f cc1 ] ; then $(INSTALL_PROGRAM) cc1 $(libsubdir)/cc1; else true; fi - -if [ -f cc1plus ] ; then $(INSTALL_PROGRAM) cc1plus $(libsubdir)/cc1plus; else true; fi - $(INSTALL_PROGRAM) cpp $(libsubdir)/cpp - ./gcc -dumpspecs > $(libsubdir)/specs - $(INSTALL_PROGRAM) gcc $(bindir)/gcc - -# Install the man pages. -install-man: install-dir gcc.1 protoize.1 unprotoize.1 - $(INSTALL_FILE) gcc.1 $(mandir)/gcc.$(manext) - chmod a-x $(mandir)/gcc.$(manext) - $(INSTALL_FILE) protoize.1 $(mandir)/protoize.$(manext) - chmod a-x $(mandir)/protoize.$(manext) - $(INSTALL_FILE) unprotoize.1 $(mandir)/unprotoize.$(manext) - chmod a-x $(mandir)/unprotoize.$(manext) - -# Cancel installation by deleting the installed files. -uninstall: - -rm -rf $(libsubdir) - -rm -rf $(bindir)/as - -rm -rf $(mandir)/gas.$(manext) - - -# These exist for maintenance purposes. - -tags TAGS: force - etags $(REAL_SOURCES) $(REAL_HEADERS) README Makefile config/*.[hc] - -bootstrap: $(ALL) force - $(MAKE) stage1 - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) - $(MAKE) stage2 - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) - $(MAKE) comparison against=stage2 - -bootstrap2: force - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) - $(MAKE) stage2 - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) - $(MAKE) comparison against=stage2 - -bootstrap3: force - $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL) - $(MAKE) comparison against=stage2 - -# Copy the object files from a particular stage into a subdirectory. -stage1: force - -mkdir stage1 - -mv $(STAGESTUFF) stage1 - if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi - -stage2: force - -mkdir stage2 - -mv $(STAGESTUFF) stage2 - if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi - -stage3: force - -mkdir stage3 - -mv $(STAGESTUFF) stage3 - if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi - -against=stage2 - -comparison: force - for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done - -de-stage1: force - - (cd stage1 ; rm as ; mv -f * ..) - - rmdir stage1 - -de-stage2: force - - (cd stage2 ; rm as ; mv -f * ..) - - rmdir stage2 - -de-stage3: force - - (cd stage3 ; rm as ; mv -f * ..) - - rmdir stage3 - -# Copy just the executable files from a particular stage into a subdirectory, -# and delete the object files. Use this if you're just verifying a version -# that is pretty sure to work, and you are short of disk space. -risky-stage1: force - -mkdir stage1 - -mv cc1 cpp cccp gcc stage1 - -rm -f stage1/gnulib - -cp gnulib stage1 && $(RANLIB) stage1/gnulib - -make clean - -risky-stage2: force - -mkdir stage2 - -mv cc1 cpp cccp gcc stage2 - -rm -f stage2/gnulib - -cp gnulib stage2 && $(RANLIB) stage2/gnulib - -make clean - -risky-stage3: force - -mkdir stage3 - -mv cc1 cpp cccp gcc stage3 - -rm -f stage3/gnulib - -cp gnulib stage3 && $(RANLIB) stage3/gnulib - -make clean - -risky-stage4: force - -mkdir stage4 - -mv cc1 cpp cccp gcc stage4 - -rm -f stage4/gnulib - -cp gnulib stage4 && $(RANLIB) stage4/gnulib - -make clean - -#In GNU Make, ignore whether `stage*' exists. -.PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap -.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4 - -force: - -Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) - $(SHELL) ./config.status - diff --git a/gas/objdump.c b/gas/objdump.c deleted file mode 100755 index 20ad39e509..0000000000 --- a/gas/objdump.c +++ /dev/null @@ -1,2232 +0,0 @@ -/* objdump -- dump information about an object file. - Copyright (C) 1988, 1991 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. */ - -/* $Id$ */ - -/* - * objdump - * - * dump information about an object file. Until there is other documentation, - * refer to the manual page dump(1) in the system 5 program's reference manual - */ -#include -#include - -#include "getopt.h" - -#include "as.h" - -/* #define COFF_ENCAPSULATE 1 */ - -typedef FILHDR fileheader; -typedef struct exec fileheader; - -#ifdef __STDC__ -static char *sym_pname(SYMENT *s); -static char *xmalloc(unsigned size); -static char *xrealloc(char *p, unsigned size); -static void doit(char *filename); -static void dump_data(fileheader *execp, FILE *f){}; -static void dump_header(fileheader *execp, FILE *f); -static void dump_lnno(fileheader *execp, FILE *f); -static void dump_nstuff(fileheader *execp){}; -static void dump_reloc(fileheader *execp, FILE *f); -static void dump_section_contents(fileheader *execp, FILE *f); -static void dump_section_headers(fileheader *execp, FILE *f); -static void dump_sym(fileheader *execp, FILE *f); -static void dump_text(fileheader *execp, FILE *f){}; -static void hex_dump(void *buffer, int size); -#endif /* __STDC__ */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -static void read_symbols (execp, f) -#else -read_symbols (execp, f) -#endif /* OBJ_BOUT */ -struct exec *execp; -#else -static void read_section_headers(execp, f) -fileheader *execp; -#endif /* OBJ_COFF */ -FILE *f; -{ -#ifndef OBJ_COFF - int i; - struct nlist *sp; - if (symtbl) - return; - nsyms = execp->a_syms / sizeof (struct nlist); - if (nsyms == 0) -#else - if (section_headers || execp->f_nscns == 0) { -#endif /* OBJ_COFF */ - return; -#ifdef OBJ_COFF - } /* already read them, or don't need to */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF - symtbl = (struct nlist *)xmalloc (nsyms * sizeof (struct nlist)); -#else - fseek(f, sizeof(*execp) + execp->f_opthdr, 0); - section_headers = (struct scnhdr *) xmalloc(execp->f_nscns * sizeof(*section_headers)); -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT - fseek(f, N_STROFF(*execp), 0); - if (fread((char *)&strsize, sizeof strsize, 1, f) != 1) { - fprintf(stderr, "%s: can not read string table size\n", -#else - fseek (f, N_STROFF(*execp), 0); - if (fread ((char *)&strsize, sizeof strsize, 1, f) != 1) { - fprintf (stderr, "%s: can not read string table size\n", -#endif /* OBJ_BOUT */ - program_name); - exit (1); - } - strtbl = xmalloc (strsize); -#ifndef OBJ_BOUT - fseek(f, N_STROFF (*execp), 0); - if (fread(strtbl, 1, strsize, f) != strsize) { - fprintf(stderr, "%s: error reading string table\n", -#else - fseek (f, N_STROFF (*execp), 0); - if (fread (strtbl, 1, strsize, f) != strsize) { - fprintf (stderr, "%s: error reading string table\n", -#endif /* OBJ_BOUT */ - program_name); - exit (1); - } -#else - if (fread(section_headers, execp->f_nscns * sizeof(*section_headers), 1, f) != 1) { - perror("error reading section headers"); - abort(); - } /* on error */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT - fseek(f, N_SYMOFF (*execp), 0); - if (fread((char *)symtbl, sizeof (struct nlist), nsyms, f) != nsyms) { - fprintf(stderr, "%s: error reading symbol table\n", -#else - fseek (f, N_SYMOFF (*execp), 0); - if (fread ((char *)symtbl, sizeof (struct nlist), nsyms, f) != nsyms) { - fprintf (stderr, "%s: error reading symbol table\n", -#endif /* OBJ_BOUT */ - program_name); - exit (1); - } -#else - return; -} /* read_section_headers() */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF - for (i = 0, sp = symtbl; i < nsyms; i++, sp++) { - if (sp->n_un.n_strx == 0) - sp->n_un.n_name = ""; - else if (sp->n_un.n_strx < 0 || sp->n_un.n_strx > strsize) - sp->n_un.n_name = ""; - else - sp->n_un.n_name = strtbl + sp->n_un.n_strx; - } -#ifndef OBJ_BOUT -} /* read_symbols() */ -#else -} -#endif /* OBJ_BOUT */ -#else -static SYMENT *symbols = NULL; -static int longest_symbol_name = SYMNMLEN; -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -static void free_symbols () -#else -free_symbols () -#endif /* OBJ_BOUT */ -#else -static void read_symbols(execp, f) -fileheader *execp; -FILE *f; -#endif /* OBJ_COFF */ -{ -#ifdef OBJ_COFF - long here; - int bufsiz = execp->f_nsyms * sizeof(struct syment); - SYMENT *s; - - if (symbols || bufsiz == 0) { - return; - } /* already read, or don't need to */ - - symbols = (SYMENT *) xmalloc(bufsiz); - - /* read symbols */ - fseek(f, execp->f_symptr, 0); - if (fread(symbols, bufsiz, 1, f) != 1) { - fprintf(stderr, "error reading symbol table.\n"); - abort(); - } /* on error */ - - here = ftell(f); - fseek(f, 0, 2); /* find end of file */ - - if (here != ftell(f)) { - /* find string table size */ - fseek(f, here, 0); - if (fread(&strsize, sizeof(strsize), 1, f) != 1) { - perror("error reading string table size"); - abort(); - } /* on error */ - - /* read string table if there is one */ - if (strsize > 0) { - strtbl = xmalloc(strsize); - fseek(f, -sizeof(strsize), 1); /* backup over size count */ - - if (fread(strtbl, strsize, 1, f) != 1) { - perror("error reading string table"); - abort(); - } /* on error */ - - /* then connect the dots. */ - for (s = symbols; s < symbols + execp->f_nsyms; ++s) { - if (!s->n_zeroes) { - int l; - - s->n_offset = (long) strtbl + s->n_offset; - l = strlen((char *) s->n_offset); - if (l > longest_symbol_name) { - longest_symbol_name = l; - } /* keep max */ - } /* "long" name */ - - s += s->n_numaux; /* skip aux entries */ - } /* walk the symbol table */ - } else { - fprintf(stderr, "Well, now that's weird. I have a string table whose size is zero?\n"); - } /* if there is a string table */ - } /* if there is a string table */ - return; -} /* read_symbols() */ - -#ifdef comment -static void free_symbols() { -#endif /* OBJ_COFF */ - if (symtbl) - free (symtbl); - symtbl = NULL; - if (strtbl) - free (strtbl); - strtbl = NULL; -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ -} /* free_symbols() */ -#ifndef OBJ_COFF -#else -} -#endif /* OBJ_BOUT */ -#else -#endif /* comment */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF - -#ifndef OBJ_BOUT -static void usage () -#else -usage () -#endif /* OBJ_BOUT */ -{ -#ifndef OBJ_BOUT -#else -static void usage() { -#endif /* OBJ_COFF */ - (void) fprintf(stderr, "Usage: %s\n", program_name); - (void) fprintf(stderr, "\t[-ahnrt] [+all] [+header] [+nstuff]\n"); - (void) fprintf(stderr, "\t[+reloc] [+symbols] [+text] [+data]\n"); - (void) fprintf(stderr, "\t[+omit-symbol-numbers] [+omit-reloc-numbers]\n"); - (void) fprintf(stderr, "\tfile...\n"); -#ifndef OBJ_COFF -#else - fprintf (stderr, "\ -Usage: %s [-hnrt] [+header] [+nstuff] [+reloc] [+symbols] file...\n", - program_name); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - exit (1); -#ifndef OBJ_COFF -} -#else -} /* usage() */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ -static int aflag = 0; -static int hflag = 0; -#ifdef OBJ_COFF -static int lflag = 0; -#endif /* OBJ_COFF */ -static int nflag = 0; -static int rflag = 0; -#ifdef OBJ_COFF -static int sflag = 0; -#endif /* OBJ_COFF */ -static int tflag = 0; -static int Dflag = 0; -static int Tflag = 0; -static int omit_reloc_numbers_flag = 0; -static int omit_sym_numbers_flag = 0; -#ifndef OBJ_COFF -#else -int hflag; -int nflag; -int rflag; -int tflag; -#endif /* OBJ_BOUT */ -#else -static int section_headers_flag = 0; -static int section_contents_flag = 0; -#endif /* OBJ_COFF */ - -/* Size of a page. Required by N_DATADDR in a.out.gnu.h [VAX]. */ -int page_size; - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -int main (argc, argv) -#else -int main(argc, argv) -#endif /* OBJ_COFF */ -int argc; -#ifndef OBJ_COFF -#else -main (argc, argv) -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ -char **argv; -{ - int c; -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ -/* extern char *optarg; */ -#ifndef OBJ_COFF -#else - extern char *optarg; -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - extern int optind; - int seenflag = 0; - int ind = 0; -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - static struct option long_options[] = { -#ifdef OBJ_COFF - {"line-numbers", 0, &lflag, 1}, - {"section-contents", 0, §ion_contents_flag, 1}, - {"section-headers", 0, §ion_headers_flag, 1}, -#endif /* OBJ_COFF */ - {"symbols", 0, &tflag, 1}, - {"reloc", 0, &rflag, 1}, - {"nstuff", 0, &nflag, 1}, - {"header", 0, &hflag, 1}, - {"data", 0, &Dflag, 1}, - {"text", 0, &Tflag, 1}, - {"omit-relocation-numbers", 0, &omit_reloc_numbers_flag, 1}, - {"omit-symbol-numbers", 0, &omit_sym_numbers_flag, 1}, - {"all", 0, &aflag, 1}, - {NULL, 0, NULL, 0}, - }; -#ifndef OBJ_COFF -#else - static struct option long_options[] = - { - {"symbols", 0, &tflag, 1}, - {"reloc", 0, &rflag, 1}, - {"nstuff", 0, &nflag, 1}, - {"header", 0, &hflag, 1}, - {NULL, 0, NULL, 0} - }; -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF - page_size = getpagesize (); - -#endif /* OBJ_COFF */ - program_name = argv[0]; - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT - while ((c = getopt_long (argc, argv, "ahnrt", long_options, &ind)) != EOF) { -#else - while ((c = getopt_long (argc, argv, "hnrt", long_options, &ind)) - != EOF) { -#endif /* OBJ_BOUT */ -#else - while ((c = getopt_long (argc, argv, "ahlonrt", long_options, &ind)) != EOF) { -#endif /* OBJ_COFF */ - seenflag = 1; -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - switch (c) { - case 0 : break; /* we've been given a long option */ -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - case 'a': aflag = 1; break; - case 'h': hflag = 1; break; -#ifdef OBJ_COFF - case 'o': hflag = 1; break; - case 'l': lflag = 1; break; -#endif /* OBJ_COFF */ - case 'n': nflag = 1; break; - case 'r': rflag = 1; break; -#ifndef OBJ_COFF -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - case 't': tflag = 1; break; -#ifndef OBJ_COFF -#ifdef OBJ_BOUT - case 'r': rflag = 1; break; - case 'n': nflag = 1; break; - case 'h': hflag = 1; break; -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - default: - usage (); -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - } /* switch on option */ - } /* while there are options */ -#ifndef OBJ_COFF -#else - } - } -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - - if (seenflag == 0 || optind == argc) - usage (); - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - if (aflag) { - hflag = 1; -#ifdef OBJ_COFF - lflag = 1; -#endif /* OBJ_COFF */ - nflag = 1; - rflag = 1; - tflag = 1; - Dflag = 1; - Tflag = 1; -#ifdef OBJ_COFF - section_headers_flag = 1; - section_contents_flag = 1; -#endif /* OBJ_COFF */ - } /* if all */ - -#ifndef OBJ_COFF -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - while (optind < argc) -#ifndef OBJ_COFF - doit (argv[optind++]); -#ifndef OBJ_BOUT -#else - doit(argv[optind++]); -#endif /* OBJ_COFF */ - - return(0); -} /* main() */ -#ifndef OBJ_COFF -#else -} -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -static void doit (name) -#else -doit (name) -#endif /* OBJ_BOUT */ -#else -static void doit(name) -#endif /* OBJ_COFF */ -char *name; -{ - FILE *f; -#ifndef OBJ_COFF - struct exec exec; -#ifndef OBJ_BOUT -#else - fileheader exec; - - if (section_headers) { - free(section_headers); - section_headers = NULL; - } /* free section headers */ - - if (symbols) { - free(symbols); - symbols = NULL; - } /* free symbols */ - -#endif /* OBJ_COFF */ - printf("%s:\n", name); -#ifndef OBJ_COFF -#else - printf ("%s:\n", name); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - f = fopen (name, "r"); - if (f == NULL) { -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - fprintf(stderr, "%s: can not open ", program_name); -#ifndef OBJ_COFF -#else - fprintf (stderr, "%s: can not open ", program_name); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - perror (name); - return; - } -#ifdef HEADER_SEEK - HEADER_SEEK (f); -#endif -#ifndef OBJ_COFF -#ifndef OBJ_BOUT - if (fread((char *)&exec, sizeof exec, 1, f) != 1) { -#else - if (fread((char *)&exec, sizeof(exec), 1, f) != 1) { -#endif /* OBJ_COFF */ - fprintf(stderr, "%s: can not read header for %s\n", -#ifndef OBJ_COFF -#else - if (fread ((char *)&exec, sizeof exec, 1, f) != 1) { - fprintf (stderr, "%s: can not read header for %s\n", -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - program_name, name); - return; - } - -#ifdef OBJ_COFF -#ifdef I960ROMAGIC -#define N_BADMAG I960BADMAG -#endif /* I960ROMAGIC */ - -#endif /* OBJ_COFF */ - if (N_BADMAG (exec)) { -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - fprintf(stderr, "%s: %s is not a%s object file\n", - program_name, name, -#ifdef B_OUT - " b.out" -#else - "n a.out" -#endif /* B_OUT */ - ); -#ifndef OBJ_COFF -#else - fprintf (stderr, "%s: %s is not an object file\n", - program_name, name); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - return; - } - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - if (hflag) dump_header(&exec, f); -#ifdef OBJ_COFF - if (lflag) dump_lnno(&exec, f); -#endif /* OBJ_COFF */ - if (nflag) dump_nstuff(&exec); -#ifdef OBJ_COFF - if (section_headers_flag) dump_section_headers(&exec, f); - if (section_contents_flag) dump_section_contents(&exec, f); - if (sflag) dump_section_contents(&exec, f); -#endif /* OBJ_COFF */ - if (Tflag) dump_text(&exec, f); - if (Dflag) dump_data(&exec, f); - if (tflag) dump_sym(&exec, f); - if (rflag) dump_reloc(&exec, f); -#ifndef OBJ_COFF -#else - if (hflag) - dump_header (&exec); -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF - if (nflag) - dump_nstuff (&exec); -#endif /* OBJ_BOUT */ -#else - printf("\n"); - fclose(f); - return; -} /* doit() */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT - free_symbols(); -#else - if (tflag) - dump_sym (&exec, f); -#endif /* OBJ_BOUT */ -#else -static void dump_lnno(execp, f) -fileheader *execp; -FILE *f; -{ - int i = execp->f_nscns; - struct scnhdr *section; - char *buffer; - int bufsiz = 0; - - if (i) { - printf("Line numbers:\n"); - read_section_headers(execp, f); - read_symbols(execp, f); - - for (section = section_headers; i; ++section, --i) { - int size = section->s_nlnno * LINESZ; - LINENO *r; - - if (size > bufsiz) { - if (bufsiz) { - buffer = xrealloc(buffer, bufsiz = size); - } else { - buffer = xmalloc(bufsiz = size); - } /* if we had allocated anything before */ - } /* if bigger than our old buffer */ - - printf("%8.8s:", section->s_name); - fseek(f, section->s_lnnoptr, 0); - - if (size) { - int j; - - if (fread(buffer, size, 1, f) != 1) { - printf(" (error reading lnno)\n"); - continue; - } /* on read error */ - - printf("\n"); - - for (r = (LINENO *) buffer, j = 0; j < section->s_nlnno; ++j, ++r) { - printf("lnno = %d,", r->l_lnno); - - if (r->l_lnno) { - printf(" paddr = 0x%lx", (unsigned long) r->l_addr.l_paddr); - } else { - printf(" symndx = %ld, \"%s\"", - r->l_addr.l_symndx, - sym_pname(symbols + r->l_addr.l_symndx)); - } /* if not symbol'd */ - - if (r->padding[0] || r->padding[1]) { - printf(" (padding = %2x %2x)", - (unsigned) r->padding[0], - (unsigned) r->padding[1]); - } /* if padding not zero'd */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#else - printf("\n"); - } /* for each lnno record */ - } else { - printf(" (section has no line numbers.)\n"); - } /* if there really is something in the section */ - } /* for each section */ - } else { - printf("No Sections.\n"); - } /* if there are sections */ - - free(buffer); - printf("\n"); -#endif /* OBJ_COFF */ - return; -#ifndef OBJ_COFF -} /* doit() */ -#else - if (rflag) - dump_reloc (&exec, f); -#endif /* OBJ_BOUT */ -#else -} /* dump_lnno() */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -static void dump_header(execp, f) -#else - free_symbols (); -#else -static void dump_reloc(execp, f) -fileheader *execp; -FILE *f; -{ - int i = execp->f_nscns; - struct scnhdr *section; - char *buffer; - int bufsiz = 0; - - if (i) { - read_section_headers(execp, f); - - printf("Relocations:\n"); - for (section = section_headers; i; ++section, --i) { - int size = section->s_nreloc * RELSZ; - RELOC *r; - - if (size > bufsiz) { - if (bufsiz) { - buffer = xrealloc(buffer, bufsiz = size); - } else { - buffer = xmalloc(bufsiz = size); - } /* if we had allocated anything before */ - } /* if bigger than our old buffer */ - - printf("%8.8s:", section->s_name); - fseek(f, section->s_relptr, 0); - - if (size) { - int j; - - if (fread(buffer, size, 1, f) != 1) { - printf(" (error reading reloc)\n"); - continue; - } /* on read error */ - - printf("\n"); - - for (r = (RELOC *) buffer, j = 0; j < section->s_nreloc; ++j, ++r) { - printf("vaddr = 0x%lx, symndx = %ld, r_type = ", - (unsigned long) r->r_vaddr, - r->r_symndx); - - switch (r->r_type) { - case R_RELLONG: printf(" RELLONG"); break; - case R_IPRSHORT: printf("IPRSHORT"); break; - case R_IPRMED: printf(" IPRMED"); break; - case R_IPRLONG: printf(" IPRLONG"); break; - case R_OPTCALL: printf(" OPTCALL"); break; - case R_OPTCALLX: printf("OPTCALLX"); break; - case R_GETSEG: printf(" GETSEG"); break; - case R_GETPA: printf(" GETPA"); break; - case R_TAGWORD: printf(" TAGWORD"); break; - default: printf("unrecognized"); break; - } /* switch on reloc type */ - - printf("."); - - if (r->pad[0] || r->pad[1]) { - printf(" (padding = %2x %2x)", - (unsigned) r->pad[0], - (unsigned) r->pad[1]); - } /* if padding isn't zero */ - - printf("\n"); - } /* for each reloc record */ - } else { - printf(" (section has no relocations.)\n"); - } /* if there really is something in the section */ - } /* for each section */ - } else { - printf("No Sections.\n"); - } /* if there are sections */ - - /* free(buffer); */ - printf("\n"); - return; -} /* dump_reloc() */ - -static void dump_section_contents(execp, f) -fileheader *execp; -FILE *f; -{ - int i = execp->f_nscns; - struct scnhdr *section; - char *buffer; - int bufsiz = 0; - - if (i) { - read_section_headers(execp, f); - printf("Section Contents:\n"); - - for (section = section_headers; i; ++section, --i) { - if (section->s_size > bufsiz) { - if (bufsiz) { - buffer = xrealloc(buffer, bufsiz = section->s_size); - } else { - buffer = xmalloc(bufsiz = section->s_size); - } /* if we had allocated anything before */ - } /* if bigger than our old buffer */ - - printf("%8.8s:", section->s_name); - - if (section->s_flags & STYP_BSS) { - printf(" bss sections have no contents.\n"); - } else { - fseek(f, section->s_scnptr, 0); - - if (section->s_size) { - if (fread(buffer, section->s_size, 1, f) != 1) { - printf(" (error reading section contents)\n"); - } /* on read error */ - - printf("\n"); - hex_dump(buffer, section->s_size); - printf("\n"); - } else { - printf(" (section has a size of zero.)\n"); - } /* if there really is a section */ - } /* if bss else dump */ - } /* for each section */ - } else { - printf("No Sections.\n"); - } /* if there are sections */ - - free(buffer); - printf("\n"); - return; -} /* dump_section_contents() */ - -static void dump_section_headers(execp, f) -fileheader *execp; -FILE *f; -{ - int i = execp->f_nscns; - struct scnhdr *section; - - if (i > 0) { - read_section_headers(execp, f); - printf("Section Headers:\n"); - - for (section = section_headers; i; ++section, --i) { - long flags = section->s_flags; - - printf("\"%8.8s\"", section->s_name); - - printf(" physical address: 0x%x vma: 0x%x size: 0x%x (%ld)", - (unsigned) section->s_paddr, - (unsigned) section->s_vaddr, - (unsigned) section->s_size, - section->s_size); - - printf(" relocs: %d linenos: %d alignment: 0x%lx (%ld)", - section->s_nreloc, - section->s_nlnno, - section->s_align, - (long) section->s_align); - - printf(" flags: 0x%x = ", (unsigned) section->s_flags); - - if (flags & STYP_REG) { - printf(" REG"); - flags &= ~STYP_REG; - } /* STYP_REG */ - - if (flags & STYP_DSECT) { - printf(" DSECT"); - flags &= ~STYP_DSECT; - } /* STYP_DSECT */ - - if (flags & STYP_NOLOAD) { - printf(" NOLOAD"); - flags &= ~STYP_NOLOAD; - } /* STYP_NOLOAD */ - - if (flags & STYP_GROUP) { - printf(" GROUP"); - flags &= ~STYP_GROUP; - } /* STYP_GROUP */ - - if (flags & STYP_PAD) { - printf(" PAD"); - flags &= ~STYP_PAD; - } /* STYP_PAD */ - - if (flags & STYP_COPY) { - printf(" COPY"); - flags &= ~STYP_COPY; - } /* STYP_COPY */ - - if (flags & STYP_TEXT) { - printf(" TEXT"); - flags &= ~STYP_TEXT; - } /* STYP_TEXT */ - - if (flags & S_SHRSEG) { - printf(" SHRSEG"); - flags &= ~S_SHRSEG; - } /* S_SHRSEG */ - - if (flags & STYP_DATA) { - printf(" DATA"); - flags &= ~STYP_DATA; - } /* STYP_DATA */ - - if (flags & STYP_BSS) { - printf(" BSS"); - flags &= ~STYP_BSS; - } /* STYP_BSS */ - - if (flags & S_NEWFCN) { - printf(" NEWFCN"); - flags &= ~S_NEWFCN; - } /* S_NEWFCN */ - - if (flags & STYP_INFO) { - printf(" INFO"); - flags &= ~STYP_INFO; - } /* STYP_INFO */ - - if (flags & STYP_OVER) { - printf(" OVER"); - flags &= ~STYP_OVER; - } /* STYP_OVER */ - - if (flags & STYP_LIB) { - printf(" LIB"); - flags &= ~STYP_LIB; - } /* STYP_LIB */ - - if (flags & STYP_MERGE) { - printf(" MERGE"); - flags &= ~STYP_MERGE; - } /* STYP_MERGE */ - - if (flags & STYP_REVERSE_PAD) { - printf(" REVERSE_PAD"); - flags &= ~STYP_REVERSE_PAD; - } /* STYP_REVERSE_PAD */ - - if (flags) { - printf(" +unknown"); - } /* foo */ - - printf("\n"); - } /* for each section header */ - } else { - printf("No section headers.\n"); - } /* if there are any sections */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -} -#else - printf("\n"); - return; -} /* dump_section_headers() */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -dump_header (execp) -#endif /* OBJ_BOUT */ -struct exec *execp; -#ifndef OBJ_BOUT -#else -static void dump_header(execp, f) -fileheader *execp; -#endif /* OBJ_COFF */ -FILE *f; -#ifndef OBJ_COFF -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ -{ -#ifdef OBJ_COFF -#ifdef COFF - printf("magic: 0x%x (%o) ", (unsigned) execp->f_magic, (unsigned) execp->f_magic); - printf("number of sections: %d number of syms: %ld ", execp->f_nscns, execp->f_nsyms); - printf("time stamp: %s", ctime(&(execp->f_timdat))); - printf("flags:"); - - if (execp->f_flags & F_RELFLG) { - printf(" RELFLG"); - } /* relflg */ - - if (execp->f_flags & F_EXEC) { - printf(" EXEC"); - } /* exec */ - - if (execp->f_flags & F_LNNO) { - printf(" LNNO"); - } /* lnno */ - - if (execp->f_flags & F_LSYMS) { - printf(" LSYMS"); - } /* lsyms */ - - if (execp->f_flags & F_AR32WR) { - printf(" AR32WR"); - } /* ar32wr */ - - assert(F_I960KB == F_I960SB); - assert(F_I960KA == F_I960SA); - - switch (execp->f_flags & F_I960TYPE) { - case F_I960CORE: printf(" I960CORE"); break; - case F_I960KB: printf(" I960KB (== I960SB)"); break; - case F_I960MC: printf(" I960MC"); break; - case F_I960XA: printf(" I960XA"); break; - case F_I960CA: printf(" I960CA"); break; - case F_I960KA: printf(" I960KA (== I960SA)"); break; - default: printf(" I960Unknown"); break; - } /* switch on i960 type */ - - if (execp->f_flags & ~(F_RELFLG | F_EXEC | F_LNNO | F_LSYMS | F_AR32WR | F_I960TYPE)) { - printf(" +unrecognized"); - } /* unrecognized */ - - printf("\n\n"); - - if (execp->f_opthdr) { - if (execp->f_opthdr == sizeof(AOUTHDR)) { - AOUTHDR hdr; - - fseek(f, sizeof(*execp), 0); - if (fread(&hdr, sizeof(AOUTHDR), 1, f) == 1) { - printf("aouthdr:\n"); - printf("magic: 0x%x (%o)", (unsigned) hdr.magic, (unsigned) hdr.magic); - printf(" vstamp: 0x%ld\n", (long) hdr.vstamp); - - printf("sizes: text 0x%lx (%ld), data 0x%lx (%ld), bss 0x%lx (%ld)\n", - hdr.tsize, - (long) hdr.tsize, - hdr.dsize, - (long) hdr.dsize, - hdr.bsize, - (long) hdr.bsize); - - printf("entry point: 0x%lx, starts: text 0x%lx (%ld), data 0x%lx (%ld)\n", - hdr.entry, - hdr.text_start, - (long) hdr.text_start, - hdr.data_start, - (long) hdr.data_start); - - printf("tag entries: %ld\n", - (long) hdr.tagentries); - } else { - fprintf(stderr, "%s: error reading optional header", program_name); - perror(NULL); - } /* on error */ - - } else { - printf("opthder != sizeof aouthdr?"); - } /* size mismatch */ - - } else { - printf("No optional header."); - } /* print optional header */ - - -#else /* COFF */ -#endif /* OBJ_COFF */ - int x; - -#if defined (__GNU_EXEC_MACROS__) && !defined (__STRUCT_EXEC_OVERRIDE__) -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - printf("magic: 0x%x (%o)", N_MAGIC(*execp), N_MAGIC(*execp)); - printf("machine type: %d", N_MACHTYPE(*execp)); - printf("flags: 0x%x", N_FLAGS(*execp)); -#ifndef OBJ_COFF -#else - printf ("magic: 0x%x (%o)", N_MAGIC(*execp), N_MAGIC(*execp)); - printf ("machine type: %d", N_MACHTYPE(*execp)); - printf ("flags: 0x%x", N_FLAGS(*execp)); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ -#else /* non-gnu struct exec. */ -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - printf("magic: 0x%x (%o) ", (unsigned) execp->a_magic, (unsigned) execp->a_magic); -#ifndef OBJ_COFF -#else - printf ("magic: 0x%x (%o) ", execp->a_magic, execp->a_magic); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ -#endif /* non-gnu struct exec. */ -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - printf("text 0x%x ", (unsigned) execp->a_text); - printf("data 0x%x ", (unsigned) execp->a_data); - printf("bss 0x%x\n", (unsigned) execp->a_bss); - printf("nsyms %ld", (long) (execp->a_syms / sizeof(struct nlist))); - x = execp->a_syms % sizeof(struct nlist); -#ifndef OBJ_COFF -#else - printf ("text 0x%x ", execp->a_text); - printf ("data 0x%x ", execp->a_data); - printf ("bss 0x%x\n", execp->a_bss); - printf ("nsyms %d", execp->a_syms / sizeof (struct nlist)); - x = execp->a_syms % sizeof (struct nlist); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - if (x) -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - printf(" (+ %d bytes)", x); - printf(" entry 0x%lx ", execp->a_entry); - -#ifdef B_OUT - printf(" talign 0x%x", (unsigned) execp->a_talign); - printf(" dalign 0x%x", (unsigned) execp->a_dalign); - printf(" balign 0x%x", (unsigned) execp->a_balign); - printf(" unused 0x%x", (unsigned) execp->unused); -#endif /* B_OUT */ - - printf(" trsize 0x%lx", execp->a_trsize); - printf(" drsize 0x%lx", execp->a_drsize); - - if (N_TXTOFF(*execp) != 0 && N_TXTOFF(*execp) != sizeof(*execp)) { - char *buffer; - char *i; - int size = N_TXTOFF(*execp) - sizeof(*execp); - - buffer = xmalloc(size); - - fseek(f, sizeof(*execp), 0); - if (fread(buffer, size, 1, f) != 1) { - fprintf(stderr, "%s: error reading between header and text", program_name); - perror(NULL); - } /* on error */ - - for (i = buffer; i < (buffer + size); ++i) { - if (*i != '\0') { - printf(" (garbage follows header)"); - break; - } /* non null */ - } /* walk the buffer looking for garbage */ - } /* check for garbage following header */ -#ifdef OBJ_COFF -#endif /* COFF */ -#endif /* OBJ_COFF */ - - printf("\n"); - return; -} /* dump_header() */ - -#ifdef OBJ_COFF -#ifdef comment -#endif /* OBJ_COFF */ -static void dump_nstuff(execp) -#ifndef OBJ_COFF -struct exec *execp; -#else -fileheader *execp; -#endif /* OBJ_COFF */ -{ - printf("N_BADMAG %d\n", N_BADMAG(*execp)); - printf("N_TXTOFF 0x%x\n", N_TXTOFF(*execp)); - printf("N_SYMOFF 0x%lx\n", N_SYMOFF(*execp)); - printf("N_STROFF 0x%lx\n", N_STROFF(*execp)); - printf("N_TXTADDR 0x%x\n", (unsigned) N_TXTADDR(*execp)); - printf("N_DATADDR 0x%lx\n", N_DATADDR(*execp)); - - return; -} /* dump_nstuff() */ -#ifndef OBJ_COFF -#else - printf (" (+ %d bytes)", x); - printf (" entry 0x%x ", execp->a_entry); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ -static void dump_text(execp, f) -#ifndef OBJ_COFF -struct exec *execp; -#else -fileheader *execp; -#endif /* OBJ_COFF */ -FILE *f; -{ - void *buffer; - - if (execp->a_text) { - buffer = xmalloc(execp->a_text); - fseek(f, N_TXTOFF(*execp), 0); - - if (fread(buffer, execp->a_text, 1, f) != 1) { - fprintf(stderr, "%s: error reading text section.\n", program_name); - return; - } /* on error */ -#ifndef OBJ_COFF -#else - printf (" talign 0x%x ", execp->a_talign); - printf (" dalign 0x%x ", execp->a_dalign); - printf (" balign 0x%x ", execp->a_balign); - printf (" unused 0x%x ", execp->unused); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - hex_dump(buffer, execp->a_text); - free(buffer); - } else { - printf("No text section.\n"); - } /* if there is text */ - - return; -} /* dump_text() */ -#ifndef OBJ_COFF -#else - printf ("trsize 0x%x ", execp->a_trsize); - printf ("drsize 0x%x\n", execp->a_drsize); -} -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ -static void dump_data(execp, f) -#ifndef OBJ_COFF -#else -dump_nstuff (execp) -#endif /* OBJ_BOUT */ -struct exec *execp; -#ifndef OBJ_BOUT -#else -fileheader *execp; -#endif /* OBJ_COFF */ -FILE *f; -{ - void *buffer; - - if (execp->a_data) { - buffer = xmalloc(execp->a_data); - fseek(f, N_TXTOFF(*execp), 0); - - if (fread(buffer, execp->a_data, 1, f) != 1) { - fprintf(stderr, "%s: error reading data section.\n", program_name); - return; - } /* on error */ - - hex_dump(buffer, execp->a_data); - free(buffer); - } else { - printf("No data section.\n"); - } /* if there is data */ - - return; -} /* dump_data() */ -#ifdef OBJ_COFF -#endif /* comment */ -#endif /* OBJ_COFF */ - -static void hex_dump(buffer, size) -void *buffer; -int size; -#ifndef OBJ_COFF -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ -{ -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - FILE *f; - -#ifndef OBJ_COFF - if ((f = popen("od -x +0x0", "w")) != NULL) { -#else - fflush(stdout); - - if ((f = popen("hexl", "w")) != NULL) { -#endif /* OBJ_COFF */ - if (fwrite(buffer, size, 1, f) != 1) { - (void) fprintf(stderr, "%s: error writing to od(1) pipe:", program_name); - perror(NULL); - } /* on error */ - } else { - (void) fprintf(stderr, "%s: error opening pipe to od(1):", program_name); - perror(NULL); - } /* on successful popen */ - - (void) pclose(f); -#ifdef OBJ_COFF - fflush(stdout); -#endif /* OBJ_COFF */ - return; -} /* hex_dump() */ -#ifndef OBJ_COFF -#else - printf ("N_BADMAG %d\n", N_BADMAG (*execp)); - printf ("N_TXTOFF 0x%x\n", N_TXTOFF (*execp)); - printf ("N_SYMOFF 0x%x\n", N_SYMOFF (*execp)); - printf ("N_STROFF 0x%x\n", N_STROFF (*execp)); - printf ("N_TXTADDR 0x%x\n", N_TXTADDR (*execp)); - printf ("N_DATADDR 0x%x\n", N_DATADDR (*execp)); -} -#endif /* OBJ_BOUT */ -#else - -char *sym_class_pname(class) -char class; -{ - switch (class) { - case C_EFCN: return("EFCN"); - case C_NULL: return("NULL"); - case C_AUTO: return("AUTO"); - case C_EXT: return("EXT"); - case C_STAT: return("STAT"); - case C_REG: return("REG"); - case C_EXTDEF: return("EXTDEF"); - case C_LABEL: return("LABEL"); - case C_ULABEL: return("ULABEL"); - case C_MOS: return("MOS"); - case C_ARG: return("ARG"); - case C_STRTAG: return("STRTAG"); - case C_MOU: return("MOU"); - case C_UNTAG: return("UNTAG"); - case C_TPDEF: return("TPDEF"); - case C_USTATIC: return("USTATIC"); - case C_ENTAG: return("ENTAG"); - case C_MOE: return("MOE"); - case C_REGPARM: return("REGPARM"); - case C_FIELD: return("FIELD"); - case C_BLOCK: return("BLOCK"); - case C_FCN: return("FCN"); - case C_EOS: return("EOS"); - case C_FILE: return("FILE"); - case C_LINE: return("LINE"); - case C_ALIAS: return("ALIAS"); - case C_HIDDEN: return("HIDDEN"); - - case C_SCALL: return("SCALL"); - case C_LEAFEXT: return("LEAFEXT"); - case C_OPTVAR: return("OPTVAR"); - case C_DEFINE: return("DEFINE"); - case C_PRAGMA: return("PRAGMA"); - case C_SEGMENT: return("SEGMENT"); - case C_LEAFSTAT:return("LEAFSTAT"); - case C_AUTOARG: return("AUTOARG"); - - default: return("(???)"); - } /* switch on class */ -} /* sym_class_pname() */ - -char *sym_type_pname(type) -unsigned long type; -{ - switch (type) { - case T_NULL: return("NULL"); - case T_VOID: return("VOID"); - case T_CHAR: return("CHAR"); - case T_SHORT: return("SHORT"); - case T_INT: return("INT"); - case T_LONG: return("LONG"); - case T_FLOAT: return("FLOAT"); - case T_DOUBLE: return("DOUBLE"); - case T_STRUCT: return("STRUCT"); - case T_UNION: return("UNION"); - case T_ENUM: return("ENUM"); - case T_MOE: return("MOE"); - case T_UCHAR: return("UCHAR"); - case T_USHORT: return("USHORT"); - case T_UINT: return("UINT"); - case T_ULONG: return("ULONG"); - case T_LNGDBL: return("LNGDBL"); - - default: return("(???)"); - } /* switch on type */ -} /* sym_type_pname() */ - -char *sym_section_pname(scnum, execp) -short scnum; -fileheader *execp; -{ - switch (scnum) { - case N_UNDEF: return("UNDEF"); - case N_ABS: return("ABS"); - case N_DEBUG: return("DEBUG"); - case N_TV: return("NTV"); - case P_TV: return("PTV"); - - default: - assert(0 <= (scnum-1)); - assert((scnum-1) < execp->f_nscns); - return(section_headers[scnum-1].s_name); - } /* switch on scnum */ -} /* sym_section_pname() */ - -static char *sym_pname(s) -SYMENT *s; -{ - static char buffer[SYMNMLEN + 1]; - if (s->n_zeroes) { - bzero(buffer, SYMNMLEN + 1); - bcopy(s->n_name, buffer, SYMNMLEN); - return(buffer); - } else { - return((char *) s->n_offset); - } /* if "short" name */ -} /* sym_pname() */ - -/* - * Notes: .file must be first, .text, .data, .bss must be last. - */ - -static void dump_aux_fcn(aux) -AUXENT *aux; -{ - /* function symbol */ - printf(" tagndx %ld,", aux->x_sym.x_tagndx); - printf(" size %ld,", aux->x_sym.x_misc.x_fsize); - printf(" lnnoptr 0x%lx,", (unsigned long) aux->x_sym.x_fcnary.x_fcn.x_lnnoptr); - printf(" endndx %ld", aux->x_sym.x_fcnary.x_fcn.x_endndx); - printf(" tvndx 0x%x,", (unsigned) aux->x_sym.x_tvndx); - return; -} /* dump_aux_fcn() */ - -static void dump_aux_tagmember(aux) -AUXENT *aux; -{ - printf(" tagndx %ld,", aux->x_sym.x_tagndx); - printf(" size %d,", aux->x_sym.x_misc.x_lnsz.x_size); - return; -} /* dump_aux_tagmember() */ - -static void dump_aux_array(aux) -AUXENT *aux; -{ - int i; -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#else - printf(" size %d, ", aux->x_sym.x_misc.x_lnsz.x_size); - - for (i = 0; i < 4; ++i) { - printf("[%d]", aux->x_sym.x_fcnary.x_ary.x_dimen[i]); - } /* four dimensions */ - - return; -} /* dump_aux_array() */ - -#endif /* OBJ_COFF */ -static void dump_sym(execp, f) -#ifndef OBJ_COFF -#else -dump_sym (execp, f) -#endif /* OBJ_BOUT */ -struct exec *execp; -#else -fileheader *execp; -#endif /* OBJ_COFF */ -FILE *f; -{ - int i; -#ifndef OBJ_COFF - struct nlist *sp; -#else - SYMENT *sp; -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT - read_symbols(execp, f); -#else - read_symbols (execp, f); -#endif /* OBJ_BOUT */ - if (nsyms == 0) { -#ifndef OBJ_BOUT -#else - read_section_headers(execp, f); - - if (execp->f_nsyms == 0) { -#endif /* OBJ_COFF */ - printf("no symbols\n"); -#ifndef OBJ_COFF -#else - printf ("no symbols\n"); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - return; -#ifndef OBJ_COFF - } -#else - } /* if there are any */ - - read_symbols(execp, f); - printf("Symbols:\n"); -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - if (!omit_sym_numbers_flag) { -#ifndef OBJ_COFF - printf("%3s: ", "#"); -#else - printf("%3s:", "#"); -#endif /* OBJ_COFF */ - } /* printing symbol numbers */ - -#ifndef OBJ_COFF - printf("%4s %5s %4s %8s\n", - "type", "other", "desc", "val"); -#else - printf(" %*.*s %8.8s %3.3s %8.8s %7.7s %3.3s %s\n", - SYMNMLEN, SYMNMLEN, "name", - "value", "num", "sec-name", "class", "aux", "type"); -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#else - printf ("%3s: %4s %5s %4s %8s\n", - "#", "type", "other", "desc", "val"); -#endif /* OBJ_BOUT */ - for (i = 0, sp = symtbl; i < nsyms; i++, sp++) { -#ifndef OBJ_BOUT -#else - for (i = 0, sp = symbols; sp < symbols + execp->f_nsyms; ++sp, ++i) { -#endif /* OBJ_COFF */ - if (!omit_sym_numbers_flag) { -#ifndef OBJ_COFF - printf("%3d: ", i); -#else - printf("%3d:", i); -#endif /* OBJ_COFF */ - } /* printing symbol numbers */ - -#ifndef OBJ_COFF - printf("%4x %5x %4x %8lx %s", - (unsigned) (sp->n_type & 0xff), - (unsigned) (sp->n_other & 0xff), - (unsigned) (sp->n_desc & 0xffff), -#else - printf ("%3d: %4x %5x %4x %8x %s", - i, - sp->n_type & 0xff, - sp->n_other & 0xff, - sp->n_desc & 0xffff, -#endif /* OBJ_BOUT */ - sp->n_value, - sp->n_un.n_name); -#ifndef OBJ_BOUT -#else - printf(" %*.*s", SYMNMLEN, SYMNMLEN, (sp->n_zeroes) ? sp->n_name : ""); -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#else - -#endif /* OBJ_BOUT */ - if (sp->n_type & N_EXT) printf(" N_EXT"); - if (sp->n_type & N_STAB) printf(" N_STAB"); -#ifndef OBJ_BOUT -#else - printf(" %8lx", (unsigned long) sp->n_value); - printf(" %3d", sp->n_scnum); - printf(" %8.8s", sym_section_pname(sp->n_scnum, execp)); - printf(" %7.7s", sym_class_pname(sp->n_sclass)); - printf(" %1d", sp->n_numaux); -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#else - -#endif /* OBJ_BOUT */ - if ((sp->n_type & N_TYPE) == N_UNDF) { - printf(" N_UNDF"); - } else { - if (sp->n_type & N_ABS) printf(" N_ABS"); - if (sp->n_type & N_TEXT) printf(" N_TEXT"); - if (sp->n_type & N_DATA) printf(" N_DATA"); - if (sp->n_type & N_BSS) printf(" N_BSS"); - if (sp->n_type & N_FN) printf(" N_FN"); - } /* if not undefined */ -#ifndef OBJ_BOUT -#else - printf(" %s", sym_type_pname(BTYPE(sp->n_type))); -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifdef B_OUT -#else - -#endif /* OBJ_BOUT */ - if (sp->n_other) { - printf(" ["); -#ifndef OBJ_BOUT -#else - /* derived type */ - printf("%s", (ISPTR(sp->n_type) - ? "(PTR)" - : (ISFCN(sp->n_type) - ? "(FCN)" - : (ISARY(sp->n_type) - ? "(ARY)" - : "")))); - - if (sp->n_type & ~(N_BTMASK | N_TMASK)) { - printf("+"); - } /* if type isn't all */ - - if (!sp->n_zeroes) { - printf(" \"%s\"", sym_pname(sp)); - } /* if "long" name */ - - /* FIXME do something with the flags field */ -#ifdef comment - if (sp->pad1[0] != 0 || sp->pad1[1] != 0) { - printf(" (pad1 %2.2x%2.2x)", (unsigned) sp->pad1[0], (unsigned) sp->pad1[1]); - } /* if padding not zeroed */ -#endif /* comment */ - - if (sp->pad2[0] != 0 || sp->pad2[1] != 0) { - printf(" (pad2 %2.2x%2.2x)", (unsigned) sp->pad2[0], (unsigned) sp->pad2[1]); - } /* if padding not zeroed */ - -#define DTYPE(x) (((x) & N_TMASK) >> N_BTSHFT) - - if (sp->n_numaux > 0) { - int auxcountshouldbe = 1; - AUXENT *aux = (AUXENT *) (sp + 1); - AUXENT *aux2 = (AUXENT *) (sp + 2); -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#else -#else - switch (sp->n_sclass) { - - case C_FILE: /* file symbol */ - printf(" filename \"%s\"", aux->x_file.x_fname); - break; - - case C_UNTAG: - case C_ENTAG: - case C_STRTAG: { - if (DTYPE(sp->n_type) == DT_NON - && (BTYPE(sp->n_type) == T_NULL - || BTYPE(sp->n_type) == T_STRUCT - || BTYPE(sp->n_type) == T_UNION - || BTYPE(sp->n_type) == T_ENUM)) { - printf(" size %d,", aux->x_sym.x_misc.x_lnsz.x_size); - printf(" endndx %ld", aux->x_sym.x_fcnary.x_fcn.x_endndx); - } else { - printf(" (don't know why this tag has an auxent)"); - abort(); - } /* if I understand */ - - break; - } /* tags */ - - case C_EOS: { - if (BTYPE(sp->n_type) == DT_NON && BTYPE(sp->n_type) == T_NULL) { - printf(" tagndx %ld,", aux->x_sym.x_tagndx); - printf(" size %d,", aux->x_sym.x_misc.x_lnsz.x_size); - } else { - printf(" (don't know why this eos has an auxent)"); - abort(); - } /* if I understand */ - break; - } /* eos */ - - case C_FCN: - case C_BLOCK: { - if (BTYPE(sp->n_type) == DT_NON && BTYPE(sp->n_type) == T_NULL) { - if (!strcmp(sp->n_name, ".bb") || !strcmp(sp->n_name, ".bf")) { - printf(" lnno %d", aux->x_sym.x_misc.x_lnsz.x_lnno); - printf(" endndx %ld", aux->x_sym.x_fcnary.x_fcn.x_endndx); - break; - - } else if (!strcmp(sp->n_name, ".eb") || !strcmp(sp->n_name, ".ef")) { - printf(" lnno %d", aux->x_sym.x_misc.x_lnsz.x_lnno); - break; - - } /* beginning or ending */ - } /* if I understand */ - - printf(" (don't know why this fcn or block has an auxent)"); - abort(); - break; - } /* begin/end blocks */ - - case C_LEAFEXT: - case C_LEAFSTAT: - case C_SCALL: - case C_EXT: { - assert(BTYPE(sp->n_type) != T_MOE); - - if (ISFCN(sp->n_type) - || BTYPE(sp->n_type) == T_NULL) { - dump_aux_fcn(aux); - - if (sp->n_sclass == C_SCALL) { - printf(" stindx %ld", aux2->x_sc.x_stindx); - auxcountshouldbe = 2; - } else if (sp->n_sclass == C_LEAFEXT - || sp->n_sclass == C_LEAFSTAT) { - printf(" balentry 0x%lx", aux2->x_bal.x_balntry); - auxcountshouldbe = 2; - } /* special functions */ - } else if (ISARY(sp->n_type)) { - dump_aux_array(aux); - } else if (BTYPE(sp->n_type) == T_STRUCT) { - printf(" tagndx %ld,", aux->x_sym.x_tagndx); - printf(" size %d,", aux->x_sym.x_misc.x_lnsz.x_size); - } else { - assert(0); - } /* on type */ - - break; - } /* function */ - - case C_STAT: { - switch (DTYPE(sp->n_type)) { - case DT_NON: - switch (BTYPE(sp->n_type)) { - case T_NULL: /* section symbol */ - printf(" length 0x%lx, relocs %d, lnnos %d", - (unsigned long) aux->x_scn.x_scnlen, - aux->x_scn.x_nreloc, - aux->x_scn.x_nlinno); - break; - case T_STRUCT: - case T_UNION: - case T_ENUM: - dump_aux_tagmember(aux); - break; - default: - printf(" (confused)."); - abort(); - } /* switch on btype */ - break; - - case DT_FCN: /* function */ - if (BTYPE(sp->n_type) == T_MOE) { - printf(" (confused)."); - abort(); - } else { - dump_aux_fcn(aux); - } /* if I understand */ - break; - - case DT_ARY: - assert(BTYPE(sp->n_type) != T_MOE); - dump_aux_array(aux); - /* intentional fall through */ - case DT_PTR: - assert(BTYPE(sp->n_type) == T_STRUCT - || BTYPE(sp->n_type) == T_UNION - || BTYPE(sp->n_type) == T_ENUM); - dump_aux_tagmember(aux); - break; - - default: - printf(" (confused.)"); - abort(); - } /* switch on derived type */ - - break; - } /* STAT */ - - case C_AUTO: - case C_MOS: - case C_MOU: - case C_TPDEF: - if (DTYPE(sp->n_type) == DT_ARY) { - assert(BTYPE(sp->n_type) != T_MOE); - dump_aux_array(aux); - } else { - dump_aux_tagmember(aux); - } /* if an array */ - break; -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#endif /* OBJ_BOUT */ - if (sp->n_other == N_CALLNAME) { - printf(" N_CALLNAME"); - } else if (sp->n_other == N_BALNAME) { - printf(" N_BALNAME"); - } else if (1 <= sp->n_other && sp->n_other <= 32) { - printf(" \"trap\""); - } else { - printf(" !!!invalid \"other\" field"); - } /* what is it */ -#ifndef OBJ_BOUT -#else - case C_FIELD: - printf(" tagndx %ld,", aux->x_sym.x_tagndx); - printf(" size %d,", aux->x_sym.x_misc.x_lnsz.x_size); - break; - - default: - printf(" (don't know why this symbol has aux entries.)"); - abort(); - break; - } /* switch on class */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#else - -#endif /* OBJ_BOUT */ - printf(" ]"); - } /* is defined */ -#ifndef OBJ_BOUT -#endif /* B_OUT */ -#else - if (sp->n_numaux != auxcountshouldbe) { - printf(" (expecting %d auxents here)", auxcountshouldbe); - abort(); - } /* on miscount */ - } /* do aux entries */ - - i += sp->n_numaux; - sp += sp->n_numaux; -#endif /* OBJ_COFF */ - - printf("\n"); - } /* for each symbol */ -#ifndef OBJ_COFF -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#else - printf("\n"); -#endif /* OBJ_COFF */ - return; -} /* dump_sym() */ -#ifndef OBJ_COFF -#else - printf("\n"); - } -} -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#else -#ifdef comment -#endif /* OBJ_COFF */ -static void dump_reloc (execp, f) -#ifndef OBJ_COFF -#else -dump_reloc (execp, f) -#endif /* OBJ_BOUT */ -struct exec *execp; -#else -fileheader *execp; -#endif /* OBJ_COFF */ -FILE *f; -{ -#ifndef OBJ_COFF - read_symbols (execp, f); -#else - read_symbols(execp, f); -#endif /* OBJ_COFF */ - if (execp->a_trsize) { -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - printf("text reloc\n"); -#ifndef OBJ_COFF -#else - printf ("text reloc\n"); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - dump_reloc1 (execp, f, N_TRELOFF (*execp), execp->a_trsize); - } - if (execp->a_drsize) { -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - printf("data reloc\n"); -#ifndef OBJ_COFF -#else - printf ("data reloc\n"); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - dump_reloc1 (execp, f, N_DRELOFF (*execp), execp->a_drsize); - } -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - - return; -} /* dump_reloc() */ -#ifndef OBJ_COFF -#else -} -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ -static void dump_reloc1 (execp, f, off, size) -#ifndef OBJ_COFF -#else -dump_reloc1 (execp, f, off, size) -#endif /* OBJ_BOUT */ -struct exec *execp; -#else -fileheader *execp; -#endif /* OBJ_COFF */ -FILE *f; -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ -int off; -int size; -#ifndef OBJ_COFF -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ -{ - int nreloc; - struct relocation_info reloc; - int i; - - nreloc = size / sizeof (struct relocation_info); - -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - if (!omit_reloc_numbers_flag) { - printf("%3s: ", "#"); - } /* if printing numbers */ - -#ifndef sparc - printf("%3s ", "len"); -#endif /* sparc */ - - printf("%8s %4s\n", "adr", "sym"); - - - fseek(f, off, 0); -#ifndef OBJ_COFF -#else - printf ("%3s: %3s %8s %4s\n", "#", "len", "adr", "sym"); - fseek (f, off, 0); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - for (i = 0; i < nreloc; i++) { -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - if (fread((char *)&reloc, sizeof reloc, 1, f) != 1) { - fprintf(stderr, "%s: error reading reloc\n", -#ifndef OBJ_COFF -#else - if (fread ((char *)&reloc, sizeof reloc, 1, f) != 1) { - fprintf (stderr, "%s: error reading reloc\n", -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - program_name); - return; - } -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - - if (!omit_reloc_numbers_flag) { - printf("%3d: ", i); - } /* if printing numbers */ - -#ifndef sparc - printf("%3d ", 1 << reloc.r_length); -#endif /* sparc */ - - printf("%8lx ", (long unsigned) reloc.r_address); - -#ifndef B_OUT -#ifndef OBJ_COFF -#else - printf ("%3d: %3d %8x ", i, 1 << reloc.r_length, - reloc.r_address); - -#ifdef NOT -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - if (reloc.r_extern) { -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - if (!omit_sym_numbers_flag) { - (void) printf("%4d ", reloc.r_symbolnum); - } else { - (void) printf(" "); - } /* if printing sym numbers */ - -#ifndef OBJ_COFF -#else - printf ("%4d ", reloc.r_symbolnum); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - if (reloc.r_symbolnum < nsyms) -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - printf("%s ", symtbl[reloc.r_symbolnum].n_un.n_name); -#ifndef OBJ_COFF -#else - printf ("%s ", - symtbl[reloc.r_symbolnum].n_un.n_name); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - } else { -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - printf(" "); -#ifndef OBJ_COFF -#else - printf (" "); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - switch (reloc.r_symbolnum & ~N_EXT) { -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - case N_TEXT: printf(".text "); break; - case N_DATA: printf(".data "); break; - case N_BSS: printf(".bss "); break; - case N_ABS: printf(".abs "); break; - default: printf("base %x ", (unsigned) reloc.r_symbolnum); break; -#ifndef OBJ_COFF -#else - case N_TEXT: printf (".text "); break; - case N_DATA: printf (".data "); break; - case N_BSS: printf (".bss "); break; - case N_ABS: printf (".abs "); break; - default: printf ("base %x ", reloc.r_symbolnum); break; -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ - } - } -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ -#endif /* not B_OUT */ - -#ifdef SPARC - if (reloc.r_addend) printf("+0x%x ", (unsigned) reloc.r_addend); - - switch (reloc.r_type) { - case RELOC_8: printf("R8 "); break; - case RELOC_16: printf("R16 "); break; - case RELOC_32: printf("R32 "); break; - case RELOC_DISP8: printf("DISP8 "); break; - case RELOC_DISP16: printf("DISP16 "); break; - case RELOC_DISP32: printf("DISP32 "); break; - case RELOC_WDISP30: printf("WDISP30 "); break; - case RELOC_WDISP22: printf("WDISP22 "); break; - case RELOC_HI22: printf("HI22 "); break; - case RELOC_22: printf("R22 "); break; - case RELOC_13: printf("R13 "); break; - case RELOC_LO10: printf("LO10 "); break; - case RELOC_SFA_BASE: printf("SFA_BASE "); break; - case RELOC_SFA_OFF13: printf("SFA_OFF13 "); break; - case RELOC_BASE10: printf("BASE10 "); break; - case RELOC_BASE13: printf("BASE13 "); break; - case RELOC_BASE22: printf("BASE22 "); break; - case RELOC_PC10: printf("PC10 "); break; - case RELOC_PC22: printf("PC22 "); break; - case RELOC_JMP_TBL: printf("JMP_TBL "); break; - case RELOC_SEGOFF16: printf("SEGOFF16 "); break; - case RELOC_GLOB_DAT: printf("GLOB_DAT "); break; - case RELOC_JMP_SLOT: printf("JMP_SLOT "); break; - case RELOC_RELATIVE: printf("RELATIVE "); break; - } /* switch on reloc type */ -#else /* SPARC */ - if (reloc.r_pcrel) printf("PCREL "); -#endif /* SPARC */ - -#ifdef B_OUT - if (reloc.r_bsr) printf("BSR "); - if (reloc.r_disp) printf("DISP "); - if (reloc.r_callj) printf("CALLJ "); - if (reloc.nuthin) printf("NUTHIN "); -#endif /* B_OUT */ - -#ifdef SPARC - { - struct reloc_info_sparc spare; - - bzero(&spare, sizeof(spare)); - - reloc.r_address = 0; - reloc.r_index = 0; - reloc.r_extern = 0; - reloc.r_type = 0; - reloc.r_addend = 0; - - if (bcmp(&reloc, &spare, sizeof(spare))) { - printf("(garbage in spare bits) "); - } /* if garbage in spare bits */ - } /* sparc */ -#endif /* SPARC */ - -#ifndef OBJ_COFF -#else -#endif /* NOT */ - if (reloc.r_pcrel) printf ("PCREL "); - if (reloc.r_bsr) printf ("BSR "); - if (reloc.r_disp) printf ("DISP "); - if (reloc.r_callj) printf ("CALLJ "); - if (reloc.nuthin) printf ("NUTHIN "); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ -#if 0 -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - if (reloc.r_pad) printf("PAD %x ", reloc.r_pad); -#ifndef OBJ_COFF -#else - if (reloc.r_pad) printf ("PAD %x ", reloc.r_pad); -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ -#endif -#ifndef OBJ_COFF -#ifndef OBJ_BOUT -#endif /* OBJ_COFF */ - printf("\n"); - } /* for each reloc record */ - - return; -} /* dump_reloc1() */ -#ifndef OBJ_COFF -#else - printf ("\n"); - } -} -#endif /* OBJ_BOUT */ -#else -#endif /* comment */ -#endif /* OBJ_COFF */ - -/* Allocate `n' bytes of memory dynamically, with error checking. */ - -#ifndef OBJ_COFF -char * -xmalloc (n) - unsigned n; -{ - char *p; - - p = malloc (n); - if (p == 0) - { -#ifndef OBJ_BOUT - fprintf(stderr, "%s: virtual memory exhausted\n", program_name); -#else - fprintf (stderr, "%s: virtual memory exhausted\n", program_name); -#endif /* OBJ_BOUT */ - exit (1); - } -#ifndef OBJ_BOUT - bzero(p, n); -#endif /* OBJ_BOUT */ - return p; -#ifndef OBJ_BOUT -#else -static char *xmalloc (n) -unsigned n; -{ - char *p; - - p = malloc (n); - if (p == NULL) - { - fprintf(stderr, "%s: virtual memory exhausted\n", program_name); - exit (1); - } - bzero(p, n); - return p; -#endif /* OBJ_COFF */ -} /* xmalloc() */ - -#ifdef OBJ_COFF -static char *xrealloc(p, size) -char *p; -unsigned size; -{ - p = realloc(p, size); - - if (p == NULL) { - fprintf(stderr, "%s: virtual memory exhausted\n", program_name); - exit (1); - } /* on malloc failure */ - - bzero(p, size); - return(p); -} /* xrealloc() */ - -#endif /* OBJ_COFF */ -/* - * Local Variables: - * comment-column: 0 - * fill-column: 131 - * End: - */ - -/* end of objdump.c */ -#ifndef OBJ_COFF -#else -} -#endif /* OBJ_BOUT */ -#endif /* OBJ_COFF */ diff --git a/gas/obstack.c b/gas/obstack.c deleted file mode 100644 index 9837b1e761..0000000000 --- a/gas/obstack.c +++ /dev/null @@ -1,380 +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 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, 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 = (struct _obstack_chunk * (*)()) chunkfun; - h->freefun = freefun; - h->chunk_size = size; - h->alignment_mask = alignment - 1; - - chunk = h->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; - /* The initial chunk now contains no empty object. */ - h->maybe_empty_object = 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. */ - -void -_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 = (*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]; - - /* If the object just copied was the only data in OLD_CHUNK, - free that chunk and remove it from the chain. - But not if that chunk might contain an empty object. */ - if (h->object_base == old_chunk->contents && !h->maybe_empty_object) - { - new_chunk->prev = old_chunk->prev; - (*h->freefun) (old_chunk); - } - - h->object_base = new_chunk->contents; - h->next_free = h->object_base + obj_size; - /* The new chunk certainly contains no empty object yet. */ - h->maybe_empty_object = 0; -} - -/* 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; - /* We use >= rather than > since the object cannot be exactly at - the beginning of the chunk but might be an empty object exactly - at the end of an adjacent 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. */ - -#undef obstack_free - -/* This function has two names with identical definitions. - This is the first one, called from non-ANSI code. */ - -void -_obstack_free (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; - /* 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) (lp); - lp = plp; - /* If we switch chunks, we can't tell whether the new current - chunk contains an empty object, so assume that it may. */ - h->maybe_empty_object = 1; - } - 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 (); -} - -/* This function is used from ANSI code. */ - -void -obstack_free (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; - /* 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) (lp); - lp = plp; - /* If we switch chunks, we can't tell whether the new current - chunk contains an empty object, so assume that it may. */ - h->maybe_empty_object = 1; - } - 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 (); -} - -#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/gas/obstack.h b/gas/obstack.h deleted file mode 100644 index c6a8e0a15f..0000000000 --- a/gas/obstack.h +++ /dev/null @@ -1,444 +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 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, 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. */ - struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */ - void (*freefun) (); /* User's function to free a chunk. */ - /* Nonzero means there is a possibility the current chunk contains - a zero-length object. This prevents freeing the chunk - if we allocate a bigger chunk to replace it. */ - char maybe_empty_object; -}; - -/* Declare the external functions we use; they are in obstack.c. */ - -#ifdef __STDC__ -extern void _obstack_newchunk (struct obstack *, int); -extern void _obstack_free (struct obstack *, void *); -extern void _obstack_begin (struct obstack *, int, int, - void *(*)(), void (*)()); -#else -extern void _obstack_newchunk (); -extern void _obstack_free (); -extern void _obstack_begin (); -#endif - -#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, \ - (void *(*) ()) obstack_chunk_alloc, (void (*) ())obstack_chunk_free) - -#define obstack_begin(h, size) \ - _obstack_begin ((h), (size), 0, \ - (void *(*) ()) obstack_chunk_alloc, (void (*) ())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__) -#if __GNUC__ < 2 -#define __extension__ -#endif - -/* 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) \ - __extension__ \ - ({ struct obstack *__o = (OBSTACK); \ - (unsigned) (__o->next_free - __o->object_base); }) - -#define obstack_room(OBSTACK) \ - __extension__ \ - ({ struct obstack *__o = (OBSTACK); \ - (unsigned) (__o->chunk_limit - __o->next_free); }) - -/* Note that the call to _obstack_newchunk is enclosed in (..., 0) - so that we can avoid having void expressions - in the arms of the conditional expression. - Casting the third operand to void was tried before, - but some compilers won't accept it. */ -#define obstack_grow(OBSTACK,where,length) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - int __len = (length); \ - ((__o->next_free + __len > __o->chunk_limit) \ - ? (_obstack_newchunk (__o, __len), 0) : 0); \ - memcpy (__o->next_free, where, __len); \ - __o->next_free += __len; \ - (void) 0; }) - -#define obstack_grow0(OBSTACK,where,length) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - int __len = (length); \ - ((__o->next_free + __len + 1 > __o->chunk_limit) \ - ? (_obstack_newchunk (__o, __len + 1), 0) : 0), \ - memcpy (__o->next_free, where, __len), \ - __o->next_free += __len, \ - *(__o->next_free)++ = 0; \ - (void) 0; }) - -#define obstack_1grow(OBSTACK,datum) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - ((__o->next_free + 1 > __o->chunk_limit) \ - ? (_obstack_newchunk (__o, 1), 0) : 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) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - ((__o->next_free + sizeof (void *) > __o->chunk_limit) \ - ? (_obstack_newchunk (__o, sizeof (void *)), 0) : 0), \ - *(*(void ***)&__o->next_free)++ = ((void *)datum); \ - (void) 0; }) - -#define obstack_int_grow(OBSTACK,datum) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - ((__o->next_free + sizeof (int) > __o->chunk_limit) \ - ? (_obstack_newchunk (__o, sizeof (int)), 0) : 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) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - int __len = (length); \ - ((__o->chunk_limit - __o->next_free < __len) \ - ? (_obstack_newchunk (__o, __len), 0) : 0); \ - __o->next_free += __len; \ - (void) 0; }) - -#define obstack_alloc(OBSTACK,length) \ -__extension__ \ -({ struct obstack *__h = (OBSTACK); \ - obstack_blank (__h, (length)); \ - obstack_finish (__h); }) - -#define obstack_copy(OBSTACK,where,length) \ -__extension__ \ -({ struct obstack *__h = (OBSTACK); \ - obstack_grow (__h, (where), (length)); \ - obstack_finish (__h); }) - -#define obstack_copy0(OBSTACK,where,length) \ -__extension__ \ -({ struct obstack *__h = (OBSTACK); \ - obstack_grow0 (__h, (where), (length)); \ - obstack_finish (__h); }) - -/* The local variable is named __o1 to avoid a name conflict - when obstack_blank is called. */ -#define obstack_finish(OBSTACK) \ -__extension__ \ -({ struct obstack *__o1 = (OBSTACK); \ - void *value = (void *) __o1->object_base; \ - if (__o1->next_free == value) \ - __o1->maybe_empty_object = 1; \ - __o1->next_free \ - = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\ - & ~ (__o1->alignment_mask)); \ - ((__o1->next_free - (char *)__o1->chunk \ - > __o1->chunk_limit - (char *)__o1->chunk) \ - ? (__o1->next_free = __o1->chunk_limit) : 0); \ - __o1->object_base = __o1->next_free; \ - value; }) - -#define obstack_free(OBSTACK, OBJ) \ -__extension__ \ -({ 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) : 0), \ - memcpy ((h)->next_free, where, (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) : 0), \ - memcpy ((h)->next_free, where, (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) : 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) : 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) : 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) : 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)->next_free == (h)->object_base \ - ? (((h)->maybe_empty_object = 1), 0) \ - : 0), \ - (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), 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) \ - : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0))) -#endif - -#endif /* not __GNUC__ or not __STDC__ */ - -#endif /* not __OBSTACKS__ */ diff --git a/gas/strerror.c b/gas/strerror.c deleted file mode 100644 index 0e3d7f9f09..0000000000 --- a/gas/strerror.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Version of strerror() for systems that need it. - Copyright (C) 1991, 1992 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. */ - - -/* - -NAME - - strerror -- map an error number to an error message string - -SYNOPSIS - - #include - - char *strerror (int errnum) - -DESCRIPTION - - Returns a pointer to a string containing an error message, the - contents of which are implementation defined. The implementation - shall behave as if no library function calls strerror. The string - pointed to shall not be modified by the caller and is only guaranteed - to be valid until a subsequent call to strerror. - -BUGS - - Requires that the system have sys_errlist and sys_nerr. - -*/ - -#ifndef HAVE_STRERROR - -extern int sys_nerr; -extern char *sys_errlist[]; - -char * -strerror (code) - int code; -{ - return (((code < 0) || (code >= sys_nerr)) - ? "(unknown error)" - : sys_errlist[code]); -} - -#endif /* HAVE_STRERROR */ - -/* end of strerror.c */ diff --git a/gas/strstr.c b/gas/strstr.c deleted file mode 100644 index 2bb8890940..0000000000 --- a/gas/strstr.c +++ /dev/null @@ -1,55 +0,0 @@ -/* strstr - find first occurrence of wanted in s - - Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* If your compiler is really ansi, then you don't need this. */ - -#if __STDC__ != 1 - -#define SIZET int - -#define NULL 0 - -#include - -char * /* found string, or NULL if none */ -strstr (s, wanted) - char *s; - char *wanted; -{ - register char *scan; - register SIZET len; - register char firstc; - - /* - * The odd placement of the two tests is so "" is findable. - * Also, we inline the first char for speed. - * The ++ on scan has been moved down for optimization. - */ - firstc = *wanted; - len = strlen (wanted); - for (scan = s; *scan != firstc || strncmp (scan, wanted, len) != 0;) - if (*scan++ == '\0') - return (NULL); - return (scan); -} /* strstr() */ - -#endif /* not __STDC__ */ - -/* end of strstr.c */ diff --git a/gas/xrealloc.c b/gas/xrealloc.c deleted file mode 100644 index a7da9f2fb7..0000000000 --- a/gas/xrealloc.c +++ /dev/null @@ -1,69 +0,0 @@ -/* xrealloc.c - new memory or bust - - Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS is free software; you can 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. - - GAS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - - -/* - - NAME - xrealloc () - get more memory or bust - INDEX - xrealloc () uses realloc () - SYNOPSIS - char *my_memory; - - my_memory = xrealloc (my_memory, 42); - / * my_memory gets (perhaps new) address of 42 chars * / - - DESCRIPTION - - Use xrealloc () as an "error-free" realloc ().It does almost the same - job. When it cannot honour your request for memory it BOMBS your - program with a "virtual memory exceeded" message. Realloc() returns - NULL and does not bomb your program. - - SEE ALSO - realloc () - */ - -#if __STDC__ == 1 -#include -#else -#ifdef USG -#include -#else -char *realloc (); -#endif /* USG */ -#endif /* not __STDC__ */ - -#define error as_fatal - -char * -xrealloc (ptr, n) - register char *ptr; - long n; -{ - void error (); - - if ((ptr = realloc (ptr, (unsigned) n)) == 0) - error ("virtual memory exceeded"); - return (ptr); -} - -/* end of xrealloc.c */ diff --git a/gdb/Makefile b/gdb/Makefile index 1bec69da6d..e69de29bb2 100755 --- a/gdb/Makefile +++ b/gdb/Makefile @@ -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 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 >alldeps.mak; - sort >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 - $(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 94040a59fc..0000000000 --- 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 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 >alldeps.mak; - sort >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 - $(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.sdir b/gdb/Makefile.sdir deleted file mode 100755 index b5fb6b3f64..0000000000 --- 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 b5fb6b3f64..0000000000 --- a/gdb/Makefile.srcdir +++ /dev/null @@ -1 +0,0 @@ -srcdir=. diff --git a/gdb/WHATS.NEW b/gdb/WHATS.NEW deleted file mode 100755 index c1899655d4..0000000000 --- a/gdb/WHATS.NEW +++ /dev/null @@ -1,596 +0,0 @@ - What has changed since GDB-3.5? - (Organized release by release) - -*** Changes in GDB-4.6: - - * Better support for C++ function names - -GDB now accepts as input the "demangled form" of C++ overloaded function -names and member function names, and can do command completion on such names -(using TAB, TAB-TAB, and ESC-?). The names have to be quoted with a pair of -single quotes. Examples are 'func (int, long)' and 'obj::operator==(obj&)'. -Make use of command completion, it is your friend. - -GDB also now accepts a variety of C++ mangled symbol formats. They are -the GNU g++ style, the Cfront (ARM) style, and the Lucid (lcc) style. -You can tell GDB which format to use by doing a 'set demangle-style {gnu, -lucid, cfront, auto}'. 'gnu' is the default. Do a 'set demangle-style foo' -for the list of formats. - - * G++ symbol mangling problem - -Recent versions of gcc have a bug in how they emit debugging information for -C++ methods (when using dbx-style stabs). The file 'gcc.patch' (in this -directory) can be applied to gcc to fix the problem. Alternatively, if you -can't fix gcc, you can #define GCC_MANGLE_BUG when compling gdb/symtab.c. The -usual symptom is difficulty with setting breakpoints on methods. GDB complains -about the method being non-existent. (We believe that version 2.2.2 of GCC has -this problem.) - - * New 'maintenance' command - -All of the commands related to hacking GDB internals have been moved out of -the main command set, and now live behind the 'maintenance' command. This -can also be abbreviated as 'mt'. The following changes were made: - - dump-me -> maintenance dump-me - info all-breakpoints -> maintenance info breakpoints - printmsyms -> maintenance print msyms - printobjfiles -> maintenance print objfiles - printpsyms -> maintenance print psymbols - printsyms -> maintenance print symbols - -The following commands are new: - - maintenance demangle Call internal GDB demangler routine to - demangle a C++ link name and prints the result. - maintenance print type Print a type chain for a given symbol - - * Change to .gdbinit file processing - -We now read the $HOME/.gdbinit file before processing the argv arguments -(e.g. reading symbol files or core files). This allows global parameters to -be set, which will apply during the symbol reading. The ./.gdbinit is still -read after argv processing. - - * New hosts supported - -Solaris-2.0 !!! sparc-sun-solaris2 or sun4sol2 - -Linux support i386-unknown-linux or linux - -We are also including code to support the HP/PA running BSD and HPUX. This -is almost guaranteed not to work, as we didn't have time to test or build it -for this release. We are including it so that the more adventurous (or -masochistic) of you can play with it. We also had major problems with the -fact that the compiler that we got from HP doesn't support the -g option. -It costs extra. - - * New targets supported - -Hitachi H8/300 h8300-hitachi-hms or h8300hms - - * More smarts about finding #include files - -GDB now remembers the compilation directory for all include files, and for -all files from which C is generated (like yacc and lex sources). This -greatly improves GDB's ability to find yacc/lex sources, and include files, -especially if you are debugging your program from a directory different from -the one that contains your sources. - -We also fixed a bug which caused difficulty with listing and setting -breakpoints in include files which contain C code. (In the past, you had to -try twice in order to list an include file that you hadn't looked at before.) - - * Interesting infernals change - -GDB now deals with arbitrary numbers of sections, where the symbols for each -section must be relocated relative to that section's landing place in the -target's address space. This work was needed to support ELF with embedded -stabs used by Solaris-2.0. - - * Bug fixes (of course!) - -There have been loads of fixes for the following things: - mips, rs6000, 29k/udi, m68k, g++, type handling, elf/dwarf, m88k, - i960, stabs, DOS(GO32), procfs, etc... - -See the ChangeLog for details. - -*** Changes in GDB-4.5: - - * New machines supported (host and target) - -IBM RS6000 running AIX rs6000-ibm-aix or rs6000 - -SGI Irix-4.x mips-sgi-irix4 or iris4 - - * New malloc package - -GDB now uses a new memory manager called mmalloc, based on gmalloc. -Mmalloc is capable of handling mutiple heaps of memory. It is also -capable of saving a heap to a file, and then mapping it back in later. -This can be used to greatly speedup the startup of GDB by using a -pre-parsed symbol table which lives in a mmalloc managed heap. For -more details, please read mmalloc/mmalloc.texi. - - * info proc - -The 'info proc' command (SVR4 only) has been enhanced quite a bit. See -'help info proc' for details. - - * MIPS ecoff symbol table format - -The code that reads MIPS symbol table format is now supported on all hosts. -Thanks to MIPS for releasing the sym.h and symconst.h files to make this -possible. - - * File name changes for MS-DOS - -Many files in the config directories have been renamed to make it easier to -support GDB on MS-DOSe systems (which have very restrictive file name -conventions :-( ). MS-DOSe host support (under DJ Delorie's GO32 -environment) is close to working but has some remaining problems. Note -that debugging of DOS programs is not supported, due to limitations -in the ``operating system'', but it can be used to host cross-debugging. - - * Cross byte order fixes - -Many fixes have been made to support cross debugging of Sparc and MIPS -targets from hosts whose byte order differs. - - * New -mapped and -readnow options - -If memory-mapped files are available on your system through the 'mmap' -system call, you can use the -mapped option on the `file' or -`symbol-file' commands to cause GDB to write the symbols from your -program into a reusable file. If the program you are debugging is -called `/path/fred', the mapped symbol file will be `./fred.syms'. -Future GDB debugging sessions will notice the presence of this file, -and will quickly map in symbol information from it, rather than reading -the symbol table from the executable program. Using the '-mapped' -option in a GDB `file' or `symbol-file' command has the same effect as -starting GDB with the '-mapped' command-line option. - -You can cause GDB to read the entire symbol table immediately by using -the '-readnow' option with any of the commands that load symbol table -information (or on the GDB command line). This makes the command -slower, but makes future operations faster. - -The -mapped and -readnow options are typically combined in order to -build a `fred.syms' file that contains complete symbol information. -A simple GDB invocation to do nothing but build a `.syms' file for future -use is: - - gdb -batch -nx -mapped -readnow programname - -The `.syms' file is specific to the host machine on which GDB is run. -It holds an exact image of GDB's internal symbol table. It cannot be -shared across multiple host platforms. - - * longjmp() handling - -GDB is now capable of stepping and nexting over longjmp(), _longjmp(), and -siglongjmp() without losing control. This feature has not yet been ported to -all systems. It currently works on many 386 platforms, all MIPS-based -platforms (SGI, DECstation, etc), and Sun3/4. - - * Solaris 2.0 - -Preliminary work has been put in to support the new Solaris OS from Sun. At -this time, it can control and debug processes, but it is not capable of -reading symbols. - - * Bug fixes - -As always, many many bug fixes. The major areas were with g++, and mipsread. -People using the MIPS-based platforms should experience fewer mysterious -crashes and trashed symbol tables. - -*** Changes in GDB-4.4: - - * New machines supported (host and target) - -SCO Unix on i386 IBM PC clones i386-sco-sysv or i386sco - (except core files) -BSD Reno on Vax vax-dec-bsd -Ultrix on Vax vax-dec-ultrix - - * New machines supported (target) - -AMD 29000 embedded, using EBMON a29k-none-none - - * C++ support - -GDB continues to improve its handling of C++. `References' work better. -The demangler has also been improved, and now deals with symbols mangled as -per the Annotated C++ Reference Guide. - -GDB also now handles `stabs' symbol information embedded in MIPS -`ecoff' symbol tables. Since the ecoff format was not easily -extensible to handle new languages such as C++, this appeared to be a -good way to put C++ debugging info into MIPS binaries. This option -will be supported in the GNU C compiler, version 2, when it is -released. - - * New features for SVR4 - -GDB now handles SVR4 shared libraries, in the same fashion as SunOS -shared libraries. Debugging dynamically linked programs should present -only minor differences from debugging statically linked programs. - -The `info proc' command will print out information about any process -on an SVR4 system (including the one you are debugging). At the moment, -it prints the address mappings of the process. - -If you bring up GDB on another SVR4 system, please send mail to -bug-gdb@prep.ai.mit.edu to let us know what changes were reqired (if any). - - * Better dynamic linking support in SunOS - -Reading symbols from shared libraries which contain debugging symbols -now works properly. However, there remain issues such as automatic -skipping of `transfer vector' code during function calls, which -make it harder to debug code in a shared library, than to debug the -same code linked statically. - - * New Getopt - -GDB is now using the latest `getopt' routines from the FSF. This -version accepts the -- prefix for options with long names. GDB will -continue to accept the old forms (-option and +option) as well. -Various single letter abbreviations for options have been explicity -added to the option table so that they won't get overshadowed in the -future by other options that begin with the same letter. - - * Bugs fixed - -The `cleanup_undefined_types' bug that many of you noticed has been squashed. -Many assorted bugs have been handled. Many more remain to be handled. -See the various ChangeLog files (primarily in gdb and bfd) for details. - - -*** Changes in GDB-4.3: - - * New machines supported (host and target) - -Amiga 3000 running Amix m68k-cbm-svr4 or amix -NCR 3000 386 running SVR4 i386-ncr-svr4 or ncr3000 -Motorola Delta 88000 running Sys V m88k-motorola-sysv or delta88 - - * Almost SCO Unix support - -We had hoped to support: -SCO Unix on i386 IBM PC clones i386-sco-sysv or i386sco -(except for core file support), but we discovered very late in the release -that it has problems with process groups that render gdb unusable. Sorry -about that. I encourage people to fix it and post the fixes. - - * Preliminary ELF and DWARF support - -GDB can read ELF object files on System V Release 4, and can handle -debugging records for C, in DWARF format, in ELF files. This support -is preliminary. If you bring up GDB on another SVR4 system, please -send mail to bug-gdb@prep.ai.mit.edu to let us know what changes were -reqired (if any). - - * New Readline - -GDB now uses the latest `readline' library. One user-visible change -is that two tabs will list possible command completions, which previously -required typing M-? (meta-question mark, or ESC ?). - - * Bugs fixed - -The `stepi' bug that many of you noticed has been squashed. -Many bugs in C++ have been handled. Many more remain to be handled. -See the various ChangeLog files (primarily in gdb and bfd) for details. - - * State of the MIPS world (in case you wondered): - -GDB can understand the symbol tables emitted by the compilers -supplied by most vendors of MIPS-based machines, including DEC. These -symbol tables are in a format that essentially nobody else uses. - -Some versions of gcc come with an assembler post-processor called -mips-tfile. This program is required if you want to do source-level -debugging of gcc-compiled programs. I believe FSF does not ship -mips-tfile with gcc version 1, but it will eventually come with gcc -version 2. - -Debugging of g++ output remains a problem. g++ version 1.xx does not -really support it at all. (If you're lucky, you should be able to get -line numbers and stack traces to work, but no parameters or local -variables.) With some work it should be possible to improve the -situation somewhat. - -When gcc version 2 is released, you will have somewhat better luck. -However, even then you will get confusing results for inheritance and -methods. - -We will eventually provide full debugging of g++ output on -DECstations. This will probably involve some kind of stabs-in-ecoff -encapulation, but the details have not been worked out yet. - - -*** 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/a68v-xdep.c b/gdb/a68v-xdep.c index d81cbe813c..e69de29bb2 100644 --- a/gdb/a68v-xdep.c +++ b/gdb/a68v-xdep.c @@ -1,158 +0,0 @@ -/* Host-dependent code for Apollo-68ksfor GDB, the GNU debugger. - Copyright 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 "defs.h" -#include "inferior.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, - (PTRACE_ARG3_TYPE) &inferior_registers, 0); -#ifdef FP0_REGNUM - ptrace (PTRACE_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); -#endif - - bcopy (&inferior_registers, registers, 16 * 4); -#ifdef FP0_REGNUM - bcopy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fps_regs); -#endif - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; -#ifdef FP0_REGNUM - bcopy (&inferior_fp_registers.fps_control, - ®isters[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). */ - -void -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 (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof inferior_fp_registers.fps_regs); -#endif - inferior_registers.r_ps = *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; - -#ifdef FP0_REGNUM - bcopy (®isters[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, - (PTRACE_ARG3_TYPE) &inferior_registers, 0); -#if FP0_REGNUM - ptrace (PTRACE_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); -#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, ®s->r_ps); - supply_register (PC_REGNUM, ®s->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, - ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof fpustruct->f_fpstatus.fps_regs); - bcopy (&fpustruct->f_fpstatus.fps_control, - ®isters[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 */ -void -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/ansidecl.h b/gdb/ansidecl.h deleted file mode 100755 index aecdb5eeef..0000000000 --- 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-opcode.h b/gdb/arm-opcode.h deleted file mode 100755 index d27a54e48a..0000000000 --- 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 : - - %% % - %d print the bitfield in decimal - %x print the bitfield in hex - %r print as an ARM register - %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 - %'c print specified char iff bit is one - %`c print specified char iff bit is zero - %?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/cadillac-patches b/gdb/cadillac-patches index 74fff63424..e69de29bb2 100755 --- a/gdb/cadillac-patches +++ b/gdb/cadillac-patches @@ -1,1021 +0,0 @@ -# Apply these patches to GDB to produce an Energize GDB. -# To apply these patches, first cd to gdb-XX/gdb, run "patch -p0 cond_string = NULL; - if (from_tty) - printf_filtered ("Breakpoint %d now unconditional.\n", bnum); -+ if (cadillac) -+ cadillac_condition_breakpoint(b); - } - else - { -*************** -*** 281,286 **** ---- 283,290 ---- - 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 (cadillac) -+ cadillac_condition_breakpoint(b); - if (*arg) - error ("Junk at end of expression"); - } -*************** -*** 316,330 **** - ALL_BREAKPOINTS (b) - if (b->number == bnum) - { -! if (from_tty && input_from_terminal_p ()) -! { -! printf_filtered ("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); ---- 320,333 ---- - ALL_BREAKPOINTS (b) - if (b->number == bnum) - { -! if ((from_tty && input_from_terminal_p ()) || cadillac) -! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\ - End with a line saying just \"end\".\n", bnum); - l = read_command_lines (); - free_command_lines (&b->commands); - b->commands = l; -+ if (cadillac) -+ cadillac_commands_breakpoint(b); - return; - } - error ("No breakpoint number %d.", bnum); -*************** -*** 925,930 **** ---- 928,935 ---- - { - b->ignore_count--; - this_bp_stop = 0; -+ if (cadillac) -+ cadillac_ignore_breakpoint(b); - } - else - { -*************** -*** 1365,1370 **** ---- 1370,1378 ---- - mention (b) - struct breakpoint *b; - { -+ if (cadillac) -+ cadillac_create_breakpoint(b); -+ - switch (b->type) - { - case bp_watchpoint: -*************** -*** 2106,2111 **** ---- 2114,2122 ---- - register struct breakpoint *b; - register bpstat bs; - -+ if (cadillac) -+ cadillac_delete_breakpoint(bpt); -+ - if (bpt->inserted) - target_remove_breakpoint(bpt->address, bpt->shadow_contents); - -*************** -*** 2277,2282 **** ---- 2288,2295 ---- - if (b->number == bptnum) - { - b->ignore_count = count; -+ if (cadillac) -+ cadillac_ignore_breakpoint(b); - if (!from_tty) - return; - else if (count == 0) -*************** -*** 2301,2307 **** - struct breakpoint *b; - - ALL_BREAKPOINTS (b) -! b->ignore_count = 0; - } - - /* Command to set ignore-count of breakpoint N to COUNT. */ ---- 2314,2324 ---- - struct breakpoint *b; - - ALL_BREAKPOINTS (b) -! { -! b->ignore_count = 0; -! if (cadillac) -! cadillac_ignore_breakpoint(b); -! } - } - - /* Command to set ignore-count of breakpoint N to COUNT. */ -*************** -*** 2368,2373 **** ---- 2385,2393 ---- - { - bpt->enable = enabled; - -+ if (cadillac) -+ cadillac_enable_breakpoint(bpt); -+ - if (xgdb_verbose && bpt->type == bp_breakpoint) - printf ("breakpoint #%d enabled\n", bpt->number); - -*************** -*** 2415,2420 **** ---- 2435,2443 ---- - disable_breakpoint (bpt) - struct breakpoint *bpt; - { -+ if (cadillac) -+ cadillac_disable_breakpoint(bpt); -+ - bpt->enable = disabled; - - if (xgdb_verbose && bpt->type == bp_breakpoint) -diff -rc command.c command.c -*** command.c Mon Jun 22 20:33:41 1992 ---- command.c Sat Jun 27 12:30:01 1992 -*************** -*** 1149,1155 **** - } - - if (pid != -1) -! while ((rc = wait (&status)) != pid && rc != -1) - ; - else - error ("Fork failed"); ---- 1149,1155 ---- - } - - if (pid != -1) -! while ((rc = cadillac ? cadillac_wait(&status) : wait (&status)) != pid && rc != -1) - ; - else - error ("Fork failed"); -diff -rc config/amix.mh config/amix.mh -*** config/amix.mh Tue Jun 9 19:05:16 1992 ---- config/amix.mh Sat Jun 27 12:31:29 1992 -*************** -*** 22,24 **** ---- 22,31 ---- - - # SVR4 puts the BSD compatible install in /usr/ucb. - INSTALL = /usr/ucb/install -c -+ -+ # These are the libs that are needed for the Cadillac version of gdb on -+ # SVR4. Note that we MUST include the standard C library before libucb.a, -+ # otherwise we get lots of broken stuff we don't want. -+ CONNECTION_LIB = deblib/connection/libconn.a -+ CADILLAC_LIBS = ${CONNECTION_LIB} -L/usr/lib -lm -lnet -lresolv -lform \ -+ -lsocket -lc /usr/ucblib/libucb.a -lnsl -diff -rc config/ncr3000.mh config/ncr3000.mh -*** config/ncr3000.mh Mon Jun 15 12:25:13 1992 ---- config/ncr3000.mh Sat Jun 27 12:31:30 1992 -*************** -*** 38,40 **** ---- 38,47 ---- - # The /usr/ucb/install program is incompatible (complains about unknown - # group staff). Use good old cp... - INSTALL = cp -+ -+ # These are the libs that are needed for the Cadillac version of gdb on -+ # SVR4. Note that we MUST include the standard C library before libucb.a, -+ # otherwise we get lots of broken stuff we don't want. -+ CONNECTION_LIB = deblib/connection/libconn.a -+ CADILLAC_LIBS = ${CONNECTION_LIB} -L/usr/lib -lm -lnet -lresolv -lform \ -+ -lsocket -lc /usr/ucblib/libucb.a -lnsl -diff -rc configure.in configure.in -*** configure.in Mon Jun 22 17:25:00 1992 ---- configure.in Sat Jun 27 12:31:29 1992 -*************** -*** 1,4 **** -! configdirs="doc" - srcname="GDB" - srctrigger=main.c - target_dependent=true ---- 1,4 ---- -! configdirs="deblib doc" - srcname="GDB" - srctrigger=main.c - target_dependent=true -diff -rc defs.h defs.h -*** defs.h Thu Jun 25 04:50:31 1992 ---- defs.h Sat Jun 27 12:30:02 1992 -*************** -*** 770,773 **** ---- 770,842 ---- - extern CORE_ADDR - push_word (); - -+ /* Energize/Cadillac stuff */ -+ -+ /* Non-zero means that we're doing the cadillac interface. */ -+ extern int cadillac; -+ -+ /* Get a pty for use with cadillac */ -+ extern char *cadillac_getpty PARAMS ((void)); -+ -+ /* Notify cadillac of new process creation */ -+ extern void cadillac_new_process PARAMS ((void)); -+ -+ /* Low level wait routine for wait_for_inferior */ -+ extern int cadillac_wait PARAMS ((int *)); -+ -+ /* Initialize */ -+ extern void cadillac_initialize PARAMS ((char *, char *)); -+ -+ /* Main loop for cadillac protocol driver */ -+ extern void cadillac_main_loop PARAMS ((void)); -+ -+ struct cmd_list_element; -+ -+ /* Command hook for cadillac */ -+ extern void cadillac_call_command PARAMS ((struct cmd_list_element *, -+ char *, int)); -+ -+ /* Read commands for the command command, and others */ -+ extern char *cadillac_command_line_input PARAMS ((void)); -+ -+ struct symbol; -+ struct type; -+ -+ extern void cadillac_start_variable_annotation PARAMS ((char *, -+ struct symbol *, -+ struct type *, -+ CORE_ADDR, -+ char *)); -+ -+ extern void cadillac_end_variable_annotation PARAMS ((void)); -+ -+ extern void cadillac_annotate_function PARAMS ((char *, int, int)); -+ -+ struct objfile; -+ extern void cadillac_symbol_file PARAMS ((struct objfile *)); -+ -+ /*extern void cadillac_query PARAMS ((char *, ...));*/ -+ extern void cadillac_query (); /* Prototypes for varargs don't work */ -+ -+ extern char *cadillac_command_line_input PARAMS ((void)); -+ -+ extern void cadillac_acknowledge_query PARAMS ((char *)); -+ -+ extern void cadillac_fputs PARAMS ((const char *)); -+ -+ struct breakpoint; -+ extern void cadillac_condition_breakpoint PARAMS ((struct breakpoint *)); -+ -+ extern void cadillac_commands_breakpoint PARAMS ((struct breakpoint *)); -+ -+ extern void cadillac_ignore_breakpoint PARAMS ((struct breakpoint *)); -+ -+ extern void cadillac_create_breakpoint PARAMS ((struct breakpoint *)); -+ -+ extern void cadillac_delete_breakpoint PARAMS ((struct breakpoint *)); -+ -+ extern void cadillac_enable_breakpoint PARAMS ((struct breakpoint *)); -+ -+ extern void cadillac_disable_breakpoint PARAMS ((struct breakpoint *)); -+ - #endif /* !defined (DEFS_H) */ -diff -rc inflow.c inflow.c -*** inflow.c Tue Jun 23 21:49:19 1992 ---- inflow.c Sat Jun 27 12:30:03 1992 -*************** -*** 81,87 **** - static short pgrp_inferior; - static short pgrp_ours; - # else /* not def SHORT_PGRP */ -! static int pgrp_inferior; - static int pgrp_ours; - # endif /* not def SHORT_PGRP */ - #else /* not def TIOCGPGRP */ ---- 81,87 ---- - static short pgrp_inferior; - static short pgrp_ours; - # else /* not def SHORT_PGRP */ -! int pgrp_inferior; - static int pgrp_ours; - # endif /* not def SHORT_PGRP */ - #else /* not def TIOCGPGRP */ -diff -rc infrun.c infrun.c -*** infrun.c Tue Jun 23 21:49:22 1992 ---- infrun.c Sat Jun 27 12:30:04 1992 -*************** -*** 617,622 **** ---- 617,624 ---- - Here we must get it up to actual execution of the real program. */ - - inferior_pid = pid; /* Needed for wait_for_inferior stuff below */ -+ if (cadillac) -+ cadillac_new_process(); - - clear_proceed_status (); - -*************** -*** 755,760 **** ---- 757,764 ---- - - attach (pid); - inferior_pid = pid; -+ if (cadillac) -+ cadillac_new_process(); - push_target (&child_ops); - - mark_breakpoints_out (); -diff -rc inftarg.c inftarg.c -*** inftarg.c Sun Mar 29 15:21:27 1992 ---- inftarg.c Sat Jun 27 12:30:04 1992 -*************** -*** 58,64 **** - #ifdef USE_PROC_FS - pid = proc_wait (status); - #else -! pid = wait (status); - #endif - if (pid == -1) /* No more children to wait for */ - { ---- 58,67 ---- - #ifdef USE_PROC_FS - pid = proc_wait (status); - #else -! if (cadillac) -! pid = cadillac_wait (status); -! else -! pid = wait (status); - #endif - if (pid == -1) /* No more children to wait for */ - { -diff -rc main.c main.c -*** main.c Mon Jun 8 23:09:23 1992 ---- main.c Sat Jun 27 12:30:05 1992 -*************** -*** 397,402 **** ---- 397,403 ---- - char *corearg = NULL; - char *cdarg = NULL; - char *ttyarg = NULL; -+ char *cadillac_id = NULL; - - /* Pointers to all arguments of +command option. */ - char **cmdarg; -*************** -*** 492,497 **** ---- 493,499 ---- - {"tty", required_argument, 0, 't'}, - {"baud", required_argument, 0, 'b'}, - {"b", required_argument, 0, 'b'}, -+ {"context", required_argument, 0, 12}, - /* Allow machine descriptions to add more options... */ - #ifdef ADDITIONAL_OPTIONS - ADDITIONAL_OPTIONS -*************** -*** 524,529 **** ---- 526,534 ---- - case 11: - cdarg = optarg; - break; -+ case 12: -+ cadillac_id = optarg; -+ break; - case 's': - symarg = optarg; - break; -*************** -*** 670,675 **** ---- 675,683 ---- - free ((PTR)dirarg); - do_cleanups (ALL_CLEANUPS); - -+ if (cadillac_id) -+ cadillac_initialize (cadillac_id, execarg); -+ - if (execarg != NULL - && symarg != NULL - && strcmp (execarg, symarg) == 0) -*************** -*** 691,696 **** ---- 699,705 ---- - 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 -*************** -*** 818,824 **** - if (!setjmp (to_top_level)) - { - do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */ -! command_loop (); - quit_command ((char *)0, instream == stdin); - } - } ---- 827,836 ---- - if (!setjmp (to_top_level)) - { - do_cleanups (ALL_CLEANUPS); /* Do complete cleanup */ -! if (cadillac_id) -! cadillac_main_loop(); -! else -! command_loop (); - quit_command ((char *)0, instream == stdin); - } - } -*************** -*** 880,886 **** - else if (c->function.cfunc == NO_FUNCTION) - error ("That is not a command, just a help topic."); - else -! (*c->function.cfunc) (arg, from_tty & caution); - } - - /* Tell the user if the language has changed (except first time). */ ---- 892,901 ---- - else if (c->function.cfunc == NO_FUNCTION) - error ("That is not a command, just a help topic."); - else -! if (cadillac) -! cadillac_call_command (c, arg, from_tty & caution); -! else -! (*c->function.cfunc) (arg, from_tty & caution); - } - - /* Tell the user if the language has changed (except first time). */ -*************** -*** 1516,1522 **** - while (1) - { - dont_repeat (); -! p = command_line_input ((char *) NULL, instream == stdin); - if (p == NULL) - /* Treat end of file like "end". */ - break; ---- 1531,1540 ---- - while (1) - { - dont_repeat (); -! if (cadillac) -! p = cadillac_command_line_input(); -! else -! p = command_line_input ((char *) NULL, instream == stdin); - if (p == NULL) - /* Treat end of file like "end". */ - break; -*************** -*** 1820,1826 **** - void - print_prompt () - { -! printf ("%s", prompt); - fflush (stdout); - } - ---- 1838,1844 ---- - void - print_prompt () - { -! printf_filtered ("%s", prompt); - fflush (stdout); - } - -diff -rc printcmd.c printcmd.c -*** printcmd.c Thu Jun 25 03:58:47 1992 ---- printcmd.c Sat Jun 27 12:30:05 1992 -*************** -*** 778,783 **** ---- 778,792 ---- - { - int histindex = record_latest_value (val); - -+ if (cadillac) -+ { -+ char buf[20]; -+ -+ sprintf(buf, "$%d", histindex); -+ cadillac_start_variable_annotation(buf, NULL, VALUE_TYPE(val), -+ VALUE_ADDRESS(val), ""); -+ } -+ - if (inspect) - printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex); - else -*************** -*** 784,789 **** ---- 793,800 ---- - if (histindex >= 0) printf_filtered ("$%d = ", histindex); - - print_formatted (val, format, fmt.size); -+ if (cadillac) -+ cadillac_end_variable_annotation(); - printf_filtered ("\n"); - if (inspect) - printf("\") )\030"); -*************** -*** 1610,1620 **** ---- 1621,1641 ---- - standard indentation here is 4 spaces, and val_print indents - 2 for each recurse. */ - val = read_var_value (sym, FRAME_INFO_ID (fi)); -+ -+ if (cadillac) -+ cadillac_start_variable_annotation(SYMBOL_NAME(sym), sym, -+ VALUE_TYPE(val), -+ VALUE_ADDRESS(val), ""); -+ - if (val) - val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val), - stream, 0, 0, 2, Val_no_prettyprint); - else - fputs_filtered ("???", stream); -+ -+ if (cadillac) -+ cadillac_end_variable_annotation(); -+ - first = 0; - } - -diff -rc stack.c stack.c -*** stack.c Sat Jun 20 16:30:33 1992 ---- stack.c Sat Jun 27 12:30:06 1992 -*************** -*** 159,165 **** - if (addressprint) - printf_filtered ("%s in ", local_hex_string(fi->pc)); - -! fputs_demangled (fname, stdout, 0); - fputs_filtered (" (...)\n", stdout); - - return; ---- 159,168 ---- - if (addressprint) - printf_filtered ("%s in ", local_hex_string(fi->pc)); - -! if (cadillac) -! cadillac_annotate_function(fname, 0, level); -! else -! fputs_demangled (fname, stdout, 0); - fputs_filtered (" (...)\n", stdout); - - return; -*************** -*** 218,224 **** - if (addressprint) - if (fi->pc != sal.pc || !sal.symtab) - printf_filtered ("%s in ", local_hex_string(fi->pc)); -! fputs_demangled (funname ? funname : "??", stdout, 0); - wrap_here (" "); - fputs_filtered (" (", stdout); - if (args) ---- 221,230 ---- - if (addressprint) - if (fi->pc != sal.pc || !sal.symtab) - printf_filtered ("%s in ", local_hex_string(fi->pc)); -! if (cadillac) -! cadillac_annotate_function(funname ? funname : "??", 0, level); -! else -! fputs_demangled (funname ? funname : "??", stdout, 0); - wrap_here (" "); - fputs_filtered (" (", stdout); - if (args) -*************** -*** 255,261 **** - { - 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); - } ---- 261,268 ---- - { - if (addressprint && mid_statement) - printf_filtered ("%s\t", local_hex_string(fi->pc)); -! if (!cadillac) -! print_source_lines (sal.symtab, sal.line, sal.line + 1, 0); - } - current_source_line = max (sal.line - lines_to_list/2, 1); - } -*************** -*** 429,435 **** - if (funname) - { - printf_filtered (" in "); -! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS); - } - wrap_here (" "); - if (sal.symtab) ---- 436,446 ---- - if (funname) - { - printf_filtered (" in "); -! if (cadillac) -! cadillac_annotate_function(funname, DMGL_ANSI | DMGL_PARAMS, -! selected_frame_level); -! else -! fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS); - } - wrap_here (" "); - if (sal.symtab) -diff -rc symfile.c symfile.c -*** symfile.c Sat Jun 13 09:20:12 1992 ---- symfile.c Sat Jun 27 12:30:06 1992 -*************** -*** 555,560 **** ---- 555,563 ---- - fflush (stdout); - } - -+ if (cadillac) -+ cadillac_symbol_file(objfile); -+ - return (objfile); - } - -diff -rc utils.c utils.c -*** utils.c Mon Jun 15 07:27:07 1992 ---- utils.c Sat Jun 27 12:30:07 1992 -*************** -*** 96,101 **** ---- 96,102 ---- - - char *error_pre_print; - char *warning_pre_print = "\nwarning: "; -+ - - /* Add a new cleanup to the cleanup_chain, - and return the previous chain pointer -*************** -*** 694,700 **** - register int ans2; - - /* Automatically answer "yes" if input is not from a terminal. */ -! if (!input_from_terminal_p ()) - return 1; - - while (1) ---- 695,701 ---- - register int ans2; - - /* Automatically answer "yes" if input is not from a terminal. */ -! if (!input_from_terminal_p () && !cadillac) - return 1; - - while (1) -*************** -*** 701,721 **** - { - va_start (args); - ctlstr = va_arg (args, char *); - vfprintf_filtered (stdout, ctlstr, args); -- va_end (args); - printf_filtered ("(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') ---- 702,734 ---- - { - va_start (args); - ctlstr = va_arg (args, char *); -+ if (cadillac) -+ cadillac_query (ctlstr, args); - vfprintf_filtered (stdout, ctlstr, args); - printf_filtered ("(y or n) "); -! if (cadillac) -! { -! char *buf; -! -! buf = cadillac_command_line_input(); -! answer = buf ? *buf : 'Y'; -! cadillac_acknowledge_query(buf); -! } -! else -! { -! 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') -*************** -*** 723,728 **** ---- 736,742 ---- - if (answer == 'N') - return 0; - printf_filtered ("Please answer y or n.\n"); -+ va_end (args); - } - } - -*************** -*** 989,994 **** ---- 1003,1014 ---- - if (linebuffer == 0) - return; - -+ if (cadillac) -+ { -+ cadillac_fputs(linebuffer); -+ return; -+ } -+ - /* Don't do any filtering if it is disabled. */ - if (stream != stdout - || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX)) -diff -rc valprint.c valprint.c -*** valprint.c Tue Jun 23 23:24:51 1992 ---- valprint.c Sat Jun 27 12:30:07 1992 -*************** -*** 485,490 **** ---- 485,491 ---- - struct type **dont_print; - { - int i, len, n_baseclasses; -+ char expr_tag[100]; /* Cadillac */ - - check_stub_type (type); - -*************** -*** 549,554 **** ---- 550,563 ---- - fprint_symbol (stream, TYPE_FIELD_NAME (type, i)); - fputs_filtered (" = ", stream); - } -+ -+ sprintf(expr_tag, ".%s", TYPE_FIELD_NAME(type, i)); -+ -+ if (cadillac) -+ cadillac_start_variable_annotation(expr_tag, NULL, -+ TYPE_FIELD_TYPE(type, i), -+ (CORE_ADDR) (valaddr + TYPE_FIELD_BITPOS(type, i) / 8), -+ ""); - if (TYPE_FIELD_PACKED (type, i)) - { - value v; -*************** -*** 567,572 **** ---- 576,583 ---- - valaddr + TYPE_FIELD_BITPOS (type, i) / 8, - 0, stream, format, 0, recurse + 1, pretty); - } -+ if (cadillac) -+ cadillac_end_variable_annotation(); - } - if (pretty) - { -*************** -*** 801,806 **** ---- 812,818 ---- - unsigned int rep1; - /* Number of repetitions we have detected so far. */ - unsigned int reps; -+ char expr_tag[100]; /* Cadillac */ - - if (i != 0) - if (arrayprint) -*************** -*** 822,827 **** ---- 834,845 ---- - ++rep1; - } - -+ sprintf(expr_tag, "[%d]", i); -+ if (cadillac) -+ cadillac_start_variable_annotation(expr_tag, NULL, -+ elttype, -+ (CORE_ADDR) (valaddr + i * eltlen), -+ ""); - if (reps > REPEAT_COUNT_THRESHOLD) - { - val_print (elttype, valaddr + i * eltlen, -*************** -*** 838,843 **** ---- 856,863 ---- - recurse + 1, pretty); - things_printed++; - } -+ if (cadillac) -+ cadillac_end_variable_annotation(); - } - if (i < len) - fprintf_filtered (stream, "..."); diff --git a/gdb/cadillac.c b/gdb/cadillac.c index 4f59924104..e69de29bb2 100755 --- a/gdb/cadillac.c +++ b/gdb/cadillac.c @@ -1,1474 +0,0 @@ -/* Energize (formerly known as Cadillac) interface routines. - Copyright 1991, 1992 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 "symtab.h" -#include "inferior.h" -#include "command.h" -#include "bfd.h" -#include "symfile.h" -#include "objfiles.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef USG -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -/* Non-zero means that we're doing the cadillac interface. */ -int cadillac = 0; - -/* Connection block for debugger<=>kernel communications. */ -static Connection *conn = 0; - -/* fd for our socket to the kernel. */ -static int kerfd; - -/* The kernel's ID for this instance of the program. */ -static int program_id; - -static int instance_id; - -/* The fd for the pty associated with the inferior. */ -static int inferior_pty = -1; -static int inferior_tty = -1; - -static int has_run = 0; - -extern int pgrp_inferior; - -extern char *source_path; - -char **pprompt; /* Pointer to pointer to prompt */ - -/* Tell cadillac_command_line_input() where to get its text from */ -static int doing_breakcommands_message = 0; - -/* Stash command text here */ -static char *command_line_text = 0; -static int command_line_length = 0; - -/* Flags returned by wait_for_events() */ -#define KERNEL_EVENT 1 -#define PTY_EVENT 2 - - -/* This routine redirects the output of fputs_filtered to the kernel so that - the user can see what's going on in his debugger window. */ - -void -cadillac_fputs(ptr) - const char *ptr; -{ - if (conn) - CVWriteTranscriptInfo (conn, instance_id, (char *)ptr); - else - fputs (ptr, stdout); -} - -void -cadillac_query(query, args) - char *query; - va_list args; -{ - char buf[100]; - - vsprintf(buf, query, args); - - CVWriteQueryInfo(conn, - instance_id, - CQueryConfirm, - qno_unknown, - buf, - ""); /* transcript */ -} - -void -cadillac_acknowledge_query(ack) - char *ack; -{ - CVWriteQueryInfo(conn, - instance_id, - CQueryAcknowleged, - 0, - ack, - ""); /* transcript */ -} - -/* Copy all data from the pty to the kernel. */ - -static void -pty_to_kernel() -{ - CTtyRequest *req; - char buf[1024]; - int cc; - - while (1) - { - cc = read(inferior_pty, buf, sizeof(buf)); - - if (cc == 0 - || (cc < 0 - && errno == EWOULDBLOCK)) - break; - - if (cc < 0) - { - close(inferior_pty); - inferior_pty = -1; - perror("pty read error"); - break; - } - - req = CWriteTtyRequest(conn, TextIORType); - CWriteVstringLen(conn, buf, cc); - CWriteLength(conn); - } - CWriteRequestBuffer(conn); -} - -/* Copy data from the kernel to the pty. */ - -static void -kernel_to_pty(data, len) - char *data; - int len; -{ - int cc; - - cc = write(inferior_pty, data, len); - - if (cc != len) - { - if (cc < 0) - { - close(inferior_pty); - inferior_pty = -1; - perror("pty write error"); - return; - } - printf("Couldn't write all the data to the pty, wanted %d, got %d\n", - len, cc); - } -} - -static char * -full_filename(symtab) - struct symtab *symtab; -{ - int pathlen; - char *filename; - - if (!symtab) - return NULL; - - if (symtab->fullname) - return savestring(symtab->fullname, strlen(symtab->fullname)); - - if (symtab->dirname) - pathlen = strlen(symtab->dirname); - else - pathlen = 0; - if (symtab->filename) - pathlen += strlen(symtab->filename); - - filename = xmalloc(pathlen+1); - - if (symtab->dirname) - strcpy(filename, symtab->dirname); - else - *filename = '\000'; - if (symtab->filename) - strcat(filename, symtab->filename); - - return filename; -} - -/* Tell the cadillac kernel how high the stack is so that frame numbers (which - are relative to the current stack height make sense. - - Calculate the number of frames on the stack, and the number of subroutine - invocations that haven't changed since the last call to this routine. The - second number is calculated by comparing the PCs of the current stack frames - to the PCs of the previous set of stack frames. The screw here is that a - subroutine may call several different procedures, which means that the PC - in its frame changes, even though you are still in the same subroutine. We - resolve this by converting the frames PC into the PC at the start of the - function (for efficiency, this is done only if the simple comparison test - fails). */ - -struct pclist -{ - CORE_ADDR pc; - struct pclist *next; -}; - -/* Non-zero means that Cadillac kernel already knows how high the stack is. */ -static int stack_info_valid = 0; - -static void -send_stack_info() -{ - struct pclist *pclist = 0, *pli, *opli; - static struct pclist *old_pclist; - FRAME frame; - int height, similar; - - if (stack_info_valid) - return; - - height = 0; - similar = 0; - -/* First, calculate the stack height, and build the new pclist */ - - for (frame = get_current_frame(); - frame != 0; - frame = get_prev_frame(frame)) - { - (height)++; - pli = (struct pclist *)xmalloc(sizeof(struct pclist)); - - pli->pc = frame->pc; - pli->next = pclist; - pclist = pli; - } - -/* Now, figure out how much of the stack hasn't changed */ - - for (pli = pclist, opli = old_pclist; - pli != 0 && opli != 0; - pli = pli->next, opli = opli->next, (similar)++) - { - if ((pli->pc != opli->pc) - && (get_pc_function_start(pli->pc) - != get_pc_function_start(opli->pc))) - break; - } - -/* Free up all elements of the old pclist */ - - opli = old_pclist; - - while (opli) - { - pli = opli->next; - free (opli); - opli = pli; - } - - old_pclist = pclist; /* Install the new pclist */ - - CVWriteStackSizeInfo(conn, - instance_id, - height, /* Frame depth */ - CInnerFrameIs0, - similar, /* Frame diff */ - "" /* Transcript */ - ); - - stack_info_valid = 1; -} - -/* Tell the kernel where we are in the program, and what the stack looks like. - */ - -static void -send_status() -{ - static int linecount = 48; - struct symtab_and_line sal; - struct symbol *symbol; - char *funcname, *filename; - static int sent_prog_inst = 0; - - if (!has_run) - return; - - if (inferior_pid == 0) /* target has died */ - { - CVWriteProgramTerminatedInfo(conn, - instance_id, - "" - ); - return; - } - - sal = find_pc_line(stop_pc, 0); - symbol = find_pc_function(stop_pc); - - funcname = symbol ? symbol->name : ""; - filename = full_filename(sal.symtab); - - if (!sent_prog_inst) - { - sent_prog_inst = 1; - CVWriteProgramInstanceInfo(conn, - program_id, - instance_id, - "", /* hostname */ - "", /* arglist */ - "" - ); - } - - send_stack_info(); - - CVWriteStackFrameInfo(conn, - instance_id, - sal.line, - CFileLinePos, - 0, /* XXX - frame # */ - funcname, - filename, - "" /* XXX ? transcript */ - ); - - CVWriteProgramStoppedInfo(conn, - instance_id, - 0, /* XXX - breakpoint # or signal # */ - CDebuggerCommand, - funcname, - "" /* XXX ? transcript */ - ); - - if (filename) - free(filename); -} - -/* Call this to output annotated function names. Names will be demangled if - necessary. arg_mode contains flags that are passed on to cplus_demangle. */ - -void -cadillac_annotate_function(funcname, arg_mode, level) - char *funcname; - int arg_mode; - int level; -{ - extern int demangle; - char *demangled_name = NULL; - - - if (funcname == NULL) - return; - - if (demangle) - { - demangled_name = cplus_demangle(funcname, arg_mode); - - if (demangled_name) - funcname = demangled_name; - } - - send_stack_info(); - - if (level < 0) level = 0; - - CVWriteBackTraceEntryInfo(conn, - instance_id, - level, /* frameNo */ - funcname); - - if (demangled_name) - free(demangled_name); -} - -/* Call this just prior to printing out the name & value of a variable. This - tells the kernel where to annotate the output. */ - -/* The args are: - expression - A text handle on what GDB can use to reference this value. - This can be a symbol name, or a convenience var, etc... - symbol - Used to determine the scope of the data. May be NULL. - type - Determines if we have a pointer ref, and the print name of the type. - Used in ShowValue message. - valaddr - The address in target memory of the data. - field - The field name of the struct or union element being referenced. -*/ - -static char cum_expr[200]; /* Cumulative expression */ -static char *expr_stack[100] = {cum_expr}; /* Pointers to end of expressions */ -static char **last_expr = expr_stack; /* Current expr stack pointer */ - -void -cadillac_start_variable_annotation(expression, symbol, type, valaddr, field) - char *expression; - struct symbol *symbol; - struct type *type; - CORE_ADDR valaddr; - char *field; -{ - int ref_type; - int stor_cl; - enum type_code type_code; - enum address_class sym_class; - char *type_cast; - - send_stack_info(); - - strcpy(*last_expr++, expression); - *last_expr = *(last_expr-1) + strlen(expression); - - switch (TYPE_CODE(type)) - { - case TYPE_CODE_ARRAY: - case TYPE_CODE_STRUCT: - case TYPE_CODE_UNION: - case TYPE_CODE_ENUM: - case TYPE_CODE_INT: - case TYPE_CODE_FLT: - ref_type = CValueValueRef; - break; - case TYPE_CODE_PTR: - ref_type = CValuePointerRef; - break; - default: - ref_type = CValueUndefRef; - break; - } - -/* Make sure that pointer points at something we understand */ - - if (ref_type == CValuePointerRef) - switch (TYPE_CODE(TYPE_TARGET_TYPE(type))) - { - case TYPE_CODE_PTR: - case TYPE_CODE_ARRAY: - case TYPE_CODE_STRUCT: - case TYPE_CODE_UNION: - case TYPE_CODE_ENUM: - case TYPE_CODE_INT: - case TYPE_CODE_FLT: - break; - default: - ref_type = CValueUndefRef; - break; - } - - if (symbol) - { - sym_class = SYMBOL_CLASS(symbol); - - switch (sym_class) - { - case LOC_CONST: - case LOC_CONST_BYTES: - stor_cl = CValueStorStaticConst; - break; - case LOC_STATIC: - stor_cl = CValueStorStaticVar; - break; - case LOC_REGISTER: - case LOC_REGPARM: - stor_cl = CValueStorRegister; - break; - case LOC_ARG: - case LOC_REF_ARG: - case LOC_LOCAL: - case LOC_LOCAL_ARG: - stor_cl = CValueStorLocalVar; - break; - default: - stor_cl = CValueStorUndef; - break; - } - } - else - stor_cl = CValueStorUndef; - - type_cast = TYPE_NAME(type); - - CVWriteValueBeginInfo(conn, - instance_id, - valaddr, - ref_type, - stor_cl, - 0, /* XXX - frameno */ - cum_expr, - field, - type_cast, - ""); /* transcript */ -} - -void -cadillac_end_variable_annotation() -{ - last_expr--; /* Pop the expr stack */ - **last_expr = '\000'; /* Cut off the last part of the expr */ - - CVWriteValueEndInfo(conn, - instance_id, - ""); /* transcript */ -} - -/* Tell the kernel that the target is now running. */ - -static void -go_busy() -{ - CVWriteProgramBusyInfo(conn, - instance_id, - ""); /* XXX ? transcript */ - CWriteRequestBuffer(conn); /* Must take place synchronusly! */ - stack_info_valid = 0; -} - - -void -cadillac_symbol_file(objfile) - struct objfile *objfile; -{ - CVWriteSymbolTableInfo(conn, - objfile->name, - ""); /* Transcript */ -} - -/* execute_command_1(echo, queue, cmd, args) - echo - non-zero means echo the - command. queue - non-zero means don't execute it now, just save it away for - later. cmd - string containing printf control sequences. args - list of - arguments needed by those control sequences. - */ - -/* Linked list of queued up commands */ -static struct command_line *queued_commands = 0; -static struct command_line *last_queued_command = 0; - -/* Call this routine to save a command for later. The command string is - copied into freshly malloc'ed memory. */ - -static void -queue_command(cmd) - char *cmd; -{ - char *buf; - struct command_line *cl; - unsigned long s; - - s = (strlen(cmd) + 1) + 7 & ~(unsigned long)7; - - buf = (char *)xmalloc(s + sizeof(struct command_line)); - cl = (struct command_line *)(buf + s); - cl->next = 0; - cl->line = buf; - - strncpy(cl->line, cmd, s); - - if (queued_commands) - last_queued_command->next = cl; - else - queued_commands = cl; - - last_queued_command = cl; -} - -/* Call this procedure to take a command off of the command queue. It returns - a pointer to a buf which the caller is responsible for freeing. NULL is - returned if there are no commands queued. */ - -static char * -dequeue_command() -{ - struct command_line *cl; - char *cmd; - - cl = queued_commands; - - if (!cl) - return NULL; - - queued_commands = cl->next; - - return cl->line; -} - -static void -execute_command_1(va_alist) - va_dcl -{ - char buf[100]; /* XXX - make buf dynamic! */ - - int echo; - int queue; - char *cmd; - va_list args; - - va_start(args); - - echo = va_arg(args, int); - queue = va_arg(args, int); - cmd = va_arg(args, char *); - - vsprintf(buf, cmd, args); - - if (queue) - queue_command(buf); - else - { - if (echo) - printf_filtered("%s\n", buf); - execute_command(buf, 1); - } - - va_end(args); -} - -#ifdef KERNEL_RECORD -FILE *kerout; - -static int -kernel_record(fd, ptr, num) - int fd, num; - char *ptr; - -{ - fwrite(ptr, num, 1, kerout); - fflush(kerout); - return write(fd, ptr, num); -} -#endif - -void -cadillac_condition_breakpoint(b) - struct breakpoint *b; -{ - CVWriteBreakConditionInfo(conn, - instance_id, - b->number, - b->cond_string ? b->cond_string : "", - "" /* transcript */ - ); -} - -void -cadillac_commands_breakpoint(b) - struct breakpoint *b; -{ - struct command_line *l; - - CVWriteBreakCommandBegInfo(conn, - instance_id, - b->number, - ""); /* transcript */ - - for (l = b->commands; l; l = l->next) - CVWriteBreakCommandEntryInfo(conn, - instance_id, - l->line, - ""); /* transcript */ - - CVWriteBreakCommandEndInfo(conn, - instance_id, - ""); /* transcript */ -} - -static void -breakpoint_notify(b, action) - struct breakpoint *b; - int action; -{ - struct symbol *sym; - char *funcname = ""; - char *filename; - char *included_in_filename = ""; - - if (b->type != bp_breakpoint) - return; - - filename = full_filename(b->symtab); - - sym = find_pc_function(b->address); - if (sym) - funcname = SYMBOL_NAME(sym); - - CVWriteBreakpointInfo (conn, - instance_id, - b->number, - b->line_number, - CFileLinePos, - CBreakOnInstrAccess, - action, - b->ignore_count, - funcname, - filename ? filename : "", - "", /* included_in_filename */ - "" /* transcript */ - ); - - if (b->commands) - cadillac_commands_breakpoint(b); - - cadillac_condition_breakpoint(b); - - if (filename) - free(filename); -} - -void -cadillac_create_breakpoint(b) - struct breakpoint *b; -{ - breakpoint_notify(b, CEnableBreakpoint); -} - -void -cadillac_delete_breakpoint(b) - struct breakpoint *b; -{ - breakpoint_notify(b, CDeleteBreakpoint); -} - -void -cadillac_enable_breakpoint(b) - struct breakpoint *b; -{ - breakpoint_notify(b, CEnableBreakpoint); -} - -void -cadillac_disable_breakpoint(b) - struct breakpoint *b; -{ - breakpoint_notify(b, CDisableBreakpoint); -} - -void -cadillac_ignore_breakpoint(b) - struct breakpoint *b; -{ - breakpoint_notify(b, CBreakAttrUnchanged); -} - -/* Open up a pty and its associated tty. Return the fd of the tty. */ - -static void -getpty() -{ - int n, ptyfd, ttyfd; - static char dev[30]; - struct stat statbuf; - struct termios termios; - -#define HIGHPTY (('z' - 'p') * 16 - 1) - - for (n = 0; n <= HIGHPTY; n++) - { - sprintf(dev, "/dev/pty%c%x", n/16 + 'p', n%16); - if (stat(dev, &statbuf)) - break; - ptyfd = open(dev, O_RDWR); - if (ptyfd < 0) - continue; - sprintf(dev, "/dev/tty%c%x", n/16 + 'p', n%16); - ttyfd = open(dev, O_RDWR); - if (ttyfd < 0) {close(ptyfd); continue;} - - /* Setup pty for non-blocking I/O. Also make it give us a SIGIO when - there's data available. */ - - n = fcntl(ptyfd, F_GETFL, 0); - fcntl(ptyfd, F_SETFL, n|FNDELAY|FASYNC); - fcntl(ptyfd, F_SETOWN, getpid()); - - tcgetattr(ttyfd, &termios); - termios.c_oflag &= ~OPOST; /* No post-processing */ - tcsetattr(ttyfd, TCSANOW, &termios); - - inferior_pty = ptyfd; - inferior_tty = ttyfd; - return; - } - - error ("getpty: can't get a pty\n"); -} - -/* Examine a protocol packet from the driver. */ - -static void -kernel_dispatch(queue) - int queue; /* Non-zero means we should just queue up - commands. */ -{ - register CHeader *head; - - head = (CHeader *)CPeekNextRequest (conn); - if (head == NULL) - { - fprintf (stderr, "EOF on kernel read!\n"); - exit (1); - } - - if (head->reqType < LastTtyRequestRType) - { - CTtyRequest* req = CReadTtyRequest (conn); - switch (req->head.reqType) - { - case AcceptConnectionRType: - /* Tell the rest of the world that cadillac is now set up */ - CSkipRequest (conn); - break; - - case RefuseConnectionRType: - fprintf (stderr, "Debugger connection refused\n"); - exit (1); - - case KillProgramRType: - exit (0); - - case TextIORType: - { - char *p; - ReqLen len; - - p = CGetVstring(conn, &len); - kernel_to_pty(p, len); - } - break; - default: - fprintf(stderr, "Unknown request type = %d\n", - req->head.reqType); - break; - } - } - else - { - CVDebuggerRequest *req = CVReadDebuggerRequest (conn); - if (!req) - { - fprintf (stderr, "CVReadDebuggerRequest returned NULL, type = %d\n", - head->reqType); - exit(1); - } - - switch (req->head.request->reqType) - { - case OpenProgramInstanceRType: - { - char *arglist, buf[100]; /* XXX - Make buf dynamic! */ - int arglen; - /* XXX - should notice when program_id changes */ - arglist = req->openProgramInstance.progArglist.text; - arglen = req->openProgramInstance.progArglist.byteLen; - - execute_command_1(1, queue, "break main"); - execute_command_1(1, queue, "enable delete $bpnum"); - if (arglist) - { - execute_command_1(1, queue, "set args %.*s", arglen, arglist); - } - execute_command_1(1, queue, "run"); - } - break; - case SearchPathRType: - directory_command(req->searchPath.searchPath.text, 0); - break; - case QuitDebuggerRType: - execute_command_1(1, queue, "quit"); - break; - case RunRType: - if (req->run.request->useArglist == CNewArglist) - { - execute_command_1(1, queue, "set args %.*s", - req->run.progArglist.byteLen, - req->run.progArglist.text); - } - execute_command_1(1, queue, "run"); - break; - case ContinueRType: - execute_command_1(1, queue, "continue"); - break; - case StepRType: - execute_command_1(1, queue, "step %d", req->step.request->stepCount); - break; - case NextRType: - execute_command_1(1, queue, "next %d", req->next.request->nextCount); - break; - case ChangeStackFrameRType: - switch (req->changeStackFrame.request->frameMovement) - { - case CToCurrentStackFrame: - execute_command_1(1, queue, "frame %d", - req->changeStackFrame.request->frameNo); - break; - case CToInnerStackFrame: - execute_command_1(1, queue, "down %d", - req->changeStackFrame.request->frameNo); - break; - case CToOuterStackFrame: - execute_command_1(1, queue, "up %d", - req->changeStackFrame.request->frameNo); - break; - case CToAbsoluteStackFrame: - execute_command_1(1, queue, "frame %d", - req->changeStackFrame.request->frameNo); - break; - } - break; - case BackTraceRType: - /* XXX - deal with limit??? */ - execute_command_1(1, queue, "backtrace"); - break; - case FinishRType: - execute_command_1(1, queue, "finish"); - break; - case TerminateProgramRType: - execute_command_1(1, queue, "kill"); - break; - case NewBreakpointRType: - { - char *tail; - int skipped; - - tail = strrchr(req->newBreakpoint.fileName.text, '/'); - if (!tail) - tail = req->newBreakpoint.fileName.text; - else - tail++; - skipped = tail - req->newBreakpoint.fileName.text; - execute_command_1(1, queue, "break %.*s:%d", - req->newBreakpoint.fileName.byteLen - skipped, - tail, - req->newBreakpoint.request->fileLinePos); - } - break; - case StopRType: - killpg(pgrp_inferior, SIGINT); - break; - case UserInputRType: - { - char *text; - long len; - - /* XXX - should really break command up into seperate lines - and spoon-feed it to execute_command */ - - text = req->userInput.userInput.text; - len = req->userInput.userInput.byteLen; - - if (text[len-1] == '\n') text[len-1] = '\000'; - - while (*text == ' ' || *text == '\t') text++; - - if (strcmp(text, "]*[") == 0) /* XXX - What does this mean??? */ - break; - - if (*text != '\000') - execute_command_1(0, queue, "%s", text); - else - print_prompt(); /* User just typed a blank line */ - } - break; - case QueryResponseRType: - { - char *resp; - - if (req->queryResponse.request->response) - resp = "y"; - else - resp = "n"; - execute_command_1(1, 1, resp); - printf_filtered("%s\n", resp); - } - break; - case ChangeBreakpointRType: - switch (req->changeBreakpoint.request->breakpointAttr) - { - case CBreakAttrUnchanged: - execute_command_1(1, queue, "ignore %d %d", - req->changeBreakpoint.request->breakpointId, - req->changeBreakpoint.request->ignoreCount); - break; - case CEnableBreakpoint: - execute_command_1(1, queue, "enable %d", - req->changeBreakpoint.request->breakpointId); - break; - case CDisableBreakpoint: - execute_command_1(1, queue, "disable %d", - req->changeBreakpoint.request->breakpointId); - break; - case CDeleteBreakpoint: - execute_command_1(1, queue, "delete %d", - req->changeBreakpoint.request->breakpointId); - break; - case CEnableDisableBreakpoint: - execute_command_1(1, queue, "enable once %d", - req->changeBreakpoint.request->breakpointId); - break; - case CEnableDeleteBreakpoint: - execute_command_1(1, queue, "enable delete %d", - req->changeBreakpoint.request->breakpointId); - break; - default: - printf_filtered("ChangeBreakpointRType: unknown breakpointAttr\n"); - printf_filtered(" breakpointAttr = %d\n", - req->changeBreakpoint.request->breakpointAttr); - printf_filtered(" breakpointId = %d\n", - req->changeBreakpoint.request->breakpointId); - printf_filtered(" breakpointType = %d\n", - req->changeBreakpoint.request->breakpointType); - printf_filtered(" ignoreCount = %d\n", - req->changeBreakpoint.request->ignoreCount); - break; - } - break; - case BreakConditionRType: - execute_command_1(1, queue, "condition %d %.*s", - req->breakCondition.request->breakpointId, - req->breakCondition.condition.byteLen, - req->breakCondition.condition.text); - break; - case BreakCommandsRType: - /* Put pointers to where cadillac_command_line_input() can find - them. */ - doing_breakcommands_message = 1; - command_line_length = req->breakCommands.commands.byteLen; - command_line_text = req->breakCommands.commands.text; - execute_command_1(1, queue, "commands %d", - req->breakCommands.request->breakpointId); - command_line_text = (char *)NULL; - command_line_length = 0; - doing_breakcommands_message = 0; - break; - case ShowValueRType: - { - char expr[100], *p = expr; - - expr[0] = 0; - - if (req->showValue.request->ref_type == CValuePointerRef) - strcat(expr, "* "); - - if (req->showValue.type_cast.byteLen) - { - strcat(expr, "("); - strncat(expr, req->showValue.type_cast.text, - req->showValue.type_cast.byteLen); - strcat(expr, ") "); - } - - if (req->showValue.field.byteLen) - strcat(expr, "("); - - strncat(expr, req->showValue.expression.text, - req->showValue.expression.byteLen); - - if (req->showValue.field.byteLen) - { - strcat(expr, ")"); - - strncat(expr, req->showValue.field.text, - req->showValue.field.byteLen); - } - - execute_command_1(1, queue, "print %s", expr); - } - break; - case SetValueRType: - { - char expr[100], *p = expr; - - expr[0] = 0; - - if (req->setValue.request->ref_type == CValuePointerRef) - strcat(expr, "* "); - -#if 0 - if (req->setValue.type_cast.byteLen) - { - strcat(expr, "("); - strncat(expr, req->setValue.type_cast.text, - req->setValue.type_cast.byteLen); - strcat(expr, ") "); - } -#endif - if (req->setValue.field.byteLen) - strcat(expr, "("); - - strncat(expr, req->setValue.expression.text, - req->setValue.expression.byteLen); - - if (req->setValue.field.byteLen) - { - strcat(expr, ")"); - - strncat(expr, req->setValue.field.text, - req->setValue.field.byteLen); - } - - execute_command_1(1, queue, "print %s = (%s) %s", expr, - req->setValue.type_cast.text, - req->setValue.value.text); - } - break; - default: - fprintf(stderr, "Unknown request type = %d\n", - req->head.request->reqType); - break; - } - free (req); /* Should probably call CVFreeDebuggerRequest() here, but - can't do so if interrupt level has mucked with req-> - request. CVFreeDebuggerRequest() only ends up calling - free() anyway! */ - } -} - -/* Return a bitmask indicating if the kernel or the pty did something - interesting. Set poll to non-zero if you don't want to wait. */ - -static int -wait_for_events(poll) - int poll; -{ - fd_set readfds; - int numfds; - int eventmask = 0; - static struct timeval tv = {0}; - - /* Output all pending requests. */ - CWriteRequestBuffer(conn); - - FD_ZERO(&readfds); - - /* Wait till there's some activity from the kernel or the pty. */ - do - { - FD_SET(kerfd, &readfds); - if (inferior_pty > 0) - FD_SET(inferior_pty, &readfds); - if (poll) - numfds = select(sizeof(readfds)*8, &readfds, 0, 0, &tv); - else - numfds = select(sizeof(readfds)*8, &readfds, 0, 0, 0); - } - while (numfds <= 0 && !poll); - - if (FD_ISSET(inferior_pty, &readfds)) - eventmask |= PTY_EVENT; - - if (FD_ISSET(kerfd, &readfds)) - eventmask |= KERNEL_EVENT; - - return eventmask; -} - -/* This is called from read_command_lines() to provide the text for breakpoint - commands, which is supplied in a BreakCommands message. Each call to this - routine supplies a single line of text, with the newline removed. */ - -/* This routine may be invoked in two different contexts. In the first, it - is being called as a result of the BreakCommands message. In this case, - all of the command text is immediately available. In the second case, it is - called as a result of the user typing the 'command' command. The command - text then needs to be glommed out of UserInput messages (and possibly other - messages as well). The most 'straighforward' way of doing this is to - basically simulate the main loop, but just accumulate the command text - instead of sending it to execute_command(). */ - -char * -cadillac_command_line_input() -{ - char *p; - - if (doing_breakcommands_message) - { - if (command_line_length <= 0) - return (char *)NULL; - - p = command_line_text; - - while (command_line_length-- > 0) - { - if (*command_line_text == '\n') - { - *command_line_text = '\000'; - command_line_text++; - break; - } - command_line_text++; - } - - printf_filtered("%s\n", p); - return p; - } - else - { - /* We come here when the user has typed the 'command' or 'define' command - to the GDB window. We are basically deep inside of the 'command' - command processing routine right now, and will be called to get a new - line of input. We expect that kernel_dispatch will queue up only one - command at a time. */ - - int eventmask; - static char buf[100]; - - eventmask = wait_for_events(0); - - if (eventmask & PTY_EVENT) - pty_to_kernel(); - - if (eventmask & KERNEL_EVENT) - kernel_dispatch(1); /* Queue up commands */ - -/* Note that command has been echoed by the time we get here */ - - p = dequeue_command(); - - if (p) - { - strncpy(buf, p, sizeof(buf)); - free(p); - return buf; - } - else - return NULL; - } -} - -/* Establish contact with the kernel. */ - -void -cadillac_initialize(cadillac_id, execarg) - char *cadillac_id; - char *execarg; -{ - CTtyRequest *req; - char *ctmp; - extern long strtol(char *str, char **ptr, int base); - char pathname[MAXPATHLEN]; - int n; - - if (!execarg) execarg = ""; - - printf("gdb-debugger pid=%d\n", getpid()); /* XXX - debugging only */ - - /* First establish the connection with the kernel. */ - - kerfd = COpenClientSocket(NULL); - if (kerfd < 0) { - printf("COpenClientSocket() failed\n"); - exit(1); - } - - /* Setup for I/O interrupts when appropriate. */ - - n = fcntl(kerfd, F_GETFL, 0); - fcntl(kerfd, F_SETFL, n|FASYNC); - fcntl(kerfd, F_SETOWN, getpid()); - - /* Setup connection buffering. */ - - CSetSocketBufferSize (kerfd, 12000); - - /* Generate a new connection control block. */ - - conn = NewConnection (0, kerfd, kerfd); - if (!conn) { - printf("NewConnection() failed\n"); - exit(1); - } - -#ifdef KERNEL_RECORD - kerout = fopen("kernel.output", "+w"); - - CReadWriteHooks(conn, conn->previewMethod, conn->readMethod, kernel_record); -#endif - - /* Tell the kernel that we are the "debugger". */ - - req = CWriteTtyRequest (conn, QueryConnectionRType); - req->generic.queryconnection.major = 0; - req->generic.queryconnection.minor = 0; - req->generic.queryconnection.cadillacId1=strtol(cadillac_id, &ctmp, 16); - req->generic.queryconnection.cadillacId2 = strtol(++ctmp, NULL, 16); - req->generic.queryconnection.nProtocols = 1; - CWriteProtocol (conn, 0, 0, "debugger"); - CWriteLength (conn); - - /* Tell the kernel that we are actually running. */ - - /* KROCK ALERT!!! The kernel doesn't really care about the arguments to - the program at all! It only cares that argument 7 be the name of the - target program. So, we just fill in the rest of the slots with - padding. I hope the kernel never cares about this! */ - - req = CWriteTtyRequest (conn, RunningProgramRType); - req->runningprogram.argc = 8; - getwd (pathname); - CWriteVstring0 (conn, pathname); - - CWriteVstring0 (conn, "0"); - CWriteVstring0 (conn, "1"); - CWriteVstring0 (conn, "2"); - CWriteVstring0 (conn, "3"); - CWriteVstring0 (conn, "4"); - CWriteVstring0 (conn, "5"); - CWriteVstring0 (conn, "6"); - CWriteVstring0 (conn, execarg); - CWriteLength (conn); - - /* Tell the kernel our PID and all that */ - - program_id = 1; - CVWriteDebugProgramInfo(conn, - getpid(), - program_id, - execarg, - ""); - - /* Tell the rest of the world that Cadillac is now set up. */ - cadillac = 1; - - setsid(); /* Drop controlling tty, become pgrp master */ - getpty(); /* Setup the pty */ - dup2(inferior_tty, 0); /* Attach all GDB I/O to the pty */ - dup2(inferior_tty, 1); - dup2(inferior_tty, 2); -} - -/* This is called from execute_command, and provides a wrapper around - various command routines in a place where both protocol messages and - user input both flow through. -*/ - -void -cadillac_call_command(cmdblk, arg, from_tty) - struct cmd_list_element *cmdblk; - char *arg; - int from_tty; -{ - if (cmdblk->class == class_run) - { - go_busy(); - has_run = 1; - (*cmdblk->function.cfunc)(arg, from_tty); - send_status(); - } - else - (*cmdblk->function.cfunc)(arg, from_tty); - - print_prompt(); -} - -void -cadillac_new_process() -{ - instance_id = inferior_pid; -} - -static void -iosig(signo) - int signo; -{ - while (1) - { - int eventmask; - - eventmask = wait_for_events(1); - - if (eventmask == 0) - return; - - if (eventmask & PTY_EVENT) - pty_to_kernel(); - - if (eventmask & KERNEL_EVENT) - kernel_dispatch(1); - } -} - -int -cadillac_wait(status) - int *status; -{ - int pid; - - signal(SIGIO, iosig); - - pid = wait(status); - - signal(SIGIO, SIG_DFL); - return pid; -} - -static void -null_routine(arg) - int arg; -{ -} - -/* All requests from the Cadillac kernel eventually end up here. */ - -void -cadillac_main_loop() -{ - CTtyRequest *req; - struct cleanup *old_chain; - - doing_breakcommands_message = 0; - -/* We will come thru here any time there is an error, so send status if - necessary. */ - - send_status(); - - print_prompt(); - - /* The actual event loop! */ - - while (1) - { - int eventmask; - char *cmd; - - old_chain = make_cleanup(null_routine, 0); - -/* First, empty out the command queue, then check for new requests. */ - - while (cmd = dequeue_command()) - { - execute_command_1(1, 0, cmd); - free(cmd); - } - - eventmask = wait_for_events(0); - - if (eventmask & PTY_EVENT) - pty_to_kernel(); - - if (eventmask & KERNEL_EVENT) - kernel_dispatch(0); - - bpstat_do_actions(&stop_bpstat); - do_cleanups(old_chain); - } -} diff --git a/gdb/config.gdb b/gdb/config.gdb deleted file mode 100755 index c380fe4577..0000000000 --- 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 ec871762a2..0000000000 --- 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 index dac9ab89d4..e69de29bb2 100755 --- a/gdb/config.sub +++ b/gdb/config.sub @@ -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/altosgas.mh b/gdb/config/altosgas.mh deleted file mode 100644 index b9b231af5d..0000000000 --- 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 7c2912e9d4..0000000000 --- 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 562e43f71d..0000000000 --- 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/go32.mt b/gdb/config/go32.mt deleted file mode 100644 index a37facd0a7..0000000000 --- a/gdb/config/go32.mt +++ /dev/null @@ -1,10 +0,0 @@ - - -fishall: - echo "Can't make GDB for go32 (yet :) " - touch $(OBS) - touch $(RAPP_OBS) - touch $(TSOBS) - touch $(NTSSTART) - touch gdb - diff --git a/gdb/config/i386sco.mt b/gdb/config/i386sco.mt deleted file mode 100644 index 720eea2a21..0000000000 --- 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 2316ffb6b8..0000000000 --- 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 cd07b5cb66..0000000000 --- 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/i386v32-g.mh b/gdb/config/i386v32-g.mh deleted file mode 100644 index 034951234e..0000000000 --- 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 e2cd6b4f60..0000000000 --- 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.mt b/gdb/config/i386v32.mt deleted file mode 100644 index 1ca4cae768..0000000000 --- a/gdb/config/i386v32.mt +++ /dev/null @@ -1,4 +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 -MT_CFLAGS= diff --git a/gdb/config/i960.mt b/gdb/config/i960.mt deleted file mode 100644 index f6a7556b2a..0000000000 --- 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/mh-vax b/gdb/config/mh-vax deleted file mode 100755 index 79ecb090a7..0000000000 --- a/gdb/config/mh-vax +++ /dev/null @@ -1,12 +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 -REGEX=regex.o -REGEX1=regex.o -XM_FILE= xm-vax.h diff --git a/gdb/config/mt-h8300hds b/gdb/config/mt-h8300hds deleted file mode 100755 index fbc6ac99d3..0000000000 --- a/gdb/config/mt-h8300hds +++ /dev/null @@ -1,4 +0,0 @@ -# Target: H8300 with HDS monitor -TDEPFILES= exec.o h8300-tdep.o hds-tdep.o -TM_FILE= tm-h8300.h -TM_CFLAGS= diff --git a/gdb/config/news1000.mt b/gdb/config/news1000.mt deleted file mode 100644 index ca16e590ef..0000000000 --- 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/sun3.mh b/gdb/config/sun3.mh deleted file mode 100644 index 4ec8d54857..0000000000 --- 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 9c93c56ede..0000000000 --- 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/sun4.mh b/gdb/config/sun4.mh deleted file mode 100644 index 176900789f..0000000000 --- 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 ser-termios.o -XM_FILE= xm-sun4os4.h diff --git a/gdb/config/sun4.mt b/gdb/config/sun4.mt deleted file mode 100644 index 39928b8901..0000000000 --- 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 742c9cbeab..0000000000 --- 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 b1890e80e3..0000000000 --- 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/sun4os5.mh b/gdb/config/sun4os5.mh deleted file mode 100755 index 8ec7ab8252..0000000000 --- a/gdb/config/sun4os5.mh +++ /dev/null @@ -1,29 +0,0 @@ -# Host: Sun 4 or Sparcstation, running SunOS 5 -XDEPFILES= procfs.o -XM_FILE= xm-sun4os5.h -SYSV_DEFINE=-DSYSV -REGEX=regex.o -REGEX1=regex.o - -# We need to find alloca() somewhere. Gcc has one built in, but most other -# compilers don't. Using the one in /usr/ucblib/libucb.a is tricky because -# we have to be careful not to pull in anything else from the library (lots -# of things are broken in most SVR4 versions). The best solution is to just -# compile alloca.c and link it into the executable. If we end up not needing -# it, then the code is just dead. Once alloca.c moves to libiberty, then we -# can eliminate this semi-kludge. -####ALLOCA=alloca.o -####ALLOCA1=alloca.o - -# SVR4 comes standard with terminfo, and in some implementations, the -# old termcap descriptions are incomplete. So ensure that we use the -# new terminfo interface and latest terminal descriptions. -TERMCAP=-ltermlib - -# SVR4 puts the BSD compatible install in /usr/ucb. -INSTALL = /usr/ucb/install -c - -# Sun's compilers require the -xs option to produce debug information -# in the final linked executable. Otherwise they leave it in the .o -# files only, with undocumented pointers to it in the linked executable. -MH_CFLAGS=-xs diff --git a/gdb/config/sun4os5.mt b/gdb/config/sun4os5.mt deleted file mode 100755 index 3f797ab732..0000000000 --- a/gdb/config/sun4os5.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Sun 4 or Sparcstation, running SunOS 5 -TDEPFILES= exec.o sparc-tdep.o sparc-pinsn.o solib.o -TM_FILE= tm-sun4os5.h diff --git a/gdb/configure b/gdb/configure deleted file mode 100755 index 5b73541ba0..0000000000 --- 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 }' &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 }' &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/convex-opcode.h b/gdb/convex-opcode.h deleted file mode 100755 index 523c8744c2..0000000000 --- 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/cplus-dem.c b/gdb/cplus-dem.c deleted file mode 100644 index b9c6288853..0000000000 --- a/gdb/cplus-dem.c +++ /dev/null @@ -1,2280 +0,0 @@ -/* Demangler for GNU C++ - Copyright 1989, 1991 Free Software Foundation, Inc. - Written by James Clark (jjc@jclark.uucp) - Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling - - 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.95.03 (November 13 version). */ - -/* This file exports two functions; cplus_mangle_opname and cplus_demangle. - - 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. */ - -/* GDB-specific, FIXME. */ -#include "defs.h" -#include "demangle.h" - -#include -#include - -/* In order to allow a single demangler executable to demangle strings - using various common values of CPLUS_MARKER, as well as any specific - one set at compile time, we maintain a string containing all the - commonly used ones, and check to see if the marker we are looking for - is in that string. CPLUS_MARKER is usually '$' on systems where the - assembler can deal with that. Where the assembler can't, it's usually - '.' (but on many systems '.' is used for other things). We put the - current defined CPLUS_MARKER first (which defaults to '$'), followed - by the next most common value, followed by an explicit '$' in case - the value of CPLUS_MARKER is not '$'. - - We could avoid this if we could just get g++ to tell us what the actual - cplus marker character is as part of the debug information, perhaps by - ensuring that it is the character that terminates the gcc_compiled - marker symbol (FIXME). */ - -#if !defined (CPLUS_MARKER) -#define CPLUS_MARKER '$' -#endif - -static const char cplus_markers[] = { CPLUS_MARKER, '.', '$', '\0' }; - -#ifndef __STDC__ -#define const -#endif - -/* Stuff that is shared between sub-routines. - * Using a shared structure allows cplus_demangle to be reentrant. */ - -struct work_stuff -{ - int options; - char **typevec; - int ntypes; - int typevec_size; - int constructor; - int destructor; - int static_type; /* A static member function */ - int const_type; /* A const member function */ -}; - -#define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI) -#define PRINT_ARG_TYPES (work -> options & DMGL_PARAMS) - -static const struct optable -{ - const char *in; - const char *out; - int flags; -} optable[] = { - "nw", " new", DMGL_ANSI, /* new (1.92, ansi) */ - "dl", " delete", DMGL_ANSI, /* new (1.92, ansi) */ - "new", " new", 0, /* old (1.91, and 1.x) */ - "delete", " delete", 0, /* old (1.91, and 1.x) */ - "as", "=", DMGL_ANSI, /* ansi */ - "ne", "!=", DMGL_ANSI, /* old, ansi */ - "eq", "==", DMGL_ANSI, /* old, ansi */ - "ge", ">=", DMGL_ANSI, /* old, ansi */ - "gt", ">", DMGL_ANSI, /* old, ansi */ - "le", "<=", DMGL_ANSI, /* old, ansi */ - "lt", "<", DMGL_ANSI, /* old, ansi */ - "plus", "+", 0, /* old */ - "pl", "+", DMGL_ANSI, /* ansi */ - "apl", "+=", DMGL_ANSI, /* ansi */ - "minus", "-", 0, /* old */ - "mi", "-", DMGL_ANSI, /* ansi */ - "ami", "-=", DMGL_ANSI, /* ansi */ - "mult", "*", 0, /* old */ - "ml", "*", DMGL_ANSI, /* ansi */ - "amu", "*=", DMGL_ANSI, /* ansi (ARM/Lucid) */ - "aml", "*=", DMGL_ANSI, /* ansi (GNU/g++) */ - "convert", "+", 0, /* old (unary +) */ - "negate", "-", 0, /* old (unary -) */ - "trunc_mod", "%", 0, /* old */ - "md", "%", DMGL_ANSI, /* ansi */ - "amd", "%=", DMGL_ANSI, /* ansi */ - "trunc_div", "/", 0, /* old */ - "dv", "/", DMGL_ANSI, /* ansi */ - "adv", "/=", DMGL_ANSI, /* ansi */ - "truth_andif", "&&", 0, /* old */ - "aa", "&&", DMGL_ANSI, /* ansi */ - "truth_orif", "||", 0, /* old */ - "oo", "||", DMGL_ANSI, /* ansi */ - "truth_not", "!", 0, /* old */ - "nt", "!", DMGL_ANSI, /* ansi */ - "postincrement","++", 0, /* old */ - "pp", "++", DMGL_ANSI, /* ansi */ - "postdecrement","--", 0, /* old */ - "mm", "--", DMGL_ANSI, /* ansi */ - "bit_ior", "|", 0, /* old */ - "or", "|", DMGL_ANSI, /* ansi */ - "aor", "|=", DMGL_ANSI, /* ansi */ - "bit_xor", "^", 0, /* old */ - "er", "^", DMGL_ANSI, /* ansi */ - "aer", "^=", DMGL_ANSI, /* ansi */ - "bit_and", "&", 0, /* old */ - "ad", "&", DMGL_ANSI, /* ansi */ - "aad", "&=", DMGL_ANSI, /* ansi */ - "bit_not", "~", 0, /* old */ - "co", "~", DMGL_ANSI, /* ansi */ - "call", "()", 0, /* old */ - "cl", "()", DMGL_ANSI, /* ansi */ - "alshift", "<<", 0, /* old */ - "ls", "<<", DMGL_ANSI, /* ansi */ - "als", "<<=", DMGL_ANSI, /* ansi */ - "arshift", ">>", 0, /* old */ - "rs", ">>", DMGL_ANSI, /* ansi */ - "ars", ">>=", DMGL_ANSI, /* ansi */ - "component", "->", 0, /* old */ - "pt", "->", DMGL_ANSI, /* ansi; Lucid C++ form */ - "rf", "->", DMGL_ANSI, /* ansi; ARM/GNU form */ - "indirect", "*", 0, /* old */ - "method_call", "->()", 0, /* old */ - "addr", "&", 0, /* old (unary &) */ - "array", "[]", 0, /* old */ - "vc", "[]", DMGL_ANSI, /* ansi */ - "compound", ", ", 0, /* old */ - "cm", ", ", DMGL_ANSI, /* ansi */ - "cond", "?:", 0, /* old */ - "cn", "?:", DMGL_ANSI, /* psuedo-ansi */ - "max", ">?", 0, /* old */ - "mx", ">?", DMGL_ANSI, /* psuedo-ansi */ - "min", "*", DMGL_ANSI, /* ansi */ -}; - - -typedef struct string /* Beware: these aren't required to be */ -{ /* '\0' terminated. */ - char *b; /* pointer to start of string */ - char *p; /* pointer after last character */ - char *e; /* pointer after end of allocated space */ -} string; - -#define STRING_EMPTY(str) ((str) -> b == (str) -> p) -#define PREPEND_BLANK(str) {if (!STRING_EMPTY(str)) \ - string_prepend(str, " ");} -#define APPEND_BLANK(str) {if (!STRING_EMPTY(str)) \ - string_append(str, " ");} - -#define ARM_VTABLE_STRING "__vtbl__" /* Lucid/cfront virtual table prefix */ -#define ARM_VTABLE_STRLEN 8 /* strlen (ARM_VTABLE_STRING) */ - -/* Prototypes for local functions */ - -static char * -mop_up PARAMS ((struct work_stuff *, string *, int)); - -#if 0 -static int -demangle_method_args PARAMS ((struct work_stuff *work, const char **, string *)); -#endif - -static int -demangle_template PARAMS ((struct work_stuff *work, const char **, string *)); - -static int -demangle_qualified PARAMS ((struct work_stuff *, const char **, string *, - int)); - -static int -demangle_class PARAMS ((struct work_stuff *, const char **, string *)); - -static int -demangle_fund_type PARAMS ((struct work_stuff *, const char **, string *)); - -static int -demangle_signature PARAMS ((struct work_stuff *, const char **, string *)); - -static int -demangle_prefix PARAMS ((struct work_stuff *, const char **, string *)); - -static int -gnu_special PARAMS ((struct work_stuff *, const char **, string *)); - -static int -cfront_special PARAMS ((struct work_stuff *, const char **, string *)); - -static void -string_need PARAMS ((string *, int)); - -static void -string_delete PARAMS ((string *)); - -static void -string_init PARAMS ((string *)); - -static void -string_clear PARAMS ((string *)); - -#if 0 -static int -string_empty PARAMS ((string *)); -#endif - -static void -string_append PARAMS ((string *, const char *)); - -static void -string_appends PARAMS ((string *, string *)); - -static void -string_appendn PARAMS ((string *, const char *, int)); - -static void -string_prepend PARAMS ((string *, const char *)); - -static void -string_prependn PARAMS ((string *, const char *, int)); - -static int -get_count PARAMS ((const char **, int *)); - -static int -consume_count PARAMS ((const char **)); - -static int -demangle_args PARAMS ((struct work_stuff *, const char **, string *)); - -static int -do_type PARAMS ((struct work_stuff *, const char **, string *)); - -static int -do_arg PARAMS ((struct work_stuff *, const char **, string *)); - -static void -demangle_function_name PARAMS ((struct work_stuff *, const char **, string *, - const char *)); - -static void -remember_type PARAMS ((struct work_stuff *, const char *, int)); - -static void -forget_types PARAMS ((struct work_stuff *)); - -#if 0 -static void -string_prepends PARAMS ((string *, string *)); -#endif - -/* Translate count to integer, consuming tokens in the process. - Conversion terminates on the first non-digit character. */ - -static int -consume_count (type) - const char **type; -{ - int count = 0; - - do - { - count *= 10; - count += **type - '0'; - (*type)++; - } while (isdigit (**type)); - return (count); -} - -/* Takes operator name as e.g. "++" and returns mangled - operator name (e.g. "postincrement_expr"), or NULL if not found. - - If OPTIONS & DMGL_ANSI == 1, return the ANSI name; - if OPTIONS & DMGL_ANSI == 0, return the old GNU name. */ - -char * -cplus_mangle_opname (opname, options) - char *opname; - int options; -{ - int i; - int len; - - len = strlen (opname); - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - if (strlen (optable[i].out) == len - && (options & DMGL_ANSI) == (optable[i].flags & DMGL_ANSI) - && memcmp (optable[i].out, opname, len) == 0) - return ((char *)optable[i].in); - } - return (0); -} - -/* char *cplus_demangle (const char *name, int options) - - 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. - - The OPTIONS arg may contain one or more of the following bits: - - DMGL_ANSI ANSI qualifiers such as `const' and `void' are - included. - DMGL_PARAMS Function parameters are included. - - For example, - - cplus_demangle ("foo__1Ai", DMGL_PARAMS) => "A::foo(int)" - cplus_demangle ("foo__1Ai", DMGL_PARAMS | DMGL_ANSI) => "A::foo(int)" - cplus_demangle ("foo__1Ai", 0) => "A::foo" - - cplus_demangle ("foo__1Afe", DMGL_PARAMS) => "A::foo(float,...)" - cplus_demangle ("foo__1Afe", DMGL_PARAMS | DMGL_ANSI)=> "A::foo(float,...)" - cplus_demangle ("foo__1Afe", 0) => "A::foo" - - Note that any leading underscores, or other such characters prepended by - the compilation system, are presumed to have already been stripped from - TYPE. */ - -char * -cplus_demangle (mangled, options) - const char *mangled; - int options; -{ - string decl; - int success = 0; - struct work_stuff work[1]; - char *demangled = NULL; - - if ((mangled != NULL) && (*mangled != '\0')) - { - memset ((char *) work, 0, sizeof (work)); - work -> options = options; - - string_init (&decl); - - /* First check to see if gnu style demangling is active and if the - string to be demangled contains a CPLUS_MARKER. If so, attempt to - recognize one of the gnu special forms rather than looking for a - standard prefix. In particular, don't worry about whether there - is a "__" string in the mangled string. Consider "_$_5__foo" for - example. */ - - if ((AUTO_DEMANGLING || GNU_DEMANGLING) - && (strpbrk (mangled, cplus_markers)) != NULL) - { - success = gnu_special (work, &mangled, &decl); - } - else - { - success = demangle_prefix (work, &mangled, &decl); - } - if (success && (*mangled != '\0')) - { - success = demangle_signature (work, &mangled, &decl); - } - demangled = mop_up (work, &decl, success); - } - return (demangled); -} - -static char * -mop_up (work, declp, success) - struct work_stuff *work; - string *declp; - int success; -{ - int i; - char *demangled = NULL; - - /* Discard the remembered types, if any. */ - - forget_types (work); - if (work -> typevec != NULL) - { - free ((char *) work -> typevec); - } - - /* If demangling was successful, ensure that the demangled string is null - terminated and return it. Otherwise, free the demangling decl. */ - - if (!success) - { - string_delete (declp); - } - else - { - string_appendn (declp, "", 1); - demangled = declp -> b; - } - return (demangled); -} - -/* - -LOCAL FUNCTION - - demangle_signature -- demangle the signature part of a mangled name - -SYNOPSIS - - static int - demangle_signature (struct work_stuff *work, const char **mangled, - string *declp); - -DESCRIPTION - - Consume and demangle the signature portion of the mangled name. - - DECLP is the string where demangled output is being built. At - entry it contains the demangled root name from the mangled name - prefix. I.E. either a demangled operator name or the root function - name. In some special cases, it may contain nothing. - - *MANGLED points to the current unconsumed location in the mangled - name. As tokens are consumed and demangling is performed, the - pointer is updated to continuously point at the next token to - be consumed. - - Demangling GNU style mangled names is nasty because there is no - explicit token that marks the start of the outermost function - argument list. -*/ - -static int -demangle_signature (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int success = 1; - int func_done = 0; - int expect_func = 0; - const char *oldmangled; - - while (success && (**mangled != '\0')) - { - switch (**mangled) - { - case 'Q': - oldmangled = *mangled; - success = demangle_qualified (work, mangled, declp, 1); - if (success) - { - remember_type (work, oldmangled, *mangled - oldmangled); - } - if (AUTO_DEMANGLING || GNU_DEMANGLING) - { - expect_func = 1; - } - break; - - case 'S': - /* Static member function */ - (*mangled)++; - work -> static_type = 1; - break; - - case 'C': - /* a const member function */ - (*mangled)++; - work -> const_type = 1; - break; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - oldmangled = *mangled; - success = demangle_class (work, mangled, declp); - if (success) - { - remember_type (work, oldmangled, *mangled - oldmangled); - } - if (AUTO_DEMANGLING || GNU_DEMANGLING) - { - expect_func = 1; - } - break; - - case 'F': - /* Function */ - /* ARM style demangling includes a specific 'F' character after - the class name. For GNU style, it is just implied. So we can - safely just consume any 'F' at this point and be compatible - with either style. */ - - func_done = 1; - (*mangled)++; - - /* For lucid/cfront style we have to forget any types we might - have remembered up to this point, since they were not argument - types. GNU style considers all types seen as available for - back references. See comment in demangle_args() */ - - if (LUCID_DEMANGLING || CFRONT_DEMANGLING) - { - forget_types (work); - } - success = demangle_args (work, mangled, declp); - break; - - case 't': - /* Template */ - success = demangle_template (work, mangled, declp); - break; - - case '_': - /* At the outermost level, we cannot have a return type specified, - so if we run into another '_' at this point we are dealing with - a mangled name that is either bogus, or has been mangled by - some algorithm we don't know how to deal with. So just - reject the entire demangling. */ - success = 0; - break; - - default: - if (AUTO_DEMANGLING || GNU_DEMANGLING) - { - /* Assume we have stumbled onto the first outermost function - argument token, and start processing args. */ - func_done = 1; - success = demangle_args (work, mangled, declp); - } - else - { - /* Non-GNU demanglers use a specific token to mark the start - of the outermost function argument tokens. Typically 'F', - for ARM-demangling, for example. So if we find something - we are not prepared for, it must be an error. */ - success = 0; - } - break; - } - if (AUTO_DEMANGLING || GNU_DEMANGLING) - { - if (success && expect_func) - { - func_done = 1; - success = demangle_args (work, mangled, declp); - } - } - } - if (success && !func_done) - { - if (AUTO_DEMANGLING || GNU_DEMANGLING) - { - /* With GNU style demangling, bar__3foo is 'foo::bar(void)', and - bar__3fooi is 'foo::bar(int)'. We get here when we find the - first case, and need to ensure that the '(void)' gets added to - the current declp. Note that with ARM, the first case - represents the name of a static data member 'foo::bar', - which is in the current declp, so we leave it alone. */ - success = demangle_args (work, mangled, declp); - } - } - if (success && work -> static_type && PRINT_ARG_TYPES) - { - string_append (declp, " static"); - } - if (success && work -> const_type && PRINT_ARG_TYPES) - { - string_append (declp, " const"); - } - return (success); -} - -#if 0 - -static int -demangle_method_args (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int success = 0; - - if (work -> static_type) - { - string_append (declp, *mangled + 1); - *mangled += strlen (*mangled); - success = 1; - } - else - { - success = demangle_args (work, mangled, declp); - } - return (success); -} - -#endif - -static int -demangle_template (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int i; - string tname; - string trawname; - int is_pointer; - int is_real; - int is_integral; - int r; - int need_comma = 0; - int success = 0; - int done; - const char *old_p; - int symbol_len; - string temp; - - (*mangled)++; - string_init (&tname); - string_init (&trawname); - /* get template name */ - if (!get_count (mangled, &r)) - { - return (0); - } - string_appendn (&tname, *mangled, r); - string_appendn (&trawname, *mangled, r); - string_appendn (&trawname, "", 1); - *mangled += r; - string_append (&tname, "<"); - /* get size of template parameter list */ - if (!get_count (mangled, &r)) - { - return (0); - } - for (i = 0; i < r; i++) - { - if (need_comma) - { - string_append (&tname, ", "); - } - /* Z for type parameters */ - if (**mangled == 'Z') - { - (*mangled)++; - success = do_type (work, mangled, &temp); - string_appendn (&temp, "", 1); - if (success) - { - string_append (&tname, temp.b); - } - string_delete(&temp); - if (!success) - { - break; - } - } - else - { - /* otherwise, value parameter */ - old_p = *mangled; - is_pointer = 0; - is_real = 0; - is_integral = 0; - done = 0; - success = do_type (work, mangled, &temp); - 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 'S': /* explicitly signed [char] */ - 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 (**mangled == 'm') - { - string_appendn (&tname, "-", 1); - (*mangled)++; - } - while (isdigit (**mangled)) - { - string_appendn (&tname, *mangled, 1); - (*mangled)++; - } - } - else if (is_real) - { - if (**mangled == 'm') - { - string_appendn (&tname, "-", 1); - (*mangled)++; - } - while (isdigit (**mangled)) - { - string_appendn (&tname, *mangled, 1); - (*mangled)++; - } - if (**mangled == '.') /* fraction */ - { - string_appendn (&tname, ".", 1); - (*mangled)++; - while (isdigit (**mangled)) - { - string_appendn (&tname, *mangled, 1); - (*mangled)++; - } - } - if (**mangled == 'e') /* exponent */ - { - string_appendn (&tname, "e", 1); - (*mangled)++; - while (isdigit (**mangled)) - { - string_appendn (&tname, *mangled, 1); - (*mangled)++; - } - } - } - else if (is_pointer) - { - if (!get_count (mangled, &symbol_len)) - { - success = 0; - break; - } - string_appendn (&tname, *mangled, symbol_len); - *mangled += symbol_len; - } - } - need_comma = 1; - } - string_append (&tname, ">::"); - if (work -> destructor) - { - string_append (&tname, "~"); - } - if (work -> constructor || work -> destructor) - { - string_append (&tname, trawname.b); - } - string_delete(&trawname); - - if (!success) - { - string_delete(&tname); - } - else - { - string_prepend (declp, tname.b); - string_delete (&tname); - - if (work -> static_type) - { - string_append (declp, *mangled + 1); - *mangled += strlen (*mangled); - success = 1; - } - else - { - success = demangle_args (work, mangled, declp); - } - } - return (success); -} - -/* - -LOCAL FUNCTION - - demangle_class -- demangle a mangled class sequence - -SYNOPSIS - - static int - demangle_class (struct work_stuff *work, const char **mangled, - strint *declp) - -DESCRIPTION - - DECLP points to the buffer into which demangling is being done. - - *MANGLED points to the current token to be demangled. On input, - it points to a mangled class (I.E. "3foo", "13verylongclass", etc.) - On exit, it points to the next token after the mangled class on - success, or the first unconsumed token on failure. - - If the CONSTRUCTOR or DESTRUCTOR flags are set in WORK, then - we are demangling a constructor or destructor. In this case - we prepend "class::class" or "class::~class" to DECLP. - - Otherwise, we prepend "class::" to the current DECLP. - - Reset the constructor/destructor flags once they have been - "consumed". This allows demangle_class to be called later during - the same demangling, to do normal class demangling. - - Returns 1 if demangling is successful, 0 otherwise. - -*/ - -static int -demangle_class (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int n; - int success = 0; - - n = consume_count (mangled); - if (strlen (*mangled) >= n) - { - if (work -> constructor || work -> destructor) - { - string_prependn (declp, *mangled, n); - if (work -> destructor) - { - string_prepend (declp, "~"); - } - work -> constructor = work -> destructor = 0; - } - string_prepend (declp, "::"); - string_prependn (declp, *mangled, n); - *mangled += n; - success = 1; - } - return (success); -} - -/* - -LOCAL FUNCTION - - demangle_prefix -- consume the mangled name prefix and find signature - -SYNOPSIS - - static int - demangle_prefix (struct work_stuff *work, const char **mangled, - string *declp); - -DESCRIPTION - - Consume and demangle the prefix of the mangled name. - - DECLP points to the string buffer into which demangled output is - placed. On entry, the buffer is empty. On exit it contains - the root function name, the demangled operator name, or in some - special cases either nothing or the completely demangled result. - - MANGLED points to the current pointer into the mangled name. As each - token of the mangled name is consumed, it is updated. Upon entry - the current mangled name pointer points to the first character of - the mangled name. Upon exit, it should point to the first character - of the signature if demangling was successful, or to the first - unconsumed character if demangling of the prefix was unsuccessful. - - Returns 1 on success, 0 otherwise. - */ - -static int -demangle_prefix (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int success = 1; - const char *scan; - int i; - - scan = strstr (*mangled, "__"); - - if (scan != NULL) - { - /* We found a sequence of two or more '_', ensure that we start at - the last pair in the sequence. */ - i = strspn (scan, "_"); - if (i > 2) - { - scan += (i - 2); - } - } - - if (scan == NULL) - { - success = 0; - } - else if (work -> static_type) - { - if (!isdigit (scan[0]) && (scan[0] != 't')) - { - success = 0; - } - } - else if ((scan == *mangled) && (isdigit (scan[2]) || (scan[2] == 'Q'))) - { - /* A GNU style constructor starts with "__" or "__Q". */ - work -> constructor = 1; - *mangled = scan + 2; - } - else if ((scan == *mangled) && !isdigit (scan[2]) && (scan[2] != 't')) - { - /* Mangled name starts with "__". Skip over any leading '_' characters, - then find the next "__" that separates the prefix from the signature. - */ - if (!(CFRONT_DEMANGLING || LUCID_DEMANGLING) - || (cfront_special (work, mangled, declp) == 0)) - { - while (*scan == '_') - { - scan++; - } - if ((scan = strstr (scan, "__")) == NULL || (*(scan + 2) == '\0')) - { - /* No separator (I.E. "__not_mangled"), or empty signature - (I.E. "__not_mangled_either__") */ - success = 0; - } - else - { - demangle_function_name (work, mangled, declp, scan); - } - } - } - else if (*(scan + 2) != '\0') - { - /* Mangled name does not start with "__" but does have one somewhere - in there with non empty stuff after it. Looks like a global - function name. */ - demangle_function_name (work, mangled, declp, scan); - } - else - { - /* Doesn't look like a mangled name */ - success = 0; - } - return (success); -} - -/* - -LOCAL FUNCTION - - gnu_special -- special handling of gnu mangled strings - -SYNOPSIS - - static int - gnu_special (struct work_stuff *work, const char **mangled, - string *declp); - - -DESCRIPTION - - Process some special GNU style mangling forms that don't fit - the normal pattern. For example: - - _$_3foo (destructor for class foo) - _vt$foo (foo virtual table) - _vt$foo$bar (foo::bar virtual table) - _3foo$varname (static data member) - */ - -static int -gnu_special (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int n; - int success = 1; - const char *p; - - if ((*mangled)[0] == '_' - && strchr (cplus_markers, (*mangled)[1]) != NULL - && (*mangled)[2] == '_') - { - /* Found a GNU style destructor, get past "__" */ - (*mangled) += 3; - work -> destructor = 1; - } - else if ((*mangled)[0] == '_' - && (*mangled)[1] == 'v' - && (*mangled)[2] == 't' - && strchr (cplus_markers, (*mangled)[3]) != NULL) - { - /* Found a GNU style virtual table, get past "_vt" - and create the decl. Note that we consume the entire mangled - input string, which means that demangle_signature has no work - to do. */ - (*mangled) += 4; - while (**mangled != '\0') - { - n = strcspn (*mangled, cplus_markers); - string_appendn (declp, *mangled, n); - (*mangled) += n; - if (**mangled != '\0') - { - string_append (declp, "::"); - (*mangled)++; - } - } - string_append (declp, " virtual table"); - } - else if ((*mangled)[0] == '_' - && isdigit ((*mangled)[1]) - && (p = strpbrk (*mangled, cplus_markers)) != NULL) - { - /* static data member, "_3foo$varname" for example */ - (*mangled)++; - p++; - n = consume_count (mangled); - string_appendn (declp, *mangled, n); - string_append (declp, "::"); - n = strlen (p); - string_appendn (declp, p, n); - (*mangled) = p + n; - } - else - { - success = 0; - } - return (success); -} - -/* - -LOCAL FUNCTION - - cfront_special -- special handling of cfront/lucid mangled strings - -SYNOPSIS - - static int - cfront_special (struct work_stuff *work, const char **mangled, - string *declp); - - -DESCRIPTION - - Process some special cfront style mangling forms that don't fit - the normal pattern. For example: - - __vtbl__3foo (foo virtual table) - __vtbl__3foo__3bar (bar::foo virtual table) - - */ - -static int -cfront_special (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int n; - int i; - int success = 1; - const char *p; - - if (strncmp (*mangled, ARM_VTABLE_STRING, ARM_VTABLE_STRLEN) == 0) - { - /* Found a cfront style virtual table, get past ARM_VTABLE_STRING - and create the decl. Note that we consume the entire mangled - input string, which means that demangle_signature has no work - to do. */ - (*mangled) += ARM_VTABLE_STRLEN; - while (**mangled != '\0') - { - n = consume_count (mangled); - string_prependn (declp, *mangled, n); - (*mangled) += n; - if ((*mangled)[0] == '_' && (*mangled)[1] == '_') - { - string_prepend (declp, "::"); - (*mangled) += 2; - } - } - string_append (declp, " virtual table"); - } - else - { - success = 0; - } - return (success); -} - -/* - -LOCAL FUNCTION - - demangle_qualified -- demangle 'Q' qualified name strings - -SYNOPSIS - - static int - demangle_qualified (struct work_stuff *, const char *mangled, - string *result, int isfuncname); - -DESCRIPTION - - Demangle a qualified name, such as "Q25Outer5Inner" which is - the mangled form of "Outer::Inner". The demangled output is - appended to the result string. - - If isfuncname is nonzero, then the qualified name we are building - is going to be used as a member function name, so if it is a - constructor or destructor function, append an appropriate - constructor or destructor name. I.E. for the above example, - the result for use as a constructor is "Outer::Inner::Inner" - and the result for use as a destructor is "Outer::Inner::~Inner". - -BUGS - - Numeric conversion is ASCII dependent (FIXME). - - */ - -static int -demangle_qualified (work, mangled, result, isfuncname) - struct work_stuff *work; - const char **mangled; - string *result; - int isfuncname; -{ - int qualifiers; - int namelength; - int success = 0; - - qualifiers = (*mangled)[1] - '0'; - if (qualifiers > 0 && qualifiers < 10) - { - /* Assume success until we discover otherwise. Skip over the 'Q', the - qualifier count, and any '_' between the qualifier count and the - first name (cfront qualified names). */ - - success = 1; - if ((*mangled)[2] == '_') - { - (*mangled)++; - } - (*mangled) += 2; - - - /* Pick off the names and append them to the result string as they - are found, separated by '::'. */ - - while (qualifiers-- > 0) - { - namelength = consume_count (mangled); - if (strlen (*mangled) < namelength) - { - /* Simple sanity check failed */ - success = 0; - break; - } - string_appendn (result, *mangled, namelength); - if (qualifiers > 0) - { - string_appendn (result, "::", 2); - } - *mangled += namelength; - } - - /* If we are using the result as a function name, we need to append - the appropriate '::' separated constructor or destructor name. - We do this here because this is the most convenient place, where - we already have a pointer to the name and the length of the name. */ - - if (isfuncname && (work -> constructor || work -> destructor)) - { - string_appendn (result, "::", 2); - if (work -> destructor) - { - string_append (result, "~"); - } - string_appendn (result, (*mangled) - namelength, namelength); - } - } - return (success); -} - -/* - -LOCAL FUNCTION - - get_count -- convert an ascii count to integer, consuming tokens - -SYNOPSIS - - static int - get_count (const char **type, int *count) - -DESCRIPTION - - Return 0 if no conversion is performed, 1 if a string is converted. -*/ - -static int -get_count (type, count) - const char **type; - int *count; -{ - const char *p; - int n; - - if (!isdigit (**type)) - { - return (0); - } - else - { - *count = **type - '0'; - (*type)++; - if (isdigit (**type)) - { - p = *type; - n = *count; - do - { - n *= 10; - n += *p - '0'; - p++; - } - 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 (work, mangled, result) - struct work_stuff *work; - const char **mangled; - string *result; -{ - int n; - int done; - int success; - string decl; - const char *remembered_type; - int constp; - int volatilep; - - string_init (&decl); - string_init (result); - - done = 0; - success = 1; - while (success && !done) - { - int member; - switch (**mangled) - { - - /* A pointer type */ - case 'P': - (*mangled)++; - string_prepend (&decl, "*"); - break; - - /* A reference type */ - case 'R': - (*mangled)++; - string_prepend (&decl, "&"); - break; - - /* A back reference to a previously seen type */ - case 'T': - (*mangled)++; - if (!get_count (mangled, &n) || n >= work -> ntypes) - { - success = 0; - } - else - { - remembered_type = work -> typevec[n]; - mangled = &remembered_type; - } - break; - - /* A function */ - case 'F': - (*mangled)++; - if (!STRING_EMPTY (&decl) && decl.b[0] == '*') - { - string_prepend (&decl, "("); - string_append (&decl, ")"); - } - /* After picking off the function args, we expect to either find the - function return type (preceded by an '_') or the end of the - string. */ - if (!demangle_args (work, mangled, &decl) - || (**mangled != '_' && **mangled != '\0')) - { - success = 0; - } - if (success && (**mangled == '_')) - { - (*mangled)++; - } - break; - - case 'M': - case 'O': - { - constp = 0; - volatilep = 0; - - member = **mangled == 'M'; - (*mangled)++; - if (!isdigit (**mangled)) - { - success = 0; - break; - } - n = consume_count (mangled); - if (strlen (*mangled) < n) - { - success = 0; - break; - } - string_append (&decl, ")"); - string_prepend (&decl, "::"); - string_prependn (&decl, *mangled, n); - string_prepend (&decl, "("); - *mangled += n; - if (member) - { - if (**mangled == 'C') - { - (*mangled)++; - constp = 1; - } - if (**mangled == 'V') - { - (*mangled)++; - volatilep = 1; - } - if (*(*mangled)++ != 'F') - { - success = 0; - break; - } - } - if ((member && !demangle_args (work, mangled, &decl)) - || **mangled != '_') - { - success = 0; - break; - } - (*mangled)++; - if (! PRINT_ANSI_QUALIFIERS) - { - break; - } - if (constp) - { - APPEND_BLANK (&decl); - string_append (&decl, "const"); - } - if (volatilep) - { - APPEND_BLANK (&decl); - string_append (&decl, "volatile"); - } - break; - } - - case 'C': - if ((*mangled)[1] == 'P') - { - (*mangled)++; - if (PRINT_ANSI_QUALIFIERS) - { - if (!STRING_EMPTY (&decl)) - { - string_prepend (&decl, " "); - } - string_prepend (&decl, "const"); - } - break; - } - - /* fall through */ - default: - done = 1; - break; - } - } - - switch (**mangled) - { - /* A qualified name, such as "Outer::Inner". */ - case 'Q': - success = demangle_qualified (work, mangled, result, 0); - break; - - default: - success = demangle_fund_type (work, mangled, result); - break; - } - - if (success) - { - if (!STRING_EMPTY (&decl)) - { - string_append (result, " "); - string_appends (result, &decl); - } - } - else - { - string_delete (result); - } - string_delete (&decl); - return (success); -} - -/* Given a pointer to a type string that represents a fundamental type - argument (int, long, unsigned int, etc) in TYPE, a pointer to the - string in which the demangled output is being built in RESULT, and - the WORK structure, decode the types and add them to the result. - - For example: - - "Ci" => "const int" - "Sl" => "signed long" - "CUs" => "const unsigned short" - - */ - -static int -demangle_fund_type (work, mangled, result) - struct work_stuff *work; - const char **mangled; - string *result; -{ - int done = 0; - int success = 1; - int n; - - /* First pick off any type qualifiers. There can be more than one. */ - - while (!done) - { - switch (**mangled) - { - case 'C': - (*mangled)++; - if (PRINT_ANSI_QUALIFIERS) - { - APPEND_BLANK (result); - string_append (result, "const"); - } - break; - case 'U': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "unsigned"); - break; - case 'S': /* signed char only */ - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "signed"); - break; - case 'V': - (*mangled)++; - if (PRINT_ANSI_QUALIFIERS) - { - APPEND_BLANK (result); - string_append (result, "volatile"); - } - break; - default: - done = 1; - break; - } - } - - /* Now pick off the fundamental type. There can be only one. */ - - switch (**mangled) - { - case '\0': - case '_': - break; - case 'v': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "void"); - break; - case 'x': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "long long"); - break; - case 'l': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "long"); - break; - case 'i': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "int"); - break; - case 's': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "short"); - break; - case 'c': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "char"); - break; - case 'r': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "long double"); - break; - case 'd': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "double"); - break; - case 'f': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "float"); - break; - case 'G': - (*mangled)++; - if (!isdigit (**mangled)) - { - success = 0; - break; - } - /* fall through */ - /* An explicit type, such as "6mytype" or "7integer" */ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - n = consume_count (mangled); - if (strlen (*mangled) < n) - { - success = 0; - break; - } - APPEND_BLANK (result); - string_appendn (result, *mangled, n); - *mangled += n; - break; - default: - success = 0; - break; - } - - return (success); -} - -/* `result' will be initialized in do_type; it will be freed on failure */ - -static int -do_arg (work, mangled, result) - struct work_stuff *work; - const char **mangled; - string *result; -{ - const char *start = *mangled; - - if (!do_type (work, mangled, result)) - { - return (0); - } - else - { - remember_type (work, start, *mangled - start); - return (1); - } -} - -static void -remember_type (work, start, len) - struct work_stuff *work; - const char *start; - int len; -{ - char *tem; - - if (work -> ntypes >= work -> typevec_size) - { - if (work -> typevec_size == 0) - { - work -> typevec_size = 3; - work -> typevec = - (char **) xmalloc (sizeof (char *) * work -> typevec_size); - } - else - { - work -> typevec_size *= 2; - work -> typevec = - (char **) xrealloc ((char *)work -> typevec, - sizeof (char *) * work -> typevec_size); - } - } - tem = (char *) xmalloc (len + 1); - memcpy (tem, start, len); - tem[len] = '\0'; - work -> typevec[work -> ntypes++] = tem; -} - -/* Forget the remembered types, but not the type vector itself. */ - -static void -forget_types (work) - struct work_stuff *work; -{ - int i; - - while (work -> ntypes > 0) - { - i = --(work -> ntypes); - if (work -> typevec[i] != NULL) - { - free (work -> typevec[i]); - work -> typevec[i] = NULL; - } - } -} - -/* Process the argument list part of the signature, after any class spec - has been consumed, as well as the first 'F' character (if any). For - example: - - "__als__3fooRT0" => process "RT0" - "complexfunc5__FPFPc_PFl_i" => process "PFPc_PFl_i" - - DECLP must be already initialised, usually non-empty. It won't be freed - on failure. - - Note that g++ differs significantly from cfront and lucid style mangling - with regards to references to previously seen types. For example, given - the source fragment: - - class foo { - public: - foo::foo (int, foo &ia, int, foo &ib, int, foo &ic); - }; - - foo::foo (int, foo &ia, int, foo &ib, int, foo &ic) { ia = ib = ic; } - void foo (int, foo &ia, int, foo &ib, int, foo &ic) { ia = ib = ic; } - - g++ produces the names: - - __3fooiRT0iT2iT2 - foo__FiR3fooiT1iT1 - - while lcc (and presumably cfront as well) produces: - - foo__FiR3fooT1T2T1T2 - __ct__3fooFiR3fooT1T2T1T2 - - Note that g++ bases it's type numbers starting at zero and counts all - previously seen types, while lucid/cfront bases it's type numbers starting - at one and only considers types after it has seen the 'F' character - indicating the start of the function args. For lucid/cfront style, we - account for this difference by discarding any previously seen types when - we see the 'F' character, and subtracting one from the type number - reference. - - */ - -static int -demangle_args (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - string arg; - int need_comma = 0; - int r; - int t; - const char *tem; - char temptype; - - if (PRINT_ARG_TYPES) - { - string_append (declp, "("); - if (**mangled == '\0') - { - string_append (declp, "void"); - } - } - - while (**mangled != '_' && **mangled != '\0' && **mangled != 'e') - { - if ((**mangled == 'N') || (**mangled == 'T')) - { - temptype = *(*mangled)++; - - if (temptype == 'N') - { - if (!get_count (mangled, &r)) - { - return (0); - } - } - else - { - r = 1; - } - if (!get_count (mangled, &t)) - { - return (0); - } - if (LUCID_DEMANGLING || CFRONT_DEMANGLING) - { - t--; - } - /* Validate the type index. Protect against illegal indices from - malformed type strings. */ - if ((t < 0) || (t >= work -> ntypes)) - { - return (0); - } - while (--r >= 0) - { - tem = work -> typevec[t]; - if (need_comma && PRINT_ARG_TYPES) - { - string_append (declp, ", "); - } - if (!do_arg (work, &tem, &arg)) - { - return (0); - } - if (PRINT_ARG_TYPES) - { - string_appends (declp, &arg); - } - string_delete (&arg); - need_comma = 1; - } - } - else - { - if (need_comma & PRINT_ARG_TYPES) - { - string_append (declp, ", "); - } - if (!do_arg (work, mangled, &arg)) - { - return (0); - } - if (PRINT_ARG_TYPES) - { - string_appends (declp, &arg); - } - string_delete (&arg); - need_comma = 1; - } - } - - if (**mangled == 'e') - { - (*mangled)++; - if (PRINT_ARG_TYPES) - { - if (need_comma) - { - string_append (declp, ","); - } - string_append (declp, "..."); - } - } - - if (PRINT_ARG_TYPES) - { - string_append (declp, ")"); - } - return (1); -} - -static void -demangle_function_name (work, mangled, declp, scan) - struct work_stuff *work; - const char **mangled; - string *declp; - const char *scan; -{ - int i; - int len; - string type; - const char *tem; - - string_appendn (declp, (*mangled), scan - (*mangled)); - string_need (declp, 1); - *(declp -> p) = '\0'; - - /* Consume the function name, including the "__" separating the name - from the signature. We are guaranteed that SCAN points to the - separator. */ - - (*mangled) = scan + 2; - - if (LUCID_DEMANGLING || CFRONT_DEMANGLING) - { - - /* See if we have an ARM style constructor or destructor operator. - If so, then just record it, clear the decl, and return. - We can't build the actual constructor/destructor decl until later, - when we recover the class name from the signature. */ - - if (strcmp (declp -> b, "__ct") == 0) - { - work -> constructor = 1; - string_clear (declp); - return; - } - else if (strcmp (declp -> b, "__dt") == 0) - { - work -> destructor = 1; - string_clear (declp); - return; - } - } - - if (declp->p - declp->b >= 3 - && declp->b[0] == 'o' - && declp->b[1] == 'p' - && strchr (cplus_markers, declp->b[2]) != NULL) - { - /* see if it's an assignment expression */ - if (declp->p - declp->b >= 10 /* op$assign_ */ - && memcmp (declp->b + 3, "assign_", 7) == 0) - { - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - len = declp->p - declp->b - 10; - if (strlen (optable[i].in) == len - && memcmp (optable[i].in, declp->b + 10, len) == 0) - { - string_clear (declp); - string_append (declp, "operator"); - string_append (declp, optable[i].out); - string_append (declp, "="); - break; - } - } - } - else - { - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - int len = declp->p - declp->b - 3; - if (strlen (optable[i].in) == len - && memcmp (optable[i].in, declp->b + 3, len) == 0) - { - string_clear (declp); - string_append (declp, "operator"); - string_append (declp, optable[i].out); - break; - } - } - } - } - else if (declp->p - declp->b >= 5 && memcmp (declp->b, "type$", 5) == 0) - { - /* type conversion operator */ - tem = declp->b + 5; - if (do_type (work, &tem, &type)) - { - string_clear (declp); - string_append (declp, "operator "); - string_appends (declp, &type); - string_delete (&type); - } - } - else if (declp->b[2] == 'o' && declp->b[3] == 'p') - { - /* ANSI. */ - /* type conversion operator. */ - tem = declp->b + 4; - if (do_type (work, &tem, &type)) - { - string_clear (declp); - string_append (declp, "operator "); - string_appends (declp, &type); - string_delete (&type); - } - } - else if (declp->b[0] == '_' && declp->b[1] == '_' - && declp->b[2] >= 'a' && declp->b[2] <= 'z' - && declp->b[3] >= 'a' && declp->b[3] <= 'z') - { - if (declp->b[4] == '\0') - { - /* Operator. */ - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - if (strlen (optable[i].in) == 2 - && memcmp (optable[i].in, declp->b + 2, 2) == 0) - { - string_clear (declp); - string_append (declp, "operator"); - string_append (declp, optable[i].out); - break; - } - } - } - else - { - if (declp->b[2] == 'a' && declp->b[5] == '\0') - { - /* Assignment. */ - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - if (strlen (optable[i].in) == 3 - && memcmp (optable[i].in, declp->b + 2, 3) == 0) - { - string_clear (declp); - string_append (declp, "operator"); - string_append (declp, optable[i].out); - break; - } - } - } - } - } -} - -/* a mini string-handling package */ - -static void -string_need (s, n) - string *s; - int n; -{ - int tem; - - 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) - { - 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; -} - -#if 0 - -static int -string_empty (s) - string *s; -{ - return (s->b == s->p); -} - -#endif - -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) - { - 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) - { - 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') - { - string_prependn (p, s, strlen (s)); - } -} - -#if 0 - -static void -string_prepends (p, s) - string *p, *s; -{ - if (s->b != s->p) - { - 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) - { - 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; - } -} - -/* To generate a standalone demangler program for testing purposes, just - compile and link this file with -DMAIN. When run, it demangles each - command line arg, or each stdin string, and prints the result on stdout. */ - -#ifdef MAIN - -static void -demangle_it (mangled_name) - char *mangled_name; -{ - char *result; - - result = cplus_demangle (mangled_name, DMGL_PARAMS | DMGL_ANSI); - if (result == NULL) - { - printf ("%s\n", mangled_name); - } - else - { - printf ("%s\n", result); - free (result); - } -} - -PTR -xmalloc (size) - long size; -{ - PTR newmem; - - if ((newmem = malloc ((int) size)) == NULL) - { - fprintf (stderr, "\nCan't allocate %u bytes\n", size); - exit (1); - } - return (newmem); -} - -PTR -xrealloc (oldmem, size) - PTR oldmem; - long size; -{ - PTR newmem; - - if ((newmem = realloc ((char *) oldmem, (int) size)) == NULL) - { - fprintf (stderr, "\nCan't reallocate %u bytes\n", size); - exit (1); - } - return (newmem); -} - -#include - -enum demangling_styles current_demangling_style = gnu_demangling; - -main (argc, argv) - int argc; - char **argv; -{ - char mangled_name[128]; - char *result; - int c; - extern char *optarg; - extern int optind; - - while ((c = getopt (argc, argv, "s:?")) != EOF) - { - switch (c) - { - case '?': - fprintf (stderr, "usage: demangle [-s style] [arg1 [arg2]] ...\n"); - fprintf (stderr, "style = { gnu, lucid, cfront }\n"); - fprintf (stderr, "reads args from stdin if none supplied\n"); - exit (0); - break; - case 's': - if (strcmp (optarg, "gnu") == 0) - { - current_demangling_style = gnu_demangling; - } - else if (strcmp (optarg, "lucid") == 0) - { - current_demangling_style = lucid_demangling; - } - else if (strcmp (optarg, "cfront") == 0) - { - current_demangling_style = cfront_demangling; - } - else - { - fprintf (stderr, "unknown demangling style `%s'\n", optarg); - exit (1); - } - break; - } - } - if (optind < argc) - { - for ( ; optind < argc; optind++) - { - demangle_it (argv[optind]); - } - } - else - { - while (gets (mangled_name)) - { - demangle_it (mangled_name); - } - } -} - -#endif /* main */ diff --git a/gdb/demangle.h b/gdb/demangle.h index cc3fc60c0f..e69de29bb2 100644 --- a/gdb/demangle.h +++ b/gdb/demangle.h @@ -1,54 +0,0 @@ -/* Defs for interface to demanglers. - Copyright 1992 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, 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 DMGL_PARAMS (1 << 0) /* Include function args */ -#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ - -/* Enumeration of possible demangling styles. - - Lucid and cfront styles are still kept logically distinct, even though - they now both behave identically. The resulting style is actual the - union of both. I.E. either style recognizes both "__pt__" and "__rf__" - for operator "->", even though the first is lucid style and the second - is cfront/ARM style. (FIXME?) */ - -extern enum demangling_styles -{ - unknown_demangling = 0, - auto_demangling, - gnu_demangling, - lucid_demangling, - cfront_demangling -} current_demangling_style; - -/* Define string names for the various demangling styles. */ - -#define AUTO_DEMANGLING_STYLE_STRING "auto" -#define GNU_DEMANGLING_STYLE_STRING "gnu" -#define LUCID_DEMANGLING_STYLE_STRING "lucid" -#define CFRONT_DEMANGLING_STYLE_STRING "cfront" - -/* Some macros to test what demangling style is active. */ - -#define AUTO_DEMANGLING (current_demangling_style == auto_demangling) -#define GNU_DEMANGLING (current_demangling_style == gnu_demangling) -#define LUCID_DEMANGLING (current_demangling_style == lucid_demangling) -#define CFRONT_DEMANGLING (current_demangling_style == cfront_demangling) - -extern void -set_demangling_style PARAMS ((char *)); diff --git a/gdb/doc/Makefile b/gdb/doc/Makefile index db880a61b7..e69de29bb2 100755 --- a/gdb/doc/Makefile +++ b/gdb/doc/Makefile @@ -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/gdb-all.texi b/gdb/doc/gdb-all.texi index e2162da8a0..e69de29bb2 100755 --- a/gdb/doc/gdb-all.texi +++ b/gdb/doc/gdb-all.texi @@ -1,8437 +0,0 @@ - -\input texinfo @c -*-texinfo-*- -@c Copyright (c) 1988 1989 1990 1991 1992 Free Software Foundation, Inc. -@c %**start of header -@setfilename gdb.info -@settitle Using GDB (v4) -@setchapternewpage odd -@c @smallbook -@c @cropmarks -@c %**end of header - -@finalout -@syncodeindex ky cp - -@c ===> NOTE! <== -@c Determine the edition number in *three* places by hand: -@c 1. First ifinfo section 2. title page 3. top node -@c To find the locations, search for !!set - -@c The following is for Pesch for his RCS system. -@c This revision number *not* the same as the Edition number. -@tex -\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision$} % For use in headers, footers too -@end tex - -@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) - -@c THIS MANUAL REQUIRES TEXINFO-2 macros and info-makers to format properly. - -@ifinfo -@format -START-INFO-DIR-ENTRY -* Gdb: (gdb). The GNU debugger. -END-INFO-DIR-ENTRY -@end format -@end ifinfo -@c -@ifinfo -This file documents the GNU debugger GDB. - -@c !!set edition, date, version -This is Edition 4.01, January 1992, -of @cite{Using GDB: A Guide to the GNU Source-Level Debugger} -for GDB Version 4.4.4. - -Copyright (C) 1988, 1989, 1990, 1991 1992 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 - -@titlepage -@title Using GDB -@subtitle A Guide to the GNU Source-Level Debugger -@sp 1 -@c !!set edition, date, version -@subtitle Edition 4.01, for GDB version 4.4.4 -@subtitle January 1992 -@author by Richard M. Stallman and Roland H. Pesch -@page -@tex -{\parskip=0pt -\hfill rms\@ai.mit.edu, pesch\@cygnus.com\par -\hfill {\it Using GDB}, \manvers\par -\hfill \TeX{}info \texinfoversion\par -} -@end tex - -@vskip 0pt plus 1filll -Copyright @copyright{} 1988, 1989, 1990, 1991, 1992 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 - -@ifinfo -@node Top, Summary, (dir), (dir) -@top GDB, the GNU symbolic debugger - -This file describes GDB, the GNU symbolic debugger. - -@c !!set edition, date, version -This is Edition 4.01, January 1992, for GDB Version 4.4.4. -@end ifinfo - -@menu -* Summary:: Summary of GDB -* New Features:: New features since GDB version 3.5 -* Sample Session:: A Sample GDB session -* Invocation:: Getting in and out of GDB -* Commands:: GDB commands -* Running:: Running programs under GDB -* Stopping:: Stopping and continuing -* Stack:: Examining the stack -* Source:: Examining source files -* Data:: Examining data -* Languages:: Using GDB with different languages -* Symbols:: Examining the symbol table -* Altering:: Altering execution -* GDB Files:: GDB's files -* Targets:: Specifying a debugging target -* Controlling GDB:: Controlling GDB -* Sequences:: Canned sequences of commands -* Emacs:: Using GDB under GNU Emacs -* GDB Bugs:: Reporting bugs in GDB -* Renamed Commands:: -* Installing GDB:: Installing GDB -* Copying:: GNU GENERAL PUBLIC LICENSE -* Index:: Index - - --- The Detailed Node Listing --- - -Summary of GDB - -* Free Software:: Free Software -* Contributors:: Contributors to GDB - -Getting In and Out of GDB - -* Invoking GDB:: Starting GDB -* Leaving GDB:: Leaving GDB -* Shell Commands:: Shell Commands - -Starting GDB - -* File Options:: Choosing Files -* Mode Options:: Choosing Modes - -GDB Commands - -* Command Syntax:: Command Syntax -* Help:: Getting Help - -Running Programs Under GDB - -* 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:: GDB and C -* Debugging C plus plus:: Special features for C++ - -Modula-2 - -* M2 Operators:: Built-in operators -* Built-In 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 your program a Signal -* Returning:: Returning from a Function -* Calling:: Calling your Program's Functions -* Patching:: Patching your Program - -GDB'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:: GDB with a Remote i960 (Nindy) -* EB29K Remote:: GDB with a Remote EB29K -* VxWorks Remote:: GDB and VxWorks - -GDB with a Remote i960 (Nindy) - -* Nindy Startup:: Startup with Nindy -* Nindy Options:: Options for Nindy -* Nindy reset:: Nindy Reset Command - -GDB with a Remote EB29K - -* Comms (EB29K):: Communications Setup -* gdb-EB29K:: EB29K cross-debugging -* Remote Log:: Remote Log - -GDB and VxWorks - -* VxWorks connection:: Connecting to VxWorks -* VxWorks download:: VxWorks Download -* VxWorks attach:: Running Tasks - -Controlling GDB - -* 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 GDB - -* Bug Criteria:: Have You Found a Bug? -* Bug Reporting:: How to Report Bugs - -Installing GDB - -* Separate Objdir:: Compiling GDB in another directory -* 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 GDB - -The purpose of a debugger such as GDB 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. - -GDB 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 GDB 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 - -GDB 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 cannot take these freedoms away -from anyone else. - -For full details, @pxref{Copying, ,GNU GENERAL PUBLIC LICENSE}. - -@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: Stu -Grossman and John Gilmore (release 4.4), John Gilmore (releases 4.3, 4.2, -4.1, 4.0, and 3.9); Jim Kingdon (releases 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 uses the BFD subroutine library to examine multiple -object-file formats; BFD was a joint project of David V. -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 GDB 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; -GDB 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, GDB 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 -GDB 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 -GDB 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 GDB as either a native debugger or a -cross-debugger. @xref{Installing GDB}, for details on how to -configure and on what architectures are now available. - -@item Interaction -The user interface to GDB'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++ -GDB 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}: GDB -can break when an exception is raised, before the stack is peeled back -to the exception handler's context. - -@item 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. Coordinated development of both GDB and the GNU Modula-2 -compiler will continue 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 GDB 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 GDB itself. -@xref{Renamed Commands}, for details on what commands were renamed. - -@item Shared Libraries -GDB 4 can debug programs and core files that use SunOS shared -libraries. - -@item Reference Card -GDB 4 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 GDB Session - -You can use this manual at your leisure to read all about GDB. -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. - -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} built-in @code{defn} to define @code{bar} as the -same thing. However, when we change the open quote string to -@code{} and the close quote string to @code{}, 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(,)} - -@i{define(baz,defn(foo))} -@i{baz} -@i{C-d} -m4: End of input: 0: fatal error: EOF in string -@end smallexample - -@noindent -Let's use GDB to try to see what's going on. - -@smallexample -$ @i{gdb 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 4.4.4, Copyright 1992 Free Software Foundation, Inc... -(gdb) -@end smallexample - -@noindent -GDB 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 now -tell GDB to use a narrower display width than usual, so that examples -will fit in this manual. - -@smallexample -(gdb) @i{set width 70} -@end smallexample - -@noindent -Let's see how the @code{m4} built-in @code{changequote} works. -Having looked at the source, we know the relevant subroutine is -@code{m4_changequote}, so we set a breakpoint there with GDB's -@code{break} command. - -@smallexample -(gdb) @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 GDB -control; as long as control does not reach the @code{m4_changequote} -subroutine, the program runs as usual: - -@smallexample -(gdb) @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}. GDB -suspends execution of @code{m4}, displaying information about the -context where it stops. - -@smallexample -@i{changequote(,)} - -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 -(gdb) @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 -(gdb) @i{s} -set_quotes (lq=0x34c78 "", rq=0x34c88 "") - at input.c:530 -530 if (lquote != def_lquote) -@end smallexample - -@noindent -The display that shows the subroutine where @code{m4} is now -suspended (and its arguments) is called a stack frame display. It -shows a summary of the stack. We can use the @code{backtrace} -command (which can also be spelled @code{bt}), to see where we are -in the stack as a whole: the @code{backtrace} command displays a -stack frame for each active subroutine. - -@smallexample -(gdb) @i{bt} -#0 set_quotes (lq=0x34c78 "", rq=0x34c88 "") - 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 -(gdb) @i{s} -0x3b5c 532 if (rquote != def_rquote) -(gdb) @i{s} -0x3b80 535 lquote = (lq == nil || *lq == '\0') ? \ -def_lquote : xstrdup(lq); -(gdb) @i{n} -536 rquote = (rq == nil || *rq == '\0') ? def_rquote\ - : xstrdup(rq); -(gdb) @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 -(gdb) @i{p lquote} -$1 = 0x35d40 "" -(gdb) @i{p rquote} -$2 = 0x35d50 "" -@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 -(gdb) @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 -(gdb) @i{n} -539 len_rquote = strlen(lquote); -(gdb) @i{n} -540 @} -(gdb) @i{p len_lquote} -$3 = 9 -(gdb) @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 -(gdb) p @i{len_lquote=strlen(lquote)} -$5 = 7 -(gdb) p @i{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 -(gdb) @i{c} -Continuing. - -@i{define(baz,defn(foo))} - -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 GDB; it -indicates @code{m4} has finished executing. We can end our GDB -session with the GDB @code{quit} command. - -@smallexample -(gdb) @i{quit} -@end smallexample - -@node Invocation, Commands, Sample Session, Top -@chapter Getting In and Out of GDB - -This chapter discusses how to start GDB, and how to get out of it. -(The essentials: type @samp{gdb} to start GDB, and type @kbd{quit} -or @kbd{C-d} to exit.) - -@menu -* Invoking GDB:: Starting GDB -* Leaving GDB:: Leaving GDB -* Shell Commands:: Shell Commands -@end menu - -@node Invoking GDB, Leaving GDB, Invocation, Invocation -@section Starting GDB - -Start GDB with the shell command @code{gdb}. Once it's running, -GDB reads commands from the terminal until you tell it to exit. - -You can also run @code{gdb} with a variety of arguments and options, -to specify more of your debugging environment at the outset. - -The command-line options described here are designed -to cover a variety of situations; in some environments, some of these -options may effectively be unavailable. - - -The most usual way to start GDB is with one argument or two, -specifying an executable program as the argument: - -@example -gdb @var{program} -@end example - -@noindent -You can also start with both an executable program and a core file -specified: - -@example -gdb @var{program} @var{core} -@end example - -You can, instead, specify a process ID as a second argument, if you want -to debug a running process: - -@example -gdb @var{program} 1234 -@end example - -@noindent -would attach GDB to process @code{1234} (unless you also have a file -named @file{1234}; GDB does check for a core file first). - -Taking advantage of the second command-line argument requires a fairly -complete operating system; when you use GDB as a remote debugger -attached to a bare board, there may not be any notion of ``process'', -and there is often no way to get a core dump. - -@noindent -You can further control how GDB starts up by using command-line -options. GDB itself can remind you of the options available. - -@noindent -Type - -@example -gdb -help -@end example - -@noindent -to display all available options and briefly describe their use -(@samp{gdb -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 -@end menu - -@node File Options, Mode Options, Invoking GDB, Invoking GDB -@subsection Choosing Files - -When GDB starts, it reads any arguments other than options as -specifying an executable file and core file (or process ID). This is -the same as if the arguments were specified by the @samp{-se} and -@samp{-c} options respectively. (GDB reads the first argument -that does not have an associated option flag as equivalent to the -@samp{-se} option followed by that argument; and the second argument -that does not have an associated option flag, if any, as equivalent to -the @samp{-c} option followed by that argument.) - -Many options have both long and short forms; both are shown in the -following list. GDB also recognizes the long forms 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 GDB 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 - -@node Mode Options, , File Options, Invoking GDB -@subsection Choosing Modes - -You can run GDB in various alternative modes---for example, in -batch mode or quiet mode. - -@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 GDB -commands in the command files. - -Batch mode may be useful for running GDB 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 GDB control -terminates) is not issued when running in batch mode. - -@item -cd=@var{directory} -Run GDB using @var{directory} as its working directory, -instead of the current directory. - -@item -fullname -@itemx -f -Emacs sets this option when it runs GDB as a subprocess. It tells GDB -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 your 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-GDB 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 GDB for remote debugging. - -@item -tty=@var{device} -Run using @var{device} for your program's standard input and output. -@c FIXME: kingdon thinks there is more to -tty. Investigate. -@end table - -@node Leaving GDB, Shell Commands, Invoking GDB, Invocation -@section Leaving GDB -@cindex exiting GDB - -@table @code -@item quit -@kindex quit -@kindex q -To exit GDB, 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 GDB, but rather -will terminate the action of any GDB command that is in progress and -return to GDB command level. It is safe to type the interrupt -character at any time because GDB does not allow it to take effect -until a time when it is safe. - -If you have been using GDB to control an attached process or device, you -can release it with the @code{detach} command; @pxref{Attach, -,Debugging an Already-Running Process}.. - -@node Shell Commands, , Leaving GDB, Invocation -@section Shell Commands - -If you need to execute occasional shell commands during your -debugging session, there is no need to leave or suspend GDB; you can -just use the @code{shell} command. - -@table @code -@item shell @var{command string} -@kindex shell -@cindex shell escape -Directs GDB 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 GDB uses -@code{/bin/sh}. -@end table - -The utility @code{make} is often needed in development environments. -You do not have to use the @code{shell} command for this purpose in GDB: - -@table @code -@item make @var{make-args} -@kindex make -@cindex calling make -Causes GDB 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 GDB Commands - -You can abbreviate GDB command if that abbreviation is unambiguous; -and you can repeat certain GDB commands by typing just @key{RET}. - -@menu -* Command Syntax:: Command Syntax -* Help:: Getting Help -@end menu - -@node Command Syntax, Help, Commands, Commands -@section Command Syntax - -A GDB 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 -GDB 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 GDB (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. - -GDB 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 is easy to press one @key{RET} too many -in this situation, GDB 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 (@pxref{Command Files}). - -@node Help, , Command Syntax, Commands -@section Getting Help -@cindex online documentation -@kindex help - -You can always ask GDB 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 -(gdb) 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. -(gdb) -@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 -(gdb) 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. -(gdb) -@end smallexample - -@item help @var{command} -With a command name as @code{help} argument, GDB will display a -short paragraph on how to use that command. -@end table - -In addition to @code{help}, you can use the GDB commands @code{info} -and @code{show} to inquire about the state of your program, or the state -of GDB 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. @xref{Index}. - -@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 have 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 GDB 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 GDB is running. You should include this -information in GDB bug-reports. If multiple versions of GDB are in -use at your site, you may occasionally want to make sure what version -of GDB you are running; as GDB evolves, new commands are introduced, -and old ones may wither away. The version number is also announced -when you start GDB with no arguments. - -@kindex show copying -@item show copying -Display information about permission for copying GDB. - -@kindex show warranty -@item show warranty -Display the GNU ``NO WARRANTY'' statement. -@end table - -@node Running, Stopping, Commands, Top -@chapter Running Programs Under GDB - -To debug a program, you must run it under GDB. - -@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. - -gcc, 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 your program is correct, but there is 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 -@w{@samp{-gg}} for debugging information. GDB 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 GDB 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, GDB will get -confused reading your program's symbol table. No error message will be -given, but GDB 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 GDB. You must -first specify the program name -(except on VxWorks) -with an argument to -GDB (@pxref{Invocation, ,Getting In and Out of GDB}), or by using the -@code{file} or @code{exec-file} command (@pxref{Files, ,Commands to -Specify Files}). - -@end table - -If you are running your program in an execution environment that -supports processes, @code{run} creates an inferior process and makes -that process run your program. (In environments without processes, -@code{run} jumps to the start of your program.) - -The execution of a program is affected by certain information it -receives from its superior. GDB provides ways to specify this -information, which you must do @i{before} starting your program. (You -can change it after starting your program, but such changes will only affect -your program the next time you start it.) This information may be -divided into four categories: - -@table @asis -@item The @i{arguments.} -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, ,Your -Program's Arguments}. - -@item The @i{environment.} -Your program normally inherits its environment from GDB, but you can -use the GDB commands @code{set environment} and @code{unset -environment} to change parts of the environment that will be given to -your program. @xref{Environment, ,Your Program's Environment}. - -@item The @i{working directory.} -Your program inherits its working directory from GDB. You can set -GDB's working directory with the @code{cd} command in GDB. -@xref{Working Directory, ,Your Program's Working Directory}. - -@item The @i{standard input and output.} -Your program normally uses the same device for standard input and -standard output as GDB 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, ,Your Program's Input and Output}. - -@cindex pipes -@emph{Warning:} While input and output redirection work, you cannot use -pipes to pass the output of the program you are debugging to another -program; if you attempt this, GDB is likely to wind up debugging the -wrong program. -@end table - -@c FIXME: Rewrite following paragraph, especially its third sentence. -When you issue the @code{run} command, your program begins to execute -immediately. @xref{Stopping, ,Stopping and Continuing}, 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 your -program, using the @code{print} or @code{call} commands. @xref{Data, -,Examining Data}. - -If the modification time of your symbol file has changed since the -last time GDB read its symbols, GDB will discard its symbol table and -re-read it. When it does this, GDB 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 your program. -GDB uses the shell indicated by your environment variable -@code{SHELL} if it exists; otherwise, GDB 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 your program with a modified -environment without having to start GDB 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 GDB 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 GDB searches the path. If you use -@samp{.} instead, it refers to the directory where you executed the -@code{path} command. GDB 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 is 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 do not 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 GDB 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 does not 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 GDB. GDB's -working directory is initially whatever it inherited from its parent -process (typically the shell), but you can specify a new working -directory in GDB with the @code{cd} command. - -The GDB working directory also serves as a default for the commands -that specify files for GDB to operate on. @xref{Files, ,Commands to -Specify Files}. - -@table @code -@item cd @var{directory} -@kindex cd -Set GDB's working directory to @var{directory}. - -@item pwd -@kindex pwd -Print GDB'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 GDB does input and output to -the same terminal that GDB uses. GDB 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 GDB's recorded information about the terminal modes your -program is using. -@end table - -You can redirect your program's input and/or output using shell -redirection with the @code{run} command. For example, - -@example -run > outfile -@end example - -@noindent -starts your program, diverting its output to the file @file{outfile}. - -@kindex tty -@cindex controlling terminal -Another way to specify where your 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 GDB 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 GDB. -(@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 GDB -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, ,Commands to Specify Files}. - -The first thing GDB does after arranging to debug the specified -process is to stop it. You can examine and modify an attached process -with all the GDB 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 GDB 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 GDB's control. Detaching -the process continues its execution. After the @code{detach} command, -that process and GDB 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 GDB 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, ,Optional Warnings and Messages}). - -@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 GDB. -@end table - -This command is useful if you wish to debug a core dump instead of a -running process. GDB ignores any core dump file while your program -is running. -@c @end group - -On some operating systems, a program cannot be executed outside GDB -while you have breakpoints set on it inside GDB. You can use the -@code{kill} command in this situation to permit running your program -outside the debugger. - -The @code{kill} command is also useful if you wish to recompile and -relink your 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}, GDB 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 your program runs into -trouble, you can investigate and find out why. - -Inside GDB, your program may stop for any of several reasons, such -as a signal, a breakpoint, or reaching a new line after a GDB -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 GDB 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 your program will stop. -You can set breakpoints with the @code{break} command and its variants -(@pxref{Set Breaks, ,Setting Breakpoints}), to specify the place where -your 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, ,Breakpoints and Exceptions}). - -@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, ,Setting -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 your 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 your 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 your 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, ,Examining the Stack}). In any selected frame but the -innermost, this will cause your 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} does not leave an active breakpoint. If you use -@code{break} without an argument in the innermost frame, GDB will stop -the next time it reaches the current location; this may be useful -inside loops. - -GDB 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 your 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, -,Break 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 after the first time your -program stops there. @xref{Disabling, ,Disabling Breakpoints}. - -@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 your 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, ,Examining Memory}). The equivalent command -for watchpoints is @code{info watch}. -@end table - -GDB allows you to set any number of breakpoints at the same place in -your program. There is nothing silly or meaningless about this. When -the breakpoints are conditional, this is even useful -(@pxref{Conditions, ,Break 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 GDB 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 GDB to examine what caused your program to raise an exception, -and to list the exceptions your 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. -@xref{Frame Info, ,Information About a Frame}. - -There are currently some limitations to exception handling in GDB. -These will be corrected in a future release. - -@itemize @bullet -@item -If you call a function interactively, GDB 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 you and cause your program to simply continue -running until it hits a breakpoint, catches a signal that GDB 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 is 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, ,Breakpoints Watchpoints and Exceptions}). - -With a conditional breakpoint (@pxref{Conditions, ,Break 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 your 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 your 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 your 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. GDB -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, ,Selecting a Frame}). When -the innermost frame is selected, this is a good way to delete a -breakpoint where your program just stopped. - -@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 (GDB -asks confirmation, unless you have @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 -do not 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 your program. A breakpoint set -with the @code{break} command starts out in this state. -@item -Disabled. The breakpoint has no effect on your program. -@item -Enabled once. The breakpoint will stop your 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 your 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 your 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 your 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 your program. -@end table - -Save for a breakpoint set with @code{tbreak} (@pxref{Set Breaks, -,Setting Breakpoints}), 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; see @ref{Continuing and Stepping, ,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 your 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 (@pxref{Expressions, ,Expressions}). A breakpoint with -a condition evaluates the expression each time your program reaches it, -and your 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 can 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, GDB might see the other breakpoint first and stop your -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, ,Breakpoint Command Lists}). - -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, ,Setting Breakpoints}. They can also be changed at any time -with the @code{condition} command. The @code{watch} command does not -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 -your program only if the value of @var{expression} is true (nonzero, in -C). When you use @code{condition}, GDB 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 is no referent? Moreover, what -@c about watchpoints? -GDB does -not actually evaluate @var{expression} at the time the @code{condition} -command is given, however. @xref{Expressions, ,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 your 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, GDB -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 your program, setting the ignore count of the -breakpoint where your program stopped to @var{count} minus one. -Thus, your 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 your 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 @w{@samp{$foo-- <= 0}} using a debugger convenience variable that -is decremented each time. @xref{Convenience Vars, ,Convenience -Variables}. - -@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 your 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 GDB command is -disabled within a @var{command-list}. - -You can use breakpoint commands to start your 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, ,Commands for Controlled 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. - -@example -break foo if x>0 -commands -silent -echo x is\040 -output x -echo \n -cont -end -@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 your 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. -GDB 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 (@pxref{Expressions, ,Expressions}) that will -change @code{x} as needed, then always have the value zero so your -program will not stop. No input is lost here, because GDB 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 GDB where you -want a breakpoint. GDB 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 -(gdb) 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. -(gdb) -@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 GDB -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 GDB, and copy the file containing your program to a new name. -Resume GDB and use the @code{exec-file} command to specify that GDB -should run your program under that name. Then start your program again. - -@c FIXME: RMS commented here "Show example". Maybe when someone -@c explains the first FIXME: in this section... - -@item -Relink your 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, your 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. @xref{Signals, ,Signals}.) - -@table @code -@item continue @r{[}@var{ignore-count}@r{]} -@kindex continue -Resume program execution, at the address where your 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, ,Break Conditions}). - -To resume execution at a different place, you can use @code{return} -(@pxref{Returning, ,Returning from a Function}) to go back to the -calling function; or @code{jump} (@pxref{Jumping, ,Continuing at a -Different Address}) to go to an arbitrary location in your program. -@end table - -A typical technique for using stepping is to set a breakpoint -(@pxref{Breakpoints, ,Breakpoints Watchpoints and Exceptions}) at the -beginning of the function or the section of your program where a -problem is believed to lie, run your 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 your program until control reaches a different source -line, then stop it and return control to GDB. 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, -,Returning from a Function}). - -@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 your 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 your 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 -(gdb) f -#0 main (argc=4, argv=0xf7fffae8) at m4.c:206 -206 expand_input(); -(gdb) 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 your 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, -,Setting Breakpoints}). 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, -,Automatic 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 your program has -requested an alarm). - -@cindex fatal signals -Some signals, including @code{SIGALRM}, are a normal part of the -functioning of your program. Others, such as @code{SIGSEGV}, indicate -errors; these signals are @dfn{fatal} (kill your 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 your program, but it is normally -fatal so it can carry out the purpose of the interrupt: to kill the program. - -GDB has the ability to detect any occurrence of a signal in your -program. You can tell GDB in advance what to do for each kind of -signal. - -@cindex handling signals -Normally, GDB is set up to ignore non-erroneous signals like @code{SIGALRM} -(so as not to interfere with their role in the functioning of your program) -but to stop your 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 GDB 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 GDB 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 -GDB should not stop your program when this signal happens. It may -still print a message telling you that the signal has come in. - -@item stop -GDB should stop your program when this signal happens. This implies -the @code{print} keyword as well. - -@item print -GDB should print a message when this signal happens. - -@item noprint -GDB should not mention the occurrence of the signal at all. This -implies the @code{nostop} keyword as well. - -@item pass -GDB should allow your program to see this signal; your program will be -able to handle the signal, or may be terminated if the signal is fatal -and not handled. - -@item nopass -GDB should not allow your program to see this signal. -@end table -@c @end group - -When a signal has been set to stop your program, your 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 GDB 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 -your program when you later continue it. - -You can also use the @code{signal} command to prevent your 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 your 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 your program would probably terminate immediately as -a result of the fatal signal once it saw the signal. To prevent this, -you can continue with @samp{signal 0}. @xref{Signaling, ,Giving your -Program a Signal}. - -@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 your 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 GDB 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 GDB and many GDB commands -refer implicitly to the selected frame. In particular, whenever you ask -GDB for the value of a variable in your program, the value is found in the -selected frame. There are special GDB commands to select whichever frame -you are interested in. - -When your program stops, GDB automatically selects the currently executing -frame and describes it briefly as the @code{frame} command does -(@pxref{Frame Info, ,Information About a Frame}). - -@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 -GDB 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 GDB to give you a way of designating stack -frames in GDB 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. GDB has limited facilities for dealing with -these function invocations. If the innermost function invocation has no -stack frame, GDB 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, GDB has no provision -for frameless functions elsewhere in the stack. - -@node Backtrace, Selection, Frames, Stack -@section Backtraces - -A backtrace is a summary of how your 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 does not begin with a program counter -value, indicating that your 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 your 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 GDB to assign numbers properly to all frames. In -addition, this can be useful when your program has multiple stacks and -switches between them. - -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. - -@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 -@group -(gdb) up -#1 0x22f0 in main (argc=1, argv=0xf7fffbf4, env=0xf7fffbfc) - at env.c:10 -10 read_input_file (argv[i]); -@end group -@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, ,Printing Source Lines}. - -@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 GDB 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, ,Selecting a Frame}). - -@item info frame -@itemx info f -@kindex info frame -@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, ,Breakpoints and Exceptions}. -@end table - -@node Source, Data, Stack, Top -@chapter Examining Source Files - -GDB can print parts of your program's source, since the debugging -information recorded in your program tells GDB what source files were -used to build it. When your program stops, GDB spontaneously prints -the line where it stopped. Likewise, when you select a stack frame -(@pxref{Selection, ,Selecting a Frame}), GDB prints the line where -execution in that frame has stopped. You can print other portions of -source files by explicit command. - -If you use GDB through its GNU Emacs interface, you may prefer to use -Emacs facilities to view source; @pxref{Emacs, ,Using GDB under GNU -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, ,Examining the -Stack}), this prints lines centered around that line. - -@item list - -Print lines just before the lines last printed. -@end table - -By default, GDB 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 use -synonym @samp{search @var{regexp}} or abbreviate the command name as -@code{fo}. - -@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. GDB has a list of directories to search for source files; -this is called the @dfn{source path}. Each time GDB 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 GDB cannot find a source file in the source path, and the object -program records a directory, GDB tries that directory too. If the -source path is empty, and there is no record of the compilation -directory, GDB will, as a last resort, look in the current -directory. - -Whenever you reset or rearrange the source path, GDB 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 GDB, 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 GDB -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 do not 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, GDB 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, ,Printing -Source Lines}). -@end table - -For example, we can use @code{info line} to discover the location of -the object code for the first line of function -@code{m4_changequote}: - -@smallexample -(gdb) 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 -(gdb) 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, -,Examining Memory}). Also, this address is saved as the value of the -convenience variable @code{$_} (@pxref{Convenience Vars, ,Convenience -Variables}). - -@table @code -@kindex disassemble -@item disassemble -This specialized command dumps 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 specify a range of addresses (first -inclusive, second exclusive) to dump. -@end table - -We can use @code{disassemble} to inspect the object code -range shown in the last @code{info line} example: - -@smallexample -(gdb) 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. -@end smallexample - -@node Data, Languages, Source, Top -@chapter Examining Data - -@cindex printing data -@cindex examining data -@kindex print -@kindex inspect -@c "inspect" is not quite a synonym if you are using Epoch, which we do not -@c document because it is 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, ,Using GDB with Different -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}, GDB displays the last value again (from the -@dfn{value history}; @pxref{Value History, ,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, ,Examining Memory}. - -If you are 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, ,Examining the Symbol Table}. - -@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 GDB 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 -GDB. 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 GDB with Different -Languages}, for information on how to use expressions in other -languages. - -In this section, we discuss operators that you can use in GDB -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? - -GDB 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, ,Artificial 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, ,Program 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}. -@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, ,Selecting a Frame}); 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 your program is executing -within the function @code{foo}, but the variable @code{b} is visible -only while your 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 -@iftex -@c info cannot cope with a :: index entry, but why deprive hard copy readers? -@kindex :: -@end iftex -@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++. GDB also supports use of the C++ -scope resolution operator in GDB 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 are -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 are 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, ,Value History}), after printing one out.) - -Sometimes the artificial array mechanism is not quite enough; in -moderately complex data structures, the elements of interest may not -actually be adjacent---for example, if you are 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, ,Convenience -Variables}) 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 are interested in the values of a field @code{fv} -in each structure. Here is 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, GDB 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 -(gdb) p/a 0x54320 -$3 = 0x54320 <_initialize_vx+396> -@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 GDB 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 - -You can use the command @code{x} (for ``examine'') to examine memory in -any of several formats, independently of your program's data types. - -@cindex examining memory -@table @code -@kindex x -@item x/@var{nfu} @var{addr} -@itemx x @var{addr} -@itemx x -Use the command @code{x} to examine memory. -@end table - -@var{n}, @var{f}, and @var{u} are all optional parameters that 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}. - -@table @r -@item @var{n}, the repeat count -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. - -@item @var{f}, the display format -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}. - -@item @var{u}, the unit size -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 - -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.) - -@item @var{addr}, starting display address -@var{addr} is the address where you want GDB 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, ,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). -@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 do not 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 have 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, GDB 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 GDB will print its value each time your 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 your program stops. @xref{Expressions, ,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 your program stops. Examining means in effect -doing @samp{x/@var{fmt} @var{addr}}. @xref{Memory, ,Examining 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 your 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 your 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 -GDB 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 -GDB 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 -@group -(gdb) f -#0 set_quotes (lq=0x34c78 "<<", rq=0x34c88 ">>") - at input.c:530 -530 if (lquote != def_lquote) -@end group -@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 -@group -(gdb) set print addr off -(gdb) f -#0 set_quotes (lq="<<", rq=">>") at input.c:530 -530 if (lquote != def_lquote) -@end group -@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 -GDB 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 GDB 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 GDB will print -before losing patience. - -@item set print pretty on -@kindex set print pretty -Cause GDB to print structures in an indented format with one member per -line, like this: - -@example -@group -$1 = @{ - next = 0x0, - flags = @{ - sweet = 1, - sour = 1 - @}, - meat = 0x54 "Pork" -@} -@end group -@end example - -@item set print pretty off -Cause GDB to print structures in a compact format, like this: - -@smallexample -@group -$1 = @{next = 0x0, flags = @{sweet = 1, sour = 1@}, meat \ -= 0x54 "Pork"@} -@end group -@end smallexample - -@noindent -This is the default format. - -@item show print pretty -@kindex show print pretty -Show which format GDB 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, -GDB 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 GDB will print only seven-bit characters. - -@item set print union on -@kindex set print union -Tell GDB to print unions which are contained in structures. This is the -default setting. - -@item set print union off -Tell GDB not to print unions which are contained in structures. - -@item show print union -@kindex show print union -Ask GDB 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 GDB'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 -GDB provides @dfn{convenience variables} that you can use within -GDB to hold on to a value and refer to it later. These variables -exist entirely within GDB; they are not part of your program, and -setting a convenience variable has no direct effect on further execution -of your program. That is 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, ,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: - -@example -set $i = 0 -print bar[$i++]->contents -@i{@dots{} repeat that command by typing @key{RET}.} -@end example - -Some convenience variables are created automatically by GDB 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, ,Examining 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 - -GDB has four ``standard'' register names that are available (in -expressions) on most machines---whenever they do not 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, ,Returning from a Function}.} 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}. - -GDB 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, GDB 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, ,Selecting a Frame}). 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, GDB must deduce where registers are saved, from the machine -code generated by your compiler. If some registers are not saved, or if -GDB 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, GDB 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 GDB 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 GDB for some languages, -allowing you to express operations like the above in your program's -native language, and allowing GDB to output values in a manner -consistent with the syntax of your program's native language. The -language you use to build expressions, called the @dfn{working -language}, can be selected manually, or GDB 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 GDB -set it automatically, or select it manually yourself. You can use the -@code{set language} command for either purpose. On startup, GDB -defaults to setting the language automatically. - -@menu -* Manually:: Setting the working language manually -* Automatically:: Having GDB 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 GDB 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 GDB 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 GDB 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 GDB infer the source language - -To have GDB set the working language automatically, use @samp{set -language local} or @samp{set language auto}. GDB 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), GDB 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 GDB 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 your 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 GDB 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 your program is running. - -GDB can check for conditions like the above if you wish. -Although GDB will not check the statements in your program, it -can check expressions entered directly into GDB for evaluation via -the @code{print} command, for example. As with the working language, -GDB can also decide whether or not to check automatically based on -your program's source language. @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 -@exdent but -@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 GDB commands, you can tell the GDB -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, GDB 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 GDB from evaluating an expression. For instance, GDB 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 further -details on specific languages. - -GDB 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, GDB 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, GDB cannot add -numbers and structures. - -@item show type -Show the current setting of the type checker, and whether or not GDB 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 GDB commands, you can tell GDB 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. - -GDB 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 GDB 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 GDB. -@end table - -@node Support, , Checks, Languages -@section Supported Languages - -GDB 4 supports C, C++, and Modula-2. The syntax for C and C++ is so -closely related that GDB does not distinguish the two. Some GDB -features may be used in expressions regardless of the language you -use: the GDB @code{@@} and @code{::} operators, and the -@samp{@{type@}addr} construct (@pxref{Expressions, ,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 GDB. These sections are -not meant to be language tutorials or references, but serve only as a -reference guide to what the GDB 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, GDB does not distinguish -between them when interpreting the expressions recognized in GDB -commands. - -@cindex C++ -@kindex g++ -@cindex GNU C++ -The C++ debugging facilities are jointly implemented by the GNU C++ -compiler and GDB. 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:: GDB 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 -@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 @w{@code{@var{a} @var{op}= @var{b}}}, -and translated to @w{@code{@var{a} = @var{a op b}}}. -@w{@code{@var{op}=}} 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 @sc{or}. Defined on integral types. - -@item && -Logical @sc{and}. Defined on integral types. - -@item | -Bitwise @sc{or}. Defined on integral types. - -@item ^ -Bitwise exclusive-@sc{or}. Defined on integral types. - -@item & -Bitwise @sc{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 GDB ``artificial array'' operator (@pxref{Expressions, ,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, -GDB 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 GDB scope operator (@pxref{Expressions, ,Expressions}). Same precedence as -@code{::}, above. -@end table - -@cindex C and C++ constants -@node C Constants, Cplusplus expressions, C Operators, C -@subsubsection C and C++ Constants - -GDB 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 a letter -@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++ -GDB'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, GDB 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; GDB 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. -GDB will not perform conversions requiring constructors or -user-defined type operators. - -@cindex reference declarations -@item -GDB 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 GDB 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 have specified @samp{set print address off}. - -@item -GDB 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}}. GDB also allows -resolving name scope by reference to source files, in both C and C++ -debugging (@pxref{Variables, ,Program Variables}). -@end enumerate - -@node C Defaults, C Checks, Cplusplus expressions, C -@subsubsection C and C++ Defaults -@cindex C and C++ defaults - -If you allow GDB 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 GDB, -selected the working language. - -If you allow GDB 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 GDB 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, GDB does not yet perform type or -range checking. -@end quotation -@c FIXME remove warning when type/range checks added - -By default, when GDB parses C or C++ expressions, type checking -is not used. However, if you turn type checking on, GDB 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 GDB 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, ,Expressions}) - -@node Debugging C plus plus, , Debugging C, C -@subsubsection GDB Commands for C++ - -@cindex commands for C++ -Some GDB 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, -GDB'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, ,Setting Breakpoints}. - -@cindex C++ exception handling -@item catch @var{exceptions} -@itemx info catch -Debug C++ exception handling using these commands. @xref{Exception -Handling, ,Breakpoints and Exceptions}. - -@cindex inheritance -@item ptype @var{typename} -Print inheritance relationships as well as other information for type -@var{typename}. -@xref{Symbols, ,Examining the Symbol Table}. - -@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, ,Print Settings}. - -@item set print object -@itemx show print object -Choose whether to print derived (actual) or declared types of objects. -@xref{Print Settings, ,Print Settings}. - -@item set print vtbl -@itemx show print vtbl -Control the format for printing virtual function tables. -@xref{Print Settings, ,Print Settings}. -@end table - -@node Modula-2, , C, Support -@subsection Modula-2 -@cindex Modula-2 - -The extensions made to GDB 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 GDB reads in the executable's symbol table. - -@cindex expressions in Modula-2 -@menu -* M2 Operators:: Built-in operators -* Built-In 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 -@end menu - -@node M2 Operators, Built-In 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 -@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 GDB 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 GDB ``artificial array'' operator (@pxref{Expressions, ,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{, }. -GDB and Modula-2 scope operators. -@end table - -@quotation -@emph{Warning:} Sets and their operations are not yet supported, so GDB -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 - -@cindex Modula-2 built-ins -@node Built-In 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 -GDB 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, Built-In Func/Proc, Modula-2 -@subsubsection Constants - -GDB 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, ,C and 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 GDB, they -both default to @code{on} whenever the working language changes to -Modula-2. This happens regardless of whether you, or GDB, -selected the working language. - -If you allow GDB 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 GDB 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. GDB 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 built-in 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, GDB does not yet perform type or -range checking. -@end quotation -@c FIXME remove warning when type/range checks added - -GDB 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 built-in functions and procedures. - -@node M2 Scope, GDB/M2, M2 Checks, Modula-2 -@subsubsection The scope operators @code{::} and @code{.} -@cindex scope -@kindex . -@cindex colon, doubled as scope operator -@ifinfo -@kindex colon-colon -@c Info cannot handoe :: but TeX can. -@end ifinfo -@iftex -@kindex :: -@end iftex - -There are a few subtle differences between the Modula-2 scope operator -(@code{.}) and the GDB 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 declared -identifier within your program, except another module. - -Using the @code{::} operator makes GDB search the scope -specified by @var{scope} for the identifier @var{id}. If it is not -found in the specified scope, then GDB will search all scopes -enclosing the one specified by @var{scope}. - -Using the @code{.} operator makes GDB 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 GDB and Modula-2 - -Some GDB 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, ,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, ,Expressions}) - -@cindex @code{#} in Modula-2 -In GDB scripts, the Modula-2 inequality operator @code{#} is -interpreted as the beginning of a comment. Use @code{<>} instead. - -@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 your program executes. GDB finds it in your -program's symbol table, in the file indicated when you started GDB -(@pxref{File Options, ,Choosing Files}), or by one of the -file-management commands (@pxref{Files, ,Commands to Specify 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, ,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}}. - -@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 -@group -(gdb) whatis v -type = struct complex -(gdb) ptype v -type = struct complex @{ - double real; - double imag; -@} -@end group -@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 your 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 GDB symbol-reading code. Only -symbols with debugging data are included. If you use @code{printsyms}, -GDB includes all the symbols for which it has already collected full -details: that is, @var{filename} reflects symbols for only those files -whose symbols GDB 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 -GDB only knows partially---that is, symbols defined in files that -GDB has skimmed, but not yet read completely. The description of -@code{symbol-file} describes how GDB reads symbols; both commands -are described under @ref{Files, ,Commands to Specify Files}. -@end table - -@node Altering, GDB Files, Symbols, Top -@chapter Altering Execution - -Once you think you have found an error in your 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 GDB features for altering execution of the -program. - -For example, you can store new values into variables or memory -locations, give your 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 your 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, ,Expressions}. For example, - -@example -print x=4 -@end example - -@noindent -stores the value 4 into the variable @code{x}, and then prints the -value of the assignment expression (which is 4). @xref{Languages, -,Using GDB with Different 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, ,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} did not happen to be a GDB command: - -@example -(gdb) whatis width -type = double -(gdb) p width -$4 = 13 -(gdb) 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 -(gdb) set var width=47 -@end example - -GDB allows more implicit conversions in assignments than C; 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, ,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 your 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, ,Printing -Source Lines}, 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 your 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 your 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 @code{0x485}, rather than at the address where your program stopped. -@xref{Continuing and Stepping, ,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 your program a Signal - -@table @code -@item signal @var{signalnum} -@kindex signal -Resume execution where your 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 your 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}, GDB 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, ,Selecting a -Frame}), 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, ,Continuing and Stepping}) resumes execution until the -selected stack frame returns naturally. - -@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, GDB 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}, GDB will open executable and -core files for both reading and writing; if you specify @samp{set write -off} (the default), GDB will open them read-only. - -If you have 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 GDB Files, Targets, Altering, Top -@chapter GDB's Files - -GDB 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 your program. To -debug a core dump of a previous run, GDB must be told the file name of -the core dump. - -@menu -* Files:: Commands to Specify Files -* Symbol Errors:: Errors Reading Symbol Files -@end menu - -@node Files, Symbol Errors, GDB Files, GDB Files -@section Commands to Specify Files -@cindex core dump file -@cindex symbol table - -The usual way to specify executable and core dump file names is with -the command arguments given when you start GDB, (@pxref{Invocation, -,Getting In and Out of GDB}. - -Occasionally it is necessary to change to a different file during a -GDB session. Or you may run GDB and forget to specify the files you -want to use. In these situations the GDB 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 GDB's working directory, GDB -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 GDB and your program, -using the @code{path} command. - -@item file -@code{file} with no argument makes GDB 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}. GDB will search the environment variable @code{PATH} -if necessary to locate your 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 GDB's information on your -program's symbol table. - -The @code{symbol-file} command causes GDB 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 GDB. - -@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, -as they are needed. - -The purpose of this two-stage reading strategy is to make GDB 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, ,Optional Warnings -and Messages}.) - -When the symbol table is stored in COFF format, @code{symbol-file} does -read the symbol table data in full right away. We have not implemented -the two-stage strategy for COFF yet. - -When GDB 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; GDB 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 GDB. So, if you have been running your 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, ,Killing the Child Process}). - -@item load @var{filename} -@kindex load -Depending on what remote debugging facilities are configured into -GDB, 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 GDB, like -the @code{add-symbol-file} command. - -If @code{load} is not available on your GDB, attempting to execute -it gets the error message ``@code{You can't do that when your target is -@dots{}}'' - -On VxWorks, @code{load} will dynamically link @var{filename} on the -current target system as well as adding its symbols in GDB. - -@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 -GDB. - - -@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; GDB 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, ,Specifying a Debugging Target}), -including the names of the executable and core dump files currently in -use by GDB, 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. GDB always converts the file name to an absolute path -name and remembers it that way. - -@cindex shared libraries - -GDB supports the SunOS shared library format. GDB 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, GDB will not understand references to a -function in a shared library, however---unless you are debugging a core -file). -@c FIXME: next GDB release should permit some refs to undef -@c FIXME...symbols---eg in a break cmd---assuming they are 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, GDB Files -@section Errors Reading Symbol Files - -While reading a symbol file, GDB will occasionally encounter problems, -such as symbol types it does not recognize, or known bugs in compiler -output. By default, GDB does not notify you of such problems, since -they are 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 GDB to print -only one message about each such type of problem, no matter how many -times the problem occurs; or you can ask GDB to print more messages, -to see how many times the problems occur, with the @code{set -complaints} command (@pxref{Messages/Warnings, ,Optional Warnings and -Messages}). - -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. - -GDB 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. - -GDB 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, ,Optional Warnings and Messages}.) - -@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. - -GDB 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. - -GDB 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 GDB does not yet -know how to read. @code{0x@var{nn}} is the symbol type of the misunderstood -information, in hexadecimal. - -GDB circumvents the error by ignoring this symbol information. This -will usually allow your 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{gdb} 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 -GDB 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 - -GDB could not parse a type specification output by the compiler. -@end table - -@node Targets, Controlling GDB, GDB Files, Top -@chapter Specifying a Debugging Target -@cindex debugging target -@kindex target - -A @dfn{target} is the execution environment occupied by your program. -Often, GDB runs in the same host environment as your program; 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 GDB 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 GDB -(@pxref{Target Commands, ,Commands for Managing Targets}). - -@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. GDB 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 -GDB 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 a 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 GDB 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, ,Commands to Specify -Files}). To specify as a target a process that is already running, use -the @code{attach} command (@pxref{Attach, ,Debugging an -Already-Running Process}.). - -@node Target Commands, Remote, Active Targets, Targets -@section Commands for Managing Targets - -@table @code -@item target @var{type} @var{parameters} -Connects the GDB 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, ,Commands to Specify 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 GDB -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 GDB-specific protocol. The argument @var{dev} -specifies what serial device to use for the connection (e.g. -@file{/dev/ttya}). @xref{Remote, ,Remote Debugging}. - -@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, ,GDB with a Remote EB29K}. - -@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, ,GDB with a Remote i960 (Nindy)}. - -@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, ,GDB and VxWorks}. -@end table - -Different targets are available on different configurations of GDB; your -configuration may have more or fewer targets. - -@node Remote, , Target Commands, Targets -@section Remote Debugging -@cindex remote debugging - -If you are trying to debug a program running on a machine that cannot run -GDB 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 GDB have special serial or TCP/IP interfaces -to make this work with particular debugging targets. In addition, -GDB comes with a generic serial protocol (specific to GDB, 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 GDB. - -To use the GDB remote serial protocol, the program to be debugged on -the remote machine needs to contain a debugging stub which talks to -GDB over the serial line. Several working remote stubs are -distributed with GDB; see the @file{README} file in the GDB -distribution for more information. - -For details of this communication protocol, see the comments in the -GDB source file @file{remote.c}. - -To start remote debugging, first run GDB and specify as an executable file -the program that is running in the remote machine. This tells GDB how -to find your 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 GDB; use @code{help targets} to list them. - -@menu -* i960-Nindy Remote:: GDB with a Remote i960 (Nindy) -* EB29K Remote:: GDB with a Remote EB29K -* VxWorks Remote:: GDB and VxWorks - -@end menu -@node i960-Nindy Remote, EB29K Remote, Remote, Remote -@subsection GDB with a Remote i960 (Nindy) - -@cindex Nindy -@cindex i960 -@dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When -GDB is configured to control a remote Intel 960 using Nindy, you can -tell GDB 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 GDB -session. @xref{Target Commands, ,Commands for Managing Targets}. - -@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{gdb} without using any command-line -options, you are prompted for what serial port to use, @emph{before} you -reach the ordinary GDB 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, ,Commands for Managing Targets}). - -@node Nindy Options, Nindy reset, Nindy Startup, i960-Nindy Remote -@subsubsection Options for Nindy - -These are the startup options for beginning your GDB 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 GDB 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 GDB should use -the ``old'' Nindy monitor protocol to connect to the target system. -This option is only available when GDB 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. GDB will repeatedly -attempt to reconnect at several different line speeds. You can abort -this process with an interrupt. -@end quotation - -@item -brk -Specify that GDB 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. - -@c @group -@node Nindy reset, , Nindy Options, i960-Nindy Remote -@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 - -@node EB29K Remote, VxWorks Remote, i960-Nindy Remote, Remote -@subsection GDB with a Remote EB29K - -@cindex EB29K board -@cindex running 29K programs - -To use GDB 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 -* gdb-EB29K:: EB29K cross-debugging -* Remote Log:: Remote Log -@end menu - -@node Comms (EB29K), gdb-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: - -@example -C:\> MODE com1:9600,n,8,1,none -@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: - -@example -C:\> CTTY com1 -@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 which 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{#}--- - -@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 - -# ~. -@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 GDB 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 do not 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; GDB will @emph{not} download it over the -serial line. - -@node gdb-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 GDB---specifying as argument the -name of your 29K program: - -@example -cd /usr/joe/work29k -gdb myfoo -@end example - -Now you can use the @code{target} command: - -@example -target amd-eb /dev/ttya 9600 MYFOO -@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 -@end example - -@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 are ready -to see your program run on the 29K board, use the GDB command -@code{run}. - -To stop debugging the remote program, use the GDB @code{detach} -command. - -To return control of the PC to its console, use @code{tip} or @code{cu} -once again, after your GDB 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, , gdb-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. - -@node VxWorks Remote, , EB29K Remote, Remote -@subsection GDB and VxWorks -@cindex VxWorks - -GDB 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. GDB uses code that runs on -both the UNIX host and on the VxWorks target. The program -@code{gdb} is installed and executed on the UNIX host. - -The following information on connecting to VxWorks was current when -this manual was produced; newer releases of VxWorks may use revised -procedures. - -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 -If you wish, 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 manufacturer's manual. - -Once you have included the RDB interface in your VxWorks system image -and set your Unix execution search path to find GDB, you are ready -to run GDB. From your UNIX host, type: - -@smallexample -% gdb -@end smallexample - -GDB will come up showing the prompt: - -@smallexample -(gdb) -@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 GDB 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 -(gdb) target vxworks tt -@end smallexample - -GDB will display a message similar to the following: - -@smallexample -Attaching remote machine across net... Success! -@end smallexample - -GDB will then attempt to read the symbol tables of any object modules -loaded into the VxWorks target since it was last booted. GDB locates -these files by searching the directories listed in the command search -path (@pxref{Environment, ,Your Program's 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 -GDB 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 GDB @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 GDB 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 GDB type: - -@smallexample -(gdb) cd wherever/vw/demo/rdb -(gdb) load prog.o -@end smallexample - -GDB 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 GDB 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 -(gdb) attach @var{task} -@end smallexample - -@noindent -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. - - -@node Controlling GDB, Sequences, Targets, Top -@chapter Controlling GDB - -You can alter many aspects of GDB's interaction with you by using -the @code{set} command. For commands controlling how GDB displays -data, @pxref{Print Settings, ,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 GDB, Controlling GDB -@section Prompt -@cindex prompt - -GDB indicates its readiness to read a command by printing a string -called the @dfn{prompt}. This string is normally @samp{(gdb)}. You -can change the prompt string with the @code{set prompt} command. For -instance, when debugging GDB with GDB, it is useful to change -the prompt in one of the GDBs so that you can always tell which -one you are talking to. - -@table @code -@item set prompt @var{newprompt} -@kindex set prompt -Directs GDB 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 GDB -@section Command Editing -@cindex readline -@cindex command line editing - -GDB 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 GDB 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 GDB -@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 GDB command history file to @var{fname}. This is -the file from which GDB 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 GDB 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 GDB 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 GDB -@section Screen Size -@cindex size of screen -@cindex pauses in output - -Certain commands to GDB may produce large amounts of information -output to the screen. To help you read all of it, GDB pauses and -asks you for input at the end of each page of output. Type @key{RET} -when you want to continue the output. GDB 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 GDB 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, GDB 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 GDB -@section Numbers -@cindex number representation -@cindex entering numbers - -You can always enter numbers in octal, decimal, or hexadecimal in GDB 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 GDB -@section Optional Warnings and Messages - -By default, GDB 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 GDB tell you when it does a lengthy internal operation, so -you will not 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, ,Commands to Specify Files}, in the description of the -command @code{symbol-file}). -@c The following is the right way to do it, but emacs 18.55 does not 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, ,Commands to Specify Files}). -@end ignore - -@table @code -@kindex set verbose -@item set verbose on -Enables GDB's output of certain informational messages. - -@item set verbose off -Disables GDB'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 GDB 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, ,Errors Reading Symbol Files}). - -@table @code -@kindex set complaints -@item set complaints @var{limit} -Permits GDB 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 GDB is permitted to produce. -@end table - -By default, GDB 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 -(gdb) run -The program being debugged has been started already. -Start it from the beginning? (y or n) -@end example - -If you are 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 does not 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. -For example, in VxWorks you can simply recompile a defective object file -and keep on running. -If you are running on one of these systems, you can allow GDB to -reload the symbols for automatically relinked modules: - -@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 -Do not replace symbol definitions when re-encountering object files of -the same name. This is the default state; if you are not running on a -system that permits automatically relinking modules, you should leave -@code{symbol-reloading} off, since otherwise GDB 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 GDB, Top -@chapter Canned Sequences of Commands - -Aside from breakpoint commands (@pxref{Break Commands, ,Breakpoint -Command Lists}), GDB 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 GDB 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 GDB 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 GDB 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 GDB 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 GDB is a file of lines that are GDB 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 GDB, it automatically executes commands from its -@dfn{init files}. These are files named @file{.gdbinit}. GDB 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, -,Choosing Modes}.) 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 GDB 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 -GDB 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 do not consider backslash-space a standard C escape sequence -@c because it is 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. @strong{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. -To print @samp{@w{ }and foo =@w{ }}, use the command -@samp{echo \@w{ }and foo = \@w{ }}. - -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, ,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 your 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, GDB Bugs, Sequences, Top -@chapter Using GDB 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 -GDB. - -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 -GDB as a subprocess of Emacs, with input and output through a newly -created Emacs buffer. - -Using GDB under Emacs is just like using GDB normally except for two -things: - -@itemize @bullet -@item -All ``terminal'' input and output goes through the Emacs buffer. -@end itemize - -This applies both to GDB 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 -GDB displays source code through Emacs. -@end itemize - -Each time GDB displays a stack frame, Emacs automatically finds the -source file for that frame and puts an arrow (@samp{=>}) at the -left margin of the current line. Emacs uses a separate buffer for -source display, and splits the window to show both your GDB session -and the source. - -Explicit GDB @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. GDB can find programs by searching your -environment's @code{PATH} variable, so the GDB input and output -session will proceed normally; but Emacs does not get enough information -back from GDB to locate the source files in this situation. To -avoid this problem, either start GDB 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 GDB @code{file} command to -switch to debugging a program in some other location, from an existing -GDB buffer in Emacs. -@end quotation - -By default, @kbd{M-x gdb} calls the program called @file{gdb}. If -you need to call GDB 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 GDB 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' GDB Mode. - -@item M-s -Execute to another source line, like the GDB @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 GDB @code{next} command. Then update the display window -to show the current file and location. - -@item M-i -Execute one instruction, like the GDB @code{stepi} command; update -display window accordingly. - -@item M-x gdb-nexti -Execute to next instruction, using the GDB @code{nexti} command; update -display window accordingly. - -@item C-c C-f -Execute until exit from the selected stack frame, like the GDB -@code{finish} command. - -@item M-c -Continue execution of your program, like the GDB @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 GDB @code{up} command. - -@emph{Warning:} In Emacs v19, this command is @kbd{C-c C-u}. - -@item M-d -Go down the number of frames indicated by the numeric argument, like the -GDB @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 GDB 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 GDB 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 GDB 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 GDB -communicates with Emacs in terms of line numbers. If you add or -delete lines from the text, the line numbers that GDB 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 GDB Bugs, Renamed Commands, Emacs, Top -@chapter Reporting Bugs in GDB -@cindex Bugs in GDB -@cindex Reporting Bugs in GDB - -Your bug reports play an essential role in making GDB 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 GDB work better. Bug -reports are your contribution to the maintenance of GDB. - -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, GDB Bugs, GDB 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 -GDB bug. Reliable debuggers never crash. - -@item -@cindex error on Valid Input -If GDB produces an error message for valid input, that is a bug. - -@item -@cindex Invalid Input -If GDB 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 GDB are welcome in any case. -@end itemize - -@node Bug Reporting, , Bug Criteria, GDB Bugs -@section How to Report Bugs -@cindex Bug Reports -@cindex GDB Bugs, Reporting - -A number of companies and individuals offer support for GNU products. -If you obtained GDB 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 GDB 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 GDB 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 do not matter. Thus, you might -assume that the name of the variable you use in an example does not matter. -Well, probably it does not, 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 is not as important as 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 GDB. GDB announces it if you start with no -arguments; you can also print it at any time using @code{show version}. - -Without this, we will not know whether there is any point in looking for -the bug in the current version of GDB. - -@item -The type of machine you are using, and the operating system name and -version number. - -@item -What compiler (and its version) was used to compile GDB---e.g. -``gcc-2.0''. - -@item -What compiler (and its version) was used to compile the program you -are debugging---e.g. ``gcc-2.0''. - -@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 will not omit something important, list them all. A copy of the -Makefile (or the output from make) is sufficient. - -If we were to try to guess the arguments, we would probably guess wrong -and then we might not encounter the bug. - -@item -A complete input script, and all necessary source files, that will -reproduce the bug. - -@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 GDB 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 GDB 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 GDB source, send us context -diffs. If you even discuss something in the GDB source, refer to -it by context, not by line number. - -The line numbers in our development sources will not 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 do not 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 do not 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 GDB it is very hard to -construct an example that will make the program follow a certain path -through the code. If you do not send us the example, we will not be able -to construct one, so we will not be able to verify that the bug is fixed. - -And if we cannot understand what bug you are trying to fix, or why your -patch should be an improvement, we will not 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 cannot guess right about such -things without first using the debugger to find the facts. -@end itemize - -@c Note: no need to update nodes for rdl-apps.texi since it appears -@c *only* in the TeX version of the manual. -@c Note: eventually, make a cross reference to the readline Info nodes. -@iftex -@c appendices describing GNU readline. Distributed with readline code. -@include rluser.texinfo -@include inc-hist.texi -@end iftex - -@node Renamed Commands, Installing GDB, GDB Bugs, Top -@appendix Renamed Commands - -The following commands were renamed in GDB 4, 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 GDB, Copying, Renamed Commands, Top -@appendix Installing GDB -@cindex configuring GDB -@cindex installation - -@iftex -@c irrelevant in info file; it's as current as the code it lives with. -@quotation -@emph{Warning:} These installation instructions are current as of -GDB version 4.4.4. If you're installing a more recent release -of GDB, we may have improved the installation procedures since -printing this manual; see the @file{README} file included in your -release for the most recent instructions. -@end quotation -@end iftex - -GDB comes with a @code{configure} script that automates the process -of preparing GDB for installation; you can then use @code{make} to -build the program. - -The GDB distribution includes all the source code you need for GDB in -a single directory, whose name is usually composed by appending the -version number to @samp{gdb}. - -For example, the GDB version 4.4.4 distribution is in the @file{gdb-4.4.4} -directory. That directory contains: - -@table @code -@item gdb-4.4.4/configure @r{(and supporting files)} -script for configuring GDB and all its supporting libraries. - -@item gdb-4.4.4/gdb -the source specific to GDB itself - -@item gdb-4.4.4/bfd -source for the Binary File Descriptor Library - -@item gdb-4.4.4/include -GNU include files - -@item gdb-4.4.4/libiberty -source for the @samp{-liberty} free software library - -@item gdb-4.4.4/readline -source for the GNU command-line interface -@end table - -The simplest way to configure and build GDB is to run @code{configure} -from the @file{gdb-@var{version-number}} source directory, which in -this example is the @file{gdb-4.4.4} directory. - -First switch to the @file{gdb-@var{version-number}} source directory -if you are not already in it; then run @code{configure}. Pass the -identifier for the platform on which GDB will run as an -argument. - -For example: - -@example -cd gdb-4.4.4 -./configure @var{host} -make -@end example - -@noindent -where @var{host} is an identifier such as @samp{sun4} or -@samp{decstation}, that identifies the platform where GDB will run. - -These @code{configure} and @code{make} commands build 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 does not recognize this automatically when you run a different -shell, you may need to run @code{sh} on it explicitly: - -@example -sh configure @var{host} -@end example - -If you run @code{configure} from a directory that contains source -directories for multiple libraries or programs, such as the -@file{gdb-4.4.4} source directory for version 4.4.4, @code{configure} -creates configuration files for every directory level underneath (unless -you tell it not to, with the @samp{--norecursion} option). - -You can run the @code{configure} script from any of the -subordinate directories in the GDB distribution, if you only want to -configure that subdirectory; but be sure to specify a path to it. - -For example, with version 4.4.4, type the following to configure only -the @code{bfd} subdirectory: - -@example -@group -cd gdb-4.4.4/bfd -../configure @var{host} -@end group -@end example - -You can install @code{gdb} 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. Remember -that GDB uses the shell to start your program---some systems refuse to -let GDB debug child processes whose programs are not readable. - -@menu -* Separate Objdir:: Compiling GDB in another directory -* 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 Separate Objdir, Config Names, Installing GDB, Installing GDB -@section Compiling GDB in Another Directory - -If you want to run GDB versions for several host or target machines, -you'll need a different @code{gdb} 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, -rather than in the source directory. 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 @code{gdb} -program specified there. - -To build @code{gdb} in a separate directory, run @code{configure} -with the @samp{--srcdir} option to specify where to find the source. -(Remember, you'll also need to specify a path to find @code{configure} -itself from your working directory.) - -For example, with version 4.4.4, you can build GDB in a separate -directory for a Sun 4 like this: - -@example -@group -cd gdb-4.4.4 -mkdir ../gdb-sun4 -cd ../gdb-sun4 -../gdb-4.4.4/configure --srcdir=../gdb-4.4.4 sun4 -make -@end group -@end example - -When @code{configure} builds a configuration using a remote source -directory, it creates a tree for the binaries with the same structure -(and using the same names) as the tree under the source directory. In -the example, you'd find the Sun 4 library @file{libiberty.a} in the -directory @file{gdb-sun4/libiberty}, and GDB itself in -@file{gdb-sun4/gdb}. - -One popular use for building several GDB configurations in separate -directories is to configure GDB for cross-compiling (where GDB -runs on one machine---the host---while debugging programs that run on -another machine---the target). You specify a cross-debugging target by -giving the @samp{--target=@var{target}} option to @code{configure}. - -When you run @code{make} to build a program or library, you must run -it in a configured directory---whatever directory you were in when you -called @code{configure} (or one of its subdirectories). - -The @code{Makefile} generated by @code{configure} for each source -directory also runs recursively. If you type @code{make} in a source -directory such as @file{gdb-4.4.4} (or in a separate configured -directory configured with @samp{--srcdir=@var{path}/gdb-4.4.4}), you -will build all the required libraries, then build GDB. - -When you have multiple hosts or targets configured in separate -directories, 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. - -@node Config Names, configure Options, Separate Objdir, Installing GDB -@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 GDB version 4.4.4. Entries -in the ``OS prefix'' column ending in a @samp{*} may be followed by a -release number. - -@c FIXME! Update for gdb 4.4 -@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:} @code{configure} can represent a very large number of -combinations of architecture, vendor, and OS. There is by no means -support available for all possible combinations! -@end quotation - -The @code{configure} script accompanying GDB 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 i786v -*** Configuration "i786v" not recognized -@end example - -@noindent -@code{config.sub} is also distributed in the GDB source -directory (@file{gdb-4.4.4}, for version 4.4.4). - -@node configure Options, Formatting Documentation, Config Names, Installing GDB -@section @code{configure} Options - -Here is a summary of all the @code{configure} options and arguments that -you might use for building GDB: - -@example -configure @r{[}--destdir=@var{dir}@r{]} @r{[}--srcdir=@var{path}@r{]} - @r{[}--norecursion@r{]} @r{[}--rm@r{]} - @r{[}--target=@var{target}@r{]} @var{host} -@end example - -@noindent -You may introduce options with a single @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 GDB as -@file{@var{dir}/bin/gdb}, 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}. - -@item --srcdir=@var{path} -Use this option to make configurations in directories separate from the -GDB source directories. Among other things, you can use this to -build (or maintain) several configurations simultaneously, in separate -directories. @code{configure} writes configuration specific files in -the current directory, but arranges for them to use the source in the -directory @var{path}. @code{configure} will create directories under -the working directory in parallel to the source directories below -@var{path}. - -@item --norecursion -Configure only the directory level where @code{configure} is executed; do not -propagate configuration to subdirectories. - -@item --rm -Remove the configuration that the other arguments specify. - -@c This does not work (yet if ever). FIXME. -@c @item --parse=@var{lang} @dots{} -@c Configure the GDB expression parser to parse the listed languages. -@c @samp{all} configures GDB for all supported languages. To get a -@c list of all supported languages, omit the argument. Without this -@c option, GDB is configured to parse all supported languages. - -@item --target=@var{target} -Configure GDB for cross-debugging programs running on the specified -@var{target}. Without this option, GDB is configured to debug -programs that run on the same machine (@var{host}) as GDB itself. - -There is no convenient way to generate a list of all available targets. - -@item @var{host} @dots{} -Configure GDB to run on the specified @var{host}. - -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 GDB or its supporting libraries. - -@node Formatting Documentation, , configure Options, Installing GDB -@section Formatting the Documentation - -All the documentation for GDB, including this manual, comes as part of -the distribution. The documentation is written in Texinfo format, -which is a documentation system that uses a single source file to -produce both on-line information and a printed manual. You can use -one of the Info formatting commands to create the on-line version of -the documentation and @TeX{} (or @code{texi2roff}) to typeset the -printed version. - -GDB includes an already formatted copy of the on-line Info version of -this manual in the @file{gdb} subdirectory. The main Info file is -@file{gdb-@var{version-number}/gdb/gdb.info}, and it refers to -subordinate files matching @samp{gdb.info*} in the same directory. - -If you want to format these Info files yourself, you need one of the -Info formatting programs, such as @code{texinfo-format-buffer} or -@code{makeinfo}. - -If you have @code{makeinfo} installed, and are in the top level GDB -source directory (@file{gdb-4.4.4}, in the case of version 4.4.4), you can -make the Info file by typing: - -@example -cd gdb -make gdb.info -@end example - -If you want to typeset and print copies of this manual, you need -@TeX{}, a printing program such as @code{lpr}, and @file{texinfo.tex}, -the Texinfo definitions file. - -@TeX{} is typesetting program; it does not print files directly, but -produces output files called @sc{dvi} files. To print a typeset -document, you need a program to print @sc{dvi} files. If your system -has @TeX{} installed, chances are it has such a program. The precise -command to use depends on your system; @kbd{lpr -d} is common; another -is @kbd{dvips}. The @sc{dvi} print command may require a file name -without any extension or a @samp{.dvi} extension. - -@TeX{} also requires a macro definitions file called -@file{texinfo.tex}. This file tells @TeX{} how to typeset a document -written in Texinfo format. On its own, @TeX{} cannot read, much less -typeset a Texinfo file. @file{texinfo.tex} is distributed with GDB -and is located in the @file{gdb-@var{version-number}/texinfo} -directory. - -If you have @TeX{} and a @sc{dvi} printer program installed, you can -typeset and print this manual. First switch to the the @file{gdb} -subdirectory of the main source directory (for example, to -@file{gdb-4.4.4/gdb}) and then type: - -@example -make gdb.dvi -@end example - -@cindex GDB reference card -@cindex reference card -In addition to the manual, the GDB 4 release includes a three-column -reference card. Format the GDB reference card by typing: - -@example -make refcard.dvi -@end example - -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 @sc{dvi} output program. - -The GDB 4 release includes an already-formatted reference card, ready -for printing on a PostScript or GhostScript printer, in the @file{gdb} -subdirectory of the main source directory---in -@file{gdb-4.2/gdb/refcard.ps} of the version 4.2 release. If you have -a PostScript or GhostScript printer, you can print the reference card -by just sending @file{refcard.ps} to the printer. - -@node Copying, Index, Installing GDB, 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: - -@enumerate a -@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 enumerate - -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: - -@enumerate a -@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 enumerate - -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: - -@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\/},} -\centerline{{\bf\fontname\tenbf}, and} -\centerline{{\sl\fontname\tensl\/}} -\centerline{are used for emphasis.}\vfill} -\page\colophon -% Blame: pesch@cygnus.com, 1991. -@end tex - -@contents -@bye diff --git a/gdb/doc/gdb.alter-m4 b/gdb/doc/gdb.alter-m4 index 56007dd965..e69de29bb2 100755 --- a/gdb/doc/gdb.alter-m4 +++ b/gdb/doc/gdb.alter-m4 @@ -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 index 96479269fd..e69de29bb2 100755 --- a/gdb/doc/gdb.bugs-m4 +++ b/gdb/doc/gdb.bugs-m4 @@ -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 index 4cbb8f4d5e..e69de29bb2 100755 --- a/gdb/doc/gdb.canned-m4 +++ b/gdb/doc/gdb.canned-m4 @@ -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 index 1020258b24..e69de29bb2 100755 --- a/gdb/doc/gdb.cmds-m4 +++ b/gdb/doc/gdb.cmds-m4 @@ -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 index 4ff4a168c7..e69de29bb2 100755 --- a/gdb/doc/gdb.ctl-m4 +++ b/gdb/doc/gdb.ctl-m4 @@ -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 index 9c74f60613..e69de29bb2 100755 --- a/gdb/doc/gdb.data-m4 +++ b/gdb/doc/gdb.data-m4 @@ -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 index 855371eac4..e69de29bb2 100755 --- a/gdb/doc/gdb.emacs-m4 +++ b/gdb/doc/gdb.emacs-m4 @@ -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 index c71a315fc3..e69de29bb2 100755 --- a/gdb/doc/gdb.files-m4 +++ b/gdb/doc/gdb.files-m4 @@ -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 index 9925f83886..e69de29bb2 100755 --- a/gdb/doc/gdb.gpl-m4 +++ b/gdb/doc/gdb.gpl-m4 @@ -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 index 651c8d0700..e69de29bb2 100755 --- a/gdb/doc/gdb.install-m4 +++ b/gdb/doc/gdb.install-m4 @@ -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 index 1ff32def53..e69de29bb2 100755 --- a/gdb/doc/gdb.invoc-m4 +++ b/gdb/doc/gdb.invoc-m4 @@ -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 index 7248efa5e1..e69de29bb2 100755 --- a/gdb/doc/gdb.rdln-m4 +++ b/gdb/doc/gdb.rdln-m4 @@ -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 index 7731a4155d..e69de29bb2 100755 --- a/gdb/doc/gdb.rename-m4 +++ b/gdb/doc/gdb.rename-m4 @@ -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 index 09df60bf01..e69de29bb2 100755 --- a/gdb/doc/gdb.run-m4 +++ b/gdb/doc/gdb.run-m4 @@ -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 index ae258ad69f..e69de29bb2 100755 --- a/gdb/doc/gdb.sample-m4 +++ b/gdb/doc/gdb.sample-m4 @@ -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{} and the close quote string to @code{}, 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(,)} - -@i{define(baz,defn(foo))} -@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(,)} - -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 "", rq=0x34c88 "") - 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 "", rq=0x34c88 "") - 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 "" -(_GDBP__) @i{p rquote} -$2 = 0x35d50 "" -@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(foo))} - -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 index fdc6e3382a..e69de29bb2 100755 --- a/gdb/doc/gdb.src-m4 +++ b/gdb/doc/gdb.src-m4 @@ -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 : ble 0x63f8 -0x63e8 : sethi %hi(0x4c00), %o0 -0x63ec : ld [%i1+4], %o0 -0x63f0 : b 0x63fc -0x63f4 : ld [%o0+4], %o0 -0x63f8 : or %o0, 0x1a4, %o0 -0x63fc : call 0x9288 -0x6400 : nop -End of assembler dump. -(_GDBP__) - -@end smallexample diff --git a/gdb/doc/gdb.stack-m4 b/gdb/doc/gdb.stack-m4 index 4bed2f5907..e69de29bb2 100755 --- a/gdb/doc/gdb.stack-m4 +++ b/gdb/doc/gdb.stack-m4 @@ -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 index 934d7867ed..e69de29bb2 100755 --- a/gdb/doc/gdb.stop-m4 +++ b/gdb/doc/gdb.stop-m4 @@ -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 index e257d31c1b..e69de29bb2 100755 --- a/gdb/doc/gdb.symb-m4 +++ b/gdb/doc/gdb.symb-m4 @@ -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.tgts-m4 b/gdb/doc/gdb.tgts-m4 index f3bee50a0f..e69de29bb2 100755 --- a/gdb/doc/gdb.tgts-m4 +++ b/gdb/doc/gdb.tgts-m4 @@ -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 index f17e3051cb..e69de29bb2 100755 --- a/gdb/doc/gdb.top-m4 +++ b/gdb/doc/gdb.top-m4 @@ -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/gdbinv-m.m4 b/gdb/doc/gdbinv-m.m4 index 8fe5f91c90..e69de29bb2 100755 --- a/gdb/doc/gdbinv-m.m4 +++ b/gdb/doc/gdbinv-m.m4 @@ -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 index e0814be89c..e69de29bb2 100755 --- a/gdb/doc/gdbinv-s.m4 +++ b/gdb/doc/gdbinv-s.m4 @@ -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/interim-gdb.texinfo b/gdb/doc/interim-gdb.texinfo index 53a01e4e2a..e69de29bb2 100755 --- a/gdb/doc/interim-gdb.texinfo +++ b/gdb/doc/interim-gdb.texinfo @@ -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__ (_GDB_VN__) -_fi__(_GENERIC__) -_if__(!_GENERIC__) -@settitle Using _GDBN__ _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{} and the close quote string to @code{}, 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(,)} - -@i{define(baz,defn(foo))} -@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(,)} - -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 "", rq=0x34c88 "") - 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 "", rq=0x34c88 "") - 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 "" -(_GDBP__) @i{p rquote} -$2 = 0x35d50 "" -@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(foo))} - -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 : ble 0x63f8 -0x63e8 : sethi %hi(0x4c00), %o0 -0x63ec : ld [%i1+4], %o0 -0x63f0 : b 0x63fc -0x63f4 : ld [%o0+4], %o0 -0x63f8 : or %o0, 0x1a4, %o0 -0x63fc : call 0x9288 -0x6400 : 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 index 8fe5f91c90..e69de29bb2 100755 --- a/gdb/doc/interim-gdbinv-m.m4 +++ b/gdb/doc/interim-gdbinv-m.m4 @@ -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 index 82de97a9bf..e69de29bb2 100755 --- a/gdb/doc/interim-gdbinv-s.m4 +++ b/gdb/doc/interim-gdbinv-s.m4 @@ -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/rc-cm.tex b/gdb/doc/rc-cm.tex index 1b44a07419..e69de29bb2 100755 --- a/gdb/doc/rc-cm.tex +++ b/gdb/doc/rc-cm.tex @@ -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 index 1a0e970372..e69de29bb2 100755 --- a/gdb/doc/rc-ps.tex +++ b/gdb/doc/rc-ps.tex @@ -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 index 24643d1d7e..e69de29bb2 100755 --- a/gdb/doc/rc-pslong.tex +++ b/gdb/doc/rc-pslong.tex @@ -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 index bc924907a1..e69de29bb2 100755 --- a/gdb/doc/rdl-apps.texi +++ b/gdb/doc/rdl-apps.texi @@ -1,2 +0,0 @@ -@include ./../../readline/doc/rluser.texinfo -@include ./../../readline/doc/inc-hist.texi diff --git a/gdb/doc/threecol.tex b/gdb/doc/threecol.tex deleted file mode 100755 index a4622c497d..0000000000 --- a/gdb/doc/threecol.tex +++ /dev/null @@ -1,46 +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 - } -% -%ALTERNATIVE FOLDING GUIDES: -% -%For NO printed folding guide, comment out other \def\vdecor's and uncomment: -%\def\vdecor{\hskip .2in plus1fil} -% -%For SOLID LINE folding guide, comment out other \def\vdecor's and uncomment: -%\def\vdecor{\hskip .1in plus1fil \vrule width .1pt \hskip .1in plus1fil} -% -%For SMALL MARKS NEAR TOP AND BOTTOM as folding guide, -%comment out other \def\vdecor's and uncomment: -\def\vdecor{\hskip .1in plus1fil -\vbox to \vsize{\hbox to .1pt{\vrule height 2pt width .1pt}\vfill -\hbox to .1pt{\vrule height 2pt width .1pt}} -\hskip .1in plus1fil} -% -%END OF ALTERNATIVES FOR FOLDING GUIDES -% -\def\tripleformat{\shipout\vbox{\fulline{\box\leftcolumn\vdecor - \box\centercolumn\vdecor - \columnbox} - } - \advancepageno} -\def\columnbox{\leftline{\pagebody}} -\def\bye{\par\vfill - \supereject - \if R\lcr \null\vfill\eject\fi - \end} diff --git a/gdb/ecoff.c b/gdb/ecoff.c index 519763dcf9..e69de29bb2 100755 --- a/gdb/ecoff.c +++ b/gdb/ecoff.c @@ -1,336 +0,0 @@ -/* Byte swap a symbol table in MIPS' format (Third-Eye). - Copyright 1992 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 "bfd.h" -#define LANGUAGE_C /* Wierd MIPS crap */ -#include "sym.h" /* MIPS symbols */ -#include "symconst.h" /* MIPS symbols */ -#include "coff/ecoff-ext.h" /* ECOFF external struct defns */ - -void -ecoff_swap_hdr_in (abfd, ext_copy, intern) - bfd *abfd; - struct hdr_ext *ext_copy; - HDRR *intern; -{ - struct hdr_ext ext[1]; - - *ext = *ext_copy; - - intern->magic = bfd_h_get_16 (abfd, (bfd_byte *)ext->h_magic); - intern->vstamp = bfd_h_get_16 (abfd, (bfd_byte *)ext->h_vstamp); - intern->ilineMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ilineMax); - intern->cbLine = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbLine); - intern->cbLineOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbLineOffset); - intern->idnMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_idnMax); - intern->cbDnOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbDnOffset); - intern->ipdMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ipdMax); - intern->cbPdOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbPdOffset); - intern->isymMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_isymMax); - intern->cbSymOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbSymOffset); - intern->ioptMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ioptMax); - intern->cbOptOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbOptOffset); - intern->iauxMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_iauxMax); - intern->cbAuxOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbAuxOffset); - intern->issMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_issMax); - intern->cbSsOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbSsOffset); - intern->issExtMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_issExtMax); - intern->cbSsExtOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbSsExtOffset); - intern->ifdMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_ifdMax); - intern->cbFdOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbFdOffset); - intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_crfd); - intern->cbRfdOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbRfdOffset); - intern->iextMax = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_iextMax); - intern->cbExtOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->h_cbExtOffset); - -#ifdef TEST - if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); -#endif -} - -/* Swap in the file descriptor record. */ - -void -ecoff_swap_fdr_in (abfd, ext_copy, intern) - bfd *abfd; - struct fdr_ext *ext_copy; - FDR *intern; -{ - struct fdr_ext ext[1]; - - *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - intern->adr = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_adr); - intern->rss = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rss); - intern->issBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_issBase); - intern->cbSs = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cbSs); - intern->isymBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_isymBase); - intern->csym = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_csym); - intern->ilineBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ilineBase); - intern->cline = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cline); - intern->ioptBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ioptBase); - intern->copt = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_copt); - intern->ipdFirst = bfd_h_get_16 (abfd, (bfd_byte *)ext->f_ipdFirst); - intern->cpd = bfd_h_get_16 (abfd, (bfd_byte *)ext->f_cpd); - intern->iauxBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_iauxBase); - intern->caux = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_caux); - intern->rfdBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rfdBase); - intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_crfd); - - /* now the fun stuff... */ - if (abfd->xvec->header_byteorder_big_p != false) { - intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_BIG) - >> FDR_BITS1_LANG_SH_BIG; - intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_BIG); - intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_BIG); - intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_BIG); - intern->glevel = (ext->f_bits2[0] & FDR_BITS2_GLEVEL_BIG) - >> FDR_BITS2_GLEVEL_SH_BIG; - /* intern->reserved we ignore. */ - } else { - intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_LITTLE) - >> FDR_BITS1_LANG_SH_LITTLE; - intern->fMerge = 0 != (ext->f_bits1[0] & FDR_BITS1_FMERGE_LITTLE); - intern->fReadin = 0 != (ext->f_bits1[0] & FDR_BITS1_FREADIN_LITTLE); - intern->fBigendian = 0 != (ext->f_bits1[0] & FDR_BITS1_FBIGENDIAN_LITTLE); - intern->glevel = (ext->f_bits2[0] & FDR_BITS2_GLEVEL_LITTLE) - >> FDR_BITS2_GLEVEL_SH_LITTLE; - /* intern->reserved we ignore. */ - } - - intern->cbLineOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cbLineOffset); - intern->cbLine = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cbLine); - -#ifdef TEST - if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); -#endif -} - - - -/* Swap in the procedure descriptor record. */ - -void -ecoff_swap_pdr_in (abfd, ext_copy, intern) - bfd *abfd; - struct pdr_ext *ext_copy; - PDR *intern; -{ - struct pdr_ext ext[1]; - - *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - intern->adr = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_adr); - intern->isym = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_isym); - intern->iline = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iline); - intern->regmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_regmask); - intern->regoffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_regoffset); - intern->iopt = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iopt); - intern->fregmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_fregmask); - intern->fregoffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_fregoffset); - intern->frameoffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_frameoffset); - intern->framereg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_framereg); - intern->pcreg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_pcreg); - intern->lnLow = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnLow); - intern->lnHigh = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnHigh); - intern->cbLineOffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_cbLineOffset); - -#ifdef TEST - if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); -#endif -} - - -/* Swap in a symbol record. */ - -void -ecoff_swap_sym_in (abfd, ext_copy, intern) - bfd *abfd; - struct sym_ext *ext_copy; - SYMR *intern; -{ - struct sym_ext ext[1]; - - *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - intern->iss = bfd_h_get_32 (abfd, (bfd_byte *)ext->s_iss); - intern->value = bfd_h_get_32 (abfd, (bfd_byte *)ext->s_value); - - /* now the fun stuff... */ - if (abfd->xvec->header_byteorder_big_p != false) { - intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_BIG) - >> SYM_BITS1_ST_SH_BIG; - intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_BIG) - << SYM_BITS1_SC_SH_LEFT_BIG) - | ((ext->s_bits2[0] & SYM_BITS2_SC_BIG) - >> SYM_BITS2_SC_SH_BIG); - intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_BIG); - intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_BIG) - << SYM_BITS2_INDEX_SH_LEFT_BIG) - | (ext->s_bits3[0] << SYM_BITS3_INDEX_SH_LEFT_BIG) - | (ext->s_bits4[0] << SYM_BITS4_INDEX_SH_LEFT_BIG); - } else { - intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_LITTLE) - >> SYM_BITS1_ST_SH_LITTLE; - intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_LITTLE) - >> SYM_BITS1_SC_SH_LITTLE) - | ((ext->s_bits2[0] & SYM_BITS2_SC_LITTLE) - << SYM_BITS2_SC_SH_LEFT_LITTLE); - intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_LITTLE); - intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_LITTLE) - >> SYM_BITS2_INDEX_SH_LITTLE) - | (ext->s_bits3[0] << SYM_BITS3_INDEX_SH_LEFT_LITTLE) - | (ext->s_bits4[0] << SYM_BITS4_INDEX_SH_LEFT_LITTLE); - } - -#ifdef TEST - if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); -#endif -} - - -/* Swap in an external symbol record. */ - -void -ecoff_swap_ext_in (abfd, ext_copy, intern) - bfd *abfd; - struct ext_ext *ext_copy; - EXTR *intern; -{ - struct ext_ext ext[1]; - - *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ - if (abfd->xvec->header_byteorder_big_p != false) { - intern->jmptbl = 0 != (ext->es_bits1[0] & EXT_BITS1_JMPTBL_BIG); - intern->cobol_main = 0 != (ext->es_bits1[0] & EXT_BITS1_COBOL_MAIN_BIG); - } else { - intern->jmptbl = 0 != (ext->es_bits1[0] & EXT_BITS1_JMPTBL_LITTLE); - intern->cobol_main = 0 != (ext->es_bits1[0] & EXT_BITS1_COBOL_MAIN_LITTLE); - } - - intern->ifd = bfd_h_get_16 (abfd, (bfd_byte *)ext->es_ifd); - ecoff_swap_sym_in (abfd, &ext->es_asym, &intern->asym); - -#ifdef TEST - if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); -#endif -} - -/* Swap in a type information record. - BIGEND says whether AUX symbols are big-endian or little-endian; this - info comes from the file header record (fh-fBigendian). */ - -void -ecoff_swap_tir_in (bigend, ext_copy, intern) - int bigend; - struct tir_ext *ext_copy; - TIR *intern; -{ - struct tir_ext ext[1]; - - *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ - if (bigend) { - intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_BIG); - intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_BIG); - intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_BIG) - >> TIR_BITS1_BT_SH_BIG; - intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_BIG) - >> TIR_BITS_TQ4_SH_BIG; - intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_BIG) - >> TIR_BITS_TQ5_SH_BIG; - intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_BIG) - >> TIR_BITS_TQ0_SH_BIG; - intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_BIG) - >> TIR_BITS_TQ1_SH_BIG; - intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_BIG) - >> TIR_BITS_TQ2_SH_BIG; - intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_BIG) - >> TIR_BITS_TQ3_SH_BIG; - } else { - intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_LITTLE); - intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_LITTLE); - intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_LITTLE) - >> TIR_BITS1_BT_SH_LITTLE; - intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_LITTLE) - >> TIR_BITS_TQ4_SH_LITTLE; - intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_LITTLE) - >> TIR_BITS_TQ5_SH_LITTLE; - intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_LITTLE) - >> TIR_BITS_TQ0_SH_LITTLE; - intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_LITTLE) - >> TIR_BITS_TQ1_SH_LITTLE; - intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_LITTLE) - >> TIR_BITS_TQ2_SH_LITTLE; - intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_LITTLE) - >> TIR_BITS_TQ3_SH_LITTLE; - } - -#ifdef TEST - if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); -#endif -} - -/* Swap in a relative symbol record. BIGEND says whether it is in - big-endian or little-endian format.*/ - -void -ecoff_swap_rndx_in (bigend, ext_copy, intern) - int bigend; - struct rndx_ext *ext_copy; - RNDXR *intern; -{ - struct rndx_ext ext[1]; - - *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ - if (bigend) { - intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_BIG) - | ((ext->r_bits[1] & RNDX_BITS1_RFD_BIG) - >> RNDX_BITS1_RFD_SH_BIG); - intern->index = ((ext->r_bits[1] & RNDX_BITS1_INDEX_BIG) - << RNDX_BITS1_INDEX_SH_LEFT_BIG) - | (ext->r_bits[2] << RNDX_BITS2_INDEX_SH_LEFT_BIG) - | (ext->r_bits[3] << RNDX_BITS3_INDEX_SH_LEFT_BIG); - } else { - intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_LITTLE) - | ((ext->r_bits[1] & RNDX_BITS1_RFD_LITTLE) - << RNDX_BITS1_RFD_SH_LEFT_LITTLE); - intern->index = ((ext->r_bits[1] & RNDX_BITS1_INDEX_LITTLE) - >> RNDX_BITS1_INDEX_SH_LITTLE) - | (ext->r_bits[2] << RNDX_BITS2_INDEX_SH_LEFT_LITTLE) - | (ext->r_bits[3] << RNDX_BITS3_INDEX_SH_LEFT_LITTLE); - } - -#ifdef TEST - if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); -#endif -} diff --git a/gdb/expread.tab.c b/gdb/expread.tab.c deleted file mode 100755 index bb9894c9c8..0000000000 --- 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 -#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 - -#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 -#else /* Not sparc */ -#ifdef MSDOS -#include -#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 cc62554102..0000000000 --- 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 -#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 exp exp1 start variable -%type type typebase -%type nonempty_typelist -%type block - -/* Fancy type parsing. */ -%type func_mod direct_abs_decl abs_decl -%type ptype -%type array_mod - -%token INT CHAR -%token UINT -%token 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 STRING -%token NAME BLOCKNAME -%token TYPENAME -%type name -%type name_not_typename -%type 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 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 LAST REGNAME - -%token VARIABLE - -%token 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 *) * ++($1[0]); - $$ = (struct type **)xrealloc ($1, len); - $$[$$[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/gdb-int.texinfo b/gdb/gdb-int.texinfo deleted file mode 100755 index cc1b1880e2..0000000000 --- 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/getpagesize.h b/gdb/getpagesize.h deleted file mode 100755 index 32adae61ef..0000000000 --- a/gdb/getpagesize.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifdef BSD -#ifndef BSD4_1 -#define HAVE_GETPAGESIZE -#endif -#endif - -#ifndef HAVE_GETPAGESIZE - -#include - -#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 8cbf4beab9..0000000000 --- a/gdb/gmalloc.c +++ /dev/null @@ -1,1161 +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 -#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 -#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 has defined it. */ -#define _SIZE_T -typedef unsigned long size_t; -#endif /* _SIZE_T */ - -/* A null pointer constant. */ - -#undef NULL /* in case 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 -#endif - -extern void EXFUN(abort, (NOARGS)); -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 -#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 -#endif - -#ifdef _MALLOC_INTERNAL - -#ifndef __ONEFILE -#include -#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 ((unsigned int) 1 << BLOCKLOG) -#define BLOCKIFY(SIZE) (((SIZE) + BLOCKSIZE - 1) / BLOCKSIZE) - -/* The difference between two pointers is a signed int. On machines where - the data addresses have the high bit set, we need to ensure that the - difference becomes an unsigned int when we are using the address as an - integral value. In addition, when using with the '%' operator, the - sign of the result is machine dependent for negative values, so force - it to be treated as an unsigned int. */ - -#define ADDR2UINT(addr) ((unsigned int) ((char *) (addr) - (char *) NULL)) -#define RESIDUAL(addr) ((unsigned int) (ADDR2UINT (addr) % 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), (NOARGS)))); - -/* 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 -#include - -#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 = RESIDUAL (ptr) >> 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 -#include -#include - -#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 = RESIDUAL (result); - 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 = - RESIDUAL (next->next) >> 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 -#include - -#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 - -#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 -#endif /* __ONEFILE */ - -#if defined(M_UNIX) -/* - * M_UNIX is defined by the SCO compilers, including the port of gcc. - */ - -/* On SunOS 4.1.1, 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 - -#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) ((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 b52db6df14..0000000000 --- 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 -#endif - -#ifdef _MALLOC_INTERNAL - -#ifndef __ONEFILE -#include -#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), (NOARGS)))); - -/* 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/go32-nat.c b/gdb/go32-nat.c deleted file mode 100644 index 899c29ffac..0000000000 --- a/gdb/go32-nat.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Native dependent code for dos running GO32 for GDB, the GNU debugger. - Copyright 1992 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 - -static void uerror(char *s) -{ - fprintf(stderr, "Fatal: %s!\n"); - exit(1); -} - -fetch_core_registers(){uerror("attempt to call fetch_core_registers()");} - -fetch_inferior_registers(){uerror("attempt to call fetch_inferior_registers()");} -store_inferior_registers(){uerror("attempt to call store_inferior_registers()");} - -child_resume(){uerror("attempt to call child_resume()");} -child_xfer_memory(){uerror("attempt to call child_xfer_memory()");} - diff --git a/gdb/hds-tdep.c b/gdb/hds-tdep.c index 139597f9cb..e69de29bb2 100755 --- a/gdb/hds-tdep.c +++ b/gdb/hds-tdep.c @@ -1,2 +0,0 @@ - - diff --git a/gdb/hp300hpux-xdep.c b/gdb/hp300hpux-xdep.c deleted file mode 100755 index f7f1cf0810..0000000000 --- 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 -#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 -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "gdbcore.h" - -#include -#include - -#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, ®val); - } - 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 *) ®isters[(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 f043accd0b..0000000000 --- a/gdb/hp300ux-xdep.c +++ /dev/null @@ -1,233 +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 "defs.h" -#include "frame.h" -#include "inferior.h" - -/* Defining this means some system include files define some extra stuff. */ -#define WOPR -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "gdbcore.h" - -#include -#include - -#define INFERIOR_AR0(u) \ - ((ptrace \ - (PT_RUAREA, inferior_pid, \ - (PTRACE_ARG3_TYPE) ((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, (PTRACE_ARG3_TYPE) regaddr, - 0)); - regval = ps_val.s[0]; - supply_register (regno, ®val); - } - 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, - (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 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 *) ®isters[(REGISTER_BYTE (regno)) + i])); - regaddr += sizeof (int); - } - } - return; -} - -void -fetch_inferior_registers (regno) - int regno; -{ - struct user u; - 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). */ - -void -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, reg_addr) - char *core_reg_sect; - int core_reg_size; - int which; - unsigned int reg_addr; /* Unused in this version */ -{ - 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/hppa-coredep.c b/gdb/hppa-coredep.c index 56bb2d5b49..e69de29bb2 100644 --- a/gdb/hppa-coredep.c +++ b/gdb/hppa-coredep.c @@ -1,121 +0,0 @@ -/* Extract registers from an HP-PA core file, for GDB. - Copyright (C) 1988, 1991, 1992 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 "gdbcore.h" - -/* These are needed on various systems to expand REGISTER_U_ADDR. */ -/* FIXME: Remove any not needed on HP-PA. */ -#include -#include -#include -#include -#include -#include -#ifndef USG -#include -#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 { - if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) - core_reg_sect[addr +3] &= ~0x3; - 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/hppab-xdep.c b/gdb/hppab-xdep.c index 01d74043e6..e69de29bb2 100644 --- a/gdb/hppab-xdep.c +++ b/gdb/hppab-xdep.c @@ -1,406 +0,0 @@ -/* Host-dependent code for HP PA-RISC running BSD Unix, for GDB. - Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.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. */ - -#include "defs.h" -#include "frame.h" -#include "inferior.h" -#include "target.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include -#ifndef USG -#include -#endif - - -#ifndef PT_ATTACH -#define PT_ATTACH PTRACE_ATTACH -#endif -#ifndef PT_DETACH -#define PT_DETACH PTRACE_DETACH -#endif - -#include "gdbcore.h" -#include /* After a.out.h */ -#include -#include - -/* 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; - PTRACE_ARG3_TYPE addr; - int 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 - -void -kill_inferior () -{ - if (inferior_pid == 0) - return; - ptrace (PT_KILL, inferior_pid, (PTRACE_ARG3_TYPE) 0, 0); - wait ((int *)0); - 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 (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 1, signal); - else - ptrace (PT_CONTINUE, inferior_pid, (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 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; - -#include /* For struct nlist */ - -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, \ - (PTRACE_ARG3_TYPE) (offsetof (struct user, u_ar0)), 0) \ - - KERNEL_U_ADDR -#endif - -/* Registers we shouldn't try to fetch. */ -#if !defined (CANNOT_FETCH_REGISTER) -#define CANNOT_FETCH_REGISTER(regno) 0 -#endif - -/* Fetch one register. */ - -static void -fetch_register (regno) - int regno; -{ - register unsigned int regaddr; - char buf[MAX_REGISTER_RAW_SIZE]; - char mess[128]; /* For messages */ - register int i; - - /* Offset of registers within the u area. */ - unsigned int offset; - - if (CANNOT_FETCH_REGISTER (regno)) - { - bzero (buf, REGISTER_RAW_SIZE (regno)); /* Supply zeroes */ - supply_register (regno, buf); - return; - } - - offset = U_REGS_OFFSET; - - regaddr = register_addr (regno, offset); - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - errno = 0; - *(int *) &buf[i] = ptrace (PT_RUREGS, inferior_pid, - (PTRACE_ARG3_TYPE) regaddr, 0); - regaddr += sizeof (int); - if (errno != 0) - { - sprintf (mess, "reading register %s (#%d)", reg_names[regno], regno); - perror_with_name (mess); - } - } - 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). */ - -void -store_inferior_registers (regno) - int regno; -{ - register unsigned int regaddr; - char buf[80]; - extern char registers[]; - register int i; - - 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, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i]); - if (errno != 0) - { - sprintf (buf, "writing register number %d(%d)", regno, i); - perror_with_name (buf); - } - 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, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i]); - if (errno != 0) - { - sprintf (buf, "writing register number %d(%d)", regno, i); - perror_with_name (buf); - } - regaddr += sizeof(int); - } - } - } - return; -} -#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, (PTRACE_ARG3_TYPE) addr, - 0); - } - - if (count > 1) /* FIXME, avoid if even boundary */ - { - buffer[count - 1] - = ptrace (PT_READ_I, inferior_pid, - (PTRACE_ARG3_TYPE) (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, (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 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, - (PTRACE_ARG3_TYPE) 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/hppabsd-core.c b/gdb/hppabsd-core.c index 5ca5f9b9fe..e69de29bb2 100644 --- a/gdb/hppabsd-core.c +++ b/gdb/hppabsd-core.c @@ -1,251 +0,0 @@ -/* Machine-dependent code which would otherwise be in core.c - for GDB, the GNU debugger. This code is for the HP PA-RISC cpu. - Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.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. */ - -#include "defs.h" -#include "frame.h" -#include "inferior.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include -/* #include Can we live without this? */ - -#ifndef hpux -#include -#include -#include -#include "/usr/src/sys/hpux/hpux.h" -#define USRSTACK 0x68FF3000 -#else -#include /* After a.out.h */ -#endif - -#include -#include -#include - -#ifndef hpux -#undef USIZE -#undef UPAGES - -#define USIZE 3 -#define UPAGES 7 -#endif - -extern int errno; - -/* File names of core file and executable file. */ - -extern char *corefile; -extern char *execfile; - -/* Descriptors on which core file and executable file are open. - Note that the execchan is closed when an inferior is created - and reopened if the inferior dies or is killed. */ - -extern int corechan; -extern int execchan; - -/* Last modification time of executable file. - Also used in source.c to compare against mtime of a source file. */ - -extern int exec_mtime; - -/* Virtual addresses of bounds of the two areas of memory in the core file. */ - -extern CORE_ADDR data_start; -extern CORE_ADDR data_end; -extern CORE_ADDR stack_start; -extern CORE_ADDR stack_end; - -/* Virtual addresses of bounds of two areas of memory in the exec file. - Note that the data area in the exec file is used only when there is no core file. */ - -extern CORE_ADDR text_start; -extern CORE_ADDR text_end; - -extern CORE_ADDR exec_data_start; -extern CORE_ADDR exec_data_end; - -/* Address in executable file of start of text area data. */ - -extern int text_offset; - -/* Address in executable file of start of data area data. */ - -extern int exec_data_offset; - -/* Address in core file of start of data area data. */ - -extern int data_offset; - -/* Address in core file of start of stack area data. */ - -extern int stack_offset; - -extern struct header file_hdr; -extern struct som_exec_auxhdr exec_hdr; - -extern int (*core_file_hook)(); - -#ifdef KERNELDEBUG - -extern int kernel_debugging; -extern int kernel_core_file_hook(); - -#endif - -core_file_command (filename, from_tty) - char *filename; - int from_tty; -{ - int val; - extern char registers[]; -#ifdef KERNELDEBUG - struct stat stb; -#endif - - /* Discard all vestiges of any previous core file - and mark data and stack spaces as empty. */ - - if (corefile) - free (corefile); - corefile = 0; - core_file_hook = 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); - -#ifdef KERNELDEBUG - fstat(corechan, &stb); - - if (kernel_debugging) { - setup_kernel_debugging(); - core_file_hook = kernel_core_file_hook; - set_kernel_boundaries(); - } else if ((stb.st_mode & S_IFMT) == S_IFCHR && - stb.st_rdev == makedev(2, 1)) { - /* looking at /dev/kmem */ - data_offset = data_start = KERNBASE; - data_end = ~0; /* XXX */ - stack_end = stack_start = data_end; - set_kernel_boundaries(); - } else -#endif - { - /* HP PA-RISC style corefile. */ -#ifndef hpux - struct hpuxuser u; -#else - struct user u; -#endif - - 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); - - /* 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 = USRSTACK; /* from sys/param.h */ - stack_end = stack_start + 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 = NBPG * USIZE; - /* 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++) - { - unsigned 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 (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) - buf[3] &= ~0x3; - 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 ())); - select_frame (get_current_frame (), 0); - validate_files (); - } - else if (from_tty) - printf ("No core file now.\n"); -} diff --git a/gdb/hppabsd-tdep.c b/gdb/hppabsd-tdep.c deleted file mode 100644 index 8fe6d289a8..0000000000 --- a/gdb/hppabsd-tdep.c +++ /dev/null @@ -1,1422 +0,0 @@ -/* Machine-dependent code which would otherwise be in inflow.c and core.c, - for GDB, the GNU debugger. This code is for the HP PA-RISC cpu. - Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.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. */ - -#include "defs.h" -#include "frame.h" -#include "inferior.h" -#include "value.h" - -/* For argument passing to the inferior */ -#include "symtab.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include - -#ifdef COFF_ENCAPSULATE -#include "a.out.encap.h" -#else -#include -#endif -#ifndef N_SET_MAGIC -#define N_SET_MAGIC(exec, val) ((exec).a_magic = (val)) -#endif - -/*#include After a.out.h */ -#include -#include -#include -#include - -#ifdef KERNELDEBUG -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern int kernel_debugging; -extern CORE_ADDR startup_file_start; -extern CORE_ADDR startup_file_end; - -#define KERNOFF ((unsigned)KERNBASE) -#define INKERNEL(x) ((x) >= KERNOFF && (x) < KERNOFF + ctob(slr)) - -static int ok_to_cache(); -static void set_kernel_boundaries(); - -int devmem = 0; -int vtophys_ready = 0; -int kerneltype; -#define OS_BSD 1 -#define OS_MACH 2 -#endif - -#include "gdbcore.h" -#include "gdbcmd.h" - -extern int errno; - - - - - - -/* Last modification time of executable file. - Also used in source.c to compare against mtime of a source file. */ - -extern int exec_mtime; - -/* Virtual addresses of bounds of the two areas of memory in the core file. */ - -/* extern CORE_ADDR data_start; */ -extern CORE_ADDR data_end; -extern CORE_ADDR stack_start; -extern CORE_ADDR stack_end; - -/* Virtual addresses of bounds of two areas of memory in the exec file. - Note that the data area in the exec file is used only when there is no core file. */ - -extern CORE_ADDR text_start; -extern CORE_ADDR text_end; - -extern CORE_ADDR exec_data_start; -extern CORE_ADDR exec_data_end; - -/* Address in executable file of start of text area data. */ - -extern int text_offset; - -/* Address in executable file of start of data area data. */ - -extern int exec_data_offset; - -/* Address in core file of start of data area data. */ - -extern int data_offset; - -/* Address in core file of start of stack area data. */ - -extern int stack_offset; - -struct header file_hdr; -struct som_exec_auxhdr exec_hdr; - -#ifdef KERNELDEBUG -/* - * Kernel debugging routines. - */ - -static struct pcb pcb; -static struct pde *pdir; -static struct hte *htbl; -static u_int npdir, nhtbl; - -static CORE_ADDR -ksym_lookup(name) - char *name; -{ - struct symbol *sym; - int i; - - if ((i = lookup_misc_func(name)) < 0) - error("kernel symbol `%s' not found.", name); - - return (misc_function_vector[i].address); -} - -/* - * (re-)set the variables that tell "inside_entry_file" where to end - * a stack backtrace. - */ -void -set_kernel_boundaries() -{ - switch (kerneltype) { - case OS_MACH: - startup_file_start = ksym_lookup("$syscall"); - startup_file_end = ksym_lookup("trap"); - break; - case OS_BSD: - startup_file_start = ksym_lookup("syscallinit"); - startup_file_end = ksym_lookup("$syscallexit"); - break; - } -} - -/* - * return true if 'len' bytes starting at 'addr' can be read out as - * longwords and/or locally cached (this is mostly for memory mapped - * i/o register access when debugging remote kernels). - */ -static int -ok_to_cache(addr, len) -{ - static CORE_ADDR ioptr; - - if (! ioptr) - ioptr = ksym_lookup("ioptr"); - - if (addr >= ioptr && addr < SPA_HIGH) - return (0); - - return (1); -} - -static -physrd(addr, dat, len) - u_int addr; - char *dat; -{ - if (lseek(corechan, addr, L_SET) == -1) - return (-1); - if (read(corechan, dat, len) != len) - return (-1); - - return (0); -} - -/* - * When looking at kernel data space through /dev/mem or with a core file, do - * virtual memory mapping. - */ -static CORE_ADDR -vtophys(space, addr) - unsigned space; - CORE_ADDR addr; -{ - struct pde *pptr; - u_int hindx, vpageno, ppageno; - CORE_ADDR phys = ~0; - - if (!vtophys_ready) { - phys = addr; /* XXX for kvread */ - } else if (kerneltype == OS_BSD) { - /* make offset into a virtual page no */ - vpageno = btop(addr); - /* - * Determine index into hash table, initialize pptr to this - * entry (since first word of pte & hte are same), and set - * physical page number for first entry in chain. - */ - hindx = pdirhash(space, addr) & (nhtbl-1); - pptr = (struct pde *) &htbl[hindx]; - ppageno = pptr->pde_next; - while (1) { - if (pptr->pde_end) - break; - pptr = &pdir[ppageno]; - /* - * If space id & virtual page number match, return - * "next PDIR entry of previous PDIR entry" as the - * physical page or'd with offset into page. - */ - if (pptr->pde_space == space && - pptr->pde_page == vpageno) { - phys = (CORE_ADDR) ((u_int)ptob(ppageno) | - (addr & PGOFSET)); - break; - } - ppageno = pptr->pde_next; - } - } -#ifdef MACHKERNELDEBUG - else if (kerneltype == OS_MACH) { - mach_vtophys(space, addr, &phys); - } -#endif -#if 0 - printf("vtophys(%x.%x) -> %x\n", space, addr, phys); -#endif - return (phys); -} - -static -kvread(addr) - CORE_ADDR addr; -{ - CORE_ADDR paddr; - - paddr = vtophys(0, addr); - if (paddr != ~0) - if (physrd(paddr, (char *)&addr, sizeof(addr)) == 0) - return (addr); - - return (~0); -} - -static void -read_pcb(addr) - u_int addr; -{ - int i, off; - extern char registers[]; - static int reg2pcb[] = { - /* RPB */ - -1, 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, 29, 30, 31, 32, 33, - 45, 52, 51, 75, 74, 49, 53, 54, 55, 56, -1, 70, 66, 67, 68, 69, - 71, 72, 73, 34, 42, 43, 44, 46, 47, 58, 59, 60, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, - /* BSD */ - -1, 0, 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, 29, 30, - 43, 64, 67, 68, 67, 47, 51, 52, 53, 54, -1, 35, 31, 32, 33, 34, - 36, 37, 38, 39, 40, 41, 42, 44, 45, 56, 57, 58,102,103,104, -1, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 82, 84, 86, 88, 90, 92, - 94, 96, 98, 100, - /* Mach */ - -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, 18, -1, - 25, -1, -1, -1, -1, 30, -1, -1, -1, -1, -1, 20, -1, -1, -1, 19, - 21, 22, 23, 24, 26, 27, -1, 28, 29, -1, -1, -1, -1, -1, -1, -1, - 34, 35, 36, 37, 38, 39, 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, - 42, 44, 46, 48 - }; - static struct rpb *rpbaddr = (struct rpb *) 0; - static u_int rpbpcbaddr = 0; - - if (!remote_debugging) { - /* - * If we are debugging a post-mortem and this is the first - * call of read_pcb, read the RPB. Also assoicate the - * thread/proc running at the time with the RPB. - */ - if (!devmem && rpbpcbaddr == 0) { - CORE_ADDR raddr = ksym_lookup("rpb"); - int usepcb = 1; - - if (raddr != ~0) { - rpbaddr = (struct rpb *) malloc(sizeof *rpbaddr); - if (!physrd(raddr, (char *)rpbaddr, sizeof *rpbaddr)) { - rpbpcbaddr = addr; - usepcb = 0; - } - } - if (usepcb) { - error("cannot read rpb, using pcb for registers\n"); - if (rpbaddr) - free((char *)rpbaddr); - rpbpcbaddr = ~0; - } - } - if (physrd (addr, (char *)&pcb, sizeof pcb)) - error ("cannot read pcb at %x.\n", addr); - } else { - if (remote_read_inferior_memory(addr, (char *)&pcb, sizeof pcb)) - error ("cannot read pcb at %x.\n", addr); - } - - if (kerneltype == OS_BSD) { - printf("p0br %lx p0lr %lx p1br %lx p1lr %lx\n", - pcb.pcb_p0br, pcb.pcb_p0lr, pcb.pcb_p1br, pcb.pcb_p1lr); - off = NUM_REGS; - } else { - printf("pcb %lx psw %lx ksp %lx\n", - addr, ((int *)&pcb)[31], ((int *)&pcb)[32]); - off = NUM_REGS * 2; - } - /* - * get the register values out of the sys pcb and - * store them where `read_register' will find them. - */ - bzero(registers, REGISTER_BYTES); - for (i = 0; i < NUM_REGS; ++i) - if (reg2pcb[i+off] != -1) - supply_register(i, &((int *)&pcb)[reg2pcb[i+off]]); - /* - * If the RPB is valid for this thread/proc use the register values - * contained there. - */ - if (addr == rpbpcbaddr) { - off = 0; - for (i = 0; i < NUM_REGS; ++i) - if (reg2pcb[i+off] != -1) - supply_register(i, &((int *)rpbaddr)[reg2pcb[i+off]]); - } -} - -void -setup_kernel_debugging() -{ - struct stat stb; - CORE_ADDR addr; - - fstat(corechan, &stb); - devmem = 0; - if ((stb.st_mode & S_IFMT) == S_IFCHR && stb.st_rdev == makedev(2, 0)) - devmem = 1; - - /* XXX */ - if (lookup_misc_func("Sysmap") < 0) - kerneltype = OS_MACH; - else - kerneltype = OS_BSD; - - if (kerneltype == OS_BSD) { - int len, err = 0; - - /* - * Hash table and PDIR are equivalently mapped - */ - nhtbl = kvread(ksym_lookup("nhtbl")); - if (nhtbl != ~0) { - len = nhtbl * sizeof(*htbl); - htbl = (struct hte *) malloc(len); - if (htbl) { - addr = kvread(ksym_lookup("htbl")); - if (physrd(addr, (char *)htbl, len)) - err++; - } else - err++; - } else - err++; - npdir = kvread(ksym_lookup("npdir")); - if (npdir != ~0) { - len = npdir * sizeof(*pdir); - pdir = (struct pde *) malloc(len); - if (pdir) { - addr = kvread(ksym_lookup("pdir")); - if (physrd(addr, (char *)pdir, len)) - err++; - } else - err++; - } else - err++; - if (err) { - error("cannot read PDIR/HTBL"); - return; - } - vtophys_ready = 1; - - /* - * pcb where "panic" saved registers in first thing in - * current u-area. The current u-area is pointed to by - * "uptr". - */ - addr = kvread(ksym_lookup("uptr")); - if (addr == ~0) { - error("cannot read current u-area address"); - return; - } - read_pcb(vtophys(0, addr)); /* XXX space */ - if (!devmem) { - /* find stack frame */ - CORE_ADDR panicstr; - char buf[256]; - register char *cp; - - panicstr = kvread(ksym_lookup("panicstr")); - if (panicstr == ~0) - return; - kernel_core_file_hook(panicstr, buf, sizeof(buf)); - for (cp = buf; cp < &buf[sizeof(buf)] && *cp; cp++) - if (!isascii(*cp) || (!isprint(*cp) && !isspace(*cp))) - *cp = '?'; - if (*cp) - *cp = '\0'; - printf("panic: %s\n", buf); - } - } -#ifdef MACHKERNELDEBUG - else { - int *thread; - - /* - * Set up address translation - */ - if (mach_vtophys_init() == 0) { - error("cannot initialize vtophys for Mach"); - return; - } - vtophys_ready = 1; - - /* - * Locate active thread and read PCB - * XXX MAJOR HACK - * - assumes uni-processor - * - assumes position of pcb to avoid mach includes - */ - thread = (int *)kvread(ksym_lookup("active_threads")); - addr = kvread(&thread[9]); /* XXX: pcb addr */ - read_pcb(vtophys(0, addr)); - } -#endif -} - -vtop_command(arg) - char *arg; -{ - u_int sp, off, pa; - - if (!arg) - error_no_arg("kernel virtual address"); - if (!kernel_debugging) - error("not debugging kernel"); - - sp = 0; /* XXX */ - off = (u_int) parse_and_eval_address(arg); - pa = vtophys(sp, off); - printf("%lx.%lx -> ", sp, off); - if (pa == ~0) - printf("\n"); - else - printf("%lx\n", pa); -} - -set_paddr_command(arg) - char *arg; -{ - u_int addr; - - if (!arg) { - if (kerneltype == OS_BSD) - error_no_arg("ps-style address for new process"); - else - error_no_arg("thread structure virtual address"); - } - if (!kernel_debugging) - error("not debugging kernel"); - - addr = (u_int) parse_and_eval_address(arg); - if (kerneltype == OS_BSD) - addr = ctob(addr); - else { - addr = kvread(&(((int *)addr)[9])); /* XXX: pcb addr */ - addr = vtophys(0, addr); /* XXX space */ - } - read_pcb(addr); - - flush_cached_frames(); - set_current_frame(create_new_frame(read_register(FP_REGNUM), read_pc())); - select_frame(get_current_frame(), 0); -} - -/* - * read len bytes from kernel virtual address 'addr' into local - * buffer 'buf'. Return 0 if read ok, 1 otherwise. On read - * errors, portion of buffer not read is zeroed. - */ -kernel_core_file_hook(addr, buf, len) - CORE_ADDR addr; - char *buf; - int len; -{ - int i; - CORE_ADDR paddr; - - while (len > 0) { - paddr = vtophys(0, addr); /* XXX space */ - if (paddr == ~0) { - bzero(buf, len); - return (1); - } - /* we can't read across a page boundary */ - i = min(len, NBPG - (addr & PGOFSET)); - if (physrd(paddr, buf, i)) { - bzero(buf, len); - return (1); - } - buf += i; - addr += i; - len -= i; - } - return (0); -} -#endif - - - - - -/* Routines to extract various sized constants out of hppa - instructions. */ - -/* This assumes that no garbage lies outside of the lower bits of - value. */ - -int -sign_extend (val, bits) - unsigned val, bits; -{ - return (int)(val >> bits - 1 ? (-1 << bits) | val : val); -} - -/* For many immediate values the sign bit is the low bit! */ - -int -low_sign_extend (val, bits) - unsigned val, bits; -{ - return (int)((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1); -} -/* extract the immediate field from a ld{bhw}s instruction */ - - - -unsigned -get_field (val, from, to) - unsigned val, from, to; -{ - val = val >> 31 - to; - return val & ((1 << 32 - from) - 1); -} - -unsigned -set_field (val, from, to, new_val) - unsigned *val, from, to; -{ - unsigned mask = ~((1 << (to - from + 1)) << (31 - from)); - return *val = *val & mask | (new_val << (31 - from)); -} - -/* extract a 3-bit space register number from a be, ble, mtsp or mfsp */ - -extract_3 (word) - unsigned word; -{ - return GET_FIELD (word, 18, 18) << 2 | GET_FIELD (word, 16, 17); -} - -extract_5_load (word) - unsigned word; -{ - return low_sign_extend (word >> 16 & MASK_5, 5); -} - -/* extract the immediate field from a st{bhw}s instruction */ - -int -extract_5_store (word) - unsigned word; -{ - return low_sign_extend (word & MASK_5, 5); -} - -/* extract an 11 bit immediate field */ - -int -extract_11 (word) - unsigned word; -{ - return low_sign_extend (word & MASK_11, 11); -} - -/* extract a 14 bit immediate field */ - -int -extract_14 (word) - unsigned word; -{ - return low_sign_extend (word & MASK_14, 14); -} - -/* deposit a 14 bit constant in a word */ - -unsigned -deposit_14 (opnd, word) - int opnd; - unsigned word; -{ - unsigned sign = (opnd < 0 ? 1 : 0); - - return word | ((unsigned)opnd << 1 & MASK_14) | sign; -} - -/* extract a 21 bit constant */ - -int -extract_21 (word) - unsigned word; -{ - int val; - - word &= MASK_21; - word <<= 11; - val = GET_FIELD (word, 20, 20); - val <<= 11; - val |= GET_FIELD (word, 9, 19); - val <<= 2; - val |= GET_FIELD (word, 5, 6); - val <<= 5; - val |= GET_FIELD (word, 0, 4); - val <<= 2; - val |= GET_FIELD (word, 7, 8); - return sign_extend (val, 21) << 11; -} - -/* deposit a 21 bit constant in a word. Although 21 bit constants are - usually the top 21 bits of a 32 bit constant, we assume that only - the low 21 bits of opnd are relevant */ - -unsigned -deposit_21 (opnd, word) - unsigned opnd, word; -{ - unsigned val = 0; - - val |= GET_FIELD (opnd, 11 + 14, 11 + 18); - val <<= 2; - val |= GET_FIELD (opnd, 11 + 12, 11 + 13); - val <<= 2; - val |= GET_FIELD (opnd, 11 + 19, 11 + 20); - val <<= 11; - val |= GET_FIELD (opnd, 11 + 1, 11 + 11); - val <<= 1; - val |= GET_FIELD (opnd, 11 + 0, 11 + 0); - return word | val; -} - -/* extract a 12 bit constant from branch instructions */ - -int -extract_12 (word) - unsigned word; -{ - return sign_extend (GET_FIELD (word, 19, 28) | - GET_FIELD (word, 29, 29) << 10 | - (word & 0x1) << 11, 12) << 2; -} - -/* extract a 17 bit constant from branch instructions, returning the - 19 bit signed value. */ - -int -extract_17 (word) - unsigned word; -{ - return sign_extend (GET_FIELD (word, 19, 28) | - GET_FIELD (word, 29, 29) << 10 | - GET_FIELD (word, 11, 15) << 11 | - (word & 0x1) << 16, 17) << 2; -} - - -CORE_ADDR -frame_saved_pc (frame) - FRAME frame; -{ - if (get_current_frame () == frame) - { - struct frame_saved_regs saved_regs; - - get_frame_saved_regs (frame, &saved_regs); - if (saved_regs.regs[RP_REGNUM]) - return read_memory_integer (saved_regs.regs[RP_REGNUM], 4); - else - return read_register (RP_REGNUM); - } - return read_memory_integer (frame->frame - 20, 4) & ~0x3; -} - -/* To see if a frame chain is valid, see if the caller looks like it - was compiled with gcc. */ - -int frame_chain_valid (chain, thisframe) - FRAME_ADDR chain; - FRAME thisframe; -{ - if (chain && (chain > 0x60000000 - /* || remote_debugging -this is no longer used */ -#ifdef KERNELDEBUG - || kernel_debugging -#endif - )) - { - CORE_ADDR pc = get_pc_function_start (FRAME_SAVED_PC (thisframe)); - - if (!inside_entry_file (pc)) - return 0; - /* look for stw rp, -20(0,sp); copy 4,1; copy sp, 4 */ - if (read_memory_integer (pc, 4) == 0x6BC23FD9) - pc = pc + 4; - - if (read_memory_integer (pc, 4) == 0x8040241 && - read_memory_integer (pc + 4, 4) == 0x81E0244) - return 1; - else - return 0; - } - else - return 0; -} - -/* Some helper functions. gcc_p returns 1 if the function beginning at - pc appears to have been compiled with gcc. hpux_cc_p returns 1 if - fn was compiled with hpux cc. gcc functions look like : - - stw rp,-0x14(sp) ; optional - or r4,r0,r1 - or sp,r0,r4 - stwm r1,framesize(sp) - - hpux cc functions look like: - - stw rp,-0x14(sp) ; optional. - stwm r3,framesiz(sp) - */ - -gcc_p (pc) - CORE_ADDR pc; -{ - if (read_memory_integer (pc, 4) == 0x6BC23FD9) - pc = pc + 4; - - if (read_memory_integer (pc, 4) == 0x8040241 && - read_memory_integer (pc + 4, 4) == 0x81E0244) - return 1; - return 0; -} - - -find_dummy_frame_regs (frame, frame_saved_regs) - struct frame_info *frame; - struct frame_saved_regs *frame_saved_regs; -{ - CORE_ADDR fp = frame->frame; - int i; - - frame_saved_regs->regs[RP_REGNUM] = fp - 20 & ~0x3; - frame_saved_regs->regs[FP_REGNUM] = fp; - frame_saved_regs->regs[1] = fp + 8; - frame_saved_regs->regs[3] = fp + 12; - for (fp += 16, i = 3; i < 30; fp += 4, i++) - frame_saved_regs->regs[i] = fp; - frame_saved_regs->regs[31] = fp; - fp += 4; - for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8) - frame_saved_regs->regs[i] = fp; - /* depend on last increment of fp */ - frame_saved_regs->regs[IPSW_REGNUM] = fp - 4; - frame_saved_regs->regs[SAR_REGNUM] = fp; - fp += 4; - frame_saved_regs->regs[PCOQ_TAIL_REGNUM] = fp; - frame_saved_regs->regs[PCSQ_TAIL_REGNUM] = fp; -} - -CORE_ADDR -hp_push_arguments (nargs, args, sp, struct_return, struct_addr) - int nargs; - value *args; - CORE_ADDR sp; - int struct_return; - CORE_ADDR struct_addr; -{ - /* array of arguments' offsets */ - int *offset = (int *)alloca(nargs); - int cum = 0; - int i, alignment; - - for (i = 0; i < nargs; i++) - { - cum += TYPE_LENGTH (VALUE_TYPE (args[i])); - /* value must go at proper alignment. Assume alignment is a - power of two.*/ - alignment = hp_alignof (VALUE_TYPE (args[i])); - if (cum % alignment) - cum = (cum + alignment) & -alignment; - offset[i] = -cum; - } - for (i == 0; i < nargs; i++) - { - write_memory (sp + offset[i], VALUE_CONTENTS (args[i]), sizeof(int)); - } - sp += min ((cum + 7) & -8, 48); - if (struct_return) - write_register (28, struct_addr); - return sp + 48; -} - -/* return the alignment of a type in bytes. Structures have the maximum - alignment required by their fields. */ - -int -hp_alignof (arg) - struct type *arg; -{ - int max_align, align, i; - switch (TYPE_CODE (arg)) - { - case TYPE_CODE_PTR: - case TYPE_CODE_INT: - case TYPE_CODE_FLT: - return TYPE_LENGTH (arg); - case TYPE_CODE_ARRAY: - return hp_alignof (TYPE_FIELD_TYPE (arg, 0)); - case TYPE_CODE_STRUCT: - case TYPE_CODE_UNION: - max_align = 2; - for (i = 0; i < TYPE_NFIELDS (arg); i++) - { - /* Bit fields have no real alignment. */ - if (!TYPE_FIELD_BITPOS (arg, i)) - { - align = hp_alignof (TYPE_FIELD_TYPE (arg, i)); - max_align = max (max_align, align); - } - } - return max_align; - default: - return 4; - } -} - -/* Print the register regnum, or all registers if regnum is -1 */ - -pa_do_registers_info (regnum, fpregs) - int regnum; - int fpregs; -{ - char raw_regs [REGISTER_BYTES]; - int i; - - for (i = 0; i < NUM_REGS; i++) - read_relative_register_raw_bytes (i, raw_regs + REGISTER_BYTE (i)); - if (regnum = -1) - pa_print_registers (raw_regs, regnum); - else if (regnum < FP0_REGNUM) - { - printf ("%s %x\n", reg_names[regnum], *(long *)(raw_regs + - REGISTER_BYTE (regnum))); - } - else - pa_print_fp_reg (regnum); -} - -pa_print_registers (raw_regs, regnum) - char *raw_regs; - int regnum; -{ - int i; - - for (i = 0; i < 18; i++) - printf ("%8.8s: %8x %8.8s: %8x %8.8s: %8x %8.8s: %8x\n", - reg_names[i], - *(int *)(raw_regs + REGISTER_BYTE (i)), - reg_names[i + 18], - *(int *)(raw_regs + REGISTER_BYTE (i + 18)), - reg_names[i + 36], - *(int *)(raw_regs + REGISTER_BYTE (i + 36)), - reg_names[i + 54], - *(int *)(raw_regs + REGISTER_BYTE (i + 54))); - for (i = 72; i < NUM_REGS; i++) - pa_print_fp_reg (i); -} - -pa_print_fp_reg (i) - int i; -{ - unsigned char raw_buffer[MAX_REGISTER_RAW_SIZE]; - unsigned char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE]; - REGISTER_TYPE val; - - /* Get the data in raw format, then convert also to virtual format. */ - read_relative_register_raw_bytes (i, raw_buffer); - REGISTER_CONVERT_TO_VIRTUAL (i, raw_buffer, virtual_buffer); - - fputs_filtered (reg_names[i], stdout); - print_spaces_filtered (15 - strlen (reg_names[i]), stdout); - - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, stdout, 0, - 1, 0, Val_pretty_default); - printf_filtered ("\n"); - -} - -/* - * Virtual to physical translation routines for Utah's Mach 3.0 - */ -#ifdef MACHKERNELDEBUG - -#define STATIC - -#if 0 /* too many includes to resolve, too much crap */ -#include -#include -#include -#else -/* queue.h */ -struct queue_entry { - struct queue_entry *next; /* next element */ - struct queue_entry *prev; /* previous element */ -}; - -typedef struct queue_entry *queue_t; -typedef struct queue_entry queue_head_t; -typedef struct queue_entry queue_chain_t; -typedef struct queue_entry *queue_entry_t; - -/* pmap.h */ -#define HP800_HASHSIZE 1024 -#define HP800_HASHSIZE_LOG2 10 - -#define pmap_hash(space, offset) \ - (((unsigned) (space) << 5 ^ \ - ((unsigned) (offset) >> 19 | (unsigned) (space) << 13) ^ \ - (unsigned) (offset) >> 11) & (HP800_HASHSIZE-1)) - -struct mapping { - queue_head_t hash_link; /* hash table links */ - queue_head_t phys_link; /* for mappings of a given PA */ - space_t space; /* virtual space */ - unsigned offset; /* virtual page number */ - unsigned tlbpage; /* physical page (for TLB load) */ - unsigned tlbprot; /* prot/access rights (for TLB load) */ - struct pmap *pmap; /* pmap mapping belongs to */ -}; - -struct phys_entry { - queue_head_t phys_link; /* head of mappings of a given PA */ - struct mapping *writer; /* mapping with R/W access */ - unsigned tlbprot; /* TLB format protection */ -}; - -#endif - -#define atop(a) ((unsigned)(a) >> 11) -#define ptoa(p) ((unsigned)(p) << 11) -#define trunc_page(a) ((unsigned)(a) & ~2047) - -STATIC long equiv_end; -STATIC queue_head_t *Ovtop_table, *vtop_table, *Ofree_mapping, free_mapping; -STATIC struct phys_entry *Ophys_table, *phys_table; -STATIC long vm_last_phys, vm_first_phys; -STATIC struct mapping *firstmap, *lastmap, *Omap_table, *map_table; -STATIC unsigned Omlow, Omhigh, Omhead, Ovlow, Ovhigh, Oplow, Ophigh; -STATIC unsigned mlow, mhigh, mhead, vlow, vhigh, plow, phigh; -STATIC int vtopsize, physsize, mapsize; -STATIC int kmemfd; - -#define IS_OVTOPPTR(p) ((unsigned)(p) >= Ovlow && (unsigned)(p) < Ovhigh) -#define IS_OMAPPTR(p) ((unsigned)(p) >= Omlow && (unsigned)(p) < Omhigh) -#define IS_OPHYSPTR(p) ((unsigned)(p) >= Oplow && (unsigned)(p) < Ophigh) -#define IS_VTOPPTR(p) ((unsigned)(p) >= vlow && (unsigned)(p) < vhigh) -#define IS_MAPPTR(p) ((unsigned)(p) >= mlow && (unsigned)(p) < mhigh) -#define IS_PHYSPTR(p) ((unsigned)(p) >= plow && (unsigned)(p) < phigh) - -struct mapstate { - char unused; - char flags; - short hashix; - short physix; -} *mapstate; - -/* flags */ -#define M_ISFREE 1 -#define M_ISHASH 2 -#define M_ISPHYS 4 - -mach_vtophys_init() -{ - int errors = 0; - - if (!readdata()) - errors++; - if (!verifydata()) - errors++; - if (!errors) - return(1); - fflush(stdout); - fprintf(stderr, - "translate: may not be able to translate all addresses\n"); - return(0); -} - -mach_vtophys(space, off, pa) - unsigned space, off, *pa; -{ - register int i; - register queue_t qp; - register struct mapping *mp; - int poff; - - /* - * Kernel IO or equivilently mapped, one to one. - */ - if (space == 0 && (long)off < equiv_end) { - *pa = off; - return(1); - } - /* - * Else look it up in specified space - */ - poff = off - trunc_page(off); - off = trunc_page(off); - qp = &vtop_table[pmap_hash(space, off)]; - for (mp = (struct mapping *)qp->next; - qp != (queue_entry_t)mp; - mp = (struct mapping *)mp->hash_link.next) { - if (mp->space == space && mp->offset == off) { - *pa = (mp->tlbpage << 7) | poff; - return(1); - } - } - return(0); -} - -STATIC -readdata() -{ - char *tmp, *mach_malloc(); - long size; - - /* easy scalars */ - mach_read("equiv_end", ~0, (char *)&equiv_end, sizeof equiv_end); - mach_read("vm_first_phys", ~0, - (char *)&vm_first_phys, sizeof vm_first_phys); - mach_read("vm_last_phys", ~0, - (char *)&vm_last_phys, sizeof vm_last_phys); - mach_read("firstmap", ~0, (char *)&firstmap, sizeof firstmap); - mach_read("lastmap", ~0, (char *)&lastmap, sizeof lastmap); - - /* virtual to physical hash table */ - vtopsize = HP800_HASHSIZE; - size = vtopsize * sizeof(queue_head_t); - tmp = mach_malloc("vtop table", size); - mach_read("vtop_table", ~0, (char *)&Ovtop_table, sizeof Ovtop_table); - mach_read("vtop table", (CORE_ADDR)Ovtop_table, tmp, size); - vtop_table = (queue_head_t *) tmp; - - /* inverted page table */ - physsize = atop(vm_last_phys - vm_first_phys); - size = physsize * sizeof(struct phys_entry); - tmp = mach_malloc("phys table", size); - mach_read("phys_table", ~0, (char *)&Ophys_table, sizeof Ophys_table); - mach_read("phys table", (CORE_ADDR)Ophys_table, tmp, size); - phys_table = (struct phys_entry *) tmp; - - /* mapping structures */ - Ofree_mapping = (queue_head_t *) ksym_lookup("free_mapping"); - mach_read("free mapping", (CORE_ADDR)Ofree_mapping, - (char *) &free_mapping, sizeof free_mapping); - Omap_table = firstmap; - mapsize = lastmap - firstmap; - size = mapsize * sizeof(struct mapping); - tmp = mach_malloc("mapping table", size); - mach_read("mapping table", (CORE_ADDR)Omap_table, tmp, size); - map_table = (struct mapping *) tmp; - - /* set limits */ - Ovlow = (unsigned) Ovtop_table; - Ovhigh = (unsigned) &Ovtop_table[vtopsize]; - Oplow = (unsigned) Ophys_table; - Ophigh = (unsigned) &Ophys_table[physsize]; - Omhead = (unsigned) Ofree_mapping; - Omlow = (unsigned) firstmap; - Omhigh = (unsigned) lastmap; - mlow = (unsigned) map_table; - mhigh = (unsigned) &map_table[mapsize]; - mhead = (unsigned) &free_mapping; - vlow = (unsigned) vtop_table; - vhigh = (unsigned) &vtop_table[vtopsize]; - plow = (unsigned) phys_table; - phigh = (unsigned) &phys_table[physsize]; - -#if 0 - fprintf(stderr, "Ovtop [%#x-%#x) Ophys [%#x-%#x) Omap %#x [%#x-%#x)\n", - Ovlow, Ovhigh, Oplow, Ophigh, Omhead, Omlow, Omhigh); - fprintf(stderr, "vtop [%#x-%#x) phys [%#x-%#x) map %#x [%#x-%#x)\n", - vlow, vhigh, plow, phigh, mhead, mlow, mhigh); -#endif - return(adjustdata()); -} - -STATIC unsigned -ptrcvt(ptr) - unsigned ptr; -{ - unsigned ret; - char *str; - - if (ptr == 0) { - ret = ptr; - str = "null"; - } else if (IS_OVTOPPTR(ptr)) { - ret = vlow + (ptr - Ovlow); - str = "vtop"; - } else if (IS_OPHYSPTR(ptr)) { - ret = plow + (ptr - Oplow); - str = "phys"; - } else if (IS_OMAPPTR(ptr)) { - ret = mlow + (ptr - Omlow); - str = "map"; - } else if (ptr == Omhead) { - ret = mhead; - str = "maphead"; - } else { - error("bogus pointer %#x", ptr); - str = "wild"; - ret = ptr; - } -#if 0 - fprintf(stderr, "%x (%s) -> %x\n", ptr, str, ret); -#endif - return(ret); -} - -STATIC int -adjustdata() -{ - register int i, lim; - queue_head_t *nq; - struct phys_entry *np; - struct mapping *nm; - - /* hash table */ - lim = vtopsize; - for (nq = vtop_table; nq < &vtop_table[lim]; nq++) { - nq->next = (queue_entry_t) ptrcvt((unsigned)nq->next); - nq->prev = (queue_entry_t) ptrcvt((unsigned)nq->prev); - } - - /* IPT */ - lim = physsize; - for (np = phys_table; np < &phys_table[lim]; np++) { - np->phys_link.next = (queue_entry_t) - ptrcvt((unsigned)np->phys_link.next); - np->phys_link.prev = (queue_entry_t) - ptrcvt((unsigned)np->phys_link.prev); - np->writer = (struct mapping *) ptrcvt((unsigned)np->writer); - } - - /* mapping table */ - free_mapping.next = (queue_entry_t)ptrcvt((unsigned)free_mapping.next); - free_mapping.prev = (queue_entry_t)ptrcvt((unsigned)free_mapping.prev); - lim = mapsize; - for (nm = map_table; nm < &map_table[lim]; nm++) { - nm->hash_link.next = (queue_entry_t) - ptrcvt((unsigned)nm->hash_link.next); - nm->hash_link.prev = (queue_entry_t) - ptrcvt((unsigned)nm->hash_link.prev); - nm->phys_link.next = (queue_entry_t) - ptrcvt((unsigned)nm->phys_link.next); - nm->phys_link.prev = (queue_entry_t) - ptrcvt((unsigned)nm->phys_link.prev); - } - return(1); -} - -/* - * Consistency checks, make sure: - * - * 1. all mappings are accounted for - * 2. no cycles - * 3. no wild pointers - * 4. consisent TLB state - */ -STATIC int -verifydata() -{ - register struct mapstate *ms; - register int i; - int errors = 0; - - mapstate = (struct mapstate *) - mach_malloc("map state", mapsize * sizeof(struct mapstate)); - for (ms = mapstate; ms < &mapstate[mapsize]; ms++) { - ms->flags = 0; - ms->hashix = ms->physix = -2; - } - - /* - * Check the free list - */ - checkhashchain(&free_mapping, M_ISFREE, -1); - /* - * Check every hash chain - */ - for (i = 0; i < vtopsize; i++) - checkhashchain(&vtop_table[i], M_ISHASH, i); - /* - * Check every phys chain - */ - for (i = 0; i < physsize; i++) - checkphyschain(&phys_table[i].phys_link, M_ISPHYS, i); - /* - * Cycle through mapstate looking for anomolies - */ - ms = mapstate; - for (i = 0; i < mapsize; i++) { - switch (ms->flags) { - case M_ISFREE: - case M_ISHASH|M_ISPHYS: - break; - case 0: - merror(ms, "not found"); - errors++; - break; - case M_ISHASH: - merror(ms, "in vtop but not phys"); - errors++; - break; - case M_ISPHYS: - merror(ms, "in phys but not vtop"); - errors++; - break; - default: - merror(ms, "totally bogus"); - errors++; - break; - } - ms++; - } - return(errors ? 0 : 1); -} - -STATIC void -checkhashchain(qhp, flag, ix) - queue_entry_t qhp; -{ - register queue_entry_t qp, pqp; - register struct mapping *mp; - struct mapstate *ms; - - qp = qhp->next; - /* - * First element is not a mapping structure, - * chain must be empty. - */ - if (!IS_MAPPTR(qp)) { - if (qp != qhp || qp != qhp->prev) - fatal("bad vtop_table header pointer"); - } else { - pqp = qhp; - do { - mp = (struct mapping *) qp; - qp = &mp->hash_link; - if (qp->prev != pqp) - fatal("bad hash_link prev pointer"); - ms = &mapstate[mp-map_table]; - ms->flags |= flag; - ms->hashix = ix; - pqp = (queue_entry_t) mp; - qp = qp->next; - } while (IS_MAPPTR(qp)); - if (qp != qhp) - fatal("bad hash_link next pointer"); - } -} - -STATIC void -checkphyschain(qhp, flag, ix) - queue_entry_t qhp; -{ - register queue_entry_t qp, pqp; - register struct mapping *mp; - struct mapstate *ms; - - qp = qhp->next; - /* - * First element is not a mapping structure, - * chain must be empty. - */ - if (!IS_MAPPTR(qp)) { - if (qp != qhp || qp != qhp->prev) - fatal("bad phys_table header pointer"); - } else { - pqp = qhp; - do { - mp = (struct mapping *) qp; - qp = &mp->phys_link; - if (qp->prev != pqp) - fatal("bad phys_link prev pointer"); - ms = &mapstate[mp-map_table]; - ms->flags |= flag; - ms->physix = ix; - pqp = (queue_entry_t) mp; - qp = qp->next; - } while (IS_MAPPTR(qp)); - if (qp != qhp) - fatal("bad phys_link next pointer"); - } -} - -STATIC void -merror(ms, str) - struct mapstate *ms; - char *str; -{ - terminal_ours(); - fflush(stdout); - fprintf(stderr, - "vtophys: %s: %c%c%c, hashix %d, physix %d, mapping %x\n", - str, - (ms->flags & M_ISFREE) ? 'F' : '-', - (ms->flags & M_ISHASH) ? 'H' : '-', - (ms->flags & M_ISPHYS) ? 'P' : '-', - ms->hashix, ms->physix, &map_table[ms-mapstate]); - return_to_top_level(); -} - -STATIC int -mach_read(str, from, top, size) - char *str; - CORE_ADDR from; - char *top; - int size; -{ - CORE_ADDR paddr; - - if (from == ~0) - from = ksym_lookup(str); - paddr = vtophys(0, from); - if (paddr == ~0 || physrd(paddr, top, size) != 0) - fatal("cannot read %s", str); -} - -STATIC char * -mach_malloc(str, size) - char *str; - int size; -{ - char *ptr = (char *) malloc(size); - - if (ptr == 0) - fatal("no memory for %s", str); - return(ptr); -} -#endif - -#ifdef KERNELDEBUG -void -_initialize_hp9k8_dep() -{ - add_com ("process-address", class_obscure, set_paddr_command, -"The process identified by (ps-style) ADDR becomes the\n\ -\"current\" process context for kernel debugging."); - add_com_alias ("paddr", "process-address", class_obscure, 0); - add_com ("virtual-to-physical", class_obscure, vtop_command, -"Translates the kernel virtual address ADDR into a physical address."); - add_com_alias ("vtop", "virtual-to-physical", class_obscure, 0); -} -#endif diff --git a/gdb/hppabsd-xdep.c b/gdb/hppabsd-xdep.c index bec14c4c4b..e69de29bb2 100644 --- a/gdb/hppabsd-xdep.c +++ b/gdb/hppabsd-xdep.c @@ -1,413 +0,0 @@ -/* Machine-dependent code which would otherwise be in infptrace.c, - for GDB, the GNU debugger. This code is for the HP PA-RISC cpu. - Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.edu). - -/* 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 "defs.h" -#include "frame.h" -#include "inferior.h" -#include "target.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include -#ifndef USG -#include -#endif - - -#ifndef PT_ATTACH -#define PT_ATTACH PTRACE_ATTACH -#endif -#ifndef PT_DETACH -#define PT_DETACH PTRACE_DETACH -#endif - -#include "gdbcore.h" -#include /* After a.out.h */ -#include -#include - -/* 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; - PTRACE_ARG3_TYPE addr; - int 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 - -void -kill_inferior () -{ - if (inferior_pid == 0) - return; - ptrace (PT_KILL, inferior_pid, (PTRACE_ARG3_TYPE) 0, 0); - wait ((int *)0); - 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 (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 1, signal); - else - ptrace (PT_CONTINUE, inferior_pid, (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 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; - -#include /* For struct nlist */ - -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, \ - (PTRACE_ARG3_TYPE) (offsetof (struct user, u_ar0)), 0) \ - - KERNEL_U_ADDR -#endif - -/* Registers we shouldn't try to fetch. */ -#if !defined (CANNOT_FETCH_REGISTER) -#define CANNOT_FETCH_REGISTER(regno) 0 -#endif - -/* Fetch one register. */ - -static void -fetch_register (regno) - int regno; -{ - register unsigned int regaddr; - char buf[MAX_REGISTER_RAW_SIZE]; - char mess[128]; /* For messages */ - register int i; - - /* Offset of registers within the u area. */ - unsigned int offset; - - if (CANNOT_FETCH_REGISTER (regno)) - { - bzero (buf, REGISTER_RAW_SIZE (regno)); /* Supply zeroes */ - supply_register (regno, buf); - return; - } - - offset = U_REGS_OFFSET; - - regaddr = register_addr (regno, offset); - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - errno = 0; - *(int *) &buf[i] = ptrace (PT_RUREGS, inferior_pid, - (PTRACE_ARG3_TYPE) regaddr, 0); - regaddr += sizeof (int); - if (errno != 0) - { - sprintf (mess, "reading register %s (#%d)", reg_names[regno], regno); - perror_with_name (mess); - } - } - if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) - buf[3] &= ~0x3; - 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). */ - -void -store_inferior_registers (regno) - int regno; -{ - register unsigned int regaddr; - char buf[80]; - extern char registers[]; - register int i; - - 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, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i]); - if (errno != 0) - { - sprintf (buf, "writing register number %d(%d)", regno, i); - perror_with_name (buf); - } - 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, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i]); - if (errno != 0) - { - sprintf (buf, "writing register number %d(%d)", regno, i); - perror_with_name (buf); - } - regaddr += sizeof(int); - } - } - } - return; -} -#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, (PTRACE_ARG3_TYPE) addr, - 0); - } - - if (count > 1) /* FIXME, avoid if even boundary */ - { - buffer[count - 1] - = ptrace (PT_READ_I, inferior_pid, - (PTRACE_ARG3_TYPE) (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, (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 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, - (PTRACE_ARG3_TYPE) 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/hppah-xdep.c b/gdb/hppah-xdep.c index a556998928..e69de29bb2 100644 --- a/gdb/hppah-xdep.c +++ b/gdb/hppah-xdep.c @@ -1,417 +0,0 @@ -/* Host-dependent code for HP PA-RISC runing HP/UX, for GDB. - Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.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. */ - -#include "defs.h" -#include "frame.h" -#include "inferior.h" -#include "target.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include - -#include - - -#ifndef PT_ATTACH -#define PT_ATTACH PTRACE_ATTACH -#endif -#ifndef PT_DETACH -#define PT_DETACH PTRACE_DETACH -#endif - -#include "gdbcore.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; - PTRACE_ARG3_TYPE addr; - int data; -{ - return ptrace (request, pid, addr, data, 0); -} - -#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 - -void -kill_inferior () -{ - if (inferior_pid == 0) - return; - ptrace (PT_EXIT, inferior_pid, (PTRACE_ARG3_TYPE) 0, 0, 0); /* PT_EXIT = PT_KILL ? */ - wait ((int *)0); - 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 (PTRACE_ARG3_TYPE) 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_SINGLE, inferior_pid, (PTRACE_ARG3_TYPE) 1, signal, 0); - else - ptrace (PT_CONTIN, inferior_pid, (PTRACE_ARG3_TYPE) 1, signal, 0); - - 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, (PTRACE_ARG3_TYPE) 0, 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, (PTRACE_ARG3_TYPE) 1, signal, 0); - 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; - -#include /* For struct nlist */ - -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, \ - (PTRACE_ARG3_TYPE) (offsetof (struct user, u_ar0)), 0, 0) \ - - KERNEL_U_ADDR -#endif - -/* Registers we shouldn't try to fetch. */ -#if !defined (CANNOT_FETCH_REGISTER) -#define CANNOT_FETCH_REGISTER(regno) 0 -#endif - -/* Fetch one register. */ - -static void -fetch_register (regno) - int regno; -{ - register unsigned int regaddr; - char buf[MAX_REGISTER_RAW_SIZE]; - char mess[128]; /* For messages */ - register int i; - - /* Offset of registers within the u area. */ - unsigned int offset; - - if (CANNOT_FETCH_REGISTER (regno)) - { - bzero (buf, REGISTER_RAW_SIZE (regno)); /* Supply zeroes */ - supply_register (regno, buf); - return; - } - - offset = U_REGS_OFFSET; - - regaddr = register_addr (regno, offset); - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - errno = 0; - *(int *) &buf[i] = ptrace (PT_RUREGS, inferior_pid, - (PTRACE_ARG3_TYPE) regaddr, 0, 0); - regaddr += sizeof (int); - if (errno != 0) - { - sprintf (mess, "reading register %s (#%d)", reg_names[regno], regno); - perror_with_name (mess); - } - } - 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). */ - -void -store_inferior_registers (regno) - int regno; -{ - register unsigned int regaddr; - char buf[80]; - extern char registers[]; - register int i; - - 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_WUAREA, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i], 0); - if (errno != 0) - { - sprintf (buf, "writing register number %d(%d)", regno, i); - perror_with_name (buf); - } - 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_WUAREA, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i], 0); - if (errno != 0) - { - sprintf (buf, "writing register number %d(%d)", regno, i); - perror_with_name (buf); - } - regaddr += sizeof(int); - } - } - } - return; -} -#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_RIUSER, inferior_pid, - (PTRACE_ARG3_TYPE) addr, 0, 0); - } - - if (count > 1) /* FIXME, avoid if even boundary */ - { - buffer[count - 1] - = ptrace (PT_RIUSER, inferior_pid, - (PTRACE_ARG3_TYPE) (addr + (count - 1) * sizeof (int)), - 0, 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)) - { -#if 0 -/* The HP-UX kernel crashes if you use PT_WDUSER to write into the text - segment. FIXME -- does it work to write into the data segment using - WIUSER, or do these idiots really expect us to figure out which segment - the address is in, so we can use a separate system call for it??! */ - errno = 0; - ptrace (PT_WDUSER, inferior_pid, (PTRACE_ARG3_TYPE) addr, - buffer[i], 0); - if (errno) -#endif - { - /* Using the appropriate one (I or D) is necessary for - Gould NP1, at least. */ - errno = 0; - ptrace (PT_WIUSER, inferior_pid, (PTRACE_ARG3_TYPE) addr, - buffer[i], 0); - } - if (errno) - return 0; - } - } - else - { - /* Read all the longwords */ - for (i = 0; i < count; i++, addr += sizeof (int)) - { - errno = 0; - buffer[i] = ptrace (PT_RIUSER, inferior_pid, - (PTRACE_ARG3_TYPE) addr, 0, 0); - if (errno) - return 0; - QUIT; - } - - /* Copy appropriate bytes out of the buffer. */ - bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len); - } - return len; -} - - - - -int -getpagesize() -{ - return(4096); -} diff --git a/gdb/hppahpux-tdep.c b/gdb/hppahpux-tdep.c index 27bf9e9726..e69de29bb2 100644 --- a/gdb/hppahpux-tdep.c +++ b/gdb/hppahpux-tdep.c @@ -1,1427 +0,0 @@ -/* Machine-dependent code which would otherwise be in inflow.c and core.c, - for GDB, the GNU debugger. This code is for the HP PA-RISC cpu. - Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.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. */ - -#include "defs.h" -#include "frame.h" -#include "inferior.h" -#include "value.h" - -/* For argument passing to the inferior */ -#include "symtab.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include - -#ifdef COFF_ENCAPSULATE -#include "a.out.encap.h" -#else -#include -#endif -#ifndef N_SET_MAGIC -#define N_SET_MAGIC(exec, val) ((exec).a_magic = (val)) -#endif - -/*#include After a.out.h */ -#include -#include -#include -#include - -#ifdef KERNELDEBUG -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern int kernel_debugging; -extern CORE_ADDR startup_file_start; -extern CORE_ADDR startup_file_end; - -#define KERNOFF ((unsigned)KERNBASE) -#define INKERNEL(x) ((x) >= KERNOFF && (x) < KERNOFF + ctob(slr)) - -static int ok_to_cache(); -static void set_kernel_boundaries(); - -int devmem = 0; -int vtophys_ready = 0; -int kerneltype; -#define OS_BSD 1 -#define OS_MACH 2 -#endif - -#include "gdbcore.h" -#include "gdbcmd.h" - -extern int errno; - - - - - - -/* Last modification time of executable file. - Also used in source.c to compare against mtime of a source file. */ - -extern int exec_mtime; - -/* Virtual addresses of bounds of the two areas of memory in the core file. */ - -/* extern CORE_ADDR data_start; */ -extern CORE_ADDR data_end; -extern CORE_ADDR stack_start; -extern CORE_ADDR stack_end; - -/* Virtual addresses of bounds of two areas of memory in the exec file. - Note that the data area in the exec file is used only when there is no core file. */ - -extern CORE_ADDR text_start; -extern CORE_ADDR text_end; - -extern CORE_ADDR exec_data_start; -extern CORE_ADDR exec_data_end; - -/* Address in executable file of start of text area data. */ - -extern int text_offset; - -/* Address in executable file of start of data area data. */ - -extern int exec_data_offset; - -/* Address in core file of start of data area data. */ - -extern int data_offset; - -/* Address in core file of start of stack area data. */ - -extern int stack_offset; - -struct header file_hdr; -struct som_exec_auxhdr exec_hdr; - -#ifdef KERNELDEBUG -/* - * Kernel debugging routines. - */ - -static struct pcb pcb; -static struct pde *pdir; -static struct hte *htbl; -static u_int npdir, nhtbl; - -static CORE_ADDR -ksym_lookup(name) - char *name; -{ - struct symbol *sym; - int i; - - if ((i = lookup_misc_func(name)) < 0) - error("kernel symbol `%s' not found.", name); - - return (misc_function_vector[i].address); -} - -/* - * (re-)set the variables that tell "inside_entry_file" where to end - * a stack backtrace. - */ -void -set_kernel_boundaries() -{ - switch (kerneltype) { - case OS_MACH: - startup_file_start = ksym_lookup("$syscall"); - startup_file_end = ksym_lookup("trap"); - break; - case OS_BSD: - startup_file_start = ksym_lookup("syscallinit"); - startup_file_end = ksym_lookup("$syscallexit"); - break; - } -} - -/* - * return true if 'len' bytes starting at 'addr' can be read out as - * longwords and/or locally cached (this is mostly for memory mapped - * i/o register access when debugging remote kernels). - */ -static int -ok_to_cache(addr, len) -{ - static CORE_ADDR ioptr; - - if (! ioptr) - ioptr = ksym_lookup("ioptr"); - - if (addr >= ioptr && addr < SPA_HIGH) - return (0); - - return (1); -} - -static -physrd(addr, dat, len) - u_int addr; - char *dat; -{ - if (lseek(corechan, addr, L_SET) == -1) - return (-1); - if (read(corechan, dat, len) != len) - return (-1); - - return (0); -} - -/* - * When looking at kernel data space through /dev/mem or with a core file, do - * virtual memory mapping. - */ -static CORE_ADDR -vtophys(space, addr) - unsigned space; - CORE_ADDR addr; -{ - struct pde *pptr; - u_int hindx, vpageno, ppageno; - CORE_ADDR phys = ~0; - - if (!vtophys_ready) { - phys = addr; /* XXX for kvread */ - } else if (kerneltype == OS_BSD) { - /* make offset into a virtual page no */ - vpageno = btop(addr); - /* - * Determine index into hash table, initialize pptr to this - * entry (since first word of pte & hte are same), and set - * physical page number for first entry in chain. - */ - hindx = pdirhash(space, addr) & (nhtbl-1); - pptr = (struct pde *) &htbl[hindx]; - ppageno = pptr->pde_next; - while (1) { - if (pptr->pde_end) - break; - pptr = &pdir[ppageno]; - /* - * If space id & virtual page number match, return - * "next PDIR entry of previous PDIR entry" as the - * physical page or'd with offset into page. - */ - if (pptr->pde_space == space && - pptr->pde_page == vpageno) { - phys = (CORE_ADDR) ((u_int)ptob(ppageno) | - (addr & PGOFSET)); - break; - } - ppageno = pptr->pde_next; - } - } -#ifdef MACHKERNELDEBUG - else if (kerneltype == OS_MACH) { - mach_vtophys(space, addr, &phys); - } -#endif -#if 0 - printf("vtophys(%x.%x) -> %x\n", space, addr, phys); -#endif - return (phys); -} - -static -kvread(addr) - CORE_ADDR addr; -{ - CORE_ADDR paddr; - - paddr = vtophys(0, addr); - if (paddr != ~0) - if (physrd(paddr, (char *)&addr, sizeof(addr)) == 0) - return (addr); - - return (~0); -} - -static void -read_pcb(addr) - u_int addr; -{ - int i, off; - extern char registers[]; - static int reg2pcb[] = { - /* RPB */ - -1, 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, 29, 30, 31, 32, 33, - 45, 52, 51, 75, 74, 49, 53, 54, 55, 56, -1, 70, 66, 67, 68, 69, - 71, 72, 73, 34, 42, 43, 44, 46, 47, 58, 59, 60, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, - /* BSD */ - -1, 0, 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, 29, 30, - 43, 64, 67, 68, 67, 47, 51, 52, 53, 54, -1, 35, 31, 32, 33, 34, - 36, 37, 38, 39, 40, 41, 42, 44, 45, 56, 57, 58,102,103,104, -1, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 82, 84, 86, 88, 90, 92, - 94, 96, 98, 100, - /* Mach */ - -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, 18, -1, - 25, -1, -1, -1, -1, 30, -1, -1, -1, -1, -1, 20, -1, -1, -1, 19, - 21, 22, 23, 24, 26, 27, -1, 28, 29, -1, -1, -1, -1, -1, -1, -1, - 34, 35, 36, 37, 38, 39, 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, - 42, 44, 46, 48 - }; - static struct rpb *rpbaddr = (struct rpb *) 0; - static u_int rpbpcbaddr = 0; - - if (!remote_debugging) { - /* - * If we are debugging a post-mortem and this is the first - * call of read_pcb, read the RPB. Also assoicate the - * thread/proc running at the time with the RPB. - */ - if (!devmem && rpbpcbaddr == 0) { - CORE_ADDR raddr = ksym_lookup("rpb"); - int usepcb = 1; - - if (raddr != ~0) { - rpbaddr = (struct rpb *) malloc(sizeof *rpbaddr); - if (!physrd(raddr, (char *)rpbaddr, sizeof *rpbaddr)) { - rpbpcbaddr = addr; - usepcb = 0; - } - } - if (usepcb) { - error("cannot read rpb, using pcb for registers\n"); - if (rpbaddr) - free((char *)rpbaddr); - rpbpcbaddr = ~0; - } - } - if (physrd (addr, (char *)&pcb, sizeof pcb)) - error ("cannot read pcb at %x.\n", addr); - } else { - if (remote_read_inferior_memory(addr, (char *)&pcb, sizeof pcb)) - error ("cannot read pcb at %x.\n", addr); - } - - if (kerneltype == OS_BSD) { - printf("p0br %lx p0lr %lx p1br %lx p1lr %lx\n", - pcb.pcb_p0br, pcb.pcb_p0lr, pcb.pcb_p1br, pcb.pcb_p1lr); - off = NUM_REGS; - } else { - printf("pcb %lx psw %lx ksp %lx\n", - addr, ((int *)&pcb)[31], ((int *)&pcb)[32]); - off = NUM_REGS * 2; - } - /* - * get the register values out of the sys pcb and - * store them where `read_register' will find them. - */ - bzero(registers, REGISTER_BYTES); - for (i = 0; i < NUM_REGS; ++i) - if (reg2pcb[i+off] != -1) - supply_register(i, &((int *)&pcb)[reg2pcb[i+off]]); - /* - * If the RPB is valid for this thread/proc use the register values - * contained there. - */ - if (addr == rpbpcbaddr) { - off = 0; - for (i = 0; i < NUM_REGS; ++i) - if (reg2pcb[i+off] != -1) - supply_register(i, &((int *)rpbaddr)[reg2pcb[i+off]]); - } -} - -void -setup_kernel_debugging() -{ - struct stat stb; - CORE_ADDR addr; - - fstat(corechan, &stb); - devmem = 0; - if ((stb.st_mode & S_IFMT) == S_IFCHR && stb.st_rdev == makedev(2, 0)) - devmem = 1; - - /* XXX */ - if (lookup_misc_func("Sysmap") < 0) - kerneltype = OS_MACH; - else - kerneltype = OS_BSD; - - if (kerneltype == OS_BSD) { - int len, err = 0; - - /* - * Hash table and PDIR are equivalently mapped - */ - nhtbl = kvread(ksym_lookup("nhtbl")); - if (nhtbl != ~0) { - len = nhtbl * sizeof(*htbl); - htbl = (struct hte *) malloc(len); - if (htbl) { - addr = kvread(ksym_lookup("htbl")); - if (physrd(addr, (char *)htbl, len)) - err++; - } else - err++; - } else - err++; - npdir = kvread(ksym_lookup("npdir")); - if (npdir != ~0) { - len = npdir * sizeof(*pdir); - pdir = (struct pde *) malloc(len); - if (pdir) { - addr = kvread(ksym_lookup("pdir")); - if (physrd(addr, (char *)pdir, len)) - err++; - } else - err++; - } else - err++; - if (err) { - error("cannot read PDIR/HTBL"); - return; - } - vtophys_ready = 1; - - /* - * pcb where "panic" saved registers in first thing in - * current u-area. The current u-area is pointed to by - * "uptr". - */ - addr = kvread(ksym_lookup("uptr")); - if (addr == ~0) { - error("cannot read current u-area address"); - return; - } - read_pcb(vtophys(0, addr)); /* XXX space */ - if (!devmem) { - /* find stack frame */ - CORE_ADDR panicstr; - char buf[256]; - register char *cp; - - panicstr = kvread(ksym_lookup("panicstr")); - if (panicstr == ~0) - return; - kernel_core_file_hook(panicstr, buf, sizeof(buf)); - for (cp = buf; cp < &buf[sizeof(buf)] && *cp; cp++) - if (!isascii(*cp) || (!isprint(*cp) && !isspace(*cp))) - *cp = '?'; - if (*cp) - *cp = '\0'; - printf("panic: %s\n", buf); - } - } -#ifdef MACHKERNELDEBUG - else { - int *thread; - - /* - * Set up address translation - */ - if (mach_vtophys_init() == 0) { - error("cannot initialize vtophys for Mach"); - return; - } - vtophys_ready = 1; - - /* - * Locate active thread and read PCB - * XXX MAJOR HACK - * - assumes uni-processor - * - assumes position of pcb to avoid mach includes - */ - thread = (int *)kvread(ksym_lookup("active_threads")); - addr = kvread(&thread[9]); /* XXX: pcb addr */ - read_pcb(vtophys(0, addr)); - } -#endif -} - -vtop_command(arg) - char *arg; -{ - u_int sp, off, pa; - - if (!arg) - error_no_arg("kernel virtual address"); - if (!kernel_debugging) - error("not debugging kernel"); - - sp = 0; /* XXX */ - off = (u_int) parse_and_eval_address(arg); - pa = vtophys(sp, off); - printf("%lx.%lx -> ", sp, off); - if (pa == ~0) - printf("\n"); - else - printf("%lx\n", pa); -} - -set_paddr_command(arg) - char *arg; -{ - u_int addr; - - if (!arg) { - if (kerneltype == OS_BSD) - error_no_arg("ps-style address for new process"); - else - error_no_arg("thread structure virtual address"); - } - if (!kernel_debugging) - error("not debugging kernel"); - - addr = (u_int) parse_and_eval_address(arg); - if (kerneltype == OS_BSD) - addr = ctob(addr); - else { - addr = kvread(&(((int *)addr)[9])); /* XXX: pcb addr */ - addr = vtophys(0, addr); /* XXX space */ - } - read_pcb(addr); - - flush_cached_frames(); - set_current_frame(create_new_frame(read_register(FP_REGNUM), read_pc())); - select_frame(get_current_frame(), 0); -} - -/* - * read len bytes from kernel virtual address 'addr' into local - * buffer 'buf'. Return 0 if read ok, 1 otherwise. On read - * errors, portion of buffer not read is zeroed. - */ -kernel_core_file_hook(addr, buf, len) - CORE_ADDR addr; - char *buf; - int len; -{ - int i; - CORE_ADDR paddr; - - while (len > 0) { - paddr = vtophys(0, addr); /* XXX space */ - if (paddr == ~0) { - bzero(buf, len); - return (1); - } - /* we can't read across a page boundary */ - i = min(len, NBPG - (addr & PGOFSET)); - if (physrd(paddr, buf, i)) { - bzero(buf, len); - return (1); - } - buf += i; - addr += i; - len -= i; - } - return (0); -} -#endif - - - - - - -/* Routines to extract various sized constants out of hppa - instructions. */ - -/* This assumes that no garbage lies outside of the lower bits of - value. */ - -int -sign_extend (val, bits) - unsigned val, bits; -{ - return (int)(val >> bits - 1 ? (-1 << bits) | val : val); -} - -/* For many immediate values the sign bit is the low bit! */ - -int -low_sign_extend (val, bits) - unsigned val, bits; -{ - return (int)((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1); -} -/* extract the immediate field from a ld{bhw}s instruction */ - - - -unsigned -get_field (val, from, to) - unsigned val, from, to; -{ - val = val >> 31 - to; - return val & ((1 << 32 - from) - 1); -} - -unsigned -set_field (val, from, to, new_val) - unsigned *val, from, to; -{ - unsigned mask = ~((1 << (to - from + 1)) << (31 - from)); - return *val = *val & mask | (new_val << (31 - from)); -} - -/* extract a 3-bit space register number from a be, ble, mtsp or mfsp */ - -extract_3 (word) - unsigned word; -{ - return GET_FIELD (word, 18, 18) << 2 | GET_FIELD (word, 16, 17); -} - -extract_5_load (word) - unsigned word; -{ - return low_sign_extend (word >> 16 & MASK_5, 5); -} - -/* extract the immediate field from a st{bhw}s instruction */ - -int -extract_5_store (word) - unsigned word; -{ - return low_sign_extend (word & MASK_5, 5); -} - -/* extract an 11 bit immediate field */ - -int -extract_11 (word) - unsigned word; -{ - return low_sign_extend (word & MASK_11, 11); -} - -/* extract a 14 bit immediate field */ - -int -extract_14 (word) - unsigned word; -{ - return low_sign_extend (word & MASK_14, 14); -} - -/* deposit a 14 bit constant in a word */ - -unsigned -deposit_14 (opnd, word) - int opnd; - unsigned word; -{ - unsigned sign = (opnd < 0 ? 1 : 0); - - return word | ((unsigned)opnd << 1 & MASK_14) | sign; -} - -/* extract a 21 bit constant */ - -int -extract_21 (word) - unsigned word; -{ - int val; - - word &= MASK_21; - word <<= 11; - val = GET_FIELD (word, 20, 20); - val <<= 11; - val |= GET_FIELD (word, 9, 19); - val <<= 2; - val |= GET_FIELD (word, 5, 6); - val <<= 5; - val |= GET_FIELD (word, 0, 4); - val <<= 2; - val |= GET_FIELD (word, 7, 8); - return sign_extend (val, 21) << 11; -} - -/* deposit a 21 bit constant in a word. Although 21 bit constants are - usually the top 21 bits of a 32 bit constant, we assume that only - the low 21 bits of opnd are relevant */ - -unsigned -deposit_21 (opnd, word) - unsigned opnd, word; -{ - unsigned val = 0; - - val |= GET_FIELD (opnd, 11 + 14, 11 + 18); - val <<= 2; - val |= GET_FIELD (opnd, 11 + 12, 11 + 13); - val <<= 2; - val |= GET_FIELD (opnd, 11 + 19, 11 + 20); - val <<= 11; - val |= GET_FIELD (opnd, 11 + 1, 11 + 11); - val <<= 1; - val |= GET_FIELD (opnd, 11 + 0, 11 + 0); - return word | val; -} - -/* extract a 12 bit constant from branch instructions */ - -int -extract_12 (word) - unsigned word; -{ - return sign_extend (GET_FIELD (word, 19, 28) | - GET_FIELD (word, 29, 29) << 10 | - (word & 0x1) << 11, 12) << 2; -} - -/* extract a 17 bit constant from branch instructions, returning the - 19 bit signed value. */ - -int -extract_17 (word) - unsigned word; -{ - return sign_extend (GET_FIELD (word, 19, 28) | - GET_FIELD (word, 29, 29) << 10 | - GET_FIELD (word, 11, 15) << 11 | - (word & 0x1) << 16, 17) << 2; -} - - -CORE_ADDR -frame_saved_pc (frame) - FRAME frame; -{ - if (get_current_frame () == frame) - { - struct frame_saved_regs saved_regs; - CORE_ADDR pc = get_frame_pc (frame); - - get_frame_saved_regs (frame, &saved_regs); - if (pc >= millicode_start && pc < millicode_end) - return read_register (31); - else if (saved_regs.regs[RP_REGNUM]) - return read_memory_integer (saved_regs.regs[RP_REGNUM], 4); - else - return read_register (RP_REGNUM); - } - return read_memory_integer (frame->frame - 20, 4) & ~0x3; -} - - -/* To see if a frame chain is valid, see if the caller looks like it - was compiled with gcc. */ - -int frame_chain_valid (chain, thisframe) - FRAME_ADDR chain; - FRAME thisframe; -{ - if (chain && (chain > 0x60000000 - /* || remote_debugging -this is no longer used */ -#ifdef KERNELDEBUG - || kernel_debugging -#endif - )) - { - CORE_ADDR pc = get_pc_function_start (FRAME_SAVED_PC (thisframe)); - - if (!inside_entry_file (pc)) - return 0; - /* look for stw rp, -20(0,sp); copy 4,1; copy sp, 4 */ - if (read_memory_integer (pc, 4) == 0x6BC23FD9) - pc = pc + 4; - - if (read_memory_integer (pc, 4) == 0x8040241 && - read_memory_integer (pc + 4, 4) == 0x81E0244) - return 1; - else - return 0; - } - else - return 0; -} - -/* Some helper functions. gcc_p returns 1 if the function beginning at - pc appears to have been compiled with gcc. hpux_cc_p returns 1 if - fn was compiled with hpux cc. gcc functions look like : - - stw rp,-0x14(sp) ; optional - or r4,r0,r1 - or sp,r0,r4 - stwm r1,framesize(sp) - - hpux cc functions look like: - - stw rp,-0x14(sp) ; optional. - stwm r3,framesiz(sp) - */ - -gcc_p (pc) - CORE_ADDR pc; -{ - if (read_memory_integer (pc, 4) == 0x6BC23FD9) - pc = pc + 4; - - if (read_memory_integer (pc, 4) == 0x8040241 && - read_memory_integer (pc + 4, 4) == 0x81E0244) - return 1; - return 0; -} - - -find_dummy_frame_regs (frame, frame_saved_regs) - struct frame_info *frame; - struct frame_saved_regs *frame_saved_regs; -{ - CORE_ADDR fp = frame->frame; - int i; - - frame_saved_regs->regs[RP_REGNUM] = fp - 20 & ~0x3; - frame_saved_regs->regs[FP_REGNUM] = fp; - frame_saved_regs->regs[1] = fp + 8; - frame_saved_regs->regs[3] = fp + 12; - for (fp += 16, i = 3; i < 30; fp += 4, i++) - frame_saved_regs->regs[i] = fp; - frame_saved_regs->regs[31] = fp; - fp += 4; - for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8) - frame_saved_regs->regs[i] = fp; - /* depend on last increment of fp */ - frame_saved_regs->regs[IPSW_REGNUM] = fp - 4; - frame_saved_regs->regs[SAR_REGNUM] = fp; - fp += 4; - frame_saved_regs->regs[PCOQ_TAIL_REGNUM] = fp; - frame_saved_regs->regs[PCSQ_TAIL_REGNUM] = fp; -} - -CORE_ADDR -hp_push_arguments (nargs, args, sp, struct_return, struct_addr) - int nargs; - value *args; - CORE_ADDR sp; - int struct_return; - CORE_ADDR struct_addr; -{ - /* array of arguments' offsets */ - int *offset = (int *)alloca(nargs); - int cum = 0; - int i, alignment; - - for (i = 0; i < nargs; i++) - { - cum += TYPE_LENGTH (VALUE_TYPE (args[i])); - /* value must go at proper alignment. Assume alignment is a - power of two.*/ - alignment = hp_alignof (VALUE_TYPE (args[i])); - if (cum % alignment) - cum = (cum + alignment) & -alignment; - offset[i] = -cum; - } - for (i == 0; i < nargs; i++) - { - write_memory (sp + offset[i], VALUE_CONTENTS (args[i]), sizeof(int)); - } - sp += min ((cum + 7) & -8, 48); - if (struct_return) - write_register (28, struct_addr); - return sp + 48; -} - -/* return the alignment of a type in bytes. Structures have the maximum - alignment required by their fields. */ - -int -hp_alignof (arg) - struct type *arg; -{ - int max_align, align, i; - switch (TYPE_CODE (arg)) - { - case TYPE_CODE_PTR: - case TYPE_CODE_INT: - case TYPE_CODE_FLT: - return TYPE_LENGTH (arg); - case TYPE_CODE_ARRAY: - return hp_alignof (TYPE_FIELD_TYPE (arg, 0)); - case TYPE_CODE_STRUCT: - case TYPE_CODE_UNION: - max_align = 2; - for (i = 0; i < TYPE_NFIELDS (arg); i++) - { - /* Bit fields have no real alignment. */ - if (!TYPE_FIELD_BITPOS (arg, i)) - { - align = hp_alignof (TYPE_FIELD_TYPE (arg, i)); - max_align = max (max_align, align); - } - } - return max_align; - default: - return 4; - } -} - -/* Print the register regnum, or all registers if regnum is -1 */ - -pa_do_registers_info (regnum, fpregs) - int regnum; - int fpregs; -{ - char raw_regs [REGISTER_BYTES]; - int i; - - for (i = 0; i < NUM_REGS; i++) - read_relative_register_raw_bytes (i, raw_regs + REGISTER_BYTE (i)); - if (regnum = -1) - pa_print_registers (raw_regs, regnum); - else if (regnum < FP0_REGNUM) - { - printf ("%s %x\n", reg_names[regnum], *(long *)(raw_regs + - REGISTER_BYTE (regnum))); - } - else - pa_print_fp_reg (regnum); -} - -pa_print_registers (raw_regs, regnum) - char *raw_regs; - int regnum; -{ - int i; - - for (i = 0; i < 18; i++) - printf ("%8.8s: %8x %8.8s: %8x %8.8s: %8x %8.8s: %8x\n", - reg_names[i], - *(int *)(raw_regs + REGISTER_BYTE (i)), - reg_names[i + 18], - *(int *)(raw_regs + REGISTER_BYTE (i + 18)), - reg_names[i + 36], - *(int *)(raw_regs + REGISTER_BYTE (i + 36)), - reg_names[i + 54], - *(int *)(raw_regs + REGISTER_BYTE (i + 54))); - for (i = 72; i < NUM_REGS; i++) - pa_print_fp_reg (i); -} - -pa_print_fp_reg (i) - int i; -{ - unsigned char raw_buffer[MAX_REGISTER_RAW_SIZE]; - unsigned char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE]; - REGISTER_TYPE val; - - /* Get the data in raw format, then convert also to virtual format. */ - read_relative_register_raw_bytes (i, raw_buffer); - REGISTER_CONVERT_TO_VIRTUAL (i, raw_buffer, virtual_buffer); - - fputs_filtered (reg_names[i], stdout); - print_spaces_filtered (15 - strlen (reg_names[i]), stdout); - - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, stdout, 0, - 1, 0, Val_pretty_default); - printf_filtered ("\n"); - -} - -/* - * Virtual to physical translation routines for Utah's Mach 3.0 - */ -#ifdef MACHKERNELDEBUG - -#define STATIC - -#if 0 /* too many includes to resolve, too much crap */ -#include -#include -#include -#else -/* queue.h */ -struct queue_entry { - struct queue_entry *next; /* next element */ - struct queue_entry *prev; /* previous element */ -}; - -typedef struct queue_entry *queue_t; -typedef struct queue_entry queue_head_t; -typedef struct queue_entry queue_chain_t; -typedef struct queue_entry *queue_entry_t; - -/* pmap.h */ -#define HP800_HASHSIZE 1024 -#define HP800_HASHSIZE_LOG2 10 - -#define pmap_hash(space, offset) \ - (((unsigned) (space) << 5 ^ \ - ((unsigned) (offset) >> 19 | (unsigned) (space) << 13) ^ \ - (unsigned) (offset) >> 11) & (HP800_HASHSIZE-1)) - -struct mapping { - queue_head_t hash_link; /* hash table links */ - queue_head_t phys_link; /* for mappings of a given PA */ - space_t space; /* virtual space */ - unsigned offset; /* virtual page number */ - unsigned tlbpage; /* physical page (for TLB load) */ - unsigned tlbprot; /* prot/access rights (for TLB load) */ - struct pmap *pmap; /* pmap mapping belongs to */ -}; - -struct phys_entry { - queue_head_t phys_link; /* head of mappings of a given PA */ - struct mapping *writer; /* mapping with R/W access */ - unsigned tlbprot; /* TLB format protection */ -}; - -#endif - -#define atop(a) ((unsigned)(a) >> 11) -#define ptoa(p) ((unsigned)(p) << 11) -#define trunc_page(a) ((unsigned)(a) & ~2047) - -STATIC long equiv_end; -STATIC queue_head_t *Ovtop_table, *vtop_table, *Ofree_mapping, free_mapping; -STATIC struct phys_entry *Ophys_table, *phys_table; -STATIC long vm_last_phys, vm_first_phys; -STATIC struct mapping *firstmap, *lastmap, *Omap_table, *map_table; -STATIC unsigned Omlow, Omhigh, Omhead, Ovlow, Ovhigh, Oplow, Ophigh; -STATIC unsigned mlow, mhigh, mhead, vlow, vhigh, plow, phigh; -STATIC int vtopsize, physsize, mapsize; -STATIC int kmemfd; - -#define IS_OVTOPPTR(p) ((unsigned)(p) >= Ovlow && (unsigned)(p) < Ovhigh) -#define IS_OMAPPTR(p) ((unsigned)(p) >= Omlow && (unsigned)(p) < Omhigh) -#define IS_OPHYSPTR(p) ((unsigned)(p) >= Oplow && (unsigned)(p) < Ophigh) -#define IS_VTOPPTR(p) ((unsigned)(p) >= vlow && (unsigned)(p) < vhigh) -#define IS_MAPPTR(p) ((unsigned)(p) >= mlow && (unsigned)(p) < mhigh) -#define IS_PHYSPTR(p) ((unsigned)(p) >= plow && (unsigned)(p) < phigh) - -struct mapstate { - char unused; - char flags; - short hashix; - short physix; -} *mapstate; - -/* flags */ -#define M_ISFREE 1 -#define M_ISHASH 2 -#define M_ISPHYS 4 - -mach_vtophys_init() -{ - int errors = 0; - - if (!readdata()) - errors++; - if (!verifydata()) - errors++; - if (!errors) - return(1); - fflush(stdout); - fprintf(stderr, - "translate: may not be able to translate all addresses\n"); - return(0); -} - -mach_vtophys(space, off, pa) - unsigned space, off, *pa; -{ - register int i; - register queue_t qp; - register struct mapping *mp; - int poff; - - /* - * Kernel IO or equivilently mapped, one to one. - */ - if (space == 0 && (long)off < equiv_end) { - *pa = off; - return(1); - } - /* - * Else look it up in specified space - */ - poff = off - trunc_page(off); - off = trunc_page(off); - qp = &vtop_table[pmap_hash(space, off)]; - for (mp = (struct mapping *)qp->next; - qp != (queue_entry_t)mp; - mp = (struct mapping *)mp->hash_link.next) { - if (mp->space == space && mp->offset == off) { - *pa = (mp->tlbpage << 7) | poff; - return(1); - } - } - return(0); -} - -STATIC -readdata() -{ - char *tmp, *mach_malloc(); - long size; - - /* easy scalars */ - mach_read("equiv_end", ~0, (char *)&equiv_end, sizeof equiv_end); - mach_read("vm_first_phys", ~0, - (char *)&vm_first_phys, sizeof vm_first_phys); - mach_read("vm_last_phys", ~0, - (char *)&vm_last_phys, sizeof vm_last_phys); - mach_read("firstmap", ~0, (char *)&firstmap, sizeof firstmap); - mach_read("lastmap", ~0, (char *)&lastmap, sizeof lastmap); - - /* virtual to physical hash table */ - vtopsize = HP800_HASHSIZE; - size = vtopsize * sizeof(queue_head_t); - tmp = mach_malloc("vtop table", size); - mach_read("vtop_table", ~0, (char *)&Ovtop_table, sizeof Ovtop_table); - mach_read("vtop table", (CORE_ADDR)Ovtop_table, tmp, size); - vtop_table = (queue_head_t *) tmp; - - /* inverted page table */ - physsize = atop(vm_last_phys - vm_first_phys); - size = physsize * sizeof(struct phys_entry); - tmp = mach_malloc("phys table", size); - mach_read("phys_table", ~0, (char *)&Ophys_table, sizeof Ophys_table); - mach_read("phys table", (CORE_ADDR)Ophys_table, tmp, size); - phys_table = (struct phys_entry *) tmp; - - /* mapping structures */ - Ofree_mapping = (queue_head_t *) ksym_lookup("free_mapping"); - mach_read("free mapping", (CORE_ADDR)Ofree_mapping, - (char *) &free_mapping, sizeof free_mapping); - Omap_table = firstmap; - mapsize = lastmap - firstmap; - size = mapsize * sizeof(struct mapping); - tmp = mach_malloc("mapping table", size); - mach_read("mapping table", (CORE_ADDR)Omap_table, tmp, size); - map_table = (struct mapping *) tmp; - - /* set limits */ - Ovlow = (unsigned) Ovtop_table; - Ovhigh = (unsigned) &Ovtop_table[vtopsize]; - Oplow = (unsigned) Ophys_table; - Ophigh = (unsigned) &Ophys_table[physsize]; - Omhead = (unsigned) Ofree_mapping; - Omlow = (unsigned) firstmap; - Omhigh = (unsigned) lastmap; - mlow = (unsigned) map_table; - mhigh = (unsigned) &map_table[mapsize]; - mhead = (unsigned) &free_mapping; - vlow = (unsigned) vtop_table; - vhigh = (unsigned) &vtop_table[vtopsize]; - plow = (unsigned) phys_table; - phigh = (unsigned) &phys_table[physsize]; - -#if 0 - fprintf(stderr, "Ovtop [%#x-%#x) Ophys [%#x-%#x) Omap %#x [%#x-%#x)\n", - Ovlow, Ovhigh, Oplow, Ophigh, Omhead, Omlow, Omhigh); - fprintf(stderr, "vtop [%#x-%#x) phys [%#x-%#x) map %#x [%#x-%#x)\n", - vlow, vhigh, plow, phigh, mhead, mlow, mhigh); -#endif - return(adjustdata()); -} - -STATIC unsigned -ptrcvt(ptr) - unsigned ptr; -{ - unsigned ret; - char *str; - - if (ptr == 0) { - ret = ptr; - str = "null"; - } else if (IS_OVTOPPTR(ptr)) { - ret = vlow + (ptr - Ovlow); - str = "vtop"; - } else if (IS_OPHYSPTR(ptr)) { - ret = plow + (ptr - Oplow); - str = "phys"; - } else if (IS_OMAPPTR(ptr)) { - ret = mlow + (ptr - Omlow); - str = "map"; - } else if (ptr == Omhead) { - ret = mhead; - str = "maphead"; - } else { - error("bogus pointer %#x", ptr); - str = "wild"; - ret = ptr; - } -#if 0 - fprintf(stderr, "%x (%s) -> %x\n", ptr, str, ret); -#endif - return(ret); -} - -STATIC int -adjustdata() -{ - register int i, lim; - queue_head_t *nq; - struct phys_entry *np; - struct mapping *nm; - - /* hash table */ - lim = vtopsize; - for (nq = vtop_table; nq < &vtop_table[lim]; nq++) { - nq->next = (queue_entry_t) ptrcvt((unsigned)nq->next); - nq->prev = (queue_entry_t) ptrcvt((unsigned)nq->prev); - } - - /* IPT */ - lim = physsize; - for (np = phys_table; np < &phys_table[lim]; np++) { - np->phys_link.next = (queue_entry_t) - ptrcvt((unsigned)np->phys_link.next); - np->phys_link.prev = (queue_entry_t) - ptrcvt((unsigned)np->phys_link.prev); - np->writer = (struct mapping *) ptrcvt((unsigned)np->writer); - } - - /* mapping table */ - free_mapping.next = (queue_entry_t)ptrcvt((unsigned)free_mapping.next); - free_mapping.prev = (queue_entry_t)ptrcvt((unsigned)free_mapping.prev); - lim = mapsize; - for (nm = map_table; nm < &map_table[lim]; nm++) { - nm->hash_link.next = (queue_entry_t) - ptrcvt((unsigned)nm->hash_link.next); - nm->hash_link.prev = (queue_entry_t) - ptrcvt((unsigned)nm->hash_link.prev); - nm->phys_link.next = (queue_entry_t) - ptrcvt((unsigned)nm->phys_link.next); - nm->phys_link.prev = (queue_entry_t) - ptrcvt((unsigned)nm->phys_link.prev); - } - return(1); -} - -/* - * Consistency checks, make sure: - * - * 1. all mappings are accounted for - * 2. no cycles - * 3. no wild pointers - * 4. consisent TLB state - */ -STATIC int -verifydata() -{ - register struct mapstate *ms; - register int i; - int errors = 0; - - mapstate = (struct mapstate *) - mach_malloc("map state", mapsize * sizeof(struct mapstate)); - for (ms = mapstate; ms < &mapstate[mapsize]; ms++) { - ms->flags = 0; - ms->hashix = ms->physix = -2; - } - - /* - * Check the free list - */ - checkhashchain(&free_mapping, M_ISFREE, -1); - /* - * Check every hash chain - */ - for (i = 0; i < vtopsize; i++) - checkhashchain(&vtop_table[i], M_ISHASH, i); - /* - * Check every phys chain - */ - for (i = 0; i < physsize; i++) - checkphyschain(&phys_table[i].phys_link, M_ISPHYS, i); - /* - * Cycle through mapstate looking for anomolies - */ - ms = mapstate; - for (i = 0; i < mapsize; i++) { - switch (ms->flags) { - case M_ISFREE: - case M_ISHASH|M_ISPHYS: - break; - case 0: - merror(ms, "not found"); - errors++; - break; - case M_ISHASH: - merror(ms, "in vtop but not phys"); - errors++; - break; - case M_ISPHYS: - merror(ms, "in phys but not vtop"); - errors++; - break; - default: - merror(ms, "totally bogus"); - errors++; - break; - } - ms++; - } - return(errors ? 0 : 1); -} - -STATIC void -checkhashchain(qhp, flag, ix) - queue_entry_t qhp; -{ - register queue_entry_t qp, pqp; - register struct mapping *mp; - struct mapstate *ms; - - qp = qhp->next; - /* - * First element is not a mapping structure, - * chain must be empty. - */ - if (!IS_MAPPTR(qp)) { - if (qp != qhp || qp != qhp->prev) - fatal("bad vtop_table header pointer"); - } else { - pqp = qhp; - do { - mp = (struct mapping *) qp; - qp = &mp->hash_link; - if (qp->prev != pqp) - fatal("bad hash_link prev pointer"); - ms = &mapstate[mp-map_table]; - ms->flags |= flag; - ms->hashix = ix; - pqp = (queue_entry_t) mp; - qp = qp->next; - } while (IS_MAPPTR(qp)); - if (qp != qhp) - fatal("bad hash_link next pointer"); - } -} - -STATIC void -checkphyschain(qhp, flag, ix) - queue_entry_t qhp; -{ - register queue_entry_t qp, pqp; - register struct mapping *mp; - struct mapstate *ms; - - qp = qhp->next; - /* - * First element is not a mapping structure, - * chain must be empty. - */ - if (!IS_MAPPTR(qp)) { - if (qp != qhp || qp != qhp->prev) - fatal("bad phys_table header pointer"); - } else { - pqp = qhp; - do { - mp = (struct mapping *) qp; - qp = &mp->phys_link; - if (qp->prev != pqp) - fatal("bad phys_link prev pointer"); - ms = &mapstate[mp-map_table]; - ms->flags |= flag; - ms->physix = ix; - pqp = (queue_entry_t) mp; - qp = qp->next; - } while (IS_MAPPTR(qp)); - if (qp != qhp) - fatal("bad phys_link next pointer"); - } -} - -STATIC void -merror(ms, str) - struct mapstate *ms; - char *str; -{ - terminal_ours(); - fflush(stdout); - fprintf(stderr, - "vtophys: %s: %c%c%c, hashix %d, physix %d, mapping %x\n", - str, - (ms->flags & M_ISFREE) ? 'F' : '-', - (ms->flags & M_ISHASH) ? 'H' : '-', - (ms->flags & M_ISPHYS) ? 'P' : '-', - ms->hashix, ms->physix, &map_table[ms-mapstate]); - return_to_top_level(); -} - -STATIC int -mach_read(str, from, top, size) - char *str; - CORE_ADDR from; - char *top; - int size; -{ - CORE_ADDR paddr; - - if (from == ~0) - from = ksym_lookup(str); - paddr = vtophys(0, from); - if (paddr == ~0 || physrd(paddr, top, size) != 0) - fatal("cannot read %s", str); -} - -STATIC char * -mach_malloc(str, size) - char *str; - int size; -{ - char *ptr = (char *) malloc(size); - - if (ptr == 0) - fatal("no memory for %s", str); - return(ptr); -} -#endif - -#ifdef KERNELDEBUG -void -_initialize_hp9k8_dep() -{ - add_com ("process-address", class_obscure, set_paddr_command, -"The process identified by (ps-style) ADDR becomes the\n\ -\"current\" process context for kernel debugging."); - add_com_alias ("paddr", "process-address", class_obscure, 0); - add_com ("virtual-to-physical", class_obscure, vtop_command, -"Translates the kernel virtual address ADDR into a physical address."); - add_com_alias ("vtop", "virtual-to-physical", class_obscure, 0); -} -#endif diff --git a/gdb/hppahpux-xdep.c b/gdb/hppahpux-xdep.c index 8c8c33f5bd..e69de29bb2 100644 --- a/gdb/hppahpux-xdep.c +++ b/gdb/hppahpux-xdep.c @@ -1,424 +0,0 @@ -/* Machine-dependent code which would otherwise be in infptrace.c, - for GDB, the GNU debugger. This code is for the HP PA-RISC cpu. - Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.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. */ - -#include "defs.h" -#include "frame.h" -#include "inferior.h" -#include "target.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include - -#include - - -#ifndef PT_ATTACH -#define PT_ATTACH PTRACE_ATTACH -#endif -#ifndef PT_DETACH -#define PT_DETACH PTRACE_DETACH -#endif - -#include "gdbcore.h" -#include /* After a.out.h */ -#include -#include - -/* 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; - PTRACE_ARG3_TYPE addr; - int data; -{ - return ptrace (request, pid, addr, data, 0); -} - -#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 - -void -kill_inferior () -{ - if (inferior_pid == 0) - return; - ptrace (PT_EXIT, inferior_pid, (PTRACE_ARG3_TYPE) 0, 0, 0); /* PT_EXIT = PT_KILL ? */ - wait ((int *)0); - 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 (PTRACE_ARG3_TYPE) 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_SINGLE, inferior_pid, (PTRACE_ARG3_TYPE) 1, signal, 0); - else - ptrace (PT_CONTIN, inferior_pid, (PTRACE_ARG3_TYPE) 1, signal, 0); - - 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, (PTRACE_ARG3_TYPE) 0, 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, (PTRACE_ARG3_TYPE) 1, signal, 0); - 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; - -#include /* For struct nlist */ - -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, \ - (PTRACE_ARG3_TYPE) (offsetof (struct user, u_ar0)), 0, 0) \ - - KERNEL_U_ADDR -#endif - -/* Registers we shouldn't try to fetch. */ -#if !defined (CANNOT_FETCH_REGISTER) -#define CANNOT_FETCH_REGISTER(regno) 0 -#endif - -/* Fetch one register. */ - -static void -fetch_register (regno) - int regno; -{ - register unsigned int regaddr; - char buf[MAX_REGISTER_RAW_SIZE]; - char mess[128]; /* For messages */ - register int i; - - /* Offset of registers within the u area. */ - unsigned int offset; - - if (CANNOT_FETCH_REGISTER (regno)) - { - bzero (buf, REGISTER_RAW_SIZE (regno)); /* Supply zeroes */ - supply_register (regno, buf); - return; - } - - offset = U_REGS_OFFSET; - - regaddr = register_addr (regno, offset); - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - errno = 0; - *(int *) &buf[i] = ptrace (PT_RUREGS, inferior_pid, - (PTRACE_ARG3_TYPE) regaddr, 0, 0); - regaddr += sizeof (int); - if (errno != 0) - { - sprintf (mess, "reading register %s (#%d)", reg_names[regno], regno); - perror_with_name (mess); - } - } - if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) - buf[3] &= ~0x3; - 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). */ - -void -store_inferior_registers (regno) - int regno; -{ - register unsigned int regaddr; - char buf[80]; - extern char registers[]; - register int i; - - 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_WUAREA, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i], 0); - if (errno != 0) - { - sprintf (buf, "writing register number %d(%d)", regno, i); - perror_with_name (buf); - } - 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_WUAREA, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i], 0); - if (errno != 0) - { - sprintf (buf, "writing register number %d(%d)", regno, i); - perror_with_name (buf); - } - regaddr += sizeof(int); - } - } - } - return; -} -#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_RIUSER, inferior_pid, - (PTRACE_ARG3_TYPE) addr, 0, 0); - } - - if (count > 1) /* FIXME, avoid if even boundary */ - { - buffer[count - 1] - = ptrace (PT_RIUSER, inferior_pid, - (PTRACE_ARG3_TYPE) (addr + (count - 1) * sizeof (int)), - 0, 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)) - { -#if 0 -/* The HP-UX kernel crashes if you use PT_WDUSER to write into the text - segment. FIXME -- does it work to write into the data segment using - WIUSER, or do these idiots really expect us to figure out which segment - the address is in, so we can use a separate system call for it??! */ - errno = 0; - ptrace (PT_WDUSER, inferior_pid, (PTRACE_ARG3_TYPE) addr, - buffer[i], 0); - if (errno) -#endif - { - /* Using the appropriate one (I or D) is necessary for - Gould NP1, at least. */ - errno = 0; - ptrace (PT_WIUSER, inferior_pid, (PTRACE_ARG3_TYPE) addr, - buffer[i], 0); - } - if (errno) - return 0; - } - } - else - { - /* Read all the longwords */ - for (i = 0; i < count; i++, addr += sizeof (int)) - { - errno = 0; - buffer[i] = ptrace (PT_RIUSER, inferior_pid, - (PTRACE_ARG3_TYPE) addr, 0, 0); - if (errno) - return 0; - QUIT; - } - - /* Copy appropriate bytes out of the buffer. */ - bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len); - } - return len; -} - - - - -int -getpagesize() -{ - return(4096); -} diff --git a/gdb/i386-xdep.c b/gdb/i386-xdep.c deleted file mode 100644 index 67e904b834..0000000000 --- a/gdb/i386-xdep.c +++ /dev/null @@ -1,250 +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 "defs.h" -#include "frame.h" -#include "inferior.h" -#include "language.h" -#include "gdbcore.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include "ieee-float.h" - -#include "target.h" - -extern struct ext_format ext_format_i387; - -/* this table must line up with REGISTER_NAMES in tm-i386v.h */ -/* symbols like 'EAX' come from */ -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 - */ - -int -i386_register_u_addr (blockend, regnum) - int blockend; - int 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) - warning ("reserved0 is %s\n", local_hex_string(ep->r0)); - if (ep->r1) - warning ("reserved1 is %s\n", local_hex_string(ep->r1)); - if (ep->r2) - warning ("reserved2 is %s\n", local_hex_string(ep->r2)); - if (ep->r3) - 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 */ - 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, (PTRACE_ARG3_TYPE) 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, (PTRACE_ARG3_TYPE) 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/m68k-opcode.h b/gdb/m68k-opcode.h deleted file mode 100755 index 1a8f7d2feb..0000000000 --- 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 , Dd */ -{"addb", one(0150400), one(0170700), "Dd~b"}, /* addb Dd, */ - -{"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 , Dd */ -{"addw", one(0150500), one(0170700), "Dd~w"}, /* addw Dd, */ - -{"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 , Dd */ -{"addl", one(0150600), one(0170700), "Dd~l"}, /* addl Dd, */ - -{"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 to fp */ -{"fmoveb", two(0xF000, 0x7800), two(0xF1C0, 0xFC7F), "IiF7@b"}, /* fmove from fp to */ -{"fmoved", two(0xF000, 0x5400), two(0xF1C0, 0xFC7F), "Ii;FF7"}, /* fmove from to fp */ -{"fmoved", two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7@F"}, /* fmove from fp to */ -{"fmovel", two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "Ii;lF7"}, /* fmove from to fp */ -{"fmovel", two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7@l"}, /* fmove from fp to */ -/* 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 to fp */ -{"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 to fp */ -{"fmoves", two(0xF000, 0x6400), two(0xF1C0, 0xFC7F), "IiF7@f"}, /* fmove from fp to */ -{"fmovew", two(0xF000, 0x5000), two(0xF1C0, 0xFC7F), "Ii;wF7"}, /* fmove from to fp */ -{"fmovew", two(0xF000, 0x7000), two(0xF1C0, 0xFC7F), "IiF7@w"}, /* fmove from fp to */ -{"fmovex", two(0xF000, 0x0000), two(0xF1C0, 0xE07F), "IiF8F7"}, /* fmove from to fp */ -{"fmovex", two(0xF000, 0x4800), two(0xF1C0, 0xFC7F), "Ii;xF7"}, /* fmove from to fp */ -{"fmovex", two(0xF000, 0x6800), two(0xF1C0, 0xFC7F), "IiF7@x"}, /* fmove from fp to */ -/* JF removed {"fmovex", two(0xF000, 0x0000), two(0xF1C0, 0xE07F), "IiFt"}, / * fmove from to fp */ - -{"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/m88k-opcode.h b/gdb/m88k-opcode.h index c5e643a1ff..e69de29bb2 100755 --- a/gdb/m88k-opcode.h +++ b/gdb/m88k-opcode.h @@ -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 - - -/* - * 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-xdep.c b/gdb/m88k-xdep.c index 9c4d1c5585..e69de29bb2 100644 --- a/gdb/m88k-xdep.c +++ b/gdb/m88k-xdep.c @@ -1,342 +0,0 @@ -/* Host-dependent Motorola 88xxx support for GDB, the GNU Debugger. - Copyright 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 "defs.h" -#include "frame.h" -#include "inferior.h" - -#ifdef USG -#include -#endif - -#include -#include -#include -#include "gdbcore.h" -#include - -#ifndef USER /* added to support BCS ptrace_user */ -#define USER ptrace_user -#endif -#include -#include -#include -#include - -#include "symtab.h" -#include "setjmp.h" -#include "value.h" - -#ifdef DELTA88 -#include - -/* 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 (regno) - int regno; /* Original value discarded */ -{ - 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, (PTRACE_ARG3_TYPE) 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, - (PTRACE_ARG3_TYPE) 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, - (PTRACE_ARG3_TYPE) SXIP_OFFSET ,0); - supply_register (SXIP_REGNUM, buf); - *(int *) &buf[0] = ptrace (3, inferior_pid, - (PTRACE_ARG3_TYPE) SNIP_OFFSET,0); - supply_register (SNIP_REGNUM, buf); - *(int *) &buf[0] = ptrace (3, inferior_pid, - (PTRACE_ARG3_TYPE) 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). */ - -void -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, - (PTRACE_ARG3_TYPE) 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, - (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register(regno)); - else if (regno == SNIP_REGNUM) - ptrace (6, inferior_pid, - (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register(regno)); - else if (regno == SFIP_REGNUM) - ptrace (6, inferior_pid, - (PTRACE_ARG3_TYPE) 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, - (PTRACE_ARG3_TYPE) regaddr, read_register (regno)); - if (errno != 0) - { - sprintf (buf, "writing register number %d", regno); - perror_with_name (buf); - } - } - ptrace (6,inferior_pid, - (PTRACE_ARG3_TYPE) SXIP_OFFSET,read_register(SXIP_REGNUM)); - ptrace (6,inferior_pid, - (PTRACE_ARG3_TYPE) SNIP_OFFSET,read_register(SNIP_REGNUM)); - ptrace (6,inferior_pid, - (PTRACE_ARG3_TYPE) 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 index 8f7ca166a4..e69de29bb2 100644 --- a/gdb/mach386-xdep.c +++ b/gdb/mach386-xdep.c @@ -1,164 +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 "defs.h" -#include "frame.h" -#include "inferior.h" -#include "gdbcore.h" - -#if defined (GDB_TARGET_IS_MACH386) - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - - -void -fetch_inferior_registers (regno) - int regno; /* Original value discarded */ -{ - struct regs inferior_registers; - struct fp_state inferior_fp_registers; - extern char registers[]; - - registers_fetched (); - - ptrace (PTRACE_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers); - ptrace (PTRACE_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers); - - bcopy (&inferior_registers, registers, sizeof inferior_registers); - - bcopy (inferior_fp_registers.f_st,®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.f_st); - bcopy (&inferior_fp_registers.f_ctrl, - ®isters[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). */ - -void -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 (®isters[REGISTER_BYTE (FP0_REGNUM)],inferior_fp_registers.f_st, - sizeof inferior_fp_registers.f_st); - bcopy (®isters[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, - (PTRACE_ARG3_TYPE) stack); - int reg = inferior_registers.r_reg[EAX]; - inferior_registers.r_reg[EAX] = - inferior_registers.r_reg[FP_REGNUM]; - ptrace (PTRACE_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers); - ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack, 0xc589); - ptrace (PTRACE_SINGLESTEP, inferior_pid, (PTRACE_ARG3_TYPE) stack, 0); - wait (0); - ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack, stuff); - inferior_registers.r_reg[EAX] = reg; - } -#endif - ptrace (PTRACE_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers); - ptrace (PTRACE_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers); -} - -#else /* Not mach386 target. */ - -/* These functions shouldn't be called when we're cross-debugging. */ - -/* ARGSUSED */ -void -fetch_inferior_registers (regno) - int regno; -{ -} - -/* ARGSUSED */ -void -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, reg_addr) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int reg_addr; /* Unused in this version */ -{ - 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, - ®isters[REGISTER_BYTE (FP0_REGNUM)], - core_reg_size); /* FIXME, probably bogus */ -#endif -#ifdef FPC_REGNUM - bcopy (&corestr.c_fpu.f_fpstatus.f_ctrl, - ®isters[REGISTER_BYTE (FPC_REGNUM)], - sizeof corestr.c_fpu.f_fpstatus - - sizeof corestr.c_fpu.f_fpstatus.f_st); -#endif - break; - } -} diff --git a/gdb/mcheck.c b/gdb/mcheck.c deleted file mode 100755 index 38b997a97e..0000000000 --- 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), (NOARGS)) = (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), (NOARGS))) -{ - 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/mips-opcode.h b/gdb/mips-opcode.h deleted file mode 100755 index f75d34e4a2..0000000000 --- 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-xdep.c b/gdb/mips-xdep.c deleted file mode 100644 index e314bf7c18..0000000000 --- a/gdb/mips-xdep.c +++ /dev/null @@ -1,163 +0,0 @@ -/* Low level MIPS interface to ptrace, for GDB when running under Unix. - Copyright 1988, 1989, 1991, 1992 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 "defs.h" -#include "inferior.h" -#include "gdbcore.h" - -/* For now we stub this out; sgi core format is super-hairy (and completely - different in the new release). - For most mips systems, this function is defined in coredep.c. */ - -#if defined(sgi) -void -fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int reg_addr; -{ - return; -} -#endif - -/* Access to the inferior is only good for native systems, not cross. - I am not sure why this is stubbed out on SGI... --gnu@cygnus.com */ - -#if defined(sgi) || !defined(GDB_TARGET_IS_MIPS) - -/* ARGSUSED */ -void -fetch_inferior_registers (regno) - int regno; -{ - return; -} - -/* ARGSUSED */ -void -store_inferior_registers (regno) - int regno; -{ - return; -} - - -#else - -/* DECstation native... */ - -#include - -/* Map gdb internal register number to ptrace ``address''. - These ``addresses'' are defined in DECstation */ - -#define REGISTER_PTRACE_ADDR(regno) \ - (regno < 32 ? GPR_BASE + regno \ - : regno == PC_REGNUM ? PC \ - : regno == CAUSE_REGNUM ? CAUSE \ - : regno == HI_REGNUM ? MMHI \ - : regno == LO_REGNUM ? MMLO \ - : regno == FCRCS_REGNUM ? FPC_CSR \ - : regno == FCRIR_REGNUM ? FPC_EIR \ - : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) \ - : 0) - -static const char zerobuf[MAX_REGISTER_RAW_SIZE]; - -/* Get all registers from the inferior */ - -void -fetch_inferior_registers (regno) - 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 (PT_READ_U, inferior_pid, - (PTRACE_ARG3_TYPE) regaddr, 0); - regaddr += sizeof (int); - } - supply_register (regno, buf); - } - - supply_register (ZERO_REGNUM, zerobuf); - /* Frame ptr reg must appear to be 0; it is faked by stack handling code. */ - supply_register (FP_REGNUM, zerobuf); -} - -/* 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 (PT_WRITE_U, inferior_pid, (PTRACE_ARG3_TYPE) 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 - || (regno >= FIRST_EMBED_REGNUM && regno <= LAST_EMBED_REGNUM)) - continue; - regaddr = register_addr (regno, 1); - errno = 0; - ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - read_register (regno)); - if (errno != 0) - { - sprintf (buf, "writing all regs, number %d", regno); - perror_with_name (buf); - } - } - } -} - -#endif /* sgi */ diff --git a/gdb/mmap-alloc.c b/gdb/mmap-alloc.c index d1ac6e4204..e69de29bb2 100755 --- a/gdb/mmap-alloc.c +++ b/gdb/mmap-alloc.c @@ -1,159 +0,0 @@ -/* GDB support for special malloc using mmap. - Copyright 1992 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 "defs.h" - -#if defined (HAVE_MMAP) - -/* Redefine the external visible symbols in gmalloc.c to be mmap versions */ - -#define free _mmap_free -#define malloc _mmap_malloc -#define realloc _mmap_realloc -#define valloc _mmap_valloc - -#define _bytes_free _mmap__bytes_free -#define _bytes_used _mmap__bytes_used -#define _chunks_free _mmap__chunks_free -#define _chunks_used _mmap__chunks_used -#define _fraghead _mmap__fraghead -#define _heapbase _mmap__heapbase -#define _heapindex _mmap__heapindex -#define _heapinfo _mmap__heapinfo -#define _heaplimit _mmap__heaplimit - -#define __default_morecore _mmap___default_morecore -#define __free _mmap___free -#define __free_hook _mmap___free_hook -#define __malloc_hook _mmap___malloc_hook -#define __malloc_initialized _mmap___malloc_initialized -#define __morecore _mmap___morecore -#define __realloc_hook _mmap___realloc_hook - -/* Arrange that instead of calling sbrk() we call mmap_sbrk() */ - -#define sbrk mmap_sbrk - -/* Now simply include the standard GNU malloc source, and all the - externally visible symbols will become _mmap_* versions, and - _mmap_sbrk will be called to get more core instead of sbrk. */ - -#include "gmalloc.c" - -/* Like mmap_malloc but get error if no storage available. */ - -PTR -mmap_xmalloc (size) - long size; -{ - register char *val = NULL; - - /* Protect against gdb wanting to allocate zero bytes. */ - - if (size > 0) - { - if ((val = (char *) _mmap_malloc (size)) == NULL) - { - fatal ("virtual memory exhausted.", 0); - } - } - return (val); -} - -/* Like mmap_realloc but get error if no storage available. */ - -PTR -mmap_xrealloc (ptr, size) - PTR ptr; - long size; -{ - register char *val; - - if ((val = (char *) _mmap_realloc (ptr, size)) == NULL) - { - fatal ("virtual memory exhausted.", 0); - } - return (val); -} - -PTR -mmap_malloc (size) - long size; -{ - return (_mmap_malloc (size)); -} - -PTR -mmap_realloc (ptr, size) - PTR ptr; - long size; -{ - return (_mmap_realloc (ptr, size)); -} - -void -mmap_free (ptr) - PTR ptr; -{ - _mmap_free (ptr); -} - -#else /* !defined (HAVE_MMAP) */ - -static char *errmsg = "This version of gdb does not support dumpable state."; - -PTR -mmap_malloc (size) - long size; -{ - error (errmsg); -} - -PTR -mmap_xmalloc (size) - long size; -{ - error (errmsg); -} - -PTR -mmap_realloc (ptr, size) - PTR ptr; - long size; -{ - error (errmsg); -} - -PTR -mmap_xrealloc (ptr, size) - PTR ptr; - long size; -{ - error (errmsg); -} - -void -mmap_free (ptr) - PTR ptr; -{ - error (errmsg); -} - -#endif /* HAVE_MMAP */ diff --git a/gdb/mmap-sbrk.c b/gdb/mmap-sbrk.c index 262284553d..e69de29bb2 100755 --- a/gdb/mmap-sbrk.c +++ b/gdb/mmap-sbrk.c @@ -1,144 +0,0 @@ -/* GDB support for an sbrk-like function that uses mmap. - Copyright 1992 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 "defs.h" - -#ifdef HAVE_MMAP - -#include -#include - -#ifdef i386 -#define MMAP_BASE ((caddr_t) 0x81000000) -#define MMAP_PGSZ 0x00002000 /* Must be multiple of real page size */ -#else -#define MMAP_BASE ((caddr_t) 0xC2000000) -#define MMAP_PGSZ 0x00002000 /* Must be multiple of real page size */ -#endif - -#define PAGE_ALIGN(addr) (caddr_t) (((long)(addr) + MMAP_PGSZ - 1) & \ - ~(MMAP_PGSZ - 1)) - -static caddr_t mbase = MMAP_BASE; /* Current base of mmap'd region */ -static caddr_t mbreak = MMAP_BASE; /* Current "break" address */ -static caddr_t mtop = MMAP_BASE; /* Current top of mmap'd region */ - -static int fd = -1; /* Open fd for /dev/zero */ - - -/* Provide a utility routine for other modules to obtain compatible - page alignment. */ - -PTR -mmap_page_align (addr) - PTR addr; -{ - return (PAGE_ALIGN (addr)); -} - -/* Return the base address of the start of the mmap'd region. Note that - we can find the end of the region at anytime by calling mmap_sbrk(0) */ - -PTR -mmap_base () -{ - return (mbase); -} - -/* Works like sbrk(), but uses mmap to add to or subtract from a - memory region. */ - -PTR -mmap_sbrk (size) - int size; -{ - PTR result = NULL; - int minc; - caddr_t moveto; - - if (size == 0) - { - /* Just return the current "break" value. */ - result = mbreak; - } - else if (size < 0) - { - /* We are deallocating memory. If the amount requested would cause - us to try to deallocate back past the base of the mmap'd region - then do nothing, and return NULL. Otherwise, deallocate the - memory and return the old break value. */ - if (mbreak + size >= mbase) - { - result = (PTR) mbreak; - mbreak += size; - moveto = PAGE_ALIGN (mbreak); - munmap (moveto, (size_t) (mtop - moveto)); - mtop = moveto; - } - } - else - { - /* We are allocating memory. Make sure we have an open file - descriptor and then go on to get the memory. */ - if ((fd == -1) && (fd = open ("/dev/zero", O_RDONLY)) < 0) - { - result = NULL; - } - else if (mbreak + size > mtop) - { - /* The request would move us past the end of the currently - mapped memory, so map in enough more memory to satisfy - the request. */ - moveto = PAGE_ALIGN (mbreak + size); - if (mmap (mtop, moveto - mtop, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0) == mtop) - { - mtop = moveto; - result = (PTR) mbreak; - mbreak += size; - } - } - else - { - result = (PTR) mbreak; - mbreak += size; - } - } - return (result); -} - -PTR -mmap_remap (base, mapsize, fd, foffset) - PTR base; - long mapsize; - int fd; - long foffset; -{ - /* FIXME: Quick hack, needs error checking and other attention. */ - munmap (mbase, (size_t) (mtop - mbase)); - mbase = base; - mtop = mbase + mapsize; - base = mmap (base, mapsize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, dup (fd), foffset); - return (base); -} - - -#endif /* HAVE_MMAP */ diff --git a/gdb/mtrace.awk b/gdb/mtrace.awk deleted file mode 100755 index d7689cec3f..0000000000 --- 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 82e7f03d41..0000000000 --- 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 -#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. . We can't include 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 */ -#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/nat-sparc.c b/gdb/nat-sparc.c index fb78d2de54..e69de29bb2 100644 --- a/gdb/nat-sparc.c +++ b/gdb/nat-sparc.c @@ -1,297 +0,0 @@ -/* Functions specific to running gdb native on a Sun 4 running sunos4. - Copyright (C) 1989, 1992, 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 "inferior.h" -#include "target.h" -#include "nat.h" - -#include -#include -#include -#include - -/* 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 - -/* 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, - (PTRACE_ARG3_TYPE) &inferior_registers, 0)) - perror("ptrace_getregs"); - - registers[REGISTER_BYTE (0)] = 0; - memcpy (®isters[REGISTER_BYTE (1)], &inferior_registers.r_g1, - 15 * REGISTER_RAW_SIZE (G0_REGNUM)); - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; - *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc; - *(int *)®isters[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, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, - 0)) - perror("ptrace_getfpregs"); - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof inferior_fp_registers.fpu_fr); - /* bcopy (&inferior_fp_registers.Fpu_fsr, - ®isters[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*)®isters[REGISTER_BYTE (SP_REGNUM)], - ®isters[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*)®isters[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), - ®isters[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). */ - -void -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; - } - } - - if (wanna_store & STACK_REGS) - { - CORE_ADDR sp = *(CORE_ADDR *)®isters[REGISTER_BYTE (SP_REGNUM)]; - - if (regno < 0 || regno == SP_REGNUM) - { - if (!register_valid[L0_REGNUM+5]) abort(); - target_xfer_memory (sp, - ®isters[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), - ®isters[REGISTER_BYTE (regno)], - REGISTER_RAW_SIZE (regno), 1); - } - - } - - if (wanna_store & INT_REGS) - { - if (!register_valid[G1_REGNUM]) abort(); - - memcpy (&inferior_registers.r_g1, ®isters[REGISTER_BYTE (G1_REGNUM)], - 15 * REGISTER_RAW_SIZE (G1_REGNUM)); - - inferior_registers.r_ps = - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; - inferior_registers.r_npc = - *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)]; - inferior_registers.r_y = - *(int *)®isters[REGISTER_BYTE (Y_REGNUM)]; - - if (0 != ptrace (PTRACE_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers, 0)) - perror("ptrace_setregs"); - } - - if (wanna_store & FP_REGS) - { - if (!register_valid[FP0_REGNUM+9]) abort(); - memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fpu_fr); - -/* memcpy (&inferior_fp_registers.Fpu_fsr, - ®isters[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE)); -****/ - if (0 != - ptrace (PTRACE_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0)) - perror("ptrace_setfpregs"); - } -} - - -void -fetch_core_registers (core_reg_sect, core_reg_size, which, ignore) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int ignore; /* reg addr, unused in this version */ -{ - - if (which == 0) { - - /* Integer registers */ - -#define gregs ((struct regs *)core_reg_sect) - /* G0 *always* holds 0. */ - *(int *)®isters[REGISTER_BYTE (0)] = 0; - - /* The globals and output registers. */ - memcpy (®isters[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1, - 15 * REGISTER_RAW_SIZE (G1_REGNUM)); - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps; - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc; - *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc; - *(int *)®isters[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 *)®isters[REGISTER_BYTE (SP_REGNUM)]; - if (0 != target_read_memory (sp, ®isters[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)) - { - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs, - sizeof (fpuregs->fpu_regs)); - memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr, - sizeof (FPU_FSR_TYPE)); - } - else - fprintf (stderr, "Couldn't read float regs from core file\n"); - } -} - diff --git a/gdb/nat-sun4os4.h b/gdb/nat-sun4os4.h index d871289767..e69de29bb2 100644 --- a/gdb/nat-sun4os4.h +++ b/gdb/nat-sun4os4.h @@ -1,27 +0,0 @@ -/* Macro definitions for running gdb on a Sun 4 running sunos 4. - Copyright (C) 1989, 1992, 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. */ - -/* Do implement the attach and detach commands. */ - -#define ATTACH_DETACH - -/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ - -#define FETCH_INFERIOR_REGISTERS - diff --git a/gdb/nat-trash.h b/gdb/nat-trash.h index 38bed5a89a..e69de29bb2 100644 --- a/gdb/nat-trash.h +++ b/gdb/nat-trash.h @@ -1,2 +0,0 @@ -/* this file is temporary scaffolding until all hosts have the - native/target/host split in place. FIXME. */ diff --git a/gdb/np1-opcode.h b/gdb/np1-opcode.h deleted file mode 100755 index 7e1001db8f..0000000000 --- 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/obstack.c b/gdb/obstack.c deleted file mode 100755 index 590fcaa9dc..0000000000 --- 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 2e80c9c70f..0000000000 --- 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 96bc85af42..0000000000 --- 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 b408a033fc..0000000000 --- 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/pn-opcode.h b/gdb/pn-opcode.h deleted file mode 100755 index 77a2770764..0000000000 --- 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/pyr-opcode.h b/gdb/pyr-opcode.h deleted file mode 100755 index 06632b8d91..0000000000 --- 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/rem-m68k.shar b/gdb/rem-m68k.shar deleted file mode 100755 index aeb76e5d85..0000000000 --- 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 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 - * - * $#. - * - * where - * :: - * :: < two hex digits computed as modulo 256 sum of > - * - * 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 -#include -#include - -/************************************************************************ - * - * 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 $# */ -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; - - /* $#. */ - 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> 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;iexceptionPC, - 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-multi.shar b/gdb/remote-multi.shar deleted file mode 100755 index 86c9cf0217..0000000000 --- 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 -#include -#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 -#include -#include -#include -#include -#include -#include -#include - -/***************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 -#include -#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, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fps_regs); - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; - bcopy (&inferior_fp_registers.fps_control, - ®isters[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 (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof inferior_fp_registers.fps_regs); - inferior_registers.r_ps = *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; - bcopy (®isters[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 *) ®isters[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 *) ®isters[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 - -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 -#include -#include -#include -#include -#include -#include - -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-sa.m68k.shar b/gdb/remote-sa.m68k.shar deleted file mode 100755 index aeb76e5d85..0000000000 --- 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 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 - * - * $#. - * - * where - * :: - * :: < two hex digits computed as modulo 256 sum of > - * - * 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 -#include -#include - -/************************************************************************ - * - * 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 $# */ -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; - - /* $#. */ - 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> 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;iexceptionPC, - 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-ser.c b/gdb/remote-ser.c index aebd693b48..e69de29bb2 100644 --- a/gdb/remote-ser.c +++ b/gdb/remote-ser.c @@ -1,794 +0,0 @@ -/* Remote target communications for serial-line targets in custom GDB protocol - Copyright 1988, 1991, 1992 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. */ - -/* 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" - - or... TAAPPPPPPPPFFFFFFFF - where AA is the signal number, - PPPPPPPP is the PC (PC_REGNUM), and - FFFFFFFF is the frame ptr (FP_REGNUM). - - kill req k -*/ - -#include "defs.h" -#include -#include "serial.h" -#include "frame.h" -#include "inferior.h" -#include "target.h" -#include "wait.h" -#include "terminal.h" -#include "gdbcmd.h" - -#include - -static int kiodebug = 0; -static int timeout = 5; - -#define PBUFSIZ 1024 - -/* 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) - -/* Round up PBUFSIZ to hold all the registers, at least. */ -#if REGISTER_BYTES > MAXBUFBYTES -#undef PBUFSIZ -#define PBUFSIZ (REGISTER_BYTES * 2 + 32) -#endif - -/* 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. */ - -/* 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[PBUFSIZ]; - int cnt = strlen (buf); - char ch; - char *p; - - /* Copy the packet into buffer BUF2, encapsulating it - and giving it a checksum. */ - - if (cnt > sizeof(buf2) - 5) /* Prosanity check */ - abort(); - - 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...", buf2); fflush(stdout); - } - serial_write (buf2, p - buf2); - - /* read until either a timeout occurs (\0) or '+' is read */ - do { - ch = readchar (); - if (kiodebug) { - if (ch == '+') - printf("Ack\n"); - else - printf ("%02X%c ", ch&0xFF, ch); - } - } while ((ch != '+') && (ch != '\0')); - } while (ch != '+'); -} - -/* Read a packet from the remote machine, with error checking, - and store it in BUF. BUF is expected to be of size PBUFSIZ. */ - -static void -getpkt (buf) - char *buf; -{ - char *bp; - unsigned char csum; - int c; - unsigned char c1, c2; - - 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; - if (bp >= buf+PBUFSIZ-1) - { - *bp = '\0'; - printf_filtered ("Remote packet too long: %s\n", buf); - goto whole; - } - *bp++ = c; - csum += c; - } - *bp = 0; - - c1 = fromhex (readchar ()); - c2 = fromhex (readchar ()); - if ((csum & 0xff) == (c1 << 4) + c2) - break; - printf_filtered ("Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n", - (c1 << 4) + c2, csum & 0xff, buf); - /* Try the whole thing again. */ -whole: - serial_write ("-", 1); - } - -#if 0 - immediate_quit--; -#endif - - serial_write ("+", 1); - - if (kiodebug) - fprintf (stderr,"Packet received: %s\n", buf); -} - -static void -remote_resume (step, siggnal) - int step, siggnal; -{ - char buf[PBUFSIZ]; - - if (siggnal) - error ("Can't send signals to a remote system. Try `handle %d ignore'.", - siggnal); - -#if 0 - dcache_flush (); -#endif - - strcpy (buf, step ? "s": "c"); - - putpkt (buf); -} - -/* Send ^C to target to halt it. Target will respond, and send us a - packet. */ - -void remote_interrupt(signo) - int signo; -{ - - if (kiodebug) - printf ("remote_interrupt called\n"); - - serial_write ("\003", 1); /* Send a ^C */ -} - - -/* 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). */ - -static int -remote_wait (status) - WAITTYPE *status; -{ - unsigned char buf[PBUFSIZ]; - void (*ofunc)(); - unsigned char *p; - int i; - char regs[REGISTER_RAW_SIZE (PC_REGNUM) + REGISTER_RAW_SIZE (FP_REGNUM)]; - - WSETEXIT ((*status), 0); - - ofunc = (void (*)()) signal (SIGINT, remote_interrupt); - getpkt ((char *) buf); - signal (SIGINT, ofunc); - - if (buf[0] == 'E') - error ("Remote failure reply: %s", buf); - if (buf[0] == 'T') - { - /* Expedited reply, containing Signal, PC, and FP. */ - p = &buf[3]; /* after Txx */ - for (i = 0; i < sizeof (regs); 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; - } - supply_register (PC_REGNUM, ®s[0]); - supply_register (FP_REGNUM, ®s[REGISTER_RAW_SIZE (PC_REGNUM)]); - } - else if (buf[0] != 'S') - error ("Invalid remote reply: %s", buf); - - WSETSTOP ((*status), (((fromhex (buf[1])) << 4) + (fromhex (buf[2])))); - - return 0; -} - -/* 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); -} - -/* Read the remote registers into the block REGS. */ -/* Currently we just read all the registers, so we don't use regno. */ -/* ARGSUSED */ -static 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, ®s[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. */ - -static 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 */ -static void -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); -} - - -/* 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. */ - -static 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); - - /* We send target system values byte by byte, in increasing byte addresses, - 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. */ - -static 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 memory 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. */ - -/* ARGSUSED */ -static int -remote_xfer_memory(memaddr, myaddr, len, should_write, target) - CORE_ADDR memaddr; - char *myaddr; - int len; - int should_write; - struct target_ops *target; /* ignored */ -{ - 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 */ -} - -static void -remote_files_info (ignore) -struct target_ops *ignore; -{ - printf ("Debugging a target over a serial line.\n"); -} - -/* - -A debug packet whose contents are -is encapsulated for transmission in the form: - - $ # CSUM1 CSUM2 - - must be ASCII alphanumeric and cannot include characters - '$' or '#' - - CSUM1 and CSUM2 are ascii hex representation of an 8-bit - checksum of , 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 - -*/ - -/* Read a single character from the remote end. - (If supported, we actually read many characters and buffer them up.) */ - -static int -readchar () -{ - static int inbuf_index, inbuf_count; -#define INBUFSIZE PBUFSIZ - static char inbuf[INBUFSIZE]; - - if (inbuf_index >= inbuf_count) - { - /* Time to do another read... */ - inbuf_index = 0; - inbuf_count = 0; - inbuf[0] = 0; /* Just in case */ - if ((inbuf[inbuf_index] = serial_readchar (timeout)) < 0) - inbuf_count = -1; - else - inbuf_count = 1; - } - - /* Just return the next character from the buffer. */ - return inbuf[inbuf_index++] & 0x7f; -} - - - -/* 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 -#include -#include -#include -#include -#include -#include -#define free bogon_free /* Sun claims "int free()" not void */ -#include -#undef free -#include -#include -#include "xdr_ptrace.h" -#include "xdr_ld.h" -#include "xdr_rdb.h" -#include "dbgRpcLib.h" - -/* get rid of value.h if possible */ -#include -#include - -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 -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 -- vx_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 - || TYPE_CODE (VALUE_TYPE (args[i])) == TYPE_CODE_UNION) - { - 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 *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *)®isters[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, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fps_regs); - bcopy (&inferior_fp_registers.fps_control, - ®isters[REGISTER_BYTE (FPC_REGNUM)], - sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs); - } - else - { - bzero (®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fps_regs); - bzero (®isters[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 *)®isters[REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = *(int *)®isters[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 (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof inferior_fp_registers.fps_regs); - bcopy (®isters[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, - 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, - 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/rs6000-xdep.c b/gdb/rs6000-xdep.c index 5524826a89..e69de29bb2 100644 --- a/gdb/rs6000-xdep.c +++ b/gdb/rs6000-xdep.c @@ -1,281 +0,0 @@ -/* IBM RS/6000 host-dependent code for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991, 1992 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 "frame.h" -#include "inferior.h" -#include "symtab.h" -#include "target.h" - -#ifdef IBM6000_TARGET - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -extern int errno; - -static void -exec_one_dummy_insn PARAMS ((void)); - -/* 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 */ -}; - -void -fetch_inferior_registers (regno) - int regno; -{ - int ii; - extern char registers[]; - - if (regno < 0) { /* for all registers */ - - /* read 32 general purpose registers. */ - - for (ii=0; ii < 32; ++ii) - *(int*)®isters[REGISTER_BYTE (ii)] = - ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) ii, 0, 0); - - /* read general purpose floating point registers. */ - - for (ii=0; ii < 32; ++ii) - ptrace (PT_READ_FPR, inferior_pid, - (PTRACE_ARG3_TYPE) ®isters [REGISTER_BYTE (FP0_REGNUM+ii)], - FPR0+ii, 0); - - /* read special registers. */ - for (ii=0; ii <= LAST_SP_REGNUM-FIRST_SP_REGNUM; ++ii) - *(int*)®isters[REGISTER_BYTE (FIRST_SP_REGNUM+ii)] = - ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) special_regs[ii], - 0, 0); - - registers_fetched (); - return; - } - - /* else an individual register is addressed. */ - - else if (regno < FP0_REGNUM) { /* a GPR */ - *(int*)®isters[REGISTER_BYTE (regno)] = - ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) regno, 0, 0); - } - else if (regno <= FPLAST_REGNUM) { /* a FPR */ - ptrace (PT_READ_FPR, inferior_pid, - (PTRACE_ARG3_TYPE) ®isters [REGISTER_BYTE (regno)], - (regno-FP0_REGNUM+FPR0), 0); - } - else if (regno <= LAST_SP_REGNUM) { /* a special register */ - *(int*)®isters[REGISTER_BYTE (regno)] = - ptrace (PT_READ_GPR, inferior_pid, - (PTRACE_ARG3_TYPE) special_regs[regno-FIRST_SP_REGNUM], 0, 0); - } - else - fprintf (stderr, "gdb error: register no %d not implemented.\n", regno); - - 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). */ - -void -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, (PTRACE_ARG3_TYPE) ii, - *(int*)®isters[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, - (PTRACE_ARG3_TYPE) ®isters[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, - (PTRACE_ARG3_TYPE) special_regs[ii], - *(int*)®isters[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, (PTRACE_ARG3_TYPE) regno, - *(int*)®isters[REGISTER_BYTE (regno)], 0); - } - - else if (regno <= FPLAST_REGNUM) { /* a FPR */ - ptrace (PT_WRITE_FPR, inferior_pid, - (PTRACE_ARG3_TYPE) ®isters[REGISTER_BYTE (regno)], - regno-FP0_REGNUM+FPR0, 0); - } - - else if (regno <= LAST_SP_REGNUM) { /* a special register */ - - ptrace (PT_WRITE_GPR, inferior_pid, - (PTRACE_ARG3_TYPE) special_regs [regno-FIRST_SP_REGNUM], - *(int*)®isters[REGISTER_BYTE (regno)], 0); - } - - else - fprintf (stderr, "Gdb error: register no %d not implemented.\n", regno); - - if ( errno ) { - perror ("ptrace write"); errno = 0; - } -} - -void -fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int reg_addr; /* Unused in this version */ -{ - /* 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, ®isters [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, ®isters [REGISTER_BYTE (FP0_REGNUM)], 32 * 8); - - else - fprintf (stderr, "Gdb error: unknown parameter to fetch_core_registers().\n"); -} - - -/* Execute one dummy breakpoint instruction. This way we give the kernel - a chance to do some housekeeping and update inferior's internal data, - including u_area. */ -static void -exec_one_dummy_insn () -{ -#define DUMMY_INSN_ADDR (TEXT_SEGMENT_BASE)+0x200 - - unsigned long shadow; - unsigned int status, pid; - - /* We plant one dummy breakpoint into DUMMY_INSN_ADDR address. We assume that - this address will never be executed again by the real code. */ - - target_insert_breakpoint (DUMMY_INSN_ADDR, &shadow); - - errno = 0; - ptrace (PT_CONTINUE, inferior_pid, (PTRACE_ARG3_TYPE) 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); -} - - -#else /* IBM6000_TARGET */ - -/* FIXME: Kludge this til we separate host vs. target vs. native code. */ - -void -fetch_inferior_registers (regno) - int regno; -{ -} - -void -store_inferior_registers (regno) - int regno; -{ -} - -void -fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int reg_addr; /* Unused in this version */ -{ -} - -#endif /* IBM6000_TARGET */ diff --git a/gdb/rs6k-opcode.def b/gdb/rs6k-opcode.def index 785fd9df2c..e69de29bb2 100755 --- a/gdb/rs6k-opcode.def +++ b/gdb/rs6k-opcode.def @@ -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 index 7f616b5182..e69de29bb2 100755 --- a/gdb/rs6k-opcode.h +++ b/gdb/rs6k-opcode.h @@ -1,236 +0,0 @@ -/* IBM RS/6000 instruction set definitions, for GNU software. */ - -typedef struct rs6000_insn { - char *operator; /* opcode name */ - char *opr_ext; /* opcode name extension */ - char *format; /* opcode format */ - char p_opcode; /* primary opcode */ - int e_opcode; /* extended opcode */ - char oprnd_format[6]; /* operand format */ -} OPCODE; - -/* 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 - -/* RS/6000 INSTRUCTION SET - (sorted on primary and extended opcode) - - oprtr primary ext. -operator ext format opcode opcode operand format -------- ------- ------ ------- ------ --------------- */ - -struct rs6000_insn rs6k_ops [] = { - -{"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, 136, {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, {RS,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} }, -}; - -#define NOPCODES (sizeof (rs6k_ops) / sizeof (struct rs6000_insn)) diff --git a/gdb/signame.c b/gdb/signame.c deleted file mode 100755 index f96b74ef35..0000000000 --- a/gdb/signame.c +++ /dev/null @@ -1,260 +0,0 @@ -/* Convert between signal names and numbers, for GDB. - Copyright 1990, 1991, 1992 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. */ - -/* GDB-specific, FIXME. (This is for the SYS_SIGLIST_MISSING define). */ -#include "defs.h" -#include -#include "signame.h" - -static void -init_sig PARAMS ((int, const char *, const char *)); - -static void -init_sigs PARAMS ((void)); - -#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 -#if defined (SIGWAITING) - init_sig (SIGWAITING, "WAITING", "Process's LWPs are blocked"); /* FIXME */ -#endif -#if defined (SIGLWP) - init_sig (SIGLWP, "LWP", "Signal LWP"); /* FIXME description */ -#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 0010796e8f..0000000000 --- a/gdb/signame.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Convert between signal names and numbers. - Copyright 1990, 1992 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. */ - -#if !defined (SIGNAME_H) -#define SIGNAME_H 1 - -/* Names for signals from 0 to NSIG-1. */ -extern char *sys_siglist[]; - -/* 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 *. */ - -extern char * -sig_abbrev PARAMS ((int)); - -/* Return the signal number for an ABBREV, or -1 if there is no - signal by that name. */ - -extern int -sig_number PARAMS ((const char *)); - -#ifndef PSIGNAL_IN_SIGNAL_H -/* Print to standard error the name of SIGNAL, preceded by MESSAGE and - a colon, and followed by a newline. */ - -extern void -psignal PARAMS ((unsigned, const char *)); -#endif - -#endif /* !defined (SIGNAME_H) */ diff --git a/gdb/sparc-opcode.h b/gdb/sparc-opcode.h deleted file mode 100755 index d97c7a3284..0000000000 --- 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-xdep.c b/gdb/sparc-xdep.c deleted file mode 100644 index a040bf5ffb..0000000000 --- a/gdb/sparc-xdep.c +++ /dev/null @@ -1,302 +0,0 @@ -/* Host-dependent code for SPARC host systems, for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1990, 1991, 1992 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 code only compiles when we have the definitions in tm-sparc.h. */ - -#define TM_FILE_OVERRIDE -#include "defs.h" -#include "tm-sparc.h" - -#include "inferior.h" -#include "target.h" - -#include -#include -#include - -#include "gdbcore.h" -#include - -/* 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 - -/* The variable deferred_stores itself is defined in sparc-tdep.c. */ - -/* 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, - (PTRACE_ARG3_TYPE) &inferior_registers, 0)) - perror("ptrace_getregs"); - - registers[REGISTER_BYTE (0)] = 0; - memcpy (®isters[REGISTER_BYTE (1)], &inferior_registers.r_g1, - 15 * REGISTER_RAW_SIZE (G0_REGNUM)); - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; - *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc; - *(int *)®isters[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, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, - 0)) - perror("ptrace_getfpregs"); - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof inferior_fp_registers.fpu_fr); - /* bcopy (&inferior_fp_registers.Fpu_fsr, - ®isters[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*)®isters[REGISTER_BYTE (SP_REGNUM)], - ®isters[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*)®isters[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), - ®isters[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). */ - -void -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; - } - } - - if (wanna_store & STACK_REGS) - { - CORE_ADDR sp = *(CORE_ADDR *)®isters[REGISTER_BYTE (SP_REGNUM)]; - - if (regno < 0 || regno == SP_REGNUM) - { - if (!register_valid[L0_REGNUM+5]) abort(); - target_xfer_memory (sp, - ®isters[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), - ®isters[REGISTER_BYTE (regno)], - REGISTER_RAW_SIZE (regno), 1); - } - - } - - if (wanna_store & INT_REGS) - { - if (!register_valid[G1_REGNUM]) abort(); - - memcpy (&inferior_registers.r_g1, ®isters[REGISTER_BYTE (G1_REGNUM)], - 15 * REGISTER_RAW_SIZE (G1_REGNUM)); - - inferior_registers.r_ps = - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; - inferior_registers.r_npc = - *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)]; - inferior_registers.r_y = - *(int *)®isters[REGISTER_BYTE (Y_REGNUM)]; - - if (0 != ptrace (PTRACE_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers, 0)) - perror("ptrace_setregs"); - } - - if (wanna_store & FP_REGS) - { - if (!register_valid[FP0_REGNUM+9]) abort(); - memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fpu_fr); - -/* memcpy (&inferior_fp_registers.Fpu_fsr, - ®isters[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE)); -****/ - if (0 != - ptrace (PTRACE_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0)) - perror("ptrace_setfpregs"); - } -} - -void -fetch_core_registers (core_reg_sect, core_reg_size, which, ignore) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int ignore; /* reg addr, unused in this version */ -{ - - if (which == 0) { - - /* Integer registers */ - -#define gregs ((struct regs *)core_reg_sect) - /* G0 *always* holds 0. */ - *(int *)®isters[REGISTER_BYTE (0)] = 0; - - /* The globals and output registers. */ - memcpy (®isters[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1, - 15 * REGISTER_RAW_SIZE (G1_REGNUM)); - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps; - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc; - *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc; - *(int *)®isters[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 *)®isters[REGISTER_BYTE (SP_REGNUM)]; - if (0 != target_read_memory (sp, ®isters[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)) - { - memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs, - sizeof (fpuregs->fpu_regs)); - memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr, - 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 58364e1422..0000000000 --- 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/stddef.h b/gdb/stddef.h deleted file mode 100755 index c2c396e139..0000000000 --- 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 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 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 40ce1676a1..0000000000 --- a/gdb/stdlib.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Fake stdlib.h supplying the stuff needed by malloc. */ - -#ifndef __ONEFILE -#include -#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/sun3-xdep.c b/gdb/sun3-xdep.c deleted file mode 100644 index 03cc3ae491..0000000000 --- a/gdb/sun3-xdep.c +++ /dev/null @@ -1,167 +0,0 @@ -/* Host-dependent code for Sun-3 for GDB, the GNU debugger. - Copyright 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 "defs.h" -#include "inferior.h" -#include "gdbcore.h" - -#include -#define KERNEL /* To get floating point reg definitions */ -#include - -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 (regno) - int regno; -{ - struct regs inferior_registers; -#ifdef FP0_REGNUM - struct fp_status inferior_fp_registers; -#endif - extern char registers[]; - - registers_fetched (); - - ptrace (PTRACE_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers); -#ifdef FP0_REGNUM - ptrace (PTRACE_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers); -#endif - - bcopy (&inferior_registers, registers, 16 * 4); -#ifdef FP0_REGNUM - bcopy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fps_regs); -#endif - *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; -#ifdef FP0_REGNUM - bcopy (&inferior_fp_registers.fps_control, - ®isters[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). */ - -void -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 (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof inferior_fp_registers.fps_regs); -#endif - inferior_registers.r_ps = *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; - -#ifdef FP0_REGNUM - bcopy (®isters[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, - (PTRACE_ARG3_TYPE) &inferior_registers); -#if FP0_REGNUM - ptrace (PTRACE_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &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, reg_addr) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int reg_addr; /* Unused in this version */ -{ - 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, (char *)®s->r_ps); - supply_register (PC_REGNUM, (char *)®s->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, - ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof fpustruct->f_fpstatus.fps_regs); - bcopy (&fpustruct->f_fpstatus.fps_control, - ®isters[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. */ - -/* ARGSUSED */ -void -fetch_inferior_registers (regno) - int regno; -{ -} - -/* ARGSUSED */ -void -store_inferior_registers (regno) - int regno; -{ -} - -/* ARGSUSED */ -void -fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int reg_addr; /* Unused in this version */ -{ -} -#endif /* Not sun3 target. */ diff --git a/gdb/sun386-xdep.c b/gdb/sun386-xdep.c deleted file mode 100644 index 7da605b7f7..0000000000 --- a/gdb/sun386-xdep.c +++ /dev/null @@ -1,289 +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 "defs.h" -#include "frame.h" -#include "inferior.h" -#include "gdbcore.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - - -void -fetch_inferior_registers (regno) - int regno; -{ - struct regs inferior_registers; - struct fp_state inferior_fp_registers; - extern char registers[]; - - registers_fetched (); - - ptrace (PTRACE_GETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers); - ptrace (PTRACE_GETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_fp_registers); - - bcopy (&inferior_registers, registers, sizeof inferior_registers); - - bcopy (inferior_fp_registers.f_st,®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.f_st); - bcopy (&inferior_fp_registers.f_ctrl, - ®isters[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). */ - -void -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 (®isters[REGISTER_BYTE (FP0_REGNUM)],inferior_fp_registers.f_st, - sizeof inferior_fp_registers.f_st); - bcopy (®isters[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, - (PTRACE_ARG3_TYPE) stack); - int reg = inferior_registers.r_reg[EAX]; - inferior_registers.r_reg[EAX] = - inferior_registers.r_reg[FP_REGNUM]; - ptrace (PTRACE_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers); - ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack, - 0xc589); - ptrace (PTRACE_SINGLESTEP, inferior_pid, (PTRACE_ARG3_TYPE) stack, - 0); - wait (0); - ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack, - stuff); - inferior_registers.r_reg[EAX] = reg; - } -#endif - ptrace (PTRACE_SETREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &inferior_registers); - ptrace (PTRACE_SETFPREGS, inferior_pid, - (PTRACE_ARG3_TYPE) &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, - ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof corestr.c_fpu.f_fpstatus.f_st); - bcopy (&corestr.c_fpu.f_fpstatus.f_ctrl, - ®isters[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, safe_strsignal (corestr.c_signo)); - } - 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. */ - -/* ARGSUSED */ -void -fetch_inferior_registers (regno) - int regno; -{ -} - -/* ARGSUSED */ -void -store_inferior_registers (regno) - int regno; -{ -} - -/* ARGSUSED */ -void -fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) - char *core_reg_sect; - unsigned core_reg_size; - int which; - unsigned int reg_addr; /* Unused in this version */ -{ -} - -#endif /* Not sun386 target. */ diff --git a/gdb/symmetry-tdep.c b/gdb/symmetry-tdep.c deleted file mode 100755 index aba21c3c43..0000000000 --- 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 -#include "defs.h" -#include "param.h" -#include "frame.h" -#include "inferior.h" -#include "symtab.h" - -#include -#include -#include -#include -#include -#include -#include "gdbcore.h" -#include - -static long i386_get_frame_setup (); -static i386_follow_jump (); - -#include -#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 *)®buf[REGISTER_BYTE(19)]); - xd.l[0] = *((int *)®buf[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 *)®buf[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 34496789ac..0000000000 --- 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 -#include "defs.h" -#include "param.h" -#include "frame.h" -#include "inferior.h" -#include "symtab.h" - -#include -#include -#include -#include -#include -#include -#include "gdbcore.h" -#include - -static long i386_get_frame_setup (); -static i386_follow_jump (); - -#include -#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 *)®isters[REGISTER_BYTE(0)]; - regs.pr_ebx = *(int *)®isters[REGISTER_BYTE(5)]; - regs.pr_ecx = *(int *)®isters[REGISTER_BYTE(2)]; - regs.pr_edx = *(int *)®isters[REGISTER_BYTE(1)]; - regs.pr_esi = *(int *)®isters[REGISTER_BYTE(6)]; - regs.pr_edi = *(int *)®isters[REGISTER_BYTE(7)]; - regs.pr_esp = *(int *)®isters[REGISTER_BYTE(14)]; - regs.pr_ebp = *(int *)®isters[REGISTER_BYTE(15)]; - regs.pr_eip = *(int *)®isters[REGISTER_BYTE(16)]; - regs.pr_flags = *(int *)®isters[REGISTER_BYTE(17)]; - for (i = 0; i < 31; i++) { - regs.pr_fpa.fpa_regs[i] = - *(int *)®isters[REGISTER_BYTE(FP1_REGNUM+i)]; - } -#if 0 - } - else - { - reg_tmp = *(int *)®isters[REGISTER_BYTE(regno)]; - ptrace(XPT_RREGS, inferior_pid, ®s, 0); - switch (regno) - { - case 0: - regs.pr_eax = *(int *)®isters[REGISTER_BYTE(0)]; - break; - case 5: - regs.pr_ebx = *(int *)®isters[REGISTER_BYTE(5)]; - break; - case 2: - regs.pr_ecx = *(int *)®isters[REGISTER_BYTE(2)]; - break; - case 1: - regs.pr_edx = *(int *)®isters[REGISTER_BYTE(1)]; - break; - case 6: - regs.pr_esi = *(int *)®isters[REGISTER_BYTE(6)]; - break; - case 7: - regs.pr_edi = *(int *)®isters[REGISTER_BYTE(7)]; - break; - case 15: - regs.pr_ebp = *(int *)®isters[REGISTER_BYTE(15)]; - break; - case 14: - regs.pr_esp = *(int *)®isters[REGISTER_BYTE(14)]; - break; - case 16: - regs.pr_eip = *(int *)®isters[REGISTER_BYTE(16)]; - break; - case 17: - regs.pr_flags = *(int *)®isters[REGISTER_BYTE(17)]; - break; - } - } -#endif /* 0 */ - ptrace(XPT_WREGS, inferior_pid, ®s, 0); -} - -void -fetch_inferior_registers() -{ - int i; - struct pt_regset regs; - extern char registers[]; - - registers_fetched (); - - ptrace(XPT_RREGS, inferior_pid, ®s, 0); - *(int *)®isters[REGISTER_BYTE(0)] = regs.pr_eax; - *(int *)®isters[REGISTER_BYTE(5)] = regs.pr_ebx; - *(int *)®isters[REGISTER_BYTE(2)] = regs.pr_ecx; - *(int *)®isters[REGISTER_BYTE(1)] = regs.pr_edx; - *(int *)®isters[REGISTER_BYTE(6)] = regs.pr_esi; - *(int *)®isters[REGISTER_BYTE(7)] = regs.pr_edi; - *(int *)®isters[REGISTER_BYTE(15)] = regs.pr_ebp; - *(int *)®isters[REGISTER_BYTE(14)] = regs.pr_esp; - *(int *)®isters[REGISTER_BYTE(16)] = regs.pr_eip; - *(int *)®isters[REGISTER_BYTE(17)] = regs.pr_flags; - for (i = 0; i < FPA_NREGS; i++) { - *(int *)®isters[REGISTER_BYTE(FP1_REGNUM+i)] = regs.pr_fpa.fpa_regs[i]; - } - bcopy(regs.pr_fpu.fpu_stack[0], ®isters[REGISTER_BYTE(3)], 10); - bcopy(regs.pr_fpu.fpu_stack[1], ®isters[REGISTER_BYTE(4)], 10); - bcopy(regs.pr_fpu.fpu_stack[2], ®isters[REGISTER_BYTE(8)], 10); - bcopy(regs.pr_fpu.fpu_stack[3], ®isters[REGISTER_BYTE(9)], 10); - bcopy(regs.pr_fpu.fpu_stack[4], ®isters[REGISTER_BYTE(10)], 10); - bcopy(regs.pr_fpu.fpu_stack[5], ®isters[REGISTER_BYTE(11)], 10); - bcopy(regs.pr_fpu.fpu_stack[6], ®isters[REGISTER_BYTE(12)], 10); - bcopy(regs.pr_fpu.fpu_stack[7], ®isters[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 */ - 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, ®set, 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/tahoe-opcode.h b/gdb/tahoe-opcode.h deleted file mode 100755 index b5cee249ee..0000000000 --- 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/tdesc.c b/gdb/tdesc.c deleted file mode 100755 index 4a38649aa3..0000000000 --- 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 -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<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;pchandle,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 3936330528..0000000000 --- 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/tm-altosgas.h b/gdb/tm-altosgas.h deleted file mode 100644 index c20030c425..0000000000 --- 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-hppabsd.h b/gdb/tm-hppabsd.h index 577bb9bbe6..e69de29bb2 100644 --- a/gdb/tm-hppabsd.h +++ b/gdb/tm-hppabsd.h @@ -1,6 +0,0 @@ -/* Parameters for execution on an HP PA-RISC machine running BSD, for GDB. - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.edu). */ - -/* It's all just the common stuff. */ -#include "tm-hppa.h" diff --git a/gdb/tm-hppahpux.h b/gdb/tm-hppahpux.h index 130365daf9..e69de29bb2 100644 --- a/gdb/tm-hppahpux.h +++ b/gdb/tm-hppahpux.h @@ -1,39 +0,0 @@ -/* Parameters for execution on an HP PA-RISC machine, running HPUX, for GDB. - Copyright 1991, 1992 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.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. */ - -/* Mostly it's common to all HPPA's. */ -#include "tm-hppa.h" - -/* Saved PC's are different, since there is millicode. */ -extern CORE_ADDR millicode_start, millicode_end; - -/* 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. */ - -#undef SAVED_PC_AFTER_CALL -#define SAVED_PC_AFTER_CALL(frame) \ - ((get_frame_pc (frame) >= millicode_start \ - && get_frame_pc (frame) < millicode_end) ? \ - read_register (31) & ~3 \ - : read_register (RP_REGNUM) & ~3) diff --git a/gdb/tm-i386v-g.h b/gdb/tm-i386v-g.h deleted file mode 100644 index 669284a32b..0000000000 --- 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-sun4os5.h b/gdb/tm-sun4os5.h index 942fb87890..e69de29bb2 100644 --- a/gdb/tm-sun4os5.h +++ b/gdb/tm-sun4os5.h @@ -1,54 +0,0 @@ -/* Macro definitions for GDB for a Sun 4 running SunOS 5. - Copyright (C) 1989, 1992 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-sysv4.h" - -#undef STACK_END_ADDRESS -#define STACK_END_ADDRESS 0xf8000000 - -#if 0 /* Setjmp/longjmp are not as well doc'd in SunOS 5.x yet */ - -/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a - comment in ! */ - -#define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */ - -#define JB_ONSSTACK 0 -#define JB_SIGMASK 1 -#define JB_SP 2 -#define JB_PC 3 -#define JB_NPC 4 -#define JB_PSR 5 -#define JB_G1 6 -#define JB_O0 7 -#define JB_WBCNT 8 - -/* Figure out where the longjmp will land. We expect that we have just entered - longjmp and haven't yet setup the stack frame, so the args are still in the - output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we - extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. - This routine returns true on success */ - -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); - -#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -#endif /* 0 */ diff --git a/gdb/tm-svr4.h b/gdb/tm-svr4.h index f1eea2057c..e69de29bb2 100755 --- a/gdb/tm-svr4.h +++ b/gdb/tm-svr4.h @@ -1,37 +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. */ - -/* Support for SVR4 shared libraries. */ - -#define CLEAR_SOLIB clear_solib -extern void clear_solib (); /* solib.c */ - -#define SOLIB_ADD(filename, from_tty, targ) solib_add (filename, from_tty, targ) -extern void solib_add (); /* solib.c */ - -#define SOLIB_CREATE_INFERIOR_HOOK solib_create_inferior_hook -extern void solib_create_inferior_hook(); /* solib.c */ - -/* 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-vxworks68.h b/gdb/tm-vxworks68.h deleted file mode 100755 index a3cd7c22f6..0000000000 --- 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 fc5c21454f..0000000000 --- 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/vax-opcode.h b/gdb/vax-opcode.h deleted file mode 100755 index 594e6352b9..0000000000 --- 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/xm-hppabsd.h b/gdb/xm-hppabsd.h index 7e5a4c5a32..e69de29bb2 100644 --- a/gdb/xm-hppabsd.h +++ b/gdb/xm-hppabsd.h @@ -1,52 +0,0 @@ -/* Parameters for hosting on an HPPA PA-RISC machine, running BSD, for GDB. - Copyright 1991, 1992 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.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 is a big-endian host. */ - -#define HOST_BYTE_ORDER BIG_ENDIAN - -/* Avoid "INT_MIN redefined" warnings -- by defining it here, exactly - the same as in the system file. */ -#undef INT_MIN -#define INT_MIN 0x80000000 - -#ifndef hp800 -#define USG -#endif - - -#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ - sp = hp_push_arguments(nargs, args, sp, struct_return, struct_addr) - -#define KERNEL_U_ADDR 0 - -/* What a coincidence! */ -#define REGISTER_U_ADDR(addr, blockend, regno) \ -{ addr = (int)(blockend) + REGISTER_BYTE (regno);} - -#define U_REGS_OFFSET 0 - -#ifndef SEEK_SET -# define SEEK_SET 0 /* Set file pointer to "offset" */ -# define SEEK_CUR 1 /* Set file pointer to current plus "offset" */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif /* SEEK_SET */ diff --git a/gdb/xm-hppahpux.h b/gdb/xm-hppahpux.h index 83cb839c4a..e69de29bb2 100644 --- a/gdb/xm-hppahpux.h +++ b/gdb/xm-hppahpux.h @@ -1,46 +0,0 @@ -/* Parameters for hosting on an HPPA-RISC machine running HPUX, for GDB. - Copyright 1991, 1992 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.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. */ - -/* Host is big-endian. */ -#define HOST_BYTE_ORDER BIG_ENDIAN - -/* Avoid "INT_MIN redefined" warnings -- by defining it here, exactly - the same as in the system file. */ -#undef INT_MIN -#define INT_MIN 0x80000000 - -#ifndef hp800 -#define USG -#endif - -#define HAVE_TERMIO - -#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ - sp = hp_push_arguments(nargs, args, sp, struct_return, struct_addr) - -#define KERNEL_U_ADDR 0 - -/* What a coincidence! */ -#define REGISTER_U_ADDR(addr, blockend, regno) \ -{ addr = (int)(blockend) + REGISTER_BYTE (regno);} - -#define U_REGS_OFFSET 0 diff --git a/gdb/xm-sun4os5.h b/gdb/xm-sun4os5.h index 5749319a03..e69de29bb2 100644 --- a/gdb/xm-sun4os5.h +++ b/gdb/xm-sun4os5.h @@ -1,61 +0,0 @@ -/* Macro definitions for running gdb on a Sun 4 running sunos 5. - Copyright 1989, 1992 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. */ - -/* Most of what we know is generic to SPARC hosts. */ - -#include "xm-sparc.h" - -/* Pick up more stuff from the generic SVR4 host include file. */ - -#include "xm-sysv4.h" - -/* SVR4's can't seem to agree on what to call the type that contains the - general registers. Kludge around it with a #define. */ - -#define gregset_t prgreg_t -#define fpregset_t prfpregset_t - -/* The native Sun compiler complains about using volatile - to indicate functions that never return. So shut it up by simply - defining away "NORETURN", which is normally defined to "volatile". */ - -#ifndef __GNUC__ -# define NORETURN /**/ -#endif - -/* 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 - -/* If you expect to use the mmalloc package to obtain mapped symbol files, - for now you have to specify some parameters that determine how gdb places - the mappings in it's address space. See the comments in map_to_address() - for details. This is expected to only be a short term solution. Yes it - is a kludge. - FIXME: Make this more automatic. */ - -#define MMAP_BASE_ADDRESS 0xE0000000 /* First mapping here */ -#define MMAP_INCREMENT 0x01000000 /* Increment to next mapping */ - -/* These are not currently used in SVR4 (but should be, FIXME!). */ -#undef DO_DEFERRED_STORES -#undef CLEAR_DEFERRED_STORES diff --git a/gdb/xm-svr4.h b/gdb/xm-svr4.h index f4c4a53690..e69de29bb2 100755 --- a/gdb/xm-svr4.h +++ b/gdb/xm-svr4.h @@ -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/ld/Makefile b/ld/Makefile deleted file mode 100755 index a565bbf509..0000000000 --- a/ld/Makefile +++ /dev/null @@ -1,201 +0,0 @@ -# -# Makefile for ld version 2 -# -# $Id$ -# -srcdir=../common -VPATH=../common -BASEDIR = ../.. -HOSTDIR = ../$(HOST)/ -INCLUDE = $(srcdir)/$(BASEDIR)/include-cygnus -INCLUDES = -I. -I$(srcdir) -I$(INCLUDE) -DEBUG = -g - - -#__sun3__#EXTRA_DEF=-DHOST_SYS=SUN3_SYS -#__sun4__#EXTRA_DEF=-DHOST_SYS=SUN4_SYS -#__dgux__#EXTRA_DEF=-DHOST_SYS=DGUX_SYS - -CFLAGS = $(INCLUDES) $(EXTRA_DEF) $(DEBUG) -LINTFLAGS = $(INCLUDES) $(EXTRA_DEF) - -.SUFFIXES: .y - -.y.o: - yacc -tvd $< - mv y.tab.c ldgram.tab.c - $(CC) -c $(CFLAGS) ldgram.tab.c - mv ldgram.tab.o ldgram.o - - -# go directly to ld.new in case this ld isn't capable of -# linking native object on this host. It can be renamed on -# install. -PROGS = $(HOSTDIR)/ld.new - -# for self hosting -GNUTARGET=a.out-generic-big -LDEMULATION=gld -BFDLIB=$(srcdir)/$(BASEDIR)/bfd/$(HOST)/libbfd.a - -OBJS= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o ld-gld68k.o \ - ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ldfile.o - -HEADERS=config.h ldmain.h ldmain.h ldmisc.h ldsym.h ldlang.h ldexp.h \ - ldlex.h ldwrite.h ldversion.h ld-emul.h ldfile.h ldgram.h ld.h - -MANSOURCES=ld.tex - -LDCSOURCES=ldlang.c ldmain.c ldwrite.c ld-lnk960.c ld-gld.c ld-gld68k.c \ - ld-gld960.c ld-emul.c ldversion.c ldmisc.c ldexp.c ldsym.c ldfile.c - -GENERATED_SOURCES=ldgram.tab.c ldlex.c ldgram.tab.h y.tab.h -GENERATED_HEADERS=ldgram.tab.h - -LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l - -BFDSOURCES=../../bfd/common/*.c - -SOURCES= $(LDSOURCES) $(BFDSOURCES) -LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES) - -all: Makefile $(PROGS) - - - -$(BFDLIB): $(BFDSOURCES) - (cd ../bfd; make) - -$(PROGS): $(OBJS) $(BFDLIB) -# (cd ../bfd; make) -# LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-generic-big;./ldok -format a.out-generic-big -o ld /lib/crt0.o $(OBJS) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib -# gld -o ld /lib/crt0.o $(OBJS) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib - $(CC) -Bstatic -o ld.new $(OBJS) $(BFDLIB) - - -ld1: ld - gcc -v -B./ -o ld1 $(OBJS) $(BFDLIB) - -ld2: ld1 - mv ld1 ld - gcc -v -B./ -o ld2 $(OBJS) $(BFDLIB) - -ld3: ld2 - mv ld2 ld - gcc -v -B./ -o ld3 $(OBJS) $(BFDLIB) - -ld.dvi:ld.tex - tex ld.tex - -ldgram.o: ldgram.y -ldgram.tab.h:ldgram.y - cp y.tab.h ldgram.tab.h - -ldlex.c: ldlex.l ldgram.tab.h -ldlex.o: ldlex.c ldgram.tab.h - -ldmain.o: ldmain.c -ldversion.o: ldversion.c -ldfile.o: ldfile.c -ldwrite.o: ldwrite.c -ldlang.o: ldlang.c ldgram.tab.h -ld-gld.o: ld-gld.c -ld-gld68k.o: ld-gld68k.c -ld-gld960.o: ld-gld960.c -ld-emul.o: ld-emul.c -ld-lnk960.o: ld-lnk960.c -ldexp.o: ldexp.c ldgram.tab.h -ldmisc.o: ldmisc.c -ldsym.o: ldsym.c - -clean: - - rm -f $(OBJS) $(GENERATED_SOURCES) $(GENERATED_HEADERS) - - rm -f ld ld1 ld2 ld3 ld.new - - -lintlog:$(SOURCES) Makefile - $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \ -| grep -v "pointer casts may be troublesome" \ -| grep -v "possible pointer alignment problem" \ -| grep -v "ignore" \ -| grep -v "conversion from long may lose accuracy" \ -| grep -v "warning: constant argument to NOT" \ -| grep -v "enumeration type clash, operator CAST" \ -| grep -v "warning: constant in conditional context"\ -| grep -v "archive\.c" - - -tags TAGS:$(SOURCES) $(HEADERS) - etags -t $(SOURCES) $(HEADERS) - -release: - (cd /4/steve/ld; tar cf - $(LDSOURCES) $(HEADERS) $(MANSOURCES)) | tar xf - - -objdump:objdump.c - -install: $(PROGS) - rm -f $G960BASE/bin/$(PROGS) - cp $(PROGS) $$G960BASE/bin/gld960c - -#----------------------------------------------------------------------------- -# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT -# -# 'VERSION' file must be present and contain a string of the form "x.y" -#----------------------------------------------------------------------------- - -ver960.c: FORCE - rm -f ver960.c - echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c - - -# This target should be invoked before building a new release. -# 'VERSION' file must be present and contain a string of the form "x.y" -# -roll: - @V=`cat VERSION` ; \ - MAJ=`sed 's/\..*//' VERSION` ; \ - MIN=`sed 's/.*\.//' VERSION` ; \ - V=$$MAJ.`expr $$MIN + 1` ; \ - rm -f VERSION ; \ - echo $$V >VERSION ; \ - echo Version $$V - -# Dummy target to force execution of dependent targets. -# -.force: -FORCE: - -# Target to uncomment host-specific lines in this makefile. Such lines must -# have the following string beginning in column 1: #____# -# Original Makefile is backed up as 'Makefile.old'. -# -# Invoke with: make make HOST=xxx -# -make: - -@if test $(HOST)x = x ; then \ - echo 'Specify "make make HOST=???"'; \ - exit 1; \ - fi ; \ - grep -s "^#The next line was generated by 'make make'" Makefile; \ - if test $$? = 0 ; then \ - echo "Makefile has already been processed with 'make make'";\ - exit 1; \ - fi ; \ - mv -f Makefile Makefile.old; \ - echo "#The next line was generated by 'make make'" >Makefile ; \ - echo "HOST=$(HOST)" >>Makefile ; \ - echo >>Makefile ; \ - sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile - -# - -Makefile: ../common/Makefile - mv Makefile Makefile.backup - cp ../common/Makefile . - $(MAKE) "HOST=$(HOST)" make - -### Local Variables: *** -### mode:fundamental *** -### page-delimiter: "^# " *** -### End: *** -### end of file diff --git a/ld/PORTING b/ld/PORTING deleted file mode 100644 index 8f4125c975..0000000000 --- a/ld/PORTING +++ /dev/null @@ -1,152 +0,0 @@ - Preliminary Notes on Porting GNU ld - ----------------------------------- - -Before porting ld itself, you will need to port the BFD library; -see ../bfd/PORTING. - -The 'host' is the system a tool runs *on*. -The 'target' is the system a tool runs *for*, i.e. -a tool can read/write the binaries of the target. -Most often, host==target, but ld supports cross-linking -(and to some extent the same ld binary can be used a linker -for multiple target rachitectures). - -Porting to a new host ---------------------- -Pick a name for your host. Call that . -You need to create the file config/mh-. - -Porting to a new target ------------------------ -Pick a name for your target. Call that . -You need to create at least config/mt-. -It should contain - EMUL= -An controls the "personality" of ld, -such as the default linker script. Usually, the - will have teh same name as the , -and you will need to create a new (see below). - -You will also need to edit Makefile.in and possible configure.in. -To see how to do that, search for existing examples (e.g. sun3, -sun4, hp300bsd). - -Porting to a new emulation target ---------------------------------- -Pick a name for your target. Call that . -Usually, and are the same. -You need to create at least .sh. -You will also need to edit Makefile.in, -To see how to do that, search for existing examples. - -The file .sh defines a set of parameter that -are used to generate the emulation. Its syntax is that -of a (Bourne) shell script, and it is "sourced" by genscripts.sh. - -Writing ----------------------- - -Usually, .sh contains: - EMULATION_NAME= - SCRIPT_NAME=