summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <>2004-02-29 23:00:22 +0000
committernobody <>2004-02-29 23:00:22 +0000
commita0f62e83fcd50712af16ddb555dac32ccf45fb23 (patch)
tree168849cc2def1bd412ea5e67f421e4da6977a6b2
parent0f42e75a11cf8bfa4741b4ca2358f568f658005a (diff)
downloadbinutils-gdb-gdb_6_1-2004-03-01-gmt-branchpoint.tar.gz
This commit was manufactured by cvs2svn to create branch 'gdb_6_1-branch'.gdb_6_1-2004-03-01-gmt-branchpoint
Sprout from drow_intercu-20040221-branch 2004-02-21 19:11:39 UTC nobody 'This commit was manufactured by cvs2svn to create branch' Cherrypick from master 2004-02-29 23:00:21 UTC Alan Modra <amodra@gmail.com> 'daily update': ChangeLog Makefile.in Makefile.tpl bfd/ChangeLog bfd/elf-bfd.h bfd/elf-eh-frame.c bfd/elf32-frv.c bfd/elf32-s390.c bfd/elf64-s390.c bfd/elflink.c bfd/elflink.h bfd/elfxx-ia64.c bfd/elfxx-target.h bfd/libaout.h bfd/netbsd-core.c bfd/version.h cpu/ChangeLog cpu/m32r.cpu cpu/m32r.opc gdb/ChangeLog gdb/MAINTAINERS gdb/Makefile.in gdb/NEWS gdb/PROBLEMS gdb/README gdb/amd64-linux-nat.c gdb/amd64-linux-tdep.c gdb/amd64-linux-tdep.h gdb/amd64-nat.c gdb/amd64-tdep.c gdb/amd64-tdep.h gdb/amd64bsd-nat.c gdb/amd64fbsd-nat.c gdb/amd64fbsd-tdep.c gdb/amd64nbsd-nat.c gdb/amd64nbsd-tdep.c gdb/amd64obsd-nat.c gdb/amd64obsd-tdep.c gdb/auxv.c gdb/breakpoint.c gdb/charset.c gdb/cli/cli-cmds.c gdb/cli/cli-dump.c gdb/cli/cli-script.c gdb/cli/cli-setshow.c gdb/coffread.c gdb/completer.c gdb/config/djgpp/fnchange.lst gdb/config/i386/fbsd.mh gdb/config/i386/fbsd.mt gdb/config/i386/fbsd64.mh gdb/config/i386/fbsd64.mt gdb/config/i386/linux64.mh gdb/config/i386/linux64.mt gdb/config/i386/nbsd.mt gdb/config/i386/nbsd64.mh gdb/config/i386/nbsd64.mt gdb/config/i386/nbsdaout.mh gdb/config/i386/nbsdelf.mh gdb/config/i386/nm-fbsd.h gdb/config/i386/nm-fbsd64.h gdb/config/i386/nm-linux64.h gdb/config/i386/nm-nbsd.h gdb/config/i386/nm-nbsdaout.h gdb/config/i386/nm-obsd.h gdb/config/i386/obsd.mh gdb/config/i386/obsd.mt gdb/config/i386/obsd64.mh gdb/config/i386/obsd64.mt gdb/config/i386/obsdaout.mh gdb/config/i386/tm-fbsd.h gdb/config/i386/tm-linux64.h gdb/config/i386/tm-nbsd.h gdb/config/i386/xm-i386.h gdb/config/i386/xm-nbsd.h gdb/config/pa/tm-hppa.h gdb/configure gdb/configure.host gdb/configure.in gdb/configure.tgt gdb/corelow.c gdb/cris-tdep.c gdb/defs.h gdb/doc/ChangeLog gdb/doc/annotate.texinfo gdb/doc/fdl.texi gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/doc/stabs.texinfo gdb/dwarf2-frame.h gdb/event-top.c gdb/exec.c gdb/frame-unwind.c gdb/gdbserver/ChangeLog gdb/gdbserver/linux-arm-low.c gdb/gdbserver/linux-low.c gdb/gdbserver/remote-utils.c gdb/gdbserver/server.c gdb/gdbserver/server.h gdb/gdbserver/target.h gdb/hppa-tdep.c gdb/i386-nat.c gdb/i386-tdep.h gdb/i386bsd-tdep.c gdb/i386fbsd-nat.c gdb/i386fbsd-tdep.c gdb/i386nbsd-tdep.c gdb/i386obsd-nat.c gdb/i386obsd-tdep.c gdb/i387-tdep.c gdb/i387-tdep.h gdb/ia64-linux-tdep.c gdb/ia64-tdep.c gdb/ia64-tdep.h gdb/infcall.c gdb/inflow.c gdb/printcmd.c gdb/regcache.c gdb/remote.c gdb/s390-tdep.c gdb/solib.c gdb/source.c gdb/symfile.c gdb/symmisc.c gdb/testsuite/ChangeLog gdb/testsuite/config/gdbserver.exp gdb/testsuite/configure gdb/testsuite/configure.in gdb/testsuite/gdb.arch/gdb1431.exp gdb/testsuite/gdb.arch/gdb1431.s gdb/testsuite/gdb.base/bigcore.exp gdb/testsuite/gdb.base/callfuncs.exp gdb/testsuite/gdb.base/charset.c gdb/testsuite/gdb.base/charset.exp gdb/testsuite/gdb.base/chng-syms.exp gdb/testsuite/gdb.base/corefile.exp gdb/testsuite/gdb.base/langs.exp gdb/testsuite/gdb.base/pending.exp gdb/testsuite/gdb.base/printcmds.exp gdb/testsuite/gdb.base/relocate.c gdb/testsuite/gdb.base/setvar.exp gdb/testsuite/gdb.cp/class2.cc gdb/testsuite/gdb.cp/class2.exp gdb/testsuite/gdb.cp/ctti.exp gdb/testsuite/gdb.cp/cttiadd.cc gdb/testsuite/gdb.cp/cttiadd1.cc gdb/testsuite/gdb.cp/cttiadd2.cc gdb/testsuite/gdb.cp/cttiadd3.cc gdb/testsuite/gdb.java/jmisc.exp gdb/testsuite/lib/gdb.exp gdb/thread-db.c gdb/top.c gdb/tracepoint.c gdb/tui/tui-disasm.c gdb/tui/tui-hooks.c gdb/tui/tui-regs.c gdb/tui/tui-win.c gdb/tui/tui.c gdb/utils.c gdb/valprint.c gdb/valprint.h gdb/version.in include/ChangeLog include/dyn-string.h libiberty/ChangeLog libiberty/cp-demangle.c libiberty/cp-demangle.h libiberty/dyn-string.c libiberty/testsuite/demangle-expected opcodes/ChangeLog opcodes/ppc-opc.c opcodes/sh-dis.c opcodes/sh-opc.h src-release texinfo/texinfo.tex Delete: gdb/config/i386/i386bsd.mh gdb/config/i386/i386bsd.mt gdb/config/i386/nm-i386bsd.h gdb/config/i386/nm-x86-64linux.h gdb/config/i386/tm-i386bsd.h gdb/config/i386/tm-x86-64linux.h gdb/config/i386/x86-64linux.mh gdb/config/i386/x86-64linux.mt gdb/config/i386/xm-i386bsd.h gdb/i386b-nat.c gdb/testsuite/gdb.arch/gdb1431.c gdb/x86-64-linux-nat.c gdb/x86-64-linux-tdep.c gdb/x86-64-linux-tdep.h gdb/x86-64-tdep.c gdb/x86-64-tdep.h sim/testsuite/sim/frv/rst.cgs sim/testsuite/sim/frv/rstb.cgs sim/testsuite/sim/frv/rstbf.cgs sim/testsuite/sim/frv/rstd.cgs sim/testsuite/sim/frv/rstdf.cgs sim/testsuite/sim/frv/rstf.cgs sim/testsuite/sim/frv/rsth.cgs sim/testsuite/sim/frv/rsthf.cgs sim/testsuite/sim/frv/rstq.cgs sim/testsuite/sim/frv/rstqf.cgs
-rw-r--r--ChangeLog18
-rw-r--r--Makefile.in41
-rw-r--r--Makefile.tpl19
-rw-r--r--bfd/ChangeLog100
-rw-r--r--bfd/elf-bfd.h27
-rw-r--r--bfd/elf-eh-frame.c42
-rw-r--r--bfd/elf32-frv.c312
-rw-r--r--bfd/elf32-s390.c9
-rw-r--r--bfd/elf64-s390.c9
-rw-r--r--bfd/elflink.c367
-rw-r--r--bfd/elflink.h508
-rw-r--r--bfd/elfxx-ia64.c22
-rw-r--r--bfd/elfxx-target.h12
-rw-r--r--bfd/libaout.h174
-rw-r--r--bfd/netbsd-core.c118
-rw-r--r--bfd/version.h2
-rw-r--r--cpu/ChangeLog24
-rw-r--r--cpu/m32r.cpu541
-rw-r--r--cpu/m32r.opc54
-rw-r--r--gdb/ChangeLog702
-rw-r--r--gdb/MAINTAINERS1
-rw-r--r--gdb/Makefile.in154
-rw-r--r--gdb/NEWS5
-rw-r--r--gdb/PROBLEMS2
-rw-r--r--gdb/README96
-rw-r--r--gdb/amd64-linux-nat.c (renamed from gdb/x86-64-linux-nat.c)127
-rw-r--r--gdb/amd64-linux-tdep.c (renamed from gdb/x86-64-linux-tdep.c)56
-rw-r--r--gdb/amd64-linux-tdep.h (renamed from gdb/x86-64-linux-tdep.h)15
-rw-r--r--gdb/amd64-nat.c29
-rw-r--r--gdb/amd64-tdep.c (renamed from gdb/x86-64-tdep.c)147
-rw-r--r--gdb/amd64-tdep.h (renamed from gdb/x86-64-tdep.h)61
-rw-r--r--gdb/amd64bsd-nat.c12
-rw-r--r--gdb/amd64fbsd-nat.c16
-rw-r--r--gdb/amd64fbsd-tdep.c19
-rw-r--r--gdb/amd64nbsd-nat.c2
-rw-r--r--gdb/amd64nbsd-tdep.c14
-rw-r--r--gdb/amd64obsd-nat.c2
-rw-r--r--gdb/amd64obsd-tdep.c17
-rw-r--r--gdb/auxv.c5
-rw-r--r--gdb/breakpoint.c72
-rw-r--r--gdb/charset.c6
-rw-r--r--gdb/cli/cli-cmds.c4
-rw-r--r--gdb/cli/cli-dump.c2
-rw-r--r--gdb/cli/cli-script.c23
-rw-r--r--gdb/cli/cli-setshow.c2
-rw-r--r--gdb/coffread.c8
-rw-r--r--gdb/completer.c2
-rw-r--r--gdb/config/djgpp/fnchange.lst6
-rw-r--r--gdb/config/i386/fbsd.mh10
-rw-r--r--gdb/config/i386/fbsd.mt5
-rw-r--r--gdb/config/i386/fbsd64.mh8
-rw-r--r--gdb/config/i386/fbsd64.mt5
-rw-r--r--gdb/config/i386/i386bsd.mh6
-rw-r--r--gdb/config/i386/i386bsd.mt3
-rw-r--r--gdb/config/i386/linux64.mh (renamed from gdb/config/i386/x86-64linux.mh)11
-rw-r--r--gdb/config/i386/linux64.mt5
-rw-r--r--gdb/config/i386/nbsd.mt6
-rw-r--r--gdb/config/i386/nbsd64.mh8
-rw-r--r--gdb/config/i386/nbsd64.mt4
-rw-r--r--gdb/config/i386/nbsdaout.mh8
-rw-r--r--gdb/config/i386/nbsdelf.mh4
-rw-r--r--gdb/config/i386/nm-fbsd.h23
-rw-r--r--gdb/config/i386/nm-fbsd64.h9
-rw-r--r--gdb/config/i386/nm-i386bsd.h38
-rw-r--r--gdb/config/i386/nm-linux64.h (renamed from gdb/config/i386/nm-x86-64linux.h)24
-rw-r--r--gdb/config/i386/nm-nbsd.h9
-rw-r--r--gdb/config/i386/nm-nbsdaout.h9
-rw-r--r--gdb/config/i386/nm-obsd.h8
-rw-r--r--gdb/config/i386/obsd.mh10
-rw-r--r--gdb/config/i386/obsd.mt4
-rw-r--r--gdb/config/i386/obsd64.mh8
-rw-r--r--gdb/config/i386/obsd64.mt6
-rw-r--r--gdb/config/i386/obsdaout.mh5
-rw-r--r--gdb/config/i386/tm-fbsd.h7
-rw-r--r--gdb/config/i386/tm-i386bsd.h40
-rw-r--r--gdb/config/i386/tm-linux64.h (renamed from gdb/config/i386/tm-x86-64linux.h)10
-rw-r--r--gdb/config/i386/tm-nbsd.h8
-rw-r--r--gdb/config/i386/x86-64linux.mt6
-rw-r--r--gdb/config/i386/xm-i386.h7
-rw-r--r--gdb/config/i386/xm-i386bsd.h22
-rw-r--r--gdb/config/i386/xm-nbsd.h11
-rw-r--r--gdb/config/pa/tm-hppa.h16
-rwxr-xr-xgdb/configure925
-rw-r--r--gdb/configure.host5
-rw-r--r--gdb/configure.in11
-rw-r--r--gdb/configure.tgt3
-rw-r--r--gdb/corelow.c2
-rw-r--r--gdb/cris-tdep.c1341
-rw-r--r--gdb/defs.h2
-rw-r--r--gdb/doc/ChangeLog25
-rw-r--r--gdb/doc/annotate.texinfo2
-rw-r--r--gdb/doc/fdl.texi372
-rw-r--r--gdb/doc/gdb.texinfo129
-rw-r--r--gdb/doc/gdbint.texinfo60
-rw-r--r--gdb/doc/stabs.texinfo2
-rw-r--r--gdb/dwarf2-frame.h1
-rw-r--r--gdb/event-top.c4
-rw-r--r--gdb/exec.c2
-rw-r--r--gdb/frame-unwind.c2
-rw-r--r--gdb/gdbserver/ChangeLog46
-rw-r--r--gdb/gdbserver/linux-arm-low.c6
-rw-r--r--gdb/gdbserver/linux-low.c44
-rw-r--r--gdb/gdbserver/remote-utils.c33
-rw-r--r--gdb/gdbserver/server.c31
-rw-r--r--gdb/gdbserver/server.h2
-rw-r--r--gdb/gdbserver/target.h10
-rw-r--r--gdb/hppa-tdep.c857
-rw-r--r--gdb/i386-nat.c221
-rw-r--r--gdb/i386-tdep.h14
-rw-r--r--gdb/i386b-nat.c72
-rw-r--r--gdb/i386bsd-tdep.c4
-rw-r--r--gdb/i386fbsd-nat.c7
-rw-r--r--gdb/i386fbsd-tdep.c18
-rw-r--r--gdb/i386nbsd-tdep.c10
-rw-r--r--gdb/i386obsd-nat.c7
-rw-r--r--gdb/i386obsd-tdep.c88
-rw-r--r--gdb/i387-tdep.c22
-rw-r--r--gdb/i387-tdep.h10
-rw-r--r--gdb/ia64-linux-tdep.c18
-rw-r--r--gdb/ia64-tdep.c7
-rw-r--r--gdb/ia64-tdep.h2
-rw-r--r--gdb/infcall.c27
-rw-r--r--gdb/inflow.c4
-rw-r--r--gdb/printcmd.c29
-rw-r--r--gdb/regcache.c3
-rw-r--r--gdb/remote.c173
-rw-r--r--gdb/s390-tdep.c51
-rw-r--r--gdb/solib.c2
-rw-r--r--gdb/source.c2
-rw-r--r--gdb/symfile.c2
-rw-r--r--gdb/symmisc.c2
-rw-r--r--gdb/testsuite/ChangeLog84
-rw-r--r--gdb/testsuite/config/gdbserver.exp6
-rwxr-xr-xgdb/testsuite/configure4
-rw-r--r--gdb/testsuite/configure.in2
-rwxr-xr-xgdb/testsuite/gdb.arch/gdb1431.c65
-rw-r--r--gdb/testsuite/gdb.arch/gdb1431.exp21
-rw-r--r--gdb/testsuite/gdb.arch/gdb1431.s129
-rw-r--r--gdb/testsuite/gdb.base/bigcore.exp2
-rw-r--r--gdb/testsuite/gdb.base/callfuncs.exp4
-rw-r--r--gdb/testsuite/gdb.base/charset.c112
-rw-r--r--gdb/testsuite/gdb.base/charset.exp22
-rw-r--r--gdb/testsuite/gdb.base/chng-syms.exp8
-rw-r--r--gdb/testsuite/gdb.base/corefile.exp16
-rw-r--r--gdb/testsuite/gdb.base/langs.exp2
-rw-r--r--gdb/testsuite/gdb.base/pending.exp8
-rw-r--r--gdb/testsuite/gdb.base/printcmds.exp12
-rw-r--r--gdb/testsuite/gdb.base/relocate.c2
-rw-r--r--gdb/testsuite/gdb.base/setvar.exp32
-rw-r--r--gdb/testsuite/gdb.cp/class2.cc10
-rw-r--r--gdb/testsuite/gdb.cp/class2.exp6
-rw-r--r--gdb/testsuite/gdb.cp/ctti.exp34
-rw-r--r--gdb/testsuite/gdb.cp/cttiadd.cc2
-rw-r--r--gdb/testsuite/gdb.cp/cttiadd1.cc2
-rw-r--r--gdb/testsuite/gdb.cp/cttiadd2.cc2
-rw-r--r--gdb/testsuite/gdb.cp/cttiadd3.cc2
-rw-r--r--gdb/testsuite/gdb.java/jmisc.exp4
-rw-r--r--gdb/testsuite/lib/gdb.exp2
-rw-r--r--gdb/thread-db.c21
-rw-r--r--gdb/top.c4
-rw-r--r--gdb/tracepoint.c4
-rw-r--r--gdb/tui/tui-disasm.c64
-rw-r--r--gdb/tui/tui-hooks.c2
-rw-r--r--gdb/tui/tui-regs.c32
-rw-r--r--gdb/tui/tui-win.c2
-rw-r--r--gdb/tui/tui.c31
-rw-r--r--gdb/utils.c141
-rw-r--r--gdb/valprint.c39
-rw-r--r--gdb/valprint.h6
-rw-r--r--gdb/version.in2
-rw-r--r--include/ChangeLog9
-rw-r--r--include/dyn-string.h31
-rw-r--r--libiberty/ChangeLog47
-rw-r--r--libiberty/cp-demangle.c355
-rw-r--r--libiberty/cp-demangle.h12
-rw-r--r--libiberty/dyn-string.c11
-rw-r--r--libiberty/testsuite/demangle-expected26
-rw-r--r--opcodes/ChangeLog22
-rw-r--r--opcodes/ppc-opc.c4
-rw-r--r--opcodes/sh-dis.c9
-rw-r--r--opcodes/sh-opc.h46
-rw-r--r--sim/testsuite/sim/frv/rst.cgs107
-rw-r--r--sim/testsuite/sim/frv/rstb.cgs72
-rw-r--r--sim/testsuite/sim/frv/rstbf.cgs76
-rw-r--r--sim/testsuite/sim/frv/rstd.cgs171
-rw-r--r--sim/testsuite/sim/frv/rstdf.cgs186
-rw-r--r--sim/testsuite/sim/frv/rstf.cgs112
-rw-r--r--sim/testsuite/sim/frv/rsth.cgs83
-rw-r--r--sim/testsuite/sim/frv/rsthf.cgs87
-rw-r--r--sim/testsuite/sim/frv/rstq.cgs297
-rw-r--r--sim/testsuite/sim/frv/rstqf.cgs333
-rw-r--r--src-release8
-rw-r--r--texinfo/texinfo.tex5279
193 files changed, 9551 insertions, 7856 deletions
diff --git a/ChangeLog b/ChangeLog
index 43a93909e83..de6ebae1c77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2004-02-28 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR bootstrap/7087
+ * Makefile.tpl: Guard XFOO sed statements better.
+ * Makefile.tpl: Add dependency for configure-target-libada.
+ * Makefile.in: Regenerate (incidentally fixes broken
+ commit when libada-branch was merged).
+
+2004-02-28 Andrew Cagney <cagney@redhat.com>
+
+ * src-release (CVS_NAMES): Define.
+ (do-tar, do-tar): Prune $(CVS_NAMES).
+
+2004-02-23 Andrew Cagney <cagney@redhat.com>
+
+ * texinfo/texinfo.tex: Update from version 2003-02-03.16 to
+ 2004-02-19.09.
+
2004-02-19 Nathanael Nerode <neroden@gcc.gnu.org>
PR bootstrap/11932
diff --git a/Makefile.in b/Makefile.in
index 061a76fb8d9..91c19d9ea4b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -516,15 +516,15 @@ EXTRA_GCC_FLAGS = \
'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
- "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s/.*=$$/XFOO=/`"
+ "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
@@ -23481,6 +23481,7 @@ configure-target-libada: $(TARGET_SUBDIR)/libada/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -23502,30 +23503,8 @@ configure-target-libada: $(TARGET_SUBDIR)/libada/multilib.out
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
- if [ "$(srcdir)" = "." ] ; then \
- if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/libada "no-such-file" ; then \
- if [ -f Makefile ]; then \
- if $(MAKE) distclean; then \
- true; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- else \
- exit 1; \
- fi; \
- else \
- true; \
- fi; \
- srcdiroption="--srcdir=."; \
- libsrcdir="."; \
- else \
srcdiroption="--srcdir=$${topdir}/libada"; \
libsrcdir="$$s/libada"; \
- fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
diff --git a/Makefile.tpl b/Makefile.tpl
index c82c81830a7..6a30f45941b 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -459,15 +459,15 @@ EXTRA_GCC_FLAGS = \
'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
- "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s/.*=$$/XFOO=/`"
+ "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
@@ -1354,6 +1354,7 @@ ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3
configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads
configure-target-fastjar: maybe-configure-target-zlib
all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
+configure-target-libada: $(ALL_GCC_C)
configure-target-libf2c: $(ALL_GCC_C)
all-target-libf2c: maybe-all-target-libiberty
configure-target-libffi: $(ALL_GCC_C)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4c97561dd33..d091b86f39a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,103 @@
+2004-02-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf-bfd.h (_bfd_elf_link_add_archive_symbols): New prototype.
+
+ * elflink.h (is_global_data_symbol_definition): Moved to
+ elflink.c.
+ (elf_link_is_defined_archive_symbol): Likewise.
+ (elf_link_add_archive_symbols): Likewise. Renamed to
+ _bfd_elf_link_add_archive_symbols.
+
+ * elflink.c (elf_link_is_defined_archive_symbol): Get the size
+ of ELF symbol table entry from backend.
+ (_bfd_elf_link_add_archive_symbols): Call bfd_link_add_symbols
+ instead of elf_link_add_object_symbols.
+
+2004-02-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * elf-bfd.h (struct elf_backend_data): Added
+ elf_backend_can_make_relative_eh_frame,
+ elf_backend_can_make_lsda_relative_eh_frame and
+ elf_backend_encode_eh_address.
+ (_bfd_elf_encode_eh_address): Declare.
+ (_bfd_elf_can_make_relative): Declare.
+ * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use new
+ hooks to decide whether to attempt to make_relative and
+ make_lsda_relative.
+ (_bfd_elf_write_section_eh_frame_hdr): Call encode_eh_address.
+ (_bfd_elf_can_make_relative): New.
+ (_bfd_elf_encode_eh_address): New.
+ * elf32-frv.c (frv_elf_use_relative_eh_frame): New.
+ (frv_elf_encode_eh_address): New.
+ (elf_backend_can_make_relative_eh_frame): Define.
+ (elf_backend_can_make_lsda_relative_eh_frame): Define.
+ (elf_backend_encode_eh_address): Define.
+ * elfxx-target.h
+ (elf_backend_can_make_relative_eh_frame): Define.
+ (elf_backend_can_make_lsda_relative_eh_frame): Define.
+ (elf_backend_encode_eh_address): Define.
+ (elfNN_bed): Add them.
+
+2004-02-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * elf32-frv.c (elf32_frv_howto_table) <R_FRV_LABEL16>: Set
+ complain_on_overflow to signed.
+
+2004-02-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elflink.h (sort_symbol): New.
+ (elf_link_add_object_symbols): Use a sorted symbol array for
+ weakdef.
+
+2004-02-27 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
+ for pc relative relocs.
+ (elf_s390_relocate_section): Likewise.
+ * elf64-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
+ for pc relative relocs.
+ (elf_s390_relocate_section): Likewise.
+
+2004-02-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-ia64.c (elfNN_ia64_check_relocs): Fix call to
+ count_dyn_reloc.
+
+2004-02-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext.
+ field to track if a relocation is against readonly section.
+ (count_dyn_reloc): Take a new argument for rent->reltext.
+ (elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc.
+ (get_reloc_section): Don't set ia64_info->reltext here.
+ (allocate_dynrel_entries): Set ia64_info->reltext here.
+
+2004-02-24 Alexandre Oliva <aoliva@redhat.com>
+
+ * elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local.
+ (_frv_emit_got_relocs_plt_entries): Decay relocation to protected
+ function's descriptor to symbol+offset, and map local undefweak
+ symbol to NULL function descriptor.
+ (elf32_frv_relocate_section): Likewise.
+
+2004-02-23 Mark Kettenis <kettenis@gnu.org>
+
+ * libaout.h (enum machine_type): Add M_SPARC64_NETBSD and
+ M_X86_64_NETBSD.
+ * netbsd-core.c (M_SPARC64_OPENBSD): Define.
+ (netbsd_core_file_p): Set architecture from machine ID for
+ selected machines.
+
+2004-02-23 Jakub Jelinek <jakub@redhat.com>
+
+ * elflink.h (size_dynamic_sections): If not adding DT_FLAGS and
+ DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry.
+
+2004-02-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elflink.c (_bfd_elf_merge_symbol): Properly handle undefined
+ symbols with non-default visibility.
+
2004-02-21 Danny Smith <daanysmith@users.sourceforge.net>
* peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 6bbacade36f..5f4bcd8469f 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -860,6 +860,24 @@ struct elf_backend_data
bfd_boolean (*elf_backend_ignore_discarded_relocs)
(asection *);
+ /* These functions tell elf-eh-frame whether to attempt to turn
+ absolute or lsda encodings into pc-relative ones. The default
+ definition enables these transformations. */
+ bfd_boolean (*elf_backend_can_make_relative_eh_frame)
+ (bfd *, struct bfd_link_info *, asection *);
+ bfd_boolean (*elf_backend_can_make_lsda_relative_eh_frame)
+ (bfd *, struct bfd_link_info *, asection *);
+
+ /* This function returns an encoding after computing the encoded
+ value (and storing it in ENCODED) for the given OFFSET into OSEC,
+ to be stored in at LOC_OFFSET into the LOC_SEC input section.
+ The default definition chooses a 32-bit PC-relative encoding. */
+ bfd_byte (*elf_backend_encode_eh_address)
+ (bfd *abfd, struct bfd_link_info *info,
+ asection *osec, bfd_vma offset,
+ asection *loc_sec, bfd_vma loc_offset,
+ bfd_vma *encoded);
+
/* This function, if defined, may write out the given section.
Returns TRUE if it did so and FALSE if the caller should. */
bfd_boolean (*elf_backend_write_section)
@@ -1301,6 +1319,12 @@ extern void _bfd_elf_sprintf_vma
extern void _bfd_elf_fprintf_vma
(bfd *, void *, bfd_vma);
+extern bfd_byte _bfd_elf_encode_eh_address
+ (bfd *abfd, struct bfd_link_info *info, asection *osec, bfd_vma offset,
+ asection *loc_sec, bfd_vma loc_offset, bfd_vma *encoded);
+extern bfd_boolean _bfd_elf_can_make_relative
+ (bfd *input_bfd, struct bfd_link_info *info, asection *eh_frame_section);
+
extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
(const Elf_Internal_Rela *);
extern bfd_vma _bfd_elf_rela_local_sym
@@ -1523,6 +1547,9 @@ extern bfd_boolean _bfd_elf_dynamic_symbol_p
extern bfd_boolean _bfd_elf_symbol_refs_local_p
(struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean);
+extern bfd_boolean _bfd_elf_link_add_archive_symbols
+ (bfd *, struct bfd_link_info *);
+
extern const bfd_target *bfd_elf32_object_p
(bfd *);
extern const bfd_target *bfd_elf32_core_file_p
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index 28e0b55fefd..d3777b44118 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -518,10 +518,16 @@ _bfd_elf_discard_section_eh_frame
/* For shared libraries, try to get rid of as many RELATIVE relocs
as possible. */
if (info->shared
+ && (get_elf_backend_data (abfd)
+ ->elf_backend_can_make_relative_eh_frame
+ (abfd, info, sec))
&& (cie.fde_encoding & 0xf0) == DW_EH_PE_absptr)
cie.make_relative = 1;
if (info->shared
+ && (get_elf_backend_data (abfd)
+ ->elf_backend_can_make_lsda_relative_eh_frame
+ (abfd, info, sec))
&& (cie.lsda_encoding & 0xf0) == DW_EH_PE_absptr)
cie.make_lsda_relative = 1;
@@ -1120,6 +1126,7 @@ _bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
asection *eh_frame_sec;
bfd_size_type size;
bfd_boolean retval;
+ bfd_vma encoded_eh_frame;
htab = elf_hash_table (info);
hdr_info = &htab->eh_info;
@@ -1143,7 +1150,10 @@ _bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
memset (contents, 0, EH_FRAME_HDR_SIZE);
contents[0] = 1; /* Version. */
- contents[1] = DW_EH_PE_pcrel | DW_EH_PE_sdata4; /* .eh_frame offset. */
+ contents[1] = get_elf_backend_data (abfd)->elf_backend_encode_eh_address
+ (abfd, info, eh_frame_sec, 0, sec, 4,
+ &encoded_eh_frame); /* .eh_frame offset. */
+
if (hdr_info->array && hdr_info->array_count == hdr_info->fde_count)
{
contents[2] = DW_EH_PE_udata4; /* FDE count encoding. */
@@ -1154,8 +1164,8 @@ _bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
contents[2] = DW_EH_PE_omit;
contents[3] = DW_EH_PE_omit;
}
- bfd_put_32 (abfd, eh_frame_sec->vma - sec->output_section->vma - 4,
- contents + 4);
+ bfd_put_32 (abfd, encoded_eh_frame, contents + 4);
+
if (contents[2] != DW_EH_PE_omit)
{
unsigned int i;
@@ -1181,3 +1191,29 @@ _bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
free (contents);
return retval;
}
+
+/* Decide whether we can use a PC-relative encoding within the given
+ EH frame section. This is the default implementation. */
+
+bfd_boolean
+_bfd_elf_can_make_relative (bfd *input_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *eh_frame_section ATTRIBUTE_UNUSED)
+{
+ return TRUE;
+}
+
+/* Select an encoding for the given address. Preference is given to
+ PC-relative addressing modes. */
+
+bfd_byte
+_bfd_elf_encode_eh_address (bfd *abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *osec, bfd_vma offset,
+ asection *loc_sec, bfd_vma loc_offset,
+ bfd_vma *encoded)
+{
+ *encoded = osec->vma + offset -
+ (loc_sec->output_section->vma + loc_sec->output_offset + loc_offset);
+ return DW_EH_PE_pcrel | DW_EH_PE_sdata4;
+}
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 488438e59bc..a813ddcd8cc 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/frv.h"
+#include "elf/dwarf2.h"
#include "hashtab.h"
/* Forward declarations. */
@@ -117,7 +118,7 @@ static reloc_howto_type elf32_frv_howto_table [] =
16, /* bitsize */
TRUE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_LABEL16", /* name */
FALSE, /* partial_inplace */
@@ -659,7 +660,6 @@ frv_elf_link_hash_table_create (bfd *abfd)
#define FRV_SYM_LOCAL(INFO, H) \
(_bfd_elf_symbol_refs_local_p ((H), (INFO), 1) \
|| ! elf_hash_table (INFO)->dynamic_sections_created \
- || (H)->root.type == bfd_link_hash_undefweak \
|| (/* The condition below is an ugly hack to get .scommon data to
be regarded as local. For some reason the
ELF_LINK_HASH_DEF_REGULAR bit is not set on such common
@@ -1029,47 +1029,61 @@ _frv_emit_got_relocs_plt_entries (struct frv_pic_relocs_info *entry,
if (entry->fdgot_entry)
{
int reloc, idx;
- bfd_vma ad;
+ bfd_vma ad = 0;
- /* If the symbol is dynamic and there may be dynamic symbol
- resolution because we are or are linked with a shared
- library, emit a FUNCDESC relocation such that the dynamic
- linker will allocate the function descriptor. */
- if (entry->symndx == -1 && ! FRV_FUNCDESC_LOCAL (info, entry->d.h))
- {
- reloc = R_FRV_FUNCDESC;
- idx = dynindx;
- ad = addend;
- if (ad)
- return FALSE;
- }
- else
+ if (! (entry->symndx == -1
+ && entry->d.h->root.type == bfd_link_hash_undefweak
+ && FRV_SYM_LOCAL (info, entry->d.h)))
{
- /* Otherwise, we know we have a private function descriptor,
- so reference it directly. */
- if (elf_hash_table (info)->dynamic_sections_created)
- BFD_ASSERT (entry->privfd);
- reloc = R_FRV_32;
- idx = elf_section_data (frv_got_section (info)->output_section)
- ->dynindx;
- ad = frv_got_section (info)->output_offset +
- frv_got_initial_offset (info) + entry->fd_entry;
- }
-
- /* If there is room for dynamic symbol resolution, emit the
- dynamic relocation. However, if we're linking an executable
- at a fixed location, we won't have emitted a dynamic symbol
- entry for the got section, so idx will be zero, which means
- we can and should compute the address of the private
- descriptor ourselves. */
- if (info->executable && !info->pie
- && (entry->symndx != -1 || FRV_FUNCDESC_LOCAL (info, entry->d.h)))
- {
- if (entry->symndx == -1
- && entry->d.h->root.type == bfd_link_hash_undefweak)
- ad = 0;
+ /* If the symbol is dynamic and there may be dynamic symbol
+ resolution because we are, or are linked with, a shared
+ library, emit a FUNCDESC relocation such that the dynamic
+ linker will allocate the function descriptor. If the
+ symbol needs a non-local function descriptor but binds
+ locally (e.g., its visibility is protected, emit a
+ dynamic relocation decayed to section+offset. */
+ if (entry->symndx == -1 && ! FRV_FUNCDESC_LOCAL (info, entry->d.h)
+ && FRV_SYM_LOCAL (info, entry->d.h)
+ && !(info->executable && !info->pie))
+ {
+ reloc = R_FRV_FUNCDESC;
+ idx = elf_section_data (entry->d.h->root.u.def.section
+ ->output_section)->dynindx;
+ ad = entry->d.h->root.u.def.section->output_offset
+ + entry->d.h->root.u.def.value;
+ }
+ else if (entry->symndx == -1
+ && ! FRV_FUNCDESC_LOCAL (info, entry->d.h))
+ {
+ reloc = R_FRV_FUNCDESC;
+ idx = dynindx;
+ ad = addend;
+ if (ad)
+ return FALSE;
+ }
else
{
+ /* Otherwise, we know we have a private function descriptor,
+ so reference it directly. */
+ if (elf_hash_table (info)->dynamic_sections_created)
+ BFD_ASSERT (entry->privfd);
+ reloc = R_FRV_32;
+ idx = elf_section_data (frv_got_section (info)
+ ->output_section)->dynindx;
+ ad = frv_got_section (info)->output_offset
+ + frv_got_initial_offset (info) + entry->fd_entry;
+ }
+
+ /* If there is room for dynamic symbol resolution, emit the
+ dynamic relocation. However, if we're linking an
+ executable at a fixed location, we won't have emitted a
+ dynamic symbol entry for the got section, so idx will be
+ zero, which means we can and should compute the address
+ of the private descriptor ourselves. */
+ if (info->executable && !info->pie
+ && (entry->symndx != -1
+ || FRV_FUNCDESC_LOCAL (info, entry->d.h)))
+ {
ad += frv_got_section (info)->output_section->vma;
_frv_add_rofixup (output_bfd, frv_gotfixup_section (info),
frv_got_section (info)->output_section->vma
@@ -1077,17 +1091,17 @@ _frv_emit_got_relocs_plt_entries (struct frv_pic_relocs_info *entry,
+ frv_got_initial_offset (info)
+ entry->fdgot_entry);
}
+ else
+ _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ frv_got_section (info),
+ frv_got_initial_offset (info)
+ + entry->fdgot_entry)
+ + frv_got_section (info)->output_section->vma
+ + frv_got_section (info)->output_offset,
+ reloc, idx, ad);
}
- else
- _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
- _bfd_elf_section_offset
- (output_bfd, info,
- frv_got_section (info),
- frv_got_initial_offset (info)
- + entry->fdgot_entry)
- + frv_got_section (info)->output_section->vma
- + frv_got_section (info)->output_offset,
- reloc, idx, ad);
bfd_put_32 (output_bfd, ad,
frv_got_section (info)->contents
@@ -2005,88 +2019,103 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
int dynindx;
bfd_vma addend = rel->r_addend;
- /* If the symbol is dynamic and there may be dynamic
- symbol resolution because we are or are linked with a
- shared library, emit a FUNCDESC relocation such that
- the dynamic linker will allocate the function
- descriptor. */
- if (h && ! FRV_FUNCDESC_LOCAL (info, h))
+ if (! (h && h->root.type == bfd_link_hash_undefweak
+ && FRV_SYM_LOCAL (info, h)))
{
- if (addend)
+ /* If the symbol is dynamic and there may be dynamic
+ symbol resolution because we are or are linked with a
+ shared library, emit a FUNCDESC relocation such that
+ the dynamic linker will allocate the function
+ descriptor. If the symbol needs a non-local function
+ descriptor but binds locally (e.g., its visibility is
+ protected, emit a dynamic relocation decayed to
+ section+offset. */
+ if (h && ! FRV_FUNCDESC_LOCAL (info, h)
+ && FRV_SYM_LOCAL (info, h)
+ && !(info->executable && !info->pie))
{
- info->callbacks->warning
- (info, _("R_FRV_FUNCDESC references dynamic symbol with nonzero addend"),
- name, input_bfd, input_section, rel->r_offset);
- return FALSE;
+ dynindx = elf_section_data (h->root.u.def.section
+ ->output_section)->dynindx;
+ addend += h->root.u.def.section->output_offset
+ + h->root.u.def.value;
+ }
+ else if (h && ! FRV_FUNCDESC_LOCAL (info, h))
+ {
+ if (addend)
+ {
+ info->callbacks->warning
+ (info, _("R_FRV_FUNCDESC references dynamic symbol with nonzero addend"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ dynindx = h->dynindx;
+ }
+ else
+ {
+ /* Otherwise, we know we have a private function
+ descriptor, so reference it directly. */
+ BFD_ASSERT (picrel->privfd);
+ r_type = R_FRV_32;
+ dynindx = elf_section_data (frv_got_section (info)
+ ->output_section)->dynindx;
+ addend = frv_got_section (info)->output_offset
+ + frv_got_initial_offset (info)
+ + picrel->fd_entry;
}
- dynindx = h->dynindx;
- }
- else
- {
- /* Otherwise, we know we have a private function
- descriptor, so reference it directly. */
- BFD_ASSERT (picrel->privfd);
- r_type = R_FRV_32;
- dynindx = elf_section_data (frv_got_section
- (info)->output_section)->dynindx;
- addend = frv_got_section (info)->output_offset
- + frv_got_initial_offset (info)
- + picrel->fd_entry;
- }
- /* If there is room for dynamic symbol resolution, emit
- the dynamic relocation. However, if we're linking an
- executable at a fixed location, we won't have emitted a
- dynamic symbol entry for the got section, so idx will
- be zero, which means we can and should compute the
- address of the private descriptor ourselves. */
- if (info->executable && !info->pie
- && (!h || FRV_FUNCDESC_LOCAL (info, h)))
- {
- addend += frv_got_section (info)->output_section->vma;
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
- & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+ /* If there is room for dynamic symbol resolution, emit
+ the dynamic relocation. However, if we're linking an
+ executable at a fixed location, we won't have emitted a
+ dynamic symbol entry for the got section, so idx will
+ be zero, which means we can and should compute the
+ address of the private descriptor ourselves. */
+ if (info->executable && !info->pie
+ && (!h || FRV_FUNCDESC_LOCAL (info, h)))
+ {
+ addend += frv_got_section (info)->output_section->vma;
+ if ((bfd_get_section_flags (output_bfd,
+ input_section->output_section)
+ & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+ {
+ if (_frv_osec_readonly_p (output_bfd,
+ input_section->output_section))
+ {
+ info->callbacks->warning
+ (info,
+ _("cannot emit fixups in read-only section"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ _frv_add_rofixup (output_bfd,
+ frv_gotfixup_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ input_section, rel->r_offset)
+ + input_section->output_section->vma
+ + input_section->output_offset);
+ }
+ }
+ else if ((bfd_get_section_flags (output_bfd,
+ input_section->output_section)
+ & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_frv_osec_readonly_p (output_bfd,
input_section->output_section))
{
info->callbacks->warning
(info,
- _("cannot emit fixups in read-only section"),
+ _("cannot emit dynamic relocations in read-only section"),
name, input_bfd, input_section, rel->r_offset);
return FALSE;
}
- if (! h || h->root.type != bfd_link_hash_undefweak)
- _frv_add_rofixup (output_bfd,
- frv_gotfixup_section (info),
+ _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
_bfd_elf_section_offset
(output_bfd, info,
input_section, rel->r_offset)
+ input_section->output_section->vma
- + input_section->output_offset);
- }
- }
- else if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
- & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
- {
- if (_frv_osec_readonly_p (output_bfd,
- input_section->output_section))
- {
- info->callbacks->warning
- (info,
- _("cannot emit dynamic relocations in read-only section"),
- name, input_bfd, input_section, rel->r_offset);
- return FALSE;
+ + input_section->output_offset,
+ r_type, dynindx, addend);
}
- _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
- _bfd_elf_section_offset
- (output_bfd, info,
- input_section, rel->r_offset)
- + input_section->output_section->vma
- + input_section->output_offset,
- r_type, dynindx, addend);
}
/* We want the addend in-place because dynamic
@@ -3672,6 +3701,57 @@ elf32_frv_finish_dynamic_symbol (bfd *output_bfd ATTRIBUTE_UNUSED,
return TRUE;
}
+/* Decide whether to attempt to turn absptr or lsda encodings in
+ shared libraries into pcrel within the given input section. */
+
+static bfd_boolean
+frv_elf_use_relative_eh_frame (bfd *input_bfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *eh_frame_section ATTRIBUTE_UNUSED)
+{
+ /* We can't use PC-relative encodings in FDPIC binaries, in general. */
+ if (elf_elfheader (input_bfd)->e_flags & EF_FRV_FDPIC)
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Adjust the contents of an eh_frame_hdr section before they're output. */
+
+static bfd_byte
+frv_elf_encode_eh_address (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *osec, bfd_vma offset,
+ asection *loc_sec, bfd_vma loc_offset,
+ bfd_vma *encoded)
+{
+ struct elf_link_hash_entry *h;
+
+ /* Non-FDPIC binaries can use PC-relative encodings. */
+ if (! (elf_elfheader (abfd)->e_flags & EF_FRV_FDPIC))
+ return _bfd_elf_encode_eh_address (abfd, info, osec, offset,
+ loc_sec, loc_offset, encoded);
+
+ h = elf_hash_table (info)->hgot;
+ BFD_ASSERT (h && h->root.type == bfd_link_hash_defined);
+
+ if (! h || (_frv_osec_to_segment (abfd, osec)
+ == _frv_osec_to_segment (abfd, loc_sec->output_section)))
+ return _bfd_elf_encode_eh_address (abfd, info, osec, offset,
+ loc_sec, loc_offset, encoded);
+
+ BFD_ASSERT (_frv_osec_to_segment (abfd, osec)
+ == _frv_osec_to_segment (abfd,
+ h->root.u.def.section->output_section));
+
+ *encoded = osec->vma + offset
+ - (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+
+ return DW_EH_PE_datarel | DW_EH_PE_sdata4;
+}
+
/* Look through the relocs for a section during the first phase.
Besides handling virtual table relocs for gc, we have to deal with
@@ -4391,6 +4471,12 @@ frv_elf_print_private_bfd_data (abfd, ptr)
#define elf_backend_want_plt_sym 0
#define elf_backend_plt_header_size 0
+#define elf_backend_can_make_relative_eh_frame \
+ frv_elf_use_relative_eh_frame
+#define elf_backend_can_make_lsda_relative_eh_frame \
+ frv_elf_use_relative_eh_frame
+#define elf_backend_encode_eh_address frv_elf_encode_eh_address
+
#define elf_backend_may_use_rel_p 1
#define elf_backend_may_use_rela_p 1
/* We use REL for dynamic relocations only. */
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 07ba23cc32a..53b3fe4db94 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -1884,9 +1884,7 @@ allocate_dynrelocs (h, inf)
if (info->shared)
{
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
- || info->symbolic))
+ if (SYMBOL_REFERENCES_LOCAL (info, h))
{
struct elf_s390_dyn_relocs **pp;
@@ -2562,10 +2560,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
&& r_type != R_390_PC32DBL
&& r_type != R_390_PC32)
|| (h != NULL
- && h->dynindx != -1
- && (! info->symbolic
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ && !SYMBOL_REFERENCES_LOCAL (info, h))))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& h != NULL
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 2260248fe36..8a919c454fe 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -1855,9 +1855,7 @@ allocate_dynrelocs (h, inf)
if (info->shared)
{
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
- || info->symbolic))
+ if (SYMBOL_REFERENCES_LOCAL (info, h))
{
struct elf_s390_dyn_relocs **pp;
@@ -2540,10 +2538,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
&& r_type != R_390_PC32DBL
&& r_type != R_390_PC64)
|| (h != NULL
- && h->dynindx != -1
- && (! info->symbolic
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ && !SYMBOL_REFERENCES_LOCAL (info, h))))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& h != NULL
diff --git a/bfd/elflink.c b/bfd/elflink.c
index f58a67aade2..b992c39cb18 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -843,8 +843,26 @@ _bfd_elf_merge_symbol (bfd *abfd,
object, we remove the old definition. */
if ((*sym_hash)->root.type == bfd_link_hash_indirect)
h = *sym_hash;
- h->root.type = bfd_link_hash_new;
- h->root.u.undef.abfd = NULL;
+
+ if ((h->root.und_next || info->hash->undefs_tail == &h->root)
+ && bfd_is_und_section (sec))
+ {
+ /* If the new symbol is undefined and the old symbol was
+ also undefined before, we need to make sure
+ _bfd_generic_link_add_one_symbol doesn't mess
+ up the linker hash table undefs list. Since the old
+ definition came from a dynamic object, it is still on the
+ undefs list. */
+ h->root.type = bfd_link_hash_undefined;
+ /* FIXME: What if the new symbol is weak undefined? */
+ h->root.u.undef.abfd = abfd;
+ }
+ else
+ {
+ h->root.type = bfd_link_hash_new;
+ h->root.u.undef.abfd = NULL;
+ }
+
if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
{
h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
@@ -2546,3 +2564,348 @@ _bfd_elf_tls_setup (bfd *obfd, struct bfd_link_info *info)
return tls;
}
+
+/* Return TRUE iff this is a non-common, definition of a non-function symbol. */
+static bfd_boolean
+is_global_data_symbol_definition (bfd *abfd ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym)
+{
+ /* Local symbols do not count, but target specific ones might. */
+ if (ELF_ST_BIND (sym->st_info) != STB_GLOBAL
+ && ELF_ST_BIND (sym->st_info) < STB_LOOS)
+ return FALSE;
+
+ /* Function symbols do not count. */
+ if (ELF_ST_TYPE (sym->st_info) == STT_FUNC)
+ return FALSE;
+
+ /* If the section is undefined, then so is the symbol. */
+ if (sym->st_shndx == SHN_UNDEF)
+ return FALSE;
+
+ /* If the symbol is defined in the common section, then
+ it is a common definition and so does not count. */
+ if (sym->st_shndx == SHN_COMMON)
+ return FALSE;
+
+ /* If the symbol is in a target specific section then we
+ must rely upon the backend to tell us what it is. */
+ if (sym->st_shndx >= SHN_LORESERVE && sym->st_shndx < SHN_ABS)
+ /* FIXME - this function is not coded yet:
+
+ return _bfd_is_global_symbol_definition (abfd, sym);
+
+ Instead for now assume that the definition is not global,
+ Even if this is wrong, at least the linker will behave
+ in the same way that it used to do. */
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Search the symbol table of the archive element of the archive ABFD
+ whose archive map contains a mention of SYMDEF, and determine if
+ the symbol is defined in this element. */
+static bfd_boolean
+elf_link_is_defined_archive_symbol (bfd * abfd, carsym * symdef)
+{
+ Elf_Internal_Shdr * hdr;
+ bfd_size_type symcount;
+ bfd_size_type extsymcount;
+ bfd_size_type extsymoff;
+ Elf_Internal_Sym *isymbuf;
+ Elf_Internal_Sym *isym;
+ Elf_Internal_Sym *isymend;
+ bfd_boolean result;
+
+ abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset);
+ if (abfd == NULL)
+ return FALSE;
+
+ if (! bfd_check_format (abfd, bfd_object))
+ return FALSE;
+
+ /* If we have already included the element containing this symbol in the
+ link then we do not need to include it again. Just claim that any symbol
+ it contains is not a definition, so that our caller will not decide to
+ (re)include this element. */
+ if (abfd->archive_pass)
+ return FALSE;
+
+ /* Select the appropriate symbol table. */
+ if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0)
+ hdr = &elf_tdata (abfd)->symtab_hdr;
+ else
+ hdr = &elf_tdata (abfd)->dynsymtab_hdr;
+
+ symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym;
+
+ /* The sh_info field of the symtab header tells us where the
+ external symbols start. We don't care about the local symbols. */
+ if (elf_bad_symtab (abfd))
+ {
+ extsymcount = symcount;
+ extsymoff = 0;
+ }
+ else
+ {
+ extsymcount = symcount - hdr->sh_info;
+ extsymoff = hdr->sh_info;
+ }
+
+ if (extsymcount == 0)
+ return FALSE;
+
+ /* Read in the symbol table. */
+ isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff,
+ NULL, NULL, NULL);
+ if (isymbuf == NULL)
+ return FALSE;
+
+ /* Scan the symbol table looking for SYMDEF. */
+ result = FALSE;
+ for (isym = isymbuf, isymend = isymbuf + extsymcount; isym < isymend; isym++)
+ {
+ const char *name;
+
+ name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link,
+ isym->st_name);
+ if (name == NULL)
+ break;
+
+ if (strcmp (name, symdef->name) == 0)
+ {
+ result = is_global_data_symbol_definition (abfd, isym);
+ break;
+ }
+ }
+
+ free (isymbuf);
+
+ return result;
+}
+
+/* Add symbols from an ELF archive file to the linker hash table. We
+ don't use _bfd_generic_link_add_archive_symbols because of a
+ problem which arises on UnixWare. The UnixWare libc.so is an
+ archive which includes an entry libc.so.1 which defines a bunch of
+ symbols. The libc.so archive also includes a number of other
+ object files, which also define symbols, some of which are the same
+ as those defined in libc.so.1. Correct linking requires that we
+ consider each object file in turn, and include it if it defines any
+ symbols we need. _bfd_generic_link_add_archive_symbols does not do
+ this; it looks through the list of undefined symbols, and includes
+ any object file which defines them. When this algorithm is used on
+ UnixWare, it winds up pulling in libc.so.1 early and defining a
+ bunch of symbols. This means that some of the other objects in the
+ archive are not included in the link, which is incorrect since they
+ precede libc.so.1 in the archive.
+
+ Fortunately, ELF archive handling is simpler than that done by
+ _bfd_generic_link_add_archive_symbols, which has to allow for a.out
+ oddities. In ELF, if we find a symbol in the archive map, and the
+ symbol is currently undefined, we know that we must pull in that
+ object file.
+
+ Unfortunately, we do have to make multiple passes over the symbol
+ table until nothing further is resolved. */
+
+bfd_boolean
+_bfd_elf_link_add_archive_symbols (bfd *abfd,
+ struct bfd_link_info *info)
+{
+ symindex c;
+ bfd_boolean *defined = NULL;
+ bfd_boolean *included = NULL;
+ carsym *symdefs;
+ bfd_boolean loop;
+ bfd_size_type amt;
+
+ if (! bfd_has_map (abfd))
+ {
+ /* An empty archive is a special case. */
+ if (bfd_openr_next_archived_file (abfd, NULL) == NULL)
+ return TRUE;
+ bfd_set_error (bfd_error_no_armap);
+ return FALSE;
+ }
+
+ /* Keep track of all symbols we know to be already defined, and all
+ files we know to be already included. This is to speed up the
+ second and subsequent passes. */
+ c = bfd_ardata (abfd)->symdef_count;
+ if (c == 0)
+ return TRUE;
+ amt = c;
+ amt *= sizeof (bfd_boolean);
+ defined = bfd_zmalloc (amt);
+ included = bfd_zmalloc (amt);
+ if (defined == NULL || included == NULL)
+ goto error_return;
+
+ symdefs = bfd_ardata (abfd)->symdefs;
+
+ do
+ {
+ file_ptr last;
+ symindex i;
+ carsym *symdef;
+ carsym *symdefend;
+
+ loop = FALSE;
+ last = -1;
+
+ symdef = symdefs;
+ symdefend = symdef + c;
+ for (i = 0; symdef < symdefend; symdef++, i++)
+ {
+ struct elf_link_hash_entry *h;
+ bfd *element;
+ struct bfd_link_hash_entry *undefs_tail;
+ symindex mark;
+
+ if (defined[i] || included[i])
+ continue;
+ if (symdef->file_offset == last)
+ {
+ included[i] = TRUE;
+ continue;
+ }
+
+ h = elf_link_hash_lookup (elf_hash_table (info), symdef->name,
+ FALSE, FALSE, FALSE);
+
+ if (h == NULL)
+ {
+ char *p, *copy;
+ size_t len, first;
+
+ /* If this is a default version (the name contains @@),
+ look up the symbol again with only one `@' as well
+ as without the version. The effect is that references
+ to the symbol with and without the version will be
+ matched by the default symbol in the archive. */
+
+ p = strchr (symdef->name, ELF_VER_CHR);
+ if (p == NULL || p[1] != ELF_VER_CHR)
+ continue;
+
+ /* First check with only one `@'. */
+ len = strlen (symdef->name);
+ copy = bfd_alloc (abfd, len);
+ if (copy == NULL)
+ goto error_return;
+ first = p - symdef->name + 1;
+ memcpy (copy, symdef->name, first);
+ memcpy (copy + first, symdef->name + first + 1, len - first);
+
+ h = elf_link_hash_lookup (elf_hash_table (info), copy,
+ FALSE, FALSE, FALSE);
+
+ if (h == NULL)
+ {
+ /* We also need to check references to the symbol
+ without the version. */
+
+ copy[first - 1] = '\0';
+ h = elf_link_hash_lookup (elf_hash_table (info),
+ copy, FALSE, FALSE, FALSE);
+ }
+
+ bfd_release (abfd, copy);
+ }
+
+ if (h == NULL)
+ continue;
+
+ if (h->root.type == bfd_link_hash_common)
+ {
+ /* We currently have a common symbol. The archive map contains
+ a reference to this symbol, so we may want to include it. We
+ only want to include it however, if this archive element
+ contains a definition of the symbol, not just another common
+ declaration of it.
+
+ Unfortunately some archivers (including GNU ar) will put
+ declarations of common symbols into their archive maps, as
+ well as real definitions, so we cannot just go by the archive
+ map alone. Instead we must read in the element's symbol
+ table and check that to see what kind of symbol definition
+ this is. */
+ if (! elf_link_is_defined_archive_symbol (abfd, symdef))
+ continue;
+ }
+ else if (h->root.type != bfd_link_hash_undefined)
+ {
+ if (h->root.type != bfd_link_hash_undefweak)
+ defined[i] = TRUE;
+ continue;
+ }
+
+ /* We need to include this archive member. */
+ element = _bfd_get_elt_at_filepos (abfd, symdef->file_offset);
+ if (element == NULL)
+ goto error_return;
+
+ if (! bfd_check_format (element, bfd_object))
+ goto error_return;
+
+ /* Doublecheck that we have not included this object
+ already--it should be impossible, but there may be
+ something wrong with the archive. */
+ if (element->archive_pass != 0)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ goto error_return;
+ }
+ element->archive_pass = 1;
+
+ undefs_tail = info->hash->undefs_tail;
+
+ if (! (*info->callbacks->add_archive_element) (info, element,
+ symdef->name))
+ goto error_return;
+ if (! bfd_link_add_symbols (element, info))
+ goto error_return;
+
+ /* If there are any new undefined symbols, we need to make
+ another pass through the archive in order to see whether
+ they can be defined. FIXME: This isn't perfect, because
+ common symbols wind up on undefs_tail and because an
+ undefined symbol which is defined later on in this pass
+ does not require another pass. This isn't a bug, but it
+ does make the code less efficient than it could be. */
+ if (undefs_tail != info->hash->undefs_tail)
+ loop = TRUE;
+
+ /* Look backward to mark all symbols from this object file
+ which we have already seen in this pass. */
+ mark = i;
+ do
+ {
+ included[mark] = TRUE;
+ if (mark == 0)
+ break;
+ --mark;
+ }
+ while (symdefs[mark].file_offset == symdef->file_offset);
+
+ /* We mark subsequent symbols from this object file as we go
+ on through the loop. */
+ last = symdef->file_offset;
+ }
+ }
+ while (loop);
+
+ free (defined);
+ free (included);
+
+ return TRUE;
+
+ error_return:
+ if (defined != NULL)
+ free (defined);
+ if (included != NULL)
+ free (included);
+ return FALSE;
+}
diff --git a/bfd/elflink.h b/bfd/elflink.h
index c37d7398d01..05f7c682b2f 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -23,8 +23,6 @@
#include "safe-ctype.h"
static bfd_boolean elf_link_add_object_symbols (bfd *, struct bfd_link_info *);
-static bfd_boolean elf_link_add_archive_symbols (bfd *,
- struct bfd_link_info *);
static bfd_boolean elf_finalize_dynstr (bfd *, struct bfd_link_info *);
static bfd_boolean elf_collect_hash_codes (struct elf_link_hash_entry *,
void *);
@@ -41,355 +39,33 @@ elf_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
case bfd_object:
return elf_link_add_object_symbols (abfd, info);
case bfd_archive:
- return elf_link_add_archive_symbols (abfd, info);
+ return _bfd_elf_link_add_archive_symbols (abfd, info);
default:
bfd_set_error (bfd_error_wrong_format);
return FALSE;
}
}
-/* Return TRUE iff this is a non-common, definition of a non-function symbol. */
-static bfd_boolean
-is_global_data_symbol_definition (bfd *abfd ATTRIBUTE_UNUSED,
- Elf_Internal_Sym *sym)
-{
- /* Local symbols do not count, but target specific ones might. */
- if (ELF_ST_BIND (sym->st_info) != STB_GLOBAL
- && ELF_ST_BIND (sym->st_info) < STB_LOOS)
- return FALSE;
-
- /* Function symbols do not count. */
- if (ELF_ST_TYPE (sym->st_info) == STT_FUNC)
- return FALSE;
-
- /* If the section is undefined, then so is the symbol. */
- if (sym->st_shndx == SHN_UNDEF)
- return FALSE;
-
- /* If the symbol is defined in the common section, then
- it is a common definition and so does not count. */
- if (sym->st_shndx == SHN_COMMON)
- return FALSE;
-
- /* If the symbol is in a target specific section then we
- must rely upon the backend to tell us what it is. */
- if (sym->st_shndx >= SHN_LORESERVE && sym->st_shndx < SHN_ABS)
- /* FIXME - this function is not coded yet:
-
- return _bfd_is_global_symbol_definition (abfd, sym);
-
- Instead for now assume that the definition is not global,
- Even if this is wrong, at least the linker will behave
- in the same way that it used to do. */
- return FALSE;
-
- return TRUE;
-}
-
-/* Search the symbol table of the archive element of the archive ABFD
- whose archive map contains a mention of SYMDEF, and determine if
- the symbol is defined in this element. */
-static bfd_boolean
-elf_link_is_defined_archive_symbol (bfd * abfd, carsym * symdef)
+/* Sort symbol by value and section. */
+static int
+sort_symbol (const void *arg1, const void *arg2)
{
- Elf_Internal_Shdr * hdr;
- bfd_size_type symcount;
- bfd_size_type extsymcount;
- bfd_size_type extsymoff;
- Elf_Internal_Sym *isymbuf;
- Elf_Internal_Sym *isym;
- Elf_Internal_Sym *isymend;
- bfd_boolean result;
-
- abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset);
- if (abfd == NULL)
- return FALSE;
-
- if (! bfd_check_format (abfd, bfd_object))
- return FALSE;
-
- /* If we have already included the element containing this symbol in the
- link then we do not need to include it again. Just claim that any symbol
- it contains is not a definition, so that our caller will not decide to
- (re)include this element. */
- if (abfd->archive_pass)
- return FALSE;
-
- /* Select the appropriate symbol table. */
- if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0)
- hdr = &elf_tdata (abfd)->symtab_hdr;
- else
- hdr = &elf_tdata (abfd)->dynsymtab_hdr;
-
- symcount = hdr->sh_size / sizeof (Elf_External_Sym);
-
- /* The sh_info field of the symtab header tells us where the
- external symbols start. We don't care about the local symbols. */
- if (elf_bad_symtab (abfd))
- {
- extsymcount = symcount;
- extsymoff = 0;
- }
+ const struct elf_link_hash_entry *h1
+ = *(const struct elf_link_hash_entry **) arg1;
+ const struct elf_link_hash_entry *h2
+ = *(const struct elf_link_hash_entry **) arg2;
+ bfd_signed_vma vdiff = h1->root.u.def.value - h2->root.u.def.value;
+
+ if (vdiff)
+ return vdiff > 0 ? 1 : -1;
else
{
- extsymcount = symcount - hdr->sh_info;
- extsymoff = hdr->sh_info;
- }
-
- if (extsymcount == 0)
- return FALSE;
-
- /* Read in the symbol table. */
- isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff,
- NULL, NULL, NULL);
- if (isymbuf == NULL)
- return FALSE;
-
- /* Scan the symbol table looking for SYMDEF. */
- result = FALSE;
- for (isym = isymbuf, isymend = isymbuf + extsymcount; isym < isymend; isym++)
- {
- const char *name;
-
- name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link,
- isym->st_name);
- if (name == NULL)
- break;
-
- if (strcmp (name, symdef->name) == 0)
- {
- result = is_global_data_symbol_definition (abfd, isym);
- break;
- }
- }
-
- free (isymbuf);
-
- return result;
-}
-
-/* Add symbols from an ELF archive file to the linker hash table. We
- don't use _bfd_generic_link_add_archive_symbols because of a
- problem which arises on UnixWare. The UnixWare libc.so is an
- archive which includes an entry libc.so.1 which defines a bunch of
- symbols. The libc.so archive also includes a number of other
- object files, which also define symbols, some of which are the same
- as those defined in libc.so.1. Correct linking requires that we
- consider each object file in turn, and include it if it defines any
- symbols we need. _bfd_generic_link_add_archive_symbols does not do
- this; it looks through the list of undefined symbols, and includes
- any object file which defines them. When this algorithm is used on
- UnixWare, it winds up pulling in libc.so.1 early and defining a
- bunch of symbols. This means that some of the other objects in the
- archive are not included in the link, which is incorrect since they
- precede libc.so.1 in the archive.
-
- Fortunately, ELF archive handling is simpler than that done by
- _bfd_generic_link_add_archive_symbols, which has to allow for a.out
- oddities. In ELF, if we find a symbol in the archive map, and the
- symbol is currently undefined, we know that we must pull in that
- object file.
-
- Unfortunately, we do have to make multiple passes over the symbol
- table until nothing further is resolved. */
-
-static bfd_boolean
-elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
-{
- symindex c;
- bfd_boolean *defined = NULL;
- bfd_boolean *included = NULL;
- carsym *symdefs;
- bfd_boolean loop;
- bfd_size_type amt;
-
- if (! bfd_has_map (abfd))
- {
- /* An empty archive is a special case. */
- if (bfd_openr_next_archived_file (abfd, NULL) == NULL)
- return TRUE;
- bfd_set_error (bfd_error_no_armap);
- return FALSE;
- }
-
- /* Keep track of all symbols we know to be already defined, and all
- files we know to be already included. This is to speed up the
- second and subsequent passes. */
- c = bfd_ardata (abfd)->symdef_count;
- if (c == 0)
- return TRUE;
- amt = c;
- amt *= sizeof (bfd_boolean);
- defined = bfd_zmalloc (amt);
- included = bfd_zmalloc (amt);
- if (defined == NULL || included == NULL)
- goto error_return;
-
- symdefs = bfd_ardata (abfd)->symdefs;
-
- do
- {
- file_ptr last;
- symindex i;
- carsym *symdef;
- carsym *symdefend;
-
- loop = FALSE;
- last = -1;
-
- symdef = symdefs;
- symdefend = symdef + c;
- for (i = 0; symdef < symdefend; symdef++, i++)
- {
- struct elf_link_hash_entry *h;
- bfd *element;
- struct bfd_link_hash_entry *undefs_tail;
- symindex mark;
-
- if (defined[i] || included[i])
- continue;
- if (symdef->file_offset == last)
- {
- included[i] = TRUE;
- continue;
- }
-
- h = elf_link_hash_lookup (elf_hash_table (info), symdef->name,
- FALSE, FALSE, FALSE);
-
- if (h == NULL)
- {
- char *p, *copy;
- size_t len, first;
-
- /* If this is a default version (the name contains @@),
- look up the symbol again with only one `@' as well
- as without the version. The effect is that references
- to the symbol with and without the version will be
- matched by the default symbol in the archive. */
-
- p = strchr (symdef->name, ELF_VER_CHR);
- if (p == NULL || p[1] != ELF_VER_CHR)
- continue;
-
- /* First check with only one `@'. */
- len = strlen (symdef->name);
- copy = bfd_alloc (abfd, len);
- if (copy == NULL)
- goto error_return;
- first = p - symdef->name + 1;
- memcpy (copy, symdef->name, first);
- memcpy (copy + first, symdef->name + first + 1, len - first);
-
- h = elf_link_hash_lookup (elf_hash_table (info), copy,
- FALSE, FALSE, FALSE);
-
- if (h == NULL)
- {
- /* We also need to check references to the symbol
- without the version. */
-
- copy[first - 1] = '\0';
- h = elf_link_hash_lookup (elf_hash_table (info),
- copy, FALSE, FALSE, FALSE);
- }
-
- bfd_release (abfd, copy);
- }
-
- if (h == NULL)
- continue;
-
- if (h->root.type == bfd_link_hash_common)
- {
- /* We currently have a common symbol. The archive map contains
- a reference to this symbol, so we may want to include it. We
- only want to include it however, if this archive element
- contains a definition of the symbol, not just another common
- declaration of it.
-
- Unfortunately some archivers (including GNU ar) will put
- declarations of common symbols into their archive maps, as
- well as real definitions, so we cannot just go by the archive
- map alone. Instead we must read in the element's symbol
- table and check that to see what kind of symbol definition
- this is. */
- if (! elf_link_is_defined_archive_symbol (abfd, symdef))
- continue;
- }
- else if (h->root.type != bfd_link_hash_undefined)
- {
- if (h->root.type != bfd_link_hash_undefweak)
- defined[i] = TRUE;
- continue;
- }
-
- /* We need to include this archive member. */
- element = _bfd_get_elt_at_filepos (abfd, symdef->file_offset);
- if (element == NULL)
- goto error_return;
-
- if (! bfd_check_format (element, bfd_object))
- goto error_return;
-
- /* Doublecheck that we have not included this object
- already--it should be impossible, but there may be
- something wrong with the archive. */
- if (element->archive_pass != 0)
- {
- bfd_set_error (bfd_error_bad_value);
- goto error_return;
- }
- element->archive_pass = 1;
-
- undefs_tail = info->hash->undefs_tail;
-
- if (! (*info->callbacks->add_archive_element) (info, element,
- symdef->name))
- goto error_return;
- if (! elf_link_add_object_symbols (element, info))
- goto error_return;
-
- /* If there are any new undefined symbols, we need to make
- another pass through the archive in order to see whether
- they can be defined. FIXME: This isn't perfect, because
- common symbols wind up on undefs_tail and because an
- undefined symbol which is defined later on in this pass
- does not require another pass. This isn't a bug, but it
- does make the code less efficient than it could be. */
- if (undefs_tail != info->hash->undefs_tail)
- loop = TRUE;
-
- /* Look backward to mark all symbols from this object file
- which we have already seen in this pass. */
- mark = i;
- do
- {
- included[mark] = TRUE;
- if (mark == 0)
- break;
- --mark;
- }
- while (symdefs[mark].file_offset == symdef->file_offset);
-
- /* We mark subsequent symbols from this object file as we go
- on through the loop. */
- last = symdef->file_offset;
- }
+ long sdiff = h1->root.u.def.section - h2->root.u.def.section;
+ if (sdiff)
+ return sdiff > 0 ? 1 : -1;
+ else
+ return 0;
}
- while (loop);
-
- free (defined);
- free (included);
-
- return TRUE;
-
- error_return:
- if (defined != NULL)
- free (defined);
- if (included != NULL)
- free (included);
- return FALSE;
}
/* Add symbols from an ELF object file to the linker hash table. */
@@ -1493,63 +1169,132 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
assembler code, handling it correctly would be very time
consuming, and other ELF linkers don't handle general aliasing
either. */
- while (weaks != NULL)
+ if (weaks != NULL)
{
- struct elf_link_hash_entry *hlook;
- asection *slook;
- bfd_vma vlook;
struct elf_link_hash_entry **hpp;
struct elf_link_hash_entry **hppend;
+ struct elf_link_hash_entry **sorted_sym_hash;
+ struct elf_link_hash_entry *h;
+ size_t sym_count;
- hlook = weaks;
- weaks = hlook->weakdef;
- hlook->weakdef = NULL;
-
- BFD_ASSERT (hlook->root.type == bfd_link_hash_defined
- || hlook->root.type == bfd_link_hash_defweak
- || hlook->root.type == bfd_link_hash_common
- || hlook->root.type == bfd_link_hash_indirect);
- slook = hlook->root.u.def.section;
- vlook = hlook->root.u.def.value;
-
+ /* Since we have to search the whole symbol list for each weak
+ defined symbol, search time for N weak defined symbols will be
+ O(N^2). Binary search will cut it down to O(NlogN). */
+ amt = extsymcount * sizeof (struct elf_link_hash_entry *);
+ sorted_sym_hash = bfd_malloc (amt);
+ if (sorted_sym_hash == NULL)
+ goto error_return;
+ sym_hash = sorted_sym_hash;
hpp = elf_sym_hashes (abfd);
hppend = hpp + extsymcount;
+ sym_count = 0;
for (; hpp < hppend; hpp++)
{
- struct elf_link_hash_entry *h;
-
h = *hpp;
- if (h != NULL && h != hlook
+ if (h != NULL
&& h->root.type == bfd_link_hash_defined
- && h->root.u.def.section == slook
- && h->root.u.def.value == vlook)
+ && h->type != STT_FUNC)
{
- hlook->weakdef = h;
+ *sym_hash = h;
+ sym_hash++;
+ sym_count++;
+ }
+ }
+
+ qsort (sorted_sym_hash, sym_count,
+ sizeof (struct elf_link_hash_entry *),
+ sort_symbol);
- /* If the weak definition is in the list of dynamic
- symbols, make sure the real definition is put there
- as well. */
- if (hlook->dynindx != -1
- && h->dynindx == -1)
+ while (weaks != NULL)
+ {
+ struct elf_link_hash_entry *hlook;
+ asection *slook;
+ bfd_vma vlook;
+ long ilook;
+ size_t i, j, idx;
+
+ hlook = weaks;
+ weaks = hlook->weakdef;
+ hlook->weakdef = NULL;
+
+ BFD_ASSERT (hlook->root.type == bfd_link_hash_defined
+ || hlook->root.type == bfd_link_hash_defweak
+ || hlook->root.type == bfd_link_hash_common
+ || hlook->root.type == bfd_link_hash_indirect);
+ slook = hlook->root.u.def.section;
+ vlook = hlook->root.u.def.value;
+
+ ilook = -1;
+ i = 0;
+ j = sym_count;
+ while (i < j)
+ {
+ bfd_signed_vma vdiff;
+ idx = (i + j) / 2;
+ h = sorted_sym_hash [idx];
+ vdiff = vlook - h->root.u.def.value;
+ if (vdiff < 0)
+ j = idx;
+ else if (vdiff > 0)
+ i = idx + 1;
+ else
{
- if (! _bfd_elf_link_record_dynamic_symbol (info, h))
- goto error_return;
+ long sdiff = slook - h->root.u.def.section;
+ if (sdiff < 0)
+ j = idx;
+ else if (sdiff > 0)
+ i = idx + 1;
+ else
+ {
+ ilook = idx;
+ break;
+ }
}
+ }
+
+ /* We didn't find a value/section match. */
+ if (ilook == -1)
+ continue;
- /* If the real definition is in the list of dynamic
- symbols, make sure the weak definition is put there
- as well. If we don't do this, then the dynamic
- loader might not merge the entries for the real
- definition and the weak definition. */
- if (h->dynindx != -1
- && hlook->dynindx == -1)
+ for (i = ilook; i < sym_count; i++)
+ {
+ h = sorted_sym_hash [i];
+
+ /* Stop if value or section doesn't match. */
+ if (h->root.u.def.value != vlook
+ || h->root.u.def.section != slook)
+ break;
+ else if (h != hlook)
{
- if (! _bfd_elf_link_record_dynamic_symbol (info, hlook))
- goto error_return;
+ hlook->weakdef = h;
+
+ /* If the weak definition is in the list of dynamic
+ symbols, make sure the real definition is put
+ there as well. */
+ if (hlook->dynindx != -1 && h->dynindx == -1)
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (info,
+ h))
+ goto error_return;
+ }
+
+ /* If the real definition is in the list of dynamic
+ symbols, make sure the weak definition is put
+ there as well. If we don't do this, then the
+ dynamic loader might not merge the entries for the
+ real definition and the weak definition. */
+ if (h->dynindx != -1 && hlook->dynindx == -1)
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (info,
+ hlook))
+ goto error_return;
+ }
+ break;
}
- break;
}
}
+
+ free (sorted_sym_hash);
}
/* If this object is the same format as the output object, and it is
@@ -2434,6 +2179,11 @@ NAME(bfd_elf,size_dynamic_sections) (bfd *output_bfd,
if (! elf_add_dynamic_entry (info, DT_FLAGS, info->flags))
return FALSE;
}
+ else if (info->flags & DF_BIND_NOW)
+ {
+ if (! elf_add_dynamic_entry (info, DT_BIND_NOW, 0))
+ return FALSE;
+ }
if (info->flags_1)
{
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index e223a10e09b..878511bb828 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -92,6 +92,9 @@ struct elfNN_ia64_dyn_sym_info
asection *srel;
int type;
int count;
+
+ /* Is this reloc against readonly section? */
+ bfd_boolean reltext;
} *reloc_entries;
/* TRUE when the section contents have been updated. */
@@ -243,9 +246,6 @@ static asection *get_pltoff
static asection *get_reloc_section
PARAMS ((bfd *abfd, struct elfNN_ia64_link_hash_table *ia64_info,
asection *sec, bfd_boolean create));
-static bfd_boolean count_dyn_reloc
- PARAMS ((bfd *abfd, struct elfNN_ia64_dyn_sym_info *dyn_i,
- asection *srel, int type));
static bfd_boolean elfNN_ia64_check_relocs
PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec,
const Elf_Internal_Rela *relocs));
@@ -2175,18 +2175,12 @@ get_reloc_section (abfd, ia64_info, sec, create)
return NULL;
}
- if (sec->flags & SEC_READONLY)
- ia64_info->reltext = 1;
-
return srel;
}
static bfd_boolean
-count_dyn_reloc (abfd, dyn_i, srel, type)
- bfd *abfd;
- struct elfNN_ia64_dyn_sym_info *dyn_i;
- asection *srel;
- int type;
+count_dyn_reloc (bfd *abfd, struct elfNN_ia64_dyn_sym_info *dyn_i,
+ asection *srel, int type, bfd_boolean reltext)
{
struct elfNN_ia64_dyn_reloc_entry *rent;
@@ -2207,6 +2201,7 @@ count_dyn_reloc (abfd, dyn_i, srel, type)
rent->count = 0;
dyn_i->reloc_entries = rent;
}
+ rent->reltext = reltext;
rent->count++;
return TRUE;
@@ -2491,7 +2486,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
if (!srel)
return FALSE;
}
- if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type))
+ if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type,
+ (sec->flags & SEC_READONLY) != 0))
return FALSE;
}
}
@@ -2798,6 +2794,8 @@ allocate_dynrel_entries (dyn_i, data)
default:
abort ();
}
+ if (rent->reltext)
+ ia64_info->reltext = 1;
rent->srel->_raw_size += sizeof (ElfNN_External_Rela) * count;
}
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index ca0e47b32e7..5bf8f4d31d6 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -391,6 +391,15 @@
#ifndef elf_backend_ignore_discarded_relocs
#define elf_backend_ignore_discarded_relocs NULL
#endif
+#ifndef elf_backend_can_make_relative_eh_frame
+#define elf_backend_can_make_relative_eh_frame _bfd_elf_can_make_relative
+#endif
+#ifndef elf_backend_can_make_lsda_relative_eh_frame
+#define elf_backend_can_make_lsda_relative_eh_frame _bfd_elf_can_make_relative
+#endif
+#ifndef elf_backend_encode_eh_address
+#define elf_backend_encode_eh_address _bfd_elf_encode_eh_address
+#endif
#ifndef elf_backend_write_section
#define elf_backend_write_section NULL
#endif
@@ -497,6 +506,9 @@ static const struct elf_backend_data elfNN_bed =
elf_backend_reloc_type_class,
elf_backend_discard_info,
elf_backend_ignore_discarded_relocs,
+ elf_backend_can_make_relative_eh_frame,
+ elf_backend_can_make_lsda_relative_eh_frame,
+ elf_backend_encode_eh_address,
elf_backend_write_section,
elf_backend_mips_irix_compat,
elf_backend_mips_rtype_to_howto,
diff --git a/bfd/libaout.h b/bfd/libaout.h
index 2b93dbf2886..960f9d0f285 100644
--- a/bfd/libaout.h
+++ b/bfd/libaout.h
@@ -1,6 +1,6 @@
/* BFD back-end data structures for a.out (and similar) files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003
+ 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -249,73 +249,74 @@ struct aout_backend_data
struct internal_exec
{
- long a_info; /* Magic number and flags, packed */
- bfd_vma a_text; /* length of text, in bytes */
- bfd_vma a_data; /* length of data, in bytes */
- bfd_vma a_bss; /* length of uninitialized data area in mem */
- bfd_vma a_syms; /* length of symbol table data in file */
- bfd_vma a_entry; /* start address */
- bfd_vma a_trsize; /* length of text's relocation info, in bytes */
- bfd_vma a_drsize; /* length of data's relocation info, in bytes */
- /* Added for i960 */
- bfd_vma a_tload; /* Text runtime load address */
- bfd_vma a_dload; /* Data runtime load address */
- unsigned char a_talign; /* Alignment of text segment */
- unsigned char a_dalign; /* Alignment of data segment */
- unsigned char a_balign; /* Alignment of bss segment */
- char a_relaxable; /* Enough info for linker relax */
+ long a_info; /* Magic number and flags, packed. */
+ bfd_vma a_text; /* Length of text, in bytes. */
+ bfd_vma a_data; /* Length of data, in bytes. */
+ bfd_vma a_bss; /* Length of uninitialized data area in mem. */
+ bfd_vma a_syms; /* Length of symbol table data in file. */
+ bfd_vma a_entry; /* Start address. */
+ bfd_vma a_trsize; /* Length of text's relocation info, in bytes. */
+ bfd_vma a_drsize; /* Length of data's relocation info, in bytes. */
+ /* Added for i960 */
+ bfd_vma a_tload; /* Text runtime load address. */
+ bfd_vma a_dload; /* Data runtime load address. */
+ unsigned char a_talign; /* Alignment of text segment. */
+ unsigned char a_dalign; /* Alignment of data segment. */
+ unsigned char a_balign; /* Alignment of bss segment. */
+ char a_relaxable; /* Enough info for linker relax. */
};
/* Magic number is written
-< MSB >
-3130292827262524232221201918171615141312111009080706050403020100
-< FLAGS >< MACHINE TYPE >< MAGIC NUMBER >
-*/
+ < MSB >
+ 3130292827262524232221201918171615141312111009080706050403020100
+ < FLAGS >< MACHINE TYPE >< MAGIC NUMBER > */
+
/* Magic number for NetBSD is
-<MSB >
-3130292827262524232221201918171615141312111009080706050403020100
-< FLAGS >< MACHINE TYPE >< MAGIC NUMBER >
-*/
+ <MSB >
+ 3130292827262524232221201918171615141312111009080706050403020100
+ < FLAGS >< MACHINE TYPE >< MAGIC NUMBER > */
-enum machine_type {
+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. */
/* Make these up for the ns32k. */
- M_NS32032 = (64), /* ns32032 running ? */
- M_NS32532 = (64 + 5), /* ns32532 running mach */
-
+ M_NS32032 = (64), /* NS32032 running ? */
+ M_NS32532 = (64 + 5), /* NS32532 running mach. */
M_386 = 100,
- M_29K = 101, /* AMD 29000 */
- M_386_DYNIX = 102, /* Sequent running dynix */
- M_ARM = 103, /* Advanced Risc Machines ARM */
- M_SPARCLET = 131, /* SPARClet = M_SPARC + 128 */
- M_386_NETBSD = 134, /* NetBSD/i386 binary */
- M_68K_NETBSD = 135, /* NetBSD/m68k binary */
- M_68K4K_NETBSD = 136, /* NetBSD/m68k4k binary */
- M_532_NETBSD = 137, /* NetBSD/ns32k binary */
- M_SPARC_NETBSD = 138, /* NetBSD/sparc binary */
- M_PMAX_NETBSD = 139, /* NetBSD/pmax (MIPS little-endian) binary */
- M_VAX_NETBSD = 140, /* NetBSD/vax binary */
- M_ALPHA_NETBSD = 141, /* NetBSD/alpha binary */
- M_ARM6_NETBSD = 143, /* NetBSD/arm32 binary */
- M_SPARCLET_1 = 147, /* 0x93, reserved */
- M_VAX4K_NETBSD = 150, /* NetBSD/vax 4K pages binary */
- M_MIPS1 = 151, /* MIPS R2000/R3000 binary */
- M_MIPS2 = 152, /* MIPS R4000/R6000 binary */
- M_SPARCLET_2 = 163, /* 0xa3, reserved */
- M_SPARCLET_3 = 179, /* 0xb3, reserved */
- M_SPARCLET_4 = 195, /* 0xc3, reserved */
- M_HP200 = 200, /* HP 200 (68010) BSD binary */
- M_HP300 = (300 % 256), /* HP 300 (68020+68881) BSD binary */
- M_HPUX = (0x20c % 256), /* HP 200/300 HPUX binary */
- M_SPARCLET_5 = 211, /* 0xd3, reserved */
- M_SPARCLET_6 = 227, /* 0xe3, reserved */
- /* M_SPARCLET_7 = 243 / * 0xf3, reserved */
+ M_29K = 101, /* AMD 29000. */
+ M_386_DYNIX = 102, /* Sequent running dynix. */
+ M_ARM = 103, /* Advanced Risc Machines ARM. */
+ M_SPARCLET = 131, /* SPARClet = M_SPARC + 128. */
+ M_386_NETBSD = 134, /* NetBSD/i386 binary. */
+ M_68K_NETBSD = 135, /* NetBSD/m68k binary. */
+ M_68K4K_NETBSD = 136, /* NetBSD/m68k4k binary. */
+ M_532_NETBSD = 137, /* NetBSD/ns32k binary. */
+ M_SPARC_NETBSD = 138, /* NetBSD/sparc binary. */
+ M_PMAX_NETBSD = 139, /* NetBSD/pmax (MIPS little-endian) binary. */
+ M_VAX_NETBSD = 140, /* NetBSD/vax binary. */
+ M_ALPHA_NETBSD = 141, /* NetBSD/alpha binary. */
+ M_ARM6_NETBSD = 143, /* NetBSD/arm32 binary. */
+ M_SPARCLET_1 = 147, /* 0x93, reserved. */
+ M_VAX4K_NETBSD = 150, /* NetBSD/vax 4K pages binary. */
+ M_MIPS1 = 151, /* MIPS R2000/R3000 binary. */
+ M_MIPS2 = 152, /* MIPS R4000/R6000 binary. */
+ M_SPARC64_NETBSD = 156, /* NetBSD/sparc64 binary. */
+ M_X86_64_NETBSD = 157, /* NetBSD/amd64 binary. */
+ M_SPARCLET_2 = 163, /* 0xa3, reserved. */
+ M_SPARCLET_3 = 179, /* 0xb3, reserved. */
+ M_SPARCLET_4 = 195, /* 0xc3, reserved. */
+ M_HP200 = 200, /* HP 200 (68010) BSD binary. */
+ M_HP300 = (300 % 256), /* HP 300 (68020+68881) BSD binary. */
+ M_HPUX = (0x20c % 256), /* HP 200/300 HPUX binary. */
+ M_SPARCLET_5 = 211, /* 0xd3, reserved. */
+ M_SPARCLET_6 = 227, /* 0xe3, reserved. */
+/*M_SPARCLET_7 = 243 / * 0xf3, reserved. */
M_SPARCLITE_LE = 243,
- M_CRIS = 255 /* Axis CRIS binary. */
+ M_CRIS = 255 /* Axis CRIS binary. */
};
#define N_DYNAMIC(exec) ((exec).a_info & 0x80000000)
@@ -362,7 +363,8 @@ enum machine_type {
((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
#endif
-typedef struct aout_symbol {
+typedef struct aout_symbol
+{
asymbol symbol;
short desc;
char other;
@@ -373,9 +375,10 @@ typedef struct aout_symbol {
Various things depend on this struct being around any time an a.out
file is being handled. An example is dbxread.c in GDB. */
-struct aoutdata {
- struct internal_exec *hdr; /* exec file header */
- aout_symbol_type *symbols; /* symtab for input bfd */
+struct aoutdata
+{
+ struct internal_exec *hdr; /* Exec file header. */
+ aout_symbol_type *symbols; /* Symtab for input bfd. */
/* For ease, we do this. */
asection *textsec;
@@ -445,30 +448,31 @@ struct aoutdata {
bfd_vma *local_got_offsets;
};
-struct aout_data_struct {
- struct aoutdata a;
- struct internal_exec e;
+struct aout_data_struct
+{
+ struct aoutdata a;
+ struct internal_exec e;
};
-#define adata(bfd) ((bfd)->tdata.aout_data->a)
-#define exec_hdr(bfd) (adata(bfd).hdr)
-#define obj_aout_symbols(bfd) (adata(bfd).symbols)
-#define obj_textsec(bfd) (adata(bfd).textsec)
-#define obj_datasec(bfd) (adata(bfd).datasec)
-#define obj_bsssec(bfd) (adata(bfd).bsssec)
-#define obj_sym_filepos(bfd) (adata(bfd).sym_filepos)
-#define obj_str_filepos(bfd) (adata(bfd).str_filepos)
-#define obj_reloc_entry_size(bfd) (adata(bfd).reloc_entry_size)
-#define obj_symbol_entry_size(bfd) (adata(bfd).symbol_entry_size)
-#define obj_aout_subformat(bfd) (adata(bfd).subformat)
-#define obj_aout_external_syms(bfd) (adata(bfd).external_syms)
-#define obj_aout_external_sym_count(bfd) (adata(bfd).external_sym_count)
-#define obj_aout_sym_window(bfd) (adata(bfd).sym_window)
-#define obj_aout_external_strings(bfd) (adata(bfd).external_strings)
-#define obj_aout_external_string_size(bfd) (adata(bfd).external_string_size)
-#define obj_aout_string_window(bfd) (adata(bfd).string_window)
-#define obj_aout_sym_hashes(bfd) (adata(bfd).sym_hashes)
-#define obj_aout_dynamic_info(bfd) (adata(bfd).dynamic_info)
+#define adata(bfd) ((bfd)->tdata.aout_data->a)
+#define exec_hdr(bfd) (adata (bfd).hdr)
+#define obj_aout_symbols(bfd) (adata (bfd).symbols)
+#define obj_textsec(bfd) (adata (bfd).textsec)
+#define obj_datasec(bfd) (adata (bfd).datasec)
+#define obj_bsssec(bfd) (adata (bfd).bsssec)
+#define obj_sym_filepos(bfd) (adata (bfd).sym_filepos)
+#define obj_str_filepos(bfd) (adata (bfd).str_filepos)
+#define obj_reloc_entry_size(bfd) (adata (bfd).reloc_entry_size)
+#define obj_symbol_entry_size(bfd) (adata (bfd).symbol_entry_size)
+#define obj_aout_subformat(bfd) (adata (bfd).subformat)
+#define obj_aout_external_syms(bfd) (adata (bfd).external_syms)
+#define obj_aout_external_sym_count(bfd) (adata (bfd).external_sym_count)
+#define obj_aout_sym_window(bfd) (adata (bfd).sym_window)
+#define obj_aout_external_strings(bfd) (adata (bfd).external_strings)
+#define obj_aout_external_string_size(bfd) (adata (bfd).external_string_size)
+#define obj_aout_string_window(bfd) (adata (bfd).string_window)
+#define obj_aout_sym_hashes(bfd) (adata (bfd).sym_hashes)
+#define obj_aout_dynamic_info(bfd) (adata (bfd).dynamic_info)
/* We take the address of the first element of an asymbol to ensure that the
macro is only ever applied to an asymbol. */
@@ -630,7 +634,7 @@ extern bfd_boolean NAME(aout,bfd_free_cached_info)
#ifndef WRITE_HEADERS
#define WRITE_HEADERS(abfd, execp) \
{ \
- bfd_size_type text_size; /* dummy vars */ \
+ bfd_size_type text_size; /* Dummy vars. */ \
file_ptr text_end; \
if (adata(abfd).magic == undecided_magic) \
NAME(aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end); \
@@ -645,7 +649,7 @@ extern bfd_boolean NAME(aout,bfd_free_cached_info)
NAME(aout,swap_exec_header_out) (abfd, execp, &exec_bytes); \
\
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \
- || bfd_bwrite ((PTR) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \
+ || bfd_bwrite ((PTR) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE,\
abfd) != EXEC_BYTES_SIZE) \
return FALSE; \
/* Now write out reloc info, followed by syms and strings. */ \
@@ -660,12 +664,12 @@ extern bfd_boolean NAME(aout,bfd_free_cached_info)
return FALSE; \
} \
\
- if (bfd_seek (abfd, (file_ptr) (N_TRELOFF(*execp)), SEEK_SET) != 0) \
+ if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0) \
return FALSE; \
if (!NAME(aout,squirt_out_relocs) (abfd, obj_textsec (abfd))) \
return FALSE; \
\
- if (bfd_seek (abfd, (file_ptr) (N_DRELOFF(*execp)), SEEK_SET) != 0) \
+ if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0) \
return FALSE; \
if (!NAME(aout,squirt_out_relocs) (abfd, obj_datasec (abfd))) \
return FALSE; \
diff --git a/bfd/netbsd-core.c b/bfd/netbsd-core.c
index 7498990a4ef..adadead8d10 100644
--- a/bfd/netbsd-core.c
+++ b/bfd/netbsd-core.c
@@ -1,44 +1,47 @@
/* BFD back end for NetBSD style core files
Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001,
- 2002
+ 2002, 2004
Free Software Foundation, Inc.
Written by Paul Kranenburg, EUR
-This file is part of BFD, the Binary File Descriptor library.
+ 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 free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
-#include "libaout.h" /* BFD a.out internal data structures */
+#include "libaout.h" /* BFD a.out internal data structures. */
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
#include <sys/core.h>
-/*
- * FIXME: On NetBSD/sparc CORE_FPU_OFFSET should be (sizeof (struct trapframe))
- */
+/* The machine ID for OpenBSD/sparc64 and older versions of
+ NetBSD/sparc64 overlaps with M_MIPS1. */
+#define M_SPARC64_OPENBSD M_MIPS1
-struct netbsd_core_struct {
- struct core core;
+/* FIXME: On NetBSD/sparc CORE_FPU_OFFSET should be (sizeof (struct trapframe)). */
+
+struct netbsd_core_struct
+{
+ struct core core;
} *rawptr;
-/* forward declarations */
+/* Forward declarations. */
static const bfd_target *netbsd_core_file_p
PARAMS ((bfd *abfd));
@@ -68,7 +71,7 @@ netbsd_core_file_p (abfd)
val = bfd_bread ((void *) &core, amt, abfd);
if (val != sizeof core)
{
- /* Too small to be a core file */
+ /* Too small to be a core file. */
bfd_set_error (bfd_error_wrong_format);
return 0;
}
@@ -160,6 +163,27 @@ netbsd_core_file_p (abfd)
#endif
}
+ /* Set architecture from machine ID. */
+ switch (CORE_GETMID (core))
+ {
+ case M_X86_64_NETBSD:
+ bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x86_64);
+ break;
+
+ case M_386_NETBSD:
+ bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_i386_i386);
+ break;
+
+ case M_SPARC_NETBSD:
+ bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc);
+ break;
+
+ case M_SPARC64_NETBSD:
+ case M_SPARC64_OPENBSD:
+ bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc_v9);
+ break;
+ }
+
/* OK, we believe you. You're a core file (sure, sure). */
return abfd->xvec;
@@ -191,15 +215,19 @@ netbsd_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd ATTRIBUTE_UNUSED;
bfd *exec_bfd ATTRIBUTE_UNUSED;
{
- return TRUE; /* FIXME, We have no way of telling at this point */
+ /* FIXME, We have no way of telling at this point. */
+ return TRUE;
}
/* If somebody calls any byte-swapping routines, shoot them. */
+
static void
swap_abort ()
{
- abort (); /* This way doesn't require any declaration for ANSI to fuck up */
+ /* This way doesn't require any declaration for ANSI to fuck up. */
+ abort ();
}
+
#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
#define NO_SIGNED_GET \
@@ -209,33 +237,33 @@ const bfd_target netbsd_core_vec =
{
"netbsd-core",
bfd_target_unknown_flavour,
- BFD_ENDIAN_UNKNOWN, /* target byte order */
- BFD_ENDIAN_UNKNOWN, /* target headers byte order */
- (HAS_RELOC | EXEC_P | /* object flags */
+ BFD_ENDIAN_UNKNOWN, /* Target byte order. */
+ BFD_ENDIAN_UNKNOWN, /* Target headers byte order. */
+ (HAS_RELOC | EXEC_P | /* Object flags. */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
- (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
- 0, /* symbol prefix */
- ' ', /* ar_pad_char */
- 16, /* ar_max_namelen */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */
-
- { /* bfd_check_format */
- _bfd_dummy_target, /* unknown format */
- _bfd_dummy_target, /* object file */
- _bfd_dummy_target, /* archive */
- netbsd_core_file_p /* a core file */
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
+ 0, /* Symbol prefix. */
+ ' ', /* ar_pad_char. */
+ 16, /* ar_max_namelen. */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data. */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data. */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data. */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs. */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs. */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs. */
+
+ { /* bfd_check_format. */
+ _bfd_dummy_target, /* Unknown format. */
+ _bfd_dummy_target, /* Object file. */
+ _bfd_dummy_target, /* Archive. */
+ netbsd_core_file_p /* A core file. */
},
- { /* bfd_set_format */
+ { /* bfd_set_format. */
bfd_false, bfd_false,
bfd_false, bfd_false
},
- { /* bfd_write_contents */
+ { /* bfd_write_contents. */
bfd_false, bfd_false,
bfd_false, bfd_false
},
@@ -252,5 +280,5 @@ const bfd_target netbsd_core_vec =
NULL,
- (PTR) 0 /* backend_data */
+ (PTR) 0 /* Backend_data. */
};
diff --git a/bfd/version.h b/bfd/version.h
index e4174168bf3..7a3a027d926 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20040221
+#define BFD_VERSION_DATE 20040301
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_string@
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index 9d0f3e2a15c..2a7b8c4de02 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,27 @@
+2004-02-23 Nick Clifton <nickc@redhat.com>
+
+ * Apply these patches from Renesas:
+
+ 2004-02-10 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * cpu/m32r.opc (my_print_insn): Fixed incorrect output when
+ disassembling codes for 0x*2 addresses.
+
+ 2003-12-15 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * cpu/m32r.cpu: Add PIPE_O attribute to "pop" instruction.
+
+ 2003-12-03 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * cpu/m32r.cpu : Add new model m32r2.
+ Add new instructions.
+ Replace occurrances of 'Mitsubishi' with 'Renesas'.
+ Changed PIPE attr of push from O to OS.
+ Care for Little-endian of M32R.
+ * cpu/m32r.opc (CGEN_DIS_HASH, my_print_insn):
+ Care for Little-endian of M32R.
+ (parse_slo16): signed extension for value.
+
2004-02-20 Andrew Cagney <cagney@redhat.com>
* m32r.opc, m32r.cpu: New files. Written by , Doug Evans, Nick
diff --git a/cpu/m32r.cpu b/cpu/m32r.cpu
index a2f94a86c40..c049b284631 100644
--- a/cpu/m32r.cpu
+++ b/cpu/m32r.cpu
@@ -1,4 +1,4 @@
-; Mitsubishi M32R CPU description. -*- Scheme -*-
+; Renesas M32R CPU description. -*- Scheme -*-
;
; Copyright 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
;
@@ -30,23 +30,25 @@
(define-arch
(name m32r) ; name of cpu family
- (comment "Mitsubishi M32R")
+ (comment "Renesas M32R")
(default-alignment aligned)
(insn-lsb0? #f)
- (machs m32r m32rx)
+ (machs m32r m32rx m32r2)
(isas m32r)
)
; Attributes.
; An attribute to describe which pipeline an insn runs in.
+; O_OS is a special attribute for sll, sra, sla, slli, srai, slai.
+; These instructions have O attribute for m32rx and OS attribute for m32r2.
(define-attr
(for insn)
(type enum)
(name PIPE)
(comment "parallel execution pipeline selection")
- (values NONE O S OS)
+ (values NONE O S OS O_OS)
)
; A derived attribute that says which insns can be executed in parallel
@@ -159,8 +161,8 @@
; The "b" suffix stands for "base" and is the convention.
; The "f" suffix stands for "family" and is the convention.
(name m32rbf)
- (comment "Mitsubishi M32R base family")
- (endian big)
+ (comment "Renesas M32R base family")
+ (endian either)
(word-bitsize 32)
; Override isa spec (??? keeps things simpler, though it was more true
; in the early days and not so much now).
@@ -169,13 +171,22 @@
(define-cpu
(name m32rxf)
- (comment "Mitsubishi M32Rx family")
- (endian big)
+ (comment "Renesas M32Rx family")
+ (endian either)
(word-bitsize 32)
; Generated files have an "x" suffix.
(file-transform "x")
)
+(define-cpu
+ (name m32r2f)
+ (comment "Renesas M32R2 family")
+ (endian either)
+ (word-bitsize 32)
+ ; Generated files have an "2" suffix.
+ (file-transform "2")
+)
+
(define-mach
(name m32r)
(comment "Generic M32R cpu")
@@ -187,6 +198,12 @@
(comment "M32RX cpu")
(cpu m32rxf)
)
+
+(define-mach
+ (name m32r2)
+ (comment "M32R2 cpu")
+ (cpu m32r2f)
+)
; Model descriptions.
@@ -327,6 +344,59 @@
() ; profile action (default)
)
)
+
+(define-model
+ (name m32r2) (comment "m32r2") (attrs)
+ (mach m32r2)
+
+ ; ??? It's 6 stages but I forget the details right now.
+ (pipeline p-o "" () ((fetch) (decode) (execute) (writeback)))
+ (pipeline p-s "" () ((fetch) (decode) (execute) (writeback)))
+ (pipeline p-o-mem "" () ((fetch) (decode) (execute) (memory) (writeback)))
+
+ (unit u-exec "Execution Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((sr INT -1) (dr INT -1)) ; inputs
+ ((dr INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ (unit u-cmp "Compare Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((src1 INT -1) (src2 INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ (unit u-mac "Multiply/Accumulate Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((src1 INT -1) (src2 INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ (unit u-cti "Branch Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((sr INT -1)) ; inputs
+ ((pc)) ; outputs
+ () ; profile action (default)
+ )
+ (unit u-load "Memory Load Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((sr INT)) ; inputs
+ ((dr INT)) ; outputs
+ () ; profile action (default)
+ )
+ (unit u-store "Memory Store Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((src1 INT) (src2 INT)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+)
; The instruction fetch/execute cycle.
; This is split into two parts as sometimes more than one instruction is
@@ -397,8 +467,10 @@
(df f-simm8 "simm8" () 8 8 INT #f #f)
(df f-simm16 "simm16" () 16 16 INT #f #f)
(dnf f-shift-op2 "shift op2" () 8 3)
+(dnf f-uimm3 "uimm3" () 5 3)
(dnf f-uimm4 "uimm4" () 12 4)
(dnf f-uimm5 "uimm5" () 11 5)
+(dnf f-uimm8 "uimm8" () 8 8)
(dnf f-uimm16 "uimm16" () 16 16)
(dnf f-uimm24 "uimm24" (ABS-ADDR RELOC) 8 24)
(dnf f-hi16 "high 16 bits" (SIGN-OPT) 16 16)
@@ -418,6 +490,7 @@
(dnf f-accs "accs" () 12 2)
(dnf f-accd "accd" () 4 2)
(dnf f-bits67 "bits67" () 6 2)
+(dnf f-bit4 "bit4" () 4 1)
(dnf f-bit14 "bit14" () 14 1)
(define-ifield (name f-imm1) (comment "1 bit immediate, 0->1 1->2")
@@ -490,7 +563,7 @@
(print-name h-cr)
(prefix "")
(values (psw 0) (cbr 1) (spi 2) (spu 3)
- (bpc 6) (bbpsw 8) (bbpc 14)
+ (bpc 6) (bbpsw 8) (bbpc 14) (evb 5)
(cr0 0) (cr1 1) (cr2 2) (cr3 3)
(cr4 4) (cr5 5) (cr6 6) (cr7 7)
(cr8 8) (cr9 9) (cr10 10) (cr11 11)
@@ -524,7 +597,7 @@
(define-hardware
(name h-accums)
(comment "accumulators")
- (attrs (MACH m32rx))
+ (attrs (MACH m32rx,m32r2))
(type register DI (2))
(indices keyword "" ((a0 0) (a1 1)))
; get/set so a0 accesses are redirected to h-accum.
@@ -589,14 +662,16 @@
(dnop simm8 "8 bit signed immediate" (HASH-PREFIX) h-sint f-simm8)
(dnop simm16 "16 bit signed immediate" (HASH-PREFIX) h-sint f-simm16)
+(dnop uimm3 "3 bit unsigned number" (HASH-PREFIX) h-uint f-uimm3)
(dnop uimm4 "4 bit trap number" (HASH-PREFIX) h-uint f-uimm4)
(dnop uimm5 "5 bit shift count" (HASH-PREFIX) h-uint f-uimm5)
+(dnop uimm8 "8 bit unsigned immediate" (HASH-PREFIX) h-uint f-uimm8)
(dnop uimm16 "16 bit unsigned immediate" (HASH-PREFIX) h-uint f-uimm16)
-(dnop imm1 "1 bit immediate" ((MACH m32rx) HASH-PREFIX) h-uint f-imm1)
-(dnop accd "accumulator destination register" ((MACH m32rx)) h-accums f-accd)
-(dnop accs "accumulator source register" ((MACH m32rx)) h-accums f-accs)
-(dnop acc "accumulator reg (d)" ((MACH m32rx)) h-accums f-acc)
+(dnop imm1 "1 bit immediate" ((MACH m32rx,m32r2) HASH-PREFIX) h-uint f-imm1)
+(dnop accd "accumulator destination register" ((MACH m32rx,m32r2)) h-accums f-accd)
+(dnop accs "accumulator source register" ((MACH m32rx,m32r2)) h-accums f-accs)
+(dnop acc "accumulator reg (d)" ((MACH m32rx,m32r2)) h-accums f-acc)
; slo16,ulo16 are used in both with-hash-prefix/no-hash-prefix cases.
; e.g. add3 r3,r3,#1 and ld r3,@(4,r4). We could use HASH-PREFIX.
@@ -694,6 +769,20 @@
(comment "non-public m32rx insn")
)
+(define-attr
+ (for insn)
+ (type boolean)
+ (name SPECIAL_M32R)
+ (comment "non-public m32r insn")
+)
+
+(define-attr
+ (for insn)
+ (type boolean)
+ (name SPECIAL_FLOAT)
+ (comment "floating point insn")
+)
+
; IDOC attribute for instruction documentation.
(define-attr
@@ -745,7 +834,8 @@
(+ OP1_4 dr simm8)
(set dr (add dr simm8))
((m32r/d (unit u-exec))
- (m32rx (unit u-exec)))
+ (m32rx (unit u-exec))
+ (m32r2 (unit u-exec)))
)
(dni addv "addv"
@@ -784,7 +874,8 @@
(+ OP1_7 (f-r1 12) disp8)
(if condbit (set pc disp8))
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bc8r "relaxable bc8"
@@ -799,7 +890,8 @@
(+ OP1_15 (f-r1 12) disp24)
(if condbit (set pc disp24))
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bc24r "relaxable bc24"
@@ -814,7 +906,8 @@
(+ OP1_11 OP2_0 src1 src2 disp16)
(if (eq src1 src2) (set pc disp16))
((m32r/d (unit u-cti) (unit u-cmp (cycles 0)))
- (m32rx (unit u-cti) (unit u-cmp (cycles 0))))
+ (m32rx (unit u-cti) (unit u-cmp (cycles 0)))
+ (m32r2 (unit u-cti) (unit u-cmp (cycles 0))))
)
(define-pmacro (cbranch sym comment op2-op comp-op)
@@ -823,7 +916,8 @@
(+ OP1_11 op2-op (f-r1 0) src2 disp16)
(if (comp-op src2 (const WI 0)) (set pc disp16))
((m32r/d (unit u-cti) (unit u-cmp (cycles 0)))
- (m32rx (unit u-cti) (unit u-cmp (cycles 0))))
+ (m32rx (unit u-cti) (unit u-cmp (cycles 0)))
+ (m32r2 (unit u-cti) (unit u-cmp (cycles 0))))
)
)
(cbranch beqz "beqz" OP2_8 eq)
@@ -842,7 +936,8 @@
(add (and pc (const -4)) (const 4)))
(set pc disp8))
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bl8r "relaxable bl8"
@@ -859,7 +954,8 @@
(set (reg h-gr 14) (add pc (const 4)))
(set pc disp24))
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bl24r "relaxable bl24"
@@ -869,7 +965,7 @@
)
(dni bcl8 "bcl with 8 bit displacement"
- (COND-CTI FILL-SLOT (MACH m32rx) (PIPE O) (IDOC BR))
+ (COND-CTI FILL-SLOT (MACH m32rx,m32r2) (PIPE O) (IDOC BR))
"bcl.s $disp8"
(+ OP1_7 (f-r1 8) disp8)
(if condbit
@@ -878,28 +974,30 @@
(add (and pc (const -4))
(const 4)))
(set pc disp8)))
- ((m32rx (unit u-cti)))
+ ((m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bcl8r "relaxable bcl8"
- (COND-CTI FILL-SLOT (MACH m32rx) (PIPE O) RELAXABLE (IDOC BR))
+ (COND-CTI FILL-SLOT (MACH m32rx,m32r2) (PIPE O) RELAXABLE (IDOC BR))
"bcl $disp8"
(emit bcl8 disp8)
)
(dni bcl24 "bcl with 24 bit displacement"
- (COND-CTI (MACH m32rx) (IDOC BR))
+ (COND-CTI (MACH m32rx,m32r2) (IDOC BR))
"bcl.l $disp24"
(+ OP1_15 (f-r1 8) disp24)
(if condbit
(sequence ()
(set (reg h-gr 14) (add pc (const 4)))
(set pc disp24)))
- ((m32rx (unit u-cti)))
+ ((m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bcl24r "relaxable bcl24"
- (COND-CTI (MACH m32rx) RELAXED (IDOC BR))
+ (COND-CTI (MACH m32rx,m32r2) RELAXED (IDOC BR))
"bcl $disp24"
(emit bcl24 disp24)
)
@@ -910,7 +1008,8 @@
(+ OP1_7 (f-r1 13) disp8)
(if (not condbit) (set pc disp8))
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bnc8r "relaxable bnc8"
@@ -925,7 +1024,8 @@
(+ OP1_15 (f-r1 13) disp24)
(if (not condbit) (set pc disp24))
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bnc24r "relaxable bnc24"
@@ -940,7 +1040,8 @@
(+ OP1_11 OP2_1 src1 src2 disp16)
(if (ne src1 src2) (set pc disp16))
((m32r/d (unit u-cti) (unit u-cmp (cycles 0)))
- (m32rx (unit u-cti) (unit u-cmp (cycles 0))))
+ (m32rx (unit u-cti) (unit u-cmp (cycles 0)))
+ (m32r2 (unit u-cti) (unit u-cmp (cycles 0))))
)
(dni bra8 "bra with 8 bit displacement"
@@ -949,7 +1050,8 @@
(+ OP1_7 (f-r1 15) disp8)
(set pc disp8)
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bra8r "relaxable bra8"
@@ -964,7 +1066,8 @@
(+ OP1_15 (f-r1 15) disp24)
(set pc disp24)
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bra24r "relaxable bra24"
@@ -974,7 +1077,7 @@
)
(dni bncl8 "bncl with 8 bit displacement"
- (COND-CTI FILL-SLOT (MACH m32rx) (PIPE O) (IDOC BR))
+ (COND-CTI FILL-SLOT (MACH m32rx,m32r2) (PIPE O) (IDOC BR))
"bncl.s $disp8"
(+ OP1_7 (f-r1 9) disp8)
(if (not condbit)
@@ -983,28 +1086,30 @@
(add (and pc (const -4))
(const 4)))
(set pc disp8)))
- ((m32rx (unit u-cti)))
+ ((m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bncl8r "relaxable bncl8"
- (COND-CTI FILL-SLOT (MACH m32rx) (PIPE O) RELAXABLE (IDOC BR))
+ (COND-CTI FILL-SLOT (MACH m32rx,m32r2) (PIPE O) RELAXABLE (IDOC BR))
"bncl $disp8"
(emit bncl8 disp8)
)
(dni bncl24 "bncl with 24 bit displacement"
- (COND-CTI (MACH m32rx) (IDOC BR))
+ (COND-CTI (MACH m32rx,m32r2) (IDOC BR))
"bncl.l $disp24"
(+ OP1_15 (f-r1 9) disp24)
(if (not condbit)
(sequence ()
(set (reg h-gr 14) (add pc (const 4)))
(set pc disp24)))
- ((m32rx (unit u-cti)))
+ ((m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dnmi bncl24r "relaxable bncl24"
- (COND-CTI (MACH m32rx) RELAXED (IDOC BR))
+ (COND-CTI (MACH m32rx,m32r2) RELAXED (IDOC BR))
"bncl $disp24"
(emit bncl24 disp24)
)
@@ -1015,7 +1120,8 @@
(+ OP1_0 OP2_4 src1 src2)
(set condbit (lt src1 src2))
((m32r/d (unit u-cmp))
- (m32rx (unit u-cmp)))
+ (m32rx (unit u-cmp))
+ (m32r2 (unit u-cmp)))
)
(dni cmpi "cmpi"
@@ -1024,7 +1130,8 @@
(+ OP1_8 (f-r1 0) OP2_4 src2 simm16)
(set condbit (lt src2 simm16))
((m32r/d (unit u-cmp))
- (m32rx (unit u-cmp)))
+ (m32rx (unit u-cmp))
+ (m32r2 (unit u-cmp)))
)
(dni cmpu "cmpu"
@@ -1033,7 +1140,8 @@
(+ OP1_0 OP2_5 src1 src2)
(set condbit (ltu src1 src2))
((m32r/d (unit u-cmp))
- (m32rx (unit u-cmp)))
+ (m32rx (unit u-cmp))
+ (m32r2 (unit u-cmp)))
)
(dni cmpui "cmpui"
@@ -1042,23 +1150,26 @@
(+ OP1_8 (f-r1 0) OP2_5 src2 simm16)
(set condbit (ltu src2 simm16))
((m32r/d (unit u-cmp))
- (m32rx (unit u-cmp)))
+ (m32rx (unit u-cmp))
+ (m32r2 (unit u-cmp)))
)
(dni cmpeq "cmpeq"
- ((MACH m32rx) (PIPE OS) (IDOC ALU))
+ ((MACH m32rx,m32r2) (PIPE OS) (IDOC ALU))
"cmpeq $src1,$src2"
(+ OP1_0 OP2_6 src1 src2)
(set condbit (eq src1 src2))
- ((m32rx (unit u-cmp)))
+ ((m32rx (unit u-cmp))
+ (m32r2 (unit u-cmp)))
)
(dni cmpz "cmpz"
- ((MACH m32rx) (PIPE OS) (IDOC ALU))
+ ((MACH m32rx,m32r2) (PIPE OS) (IDOC ALU))
"cmpz $src2"
(+ OP1_0 OP2_7 (f-r1 0) src2)
(set condbit (eq src2 (const 0)))
- ((m32rx (unit u-cmp)))
+ ((m32rx (unit u-cmp))
+ (m32r2 (unit u-cmp)))
)
(dni div "div"
@@ -1067,7 +1178,8 @@
(+ OP1_9 OP2_0 dr sr (f-simm16 0))
(if (ne sr (const 0)) (set dr (div dr sr)))
((m32r/d (unit u-exec (cycles 37)))
- (m32rx (unit u-exec (cycles 37))))
+ (m32rx (unit u-exec (cycles 37)))
+ (m32r2 (unit u-exec (cycles 37))))
)
(dni divu "divu"
@@ -1076,7 +1188,8 @@
(+ OP1_9 OP2_1 dr sr (f-simm16 0))
(if (ne sr (const 0)) (set dr (udiv dr sr)))
((m32r/d (unit u-exec (cycles 37)))
- (m32rx (unit u-exec (cycles 37))))
+ (m32rx (unit u-exec (cycles 37)))
+ (m32r2 (unit u-exec (cycles 37))))
)
(dni rem "rem"
@@ -1086,7 +1199,8 @@
; FIXME: Check rounding direction.
(if (ne sr (const 0)) (set dr (mod dr sr)))
((m32r/d (unit u-exec (cycles 37)))
- (m32rx (unit u-exec (cycles 37))))
+ (m32rx (unit u-exec (cycles 37)))
+ (m32r2 (unit u-exec (cycles 37))))
)
(dni remu "remu"
@@ -1096,31 +1210,95 @@
; FIXME: Check rounding direction.
(if (ne sr (const 0)) (set dr (umod dr sr)))
((m32r/d (unit u-exec (cycles 37)))
- (m32rx (unit u-exec (cycles 37))))
+ (m32rx (unit u-exec (cycles 37)))
+ (m32r2 (unit u-exec (cycles 37))))
+)
+
+(dni remh "remh"
+ ((MACH m32r2))
+ "remh $dr,$sr"
+ (+ OP1_9 OP2_2 dr sr (f-simm16 #x10))
+ ; FIXME: Check rounding direction.
+ (if (ne sr (const 0)) (set dr (mod (ext WI (trunc HI dr)) sr)))
+ ((m32r2 (unit u-exec (cycles 21))))
+)
+
+(dni remuh "remuh"
+ ((MACH m32r2))
+ "remuh $dr,$sr"
+ (+ OP1_9 OP2_3 dr sr (f-simm16 #x10))
+ ; FIXME: Check rounding direction.
+ (if (ne sr (const 0)) (set dr (umod dr sr)))
+ ((m32r2 (unit u-exec (cycles 21))))
+)
+
+(dni remb "remb"
+ ((MACH m32r2))
+ "remb $dr,$sr"
+ (+ OP1_9 OP2_2 dr sr (f-simm16 #x18))
+ ; FIXME: Check rounding direction.
+ (if (ne sr (const 0)) (set dr (mod (ext WI (trunc BI dr)) sr)))
+ ((m32r2 (unit u-exec (cycles 21))))
+)
+
+(dni remub "remub"
+ ((MACH m32r2))
+ "remub $dr,$sr"
+ (+ OP1_9 OP2_3 dr sr (f-simm16 #x18))
+ ; FIXME: Check rounding direction.
+ (if (ne sr (const 0)) (set dr (umod dr sr)))
+ ((m32r2 (unit u-exec (cycles 21))))
+)
+
+(dni divuh "divuh"
+ ((MACH m32r2))
+ "divuh $dr,$sr"
+ (+ OP1_9 OP2_1 dr sr (f-simm16 #x10))
+ (if (ne sr (const 0)) (set dr (udiv dr sr)))
+ ((m32r2 (unit u-exec (cycles 21))))
+)
+
+(dni divb "divb"
+ ((MACH m32r2))
+ "divb $dr,$sr"
+ (+ OP1_9 OP2_0 dr sr (f-simm16 #x18))
+ (if (ne sr (const 0)) (set dr (div (ext WI (trunc BI dr)) sr)))
+ ((m32r2 (unit u-exec (cycles 21))))
+)
+
+(dni divub "divub"
+ ((MACH m32r2))
+ "divub $dr,$sr"
+ (+ OP1_9 OP2_1 dr sr (f-simm16 #x18))
+ (if (ne sr (const 0)) (set dr (udiv dr sr)))
+ ((m32r2 (unit u-exec (cycles 21))))
)
(dni divh "divh"
- ((MACH m32rx) (IDOC ALU))
+ ((MACH m32rx,m32r2) (IDOC ALU))
"divh $dr,$sr"
(+ OP1_9 OP2_0 dr sr (f-simm16 #x10))
(if (ne sr (const 0)) (set dr (div (ext WI (trunc HI dr)) sr)))
- ((m32rx (unit u-exec (cycles 21))))
+ ((m32rx (unit u-exec (cycles 21)))
+ (m32r2 (unit u-exec (cycles 21))))
)
(dni jc "jc"
- (COND-CTI (MACH m32rx) (PIPE O) SPECIAL (IDOC BR))
+ (COND-CTI (MACH m32rx,m32r2) (PIPE O) SPECIAL (IDOC BR))
"jc $sr"
(+ OP1_1 (f-r1 12) OP2_12 sr)
(if condbit (set pc (and sr (const -4))))
- ((m32rx (unit u-cti)))
+ ((m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dni jnc "jnc"
- (COND-CTI (MACH m32rx) (PIPE O) SPECIAL (IDOC BR))
+ (COND-CTI (MACH m32rx,m32r2) (PIPE O) SPECIAL (IDOC BR))
"jnc $sr"
(+ OP1_1 (f-r1 13) OP2_12 sr)
(if (not condbit) (set pc (and sr (const -4))))
- ((m32rx (unit u-cti)))
+ ((m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dni jl "jl"
@@ -1132,7 +1310,8 @@
(add (and pc (const -4)) (const 4)))
(set pc (and sr (const -4))))
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(dni jmp "jmp"
@@ -1154,7 +1333,8 @@
; (add WI (and WI pc (const WI -4)) (const WI 4))))
; (set WI pc sr))
((m32r/d (unit u-cti))
- (m32rx (unit u-cti)))
+ (m32rx (unit u-cti))
+ (m32r2 (unit u-cti)))
)
(define-pmacro (no-ext-expr mode expr) expr)
@@ -1169,7 +1349,8 @@
(+ OP1_2 op2-op dr sr)
(set dr (ext-op WI (mem mode sr)))
((m32r/d (unit u-load))
- (m32rx (unit u-load)))
+ (m32rx (unit u-load))
+ (m32r2 (unit u-load)))
)
(dnmi (.sym ld suffix "-2") (.str "ld" suffix "-2")
(NO-DIS (PIPE O) (IDOC MEM))
@@ -1181,7 +1362,8 @@
(+ OP1_10 op2-op dr sr slo16)
(set dr (ext-op WI (mem mode (add sr slo16))))
((m32r/d (unit u-load (cycles 2)))
- (m32rx (unit u-load (cycles 2))))
+ (m32rx (unit u-load (cycles 2)))
+ (m32r2 (unit u-load (cycles 2))))
)
(dnmi (.sym ld suffix -d2) (.str "ld" suffix "-d2")
(NO-DIS (IDOC MEM))
@@ -1217,11 +1399,13 @@
(unit u-exec (in sr #f) (in dr sr) (out dr sr) (cycles 0) (pred (const 1))))
(m32rx (unit u-load)
(unit u-exec (in sr #f) (in dr sr) (out dr sr) (cycles 0) (pred (const 1))))
+ (m32r2 (unit u-load)
+ (unit u-exec (in sr #f) (in dr sr) (out dr sr) (cycles 0) (pred (const 1))))
)
)
(dnmi pop "pop"
- ((IDOC MEM))
+ ((PIPE O) (IDOC MEM))
"pop $dr"
(emit ld-plus dr (sr 15)) ; "ld %0,@sp+"
)
@@ -1272,7 +1456,8 @@
(set (reg h-lock) (const BI 1))
(set dr (mem WI sr)))
((m32r/d (unit u-load))
- (m32rx (unit u-load)))
+ (m32rx (unit u-load))
+ (m32r2 (unit u-load)))
)
(dni machi "machi"
@@ -1299,7 +1484,7 @@
)
(dni machi-a "machi-a"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"machi $src1,$src2,$acc"
(+ OP1_3 src1 acc (f-op23 4) src2)
(set acc
@@ -1312,7 +1497,8 @@
(ext DI (trunc HI (sra WI src2 (const 16))))))
(const 8))
(const 8)))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dni maclo "maclo"
@@ -1333,7 +1519,7 @@
)
(dni maclo-a "maclo-a"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"maclo $src1,$src2,$acc"
(+ OP1_3 src1 acc (f-op23 5) src2)
(set acc
@@ -1346,7 +1532,8 @@
(ext DI (trunc HI src2))))
(const 8))
(const 8)))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dni macwhi "macwhi"
@@ -1367,7 +1554,7 @@
)
(dni macwhi-a "macwhi-a"
- ((MACH m32rx) (PIPE S) SPECIAL (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) SPECIAL (IDOC MAC))
"macwhi $src1,$src2,$acc"
(+ OP1_3 src1 acc (f-op23 6) src2)
; Note that this doesn't do the sign extension, which is correct.
@@ -1375,7 +1562,8 @@
(add acc
(mul (ext DI src1)
(ext DI (trunc HI (sra src2 (const 16)))))))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dni macwlo "macwlo"
@@ -1396,7 +1584,7 @@
)
(dni macwlo-a "macwlo-a"
- ((MACH m32rx) (PIPE S) SPECIAL (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) SPECIAL (IDOC MAC))
"macwlo $src1,$src2,$acc"
(+ OP1_3 src1 acc (f-op23 7) src2)
; Note that this doesn't do the sign extension, which is correct.
@@ -1404,7 +1592,8 @@
(add acc
(mul (ext DI src1)
(ext DI (trunc HI src2)))))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dni mul "mul"
@@ -1413,7 +1602,8 @@
(+ OP1_1 OP2_6 dr sr)
(set dr (mul dr sr))
((m32r/d (unit u-exec (cycles 4)))
- (m32rx (unit u-exec (cycles 4))))
+ (m32rx (unit u-exec (cycles 4)))
+ (m32r2 (unit u-exec (cycles 4))))
)
(dni mulhi "mulhi"
@@ -1432,7 +1622,7 @@
)
(dni mulhi-a "mulhi-a"
- ((MACH m32rx) (PIPE S) (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC ACCUM))
"mulhi $src1,$src2,$acc"
(+ OP1_3 (f-op23 0) src1 acc src2)
(set acc
@@ -1443,7 +1633,8 @@
(ext DI (trunc HI (sra WI src2 (const 16)))))
(const 16))
(const 16)))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dni mullo "mullo"
@@ -1462,7 +1653,7 @@
)
(dni mullo-a "mullo-a"
- ((MACH m32rx) (PIPE S) (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC ACCUM))
"mullo $src1,$src2,$acc"
(+ OP1_3 src1 acc (f-op23 1) src2)
(set acc
@@ -1473,7 +1664,8 @@
(ext DI (trunc HI src2)))
(const 16))
(const 16)))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dni mulwhi "mulwhi"
@@ -1492,14 +1684,15 @@
)
(dni mulwhi-a "mulwhi-a"
- ((MACH m32rx) (PIPE S) SPECIAL (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) SPECIAL (IDOC ACCUM))
"mulwhi $src1,$src2,$acc"
(+ OP1_3 src1 acc (f-op23 2) src2)
; Note that this doesn't do the sign extension, which is correct.
(set acc
(mul (ext DI src1)
(ext DI (trunc HI (sra src2 (const 16))))))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dni mulwlo "mulwlo"
@@ -1518,14 +1711,15 @@
)
(dni mulwlo-a "mulwlo-a"
- ((MACH m32rx) (PIPE S) SPECIAL (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) SPECIAL (IDOC ACCUM))
"mulwlo $src1,$src2,$acc"
(+ OP1_3 src1 acc (f-op23 3) src2)
; Note that this doesn't do the sign extension, which is correct.
(set acc
(mul (ext DI src1)
(ext DI (trunc HI src2))))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dni mv "mv"
@@ -1545,11 +1739,12 @@
)
(dni mvfachi-a "mvfachi-a"
- ((MACH m32rx) (PIPE S) (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC ACCUM))
"mvfachi $dr,$accs"
(+ OP1_5 dr OP2_15 accs (f-op3 0))
(set dr (trunc WI (sra DI accs (const 32))))
- ((m32rx (unit u-exec (cycles 2))))
+ ((m32rx (unit u-exec (cycles 2)))
+ (m32r2 (unit u-exec (cycles 2))))
)
(dni mvfaclo "mvfaclo"
@@ -1561,11 +1756,12 @@
)
(dni mvfaclo-a "mvfaclo-a"
- ((MACH m32rx) (PIPE S) (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC ACCUM))
"mvfaclo $dr,$accs"
(+ OP1_5 dr OP2_15 accs (f-op3 1))
(set dr (trunc WI accs))
- ((m32rx (unit u-exec (cycles 2))))
+ ((m32rx (unit u-exec (cycles 2)))
+ (m32r2 (unit u-exec (cycles 2))))
)
(dni mvfacmi "mvfacmi"
@@ -1577,11 +1773,12 @@
)
(dni mvfacmi-a "mvfacmi-a"
- ((MACH m32rx) (PIPE S) (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC ACCUM))
"mvfacmi $dr,$accs"
(+ OP1_5 dr OP2_15 accs (f-op3 2))
(set dr (trunc WI (sra DI accs (const 16))))
- ((m32rx (unit u-exec (cycles 2))))
+ ((m32rx (unit u-exec (cycles 2)))
+ (m32r2 (unit u-exec (cycles 2))))
)
(dni mvfc "mvfc"
@@ -1604,14 +1801,15 @@
)
(dni mvtachi-a "mvtachi-a"
- ((MACH m32rx) (PIPE S) (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC ACCUM))
"mvtachi $src1,$accs"
(+ OP1_5 src1 OP2_7 accs (f-op3 0))
(set accs
(or DI
(and DI accs (const DI #xffffffff))
(sll DI (ext DI src1) (const 32))))
- ((m32rx (unit u-exec (in sr src1))))
+ ((m32rx (unit u-exec (in sr src1)))
+ (m32r2 (unit u-exec (in sr src1))))
)
(dni mvtaclo "mvtaclo"
@@ -1626,14 +1824,15 @@
)
(dni mvtaclo-a "mvtaclo-a"
- ((MACH m32rx) (PIPE S) (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC ACCUM))
"mvtaclo $src1,$accs"
(+ OP1_5 src1 OP2_7 accs (f-op3 1))
(set accs
(or DI
(and DI accs (const DI #xffffffff00000000))
(zext DI src1)))
- ((m32rx (unit u-exec (in sr src1))))
+ ((m32rx (unit u-exec (in sr src1)))
+ (m32r2 (unit u-exec (in sr src1))))
)
(dni mvtc "mvtc"
@@ -1660,7 +1859,8 @@
; FIXME: quick hack: parallel nops don't contribute to cycle count.
; Other kinds of nops do however (which we currently ignore).
((m32r/d (unit u-exec (cycles 0)))
- (m32rx (unit u-exec (cycles 0))))
+ (m32rx (unit u-exec (cycles 0)))
+ (m32r2 (unit u-exec (cycles 0))))
)
(dni not "not"
@@ -1690,7 +1890,7 @@
)
(dni rac-dsi "rac-dsi"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"rac $accd,$accs,$imm1"
(+ OP1_5 accd (f-bits67 0) OP2_9 accs (f-bit14 0) imm1)
(sequence ((DI tmp1))
@@ -1704,17 +1904,18 @@
(const DI #xffff800000000000))
(else (and tmp1 (const DI #xffffffffffff0000)))))
)
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dnmi rac-d "rac-d"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"rac $accd"
(emit rac-dsi accd (f-accs 0) (f-imm1 0))
)
(dnmi rac-ds "rac-ds"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"rac $accd,$accs"
(emit rac-dsi accd accs (f-imm1 0))
)
@@ -1748,7 +1949,7 @@
)
(dni rach-dsi "rach-dsi"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"rach $accd,$accs,$imm1"
(+ OP1_5 accd (f-bits67 0) OP2_8 accs (f-bit14 0) imm1)
(sequence ((DI tmp1))
@@ -1762,17 +1963,18 @@
(const DI #xffff800000000000))
(else (and tmp1 (const DI #xffffffff00000000)))))
)
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
(dnmi rach-d "rach-d"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"rach $accd"
(emit rach-dsi accd (f-accs 0) (f-imm1 0))
)
(dnmi rach-ds "rach-ds"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"rach $accd,$accs"
(emit rach-dsi accd accs (f-imm1 0))
)
@@ -1804,7 +2006,7 @@
(define-pmacro (shift-op sym op2-r-op op2-3-op op2-i-op sem-op)
(begin
- (dni sym sym ((PIPE O) (IDOC ALU))
+ (dni sym sym ((PIPE O_OS) (IDOC ALU))
(.str sym " $dr,$sr")
(+ OP1_1 op2-r-op dr sr)
(set dr (sem-op dr (and sr (const 31))))
@@ -1816,7 +2018,7 @@
(set dr (sem-op sr (and WI simm16 (const 31))))
()
)
- (dni (.sym sym "i") sym ((PIPE O) (IDOC ALU))
+ (dni (.sym sym "i") sym ((PIPE O_OS) (IDOC ALU))
(.str sym "i $dr,$uimm5")
(+ OP1_5 (f-shift-op2 op2-i-op) dr uimm5)
(set dr (sem-op dr uimm5))
@@ -1836,7 +2038,8 @@
(+ OP1_2 op2-op src1 src2)
(set mode (mem mode src2) src1)
((m32r/d (unit u-store (cycles 1)))
- (m32rx (unit u-store (cycles 1))))
+ (m32rx (unit u-store (cycles 1)))
+ (m32r2 (unit u-store (cycles 1))))
)
(dnmi (.sym st suffix "-2") (.str "st" suffix "-2")
(NO-DIS (PIPE O) (IDOC MEM))
@@ -1848,7 +2051,8 @@
(+ OP1_10 op2-op src1 src2 slo16)
(set mode (mem mode (add src2 slo16)) src1)
((m32r/d (unit u-store (cycles 2)))
- (m32rx (unit u-store (cycles 2))))
+ (m32rx (unit u-store (cycles 2)))
+ (m32r2 (unit u-store (cycles 2))))
)
(dnmi (.sym st suffix -d2) (.str "st" suffix "-d2")
(NO-DIS (IDOC MEM))
@@ -1873,6 +2077,40 @@
(unit u-exec (in dr src2) (out dr src2) (cycles 0)))
(m32rx (unit u-store)
(unit u-exec (in dr src2) (out dr src2) (cycles 0)))
+ (m32r2 (unit u-store)
+ (unit u-exec (in dr src2) (out dr src2) (cycles 0)))
+ )
+)
+
+(dni sth-plus "sth+"
+ ((MACH m32rx,m32r2) (PIPE O) SPECIAL)
+ "sth $src1,@$src2+"
+ (+ OP1_2 OP2_3 src1 src2)
+ ; This has to be coded carefully to avoid an "earlyclobber" of src2.
+ (sequence ((HI new-src2))
+ (set (mem HI new-src2) src1)
+ (set new-src2 (add src2 (const 2)))
+ (set src2 new-src2))
+ ((m32rx (unit u-store)
+ (unit u-exec (in dr src2) (out dr src2) (cycles 0)))
+ (m32r2 (unit u-store)
+ (unit u-exec (in dr src2) (out dr src2) (cycles 0)))
+ )
+)
+
+(dni stb-plus "stb+"
+ ((MACH m32rx,m32r2) (PIPE O) SPECIAL)
+ "stb $src1,@$src2+"
+ (+ OP1_2 OP2_1 src1 src2)
+ ; This has to be coded carefully to avoid an "earlyclobber" of src2.
+ (sequence ((QI new-src2))
+ (set (mem QI new-src2) src1)
+ (set new-src2 (add src2 (const 1)))
+ (set src2 new-src2))
+ ((m32rx (unit u-store)
+ (unit u-exec (in dr src2) (out dr src2) (cycles 0)))
+ (m32r2 (unit u-store)
+ (unit u-exec (in dr src2) (out dr src2) (cycles 0)))
)
)
@@ -1893,10 +2131,12 @@
(unit u-exec (in dr src2) (out dr src2) (cycles 0)))
(m32rx (unit u-store)
(unit u-exec (in dr src2) (out dr src2) (cycles 0)))
+ (m32r2 (unit u-store)
+ (unit u-exec (in dr src2) (out dr src2) (cycles 0)))
)
)
-(dnmi push "push" ((IDOC MEM))
+(dnmi push "push" ((PIPE O) (IDOC MEM))
"push $src1"
(emit st-minus src1 (src2 15)) ; "st %0,@-sp"
)
@@ -1961,12 +2201,13 @@
(set (mem WI src2) src1))
(set (reg h-lock) (const BI 0)))
((m32r/d (unit u-load))
- (m32rx (unit u-load)))
+ (m32rx (unit u-load))
+ (m32r2 (unit u-load)))
)
; Saturate into byte.
(dni satb "satb"
- ((MACH m32rx) (IDOC ALU))
+ ((MACH m32rx,m32r2) (IDOC ALU))
"satb $dr,$sr"
(+ OP1_8 dr OP2_6 sr (f-uimm16 #x0300))
(set dr
@@ -1980,7 +2221,7 @@
; Saturate into half word.
(dni sath "sath"
- ((MACH m32rx) (IDOC ALU))
+ ((MACH m32rx,m32r2) (IDOC ALU))
"sath $dr,$sr"
(+ OP1_8 dr OP2_6 sr (f-uimm16 #x0200))
(set dr
@@ -1993,7 +2234,7 @@
; Saturate word.
(dni sat "sat"
- ((MACH m32rx) SPECIAL (IDOC ALU))
+ ((MACH m32rx,m32r2) SPECIAL (IDOC ALU))
"sat $dr,$sr"
(+ OP1_8 dr OP2_6 sr (f-uimm16 0))
(set dr
@@ -2008,7 +2249,7 @@
; Parallel compare byte zeros.
; Set C bit in condition register if any byte in source register is zero.
(dni pcmpbz "pcmpbz"
- ((MACH m32rx) (PIPE OS) SPECIAL (IDOC ALU))
+ ((MACH m32rx,m32r2) (PIPE OS) SPECIAL (IDOC ALU))
"pcmpbz $src2"
(+ OP1_0 (f-r1 3) OP2_7 src2)
(set condbit
@@ -2018,23 +2259,25 @@
((eq (and src2 (const #xff0000)) (const 0)) (const BI 1))
((eq (and src2 (const #xff000000)) (const 0)) (const BI 1))
(else (const BI 0))))
- ((m32rx (unit u-cmp)))
+ ((m32rx (unit u-cmp))
+ (m32r2 (unit u-cmp)))
)
; Add accumulators
(dni sadd "sadd"
- ((MACH m32rx) (PIPE S) (IDOC ACCUM))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC ACCUM))
"sadd"
(+ OP1_5 (f-r1 0) OP2_14 (f-r2 4))
(set (reg h-accums 0)
(add (sra (reg h-accums 1) (const 16))
(reg h-accums 0)))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
; Multiply and add into accumulator 1
(dni macwu1 "macwu1"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"macwu1 $src1,$src2"
(+ OP1_5 src1 OP2_11 src2)
(set (reg h-accums 1)
@@ -2047,12 +2290,13 @@
(ext DI (and src2 (const #xffff)))))
(const 8))
(const 8)))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
; Multiply and subtract from accumulator 0
(dni msblo "msblo"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"msblo $src1,$src2"
(+ OP1_5 src1 OP2_13 src2)
(set accum
@@ -2068,12 +2312,13 @@
(const 16)))
(const 8))
(const 8)))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
; Multiply into accumulator 1
(dni mulwu1 "mulwu1"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"mulwu1 $src1,$src2"
(+ OP1_5 src1 OP2_10 src2)
(set (reg h-accums 1)
@@ -2084,12 +2329,13 @@
(ext DI (and src2 (const #xffff))))
(const 16))
(const 16)))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
; Multiply and add into accumulator 1
(dni maclh1 "maclh1"
- ((MACH m32rx) (PIPE S) (IDOC MAC))
+ ((MACH m32rx,m32r2) (PIPE S) (IDOC MAC))
"maclh1 $src1,$src2"
(+ OP1_5 src1 OP2_12 src2)
(set (reg h-accums 1)
@@ -2105,12 +2351,13 @@
(const 16)))
(const 8))
(const 8)))
- ((m32rx (unit u-mac)))
+ ((m32rx (unit u-mac))
+ (m32r2 (unit u-mac)))
)
; skip instruction if C
(dni sc "sc"
- ((MACH m32rx) (PIPE O) SPECIAL (IDOC BR))
+ ((MACH m32rx,m32r2) (PIPE O) SPECIAL (IDOC BR))
"sc"
(+ OP1_7 (f-r1 4) OP2_0 (f-r2 1))
(skip (zext INT condbit))
@@ -2119,9 +2366,61 @@
; skip instruction if not C
(dni snc "snc"
- ((MACH m32rx) (PIPE O) SPECIAL (IDOC BR))
+ ((MACH m32rx,m32r2) (PIPE O) SPECIAL (IDOC BR))
"snc"
(+ OP1_7 (f-r1 5) OP2_0 (f-r2 1))
(skip (zext INT (not condbit)))
()
)
+
+; PSW &= ~((unsigned char) uimm8 | 0x000ff00)
+(dni clrpsw "clrpsw"
+ ((PIPE O) SPECIAL_M32R)
+ "clrpsw $uimm8"
+ (+ OP1_7 (f-r1 2) uimm8)
+ (set USI (reg h-cr 0)
+ (and USI (reg h-cr 0)
+ (or USI (inv BI uimm8) (const #xff00))))
+ ()
+)
+
+; PSW |= (unsigned char) uimm8
+(dni setpsw "setpsw"
+ ((PIPE O) SPECIAL_M32R)
+ "setpsw $uimm8"
+ (+ OP1_7 (f-r1 1) uimm8)
+ (set USI (reg h-cr 0) uimm8)
+ ()
+)
+
+; bset
+(dni bset "bset"
+ (SPECIAL_M32R)
+ "bset $uimm3,@($slo16,$sr)"
+ (+ OP1_10 (f-bit4 0) uimm3 OP2_6 sr slo16)
+ (set QI (mem QI (add sr slo16))
+ (or QI (mem QI (add sr slo16))
+ (sll USI (const 1) (sub (const 7) uimm3))))
+ ()
+)
+
+; bclr
+(dni bclr "bclr"
+ (SPECIAL_M32R)
+ "bclr $uimm3,@($slo16,$sr)"
+ (+ OP1_10 (f-bit4 0) uimm3 OP2_7 sr slo16)
+ (set QI (mem QI (add sr slo16))
+ (and QI (mem QI (add sr slo16))
+ (inv QI (sll USI (const 1) (sub (const 7) uimm3)))))
+ ()
+)
+
+; btst
+(dni btst "btst"
+ (SPECIAL_M32R (PIPE O))
+ "btst $uimm3,$sr"
+ (+ OP1_0 (f-bit4 0) uimm3 OP2_15 sr)
+ (set condbit (and QI (srl USI sr (sub (const 7) uimm3)) (const 1)))
+ ()
+)
+
diff --git a/cpu/m32r.opc b/cpu/m32r.opc
index dbb6f1d7b90..6764223f2bf 100644
--- a/cpu/m32r.opc
+++ b/cpu/m32r.opc
@@ -27,7 +27,6 @@
*/
-
/* This file is an addendum to m32r.cpu. Heavy use of C code isn't
appropriate in .cpu files, so it resides here. This especially applies
to assembly/disassembly where parsing/printing can be quite involved.
@@ -49,6 +48,7 @@
#undef CGEN_DIS_HASH_SIZE
#define CGEN_DIS_HASH_SIZE 256
#undef CGEN_DIS_HASH
+#if 0
#define X(b) (((unsigned char *) (b))[0] & 0xf0)
#define CGEN_DIS_HASH(buffer, value) \
(X (buffer) | \
@@ -56,9 +56,39 @@
: X (buffer) == 0x70 || X (buffer) == 0xf0 ? (((unsigned char *) (buffer))[0] & 0xf) \
: X (buffer) == 0x30 ? ((((unsigned char *) (buffer))[1] & 0x70) >> 4) \
: ((((unsigned char *) (buffer))[1] & 0xf0) >> 4)))
+#else
+#define CGEN_DIS_HASH(buffer, value) m32r_cgen_dis_hash(buffer, value)
+extern unsigned int m32r_cgen_dis_hash(const char *, CGEN_INSN_INT);
+#endif
/* -- */
+/* -- opc.c */
+unsigned int
+m32r_cgen_dis_hash (buf, value)
+ const char * buf ATTRIBUTE_UNUSED;
+ CGEN_INSN_INT value;
+{
+ unsigned int x;
+
+ if (value & 0xffff0000) /* 32bit instructions */
+ value = (value >> 16) & 0xffff;
+
+ x = (value>>8) & 0xf0;
+ if (x == 0x40 || x == 0xe0 || x == 0x60 || x == 0x50)
+ return x;
+
+ if (x == 0x70 || x == 0xf0)
+ return x | ((value>>8) & 0x0f);
+
+ if (x == 0x30)
+ return x | ((value & 0x70) >> 4);
+ else
+ return x | ((value & 0xf0) >> 4);
+}
+
+/* -- */
+
/* -- asm.c */
static const char * parse_hash
PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *));
@@ -159,7 +189,11 @@ parse_slo16 (cd, strp, opindex, valuep)
++*strp;
if (errmsg == NULL
&& result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
- value &= 0xffff;
+ {
+ value &= 0xffff;
+ if (value & 0x8000)
+ value |= 0xffff0000;
+ }
*valuep = value;
return errmsg;
}
@@ -259,10 +293,13 @@ my_print_insn (cd, pc, info)
char *buf = buffer;
int status;
int buflen = (pc & 3) == 0 ? 4 : 2;
+ int big_p = CGEN_CPU_INSN_ENDIAN (cd) == CGEN_ENDIAN_BIG;
+ char *x;
/* Read the base part of the insn. */
- status = (*info->read_memory_func) (pc, buf, buflen, info);
+ status = (*info->read_memory_func) (pc - ((!big_p && (pc & 3) != 0) ? 2 : 0),
+ buf, buflen, info);
if (status != 0)
{
(*info->memory_error_func) (status, pc, info);
@@ -270,22 +307,25 @@ my_print_insn (cd, pc, info)
}
/* 32 bit insn? */
- if ((pc & 3) == 0 && (buf[0] & 0x80) != 0)
+ x = (big_p ? &buf[0] : &buf[3]);
+ if ((pc & 3) == 0 && (*x & 0x80) != 0)
return print_insn (cd, pc, info, buf, buflen);
/* Print the first insn. */
if ((pc & 3) == 0)
{
+ buf += (big_p ? 0 : 2);
if (print_insn (cd, pc, info, buf, 2) == 0)
(*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG);
- buf += 2;
+ buf += (big_p ? 2 : -2);
}
- if (buf[0] & 0x80)
+ x = (big_p ? &buf[0] : &buf[1]);
+ if (*x & 0x80)
{
/* Parallel. */
(*info->fprintf_func) (info->stream, " || ");
- buf[0] &= 0x7f;
+ *x &= 0x7f;
}
else
(*info->fprintf_func) (info->stream, " -> ");
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 162a09f43c2..6382a3d1118 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,627 @@
+2004-02-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * inflow.c (terminal_inferior): Don't give up the terminal if we
+ previously couldn't get the inferior's terminal state.
+
+2004-02-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * regcache.c (read_pc_pid): Restore inferior_ptid after reading
+ PC_REGNUM.
+
+2004-02-28 Andrew Cagney <cagney@redhat.com>
+
+ * NEWS: Refer to GDB 6.1.
+ * README: Refer to GDB 6.1.
+ * PROBLEMS: Refer to GDB 6.1.
+
+2004-02-28 Daniel Jacobowitz <drow@mvista.com>
+
+ * thread-db.c (disable_thread_signals): Remove unused function.
+
+2004-02-28 Mark Kettenis <kettenis@gnu.org>
+
+ * amd64-nat.c: Include "gdb_string.h".
+ (amd64_collect_native_gregset): Zero-extend the 32-bit
+ general-purpose registers and %eip.
+
+ * amd64-tdep.h: (amd64_collect_fxsave): New prototype.
+ * amd64-tdep.c (amd64_collect_fxsave): New function.
+ (amd64_fill_fxsave): Simply call amd64_collect_fxsave.
+
+ * i387-tdep.h: Update copyright year.
+ (i387_collect_fxsave): New prototype.
+ * i387-tdep.c: Update copyright year.
+ (i387_collect_fxsave): New function containing most of the code
+ from i387_fill_fxsave.
+ (i387_fill_fxsave): Call i387_collect_fxsave.
+
+2004-02-28 Andrew Cagney <cagney@redhat.com>
+
+ * amd64-linux-nat.c (ps_get_thread_area): When architecture is
+ i386 use PTRACE_GET_THREAD_AREA. Suggested by Roland McGrath.
+
+2004-02-28 Mark Kettenis <kettenis@gnu.org>
+
+ * amd64-tdep.c (amd64_frame_cache): Fix comment.
+
+2004-02-28 Andrew Cagney <cagney@redhat.com>
+
+ * utils.c: Use "", instead of <>, to include readline.
+ tui/tui-win.c, tui/tui.c, tui/tui-hooks.c: Ditto.
+ * tracepoint.c, top.c, symmisc.c, symfile.c: Ditto.
+ * source.c, solib.c, exec.c, event-top.c: Ditto.
+ * corelow.c, completer.c, cli/cli-setshow.c: Ditto.
+ * cli/cli-dump.c, cli/cli-cmds.c: Ditto.
+ * Makefile.in: Update all dependencies.
+ (readline_tilde_h, readline_history_h): Define.
+ (readline_headers): Delete.
+
+2004-02-28 Mark Kettenis <kettenis@gnu.org>
+
+ * config/djgpp/fnchange.lst: Rename "config/i386/nm-linux64.h" to
+ "config/i386/nm-lx64.h" and "config/i386/tm-linux64.h" to
+ "config/i386/tm-lx64.h".
+
+ * config/djgpp/fnchange.lst: Rename "amd64-linux-tdep.c" to
+ "amd64-ltdep.c" and "amd64-linux-nat.c" to "amd64-lnat.c". Remove
+ rules for "x86-64-linux-tdep.c" and "x86-64-linux-nat.c".
+
+2004-02-28 Andrew Cagney <cagney@redhat.com>
+
+ * dwarf2-frame.h (struct gdbarch): Add opaque declaration.
+
+ * breakpoint.c (_initialize_breakpoint): Use
+ "add_setshow_auto_boolean_cmd. Better word-wrap help messages.
+ Add help to show command.
+
+2004-02-28 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-nat.c: Reformat to be closer to coding standards.
+ (i386_handle_nonaligned_watchpoint): Rename local variable `rv' to
+ `retval'. Make variables `align' and `size' local to while-loop.
+ (i386_stopped_data_address): Rename local variable `ret' to `addr'.
+ (_initialize_i386_nat): New prototype.
+
+ * tui/tui.c: Include <readline/readline.h> instead of
+ "readline/readline.h". Include it after <term.h> and
+ "gdb_curses.h".
+
+2004-02-27 Andrew Cagney <cagney@redhat.com>
+
+ * hppa-tdep.c (hppa_gdbarch_init): On 32-bit systems always use
+ the new frame unwind code.
+ (hppa_frame_cache): Use PCOQ_HEAD_REGNUM instead of PC_REGNUM.
+ (hppa_frame_prev_register): Compute PCOQ_TAIL_REGNUM from
+ PCOQ_HEAD_REGNUM.
+
+ * hppa-tdep.c (hppa_gdbarch_init): On 32-bit systems always
+ "return_value" and "push_dummy_call".
+ (hppa32_use_struct_convention): Delete unused function.
+ (hppa32_store_return_value): Delete unused function.
+ (hppa32_extract_return_value): Delete unused function.
+ (hppa32_stack_align): Delete function.
+
+2004-02-27 Eli Zaretskii <eliz@elta.co.il>
+
+ * coffread.c (enter_linenos): Don't let rawptr reference memory
+ outside linetab[]'s limits.
+
+2004-02-27 Andrew Cagney <cagney@redhat.com>
+
+ * hppa-tdep.c (hppa32_push_dummy_call): Fix code reserving
+ inferior stack space - the stack needs to grow upwards.
+ (hppa32_frame_align): New function.
+ (hppa64_frame_align): Replace hppa_frame_align.
+ (hppa_gdbarch_init): Update.
+
+2004-02-26 Orjan Friberg <orjanf@axis.com>
+
+ * cris-tdep.c (frame_unwind.h, frame-base.h, trad-frame.h)
+ (dwarf2-frame.h): Include.
+ (enum cris_regnums): New enum CRIS_FP_REGNUM.
+ Remove static variables related to ABI setting.
+ (struct gdbarch_tdep): Remove cris_abi member.
+ (struct frame_extra_info): Remove.
+ (cris_unwind_cache, stack_item): New structs.
+ (cris_frame_unwind, cris_frame_base): New variables.
+ (push_stack_item, pop_stack_item)
+ (cris_frame_unwind_cache, cris_frame_this_id)
+ (cris_frame_prev_register, cris_unwind_dummy_id, cris_frame_align)
+ (cris_push_dummy_code, cris_push_dummy_call, cris_frame_sniffer)
+ (cris_frame_base_address, cris_scan_prologue, cris_unwind_pc)
+ (cris_unwind_sp, cris_store_return_value, cris_extract_return_value)
+ (cris_reg_struct_has_addr): New functions.
+ (cris_examine, cris_frame_init_saved_regs, cris_frame_chain)
+ (cris_frame_saved_pc, cris_saved_pc_after_call,
+ (cris_store_struct_return, cris_frameless_function_invocation)
+ (cris_pop_frame, cris_skip_prologue_main)
+ (cris_abi_original_store_return_value)
+ (cris_abi_v2_store_return_value)
+ (cris_abi_original_extract_return_value)
+ (cris_abi_v2_extract_return_value)
+ (cris_abi_original_reg_struct_has_addr)
+ (cris_abi_v2_reg_struct_has_addr)
+ (cris_abi_original_push_arguments, cris_abi_v2_push_arguments)
+ (cris_push_return_address, cris_abi_update): Remove.
+ (_initialize_cris_tdep): Remove ABI command.
+ (cris_dump_tdep): Ditto.
+ (cris_gdbarch_init): Remove ABI command.
+ Set store_return_value, extract_return_value, push_dummy_code,
+ push_dummy_call, frame_align, unwind_pc, unwind_sp, unwind_dummy_id,
+ frame_unwind_append_sniffer, frame_base_set_default.
+ Clear deprecated init_frame_pc, push_arguments, store_return_value,
+ extract_return_value, fp_regnum, pc_in_call_dummy, call_dummy_words,
+ sizeof_call_dummy_words, get_saved_register, push_return_address,
+ pop_frame, store_struct_return, frame_init_saved_regs,
+ init_extra_frame_info, frameless_function_invocation, frame_chain,
+ frame_saved_pc, saved_pc_after_call, save_dummy_frame_tos,
+ dummy_write_sp.
+
+2004-02-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * valprint.h (print_hex_chars, print_char_chars): New prototypes.
+ * valprint.c (print_hex_chars): Change from static to external.
+ (print_char_chars): New function.
+ * printcmd.c (print_scalar_formatted): For integer and enum types
+ that are longer than LONGEST, perform processing via appropriate
+ print_*_chars routines.
+
+2004-02-26 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in: Update dependencies.
+ Changes from Ulrich Weigand,
+ * s390-tdep.c: Include "dwarf2-frame.h".
+ (s390_dwarf2_frame_init_reg): New function.
+ (s390_gdbarch_init): Install dwarf2_frame_sniffer and
+ dwarf2_frame_base_sniffer. Call dwarf2_frame_set_init_reg.
+
+2004-02-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * breakpoint.c (pending_break_support): New setting variable.
+ (break_command_1): Account for pending_break_support setting
+ when creating pending breakpoints.
+ (set_breakpoint_cmd, show_breakpoint_cmd): New functions.
+ (_initialize_breakpoint): Add "set breakpoint pending" and
+ "show breakpoint pending" commands.
+
+2004-02-26 Andrew Cagney <cagney@redhat.com>
+
+ Fix PR i18n/1570.
+ * charset.c (backslashable, backslashed, represented): Remove 'e'
+ from list of escaped characters, not part of ISO-C.
+
+2004-02-25 J. Brobecker <brobecker@gnat.com>
+
+ From Peter Schauer <schauer@pdf.de>:
+ * tui/tui.c: Move system header includes after local includes.
+ Fixes a build failure on solaris systems.
+
+2004-02-25 J. Brobecker <brobecker@gnat.com>
+
+ * configure.in: Refine the previous change.
+ * configure: Regenerate.
+
+2004-02-25 Mark Kettenis <kettenis@gnu.org>
+
+ * amd64-tdep.h: Renamed from x86-64-tdep.h.
+ * amd64-tdep.c: Renamed from x86-64-tdep.c. Include
+ "amd64-tdep.h" instead of "x86-64-tdep.h".
+ * amd64-nat.c: Include "amd64-tdep.h" instead of "x86-64-tdep.h".
+ * amd64-linux-tdep.h: Renamed from x86-64-linux.h.
+ * amd64-linux-tdep.c: Renamed from x86-64-linux-tdep.c. Include
+ "amd64-tdep.h" and "amd64-linux-tdep.h" instead of "x86-64-tdep.h"
+ and "x86-64-tdep.c".
+ * amd64-linux-nat.c: Renamed from x86-64-linux-nat.c. Include
+ "amd64-tdep.h" and "amd64-linux-tdep.h" instead of "x86-64-tdep.h"
+ and "x86-64-tdep.c".
+ * amd64bsd-nat.c: Update copyright year.
+ Include "amd64-tdep.h" instead of "x86-64-tdep.h".
+ * amd64fbsd-tdep.c: Include "amd64-tdep.h" instead of
+ "x86-64-tdep.h".
+ * amd64fbsd-nat.c: Include "amd64-tdep.h" instead of
+ "x86-64-tdep.h".
+ * amd64nbsd-tdep.c: Include "amd64-tdep.h" instead of
+ "x86-64-tdep.h".
+ * amd64nbsd-nat.c: Include "amd64-tdep.h" instead of
+ "x86-64-tdep.h".
+ * amd64obsd-tdep.c: Include "amd64-tdep.h" instead of
+ "x86-64-tdep.h".
+ * amd64obsd-nat.c: Include "amd64-tdep.h" instead of
+ "x86-64-tdep.h".
+ * configure.host: (x86_64-*-linux*): Set gdb_target to linux64.
+ * configure.tgt (x86_64-*-linux*): Set gdb_target to linux64.
+ * Makefile.in (amd64_linux_tdep_h): Renamed from
+ x86_64_linux_tdep_h.
+ (amd64_tdep_h): Renamed from x86_64_tdep_h.
+ (amd64bsd-nat.o, amd64fbsd-nat.o, amd64fbsd-tdep.o, amd64-nat.o)
+ (amd64nbsd-nat.o, amd64nbsd-tdep.o, amd64obsd-nat.o)
+ (amd64obsd-tdep.o): Update dependencies.
+ (amd64-tdep.o, amd64-linux-nat.o, amd64-linux-tdep.o): New
+ dependencies.
+ (x86-64-linux-nat.o, x86-64-linux-tdep.o, x86-64-tdep.o): Remove
+ dependencies.
+ (ALLDEPFILES): Add amd64-tdep.c, amd64obsd-nat.c, amd64obsd-nat.c,
+ amd64-linux-nat.c amd64-linux-tdep.c.
+ * config/i386/tm-linux64.h: Renamed from tm-x86-64linux.h
+ * config/i386/nm-linux64.h: Renamed from nm-x86-64linux.h.
+ * config/i386/linux64.mt: Renamed from x86-64linux.mt.
+ (TDEPFILES): Replace x86-64-tdep.o and x86-64-linux-tdep.o with
+ amd64-tdep.o and amd64-linux-tdep.o.
+ (TM_FILE): Set to tm-linux64.h.
+ * config/i386/linux64.mh: Renamed from x86-64linux.mh.
+ (NAT_FILE): Set to nm-linux64.h.
+ (NATDEPFILES): Replace x86-64-linux-nat.o with amd64-linux-nat.o.
+ * config/i386/fbsd64.mt (TDEPFILES): Replace x86-64-tdep.o with
+ amd64-tdep.o.
+ * config/i386/nbsd64.mt (TDEPFILES): Replace x86-64-tdep.o with
+ amd64-tdep.o.
+ * config/i386/obsd64.mt (TDEPFILES): Replace x86-64-tdep.o with
+ amd64-tdep.o.
+
+2004-02-25 Roland McGrath <roland@redhat.com>
+
+ * remote.c (remote_protocol_qPart_auxv): New variable.
+ (init_all_packet_configs): Initialize it.
+ (set_remote_protocol_qPart_auxv_packet_cmd): New function.
+ (show_remote_protocol_qPart_auxv_packet_cmd): New function.
+ (show_remote_cmd): Call it.
+ (_initialize_remote): Initialize commands.
+ (remote_xfer_partial): If enabled, use qPart:auxv:read:... query to
+ service TARGET_OBJECT_AUXV requests.
+
+2004-02-25 J. Brobecker <brobecker@gnat.com>
+
+ * configure.in: Make sure that the wborder function is available.
+ Otherwise, search for it in the cur_colr library.
+ * configure: Regenerate.
+
+2004-02-25 Andrew Cagney <cagney@redhat.com>
+
+ * hppa-tdep.c (hppa32_push_dummy_call): Rewrite.
+
+2004-02-25 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-x86-64linux.h: Tweak comments.
+
+2004-02-25 Richard Sandiford <rsandifo@redhat.com>
+
+ * MAINTAINERS: Add self to write-after-approval list.
+
+2004-02-25 Andrew Cagney <cagney@redhat.com>
+
+ PR cli/1566. Problem found, and fix suggested by David Allan.
+ * cli/cli-script.c (execute_control_command): Unconditionally
+ install a cleanup. Default "ret" to "invalid_control". Use
+ "break" instead of "return" to escape from the switch.
+
+2004-02-24 J. Brobecker <brobecker@gnat.com>
+
+ * tui/tui-disasm.c: %s/lines/asm_lines/g to avoid a collision
+ with the lines macro defined in term.h on AiX.
+ * tui/tui-regs.c: %s/label_width/tui_label_width/g, to avoid
+ a collision with the label_width macro defined in term.h on AiX.
+
+2004-02-23 David Mosberger <davidm@hpl.hp.com>
+
+ Committed by Kevin Buettner <kevinb@redhat.com>.
+
+ * ia64-tdep.h (ia64_write_pc, ia64_linux_write_pc): Declare.
+ * ia64-tdep.c (ia64_write_pc): Make it a global function.
+ (ia64_gdbarch_init): For Linux targets, use ia64_linux_write_pc()
+ instead of ia64_write_pc().
+ * ia64-linux-tdep.c (regcache.h): Include.
+ (ia64_linux_write_pc): New function.
+
+2004-02-23 Roland McGrath <roland@redhat.com>
+
+ * auxv.c (info_auxv_command): Fix typos in error messages.
+
+2004-02-23 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-tdep.h: Tweak comment.
+ (enum amd64_regnum): New.
+ (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM)
+ (X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM)
+ (X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM)
+ (X86_64_XMM1_REGNUM): Removed.
+ (AMD64_NUM_GREGS): Renamed from X86_64_NUM_GREGS.
+ (amd64_init_abi, amd64_supply_fxsave, amd64_fill_fxsave): Adjust
+ prototypes for renamed functions.
+ * x86-64-tdep.c: Fix typo.
+ (amd64_dwarf_regmap): Use constants from `enum amd64_regnum' for
+ register numbers.
+ (amd64_return_value, amd64_push_arguments, amd64_push_dummy_call):
+ Use constants from `enum amd64_regnum' for register numbers.
+ (AMD64_NUM_SAVED_REGS): Adjust for renamed macros.
+ (amd64_analyze_prologue, amd64_frame_cache,
+ amd64_sigtramp_frame_cache): Use constants from `enum
+ amd64_regnum' for register numbers.
+ (amd64_supply_fpregset): Adjust for renamed functions.
+ (amd64_init_abi): Rename from x86_64_init_abi. Use constants from
+ `enum amd64_regnum' for register numbers.
+ (I387_ST0_REGNUM): Use constant from `enum amd64_regnum'.
+ (amd64_supply_fxsave): Rename from x86_64_supply_fxsave.
+ (amd64_fill_fxsave): Rename fro x86_64_fill_fxsave.
+ * x86-64-linux-tdep.c (amd64_linux_supply_gregset)
+ (amd64_linux_fill_gregset): Adjust for renamed macros.
+ (fetch_core_registers): Adjust for renamed functions.
+ (amd64_linux_init_abi): Adjust for renamed functions.
+ * x86-64-linux-nat.c (supply_gregset, fill_gregset): Adjust for
+ renamed functions.
+ * amd64-nat.c: Adjust for renamed macros.
+ * amd64bsd-nat.c (fetch_inferior_registers)
+ (store_inferior_registers): Use constants from `enum amd64_regnum'
+ for register numbers. Adjust for renamed variables.
+ * amd64fbsd-nat.c (supply_gregset, fill_gregset): Adjust for
+ renamed variables.
+ (_initialize_amd64fbsd_nat): Use constants from `enum
+ amd64_regnum' for register numbers.
+ * amd64fbsd-tdep.c (amd64fbsd_sigcontext_addr): Use constants from
+ `enum amd64_regnum' for register numbers.
+ (amd64fbsd_init_abi): Adjust for renamed functions.
+ * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Use constants from
+ `enum amd64_regnum' for register numbers.
+ (amd64nbsd_init_abi): Adjust for renamed functions.
+ (_initialize_amd64nbsd_ndep): Adjust for renamed macros.
+ * amd64obsd-tdep.c (amd64obsd_sigcontext_addr): Use constants from
+ `enum amd64_regnum' for register numbers.
+ (amd64obsd_init_abi): Adjust for renamed functions.
+ (_initialize_amd64obsd_ndep): Adjust for renamed macros.
+
+2004-02-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * breakpoint.c (print_one_breakpoint): Do not output spaces
+ after printing <PENDING> for a pending breakpoint.
+
+2004-02-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * printcmd.c (print_scalar_formatted): Initialize val_long
+ to remove compiler warning message.
+
+2004-02-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * defs.h (nquery, yquery): New prototypes.
+ * breakpoint.c (break_command_1): Use new nquery interface.
+ * utils.c (defaulted_query, nquery, yquery): New functions.
+
+2004-02-23 Andrew Cagney <cagney@redhat.com>
+
+ * hppa-tdep.c (hppa_frame_align): New function.
+ (hppa32_push_dummy_call): New function.
+ (hppa64_push_dummy_call): New function.
+ (hppa_gdbarch_init): Set frame_align and push_dummy_call; keep
+ disabled.
+
+ * infcall.c (legacy_push_dummy_code): Don't call deprecated
+ FIX_CALL_DUMMY when push_dummy_call is available.
+ (call_function_by_hand, push_dummy_code): Ditto.
+
+2004-02-22 Andrew Cagney <cagney@redhat.com>
+
+ * config/pa/tm-hppa.h (CALL_DUMMY_LOCATION): Delete macro.
+ (DEPRECATED_PC_IN_CALL_DUMMY): Delete macro.
+ (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Delete macro.
+ * hppa-tdep.c (hppa_gdbarch_init): Clear deprecated
+ use_generic_dummy_frames, set deprecated pc_in_call_dummy, set
+ call_dummy_location to ON_STACK.
+
+2004-02-22 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-linux-tdep.c: Tweak comment.
+ (amd64_linux_supply_gregset): Renamed from
+ x86_64_linux_supply_gresget.
+ (amd64_linux_fill_gregset): Renamed from
+ x86_64_linux_fill_gregset.
+ (fetch_core_registers): Adjust for renamed functions.
+ (amd64_core_fns): Renamed from x86_64_core_fns.
+ (amd64_linux_sigtramp_start): Renamed from
+ x86_64_linux_sigtramp_start.
+ (amd64_linux_pc_in_sigtramp): Renamed from
+ x86_64_linux_pc_in_sigtramp. Adjust for renamed functions.
+ (AMD64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Renamed from
+ X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET.
+ (amd64_linux_sigcontext_addr): Renamed from
+ x86_64_linux_sigcontext_addr.
+ (amd64_linux_sc_reg_offset): Renamed from
+ x86_64_linux_sc_reg_offset.
+ (amd64_linux_init_abi): Renamed from x86_64_linux_init_abi.
+ Adjust for renamed functions and variables.
+ (_initialize_amd64_linux_tdep): Renamed from
+ _initialize_x86_64_linux_tdep. Adjust for renamed functions and
+ variables.
+ * x86-64-linux-tdep.h: Update copyright year. Tweak comment.
+ Adjust for renamed functions.
+
+ * x86-64-linux-nat.c (amd64_linux_gregset64_reg_offset): Rename
+ from x86_64_linux_gregset64_reg_offset.
+ (amd64_linux_gregset32_reg_offset): Rename from
+ x86_64_linux_gregset64_reg_offset.
+ (amd64_linux_dr_get): Renamed from x86_64_linux_dr_get.
+ (amd64_linux_dr_set): Renamed from x86_64_linux_dr_set.
+ (amd64_linux_dr_set_control): Renamed from
+ x86_64_linux_dr_set_control. Adjust for renamed functions.
+ (amd64_linux_dr_set_addr): Renamed from x86_64_linux_dr_set_addr.
+ Adjust for renamed functions.
+ (amd64_linux_dr_reset_addr): Renamed from
+ x86_64_linux_dr_reset_addr. Adjust for renamed functions.
+ (amd64_linux_dr_get_status): Renamed from
+ x86_64_linux_dr_get_status. Adjust for renamed functions.
+ (_initialize_amd64_linux_nat): Renamed from
+ _initialize_x86_64_linux_nat. Adjust for renamed variables and
+ functions.
+ * config/i386/nm-x86-64linux.h: Update copyright year.
+ Adjust for renamed functions.
+
+ * amd64fbsd-tdep.c (amd64fbsd_sigtramp_start_addr): Renamed from
+ amd64fbsd_sigtramp_start.
+ (amd64fbsd_sigtramp_end_addr): Renamed from
+ amd64fbsd_sigtramp_end.
+ (amd64fbsd_init_abi): Adjust for renamed variables.
+ * amd64fbsd-nat.c (_initialize_amd64fbsd_nat): Adjust for renamed
+ variables.
+ * x86-64-tdep.h (amd64fbsd_sigtramp_start_addr): Renamed from
+ amd64fbsd_sigtramp_start.
+ (amd64fbsd_sigtramp_end_addr): Renamed from
+ amd64fbsd_sigtramp_end.
+
+2004-02-22 Andrew Cagney <cagney@redhat.com>
+
+ * hppa-tdep.c (hppa32_return_value): New function.
+ (hppa64_return_value): New function.
+ (hppa_gdbarch_init): Set return_value; keep disabled.
+
+ * hppa-tdep.c (hppa_gdbarch_init): Re-order separating
+ struct-return and inferior function call methods.
+
+ * hppa-tdep.c: Include "trad-frame.h", "frame-unwind.h", and
+ "frame-base.h".
+ (struct hppa_frame_cache): Define.
+ (hppa_frame_cache, hppa_frame_this_id): New functions.
+ (hppa_frame_prev_register): New function.
+ (hppa_frame_unwind, hppa_frame_base): New variables.
+ (hppa_frame_unwind_sniffer): New function.
+ (hppa_frame_base_address, hppa_unwind_pc): New function.
+ (hppa_gdbarch_init): Set unwind_dummy_id, unwind_pc, frame unwind
+ sniffer, and frame base sniffer; keep disabled.
+ (hppa_frame_base_sniffer, hppa_unwind_dummy_id): New functions.
+ * Makefile.in: Update dependencies, fix s/nbsd/obsd/ typo.
+
+ * frame-unwind.c (frame_unwind_find_by_frame): Add legacy_frame_p
+ to predicates for "seriously old code".
+
+ * hppa-tdep.c (hppa_gdbarch_init): Convert compile time #if0s into
+ runtime if(0).
+
+ * hppa-tdep.c (hppa_breakpoint_from_pc): Make "breakpoint"
+ unsigned.
+ (hppa_frame_find_saved_regs): Fix "std" instruction pattern
+
+ * config/pa/tm-hppa.h: Update copyright.
+ (DEPRECATED_INIT_FRAME_PC): Delete macro.
+ (deprecated_init_frame_pc_default): Delete declaration.
+ (hppa_frame_init_saved_regs): Delete declaration.
+ (DEPRECATED_FRAME_INIT_SAVED_REGS): Delete macro.
+ * hppa-tdep.c: Include "arch-utils.h".
+ (hppa_gdbarch_init): Set deprecated init_frame_pc
+ and deprecated frame_init_saved_regs.
+ (hppa_frame_init_saved_regs): Make static.
+
+2004-02-22 Mark Kettenis <kettenis@gnu.org>
+
+ Remove old 386BSD support.
+ * NEWS (REMOVED configurations and files): Add i[3456]86-*-bsd*.
+ * configure.host: Remove i[34567]86-*-bsd*.
+ * configure.tgt: Remove i[34567]86-*-bsd*.
+ * i386b-nat.c: Removed.
+ * Makefile.in (ALLDEPFILES): Remove i386b-nat.c.
+ (i386b-nat.o): Remove dependencies.
+
+ * config/i386/i386bsd.mh: Removed.
+ * config/i386/i386bsd.mt: Removed.
+ * config/i386/nm-i386bsd.h: Removed.
+ * config/i386/tm-i386bsd.h: Removed.
+ * config/i386/xm-i386bsd.h: Removed.
+
+ * x86-64-tdep.h (amd64obsd_r_reg_offset): New extern declaration.
+
+ * amd64fbsd-tdep.c: Include "solib-svr4.h".
+ (amd64fbsd_init_abi): Set link map offsets.
+ * amd64nbsd-tdep.c: Include "slib-svr4.h".
+ (amd64nbsd_init_abi): Set link map offsets.
+ * amd64obsd-tdep.c: Include "solib-svr4.h".
+ (amd64obsd_init_abi): Set link map offsets.
+ * i386fbsd-tdep.c: Include "solib-svr4.h".
+ (i386fbsd_init_abi): Set link map offsets.
+ * i386nbsd-tdep.c: Include "solib-svr4.h".
+ (i386nbsdelf_init_abi): Set link map offsets.
+ * Makefile.in (amd64fbsd-tdep.o, amd64nbsd-tdep.o)
+ (amd64obsd-tdep.o, i386fbsd-tdep.o): Update dependencies.
+ * config/i386/fbsd.mh (NATDEPFILES): Remove solib.o, solib-svr4.o,
+ solib-legacy.o and core-aout.o. Reformat.
+ * config/i386/fbsd64.mh (NATDEPFILES): Remove solib.o,
+ solib-svr4.o, solib-legacy.o. Reformat.
+ * config/i386/nbsdaout.mh (NATDEPFILES): Add solib.o. Reformat.
+ * config/i386/nbsdelf.mh: Reformat.
+ * config/i386/nbsd64.mh (NATDEPFILES): Remove solib.o,
+ solib-svr4.o, solib-legacy.o and corelow.o.
+ * config/i386/obsd.mh, config/i386/obsdaout.mh: Reformat.
+ * config/i386/obsd64.mh (NATDEPFILES): Remove solib.o,
+ solib-svr4.o, solib-legacy.o and corelow.o. Reformat.
+ * config/i386/fbsd.mt (TDEPFILES): Add solib.o, solib-svr4.o.
+ * config/i386/fbsd64.mt (TDEPFILES): Add solib.o, solib-svr4.o.
+ (TM_FILE): Set to tm-fbsd.h.
+ * config/i386/nbsd.mt (TDEPFILES): Reformat.
+ * config/i386/nbsd64.mt (TDEPFILES): Add corelow.o, solib.o and
+ solib-svr4.o.
+ * config/i386/obsd.mt (TDEPFILES): Add corelow.o, solib.o and
+ solib-svr4.o.
+ (TM_FILE): Set to nm-nbsd.h.
+ * config/i386/nm-fbsd.h: Update copyright year. Tweak comments.
+ Simplify shared library support. Don't include "elf/common.h".
+ (SVR4_SHARED_LIBS): Don't define.
+ * config/i386/nm-fbsd64.h: Update copyright year. Don't include
+ "solib.h".
+ * config/i386/nm-nbsd.h, config/i386/nm-nbsdaout.h,
+ config/i386/nm-obsd.h: Update copyright year. Tweak comments.
+ * config/i386/tm-fbsd.h: Update copyright tear. Tweak comments.
+ Don't include "i386/tm-i386.h". Include "solib.h".
+ * config/i386/tm-nbsd.h: Update copyright year. Tweak comments.
+ Don't include "i386/tm-i386.h".
+ * config/i386/xm-i386.h: Update copyright year. Tweak comments.
+ * config/i386/xm-nbsd.h: Update copyright year. Tweak comments.
+ Include "i386/xm-i386.h".
+ (HOST_LONG_DOUBLE_FORMAT): Remove.
+
+ Fix OpenBSD/i386 sigtramp recognition.
+ * i386-tdep.h: Update copyright year.
+ (i386bsd_pc_in_sigtramp, i386bsd_sigtramp_start)
+ (i386bsd_sigtramp_end): New prototypes.
+ (i386fbsd_sigtramp_start_addr): Renamed from
+ i386fbsd_sigtramp_start.
+ (i386fbsd_sigtramp_end_addr): Renamed from i386fbsd_sigtramp_end.
+ (i386obsd_sigtramp_start_addr): Renamed from
+ i386obsd_sigtramp_start.
+ (i386obsd_sigtramp_end_addr): Renamed from i386obsd_sigtramp_end.
+ * i386bsd-tdep.c: Update copyright year.
+ (i386bsd_pc_in_sigtramp): Make public.
+ * i386fbsd-nat.c: Update copyright year.
+ (_initialize_i386fbsd_nat): Adjust for renamed variables.
+ * i386fbsd-tdep.c: Update copyright year.
+ (i386fbsd_sigtramp_start_addr): Renamed from
+ i386fbsd_sigtramp_start.
+ (i386fbsd_sigtramp_end_addr): Renamed from i386fbsd_sigtramp_end.
+ (i386fbsdaout_init_abi): Adjust for renamed variables.
+ * i386obsd-nat.c: Update copyright year.
+ (_initialize_i386obsd_nat): Adjust for renamed variables.
+ * i386obsd-tdep.c: Include "target.h".
+ (i386obsd_page_size): New variable.
+ (i386obsd_pc_in_sigtramp, i386obsd_sigtramp_start)
+ (i386obsd_sigtramp_end): New functions.
+ (i386obsd_sigtramp_start_addr): Renamed from
+ i386obsd_sigtramp_start.
+ (i386obsd_sigtramp_end_addr): Renamed from i386obsd_sigtramp_end.
+ (i386obsd_init_abi): Adjust for renamed variables. Set
+ pc_in_sigtramp, sigtramp_start and sigtramp_end.
+ * Makefile.in (i386obsd-tdep.o): Update dependencies.
+
+ * amd64obsd-tdep.c (amd64obsd_pc_in_sigtramp): Adjust for signal
+ trampoline change in OpenBSD kernel.
+
+ * amd64-nat.c: Update copyright year.
+ (amd64_supply_native_gregset, amd64_collect_native_gregset): Use
+ architecture from REGCACHE.
+
+ * x86-64-linux-nat.c (x86_64_linux_gregset32_reg_offset): Use
+ symbolic constants from <sys/reg.h> instead of hard-coded numbers.
+
2004-02-21 Mark Kettenis <kettenis@gnu.org>
+ * configure.host: Add i[34567]86-*-openbsd[0-2].* and
+ i[34567]86-*-openbsd3.[0-3].
+ * config/i386/obsdaout.mh: New file.
+
+ * config/i386/obsd.mh (MH_FLAGS): Remove.
+
Fix PR build/1549.
* i386obsd-tdep.c: Update copyright years. Include
"solib-svr4.h".
@@ -92,7 +714,7 @@
pc. Update comments.
2004-02-19 Elena Zannoni <ezannoni@redhat.com>
-
+
* event-top.c (async_request_quit): Remove uses of REQUEST_QUIT
macro, which was part of the now removed Mach 3 port.
* utils.c (request_quit): Ditto.
@@ -137,7 +759,7 @@
amd64nbsd-tdep.c.
* i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Make
- static. Remove extraneous whitespace.
+ static. Remove extraneous whitespace.
* i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Make
static.
@@ -149,7 +771,7 @@
Committed by Jim Blandy <jimb@redhat.com>.
- * eval.c (evaluate_subexp_standard, case OP_OBJC_MSGCALL): Use
+ * eval.c (evaluate_subexp_standard, case OP_OBJC_MSGCALL): Use
CORE_ADDR as type for selectors. Correct types for GNU run time
message lookup function to use double indirection.
* objc-lang.c (lookup_child_selector): Use CORE_ADDR as return type.
@@ -172,7 +794,7 @@
(S390_SIGCONTEXT_SREGS_OFFSET, S390X_SIGCONTEXT_SREGS_OFFSET,
S390_SIGREGS_FP0_OFFSET, S390X_SIGREGS_FP0_OFFSET,
S390_UC_MCONTEXT_OFFSET, S390X_UC_MCONTEXT_OFFSET,
- S390_SIGNAL_FRAMESIZE,
+ S390_SIGNAL_FRAMESIZE,
s390_NR_sigreturn, s390_NR_rt_sigreturn): Remove.
(struct frame_extra_info): Remove.
(s390_memset_extra_info): Remove.
@@ -260,7 +882,7 @@
(s390_extract_return_value, s390_store_return_value): Remove.
(s390_return_value_convention, s390_return_value): New functions.
(is_float_singleton): Handle typedefs.
- (is_double_or_float, is_double_arg, is_simple_arg, pass_by_copy_ref):
+ (is_double_or_float, is_double_arg, is_simple_arg, pass_by_copy_ref):
Remove, replace by ...
(s390_function_arg_pass_by_reference, s390_function_arg_float,
s390_function_arg_integer): ... these new functions.
@@ -285,7 +907,7 @@
set_gdbarch_push_dummy_call,
set_gdbarch_unwind_dummy_id,
set_gdbarch_return_value.
-
+
* config/s390/nm-linux.h: Update comments.
(target_insert_watchpoint, target_remove_watchpoint): Redefine.
(STOPPED_BY_WATCHPOINT): Redefine.
@@ -297,7 +919,7 @@
(watch_area): Remove typedef.
Global replace watch_area by struct watch_area.
(watch_area_cnt, watch_lo_addr, watch_hi_addr): Remove.
- (s390_stopped_by_watchpoint): Remove pid argument,
+ (s390_stopped_by_watchpoint): Remove pid argument,
use s390_inferior_tid. Add short-cut for the no watchpoint case.
(s390_fix_watch_points): Remove pid argument,
use s390_inferior_tid. Recompute area spanned by watchpoints.
@@ -307,7 +929,7 @@
* config/s390/nm-linux.h: Update comments. Do not include "solib.h".
(KERNEL_U_ADDR, REGISTER_U_ADDR, U_REGS_OFFSET): Remove.
(FETCH_INFERIOR_REGISTERS): Define.
- * config/s390/s390.mh (NATDEPFILES): Remove core-aout.o and
+ * config/s390/s390.mh (NATDEPFILES): Remove core-aout.o and
core-regset.o.
* config/s390/s390x.mt: Remove.
* config/s390/tm-s390.h: Remove.
@@ -319,7 +941,7 @@
* regformats/reg-s390.dat: Remove control registers.
* regformats/reg-s390x.dat: Likewise.
* s390-tdep.h: New file.
- * s390-nat.c: Do not include <asm/processor.h> or <value.h>.
+ * s390-nat.c: Do not include <asm/processor.h> or <value.h>.
Include "inferior.h" and "s390-tdep.h".
Remove private definition of offsetof.
(s390_register_u_addr): Remove.
@@ -367,10 +989,10 @@
Replace S390_FP_REGNUM by S390_SP_REGNUM.
Remove calls to:
set_gdbarch_deprecated_max_register_raw_size,
- set_gdbarch_deprecated_max_register_virtual_size,
- set_gdbarch_deprecated_register_byte,
+ set_gdbarch_deprecated_max_register_virtual_size,
+ set_gdbarch_deprecated_register_byte,
set_gdbarch_cannot_fetch_register,
- set_gdbarch_cannot_store_register,
+ set_gdbarch_cannot_store_register,
set_gdbarch_deprecated_register_size,
set_gdbarch_deprecated_register_raw_size,
set_gdbarch_deprecated_register_virtual_size,
@@ -410,7 +1032,7 @@
END_PROGRESS.
2004-02-17 Elena Zannoni <ezannoni@redhat.com>
-
+
* objfiles.c (terminate_minimal_symbol_table): Add back
initialization of MSYMBOL_TYPE.
@@ -599,7 +1221,7 @@
* infrun.c (_initialize_infrun): Ditto.
* mi/mi-main.c (_initialize_mi_main): Ditto.
* gdbtypes.c (_initialize_gdbtypes): Ditto.
-
+
* solib.c (solib_map_sections): Use bfd_set_cacheable instead of
poking .cacheable directly.
* symfile.c (symfile_bfd_open): Ditto.
@@ -628,7 +1250,7 @@
* gdbarch.sh (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED): Delete.
(DEPRECATED_CALL_DUMMY_STACK_ADJUST): Delete.
(DEPRECATED_CALL_DUMMY_ADDRESS): Delete.
- * gdbarch.h, gdbarch.c: Re-generate.
+ * gdbarch.h, gdbarch.c: Re-generate.
* frame.c (deprecated_get_next_frame_hack): Delete function.
* frame.h (deprecated_get_next_frame_hack): Delete declaration.
* blockframe.c (deprecated_pc_in_call_dummy_at_entry_point):
@@ -638,13 +1260,13 @@
2004-02-14 Elena Zannoni <ezannoni@redhat.com>
* symfile.c (init_entry_point_info, entry_point_address): Move
- from here...
+ from here...
* objfiles.c (init_entry_point_info, entry_point_address):..to
here.
* symfile.h (init_entry_point_info, entry_point_address): Remove
prototypes.
* objfiles.h (init_entry_point_info, entry_point_address):Add
- prototypes.
+ prototypes.
* cris-tdep.c: Remove include of symfile.h. Add include of
objfiles.h.
* infcall.c: Ditto.
@@ -658,23 +1280,23 @@
* dbxread.c: Ditto.
* dwarf2read.c: Ditto.
* dwarfread.c: Ditto.
- * frv-tdep.c: Ditto.
+ * frv-tdep.c: Ditto.
* ia64-tdep.c: Ditto.
* mdebugread.c: Ditto.
* mipsread.c: Ditto.
- * rs6000-tdep.c: Ditto.
+ * rs6000-tdep.c: Ditto.
* s390-tdep.c: Ditto.
* sh-tdep.c: Ditto.
- * xstormy16-tdep.c: Ditto.
+ * xstormy16-tdep.c: Ditto.
* gdbarch.sh: Remove include of symfile.h.
* gdbarch.c: Regenerate.
* solib-irix.c (enable_break): Use entry_point_address().
Add comment about include file.
* xcoffread.c: Add comment about include file.
- * Makefile.in (arm-tdep.o, blockframe.o, coffread.o, cris-tdep.o)
- (dbxread.o, dwarf2read.o, dwarfread.o, frv-tdep.o, gdbarch.o)
- (ia64-tdep.o, infcall.o, mcore-tdep.o, mdebugread.o, mipsread.o)
- (mn10300-tdep.o, rs6000-nat.o, s390-tdep.o, sh64-tdep.o)
+ * Makefile.in (arm-tdep.o, blockframe.o, coffread.o, cris-tdep.o)
+ (dbxread.o, dwarf2read.o, dwarfread.o, frv-tdep.o, gdbarch.o)
+ (ia64-tdep.o, infcall.o, mcore-tdep.o, mdebugread.o, mipsread.o)
+ (mn10300-tdep.o, rs6000-nat.o, s390-tdep.o, sh64-tdep.o)
(sh-tdep.o, v850-tdep.o, xstormy16-tdep.o): Update dependencies.
2004-02-13 Andrew Cagney <cagney@redhat.com>
@@ -803,7 +1425,7 @@
(SUBDIR_GDBTK_SRCS): Fix path to gdbtk-interp.c.
2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
-
+
* ia64-tdep.c (ia64_frame_this_id): Fix tracing print statement
to use paddr functions to format ia64 addresses and long values.
(ia64_frame_prev_register, ia64_sigtramp_frame_this_id): Ditto.
@@ -853,7 +1475,7 @@
* bcache.c (bcache_xmalloc): Use obstack_init instead of
obstack_specify_allocation.
* objfiles.c (allocate_objfile): Ditto.
- * solib-sunos.c (solib_add_common_symbols)
+ * solib-sunos.c (solib_add_common_symbols)
(allocate_rt_common_objfile): Ditto.
* symfile.c (reread_symbols): Ditto.
* gdb_obstack.h: Add comment.
@@ -987,11 +1609,11 @@
* buildsym.c (free_pending_blocks, finish_block)
(record_pending_block, make_blockvector, end_symtab): Replace
symbol_obstack with objfile_obstack.
- * coffread.c (process_coff_symbol, coff_read_struct_type)
+ * coffread.c (process_coff_symbol, coff_read_struct_type)
(coff_read_enum_type): Ditto.
- * cp-namespace.c (initialize_namespace_symtab)
+ * cp-namespace.c (initialize_namespace_symtab)
(check_one_possible_namespace_symbol): Ditto.
- * dwarf2read.c (new_symbol, dwarf2_const_value, macro_start_file)
+ * dwarf2read.c (new_symbol, dwarf2_const_value, macro_start_file)
(dwarf2_symbol_mark_computed): Ditto.
* dwarfread.c (enum_type, new_symbol, synthesize_typedef): Ditto.
* elfread.c (elf_symtab_read): Ditto.
@@ -999,9 +1621,9 @@
(hpread_read_enum_type, hpread_read_function_type)
(hpread_read_doc_function_type, hpread_process_one_debug_symbol):
Ditto.
- * jv-lang.c (get_java_class_symtab, add_class_symbol)
+ * jv-lang.c (get_java_class_symtab, add_class_symbol)
(java_link_class_type): Ditto.
- * mdebugread.c (parse_symbol, psymtab_to_symtab_1, new_symtab)
+ * mdebugread.c (parse_symbol, psymtab_to_symtab_1, new_symtab)
(new_symbol): Ditto.
* minsyms.c (install_minimal_symbols): Ditto.
* objfiles.c (allocate_objfile): Remove init of symbol_obstack.
@@ -1111,7 +1733,7 @@
(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
Ditto.
* mips-tdep.c (non_heuristic_proc_desc): Ditto.
- * objfiles.c (add_to_objfile_sections)
+ * objfiles.c (add_to_objfile_sections)
(build_objfile_section_table): Ditto.
(allocate_objfile): Remove init of psymbol_obstack.
(free_objfile): Remove freeing of psymbol_obstack.
@@ -1145,14 +1767,14 @@
read_structure_scope read_enumeration, new_symbol): Replace
type_obstack with objfile_obstack.
* dwarfread.c (struct_type, enum_type): Ditto.
- * gdbtypes.c (alloc_type, alloc_type_instance, init_type)
+ * gdbtypes.c (alloc_type, alloc_type_instance, init_type)
(lookup_fundamental_type): Ditto.
* gdbtypes.h (TYPE_ALLOC): Ditto.
- * hpread.c (hpread_read_enum_type, hpread_read_function_type)
- (hpread_read_doc_function_type, hpread_read_struct_type)
- (fix_static_member_physnames, hpread_read_array_type)
+ * hpread.c (hpread_read_enum_type, hpread_read_function_type)
+ (hpread_read_doc_function_type, hpread_read_struct_type)
+ (fix_static_member_physnames, hpread_read_array_type)
(hpread_read_subrange_type, hpread_type_lookup): Ditto.
- * jv-lang.c (java_lookup_class, type_from_class, type_from_class)
+ * jv-lang.c (java_lookup_class, type_from_class, type_from_class)
(java_link_class_type): Ditto.
* mdebugread.c (parse_type): Ditto.
* objfiles.c (allocate_objfile, free_objfile): Ditto.
@@ -1161,7 +1783,7 @@
read_cpp_abbrev, read_one_struct_field): Ditto.
* symfile.c (reread_symbols): Ditto.
* symmisc.c (print_objfile_statistics): Ditto.
-
+
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui-data.h (tui_win_element): Rename TuiWinElement.
@@ -1189,7 +1811,7 @@
* tui/tui-regs.c, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
-
+
2004-02-07 Mark Kettenis <kettenis@gnu.org>
* dwarf2-frame.h: Update copyright.
@@ -1320,7 +1942,7 @@
* tui/tui-wingeneral.h: Update copyright.
(m_allBeVisible): Delete macro.
- (m_allBeInvisible): Delete macro.
+ (m_allBeInvisible): Delete macro.
(struct tui_gen_win_info): Declare.
(struct tui_win_info): Declare.
(tui_unhighlight_win): Rename unhighlightWin.
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index 204338cd71e..59249867a8b 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -385,6 +385,7 @@ Ian Roxborough irox@redhat.com
Grace Sainsbury graces@redhat.com
Kei Sakamoto sakamoto.kei@renesas.com
Mark Salter msalter@redhat.com
+Richard Sandiford rsandifo@redhat.com
Peter Schauer Peter.Schauer@regent
Andreas Schwab schwab@suse.de
Keith Seitz keiths@redhat.com
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 7e179a83d5e..83a4484f331 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -576,6 +576,8 @@ demangle_h = $(INCLUDE_DIR)/demangle.h
obstack_h = $(INCLUDE_DIR)/obstack.h
opcode_m68hc11_h = $(INCLUDE_DIR)/opcode/m68hc11.h
readline_h = $(READLINE_SRC)/readline.h
+readline_tilde_h = $(READLINE_SRC)/tilde.h
+readline_history_h = $(READLINE_SRC)/history.h
frv_desc_h = $(OPCODES_SRC)/frv-desc.h
sh_opc_h = $(OPCODES_SRC)/sh-opc.h
gdb_sim_arm_h = $(INCLUDE_DIR)/gdb/sim-arm.h
@@ -584,12 +586,6 @@ gdb_sim_frv_h = $(INCLUDE_DIR)/gdb/sim-frv.h
gdb_sim_sh_h = $(INCLUDE_DIR)/gdb/sim-sh.h
splay_tree_h = $(INCLUDE_DIR)/splay-tree.h
-readline_headers = \
- $(READLINE_SRC)/chardefs.h \
- $(READLINE_SRC)/history.h \
- $(READLINE_SRC)/keymaps.h \
- $(READLINE_SRC)/readline.h
-
#
# $BUILD/ headers
#
@@ -617,7 +613,9 @@ nm_h = @nm_h@
ada_lang_h = ada-lang.h $(value_h) $(gdbtypes_h)
alphabsd_tdep_h = alphabsd-tdep.h
alpha_tdep_h = alpha-tdep.h
+amd64_linux_tdep_h = amd64-linux-tdep.h
amd64_nat_h = amd64-nat.h
+amd64_tdep_h = amd64-tdep.h $(i386_tdep_h)
annotate_h = annotate.h $(symtab_h) $(gdbtypes_h)
arch_utils_h = arch-utils.h
arm_tdep_h = arm-tdep.h
@@ -770,8 +768,6 @@ vax_tdep_h = vax-tdep.h
version_h = version.h
wince_stub_h = wince-stub.h
wrapper_h = wrapper.h $(gdb_h)
-x86_64_linux_tdep_h = x86-64-linux-tdep.h
-x86_64_tdep_h = x86-64-tdep.h $(i386_tdep_h)
xcoffsolib_h = xcoffsolib.h
xmodem_h = xmodem.h
@@ -1307,8 +1303,11 @@ ALLDEPFILES = \
alpha-nat.c alphabsd-nat.c \
alpha-tdep.c alpha-linux-tdep.c alphabsd-tdep.c alphanbsd-tdep.c \
alpha-osf1-tdep.c alphafbsd-tdep.c alpha-mdebug-tdep.c \
- amd64-nat.c amd64bsd-nat.c amdfbsd-nat.c amd64-fbsd-tdep.c \
+ amd64-nat.c amd64-tdep.c \
+ amd64bsd-nat.c amdfbsd-nat.c amd64fbsd-tdep.c \
amd64nbsd-nat.c amd64nbsd-tdep.c \
+ amd64obsd-nat.c amd64obsd-tdep.c \
+ amd64-linux-nat.c amd64-linux-tdep.c \
arm-linux-nat.c arm-linux-tdep.c arm-tdep.c \
armnbsd-nat.c armnbsd-tdep.c \
avr-tdep.c \
@@ -1319,7 +1318,7 @@ ALLDEPFILES = \
go32-nat.c h8300-tdep.c \
hppa-tdep.c hppa-hpux-tdep.c \
hppah-nat.c hpread.c \
- i386-tdep.c i386b-nat.c i386v-nat.c i386-linux-nat.c \
+ i386-tdep.c i386v-nat.c i386-linux-nat.c \
i386v4-nat.c i386ly-tdep.c i386-cygwin-tdep.c \
i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c i386fbsd-tdep.c \
i387-tdep.c \
@@ -1519,24 +1518,36 @@ alpha-tdep.o: alpha-tdep.c $(defs_h) $(doublest_h) $(frame_h) \
$(regcache_h) $(reggroups_h) $(arch_utils_h) $(osabi_h) $(block_h) \
$(elf_bfd_h) $(alpha_tdep_h)
amd64bsd-nat.o: amd64bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
- $(gdb_assert_h) $(x86_64_tdep_h) $(amd64_nat_h)
+ $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h)
amd64fbsd-nat.o: amd64fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
- $(gdb_assert_h) $(gregset_h) $(x86_64_tdep_h) $(amd64_nat_h)
+ $(gdb_assert_h) $(gregset_h) $(amd64_tdep_h) $(amd64_nat_h)
amd64fbsd-tdep.o: amd64fbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
$(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) \
- $(x86_64_tdep_h)
+ $(amd64_tdep_h) $(solib_svr4_h)
+amd64-linux-nat.o: amd64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
+ $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
+ $(gdb_proc_service_h) $(gregset_h) $(amd64_tdep_h) \
+ $(amd64_linux_tdep_h) $(i386_linux_tdep_h) $(amd64_nat_h)
+amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \
+ $(regcache_h) $(osabi_h) $(gdb_string_h) $(amd64_tdep_h) \
+ $(amd64_linux_tdep_h)
amd64-nat.o: amd64-nat.c $(defs_h) $(gdbarch_h) $(regcache_h) \
- $(gdb_assert_h) $(i386_tdep_h) $(x86_64_tdep_h)
-amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(gdb_assert_h) $(x86_64_tdep_h) \
+ $(gdb_assert_h) $(i386_tdep_h) $(amd64_tdep_h)
+amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(gdb_assert_h) $(amd64_tdep_h) \
$(amd64_nat_h)
amd64nbsd-tdep.o: amd64nbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
- $(gdbcore_h) $(osabi_h) $(gdb_assert_h) $(nbsd_tdep_h) \
- $(x86_64_tdep_h)
-amd64obsd-nat.o: amd64nbsd-nat.c $(defs_h) $(gdb_assert_h) $(x86_64_tdep_h) \
+ $(gdbcore_h) $(osabi_h) $(gdb_assert_h) $(amd64_tdep_h) \
+ $(nbsd_tdep_h) $(solib_svr4_h)
+amd64obsd-nat.o: amd64obsd-nat.c $(defs_h) $(gdb_assert_h) $(amd64_tdep_h) \
$(amd64_nat_h)
-amd64obsd-tdep.o: amd64nbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
- $(gdbcore_h) $(osabi_h) $(regset_h) $(target_h) $(gdb_assert_h) \
- $(gdb_string_h) $(x86_64_tdep_h) $(i387_tdep_h)
+amd64obsd-tdep.o: amd64obsd-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \
+ $(osabi_h) $(regset_h) $(target_h) $(gdb_assert_h) $(gdb_string_h) \
+ $(amd64_tdep_h) $(i387_tdep_h) $(solib_svr4_h)
+amd64-tdep.o: amd64-tdep.c $(defs_h) $(arch_utils_h) $(block_h) \
+ $(dummy_frame_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
+ $(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(regcache_h) \
+ $(regset_h) $(symfile_h) $(gdb_assert_h) $(amd64_tdep_h) \
+ $(i387_tdep_h)
annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \
$(gdbtypes_h) $(breakpoint_h)
arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \
@@ -1617,7 +1628,7 @@ complaints.o: complaints.c $(defs_h) $(complaints_h) $(gdb_assert_h) \
$(command_h) $(gdbcmd_h)
completer.o: completer.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(filenames_h) $(language_h) $(cli_decode_h) $(gdbcmd_h) \
- $(completer_h)
+ $(readline_h) $(completer_h)
copying.o: copying.c $(defs_h) $(command_h) $(gdbcmd_h)
core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(regcache_h) \
$(gdb_dirent_h) $(gdb_stat_h)
@@ -1627,7 +1638,7 @@ corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \
corelow.o: corelow.c $(defs_h) $(arch_utils_h) $(gdb_string_h) $(frame_h) \
$(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \
$(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \
- $(exec_h) $(gdb_assert_h)
+ $(exec_h) $(readline_h) $(gdb_assert_h)
core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
$(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h)
cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \
@@ -1645,11 +1656,12 @@ cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \
$(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \
$(demangle_h) $(annotate_h) $(gdb_string_h) $(c_lang_h) $(target_h) \
$(cp_abi_h) $(valprint_h)
-cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \
- $(gdbtypes_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(value_h) \
- $(opcode_cris_h) $(arch_utils_h) $(regcache_h) $(gdb_assert_h) \
- $(objfiles_h) $(solib_h) $(solib_svr4_h) $(gdb_string_h) \
- $(dis_asm_h)
+cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
+ $(frame_base_h) $(trad_frame_h) $(dwarf2_frame_h) $(symtab_h) \
+ $(inferior_h) $(gdbtypes_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) \
+ $(value_h) $(opcode_cris_h) $(arch_utils_h) $(regcache_h) \
+ $(gdb_assert_h) $(objfiles_h) $(solib_h) $(solib_svr4_h) \
+ $(gdb_string_h) $(dis_asm_h)
c-typeprint.o: c-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
$(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
$(language_h) $(demangle_h) $(c_lang_h) $(typeprint_h) $(cp_abi_h) \
@@ -1722,10 +1734,11 @@ event-loop.o: event-loop.c $(defs_h) $(event_loop_h) $(event_top_h) \
$(gdb_string_h)
event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \
$(terminal_h) $(event_loop_h) $(event_top_h) $(interps_h) \
- $(gdbcmd_h)
+ $(gdbcmd_h) $(readline_h) $(readline_history_h)
exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \
$(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \
- $(exec_h) $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h)
+ $(exec_h) $(readline_h) $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) \
+ $(xcoffsolib_h)
expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(value_h) $(language_h) $(parser_defs_h) $(user_regs_h) $(target_h) \
$(gdb_string_h) $(block_h)
@@ -1800,16 +1813,17 @@ hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
$(osabi_h) $(gdb_string_h) $(frame_h)
hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \
$(value_h) $(regcache_h) $(completer_h) $(language_h) $(osabi_h) \
- $(gdb_assert_h) $(infttrace_h) $(symtab_h) $(infcall_h) $(dis_asm_h) \
- $(a_out_encap_h) $(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) \
- $(gdbcmd_h) $(target_h) $(symfile_h) $(objfiles_h) $(hppa_tdep_h)
+ $(gdb_assert_h) $(infttrace_h) $(arch_utils_h) $(symtab_h) \
+ $(infcall_h) $(dis_asm_h) $(trad_frame_h) $(frame_unwind_h) \
+ $(frame_base_h) $(a_out_encap_h) $(gdb_stat_h) $(gdb_wait_h) \
+ $(gdbcore_h) $(gdbcmd_h) $(target_h) $(symfile_h) $(objfiles_h) \
+ $(hppa_tdep_h)
hpread.o: hpread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(hp_symtab_h) \
$(syms_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \
$(complaints_h) $(gdb_stabs_h) $(gdbtypes_h) $(demangle_h) \
$(somsolib_h) $(gdb_assert_h) $(gdb_string_h)
hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) \
$(inferior_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h)
-i386b-nat.o: i386b-nat.c $(defs_h)
i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(gdb_assert_h) $(gregset_h) $(i386_tdep_h) $(i387_tdep_h)
i386bsd-tdep.o: i386bsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
@@ -1819,7 +1833,7 @@ i386-cygwin-tdep.o: i386-cygwin-tdep.c $(defs_h) $(osabi_h) $(gdb_string_h) \
i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(i386_tdep_h)
i386fbsd-tdep.o: i386fbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
- $(i386_tdep_h) $(i387_tdep_h)
+ $(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_h)
i386gnu-nat.o: i386gnu-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \
$(regcache_h) $(gdb_assert_h) $(i386_tdep_h) $(gnu_nat_h) \
$(i387_tdep_h) $(gregset_h)
@@ -1849,8 +1863,8 @@ i386-nto-tdep.o: i386-nto-tdep.c $(gdb_string_h) $(gdb_assert_h) $(defs_h) \
$(nto_tdep_h) $(osabi_h) $(i387_tdep_h)
i386obsd-nat.o: i386obsd-nat.c $(defs_h) $(i386_tdep_h)
i386obsd-tdep.o: i386obsd-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
- $(regcache_h) $(regset_h) $(osabi_h) $(gdb_assert_h) $(gdb_string_h) \
- $(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_h)
+ $(regcache_h) $(regset_h) $(osabi_h) $(target_h) $(gdb_assert_h) \
+ $(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_h)
i386-sol2-tdep.o: i386-sol2-tdep.c $(defs_h) $(value_h) $(osabi_h) \
$(i386_tdep_h)
i386-stub.o: i386-stub.c
@@ -1876,7 +1890,7 @@ ia64-aix-tdep.o: ia64-aix-tdep.c $(defs_h)
ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) \
$(target_h) $(gdbcore_h) $(regcache_h) $(gdb_wait_h) $(gregset_h)
ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(ia64_tdep_h) \
- $(arch_utils_h) $(gdbcore_h)
+ $(arch_utils_h) $(gdbcore_h) $(regcache_h)
ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \
$(arch_utils_h) $(floatformat_h) $(regcache_h) $(reggroups_h) \
$(frame_h) $(frame_base_h) $(frame_unwind_h) $(doublest_h) \
@@ -2231,9 +2245,9 @@ s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) $(inferior_h) \
s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
$(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(objfiles_h) \
$(tm_h) $(__bfd_bfd_h) $(floatformat_h) $(regcache_h) \
- $(trad_frame_h) $(frame_base_h) $(frame_unwind_h) $(reggroups_h) \
- $(regset_h) $(value_h) $(gdb_assert_h) $(dis_asm_h) $(solib_svr4_h) \
- $(s390_tdep_h)
+ $(trad_frame_h) $(frame_base_h) $(frame_unwind_h) $(dwarf2_frame_h) \
+ $(reggroups_h) $(regset_h) $(value_h) $(gdb_assert_h) $(dis_asm_h) \
+ $(solib_svr4_h) $(s390_tdep_h)
scm-exp.o: scm-exp.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(parser_defs_h) $(language_h) $(value_h) $(c_lang_h) $(scm_lang_h) \
$(scm_tags_h)
@@ -2280,7 +2294,7 @@ solib-aix5.o: solib-aix5.c $(defs_h) $(gdb_string_h) $(elf_external_h) \
solib.o: solib.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) $(symfile_h) \
$(objfiles_h) $(gdbcore_h) $(command_h) $(target_h) $(frame_h) \
$(gdb_regex_h) $(inferior_h) $(environ_h) $(language_h) $(gdbcmd_h) \
- $(completer_h) $(filenames_h) $(exec_h) $(solist_h)
+ $(completer_h) $(filenames_h) $(exec_h) $(solist_h) $(readline_h)
solib-irix.o: solib-irix.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h)
solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) $(solib_svr4_h)
@@ -2307,7 +2321,7 @@ source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \
$(command_h) $(source_h) $(gdbcmd_h) $(frame_h) $(value_h) \
$(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \
$(symfile_h) $(objfiles_h) $(annotate_h) $(gdbtypes_h) $(linespec_h) \
- $(filenames_h) $(completer_h) $(ui_out_h)
+ $(filenames_h) $(completer_h) $(ui_out_h) $(readline_h)
sparc64fbsd-nat.o: sparc64fbsd-nat.c $(defs_h) $(sparc64_tdep_h) \
$(sparc_nat_h)
sparc64fbsd-tdep.o: sparc64fbsd-tdep.c $(defs_h) $(frame_h) \
@@ -2385,8 +2399,8 @@ symfile.o: symfile.c $(defs_h) $(bfdlink_h) $(symtab_h) $(gdbtypes_h) \
$(objfiles_h) $(source_h) $(gdbcmd_h) $(breakpoint_h) $(language_h) \
$(complaints_h) $(demangle_h) $(inferior_h) $(filenames_h) \
$(gdb_stabs_h) $(gdb_obstack_h) $(completer_h) $(bcache_h) \
- $(hashtab_h) $(gdb_assert_h) $(block_h) $(gdb_string_h) \
- $(gdb_stat_h)
+ $(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \
+ $(gdb_string_h) $(gdb_stat_h)
symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \
$(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \
$(gdb_obstack_h) $(language_h) $(bcache_h) $(block_h) $(gdb_regex_h) \
@@ -2411,13 +2425,14 @@ top.o: top.c $(defs_h) $(gdbcmd_h) $(call_cmds_h) $(cli_cmds_h) \
$(inferior_h) $(target_h) $(breakpoint_h) $(gdbtypes_h) \
$(expression_h) $(value_h) $(language_h) $(terminal_h) $(annotate_h) \
$(completer_h) $(top_h) $(version_h) $(serial_h) $(doublest_h) \
- $(gdb_assert_h) $(event_top_h) $(gdb_string_h) $(gdb_stat_h) \
- $(ui_out_h) $(cli_out_h)
+ $(gdb_assert_h) $(readline_h) $(readline_history_h) $(event_top_h) \
+ $(gdb_string_h) $(gdb_stat_h) $(ui_out_h) $(cli_out_h)
tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \
$(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \
$(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \
$(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) \
- $(block_h) $(dictionary_h) $(ax_h) $(ax_gdb_h)
+ $(block_h) $(dictionary_h) $(ax_h) $(ax_gdb_h) $(readline_h) \
+ $(readline_history_h)
trad-frame.o: trad-frame.c $(defs_h) $(frame_h) $(trad_frame_h) \
$(regcache_h)
typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
@@ -2432,7 +2447,7 @@ user-regs.o: user-regs.c $(defs_h) $(user_regs_h) $(gdbtypes_h) \
utils.o: utils.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(event_top_h) \
$(tui_h) $(gdbcmd_h) $(serial_h) $(bfd_h) $(target_h) $(demangle_h) \
$(expression_h) $(language_h) $(charset_h) $(annotate_h) \
- $(filenames_h) $(inferior_h)
+ $(filenames_h) $(inferior_h) $(readline_h)
uw-thread.o: uw-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \
$(regcache_h) $(gregset_h)
v850ice.o: v850ice.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
@@ -2471,18 +2486,6 @@ wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \
$(regcache_h) $(mips_tdep_h)
wince-stub.o: wince-stub.c $(wince_stub_h)
wrapper.o: wrapper.c $(defs_h) $(value_h) $(wrapper_h)
-x86-64-linux-nat.o: x86-64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
- $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
- $(gdb_proc_service_h) $(gregset_h) $(x86_64_tdep_h) \
- $(x86_64_linux_tdep_h) $(i386_linux_tdep_h) $(amd64_nat_h)
-x86-64-linux-tdep.o: x86-64-linux-tdep.c $(defs_h) $(inferior_h) \
- $(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) \
- $(x86_64_tdep_h) $(x86_64_linux_tdep_h)
-x86-64-tdep.o: x86-64-tdep.c $(defs_h) $(arch_utils_h) $(block_h) \
- $(dummy_frame_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
- $(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(regcache_h) \
- $(regset_h) $(symfile_h) $(gdb_assert_h) $(x86_64_tdep_h) \
- $(i387_tdep_h)
xcoffread.o: xcoffread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(gdb_stat_h) \
$(coff_internal_h) $(libcoff_h) $(coff_xcoff_h) $(libxcoff_h) \
$(coff_rs6000_h) $(symtab_h) $(gdbtypes_h) $(symfile_h) \
@@ -2501,12 +2504,13 @@ xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(value_h) $(inferior_h) \
# Need to explicitly specify the compile rule as make will do nothing
# or try to compile the object file into the sub-directory.
-cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(defs_h) $(completer_h) $(target_h) \
- $(gdb_wait_h) $(gdb_regex_h) $(gdb_string_h) $(gdb_vfork_h) \
- $(linespec_h) $(expression_h) $(frame_h) $(value_h) $(language_h) \
- $(filenames_h) $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) \
- $(top_h) $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) \
- $(cli_cmds_h) $(tui_h)
+cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(defs_h) $(readline_h) \
+ $(readline_tilde_h) $(completer_h) $(target_h) $(gdb_wait_h) \
+ $(gdb_regex_h) $(gdb_string_h) $(gdb_vfork_h) $(linespec_h) \
+ $(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
+ $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
+ $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
+ $(tui_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
$(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \
@@ -2514,7 +2518,7 @@ cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-decode.c
cli-dump.o: $(srcdir)/cli/cli-dump.c $(defs_h) $(gdb_string_h) \
$(cli_decode_h) $(cli_cmds_h) $(value_h) $(completer_h) \
- $(cli_dump_h) $(gdb_assert_h) $(target_h)
+ $(cli_dump_h) $(gdb_assert_h) $(target_h) $(readline_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-dump.c
cli-interp.o: $(srcdir)/cli/cli-interp.c $(defs_h) $(interps_h) $(wrapper_h) \
$(event_top_h) $(ui_out_h) $(cli_out_h) $(top_h) $(gdb_string_h)
@@ -2526,8 +2530,8 @@ cli-script.o: $(srcdir)/cli/cli-script.c $(defs_h) $(value_h) $(language_h) \
$(ui_out_h) $(gdb_string_h) $(top_h) $(cli_cmds_h) $(cli_decode_h) \
$(cli_script_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-script.c
-cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(defs_h) $(value_h) \
- $(gdb_string_h) $(ui_out_h) $(cli_decode_h) $(cli_cmds_h) \
+cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(defs_h) $(readline_tilde_h) \
+ $(value_h) $(gdb_string_h) $(ui_out_h) $(cli_decode_h) $(cli_cmds_h) \
$(cli_setshow_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-setshow.c
cli-utils.o: $(srcdir)/cli/cli-utils.c $(defs_h) $(cli_utils_h)
@@ -2774,8 +2778,8 @@ signals.o: $(srcdir)/signals/signals.c $(server_h) $(defs_h) $(target_h) \
tui.o: $(srcdir)/tui/tui.c $(defs_h) $(gdbcmd_h) $(tui_h) $(tui_hooks_h) \
$(tui_data_h) $(tui_layout_h) $(tui_io_h) $(tui_regs_h) \
$(tui_stack_h) $(tui_win_h) $(tui_winsource_h) $(tui_windata_h) \
- $(readline_h) $(target_h) $(frame_h) $(breakpoint_h) $(inferior_h) \
- $(symtab_h) $(source_h) $(gdb_curses_h)
+ $(target_h) $(frame_h) $(breakpoint_h) $(inferior_h) $(symtab_h) \
+ $(source_h) $(gdb_curses_h) $(readline_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui.c
tui-command.o: $(srcdir)/tui/tui-command.c $(defs_h) $(tui_h) $(tui_data_h) \
$(tui_win_h) $(tui_io_h) $(gdb_curses_h) $(gdb_string_h)
@@ -2794,8 +2798,8 @@ tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(ui_file_h) $(tui_file_h) \
tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(defs_h) $(symtab_h) $(inferior_h) \
$(command_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) \
$(gdbcore_h) $(event_loop_h) $(event_top_h) $(frame_h) \
- $(breakpoint_h) $(gdb_events_h) $(ui_out_h) $(top_h) $(tui_h) \
- $(tui_hooks_h) $(tui_data_h) $(tui_layout_h) $(tui_io_h) \
+ $(breakpoint_h) $(gdb_events_h) $(ui_out_h) $(top_h) $(readline_h) \
+ $(tui_h) $(tui_hooks_h) $(tui_data_h) $(tui_layout_h) $(tui_io_h) \
$(tui_regs_h) $(tui_win_h) $(tui_stack_h) $(tui_windata_h) \
$(tui_winsource_h) $(gdb_curses_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-hooks.c
@@ -2841,7 +2845,7 @@ tui-win.o: $(srcdir)/tui/tui-win.c $(defs_h) $(command_h) $(symtab_h) \
$(breakpoint_h) $(frame_h) $(cli_cmds_h) $(top_h) $(source_h) \
$(tui_h) $(tui_data_h) $(tui_wingeneral_h) $(tui_stack_h) \
$(tui_regs_h) $(tui_disasm_h) $(tui_source_h) $(tui_winsource_h) \
- $(tui_windata_h) $(gdb_curses_h) $(gdb_string_h)
+ $(tui_windata_h) $(gdb_curses_h) $(gdb_string_h) $(readline_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-win.c
tui-windata.o: $(srcdir)/tui/tui-windata.c $(defs_h) $(tui_h) $(tui_data_h) \
$(tui_wingeneral_h) $(tui_regs_h) $(gdb_string_h) $(gdb_curses_h)
diff --git a/gdb/NEWS b/gdb/NEWS
index 8314f052ede..3671288fb03 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -1,7 +1,9 @@
What has changed in GDB?
(Organized release by release)
-*** Changes since GDB 6.0:
+*** Changes since GDB 6.1:
+
+*** Changes in GDB 6.1:
* Removed --with-mmalloc
@@ -83,6 +85,7 @@ HP/PA running BSD hppa*-*-bsd*
HP/PA running OSF/1 hppa*-*-osf*
HP/PA Pro target hppa*-*-pro*
PMAX (MIPS) running Mach 3.0 mips*-*-mach3*
+386BSD i[3456]86-*-bsd*
Sequent family i[3456]86-sequent-sysv4*
i[3456]86-sequent-sysv*
i[3456]86-sequent-bsd*
diff --git a/gdb/PROBLEMS b/gdb/PROBLEMS
index 9a0127dfd61..d3b4f845266 100644
--- a/gdb/PROBLEMS
+++ b/gdb/PROBLEMS
@@ -1,5 +1,5 @@
- Known problems in GDB 6.0
+ Known problems in GDB 6.1
See also: http://www.gnu.org/software/gdb/bugs/
diff --git a/gdb/README b/gdb/README
index d2fb8ab52ba..9a7cc05404c 100644
--- a/gdb/README
+++ b/gdb/README
@@ -1,5 +1,5 @@
- README for gdb-6.0 release
- Updated 23th June, 2003 by Andrew Cagney
+ README for gdb-6.1 release
+ Updated 29 February, 2004 by Andrew Cagney
This is GDB, the GNU source-level debugger.
@@ -20,7 +20,7 @@ Unpacking and Installation -- quick overview
In this release, the GDB debugger sources, the generic GNU include
files, the BFD ("binary file description") library, the readline
library, and other libraries all have directories of their own
-underneath the gdb-6.0 directory. The idea is that a variety of GNU
+underneath the gdb-6.1 directory. The idea is that a variety of GNU
tools can share a common copy of these things. Be aware of variation
over time--for example don't try to build gdb with a copy of bfd from
a release other than the gdb release (such as a binutils release),
@@ -29,8 +29,8 @@ Configuration scripts and makefiles exist to cruise up and down this
directory tree and automatically build all the pieces in the right
order.
- When you unpack the gdb-6.0.tar.gz file, you'll find a directory
-called `gdb-6.0', which contains:
+ When you unpack the gdb-6.1.tar.gz file, you'll find a directory
+called `gdb-6.1', which contains:
COPYING config.sub intl missing opcodes
COPYING.LIB configure libiberty mkinstalldirs readline
@@ -44,7 +44,7 @@ called `gdb-6.0', which contains:
You can build GDB right in the source directory:
- cd gdb-6.0
+ cd gdb-6.1
./configure
make
cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
@@ -58,25 +58,25 @@ You can build GDB in any empty build directory:
mkdir build
cd build
- <full path to your sources>/gdb-6.0/configure
+ <full path to your sources>/gdb-6.1/configure
make
cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
(Building GDB with DJGPP tools for MS-DOS/MS-Windows is slightly
-different; see the file gdb-6.0/gdb/config/djgpp/README for details.)
+different; see the file gdb-6.1/gdb/config/djgpp/README for details.)
This will configure and build all the libraries as well as GDB. If
`configure' can't determine your system type, specify one as its
argument, e.g., `./configure sun4' or `./configure decstation'.
- Make sure that your 'configure' line ends in 'gdb-6.0/configure':
+ Make sure that your 'configure' line ends in 'gdb-6.1/configure':
- /berman/migchain/source/gdb-6.0/configure # RIGHT
- /berman/migchain/source/gdb-6.0/gdb/configure # WRONG
+ /berman/migchain/source/gdb-6.1/configure # RIGHT
+ /berman/migchain/source/gdb-6.1/gdb/configure # WRONG
The gdb package contains several subdirectories, such as 'gdb',
'bfd', and 'readline'. If your 'configure' line ends in
-'gdb-6.0/gdb/configure', then you are configuring only the gdb
+'gdb-6.1/gdb/configure', then you are configuring only the gdb
subdirectory, not the whole gdb package. This leads to build errors
such as:
@@ -107,7 +107,7 @@ documentation and TeX (or `texi2roff') to typeset the printed version.
GDB includes an already formatted copy of the on-line Info version
of this manual in the `gdb/doc' subdirectory. The main Info file is
-`gdb-6.0/gdb/doc/gdb.info', and it refers to subordinate files
+`gdb-6.1/gdb/doc/gdb.info', and it refers to subordinate files
matching `gdb.info*' in the same directory. If necessary, you can
print out these files, or read them with any editor; but they are
easier to read using the `info' subsystem in GNU Emacs or the
@@ -119,7 +119,7 @@ Info formatting programs, such as `texinfo-format-buffer' or
`makeinfo'.
If you have `makeinfo' installed, and are in the top level GDB
-source directory (`gdb-6.0', in the case of version 6.0), you can make
+source directory (`gdb-6.1', in the case of version 6.1), you can make
the Info file by typing:
cd gdb/doc
@@ -128,7 +128,7 @@ the Info file by typing:
If you want to typeset and print copies of this manual, you need
TeX, a program to print its DVI output files, and `texinfo.tex', the
Texinfo definitions file. This file is included in the GDB
-distribution, in the directory `gdb-6.0/texinfo'.
+distribution, in the directory `gdb-6.1/texinfo'.
TeX is a typesetting program; it does not print files directly, but
produces output files called DVI files. To print a typeset document,
@@ -142,11 +142,11 @@ without any extension or a `.dvi' extension.
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.
`texinfo.tex' is distributed with GDB and is located in the
-`gdb-6.0/texinfo' directory.
+`gdb-6.1/texinfo' directory.
If you have TeX and a DVI printer program installed, you can typeset
and print this manual. First switch to the the `gdb' subdirectory of
-the main source directory (for example, to `gdb-6.0/gdb') and then type:
+the main source directory (for example, to `gdb-6.1/gdb') and then type:
make doc/gdb.dvi
@@ -169,55 +169,55 @@ preparing GDB for installation; you can then use `make' to build the
a single directory, whose name is usually composed by appending the
version number to `gdb'.
- For example, the GDB version 6.0 distribution is in the `gdb-6.0'
+ For example, the GDB version 6.1 distribution is in the `gdb-6.1'
directory. That directory contains:
-`gdb-6.0/{COPYING,COPYING.LIB}'
+`gdb-6.1/{COPYING,COPYING.LIB}'
Standard GNU license files. Please read them.
-`gdb-6.0/bfd'
+`gdb-6.1/bfd'
source for the Binary File Descriptor library
-`gdb-6.0/config*'
+`gdb-6.1/config*'
script for configuring GDB, along with other support files
-`gdb-6.0/gdb'
+`gdb-6.1/gdb'
the source specific to GDB itself
-`gdb-6.0/include'
+`gdb-6.1/include'
GNU include files
-`gdb-6.0/libiberty'
+`gdb-6.1/libiberty'
source for the `-liberty' free software library
-`gdb-6.0/mmalloc'
+`gdb-6.1/mmalloc'
source for the GNU memory-mapped malloc package
-`gdb-6.0/opcodes'
+`gdb-6.1/opcodes'
source for the library of opcode tables and disassemblers
-`gdb-6.0/readline'
+`gdb-6.1/readline'
source for the GNU command-line interface
NOTE: The readline library is compiled for use by GDB, but will
not be installed on your system when "make install" is issued.
-`gdb-6.0/sim'
+`gdb-6.1/sim'
source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc)
-`gdb-6.0/intl'
+`gdb-6.1/intl'
source for the GNU gettext library, for internationalization.
This is slightly modified from the standalone gettext
distribution you can get from GNU.
-`gdb-6.0/texinfo'
+`gdb-6.1/texinfo'
The `texinfo.tex' file, which you need in order to make a printed
manual using TeX.
-`gdb-6.0/etc'
+`gdb-6.1/etc'
Coding standards, useful files for editing GDB, and other
miscellanea.
-`gdb-6.0/utils'
+`gdb-6.1/utils'
A grab bag of random utilities.
Note: the following instructions are for building GDB on Unix or
@@ -226,14 +226,14 @@ MS-DOS/MS-Windows are in the file gdb/config/djgpp/README.
The simplest way to configure and build GDB is to run `configure'
from the `gdb-VERSION-NUMBER' source directory, which in this example
-is the `gdb-6.0' directory.
+is the `gdb-6.1' directory.
First switch to the `gdb-VERSION-NUMBER' source directory if you are
not already in it; then run `configure'.
For example:
- cd gdb-6.0
+ cd gdb-6.1
./configure
make
@@ -249,8 +249,8 @@ you may need to run `sh' on it explicitly:
sh configure
If you run `configure' from a directory that contains source
-directories for multiple libraries or programs, such as the `gdb-6.0'
-source directory for version 6.0, `configure' creates configuration
+directories for multiple libraries or programs, such as the `gdb-6.1'
+source directory for version 6.1, `configure' creates configuration
files for every directory level underneath (unless you tell it not to,
with the `--norecursion' option).
@@ -258,10 +258,10 @@ with the `--norecursion' option).
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 6.0, type the following to configure only
+ For example, with version 6.1, type the following to configure only
the `bfd' subdirectory:
- cd gdb-6.0/bfd
+ cd gdb-6.1/bfd
../configure
You can install `gdb' anywhere; it has no hardwired paths. However,
@@ -290,13 +290,13 @@ directory. If the path to `configure' would be the same as the
argument to `--srcdir', you can leave out the `--srcdir' option; it
will be assumed.)
- For example, with version 6.0, you can build GDB in a separate
+ For example, with version 6.1, you can build GDB in a separate
directory for a Sun 4 like this:
- cd gdb-6.0
+ cd gdb-6.1
mkdir ../gdb-sun4
cd ../gdb-sun4
- ../gdb-6.0/configure
+ ../gdb-6.1/configure
make
When `configure' builds a configuration using a remote source
@@ -317,8 +317,8 @@ called `configure' (or one of its subdirectories).
The `Makefile' that `configure' generates in each source directory
also runs recursively. If you type `make' in a source directory such
-as `gdb-6.0' (or in a separate configured directory configured with
-`--srcdir=PATH/gdb-6.0'), you will build all the required libraries,
+as `gdb-6.1' (or in a separate configured directory configured with
+`--srcdir=PATH/gdb-6.1'), you will build all the required libraries,
and then build GDB.
When you have multiple hosts or targets configured in separate
@@ -361,7 +361,7 @@ you can use it to test your guesses on abbreviations--for example:
Invalid configuration `i786v': machine `i786v' not recognized
`config.sub' is also distributed in the GDB source directory
-(`gdb-6.0', for version 6.0).
+(`gdb-6.1', for version 6.1).
`configure' options
@@ -491,7 +491,7 @@ As an alternative, the bug report can be submitted, via e-mail, to the
address "bug-gdb@gnu.org".
When submitting a bug, please include the GDB version number (e.g.,
-gdb-6.0), and how you configured it (e.g., "sun4" or "mach386 host,
+gdb-6.1), and how you configured it (e.g., "sun4" or "mach386 host,
i586-intel-synopsys target"). Since GDB now supports so many
different configurations, it is important that you be precise about
this. If at all possible, you should include the actual banner that
@@ -546,17 +546,17 @@ ftp://sources.redhat.com/pub/dejagnu/ will contain a recent snapshot.
Once DejaGNU is installed, you can run the tests in one of the
following ways:
- (1) cd gdb-6.0
+ (1) cd gdb-6.1
make check-gdb
or
- (2) cd gdb-6.0/gdb
+ (2) cd gdb-6.1/gdb
make check
or
- (3) cd gdb-6.0/gdb/testsuite
+ (3) cd gdb-6.1/gdb/testsuite
make site.exp (builds the site specific file)
runtest -tool gdb GDB=../gdb (or GDB=<somepath> as appropriate)
diff --git a/gdb/x86-64-linux-nat.c b/gdb/amd64-linux-nat.c
index 98d30aaa258..ec0bfb92812 100644
--- a/gdb/x86-64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -47,15 +47,15 @@
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
-#include "x86-64-tdep.h"
-#include "x86-64-linux-tdep.h"
+#include "amd64-tdep.h"
+#include "amd64-linux-tdep.h"
#include "i386-linux-tdep.h"
#include "amd64-nat.h"
/* Mapping between the general-purpose registers in GNU/Linux x86-64
`struct user' format and GDB's register cache layout. */
-static int x86_64_linux_gregset64_reg_offset[] =
+static int amd64_linux_gregset64_reg_offset[] =
{
RAX * 8, RBX * 8, /* %rax, %rbx */
RCX * 8, RDX * 8, /* %rcx, %rdx */
@@ -81,20 +81,20 @@ static int x86_64_linux_gregset64_reg_offset[] =
little-endian we get away with that. */
/* From <sys/reg.h> on GNU/Linux i386. */
-static int x86_64_linux_gregset32_reg_offset[] =
+static int amd64_linux_gregset32_reg_offset[] =
{
- 10 * 8, 11 * 8, /* %eax, %ecx */
- 12 * 8, 13 * 8, /* %edx, %ebx */
- 19 * 8, 4 * 8, /* %esp, %ebp */
- 13 * 8, 14 * 8, /* %esi, %edi */
- 16 * 8, 18 * 8, /* %eip, %eflags */
- 17 * 8, 20 * 8, /* %cs, %ss */
- 23 * 8, 24 * 8, /* %ds, %es */
- 25 * 4, 26 * 4, /* %fs, %gs */
+ RAX * 8, RCX * 8, /* %eax, %ecx */
+ RDX * 8, RBX * 8, /* %edx, %ebx */
+ RSP * 8, RBP * 8, /* %esp, %ebp */
+ RSI * 8, RDI * 8, /* %esi, %edi */
+ RIP * 8, EFLAGS * 8, /* %eip, %eflags */
+ CS * 8, SS * 8, /* %cs, %ss */
+ DS * 8, ES * 8, /* %ds, %es */
+ FS * 8, GS * 8, /* %fs, %gs */
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1,
- 15 * 8 /* "orig_eax" */
+ ORIG_RAX * 8 /* "orig_eax" */
};
/* Which ptrace request retrieves which registers?
@@ -166,7 +166,7 @@ store_regs (int tid, int regnum)
void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
- x86_64_supply_fxsave (current_regcache, -1, fpregsetp);
+ amd64_supply_fxsave (current_regcache, -1, fpregsetp);
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in
@@ -176,7 +176,7 @@ supply_fpregset (elf_fpregset_t *fpregsetp)
void
fill_fpregset (elf_fpregset_t *fpregsetp, int regnum)
{
- x86_64_fill_fxsave ((char *) fpregsetp, regnum);
+ amd64_fill_fxsave ((char *) fpregsetp, regnum);
}
/* Fetch all floating-point registers from process/thread TID and store
@@ -277,7 +277,7 @@ store_inferior_registers (int regnum)
static unsigned long
-x86_64_linux_dr_get (int regnum)
+amd64_linux_dr_get (int regnum)
{
int tid;
unsigned long value;
@@ -306,7 +306,7 @@ x86_64_linux_dr_get (int regnum)
}
static void
-x86_64_linux_dr_set (int regnum, unsigned long value)
+amd64_linux_dr_set (int regnum, unsigned long value)
{
int tid;
@@ -322,59 +322,88 @@ x86_64_linux_dr_set (int regnum, unsigned long value)
}
void
-x86_64_linux_dr_set_control (unsigned long control)
+amd64_linux_dr_set_control (unsigned long control)
{
- x86_64_linux_dr_set (DR_CONTROL, control);
+ amd64_linux_dr_set (DR_CONTROL, control);
}
void
-x86_64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{
gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
- x86_64_linux_dr_set (DR_FIRSTADDR + regnum, addr);
+ amd64_linux_dr_set (DR_FIRSTADDR + regnum, addr);
}
void
-x86_64_linux_dr_reset_addr (int regnum)
+amd64_linux_dr_reset_addr (int regnum)
{
gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
- x86_64_linux_dr_set (DR_FIRSTADDR + regnum, 0L);
+ amd64_linux_dr_set (DR_FIRSTADDR + regnum, 0L);
}
unsigned long
-x86_64_linux_dr_get_status (void)
+amd64_linux_dr_get_status (void)
{
- return x86_64_linux_dr_get (DR_STATUS);
+ return amd64_linux_dr_get (DR_STATUS);
}
+/* This function is called by libthread_db as part of its handling of
+ a request for a thread's local storage address. */
+
ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
-/* This definition comes from prctl.h, but some kernels may not have it. */
+ if (gdbarch_ptr_bit (current_gdbarch) == 32)
+ {
+ /* The full structure is found in <asm-i386/ldt.h>. The second
+ integer is the LDT's base_address and that is used to locate
+ the thread's local storage. See i386-linux-nat.c more
+ info. */
+ unsigned int desc[4];
+
+ /* This code assumes that "int" is 32 bits and that
+ GET_THREAD_AREA returns no more than 4 int values. */
+ gdb_assert (sizeof (int) == 4);
+#ifndef PTRACE_GET_THREAD_AREA
+#define PTRACE_GET_THREAD_AREA 25
+#endif
+ if (ptrace (PTRACE_GET_THREAD_AREA,
+ lwpid, (void *) (long) idx, (unsigned long) &desc) < 0)
+ return PS_ERR;
+
+ /* Extend the value to 64 bits. Here it's assumed that a "long"
+ and a "void *" are the same. */
+ (*base) = (void *) (long) desc[1];
+ return PS_OK;
+ }
+ else
+ {
+ /* This definition comes from prctl.h, but some kernels may not
+ have it. */
#ifndef PTRACE_ARCH_PRCTL
#define PTRACE_ARCH_PRCTL 30
#endif
-
- /* FIXME: ezannoni-2003-07-09 see comment above about include file order.
- We could be getting bogus values for these two. */
- gdb_assert (FS < ELF_NGREG);
- gdb_assert (GS < ELF_NGREG);
- switch (idx)
- {
- case FS:
- if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_FS) == 0)
- return PS_OK;
- break;
- case GS:
- if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_GS) == 0)
- return PS_OK;
- break;
- default: /* Should not happen. */
- return PS_BADADDR;
+ /* FIXME: ezannoni-2003-07-09 see comment above about include
+ file order. We could be getting bogus values for these two. */
+ gdb_assert (FS < ELF_NGREG);
+ gdb_assert (GS < ELF_NGREG);
+ switch (idx)
+ {
+ case FS:
+ if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_FS) == 0)
+ return PS_OK;
+ break;
+ case GS:
+ if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_GS) == 0)
+ return PS_OK;
+ break;
+ default: /* Should not happen. */
+ return PS_BADADDR;
+ }
}
return PS_ERR; /* ptrace failed. */
}
@@ -389,17 +418,17 @@ child_post_startup_inferior (ptid_t ptid)
/* Provide a prototype to silence -Wmissing-prototypes. */
-void _initialize_x86_64_linux_nat (void);
+void _initialize_amd64_linux_nat (void);
void
-_initialize_x86_64_linux_nat (void)
+_initialize_amd64_linux_nat (void)
{
- amd64_native_gregset32_reg_offset = x86_64_linux_gregset32_reg_offset;
+ amd64_native_gregset32_reg_offset = amd64_linux_gregset32_reg_offset;
amd64_native_gregset32_num_regs = I386_LINUX_NUM_REGS;
- amd64_native_gregset64_reg_offset = x86_64_linux_gregset64_reg_offset;
+ amd64_native_gregset64_reg_offset = amd64_linux_gregset64_reg_offset;
- gdb_assert (ARRAY_SIZE (x86_64_linux_gregset32_reg_offset)
+ gdb_assert (ARRAY_SIZE (amd64_linux_gregset32_reg_offset)
== amd64_native_gregset32_num_regs);
- gdb_assert (ARRAY_SIZE (x86_64_linux_gregset64_reg_offset)
+ gdb_assert (ARRAY_SIZE (amd64_linux_gregset64_reg_offset)
== amd64_native_gregset64_num_regs);
}
diff --git a/gdb/x86-64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index fee1233f4fc..9a1636a8998 100644
--- a/gdb/x86-64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1,4 +1,4 @@
-/* Target-dependent code for GNU/Linux running on x86-64, for GDB.
+/* Target-dependent code for GNU/Linux x86-64.
Copyright 2001, 2003, 2004 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
@@ -28,8 +28,8 @@
#include "gdb_string.h"
-#include "x86-64-tdep.h"
-#include "x86-64-linux-tdep.h"
+#include "amd64-tdep.h"
+#include "amd64-linux-tdep.h"
/* Register indexes to 'struct user' come from <sys/reg.h>. */
@@ -76,11 +76,11 @@ static int user_to_gdb_regmap[] =
in *GREGSETP. */
void
-x86_64_linux_supply_gregset (char *regp)
+amd64_linux_supply_gregset (char *regp)
{
int i;
- for (i = 0; i < X86_64_NUM_GREGS; i++)
+ for (i = 0; i < AMD64_NUM_GREGS; i++)
supply_register (i, regp + (user_to_gdb_regmap[i] * 8));
}
@@ -89,11 +89,11 @@ x86_64_linux_supply_gregset (char *regp)
do this for all registers. */
void
-x86_64_linux_fill_gregset (char *regp, int regno)
+amd64_linux_fill_gregset (char *regp, int regno)
{
int i;
- for (i = 0; i < X86_64_NUM_GREGS; i++)
+ for (i = 0; i < AMD64_NUM_GREGS; i++)
if (regno == -1 || regno == i)
regcache_collect (i, regp + (user_to_gdb_regmap[i] * 8));
}
@@ -114,7 +114,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size != 216)
warning ("Wrong size register set in core file.");
else
- x86_64_linux_supply_gregset (core_reg_sect);
+ amd64_linux_supply_gregset (core_reg_sect);
break;
case 2: /* Floating point registers. */
@@ -123,7 +123,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size != 512)
warning ("Wrong size XMM register set in core file.");
else
- x86_64_supply_fxsave (current_regcache, -1, core_reg_sect);
+ amd64_supply_fxsave (current_regcache, -1, core_reg_sect);
break;
default:
@@ -132,7 +132,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
}
}
-static struct core_fns x86_64_core_fns =
+static struct core_fns amd64_core_fns =
{
bfd_target_elf_flavour, /* core_flavour */
default_check_format, /* check_format */
@@ -160,7 +160,7 @@ static const unsigned char linux_sigtramp_code[] =
the routine. Otherwise, return 0. */
static CORE_ADDR
-x86_64_linux_sigtramp_start (CORE_ADDR pc)
+amd64_linux_sigtramp_start (CORE_ADDR pc)
{
unsigned char buf[LINUX_SIGTRAMP_LEN];
@@ -194,7 +194,7 @@ x86_64_linux_sigtramp_start (CORE_ADDR pc)
/* Return whether PC is in a GNU/Linux sigtramp routine. */
static int
-x86_64_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
+amd64_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
/* If we have NAME, we can optimize the search. The trampoline is
named __restore_rt. However, it isn't dynamically exported from
@@ -203,19 +203,19 @@ x86_64_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
__sigaction, or __libc_sigaction (all aliases to the same
function). */
if (name == NULL || strstr (name, "sigaction") != NULL)
- return (x86_64_linux_sigtramp_start (pc) != 0);
+ return (amd64_linux_sigtramp_start (pc) != 0);
return (strcmp ("__restore_rt", name) == 0);
}
/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
-#define X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 40
+#define AMD64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 40
/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp
routine, return the address of the associated sigcontext structure. */
static CORE_ADDR
-x86_64_linux_sigcontext_addr (struct frame_info *next_frame)
+amd64_linux_sigcontext_addr (struct frame_info *next_frame)
{
CORE_ADDR sp;
char buf[8];
@@ -229,12 +229,12 @@ x86_64_linux_sigcontext_addr (struct frame_info *next_frame)
function calls so we can't use it. Fortunately the user context
is part of the signal frame and the unwound %rsp directly points
at it. */
- return sp + X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
+ return sp + AMD64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
}
/* From <asm/sigcontext.h>. */
-static int x86_64_linux_sc_reg_offset[] =
+static int amd64_linux_sc_reg_offset[] =
{
13 * 8, /* %rax */
11 * 8, /* %rbx */
@@ -268,27 +268,27 @@ static int x86_64_linux_sc_reg_offset[] =
};
static void
-x86_64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- x86_64_init_abi (info, gdbarch);
+ amd64_init_abi (info, gdbarch);
- set_gdbarch_pc_in_sigtramp (gdbarch, x86_64_linux_pc_in_sigtramp);
+ set_gdbarch_pc_in_sigtramp (gdbarch, amd64_linux_pc_in_sigtramp);
- tdep->sigcontext_addr = x86_64_linux_sigcontext_addr;
- tdep->sc_reg_offset = x86_64_linux_sc_reg_offset;
- tdep->sc_num_regs = ARRAY_SIZE (x86_64_linux_sc_reg_offset);
+ tdep->sigcontext_addr = amd64_linux_sigcontext_addr;
+ tdep->sc_reg_offset = amd64_linux_sc_reg_offset;
+ tdep->sc_num_regs = ARRAY_SIZE (amd64_linux_sc_reg_offset);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
-extern void _initialize_x86_64_linux_tdep (void);
+extern void _initialize_amd64_linux_tdep (void);
void
-_initialize_x86_64_linux_tdep (void)
+_initialize_amd64_linux_tdep (void)
{
- add_core_fns (&x86_64_core_fns);
+ add_core_fns (&amd64_core_fns);
- gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_LINUX,
- x86_64_linux_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
+ GDB_OSABI_LINUX, amd64_linux_init_abi);
}
diff --git a/gdb/x86-64-linux-tdep.h b/gdb/amd64-linux-tdep.h
index a135cfafb88..5b960201f82 100644
--- a/gdb/x86-64-linux-tdep.h
+++ b/gdb/amd64-linux-tdep.h
@@ -1,7 +1,6 @@
-/* Target-dependent code for the x86-64.
+/* Target-dependent definitions for GNU/Linux x86-64.
- Copyright 2003
- Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
Contributed by Michal Ludvig, SuSE AG.
@@ -22,18 +21,18 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef X86_64_LINUX_TDEP_H
-#define X86_64_LINUX_TDEP_H
+#ifndef AMD64_LINUX_TDEP_H
+#define AMD64_LINUX_TDEP_H
/* Fill GDB's register array with the general-purpose register values
in *GREGSETP. */
-void x86_64_linux_supply_gregset (char *regp);
+void amd64_linux_supply_gregset (char *regp);
/* Fill register REGNO (if it is a general-purpose register) in
*GREGSETPS with the value in GDB's register array. If REGNO is -1,
do this for all registers. */
-void x86_64_linux_fill_gregset (char *regp, int regno);
+void amd64_linux_fill_gregset (char *regp, int regno);
-#endif /* x86-64-linux-tdep.h */
+#endif /* amd64-linux-tdep.h */
diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
index fb0efcf8dea..1efe47a5698 100644
--- a/gdb/amd64-nat.c
+++ b/gdb/amd64-nat.c
@@ -1,6 +1,6 @@
/* Native-dependent code for AMD64.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -24,9 +24,10 @@
#include "regcache.h"
#include "gdb_assert.h"
+#include "gdb_string.h"
#include "i386-tdep.h"
-#include "x86-64-tdep.h"
+#include "amd64-tdep.h"
/* The following bits of code help with implementing debugging 32-bit
code natively on AMD64. The idea is to define two mappings between
@@ -46,7 +47,7 @@ int amd64_native_gregset32_num_regs = I386_NUM_GREGS;
/* General-purpose register mapping for native 64-bit code. */
int *amd64_native_gregset64_reg_offset;
-int amd64_native_gregset64_num_regs = X86_64_NUM_GREGS;
+int amd64_native_gregset64_num_regs = AMD64_NUM_GREGS;
/* Return the offset of REGNUM within the appropriate native
general-purpose register set. */
@@ -92,10 +93,11 @@ amd64_supply_native_gregset (struct regcache *regcache,
const void *gregs, int regnum)
{
const char *regs = gregs;
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
int num_regs = amd64_native_gregset64_num_regs;
int i;
- if (gdbarch_ptr_bit (current_gdbarch) == 32)
+ if (gdbarch_ptr_bit (gdbarch) == 32)
num_regs = amd64_native_gregset32_num_regs;
if (num_regs > NUM_REGS)
@@ -108,7 +110,7 @@ amd64_supply_native_gregset (struct regcache *regcache,
int offset = amd64_native_gregset_reg_offset (i);
if (offset != -1)
- regcache_raw_supply (current_regcache, i, regs + offset);
+ regcache_raw_supply (regcache, i, regs + offset);
}
}
}
@@ -122,11 +124,22 @@ amd64_collect_native_gregset (const struct regcache *regcache,
void *gregs, int regnum)
{
char *regs = gregs;
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
int num_regs = amd64_native_gregset64_num_regs;
int i;
- if (gdbarch_ptr_bit (current_gdbarch) == 32)
- num_regs = amd64_native_gregset32_num_regs;
+ if (gdbarch_ptr_bit (gdbarch) == 32)
+ {
+ num_regs = amd64_native_gregset32_num_regs;
+
+ /* Make sure %eax, %ebx, %ecx, %edx, %esi, %edi, %ebp, %esp and
+ %eip get zero-extended to 64 bits. */
+ for (i = 0; i <= I386_EIP_REGNUM; i++)
+ {
+ if (regnum == -1 || regnum == i)
+ memset (regs + amd64_native_gregset_reg_offset (i), 0, 8);
+ }
+ }
if (num_regs > NUM_REGS)
num_regs = NUM_REGS;
@@ -138,7 +151,7 @@ amd64_collect_native_gregset (const struct regcache *regcache,
int offset = amd64_native_gregset_reg_offset (i);
if (offset != -1)
- regcache_raw_collect (current_regcache, i, regs + offset);
+ regcache_raw_collect (regcache, i, regs + offset);
}
}
}
diff --git a/gdb/x86-64-tdep.c b/gdb/amd64-tdep.c
index b19372fe89c..e0b2ca046f5 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -37,12 +37,12 @@
#include "gdb_assert.h"
-#include "x86-64-tdep.h"
+#include "amd64-tdep.h"
#include "i387-tdep.h"
/* Note that the AMD64 architecture was previously known as x86-64.
The latter is (forever) engraved into the canonical system name as
- returned bu config.guess, and used as the name for the AMD64 port
+ returned by config.guess, and used as the name for the AMD64 port
of GNU/Linux. The BSD's have renamed their ports to amd64; they
don't like to shout. For GDB we prefer the amd64_-prefix over the
x86_64_-prefix since it's so much easier to type. */
@@ -154,38 +154,39 @@ amd64_register_type (struct gdbarch *gdbarch, int regnum)
static int amd64_dwarf_regmap[] =
{
/* General Purpose Registers RAX, RDX, RCX, RBX, RSI, RDI. */
- X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, 2, 1,
- 4, X86_64_RDI_REGNUM,
+ AMD64_RAX_REGNUM, AMD64_RDX_REGNUM,
+ AMD64_RCX_REGNUM, AMD64_RBX_REGNUM,
+ AMD64_RSI_REGNUM, AMD64_RDI_REGNUM,
/* Frame Pointer Register RBP. */
- X86_64_RBP_REGNUM,
+ AMD64_RBP_REGNUM,
/* Stack Pointer Register RSP. */
- X86_64_RSP_REGNUM,
+ AMD64_RSP_REGNUM,
/* Extended Integer Registers 8 - 15. */
8, 9, 10, 11, 12, 13, 14, 15,
/* Return Address RA. Mapped to RIP. */
- X86_64_RIP_REGNUM,
+ AMD64_RIP_REGNUM,
/* SSE Registers 0 - 7. */
- X86_64_XMM0_REGNUM + 0, X86_64_XMM1_REGNUM,
- X86_64_XMM0_REGNUM + 2, X86_64_XMM0_REGNUM + 3,
- X86_64_XMM0_REGNUM + 4, X86_64_XMM0_REGNUM + 5,
- X86_64_XMM0_REGNUM + 6, X86_64_XMM0_REGNUM + 7,
+ AMD64_XMM0_REGNUM + 0, AMD64_XMM1_REGNUM,
+ AMD64_XMM0_REGNUM + 2, AMD64_XMM0_REGNUM + 3,
+ AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5,
+ AMD64_XMM0_REGNUM + 6, AMD64_XMM0_REGNUM + 7,
/* Extended SSE Registers 8 - 15. */
- X86_64_XMM0_REGNUM + 8, X86_64_XMM0_REGNUM + 9,
- X86_64_XMM0_REGNUM + 10, X86_64_XMM0_REGNUM + 11,
- X86_64_XMM0_REGNUM + 12, X86_64_XMM0_REGNUM + 13,
- X86_64_XMM0_REGNUM + 14, X86_64_XMM0_REGNUM + 15,
+ AMD64_XMM0_REGNUM + 8, AMD64_XMM0_REGNUM + 9,
+ AMD64_XMM0_REGNUM + 10, AMD64_XMM0_REGNUM + 11,
+ AMD64_XMM0_REGNUM + 12, AMD64_XMM0_REGNUM + 13,
+ AMD64_XMM0_REGNUM + 14, AMD64_XMM0_REGNUM + 15,
/* Floating Point Registers 0-7. */
- X86_64_ST0_REGNUM + 0, X86_64_ST0_REGNUM + 1,
- X86_64_ST0_REGNUM + 2, X86_64_ST0_REGNUM + 3,
- X86_64_ST0_REGNUM + 4, X86_64_ST0_REGNUM + 5,
- X86_64_ST0_REGNUM + 6, X86_64_ST0_REGNUM + 7
+ AMD64_ST0_REGNUM + 0, AMD64_ST0_REGNUM + 1,
+ AMD64_ST0_REGNUM + 2, AMD64_ST0_REGNUM + 3,
+ AMD64_ST0_REGNUM + 4, AMD64_ST0_REGNUM + 5,
+ AMD64_ST0_REGNUM + 6, AMD64_ST0_REGNUM + 7
};
static const int amd64_dwarf_regmap_len =
@@ -406,8 +407,8 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *type,
{
enum amd64_reg_class class[2];
int len = TYPE_LENGTH (type);
- static int integer_regnum[] = { X86_64_RAX_REGNUM, X86_64_RDX_REGNUM };
- static int sse_regnum[] = { X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM };
+ static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
+ static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
int integer_reg = 0;
int sse_reg = 0;
int i;
@@ -457,7 +458,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *type,
case AMD64_X87:
/* 6. If the class is X87, the value is returned on the X87
stack in %st0 as 80-bit x87 number. */
- regnum = X86_64_ST0_REGNUM;
+ regnum = AMD64_ST0_REGNUM;
if (writebuf)
i387_return_value (gdbarch, regcache);
break;
@@ -466,7 +467,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *type,
/* 7. If the class is X87UP, the value is returned together
with the previous X87 value in %st0. */
gdb_assert (i > 0 && class[0] == AMD64_X87);
- regnum = X86_64_ST0_REGNUM;
+ regnum = AMD64_ST0_REGNUM;
offset = 8;
len = 2;
break;
@@ -498,17 +499,20 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
{
static int integer_regnum[] =
{
- X86_64_RDI_REGNUM, 4, /* %rdi, %rsi */
- X86_64_RDX_REGNUM, 2, /* %rdx, %rcx */
- 8, 9 /* %r8, %r9 */
+ AMD64_RDI_REGNUM, /* %rdi */
+ AMD64_RSI_REGNUM, /* %rsi */
+ AMD64_RDX_REGNUM, /* %rdx */
+ AMD64_RCX_REGNUM, /* %rcx */
+ 8, /* %r8 */
+ 9 /* %r9 */
};
static int sse_regnum[] =
{
/* %xmm0 ... %xmm7 */
- X86_64_XMM0_REGNUM + 0, X86_64_XMM1_REGNUM,
- X86_64_XMM0_REGNUM + 2, X86_64_XMM0_REGNUM + 3,
- X86_64_XMM0_REGNUM + 4, X86_64_XMM0_REGNUM + 5,
- X86_64_XMM0_REGNUM + 6, X86_64_XMM0_REGNUM + 7,
+ AMD64_XMM0_REGNUM + 0, AMD64_XMM1_REGNUM,
+ AMD64_XMM0_REGNUM + 2, AMD64_XMM0_REGNUM + 3,
+ AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5,
+ AMD64_XMM0_REGNUM + 6, AMD64_XMM0_REGNUM + 7,
};
struct value **stack_args = alloca (nargs * sizeof (struct value *));
int num_stack_args = 0;
@@ -617,7 +621,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
varargs or stdargs (prototype-less calls or calls to functions
containing ellipsis (...) in the declaration) %al is used as
hidden argument to specify the number of SSE registers used. */
- regcache_raw_write_unsigned (regcache, X86_64_RAX_REGNUM, sse_reg);
+ regcache_raw_write_unsigned (regcache, AMD64_RAX_REGNUM, sse_reg);
return sp;
}
@@ -636,7 +640,7 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
if (struct_return)
{
store_unsigned_integer (buf, 8, struct_addr);
- regcache_cooked_write (regcache, X86_64_RDI_REGNUM, buf);
+ regcache_cooked_write (regcache, AMD64_RDI_REGNUM, buf);
}
/* Store return address. */
@@ -646,17 +650,17 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
/* Finally, update the stack pointer... */
store_unsigned_integer (buf, 8, sp);
- regcache_cooked_write (regcache, X86_64_RSP_REGNUM, buf);
+ regcache_cooked_write (regcache, AMD64_RSP_REGNUM, buf);
/* ...and fake a frame pointer. */
- regcache_cooked_write (regcache, X86_64_RBP_REGNUM, buf);
+ regcache_cooked_write (regcache, AMD64_RBP_REGNUM, buf);
return sp + 16;
}
/* The maximum number of saved registers. This should include %rip. */
-#define AMD64_NUM_SAVED_REGS X86_64_NUM_GREGS
+#define AMD64_NUM_SAVED_REGS AMD64_NUM_GREGS
struct amd64_frame_cache
{
@@ -729,7 +733,7 @@ amd64_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
{
/* Take into account that we've executed the `pushq %rbp' that
starts this instruction sequence. */
- cache->saved_regs[X86_64_RBP_REGNUM] = 0;
+ cache->saved_regs[AMD64_RBP_REGNUM] = 0;
cache->sp_offset += 8;
/* If that's all, return now. */
@@ -786,20 +790,19 @@ amd64_frame_cache (struct frame_info *next_frame, void **this_cache)
if (cache->frameless_p)
{
- /* We didn't find a valid frame, which means that CACHE->base
- currently holds the frame pointer for our calling frame. If
- we're at the start of a function, or somewhere half-way its
- prologue, the function's frame probably hasn't been fully
- setup yet. Try to reconstruct the base address for the stack
- frame by looking at the stack pointer. For truly "frameless"
- functions this might work too. */
-
- frame_unwind_register (next_frame, X86_64_RSP_REGNUM, buf);
+ /* We didn't find a valid frame. If we're at the start of a
+ function, or somewhere half-way its prologue, the function's
+ frame probably hasn't been fully setup yet. Try to
+ reconstruct the base address for the stack frame by looking
+ at the stack pointer. For truly "frameless" functions this
+ might work too. */
+
+ frame_unwind_register (next_frame, AMD64_RSP_REGNUM, buf);
cache->base = extract_unsigned_integer (buf, 8) + cache->sp_offset;
}
else
{
- frame_unwind_register (next_frame, X86_64_RBP_REGNUM, buf);
+ frame_unwind_register (next_frame, AMD64_RBP_REGNUM, buf);
cache->base = extract_unsigned_integer (buf, 8);
}
@@ -810,7 +813,7 @@ amd64_frame_cache (struct frame_info *next_frame, void **this_cache)
/* For normal frames, %rip is stored at 8(%rbp). If we don't have a
frame we find it at the same offset from the reconstructed base
address. */
- cache->saved_regs[X86_64_RIP_REGNUM] = 8;
+ cache->saved_regs[AMD64_RIP_REGNUM] = 8;
/* Adjust all the saved registers such that they contain addresses
instead of offsets. */
@@ -913,7 +916,7 @@ amd64_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
cache = amd64_alloc_frame_cache ();
- frame_unwind_register (next_frame, X86_64_RSP_REGNUM, buf);
+ frame_unwind_register (next_frame, AMD64_RSP_REGNUM, buf);
cache->base = extract_unsigned_integer (buf, 8) - 8;
addr = tdep->sigcontext_addr (next_frame);
@@ -999,7 +1002,7 @@ amd64_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
char buf[8];
CORE_ADDR fp;
- frame_unwind_register (next_frame, X86_64_RBP_REGNUM, buf);
+ frame_unwind_register (next_frame, AMD64_RBP_REGNUM, buf);
fp = extract_unsigned_integer (buf, 8);
return frame_id_build (fp + 16, frame_pc_unwind (next_frame));
@@ -1025,7 +1028,7 @@ amd64_supply_fpregset (const struct regset *regset, struct regcache *regcache,
const struct gdbarch_tdep *tdep = regset->descr;
gdb_assert (len == tdep->sizeof_fpregset);
- x86_64_supply_fxsave (regcache, regnum, fpregs);
+ amd64_supply_fxsave (regcache, regnum, fpregs);
}
/* Return the appropriate register set for the core section identified
@@ -1054,7 +1057,7 @@ amd64_regset_from_core_section (struct gdbarch *gdbarch,
void
-x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -1063,7 +1066,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->sizeof_fpregset = I387_SIZEOF_FXSAVE;
/* AMD64 has an FPU and 16 SSE registers. */
- tdep->st0_regnum = X86_64_ST0_REGNUM;
+ tdep->st0_regnum = AMD64_ST0_REGNUM;
tdep->num_xmm_regs = 16;
/* This is what all the fuss is about. */
@@ -1081,10 +1084,10 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_register_type (gdbarch, amd64_register_type);
/* Register numbers of various important registers. */
- set_gdbarch_sp_regnum (gdbarch, X86_64_RSP_REGNUM); /* %rsp */
- set_gdbarch_pc_regnum (gdbarch, X86_64_RIP_REGNUM); /* %rip */
- set_gdbarch_ps_regnum (gdbarch, X86_64_EFLAGS_REGNUM); /* %eflags */
- set_gdbarch_fp0_regnum (gdbarch, X86_64_ST0_REGNUM); /* %st(0) */
+ set_gdbarch_sp_regnum (gdbarch, AMD64_RSP_REGNUM); /* %rsp */
+ set_gdbarch_pc_regnum (gdbarch, AMD64_RIP_REGNUM); /* %rip */
+ set_gdbarch_ps_regnum (gdbarch, AMD64_EFLAGS_REGNUM); /* %eflags */
+ set_gdbarch_fp0_regnum (gdbarch, AMD64_ST0_REGNUM); /* %st(0) */
/* The "default" register numbering scheme for AMD64 is referred to
as the "DWARF Register Number Mapping" in the System V psABI.
@@ -1134,7 +1137,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
}
-#define I387_ST0_REGNUM X86_64_ST0_REGNUM
+#define I387_ST0_REGNUM AMD64_ST0_REGNUM
/* The 64-bit FXSAVE format differs from the 32-bit format in the
sense that the instruction pointer and data pointer are simply
@@ -1149,7 +1152,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
reserved bits in *FXSAVE. */
void
-x86_64_supply_fxsave (struct regcache *regcache, int regnum,
+amd64_supply_fxsave (struct regcache *regcache, int regnum,
const void *fxsave)
{
i387_supply_fxsave (regcache, regnum, fxsave);
@@ -1166,17 +1169,31 @@ x86_64_supply_fxsave (struct regcache *regcache, int regnum,
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in
- *FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
- this for all registers. This function doesn't touch any of the
- reserved bits in *FXSAVE. */
+ *FXSAVE with the value from REGCACHE. If REGNUM is -1, do this for
+ all registers. This function doesn't touch any of the reserved
+ bits in *FXSAVE. */
void
-x86_64_fill_fxsave (char *fxsave, int regnum)
+amd64_collect_fxsave (const struct regcache *regcache, int regnum,
+ void *fxsave)
{
- i387_fill_fxsave (fxsave, regnum);
+ char *regs = fxsave;
+
+ i387_collect_fxsave (regcache, regnum, fxsave);
if (regnum == -1 || regnum == I387_FISEG_REGNUM)
- regcache_collect (I387_FISEG_REGNUM, fxsave + 12);
+ regcache_raw_collect (regcache, I387_FISEG_REGNUM, regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
- regcache_collect (I387_FOSEG_REGNUM, fxsave + 20);
+ regcache_raw_collect (regcache, I387_FOSEG_REGNUM, regs + 20);
+}
+
+/* Fill register REGNUM (if it is a floating-point or SSE register) in
+ *FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
+ this for all registers. This function doesn't touch any of the
+ reserved bits in *FXSAVE. */
+
+void
+amd64_fill_fxsave (char *fxsave, int regnum)
+{
+ amd64_collect_fxsave (current_regcache, regnum, fxsave);
}
diff --git a/gdb/x86-64-tdep.h b/gdb/amd64-tdep.h
index 4aa0e7faf9f..042618b3e09 100644
--- a/gdb/x86-64-tdep.h
+++ b/gdb/amd64-tdep.h
@@ -1,4 +1,4 @@
-/* Target-dependent code for the x86-64.
+/* Target-dependent definitions for AMD64.
Copyright 2001, 2003, 2004 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
@@ -20,8 +20,8 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef X86_64_TDEP_H
-#define X86_64_TDEP_H
+#ifndef AMD64_TDEP_H
+#define AMD64_TDEP_H
struct gdbarch;
struct frame_info;
@@ -31,44 +31,63 @@ struct regcache;
/* Register numbers of various important registers. */
-#define X86_64_RAX_REGNUM 0 /* %rax */
-#define X86_64_RDX_REGNUM 3 /* %rdx */
-#define X86_64_RDI_REGNUM 5 /* %rdi */
-#define X86_64_RBP_REGNUM 6 /* %rbp */
-#define X86_64_RSP_REGNUM 7 /* %rsp */
-#define X86_64_RIP_REGNUM 16 /* %rip */
-#define X86_64_EFLAGS_REGNUM 17 /* %eflags */
-#define X86_64_ST0_REGNUM 24 /* %st0 */
-#define X86_64_XMM0_REGNUM 40 /* %xmm0 */
-#define X86_64_XMM1_REGNUM 41 /* %xmm1 */
+enum amd64_regnum
+{
+ AMD64_RAX_REGNUM, /* %rax */
+ AMD64_RBX_REGNUM, /* %rbx */
+ AMD64_RCX_REGNUM, /* %rcx */
+ AMD64_RDX_REGNUM, /* %rdx */
+ AMD64_RSI_REGNUM, /* %rsi */
+ AMD64_RDI_REGNUM, /* %rdi */
+ AMD64_RBP_REGNUM, /* %rbp */
+ AMD64_RSP_REGNUM, /* %rsp */
+ AMD64_R8_REGNUM = 8, /* %r8 */
+ AMD64_R15_REGNUM = 15, /* %r15 */
+ AMD64_RIP_REGNUM, /* %rip */
+ AMD64_EFLAGS_REGNUM, /* %eflags */
+ AMD64_ST0_REGNUM = 24, /* %st0 */
+ AMD64_XMM0_REGNUM = 40, /* %xmm0 */
+ AMD64_XMM1_REGNUM /* %xmm1 */
+};
/* Number of general purpose registers. */
-#define X86_64_NUM_GREGS 24
+#define AMD64_NUM_GREGS 24
-void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
+extern void amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
/* Fill register REGNUM in REGCACHE with the appropriate
floating-point or SSE register value from *FXSAVE. If REGNUM is
-1, do this for all registers. This function masks off any of the
reserved bits in *FXSAVE. */
-extern void x86_64_supply_fxsave (struct regcache *regcache, int regnum,
- const void *fxsave);
+extern void amd64_supply_fxsave (struct regcache *regcache, int regnum,
+ const void *fxsave);
+
+/* Fill register REGNUM (if it is a floating-point or SSE register) in
+ *FXSAVE with the value from REGCACHE. If REGNUM is -1, do this for
+ all registers. This function doesn't touch any of the reserved
+ bits in *FXSAVE. */
+
+extern void amd64_collect_fxsave (const struct regcache *regcache, int regnum,
+ void *fxsave);
/* Fill register REGNUM (if it is a floating-point or SSE register) in
*FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
this for all registers. This function doesn't touch any of the
reserved bits in *FXSAVE. */
-void x86_64_fill_fxsave (char *fxsave, int regnum);
+extern void amd64_fill_fxsave (char *fxsave, int regnum);
/* Variables exported from amd64nbsd-tdep.c. */
extern int amd64nbsd_r_reg_offset[];
+/* Variables exported from amd64obsd-tdep.c. */
+extern int amd64obsd_r_reg_offset[];
+
/* Variables exported from amd64fbsd-tdep.c. */
-extern CORE_ADDR amd64fbsd_sigtramp_start;
-extern CORE_ADDR amd64fbsd_sigtramp_end;
+extern CORE_ADDR amd64fbsd_sigtramp_start_addr;
+extern CORE_ADDR amd64fbsd_sigtramp_end_addr;
extern int amd64fbsd_sc_reg_offset[];
-#endif /* x86-64-tdep.h */
+#endif /* amd64-tdep.h */
diff --git a/gdb/amd64bsd-nat.c b/gdb/amd64bsd-nat.c
index 6c85f20633c..4c7c04a881d 100644
--- a/gdb/amd64bsd-nat.c
+++ b/gdb/amd64bsd-nat.c
@@ -1,6 +1,6 @@
/* Native-dependent code for AMD64 BSD's.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -31,7 +31,7 @@
#include <sys/ptrace.h>
#include <machine/reg.h>
-#include "x86-64-tdep.h"
+#include "amd64-tdep.h"
#include "amd64-nat.h"
@@ -54,7 +54,7 @@ fetch_inferior_registers (int regnum)
return;
}
- if (regnum == -1 || regnum >= X86_64_ST0_REGNUM)
+ if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
{
struct fpreg fpregs;
@@ -62,7 +62,7 @@ fetch_inferior_registers (int regnum)
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
- x86_64_supply_fxsave (current_regcache, -1, &fpregs);
+ amd64_supply_fxsave (current_regcache, -1, &fpregs);
}
}
@@ -90,7 +90,7 @@ store_inferior_registers (int regnum)
return;
}
- if (regnum == -1 || regnum >= X86_64_ST0_REGNUM)
+ if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
{
struct fpreg fpregs;
@@ -98,7 +98,7 @@ store_inferior_registers (int regnum)
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
- x86_64_fill_fxsave ((char *) &fpregs, regnum);
+ amd64_fill_fxsave ((char *) &fpregs, regnum);
if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
diff --git a/gdb/amd64fbsd-nat.c b/gdb/amd64fbsd-nat.c
index edab8b56709..f08373422c2 100644
--- a/gdb/amd64fbsd-nat.c
+++ b/gdb/amd64fbsd-nat.c
@@ -44,7 +44,7 @@ typedef struct fpreg fpregset_t;
#endif
#include "gregset.h"
-#include "x86-64-tdep.h"
+#include "amd64-tdep.h"
#include "amd64-nat.h"
@@ -131,7 +131,7 @@ fill_gregset (gregset_t *gregsetp, int regnum)
void
supply_fpregset (fpregset_t *fpregsetp)
{
- x86_64_supply_fxsave (current_regcache, -1, fpregsetp);
+ amd64_supply_fxsave (current_regcache, -1, fpregsetp);
}
/* Fill register REGNUM (if it is a floating-point register) in
@@ -141,7 +141,7 @@ supply_fpregset (fpregset_t *fpregsetp)
void
fill_fpregset (fpregset_t *fpregsetp, int regnum)
{
- x86_64_fill_fxsave ((char *) fpregsetp, regnum);
+ amd64_fill_fxsave ((char *) fpregsetp, regnum);
}
@@ -168,9 +168,9 @@ _initialize_amd64fbsd_nat (void)
pointer since these members of `struct sigcontext' are essential
for providing backtraces. */
-#define SC_RIP_OFFSET SC_REG_OFFSET[X86_64_RIP_REGNUM]
-#define SC_RSP_OFFSET SC_REG_OFFSET[X86_64_RSP_REGNUM]
-#define SC_RBP_OFFSET SC_REG_OFFSET[X86_64_RBP_REGNUM]
+#define SC_RIP_OFFSET SC_REG_OFFSET[AMD64_RIP_REGNUM]
+#define SC_RSP_OFFSET SC_REG_OFFSET[AMD64_RSP_REGNUM]
+#define SC_RBP_OFFSET SC_REG_OFFSET[AMD64_RBP_REGNUM]
/* Override the default value for the offset of the program counter
in the sigcontext structure. */
@@ -228,8 +228,8 @@ Please report this to <bug-gdb@gnu.org>.",
len = sizeof (ps_strings);
if (sysctl (mib, 2, &ps_strings, &len, NULL, 0) == 0)
{
- amd64fbsd_sigtramp_start = ps_strings - 32;
- amd64fbsd_sigtramp_end = ps_strings;
+ amd64fbsd_sigtramp_start_addr = ps_strings - 32;
+ amd64fbsd_sigtramp_end_addr = ps_strings;
}
}
}
diff --git a/gdb/amd64fbsd-tdep.c b/gdb/amd64fbsd-tdep.c
index 6814dd97e96..e4e02abb61c 100644
--- a/gdb/amd64fbsd-tdep.c
+++ b/gdb/amd64fbsd-tdep.c
@@ -28,7 +28,8 @@
#include "gdb_string.h"
-#include "x86-64-tdep.h"
+#include "amd64-tdep.h"
+#include "solib-svr4.h"
/* Support for signal handlers. */
@@ -43,7 +44,7 @@ amd64fbsd_sigcontext_addr (struct frame_info *next_frame)
/* The `struct sigcontext' (which really is an `ucontext_t' on
FreeBSD/amd64) lives at a fixed offset in the signal frame. See
<machine/sigframe.h>. */
- sp = frame_unwind_register_unsigned (next_frame, X86_64_RSP_REGNUM);
+ sp = frame_unwind_register_unsigned (next_frame, AMD64_RSP_REGNUM);
return sp + 16;
}
@@ -85,8 +86,8 @@ static int amd64fbsd_r_reg_offset[] =
};
/* Location of the signal trampoline. */
-CORE_ADDR amd64fbsd_sigtramp_start = 0x7fffffffffc0;
-CORE_ADDR amd64fbsd_sigtramp_end = 0x7fffffffffe0;
+CORE_ADDR amd64fbsd_sigtramp_start_addr = 0x7fffffffffc0;
+CORE_ADDR amd64fbsd_sigtramp_end_addr = 0x7fffffffffe0;
/* From <machine/signal.h>. */
int amd64fbsd_sc_reg_offset[] =
@@ -129,13 +130,17 @@ amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->gregset_num_regs = ARRAY_SIZE (amd64fbsd_r_reg_offset);
tdep->sizeof_gregset = 22 * 8;
- x86_64_init_abi (info, gdbarch);
+ amd64_init_abi (info, gdbarch);
- tdep->sigtramp_start = amd64fbsd_sigtramp_start;
- tdep->sigtramp_end = amd64fbsd_sigtramp_end;
+ tdep->sigtramp_start = amd64fbsd_sigtramp_start_addr;
+ tdep->sigtramp_end = amd64fbsd_sigtramp_end_addr;
tdep->sigcontext_addr = amd64fbsd_sigcontext_addr;
tdep->sc_reg_offset = amd64fbsd_sc_reg_offset;
tdep->sc_num_regs = ARRAY_SIZE (amd64fbsd_sc_reg_offset);
+
+ /* FreeBSD uses SVR4-style shared libraries. */
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, svr4_lp64_fetch_link_map_offsets);
}
diff --git a/gdb/amd64nbsd-nat.c b/gdb/amd64nbsd-nat.c
index da4532e69ee..df7ceb9e861 100644
--- a/gdb/amd64nbsd-nat.c
+++ b/gdb/amd64nbsd-nat.c
@@ -23,7 +23,7 @@
#include "gdb_assert.h"
-#include "x86-64-tdep.h"
+#include "amd64-tdep.h"
#include "amd64-nat.h"
/* Mapping between the general-purpose registers in NetBSD/amd64
diff --git a/gdb/amd64nbsd-tdep.c b/gdb/amd64nbsd-tdep.c
index a39c33e7c11..a04e04fa34b 100644
--- a/gdb/amd64nbsd-tdep.c
+++ b/gdb/amd64nbsd-tdep.c
@@ -27,8 +27,9 @@
#include "gdb_assert.h"
+#include "amd64-tdep.h"
#include "nbsd-tdep.h"
-#include "x86-64-tdep.h"
+#include "solib-svr4.h"
/* Support for signal handlers. */
@@ -42,7 +43,7 @@ amd64nbsd_sigcontext_addr (struct frame_info *next_frame)
/* The stack pointer points at `struct sigcontext' upon entry of a
signal trampoline. */
- sp = frame_unwind_register_unsigned (next_frame, X86_64_RSP_REGNUM);
+ sp = frame_unwind_register_unsigned (next_frame, AMD64_RSP_REGNUM);
return sp;
}
@@ -92,12 +93,13 @@ amd64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->gregset_num_regs = ARRAY_SIZE (amd64nbsd_r_reg_offset);
tdep->sizeof_gregset = 26 * 8;
- x86_64_init_abi (info, gdbarch);
+ amd64_init_abi (info, gdbarch);
tdep->jb_pc_offset = 7 * 8;
/* NetBSD has its own convention for signal trampolines. */
set_gdbarch_pc_in_sigtramp (gdbarch, nbsd_pc_in_sigtramp);
+ tdep->sigcontext_addr = amd64nbsd_sigcontext_addr;
/* Initialize the array with register offsets in `struct
sigcontext'. This `struct sigcontext' has an sc_mcontext member
@@ -113,7 +115,9 @@ amd64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->sc_reg_offset[i] = 32 + amd64nbsd_r_reg_offset[i];
}
- tdep->sigcontext_addr = amd64nbsd_sigcontext_addr;
+ /* NetBSD uses SVR4-style shared libraries. */
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, svr4_lp64_fetch_link_map_offsets);
}
@@ -124,7 +128,7 @@ void
_initialize_amd64nbsd_ndep (void)
{
/* The NetBSD/amd64 native dependent code makes this assumption. */
- gdb_assert (ARRAY_SIZE (amd64nbsd_r_reg_offset) == X86_64_NUM_GREGS);
+ gdb_assert (ARRAY_SIZE (amd64nbsd_r_reg_offset) == AMD64_NUM_GREGS);
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
GDB_OSABI_NETBSD_ELF, amd64nbsd_init_abi);
diff --git a/gdb/amd64obsd-nat.c b/gdb/amd64obsd-nat.c
index 5a802d4bbe8..e8d92fefa80 100644
--- a/gdb/amd64obsd-nat.c
+++ b/gdb/amd64obsd-nat.c
@@ -23,7 +23,7 @@
#include "gdb_assert.h"
-#include "x86-64-tdep.h"
+#include "amd64-tdep.h"
#include "amd64-nat.h"
/* Mapping between the general-purpose registers in OpenBSD/amd64
diff --git a/gdb/amd64obsd-tdep.c b/gdb/amd64obsd-tdep.c
index be263d8a77b..198c87e4a28 100644
--- a/gdb/amd64obsd-tdep.c
+++ b/gdb/amd64obsd-tdep.c
@@ -29,8 +29,9 @@
#include "gdb_assert.h"
#include "gdb_string.h"
-#include "x86-64-tdep.h"
+#include "amd64-tdep.h"
#include "i387-tdep.h"
+#include "solib-svr4.h"
/* Support for core dumps. */
@@ -44,7 +45,7 @@ amd64obsd_supply_regset (const struct regset *regset,
gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE);
i386_supply_gregset (regset, regcache, regnum, regs, tdep->sizeof_gregset);
- x86_64_supply_fxsave (regcache, regnum, (char *)regs + tdep->sizeof_gregset);
+ amd64_supply_fxsave (regcache, regnum, (char *)regs + tdep->sizeof_gregset);
}
static const struct regset *
@@ -84,7 +85,7 @@ amd64obsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
0x48, 0xc7, 0xc0,
0x67, 0x00, 0x00, 0x00, /* movq $SYS_sigreturn, %rax */
- 0x0f, 0x05 /* syscall */
+ 0xcd, 0x80 /* int $0x80 */
};
char *buf;
@@ -111,7 +112,7 @@ amd64obsd_sigcontext_addr (struct frame_info *next_frame)
{
/* The %rsp register points at `struct sigcontext' upon entry of a
signal trampoline. */
- return frame_unwind_register_unsigned (next_frame, X86_64_RSP_REGNUM);
+ return frame_unwind_register_unsigned (next_frame, AMD64_RSP_REGNUM);
}
/* OpenBSD 3.5 or later. */
@@ -182,7 +183,7 @@ amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- x86_64_init_abi (info, gdbarch);
+ amd64_init_abi (info, gdbarch);
/* Initialize general-purpose register set details. */
tdep->gregset_reg_offset = amd64obsd_r_reg_offset;
@@ -198,6 +199,10 @@ amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->sigcontext_addr = amd64obsd_sigcontext_addr;
tdep->sc_reg_offset = amd64obsd_sc_reg_offset;
tdep->sc_num_regs = ARRAY_SIZE (amd64obsd_sc_reg_offset);
+
+ /* OpenBSD uses SVR4-style shared libraries. */
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, svr4_lp64_fetch_link_map_offsets);
}
@@ -208,7 +213,7 @@ void
_initialize_amd64obsd_tdep (void)
{
/* The OpenBSD/amd64 native dependent code makes this assumption. */
- gdb_assert (ARRAY_SIZE (amd64obsd_r_reg_offset) == X86_64_NUM_GREGS);
+ gdb_assert (ARRAY_SIZE (amd64obsd_r_reg_offset) == AMD64_NUM_GREGS);
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
GDB_OSABI_OPENBSD_ELF, amd64obsd_init_abi);
diff --git a/gdb/auxv.c b/gdb/auxv.c
index c28014c4a9e..a2516b68528 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -276,16 +276,15 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
static void
info_auxv_command (char *cmd, int from_tty)
{
-
if (! target_has_stack)
error ("The program has no auxiliary information now.");
else
{
int ents = fprint_target_auxv (gdb_stdout, &current_target);
if (ents < 0)
- error ("No auxilary vector found, or failed reading it.");
+ error ("No auxiliary vector found, or failed reading it.");
else if (ents == 0)
- error ("Auxilary vector is empty.");
+ error ("Auxiliary vector is empty.");
}
}
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index a4cfa461b3c..01a46b39f41 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -212,6 +212,12 @@ static void ep_skip_leading_whitespace (char **s);
if such is available. */
static int can_use_hw_watchpoints;
+/* If AUTO_BOOLEAN_FALSE, gdb will not attempt to create pending breakpoints.
+ If AUTO_BOOLEAN_TRUE, gdb will automatically create pending breakpoints
+ for unrecognized breakpoint locations.
+ If AUTO_BOOLEAN_AUTO, gdb will query when breakpoints are unrecognized. */
+static enum auto_boolean pending_break_support;
+
void _initialize_breakpoint (void);
extern int addressprint; /* Print machine addresses? */
@@ -3471,13 +3477,7 @@ print_one_breakpoint (struct breakpoint *b,
{
annotate_field (4);
if (b->pending)
- {
- ui_out_field_string (uiout, "addr", "<PENDING>");
- if (TARGET_ADDR_BIT <= 32)
- ui_out_spaces (uiout, 2);
- else
- ui_out_spaces (uiout, 8);
- }
+ ui_out_field_string (uiout, "addr", "<PENDING>");
else
ui_out_field_core_addr (uiout, "addr", b->loc->address);
}
@@ -5103,8 +5103,22 @@ break_command_1 (char *arg, int flag, int from_tty, struct breakpoint *pending_b
error_output_message (NULL, err_msg);
xfree (err_msg);
- if (!query ("Make breakpoint pending on future shared library load? "))
+
+ /* If pending breakpoint support is turned off, throw error. */
+
+ if (pending_break_support == AUTO_BOOLEAN_FALSE)
+ throw_exception (RETURN_ERROR);
+
+ /* If pending breakpoint support is auto query and the user selects
+ no, then simply return the error code. */
+ if (pending_break_support == AUTO_BOOLEAN_AUTO &&
+ !nquery ("Make breakpoint pending on future shared library load? "))
return rc;
+
+ /* At this point, either the user was queried about setting a
+ pending breakpoint and selected yes, or pending breakpoint
+ behavior is on and thus a pending breakpoint is defaulted
+ on behalf of the user. */
copy_arg = xstrdup (addr_start);
addr_string = &copy_arg;
sals.nelts = 1;
@@ -7696,6 +7710,16 @@ enable_delete_command (char *args, int from_tty)
map_breakpoint_numbers (args, enable_delete_breakpoint);
}
+static void
+set_breakpoint_cmd (char *args, int from_tty)
+{
+}
+
+static void
+show_breakpoint_cmd (char *args, int from_tty)
+{
+}
+
/* Use default_breakpoint_'s, or nothing if they aren't valid. */
struct symtabs_and_lines
@@ -7720,6 +7744,8 @@ decode_line_spec_1 (char *string, int funfirstline)
void
_initialize_breakpoint (void)
{
+ static struct cmd_list_element *breakpoint_set_cmdlist;
+ static struct cmd_list_element *breakpoint_show_cmdlist;
struct cmd_list_element *c;
breakpoint_chain = 0;
@@ -8038,4 +8064,34 @@ hardware.)",
add_show_from_set (c, &showlist);
can_use_hw_watchpoints = 1;
+
+ add_prefix_cmd ("breakpoint", class_maintenance, set_breakpoint_cmd, "\
+Breakpoint specific settings\n\
+Configure various breakpoint-specific variables such as\n\
+pending breakpoint behavior",
+ &breakpoint_set_cmdlist, "set breakpoint ",
+ 0/*allow-unknown*/, &setlist);
+ add_prefix_cmd ("breakpoint", class_maintenance, show_breakpoint_cmd, "\
+Breakpoint specific settings\n\
+Configure various breakpoint-specific variables such as\n\
+pending breakpoint behavior",
+ &breakpoint_show_cmdlist, "show breakpoint ",
+ 0/*allow-unknown*/, &showlist);
+
+ add_setshow_auto_boolean_cmd ("pending", no_class, &pending_break_support, "\
+Set debugger's behavior regarding pending breakpoints.\n\
+If on, an unrecognized breakpoint location will cause gdb to create a\n\
+pending breakpoint. If off, an unrecognized breakpoint location results in\n\
+an error. If auto, an unrecognized breakpoint location results in a\n\
+user-query to see if a pending breakpoint should be created.","\
+Show debugger's behavior regarding pending breakpoints.\n\
+If on, an unrecognized breakpoint location will cause gdb to create a\n\
+pending breakpoint. If off, an unrecognized breakpoint location results in\n\
+an error. If auto, an unrecognized breakpoint location results in a\n\
+user-query to see if a pending breakpoint should be created.",
+ NULL, NULL,
+ &breakpoint_set_cmdlist,
+ &breakpoint_show_cmdlist);
+
+ pending_break_support = AUTO_BOOLEAN_AUTO;
}
diff --git a/gdb/charset.c b/gdb/charset.c
index fa683743cb7..2005a49e009 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -518,9 +518,9 @@ identity_either_char_to_other (void *baton, int either_char, int *other_char)
/* Default non-trivial conversion functions. */
-static char backslashable[] = "abefnrtv";
-static char *backslashed[] = {"a", "b", "e", "f", "n", "r", "t", "v", "0"};
-static char represented[] = "\a\b\e\f\n\r\t\v";
+static char backslashable[] = "abfnrtv";
+static char *backslashed[] = {"a", "b", "f", "n", "r", "t", "v", "0"};
+static char represented[] = "\a\b\f\n\r\t\v";
/* Translate TARGET_CHAR into the host character set, and see if it
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 7cd604719fa..9378ac87064 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -20,8 +20,8 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include <readline/readline.h>
-#include <readline/tilde.h>
+#include "readline/readline.h"
+#include "readline/tilde.h"
#include "completer.h"
#include "target.h" /* For baud_rate, remote_debug and remote_timeout */
#include "gdb_wait.h" /* For shell escape implementation */
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 9e9c3de4b91..ac54aa675b9 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -31,7 +31,7 @@
#include "gdb_assert.h"
#include <ctype.h>
#include "target.h"
-#include <readline/readline.h>
+#include "readline/readline.h"
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index a8375a38f5f..ca0c14f043b 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -294,21 +294,25 @@ execute_control_command (struct command_line *cmd)
{
struct expression *expr;
struct command_line *current;
- struct cleanup *old_chain = 0;
+ struct cleanup *old_chain = make_cleanup (null_cleanup, 0);
struct value *val;
struct value *val_mark;
int loop;
enum command_control_type ret;
char *new_line;
+ /* Start by assuming failure, if a problem is detected, the code
+ below will simply "break" out of the switch. */
+ ret = invalid_control;
+
switch (cmd->control_type)
{
case simple_control:
/* A simple command, execute it and return. */
new_line = insert_args (cmd->line);
if (!new_line)
- return invalid_control;
- old_chain = make_cleanup (free_current_contents, &new_line);
+ break;
+ make_cleanup (free_current_contents, &new_line);
execute_command (new_line, 0);
ret = cmd->control_type;
break;
@@ -325,8 +329,8 @@ execute_control_command (struct command_line *cmd)
/* Parse the loop control expression for the while statement. */
new_line = insert_args (cmd->line);
if (!new_line)
- return invalid_control;
- old_chain = make_cleanup (free_current_contents, &new_line);
+ break;
+ make_cleanup (free_current_contents, &new_line);
expr = parse_expression (new_line);
make_cleanup (free_current_contents, &expr);
@@ -385,8 +389,8 @@ execute_control_command (struct command_line *cmd)
{
new_line = insert_args (cmd->line);
if (!new_line)
- return invalid_control;
- old_chain = make_cleanup (free_current_contents, &new_line);
+ break;
+ make_cleanup (free_current_contents, &new_line);
/* Parse the conditional for the if statement. */
expr = parse_expression (new_line);
make_cleanup (free_current_contents, &expr);
@@ -424,11 +428,10 @@ execute_control_command (struct command_line *cmd)
default:
warning ("Invalid control type in command structure.");
- return invalid_control;
+ break;
}
- if (old_chain)
- do_cleanups (old_chain);
+ do_cleanups (old_chain);
return ret;
}
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 64a0d7353a2..62fe36f360b 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -18,7 +18,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include <readline/tilde.h>
+#include "readline/tilde.h"
#include "value.h"
#include <ctype.h>
#include "gdb_string.h"
diff --git a/gdb/coffread.c b/gdb/coffread.c
index b0468e02340..056ba137471 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1362,11 +1362,15 @@ enter_linenos (long file_offset, int first_line,
/* line numbers start at one for the first line of the function */
first_line--;
- for (;;)
+ /* If the line number table is full (e.g. 64K lines in COFF debug
+ info), the next function's L_LNNO32 might not be zero, so don't
+ overstep the table's end in any case. */
+ while (rawptr <= &linetab[0] + linetab_size)
{
bfd_coff_swap_lineno_in (symfile_bfd, rawptr, &lptr);
rawptr += local_linesz;
- /* The next function, or the sentinel, will have L_LNNO32 zero; we exit. */
+ /* The next function, or the sentinel, will have L_LNNO32 zero;
+ we exit. */
if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
record_line (current_subfile, first_line + L_LNNO32 (&lptr),
lptr.l_addr.l_paddr
diff --git a/gdb/completer.c b/gdb/completer.c
index 1ab71bea188..bcd7239cea3 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -33,7 +33,7 @@
/* Needed for rl_completer_word_break_characters() and for
rl_filename_completion_function. */
-#include <readline/readline.h>
+#include "readline/readline.h"
/* readline defines this. */
#undef savestring
diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst
index c007b2155f1..1d9e3936eee 100644
--- a/gdb/config/djgpp/fnchange.lst
+++ b/gdb/config/djgpp/fnchange.lst
@@ -85,6 +85,8 @@
@V@/gdb/config/alpha/tm-alphalinux.h @V@/gdb/config/alpha/tm-alplinux.h
@V@/gdb/config/alpha/xm-alphalinux.h @V@/gdb/config/alpha/xm-alplinux.h
@V@/gdb/config/alpha/xm-alphaosf.h @V@/gdb/config/alpha/xm-alposf.h
+@V@/gdb/config/i386/nm-linux64.h @V@/gdb/config/i386/nm-lx64.h
+@V@/gdb/config/i386/tm-linux64.h @V@/gdb/config/i386/tm-lx64.h
@V@/gdb/config/i386/nm-i386sco4.h @V@/gdb/config/i386/nm-sco4.h
@V@/gdb/config/i386/nm-i386sco5.h @V@/gdb/config/i386/nm-sco5.h
@V@/gdb/config/i386/nm-i386sol2.h @V@/gdb/config/i386/nm-sol2.h
@@ -228,8 +230,8 @@
@V@/gdb/testsuite/gdb.mi/mi2-var-child.exp @V@/gdb/testsuite/gdb.mi/mi2varchild.exp
@V@/gdb/testsuite/gdb.mi/mi2-var-cmd.exp @V@/gdb/testsuite/gdb.mi/mi2varcmd.exp
@V@/gdb/testsuite/gdb.mi/mi2-var-display.exp @V@/gdb/testsuite/gdb.mi/mi2vardisplay.exp
-@V@/gdb/x86-64-linux-tdep.c @V@/gdb/x8664-ltdep.c
-@V@/gdb/x86-64-linux-nat.c @V@/gdb/x8664-lnat.c
+@V@/gdb/amd64-linux-tdep.c @V@/gdb/amd64-ltdep.c
+@V@/gdb/amd64-linux-nat.c @V@/gdb/amd64-lnat.c
@V@/include/ChangeLog-9103 @V@/include/ChangeLog.9103
@V@/include/coff/ChangeLog-9103 @V@/include/coff/ChangeLog.9103
@V@/include/elf/ChangeLog-9103 @V@/include/elf/ChangeLog.9103
diff --git a/gdb/config/i386/fbsd.mh b/gdb/config/i386/fbsd.mh
index 4c70fc62055..2d0500e565d 100644
--- a/gdb/config/i386/fbsd.mh
+++ b/gdb/config/i386/fbsd.mh
@@ -1,7 +1,5 @@
-# Host: Intel 386 running FreeBSD
-
-XM_FILE= xm-i386.h
-
+# Host: FreeBSD/i386
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+ i386-nat.o i386bsd-nat.o i386fbsd-nat.o gcore.o fbsd-proc.o
NAT_FILE= nm-fbsd.h
-# NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
-NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o core-aout.o i386-nat.o i386bsd-nat.o i386fbsd-nat.o gcore.o fbsd-proc.o
+XM_FILE= xm-i386.h
diff --git a/gdb/config/i386/fbsd.mt b/gdb/config/i386/fbsd.mt
index b266255d51a..be095e987a8 100644
--- a/gdb/config/i386/fbsd.mt
+++ b/gdb/config/i386/fbsd.mt
@@ -1,3 +1,4 @@
-# Target: Intel 386 running FreeBSD
-TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o corelow.o
+# Target: FreeBSD/i386
+TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o \
+ corelow.o solib.o solib-svr4.o
TM_FILE= tm-fbsd.h
diff --git a/gdb/config/i386/fbsd64.mh b/gdb/config/i386/fbsd64.mh
index eaa801fc23a..6c30e3072df 100644
--- a/gdb/config/i386/fbsd64.mh
+++ b/gdb/config/i386/fbsd64.mh
@@ -1,7 +1,5 @@
# Host: FreeBSD/amd64
-
-XM_FILE= xm-i386.h
-
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+ amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o gcore.o fbsd-proc.o
NAT_FILE= nm-fbsd64.h
-# NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
-NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o gcore.o fbsd-proc.o
+XM_FILE= xm-i386.h
diff --git a/gdb/config/i386/fbsd64.mt b/gdb/config/i386/fbsd64.mt
index 3a66a15028f..d4cb24b76b8 100644
--- a/gdb/config/i386/fbsd64.mt
+++ b/gdb/config/i386/fbsd64.mt
@@ -1,2 +1,5 @@
# Target: FreeBSD/amd64
-TDEPFILES= x86-64-tdep.o amd64fbsd-tdep.o i386-tdep.o i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o corelow.o
+TDEPFILES= amd64-tdep.o amd64fbsd-tdep.o \
+ i386-tdep.o i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o \
+ corelow.o solib.o solib-svr4.o
+TM_FILE= tm-fbsd.h
diff --git a/gdb/config/i386/i386bsd.mh b/gdb/config/i386/i386bsd.mh
deleted file mode 100644
index 01457d479b8..00000000000
--- a/gdb/config/i386/i386bsd.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Intel 386 running 386BSD
-
-XM_FILE= xm-i386bsd.h
-
-NAT_FILE= nm-i386bsd.h
-NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o core-aout.o i386b-nat.o
diff --git a/gdb/config/i386/i386bsd.mt b/gdb/config/i386/i386bsd.mt
deleted file mode 100644
index ef617311115..00000000000
--- a/gdb/config/i386/i386bsd.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 running BSD
-TM_FILE= tm-i386bsd.h
-TDEPFILES= i386-tdep.o
diff --git a/gdb/config/i386/x86-64linux.mh b/gdb/config/i386/linux64.mh
index ed563cb0cf4..c02e864a347 100644
--- a/gdb/config/i386/x86-64linux.mh
+++ b/gdb/config/i386/linux64.mh
@@ -1,12 +1,9 @@
-# Host: AMD x86-64 running GNU/Linux
-
-XM_FILE= xm-i386.h
-
-NAT_FILE= nm-x86-64linux.h
+# Host: GNU/Linux x86-64
NATDEPFILES= infptrace.o inftarg.o fork-child.o \
- i386-nat.o amd64-nat.o x86-64-linux-nat.o \
- linux-nat.o \
+ i386-nat.o amd64-nat.o amd64-linux-nat.o linux-nat.o \
proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o
+NAT_FILE= nm-linux64.h
+XM_FILE= xm-i386.h
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
diff --git a/gdb/config/i386/linux64.mt b/gdb/config/i386/linux64.mt
new file mode 100644
index 00000000000..f642e317a55
--- /dev/null
+++ b/gdb/config/i386/linux64.mt
@@ -0,0 +1,5 @@
+# Target: GNU/Linux x86-64
+TDEPFILES= amd64-tdep.o amd64-linux-tdep.o \
+ i386-tdep.o i387-tdep.o i386-linux-tdep.o glibc-tdep.o \
+ solib.o solib-svr4.o solib-legacy.o corelow.o
+TM_FILE=tm-linux64.h
diff --git a/gdb/config/i386/nbsd.mt b/gdb/config/i386/nbsd.mt
index f7f8cd6e70c..d6699b54ec2 100644
--- a/gdb/config/i386/nbsd.mt
+++ b/gdb/config/i386/nbsd.mt
@@ -1,4 +1,4 @@
-# Target: Intel 386 running NetBSD
-TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o corelow.o \
- nbsd-tdep.o solib.o solib-svr4.o
+# Target: NetBSD/i386
+TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o nbsd-tdep.o \
+ corelow.o solib.o solib-svr4.o
TM_FILE= tm-nbsd.h
diff --git a/gdb/config/i386/nbsd64.mh b/gdb/config/i386/nbsd64.mh
index 5acd1676bbf..e10ae7a2be4 100644
--- a/gdb/config/i386/nbsd64.mh
+++ b/gdb/config/i386/nbsd64.mh
@@ -1,7 +1,5 @@
# Host: NetBSD/amd64
-
-XM_FILE= xm-i386.h
-
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+ amd64-nat.o amd64bsd-nat.o amd64nbsd-nat.o
NAT_FILE= nm-nbsd.h
-# NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
-NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o corelow.o amd64-nat.o amd64bsd-nat.o amd64nbsd-nat.o
+XM_FILE= xm-i386.h
diff --git a/gdb/config/i386/nbsd64.mt b/gdb/config/i386/nbsd64.mt
index 6d73660fba2..3c982116a4c 100644
--- a/gdb/config/i386/nbsd64.mt
+++ b/gdb/config/i386/nbsd64.mt
@@ -1,2 +1,4 @@
# Target: NetBSD/amd64
-TDEPFILES= x86-64-tdep.o amd64nbsd-tdep.o i386-tdep.o i387-tdep.o nbsd-tdep.o
+TDEPFILES= amd64-tdep.o amd64nbsd-tdep.o i386-tdep.o i387-tdep.o nbsd-tdep.o \
+ corelow.o solib.o solib-svr4.o
+TM_FILE= tm-nbsd.h
diff --git a/gdb/config/i386/nbsdaout.mh b/gdb/config/i386/nbsdaout.mh
index 226c56cc445..98e69c4c97b 100644
--- a/gdb/config/i386/nbsdaout.mh
+++ b/gdb/config/i386/nbsdaout.mh
@@ -1,5 +1,5 @@
-# Host: Intel 386 running NetBSD
-NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o solib-sunos.o
-
-XM_FILE= xm-nbsd.h
+# Host: NetBSD/i386 a.out
+NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o \
+ solib.o solib-sunos.o
NAT_FILE= nm-nbsdaout.h
+XM_FILE= xm-nbsd.h
diff --git a/gdb/config/i386/nbsdelf.mh b/gdb/config/i386/nbsdelf.mh
index 7c27b02f3ac..0d313ddac82 100644
--- a/gdb/config/i386/nbsdelf.mh
+++ b/gdb/config/i386/nbsdelf.mh
@@ -1,4 +1,4 @@
-# Host: Intel 386 running NetBSD
+# Host: NetBSD/i386 ELF
NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o
-XM_FILE= xm-nbsd.h
NAT_FILE= nm-nbsd.h
+XM_FILE= xm-nbsd.h
diff --git a/gdb/config/i386/nm-fbsd.h b/gdb/config/i386/nm-fbsd.h
index e47e9ef1a60..314e3a0f2f1 100644
--- a/gdb/config/i386/nm-fbsd.h
+++ b/gdb/config/i386/nm-fbsd.h
@@ -1,5 +1,6 @@
/* Native-dependent definitions for FreeBSD/i386.
- Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1997, 2000, 2001
+
+ Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1997, 2000, 2001, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -87,20 +88,10 @@ extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno);
/* Shared library support. */
-/* The FreeBSD <link.h> uses the same condition to distinguish ELF
- from a.out. ELF implies SVR4 shared libraries. */
-#if (defined (FREEBSD_ELF) || defined (__ELF__)) && !defined (FREEBSD_AOUT)
-#define SVR4_SHARED_LIBS
-#endif
-
-#include "solib.h" /* Support for shared libraries. */
-#ifdef SVR4_SHARED_LIBS
-#include "elf/common.h" /* Additional ELF shared library info. */
-#endif
-
-#ifndef SVR4_SHARED_LIBS
+#include "solib.h"
-/* Make structure definitions match up with those expected in `solib.c'. */
+/* Make structure definitions match up with those expected in
+ `solib-sunos.c'. */
#define link_object sod
#define lo_name sod_name
@@ -154,6 +145,4 @@ extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno);
#define ld_un d_un
#define ld_2 d_sdt
-#endif /* !SVR4_SHARED_LIBS */
-
-#endif /* NM_FBSD_H */
+#endif /* nm-fbsd.h */
diff --git a/gdb/config/i386/nm-fbsd64.h b/gdb/config/i386/nm-fbsd64.h
index e5b66df15ed..4c27aff6d74 100644
--- a/gdb/config/i386/nm-fbsd64.h
+++ b/gdb/config/i386/nm-fbsd64.h
@@ -1,6 +1,6 @@
/* Native-dependent definitions for FreeBSD/amd64.
- Copyright 2003
- Free Software Foundation, Inc.
+
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -33,10 +33,5 @@
/* We can attach and detach. */
#define ATTACH_DETACH
-
-
-/* Shared library support. */
-
-#include "solib.h"
#endif /* nm-fbsd64.h */
diff --git a/gdb/config/i386/nm-i386bsd.h b/gdb/config/i386/nm-i386bsd.h
deleted file mode 100644
index 628c648bf77..00000000000
--- a/gdb/config/i386/nm-i386bsd.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1993, 2000
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef NM_I386BSD_H
-#define NM_I386BSD_H
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#include <machine/vmparam.h>
-#define KERNEL_U_ADDR USRSTACK
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- (addr) = i386_register_u_addr ((blockend),(regno));
-
-extern int i386_register_u_addr (int, int);
-
-#define PTRACE_ARG3_TYPE char*
-
-#endif /* NM_I386BSD_H */
diff --git a/gdb/config/i386/nm-x86-64linux.h b/gdb/config/i386/nm-linux64.h
index d1ac9104a15..1764758f3b9 100644
--- a/gdb/config/i386/nm-x86-64linux.h
+++ b/gdb/config/i386/nm-linux64.h
@@ -1,6 +1,6 @@
/* Native support for GNU/Linux x86-64.
- Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
@@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef NM_X86_64_LINUX_H
-#define NM_X86_64_LINUX_H
+#ifndef NM_LINUX64_H
+#define NM_LINUX64_H
/* GNU/Linux supports the i386 hardware debugging registers. */
#define I386_USE_GENERIC_WATCHPOINTS
@@ -35,21 +35,21 @@
/* Provide access to the i386 hardware debugging registers. */
-extern void x86_64_linux_dr_set_control (unsigned long control);
+extern void amd64_linux_dr_set_control (unsigned long control);
#define I386_DR_LOW_SET_CONTROL(control) \
- x86_64_linux_dr_set_control (control)
+ amd64_linux_dr_set_control (control)
-extern void x86_64_linux_dr_set_addr (int regnum, CORE_ADDR addr);
+extern void amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr);
#define I386_DR_LOW_SET_ADDR(regnum, addr) \
- x86_64_linux_dr_set_addr (regnum, addr)
+ amd64_linux_dr_set_addr (regnum, addr)
-extern void x86_64_linux_dr_reset_addr (int regnum);
+extern void amd64_linux_dr_reset_addr (int regnum);
#define I386_DR_LOW_RESET_ADDR(regnum) \
- x86_64_linux_dr_reset_addr (regnum)
+ amd64_linux_dr_reset_addr (regnum)
-extern unsigned long x86_64_linux_dr_get_status (void);
+extern unsigned long amd64_linux_dr_get_status (void);
#define I386_DR_LOW_GET_STATUS() \
- x86_64_linux_dr_get_status ()
+ amd64_linux_dr_get_status ()
/* Type of the third argument to the `ptrace' system call. */
@@ -66,4 +66,4 @@ extern unsigned long x86_64_linux_dr_get_status (void);
`x86-86-linux-nat.c' instead, which calls both. */
#define LINUX_CHILD_POST_STARTUP_INFERIOR
-#endif /* NM_X86_64_LINUX_H */
+#endif /* nm-linux64.h */
diff --git a/gdb/config/i386/nm-nbsd.h b/gdb/config/i386/nm-nbsd.h
index 2e5adb82b3d..fef50f37bf5 100644
--- a/gdb/config/i386/nm-nbsd.h
+++ b/gdb/config/i386/nm-nbsd.h
@@ -1,5 +1,6 @@
-/* Native-dependent definitions for Intel 386 running NetBSD, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1994, 2000, 2002
+/* Native-dependent definitions for NetBSD/i386.
+
+ Copyright 1986, 1987, 1989, 1992, 1994, 2000, 2002, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -22,7 +23,7 @@
#ifndef NM_NBSD_H
#define NM_NBSD_H
-/* Get generic NetBSD native definitions. */
+/* Get generic NetBSD native definitions. */
#include "config/nm-nbsd.h"
-#endif /* NM_NBSD_H */
+#endif /* nm-nbsd.h */
diff --git a/gdb/config/i386/nm-nbsdaout.h b/gdb/config/i386/nm-nbsdaout.h
index dc8aac961c4..375a6a02d95 100644
--- a/gdb/config/i386/nm-nbsdaout.h
+++ b/gdb/config/i386/nm-nbsdaout.h
@@ -1,5 +1,6 @@
-/* Native-dependent definitions for Intel 386 running NetBSD, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1994, 1996, 2000
+/* Native-dependent definitions for NetBSD/i386 a.out.
+
+ Copyright 1986, 1987, 1989, 1992, 1994, 1996, 2000, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -24,7 +25,7 @@
#include "i386/nm-nbsd.h"
-/* Get generic NetBSD a.out native definitions. */
+/* Get generic NetBSD a.out native definitions. */
#include "config/nm-nbsdaout.h"
-#endif /* NM_NBSDAOUT_H */
+#endif /* nm-nbsdaout.h */
diff --git a/gdb/config/i386/nm-obsd.h b/gdb/config/i386/nm-obsd.h
index 6113e140088..4d10b539d86 100644
--- a/gdb/config/i386/nm-obsd.h
+++ b/gdb/config/i386/nm-obsd.h
@@ -1,5 +1,6 @@
/* Native-dependent definitions for OpenBSD/i386.
- Copyright 2001 Free Software Foundation, Inc.
+
+ Copyright 2001, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -51,9 +52,10 @@ extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno);
/* Shared library support. */
-#include "solib.h" /* Support for shared libraries. */
+#include "solib.h"
-/* Make structure definitions match up with those expected in `solib.c'. */
+/* Make structure definitions match up with those expected in
+ `solib-sunos.c'. */
#define link_object sod
#define lo_name sod_name
diff --git a/gdb/config/i386/obsd.mh b/gdb/config/i386/obsd.mh
index 316f04f9233..50a4fb71062 100644
--- a/gdb/config/i386/obsd.mh
+++ b/gdb/config/i386/obsd.mh
@@ -1,10 +1,4 @@
# Host: OpenBSD/i386 ELF
-
-XM_FILE= xm-i386.h
-
-NAT_FILE= nm-obsd.h
NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o i386obsd-nat.o
-
-# The OpenBSD yacc generates yyname and yyrule tables that conflict at
-# link time if we define YYDEBUG to a non-zero value.
-MH_CFLAGS= -DYYDEBUG=0
+NAT_FILE= nm-obsd.h
+XM_FILE= xm-i386.h
diff --git a/gdb/config/i386/obsd.mt b/gdb/config/i386/obsd.mt
index c49ae606c50..58e0fc0ebc8 100644
--- a/gdb/config/i386/obsd.mt
+++ b/gdb/config/i386/obsd.mt
@@ -1,4 +1,4 @@
# Target: OpenBSD/i386
-TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386obsd-tdep.o corelow.o \
- solib.o solib-svr4.o
+TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386obsd-tdep.o \
+ corelow.o solib.o solib-svr4.o
TM_FILE= tm-nbsd.h
diff --git a/gdb/config/i386/obsd64.mh b/gdb/config/i386/obsd64.mh
index 9e196ad8b78..99ccfa2023f 100644
--- a/gdb/config/i386/obsd64.mh
+++ b/gdb/config/i386/obsd64.mh
@@ -1,7 +1,5 @@
# Host: OpenBSD/amd64
-
-XM_FILE= xm-i386.h
-
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+ amd64-nat.o amd64bsd-nat.o amd64obsd-nat.o
NAT_FILE= nm-nbsd.h
-# NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
-NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o corelow.o amd64-nat.o amd64bsd-nat.o amd64obsd-nat.o
+XM_FILE= xm-i386.h
diff --git a/gdb/config/i386/obsd64.mt b/gdb/config/i386/obsd64.mt
index 20a35d1ef94..16be0798e7f 100644
--- a/gdb/config/i386/obsd64.mt
+++ b/gdb/config/i386/obsd64.mt
@@ -1,3 +1,5 @@
# Target: OpenBSD/amd64
-TDEPFILES= x86-64-tdep.o amd64obsd-tdep.o \
- i386-tdep.o i387-tdep.o i386bsd-tdep.o
+TDEPFILES= amd64-tdep.o amd64obsd-tdep.o \
+ i386-tdep.o i387-tdep.o i386bsd-tdep.o \
+ corelow.o solib.o solib-svr4.o
+TM_FILE= tm-nbsd.h
diff --git a/gdb/config/i386/obsdaout.mh b/gdb/config/i386/obsdaout.mh
new file mode 100644
index 00000000000..3577178946a
--- /dev/null
+++ b/gdb/config/i386/obsdaout.mh
@@ -0,0 +1,5 @@
+# Host: OpenBSD/i386 a.out
+NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o i386obsd-nat.o \
+ solib.o solib-sunos.o
+NAT_FILE= nm-obsd.h
+XM_FILE= xm-i386.h
diff --git a/gdb/config/i386/tm-fbsd.h b/gdb/config/i386/tm-fbsd.h
index 433ef849383..98a2702175c 100644
--- a/gdb/config/i386/tm-fbsd.h
+++ b/gdb/config/i386/tm-fbsd.h
@@ -1,5 +1,6 @@
/* Target-dependent definitions for FreeBSD/i386.
- Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -21,10 +22,10 @@
#ifndef TM_FBSD_H
#define TM_FBSD_H
-#include "i386/tm-i386.h"
+#include "solib.h"
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-#endif /* TM_FBSD_H */
+#endif /* tm-fbsd.h */
diff --git a/gdb/config/i386/tm-i386bsd.h b/gdb/config/i386/tm-i386bsd.h
deleted file mode 100644
index fef009ec01d..00000000000
--- a/gdb/config/i386/tm-i386bsd.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Macro definitions for i386 running under BSD Unix.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_I386BSD_H
-#define TM_I386BSD_H 1
-
-#include "i386/tm-i386.h"
-
-/* 386BSD cannot handle the segment registers. */
-/* BSDI can't handle them either. */
-
-#undef NUM_REGS
-#define NUM_REGS 10
-
-/* On 386 bsd, sigtramp is above the user stack and immediately below
- the user area. Using constants here allows for cross debugging.
- These are tested for BSDI but should work on 386BSD. */
-
-#define SIGTRAMP_START(pc) 0xfdbfdfc0
-#define SIGTRAMP_END(pc) 0xfdbfe000
-
-#endif /* ifndef TM_I386BSD_H */
diff --git a/gdb/config/i386/tm-x86-64linux.h b/gdb/config/i386/tm-linux64.h
index 4c16766f3a8..c3ff3521ea8 100644
--- a/gdb/config/i386/tm-x86-64linux.h
+++ b/gdb/config/i386/tm-linux64.h
@@ -1,6 +1,6 @@
-/* Definitions to target GDB to GNU/Linux on x86-64.
+/* Target-dependent definitions for GNU/Linux x86-64.
- Copyright 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michal Ludvig, SuSE Labs.
@@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef TM_X86_64LINUX_H
-#define TM_X86_64LINUX_H
+#ifndef TM_LINUX64_H
+#define TM_LINUX64_H
/* We define SVR4_SHARED_LIBS unconditionally, on the assumption that
link.h is available on all linux platforms. For I386 and SH3/4, we
@@ -33,4 +33,4 @@
#define SVR4_SHARED_LIBS
#include "solib.h" /* Support for shared libraries. */
-#endif /* #ifndef TM_X86_64LINUX_H */
+#endif /* tm-linux64.h */
diff --git a/gdb/config/i386/tm-nbsd.h b/gdb/config/i386/tm-nbsd.h
index 8e589281325..8fd41580765 100644
--- a/gdb/config/i386/tm-nbsd.h
+++ b/gdb/config/i386/tm-nbsd.h
@@ -1,5 +1,6 @@
-/* Macro definitions for i386 running under NetBSD.
- Copyright 1994, 1996, 2000, 2002 Free Software Foundation, Inc.
+/* Target-dependent definitions for NetBSD/i386.
+
+ Copyright 1994, 1996, 2000, 2002, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -21,7 +22,6 @@
#ifndef TM_NBSD_H
#define TM_NBSD_H
-#include "i386/tm-i386.h"
#include "solib.h"
-#endif /* TM_NBSD_H */
+#endif /* tm-nbsd.h */
diff --git a/gdb/config/i386/x86-64linux.mt b/gdb/config/i386/x86-64linux.mt
deleted file mode 100644
index 8bc4adbad4d..00000000000
--- a/gdb/config/i386/x86-64linux.mt
+++ /dev/null
@@ -1,6 +0,0 @@
-# Target: AMD x86-64 running GNU/Linux
-TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o \
- i386-tdep.o i387-tdep.o i386-linux-tdep.o glibc-tdep.o \
- solib.o solib-svr4.o solib-legacy.o corelow.o
-
-TM_FILE=tm-x86-64linux.h
diff --git a/gdb/config/i386/xm-i386.h b/gdb/config/i386/xm-i386.h
index 151e7a6b556..de29b265998 100644
--- a/gdb/config/i386/xm-i386.h
+++ b/gdb/config/i386/xm-i386.h
@@ -1,5 +1,6 @@
-/* Host-dependent definitions for i386.
- Copyright 2001 Free Software Foundation, Inc.
+/* Host-dependent definitions for the i386.
+
+ Copyright 2001, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -27,4 +28,4 @@
#define HOST_DOUBLE_FORMAT &floatformat_ieee_double_little
#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
-#endif /* XM_386_H */
+#endif /* xm-i386.h */
diff --git a/gdb/config/i386/xm-i386bsd.h b/gdb/config/i386/xm-i386bsd.h
deleted file mode 100644
index ca0ffb2ab8f..00000000000
--- a/gdb/config/i386/xm-i386bsd.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Host-dependent definitions for Intel 386 running BSD Unix, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1995, 1996
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <machine/limits.h> /* for INT_MIN */
diff --git a/gdb/config/i386/xm-nbsd.h b/gdb/config/i386/xm-nbsd.h
index 4a998cde4ee..703c261ebe8 100644
--- a/gdb/config/i386/xm-nbsd.h
+++ b/gdb/config/i386/xm-nbsd.h
@@ -1,5 +1,6 @@
-/* Parameters for execution on a i386 running NetBSD, for GDB.
- Copyright 1994, 2000 Free Software Foundation, Inc.
+/* Host-dependent definitions for NetBSD/i386.
+
+ Copyright 1994, 2000, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -18,7 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Get generic NetBSD host definitions. */
-#include "config/xm-nbsd.h"
+#include "i386/xm-i386.h"
-#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
+/* Get generic NetBSD host definitions. */
+#include "config/xm-nbsd.h"
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index b8c971c5dc5..9924ffa9678 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -1,6 +1,8 @@
/* Parameters for execution on any Hewlett-Packard PA-RISC machine.
- Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -29,14 +31,8 @@
#define GDB_MULTI_ARCH 1
-/* NOTE: cagney/2002-11-24: This is a guess. */
-#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0
-#define CALL_DUMMY_LOCATION ON_STACK
-#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address)
/* Hack, get around problem with including "arch-utils.h". */
struct frame_info;
-extern CORE_ADDR deprecated_init_frame_pc_default (int fromleaf, struct frame_info *prev);
-#define DEPRECATED_INIT_FRAME_PC(l,f) (deprecated_init_frame_pc_default (l, f))
/* Forward declarations of some types we use in prototypes */
@@ -109,10 +105,6 @@ extern int hppa_instruction_nullified (void);
#define INSTRUCTION_NULLIFIED hppa_instruction_nullified ()
#endif
-extern void hppa_frame_init_saved_regs (struct frame_info *);
-#define DEPRECATED_FRAME_INIT_SAVED_REGS(FI) \
- hppa_frame_init_saved_regs (FI)
-
#define INSTRUCTION_SIZE 4
/* This sequence of words is the instructions
diff --git a/gdb/configure b/gdb/configure
index a0fe6a69fd9..e4de4c94085 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -3102,6 +3102,75 @@ else :
echo "configure: warning: no curses library found" 1>&2
fi
+# Check whether the wborder function is provided by the curses
+# library detected above. In certain implementations such as
+# the HP/UX Hcurses for instance, this function is provided by an
+# additional library. So if we did not find this function inside
+# the curses library, try some alternate libraries we know might
+# provide it.
+
+echo $ac_n "checking for library containing wborder""... $ac_c" 1>&6
+echo "configure:3114: checking for library containing wborder" >&5
+if eval "test \"`echo '$''{'ac_cv_search_wborder'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_wborder="no"
+cat > conftest.$ac_ext <<EOF
+#line 3121 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char wborder();
+
+int main() {
+wborder()
+; return 0; }
+EOF
+if { (eval echo configure:3132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_search_wborder="none required"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+test "$ac_cv_search_wborder" = "no" && for i in cur_colr; do
+LIBS="-l$i $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3143 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char wborder();
+
+int main() {
+wborder()
+; return 0; }
+EOF
+if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_search_wborder="-l$i"
+break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+LIBS="$ac_func_search_save_LIBS"
+fi
+
+echo "$ac_t""$ac_cv_search_wborder" 1>&6
+if test "$ac_cv_search_wborder" != "no"; then
+ test "$ac_cv_search_wborder" = "none required" || LIBS="$ac_cv_search_wborder $LIBS"
+
+else :
+ echo "configure: warning: wborder function not found, tui will be disabled" 1>&2
+fi
+
# Enable TUI.
# Check whether --enable-tui or --disable-tui was given.
if test "${enable_tui+set}" = set; then
@@ -3118,7 +3187,7 @@ fi
if test x"$enable_tui" = xyes; then
if test -d $srcdir/tui; then
- if test "$ac_cv_search_initscr" != no; then
+ if test "$ac_cv_search_initscr" != no -a "$ac_cv_search_wborder" != no; then
CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
@@ -3172,17 +3241,17 @@ else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3176: checking for $ac_hdr" >&5
+echo "configure:3245: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3181 "configure"
+#line 3250 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3212,17 +3281,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3216: checking for $ac_hdr" >&5
+echo "configure:3285: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3221 "configure"
+#line 3290 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3260,17 +3329,17 @@ if test x"$enable_libunwind" = xyes; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3264: checking for $ac_hdr" >&5
+echo "configure:3333: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3269 "configure"
+#line 3338 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3300,17 +3369,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3304: checking for $ac_hdr" >&5
+echo "configure:3373: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3309 "configure"
+#line 3378 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3363,12 +3432,12 @@ fi
for ac_func in monstartup _mcleanup
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3367: checking for $ac_func" >&5
+echo "configure:3436: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3372 "configure"
+#line 3441 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3391,7 +3460,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3416,12 +3485,12 @@ fi
done
echo $ac_n "checking for _etext""... $ac_c" 1>&6
-echo "configure:3420: checking for _etext" >&5
+echo "configure:3489: checking for _etext" >&5
if eval "test \"`echo '$''{'ac_cv_var__etext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3425 "configure"
+#line 3494 "configure"
#include "confdefs.h"
#include <stdlib.h>
extern char _etext;
@@ -3430,7 +3499,7 @@ int main() {
free (&_etext);
; return 0; }
EOF
-if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var__etext=yes
else
@@ -3458,19 +3527,19 @@ if test "$enable_profiling" = yes ; then
CFLAGS="$CFLAGS $PROFILE_CFLAGS"
echo $ac_n "checking whether $CC supports -pg""... $ac_c" 1>&6
-echo "configure:3462: checking whether $CC supports -pg" >&5
+echo "configure:3531: checking whether $CC supports -pg" >&5
if eval "test \"`echo '$''{'ac_cv_cc_supports_pg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3467 "configure"
+#line 3536 "configure"
#include "confdefs.h"
int main() {
int x;
; return 0; }
EOF
-if { (eval echo configure:3474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cc_supports_pg=yes
else
@@ -3500,7 +3569,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3504: checking for $ac_word" >&5
+echo "configure:3573: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3541,7 +3610,7 @@ done
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:3545: checking for a BSD compatible install" >&5
+echo "configure:3614: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3594,7 +3663,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3598: checking whether ln -s works" >&5
+echo "configure:3667: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3617,7 +3686,7 @@ fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3621: checking for $ac_word" >&5
+echo "configure:3690: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3649,7 +3718,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3653: checking for $ac_word" >&5
+echo "configure:3722: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3683,7 +3752,7 @@ test -n "$YACC" || YACC="yacc"
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3687: checking for $ac_word" >&5
+echo "configure:3756: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3715,7 +3784,7 @@ fi
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3719: checking for $ac_word" >&5
+echo "configure:3788: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3747,7 +3816,7 @@ fi
# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
set dummy ${ac_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3751: checking for $ac_word" >&5
+echo "configure:3820: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3781,7 +3850,7 @@ fi
# Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
set dummy ${ac_tool_prefix}mig; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3785: checking for $ac_word" >&5
+echo "configure:3854: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3817,7 +3886,7 @@ fi
# We might need to link with -lm; most simulators need it.
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:3821: checking for main in -lm" >&5
+echo "configure:3890: checking for main in -lm" >&5
ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3825,14 +3894,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3829 "configure"
+#line 3898 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3865,12 +3934,12 @@ fi
# libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1
# is known to have this problem). Therefore we avoid libw if we can.
echo $ac_n "checking for wctype""... $ac_c" 1>&6
-echo "configure:3869: checking for wctype" >&5
+echo "configure:3938: checking for wctype" >&5
if eval "test \"`echo '$''{'ac_cv_func_wctype'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3874 "configure"
+#line 3943 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char wctype(); below. */
@@ -3893,7 +3962,7 @@ wctype();
; return 0; }
EOF
-if { (eval echo configure:3897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_wctype=yes"
else
@@ -3911,7 +3980,7 @@ if eval "test \"`echo '$ac_cv_func_'wctype`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6
-echo "configure:3915: checking for wctype in -lw" >&5
+echo "configure:3984: checking for wctype in -lw" >&5
ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3919,7 +3988,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lw $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3923 "configure"
+#line 3992 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3930,7 +3999,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:3934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3963,14 +4032,14 @@ fi
# Some systems (e.g. Solaris) have `gethostbyname' in libnsl.
echo $ac_n "checking for library containing gethostbyname""... $ac_c" 1>&6
-echo "configure:3967: checking for library containing gethostbyname" >&5
+echo "configure:4036: checking for library containing gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_search_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_gethostbyname="no"
cat > conftest.$ac_ext <<EOF
-#line 3974 "configure"
+#line 4043 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3981,7 +4050,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:3985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_gethostbyname="none required"
else
@@ -3992,7 +4061,7 @@ rm -f conftest*
test "$ac_cv_search_gethostbyname" = "no" && for i in nsl; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3996 "configure"
+#line 4065 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4003,7 +4072,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:4007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_gethostbyname="-l$i"
break
@@ -4027,14 +4096,14 @@ fi
# Some systems (e.g. Solaris) have `socketpair' in libsocket.
echo $ac_n "checking for library containing socketpair""... $ac_c" 1>&6
-echo "configure:4031: checking for library containing socketpair" >&5
+echo "configure:4100: checking for library containing socketpair" >&5
if eval "test \"`echo '$''{'ac_cv_search_socketpair'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_socketpair="no"
cat > conftest.$ac_ext <<EOF
-#line 4038 "configure"
+#line 4107 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4045,7 +4114,7 @@ int main() {
socketpair()
; return 0; }
EOF
-if { (eval echo configure:4049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_socketpair="none required"
else
@@ -4056,7 +4125,7 @@ rm -f conftest*
test "$ac_cv_search_socketpair" = "no" && for i in socket; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4060 "configure"
+#line 4129 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4067,7 +4136,7 @@ int main() {
socketpair()
; return 0; }
EOF
-if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_socketpair="-l$i"
break
@@ -4106,14 +4175,14 @@ case $host_os in
# ??? Why?
echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6
-echo "configure:4110: checking for library containing tgetent" >&5
+echo "configure:4179: checking for library containing tgetent" >&5
if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_tgetent="no"
cat > conftest.$ac_ext <<EOF
-#line 4117 "configure"
+#line 4186 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4124,7 +4193,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:4128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_tgetent="none required"
else
@@ -4135,7 +4204,7 @@ rm -f conftest*
test "$ac_cv_search_tgetent" = "no" && for i in tinfo ncurses curses termcap; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4139 "configure"
+#line 4208 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4146,7 +4215,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:4150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_tgetent="-l$i"
break
@@ -4173,14 +4242,14 @@ esac
# Readline doesn't, so I think we're safe with leaving them out.
echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6
-echo "configure:4177: checking for library containing tgetent" >&5
+echo "configure:4246: checking for library containing tgetent" >&5
if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_tgetent="no"
cat > conftest.$ac_ext <<EOF
-#line 4184 "configure"
+#line 4253 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4191,7 +4260,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:4195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_tgetent="none required"
else
@@ -4202,7 +4271,7 @@ rm -f conftest*
test "$ac_cv_search_tgetent" = "no" && for i in termcap tinfo ncurses Hcurses curses; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4206 "configure"
+#line 4275 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4213,7 +4282,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:4217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_tgetent="-l$i"
break
@@ -4247,12 +4316,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:4251: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4320: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4256 "configure"
+#line 4325 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -4260,7 +4329,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:4264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -4285,7 +4354,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:4289: checking for opendir in -ldir" >&5
+echo "configure:4358: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4293,7 +4362,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4297 "configure"
+#line 4366 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4304,7 +4373,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4326,7 +4395,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4330: checking for opendir in -lx" >&5
+echo "configure:4399: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4334,7 +4403,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4338 "configure"
+#line 4407 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4345,7 +4414,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4368,12 +4437,12 @@ fi
fi
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:4372: checking whether stat file-mode macros are broken" >&5
+echo "configure:4441: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4377 "configure"
+#line 4446 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -4424,12 +4493,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4428: checking for ANSI C header files" >&5
+echo "configure:4497: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4433 "configure"
+#line 4502 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -4437,7 +4506,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4454,7 +4523,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 4458 "configure"
+#line 4527 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -4472,7 +4541,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 4476 "configure"
+#line 4545 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -4493,7 +4562,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 4497 "configure"
+#line 4566 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -4504,7 +4573,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:4508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -4531,17 +4600,17 @@ for ac_hdr in link.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4535: checking for $ac_hdr" >&5
+echo "configure:4604: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4540 "configure"
+#line 4609 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4571,17 +4640,17 @@ for ac_hdr in machine/reg.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4575: checking for $ac_hdr" >&5
+echo "configure:4644: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4580 "configure"
+#line 4649 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4611,17 +4680,17 @@ for ac_hdr in nlist.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4615: checking for $ac_hdr" >&5
+echo "configure:4684: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4620 "configure"
+#line 4689 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4651,17 +4720,17 @@ for ac_hdr in poll.h sys/poll.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4655: checking for $ac_hdr" >&5
+echo "configure:4724: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4660 "configure"
+#line 4729 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4691,17 +4760,17 @@ for ac_hdr in proc_service.h thread_db.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4695: checking for $ac_hdr" >&5
+echo "configure:4764: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4700 "configure"
+#line 4769 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4731,17 +4800,17 @@ for ac_hdr in stddef.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4735: checking for $ac_hdr" >&5
+echo "configure:4804: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4740 "configure"
+#line 4809 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4771,17 +4840,17 @@ for ac_hdr in stdlib.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4775: checking for $ac_hdr" >&5
+echo "configure:4844: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4780 "configure"
+#line 4849 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4811,17 +4880,17 @@ for ac_hdr in stdint.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4815: checking for $ac_hdr" >&5
+echo "configure:4884: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4820 "configure"
+#line 4889 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4851,17 +4920,17 @@ for ac_hdr in string.h memory.h strings.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4855: checking for $ac_hdr" >&5
+echo "configure:4924: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4860 "configure"
+#line 4929 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4891,17 +4960,17 @@ for ac_hdr in sys/fault.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4895: checking for $ac_hdr" >&5
+echo "configure:4964: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4900 "configure"
+#line 4969 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4931,17 +5000,17 @@ for ac_hdr in sys/file.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4935: checking for $ac_hdr" >&5
+echo "configure:5004: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4940 "configure"
+#line 5009 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4971,17 +5040,17 @@ for ac_hdr in sys/filio.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4975: checking for $ac_hdr" >&5
+echo "configure:5044: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4980 "configure"
+#line 5049 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5011,17 +5080,17 @@ for ac_hdr in sys/ioctl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5015: checking for $ac_hdr" >&5
+echo "configure:5084: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5020 "configure"
+#line 5089 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5051,17 +5120,17 @@ for ac_hdr in sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5055: checking for $ac_hdr" >&5
+echo "configure:5124: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5060 "configure"
+#line 5129 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5091,17 +5160,17 @@ for ac_hdr in sys/proc.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5095: checking for $ac_hdr" >&5
+echo "configure:5164: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5100 "configure"
+#line 5169 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5131,17 +5200,17 @@ for ac_hdr in sys/procfs.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5135: checking for $ac_hdr" >&5
+echo "configure:5204: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5140 "configure"
+#line 5209 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5171,17 +5240,17 @@ for ac_hdr in sys/ptrace.h ptrace.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5175: checking for $ac_hdr" >&5
+echo "configure:5244: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5180 "configure"
+#line 5249 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5211,17 +5280,17 @@ for ac_hdr in sys/reg.h sys/debugreg.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5215: checking for $ac_hdr" >&5
+echo "configure:5284: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5220 "configure"
+#line 5289 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5251,17 +5320,17 @@ for ac_hdr in sys/select.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5255: checking for $ac_hdr" >&5
+echo "configure:5324: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5260 "configure"
+#line 5329 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5291,17 +5360,17 @@ for ac_hdr in sys/syscall.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5295: checking for $ac_hdr" >&5
+echo "configure:5364: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5300 "configure"
+#line 5369 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5331,17 +5400,17 @@ for ac_hdr in sys/user.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5335: checking for $ac_hdr" >&5
+echo "configure:5404: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5340 "configure"
+#line 5409 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5371,17 +5440,17 @@ for ac_hdr in sys/wait.h wait.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5375: checking for $ac_hdr" >&5
+echo "configure:5444: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5380 "configure"
+#line 5449 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5411,17 +5480,17 @@ for ac_hdr in termios.h termio.h sgtty.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5415: checking for $ac_hdr" >&5
+echo "configure:5484: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5420 "configure"
+#line 5489 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5451,17 +5520,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5455: checking for $ac_hdr" >&5
+echo "configure:5524: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5460 "configure"
+#line 5529 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5504,17 +5573,17 @@ for ac_hdr in curses.h ncurses.h term.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5508: checking for $ac_hdr" >&5
+echo "configure:5577: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5513 "configure"
+#line 5582 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5547,17 +5616,17 @@ for ac_hdr in ctype.h time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5551: checking for $ac_hdr" >&5
+echo "configure:5620: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5556 "configure"
+#line 5625 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5585,12 +5654,12 @@ done
echo $ac_n "checking for member st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:5589: checking for member st_blocks in struct stat" >&5
+echo "configure:5658: checking for member st_blocks in struct stat" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_stat_with_st_blocks_member'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5594 "configure"
+#line 5663 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -5598,7 +5667,7 @@ int main() {
struct stat st; (void) st.st_blocks;
; return 0; }
EOF
-if { (eval echo configure:5602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_stat_with_st_blocks_member=yes
else
@@ -5625,12 +5694,12 @@ for ac_func in getopt
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:5629: checking whether $ac_func is declared" >&5
+echo "configure:5698: checking whether $ac_func is declared" >&5
if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5634 "configure"
+#line 5703 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -5642,7 +5711,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:5646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -5679,12 +5748,12 @@ fi
# ------------------ #
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:5683: checking return type of signal handlers" >&5
+echo "configure:5752: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5688 "configure"
+#line 5757 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -5701,7 +5770,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:5705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -5725,12 +5794,12 @@ EOF
# ------------------------------------- #
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5729: checking for working const" >&5
+echo "configure:5798: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5734 "configure"
+#line 5803 "configure"
#include "confdefs.h"
int main() {
@@ -5779,7 +5848,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:5783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -5800,21 +5869,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:5804: checking for inline" >&5
+echo "configure:5873: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 5811 "configure"
+#line 5880 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:5818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -5847,19 +5916,19 @@ esac
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:5851: checking for working alloca.h" >&5
+echo "configure:5920: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5856 "configure"
+#line 5925 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:5863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -5880,12 +5949,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:5884: checking for alloca" >&5
+echo "configure:5953: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5889 "configure"
+#line 5958 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -5913,7 +5982,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:5917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -5945,12 +6014,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:5949: checking whether alloca needs Cray hooks" >&5
+echo "configure:6018: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5954 "configure"
+#line 6023 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -5975,12 +6044,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5979: checking for $ac_func" >&5
+echo "configure:6048: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5984 "configure"
+#line 6053 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6003,7 +6072,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6030,7 +6099,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:6034: checking stack direction for C alloca" >&5
+echo "configure:6103: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6038,7 +6107,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 6042 "configure"
+#line 6111 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -6057,7 +6126,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:6061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -6082,17 +6151,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6086: checking for $ac_hdr" >&5
+echo "configure:6155: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6091 "configure"
+#line 6160 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6121,12 +6190,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6125: checking for $ac_func" >&5
+echo "configure:6194: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6130 "configure"
+#line 6199 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6149,7 +6218,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6174,7 +6243,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6178: checking for working mmap" >&5
+echo "configure:6247: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6182,7 +6251,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 6186 "configure"
+#line 6255 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6322,7 +6391,7 @@ main()
}
EOF
-if { (eval echo configure:6326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -6345,12 +6414,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:6349: checking for pid_t" >&5
+echo "configure:6418: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6354 "configure"
+#line 6423 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -6379,17 +6448,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:6383: checking for vfork.h" >&5
+echo "configure:6452: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6388 "configure"
+#line 6457 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6414,18 +6483,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:6418: checking for working vfork" >&5
+echo "configure:6487: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:6424: checking for vfork" >&5
+echo "configure:6493: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6429 "configure"
+#line 6498 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -6448,7 +6517,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:6452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -6470,7 +6539,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 6474 "configure"
+#line 6543 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -6565,7 +6634,7 @@ main() {
}
}
EOF
-if { (eval echo configure:6569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -6590,12 +6659,12 @@ fi
for ac_func in canonicalize_file_name realpath
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6594: checking for $ac_func" >&5
+echo "configure:6663: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6599 "configure"
+#line 6668 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6618,7 +6687,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6645,12 +6714,12 @@ done
for ac_func in poll
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6649: checking for $ac_func" >&5
+echo "configure:6718: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6654 "configure"
+#line 6723 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6673,7 +6742,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6700,12 +6769,12 @@ done
for ac_func in pread64
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6704: checking for $ac_func" >&5
+echo "configure:6773: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6709 "configure"
+#line 6778 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6728,7 +6797,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6755,12 +6824,12 @@ done
for ac_func in sbrk
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6759: checking for $ac_func" >&5
+echo "configure:6828: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6764 "configure"
+#line 6833 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6783,7 +6852,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6810,12 +6879,12 @@ done
for ac_func in setpgid setpgrp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6814: checking for $ac_func" >&5
+echo "configure:6883: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6819 "configure"
+#line 6888 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6838,7 +6907,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6865,12 +6934,12 @@ done
for ac_func in sigaction sigprocmask sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6869: checking for $ac_func" >&5
+echo "configure:6938: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6874 "configure"
+#line 6943 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6893,7 +6962,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6920,12 +6989,12 @@ done
for ac_func in socketpair
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6924: checking for $ac_func" >&5
+echo "configure:6993: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6929 "configure"
+#line 6998 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6948,7 +7017,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6975,12 +7044,12 @@ done
for ac_func in syscall
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6979: checking for $ac_func" >&5
+echo "configure:7048: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6984 "configure"
+#line 7053 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7003,7 +7072,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -7030,7 +7099,7 @@ done
if test "$cross_compiling" = no; then
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:7034: checking whether setpgrp takes no argument" >&5
+echo "configure:7103: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7038,7 +7107,7 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 7042 "configure"
+#line 7111 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -7058,7 +7127,7 @@ main()
}
EOF
-if { (eval echo configure:7062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setpgrp_void=no
else
@@ -7083,12 +7152,12 @@ fi
else
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:7087: checking whether setpgrp takes no argument" >&5
+echo "configure:7156: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7092 "configure"
+#line 7161 "configure"
#include "confdefs.h"
#include <unistd.h>
@@ -7102,7 +7171,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:7106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_func_setpgrp_void=no
else
@@ -7126,12 +7195,12 @@ fi
# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
# since sigsetjmp might only be defined as a macro.
echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:7130: checking for sigsetjmp" >&5
+echo "configure:7199: checking for sigsetjmp" >&5
if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7135 "configure"
+#line 7204 "configure"
#include "confdefs.h"
#include <setjmp.h>
@@ -7140,7 +7209,7 @@ int main() {
sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
; return 0; }
EOF
-if { (eval echo configure:7144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_func_sigsetjmp=yes
else
@@ -7166,12 +7235,12 @@ gdb_use_included_regex=yes
# However, if the system regex is GNU regex, then default to *not*
# using the included regex.
echo $ac_n "checking for GNU regex""... $ac_c" 1>&6
-echo "configure:7170: checking for GNU regex" >&5
+echo "configure:7239: checking for GNU regex" >&5
if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7175 "configure"
+#line 7244 "configure"
#include "confdefs.h"
#include <gnu-versions.h>
int main() {
@@ -7181,7 +7250,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:7185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_gnu_regex=yes
else
@@ -7215,12 +7284,12 @@ fi
# See if <machine/reg.h> degines `struct reg'.
echo $ac_n "checking for struct reg in machine/reg.h""... $ac_c" 1>&6
-echo "configure:7219: checking for struct reg in machine/reg.h" >&5
+echo "configure:7288: checking for struct reg in machine/reg.h" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7224 "configure"
+#line 7293 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <machine/reg.h>
@@ -7228,7 +7297,7 @@ int main() {
struct reg r;
; return 0; }
EOF
-if { (eval echo configure:7232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg=yes
else
@@ -7251,19 +7320,19 @@ fi
# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6
-echo "configure:7255: checking for r_fs in struct reg" >&5
+echo "configure:7324: checking for r_fs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7260 "configure"
+#line 7329 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_fs;
; return 0; }
EOF
-if { (eval echo configure:7267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_fs=yes
else
@@ -7283,19 +7352,19 @@ EOF
fi
echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
-echo "configure:7287: checking for r_gs in struct reg" >&5
+echo "configure:7356: checking for r_gs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7292 "configure"
+#line 7361 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_gs;
; return 0; }
EOF
-if { (eval echo configure:7299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_gs=yes
else
@@ -7317,19 +7386,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
-echo "configure:7321: checking for PTRACE_GETREGS" >&5
+echo "configure:7390: checking for PTRACE_GETREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7326 "configure"
+#line 7395 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETREGS;
; return 0; }
EOF
-if { (eval echo configure:7333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getregs=yes
else
@@ -7351,19 +7420,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
-echo "configure:7355: checking for PTRACE_GETFPXREGS" >&5
+echo "configure:7424: checking for PTRACE_GETFPXREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7360 "configure"
+#line 7429 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETFPXREGS;
; return 0; }
EOF
-if { (eval echo configure:7367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getfpxregs=yes
else
@@ -7385,12 +7454,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
-echo "configure:7389: checking for PT_GETDBREGS" >&5
+echo "configure:7458: checking for PT_GETDBREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7394 "configure"
+#line 7463 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -7398,7 +7467,7 @@ int main() {
PT_GETDBREGS;
; return 0; }
EOF
-if { (eval echo configure:7402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getdbregs=yes
else
@@ -7420,12 +7489,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
-echo "configure:7424: checking for PT_GETXMMREGS" >&5
+echo "configure:7493: checking for PT_GETXMMREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7429 "configure"
+#line 7498 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -7433,7 +7502,7 @@ int main() {
PT_GETXMMREGS;
; return 0; }
EOF
-if { (eval echo configure:7437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getxmmregs=yes
else
@@ -7456,19 +7525,19 @@ fi
# See if stdint.h provides the uintptr_t type.
# Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this.
echo $ac_n "checking for uintptr_t in stdint.h""... $ac_c" 1>&6
-echo "configure:7460: checking for uintptr_t in stdint.h" >&5
+echo "configure:7529: checking for uintptr_t in stdint.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_uintptr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7465 "configure"
+#line 7534 "configure"
#include "confdefs.h"
#include <stdint.h>
int main() {
uintptr_t foo = 0;
; return 0; }
EOF
-if { (eval echo configure:7472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_uintptr_t=yes
else
@@ -7489,12 +7558,12 @@ EOF
fi
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:7493: checking whether malloc must be declared" >&5
+echo "configure:7562: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7498 "configure"
+#line 7567 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7515,7 +7584,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:7519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -7536,12 +7605,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:7540: checking whether realloc must be declared" >&5
+echo "configure:7609: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7545 "configure"
+#line 7614 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7562,7 +7631,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:7566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -7583,12 +7652,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:7587: checking whether free must be declared" >&5
+echo "configure:7656: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7592 "configure"
+#line 7661 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7609,7 +7678,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:7613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -7630,12 +7699,12 @@ EOF
fi
echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:7634: checking whether strerror must be declared" >&5
+echo "configure:7703: checking whether strerror must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7639 "configure"
+#line 7708 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7656,7 +7725,7 @@ int main() {
char *(*pfn) = (char *(*)) strerror
; return 0; }
EOF
-if { (eval echo configure:7660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strerror=no
else
@@ -7677,12 +7746,12 @@ EOF
fi
echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:7681: checking whether strdup must be declared" >&5
+echo "configure:7750: checking whether strdup must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7686 "configure"
+#line 7755 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7703,7 +7772,7 @@ int main() {
char *(*pfn) = (char *(*)) strdup
; return 0; }
EOF
-if { (eval echo configure:7707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strdup=no
else
@@ -7724,12 +7793,12 @@ EOF
fi
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:7728: checking whether strstr must be declared" >&5
+echo "configure:7797: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7733 "configure"
+#line 7802 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7750,7 +7819,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:7754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -7771,12 +7840,12 @@ EOF
fi
echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:7775: checking whether canonicalize_file_name must be declared" >&5
+echo "configure:7844: checking whether canonicalize_file_name must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7780 "configure"
+#line 7849 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7797,7 +7866,7 @@ int main() {
char *(*pfn) = (char *(*)) canonicalize_file_name
; return 0; }
EOF
-if { (eval echo configure:7801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_canonicalize_file_name=no
else
@@ -7823,9 +7892,9 @@ fi
# could be expunged. --jsm 1999-03-22
echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
-echo "configure:7827: checking for HPUX save_state structure" >&5
+echo "configure:7896: checking for HPUX save_state structure" >&5
cat > conftest.$ac_ext <<EOF
-#line 7829 "configure"
+#line 7898 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -7840,7 +7909,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 7844 "configure"
+#line 7913 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -7910,12 +7979,12 @@ fi
if test "$ac_cv_header_sys_procfs_h" = yes; then
echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7914: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:7983: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7919 "configure"
+#line 7988 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7924,7 +7993,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:7928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -7946,12 +8015,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7950: checking for prrun_t in sys/procfs.h" >&5
+echo "configure:8019: checking for prrun_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7955 "configure"
+#line 8024 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7960,7 +8029,7 @@ int main() {
prrun_t avar
; return 0; }
EOF
-if { (eval echo configure:7964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prrun_t=yes
else
@@ -7982,12 +8051,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6
echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7986: checking for gregset_t in sys/procfs.h" >&5
+echo "configure:8055: checking for gregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7991 "configure"
+#line 8060 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7996,7 +8065,7 @@ int main() {
gregset_t avar
; return 0; }
EOF
-if { (eval echo configure:8000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_gregset_t=yes
else
@@ -8018,12 +8087,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6
echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8022: checking for fpregset_t in sys/procfs.h" >&5
+echo "configure:8091: checking for fpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8027 "configure"
+#line 8096 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8032,7 +8101,7 @@ int main() {
fpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:8036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_fpregset_t=yes
else
@@ -8054,12 +8123,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6
echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8058: checking for prgregset_t in sys/procfs.h" >&5
+echo "configure:8127: checking for prgregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8063 "configure"
+#line 8132 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8068,7 +8137,7 @@ int main() {
prgregset_t avar
; return 0; }
EOF
-if { (eval echo configure:8072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset_t=yes
else
@@ -8090,12 +8159,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6
echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8094: checking for prfpregset_t in sys/procfs.h" >&5
+echo "configure:8163: checking for prfpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8099 "configure"
+#line 8168 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8104,7 +8173,7 @@ int main() {
prfpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:8108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset_t=yes
else
@@ -8126,12 +8195,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6
echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8130: checking for prgregset32_t in sys/procfs.h" >&5
+echo "configure:8199: checking for prgregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8135 "configure"
+#line 8204 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8140,7 +8209,7 @@ int main() {
prgregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:8144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset32_t=yes
else
@@ -8162,12 +8231,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6
echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8166: checking for prfpregset32_t in sys/procfs.h" >&5
+echo "configure:8235: checking for prfpregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8171 "configure"
+#line 8240 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8176,7 +8245,7 @@ int main() {
prfpregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:8180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset32_t=yes
else
@@ -8198,12 +8267,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6
echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8202: checking for lwpid_t in sys/procfs.h" >&5
+echo "configure:8271: checking for lwpid_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8207 "configure"
+#line 8276 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8212,7 +8281,7 @@ int main() {
lwpid_t avar
; return 0; }
EOF
-if { (eval echo configure:8216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpid_t=yes
else
@@ -8234,12 +8303,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6
echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8238: checking for psaddr_t in sys/procfs.h" >&5
+echo "configure:8307: checking for psaddr_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8243 "configure"
+#line 8312 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8248,7 +8317,7 @@ int main() {
psaddr_t avar
; return 0; }
EOF
-if { (eval echo configure:8252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psaddr_t=yes
else
@@ -8270,12 +8339,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8274: checking for prsysent_t in sys/procfs.h" >&5
+echo "configure:8343: checking for prsysent_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8279 "configure"
+#line 8348 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8284,7 +8353,7 @@ int main() {
prsysent_t avar
; return 0; }
EOF
-if { (eval echo configure:8288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prsysent_t=yes
else
@@ -8306,12 +8375,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6
echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8310: checking for pr_sigset_t in sys/procfs.h" >&5
+echo "configure:8379: checking for pr_sigset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8315 "configure"
+#line 8384 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8320,7 +8389,7 @@ int main() {
pr_sigset_t avar
; return 0; }
EOF
-if { (eval echo configure:8324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigset_t=yes
else
@@ -8342,12 +8411,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6
echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8346: checking for pr_sigaction64_t in sys/procfs.h" >&5
+echo "configure:8415: checking for pr_sigaction64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8351 "configure"
+#line 8420 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8356,7 +8425,7 @@ int main() {
pr_sigaction64_t avar
; return 0; }
EOF
-if { (eval echo configure:8360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes
else
@@ -8378,12 +8447,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6
echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8382: checking for pr_siginfo64_t in sys/procfs.h" >&5
+echo "configure:8451: checking for pr_siginfo64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8387 "configure"
+#line 8456 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8392,7 +8461,7 @@ int main() {
pr_siginfo64_t avar
; return 0; }
EOF
-if { (eval echo configure:8396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes
else
@@ -8419,7 +8488,7 @@ EOF
if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6
-echo "configure:8423: checking whether prfpregset_t type is broken" >&5
+echo "configure:8492: checking whether prfpregset_t type is broken" >&5
if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8427,7 +8496,7 @@ else
gdb_cv_prfpregset_t_broken=yes
else
cat > conftest.$ac_ext <<EOF
-#line 8431 "configure"
+#line 8500 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main ()
@@ -8437,7 +8506,7 @@ else
return 0;
}
EOF
-if { (eval echo configure:8441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_prfpregset_t_broken=no
else
@@ -8462,12 +8531,12 @@ EOF
echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8466: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
+echo "configure:8535: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8471 "configure"
+#line 8540 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/types.h>
@@ -8480,7 +8549,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:8484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_procfs_piocset=yes
else
@@ -8504,19 +8573,19 @@ fi
if test ${host} = ${target} ; then
echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8508: checking for member l_addr in struct link_map" >&5
+echo "configure:8577: checking for member l_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8513 "configure"
+#line 8582 "configure"
#include "confdefs.h"
#include <link.h>
int main() {
struct link_map lm; (void) lm.l_addr;
; return 0; }
EOF
-if { (eval echo configure:8520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_l_members=yes
else
@@ -8538,12 +8607,12 @@ EOF
echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8542: checking for member lm_addr in struct link_map" >&5
+echo "configure:8611: checking for member lm_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8547 "configure"
+#line 8616 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <link.h>
@@ -8551,7 +8620,7 @@ int main() {
struct link_map lm; (void) lm.lm_addr;
; return 0; }
EOF
-if { (eval echo configure:8555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_lm_members=yes
else
@@ -8573,12 +8642,12 @@ EOF
echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
-echo "configure:8577: checking for member som_addr in struct so_map" >&5
+echo "configure:8646: checking for member som_addr in struct so_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8582 "configure"
+#line 8651 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_NLIST_H
@@ -8589,7 +8658,7 @@ int main() {
struct so_map lm; (void) lm.som_addr;
; return 0; }
EOF
-if { (eval echo configure:8593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_so_map_with_som_members=yes
else
@@ -8611,12 +8680,12 @@ EOF
echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
-echo "configure:8615: checking for struct link_map32 in sys/link.h" >&5
+echo "configure:8684: checking for struct link_map32 in sys/link.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8620 "configure"
+#line 8689 "configure"
#include "confdefs.h"
#define _SYSCALL32
#include <sys/link.h>
@@ -8624,7 +8693,7 @@ int main() {
struct link_map32 l;
; return 0; }
EOF
-if { (eval echo configure:8628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map32=yes
else
@@ -8651,12 +8720,12 @@ fi
echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:8655: checking for long long support in compiler" >&5
+echo "configure:8724: checking for long long support in compiler" >&5
if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8660 "configure"
+#line 8729 "configure"
#include "confdefs.h"
int main() {
@@ -8666,7 +8735,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:8670: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_c_long_long=yes
else
@@ -8688,7 +8757,7 @@ fi
echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:8692: checking for long long support in printf" >&5
+echo "configure:8761: checking for long long support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8696,7 +8765,7 @@ else
gdb_cv_printf_has_long_long=no
else
cat > conftest.$ac_ext <<EOF
-#line 8700 "configure"
+#line 8769 "configure"
#include "confdefs.h"
int main () {
@@ -8710,7 +8779,7 @@ int main () {
return (strcmp ("0x0123456789abcdef", buf));
}
EOF
-if { (eval echo configure:8714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_long=yes
else
@@ -8734,19 +8803,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
-echo "configure:8738: checking for long double support in compiler" >&5
+echo "configure:8807: checking for long double support in compiler" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8743 "configure"
+#line 8812 "configure"
#include "confdefs.h"
int main() {
long double foo;
; return 0; }
EOF
-if { (eval echo configure:8750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_double=yes
else
@@ -8768,7 +8837,7 @@ fi
echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:8772: checking for long double support in printf" >&5
+echo "configure:8841: checking for long double support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8776,7 +8845,7 @@ else
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 8780 "configure"
+#line 8849 "configure"
#include "confdefs.h"
int main () {
@@ -8786,7 +8855,7 @@ int main () {
return (strncmp ("3.14159", buf, 7));
}
EOF
-if { (eval echo configure:8790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_double=yes
else
@@ -8810,7 +8879,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6
echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
-echo "configure:8814: checking for long double support in scanf" >&5
+echo "configure:8883: checking for long double support in scanf" >&5
if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8818,7 +8887,7 @@ else
gdb_cv_scanf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 8822 "configure"
+#line 8891 "configure"
#include "confdefs.h"
int main () {
@@ -8828,7 +8897,7 @@ int main () {
return !(f > 3.14159 && f < 3.14160);
}
EOF
-if { (eval echo configure:8832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_scanf_has_long_double=yes
else
@@ -8853,7 +8922,7 @@ echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6
case ${host_os} in
aix*)
echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
-echo "configure:8857: checking for -bbigtoc option" >&5
+echo "configure:8926: checking for -bbigtoc option" >&5
if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8867,14 +8936,14 @@ else
LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
cat > conftest.$ac_ext <<EOF
-#line 8871 "configure"
+#line 8940 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:8878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
:
else
echo "configure: failed program was:" >&5
@@ -8897,7 +8966,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
case ${host_os} in
hpux*)
echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
-echo "configure:8901: checking for HPUX/OSF thread support" >&5
+echo "configure:8970: checking for HPUX/OSF thread support" >&5
if test -f /usr/include/dce/cma_config.h ; then
if test "$GCC" = "yes" ; then
echo "$ac_t""yes" 1>&6
@@ -8920,7 +8989,7 @@ EOF
# because version 0 (present on Solaris 2.4 or earlier) doesn't have
# the same API.
echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:8924: checking for Solaris thread debugging library" >&5
+echo "configure:8993: checking for Solaris thread debugging library" >&5
if test -f /usr/lib/libthread_db.so.1 ; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
@@ -8930,7 +8999,7 @@ EOF
CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:8934: checking for dlopen in -ldl" >&5
+echo "configure:9003: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8938,7 +9007,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8942 "configure"
+#line 9011 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -8949,7 +9018,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:8953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -8981,17 +9050,17 @@ fi
# all symbols visible in the dynamic symbol table.
hold_ldflags=$LDFLAGS
echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
-echo "configure:8985: checking for the ld -export-dynamic flag" >&5
+echo "configure:9054: checking for the ld -export-dynamic flag" >&5
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
cat > conftest.$ac_ext <<EOF
-#line 8988 "configure"
+#line 9057 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:8995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
found=yes
else
@@ -9010,13 +9079,13 @@ rm -f conftest*
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
-echo "configure:9014: checking if <proc_service.h> is old" >&5
+echo "configure:9083: checking if <proc_service.h> is old" >&5
if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9020 "configure"
+#line 9089 "configure"
#include "confdefs.h"
#include <proc_service.h>
@@ -9027,7 +9096,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:9031: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_proc_service_is_old=no
else
@@ -9053,12 +9122,12 @@ EOF
;;
aix*)
echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6
-echo "configure:9057: checking for AiX thread debugging library" >&5
+echo "configure:9126: checking for AiX thread debugging library" >&5
if eval "test \"`echo '$''{'gdb_cv_have_aix_thread_debug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9062 "configure"
+#line 9131 "configure"
#include "confdefs.h"
#include <sys/pthdebug.h>
int main() {
@@ -9067,7 +9136,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:9071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_aix_thread_debug=yes
else
@@ -9092,19 +9161,19 @@ fi
if test "x$ac_cv_header_thread_db_h" = "xyes"; then
echo $ac_n "checking whether <thread_db.h> has TD_NOTALLOC""... $ac_c" 1>&6
-echo "configure:9096: checking whether <thread_db.h> has TD_NOTALLOC" >&5
+echo "configure:9165: checking whether <thread_db.h> has TD_NOTALLOC" >&5
if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9101 "configure"
+#line 9170 "configure"
#include "confdefs.h"
#include <thread_db.h>
int main() {
int i = TD_NOTALLOC;
; return 0; }
EOF
-if { (eval echo configure:9108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_thread_db_h_has_td_notalloc=yes
else
@@ -9129,19 +9198,19 @@ fi
if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
echo $ac_n "checking whether <sys/syscall.h> has __NR_tkill""... $ac_c" 1>&6
-echo "configure:9133: checking whether <sys/syscall.h> has __NR_tkill" >&5
+echo "configure:9202: checking whether <sys/syscall.h> has __NR_tkill" >&5
if eval "test \"`echo '$''{'gdb_cv_sys_syscall_h_has_tkill'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9138 "configure"
+#line 9207 "configure"
#include "confdefs.h"
#include <sys/syscall.h>
int main() {
int i = __NR_tkill;
; return 0; }
EOF
-if { (eval echo configure:9145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_sys_syscall_h_has_tkill=yes
else
@@ -9253,7 +9322,7 @@ WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
then
echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6
-echo "configure:9257: checking compiler warning flags" >&5
+echo "configure:9326: checking compiler warning flags" >&5
# Separate out the -Werror flag as some files just cannot be
# compiled with it enabled.
for w in ${build_warnings}; do
@@ -9263,14 +9332,14 @@ echo "configure:9257: checking compiler warning flags" >&5
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $w"
cat > conftest.$ac_ext <<EOF
-#line 9267 "configure"
+#line 9336 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:9274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
WARN_CFLAGS="${WARN_CFLAGS} $w"
else
@@ -9288,12 +9357,12 @@ fi
# In the Cygwin environment, we need some additional flags.
echo $ac_n "checking for cygwin""... $ac_c" 1>&6
-echo "configure:9292: checking for cygwin" >&5
+echo "configure:9361: checking for cygwin" >&5
if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9297 "configure"
+#line 9366 "configure"
#include "confdefs.h"
#if defined (__CYGWIN__) || defined (__CYGWIN32__)
@@ -9371,7 +9440,7 @@ if test "${with_tclconfig+set}" = set; then
fi
echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:9375: checking for Tcl configuration" >&5
+echo "configure:9444: checking for Tcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -9480,7 +9549,7 @@ if test "${with_tkconfig+set}" = set; then
fi
echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:9484: checking for Tk configuration" >&5
+echo "configure:9553: checking for Tk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -9589,7 +9658,7 @@ fi
no_tcl=true
echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:9593: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:9662: checking for Tcl private headers. dir=${configdir}" >&5
# Check whether --with-tclinclude or --without-tclinclude was given.
if test "${with_tclinclude+set}" = set; then
withval="$with_tclinclude"
@@ -9655,17 +9724,17 @@ fi
if test x"${ac_cv_c_tclh}" = x ; then
ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
-echo "configure:9659: checking for tclInt.h" >&5
+echo "configure:9728: checking for tclInt.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9664 "configure"
+#line 9733 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -9725,7 +9794,7 @@ fi
#
no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:9729: checking for Tk private headers" >&5
+echo "configure:9798: checking for Tk private headers" >&5
# Check whether --with-tkinclude or --without-tkinclude was given.
if test "${with_tkinclude+set}" = set; then
withval="$with_tkinclude"
@@ -9791,17 +9860,17 @@ fi
if test x"${ac_cv_c_tkh}" = x ; then
ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tk.h""... $ac_c" 1>&6
-echo "configure:9795: checking for tk.h" >&5
+echo "configure:9864: checking for tk.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9800 "configure"
+#line 9869 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -9847,7 +9916,7 @@ fi
echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:9851: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:9920: checking for Itcl private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itclh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
if test -f $i/generic/itcl.h ; then
@@ -9870,7 +9939,7 @@ fi
echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:9874: checking for Itk private headers. srcdir=${srcdir}" >&5
+echo "configure:9943: checking for Itk private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itkh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
if test -f $i/generic/itk.h ; then
@@ -9925,7 +9994,7 @@ if test "${with_itclconfig+set}" = set; then
fi
echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
-echo "configure:9929: checking for Itcl configuration" >&5
+echo "configure:9998: checking for Itcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10028,7 +10097,7 @@ if test "${with_itkconfig+set}" = set; then
fi
echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
-echo "configure:10032: checking for Itk configuration" >&5
+echo "configure:10101: checking for Itk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10170,7 +10239,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:10174: checking for X" >&5
+echo "configure:10243: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -10232,12 +10301,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 10236 "configure"
+#line 10305 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -10306,14 +10375,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 10310 "configure"
+#line 10379 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:10317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -10525,7 +10594,7 @@ fi
# We only build gdbserver automatically if host and target are the same.
if test "x$target" = "x$host"; then
echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
-echo "configure:10529: checking whether gdbserver is supported on this host" >&5
+echo "configure:10598: checking whether gdbserver is supported on this host" >&5
if test "x$build_gdbserver" = xyes; then
configdirs="$configdirs gdbserver"
echo "$ac_t""yes" 1>&6
@@ -10589,12 +10658,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:10593: checking for Cygwin environment" >&5
+echo "configure:10662: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10598 "configure"
+#line 10667 "configure"
#include "confdefs.h"
int main() {
@@ -10605,7 +10674,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:10609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -10622,19 +10691,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:10626: checking for mingw32 environment" >&5
+echo "configure:10695: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10631 "configure"
+#line 10700 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:10638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -10653,7 +10722,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:10657: checking for executable suffix" >&5
+echo "configure:10726: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10663,7 +10732,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:10667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:10736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -10705,7 +10774,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:10709: checking for iconv" >&5
+echo "configure:10778: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10713,7 +10782,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 10717 "configure"
+#line 10786 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -10723,7 +10792,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:10727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -10735,7 +10804,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
cat > conftest.$ac_ext <<EOF
-#line 10739 "configure"
+#line 10808 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -10745,7 +10814,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:10749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
@@ -10766,13 +10835,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:10770: checking for iconv declaration" >&5
+echo "configure:10839: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10776 "configure"
+#line 10845 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -10791,7 +10860,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:10795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
diff --git a/gdb/configure.host b/gdb/configure.host
index f775746a2a6..d652e1f1c2f 100644
--- a/gdb/configure.host
+++ b/gdb/configure.host
@@ -50,7 +50,6 @@ hppa*-*-hpux11*) gdb_host=hpux11 ;;
hppa*-*-hpux*) gdb_host=hppahpux ;;
i[34567]86-ncr-*) gdb_host=ncr3000 ;;
-i[34567]86-*-bsd*) gdb_host=i386bsd ;;
i[34567]86-*-dgux*) gdb_host=i386v4 ;;
i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu)
gdb_host=fbsd ;;
@@ -64,6 +63,8 @@ i[34567]86-*-linux*) gdb_host=linux ;;
i[34567]86-*-lynxos*) gdb_host=i386lynx ;;
i[34567]86-*-gnu*) gdb_host=i386gnu ;;
i[3456]86-*-nto*) gdb_host=nto ;;
+i[34567]86-*-openbsd[0-2].* | i[34567]86-*-openbsd3.[0-3])
+ gdb_host=obsdaout ;;
i[34567]86-*-openbsd*) gdb_host=obsd ;;
i[34567]86-*-sco3.2v5*) gdb_host=i386sco5 ;;
i[34567]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
@@ -143,7 +144,7 @@ vax-*-bsd*) gdb_host=vaxbsd ;;
vax-*-ultrix2*) gdb_host=vaxult2 ;;
vax-*-ultrix*) gdb_host=vaxult ;;
-x86_64-*-linux*) gdb_host=x86-64linux ;;
+x86_64-*-linux*) gdb_host=linux64 ;;
x86_64-*-freebsd*) gdb_host=fbsd64 ;;
x86_64-*-netbsd*) gdb_host=nbsd64 ;;
x86_64-*-openbsd*) gdb_host=obsd64 ;;
diff --git a/gdb/configure.in b/gdb/configure.in
index 2d912fbc1df..07a289fb00f 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -146,6 +146,15 @@ fi
AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses pdcurses], [],
[AC_MSG_WARN([no curses library found])])
+# Check whether the wborder function is provided by the curses
+# library detected above. In certain implementations such as
+# the HP/UX Hcurses for instance, this function is provided by an
+# additional library. So if we did not find this function inside
+# the curses library, try some alternate libraries we know might
+# provide it.
+AC_SEARCH_LIBS(wborder, [cur_colr], [],
+ [AC_MSG_WARN([wborder function not found, tui will be disabled])])
+
# Enable TUI.
AC_ARG_ENABLE(tui,
[ --enable-tui enable full-screen terminal user interface (TUI)],
@@ -157,7 +166,7 @@ AC_ARG_ENABLE(tui,
esac],enable_tui=yes)
if test x"$enable_tui" = xyes; then
if test -d $srcdir/tui; then
- if test "$ac_cv_search_initscr" != no; then
+ if test "$ac_cv_search_initscr" != no -a "$ac_cv_search_wborder" != no; then
CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 76eb8ec1ac9..c13bb71d4bf 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -77,7 +77,6 @@ hppa*-*-hiux*) gdb_target=hppahpux ;;
hppa*-*-*) gdb_target=hppa ;;
i[34567]86-ncr-*) gdb_target=ncr3000 ;;
-i[34567]86-*-bsd*) gdb_target=i386bsd ;;
i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu)
gdb_target=nbsd ;;
i[34567]86-*-openbsd*) gdb_target=obsd ;;
@@ -212,7 +211,7 @@ v850*-*-*) gdb_target=v850
esac
;;
-x86_64-*-linux*) gdb_target=x86-64linux
+x86_64-*-linux*) gdb_target=linux64
build_gdbserver=yes
;;
x86_64-*-netbsd*) gdb_target=nbsd64 ;;
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 5f6e26db3b5..403cfa31338 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -42,7 +42,7 @@
#include "regset.h"
#include "symfile.h"
#include "exec.h"
-#include <readline/readline.h>
+#include "readline/readline.h"
#include "gdb_assert.h"
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 7558f2db00e..14bac098475 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -23,6 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
+#include "frame-unwind.h"
+#include "frame-base.h"
+#include "trad-frame.h"
+#include "dwarf2-frame.h"
#include "symtab.h"
#include "inferior.h"
#include "gdbtypes.h"
@@ -57,7 +61,7 @@ enum cris_num_regs
};
/* Register numbers of various important registers.
- DEPRECATED_FP_REGNUM Contains address of executing stack frame.
+ CRIS_FP_REGNUM Contains address of executing stack frame.
STR_REGNUM Contains the address of structure return values.
RET_REGNUM Contains the return value when shorter than or equal to 32 bits
ARG1_REGNUM Contains the first parameter to a function.
@@ -69,13 +73,11 @@ enum cris_num_regs
SRP_REGNUM Subroutine return pointer register.
BRP_REGNUM Breakpoint return pointer register. */
-/* DEPRECATED_FP_REGNUM = 8, SP_REGNUM = 14, and PC_REGNUM = 15 have
- been incorporated into the multi-arch framework. */
-
enum cris_regnums
{
/* Enums with respect to the general registers, valid for all
CRIS versions. */
+ CRIS_FP_REGNUM = 8,
STR_REGNUM = 9,
RET_REGNUM = 10,
ARG1_REGNUM = 10,
@@ -127,35 +129,11 @@ static const char *cris_mode_enums[] =
0
};
-/* CRIS ABI, set via the user command 'set cris-abi'.
- There are two flavours:
- 1. Original ABI with 32-bit doubles, where arguments <= 4 bytes are
- passed by value.
- 2. New ABI with 64-bit doubles, where arguments <= 8 bytes are passed by
- value. */
-static const char *usr_cmd_cris_abi;
-
-/* Indicates whether to trust the above variable. */
-static int usr_cmd_cris_abi_valid = 0;
-
-/* These variables are strings instead of enums to make them usable as
- parameters to add_set_enum_cmd. */
-static const char CRIS_ABI_ORIGINAL[] = "CRIS_ABI_ORIGINAL";
-static const char CRIS_ABI_V2[] = "CRIS_ABI_V2";
-static const char CRIS_ABI_SYMBOL[] = ".$CRIS_ABI_V2";
-static const char *cris_abi_enums[] =
-{
- CRIS_ABI_ORIGINAL,
- CRIS_ABI_V2,
- 0
-};
-
/* CRIS architecture specific information. */
struct gdbarch_tdep
{
int cris_version;
const char *cris_mode;
- const char *cris_abi;
};
/* Functions for accessing target dependent data. */
@@ -172,10 +150,27 @@ cris_mode (void)
return (gdbarch_tdep (current_gdbarch)->cris_mode);
}
-struct frame_extra_info
+struct cris_unwind_cache
{
+ /* The previous frame's inner most stack address. Used as this
+ frame ID's stack_addr. */
+ CORE_ADDR prev_sp;
+ /* The frame's base, optionally used by the high-level debug info. */
+ CORE_ADDR base;
+ int size;
+ /* How far the SP and r8 (FP) have been offset from the start of
+ the stack frame (as defined by the previous frame's stack
+ pointer). */
+ LONGEST sp_offset;
+ LONGEST r8_offset;
+ int uses_frame;
+
+ /* From old frame_extra_info struct. */
CORE_ADDR return_pc;
int leaf_function;
+
+ /* Table indicating the location of each and every register. */
+ struct trad_frame_saved_reg *saved_regs;
};
/* The instruction environment needed to find single-step breakpoints. */
@@ -345,8 +340,6 @@ cris_get_signed_offset (unsigned short insn)
inst_env. */
static void cris_gdb_func (enum cris_op_type, unsigned short, inst_env_type *);
-static CORE_ADDR cris_skip_prologue_main (CORE_ADDR pc, int frameless_p);
-
static struct gdbarch *cris_gdbarch_init (struct gdbarch_info,
struct gdbarch_list *);
@@ -358,11 +351,305 @@ static void cris_version_update (char *ignore_args, int from_tty,
static void cris_mode_update (char *ignore_args, int from_tty,
struct cmd_list_element *c);
-static void cris_abi_update (char *ignore_args, int from_tty,
- struct cmd_list_element *c);
-
static CORE_ADDR bfd_lookup_symbol (bfd *, const char *);
+static CORE_ADDR cris_scan_prologue (CORE_ADDR pc,
+ struct frame_info *next_frame,
+ struct cris_unwind_cache *info);
+
+static CORE_ADDR cris_unwind_pc (struct gdbarch *gdbarch,
+ struct frame_info *next_frame);
+
+static CORE_ADDR cris_unwind_sp (struct gdbarch *gdbarch,
+ struct frame_info *next_frame);
+
+/* When arguments must be pushed onto the stack, they go on in reverse
+ order. The below implements a FILO (stack) to do this. */
+
+/* Borrowed from d10v-tdep.c. */
+
+struct stack_item
+{
+ int len;
+ struct stack_item *prev;
+ void *data;
+};
+
+static struct stack_item *
+push_stack_item (struct stack_item *prev, void *contents, int len)
+{
+ struct stack_item *si;
+ si = xmalloc (sizeof (struct stack_item));
+ si->data = xmalloc (len);
+ si->len = len;
+ si->prev = prev;
+ memcpy (si->data, contents, len);
+ return si;
+}
+
+static struct stack_item *
+pop_stack_item (struct stack_item *si)
+{
+ struct stack_item *dead = si;
+ si = si->prev;
+ xfree (dead->data);
+ xfree (dead);
+ return si;
+}
+
+/* Put here the code to store, into fi->saved_regs, the addresses of
+ the saved registers of frame described by FRAME_INFO. This
+ includes special registers such as pc and fp saved in special ways
+ in the stack frame. sp is even more special: the address we return
+ for it IS the sp for the next frame. */
+
+struct cris_unwind_cache *
+cris_frame_unwind_cache (struct frame_info *next_frame,
+ void **this_prologue_cache)
+{
+ CORE_ADDR pc;
+ struct cris_unwind_cache *info;
+ int i;
+
+ if ((*this_prologue_cache))
+ return (*this_prologue_cache);
+
+ info = FRAME_OBSTACK_ZALLOC (struct cris_unwind_cache);
+ (*this_prologue_cache) = info;
+ info->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+
+ /* Zero all fields. */
+ info->prev_sp = 0;
+ info->base = 0;
+ info->size = 0;
+ info->sp_offset = 0;
+ info->r8_offset = 0;
+ info->uses_frame = 0;
+ info->return_pc = 0;
+ info->leaf_function = 0;
+
+ /* Prologue analysis does the rest... */
+ cris_scan_prologue (frame_func_unwind (next_frame), next_frame, info);
+
+ return info;
+}
+
+/* Given a GDB frame, determine the address of the calling function's
+ frame. This will be used to create a new GDB frame struct. */
+
+static void
+cris_frame_this_id (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ struct frame_id *this_id)
+{
+ struct cris_unwind_cache *info
+ = cris_frame_unwind_cache (next_frame, this_prologue_cache);
+ CORE_ADDR base;
+ CORE_ADDR func;
+ struct frame_id id;
+
+ /* The FUNC is easy. */
+ func = frame_func_unwind (next_frame);
+
+ /* Hopefully the prologue analysis either correctly determined the
+ frame's base (which is the SP from the previous frame), or set
+ that base to "NULL". */
+ base = info->prev_sp;
+ if (base == 0)
+ return;
+
+ id = frame_id_build (base, func);
+
+ (*this_id) = id;
+}
+
+static void
+cris_frame_prev_register (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *bufferp)
+{
+ struct cris_unwind_cache *info
+ = cris_frame_unwind_cache (next_frame, this_prologue_cache);
+ trad_frame_prev_register (next_frame, info->saved_regs, regnum,
+ optimizedp, lvalp, addrp, realnump, bufferp);
+}
+
+/* Assuming NEXT_FRAME->prev is a dummy, return the frame ID of that
+ dummy frame. The frame ID's base needs to match the TOS value
+ saved by save_dummy_frame_tos(), and the PC match the dummy frame's
+ breakpoint. */
+
+static struct frame_id
+cris_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ return frame_id_build (cris_unwind_sp (gdbarch, next_frame),
+ frame_pc_unwind (next_frame));
+}
+
+static CORE_ADDR
+cris_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+{
+ /* Align to the size of an instruction (so that they can safely be
+ pushed onto the stack). */
+ return sp & ~3;
+}
+
+static CORE_ADDR
+cris_push_dummy_code (struct gdbarch *gdbarch,
+ CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
+ struct value **args, int nargs,
+ struct type *value_type,
+ CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
+{
+ /* Allocate space sufficient for a breakpoint. */
+ sp = (sp - 4) & ~3;
+ /* Store the address of that breakpoint */
+ *bp_addr = sp;
+ /* CRIS always starts the call at the callee's entry point. */
+ *real_pc = funaddr;
+ return sp;
+}
+
+static CORE_ADDR
+cris_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ int stack_alloc;
+ int stack_offset;
+ int argreg;
+ int argnum;
+
+ CORE_ADDR regval;
+
+ /* The function's arguments and memory allocated by gdb for the arguments to
+ point at reside in separate areas on the stack.
+ Both frame pointers grow toward higher addresses. */
+ CORE_ADDR fp_arg;
+ CORE_ADDR fp_mem;
+
+ struct stack_item *si = NULL;
+
+ /* Push the return address. */
+ regcache_cooked_write_unsigned (regcache, SRP_REGNUM, bp_addr);
+
+ /* Are we returning a value using a structure return or a normal value
+ return? struct_addr is the address of the reserved space for the return
+ structure to be written on the stack. */
+ if (struct_return)
+ {
+ regcache_cooked_write_unsigned (regcache, STR_REGNUM, struct_addr);
+ }
+
+ /* Now load as many as possible of the first arguments into registers,
+ and push the rest onto the stack. */
+ argreg = ARG1_REGNUM;
+ stack_offset = 0;
+
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+ int len;
+ char *val;
+ int reg_demand;
+ int i;
+
+ len = TYPE_LENGTH (VALUE_TYPE (args[argnum]));
+ val = (char *) VALUE_CONTENTS (args[argnum]);
+
+ /* How may registers worth of storage do we need for this argument? */
+ reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
+
+ if (len <= (2 * 4) && (argreg + reg_demand - 1 <= ARG4_REGNUM))
+ {
+ /* Data passed by value. Fits in available register(s). */
+ for (i = 0; i < reg_demand; i++)
+ {
+ regcache_cooked_write_unsigned (regcache, argreg,
+ *(unsigned long *) val);
+ argreg++;
+ val += 4;
+ }
+ }
+ else if (len <= (2 * 4) && argreg <= ARG4_REGNUM)
+ {
+ /* Data passed by value. Does not fit in available register(s).
+ Use the register(s) first, then the stack. */
+ for (i = 0; i < reg_demand; i++)
+ {
+ if (argreg <= ARG4_REGNUM)
+ {
+ regcache_cooked_write_unsigned (regcache, argreg,
+ *(unsigned long *) val);
+ argreg++;
+ val += 4;
+ }
+ else
+ {
+ /* Push item for later so that pushed arguments
+ come in the right order. */
+ si = push_stack_item (si, val, 4);
+ val += 4;
+ }
+ }
+ }
+ else if (len > (2 * 4))
+ {
+ /* FIXME */
+ internal_error (__FILE__, __LINE__, "We don't do this");
+ }
+ else
+ {
+ /* Data passed by value. No available registers. Put it on
+ the stack. */
+ si = push_stack_item (si, val, len);
+ }
+ }
+
+ while (si)
+ {
+ /* fp_arg must be word-aligned (i.e., don't += len) to match
+ the function prologue. */
+ sp = (sp - si->len) & ~3;
+ write_memory (sp, si->data, si->len);
+ si = pop_stack_item (si);
+ }
+
+ /* Finally, update the SP register. */
+ regcache_cooked_write_unsigned (regcache, SP_REGNUM, sp);
+
+ return sp;
+}
+
+static const struct frame_unwind cris_frame_unwind = {
+ NORMAL_FRAME,
+ cris_frame_this_id,
+ cris_frame_prev_register
+};
+
+const struct frame_unwind *
+cris_frame_sniffer (struct frame_info *next_frame)
+{
+ return &cris_frame_unwind;
+}
+
+static CORE_ADDR
+cris_frame_base_address (struct frame_info *next_frame, void **this_cache)
+{
+ struct cris_unwind_cache *info
+ = cris_frame_unwind_cache (next_frame, this_cache);
+ return info->base;
+}
+
+static const struct frame_base cris_frame_base = {
+ &cris_frame_unwind,
+ cris_frame_base_address,
+ cris_frame_base_address,
+ cris_frame_base_address
+};
+
/* Frames information. The definition of the struct frame_info is
CORE_ADDR frame
@@ -440,8 +727,8 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, const char *);
determine that it is a prologue (1). */
static CORE_ADDR
-cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
- int frameless_p)
+cris_scan_prologue (CORE_ADDR pc, struct frame_info *next_frame,
+ struct cris_unwind_cache *info)
{
/* Present instruction. */
unsigned short insn;
@@ -462,60 +749,58 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
/* move.d r<source_register>,rS */
short source_register;
- /* This frame is with respect to a leaf until a push srp is found. */
- get_frame_extra_info (fi)->leaf_function = 1;
+ /* Scan limit. */
+ int limit;
- /* This frame is without the FP until a push fp is found. */
- have_fp = 0;
+ /* This frame is with respect to a leaf until a push srp is found. */
+ if (info)
+ {
+ info->leaf_function = 1;
+ }
/* Assume nothing on stack. */
val = 0;
regsave = -1;
- /* No information about register contents so far. */
+ /* If we were called without a next_frame, that means we were called
+ from cris_skip_prologue which already tried to find the end of the
+ prologue through the symbol information. 64 instructions past current
+ pc is arbitrarily chosen, but at least it means we'll stop eventually. */
+ limit = next_frame ? frame_pc_unwind (next_frame) : pc + 64;
- /* We only want to know the end of the prologue when fi->saved_regs == 0.
- When the saved registers are allocated full information is required. */
- if (deprecated_get_frame_saved_regs (fi))
- {
- for (regno = 0; regno < NUM_REGS; regno++)
- deprecated_get_frame_saved_regs (fi)[regno] = 0;
- }
-
/* Find the prologue instructions. */
- do
+ while (pc < limit)
{
- insn = read_memory_unsigned_integer (ip, sizeof (short));
- ip += sizeof (short);
+ insn = read_memory_unsigned_integer (pc, 2);
+ pc += 2;
if (insn == 0xE1FC)
{
/* push <reg> 32 bit instruction */
- insn_next = read_memory_unsigned_integer (ip, sizeof (short));
- ip += sizeof (short);
+ insn_next = read_memory_unsigned_integer (pc, 2);
+ pc += 2;
regno = cris_get_operand2 (insn_next);
-
+ if (info)
+ {
+ info->sp_offset += 4;
+ }
/* This check, meant to recognize srp, used to be regno ==
(SRP_REGNUM - NUM_GENREGS), but that covers r11 also. */
if (insn_next == 0xBE7E)
{
- if (frameless_p)
- {
- return ip;
- }
- get_frame_extra_info (fi)->leaf_function = 0;
- }
- else if (regno == DEPRECATED_FP_REGNUM)
- {
- have_fp = 1;
+ if (info)
+ {
+ info->leaf_function = 0;
+ }
}
}
else if (insn == 0x866E)
{
/* move.d sp,r8 */
- if (frameless_p)
- {
- return ip;
- }
+ if (info)
+ {
+ info->uses_frame = 1;
+ info->r8_offset = info->sp_offset;
+ }
continue;
}
else if (cris_get_operand2 (insn) == SP_REGNUM
@@ -523,7 +808,10 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
&& cris_get_opcode (insn) == 0x000A)
{
/* subq <val>,sp */
- val = cris_get_quick_value (insn);
+ if (info)
+ {
+ info->sp_offset += cris_get_quick_value (insn);
+ }
}
else if (cris_get_mode (insn) == 0x0002
&& cris_get_opcode (insn) == 0x000F
@@ -531,10 +819,6 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
&& cris_get_operand1 (insn) == SP_REGNUM)
{
/* movem r<regsave>,[sp] */
- if (frameless_p)
- {
- return ip;
- }
regsave = cris_get_operand2 (insn);
}
else if (cris_get_operand2 (insn) == SP_REGNUM
@@ -545,24 +829,23 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
register. Used for CRIS v8 i.e. ETRAX 100 and newer if <val>
is between 64 and 128.
movem r<regsave>,[sp=sp-<val>] */
- val = -cris_get_signed_offset (insn);
- insn_next = read_memory_unsigned_integer (ip, sizeof (short));
- ip += sizeof (short);
+ if (info)
+ {
+ info->sp_offset += -cris_get_signed_offset (insn);
+ }
+ insn_next = read_memory_unsigned_integer (pc, 2);
+ pc += 2;
if (cris_get_mode (insn_next) == PREFIX_ASSIGN_MODE
&& cris_get_opcode (insn_next) == 0x000F
&& cris_get_size (insn_next) == 0x0003
&& cris_get_operand1 (insn_next) == SP_REGNUM)
{
- if (frameless_p)
- {
- return ip;
- }
regsave = cris_get_operand2 (insn_next);
}
else
{
/* The prologue ended before the limit was reached. */
- ip -= 2 * sizeof (short);
+ pc -= 4;
break;
}
}
@@ -571,10 +854,6 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
&& cris_get_size (insn) == 0x0002)
{
/* move.d r<10..13>,r<0..15> */
- if (frameless_p)
- {
- return ip;
- }
source_register = cris_get_operand1 (insn);
/* FIXME? In the glibc solibs, the prologue might contain something
@@ -587,19 +866,19 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
if (source_register < ARG1_REGNUM || source_register > ARG4_REGNUM)
{
/* The prologue ended before the limit was reached. */
- ip -= sizeof (short);
+ pc -= 2;
break;
}
}
- else if (cris_get_operand2 (insn) == DEPRECATED_FP_REGNUM
+ else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM
/* The size is a fixed-size. */
&& ((insn & 0x0F00) >> 8) == 0x0001
/* A negative offset. */
&& (cris_get_signed_offset (insn) < 0))
{
/* move.S rZ,[r8-U] (?) */
- insn_next = read_memory_unsigned_integer (ip, sizeof (short));
- ip += sizeof (short);
+ insn_next = read_memory_unsigned_integer (pc, 2);
+ pc += 2;
regno = cris_get_operand2 (insn_next);
if ((regno >= 0 && regno < SP_REGNUM)
&& cris_get_mode (insn_next) == PREFIX_OFFSET_MODE
@@ -611,19 +890,19 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
else
{
/* The prologue ended before the limit was reached. */
- ip -= 2 * sizeof (short);
+ pc -= 4;
break;
}
}
- else if (cris_get_operand2 (insn) == DEPRECATED_FP_REGNUM
+ else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM
/* The size is a fixed-size. */
&& ((insn & 0x0F00) >> 8) == 0x0001
/* A positive offset. */
&& (cris_get_signed_offset (insn) > 0))
{
/* move.S [r8+U],rZ (?) */
- insn_next = read_memory_unsigned_integer (ip, sizeof (short));
- ip += sizeof (short);
+ insn_next = read_memory_unsigned_integer (pc, 2);
+ pc += 2;
regno = cris_get_operand2 (insn_next);
if ((regno >= 0 && regno < SP_REGNUM)
&& cris_get_mode (insn_next) == PREFIX_OFFSET_MODE
@@ -636,92 +915,124 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi,
else
{
/* The prologue ended before the limit was reached. */
- ip -= 2 * sizeof (short);
+ pc -= 4;
break;
}
}
else
{
/* The prologue ended before the limit was reached. */
- ip -= sizeof (short);
+ pc -= 2;
break;
}
}
- while (ip < limit);
- /* We only want to know the end of the prologue when
- fi->saved_regs == 0. */
- if (!deprecated_get_frame_saved_regs (fi))
- return ip;
+ /* We only want to know the end of the prologue when next_frame and info
+ are NULL (called from cris_skip_prologue i.e.). */
+ if (next_frame == NULL && info == NULL)
+ {
+ return pc;
+ }
- if (have_fp)
+ info->size = info->sp_offset;
+
+ /* Compute the previous frame's stack pointer (which is also the
+ frame's ID's stack address), and this frame's base pointer. */
+ if (info->uses_frame)
{
- deprecated_get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM] = get_frame_base (fi);
-
- /* Calculate the addresses. */
- for (regno = regsave; regno >= 0; regno--)
- {
- deprecated_get_frame_saved_regs (fi)[regno] = get_frame_base (fi) - val;
- val -= 4;
- }
- if (get_frame_extra_info (fi)->leaf_function)
- {
- /* Set the register SP to contain the stack pointer of
- the caller. */
- deprecated_get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) + 4;
- }
- else
- {
- /* Set the register SP to contain the stack pointer of
- the caller. */
- deprecated_get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) + 8;
+ ULONGEST this_base;
+ /* The SP was moved to the FP. This indicates that a new frame
+ was created. Get THIS frame's FP value by unwinding it from
+ the next frame. */
+ frame_unwind_unsigned_register (next_frame, CRIS_FP_REGNUM,
+ &this_base);
+ info->base = this_base;
+ /* The FP points at the last saved register. Adjust the FP back
+ to before the first saved register giving the SP. */
+ info->prev_sp = info->base + info->r8_offset;
+ }
+ else
+ {
+ ULONGEST this_base;
+ /* Assume that the FP is this frame's SP but with that pushed
+ stack space added back. */
+ frame_unwind_unsigned_register (next_frame, SP_REGNUM, &this_base);
+ info->base = this_base;
+ info->prev_sp = info->base + info->size;
+ }
- /* Set the register SRP to contain the return address of
- the caller. */
- deprecated_get_frame_saved_regs (fi)[SRP_REGNUM] = get_frame_base (fi) + 4;
- }
+ info->saved_regs[CRIS_FP_REGNUM].addr = info->base;
+
+ /* Calculate the addresses for the saved registers on the stack. */
+ /* FIXME: The address calculation should really be done on the fly while
+ we're analyzing the prologue (we only hold one regsave value as it is
+ now). */
+ val = info->sp_offset;
+
+ for (regno = regsave; regno >= 0; regno--)
+ {
+ info->saved_regs[regno].addr = info->base + info->r8_offset - val;
+ val -= 4;
+ }
+
+ /* The previous frame's SP needed to be computed. Save the computed
+ value. */
+ trad_frame_set_value (info->saved_regs, SP_REGNUM, info->prev_sp);
+
+ if (!info->leaf_function)
+ {
+ /* SRP saved on the stack. */
+ info->saved_regs[SRP_REGNUM].addr = info->base + 4;
}
- return ip;
+
+ /* The PC is found in SRP (the actual register or located on the stack). */
+ info->saved_regs[PC_REGNUM] = info->saved_regs[SRP_REGNUM];
+
+ return pc;
}
/* Advance pc beyond any function entry prologue instructions at pc
to reach some "real" code. */
-static CORE_ADDR
-cris_skip_prologue (CORE_ADDR pc)
-{
- return cris_skip_prologue_main (pc, 0);
-}
-
/* Given a PC value corresponding to the start of a function, return the PC
of the first instruction after the function prologue. */
static CORE_ADDR
-cris_skip_prologue_main (CORE_ADDR pc, int frameless_p)
+cris_skip_prologue (CORE_ADDR pc)
{
- struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
- struct frame_info *fi;
- struct symtab_and_line sal = find_pc_line (pc, 0);
- int best_limit;
+ CORE_ADDR func_addr, func_end;
+ struct symtab_and_line sal;
CORE_ADDR pc_after_prologue;
- /* frame_info now contains dynamic memory. Since fi is a dummy
- here, I don't bother allocating memory for saved_regs. */
- fi = deprecated_frame_xmalloc_with_cleanup (0, sizeof (struct frame_extra_info));
-
- /* If there is no symbol information then sal.end == 0, and we end up
- examining only the first instruction in the function prologue.
- Exaggerating the limit seems to be harmless. */
- if (sal.end > 0)
- best_limit = sal.end;
- else
- best_limit = pc + 100;
+ /* If we have line debugging information, then the end of the prologue
+ should the first assembly instruction of the first source line. */
+ if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
+ {
+ sal = find_pc_line (func_addr, 0);
+ if (sal.end > 0 && sal.end < func_end)
+ return sal.end;
+ }
- pc_after_prologue = cris_examine (pc, best_limit, fi, frameless_p);
- do_cleanups (old_chain);
+ pc_after_prologue = cris_scan_prologue (pc, NULL, NULL);
return pc_after_prologue;
}
+static CORE_ADDR
+cris_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ ULONGEST pc;
+ frame_unwind_unsigned_register (next_frame, PC_REGNUM, &pc);
+ return pc;
+}
+
+static CORE_ADDR
+cris_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ ULONGEST sp;
+ frame_unwind_unsigned_register (next_frame, SP_REGNUM, &sp);
+ return sp;
+}
+
/* Use the program counter to determine the contents and size of a breakpoint
instruction. It returns a pointer to a string of bytes that encode a
breakpoint instruction, stores the length of the string to *lenptr, and
@@ -737,15 +1048,6 @@ cris_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
return break_insn;
}
-/* Returns the register SRP (subroutine return pointer) which must contain
- the content of the register PC after a function call. */
-
-static CORE_ADDR
-cris_saved_pc_after_call (struct frame_info *frame)
-{
- return read_register (SRP_REGNUM);
-}
-
/* Returns 1 if spec_reg is applicable to the current gdbarch's CRIS version,
0 otherwise. */
@@ -929,34 +1231,31 @@ cris_register_virtual_type (int regno)
/* Stores a function return value of type type, where valbuf is the address
of the value to be stored. */
-/* In the original CRIS ABI, R10 is used to store return values. */
-
-static void
-cris_abi_original_store_return_value (struct type *type, char *valbuf)
-{
- int len = TYPE_LENGTH (type);
-
- if (len <= DEPRECATED_REGISTER_SIZE)
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (RET_REGNUM), valbuf, len);
- else
- internal_error (__FILE__, __LINE__, "cris_abi_original_store_return_value: type length too large.");
-}
-
-/* In the CRIS ABI V2, R10 and R11 are used to store return values. */
+/* In the CRIS ABI, R10 and R11 are used to store return values. */
static void
-cris_abi_v2_store_return_value (struct type *type, char *valbuf)
+cris_store_return_value (struct type *type, struct regcache *regcache,
+ const void *valbuf)
{
+ ULONGEST val;
int len = TYPE_LENGTH (type);
- if (len <= 2 * DEPRECATED_REGISTER_SIZE)
+ if (len <= 4)
+ {
+ /* Put the return value in R10. */
+ val = extract_unsigned_integer (valbuf, len);
+ regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val);
+ }
+ else if (len <= 8)
{
- /* Note that this works since R10 and R11 are consecutive registers. */
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (RET_REGNUM),
- valbuf, len);
+ /* Put the return value in R10 and R11. */
+ val = extract_unsigned_integer (valbuf, 4);
+ regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val);
+ val = extract_unsigned_integer ((char *)valbuf + 4, len - 4);
+ regcache_cooked_write_unsigned (regcache, ARG2_REGNUM, val);
}
else
- internal_error (__FILE__, __LINE__, "cris_abi_v2_store_return_value: type length too large.");
+ error ("cris_store_return_value: type length too large.");
}
/* Return the name of register regno as a string. Return NULL for an invalid or
@@ -1014,509 +1313,45 @@ cris_register_bytes_ok (long bytes)
return value of type type, and copy that, in virtual format, into
valbuf. */
-/* In the original CRIS ABI, R10 is used to return values. */
-
-static void
-cris_abi_original_extract_return_value (struct type *type, char *regbuf,
- char *valbuf)
-{
- int len = TYPE_LENGTH (type);
-
- if (len <= DEPRECATED_REGISTER_SIZE)
- memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (RET_REGNUM), len);
- else
- internal_error (__FILE__, __LINE__, "cris_abi_original_extract_return_value: type length too large");
-}
-
-/* In the CRIS ABI V2, R10 and R11 are used to store return values. */
+/* In the CRIS ABI, R10 and R11 are used to store return values. */
static void
-cris_abi_v2_extract_return_value (struct type *type, char *regbuf,
- char *valbuf)
+cris_extract_return_value (struct type *type, struct regcache *regcache,
+ void *valbuf)
{
+ ULONGEST val;
int len = TYPE_LENGTH (type);
- if (len <= 2 * DEPRECATED_REGISTER_SIZE)
- memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (RET_REGNUM), len);
+ if (len <= 4)
+ {
+ /* Get the return value from R10. */
+ regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val);
+ store_unsigned_integer (valbuf, len, val);
+ }
+ else if (len <= 8)
+ {
+ /* Get the return value from R10 and R11. */
+ regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val);
+ store_unsigned_integer (valbuf, 4, val);
+ regcache_cooked_read_unsigned (regcache, ARG2_REGNUM, &val);
+ store_unsigned_integer ((char *)valbuf + 4, len - 4, val);
+ }
else
- internal_error (__FILE__, __LINE__, "cris_abi_v2_extract_return_value: type length too large");
-}
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. In the CRIS ABI, R9 is used in order to
- pass the address of the allocated area where a structure return
- value must be stored. */
-
-static void
-cris_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
-{
- write_register (STR_REGNUM, addr);
+ error ("cris_extract_return_value: type length too large");
}
/* Returns 1 if the given type will be passed by pointer rather than
directly. */
-/* In the original CRIS ABI, arguments shorter than or equal to 32 bits are
- passed by value. */
-
-static int
-cris_abi_original_reg_struct_has_addr (int gcc_p, struct type *type)
-{
- return (TYPE_LENGTH (type) > 4);
-}
-
-/* In the CRIS ABI V2, arguments shorter than or equal to 64 bits are passed
+/* In the CRIS ABI, arguments shorter than or equal to 64 bits are passed
by value. */
static int
-cris_abi_v2_reg_struct_has_addr (int gcc_p, struct type *type)
+cris_reg_struct_has_addr (int gcc_p, struct type *type)
{
return (TYPE_LENGTH (type) > 8);
}
-/* Returns 1 if the function invocation represented by fi does not have a
- stack frame associated with it. Otherwise return 0. */
-
-static int
-cris_frameless_function_invocation (struct frame_info *fi)
-{
- if ((get_frame_type (fi) == SIGTRAMP_FRAME))
- return 0;
- else
- return legacy_frameless_look_for_prologue (fi);
-}
-
-/* See frame.h. Determines the address of all registers in the
- current stack frame storing each in frame->saved_regs. Space for
- frame->saved_regs shall be allocated by
- DEPRECATED_FRAME_INIT_SAVED_REGS using frame_saved_regs_zalloc. */
-
-static void
-cris_frame_init_saved_regs (struct frame_info *fi)
-{
- CORE_ADDR ip;
- struct symtab_and_line sal;
- int best_limit;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi),
- get_frame_base (fi));
-
- /* Examine the entire prologue. */
- int frameless_p = 0;
-
- /* Has this frame's registers already been initialized? */
- if (deprecated_get_frame_saved_regs (fi))
- return;
-
- frame_saved_regs_zalloc (fi);
-
- if (dummy_regs)
- {
- /* I don't see this ever happening, considering the context in which
- cris_frame_init_saved_regs is called (always when we're not in
- a dummy frame). */
- memcpy (deprecated_get_frame_saved_regs (fi), dummy_regs, SIZEOF_FRAME_SAVED_REGS);
- }
- else
- {
- ip = get_frame_func (fi);
- sal = find_pc_line (ip, 0);
-
- /* If there is no symbol information then sal.end == 0, and we end up
- examining only the first instruction in the function prologue.
- Exaggerating the limit seems to be harmless. */
- if (sal.end > 0)
- best_limit = sal.end;
- else
- best_limit = ip + 100;
-
- cris_examine (ip, best_limit, fi, frameless_p);
- }
-}
-
-/* Initialises the extra frame information at the creation of a new frame.
- The inparameter fromleaf is 0 when the call is from create_new_frame.
- When the call is from get_prev_frame_info, fromleaf is determined by
- cris_frameless_function_invocation. */
-
-static void
-cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
-{
- if (get_next_frame (fi))
- {
- /* Called from get_prev_frame. */
- deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
- }
-
- frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
-
- get_frame_extra_info (fi)->return_pc = 0;
- get_frame_extra_info (fi)->leaf_function = 0;
-
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
- get_frame_base (fi),
- get_frame_base (fi)))
- {
- /* We need to setup fi->frame here because call_function_by_hand
- gets it wrong by assuming it's always FP. */
- deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
- get_frame_extra_info (fi)->return_pc =
- deprecated_read_register_dummy (get_frame_pc (fi),
- get_frame_base (fi), PC_REGNUM);
-
- /* FIXME: Is this necessarily true? */
- get_frame_extra_info (fi)->leaf_function = 0;
- }
- else
- {
- cris_frame_init_saved_regs (fi);
-
- /* Check fromleaf/frameless_function_invocation. (FIXME) */
-
- if (deprecated_get_frame_saved_regs (fi)[SRP_REGNUM] != 0)
- {
- /* SRP was saved on the stack; non-leaf function. */
- get_frame_extra_info (fi)->return_pc =
- read_memory_integer (deprecated_get_frame_saved_regs (fi)[SRP_REGNUM],
- DEPRECATED_REGISTER_RAW_SIZE (SRP_REGNUM));
- }
- else
- {
- /* SRP is still in a register; leaf function. */
- get_frame_extra_info (fi)->return_pc = read_register (SRP_REGNUM);
- /* FIXME: Should leaf_function be set to 1 here? */
- get_frame_extra_info (fi)->leaf_function = 1;
- }
- }
-}
-
-/* Return the content of the frame pointer in the present frame. In other
- words, determine the address of the calling function's frame. */
-
-static CORE_ADDR
-cris_frame_chain (struct frame_info *fi)
-{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
- get_frame_base (fi),
- get_frame_base (fi)))
- {
- return get_frame_base (fi);
- }
- else if (!deprecated_inside_entry_file (get_frame_pc (fi)))
- {
- return read_memory_unsigned_integer (get_frame_base (fi), 4);
- }
- else
- {
- return 0;
- }
-}
-
-/* Return the saved PC (which equals the return address) of this frame. */
-
-static CORE_ADDR
-cris_frame_saved_pc (struct frame_info *fi)
-{
- return get_frame_extra_info (fi)->return_pc;
-}
-
-/* Setup the function arguments for calling a function in the inferior. */
-
-static CORE_ADDR
-cris_abi_original_push_arguments (int nargs, struct value **args,
- CORE_ADDR sp, int struct_return,
- CORE_ADDR struct_addr)
-{
- int stack_alloc;
- int stack_offset;
- int argreg;
- int argnum;
- struct type *type;
- int len;
- CORE_ADDR regval;
- char *val;
-
- /* Data and parameters reside in different areas on the stack.
- Both frame pointers grow toward higher addresses. */
- CORE_ADDR fp_params;
- CORE_ADDR fp_data;
-
- /* Are we returning a value using a structure return or a normal value
- return? struct_addr is the address of the reserved space for the return
- structure to be written on the stack. */
- if (struct_return)
- {
- write_register (STR_REGNUM, struct_addr);
- }
-
- /* Make sure there's space on the stack. Allocate space for data and a
- parameter to refer to that data. */
- for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
- stack_alloc += (TYPE_LENGTH (VALUE_TYPE (args[argnum])) + DEPRECATED_REGISTER_SIZE);
- sp -= stack_alloc;
- /* We may over-allocate a little here, but that won't hurt anything. */
-
- /* Initialize stack frame pointers. */
- fp_params = sp;
- fp_data = sp + (nargs * DEPRECATED_REGISTER_SIZE);
-
- /* Now load as many as possible of the first arguments into
- registers, and push the rest onto the stack. */
- argreg = ARG1_REGNUM;
- stack_offset = 0;
-
- for (argnum = 0; argnum < nargs; argnum++)
- {
- type = VALUE_TYPE (args[argnum]);
- len = TYPE_LENGTH (type);
- val = (char *) VALUE_CONTENTS (args[argnum]);
-
- if (len <= DEPRECATED_REGISTER_SIZE && argreg <= ARG4_REGNUM)
- {
- /* Data fits in a register; put it in the first available
- register. */
- write_register (argreg, *(unsigned long *) val);
- argreg++;
- }
- else if (len > DEPRECATED_REGISTER_SIZE && argreg <= ARG4_REGNUM)
- {
- /* Data does not fit in register; pass it on the stack and
- put its address in the first available register. */
- write_memory (fp_data, val, len);
- write_register (argreg, fp_data);
- fp_data += len;
- argreg++;
- }
- else if (len > DEPRECATED_REGISTER_SIZE)
- {
- /* Data does not fit in register; put both data and
- parameter on the stack. */
- write_memory (fp_data, val, len);
- write_memory (fp_params, (char *) (&fp_data), DEPRECATED_REGISTER_SIZE);
- fp_data += len;
- fp_params += DEPRECATED_REGISTER_SIZE;
- }
- else
- {
- /* Data fits in a register, but we are out of registers;
- put the parameter on the stack. */
- write_memory (fp_params, val, DEPRECATED_REGISTER_SIZE);
- fp_params += DEPRECATED_REGISTER_SIZE;
- }
- }
-
- return sp;
-}
-
-static CORE_ADDR
-cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
-{
- int stack_alloc;
- int stack_offset;
- int argreg;
- int argnum;
-
- CORE_ADDR regval;
-
- /* The function's arguments and memory allocated by gdb for the arguments to
- point at reside in separate areas on the stack.
- Both frame pointers grow toward higher addresses. */
- CORE_ADDR fp_arg;
- CORE_ADDR fp_mem;
-
- /* Are we returning a value using a structure return or a normal value
- return? struct_addr is the address of the reserved space for the return
- structure to be written on the stack. */
- if (struct_return)
- {
- write_register (STR_REGNUM, struct_addr);
- }
-
- /* Allocate enough to keep things word-aligned on both parts of the
- stack. */
- stack_alloc = 0;
- for (argnum = 0; argnum < nargs; argnum++)
- {
- int len;
- int reg_demand;
-
- len = TYPE_LENGTH (VALUE_TYPE (args[argnum]));
- reg_demand = (len / DEPRECATED_REGISTER_SIZE) + (len % DEPRECATED_REGISTER_SIZE != 0 ? 1 : 0);
-
- /* reg_demand * DEPRECATED_REGISTER_SIZE is the amount of memory
- we might need to allocate for this argument. 2 *
- DEPRECATED_REGISTER_SIZE is the amount of stack space we
- might need to pass the argument itself (either by value or by
- reference). */
- stack_alloc += (reg_demand * DEPRECATED_REGISTER_SIZE + 2 * DEPRECATED_REGISTER_SIZE);
- }
- sp -= stack_alloc;
- /* We may over-allocate a little here, but that won't hurt anything. */
-
- /* Initialize frame pointers. */
- fp_arg = sp;
- fp_mem = sp + (nargs * (2 * DEPRECATED_REGISTER_SIZE));
-
- /* Now load as many as possible of the first arguments into registers,
- and push the rest onto the stack. */
- argreg = ARG1_REGNUM;
- stack_offset = 0;
-
- for (argnum = 0; argnum < nargs; argnum++)
- {
- int len;
- char *val;
- int reg_demand;
- int i;
-
- len = TYPE_LENGTH (VALUE_TYPE (args[argnum]));
- val = (char *) VALUE_CONTENTS (args[argnum]);
-
- /* How may registers worth of storage do we need for this argument? */
- reg_demand = (len / DEPRECATED_REGISTER_SIZE) + (len % DEPRECATED_REGISTER_SIZE != 0 ? 1 : 0);
-
- if (len <= (2 * DEPRECATED_REGISTER_SIZE)
- && (argreg + reg_demand - 1 <= ARG4_REGNUM))
- {
- /* Data passed by value. Fits in available register(s). */
- for (i = 0; i < reg_demand; i++)
- {
- write_register (argreg, *(unsigned long *) val);
- argreg++;
- val += DEPRECATED_REGISTER_SIZE;
- }
- }
- else if (len <= (2 * DEPRECATED_REGISTER_SIZE) && argreg <= ARG4_REGNUM)
- {
- /* Data passed by value. Does not fit in available register(s).
- Use the register(s) first, then the stack. */
- for (i = 0; i < reg_demand; i++)
- {
- if (argreg <= ARG4_REGNUM)
- {
- write_register (argreg, *(unsigned long *) val);
- argreg++;
- val += DEPRECATED_REGISTER_SIZE;
- }
- else
- {
- /* I guess this memory write could write the
- remaining data all at once instead of in
- DEPRECATED_REGISTER_SIZE chunks. */
- write_memory (fp_arg, val, DEPRECATED_REGISTER_SIZE);
- fp_arg += DEPRECATED_REGISTER_SIZE;
- val += DEPRECATED_REGISTER_SIZE;
- }
- }
- }
- else if (len > (2 * DEPRECATED_REGISTER_SIZE))
- {
- /* Data passed by reference. Put it on the stack. */
- write_memory (fp_mem, val, len);
- write_memory (fp_arg, (char *) (&fp_mem), DEPRECATED_REGISTER_SIZE);
-
- /* fp_mem need not be word-aligned since it's just a chunk of
- memory being pointed at. That is, += len would do. */
- fp_mem += reg_demand * DEPRECATED_REGISTER_SIZE;
- fp_arg += DEPRECATED_REGISTER_SIZE;
- }
- else
- {
- /* Data passed by value. No available registers. Put it on
- the stack. */
- write_memory (fp_arg, val, len);
-
- /* fp_arg must be word-aligned (i.e., don't += len) to match
- the function prologue. */
- fp_arg += reg_demand * DEPRECATED_REGISTER_SIZE;
- }
- }
-
- return sp;
-}
-
-/* Never put the return address on the stack. The register SRP is pushed
- by the called function unless it is a leaf-function. Due to the BRP
- register the PC will change when continue is sent. */
-
-static CORE_ADDR
-cris_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
-{
- write_register (SRP_REGNUM, entry_point_address ());
- return sp;
-}
-
-/* Restore the machine to the state it had before the current frame
- was created. Discard the innermost frame from the stack and restore
- all saved registers. */
-
-static void
-cris_pop_frame (void)
-{
- struct frame_info *fi = get_current_frame ();
- int regno;
- int stack_offset = 0;
-
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
- get_frame_base (fi),
- get_frame_base (fi)))
- {
- /* This happens when we hit a breakpoint set at the entry point,
- when returning from a dummy frame. */
- generic_pop_dummy_frame ();
- }
- else
- {
- cris_frame_init_saved_regs (fi);
-
- /* For each register, the address of where it was saved on entry to
- the frame now lies in fi->saved_regs[regno], or zero if it was not
- saved. This includes special registers such as PC and FP saved in
- special ways in the stack frame. The SP_REGNUM is even more
- special, the address here is the SP for the next frame, not the
- address where the SP was saved. */
-
- /* Restore general registers R0 - R7. They were pushed on the stack
- after SP was saved. */
- for (regno = 0; regno < DEPRECATED_FP_REGNUM; regno++)
- {
- if (deprecated_get_frame_saved_regs (fi)[regno])
- {
- write_register (regno,
- read_memory_integer (deprecated_get_frame_saved_regs (fi)[regno], 4));
- }
- }
-
- if (deprecated_get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM])
- {
- /* Pop the frame pointer (R8). It was pushed before SP
- was saved. */
- write_register (DEPRECATED_FP_REGNUM,
- read_memory_integer (deprecated_get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM], 4));
- stack_offset += 4;
-
- /* Not a leaf function. */
- if (deprecated_get_frame_saved_regs (fi)[SRP_REGNUM])
- {
- /* SRP was pushed before SP was saved. */
- stack_offset += 4;
- }
-
- /* Restore the SP and adjust for R8 and (possibly) SRP. */
- write_register (SP_REGNUM, deprecated_get_frame_saved_regs (fi)[DEPRECATED_FP_REGNUM] + stack_offset);
- }
- else
- {
- /* Currently, we can't get the correct info into fi->saved_regs
- without a frame pointer. */
- }
-
- /* Restore the PC. */
- write_register (PC_REGNUM, get_frame_extra_info (fi)->return_pc);
- }
- flush_cached_frames ();
-}
-
/* Calculates a value that measures how good inst_args constraints an
instruction. It stems from cris_constraint, found in cris-dis.c. */
@@ -3769,12 +3604,6 @@ _initialize_cris_tdep (void)
set_cmd_sfunc (c, cris_mode_update);
add_show_from_set (c, &showlist);
- c = add_set_enum_cmd ("cris-abi", class_support, cris_abi_enums,
- &usr_cmd_cris_abi,
- "Set the current CRIS ABI version.", &setlist);
- set_cmd_sfunc (c, cris_abi_update);
- add_show_from_set (c, &showlist);
-
c = add_cmd ("cris-fpless-backtrace", class_support, cris_fpless_backtrace,
"Display call chain using the subroutine return pointer.\n"
"Note that this displays the address after the jump to the "
@@ -3796,9 +3625,6 @@ cris_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
tdep->cris_version);
fprintf_unfiltered (file, "cris_dump_tdep: tdep->cris_mode = %s\n",
tdep->cris_mode);
- fprintf_unfiltered (file, "cris_dump_tdep: tdep->cris_abi = %s\n",
- tdep->cris_abi);
-
}
}
@@ -3856,33 +3682,6 @@ cris_mode_update (char *ignore_args, int from_tty,
}
}
-static void
-cris_abi_update (char *ignore_args, int from_tty,
- struct cmd_list_element *c)
-{
- struct gdbarch_info info;
-
- /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
- the set command passed as a parameter. The clone operation will
- include (BUG?) any ``set'' command callback, if present.
- Commands like ``info set'' call all the ``show'' command
- callbacks. Unfortunately, for ``show'' commands cloned from
- ``set'', this includes callbacks belonging to ``set'' commands.
- Making this worse, this only occures if add_show_from_set() is
- called after add_cmd_sfunc() (BUG?). */
-
- /* From here on, trust the user's CRIS ABI setting. */
- if (cmd_type (c) == set_cmd)
- {
- usr_cmd_cris_abi_valid = 1;
-
- /* Update the current architecture, if needed. */
- gdbarch_info_init (&info);
- if (!gdbarch_update_p (info))
- internal_error (__FILE__, __LINE__, "cris_gdbarch_update: failed to update architecture.");
- }
-}
-
/* Copied from pa64solib.c, with a couple of minor changes. */
static CORE_ADDR
@@ -3926,8 +3725,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
struct gdbarch_tdep *tdep;
int cris_version;
const char *cris_mode;
- const char *cris_abi;
- CORE_ADDR cris_abi_sym = 0;
int register_bytes;
if (usr_cmd_cris_version_valid)
@@ -3958,51 +3755,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
cris_mode = CRIS_MODE_SUPERVISOR;
}
- if (usr_cmd_cris_abi_valid)
- {
- /* Trust the user's ABI setting. */
- cris_abi = usr_cmd_cris_abi;
- }
- else if (info.abfd)
- {
- if (bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
- {
- /* An elf target uses the new ABI. */
- cris_abi = CRIS_ABI_V2;
- }
- else if (bfd_get_flavour (info.abfd) == bfd_target_aout_flavour)
- {
- /* An a.out target may use either ABI. Look for hints in the
- symbol table. */
- cris_abi_sym = bfd_lookup_symbol (info.abfd, CRIS_ABI_SYMBOL);
- cris_abi = cris_abi_sym ? CRIS_ABI_V2 : CRIS_ABI_ORIGINAL;
- }
- else
- {
- /* Unknown bfd flavour. Assume it's the new ABI. */
- cris_abi = CRIS_ABI_V2;
- }
- }
- else if (arches != NULL)
- {
- /* No bfd available. Stick with the ABI from the most recently
- selected architecture of this same family (the head of arches
- always points to this). (This is to avoid changing the ABI
- when the user updates the architecture with the 'set
- cris-version' command.) */
- cris_abi = gdbarch_tdep (arches->gdbarch)->cris_abi;
- }
- else
- {
- /* No bfd, and no previously selected architecture available.
- Assume it's the new ABI. */
- cris_abi = CRIS_ABI_V2;
- }
-
/* Make the current settings visible to the user. */
usr_cmd_cris_version = cris_version;
usr_cmd_cris_mode = cris_mode;
- usr_cmd_cris_abi = cris_abi;
/* Find a candidate among the list of pre-declared architectures. Both
CRIS version and ABI must match. */
@@ -4011,8 +3766,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
arches = gdbarch_list_lookup_by_info (arches->next, &info))
{
if ((gdbarch_tdep (arches->gdbarch)->cris_version == cris_version)
- && (gdbarch_tdep (arches->gdbarch)->cris_mode == cris_mode)
- && (gdbarch_tdep (arches->gdbarch)->cris_abi == cris_abi))
+ && (gdbarch_tdep (arches->gdbarch)->cris_mode == cris_mode))
return arches->gdbarch;
}
@@ -4020,13 +3774,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
gdbarch = gdbarch_alloc (&info, tdep);
- /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
- ready to unwind the PC first (see frame.c:get_prev_frame()). */
- set_gdbarch_deprecated_init_frame_pc (gdbarch, deprecated_init_frame_pc_default);
-
tdep->cris_version = cris_version;
tdep->cris_mode = cris_mode;
- tdep->cris_abi = cris_abi;
/* INIT shall ensure that the INFO.BYTE_ORDER is non-zero. */
switch (info.byte_order)
@@ -4043,57 +3792,31 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
internal_error (__FILE__, __LINE__, "cris_gdbarch_init: unknown byte order in info");
}
- /* Initialize the ABI dependent things. */
- if (tdep->cris_abi == CRIS_ABI_ORIGINAL)
- {
- set_gdbarch_double_bit (gdbarch, 32);
- set_gdbarch_deprecated_push_arguments (gdbarch, cris_abi_original_push_arguments);
- set_gdbarch_deprecated_store_return_value (gdbarch,
- cris_abi_original_store_return_value);
- set_gdbarch_deprecated_extract_return_value
- (gdbarch, cris_abi_original_extract_return_value);
- set_gdbarch_deprecated_reg_struct_has_addr
- (gdbarch, cris_abi_original_reg_struct_has_addr);
- }
- else if (tdep->cris_abi == CRIS_ABI_V2)
- {
- set_gdbarch_double_bit (gdbarch, 64);
- set_gdbarch_deprecated_push_arguments (gdbarch, cris_abi_v2_push_arguments);
- set_gdbarch_deprecated_store_return_value (gdbarch, cris_abi_v2_store_return_value);
- set_gdbarch_deprecated_extract_return_value
- (gdbarch, cris_abi_v2_extract_return_value);
- set_gdbarch_deprecated_reg_struct_has_addr
- (gdbarch, cris_abi_v2_reg_struct_has_addr);
- }
- else
- internal_error (__FILE__, __LINE__, "cris_gdbarch_init: unknown CRIS ABI");
+ /* FIXME: Should be replaced by a cris_return_value implementation. */
+ set_gdbarch_store_return_value (gdbarch, cris_store_return_value);
+ set_gdbarch_extract_return_value (gdbarch, cris_extract_return_value);
+ set_gdbarch_deprecated_reg_struct_has_addr (gdbarch,
+ cris_reg_struct_has_addr);
+ set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
- /* The default definition of a long double is 2 * TARGET_DOUBLE_BIT,
- which means we have to set this explicitly. */
- set_gdbarch_long_double_bit (gdbarch, 64);
-
/* There are 32 registers (some of which may not be implemented). */
set_gdbarch_num_regs (gdbarch, 32);
set_gdbarch_sp_regnum (gdbarch, 14);
- set_gdbarch_deprecated_fp_regnum (gdbarch, 8);
set_gdbarch_pc_regnum (gdbarch, 15);
-
set_gdbarch_register_name (gdbarch, cris_register_name);
/* Length of ordinary registers used in push_word and a few other
places. DEPRECATED_REGISTER_RAW_SIZE is the real way to know how
big a register is. */
set_gdbarch_deprecated_register_size (gdbarch, 4);
-
- /* NEW */
+ set_gdbarch_double_bit (gdbarch, 64);
+ /* The default definition of a long double is 2 * TARGET_DOUBLE_BIT,
+ which means we have to set this explicitly. */
+ set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_register_bytes_ok (gdbarch, cris_register_bytes_ok);
- set_gdbarch_software_single_step (gdbarch, cris_software_single_step);
-
-
set_gdbarch_cannot_store_register (gdbarch, cris_cannot_store_register);
set_gdbarch_cannot_fetch_register (gdbarch, cris_cannot_fetch_register);
-
/* The total amount of space needed to store (in an array called registers)
GDB's copy of the machine's register state. Note: We can not use
cris_register_size at this point, since it relies on current_gdbarch
@@ -4147,26 +3870,12 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_register_virtual_type (gdbarch, cris_register_virtual_type);
- /* Use generic dummy frames. */
-
- /* Read all about dummy frames in blockframe.c. */
- set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
-
- /* Defined to 1 to indicate that the target supports inferior function
- calls. */
- set_gdbarch_deprecated_call_dummy_words (gdbarch, 0);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
-
- set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
-
- set_gdbarch_deprecated_push_return_address (gdbarch, cris_push_return_address);
- set_gdbarch_deprecated_pop_frame (gdbarch, cris_pop_frame);
-
- set_gdbarch_deprecated_store_struct_return (gdbarch, cris_store_struct_return);
- set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
+ /* Dummy frame functions. */
+ set_gdbarch_push_dummy_code (gdbarch, cris_push_dummy_code);
+ set_gdbarch_push_dummy_call (gdbarch, cris_push_dummy_call);
+ set_gdbarch_frame_align (gdbarch, cris_frame_align);
- set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, cris_frame_init_saved_regs);
- set_gdbarch_deprecated_init_extra_frame_info (gdbarch, cris_init_extra_frame_info);
+ set_gdbarch_software_single_step (gdbarch, cris_software_single_step);
set_gdbarch_skip_prologue (gdbarch, cris_skip_prologue);
/* The stack grows downward. */
@@ -4174,17 +3883,17 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_breakpoint_from_pc (gdbarch, cris_breakpoint_from_pc);
- set_gdbarch_deprecated_frameless_function_invocation (gdbarch, cris_frameless_function_invocation);
- set_gdbarch_deprecated_frame_chain (gdbarch, cris_frame_chain);
-
- set_gdbarch_deprecated_frame_saved_pc (gdbarch, cris_frame_saved_pc);
- set_gdbarch_deprecated_saved_pc_after_call (gdbarch, cris_saved_pc_after_call);
-
- /* Helpful for backtracing and returning in a call dummy. */
- set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
-
- /* Should be using push_dummy_call. */
- set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ /* Prologue analyzer may have to be able to parse an incomplete
+ prologue (PC in prologue, that is). Check infrun.c. */
+ set_gdbarch_unwind_pc (gdbarch, cris_unwind_pc);
+ set_gdbarch_unwind_sp (gdbarch, cris_unwind_sp);
+ set_gdbarch_unwind_dummy_id (gdbarch, cris_unwind_dummy_id);
+
+ /* FIXME: Hook in the DWARF CFI frame unwinder.
+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
+ */
+ frame_unwind_append_sniffer (gdbarch, cris_frame_sniffer);
+ frame_base_set_default (gdbarch, &cris_frame_base);
/* Use target_specific function to define link map offsets. */
set_solib_svr4_fetch_link_map_offsets
diff --git a/gdb/defs.h b/gdb/defs.h
index e6d2fec2649..e49f9e0e5ba 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -405,6 +405,8 @@ extern void null_cleanup (void *);
extern int myread (int, char *, int);
extern int query (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern int nquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern int yquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
extern void init_page_info (void);
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index b7c8384e331..6fbd7662892 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,28 @@
+2004-02-28 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.texinfo (Contributors): Mention GDB 6.1 release engineer.
+
+2004-02-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gdb.texinfo (breakpoints): Add information about the
+ new "set breakpoint pending" and "show breakpoint pending"
+ commands.
+
+2004-02-26 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Coding): Document use of gdbarch_obstack_zalloc
+ in Per-architecture module data section.
+
+2004-02-25 Roland McGrath <roland@redhat.com>
+
+ * gdb.texinfo (General Query Packets): Document qPart:... packets.
+
+2004-02-24 Andrew Cagney <cagney@redhat.com>
+
+ * annotate.texinfo: Wrap fdl.texi include in raise/lower sections.
+ * gdb.texinfo, gdbint.texinfo, stabs.texinfo: Ditto.
+ * fdl.texi: Import Version 1.2, November 2002.
+
2004-02-17 Andrew Cagney <cagney@redhat.com>
* gdb.texinfo (Mode Options): Note that "mi1" is deprecated.
diff --git a/gdb/doc/annotate.texinfo b/gdb/doc/annotate.texinfo
index 901c6e1ba25..86b90cc74e7 100644
--- a/gdb/doc/annotate.texinfo
+++ b/gdb/doc/annotate.texinfo
@@ -820,7 +820,9 @@ source which is being displayed. @var{addr} is in the form @samp{0x}
followed by one or more lowercase hex digits (note that this does not
depend on the language).
+@raisesections
@include fdl.texi
+@lowersections
@ignore
@node Index
diff --git a/gdb/doc/fdl.texi b/gdb/doc/fdl.texi
index f4726b9b149..11737cc89bd 100644
--- a/gdb/doc/fdl.texi
+++ b/gdb/doc/fdl.texi
@@ -1,28 +1,29 @@
-@c -*-texinfo-*-
+
@node GNU Free Documentation License
+@appendixsec GNU Free Documentation License
-@appendix GNU Free Documentation License
-@center Version 1.1, March 2000
+@cindex FDL, GNU Free Documentation License
+@center Version 1.2, November 2002
@display
-Copyright (C) 2000 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
-@sp 1
+
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
-written document ``free'' in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially. Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
+functional and useful document @dfn{free} in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
@@ -37,60 +38,72 @@ it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
-@sp 1
@item
APPLICABILITY AND DEFINITIONS
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License. The ``Document'', below, refers to any
-such manual or work. Any member of the public is a licensee, and is
-addressed as ``you.''
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The ``Document'', below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as ``you''. You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
-A ``Secondary Section'' is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (For example, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
+A ``Secondary Section'' is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
+general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent. A copy that is
-not ``Transparent'' is called ``Opaque.''
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification. Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
+@sc{ascii} without markup, Texinfo input format, La@TeX{} input
+format, @acronym{SGML} or @acronym{XML} using a publicly available
+@acronym{DTD}, and standard-conforming simple @acronym{HTML},
+PostScript or @acronym{PDF} designed for human modification. Examples
+of transparent image formats include @acronym{PNG}, @acronym{XCF} and
+@acronym{JPG}. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, @acronym{SGML} or
+@acronym{XML} for which the @acronym{DTD} and/or processing tools are
+not generally available, and the machine-generated @acronym{HTML},
+PostScript or @acronym{PDF} produced by some word processors for
+output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
@@ -98,7 +111,22 @@ this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
-@sp 1
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
@item
VERBATIM COPYING
@@ -114,13 +142,14 @@ number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
-@sp 1
+
@item
COPYING IN QUANTITY
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
@@ -138,21 +167,20 @@ pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols. If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
-@sp 1
+
@item
MODIFICATIONS
@@ -163,52 +191,85 @@ Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.@*
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has less than five).@*
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.@*
-D. Preserve all the copyright notices of the Document.@*
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.@*
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.@*
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.@*
-H. Include an unaltered copy of this License.@*
-I. Preserve the section entitled ``History'', and its title, and add to
- it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section entitled ``History'' in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.@*
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the ``History'' section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.@*
-K. In any section entitled ``Acknowledgements'' or ``Dedications'',
- preserve the section's title, and preserve in the section all the
- substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.@*
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.@*
-M. Delete any section entitled ``Endorsements.'' Such a section
- may not be included in the Modified Version.@*
-N. Do not retitle any existing section as ``Endorsements''
- or to conflict in title with any Invariant Section.@*
-@sp 1
+@enumerate A
+@item
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document). You may use the same title as a previous version
+if the original publisher of that version gives permission.
+
+@item
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has fewer than five),
+unless they release you from this requirement.
+
+@item
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
+@item
+Preserve all the copyright notices of the Document.
+
+@item
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
+@item
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+
+@item
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+
+@item
+Include an unaltered copy of this License.
+
+@item
+Preserve the section Entitled ``History'', Preserve its Title, and add
+to it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page. If
+there is no section Entitled ``History'' in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+
+@item
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on. These may be placed in the ``History'' section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+
+@item
+For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
+the Title of the section, and preserve in the section all the
+substance and tone of each of the contributor acknowledgements and/or
+dedications given therein.
+
+@item
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles. Section numbers
+or the equivalent are not considered part of the section titles.
+
+@item
+Delete any section Entitled ``Endorsements''. Such a section
+may not be included in the Modified Version.
+
+@item
+Do not retitle any existing section to be Entitled ``Endorsements'' or
+to conflict in title with any Invariant Section.
+
+@item
+Preserve any Warranty Disclaimers.
+@end enumerate
+
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
@@ -216,9 +277,9 @@ of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
-You may add a section entitled ``Endorsements'', provided it contains
+You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
+parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
@@ -235,7 +296,7 @@ permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
-@sp 1
+
@item
COMBINING DOCUMENTS
@@ -244,7 +305,7 @@ License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
-license notice.
+license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
@@ -255,12 +316,12 @@ author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
-In the combination, you must combine any sections entitled ``History''
-in the various original documents, forming one section entitled
-``History''; likewise combine any sections entitled ``Acknowledgements'',
-and any sections entitled ``Dedications.'' You must delete all sections
-entitled ``Endorsements.''
-@sp 1
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications''. You must delete all
+sections Entitled ``Endorsements.''
+
@item
COLLECTIONS OF DOCUMENTS
@@ -274,25 +335,27 @@ You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
-@sp 1
+
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation. Such a compilation is called an ``aggregate'', and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
-@sp 1
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
@item
TRANSLATION
@@ -302,11 +365,18 @@ Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
-translation of this License provided that you also include the
-original English version of this License. In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
-@sp 1
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
@item
TERMINATION
@@ -317,7 +387,7 @@ 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.
-@sp 1
+
@item
FUTURE REVISIONS OF THIS LICENSE
@@ -325,7 +395,7 @@ The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation 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. See
-http://www.gnu.org/copyleft/.
+@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
@@ -335,10 +405,10 @@ of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
-
@end enumerate
-@unnumberedsec ADDENDUM: How to use this License for your documents
+@page
+@appendixsubsec ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
@@ -346,23 +416,37 @@ license notices just after the title page:
@smallexample
@group
-Copyright (C) @var{year} @var{your name}.
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being @var{list their titles}, with the
-Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
-A copy of the license is included in the section entitled "GNU
-Free Documentation License."
+ Copyright (C) @var{year} @var{your name}.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
@end group
@end smallexample
-If you have no Invariant Sections, write ``with no Invariant Sections''
-instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write ``no Front-Cover Texts'' instead of
-``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with...Texts.'' line with this:
+
+@smallexample
+@group
+ with the Invariant Sections being @var{list their titles}, with
+ the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
+ being @var{list}.
+@end group
+@end smallexample
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
+
+@c Local Variables:
+@c ispell-local-pdict: "ispell-dict"
+@c End:
+
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 9a14584c448..77b96a067e3 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -347,7 +347,7 @@ omitted from this list, we would like to add your names!
So that they may not regard their many labors as thankless, we
particularly thank those who shepherded @value{GDBN} through major
releases:
-Andrew Cagney (releases 6.0, 5.3, 5.2, 5.1 and 5.0);
+Andrew Cagney (releases 6.1, 6.0, 5.3, 5.2, 5.1 and 5.0);
Jim Blandy (release 4.18);
Jason Molenda (release 4.17);
Stan Shebs (release 4.14);
@@ -2639,26 +2639,53 @@ the breakpoints are conditional, this is even useful
(@pxref{Conditions, ,Break conditions}).
@cindex pending breakpoints
-If a specified breakpoint location cannot be found, @value{GDBN} will
-prompt you
-as to whether to make the breakpoint pending on a future shared
-library load. This is useful for setting breakpoints at the start of your
+If a specified breakpoint location cannot be found, it may be due to the fact
+that the location is in a shared library that is yet to be loaded. In such
+a case, you may want @value{GDBN} to create a special breakpoint (known as
+a @dfn{pending breakpoint}) that
+attempts to resolve itself in the future when an appropriate shared library
+gets loaded.
+
+Pending breakpoints are useful to set at the start of your
@value{GDBN} session for locations that you know will be dynamically loaded
later by the program being debugged. When shared libraries are loaded,
-a check is made to see if the load resoloves any pending breakpoint locations.
-If a pending breakpoint location has been resolved,
-a real breakpoint is created and the original pending breakpoint is removed.
+a check is made to see if the load resolves any pending breakpoint locations.
+If a pending breakpoint location gets resolved,
+a regular breakpoint is created and the original pending breakpoint is removed.
-@cindex operations allowed on pending breakpoints
-Normal breakpoint operations apply to pending breakpoints as well. You may
-specify a condition for a pending breakpoint and/or commands to run when the
+@value{GDBN} provides some additional commands for controlling pending
+breakpoint support:
+
+@kindex set breakpoint pending
+@kindex show breakpoint pending
+@table @code
+@item set breakpoint pending auto
+This is the default behavior. When @value{GDBN} cannot find the breakpoint
+location, it queries you whether a pending breakpoint should be created.
+
+@item set breakpoint pending on
+This indicates that an unrecognized breakpoint location should automatically
+result in a pending breakpoint being created.
+
+@item set breakpoint pending off
+This indicates that pending breakpoints are not to be created. Any
+unrecognized breakpoint location results in an error. This setting does
+not affect any pending breakpoints previously created.
+
+@item show breakpoint pending
+Show the current behavior setting for creating pending breakpoints.
+@end table
+
+@cindex operations allowed on pending breakpoints
+Normal breakpoint operations apply to pending breakpoints as well. You may
+specify a condition for a pending breakpoint and/or commands to run when the
breakpoint is reached. You can also enable or disable
the pending breakpoint. When you specify a condition for a pending breakpoint,
the parsing of the condition will be deferred until the point where the
pending breakpoint location is resolved. Disabling a pending breakpoint
tells @value{GDBN} to not attempt to resolve the breakpoint on any subsequent
shared library load. When a pending breakpoint is re-enabled,
-@value{GDBN} checks to see if the location is already resolved.
+@value{GDBN} checks to see if the location is already resolved.
This is done because any number of shared library loads could have
occurred since the time the breakpoint was disabled and one or more
of these loads could resolve the location.
@@ -20422,6 +20449,82 @@ encoded). @value{GDBN} will continue to supply the values of symbols
(if available), until the target ceases to request them.
@end table
+@item @code{qPart}:@var{object}:@code{read}:@var{annex}:@var{offset},@var{length} --- read special data
+
+Read uninterpreted bytes from the target's special data area
+identified by the keyword @code{object}.
+Request @var{length} bytes starting at @var{offset} bytes into the data.
+The content and encoding of @var{annex} is specific to the object;
+it can supply additional details about what data to access.
+
+Here are the specific requests of this form defined so far.
+All @samp{@code{qPart}:@var{object}:@code{read}:@dots{}}
+requests use the same reply formats, listed below.
+
+@table @asis
+@item @code{qPart}:@code{auxv}:@code{read}::@var{offset},@var{length}
+Access the target's @dfn{auxiliary vector}. @xref{Auxiliary Vector}.
+Note @var{annex} must be empty.
+@end table
+
+Reply:
+@table @asis
+@item @code{OK}
+The @var{offset} in the request is at the end of the data.
+There is no more data to be read.
+
+@item @var{XX@dots{}}
+Hex encoded data bytes read.
+This may be fewer bytes than the @var{length} in the request.
+
+@item @code{E00}
+The request was malformed, or @var{annex} was invalid.
+
+@item @code{E}@var{nn}
+The offset was invalid, or there was an error encountered reading the data.
+@var{nn} is a hex-encoded @code{errno} value.
+
+@item @code{""} (empty)
+An empty reply indicates the @var{object} or @var{annex} string was not
+recognized by the stub.
+@end table
+
+@item @code{qPart}:@var{object}:@code{write}:@var{annex}:@var{offset}:@var{data@dots{}}
+
+Write uninterpreted bytes into the target's special data area
+identified by the keyword @code{object},
+starting at @var{offset} bytes into the data.
+@var{data@dots{}} is the hex-encoded data to be written.
+The content and encoding of @var{annex} is specific to the object;
+it can supply additional details about what data to access.
+
+No requests of this form are presently in use. This specification
+serves as a placeholder to document the common format that new
+specific request specifications ought to use.
+
+Reply:
+@table @asis
+@item @var{nn}
+@var{nn} (hex encoded) is the number of bytes written.
+This may be fewer bytes than supplied in the request.
+
+@item @code{E00}
+The request was malformed, or @var{annex} was invalid.
+
+@item @code{E}@var{nn}
+The offset was invalid, or there was an error encountered writing the data.
+@var{nn} is a hex-encoded @code{errno} value.
+
+@item @code{""} (empty)
+An empty reply indicates the @var{object} or @var{annex} string was not
+recognized by the stub, or that the object does not support writing.
+@end table
+
+@item @code{qPart}:@var{object}:@var{operation}:@dots{}
+Requests of this form may be added in the future. When a stub does
+not recognize the @var{object} keyword, or its support for
+@var{object} does not recognize the @var{operation} keyword,
+the stub must respond with an empty packet.
@end table
@node Register Packet Format
@@ -21629,7 +21732,9 @@ host is called:
@include gpl.texi
+@raisesections
@include fdl.texi
+@lowersections
@node Index
@unnumbered Index
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 6cf794d1b26..10710993fe6 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -4879,7 +4879,7 @@ object.
A module registers one or more per-architecture data-pointers using the
function @code{register_gdbarch_data}:
-@deftypefun struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *@var{init}, gdbarch_data_free_ftype *@var{free})
+@deftypefun struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *@var{init})
The @var{init} function is used to obtain an initial value for a
per-architecture data-pointer. The function is called, after the
@@ -4888,10 +4888,9 @@ uninitialized (@code{NULL}) and its value has been requested via a call
to @code{gdbarch_data}. A data-pointer can also be initialize
explicitly using @code{set_gdbarch_data}.
-The @var{free} function is called when a data-pointer needs to be
-destroyed. This occurs when either the corresponding @code{struct
-gdbarch} object is being destroyed or when @code{set_gdbarch_data} is
-overriding a non-@code{NULL} data-pointer value.
+Any memory required by the @var{init} function should be allocated
+using @code{GDBARCH_OBSTACK_ZALLOC}. That memory is automatically
+released when the corresponding architecture is deleted.
The function @code{register_gdbarch_data} returns a @code{struct
gdbarch_data} that is used to identify the data-pointer that was added
@@ -4899,23 +4898,18 @@ to the module.
@end deftypefun
-A typical module has @code{init} and @code{free} functions of the form:
+A typical module has an @code{init} function of the form:
@smallexample
+struct nozel @{ int total; @};
static struct gdbarch_data *nozel_handle;
static void *
nozel_init (struct gdbarch *gdbarch)
@{
- struct nozel *data = XMALLOC (struct nozel);
+ struct nozel *data = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct nozel);
@dots{}
return data;
@}
-@dots{}
-static void
-nozel_free (struct gdbarch *gdbarch, void *data)
-@{
- xfree (data);
-@}
@end smallexample
Since uninitialized (@code{NULL}) data-pointers are initialized
@@ -4930,7 +4924,7 @@ The data-pointer is registered with the call:
void
_initialize_nozel (void)
@{
- nozel_handle = register_gdbarch_data (nozel_init, nozel_free);
+ nozel_handle = register_gdbarch_data (nozel_init);
@dots{}
@end smallexample
@@ -4958,35 +4952,37 @@ nozel_total (struct gdbarch *gdbarch)
It is also possible to directly initialize the data-pointer using:
-@deftypefun void set_gdbarch_data (struct gdbarch *@var{gdbarch}, struct gdbarch_data *handle, void *@var{pointer})
-Update the data-pointer corresponding to @var{handle} with the value of
-@var{pointer}. If the previous data-pointer value is non-NULL, then it
-is freed using data-pointers @var{free} function.
+@deftypefun void set_gdbarch_data (struct gdbarch *@var{gdbarch}, struct gdbarch_data *@var{handle}, void *@var{pointer})
+Set the still @code{NULL} data-pointer corresponding to @var{handle}
+to the non-@code{NULL} @var{pointer} value.
@end deftypefun
This function is used by modules that require a mechanism for explicitly
setting the per-architecture data-pointer during architecture creation:
@smallexample
-/* Called during architecture creation. */
-extern void
-set_gdbarch_nozel (struct gdbarch *gdbarch,
- int total)
+/* Always return a non-NULL nozel. */
+static struct nozel *
+gdbarch_nozel (struct gdbarch *gdbarch)
@{
- struct nozel *data = XMALLOC (struct nozel);
- @dots{}
- set_gdbarch_data (gdbarch, nozel_handle, nozel);
+ struct nozel *nozel = gdbarch_data (gdbarch, nozel_handle);
+ if (nozel == NULL)
+ @{
+ nozel = nozel_init (gdbarch);
+ set_gdbarch_data (gdbarch, nozel_handle, nozel);
+ @}
+ return nozel;
@}
@end smallexample
@smallexample
-/* Default, called when nozel not set by set_gdbarch_nozel(). */
-static void *
-nozel_init (struct gdbarch *gdbarch)
+/* Called during architecture creation. */
+extern void
+set_gdbarch_nozel (struct gdbarch *gdbarch, int total)
@{
- struct nozel *default_nozel = XMALLOC (struc nozel);
+ struct nozel *data = gdbarch_nozel (gdbarch);
@dots{}
- return default_nozel;
+ data->total = total;
@}
@end smallexample
@@ -4994,7 +4990,7 @@ nozel_init (struct gdbarch *gdbarch)
void
_initialize_nozel (void)
@{
- nozel_handle = register_gdbarch_data (nozel_init, NULL);
+ nozel_handle = register_gdbarch_data (nozel_init);
@dots{}
@end smallexample
@@ -6749,7 +6745,9 @@ is so old that it has never been converted to use BFD. Now that's old!
@end table
@include observer.texi
+@raisesections
@include fdl.texi
+@lowersections
@node Index
@unnumbered Index
diff --git a/gdb/doc/stabs.texinfo b/gdb/doc/stabs.texinfo
index c20ae411964..e3be2ca9540 100644
--- a/gdb/doc/stabs.texinfo
+++ b/gdb/doc/stabs.texinfo
@@ -4026,7 +4026,9 @@ is no more work than having the linker relocate ELF symbols, and it
solves the problem of having to associate the ELF and stab symbols.
However, no one has yet designed or implemented such a scheme.
+@raisesections
@include fdl.texi
+@lowersections
@node Symbol Types Index
@unnumbered Symbol Types Index
diff --git a/gdb/dwarf2-frame.h b/gdb/dwarf2-frame.h
index 4bb313cba25..1ae44b5064c 100644
--- a/gdb/dwarf2-frame.h
+++ b/gdb/dwarf2-frame.h
@@ -24,6 +24,7 @@
#ifndef DWARF2_FRAME_H
#define DWARF2_FRAME_H 1
+struct gdbarch;
struct objfile;
struct frame_info;
diff --git a/gdb/event-top.c b/gdb/event-top.c
index f03aa1192a1..f4ba015e817 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -33,8 +33,8 @@
#include "gdbcmd.h"
/* readline include files */
-#include <readline/readline.h>
-#include <readline/history.h>
+#include "readline/readline.h"
+#include "readline/history.h"
/* readline defines this. */
#undef savestring
diff --git a/gdb/exec.c b/gdb/exec.c
index b849533e0c4..418b0b3aa35 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -38,7 +38,7 @@
#endif
#include <fcntl.h>
-#include <readline/readline.h>
+#include "readline/readline.h"
#include "gdb_string.h"
#include "gdbcore.h"
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index fc5a82122e4..82eaf7c0aec 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -74,7 +74,7 @@ frame_unwind_find_by_frame (struct frame_info *next_frame)
int i;
struct gdbarch *gdbarch = get_frame_arch (next_frame);
struct frame_unwind_table *table = gdbarch_data (gdbarch, frame_unwind_data);
- if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
+ if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES && legacy_frame_p (gdbarch))
/* Seriously old code. Don't even try to use this new mechanism.
(Note: The variable USE_GENERIC_DUMMY_FRAMES is deprecated, not
the dummy frame mechanism. All architectures should be using
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 24c69abe7a7..156036087ec 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,9 +1,48 @@
+2004-02-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * server.c (handle_v_cont): Call set_desired_inferior.
+
+2004-02-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * remote-utils.c (prepare_resume_reply): Always supply "thread:".
+
+2004-02-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * linux-low.c (linux_wait): Unblock async I/O.
+ (linux_resume): Block and enable async I/O.
+ * remote-utils.c (block_async_io, unblock_async_io): New functions.
+ * server.h (block_async_io, unblock_async_io): Add prototypes.
+
+2004-02-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * remote-utils.c (remote_open): Print a status notice after
+ opening a TCP port.
+ * server.c (attach_inferior): Print a status notice after
+ attaching.
+
+2004-02-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
+
+2004-02-26 Daniel Jacobowitz <drow@mvista.com>
+
+ * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
+ error packet.
+ * server.c, target.h: Update copyright years.
+
+2004-02-25 Roland McGrath <roland@redhat.com>
+
+ * target.h (struct target_ops): New member `read_auxv'.
+ * server.c (handle_query): Handle qPart:auxv:read: query using that.
+ * linux-low.c (linux_read_auxv): New function.
+ (linux_target_ops): Initialize `read_auxv' member to that.
+
2004-02-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Committed by Jim Blandy <jimb@redhat.com>.
* linux-s390-low.c (s390_num_regs): Update.
- (s390_regmap): Remove control registers. Use __s390x__ predefine
+ (s390_regmap): Remove control registers. Use __s390x__ predefine
instead of GPR_SIZE to distiguish s390 and s390x targets.
2004-01-31 Daniel Jacobowitz <drow@mvista.com>
@@ -153,7 +192,7 @@ Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com>
for create_inferior.
* server.c (signal_pid): New variable.
(create_inferior): Set signal_pid. Block SIGTTOU and SIGTTIN in
- gdbserver. Set the child to be the foreground process group.
+ gdbserver. Set the child to be the foreground process group.
(attach_inferior): Set signal_pid.
2002-08-23 Daniel Jacobowitz <drow@mvista.com>
@@ -182,7 +221,7 @@ Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com>
2002-07-04 Michal Ludvig <mludvig@suse.cz>
- * linux-x86-64-low.c (x86_64_regmap): Make it an array of
+ * linux-x86-64-low.c (x86_64_regmap): Make it an array of
byte offsets instead of an array of indexes.
(x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
@@ -567,4 +606,3 @@ Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com>
* server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes.
* utils.c (error): Remove NORETURN.
(fatal): Likewise.
-
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index 2e8bb981b52..f091a3dccc3 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -1,5 +1,5 @@
/* GNU/Linux/ARM specific low level interface, for the remote server for GDB.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -47,11 +47,15 @@ arm_cannot_fetch_register (int regno)
return (regno >= arm_num_regs);
}
+extern int debug_threads;
+
static CORE_ADDR
arm_get_pc ()
{
unsigned long pc;
collect_register_by_name ("pc", &pc);
+ if (debug_threads)
+ fprintf (stderr, "stop pc is %08lx\n", pc);
return pc;
}
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 501bb581956..ea155160e36 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -597,7 +597,7 @@ linux_wait_for_event (struct thread_info *child)
/* If we were single-stepping, we definitely want to report the
SIGTRAP. The single-step operation has completed, so also
- clear the stepping flag; in general this does not matter,
+ clear the stepping flag; in general this does not matter,
because the SIGTRAP will be reported to the client, which
will give us a new action for this thread, but clear it for
consistency anyway. It's safe to clear the stepping flag
@@ -662,6 +662,7 @@ retry:
}
enable_async_io ();
+ unblock_async_io ();
w = linux_wait_for_event (child);
stop_all_processes ();
disable_async_io ();
@@ -841,7 +842,7 @@ linux_resume_one_process (struct inferior_list_entry *entry,
check_removed_breakpoint (process);
- if (debug_threads && the_low_target.get_pc != NULL)
+ if (debug_threads && the_low_target.get_pc != NULL)
{
fprintf (stderr, " ");
(long) (*the_low_target.get_pc) ();
@@ -1017,7 +1018,11 @@ linux_resume (struct thread_resume *resume_info)
if (pending_flag)
for_each_inferior (&all_threads, linux_queue_one_thread);
else
- for_each_inferior (&all_threads, linux_continue_one_thread);
+ {
+ block_async_io ();
+ enable_async_io ();
+ for_each_inferior (&all_threads, linux_continue_one_thread);
+ }
}
#ifdef HAVE_LINUX_USRREGS
@@ -1283,11 +1288,11 @@ linux_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
/* Round starting address down to longword boundary. */
register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
/* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
+ register int count
+ = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
/ sizeof (PTRACE_XFER_TYPE);
/* Allocate buffer of that many longwords. */
- register PTRACE_XFER_TYPE *buffer
+ register PTRACE_XFER_TYPE *buffer
= (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
/* Read all the longwords */
@@ -1381,6 +1386,32 @@ linux_send_signal (int signum)
kill (signal_pid, signum);
}
+/* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET
+ to debugger memory starting at MYADDR. */
+
+static int
+linux_read_auxv (CORE_ADDR offset, char *myaddr, unsigned int len)
+{
+ char filename[PATH_MAX];
+ int fd, n;
+
+ snprintf (filename, sizeof filename, "/proc/%d/auxv", inferior_pid);
+
+ fd = open (filename, O_RDONLY);
+ if (fd < 0)
+ return -1;
+
+ if (offset != (CORE_ADDR) 0
+ && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
+ n = -1;
+ else
+ n = read (fd, myaddr, len);
+
+ close (fd);
+
+ return n;
+}
+
static struct target_ops linux_target_ops = {
linux_create_inferior,
@@ -1396,6 +1427,7 @@ static struct target_ops linux_target_ops = {
linux_write_memory,
linux_look_up_symbols,
linux_send_signal,
+ linux_read_auxv,
};
static void
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index eb56c1039a8..26b267a3aaf 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -1,6 +1,6 @@
/* Remote utility routines for the remote server for GDB.
Copyright 1986, 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002
+ 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -135,6 +135,8 @@ remote_open (char *name)
|| listen (tmp_desc, 1))
perror_with_name ("Can't bind address");
+ fprintf (stderr, "Listening on port %d\n", port);
+
tmp = sizeof (sockaddr);
remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp);
if (remote_desc == -1)
@@ -366,6 +368,24 @@ input_interrupt (int unused)
}
void
+block_async_io (void)
+{
+ sigset_t sigio_set;
+ sigemptyset (&sigio_set);
+ sigaddset (&sigio_set, SIGIO);
+ sigprocmask (SIG_BLOCK, &sigio_set, NULL);
+}
+
+void
+unblock_async_io (void)
+{
+ sigset_t sigio_set;
+ sigemptyset (&sigio_set);
+ sigaddset (&sigio_set, SIGIO);
+ sigprocmask (SIG_UNBLOCK, &sigio_set, NULL);
+}
+
+void
enable_async_io (void)
{
signal (SIGIO, input_interrupt);
@@ -487,9 +507,10 @@ write_ok (char *buf)
void
write_enn (char *buf)
{
+ /* Some day, we should define the meanings of the error codes... */
buf[0] = 'E';
- buf[1] = 'N';
- buf[2] = 'N';
+ buf[1] = '0';
+ buf[2] = '1';
buf[3] = '\0';
}
@@ -609,7 +630,11 @@ prepare_resume_reply (char *buf, char status, unsigned char signo)
thread_from_wait = ((struct inferior_list_entry *)current_inferior)->id;
if (debug_threads)
fprintf (stderr, "Writing resume reply for %d\n\n", thread_from_wait);
- if (old_thread_from_wait != thread_from_wait)
+ /* This if (1) ought to be unnecessary. But remote_wait in GDB
+ will claim this event belongs to inferior_ptid if we do not
+ specify a thread, and there's no way for gdbserver to know
+ what inferior_ptid is. */
+ if (1 || old_thread_from_wait != thread_from_wait)
{
general_thread = thread_from_wait;
sprintf (buf, "thread:%x;", thread_from_wait);
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index dffff2e1e61..fb667ef5e87 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1,5 +1,5 @@
/* Main code for remote server for GDB.
- Copyright 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2002
+ Copyright 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -70,6 +70,8 @@ attach_inferior (int pid, char *statusptr, unsigned char *sigptr)
if (myattach (pid) != 0)
return -1;
+ fprintf (stderr, "Attached; pid = %d\n", pid);
+
/* FIXME - It may be that we should get the SIGNAL_PID from the
attach function, so that it can be the main thread instead of
whichever we were told to attach to. */
@@ -104,7 +106,7 @@ handle_query (char *own_buf)
thread_ptr = thread_ptr->next;
return;
}
-
+
if (strcmp ("qsThreadInfo", own_buf) == 0)
{
if (thread_ptr != NULL)
@@ -119,7 +121,27 @@ handle_query (char *own_buf)
return;
}
}
-
+
+ if (the_target->read_auxv != NULL
+ && strncmp ("qPart:auxv:read::", own_buf, 17) == 0)
+ {
+ char data[(PBUFSIZ - 1) / 2];
+ CORE_ADDR ofs;
+ unsigned int len;
+ int n;
+ decode_m_packet (&own_buf[17], &ofs, &len); /* "OFS,LEN" */
+ if (len > sizeof data)
+ len = sizeof data;
+ n = (*the_target->read_auxv) (ofs, data, len);
+ if (n == 0)
+ write_ok (own_buf);
+ else if (n < 0)
+ write_enn (own_buf);
+ else
+ convert_int_to_ascii (data, own_buf, n);
+ return;
+ }
+
/* Otherwise we didn't know what packet it was. Say we didn't
understand it. */
own_buf[0] = 0;
@@ -213,6 +235,7 @@ handle_v_cont (char *own_buf, char *status, unsigned char *signal)
cont_thread = resume_info[0].thread;
else
cont_thread = -1;
+ set_desired_inferior (0);
(*the_target->resume) (resume_info);
@@ -371,7 +394,7 @@ main (int argc, char *argv[])
detach_inferior ();
write_ok (own_buf);
putpkt (own_buf);
- remote_close ();
+ remote_close ();
/* If we are attached, then we can exit. Otherwise, we need to
hang around doing nothing, until the child is gone. */
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 5212deb2c4a..4896afb5856 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -134,6 +134,8 @@ void write_ok (char *buf);
void write_enn (char *buf);
void enable_async_io (void);
void disable_async_io (void);
+void unblock_async_io (void);
+void block_async_io (void);
void convert_ascii_to_int (char *from, char *to, int n);
void convert_int_to_ascii (char *from, char *to, int n);
void new_thread_notify (int id);
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index aa0a44afd61..88ff2d482d3 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -1,5 +1,5 @@
/* Target operations for the remote server for GDB.
- Copyright 2002
+ Copyright 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by MontaVista Software.
@@ -92,7 +92,7 @@ struct target_ops
If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */
void (*fetch_registers) (int regno);
-
+
/* Store registers to the inferior process.
If REGNO is -1, store all registers; otherwise, store at least REGNO. */
@@ -125,6 +125,12 @@ struct target_ops
/* Send a signal to the inferior process, however is appropriate. */
void (*send_signal) (int);
+
+ /* Read auxiliary vector data from the inferior process.
+
+ Read LEN bytes at OFFSET into a buffer at MYADDR. */
+
+ int (*read_auxv) (CORE_ADDR offset, char *myaddr, unsigned int len);
};
extern struct target_ops *the_target;
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 06aa5a9896f..ccbdcba21c8 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -35,10 +35,14 @@
#include "osabi.h"
#include "gdb_assert.h"
#include "infttrace.h"
+#include "arch-utils.h"
/* For argument passing to the inferior */
#include "symtab.h"
#include "infcall.h"
#include "dis-asm.h"
+#include "trad-frame.h"
+#include "frame-unwind.h"
+#include "frame-base.h"
#ifdef USG
#include <sys/types.h>
@@ -114,6 +118,8 @@ static unsigned extract_5R_store (unsigned int);
static unsigned extract_5r_store (unsigned int);
+static void hppa_frame_init_saved_regs (struct frame_info *frame);
+
static void find_dummy_frame_regs (struct frame_info *, CORE_ADDR *);
static int find_proc_framesize (CORE_ADDR);
@@ -177,7 +183,6 @@ int hppa_in_solib_call_trampoline (CORE_ADDR pc, char *name);
int hppa_in_solib_return_trampoline (CORE_ADDR pc, char *name);
CORE_ADDR hppa_saved_pc_after_call (struct frame_info *frame);
int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
-CORE_ADDR hppa32_stack_align (CORE_ADDR sp);
CORE_ADDR hppa64_stack_align (CORE_ADDR sp);
int hppa_pc_requires_run_before_use (CORE_ADDR pc);
int hppa_instruction_nullified (void);
@@ -186,13 +191,9 @@ int hppa_register_byte (int reg_nr);
struct type * hppa32_register_virtual_type (int reg_nr);
struct type * hppa64_register_virtual_type (int reg_nr);
void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
-void hppa32_extract_return_value (struct type *type, char *regbuf,
- char *valbuf);
void hppa64_extract_return_value (struct type *type, char *regbuf,
char *valbuf);
-int hppa32_use_struct_convention (int gcc_p, struct type *type);
int hppa64_use_struct_convention (int gcc_p, struct type *type);
-void hppa32_store_return_value (struct type *type, char *valbuf);
void hppa64_store_return_value (struct type *type, char *valbuf);
int hppa_cannot_store_register (int regnum);
void hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame);
@@ -235,18 +236,115 @@ extern int exception_catchpoints_are_fragile;
/* Should call_function allocate stack space for a struct return? */
int
-hppa32_use_struct_convention (int gcc_p, struct type *type)
+hppa64_use_struct_convention (int gcc_p, struct type *type)
{
- return (TYPE_LENGTH (type) > 2 * DEPRECATED_REGISTER_SIZE);
+ /* RM: struct upto 128 bits are returned in registers */
+ return TYPE_LENGTH (type) > 16;
}
-/* Same as hppa32_use_struct_convention() for the PA64 ABI. */
+/* Handle 32/64-bit struct return conventions. */
-int
-hppa64_use_struct_convention (int gcc_p, struct type *type)
+static enum return_value_convention
+hppa32_return_value (struct gdbarch *gdbarch,
+ struct type *type, struct regcache *regcache,
+ void *readbuf, const void *writebuf)
{
- /* RM: struct upto 128 bits are returned in registers */
- return TYPE_LENGTH (type) > 16;
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ {
+ if (readbuf != NULL)
+ regcache_cooked_read_part (regcache, FP4_REGNUM, 0,
+ TYPE_LENGTH (type), readbuf);
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, FP4_REGNUM, 0,
+ TYPE_LENGTH (type), writebuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ if (TYPE_LENGTH (type) <= 2 * 4)
+ {
+ /* The value always lives in the right hand end of the register
+ (or register pair)? */
+ int b;
+ int reg = 28;
+ int part = TYPE_LENGTH (type) % 4;
+ /* The left hand register contains only part of the value,
+ transfer that first so that the rest can be xfered as entire
+ 4-byte registers. */
+ if (part > 0)
+ {
+ if (readbuf != NULL)
+ regcache_cooked_read_part (regcache, reg, 4 - part,
+ part, readbuf);
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, reg, 4 - part,
+ part, writebuf);
+ reg++;
+ }
+ /* Now transfer the remaining register values. */
+ for (b = part; b < TYPE_LENGTH (type); b += 4)
+ {
+ if (readbuf != NULL)
+ regcache_cooked_read (regcache, reg, (char *) readbuf + b);
+ if (writebuf != NULL)
+ regcache_cooked_write (regcache, reg, (const char *) writebuf + b);
+ reg++;
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ else
+ return RETURN_VALUE_STRUCT_CONVENTION;
+}
+
+static enum return_value_convention
+hppa64_return_value (struct gdbarch *gdbarch,
+ struct type *type, struct regcache *regcache,
+ void *readbuf, const void *writebuf)
+{
+ /* RM: Floats are returned in FR4R, doubles in FR4. Integral values
+ are in r28, padded on the left. Aggregates less that 65 bits are
+ in r28, right padded. Aggregates upto 128 bits are in r28 and
+ r29, right padded. */
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ {
+ /* Floats are right aligned? */
+ int offset = register_size (gdbarch, FP4_REGNUM) - TYPE_LENGTH (type);
+ if (readbuf != NULL)
+ regcache_cooked_read_part (regcache, FP4_REGNUM, offset,
+ TYPE_LENGTH (type), readbuf);
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, FP4_REGNUM, offset,
+ TYPE_LENGTH (type), writebuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ else if (TYPE_LENGTH (type) <= 8 && is_integral_type (type))
+ {
+ /* Integrals are right aligned. */
+ int offset = register_size (gdbarch, FP4_REGNUM) - TYPE_LENGTH (type);
+ if (readbuf != NULL)
+ regcache_cooked_read_part (regcache, 28, offset,
+ TYPE_LENGTH (type), readbuf);
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, 28, offset,
+ TYPE_LENGTH (type), writebuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ else if (TYPE_LENGTH (type) <= 2 * 8)
+ {
+ /* Composite values are left aligned. */
+ int b;
+ for (b = 0; b < TYPE_LENGTH (type); b += 8)
+ {
+ int part = (TYPE_LENGTH (type) - b - 1) % 8 + 1;
+ if (readbuf != NULL)
+ regcache_cooked_read_part (regcache, 28, 0, part,
+ (char *) readbuf + b);
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, 28, 0, part,
+ (const char *) writebuf + b);
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ else
+ return RETURN_VALUE_STRUCT_CONVENTION;
}
/* Routines to extract various sized constants out of hppa
@@ -699,7 +797,7 @@ find_unwind_entry (CORE_ADDR pc)
const unsigned char *
hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len)
{
- static const char breakpoint[] = {0x00, 0x01, 0x00, 0x04};
+ static const unsigned char breakpoint[] = {0x00, 0x01, 0x00, 0x04};
(*len) = sizeof (breakpoint);
return breakpoint;
}
@@ -2060,6 +2158,265 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
#endif
+/* This function pushes a stack frame with arguments as part of the
+ inferior function calling mechanism.
+
+ This is the version of the function for the 32-bit PA machines, in
+ which later arguments appear at lower addresses. (The stack always
+ grows towards higher addresses.)
+
+ We simply allocate the appropriate amount of stack space and put
+ arguments into their proper slots. */
+
+CORE_ADDR
+hppa32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ /* NOTE: cagney/2004-02-27: This is a guess - its implemented by
+ reverse engineering testsuite failures. */
+
+ /* Stack base address at which any pass-by-reference parameters are
+ stored. */
+ CORE_ADDR struct_end = 0;
+ /* Stack base address at which the first parameter is stored. */
+ CORE_ADDR param_end = 0;
+
+ /* The inner most end of the stack after all the parameters have
+ been pushed. */
+ CORE_ADDR new_sp = 0;
+
+ /* Two passes. First pass computes the location of everything,
+ second pass writes the bytes out. */
+ int write_pass;
+ for (write_pass = 0; write_pass < 2; write_pass++)
+ {
+ CORE_ADDR struct_ptr = 0;
+ CORE_ADDR param_ptr = 0;
+ int reg = 27; /* NOTE: Registers go down. */
+ int i;
+ for (i = 0; i < nargs; i++)
+ {
+ struct value *arg = args[i];
+ struct type *type = check_typedef (VALUE_TYPE (arg));
+ /* The corresponding parameter that is pushed onto the
+ stack, and [possibly] passed in a register. */
+ char param_val[8];
+ int param_len;
+ memset (param_val, 0, sizeof param_val);
+ if (TYPE_LENGTH (type) > 8)
+ {
+ /* Large parameter, pass by reference. Store the value
+ in "struct" area and then pass its address. */
+ param_len = 4;
+ struct_ptr += align_up (TYPE_LENGTH (type), 8);
+ if (write_pass)
+ write_memory (struct_end - struct_ptr, VALUE_CONTENTS (arg),
+ TYPE_LENGTH (type));
+ store_unsigned_integer (param_val, 4, struct_end - struct_ptr);
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_INT
+ || TYPE_CODE (type) == TYPE_CODE_ENUM)
+ {
+ /* Integer value store, right aligned. "unpack_long"
+ takes care of any sign-extension problems. */
+ param_len = align_up (TYPE_LENGTH (type), 4);
+ store_unsigned_integer (param_val, param_len,
+ unpack_long (type,
+ VALUE_CONTENTS (arg)));
+ }
+ else
+ {
+ /* Small struct value, store right aligned? */
+ param_len = align_up (TYPE_LENGTH (type), 4);
+ memcpy (param_val + param_len - TYPE_LENGTH (type),
+ VALUE_CONTENTS (arg), TYPE_LENGTH (type));
+ }
+ param_ptr += param_len;
+ reg -= param_len / 4;
+ if (write_pass)
+ {
+ write_memory (param_end - param_ptr, param_val, param_len);
+ if (reg >= 23)
+ {
+ regcache_cooked_write (regcache, reg, param_val);
+ if (param_len > 4)
+ regcache_cooked_write (regcache, reg + 1, param_val + 4);
+ }
+ }
+ }
+
+ /* Update the various stack pointers. */
+ if (!write_pass)
+ {
+ struct_end = sp + struct_ptr;
+ /* PARAM_PTR already accounts for all the arguments passed
+ by the user. However, the ABI mandates minimum stack
+ space allocations for outgoing arguments. The ABI also
+ mandates minimum stack alignments which we must
+ preserve. */
+ param_end = struct_end + max (align_up (param_ptr, 8),
+ REG_PARM_STACK_SPACE);
+ }
+ }
+
+ /* If a structure has to be returned, set up register 28 to hold its
+ address */
+ if (struct_return)
+ write_register (28, struct_addr);
+
+ /* Set the return address. */
+ regcache_cooked_write_unsigned (regcache, RP_REGNUM, bp_addr);
+
+ /* The stack will have 32 bytes of additional space for a frame marker. */
+ return param_end + 32;
+}
+
+/* This function pushes a stack frame with arguments as part of the
+ inferior function calling mechanism.
+
+ This is the version for the PA64, in which later arguments appear
+ at higher addresses. (The stack always grows towards higher
+ addresses.)
+
+ We simply allocate the appropriate amount of stack space and put
+ arguments into their proper slots.
+
+ This ABI also requires that the caller provide an argument pointer
+ to the callee, so we do that too. */
+
+CORE_ADDR
+hppa64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ /* Array of arguments' offsets. */
+ int *offset = (int *) alloca (nargs * sizeof (int));
+
+ /* Array of arguments' lengths: real lengths in bytes, not aligned
+ to word size. */
+ int *lengths = (int *) alloca (nargs * sizeof (int));
+
+ /* The value of SP as it was passed into this function. */
+ CORE_ADDR orig_sp = sp;
+
+ /* The number of stack bytes occupied by the current argument. */
+ int bytes_reserved;
+
+ /* The total number of bytes reserved for the arguments. */
+ int cum_bytes_reserved = 0;
+
+ /* Similarly, but aligned. */
+ int cum_bytes_aligned = 0;
+ int i;
+
+ /* Iterate over each argument provided by the user. */
+ for (i = 0; i < nargs; i++)
+ {
+ struct type *arg_type = VALUE_TYPE (args[i]);
+
+ /* Integral scalar values smaller than a register are padded on
+ the left. We do this by promoting them to full-width,
+ although the ABI says to pad them with garbage. */
+ if (is_integral_type (arg_type)
+ && TYPE_LENGTH (arg_type) < DEPRECATED_REGISTER_SIZE)
+ {
+ args[i] = value_cast ((TYPE_UNSIGNED (arg_type)
+ ? builtin_type_unsigned_long
+ : builtin_type_long),
+ args[i]);
+ arg_type = VALUE_TYPE (args[i]);
+ }
+
+ lengths[i] = TYPE_LENGTH (arg_type);
+
+ /* Align the size of the argument to the word size for this
+ target. */
+ bytes_reserved = (lengths[i] + DEPRECATED_REGISTER_SIZE - 1) & -DEPRECATED_REGISTER_SIZE;
+
+ offset[i] = cum_bytes_reserved;
+
+ /* Aggregates larger than eight bytes (the only types larger
+ than eight bytes we have) are aligned on a 16-byte boundary,
+ possibly padded on the right with garbage. This may leave an
+ empty word on the stack, and thus an unused register, as per
+ the ABI. */
+ if (bytes_reserved > 8)
+ {
+ /* Round up the offset to a multiple of two slots. */
+ int new_offset = ((offset[i] + 2*DEPRECATED_REGISTER_SIZE-1)
+ & -(2*DEPRECATED_REGISTER_SIZE));
+
+ /* Note the space we've wasted, if any. */
+ bytes_reserved += new_offset - offset[i];
+ offset[i] = new_offset;
+ }
+
+ cum_bytes_reserved += bytes_reserved;
+ }
+
+ /* CUM_BYTES_RESERVED already accounts for all the arguments passed
+ by the user. However, the ABIs mandate minimum stack space
+ allocations for outgoing arguments.
+
+ The ABIs also mandate minimum stack alignments which we must
+ preserve. */
+ cum_bytes_aligned = align_up (cum_bytes_reserved, 16);
+ sp += max (cum_bytes_aligned, REG_PARM_STACK_SPACE);
+
+ /* Now write each of the args at the proper offset down the
+ stack. */
+ for (i = 0; i < nargs; i++)
+ write_memory (orig_sp + offset[i], VALUE_CONTENTS (args[i]), lengths[i]);
+
+ /* If a structure has to be returned, set up register 28 to hold its
+ address */
+ if (struct_return)
+ write_register (28, struct_addr);
+
+ /* For the PA64 we must pass a pointer to the outgoing argument
+ list. The ABI mandates that the pointer should point to the
+ first byte of storage beyond the register flushback area.
+
+ However, the call dummy expects the outgoing argument pointer to
+ be passed in register %r4. */
+ write_register (4, orig_sp + REG_PARM_STACK_SPACE);
+
+ /* ?!? This needs further work. We need to set up the global data
+ pointer for this procedure. This assumes the same global pointer
+ for every procedure. The call dummy expects the dp value to be
+ passed in register %r6. */
+ write_register (6, read_register (27));
+
+ /* Set the return address. */
+ regcache_cooked_write_unsigned (regcache, RP_REGNUM, bp_addr);
+
+ /* The stack will have 64 bytes of additional space for a frame
+ marker. */
+ return sp + 64;
+
+}
+
+static CORE_ADDR
+hppa32_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ /* HP frames are 64-byte (or cache line) aligned (yes that's _byte_
+ and not _bit_)! */
+ return align_up (addr, 64);
+}
+
+/* Force all frames to 16-byte alignment. Better safe than sorry. */
+
+static CORE_ADDR
+hppa64_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ /* Just always 16-byte align. */
+ return align_up (addr, 16);
+}
+
+
/* elz: Used to lookup a symbol in the shared libraries.
This function calls shl_findsym, indirectly through a
call to __d_shl_get. __d_shl_get is in end.c, which is always
@@ -4146,7 +4503,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
&& extract_14 (inst) >= 0)
frame_saved_regs[reg] = get_frame_base (frame_info);
/* A std has explicit post_modify forms. */
- else if ((inst & 0xfc00000c0) == 0x70000008)
+ else if ((inst & 0xfc00000c) == 0x70000008)
frame_saved_regs[reg] = get_frame_base (frame_info);
else
{
@@ -4226,7 +4583,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
that do not yet implement DEPRECATED_FRAME_INIT_SAVED_REGS. */
/* Find the addresses in which registers are saved in FRAME. */
-void
+static void
hppa_frame_init_saved_regs (struct frame_info *frame)
{
if (deprecated_get_frame_saved_regs (frame) == NULL)
@@ -4234,6 +4591,326 @@ hppa_frame_init_saved_regs (struct frame_info *frame)
hppa_frame_find_saved_regs (frame, deprecated_get_frame_saved_regs (frame));
}
+struct hppa_frame_cache
+{
+ CORE_ADDR base;
+ struct trad_frame_saved_reg *saved_regs;
+};
+
+static struct hppa_frame_cache *
+hppa_frame_cache (struct frame_info *next_frame, void **this_cache)
+{
+ struct hppa_frame_cache *cache;
+ long saved_gr_mask;
+ long saved_fr_mask;
+ CORE_ADDR this_sp;
+ long frame_size;
+ struct unwind_table_entry *u;
+ int i;
+
+ if ((*this_cache) != NULL)
+ return (*this_cache);
+ cache = FRAME_OBSTACK_ZALLOC (struct hppa_frame_cache);
+ (*this_cache) = cache;
+ cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+
+ /* Yow! */
+ u = find_unwind_entry (frame_func_unwind (next_frame));
+ if (!u)
+ return;
+
+ /* Turn the Entry_GR field into a bitmask. */
+ saved_gr_mask = 0;
+ for (i = 3; i < u->Entry_GR + 3; i++)
+ {
+ /* Frame pointer gets saved into a special location. */
+ if (u->Save_SP && i == DEPRECATED_FP_REGNUM)
+ continue;
+
+ saved_gr_mask |= (1 << i);
+ }
+
+ /* Turn the Entry_FR field into a bitmask too. */
+ saved_fr_mask = 0;
+ for (i = 12; i < u->Entry_FR + 12; i++)
+ saved_fr_mask |= (1 << i);
+
+ /* Loop until we find everything of interest or hit a branch.
+
+ For unoptimized GCC code and for any HP CC code this will never ever
+ examine any user instructions.
+
+ For optimized GCC code we're faced with problems. GCC will schedule
+ its prologue and make prologue instructions available for delay slot
+ filling. The end result is user code gets mixed in with the prologue
+ and a prologue instruction may be in the delay slot of the first branch
+ or call.
+
+ Some unexpected things are expected with debugging optimized code, so
+ we allow this routine to walk past user instructions in optimized
+ GCC code. */
+ {
+ int final_iteration = 0;
+ CORE_ADDR pc;
+ CORE_ADDR end_pc = skip_prologue_using_sal (pc);
+ int looking_for_sp = u->Save_SP;
+ int looking_for_rp = u->Save_RP;
+ int fp_loc = -1;
+ if (end_pc == 0)
+ end_pc = frame_pc_unwind (next_frame);
+ frame_size = 0;
+ for (pc = frame_func_unwind (next_frame);
+ ((saved_gr_mask || saved_fr_mask
+ || looking_for_sp || looking_for_rp
+ || frame_size < (u->Total_frame_size << 3))
+ && pc <= end_pc);
+ pc += 4)
+ {
+ int reg;
+ char buf4[4];
+ long status = target_read_memory (pc, buf4, sizeof buf4);
+ long inst = extract_unsigned_integer (buf4, sizeof buf4);
+
+ /* Note the interesting effects of this instruction. */
+ frame_size += prologue_inst_adjust_sp (inst);
+
+ /* There are limited ways to store the return pointer into the
+ stack. */
+ if (inst == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */
+ {
+ looking_for_rp = 0;
+ cache->saved_regs[RP_REGNUM].addr = -20;
+ }
+ else if (inst == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */
+ {
+ looking_for_rp = 0;
+ cache->saved_regs[RP_REGNUM].addr = -16;
+ }
+
+ /* Check to see if we saved SP into the stack. This also
+ happens to indicate the location of the saved frame
+ pointer. */
+ if ((inst & 0xffffc000) == 0x6fc10000 /* stw,ma r1,N(sr0,sp) */
+ || (inst & 0xffffc00c) == 0x73c10008) /* std,ma r1,N(sr0,sp) */
+ {
+ looking_for_sp = 0;
+ cache->saved_regs[DEPRECATED_FP_REGNUM].addr = 0;
+ }
+
+ /* Account for general and floating-point register saves. */
+ reg = inst_saves_gr (inst);
+ if (reg >= 3 && reg <= 18
+ && (!u->Save_SP || reg != DEPRECATED_FP_REGNUM))
+ {
+ saved_gr_mask &= ~(1 << reg);
+ if ((inst >> 26) == 0x1b && extract_14 (inst) >= 0)
+ /* stwm with a positive displacement is a _post_
+ _modify_. */
+ cache->saved_regs[reg].addr = 0;
+ else if ((inst & 0xfc00000c) == 0x70000008)
+ /* A std has explicit post_modify forms. */
+ cache->saved_regs[reg].addr = 0;
+ else
+ {
+ CORE_ADDR offset;
+
+ if ((inst >> 26) == 0x1c)
+ offset = (inst & 0x1 ? -1 << 13 : 0) | (((inst >> 4) & 0x3ff) << 3);
+ else if ((inst >> 26) == 0x03)
+ offset = low_sign_extend (inst & 0x1f, 5);
+ else
+ offset = extract_14 (inst);
+
+ /* Handle code with and without frame pointers. */
+ if (u->Save_SP)
+ cache->saved_regs[reg].addr = offset;
+ else
+ cache->saved_regs[reg].addr = (u->Total_frame_size << 3) + offset;
+ }
+ }
+
+ /* GCC handles callee saved FP regs a little differently.
+
+ It emits an instruction to put the value of the start of
+ the FP store area into %r1. It then uses fstds,ma with a
+ basereg of %r1 for the stores.
+
+ HP CC emits them at the current stack pointer modifying the
+ stack pointer as it stores each register. */
+
+ /* ldo X(%r3),%r1 or ldo X(%r30),%r1. */
+ if ((inst & 0xffffc000) == 0x34610000
+ || (inst & 0xffffc000) == 0x37c10000)
+ fp_loc = extract_14 (inst);
+
+ reg = inst_saves_fr (inst);
+ if (reg >= 12 && reg <= 21)
+ {
+ /* Note +4 braindamage below is necessary because the FP
+ status registers are internally 8 registers rather than
+ the expected 4 registers. */
+ saved_fr_mask &= ~(1 << reg);
+ if (fp_loc == -1)
+ {
+ /* 1st HP CC FP register store. After this
+ instruction we've set enough state that the GCC and
+ HPCC code are both handled in the same manner. */
+ cache->saved_regs[reg + FP4_REGNUM + 4].addr = 0;
+ fp_loc = 8;
+ }
+ else
+ {
+ cache->saved_regs[reg + FP0_REGNUM + 4].addr = fp_loc;
+ fp_loc += 8;
+ }
+ }
+
+ /* Quit if we hit any kind of branch the previous iteration. */
+ if (final_iteration)
+ break;
+ /* We want to look precisely one instruction beyond the branch
+ if we have not found everything yet. */
+ if (is_branch (inst))
+ final_iteration = 1;
+ }
+ }
+
+ {
+ /* The frame base always represents the value of %sp at entry to
+ the current function (and is thus equivalent to the "saved"
+ stack pointer. */
+ CORE_ADDR this_sp = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+ /* FIXME: cagney/2004-02-22: This assumes that the frame has been
+ created. If it hasn't everything will be out-of-wack. */
+ if (u->Save_SP && trad_frame_addr_p (cache->saved_regs, SP_REGNUM))
+ /* Both we're expecting the SP to be saved and the SP has been
+ saved. The entry SP value is saved at this frame's SP
+ address. */
+ cache->base = read_memory_integer (this_sp, TARGET_PTR_BIT / 8);
+ else
+ /* The prologue has been slowly allocating stack space. Adjust
+ the SP back. */
+ cache->base = this_sp - frame_size;
+ trad_frame_set_value (cache->saved_regs, SP_REGNUM, cache->base);
+ }
+
+ /* The PC is found in the "return register", "Millicode" uses "r31"
+ as the return register while normal code uses "rp". */
+ if (u->Millicode)
+ cache->saved_regs[PCOQ_HEAD_REGNUM] = cache->saved_regs[31];
+ else
+ cache->saved_regs[PCOQ_HEAD_REGNUM] = cache->saved_regs[RP_REGNUM];
+
+ {
+ /* Convert all the offsets into addresses. */
+ int reg;
+ for (reg = 0; reg < NUM_REGS; reg++)
+ {
+ if (trad_frame_addr_p (cache->saved_regs, reg))
+ cache->saved_regs[reg].addr += cache->base;
+ }
+ }
+
+ return (*this_cache);
+}
+
+static void
+hppa_frame_this_id (struct frame_info *next_frame, void **this_cache,
+ struct frame_id *this_id)
+{
+ struct hppa_frame_cache *info = hppa_frame_cache (next_frame, this_cache);
+ (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame));
+}
+
+static void
+hppa_frame_prev_register (struct frame_info *next_frame,
+ void **this_cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *valuep)
+{
+ struct hppa_frame_cache *info = hppa_frame_cache (next_frame, this_cache);
+ struct gdbarch *gdbarch = get_frame_arch (next_frame);
+ if (regnum == PCOQ_TAIL_REGNUM)
+ {
+ /* The PCOQ TAIL, or NPC, needs to be computed from the unwound
+ PC register. */
+ *optimizedp = 0;
+ *lvalp = not_lval;
+ *addrp = 0;
+ *realnump = 0;
+ if (valuep)
+ {
+ int regsize = register_size (gdbarch, PCOQ_HEAD_REGNUM);
+ CORE_ADDR pc;
+ int optimized;
+ enum lval_type lval;
+ CORE_ADDR addr;
+ int realnum;
+ bfd_byte value[MAX_REGISTER_SIZE];
+ trad_frame_prev_register (next_frame, info->saved_regs,
+ PCOQ_HEAD_REGNUM, &optimized, &lval, &addr,
+ &realnum, &value);
+ pc = extract_unsigned_integer (&value, regsize);
+ store_unsigned_integer (valuep, regsize, pc + 4);
+ }
+ }
+ else
+ {
+ trad_frame_prev_register (next_frame, info->saved_regs, regnum,
+ optimizedp, lvalp, addrp, realnump, valuep);
+ }
+}
+
+static const struct frame_unwind hppa_frame_unwind =
+{
+ NORMAL_FRAME,
+ hppa_frame_this_id,
+ hppa_frame_prev_register
+};
+
+static const struct frame_unwind *
+hppa_frame_unwind_sniffer (struct frame_info *next_frame)
+{
+ return &hppa_frame_unwind;
+}
+
+static CORE_ADDR
+hppa_frame_base_address (struct frame_info *next_frame,
+ void **this_cache)
+{
+ struct hppa_frame_cache *info = hppa_frame_cache (next_frame,
+ this_cache);
+ return info->base;
+}
+
+static const struct frame_base hppa_frame_base = {
+ &hppa_frame_unwind,
+ hppa_frame_base_address,
+ hppa_frame_base_address,
+ hppa_frame_base_address
+};
+
+static const struct frame_base *
+hppa_frame_base_sniffer (struct frame_info *next_frame)
+{
+ return &hppa_frame_base;
+}
+
+static struct frame_id
+hppa_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ return frame_id_build (frame_unwind_register_unsigned (next_frame,
+ SP_REGNUM),
+ frame_pc_unwind (next_frame));
+}
+
+static CORE_ADDR
+hppa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ return frame_unwind_register_signed (next_frame, PC_REGNUM) & ~3;
+}
+
/* Exception handling support for the HP-UX ANSI C++ compiler.
The compiler (aCC) provides a callback for exception events;
GDB can set a breakpoint on this callback and find out what
@@ -4785,30 +5462,6 @@ hppa_skip_permanent_breakpoint (void)
/* We can leave the tail's space the same, since there's no jump. */
}
-/* Copy the function value from VALBUF into the proper location
- for a function return.
-
- Called only in the context of the "return" command. */
-
-void
-hppa32_store_return_value (struct type *type, char *valbuf)
-{
- /* For software floating point, the return value goes into the
- integer registers. But we do not have any flag to key this on,
- so we always store the value into the integer registers.
-
- If its a float value, then we also store it into the floating
- point registers. */
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (28)
- + (TYPE_LENGTH (type) > 4
- ? (8 - TYPE_LENGTH (type))
- : (4 - TYPE_LENGTH (type))),
- valbuf, TYPE_LENGTH (type));
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP4_REGNUM),
- valbuf, TYPE_LENGTH (type));
-}
-
/* Same as hppa32_store_return_value(), but for the PA64 ABI. */
void
@@ -4835,28 +5488,6 @@ hppa64_store_return_value (struct type *type, char *valbuf)
}
}
-/* Copy the function's return value into VALBUF.
-
- This function is called only in the context of "target function calls",
- ie. when the debugger forces a function to be called in the child, and
- when the debugger forces a fucntion to return prematurely via the
- "return" command. */
-
-void
-hppa32_extract_return_value (struct type *type, char *regbuf, char *valbuf)
-{
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
- memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (FP4_REGNUM), TYPE_LENGTH (type));
- else
- memcpy (valbuf,
- (regbuf
- + DEPRECATED_REGISTER_BYTE (28)
- + (TYPE_LENGTH (type) > 4
- ? (8 - TYPE_LENGTH (type))
- : (4 - TYPE_LENGTH (type)))),
- TYPE_LENGTH (type));
-}
-
/* Same as hppa32_extract_return_value but for the PA64 ABI case. */
void
@@ -4903,15 +5534,6 @@ hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs)
}
CORE_ADDR
-hppa32_stack_align (CORE_ADDR sp)
-{
- /* elz: adjust the quantity to the next highest value which is
- 64-bit aligned. This is used in valops.c, when the sp is adjusted.
- On hppa the sp must always be kept 64-bit aligned */
- return ((sp % 8) ? (sp + 7) & -8 : sp);
-}
-
-CORE_ADDR
hppa64_stack_align (CORE_ADDR sp)
{
/* The PA64 ABI mandates a 16 byte stack alignment. */
@@ -5183,44 +5805,79 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
/* Inferior function call methods. */
-#if 0
-#else
switch (tdep->bytes_per_address)
{
case 4:
- set_gdbarch_deprecated_call_dummy_length (gdbarch, hppa32_call_dummy_length);
- set_gdbarch_deprecated_stack_align (gdbarch, hppa32_stack_align);
- set_gdbarch_deprecated_reg_struct_has_addr (gdbarch, hppa_reg_struct_has_addr);
- set_gdbarch_deprecated_extract_return_value (gdbarch, hppa32_extract_return_value);
- set_gdbarch_use_struct_convention (gdbarch, hppa32_use_struct_convention);
- set_gdbarch_deprecated_store_return_value (gdbarch, hppa32_store_return_value);
+ set_gdbarch_push_dummy_call (gdbarch, hppa32_push_dummy_call);
+ set_gdbarch_frame_align (gdbarch, hppa32_frame_align);
break;
case 8:
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, hppa64_call_dummy_breakpoint_offset);
- set_gdbarch_deprecated_call_dummy_length (gdbarch, hppa64_call_dummy_length);
- set_gdbarch_deprecated_stack_align (gdbarch, hppa64_stack_align);
- set_gdbarch_deprecated_extract_return_value (gdbarch, hppa64_extract_return_value);
- set_gdbarch_use_struct_convention (gdbarch, hppa64_use_struct_convention);
- set_gdbarch_deprecated_store_return_value (gdbarch, hppa64_store_return_value);
+ if (0)
+ {
+ set_gdbarch_push_dummy_call (gdbarch, hppa64_push_dummy_call);
+ set_gdbarch_frame_align (gdbarch, hppa64_frame_align);
+ break;
+ }
+ else
+ {
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, hppa64_call_dummy_breakpoint_offset);
+ set_gdbarch_deprecated_call_dummy_length (gdbarch, hppa64_call_dummy_length);
+ set_gdbarch_deprecated_stack_align (gdbarch, hppa64_stack_align);
+ break;
+ set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame);
+ /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
+ set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments);
+ set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
+ set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
+ set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ }
break;
}
- set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return);
- set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame);
- /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
- set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments);
-#endif
-
+
+ /* Struct return methods. */
+ switch (tdep->bytes_per_address)
+ {
+ case 4:
+ set_gdbarch_return_value (gdbarch, hppa32_return_value);
+ break;
+ case 8:
+ if (0)
+ set_gdbarch_return_value (gdbarch, hppa64_return_value);
+ else
+ {
+ set_gdbarch_deprecated_extract_return_value (gdbarch, hppa64_extract_return_value);
+ set_gdbarch_use_struct_convention (gdbarch, hppa64_use_struct_convention);
+ set_gdbarch_deprecated_store_return_value (gdbarch, hppa64_store_return_value);
+ set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return);
+ }
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+
/* Frame unwind methods. */
-#if 0
-#else
- set_gdbarch_deprecated_saved_pc_after_call (gdbarch, hppa_saved_pc_after_call);
- set_gdbarch_deprecated_init_extra_frame_info (gdbarch, hppa_init_extra_frame_info);
- set_gdbarch_deprecated_frame_chain (gdbarch, hppa_frame_chain);
- set_gdbarch_deprecated_frame_chain_valid (gdbarch, hppa_frame_chain_valid);
- set_gdbarch_deprecated_frameless_function_invocation (gdbarch, hppa_frameless_function_invocation);
- set_gdbarch_deprecated_frame_saved_pc (gdbarch, hppa_frame_saved_pc);
- set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame);
-#endif
+ switch (tdep->bytes_per_address)
+ {
+ case 4:
+ set_gdbarch_unwind_dummy_id (gdbarch, hppa_unwind_dummy_id);
+ set_gdbarch_unwind_pc (gdbarch, hppa_unwind_pc);
+ frame_unwind_append_sniffer (gdbarch, hppa_frame_unwind_sniffer);
+ frame_base_append_sniffer (gdbarch, hppa_frame_base_sniffer);
+ break;
+ case 8:
+ set_gdbarch_deprecated_saved_pc_after_call (gdbarch, hppa_saved_pc_after_call);
+ set_gdbarch_deprecated_init_frame_pc (gdbarch, deprecated_init_frame_pc_default);
+ set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, hppa_frame_init_saved_regs);
+ set_gdbarch_deprecated_init_extra_frame_info (gdbarch, hppa_init_extra_frame_info);
+ set_gdbarch_deprecated_frame_chain (gdbarch, hppa_frame_chain);
+ set_gdbarch_deprecated_frame_chain_valid (gdbarch, hppa_frame_chain_valid);
+ set_gdbarch_deprecated_frameless_function_invocation (gdbarch, hppa_frameless_function_invocation);
+ set_gdbarch_deprecated_frame_saved_pc (gdbarch, hppa_frame_saved_pc);
+ set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c
index 73794bc2fb5..a20e9b06635 100644
--- a/gdb/i386-nat.c
+++ b/gdb/i386-nat.c
@@ -1,5 +1,6 @@
-/* Intel x86 (a.k.a. ia32) native-dependent code.
- Copyright (C) 2001 Free Software Foundation, Inc.
+/* Native-dependent code for the i386.
+
+ Copyright 2001, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,24 +24,24 @@
#include "command.h"
#include "gdbcmd.h"
-/* Support for hardware watchpoints and breakpoints using the x86
+/* Support for hardware watchpoints and breakpoints using the i386
debug registers.
This provides several functions for inserting and removing
- hardware-assisted breakpoints and watchpoints, testing if
- one or more of the watchpoints triggered and at what address,
- checking whether a given region can be watched, etc.
-
- A target which wants to use these functions should define
- several macros, such as `target_insert_watchpoint' and
- `target_stopped_data_address', listed in target.h, to call
- the appropriate functions below. It should also define
+ hardware-assisted breakpoints and watchpoints, testing if one or
+ more of the watchpoints triggered and at what address, checking
+ whether a given region can be watched, etc.
+
+ A target which wants to use these functions should define several
+ macros, such as `target_insert_watchpoint' and
+ `target_stopped_data_address', listed in target.h, to call the
+ appropriate functions below. It should also define
I386_USE_GENERIC_WATCHPOINTS in its tm.h file.
- In addition, each target should provide several low-level
- macros that will be called to insert watchpoints and hardware
- breakpoints into the inferior, remove them, and check their
- status. These macros are:
+ In addition, each target should provide several low-level macros
+ that will be called to insert watchpoints and hardware breakpoints
+ into the inferior, remove them, and check their status. These
+ macros are:
I386_DR_LOW_SET_CONTROL -- set the debug control (DR7)
register to a given value
@@ -54,21 +55,20 @@
I386_DR_LOW_GET_STATUS -- return the value of the debug
status (DR6) register.
- The functions below implement debug registers sharing by
- reference counts, and allow to watch regions up to 16 bytes
- long. */
+ The functions below implement debug registers sharing by reference
+ counts, and allow to watch regions up to 16 bytes long. */
#ifdef I386_USE_GENERIC_WATCHPOINTS
/* Support for 8-byte wide hw watchpoints. */
#ifndef TARGET_HAS_DR_LEN_8
-#define TARGET_HAS_DR_LEN_8 0
+#define TARGET_HAS_DR_LEN_8 0
#endif
/* Debug registers' indices. */
-#define DR_NADDR 4 /* the number of debug address registers */
-#define DR_STATUS 6 /* index of debug status register (DR6) */
-#define DR_CONTROL 7 /* index of debug control register (DR7) */
+#define DR_NADDR 4 /* The number of debug address registers. */
+#define DR_STATUS 6 /* Index of debug status register (DR6). */
+#define DR_CONTROL 7 /* Index of debug control register (DR7). */
/* DR7 Debug Control register fields. */
@@ -78,46 +78,46 @@
#define DR_CONTROL_SIZE 4
/* Watchpoint/breakpoint read/write fields in DR7. */
-#define DR_RW_EXECUTE (0x0) /* break on instruction execution */
-#define DR_RW_WRITE (0x1) /* break on data writes */
-#define DR_RW_READ (0x3) /* break on data reads or writes */
+#define DR_RW_EXECUTE (0x0) /* Break on instruction execution. */
+#define DR_RW_WRITE (0x1) /* Break on data writes. */
+#define DR_RW_READ (0x3) /* Break on data reads or writes. */
/* This is here for completeness. No platform supports this
- functionality yet (as of Mar-2001). Note that the DE flag in the
+ functionality yet (as of March 2001). Note that the DE flag in the
CR4 register needs to be set to support this. */
#ifndef DR_RW_IORW
-#define DR_RW_IORW (0x2) /* break on I/O reads or writes */
+#define DR_RW_IORW (0x2) /* Break on I/O reads or writes. */
#endif
/* Watchpoint/breakpoint length fields in DR7. The 2-bit left shift
is so we could OR this with the read/write field defined above. */
-#define DR_LEN_1 (0x0 << 2) /* 1-byte region watch or breakpt */
-#define DR_LEN_2 (0x1 << 2) /* 2-byte region watch */
-#define DR_LEN_4 (0x3 << 2) /* 4-byte region watch */
-#define DR_LEN_8 (0x2 << 2) /* 8-byte region watch (x86-64) */
+#define DR_LEN_1 (0x0 << 2) /* 1-byte region watch or breakpoint. */
+#define DR_LEN_2 (0x1 << 2) /* 2-byte region watch. */
+#define DR_LEN_4 (0x3 << 2) /* 4-byte region watch. */
+#define DR_LEN_8 (0x2 << 2) /* 8-byte region watch (AMD64). */
/* Local and Global Enable flags in DR7.
When the Local Enable flag is set, the breakpoint/watchpoint is
enabled only for the current task; the processor automatically
- clears this flag on every task switch. When the Global Enable
- flag is set, the breakpoint/watchpoint is enabled for all tasks;
- the processor never clears this flag.
+ clears this flag on every task switch. When the Global Enable flag
+ is set, the breakpoint/watchpoint is enabled for all tasks; the
+ processor never clears this flag.
Currently, all watchpoint are locally enabled. If you need to
enable them globally, read the comment which pertains to this in
i386_insert_aligned_watchpoint below. */
-#define DR_LOCAL_ENABLE_SHIFT 0 /* extra shift to the local enable bit */
-#define DR_GLOBAL_ENABLE_SHIFT 1 /* extra shift to the global enable bit */
-#define DR_ENABLE_SIZE 2 /* 2 enable bits per debug register */
+#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit. */
+#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit. */
+#define DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */
/* Local and global exact breakpoint enable flags (a.k.a. slowdown
flags). These are only required on i386, to allow detection of the
exact instruction which caused a watchpoint to break; i486 and
later processors do that automatically. We set these flags for
- back compatibility. */
+ backwards compatibility. */
#define DR_LOCAL_SLOWDOWN (0x100)
-#define DR_GLOBAL_SLOWDOWN (0x200)
+#define DR_GLOBAL_SLOWDOWN (0x200)
/* Fields reserved by Intel. This includes the GD (General Detect
Enable) flag, which causes a debug exception to be generated when a
@@ -129,7 +129,7 @@
/* Auxiliary helper macros. */
/* A value that masks all fields in DR7 that are reserved by Intel. */
-#define I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED)
+#define I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED)
/* The I'th debug register is vacant if its Local and Global Enable
bits are reset in the Debug Control register. */
@@ -168,13 +168,13 @@
/* Mirror the inferior's DRi registers. We keep the status and
control registers separated because they don't hold addresses. */
static CORE_ADDR dr_mirror[DR_NADDR];
-static unsigned dr_status_mirror, dr_control_mirror;
+static unsigned dr_status_mirror, dr_control_mirror;
/* Reference counts for each debug register. */
-static int dr_ref_count[DR_NADDR];
+static int dr_ref_count[DR_NADDR];
/* Whether or not to print the mirrored debug registers. */
-static int maint_show_dr;
+static int maint_show_dr;
/* Types of operations supported by i386_handle_nonaligned_watchpoint. */
typedef enum { WP_INSERT, WP_REMOVE, WP_COUNT } i386_wp_op_t;
@@ -182,8 +182,8 @@ typedef enum { WP_INSERT, WP_REMOVE, WP_COUNT } i386_wp_op_t;
/* Internal functions. */
/* Return the value of a 4-bit field for DR7 suitable for watching a
- region of LEN bytes for accesses of type TYPE. LEN is assumed
- to have the value of 1, 2, or 4. */
+ region of LEN bytes for accesses of type TYPE. LEN is assumed to
+ have the value of 1, 2, or 4. */
static unsigned i386_length_and_rw_bits (int len, enum target_hw_bp_type type);
/* Insert a watchpoint at address ADDR, which is assumed to be aligned
@@ -206,16 +206,17 @@ static int i386_remove_aligned_watchpoint (CORE_ADDR addr,
number of debug registers required to watch a region at address
ADDR whose length is LEN for accesses of type TYPE. Return 0 on
successful insertion or removal, a positive number when queried
- about the number of registers, or -1 on failure. If WHAT is not
- a valid value, bombs through internal_error. */
+ about the number of registers, or -1 on failure. If WHAT is not a
+ valid value, bombs through internal_error. */
static int i386_handle_nonaligned_watchpoint (i386_wp_op_t what,
CORE_ADDR addr, int len,
enum target_hw_bp_type type);
/* Implementation. */
-/* Clear the reference counts and forget everything we knew about
- the debug registers. */
+/* Clear the reference counts and forget everything we knew about the
+ debug registers. */
+
void
i386_cleanup_dregs (void)
{
@@ -231,18 +232,22 @@ i386_cleanup_dregs (void)
}
#ifndef LINUX_CHILD_POST_STARTUP_INFERIOR
-/* Reset all debug registers at each new startup
- to avoid missing watchpoints after restart. */
+
+/* Reset all debug registers at each new startup to avoid missing
+ watchpoints after restart. */
+
void
child_post_startup_inferior (ptid_t ptid)
{
i386_cleanup_dregs ();
}
+
#endif /* LINUX_CHILD_POST_STARTUP_INFERIOR */
-/* Print the values of the mirrored debug registers.
- This is called when maint_show_dr is non-zero. To set that
- up, type "maint show-debug-regs" at GDB's prompt. */
+/* Print the values of the mirrored debug registers. This is called
+ when maint_show_dr is non-zero. To set that up, type "maint
+ show-debug-regs" at GDB's prompt. */
+
static void
i386_show_dr (const char *func, CORE_ADDR addr,
int len, enum target_hw_bp_type type)
@@ -268,7 +273,8 @@ i386_show_dr (const char *func, CORE_ADDR addr,
dr_control_mirror, dr_status_mirror);
ALL_DEBUG_REGISTERS(i)
{
- printf_unfiltered ("\tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n",
+ printf_unfiltered ("\
+\tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n",
i, paddr(dr_mirror[i]), dr_ref_count[i],
i+1, paddr(dr_mirror[i+1]), dr_ref_count[i+1]);
i++;
@@ -276,8 +282,9 @@ i386_show_dr (const char *func, CORE_ADDR addr,
}
/* Return the value of a 4-bit field for DR7 suitable for watching a
- region of LEN bytes for accesses of type TYPE. LEN is assumed
- to have the value of 1, 2, or 4. */
+ region of LEN bytes for accesses of type TYPE. LEN is assumed to
+ have the value of 1, 2, or 4. */
+
static unsigned
i386_length_and_rw_bits (int len, enum target_hw_bp_type type)
{
@@ -291,18 +298,21 @@ i386_length_and_rw_bits (int len, enum target_hw_bp_type type)
case hw_write:
rw = DR_RW_WRITE;
break;
- case hw_read: /* x86 doesn't support data-read watchpoints */
+ case hw_read:
+ /* The i386 doesn't support data-read watchpoints. */
case hw_access:
rw = DR_RW_READ;
break;
#if 0
- case hw_io_access: /* not yet supported */
+ /* Not yet supported. */
+ case hw_io_access:
rw = DR_RW_IORW;
break;
#endif
default:
internal_error (__FILE__, __LINE__, "\
-Invalid hw breakpoint type %d in i386_length_and_rw_bits.\n", (int)type);
+Invalid hardware breakpoint type %d in i386_length_and_rw_bits.\n",
+ (int) type);
}
switch (len)
@@ -318,7 +328,7 @@ Invalid hw breakpoint type %d in i386_length_and_rw_bits.\n", (int)type);
return (DR_LEN_8 | rw);
default:
internal_error (__FILE__, __LINE__, "\
-Invalid hw breakpoint length %d in i386_length_and_rw_bits.\n", len);
+Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n", len);
}
}
@@ -327,6 +337,7 @@ Invalid hw breakpoint length %d in i386_length_and_rw_bits.\n", len);
value of the bits from DR7 which describes the length and access
type of the region to be watched by this watchpoint. Return 0 on
success, -1 on failure. */
+
static int
i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
{
@@ -364,7 +375,7 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
dr_ref_count[i] = 1;
I386_DR_SET_RW_LEN (i, len_rw_bits);
/* Note: we only enable the watchpoint locally, i.e. in the current
- task. Currently, no x86 target allows or supports global
+ task. Currently, no i386 target allows or supports global
watchpoints; however, if any target would want that in the
future, GDB should probably provide a command to control whether
to enable watchpoints globally or locally, and the code below
@@ -386,6 +397,7 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
value of the bits from DR7 which describes the length and access
type of the region watched by this watchpoint. Return 0 on
success, -1 on failure. */
+
static int
i386_remove_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
{
@@ -417,42 +429,46 @@ i386_remove_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
number of debug registers required to watch a region at address
ADDR whose length is LEN for accesses of type TYPE. Return 0 on
successful insertion or removal, a positive number when queried
- about the number of registers, or -1 on failure. If WHAT is not
- a valid value, bombs through internal_error. */
+ about the number of registers, or -1 on failure. If WHAT is not a
+ valid value, bombs through internal_error. */
+
static int
i386_handle_nonaligned_watchpoint (i386_wp_op_t what, CORE_ADDR addr, int len,
enum target_hw_bp_type type)
{
- int align;
- int size;
- int rv = 0, status = 0;
+ int retval = 0, status = 0;
int max_wp_len = TARGET_HAS_DR_LEN_8 ? 8 : 4;
static int size_try_array[8][8] =
{
- {1, 1, 1, 1, 1, 1, 1, 1}, /* trying size one */
- {2, 1, 2, 1, 2, 1, 2, 1}, /* trying size two */
- {2, 1, 2, 1, 2, 1, 2, 1}, /* trying size three */
- {4, 1, 2, 1, 4, 1, 2, 1}, /* trying size four */
- {4, 1, 2, 1, 4, 1, 2, 1}, /* trying size five */
- {4, 1, 2, 1, 4, 1, 2, 1}, /* trying size six */
- {4, 1, 2, 1, 4, 1, 2, 1}, /* trying size seven */
- {8, 1, 2, 1, 4, 1, 2, 1}, /* trying size eight */
+ {1, 1, 1, 1, 1, 1, 1, 1}, /* Trying size one. */
+ {2, 1, 2, 1, 2, 1, 2, 1}, /* Trying size two. */
+ {2, 1, 2, 1, 2, 1, 2, 1}, /* Trying size three. */
+ {4, 1, 2, 1, 4, 1, 2, 1}, /* Trying size four. */
+ {4, 1, 2, 1, 4, 1, 2, 1}, /* Trying size five. */
+ {4, 1, 2, 1, 4, 1, 2, 1}, /* Trying size six. */
+ {4, 1, 2, 1, 4, 1, 2, 1}, /* Trying size seven. */
+ {8, 1, 2, 1, 4, 1, 2, 1}, /* Trying size eight. */
};
while (len > 0)
{
- align = addr % max_wp_len;
- /* Four(eigth on x86_64) is the maximum length an x86 debug register
+ int align = addr % max_wp_len;
+ /* Four (eigth on AMD64) is the maximum length a debug register
can watch. */
- size = size_try_array[len > max_wp_len ? (max_wp_len - 1) : len - 1][align];
+ int try = (len > max_wp_len ? (max_wp_len - 1) : len - 1);
+ int size = size_try_array[try][align];
+
if (what == WP_COUNT)
- /* size_try_array[] is defined so that each iteration through
- the loop is guaranteed to produce an address and a size
- that can be watched with a single debug register. Thus,
- for counting the registers required to watch a region, we
- simply need to increment the count on each iteration. */
- rv++;
+ {
+ /* size_try_array[] is defined such that each iteration
+ through the loop is guaranteed to produce an address and a
+ size that can be watched with a single debug register.
+ Thus, for counting the registers required to watch a
+ region, we simply need to increment the count on each
+ iteration. */
+ retval++;
+ }
else
{
unsigned len_rw = i386_length_and_rw_bits (size, type);
@@ -475,17 +491,20 @@ Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n",
to our failure to insert this watchpoint and tries to
remove it. */
if (status)
- rv = status;
+ retval = status;
}
+
addr += size;
len -= size;
}
- return rv;
+
+ return retval;
}
/* Insert a watchpoint to watch a memory region which starts at
address ADDR and whose length is LEN bytes. Watch memory accesses
of the type TYPE. Return 0 on success, -1 on failure. */
+
int
i386_insert_watchpoint (CORE_ADDR addr, int len, int type)
{
@@ -533,25 +552,26 @@ i386_remove_watchpoint (CORE_ADDR addr, int len, int type)
/* Return non-zero if we can watch a memory region that starts at
address ADDR and whose length is LEN bytes. */
+
int
i386_region_ok_for_watchpoint (CORE_ADDR addr, int len)
{
+ int nregs;
+
/* Compute how many aligned watchpoints we would need to cover this
region. */
- int nregs = i386_handle_nonaligned_watchpoint (WP_COUNT, addr, len,
- hw_write);
-
+ nregs = i386_handle_nonaligned_watchpoint (WP_COUNT, addr, len, hw_write);
return nregs <= DR_NADDR ? 1 : 0;
}
/* If the inferior has some watchpoint that triggered, return the
- address associated with that watchpoint. Otherwise, return
- zero. */
+ address associated with that watchpoint. Otherwise, return zero. */
+
CORE_ADDR
i386_stopped_data_address (void)
{
+ CORE_ADDR addr = 0;
int i;
- CORE_ADDR ret = 0;
dr_status_mirror = I386_DR_LOW_GET_STATUS ();
@@ -562,22 +582,23 @@ i386_stopped_data_address (void)
watchpoint, not a hardware breakpoint. The reason is
that GDB doesn't call the target_stopped_data_address
method except for data watchpoints. In other words, I'm
- being paranoiac. */
+ being paranoid. */
&& I386_DR_GET_RW_LEN (i) != 0)
{
- ret = dr_mirror[i];
+ addr = dr_mirror[i];
if (maint_show_dr)
- i386_show_dr ("watchpoint_hit", ret, -1, hw_write);
+ i386_show_dr ("watchpoint_hit", addr, -1, hw_write);
}
}
- if (maint_show_dr && ret == 0)
+ if (maint_show_dr && addr == 0)
i386_show_dr ("stopped_data_addr", 0, 0, hw_write);
- return ret;
+ return addr;
}
/* Return non-zero if the inferior has some break/watchpoint that
triggered. */
+
int
i386_stopped_by_hwbp (void)
{
@@ -612,6 +633,7 @@ i386_insert_hw_breakpoint (CORE_ADDR addr, void *shadow)
/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
unused. Return 0 on success, -1 on failure. */
+
int
i386_remove_hw_breakpoint (CORE_ADDR addr, void *shadow)
{
@@ -625,8 +647,11 @@ i386_remove_hw_breakpoint (CORE_ADDR addr, void *shadow)
}
#endif /* I386_USE_GENERIC_WATCHPOINTS */
-
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_i386_nat (void);
+
void
_initialize_i386_nat (void)
{
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index 70f6b8fec24..f164e9d849a 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -1,7 +1,6 @@
/* Target-dependent code for the i386.
- Copyright 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -214,10 +213,13 @@ extern void i386_svr4_init_abi (struct gdbarch_info, struct gdbarch *);
/* Functions and variables exported from i386bsd-tdep.c. */
extern void i386bsd_init_abi (struct gdbarch_info, struct gdbarch *);
-extern CORE_ADDR i386fbsd_sigtramp_start;
-extern CORE_ADDR i386fbsd_sigtramp_end;
-extern CORE_ADDR i386obsd_sigtramp_start;
-extern CORE_ADDR i386obsd_sigtramp_end;
+extern int i386bsd_pc_in_sigtramp (CORE_ADDR pc, char *name);
+extern CORE_ADDR i386bsd_sigtramp_start (CORE_ADDR pc);
+extern CORE_ADDR i386bsd_sigtramp_end (CORE_ADDR pc);
+extern CORE_ADDR i386fbsd_sigtramp_start_addr;
+extern CORE_ADDR i386fbsd_sigtramp_end_addr;
+extern CORE_ADDR i386obsd_sigtramp_start_addr;
+extern CORE_ADDR i386obsd_sigtramp_end_addr;
extern int i386fbsd4_sc_reg_offset[];
extern int i386fbsd_sc_reg_offset[];
extern int i386nbsd_sc_reg_offset[];
diff --git a/gdb/i386b-nat.c b/gdb/i386b-nat.c
deleted file mode 100644
index 7c2a7d8deb3..00000000000
--- a/gdb/i386b-nat.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Native-dependent code for BSD Unix running on i386's, for GDB.
- Copyright 1988, 1989, 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000,
- 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-
-#include <machine/reg.h>
-
-/* This table must line up with REGISTER_NAME in "i386-tdep.c". */
-/* symbols like 'tEAX' come from <machine/reg.h> */
-static int tregmap[] =
-{
- tEAX, tECX, tEDX, tEBX,
- tESP, tEBP, tESI, tEDI,
- tEIP, tEFLAGS, tCS, tSS
-};
-
-#ifdef sEAX
-static int sregmap[] =
-{
- sEAX, sECX, sEDX, sEBX,
- sESP, sEBP, sESI, sEDI,
- sEIP, sEFLAGS, sCS, sSS
-};
-#else /* No sEAX */
-
-/* FreeBSD has decided to collapse the s* and t* symbols. So if the s*
- ones aren't around, use the t* ones for sregmap too. */
-
-static int sregmap[] =
-{
- tEAX, tECX, tEDX, tEBX,
- tESP, tEBP, tESI, tEDI,
- tEIP, tEFLAGS, tCS, tSS
-};
-#endif /* No sEAX */
-
-/* blockend is the value of u.u_ar0, and points to the
- place where ES is stored. */
-
-int
-i386_register_u_addr (int blockend, int regnum)
-{
- /* The following condition is a kludge to get at the proper register map
- depending upon the state of pcb_flag.
- The proper condition would be
- if (u.u_pcb.pcb_flag & FM_TRAP)
- but that would require a ptrace call here and wouldn't work
- for corefiles. */
-
- if (blockend < 0x1fcc)
- return (blockend + 4 * tregmap[regnum]);
- else
- return (blockend + 4 * sregmap[regnum]);
-}
diff --git a/gdb/i386bsd-tdep.c b/gdb/i386bsd-tdep.c
index 67d09ee14d7..9276c32b3f7 100644
--- a/gdb/i386bsd-tdep.c
+++ b/gdb/i386bsd-tdep.c
@@ -1,6 +1,6 @@
/* Target-dependent code for i386 BSD's.
- Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -34,7 +34,7 @@
/* Return whether PC is in a BSD sigtramp routine. */
-static int
+int
i386bsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
diff --git a/gdb/i386fbsd-nat.c b/gdb/i386fbsd-nat.c
index 7feb7b053e6..efc61b6cbbb 100644
--- a/gdb/i386fbsd-nat.c
+++ b/gdb/i386fbsd-nat.c
@@ -1,5 +1,6 @@
/* Native-dependent code for FreeBSD/i386.
- Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -98,8 +99,8 @@ _initialize_i386fbsd_nat (void)
len = sizeof (ps_strings);
if (sysctl (mib, 2, &ps_strings, &len, NULL, 0) == 0)
{
- i386fbsd_sigtramp_start = ps_strings - 128;
- i386fbsd_sigtramp_end = ps_strings;
+ i386fbsd_sigtramp_start_addr = ps_strings - 128;
+ i386fbsd_sigtramp_end_addr = ps_strings;
}
}
#endif
diff --git a/gdb/i386fbsd-tdep.c b/gdb/i386fbsd-tdep.c
index 786de7d1fc2..db14a67a5b5 100644
--- a/gdb/i386fbsd-tdep.c
+++ b/gdb/i386fbsd-tdep.c
@@ -1,6 +1,6 @@
/* Target-dependent code for FreeBSD/i386.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -25,6 +25,7 @@
#include "i386-tdep.h"
#include "i387-tdep.h"
+#include "solib-svr4.h"
/* FreeBSD 3.0-RELEASE or later. */
@@ -39,8 +40,9 @@ static int i386fbsd_r_reg_offset[] =
1 * 4, 0 * 4, -1, -1 /* %ds, %es, %fs, %gs */
};
-CORE_ADDR i386fbsd_sigtramp_start = 0xbfbfdf20;
-CORE_ADDR i386fbsd_sigtramp_end = 0xbfbfdff0;
+/* Sigtramp routine location. */
+CORE_ADDR i386fbsd_sigtramp_start_addr = 0xbfbfdf20;
+CORE_ADDR i386fbsd_sigtramp_end_addr = 0xbfbfdff0;
/* From <machine/signal.h>. */
static int i386fbsd_sc_reg_offset[] =
@@ -82,8 +84,8 @@ i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->struct_return = reg_struct_return;
/* FreeBSD uses a different memory layout. */
- tdep->sigtramp_start = i386fbsd_sigtramp_start;
- tdep->sigtramp_end = i386fbsd_sigtramp_end;
+ tdep->sigtramp_start = i386fbsd_sigtramp_start_addr;
+ tdep->sigtramp_end = i386fbsd_sigtramp_end_addr;
/* FreeBSD has a more complete `struct sigcontext'. */
tdep->sc_reg_offset = i386fbsd_sc_reg_offset;
@@ -100,8 +102,10 @@ i386fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_elf_init_abi (info, gdbarch);
/* FreeBSD ELF uses SVR4-style shared libraries. */
- set_gdbarch_in_solib_call_trampoline (gdbarch,
- generic_in_solib_call_trampoline);
+ set_gdbarch_in_solib_call_trampoline
+ (gdbarch, generic_in_solib_call_trampoline);
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, svr4_ilp32_fetch_link_map_offsets);
}
/* FreeBSD 4.0-RELEASE or later. */
diff --git a/gdb/i386nbsd-tdep.c b/gdb/i386nbsd-tdep.c
index a0609d55bd8..82013b59fc0 100644
--- a/gdb/i386nbsd-tdep.c
+++ b/gdb/i386nbsd-tdep.c
@@ -1,6 +1,7 @@
/* Target-dependent code for NetBSD/i386.
- Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001, 2002, 2003
+ Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001, 2002,
+ 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -33,7 +34,6 @@
#include "i386-tdep.h"
#include "i387-tdep.h"
#include "nbsd-tdep.h"
-
#include "solib-svr4.h"
/* From <machine/reg.h>. */
@@ -267,10 +267,10 @@ i386nbsdelf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_elf_init_abi (info, gdbarch);
/* NetBSD ELF uses SVR4-style shared libraries. */
- set_gdbarch_in_solib_call_trampoline (gdbarch,
- generic_in_solib_call_trampoline);
+ set_gdbarch_in_solib_call_trampoline
+ (gdbarch, generic_in_solib_call_trampoline);
set_solib_svr4_fetch_link_map_offsets
- (gdbarch, nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
+ (gdbarch, svr4_ilp32_fetch_link_map_offsets);
/* NetBSD ELF uses -fpcc-struct-return by default. */
tdep->struct_return = pcc_struct_return;
diff --git a/gdb/i386obsd-nat.c b/gdb/i386obsd-nat.c
index b0d4e033b8d..68cc79044ec 100644
--- a/gdb/i386obsd-nat.c
+++ b/gdb/i386obsd-nat.c
@@ -1,5 +1,6 @@
/* Native-dependent code for OpenBSD/i386.
- Copyright 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -51,8 +52,8 @@ _initialize_i386obsd_nat (void)
len = sizeof (_ps);
if (sysctl (mib, 2, &_ps, &len, NULL, 0) == 0)
{
- i386obsd_sigtramp_start = (CORE_ADDR)_ps.val - 128;
- i386obsd_sigtramp_end = (CORE_ADDR)_ps.val;
+ i386obsd_sigtramp_start_addr = (CORE_ADDR)_ps.val - 128;
+ i386obsd_sigtramp_end_addr = (CORE_ADDR)_ps.val;
}
}
#endif
diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c
index be9e735cb3c..d8556ea460a 100644
--- a/gdb/i386obsd-tdep.c
+++ b/gdb/i386obsd-tdep.c
@@ -27,6 +27,7 @@
#include "regcache.h"
#include "regset.h"
#include "osabi.h"
+#include "target.h"
#include "gdb_assert.h"
#include "gdb_string.h"
@@ -35,6 +36,81 @@
#include "i387-tdep.h"
#include "solib-svr4.h"
+/* Support for signal handlers. */
+
+/* Since OpenBSD 3.2, the sigtramp routine is mapped at a random page
+ in virtual memory. The randomness makes it somewhat tricky to
+ detect it, but fortunately we can rely on the fact that the start
+ of the sigtramp routine is page-aligned. By the way, the mapping
+ is read-only, so you cannot place a breakpoint in the signal
+ trampoline. */
+
+/* Default page size. */
+static const int i386obsd_page_size = 4096;
+
+/* Return whether PC is in an OpenBSD sigtramp routine. */
+
+static int
+i386obsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ CORE_ADDR start_pc = (pc & ~(i386obsd_page_size - 1));
+ const char sigreturn[] =
+ {
+ 0xb8,
+ 0x67, 0x00, 0x00, 0x00, /* movl $SYS_sigreturn, %eax */
+ 0xcd, 0x80 /* int $0x80 */
+ };
+ char *buf;
+
+ /* Avoid reading memory from the target if possible. If we're in a
+ named function, we're certainly not in a sigtramp routine
+ provided by the kernel. Take synthetic function names into
+ account though. */
+ if (name && name[0] != '<')
+ return 0;
+
+ /* If we can't read the instructions at START_PC, return zero. */
+ buf = alloca (sizeof sigreturn);
+ if (target_read_memory (start_pc + 0x14, buf, sizeof sigreturn))
+ return 0;
+
+ /* Check for sigreturn(2). */
+ if (memcmp (buf, sigreturn, sizeof sigreturn) == 0)
+ return 1;
+
+ /* Check for a traditional BSD sigtramp routine. */
+ return i386bsd_pc_in_sigtramp (pc, name);
+}
+
+/* Return the start address of the sigtramp routine. */
+
+static CORE_ADDR
+i386obsd_sigtramp_start (CORE_ADDR pc)
+{
+ CORE_ADDR start_pc = (pc & ~(i386obsd_page_size - 1));
+
+ if (i386bsd_pc_in_sigtramp (pc, NULL))
+ return i386bsd_sigtramp_start (pc);
+
+ return start_pc;
+}
+
+/* Return the end address of the sigtramp routine. */
+
+static CORE_ADDR
+i386obsd_sigtramp_end (CORE_ADDR pc)
+{
+ CORE_ADDR start_pc = (pc & ~(i386obsd_page_size - 1));
+
+ if (i386bsd_pc_in_sigtramp (pc, NULL))
+ return i386bsd_sigtramp_end (pc);
+
+ return start_pc + 0x22;
+}
+
+/* Mapping between the general-purpose registers in `struct reg'
+ format and GDB's register cache layout. */
+
/* From <machine/reg.h>. */
static int i386obsd_r_reg_offset[] =
{
@@ -95,8 +171,9 @@ i386obsd_aout_regset_from_core_section (struct gdbarch *gdbarch,
}
-CORE_ADDR i386obsd_sigtramp_start = 0xbfbfdf20;
-CORE_ADDR i386obsd_sigtramp_end = 0xbfbfdff0;
+/* Sigtramp routine location for OpenBSD 3.1 and earlier releases. */
+CORE_ADDR i386obsd_sigtramp_start_addr = 0xbfbfdf20;
+CORE_ADDR i386obsd_sigtramp_end_addr = 0xbfbfdff0;
/* From <machine/signal.h>. */
int i386obsd_sc_reg_offset[I386_NUM_GREGS] =
@@ -136,8 +213,11 @@ i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->struct_return = reg_struct_return;
/* OpenBSD uses a different memory layout. */
- tdep->sigtramp_start = i386obsd_sigtramp_start;
- tdep->sigtramp_end = i386obsd_sigtramp_end;
+ tdep->sigtramp_start = i386obsd_sigtramp_start_addr;
+ tdep->sigtramp_end = i386obsd_sigtramp_end_addr;
+ set_gdbarch_pc_in_sigtramp (gdbarch, i386obsd_pc_in_sigtramp);
+ set_gdbarch_sigtramp_start (gdbarch, i386obsd_sigtramp_start);
+ set_gdbarch_sigtramp_end (gdbarch, i386obsd_sigtramp_end);
/* OpenBSD has a `struct sigcontext' that's different from the
origional 4.3 BSD. */
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 15525659bb8..21386fb13f0 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -1,7 +1,7 @@
/* Intel 387 floating point stuff.
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1998, 1999, 2000,
- 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -613,14 +613,13 @@ i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave)
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in
- *FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
- this for all registers. This function doesn't touch any of the
- reserved bits in *FXSAVE. */
+ *FXSAVE with the value from REGCACHE. If REGNUM is -1, do this for
+ all registers. This function doesn't touch any of the reserved
+ bits in *FXSAVE. */
void
-i387_fill_fxsave (void *fxsave, int regnum)
+i387_collect_fxsave (const struct regcache *regcache, int regnum, void *fxsave)
{
- struct regcache *regcache = current_regcache;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
char *regs = fxsave;
int i;
@@ -686,6 +685,17 @@ i387_fill_fxsave (void *fxsave, int regnum)
#undef I387_NUM_XMM_REGS
}
+/* Fill register REGNUM (if it is a floating-point or SSE register) in
+ *FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
+ this for all registers. This function doesn't touch any of the
+ reserved bits in *FXSAVE. */
+
+void
+i387_fill_fxsave (void *fxsave, int regnum)
+{
+ i387_collect_fxsave (current_regcache, regnum, fxsave);
+}
+
/* Recreate the FTW (tag word) valid bits from the 80-bit FP data in
*RAW. */
diff --git a/gdb/i387-tdep.h b/gdb/i387-tdep.h
index fa94a486d81..978fdf9937e 100644
--- a/gdb/i387-tdep.h
+++ b/gdb/i387-tdep.h
@@ -1,6 +1,6 @@
/* Target-dependent code for the i387.
- Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -96,6 +96,14 @@ extern void i387_supply_fxsave (struct regcache *regcache, int regnum,
const void *fxsave);
/* Fill register REGNUM (if it is a floating-point or SSE register) in
+ *FXSAVE with the value from REGCACHE. If REGNUM is -1, do this for
+ all registers. This function doesn't touch any of the reserved
+ bits in *FXSAVE. */
+
+extern void i387_collect_fxsave (const struct regcache *regcache, int regnum,
+ void *fxsave);
+
+/* Fill register REGNUM (if it is a floating-point or SSE register) in
*FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
this for all registers. This function doesn't touch any of the
reserved bits in *FXSAVE. */
diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c
index 12f0c18c112..c3fa443a365 100644
--- a/gdb/ia64-linux-tdep.c
+++ b/gdb/ia64-linux-tdep.c
@@ -23,6 +23,7 @@
#include "ia64-tdep.h"
#include "arch-utils.h"
#include "gdbcore.h"
+#include "regcache.h"
/* The sigtramp code is in a non-readable (executable-only) region
of memory called the ``gate page''. The addresses in question
@@ -94,3 +95,20 @@ ia64_linux_sigcontext_register_address (CORE_ADDR sp, int regno)
return 0;
}
}
+
+void
+ia64_linux_write_pc (CORE_ADDR pc, ptid_t ptid)
+{
+ ia64_write_pc (pc, ptid);
+
+ /* We must be careful with modifying the instruction-pointer: if we
+ just interrupt a system call, the kernel would ordinarily try to
+ restart it when we resume the inferior, which typically results
+ in SIGSEGV or SIGILL. We prevent this by clearing r10, which
+ will tell the kernel that r8 does NOT contain a valid error code
+ and hence it will skip system-call restart.
+
+ The clearing of r10 is safe as long as ia64_write_pc() is only
+ called as part of setting up an inferior call. */
+ write_register_pid (IA64_GR10_REGNUM, 0, ptid);
+}
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index caeaf2d9c6c..278538caa8b 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -628,7 +628,7 @@ ia64_read_pc (ptid_t ptid)
return pc_value | (slot_num * SLOT_MULTIPLIER);
}
-static void
+void
ia64_write_pc (CORE_ADDR new_pc, ptid_t ptid)
{
int slot_num = (int) (new_pc & 0xf) / SLOT_MULTIPLIER;
@@ -3338,7 +3338,10 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint);
set_gdbarch_breakpoint_from_pc (gdbarch, ia64_breakpoint_from_pc);
set_gdbarch_read_pc (gdbarch, ia64_read_pc);
- set_gdbarch_write_pc (gdbarch, ia64_write_pc);
+ if (info.osabi == GDB_OSABI_LINUX)
+ set_gdbarch_write_pc (gdbarch, ia64_linux_write_pc);
+ else
+ set_gdbarch_write_pc (gdbarch, ia64_write_pc);
/* Settings for calling functions in the inferior. */
set_gdbarch_push_dummy_call (gdbarch, ia64_push_dummy_call);
diff --git a/gdb/ia64-tdep.h b/gdb/ia64-tdep.h
index 32364d276e8..e153eed580c 100644
--- a/gdb/ia64-tdep.h
+++ b/gdb/ia64-tdep.h
@@ -25,5 +25,7 @@
extern CORE_ADDR ia64_linux_sigcontext_register_address (CORE_ADDR, int);
extern CORE_ADDR ia64_aix_sigcontext_register_address (CORE_ADDR, int);
extern unsigned long ia64_linux_getunwind_table (void *, size_t);
+extern void ia64_write_pc (CORE_ADDR, ptid_t);
+extern void ia64_linux_write_pc (CORE_ADDR, ptid_t);
#endif /* IA64_TDEP_H */
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 860d9cfafd0..11ce018087c 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -275,18 +275,21 @@ legacy_push_dummy_code (struct gdbarch *gdbarch,
DUMMY_ADDR is pretty messed up. It comes from constant tinkering
with the values. Instead a DEPRECATED_FIX_CALL_DUMMY replacement
(PUSH_DUMMY_BREAKPOINT?) should just do everything. */
+ if (!gdbarch_push_dummy_call_p (current_gdbarch))
+ {
#ifdef GDB_TARGET_IS_HPPA
- (*real_pc) = DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs,
- args, value_type, using_gcc);
+ (*real_pc) = DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs,
+ args, value_type, using_gcc);
#else
- if (DEPRECATED_FIX_CALL_DUMMY_P ())
- {
- /* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */
- DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
- value_type, using_gcc);
- }
- (*real_pc) = start_sp;
+ if (DEPRECATED_FIX_CALL_DUMMY_P ())
+ {
+ /* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */
+ DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
+ value_type, using_gcc);
+ }
+ (*real_pc) = start_sp;
#endif
+ }
/* Yes, the offset is applied to the real_pc and not the dummy addr.
Ulgh! Blame the HP/UX target. */
(*bp_addr) = (*real_pc) + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET;
@@ -348,7 +351,8 @@ push_dummy_code (struct gdbarch *gdbarch,
if (gdbarch_push_dummy_code_p (gdbarch))
return gdbarch_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
args, nargs, value_type, real_pc, bp_addr);
- else if (DEPRECATED_FIX_CALL_DUMMY_P ())
+ else if (DEPRECATED_FIX_CALL_DUMMY_P ()
+ && !gdbarch_push_dummy_call_p (gdbarch))
return legacy_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
args, nargs, value_type, real_pc, bp_addr);
else
@@ -546,7 +550,8 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
}
break;
case AT_ENTRY_POINT:
- if (DEPRECATED_FIX_CALL_DUMMY_P ())
+ if (DEPRECATED_FIX_CALL_DUMMY_P ()
+ && !gdbarch_push_dummy_call_p (current_gdbarch))
{
/* Sigh. Some targets use DEPRECATED_FIX_CALL_DUMMY to
shove extra stuff onto the stack or into registers. That
diff --git a/gdb/inflow.c b/gdb/inflow.c
index 55f6ab52073..35cd79968b9 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -1,6 +1,7 @@
/* Low level interface to ptrace, for GDB when running under Unix.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of GDB.
@@ -223,6 +224,7 @@ void
terminal_inferior (void)
{
if (gdb_has_a_terminal () && terminal_is_ours
+ && inferior_ttystate != NULL
&& inferior_thisrun_terminal == 0)
{
int result;
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 72da9495c13..9734ec12ed6 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -347,9 +347,36 @@ void
print_scalar_formatted (void *valaddr, struct type *type, int format, int size,
struct ui_file *stream)
{
- LONGEST val_long;
+ LONGEST val_long = 0;
unsigned int len = TYPE_LENGTH (type);
+ if (len > sizeof(LONGEST) &&
+ (TYPE_CODE (type) == TYPE_CODE_INT
+ || TYPE_CODE (type) == TYPE_CODE_ENUM))
+ {
+ switch (format)
+ {
+ case 'o':
+ print_octal_chars (stream, valaddr, len);
+ return;
+ case 'u':
+ case 'd':
+ print_decimal_chars (stream, valaddr, len);
+ return;
+ case 't':
+ print_binary_chars (stream, valaddr, len);
+ return;
+ case 'x':
+ print_hex_chars (stream, valaddr, len);
+ return;
+ case 'c':
+ print_char_chars (stream, valaddr, len);
+ return;
+ default:
+ break;
+ };
+ }
+
if (format != 'f')
val_long = unpack_long (type, valaddr);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index e479954296e..154fc5e0c71 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1332,8 +1332,7 @@ read_pc_pid (ptid_t ptid)
else if (PC_REGNUM >= 0)
{
CORE_ADDR raw_val = read_register_pid (PC_REGNUM, ptid);
- CORE_ADDR pc_val = ADDR_BITS_REMOVE (raw_val);
- return pc_val;
+ pc_val = ADDR_BITS_REMOVE (raw_val);
}
else
internal_error (__FILE__, __LINE__, "read_pc_pid: Unable to find PC");
diff --git a/gdb/remote.c b/gdb/remote.c
index 55bc135a9b2..29bbbc86d80 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -292,7 +292,7 @@ init_remote_state (struct gdbarch *gdbarch)
little. */
if (rs->sizeof_g_packet > ((rs->remote_packet_size - 32) / 2))
rs->remote_packet_size = (rs->sizeof_g_packet * 2 + 32);
-
+
/* This one is filled in when a ``g'' packet is received. */
rs->actual_register_packet_size = 0;
@@ -790,7 +790,7 @@ show_remote_protocol_e_packet_cmd (char *args, int from_tty,
{
show_packet_config_cmd (&remote_protocol_e);
}
-
+
/* Should we try the 'E' (step over range / w signal #) request? */
static struct packet_config remote_protocol_E;
@@ -808,7 +808,7 @@ show_remote_protocol_E_packet_cmd (char *args, int from_tty,
{
show_packet_config_cmd (&remote_protocol_E);
}
-
+
/* Should we try the 'P' (set register) request? */
@@ -960,7 +960,7 @@ static struct packet_config remote_protocol_binary_download;
This variable (NOT available to the user: auto-detect only!)
determines whether GDB will use the new, simpler "ThreadInfo"
query or the older, more complex syntax for thread queries.
- This is an auto-detect variable (set to true at each connect,
+ This is an auto-detect variable (set to true at each connect,
and set to false when the target fails to recognize it). */
static int use_threadinfo_query;
@@ -981,6 +981,23 @@ show_remote_protocol_binary_download_cmd (char *args, int from_tty,
show_packet_config_cmd (&remote_protocol_binary_download);
}
+/* Should we try the 'qPart:auxv' (target auxiliary vector read) request? */
+static struct packet_config remote_protocol_qPart_auxv;
+
+static void
+set_remote_protocol_qPart_auxv_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
+{
+ update_packet_config (&remote_protocol_qPart_auxv);
+}
+
+static void
+show_remote_protocol_qPart_auxv_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
+{
+ show_packet_config_cmd (&remote_protocol_qPart_auxv);
+}
+
/* Tokens for use by the asynchronous signal handlers for SIGINT */
static void *sigint_remote_twice_token;
@@ -1455,7 +1472,7 @@ pack_threadinfo_request (char *pkt, int mode, threadref *id)
fetch registers and its stack */
#define TAG_DISPLAY 4 /* A short thing maybe to put on a window */
#define TAG_THREADNAME 8 /* string, maps 1-to-1 with a thread is */
-#define TAG_MOREDISPLAY 16 /* Whatever the kernel wants to say about
+#define TAG_MOREDISPLAY 16 /* Whatever the kernel wants to say about
the process */
static int
@@ -1743,8 +1760,8 @@ remote_current_thread (ptid_t oldpid)
return oldpid;
}
-/* Find new threads for info threads command.
- * Original version, using John Metzler's thread protocol.
+/* Find new threads for info threads command.
+ * Original version, using John Metzler's thread protocol.
*/
static void
@@ -1780,7 +1797,7 @@ remote_threads_info (void)
bufp = buf;
getpkt (bufp, (rs->remote_packet_size), 0);
if (bufp[0] != '\0') /* q packet recognized */
- {
+ {
while (*bufp++ == 'm') /* reply contains one or more TID */
{
do
@@ -1804,12 +1821,12 @@ remote_threads_info (void)
return;
}
-/*
+/*
* Collect a descriptive string about the given thread.
* The target may say anything it wants to about the thread
* (typically info about its blocked / runnable state, name, etc.).
* This string will appear in the info threads display.
- *
+ *
* Optional: targets are not required to implement this function.
*/
@@ -1969,9 +1986,9 @@ get_offsets (void)
if (symfile_objfile == NULL)
return;
- offs = ((struct section_offsets *)
+ offs = ((struct section_offsets *)
alloca (SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections)));
- memcpy (offs, symfile_objfile->section_offsets,
+ memcpy (offs, symfile_objfile->section_offsets,
SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_addr;
@@ -2070,6 +2087,7 @@ init_all_packet_configs (void)
/* Force remote_write_bytes to check whether target supports binary
downloading. */
update_packet_config (&remote_protocol_binary_download);
+ update_packet_config (&remote_protocol_qPart_auxv);
}
/* Symbol look-up. */
@@ -2103,7 +2121,7 @@ remote_check_symbols (struct objfile *objfile)
if (sym == NULL)
sprintf (msg, "qSymbol::%s", &reply[8]);
else
- sprintf (msg, "qSymbol:%s:%s",
+ sprintf (msg, "qSymbol:%s:%s",
paddr_nz (SYMBOL_VALUE_ADDRESS (sym)),
&reply[8]);
putpkt (msg);
@@ -2183,7 +2201,7 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
push_target (target); /* Switch to using remote target now */
init_all_packet_configs ();
-
+
general_thread = -2;
continue_thread = -2;
@@ -2259,10 +2277,10 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
getpkt (buf, (rs->remote_packet_size), 0);
}
#ifdef SOLIB_CREATE_INFERIOR_HOOK
- /* FIXME: need a master target_open vector from which all
- remote_opens can be called, so that stuff like this can
+ /* FIXME: need a master target_open vector from which all
+ remote_opens can be called, so that stuff like this can
go there. Failing that, the following code must be copied
- to the open function for any remote target that wants to
+ to the open function for any remote target that wants to
support svr4 shared libraries. */
/* Set up to detect and load shared libraries. */
@@ -2556,7 +2574,7 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal)
too is not supported. But that would require another copy of
the code to issue the 'e' packet (and fall back to 's' if not
supported) in remote_wait(). */
-
+
if (siggnal != TARGET_SIGNAL_0)
{
if (remote_protocol_E.support != PACKET_DISABLE)
@@ -2838,7 +2856,7 @@ remote_console_output (char *msg)
/* Wait until the remote machine stops, then return,
storing status in STATUS just as `wait' would.
- Returns "pid", which in the case of a multi-threaded
+ Returns "pid", which in the case of a multi-threaded
remote OS, is the thread-id. */
static ptid_t
@@ -2896,7 +2914,7 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
LONGEST pnum = 0;
/* If the packet contains a register number save it in pnum
- and set p1 to point to the character following it.
+ and set p1 to point to the character following it.
Otherwise p1 points to p. */
/* If this packet is an awatch packet, don't parse the 'a'
@@ -2908,7 +2926,7 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
pnum = strtol (p, &p_temp, 16);
p1 = (unsigned char *) p_temp;
}
- else
+ else
p1 = p;
if (p1 == p) /* No register number present here */
@@ -3085,19 +3103,19 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
long pnum = 0;
/* If the packet contains a register number, save it in pnum
- and set p1 to point to the character following it.
+ and set p1 to point to the character following it.
Otherwise p1 points to p. */
/* If this packet is an awatch packet, don't parse the 'a'
as a register number. */
-
+
if (!strncmp (p, "awatch", strlen ("awatch")) != 0)
{
/* Read the register number. */
pnum = strtol (p, &p_temp, 16);
p1 = (unsigned char *) p_temp;
}
- else
+ else
p1 = p;
if (p1 == p) /* No register number present here */
@@ -3128,7 +3146,7 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
p = p_temp;
}
}
-
+
else
{
struct packet_reg *reg = packet_reg_from_pnum (rs, pnum);
@@ -3529,7 +3547,7 @@ check_binary_download (CORE_ADDR addr)
{
char *buf = alloca (rs->remote_packet_size);
char *p;
-
+
p = buf;
*p++ = 'X';
p += hexnumstr (p, (ULONGEST) addr);
@@ -3537,7 +3555,7 @@ check_binary_download (CORE_ADDR addr)
p += hexnumstr (p, (ULONGEST) 0);
*p++ = ':';
*p = '\0';
-
+
putpkt_binary (buf, (int) (p - buf));
getpkt (buf, (rs->remote_packet_size), 0);
@@ -3619,14 +3637,14 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
default:
internal_error (__FILE__, __LINE__, "bad switch");
}
-
+
/* Append "<memaddr>". */
memaddr = remote_address_masked (memaddr);
p += hexnumstr (p, (ULONGEST) memaddr);
/* Append ",". */
*p++ = ',';
-
+
/* Append <len>. Retain the location/size of <len>. It may need to
be adjusted once the packet body has been created. */
plen = p;
@@ -3636,7 +3654,7 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
/* Append ":". */
*p++ = ':';
*p = '\0';
-
+
/* Append the packet body. */
payload_start = p;
switch (remote_protocol_binary_download.support)
@@ -3665,7 +3683,7 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
}
if (nr_bytes < todo)
{
- /* Escape chars have filled up the buffer prematurely,
+ /* Escape chars have filled up the buffer prematurely,
and we have actually sent fewer bytes than planned.
Fix-up the length field of the packet. Use the same
number of characters as before. */
@@ -3686,10 +3704,10 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
default:
internal_error (__FILE__, __LINE__, "bad switch");
}
-
+
putpkt_binary (buf, (int) (p - buf));
getpkt (buf, sizeof_buf, 0);
-
+
if (buf[0] == 'E')
{
/* There is no correspondance between what the remote protocol
@@ -3699,7 +3717,7 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
errno = EIO;
return 0;
}
-
+
/* Return NR_BYTES, not TODO, in case escape chars caused us to send fewer
bytes than we'd planned. */
return nr_bytes;
@@ -4051,7 +4069,7 @@ read_frame (char *buf,
check_0 = readchar (remote_timeout);
if (check_0 >= 0)
check_1 = readchar (remote_timeout);
-
+
if (check_0 == SERIAL_TIMEOUT || check_1 == SERIAL_TIMEOUT)
{
if (remote_debug)
@@ -4092,7 +4110,7 @@ read_frame (char *buf,
/* The character before ``*'' is repeated. */
- if (repeat > 0 && repeat <= 255
+ if (repeat > 0 && repeat <= 255
&& bc > 0
&& bc + repeat - 1 < sizeof_buf - 1)
{
@@ -4293,7 +4311,7 @@ extended_remote_mourn (void)
{
/* We do _not_ want to mourn the target like this; this will
remove the extended remote target from the target stack,
- and the next time the user says "run" it'll fail.
+ and the next time the user says "run" it'll fail.
FIXME: What is the right thing to do here? */
#if 0
@@ -4311,7 +4329,7 @@ remote_mourn_1 (struct target_ops *target)
/* In the extended protocol we want to be able to do things like
"run" and have them basically work as expected. So we need
- a special create_inferior function.
+ a special create_inferior function.
FIXME: One day add support for changing the exec file
we're debugging, arguments and an environment. */
@@ -4408,19 +4426,19 @@ remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
struct remote_state *rs = get_remote_state ();
#ifdef DEPRECATED_REMOTE_BREAKPOINT
int val;
-#endif
+#endif
int bp_size;
/* Try the "Z" s/w breakpoint packet if it is not already disabled.
If it succeeds, then set the support to PACKET_ENABLE. If it
fails, and the user has explicitly requested the Z support then
report an error, otherwise, mark it disabled and go on. */
-
+
if (remote_protocol_Z[Z_PACKET_SOFTWARE_BP].support != PACKET_DISABLE)
{
char *buf = alloca (rs->remote_packet_size);
char *p = buf;
-
+
addr = remote_address_masked (addr);
*(p++) = 'Z';
*(p++) = '0';
@@ -4428,7 +4446,7 @@ remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
p += hexnumstr (p, (ULONGEST) addr);
BREAKPOINT_FROM_PC (&addr, &bp_size);
sprintf (p, ",%d", bp_size);
-
+
putpkt (buf);
getpkt (buf, (rs->remote_packet_size), 0);
@@ -4443,7 +4461,7 @@ remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
}
}
-#ifdef DEPRECATED_REMOTE_BREAKPOINT
+#ifdef DEPRECATED_REMOTE_BREAKPOINT
val = target_read_memory (addr, contents_cache, sizeof big_break_insn);
if (val == 0)
@@ -4472,7 +4490,7 @@ remote_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
char *buf = alloca (rs->remote_packet_size);
char *p = buf;
-
+
*(p++) = 'z';
*(p++) = '0';
*(p++) = ',';
@@ -4481,7 +4499,7 @@ remote_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
p += hexnumstr (p, (ULONGEST) addr);
BREAKPOINT_FROM_PC (&addr, &bp_size);
sprintf (p, ",%d", bp_size);
-
+
putpkt (buf);
getpkt (buf, (rs->remote_packet_size), 0);
@@ -4527,13 +4545,13 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type)
error ("Can't set hardware watchpoints without the '%s' (%s) packet\n",
remote_protocol_Z[packet].name,
remote_protocol_Z[packet].title);
-
+
sprintf (buf, "Z%x,", packet);
p = strchr (buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
sprintf (p, ",%x", len);
-
+
putpkt (buf);
getpkt (buf, (rs->remote_packet_size), 0);
@@ -4562,7 +4580,7 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type)
error ("Can't clear hardware watchpoints without the '%s' (%s) packet\n",
remote_protocol_Z[packet].name,
remote_protocol_Z[packet].title);
-
+
sprintf (buf, "z%x,", packet);
p = strchr (buf, '\0');
addr = remote_address_masked (addr);
@@ -4635,21 +4653,21 @@ remote_insert_hw_breakpoint (CORE_ADDR addr, char *shadow)
struct remote_state *rs = get_remote_state ();
char *buf = alloca (rs->remote_packet_size);
char *p = buf;
-
+
/* The length field should be set to the size of a breakpoint
instruction. */
- BREAKPOINT_FROM_PC (&addr, &len);
+ BREAKPOINT_FROM_PC (&addr, &len);
if (remote_protocol_Z[Z_PACKET_HARDWARE_BP].support == PACKET_DISABLE)
error ("Can't set hardware breakpoint without the '%s' (%s) packet\n",
remote_protocol_Z[Z_PACKET_HARDWARE_BP].name,
remote_protocol_Z[Z_PACKET_HARDWARE_BP].title);
-
+
*(p++) = 'Z';
*(p++) = '1';
*(p++) = ',';
-
+
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
sprintf (p, ",%x", len);
@@ -4670,7 +4688,7 @@ remote_insert_hw_breakpoint (CORE_ADDR addr, char *shadow)
}
-static int
+static int
remote_remove_hw_breakpoint (CORE_ADDR addr, char *shadow)
{
int len;
@@ -4687,18 +4705,18 @@ remote_remove_hw_breakpoint (CORE_ADDR addr, char *shadow)
error ("Can't clear hardware breakpoint without the '%s' (%s) packet\n",
remote_protocol_Z[Z_PACKET_HARDWARE_BP].name,
remote_protocol_Z[Z_PACKET_HARDWARE_BP].title);
-
+
*(p++) = 'z';
*(p++) = '1';
*(p++) = ',';
-
+
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
sprintf (p, ",%x", len);
putpkt(buf);
getpkt (buf, (rs->remote_packet_size), 0);
-
+
switch (packet_ok (buf, &remote_protocol_Z[Z_PACKET_HARDWARE_BP]))
{
case PACKET_ERROR:
@@ -4872,6 +4890,41 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
case TARGET_OBJECT_AVR:
query_type = 'R';
break;
+
+ case TARGET_OBJECT_AUXV:
+ if (remote_protocol_qPart_auxv.support != PACKET_DISABLE)
+ {
+ unsigned int total = 0;
+ while (len > 0)
+ {
+ LONGEST n = min ((rs->remote_packet_size - 2) / 2, len);
+ snprintf (buf2, rs->remote_packet_size,
+ "qPart:auxv:read::%s,%s",
+ phex_nz (offset, sizeof offset),
+ phex_nz (n, sizeof n));
+ i = putpkt (buf2);
+ if (i < 0)
+ return total > 0 ? total : i;
+ buf2[0] = '\0';
+ getpkt (buf2, rs->remote_packet_size, 0);
+ if (packet_ok (buf2, &remote_protocol_qPart_auxv) != PACKET_OK)
+ return total > 0 ? total : -1;
+ if (buf2[0] == 'O' && buf2[1] == 'K' && buf2[2] == '\0')
+ break; /* Got EOF indicator. */
+ /* Got some data. */
+ i = hex2bin (buf2, readbuf, len);
+ if (i > 0)
+ {
+ readbuf = (void *) ((char *) readbuf + i);
+ offset += i;
+ len -= i;
+ total += i;
+ }
+ }
+ return total;
+ }
+ return -1;
+
default:
return -1;
}
@@ -5369,6 +5422,7 @@ show_remote_cmd (char *args, int from_tty)
show_remote_protocol_qSymbol_packet_cmd (args, from_tty, NULL);
show_remote_protocol_vcont_packet_cmd (args, from_tty, NULL);
show_remote_protocol_binary_download_cmd (args, from_tty, NULL);
+ show_remote_protocol_qPart_auxv_packet_cmd (args, from_tty, NULL);
}
static void
@@ -5612,6 +5666,13 @@ in a memory packet.\n",
&remote_set_cmdlist, &remote_show_cmdlist,
0);
+ add_packet_config_cmd (&remote_protocol_qPart_auxv,
+ "qPart_auxv", "read-aux-vector",
+ set_remote_protocol_qPart_auxv_packet_cmd,
+ show_remote_protocol_qPart_auxv_packet_cmd,
+ &remote_set_cmdlist, &remote_show_cmdlist,
+ 0);
+
/* Keep the old ``set remote Z-packet ...'' working. */
add_setshow_auto_boolean_cmd ("Z-packet", class_obscure,
&remote_Z_packet_detect, "\
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 2499c3c4455..7e3463e1fb2 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -38,6 +38,7 @@
#include "trad-frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
+#include "dwarf2-frame.h"
#include "reggroups.h"
#include "regset.h"
#include "value.h"
@@ -2298,6 +2299,53 @@ s390_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
}
+/* DWARF-2 frame support. */
+
+static void
+s390_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
+ struct dwarf2_frame_state_reg *reg)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ switch (tdep->abi)
+ {
+ case ABI_LINUX_S390:
+ /* Call-saved registers. */
+ if ((regnum >= S390_R6_REGNUM && regnum <= S390_R15_REGNUM)
+ || regnum == S390_F4_REGNUM
+ || regnum == S390_F6_REGNUM)
+ reg->how = DWARF2_FRAME_REG_SAME_VALUE;
+
+ /* Call-clobbered registers. */
+ else if ((regnum >= S390_R0_REGNUM && regnum <= S390_R5_REGNUM)
+ || (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM
+ && regnum != S390_F4_REGNUM && regnum != S390_F6_REGNUM))
+ reg->how = DWARF2_FRAME_REG_UNDEFINED;
+
+ /* The return address column. */
+ else if (regnum == S390_PC_REGNUM)
+ reg->how = DWARF2_FRAME_REG_RA;
+ break;
+
+ case ABI_LINUX_ZSERIES:
+ /* Call-saved registers. */
+ if ((regnum >= S390_R6_REGNUM && regnum <= S390_R15_REGNUM)
+ || (regnum >= S390_F8_REGNUM && regnum <= S390_F15_REGNUM))
+ reg->how = DWARF2_FRAME_REG_SAME_VALUE;
+
+ /* Call-clobbered registers. */
+ else if ((regnum >= S390_R0_REGNUM && regnum <= S390_R5_REGNUM)
+ || (regnum >= S390_F0_REGNUM && regnum <= S390_F7_REGNUM))
+ reg->how = DWARF2_FRAME_REG_UNDEFINED;
+
+ /* The return address column. */
+ else if (regnum == S390_PC_REGNUM)
+ reg->how = DWARF2_FRAME_REG_RA;
+ break;
+ }
+}
+
+
/* Dummy function calls. */
/* Return non-zero if TYPE is an integer-like type, zero otherwise.
@@ -2977,6 +3025,9 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Frame handling. */
set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
+ dwarf2_frame_set_init_reg (gdbarch, s390_dwarf2_frame_init_reg);
+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
+ frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
frame_unwind_append_sniffer (gdbarch, s390_pltstub_frame_sniffer);
frame_unwind_append_sniffer (gdbarch, s390_sigtramp_frame_sniffer);
frame_unwind_append_sniffer (gdbarch, s390_frame_sniffer);
diff --git a/gdb/solib.c b/gdb/solib.c
index 80f834f1e0d..a98c3bdfed7 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -42,7 +42,7 @@
#include "filenames.h" /* for DOSish file names */
#include "exec.h"
#include "solist.h"
-#include <readline/readline.h>
+#include "readline/readline.h"
/* external data declarations */
diff --git a/gdb/source.c b/gdb/source.c
index ba2dc06f72a..92cdce426e6 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -44,7 +44,7 @@
#include "filenames.h" /* for DOSish file names */
#include "completer.h"
#include "ui-out.h"
-#include <readline/readline.h>
+#include "readline/readline.h"
#ifdef CRLF_SOURCE_FILES
diff --git a/gdb/symfile.c b/gdb/symfile.c
index f1a5ecf30e2..19ae2943301 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -45,7 +45,7 @@
#include "completer.h"
#include "bcache.h"
#include "hashtab.h"
-#include <readline/readline.h>
+#include "readline/readline.h"
#include "gdb_assert.h"
#include "block.h"
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index f6d31f9cc45..c17bda4783d 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -37,7 +37,7 @@
#include "dictionary.h"
#include "gdb_string.h"
-#include <readline/readline.h>
+#include "readline/readline.h"
#ifndef DEV_TTY
#define DEV_TTY "/dev/tty"
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 3e59787c00f..9e221746373 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,7 +1,91 @@
+2004-02-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.cp/ctti.exp: Handle unsigned char type. Expect templates
+ to use unsigned char.
+ * gdb.cp/cttiadd.c, gdb.cp/cttiadd1.c, gdb.cp/cttiadd2.c,
+ gdb.cp/cttiadd3.c: Change type of variable to unsigned char.
+
+2004-02-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/gdbserver.exp (gdbserver_gdb_load): Wait for a complete
+ line of output.
+
+2004-02-28 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/relocate.c (dummy): Initialize.
+
+2004-02-28 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/chng-syms.exp: Anchor exit pattern. Allow
+ a breakpoint at exit.
+
+2004-02-27 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/chng-syms.exp: Add expect condition to match failing
+ case that isn't a timeout.
+
+2004-02-27 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.base/bigcore.exp: Disable on HP/UX, no sparse corefile
+ support.
+
+2004-02-26 Fred Fish <fnf@redhat.com>
+
+ * gdb.arch/gdb1431.c: Remove.
+ * gdb.arch/gdb1431.s: New file, copy of gdb1291.s
+ * gdb.arch/gdb1431.exp: Use "advance" correctly instead
+ of "until" incorrectly.
+
+2004-02-26 J. Brobecker <brobecker@gnat.com>
+
+ * gdb.cp/class2.cc (empty): New class.
+ (refer): New function.
+ (main): Declare an object of type empty and use it.
+ * gdb.cp/class2.exp: Print the value of an object of type empty.
+
+2004-02-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gdb.base/langs.exp: Update query string to match the
+ new nquery format used for pending breakpoints.
+
+2004-02-26 Andrew Cagney <cagney@redhat.com>
+
+ Fix PR i18n/1570.
+ * gdb.base/charset.c: Update copyright notice.
+ (main, init_string): Remove the escape character '\e' tests.
+ * gdb.base/printcmds.exp (test_print_all_chars): Ditto.
+ * gdb.base/charset.exp (valid_host_charset): Ditto.
+ * gdb.base/setvar.exp: Ditto.
+
+2004-02-24 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.base/corefile.exp: Use gdb_test_multiple, make "accessing
+ mmapped data in core file" PASS and FAIL messages consistent.
+
+ * gdb.java/jmisc.exp: Use the fully quallified name of "main" when
+ setting a breakpoint. Work around PR java/1565.
+
+2004-02-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * lib/gdb.exp (gdb_breakpoint): Update query string to match
+ new nquery format.
+ * gdb.base/pending.exp: Ditto.
+
+2004-02-22 Mark Kettenis <kettenis@gnu.org>
+
+ * configure.in: Run stabs tests on *BSD.
+ * configure: Regenerated.
+
2004-02-21 Mark Kettenis <kettenis@gnu.org>
* gdb.base/bigcore.exp: Bail out on *BSD instead of only NetBSD.
+2004-02-20 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/callfuncs.exp (do_function_calls): Remove extraneous
+ blank in test for "returns short", for consistency with other
+ "returns xxx" tests. Update copyright year.
+
2004-02-19 Fred Fish <fnf@redhat.com>
New testcase for PR breakpoint/1558.
diff --git a/gdb/testsuite/config/gdbserver.exp b/gdb/testsuite/config/gdbserver.exp
index bb5b246a050..ed812f81aa4 100644
--- a/gdb/testsuite/config/gdbserver.exp
+++ b/gdb/testsuite/config/gdbserver.exp
@@ -144,11 +144,13 @@ proc gdbserver_gdb_load { server_exec } {
"$gdbserver $sockethost$portnum $server_exec"]
}
- # Wait for the server to produce at least one character of output.
+ # Wait for the server to produce at least one line and an additional
+ # character of output. This will wait until any TCP socket has been
+ # created, so that GDB can connect.
expect {
-i $server_spawn_id
-notransfer
- -re . { }
+ -re ".*\n." { }
}
# We can't just call close, because if gdbserver is local then that means
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index f5cb0895a2b..1419ba1f59c 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -641,7 +641,7 @@ else
case $target in
powerpc-*-aix* \
| rs6000-*-aix* \
- | *-*-bsd* \
+ | *-*-*bsd* \
| *-*-go32* \
| *-*-linux* \
| *-*-lynxos* \
@@ -917,7 +917,7 @@ else
if { (eval echo configure:918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in
index c60cf576a4d..49b0444ad88 100644
--- a/gdb/testsuite/configure.in
+++ b/gdb/testsuite/configure.in
@@ -42,7 +42,7 @@ AC_ARG_WITH(stabs,
case $target in
powerpc-*-aix* \
| rs6000-*-aix* \
- | *-*-bsd* \
+ | *-*-*bsd* \
| *-*-go32* \
| *-*-linux* \
| *-*-lynxos* \
diff --git a/gdb/testsuite/gdb.arch/gdb1431.c b/gdb/testsuite/gdb.arch/gdb1431.c
deleted file mode 100755
index 64f5c60b391..00000000000
--- a/gdb/testsuite/gdb.arch/gdb1431.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright 2003, 2004 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- Please email any bugs, comments, and/or additions to this file to:
- bug-gdb@gnu.org
-
- This file is part of the gdb testsuite. */
-
-void sub1 (void);
-void sub2 (void);
-
-main()
-{
- sub1();
- sub2();
-}
-
-asm(".text\n"
- " .align 5\n"
- "sub1:\n"
- "_sub1:\n"
- " mov.l r14,@-r15\n"
- " add #-128,r15\n"
- " add #-128,r15\n"
- " mov r15,r14\n"
- " mov.w .STACK1,r7\n"
- " add r7,r14\n"
- " mov r14,r15\n"
- " mov.l @r15+,r14\n"
- " rts\n"
- " nop\n"
- " .align 1\n"
- ".STACK1:\n"
- " .short 256\n");
-
-asm(".text\n"
- " .align 5\n"
- "sub2:\n"
- "_sub2:\n"
- " mov.l r14,@-r15\n"
- " mov.w .STACK2,r3\n"
- " sub r3,r15\n"
- " mov r15,r14\n"
- " mov.w .STACK2,r7\n"
- " add r7,r14\n"
- " mov r14,r15\n"
- " mov.l @r15+,r14\n"
- " rts\n"
- " nop\n"
- " .align 1\n"
- ".STACK2:\n"
- " .short 260\n");
diff --git a/gdb/testsuite/gdb.arch/gdb1431.exp b/gdb/testsuite/gdb.arch/gdb1431.exp
index 15bff46c774..697c9f89b2d 100644
--- a/gdb/testsuite/gdb.arch/gdb1431.exp
+++ b/gdb/testsuite/gdb.arch/gdb1431.exp
@@ -1,4 +1,4 @@
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004 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
@@ -20,6 +20,9 @@
# This file is part of the gdb testsuite.
# Tests for PR:1431. Catch gdb not continuing to second function properly.
+# Note that originally this bug was reported as a problem with the "until"
+# command, which actually is behaving as currently defined. What apparently
+# was expected was the behavior of the newer "advance" command.
if $tracelevel {
strace $tracelevel
@@ -36,9 +39,9 @@ if ![istarget "sh-*-*"] then {
}
set testfile "gdb1431"
-set srcfile ${testfile}.c
+set srcfile ${testfile}.s
set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
@@ -55,12 +58,6 @@ if ![runto_main] then {
gdb_suppress_tests
}
-gdb_test "u sub1" "sub1*" "get to sub1"
-gdb_test "bt" "#0\[ \t\]*$hex \\(\\) at sh-bt.*\r\n#1\[ \t\]*$hex in main.*" \
- "backtrace in gdb1291"
-
-kfail "gdb/1431" "u sub2"
-# This is what we would expect to be able to do:
-#gdb_test "u sub2" "sub2*" "get to sub2"
-#gdb_test "bt" "#0\[ \t\]*$hex \\(\\) at sh-bt.*\r\n#1\[ \t\]*$hex in main.*" \
-# "backtrace in gdb1291"
+gdb_test "advance sub1" "hello world\r\n$hex in sub1 \\(\\)" "get to sub1"
+gdb_test "advance sub2" "$hex in main \\(\\)" "advance returns from sub1 frame"
+gdb_test "advance sub2" "$hex in sub2 \\(\\)" "get to sub2"
diff --git a/gdb/testsuite/gdb.arch/gdb1431.s b/gdb/testsuite/gdb.arch/gdb1431.s
new file mode 100644
index 00000000000..36b43d260f2
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/gdb1431.s
@@ -0,0 +1,129 @@
+! Copyright 2004 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+!
+! Please email any bugs, comments, and/or additions to this file to:
+! bug-gdb@gnu.org
+!
+! This file is part of the gdb testsuite.
+!
+! It was generated using "sh-elf-gcc -S gdb1431.c", using the following
+! source file:
+!
+! #include <stdio.h>
+!
+! main()
+! {
+! printf("hello world\n");
+! sub1();
+! sub2();
+! }
+! sub1()
+! {
+! int buf[64];
+!
+! }
+!
+! sub2()
+! {
+! int buf[65];
+!
+! }
+!
+! We use a pregenerated assembly file as the test input to avoid possible
+! problems with future versions of gcc generating different code.
+
+ .file "gdb1431.c"
+ .text
+ .section .rodata
+ .align 2
+.LC0:
+ .string "hello world\n"
+ .text
+ .align 1
+ .global _main
+ .type _main, @function
+_main:
+ mov.l r14,@-r15
+ sts.l pr,@-r15
+ mov r15,r14
+ mov.l .L2,r1
+ mov r1,r4
+ mov.l .L3,r1
+ jsr @r1
+ nop
+ mov.l .L4,r1
+ jsr @r1
+ nop
+ mov.l .L5,r1
+ jsr @r1
+ nop
+ mov r14,r15
+ lds.l @r15+,pr
+ mov.l @r15+,r14
+ rts
+ nop
+.L6:
+ .align 2
+.L2:
+ .long .LC0
+.L3:
+ .long _printf
+.L4:
+ .long _sub1
+.L5:
+ .long _sub2
+ .size _main, .-_main
+ .align 1
+ .global _sub1
+ .type _sub1, @function
+_sub1:
+ mov.l r14,@-r15
+ sts.l pr,@-r15
+ add #-128,r15
+ add #-128,r15
+ mov r15,r14
+ mov.w .L8,r7
+ add r7,r14
+ mov r14,r15
+ lds.l @r15+,pr
+ mov.l @r15+,r14
+ rts
+ nop
+ .align 1
+.L8:
+ .short 256
+ .size _sub1, .-_sub1
+ .align 1
+ .global _sub2
+ .type _sub2, @function
+_sub2:
+ mov.l r14,@-r15
+ sts.l pr,@-r15
+ mov.w .L11,r1
+ sub r1,r15
+ mov r15,r14
+ mov.w .L11,r7
+ add r7,r14
+ mov r14,r15
+ lds.l @r15+,pr
+ mov.l @r15+,r14
+ rts
+ nop
+ .align 1
+.L11:
+ .short 260
+ .size _sub2, .-_sub2
+ .ident "GCC: (GNU) 3.5.0 20040204 (experimental)"
diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp
index aa831a87e2b..58cbfa1cc66 100644
--- a/gdb/testsuite/gdb.base/bigcore.exp
+++ b/gdb/testsuite/gdb.base/bigcore.exp
@@ -41,7 +41,7 @@ if ![isnative] then {
# consumes too many resources - gigabytes worth of disk space and and
# I/O bandwith.
-if { [istarget "*-*-*bsd*"] } {
+if { [istarget "*-*-*bsd*"] || [istarget "*-*-hpux*"] } {
untested "Kernel lacks sparse corefile support (PR gdb/1551)"
return
}
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index 62f6cb82970..feccd6f7ea5 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -1,5 +1,5 @@
-# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004 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
diff --git a/gdb/testsuite/gdb.base/charset.c b/gdb/testsuite/gdb.base/charset.c
index a7b71238c5f..4361ffc7bc2 100644
--- a/gdb/testsuite/gdb.base/charset.c
+++ b/gdb/testsuite/gdb.base/charset.c
@@ -1,5 +1,25 @@
-/* Test GDB's character set support
- Jim Blandy <jimb@cygnus.com> --- December 2001 */
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2001, 2004 Free Software Foundation, Inc.
+
+ Contributed by Red Hat, originally written by Jim Blandy.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@gnu.org */
#include <stdio.h>
#include <string.h>
@@ -14,21 +34,20 @@
[0] --- the `alert' character, '\a'
[1] --- the `backspace' character, '\b'
- [2] --- the `escape' character, '\e'
- [3] --- the `form feed' character, '\f'
- [4] --- the `line feed' character, '\n'
- [5] --- the `carriage return' character, '\r'
- [6] --- the `horizontal tab' character, '\t'
- [7] --- the `vertical tab' character, '\v'
- [8 .. 33] --- the uppercase letters A-Z
- [34 .. 59] --- the lowercase letters a-z
- [60 .. 69] --- the digits 0-9
- [70] --- the `cent' character
- [71] --- a control character with no defined backslash escape
+ [2] --- the `form feed' character, '\f'
+ [3] --- the `line feed' character, '\n'
+ [4] --- the `carriage return' character, '\r'
+ [5] --- the `horizontal tab' character, '\t'
+ [6] --- the `vertical tab' character, '\v'
+ [7 .. 32] --- the uppercase letters A-Z
+ [33 .. 58] --- the lowercase letters a-z
+ [59 .. 68] --- the digits 0-9
+ [69] --- the `cent' character
+ [70] --- a control character with no defined backslash escape
Feel free to extend these as you like. */
-#define NUM_CHARS (72)
+#define NUM_CHARS (71)
char ascii_string[NUM_CHARS];
char iso_8859_1_string[NUM_CHARS];
@@ -39,21 +58,20 @@ char ibm1047_string[NUM_CHARS];
void
init_string (char string[],
char x,
- char alert, char backspace, char escape, char form_feed,
+ char alert, char backspace, char form_feed,
char line_feed, char carriage_return, char horizontal_tab,
char vertical_tab, char cent, char misc_ctrl)
{
memset (string, x, NUM_CHARS);
string[0] = alert;
string[1] = backspace;
- string[2] = escape;
- string[3] = form_feed;
- string[4] = line_feed;
- string[5] = carriage_return;
- string[6] = horizontal_tab;
- string[7] = vertical_tab;
- string[70] = cent;
- string[71] = misc_ctrl;
+ string[2] = form_feed;
+ string[3] = line_feed;
+ string[4] = carriage_return;
+ string[5] = horizontal_tab;
+ string[6] = vertical_tab;
+ string[69] = cent;
+ string[70] = misc_ctrl;
}
@@ -77,56 +95,56 @@ int main ()
/* Initialize ascii_string. */
init_string (ascii_string,
120,
- 7, 8, 27, 12,
+ 7, 8, 12,
10, 13, 9,
11, 120, 17);
- fill_run (ascii_string, 8, 26, 65);
- fill_run (ascii_string, 34, 26, 97);
- fill_run (ascii_string, 60, 10, 48);
+ fill_run (ascii_string, 7, 26, 65);
+ fill_run (ascii_string, 33, 26, 97);
+ fill_run (ascii_string, 59, 10, 48);
/* Initialize iso_8859_1_string. */
init_string (iso_8859_1_string,
120,
- 7, 8, 27, 12,
+ 7, 8, 12,
10, 13, 9,
11, 162, 17);
- fill_run (iso_8859_1_string, 8, 26, 65);
- fill_run (iso_8859_1_string, 34, 26, 97);
- fill_run (iso_8859_1_string, 60, 10, 48);
+ fill_run (iso_8859_1_string, 7, 26, 65);
+ fill_run (iso_8859_1_string, 33, 26, 97);
+ fill_run (iso_8859_1_string, 59, 10, 48);
/* Initialize ebcdic_us_string. */
init_string (ebcdic_us_string,
167,
- 47, 22, 39, 12,
+ 47, 22, 12,
37, 13, 5,
11, 74, 17);
/* In EBCDIC, the upper-case letters are broken into three separate runs. */
- fill_run (ebcdic_us_string, 8, 9, 193);
- fill_run (ebcdic_us_string, 17, 9, 209);
- fill_run (ebcdic_us_string, 26, 8, 226);
+ fill_run (ebcdic_us_string, 7, 9, 193);
+ fill_run (ebcdic_us_string, 16, 9, 209);
+ fill_run (ebcdic_us_string, 25, 8, 226);
/* The lower-case letters are, too. */
- fill_run (ebcdic_us_string, 34, 9, 129);
- fill_run (ebcdic_us_string, 43, 9, 145);
- fill_run (ebcdic_us_string, 52, 8, 162);
+ fill_run (ebcdic_us_string, 33, 9, 129);
+ fill_run (ebcdic_us_string, 42, 9, 145);
+ fill_run (ebcdic_us_string, 51, 8, 162);
/* The digits, at least, are contiguous. */
- fill_run (ebcdic_us_string, 60, 10, 240);
+ fill_run (ebcdic_us_string, 59, 10, 240);
/* Initialize ibm1047_string. */
init_string (ibm1047_string,
167,
- 47, 22, 39, 12,
+ 47, 22, 12,
37, 13, 5,
11, 74, 17);
/* In EBCDIC, the upper-case letters are broken into three separate runs. */
- fill_run (ibm1047_string, 8, 9, 193);
- fill_run (ibm1047_string, 17, 9, 209);
- fill_run (ibm1047_string, 26, 8, 226);
+ fill_run (ibm1047_string, 7, 9, 193);
+ fill_run (ibm1047_string, 16, 9, 209);
+ fill_run (ibm1047_string, 25, 8, 226);
/* The lower-case letters are, too. */
- fill_run (ibm1047_string, 34, 9, 129);
- fill_run (ibm1047_string, 43, 9, 145);
- fill_run (ibm1047_string, 52, 8, 162);
+ fill_run (ibm1047_string, 33, 9, 129);
+ fill_run (ibm1047_string, 42, 9, 145);
+ fill_run (ibm1047_string, 51, 8, 162);
/* The digits, at least, are contiguous. */
- fill_run (ibm1047_string, 60, 10, 240);
+ fill_run (ibm1047_string, 59, 10, 240);
puts ("All set!"); /* all strings initialized */
}
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index e17bb14bbce..780e909dbca 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -1,4 +1,6 @@
-# Copyright 2001 Free Software Foundation, Inc.
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2001, 2004 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
@@ -15,7 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# bug-gdb@gnu.org
# Test GDB's character set support.
@@ -439,7 +441,7 @@ foreach target_charset [all_charset_names] {
# Compute a regexp matching the results we expect. This is static,
# but it's easier than writing it out.
- regsub -all "." "abefnrtv" "(\\\\&|x)" escapes
+ regsub -all "." "abfnrtv" "(\\\\&|x)" escapes
set uppercase "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
set lowercase "abcdefghijklmnopqrstuvwxyz"
set digits "0123456789"
@@ -448,7 +450,7 @@ foreach target_charset [all_charset_names] {
send_gdb "print $var_name\n"
# ${escapes}${uppercase}${lowercase}${digits}${octal}${octal}
gdb_expect {
- -re ".* = \"(\\\\a|x)(\\\\b|x)(\\\\e|x)(\\\\f|x)(\\\\n|x)(\\\\r|x)(\\\\t|x)(\\\\v|x)${uppercase}${lowercase}${digits}(\\\\\[0-9\]\[0-9\]\[0-9\]|x)(\\\\\[0-9\]\[0-9\]\[0-9\]|x).*\"\[\r\n\]+$gdb_prompt $" {
+ -re ".* = \"(\\\\a|x)(\\\\b|x)(\\\\f|x)(\\\\n|x)(\\\\r|x)(\\\\t|x)(\\\\v|x)${uppercase}${lowercase}${digits}(\\\\\[0-9\]\[0-9\]\[0-9\]|x)(\\\\\[0-9\]\[0-9\]\[0-9\]|x).*\"\[\r\n\]+$gdb_prompt $" {
pass "print string in $target_charset"
}
-re "$gdb_prompt $" {
@@ -465,7 +467,7 @@ foreach target_charset [all_charset_names] {
"parse character literal in ${target_charset}"
# Check that the character literal was encoded correctly.
- gdb_test "print 'A' == $var_name\[8\]" \
+ gdb_test "print 'A' == $var_name\[7\]" \
" = 1" \
"check value of parsed character literal in ${target_charset}"
@@ -475,14 +477,14 @@ foreach target_charset [all_charset_names] {
"parse string literal in ${target_charset}"
# Check that the string literal was encoded correctly.
- gdb_test "print \"q\"\[0\] == $var_name\[50\]" \
+ gdb_test "print \"q\"\[0\] == $var_name\[49\]" \
" = 1" \
"check value of parsed string literal in ${target_charset}"
# Test handling of characters in the target charset which
# can't be translated into the host charset.
if {! [string compare $target_charset iso-8859-1]} {
- gdb_test "print iso_8859_1_string\[70\]" \
+ gdb_test "print iso_8859_1_string\[69\]" \
" = \[0-9-\]+ '\\\\242'" \
"print character with no equivalent in host character set"
gdb_test "print iso_8859_1_string + 70" \
@@ -493,7 +495,7 @@ foreach target_charset [all_charset_names] {
# Make sure that we don't apply the ISO-8859-1 `print_literally'
# function to ASCII.
if {! [string compare $target_charset ascii]} {
- gdb_test "print iso_8859_1_string\[70\]" \
+ gdb_test "print iso_8859_1_string\[69\]" \
" = \[0-9-\]+ '\\\\242'" \
"print ASCII unprintable character"
gdb_test "print iso_8859_1_string + 70" \
@@ -502,7 +504,7 @@ foreach target_charset [all_charset_names] {
}
# Try printing characters with backslash escape equivalents.
- set escapees {a b e f n r t v}
+ set escapees {a b f n r t v}
for {set i 0} {$i < [llength $escapees]} {incr i} {
set escape [lindex $escapees $i]
send_gdb "print $var_name\[$i\]\n"
@@ -541,7 +543,7 @@ foreach target_charset [all_charset_names] {
# get the unescaped character, in the target character set.
gdb_test "print '\\q'" " = \[0-9-\]+ 'q'" \
"print escape that doesn't exist in $target_charset"
- gdb_test "print '\\q' == $var_name\[50\]" " = 1" \
+ gdb_test "print '\\q' == $var_name\[49\]" " = 1" \
"check value of escape that doesn't exist in $target_charset"
}
diff --git a/gdb/testsuite/gdb.base/chng-syms.exp b/gdb/testsuite/gdb.base/chng-syms.exp
index 18f847f937d..b967d21614b 100644
--- a/gdb/testsuite/gdb.base/chng-syms.exp
+++ b/gdb/testsuite/gdb.base/chng-syms.exp
@@ -105,9 +105,15 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
gdb_run_cmd
gdb_expect {
- -re "Error in re-setting .*No symbol .var1..*Program exited normally.*" {
+ -re "Error in re-setting .*No symbol .var1..*Program exited normally.*$gdb_prompt $" {
pass "running with invalidated bpt condition after executable changes"
}
+ -re "Error in re-setting .*No symbol .var1..*Breakpoint .*,( 0x.* in)? exit .*$gdb_prompt $" {
+ pass "running with invalidated bpt condition after executable changes"
+ }
+ -re "$gdb_prompt $" {
+ fail "running with invalidated bpt condition after executable changes"
+ }
timeout {
fail "(timeout) running with invalidated bpt condition after executable changes"
}
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index d41ea7e1194..eb58ed259d3 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -222,22 +222,16 @@ gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp"
gdb_test "x/8bd buf1" ".*:.*0.*1.*2.*3.*4.*5.*6.*7" "accessing original mmap data in core file"
setup_xfail "*-*-sunos*" "*-*-ultrix*" "*-*-aix*"
-send_gdb "x/8bd buf2\n"
-gdb_expect {
+set test "accessing mmapped data in core file"
+gdb_test_multiple "x/8bd buf2" "$test" {
-re ".*:.*0.*1.*2.*3.*4.*5.*6.*7.*$gdb_prompt $" {
- pass "accessing mmapped data in core file"
+ pass "$test"
}
-re "0x\[f\]*:.*Cannot access memory at address 0x\[f\]*.*$gdb_prompt $" {
- fail "accessing mmapped data (mapping failed at runtime)"
+ fail "$test (mapping failed at runtime)"
}
-re "0x.*:.*Cannot access memory at address 0x.*$gdb_prompt $" {
- fail "accessing mmapped data (mapping address not found in core file)"
- }
- -re ".*$gdb_prompt $" {
- fail "accessing mmapped data (incorrect data found in core file)"
- }
- timeout {
- fail "accessing mmapped data (timeout)"
+ fail "$test (mapping address not found in core file)"
}
}
diff --git a/gdb/testsuite/gdb.base/langs.exp b/gdb/testsuite/gdb.base/langs.exp
index a81df664f7d..49b9c5d5adf 100644
--- a/gdb/testsuite/gdb.base/langs.exp
+++ b/gdb/testsuite/gdb.base/langs.exp
@@ -66,7 +66,7 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test_multiple "b langs0" "break on nonexistent function in langs.exp" {
- -re "Function \"langs0\" not defined\..*Make breakpoint pending on future shared library load.*y or n. $" {
+ -re "Function \"langs0\" not defined\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
gdb_test "n" "" "break on nonexistent function in langs.exp"
}
diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp
index 2cef30af5bf..315e544ee74 100644
--- a/gdb/testsuite/gdb.base/pending.exp
+++ b/gdb/testsuite/gdb.base/pending.exp
@@ -111,7 +111,7 @@ if [target_info exists gdb_stub] {
#
gdb_test_multiple "break pendfunc1" "set pending breakpoint" {
- -re ".*Make breakpoint pending.*y or n. $" {
+ -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
gdb_test "y" "Breakpoint.*pendfunc1.*pending." "set pending breakpoint"
}
}
@@ -142,7 +142,7 @@ gdb_test "info break" \
# Test not setting a pending breakpoint
#
gdb_test_multiple "break pendfunc2" "Don't set pending breakpoint" {
- -re ".*Make breakpoint pending.*y or n. $" {
+ -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
gdb_test "n" "" "Don't set pending breakpoint"
}
}
@@ -192,7 +192,7 @@ gdb_test "info break" \
#
gdb_test_multiple "break pendshr.c:26 if x > 3" "Set pending breakpoint 2" {
- -re ".*Make breakpoint pending.*y or n. $" {
+ -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
gdb_test "y" "Breakpoint.*pendshr.c:26.*pending." \
"Set pending breakpoint 2"
}
@@ -247,7 +247,7 @@ gdb_breakpoint "main"
# Set non-existent pending breakpoint
#
gdb_test_multiple "break imaginary" "set imaginary pending breakpoint" {
- -re ".*Make breakpoint pending.*y or n. $" {
+ -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
gdb_test "y" "Breakpoint.*imaginary.*pending." \
"set imaginary pending breakpoint"
}
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 8f3ba89eb99..e532d71de09 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -1,5 +1,7 @@
-# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003 Free
-# Software Foundation, Inc.
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004
+# 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
@@ -16,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# bug-gdb@gnu.org
# This file was written by Fred Fish. (fnf@cygnus.com)
@@ -161,7 +163,7 @@ proc test_print_all_chars {} {
gdb_test "p ctable1\[24\]" " = 24 '\\\\030'"
gdb_test "p ctable1\[25\]" " = 25 '\\\\031'"
gdb_test "p ctable1\[26\]" " = 26 '\\\\032'"
- gdb_test "p ctable1\[27\]" " = 27 '\\\\e'"
+ gdb_test "p ctable1\[27\]" " = 27 '\\\\033'"
gdb_test "p ctable1\[28\]" " = 28 '\\\\034'"
gdb_test "p ctable1\[29\]" " = 29 '\\\\035'"
gdb_test "p ctable1\[30\]" " = 30 '\\\\036'"
@@ -479,7 +481,7 @@ proc test_print_strings {} {
gdb_test "p &ctable1\[2*8\]" \
" = \\(unsigned char \\*\\) \"\\\\020\\\\021\\\\022\\\\023\\\\024\\\\025\\\\026\\\\027\"..."
gdb_test "p &ctable1\[3*8\]" \
- " = \\(unsigned char \\*\\) \"\\\\030\\\\031\\\\032\\\\e\\\\034\\\\035\\\\036\\\\037\"..."
+ " = \\(unsigned char \\*\\) \"\\\\030\\\\031\\\\032\\\\033\\\\034\\\\035\\\\036\\\\037\"..."
gdb_test "p &ctable1\[4*8\]" \
" = \\(unsigned char \\*\\) \" !\\\\\"#\\\$%&'\"..."
gdb_test "p &ctable1\[5*8\]" \
diff --git a/gdb/testsuite/gdb.base/relocate.c b/gdb/testsuite/gdb.base/relocate.c
index df8545dc62e..90e70ffe8b6 100644
--- a/gdb/testsuite/gdb.base/relocate.c
+++ b/gdb/testsuite/gdb.base/relocate.c
@@ -3,7 +3,7 @@ static int static_bar = 2;
/* This padding is just for the benefit of the test harness. It
causes the globals to have different addresses than the functions. */
-int dummy[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+int dummy[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
int global_foo = 3;
int global_bar = 4;
diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp
index 5f3b02c4391..c101f9c4ce2 100644
--- a/gdb/testsuite/gdb.base/setvar.exp
+++ b/gdb/testsuite/gdb.base/setvar.exp
@@ -1,25 +1,7 @@
-# Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2004
-# Free Software Foundation, Inc.
+# This testcase is part of GDB, the GNU debugger.
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-
-# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1995
-# Free Software Foundation, Inc.
+# Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+# 1999, 2000, 2001, 2004 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
@@ -36,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# bug-gdb@gnu.org
# This file was written by Rob Savoye. (rob@cygnus.com)
@@ -140,7 +122,7 @@ proc test_set { args } {
test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.0\'" "set variable char=0"
test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'" "set variable char=1"
-test_set "set variable v_char=27" "print v_char" ".\[0-9\]* = 27 \'.e\'" "set variable char=27 (Esc)"
+test_set "set variable v_char=7" "print v_char" ".\[0-9\]* = 7 \'.a\'" "set variable char=7 (Bel)"
test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'" "set variable char=32 (SPC)"
test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'" "set variable char=65 ('A')"
test_set "set variable v_char=97" "print v_char" ".\[0-9\]* = 97 \'a\'" "set variable char=97 ('a')"
@@ -151,7 +133,7 @@ test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'"
#
test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.0\'" "set variable signed char=0"
test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'" "set variable signed char=1"
-test_set "set variable v_signed_char=27" "print v_signed_char" ".\[0-9\]* = 27 \'.e\'" "set variable signed char=27 (Esc)"
+test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7 \'.a\'" "set variable signed char=7 (Bel)"
test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'" "set variable signed char=32 (SPC)"
test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'" "set variable signed char=65 ('A')"
test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \'a\'" "set variable signed char=97 ('a')"
@@ -170,7 +152,7 @@ gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
#
test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.0\'" "set variable unsigned char=0"
test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'" "set variable unsigned char=1"
-test_set "set variable v_unsigned_char=27" "print v_unsigned_char" ".\[0-9\]* = 27 \'.e\'" "set variable unsigned char=27 (Esc)"
+test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7 \'.a\'" "set variable unsigned char=7 (Bel)"
test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'" "set variable unsigned char=32 (SPC)"
test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'" "set variable unsigned char=65 ('A')"
test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97 \'a\'" "set variable unsigned char=97 ('a')"
diff --git a/gdb/testsuite/gdb.cp/class2.cc b/gdb/testsuite/gdb.cp/class2.cc
index 34263c8843e..b4aa20a0df1 100644
--- a/gdb/testsuite/gdb.cp/class2.cc
+++ b/gdb/testsuite/gdb.cp/class2.cc
@@ -48,10 +48,19 @@ void refer (A *)
;
}
+struct empty {};
+
+// Stop the compiler from optimizing away data.
+void refer (empty *)
+{
+ ;
+}
+
int main (void)
{
A alpha, *aap, *abp;
B beta, *bbp;
+ empty e;
alpha.a1 = 100;
beta.a1 = 200; beta.b1 = 201; beta.b2 = 202;
@@ -59,6 +68,7 @@ int main (void)
aap = &alpha; refer (aap);
abp = &beta; refer (abp);
bbp = &beta; refer (bbp);
+ refer (&e);
return 0; // marker return 0
} // marker close brace
diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp
index 9d5534566d2..e3f63b08eae 100644
--- a/gdb/testsuite/gdb.cp/class2.exp
+++ b/gdb/testsuite/gdb.cp/class2.exp
@@ -1,4 +1,4 @@
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004 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
@@ -113,3 +113,7 @@ gdb_test_multiple "print * abp" "print * abp at marker return 0, s-p-o off" {
gdb_test "print * (B *) abp" \
"= {.*a1 = 200.*b1 = 201.*b2 = 202}" \
"print * (B *) abp at marker return 0"
+
+# Printing the value of an object containing no data fields:
+
+gdb_test "p e" "= \{<No data fields>\}" "print object with no data fields"
diff --git a/gdb/testsuite/gdb.cp/ctti.exp b/gdb/testsuite/gdb.cp/ctti.exp
index 7c23b49d20d..a2a2e0a3245 100644
--- a/gdb/testsuite/gdb.cp/ctti.exp
+++ b/gdb/testsuite/gdb.cp/ctti.exp
@@ -76,7 +76,7 @@ if ![runto_main] then {
gdb_breakpoint [gdb_get_line_number "marker add1"]
gdb_continue_to_breakpoint "marker add1"
-gdb_test "print c" "\\$\[0-9\]+ = -62 .*"
+gdb_test "print c" "\\$\[0-9\]+ = 194 .*"
gdb_test "print f" "\\$\[0-9\]+ = 9"
gdb_test "print i" "\\$\[0-9\]+ = 4"
@@ -106,13 +106,13 @@ gdb_test_multiple "print add<float>(2.25,2.25)" "print add<float>(2.25,2.25)" {
}
}
-gdb_test_multiple "print add<char>('A','A')" "print add<char>('A','A')" {
+gdb_test_multiple "print add<unsigned char>('A','A')" "print add<unsigned char>('A','A')" {
-re "\\$\[0-9\]+ = -126 .*\r\n$gdb_prompt $" {
- pass "print add<char>('A','A')"
+ pass "print add<unsigned char>('A','A')"
}
- -re "No symbol \"add<char>\" in current context.\r\n$gdb_prompt $" {
+ -re "No symbol \"add<unsigned char>\" in current context.\r\n$gdb_prompt $" {
# TODO: kfail or xfail this
- fail "print add<char>('A','A')"
+ fail "print add<unsigned char>('A','A')"
}
}
@@ -136,13 +136,13 @@ gdb_test_multiple "print add2<float>(2.25,2.25)" "print add2<float>(2.25,2.25)"
}
}
-gdb_test_multiple "print add2<char>('A','A')" "print add2<char>('A','A')" {
+gdb_test_multiple "print add2<unsigned char>('A','A')" "print add2<unsigned char>('A','A')" {
-re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
- pass "print add2<char>('A','A')"
+ pass "print add2<unsigned char>('A','A')"
}
- -re "No symbol \"add2<char>\" in current context.\r\n$gdb_prompt $" {
+ -re "No symbol \"add2<unsigned char>\" in current context.\r\n$gdb_prompt $" {
# TODO: kfail or xfail this
- fail "print add2<char>('A','A')"
+ fail "print add2<unsigned char>('A','A')"
}
}
@@ -166,13 +166,13 @@ gdb_test_multiple "print add3<float>(2.25,2.25)" "print add3<float>(2.25,2.25)"
}
}
-gdb_test_multiple "print add3<char>('A','A')" "print add3<char>('A','A')" {
+gdb_test_multiple "print add3<unsigned char>('A','A')" "print add3<unsigned char>('A','A')" {
-re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
- pass "print add3<char>('A','A')"
+ pass "print add3<unsigned char>('A','A')"
}
- -re "No symbol \"add3<char>\" in current context.\r\n$gdb_prompt $" {
+ -re "No symbol \"add3<unsigned char>\" in current context.\r\n$gdb_prompt $" {
# TODO: kfail or xfail this
- fail "print add3<char>('A','A')"
+ fail "print add3<unsigned char>('A','A')"
}
}
@@ -196,12 +196,12 @@ gdb_test_multiple "print add4<float>(2.25,2.25)" "print add4<float>(2.25,2.25)"
}
}
-gdb_test_multiple "print add4<char>('A','A')" "print add4<char>('A','A')" {
+gdb_test_multiple "print add4<unsigned char>('A','A')" "print add4<unsigned char>('A','A')" {
-re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
- pass "print add4<char>('A','A')"
+ pass "print add4<unsigned char>('A','A')"
}
- -re "No symbol \"add4<char>\" in current context.\r\n$gdb_prompt $" {
+ -re "No symbol \"add4<unsigned char>\" in current context.\r\n$gdb_prompt $" {
# TODO: kfail or xfail this
- fail "print add4<char>('A','A')"
+ fail "print add4<unsigned char>('A','A')"
}
}
diff --git a/gdb/testsuite/gdb.cp/cttiadd.cc b/gdb/testsuite/gdb.cp/cttiadd.cc
index ffba405cc16..14ac6d130e5 100644
--- a/gdb/testsuite/gdb.cp/cttiadd.cc
+++ b/gdb/testsuite/gdb.cp/cttiadd.cc
@@ -27,7 +27,7 @@ template<class T> T add(T v1, T v2)
int main()
{
- char c;
+ unsigned char c;
int i;
float f;
extern void add1();
diff --git a/gdb/testsuite/gdb.cp/cttiadd1.cc b/gdb/testsuite/gdb.cp/cttiadd1.cc
index 9b149b3cdb8..a67babe0a9c 100644
--- a/gdb/testsuite/gdb.cp/cttiadd1.cc
+++ b/gdb/testsuite/gdb.cp/cttiadd1.cc
@@ -21,7 +21,7 @@ template<class T> T add(T v1, T v2);
void add1()
{
- char c;
+ unsigned char c;
int i;
float f;
diff --git a/gdb/testsuite/gdb.cp/cttiadd2.cc b/gdb/testsuite/gdb.cp/cttiadd2.cc
index 35386616958..0d388d7cfb8 100644
--- a/gdb/testsuite/gdb.cp/cttiadd2.cc
+++ b/gdb/testsuite/gdb.cp/cttiadd2.cc
@@ -27,7 +27,7 @@ template<class T> T add2(T v1, T v2)
void subr2()
{
- char c;
+ unsigned char c;
int i;
float f;
diff --git a/gdb/testsuite/gdb.cp/cttiadd3.cc b/gdb/testsuite/gdb.cp/cttiadd3.cc
index 2bea7bbb5ce..1d11dafccd6 100644
--- a/gdb/testsuite/gdb.cp/cttiadd3.cc
+++ b/gdb/testsuite/gdb.cp/cttiadd3.cc
@@ -35,7 +35,7 @@ template<class T> T add4(T v1, T v2)
void subr3()
{
- char c;
+ unsigned char c;
int i;
float f;
diff --git a/gdb/testsuite/gdb.java/jmisc.exp b/gdb/testsuite/gdb.java/jmisc.exp
index 8f6c6fbc2b7..9fd220ff307 100644
--- a/gdb/testsuite/gdb.java/jmisc.exp
+++ b/gdb/testsuite/gdb.java/jmisc.exp
@@ -66,7 +66,9 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_test "set print sevenbit-strings" ".*"
if ![set_lang_java] then {
- runto ${testfile}.main
+ # Ref PR gdb:java/1565. Don't use the simpler "break jmisc.main".
+ # As of 2004-02-24 it wasn't working and is being tested separatly.
+ runto "\'${testfile}.main(java.lang.String\[\])\'"
send_gdb "ptype jmisc\n"
gdb_expect {
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 5cd54abd023..72d9143ab21 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -275,7 +275,7 @@ proc gdb_breakpoint { function } {
-re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {}
- -re "Make breakpoint pending.*y or n. $" {
+ -re "Make breakpoint pending.*y or \\\[n\\\]. $" {
send_gdb "n\n"
exp_continue
}
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index b135c39f160..804f48a8073 100644
--- a/gdb/thread-db.c
+++ b/gdb/thread-db.c
@@ -585,27 +585,6 @@ check_thread_signals (void)
}
static void
-disable_thread_signals (void)
-{
-#ifdef GET_THREAD_SIGNALS
- if (thread_signals)
- {
- int i;
-
- for (i = 1; i < NSIG; i++)
- {
- if (sigismember (&thread_stop_set, i))
- signal_stop_update (target_signal_from_host (i), 1);
- if (sigismember (&thread_print_set, i))
- signal_print_update (target_signal_from_host (i), 1);
- }
-
- thread_signals = 0;
- }
-#endif
-}
-
-static void
thread_db_new_objfile (struct objfile *objfile)
{
td_err_e err;
diff --git a/gdb/top.c b/gdb/top.c
index e11aad249e8..d6bdfd09284 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -47,8 +47,8 @@
#include "gdb_assert.h"
/* readline include files */
-#include <readline/readline.h>
-#include <readline/history.h>
+#include "readline/readline.h"
+#include "readline/history.h"
/* readline defines this. */
#undef savestring
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 713bf14f2cc..39c6877c2a8 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -44,8 +44,8 @@
#include "ax-gdb.h"
/* readline include files */
-#include <readline/readline.h>
-#include <readline/history.h>
+#include "readline/readline.h"
+#include "readline/history.h"
/* readline defines this. */
#undef savestring
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index 19226b35c1d..9c3072bf74e 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -51,7 +51,7 @@ struct tui_asm_line
Disassemble count lines starting at pc.
Return address of the count'th instruction after pc. */
static CORE_ADDR
-tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count)
+tui_disassemble (struct tui_asm_line* asm_lines, CORE_ADDR pc, int count)
{
struct ui_file *gdb_dis_out;
@@ -59,22 +59,22 @@ tui_disassemble (struct tui_asm_line* lines, CORE_ADDR pc, int count)
gdb_dis_out = tui_sfileopen (256);
/* Now construct each line */
- for (; count > 0; count--, lines++)
+ for (; count > 0; count--, asm_lines++)
{
- if (lines->addr_string)
- xfree (lines->addr_string);
- if (lines->insn)
- xfree (lines->insn);
+ if (asm_lines->addr_string)
+ xfree (asm_lines->addr_string);
+ if (asm_lines->insn)
+ xfree (asm_lines->insn);
print_address (pc, gdb_dis_out);
- lines->addr = pc;
- lines->addr_string = xstrdup (tui_file_get_strbuf (gdb_dis_out));
+ asm_lines->addr = pc;
+ asm_lines->addr_string = xstrdup (tui_file_get_strbuf (gdb_dis_out));
ui_file_rewind (gdb_dis_out);
pc = pc + gdb_print_insn (pc, gdb_dis_out);
- lines->insn = xstrdup (tui_file_get_strbuf (gdb_dis_out));
+ asm_lines->insn = xstrdup (tui_file_get_strbuf (gdb_dis_out));
/* reset the buffer to empty */
ui_file_rewind (gdb_dis_out);
@@ -92,21 +92,21 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
CORE_ADDR new_low;
int max_lines;
int i;
- struct tui_asm_line* lines;
+ struct tui_asm_line* asm_lines;
max_lines = (from > 0) ? from : - from;
if (max_lines <= 1)
return pc;
- lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
+ asm_lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
* max_lines);
- memset (lines, 0, sizeof (struct tui_asm_line) * max_lines);
+ memset (asm_lines, 0, sizeof (struct tui_asm_line) * max_lines);
new_low = pc;
if (from > 0)
{
- tui_disassemble (lines, pc, max_lines);
- new_low = lines[max_lines - 1].addr;
+ tui_disassemble (asm_lines, pc, max_lines);
+ new_low = asm_lines[max_lines - 1].addr;
}
else
{
@@ -127,8 +127,8 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
else
new_low += 1 * max_lines;
- tui_disassemble (lines, new_low, max_lines);
- last_addr = lines[pos].addr;
+ tui_disassemble (asm_lines, new_low, max_lines);
+ last_addr = asm_lines[pos].addr;
} while (last_addr > pc && msymbol);
/* Scan forward disassembling one instruction at a time
@@ -145,7 +145,7 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
if (pos >= max_lines)
pos = 0;
- next_addr = tui_disassemble (&lines[pos], last_addr, 1);
+ next_addr = tui_disassemble (&asm_lines[pos], last_addr, 1);
/* If there are some problems while disassembling exit. */
if (next_addr <= last_addr)
@@ -155,12 +155,12 @@ tui_find_disassembly_address (CORE_ADDR pc, int from)
pos++;
if (pos >= max_lines)
pos = 0;
- new_low = lines[pos].addr;
+ new_low = asm_lines[pos].addr;
}
for (i = 0; i < max_lines; i++)
{
- xfree (lines[i].addr_string);
- xfree (lines[i].insn);
+ xfree (asm_lines[i].addr_string);
+ xfree (asm_lines[i].insn);
}
return new_low;
}
@@ -176,7 +176,7 @@ tui_set_disassem_content (CORE_ADDR pc)
CORE_ADDR cur_pc;
struct tui_gen_win_info * locator = tui_locator_win_info_ptr ();
int tab_len = tui_default_tab_len ();
- struct tui_asm_line* lines;
+ struct tui_asm_line* asm_lines;
int insn_pos;
int addr_size, max_size;
char* line;
@@ -195,24 +195,24 @@ tui_set_disassem_content (CORE_ADDR pc)
max_lines = TUI_DISASM_WIN->generic.height - 2; /* account for hilite */
/* Get temporary table that will hold all strings (addr & insn). */
- lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
+ asm_lines = (struct tui_asm_line*) alloca (sizeof (struct tui_asm_line)
* max_lines);
- memset (lines, 0, sizeof (struct tui_asm_line) * max_lines);
+ memset (asm_lines, 0, sizeof (struct tui_asm_line) * max_lines);
line_width = TUI_DISASM_WIN->generic.width - 1;
- tui_disassemble (lines, pc, max_lines);
+ tui_disassemble (asm_lines, pc, max_lines);
/* See what is the maximum length of an address and of a line. */
addr_size = 0;
max_size = 0;
for (i = 0; i < max_lines; i++)
{
- size_t len = strlen (lines[i].addr_string);
+ size_t len = strlen (asm_lines[i].addr_string);
if (len > addr_size)
addr_size = len;
- len = strlen (lines[i].insn) + tab_len;
+ len = strlen (asm_lines[i].insn) + tab_len;
if (len > max_size)
max_size = len;
}
@@ -231,7 +231,7 @@ tui_set_disassem_content (CORE_ADDR pc)
element = (struct tui_win_element *) TUI_DISASM_WIN->generic.content[i];
src = &element->which_element.source;
- strcpy (line, lines[i].addr_string);
+ strcpy (line, asm_lines[i].addr_string);
cur_len = strlen (line);
/* Add spaces to make the instructions start on the same column */
@@ -241,7 +241,7 @@ tui_set_disassem_content (CORE_ADDR pc)
cur_len++;
}
- strcat (line, lines[i].insn);
+ strcat (line, asm_lines[i].insn);
/* Now copy the line taking the offset into account */
if (strlen (line) > offset)
@@ -249,15 +249,15 @@ tui_set_disassem_content (CORE_ADDR pc)
else
src->line[0] = '\0';
- src->line_or_addr.addr = lines[i].addr;
- src->is_exec_point = lines[i].addr == cur_pc;
+ src->line_or_addr.addr = asm_lines[i].addr;
+ src->is_exec_point = asm_lines[i].addr == cur_pc;
/* See whether there is a breakpoint installed. */
src->has_break = (!src->is_exec_point
&& breakpoint_here_p (pc) != no_breakpoint_here);
- xfree (lines[i].addr_string);
- xfree (lines[i].insn);
+ xfree (asm_lines[i].addr_string);
+ xfree (asm_lines[i].insn);
}
TUI_DISASM_WIN->generic.content_size = i;
return TUI_SUCCESS;
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index fbdf5bf56ac..a864be28276 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -35,7 +35,7 @@
#include "gdb-events.h"
#include "ui-out.h"
#include "top.h"
-#include <readline/readline.h>
+#include "readline/readline.h"
#include <unistd.h>
#include <fcntl.h>
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 7ce92c25d1b..3813db0c0a4 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -277,9 +277,15 @@ tui_display_registers_from (int start_element_no)
TUI_DATA_WIN->detail.data_display_info.regs_content_count > 0)
{
int i = start_element_no;
- int j, value_chars_wide, item_win_width, cur_y, label_width;
+ int j, value_chars_wide, item_win_width, cur_y;
enum precision_type precision;
+ /* Do not rename the following variable into "label_width".
+ Unfortunately, term.h on AiX systems defines a macro with
+ the same name, which causes a build failure if we use the
+ same name for this variable. */
+ int tui_label_width;
+
precision = (TUI_DATA_WIN->detail.data_display_info.regs_display_type
== TUI_DFLOAT_REGS) ?
double_precision : unspecified_precision;
@@ -287,7 +293,7 @@ tui_display_registers_from (int start_element_no)
TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS)
{
value_chars_wide = DOUBLE_FLOAT_VALUE_WIDTH;
- label_width = DOUBLE_FLOAT_LABEL_WIDTH;
+ tui_label_width = DOUBLE_FLOAT_LABEL_WIDTH;
}
else
{
@@ -295,15 +301,15 @@ tui_display_registers_from (int start_element_no)
TUI_SFLOAT_REGS)
{
value_chars_wide = SINGLE_FLOAT_VALUE_WIDTH;
- label_width = SINGLE_FLOAT_LABEL_WIDTH;
+ tui_label_width = SINGLE_FLOAT_LABEL_WIDTH;
}
else
{
value_chars_wide = SINGLE_VALUE_WIDTH;
- label_width = SINGLE_LABEL_WIDTH;
+ tui_label_width = SINGLE_LABEL_WIDTH;
}
}
- item_win_width = value_chars_wide + label_width;
+ item_win_width = value_chars_wide + tui_label_width;
/*
** Now create each data "sub" window, and write the display into it.
*/
@@ -859,15 +865,21 @@ tui_display_register (int reg_num,
{
int i;
char buf[40];
- int value_chars_wide, label_width;
+ int value_chars_wide;
struct tui_data_element * data_element_ptr = &((tui_win_content)
win_info->content)[0]->which_element.data;
+ /* Do not rename the following variable into "label_width".
+ Unfortunately, term.h on AiX systems defines a macro with
+ the same name, which causes a build failure if we use the
+ same name for this variable. */
+ int tui_label_width;
+
if (IS_64BIT ||
TUI_DATA_WIN->detail.data_display_info.regs_display_type == TUI_DFLOAT_REGS)
{
value_chars_wide = DOUBLE_FLOAT_VALUE_WIDTH;
- label_width = DOUBLE_FLOAT_LABEL_WIDTH;
+ tui_label_width = DOUBLE_FLOAT_LABEL_WIDTH;
}
else
{
@@ -875,18 +887,18 @@ tui_display_register (int reg_num,
TUI_SFLOAT_REGS)
{
value_chars_wide = SINGLE_FLOAT_VALUE_WIDTH;
- label_width = SINGLE_FLOAT_LABEL_WIDTH;
+ tui_label_width = SINGLE_FLOAT_LABEL_WIDTH;
}
else
{
value_chars_wide = SINGLE_VALUE_WIDTH;
- label_width = SINGLE_LABEL_WIDTH;
+ tui_label_width = SINGLE_LABEL_WIDTH;
}
}
buf[0] = (char) 0;
tui_register_format (buf,
- value_chars_wide + label_width,
+ value_chars_wide + tui_label_width,
reg_num,
data_element_ptr,
precision);
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index afd4b10d530..846e0b4c321 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -50,7 +50,7 @@
#include "gdb_string.h"
#include <ctype.h>
-#include <readline/readline.h>
+#include "readline/readline.h"
/*******************************
** Static Local Decls
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 4d1e55b9f35..d6f344f43d5 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -22,18 +22,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#ifdef HAVE_TERM_H
-#include <term.h>
-#endif
-#include <signal.h>
-#include <fcntl.h>
-#if 0
-#include <termio.h>
-#endif
-#include <setjmp.h>
#include "defs.h"
#include "gdbcmd.h"
#include "tui/tui.h"
@@ -46,7 +34,6 @@
#include "tui/tui-win.h"
#include "tui/tui-winsource.h"
#include "tui/tui-windata.h"
-#include "readline/readline.h"
#include "target.h"
#include "frame.h"
#include "breakpoint.h"
@@ -54,8 +41,26 @@
#include "symtab.h"
#include "source.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#ifdef HAVE_TERM_H
+#include <term.h>
+#endif
+#include <signal.h>
+#include <fcntl.h>
+#if 0
+#include <termio.h>
+#endif
+#include <setjmp.h>
+
#include "gdb_curses.h"
+/* This redefines CTRL if it is not already defined, so it must come
+ after terminal state releated include files like <term.h> and
+ "gdb_ncurses.h". */
+#include "readline/readline.h"
+
/* Tells whether the TUI is active or not. */
int tui_active = 0;
static int tui_finish_init = 1;
diff --git a/gdb/utils.c b/gdb/utils.c
index 34e67771b34..3bc5fed2a30 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -63,7 +63,7 @@
#include <term.h>
#endif
-#include <readline/readline.h>
+#include "readline/readline.h"
#ifdef NEED_DECLARATION_MALLOC
extern PTR malloc (); /* OK: PTR */
@@ -1335,6 +1335,145 @@ query (const char *ctlstr, ...)
}
+/* This function supports the nquery() and yquery() functions.
+ Ask user a y-or-n question and return 0 if answer is no, 1 if
+ answer is yes, or default the answer to the specified default.
+ DEFCHAR is either 'y' or 'n' and refers to the default answer.
+ CTLSTR is the control string and should end in "? ". It should
+ not say how to answer, because we do that.
+ ARGS are the arguments passed along with the CTLSTR argument to
+ printf. */
+
+static int
+defaulted_query (const char *ctlstr, const char defchar, va_list args)
+{
+ int answer;
+ int ans2;
+ int retval;
+ int def_value;
+ char def_answer, not_def_answer;
+ char *y_string, *n_string;
+
+ /* Set up according to which answer is the default. */
+ if (defchar == 'y')
+ {
+ def_value = 1;
+ def_answer = 'Y';
+ not_def_answer = 'N';
+ y_string = "[y]";
+ n_string = "n";
+ }
+ else
+ {
+ def_value = 0;
+ def_answer = 'N';
+ not_def_answer = 'Y';
+ y_string = "y";
+ n_string = "[n]";
+ }
+
+ if (query_hook)
+ {
+ return query_hook (ctlstr, args);
+ }
+
+ /* Automatically answer default value if input is not from a terminal. */
+ if (!input_from_terminal_p ())
+ return def_value;
+
+ while (1)
+ {
+ wrap_here (""); /* Flush any buffered output */
+ gdb_flush (gdb_stdout);
+
+ if (annotation_level > 1)
+ printf_filtered ("\n\032\032pre-%cquery\n", defchar);
+
+ vfprintf_filtered (gdb_stdout, ctlstr, args);
+ printf_filtered ("(%s or %s) ", y_string, n_string);
+
+ if (annotation_level > 1)
+ printf_filtered ("\n\032\032%cquery\n", defchar);
+
+ wrap_here ("");
+ gdb_flush (gdb_stdout);
+
+ answer = fgetc (stdin);
+ clearerr (stdin); /* in case of C-d */
+ if (answer == EOF) /* C-d */
+ {
+ retval = def_value;
+ break;
+ }
+ /* Eat rest of input line, to EOF or newline */
+ if (answer != '\n')
+ do
+ {
+ ans2 = fgetc (stdin);
+ clearerr (stdin);
+ }
+ while (ans2 != EOF && ans2 != '\n' && ans2 != '\r');
+
+ if (answer >= 'a')
+ answer -= 040;
+ /* Check answer. For the non-default, the user must specify
+ the non-default explicitly. */
+ if (answer == not_def_answer)
+ {
+ retval = !def_value;
+ break;
+ }
+ /* Otherwise, for the default, the user may either specify
+ the required input or have it default by entering nothing. */
+ if (answer == def_answer || answer == '\n' ||
+ answer == '\r' || answer == EOF)
+ {
+ retval = def_value;
+ break;
+ }
+ /* Invalid entries are not defaulted and require another selection. */
+ printf_filtered ("Please answer %s or %s.\n",
+ y_string, n_string);
+ }
+
+ if (annotation_level > 1)
+ printf_filtered ("\n\032\032post-%cquery\n", defchar);
+ return retval;
+}
+
+
+/* Ask user a y-or-n question and return 0 if answer is no, 1 if
+ answer is yes, or 0 if answer is defaulted.
+ 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
+nquery (const char *ctlstr, ...)
+{
+ va_list args;
+
+ va_start (args, ctlstr);
+ return defaulted_query (ctlstr, 'n', args);
+ va_end (args);
+}
+
+/* Ask user a y-or-n question and return 0 if answer is no, 1 if
+ answer is yes, or 1 if answer is defaulted.
+ 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
+yquery (const char *ctlstr, ...)
+{
+ va_list args;
+
+ va_start (args, ctlstr);
+ return defaulted_query (ctlstr, 'y', args);
+ va_end (args);
+}
+
/* Print an error message saying that we couldn't make sense of a
\^mumble sequence in a string or character constant. START and END
indicate a substring of some larger string that contains the
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 0aaf8f5dafb..294e09f58ab 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -42,9 +42,6 @@
static int partial_memory_read (CORE_ADDR memaddr, char *myaddr,
int len, int *errnoptr);
-static void print_hex_chars (struct ui_file *, unsigned char *,
- unsigned int);
-
static void show_print (char *, int);
static void set_print (char *, int);
@@ -846,7 +843,7 @@ print_decimal_chars (struct ui_file *stream, unsigned char *valaddr,
/* VALADDR points to an integer of LEN bytes. Print it in hex on stream. */
-static void
+void
print_hex_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
{
unsigned char *p;
@@ -875,6 +872,40 @@ print_hex_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
fputs_filtered (local_hex_format_suffix (), stream);
}
+/* VALADDR points to a char integer of LEN bytes. Print it out in appropriate language form on stream.
+ Omit any leading zero chars. */
+
+void
+print_char_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
+{
+ unsigned char *p;
+
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ {
+ p = valaddr;
+ while (p < valaddr + len - 1 && *p == 0)
+ ++p;
+
+ while (p < valaddr + len)
+ {
+ LA_EMIT_CHAR (*p, stream, '\'');
+ ++p;
+ }
+ }
+ else
+ {
+ p = valaddr + len - 1;
+ while (p > valaddr && *p == 0)
+ --p;
+
+ while (p >= valaddr)
+ {
+ LA_EMIT_CHAR (*p, stream, '\'');
+ --p;
+ }
+ }
+}
+
/* Called by various <lang>_val_print routines to print elements of an
array in the form "<elem1>, <elem2>, <elem3>, ...".
diff --git a/gdb/valprint.h b/gdb/valprint.h
index 4e2d1661ad2..647b4bdc37d 100644
--- a/gdb/valprint.h
+++ b/gdb/valprint.h
@@ -63,4 +63,10 @@ extern void print_octal_chars (struct ui_file *, unsigned char *,
extern void print_decimal_chars (struct ui_file *, unsigned char *,
unsigned int);
+
+extern void print_hex_chars (struct ui_file *, unsigned char *,
+ unsigned int);
+
+extern void print_char_chars (struct ui_file *, unsigned char *,
+ unsigned int);
#endif
diff --git a/gdb/version.in b/gdb/version.in
index 777d3b9bef9..5e3690770c1 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2004-02-21-cvs
+2004-02-29-cvs
diff --git a/include/ChangeLog b/include/ChangeLog
index e2fa68f30d9..37c6cfdadf1 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,12 @@
+2004-02-24 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * dyn-string.h: Update copyright date.
+
+2004-02-23 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * dyn-string.h: Remove test of IN_LIBGCC2 and IN_GLIBCPP_V3 and
+ the associated #defines.
+
2004-01-12 Ian Lance Taylor <ian@wasabisystems.com>
* demangle.h: Instead of checking ANSI_PROTOTYPES, just include
diff --git a/include/dyn-string.h b/include/dyn-string.h
index 2a771c7a5d1..85f88b12cf6 100644
--- a/include/dyn-string.h
+++ b/include/dyn-string.h
@@ -1,5 +1,5 @@
/* An abstract string datatype.
- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
This file is part of GCC.
@@ -40,35 +40,6 @@ typedef struct dyn_string
(strcmp ((DS1)->s, (DS2)->s))
-/* dyn_string functions are used in the demangling implementation
- included in the G++ runtime library. To prevent collisions with
- names in user programs, the functions that are used in the
- demangler are given implementation-reserved names. */
-
-#if defined(IN_LIBGCC2) || defined(IN_GLIBCPP_V3)
-
-#define dyn_string_init __cxa_dyn_string_init
-#define dyn_string_new __cxa_dyn_string_new
-#define dyn_string_delete __cxa_dyn_string_delete
-#define dyn_string_release __cxa_dyn_string_release
-#define dyn_string_resize __cxa_dyn_string_resize
-#define dyn_string_clear __cxa_dyn_string_clear
-#define dyn_string_copy __cxa_dyn_string_copy
-#define dyn_string_copy_cstr __cxa_dyn_string_copy_cstr
-#define dyn_string_prepend __cxa_dyn_string_prepend
-#define dyn_string_prepend_cstr __cxa_dyn_string_prepend_cstr
-#define dyn_string_insert __cxa_dyn_string_insert
-#define dyn_string_insert_cstr __cxa_dyn_string_insert_cstr
-#define dyn_string_insert_char __cxa_dyn_string_insert_char
-#define dyn_string_append __cxa_dyn_string_append
-#define dyn_string_append_cstr __cxa_dyn_string_append_cstr
-#define dyn_string_append_char __cxa_dyn_string_append_char
-#define dyn_string_substring __cxa_dyn_string_substring
-#define dyn_string_eq __cxa_dyn_string_eq
-
-#endif /* IN_LIBGCC2 || IN_GLIBCPP_V3 */
-
-
extern int dyn_string_init PARAMS ((struct dyn_string *, int));
extern dyn_string_t dyn_string_new PARAMS ((int));
extern void dyn_string_delete PARAMS ((dyn_string_t));
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 08b7d5b6b11..b9d6e73f89e 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,50 @@
+2004-02-24 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.h (enum d_builtin_type_print): Add D_PRINT_UNSIGNED,
+ D_PRINT_UNSIGNED_LONG, D_PRINT_LONG_LONG,
+ D_PRINT_UNSIGNED_LONG_LONG, D_PRINT_FLOAT.
+ * cp-demangle.c (cplus_demangle_builtin_types): Change char and
+ short types to D_PRINT_DEFAULT. Change other integer types to use
+ new D_PRINT_* values where appropriate. Change float types to
+ D_PRINT_FLOAT.
+ (d_print_comp) [LITERAL, LITERAL_NEG]: Handle new D_PRINT_*
+ values.
+ * testsuite/demangle-expected: Adjust two test cases.
+
+ * cp-demangle.c (d_print_function_type): Print a space before the
+ parenthesis around the function type in more cases.
+ * testsuite/demangle-expected: Adjust one test case.
+
+ * cp-demangle.c (d_print_comp) [UNARY]: Don't emit extra
+ parentheses around a cast.
+ * testsuite/demangle-expected: Adjust two test cases to match new
+ output.
+
+ * cp-demangle.c (__cxa_demangle): Pass DMGL_PARAMS to d_demangle.
+
+ * cp-demangle.c (d_print_comp) [RESTRICT, VOLATILE, CONST]: Don't
+ push more than one of the same CV-qualifier on the top of the
+ stack.
+ (d_print_comp) [ARRAY_TYPE]: If the array itself is CV-qualified,
+ move the CV-qualifiers to apply to the element type instead.
+ (d_print_array_type): When checking the modifiers, keep looking
+ past ones which have been printed already.
+ * testsuite/demangle-expected: Add three test cases.
+
+2004-02-23 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (__cxa_demangle): Adjust last patch to handle
+ empty string correctly.
+
+ * cp-demangle.c (__cxa_demangle): It is not an error if status is
+ not NULL. It is an error if the mangled name is the same as a
+ built-in type name.
+ (main): If IN_GLIBCPP_V3 is defined, test __cxa_demangle rather
+ than cplus_demangle_v3.
+
+ * dyn-string.c: Remove test of IN_LIBGCC2 and IN_GLIBCPP_V3 and
+ the associated #define of RETURN_ON_ALLOCATION_FAILURE.
+
2004-02-16 Matt Kraai <kraai@alumni.cmu.edu>
* regex.c: Include <ansidecl.h>.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 19f191ed8b8..fe4b36712d3 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -1748,31 +1748,33 @@ CP_STATIC_IF_GLIBCPP_V3
const struct demangle_builtin_type_info
cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT] =
{
- /* a */ { NL ("signed char"), NL ("signed char"), D_PRINT_INT },
+ /* a */ { NL ("signed char"), NL ("signed char"), D_PRINT_DEFAULT },
/* b */ { NL ("bool"), NL ("boolean"), D_PRINT_BOOL },
- /* c */ { NL ("char"), NL ("byte"), D_PRINT_INT },
- /* d */ { NL ("double"), NL ("double"), D_PRINT_DEFAULT },
- /* e */ { NL ("long double"), NL ("long double"), D_PRINT_DEFAULT },
- /* f */ { NL ("float"), NL ("float"), D_PRINT_DEFAULT },
- /* g */ { NL ("__float128"), NL ("__float128"), D_PRINT_DEFAULT },
- /* h */ { NL ("unsigned char"), NL ("unsigned char"), D_PRINT_INT },
+ /* c */ { NL ("char"), NL ("byte"), D_PRINT_DEFAULT },
+ /* d */ { NL ("double"), NL ("double"), D_PRINT_FLOAT },
+ /* e */ { NL ("long double"), NL ("long double"), D_PRINT_FLOAT },
+ /* f */ { NL ("float"), NL ("float"), D_PRINT_FLOAT },
+ /* g */ { NL ("__float128"), NL ("__float128"), D_PRINT_FLOAT },
+ /* h */ { NL ("unsigned char"), NL ("unsigned char"), D_PRINT_DEFAULT },
/* i */ { NL ("int"), NL ("int"), D_PRINT_INT },
- /* j */ { NL ("unsigned int"), NL ("unsigned"), D_PRINT_INT },
+ /* j */ { NL ("unsigned int"), NL ("unsigned"), D_PRINT_UNSIGNED },
/* k */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
/* l */ { NL ("long"), NL ("long"), D_PRINT_LONG },
- /* m */ { NL ("unsigned long"), NL ("unsigned long"), D_PRINT_LONG },
+ /* m */ { NL ("unsigned long"), NL ("unsigned long"), D_PRINT_UNSIGNED_LONG },
/* n */ { NL ("__int128"), NL ("__int128"), D_PRINT_DEFAULT },
- /* o */ { NL ("unsigned __int128"), NL ("unsigned __int128"), D_PRINT_DEFAULT },
+ /* o */ { NL ("unsigned __int128"), NL ("unsigned __int128"),
+ D_PRINT_DEFAULT },
/* p */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
/* q */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
/* r */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
- /* s */ { NL ("short"), NL ("short"), D_PRINT_INT },
- /* t */ { NL ("unsigned short"), NL ("unsigned short"), D_PRINT_INT },
+ /* s */ { NL ("short"), NL ("short"), D_PRINT_DEFAULT },
+ /* t */ { NL ("unsigned short"), NL ("unsigned short"), D_PRINT_DEFAULT },
/* u */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
/* v */ { NL ("void"), NL ("void"), D_PRINT_VOID },
- /* w */ { NL ("wchar_t"), NL ("char"), D_PRINT_INT },
- /* x */ { NL ("long long"), NL ("long"), D_PRINT_DEFAULT },
- /* y */ { NL ("unsigned long long"), NL ("unsigned long long"), D_PRINT_DEFAULT },
+ /* w */ { NL ("wchar_t"), NL ("char"), D_PRINT_DEFAULT },
+ /* x */ { NL ("long long"), NL ("long"), D_PRINT_LONG_LONG },
+ /* y */ { NL ("unsigned long long"), NL ("unsigned long long"),
+ D_PRINT_UNSIGNED_LONG_LONG },
/* z */ { NL ("..."), NL ("..."), D_PRINT_DEFAULT },
};
@@ -3050,6 +3052,30 @@ d_print_comp (dpi, dc)
case DEMANGLE_COMPONENT_RESTRICT:
case DEMANGLE_COMPONENT_VOLATILE:
case DEMANGLE_COMPONENT_CONST:
+ {
+ struct d_print_mod *pdpm;
+
+ /* When printing arrays, it's possible to have cases where the
+ same CV-qualifier gets pushed on the stack multiple times.
+ We only need to print it once. */
+
+ for (pdpm = dpi->modifiers; pdpm != NULL; pdpm = pdpm->next)
+ {
+ if (! pdpm->printed)
+ {
+ if (pdpm->mod->type != DEMANGLE_COMPONENT_RESTRICT
+ && pdpm->mod->type != DEMANGLE_COMPONENT_VOLATILE
+ && pdpm->mod->type != DEMANGLE_COMPONENT_CONST)
+ break;
+ if (pdpm->mod->type == dc->type)
+ {
+ d_print_comp (dpi, d_left (dc));
+ return;
+ }
+ }
+ }
+ }
+ /* Fall through. */
case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_CONST_THIS:
@@ -3125,24 +3151,65 @@ d_print_comp (dpi, dc)
case DEMANGLE_COMPONENT_ARRAY_TYPE:
{
- struct d_print_mod dpm;
+ struct d_print_mod *hold_modifiers;
+ struct d_print_mod adpm[4];
+ unsigned int i;
+ struct d_print_mod *pdpm;
/* We must pass this type down as a modifier in order to print
- multi-dimensional arrays correctly. */
+ multi-dimensional arrays correctly. If the array itself is
+ CV-qualified, we act as though the element type were
+ CV-qualified. We do this by copying the modifiers down
+ rather than fiddling pointers, so that we don't wind up
+ with a d_print_mod higher on the stack pointing into our
+ stack frame after we return. */
- dpm.next = dpi->modifiers;
- dpi->modifiers = &dpm;
- dpm.mod = dc;
- dpm.printed = 0;
- dpm.templates = dpi->templates;
+ hold_modifiers = dpi->modifiers;
+
+ adpm[0].next = hold_modifiers;
+ dpi->modifiers = &adpm[0];
+ adpm[0].mod = dc;
+ adpm[0].printed = 0;
+ adpm[0].templates = dpi->templates;
+
+ i = 1;
+ pdpm = hold_modifiers;
+ while (pdpm != NULL
+ && (pdpm->mod->type == DEMANGLE_COMPONENT_RESTRICT
+ || pdpm->mod->type == DEMANGLE_COMPONENT_VOLATILE
+ || pdpm->mod->type == DEMANGLE_COMPONENT_CONST))
+ {
+ if (! pdpm->printed)
+ {
+ if (i >= sizeof adpm / sizeof adpm[0])
+ {
+ d_print_error (dpi);
+ return;
+ }
+
+ adpm[i] = *pdpm;
+ adpm[i].next = dpi->modifiers;
+ dpi->modifiers = &adpm[i];
+ pdpm->printed = 1;
+ ++i;
+ }
+
+ pdpm = pdpm->next;
+ }
d_print_comp (dpi, d_right (dc));
- dpi->modifiers = dpm.next;
+ dpi->modifiers = hold_modifiers;
- if (dpm.printed)
+ if (adpm[0].printed)
return;
+ while (i > 1)
+ {
+ --i;
+ d_print_mod (dpi, adpm[i].mod);
+ }
+
d_print_array_type (dpi, dc, dpi->modifiers);
return;
@@ -3212,15 +3279,13 @@ d_print_comp (dpi, dc)
d_print_expr_op (dpi, d_left (dc));
else
{
- d_append_string_constant (dpi, "((");
+ d_append_char (dpi, '(');
d_print_cast (dpi, d_left (dc));
d_append_char (dpi, ')');
}
d_append_char (dpi, '(');
d_print_comp (dpi, d_right (dc));
d_append_char (dpi, ')');
- if (d_left (dc)->type == DEMANGLE_COMPONENT_CAST)
- d_append_char (dpi, ')');
return;
case DEMANGLE_COMPONENT_BINARY:
@@ -3284,62 +3349,86 @@ d_print_comp (dpi, dc)
case DEMANGLE_COMPONENT_LITERAL:
case DEMANGLE_COMPONENT_LITERAL_NEG:
- /* For some builtin types, produce simpler output. */
- if (d_left (dc)->type == DEMANGLE_COMPONENT_BUILTIN_TYPE)
- {
- switch (d_left (dc)->u.s_builtin.type->print)
- {
- case D_PRINT_INT:
- if (d_right (dc)->type == DEMANGLE_COMPONENT_NAME)
- {
- if (dc->type == DEMANGLE_COMPONENT_LITERAL_NEG)
- d_append_char (dpi, '-');
- d_print_comp (dpi, d_right (dc));
- return;
- }
- break;
+ {
+ enum d_builtin_type_print tp;
- case D_PRINT_LONG:
- if (d_right (dc)->type == DEMANGLE_COMPONENT_NAME)
- {
- if (dc->type == DEMANGLE_COMPONENT_LITERAL_NEG)
- d_append_char (dpi, '-');
- d_print_comp (dpi, d_right (dc));
- d_append_char (dpi, 'l');
- return;
- }
- break;
+ /* For some builtin types, produce simpler output. */
+ tp = D_PRINT_DEFAULT;
+ if (d_left (dc)->type == DEMANGLE_COMPONENT_BUILTIN_TYPE)
+ {
+ tp = d_left (dc)->u.s_builtin.type->print;
+ switch (tp)
+ {
+ case D_PRINT_INT:
+ case D_PRINT_UNSIGNED:
+ case D_PRINT_LONG:
+ case D_PRINT_UNSIGNED_LONG:
+ case D_PRINT_LONG_LONG:
+ case D_PRINT_UNSIGNED_LONG_LONG:
+ if (d_right (dc)->type == DEMANGLE_COMPONENT_NAME)
+ {
+ if (dc->type == DEMANGLE_COMPONENT_LITERAL_NEG)
+ d_append_char (dpi, '-');
+ d_print_comp (dpi, d_right (dc));
+ switch (tp)
+ {
+ default:
+ break;
+ case D_PRINT_UNSIGNED:
+ d_append_char (dpi, 'u');
+ break;
+ case D_PRINT_LONG:
+ d_append_char (dpi, 'l');
+ break;
+ case D_PRINT_UNSIGNED_LONG:
+ d_append_string_constant (dpi, "ul");
+ break;
+ case D_PRINT_LONG_LONG:
+ d_append_string_constant (dpi, "ll");
+ break;
+ case D_PRINT_UNSIGNED_LONG_LONG:
+ d_append_string_constant (dpi, "ull");
+ break;
+ }
+ return;
+ }
+ break;
- case D_PRINT_BOOL:
- if (d_right (dc)->type == DEMANGLE_COMPONENT_NAME
- && d_right (dc)->u.s_name.len == 1
- && dc->type == DEMANGLE_COMPONENT_LITERAL)
- {
- switch (d_right (dc)->u.s_name.s[0])
- {
- case '0':
- d_append_string_constant (dpi, "false");
- return;
- case '1':
- d_append_string_constant (dpi, "true");
- return;
- default:
- break;
- }
- }
- break;
+ case D_PRINT_BOOL:
+ if (d_right (dc)->type == DEMANGLE_COMPONENT_NAME
+ && d_right (dc)->u.s_name.len == 1
+ && dc->type == DEMANGLE_COMPONENT_LITERAL)
+ {
+ switch (d_right (dc)->u.s_name.s[0])
+ {
+ case '0':
+ d_append_string_constant (dpi, "false");
+ return;
+ case '1':
+ d_append_string_constant (dpi, "true");
+ return;
+ default:
+ break;
+ }
+ }
+ break;
- default:
- break;
- }
- }
+ default:
+ break;
+ }
+ }
- d_append_char (dpi, '(');
- d_print_comp (dpi, d_left (dc));
- d_append_char (dpi, ')');
- if (dc->type == DEMANGLE_COMPONENT_LITERAL_NEG)
- d_append_char (dpi, '-');
- d_print_comp (dpi, d_right (dc));
+ d_append_char (dpi, '(');
+ d_print_comp (dpi, d_left (dc));
+ d_append_char (dpi, ')');
+ if (dc->type == DEMANGLE_COMPONENT_LITERAL_NEG)
+ d_append_char (dpi, '-');
+ if (tp == D_PRINT_FLOAT)
+ d_append_char (dpi, '[');
+ d_print_comp (dpi, d_right (dc));
+ if (tp == D_PRINT_FLOAT)
+ d_append_char (dpi, ']');
+ }
return;
default:
@@ -3549,11 +3638,13 @@ d_print_function_type (dpi, dc, mods)
{
int need_paren;
int saw_mod;
+ int need_space;
struct d_print_mod *p;
struct d_print_mod *hold_modifiers;
need_paren = 0;
saw_mod = 0;
+ need_space = 0;
for (p = mods; p != NULL; p = p->next)
{
if (p->printed)
@@ -3562,15 +3653,18 @@ d_print_function_type (dpi, dc, mods)
saw_mod = 1;
switch (p->mod->type)
{
+ case DEMANGLE_COMPONENT_POINTER:
+ case DEMANGLE_COMPONENT_REFERENCE:
+ need_paren = 1;
+ break;
case DEMANGLE_COMPONENT_RESTRICT:
case DEMANGLE_COMPONENT_VOLATILE:
case DEMANGLE_COMPONENT_CONST:
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
- case DEMANGLE_COMPONENT_POINTER:
- case DEMANGLE_COMPONENT_REFERENCE:
case DEMANGLE_COMPONENT_COMPLEX:
case DEMANGLE_COMPONENT_IMAGINARY:
case DEMANGLE_COMPONENT_PTRMEM_TYPE:
+ need_space = 1;
need_paren = 1;
break;
case DEMANGLE_COMPONENT_RESTRICT_THIS:
@@ -3589,18 +3683,14 @@ d_print_function_type (dpi, dc, mods)
if (need_paren)
{
- switch (d_last_char (dpi))
+ if (! need_space)
{
- case ' ':
- case '(':
- case '*':
- break;
-
- default:
- d_append_char (dpi, ' ');
- break;
+ if (d_last_char (dpi) != '('
+ && d_last_char (dpi) != '*')
+ need_space = 1;
}
-
+ if (need_space && d_last_char (dpi) != ' ')
+ d_append_char (dpi, ' ');
d_append_char (dpi, '(');
}
@@ -3643,19 +3733,19 @@ d_print_array_type (dpi, dc, mods)
need_paren = 0;
for (p = mods; p != NULL; p = p->next)
{
- if (p->printed)
- break;
-
- if (p->mod->type == DEMANGLE_COMPONENT_ARRAY_TYPE)
- {
- need_space = 0;
- break;
- }
- else
+ if (! p->printed)
{
- need_paren = 1;
- need_space = 1;
- break;
+ if (p->mod->type == DEMANGLE_COMPONENT_ARRAY_TYPE)
+ {
+ need_space = 0;
+ break;
+ }
+ else
+ {
+ need_paren = 1;
+ need_space = 1;
+ break;
+ }
}
}
@@ -3944,29 +4034,46 @@ __cxa_demangle (mangled_name, output_buffer, length, status)
char *demangled;
size_t alc;
- if (status == NULL)
- return NULL;
-
if (mangled_name == NULL)
{
- *status = -3;
+ if (status != NULL)
+ *status = -3;
return NULL;
}
if (output_buffer != NULL && length == NULL)
{
- *status = -3;
+ if (status != NULL)
+ *status = -3;
+ return NULL;
+ }
+
+ /* The specification for __cxa_demangle() is that if the mangled
+ name could be either an extern "C" identifier, or an internal
+ built-in type name, then we resolve it as the identifier. All
+ internal built-in type names are a single lower case character.
+ Frankly, this simplistic disambiguation doesn't make sense to me,
+ but it is documented, so we implement it here. */
+ if (IS_LOWER (mangled_name[0])
+ && mangled_name[1] == '\0'
+ && cplus_demangle_builtin_types[mangled_name[0] - 'a'].name != NULL)
+ {
+ if (status != NULL)
+ *status = -2;
return NULL;
}
- demangled = d_demangle (mangled_name, DMGL_TYPES, &alc);
+ demangled = d_demangle (mangled_name, DMGL_PARAMS | DMGL_TYPES, &alc);
if (demangled == NULL)
{
- if (alc == 1)
- *status = -1;
- else
- *status = -2;
+ if (status != NULL)
+ {
+ if (alc == 1)
+ *status = -1;
+ else
+ *status = -2;
+ }
return NULL;
}
@@ -3990,7 +4097,8 @@ __cxa_demangle (mangled_name, output_buffer, length, status)
}
}
- *status = 0;
+ if (status != NULL)
+ *status = 0;
return demangled;
}
@@ -4296,7 +4404,11 @@ main (argc, argv)
if (dyn_string_length (mangled) > 0)
{
+#ifdef IN_GLIBCPP_V3
+ s = __cxa_demangle (dyn_string_buf (mangled), NULL, NULL, NULL);
+#else
s = cplus_demangle_v3 (dyn_string_buf (mangled), options);
+#endif
if (s != NULL)
{
@@ -4328,9 +4440,16 @@ main (argc, argv)
for (i = optind; i < argc; ++i)
{
char *s;
+#ifdef IN_GLIBCPP_V3
+ int status;
+#endif
/* Attempt to demangle. */
+#ifdef IN_GLIBCPP_V3
+ s = __cxa_demangle (argv[i], NULL, NULL, &status);
+#else
s = cplus_demangle_v3 (argv[i], options);
+#endif
/* If it worked, print the demangled name. */
if (s != NULL)
@@ -4339,7 +4458,13 @@ main (argc, argv)
free (s);
}
else
- fprintf (stderr, "Failed: %s\n", argv[i]);
+ {
+#ifdef IN_GLIBCPP_V3
+ fprintf (stderr, "Failed: %s (status %d)\n", argv[i], status);
+#else
+ fprintf (stderr, "Failed: %s\n", argv[i]);
+#endif
+ }
}
}
diff --git a/libiberty/cp-demangle.h b/libiberty/cp-demangle.h
index d3c57ce3766..eea086862d6 100644
--- a/libiberty/cp-demangle.h
+++ b/libiberty/cp-demangle.h
@@ -53,10 +53,20 @@ enum d_builtin_type_print
D_PRINT_DEFAULT,
/* Print as integer. */
D_PRINT_INT,
- /* Print as long, with trailing `l'. */
+ /* Print as unsigned integer, with trailing "u". */
+ D_PRINT_UNSIGNED,
+ /* Print as long, with trailing "l". */
D_PRINT_LONG,
+ /* Print as unsigned long, with trailing "ul". */
+ D_PRINT_UNSIGNED_LONG,
+ /* Print as long long, with trailing "ll". */
+ D_PRINT_LONG_LONG,
+ /* Print as unsigned long long, with trailing "ull". */
+ D_PRINT_UNSIGNED_LONG_LONG,
/* Print as bool. */
D_PRINT_BOOL,
+ /* Print as float--put value in square brackets. */
+ D_PRINT_FLOAT,
/* Print in usual way, but here to detect void. */
D_PRINT_VOID
};
diff --git a/libiberty/dyn-string.c b/libiberty/dyn-string.c
index 1da76c2110d..5d48cdc6955 100644
--- a/libiberty/dyn-string.c
+++ b/libiberty/dyn-string.c
@@ -1,5 +1,5 @@
/* An abstract string datatype.
- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
This file is part of GNU CC.
@@ -45,15 +45,6 @@ Boston, MA 02111-1307, USA. */
#include "libiberty.h"
#include "dyn-string.h"
-/* If this file is being compiled for inclusion in the C++ runtime
- library, as part of the demangler implementation, we don't want to
- abort if an allocation fails. Instead, percolate an error code up
- through the call chain. */
-
-#if defined(IN_LIBGCC2) || defined(IN_GLIBCPP_V3)
-#define RETURN_ON_ALLOCATION_FAILURE
-#endif
-
/* Performs in-place initialization of a dyn_string struct. This
function can be used with a dyn_string struct on the stack or
embedded in another object. The contents of of the string itself
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 25e88309b76..9a3f0b9da8d 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3591,13 +3591,13 @@ hairyfunc5
# This is from gcc PR 8861
--format=gnu-v3 --no-params
_Z1fILi1ELc120EEv1AIXplT_cviLd810000000000000000703DAD7A370C5EEE
-void f<1, 120>(A<(1) + (((int)((double)810000000000000000703DAD7A370C5)))>)
-f<1, 120>
+void f<1, (char)120>(A<(1) + ((int)((double)[810000000000000000703DAD7A370C5]))>)
+f<1, (char)120>
#
# This is also from gcc PR 8861
--format=gnu-v3 --no-params
_Z1fILi1EEv1AIXplT_cvingLf3f800000EEE
-void f<1>(A<(1) + (((int)(-((float)3f800000))))>)
+void f<1>(A<(1) + ((int)(-((float)[3f800000])))>)
f<1>
#
# This is from a libstdc++ debug mode patch.
@@ -3635,7 +3635,7 @@ std::operator< <file_path, std::string>
# More hairy qualifier handling.
--format=gnu-v3 --no-params
_Z9hairyfuncM1YKFPVPFrPA2_PM1XKFKPA3_ilEPcEiE
-hairyfunc(int (* const (X::** (* restrict (* volatile*(Y::*)(int) const)(char*)) [2])(long) const) [3])
+hairyfunc(int (* const (X::** (* restrict (* volatile* (Y::*)(int) const)(char*)) [2])(long) const) [3])
hairyfunc
#
# Check that negative numbers are handled correctly.
@@ -3681,6 +3681,24 @@ _ZNK5boost6spirit5matchI13rcs_deltatextEcvMNS0_4impl5dummyEFvvEEv
boost::spirit::match<rcs_deltatext>::operator void (boost::spirit::impl::dummy::*)()() const
boost::spirit::match<rcs_deltatext>::operator void (boost::spirit::impl::dummy::*)()
#
+# Multi-dimensional arrays with qualifiers on the inner dimensions.
+--format=gnu-v3 --no-params
+_Z3fooIA6_KiEvA9_KT_rVPrS4_
+void foo<int const [6]>(int const [9][6], int restrict const (* volatile restrict) [9][6])
+foo<int const [6]>
+#
+# From PR libstdc++/12736
+--format=gnu-v3 --no-params
+_Z3fooIA3_iEvRKT_
+void foo<int [3]>(int const (&) [3])
+foo<int [3]>
+#
+# Related to PR libstdc++/12736
+--format=gnu-v3 --no-params
+_Z3fooIPA3_iEvRKT_
+void foo<int (*) [3]>(int (* const&) [3])
+foo<int (*) [3]>
+#
# Test GNU V3 constructor and destructor identification.
# 0 means it is not a constructor/destructor.
# Other integers correspond to enum gnu_v3_{c,d}tor_kinds in demangle.h.
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 5e2e1cc7591..783165bee73 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,25 @@
+2004-02-26 Andrew Stubbs <andrew.stubbs@superh.com>
+
+ * sh-opc.h: Move fsca and fsrra instructions from sh4a to sh4.
+ Also correct mistake in the comment.
+
+2004-02-26 Andrew Stubbs <andrew.stubbs@superh.com>
+
+ * sh-dis.c (print_insn_sh): Add REG_N_D nibble type to
+ ensure that double registers have even numbers.
+ Add REG_N_B01 for nn01 (binary 01) nibble to ensure
+ that reserved instruction 0xfffd does not decode the same
+ as 0xfdfd (ftrv).
+ * sh-opc.h: Add REG_N_D nibble type and use it whereever
+ REG_N refers to a double register.
+ Add REG_N_B01 nibble type and use it instead of REG_NM
+ in ftrv.
+ Adjust the bit patterns in a few comments.
+
+2004-02-25 Aldy Hernandez <aldyh@redhat.com>
+
+ * ppc-opc.c (powerpc_opcodes): Change mask for dcbt and dcbtst.
+
2004-02-20 Aldy Hernandez <aldyh@redhat.com>
* ppc-opc.c (powerpc_opcodes): Move mfmcsrr0 before mfdc_dat.
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index 540f23b549b..9c65ff3a8a6 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -3476,7 +3476,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mtsrin", X(31,242), XRA_MASK, PPC32, { RS, RB } },
{ "mtsri", X(31,242), XRA_MASK, POWER32, { RS, RB } },
-{ "dcbtst", X(31,246), XRT_MASK, PPC, { CT, RA, RB } },
+{ "dcbtst", X(31,246), X_MASK, PPC, { CT, RA, RB } },
{ "stbux", X(31,247), X_MASK, COM, { RS, RAS, RB } },
@@ -3510,7 +3510,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "lscbx", XRC(31,277,0), X_MASK, M601, { RT, RA, RB } },
{ "lscbx.", XRC(31,277,1), X_MASK, M601, { RT, RA, RB } },
-{ "dcbt", X(31,278), XRT_MASK, PPC, { CT, RA, RB } },
+{ "dcbt", X(31,278), X_MASK, PPC, { CT, RA, RB } },
{ "lhzx", X(31,279), X_MASK, COM, { RT, RA, RB } },
diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c
index 70fdffb48e8..2512f966d35 100644
--- a/opcodes/sh-dis.c
+++ b/opcodes/sh-dis.c
@@ -577,12 +577,21 @@ print_insn_sh (memaddr, info)
case IMM1_8BY4:
imm = ((nibs[2] << 4) | nibs[3]) << 2;
goto ok;
+ case REG_N_D:
+ if ((nibs[n] & 1) != 0)
+ goto fail;
+ /* fall through */
case REG_N:
rn = nibs[n];
break;
case REG_M:
rm = nibs[n];
break;
+ case REG_N_B01:
+ if ((nibs[n] & 0x3) != 1 /* binary 01 */)
+ goto fail;
+ rn = (nibs[n] & 0xc) >> 2;
+ break;
case REG_NM:
rn = (nibs[n] & 0xc) >> 2;
rm = (nibs[n] & 0x3);
diff --git a/opcodes/sh-opc.h b/opcodes/sh-opc.h
index 4b0b0a8d0e7..0ef1fab42a6 100644
--- a/opcodes/sh-opc.h
+++ b/opcodes/sh-opc.h
@@ -37,6 +37,8 @@ typedef enum
HEX_XX00,
HEX_00YY,
REG_N,
+ REG_N_D, /* nnn0 */
+ REG_N_B01, /* nn01 */
REG_M,
SDT_REG_N,
REG_NM,
@@ -842,7 +844,7 @@ const sh_opcode_info sh_table[] =
{"pswap", {DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_B,HEX_D,HEX_4}, arch_sh4al_dsp_up},
/* 1111nnnn01011101 fabs <F_REG_N> */{"fabs",{F_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}, arch_sh2e_up},
-/* 1111nnnn01011101 fabs <D_REG_N> */{"fabs",{D_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}, arch_sh4_up},
+/* 1111nnn001011101 fabs <D_REG_N> */{"fabs",{D_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}, arch_sh4_up},
/* 1111nnnnmmmm0000 fadd <F_REG_M>,<F_REG_N>*/{"fadd",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_0}, arch_sh2e_up},
/* 1111nnn0mmm00000 fadd <D_REG_M>,<D_REG_N>*/{"fadd",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_0}, arch_sh4_up},
@@ -853,9 +855,9 @@ const sh_opcode_info sh_table[] =
/* 1111nnnnmmmm0101 fcmp/gt <F_REG_M>,<F_REG_N>*/{"fcmp/gt",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_5}, arch_sh2e_up},
/* 1111nnn0mmm00101 fcmp/gt <D_REG_M>,<D_REG_N>*/{"fcmp/gt",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_5}, arch_sh4_up},
-/* 1111nnn010111101 fcnvds <D_REG_N>,FPUL*/{"fcnvds",{D_REG_N,FPUL_M},{HEX_F,REG_N,HEX_B,HEX_D}, arch_sh4_up},
+/* 1111nnn010111101 fcnvds <D_REG_N>,FPUL*/{"fcnvds",{D_REG_N,FPUL_M},{HEX_F,REG_N_D,HEX_B,HEX_D}, arch_sh4_up},
-/* 1111nnn010101101 fcnvsd FPUL,<D_REG_N>*/{"fcnvsd",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_A,HEX_D}, arch_sh4_up},
+/* 1111nnn010101101 fcnvsd FPUL,<D_REG_N>*/{"fcnvsd",{FPUL_M,D_REG_N},{HEX_F,REG_N_D,HEX_A,HEX_D}, arch_sh4_up},
/* 1111nnnnmmmm0011 fdiv <F_REG_M>,<F_REG_N>*/{"fdiv",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_3}, arch_sh2e_up},
/* 1111nnn0mmm00011 fdiv <D_REG_M>,<D_REG_N>*/{"fdiv",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_3}, arch_sh4_up},
@@ -869,42 +871,42 @@ const sh_opcode_info sh_table[] =
/* 1111nnnn00011101 flds <F_REG_N>,FPUL*/{"flds",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_1,HEX_D}, arch_sh2e_up},
/* 1111nnnn00101101 float FPUL,<F_REG_N>*/{"float",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}, arch_sh2e_up},
-/* 1111nnnn00101101 float FPUL,<D_REG_N>*/{"float",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}, arch_sh4_up},
+/* 1111nnn000101101 float FPUL,<D_REG_N>*/{"float",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}, arch_sh4_up},
/* 1111nnnnmmmm1110 fmac FR0,<F_REG_M>,<F_REG_N>*/{"fmac",{F_FR0,F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_E}, arch_sh2e_up},
/* 1111nnnnmmmm1100 fmov <F_REG_M>,<F_REG_N>*/{"fmov",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_C}, arch_sh2e_up},
-/* 1111nnnnmmmm1100 fmov <DX_REG_M>,<DX_REG_N>*/{"fmov",{DX_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_C}, arch_sh4_up},
+/* 1111nnn1mmmm1100 fmov <DX_REG_M>,<DX_REG_N>*/{"fmov",{DX_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_C}, arch_sh4_up},
/* 1111nnnnmmmm1000 fmov @<REG_M>,<F_REG_N>*/{"fmov",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh2e_up},
-/* 1111nnnnmmmm1000 fmov @<REG_M>,<DX_REG_N>*/{"fmov",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up},
+/* 1111nnn1mmmm1000 fmov @<REG_M>,<DX_REG_N>*/{"fmov",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up},
/* 1111nnnnmmmm1010 fmov <F_REG_M>,@<REG_N>*/{"fmov",{F_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh2e_up},
-/* 1111nnnnmmmm1010 fmov <DX_REG_M>,@<REG_N>*/{"fmov",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh4_up},
+/* 1111nnnnmmm11010 fmov <DX_REG_M>,@<REG_N>*/{"fmov",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh4_up},
/* 1111nnnnmmmm1001 fmov @<REG_M>+,<F_REG_N>*/{"fmov",{A_INC_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh2e_up},
-/* 1111nnnnmmmm1001 fmov @<REG_M>+,<DX_REG_N>*/{"fmov",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh4_up},
+/* 1111nnn1mmmm1001 fmov @<REG_M>+,<DX_REG_N>*/{"fmov",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh4_up},
/* 1111nnnnmmmm1011 fmov <F_REG_M>,@-<REG_N>*/{"fmov",{F_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh2e_up},
-/* 1111nnnnmmmm1011 fmov <DX_REG_M>,@-<REG_N>*/{"fmov",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh4_up},
+/* 1111nnnnmmm11011 fmov <DX_REG_M>,@-<REG_N>*/{"fmov",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh4_up},
/* 1111nnnnmmmm0110 fmov @(R0,<REG_M>),<F_REG_N>*/{"fmov",{A_IND_R0_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh2e_up},
-/* 1111nnnnmmmm0110 fmov @(R0,<REG_M>),<DX_REG_N>*/{"fmov",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh4_up},
+/* 1111nnn1mmmm0110 fmov @(R0,<REG_M>),<DX_REG_N>*/{"fmov",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh4_up},
/* 1111nnnnmmmm0111 fmov <F_REG_M>,@(R0,<REG_N>)*/{"fmov",{F_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh2e_up},
-/* 1111nnnnmmmm0111 fmov <DX_REG_M>,@(R0,<REG_N>)*/{"fmov",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up},
+/* 1111nnnnmmm10111 fmov <DX_REG_M>,@(R0,<REG_N>)*/{"fmov",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up},
-/* 1111nnnnmmmm1000 fmov.d @<REG_M>,<DX_REG_N>*/{"fmov.d",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up},
+/* 1111nnn1mmmm1000 fmov.d @<REG_M>,<DX_REG_N>*/{"fmov.d",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up},
-/* 1111nnnnmmmm1010 fmov.d <DX_REG_M>,@<REG_N>*/{"fmov.d",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh4_up},
+/* 1111nnnnmmm11010 fmov.d <DX_REG_M>,@<REG_N>*/{"fmov.d",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh4_up},
-/* 1111nnnnmmmm1001 fmov.d @<REG_M>+,<DX_REG_N>*/{"fmov.d",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh4_up},
+/* 1111nnn1mmmm1001 fmov.d @<REG_M>+,<DX_REG_N>*/{"fmov.d",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh4_up},
-/* 1111nnnnmmmm1011 fmov.d <DX_REG_M>,@-<REG_N>*/{"fmov.d",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh4_up},
+/* 1111nnnnmmm11011 fmov.d <DX_REG_M>,@-<REG_N>*/{"fmov.d",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh4_up},
-/* 1111nnnnmmmm0110 fmov.d @(R0,<REG_M>),<DX_REG_N>*/{"fmov.d",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh4_up},
+/* 1111nnn1mmmm0110 fmov.d @(R0,<REG_M>),<DX_REG_N>*/{"fmov.d",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh4_up},
-/* 1111nnnnmmmm0111 fmov.d <DX_REG_M>,@(R0,<REG_N>)*/{"fmov.d",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up},
+/* 1111nnnnmmm10111 fmov.d <DX_REG_M>,@(R0,<REG_N>)*/{"fmov.d",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up},
/* 1111nnnnmmmm1000 fmov.s @<REG_M>,<F_REG_N>*/{"fmov.s",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh2e_up},
@@ -922,20 +924,20 @@ const sh_opcode_info sh_table[] =
/* 1111nnn0mmm00010 fmul <D_REG_M>,<D_REG_N>*/{"fmul",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_2}, arch_sh4_up},
/* 1111nnnn01001101 fneg <F_REG_N> */{"fneg",{F_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}, arch_sh2e_up},
-/* 1111nnnn01001101 fneg <D_REG_N> */{"fneg",{D_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}, arch_sh4_up},
+/* 1111nnn001001101 fneg <D_REG_N> */{"fneg",{D_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}, arch_sh4_up},
/* 1111011111111101 fpchg */{"fpchg",{0},{HEX_F,HEX_7,HEX_F,HEX_D}, arch_sh4a_up},
/* 1111101111111101 frchg */{"frchg",{0},{HEX_F,HEX_B,HEX_F,HEX_D}, arch_sh4_up},
-/* 1111nnn011111101 fsca FPUL,<F_REG_N> */{"fsca",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_F,HEX_D}, arch_sh4a_up},
+/* 1111nnn011111101 fsca FPUL,<D_REG_N> */{"fsca",{FPUL_M,D_REG_N},{HEX_F,REG_N_D,HEX_F,HEX_D}, arch_sh4_up},
/* 1111001111111101 fschg */{"fschg",{0},{HEX_F,HEX_3,HEX_F,HEX_D}, arch_sh4_up},
/* 1111nnnn01101101 fsqrt <F_REG_N> */{"fsqrt",{F_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh3e_up},
-/* 1111nnnn01101101 fsqrt <D_REG_N> */{"fsqrt",{D_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh4_up},
+/* 1111nnn001101101 fsqrt <D_REG_N> */{"fsqrt",{D_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh4_up},
-/* 1111nnnn01111101 fsrra <F_REG_N> */{"fsrra",{F_REG_N},{HEX_F,REG_N,HEX_7,HEX_D}, arch_sh4a_up},
+/* 1111nnnn01111101 fsrra <F_REG_N> */{"fsrra",{F_REG_N},{HEX_F,REG_N,HEX_7,HEX_D}, arch_sh4_up},
/* 1111nnnn00001101 fsts FPUL,<F_REG_N>*/{"fsts",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_0,HEX_D}, arch_sh2e_up},
@@ -945,7 +947,7 @@ const sh_opcode_info sh_table[] =
/* 1111nnnn00111101 ftrc <F_REG_N>,FPUL*/{"ftrc",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_3,HEX_D}, arch_sh2e_up},
/* 1111nnnn00111101 ftrc <D_REG_N>,FPUL*/{"ftrc",{D_REG_N,FPUL_M},{HEX_F,REG_N,HEX_3,HEX_D}, arch_sh4_up},
-/* 1111nn0111111101 ftrv XMTRX_M4,<V_REG_n>*/{"ftrv",{XMTRX_M4,V_REG_N},{HEX_F,REG_NM,HEX_F,HEX_D}, arch_sh4_up},
+/* 1111nn0111111101 ftrv XMTRX_M4,<V_REG_n>*/{"ftrv",{XMTRX_M4,V_REG_N},{HEX_F,REG_N_B01,HEX_F,HEX_D}, arch_sh4_up},
{ 0, {0}, {0}, 0 }
};
diff --git a/sim/testsuite/sim/frv/rst.cgs b/sim/testsuite/sim/frv/rst.cgs
deleted file mode 100644
index c8ba442516d..00000000000
--- a/sim/testsuite/sim/frv/rst.cgs
+++ /dev/null
@@ -1,107 +0,0 @@
-# frv testcase for rst $GRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global rst
-rst:
- ; No nesr's active
- set_gr_gr sp,gr10
- set_gr_gr sp,gr24
- set_mem_limmed 0x2222,0x2222,gr24
- set_gr_gr gr24,gr27
- inc_gr_immed -4,gr27
- set_mem_limmed 0x3333,0x3333,gr27
- set_gr_gr gr27,gr26
- inc_gr_immed -4,gr26
- set_mem_limmed 0x4444,0x4444,gr26
- set_gr_gr gr26,gr25
- inc_gr_immed -4,gr25
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_limmed 0x1111,0x1111,gr20
- set_gr_immed 0,gr7
- set_gr_limmed 0xffff,0xffff,gr8
- rst gr8,@(sp,gr7)
- test_mem_limmed 0xffff,0xffff,gr24
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_gr_limmed 0x1111,0x1111,gr20
-
- ; 1 nesr active with the incorrect address in neear for gr
- nldi @(sp,0),gr20
- test_spr_gr neear0,gr10
- set_mem_limmed 0x2222,0x2222,gr24
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_limmed 0x1111,0x1111,gr20
- set_gr_limmed 0xffff,0xffff,gr8
- set_gr_immed -4,gr7
- rst gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr24
- test_mem_limmed 0xffff,0xffff,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_gr_limmed 0x1111,0x1111,gr20
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed -4,gr10
- nldfi @(sp,-4),fr20
- test_spr_gr neear1,gr10
- set_mem_limmed 0x2222,0x2222,gr24
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_fr_iimmed 0x1111,0x1111,fr20
- set_gr_limmed 0xffff,0xffff,gr8
- inc_gr_immed -4,sp
- set_gr_immed 4,gr7
- rst gr8,@(sp,gr7)
- test_mem_limmed 0xffff,0xffff,gr24
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the correct address in neear for gr
- inc_gr_immed -4,gr10
- nldi @(sp,-4),gr20
- test_spr_gr neear2,gr10
- set_mem_limmed 0x2222,0x2222,gr24
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_limmed 0x1111,0x1111,gr20
- set_gr_limmed 0xffff,0xffff,gr8
- inc_gr_immed -4,sp
- set_gr_immed 0,gr7
- rst gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr24
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0xffff,0xffff,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_gr_limmed 0xffff,0xffff,gr20
-
- ; 1 nesr active with the correct address in neear for fr
- inc_gr_immed -4,gr10
- nldfi @(sp,-4),fr20
- test_spr_gr neear3,gr10
- set_mem_limmed 0x2222,0x2222,gr24
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_fr_iimmed 0x1111,0x1111,fr20
- set_gr_limmed 0xffff,0xffff,gr8
- set_gr_immed -4,gr7
- rst gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr24
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0xffff,0xffff,gr25
- test_fr_limmed 0xffff,0xffff,fr20
-
- pass
diff --git a/sim/testsuite/sim/frv/rstb.cgs b/sim/testsuite/sim/frv/rstb.cgs
deleted file mode 100644
index e7bab4231a7..00000000000
--- a/sim/testsuite/sim/frv/rstb.cgs
+++ /dev/null
@@ -1,72 +0,0 @@
-# frv testcase for rstb $GRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global add
-add:
- ; No nesr's active
- set_gr_gr sp,gr21
- set_gr_gr gr21,gr22
- set_gr_limmed 0x1111,0x1111,gr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_gr_immed 0,gr7
- set_gr_limmed 0xffff,0xffff,gr8
- rstb gr8,@(sp,gr7)
- test_mem_limmed 0xff22,0x2222,sp
- test_gr_limmed 0x1111,0x1111,gr20
-
- ; 1 nesr active with the incorrect address in neear for gr
- inc_gr_immed 3,gr22
- nldubi @(sp,3),gr20
- test_spr_gr neear0,gr22
- set_gr_limmed 0x1111,0x1111,gr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_gr_limmed 0xffff,0xffff,gr8
- inc_gr_immed 1,gr7
- rstb gr8,@(sp,gr7)
- test_mem_limmed 0x22ff,0x2222,gr21
- test_gr_limmed 0x1111,0x1111,gr20
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed -1,gr22
- nldbfi @(sp,2),fr20
- test_spr_gr neear1,gr22
- set_fr_iimmed 0x1111,0x1111,fr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_gr_limmed 0xffff,0xffff,gr8
- inc_gr_immed 4,sp
- set_gr_immed -1,gr7
- rstb gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x22ff,gr21
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the correct address in neear for gr
- inc_gr_immed -1,gr22
- nldubi @(sp,-3),gr20
- test_spr_gr neear2,gr22
- set_gr_limmed 0x1111,0x1111,gr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_gr_limmed 0xffff,0xffff,gr8
- inc_gr_immed -4,sp
- set_gr_immed 1,gr7
- rstb gr8,@(sp,gr7)
- test_mem_limmed 0x22ff,0x2222,gr21
- test_gr_limmed 0x0000,0x00ff,gr20
-
- ; 1 nesr active with the correct address in neear for fr
- inc_gr_immed -1,gr22
- nldbfi @(sp,0),fr20
- test_spr_gr neear3,gr22
- set_fr_iimmed 0x1111,0x1111,fr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_gr_limmed 0xffff,0xffff,gr8
- set_gr_immed 0,gr7
- rstb gr8,@(sp,gr7)
- test_mem_limmed 0xff22,0x2222,gr21
- test_fr_limmed 0x0000,0x00ff,fr20
-
- pass
diff --git a/sim/testsuite/sim/frv/rstbf.cgs b/sim/testsuite/sim/frv/rstbf.cgs
deleted file mode 100644
index e35260a4825..00000000000
--- a/sim/testsuite/sim/frv/rstbf.cgs
+++ /dev/null
@@ -1,76 +0,0 @@
-# frv testcase for rstbf $FRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global add
-add:
- ; No nesr's active
- set_gr_gr sp,gr21
- set_gr_gr gr21,gr22
- set_fr_iimmed 0x1111,0x1111,fr20
- set_gr_limmed 0x1111,0x1111,gr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_gr_immed 0,gr7
- set_fr_iimmed 0xffff,0xffff,fr8
- rstbf fr8,@(sp,gr7)
- test_mem_limmed 0xff22,0x2222,sp
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the incorrect address in neear for gr
- inc_gr_immed 1,gr22
- nldubi @(sp,1),gr20
- test_spr_gr neear0,gr22
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_fr_iimmed 0xffff,0xffff,fr8
- inc_gr_immed 2,gr7
- rstbf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0xff22,gr21
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed -1,gr22
- nldbfi @(sp,0),fr20
- test_spr_gr neear1,gr22
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_fr_iimmed 0xffff,0xffff,fr8
- inc_gr_immed 4,sp
- set_gr_immed -1,gr7
- rstbf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x22ff,gr21
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the correct address in neear for gr
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_fr_iimmed 0xffff,0xffff,fr8
- inc_gr_immed -4,sp
- set_gr_immed 1,gr7
- rstbf fr8,@(sp,gr7)
- test_mem_limmed 0x22ff,0x2222,gr21
- test_gr_limmed 0x0000,0x00ff,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the correct address in neear for fr
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_mem_limmed 0x2222,0x2222,gr21
- set_fr_iimmed 0xffff,0xffff,fr8
- set_gr_immed 0,gr7
- rstbf fr8,@(sp,gr7)
- test_mem_limmed 0xff22,0x2222,gr21
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x0000,0x00ff,fr20
-
- pass
diff --git a/sim/testsuite/sim/frv/rstd.cgs b/sim/testsuite/sim/frv/rstd.cgs
deleted file mode 100644
index bf676351c67..00000000000
--- a/sim/testsuite/sim/frv/rstd.cgs
+++ /dev/null
@@ -1,171 +0,0 @@
-# frv testcase for rstd $GRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global add
-add:
- ; No nesr's active
- set_gr_gr sp,gr20
- set_mem_limmed 0x2222,0x2222,gr20
- set_gr_gr gr20,gr27
- inc_gr_immed -4,gr27
- set_mem_limmed 0x3333,0x3333,gr27
- set_gr_gr gr27,gr26
- inc_gr_immed -4,gr26
- set_mem_limmed 0x4444,0x4444,gr26
- set_gr_gr gr26,gr25
- inc_gr_immed -4,gr25
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_gr gr25,gr24
- inc_gr_immed -4,gr24
- set_mem_limmed 0x6666,0x6666,gr24
- set_gr_gr gr24,gr23
- inc_gr_immed -4,gr23
- set_mem_limmed 0x7777,0x7777,gr23
- set_gr_gr gr23,gr22
- inc_gr_immed -4,gr22
- set_mem_limmed 0x8888,0x8888,gr22
- set_gr_gr gr22,gr21
- inc_gr_immed -4,gr21
- set_mem_limmed 0x9999,0x9999,gr21
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- inc_gr_immed -4,sp
- set_gr_immed 0,gr7
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- rstd gr8,@(sp,gr7)
- test_mem_limmed 0xffff,0xffff,gr20
- test_mem_limmed 0xeeee,0xeeee,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
-
- ; 1 nesr active with the incorrect address in neear for gr
- set_gr_gr sp,gr10
- nlddi @(sp,0),gr40
- test_spr_gr neear0,gr10
- set_mem_limmed 0x2222,0x2222,gr20
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_gr_immed -8,gr7
- rstd gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr20
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0xffff,0xffff,gr26
- test_mem_limmed 0xeeee,0xeeee,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed -8,gr10
- nlddfi @(sp,-8),fr40
- test_spr_gr neear1,gr10
- set_mem_limmed 0x2222,0x2222,gr20
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- inc_gr_immed -8,sp
- set_gr_immed 8,gr7
- rstd gr8,@(sp,gr7)
- test_mem_limmed 0xffff,0xffff,gr20
- test_mem_limmed 0xeeee,0xeeee,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_fr_limmed 0x1111,0x1111,fr40
- test_fr_limmed 0x1111,0x1111,fr41
-
- ; 1 nesr active with the correct address in neear for gr
- inc_gr_immed -8,gr10
- nlddi @(sp,-8),gr40
- test_spr_gr neear2,gr10
- set_mem_limmed 0x2222,0x2222,gr20
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- inc_gr_immed -8,sp
- set_gr_immed 0,gr7
- rstd gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr20
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0xffff,0xffff,gr24
- test_mem_limmed 0xeeee,0xeeee,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_gr_limmed 0xffff,0xffff,gr41
- test_gr_limmed 0xeeee,0xeeee,gr40
-
- ; 1 nesr active with the correct address in neear for fr
- inc_gr_immed -8,gr10
- nlddfi @(sp,-8),fr40
- test_spr_gr neear3,gr10
- set_mem_limmed 0x2222,0x2222,gr20
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_gr_immed -8,gr7
- rstd gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr20
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0xffff,0xffff,gr22
- test_mem_limmed 0xeeee,0xeeee,gr21
- test_fr_limmed 0xffff,0xffff,fr41
- test_fr_limmed 0xeeee,0xeeee,fr40
-
- pass
diff --git a/sim/testsuite/sim/frv/rstdf.cgs b/sim/testsuite/sim/frv/rstdf.cgs
deleted file mode 100644
index 9d0d841c5d4..00000000000
--- a/sim/testsuite/sim/frv/rstdf.cgs
+++ /dev/null
@@ -1,186 +0,0 @@
-# frv testcase for rstdf $FRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global add
-add:
- ; No nesr's active
- set_gr_gr sp,gr20
- set_mem_limmed 0x2222,0x2222,gr20
- set_gr_gr gr20,gr27
- inc_gr_immed -4,gr27
- set_mem_limmed 0x3333,0x3333,gr27
- set_gr_gr gr27,gr26
- inc_gr_immed -4,gr26
- set_mem_limmed 0x4444,0x4444,gr26
- set_gr_gr gr26,gr25
- inc_gr_immed -4,gr25
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_gr gr25,gr24
- inc_gr_immed -4,gr24
- set_mem_limmed 0x6666,0x6666,gr24
- set_gr_gr gr24,gr23
- inc_gr_immed -4,gr23
- set_mem_limmed 0x7777,0x7777,gr23
- set_gr_gr gr23,gr22
- inc_gr_immed -4,gr22
- set_mem_limmed 0x8888,0x8888,gr22
- set_gr_gr gr22,gr21
- inc_gr_immed -4,gr21
- set_mem_limmed 0x9999,0x9999,gr21
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- inc_gr_immed -4,sp
- set_gr_immed 0,gr7
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- rstdf fr8,@(sp,gr7)
- test_mem_limmed 0xffff,0xffff,gr20
- test_mem_limmed 0xeeee,0xeeee,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
- test_fr_limmed 0x1111,0x1111,fr40
- test_fr_limmed 0x1111,0x1111,fr41
-
- ; 1 nesr active with the incorrect address in neear for gr
- set_gr_gr sp,gr10
- inc_gr_immed -16,gr10
- nlddi @(sp,-16),gr40
- test_spr_gr neear0,gr10
- set_mem_limmed 0x2222,0x2222,gr20
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_gr_immed -8,gr7
- rstdf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr20
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0xffff,0xffff,gr26
- test_mem_limmed 0xeeee,0xeeee,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
- test_fr_limmed 0x1111,0x1111,fr40
- test_fr_limmed 0x1111,0x1111,fr41
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed -8,gr10
- nlddfi @(sp,-24),fr40
- test_spr_gr neear1,gr10
- set_mem_limmed 0x2222,0x2222,gr20
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- inc_gr_immed -8,sp
- set_gr_immed 8,gr7
- rstdf fr8,@(sp,gr7)
- test_mem_limmed 0xffff,0xffff,gr20
- test_mem_limmed 0xeeee,0xeeee,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
- test_fr_limmed 0x1111,0x1111,fr40
- test_fr_limmed 0x1111,0x1111,fr41
-
- ; 1 nesr active with the correct address in neear for gr
- set_mem_limmed 0x2222,0x2222,gr20
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- inc_gr_immed -8,sp
- set_gr_immed 0,gr7
- rstdf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr20
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0xffff,0xffff,gr24
- test_mem_limmed 0xeeee,0xeeee,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_gr_limmed 0xffff,0xffff,gr41
- test_gr_limmed 0xeeee,0xeeee,gr40
- test_fr_limmed 0x1111,0x1111,fr41
- test_fr_limmed 0x1111,0x1111,fr40
-
- ; 1 nesr active with the correct address in neear for fr
- set_mem_limmed 0x2222,0x2222,gr20
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_gr_immed -8,gr7
- rstdf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr20
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0xffff,0xffff,gr22
- test_mem_limmed 0xeeee,0xeeee,gr21
- test_gr_limmed 0x1111,0x1111,gr41
- test_gr_limmed 0x1111,0x1111,gr40
- test_fr_limmed 0xffff,0xffff,fr41
- test_fr_limmed 0xeeee,0xeeee,fr40
-
- pass
diff --git a/sim/testsuite/sim/frv/rstf.cgs b/sim/testsuite/sim/frv/rstf.cgs
deleted file mode 100644
index 17a123af26f..00000000000
--- a/sim/testsuite/sim/frv/rstf.cgs
+++ /dev/null
@@ -1,112 +0,0 @@
-# frv testcase for rstf $FRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global add
-add:
- ; No nesr's active
- set_gr_gr sp,gr10
- set_gr_gr sp,gr24
- set_mem_limmed 0x2222,0x2222,gr24
- set_gr_gr gr24,gr27
- inc_gr_immed -4,gr27
- set_mem_limmed 0x3333,0x3333,gr27
- set_gr_gr gr27,gr26
- inc_gr_immed -4,gr26
- set_mem_limmed 0x4444,0x4444,gr26
- set_gr_gr gr26,gr25
- inc_gr_immed -4,gr25
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_gr_immed 0,gr7
- set_fr_iimmed 0xffff,0xffff,fr8
- rstf fr8,@(sp,gr7)
- test_mem_limmed 0xffff,0xffff,gr24
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the incorrect address in neear for gr
- inc_gr_immed -8,gr10
- nldi @(sp,-8),gr20
- test_spr_gr neear0,gr10
- set_mem_limmed 0x2222,0x2222,gr24
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_fr_iimmed 0xffff,0xffff,fr8
- set_gr_immed -4,gr7
- rstf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr24
- test_mem_limmed 0xffff,0xffff,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed -4,gr10
- nldfi @(sp,-12),fr20
- test_spr_gr neear1,gr10
- set_mem_limmed 0x2222,0x2222,gr24
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_fr_iimmed 0xffff,0xffff,fr8
- inc_gr_immed -4,sp
- set_gr_immed 4,gr7
- rstf fr8,@(sp,gr7)
- test_mem_limmed 0xffff,0xffff,gr24
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the correct address in neear for gr
- set_mem_limmed 0x2222,0x2222,gr24
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_fr_iimmed 0xffff,0xffff,fr8
- inc_gr_immed -4,sp
- set_gr_immed 0,gr7
- rstf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr24
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0xffff,0xffff,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_gr_limmed 0xffff,0xffff,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the correct address in neear for fr
- set_mem_limmed 0x2222,0x2222,gr24
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_fr_iimmed 0xffff,0xffff,fr8
- set_gr_immed -4,gr7
- rstf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr24
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0xffff,0xffff,gr25
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0xffff,0xffff,fr20
-
- pass
diff --git a/sim/testsuite/sim/frv/rsth.cgs b/sim/testsuite/sim/frv/rsth.cgs
deleted file mode 100644
index a2b283ef3b2..00000000000
--- a/sim/testsuite/sim/frv/rsth.cgs
+++ /dev/null
@@ -1,83 +0,0 @@
-# frv testcase for rsth $GRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global add
-add:
- ; No nesr's active
- set_gr_gr sp,gr22
- set_mem_limmed 0x2222,0x2222,gr22
- set_gr_gr gr22,gr21
- inc_gr_immed -4,gr21
- set_mem_limmed 0x3333,0x3333,gr21
- set_gr_gr gr22,gr23
- set_gr_limmed 0x1111,0x1111,gr20
- set_gr_immed 0,gr7
- set_gr_limmed 0xffff,0xffff,gr8
- rsth gr8,@(sp,gr7)
- test_mem_limmed 0xffff,0x2222,gr22
- test_mem_limmed 0x3333,0x3333,gr21
- test_gr_limmed 0x1111,0x1111,gr20
-
- ; 1 nesr active with the incorrect address in neear for gr
- nlduhi @(sp,0),gr20
- test_spr_gr neear0,gr23
- set_mem_limmed 0x2222,0x2222,gr22
- set_mem_limmed 0x3333,0x3333,gr21
- set_gr_limmed 0x1111,0x1111,gr20
- set_gr_limmed 0xffff,0xffff,gr8
- set_gr_immed 2,gr7
- rsth gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0xffff,gr22
- test_mem_limmed 0x3333,0x3333,gr21
- test_gr_limmed 0x1111,0x1111,gr20
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed 2,gr23
- nldhfi @(sp,2),fr20
- test_spr_gr neear1,gr23
- set_mem_limmed 0x2222,0x2222,gr22
- set_mem_limmed 0x3333,0x3333,gr21
- set_fr_iimmed 0x1111,0x1111,fr20
- set_gr_limmed 0xffff,0xffff,gr8
- inc_gr_immed 4,sp
- set_gr_immed -4,gr7
- rsth gr8,@(sp,gr7)
- test_mem_limmed 0xffff,0x2222,gr22
- test_mem_limmed 0x3333,0x3333,gr21
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the correct address in neear for gr
- inc_gr_immed -4,gr23
- nlduhi @(sp,-6),gr20
- test_spr_gr neear2,gr23
- set_mem_limmed 0x2222,0x2222,gr22
- set_mem_limmed 0x3333,0x3333,gr21
- set_gr_limmed 0x1111,0x1111,gr20
- set_gr_limmed 0xffff,0xffff,gr8
- inc_gr_immed -4,sp
- set_gr_immed -2,gr7
- rsth gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr22
- test_mem_limmed 0x3333,0xffff,gr21
- test_gr_limmed 0x0000,0xffff,gr20
-
- ; 1 nesr active with the correct address in neear for fr
- inc_gr_immed -2,gr23
- nldhfi @(sp,-4),fr20
- test_spr_gr neear3,gr23
- set_mem_limmed 0x2222,0x2222,gr22
- set_mem_limmed 0x3333,0x3333,gr21
- set_fr_iimmed 0x1111,0x1111,fr20
- set_gr_limmed 0xffff,0xffff,gr8
- set_gr_immed -4,gr7
- rsth gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr22
- test_mem_limmed 0xffff,0x3333,gr21
- test_fr_limmed 0x0000,0xffff,fr20
-
- pass
diff --git a/sim/testsuite/sim/frv/rsthf.cgs b/sim/testsuite/sim/frv/rsthf.cgs
deleted file mode 100644
index 06adb97fd00..00000000000
--- a/sim/testsuite/sim/frv/rsthf.cgs
+++ /dev/null
@@ -1,87 +0,0 @@
-# frv testcase for rsthf $FRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global add
-add:
- ; No nesr's active
- set_gr_gr sp,gr22
- set_mem_limmed 0x2222,0x2222,gr22
- set_gr_gr gr22,gr21
- inc_gr_immed -4,gr21
- set_mem_limmed 0x3333,0x3333,gr21
- set_gr_gr gr22,gr23
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_gr_immed 0,gr7
- set_fr_iimmed 0xffff,0xffff,fr8
- rsthf fr8,@(sp,gr7)
- test_mem_limmed 0xffff,0x2222,gr22
- test_mem_limmed 0x3333,0x3333,gr21
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the incorrect address in neear for gr
- inc_gr_immed -2,gr23
- nlduhi @(sp,-2),gr20
- test_spr_gr neear0,gr23
- set_mem_limmed 0x2222,0x2222,gr22
- set_mem_limmed 0x3333,0x3333,gr21
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0xffff,0xffff,fr8
- set_gr_immed 2,gr7
- rsthf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0xffff,gr22
- test_mem_limmed 0x3333,0x3333,gr21
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed -2,gr23
- nldhfi @(sp,-4),fr20
- test_spr_gr neear1,gr23
- set_mem_limmed 0x2222,0x2222,gr22
- set_mem_limmed 0x3333,0x3333,gr21
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_fr_iimmed 0xffff,0xffff,fr8
- inc_gr_immed 4,sp
- set_gr_immed -4,gr7
- rsthf fr8,@(sp,gr7)
- test_mem_limmed 0xffff,0x2222,gr22
- test_mem_limmed 0x3333,0x3333,gr21
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the correct address in neear for gr
- set_mem_limmed 0x2222,0x2222,gr22
- set_mem_limmed 0x3333,0x3333,gr21
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_fr_iimmed 0xffff,0xffff,fr8
- inc_gr_immed -4,sp
- set_gr_immed -2,gr7
- rsthf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr22
- test_mem_limmed 0x3333,0xffff,gr21
- test_gr_limmed 0x0000,0xffff,gr20
- test_fr_limmed 0x1111,0x1111,fr20
-
- ; 1 nesr active with the correct address in neear for fr
- set_mem_limmed 0x2222,0x2222,gr22
- set_mem_limmed 0x3333,0x3333,gr21
- set_gr_limmed 0x1111,0x1111,gr20
- set_fr_iimmed 0x1111,0x1111,fr20
- set_fr_iimmed 0xffff,0xffff,fr8
- set_gr_immed -4,gr7
- rsthf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr22
- test_mem_limmed 0xffff,0x3333,gr21
- test_gr_limmed 0x1111,0x1111,gr20
- test_fr_limmed 0x0000,0xffff,fr20
-
- pass
diff --git a/sim/testsuite/sim/frv/rstq.cgs b/sim/testsuite/sim/frv/rstq.cgs
deleted file mode 100644
index 190c954e4e8..00000000000
--- a/sim/testsuite/sim/frv/rstq.cgs
+++ /dev/null
@@ -1,297 +0,0 @@
-# frv testcase for rstq $GRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global add
-add:
- ; No nesr's active
- set_gr_gr sp,gr6
- set_mem_limmed 0x2222,0x2222,gr6
- set_gr_gr gr6,gr27
- inc_gr_immed -4,gr27
- set_mem_limmed 0x3333,0x3333,gr27
- set_gr_gr gr27,gr26
- inc_gr_immed -4,gr26
- set_mem_limmed 0x4444,0x4444,gr26
- set_gr_gr gr26,gr25
- inc_gr_immed -4,gr25
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_gr gr25,gr24
- inc_gr_immed -4,gr24
- set_mem_limmed 0x6666,0x6666,gr24
- set_gr_gr gr24,gr23
- inc_gr_immed -4,gr23
- set_mem_limmed 0x7777,0x7777,gr23
- set_gr_gr gr23,gr22
- inc_gr_immed -4,gr22
- set_mem_limmed 0x8888,0x8888,gr22
- set_gr_gr gr22,gr21
- inc_gr_immed -4,gr21
- set_mem_limmed 0x9999,0x9999,gr21
- set_gr_gr gr21,gr20
- inc_gr_immed -4,gr20
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_gr_gr gr20,gr19
- inc_gr_immed -4,gr19
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_gr_gr gr19,gr18
- inc_gr_immed -4,gr18
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_gr_gr gr18,gr17
- inc_gr_immed -4,gr17
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_gr_gr gr17,gr16
- inc_gr_immed -4,gr16
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_gr_gr gr16,gr15
- inc_gr_immed -4,gr15
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_gr_gr gr15,gr14
- inc_gr_immed -4,gr14
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_gr_gr gr14,gr13
- inc_gr_immed -4,gr13
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_gr_limmed 0x1111,0x1111,gr42
- set_gr_limmed 0x1111,0x1111,gr43
- inc_gr_immed -12,sp
- set_gr_immed 0,gr7
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- set_gr_limmed 0xcccc,0xcccc,gr10
- set_gr_limmed 0xdddd,0xdddd,gr11
- rstq gr8,@(sp,gr7)
- test_mem_limmed 0xdddd,0xdddd,gr6
- test_mem_limmed 0xcccc,0xcccc,gr27
- test_mem_limmed 0xffff,0xffff,gr26
- test_mem_limmed 0xeeee,0xeeee,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_mem_limmed 0xaaaa,0xaaaa,gr20
- test_mem_limmed 0xbbbb,0xbbbb,gr19
- test_mem_limmed 0xcccc,0xcccc,gr18
- test_mem_limmed 0xdddd,0xdddd,gr17
- test_mem_limmed 0xeeee,0xeeee,gr16
- test_mem_limmed 0xf0f0,0xf0f0,gr15
- test_mem_limmed 0xf1f1,0xf1f1,gr14
- test_mem_limmed 0xf2f2,0xf2f2,gr13
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
- test_gr_limmed 0x1111,0x1111,gr42
- test_gr_limmed 0x1111,0x1111,gr43
-
- ; 1 nesr active with the incorrect address in neear for gr
- set_gr_gr sp,gr12
- nldq @(sp,gr0),gr40
- test_spr_gr neear0,gr12
- set_mem_limmed 0x2222,0x2222,gr6
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- set_gr_limmed 0xcccc,0xcccc,gr10
- set_gr_limmed 0xdddd,0xdddd,gr11
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_gr_limmed 0x1111,0x1111,gr42
- set_gr_limmed 0x1111,0x1111,gr43
- set_gr_immed -16,gr7
- rstq gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr6
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0xdddd,0xdddd,gr24
- test_mem_limmed 0xcccc,0xcccc,gr23
- test_mem_limmed 0xffff,0xffff,gr22
- test_mem_limmed 0xeeee,0xeeee,gr21
- test_mem_limmed 0xaaaa,0xaaaa,gr20
- test_mem_limmed 0xbbbb,0xbbbb,gr19
- test_mem_limmed 0xcccc,0xcccc,gr18
- test_mem_limmed 0xdddd,0xdddd,gr17
- test_mem_limmed 0xeeee,0xeeee,gr16
- test_mem_limmed 0xf0f0,0xf0f0,gr15
- test_mem_limmed 0xf1f1,0xf1f1,gr14
- test_mem_limmed 0xf2f2,0xf2f2,gr13
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
- test_gr_limmed 0x1111,0x1111,gr42
- test_gr_limmed 0x1111,0x1111,gr43
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed -16,gr12
- nlddfi @(sp,-16),fr40
- test_spr_gr neear1,gr12
- set_mem_limmed 0x2222,0x2222,gr6
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- set_gr_limmed 0xcccc,0xcccc,gr10
- set_gr_limmed 0xdddd,0xdddd,gr11
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_fr_iimmed 0x1111,0x1111,fr42
- set_fr_iimmed 0x1111,0x1111,fr43
- inc_gr_immed -16,sp
- set_gr_immed 16,gr7
- rstq gr8,@(sp,gr7)
- test_mem_limmed 0xdddd,0xdddd,gr6
- test_mem_limmed 0xcccc,0xcccc,gr27
- test_mem_limmed 0xffff,0xffff,gr26
- test_mem_limmed 0xeeee,0xeeee,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_mem_limmed 0xaaaa,0xaaaa,gr20
- test_mem_limmed 0xbbbb,0xbbbb,gr19
- test_mem_limmed 0xcccc,0xcccc,gr18
- test_mem_limmed 0xdddd,0xdddd,gr17
- test_mem_limmed 0xeeee,0xeeee,gr16
- test_mem_limmed 0xf0f0,0xf0f0,gr15
- test_mem_limmed 0xf1f1,0xf1f1,gr14
- test_mem_limmed 0xf2f2,0xf2f2,gr13
- test_fr_limmed 0x1111,0x1111,fr40
- test_fr_limmed 0x1111,0x1111,fr41
- test_fr_limmed 0x1111,0x1111,fr42
- test_fr_limmed 0x1111,0x1111,fr43
-
- ; 1 nesr active with the correct address in neear for gr
- inc_gr_immed -16,gr12
- nlddi @(sp,-16),gr40
- test_spr_gr neear2,gr12
- set_mem_limmed 0x2222,0x2222,gr6
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- set_gr_limmed 0xcccc,0xcccc,gr10
- set_gr_limmed 0xdddd,0xdddd,gr11
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_gr_limmed 0x1111,0x1111,gr42
- set_gr_limmed 0x1111,0x1111,gr43
- inc_gr_immed -16,sp
- set_gr_immed 0,gr7
- rstq gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr6
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_mem_limmed 0xdddd,0xdddd,gr20
- test_mem_limmed 0xcccc,0xcccc,gr19
- test_mem_limmed 0xffff,0xffff,gr18
- test_mem_limmed 0xeeee,0xeeee,gr17
- test_mem_limmed 0xeeee,0xeeee,gr16
- test_mem_limmed 0xf0f0,0xf0f0,gr15
- test_mem_limmed 0xf1f1,0xf1f1,gr14
- test_mem_limmed 0xf2f2,0xf2f2,gr13
- test_gr_limmed 0xeeee,0xeeee,gr40
- test_gr_limmed 0xffff,0xffff,gr41
- test_gr_limmed 0xcccc,0xcccc,gr42
- test_gr_limmed 0xdddd,0xdddd,gr43
-
- ; 1 nesr active with the correct address in neear for fr
- inc_gr_immed -16,gr12
- nlddfi @(sp,-16),fr40
- test_spr_gr neear3,gr12
- set_mem_limmed 0x2222,0x2222,gr6
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_gr_limmed 0xeeee,0xeeee,gr8
- set_gr_limmed 0xffff,0xffff,gr9
- set_gr_limmed 0xcccc,0xcccc,gr10
- set_gr_limmed 0xdddd,0xdddd,gr11
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_fr_iimmed 0x1111,0x1111,fr42
- set_fr_iimmed 0x1111,0x1111,fr43
- set_gr_immed -16,gr7
- rstq gr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr6
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_mem_limmed 0xaaaa,0xaaaa,gr20
- test_mem_limmed 0xbbbb,0xbbbb,gr19
- test_mem_limmed 0xcccc,0xcccc,gr18
- test_mem_limmed 0xdddd,0xdddd,gr17
- test_mem_limmed 0xdddd,0xdddd,gr16
- test_mem_limmed 0xcccc,0xcccc,gr15
- test_mem_limmed 0xffff,0xffff,gr14
- test_mem_limmed 0xeeee,0xeeee,gr13
- test_fr_limmed 0xeeee,0xeeee,fr40
- test_fr_limmed 0xffff,0xffff,fr41
- test_fr_limmed 0xcccc,0xcccc,fr42
- test_fr_limmed 0xdddd,0xdddd,fr43
-
- pass
diff --git a/sim/testsuite/sim/frv/rstqf.cgs b/sim/testsuite/sim/frv/rstqf.cgs
deleted file mode 100644
index 72fd04a7009..00000000000
--- a/sim/testsuite/sim/frv/rstqf.cgs
+++ /dev/null
@@ -1,333 +0,0 @@
-# frv testcase for rstqf $FRk,@($GRi,$GRj)
-# mach: frv
-# as(frv): -mcpu=frv
-
- .include "testutils.inc"
-
- start
-
- .global add
-add:
- ; No nesr's active
- set_gr_gr sp,gr12
- set_mem_limmed 0x2222,0x2222,gr12
- set_gr_gr gr12,gr27
- inc_gr_immed -4,gr27
- set_mem_limmed 0x3333,0x3333,gr27
- set_gr_gr gr27,gr26
- inc_gr_immed -4,gr26
- set_mem_limmed 0x4444,0x4444,gr26
- set_gr_gr gr26,gr25
- inc_gr_immed -4,gr25
- set_mem_limmed 0x5555,0x5555,gr25
- set_gr_gr gr25,gr24
- inc_gr_immed -4,gr24
- set_mem_limmed 0x6666,0x6666,gr24
- set_gr_gr gr24,gr23
- inc_gr_immed -4,gr23
- set_mem_limmed 0x7777,0x7777,gr23
- set_gr_gr gr23,gr22
- inc_gr_immed -4,gr22
- set_mem_limmed 0x8888,0x8888,gr22
- set_gr_gr gr22,gr21
- inc_gr_immed -4,gr21
- set_mem_limmed 0x9999,0x9999,gr21
- set_gr_gr gr21,gr20
- inc_gr_immed -4,gr20
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_gr_gr gr20,gr19
- inc_gr_immed -4,gr19
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_gr_gr gr19,gr18
- inc_gr_immed -4,gr18
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_gr_gr gr18,gr17
- inc_gr_immed -4,gr17
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_gr_gr gr17,gr16
- inc_gr_immed -4,gr16
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_gr_gr gr16,gr15
- inc_gr_immed -4,gr15
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_gr_gr gr15,gr14
- inc_gr_immed -4,gr14
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_gr_gr gr14,gr13
- inc_gr_immed -4,gr13
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_gr_limmed 0x1111,0x1111,gr42
- set_gr_limmed 0x1111,0x1111,gr43
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_fr_iimmed 0x1111,0x1111,fr42
- set_fr_iimmed 0x1111,0x1111,fr43
- inc_gr_immed -12,sp
- set_gr_immed 0,gr7
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- set_fr_iimmed 0xcccc,0xcccc,fr10
- set_fr_iimmed 0xdddd,0xdddd,fr11
- rstqf fr8,@(sp,gr7)
- test_mem_limmed 0xdddd,0xdddd,gr12
- test_mem_limmed 0xcccc,0xcccc,gr27
- test_mem_limmed 0xffff,0xffff,gr26
- test_mem_limmed 0xeeee,0xeeee,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_mem_limmed 0xaaaa,0xaaaa,gr20
- test_mem_limmed 0xbbbb,0xbbbb,gr19
- test_mem_limmed 0xcccc,0xcccc,gr18
- test_mem_limmed 0xdddd,0xdddd,gr17
- test_mem_limmed 0xeeee,0xeeee,gr16
- test_mem_limmed 0xf0f0,0xf0f0,gr15
- test_mem_limmed 0xf1f1,0xf1f1,gr14
- test_mem_limmed 0xf2f2,0xf2f2,gr13
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
- test_gr_limmed 0x1111,0x1111,gr42
- test_gr_limmed 0x1111,0x1111,gr43
- test_fr_limmed 0x1111,0x1111,fr40
- test_fr_limmed 0x1111,0x1111,fr41
- test_fr_limmed 0x1111,0x1111,fr42
- test_fr_limmed 0x1111,0x1111,fr43
-
- ; 1 nesr active with the incorrect address in neear for gr
- set_gr_gr sp,gr10
- inc_gr_immed -32,gr10
- set_gr_immed -32,gr9
- nldq @(sp,gr9),gr40
- test_spr_gr neear0,gr10
- set_mem_limmed 0x2222,0x2222,gr12
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- set_fr_iimmed 0xcccc,0xcccc,fr10
- set_fr_iimmed 0xdddd,0xdddd,fr11
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_gr_limmed 0x1111,0x1111,gr42
- set_gr_limmed 0x1111,0x1111,gr43
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_fr_iimmed 0x1111,0x1111,fr42
- set_fr_iimmed 0x1111,0x1111,fr43
- set_gr_immed -16,gr7
- rstqf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr12
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0xdddd,0xdddd,gr24
- test_mem_limmed 0xcccc,0xcccc,gr23
- test_mem_limmed 0xffff,0xffff,gr22
- test_mem_limmed 0xeeee,0xeeee,gr21
- test_mem_limmed 0xaaaa,0xaaaa,gr20
- test_mem_limmed 0xbbbb,0xbbbb,gr19
- test_mem_limmed 0xcccc,0xcccc,gr18
- test_mem_limmed 0xdddd,0xdddd,gr17
- test_mem_limmed 0xeeee,0xeeee,gr16
- test_mem_limmed 0xf0f0,0xf0f0,gr15
- test_mem_limmed 0xf1f1,0xf1f1,gr14
- test_mem_limmed 0xf2f2,0xf2f2,gr13
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
- test_gr_limmed 0x1111,0x1111,gr42
- test_gr_limmed 0x1111,0x1111,gr43
- test_fr_limmed 0x1111,0x1111,fr40
- test_fr_limmed 0x1111,0x1111,fr41
- test_fr_limmed 0x1111,0x1111,fr42
- test_fr_limmed 0x1111,0x1111,fr43
-
- ; 1 nesr active with the incorrect address in neear for fr
- inc_gr_immed -16,gr10
- nlddfi @(sp,-48),fr40
- test_spr_gr neear1,gr10
- set_mem_limmed 0x2222,0x2222,gr12
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- set_fr_iimmed 0xcccc,0xcccc,fr10
- set_fr_iimmed 0xdddd,0xdddd,fr11
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_gr_limmed 0x1111,0x1111,gr42
- set_gr_limmed 0x1111,0x1111,gr43
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_fr_iimmed 0x1111,0x1111,fr42
- set_fr_iimmed 0x1111,0x1111,fr43
- inc_gr_immed -16,sp
- set_gr_immed 16,gr7
- rstqf fr8,@(sp,gr7)
- test_mem_limmed 0xdddd,0xdddd,gr12
- test_mem_limmed 0xcccc,0xcccc,gr27
- test_mem_limmed 0xffff,0xffff,gr26
- test_mem_limmed 0xeeee,0xeeee,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_mem_limmed 0xaaaa,0xaaaa,gr20
- test_mem_limmed 0xbbbb,0xbbbb,gr19
- test_mem_limmed 0xcccc,0xcccc,gr18
- test_mem_limmed 0xdddd,0xdddd,gr17
- test_mem_limmed 0xeeee,0xeeee,gr16
- test_mem_limmed 0xf0f0,0xf0f0,gr15
- test_mem_limmed 0xf1f1,0xf1f1,gr14
- test_mem_limmed 0xf2f2,0xf2f2,gr13
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
- test_gr_limmed 0x1111,0x1111,gr42
- test_gr_limmed 0x1111,0x1111,gr43
- test_fr_limmed 0x1111,0x1111,fr40
- test_fr_limmed 0x1111,0x1111,fr41
- test_fr_limmed 0x1111,0x1111,fr42
- test_fr_limmed 0x1111,0x1111,fr43
-
- ; 1 nesr active with the correct address in neear for gr
- set_mem_limmed 0x2222,0x2222,gr12
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- set_fr_iimmed 0xcccc,0xcccc,fr10
- set_fr_iimmed 0xdddd,0xdddd,fr11
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_gr_limmed 0x1111,0x1111,gr42
- set_gr_limmed 0x1111,0x1111,gr43
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_fr_iimmed 0x1111,0x1111,fr42
- set_fr_iimmed 0x1111,0x1111,fr43
- inc_gr_immed -16,sp
- set_gr_immed 0,gr7
- rstqf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr12
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_mem_limmed 0xdddd,0xdddd,gr20
- test_mem_limmed 0xcccc,0xcccc,gr19
- test_mem_limmed 0xffff,0xffff,gr18
- test_mem_limmed 0xeeee,0xeeee,gr17
- test_mem_limmed 0xeeee,0xeeee,gr16
- test_mem_limmed 0xf0f0,0xf0f0,gr15
- test_mem_limmed 0xf1f1,0xf1f1,gr14
- test_mem_limmed 0xf2f2,0xf2f2,gr13
- test_gr_limmed 0xeeee,0xeeee,gr40
- test_gr_limmed 0xffff,0xffff,gr41
- test_gr_limmed 0xcccc,0xcccc,gr42
- test_gr_limmed 0xdddd,0xdddd,gr43
- test_fr_limmed 0x1111,0x1111,fr40
- test_fr_limmed 0x1111,0x1111,fr41
- test_fr_limmed 0x1111,0x1111,fr42
- test_fr_limmed 0x1111,0x1111,fr43
-
- ; 1 nesr active with the correct address in neear for fr
- set_mem_limmed 0x2222,0x2222,gr12
- set_mem_limmed 0x3333,0x3333,gr27
- set_mem_limmed 0x4444,0x4444,gr26
- set_mem_limmed 0x5555,0x5555,gr25
- set_mem_limmed 0x6666,0x6666,gr24
- set_mem_limmed 0x7777,0x7777,gr23
- set_mem_limmed 0x8888,0x8888,gr22
- set_mem_limmed 0x9999,0x9999,gr21
- set_mem_limmed 0xaaaa,0xaaaa,gr20
- set_mem_limmed 0xbbbb,0xbbbb,gr19
- set_mem_limmed 0xcccc,0xcccc,gr18
- set_mem_limmed 0xdddd,0xdddd,gr17
- set_mem_limmed 0xeeee,0xeeee,gr16
- set_mem_limmed 0xf0f0,0xf0f0,gr15
- set_mem_limmed 0xf1f1,0xf1f1,gr14
- set_mem_limmed 0xf2f2,0xf2f2,gr13
- set_fr_iimmed 0xeeee,0xeeee,fr8
- set_fr_iimmed 0xffff,0xffff,fr9
- set_fr_iimmed 0xcccc,0xcccc,fr10
- set_fr_iimmed 0xdddd,0xdddd,fr11
- set_gr_limmed 0x1111,0x1111,gr40
- set_gr_limmed 0x1111,0x1111,gr41
- set_gr_limmed 0x1111,0x1111,gr42
- set_gr_limmed 0x1111,0x1111,gr43
- set_fr_iimmed 0x1111,0x1111,fr40
- set_fr_iimmed 0x1111,0x1111,fr41
- set_fr_iimmed 0x1111,0x1111,fr42
- set_fr_iimmed 0x1111,0x1111,fr43
- set_gr_immed -16,gr7
- rstqf fr8,@(sp,gr7)
- test_mem_limmed 0x2222,0x2222,gr12
- test_mem_limmed 0x3333,0x3333,gr27
- test_mem_limmed 0x4444,0x4444,gr26
- test_mem_limmed 0x5555,0x5555,gr25
- test_mem_limmed 0x6666,0x6666,gr24
- test_mem_limmed 0x7777,0x7777,gr23
- test_mem_limmed 0x8888,0x8888,gr22
- test_mem_limmed 0x9999,0x9999,gr21
- test_mem_limmed 0xaaaa,0xaaaa,gr20
- test_mem_limmed 0xbbbb,0xbbbb,gr19
- test_mem_limmed 0xcccc,0xcccc,gr18
- test_mem_limmed 0xdddd,0xdddd,gr17
- test_mem_limmed 0xdddd,0xdddd,gr16
- test_mem_limmed 0xcccc,0xcccc,gr15
- test_mem_limmed 0xffff,0xffff,gr14
- test_mem_limmed 0xeeee,0xeeee,gr13
- test_gr_limmed 0x1111,0x1111,gr40
- test_gr_limmed 0x1111,0x1111,gr41
- test_gr_limmed 0x1111,0x1111,gr42
- test_gr_limmed 0x1111,0x1111,gr43
- test_fr_limmed 0xeeee,0xeeee,fr40
- test_fr_limmed 0xffff,0xffff,fr41
- test_fr_limmed 0xcccc,0xcccc,fr42
- test_fr_limmed 0xdddd,0xdddd,fr43
-
- pass
diff --git a/src-release b/src-release
index 403ce147c5c..4fec631212c 100644
--- a/src-release
+++ b/src-release
@@ -208,11 +208,14 @@ do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
-rm -f $(PACKAGE)-$(VER)
ln -s proto-toplev $(PACKAGE)-$(VER)
+CVS_NAMES= \( -name CVS -o -name '.cvsignore' \)
+
.PHONY: do-tar
do-tar:
echo "==> Making $(PACKAGE)-$(VER).tar"
-rm -f $(PACKAGE)-$(VER).tar
- find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
+ find $(PACKAGE)-$(VER) -follow $(CVS_NAMES) -prune \
+ -o -type f -print \
| tar cTfh - $(PACKAGE)-$(VER).tar
.PHONY: do-bz2
@@ -224,7 +227,8 @@ do-bz2:
.PHONY: do-md5sum
do-md5sum:
echo "==> Adding md5 checksum to top-level directory"
- cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
+ cd proto-toplev && find * -follow $(CVS_NAMES) -prune \
+ -o -type f -print \
| xargs $(MD5PROG) > ../md5.sum
mv md5.sum proto-toplev
diff --git a/texinfo/texinfo.tex b/texinfo/texinfo.tex
index 555a07707ab..6f322ea17b3 100644
--- a/texinfo/texinfo.tex
+++ b/texinfo/texinfo.tex
@@ -3,10 +3,11 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2003-02-03.16}
+\def\texinfoversion{2004-02-19.09}
%
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
-% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+% Foundation, Inc.
%
% This texinfo.tex file is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
@@ -23,23 +24,18 @@
% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
% Boston, MA 02111-1307, USA.
%
-% In other words, you are welcome to use, share and improve this program.
-% You are forbidden to forbid anyone else to use, share and improve
-% what you give them. Help stamp out software-hoarding!
-%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction. (This has been our intent since Texinfo was invented.)
+%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
-% ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex
-% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
+% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
% ftp://tug.org/tex/texinfo.tex
-% (and all CTAN mirrors, see http://www.ctan.org),
-% and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
-%
-% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
-%
-% The texinfo.tex in any given Texinfo distribution could well be out
+% (and all CTAN mirrors, see http://www.ctan.org).
+% The texinfo.tex in any given distribution could well be out
% of date, so if that's what you're using, please check.
-%
+%
% Send bug reports to bug-texinfo@gnu.org. Please include including a
% complete document in each bug report with which we can reproduce the
% problem. Patches are, of course, greatly appreciated.
@@ -55,10 +51,13 @@
% The extra TeX runs get the cross-reference information correct.
% Sometimes one run after texindex suffices, and sometimes you need more
% than two; texi2dvi does it as many times as necessary.
-%
+%
% It is possible to adapt texinfo.tex for other languages, to some
% extent. You can get the existing language-specific files from the
% full Texinfo distribution.
+%
+% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+
\message{Loading texinfo [version \texinfoversion]:}
@@ -71,11 +70,11 @@
\message{Basics,}
\chardef\other=12
-% We never want plain's outer \+ definition in Texinfo.
+% We never want plain's \outer definition of \+ in Texinfo.
% For @tex, we can use \tabalign.
\let\+ = \relax
-% Save some parts of plain tex whose names we will redefine.
+% Save some plain tex macros whose names we will redefine.
\let\ptexb=\b
\let\ptexbullet=\bullet
\let\ptexc=\c
@@ -85,13 +84,18 @@
\let\ptexend=\end
\let\ptexequiv=\equiv
\let\ptexexclam=\!
+\let\ptexfootnote=\footnote
\let\ptexgtr=>
\let\ptexhat=^
\let\ptexi=\i
+\let\ptexindent=\indent
+\let\ptexnoindent=\noindent
+\let\ptexinsert=\insert
\let\ptexlbrace=\{
\let\ptexless=<
\let\ptexplus=+
\let\ptexrbrace=\}
+\let\ptexslash=\/
\let\ptexstar=\*
\let\ptext=\t
@@ -99,6 +103,15 @@
% starts a new line in the output.
\newlinechar = `^^J
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Pre-3.0.
+\else
+ \def\linenumber{l.\the\inputlineno:\space}
+\fi
+
% Set up fixed words for English if not already set.
\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
@@ -137,42 +150,79 @@
\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
-\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
-\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
% In some macros, we cannot use the `\? notation---the left quote is
% in some cases the escape char.
\chardef\colonChar = `\:
\chardef\commaChar = `\,
\chardef\dotChar = `\.
-\chardef\equalChar = `\=
\chardef\exclamChar= `\!
\chardef\questChar = `\?
\chardef\semiChar = `\;
-\chardef\spaceChar = `\ %
\chardef\underChar = `\_
+\chardef\spaceChar = `\ %
+\chardef\spacecat = 10
+\def\spaceisspace{\catcode\spaceChar=\spacecat}
+
% Ignore a token.
%
\def\gobble#1{}
-% True if #1 is the empty string, i.e., called like `\ifempty{}'.
-%
-\def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}%
-\def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}%
+% The following is used inside several \edef's.
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
% Hyphenation fixes.
-\hyphenation{ap-pen-dix}
-\hyphenation{mini-buf-fer mini-buf-fers}
-\hyphenation{eshell}
-\hyphenation{white-space}
+\hyphenation{
+ Flor-i-da Ghost-script Ghost-view Mac-OS ap-pen-dix bit-map bit-maps
+ data-base data-bases eshell fall-ing half-way long-est man-u-script
+ man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
+ par-a-digms rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
+ stand-alone strong-est time-stamp time-stamps which-ever white-space
+ wide-spread wrap-around
+}
% Margin to add to right of even pages, to left of odd pages.
\newdimen\bindingoffset
\newdimen\normaloffset
\newdimen\pagewidth \newdimen\pageheight
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
% Sometimes it is convenient to have everything in the transcript file
% and nothing on the terminal. We don't just call \tracingall here,
% since that produces some useless output on the terminal. We also make
@@ -197,12 +247,12 @@
\tracingassigns1
\fi
\tracingcommands3 % 3 gives us more in etex
- \errorcontextlines\maxdimen
+ \errorcontextlines16
}%
% add check for \lastpenalty to plain's definitions. If the last thing
% we did was a \nobreak, we don't want to insert more space.
-%
+%
\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
\removelastskip\penalty-50\smallskip\fi\fi}
\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
@@ -255,7 +305,7 @@
% the page break happens to be in the middle of an example.
\shipout\vbox{%
% Do this early so pdf references go to the beginning of the page.
- \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
+ \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
%
\ifcropmarks \vbox to \outervsize\bgroup
\hsize = \outerhsize
@@ -336,132 +386,162 @@
% the input line (except we remove a trailing comment). #1 should be a
% macro which expects an ordinary undelimited TeX argument.
%
-\def\parsearg#1{%
- \let\next = #1%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+ \def\next{#2}%
\begingroup
\obeylines
- \futurelet\temp\parseargx
-}
-
-% If the next token is an obeyed space (from an @example environment or
-% the like), remove it and recurse. Otherwise, we're done.
-\def\parseargx{%
- % \obeyedspace is defined far below, after the definition of \sepspaces.
- \ifx\obeyedspace\temp
- \expandafter\parseargdiscardspace
- \else
- \expandafter\parseargline
- \fi
+ \spaceisspace
+ #1%
+ \parseargline\empty% Insert the \empty token, see \finishparsearg below.
}
-% Remove a single space (as the delimiter token to the macro call).
-{\obeyspaces %
- \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
-
{\obeylines %
\gdef\parseargline#1^^M{%
\endgroup % End of the group started in \parsearg.
- %
- % First remove any @c comment, then any @comment.
- % Result of each macro is put in \toks0.
- \argremovec #1\c\relax %
- \expandafter\argremovecomment \the\toks0 \comment\relax %
- %
- % Call the caller's macro, saved as \next in \parsearg.
- \expandafter\next\expandafter{\the\toks0}%
+ \argremovecomment #1\comment\ArgTerm%
}%
}
-% Since all \c{,omment} does is throw away the argument, we can let TeX
-% do that for us. The \relax here is matched by the \relax in the call
-% in \parseargline; it could be more or less anything, its purpose is
-% just to delimit the argument to the \c.
-\def\argremovec#1\c#2\relax{\toks0 = {#1}}
-\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
+% First remove any @comment, then any @c comment.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
-% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
+% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
+%
+% \argremovec might leave us with trailing space, e.g.,
% @end itemize @c foo
-% will have two active spaces as part of the argument with the
-% `itemize'. Here we remove all active spaces from #1, and assign the
-% result to \toks0.
-%
-% This loses if there are any *other* active characters besides spaces
-% in the argument -- _ ^ +, for example -- since they get expanded.
-% Fortunately, Texinfo does not define any such commands. (If it ever
-% does, the catcode of the characters in questionwill have to be changed
-% here.) But this means we cannot call \removeactivespaces as part of
-% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
-% that \parsearg gets might well have any character at all in it.
-%
-\def\removeactivespaces#1{%
- \begingroup
- \ignoreactivespaces
- \edef\temp{#1}%
- \global\toks0 = \expandafter{\temp}%
- \endgroup
+% This space token undergoes the same procedure and is eventually removed
+% by \finishparsearg.
+%
+\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
+\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
+\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
+ \def\temp{#3}%
+ \ifx\temp\empty
+ % We cannot use \next here, as it holds the macro to run;
+ % thus we reuse \temp.
+ \let\temp\finishparsearg
+ \else
+ \let\temp\argcheckspaces
+ \fi
+ % Put the space token in:
+ \temp#1 #3\ArgTerm
}
-% Change the active space to expand to nothing.
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it now,
+% just before passing the control to \next.
+% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
+% either the null string, or it ends with \^^M---thus there is no danger
+% that a pair of braces would be stripped.
%
-\begingroup
+% But first, we have to remove the trailing space token.
+%
+\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}}
+
+% \parseargdef\foo{...}
+% is roughly equivalent to
+% \def\foo{\parsearg\Xfoo}
+% \def\Xfoo#1{...}
+%
+% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
+% favourite TeX trick. --kasal, 16nov03
+
+\def\parseargdef#1{%
+ \expandafter \doparseargdef \csname\string#1\endcsname #1%
+}
+\def\doparseargdef#1#2{%
+ \def#2{\parsearg#1}%
+ \def#1##1%
+}
+
+% Several utility definitions with active space:
+{
\obeyspaces
- \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
-\endgroup
+ \gdef\obeyedspace{ }
+
+ % Make each space character in the input produce a normal interword
+ % space in the output. Don't allow a line break at this space, as this
+ % is used only in environments like @example, where each line of input
+ % should produce a line of output anyway.
+ %
+ \gdef\sepspaces{\obeyspaces\let =\tie}
+
+ % If an index command is used in an @example environment, any spaces
+ % therein should become regular spaces in the raw index file, not the
+ % expansion of \tie (\leavevmode \penalty \@M \ ).
+ \gdef\unsepspaces{\let =\space}
+}
\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
-%% These are used to keep @begin/@end levels from running away
-%% Call \inENV within environments (after a \begingroup)
-\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
-\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment; press RETURN to continue}
-\endgroup\fi} % This is not perfect, but it should reduce lossage
+% Define the framework for environments in texinfo.tex. It's used like this:
+%
+% \envdef\foo{...}
+% \def\Efoo{...}
+%
+% It's the responsibility of \envdef to insert \begingroup before the
+% actual body; @end closes the group after calling \Efoo. \envdef also
+% defines \thisenv, so the current environment is known; @end checks
+% whether the environment name matches. The \checkenv macro can also be
+% used to check whether the current environment is the one expected.
+%
+% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
+% are not treated as enviroments; they don't open a group. (The
+% implementation of @end takes care not to call \endgroup in this
+% special case.)
-% @begin foo is the same as @foo, for now.
-\newhelp\EMsimple{Press RETURN to continue.}
-\outer\def\begin{\parsearg\beginxxx}
+% At runtime, environments start with this:
+\def\startenvironment#1{\begingroup\def\thisenv{#1}}
+% initialize
+\let\thisenv\empty
-\def\beginxxx #1{%
-\expandafter\ifx\csname #1\endcsname\relax
-{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
-\csname #1\endcsname\fi}
+% ... but they get defined via ``\envdef\foo{...}'':
+\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
+\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
-% @end foo executes the definition of \Efoo.
-%
-\def\end{\parsearg\endxxx}
-\def\endxxx #1{%
- \removeactivespaces{#1}%
- \edef\endthing{\the\toks0}%
- %
- \expandafter\ifx\csname E\endthing\endcsname\relax
- \expandafter\ifx\csname \endthing\endcsname\relax
- % There's no \foo, i.e., no ``environment'' foo.
- \errhelp = \EMsimple
- \errmessage{Undefined command `@end \endthing'}%
- \else
- \unmatchedenderror\endthing
- \fi
+% Check whether we're in the right environment:
+\def\checkenv#1{%
+ \def\temp{#1}%
+ \ifx\thisenv\temp
\else
- % Everything's ok; the right environment has been started.
- \csname E\endthing\endcsname
+ \badenverr
\fi
}
-% There is an environment #1, but it hasn't been started. Give an error.
-%
-\def\unmatchedenderror#1{%
+% Evironment mismatch, #1 expected:
+\def\badenverr{%
\errhelp = \EMsimple
- \errmessage{This `@end #1' doesn't have a matching `@#1'}%
+ \errmessage{This command can appear only \inenvironment\temp,
+ not \inenvironment\thisenv}%
+}
+\def\inenvironment#1{%
+ \ifx#1\empty
+ out of any environment%
+ \else
+ in environment \expandafter\string#1%
+ \fi
}
-% Define the control sequence \E#1 to give an unmatched @end error.
+% @end foo executes the definition of \Efoo.
+% But first, it executes a specialized version of \checkenv
%
-\def\defineunmatchedend#1{%
- \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
+\parseargdef\end{%
+ \if 1\csname iscond.#1\endcsname
+ \else
+ % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
+ \expandafter\checkenv\csname#1\endcsname
+ \csname E#1\endcsname
+ \endgroup
+ \fi
}
+\newhelp\EMsimple{Press RETURN to continue.}
+
%% Simple single-character @ commands
@@ -493,6 +573,9 @@
!gdef!rbraceatcmd[@}]%
!endgroup
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
\let\, = \c
@@ -502,10 +585,12 @@
\let\ubaraccent = \b
\let\udotaccent = \d
-% Other special characters: @questiondown @exclamdown
+% Other special characters: @questiondown @exclamdown @ordf @ordm
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
\def\questiondown{?`}
\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
% Dotless i and dotless j, used for accents.
\def\imacro{i}
@@ -518,6 +603,25 @@
\fi\fi
}
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence. (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=3000 }
+
+% @LaTeX{} logo. Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+ L\kern-.36em
+ {\setbox0=\hbox{T}%
+ \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
+ \kern-.15em
+ \TeX
+}
+
% Be sure we're in horizontal mode when doing a tie, since we make space
% equivalent to this in @example-like environments. Otherwise, a space
% at the beginning of a line will start with \penalty -- and
@@ -536,6 +640,9 @@
% @* forces a line break.
\def\*{\hfil\break\hbox{}\ignorespaces}
+% @/ allows a line break.
+\let\/=\allowbreak
+
% @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 }
@@ -564,63 +671,18 @@
% explicit \vfill so that the extra space is at the bottom. The
% threshold for doing this is if the group is more than \vfilllimit
% percent of a page (\vfilllimit can be changed inside of @tex).
-%
+%
\newbox\groupbox
\def\vfilllimit{0.7}
%
-\def\group{\begingroup
- \ifnum\catcode13=\active \else
+\envdef\group{%
+ \ifnum\catcode`\^^M=\active \else
\errhelp = \groupinvalidhelp
\errmessage{@group invalid in context where filling is enabled}%
\fi
- %
- % The \vtop we start below produces a box with normal height and large
- % depth; thus, TeX puts \baselineskip glue before it, and (when the
- % next line of text is done) \lineskip glue after it. (See p.82 of
- % the TeXbook.) Thus, space below is not quite equal to space
- % above. But it's pretty close.
- \def\Egroup{%
- \egroup % End the \vtop.
- % \dimen0 is the vertical size of the group's box.
- \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
- % \dimen2 is how much space is left on the page (more or less).
- \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
- % if the group doesn't fit on the current page, and it's a big big
- % group, force a page break.
- \ifdim \dimen0 > \dimen2
- \ifdim \pagetotal < \vfilllimit\pageheight
- \page
- \fi
- \fi
- \copy\groupbox
- \endgroup % End the \group.
- }%
+ \startsavinginserts
%
\setbox\groupbox = \vtop\bgroup
- % We have to put a strut on the last line in case the @group is in
- % the midst of an example, rather than completely enclosing it.
- % Otherwise, the interline space between the last line of the group
- % and the first line afterwards is too small. But we can't put the
- % strut in \Egroup, since there it would be on a line by itself.
- % Hence this just inserts a strut at the beginning of each line.
- \everypar = {\strut}%
- %
- % Since we have a strut on every line, we don't need any of TeX's
- % normal interline spacing.
- \offinterlineskip
- %
- % OK, but now we have to do something about blank
- % lines in the input in @example-like environments, which normally
- % just turn into \lisppar, which will insert no space now that we've
- % turned off the interline space. Simplest is to make them be an
- % empty paragraph.
- \ifx\par\lisppar
- \edef\par{\leavevmode \par}%
- %
- % Reset ^^M's definition to new definition of \par.
- \obeylines
- \fi
- %
% Do @comment since we are called inside an environment such as
% @example, where each end-of-line in the input causes an
% end-of-line in the output. We don't want the end-of-line after
@@ -630,6 +692,32 @@
\comment
}
%
+% The \vtop produces a box with normal height and large depth; thus, TeX puts
+% \baselineskip glue before it, and (when the next line of text is done)
+% \lineskip glue after it. Thus, space below is not quite equal to space
+% above. But it's pretty close.
+\def\Egroup{%
+ % To get correct interline space between the last line of the group
+ % and the first line afterwards, we have to propagate \prevdepth.
+ \endgraf % Not \par, as it may have been set to \lisppar.
+ \global\dimen1 = \prevdepth
+ \egroup % End the \vtop.
+ % \dimen0 is the vertical size of the group's box.
+ \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
+ % \dimen2 is how much space is left on the page (more or less).
+ \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
+ % if the group doesn't fit on the current page, and it's a big big
+ % group, force a page break.
+ \ifdim \dimen0 > \dimen2
+ \ifdim \pagetotal < \vfilllimit\pageheight
+ \page
+ \fi
+ \fi
+ \box\groupbox
+ \prevdepth = \dimen1
+ \checkinserts
+}
+%
% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
% message, so this ends up printing `@group can only ...'.
%
@@ -642,10 +730,8 @@ where each line of input produces a line of output.}
\newdimen\mil \mil=0.001in
-\def\need{\parsearg\needx}
-
% Old definition--didn't work.
-%\def\needx #1{\par %
+%\parseargdef\need{\par %
%% This method tries to make TeX break the page naturally
%% if the depth of the box does not fit.
%{\baselineskip=0pt%
@@ -653,7 +739,7 @@ where each line of input produces a line of output.}
%\prevdepth=-1000pt
%}}
-\def\needx#1{%
+\parseargdef\need{%
% Ensure vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
@@ -692,37 +778,11 @@ where each line of input produces a line of output.}
\fi
}
-% @br forces paragraph break
+% @br forces paragraph break (and is undocumented).
\let\br = \par
-% @dots{} output an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in a typewriter
-% font as three actual period characters.
-%
-\def\dots{%
- \leavevmode
- \hbox to 1.5em{%
- \hskip 0pt plus 0.25fil minus 0.25fil
- .\hss.\hss.%
- \hskip 0pt plus 0.5fil minus 0.5fil
- }%
-}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
- \leavevmode
- \hbox to 2em{%
- \hskip 0pt plus 0.25fil minus 0.25fil
- .\hss.\hss.\hss.%
- \hskip 0pt plus 0.5fil minus 0.5fil
- }%
- \spacefactor=3000
-}
-
-
-% @page forces the start of a new page
+% @page forces the start of a new page.
%
\def\page{\par\vfill\supereject}
@@ -734,13 +794,11 @@ where each line of input produces a line of output.}
\newskip\exdentamount
% This defn is used inside fill environments such as @defun.
-\def\exdent{\parsearg\exdentyyy}
-\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
+\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
% This defn is used inside nofill environments such as @example.
-\def\nofillexdent{\parsearg\nofillexdentyyy}
-\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
-\leftline{\hskip\leftskip{\rm#1}}}}
+\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
+ \leftline{\hskip\leftskip{\rm#1}}}}
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
% paragraph. For more general purposes, use the \margin insertion
@@ -771,10 +829,10 @@ where each line of input produces a line of output.}
% @inmargin{TEXT [, RIGHT-TEXT]}
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
% else use TEXT for both).
-%
+%
\def\inmargin#1{\parseinmargin #1,,\finish}
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
- \setbox0 = \hbox{\ignorespaces #2}%
+ \setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt
\def\lefttext{#1}% have both texts
\def\righttext{#2}%
@@ -792,8 +850,19 @@ where each line of input produces a line of output.}
}
% @include file insert text of that file as input.
-% Allow normal characters that we make active in the argument (a file name).
-\def\include{\begingroup
+%
+\def\include{\parseargusing\filenamecatcodes\includezzz}
+\def\includezzz#1{%
+ \pushthisfilestack
+ \def\thisfile{#1}%
+ {%
+ \makevalueexpandable
+ \def\temp{\input #1 }%
+ \expandafter
+ }\temp
+ \popthisfilestack
+}
+\def\filenamecatcodes{%
\catcode`\\=\other
\catcode`~=\other
\catcode`^=\other
@@ -802,33 +871,50 @@ where each line of input produces a line of output.}
\catcode`<=\other
\catcode`>=\other
\catcode`+=\other
- \parsearg\includezzz}
-% Restore active chars for included file.
-\def\includezzz#1{\endgroup\begingroup
- % Read the included file in a group so nested @include's work.
- \def\thisfile{#1}%
- \let\value=\expandablevalue
- \input\thisfile
-\endgroup}
+ \catcode`-=\other
+}
+
+\def\pushthisfilestack{%
+ \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
+}
+\def\pushthisfilestackX{%
+ \expandafter\pushthisfilestackY\thisfile\StackTerm
+}
+\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
+ \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
+}
+
+\def\popthisfilestack{\errthisfilestackempty}
+\def\errthisfilestackempty{\errmessage{Internal error:
+ the stack of filenames is empty.}}
\def\thisfile{}
% @center line
% outputs that line, centered.
%
-\def\center{\parsearg\docenter}
-\def\docenter#1{{%
- \ifhmode \hfil\break \fi
- \advance\hsize by -\leftskip
- \advance\hsize by -\rightskip
- \line{\hfil \ignorespaces#1\unskip \hfil}%
- \ifhmode \break \fi
-}}
+\parseargdef\center{%
+ \ifhmode
+ \let\next\centerH
+ \else
+ \let\next\centerV
+ \fi
+ \next{\hfil \ignorespaces#1\unskip \hfil}%
+}
+\def\centerH#1{%
+ {%
+ \hfil\break
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{#1}%
+ \break
+ }%
+}
+\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
% @sp n outputs n lines of vertical space
-\def\sp{\parsearg\spxxx}
-\def\spxxx #1{\vskip #1\baselineskip}
+\parseargdef\sp{\vskip #1\baselineskip}
% @comment ...line which is ignored...
% @c is the same as @comment
@@ -843,13 +929,13 @@ where each line of input produces a line of output.}
% @paragraphindent NCHARS
% We'll use ems for NCHARS, close enough.
-% We cannot implement @paragraphindent asis, though.
-%
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
\def\asisword{asis} % no translation, these are keywords
\def\noneword{none}
%
-\def\paragraphindent{\parsearg\doparagraphindent}
-\def\doparagraphindent#1{%
+\parseargdef\paragraphindent{%
\def\temp{#1}%
\ifx\temp\asisword
\else
@@ -866,8 +952,7 @@ where each line of input produces a line of output.}
% We'll use ems for NCHARS like @paragraphindent.
% It seems @exampleindent asis isn't necessary, but
% I preserve it to make it similar to @paragraphindent.
-\def\exampleindent{\parsearg\doexampleindent}
-\def\doexampleindent#1{%
+\parseargdef\exampleindent{%
\def\temp{#1}%
\ifx\temp\asisword
\else
@@ -879,48 +964,97 @@ where each line of input produces a line of output.}
\fi
}
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading. If WORD is `insert', then do indent at such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do.
+% We switch the definition of this back and forth according to WORD.
+% By default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\def\insertword{insert}
+%
+\parseargdef\firstparagraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\noneword
+ \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+ \else\ifx\temp\insertword
+ \let\suppressfirstparagraphindent = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @firstparagraphindent option `\temp'}%
+ \fi\fi
+}
+
+% Here is how we actually suppress indentation. Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+ \gdef\indent{%
+ \restorefirstparagraphindent
+ \indent
+ }%
+ \gdef\noindent{%
+ \restorefirstparagraphindent
+ \noindent
+ }%
+ \global\everypar = {%
+ \kern -\parindent
+ \restorefirstparagraphindent
+ }%
+}
+
+\gdef\restorefirstparagraphindent{%
+ \global \let \indent = \ptexindent
+ \global \let \noindent = \ptexnoindent
+ \global \everypar = {}%
+}
+
+
% @asis just yields its argument. Used with @table, for example.
%
\def\asis#1{#1}
% @math outputs its argument in math mode.
-% We don't use $'s directly in the definition of \math because we need
-% to set catcodes according to plain TeX first, to allow for subscripts,
-% superscripts, special math chars, etc.
-%
-\let\implicitmath = $%$ font-lock fix
%
% One complication: _ usually means subscripts, but it could also mean
% an actual _ character, as in @math{@var{some_variable} + 1}. So make
-% _ within @math be active (mathcode "8000), and distinguish by seeing
-% if the current family is \slfam, which is what @var uses.
-%
-{\catcode\underChar = \active
-\gdef\mathunderscore{%
- \catcode\underChar=\active
- \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
-}}
-%
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+ \catcode\underChar = \active
+ \gdef\mathunderscore{%
+ \catcode\underChar=\active
+ \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+ }
+}
% Another complication: we want \\ (and @\) to output a \ character.
% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
% this is not advertised and we don't care. Texinfo does not
% otherwise define @\.
-%
+%
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
%
\def\math{%
\tex
- \mathcode`\_="8000 \mathunderscore
+ \mathunderscore
\let\\ = \mathbackslash
\mathactive
- \implicitmath\finishmath}
-\def\finishmath#1{#1\implicitmath\Etex}
+ $\finishmath
+}
+\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
% Some active characters (such as <) are spaced differently in math.
-% We have to reset their definitions in case the @math was an
-% argument to a command which set the catcodes (such as @item or @section).
-%
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
{
\catcode`^ = \active
\catcode`< = \active
@@ -935,8 +1069,33 @@ where each line of input produces a line of output.}
}
% @bullet and @minus need the same treatment as @math, just above.
-\def\bullet{\implicitmath\ptexbullet\implicitmath}
-\def\minus{\implicitmath-\implicitmath}
+\def\bullet{$\ptexbullet$}
+\def\minus{$-$}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+ \leavevmode
+ \hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil
+ .\hfil.\hfil.%
+ \hskip 0pt plus 0.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \dots
+ \spacefactor=3000
+}
+
+% @comma{} is so commas can be inserted into text without messing up
+% Texinfo's parsing.
+%
+\let\comma = ,
% @refill is a no-op.
\let\refill=\relax
@@ -952,20 +1111,20 @@ where each line of input produces a line of output.}
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
\iflinks
- \readauxfile
+ \tryauxfile
+ % Open the new aux file. TeX will close it automatically at exit.
+ \immediate\openout\auxfile=\jobname.aux
\fi % \openindices needs to do some work in any case.
\openindices
- \fixbackslash % Turn off hack to swallow `\input texinfo'.
- \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
+ \let\setfilename=\comment % Ignore extra @setfilename cmds.
%
% If texinfo.cnf is present on the system, read it.
% Useful for site-wide @afourpaper, etc.
- % Just to be on the safe side, close the input stream before the \input.
\openin 1 texinfo.cnf
- \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
- \closein1
- \temp
+ \ifeof 1 \else \input texinfo.cnf \fi
+ \closein 1
%
\comment % Ignore the actual filename.
}
@@ -1012,6 +1171,7 @@ where each line of input produces a line of output.}
\pdftrue
\pdfoutput = 1
\input pdfcolor
+ \pdfcatalog{/PageMode /UseOutlines}%
\def\dopdfimage#1#2#3{%
\def\imagewidth{#2}%
\def\imageheight{#3}%
@@ -1032,7 +1192,13 @@ where each line of input produces a line of output.}
\ifnum\pdftexversion < 14 \else
\pdfrefximage \pdflastximage
\fi}
- \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}}
+ \def\pdfmkdest#1{{%
+ % We have to set dummies so commands such as @code in a section title
+ % aren't expanded.
+ \atdummies
+ \normalturnoffactive
+ \pdfdest name{#1} xyz%
+ }}
\def\pdfmkpgn#1{#1}
\let\linkcolor = \Blue % was Cyan, but that seems light?
\def\endlink{\Black\pdfendlink}
@@ -1041,48 +1207,94 @@ where each line of input produces a line of output.}
\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
\else \csname#1\endcsname \fi}
\def\advancenumber#1{\tempnum=\expnumber{#1}\relax
- \advance\tempnum by1
+ \advance\tempnum by 1
\expandafter\xdef\csname#1\endcsname{\the\tempnum}}
- \def\pdfmakeoutlines{{%
- \openin 1 \jobname.toc
- \ifeof 1\else\begingroup
- \closein 1
- % Thanh's hack / proper braces in bookmarks
+ %
+ % #1 is the section text. #2 is the pdf expression for the number
+ % of subentries (or empty, for subsubsections). #3 is the node
+ % text, which might be empty if this toc entry had no
+ % corresponding node. #4 is the page number.
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ % Generate a link to the node text if that exists; else, use the
+ % page number. We could generate a destination for the section
+ % text in the case where a section has no node, but it doesn't
+ % seem worthwhile, since most documents are normally structured.
+ \def\pdfoutlinedest{#3}%
+ \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi
+ %
+ \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ % Thanh's hack / proper braces in bookmarks
\edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
%
- \def\chapentry ##1##2##3{}
- \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
- \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
- \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
- \let\appendixentry = \chapentry
- \let\unnumbchapentry = \chapentry
- \let\unnumbsecentry = \secentry
- \let\unnumbsubsecentry = \subsecentry
- \let\unnumbsubsubsecentry = \subsubsecentry
+ % Read toc silently, to get counts of subentries for \pdfoutline.
+ \def\numchapentry##1##2##3##4{%
+ \def\thischapnum{##2}%
+ \let\thissecnum\empty
+ \let\thissubsecnum\empty
+ }%
+ \def\numsecentry##1##2##3##4{%
+ \advancenumber{chap\thischapnum}%
+ \def\thissecnum{##2}%
+ \let\thissubsecnum\empty
+ }%
+ \def\numsubsecentry##1##2##3##4{%
+ \advancenumber{sec\thissecnum}%
+ \def\thissubsecnum{##2}%
+ }%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \advancenumber{subsec\thissubsecnum}%
+ }%
+ \let\thischapnum\empty
+ \let\thissecnum\empty
+ \let\thissubsecnum\empty
+ %
+ % use \def rather than \let here because we redefine \chapentry et
+ % al. a second time, below.
+ \def\appentry{\numchapentry}%
+ \def\appsecentry{\numsecentry}%
+ \def\appsubsecentry{\numsubsecentry}%
+ \def\appsubsubsecentry{\numsubsubsecentry}%
+ \def\unnchapentry{\numchapentry}%
+ \def\unnsecentry{\numsecentry}%
+ \def\unnsubsecentry{\numsubsecentry}%
+ \def\unnsubsubsecentry{\numsubsubsecentry}%
\input \jobname.toc
- \def\chapentry ##1##2##3{%
- \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
- \def\secentry ##1##2##3##4{%
- \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
- \def\subsecentry ##1##2##3##4##5{%
- \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
- \def\subsubsecentry ##1##2##3##4##5##6{%
- \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
- \let\appendixentry = \chapentry
- \let\unnumbchapentry = \chapentry
- \let\unnumbsecentry = \secentry
- \let\unnumbsubsecentry = \subsecentry
- \let\unnumbsubsubsecentry = \subsubsecentry
%
- % Make special characters normal for writing to the pdf file.
+ % Read toc second time, this time actually producing the outlines.
+ % The `-' means take the \expnumber as the absolute number of
+ % subentries, which we calculated on our first read of the .toc above.
%
+ % We use the node names as the destinations.
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{% count is always zero
+ \dopdfoutline{##1}{}{##3}{##4}}%
+ %
+ % PDF outlines are displayed using system fonts, instead of
+ % document fonts. Therefore we cannot use special characters,
+ % since the encoding is unknown. For example, the eogonek from
+ % Latin 2 (0xea) gets translated to a | character. Info from
+ % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
+ %
+ % xx to do this right, we have to translate 8-bit characters to
+ % their "best" equivalent, based on the @documentencoding. Right
+ % now, I guess we'll just let the pdf reader have its way.
\indexnofonts
- \let\tt=\relax
\turnoffactive
\input \jobname.toc
- \endgroup\fi
- }}
+ \endgroup
+ }
+ %
\def\makelinks #1,{%
\def\params{#1}\def\E{END}%
\ifx\params\E
@@ -1091,7 +1303,7 @@ where each line of input produces a line of output.}
\let\nextmakelinks=\makelinks
\ifnum\lnkcount>0,\fi
\picknum{#1}%
- \startlink attr{/Border [0 0 0]}
+ \startlink attr{/Border [0 0 0]}
goto name{\pdfmkpgn{\the\pgn}}%
\linkcolor #1%
\advance\lnkcount by 1%
@@ -1113,7 +1325,6 @@ where each line of input produces a line of output.}
\def\ppn#1{\pgn=#1\gobble}
\def\ppnn{\pgn=\first}
\def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
- \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
\def\skipspaces#1{\def\PP{#1}\def\D{|}%
\ifx\PP\D\let\nextsp\relax
\else\let\nextsp\skipspaces
@@ -1131,22 +1342,21 @@ where each line of input produces a line of output.}
\def\pdfurl#1{%
\begingroup
\normalturnoffactive\def\@{@}%
- \let\value=\expandablevalue
+ \makevalueexpandable
\leavevmode\Red
\startlink attr{/Border [0 0 0]}%
user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
- % #1
\endgroup}
\def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
\def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
\def\maketoks{%
- \expandafter\poptoks\the\toksA|ENDTOKS|
+ \expandafter\poptoks\the\toksA|ENDTOKS|\relax
\ifx\first0\adn0
\else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
\else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
- \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
\else
\ifnum0=\countA\else\makelink\fi
\ifx\first.\let\next=\done\else
@@ -1166,16 +1376,34 @@ where each line of input produces a line of output.}
\message{fonts,}
-% Font-change commands.
+
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+ \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+ \csname ten#1\endcsname % change the current font
+}
+
+% Select #1 fonts with the current style.
+%
+\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
-% So we set up a \sf analogous to plain's \rm, etc.
+% So we set up a \sf.
\newfam\sffam
-\def\sf{\fam=\sffam \tensf}
+\def\sf{\fam=\sffam \setfontstyle{sf}}
\let\li = \sf % Sometimes we call it \li, not \sf.
-% We don't need math for this one.
-\def\ttsl{\tenttsl}
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
% Default leading.
\newdimen\textleading \textleading = 13.2pt
@@ -1226,6 +1454,7 @@ where each line of input produces a line of output.}
\def\scshape{csc}
\def\scbshape{csc}
+% Text fonts (11.2pt, magstep1).
\newcount\mainmagstep
\ifx\bigger\relax
% not really supported.
@@ -1237,10 +1466,6 @@ where each line of input produces a line of output.}
\setfont\textrm\rmshape{10}{\mainmagstep}
\setfont\texttt\ttshape{10}{\mainmagstep}
\fi
-% Instead of cmb10, you may want to use cmbx10.
-% cmbx10 is a prettier font on its own, but cmb10
-% looks better when embedded in a line with cmr10
-% (in Bob's opinion).
\setfont\textbf\bfshape{10}{\mainmagstep}
\setfont\textit\itshape{10}{\mainmagstep}
\setfont\textsl\slshape{10}{\mainmagstep}
@@ -1250,10 +1475,11 @@ where each line of input produces a line of output.}
\font\texti=cmmi10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep
-% A few fonts for @defun, etc.
-\setfont\defbf\bxshape{10}{\magstep1} %was 1314
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstep1}
\setfont\deftt\ttshape{10}{\magstep1}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
+\setfont\defttsl\ttslshape{10}{\magstep1}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
% Fonts for indices, footnotes, small examples (9pt).
\setfont\smallrm\rmshape{9}{1000}
@@ -1279,7 +1505,7 @@ where each line of input produces a line of output.}
\font\smalleri=cmmi8
\font\smallersy=cmsy8
-% Fonts for title page:
+% Fonts for title page (20.4pt):
\setfont\titlerm\rmbshape{12}{\magstep3}
\setfont\titleit\itbshape{10}{\magstep4}
\setfont\titlesl\slbshape{10}{\magstep4}
@@ -1325,11 +1551,21 @@ where each line of input produces a line of output.}
\setfont\ssecttsl\ttslshape{10}{1315}
\setfont\ssecsf\sfbshape{12}{\magstephalf}
\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{\magstep1}
+\setfont\ssecsc\scbshape{10}{1315}
\font\sseci=cmmi12 scaled \magstephalf
\font\ssecsy=cmsy10 scaled 1315
-% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
-% but that is not a standard magnification.
+
+% Reduced fonts for @acro in text (10pt).
+\setfont\reducedrm\rmshape{10}{1000}
+\setfont\reducedtt\ttshape{10}{1000}
+\setfont\reducedbf\bfshape{10}{1000}
+\setfont\reducedit\itshape{10}{1000}
+\setfont\reducedsl\slshape{10}{1000}
+\setfont\reducedsf\sfshape{10}{1000}
+\setfont\reducedsc\scshape{10}{1000}
+\setfont\reducedttsl\ttslshape{10}{1000}
+\font\reducedi=cmmi10
+\font\reducedsy=cmsy10
% In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families. Since
@@ -1344,50 +1580,72 @@ where each line of input produces a line of output.}
}
% The font-changing commands redefine the meanings of \tenSTYLE, instead
-% of just \STYLE. We do this so that font changes will continue to work
-% in math mode, where it is the current \fam that is relevant in most
-% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
-% \tenbf}, for example. By redefining \tenbf, we obviate the need to
-% redefine \bf itself.
+% of just \STYLE. We do this because \STYLE needs to also set the
+% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
+% \tenSTYLE to set the current font.
+%
+% Each font-changing command also sets the names \lsize (one size lower)
+% and \lllsize (three sizes lower). These relative commands are used in
+% the LaTeX logo and acronyms.
+%
+% This all needs generalizing, badly.
+%
\def\textfonts{%
\let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
\let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
- \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
+ \let\tenttsl=\textttsl
+ \def\lsize{reduced}\def\lllsize{smaller}%
\resetmathfonts \setleading{\textleading}}
\def\titlefonts{%
\let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
\let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
\let\tenttsl=\titlettsl
+ \def\lsize{chap}\def\lllsize{subsec}%
\resetmathfonts \setleading{25pt}}
\def\titlefont#1{{\titlefonts\rm #1}}
\def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
\let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
+ \def\lsize{sec}\def\lllsize{text}%
\resetmathfonts \setleading{19pt}}
\def\secfonts{%
\let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
\let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
- \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
+ \let\tenttsl=\secttsl
+ \def\lsize{subsec}\def\lllsize{reduced}%
\resetmathfonts \setleading{16pt}}
\def\subsecfonts{%
\let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
\let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
- \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
+ \let\tenttsl=\ssecttsl
+ \def\lsize{text}\def\lllsize{small}%
\resetmathfonts \setleading{15pt}}
-\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
+\let\subsubsecfonts = \subsecfonts
+\def\reducedfonts{%
+ \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
+ \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
+ \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
+ \let\tenttsl=\reducedttsl
+ \def\lsize{small}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
\def\smallfonts{%
\let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
\let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
\let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
\let\tenttsl=\smallttsl
+ \def\lsize{smaller}\def\lllsize{smaller}%
\resetmathfonts \setleading{10.5pt}}
\def\smallerfonts{%
\let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
\let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
\let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
\let\tenttsl=\smallerttsl
+ \def\lsize{smaller}\def\lllsize{smaller}%
\resetmathfonts \setleading{9.5pt}}
% Set the fonts to use with the @small... environments.
@@ -1396,22 +1654,21 @@ where each line of input produces a line of output.}
% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
% can fit this many characters:
% 8.5x11=86 smallbook=72 a4=90 a5=69
-% If we use \smallerfonts (8pt), then we can fit this many characters:
+% If we use \scriptfonts (8pt), then we can fit this many characters:
% 8.5x11=90+ smallbook=80 a4=90+ a5=77
% For me, subjectively, the few extra characters that fit aren't worth
% the additional smallness of 8pt. So I'm making the default 9pt.
-%
+%
% By the way, for comparison, here's what fits with @example (10pt):
% 8.5x11=71 smallbook=60 a4=75 a5=58
-%
-% I wish we used A4 paper on this side of the Atlantic.
-%
+%
+% I wish the USA used A4 paper.
% --karl, 24jan03.
% Set up the default fonts, so we can use them for creating boxes.
%
-\textfonts
+\textfonts \rm
% Define these so they can be easily changed for other fonts.
\def\angleleft{$\langle$}
@@ -1422,7 +1679,7 @@ where each line of input produces a line of output.}
% Fonts for short table of contents.
\setfont\shortcontrm\rmshape{12}{1000}
-\setfont\shortcontbf\bxshape{12}{1000}
+\setfont\shortcontbf\bfshape{10}{\magstep1} % no cmb12
\setfont\shortcontsl\slshape{12}{1000}
\setfont\shortconttt\ttshape{12}{1000}
@@ -1431,15 +1688,23 @@ where each line of input produces a line of output.}
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
+ \ptexslash\fi\fi\fi}
\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
+% like \smartslanted except unconditionally uses \ttsl.
+% @var is set to this for defun arguments.
+\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
+
+% like \smartslanted except unconditionally use \sl. We never want
+% ttsl for book titles, do we?
+\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
+
\let\i=\smartitalic
\let\var=\smartslanted
\let\dfn=\smartslanted
\let\emph=\smartitalic
-\let\cite=\smartslanted
\def\b#1{{\bf #1}}
\let\strong=\b
@@ -1454,7 +1719,7 @@ where each line of input produces a line of output.}
% Set sfcode to normal for the chars that usually have another value.
% Can't use plain's \frenchspacing because it uses the `\x notation, and
% sometimes \x has an active definition that messes things up.
-%
+%
\catcode`@=11
\def\frenchspacing{%
\sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
@@ -1466,7 +1731,6 @@ where each line of input produces a line of output.}
{\tt \rawbackslash \frenchspacing #1}%
\null
}
-\let\ttfont=\t
\def\samp#1{`\tclose{#1}'\null}
\setfont\keyrm\rmshape{8}{1000}
\font\keysy=cmsy9
@@ -1507,7 +1771,7 @@ where each line of input produces a line of output.}
\null
}
-% We *must* turn on hyphenation at `-' and `_' in \code.
+% We *must* turn on hyphenation at `-' and `_' in @code.
% Otherwise, it is too hard to avoid overfull hboxes
% in the Emacs manual, the Library manual, etc.
@@ -1525,10 +1789,6 @@ where each line of input produces a line of output.}
\catcode`\_=\active \let_\codeunder
\codex
}
- %
- % If we end up with any active - characters when handling the index,
- % just treat them as a normal -.
- \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
}
\def\realdash{-}
@@ -1552,8 +1812,7 @@ where each line of input produces a line of output.}
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
% `example' (@kbd uses ttsl only inside of @example and friends),
% or `code' (@kbd uses normal tty font always).
-\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
-\def\kbdinputstylexxx#1{%
+\parseargdef\kbdinputstyle{%
\def\arg{#1}%
\ifx\arg\worddistinct
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
@@ -1563,7 +1822,7 @@ where each line of input produces a line of output.}
\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
\else
\errhelp = \EMsimple
- \errmessage{Unknown @kbdinputstyle `\arg'}%
+ \errmessage{Unknown @kbdinputstyle option `\arg'}%
\fi\fi\fi
}
\def\worddistinct{distinct}
@@ -1614,7 +1873,7 @@ where each line of input produces a line of output.}
% rms does not like angle brackets --karl, 17may97.
% So now @email is just like @uref, unless we are pdf.
-%
+%
%\def\email#1{\angleleft{\tt #1}\angleright}
\ifpdf
\def\email#1{\doemail#1,,\finish}
@@ -1653,12 +1912,29 @@ where each line of input produces a line of output.}
\def\sc#1{{\smallcaps#1}} % smallcaps font
\def\ii#1{{\it #1}} % italic font
-% @acronym downcases the argument and prints in smallcaps.
-\def\acronym#1{{\smallcaps \lowercase{#1}}}
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+ {\selectfonts\lsize #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+}
-% @pounds{} is a sterling sign.
+% @pounds{} is a sterling sign, which is in the CM italic font.
+%
\def\pounds{{\it\$}}
+% @registeredsymbol - R in a circle. The font for the R should really
+% be smaller yet, but lllsize is the best we can do for now.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+ \hfil\crcr\Orb}}%
+ }$%
+}
+
\message{page headings,}
@@ -1677,87 +1953,103 @@ where each line of input produces a line of output.}
\newif\ifsetshortcontentsaftertitlepage
\let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
-\def\shorttitlepage{\parsearg\shorttitlepagezzz}
-\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\endgroup\page\hbox{}\page}
-\def\titlepage{\begingroup \parindent=0pt \textfonts
- \let\subtitlerm=\tenrm
- \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
- %
- \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
- \let\tt=\authortt}%
- %
- % Leave some space at the very top of the page.
- \vglue\titlepagetopglue
- %
- % Now you can print the title using @title.
- \def\title{\parsearg\titlezzz}%
- \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
- % print a rule at the page bottom also.
- \finishedtitlepagefalse
- \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
- % No rule at page bottom unless we print one at the top with @title.
- \finishedtitlepagetrue
- %
- % Now you can put text using @subtitle.
- \def\subtitle{\parsearg\subtitlezzz}%
- \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
- %
- % @author should come last, but may come many times.
- \def\author{\parsearg\authorzzz}%
- \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
- {\authorfont \leftline{##1}}}%
- %
- % Most title ``pages'' are actually two pages long, with space
- % at the top of the second. We don't want the ragged left on the second.
- \let\oldpage = \page
- \def\page{%
+\envdef\titlepage{%
+ % Open one extra group, as we want to close it in the middle of \Etitlepage.
+ \begingroup
+ \parindent=0pt \textfonts
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
\iffinishedtitlepage\else
- \finishtitlepage
+ \finishtitlepage
\fi
- \oldpage
\let\page = \oldpage
- \hbox{}}%
-% \def\page{\oldpage \hbox{}}
+ \page
+ \null
+ }%
}
\def\Etitlepage{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- % It is important to do the page break before ending the group,
- % because the headline and footline are only empty inside the group.
- % If we use the new definition of \page, we always get a blank page
- % after the title page, which we certainly don't want.
- \oldpage
- \endgroup
- %
- % Need this before the \...aftertitlepage checks so that if they are
- % in effect the toc pages will come out with page numbers.
- \HEADINGSon
- %
- % If they want short, they certainly want long too.
- \ifsetshortcontentsaftertitlepage
- \shortcontents
- \contents
- \global\let\shortcontents = \relax
- \global\let\contents = \relax
- \fi
- %
- \ifsetcontentsaftertitlepage
- \contents
- \global\let\contents = \relax
- \global\let\shortcontents = \relax
- \fi
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % Need this before the \...aftertitlepage checks so that if they are
+ % in effect the toc pages will come out with page numbers.
+ \HEADINGSon
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
}
\def\finishtitlepage{%
- \vskip4pt \hrule height 2pt width \hsize
- \vskip\titlepagebottomglue
- \finishedtitlepagetrue
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+%%% Macros to be used within @titlepage:
+
+\let\subtitlerm=\tenrm
+\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
+
+\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
+ \let\tt=\authortt}
+
+\parseargdef\title{%
+ \checkenv\titlepage
+ \leftline{\titlefonts\rm #1}
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt
}
+\parseargdef\subtitle{%
+ \checkenv\titlepage
+ {\subtitlefont \rightline{#1}}%
+}
+
+% @author should come last, but may come many times.
+% It can also be used inside @quotation.
+%
+\parseargdef\author{%
+ \def\temp{\quotation}%
+ \ifx\thisenv\temp
+ \def\quotationauthor{#1}% printed in \Equotation.
+ \else
+ \checkenv\titlepage
+ \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
+ {\authorfont \leftline{#1}}%
+ \fi
+}
+
+
%%% Set up page headings and footings.
\let\thispage=\folio
@@ -1767,7 +2059,7 @@ where each line of input produces a line of output.}
\newtoks\evenfootline % footline on even pages
\newtoks\oddfootline % footline on odd pages
-% Now make Tex use those variables
+% Now make TeX use those variables
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
\else \the\evenheadline \fi}}
\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
@@ -1781,32 +2073,27 @@ where each line of input produces a line of output.}
% @evenfooting @thisfile||
% @oddfooting ||@thisfile
-\def\evenheading{\parsearg\evenheadingxxx}
-\def\oddheading{\parsearg\oddheadingxxx}
-\def\everyheading{\parsearg\everyheadingxxx}
-\def\evenfooting{\parsearg\evenfootingxxx}
-\def\oddfooting{\parsearg\oddfootingxxx}
-\def\everyfooting{\parsearg\everyfootingxxx}
-
-{\catcode`\@=0 %
-
-\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
-\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
+\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
-\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
+\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
-\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
-\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
+\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
-\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
+\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
\global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
%
% Leave some space for the footline. Hopefully ok to assume
@@ -1815,9 +2102,8 @@ where each line of input produces a line of output.}
\global\advance\vsize by -\baselineskip
}
-\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
-%
-}% unbind the catcode of @.
+\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+
% @headings double turns headings on for double-sided printing.
% @headings single turns headings on for single-sided printing.
@@ -1831,7 +2117,7 @@ where each line of input produces a line of output.}
\def\headings #1 {\csname HEADINGS#1\endcsname}
-\def\HEADINGSoff{
+\def\HEADINGSoff{%
\global\evenheadline={\hfil} \global\evenfootline={\hfil}
\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
\HEADINGSoff
@@ -1840,7 +2126,7 @@ where each line of input produces a line of output.}
% chapter name on inside top of right hand pages, document
% title on inside top of left hand pages, and page numbers on outside top
% edge of all pages.
-\def\HEADINGSdouble{
+\def\HEADINGSdouble{%
\global\pageno=1
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
@@ -1852,7 +2138,7 @@ where each line of input produces a line of output.}
% For single-sided printing, chapter title goes across top left of page,
% page number on top right.
-\def\HEADINGSsingle{
+\def\HEADINGSsingle{%
\global\pageno=1
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
@@ -1899,12 +2185,11 @@ where each line of input produces a line of output.}
% @settitle line... specifies the title of the document, for headings.
% It generates no output of its own.
\def\thistitle{\putwordNoTitle}
-\def\settitle{\parsearg\settitlezzz}
-\def\settitlezzz #1{\gdef\thistitle{#1}}
+\def\settitle{\parsearg{\gdef\thistitle}}
\message{tables,}
-% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
+% Tables -- @table, @ftable, @vtable, @item(x).
% default indentation of table text
\newdimen\tableindent \tableindent=.8in
@@ -1916,7 +2201,7 @@ where each line of input produces a line of output.}
% used internally for \itemindent minus \itemmargin
\newdimen\itemmax
-% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
+% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
% these defs.
% They also define \itemindex
% to index the item name in whatever manner is desired (perhaps none).
@@ -1928,22 +2213,10 @@ where each line of input produces a line of output.}
\def\internalBitem{\smallbreak \parsearg\itemzzz}
\def\internalBitemx{\itemxpar \parsearg\itemzzz}
-\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
-\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
-
-\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
-\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
-
-\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
- \itemzzz {#1}}
-
-\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
- \itemzzz {#1}}
-
\def\itemzzz #1{\begingroup %
\advance\hsize by -\rightskip
\advance\hsize by -\tableindent
- \setbox0=\hbox{\itemfont{#1}}%
+ \setbox0=\hbox{\itemindicate{#1}}%
\itemindex{#1}%
\nobreak % This prevents a break before @itemx.
%
@@ -1997,92 +2270,95 @@ where each line of input produces a line of output.}
\fi
}
-\def\item{\errmessage{@item while not in a table}}
-\def\itemx{\errmessage{@itemx while not in a table}}
-\def\kitem{\errmessage{@kitem while not in a table}}
-\def\kitemx{\errmessage{@kitemx while not in a table}}
-\def\xitem{\errmessage{@xitem while not in a table}}
-\def\xitemx{\errmessage{@xitemx while not in a table}}
-
-% Contains a kludge to get @end[description] to work.
-\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+\def\item{\errmessage{@item while not in a list environment}}
+\def\itemx{\errmessage{@itemx while not in a list environment}}
% @table, @ftable, @vtable.
-\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
-{\obeylines\obeyspaces%
-\gdef\tablex #1^^M{%
-\tabley\dontindex#1 \endtabley}}
-
-\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
-{\obeylines\obeyspaces%
-\gdef\ftablex #1^^M{%
-\tabley\fnitemindex#1 \endtabley
-\def\Eftable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
-{\obeylines\obeyspaces%
-\gdef\vtablex #1^^M{%
-\tabley\vritemindex#1 \endtabley
-\def\Evtable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\dontindex #1{}
-\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
-\def\vritemindex #1{\doind {vr}{\code{#1}}}%
-
-{\obeyspaces %
-\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
-\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
-
-\def\tablez #1#2#3#4#5#6{%
-\aboveenvbreak %
-\begingroup %
-\def\Edescription{\Etable}% Necessary kludge.
-\let\itemindex=#1%
-\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
-\ifnum 0#4>0 \tableindent=#4\mil \fi %
-\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
-\def\itemfont{#2}%
-\itemmax=\tableindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \tableindent %
-\exdentamount=\tableindent
-\parindent = 0pt
-\parskip = \smallskipamount
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def\Etable{\endgraf\afterenvbreak\endgroup}%
-\let\item = \internalBitem %
-\let\itemx = \internalBitemx %
-\let\kitem = \internalBkitem %
-\let\kitemx = \internalBkitemx %
-\let\xitem = \internalBxitem %
-\let\xitemx = \internalBxitemx %
+\envdef\table{%
+ \let\itemindex\gobble
+ \tablex
+}
+\envdef\ftable{%
+ \def\itemindex ##1{\doind {fn}{\code{##1}}}%
+ \tablex
+}
+\envdef\vtable{%
+ \def\itemindex ##1{\doind {vr}{\code{##1}}}%
+ \tablex
+}
+\def\tablex#1{%
+ \def\itemindicate{#1}%
+ \parsearg\tabley
+}
+\def\tabley#1{%
+ {%
+ \makevalueexpandable
+ \edef\temp{\noexpand\tablez #1\space\space\space}%
+ \expandafter
+ }\temp \endtablez
}
+\def\tablez #1 #2 #3 #4\endtablez{%
+ \aboveenvbreak
+ \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
+ \ifnum 0#2>0 \tableindent=#2\mil \fi
+ \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
+ \itemmax=\tableindent
+ \advance \itemmax by -\itemmargin
+ \advance \leftskip by \tableindent
+ \exdentamount=\tableindent
+ \parindent = 0pt
+ \parskip = \smallskipamount
+ \ifdim \parskip=0pt \parskip=2pt \fi
+ \let\item = \internalBitem
+ \let\itemx = \internalBitemx
+}
+\def\Etable{\endgraf\afterenvbreak}
+\let\Eftable\Etable
+\let\Evtable\Etable
+\let\Eitemize\Etable
+\let\Eenumerate\Etable
% This is the counter used by @enumerate, which is really @itemize
\newcount \itemno
-\def\itemize{\parsearg\itemizezzz}
+\envdef\itemize{\parsearg\doitemize}
-\def\itemizezzz #1{%
- \begingroup % ended by the @end itemize
- \itemizey {#1}{\Eitemize}
+\def\doitemize#1{%
+ \aboveenvbreak
+ \itemmax=\itemindent
+ \advance\itemmax by -\itemmargin
+ \advance\leftskip by \itemindent
+ \exdentamount=\itemindent
+ \parindent=0pt
+ \parskip=\smallskipamount
+ \ifdim\parskip=0pt \parskip=2pt \fi
+ \def\itemcontents{#1}%
+ % @itemize with no arg is equivalent to @itemize @bullet.
+ \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+ \let\item=\itemizeitem
}
-\def\itemizey #1#2{%
-\aboveenvbreak %
-\itemmax=\itemindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \itemindent %
-\exdentamount=\itemindent
-\parindent = 0pt %
-\parskip = \smallskipamount %
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def#2{\endgraf\afterenvbreak\endgroup}%
-\def\itemcontents{#1}%
-\let\item=\itemizeitem}
+% Definition of @item while inside @itemize and @enumerate.
+%
+\def\itemizeitem{%
+ \advance\itemno by 1 % for enumerations
+ {\let\par=\endgraf \smallbreak}% reasonable place to break
+ {%
+ % If the document has an @itemize directly after a section title, a
+ % \nobreak will be last on the list, and \sectionheading will have
+ % done a \vskip-\parskip. In that case, we don't want to zero
+ % parskip, or the item text will crash with the heading. On the
+ % other hand, when there is normal text preceding the item (as there
+ % usually is), we do want to zero parskip, or there would be too much
+ % space. In that case, we won't have a \nobreak before. At least
+ % that's the theory.
+ \ifnum\lastpenalty<10000 \parskip=0in \fi
+ \noindent
+ \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+ \vadjust{\penalty 1200}}% not good to break after first line of item.
+ \flushcr
+}
% \splitoff TOKENS\endmark defines \first to be the first token in
% TOKENS, and \rest to be the remainder.
@@ -2093,11 +2369,8 @@ where each line of input produces a line of output.}
% or number, to specify the first label in the enumerated list. No
% argument is the same as `1'.
%
-\def\enumerate{\parsearg\enumeratezzz}
-\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
+\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
\def\enumeratey #1 #2\endenumeratey{%
- \begingroup % ended by the @end enumerate
- %
% If we were given no argument, pretend we were given `1'.
\def\thearg{#1}%
\ifx\thearg\empty \def\thearg{1}\fi
@@ -2168,13 +2441,13 @@ where each line of input produces a line of output.}
}%
}
-% Call itemizey, adding a period to the first argument and supplying the
+% Call \doitemize, adding a period to the first argument and supplying the
% common last two arguments. Also subtract one from the initial value in
% \itemno, since @item increments \itemno.
%
\def\startenumeration#1{%
\advance\itemno by -1
- \itemizey{#1.}\Eenumerate\flushcr
+ \doitemize{#1.}\flushcr
}
% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
@@ -2185,16 +2458,6 @@ where each line of input produces a line of output.}
\def\Ealphaenumerate{\Eenumerate}
\def\Ecapsenumerate{\Eenumerate}
-% Definition of @item while inside @itemize.
-
-\def\itemizeitem{%
-\advance\itemno by 1
-{\let\par=\endgraf \smallbreak}%
-\ifhmode \errmessage{In hmode at itemizeitem}\fi
-{\parskip=0in \hskip 0pt
-\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
-\vadjust{\penalty 1200}}%
-\flushcr}
% @multitable macros
% Amy Hendrickson, 8/18/94, 3/6/96
@@ -2221,24 +2484,14 @@ where each line of input produces a line of output.}
% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
% @item ...
% using the widest term desired in each column.
-%
-% For those who want to use more than one line's worth of words in
-% the preamble, break the line within one argument and it
-% will parse correctly, i.e.,
-%
-% @multitable {Column 1 template} {Column 2 template} {Column 3
-% template}
-% Not:
-% @multitable {Column 1 template} {Column 2 template}
-% {Column 3 template}
% Each new table line starts with @item, each subsequent new column
% starts with @tab. Empty columns may be produced by supplying @tab's
% with nothing between them for as many times as empty columns are needed,
% ie, @tab@tab@tab will produce two empty columns.
-% @item, @tab, @multitable or @end multitable do not need to be on their
-% own lines, but it will not hurt if they are.
+% @item, @tab do not need to be on their own lines, but it will not hurt
+% if they are.
% Sample multitable:
@@ -2282,13 +2535,12 @@ where each line of input produces a line of output.}
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
-% #1 is the part of the @columnfraction before the decimal point, which
-% is presumably either 0 or the empty string (but we don't check, we
-% just throw it away). #2 is the decimal part, which we use as the
-% percent of \hsize for this column.
-\def\pickupwholefraction#1.#2 {%
+% #1 is the @columnfraction, usually a decimal number like .5, but might
+% be just 1. We just use it, whatever it is.
+%
+\def\pickupwholefraction#1 {%
\global\advance\colcount by 1
- \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
+ \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
\setuptable
}
@@ -2321,18 +2573,30 @@ where each line of input produces a line of output.}
\go
}
+% multitable-only commands.
+%
+% @headitem starts a heading row, which we typeset in bold.
+% Assignments have to be global since we are inside the implicit group
+% of an alignment entry. Note that \everycr resets \everytab.
+\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}%
+%
+% A \tab used to include \hskip1sp. But then the space in a template
+% line is not enough. That is bad. So let's go back to just `&' until
+% we encounter the problem it was intended to solve again.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{\checkenv\multitable &\the\everytab}%
+
% @multitable ... @end multitable definitions:
%
-\def\multitable{\parsearg\dotable}
-\def\dotable#1{\bgroup
+\newtoks\everytab % insert after every tab.
+%
+\envdef\multitable{%
\vskip\parskip
- \let\item=\crcrwithfootnotes
- % A \tab used to include \hskip1sp. But then the space in a template
- % line is not enough. That is bad. So let's go back to just & until
- % we encounter the problem it was intended to solve again. --karl,
- % nathan@acm.org, 20apr99.
- \let\tab=&%
- \let\startfootins=\startsavedfootnote
+ \startsavinginserts
+ %
+ % @item within a multitable starts a normal row.
+ \let\item\crcr
+ %
\tolerance=9500
\hbadness=9500
\setmultitablespacing
@@ -2340,70 +2604,80 @@ where each line of input produces a line of output.}
\parindent=\multitableparindent
\overfullrule=0pt
\global\colcount=0
- \def\Emultitable{%
- \global\setpercentfalse
- \crcrwithfootnotes\crcr
- \egroup\egroup
+ %
+ \everycr = {%
+ \noalign{%
+ \global\everytab={}%
+ \global\colcount=0 % Reset the column counter.
+ % Check for saved footnotes, etc.
+ \checkinserts
+ % Keeps underfull box messages off when table breaks over pages.
+ %\filbreak
+ % Maybe so, but it also creates really weird page breaks when the
+ % table breaks over pages. Wouldn't \vfil be better? Wait until the
+ % problem manifests itself, so it can be fixed for real --karl.
+ }%
}%
%
+ \parsearg\domultitable
+}
+\def\domultitable#1{%
% To parse everything between @multitable and @item:
\setuptable#1 \endsetuptable
%
- % \everycr will reset column counter, \colcount, at the end of
- % each line. Every column entry will cause \colcount to advance by one.
- % The table preamble
- % looks at the current \colcount to find the correct column width.
- \everycr{\noalign{%
- %
- % \filbreak%% keeps underfull box messages off when table breaks over pages.
- % Maybe so, but it also creates really weird page breaks when the table
- % breaks over pages. Wouldn't \vfil be better? Wait until the problem
- % manifests itself, so it can be fixed for real --karl.
- \global\colcount=0\relax}}%
- %
% This preamble sets up a generic column definition, which will
% be used as many times as user calls for columns.
% \vtop will set a single line and will also let text wrap and
% continue for many paragraphs if desired.
- \halign\bgroup&\global\advance\colcount by 1\relax
- \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
- %
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- %
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- %
- % If the user has set preamble in terms of percent of \hsize we will
- % use that dimension as the width of the column, and the \leftskip
- % will keep entries from bumping into each other. Table will start at
- % left margin and final column will justify at right margin.
- %
- % Make sure we don't inherit \rightskip from the outer environment.
- \rightskip=0pt
- \ifnum\colcount=1
- % The first column will be indented with the surrounding text.
- \advance\hsize by\leftskip
- \else
- \ifsetpercent \else
- % If user has not set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace.
- \advance\hsize by \multitablecolspace
- \fi
- % In either case we will make \leftskip=\multitablecolspace:
- \leftskip=\multitablecolspace
- \fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighting sequences respectively marking
- % characters.
- \noindent\ignorespaces##\unskip\multistrut}\cr
+ \halign\bgroup &%
+ \global\advance\colcount by 1
+ \multistrut
+ \vtop{%
+ % Use the current \colcount to find the correct column width:
+ \hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively
+ % marking characters.
+ \noindent\ignorespaces##\unskip\multistrut
+ }\cr
+}
+\def\Emultitable{%
+ \crcr
+ \egroup % end the \halign
+ \global\setpercentfalse
}
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
@@ -2433,163 +2707,33 @@ width0pt\relax} \fi
%% than skip between lines in the table.
\fi}
-% In case a @footnote appears inside an alignment, save the footnote
-% text to a box and make the \insert when a row of the table is
-% finished. Otherwise, the insertion is lost, it never migrates to the
-% main vertical list. --kasal, 22jan03.
-%
-\newbox\savedfootnotes
-%
-% \dotable \let's \startfootins to this, so that \dofootnote will call
-% it instead of starting the insertion right away.
-\def\startsavedfootnote{%
- \global\setbox\savedfootnotes = \vbox\bgroup
- \unvbox\savedfootnotes
-}
-\def\crcrwithfootnotes{%
- \crcr
- \ifvoid\savedfootnotes \else
- \noalign{\insert\footins{\box\savedfootnotes}}%
- \fi
-}
\message{conditionals,}
-% Prevent errors for section commands.
-% Used in @ignore and in failing conditionals.
-\def\ignoresections{%
- \let\chapter=\relax
- \let\unnumbered=\relax
- \let\top=\relax
- \let\unnumberedsec=\relax
- \let\unnumberedsection=\relax
- \let\unnumberedsubsec=\relax
- \let\unnumberedsubsection=\relax
- \let\unnumberedsubsubsec=\relax
- \let\unnumberedsubsubsection=\relax
- \let\section=\relax
- \let\subsec=\relax
- \let\subsubsec=\relax
- \let\subsection=\relax
- \let\subsubsection=\relax
- \let\appendix=\relax
- \let\appendixsec=\relax
- \let\appendixsection=\relax
- \let\appendixsubsec=\relax
- \let\appendixsubsection=\relax
- \let\appendixsubsubsec=\relax
- \let\appendixsubsubsection=\relax
- \let\contents=\relax
- \let\smallbook=\relax
- \let\titlepage=\relax
-}
-
-% Used in nested conditionals, where we have to parse the Texinfo source
-% and so want to turn off most commands, in case they are used
-% incorrectly.
-%
-% We use \empty instead of \relax for the @def... commands, so that \end
-% doesn't throw an error. For instance:
-% @ignore
-% @deffn ...
-% @end deffn
-% @end ignore
-%
-% The @end deffn is going to get expanded, because we're trying to allow
-% nested conditionals. But we don't want to expand the actual @deffn,
-% since it might be syntactically correct and intended to be ignored.
-% Since \end checks for \relax, using \empty does not cause an error.
-%
-\def\ignoremorecommands{%
- \let\defcodeindex = \relax
- \let\defcv = \empty
- \let\defcvx = \empty
- \let\Edefcv = \empty
- \let\deffn = \empty
- \let\deffnx = \empty
- \let\Edeffn = \empty
- \let\defindex = \relax
- \let\defivar = \empty
- \let\defivarx = \empty
- \let\Edefivar = \empty
- \let\defmac = \empty
- \let\defmacx = \empty
- \let\Edefmac = \empty
- \let\defmethod = \empty
- \let\defmethodx = \empty
- \let\Edefmethod = \empty
- \let\defop = \empty
- \let\defopx = \empty
- \let\Edefop = \empty
- \let\defopt = \empty
- \let\defoptx = \empty
- \let\Edefopt = \empty
- \let\defspec = \empty
- \let\defspecx = \empty
- \let\Edefspec = \empty
- \let\deftp = \empty
- \let\deftpx = \empty
- \let\Edeftp = \empty
- \let\deftypefn = \empty
- \let\deftypefnx = \empty
- \let\Edeftypefn = \empty
- \let\deftypefun = \empty
- \let\deftypefunx = \empty
- \let\Edeftypefun = \empty
- \let\deftypeivar = \empty
- \let\deftypeivarx = \empty
- \let\Edeftypeivar = \empty
- \let\deftypemethod = \empty
- \let\deftypemethodx = \empty
- \let\Edeftypemethod = \empty
- \let\deftypeop = \empty
- \let\deftypeopx = \empty
- \let\Edeftypeop = \empty
- \let\deftypevar = \empty
- \let\deftypevarx = \empty
- \let\Edeftypevar = \empty
- \let\deftypevr = \empty
- \let\deftypevrx = \empty
- \let\Edeftypevr = \empty
- \let\defun = \empty
- \let\defunx = \empty
- \let\Edefun = \empty
- \let\defvar = \empty
- \let\defvarx = \empty
- \let\Edefvar = \empty
- \let\defvr = \empty
- \let\defvrx = \empty
- \let\Edefvr = \empty
- \let\clear = \relax
- \let\down = \relax
- \let\evenfooting = \relax
- \let\evenheading = \relax
- \let\everyfooting = \relax
- \let\everyheading = \relax
- \let\headings = \relax
- \let\include = \relax
- \let\item = \relax
- \let\lowersections = \relax
- \let\oddfooting = \relax
- \let\oddheading = \relax
- \let\printindex = \relax
- \let\pxref = \relax
- \let\raisesections = \relax
- \let\ref = \relax
- \let\set = \relax
- \let\setchapternewpage = \relax
- \let\setchapterstyle = \relax
- \let\settitle = \relax
- \let\up = \relax
- \let\verbatiminclude = \relax
- \let\xref = \relax
+
+% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
+% @ifnotxml always succeed. They currently do nothing; we don't
+% attempt to check whether the conditionals are properly nested. But we
+% have to remember that they are conditionals, so that @end doesn't
+% attempt to close an environment group.
+%
+\def\makecond#1{%
+ \expandafter\let\csname #1\endcsname = \relax
+ \expandafter\let\csname iscond.#1\endcsname = 1
}
+\makecond{iftex}
+\makecond{ifnotdocbook}
+\makecond{ifnothtml}
+\makecond{ifnotinfo}
+\makecond{ifnotplaintext}
+\makecond{ifnotxml}
% Ignore @ignore, @ifhtml, @ifinfo, and the like.
%
\def\direntry{\doignore{direntry}}
-\def\documentdescriptionword{documentdescription}
\def\documentdescription{\doignore{documentdescription}}
+\def\docbook{\doignore{docbook}}
\def\html{\doignore{html}}
+\def\ifdocbook{\doignore{ifdocbook}}
\def\ifhtml{\doignore{ifhtml}}
\def\ifinfo{\doignore{ifinfo}}
\def\ifnottex{\doignore{ifnottex}}
@@ -2599,198 +2743,133 @@ width0pt\relax} \fi
\def\menu{\doignore{menu}}
\def\xml{\doignore{xml}}
-% @dircategory CATEGORY -- specify a category of the dir file
-% which this file should belong to. Ignore this in TeX.
-\let\dircategory = \comment
-
-% Ignore text until a line `@end #1'.
+% Ignore text until a line `@end #1', keeping track of nested conditionals.
%
+% A count to remember the depth of nesting.
+\newcount\doignorecount
+
\def\doignore#1{\begingroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define a command to swallow text until we reach `@end #1'.
- % This @ is a catcode 12 token (that is the normal catcode of @ in
- % this texinfo.tex file). We change the catcode of @ below to match.
- \long\def\doignoretext##1@end #1{\enddoignore}%
+ % Scan in ``verbatim'' mode:
+ \catcode`\@ = \other
+ \catcode`\{ = \other
+ \catcode`\} = \other
%
% Make sure that spaces turn into tokens that match what \doignoretext wants.
- \catcode\spaceChar = 10
- %
- % Ignore braces, too, so mismatched braces don't cause trouble.
- \catcode`\{ = 9
- \catcode`\} = 9
+ \spaceisspace
%
- % We must not have @c interpreted as a control sequence.
- \catcode`\@ = 12
+ % Count number of #1's that we've seen.
+ \doignorecount = 0
%
- \def\ignoreword{#1}%
- \ifx\ignoreword\documentdescriptionword
- % The c kludge breaks documentdescription, since
- % `documentdescription' contains a `c'. Means not everything will
- % be ignored inside @documentdescription, but oh well...
- \else
- % Make the letter c a comment character so that the rest of the line
- % will be ignored. This way, the document can have (for example)
- % @c @end ifinfo
- % and the @end ifinfo will be properly ignored.
- % (We've just changed @ to catcode 12.)
- \catcode`\c = 14
- \fi
- %
- % And now expand the command defined above.
- \doignoretext
-}
-
-% What we do to finish off ignored text.
-%
-\def\enddoignore{\endgroup\ignorespaces}%
-
-\newif\ifwarnedobs\warnedobsfalse
-\def\obstexwarn{%
- \ifwarnedobs\relax\else
- % We need to warn folks that they may have trouble with TeX 3.0.
- % This uses \immediate\write16 rather than \message to get newlines.
- \immediate\write16{}
- \immediate\write16{WARNING: for users of Unix TeX 3.0!}
- \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
- \immediate\write16{If you are running another version of TeX, relax.}
- \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
- \immediate\write16{ Then upgrade your TeX installation if you can.}
- \immediate\write16{ (See ftp://ftp.gnu.org/non-gnu/TeX.README.)}
- \immediate\write16{If you are stuck with version 3.0, run the}
- \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
- \immediate\write16{ to use a workaround.}
- \immediate\write16{}
- \global\warnedobstrue
- \fi
+ % Swallow text until we reach the matching `@end #1'.
+ \dodoignore {#1}%
}
-% **In TeX 3.0, setting text in \nullfont hangs tex. For a
-% workaround (which requires the file ``dummy.tfm'' to be installed),
-% uncomment the following line:
-%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
-
-% Ignore text, except that we keep track of conditional commands for
-% purposes of nesting, up to an `@end #1' command.
-%
-\def\nestedignore#1{%
- \obstexwarn
- % We must actually expand the ignored text to look for the @end
- % command, so that nested ignore constructs work. Thus, we put the
- % text into a \vbox and then do nothing with the result. To minimize
- % the chance of memory overflow, we follow the approach outlined on
- % page 401 of the TeXbook.
+{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
+ \obeylines %
%
- \setbox0 = \vbox\bgroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define `@end #1' to end the box, which will in turn undefine the
- % @end command again.
- \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
- %
- % We are going to be parsing Texinfo commands. Most cause no
- % trouble when they are used incorrectly, but some commands do
- % complicated argument parsing or otherwise get confused, so we
- % undefine them.
- %
- % We can't do anything about stray @-signs, unfortunately;
- % they'll produce `undefined control sequence' errors.
- \ignoremorecommands
- %
- % Set the current font to be \nullfont, a TeX primitive, and define
- % all the font commands to also use \nullfont. We don't use
- % dummy.tfm, as suggested in the TeXbook, because some sites
- % might not have that installed. Therefore, math mode will still
- % produce output, but that should be an extremely small amount of
- % stuff compared to the main input.
- %
- \nullfont
- \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
- \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
- \let\tensf=\nullfont
- % Similarly for index fonts.
- \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
- \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
- \let\smallsf=\nullfont
- % Similarly for smallexample fonts.
- \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont
- \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont
- \let\smallersf=\nullfont
- %
- % Don't complain when characters are missing from the fonts.
- \tracinglostchars = 0
+ \gdef\dodoignore#1{%
+ % #1 contains the string `ifinfo'.
%
- % Don't bother to do space factor calculations.
- \frenchspacing
- %
- % Don't report underfull hboxes.
- \hbadness = 10000
- %
- % Do minimal line-breaking.
- \pretolerance = 10000
+ % Define a command to find the next `@end #1', which must be on a line
+ % by itself.
+ \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}%
+ % And this command to find another #1 command, at the beginning of a
+ % line. (Otherwise, we would consider a line `@c @ifset', for
+ % example, to count as an @ifset for nesting.)
+ \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
%
- % Do not execute instructions in @tex.
- \def\tex{\doignore{tex}}%
- % Do not execute macro definitions.
- % `c' is a comment character, so the word `macro' will get cut off.
- \def\macro{\doignore{ma}}%
+ % And now expand that command.
+ \obeylines %
+ \doignoretext ^^M%
+ }%
}
+\def\doignoreyyy#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty % Nothing found.
+ \let\next\doignoretextzzz
+ \else % Found a nested condition, ...
+ \advance\doignorecount by 1
+ \let\next\doignoretextyyy % ..., look for another.
+ % If we're here, #1 ends with ^^M\ifinfo (for example).
+ \fi
+ \next #1% the token \_STOP_ is present just after this macro.
+}
+
+% We have to swallow the remaining "\_STOP_".
+%
+\def\doignoretextzzz#1{%
+ \ifnum\doignorecount = 0 % We have just found the outermost @end.
+ \let\next\enddoignore
+ \else % Still inside a nested condition.
+ \advance\doignorecount by -1
+ \let\next\doignoretext % Look for the next @end.
+ \fi
+ \next
+}
+
+% Finish off ignored text.
+\def\enddoignore{\endgroup\ignorespaces}
+
+
% @set VAR sets the variable VAR to an empty value.
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
%
% Since we want to separate VAR from REST-OF-LINE (which might be
% empty), we can't just use \parsearg; we have to insert a space of our
% own to delimit the rest of the line, and then take it out again if we
-% didn't need it. Make sure the catcode of space is correct to avoid
-% losing inside @example, for instance.
+% didn't need it.
+% We rely on the fact that \parsearg sets \catcode`\ =10.
%
-\def\set{\begingroup\catcode` =10
- \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
- \parsearg\setxxx}
-\def\setxxx#1{\setyyy#1 \endsetyyy}
+\parseargdef\set{\setyyy#1 \endsetyyy}
\def\setyyy#1 #2\endsetyyy{%
- \def\temp{#2}%
- \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
- \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
- \fi
- \endgroup
+ {%
+ \makevalueexpandable
+ \def\temp{#2}%
+ \edef\next{\gdef\makecsname{SET#1}}%
+ \ifx\temp\empty
+ \next{}%
+ \else
+ \setzzz#2\endsetzzz
+ \fi
+ }%
}
-% Can't use \xdef to pre-expand #2 and save some time, since \temp or
-% \next or other control sequences that we've defined might get us into
-% an infinite loop. Consider `@set foo @cite{bar}'.
-\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+% Remove the trailing space \setxxx inserted.
+\def\setzzz#1 \endsetzzz{\next{#1}}
% @clear VAR clears (i.e., unsets) the variable VAR.
%
-\def\clear{\parsearg\clearxxx}
-\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+\parseargdef\clear{%
+ {%
+ \makevalueexpandable
+ \global\expandafter\let\csname SET#1\endcsname=\relax
+ }%
+}
% @value{foo} gets the text saved in variable foo.
+\def\value{\begingroup\makevalueexpandable\valuexxx}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
{
- \catcode`\_ = \active
+ \catcode`\- = \active \catcode`\_ = \active
%
- % We might end up with active _ or - characters in the argument if
- % we're called from @code, as @code{@value{foo-bar_}}. So \let any
- % such active characters to their normal equivalents.
- \gdef\value{\begingroup
+ \gdef\makevalueexpandable{%
+ \let\value = \expandablevalue
+ % We don't want these characters active, ...
\catcode`\-=\other \catcode`\_=\other
- \indexbreaks \let_\normalunderscore
- \valuexxx}
+ % ..., but we might end up with active ones in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}, though.
+ % So \let them to their normal equivalents.
+ \let-\realdash \let_\normalunderscore
+ }
}
-\def\valuexxx#1{\expandablevalue{#1}\endgroup}
% We have this subroutine so that we can handle at least some @value's
-% properly in indexes (we \let\value to this in \indexdummies). Ones
-% whose names contain - or _ still won't work, but we can't do anything
-% about that. The command has to be fully expandable (if the variable
-% is set), since the result winds up in the index file. This means that
-% if the variable's value contains other Texinfo commands, it's almost
-% certain it will fail (although perhaps we could fix that with
-% sufficient work to do a one-level expansion on the result, instead of
-% complete).
+% properly in indexes (we call \makevalueexpandable in \indexdummies).
+% The command has to be fully expandable (if the variable is set), since
+% the result winds up in the index file. This means that if the
+% variable's value contains other Texinfo commands, it's almost certain
+% it will fail (although perhaps we could fix that with sufficient work
+% to do a one-level expansion on the result, instead of complete).
%
\def\expandablevalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
@@ -2804,55 +2883,36 @@ width0pt\relax} \fi
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
%
-\def\ifset{\parsearg\doifset}
-\def\doifset#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \let\next=\ifsetfail
- \else
- \let\next=\ifsetsucceed
- \fi
- \next
+% To get special treatment of `@end ifset,' call \makeond and the redefine.
+%
+\makecond{ifset}
+\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
+\def\doifset#1#2{%
+ {%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname SET#2\endcsname\relax
+ #1% If not set, redefine \next.
+ \fi
+ \expandafter
+ }\next
}
-\def\ifsetsucceed{\conditionalsucceed{ifset}}
-\def\ifsetfail{\nestedignore{ifset}}
-\defineunmatchedend{ifset}
+\def\ifsetfail{\doignore{ifset}}
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear.
%
-\def\ifclear{\parsearg\doifclear}
-\def\doifclear#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \let\next=\ifclearsucceed
- \else
- \let\next=\ifclearfail
- \fi
- \next
-}
-\def\ifclearsucceed{\conditionalsucceed{ifclear}}
-\def\ifclearfail{\nestedignore{ifclear}}
-\defineunmatchedend{ifclear}
-
-% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we
-% read the text following, through the first @end iftex (etc.). Make
-% `@end iftex' (etc.) valid only after an @iftex.
+% The `\else' inside the `\doifset' parameter is a trick to reuse the
+% above code: if the variable is not set, do nothing, if it is set,
+% then redefine \next to \ifclearfail.
%
-\def\iftex{\conditionalsucceed{iftex}}
-\def\ifnothtml{\conditionalsucceed{ifnothtml}}
-\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
-\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}}
-\defineunmatchedend{iftex}
-\defineunmatchedend{ifnothtml}
-\defineunmatchedend{ifnotinfo}
-\defineunmatchedend{ifnotplaintext}
+\makecond{ifclear}
+\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
+\def\ifclearfail{\doignore{ifclear}}
-% True conditional. Since \set globally defines its variables, we can
-% just start and end a group (to keep the @end definition undefined at
-% the outer level).
-%
-\def\conditionalsucceed#1{\begingroup
- \expandafter\def\csname E#1\endcsname{\endgroup}%
-}
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory=\comment
% @defininfoenclose.
\let\definfoenclose=\comment
@@ -2903,10 +2963,10 @@ width0pt\relax} \fi
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
-%
+%
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
-%
+%
\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
@@ -2948,13 +3008,13 @@ width0pt\relax} \fi
% Take care of Texinfo commands that can appear in an index entry.
% Since there are some commands we want to expand, and others we don't,
% we have to laboriously prevent expansion for those that we don't.
-%
+%
\def\indexdummies{%
\def\@{@}% change to @@ when we switch to @ as escape char in index files.
\def\ {\realbackslash\space }%
% Need these in case \tex is in effect and \{ is a \delimiter again.
% But can't use \lbracecmd and \rbracecmd because texindex assumes
- % braces and backslashes are used only as delimiters.
+ % braces and backslashes are used only as delimiters.
\let\{ = \mylbrace
\let\} = \myrbrace
%
@@ -2963,14 +3023,14 @@ width0pt\relax} \fi
% words, not control letters, because the \space would be incorrect
% for control characters, but is needed to separate the control word
% from whatever follows.
- %
+ %
% For control letters, we have \definedummyletter, which omits the
% space.
- %
+ %
% These can be used both for control words that take an argument and
% those that do not. If it is followed by {arg} in the input, then
% that will dutifully get written to the index (or wherever).
- %
+ %
\def\definedummyword##1{%
\expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
}%
@@ -2983,9 +3043,9 @@ width0pt\relax} \fi
}
% For the aux file, @ is the escape character. So we want to redefine
-% everything using @ instead of \realbackslash. When everything uses
+% everything using @ instead of \realbackslash. When everything uses
% @, this will be simpler.
-%
+%
\def\atdummies{%
\def\@{@@}%
\def\ {@ }%
@@ -3006,31 +3066,16 @@ width0pt\relax} \fi
% Called from \indexdummies and \atdummies. \definedummyword and
% \definedummyletter must be defined first.
-%
+%
\def\commondummies{%
%
\normalturnoffactive
%
- % Control letters and accents.
+ \commondummiesnofonts
+ %
\definedummyletter{_}%
- \definedummyletter{,}%
- \definedummyletter{"}%
- \definedummyletter{`}%
- \definedummyletter{'}%
- \definedummyletter{^}%
- \definedummyletter{~}%
- \definedummyletter{=}%
- \definedummyword{u}%
- \definedummyword{v}%
- \definedummyword{H}%
- \definedummyword{dotaccent}%
- \definedummyword{ringaccent}%
- \definedummyword{tieaccent}%
- \definedummyword{ubaraccent}%
- \definedummyword{udotaccent}%
- \definedummyword{dotless}%
- %
- % Other non-English letters.
+ %
+ % Non-English letters.
\definedummyword{AA}%
\definedummyword{AE}%
\definedummyword{L}%
@@ -3042,6 +3087,10 @@ width0pt\relax} \fi
\definedummyword{oe}%
\definedummyword{o}%
\definedummyword{ss}%
+ \definedummyword{exclamdown}%
+ \definedummyword{questiondown}%
+ \definedummyword{ordf}%
+ \definedummyword{ordm}%
%
% Although these internal commands shouldn't show up, sometimes they do.
\definedummyword{bf}%
@@ -3053,37 +3102,13 @@ width0pt\relax} \fi
\definedummyword{tclose}%
\definedummyword{tt}%
%
- % Texinfo font commands.
- \definedummyword{b}%
- \definedummyword{i}%
- \definedummyword{r}%
- \definedummyword{sc}%
- \definedummyword{t}%
- %
+ \definedummyword{LaTeX}%
\definedummyword{TeX}%
- \definedummyword{acronym}%
- \definedummyword{cite}%
- \definedummyword{code}%
- \definedummyword{command}%
- \definedummyword{dfn}%
- \definedummyword{dots}%
- \definedummyword{emph}%
- \definedummyword{env}%
- \definedummyword{file}%
- \definedummyword{kbd}%
- \definedummyword{key}%
- \definedummyword{math}%
- \definedummyword{option}%
- \definedummyword{samp}%
- \definedummyword{strong}%
- \definedummyword{uref}%
- \definedummyword{url}%
- \definedummyword{var}%
- \definedummyword{w}%
%
% Assorted special characters.
\definedummyword{bullet}%
\definedummyword{copyright}%
+ \definedummyword{registeredsymbol}%
\definedummyword{dots}%
\definedummyword{enddots}%
\definedummyword{equiv}%
@@ -3095,10 +3120,9 @@ width0pt\relax} \fi
\definedummyword{print}%
\definedummyword{result}%
%
- % Handle some cases of @value -- where the variable name does not
- % contain - or _, and the value does not contain any
+ % Handle some cases of @value -- where it does not contain any
% (non-fully-expandable) commands.
- \let\value = \expandablevalue
+ \makevalueexpandable
%
% Normal spaces, not active ones.
\unsepspaces
@@ -3107,45 +3131,91 @@ width0pt\relax} \fi
\turnoffmacros
}
-% If an index command is used in an @example environment, any spaces
-% therein should become regular spaces in the raw index file, not the
-% expansion of \tie (\leavevmode \penalty \@M \ ).
-{\obeyspaces
- \gdef\unsepspaces{\obeyspaces\let =\space}}
-
+% \commondummiesnofonts: common to \commondummies and \indexnofonts.
+%
+% Better have this without active chars.
+{
+ \catcode`\~=\other
+ \gdef\commondummiesnofonts{%
+ % Control letters and accents.
+ \definedummyletter{!}%
+ \definedummyletter{"}%
+ \definedummyletter{'}%
+ \definedummyletter{*}%
+ \definedummyletter{,}%
+ \definedummyletter{.}%
+ \definedummyletter{/}%
+ \definedummyletter{:}%
+ \definedummyletter{=}%
+ \definedummyletter{?}%
+ \definedummyletter{^}%
+ \definedummyletter{`}%
+ \definedummyletter{~}%
+ \definedummyword{u}%
+ \definedummyword{v}%
+ \definedummyword{H}%
+ \definedummyword{dotaccent}%
+ \definedummyword{ringaccent}%
+ \definedummyword{tieaccent}%
+ \definedummyword{ubaraccent}%
+ \definedummyword{udotaccent}%
+ \definedummyword{dotless}%
+ %
+ % Texinfo font commands.
+ \definedummyword{b}%
+ \definedummyword{i}%
+ \definedummyword{r}%
+ \definedummyword{sc}%
+ \definedummyword{t}%
+ %
+ % Commands that take arguments.
+ \definedummyword{acronym}%
+ \definedummyword{cite}%
+ \definedummyword{code}%
+ \definedummyword{command}%
+ \definedummyword{dfn}%
+ \definedummyword{emph}%
+ \definedummyword{env}%
+ \definedummyword{file}%
+ \definedummyword{kbd}%
+ \definedummyword{key}%
+ \definedummyword{math}%
+ \definedummyword{option}%
+ \definedummyword{samp}%
+ \definedummyword{strong}%
+ \definedummyword{tie}%
+ \definedummyword{uref}%
+ \definedummyword{url}%
+ \definedummyword{var}%
+ \definedummyword{verb}%
+ \definedummyword{w}%
+ }
+}
% \indexnofonts is used when outputting the strings to sort the index
% by, and when constructing control sequence names. It eliminates all
% control sequences and just writes whatever the best ASCII sort string
% would be for a given command (usually its argument).
%
-\def\indexdummytex{TeX}
-\def\indexdummydots{...}
-%
\def\indexnofonts{%
+ \def\definedummyword##1{%
+ \expandafter\let\csname ##1\endcsname\asis
+ }%
+ \let\definedummyletter=\definedummyword
+ %
+ \commondummiesnofonts
+ %
+ % Don't no-op \tt, since it isn't a user-level command
+ % and is used in the definitions of the active chars like <, >, |, etc.
+ % Likewise with the other plain tex font commands.
+ %\let\tt=\asis
+ %
\def\ { }%
\def\@{@}%
% how to handle braces?
\def\_{\normalunderscore}%
%
- \let\,=\asis
- \let\"=\asis
- \let\`=\asis
- \let\'=\asis
- \let\^=\asis
- \let\~=\asis
- \let\==\asis
- \let\u=\asis
- \let\v=\asis
- \let\H=\asis
- \let\dotaccent=\asis
- \let\ringaccent=\asis
- \let\tieaccent=\asis
- \let\ubaraccent=\asis
- \let\udotaccent=\asis
- \let\dotless=\asis
- %
- % Other non-English letters.
+ % Non-English letters.
\def\AA{AA}%
\def\AE{AE}%
\def\L{L}%
@@ -3159,130 +3229,164 @@ width0pt\relax} \fi
\def\ss{ss}%
\def\exclamdown{!}%
\def\questiondown{?}%
+ \def\ordf{a}%
+ \def\ordm{o}%
%
- % Don't no-op \tt, since it isn't a user-level command
- % and is used in the definitions of the active chars like <, >, |, etc.
- % Likewise with the other plain tex font commands.
- %\let\tt=\asis
+ \def\LaTeX{LaTeX}%
+ \def\TeX{TeX}%
%
- % Texinfo font commands.
- \let\b=\asis
- \let\i=\asis
- \let\r=\asis
- \let\sc=\asis
- \let\t=\asis
- %
- \let\TeX=\indexdummytex
- \let\acronym=\asis
- \let\cite=\asis
- \let\code=\asis
- \let\command=\asis
- \let\dfn=\asis
- \let\dots=\indexdummydots
- \let\emph=\asis
- \let\env=\asis
- \let\file=\asis
- \let\kbd=\asis
- \let\key=\asis
- \let\math=\asis
- \let\option=\asis
- \let\samp=\asis
- \let\strong=\asis
- \let\uref=\asis
- \let\url=\asis
- \let\var=\asis
- \let\w=\asis
+ % Assorted special characters.
+ % (The following {} will end up in the sort string, but that's ok.)
+ \def\bullet{bullet}%
+ \def\copyright{copyright}%
+ \def\registeredsymbol{R}%
+ \def\dots{...}%
+ \def\enddots{...}%
+ \def\equiv{==}%
+ \def\error{error}%
+ \def\expansion{==>}%
+ \def\minus{-}%
+ \def\pounds{pounds}%
+ \def\point{.}%
+ \def\print{-|}%
+ \def\result{=>}%
}
\let\indexbackslash=0 %overridden during \printindex.
\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
-% For \ifx comparisons.
-\def\emptymacro{\empty}
-
% Most index entries go through here, but \dosubind is the general case.
-%
-\def\doind#1#2{\dosubind{#1}{#2}\empty}
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{\dosubind{#1}{#2}{}}
% Workhorse for all \fooindexes.
% #1 is name of index, #2 is stuff to put there, #3 is subentry --
-% \empty if called from \doind, as we usually are. The main exception
-% is with defuns, which call us directly.
+% empty if called from \doind, as we usually are (the main exception
+% is with most defuns, which call us directly).
%
\def\dosubind#1#2#3{%
+ \iflinks
+ {%
+ % Store the main index entry text (including the third arg).
+ \toks0 = {#2}%
+ % If third arg is present, precede it with a space.
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\empty \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ \edef\writeto{\csname#1indfile\endcsname}%
+ %
+ \ifvmode
+ \dosubindsanitize
+ \else
+ \dosubindwrite
+ \fi
+ }%
+ \fi
+}
+
+% Write the entry in \toks0 to the index file:
+%
+\def\dosubindwrite{%
% Put the index entry in the margin if desired.
\ifx\SETmarginindex\relax\else
- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
\fi
- {%
- \count255=\lastpenalty
- {%
- \indexdummies % Must do this here, since \bf, etc expand at this stage
- \escapechar=`\\
- {%
- \let\folio = 0% We will expand all macros now EXCEPT \folio.
- \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
- % so it will be output as is; and it will print as backslash.
- %
- % The main index entry text.
- \toks0 = {#2}%
- %
- % If third arg is present, precede it with space in sort key.
- \def\thirdarg{#3}%
- \ifx\thirdarg\emptymacro \else
- % If the third (subentry) arg is present, add it to the index
- % line to write.
- \toks0 = \expandafter{\the\toks0 \space #3}%
- \fi
- %
- % Process the index entry with all font commands turned off, to
- % get the string to sort by.
- {\indexnofonts
- \edef\temp{\the\toks0}% need full expansion
- \xdef\indexsorttmp{\temp}%
- }%
- %
- % Set up the complete index entry, with both the sort key and
- % the original text, including any font commands. We write
- % three arguments to \entry to the .?? file (four in the
- % subentry case), texindex reduces to two when writing the .??s
- % sorted result.
- \edef\temp{%
- \write\csname#1indfile\endcsname{%
- \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
- }%
- %
- % If a skip is the last thing on the list now, preserve it
- % by backing up by \lastskip, doing the \write, then inserting
- % the skip again. Otherwise, the whatsit generated by the
- % \write will make \lastskip zero. The result is that sequences
- % like this:
- % @end defun
- % @tindex whatever
- % @defun ...
- % will have extra space inserted, because the \medbreak in the
- % start of the @defun won't see the skip inserted by the @end of
- % the previous defun.
- %
- % But don't do any of this if we're not in vertical mode. We
- % don't want to do a \vskip and prematurely end a paragraph.
- %
- % Avoid page breaks due to these extra skips, too.
- %
- \iflinks
- \ifvmode
- \skip0 = \lastskip
- \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi
- \fi
- %
- \temp % do the write
- %
- \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
- \fi
- }%
- }%
- \penalty\count255
+ %
+ % Remember, we are within a group.
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \escapechar=`\\
+ \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ % Process the index entry with all font commands turned off, to
+ % get the string to sort by.
+ {\indexnofonts
+ \edef\temp{\the\toks0}% need full expansion
+ \xdef\indexsorttmp{\temp}%
+ }%
+ %
+ % Set up the complete index entry, with both the sort key and
+ % the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file (four in the
+ % subentry case), texindex reduces to two when writing the .??s
+ % sorted result.
+ \edef\temp{%
+ \write\writeto{%
+ \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
}%
+ \temp
+}
+
+% Take care of unwanted page breaks:
+%
+% If a skip is the last thing on the list now, preserve it
+% by backing up by \lastskip, doing the \write, then inserting
+% the skip again. Otherwise, the whatsit generated by the
+% \write will make \lastskip zero. The result is that sequences
+% like this:
+% @end defun
+% @tindex whatever
+% @defun ...
+% will have extra space inserted, because the \medbreak in the
+% start of the @defun won't see the skip inserted by the @end of
+% the previous defun.
+%
+% But don't do any of this if we're not in vertical mode. We
+% don't want to do a \vskip and prematurely end a paragraph.
+%
+% Avoid page breaks due to these extra skips, too.
+%
+% But wait, there is a catch there:
+% We'll have to check whether \lastskip is zero skip. \ifdim is not
+% sufficient for this purpose, as it ignores stretch and shrink parts
+% of the skip. The only way seems to be to check the textual
+% representation of the skip.
+%
+% The following is almost like \def\zeroskipmacro{0.0pt} except that
+% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
+%
+\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
+%
+% ..., ready, GO:
+%
+\def\dosubindsanitize{%
+ % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
+ \skip0 = \lastskip
+ \edef\lastskipmacro{\the\lastskip}%
+ \count255 = \lastpenalty
+ %
+ % If \lastskip is nonzero, that means the last item was a
+ % skip. And since a skip is discardable, that means this
+ % -\skip0 glue we're inserting is preceded by a
+ % non-discardable item, therefore it is not a potential
+ % breakpoint, therefore no \nobreak needed.
+ \ifx\lastskipmacro\zeroskipmacro
+ \else
+ \vskip-\skip0
+ \fi
+ %
+ \dosubindwrite
+ %
+ \ifx\lastskipmacro\zeroskipmacro
+ % if \lastskip was zero, perhaps the last item was a
+ % penalty, and perhaps it was >=10000, e.g., a \nobreak.
+ % In that case, we want to re-insert the penalty; since we
+ % just inserted a non-discardable item, any following glue
+ % (such as a \parskip) would be a breakpoint. For example:
+ % @deffn deffn-whatever
+ % @vindex index-whatever
+ % Description.
+ % would allow a break between the index-whatever whatsit
+ % and the "Description." paragraph.
+ \ifnum\count255>9999 \nobreak \fi
+ \else
+ % On the other hand, if we had a nonzero \lastskip,
+ % this make-up glue would be preceded by a non-discardable item
+ % (the whatsit from the \write), so we must insert a \nobreak.
+ \nobreak\vskip\skip0
+ \fi
}
% The index entry written in the file actually looks like
@@ -3320,13 +3424,12 @@ width0pt\relax} \fi
% @printindex causes a particular index (the ??s file) to get printed.
% It does not print any chapter heading (usually an @unnumbered).
%
-\def\printindex{\parsearg\doprintindex}
-\def\doprintindex#1{\begingroup
+\parseargdef\printindex{\begingroup
\dobreak \chapheadingskip{10000}%
%
\smallfonts \rm
\tolerance = 9500
- \indexbreaks
+ \everypar = {}% don't want the \kern\-parindent from indentation suppression.
%
% See if the index file exists and is nonempty.
% Change catcode of @ here so that if the index file contains
@@ -3353,7 +3456,7 @@ width0pt\relax} \fi
% Index files are almost Texinfo source, but we use \ as the escape
% character. It would be better to use @, but that's too big a change
% to make right now.
- \def\indexbackslash{\rawbackslashxx}%
+ \def\indexbackslash{\backslashcurfont}%
\catcode`\\ = 0
\escapechar = `\\
\begindoublecolumns
@@ -3391,74 +3494,95 @@ width0pt\relax} \fi
\nobreak
}}
-% This typesets a paragraph consisting of #1, dot leaders, and then #2
-% flush to the right margin. It is used for index and table of contents
-% entries. The paragraph is indented by \leftskip.
+% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
+% then page number (#2) flushed to the right margin. It is used for index
+% and table of contents entries. The paragraph is indented by \leftskip.
%
-\def\entry#1#2{\begingroup
- %
- % Start a new paragraph if necessary, so our assignments below can't
- % affect previous text.
- \par
- %
- % Do not fill out the last line with white space.
- \parfillskip = 0in
- %
- % No extra space above this paragraph.
- \parskip = 0in
- %
- % Do not prefer a separate line ending with a hyphen to fewer lines.
- \finalhyphendemerits = 0
- %
- % \hangindent is only relevant when the entry text and page number
- % don't both fit on one line. In that case, bob suggests starting the
- % dots pretty far over on the line. Unfortunately, a large
- % indentation looks wrong when the entry text itself is broken across
- % lines. So we use a small indentation and put up with long leaders.
- %
- % \hangafter is reset to 1 (which is the value we want) at the start
- % of each paragraph, so we need not do anything with that.
- \hangindent = 2em
- %
- % When the entry text needs to be broken, just fill out the first line
- % with blank space.
- \rightskip = 0pt plus1fil
- %
- % A bit of stretch before each entry for the benefit of balancing columns.
- \vskip 0pt plus1pt
- %
- % Start a ``paragraph'' for the index entry so the line breaking
- % parameters we've set above will have an effect.
- \noindent
- %
- % Insert the text of the index entry. TeX will do line-breaking on it.
- #1%
- % The following is kludged to not output a line of dots in the index if
- % there are no page numbers. The next person who breaks this will be
- % cursed by a Unix daemon.
- \def\tempa{{\rm }}%
- \def\tempb{#2}%
- \edef\tempc{\tempa}%
- \edef\tempd{\tempb}%
- \ifx\tempc\tempd\ \else%
+% A straightforward implementation would start like this:
+% \def\entry#1#2{...
+% But this frozes the catcodes in the argument, and can cause problems to
+% @code, which sets - active. This problem was fixed by a kludge---
+% ``-'' was active throughout whole index, but this isn't really right.
+%
+% The right solution is to prevent \entry from swallowing the whole text.
+% --kasal, 21nov03
+\def\entry{%
+ \begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
%
- % If we must, put the page number on a line of its own, and fill out
- % this line with blank space. (The \hfil is overwhelmed with the
- % fill leaders glue in \indexdotfill if the page number does fit.)
- \hfil\penalty50
- \null\nobreak\indexdotfill % Have leaders before the page number.
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
%
- % The `\ ' here is removed by the implicit \unskip that TeX does as
- % part of (the primitive) \par. Without it, a spurious underfull
- % \hbox ensues.
- \ifpdf
- \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ % A bit of stretch before each entry for the benefit of balancing
+ % columns.
+ \vskip 0pt plus1pt
+ %
+ % Swallow the left brace of the text (first parameter):
+ \afterassignment\doentry
+ \let\temp =
+}
+\def\doentry{%
+ \bgroup % Instead of the swallowed brace.
+ \noindent
+ \aftergroup\finishentry
+ % And now comes the text of the entry.
+}
+\def\finishentry#1{%
+ % #1 is the page number.
+ %
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \def\tempa{{\rm }}%
+ \def\tempb{#1}%
+ \edef\tempc{\tempa}%
+ \edef\tempd{\tempb}%
+ \ifx\tempc\tempd
+ \ %
\else
- \ #2% The page number ends the paragraph.
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ifpdf
+ \pdfgettoks#1.%
+ \ \the\toksA
+ \else
+ \ #1%
+ \fi
\fi
- \fi%
- \par
-\endgroup}
+ \par
+ \endgroup
+}
% Like \dotfill except takes at least 1 em.
\def\indexdotfill{\cleaders
@@ -3569,7 +3693,7 @@ width0pt\relax} \fi
\wd0=\hsize \wd2=\hsize
\hbox to\pagewidth{\box0\hfil\box2}%
}
-%
+%
% All done with double columns.
\def\enddoublecolumns{%
\output = {%
@@ -3627,6 +3751,12 @@ width0pt\relax} \fi
\message{sectioning,}
% Chapters, sections, etc.
+% \unnumberedno is an oxymoron, of course. But we count the unnumbered
+% sections so that we can refer to them unambiguously in the pdf
+% outlines by their "section number". We avoid collisions with chapter
+% numbers by starting them at 10000. (If a document ever has 10000
+% chapters, we're in trouble anyway, I'm sure.)
+\newcount\unnumberedno \unnumberedno = 10000
\newcount\chapno
\newcount\secno \secno=0
\newcount\subsecno \subsecno=0
@@ -3634,9 +3764,12 @@ width0pt\relax} \fi
% This counter is funny since it counts through charcodes of letters A, B, ...
\newcount\appendixno \appendixno = `\@
+%
% \def\appendixletter{\char\the\appendixno}
-% We do the following for the sake of pdftex, which needs the actual
+% We do the following ugly conditional instead of the above simple
+% construct for the sake of pdftex, which needs the actual
% letter in the expansion, not just typeset.
+%
\def\appendixletter{%
\ifnum\appendixno=`A A%
\else\ifnum\appendixno=`B B%
@@ -3674,11 +3807,12 @@ width0pt\relax} \fi
% Each @chapter defines this as the name of the chapter.
% page headings and footings can use it. @section does likewise.
+% However, they are not reliable, because we don't use marks.
\def\thischapter{}
\def\thissection{}
\newcount\absseclevel % used to calculate proper heading level
-\newcount\secbase\secbase=0 % @raise/lowersections modify this count
+\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
% @raisesections: treat @section as chapter, @subsection as section, etc.
\def\raisesections{\global\advance\secbase by -1}
@@ -3693,113 +3827,105 @@ width0pt\relax} \fi
% #2 is text for heading
\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
\ifcase\absseclevel
- \chapterzzz{#2}
-\or
- \seczzz{#2}
-\or
- \numberedsubseczzz{#2}
-\or
- \numberedsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \chapterzzz{#2}
+ \chapterzzz{#2}%
+ \or \seczzz{#2}%
+ \or \numberedsubseczzz{#2}%
+ \or \numberedsubsubseczzz{#2}%
\else
- \numberedsubsubseczzz{#2}
+ \ifnum \absseclevel<0 \chapterzzz{#2}%
+ \else \numberedsubsubseczzz{#2}%
+ \fi
\fi
-\fi
+ \suppressfirstparagraphindent
}
% like \numhead, but chooses appendix heading levels
\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
\ifcase\absseclevel
- \appendixzzz{#2}
-\or
- \appendixsectionzzz{#2}
-\or
- \appendixsubseczzz{#2}
-\or
- \appendixsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \appendixzzz{#2}
+ \appendixzzz{#2}%
+ \or \appendixsectionzzz{#2}%
+ \or \appendixsubseczzz{#2}%
+ \or \appendixsubsubseczzz{#2}%
\else
- \appendixsubsubseczzz{#2}
+ \ifnum \absseclevel<0 \appendixzzz{#2}%
+ \else \appendixsubsubseczzz{#2}%
+ \fi
\fi
-\fi
+ \suppressfirstparagraphindent
}
% like \numhead, but chooses numberless heading levels
\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \unnumberedzzz{#2}
-\or
- \unnumberedseczzz{#2}
-\or
- \unnumberedsubseczzz{#2}
-\or
- \unnumberedsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \unnumberedzzz{#2}
+ \ifcase\absseclevel
+ \unnumberedzzz{#2}%
+ \or \unnumberedseczzz{#2}%
+ \or \unnumberedsubseczzz{#2}%
+ \or \unnumberedsubsubseczzz{#2}%
\else
- \unnumberedsubsubseczzz{#2}
+ \ifnum \absseclevel<0 \unnumberedzzz{#2}%
+ \else \unnumberedsubsubseczzz{#2}%
+ \fi
\fi
-\fi
+ \suppressfirstparagraphindent
}
-% @chapter, @appendix, @unnumbered.
-\def\thischaptername{No Chapter Title}
-\outer\def\chapter{\parsearg\chapteryyy}
-\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz #1{%
- \secno=0 \subsecno=0 \subsubsecno=0
- \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
- \chapmacro {#1}{\the\chapno}%
- \gdef\thissection{#1}%
- \gdef\thischaptername{#1}%
- % We don't substitute the actual chapter name into \thischapter
- % because we don't want its macros evaluated now.
- \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
- \writetocentry{chap}{#1}{{\the\chapno}}
- \donoderef
+% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
+% all lower-level sectioning counters to zero.
+%
+% Also set \chaplevelprefix, which we prepend to @float sequence numbers
+% (e.g., figures), q.v. By default (before any chapter), that is empty.
+\let\chaplevelprefix = \empty
+%
+\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz#1{%
+ % section resetting is \global in case the chapter is in a group, such
+ % as an @include file.
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\chapno by 1
+ %
+ % Used for \float.
+ \gdef\chaplevelprefix{\the\chapno.}%
+ \resetallfloatnos
+ %
+ \message{\putwordChapter\space \the\chapno}%
+ %
+ % Write the actual heading.
+ \chapmacro{#1}{Ynumbered}{\the\chapno}%
+ %
+ % So @section and the like are numbered underneath this chapter.
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
\global\let\subsubsection = \numberedsubsubsec
}
-% we use \chapno to avoid indenting back
-\def\appendixbox#1{%
- \setbox0 = \hbox{\putwordAppendix{} \the\chapno}%
- \hbox to \wd0{#1\hss}}
-
-\outer\def\appendix{\parsearg\appendixyyy}
-\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
-\def\appendixzzz #1{%
- \secno=0 \subsecno=0 \subsubsecno=0
- \global\advance \appendixno by 1
- \message{\putwordAppendix\space \appendixletter}%
- \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
- \gdef\thissection{#1}%
- \gdef\thischaptername{#1}%
- \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
- \writetocentry{appendix}{#1}{{\appendixletter}}
- \appendixnoderef
+\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\appendixno by 1
+ \gdef\chaplevelprefix{\appendixletter.}%
+ \resetallfloatnos
+ %
+ \def\appendixnum{\putwordAppendix\space \appendixletter}%
+ \message{\appendixnum}%
+ %
+ \chapmacro{#1}{Yappendix}{\appendixletter}%
+ %
\global\let\section = \appendixsec
\global\let\subsection = \appendixsubsec
\global\let\subsubsection = \appendixsubsubsec
}
% @centerchap is like @unnumbered, but the heading is centered.
-\outer\def\centerchap{\parsearg\centerchapyyy}
-\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+\outer\parseargdef\centerchap{{\unnumberedyyy{#1}}}
-% @top is like @unnumbered.
-\outer\def\top{\parsearg\unnumberedyyy}
-
-\outer\def\unnumbered{\parsearg\unnumberedyyy}
-\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
-\def\unnumberedzzz #1{%
- \secno=0 \subsecno=0 \subsubsecno=0
+\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\unnumberedno by 1
+ %
+ % Since an unnumbered has no number, no prefix for figures.
+ \global\let\chaplevelprefix = \empty
+ \resetallfloatnos
%
% This used to be simply \message{#1}, but TeX fully expands the
% argument to \message. Therefore, if #1 contained @-commands, TeX
@@ -3812,112 +3938,84 @@ width0pt\relax} \fi
% \the<toks register> to achieve this: TeX expands \the<toks> only once,
% simply yielding the contents of <toks register>. (We also do this for
% the toc entries.)
- \toks0 = {#1}\message{(\the\toks0)}%
+ \toks0 = {#1}%
+ \message{(\the\toks0)}%
+ %
+ \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
%
- \unnumbchapmacro {#1}%
- \gdef\thischapter{#1}\gdef\thissection{#1}%
- \writetocentry{unnumbchap}{#1}{{\the\chapno}}
- \unnumbnoderef
\global\let\section = \unnumberedsec
\global\let\subsection = \unnumberedsubsec
\global\let\subsubsection = \unnumberedsubsubsec
}
+% @top is like @unnumbered.
+\let\top\unnumbered
+
% Sections.
-\outer\def\numberedsec{\parsearg\secyyy}
-\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
-\def\seczzz #1{%
- \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
- \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
- \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}}
- \donoderef
- \nobreak
+\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
+\def\seczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
}
-\outer\def\appendixsection{\parsearg\appendixsecyyy}
-\outer\def\appendixsec{\parsearg\appendixsecyyy}
-\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
-\def\appendixsectionzzz #1{%
- \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
- \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
- \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}}
- \appendixnoderef
- \nobreak
+\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
}
+\let\appendixsec\appendixsection
-\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
-\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
-\def\unnumberedseczzz #1{%
- \plainsecheading {#1}\gdef\thissection{#1}%
- \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}}
- \unnumbnoderef
- \nobreak
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
}
% Subsections.
-\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
-\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
-\def\numberedsubseczzz #1{%
- \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
- \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
- \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
- \donoderef
- \nobreak
+\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
}
-\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
-\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
-\def\appendixsubseczzz #1{%
- \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
- \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
- \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}}
- \appendixnoderef
- \nobreak
+\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno}%
}
-\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
-\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
-\def\unnumberedsubseczzz #1{%
- \plainsubsecheading {#1}\gdef\thissection{#1}%
- \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
- \unnumbnoderef
- \nobreak
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno}%
}
% Subsubsections.
-\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
-\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
-\def\numberedsubsubseczzz #1{%
- \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
- \subsubsecheading {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
- \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
- \donoderef
- \nobreak
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynumbered}%
+ {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
}
-\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
-\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
-\def\appendixsubsubseczzz #1{%
- \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
- \subsubsecheading {#1}
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
- \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
- \appendixnoderef
- \nobreak
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
}
-\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
-\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
-\def\unnumberedsubsubseczzz #1{%
- \plainsubsubsecheading {#1}\gdef\thissection{#1}%
- \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
- \unnumbnoderef
- \nobreak
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
}
% These are variants which are not "outer", so they can appear in @ifinfo.
-% Actually, they should now be obsolete; ordinary section commands should work.
+% Actually, they are now be obsolete; ordinary section commands should work.
\def\infotop{\parsearg\unnumberedzzz}
\def\infounnumbered{\parsearg\unnumberedzzz}
\def\infounnumberedsec{\parsearg\unnumberedseczzz}
@@ -3937,9 +4035,9 @@ width0pt\relax} \fi
% These macros control what the section commands do, according
% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
% Define them by default for a numbered chapter.
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
+\let\section = \numberedsec
+\let\subsection = \numberedsubsec
+\let\subsubsection = \numberedsubsubsec
% Define @majorheading, @heading and @subheading
@@ -3952,23 +4050,27 @@ width0pt\relax} \fi
% if justification is not attempted. Hence \raggedright.
-\def\majorheading{\parsearg\majorheadingzzz}
-\def\majorheadingzzz #1{%
+\def\majorheading{%
{\advance\chapheadingskip by 10pt \chapbreak }%
- {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
+ \parsearg\chapheadingzzz
+}
-\def\chapheading{\parsearg\chapheadingzzz}
-\def\chapheadingzzz #1{\chapbreak %
+\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
+\def\chapheadingzzz#1{%
{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
+ \rm #1\hfill}}%
+ \bigskip \par\penalty 200\relax
+ \suppressfirstparagraphindent
+}
% @heading, @subheading, @subsubheading.
-\def\heading{\parsearg\plainsecheading}
-\def\subheading{\parsearg\plainsubsecheading}
-\def\subsubheading{\parsearg\plainsubsubsecheading}
+\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
% These macros generate a chapter, section, etc. heading only
% (including whitespace, linebreaking, etc. around it),
@@ -4001,7 +4103,7 @@ width0pt\relax} \fi
\global\let\pagealignmacro=\chappager
\global\def\HEADINGSon{\HEADINGSsingle}}
-\def\CHAPPAGodd{
+\def\CHAPPAGodd{%
\global\let\contentsalignmacro = \chapoddpage
\global\let\pchapsepmacro=\chapoddpage
\global\let\pagealignmacro=\chapoddpage
@@ -4009,30 +4111,79 @@ width0pt\relax} \fi
\CHAPPAGon
-\def\CHAPFplain{
+\def\CHAPFplain{%
\global\let\chapmacro=\chfplain
-\global\let\unnumbchapmacro=\unnchfplain
\global\let\centerchapmacro=\centerchfplain}
-% Plain chapter opening.
-% #1 is the text, #2 the chapter number or empty if unnumbered.
-\def\chfplain#1#2{%
+% Normal chapter opening.
+%
+% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
+% Yappendix, Yomitfromtoc), #3 the chapter number.
+%
+% To test against our argument.
+\def\Ynothingkeyword{Ynothing}
+\def\Yomitfromtockeyword{Yomitfromtoc}
+\def\Yappendixkeyword{Yappendix}
+%
+\def\chfplain#1#2#3{%
\pchapsepmacro
{%
\chapfonts \rm
- \def\chapnum{#2}%
- \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
+ %
+ % Have to define \thissection before calling \donoderef, because the
+ % xref code eventually uses it. On the other hand, it has to be called
+ % after \pchapsepmacro, or the headline will change too soon.
+ \gdef\thissection{#1}%
+ \gdef\thischaptername{#1}%
+ %
+ % Only insert the separating space if we have a chapter/appendix
+ % number, and don't print the unnumbered ``number''.
+ \def\temptype{#2}%
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unnchap}%
+ \def\thischapter{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
+ \def\toctype{omit}%
+ \xdef\thischapter{}%
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
+ \def\toctype{app}%
+ % We don't substitute the actual chapter name into \thischapter
+ % because we don't want its macros evaluated now. And we don't
+ % use \thissection because that changes with each section.
+ %
+ \xdef\thischapter{\putwordAppendix{} \appendixletter:
+ \noexpand\thischaptername}%
+ \else
+ \setbox0 = \hbox{#3\enspace}%
+ \def\toctype{numchap}%
+ \xdef\thischapter{\putwordChapter{} \the\chapno:
+ \noexpand\thischaptername}%
+ \fi\fi\fi
+ %
+ % Write the toc entry for this chapter. Must come before the
+ % \donoderef, because we include the current node name in the toc
+ % entry, and \donoderef resets it to empty.
+ \writetocentry{\toctype}{#1}{#3}%
+ %
+ % For pdftex, we have to write out the node definition (aka, make
+ % the pdfdest) after any page break, but before the actual text has
+ % been typeset. If the destination for the pdf outline is after the
+ % text, then jumping from the outline may wind up with the text not
+ % being visible, for instance under high magnification.
+ \donoderef{#2}%
+ %
+ % Typeset the actual heading.
\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
- \hangindent = \wd0 \centerparametersmaybe
+ \hangindent=\wd0 \centerparametersmaybe
\unhbox0 #1\par}%
}%
\nobreak\bigskip % no page break after a chapter title
\nobreak
}
-% Plain opening for unnumbered.
-\def\unnchfplain#1{\chfplain{#1}{}}
-
% @centerchap -- centered and unnumbered.
\let\centerparametersmaybe = \relax
\def\centerchfplain#1{{%
@@ -4041,11 +4192,14 @@ width0pt\relax} \fi
\leftskip = \rightskip
\parfillskip = 0pt
}%
- \chfplain{#1}{}%
+ \chfplain{#1}{Ynothing}{}%
}}
\CHAPFplain % The default
+% I don't think this chapter style is supported any more, so I'm not
+% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
+%
\def\unnchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
@@ -4063,61 +4217,95 @@ width0pt\relax} \fi
\hfill {\rm #1}\hfill}}\bigskip \par\nobreak
}
-\def\CHAPFopen{
+\def\CHAPFopen{%
\global\let\chapmacro=\chfopen
-\global\let\unnumbchapmacro=\unnchfopen
\global\let\centerchapmacro=\centerchfopen}
-% Section titles.
+% Section titles. These macros combine the section number parts and
+% call the generic \sectionheading to do the printing.
+%
\newskip\secheadingskip
-\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
-\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
-\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
+\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
% Subsection titles.
-\newskip \subsecheadingskip
-\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
-\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
-\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
+\newskip\subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
% Subsubsection titles.
-\let\subsubsecheadingskip = \subsecheadingskip
-\let\subsubsecheadingbreak = \subsecheadingbreak
-\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
-\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
+\def\subsubsecheadingskip{\subsecheadingskip}
+\def\subsubsecheadingbreak{\subsecheadingbreak}
-% Print any size section title.
-%
-% #1 is the section type (sec/subsec/subsubsec), #2 is the section
-% number (maybe empty), #3 the text.
-\def\sectionheading#1#2#3{%
- {%
- \expandafter\advance\csname #1headingskip\endcsname by \parskip
- \csname #1headingbreak\endcsname
- }%
+% Print any size, any type, section title.
+%
+% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
+% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
+% section number.
+%
+\def\sectionheading#1#2#3#4{%
{%
% Switch to the right set of fonts.
- \csname #1fonts\endcsname \rm
+ \csname #2fonts\endcsname \rm
+ %
+ % Insert space above the heading.
+ \csname #2headingbreak\endcsname
%
- % Only insert the separating space if we have a section number.
- \def\secnum{#2}%
- \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
+ % Only insert the space after the number if we have a section number.
+ \def\sectionlevel{#2}%
+ \def\temptype{#3}%
%
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unn}%
+ \gdef\thissection{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ % for @headings -- no section number, don't include in toc,
+ % and don't redefine \thissection.
+ \setbox0 = \hbox{}%
+ \def\toctype{omit}%
+ \let\sectionlevel=\empty
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{app}%
+ \gdef\thissection{#1}%
+ \else
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{num}%
+ \gdef\thissection{#1}%
+ \fi\fi\fi
+ %
+ % Write the toc entry (before \donoderef). See comments in \chfplain.
+ \writetocentry{\toctype\sectionlevel}{#1}{#4}%
+ %
+ % Write the node reference (= pdf destination for pdftex).
+ % Again, see comments in \chfplain.
+ \donoderef{#3}%
+ %
+ % Output the actual section heading.
\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
- \hangindent = \wd0 % zero if no section number
- \unhbox0 #3}%
+ \hangindent=\wd0 % zero if no section number
+ \unhbox0 #1}%
}%
- % Add extra space after the heading -- either a line space or a
- % paragraph space, whichever is more. (Some people like to set
- % \parskip to large values for some reason.) Don't allow stretch, though.
+ % Add extra space after the heading -- half of whatever came above it.
+ % Don't allow stretch, though.
+ \kern .5 \csname #2headingskip\endcsname
+ %
+ % Do not let the kern be a potential breakpoint, as it would be if it
+ % was followed by glue.
\nobreak
- \ifdim\parskip>\normalbaselineskip
- \kern\parskip
- \else
- \kern\normalbaselineskip
- \fi
+ %
+ % We'll almost certainly start a paragraph next, so don't let that
+ % glue accumulate. (Not a breakpoint because it's preceded by a
+ % discardable item.)
+ \vskip-\parskip
+ %
+ % This \nobreak is purely so the last item on the list is a \penalty
+ % of 10000. This is so other code, for instance \parsebodycommon, can
+ % check for and avoid allowing breakpoints. Otherwise, it would
+ % insert a valid breakpoint between:
+ % @section sec-whatever
+ % @deffn def-whatever
\nobreak
}
@@ -4127,119 +4315,152 @@ width0pt\relax} \fi
\newwrite\tocfile
% Write an entry to the toc file, opening it if necessary.
-% Called from @chapter, etc. We supply {\folio} at the end of the
-% argument, which will end up as the last argument to the \...entry macro.
-%
-% Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}}
+% Called from @chapter, etc.
+%
+% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
+% We append the current node name (if any) and page number as additional
+% arguments for the \{chap,sec,...}entry macros which will eventually
+% read this. The node name is used in the pdf outlines as the
+% destination to jump to.
+%
% We open the .toc file for writing here instead of at @setfilename (or
% any other fixed time) so that @contents can be anywhere in the document.
+% But if #1 is `omit', then we don't do anything. This is used for the
+% table of contents chapter openings themselves.
%
\newif\iftocfileopened
+\def\omitkeyword{omit}%
+%
\def\writetocentry#1#2#3{%
- \iftocfileopened\else
- \immediate\openout\tocfile = \jobname.toc
- \global\tocfileopenedtrue
- \fi
- %
- \iflinks
- \toks0 = {#2}%
- \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}%
- \temp
+ \edef\writetoctype{#1}%
+ \ifx\writetoctype\omitkeyword \else
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ %
+ \iflinks
+ \toks0 = {#2}%
+ \toks2 = \expandafter{\lastnode}%
+ \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}{#3}%
+ {\the\toks2}{\noexpand\folio}}}%
+ \temp
+ \fi
\fi
%
- % Tell \shipout to create a page destination if we're doing pdf, which
- % will be the target of the links in the table of contents. We can't
- % just do it on every page because the title pages are numbered 1 and
- % 2 (the page numbers aren't printed), and so are the first two pages
- % of the document. Thus, we'd have two destinations named `1', and
- % two named `2'.
- \ifpdf \pdfmakepagedesttrue \fi
+ % Tell \shipout to create a pdf destination on each page, if we're
+ % writing pdf. These are used in the table of contents. We can't
+ % just write one on every page because the title pages are numbered
+ % 1 and 2 (the page numbers aren't printed), and so are the first
+ % two pages of the document. Thus, we'd have two destinations named
+ % `1', and two named `2'.
+ \ifpdf \global\pdfmakepagedesttrue \fi
}
\newskip\contentsrightmargin \contentsrightmargin=1in
\newcount\savepageno
\newcount\lastnegativepageno \lastnegativepageno = -1
-% Finish up the main text and prepare to read what we've written
-% to \tocfile.
+% Prepare to read what we've written to \tocfile.
%
\def\startcontents#1{%
- % If @setchapternewpage on, and @headings double, the contents should
- % start on an odd page, unlike chapters. Thus, we maintain
- % \contentsalignmacro in parallel with \pagealignmacro.
- % From: Torbjorn Granlund <tege@matematik.su.se>
- \contentsalignmacro
- \immediate\closeout\tocfile
- %
- % Don't need to put `Contents' or `Short Contents' in the headline.
- % It is abundantly clear what they are.
- \unnumbchapmacro{#1}\def\thischapter{}%
- \savepageno = \pageno
- \begingroup % Set up to handle contents files properly.
- \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
- % We can't do this, because then an actual ^ in a section
- % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
- %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
- \raggedbottom % Worry more about breakpoints than the bottom.
- \advance\hsize by -\contentsrightmargin % Don't use the full line length.
- %
- % Roman numerals for page numbers.
- \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \def\thischapter{}%
+ \chapmacro{#1}{Yomitfromtoc}{}%
+ %
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
+ % We can't do this, because then an actual ^ in a section
+ % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
+ %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
}
% Normal (long) toc.
\def\contents{%
- \startcontents{\putwordTOC}%
- \openin 1 \jobname.toc
- \ifeof 1 \else
- \closein 1
- \input \jobname.toc
- \fi
- \vfill \eject
- \contentsalignmacro % in case @setchapternewpage odd is in effect
- \pdfmakeoutlines
- \endgroup
- \lastnegativepageno = \pageno
- \global\pageno = \savepageno
+ \startcontents{\putwordTOC}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \ifeof 1 \else
+ \pdfmakeoutlines
+ \fi
+ \closein 1
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
}
% And just the chapters.
\def\summarycontents{%
- \startcontents{\putwordShortTOC}%
- %
- \let\chapentry = \shortchapentry
- \let\appendixentry = \shortappendixentry
- \let\unnumbchapentry = \shortunnumberedentry
- % We want a true roman here for the page numbers.
- \secfonts
- \let\rm=\shortcontrm \let\bf=\shortcontbf
- \let\sl=\shortcontsl \let\tt=\shortconttt
- \rm
- \hyphenpenalty = 10000
- \advance\baselineskip by 1pt % Open it up a little.
- \def\secentry ##1##2##3##4{}
- \def\subsecentry ##1##2##3##4##5{}
- \def\subsubsecentry ##1##2##3##4##5##6{}
- \let\unnumbsecentry = \secentry
- \let\unnumbsubsecentry = \subsecentry
- \let\unnumbsubsubsecentry = \subsubsecentry
- \openin 1 \jobname.toc
- \ifeof 1 \else
- \closein 1
- \input \jobname.toc
- \fi
- \vfill \eject
- \contentsalignmacro % in case @setchapternewpage odd is in effect
- \endgroup
- \lastnegativepageno = \pageno
- \global\pageno = \savepageno
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\numchapentry = \shortchapentry
+ \let\appentry = \shortchapentry
+ \let\unnchapentry = \shortunnchapentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf
+ \let\sl=\shortcontsl \let\tt=\shortconttt
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\numsecentry##1##2##3##4{}
+ \let\appsecentry = \numsecentry
+ \let\unnsecentry = \numsecentry
+ \let\numsubsecentry = \numsecentry
+ \let\appsubsecentry = \numsecentry
+ \let\unnsubsecentry = \numsecentry
+ \let\numsubsubsecentry = \numsecentry
+ \let\appsubsubsecentry = \numsecentry
+ \let\unnsubsubsecentry = \numsecentry
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \input \jobname.toc
+ \fi
+ \closein 1
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
}
\let\shortcontents = \summarycontents
-\ifpdf
- \pdfcatalog{/PageMode /UseOutlines}%
-\fi
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
+%
+\def\shortchaplabel#1{%
+ % This space should be enough, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % But use \hss just in case.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ %
+ % We'd like to right-justify chapter numbers, but that looks strange
+ % with appendix letters. And right-justifying numbers and
+ % left-justifying letters looks strange when there is less than 10
+ % chapters. Have to read the whole toc once to know how many chapters
+ % there are before deciding ...
+ \hbox to 1em{#1\hss}%
+}
% These macros generate individual entries in the table of contents.
% The first argument is the chapter or section name.
@@ -4247,58 +4468,46 @@ width0pt\relax} \fi
% The arguments in between are the chapter number, section number, ...
% Chapters, in the main contents.
-\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
+\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
%
% Chapters, in the short toc.
% See comments in \dochapentry re vbox and related settings.
-\def\shortchapentry#1#2#3{%
- \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
+\def\shortchapentry#1#2#3#4{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
}
% Appendices, in the main contents.
-\def\appendixentry#1#2#3{%
- \dochapentry{\appendixbox{\putwordAppendix{} #2}\labelspace#1}{#3}}
-%
-% Appendices, in the short toc.
-\let\shortappendixentry = \shortchapentry
-
-% Typeset the label for a chapter or appendix for the short contents.
-% The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter.
-% We could simplify the code here by writing out an \appendixentry
-% command in the toc file for appendices, instead of using \chapentry
-% for both, but it doesn't seem worth it.
-%
-\newdimen\shortappendixwidth
+% Need the word Appendix, and a fixed-size box.
+%
+\def\appendixbox#1{%
+ % We use M since it's probably the widest letter.
+ \setbox0 = \hbox{\putwordAppendix{} M}%
+ \hbox to \wd0{\putwordAppendix{} #1\hss}}
%
-\def\shortchaplabel#1{%
- % This space should be enough, since a single number is .5em, and the
- % widest letter (M) is 1em, at least in the Computer Modern fonts.
- % But use \hss just in case.
- % (This space doesn't include the extra space that gets added after
- % the label; that gets put in by \shortchapentry above.)
- \dimen0 = 1em
- \hbox to \dimen0{#1\hss}%
-}
+\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
% Unnumbered chapters.
-\def\unnumbchapentry#1#2#3{\dochapentry{#1}{#3}}
-\def\shortunnumberedentry#1#2#3{\tocentry{#1}{\doshortpageno\bgroup#3\egroup}}
+\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
% Sections.
-\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
-\def\unnumbsecentry#1#2#3#4{\dosecentry{#1}{#4}}
+\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
+\let\appsecentry=\numsecentry
+\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
% Subsections.
-\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
-\def\unnumbsubsecentry#1#2#3#4#5{\dosubsecentry{#1}{#5}}
+\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsecentry=\numsubsecentry
+\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
% And subsubsections.
-\def\subsubsecentry#1#2#3#4#5#6{%
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
-\def\unnumbsubsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#1}{#6}}
+\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsubsecentry=\numsubsubsecentry
+\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
% This parameter controls the indentation of the various levels.
-\newdimen\tocindent \tocindent = 3pc
+% Same as \defaultparindent.
+\newdimen\tocindent \tocindent = 15pt
% Now for the actual typesetting. In all these, #1 is the text and #2 is the
% page number.
@@ -4329,17 +4538,8 @@ width0pt\relax} \fi
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
-% Final typesetting of a toc entry; we use the same \entry macro as for
-% the index entries, but we want to suppress hyphenation here. (We
-% can't do that in the \entry macro, since index entries might consist
-% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
-\def\tocentry#1#2{\begingroup
- \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
- % Do not use \turnoffactive in these arguments. Since the toc is
- % typeset in cmr, characters such as _ would come out wrong; we
- % have to do the usual translation tricks.
- \entry{#1}{#2}%
-\endgroup}
+% We use the same \entry macro as for the index entries.
+\let\tocentry = \entry
% Space between chapter (or whatever) number and the title.
\def\labelspace{\hskip1em \relax}
@@ -4349,15 +4549,15 @@ width0pt\relax} \fi
\def\chapentryfonts{\secfonts \rm}
\def\secentryfonts{\textfonts}
-\let\subsecentryfonts = \textfonts
-\let\subsubsecentryfonts = \textfonts
+\def\subsecentryfonts{\textfonts}
+\def\subsubsecentryfonts{\textfonts}
\message{environments,}
% @foo ... @end foo.
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
-%
+%
% Since these characters are used in examples, it should be an even number of
% \tt widths. Each \tt character is 1en, so two makes it 1em.
%
@@ -4369,7 +4569,7 @@ width0pt\relax} \fi
% The @error{} command.
% Adapted from the TeXbook's \boxit.
-%
+%
\newbox\errorbox
%
{\tentt \global\dimen0 = 3em}% Width of the box.
@@ -4377,10 +4577,10 @@ width0pt\relax} \fi
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
%
-\global\setbox\errorbox=\hbox to \dimen0{\hfil
+\setbox\errorbox=\hbox to \dimen0{\hfil
\hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
\advance\hsize by -2\dimen2 % Rules.
- \vbox{
+ \vbox{%
\hrule height\dimen2
\hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
\vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
@@ -4394,14 +4594,13 @@ width0pt\relax} \fi
% One exception: @ is still an escape character, so that @end tex works.
% But \@ or @@ will get a plain tex @ character.
-\def\tex{\begingroup
+\envdef\tex{%
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
\catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
\catcode `\%=14
\catcode `\+=\other
\catcode `\"=\other
- \catcode `\==\other
\catcode `\|=\other
\catcode `\<=\other
\catcode `\>=\other
@@ -4416,19 +4615,23 @@ width0pt\relax} \fi
\let\equiv=\ptexequiv
\let\!=\ptexexclam
\let\i=\ptexi
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
\let\{=\ptexlbrace
\let\+=\tabalign
\let\}=\ptexrbrace
+ \let\/=\ptexslash
\let\*=\ptexstar
\let\t=\ptext
%
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
\def\@{@}%
-\let\Etex=\endgroup}
+}
+% There is no need to define \Etex.
% Define @lisp ... @end lisp.
-% @lisp does a \begingroup so it can rebind things,
+% @lisp environment forms a group so it can rebind things,
% including the definition of @end lisp (which normally is erroneous).
% Amount to narrow the margins by for @lisp.
@@ -4439,19 +4642,6 @@ width0pt\relax} \fi
% have any width.
\def\lisppar{\null\endgraf}
-% Make each space character in the input produce a normal interword
-% space in the output. Don't allow a line break at this space, as this
-% is used only in environments like @example, where each line of input
-% should produce a line of output anyway.
-%
-{\obeyspaces %
-\gdef\sepspaces{\obeyspaces\let =\tie}}
-
-% Define \obeyedspace to be our active space, whatever it is. This is
-% for use in \parsearg.
-{\sepspaces%
-\global\let\obeyedspace= }
-
% This space is always present above and below environments.
\newskip\envskipamount \envskipamount = 0pt
@@ -4469,7 +4659,7 @@ width0pt\relax} \fi
\removelastskip
% it's not a good place to break if the last penalty was \nobreak
% or better ...
- \ifnum\lastpenalty>10000 \else \penalty-50 \fi
+ \ifnum\lastpenalty<10000 \penalty-50 \fi
\vskip\envskipamount
\fi
\fi
@@ -4501,52 +4691,52 @@ width0pt\relax} \fi
%
\newskip\lskip\newskip\rskip
-\def\cartouche{%
-\par % can't be in the midst of a paragraph.
-\begingroup
- \lskip=\leftskip \rskip=\rightskip
- \leftskip=0pt\rightskip=0pt %we want these *outside*.
- \cartinner=\hsize \advance\cartinner by-\lskip
- \advance\cartinner by-\rskip
- \cartouter=\hsize
- \advance\cartouter by 18.4pt % allow for 3pt kerns on either
-% side, and for 6pt waste from
-% each corner char, and rule thickness
- \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
- % Flag to tell @lisp, etc., not to narrow margin.
- \let\nonarrowing=\comment
- \vbox\bgroup
- \baselineskip=0pt\parskip=0pt\lineskip=0pt
- \carttop
- \hbox\bgroup
- \hskip\lskip
- \vrule\kern3pt
- \vbox\bgroup
- \hsize=\cartinner
- \kern3pt
- \begingroup
- \baselineskip=\normbskip
- \lineskip=\normlskip
- \parskip=\normpskip
- \vskip -\parskip
+\envdef\cartouche{%
+ \ifhmode\par\fi % can't be in the midst of a paragraph.
+ \startsavinginserts
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt % we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+ % side, and for 6pt waste from
+ % each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing=\comment
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \kern3pt
+ \hsize=\cartinner
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+ \comment % For explanation, see the end of \def\group.
+}
\def\Ecartouche{%
- \endgroup
- \kern3pt
- \egroup
- \kern3pt\vrule
- \hskip\rskip
- \egroup
- \cartbot
- \egroup
-\endgroup
-}}
+ \ifhmode\par\fi
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+ \checkinserts
+}
% This macro is called at the beginning of all the @example variants,
% inside a group.
\def\nonfillstart{%
\aboveenvbreak
- \inENV % This group ends at the end of the body
\hfuzz = 12pt % Don't be fussy
\sepspaces % Make spaces be word-separators rather than space tokens.
\let\par = \lisppar % don't ignore blank lines
@@ -4559,103 +4749,99 @@ width0pt\relax} \fi
\ifx\nonarrowing\relax
\advance \leftskip by \lispnarrowing
\exdentamount=\lispnarrowing
- \let\exdent=\nofillexdent
- \let\nonarrowing=\relax
\fi
+ \let\exdent=\nofillexdent
}
-% Define the \E... control sequence only if we are inside the particular
-% environment, so the error checking in \end will work.
+% If you want all examples etc. small: @set dispenvsize small.
+% If you want even small examples the full size: @set dispenvsize nosmall.
+% This affects the following displayed environments:
+% @example, @display, @format, @lisp
%
-% To end an @example-like environment, we first end the paragraph (via
-% \afterenvbreak's vertical glue), and then the group. That way we keep
-% the zero \parskip that the environments set -- \parskip glue will be
-% inserted at the beginning of the next paragraph in the document, after
-% the environment.
-%
-\def\nonfillfinish{\afterenvbreak\endgroup}
+\def\smallword{small}
+\def\nosmallword{nosmall}
+\let\SETdispenvsize\relax
+\def\setnormaldispenv{%
+ \ifx\SETdispenvsize\smallword
+ \smallexamplefonts \rm
+ \fi
+}
+\def\setsmalldispenv{%
+ \ifx\SETdispenvsize\nosmallword
+ \else
+ \smallexamplefonts \rm
+ \fi
+}
-% @lisp: indented, narrowed, typewriter font.
-\def\lisp{\begingroup
- \nonfillstart
- \let\Elisp = \nonfillfinish
- \tt
- \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
- \gobble % eat return
+% We often define two environments, @foo and @smallfoo.
+% Let's do it by one command:
+\def\makedispenv #1#2{
+ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
+ \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
+ \expandafter\let\csname E#1\endcsname \afterenvbreak
+ \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
}
-% @example: Same as @lisp.
-\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
+% Define two synonyms:
+\def\maketwodispenvs #1#2#3{
+ \makedispenv{#1}{#3}
+ \makedispenv{#2}{#3}
+}
+% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
+%
% @smallexample and @smalllisp: use smaller fonts.
% Originally contributed by Pavel@xerox.
-\def\smalllisp{\begingroup
- \def\Esmalllisp{\nonfillfinish\endgroup}%
- \def\Esmallexample{\nonfillfinish\endgroup}%
- \smallexamplefonts
- \lisp
+%
+\maketwodispenvs {lisp}{example}{%
+ \nonfillstart
+ \tt
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
}
-\let\smallexample = \smalllisp
-
-% @display: same as @lisp except keep current font.
+% @display/@smalldisplay: same as @lisp except keep current font.
%
-\def\display{\begingroup
+\makedispenv {display}{%
\nonfillstart
- \let\Edisplay = \nonfillfinish
\gobble
}
-%
-% @smalldisplay: @display plus smaller fonts.
-%
-\def\smalldisplay{\begingroup
- \def\Esmalldisplay{\nonfillfinish\endgroup}%
- \smallexamplefonts \rm
- \display
-}
-% @format: same as @display except don't narrow margins.
+% @format/@smallformat: same as @display except don't narrow margins.
%
-\def\format{\begingroup
- \let\nonarrowing = t
+\makedispenv{format}{%
+ \let\nonarrowing = t%
\nonfillstart
- \let\Eformat = \nonfillfinish
\gobble
}
-%
-% @smallformat: @format plus smaller fonts.
-%
-\def\smallformat{\begingroup
- \def\Esmallformat{\nonfillfinish\endgroup}%
- \smallexamplefonts \rm
- \format
-}
-% @flushleft (same as @format).
-%
-\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
+% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
+\envdef\flushleft{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+\let\Eflushleft = \afterenvbreak
% @flushright.
%
-\def\flushright{\begingroup
- \let\nonarrowing = t
+\envdef\flushright{%
+ \let\nonarrowing = t%
\nonfillstart
- \let\Eflushright = \nonfillfinish
\advance\leftskip by 0pt plus 1fill
\gobble
}
+\let\Eflushright = \afterenvbreak
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
-% and narrows the margins.
+% and narrows the margins. We keep \parskip nonzero in general, since
+% we're doing normal filling. So, when using \aboveenvbreak and
+% \afterenvbreak, temporarily make \parskip 0.
%
-\def\quotation{%
- \begingroup\inENV %This group ends at the end of the @quotation body
+\envdef\quotation{%
{\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
\parindent=0pt
- % We have retained a nonzero parskip for the environment, since we're
- % doing normal filling. So to avoid extra space below the environment...
- \def\Equotation{\parskip = 0pt \nonfillfinish}%
%
% @cartouche defines \nonarrowing to inhibit narrowing at next level down.
\ifx\nonarrowing\relax
@@ -4664,11 +4850,32 @@ width0pt\relax} \fi
\exdentamount = \lispnarrowing
\let\nonarrowing = \relax
\fi
+ \parsearg\quotationlabel
+}
+
+% We have retained a nonzero parskip for the environment, since we're
+% doing normal filling.
+%
+\def\Equotation{%
+ \par
+ \ifx\quotationauthor\undefined\else
+ % indent a bit.
+ \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
+ \fi
+ {\parskip=0pt \afterenvbreak}%
+}
+
+% If we're given an argument, typeset it in bold with a colon after.
+\def\quotationlabel#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty \else
+ {\bf #1: }%
+ \fi
}
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
-% If we want to allow any <char> as delimiter,
+% If we want to allow any <char> as delimiter,
% we need the curly braces so that makeinfo sees the @verb command, eg:
% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
%
@@ -4685,7 +4892,7 @@ width0pt\relax} \fi
%
% [Knuth] p. 380
\def\uncatcodespecials{%
- \def\do##1{\catcode`##1=12}\dospecials}
+ \def\do##1{\catcode`##1=\other}\dospecials}
%
% [Knuth] pp. 380,381,391
% Disable Spanish ligatures ?` and !` of \tt font
@@ -4733,6 +4940,8 @@ width0pt\relax} \fi
}
\endgroup
\def\setupverbatim{%
+ \nonfillstart
+ \advance\leftskip by -\defbodyindent
% Easiest (and conventionally used) font for verbatim
\tt
\def\par{\leavevmode\egroup\box0\endgraf}%
@@ -4746,15 +4955,15 @@ width0pt\relax} \fi
\everypar{\starttabbox}%
}
-% Do the @verb magic: verbatim text is quoted by unique
-% delimiter characters. Before first delimiter expect a
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
% right brace, after last delimiter expect closing brace:
%
% \def\doverb'{'<char>#1<char>'}'{#1}
%
% [Knuth] p. 382; only eat outer {}
\begingroup
- \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
+ \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
\gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
\endgroup
%
@@ -4766,18 +4975,11 @@ width0pt\relax} \fi
%
% \def\doverbatim#1@end verbatim{#1}
%
-% For Texinfo it's a lot easier than for LaTeX,
+% For Texinfo it's a lot easier than for LaTeX,
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
% we need not redefine '\', '{' and '}'.
%
% Inspired by LaTeX's verbatim command set [latex.ltx]
-%% Include LaTeX hack for completeness -- never know
-%% \begingroup
-%% \catcode`|=0 \catcode`[=1
-%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
-%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
-%% #1|endgroup|def|Everbatim[]|end[verbatim]]
-%% |endgroup
%
\begingroup
\catcode`\ =\active
@@ -4785,62 +4987,41 @@ width0pt\relax} \fi
% ignore everything up to the first ^^M, that's the newline at the end
% of the @verbatim input line itself. Otherwise we get an extra blank
% line in the output.
- \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}%
+ \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+ % We really want {...\end verbatim} in the body of the macro, but
+ % without the active space; thus we have to use \xdef and \gobble.
\endgroup
%
-\def\verbatim{%
- \def\Everbatim{\nonfillfinish\endgroup}%
- \begingroup
- \nonfillstart
- \advance\leftskip by -\defbodyindent
- \begingroup\setupverbatim\doverbatim
+\envdef\verbatim{%
+ \setupverbatim\doverbatim
}
+\let\Everbatim = \afterenvbreak
+
% @verbatiminclude FILE - insert text of file in verbatim environment.
%
-% Allow normal characters that we make active in the argument (a file name).
-\def\verbatiminclude{%
- \begingroup
- \catcode`\\=\other
- \catcode`~=\other
- \catcode`^=\other
- \catcode`_=\other
- \catcode`|=\other
- \catcode`<=\other
- \catcode`>=\other
- \catcode`+=\other
- \parsearg\doverbatiminclude
-}
-\def\setupverbatiminclude{%
- \begingroup
- \nonfillstart
- \advance\leftskip by -\defbodyindent
- \begingroup\setupverbatim
-}
+\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
%
\def\doverbatiminclude#1{%
- % Restore active chars for included file.
- \endgroup
- \begingroup
- \let\value=\expandablevalue
- \def\thisfile{#1}%
- \expandafter\expandafter\setupverbatiminclude\input\thisfile
- \endgroup
- \nonfillfinish
- \endgroup
+ {%
+ \makevalueexpandable
+ \setupverbatim
+ \input #1
+ \afterenvbreak
+ }%
}
% @copying ... @end copying.
% Save the text away for @insertcopying later. Many commands won't be
% allowed in this context, but that's ok.
-%
+%
% We save the uninterpreted tokens, rather than creating a box.
% Saving the text in a box would be much easier, but then all the
% typesetting commands (@smallbook, font changes, etc.) have to be done
% beforehand -- and a) we want @copying to be done first in the source
% file; b) letting users define the frontmatter in as flexible order as
% possible is very desirable.
-%
+%
\def\copying{\begingroup
% Define a command to swallow text until we reach `@end copying'.
% \ is the escape char in this texinfo.tex file, so it is the
@@ -4863,15 +5044,15 @@ width0pt\relax} \fi
% end-of-line to be a \par, as would happen with the normal active
% definition of ^^M. On the third hand, two ^^M's in a row should still
% generate a \par.
-%
+%
% Our approach is to make ^^M insert a space and a penalty1 normally;
% then it can also check if \lastpenalty=1. If it does, then manually
% do \par.
-%
+%
% This messes up the normal definitions of @c[omment], so we redefine
% it. Similarly for @ignore. (These commands are used in the gcc
% manual for man page generation.)
-%
+%
% Seems pretty fragile, most line-oriented commands will presumably
% fail, but for the limited use of getting the copying text (which
% should be quite simple) inserted, we can hope it's ok.
@@ -4902,581 +5083,336 @@ width0pt\relax} \fi
\message{defuns,}
% @defun etc.
-% Allow user to change definition object font (\df) internally
-\def\setdeffont#1 {\csname DEF#1\endcsname}
-
\newskip\defbodyindent \defbodyindent=.4in
\newskip\defargsindent \defargsindent=50pt
\newskip\deflastargmargin \deflastargmargin=18pt
-\newcount\parencount
-
-% We want ()&[] to print specially on the defun line.
-%
-\def\activeparens{%
- \catcode`\(=\active \catcode`\)=\active
- \catcode`\&=\active
- \catcode`\[=\active \catcode`\]=\active
-}
-
-% Make control sequences which act like normal parenthesis chars.
-\let\lparen = ( \let\rparen = )
-
-{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
-
-% Be sure that we always have a definition for `(', etc. For example,
-% if the fn name has parens in it, \boldbrax will not be in effect yet,
-% so TeX would otherwise complain about undefined control sequence.
-\global\let(=\lparen \global\let)=\rparen
-\global\let[=\lbrack \global\let]=\rbrack
-
-\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
-\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
-% This is used to turn on special parens
-% but make & act ordinary (given that it's active).
-\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
-
-% Definitions of (, ) and & used in args for functions.
-% This is the definition of ( outside of all parentheses.
-\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
- \global\advance\parencount by 1
-}
-%
-% This is the definition of ( when already inside a level of parens.
-\gdef\opnested{\char`\(\global\advance\parencount by 1 }
-%
-\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
- % also in that case restore the outer-level definition of (.
- \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
- \global\advance \parencount by -1 }
-% If we encounter &foo, then turn on ()-hacking afterwards
-\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
-%
-\gdef\normalparens{\boldbrax\let&=\ampnr}
-} % End of definition inside \activeparens
-%% These parens (in \boldbrax) actually are a little bolder than the
-%% contained text. This is especially needed for [ and ]
-\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
-\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
-\let\ampnr = \&
-\def\lbrb{{\bf\char`\[}}
-\def\rbrb{{\bf\char`\]}}
-
-% Active &'s sneak into the index arguments, so make sure it's defined.
-{
- \catcode`& = \active
- \global\let& = \ampnr
-}
-
-% \defname, which formats the name of the @def (not the args).
-% #1 is the function name.
-% #2 is the type of definition, such as "Function".
-%
-\def\defname#1#2{%
- % How we'll output the type name. Putting it in brackets helps
- % distinguish it from the body text that may end up on the next line
- % just below it.
- \ifempty{#2}%
- \def\defnametype{}%
+% Start the processing of @deffn:
+\def\startdefun{%
+ \ifnum\lastpenalty<10000
+ \medbreak
\else
- \def\defnametype{[\rm #2]}%
+ % If there are two @def commands in a row, we'll have a \nobreak,
+ % which is there to keep the function description together with its
+ % header. But if there's nothing but headers, we need to allow a
+ % break somewhere. Check for penalty 10002 (inserted by
+ % \defargscommonending) instead of 10000, since the sectioning
+ % commands insert a \penalty10000, and we don't want to allow a break
+ % between a section heading and a defun.
+ \ifnum\lastpenalty=10002 \penalty2000 \fi
+ %
+ % Similarly, after a section heading, do not allow a break.
+ % But do insert the glue.
+ \medskip % preceded by discardable penalty, so not a breakpoint
\fi
%
- % Get the values of \leftskip and \rightskip as they were outside the @def...
- \dimen2=\leftskip
- \advance\dimen2 by -\defbodyindent
- %
- % Figure out values for the paragraph shape.
- \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}%
- \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
- \dimen1=\hsize \advance \dimen1 by -\defargsindent % size for continuations
- \parshape 2 0in \dimen0 \defargsindent \dimen1
- %
- % Output arg 2 ("Function" or some such) but stuck inside a box of
- % width 0 so it does not interfere with linebreaking.
- \noindent
- %
- {% Adjust \hsize to exclude the ambient margins,
- % so that \rightline will obey them.
- \advance \hsize by -\dimen2
- \dimen3 = 0pt % was -1.25pc
- \rlap{\rightline{\defnametype\kern\dimen3}}%
- }%
- %
- % Allow all lines to be underfull without complaint:
- \tolerance=10000 \hbadness=10000
- \advance\leftskip by -\defbodyindent
- \exdentamount=\defbodyindent
- {\df #1}\enskip % output function name
- % \defunargs will be called next to output the arguments, if any.
-}
-
-% Common pieces to start any @def...
-% #1 is the \E... control sequence to end the definition (which we define).
-% #2 is the \...x control sequence (which our caller defines).
-% #3 is the control sequence to process the header, such as \defunheader.
-%
-\def\parsebodycommon#1#2#3{%
- \begingroup\inENV
- % If there are two @def commands in a row, we'll have a \nobreak,
- % which is there to keep the function description together with its
- % header. But if there's nothing but headers, we want to allow a
- % break after all. Check for penalty 10002 (inserted by
- % \defargscommonending) instead of 10000, since the sectioning
- % commands insert a \penalty10000, and we don't want to allow a break
- % between a section heading and a defun.
- \ifnum\lastpenalty=10002 \penalty0 \fi
- \medbreak
- %
- % Define the \E... end token that this defining construct specifies
- % so that it will exit this group.
- \def#1{\endgraf\endgroup\medbreak}%
- %
\parindent=0in
\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
}
-% Common part of the \...x definitions.
-%
-\def\defxbodycommon{%
- % As with \parsebodycommon above, allow line break if we have multiple
- % x headers in a row. It's not a great place, though.
- \ifnum\lastpenalty=10000 \penalty1000 \fi
+\def\dodefunx#1{%
+ % First, check whether we are in the right environment:
+ \checkenv#1%
%
- \begingroup\obeylines
+ % As above, allow line break if we have multiple x headers in a row.
+ % It's not a great place, though.
+ \ifnum\lastpenalty=10002 \penalty3000 \fi
+ %
+ % And now, it's time to reuse the body of the original defun:
+ \expandafter\gobbledefun#1%
}
+\def\gobbledefun#1\startdefun{}
-% Process body of @defun, @deffn, @defmac, etc.
+% \printdefunline \deffnheader{text}
%
-\def\defparsebody#1#2#3{%
- \parsebodycommon{#1}{#2}{#3}%
- \def#2{\defxbodycommon \activeparens \spacesplit#3}%
- \catcode\equalChar=\active
- \begingroup\obeylines\activeparens
- \spacesplit#3%
+\def\printdefunline#1#2{%
+ \begingroup
+ % call \deffnheader:
+ #1#2 \endheader
+ % common ending:
+ \interlinepenalty = 10000
+ \advance\rightskip by 0pt plus 1fil
+ \endgraf
+ \nobreak\vskip -\parskip
+ \penalty 10002 % signal to \startdefun and \dodefunx
+ % Some of the @defun-type tags do not enable magic parentheses,
+ % rendering the following check redundant. But we don't optimize.
+ \checkparencounts
+ \endgroup
}
-% #1, #2, #3 are the common arguments (see \parsebodycommon above).
-% #4, delimited by the space, is the class name.
+\def\Edefun{\endgraf\medbreak}
+
+% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
+% the only thing remainnig is to define \deffnheader.
%
-\def\defmethparsebody#1#2#3#4 {%
- \parsebodycommon{#1}{#2}{#3}%
- \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}%
- \begingroup\obeylines\activeparens
- % The \empty here prevents misinterpretation of a construct such as
- % @deffn {whatever} {Enharmonic comma}
- % See comments at \deftpparsebody, although in our case we don't have
- % to remove the \empty afterwards, since it is empty.
- \spacesplit{#3{#4}}\empty
+\def\makedefun#1{%
+ \expandafter\let\csname E#1\endcsname = \Edefun
+ \edef\temp{\noexpand\domakedefun
+ \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
+ \temp
}
-% Used for @deftypemethod and @deftypeivar.
-% #1, #2, #3 are the common arguments (see \defparsebody).
-% #4, delimited by a space, is the class name.
-% #5 is the method's return type.
+% \domakedefun \deffn \deffnx \deffnheader
+%
+% Define \deffn and \deffnx, without parameters.
+% \deffnheader has to be defined explicitly.
%
-\def\deftypemethparsebody#1#2#3#4 #5 {%
- \parsebodycommon{#1}{#2}{#3}%
- \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}%
- \begingroup\obeylines\activeparens
- \spacesplit{#3{#4}{#5}}%
+\def\domakedefun#1#2#3{%
+ \envdef#1{%
+ \startdefun
+ \parseargusing\activeparens{\printdefunline#3}%
+ }%
+ \def#2{\dodefunx#1}%
+ \def#3%
}
-% Used for @deftypeop. The change from \deftypemethparsebody is an
-% extra argument at the beginning which is the `category', instead of it
-% being the hardwired string `Method' or `Instance Variable'. We have
-% to account for this both in the \...x definition and in parsing the
-% input at hand. Thus also need a control sequence (passed as #5) for
-% the \E... definition to assign the category name to.
-%
-\def\deftypeopparsebody#1#2#3#4#5 #6 {%
- \parsebodycommon{#1}{#2}{#3}%
- \def#2##1 ##2 ##3 {\def#4{##1}%
- \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}%
- \begingroup\obeylines\activeparens
- \spacesplit{#3{#5}{#6}}%
-}
+%%% Untyped functions:
-% For @defop.
-\def\defopparsebody #1#2#3#4#5 {%
- \parsebodycommon{#1}{#2}{#3}%
- \def#2##1 ##2 {\def#4{##1}%
- \defxbodycommon \activeparens \spacesplit{#3{##2}}}%
- \begingroup\obeylines\activeparens
- \spacesplit{#3{#5}}%
-}
+% @deffn category name args
+\makedefun{deffn}{\deffngeneral{}}
-% These parsing functions are similar to the preceding ones
-% except that they do not make parens into active characters.
-% These are used for "variables" since they have no arguments.
-%
-\def\defvarparsebody #1#2#3{%
- \parsebodycommon{#1}{#2}{#3}%
- \def#2{\defxbodycommon \spacesplit#3}%
- \catcode\equalChar=\active
- \begingroup\obeylines
- \spacesplit#3%
-}
+% @deffn category class name args
+\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
-% @defopvar.
-\def\defopvarparsebody #1#2#3#4#5 {%
- \parsebodycommon{#1}{#2}{#3}%
- \def#2##1 ##2 {\def#4{##1}%
- \defxbodycommon \spacesplit{#3{##2}}}%
- \begingroup\obeylines
- \spacesplit{#3{#5}}%
-}
+% \defopon {category on}class name args
+\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
-\def\defvrparsebody#1#2#3#4 {%
- \parsebodycommon{#1}{#2}{#3}%
- \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
- \begingroup\obeylines
- \spacesplit{#3{#4}}%
-}
-
-% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
-% type is just `struct', because we lose the braces in `{struct
-% termios}' when \spacesplit reads its undelimited argument. Sigh.
-% \let\deftpparsebody=\defvrparsebody
-%
-% So, to get around this, we put \empty in with the type name. That
-% way, TeX won't find exactly `{...}' as an undelimited argument, and
-% won't strip off the braces.
+% \deffngeneral {subind}category name args
%
-\def\deftpparsebody #1#2#3#4 {%
- \parsebodycommon{#1}{#2}{#3}%
- \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
- \begingroup\obeylines
- \spacesplit{\parsetpheaderline{#3{#4}}}\empty
+\def\deffngeneral#1#2 #3 #4\endheader{%
+ % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
+ \dosubind{fn}{\code{#3}}{#1}%
+ \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
}
-% Fine, but then we have to eventually remove the \empty *and* the
-% braces (if any). That's what this does.
-%
-\def\removeemptybraces\empty#1\relax{#1}
+%%% Typed functions:
-% After \spacesplit has done its work, this is called -- #1 is the final
-% thing to call, #2 the type name (which starts with \empty), and #3
-% (which might be empty) the arguments.
-%
-\def\parsetpheaderline#1#2#3{%
- #1{\removeemptybraces#2\relax}{#3}%
-}%
+% @deftypefn category type name args
+\makedefun{deftypefn}{\deftypefngeneral{}}
-% Split up #2 (the rest of the input line) at the first space token.
-% call #1 with two arguments:
-% the first is all of #2 before the space token,
-% the second is all of #2 after that space token.
-% If #2 contains no space token, all of it is passed as the first arg
-% and the second is passed as empty.
-%
-{\obeylines %
- \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}%
- \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{%
- \ifx\relax #3%
- #1{#2}{}%
- \else %
- #1{#2}{#3#4}%
- \fi}%
-}
+% @deftypeop category class type name args
+\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
-% Define @defun.
+% \deftypeopon {category on}class type name args
+\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
-% This is called to end the arguments processing for all the @def... commands.
+% \deftypefngeneral {subind}category type name args
%
-\def\defargscommonending{%
- \interlinepenalty = 10000
- \advance\rightskip by 0pt plus 1fil
- \endgraf
- \nobreak\vskip -\parskip
- \penalty 10002 % signal to \parsebodycommon.
+\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{fn}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
-% This expands the args and terminates the paragraph they comprise.
-%
-\def\defunargs#1{\functionparens \sl
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-% Set the font temporarily and use \font in case \setfont made \tensl a macro.
-{\tensl\hyphenchar\font=0}%
-#1%
-{\tensl\hyphenchar\font=45}%
-\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
- \defargscommonending
-}
+%%% Typed variables:
-\def\deftypefunargs #1{%
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-% Use \boldbraxnoamp, not \functionparens, so that & is not special.
-\boldbraxnoamp
-\tclose{#1}% avoid \code because of side effects on active chars
- \defargscommonending
-}
+% @deftypevr category type var args
+\makedefun{deftypevr}{\deftypecvgeneral{}}
-% Do complete processing of one @defun or @defunx line already parsed.
+% @deftypecv category class type var args
+\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
-% @deffn Command forward-char nchars
+% \deftypecvof {category of}class type var args
+\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
-\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
-
-\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
+% \deftypecvgeneral {subind}category type var args
+%
+\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{vr}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
-% @defun == @deffn Function
+%%% Untyped variables:
-\def\defun{\defparsebody\Edefun\defunx\defunheader}
+% @defvr category var args
+\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
-\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{\putwordDeffunc}%
-\defunargs {#2}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
-}
-
-% @deftypefun int foobar (int @var{foo}, float @var{bar})
+% @defcv category class var args
+\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
-\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
+% \defcvof {category of}class var args
+\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
-% #1 is the data type. #2 is the name and args.
-\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
-% #1 is the data type, #2 the name, #3 the args.
-\def\deftypefunheaderx #1#2 #3\relax{%
-\doind {fn}{\code{#2}}% Make entry in function index
-\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
-\deftypefunargs {#3}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
+%%% Type:
+% @deftp category name args
+\makedefun{deftp}#1 #2 #3\endheader{%
+ \doind{tp}{\code{#2}}%
+ \defname{#1}{}{#2}\defunargs{#3\unskip}%
}
-% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
-
-\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
-
-% \defheaderxcond#1\relax$.$
-% puts #1 in @code, followed by a space, but does nothing if #1 is null.
-\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi}
+% Remaining @defun-like shortcuts:
+\makedefun{defun}{\deffnheader{\putwordDeffunc} }
+\makedefun{defmac}{\deffnheader{\putwordDefmac} }
+\makedefun{defspec}{\deffnheader{\putwordDefspec} }
+\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
+\makedefun{defvar}{\defvrheader{\putwordDefvar} }
+\makedefun{defopt}{\defvrheader{\putwordDefopt} }
+\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
+\makedefun{defmethod}{\defopon\putwordMethodon}
+\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
+\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
+\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
-% #1 is the classification. #2 is the data type. #3 is the name and args.
-\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
-% #1 is the classification, #2 the data type, #3 the name, #4 the args.
-\def\deftypefnheaderx #1#2#3 #4\relax{%
-\doind {fn}{\code{#3}}% Make entry in function index
-\begingroup
-\normalparens % notably, turn off `&' magic, which prevents
-% at least some C++ text from working
-\defname {\defheaderxcond#2\relax$.$#3}{#1}%
-\deftypefunargs {#4}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
+% \defname, which formats the name of the @def (not the args).
+% #1 is the category, such as "Function".
+% #2 is the return type, if any.
+% #3 is the function name.
+%
+% We are followed by (but not passed) the arguments, if any.
+%
+\def\defname#1#2#3{%
+ % Get the values of \leftskip and \rightskip as they were outside the @def...
+ \advance\leftskip by -\defbodyindent
+ %
+ % How we'll format the type name. Putting it in brackets helps
+ % distinguish it from the body text that may end up on the next line
+ % just below it.
+ \def\temp{#1}%
+ \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
+ %
+ % Figure out line sizes for the paragraph shape.
+ % The first line needs space for \box0; but if \rightskip is nonzero,
+ % we need only space for the part of \box0 which exceeds it:
+ \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
+ % The continuations:
+ \dimen2=\hsize \advance\dimen2 by -\defargsindent
+ % (plain.tex says that \dimen1 should be used only as global.)
+ \parshape 2 0in \dimen0 \defargsindent \dimen2
+ %
+ % Put the type name to the right margin.
+ \noindent
+ \hbox to 0pt{%
+ \hfil\box0 \kern-\hsize
+ % \hsize has to be shortened this way:
+ \kern\leftskip
+ % Intentionally do not respect \rightskip, since we need the space.
+ }%
+ %
+ % Allow all lines to be underfull without complaint:
+ \tolerance=10000 \hbadness=10000
+ \exdentamount=\defbodyindent
+ {%
+ % defun fonts. We use typewriter by default (used to be bold) because:
+ % . we're printing identifiers, they should be in tt in principle.
+ % . in languages with many accents, such as Czech or French, it's
+ % common to leave accents off identifiers. The result looks ok in
+ % tt, but exceedingly strange in rm.
+ % . we don't want -- and --- to be treated as ligatures.
+ % . this still does not fix the ?` and !` ligatures, but so far no
+ % one has made identifiers using them :).
+ \df \tt
+ \def\temp{#2}% return value type
+ \ifx\temp\empty\else \tclose{\temp} \fi
+ #3% output function name
+ }%
+ {\rm\enskip}% hskip 0.5 em of \tenrm
+ %
+ \boldbrax
+ % arguments will be output next, if any.
}
-% @defmac == @deffn Macro
-
-\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
+% Print arguments in slanted roman (not ttsl), inconsistently with using
+% tt for the name. This is because literal text is sometimes needed in
+% the argument list (groff manual), and ttsl and tt are not very
+% distinguishable. Prevent hyphenation at `-' chars.
+%
+\def\defunargs#1{%
+ % use sl by default (not ttsl),
+ % tt for the names.
+ \df \sl \hyphenchar\font=0
+ %
+ % On the other hand, if an argument has two dashes (for instance), we
+ % want a way to get ttsl. Let's try @var for that.
+ \let\var=\ttslanted
+ #1%
+ \sl\hyphenchar\font=45
+}
-\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{\putwordDefmac}%
-\defunargs {#2}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
+% We want ()&[] to print specially on the defun line.
+%
+\def\activeparens{%
+ \catcode`\(=\active \catcode`\)=\active
+ \catcode`\[=\active \catcode`\]=\active
+ \catcode`\&=\active
}
-% @defspec == @deffn Special Form
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
-\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+{
+ \activeparens
+ \global\let(=\lparen \global\let)=\rparen
+ \global\let[=\lbrack \global\let]=\rbrack
+ \global\let& = \&
-\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{\putwordDefspec}%
-\defunargs {#2}\endgroup %
-\catcode\equalChar=\other % Turn off change made in \defparsebody
+ \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+ \gdef\magicamp{\let&=\amprm}
}
-% @defop CATEGORY CLASS OPERATION ARG...
-%
-\def\defop #1 {\def\defoptype{#1}%
-\defopparsebody\Edefop\defopx\defopheader\defoptype}
-%
-\def\defopheader#1#2#3{%
- \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
- \begingroup
- \defname{#2}{\defoptype\ \putwordon\ #1}%
- \defunargs{#3}%
- \endgroup
-}
+\newcount\parencount
-% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
-%
-\def\deftypeop #1 {\def\deftypeopcategory{#1}%
- \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
- \deftypeopcategory}
-%
-% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
-\def\deftypeopheader#1#2#3#4{%
- \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
- \begingroup
- \defname{\defheaderxcond#2\relax$.$#3}
- {\deftypeopcategory\ \putwordon\ \code{#1}}%
- \deftypefunargs{#4}%
- \endgroup
+% If we encounter &foo, then turn on ()-hacking afterwards
+\newif\ifampseen
+\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+
+\def\parenfont{%
+ \ifampseen
+ % At the first level, print parens in roman,
+ % otherwise use the default font.
+ \ifnum \parencount=1 \rm \fi
+ \else
+ % The \sf parens (in \boldbrax) actually are a little bolder than
+ % the contained text. This is especially needed for [ and ] .
+ \sf
+ \fi
}
-
-% @deftypemethod CLASS TYPE METHOD ARG...
-%
-\def\deftypemethod{%
- \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
-%
-% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
-\def\deftypemethodheader#1#2#3#4{%
- \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
- \begingroup
- \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}%
- \deftypefunargs{#4}%
- \endgroup
+\def\infirstlevel#1{%
+ \ifampseen
+ \ifnum\parencount=1
+ #1%
+ \fi
+ \fi
}
+\def\bfafterword#1 {#1 \bf}
-% @deftypeivar CLASS TYPE VARNAME
-%
-\def\deftypeivar{%
- \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
-%
-% #1 is the class name, #2 the data type, #3 the variable name.
-\def\deftypeivarheader#1#2#3{%
- \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
- \begingroup
- \defname{\defheaderxcond#2\relax$.$#3}
- {\putwordInstanceVariableof\ \code{#1}}%
- \defvarargs{#3}%
- \endgroup
+\def\opnr{%
+ \global\advance\parencount by 1
+ {\parenfont(}%
+ \infirstlevel \bfafterword
}
-
-% @defmethod == @defop Method
-%
-\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
-%
-% #1 is the class name, #2 the method name, #3 the args.
-\def\defmethodheader#1#2#3{%
- \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
- \begingroup
- \defname{#2}{\putwordMethodon\ \code{#1}}%
- \defunargs{#3}%
- \endgroup
+\def\clnr{%
+ {\parenfont)}%
+ \infirstlevel \sl
+ \global\advance\parencount by -1
}
-% @defcv {Class Option} foo-class foo-flag
-
-\def\defcv #1 {\def\defcvtype{#1}%
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
-
-\def\defcvarheader #1#2#3{%
- \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
- \begingroup
- \defname{#2}{\defcvtype\ \putwordof\ #1}%
- \defvarargs{#3}%
- \endgroup
+\newcount\brackcount
+\def\lbrb{%
+ \global\advance\brackcount by 1
+ {\bf[}%
}
-
-% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
-%
-\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
-%
-\def\defivarheader#1#2#3{%
- \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
- \begingroup
- \defname{#2}{\putwordInstanceVariableof\ #1}%
- \defvarargs{#3}%
- \endgroup
+\def\rbrb{%
+ {\bf]}%
+ \global\advance\brackcount by -1
}
-% @defvar
-% First, define the processing that is wanted for arguments of @defvar.
-% This is actually simple: just print them in roman.
-% This must expand the args and terminate the paragraph they make up
-\def\defvarargs #1{\normalparens #1%
- \defargscommonending
+\def\checkparencounts{%
+ \ifnum\parencount=0 \else \badparencount \fi
+ \ifnum\brackcount=0 \else \badbrackcount \fi
}
-
-% @defvr Counter foo-count
-
-\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
-
-\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
-
-% @defvar == @defvr Variable
-
-\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
-
-\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{\putwordDefvar}%
-\defvarargs {#2}\endgroup %
+\def\badparencount{%
+ \errmessage{Unbalanced parentheses in @def}%
+ \global\parencount=0
}
-
-% @defopt == @defvr {User Option}
-
-\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
-
-\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{\putwordDefopt}%
-\defvarargs {#2}\endgroup %
+\def\badbrackcount{%
+ \errmessage{Unbalanced square braces in @def}%
+ \global\brackcount=0
}
-% @deftypevar int foobar
-
-\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
-
-% #1 is the data type. #2 is the name, perhaps followed by text that
-% is actually part of the data type, which should not be put into the index.
-\def\deftypevarheader #1#2{%
-\dovarind#2 \relax% Make entry in variables index
-\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
- \defargscommonending
-\endgroup}
-\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
-
-% @deftypevr {Global Flag} int enable
-
-\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
-
-\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
-\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
- \defargscommonending
-\endgroup}
-
-% Now define @deftp
-% Args are printed in bold, a slight difference from @defvar.
-
-\def\deftpargs #1{\bf \defvarargs{#1}}
-
-% @deftp Class window height width ...
-
-\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
-
-\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
-\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
-
-% These definitions are used if you use @defunx (etc.)
-% anywhere other than immediately after a @defun or @defunx.
-%
-\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
-\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
-\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
-\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
-\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
-\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
-\def\defopx#1 {\errmessage{@defopx in invalid context}}
-\def\defspecx#1 {\errmessage{@defspecx in invalid context}}
-\def\deftpx#1 {\errmessage{@deftpx in invalid context}}
-\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
-\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
-\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
-\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
-\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
-\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
-\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
-\def\defunx#1 {\errmessage{@defunx in invalid context}}
-\def\defvarx#1 {\errmessage{@defvarx in invalid context}}
-\def\defvrx#1 {\errmessage{@defvrx in invalid context}}
-
\message{macros,}
% @macro.
@@ -5484,28 +5420,33 @@ width0pt\relax} \fi
% To do this right we need a feature of e-TeX, \scantokens,
% which we arrange to emulate with a temporary file in ordinary TeX.
\ifx\eTeXversion\undefined
- \newwrite\macscribble
- \def\scanmacro#1{%
- \begingroup \newlinechar`\^^M
- % Undo catcode changes of \startcontents and \doprintindex
- \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
- % Append \endinput to make sure that TeX does not see the ending newline.
- \toks0={#1\endinput}%
- \immediate\openout\macscribble=\jobname.tmp
- \immediate\write\macscribble{\the\toks0}%
- \immediate\closeout\macscribble
- \let\xeatspaces\eatspaces
- \input \jobname.tmp
- \endgroup
-}
-\else
-\def\scanmacro#1{%
-\begingroup \newlinechar`\^^M
-% Undo catcode changes of \startcontents and \doprintindex
-\catcode`\@=0 \catcode`\\=\other \escapechar=`\@
-\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
+ \newwrite\macscribble
+ \def\scantokens#1{%
+ \toks0={#1\endinput}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \input \jobname.tmp
+ }
\fi
+\def\scanmacro#1{%
+ \begingroup
+ \newlinechar`\^^M
+ \let\xeatspaces\eatspaces
+ % Undo catcode changes of \startcontents and \doprintindex
+ \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
+ % ... and \example
+ \spaceisspace
+ %
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ %
+ % I've verified that it is necessary both for e-TeX and for ordinary TeX
+ % --kasal, 29nov03
+ \scantokens{#1\endinput}%
+ \endgroup
+}
+
\newcount\paramno % Count of parameters
\newtoks\macname % Macro name
\newif\ifrecursive % Is it recursive?
@@ -5513,7 +5454,7 @@ width0pt\relax} \fi
% \do\macro1\do\macro2...
% Utility routines.
-% Thisdoes \let #1 = #2, except with \csnames.
+% This does \let #1 = #2, except with \csnames.
\def\cslet#1#2{%
\expandafter\expandafter
\expandafter\let
@@ -5610,8 +5551,7 @@ width0pt\relax} \fi
\else \expandafter\parsemacbody
\fi}
-\def\unmacro{\parsearg\dounmacro}
-\def\dounmacro#1{%
+\parseargdef\unmacro{%
\if1\csname ismacro.#1\endcsname
\global\cslet{#1}{macsave.#1}%
\global\expandafter\let \csname ismacro.#1\endcsname=0%
@@ -5628,7 +5568,7 @@ width0pt\relax} \fi
% Called by \do from \dounmacro on each macro. The idea is to omit any
% macro definitions that have been changed to \relax.
-%
+%
\def\unmacrodo#1{%
\ifx#1\relax
% remove this
@@ -5761,16 +5701,18 @@ width0pt\relax} \fi
% @alias.
% We need some trickery to remove the optional spaces around the equal
% sign. Just make them active and then expand them all to nothing.
-\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
\def\aliasxxx #1{\aliasyyy#1\relax}
-\def\aliasyyy #1=#2\relax{\ignoreactivespaces
-\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
- \expandafter\noexpand\csname#2\endcsname}%
-\expandafter\endgroup\next}
+\def\aliasyyy #1=#2\relax{%
+ {%
+ \expandafter\let\obeyedspace=\empty
+ \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+ }%
+ \next
+}
\message{cross references,}
-% @xref etc.
\newwrite\auxfile
@@ -5782,64 +5724,61 @@ width0pt\relax} \fi
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
-% @node's job is to define \lastnode.
-\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+% @node's only job in TeX is to define \lastnode, which is used in
+% cross-references.
+\parseargdef\node{\checkenv{}\nodexxx #1,\finishnodeparse}
+\def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}}
\let\nwnode=\node
-\let\lastnode=\relax
-
-% The sectioning commands (@chapter, etc.) call these.
-\def\donoderef{%
- \ifx\lastnode\relax\else
- \expandafter\expandafter\expandafter\setref{\lastnode}%
- {Ysectionnumberandtype}%
- \global\let\lastnode=\relax
- \fi
-}
-\def\unnumbnoderef{%
- \ifx\lastnode\relax\else
- \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
- \global\let\lastnode=\relax
- \fi
-}
-\def\appendixnoderef{%
- \ifx\lastnode\relax\else
- \expandafter\expandafter\expandafter\setref{\lastnode}%
- {Yappendixletterandtype}%
- \global\let\lastnode=\relax
+\let\lastnode=\empty
+
+% Write a cross-reference definition for the current node. #1 is the
+% type (Ynumbered, Yappendix, Ynothing).
+%
+\def\donoderef#1{%
+ \ifx\lastnode\empty\else
+ \setref{\lastnode}{#1}%
+ \global\let\lastnode=\empty
\fi
}
-
% @anchor{NAME} -- define xref target at arbitrary point.
%
\newcount\savesfregister
-\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
-\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
-\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+%
+\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
-% anchor), namely NAME-title (the corresponding @chapter/etc. name),
-% NAME-pg (the page number), and NAME-snt (section number and type).
-% Called from \foonoderef.
+% anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name taken from \thissection,
+% or the anchor name.
+% 2) NAME-snt - section number and type, passed as the SNT arg, or
+% empty for anchors.
+% 3) NAME-pg - the page number.
%
-% We have to set \indexdummies so commands such as @code in a section
-% title aren't expanded. It would be nicer not to expand the titles in
-% the first place, but there's so many layers that that is hard to do.
-%
-% Likewise, use \turnoffactive so that punctuation chars such as underscore
-% and backslash work in node names.
+% This is called from \donoderef, \anchor, and \dofloat. In the case of
+% floats, there is an additional part, which is not written here:
+% 4) NAME-lof - the text as it should appear in a @listoffloats.
%
-\def\setref#1#2{{%
- \atdummies
+\def\setref#1#2{%
\pdfmkdest{#1}%
- %
- \turnoffactive
- \dosetq{#1-title}{Ytitle}%
- \dosetq{#1-pg}{Ypagenumber}%
- \dosetq{#1-snt}{#2}%
-}}
+ \iflinks
+ {%
+ \atdummies % preserve commands, but don't expand them
+ \turnoffactive
+ \otherbackslash
+ \edef\writexrdef##1##2{%
+ \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
+ ##1}{##2}}% these are parameters of \writexrdef
+ }%
+ \toks0 = \expandafter{\thissection}%
+ \immediate \writexrdef{title}{\the\toks0 }%
+ \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
+ \writexrdef{pg}{\folio}% will be written later, during \shipout
+ }%
+ \fi
+}
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
% the node name, #2 the name of the Info cross-reference, #3 the printed
@@ -5852,38 +5791,33 @@ width0pt\relax} \fi
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
\unsepspaces
\def\printedmanual{\ignorespaces #5}%
- \def\printednodename{\ignorespaces #3}%
- \setbox1=\hbox{\printedmanual}%
- \setbox0=\hbox{\printednodename}%
+ \def\printedrefname{\ignorespaces #3}%
+ \setbox1=\hbox{\printedmanual\unskip}%
+ \setbox0=\hbox{\printedrefname\unskip}%
\ifdim \wd0 = 0pt
% No printed node name was explicitly given.
\expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
% Use the node name inside the square brackets.
- \def\printednodename{\ignorespaces #1}%
+ \def\printedrefname{\ignorespaces #1}%
\else
% Use the actual chapter/section title appear inside
% the square brackets. Use the real section title if we have it.
\ifdim \wd1 > 0pt
% It is in another manual, so we don't have it.
- \def\printednodename{\ignorespaces #1}%
+ \def\printedrefname{\ignorespaces #1}%
\else
\ifhavexrefs
% We know the real title if we have the xref values.
- \def\printednodename{\refx{#1-title}{}}%
+ \def\printedrefname{\refx{#1-title}{}}%
\else
% Otherwise just copy the Info node name.
- \def\printednodename{\ignorespaces #1}%
+ \def\printedrefname{\ignorespaces #1}%
\fi%
\fi
\fi
\fi
%
- % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
- % insert empty discretionaries after hyphens, which means that it will
- % not find a line break at a hyphen in a node names. Since some manuals
- % are best written with fairly long node names, containing hyphens, this
- % is a loss. Therefore, we give the text of the node name again, so it
- % is as if TeX is seeing it for the first time.
+ % Make link in pdf output.
\ifpdf
\leavevmode
\getfilename{#4}%
@@ -5893,53 +5827,86 @@ width0pt\relax} \fi
goto file{\the\filename.pdf} name{#1}%
\else
\startlink attr{/Border [0 0 0]}%
- goto name{#1}%
+ goto name{\pdfmkpgn{#1}}%
\fi
}%
\linkcolor
\fi
%
- \ifdim \wd1 > 0pt
- \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
+ % Float references are printed completely differently: "Figure 1.2"
+ % instead of "[somenode], p.3". We distinguish them by the
+ % LABEL-title being set to a magic string.
+ {%
+ % Have to otherify everything special to allow the \csname to
+ % include an _ in the xref name, etc.
+ \indexnofonts
+ \turnoffactive
+ \otherbackslash
+ \expandafter\global\expandafter\let\expandafter\Xthisreftitle
+ \csname XR#1-title\endcsname
+ }%
+ \iffloat\Xthisreftitle
+ % If the user specified the print name (third arg) to the ref,
+ % print it instead of our usual "Figure 1.2".
+ \ifdim\wd0 = 0pt
+ \refx{#1-snt}%
+ \else
+ \printedrefname
+ \fi
+ %
+ % if the user also gave the printed manual name (fifth arg), append
+ % "in MANUALNAME".
+ \ifdim \wd1 > 0pt
+ \space \putwordin{} \cite{\printedmanual}%
+ \fi
\else
- % _ (for example) has to be the character _ for the purposes of the
- % control sequence corresponding to the node, but it has to expand
- % into the usual \leavevmode...\vrule stuff for purposes of
- % printing. So we \turnoffactive for the \refx-snt, back on for the
- % printing, back off for the \refx-pg.
- {\turnoffactive \otherbackslash
- % Only output a following space if the -snt ref is nonempty; for
- % @unnumbered and @anchor, it won't be.
- \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
- \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
- }%
- % [mynode],
- [\printednodename],\space
- % page 3
- \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
+ % node/anchor (non-float) references.
+ %
+ % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+ % insert empty discretionaries after hyphens, which means that it will
+ % not find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens, this
+ % is a loss. Therefore, we give the text of the node name again, so it
+ % is as if TeX is seeing it for the first time.
+ \ifdim \wd1 > 0pt
+ \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
+ \else
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\turnoffactive \otherbackslash
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % output the `[mynode]' via a macro so it can be overridden.
+ \xrefprintnodename\printedrefname
+ %
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
+ \fi
\fi
\endlink
\endgroup}
-% \dosetq is called from \setref to do the actual \write (\iflinks).
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output. It's a separate macro only so it can be changed more easily,
+% since square brackets don't work well in some documents. Particularly
+% one that Bob is working on :).
%
-\def\dosetq#1#2{%
- {\let\folio=0%
- \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
- \iflinks \next \fi
- }%
-}
-
-% \internalsetq{foo}{page} expands into
-% CHARACTERS @xrdef{foo}{...expansion of \page...}
-\def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}}
+\def\xrefprintnodename#1{[#1]}
-% Things to be expanded by \internalsetq.
-%
-\def\Ypagenumber{\folio}
-\def\Ytitle{\thissection}
+% Things referred to by \setref.
+%
\def\Ynothing{}
-\def\Ysectionnumberandtype{%
+\def\Yomitfromtoc{}
+\def\Ynumbered{%
\ifnum\secno=0
\putwordChapter@tie \the\chapno
\else \ifnum\subsecno=0
@@ -5950,8 +5917,7 @@ width0pt\relax} \fi
\putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
\fi\fi\fi
}
-
-\def\Yappendixletterandtype{%
+\def\Yappendix{%
\ifnum\secno=0
\putwordAppendix@tie @char\the\appendixno{}%
\else \ifnum\subsecno=0
@@ -5964,15 +5930,6 @@ width0pt\relax} \fi
\fi\fi\fi
}
-% Use TeX 3.0's \inputlineno to get the line number, for better error
-% messages, but if we're using an old version of TeX, don't do anything.
-%
-\ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Pre-3.0.
-\else
- \def\linenumber{\the\inputlineno:\space}
-\fi
-
% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
% If its value is nonempty, SUFFIX is output afterward.
%
@@ -5981,7 +5938,7 @@ width0pt\relax} \fi
\indexnofonts
\otherbackslash
\expandafter\global\expandafter\let\expandafter\thisrefX
- \csname X#1\endcsname
+ \csname XR#1\endcsname
}%
\ifx\thisrefX\relax
% If not defined, say something at least.
@@ -6003,11 +5960,44 @@ width0pt\relax} \fi
#2% Output the suffix in any case.
}
-% This is the macro invoked by entries in the aux file.
+% This is the macro invoked by entries in the aux file. Usually it's
+% just a \def (we prepend XR to the control sequence name to avoid
+% collisions). But if this is a float type, we have more work to do.
%
-\def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
+\def\xrdef#1#2{%
+ \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value.
+ %
+ % Was that xref control sequence that we just defined for a float?
+ \expandafter\iffloat\csname XR#1\endcsname
+ % it was a float, and we have the (safe) float type in \iffloattype.
+ \expandafter\let\expandafter\floatlist
+ \csname floatlist\iffloattype\endcsname
+ %
+ % Is this the first time we've seen this float type?
+ \expandafter\ifx\floatlist\relax
+ \toks0 = {\do}% yes, so just \do
+ \else
+ % had it before, so preserve previous elements in list.
+ \toks0 = \expandafter{\floatlist\do}%
+ \fi
+ %
+ % Remember this xref in the control sequence \floatlistFLOATTYPE,
+ % for later use in \listoffloats.
+ \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}%
+ \fi
+}
% Read the last existing aux file, if any. No error if none exists.
+%
+\def\tryauxfile{%
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \readauxfile
+ \global\havexrefstrue
+ \fi
+ \closein 1
+}
+
\def\readauxfile{\begingroup
\catcode`\^^@=\other
\catcode`\^^A=\other
@@ -6066,7 +6056,16 @@ width0pt\relax} \fi
\catcode`\%=\other
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
%
- % Make the characters 128-255 be printing characters
+ % This is to support \ in node names and titles, since the \
+ % characters end up in a \csname. It's easier than
+ % leaving it active and making its active definition an actual \
+ % character. What I don't understand is why it works in the *value*
+ % of the xrdef. Seems like it should be a catcode12 \, and that
+ % should not typeset properly. But it works, so I'm moving on for
+ % now. --karl, 15jan04.
+ \catcode`\\=\other
+ %
+ % Make the characters 128-255 be printing characters.
{%
\count 1=128
\def\loop{%
@@ -6076,31 +6075,17 @@ width0pt\relax} \fi
}%
}%
%
- % Turn off \ as an escape so we do not lose on
- % entries which were dumped with control sequences in their names.
- % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^
- % Reference to such entries still does not work the way one would wish,
- % but at least they do not bomb out when the aux file is read in.
- \catcode`\\=\other
- %
- % @ is our escape character in .aux files.
+ % @ is our escape character in .aux files, and we need braces.
\catcode`\{=1
\catcode`\}=2
\catcode`\@=0
%
- \openin 1 \jobname.aux
- \ifeof 1 \else
- \closein 1
- \input \jobname.aux
- \global\havexrefstrue
- \global\warnedobstrue
- \fi
- % Open the new aux file. TeX will close it automatically at exit.
- \openout\auxfile=\jobname.aux
+ \input \jobname.aux
\endgroup}
-% Footnotes.
+\message{insertions,}
+% including footnotes.
\newcount \footnoteno
@@ -6114,19 +6099,19 @@ width0pt\relax} \fi
% @footnotestyle is meaningful for info output only.
\let\footnotestyle=\comment
-\let\ptexfootnote=\footnote
-
{\catcode `\@=11
%
% Auto-number footnotes. Otherwise like plain.
\gdef\footnote{%
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
\global\advance\footnoteno by \@ne
\edef\thisfootno{$^{\the\footnoteno}$}%
%
% In case the footnote comes at the end of a sentence, preserve the
% extra spacing after we do the footnote number.
\let\@sf\empty
- \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
%
% Remove inadvertent blank space before typesetting the footnote number.
\unskip
@@ -6137,17 +6122,12 @@ width0pt\relax} \fi
% Don't bother with the trickery in plain.tex to not require the
% footnote text as a parameter. Our footnotes don't need to be so general.
%
-% Oh yes, they do; otherwise, @ifset and anything else that uses
-% \parseargline fail inside footnotes because the tokens are fixed when
+% Oh yes, they do; otherwise, @ifset (and anything else that uses
+% \parseargline) fails inside footnotes because the tokens are fixed when
% the footnote is read. --karl, 16nov96.
%
-% The start of the footnote looks usually like this:
-\gdef\startfootins{\insert\footins\bgroup}
-%
-% ... but this macro is redefined inside @multitable.
-%
\gdef\dofootnote{%
- \startfootins
+ \insert\footins\bgroup
% We want to typeset this text as a normal paragraph, even if the
% footnote reference occurs in (for example) a display environment.
% So reset some parameters.
@@ -6183,40 +6163,66 @@ width0pt\relax} \fi
}
}%end \catcode `\@=11
-% @| inserts a changebar to the left of the current line. It should
-% surround any changed text. This approach does *not* work if the
-% change spans more than two lines of output. To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change).
+% In case a @footnote appears in a vbox, save the footnote text and create
+% the real \insert just after the vbox finished. Otherwise, the insertion
+% would be lost.
+% Similarily, if a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is finished.
+% And the same can be done for other insert classes. --kasal, 16nov03.
+
+% Replace the \insert primitive by a cheating macro.
+% Deeper inside, just make sure that the saved insertions are not spilled
+% out prematurely.
%
-\def\|{%
- % \vadjust can only be used in horizontal mode.
- \leavevmode
- %
- % Append this vertical mode material after the current line in the output.
- \vadjust{%
- % We want to insert a rule with the height and depth of the current
- % leading; that is exactly what \strutbox is supposed to record.
- \vskip-\baselineskip
- %
- % \vadjust-items are inserted at the left edge of the type. So
- % the \llap here moves out into the left-hand margin.
- \llap{%
- %
- % For a thicker or thinner bar, change the `1pt'.
- \vrule height\baselineskip width1pt
- %
- % This is the space between the bar and the text.
- \hskip 12pt
- }%
- }%
+\def\startsavinginserts{%
+ \ifx \insert\ptexinsert
+ \let\insert\saveinsert
+ \else
+ \let\checkinserts\relax
+ \fi
}
-% For a final copy, take out the rectangles
-% that mark overfull boxes (in case you have decided
-% that the text looks ok even though it passes the margin).
+% This \insert replacement works for both \insert\footins{foo} and
+% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
%
-\def\finalout{\overfullrule=0pt}
+\def\saveinsert#1{%
+ \edef\next{\noexpand\savetobox \makeSAVEname#1}%
+ \afterassignment\next
+ % swallow the left brace
+ \let\temp =
+}
+\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
+\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
+
+\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
+
+\def\placesaveins#1{%
+ \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
+ {\box#1}%
+}
+
+% eat @SAVE -- beware, all of them have catcode \other:
+{
+ \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
+ \gdef\gobblesave @SAVE{}
+}
+
+% initialization:
+\def\newsaveins #1{%
+ \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
+ \next
+}
+\def\newsaveinsX #1{%
+ \csname newbox\endcsname #1%
+ \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
+ \checksaveins #1}%
+}
+
+% initialize:
+\let\checkinserts\empty
+\newsaveins\footins
+\newsaveins\margin
+
% @image. We use the macros from epsf.tex to support this.
% If epsf.tex is not installed and @image is used, we complain.
@@ -6226,12 +6232,12 @@ width0pt\relax} \fi
% undone and the next image would fail.
\openin 1 = epsf.tex
\ifeof 1 \else
- \closein 1
% Do not bother showing banner with epsf.tex v2.7k (available in
% doc/epsf.tex and on ctan).
\def\epsfannounce{\toks0 = }%
\input epsf.tex
\fi
+\closein 1
%
% We will only complain once about lack of epsf.tex.
\newif\ifwarnednoepsf
@@ -6267,7 +6273,7 @@ width0pt\relax} \fi
\nobreak\bigskip
% Usually we'll have text after the image which will insert
% \parskip glue, so insert it here too to equalize the space
- % above and below.
+ % above and below.
\nobreak\vskip\parskip
\nobreak
\line\bgroup\hss
@@ -6287,6 +6293,249 @@ width0pt\relax} \fi
\endgroup}
+% @float FLOATTYPE,LOC ... @end float for displayed figures, tables, etc.
+% We don't actually implement floating yet, we just plop the float "here".
+% But it seemed the best name for the future.
+%
+\envparseargdef\float{\dofloat #1,,,\finish}
+
+% #1 is the optional FLOATTYPE, the text label for this float, typically
+% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
+% this float will not be numbered and cannot be referred to.
+%
+% #2 is the optional xref label. Also must be present for the float to
+% be referable.
+%
+% #3 is the optional positioning argument; for now, it is ignored. It
+% will somehow specify the positions allowed to float to (here, top, bottom).
+%
+% We keep a separate counter for each FLOATTYPE, which we reset at each
+% chapter-level command.
+\let\resetallfloatnos=\empty
+%
+\def\dofloat#1,#2,#3,#4\finish{%
+ \let\thiscaption=\empty
+ \let\thisshortcaption=\empty
+ %
+ % don't lose footnotes inside @float.
+ \startsavinginserts
+ %
+ \vtop\bgroup
+ \def\floattype{#1}%
+ \def\floatlabel{#2}%
+ \def\floatloc{#3}% we do nothing with this yet.
+ %
+ \ifx\floattype\empty
+ \let\safefloattype=\empty
+ \else
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ \fi
+ %
+ % If label is given but no type, we handle that as the empty type.
+ \ifx\floatlabel\empty \else
+ % We want each FLOATTYPE to be numbered separately (Figure 1,
+ % Table 1, Figure 2, ...). (And if no label, no number.)
+ %
+ \expandafter\getfloatno\csname\safefloattype floatno\endcsname
+ \global\advance\floatno by 1
+ %
+ {%
+ % This magic value for \thissection is output by \setref as the
+ % XREFLABEL-title value. \xrefX uses it to distinguish float
+ % labels (which have a completely different output format) from
+ % node and anchor labels. And \xrdef uses it to construct the
+ % lists of floats.
+ %
+ \edef\thissection{\floatmagic=\safefloattype}%
+ \setref{\floatlabel}{Yfloat}%
+ }%
+ \fi
+ %
+ % start with \parskip glue, I guess.
+ \vskip\parskip
+ %
+ % Don't suppress indentation if a float happens to start a section.
+ \restorefirstparagraphindent
+}
+
+% we have these possibilities:
+% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
+% @float Foo,lbl & no caption: Foo 1.1
+% @float Foo & @caption{Cap}: Foo: Cap
+% @float Foo & no caption: Foo
+% @float ,lbl & Caption{Cap}: 1.1: Cap
+% @float ,lbl & no caption: 1.1
+% @float & @caption{Cap}: Cap
+% @float & no caption:
+%
+\def\Efloat{%
+ \let\floatident = \empty
+ %
+ % In all cases, if we have a float type, it comes first.
+ \ifx\floattype\empty \else \def\floatident{\floattype}\fi
+ %
+ % If we have an xref label, the number comes next.
+ \ifx\floatlabel\empty \else
+ \ifx\floattype\empty \else % if also had float type, need tie first.
+ \appendtomacro\floatident{\tie}%
+ \fi
+ % the number.
+ \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
+ \fi
+ %
+ % Start the printed caption with what we've constructed in
+ % \floatident, but keep it separate; we need \floatident again.
+ \let\captionline = \floatident
+ %
+ \ifx\thiscaption\empty \else
+ \ifx\floatident\empty \else
+ \appendtomacro\captionline{: }% had ident, so need a colon between
+ \fi
+ %
+ % caption text.
+ \appendtomacro\captionline\thiscaption
+ \fi
+ %
+ % If we have anything to print, print it, with space before.
+ % Eventually this needs to become an \insert.
+ \ifx\captionline\empty \else
+ \vskip.5\parskip
+ \captionline
+ \fi
+ %
+ % If have an xref label, write the list of floats info. Do this
+ % after the caption, to avoid chance of it being a breakpoint.
+ \ifx\floatlabel\empty \else
+ % Write the text that goes in the lof to the aux file as
+ % \floatlabel-lof. Besides \floatident, we include the short
+ % caption if specified, else the full caption if specified, else nothing.
+ {%
+ \atdummies \turnoffactive \otherbackslash
+ \immediate\write\auxfile{@xrdef{\floatlabel-lof}{%
+ \floatident
+ \ifx\thisshortcaption\empty
+ \ifx\thiscaption\empty \else : \thiscaption \fi
+ \else
+ : \thisshortcaption
+ \fi
+ }}%
+ }%
+ \fi
+ %
+ % Space below caption, if we printed anything.
+ \ifx\printedsomething\empty \else \vskip\parskip \fi
+ \egroup % end of \vtop
+ \checkinserts
+}
+
+% Append the tokens #2 to the definition of macro #1, not expanding either.
+%
+\newtoks\appendtomacroAtoks
+\newtoks\appendtomacroBtoks
+\def\appendtomacro#1#2{%
+ \appendtomacroAtoks = \expandafter{#1}%
+ \appendtomacroBtoks = {#2}%
+ \edef#1{\the\appendtomacroAtoks \the\appendtomacroBtoks}%
+}
+
+% @caption, @shortcaption are easy.
+%
+\long\def\caption#1{\checkenv\float \def\thiscaption{#1}}
+\def\shortcaption#1{\checkenv\float \def\thisshortcaption{#1}}
+
+% The parameter is the control sequence identifying the counter we are
+% going to use. Create it if it doesn't exist and assign it to \floatno.
+\def\getfloatno#1{%
+ \ifx#1\relax
+ % Haven't seen this figure type before.
+ \csname newcount\endcsname #1%
+ %
+ % Remember to reset this floatno at the next chap.
+ \expandafter\gdef\expandafter\resetallfloatnos
+ \expandafter{\resetallfloatnos #1=0 }%
+ \fi
+ \let\floatno#1%
+}
+
+% \setref calls this to get the XREFLABEL-snt value. We want an @xref
+% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
+% first read the @float command.
+%
+\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
+
+% Magic string used for the XREFLABEL-title value, so \xrefX can
+% distinguish floats from other xref types.
+\def\floatmagic{!!float!!}
+
+% #1 is the control sequence we are passed; we expand into a conditional
+% which is true if #1 represents a float ref. That is, the magic
+% \thissection value which we \setref above.
+%
+\def\iffloat#1{\expandafter\doiffloat#1==\finish}
+%
+% #1 is (maybe) the \floatmagic string. If so, #2 will be the
+% (safe) float type for this float. We set \iffloattype to #2.
+%
+\def\doiffloat#1=#2=#3\finish{%
+ \def\temp{#1}%
+ \def\iffloattype{#2}%
+ \ifx\temp\floatmagic
+}
+
+% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
+%
+\parseargdef\listoffloats{%
+ \def\floattype{#1}% floattype
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ %
+ % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
+ \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
+ \ifhavexrefs
+ % if the user said @listoffloats foo but never @float foo.
+ \message{\linenumber No `\safefloattype' floats to list.}%
+ \fi
+ \else
+ \begingroup
+ \leftskip=\tocindent % indent these entries like a toc
+ \let\do=\listoffloatsdo
+ \csname floatlist\safefloattype\endcsname
+ \endgroup
+ \fi
+}
+
+% This is called on each entry in a list of floats. We're passed the
+% xref label, in the form LABEL-title, which is how we save it in the
+% aux file. We strip off the -title and look up \XRLABEL-lof, which
+% has the text we're supposed to typeset here.
+%
+% Figures without xref labels will not be included in the list (since
+% they won't appear in the aux file).
+%
+\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+\def\listoffloatsdoentry#1-title\finish{{%
+ % Can't fully expand XR#1-lof because it can contain anything. Just
+ % pass the control sequence. On the other hand, XR#1-pg is just the
+ % page number, and we want to fully expand that so we can get a link
+ % in pdf output.
+ \toksA = \expandafter{\csname XR#1-lof\endcsname}%
+ %
+ % use the same \entry macro we use to generate the TOC and index.
+ \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
+ \writeentry
+}}
+
\message{localization,}
% and i18n.
@@ -6295,19 +6544,17 @@ width0pt\relax} \fi
% properly. Single argument is the language abbreviation.
% It would be nice if we could set up a hyphenation file here.
%
-\def\documentlanguage{\parsearg\dodocumentlanguage}
-\def\dodocumentlanguage#1{%
+\parseargdef\documentlanguage{%
\tex % read txi-??.tex file in plain TeX.
- % Read the file if it exists.
- \openin 1 txi-#1.tex
- \ifeof1
- \errhelp = \nolanghelp
- \errmessage{Cannot read language file txi-#1.tex}%
- \let\temp = \relax
- \else
- \def\temp{\input txi-#1.tex }%
- \fi
- \temp
+ % Read the file if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \else
+ \input txi-#1.tex
+ \fi
+ \closein 1
\endgroup
}
\newhelp\nolanghelp{The given language definition file cannot be found or
@@ -6355,7 +6602,7 @@ should work if nowhere else does.}
% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
% physical page width.
-%
+%
% We also call \setleading{\textleading}, so the caller should define
% \textleading. The caller should also set \parskip.
%
@@ -6423,7 +6670,7 @@ should work if nowhere else does.}
\parskip = 3pt plus 2pt minus 1pt
\textleading = 13.2pt
%
- % Double-side printing via postscript on Laserjet 4050
+ % Double-side printing via postscript on Laserjet 4050
% prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
% To change the settings for a different printer or situation, adjust
% \normaloffset until the front-side and back-side texts align. Then
@@ -6464,7 +6711,7 @@ should work if nowhere else does.}
\tableindent = 12mm
}}
-% A specific text layout, 24x15cm overall, intended for A4 paper.
+% A specific text layout, 24x15cm overall, intended for A4 paper.
\def\afourlatex{{\globaldefs = 1
\afourpaper
\internalpagesizes{237mm}{150mm}%
@@ -6490,8 +6737,7 @@ should work if nowhere else does.}
% Perhaps we should allow setting the margins, \topskip, \parskip,
% and/or leading, also. Or perhaps we should compute them somehow.
%
-\def\pagesizes{\parsearg\pagesizesxxx}
-\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
\def\pagesizesyyy#1,#2,#3\finish{{%
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
\globaldefs = 1
@@ -6538,8 +6784,8 @@ should work if nowhere else does.}
\def\normalplus{+}
\def\normaldollar{$}%$ font-lock fix
-% This macro is used to make a character print one way in ttfont
-% where it can probably just be output, and another way in other fonts,
+% This macro is used to make a character print one way in \tt
+% (where it can probably be output as-is), and another way in other fonts,
% where something hairier probably needs to be done.
%
% #1 is what to print if we are indeed using \tt; #2 is what to print
@@ -6587,13 +6833,6 @@ should work if nowhere else does.}
\catcode`\$=\active
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
-% Set up an active definition for =, but don't enable it most of the time.
-{\catcode`\==\active
-\global\def={{\tt \char 61}}}
-
-\catcode`+=\active
-\catcode`\_=\active
-
% If a .fmt file is being used, characters that might appear in a file
% name cannot be active until we have parsed the command line.
% So turn them off again, and have \everyjob (or @setfilename) turn them on.
@@ -6602,15 +6841,16 @@ should work if nowhere else does.}
\catcode`\@=0
-% \rawbackslashxx outputs one backslash character in current font,
+% \backslashcurfont outputs one backslash character in current font,
% as in \char`\\.
-\global\chardef\rawbackslashxx=`\\
+\global\chardef\backslashcurfont=`\\
+\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
-% \rawbackslash defines an active \ to do \rawbackslashxx.
+% \rawbackslash defines an active \ to do \backslashcurfont.
% \otherbackslash defines an active \ to be a literal `\' character with
% catcode other.
{\catcode`\\=\active
- @gdef@rawbackslash{@let\=@rawbackslashxx}
+ @gdef@rawbackslash{@let\=@backslashcurfont}
@gdef@otherbackslash{@let\=@realbackslash}
}
@@ -6618,7 +6858,7 @@ should work if nowhere else does.}
{\catcode`\\=\other @gdef@realbackslash{\}}
% \normalbackslash outputs one backslash in fixed width font.
-\def\normalbackslash{{\tt\rawbackslashxx}}
+\def\normalbackslash{{\tt\backslashcurfont}}
\catcode`\\=\active
@@ -6635,12 +6875,13 @@ should work if nowhere else does.}
@let>=@normalgreater
@let+=@normalplus
@let$=@normaldollar %$ font-lock fix
+ @unsepspaces
}
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
% the literal character `\'. (Thus, \ is not expandable when this is in
% effect.)
-%
+%
@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
% Make _ and + \other characters, temporarily.
@@ -6669,15 +6910,11 @@ should work if nowhere else does.}
% Say @foo, not \foo, in error messages.
@escapechar = `@@
-% These look ok in all fonts, so just make them not special.
+% These look ok in all fonts, so just make them not special.
@catcode`@& = @other
@catcode`@# = @other
@catcode`@% = @other
-@c Set initial fonts.
-@textfonts
-@rm
-
@c Local variables:
@c eval: (add-hook 'write-file-hooks 'time-stamp)
@@ -6686,3 +6923,9 @@ should work if nowhere else does.}
@c time-stamp-format: "%:y-%02m-%02d.%02H"
@c time-stamp-end: "}"
@c End:
+
+@c vim:sw=2:
+
+@ignore
+ arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
+@end ignore