From 5d522df45b49d6b5cb503e2f69b60e64bb65fa68 Mon Sep 17 00:00:00 2001 From: dfr Date: Sun, 2 May 1999 10:18:14 +0000 Subject: Virgin import of gdb-4.18 --- contrib/gdb/COPYING | 7 +- contrib/gdb/COPYING.LIB | 5 +- contrib/gdb/Makefile.in | 841 ++- contrib/gdb/README | 15 +- contrib/gdb/config-ml.in | 624 +++ contrib/gdb/config.guess | 543 +- contrib/gdb/config.if | 87 + contrib/gdb/config.sub | 338 +- contrib/gdb/configure | 549 +- contrib/gdb/configure.in | 691 ++- contrib/gdb/gdb/COPYING | 7 +- contrib/gdb/gdb/ChangeLog | 2117 ++++---- contrib/gdb/gdb/ChangeLog-95 | 95 +- contrib/gdb/gdb/ChangeLog-96 | 5116 ++++++++++++++++++ contrib/gdb/gdb/ChangeLog-97 | 2855 +++++++++++ contrib/gdb/gdb/ChangeLog-98 | 7122 ++++++++++++++++++++++++++ contrib/gdb/gdb/Makefile.in | 529 +- contrib/gdb/gdb/NEWS | 273 + contrib/gdb/gdb/README | 255 +- contrib/gdb/gdb/TODO | 3 + contrib/gdb/gdb/abug-rom.c | 169 + contrib/gdb/gdb/acconfig.h | 86 + contrib/gdb/gdb/acinclude.m4 | 861 ++++ contrib/gdb/gdb/aclocal.m4 | 1424 +++-- contrib/gdb/gdb/alpha-nat.c | 86 +- contrib/gdb/gdb/alpha-tdep.c | 254 +- contrib/gdb/gdb/annotate.c | 51 +- contrib/gdb/gdb/annotate.h | 9 + contrib/gdb/gdb/arc-tdep.c | 733 +++ contrib/gdb/gdb/arm-tdep.c | 1642 ++++-- contrib/gdb/gdb/arm-xdep.c | 287 +- contrib/gdb/gdb/ax-gdb.c | 1942 +++++++ contrib/gdb/gdb/ax-gdb.h | 111 + contrib/gdb/gdb/ax-general.c | 552 ++ contrib/gdb/gdb/ax.h | 285 ++ contrib/gdb/gdb/bcache.c | 40 +- contrib/gdb/gdb/bcache.h | 2 +- contrib/gdb/gdb/blockframe.c | 581 ++- contrib/gdb/gdb/breakpoint.c | 3877 +++++++++++--- contrib/gdb/gdb/breakpoint.h | 190 +- contrib/gdb/gdb/buildsym.c | 655 ++- contrib/gdb/gdb/buildsym.h | 256 +- contrib/gdb/gdb/c-exp.tab.c | 1247 ++--- contrib/gdb/gdb/c-exp.y | 229 +- contrib/gdb/gdb/c-lang.c | 79 +- contrib/gdb/gdb/c-lang.h | 33 +- contrib/gdb/gdb/c-typeprint.c | 474 +- contrib/gdb/gdb/c-valprint.c | 148 +- contrib/gdb/gdb/ch-exp.c | 141 +- contrib/gdb/gdb/ch-lang.c | 26 +- contrib/gdb/gdb/ch-lang.h | 5 +- contrib/gdb/gdb/ch-valprint.c | 104 +- contrib/gdb/gdb/coff-solib.c | 5 +- contrib/gdb/gdb/coff-solib.h | 130 + contrib/gdb/gdb/coffread.c | 261 +- contrib/gdb/gdb/command.c | 190 +- contrib/gdb/gdb/complaints.c | 5 - contrib/gdb/gdb/complaints.h | 7 + contrib/gdb/gdb/config.in | 261 +- contrib/gdb/gdb/config/alpha/alpha-linux.mh | 9 + contrib/gdb/gdb/config/alpha/alpha-linux.mt | 3 + contrib/gdb/gdb/config/alpha/alpha-osf1.mh | 5 + contrib/gdb/gdb/config/alpha/alpha-osf1.mt | 3 + contrib/gdb/gdb/config/alpha/alpha-osf2.mh | 5 + contrib/gdb/gdb/config/alpha/alpha-osf3.mh | 5 + contrib/gdb/gdb/config/alpha/nm-linux.h | 66 + contrib/gdb/gdb/config/alpha/nm-osf.h | 56 + contrib/gdb/gdb/config/alpha/nm-osf2.h | 54 + contrib/gdb/gdb/config/alpha/nm-osf3.h | 26 + contrib/gdb/gdb/config/alpha/tm-alpha.h | 479 ++ contrib/gdb/gdb/config/alpha/tm-alphalinux.h | 80 + contrib/gdb/gdb/config/alpha/xm-alphalinux.h | 29 + contrib/gdb/gdb/config/alpha/xm-alphaosf.h | 27 + contrib/gdb/gdb/config/i386/cygwin.mh | 6 + contrib/gdb/gdb/config/i386/cygwin.mt | 6 + contrib/gdb/gdb/config/i386/fbsd.mh | 2 +- contrib/gdb/gdb/config/i386/fbsd.mt | 2 +- contrib/gdb/gdb/config/i386/go32.mh | 1 - contrib/gdb/gdb/config/i386/i386aix.mh | 2 - contrib/gdb/gdb/config/i386/i386dgux.mh | 5 - contrib/gdb/gdb/config/i386/i386gnu.mh | 13 +- contrib/gdb/gdb/config/i386/i386m3.mh | 4 - contrib/gdb/gdb/config/i386/i386mk.mh | 4 - contrib/gdb/gdb/config/i386/i386mk.mt | 2 +- contrib/gdb/gdb/config/i386/i386sco5.mh | 4 +- contrib/gdb/gdb/config/i386/i386sco5.mt | 3 + contrib/gdb/gdb/config/i386/i386sol2.mh | 7 +- contrib/gdb/gdb/config/i386/i386sol2.mt | 2 +- contrib/gdb/gdb/config/i386/i386v4.mh | 5 - contrib/gdb/gdb/config/i386/i386v42mp.mh | 11 + contrib/gdb/gdb/config/i386/i386v42mp.mt | 3 + contrib/gdb/gdb/config/i386/linux.mh | 8 +- contrib/gdb/gdb/config/i386/linux.mt | 4 +- contrib/gdb/gdb/config/i386/nbsd.mh | 2 +- contrib/gdb/gdb/config/i386/ncr3000.mh | 5 - contrib/gdb/gdb/config/i386/nm-fbsd.h | 3 - contrib/gdb/gdb/config/i386/nm-i386sco.h | 6 - contrib/gdb/gdb/config/i386/nm-i386sco5.h | 22 +- contrib/gdb/gdb/config/i386/nm-i386sol2.h | 35 + contrib/gdb/gdb/config/i386/nm-i386v.h | 2 - contrib/gdb/gdb/config/i386/nm-i386v4.h | 5 +- contrib/gdb/gdb/config/i386/nm-i386v42mp.h | 22 + contrib/gdb/gdb/config/i386/nm-linux.h | 21 +- contrib/gdb/gdb/config/i386/nm-symmetry.h | 1 - contrib/gdb/gdb/config/i386/tm-cygwin.h | 127 + contrib/gdb/gdb/config/i386/tm-fbsd.h | 32 + contrib/gdb/gdb/config/i386/tm-i386.h | 12 +- contrib/gdb/gdb/config/i386/tm-i386bsd.h | 4 +- contrib/gdb/gdb/config/i386/tm-i386nw.h | 2 +- contrib/gdb/gdb/config/i386/tm-i386os9k.h | 4 +- contrib/gdb/gdb/config/i386/tm-i386sco5.h | 62 + contrib/gdb/gdb/config/i386/tm-i386sol2.h | 64 + contrib/gdb/gdb/config/i386/tm-i386v.h | 6 +- contrib/gdb/gdb/config/i386/tm-i386v4.h | 2 +- contrib/gdb/gdb/config/i386/tm-i386v42mp.h | 44 + contrib/gdb/gdb/config/i386/tm-linux.h | 5 +- contrib/gdb/gdb/config/i386/windows.mh | 17 + contrib/gdb/gdb/config/i386/xm-cygwin.h | 34 + contrib/gdb/gdb/config/i386/xm-i386bsd.h | 3 +- contrib/gdb/gdb/config/i386/xm-i386m3.h | 5 - contrib/gdb/gdb/config/i386/xm-i386mach.h | 5 - contrib/gdb/gdb/config/i386/xm-i386mk.h | 2 +- contrib/gdb/gdb/config/i386/xm-i386v4.h | 10 - contrib/gdb/gdb/config/i386/xm-linux.h | 12 +- contrib/gdb/gdb/config/i386/xm-windows.h | 35 + contrib/gdb/gdb/configure | 5792 +++++++++++++++++---- contrib/gdb/gdb/configure.host | 162 + contrib/gdb/gdb/configure.in | 827 ++- contrib/gdb/gdb/configure.tgt | 282 + contrib/gdb/gdb/copying.awk | 8 +- contrib/gdb/gdb/copying.c | 10 +- contrib/gdb/gdb/core-aout.c | 54 +- contrib/gdb/gdb/core-regset.c | 10 +- contrib/gdb/gdb/core-sol2.c | 8 +- contrib/gdb/gdb/corefile.c | 156 +- contrib/gdb/gdb/corelow.c | 202 +- contrib/gdb/gdb/cp-valprint.c | 312 +- contrib/gdb/gdb/cpu32bug-rom.c | 104 +- contrib/gdb/gdb/cxux-nat.c | 4 +- contrib/gdb/gdb/dbxread.c | 610 ++- contrib/gdb/gdb/dcache.c | 90 +- contrib/gdb/gdb/defs.h | 476 +- contrib/gdb/gdb/demangle.c | 169 +- contrib/gdb/gdb/dink32-rom.c | 198 + contrib/gdb/gdb/doc/ChangeLog | 267 + contrib/gdb/gdb/doc/GDBvn.texi | 2 +- contrib/gdb/gdb/doc/HPPA-cfg.texi | 114 + contrib/gdb/gdb/doc/LRS | 197 + contrib/gdb/gdb/doc/Makefile.in | 81 +- contrib/gdb/gdb/doc/agentexpr.texi | 839 +++ contrib/gdb/gdb/doc/all-cfg.texi | 16 +- contrib/gdb/gdb/doc/configure | 862 ++++ contrib/gdb/gdb/doc/configure.in | 11 +- contrib/gdb/gdb/doc/gdb.texinfo | 2688 +++++++--- contrib/gdb/gdb/doc/gdbint.texinfo | 4068 ++++++++------- contrib/gdb/gdb/doc/refcard.tex | 32 +- contrib/gdb/gdb/doc/remote.texi | 217 +- contrib/gdb/gdb/doc/stabs.texinfo | 121 +- contrib/gdb/gdb/dwarf2read.c | 5865 +++++++++++++++++++++ contrib/gdb/gdb/dwarfread.c | 152 +- contrib/gdb/gdb/elfread.c | 141 +- contrib/gdb/gdb/eval.c | 359 +- contrib/gdb/gdb/exec.c | 293 +- contrib/gdb/gdb/expprint.c | 485 +- contrib/gdb/gdb/expression.h | 26 +- contrib/gdb/gdb/f-exp.tab.c | 243 +- contrib/gdb/gdb/f-exp.y | 10 +- contrib/gdb/gdb/f-lang.c | 155 +- contrib/gdb/gdb/f-lang.h | 6 +- contrib/gdb/gdb/f-typeprint.c | 26 +- contrib/gdb/gdb/f-valprint.c | 61 +- contrib/gdb/gdb/findvar.c | 420 +- contrib/gdb/gdb/fork-child.c | 473 +- contrib/gdb/gdb/fr30-tdep.c | 552 ++ contrib/gdb/gdb/frame.h | 134 +- contrib/gdb/gdb/gdb-stabs.h | 16 +- contrib/gdb/gdb/gdb.1 | 6 +- contrib/gdb/gdb/gdb_string.h | 34 +- contrib/gdb/gdb/gdbarch.c | 360 ++ contrib/gdb/gdb/gdbarch.h | 118 + contrib/gdb/gdb/gdbcmd.h | 8 + contrib/gdb/gdb/gdbcore.h | 22 +- contrib/gdb/gdb/gdbinit.in | 18 + contrib/gdb/gdb/gdbserver/Makefile.in | 44 +- contrib/gdb/gdb/gdbserver/configure.in | 245 +- contrib/gdb/gdb/gdbserver/gdbreplay.c | 3 +- contrib/gdb/gdb/gdbserver/low-hppabsd.c | 6 +- contrib/gdb/gdb/gdbserver/low-linux.c | 47 +- contrib/gdb/gdb/gdbserver/low-sim.c | 289 ++ contrib/gdb/gdb/gdbserver/low-sparc.c | 2 +- contrib/gdb/gdb/gdbserver/remote-utils.c | 102 +- contrib/gdb/gdb/gdbserver/server.c | 43 +- contrib/gdb/gdb/gdbserver/server.h | 62 +- contrib/gdb/gdb/gdbserver/utils.c | 3 +- contrib/gdb/gdb/gdbthread.h | 121 + contrib/gdb/gdb/gdbtypes.c | 1302 ++++- contrib/gdb/gdb/gdbtypes.h | 434 +- contrib/gdb/gdb/gnu-nat.c | 811 ++- contrib/gdb/gdb/gnu-nat.h | 32 +- contrib/gdb/gdb/gnu-regex.c | 6668 +++++++++++++++++++----- contrib/gdb/gdb/gnu-regex.h | 727 ++- contrib/gdb/gdb/hp-psymtab-read.c | 2381 +++++++++ contrib/gdb/gdb/hp-symtab-read.c | 3988 ++++++++++++++ contrib/gdb/gdb/hpread.h | 150 + contrib/gdb/gdb/hpux-thread.c | 641 +++ contrib/gdb/gdb/i386-stub.c | 38 +- contrib/gdb/gdb/i386-tdep.c | 114 +- contrib/gdb/gdb/i386aix-nat.c | 6 +- contrib/gdb/gdb/i386b-nat.c | 3 +- contrib/gdb/gdb/i386gnu-nat.c | 29 +- contrib/gdb/gdb/i386ly-tdep.c | 1 + contrib/gdb/gdb/i386m3-nat.c | 6 +- contrib/gdb/gdb/i386mach-nat.c | 4 +- contrib/gdb/gdb/i386v-nat.c | 29 +- contrib/gdb/gdb/i386v4-nat.c | 25 +- contrib/gdb/gdb/i387-tdep.c | 6 +- contrib/gdb/gdb/infcmd.c | 306 +- contrib/gdb/gdb/inferior.h | 183 +- contrib/gdb/gdb/inflow.c | 67 +- contrib/gdb/gdb/infptrace.c | 240 +- contrib/gdb/gdb/infrun.c | 2243 ++++++-- contrib/gdb/gdb/inftarg.c | 768 ++- contrib/gdb/gdb/infttrace.c | 5674 ++++++++++++++++++++ contrib/gdb/gdb/irix4-nat.c | 5 +- contrib/gdb/gdb/irix5-nat.c | 484 +- contrib/gdb/gdb/jv-exp.tab.c | 2351 +++++++++ contrib/gdb/gdb/jv-exp.y | 1466 ++++++ contrib/gdb/gdb/jv-lang.c | 1088 ++++ contrib/gdb/gdb/jv-lang.h | 67 + contrib/gdb/gdb/jv-typeprint.c | 339 ++ contrib/gdb/gdb/jv-valprint.c | 526 ++ contrib/gdb/gdb/language.c | 85 +- contrib/gdb/gdb/language.h | 30 +- contrib/gdb/gdb/lynx-nat.c | 15 +- contrib/gdb/gdb/m2-exp.tab.c | 210 +- contrib/gdb/gdb/m2-exp.y | 2 +- contrib/gdb/gdb/m2-lang.c | 17 +- contrib/gdb/gdb/m2-lang.h | 2 +- contrib/gdb/gdb/m2-valprint.c | 12 +- contrib/gdb/gdb/m3-nat.c | 100 +- contrib/gdb/gdb/m32r-rom.c | 650 +++ contrib/gdb/gdb/m32r-stub.c | 1685 ++++++ contrib/gdb/gdb/m32r-tdep.c | 745 +++ contrib/gdb/gdb/m68k-stub.c | 6 +- contrib/gdb/gdb/m68k-tdep.c | 4 +- contrib/gdb/gdb/m68klinux-nat.c | 155 + contrib/gdb/gdb/m68knbsd-nat.c | 2 +- contrib/gdb/gdb/m88k-tdep.c | 25 +- contrib/gdb/gdb/main.c | 311 +- contrib/gdb/gdb/maint.c | 81 +- contrib/gdb/gdb/mdebugread.c | 486 +- contrib/gdb/gdb/mem-break.c | 121 +- contrib/gdb/gdb/minsyms.c | 105 +- contrib/gdb/gdb/mipsread.c | 39 +- contrib/gdb/gdb/mon960-rom.c | 224 +- contrib/gdb/gdb/monitor.c | 1175 ++++- contrib/gdb/gdb/monitor.h | 272 +- contrib/gdb/gdb/mpw-config.in | 1 - contrib/gdb/gdb/mpw-make.sed | 31 +- contrib/gdb/gdb/nindy-tdep.c | 3 +- contrib/gdb/gdb/nlm/Makefile.in | 17 +- contrib/gdb/gdb/nlm/configure | 314 +- contrib/gdb/gdb/nlm/configure.in | 4 +- contrib/gdb/gdb/nlmread.c | 59 +- contrib/gdb/gdb/ns32k-tdep.c | 95 + contrib/gdb/gdb/ns32km3-nat.c | 16 +- contrib/gdb/gdb/ns32knbsd-nat.c | 353 ++ contrib/gdb/gdb/objfiles.c | 249 +- contrib/gdb/gdb/objfiles.h | 76 +- contrib/gdb/gdb/ocd.c | 1444 ++++++ contrib/gdb/gdb/ocd.h | 139 + contrib/gdb/gdb/op50-rom.c | 118 +- contrib/gdb/gdb/os9kread.c | 75 +- contrib/gdb/gdb/osfsolib.c | 47 +- contrib/gdb/gdb/parse.c | 384 +- contrib/gdb/gdb/parser-defs.h | 7 + contrib/gdb/gdb/partial-stab.h | 84 +- contrib/gdb/gdb/ppc-bdm.c | 387 ++ contrib/gdb/gdb/ppcbug-rom.c | 109 +- contrib/gdb/gdb/printcmd.c | 577 ++- contrib/gdb/gdb/procfs.c | 5543 +++++++++++++------- contrib/gdb/gdb/pyr-tdep.c | 100 +- contrib/gdb/gdb/pyr-xdep.c | 12 +- contrib/gdb/gdb/remote-adapt.c | 140 +- contrib/gdb/gdb/remote-array.c | 144 +- contrib/gdb/gdb/remote-bug.c | 104 +- contrib/gdb/gdb/remote-d10v.c | 228 + contrib/gdb/gdb/remote-e7000.c | 538 +- contrib/gdb/gdb/remote-eb.c | 95 +- contrib/gdb/gdb/remote-es.c | 234 +- contrib/gdb/gdb/remote-est.c | 105 +- contrib/gdb/gdb/remote-hms.c | 205 +- contrib/gdb/gdb/remote-mips.c | 1550 ++++-- contrib/gdb/gdb/remote-mm.c | 102 +- contrib/gdb/gdb/remote-nindy.c | 138 +- contrib/gdb/gdb/remote-nrom.c | 110 +- contrib/gdb/gdb/remote-os9k.c | 128 +- contrib/gdb/gdb/remote-rdi.c | 973 ++++ contrib/gdb/gdb/remote-rdp.c | 417 +- contrib/gdb/gdb/remote-sds.c | 1206 +++++ contrib/gdb/gdb/remote-sim.c | 735 ++- contrib/gdb/gdb/remote-st.c | 124 +- contrib/gdb/gdb/remote-udi.c | 111 +- contrib/gdb/gdb/remote-utils.c | 22 +- contrib/gdb/gdb/remote-vx.c | 171 +- contrib/gdb/gdb/remote-vx29k.c | 2 +- contrib/gdb/gdb/remote.c | 2284 +++++++-- contrib/gdb/gdb/scm-exp.c | 19 +- contrib/gdb/gdb/scm-lang.c | 28 +- contrib/gdb/gdb/scm-lang.h | 6 +- contrib/gdb/gdb/scm-tags.h | 4 +- contrib/gdb/gdb/scm-valprint.c | 38 +- contrib/gdb/gdb/ser-e7kpc.c | 138 +- contrib/gdb/gdb/ser-go32.c | 1 + contrib/gdb/gdb/ser-mac.c | 3 +- contrib/gdb/gdb/ser-ocd.c | 209 + contrib/gdb/gdb/ser-tcp.c | 45 +- contrib/gdb/gdb/ser-unix.c | 94 +- contrib/gdb/gdb/serial.c | 198 +- contrib/gdb/gdb/serial.h | 19 +- contrib/gdb/gdb/sol-thread.c | 1673 ++++++ contrib/gdb/gdb/solib.c | 274 +- contrib/gdb/gdb/solib.h | 145 +- contrib/gdb/gdb/somread.c | 403 +- contrib/gdb/gdb/somsolib.c | 1066 +++- contrib/gdb/gdb/somsolib.h | 126 + contrib/gdb/gdb/source.c | 324 +- contrib/gdb/gdb/srec.h | 7 +- contrib/gdb/gdb/stabsread.c | 1812 +++++-- contrib/gdb/gdb/stabsread.h | 36 +- contrib/gdb/gdb/stack.c | 693 ++- contrib/gdb/gdb/symfile.c | 1503 +++++- contrib/gdb/gdb/symfile.h | 107 +- contrib/gdb/gdb/symmisc.c | 233 +- contrib/gdb/gdb/symtab.c | 2320 ++++++--- contrib/gdb/gdb/symtab.h | 313 +- contrib/gdb/gdb/target.c | 981 +++- contrib/gdb/gdb/target.h | 541 +- contrib/gdb/gdb/terminal.h | 17 +- contrib/gdb/gdb/thread.c | 359 +- contrib/gdb/gdb/top.c | 626 ++- contrib/gdb/gdb/top.h | 25 +- contrib/gdb/gdb/tracepoint.c | 2780 ++++++++++ contrib/gdb/gdb/tracepoint.h | 137 + contrib/gdb/gdb/tui/ChangeLog | 121 + contrib/gdb/gdb/tui/Makefile | 182 + contrib/gdb/gdb/tui/Makefile.in | 168 + contrib/gdb/gdb/tui/tui.c | 830 +++ contrib/gdb/gdb/tui/tui.h | 120 + contrib/gdb/gdb/tui/tuiCommand.c | 215 + contrib/gdb/gdb/tui/tuiCommand.h | 24 + contrib/gdb/gdb/tui/tuiData.c | 1624 ++++++ contrib/gdb/gdb/tui/tuiData.h | 302 ++ contrib/gdb/gdb/tui/tuiDataWin.c | 400 ++ contrib/gdb/gdb/tui/tuiDataWin.h | 29 + contrib/gdb/gdb/tui/tuiDisassem.c | 343 ++ contrib/gdb/gdb/tui/tuiDisassem.h | 22 + contrib/gdb/gdb/tui/tuiGeneralWin.c | 469 ++ contrib/gdb/gdb/tui/tuiGeneralWin.h | 31 + contrib/gdb/gdb/tui/tuiIO.c | 734 +++ contrib/gdb/gdb/tui/tuiIO.h | 43 + contrib/gdb/gdb/tui/tuiLayout.c | 1410 +++++ contrib/gdb/gdb/tui/tuiLayout.h | 15 + contrib/gdb/gdb/tui/tuiRegs.c | 1210 +++++ contrib/gdb/gdb/tui/tuiRegs.h | 28 + contrib/gdb/gdb/tui/tuiSource.c | 465 ++ contrib/gdb/gdb/tui/tuiSource.h | 27 + contrib/gdb/gdb/tui/tuiSourceWin.c | 1098 ++++ contrib/gdb/gdb/tui/tuiSourceWin.h | 74 + contrib/gdb/gdb/tui/tuiStack.c | 554 ++ contrib/gdb/gdb/tui/tuiStack.h | 22 + contrib/gdb/gdb/tui/tuiWin.c | 1650 ++++++ contrib/gdb/gdb/tui/tuiWin.h | 28 + contrib/gdb/gdb/typeprint.c | 27 +- contrib/gdb/gdb/typeprint.h | 6 +- contrib/gdb/gdb/utils.c | 1348 ++++- contrib/gdb/gdb/v850-tdep.c | 884 ++++ contrib/gdb/gdb/valarith.c | 102 +- contrib/gdb/gdb/valops.c | 1597 +++++- contrib/gdb/gdb/valprint.c | 832 ++- contrib/gdb/gdb/valprint.h | 12 +- contrib/gdb/gdb/value.h | 111 +- contrib/gdb/gdb/values.c | 409 +- contrib/gdb/gdb/xcoffread.c | 182 +- contrib/gdb/gdb/xcoffsolib.c | 13 +- contrib/gdb/gdb/xcoffsolib.h | 12 +- contrib/gdb/move-if-change | 17 + 387 files changed, 143341 insertions(+), 22624 deletions(-) create mode 100644 contrib/gdb/config-ml.in create mode 100644 contrib/gdb/config.if create mode 100644 contrib/gdb/gdb/ChangeLog-96 create mode 100644 contrib/gdb/gdb/ChangeLog-97 create mode 100644 contrib/gdb/gdb/ChangeLog-98 create mode 100644 contrib/gdb/gdb/abug-rom.c create mode 100644 contrib/gdb/gdb/acinclude.m4 create mode 100644 contrib/gdb/gdb/arc-tdep.c create mode 100644 contrib/gdb/gdb/ax-gdb.c create mode 100644 contrib/gdb/gdb/ax-gdb.h create mode 100644 contrib/gdb/gdb/ax-general.c create mode 100644 contrib/gdb/gdb/ax.h create mode 100644 contrib/gdb/gdb/config/alpha/alpha-linux.mh create mode 100644 contrib/gdb/gdb/config/alpha/alpha-linux.mt create mode 100644 contrib/gdb/gdb/config/alpha/alpha-osf1.mh create mode 100644 contrib/gdb/gdb/config/alpha/alpha-osf1.mt create mode 100644 contrib/gdb/gdb/config/alpha/alpha-osf2.mh create mode 100644 contrib/gdb/gdb/config/alpha/alpha-osf3.mh create mode 100644 contrib/gdb/gdb/config/alpha/nm-linux.h create mode 100644 contrib/gdb/gdb/config/alpha/nm-osf.h create mode 100644 contrib/gdb/gdb/config/alpha/nm-osf2.h create mode 100644 contrib/gdb/gdb/config/alpha/nm-osf3.h create mode 100644 contrib/gdb/gdb/config/alpha/tm-alpha.h create mode 100644 contrib/gdb/gdb/config/alpha/tm-alphalinux.h create mode 100644 contrib/gdb/gdb/config/alpha/xm-alphalinux.h create mode 100644 contrib/gdb/gdb/config/alpha/xm-alphaosf.h create mode 100644 contrib/gdb/gdb/config/i386/cygwin.mh create mode 100644 contrib/gdb/gdb/config/i386/cygwin.mt create mode 100644 contrib/gdb/gdb/config/i386/i386sco5.mt create mode 100644 contrib/gdb/gdb/config/i386/i386v42mp.mh create mode 100644 contrib/gdb/gdb/config/i386/i386v42mp.mt create mode 100644 contrib/gdb/gdb/config/i386/nm-i386sol2.h create mode 100644 contrib/gdb/gdb/config/i386/nm-i386v42mp.h create mode 100644 contrib/gdb/gdb/config/i386/tm-cygwin.h create mode 100644 contrib/gdb/gdb/config/i386/tm-fbsd.h create mode 100644 contrib/gdb/gdb/config/i386/tm-i386sco5.h create mode 100644 contrib/gdb/gdb/config/i386/tm-i386sol2.h create mode 100644 contrib/gdb/gdb/config/i386/tm-i386v42mp.h create mode 100644 contrib/gdb/gdb/config/i386/windows.mh create mode 100644 contrib/gdb/gdb/config/i386/xm-cygwin.h create mode 100644 contrib/gdb/gdb/config/i386/xm-windows.h create mode 100644 contrib/gdb/gdb/configure.host create mode 100644 contrib/gdb/gdb/configure.tgt create mode 100644 contrib/gdb/gdb/dink32-rom.c create mode 100644 contrib/gdb/gdb/doc/HPPA-cfg.texi create mode 100644 contrib/gdb/gdb/doc/LRS create mode 100644 contrib/gdb/gdb/doc/agentexpr.texi create mode 100644 contrib/gdb/gdb/doc/configure create mode 100644 contrib/gdb/gdb/dwarf2read.c create mode 100644 contrib/gdb/gdb/fr30-tdep.c create mode 100644 contrib/gdb/gdb/gdbarch.c create mode 100644 contrib/gdb/gdb/gdbarch.h create mode 100644 contrib/gdb/gdb/gdbinit.in create mode 100644 contrib/gdb/gdb/gdbserver/low-sim.c create mode 100644 contrib/gdb/gdb/gdbthread.h create mode 100644 contrib/gdb/gdb/hp-psymtab-read.c create mode 100644 contrib/gdb/gdb/hp-symtab-read.c create mode 100644 contrib/gdb/gdb/hpread.h create mode 100644 contrib/gdb/gdb/hpux-thread.c create mode 100644 contrib/gdb/gdb/infttrace.c create mode 100644 contrib/gdb/gdb/jv-exp.tab.c create mode 100644 contrib/gdb/gdb/jv-exp.y create mode 100644 contrib/gdb/gdb/jv-lang.c create mode 100644 contrib/gdb/gdb/jv-lang.h create mode 100644 contrib/gdb/gdb/jv-typeprint.c create mode 100644 contrib/gdb/gdb/jv-valprint.c create mode 100644 contrib/gdb/gdb/m32r-rom.c create mode 100644 contrib/gdb/gdb/m32r-stub.c create mode 100644 contrib/gdb/gdb/m32r-tdep.c create mode 100644 contrib/gdb/gdb/m68klinux-nat.c create mode 100644 contrib/gdb/gdb/ns32knbsd-nat.c create mode 100644 contrib/gdb/gdb/ocd.c create mode 100644 contrib/gdb/gdb/ocd.h create mode 100644 contrib/gdb/gdb/ppc-bdm.c create mode 100644 contrib/gdb/gdb/remote-d10v.c create mode 100644 contrib/gdb/gdb/remote-rdi.c create mode 100644 contrib/gdb/gdb/remote-sds.c create mode 100644 contrib/gdb/gdb/ser-ocd.c create mode 100644 contrib/gdb/gdb/sol-thread.c create mode 100644 contrib/gdb/gdb/tracepoint.c create mode 100644 contrib/gdb/gdb/tracepoint.h create mode 100644 contrib/gdb/gdb/tui/ChangeLog create mode 100644 contrib/gdb/gdb/tui/Makefile create mode 100644 contrib/gdb/gdb/tui/Makefile.in create mode 100644 contrib/gdb/gdb/tui/tui.c create mode 100644 contrib/gdb/gdb/tui/tui.h create mode 100644 contrib/gdb/gdb/tui/tuiCommand.c create mode 100644 contrib/gdb/gdb/tui/tuiCommand.h create mode 100644 contrib/gdb/gdb/tui/tuiData.c create mode 100644 contrib/gdb/gdb/tui/tuiData.h create mode 100644 contrib/gdb/gdb/tui/tuiDataWin.c create mode 100644 contrib/gdb/gdb/tui/tuiDataWin.h create mode 100644 contrib/gdb/gdb/tui/tuiDisassem.c create mode 100644 contrib/gdb/gdb/tui/tuiDisassem.h create mode 100644 contrib/gdb/gdb/tui/tuiGeneralWin.c create mode 100644 contrib/gdb/gdb/tui/tuiGeneralWin.h create mode 100644 contrib/gdb/gdb/tui/tuiIO.c create mode 100644 contrib/gdb/gdb/tui/tuiIO.h create mode 100644 contrib/gdb/gdb/tui/tuiLayout.c create mode 100644 contrib/gdb/gdb/tui/tuiLayout.h create mode 100644 contrib/gdb/gdb/tui/tuiRegs.c create mode 100644 contrib/gdb/gdb/tui/tuiRegs.h create mode 100644 contrib/gdb/gdb/tui/tuiSource.c create mode 100644 contrib/gdb/gdb/tui/tuiSource.h create mode 100644 contrib/gdb/gdb/tui/tuiSourceWin.c create mode 100644 contrib/gdb/gdb/tui/tuiSourceWin.h create mode 100644 contrib/gdb/gdb/tui/tuiStack.c create mode 100644 contrib/gdb/gdb/tui/tuiStack.h create mode 100644 contrib/gdb/gdb/tui/tuiWin.c create mode 100644 contrib/gdb/gdb/tui/tuiWin.h create mode 100644 contrib/gdb/gdb/v850-tdep.c (limited to 'contrib/gdb') diff --git a/contrib/gdb/COPYING b/contrib/gdb/COPYING index a43ea21..60549be 100644 --- a/contrib/gdb/COPYING +++ b/contrib/gdb/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + 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. @@ -279,7 +279,7 @@ POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -305,7 +305,8 @@ the "copyright" line and a pointer to where the full notice is found. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Also add information on how to contact you by electronic and paper mail. diff --git a/contrib/gdb/COPYING.LIB b/contrib/gdb/COPYING.LIB index eb685a5..161a3d1 100644 --- a/contrib/gdb/COPYING.LIB +++ b/contrib/gdb/COPYING.LIB @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + 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. @@ -464,7 +464,8 @@ convey the exclusion of warranty; and each file should have at least the You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA Also add information on how to contact you by electronic and paper mail. diff --git a/contrib/gdb/Makefile.in b/contrib/gdb/Makefile.in index 60a8025..6465ee1 100644 --- a/contrib/gdb/Makefile.in +++ b/contrib/gdb/Makefile.in @@ -1,6 +1,7 @@ # # Makefile for directory with subdirs to build. -# Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation +# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 +# Free Software Foundation # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,16 +21,25 @@ srcdir = . prefix = /usr/local - exec_prefix = $(prefix) -bindir = $(exec_prefix)/bin -libdir = $(exec_prefix)/lib + +bindir=${exec_prefix}/bin +sbindir=${exec_prefix}/sbin +libexecdir=${exec_prefix}/libexec +datadir=${prefix}/share +sysconfdir=${prefix}/etc +sharedstatedir=${prefix}/com +localstatedir=${prefix}/var +libdir=${exec_prefix}/lib +includedir=${prefix}/include +oldincludedir=/usr/include +infodir=${prefix}/info +mandir=${prefix}/man + tooldir = $(exec_prefix)/$(target) program_transform_name = -datadir = $(prefix)/lib -mandir = $(prefix)/man man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 man3dir = $(mandir)/man3 @@ -41,15 +51,20 @@ man8dir = $(mandir)/man8 man9dir = $(mandir)/man9 infodir = $(prefix)/info includedir = $(prefix)/include -docdir = $(datadir)/doc +# Directory in which the compiler finds executables, libraries, etc. +libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) GDB_NLM_DEPS = SHELL = /bin/sh -INSTALL = $${srcroot}/install.sh -c -INSTALL_PROGRAM = $(INSTALL) +# INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a +# cygwin host. +INSTALL_PROGRAM_ARGS = + +INSTALL = $(SHELL) $$s/install-sh -c +INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS) +INSTALL_SCRIPT = $(INSTALL) INSTALL_DATA = $(INSTALL) -m 644 -INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' INSTALL_DOSREL = install-dosrel-fake @@ -64,19 +79,22 @@ HOST_CC = $(CC_FOR_BUILD) HOST_PREFIX = HOST_PREFIX_1 = loser- -# We don't specify -g -O because many compilers don't support -g -O, -# and/or -O is broken in and of itself. +# These flag values are normally overridden by the configure script. CFLAGS = -g +CXXFLAGS = -g -O2 + LIBCFLAGS = $(CFLAGS) CFLAGS_FOR_TARGET = $(CFLAGS) +LDFLAGS_FOR_TARGET = LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) PICFLAG = PICFLAG_FOR_TARGET = -CXX = gcc +CHILLFLAGS = $(CFLAGS) +CHILL_LIB = -lchill +CXX = c++ # Use -O2 to stress test the compiler. -CXXFLAGS = -g -O2 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates CXXFLAGS_FOR_TARGET = $(CXXFLAGS) LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates @@ -84,25 +102,43 @@ LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates RANLIB = ranlib DLLTOOL = dlltool +WINDRES = windres NM = nm + +LD = ld + # Not plain GZIP, since gzip looks there for extra command-line options. GZIPPROG = gzip # These values are substituted by configure. DEFAULT_YACC = yacc DEFAULT_LEX = lex +DEFAULT_M4 = m4 + +BISON = `if [ -f $$r/bison/bison ] ; then \ + echo $$r/bison/bison -L $$s/bison/ ; \ + else \ + echo bison ; \ + fi` + +YACC = `if [ -f $$r/bison/bison ] ; then \ + echo $$r/bison/bison -y -L $$s/bison/ ; \ + elif [ -f $$r/byacc/byacc ] ; then \ + echo $$r/byacc/byacc ; \ + else \ + echo ${DEFAULT_YACC} ; \ + fi` -BISON = bison -y LEX = `if [ -f $$r/flex/flex ] ; \ then echo $$r/flex/flex ; \ else echo ${DEFAULT_LEX} ; fi` M4 = `if [ -f $$r/m4/m4 ] ; \ then echo $$r/m4/m4 ; \ - else echo m4 ; fi` + else echo ${DEFAULT_M4} ; fi` -MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ +MAKEINFO = `if [ -f $$r/texinfo/makeinfo/Makefile ] ; \ then echo $$r/texinfo/makeinfo/makeinfo ; \ else echo makeinfo ; fi` @@ -115,8 +151,8 @@ EXPECT = `if [ -f $$r/expect/expect ] ; \ then echo $$r/expect/expect ; \ else echo expect ; fi` -RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \ - then echo $${srcroot}/dejagnu/runtest ; \ +RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \ + then echo $$s/dejagnu/runtest ; \ else echo runtest ; fi` @@ -130,10 +166,13 @@ OTHERS = # This is set by the configure script to the list of directories which # should be built using the target tools. -TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup + + +TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes bsp libstub cygmon # Target libraries are put under this directory: -TARGET_SUBDIR = . # Changed by configure to $(target_alias) if cross. +# Changed by configure to $(target_alias) if cross. +TARGET_SUBDIR = . # This is set by the configure script to the arguments passed to configure. CONFIG_ARGUMENTS = @@ -152,18 +191,31 @@ REALLY_SET_LIB_PATH = \ export $(RPATH_ENVVAR); ALL = all.normal -INSTALL_TARGET = install-dirs \ +INSTALL_TARGET = installdirs \ + install-gcc \ $(INSTALL_MODULES) \ $(INSTALL_TARGET_MODULES) \ $(INSTALL_X11_MODULES) \ - install-gcc \ $(INSTALL_DOSREL) +INSTALL_TARGET_CROSS = installdirs \ + install-gcc-cross \ + $(INSTALL_MODULES) \ + $(INSTALL_TARGET_MODULES) \ + $(INSTALL_X11_MODULES) \ + $(INSTALL_DOSREL) CC_FOR_TARGET = ` \ - if [ -f $$r/gcc/Makefile ] ; then \ + if [ -f $$r/gcc/xgcc ] ; then \ if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \ - echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \ + case "$(target_canonical)" in \ + i[3456]86-*-cygwin*) \ + echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc; \ + ;; \ + *) \ + echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ + ;; \ + esac \ else \ echo $$r/gcc/xgcc -B$$r/gcc/; \ fi; \ @@ -175,11 +227,34 @@ CC_FOR_TARGET = ` \ fi; \ fi` +# If CC_FOR_TARGET is not overriden on the command line, then this +# variable is passed down to the gcc Makefile, where it is used to +# build libgcc2.a. We define it here so that it can itself be +# overridden on the command line. +GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ + +CHILL_FOR_TARGET = ` \ + if [ -f $$r/gcc/xgcc ] ; then \ + echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \ + else \ + if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + echo $(CC); \ + else \ + t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \ + fi; \ + fi` CXX_FOR_TARGET = ` \ - if [ -f $$r/gcc/Makefile ] ; then \ + if [ -f $$r/gcc/xgcc ] ; then \ if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \ - echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \ + case "$(target_canonical)" in \ + i[3456]86-*-cygwin*) \ + echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc; \ + ;; \ + *) \ + echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ + ;; \ + esac \ else \ echo $$r/gcc/xgcc -B$$r/gcc/; \ fi; \ @@ -187,13 +262,13 @@ CXX_FOR_TARGET = ` \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ echo $(CXX); \ else \ - t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \ + t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \ fi; \ fi` AS_FOR_TARGET = ` \ - if [ -f $$r/gas/as.new ] ; then \ - echo $$r/gas/as.new ; \ + if [ -f $$r/gas/as-new ] ; then \ + echo $$r/gas/as-new ; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ echo $(AS); \ @@ -203,8 +278,8 @@ AS_FOR_TARGET = ` \ fi` LD_FOR_TARGET = ` \ - if [ -f $$r/ld/ld.new ] ; then \ - echo $$r/ld/ld.new ; \ + if [ -f $$r/ld/ld-new ] ; then \ + echo $$r/ld/ld-new ; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ echo $(LD); \ @@ -224,6 +299,17 @@ DLLTOOL_FOR_TARGET = ` \ fi; \ fi` +WINDRES_FOR_TARGET = ` \ + if [ -f $$r/binutils/windres ] ; then \ + echo $$r/binutils/windres ; \ + else \ + if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + echo $(WINDRES); \ + else \ + t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \ + fi; \ + fi` + AR_FOR_TARGET = ` \ if [ -f $$r/binutils/ar ] ; then \ echo $$r/binutils/ar ; \ @@ -247,8 +333,8 @@ RANLIB_FOR_TARGET = ` \ fi` NM_FOR_TARGET = ` \ - if [ -f $$r/binutils/nm.new ] ; then \ - echo $$r/binutils/nm.new ; \ + if [ -f $$r/binutils/nm-new ] ; then \ + echo $$r/binutils/nm-new ; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ echo $(NM); \ @@ -257,6 +343,18 @@ NM_FOR_TARGET = ` \ fi; \ fi` +# The first rule in the file had better be this one. Don't put any above it. +# This lives here to allow makefile fragments to contain dependencies. +all: all.normal +.PHONY: all + +# These can be overridden by config/mt-*. +# The _TARGET_ is because they're specified in mt-foo. +# The _HOST_ is because they're programs that run on the host. +EXTRA_TARGET_HOST_ALL_MODULES = +EXTRA_TARGET_HOST_INSTALL_MODULES = +EXTRA_TARGET_HOST_CHECK_MODULES = + #### host and target specific makefile fragments come in here. ### @@ -271,16 +369,18 @@ BASE_FLAGS_TO_PASS = \ "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ "CFLAGS=$(CFLAGS)" \ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "CHILLFLAGS=$(CHILLFLAGS)" \ + "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \ + "CHILL_LIB=$(CHILL_LIB)" \ "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ "CXXFLAGS=$(CXXFLAGS)" \ "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ - "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \ "INSTALL=$(INSTALL)" \ "INSTALL_DATA=$(INSTALL_DATA)" \ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ - "INSTALL_XFORM=$(INSTALL_XFORM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ "LDFLAGS=$(LDFLAGS)" \ "LEX=$(LEX)" \ "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ @@ -289,19 +389,39 @@ BASE_FLAGS_TO_PASS = \ "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ "M4=$(M4)" \ + "MAKE=$(MAKE)" \ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ - "PICFLAG=$(PICFLAG)" \ - "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ + "RPATH_ENVVAR=$(RPATH_ENVVAR)" \ "SHELL=$(SHELL)" \ "EXPECT=$(EXPECT)" \ "RUNTEST=$(RUNTEST)" \ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ - "YACC=$(BISON)" \ + "TARGET_SUBDIR=$(TARGET_SUBDIR)" \ + "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \ + "YACC=$(YACC)" \ + "bindir=$(bindir)" \ + "datadir=$(datadir)" \ "exec_prefix=$(exec_prefix)" \ + "includedir=$(includedir)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "libexecdir=$(libexecdir)" \ + "lispdir=$(lispdir)" \ + "localstatedir=$(localstatedir)" \ + "mandir=$(mandir)" \ + "oldincludedir=$(oldincludedir)" \ "prefix=$(prefix)" \ - "tooldir=$(tooldir)" + "sbindir=$(sbindir)" \ + "sharedstatedir=$(sharedstatedir)" \ + "sysconfdir=$(sysconfdir)" \ + "tooldir=$(tooldir)" \ + "gxx_include_dir=$(gxx_include_dir)" \ + "gcc_version=$(gcc_version)" \ + "gcc_version_trigger=$(gcc_version_trigger)" \ + "target_alias=$(target_alias)" \ + "libsubdir=$(libsubdir)" # Flags to pass down to most sub-makes, in which we're building with # the host environment. @@ -312,9 +432,10 @@ EXTRA_HOST_FLAGS = \ 'CC=$(CC)' \ 'CXX=$(CXX)' \ 'DLLTOOL=$(DLLTOOL)' \ + 'LD=$(LD)' \ 'NM=$(NM)' \ - 'RANLIB=$(RANLIB)' - + 'RANLIB=$(RANLIB)' \ + 'WINDRES=$(WINDRES)' FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) @@ -346,8 +467,8 @@ EXTRA_TARGET_FLAGS = \ 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ 'NM=$$(NM_FOR_TARGET)' \ - 'PICFLAG=$$(PICFLAG_FOR_TARGET)' \ - 'RANLIB=$$(RANLIB_FOR_TARGET)' + 'RANLIB=$$(RANLIB_FOR_TARGET)' \ + 'WINDRES=$$(WINDRES_FOR_TARGET)' TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) @@ -358,7 +479,7 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) # The HOST_* variables are a special case, which are used for the gcc # cross-building scheme. EXTRA_GCC_FLAGS = \ - 'AR=$$(AR_FOR_TARGET)' \ + 'AR=$(AR)' \ 'AS=$(AS)' \ 'CC=$(CC)' \ 'CXX=$(CXX)' \ @@ -367,49 +488,68 @@ EXTRA_GCC_FLAGS = \ 'HOST_PREFIX=$(HOST_PREFIX)' \ 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \ 'NM=$(NM)' \ - 'RANLIB=$$(RANLIB_FOR_TARGET)' \ - `if test x"$(LANGUAGES)" != x; then echo "LANGUAGES=$(LANGUAGES)"; fi` \ - `if test x"$(STMP_FIXPROTO)" != x; then echo "STMP_FIXPROTO=$(STMP_FIXPROTO)"; fi` \ - `if test x"$(LIMITS_H_TEST)" != x; then echo "LIMITS_H_TEST=$(LIMITS_H_TEST)"; fi` \ - `if test x"$(LIBGCC1_TEST)" != x; then echo "LIBGCC1_TEST=$(LIBGCC1_TEST)"; fi` \ - `if test x"$(LIBGCC2_CFLAGS)" != x; then echo "LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)"; fi` \ - `if test x"$(LIBGCC2_INCLUDES)" != x; then echo "LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)"; fi` \ - `if test x"$(ENQUIRE)" != x; then echo "ENQUIRE=$(ENQUIRE)"; fi` \ - `if test x"$(BOOT_CFLAGS)" != x; then echo "BOOT_CFLAGS=$(BOOT_CFLAGS)"; fi` + 'RANLIB=$(RANLIB)' \ + 'WINDRES=$$(WINDRES_FOR_TARGET)' \ + "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ + "`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 'LIBGCC1_TEST=$(LIBGCC1_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 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) # This is a list of the targets for all of the modules which are compiled # using $(FLAGS_TO_PASS). ALL_MODULES = \ + all-apache \ + all-ash \ all-autoconf \ + all-automake \ + all-bash \ all-bfd \ all-binutils \ + all-bison \ all-byacc \ - all-cvs \ + all-bzip2 \ + all-cvssrc \ + all-db \ all-dejagnu \ all-diff \ all-dosutils \ all-etc \ all-fileutils \ + all-findutils \ all-find \ all-flex \ all-gas \ all-gawk \ + all-gettext \ + all-gnuserv \ all-gprof \ all-grep \ all-grez \ all-gzip \ all-hello \ all-indent \ + all-inet \ + all-intl \ all-ispell \ + all-itcl \ all-ld \ + all-libgui \ all-libiberty \ + all-libtool \ all-m4 \ all-make \ all-mmalloc \ all-opcodes \ all-patch \ + all-perl \ all-prms \ all-rcs \ all-readline \ @@ -421,50 +561,68 @@ ALL_MODULES = \ all-sim \ all-tar \ all-tcl \ + all-tcl8.1 \ all-texinfo \ all-textutils \ all-tgas \ all-time \ all-uudecode \ - all-wdiff + all-wdiff \ + all-zip \ + $(EXTRA_TARGET_HOST_ALL_MODULES) # This is a list of the check targets for all of the modules which are # compiled using $(FLAGS_TO_PASS). -# This is a list of the check targets for all of the modules which are -# compiled using $(FLAGS_TO_PASS). # # The list is in two parts. The first lists those tools which # are tested as part of the host's native tool-chain, and not # tested in a cross configuration. NATIVE_CHECK_MODULES = \ + check-bison \ check-byacc \ - check-flex + check-flex \ + check-zip CROSS_CHECK_MODULES = \ + check-apache \ + check-ash \ check-autoconf \ + check-automake \ + check-bash \ check-bfd \ check-binutils \ - check-cvs \ + check-bzip2 \ + check-cvssrc \ + check-db \ check-dejagnu \ check-diff \ check-etc \ check-fileutils \ + check-findutils \ check-find \ check-gas \ check-gawk \ + check-gettext \ + check-gnuserv \ check-gprof \ check-grep \ check-gzip \ check-hello \ check-indent \ + check-inet \ + check-intl \ check-ispell \ + check-itcl \ check-ld \ + check-libgui \ check-libiberty \ + check-libtool \ check-m4 \ check-make \ check-mmcheckoc \ check-opcodes \ check-patch \ + check-perl \ check-prms \ check-rcs \ check-readline \ @@ -480,41 +638,65 @@ CROSS_CHECK_MODULES = \ check-tgas \ check-time \ check-uudecode \ - check-wdiff + check-wdiff \ + $(EXTRA_TARGET_HOST_CHECK_MODULES) CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES) # This is a list of the install targets for all of the modules which are # compiled using $(FLAGS_TO_PASS). +# We put install-opcodes before install-binutils because the installed +# binutils might be on PATH, and they might need the shared opcodes +# library. +# We put install-tcl before install-itcl because itcl wants to run a +# program on installation which uses the Tcl libraries. INSTALL_MODULES = \ + install-apache \ + install-ash \ install-autoconf \ + install-automake \ + install-bash \ install-bfd \ + install-bzip2 \ + install-opcodes \ install-binutils \ + install-bison \ install-byacc \ - install-cvs \ + install-cvssrc \ + install-db \ install-dejagnu \ install-diff \ install-dosutils \ install-etc \ install-fileutils \ + install-findutils \ install-find \ install-flex \ install-gas \ install-gawk \ + install-gettext \ + install-gnuserv \ install-gprof \ install-grep \ install-grez \ install-gzip \ install-hello \ install-indent \ + install-inet \ + install-intl \ install-ispell \ + install-tcl \ + install-tcl8.1 \ + install-itcl \ install-ld \ + install-libgui \ install-libiberty \ + install-libtool \ install-m4 \ install-make \ install-mmalloc \ - install-opcodes \ install-patch \ + install-perl \ install-prms \ install-rcs \ install-readline \ @@ -524,12 +706,13 @@ INSTALL_MODULES = \ install-shellutils \ install-sim \ install-tar \ - install-tcl \ install-textutils \ install-tgas \ install-time \ install-uudecode \ - install-wdiff + install-wdiff \ + install-zip \ + $(EXTRA_TARGET_HOST_INSTALL_MODULES) # This is a list of the targets for all of the modules which are compiled # using $(X11_FLAGS_TO_PASS). @@ -539,18 +722,23 @@ ALL_X11_MODULES = \ all-gdb \ all-expect \ all-gash \ + all-guile \ all-tclX \ - all-tk + all-tk \ + all-tk8.1 \ + all-tix # This is a list of the check targets for all of the modules which are # compiled using $(X11_FLAGS_TO_PASS). CHECK_X11_MODULES = \ check-emacs \ check-gdb \ + check-guile \ check-expect \ check-gash \ check-tclX \ - check-tk + check-tk \ + check-tix # This is a list of the install targets for all the modules which are # compiled using $(X11_FLAGS_TO_PASS). @@ -558,10 +746,13 @@ INSTALL_X11_MODULES = \ install-emacs \ install-emacs19 \ install-gdb \ + install-guile \ install-expect \ install-gash \ install-tclX \ - install-tk + install-tk \ + install-tk8.1 \ + install-tix # This is a list of the targets for all of the modules which are compiled # using $(TARGET_FLAGS_TO_PASS). @@ -571,10 +762,15 @@ ALL_TARGET_MODULES = \ all-target-librx \ all-target-libg++ \ all-target-newlib \ + all-target-libtermcap \ all-target-winsup \ all-target-libgloss \ all-target-libiberty \ - all-target-examples + all-target-gperf \ + all-target-examples \ + all-target-libstub \ + all-target-bsp \ + all-target-cygmon # This is a list of the configure targets for all of the modules which # are compiled using the target tools. @@ -584,10 +780,15 @@ CONFIGURE_TARGET_MODULES = \ configure-target-librx \ configure-target-libg++ \ configure-target-newlib \ + configure-target-libtermcap \ configure-target-winsup \ configure-target-libgloss \ configure-target-libiberty \ - configure-target-examples + configure-target-gperf \ + configure-target-examples \ + configure-target-libstub \ + configure-target-bsp \ + configure-target-cygmon # This is a list of the check targets for all of the modules which are # compiled using $(TARGET_FLAGS_TO_PASS). @@ -597,7 +798,8 @@ CHECK_TARGET_MODULES = \ check-target-libg++ \ check-target-newlib \ check-target-winsup \ - check-target-libiberty + check-target-libiberty \ + check-target-gperf # This is a list of the install targets for all of the modules which are # compiled using $(TARGET_FLAGS_TO_PASS). @@ -606,20 +808,112 @@ INSTALL_TARGET_MODULES = \ install-target-libstdc++ \ install-target-libg++ \ install-target-newlib \ + install-target-libtermcap \ install-target-winsup \ install-target-libgloss \ - install-target-libiberty - -# The first rule in the file had better be this one. Don't put any above it. -all: all.normal -.PHONY: all + install-target-libiberty \ + install-target-bsp \ + install-target-gperf + +# This is a list of the targets for which we can do a clean-{target}. +CLEAN_MODULES = \ + clean-apache \ + clean-ash \ + clean-autoconf \ + clean-automake \ + clean-bash \ + clean-bfd \ + clean-binutils \ + clean-bison \ + clean-byacc \ + clean-bzip2 \ + clean-cvssrc \ + clean-db \ + clean-dejagnu \ + clean-diff \ + clean-dosutils \ + clean-etc \ + clean-fileutils \ + clean-findutils \ + clean-find \ + clean-flex \ + clean-gas \ + clean-gawk \ + clean-gettext \ + clean-gnuserv \ + clean-gprof \ + clean-grep \ + clean-grez \ + clean-gzip \ + clean-hello \ + clean-indent \ + clean-inet \ + clean-intl \ + clean-ispell \ + clean-itcl \ + clean-ld \ + clean-libgui \ + clean-libiberty \ + clean-libtool \ + clean-m4 \ + clean-make \ + clean-mmalloc \ + clean-opcodes \ + clean-patch \ + clean-perl \ + clean-prms \ + clean-rcs \ + clean-readline \ + clean-release \ + clean-recode \ + clean-sed \ + clean-send-pr \ + clean-shellutils \ + clean-sim \ + clean-tar \ + clean-tcl \ + clean-texinfo \ + clean-textutils \ + clean-tgas \ + clean-time \ + clean-uudecode \ + clean-wdiff \ + clean-zip + +# All of the target modules that can be cleaned +CLEAN_TARGET_MODULES = \ + clean-target-libio \ + clean-target-libstdc++ \ + clean-target-librx \ + clean-target-libg++ \ + clean-target-newlib \ + clean-target-winsup \ + clean-target-libgloss \ + clean-target-libiberty \ + clean-target-gperf \ + clean-target-examples \ + clean-target-libstub \ + clean-target-bsp \ + clean-target-cygmon + +# All of the x11 modules that can be cleaned +CLEAN_X11_MODULES = \ + clean-emacs \ + clean-emacs19 \ + clean-gdb \ + clean-expect \ + clean-gash \ + clean-guile \ + clean-tclX \ + clean-tk \ + clean-tix # The target built for a native build. .PHONY: all.normal all.normal: \ $(ALL_MODULES) \ - $(ALL_TARGET_MODULES) \ $(ALL_X11_MODULES) \ + $(ALL_TARGET_MODULES) \ all-gcc # Do a target for all the subdirectories. A ``make do-X'' will do a @@ -643,7 +937,7 @@ DO_X = \ $(DO_X): @target=`echo $@ | sed -e 's/^do-//'`; \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ for i in $(SUBDIRS) -dummy-; do \ if [ -f ./$$i/Makefile ]; then \ @@ -659,31 +953,31 @@ $(DO_X): done; \ ;; \ esac ; \ - export AR AS CC CXX NM RANLIB DLLTOOL; \ + export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \ if (cd ./$$i; \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ $${target}); \ then true; else exit 1; fi; \ else true; fi; \ done @target=`echo $@ | sed -e 's/^do-//'`; \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ for i in $(TARGET_CONFIGDIRS) -dummy-; do \ if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ for flag in $(EXTRA_TARGET_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \ done; \ - export AR AS CC CXX NM RANLIB DLLTOOL; \ + export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \ if (cd $(TARGET_SUBDIR)/$$i; \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ $${target}); \ then true; else exit 1; fi; \ else true; fi; \ @@ -698,17 +992,20 @@ info: do-info installcheck: do-installcheck dvi: do-dvi +# Make sure makeinfo is built before we do a `make info'. +do-info: all-texinfo + install-info: do-install-info dir.info - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ if [ -f dir.info ] ; then \ $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \ else true ; fi local-clean: - -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E + -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log local-distclean: - -rm -f Makefile config.status + -rm -f Makefile config.status config.cache mh-frag mt-frag -if [ "$(TARGET_SUBDIR)" != "." ]; then \ rm -rf $(TARGET_SUBDIR); \ else true; fi @@ -724,6 +1021,34 @@ maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean maintainer-clean: local-distclean realclean: maintainer-clean +# This rule is used to clean specific modules. +.PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc +$(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc: + @dir=`echo $@ | sed -e 's/clean-//'`; \ + if [ -f ./$${dir}/Makefile ] ; then \ + r=`pwd`; export r; \ + s=`cd $(srcdir); pwd`; export s; \ + $(SET_LIB_PATH) \ + (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \ + else \ + true; \ + fi + +.PHONY: $(CLEAN_TARGET_MODULES) +$(CLEAN_TARGET_MODULES): + @dir=`echo $@ | sed -e 's/clean-target-//'`; \ + rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \ + if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ + r=`pwd`; export r; \ + s=`cd $(srcdir); pwd`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \ + else \ + true; \ + fi + +clean-target: $(CLEAN_TARGET_MODULES) + # Check target. .PHONY: check @@ -732,10 +1057,32 @@ check: $(CHECK_MODULES) \ $(CHECK_X11_MODULES) \ check-gcc +# Automated reporting of test results. + +warning.log: build.log + $(srcdir)/contrib/warn_summary build.log > $@ + +mail-report.log: + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + +mail-report-with-warnings.log: warning.log + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t -i warning.log >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + # Installation targets. -.PHONY: install uninstall source-vault binary-vault vault-install +.PHONY: install install-cross uninstall source-vault binary-vault vault-install install: $(INSTALL_TARGET) +install-cross: $(INSTALL_TARGET_CROSS) uninstall: @echo "the uninstall target is not supported in this tree" @@ -766,11 +1113,16 @@ install.all: install-no-fixedincludes true ; \ fi +# inet-install is used because the I*Net wants DejaGNU installed but +# not built. Similarly, gzip is built but not installed. +inet-install: + $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install + # install-no-fixedincludes is used because Cygnus can not distribute # the fixed header files. .PHONY: install-no-fixedincludes install-no-fixedincludes: \ - install-dirs \ + installdirs \ $(INSTALL_MODULES) \ $(INSTALL_TARGET_MODULES) \ $(INSTALL_X11_MODULES) \ @@ -789,7 +1141,7 @@ gcc-no-fixedincludes: touch gcc/stmp-fixinc gcc/include/fixed; \ rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd` ; export srcroot; \ + s=`cd $(srcdir); pwd` ; export s; \ $(SET_LIB_PATH) \ (cd ./gcc; \ $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ @@ -797,6 +1149,7 @@ gcc-no-fixedincludes: mv gcc/tmp-include gcc/include 2>/dev/null; \ else true; fi + # This rule is used to build the modules which use FLAGS_TO_PASS. To # build a target all-X means to cd to X and make all. # @@ -808,7 +1161,7 @@ $(ALL_MODULES) all-gui all-libproc: @dir=`echo $@ | sed -e 's/all-//'`; \ if [ -f ./$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \ else \ @@ -825,7 +1178,7 @@ $(NATIVE_CHECK_MODULES): dir=`echo $@ | sed -e 's/check-//'`; \ if [ -f ./$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \ else \ @@ -837,7 +1190,7 @@ $(CROSS_CHECK_MODULES): @dir=`echo $@ | sed -e 's/check-//'`; \ if [ -f ./$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \ else \ @@ -847,11 +1200,11 @@ $(CROSS_CHECK_MODULES): # This rule is used to install the modules which use FLAGS_TO_PASS. # To build a target install-X means to cd to X and make install. .PHONY: $(INSTALL_MODULES) -$(INSTALL_MODULES): install-dirs +$(INSTALL_MODULES): installdirs @dir=`echo $@ | sed -e 's/install-//'`; \ if [ -f ./$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \ else \ @@ -863,13 +1216,33 @@ $(INSTALL_MODULES): install-dirs .PHONY: $(CONFIGURE_TARGET_MODULES) $(CONFIGURE_TARGET_MODULES): @dir=`echo $@ | sed -e 's/configure-target-//'`; \ - if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ + if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \ + r=`pwd`; export r; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \ + if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \ + if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \ + if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \ + rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \ + else \ + echo "Multilibs changed for $${dir}, reconfiguring"; \ + rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \ + mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \ + fi; \ + fi; \ + fi; exit 0 # break command into two pieces + @dir=`echo $@ | sed -e 's/configure-target-//'`; \ + if [ ! -d $(TARGET_SUBDIR) ]; then \ + true; \ + elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ true; \ elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \ if [ -d $(srcdir)/$${dir} ]; then \ [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ AR="$(AR_FOR_TARGET)"; export AR; \ AS="$(AS_FOR_TARGET)"; export AS; \ @@ -879,8 +1252,10 @@ $(CONFIGURE_TARGET_MODULES): CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ NM="$(NM_FOR_TARGET)"; export NM; \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ echo Configuring in $(TARGET_SUBDIR)/$${dir}; \ cd $(TARGET_SUBDIR)/$${dir}; \ case $(srcdir) in \ @@ -894,7 +1269,7 @@ $(CONFIGURE_TARGET_MODULES): esac; \ if [ "$(srcdir)" = "." ] ; then \ if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $${srcroot}/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \ if [ -f Makefile ]; then \ if $(MAKE) distclean; then \ true; \ @@ -914,17 +1289,26 @@ $(CONFIGURE_TARGET_MODULES): libsrcdir="."; \ else \ srcdiroption="--srcdir=$${topdir}/$${dir}"; \ - libsrcdir="$${srcroot}/$${dir}"; \ + libsrcdir="$$s/$${dir}"; \ fi; \ if [ -f $${libsrcdir}/configure ] ; then \ - $(SHELL) $${libsrcdir}/configure \ + rm -f no-such-file skip-this-dir; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ $(CONFIG_ARGUMENTS) $${srcdiroption} \ --with-target-subdir="$(TARGET_SUBDIR)"; \ else \ - $(SHELL) $${srcroot}/configure \ + rm -f no-such-file skip-this-dir; \ + CONFIG_SITE=no-such-file $(SHELL) $$s/configure \ $(CONFIG_ARGUMENTS) $${srcdiroption} \ --with-target-subdir="$(TARGET_SUBDIR)"; \ fi; \ + if [ -f skip-this-dir ] ; then \ + sh skip-this-dir; \ + rm -f skip-this-dir; \ + cd ..; rmdir $${dir} || true; \ + else \ + true; \ + fi; \ else \ true; \ fi; \ @@ -939,7 +1323,7 @@ $(ALL_TARGET_MODULES): @dir=`echo $@ | sed -e 's/all-target-//'`; \ if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \ else \ @@ -953,7 +1337,7 @@ $(CHECK_TARGET_MODULES): @dir=`echo $@ | sed -e 's/check-target-//'`; \ if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\ else \ @@ -964,11 +1348,11 @@ $(CHECK_TARGET_MODULES): # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X # and make install. .PHONY: $(INSTALL_TARGET_MODULES) -$(INSTALL_TARGET_MODULES): install-dirs +$(INSTALL_TARGET_MODULES): installdirs @dir=`echo $@ | sed -e 's/install-target-//'`; \ if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $(TARGET_SUBDIR)/$${dir}; \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \ @@ -983,7 +1367,7 @@ $(ALL_X11_MODULES): @dir=`echo $@ | sed -e 's/all-//'`; \ if [ -f ./$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $${dir}; \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \ @@ -998,7 +1382,7 @@ $(CHECK_X11_MODULES): @dir=`echo $@ | sed -e 's/check-//'`; \ if [ -f ./$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $${dir}; \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \ @@ -1009,11 +1393,11 @@ $(CHECK_X11_MODULES): # This rule is used to install the modules which use X11_FLAGS_TO_PASS. # To build a target install-X means to cd to X and make install. .PHONY: $(INSTALL_X11_MODULES) -$(INSTALL_X11_MODULES): +$(INSTALL_X11_MODULES): installdirs @dir=`echo $@ | sed -e 's/install-//'`; \ if [ -f ./$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $${dir}; \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \ @@ -1026,29 +1410,70 @@ $(INSTALL_X11_MODULES): all-gcc: @if [ -f ./gcc/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ else \ true; \ fi -.PHONY: all-bootstrap -all-bootstrap: - @if [ -f ./gcc/Makefile ] ; then \ - r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ - $(SET_LIB_PATH) \ - (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \ - else \ - true; \ - fi +# Building GCC uses some tools for rebuilding "source" files +# like texinfo, bison/byacc, etc. So we must depend on those. +# +# While building GCC, it may be necessary to run various target +# programs like the assembler, linker, etc. So we depend on +# those too. +# +# In theory, on an SMP all those dependencies can be resolved +# in parallel. +# +.PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean +bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-texinfo all-bison all-byacc all-binutils all-gas all-ld + @r=`pwd`; export r; \ + s=`cd $(srcdir); pwd`; export s; \ + $(SET_LIB_PATH) \ + echo "Bootstrapping the compiler"; \ + cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@ + @r=`pwd`; export r; \ + s=`cd $(srcdir); pwd`; export s; \ + case "$@" in \ + *bootstrap4-lean ) \ + msg="Comparing stage3 and stage4 of the compiler"; \ + compare=compare3-lean ;; \ + *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \ + compare=compare3 ;; \ + *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \ + compare=compare-lean ;; \ + * ) msg="Comparing stage2 and stage3 of the compiler"; \ + compare=compare ;; \ + esac; \ + $(SET_LIB_PATH) \ + echo "$$msg"; \ + cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare + @r=`pwd`; export r; \ + s=`cd $(srcdir); pwd` ; export s; \ + $(SET_LIB_PATH) \ + echo "Building runtime libraries"; \ + $(MAKE) $(BASE_FLAGS_TO_PASS) all + +.PHONY: cross +cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld + @r=`pwd`; export r; \ + s=`cd $(srcdir); pwd`; export s; \ + $(SET_LIB_PATH) \ + echo "Building the C and C++ compiler"; \ + cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" + @r=`pwd`; export r; \ + s=`cd $(srcdir); pwd` ; export s; \ + $(SET_LIB_PATH) \ + echo "Building runtime libraries"; \ + $(MAKE) $(BASE_FLAGS_TO_PASS) all LANGUAGES="c c++" .PHONY: check-gcc check-gcc: @if [ -f ./gcc/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ else \ @@ -1059,23 +1484,32 @@ check-gcc: install-gcc: @if [ -f ./gcc/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ else \ true; \ fi - +.PHONY: install-gcc-cross +install-gcc-cross: + @if [ -f ./gcc/Makefile ] ; then \ + r=`pwd`; export r; \ + s=`cd $(srcdir); pwd`; export s; \ + $(SET_LIB_PATH) \ + (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \ + else \ + true; \ + fi # EXPERIMENTAL STUFF # This rule is used to install the modules which use FLAGS_TO_PASS. # To build a target install-X means to cd to X and make install. .PHONY: install-dosrel -install-dosrel: install-dirs info +install-dosrel: installdirs info @dir=`echo $@ | sed -e 's/install-//'`; \ if [ -f ./$${dir}/Makefile ] ; then \ r=`pwd`; export r; \ - srcroot=`cd $(srcdir); pwd`; export srcroot; \ + s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \ else \ @@ -1086,57 +1520,84 @@ install-dosrel-fake: # This is a list of inter-dependencies among modules. -all-autoconf: all-m4 -all-bfd: -all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc +all-apache: +all-ash: +all-autoconf: all-m4 all-texinfo +all-automake: all-m4 all-texinfo +all-bash: +all-bfd: all-libiberty all-intl +all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl +all-bison: all-texinfo +configure-target-bsp: $(ALL_GCC) +all-target-bsp: configure-target-bsp all-gas all-ld all-gcc all-byacc: -all-cvs: +all-bzip2: +all-cvssrc: +configure-target-cygmon: $(ALL_GCC) +all-target-cygmon: configure-target-cygmon all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-libstub +all-db: all-dejagnu: all-tcl all-expect all-tk all-diff: all-libiberty all-emacs: -all-emacs19: all-byacc +all-emacs19: all-bison all-byacc all-etc: configure-target-examples: $(ALL_GCC) all-target-examples: configure-target-examples all-expect: all-tcl all-tk all-fileutils: all-libiberty +all-findutils: all-find: -all-flex: all-libiberty all-byacc -all-gas: all-libiberty all-opcodes all-bfd +all-flex: all-libiberty all-bison all-byacc +all-gas: all-libiberty all-opcodes all-bfd all-intl all-gash: all-tcl all-gawk: ALL_GCC = all-gcc -all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld -all-bootstrap: all-libiberty all-byacc all-binutils all-gas all-ld -GDB_TK = all-tk all-tcl -all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK) -all-gprof: all-libiberty all-bfd all-opcodes -all-grep: all-libiberty +all-gcc: all-bison all-byacc all-binutils all-gas all-ld +all-bootstrap: all-libiberty all-bison all-byacc all-binutils all-gas all-ld +GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui +all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK) +all-gettext: +all-gnuserv: +configure-target-gperf: $(ALL_GCC) +all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++ +all-gprof: all-libiberty all-bfd all-opcodes all-intl all-grez: all-libiberty all-bfd all-opcodes all-gui: all-gdb all-libproc all-target-librx +all-guile: all-gzip: all-libiberty all-hello: all-libiberty all-indent: +all-inet: all-tcl all-send-pr all-perl +all-intl: all-ispell: all-emacs19 -all-ld: all-libiberty all-bfd all-opcodes all-byacc all-flex +all-itcl: all-tcl all-tk all-tcl8.1 all-tk8.1 +all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl configure-target-libg++: $(ALL_GCC) configure-target-librx all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++ configure-target-libgloss: $(ALL_GCC) all-target-libgloss: configure-target-libgloss configure-target-newlib configure-target-libio: $(ALL_GCC) all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib +check-target-libio: all-target-libstdc++ +all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl all-libiberty: configure-target-librx: $(ALL_GCC) configure-target-newlib all-target-librx: configure-target-librx configure-target-libstdc++: $(ALL_GCC) all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio +configure-target-libstub: $(ALL_GCC) +all-target-libstub: configure-target-libstub +all-libtool: all-m4: all-libiberty all-make: all-libiberty all-mmalloc: configure-target-newlib: $(ALL_GCC) +configure-target-libtermcap: $(ALL_GCC) all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc +all-target-libtermcap: configure-target-libtermcap all-binutils all-gas all-gcc all-opcodes: all-bfd all-libiberty all-patch: all-libiberty +all-perl: all-prms: all-libiberty all-rcs: all-readline: @@ -1144,46 +1605,35 @@ all-recode: all-libiberty all-sed: all-libiberty all-send-pr: all-prms all-shellutils: -all-sim: all-libiberty all-bfd all-opcodes +all-sim: all-libiberty all-bfd all-opcodes all-readline all-tar: all-libiberty all-tcl: +all-tcl8.1: all-tclX: all-tcl all-tk all-tk: all-tcl +all-tk8.1: all-tcl8.1 all-texinfo: all-libiberty all-textutils: all-tgas: all-libiberty all-bfd all-opcodes all-time: +all-tix: all-tcl all-tk all-tcl8.1 all-tk8.1 all-wdiff: -all-target-winsup: all-target-newlib all-target-libiberty configure-target-winsup +all-target-winsup: all-target-newlib all-target-libiberty all-target-libtermcap configure-target-winsup configure-target-winsup: configure-target-newlib all-uudecode: all-libiberty +all-zip: configure-target-libiberty: $(ALL_GCC) all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib - +all-target: $(ALL_TARGET_MODULES) +install-target: $(INSTALL_TARGET_MODULES) ### other supporting targets MAKEDIRS= \ $(prefix) \ - $(exec_prefix) \ - $(tooldir) - -.PHONY: install-dirs -install-dirs: - @for i in $(MAKEDIRS) ; do \ - echo Making $$i... ; \ - parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \ - if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \ - if [ ! -d $$i ] ; then \ - if mkdir $$i ; then \ - true ; \ - else \ - exit 1 ; \ - fi ; \ - else \ - true ; \ - fi ; \ - done - + $(exec_prefix) +.PHONY: installdirs +installdirs: mkinstalldirs + $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) dir.info: do-install-info if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ @@ -1208,7 +1658,7 @@ TAGS: do-TAGS # with the gnu make, this is done automatically. -Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) +Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger) $(SHELL) ./config.status # @@ -1218,39 +1668,28 @@ Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) # ChangeLog omitted because it may refer to files which are not in this # distribution (perhaps it would be better to include it anyway). DEVO_SUPPORT= README Makefile.in configure configure.in \ - config.guess config.sub config move-if-change \ - mpw-README mpw-build.in mpw-config.in mpw-configure \ - COPYING COPYING.LIB install.sh config-ml.in symlink-tree + config.guess config.if config.sub config move-if-change \ + mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \ + COPYING COPYING.LIB install-sh config-ml.in symlink-tree \ + mkinstalldirs ltconfig ltmain.sh missing ylwrap # Files in devo/etc used in any net release. # ChangeLog omitted because it may refer to files which are not in this # distribution (perhaps it would be better to include it anyway). -ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \ - configure.texi standards.texi make-stds.texi \ - configure.info* standards.info* cfg-paper.info* +ETC_SUPPORT= Makefile.in configure configure.in standards.texi \ + make-stds.texi standards.info* # When you use `make setup-dirs' or `make taz' you should always redefine # this macro. SUPPORT_FILES = list-of-support-files-for-tool-in-question -# Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF). -DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in .PHONY: taz taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \ texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo - # Make sure "diststuff" files get built properly. - for f in $(DISTBISONFILES) ; do \ - if [ -r $$f ]; then \ - sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \ - mv -f tmp $$f ; \ - else true; fi ; \ - done - # Take out texinfo from a few places; make simple BISON=bison line. + # Take out texinfo from a few places. sed -e '/^all\.normal: /s/\all-texinfo //' \ -e '/^ install-texinfo /d' \ - -e '/^BISON = /,/^$$/d' \ - -e '/^# BISON:/s/.*/BISON = bison -y/' \ tmp mv -f tmp Makefile.in # @@ -1291,29 +1730,40 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \ proto-toplev/configure.in # mkdir proto-toplev/texinfo - ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/ - ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/ - ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/ - ln -s ../../texinfo/tex3patch proto-toplev/texinfo/ - chmod og=u `find . -print` - (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \ - echo "==> Making $(TOOL)-$$VER.tar.gz"; \ - rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \ - tar cfh - $(TOOL)-$$VER \ - | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz ) + ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/ + ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/ + ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/ + if test -r texinfo/util/tex3patch ; then \ + mkdir proto-toplev/texinfo/util && \ + ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \ + else true; fi + chmod -R og=u . || chmod og=u `find . -print` + if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \ + ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \ + else \ + ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \ + fi; \ + $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver + +do-tar-gz: + echo "==> Making $(TOOL)-$(VER).tar.gz" + -rm -f $(TOOL)-$(VER) + ln -s proto-toplev $(TOOL)-$(VER) + tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER) + $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) .PHONY: gas.tar.gz -GAS_SUPPORT_DIRS= bfd include libiberty opcodes +GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas $(MAKE) -f Makefile.in taz TOOL=gas \ SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" # The FSF "binutils" release includes gprof and ld. .PHONY: binutils.tar.gz -BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof +BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils $(MAKE) -f Makefile.in taz TOOL=binutils \ SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat" @@ -1336,7 +1786,7 @@ gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)" .PHONY: gdb.tar.gz -GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils +GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb $(MAKE) -f Makefile.in taz TOOL=gdb \ SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" @@ -1362,5 +1812,4 @@ newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib .NOEXPORT: MAKEOVERRIDES= - # end of Makefile.in diff --git a/contrib/gdb/README b/contrib/gdb/README index 7ec34b1..eb0e436 100644 --- a/contrib/gdb/README +++ b/contrib/gdb/README @@ -4,7 +4,7 @@ This directory contains various GNU compilers, assemblers, linkers, debuggers, etc., plus their support routines, definitions, and documentation. If you are receiving this as part of a GDB release, see the file gdb/README. -If with a gas release, see gas/README; if with a libg++ release, +If with a binutils release, see binutils/README; if with a libg++ release, see libg++/README, etc. That'll give you info about this package -- supported targets, how to use it, how to report bugs, etc. @@ -19,7 +19,7 @@ To install them (by default in /usr/local/bin, /usr/local/lib, etc), then do: make install -If the configure script can't determine your type of computer, give it +(If the configure script can't determine your type of computer, give it the name as an argument, for instance ``./configure sun4''. You can use the script ``config.sub'' to test whether a name is recognized; if it is, config.sub translates it to a triplet specifying CPU, vendor, @@ -30,21 +30,18 @@ explicitly set CC in the environment before running configure, and to also set CC when running make. For example (assuming sh/bash/ksh): CC=gcc ./configure - make CC=gcc + make A similar example using csh: setenv CC gcc ./configure - make CC=gcc - -See etc/cfg-paper.texi, etc/configure.texi, and/or the README files in -various subdirectories, for more details. + make Much of the code and documentation enclosed is copyright by the Free Software Foundation, Inc. See the file COPYING or COPYING.LIB in the various directories, for a description of the GNU General Public License terms under which you can copy the files. -REPORTING BUGS: Again, see gdb/README, gas/README, etc., for info on where and -how to report problems. +REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info +on where and how to report problems. diff --git a/contrib/gdb/config-ml.in b/contrib/gdb/config-ml.in new file mode 100644 index 0000000..3a159cf --- /dev/null +++ b/contrib/gdb/config-ml.in @@ -0,0 +1,624 @@ +# Configure fragment invoked in the post-target section for subdirs +# wanting multilib support. +# +# It is advisable to support a few --enable/--disable options to let the +# user select which libraries s/he really wants. +# +# Subdirectories wishing to use multilib should put the following lines +# in the "post-target" section of configure.in. +# +# if [ "${srcdir}" = "." ] ; then +# if [ "${with_target_subdir}" != "." ] ; then +# . ${with_multisrctop}../../config-ml.in +# else +# . ${with_multisrctop}../config-ml.in +# fi +# else +# . ${srcdir}/../config-ml.in +# fi +# +# See librx/configure.in in the libg++ distribution for an example of how +# to handle autoconf'd libraries. +# +# Things are complicated because 6 separate cases must be handled: +# 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6. +# +# srcdir=. is special. It must handle make programs that don't handle VPATH. +# To implement this, a symlink tree is built for each library and for each +# multilib subdir. +# +# The build tree is layed out as +# +# ./ +# libg++ +# newlib +# m68020/ +# libg++ +# newlib +# m68881/ +# libg++ +# newlib +# +# The nice feature about this arrangement is that inter-library references +# in the build tree work without having to care where you are. Note that +# inter-library references also work in the source tree because symlink trees +# are built when srcdir=. +# +# Unfortunately, trying to access the libraries in the build tree requires +# the user to manually choose which library to use as GCC won't be able to +# find the right one. This is viewed as the lesser of two evils. +# +# Configure variables: +# ${with_target_subdir} = "." for native, or ${target_alias} for cross. +# Set by top level Makefile. +# ${with_multisrctop} = how many levels of multilibs there are in the source +# tree. It exists to handle the case of configuring in the source tree: +# ${srcdir} is not constant. +# ${with_multisubdir} = name of multilib subdirectory (eg: m68020/m68881). +# +# Makefile variables: +# MULTISRCTOP = number of multilib levels in source tree (+1 if cross) +# (FIXME: note that this is different than ${with_multisrctop}. Check out.). +# MULTIBUILDTOP = number of multilib levels in build tree +# MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...) +# (only defined in each library's main Makefile). +# MULTISUBDIR = installed subdirectory name with leading '/' (eg: /m68000) +# (only defined in each multilib subdir). + +# FIXME: Multilib is currently disabled by default for everything other than +# newlib. It is up to each target to turn on multilib support for the other +# libraries as desired. + +# We have to handle being invoked by both Cygnus configure and Autoconf. +# +# Cygnus configure incoming variables: +# srcdir, subdir, target, arguments +# +# Autoconf incoming variables: +# srcdir, target, ac_configure_args +# +# We *could* figure srcdir and target out, but we'd have to do work that +# our caller has already done to figure them out and requiring these two +# seems reasonable. + +if [ -n "${ac_configure_args}" ]; then + Makefile=${ac_file-Makefile} + ml_config_shell=${CONFIG_SHELL-/bin/sh} + ml_arguments="${ac_configure_args}" + ml_realsrcdir=${srcdir} +else + Makefile=${Makefile-Makefile} + ml_config_shell=${config_shell-/bin/sh} + ml_arguments="${arguments}" + if [ -n "${subdir}" -a "${subdir}" != "." ] ; then + ml_realsrcdir=${srcdir}/${subdir} + else + ml_realsrcdir=${srcdir} + fi +fi + +# Scan all the arguments and set all the ones we need. + +ml_verbose=--verbose +for option in ${ml_arguments} +do + case $option in + --*) ;; + -*) option=-$option ;; + esac + + case $option in + --*=*) + optarg=`echo $option | sed -e 's/^[^=]*=//'` + ;; + esac + + case $option in + --disable-*) + enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'` + eval $enableopt=no + ;; + --enable-*) + case "$option" in + *=*) ;; + *) optarg=yes ;; + esac + enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` + eval $enableopt="$optarg" + ;; + --norecursion | --no*) + ml_norecursion=yes + ;; + --silent | --sil* | --quiet | --q*) + ml_verbose=--silent + ;; + --verbose | --v | --verb*) + ml_verbose=--verbose + ;; + --with-*) + case "$option" in + *=*) ;; + *) optarg=yes ;; + esac + withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` + eval $withopt="$optarg" + ;; + --without-*) + withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'` + eval $withopt=no + ;; + esac +done + +# Only do this if --enable-multilib. +if [ "${enable_multilib}" = yes ]; then + +# Compute whether this is the library's top level directory +# (ie: not a multilib subdirectory, and not a subdirectory like libg++/src). +# ${with_multisubdir} tells us we're in the right branch, but we could be +# in a subdir of that. +# ??? The previous version could void this test by separating the process into +# two files: one that only the library's toplevel configure.in ran (to +# configure the multilib subdirs), and another that all configure.in's ran to +# update the Makefile. It seemed reasonable to collapse all multilib support +# into one file, but it does leave us with having to perform this test. +ml_toplevel_p=no +if [ -z "${with_multisubdir}" ]; then + if [ "${srcdir}" = "." ]; then + # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}. + # ${with_target_subdir} = "." for native, otherwise target alias. + if [ "${with_target_subdir}" = "." ]; then + if [ -f ${ml_realsrcdir}/../config-ml.in ]; then + ml_toplevel_p=yes + fi + else + if [ -f ${ml_realsrcdir}/../../config-ml.in ]; then + ml_toplevel_p=yes + fi + fi + else + # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}. + if [ -f ${ml_realsrcdir}/../config-ml.in ]; then + ml_toplevel_p=yes + fi + fi +fi + +# If this is the library's top level directory, set multidirs to the +# multilib subdirs to support. This lives at the top because we need +# `multidirs' set right away. + +if [ "${ml_toplevel_p}" = yes ]; then + +multidirs= +for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do + dir=`echo $i | sed -e 's/;.*$//'` + if [ "${dir}" = "." ]; then + true + else + if [ -z "${multidirs}" ]; then + multidirs="${dir}" + else + multidirs="${multidirs} ${dir}" + fi + fi +done + +case "${target}" in +arc-*-elf*) + if [ x$enable_biendian != xyes ] + then + old_multidirs=${multidirs} + multidirs="" + for x in ${old_multidirs}; do + case "${x}" in + *be*) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + ;; +m68*-*-*) + if [ x$enable_softfloat = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *soft-float* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_m68881 = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *m68881* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_m68000 = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *m68000* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_m68020 = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *m68020* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + ;; +mips*-*-*) + if [ x$enable_single_float = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *single* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_biendian = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *el* ) : ;; + *eb* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_softfloat = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *soft-float* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + ;; +powerpc*-*-* | rs6000*-*-*) + if [ x$enable_softfloat = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *soft-float* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_powercpu = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + power | */power | */power/* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_powerpccpu = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *powerpc* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_powerpcos = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *mcall-linux* | *mcall-solaris* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_biendian = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *mlittle* | *mbig* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_sysv = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *mcall-sysv* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_aix = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *mcall-aix* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + ;; +esac + +# Remove extraneous blanks from multidirs. +# Tests like `if [ -n "$multidirs" ]' require it. +multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'` + +# Add code to library's top level makefile to handle building the multilib +# subdirs. + +cat > Multi.tem <<\EOF + +# FIXME: There should be an @-sign in front of the `if'. +# Leave out until this is tested a bit more. +multi-do: + if [ -z "$(MULTIDIRS)" ]; then \ + true; \ + else \ + rootpre=`pwd`/; export rootpre; \ + srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \ + lib=`echo $${rootpre} | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \ + compiler="$(CC)"; \ + for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \ + dir=`echo $$i | sed -e 's/;.*$$//'`; \ + if [ "$${dir}" = "." ]; then \ + true; \ + else \ + if [ -d ../$${dir}/$${lib} ]; then \ + flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ + if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(CFLAGS) $${flags}" \ + CXXFLAGS="$(CXXFLAGS) $${flags}" \ + LIBCFLAGS="$(LIBCFLAGS) $${flags}" \ + LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \ + LDFLAGS="$(LDFLAGS) $${flags}" \ + $(DO)); then \ + true; \ + else \ + exit 1; \ + fi; \ + else true; \ + fi; \ + fi; \ + done; \ + fi + +# FIXME: There should be an @-sign in front of the `if'. +# Leave out until this is tested a bit more. +multi-clean: + if [ -z "$(MULTIDIRS)" ]; then \ + true; \ + else \ + lib=`pwd | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \ + for dir in Makefile $(MULTIDIRS); do \ + if [ -f ../$${dir}/$${lib}/Makefile ]; then \ + if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \ + then true; \ + else exit 1; \ + fi; \ + else true; \ + fi; \ + done; \ + fi +EOF + +cat ${Makefile} Multi.tem > Makefile.tem +rm -f ${Makefile} Multi.tem +mv Makefile.tem ${Makefile} + +fi # ${ml_toplevel_p} = yes + +if [ "${ml_verbose}" = --verbose ]; then + echo "Adding multilib support to Makefile in ${ml_realsrcdir}" + if [ "${ml_toplevel_p}" = yes ]; then + echo "multidirs=${multidirs}" + fi + echo "with_multisubdir=${with_multisubdir}" +fi + +if [ "${srcdir}" = "." ]; then + if [ "${with_target_subdir}" != "." ]; then + ml_srcdotdot="../" + else + ml_srcdotdot="" + fi +else + ml_srcdotdot="" +fi + +if [ -z "${with_multisubdir}" ]; then + ml_subdir= + ml_builddotdot= + : # ml_srcdotdot= # already set +else + ml_subdir="/${with_multisubdir}" + # The '[^/][^/]*' appears that way to work around a SunOS sed bug. + ml_builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`/ + if [ "$srcdir" = "." ]; then + ml_srcdotdot=${ml_srcdotdot}${ml_builddotdot} + else + : # ml_srcdotdot= # already set + fi +fi + +if [ "${ml_toplevel_p}" = yes ]; then + ml_do='$(MAKE)' + ml_clean='$(MAKE)' +else + ml_do=true + ml_clean=true +fi + +# TOP is used by newlib and should not be used elsewhere for this purpose. +# MULTI{SRC,BUILD}TOP are the proper ones to use. MULTISRCTOP is empty +# when srcdir != builddir. MULTIBUILDTOP is always some number of ../'s. +# FIXME: newlib needs to be updated to use MULTI{SRC,BUILD}TOP so we can +# delete TOP. Newlib may wish to continue to use TOP for its own purposes +# of course. +# MULTIDIRS is non-empty for the cpu top level Makefile (eg: newlib/Makefile) +# and lists the subdirectories to recurse into. +# MULTISUBDIR is non-empty in each cpu subdirectory's Makefile +# (eg: newlib/h8300h/Makefile) and is the installed subdirectory name with +# a leading '/'. +# MULTIDO is used for targets like all, install, and check where +# $(FLAGS_TO_PASS) augmented with the subdir's compiler option is needed. +# MULTICLEAN is used for the *clean targets. +# +# ??? It is possible to merge MULTIDO and MULTICLEAN into one. They are +# currently kept separate because we don't want the *clean targets to require +# the existence of the compiler (which MULTIDO currently requires) and +# therefore we'd have to record the directory options as well as names +# (currently we just record the names and use --print-multi-lib to get the +# options). + +sed -e "s:^TOP[ ]*=[ ]*\([./]*\)[ ]*$:TOP = ${ml_builddotdot}\1:" \ + -e "s:^MULTISRCTOP[ ]*=.*$:MULTISRCTOP = ${ml_srcdotdot}:" \ + -e "s:^MULTIBUILDTOP[ ]*=.*$:MULTIBUILDTOP = ${ml_builddotdot}:" \ + -e "s:^MULTIDIRS[ ]*=.*$:MULTIDIRS = ${multidirs}:" \ + -e "s:^MULTISUBDIR[ ]*=.*$:MULTISUBDIR = ${ml_subdir}:" \ + -e "s:^MULTIDO[ ]*=.*$:MULTIDO = $ml_do:" \ + -e "s:^MULTICLEAN[ ]*=.*$:MULTICLEAN = $ml_clean:" \ + ${Makefile} > Makefile.tem +rm -f ${Makefile} +mv Makefile.tem ${Makefile} + +# If this is the library's top level, configure each multilib subdir. +# This is done at the end because this is the loop that runs configure +# in each multilib subdir and it seemed reasonable to finish updating the +# Makefile before going on to configure the subdirs. + +if [ "${ml_toplevel_p}" = yes ]; then + +# We must freshly configure each subdirectory. This bit of code is +# actually partially stolen from the main configure script. FIXME. + +if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then + + if [ "${ml_verbose}" = --verbose ]; then + echo "Running configure in multilib subdirs ${multidirs}" + echo "pwd: `pwd`" + fi + + ml_origdir=`pwd` + ml_libdir=`echo $ml_origdir | sed -e 's,^.*/,,'` + # cd to top-level-build-dir/${with_target_subdir} + cd .. + + for ml_dir in ${multidirs}; do + + if [ "${ml_verbose}" = --verbose ]; then + echo "Running configure in multilib subdir ${ml_dir}" + echo "pwd: `pwd`" + fi + + if [ -d ${ml_dir} ]; then true; else mkdir ${ml_dir}; fi + if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi + + # Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../ + dotdot=../`echo ${ml_dir} | sed -e 's|[^/]||g' -e 's|/|../|g'` + + case ${srcdir} in + ".") + echo Building symlink tree in `pwd`/${ml_dir}/${ml_libdir} + if [ "${with_target_subdir}" != "." ]; then + ml_unsubdir="../" + else + ml_unsubdir="" + fi + (cd ${ml_dir}/${ml_libdir}; + ../${dotdot}${ml_unsubdir}symlink-tree ../${dotdot}${ml_unsubdir}${ml_libdir} "") + if [ -f ${ml_dir}/${ml_libdir}/Makefile ]; then + if [ x"${MAKE}" = x ]; then + (cd ${ml_dir}/${ml_libdir}; make distclean) + else + (cd ${ml_dir}/${ml_libdir}; ${MAKE} distclean) + fi + fi + ml_newsrcdir="." + ml_srcdiroption= + multisrctop=${dotdot} + ;; + *) + case "${srcdir}" in + /*) # absolute path + ml_newsrcdir=${srcdir} + ;; + *) # otherwise relative + ml_newsrcdir=${dotdot}${srcdir} + ;; + esac + ml_srcdiroption="-srcdir=${ml_newsrcdir}" + multisrctop= + ;; + esac + + case "${progname}" in + /*) ml_recprog=${progname} ;; + *) ml_recprog=${dotdot}${progname} ;; + esac + + # FIXME: POPDIR=${PWD=`pwd`} doesn't work here. + ML_POPDIR=`pwd` + cd ${ml_dir}/${ml_libdir} + + if [ -f ${ml_newsrcdir}/configure ]; then + ml_recprog=${ml_newsrcdir}/configure + fi + if eval ${ml_config_shell} ${ml_recprog} \ + --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \ + ${ml_arguments} ${ml_srcdiroption} ; then + true + else + exit 1 + fi + + cd ${ML_POPDIR} + + done + + cd ${ml_origdir} +fi + +fi # ${ml_toplevel_p} = yes +fi # ${enable_multilib} = yes diff --git a/contrib/gdb/config.guess b/contrib/gdb/config.guess index c3c4e79..3263584 100755 --- a/contrib/gdb/config.guess +++ b/contrib/gdb/config.guess @@ -1,6 +1,6 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc. +# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -51,15 +51,55 @@ trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - alpha:OSF1:[VX]*:*) - # After 1.2, OSF1 uses "V1.3" for uname -r. - # After 4.x, OSF1 uses "X4.x" for uname -r. - echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VX]//'` - exit 0 ;; alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo alpha-dec-osf${UNAME_RELEASE} - exit 0 ;; + cat <dummy.s + .globl main + .ent main +main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + ${CC-cc} dummy.s -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + fi + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; @@ -69,21 +109,58 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in amiga:NetBSD:*:*) echo m68k-cbm-netbsd${UNAME_RELEASE} exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - Pyramid*:OSx*:*:*) + arm32:NetBSD:*:*) + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; - sun4*:SunOS:5.*:*) + NILE:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) - echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -103,25 +180,81 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; atari*:NetBSD:*:*) echo m68k-atari-netbsd${UNAME_RELEASE} exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; mac68k:NetBSD:*:*) echo m68k-apple-netbsd${UNAME_RELEASE} exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; - mips:*:4*:UMIPS) - echo mips-mips-riscos4sysv + 2020:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; - mips:*:5*:RISCos) + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >dummy.c + int main (argc, argv) int argc; char **argv; { + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + ${CC-cc} dummy.c -o dummy \ + && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Night_Hawk:Power_UNIX:*:*) @@ -138,8 +271,8 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ -o ${TARGET_BINARY_INTERFACE}x = x ] ; then echo m88k-dg-dgux${UNAME_RELEASE} @@ -165,10 +298,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i[34]86:AIX:*:*) + i?86:AIX:*:*) echo i386-ibm-aix exit 0 ;; *:AIX:2:3) @@ -213,7 +346,7 @@ EOF echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -227,12 +360,48 @@ EOF hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; - 9000/[3478]??:HP-UX:*:*) + *9??*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/7?? | 9000/8?[679] ) HP_ARCH=hppa1.1 ;; - 9000/8?? ) HP_ARCH=hppa1.0 ;; + 9000/[678][0-9][0-9] ) + + sed 's/^ //' << EOF >dummy.c + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy` + rm -f dummy.c dummy esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -279,6 +448,13 @@ EOF hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; @@ -306,64 +482,219 @@ EOF CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} exit 0 ;; - CRAY*C90:*:*:*) - echo c90-cray-unicos${UNAME_RELEASE} + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; hp3[0-9][05]:NetBSD:*:*) echo m68k-hp-netbsd${UNAME_RELEASE} exit 0 ;; - i[34]86:BSD/386:*:* | *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + if test -x /usr/bin/objformat; then + if test "elf" = "`/usr/bin/objformat`"; then + echo ${UNAME_MACHINE}-unknown-freebsdelf`echo${UNAME_RELEASE}|sed -e 's/[-_].*//'` + exit 0 + fi + fi + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:NetBSD:*:*) echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; - i*:CYGWIN*:*) - echo i386-unknown-cygwin32 + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:[Cc][Yy][Gg][Ww][Ii][Nn]*:*) + echo ${UNAME_MACHINE}-pc-cygwin32 + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin32 exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) + # uname on the ARM produces all sorts of strangeness, and we need to + # filter it out. + case "$UNAME_MACHINE" in + arm* | sa110*) UNAME_MACHINE="arm" ;; + esac + # The BFD linker knows what the default object file format is, so # first see if it will tell us. ld_help_string=`ld --help 2>&1` - if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then - echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then - echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then - echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then - echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then - echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 - elif test "${UNAME_MACHINE}" = "alpha" ; then - echo alpha-unknown-linux ; exit 0 + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32ppc) + # Determine Lib Version + cat >dummy.c < +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif +main(argc, argv) + int argc; + char *argv[]; +{ +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); +#else + printf("unkown\n"); +#endif + return 0; +} +EOF + LIBC="" + ${CC-cc} dummy.c -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f dummy.c dummy + echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + sed 's/^ //' <dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + LIBC="" + ${CC-cc} dummy.s -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy else - # Either a pre-BFD a.out linker (linuxoldld) or one that does not give us - # useful --help. Gcc wants to distinguish between linuxoldld and linuxaout. - test ! -d /usr/lib/ldscripts/. \ - && echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0 + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac # Determine whether the default compiler is a.out or elf cat >dummy.c < main(argc, argv) -int argc; -char *argv[]; + int argc; + char *argv[]; { #ifdef __ELF__ - printf ("%s-unknown-linux\n", argv[1]); +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif #else - printf ("%s-unknown-linuxaout\n", argv[1]); + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); #endif return 0; } @@ -373,32 +704,63 @@ EOF fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. - i[34]86:DYNIX/ptx:4*:*) + i?86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; - i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*) + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} else - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE} + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} fi exit 0 ;; - i[34]86:*:3.2:*) + i?86:*:5:7*) + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 +# 5.0.4c returns "Pent II". 5.0.5 returns PentII + (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} + exit 0 ;; + i?86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 - echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL + (/bin/uname -X|egrep '^Machine.*PentII' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pent II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else - echo ${UNAME_MACHINE}-unknown-sysv32 + echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; + pc:*:*:*) + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; Intel:Mach:3*:*) - echo i386-unknown-mach3 + echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 @@ -414,28 +776,36 @@ EOF # "miniframe" echo m68010-convergent-sysv exit 0 ;; - M680[234]0:*:R3V[567]*:*) + M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0) - uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3 && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - uname -p 2>/dev/null | grep 86 >/dev/null \ + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; - m680[234]0:LynxOS:2.[23]*:*) - echo m68k-lynx-lynxos${UNAME_RELEASE} + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i[34]86:LynxOS:2.[23]*:*) - echo i386-lynx-lynxos${UNAME_RELEASE} + i?86:LynxOS:2.*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - TSUNAMI:LynxOS:2.[23]*:*) - echo sparc-lynx-lynxos${UNAME_RELEASE} + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - rs6000:LynxOS:2.[23]*:*) - echo rs6000-lynx-lynxos${UNAME_RELEASE} + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 @@ -448,16 +818,41 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - R3000:*System_V*:*:*) + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -501,7 +896,7 @@ main () #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3"); + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); exit (0); #endif @@ -518,7 +913,7 @@ main () #endif #if defined (__386BSD__) - printf ("i386-unknown-bsd\n"); exit (0); + printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) diff --git a/contrib/gdb/config.if b/contrib/gdb/config.if new file mode 100644 index 0000000..bcc0269 --- /dev/null +++ b/contrib/gdb/config.if @@ -0,0 +1,87 @@ +#! /dev/null +# Don't call it directly. This shell script fragment is called to +# determine: +# +# 1. libstcxx_interface: the interface name for libstdc++. +# 2. cxx_interface: the interface name for c++. +# 3. libc_interface: the interface name for libc. +# + +# Get the top level src dir. +if [ -z "${topsrcdir}" -a -z "${top_srcdir}" ] +then + echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2 + exit 1 +fi + +if [ -n "${topsrcdir}" ] +then + if_topsrcdir=${topsrcdir} +else + if_topsrcdir=${top_srcdir} +fi + +if [ -f ${if_topsrcdir}/libstdc++/Makefile.in ]; then +# We check libstdc++ for libstdcxx_interface. +libstdcxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/libstdc++/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` +else +libstdcxx_interface= +fi + +if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then +# We check gcc/cp for cxx_interface. +cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` +else +cxx_interface= +fi + +# The trickiest part is libc_interface. +if [ -z "${libc_interface}" ] +then + case ${target_os} in + *linux*libc1*|*linux*libc5*) + case ${target_alias} in + *alpha*|*powerpc*) + libc_interface=-libc5.9- + ;; + *) + libc_interface=-libc5- + ;; + esac + ;; + *linux*gnu*) + # We have to work harder to figure it out. + if [ ${target_alias} = ${build_alias} ] + then + dummy=if$$ + cat >$dummy.c < +main(argc, argv) + int argc; + char *argv[]; +{ + printf("%d\n", __GLIBC_MINOR__); + return 0; +} +EOF + ${CC-cc} $dummy.c -o $dummy 2>/dev/null + if [ "$?" = 0 ] + then + libc_interface=-libc6.`./$dummy`- + rm -f $dummy.c $dummy + else + # It should never happen. + echo "Cannot find the GNU C library minor version number." >&2 + rm -f $dummy.c $dummy + exit 1 + fi + else + # Cross compiling. Assume glibc 2.1. + libc_interface=-libc6.1- + fi + ;; + *) + libc_interface=- + ;; + esac +fi diff --git a/contrib/gdb/config.sub b/contrib/gdb/config.sub index c462f8a..3ce1136 100755 --- a/contrib/gdb/config.sub +++ b/contrib/gdb/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. +# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. +# can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -41,6 +41,8 @@ # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. if [ x$1 = x ] @@ -62,11 +64,33 @@ case $1 in ;; esac -# Separate what the user gave into CPU-COMPANY and OS (if any). -basic_machine=`echo $1 | sed 's/-[^-]*$//'` -if [ $basic_machine != $1 ] -then os=`echo $1 | sed 's/.*-/-/'` -else os=; fi +# CYGNUS LOCAL marketing-names +# Here we handle any "marketing" names - translating them to +# standard triplets +case $1 in + mips-tx39-elf) + set mipstx39-unknown-elf + ;; + *) + ;; +esac +# END CYGNUS LOCAL marketing-names + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also @@ -81,7 +105,8 @@ case $os in -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp ) + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple) os= basic_machine=$1 ;; @@ -89,10 +114,6 @@ case $os in os= basic_machine=$1 ;; - -apple*) # CYGNUS LOCAL - os= - basic_machine=$1 - ;; -scout) # CYGNUS LOCAL ;; -wrs) # CYGNUS LOCAL @@ -103,34 +124,37 @@ case $os in os=-hiuxwe2 ;; -sco5) - os=sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos @@ -150,16 +174,27 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i[3456]86 | i860 | m68k | m68000 | m88k | ns32k | arm \ - | arme[lb] | pyramid \ - | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \ - | alpha | we32k | ns16k | clipper | i370 | sh \ - | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \ - | pdp11 | mips64el | mips64orion | mips64orionel \ - | sparc | sparclet | sparclite | sparc64) + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 \ + | tron | a29k | 580 | i960 | h8300 \ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | alpha | alphaev[45678] | alphaev56 | alphapca5[67] \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp11 \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | sparc86x | v850 \ + | c4x) basic_machine=$basic_machine-unknown ;; - m88110 | m680[01234]0 | m683?2 | m68360 | z8k | v70 | h8500 | w65) # CYGNUS LOCAL + m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \ + | h8500 | w65 | fr30) # CYGNUS LOCAL + basic_machine=$basic_machine-unknown + ;; + strongarm) # CYGNUS LOCAL nickc/strongarm + basic_machine=$basic_machine-unknown + ;; + thumb) basic_machine=$basic_machine-unknown ;; mips64vr4300 | mips64vr4300el) # CYGNUS LOCAL jsmith/vr4300 @@ -168,27 +203,85 @@ case $basic_machine in mips64vr4100 | mips64vr4100el) # CYGNUS LOCAL jsmith/vr4100 basic_machine=$basic_machine-unknown ;; + mips64vr5000 | mips64vr5000el) # CYGNUS LOCAL ian/vr5000 + basic_machine=$basic_machine-unknown + ;; + mips16) + basic_machine=$basic_machine-unknown + ;; + tic30) # CYGNUS LOCAL ian/tic30 + basic_machine=$basic_machine-unknown + ;; + c30) # CYGNUS LOCAL ian/tic30 + basic_machine=tic30-unknown + ;; + + v850e) # CYGNUS LOCAL jtc/v850 + basic_machine=$basic_machine-unknown + ;; + v850ea) # CYGNUS LOCAL jtc/v850 + basic_machine=$basic_machine-unknown + ;; + d10v) + basic_machine=$basic_machine-unknown + ;; + d30v) # CYGNUS LOCAL hunt/d30v + basic_machine=$basic_machine-unknown + ;; + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[34567]86) + basic_machine=$basic_machine-pc + ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. - vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \ - | sparc-* | ns32k-* | fx80-* | arm-* | arme[lb]-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \ - | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ - | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ - | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ - | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-*) - ;; - m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-*) # CYGNUS LOCAL - ;; + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ + | xmp-* | ymp-* \ + | hppa-* | hppa1.0-* | hppa1.1-* \ + | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ + | alpha-* | alphaev[45678]-* | alphaev56-* | alphapca5[67]-* \ + | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \ + | xps100-* | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mipstx39-* | mipstx39el-* \ + | f301-* \ + | fr30-*) # CYGNUS LOCAL + ;; + m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # CYGNUS LOCAL + ;; + strongarm-*) # CYGNUS LOCAL nickc/strongarm + ;; + thumb-*) # CYGNUS LOCAL angela/thumb + ;; + v850-*) # CYGNUS LOCAL + ;; + v850e-*) # CYGNUS LOCAL + ;; + v850ea-*) # CYGNUS LOCAL + ;; + d30v-*) # CYGNUS LOCAL + ;; mips64vr4300-* | mips64vr4300el-*) # CYGNUS LOCAL jsmith/vr4300 ;; mips64vr4100-* | mips64vr4100el-*) # CYGNUS LOCAL jsmith/vr4100 ;; + mips16-*) # CYGNUS LOCAL krk/mips16 + ;; + tic30-*) # CYGNUS LOCAL ian/tic30 + ;; + c30-*) # CYGNUS LOCAL ian/tic30 + basic_machine=tic30-unknown + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) # CYGNUS LOCAL @@ -226,9 +319,9 @@ case $basic_machine in amiga | amiga-*) basic_machine=m68k-cbm ;; - amigados) + amigaos | amigados) basic_machine=m68k-cbm - os=-amigados + os=-amigaos ;; amigaunix | amix) basic_machine=m68k-cbm @@ -242,10 +335,6 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; - arm | armel | armeb) - basic_machine=arm-arm - os=-aout - ;; aux) basic_machine=m68k-apple os=-aux @@ -282,6 +371,10 @@ case $basic_machine in basic_machine=cray2-cray os=-unicos ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; crds | unos) basic_machine=m68k-crds ;; @@ -379,18 +472,39 @@ case $basic_machine in basic_machine=hppa1.1-hp os=-proelf ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; - hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) + hp9k6[0-9][0-9] | hp6[0-9][0-9] ) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9] ) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9] ) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \ + hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 ) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679] ) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; + hppa-next) + os=-nextstep3 + ;; hppaosf) # CYGNUS LOCAL basic_machine=hppa1.1-hp os=-osf @@ -400,20 +514,20 @@ case $basic_machine in os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[3456]86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[3456]86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[3456]86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[3456]86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) # CYGNUS LOCAL @@ -428,6 +542,10 @@ case $basic_machine in basic_machine=i386-unknown os=-go32 ;; + i386-mingw32 | mingw32) + basic_machine=i386-unknown + os=-mingw32 + ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -456,6 +574,14 @@ case $basic_machine in miniframe) basic_machine=m68000-convergent ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -519,7 +645,7 @@ case $basic_machine in basic_machine=i960-intel os=-nindy ;; - mon960) + mon960) # CYGNUS LOCAL basic_machine=i960-intel os=-mon960 ;; @@ -551,25 +677,23 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5) - basic_machine=i586-intel + pentium | p5 | k5 | nexen) + basic_machine=i586-pc ;; - pentiumpro | p6) - basic_machine=i686-intel + pentiumpro | p6 | k6 | 6x86) + basic_machine=i686-pc ;; - pentium-* | p5-*) + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-*) + pentiumpro-* | p6-* | k6-* | 6x86-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - k5) - # We don't have specific support for AMD's K5 yet, so just call it a Pentium - basic_machine=i586-amd - ;; - nexen) - # We don't have specific support for Nexgen yet, so just call it a Pentium - basic_machine=i586-nexgen + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -672,6 +796,12 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -695,6 +825,9 @@ case $basic_machine in basic_machine=vax-dec os=-vms ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; vxworks960) basic_machine=i960-wrs os=-vxworks @@ -739,7 +872,11 @@ case $basic_machine in basic_machine=hppa1.1-oki ;; mips) - basic_machine=mips-mips + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi ;; romp) basic_machine=romp-ibm @@ -756,7 +893,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sparc) + sparc | sparcv9) basic_machine=sparc-sun ;; cydra) @@ -774,6 +911,10 @@ case $basic_machine in pmac | pmac-mpw) # CYGNUS LOCAL basic_machine=powerpc-apple ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -797,6 +938,8 @@ esac if [ x"$os" != x"" ] then case $os in + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -804,38 +947,46 @@ case $os in -solaris) os=-solaris2 ;; - -unixware* | svr4*) + -svr4*) os=-sysv4 ;; + -unixware*) + os=-sysv4.2uw + ;; -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux|'` + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[3456]* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigados* | -msdos* | -moss* | -newsos* | -unicos* | -aos* | -aof* \ - | -nindy* | -mon960* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \ - | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin32* | -pe* | -psos*) + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk*) # Remember, each alternative MUST END IN *, to match a version number. ;; # CYGNUS LOCAL -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -proelf | -os9* \ - | -macos* | -mpw* | -magic*) + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mon960* | -lnews* ) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; # END CYGNUS LOCAL + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; @@ -952,12 +1103,18 @@ case $basic_machine in mips*-cisco) # CYGNUS LOCAL os=-elf ;; + mips*-*) # CYGNUS LOCAL + os=-elf + ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; + *-be) + os=-beos + ;; *-ibm) os=-aix ;; @@ -980,7 +1137,7 @@ case $basic_machine in os=-sysv ;; *-cbm) - os=-amigados + os=-amigaos ;; *-dg) os=-dgux @@ -1030,6 +1187,9 @@ case $basic_machine in *-masscomp) os=-rtu ;; + f301-fujitsu) + os=-uxpv + ;; *-rom68k) # CYGNUS LOCAL os=-coff ;; @@ -1057,18 +1217,18 @@ case $basic_machine in -sunos*) vendor=sun ;; - -bosx*) # CYGNUS LOCAL - vendor=bull - ;; - -lynxos*) - vendor=lynx - ;; -aix*) vendor=ibm ;; + -beos*) + vendor=be + ;; -hpux*) vendor=hp ;; + -mpeix*) + vendor=hp + ;; -hiux*) vendor=hitachi ;; @@ -1090,7 +1250,7 @@ case $basic_machine in -ptx*) vendor=sequent ;; - -vxworks*) + -vxsim* | -vxworks*) vendor=wrs ;; -aux*) diff --git a/contrib/gdb/configure b/contrib/gdb/configure index f284be1..a63a3fb 100755 --- a/contrib/gdb/configure +++ b/contrib/gdb/configure @@ -3,7 +3,8 @@ ### WARNING: this file contains embedded tabs. Do not run untabify on this file. # Configuration script -# Copyright (C) 1988, 90, 91, 92, 93, 94 Free Software Foundation, Inc. +# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 1997 +# 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 @@ -47,20 +48,25 @@ Makefile=Makefile Makefile_in=Makefile.in arguments= build_alias= -cache_file= +cache_file=config.cache cache_file_option= configdirs= +extraconfigdirs= +diroptions= exec_prefix= exec_prefixoption= fatal= floating_point=default gas=default +gcc_version= +gcc_version_trigger= host_alias=NOHOST host_makefile_frag= moveifchange= norecursion= other_options= package_makefile_frag= +package_makefile_rules_frag= prefix=/usr/local progname= program_prefix= @@ -69,7 +75,7 @@ program_suffix= program_suffixoption= program_transform_name= program_transform_nameoption= -redirect=">/dev/null" +redirect= removing= site= site_makefile_frag= @@ -80,11 +86,54 @@ subdirs= target_alias=NOTARGET target_makefile_frag= undefs=NOUNDEFS -version="$Revision: 1.222.4.1 $" +version="$Revision: 1.270 $" x11=default +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' ### we might need to use some other shell than /bin/sh for running subshells -# + +### If we are on Windows, search for the shell. This will permit people +### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure +### without also having to set CONFIG_SHELL. This code will work when +### using bash, which sets OSTYPE. +case "${OSTYPE}" in +*win32*) + if [ x${CONFIG_SHELL} = x ]; then + if [ ! -f /bin/sh ]; then + if [ x${SHELL} != x ] && [ -f ${SHELL} ]; then + CONFIG_SHELL=${SHELL} + export CONFIG_SHELL + else + for prog in sh sh.exe bash bash.exe; do + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/$prog; then + CONFIG_SHELL=$dir/$prog + export CONFIG_SHELL + break + fi + done + IFS="$save_ifs" + test -n "${CONFIG_SHELL}" && break + done + fi + fi + fi + ;; +esac + config_shell=${CONFIG_SHELL-/bin/sh} NO_EDIT="This file was generated automatically by configure. Do not edit." @@ -157,6 +206,10 @@ do # Now, process the options case $option in + --bi*) + bindir=$optarg + diroptions="$diroptions --bindir=$optarg" + ;; --build* | --bu*) case "$build_alias" in "") build_alias=$optarg ;; @@ -168,6 +221,10 @@ do --cache*) cache_file=$optarg ;; + --da*) + datadir=$optarg + diroptions="$diroptions --datadir=$optarg" + ;; --disable-*) enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'` eval $enableopt=no @@ -201,6 +258,30 @@ do ;; esac ;; + --inc*) + includedir=$optarg + diroptions="$diroptions --includedir=$optarg" + ;; + --inf*) + infodir=$optarg + diroptions="$diroptions --infodir=$optarg" + ;; + --libd*) + libdir=$optarg + diroptions="$diroptions --libdir=$optarg" + ;; + --libe*) + libexecdir=$optarg + diroptions="$diroptions --libexecdir=$optarg" + ;; + --lo*) + localstatedir=$optarg + diroptions="$diroptions --localstatedir=$optarg" + ;; + --ma*) + mandir=$optarg + diroptions="$diroptions --mandir=$optarg" + ;; --nfp | --nf*) floating_point=no floating_pointoption="--nfp" @@ -208,6 +289,10 @@ do --norecursion | --no*) norecursion=yes ;; + --ol*) + oldincludedir=$optarg + diroptions="$diroptions --oldincludedir=$optarg" + ;; --prefix* | --pre*) prefix=$optarg prefixoption="--prefix=$optarg" @@ -228,6 +313,14 @@ do --rm) removing=--rm ;; + --sb*) + sbindir=$optarg + diroptions="$diroptions --sbindir=$optarg" + ;; + --sh*) + sharedstatedir=$optarg + diroptions="$diroptions --sharedstatedir=$optarg" + ;; --silent | --sil* | --quiet | --q*) redirect=">/dev/null" verbose=--silent @@ -246,6 +339,10 @@ do --srcdir* | --sr*) srcdir=$optarg ;; + --sy*) + sysconfdir=$optarg + diroptions="$diroptions --sysconfdir=$optarg" + ;; --target* | --ta*) case $target_alias in NOTARGET) target_alias=$optarg ;; @@ -286,9 +383,6 @@ do ;; --x-i* | --x-l*) other_options="$other_options $orig_option" ;; - --bi* | --sb* | --li* | --da* | --sy* | --sh* | --lo* | --in* | --ol* | --ma*) - # These options were added to autoconf for emacs. - ;; --*) echo "configure: Unrecognized option: \"$orig_option\"; use --help for usage." >&2 exit 1 @@ -340,7 +434,7 @@ case "${fatal}" in # Neither --host option nor undefs were present. # Call config.guess. guesssys=`echo ${progname} | sed 's/configure$/config.guess/'` - if host_alias=`${guesssys}` + if host_alias=`${config_shell} ${guesssys}` then # If the string we are going to use for # the target is a prefix of the string @@ -424,9 +518,11 @@ fi configsub=`echo ${progname} | sed 's/configure$/config.sub/'` moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'` +topsrcdir=`cd \`dirname ${progname}\`; pwd` + # this is a hack. sun4 must always be a valid host alias or this will fail. -if ${configsub} sun4 >/dev/null 2>&1 ; then +if ${config_shell} ${configsub} sun4 >/dev/null 2>&1 ; then true else echo '***' cannot find config.sub. 1>&2 @@ -434,7 +530,7 @@ else fi touch config.junk -if ${moveifchange} config.junk config.trash ; then +if ${config_shell} ${moveifchange} config.junk config.trash ; then true else echo '***' cannot find move-if-change. 1>&2 @@ -480,12 +576,35 @@ case "${srcdir}" in fi esac + # default exec_prefix case "${exec_prefixoption}" in "") exec_prefix="\$(prefix)" ;; *) ;; esac +# Define the trigger file to make sure configure will re-run whenever +# the gcc version number changes. +if [ "${with_gcc_version_trigger+set}" = set ]; then + gcc_version_trigger="$with_gcc_version_trigger" + gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${with_gcc_version_trigger}` +else + # If gcc's sources are available, define the trigger file. + if [ -f ${topsrcdir}/gcc/version.c ] ; then + gcc_version_trigger=${topsrcdir}/gcc/version.c + gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${gcc_version_trigger}` + case "$arguments" in + *--with-gcc-version-trigger=$gcc_version_trigger* ) + ;; + * ) + # Make sure configure.in knows about this. + arguments="--with-gcc-version-trigger=$gcc_version_trigger $arguments" + ;; + esac + withoptions="--with-gcc-version-trigger=$gcc_version_trigger $withoptions" + fi +fi + ### break up ${srcdir}/configure.in. case "`grep '^# per\-host:' ${srcdir}/configure.in`" in "") @@ -508,7 +627,7 @@ case "`grep '^# per\-host:' ${srcdir}/configure.in`" in eval exec ${config_shell} ${srcdir}/configure ${verbose} \ ${buildopt} --host=${host_alias} --target=${target_alias} \ ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \ - ${srcdiroption} \ + ${srcdiroption} ${diroptions} \ ${program_prefixoption} ${program_suffixoption} \ ${program_transform_nameoption} ${site_option} \ ${withoptions} ${withoutoptions} \ @@ -559,8 +678,24 @@ fi ### do common part of configure.in +# If the language specific compiler does not exist, but the "gcc" directory does, +# we will skip this directory; in this case the sub-directory's common part +# of configure.in will create a small shell script "skip-this-dir" containing +# commands to completely clean up any temporary or created files. + . ${tmpfile}.com +if test -f skip-this-dir; then + # Perform the same cleanup as the trap handler, minus the "exit 1" of course, + # and reset the trap handler. + trap 0 + rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos + # Execute the final clean-up actions + ${config_shell} skip-this-dir + # and stop configuring this directory. + exit 0 +fi + # some sanity checks on configure.in case "${srctrigger}" in "") @@ -573,9 +708,9 @@ esac case "${build_alias}" in "") if result=`${config_shell} ${configsub} ${host_alias}` ; then - build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` - build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` - build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` + build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` build=${build_cpu}-${build_vendor}-${build_os} build_alias=${host_alias} fi @@ -583,9 +718,9 @@ case "${build_alias}" in *) if result=`${config_shell} ${configsub} ${build_alias}` ; then buildopt="--build=${build_alias}" - build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` - build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` - build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` + build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` build=${build_cpu}-${build_vendor}-${build_os} else echo "Unrecognized build system name ${build_alias}." 1>&2 @@ -600,9 +735,9 @@ else echo "Unrecognized host system name ${host_alias}." 1>&2 exit 1 fi -host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` -host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` -host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` +host_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` host=${host_cpu}-${host_vendor}-${host_os} . ${tmpfile}.hst @@ -613,9 +748,9 @@ else echo "Unrecognized target system name ${target_alias}." 1>&2 exit 1 fi -target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` -target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` -target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` +target_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` target=${target_cpu}-${target_vendor}-${target_os} . ${tmpfile}.tgt @@ -670,26 +805,46 @@ fi # If CC and CXX are not set in the environment, and the Makefile # exists, try to extract them from it. This is to handle running # ./config.status by hand. -if [ -z "${CC}" -a -r Makefile ]; then +if [ -z "${CC}" ] && [ -r Makefile ]; then sed -n -e ':loop /\\$/ N -/\\$/ b loop s/\\\n//g +t loop /^CC[ ]*=/ s/CC[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc CC=`tail -1 Makefile.cc` rm -f Makefile.cc fi -if [ -z "${CXX}" -a -r Makefile ]; then +if [ -z "${CFLAGS}" ] && [ -r Makefile ]; then + sed -n -e ':loop +/\\$/ N +s/\\\n//g +t loop +/^CFLAGS[ ]*=/ s/CFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc + CFLAGS=`tail -1 Makefile.cc` + rm -f Makefile.cc +fi + +if [ -z "${CXX}" ] && [ -r Makefile ]; then sed -n -e ':loop /\\$/ N -/\\$/ b loop s/\\\n//g +t loop /^CXX[ ]*=/ s/CXX[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc CXX=`tail -1 Makefile.cc` rm -f Makefile.cc fi +if [ -z "${CXXFLAGS}" ] && [ -r Makefile ]; then + sed -n -e ':loop +/\\$/ N +s/\\\n//g +t loop +/^CXXFLAGS[ ]*=/ s/CXXFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc + CXXFLAGS=`tail -1 Makefile.cc` + rm -f Makefile.cc +fi + # Generate a default definition for YACC. This is used if the makefile can't # locate bison or byacc in objdir. @@ -709,6 +864,25 @@ do test -n "$DEFAULT_YACC" && break done +# Generate a default definition for M4. This is used if the makefile can't +# locate m4 in objdir. + +for prog in gm4 gnum4 m4 +do + set dummy $prog; tmp=$2 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/$tmp; then + DEFAULT_M4="$prog" + break + fi + done + IFS="$save_ifs" + + test -n "$DEFAULT_M4" && break +done + # Generate a default definition for LEX. This is used if the makefile can't # locate flex in objdir. @@ -734,16 +908,17 @@ if [ "${build}" != "${host}" ]; then tools="AR AR_FOR_TARGET AS AS_FOR_TARGET BISON CC_FOR_BUILD" tools="${tools} CC_FOR_TARGET CXX_FOR_TARGET" - tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET HOST_PREFIX" + tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET GCC_FOR_TARGET HOST_PREFIX" tools="${tools} HOST_PREFIX_1 LD LD_FOR_TARGET LEX MAKEINFO NM" tools="${tools} NM_FOR_TARGET RANLIB RANLIB_FOR_TARGET" + tools="${tools} WINDRES WINDRES_FOR_TARGET YACC" for var in ${tools}; do - if [ -z "`eval 'echo $'"${var}"`" -a -r Makefile ]; then + if [ -z "`eval 'echo $'"${var}"`" ] && [ -r Makefile ]; then sed -n -e ':loop /\\$/ N -/\\$/ b loop s/\\\n//g +t loop /^'"${var}"'[ ]*=/ s/'"${var}"'[ ]*=[ ]*\(.*\)/\1/p' \ < Makefile > Makefile.v t=`tail -1 Makefile.v` @@ -758,13 +933,17 @@ s/\\\n//g AR_FOR_TARGET=${AR_FOR_TARGET-${target_alias}-ar} AS=${AS-${host_alias}-as} AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as} + BISON=${BISON-bison} CC=${CC-${host_alias}-gcc} - CXX=${CXX-${host_alias}-gcc} + CFLAGS=${CFLAGS-"-g -O2"} + CXX=${CXX-${host_alias}-c++} + CXXFLAGS=${CXXFLAGS-"-g -O2"} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc} - CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-gcc} + CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++} DLLTOOL=${DLLTOOL-${host_alias}-dlltool} DLLTOOL_FOR_TARGET=${DLLTOOL_FOR_TARGET-${target_alias}-dlltool} + GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}} HOST_PREFIX=${build_alias}- HOST_PREFIX_1=${build_alias}- LD=${LD-${host_alias}-ld} @@ -774,26 +953,30 @@ s/\\\n//g NM_FOR_TARGET=${NM_FOR_TARGET-${target_alias}-nm} RANLIB=${RANLIB-${host_alias}-ranlib} RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET-${target_alias}-ranlib} + WINDRES=${WINDRES-${host_alias}-windres} + WINDRES_FOR_TARGET=${WINDRES_FOR_TARGET-${target_alias}-windres} - if [ -z "${BISON}" ]; then + if [ -z "${YACC}" ]; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. - if test -f $dir/byacc; then - BISON=byacc + if test -f $dir/bison; then + YACC="bison -y" break fi - if test -f $dir/bison; then - BISON=bison + if test -f $dir/byacc; then + YACC=byacc break fi if test -f $dir/yacc; then - BISON=yacc + YACC=yacc break fi done IFS="$save_ifs" - BISON=${BISON-bison} + if [ -z "${YACC}" ]; then + YACC="bison -y" + fi fi if [ -z "${LEX}" ]; then @@ -821,6 +1004,7 @@ s/\\\n//g export LD export NM export RANLIB + export WINDRES else # If CC is still not set, try to get gcc. if [ -z "${CC}" ]; then @@ -828,31 +1012,51 @@ else for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc; then - CC="gcc -O2" + CC="gcc" + echo 'void f(){}' > conftest.c + if test -z "`${CC} -g -c conftest.c 2>&1`"; then + CFLAGS=${CFLAGS-"-g -O2"} + CXXFLAGS=${CXXFLAGS-"-g -O2"} + else + CFLAGS=${CFLAGS-"-O2"} + CXXFLAGS=${CXXFLAGS-"-O2"} + fi + rm -f conftest* break fi done IFS="$save_ifs" CC=${CC-cc} + else + if test -z "${CFLAGS}"; then + # Here CC is set but CFLAGS is not. Use a quick hack to use -O2 if CC + # is set to a version of gcc. + case "${CC}" in + *gcc) + echo 'void f(){}' > conftest.c + if test -z "`${CC} -g -c conftest.c 2>&1`"; then + CFLAGS=${CFLAGS-"-g -O2"} + CXXFLAGS=${CXXFLAGS-"-g -O2"} + else + CFLAGS=${CFLAGS-"-O2"} + CXXFLAGS=${CXXFLAGS-"-O2"} + fi + rm -f conftest* + ;; + esac + fi fi - CXX=${CXX-"gcc"} + CXX=${CXX-"c++"} + CFLAGS=${CFLAGS-"-g"} + CXXFLAGS=${CXXFLAGS-"-g -O2"} fi export CC export CXX +export CFLAGS +export CXXFLAGS -case "$host" in - *go32*) - enable_gdbtk=no ;; -esac - -# Determine whether gdb needs tk/tcl or not. -if [ "$enable_gdbtk" != "no" ]; then - GDB_TK="all-tcl all-tk" -else - GDB_TK="" -fi for subdir in . ${subdirs} ; do @@ -911,27 +1115,34 @@ for subdir in . ${subdirs} ; do set ${links}; link=$1; shift; links=$* if [ ! -r ${srcdir}/${file} ] ; then + if [ ! -r ${file} ] ; then + echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2 exit 1 + else + srcfile=${file} + fi + else + srcfile=${srcdir}/${file} fi ${remove} -f ${link} # Make a symlink if possible, otherwise try a hard link - if ${symbolic_link} ${srcdir}/${file} ${link} >/dev/null 2>&1 ; then + if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then true else # We need to re-remove the file because Lynx leaves a # very strange directory there when it fails an NFS symlink. ${remove} -r -f ${link} - ${hard_link} ${srcdir}/${file} ${link} + ${hard_link} ${srcfile} ${link} fi if [ ! -r ${link} ] ; then - echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2 + echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2 exit 1 fi - echo "Linked \"${link}\" to \"${srcdir}/${file}\"." + echo "Linked \"${link}\" to \"${srcfile}\"." done # Create a .gdbinit file which runs the one in srcdir @@ -957,88 +1168,101 @@ EOF # been somewhat optimized and is perhaps a bit twisty. # code is order so as to try to sed the smallest input files we know. + # so do these separately because I don't trust the order of sed -e expressions. - # the four makefile fragments MUST end up in the resulting Makefile in this order: - # package, target, host, and site. so do these separately because I don't trust the - # order of sed -e expressions. + # the five makefile fragments MUST end up in the resulting Makefile in this order: + # package macros, target, host, site, and package rules. if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then - # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem - rm -f ${subdir}/Makefile.tem - case "${site}" in + # Conditionalize the makefile for this package from "Makefile.in" (or whatever it's called) into Makefile.tem. + rm -f ${subdir}/${Makefile}.tem + case "${package_makefile_rules_frag}" in "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;; *) + if [ ! -f ${package_makefile_rules_frag} ] ; then + package_makefile_rules_frag=${srcdir}/${package_makefile_rules_frag} + fi + if [ -f ${package_makefile_rules_frag} ] ; then + sed -e "/^####/ r ${package_makefile_rules_frag}" ${srcdir}/${subdir}/${Makefile_in} > ${Makefile}.tem + else + echo '***' Expected package makefile rules fragment \"${package_makefile_rules_frag}\" 1>&2 + echo '***' is missing in ${PWD=`pwd`}. 1>&2 + cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem + fi + esac + # working copy now in ${Makefile}.tem + + # Conditionalize for this site. + rm -f ${Makefile} + case "${site}" in + "") mv ${subdir}/Makefile.tem ${Makefile} ;; + *) site_makefile_frag=${srcdir}/config/ms-${site} if [ -f ${site_makefile_frag} ] ; then - sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \ - > ${subdir}/Makefile.tem + sed -e "/^####/ r ${site_makefile_frag}" ${subdir}/Makefile.tem \ + > ${Makefile} else - cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem + mv ${subdir}/Makefile.tem ${Makefile} site_makefile_frag= fi ;; esac - # working copy now in ${subdir}/Makefile.tem + # working copy now in ${Makefile} # Conditionalize the makefile for this host. - rm -f ${Makefile} + rm -f ${subdir}/Makefile.tem case "${host_makefile_frag}" in - "") mv ${subdir}/Makefile.tem ${Makefile} ;; + "") mv ${Makefile} ${subdir}/Makefile.tem ;; *) if [ ! -f ${host_makefile_frag} ] ; then host_makefile_frag=${srcdir}/${host_makefile_frag} fi if [ -f ${host_makefile_frag} ] ; then - sed -e "/^####/ r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile} + sed -e "/^####/ r ${host_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem else echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2 echo '***' is missing in ${PWD=`pwd`}. 1>&2 - mv ${subdir}/Makefile.tem ${Makefile} + mv ${Makefile} ${subdir}/Makefile.tem fi esac - # working copy now in ${Makefile} + # working copy now in ${subdir)/Makefile.tem # Conditionalize the makefile for this target. - rm -f ${subdir}/Makefile.tem + rm -f ${Makefile} case "${target_makefile_frag}" in - "") mv ${Makefile} ${subdir}/Makefile.tem ;; + "") mv ${subdir}/Makefile.tem ${Makefile} ;; *) if [ ! -f ${target_makefile_frag} ] ; then target_makefile_frag=${srcdir}/${target_makefile_frag} fi if [ -f ${target_makefile_frag} ] ; then - sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem + sed -e "/^####/ r ${target_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile} else - mv ${Makefile} ${subdir}/Makefile.tem + mv ${subdir}/Makefile.tem ${Makefile} target_makefile_frag= fi ;; esac - # real copy now in ${subdir}/Makefile.tem + # working copy now in ${Makefile} - # Conditionalize the makefile for this package. - rm -f ${Makefile} + # Emit the default values of this package's macros. + rm -f ${subdir}/Makefile.tem case "${package_makefile_frag}" in - "") mv ${subdir}/Makefile.tem ${Makefile} ;; + "") mv ${Makefile} ${subdir}/Makefile.tem ;; *) if [ ! -f ${package_makefile_frag} ] ; then package_makefile_frag=${srcdir}/${package_makefile_frag} fi if [ -f ${package_makefile_frag} ] ; then - sed -e "/^####/ r ${package_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile} - rm -f ${subdir}/Makefile.tem + sed -e "/^####/ r ${package_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem else - echo '***' Expected package makefile fragment \"${package_makefile_frag}\" 1>&2 + echo '***' Expected package makefile fragment \"${package_makefile_rules_frag}\" 1>&2 echo '***' is missing in ${PWD=`pwd`}. 1>&2 - mv ${subdir}/Makefile.tem ${Makefile} + mv ${Makefile} ${subdir}/Makefile.tem fi esac - # working copy now in ${Makefile} - - mv ${Makefile} ${subdir}/Makefile.tem - # real copy now in ${subdir}/Makefile.tem # prepend warning about editting, and a bunch of variables. @@ -1091,43 +1315,118 @@ EOF echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile} fi + # provide a proper gxx_include_dir to all subdirs. + # Note, if you change the default, make sure to fix both here + # and in the gcc subdirectory. + # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given. + gxx_include_dir= + if test -n "${with_gxx_include_dir}"; then + case "${with_gxx_include_dir}" in + yes ) + echo "configure: error: bad value ${withval} given for g++ include directory" 1>&2 + exit 1 + ;; + no ) + ;; + * ) + gxx_include_dir=${with_gxx_include_dir} + ;; + esac + fi + if test x${gxx_include_dir} = x; then + if test x${enable_version_specific_runtime_libs} = xyes; then + echo gxx_include_dir = '${libsubdir}/include/g++' >> ${Makefile} + else + . ${topsrcdir}/config.if + echo gxx_include_dir = '${prefix}/include/g++'-${libstdcxx_interface} >> ${Makefile} + fi + else + echo gxx_include_dir = ${gxx_include_dir} >> ${Makefile} + fi + + # record if we want to build shared libs. + if test -z "${enable_shared}"; then + echo enable_shared = no >> ${Makefile} + else + echo enable_shared = ${enable_shared} >> ${Makefile} + fi + # record if we want to rumtime library stuff installed in libsubdir. + if test -z "${enable_version_specific_runtime_libs}"; then + echo enable_version_specific_runtime_libs = no >> ${Makefile} + else + echo enable_version_specific_runtime_libs = ${enable_version_specific_runtime_libs} >> ${Makefile} + fi + + # Emit a macro which describes the file containing gcc's + # version number. + echo gcc_version_trigger = ${gcc_version_trigger} >> ${Makefile} + # And emit a macro defining gcc's version number. + echo gcc_version = ${gcc_version} >> ${Makefile} + # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS, # remove any form feeds. if [ -z "${subdirs}" ]; then - rm -f ${subdir}/Makefile.tem2 + rm -f ${subdir}/Makefile.tm2 sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \ -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \ - ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2 + ${subdir}/Makefile.tem > ${subdir}/Makefile.tm2 rm -f ${subdir}/Makefile.tem - mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem - fi - sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \ - -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \ + mv ${subdir}/Makefile.tm2 ${subdir}/Makefile.tem + fi + sed -e "s|^prefix[ ]*=.*$|prefix = ${prefix}|" \ + -e "s|^exec_prefix[ ]*=.*$|exec_prefix = ${exec_prefix}|" \ + -e "s|^bindir[ ]*=.*$|bindir = ${bindir}|" \ + -e "s|^sbindir[ ]*=.*$|sbindir = ${sbindir}|" \ + -e "s|^libexecdir[ ]*=.*$|libexecdir = ${libexecdir}|" \ + -e "s|^datadir[ ]*=.*$|datadir = ${datadir}|" \ + -e "s|^sysconfdir[ ]*=.*$|sysconfdir = ${sysconfdir}|" \ + -e "s|^sharedstatedir[ ]*=.*$|sharedstatedir = ${sharedstatedir}|" \ + -e "s|^localstatedir[ ]*=.*$|localstatedir = ${localstatedir}|" \ + -e "s|^libdir[ ]*=.*$|libdir = ${libdir}|" \ + -e "s|^includedir[ ]*=.*$|includedir = ${includedir}|" \ + -e "s|^oldincludedir[ ]*=.*$|oldincludedir = ${oldincludedir}|" \ + -e "s|^infodir[ ]*=.*$|infodir = ${infodir}|" \ + -e "s|^mandir[ ]*=.*$|mandir = ${mandir}|" \ -e "/^CC[ ]*=/{ :loop1 /\\\\$/ N - /\\\\$/ b loop1 s/\\\\\\n//g + t loop1 s%^CC[ ]*=.*$%CC = ${CC}% }" \ -e "/^CXX[ ]*=/{ :loop2 /\\\\$/ N - /\\\\$/ b loop2 s/\\\\\\n//g + t loop2 s%^CXX[ ]*=.*$%CXX = ${CXX}% }" \ - -e "s:^SHELL[ ]*=.*$:SHELL = ${config_shell}:" \ - -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" \ - -e "s:^srcdir[ ]*=.*$:srcdir = ${makesrcdir}:" \ + -e "/^CFLAGS[ ]*=/{ + :loop3 + /\\\\$/ N + s/\\\\\\n//g + t loop3 + s%^CFLAGS[ ]*=.*$%CFLAGS = ${CFLAGS}% + }" \ + -e "/^CXXFLAGS[ ]*=/{ + :loop4 + /\\\\$/ N + s/\\\\\\n//g + t loop4 + s%^CXXFLAGS[ ]*=.*$%CXXFLAGS = ${CXXFLAGS}% + }" \ + -e "s|^SHELL[ ]*=.*$|SHELL = ${config_shell}|" \ + -e "s|^srcdir[ ]*=.*$|srcdir = ${makesrcdir}|" \ -e "s/ //" \ -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \ -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \ -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \ - -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \ + -e "s|^tooldir[ ]*=.*$|tooldir = ${tooldir}|" \ -e "s:^DEFAULT_YACC[ ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \ -e "s:^DEFAULT_LEX[ ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \ + -e "s:^DEFAULT_M4[ ]*=.*$:DEFAULT_M4 = ${DEFAULT_M4}:" \ ${subdir}/Makefile.tem >> ${Makefile} + # If this is a Canadian Cross, preset the values of many more # tools. @@ -1202,27 +1501,41 @@ ${progname}" ${arguments} " if [ -r ${subdir}/config.back ] ; then mv -f ${subdir}/config.back ${subdir}/config.status fi - ${moveifchange} ${subdir}/config.new ${subdir}/config.status + ${config_shell} ${moveifchange} ${subdir}/config.new ${subdir}/config.status ;; *) rm -f ${Makefile} ${subdir}/config.status ${links} ;; esac done -# If there are subdirectories, then recur. -if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then - for configdir in ${configdirs} ; do +# If there are subdirectories, then recur. +if [ -z "${norecursion}" ] && [ -n "${configdirs}" ] ; then + for configdir in ${configdirs} ${extraconfigdirs} ; do + + # If configdir contains ',' it is + # srcdir,builddir,target_alias + # These come from extraconfigdirs. + case ${configdir} in + *,*) + eval `echo ${configdir} | sed -e 's/\([^,]*\),\([^,]*\),\(.*\)/cfg_dir=\1 bld_dir=\2 tgt_alias=\3/'` + ;; + *) + cfg_dir=${configdir} + bld_dir=${configdir} + tgt_alias=${target_alias} + ;; + esac - if [ -d ${srcdir}/${configdir} ] ; then + if [ -d ${srcdir}/${cfg_dir} ] ; then eval echo Configuring ${configdir}... ${redirect} case "${srcdir}" in ".") ;; *) - if [ ! -d ./${configdir} ] ; then - if mkdir ./${configdir} ; then + if [ ! -d ./${bld_dir} ] ; then + if mkdir ./${bld_dir} ; then true else - echo '***' "${progname}: could not make ${PWD=`pwd`}/${configdir}" 1>&2 + echo '***' "${progname}: could not make ${PWD=`pwd`}/${bld_dir}" 1>&2 exit 1 fi fi @@ -1230,17 +1543,21 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then esac POPDIR=${PWD=`pwd`} - cd ${configdir} + cd ${bld_dir} ### figure out what to do with srcdir case "${srcdir}" in ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place. /*) # absolute path - newsrcdir=${srcdir}/${configdir} + newsrcdir=${srcdir}/${cfg_dir} + srcdiroption="--srcdir=${newsrcdir}" + ;; + ?:*) # absolute path on win32 + newsrcdir=${srcdir}/${cfg_dir} srcdiroption="--srcdir=${newsrcdir}" ;; *) # otherwise relative - newsrcdir=../${srcdir}/${configdir} + newsrcdir=../${srcdir}/${cfg_dir} srcdiroption="--srcdir=${newsrcdir}" ;; esac @@ -1252,6 +1569,9 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then /*) # absolute path cache_file_option="--cache-file=${cache_file}" ;; + ?:*) # absolute path on win32 + cache_file_option="--cache-file=${cache_file}" + ;; *) # relative path cache_file_option="--cache-file=../${cache_file}" ;; @@ -1263,18 +1583,19 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then elif [ -f ${newsrcdir}/configure.in ] ; then case "${progname}" in /*) recprog=${progname} ;; + ?:*) recprog=${progname} ;; *) recprog=../${progname} ;; esac else - eval echo No configuration information in ${configdir} ${redirect} + eval echo No configuration information in ${cfg_dir} ${redirect} recprog= fi ### The recursion line is here. if [ ! -z "${recprog}" ] ; then - if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \ + if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${tgt_alias} \ ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \ - ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${floating_pointoption} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then + ${srcdiroption} ${diroptions} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${floating_pointoption} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then true else echo Configure in `pwd` failed, exiting. 1>&2 diff --git a/contrib/gdb/configure.in b/contrib/gdb/configure.in index fd35114..eb7fc71 100644 --- a/contrib/gdb/configure.in +++ b/contrib/gdb/configure.in @@ -1,3 +1,4 @@ +#! /bin/bash ############################################################################## ## This file is a shell script fragment that supplies the information @@ -13,6 +14,23 @@ ## For more information on these two systems, check out the documentation ## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi). +# Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 +# Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You 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. + ############################################################################## ### To add a new directory to the tree, first choose whether it is a target @@ -24,26 +42,27 @@ # these libraries are used by various programs built for the host environment # -host_libs="mmalloc libiberty opcodes bfd readline gash tcl tk tclX" +host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tcl8.1 tk8.1 tclX itcl tix libgui" if [ "${enable_gdbgui}" = "yes" ] ; then host_libs="${host_libs} libgui" fi # these tools are built for the host environment -# -host_tools="byacc flex bison binutils ld gas gcc gdb make patch - prms send-pr gprof gdbtest tgas etc expect dejagnu sim - m4 autoconf ispell grep diff rcs cvs fileutils shellutils - textutils wdiff find emacs emacs19 uudecode hello tar gzip indent - recode release sed utils" - +# Note, the powerpc-eabi build depends on sim occurring before gdb in order to +# know that we are building the simulator. +host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip" # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) # -target_libs="target-libiberty target-libgloss target-newlib target-libio target-librx target-libstdc++ target-libg++" - +target_libs="target-libiberty \ + target-libgloss \ + target-newlib \ + target-libio \ + target-librx \ + target-libstdc++ \ + target-libg++" # these tools are built using the target libs, and are intended to run only # in the target environment @@ -52,7 +71,7 @@ target_libs="target-libiberty target-libgloss target-newlib target-libio target- # list belongs in this list. those programs are also very likely # candidates for the "native_only" list which follows # -target_tools="target-examples target-groff" +target_tools="target-examples target-groff target-gperf" ################################################################################ @@ -64,13 +83,13 @@ target_tools="target-examples target-groff" # directories to be built in the native environment only # -native_only="autoconf cvs emacs emacs19 fileutils find grep gzip hello - indent ispell m4 rcs recode sed shellutils tar textutils gash - uudecode wdiff gprof target-groff" +# This must be a single line because of the way it is searched by grep in +# the code below. +native_only="autoconf automake libtool cvssrc emacs emacs19 fileutils find gawk gettext grep gzip hello indent ispell m4 rcs recode sed shellutils tar textutils gash uudecode wdiff gprof target-groff guile perl apache inet time ash bash bzip2 prms snavigator gnuserv target-gperf" # directories to be built in a cross environment only # -cross_only="target-libiberty target-libgloss target-newlib" +cross_only="target-libgloss target-newlib target-cygmon target-opcodes target-libstub" ## All tools belong in one of the four categories, and are assigned above ## We assign ${configdirs} this way to remove all embedded newlines. This @@ -94,45 +113,132 @@ appdirs="" # Work in distributions that contain no compiler tools, like Autoconf. if [ -d ${srcdir}/config ]; then case "${host}" in - m68k-hp-hpux*) host_makefile_frag=config/mh-hp300 ;; - m68k-apollo-sysv*) host_makefile_frag=config/mh-apollo68 ;; - m68k-apollo-bsd*) host_makefile_frag=config/mh-a68bsd ;; - m68k-*-linux*) host_makefile_frag=config/mh-linux ;; - m88k-dg-dgux*) host_makefile_frag=config/mh-dgux ;; - m88k-harris-cxux*) host_makefile_frag=config/mh-cxux ;; - m88k-motorola-sysv*) host_makefile_frag=config/mh-delta88;; - mips*-dec-ultrix*) host_makefile_frag=config/mh-decstation ;; - mips*-nec-sysv4*) host_makefile_frag=config/mh-necv4 ;; - mips*-sgi-irix[56]*) host_makefile_frag=config/mh-irix5 ;; - mips*-sgi-irix4*) host_makefile_frag=config/mh-irix4 ;; - mips*-sgi-irix3*) host_makefile_frag=config/mh-sysv ;; - mips*-*-sysv4*) host_makefile_frag=config/mh-sysv4 ;; - mips*-*-sysv*) host_makefile_frag=config/mh-riscos ;; - i[345]86-ncr-sysv4.3) host_makefile_frag=config/mh-ncrsvr43 ;; - i[345]86-ncr-sysv4*) host_makefile_frag=config/mh-ncr3000 ;; - i[345]86-*-sco3.2v5*) host_makefile_frag=config/mh-sysv ;; - i[345]86-*-sco*) host_makefile_frag=config/mh-sco ;; - i[345]86-*-isc*) host_makefile_frag=config/mh-sysv ;; - i[345]86-*-linux*) host_makefile_frag=config/mh-linux ;; - i[345]86-*-solaris2*) host_makefile_frag=config/mh-sysv4 ;; - i[345]86-*-aix*) host_makefile_frag=config/mh-aix386 ;; - i[345]86-*-go32*) host_makefile_frag=config/mh-go32 ;; - vax-*-ultrix2*) host_makefile_frag=config/mh-vaxult2 ;; - *-*-solaris2*) host_makefile_frag=config/mh-solaris ;; - m68k-sun-sunos*) host_makefile_frag=config/mh-sun3 ;; - *-hp-hpux[78]*) host_makefile_frag=config/mh-hpux8 ;; - *-hp-hpux*) host_makefile_frag=config/mh-hpux ;; - *-*-hiux*) host_makefile_frag=config/mh-hpux ;; - rs6000-*-lynxos*) host_makefile_frag=config/mh-lynxrs6k ;; - *-*-lynxos*) host_makefile_frag=config/mh-lynxos ;; - *-*-sysv4*) host_makefile_frag=config/mh-sysv4 ;; - *-*-sysv*) host_makefile_frag=config/mh-sysv ;; + m68k-hp-hpux*) + host_makefile_frag="${host_makefile_frag} config/mh-hp300" + ;; + m68k-apollo-sysv*) + host_makefile_frag="${host_makefile_frag} config/mh-apollo68" + ;; + m68k-apollo-bsd*) + host_makefile_frag="${host_makefile_frag} config/mh-a68bsd" + ;; + m88k-dg-dgux*) + host_makefile_frag="${host_makefile_frag} config/mh-dgux" + ;; + m88k-harris-cxux*) + host_makefile_frag="${host_makefile_frag} config/mh-cxux" + ;; + m88k-motorola-sysv*) + host_makefile_frag="${host_makefile_frag} config/mh-delta88" + ;; + mips*-dec-ultrix*) + host_makefile_frag="${host_makefile_frag} config/mh-decstation" + ;; + mips*-nec-sysv4*) + host_makefile_frag="${host_makefile_frag} config/mh-necv4" + ;; + mips*-sgi-irix6*) + host_makefile_frag="${host_makefile_frag} config/mh-irix6" + ;; + mips*-sgi-irix5*) + host_makefile_frag="${host_makefile_frag} config/mh-irix5" + ;; + mips*-sgi-irix4*) + host_makefile_frag="${host_makefile_frag} config/mh-irix4" + ;; + mips*-sgi-irix3*) + host_makefile_frag="${host_makefile_frag} config/mh-sysv" + ;; + mips*-*-sysv4*) + host_makefile_frag="${host_makefile_frag} config/mh-sysv4" + ;; + mips*-*-sysv*) + host_makefile_frag="${host_makefile_frag} config/mh-riscos" + ;; + i[3456]86-*-sysv5*) + host_makefile_frag="${host_makefile_frag} config/mh-sysv5" + ;; + i[3456]86-*-dgux*) + host_makefile_frag="${host_makefile_frag} config/mh-dgux386" + ;; + i[3456]86-ncr-sysv4.3*) + host_makefile_frag="${host_makefile_frag} config/mh-ncrsvr43" + ;; + i[3456]86-ncr-sysv4*) + host_makefile_frag="${host_makefile_frag} config/mh-ncr3000" + ;; + i[3456]86-*-sco3.2v5*) + host_makefile_frag="${host_makefile_frag} config/mh-sysv" + ;; + i[3456]86-*-sco*) + host_makefile_frag="${host_makefile_frag} config/mh-sco" + ;; + i[3456]86-*-udk*) + host_makefile_frag="${host_makefile_frag} config/mh-sysv5" + ;; + i[3456]86-*-isc*) + host_makefile_frag="${host_makefile_frag} config/mh-sysv" + ;; + i[3456]86-*-solaris2*) + host_makefile_frag="${host_makefile_frag} config/mh-sysv4" + ;; + i[3456]86-*-aix*) + host_makefile_frag="${host_makefile_frag} config/mh-aix386" + ;; + i[3456]86-*-go32*) + host_makefile_frag="${host_makefile_frag} config/mh-go32" + ;; + i[3456]86-*-msdosdjgpp*) + host_makefile_frag="${host_makefile_frag} config/mh-go32" + ;; + *-cygwin*) + host_makefile_frag="${host_makefile_frag} config/mh-cygwin" + ;; + *-mingw32*) + host_makefile_frag="${host_makefile_frag} config/mh-mingw32" + ;; + *-windows*) + host_makefile_frag="${host_makefile_frag} config/mh-windows" + ;; + vax-*-ultrix2*) + host_makefile_frag="${host_makefile_frag} config/mh-vaxult2" + ;; + *-*-solaris2*) + host_makefile_frag="${host_makefile_frag} config/mh-solaris" + ;; + m68k-sun-sunos*) + host_makefile_frag="${host_makefile_frag} config/mh-sun3" + ;; + *-hp-hpux[78]*) + host_makefile_frag="${host_makefile_frag} config/mh-hpux8" + ;; + *-hp-hpux*) + host_makefile_frag="${host_makefile_frag} config/mh-hpux" + ;; + *-*-hiux*) + host_makefile_frag="${host_makefile_frag} config/mh-hpux" + ;; + rs6000-*-lynxos*) + host_makefile_frag="${host_makefile_frag} config/mh-lynxrs6k" + ;; + *-*-lynxos*) + host_makefile_frag="${host_makefile_frag} config/mh-lynxos" + ;; + *-*-aix4.[3456789]* | *-*-aix[56789].*) + host_makefile_frag="${host_makefile_frag} config/mh-aix43" + ;; + *-*-sysv4*) + host_makefile_frag="${host_makefile_frag} config/mh-sysv4" + ;; + *-*-sysv*) + host_makefile_frag="${host_makefile_frag} config/mh-sysv" + ;; esac fi # If we aren't going to be using gcc, see if we can extract a definition # of CC from the fragment. -if [ -z "${CC}" -a "${build}" = "${host}" ]; then +if [ -z "${CC}" ] && [ "${build}" = "${host}" ]; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" found= for dir in $PATH; do @@ -143,7 +249,7 @@ if [ -z "${CC}" -a "${build}" = "${host}" ]; then fi done IFS="$save_ifs" - if [ -z "${found}" -a -n "${host_makefile_frag}" -a -f "${srcdir}/${host_makefile_frag}" ]; then + if [ -z "${found}" ] && [ -n "${host_makefile_frag}" ] && [ -f "${srcdir}/${host_makefile_frag}" ]; then xx=`sed -n -e 's/^[ ]*CC[ ]*=[ ]*\(.*\)$/\1/p' < ${srcdir}/${host_makefile_frag}` if [ -n "${xx}" ] ; then CC=$xx @@ -155,37 +261,90 @@ fi # Well, we don't yet, but we will. if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then case "${target}" in - alpha-dec-osf*) enable_shared=yes ;; + alpha*-dec-osf*) enable_shared=yes ;; + alpha*-*-linux*) enable_shared=yes ;; mips-sgi-irix5*) enable_shared=yes ;; *) enable_shared=no ;; esac fi -if [ x${enable_shared} = xyes ]; then - waugh= +case "${enable_shared}" in + yes) shared=yes ;; + no) shared=no ;; + "") shared=no ;; + *) shared=yes ;; +esac + +if [ x${shared} = xyes ]; then case "${host}" in - hppa*) waugh=config/mh-papic ;; - i[345]86-*) waugh=config/mh-x86pic ;; - sparc64-*) waugh=config/mh-sparcpic ;; - *) waugh=config/mh-${host_cpu}pic ;; + hppa*) + host_makefile_frag="${host_makefile_frag} config/mh-papic" + ;; + i[3456]86-*-cygwin*) + # We don't want -fPIC on Cygwin. + ;; + i[3456]86-*) + host_makefile_frag="${host_makefile_frag} config/mh-x86pic" + ;; + sparc64-*) + host_makefile_frag="${host_makefile_frag} config/mh-sparcpic" + ;; + powerpc*-*) + host_makefile_frag="${host_makefile_frag} config/mh-ppcpic" + ;; + alpha*-*-linux*) + host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic" + ;; + *) + if test -f ${srcdir}/config/mh-${host_cpu}pic; then + host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic" + fi + ;; esac - if [ -f ${srcdir}/${waugh} ]; then - if [ -n "${host_makefile_frag}" ] ; then - cat ${srcdir}/${host_makefile_frag} > mh-frag - cat ${srcdir}/${waugh} >> mh-frag - host_makefile_frag=mh-frag - else - host_makefile_frag=${waugh} - fi - fi +fi + +rm -f mh-frag +if [ -n "${host_makefile_frag}" ] ; then + for f in ${host_makefile_frag} + do + cat ${srcdir}/$f >> mh-frag + done + host_makefile_frag=mh-frag fi # per-target: case "${target}" in - v810*) target_makefile_frag=config/mt-v810 ;; - i[345]86-*-netware*) target_makefile_frag=config/mt-netware ;; - powerpc-*-netware*) target_makefile_frag=config/mt-netware ;; + v810*) + target_makefile_frag="${target_makefile_frag} config/mt-v810" + ;; + i[3456]86-*-netware*) + target_makefile_frag="${target_makefile_frag} config/mt-netware" + ;; + powerpc-*-netware*) + target_makefile_frag="${target_makefile_frag} config/mt-netware" + ;; + *-*-linux-gnu) + target_makefile_frag="${target_makefile_frag} config/mt-linux" + ;; +esac + +# If --enable-target-optspace always use -Os instead of -O2 to build +# the target libraries, similarly if it is not specified, use -Os +# on selected platforms. +case "${enable_target_optspace}:${target}" in + yes:*) + target_makefile_frag="${target_makefile_frag} config/mt-ospace" + ;; + # CYGNUS LOCAL d10v, d30v, fr30 + :m32r-* | :d10v-* | :d30v-* | :fr30-*) + target_makefile_frag="${target_makefile_frag} config/mt-ospace" + ;; + no:* | :*) + ;; + *) + echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2 + ;; esac skipdirs= @@ -200,7 +359,7 @@ case ${with_x} in yes | "") # the default value for this tree is that X11 is available ;; no) - skipdirs="${skipdirs} tk gash" + skipdirs="${skipdirs} tk libgui gash" ;; *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 @@ -219,22 +378,25 @@ if [ x"${host}" = x"${target}" ] ; then # that are in the 'cross only' list skipdirs="${skipdirs} ${cross_only}" is_cross_compiler=no - target_subdir=. else # similarly, don't build the targets in the 'native only' # list when building a cross compiler skipdirs="${skipdirs} ${native_only}" is_cross_compiler=yes - target_subdir=${target_alias} - if [ ! -d ${target_subdir} ] ; then - if mkdir ${target_subdir} ; then true - else - echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2 - exit 1 - fi - fi fi +# We always want to use the same name for this directory, so that dejagnu +# can reliably find it. +target_subdir=${target_alias} + +if [ ! -d ${target_subdir} ] ; then + if mkdir ${target_subdir} ; then true + else + echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2 + exit 1 + fi +fi + copy_dirs= # Handle --with-headers=XXX. The contents of the named directory are @@ -287,7 +449,9 @@ fi # Default to using --with-stabs for certain targets. if [ x${with_stabs} = x ]; then case "${target}" in - mips*-*-* | alpha*-*-osf* | i[345]86*-*-sysv4* | i[345]86*-*-unixware*) + mips*-*-irix6*) + ;; + mips*-*-* | alpha*-*-osf*) with_stabs=yes; withoptions="${withoptions} --with-stabs" ;; @@ -309,7 +473,7 @@ while [ $# != 0 ]; do : else echo >config.temp - ${srcdir}/install.sh -c -m 644 config.temp $2/COPIED + ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED fi # Copy the directory, assuming we have tar. @@ -328,8 +492,12 @@ done # Configure extra directories which are host specific case "${host}" in - i[345]86-*-go32*) + i[3456]86-*-go32*) configdirs="$configdirs dosrel" ;; + i[3456]86-*-mingw32*) + configdirs="$configdirs dosrel" ;; + *-cygwin*) + configdirs="$configdirs libtermcap dosrel" ;; esac # Remove more programs from consideration, based on the host or @@ -339,46 +507,132 @@ esac noconfigdirs="" case "${host}" in - i[345]86-*-vsta) - noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff" + i[3456]86-*-vsta) + noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext" ;; - i[345]86-*-go32) - noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff" + i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*) + noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext" + ;; + i[3456]86-*-mingw32*) + # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv" + noconfigdirs="expect dejagnu cvs autoconf automake send-pr gprof rcs guile perl texinfo apache inet libtool" ;; - *-*-cygwin32) - noconfigdirs="patch diff make tk tcl expect dejagnu cvs autoconf texinfo bison send-pr gprof rcs" + *-*-cygwin*) + noconfigdirs="autoconf automake send-pr gprof rcs guile perl texinfo apache inet" + ;; + *-*-windows*) +# This is only used to build WinGDB... +# note that powerpc-eabi depends on sim configured before gdb. + configdirs="bfd libiberty opcodes readline sim gdb" + target_configdirs= + ;; + *-*-netbsd*) + noconfigdirs="rcs" ;; ppc*-*-pe) - noconfigdirs="patch diff make tk tcl expect dejagnu cvs autoconf texinfo bison send-pr gprof rcs" + noconfigdirs="patch diff make tk tcl expect dejagnu cvssrc autoconf automake texinfo bison send-pr gprof rcs guile perl apache inet itcl tix db snavigator gnuserv" ;; esac case "${target}" in *-*-netware) - noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty" + noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss" + ;; + *-*-rtems*) + noconfigdirs="$noconfigdirs target-libgloss" ;; *-*-vxworks*) - noconfigdirs="$noconfigdirs target-newlib" + noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; - alpha-dec-osf*) + alpha*-dec-osf*) # ld works, but does not support shared libraries. emacs doesn't - # work. newlib is not 64 bit ready. I'm not sure about fileutils or grep. + # work. newlib is not 64 bit ready. I'm not sure about fileutils. # gas doesn't generate exception information. - noconfigdirs="$noconfigdirs gas ld emacs fileutils grep target-newlib" + noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss" + ;; + alpha*-*-*vms*) + noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss" + ;; + alpha*-*-linux*) + # newlib is not 64 bit ready + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + # linux has rx in libc + skipdirs="$skipdirs target-librx" ;; alpha*-*-*) # newlib is not 64 bit ready - noconfigdirs="$noconfigdirs target-newlib" + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; + arc-*-*) + noconfigdirs="$noconfigdirs target-libgloss" ;; arm-*-pe*) + noconfigdirs="$noconfigdirs target-libgloss" + ;; + arm-*-coff*) + noconfigdirs="$noconfigdirs target-libgloss" + ;; + arm-*-elf*) + noconfigdirs="$noconfigdirs target-libgloss" + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + fi + ;; + arm-*-oabi*) + noconfigdirs="$noconfigdirs target-libgloss" + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + fi + ;; + c4x-*-*) + noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss" + ;; + thumb-*-coff) + noconfigdirs="$noconfigdirs target-libgloss" + ;; +# CYGNUS LOCAL clm/arm-elf + thumb-*-elf) + noconfigdirs="$noconfigdirs target-libgloss" + ;; + thumb-*-oabi) + noconfigdirs="$noconfigdirs target-libgloss" + ;; +# END CYGNUS LOCAL +# CYGNUS LOCAL nickc/strongarm + strongarm-*-elf) + noconfigdirs="$noconfigdirs target-libgloss" + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + fi + ;; + strongarm-*-coff) + noconfigdirs="$noconfigdirs target-libgloss" + ;; +# END CYGNUS LOCAL + thumb-*-pe) # CYGNUS LOCAL nickc/thumb + noconfigdirs="$noconfigdirs target-libgloss" ;; arm-*-riscix*) - noconfigdirs="$noconfigdirs ld" + noconfigdirs="$noconfigdirs ld target-libgloss" + ;; + d10v-*-*) + noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio target-libgloss" ;; +# CYGNUS LOCAL d30v + d30v-*-*) + ;; +# END CYGNUS LOCAL +# CYGNUS LOCAL fr30 + fr30-*-elf*) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + fi + ;; +# END CYGNUS LOCAL h8300*-*-* | \ h8500-*-*) - noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx" + noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss" ;; hppa*-*-*elf* | \ hppa*-*-lites*) @@ -394,115 +648,198 @@ case "${target}" in esac noconfigdirs="$noconfigdirs ld shellutils" ;; - i[345]86-*-go32) + i[3456]86-*-coff | i[3456]86-*-elf) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-libstub target-cygmon" + fi + ;; + i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*) # but don't build gdb noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx" ;; - *-*-cygwin32) + *-*-linux*) + # linux has rx in libc + skipdirs="$skipdirs target-librx" + ;; + i[3456]86-*-mingw32*) + target_configdirs="$target_configdirs target-mingw" + noconfigdirs="$noconfigdirs expect target-libgloss" - # make/glob's configure uses some AC_TRY_RUN type tests - target_configdirs="$target_configdirs target-winsup" - noconfigdirs="$noconfigdirs tcl tk expect make" + # Can't build gdb for mingw32 if not native. + case "${host}" in + i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc. + *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv" + ;; + esac + ;; + *-*-cygwin*) + target_configdirs="$target_configdirs target-libtermcap target-winsup" + noconfigdirs="$noconfigdirs target-libgloss" # always build newlib. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` - # Can't build gdb for cygwin32 if not native. - case "${host}:${build}" in - *-*-cygwin32 | *-*-cygwin32:*-*-cygwin32) ;; # keep gdb - *) noconfigdirs="$noconfigdirs gdb" + # Can't build gdb for Cygwin if not native. + case "${host}" in + *-*-cygwin*) ;; # keep gdb tcl tk expect etc. + *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv" + ;; esac - ;; - i[345]86-*-pe) - noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx" + i[3456]86-*-pe) + noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss" ;; - i[345]86-*-sco3.2v5*) + i[3456]86-*-sco3.2v5*) # The linker does not yet know about weak symbols in COFF, # and is not configured to handle mixed ELF and COFF. - noconfigdirs="$noconfigdirs gprof ld" + noconfigdirs="$noconfigdirs ld target-libgloss" ;; - i[345]86-*-sco*) - noconfigdirs="$noconfigdirs gprof" + i[3456]86-*-sco*) + noconfigdirs="$noconfigdirs gprof target-libgloss" ;; - i[345]86-*-solaris2*) - # The linker does static linking correctly, but the Solaris C library - # has bugs such that some important functions won't work when statically - # linked. (See man pages for getpwuid, for example.) - noconfigdirs="$noconfigdirs ld" + i[3456]86-*-solaris2*) + noconfigdirs="$noconfigdirs target-libgloss" ;; - i[345]86-*-sysv4*) + i[3456]86-*-sysv4*) # The SYSV4 C compiler doesn't handle Emacs correctly case "${CC}" in "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;; *) ;; esac # but that's okay since emacs doesn't work anyway - noconfigdirs="$noconfigdirs emacs emacs19" + noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss" + ;; + m68k-*-*) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + fi + ;; + mn10200-*-*) + noconfigdirs="$noconfigdirs" + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-libstub target-cygmon" + fi + ;; + mn10300-*-*) + noconfigdirs="$noconfigdirs" + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + fi ;; powerpc-*-aix*) # copied from rs6000-*-* entry - noconfigdirs="$noconfigdirs gprof cvs" + noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss" + # This is needed until gcc and ld are fixed to work together. + use_gnu_ld=no ;; powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe) target_configdirs="$target_configdirs target-winsup" - noconfigdirs="$noconfigdirs gdb tcl tk make expect" + noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv" # always build newlib. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; + # This is temporary until we can link against shared libraries + powerpcle-*-solaris*) + noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv" + ;; + powerpc-*-eabi) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + fi + ;; rs6000-*-lynxos*) # The CVS server code doesn't work on the RS/6000 # Newlib makes problems for libg++ in crosses. - noconfigdirs="$noconfigdirs target-newlib gprof cvs" + noconfigdirs="$noconfigdirs target-newlib gprof cvssrc" + ;; + rs6000-*-aix*) + noconfigdirs="$noconfigdirs gprof" + # This is needed until gcc and ld are fixed to work together. + use_gnu_ld=no ;; rs6000-*-*) noconfigdirs="$noconfigdirs gprof" ;; m68k-apollo-*) - noconfigdirs="$noconfigdirs ld binutils gprof" + noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss" ;; mips*-*-irix5*) # The GNU linker does not support shared libraries. # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work) - noconfigdirs="$noconfigdirs ld gprof emacs" + noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss" + ;; + mips*-*-irix6*) + # The GNU assembler and linker do not support IRIX 6. + # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work) + noconfigdirs="$noconfigdirs ld gas gprof emacs target-libgloss" ;; mips*-dec-bsd*) - noconfigdirs="$noconfigdirs gprof" + noconfigdirs="$noconfigdirs gprof target-libgloss" ;; mips*-*-bsd*) - noconfigdirs="$noconfigdirs gprof" + noconfigdirs="$noconfigdirs gprof target-libgloss" ;; + mipstx39-*-*) + noconfigdirs="$noconfigdirs gprof" # same as generic mips + target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" + ;; mips*-*-*) noconfigdirs="$noconfigdirs gprof" ;; romp-*-*) - noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes" + noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss" ;; sh-*-*) case "${host}" in - i[345]86-*-vsta) ;; # don't add gprof back in - i[345]86-*-go32) ;; # don't add gprof back in + i[3456]86-*-vsta) ;; # don't add gprof back in + i[3456]86-*-go32*) ;; # don't add gprof back in + i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;; esac + noconfigdirs="$noconfigdirs target-libgloss" + ;; + sparc-*-elf*) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-libstub target-cygmon" + fi + ;; + sparc64-*-elf*) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-libstub target-cygmon" + fi + ;; + sparclite-*-*) + if [ x${is_cross_compiler} != xno ] ; then + target_configdirs="${target_configdirs} target-libstub target-cygmon" + fi ;; sparc-*-sunos4*) if [ x${is_cross_compiler} != xno ] ; then - noconfigdirs="$noconfigdirs gdb gdbtest target-newlib" + noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss" else use_gnu_ld=no fi ;; v810-*-*) - noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes" + noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss" + ;; + v850-*-*) + noconfigdirs="$noconfigdirs target-libgloss" + ;; + v850e-*-*) # CYGNUS LOCAL v850e + noconfigdirs="$noconfigdirs target-libgloss" ;; + v850ea-*-*) + noconfigdirs="$noconfigdirs target-libgloss" + ;; # END CYGNUS LOCAL vax-*-vms) - noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes" + noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss" ;; vax-*-*) - noconfigdirs="$noconfigdirs target-newlib" + noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; *-*-lynxos*) # Newlib makes problems for libg++ in crosses. - noconfigdirs="$noconfigdirs target-newlib" + noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; *-*-macos* | \ *-*-mpw*) @@ -511,19 +848,13 @@ case "${target}" in ;; esac -# targets that need a second pass -case "${target}" in - *-gm-magic*) - noconfigdirs="$noconfigdirs libgloss" - ;; +# If we aren't building newlib, then don't build libgloss, since libgloss +# depends upon some newlib header files. +case "${noconfigdirs}" in + *target-libgloss*) ;; + *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;; esac -# If we are building a Canadian Cross, discard tools that can not be built -# using a cross compiler. FIXME: These tools should be fixed. -if [ "${build}" != "${host}" ]; then - noconfigdirs="$noconfigdirs expect dejagnu make texinfo diff" -fi - # Make sure we don't let GNU ld be added if we didn't want it. if [ x$with_gnu_ld = xno ]; then use_gnu_ld=no @@ -587,12 +918,12 @@ fi # Deconfigure all subdirectories, in case we are changing the # configuration from one where a subdirectory is supported to one where it # is not. -if [ -z "${norecursion}" -a -n "${configdirs}" ]; then +if [ -z "${norecursion}" ] && [ -n "${configdirs}" ]; then for i in `echo ${configdirs} | sed -e s/target-//g` ; do rm -f $i/Makefile done fi -if [ -z "${norecursion}" -a -n "${target_configdirs}" ]; then +if [ -z "${norecursion}" ] && [ -n "${target_configdirs}" ]; then for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do rm -f ${target_subdir}/$i/Makefile done @@ -660,14 +991,45 @@ if [ x${use_gnu_ld} = x ] ; then fi fi -if [ x${enable_shared} = xyes ]; then +# If using newlib, add --with-newlib to the withoptions so that gcc/configure +# can detect this case. + +if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then + with_newlib=yes + withoptions="$withoptions --with-newlib" +fi + +if [ x${shared} = xyes ]; then case "${target}" in - hppa*) target_makefile_frag=config/mt-papic ;; - i[345]86-*) target_makefile_frag=config/mt-x86pic ;; - *) target_makefile_frag=config/mt-${target_cpu}pic ;; + hppa*) + target_makefile_frag="${target_makefile_frag} config/mt-papic" + ;; + i[3456]86-*) + target_makefile_frag="${target_makefile_frag} config/mt-x86pic" + ;; + powerpc*-*) + target_makefile_frag="${target_makefile_frag} config/mt-ppcpic" + ;; + alpha*-*-linux*) + target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic" + ;; + *) + if test -f ${srcdir}/config/mt-${target_cpu}pic; then + target_makefile_frag="${target_makefile_frag} config/mt-${target_cpu}pic" + fi + ;; esac fi +rm -f mt-frag +if [ -n "${target_makefile_frag}" ] ; then + for f in ${target_makefile_frag} + do + cat ${srcdir}/$f >> mt-frag + done + target_makefile_frag=mt-frag +fi + # post-target: # Make sure that the compiler is able to generate an executable. If it @@ -676,7 +1038,7 @@ fi # can be created. At this point the main configure script has set CC. echo "int main () { return 0; }" > conftest.c ${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c -if [ $? = 0 ] && [ -s conftest ]; then +if [ $? = 0 ] && [ -s conftest -o -s conftest.exe ]; then : else echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed." @@ -689,7 +1051,8 @@ rm -f conftest* # The Solaris /usr/ucb/cc compiler does not appear to work. case "${host}" in sparc-sun-solaris2*) - if [ "`/usr/bin/which ${CC-cc}`" = "/usr/ucb/cc" ] ; then + CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`" + if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then could_use= [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin" if [ -d /opt/cygnus/bin ] ; then @@ -715,7 +1078,7 @@ esac # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the # binutils tools will find libbfd.so. -if [ "${enable_shared}" = "yes" ]; then +if [ "${shared}" = "yes" ]; then sed -e 's/^SET_LIB_PATH[ ]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \ Makefile > Makefile.tem rm -f Makefile @@ -723,7 +1086,7 @@ if [ "${enable_shared}" = "yes" ]; then case "${host}" in *-*-hpux*) - sed -e 's/RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \ + sed -e 's/^RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \ Makefile > Makefile.tem rm -f Makefile mv -f Makefile.tem Makefile @@ -734,9 +1097,10 @@ fi # Record target_configdirs and the configure arguments in Makefile. target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` targargs=`echo "${arguments}" | \ - sed -e 's/--norecursion//' \ + sed -e 's/--no[^ ]*//' \ -e 's/--cache[a-z-]*=[^ ]*//' \ -e 's/--ho[a-z-]*=[^ ]*//' \ + -e 's/--bu[a-z-]*=[^ ]*//' \ -e 's/--ta[a-z-]*=[^ ]*//'` # Passing a --with-cross-host argument lets the target libraries know @@ -748,7 +1112,18 @@ if [ x${is_cross_compiler} = xyes ]; then targargs="--with-cross-host=${host_alias} ${targargs}" fi -targargs="--host=${target_alias} ${targargs}" +# Default to --enable-multilib. +if [ x${enable_multilib} = x ]; then + targargs="--enable-multilib ${targargs}" +fi + +# Pass --with-newlib if appropriate. Note that target_configdirs has +# changed from the earlier setting of with_newlib. +if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then + targargs="--with-newlib ${targargs}" +fi + +targargs="--host=${target_alias} --build=${build_alias} ${targargs}" sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \ -e "s%^CONFIG_ARGUMENTS[ ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \ -e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \ diff --git a/contrib/gdb/gdb/COPYING b/contrib/gdb/gdb/COPYING index a43ea21..60549be 100644 --- a/contrib/gdb/gdb/COPYING +++ b/contrib/gdb/gdb/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + 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. @@ -279,7 +279,7 @@ POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -305,7 +305,8 @@ the "copyright" line and a pointer to where the full notice is found. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Also add information on how to contact you by electronic and paper mail. diff --git a/contrib/gdb/gdb/ChangeLog b/contrib/gdb/gdb/ChangeLog index 0ee1d9c..0ae5117 100644 --- a/contrib/gdb/gdb/ChangeLog +++ b/contrib/gdb/gdb/ChangeLog @@ -1,1414 +1,1115 @@ -Mon Apr 22 20:17:01 1996 Fred Fish - - * Makefile.in (VERSION): Bump version number to 4.16 - * NEWS: Update for 4.16 release. - -Fri Apr 12 21:39:42 1996 Fred Fish - - * Makefile.in (VERSION): Bump version to 4.15.86 - * README: Update for 4.16 release. - * configure.in (AC_CHECK_FUNCS): Also check for sbrk. - * configure: Regenerate with autoconf. - * config.in: Regenerate with autoheader. - * main.c (main): Only use sbrk() when HAVE_SBRK is defined. - * top.c (command_loop): Ditto. - -Thu Apr 11 17:51:58 1996 Fred Fish - - From: Miles Bader - * configure.in (AC_CHECK_HEADERS): check for endian.h. - Use AC_CHECK_TOOL to find AR & RANLIB. Add AC_PROG_AWK. - Add host & target cases for i[345]86-*-gnu*. - * config.in: Regenerate with autoheader. - * configure: Regenerate with autoconf. - * Makefile.in (AR, AWK): Set from corresponding autoconf substs. - (init.c): Don't scan mig-generated files. - * defs.h (endian.h): Include if HAVE_ENDIAN_H defined. - * config/nm-m3.h (ATTACH_NO_WAIT): Define. - * infcmd.c (attach_command): Use "#ifndef ATTACH_NO_WAIT" - rather than "#ifndef MACH". - -Mon Apr 8 12:53:56 1996 Fred Fish - - * Makefile.in (scm-exp.o, scm-lang.o, scm-valprint.o): Add targets and - dependencies. - * scm-lang.c (gdb_string.h): Include. - * objfiles.c (add_to_objfile_sections): Cast second arg of obstack_grow - call to correct type (char *). - * cp-valprint.c (cp_print_static_field): Ditto. - * somsolib.c (som_solib_create_inferior_hook): Add a declaration - for external find_unwind_entry function (from hppa-tdep.c). - * remote-pa.c (remote_write_bytes, remote_read_bytes): Change - type of second arg to "char *" to be type compatible with - dcache. - (remote_wait): Cast second arg to strtol to correct type. - * hppa-tdep.c (compare_unwind_entries): Change argument types to - "const void *" to be type compatible with qsort, and then - assign to local args prior to use. - -Sun Apr 7 22:34:29 1996 Fred Fish - - From: Miles Bader - * gnu-nat.c, gnu-nat.h, msg.defs, exc_request.defs, i386gnu-nat.c, - msg_reply.defs, notify.defs, process_reply.defs, reply_mig_hack.awk, - config/nm-gnu.h, config/i386/{i386gnu.mh, i386gnu.mt, nm-gnu.h, - m-i386gnu.h, xm-i386gnu.h}: New files for GNU hurd. - -Sun Apr 7 13:32:41 1996 Fred Fish - - * configure.in (case host): Add i386sco5 host. - * configure: Regenerate. - - From: Robert Lipe - Add support for SCO OpenServer 5 (a.k.a. 3.2v5*) This - target is an SVR3.2 with COFF, ELF, and shared libes, but - no /proc. - * config/i386/i386sco5.mh: New file. - * config/i386/nm-i386sco5.h: New file. - -Sat Apr 6 08:55:22 1996 Fred Fish - - * bcache.c (bcache): When size of chunk to cache is exactly equal to - BCACHE_MAXLENGTH, stash chunk as unique copy. - -Sat Apr 6 00:46:26 1996 Fred Fish - - * symfile.c (INLINE_ADD_PSYMBOL): Remove ifdef. - (add_psymbol_to_list): Add an arg for passing CORE_ADDR values and - use it, rather than calling add_psymbol_addr_to_list. - (add_psymbol_addr_to_list): Delete. - (add_psymbol_to_list): Make psymbol static to avoid random data in - gaps due to alignment of structure members. - * symfile.h (INLINE_ADD_PSYMBOL, ADD_PSYMBOL_TO_LIST, - ADD_PSYMBOL_ADDR_TO_LIST): Remove. Real world tests show no - performance improvements by inlining via complicated macros and - they just make gdb larger and harder to maintain. - * dwarfread.c (add_enum_psymbol): Replace ADD_PSYMBOL_TO_LIST - and/or ADD_PSYMBOL_ADDR_TO_LIST macro(s) with call to - add_psymbol_to_list with appropriate long or CORE_ADDR args. - (add_partial_symbol): Ditto. - * partial-stab.h: Ditto. - * os9kread.c (read_os9k_psymtab): Ditto - * mdebugread.c (parse_partial_symbols): Ditto. - (handle_psymbol_enumerators): Ditto. - (demangle.h): Include. - * hpread.c (hpread_build_psymtabs): Ditto. - (hpread_build_psymtabs): Ditto. - (demangle.h): Include - -Thu Apr 4 17:59:58 1996 Fred Fish - - * configure.in: Check for setpgid function. - * config.in: Regenerate with autoheader. - * configure: Regenerate with autoconf. - * inflow.c (_initialize_inflow): Only try to use _SC_JOB_CONTROL - if it is actually defined. - (gdb_setpgid): Use HAVE_SETPGID. - * ch-exp.c: Change include of to "gdb_string.h". - * c-exp.y: Ditto. - * f-exp.y: Ditto. - * m2-exp.y: Ditto. - * c-exp.y: Include . - * serial.c: Ditto. - * config/m68k/nm-news.h: Add typedef for pid_t which is - apparently missing from . Enclose entire - file in NM_NEWS_H ifndef and define when included. - * config/mips/nm-news-mips.h: Ditto. - * config/m68k/tm-m68k.h (REGISTER_CONVERT_TO_VIRTUAL, - REGISTER_CONVERT_TO_RAW): Change name of temporary variable. - -Thu Apr 4 17:17:53 1996 Fred Fish - - * symmisc.c (print_objfile_statistics): Print memory used by - psymbol cache obstack. - -Mon Apr 1 16:31:00 1996 Stan Shebs - - * mpw-make.sed: Change references to config.h to be in objdir, - edit out rules to rebuild config.h. - -Mon Apr 1 08:32:23 1996 Fred Fish - - * hppa-tdep.c (hppa_pop_frame): Call clear_proceed_status before - proceeding. - -Sun Mar 31 16:15:43 1996 Fred Fish - - * hppah-nat.c (store_inferior_registers, store_inferior_registers, - fetch_register, child_xfer_memory): Use call_ptrace function supplied - by infptrace.c rather than calling ptrace directly. - -Sat Mar 30 11:00:22 1996 Fred Fish - - * configure.in: Check whether printf family supports printing - long doubles or not and define PRINTF_HAS_LONG_DOUBLE if so. - * acconfig.h: Provide default undef for PRINTF_HAS_LONG_DOUBLE. - * configure: Regenerate. - * valprint.c (print_floating): Use PRINTF_HAS_LONG_DOUBLE. - * c-exp.y (parse_number): Use PRINTF_HAS_LONG_DOUBLE. - * configure.in: Fix have_gregset and have_fpregset autoconf - variable names so that they match the pattern required to - cache them. - -Fri Mar 29 21:53:14 1996 Fred Fish - - * core-aout.c (fetch_core_registers): Cast core_reg_size to int - before testing against reg_ptr. - * eval.c (evaluate_subexp_standard): Cast type of - TYPE_FN_FIELD_VOFFSET to int. - * findvar.c (extract_signed_integer, extract_unsigned_integer, - extract_long_unsigned_integer): Cast type of sizeof to int. - * values.c (unpack_field_as_long, modify_field): Ditto. - * valops.c (value_assign, call_function_by_hand): Ditto. - * infcmd.c (do_registers_info): Ditto. - * ser-tcp.c (tcp_open): Ditto - * remote.c (putpkt): Ditto. - * dcache.c (dcache_peek): Ditto. - * dcache.c (dcache_poke): Ditto. - * m2-exp.y (yylex): Ditto. - * gnu-regex.c (re_match_2): Ditto. - * f-lang.c (ADD_BF_SYMNUM, saved_bf_list_end, tmp_bf_ptr): Ifdef - out unused macro definition and variables. - * inftarg.c (proc_wait): Move from main.c to here, and make static. - * valprint.c (val_print_string): Change bufsize from int to unsigned. - * main.c (wait.h): Include - * top.c (command_line_input): Remove unused variable "c". - * f-typeprint.c (f_type_print_varspec_prefix): Add missing enum - value TYPE_CODE_TYPEDEF to switch statement. - (f_type_print_varspec_suffix): Add missing enum value - TYPE_CODE_TYPEDEF to switch statement. - * ch-exp.c (parse_primval): Add remaining enumeration values to - switch statement, with no specific action. - (ch_lex): Add LOC_UNRESOLVED in switch statement. - (pushback_token): Ifdef out, since code using it is ifdef'd out. - * stabsread.c (cleanup_undefined_types): Remove unused label - "badtype". - * objfiles.h (print_symbol_bcache_statistics): Add prototype. - * maint.c (objfiles.h): Include. - (maintenance_print_statistics): Remove unused variable "temp". - * minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove - unused variable "found_file_symbol". - * m2-exp.y (yylex): Add LOC_UNRESOLVED case to switch. - * language.c (lang_bool_type): Use existing function local type - variable rather than create block local variables. - * solib.c (disable_break): Enclose in ifndef SVR4_SHARED_LIBS. - * infptrace.c (wait.h, command.h): Include. - * ser-tcp.c (gdb_string.h): Include - * i386-tdep.c (codestream_seek): Change "place" to CORE_ADDR. - (i386_get_frame_setup): Change "pc" from int to CORE_ADDR. - * command.c (complete_on_enum): Make assignment used as truth value - explictly check against NULL. - (wait.h): Include. - * infrun.c (wait_for_inferior): Ifdef out prologue_pc since code - that uses it is ifdef'd out. - * parser-defs.h: Add prototype for write_dollar_variable. - * infrun.c: Add prototype for write_pc_pid. - * breakpoint.h: Add prototype for re_enable_breakpoints_in_shlibs. - * symmisc.c (bcache.h): Include. - * bcache.h: Add prototype for print_bcache_statistics. - * symfile.c: Include . - * printcmd.c (print_scalar_formatted): Change len to unsigned int. - * valarith.c (value_equal): Cast result of TYPE_LENGTH to int. - * valarith.c (value_binop): Change result_len, promoted_len1, - and promoted_len2 to unsigned int. - * valarith.c (value_subscripted_rvalue): Change elt_offs and - elt_size to unsigned int. - * valops.c (value_array): Change typelength to unsigned int. - (destructor_name_p): Change len to unsigned int. - * scm-lang.h (scm_parse): Add prototype for scm_unpack. - * symfile.c (decrement_reading_symtab): Change return type to void. - * valarith.c (value_subscript): Remove unused variable "word". - (value_subscript): Remove unused variable "tint". - * valops.c (auto_abandon): Ifdef out, since code using it is also - ifdef'd out. - * eval.c (init_array_element): Remove unused variable "val". - * Makefile.in (values.o): Depends on scm-lang.h. - (command.o): Depends upon wait_h. - (ser-tcp.o): Depends upon gdb_string.h. - (infptrace.o): Depends upon wait_h and command_h. - (maint.o): Depends on objfiles.h and symfile.h. - * values.c (allocate_repeat_value): Remove unused variable - "element_type". - (scm-lang.h): Include. - * breakpoint.c (create_longjmp_breakpoint): Enclose in - GET_LONGJMP_TARGET define, unused otherwise. - * config/i386/nm-linux.h: Add prototypes for i386_insert_watchpoint, - i386_remove_watchpoint and i386_stopped_by_watchpoint. - -Thu Mar 28 06:51:26 1996 Fred Fish +1999-04-07 Jim Blandy + + * GDB 4.18 released. - * valops.c (value_assign): Make copy of internal variable value - before returning it as a new value, since it is owned by the - internal variable and will be freed along with it. +1999-04-06 Jim Blandy -Wed Mar 27 12:54:55 1996 Fred Fish + * README: Change revision numbers in text to "4.18". + * Makefile.in (VERSION): Set to 4.18. - From Peter Schauer - * breakpoint.c (breakpoint_re_set_one): Keep temporary - breakpoints bp_until, bp_finish, bp_watchpoint_cope, bp_call_dummy - and bp_step_resume in case breakpoint_re_set_one is called due - to a step over a dlopen call. - * infrun.c (wait_for_inferior): Always remove breakpoints from - inferior in BPSTAT_WHAT_CHECK_SHLIBS case. +1999-04-06 Stan Shebs + + * solib.c (clear_solib): Don't call disable_breakpoints_in_shlibs, + this breaks rerunning on sun4 native. + +1999-04-05 Stan Shebs + + * NEWS: Incorporate suggestions from David Taylor and Jason Molenda. -Tue Mar 26 13:15:32 1996 Fred Fish +1999-04-02 Jim Blandy - * Makefile.in (VERSION): Bump version to 4.15.85 + * README: Note that GDB requires an ANSI C compiler, and explain + how to get GCC. - * config/mips/tm-mips.h (COERCE_FLOAT_TO_DOUBLE): Only prefer - non-prototyped case over prototyped case for C. - * config/pa/tm-hppa.h (COERCE_FLOAT_TO_DOUBLE): Ditto. + * README: Update. + It says we provide HTML documentation, but we don't. + The instructions for building the .info files were wrong. + It didn't mention that texinfo.tex was provided with GDB. + It didn't mention the intl, texinfo, etc, or util directories. + (Perhaps util would be best left unmentioned.) + It didn't mention the --enable-build-warnings flag, or the --host + flag. + It didn't mention remote-array.c or remote-d10v.c. + It had an old address for reporting bugs. It's now gdb@gnu.org. + It mentioned xxgdb, which is obsolete, but didn't mention DDD. -Sat Mar 23 15:50:47 1996 Fred Fish + * config/sparc/nm-linux.h: Don't redefine PT_ATTACH to use the + deprecated PTRACE_SUNATTACH compatibility commands. The + definitions from are fine. - * os9kread.c (os9k_process_one_symbol): Note nonportable - assumption that an int can hold a char *. +1999-04-01 Stan Shebs - * bcache.h (struct hashlink): Wrap data[] inside union with - double to force longest alignment. - (BCACHE_DATA): New macro to access data[]. - (BCACHE_ALIGNMENT): New macro to get offset to data[]. - * bcache.c (lookup_cache, bcache): Use BCACHE_DATA to get - address of cached data. Use BCACHE_ALIGNMENT to compute - amount of space to allocate for each hashlink struct. + * NEWS: Add more notes about user-visible changes. -Sat Mar 23 12:14:02 1996 Fred Fish +1999-04-01 Jim Blandy - * ch-lang.c (evaluate_subexp_chill): Fix typo. + Fix for cross-debugging on an AIX host from Johanna Svenningsson: + * ax-gdb.h (enum axs_lvalue_kind): Remove trailing comma from enum. + * ax.h (enum agent_op, enum agent_flaws): Same. + * tracepoint.h (enum actionline_type): Same. + * config/xm-aix4.h: Add declaration for termdef. -Thu Mar 21 08:27:19 1996 Fred Fish +1999-03-31 Stan Shebs - * Makefile.in (VERSION): Bump version to 4.15.3 + * jv-lang.h (dynamics_objfile): Remove decl, conflicts with static + decl in jv-lang.c. -Thu Mar 21 10:56:41 1996 Ian Lance Taylor +1999-03-31 Jim Blandy - * config.in: Rename from config.h.in. - * configure.in: Call AC_CONFIG_HEADER with config.h:config.in. - Change CONFIG_HEADERS test in AC_OUTPUT accordingly. - * configure: Rebuild. - * Makefile.in (stamp-h): Depend upon config.in, not config.h.in. - Set CONFIG_HEADERS to config.h:config.in. + Mon Mar 29 14:40:44 1999 David Taylor -Tue Mar 19 12:47:51 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + * valops.c (search_struct_field): revert HP merge change + to this function -- it causes messages to be printed about + member class ambiguity when the compiler is happy. + (search_struct_field_aux): delete -- added as part of HP merge + change; with aforementioned change it is no longer called. - * partial-stab.h (case N_ENDM): Finish current partial symbol - table for Solaris 2 cc. +1999-03-26 Jim Blandy -Tue Mar 19 10:39:15 1996 Jeffrey A Law (law@cygnus.com) + Merged change from Keith Seitz: + + 1999-03-16 Keith Seitz - * rs6000-nat.c (exec_one_dummy_insn): Don't clobber the - PC in the registers array. From Peter Schauer. + * remote.c (reomte_binary_checked): New file global. + (check_binary_download): New function to check if + stub supports binary downloading that works with + stubs that are not eight bit clean. + (remote_write_bytes): Check for binary download capability + and use it if available. + Remove references to global remote_binary_length. What a hack. + (putpkt_binary): New function. + (putpkt): Call putpkt_binary. + Use xor to escape trouble characters. + * m32r-stub.c (bin2mem): Follow escape char convention change. -Mon Mar 18 13:47:09 1996 Fred Fish + Applied patch from Stu Grossman: - * symfile.c (reread_symbols): Reinitialize bcache struct - members to zero using memset. Also use memset to reinit - global_psymbols and static_psymbols, rather than explicitly - resetting each structure member. + Mon Feb 22 12:32:19 1999 Per Bothner -Sat Mar 16 19:47:36 1996 Fred Fish + * jv-valprint.c (java_val_print): Restore line that somehow got lost. - * configure.in: Add fragment to create stamp-h. - - From Peter Schauer - * configure.in (AC_CHECK_HEADERS): Check for link.h. - * configure: Regenerate with autoconf. - * config.h.in: Regenerate with autoheader. - * config/i386/nm-linux.h: Include solib.h only if HAVE_LINK_H - is defined. - * solib.c: Exclude most of the code if HAVE_LINK_H is not defined. - * config/i386/linux.mh: Reinstate XM_CLIBS, it is needed for - older a.out based systems. - -Sat Mar 16 16:45:43 1996 Fred Fish - - * config.h.in: New file. - * acconfig.h: New file, for autoheader. - * configure.in (AC_CONFIG_HEADER): Add, generate config.h. - * configure: Regenerate. - * Makefile.in (defs_h): Add config.h - (distclean): Remove config.h and stamp-h during distclean. - (config.h, stamp-h): New targets to remake config.h when necessary. - * defs.h (config.h): Include before any other includes or defines. - * i386-tdep.c (gdb_string.h): Move include after include of defs.h. - * i386v4-nat.c (defs.h): Include before testing HAVE_SYS_PROCFS_H. +1999-03-24 Stan Shebs -Sat Mar 16 14:55:27 1996 Fred Fish + * Makefile (VERSION): Bump to 4.17.87. - From Peter Schauer - * Makefile.in (INSTALLED_LIBS): Make sure that @LIBS@ will not - result in an empty line, to work around a bug in native Ultrix 4.4 - and OSF/1-3.2C make. + Attempt to sort out SCO-related configs. + * configure.host (i[3456]86-*-sysv4.2*): Use instead of + i[3456]86-*-sysv4.2MP and i[3456]86-*-sysv4.2uw2*. + (i[3456]86-*-sysv5*): Recognize. + * configure.tgt (i[3456]86-*-sco3.2v5*, i[3456]86-*-sco3.2v4*): + Recognize. -Sat Mar 16 13:33:17 1996 Fred Fish +Wed Mar 24 01:01:27 1999 Andrew Cagney - * configure.in: Add gdbserver to configdirs under linux. - * configure: Regenerate. + * rs6000-tdep.c (rs6000_software_single_step): Change SIGNAL to + unsigned int. + + From Rodney Brown : + * target.h (enum thread_control_capabilities), breakpoint.h (enum + bptype), breakpoint.c (enum insertion_state_t): Strict ISO-C + doesn't allow trailing comma in enum definition. -Fri Mar 15 12:06:58 1996 J.T. Conklin - - * config/i386/nm-nbsd.h (FLOAT_INFO): Comment out. - * config/i386/tm-nbsd.h (NUM_REGS): Define. - -Thu Mar 14 10:31:18 1996 Jeffrey A Law (law@cygnus.com) - - * solib.c (solib_break_names): Add _r_debug_state for - vanilla SVR4 implementations. From Peter Schauer. - -Mon Mar 11 14:24:57 1996 Dawn Perchik - - * mon960-rom.c: New file; support mon960 rom monitor on i960. - * monitor.c (monitor_debug): Change remotedebug to buffer strings. - * monitor.c (monitor_open): Add test for flag MO_NO_ECHO_ON_OPEN before - epecting prompt and echo during open. - * monitor.c (monitor_stop): Add test for flag MO_SEND_BREAK_ON_OPEN to - determine if break should be sent as stop command. - * monitor.h: Add flags MO_NO_ECHO_ON_OPEN and MO_SEND_BREAK_ON_OPEN. - * i960-tdep.c (mon960_frame_chain_valid): New function for getting - stack frame on mon960. - * Makefile.in: Add mon960 files. - * configure.in: Changed i960-*-coff* and i960-*-elf* to target mon960; - added i960-nindy-coff* and i960-nindy-elf* for target nindy. +1999-03-23 Jason Molenda (jsm@bugshack.cygnus.com) + + * hppa-tdep.c (pa_register_look_aside): Remove CPU_HPPA_RISC_20 + check, test for presence of struct save_state_t and the ss_wide + member directly. + * configure.in: Remove CPU_HPPA_RISC_20 test. Add tests for + HAVE_STRUCT_SAVE_STATE_T and HAVE_STRUCT_MEMBER_SS_WIDE. + * acconfig.h: Add HAVE_STRUCT_SAVE_STATE_T HAVE_STRUCT_MEMBER_SS_WIDE. + * configure, config.in: Regenerated. + +Tue Mar 23 17:22:57 1999 Philippe De Muyter + + * remote.c, parse.c: Include ctype.h. + +Mon Mar 22 13:25:13 1999 Michael Snyder + + * infttrace.c (proc_wait): rename to ptrace_wait. + +1999-03-17 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in (HAVE_MULTIPLE_PROC_FDS): Don't define for Solaris + hosts--gdb doesn't support this yet. * configure: Regenerated. - * config/i960/mon960.mt, config/i960/tm-mon960.h: New files; - support mon960 rom monitor on i960. - -Mon Mar 11 11:02:47 1996 Steve Chamberlain - - With Michael Snyder: - * i386-tdep.c (skip_trampoline_code): Fix strncmp length. - * win32-nat.c (CHECK, DEBUG*, debug_*): New. - (handle_load_dll): Don't reload symbols. - (handle_exception): Use the DEBUG_* names. - (child_wait): Add DEBUG_* code. - (_initialize_inftarg): Add new commands to set debug_ names. - -Mon Mar 11 09:19:58 1996 Jeffrey A Law (law@cygnus.com) - - * From Peter Schauer: - * breakpoint.c (insert_breakpoints): Use ALL_BREAKPOINTS_SAFE. - (bpstat_stop_status): Likewise. - (remove_solib_event_breakpoints): Likewise. - (clear_momentary_breakpoints): Likewise. - (re_enable_breakpoints_in_shlibs): Don't reenable a breakpoint - if we still can't read the memory for that breakpoint. - (mention): Add bp_shlib_event case to keep gcc quiet. + +Tue Mar 16 01:11:33 1999 Andrew Cagney + + * target.h (struct target_ops), target.c (debug_to_query), + remote.c (pack_hex_byte, remote_query): Promote char parameters to + int. Stops compile problems with pedantic ISO-C compilers. + +Tue Mar 16 15:29:04 1999 Stan Shebs + + * jv-lang.c, jv-lang.h (java_primitive_type): Declare argument + as int instead of char. + +1999-03-15 Jim Blandy + + Merged changes for binary downloads from Michael Snyder: -Fri Mar 8 12:08:12 1996 Jeffrey A Law (law@cygnus.com) + Fri Mar 12 13:11:48 1999 Michael Snyder - * breakpoint.h (enum enable): New enum shlib_disabled for - shared library breakpoints that have been temporarily disabled. - * breakpoint.c: Handle temporarily disabled shared library - breakpoints like disabled breakpoints in most places. - (insert_breakpoints): Use shlib_disabled to indicate - that an unsettable breakpoint is only temporarily disabled. - (re_enable_breakpoints_in_shlibs): New function. - * corelow.c (solib_add_stub): After adding shared libraries, - try to reenable any temporarily disabled breakpoints. - * infcmd.c (attach_command): Likewise. - * infrun.c (wait_for_inferior): Likewise. + * remote.c (remote_write_bytes): fix 'X' packet protocol so that it + can't overwrite the end of its buffer with escaped characters. -Fri Mar 8 11:41:25 1996 Ian Lance Taylor +1999-03-12 Jim Blandy - * defs.h (extract_long_unsigned_integer): Declare. - * findvar.c (extract_long_unsigned_integer): New function. - * printcmd.c (print_scalar_formatted): Use it. - * valprint.c (val_print_type_code_int): Likewise. + Merged changes for HP/UX 9 from Jason Molenda: -Thu Mar 7 17:40:50 1996 Stan Shebs + 1999-03-08 Jason Molenda (jsm@bugshack.cygnus.com) - * infcmd.c (do_registers_info): Ignore anonymous registers. - * sh-tdep.c (set processor): New command to set specific - processor type. - (sh_reg_names, sh3_reg_names): Arrays of register names for - SH and SH3 processors. - (sh_set_processor_type): New function. - * sh3-rom.c (sh3_open): Call it. - (sh3_regname): Add names of all the bank registers. - (sh3_supply_register): Clean up formatting. - * config/sh/tm-sh.h (NUM_REGS, NUM_REALREGS): Increase to include - bank registers. - (REGISTER_NAMES): Add names of bank registers. - (FP15_REGNUM): Define. - (REGISTER_VIRTUAL_TYPE): Use it. - * monitor.c: Clean up some comments. + * infttrace.c (hppa_get_process_events): Removed. Function only + usable on HPUX 10 and above. It is not called by any other part + of GDB. + * hppah-nat.c (hppa_get_process_events): Ditto. + (child_pid_to_exec_file): Only call ptrace with PT_GET_PROCESS_PATHNAME + if that symbol has been defined. + * config/pa/nm-hppah.h: Don't set up prototypes et al for + hppa_get_process_events. -Thu Mar 7 12:09:51 1996 J.T. Conklin + * config/pa/hppahpux.mh (TERM_LIB): Do not initialize, let autoconf + determine best library automatically. + * config/pa/hpux1020.mh: Ditto. + * config/pa/hpux1100.mh: Ditto. + * configure.in (TERM_LIB): Also check for libHcurses. + * configure: Regenerated. - * i386b-nat.c: Revert part of Mar 5 change. FreeBSD collapsed the - s* and t* symbols too. + Merged changes to accomodate the Hurd: + + Thu Mar 11 18:05:11 1999 Michael Snyder -Thu Mar 7 15:18:51 1996 James G. Smith + * infptrace.c (proc_wait): Rename to ptrace_wait. + * inftarg.c (child_wait): call ptrace_wait instead of proc_wait. + * inferior.h: Declare ptrace_wait instead of proc_wait. - * symfile.c (generic_load): Avoid division by zero. +1999-03-11 Jim Blandy -Wed Mar 6 17:57:59 1996 Jeffrey A Law (law@cygnus.com) + * Makefile.in (VERSION): click to 4.17.86, for next snapshot. - * breakpoint.c (bfd_lookup_symbol): Provide for all SVR4 systems, - not just those with HANDLE_SVR4_EXEC_EMULATORS. +1999-03-09 Rodney Brown - From Peter Schauer: - * breakpoint.c (internal_breakpoint_number): Move to file scope. - (create_solib_event_breakpoint): Use an internal breakpoint number. + Get working on UnixWare 2.1.1. + * acconfig.h: Update for defines for procfs.c. + * configure.in: Identify defines for procfs.c. + * configure.host: i386-*-sysv4.2uw2* => i386v42mp + * configure.tgt: i386-*-sysv4.2uw2* => i386v42mp + * configure, config.in: Regenerate. + * procfs.c: Rename HAVE_NO_PRRUN_T to HAVE_PRRUN_T (autoconf + standard), wrap UNIXWARE difference in THE_PR_LWP macro for + legibility. + * config/i386/tm-i386v42mp.h: Remove HAVE_PSTATUS_T, + HAVE_NO_PRRUN_T; now set by configure. -Wed Mar 6 00:32:44 1996 Wilfried Moser (Alcatel) +1999-03-04 Jim Blandy - * valarith.c (value_in): Change builtin_type_chill_bool to - LA_BOOL_TYPE. + Merged changes from Jason Molenda: + + 1999-02-24 Jason Molenda (jsm@bugshack.cygnus.com) -Tue Mar 5 23:48:36 1996 Wilfried Moser (Alcatel) + * configure.in: Set CPU_HPPA_RISC_20 if the host CPU is a PA 2.0 + processor. + * acconfig.h: Add CPU_HPPA_RISC_20 + * config.in, configure: Regenerated. + * hppa-tdep.c (pa_register_look_aside): Only refer to new + structure elements if we are on a PA2.0 system. + * defs.h: Include limits.h. - * ch-exp.c (parse_primval): Handle CARD, MAX, MIN. - (match_string_literal): Handle control sequence. - (match_character_literal): Deto. + Merged changes from Stu Grossman: + + Wed Feb 17 10:10:27 1999 Stu Grossman - * ch-lang.c (chill_printchar): Change formating of nonprintable - characters from C'xx' to ^(num). - (chill_printstr): Deto. - (value_chill_card, value_chill_max_min): New functions to process - Chill's CARD, MAX, MIN. - (evaluate_subexp_chill): Process UNOP_CARD, UNOP_CHMAX, UNOP_CHMIN. + * gdbtypes.h (get_discrete_bounds): Remove duplicate decl. - * expression.h (exp_opcode): Add UNOP_CARD, UNOP_CHMAX, UNOP_CHMIN - for Chill's CARD, MAX, MIN. + * jv-typeprint.c (java_type_print_base): Change fputs => fputs_filtered. + + Mon Jan 25 18:30:57 1999 Per Bothner + + * jv-lang.h (JAVA_OBJECT_SIZE): Change from hard-wired constant. + (java_primitive_type_from_name, get_java_object_header_size): Declare. + * jv-lang.c (java_class_from_object): Use get_java_object_type. + * jv-lang.c: Update Class field names: dtable->vtable, + msize->method_count, nfields->field_count, bfsize->size_in_bytes, + nmethods->method_count. + (type_from_class): Demangle array type names. + (java_link_class_type): Array type names are now demangled. + (get_java_object_type): If not defined yet, try looking it up. + (get_java_object_header_size): New function. + (java_primitive_type_from_name): New function. + (java_demangled_signature_length, java_demangled_signature_copy): New. + (java_demangle_type_signature): Re-implement using above functions. + (evaluate_subexp_java): For UNOP_IND, call evaluate_subexp_java + to evaluate subexp (not evaluate_subexp_standard). + For BINOP_SUBSCRIPT update for new array type naming scheme. + * jv-valprint.c (java_value_print): Use java_class_from_object. + Update array printing to new array type naming convention. + (java_val_print): Doing check_typedef when printing a pointer is + is a waste of effort. Also, handle TYPE_CODE_INT, to make sure + Java bytes as not printed as C chars. + + Fri Jan 8 16:58:22 1999 Stu Grossman + + * blockframe.c (find_pc_sect_partial_function): Search full symtabs as + a last ditch effort (after the partial & minimal symtabs). + * defs.h utils.c: Fixup prototypes for vprintf_filtered, + vfprintf_filtered, vfprintf_unfiltered and vprintf_unfiltered to return + ints to match their standard equivalents. + * defs.h symtab.c top.c: Create skip_prologue_hook to allow Java to + control the prologue skipping process. + * jv-typeprint.c (java_type_print_base): Remove extern for + jv_class_demangle, add new arg for objfile (NULL). + * symtab.h: Remove struct sourcevector and struct source. Definately + not needed. + * values.c (value_virtual_fn_field): Fixes code to handle new vtable + debug info format. Patch from marka. + + Wed Dec 16 23:11:25 1998 Stu Grossman - * valarith.c (value_in): Add processing of TYPE_CODE_RANGE - and change return type from builtin_type_int to - builtin_type_chill_bool. + * jv-lang.c (java_class_from_object java_class_is_primitive + is_object_type): Change dtable to vtable. + * (java_primitive_type): Change arg to type char. + * (_initialize_java_language): Make java_char_type be unsigned. + * jv-lang.h: Fixup prototypes. + + Mon Dec 7 19:02:15 1998 Stu Grossman + + * jv-valprint.c (java_value_print): Fix printing of values where + run time type != compile time type. + + Fri Dec 4 15:23:38 1998 Stu Grossman + + * Makefile.in: Whack out m2-typeprint.c. + * c-typeprint.c (c_type_print_varspec_suffix) typeprint.h: Make this + global. It's needed by Java. + * (c_type_print_base): Whack prefix off of qualified method names + (names with name spaces). + * gdbtypes.h (struct cplus_struct_type): Add bits for Java attributes. + Shrink voffset + to 16 bits to compensate for added bits above (hopefully this is still + enough). + * Add new accessor macros (TYPE_FND_FIELD_PUBLIC, ...) for all new + attribute bits. + * jv-typeprint.c (java_type_print_base): Fix printing of method + attributes. Handle JVM style manglings. + * (java_print_type): Enable code type print varspec_suffix to allow + array indices to print out. + * jv-valprint.c (java_val_print): Minor formatting. + * m2-lang.c (m2_language_d): Change m2_print_type to c_print_type. + * stabsread.c (read_member_functions): Save public and static attributes. + +1999-03-02 Stan Shebs + + From Gary Thomas : + * arm-tdep.c (ARM_LE_BREAKPOINT, ARM_BE_BREAKPOINT, + THUMB_LE_BREAKPOINT, THUMB_BE_BREAKPOINT): Use illegal instruction + instead of SWI 24. + * config/arm/tm-arm.h (CALL_DUMMY): Ditto. + (IN_SIGTRAMP): Define. + +1999-03-01 Jim Blandy + + * configure.in (TERM_LIB): Move the code which sets this to a + better place. + +1999-02-25 Stan Shebs + + * breakpoint.c (SOLIB_LOADED_LIBRARY_PATHNAME, + SOLIB_UNLOADED_LIBRARY_PATHNAME, SOLIB_CREATE_CATCH_LOAD_HOOK, + SOLIB_CREATE_CATCH_UNLOAD_HOOK): Supply default definitions. + * infrun.c (SOLIB_IN_DYNAMIC_LINKER): Ditto. + +1999-02-23 Jim Blandy + + Patch from Jason Molenda (jsm@bugshack.cygnus.com) + * configure.in (TERM_LIB): Move checking for TERM_LIB, substituting. + * configure, aclocal.m4, config.in: Regenerated. + +1999-02-22 Jim Blandy + + * Makefile.in (VERSION): Bump to 4.17.85, for the release process. + + Patch from Elena Zannoni + * breakpoint.c (watch_command_1): Reformat comment. + + Patch from Elena Zannoni + * c-typeprint.c (c_type_print_base): Reformat comments. + + Patch from Edith Epstein : + * config/pa/nm-hppah.h: Added prototype declarations for + hppa_enable_page_protection_events and + hppa_disable_page_protection_events. + + Patch from Edith Epstein : + * infttrace.c (hppa_insert_hw_watchpoint): Make sure that + function always returns a value. + (hppa_remove_hw_watchpoint): Make sure that function always + returns a value. + + Patch from Edith Epstein : + * inftarg.c (child_wait): Fixed code that checks whether + or not the target program has done a fork/vfork. + related_pid does not have a value unless the target + program has forked/vforked. + +1999-02-22 Jim Blandy -Tue Mar 5 18:54:04 1996 Stan Shebs + * tm-h8500.h, i386lynx-nat.c: Removed. These files are long + dead; it seems that they only appeared due to some CVS weirdness. + If they appear again, we may need to distribute garlic and holy + water. - * config/nm-nbsd.h (link_object, lo_name, etc): Move to here - from config/nm-nbsd.h. - * config/sparc/nm-nbsd.h (regs, fp_status, etc): Move to here - from config/sparc/tm-nbsd.h. +1999-02-16 Jim Blandy - * config/m68k/nm-hp300hpux.h (FIVE_ARG_PTRACE): Define here - instead of in config/m68k/xm-hp300hpux.h. + * Makefile.in (VERSION): Bump to 4.17.2. -Tue Mar 5 12:05:35 1996 J.T. Conklin +Sun Feb 14 18:21:08 1999 Mark Alexander - * i386b-nat.c, m68knbsd-nat.c (fetch_core_registers): Provide - implementation for NetBSD systems. + * config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that + coffread.c will correctly handle char or short function parameters. -Mon Mar 4 23:44:16 1996 Per Bothner +1999-02-11 Jason Molenda (jsm@bugshack.cygnus.com) - * valarith.c (binop_user_defined_p): Return 0 for BINOP_CONCAT. - (value_concat): Handle varying strings (add COERCE_VARYING_ARRAY). + * configure, aclocal.m4: Regenerate with correct version of aclocal. - * ch-lang.c (evaluate_subexp_chill case MULTI_SUBSCRIPT): Error - if "function" is pointer to non-function. +1999-02-10 Syd Polk -Mon Mar 4 17:47:03 1996 Stan Shebs + * acinclude.m4: Fix for new location of itclConfig.sh and itkConfig.sh. + * aclocal.m4: Regnerate. + * configure: Regenerate. - * top.c (print_gdb_version): Update copyright year. +1999-02-10 Jason Molenda (jsm@bugshack.cygnus.com) -Mon Mar 4 14:44:54 1996 Jeffrey A Law (law@cygnus.com) + * demangle.c: Fix comments to mention "set demangle-style" + instead of "set demangle". + Run through indent to fix minor indenting problems. - From Peter Schauer: - * infrun.c (wait_for_inferior): Remove breakpoints and - switch terminal settings before calling SOLIB_ADD. - * solib.c (enable_break, SVR4 variant): Don't map in symbols - for the dynamic linker, the namespace pollution causes real - problems. +Wed Feb 10 17:53:09 1999 Bob Manson -Sun Mar 3 17:18:57 1996 James G. Smith + * i386-tdep.c (gdb_print_insn_i386): Add missing returns. - * remote-mips.c (common_breakpoint): Explicitly terminate the - returned buffer. +Wed Feb 10 13:17:21 1999 Stan Shebs -Wed Feb 28 22:32:18 1996 Stan Shebs + Declare Gould configuration obsolete: + * configure.host, configure.tgt: Comment out Gould configs. + * Makefile.in: Comment out Gould-related actions. + * gould-xdep.c, gould-tdep.c, config/gould/*: Comment out. + * NEWS: Mention obsolete status. - From Wilfried Moser : - * remote.c (remote_detach): Send a command 'D' to the target - when detaching, update the function's comments. +1999-02-09 DJ Delorie -Wed Feb 28 15:50:12 1996 Fred Fish + * sparcl-tdep.c: UDP download works in cygwin - * Makefile.in (VERSION): Bump version to 4.15.2 to establish - baseline for gdb 4.16 rerelease testing. +1999-02-08 Jason Molenda (jsm@bugshack.cygnus.com) -Wed Feb 28 13:32:05 1996 Jeffrey A Law (law@cygnus.com) + * gnu-regex.c: Check ENABLE_NLS instead of HAVE_LIBINTL_H. + * configure.in: Don't check for libintl.h. + * configure, config.in: Regenerated. - * somsolib.c (som_solib_create_inferior_hook): Before returning - call clear_symtab_users. +Mon Feb 8 18:10:50 1999 Stan Shebs -Tue Feb 27 00:04:46 1996 Stu Grossman (grossman@critters.cygnus.com) + * NEWS: Mention new X packet and PowerPC variant support. - * remote-e7000.c (e7000_open): Delete all breakpoints when - connecting to e7000. Change connect message to allow use of - monitor.exp in test suite. - * (e7000_load): Print transfer rate of download. - * symfile.c (generic_load): Print transfer rate of download. +1999-02-08 Nick Clifton -Sun Feb 25 13:58:33 1996 Stan Shebs + * configure.host: Add support for StrongARM host. + * configure.tgt: Add support for StrongARM target. - * configure.in (mips*-*-vxworks*): New config. - * configure: Regenerated. +Mon Feb 8 12:05:05 1999 David Taylor - * config/mips/vxmips.mt, config/mips/tm-vxmips.h: New files. - * remote-vxmips.c (vx_convert_to_virtual, vx_convert_from_virtual): - Remove, never used. + * dsrec.c (make_srec): Cast targ_addr to int in call to sprintf + otherwise on big endian machine with a bfd_vma of 64 bits, + *everything* gets loaded at location 0. -Sat Feb 24 12:30:28 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) +Mon Feb 7 10:05:43 1999 Frank Ch. Eigler - * partial-stab.h (case N_FUN): Function symbols generated - by SPARCworks cc have a meaningless zero value, do not update - pst->textlow if the function symbol value is zero. + * infrun.c (wait_for_inferior): Allow SIGTRAP to be "pass"ed + to target program. - * stabsread.c (define_symbol): Initialize SYMBOL_TYPE field - for function prototype declaration symbols. +Fri Feb 5 16:46:14 1999 Stan Shebs -Fri Feb 23 22:33:04 1996 Stu Grossman (grossman@critters.cygnus.com) + * NEWS: Add mentions of various new things. - * remote-e7000.c (e7000_load): New routine to download via the - network. - * (e7000_wait): Don't backup PC when we hit a breakpoint. - Apparantly new sh2 pods get this right... - * (e7000_ops): Add call to e7000_load. +Thu Feb 4 00:19:14 1999 Christopher Faylor -Thu Feb 22 00:52:42 1996 J.T. Conklin + * configure.in: Move termcap determination later in the + file to catch setting of cygwin flag. + * configure: Regenerate. - * config/m68k/{nbsd.mh,nbsd.mt,nm-nbsd.h,tm-nbsd.h,xm-nbsd.h}, - m68knbsd-nat.c: New files, support for NetBSD/m68k. +Wed Feb 3 14:16:38 1999 Christopher Faylor - * configure.in (m68k-*-netbsd*): New config. + * config/i386/cygwin.mh: Move TERMCAP test code to configure.in. + * configure.in: Treat libtermcap.a detection as a special case + when hosting on cygwin. + * configure: Regenerate. + +1999-02-03 Keith Seitz + + * remote.c (remote_binary_download, remote_binary_length): New + static globals for dealing with binary transmissions. + (remote_write_bytes): Add support for binary downloads + by shadowing the "M" packet with a new "X" packet. This + defaults to ON; if the stub does not understand this, it + will fall back to using "M". + (putpkt): Add support for binary downloading. + * monitor.c (monitor_expect): The mon2000 monitor + on the MSA2000 will also emit random DC1/DC3 chars. + * m32r-stub.c: Change all char's to unsigned char's + to support binary downloading. + (handle_exception): Add support for binary downloading + via a new "X" packet. + (getpacket): Do NOT strip eighth bit of incoming chars. + Watch out for escaped characters in the incoming stream. + (putpacket): Do NOT strip eighth bit of incoming chars. + (bin2mem): New function to write binary data directly to + memory. + * m32r-rom.c: Add new "mon2000" target. + +Tue Feb 2 18:40:29 1999 Elena Zannoni + + * hp-psymtab-read.c (hpread_build_psymtabs): Coerce first arg + passed to make_cleanup to the correct type. + (hpread_quick_traverse): Change fifth arg to call to + hpread_end_psymtab to be 0. + Compare CURR_MODULE_END to 0 rather than NULL. + Get rid of ifdef'ed out code. + (scan_procs): Get rid of ifdef'ed out code. + + * somread.c (som_symfile_read): Coerce first argument passed to + make_cleanup to the correct type. + +Tue Feb 2 17:36:29 1999 Elena Zannoni + + * hp-psymtab-read.c (do_pxdb): New function. Check whether the + file needs to be processed by pxdb (an HP debug info massaging + tool), if so call it. + (hpread_build_psymtabs): Initialize scan_start to 0 and + simplify flow of control. + + * somread.c (som_symfile_read): Add call to do_pxdb (), + in hp-psymtab-read.c. + + * symfile.c (symbol_file_add): Remove ifdef'ed out HPUX specific + code. + (symfile_bfd_open): Remove HPUXHPPA ifdef'ed code. Code is now + in hp-psymtab-read.c. + +1999-02-02 Martin Hunt + + * printcmd.c (print_scalar_formatted): Use strcat to concat all + the output together before calling fprintf_filtered(). + +1999-02-01 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in: Require autoconf 2.13. + (AM_EXEEXT): Replace with new AC_EXEEXT. + * acinclude.m4: Move itcl header macros from aclocal.m4 to here. + * aclocal.m4: Regenerated. * configure: Regenerated. -Wed Feb 21 19:00:21 1996 Fred Fish +1999-02-01 Jim Blandy - * standalone.c (open, _initialize_standalone): Fix obvious typos - reported by Martin Pool . + Allow PPC users to select which PPC/RS6000 variant they're + debugging at run-time. At the moment, the only thing this affects + is the set of registers visible. + * config/rs6000/tm-rs6000.h (REGISTER_NAME): Define this as a call + to the function rs6000_register_name. + (rs6000_register_name): Include extern decl. + (NUM_REGS): Bump to 183. What's the right way to do this? + (FIRST_UISA_SP_REGNUM, LAST_UISA_SP_REGNUM): Renamed from + FIRST_SP_REGNUM, LAST_SP_REGNUM. + (REGISTER_BYTES): Recompute this. + * rs6000-tdep.c: Renamed all uses of FIRST_SP_REGNUM and + LAST_SP_REGNUM to FIRST_UISA_SP_REGNUM and LAST_UISA_SP_REGNUM, with + some concomitant formatting changes. + #include "gdbcmd.h", so we can define commands here. + (struct variant): New structure. + (COMMON_UISA_REG_NAMES, PPC_UISA_SPR_NAMES, PPC_SEGMENT_REG_NAMES, + PPC_32_OEA_SPR_NAMES, num_registers): New macros. + (register_names_rs6000, register_names_uisa, register_names_403, + register_names_403GC, register_names_505, register_names_860, + register_names_601, register_names_602, register_names_603, + register_names_604, register_names_750, variants): New variables. + (rs6000_register_name, install_variant, find_variant_by_name, + install_variant_by_name, list_variants, show_current_variant, + set_processor, show_processor): New functions. + (_initialize_rs6000_tdep): Define new commands `set processor' and + `show processor', and call install_variant_by_name to set the + default variant. + * rs6000-nat.c: Renamed all uses of FIRST_SP_REGNUM and + LAST_SP_REGNUM to FIRST_UISA_SP_REGNUM and LAST_UISA_SP_REGNUM, with + some concomitant formatting changes. + * configure.in: Accept the `--with-cpu' flag, to specify a default + processor variant. + * acconfig.h: Provide a blurb for TARGET_CPU_DEFAULT, which is set + by configure's `--with-cpu' flag. + * config.in, configure: Regenerated. -Wed Feb 21 14:24:04 1996 Jeffrey A Law (law@cygnus.com) +Sun Jan 31 15:24:24 1999 Stan Shebs - * solib.c (solib_create_inferior_hook): Fix thinko. + * buildsym.h, buildsym.c: Convert to ANSI-only. -Tue Feb 20 23:59:19 1996 Jeffrey A Law (law@cygnus.com) + * buildsym.h, buildsym.c: Reformat to standard. - * solib.c (solib_break_names): Define for Solaris and Linux. - (enable_break): For SVR4 systems, first try to use the debugger - interfaces in the dynamic linker to track shared library events - as they happen, then fall back to BKPT_AT_SYMBOL code. Convert - BKPT_AT_SYMBOL code to use shared library event breakpoints. - (solib_create_inferior_hook): Simplify BKPT_AT_SYMBOL code, - it no longer needs to restart/wait on the inferior. - * symfile.c (find_lowest_section): No longer static. - * symfile.h (find_lowest_section): Corresponding changes. + * buildsym.c (merge_symbol_lists): Remove unused variable. + (_initialize_buildsym): Remove, does nothing. -Tue Feb 20 18:54:08 1996 Fred Fish +1999-01-31 J.T. Conklin - * valops.c (COERCE_FLOAT_TO_DOUBLE): Define default value. - (value_arg_coerce): Use COERCE_FLOAT_TO_DOUBLE. - * config/alpha/tm-alpha.h (COERCE_FLOAT_TO_DOUBLE): Define to 1. - * config/mips/tm-mips.h: Ditto. - * config/pa/tm-hppa.h: Ditto. - * config/rs6000/tm-rs6000.h: Ditto. - * config/sparc/tm-sparc.h: Ditto. - -Tue Feb 20 17:32:05 1996 J.T. Conklin + * i386-stub.c, m32r-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c, + sparcl-stub, sparclet-stub.c: Change declaration of putDebugChar + to include explicit void return type as per documentation. Fix up + occasions where stubs erroneously checked return type. - * config/{i386,ns32k}/nbsd.mh (NATDEPFILES): Remove core-aout.o. +Sun Jan 31 13:18:33 1999 Stan Shebs - * config/nm-nbsd.h (FETCH_INFERIOR_REGISTERS): Defined. - * config/xm-nbsd.h (CC_HAS_LONG_LONG, PRINTF_HAS_LONG_LONG): - #ifdef'd out definitions --- Causes serious gdb failures on - the i386. Need to investigate further before enabling. + From J.T. Conklin : + * remote.c (remote_query): Fix tipo. - * i386b-nat.c (fetch_inferior_registers, store_inferior_registers, - fetch_core_registers): New functions. These functions are defined - if FETCH_INFERIOR_REGISTERS is set. Registers are fetched/stored - with ptrace PT_GETREGS/PT_SETREGS. +Fri Jan 29 15:25:09 1999 Stan Shebs -Tue Feb 20 16:55:06 1996 Stu Grossman (grossman@critters.cygnus.com) + * configure.tgt (v850): Add wildcard to match. - * findvar.c (extract_floating store_floating): Replace `long - double' with `DOUBLEST'. +Fri Jan 29 16:44:01 1999 Edith Epstein -Mon Feb 19 15:25:51 1996 J.T. Conklin + * inferior.h: Ran indent. - * config/xm-nbsd.h (CC_HAS_LONG_LONG, PRINTF_HAS_LONG_LONG): - Define. + * fork-child.c: Ran indent. -Mon Feb 19 10:32:05 1996 Jeffrey A Law (law@cygnus.com) + * infrun.c : Ran indent. - * symtab.h (looup_minimal_symbol_solib_trampoline): Declare. +Fri Jan 29 12:57:34 1999 Elena Zannoni - * breakpoint.h (remove_solib_event_breakpoints): Declare. - * breakpoint.c (remove_solib_event_breakpoints): New function. - * somsolib.c (solib_create_inferior_hook): Remove all solib event - breakpoints before inserting any new ones. Use a solib event - breakpoint for the breakpoint at "_start". - Remove extraneous "\n" from calls to warning. - - * breakpoint.c (breakpoint_1): Add missing "sigtramp" to bptypes - name array. - -Mon Feb 19 01:09:32 1996 Doug Evans - - * dwarfread.c (add_partial_symbol): Use ADD_PSYMBOL_ADDR_TO_LIST - for CORE_ADDR values. - (new_symbol): Use SYMBOL_VALUE_ADDRESS for CORE_ADDR values. - * symfile.h (add_psymbol_{,addr}to_list): Add prototypes. - -Sun Feb 18 14:37:13 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * mipsread.c (mipscoff_symfile_read): Unconditionally add - alpha coff dynamic symbols for all symbol files. Makes skipping - over the trampoline code work when stepping from a function in a - shared library into a function in a different shared library. - -Sun Feb 18 09:27:10 1996 Stu Grossman (grossman@cygnus.com) - - * config/sparc/tm-sparc.h: Define PS_FLAG_CARRY. Define - RETURN_VALUE_ON_STACK to return long doubles on the stack. - -Sat Feb 17 16:33:11 1996 Fred Fish - - * Makefile.in (ch-exp.o): Add dependencies. - (various): Add gdb_string.h to dependencies that need it. - -Sat Feb 17 08:57:50 1996 Fred Fish - - * symmisc.c (print_symbol_bcache_statistics): Update description for - printing byte cache statistics. - -Thu Feb 16 16:02:03 1996 Stu Grossman (grossman@cygnus.com) - - * Add native support for long double data type. - * c-exp.y (%union): Change dval to typed_val_float. Use DOUBLEST - to store actual data. Change types of INT and FLOAT tokens to - typed_val_int and typed_val_float respectively. Create new token - DOUBLE_KEYWORD to specify the string `double'. Make production - for FLOAT use type determined by parse_number. Add production for - "long double" data type. - * (parse_number): Use sscanf to parse numbers as float, double or - long double depending upon the type of typed_val_float.dval. Also - allow user to specify `f' or `l' suffix to explicitly specify - float or long double constants. Change typed_val to - typed_val_int. - * (yylex): Change typed_val to typed_val_int. Also, scan for - "double" keyword. - * coffread.c (decode_base_type): Add support for T_LNGDBL basic - type. - * configure, configure.in: Add check for long double support in - the host compiler. - * defs.h: Define DOUBLEST appropriatly depending on whether - HAVE_LONG_DOUBLE (from autoconf) is defined. Also, fix prototypes - for functions that handle this type. - * expression.h (union exp_element): doubleconst is now type - DOUBLEST. - * m2-exp.y f-exp.y (%union): dval becomes type DOUBLEST. - * findvar.c (extract_floating): Make return value be DOUBLEST. - Also, add support for numbers with size of long double. - * (store_floating): Arg `val' is now type DOUBLEST. Handle all - floating types. - * parser-defs.h parse.c (write_exp_elt_dblcst): Arg expelt is now - DOUBLEST. - * valarith.c (value_binop): Change temp variables v1, v2 and v to - type DOUBLEST. Coerce type of result to long double if either op - was of that type. - * valops.c (value_arg_coerce): If argument type is bigger than - double, coerce to long double. - * (call_function_by_hand): If REG_STRUCT_HAS_ADDR is defined, and - arg type is float and > 8 bytes, then use pointer-to-object - calling conventions. - * valprint.c (print_floating): Arg doub is now type DOUBLEST. - Use appropriate format and precision to print out floating point - values. - * value.h: Fixup prototypes for value_as_double, - value_from_double, and unpack_double to use DOUBLEST. - * values.c (record_latest_value): Remove check for invalid - floats. Allow history to store them so that people may examine - them in hex if they want. - * (value_as_double unpack_double): Change return value to DOUBLEST. - * (value_from_double): Arg `num' is now DOUBLEST. - * (using_struct_return): Use RETURN_VALUE_ON_STACK macro (target - specific) to expect certain types to always be returned on the stack. - -Fri Feb 16 14:00:54 1996 Fred Fish - - * bcache.c, bcache.h: New files to implement a byte cache. - * Makefile.in (SFILES): Add bcache.c. - (symtab_h): Add bcache.h. - (HFILES_NO_SRCDIR): add bcache.h - (COMMON_OBJS): Add bcache.o - (bcache.o): New target. - * dbxread.c (start_psymtab): Make global_syms & static_syms - type "partial_symbol **". - * hpread.c (hpread_start_symtab): Ditto. - * os9kread.c (os9k_start_psymtab): Ditto. - * stabsread.h (start_psymtab): Ditto. - * {symfile.c, symfile.h} (start_psymtab_common): Ditto. - * maint.c (maintenance_print_statistics): Call - print_symbol_bcache_statistics. - * objfiles.c (allocate_objfile): Initialize psymbol bcache malloc - and free pointers. - * solib.c (allocate_rt_common_objfile): Ditto. - * symfile.c (reread_symbols): Ditto. - (free_objfile): Free psymbol bcache when objfile is freed. - (objfile_relocate): Use new indirect psymbol pointers. - * objfiles.h (struct objfile): Add psymbol cache. - * symfile.c (compare_psymbols): Now passed pointers to pointers to - psymbols. - (reread_symbols): Free psymbol bcache when freeing other objfile - resources. - (add_psymbol_to_list, add_psymbol_addr_to_list): Initialize new - psymbol using the psymbol bcache. - (init_psymbol_list): Psymbol lists now contain pointers rather than - the actual psymbols. - * symfile.h (psymbol_allocation_list): Psymbol lists now dynamically - grown arrays of pointers. - (ADD_PSYMBOL_VT_TO_LIST): Initialize new symbol using the psymbol - bcache. - * symmisc.c (print_partial_symbols): Now takes pointer to pointer - to partial symbol. - (print_symbol_bcache_statistics): New function to print per objfile - bcache statistics. - (print_partial_symbol, print_partial_symbols, - maintenance_check_symtabs, extend_psymbol_list): - Account for change to pointer to pointer to partial symbol. - * symtab.c (find_pc_psymbol, lookup_partial_symbol, decode_line_2, - make_symbol_completion_list): - Account for change to pointer to pointer to partial symbol. - * symtab.h (bcache.h): Include. - * xcoffread.c (xcoff_start_psymtab): Make global_syms & static_syms - type "partial_symbol **". - -Fri Feb 16 10:02:34 1996 Fred Fish - - * dwarfread.c (free_utypes): New function. - (read_file_scope): Call free_utypes as cleanup, rather than just - freeing the utypes pointer. - -Thu Feb 15 21:40:52 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * demangle.c (is_cplus_marker): New function, checks if a - character is one of the commonly used C++ marker characters. - * defs.h (is_cplus_marker): Add prototype. - * c-typeprint.c (c_type_print_base), ch-lang.c (chill_demangle), - cp-valprint.c (cp_print_class_method), mdebugread.c (parse_symbol), - stabsread.c (define_symbol, read_member_functions, read_struct_fields), - symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P), - values.c (vb_match): Use is_cplus_marker instead of comparison - with CPLUS_MARKER. - -Thu Feb 15 18:08:13 1996 Fred Fish - - * symfile.h (INLINE_ADD_PSYMBOL): Default this to 0 and possibly - delete entirely someday. - -Thu Feb 15 15:25:34 1996 Stan Shebs - - * mpw-make.sed: Edit out makefile rebuild rule. - (host_alias, target_alias): Comment out instead of deleting. - (@LIBS@): Edit out references. - -Tue Feb 13 22:56:46 1996 Fred Fish - - * symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): - Use n_psyms in OBJSTAT, not psyms. - -Mon Feb 12 15:59:31 1996 Doug Evans - - * configure.in (sparclet-*-aout*): New config. - * configure: Regenerated. + * infrun.c (_initialize_infrun): Do not stop or print anything + when a SIGWINCH is received. -Mon Feb 12 14:17:52 1996 Fred Fish + * Makefile.in (m2-exp.tab.c): Use YACC not BISON. + (f-exp.tab.c): Ditto. + (jv-exp.tab.c): Ditto. + (c-exp.tab.c): Ditto. + (YACC): Define as @YACC@. - * somsolib.c (som_solib_add): Use xmalloc rather than bare - unchecked call to malloc. - * remote-mips.c (pmon_load_fast): ditto. - * remote-mm.c (mm_open): ditto. - * hpread.c (hpread_lookup_type): ditto. - * remote-adapt.c (adapt_open): ditto. +1999-01-29 Martin Hunt -Mon Feb 12 13:11:32 1996 Fred Fish + Changes from Keith Seitz + * valops.c (value_assign): Add calls to register_changed_hook and + memory_changed_hook to inform UIs that the user has changed + the target's registers/memory. + * findvar.c (write_register_gen): Remove call to pc_changed_hook. + * defs.h: Remove declaration for pc_changed_hook and + add declarations for register_changed_hook and + memory_changed_hook. + * top.c: Ditto. - * f-lang.c (allocate_saved_bf_node, allocate_saved_function_node, - allocate_saved_f77_common_node, allocate_common_entry_node, - add_common_block): Use xmalloc rather than malloc, some of which - were unchecked. - * gnu-regex.c: At same point as other gdb specific changes - #undef malloc and then #define it to xmalloc. - * ch-exp.c (growbuf_by_size): Use xmalloc/xrealloc rather than - bare unchecked calls to malloc/realloc. - * stabsread.c (dbx_lookup_type): Use xmalloc rather than bare - unchecked call to malloc. +1999-01-29 Mark Alexander -Wed Feb 7 11:31:26 1996 Stu Grossman (grossman@cygnus.com) + * procfs.c (wait_fd): Handle deleted threads correctly. - * symtab.c (gdb_mangle_name): Change opname var to be const to - match return val of cplus_mangle_name. - * i960-tdep.c: Change arg types of next_insn to match callers. +1999-01-28 Jason Molenda (jsm@bugshack.cygnus.com) -Wed Feb 7 07:34:24 1996 Fred Fish + * utils.c (init_page_info): Force window size if running under emacs. - * config/i386/linux.mh (XM_CLIBS, GDBSERVER_LIBS): Remove. These - apparently aren't needed in any reasonably recent version of - linux. +1999-01-27 James Ingham -Tue Feb 6 21:37:03 1996 Per Bothner + * typeprint.c (whatis_exp): Remove static declaration. - * stabsread.c (read_range_type): If !self-subrange and language - is Chill, assume a true range. If a true_range is a sub_subrange, - use builtin_type_int for index_type. +Wed Jan 27 16:50:25 1999 Elena Zannoni -Tue Feb 6 18:38:51 1996 J.T. Conklin + * hp-psymtab-read.c: Reformat using indent. - * nindy-share/nindy.c (say): Use stdarg.h macros when compiling - with an ANSI compiler. +Wed Jan 27 13:20:25 1999 Elena Zannoni -Mon Feb 5 18:24:28 1996 Steve Chamberlain + * hp-psymtab-read.c: Reformat comments, update copyright. - From Michael_Snyder@NeXT.COM (Michael Snyder): - * valops.c (value_arg_coerce): Coerce float to double, unless the - function prototype specifies float. - -Mon Feb 5 09:51:55 1996 Tom Tromey +Tue Jan 26 16:02:47 1999 Mark Alexander - * language.c (set_language_command): Use languages table when - printing available languages. + * v850-tdep.c (v850_generic_reg_names, v850e_reg_names, + v850_register_names, v850_processor_type_table): Declare tables + and structures for handling differences in register names for + v850 and v850e. + (struct reg_list): Define new structure for creating tables + of register bit masks in v850e instrutions. + (handle_prepare, handle_pushm): New helpers for v850_scan_prologue. + (v850_scan_prologue): Recognize v850e instructions: callt, prepare, + and pushm. + (v850_target_architecture_hook): New function to set register + names based on current machine. + (_initialize_v850_tdep): Set up target_architecture_hook. + * config/v850/tm-v850.h (v850_register_names): Declare. + (REGISTER_NAME): Define to refer to v850_register_names. + (SR0_REGNUM, CTBP_REGNUM): Define. + (PS_REGNUM): Redefine in terms of SR0_REGNUM. -Sat Feb 3 12:22:05 1996 Fred Fish +Tue Jan 26 18:27:26 1999 Elena Zannoni - Fix problems reported by Hans Verkuil (hans@wyst.hobby.nl): - * command.c (add_cmd): Add missing initialization for enums member. - Reorder members to match structure declaration to make it easier to - tell when one is missing. - * exec.c (exec_file_command): Fix problem where filename in malloc'd - memory is referenced after being freed. + * Makefile.in (c-exp.tab.c): Use BISON instead of YACC, to pick + the correct value from configure output. + (jv-exp.tab.c): Ditto. + (f-exp.tab.c): Ditto. + (m2-exp.tab.c): Ditto. -Sat Feb 3 03:26:21 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) +1999-01-26 Jason Molenda (jsm@bugshack.cygnus.com) - * dwarfread.c (read_func_scope): Avoid GDB core dumps if - AT_name tag is missing. + * breakpoint.h (ep_is_exception_catchpoint): Add prototype. + * frame.h (select_and_print_frame): Add prototype. + * stack.c (func_command): Call select_and_print_frame with correct + number of arguments. Reformat whitespace. - * procfs.c (procfs_stopped_by_watchpoint): Fix logic when - FLTWATCH and FLTKWATCH are defined. +Tue Jan 26 16:53:54 1999 Fernando Nasser - * remote.c (remote_read_bytes): Advance memaddr for transfers, - return number of bytes transferred for partial reads. + * remote.c (remote_query): fix maximum packet size to account for + remote_debug use. + (putpkt): add comment to alert about extra byte need. - * top.c (init_signals): Reset SIGTRAP to SIG_DFL. +Mon Jan 25 19:55:30 1999 Mark Alexander -Fri Feb 2 13:40:50 1996 Steve Chamberlain + * sh-tdep.c (sh_target_architecture_hook): Return immediately + when a matching machine is found. - * win32-nat.c (mappings): Add ppc registers. - (child_resume): Turn off step for ppc. +Fri Jan 22 09:10:35 1999 Mark Alexander -Thu Feb 1 10:29:31 1996 Steve Chamberlain + * remote-mips.c (mips_initialize): Fix parameters to clear_breakpoint. + (common_breakpoint): Restore support for instruction breakpoints + on non-LSI targets. - * config/powerpc/(cygwin32.mh, cygwin32.mt, tm-cygwin32.h, - xm-cygwin32.h): New. - * config/i386/(*win32*): Becomes *cygwin32*. - * configure.in (i[3456]86-*-win32*): Becomes i[3456]86-*-cygwin32. - (powerpcle-*-cygwin32): New. - * configure: Regenerate. - * win32-nat.c (child_create_inferior): Call CreateProcess - with the right program arg. +Thu Jan 21 17:16:19 1999 Andrew Cagney -Thu Feb 1 11:01:10 1996 Jeffrey A Law (law@cygnus.com) + * stack.c: Close open comment. + * symtab.c (find_pc_sect_line): Ditto. - * config/pa/tm-hppa.h (SOFT_FLOAT): Provide a default definition. +Thu Jan 21 17:51:51 1999 Stan Shebs -Wed Jan 31 19:01:28 1996 Fred Fish + * procfs.c (init_procfs_ops): New function, fills in procfs_ops, + init only nonzero fields, leave to_require_attach and + to_require_detach empty, not needed for /proc systems yet. + (_initialize_procfs): Call init_procfs_ops. - * serial.c: Change fputc/fputs/fprintf to _unfiltered forms. + From J.T. Conklin : + * top.c (init_main): Fix tipo in description of the remotetimeout + variable. + * breakpoint.c (bpstat_stop_status): Handle systems where + DECR_PC_AFTER_BREAK != DECR_PC_AFTER_HW_BREAK. -Wed Jan 31 18:36:27 1996 Stan Shebs +Thu Jan 21 17:25:46 1999 Mark Alexander - * config/sparc/xm-sun4os4.h (HAVE_TERMIOS): Remove. + * mon960-rom.c (_initialize_mon960): Call init_mon960_cmds + to fill in mon960_cmds structure properly. - * config/sparc/xm-sparc.h (HAVE_WAIT_STRUCT): Remove, never used. +Wed Jan 20 17:53:22 1999 Stan Shebs - * config/i386/nm-i386mach.h (CHILD_PREPARE_TO_STORE): Move to - here from config/i386/xm-i386mach.h, fix name. - * config/i386/nm-sun386.h: Ditto, from config/i386/xm-sun386.h. - * config/i386/nm-ptx4.h (CHILD_PREPARE_TO_STORE): Move to - here from config/i386/xm-ptx4.h. - * config/i386/nm-ptx4.h: Ditto, from config/i386/xm-ptx.h. - * config/i386/nm-symmetry.h: Ditto, from config/i386/xm-symmetry.h. - * config/m68k/nm-sun3.h: Ditto, from config/m68k/xm-sun3.h. - * config/sparc/nm-nbsd.h: Ditto, from config/sparc/xm-nbsd.h. - * config/sparc/nm-sun4os4: Ditto, from config/sparc/xm-sparc.h. + * remote-sds.c (sds_ops): Define only once. + (init_sds_ops, sds_command, _initialize_remote_sds): Declare. + (init_sds_ops): Init only non-zero fields. - * config/sparc/nm-sun4sol2.h: New file, renamed from nm-sysv4.h. - (PRSVADDR_BROKEN): Move here from xm-sun4sol2.h. - * config/sparc/sun4sol2.mh (NAT_FILE): Update. +Wed Jan 20 15:45:15 1999 Mark Alexander -Wed Jan 31 17:20:26 1996 Jeffrey A Law (law@cygnus.com) + * h8300-tdep.c (original_register_names, h8300h_register_names, + h8300_register_names): Define new variables. + (set_register_names): New function to set register names based on + current CPU type. + (h8300_command, h8300h_command, h8300s_command): Call + set_register_names. + * config/h8300/tm-h8300.h (h8300_register_names): Declare. + (REGISTER_NAME): Define to refer to h8300_register_names. - * config/pa/tm-hppa.h (EXTRACT_RETURN_VALUE): Handle software - floating point correctly. - (STORE_RETURN_VALUE): Likewise. - * config/pa/tm-pro.h (SOFT_FLOAT): define. +1999-01-19 Fernando Nasser -Wed Jan 31 13:34:52 1996 Fred Fish + * sol-thread.c abug-rom.c cpu32bug-rom.c dbug-rom.c m32r-rom.c + mac-nat.c mon960-rom.c op50-rom.c ppc-bdm.c remote-adapt.c + remote-array.c remote-bug.c remote-e7000.c remote-eb.c remote-es.c + remote-est.c remote-hms.c remote-mm.c remote-nindy.c remote-nrom.c + remote-os9k.c remote-rdp.c remote-sds.c remote-sim.c remote-st.c + remote-udi.c rom68k-rom.c sh3-rom.c sparcl-tdep.c sparclet-rom.c + v850ice.c win32-nat.c: cosmetic changes to conform to coding + standards. - * config/i386/xm-linux.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT): - Define to what should be reasonable values. However, apparently - a bug in linux mmap prevents mapped symbol tables from working. +1999-01-19 Jim Blandy -Tue Jan 30 18:26:19 1996 Fred Fish + Use aclocal to generate GDB's aclocal.m4 script. + * acinclude.m4: New file, containing the hand-written local macro + definitions that used to be in aclocal.m4. Don't sinclude + ../bfd/aclocal.m4 any more; running aclocal in this directory will + get us the definitions we need. HOWEVER: Do sinclude + ../bfd/acinclude.m4, because we need the definition of + BFD_NEED_DECLARATION. + * aclocal.m4: Regenerated by aclocal. + * configure: Regenerated by autoconf. - * defs.h (errno.h>: Move #include closer to head of file to solve - obscure problem with systems that declare perror with const arg, in - both errno.h and stdio.h, and const is defined away by intervening - local include. +Tue Jan 19 10:27:23 1999 David Taylor -Tue Jan 30 15:41:10 1996 Fred Fish + * breakpoint.c (disable_breakpoints_in_shlibs): new parameter, + silent, controls whether to print message about removal of shared + library breakpoints. + * breakpoint.h (disable_breakpoints_in_shlibs): decl updated. + * irix5-nat.c (clear_solib): call disable_breakpoints_in_shlibs. + * osfsolib.c (clear_solib): ditto. + * solib.c (clear_solib): ditto. + * somsolib.c (som_solib_restart): update call to + disable_breakpoints_in_shlibs. - From Jon Reeves : - * i386-stub.c (getpacket): Change fprintf stream from "gdb" to stderr. - (mem_fault_routine): Fix misplaced volatile type qualifier in decl. + * target.h (child_post_attach): only declare if CHILD_POST_ATTACH + is define. -Mon Jan 29 19:05:58 1996 Fred Fish +Tue Jan 19 18:07:11 1999 Andrew Cagney - * Makefile.in (diststuff): Make all-doc; diststuff target does not - exist in doc/Makefile.in. + * corelow.c (solib_add_stub): Ditto. + (core_file_to_sym_file): Cast make_cleanup parameter. -Mon Jan 29 18:44:57 1996 Stan Shebs + * solib.c (symbol_add_stub, solib_map_sections): Change argument + to PTR insted of a char*. Matches catch_errors interface. - * config/m88k/xm-cxux.h (BP_HIT_COUNT): Remove, never used. +Mon Jan 18 14:01:24 1999 Andrew Cagney -Mon Jan 29 00:10:35 1996 Wilfried Moser (Alcatel) + * remote-array.c (array_open): Don't use fprintf_filtered to send + data to the log file. - * ch-valprint.c (calculate_array_length): New function to - determine the length of an array type. - (chill_val_print (case TYPE_CODE_ARRAY)): If the length of an - array type is zero, call calculate_array_length. + * remote-array.c (handle_load_dll): Change argument type to PTR so + that it is compatible with catch_errors. + * ocd.c (ocd_start_remote): Ditto. + * remote-sds.c (sds_start_remote): Ditto. - * gdbtypes.c (get_discrete_bounds (case TYPE_CODE_ENUM)): The - values may not be sorted. Scan all entries and set the real lower - and upper bound. + * win32-nat.c (win32_child_thread_alive): Namespace proof + child_thread_alive. + (init_child_ops): Update. -Sun Jan 28 15:50:42 1996 Fred Fish +Mon Jan 18 12:03:47 1999 Andrew Cagney - * config/xm-linux.h: Move include of solib.h and #define of - SVR4_SHARED_LIBS from here ... - * config/nm-linux.h: ...to here. + * remote-rdi.c (arm_rdi_open): Set gdb_hostif.hostosarg and + gdb_hostif.dbgarg to NULL instead of stdout. + (voiddummy, myprint, mywritec): Use gdb_stdout instead of stdout. -Sat Jan 27 10:34:05 1996 Fred Fish +Mon Jan 18 16:40:50 1999 Stan Shebs - * configure.in (AC_CHECK_HEADERS): Check for sys/procfs.h. - Also check for gregset_t and fpregset_t types. - * configure: Regenerate. - * core-regset.c (sys/procfs.h): Only include if HAVE_SYS_PROCFS_H - is defined. - (fetch_core_registers): Turn into stub unless both HAVE_GREGSET_T - and HAVE_FPREGSET_T are defined. These changes allow systems - like linux that are migrating to /proc support to use a single - configuration for both new and old versions. + * ser-ocd.c (ocd_open): Handle Unix case gracefully. - * config/i386/linux.mt: Note that this is now for both a.out and - ELF systems. - * config/i386/linux.mh (NATDEPFILES): Add solib.o, core-regset.o, - i386v4-nat.o - * config/i386/tm-linux.h (tm-sysv4.h): Include. - * config/i386/xm-linux.h (solib.h): Include - (SVR4_SHARED_LIBS): Define. - * i386v4-nat.c: Only compile if HAVE_SYS_PROCFS_H is defined. - (supply_gregset, fill_gregset): Compile if HAVE_GREGSET_T defined. - (supply_fpregset, fill_fpregset): Compile if HAVE_FPREGSET_T - defined. + * target.c (dummy_target): Don't initialize statically. + (init_dummy_target): New function, fills in dummy_target. + (initialize_targets): Use it. + * hpux-thread.c (hpux_thread_ops): Don't initialize statically. + (init_hpux_thread_ops): New function, fills in hpux_thread_ops. + (_initialize_hpux_thread): Use it. + * m3-nat.c (m3_ops): Don't initialize statically. + (init_m3_ops): New function, fills in m3_ops. + (_initialize_m3): Use it. -Fri Jan 26 13:48:14 1996 Stan Shebs +1999-01-18 Fernando Nasser - * config/sparc/xm-sparc.h (NEW_SUN_CORE): Remove, never used. - * config/i386/xm-sun386.h: Ditto. - * config/m68k/xm-sun2.h, config/m68k/xm-sun3.h: Ditto. + * sol-thread.c: delete compile time initialization of target_ops + (_initialize_sol_thread): initialize target_ops at run time. + * hpux-thread.c: added target_ops entry. + * m3-nat.c: ditto. -Thu Jan 25 16:05:53 1996 Tom Tromey +Mon Jan 18 15:19:13 1999 David Taylor - * Makefile.in (INSTALLED_LIBS, CLIBS): Include @LIBS@. + * procfs.c (procfs_ops): delete compile time initialization. + (_initialize_procfs): initialize procfs_ops at run time. + +Mon Jan 18 12:51:44 1999 Christopher Faylor -Thu Jan 25 09:22:15 1996 Steve Chamberlain + * configure.in: Ensure that -luser32 is always linked in + for cygwin build. + * configure: Regenerated. - From Greg McGary : - * dcache.c (dcache_peek, dcache_poke): Advance addr for - multi-byte I/O. +Mon Jan 18 08:38:05 1999 Mark Alexander -Thu Jan 25 13:08:51 1996 Doug Evans (dje@cygnus.com) + * values.c (value_virtual_fn_field): Clear the pointed-to + offset when casting to the base class. - * infrun.c (normal_stop): Fix test for shared library event. +Mon Jan 18 10:30:51 1999 David Taylor -Thu Jan 25 03:26:38 1996 Doug Evans + * remote-udi.c (init_udi_ops): change non-existant udi_run_ops to + udi_ops; delete NULL initializers. - * configure.in (sparc64-*-*): Add default host configuration. - (sparc64-*-solaris2*): Add target configuration. - * configure: Regenerated. - * sparc/sp64sol2.mt: New file. - -Wed Jan 24 22:31:37 1996 Doug Evans - - * Makefile.in (RUNTEST): srcdir renamed to rootsrc. - -Wed Jan 24 15:42:24 1996 Tom Tromey - - * Makefile.in (lint): Close backquotes. - -Wed Jan 24 13:19:10 1996 Fred Fish - - * NEWS: Make note of new record and replay feature for - remote debug sessions. - * serial.c (gdbcmd.h): Include. - (serial_logfile, serial_logfp, serial_reading, serial_writing): - Define here, for remote debug session logging. - (serial_log_command, serial_logchar, serial_write, serial_readchar): - New functions for remote debug session logging. - (serial_open): Open remote debug session log file when needed. - (serial_close): Close remote debug session log file when needed. - (_initialize_serial): Add set/show commands for name of remote - debug session log file. - * serial.h (serial_readchar): Declare - (SERIAL_READCHAR): Call serial_readchar(). - (SERIAL_WRITE): Call serial_write(). - (serial_close): Declare as extern. - (serial_logfile, serial_logfp): Declare. - * top.c (execute_command): Declare serial_logfp. Log user command - in remote debug session log if log file is open. - * remote-array.c (array_wait): #ifdef out echo to gdb_stdout. - (array_read_inferior_memory): Rewrite to fix memory overwrite bug. - * remote-array.c (SREC_SIZE): Remove, duplicates define in - monitor.h. - * remote-array.c (hexchars, hex2mem): Remove, unused. - * gdbserver/low-linux.c (store_inferior_registers): Remove - unnecessary extern declaration of registers[]. - * gdbserver/Makefile.in (all): Add gdbreplay. - * gdbserver/gdbreplay.c: New file. - * gdbserver/README: Give example of recording a remote - debug session with gdb and then replaying it with gdbreplay. +Mon Jan 18 12:03:47 1999 Andrew Cagney + + * serial.c (serial_close): gdb_fclose tages gdb_file** arg, not + gdb_file*. + + * f-valprint.c, target.c, gdbarch.c: Pass gdb_stderr not stderr. + +Mon Jan 18 10:46:12 1999 Andrew Cagney + + * stack.c (print_frame_info_base): Don't cast call to + catch_errors. + (print_args_stub): Change char* arg to PTR. + * symmisc.c (print_symbol): Ditto. + * top.c (quit_cover): Ditto. + * remote.c (remote_open_1, remote_start_remote): Ditto. + * infrun.c (normal_stop, hook_stop_stub, restore_selected_frame): + Ditto. + + * stack.c (backtrace_command): Cast first arg of make_cleanup to + make_cleanup_func. + * remote.c (remote_kill): Cast putpkt arg to catch_errors_ftype. + +Mon Jan 18 08:47:02 1999 Andrew Cagney -Tue Jan 23 18:02:35 1996 Per Bothner - - * stabsread.c (rs6000_builtin_type): Make bool type unsigned. - (read_one_struct_field): Support boolean bitfields. - * c-valprint.c (c_val_print): Print booleans properly. - -Tue Jan 23 18:54:09 1996 Stan Shebs - - * remote-vxsparc.c (vx_convert_to_virtual, vx_convert_from_virtual): - Remove, never used. - * config/sparc/vxsparc.mt (TDEPFILES): Add remote-vxsparc.o. - -Tue Jan 23 14:36:05 1996 Per Bothner - - * ch-exp.c (parse_tuple): Error if invalid mode. - - * value.h (COERCE_ARRAY): Don't coerce enums. - (COERCE_ENUM): Don't COERCE_REF. - (COERCE_NUMBER): New macro (same as COERCE_ARRAY then COERCE_ENUM). - * valops.c (value_assign): Only do COERCE_ARRAY if internalvar (let - value_cast handle it otherwise); do *not* COERCE_ENUM either way. - * valarith.c: Use COERCE_NUMBER instead od COEREC_ARRAY. - Add COERCE_REF before COERCE_ENUM. - * values.c (value_as_long): Simplify. - - * valops.c (value_array): Create internalvar if !c_style_arrays. - - * language.c (lang_bool_type): Add Fortran support. - * eval.c (OP_BOOL): Use LA_BOOL_TYPE. - -Tue Jan 23 13:08:26 1996 Jeffrey A Law (law@cygnus.com) - - * symfile.c (auto_solib_add): Renamed from auto_solib_add_at_startup. - All references changed. - * breakpoint.c (bpstat_what): Add shlib_event to the class types. - Update state table. Reformat so that it's still readable. - When we hit the shlib_event breakpoint, set the calss of shlib_event. - (breakpoint_1): Add "shlib events" as a breakpoint type. - Print the shlib_event breakpoint like other breakpoints. - (create_solib_event_breakpoint): New function. - (breakpoint_re_set_one): Handle solib_event breakpoints. - * breakpoint.h (enum bytype): Add bp_shlib_event breakpoint type. - (enum bpstat_what_main_action): Add BPSTAT_WHAT_CHECK_SHLIBS - action. - (create_solib_event_breakpoint): Declare. - * infrun.c (wait_for_inferior): Handle CHECK_SHLIBS bpstat. - (normal_stop): Inform the user when the inferior stoped due - to a shared library event. - (_initialize_infrun): Add new set/show variable "stop-on-solib-events" - to control whether or not gdb continues the inferior or stops it when - a shared library event occurs. - * minsyms.c (lookup_minimal_symbol_solib_trampoline): New function. - * somsolib.c (TODO list): Update. - (som_solib_create_inferior_hook): Arrange for gdb to be notified - when significant shared library events occur. - * hppa-tdep.c (find_unwind_entry): No longer static. - -Tue Jan 23 09:00:48 1996 Doug Evans - - * printcmd.c (print_insn): Pass fprintf_unfiltered to - INIT_DISASSEMBLE_INFO. - -Mon Jan 22 16:59:40 1996 Stan Shebs - - * remote.c (remotebreak): New GDB variable. - (remote_break): New global. - (remote_interrupt): Send a break instead of ^C if remote_break. - * NEWS: Describe the new variable. - -Mon Jan 22 16:24:11 1996 Doug Evans - - * sparc-tdep.c (_initialize_sparc_tdep): Always use print_insn_sparc. - -Fri Jan 19 07:19:38 1996 Fred Fish - - * hp300ux-nat.c (getpagesize): Remove unused function - fetch_core_registers. - (hp300ux_core_fns): Remove, is unused. - (_initialize_core_hp300ux): Remove, is unused. - (gdbcore.h): Remove #include, no longer needed. + * defs.h (catch_errors_ftype): Define. + (catch_errors): Replace char* arg with PTR arg. + * top.c (catch_errors): Update + + * breakpoint.c (bpstat_stop_status, bpstat_stop_status, + delete_breakpoint, breakpoint_re_set): Delete all casts in call to + catch_errors. + (breakpoint_cond_eval, watchpoint_check, + cover_target_enable_exception_callback, breakpoint_re_set_one): + Arg is PTR not char*. -Fri Jan 19 00:59:53 1996 Jeffrey A Law (law@cygnus.com) + * breakpoint.c (cover_target_enable_exception_callback): Change + type to int. Check for cast values of 0 and -1. Return a result! + (insert_breakpoints): Move declaration of SAL and ARGS to where + they are used. + +1999-01-16 Fernando Nasser - * rs6000-nat.c (exec_one_dummy_insn): Rework to avoid - ptrace bug in aix4.1.3 on the rs6000. + * remote.c (remote_query): new function - creates proper interface + to the remote protocol "q" command. -Wed Jan 17 13:22:27 1996 Stan Shebs +Fri Jan 15 17:11:48 EST 1999 Zdenek Radouch (radouch@cygnus.com) - * remote-hms.c (hms_ops): Add value for to_thread_alive. - * remote-nindy.c (nindy_ops): Ditto. - * remote-udi.c (udi_ops): Ditto. + * config/fr30/tm-fr30.h: Changed ABI to match GCC change + (always use pointer for structs passed by value). -Tue Jan 16 18:00:35 1996 James G. Smith +1999-01-15 Fernando Nasser - * remote-mips.c (pmon_opn, pmon_wait, pmon_makeb64, pmon_zeroset, - pmon_checkset, pmon_make_fastrec, pmon_check_ack, - pmon_load_fast): New functions. Support for the PMON monitor world. - (common_open): New function to merge support for different monitors. - (mips_open): Use common_open(). - (mips_send_command): New function. - (mips_send_packet): Scan out-of-sequence packets. - (mips_enter_debug, mips_exit_debug): New functions. - (pmon_ops): New target definition structure. + * target.h: added entry for target queries (to_query) + target.c: ditto. + +Thu Jan 14 18:29:17 1999 David Taylor + + * remote-mm.c (mm_wait): fix stream arg to gdb_flush. + * remote-udi.c (udi_wait): fix stream arg to fwrite. + * symmisc.c (maintenance_check_symtabs): fix stream argument to + print_address_numeric. + +Wed Jan 13 19:33:16 1999 David Taylor + + * breakpoint.c (insert_breakpoints): insert cast to eliminate + warning. + +Wed Jan 13 14:59:02 1999 Michael Snyder + + * infrun.c (set/show scheduler-locking) New command. Set a + mode bit that will control how GDB attempts to control thread + scheduling for step, continue, etc. (resume): make use of + the schedule-locking mode. + * target.h (struct target_ops): new field to_has_thread_control. + * sol-thread.c: initialize target_ops to_has_thread_control. + * procfs.c: ditto. + * target.c: ditto. + * m3-nat.c: ditto. + * remote.c: ditto. + * hpux-thread.c: ditto. + * thread.c: cull duplicate prototypes. Move prototypes to top. + * serial.c: indentation cleanup. + * breakpoint.c: add casts to eliminate compiler warnings. -Tue Jan 16 11:22:58 1996 Stu Grossman (grossman@cygnus.com) +Tue Jan 12 17:00:00 1999 Edith Epstein + + * inftarg.c (child_create_inferior): fixed HPUXHPPA specific + call to fork_inferior. The shell param is now NULL. + +1999-01-12 Jason Molenda (jsm@bugshack.cygnus.com) + + * monitor.c (init_base_monitor_ops): Whitespace cleanup. + (_initialize_remote_monitors): Same. + +1999-01-12 Jason Molenda (jsm@bugshack.cygnus.com) + + * monitor.c (init_monitor_ops): Initialize the monitor_ops + structure if it hasn't already been done. + +Tue Jan 12 14:50:10 1999 Stan Shebs - * Makefile.in (CLIBS): Add LIBS to allow libraries to be - specified on the make command line (via make LIBS=xxx). + * inftarg.c (child_ops): Don't initialize statically. + (init_child_ops): New function, fills in child_ops. + (_initialize_inftarg): Use it. + (child_post_attach): Declare extern. + (child_wait): Fix ambiguous parens. + (child_attach_to_process): Remove unused local wstatus. + (child_insert_fork_catchpoint, child_remove_fork_catchpoint, + child_insert_vfork_catchpoint, child_remove_vfork_catchpoint, + child_has_forked, child_insert_exec_catchpoint, + child_remove_exec_catchpoint): Return a value. +Mon Jan 11 16:43:44 1999 Michael Snyder -Fri Jan 12 21:41:58 1996 Jeffrey A Law (law@cygnus.com) + * remote.c (remote_wait): Add inferior_pid to thread list only + if it is not already there. - * symtab.c (find_pc_symtab): Don't lose if OBJF_REORDERED - is set but there are no psymtabs. +1999-01-11 Jason Molenda (jsm@bugshack.cygnus.com) -Fri Jan 12 15:56:12 1996 Steve Chamberlain + * scm-tags.h: Update FSF's address on copyright notice. + * ser-e7kpc.c: Same. + * gnu-nat.h: Same. - * dsrec.c (load_srec): Remove unused variable. - * monitor.c (monitor_expect): Don't expect a ^C to echo. - * serial.c (serial_open): Add parallel interface. - * sh3-rom.c (parallel, parallel_in_use): New. - (sh3_load): If parallel_in_use, download though the - parallel port. - (sh3_open): Open parallel port if specified. - (sh3_close): New function. - (_inititalize_sh3): Add sh3_close hook and documentation. - * monitor.c (monitor_close): Export. - * monitor.h (monitor_close): Add prototype. +Mon Jan 11 13:45:57 1999 Stu Grossman -Fri Jan 12 13:11:42 1996 Stan Shebs + * dwarf2read.c (dump_die): Change stderr to gdb_stderr. + * expprint.c (print_subexp): fprintf => fprintf_unfiltered. + * jv-typeprint.c (java_type_print_base): fputs => fputs_filtered. + * stack.c (struct function_bounds): Remove superfluous `typedef'. + * symfile.c (list_overlays_command): stdout => gdb_stdout. + * symmisc.c (maintenance_check_symtabs): stdout => gdb_stdout. + * utils.c (print_spaces): Make more efficient. + +Mon Jan 11 13:55:51 1999 David Taylor - From Wilfried Moser : - * remote.c (remotetimeout): New GDB variable, use to set the - remote timeout for reading. + * utils (print_spaces): fix arg to strcat; fix formatting. +Fri Jan 8 11:57:24 1999 Stan Shebs -Fri Jan 12 07:14:27 1996 Fred Fish + * exec.c (exec_ops): Don't initialize statically. + (init_exec_ops): New function, fills in exec_ops. + (_initialize_exec): Use it. - * lynx-nat.c, irix4-nat.c, sparc-nat.c: Include gdbcore.h - to get "struct core_fns" defined. - * Makefile.in (lynx-nat.o, irix4-nat.o, sparc-nat.o): - Are dependent upon gdbcore_h. +Thu Jan 7 17:50:15 EST 1999 Zdenek Radouch (radouch@cygnus.com) -Thu Jan 11 23:13:24 1996 Per Bothner + Beta FR30 port. + * fr30-tdep.c + * config/fr30/tm-fr30.h + +Wed Jan 6 12:28:35 1999 David Taylor - * symfile.c (decrement_reading_symtab): New function. - * symfile.c, symtab.h (currently_reading_symtab): New variable. - * symfile.c (psymtab_to_symtab): Adjust currently_reading_symtab. - * gdbtypes.c (check_typedef): Don't call lookup_symbol if - currently_reading_symtab (since that could infinitely recurse). + * configure.in: Add an --enable-tui argument. Construct + tui/Makefile from tui/Makefile.in. Use AM_PROG_CC_STDC. If we + have the GUI, then we need this to process libgui.h. + (ENABLE_CFLAGS): define and export BUILD_TUI. + (AC_CHECK_HEADERS): Add check for term.h. + + * configure.host (hppa-*-hpux10.20, hppa-*-hpux11.0*): New configs. + + * config.in, configure : regenerated. + + * Makefile.in: Allow the TUI code to be conditionally enabled. + (TUI_LIBRARY): New variable, value are set by the configuration + script. Set to the empty string when the TUI isn't enabled. + (gdb$(GDBEXT)): Use those, instead of referring to all-tui and + tui/libtui.a directly. + (BUILD_TUI): build the tui -- only when configured with + --enable-tui. + (YLWRAP): use ylwrap to avoid problems on systems w/o bison. + (gdb$(EXEEXT)): make it dependent on BUILD_TUI. + (all-tui): remove dependency from phony target. + (c-exp.tab.c): use ylwrap instead of bison. + (jv-exp.tab.c): ditto. + (f-exp.tab.c): ditto. + (m2-exp.tab.c): ditto. + (ALLDEPFILES): add somread.c, hp-psymtab-read.c, hp-symtab-read.c. + (SFILES): remove the above files + (COMMON_OBS): remove somread.o + (SFILES): Add the tui files to this, so they get included in etags + tables. + (gdb$(EXEEXT)): Add all-tui to the list of dependencies, and add + tui/libtui.a to the link list. + (all-tui): New rule, which does a recursive make in the tui + subdir. + (tui/libtui.a): When recursing, pass down ${FLAGS_TO_PASS}. And + don't echo the make command. This is closer to what the other + recursions do. + (HFILES_NO_SRCDIR): add hpread.h + (COMMON_OBS): add hp-psymtab-read.o, hp-symtab-read.o + (SFILES): add hp-psymtab-read.c, hp-symtab-read.c add rules for + the new files. Remove hpread.c, hpread.o + (gdb$(EXEEXT)): Depend on the actual tui library, not on a + fictitious target. Since the fictitious target never existed, + make would always relink. + (tui/libtui.a): Always recurse to make sure the library is up to + date. + +Wed Jan 6 12:05:12 1999 Stan Shebs + + * remote.c: Pacify --enable-build-warnings, reformat code + to conform to standards, fix spelling errors. + (ishex, stubhex, record_currthread, etc): Declare. + (ishex, stubhex): Declare char arg as int. + (pack_string): Comment out, never used but possibly useful. + (threadref_to_int, remote_get_threadinfo, etc): Make static. + +Wed Jan 6 11:43:32 1999 David Taylor + + The following changes were made by Elena Zannoni + and Edith Epstein as + part of a project to merge in changes made by HP. + + * c-exp.y: use external flag hp_som_som_object_present to decide + whether code was compiled by HP's compilers. Add two new C++ + tokens for true and false. + (yylex): check for template name is done differently for the + HP/aCC compiler case. Change some of the template processing code + for handling HP aCC templates. Handle true and false tokens. + +Tue Jan 5 11:13:36 1999 Michael Snyder + + * remote.c (record_curthread): Must not modify inferior_pid when + called from wait_for_inferior. Instead, if a new thread-id is + detected, call add_thread. + (MAGIC_NULL_PID): new macro, use instead of the magic number + "42000". + (remote_find_new_threads): if inferior_pid is unknown, get and use + the current thread id. + (remote_start_remote): on connecting, attempt to get the current + thread id for inferior_pid. + (remote_resume): If pid == -1, then resume any-thread (not the + current thread specifically). Also some cosmetic fixups. + + * thread.c (info_threads_command): don't initialize current_pid + until after call to FIND_NEW_THREADS (which may change inferior_pid). + Also some cosmetic fixups. + * infrun.c: cosmetic fixups and casts to avoid warnings. + * infcmd.c: cosmetic fixups, mainly long lines. + +Tue Jan 5 11:55:57 1999 David Taylor + + * target.c (noprocess): terminate sentence with a period. + * breakpoint.c (catch_command_1): ditto. -Thu Jan 11 17:21:25 1996 Per Bothner + * c-valprint.c (c_value_print): remove hack^2 from HP; it causes + testsuite losses with no real gain. - * stabsread.c (read_struct_type): Trivial simplification. + * inferior.h (START_INFERIOR_TRAPS_EXPECTED): restore, but only + if tm-*.h hasn't overridden default value. - * stabsread.c (define-symbol): Use invisible references - for TYPE_CODE_SET and TYPE_CODE_BITSTRING too. - * valops.c (call_function_by_hand): Likewise. - * eval.c (evaluate_subexp_standard): When known, use the formal - parameter type as the expected type when evaluating arg expressions. - * ch-lang.c (evaluate_subexp_chill): Likewise (for MULTI_SUBSCRIPT). +1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com) + * configure.in: Fix whitespace indentation for --help. + * configure: Regenerated. -Wed Jan 10 16:08:49 1996 Brendan Kehoe +1999-01-04 Manuel Bouyer - * configure.in, configure: Recognize rs6000-*-aix4*. - * config/powerpc/xm-aix.h: Reduce to include "xm-aix4.h". - * config/rs6000/aix4.mh (XM_FILE): Point to xm-aix4.h. - * config/rs6000/xm-aix4.h: New file. - * config/xm-aix4.h: New file. + * main.c: Add --write command line option, document -w. + * gdb.1: Document --write. -Wed Jan 10 11:25:37 1996 Fred Fish +1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com) - From Wilfried Moser : - * gdbserver/low-linux.c: New file. - * remote.c (remote_read_bytes): Fix aborts on larger packets. - - * config/i386/linux.mh (GDBSERVER_DEPFILES, GDBSERVER_LIBS): - Define. - * stabsread.c (define_symbol): If register value is too large, - tell what it is and what max is. + * configure.in: Require autoconf 2.12.1 or higher. + * doc/configure.in: Ditto. + * nlm/configure.in: Ditto. + * rdi-share/configure.in: Ditto. + * testsuite/configure.in: Ditto. + * doc/Makefile.in: Don't hardcode $(SHELL). + * nlm/Makefile.in: Ditto. + * rdi-share/Makefile.in: Ditto. + * testsuite/Makefile.in: Ditto. +Mon Jan 4 12:53:03 1999 Stan Shebs -Tue Jan 9 09:33:53 1996 Jeffrey A Law (law@cygnus.com) - - * hpread.c (hpread_build_psymtabs): Finish Jan 4th - enum namespace -> enum_namespace change. - -Tue Jan 9 04:44:47 1996 Wilfried Moser (Alcatel) - - * ch-exp.c (parse_primval): In case ARRAY, add missing - FORWARD_TOKEN (). - -Mon Jan 8 13:29:34 1996 Stan Shebs - - * remote-mips.c (mips_receive_header): Recognize \012 instead - of \n, but write \n when program sends a \012. - * ser-mac.c (mac_input_buffer): Increase size of buffer. - -Mon Jan 8 12:00:40 1996 Jeffrey A Law (law@cygnus.com) - - * infptrace.c (initialize_infptrace): Move function out of - #ifdef conditional; put code within the function inside an - #ifdef conditional. - - * buildsym.c (end_symtab): Remove sort_pending and sort_linevec - arguments. Sorting is now dependent on OBJF_REORDERED. All - callers/references changed. - * dbxread.c (read_ofile_symtab): Correctly determine value for - last_source_start_addr for reordered executables. - (process_one_symbol): Handle N_FUN with no name as an end of - function marker. - * partial-stab.h (case N_FN, N_TEXT): Don't assume CUR_SYMBOL_VALUE - is the high text address for a psymtab. - (case N_SO): Likewise. - (case N_FUN): Handle N_FUN with no name as an end of function - marker. - * minsyms.c (lookup_minimal_symbol_by_pc): Examine all symbols - at the same address rather than a random subset of them. - * coffread.c (coff_symfile_init): Set OBJF_REORDERED. - * elfread.c (elf_symfile_init): Similarly. - * somread.c (som_symfile_init): Similarly. - * xcoffread.c (xcoff_symfile_init): Similarly. - -Fri Jan 5 17:46:01 1996 Stu Grossman (grossman@cygnus.com) - - * stack.c (print_stack_frame print_frame_info) symmisc.c - (dump_symtab): Change RETURN_MASK_ERROR to RETURN_MASK_ALL so - that catch_errors doesn't get blindsided by QUIT and lose the - cleanup chain. This fixes a problem where ^C while in a - user-defined command sometimes leaves instream NULL and causes a - segfault in command_loop. - -Fri Jan 5 13:59:16 1996 Brendan Kehoe - - * configure.in, configure: Add `-ldl -lw' for Solaris linking. - -Fri Jan 5 12:02:00 1996 Steve Chamberlain - - * config/sh/sh.mt, config/powerpc/*.mt, config/pa/hppapro.mt, - config/m68k/monitor.mt, config/h8500/h8500.mt, config/h8300/h8300.mt: - srec.o renamed to dsrec.o. - -Thu Jan 4 16:04:54 1996 Stu Grossman (grossman@cygnus.com) - - * breakpoint.c (remove_breakpoint): Change error to warning so - that hardware watchpoint removal problems won't leave breakpoint - traps in the target. - * remote-e7000.c (e7000_insert_breakpoint, - e7000_remove_breakpoint): Use e7000 based breakpoints, not memory - breakpoints. - * (e7000_wait): Adjust PC back by two when we see a breakpoint to - compensate for e7000 maladjustment. - * sparcl-tdep.c (sparclite_check_watch_resources): Fix logic bug - which prevented hardware watchpoints from working. - -Thu Jan 4 10:44:17 1996 Fred Fish - - * infptrace.c (udot_info): New function. - (PT_*): Define each individually if that one is not defined. - * rs6000-nat.c (kernel_u_size): New function - Include for "struct user" - * alpha-nat.c (kernel_u_size): New function. - Include for "struct user" - * sparc-nat.c (kernel_u_size): New function. - Include for "struct user" - * i386b-nat.c (kernel_u_size): New function. - * i386v-nat.c (kernel_u_size): New function. - * config/i386/nm-fbsd.h (KERNEL_U_SIZE): Define. - (kernel_u_size): Declare. - * config/i386/nm-linux.h (KERNEL_U_SIZE): Define. - (kernel_u_size): Declare. - * config/sparc/nm-sun4os4.h (KERNEL_U_SIZE): Define. - (kernel_u_size): Declare. - * config/alpha/nm-osf2.h (KERNEL_U_SIZE): Define. - (kernel_u_size): Declare. - * config/rs6000/nm-rs6000.h (KERNEL_U_SIZE): Define. - (kernel_u_size): Declare. - -Thu Jan 4 11:00:01 1996 steve chamberlain - - * mdebugread.c (mylookup_symbol): enum namespace becomes - enum_namespace type. - * symfile.c (add_psymbol_to_list) - (add_psymbol_addr_to_list): Ditto. - * symtab.c (lookup_partial_symbol): Ditto. - (lookup_symbol): Ditto. - (lookup_block_symbol): Ditto. - * win32-nat.c (handle_load_dll): Use incoming dll base. - (child_wait): Catch DLL load errors. - (create_child_inferior): Translated between paths correctly. - -Wed Jan 3 23:13:53 1996 Fred Fish - - * i386v4-nat.c (supply_gregset, fill_gregset): Subtract NUM_FREGS - from NUM_REGS to get number of general registers that we care about. - * config/i386/tm-i386.h (REGISTER_BYTES): Define in terms - of number of general regs and number of floating point regs. - -Wed Jan 3 19:49:54 1996 steve chamberlain - - * config/i386/tm-win32.h (IN_SOLIB_CALL_TRAMPOLINE): New. - (SKIP_TRAMPOLINE_CODE): New. - * config/i386/xm-win32.h (CANT_FORK): Deleted. - (SLASH*) Changed to use unix style slash. - * symtab.h (namespace enum): becomes typedef to avoid namespace - collision in C++. - * infcmd.c (path_command): Use empty string if PATH name not set. - * i386-tdep.c (skip_trampoline_code): New function. - * srec.c: Renamed dsrec.c to avoid filename collision. - * Makefile.in: Cope with renaming. - -Wed Jan 3 13:09:04 1996 Fred Fish + * remote-vx.c (init_vx_ops, init_vx_run_ops): Remove unneeded + inits of new fields, including ref to bogus field. + (vx_ops, vx_run_ops): Make static. - * symmisc.c (print_objfile_statistics): Print memory use statistics - for objfile psymbol, symbol, and type obstacks. +Mon Jan 4 15:05:29 1999 David Taylor -Tue Jan 2 13:41:14 1996 Stan Shebs + * inferior.h (START_INFERIOR_TRAPS_EXPECTED): delete, + already defined in tm.h. - * config/mips/nm-irix5.h: Restore. - (TARGET_HAS_HARDWARE_WATCHPOINTS, etc): Define as for Irix 4; - from Lee Iverson . - * config/mips/irix5.mh (NAT_FILE): Use nm-irix5.h. - * config/mips/irix[345].mh (MUNCH_DEFINE): Remove. + * inftarg.c: change to and + conditionalize its inclusion. + * infttrace.c: ditto. -For older changes see ChangeLog-95 +For older changes see ChangeLog-98 Local Variables: -mode: indented-text +mode: change-log left-margin: 8 fill-column: 74 version-control: never diff --git a/contrib/gdb/gdb/ChangeLog-95 b/contrib/gdb/gdb/ChangeLog-95 index cdf4dda..2265be8 100644 --- a/contrib/gdb/gdb/ChangeLog-95 +++ b/contrib/gdb/gdb/ChangeLog-95 @@ -3,7 +3,6 @@ Fri Dec 29 16:30:58 1995 Stan Shebs * symfile.c (find_sym_fns): Add PowerMac to xcoff file recognition kludge. - Fri Dec 22 11:05:59 1995 Michael Meissner * configure.in (gdb_host): Add support for DG/UX running on x86 as @@ -108,7 +107,6 @@ Mon Dec 11 18:19:16 1995 Stan Shebs * mac-gdb.r: Fix version resources to use symbolic version strings. (cfrg): New resource, code fragment for PowerMac. - Mon Dec 11 14:13:03 1995 Fred Fish * dbxread.c (process_one_symbol): When looking at the next @@ -119,7 +117,7 @@ Mon Dec 11 15:56:55 1995 Per Bothner * eval.c (evaluate_struct_tuple): Fix thinko. -Mon Dec 11 06:52:02 1995 Wilfried Moser (Alcatel) +Mon Dec 11 06:52:02 1995 Wilfried Moser * ch-typeprint.c (chill_type_print_base): Slightly change of printing of variant structures. @@ -843,7 +841,8 @@ Fri Oct 27 09:54:07 1995 Stu Grossman (grossman@cygnus.com) startup. Eliminate sleeps. Clear breakpoints (if using monitor breakpoints). Re-init frame. * (mips_detach): Close down target. - * (mips_wait): Handle return status with registers, or breakpoint stuff. + * (mips_wait): Handle return status with registers, or breakpoint + * stuff. * (mips_kill): Add ^C handling. * (mips_insert_breakpoint mips_remove_breakpoint): Call new breakpoint stuff if enabled. @@ -856,7 +855,6 @@ Fri Oct 27 09:54:07 1995 Stu Grossman (grossman@cygnus.com) user-defined commands to suppress auto-repeat (by hittin return key). * valops.c: Add start of auto function-call abandonment capability. - Thu Oct 26 22:02:27 1995 Stan Shebs * mpw-config.in: Add support for PowerMac host, add beginnings @@ -1817,7 +1815,7 @@ Tue Aug 1 11:44:53 1995 J.T. Conklin inflow.c, infptrace.c, infrun.c, irix5-nat.c, language.c, m2-typeprint.c, main.c, mdebugread.c, minsyms.c, mipsread.c, monitor.c, nlmread.c, objfiles.c, os9kread.c, osfsolib.c, parse.c, - printcmd.c, procfs.c, regex.c, remote-adapt.c, remote-arc.c, + printcmd.c, procfs.c, regex.c, remote-adapt.c, remote-array.c, remote-bug.c, remote-e7000.c, remote-eb.c, remote-es.c, remote-hms.c, remote-mm.c, remote-os9k.c, remote-pa.c, remote-sim.c, remote-st.c, remote-udi.c, @@ -2237,7 +2235,6 @@ Thu Jul 13 13:42:38 1995 Jeffrey A. Law * m3-nat.c (m3_ops): Likewise. * monitor.c (monitor_ops): Likewise. * procfs.c (procfs_ops): Likewise. - * remote-arc.c (arc_ops): Likewise. * remote-array.c (array_ops): Likewise. * remote-e7000.c (e7000_ops): Likewise. * remote-es.c (es1800_ops, es1800_child_ops): Likewise. @@ -2551,6 +2548,16 @@ Sat Jun 3 01:54:56 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * value.h (struct value): Change `repetitions' field from `short' to `int' type. +Fri Jun 2 11:17:23 1995 Doug Evans + + * arc-tdep.c (arc_bfd_mach_type): New static global. + (codestream_fill): Handle byte order differences. + (setup_prologue_scan): Don't read stdarg function's "sub sp,sp,N". + (arc_get_frame_setup): Read it here. + (arc_frame_saved_pc): And here. + (arc_print_insn): New function. + (arc_set_cpu_type): Set arc_bfd_mach_type. Don't set tm_print_insn. + (_initialize_arc_tdep): Set tm_print_insn to arc_print_insn. Wed May 31 12:04:01 1995 J.T. Conklin @@ -2884,6 +2891,7 @@ Tue May 2 18:32:24 1995 Stan Shebs * remote-nrom.c: New file, NetROM target support. * config/a29k/a29k-udi.mt, config/i960/vxworks960.mt: Use REMOTE_OBS instead of REMOTE_O. + * config/arc/arc.mt: Ditto. Fri Apr 28 23:30:00 1995 Stu Grossman (grossman@cygnus.com) @@ -3056,6 +3064,41 @@ Wed Apr 12 14:34:31 1995 Jim Kingdon * xcoffread.c: Call complain() rather than error() or printing a warning. +Wed Apr 12 08:15:27 1995 Doug Evans + + * arc-tdep.c: #include "gdbcmd.h". + (codestream_seek): Pass CORE_ADDR. + (arc_cpu_type, tmp_arc_cpu_type, arc_cpu_type_table): New globals. + (debug_pipeline_p): Likewise. + (X_...): Instruction field access macros. + (BUILD_INSN): Define. + (codestream_tell): Allow for stream elements > 1 byte. + (codestream_fill): Likewise. + (setup_prologue_scan): New function. + (arc_get_frame_setup): Call it. Update to current spec + regarding prologues. Use BUILD_INSN. + (skip_prologue): New argument `frameless_p'. Use BUILD_INSN. + (arc_frame_saved_pc): New function. + (frame_find_saved_regs): Use BUILD_INSN. + (get_insn_type, single_step): New functions. + (one_stepped): New global. + (arc_set_cpu_type_command, arc_show_cpu_type_command): New functions. + (arc_set_cpu_type): New function. + (_initialize_arc_tdep): Define new `set' commands `cpu', + `displaypipeline', and `debugpipeline'. + * arc/tm-arc.h (TARGET_BYTE_ORDER): Delete. + (TARGET_BYTE_ORDER_SELECTABLE): Define. + (DEFAULT_ARC_CPU_TYPE): Define. + (SKIP_PROLOGUE_FRAMELESS_P): Define. + (BREAKPOINT): Delete. + (BIG_BREAKPOINT, LITTLE_BREAKPOINT): Define. + (DECR_PC_AFTER_BREAK): Change to 8. + (NO_SINGLE_STEP): Define. + (ARC_PC_TO_REAL_ADDRESS): Define. + (SAVED_PC_AFTER_CALL): Use it. + (NUM_REGS, REGISTER_BYTES): Fix. + (FRAME_SAVED_PC): Call arc_frame_saved_pc. + (FRAME_LOCALS_ADDRESS): Fix. Tue Apr 11 16:42:37 1995 Jim Kingdon (kingdon@lioth.cygnus.com) @@ -3647,6 +3690,9 @@ Mon Mar 13 15:25:47 1995 Jim Kingdon * alpha-tdep.c (find_proc_desc): If pdr.framereg field is -1, don't use the PDR, just examine prologues instead. +Fri Mar 10 16:13:18 1995 Kung Hsu + + * config/arc/tm-arc.h: Change arc register names. Fri Mar 10 02:49:40 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) @@ -3742,9 +3788,9 @@ Tue Mar 7 00:23:47 1995 Stu Grossman (grossman@cygnus.com) match the IDP monitor. Also, set NUM_REGS to 18 cuz there's no floating-point for this card. - * serial.h, ser-go32.c, ser-go32-para.c, ser-mac.c, ser-tcp.c, - ser-unix.c: Add SERIAL_SETSTOPBITS to set the number of stopbits - (needed for IDP board?!?!?). + * serial.h, ser-go32.c, ser-mac.c, ser-tcp.c, ser-unix.c: Add + SERIAL_SETSTOPBITS to set the number of stopbits (needed for IDP + board?!?!?). * defs.h, utils.c, remote-hms.c, remote-pa.c, remote.c: Fix defs and usage of fputc_unfiltered and putchar_unfiltered. Eliminate @@ -3901,7 +3947,8 @@ Tue Feb 28 14:38:39 1995 Kung Hsu * defs.h (SWAP_TARGET_AND_HOST): check endianess at runtime not compile time. - + * arc-tdep.c (_initialize_arc_tdep): set tm_print_insn according to + processor. * vx-share/ptrace.h: merge in WRS new ptrace requests. @@ -4147,6 +4194,7 @@ Mon Feb 6 18:50:59 1995 Stan Shebs * i386-tdep.c (_initialize_i386_tdep): Put void decl on separate line, so init.c generation works correctly. + * arc-tdep.c (_initialize_arc_tdep): Ditto. Mon Feb 6 14:44:36 1995 Rob Savoye @@ -4160,10 +4208,6 @@ Sat Feb 4 13:29:52 1995 Stan Shebs * config/m68k/est.mt (TDEPFILES): Remove m68k-pinsn.o. -Fri Feb 3 16:47:31 1995 Kung Hsu - - * ser-go32-para.c (dos_read): fix syntax errors. - Fri Feb 3 11:19:20 1995 Stu Grossman (grossman@cygnus.com) * core.c (dis_asm_read_memory), defs.h, top.c: Get rid of @@ -4190,7 +4234,11 @@ Thu Feb 2 19:02:45 1995 Rob Savoye Thu Feb 2 16:11:04 1995 Kung Hsu - * ser-go32-para.c: new file for go32 parallel port communication. + * config/arc/arc.mt: new target makefile for arc processor. + * config/arc/tm-arc.h: new target header for arc processor. + * config/arc/go32.mh: new go32 host makefile for arc processor. + * config/arc/xm-go32.h: new go32 host header for arc processor. + * arc-tdep.c: new target dependent codes for arc processor. Thu Feb 2 13:58:40 1995 Stan Shebs @@ -4473,21 +4521,6 @@ Wed Jan 25 01:11:21 1995 Jeff Law (law@snake.cs.utah.edu) * hpread.c (hpread_process_one_debug_symbol): Fix lines garbled by an ill-advised global search and replace. -Tue Jan 24 12:10:28 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (create_registers_window): Work around a radiobutton - widget bug to make Options|Natural button work. - - * gdbtk.c (gdb_disassemble): Fix problem with source+assembly and - g++ caused by out-of-order pc's. - * gdbtk.tcl (files_command): Remove duplicate file names. Also, - add scrollbar. - -Mon Jan 23 17:21:09 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl: Take .gdbtkinit if it exists. Makes gdbtk match the - doc! - Mon Jan 23 13:11:46 1995 Per Bothner Add support for Chill bitstring literals (e.h. H'FF00'). diff --git a/contrib/gdb/gdb/ChangeLog-96 b/contrib/gdb/gdb/ChangeLog-96 new file mode 100644 index 0000000..760b425 --- /dev/null +++ b/contrib/gdb/gdb/ChangeLog-96 @@ -0,0 +1,5116 @@ +Tue Dec 31 15:19:32 1996 Geoffrey Noer + + * config/mn10300/tm-mn10300.h: more small register fixes + +Tue Dec 31 06:51:43 1996 Mark Alexander + + * config/i386/xm-windows.h: Undo previous change to SIGTRAP + and SIGQUIT values; it messed up non-MIPS targets. + * config/mips/tm-mips.h: Undefine BREAKPOINT, replace + with separate LITTLE_BREAKPOINT and BIG_BREAKPOINT definitions; + this fixes problem with setting breakpoints in little-endian + programs in the simulator. + +Mon Dec 30 00:14:06 1996 Doug Evans + + * remote-sim.c (gdbsim_open_p): New static local. + (gdbsim_open): Call unpush_target if sim open. Set gdbsim_open_p. + (gdbsim_close): Only call sim_close if sim open. Reset gdbsim_open_p. + +Sun Dec 29 09:15:03 1996 Mark Alexander + + * config/i386/xm-windows.h: Make SIGTRAP and SIGQUIT consistent + with sim/mips/support.h. + +Fri Dec 27 14:53:40 1996 Michael Meissner + + * v850-tdep.c (struct pifsr): Add cur_frameoffset field. + (v850_scan_prologue): Add debug code #ifdef'ed DEBUG. Support new + compiler prologues using register save functions and short store + instructions. Add support for functions with large stack frames. + + * config/v850/tm-vm850.h ({R0,R1,R12,EP}_REGNUMS): New register + number defintiions for r0, r1, r12, ep. + (SAVE{1,2,3}_{START,END}_REGNUM): Register number definitions for + the 3 sets of saved registers. + +Thu Dec 26 19:56:55 1996 Mark Alexander + + * valprint.c (print_longest): Don't lose upper bits + of 64-bit values on Windows. + * config/i386/xm-windows.h: Leave CC_HAS_LONG_LONG defined, + undefine PRINTF_HAS_LONG_LONG, so that 64-bit values will + be printed without loss of upper bits. + +Thu Dec 26 15:15:21 1996 Michael Snyder + + * config/sparc/tm-sparclet.h: make registers ASR15, ASR19 invisible + (they're not useful, you can't change, write or even read them) + +Thu Dec 26 15:20:48 1996 Fred Fish + + * config/pa/hppahpux.mh (TERMCAP): Always link to libc before + libcurses, to avoid picking up broken select() from libcurses + on some versions of HPUX. + +Thu Dec 26 15:14:41 1996 Michael Snyder + + * sparclet-rom.c: Remove includes of Unix system files. + Add function "sparclet_supply_register" so that parse_register_dump + will not seg-fault by calling a null function pointer. + Remove XMODEM support (unfinished work?). + Remove flag "MO_HANDLE_NL", so monitor's output can be read by humans. + Add fill command. + Remove colon from getreg.resp_delim so PSR register will work. + Remove pointer to sparclet_load (downloading SREC's doesn't work). + Null out local register names for %g0, all %cc and all %asr regs, + since the monitor can't report them. Will return zero instead. + * sparclet-stub.c: New -- remote protocol support for sparclet CPU. + * config/sparc/tm-sparclet.h: Re-arrange REGISTER_NAMES: + Add back %g0 and %psr, add %cc coprocessor regs, add %asr regs. + Adjust NUM_REGS and REGISTER_BYTES accordingly + +Tue Dec 24 10:27:37 1996 Jeffrey A Law (law@cygnus.com) + + * remote-e7000.c (want_h8300h, want_nopc_h8300h): Renamed + from want and want_nopc. + (want_h8300s, want_nopc_h8300s): New variables for H8/S register + lists. + (e7000_fetch_registers): Use H8/300H or H8/S register list string + as needed. + (e7000_wait): Likewise. + +Mon Dec 23 02:25:58 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * mips-tdep.c (mips_find_saved_regs): If a frame has been + interrupted by a signal, figure out whether the registers that + the proc_desc claims are saved have been saved yet. + (mips_push_dummy_frame): Write dummy frame register after all + registers have been saved in the dummy frame. Update comments + to reflect the fact that we are now using an AT_ENTRY_POINT + call dummy. + +Sun Dec 22 15:52:25 1996 Martin M. Hunt + + * d10v-tdep.c (d10v_skip_prologue): PR11287. Fix problem where + some breakpoints weren't being set. + +Sat Dec 21 12:57:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * config/mips/tm-mips.h (PC_IN_CALL_DUMMY): Removed, the default + definition in inferior.h is sufficient. + * mips-tdep.c (mips_pc_in_call_dummy): Ditto. + (mips_push_arguments): Make sure that the stack is aligned to a + multiple of 8 after the arguments are pushed. + Structures are always passed by value in the old ABI. + Adjust argument register value on big endian targets when passing + a value whose length is less than the register size. + Write stack arguments with a single write_memory call. + (mips_pop_frame): Use frame_saved_regs instead of proc_desc to + decide which registers have to be restored. + + * irix5-nat.c (fill_gregset): Sign extend registers before + filling in the gregset structure. + +Fri Dec 20 11:06:03 1996 Stu Grossman (grossman@critters.cygnus.com) + + * mswin/genmakes: Don't define _DEBUG. This breaks wingdb. + +Thu Dec 19 19:42:44 1996 Michael Meissner + + * v850-tdep.c (v850_scan_prologue): Deal with -mep shorting + register saves by using the ep register. + +Thu Dec 19 15:57:16 1996 Doug Evans + + * m32r-tdep.c (m32r_frame_find_saved_regs): Fix thinko in arg def. + +Thu Dec 19 09:38:56 1996 Mark Alexander + + * values.c (unpack_double): Make it compile with MSVC++ 2.x. + * remote-mips.c (S_IROTH): Define if not defined by stat.h, e.g. + when using MSVC++. + (common_open): Fix help string. + +Wed Dec 18 23:01:32 1996 Stan Shebs + + * mpw-make.sed: Use NewFolderRecursive for installation. + +Sat Dec 14 20:50:01 1996 Mark Alexander + + * mips-tdep.c (mips_push_arguments): Handle floating point args. + * config/mips/tm-mips.h (FIX_CALL_DUMMY): Define to set up $25 + correctly for PIC on Irix 5. + +Sat Dec 14 09:52:30 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * i386-tdep.c (i386_frame_find_saved_regs): Handle zero return + from get_pc_function_start gracefully. + +Sat Dec 14 00:43:57 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * c-exp.y (qualified_name): Replace explicit check for valid + destructor name with call to destructor_name_p. + + * c-lang.h, c-typeprint.c (cp_type_print_method_args): Removed, + no longer needed. + + * c-typeprint.c (c_type_print_varspec_prefix, c_type_print_base): + Replace remaining fprintf_unfiltered calls with their filtered variant. + (c_type_print_base): Do not print return type for destructors from + template classes. + Replace cp_type_print_method_args with cplus_demangle call to get + consistent type output for stubbed and unstubbed methods. + + * cp-valprint.c (cp_print_class_method): Replace + cp_type_print_method_args with cplus_demangle call to get consistent + type output for stubbed and unstubbed methods. + + * gdbtypes.c, gdbtypes.h (get_destructor_fn_field): New function + to find the destructor field indices for a type. + + * gdbtypes.h (struct type): Clarify comments for vptr_basetype + and arg_types fields. + (struct fn_field): Remove args field, no longer used. + + * symtab.c (decode_line_1), valops.c (value_struct_elt, + check_field_in): Use get_destructor_fn_field to find the destructor + field indices instead of assuming that the compiler passes the member + function fields in a specific order. + + * symtab.c (find_methods): Pass NULL instead of SYMBOL_BLOCK_VALUE + to lookup_symbol. + (list_symbol): Replace cp_type_print_method_args with cplus_demangle + call in zapped out code and explain why this code is zapped out. + +Thu Dec 12 13:29:14 1996 Michael Meissner + + * config/powerpc/ppc{,le}-sim.mt (SIM): Add the simulator common + library ../sim/common/libcommon.a. + +Wed Dec 11 11:15:08 1996 Doug Evans + + * monitor.c (monitor_load): Add support for load address argument. + * dsrec.c: #include . + (load_srec): New argument load_offset. Print download stats. + * srec.h (load_srec): Update prototype. + * sh3-rom.c (sh3_load): Update call to load_srec. + +Mon Dec 9 17:34:05 1996 Geoffrey Noer + + * config/mn10300/tm-mn10300.h: more small register fixes + * mn10300-tdep.c: filled in from another target + +Mon Dec 9 17:12:19 1996 Doug Evans + + * monitor.c (monitor_insert_breakpoint): Handle bi-endian machines. + +Mon Dec 9 15:58:51 1996 Mark Alexander + + * config/mips/tm-mips.h: Get rid of call-dummy code. + Minor changes to make pre-ANSI compilers happy. + * mips-tdep.c: Minor changes to make pre-ANSI compilers happy. + (mips_push_arguments): Rewrite to partially support EABI. + (mips_pc_in_call_dummy): New function. + * infcmd.c: Include symfile.h to get prototype of entry_point_address, + which fixes 64-bit sign extension bug on MIPS. + +Mon Dec 9 00:14:49 1996 Geoffrey Noer + + * config/mn10300/tm-mn10300.h: fix register names + * mn10300-tdep.c: new skeleton tdep for mn10300 + +Sun Dec 8 18:02:57 1996 Doug Evans + + * remote-sim.h: Update some comments. + * remote-sim.c (gdb_os_error): New function. + (init_callbacks): Fix initializing of gdb_callback. Add gdb_os_error. + (gdb_os_printf_filtered): Use gdb_stdout, not stdout. + +Sun Dec 8 00:36:31 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * irix5-nat.c (supply_gregset, fill_gregset): Handle gregsets + from O32 and N32 ABI. + (xfer_link_map_member): Work around problem with alignments + in struct obj when compiling GDB under N32 ABI. + +Thu Dec 5 23:30:44 1996 Stan Shebs + + * d10v-tdep.c: Add support for examination and interpretation + of instruction trace buffer. + (trace, untrace, info trace, tdisassemble): New commands. + +Thu Dec 5 14:06:23 1996 Doug Evans + + * config/sparc/tm-sparclet.h (TARGET_BYTE_ORDER): Undef. + (TARGET_BYTE_ORDER_SELECTABLE): Define. + (BREAKPOINT): Undef. + ({BIG,LITTLE}_BREAKPOINT): Define. + (TM_PRINT_INSN_MACH): Redefine for sparclet. + +Wed Dec 4 16:34:05 1996 Geoffrey Noer + + * config/mn10300/mn10300.mt, config/mn10300/tm-mn10300.h: New. + +Tue Dec 3 13:02:08 1996 Fred Fish + + * infptrace.c (store_inferior_registers): Move some common code out + to store_register, like fetch_inferior_registers & fetch_register. + (store_register): New function, from store_inferior_registers. + (fetch_inferior_registers, fetch_register): Minor code tweaks to + make {fetch,store}_inferior_registers and {fetch,store}_register + routines as similar in structure as possible. + (fetch_inferior_registers, store_inferior_registers): Eliminate + local variable numregs and just use ARCH_NUM_REGS directly. + +Tue Dec 3 11:38:14 1996 Michael Snyder + + * blockframe.c: add macro USE_GENERIC_DUMMY_FRAMES to enable/disable + code for generic call_dummy frames. + * config/h8300/tm-h8300.h: turn on USE_GENERIC_DUMMY_FRAMES + * config/m32r/tm-m32r.h: Ditto. + * config/sh/tm-sh.h: Ditto. + * config/v850/tm-v850.h: Ditto. + +Sun Dec 1 00:41:47 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * vax-tdep.c (vax_print_insn, print_insn_arg): Use info functions + for printing. From Valeriy Ushakov . + +Sun Dec 1 00:40:46 1996 Geoffrey Noer + + * configure.tgt: Add new mn10300 entry. + +Sun Dec 1 00:18:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + Add support for Irix 6.2 native O32 and N32 ABI. + + * config.in, configure.in, configure: Check for . + * configure.tgt: Handle mips*-sgi-irix6* like irix5 for now. + + * cp-valprint.c (cp_print_value_fields): Use SYMBOL_VALUE_ADDRESS + instead of SYMBOL_BLOCK_VALUE to get the address of a static member. + + * dwarf2read.c: Turn warnings and recoverable errors into complaints, + add new complaints where appropriate. + gcc -Wall cleanup. + (struct line_head): Change line_base from char to int to avoid + problems with compilers whose plain char is represented by an + unsigned char. + (struct partial_die_info): Add is_declaration field. + (dwarf2_tmp_obstack): New obstack for allocating temporary storage + used during symbol reading. + (cu_header_offset): New variable for resolving relative reference + dies. + (optimized_out, basereg, islocal, frame_base_reg, frame_base_offset): + New interface variables for decode_locdesc. + (struct dwarf2_pinfo): New structure for communication between + psymtab and symtab reading, passed via pst->read_symtab_private. + (dwarf2_has_info, dwarf2_build_psymtabs): Accept objects files + without line number sections. + (dwarf2_build_psymtabs_hard): Initialize temporary obstack + for symbol reading. + Allocate and initialize pst->read_symtab_private. + Relocate pst->textlow and pst->texthigh with baseaddr. + (scan_partial_symbols): Do not add DW_AT_declaration symbols + to the partial symbol table. + Add file scope enumerator symbols to the partial symbol table. + Fix typo in highpc computation. + If we didn't find a lowpc, set it to highpc to avoid complaints + from `maint check. + (add_partial_symbol): Relocate symbol values with baseaddr. + Add static DW_TAG_subprogram and DW_TAG_variable symbols to the + minimal symbol table. + Obtain symbol values for DW_TAG_variable symbols from the location + descriptor, skip symbols with missing location desciptors. + Skip symbols for aggregate types without children. + Handle enumerator symbols. + (dwarf2_psymtab_to_symtab): Issue symbol reading message if verbose. + (psymtab_to_symtab_1): Set local variables from + pst->read_symtab_private, set cu_header_offset and baseaddr. + Initialize temporary obstack for symbol reading, initialize + buildsym and add a cleanup to really_free_pendings. + Relocate highpc with baseaddr when calling end_symtab. + If the compilation is from a C file generated by language + preprocessors, do not set the symtab language if it was already + deduced by start_subfile. + Removed verbose sorting symbol table message. + (process_die): Handle DW_TAG_ptr_to_member_type and + DW_TAG_reference_type. + Use read_subroutine_type to get the function type for + DW_TAG_subprogram before calling read_func_scope. + (read_file_scope): Initialize file name to , start_subfile + expects a non-NULL name. + If we didn't find a lowpc, set it to highpc to avoid complaints + from finish_symbol. + Relocate lowpc and highpc with baseaddr. + Get rid of Irix6.2 native cc compile machine prefix in comp_dir. + Zero out ftypes for each new compilation unit (may be different + language or different objfile). + Accept compilation units without line number information, pass + comp_dir to decode_lines. + (read_func_scope): Initialize function name to to avoid + core dumps when DW_AT_name is missing. + Relocate lowpc and highpc with baseaddr. + Handle DW_AT_frame_base, keep result for DW_OP_fbreg operations. + Pass function type to new_symbol. + (read_lexical_block_scope): Relocate lowpc and highpc with baseaddr. + (read_structure_scope): Set TYPE_TAG_NAME, not TYPE_NAME. + Handle DW_TAG_class_type. + Copy fields to type_obstack, release temporary storage for fields. + Don't add symbol if die is a stub die and has no children. + Handle C++ static member fields. + (read_enumeration): Set TYPE_TAG_NAME, not TYPE_NAME. + Copy fields to type_obstack, release temporary storage for fields. + Let new_symbol handle the symbol creation for enumerators + instead of handcrafting a symbol. + Determine signedness of enum type from enumerators. + (dwarf_read_array_type): Handle variable length arrays. + Use lookup_pointer_type instead of handcrafting a type. + Create array type only if a DW_TAG_subrange_type was found. + (read_tag_pointer_type, read_tag_reference_type): + Use lookup_pointer_type and lookup_reference_type instead + of handcrafting a type. + (read_tag_ptr_to_member_type): New function to handle + DW_TAG_ptr_to_member_type. + (read_subroutine_type): Handle parameter dies. + Use lookup_function_type instead of handcrafting a type. + (read_typedef): Allocate a TYPE_CODE_TYPEDEF type for the typedef. + (read_base_type): If the type has a name, use init_type to create + a new type instead of second guessing a fundamental type. + (read_comp_unit): Reset die reference table before building + a new one. + (dwarf2_read_section): Read section contents into psymbol_obstack. + (dwarf2_read_abbrevs): Handle unterminated abbreviations + for a compile unit gracefully. + (read_partial_die): Zero partial die before reading its info. + Handle DW_AT_declaration. + Fix typo in handling of DW_FORM_block4. + (read_full_die): Fix typo in handling of DW_FORM_block4. + (read_1_signed_byte, read_2_signed_bytes, read_4_signed_bytes): + New routines to get signed values from a buffer. + (read_n_bytes, read_string): Allocate storage from the temporary + obstack. If the host char size permits it, return pointer + to buffer instead of allocating storage. + (set_cu_language): Handle DW_LANG_Mips_Assembler. + (dwarf_attr): Return NULL if reference die for DW_AT_specification + or DW_AT_abstract_origin die is not found. + (record_minimal_symbol): Removed, replaced with a direct call to + prim_record_minimal_symbol, it now handles saving the string itself. + (convert_locdesc): Removed, partial symtab reading now uses + decode_locdesc. + (dwarf_attr): Use dwarf2_get_ref_die_offset to get the absolute + offset for the die reference. + (dwarf_decode_lines): Complain if the line section info is missing. + Use read_1_signed_byte to extract lh.line_base to avoid + problems with compilers whose plain char is represented by an + unsigned char. + Add cleanups for allocated temporary storage. + Start a subfile for the first file in the state machine. + Fix off by one problem with dirs.dirs access. + Use comp_dir when directory index is 0. + Support multiple sequences (from Jason Merrill ). + (dwarf2_start_subfile): Try to keep line numbers from identical + absolute and relative file names in a common subfile. + (new_symbol): Allocate symbol and symbol name on the symbol_obstack. + Set SYMBOL_LINE from DW_AT_decl_line if present. + Set SYMBOL_TYPE from passed type if not NULL. + Change DW_TAG_variable symbol types with missing type entries + to a sensible type. + Handle optimized_out, offreg and islocal storage classes. + Add external symbols with type information whose address isn't + known as LOC_UNRESOLVED symbols. + Synthesize typedefs for C++ classes, structs, unions and enumerations. + Handle DW_TAG_enumerator symbols, complain for unrecognized + symbol tags. + (die_type): A missing DW_AT_type represents a void type. + Use dwarf2_get_ref_die_offset to get the absolute offset for + the die reference. + (die_containing_type): New function to build type from + DW_AT_containing_type attribut. + (read_type_die): Handle DW_TAG_ptr_to_member_type. + Treat DW_TAG_subprogram like DW_TAG_subroutine_type. + (dwarf_base_type): Fix typo with creation of FT_UNSIGNED_SHORT + fundamental type. + (create_name): Removed, symbol name allocation is now done + in new_symbol. + (dump_die): Use print_address_numeric to print a CORE_ADDR. + (dwarf2_empty_die_ref_table): New function to clear the die + reference table. + (dwarf2_get_ref_die_offset): New function to get the absolute + die offset from a die reference attribute. + (decode_locdesc): Complete rewrite using a stack, code mostly + borrowed from dwarfread.c:locval. + (dwarf_alloc_type): Removed, replaced by direct calls to alloc_type. + (dwarf_alloc_block): Allocate block on temporary obstack. + + * elfread.c (elf_symtab_read): When handling Irix dynamic symbols, + skip section name symbols and relocate all others. + (elf_symfile_read): Build dwarf2 psymtab even if offset is non-zero. + + * irix5-nat.c (fetch_core_registers): Handle core_reg_sect + from N32 executables. Call registers_fetched after extracting + the registers. + (obj_list_variant, struct link_map, LM_OFFSET, LM_ADDR): New + definitions to enable support of O32 and N32 format objlists. + (struct so_list): New members offset, so_name and lmstart to + eliminate dependencies from the objlist format used. + (solib_map_sections, symbol_add_stub, solib_add, + info_sharedlibrary_command, solib_address, clear_solib): Use + so_name and LM_OFFSET. + (first_link_map_member): Rewrite to enable support of O32 and N32 + format objlists. + (next_link_map_member, xfer_link_map_member): New functions to + support O32 and N32 format objlists. + (find_solib): Use first_link_map_member, next_link_map_member and + xfer_link_map_member. + (solib_create_inferior_hook): Use TARGET_SIGNAL_* instead of + host signal numbers. + + * mdebugread.c (parse_partial_symbols, handle_psymbol_enumerators): + Pass CORE_ADDR variant to add_psymbol_to_list. + + * mips-tdep.c (heuristic_proc_desc): Stop examining the prologue + if we encounter a positive stack adjustment. Handle `move $30,$sp'. + Handle `sd reg,offset($sp)' for 32 bit ABIs. + + * symmisc.c (dump_msymbols, print_partial_symbols): Use + print_address_numeric to print a SYMBOL_VALUE_ADDRESS. + (dump_symtab): Print compilation directory if it is not NULL. + + * valops.c (search_struct_field, value_struct_elt_for_reference): + Use SYMBOL_VALUE_ADDRESS instead of SYMBOL_BLOCK_VALUE to get the + address of a static member. + +Thu Nov 28 00:46:24 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * vax-tdep.c (vax_print_insn): Made static, modified to take + disassemble_info as parameter. + (_initialize_vax_tdep): New function to initialize tm_print_insn + to vax_print_insn. + +Wed Nov 27 11:29:06 1996 Michael Snyder + + * blockframe.c: Remove old-style CALL_DUMMY code. + * h8300-tdep.c, config/h8300/tm-h8300.h: Ditto. + * m32r-tdep.c, config/m32r/tm-m32r.h: Ditto. + * sh-tdep.c, config/sh/tm-sh.h: Ditto. + * v850-tdep.c, config/v850/tm-v850.h: Ditto. + +Wed Nov 27 10:32:14 1996 Michael Snyder + + * breakpoint.c: DELETE command will not delete CALL_DUMMY breakpoint. + * blockframe.c: Add target-independant support for managing + CALL_DUMMY frames on the host side. + * frame.h: Declarations for generic CALL_DUMMY frame support. + * h8300-tdep.c: Add target function calls using generic frame support. + * config/h8300/tm-h8300.h: config for generic target function calls. + * m32r-tdep.c: Add target function calls using generic frame support. + * config/m32r/tm-m32r.h: config for generic target function calls. + * sh-tdep.c: Add target function calls using generic frame support. + * config/sh/tm-sh.h: config for generic target function calls. + * v850-tdep.c: Add target function calls using generic frame support. + * config/v850/tm-v850.h: config for generic target function calls. + * valops.c: ADD PUSH_RETURN_ADDRESS so that it doesn't have to be + done by PUSH_ARGUMENTS when there's no CALL_DUMMY. + +Tue Nov 26 19:21:35 1996 Mark Alexander + + * config/mips/tm-mips.h (ADDR_BITS_REMOVE, TARGET_READ_SP): Define. + (mips_addr_bits_remove): Declare. + * mips-tdep.c (mips_push_dummy_frame): Fix heuristic-fence-post + errors when hitting breakpoints during inferior function calls + in 64-bit programs. + (fix_sign_extension): Make public, rename to mips_addr_bits_remove. + * utils.c (paddr_nz, preg_nz): New functions, similar to + paddr and preg but don't print leading zeroes. + * defs.h (paddr_nz, preg_nz): Declare. + * remote-mips.c: Use paddr_nz instead of paddr throughout + to reduce packet size. + (pmon_end_download): Improve timeout error handling. + +Tue Nov 26 17:21:37 1996 Ian Lance Taylor + + * configure: Rebuild with autoconf 2.12. + +Mon Nov 25 13:17:16 1996 Fred Fish + + From: Paul Eggert + * remote-bug.c (wait_strings): Avoid creating a trigraph. + +Fri Nov 22 15:55:22 1996 Martin M. Hunt + + * valops.c (value_at, value_fetch_lazy): Put in D10V call + to fix up address pointers. + * values.c (value_from_longest): Removed previous d10v changes. + * config/d10v/tm-d10v.h (TARGET_PTR_BIT): Change to 4 bytes. + +Fri Nov 22 10:06:19 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * config/i386/nm-i386v4.h (LOSING_POLL): Define, needed for + Unixware 1.1.2. + +Thu Nov 21 19:13:58 1996 Mark Alexander + + * mips-tdep.c: Replace hard-coded constants with MIPS_INSTLEN. + (common_breakpoint): Use paddr instead of %x to print 64-bit values. + (heuristic_proc_desc): Add tests for 64-bit instructions. + (init_extra_frame_info, mips_push_arguments): Recognize additional + registers for EABI. + * remote-mips.c: Extend DDB target to allow TFTP downloads. + * config/mips/tm-mips.h (MIPS_LAST_ARG_REGNUM, MIPS_NUM_ARG_REGS): + Define. + +Wed Nov 20 19:09:16 1996 Martin M. Hunt + + * infcmd.c (do_registers_info): Call val_print with the + virtual buf instead of the raw buf. Needed for REGISTER_CONVERT + to work with non-floating point regs. + + * d10v-tdep.c (d10v_skip_prologue): If we have line debugging + information, then the end of the prologue should the first + assembly instruction of the first source line. + + * values.c (value_from_longest): Put in D10V call to + fix up address pointers. + + * config/d10v/tm-d10v.h (REGISTER_VIRTUAL_SIZE): Modified. + (REGISTER_VIRTUAL_TYPE): Modified for PC_REGNUM and SP_REGNUM. + (REGISTER_CONVERTIBLE): Make PC and SP convertible. + (REGISTER_CONVERT_TO_VIRTUAL): Define. + (REGISTER_CONVERT_TO_RAW): Define. + (D10V_MAKE_DADDR): Define. + (D10V_MAKE_IADDR): Define. + +Wed Nov 20 16:15:15 1996 Geoffrey Noer + + * config/i386/cygwin32.mh: add MMALLOC_CFLAGS = -I$(MMALLOC_SRC) + -DMMCHECK_FORCE=1 so memory checks are loaded for cygwin32 gdb + +Wed Nov 20 00:43:09 1996 Doug Evans + + * callback.h: Delete, moved to ../include. + * callback.c: Delete, moved to ../sim/common. + * Makefile.in (SFILES,COMMON_OBJS): Delete callback.[co]. + (callback.o): Delete rule. + * remote-sim.h: No longer include callback.h. + (sim_callback_write_stdout): Delete prototype. + * remote-sim.c (init_callbacks,end_callbacks): New functions. + (gdb_os_write_stdout, gdb_os_printf_filtered): New functions. + (gdb_callback, callbacks_initialized): New static globals. + (gdbsim_open): Call init_callbacks. + (gdbsim_close): Call end_callbacks. + (simulator_command): Call init_callbacks. + + * config/h8300/h8300.mt (SIM): Change to ../sim/h8300/libsim.a. + * config/h8500/h8500.mt (SIM): Change to ../sim/h8500/libsim.a. + +Mon Nov 18 15:58:05 1996 Jim Wilson + + * config/mips/tm-mips.h (FIX_CALL_DUMMY): Change unsigned LONGEST + to ULONGEST. + +Fri Nov 15 15:34:18 1996 Fred Fish + + From Peter Schauer + * procfs.c (wait_fd): Handle EINTR error return from poll + by restarting the poll. + * defs.h (PIDGET): Define a default version that just + returns its argument unchanged. + * inflow.c (terminal_init_inferior): Eliminate #ifdef + of PIDGET and fold both alternatives into common code. + (pass_signal): Use PIDGET for pid passed to kill(). + +Thu Nov 14 15:54:20 1996 Michael Meissner + + * utils.c (paddr,preg): Use a static variable initialized to 32 + instead of doing addr>>32 to eliminate a warning produced by GCC + on 32-bit systems. + + * config/d10v/tm-d10v.h (ULONGEST): Define. + +Tue Nov 12 12:25:27 1996 Jim Wilson + + * c-typeprint.c (cp_type_print_method_args): Pass -1 for show in + recursive call to type_print. + +Tue Nov 12 12:18:29 1996 Jim Wilson + + * defs.h (ULONGEST): New macro. + * alpha-tdep.c, breakpoint.c, c-exp.y, ch-exp.c, convex-xdep.c, + corefile.c, defs.h, f-exp.y, findvar.c, gdbcore.h, m2-exp.y, + m88k-tdep.c, printcmd.c, remote-hms.c, remote-mips.c, sparc-tdep.c, + valarith.c, valops.c, values.c, config/gould/tm-np1.h, + config/mips/tm-mips.h, mswin/prebuilt/gdb/cexptab.c, + mswin/prebuilt/gdb/fexptab.c, mswin/prebuilt/gdb/m2exptab.c: + Change all occurances of unsigned LONGEST to ULONGEST. + + * configure.host (mips-sgi-irix6): Add. + +Tue Nov 12 12:16:40 1996 Michael Snyder + + * sh-tdep.c: Add functionality for target function calls. + * config/sh/tm-sh.h: Add support for target function calls. + +Tue Nov 12 12:06:58 1996 Michael Snyder + + * m32r-tdep.c: Add functionality for target function calls. + * valops.c: Small change to support target function calls. + * config/m32r/tm-m32r.h: Add support for target function calls. + +Mon Nov 11 17:15:59 1996 Geoffrey Noer + + * defs.h: Modify Nov 11 12:59:00 change so _MSC_VER is checked + instead of _WIN32. + * win32-nat.c: Fix Nov 11 12:59:00 change (windows.h should + be included instead of windefs.h for compilers other than + VC++). + * mswin/windefs.h: Remove ^Ms and change C++ style comments + to C style comments. + +Mon Nov 11 14:32:38 1996 Mark Alexander + + * utils.c (get_cell): Fix off-by-one bug. + * mips-tdep.c (get_frame_pointer, fix_sign_extension): + New functions to consolidate common code. + (mips_frame_chain, init_extra_frame_info): Use new functions + to fix problems with backtrace and finish commands on ddb board. + +Mon Nov 11 12:59:00 1996 Dawn Perchik + + * mips-tdep.c, remote-mips.c, values.c, mdebugread.c, + config/mips/tm-mips.h: Add/fix bugs for 64-bit mips support. + * defs.h: Cleanup; add prototypes. + * corefile.c: Change FIXME #ifdef + * win32-nat.c: Include windefs instead of windows.h. + * utils.c: Add routines for printing addresses and registers + based on type size. + +Sat Nov 9 01:05:10 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * alpha-tdep.c (heuristic_proc_desc): Stop examining the prologue + if we encounter a positive stack adjustment. + (find_proc_desc): If heuristic_fence_post is non-zero, use + heuristic_proc_start to determine the start of a function before + calling heuristic_proc_desc. + + * coffread.c (coff_symtab_read): Change minimal symbol types + for C_LABEL symbols from mst_* to mst_file_*. + + * config/m68k/sun3os4.mh (MMALLOC_CFLAGS): Define MMCHECK_FORCE to 1. + + * configure.in: Handle error message from sun3 native ld when + configuring HLDFLAGS. + * configure: Regenerated with autoconf. + + * c-valprint.c (c_value_print): Adjust value address by VALUE_OFFSET. + * cp-valprint.c (cp_print_value): Prevent gdb crashes by making sure + that the virtual base pointer from an user object still points to + accessible memory. + + * dbxread.c (dbx_symfile_init): Initialize sym_stab_info to + clear the recently added header_files fields. + (dbx_symfile_finish): Free hfiles[i].vector to avoid storage leak. + +Fri Nov 8 14:30:23 1996 Michael Snyder + + * config/tm-sh.h: Added a missing comma in middle of + REGISTER_NAMES list. + +Fri Nov 8 12:29:51 1996 Stan Shebs + + * monitor.c: Fix some formatting and comments. + + * remote-sim.c (simulator_command): Set up callbacks before + entering the simulator. + +Thu Nov 7 15:19:08 1996 Martin M. Hunt + + * d10v-tdep.c: Fix some problems with inferior function calls. + * config/d10v/tm-d10v.h (EXTRA_FRAME_INFO): Change dummy to be + a pointer to the dummy's stack instead of just a flag. + +Tue Nov 5 10:21:02 1996 Michael Snyder + + * m32r-tdep.c: Improved frame_chain and fn prologue analysis. + * config/tm-m32r.h: Add framesize and register to extra_frame_info. + +Tue Nov 5 10:08:07 1996 Stu Grossman (grossman@critters.cygnus.com) + + * mswin/gdbwin.h: Remove bogus definition of CORE_ADDR. + * mswin/srcwin.cpp (CSrcScroll1::CSrcScroll1): Initialize depth + to fix divide-by-zero problem with clicking on source window. + +Mon Nov 4 00:48:37 1996 Stu Grossman (grossman@critters.cygnus.com) + + * mswin/recordit: Fix problem with absolute paths. + * mswin/recordit: Fix problem with relative paths. + +Sun Nov 3 18:06:42 1996 Stu Grossman (grossman@critters.cygnus.com) + + * mswin/{Makefile.in configure configure.in}: New files for + configuring wingdb under Unix. + +Sat Nov 2 03:54:13 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * irix5-nat.c, osfsolib.c, solib.c (symbol_add_stub): Handle + missing or zero-sized .text sections properly. + * mdebugread.c: Handle scRConst and scSUndefined storage classes. + * stabsread.c (scan_file_globals): Try to resolve symbols + for shared libraries from the minimal symbol table of the main + executable first. + +Fri Nov 1 13:59:28 1996 Martin M. Hunt + + * d10v-tdep.c, config/d10v/tm-d10v.h: Major fixes to support + inferior function calls and proper stack backtracing on D10V-EVA + board. + +Fri Nov 1 10:50:51 1996 Michael Meissner + + * config/powerpc/linux.mh (NATDEPFILES): Fix up things so that it + links. + (GDBSERVER_DEPFILES,TERMCAP): Ditto. + + * monitor.c (dev_name,targ_ops): Move static variables before + first use, to avoid compiler warnings. + +Thu Oct 31 16:37:17 1996 Michael Snyder + + * m32r-tdep.c: Improved frame_chain and fn prologue analysis. + * configure.tgt: Add entry for m32r target. + * monitor.h: Add a flag to tell monitor_store_register to use + (val, regno) instead of (regno, val). + * monitor.c: Make monitor_store_register honor the above flag. + Make monitor_exp ignore DC1/DC3 for m32r. + Increase buf size in monitor_dump_regs. + +Wed Oct 30 18:14:14 1996 Michael Snyder + + * m32r-tdep.c, m32r-rom.c: New files. + * config/m32r/m32r.mt: New file. + * config/m32r/tm-m32r.h: New file. + +Tue Oct 29 16:56:01 1996 Geoffrey Noer + + * config/i386/xm-cygwin32.h: + * config/powerpc/xm-cygwin32.h: + add #define LSEEK_NOT_LINEAR so source lines aren't unexpectedly + truncated. + +Tue Oct 29 18:36:43 1996 Michael Meissner + + * config/powerpc/tm-ppc-eabi.h (TARGET_BYTE_ORDER_SELECTABLE): + Define. + +Tue Oct 29 14:59:20 1996 Stan Shebs + + * TODO: Add item suggesting an "info bfd" command. + +Tue Oct 29 12:48:04 1996 Martin M. Hunt + + * d10v-tdep.c: Snapshot that supports D10V-EVA board. + + * config/d10v/tm-d10v.h (REGISTER_NAMES): Add imap0,imap1,dmap. + (TARGET_READ_FP,TARGET_WRITE_FP): Define. + +Mon Oct 28 17:34:24 1996 Stu Grossman (grossman@critters.cygnus.com) + + * mswin/genmakes mswin/recordit: New scripts to generate make + files for MSVC. + +Sun Oct 27 20:18:04 1996 Mark Alexander + + * config/mips/{tm-vr5000.h,tm-vr5000el.h,vr5000.mt,vr5000el.mt}: + New files. + * configure.tgt: Modify cases for vr5000 to use new files. + +Sat Oct 26 07:15:14 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * config/alpha/alpha-osf3.mh (XM_CLIBS): Add -lm for OSF/1-4.0. + + * procfs.c (proc_set_exec_trap): Under Alpha OSF/1-4.0, tracing + the entry to the exit system call to detect termination of the + inferior stopped working. Trace termination of the inferior via + PRFS_STOPTERM instead. + (procfs_init_inferior): Do not trace entry to exit system call + if PIOCSSPCACT is defined. + (procfs_wait): Handle PR_DEAD event, which signals the termination + of the inferior if PRFS_STOPTERM is set. + + * mdebugread.c (parse_partial_symbols): Ignore stNil section + start address symbols. + + * sparc-tdep.c (get_saved_register): Get saved PC from the + frame info if not in innermost frame. + +Thu Oct 24 10:51:45 1996 Mark Alexander + + * dbxread.c (process_one_symbol): Interpret end-of-function + markers correctly; this fixes problem on Vr5000 where all + functions in a module had the same address. + * configure.in, configure.tgt, configure.host, gdbserver/configure.in: + Correct for pc-linux-gnu problem in config.guess. + * configure: Regenerate. + +Thu Oct 24 10:06:58 1996 Stu Grossman (grossman@critters.cygnus.com) + + * dbxread.c: Don't swap symbols in place, since internal and + external forms may have different sizes. Don't assume that an + internal_nlist has the same layout as an external_nlist. Create + symbol for n_strx element so to hide specifics of nlist from + partial-stab.h. + * partial-stab.h: Don't reference dbxread symbols directly. Use + CUR_SYMBOL_STRX instead. + * config/i386/xm-windows.h: Define SIGQUIT and SIGTRAP. + + * config/v850/tm-v850.h: Define PS_REGNUM and TARGET_V850 for + MSVC builds. + * mswin/gdbwin.c (reg_order): Define register order for V850. + * mswin/gui.cpp (CGuiApp::InitInstance): Define target name for + V850. + * mswin/regdoc.h: Define MAXREGS for V850. + +Tue Oct 22 16:28:20 1996 Stu Grossman (grossman@critters.cygnus.com) + + * v850-tdep.c (scan_prologue): Changes to deal with scheduled + prologues correctly. First, prologue end is now defined by + presence of a branch, jump or call insn. Second, can no longer + fix frame offsets because we may not know the offset until after a + register has been saved. + * (v850_init_extra_frame_info): Fixup frame offsets here because + we have all the info at this time. + * (v850_frame_chain): Use new calling convention for scan_prologue. + +Tue Oct 22 10:25:29 1996 Martin M. Hunt + + * d10v-tdep.c, config/d10v/tm-d10v.h: Changes to allow stack + backtraces and inferior function calls. + +Tue Oct 22 10:32:46 1996 Stan Shebs + + * mpw-make.sed: Update init.c editing to work with Oct 8 change. + (@HLDFLAGS@): Always edit out. + +Mon Oct 21 18:17:08 1996 Mark Alexander + + * mdebugread.c (parse_partial_symbols): Fix 64-bit + sign-extension problems in calculating psymtab addresses. + * buildsym.c (end_symtab): Use macro to pop context. + +Mon Oct 21 14:40:50 1996 Stu Grossman (grossman@critters.cygnus.com) + + * v850-tdep.c: Cleanup lots of things. Add many comments. + + * v850-tdep.c (v850_init_extra_frame_info v850_frame_chain): Fix + sign bugs with scanning prologues. Get a little smarter about + calculating the length of uninteresting instructions. + +Mon Oct 21 14:01:38 1996 Michael Snyder + + * top.c: Add new commands "set annotate" and "show annotate". + +Sun Oct 20 04:38:39 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * corelow.c (core_close): Clear inferior_pid only if there is + an open core_bfd. + + * cp-valprint.c (cp_print_value_fields): Pass correct address + to val_print, not 0. + + From Andreas Schwab (schwab@issan.informatik.uni-dortmund.de): + * eval.c (evaluate_subexp_standard) [case BINOP_REPEAT]: Chase + typedefs before checking for integral type of right operand. + +Fri Oct 18 17:26:22 1996 Mark Alexander + + * mdebugread.c (parse_symbol): Fix crash when malloc has + no type info and void type has no associated pointer type. + +Thu Oct 17 18:18:20 1996 Stan Shebs + + * configure.host: New file, host configuration mapping. + * configure.tgt: New file, target configuration mapping. + * configure.in: Remove host and target mapping. + * configure: Rebuild. + +Wed Oct 16 17:46:03 1996 Stan Shebs + + * breakpoint.c (must_shift_inst_regs): New global. + (bpstat_stop_status): Change #if uses of DECR_PC_AFTER_BREAK into + equivalent expression uses. + * infrun.c (wait_for_inferior): Ditto. + +Wed Oct 16 01:53:43 1996 Stu Grossman (grossman@critters.cygnus.com) + + * v850-tdep.c (v850_push_arguments): Use symbolic names for arg + registers. + * config/v850/tm-v850.h: Change FP to 29. Define arg regs. + +Tue Oct 15 16:30:07 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in (init.c): Don't use -s option with grep. It means + something different under Digital Unix. + + * buildsym.c (finish_block): Treat LOC_BASEREG_ARG and + LOC_LOCAL_ARG as arguments so that GDB will know about function + args declared this way. Mostly affects dwarf. + * dwarfread.c (decode_die_type): Change default type from int to + void. This allows GDB to recognize void functions. + * (new_symbol): If AT_PROTOTYPED is present, set a flag in the + type structure. + * findvar.c (extract_floating store_floating): Clean up comments + to reflect reality. + * gdbtypes.h: Add TYPE_FLAG_PROTOTYPED so that we can tell if a + function has a prototype. Currently, only dwarf supports this. + * utils.c (floatformat_from_doublest): Fix logic error with + converting from double to float. (It wasn't shifting mant_long if + it had a hidden bit.) + * v850-tdep.c: Add support for function calling. Fix some + problems with debugging code w/o debug symbols. + * config/v850/tm-v850.h: Ditto. + +Tue Oct 15 18:19:42 1996 Ian Lance Taylor + + * utils.c: Always ensure that size_t is defined. Check + HAVE_STDDEF_H rather than __STDC__ + (xmalloc, xrealloc): Use size_t rather than long. + +Tue Oct 15 14:24:19 1996 Martin M. Hunt + + * config/powerpc/tm-ppc-eabi.h: Undefine NO_SINGLE_STEP so targets + can use single-step commands. + +Sun Oct 13 11:38:25 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * stabsread.c (define_symbol): If REG_STRUCT_HAS_ADDR is non-zero, + follow typedefs before checking TYPE_CODE for structures and unions. + +Fri Oct 11 15:43:54 1996 Stu Grossman (grossman@critters.cygnus.com) + + * frame.h: Move definition of struct frame_saved_regs to before + struct frame to make it possible to use frame_saved_regs in + EXTRA_FRAME_INFO macro. + + * v850-tdep.c config/v850/tm-v850.h: Lotsa new functions and + macros to make frame operations (such as backtrace) work. + +Fri Oct 11 14:23:50 1996 Fred Fish + + * dbxread.c (process_one_symbol): Check for null string directly + rather than using strcmp against "". + * partial-stab.h: Ditto. + +Fri Oct 11 12:18:32 1996 Mark Alexander + + * gdbserver/{gdbreplay.c,low-linux.c,remote-utils.c,utils.c}: + Make it compile on Linux and eliminate some warnings. + +Thu Oct 10 16:32:08 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in (init.c): Fixup final sed script to work around + Linux bug with `p' operator. + +Wed Oct 9 18:02:48 1996 Stan Shebs + + * remote-mips.c: Use the correct name everywhere (DDB) for NEC's + VR4300 target. + (ddb_ops, pmon_ops): Fix the documentation strings. + +Wed Oct 9 07:42:44 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in (init.c): Retro HPUX grep lacks -h option. Strip + filenames with sed instead. + +Tue Oct 8 15:59:44 1996 Stu Grossman (grossman@critters.cygnus.com) + + * defs.h: Remove decls of xmalloc and xrealloc. There is a + conflicting definition in libiberty.h. + +Tue Oct 8 11:47:13 1996 Fred Fish + + * dbxread.c (dbx_symfile_read): Call free_pending_blocks rather + than poking global variable (which is now static). + * hpread.c (hpread_build_psymtabs): Ditto. + * os9kread.c (os9k_symfile_read): Ditto. + * xcoffread.c (xcoff_initial_scan): Ditto. + + * buildsym.h (free_pending_blocks): Declare here. + (pending_blocks): Remove declaration of global symbol. + (free_pendings): Remove declaration of global symbol. + (make_blockvector): Declare here. + (record_pending_block): Declare here. + + * dstread.c (make_blockvector): Remove static copy that was old + clone of version in buildsym.c. + (process_dst_block): Call record_pending_block rather than doing + it by hand. + (read_dst_symtab): Ditto. + + * buildsym.c (make_blockvector): Make global rather than static, + (record_pending_block): New function, code moved from finish_block. + (finish_block): Use record_pending_block. + (free_pending_blocks): New function. + (really_free_pendings): Call free_pending_blocks. + (pending_blocks): Make static instead of global. + (free_pendings): Make static instead of global. + +Tue Oct 8 09:03:22 1996 Stu Grossman (grossman@critters.cygnus.com) + + * config/i386/windows.mh config/i386/xm-windows.h:: New config + files to support building Wingdb (built under Microsoft build + environment). + + * Makefile.in: Add rule for hpux-thread.o (needs special header + files). + * (SUBDIRS): Remove mswin. + * Change procedure for creating init.c. Speeds things up quite a + bit. + * config.in configure configure.in: Check for select, poll. + * Check for OSF header files before including hpux-thread.o. + * Don't configure doc or testsuite when building under MSVC. + * findvar.c value.h (read_register_pid write_register_pid): Make + global. Needed for hppa-tdep.c. + * (supply_register): Don't set pid to inferior_pid when supplying + registers. + * hppa-tdep.c (saved_pc_after_call): frame_saved_pc -> + FRAME_SAVED_PC. + * (frame_saved_pc): Change name to hppa_frame_saved_pc. + * (hppa_pop_frame): Don't use a pid of 0 with target_write_pc. + Use write_pc instead, which uses the correct pid. + * (target_read_pc target_write_pc): Use read/write_register_pid + instead of read/write_register to preserve the pid passed in. + * inftarg.c (child_can_run): Add flag child_suppress_run to allow + hpux-threads.c to override this as a runnable target. + * config/pa/nm-hppah.h: Define target_new_objfile and + target_pid_to_str. + * config/pa/tm-hppa.h (FRAME_SAVED_PC): Use hppa_frame_saved_pc + instead of frame_saved_pc. + * config/m68k/tm-m68k.h: Define TARGET_M68K for Wingdb. + * config/m68k/tm-monitor.h: Use FRAME_CHAIN_VALID_ALTERNATE, since + we can't easily determine the start file bounds with ELF. + * config/mips/tm-mips.h: Define TARGET_MIPS for Wingdb. + * hpux-thread.c: New file for HPUX/OSF thread support. + * osf-share/{README AT386/cma_thread_io.h HP800/cma_thread_io.h + RIOS/cma_thread_io.h cma_attr.h cma_deb_core.h cma_debug_client.h + cma_errors.h cma_handle.h cma_init.h cma_list.h cma_mutex.h + cma_sched.h cma_semaphore_defs.h cma_sequence.h cma_stack.h + cma_stack_int.h cma_tcb_defs.h cma_util.h}: New files for OSF + thread support. + +Sun Oct 6 15:48:09 1996 Fred Fish + + * buildsym.c (finish_block): Change innerblock_anon_complaint to + print the addresses as part of the complaint. Add a complaint for + cases where the block end address is smaller than the block start + address, in case any such conditions slip through our fixup mechanism. + * symmisc.c (dump_symtab): Only print blockvector for primary + symtabs, to avoid massive duplication of output due to secondary + symtabs that point to same blockvector. Also do some minor + formatting tweaks. + +Mon Oct 7 10:42:32 1996 Per Bothner + + Replace header_files global by per-objfile field. + * gdb-stabs.h (struct dbx_symfile_info): Add fields header_files, + n_header_files, n_allocated_header_files. + * stabsread.h (header_files, n_header_files, n_allocated_header_files): + Replace externs by macros HEADER_FILES, N_HEADER_FILES, and + N_ALLOCATED_HEADER_FILES. + * dbxread.c (dbx_symfile_finish): Free HEADER_FILES. + (free_header_files, init_header-files): Don't free/init headerfiles. + (various functions): Use macros instead of header_files globals. + * stabsread.c (various functions): Likewise. + +Sun Oct 6 22:43:06 1996 Jason Merrill + + * dwarf2read.c (read_tag_reference_type): New fn. + (read_type_die): Call it. + (dwarf_attr): Also look in the DIEs referred to by specification + or abstract_origin attributes. + +Wed Oct 2 22:07:16 1996 Fred Fish + + * inferior.h (IN_SIGTRAMP): Pass pc to SIGTRAMP_START and + SIGTRAMP_END. + * config/i386/tm-i386os9k.h (SIGTRAMP_START, SIGTRAMP_END): + Define with dummy pc arg. + * config/m68k/tm-nbsd.h: Ditto. + * doc/gdbint.texinfo: Document that SIGTRAMP_START and + SIGTRAMP_END are macros that take an single argument. + +Mon Sep 30 20:02:45 1996 Fred Fish + + * defs.h: Remove define of PRIVATE_XMALLOC. + +Mon Sep 30 15:39:28 1996 Stu Grossman (grossman@critters.cygnus.com) + + * config/v850/tm-v850.h: Use distinct register for PC, not EIPC. + +Mon Sep 30 11:16:34 1996 Jeffrey A Law (law@cygnus.com) + + * top.c (execute_control_command): Free values from while_control + and if_control conditions after evaluation to avoid storage leaks. + From Peter Schauer. + +Fri Sep 27 17:43:06 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure configure.in: Recognize v850 target. + * v850-tdep.c: New file, NEC V850 target support. + * config/v850/{v850.mt tm-v850.h}: New files for NEC V850 support. + +Fri Sep 27 14:48:15 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * infrun.c (wait_for_inferior): Update current_line and + current_symtab when stepping continues in the middle of a new line. + +Fri Sep 27 10:25:30 1996 Fred Fish + + * top.c (print_gdb_version): Rewrote to comply with new GNU coding + standards for the --version option. + (print_gnu_advertisement): Remove, now part of print_gdb_version. + (show_version): Remove call to print_gnu_advertisement. + * top.h (print_gnu_advertisement): Remove prototype. + * main.c (print_gdb_help): Move help to static function and + add prototype. + (main): Call print_gdb_help rather than inlining it. + (main): Remove call to print_gnu_advertisement. + +Fri Sep 27 13:32:53 1996 Michael Meissner + + * config/d10v/tm-d10v.h (TARGET_{INT,PTR}_BIT): Define. + (TARGET_{,LONG_}DOUBLE_BIT): Ditto. + +Thu Sep 26 23:10:26 1996 Mark Alexander + + * configure.in, config/i386/tm-linux.h: Fix configure + problem on older Linux systems that prevented core files + from being recognized. + +Wed Sep 25 18:31:33 1996 Stan Shebs + + * dbug-rom.c: New file, support for Motorola's dBUG monitor. + * config/m68k/monitor.mt (TDEPFILES): Add it. + * NEWS: Mention it. + +Mon Sep 23 16:13:50 1996 Martin M. Hunt + + * config/d10v/tm-d10v.h (SAVED_PC_AFTER_CALL): Fixed. + Now single-steps correctly. + * d10v-tdep.c (d10v_pop_frame): Fixed. + +Fri Sep 20 16:10:58 1996 Stan Shebs + + * config/sh/tm-sh.h (REGISTER_NAMES): Move fp registers to + be consistent with GCC. + (FPUL_REGNUM, etc): Renumber to match list changes. + (ADDR_BITS_REMOVE): Delete. + * sh-tdep.c (sh_reg_names, sh3_reg_names, sh3e_reg_names): + Rearrange to match REGISTER_NAMES. + * sh3-rom.c (sh3_regnames, sh3e_regnames): Ditto. + +Thu Sep 19 16:19:01 1996 Martin M. Hunt + + * d10v-tdep.c: Stack chain should work now. + +Tue Sep 17 18:46:57 1996 Martin M. Hunt + + * d10v-tdep.c, config/d10v/tm-d10v.h: Snapshot. + +Tue Sep 17 12:20:50 1996 Ian Lance Taylor + + * configure.in: Add cases for MIPS 5000 like MIPS 4300. + * configure: Rebuild. + +Tue Sep 17 12:09:00 1996 Dawn Perchik + + * ser-e7kpc.c: Added wingdb support for target e7000pc. + +Tue Sep 17 10:56:52 1996 James G. Smith + + * remote-mips.c (pmon_wait): DDB PMON does not require forced + re-entry back into debug mode. + +Mon Sep 16 14:32:58 1996 James G. Smith + + * remote-mips.c (mips_load): Ensure that the PC is explicitly + loaded after a load to a DDB PMON system. + +Fri Sep 13 12:02:39 1996 Fred Fish + + * Makefile.in (INTERNAL_LDFLAGS): Add @HLDFLAGS@ to list. + (HLDENV): Set to @HLDENV@. + (gdb): Prefix link command line with $(HLDENV). + * configure.in: Add support to test for --enable-shared and + generate appropriate values for HLDFLAGS and HLDENV. + * configure: Regenerated with autoconf. + +Sun Sep 8 15:26:27 1996 Fred Fish + + * alpha-nat.c (fetch_core_registers): Match Sep 4 gdbcore.h prototype + change for core_read_registers in struct core_fns. + * core-regset.c (fetch_core_registers): Ditto & add prototype. + * core-sol2.c (fetch_core_registers): Ditto & add prototype. + * i386aix-nat.c (fetch_core_registers): Ditto & add prototype. + * i386b-nat.c (fetch_core_registers): Ditto. + * i386mach-nat.c (fetch_core_registers): Ditto & add prototype. + * irix4-nat.c (fetch_core_registers): Ditto. + * irix5-nat.c (fetch_core_registers): Ditto. + * lynx-nat.c (fetch_core_registers): Ditto & add prototype. + * m68knbsd-nat.c (fetch_core_registers): Ditto. + * mips-nat.c (fetch_core_registers): Ditto & add prototype. + * rs6000-nat.c (fetch_core_registers): Ditto. + * sparc-nat.c (fetch_core_registers): Ditto. + * sun3-nat.c (fetch_core_registers): Ditto & add prototype. + * ultra3-nat.c (fetch_core_registers): Ditto & add prototype. + + * alpha-nat.c (register_addr): Match Sep 4 gdbcore.h prototype change. + * delta68-nat.c (register_addr): Ditto. + * gdbserver/low-linux.c (register_addr): Ditto. + * gdbserver/low-hppabsd.c (register_addr): Ditto. + * i386m3-nat.c (register_addr): Ditto. + * mips-nat.c (register_addr): Ditto. + * ultra3-nat.c (register_addr): Ditto. + +Sun Sep 8 15:14:00 1996 Stu Grossman (grossman@critters.cygnus.com) + + * blockframe.c (inside_main_func): Cleanup slightly. Move + mainsym def into the block it's used in. + * configure.in configure: Allow NATDEPFILES to be recognized in + .mh files regardless of whitespace. + + * cpu32bug-rom.c (cpu32bug_cmds): Change load_response string to + keep downloads from hanging. + + * remote-wiggler.c: Add support for flash upgrades. + * (wiggler_error): Fix message format. Add new error code. + * (wiggler_write_byets): Error code is hex. Report errors with + proper routine name. + * (wiggler_read_byets): Report errors with proper routine name. + * (get_packet): Add support for new flash commands. + * (wiggler_load): Call clear_symtab_users() to reset things + properly after download. + * (flash_xfer_memory bdm_update_flash_command): New funxtions to + support flash upgrades for Wiggler. + * (_initialize_remote_wiggler): Add `bdm update-flash' command. + +Fri Sep 6 13:14:13 1996 Geoffrey Noer + + * ser-tcp.c: don't include netinet/tcp.h if __CYGWIN32__ + +Thu Sep 5 17:05:13 1996 Geoffrey Noer + + * config/i386/cygwin32.mh: + * config/powerpc/cygwin32.mh: build ser-tcp.o for both hosts + +Thu Sep 5 12:09:13 1996 Per Bothner + + * value.h (COERCE_REF): Fix previous change. + (COERCE_ENUM): Add a check_typedef (this is the real fix). + +Thu Sep 5 03:28:30 1996 Wilfried Moser + + * eval.c (evaluate_subexp_standard): In case of OP_ARRAY: make a + better check of array boundaries. + +Thu Sep 5 01:29:42 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure: Update aclocal.m4 and re-run autoconf to get correct + defs for BFD stuff. + * remote-wiggler.c (wiggler_error): Error codes are hex. Also, + fix default message generation. + +Wed Sep 4 17:28:40 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in: Add mswin to SUBDIRS. Add rules for + mswin/libwingdb.a and remote-wiggler.o. + * breakpoint.c (breakpoint_here_p): Clean up bp enabled test. + * (breakpoint_inserted_here_p): New func, just like + breakpoint_here_p, except it's honest. Honestly. + * breakpoint.h: Proto for above. + * configure configure.in: Add mswin to configdirs if host is + i[3456]86-*-windows. + * core-aout.c (fetch_core_registers register_addr) gdbcore.h: + Change all vars that can contain addresses to type CORE_ADDR. + * findvar.c (supply_register): Allow val to be NULL. This means + that regno is unsupported. + * (read_pc read_pc_pid write_pc write_pc_pid): Make non-pid forms + just call pid forms with inferior_pid so that there's only once + place to hack PC's and such. + * infrun.c (proceed): Don't skip breakpoints if user changed PC. + * remote-wiggler.c: New file. Support for BDM interface from + Macraigor Systems. + * serial.c: Enhance serial logging capability. Add hex and octal + output modes (set remotelogbase {hex|octal|ascii}. Also log + breaks, timeouts, errors, and eofs. + * serial.h: Redefine SERIAL_SEND_BREAK to go through a wrapper + function so that we can log breaks. Don't export serial_logfile + or serial_logfp. + * top.c (execute_command): Don't test for serial_logfp here. + Just call serial_log_comand, and let serial.c sort it out. + * valops.c (value_of_variable): Don't attempt to establish frames + for static and global variables. This makes things work a bit + better if the stack or frame pointer is trashed. + * config/m68k/monitor.mt (TDEPFILES): Add remote-wiggler.o. + * config/m68k/tm-m68k.h: Define STACK_ALIGN. CPU32 can't hack + misaligned stacks during function calls. + +Wed Sep 4 13:06:26 1996 Ian Lance Taylor + + * terminal.h: Don't use #elif. + +Wed Sep 4 06:49:35 1996 Wilfried Moser + + * ch-exp.c (parse_tuple_element): Allow (*): for array tuples + if we have a type. + + * eval.c (evaluate_subexp_standard): In case of OP_ARRAY: + check number of args against bounds of array to avoid + memory corruption. + + * value.h (COERCE_REF): Do a CHECK_TYPEDEF in case we get + a TYPE_CODE_TYPEDEF. + +Fri Aug 30 15:07:14 1996 James G. Smith + + * remote-mips.c: Provide support for DDBVR4300 target board. + (ddb_open, ddb_ops): Added. + (mips_monitor_type): MON_DDB Added. + (mips_enter_debug, mips_exit_debug, mips_initialize, + mips_fetch_registers, common_breakpoint, mips_load, + _initialize_remote_mips): Updated. + +Thu Aug 29 17:00:18 1996 Michael Meissner + + * nlm/configure.in (i[345]86-*-*): Recognize i686 for pentium pro. + * nlm/configure: Regenerate. + + * gdbserver/configure.in (i[345]86-*-*): Recognize i686 for + pentium pro. + +Wed Aug 28 13:11:15 1996 Ian Lance Taylor + + * configure.in: If CY_AC_PATH_TCLCONFIG can't find TCL, don't run + CY_AC_LOAD_TCLCONFIG. + * configure: Rebuild. + +Tue Aug 27 12:40:40 1996 Fred Fish + + * infrun.c (wait_for_inferior): Initialize stop_func_end before calling + find_pc_partial_function. + +Tue Aug 27 10:17:34 1996 Michael Meissner + + * configure: Regenerate again. + +Tue Aug 27 04:25:08 1996 Geoffrey Noer + + * configure.in: work around host_alias configure bug. + AC_CANONICAL_HOST is called twice (first by AC_CHECK_TOOL + and second by AC_CANONICAL_SYSTEM). The second clobbers the + previous setting. Circumventing by moving the second check + to before the first. + * configure: regenerated + +Mon Aug 26 18:36:54 1996 Martin M. Hunt + + * config/d10v/d10v.mt: New file. + * config/d10v/tm-d10v.h: New file. + * configure.in: New target D10V. + * d10v-tdep.c: New file. + +Sun Aug 25 00:09:47 1996 Fred Fish + + * rs6000-tdep.c: Fix typo in comment. + * valops.c (call_function_by_hand): Set using_gcc to 2 + for code compiled without -g, per comment in code. + * config/a29k/tm-a29k.h (STACK_ALIGN): Add comment. + * config/sparc/tm-sparc.h (STACK_ALIGN): Add comment. + * config/sparc/tm-sp64.h (STACK_ALIGN): Add comment. + * config/pyr/tm-pyr.h (STACK_ALIGN): Add comment. + * config/m88k/tm-m88k.h (STACK_ALIGN): Add comment. + * config/pa/tm-hppa.h (PUSH_ARGUMENTS): Enclose args in ()'s. + (STACK_ALIGN): Add comment, move to be with other associated + macros, and document. + * config/mips/tm-mips.h (PUSH_ARGUMENTS): Enclose args in ()'s. + (STACK_ALIGN): Remove completely, handled by PUSH_ARGUMENTS. + * config/alpha/tm-alpha.h (PUSH_ARGUMENTS): Enclose args in ()'s. + * config/rs6000/tm-rs6000.h (STACK_ALIGN): Remove completely, + handled by PUSH_ARGUMENTS. + (PUSH_ARGUMENTS): Enclose args in ()'s. + +Fri Aug 23 13:55:05 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * infrun.c (wait_for_inferior): Try to reenable shared library + breakpoints even if auto_solib_load is not set. + +Wed Aug 21 16:31:27 1996 Fred Fish + + * valprint.c (print_longest): Test for CC_HAS_LONG_LONG as well as + PRINTF_HAS_LONG_LONG. + * expprint.c (dump_expression): Ditto. + * configure.in: Fix check for long long support in compiler to + use a function body, not a nested function. + * configure: Rebuild with autoconf. + +Tue Aug 20 17:59:42 1996 Ian Lance Taylor + + * aclocal.m4: Include ../bfd/aclocal.m4. + * configure.in: Add stdlib.h to AC_CHECK_HEADERS. Call + BFD_NEED_DECLARATION on malloc, realloc, and free. + * acconfig.h: Add NEED_DECLARATION_MALLOC, + NEED_DECLARATION_REALLOC, and NEED_DECLARATION_FREE. + * configure, config.in: Rebuild. + * defs.h: Include and based on HAVE_*_H + rather than __STDC__. Only declare malloc, realloc, and free if + NEED_DECLARATION_* is defined. + +Tue Aug 20 15:37:03 1996 Fred Fish + + * solib.c (_initialize_solib): Add missing '\' chars at ends of + strings that continue on next line. + (enable_break): Replace "return 0" with setting success to zero + and letting normal return handle the return. + +Sat Aug 17 14:16:23 1996 Fred Fish + + * mips-tdep.c (mips_push_arguments): Make sure sp and struct_addr + are properly aligned. + +Fri Aug 16 17:54:26 1996 Stan Shebs + + * rs6000-tdep.c (rs6000_fix_call_dummy): Add full set of arguments. + * config/rs6000/tm-rs6000.h (FIX_CALL_DUMMY): Pass all arguments + to function, declare function correctly. + +Fri Aug 16 17:24:35 1996 Dawn Perchik + + * symtab.h: changed namespace to _namespace for compiling under + MFC v4.0. + +Fri Aug 16 13:52:21 1996 Stan Shebs + + * mpw-make.sed: Update for various recent changes, add some + comments. + +Fri Aug 16 15:47:36 1996 Michael Meissner + + * config/rs6000/tm-rs6000.h (FIX_CALL_DUMMY): Cast args to be an + integer for type correctness. + +Fri Aug 16 15:15:37 1996 James G. Smith + + * config/mips/{vr4300.mt, vr4300el.mt} (SIM): Add -lm when + simulator is included. + +Thu Aug 15 13:44:13 1996 Fred Fish + + * findvar.c (write_register_pid): Only needed when TARGET_WRITE_PC + is not defined. + (read_register_pid): Only needed when TARGET_READ_PC is not + defined. + * hppa-tdep.c (frame_saved_pc): Remove prototype. + * infptrace.c (udot_info): Prototype when CHILD_XFER_MEMORY is + not defined. + * config/xm-aix4.h (aix_resizewindow): Convert old style decl + to prototype. + * xcoffsolib.c (command.h): Include for needed prototypes. + +Wed Aug 14 17:54:19 1996 Stu Grossman (grossman@critters.cygnus.com) + + * config/i386/cygwin32.mh: Set NAT_FILE to nm-empty.h to make + native work. + +Wed Aug 14 02:03:42 1996 Fred Fish + + From Blair MacIntyre : + * hppa-tdep.c (hppa_fix_call_dummy): Use MSYMBOL_TYPE rather + than SYMBOL_TYPE on msymbols. + * somsolib.c (som_solib_create_inferior_hook): Ditto. + + * Makefile.in (init.c): Generate with prototypes. + + * config/pa/tm-hppa.h (frame_saved_pc): Add prototype. + * config/rs6000/xm-rs6000.h (aix_resizewindow): Ditto. + * config/rs6000/tm-rs6000.h (frame_initial_stack_address): Ditto. + (pc_load_segment_name): Ditto. + (pop_frame): Ditto. + (extract_return_value): Ditto. + (is_magic_function_pointer): Ditto. + (push_dummy_frame): Ditto. + (fix_call_dummy): Ditto. + (push_arguments): Ditto. + (skip_trampoline_code): Ditto. + (aix_process_linenos): Ditto. + + * config/m68k/tm-cisco.h (get_longjmp_target): Add prototype. + * config/m68k/tm-es1800.h: Ditto. + * config/m68k/tm-vx68.h: Ditto. + * config/m68k/tm-sun3.h: Ditto. + * config/m68k/tm-m68kv4.h: Ditto. + +Tue Aug 13 23:04:36 1996 Fred Fish + + * config/mips/nm-mips.h (get_longjmp_target): Add prototype. + * config/mips/nm-irix3.h (get_longjmp_target): Add prototype. + * remote-mips.c (mips_read_processor_type): Remove prototype. + * mips-tdep.c (gdb_print_insn_mips): Add prototype and make static. + * irix5-nat.c (fetch_core_registers): Add prototype. + +Mon Aug 12 21:23:44 1996 Fred Fish + + * remote-pa.c (boot_board): Add dummy params to make type compatible + for passing to add_com. + * scm-exp.c (scm_lreadr): Ensure svalue is not used uninitialized. + * buildsym.c (compare_line_numbers): Change function to match + prototype and also what qsort expects. + +Mon Aug 12 19:19:00 1996 Mark Alexander + + * remote.c: Make remote_write_size public. + * sh-tdep.c (_initialize_sh_tdep): Set remote_write_size to 300 + to prevent packet errors with some versions of CMON. + +Mon Aug 12 16:20:58 1996 Stu Grossman (grossman@critters.cygnus.com) + + * defs.h: Define CONST_PTR as blank if compiling with Microsoft + C, else it's `const'. + * c-lang.c c-lang.h ch-lang.c f-lang.c language.c m2-lang.c + scm-lang.c: Microsoft C can't hack const pointers. Use CONST_PTR + macro instead. + * configure configure.in defs.h: Use AC_C_CONST to figure out if + the compiler supports const. Gets rid of some cruft in defs.h. + * dwarf2read.c: -> "gdb_string.h" + * remote-sim.c: Add prototypes. Fix call to gdbsim_kill. + * sparcl-tdep.c (download): Add prototypes to write_routine and + start_routine args. + + * mswin/gdbwin.c: Don't include both varargs.h AND stdarg.h. Get + rid of varargs.h Include string.h. + * (gdbwin_update gdbwin_fputs regs_changed_f bpt_changed_f + update): Fix prototypes, fix calls. + * (update): Return value for catch_errors. + * (run_execute_command togdb_command_from_tty togdb_command): + Cleanup catching of errors from calls to execute_command. Also, + dup command string to avoid modifying const strings. + * (togdb_breakinfo_i_init togdb_breakinfo_i_next): Use 0 instead + of NULL when see if b->address isn't set. + * (bi_disable_bpt bi_enable_bpt bi_delete_all + bi_delete_breakpoint): Add arg to calls to update. + * (gui_command): Add prototype. + * (mswin_query): Fix prototype. + * (_initialize_gdbwin): Dup string to avoid modifying const. + * (info_path togdb_get_info_path): Remove const from decls cuz + this can't be const (it points at malloc'ed memory). + * (togdb_searchpath): Remove const from path. Dup string to + avoid modifying const strings. + * rindex -> strrchr. + * (gdbwin_list_symbols): Regexp param is const. + * Fix lots of refs to psymtabs to deref correct pointers. + * (togdb_set_breakpoint_sal): Call set_breakpoint_sal with sal, + not &sal. + * mswin/gdbwin.h (togdb_searchpath togdb_get_info_path + toget_set_info_path): Fix prototypes to match reality. + * mswin/gui.cpp: Define _beginthreadex and _endthreadex routines + with proper prototypes. + * mswin/iface.cpp (gdbwin_fputs): Define with correct number of args. + * mswin/ser-win32s.c: Fix defs of min and max. + * mswin/serdll32.c (OpenComm16): Make cbInQueue and cbOutQueue be + USHORT. + * (WriteComm16): Change lpBug from LPVOID to LPCSTR. + * mswin/serdll32.h: Fix prototypes for OpenComm16 and WriteComm16. + +Sun Aug 11 20:54:16 1996 Stu Grossman (grossman@critters.cygnus.com) + + * main.c (main): Make sure command loop is used with cygwin32. + * terminal.h: Allow cygwin32 to use termios.h. + +Fri Aug 9 12:42:49 1996 Jeffrey A Law (law@cygnus.com) + + * somread.c (som_symtab_read): Handle secondary definition + symbols (aka weak symbols). + + * config/tm-hppa.h (EXTRACT_RETURN_VALUE): Fix thinko in + last change. + +Thu Aug 8 10:12:36 1996 Stu Grossman (grossman@critters.cygnus.com) + + * symfile.c (symfile_bfd_open): Change ifdef from __WIN32__ to + _WIN32. + + * somread.c: Rearrange order of includes to fix warnings under + hpux-10.10. Also don't include sys/file.h. + +Wed Aug 7 21:45:52 1996 Stu Grossman (grossman@critters.cygnus.com) + + * dbxread.c: Don't include param.h or sys/file.h. + * (dbx_symfile_read): Determine symfile_relocatable from bfd + flags instead of file extension. Also clean up a little bit. + +Wed Aug 7 17:18:37 1996 Stu Grossman (grossman@critters.cygnus.com) + + * dwarf2read.c dwarfread.c exec.c infcmd.c infrun.c main.c + mdebugread.c os9kread.c source.c top.c utils.c: Don't + include param.h or sys/file.h (or unistd.h in some cases). + * defs.h exec.c inflow.c remote-array.c remote-e7000.c + sparcl-tdep.c terminal.h utils.c: Replace all occurances of + __WIN32__, WINGDB, WIN32, etc... with _WIN32. + * main.c: Remove #ifndef WINGDB around option processing. Fix + bug with passing argc==0 and argv==NULL to getopt. + * (main) Remove calls to access() before source_command. Let + soure_command handle access errors. + * maint.c (maintenance_dump_me): #ifdef out for _WIN32. + * symtab.c (operator_chars): Make this global for wingdb. + * top.c (disconnect): #ifdef out for _WIN32. + * (source_command): If got an error and from_tty, then call print + error, else just return quietly. + * utils.c (fatal_dump_core): Can't kill ourselves under windows. + Just exit. + * (pollquit notice_quit): #ifdef out stuff that doesn't exist + under windows. + +Wed Aug 7 09:59:19 1996 Jeffrey A Law (law@cygnus.com) + + * config/pa/tm-hppa.h (EXTRACT_RETURN_VALUE): Tweak for + structures > 4 bytes in size. + + * valops.c (call_function_by_hand): Handle aligning stacks that + grow up correctly. + * config/pa/tm-hppa.h (USE_STRUCT_CONVENTION): Define. + (STACK_ALIGN): Define. + * hppa-tdep.c (hppa_alignof): Don't demand a minumim two byte + alignment on structs/unions. + +Sun Aug 4 16:22:42 1996 Fred Fish + + * config/powerpc/nm-aix.h (PTRACE_ARG3_TYPE): Define to "int *", + which is the documented type under at least AIX 3 and AIX 4. + +Sat Aug 3 04:02:46 1996 Fred Fish + + * config/alpha/alpha-osf3.mh (XM_FILE): Change from xm-alpha.h to + xm-alphaosf.h. + (MMALLOC_CFLAGS): Define NO_MMCHECK to not install consistency + checks. + +Thu Aug 1 10:11:34 1996 Fred Fish + + * config/mips/tm-mips.h (TM_MIPS_H): Enclose file contents in + this, define when contents are included. + (mips_read_processor_type): Add prototype. + * config/mips/xm-mips.h: Remove strdup decl, now in gdb_string.h + * mdebugread.c (ecoff_relocate_efi): Add prototype. + (fixup_sigtramp): Only needed when TM_MIPS_H is defined. + +Wed Jul 31 20:21:24 1996 Fred Fish + + * rs6000-nat.c (add_vmap): Return 0 to caller rather than random value. + (vmap_ldinfo): Ensure got_exec_file is not used uninitialized. + (fetch_core_registers): Add prototype. + (vmap_symtab): Ditto. + (objfile_symbol_add): Ditto. + (add_vmap): Ditto. + (vmap_ldinfo): Ditto. + (vmap_exec): Ditto. + +Tue Jul 30 17:57:46 1996 Stan Shebs + + * stabsread.c (get_substring): Declare second arg as int. + + * remote-es.c: Include gdb_string.h after defs.h. + +Mon Jul 29 21:13:20 1996 Fred Fish + + * rs6000-tdep.c (push_arguments): Remove unused variable "pc". + (branch_dest): Remove unused variable "offset". + (pop_dummy_frame): Add prototype and make static. + (push_arguments): Guard against using len uninitialized. + (push_arguments): Guard against using arg uninitialized. + (frame_saved_pc): Remove unused variable "frameless". + (free_loadinfo): Ifdef out unused function. + + * xcoffread.c (compare_lte): Change prototype and function to + be correct type for passing to qsort. + (add_stab_to_list): Ifdef out unused function and prototype. + (compare_lte): Add prototype + (arrange_linetable): Ditto. + (record_include_begin): Ditto. + (record_include_end): Ditto. + (process_linenos): Ditto. + (xcoff_next_symbol_text): Ditto. + (scan_xcoff_symtab): Ditto. + (xcoff_initial_scan): Ditto. + + * mips-tdep.c (mips_read_processor_type): Add parens around + bitwise-and operands in comparison; previous expression always + evaluated to 0 because of equality comparison of two constants. + + * rs6000-tdep.c (skip_prologue): Add missing parens around + operands of logical-or so that first operand does not bind + to previous logical-and. + + * configure.in: Expand "long long" test to include code that triggers + known problem on HPUX with native compiler. + (configure): Regenerated. + +Mon Jul 29 18:12:27 1996 Jeffrey A Law (law@cygnus.com) + + * somsolib.c (som_solib_create_inferior_hook): Don't + warn if __d_pid can't be found. + +Sun Jul 28 10:46:39 1996 Fred Fish + + * config/mips/tm-mips.h (struct frame_info): Forward decl. + (struct type): Ditto. + (struct value): Ditto. + + * config/mips/tm-mips.h (sigtramp_address): Move extern decl + from mips-tdep.c to here. + (sigtramp_end): Ditto. + (fixup_sigtramp): Ditto. + + * config/mips/tm-mips.h (init_extra_frame_info): Add prototype. + (mips_frame_chain): Ditto. + (mips_step_skips_delay): Ditto. + (mips_frame_saved_pc): Ditto. + (mips_find_saved_regs): Ditto. + (mips_frame_num_args): Ditto. + (mips_pop_frame): Ditto. + (mips_extract_return_value): Ditto. + (mips_store_return_value): Ditto. + (mips_push_dummy_frame): Ditto. + (mips_push_arguments): Ditto. + (mips_do_registers_info): Ditto. + (ecoff_relocate_efi): Ditto. + (ecoff_relocate_efi): Ditto. + * irix4-nat.c (fetch_core_registers): Add prototype. + * mips-tdep.c (read_next_frame_reg): Add prototype + (heuristic_proc_start): Ditto. + (heuristic_proc_desc): Ditto. + (mips_print_register): Ditto. + * config/mips/nm-irix5.h (procfs_set_watchpoint): Add prototype. + (procfs_stopped_by_watchpoint): Ditto. + * config/mips/nm-irix4.h (procfs_set_watchpoint): Add prototype. + (procfs_stopped_by_watchpoint): Ditto. + * config/alpha/tm-alpha.h (ecoff_relocate_efi): Add prototype. + (struct symbol): Add forward decl for prototype. + + * breakpoint.c (internal_breakpoint_number): Only needed if + GET_LONGJMP_TARGET or SOLIB_ADD is defined. + + * objfiles.c (ecoff_relocate_efi): Remove prototype. + +Sat Jul 27 17:47:35 1996 Fred Fish + + * configure.in: Add test for "long long" support. + * configure: Regenerate with autoconf. + * acconfig.h: Add CC_HAS_LONG_LONG + * config.in: Regenerate with autoheader. + * config/mips/tm-mips64.h (FORCE_LONG_LONG): Remove + * config/sparc/tm-sp64.h (CC_HAS_LONG_LONG): Remove. + * config/mips/tm-vr4300el.h (CC_HAS_LONG_LONG): Remove. + * config/mips/tm-vr4300.h (CC_HAS_LONG_LONG): Remove. + * config/mips/xm-irix5.h (CC_HAS_LONG_LONG): Remove + (PRINTF_HAS_LONG_LONG): Remove. + (FORCE_LONG_LONG): Remove. + * config/powerpc/xm-aix.h (UINT_MAX): Undef and use gdb's version. + * config/convex/xm-convex.h (CC_HAS_LONG_LONG): Remove + (PRINTF_HAS_LONG_LONG): Remove. + * config/xm-nbsd.h (CC_HAS_LONG_LONG): Remove. + (PRINTF_HAS_LONG_LONG): Remove. + * config/pa/tm-hppa.h (GET_FIELD): Put parens around + subtraction inside shift. Put parens around subtraction + in operand of bitwise and. + (struct frame_info): Forward declare + if __STDC__ defined. + (frame_saved_regs): Ditto. + (struct value): Ditto. + (struct type): Ditto. + (struct inferior_status): Ditto. + (init_extra_frame_info): Add prototype. + (skip_prologue): Ditto. + (frameless_function_invocation): Ditto. + (frame_chain): Ditto. + (frame_chain_valid): Ditto. + (saved_pc_after_call): Ditto. + (hppa_fix_call_dummy): Ditto. + (hppa_push_arguments): Ditto. + (pa_do_registers_info): Ditto. + (in_solib_call_trampoline): Ditto. + (in_solib_return_trampoline): Ditto. + (push_dummy_frame): Ditto. + * convex-tdep.c (decout): Use print_longest rather than + fprintf_filtered. + * defs.h: Remove use of FORCE_LONG_LONG and __GNUC__ to set + CC_HAS_LONG_LONG. + (INT_MIN): Fix so it works correctly when assigned to a long long. + * valprint.c (longest_to_int): Rewrite to remove dependence + on INT_MIN and INT_MAX. + (print_longest): Rewrite the code that falls back to synthesized + hex output when LONGEST value is not representable as in a long and + printf doesn't support printing long longs. + * ch-valprint.c (chill_val_print): Cast 2nd arg of + chill_print_type_scalar to LONGEST. + chill_print_type_scalar): Make static and add prototype. + * hppa-tdep.c (get_field): Ifdef out unused function. + (set_field): Ditto. + (extract_3): Ditto. + (extract_5_store): Ditto. + (extract_11): Ditto. + (extract_12): Ditto. + (deposit_17): Ditto. + (extract_14): Convert to static and add prototype. + (deposit_14): Ditto. + (extract_21): Ditto. + (deposit_21): Ditto. + (extract_17): Ditto. + (extract_5r_store): Ditto. + (extract_5R_store): Ditto. + (extract_5_load): Ditto. + (find_proc_framesize): Ditto. + (find_dummy_frame_regs): Ditto. + (sign_extend): Ditto. + (find_unwind_entry): Add prototype. + (find_return_regnum): Ditto. + (unwind_command): Ditto. + (find_dummy_frame_regs): Add parens around subtraction in operand + of bitwise-and. + (skip_prologue): Add parens around operands of logical-and inside + operand of logical-or. + (sign_extend): Add parens around operands of subtraction inside + operand of shift. + (low_sign_extend): Ditto. + * top.c (filename_completer): Convert old style decl of + filename_completion_function into prototype. + * f-lang.c (patch_common_entries): Ifdef out unused function. + * stabsread.c (read_cfront_baseclasses): Remove unused local + variable "msg_noterm". + (resolve_cfront_continuation): Remove unused local variable "fip". + (read_type): Remove unused variable xtypenums. + (read_cfront_static_fields): Remove unused variable "i". + (read_cfront_static_fields): Remove unused variable "nfields". + (read_cfront_member_functions): Add missing comment terminator. + (read_cfront_static_fields): Return 1 rather than random value. + (read_cfront_baseclasses): Ditto. + (read_cfront_baseclasses): Ditto. + (read_cfront_baseclasses): Ditto. + * somsolib.c (som_solib_create_inferior_hook): Remove unused + variable "u". + (som_solib_create_inferior_hook): Remove unused variable + shadow_contents. + (language.h): Add for needed prototypes. + (som_solib_sharedlibrary_command): Add prototype. + * hpread.c: (hpread_read_array_type): Add prototype. + * somread.c (hpread_build_pysmtabs): Add prototype. + (hpread_symfile_finish): Ditto. + (hpread_symfile_init): Ditto. + * hppah-nat.c (fetch_register): Convert old style decl + to prototype. + (gdbcore.h): Include for needed prototypes. + (fetch_register): Remove unused variable "mess". + * remote-pa.c (get_offsets): Ifdef out unused function. + (remote_start_remote): Remove unused variable "timeout". + (boot_board): Add prototype. + (reaad_frame): Add prototype. + (getpkt): Remove unused variable "bp". + (remote_kill): Add prototype. + (remote_mourn): Add prototype. + (remote_insert_breakpoint): Add prototype. + (remote_remove_breakpoint): Add prototype. + * valops.c (value_push): Only use if PUSH_ARGUMENTS is not defined. + * infcmd.c (do_registers_info): Only need prototype if + DO_REGISTERS_INFO is not defined. + (breakpoint_auto_delete_contents): Only need if + CALL_DUMMY_BREAKPOINT_OFFSET is defined. + +Sat Jul 27 08:49:49 1996 Fred Fish + + * xcoffread.c (xcoff_end_psymtab): Add textlow_not_set parameter. + (END_PSYMTAB): Ditto. + (scan_xcoff_symtab): Call xcoff_end_psymtab with textlow_not_set. + +Fri Jul 26 14:07:37 1996 Ian Lance Taylor + + * printcmd.c (_initialize_printcmd): Initialize + tm_print_insn_info.flavour. + +Thu Jul 25 19:41:31 1996 Fred Fish + + * Makefile.in (scm-valprint.o): Depends upon gdbcore_h. + (arm-tdep.o): Ditto. + (dcache.o): Ditto. + (i386ly-tdep.o): Ditto. + (i960-tdep.o): Ditto. + (m68k-tdep.o): Ditto. + (nindy-tdep.o): Ditto. + (scm-lang.o): Ditto. + (w65-tdep.o): Ditto. + (z8k-tdep.o): Ditto. + (m68k-tdep.o): Depends upon value_h and gdb_string.h + (m2-valprint.o): Depends upon m2-lang.h. + (sparc-tdep.o): Depends upon gdb_string.h + (valprint.o): Depends upon valprint.h + + * remote-e7000.c (notice_quit): Remove prototype. + * top.c (initialize_targets): Remove prototype, now in target.h. + * stabsread.c (resolve_cfront_continuation): Remove prototype. + * dbxread.c (resolve_cfront_continuation): Remove prototype. + * symfile.h (set_demangling_style): Remove prototype. + * config/tm-sysv4.h (in_plt_section): Remove prototype, in objfiles.h. + * config/sparc/tm-sparc.h (single_step): Remove extern decl, now in + target.h. + * config/arc/tm-arc.h (one_stepped, single_step): Remove extern decls, + now in target.h. + * ser-unix.c (hardwire_restore): Remove obsolete prototype. + * sparc-tdep.c (single_step): Remove forward decl of isbranch. + * scm-lang.c (find_function_in_inferior): Remove prototype. + (value_allocate_space_in_inferior): Ditto. + * infrun.c (write_pc_pid): Remove prototype, now in inferior.h. + * defs.h (strchr): Remove declarations, they are declared in + gdb_string.h also. + (strrchr): Ditto. + (strstr): Ditto. + (strtok): Ditto. + (strerror): Ditto. + * f-valprint.c (f77_print_array_1): Remove extra arg that was being + passed to f77_print_array_1. + * gdbtypes.c (add_name): Remove unused variables lenstrlen and lenstr. + * scm-exp.c (scm_istr2int): Remove unused variable "j". + (scm_parse): Remove unused variable "str". + * hp300ux-nat.c (store_inferior_register): Remove unused variable + "buf". + (store_inferior_registers): Remove unnecessary decl "registers". + * m68k-tdep.c (m68k_pop_frame): Remove unused variable "fi". + * scm-lang.c (scm_get_field): Remove unused variable "val". + (scm_lookup_name): Remove unused variable "symval". + * objfiles.c (map_to_file): Remove unused local variable "tempfd". + * procfs.c (do_attach, do_detach): Remove unused variable "result". + (last_resume_pid): Remove unused static variable. + * alpha-tdep.c (alpha_linux_sigtramp_offset): Remove unused variable + "res". + * objfiles.c (map_to_address): Remove unused function. + * f-valprint.c (print_max): Remove extraneous extern decl, + in valprint.h. + (calc_f77_array_dims): Remove extraneous prototype, in f-lang.h. + * ch-exp.c (write_lower_upper_value): Remove prototype for + type_lower_upper. + + * gdbtypes.c (cfront_mangle_name): #ifdef out unused function. + * ch-exp.c (parse_mode_call): Ditto. + * f-valprint.c (there_is_a_visible_common_named): Ditto. + * f-lang.c (clear_function_list): Ditto. + (get_bf_for_fcn): Ditto. + (clear_bf_list): Ditto. + (add_common_block): Ditto. + (patch_all_commons_by_name): Ditto. + (find_first_common_named): Ditto. + (add_common_entry): Ditto. + (allocate_saved_function_node): Ditto. + (allocate_saved_bf_node): Ditto. + (allocate_common_entry_node): Ditto. + (allocate_saved_f77_common_node): Ditto. + + * arm-tdep.c (gdbcore.h): Include for necessary prototypes. + * dcache.c (gdbcore.h): Ditto. + * i386ly-tdep.c (gdbcore.h): Ditto. + * i960-tdep.c (gdbcore.h): Ditto. + * m2-valprint.c (m2-lang.h): Ditto. + * m68k-tdep.c (gdbcore.h): Ditto. + (value.h): Ditto. + (gdb_string.h): Ditto. + * nindy-tdep.c (gdbcore.h): Ditto. + * scm-lang.c (gdbcore.h): Ditto. + * scm-valprint.c (gdbcore.h): Ditto. + * w65-tdep.c (gdbcore.h): Ditto. + * z8k-tdep.c (gdbcore.h): Ditto. + * sparc-tdep.c (gdb_string.h): Include. + * valprint.c (valprint.h): Include. + + * config/xm-lynx.h: Remove part of comment about INT_MIN + redefined warnings from defs.h, since INT_MIN define in + defs.h is now protected by #ifndef INT_MIN. + * config/i386/xm-i386bsd.h: Ditto. + * config/m68k/xm-hp300bsd.h: Ditto. + * config/m68k/xm-news.h: Ditto. + + * config/pa/xm-hppah.h (INT_MIN): Remove bogus INT_MIN + definition as 0x80000000. The macro in defs.h is better. + * config/i386/xm-i386m3.h (INT_MIN): Ditto. + * config/i386/xm-i386mach.h (INT_MIN): Ditto. + * config/ns32k/xm-ns32km3.h (INT_MIN): Ditto. + * config/pa/xm-hppab.h: Ditto. + + * core-aout.c (fetch_core_registers): Add prototype. + * hp300ux-nat.c (fetch_inferior_register): Ditto. + (store_inferior_register_1): Ditto. + (store_inferior_register): Ditto. + * config/m68k/tm-m68k.h (find_saved_regs): Ditto. + *scm-valprint.c (c_val_print): Ditto. + * procfs.c (add_fd): Ditto. + (remove_fd): Ditto. + (wait_fd): Ditto. + (sigcodename): Ditto. + (sigcodedesc): Ditto. + (procfs_kill_inferior): Ditto. + (procfs_xfer_memory): Ditto. + (procfs_store_registers): Ditto. + (create_procinfo): Ditto. + (procfs_init_inferior): Ditto. + (proc_set_exec_trap): Ditto. + (procfs_attach): Ditto. + (procfs_detach): Ditto. + (procfs_prepare_to_store): Ditto. + (procfs_files_info): Ditto. + (procfs_open): Ditto. + (procfs_wait): Ditto. + (procfs_fetch_registers): Ditto. + (procfs_mourn_inferior): Ditto. + (procfs_can_run): Ditto. + (procfs_thread_alive): Ditto. + (procfs_stop): Ditto. + * alpha-nat.c (fetch_core_registers): Ditto. + * config/alpha/tm-alpha.h (alpha_osf_skip_sigtramp_frame): Ditto. + * objfiles.c (ecoff_relocate_efi): Ditto. + * inflow.c (pass_signal): Ditto. + (handle_sigio): Ditto. + * annotate.c (breakpoint_changed): Ditto. + * callback.c (wrap): Ditto. + (fdbad): Ditto. + (fdmap): Ditto. + * utils.c (malloc_botch): Ditto. + (fputs_maybe_filtered): Ditto. + (vfprintf_maybe_filtered): Ditto. + * defs.h (notice_quit): Ditto. + * defs.h (xmalloc, xrealloc): Ditto. + * top.c (stop_sig): Ditto. + (init_signals): Ditto. + (user_defined_command): Ditto. + (source_cleanup_lines): Ditto. + (dont_repeat_command): Ditto. + (serial_log_command): Ditto. + (disconnect): Ditto. + * target.h (initialize_targets): Ditto. + * os9kread.c (read_minimal_symbols): Ditto. + * mdebugread.c (mdebug_psymtab_to_symtab): Ditto. + (fdr_name): Ditto. + (push_parse_stack): Ditto. + (pop_parse_stack): Ditto. + (is_pending_symbol): Ditto. + (add_pending): Ditto. + * serial.c (serial_logchar): Ditto. + (serial_interface_lookup): Ditto. + * serial.h (serial_log_command): Ditto. + * f-valprint.c (info_common_command): Ditto. + * gdbtypes.h (print_type_scalar): Ditto. + * scm-valprint.c (scm_scmlist_print): Ditto. + (scm_ipruk): Ditto. + * scm-lang.c (scm_printstr): Ditto. + (in_eval_c): Ditto. + (evaluate_subexp_scm): Ditto. + * scm-exp.c (scm_read_token): Ditto. + (scm_skip_ws): Ditto. + (scm_lreadparen): Ditto. + * m2-lang.c (emit_char): Ditto. + (m2_printchar): Ditto. + (m2_printstr): Ditto. + (m2_create_fundamental_type): Ditto. + * f-lang.c (emit_char): Ditto. + (f_printchar): Ditto. + (f_printstr): Ditto. + (f_create_fundamental_type): Ditto. + * ch-lang.c (chill_printchar): Ditto. + (chill_printstr): Ditto. + (chill_create_fundamental_type): Ditto. + (value_chill_length): Ditto. + (value_chill_card): Ditto. + (value_chill_max_min): Ditto. + (evaluate_subexp_chill): Ditto. + * ch-exp.c (PEEK_TOKEN): Ditto. + (peek_token_): Ditto. + (forward_token_): Ditto. + (parse_case_label): Ditto. + (parse_opt_untyped_expr): Ditto. + (parse_unary_call): Ditto. + (parse_call): Ditto. + (parse_named_record_element): Ditto. + (parse_tuple_element): Ditto. + (parse_opt_element_list): Ditto. + (parse_tuple): Ditto. + (parse_primval): Ditto. + (parse_operand6): Ditto. + (parse_operand5): Ditto. + (parse_operand4): Ditto. + (parse_operand3): Ditto. + (parse_operand2): Ditto. + (parse_operand1): Ditto. + (parse_operand0): Ditto. + (parse_expr): Ditto. + (parse_then_alternative): Ditto. + (parse_else_alternative): Ditto. + (parse_if_expression): Ditto. + (parse_untyped_expr): Ditto. + (growbuf_by_size): Ditto. + (match_simple_name_string): Ditto. + (decode_integer_value): Ditto. + (decode_integer_literal): Ditto. + (match_float_literal): Ditto. + (match_float_literal): Ditto. + (match_string_literal): Ditto. + (match_character_literal): Ditto. + (match_integer_literal): Ditto. + (match_bitstring_literal): Ditto. + (write_lower_upper_value): Ditto. + * ch-lang.h (type_lower_upper): Ditto. + * c-lang.c (emit_char): Ditto. + * dwarfread.c (free_utypes): Ditto. + * stabsread.h (resolve_cfront_continuation): Ditto. + * stabsread.c (get_substring): Ditto. + (read_one_struct_field): Ditto. + * stabsread.h (process_later): Ditto. + * demangle.c (set_demangling_command): Ditto. + * defs.h (set_demangling_style): Ditto. + * maint.c (maintenance_info_command): Ditto. + (print_section_table): Ditto. + (maintenance_info_sections): Ditto. + (maintenance_print_command): Ditto. + * symtab.h (maintenance_print_statistics): Ditto. + * objfiles.h (in_plt_section): Ditto. + * objfiles.c (add_to_objfile_sections): Ditto. + * bcache.c (hash): Ditto. + (lookup_cache): Ditto. + * exec.c (bfdsec_to_vmap): Ditto. + (ignore): Ditto. + * f-exp.y (growbuf_by_size, match_string_literal): Ditto. + * language.c (unk_lang_printchar): Ditto. + (unk_lang_printstr): Ditto. + (unk_lang_create_fundamental_type): Ditto. + (unk_lang_print_type): Ditto. + (unk_lang_val_print): Ditto. + (unk_lang_value_print): Ditto. + * target.c (update_current_target): Ditto. + (debug_to_open): Ditto. + (debug_to_close): Ditto. + (debug_to_attach): Ditto. + (debug_to_detach): Ditto. + (debug_to_resume): Ditto. + (debug_to_wait): Ditto. + (debug_to_fetch_registers): Ditto. + (debug_to_store_registers): Ditto. + (debug_to_prepare_to_store): Ditto. + (debug_to_xfer_memory): Ditto. + (debug_to_files_info): Ditto. + (debug_to_insert_breakpoint): Ditto. + (debug_to_remove_breakpoint): Ditto. + (debug_to_terminal_init): Ditto. + (debug_to_terminal_inferior): Ditto. + (debug_to_terminal_ours_for_output): Ditto. + (debug_to_terminal_ours): Ditto. + (debug_to_terminal_info): Ditto. + (debug_to_kill): Ditto. + (debug_to_load): Ditto. + (debug_to_lookup_symbol): Ditto. + (debug_to_create_inferior): Ditto. + (debug_to_mourn_inferior): Ditto. + (debug_to_can_run): Ditto. + (debug_to_notice_signals): Ditto. + (debug_to_thread_alive): Ditto. + (debug_to_stop): Ditto. + * breakpoint.h (set_breakpoint_sal): Ditto. + * remote-utils.c (usage): Ditto. + * remote.c (set_thread): Ditto. + (remote_thread_alive): Ditto. + (get_offsets): Ditto. + (read_frame): Ditto. + (remote_insert_breakpoint): Ditto. + (remote_remove_breakpoint): Ditto. + * sparc-nat.c (fetch_core_registers): Ditto. + * corelow.c (add_to_thread_list): Ditto. + (ignore): Ditto. + * inftarg.c (proc_wait): Ditto. + * infptrace.c (udot_info): Ditto. + (fetch_register): Ditto. + * ser-unix.c (hardwire_noflush_set_tty_state): Ditto. + (hardwire_print_tty_state): Ditto. + (hardwire_flush_output): Ditto. + (hardwire_flush_input): Ditto. + (hardwire_send_break): Ditto. + (hardwire_setstopbits): Ditto. + * ser-tcp.c (tcp_return_0): Ditto. + (tcp_noflush_set_tty_state): Ditto. + (tcp_print_tty_state): Ditto. + * solib.c (match_main): Ditto. + * gdbtypes.c (print_bit_vector): Ditto. + (print_arg_types): Ditto. + (dump_fn_fieldlists): Ditto. + (print_cplus_stuff): Ditto. + * symfile.h (entry_point_address): Ditto. + * symfile.c (decrement_reading_symtab): Ditto. + * valops.c (value_arg_coerce): Ditto. + * value.h (find_function_in_inferior): Ditto. + (value_allocate_space_in_inferior): Ditto. + * values.c (vb_match): Ditto. + * thread.c (info_thread_command): Ditto. + (restore_current_thread): Ditto. + (thread_apply_all_command): Ditto. + (thread_apply_command): Ditto. + * inferior.h (write_pc_pid): Ditto. + * infrun.c (delete_breakpoint_current_contents): Ditto. + * breakpoint.c (print_it_normal): Ditto. + (watchpoint_check): Ditto. + (print_it_done): Ditto. + (print_it_noop): Ditto. + (maintenance_info_breakpoints): Ditto. + (create_longjmp_breakpoint): Ditto. + (hbreak_command): Ditto. + (thbreak_command): Ditto. + (watch_commnd_1): Ditto. + (rwatch_command): Ditto. + (awatch_command): Ditto. + (do_enable_breakpoint): Ditto. + * ch-valprint.c (chill_val_print_array_elements): Ditto. + * eval.c (evaluate_subexp): Ditto. + (get_label): Ditto. + (evaluate_struct_tuple): Ditto. + * eval.c (init_array_element): Ditto. + + * alpha-tdep.c (push_sigtramp_desc): Add prototype and make static. + * breakpoint.c (hw_breakpoint_used_count): Ditto. + (hw_watchpoint_used_count): Ditto. + * findvar.c (write_register_gen): Ditto. + (read_register_pid): Ditto. + * symtab.c (cplusplus_hint): Ditto. + * infcmd.c (breakpoint_auto_delete_contents): Ditto. + * ch-valprint.c (chill_print_type_scalar): Ditto. + * gdbtypes.c (add_name): Ditto. + (add_mangled_type): Ditto. + (cfront_mangle_name): Ditto. + * sparc-tdep.c (isbranch): Ditto. + * inftarg.c (child_stop): Ditto. + * win32-nat.c (child_stop): Ditto. + * mac-nat.c (child_stop): Ditto. + * remote-utils.c (sr_com): Ditto. + * dbxread.c (process_now): Ditto. + * ch-exp.c (require): Ditto. + (check_token): Ditto. + (expect): Ditto. + (parse_mode_call): Ditto. + (parse_mode_or_normal_call): Ditto. + * scm-lang.c (scm_lookup_name): Ditto + * f-lang.c (allocate_saved_bf_node): Ditto. + (allocate_saved_function_node): Ditto. + (allocate_saved_f77_common_node): Ditto. + (allocate_common_entry_node): Ditto. + (add_common_block): Ditto. + (add_common_entry): Ditto. + (find_first_common_named): Ditto. + (patch_common_entries): Ditto. + (patch_all_commons_by_name): Ditto. + (clear_bf_list): Ditto. + (get_bf_for_fcn): Ditto. + (clear_function_list): Ditto. + * scm-exp.c (scm_istr2int): Ditto. + (scm_istring2number): Ditto. + * scm-valprint.c (scm_inferior_print): Ditto. + * f-typeprint.c (print_equivalent_f77_float_type): Ditto. + * f-valprint.c (f77_get_dynamic_length_of_aggregate): Ditto. + (f77_create_arrayprint_offset_tbl): Ditto. + (f77_print_array_1): Ditto. + (f77_print_array): Ditto. + (list_all_visible_commons): Ditto. + (there_is_a_visible_common_named): Ditto. + * mdebugread.c (ecoff_relocate_efi): Ditto. + * callback.c (os_close): Ditto. + (os_get_errno): Ditto. + (os_isatty): Ditto. + (os_lseek): Ditto. + (os_open): Ditto. + (os_read): Ditto. + (os_read_stdin): Ditto. + (os_write): Ditto. + (os_write_stdout): Ditto. + (os_rename): Ditto. + (os_system): Ditto. + (os_time): Ditto. + (os_unlink): Ditto. + (os_shutdown): Ditto. + (os_init): Ditto. + (os_printf_filtered): Ditto. + + * scm-lang.h (scm_parse): Change old style decl to prototype. + * config/alpha/tm-alphalinux.h (alpha_linux_sigtramp_offset): Ditto. + * top.c (init_proc): Ditto. + (query_hook): Ditto. + (error_hook): Ditto. + * f-lang.c (c_value_print): Ditto. + * ch-exp.c (parse_expression): Ditto. + (parse_primval): Ditto. + (parse_untyped_expr): Ditto. + (parse_opt_untyped_expr): Ditto. + (ch_lex): Ditto. + * config/sparc/tm-sparc.h (sparc_init_extra_frame_info): Ditto. + (sparc_frame_saved_pc): Ditto. + (sparc_push_dummy_frame): Ditto. + (sparc_pop_frame): Ditto. + * defs.h (fclose): Ditto. + (atof): Ditto. + (error_hook): Ditto. + + * arc-tdep.c (single_step): Change arg to type "enum target_signal". + * rs6000-tdep.c (single_step): Ditto. + * sparc-tdep.c (single_step): Ditto. + + * breakpoint.c (cleanup_executing_breakpoints): Change unused arg type + to PTR which is what make_cleanup expects. + * utils.c (null_cleanup): Change arg type to PTR. + * defs.h (null_cleanup): Change prototype to match actual function. + * config/sparc/tm-sparc.h (struct frame_info): Move forward decl. + * ch-valprint.c (chill_val_print): Cast 2nd arg of + chill_print_type_scalar to LONGEST. + * infrun.c (wait_for_inferior): Have empty switch case for + BPSTAT_WHAT_CHECK_SHLIBS when SOLIB_ADD is not defined. + (stop_on_solib_events): Only needed if SOLIB_ADD is defined. + * infcmd.c (attach_command): Only need auto_solib_add if SOLIB_ADD + is defined. + * symfile.c (generic_load): Scan long int using a long int spec, + not an int spec. + * infptrace.c (udot_info): Only need local variables if KERNEL_U_SIZE + is defined. + (fetch_register): Only need function if FETCH_INFERIOR_REGISTERS is + not defined. + * inflow.c (handle_sigio): Only need prototype when the actual + function is compiled in. + * valprint.c (longest_to_int): Expand error message to be + separate messages for args larger than largest signed int + and args smaller than smallest signed int. + * valprint.c (print_longest): Fix problems with support for case + where compiler supports type "long long" but the runtime doesn't + support printing them with "%ll". + * scm-valprint.c (scm_scmlist_print, scm_scmval_print): Change + return types to void since we don't actually return anything + meaningful and callees ignore the values anyway. + * procfs.c (modify_inherit_on_fork_flag): Enclose pr_flags in PIOCSET + ifdef. + (modify_run_on_last_close_flag): Ditto. + (wait_fd): Enclose local variables "num_fds" and "i" LOSING_POLL + ifdef + * alpha-tdep.c (push_sigtramp_desc): Return proc_desc rather than + random value. + * infrun.c (wait_for_inferior): Ensure random_signal is not used + uninitialized. + * valops.c (call_function_by_hand): Ensure struct_addr is not used + uninitialized. + * breakpoint.c (watch_command_1): Ensure prev_frame is not used + uninitialized. + * utils.c (vfprintf_maybe_filtered): Change second arg from "char *" + to "const char *". + * infptrace.c (udot_info): Add two dummy args so that the type is + correct for passing to add_info. + * f-lang.c (saved_fcn): Move decl to head of file so it can be used + in prototypes. + (saved_bf_symnum): Ditto. + (SAVED_FUNCTION): Ditto. + (SAVED_FUNCTION_PTR): Ditto. + (SAVED_BF): Ditto. + (SAVED_BF_PTR): Ditto. + * ch-exp.c (parse_named_record_element): Build error message in + temporary buffer before passing it to expect, rather than passing + wrong number of args to expect. + * demangle.c (set_demangling_style): Call set_demangling_command with + correct number of arguments. + * inferior.h (terminal_init_inferior_with_pgrp): Change arg type to + int to match actual function. + (os_isatty): Call fdmap with right number of arguments, was missing + the host_callback* arg. + * target.c (cleanup_target): Prototype all functions casts. + * target.h (one_stepped, single_step): Declare here and convert + single_step to prototype. + * infrun.c (one_stepped, single_step): Don't declare externs + here, they have moved to target.h. + * eval.c (init_array_element): Declare previously undeclared + last two args as LONGEST. + * dcache.c (dcache_xfer_memory): Change xfunc decls to prototype form. + +Thu Jul 25 16:11:54 1996 Doug Evans + + * dsrec.c (load_srec): Protect ANSI style function parms with PARAMS. + +Mon Jul 22 18:13:27 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in (os9kread.o): Remove dependency on partial-stab.h. + * dbxread.c (read_dbx_symtab end_psymtab), partial-stab.h: Don't + use partial_symtab->textlow==0 as a flag, as 0 is a legitimate + text address. Use a seperate flag (textlow_not_set) instead. + This makes stabs in ELF .o files work a lot better. + * mdebugread.c xcoffread.c: Define textlow_not_set for + partial-stab.h. + * stabsread.h (end_psymtab): Add textlow_not_set arg to prototype. + +Sat Jul 20 10:41:06 1996 Fred Fish + + * dwarf2read.c (struct filenames): Change internal "struct file" + to "struct fileinfo" to avoid conflict with "struct file" in + on HPUX and Solaris. + +Fri Jul 19 14:05:57 1996 Stan Shebs + + * dwarf2read.c: New file, DWARF 2 reader originally contributed by + Brent Benson, with additions by Gary Funck and Jerry Kreuscher. + * Makefile.in (COMMON_OBS): Add dwarf2read.o. + (SFILES): Add dwarf2read.c. + (dwarf2read.o): Add build rule. + * symfile.h (dwarf2_has_info, dwarf2_build_psymtabs): Declare + exported functions. + * elfread.c (elf_symfile_read): Call them. + (elf_symtab_read) [HARRIS_TARGET]: Skip some special symbols. + +Thu Jul 18 01:22:01 1996 Geoffrey Noer + + * symfile.c (symfile_bfd_open): + * exec.c (exec_file_command): for __GO32__ and __WIN32__ systems, + free the user from having to type the .exe extension. + +Wed Jul 17 06:54:50 1996 Mark Alexander + + * mon960-rom.c: Shorten the mon960_inits string to a single + carriage return; this prevents a hang on connecting immediately + after powerup, when MON960 is attempting autobaud detection. + +Tue Jul 16 23:47:04 1996 Mark Alexander + + * a29k-tdep.c (get_saved_register): Allow PC to be modified + when innermost frame is selected, but not in outer frames. + +Tue Jul 16 23:37:25 1996 Stu Grossman (grossman@critters.cygnus.com) + + * command.c (do_setshow_command): Don't segfault when showing + var_string and var_string_noescape vars that are NULL. + +Mon Jul 15 16:55:48 1996 Doug Evans + + * win32-nat.c (handle_load_dll): dos_path_to_unix_path renamed to + cygwin32_conv_to_posix_path. + (child_create_inferior): unix_path_to_dos_path renamed to + cygwin32_conv_to_win32_path. Rewrite code to translate PATH. + +Mon Jul 15 16:44:05 1996 Stu Grossman (grossman@critters.cygnus.com) + + * defs.h printcmd.c: Create global disassemble_info structure + tm_print_insn_info. + * i386-tdep.c (set_assembly_language_command): set + tm_print_insn_info.mach to the appropriate value for 386 or 8086 + disassembly. + * printcmd.c (print_insn): Move init of disassembler_info to + _initialize_printcmd. Set endian for disassembler here. + * sparc-tdep.c: Set tm_print_insn_info.mach as appropriate to + select sparc/sparclite. + * config/sparc/{tm-sparc.h tm-sparclite.h}: Get rid of + TM_PRINT_INSN. Set TM_PRINT_INSN_MACH to + bfd_mach_sparc/bfd_mach_sparc_sparclite. + +Fri Jul 12 19:04:32 1996 Fred Fish + + * hpread.c (hpread_lookup_type): Use xmmalloc/xmrealloc rather + than xmalloc/xrealloc. + +Fri Jul 12 17:59:47 1996 Fred Fish + + * objfiles.c (map_to_file): Error return from mmalloc_findbase is + a NULL pointer, not a -1. + +Fri Jul 12 10:16:24 1996 Stu Grossman (grossman@critters.cygnus.com) + + * i386-tdep.c (set_assembly_language_command): New routine to + select between i386 and i8086 instruction sets for disassembly. + New command `set assembly-language {i386 i8086}'. + +Thu Jul 11 21:13:21 1996 Mark Alexander + + * monitor.c (monitor_write_memory, monitor_read_memory_single): + Disable use of "long long" memory read/write commands; can't + use them because we hold the values to read/write in an int + variable, and because strtoul fails on values that exceed the + size of a long. This fixes breakpoint problems on MON960. + +Thu Jul 11 11:39:31 1996 Fred Fish + + * config/m68k/xm-hp300hpux.h (HAVE_MMAP): Remove definition. + * config/pa/xm-hppah.h (HAVE_MMAP): Ditto. + +Wed Jul 10 16:54:41 1996 Fred Fish + + * Makefile.in (MMALLOC_CFLAGS): Eliminate intermediate MMALLOC_DISABLE + and MMALLOC_CHECK macros, and add comment indicating how host dependent + makefile fragment should modify MMALLOC_CFLAGS to not use mmalloc, or + to use it but to not do heap corruption checking. + * gdbserver/Makefile.in: Ditto. + * utils.c (init_malloc): Replace warning() use with direct call of + fprintf_unfiltered, since current_target has not yet been set and thus + we cannot use warning(). If we try to use mmcheck and it fails, + suggest that this configuration needs NO_MMCHECK or MMCHECK_FORCE + defined. Other small mmalloc related cleanups. + * config/sparc/sun4os4.mh (MMALLOC_CFLAGS): Define MMCHECK_FORCE to 1. + * config/alpha/alpha-osf2.mh (MMALLOC_CFLAGS): Set to -DNO_MMCHECK. + + * config/sparc/xm-sun4os4.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT): + * config/i386/xm-i386v4.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT): + * config/i386/xm-linux.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT): + * config/m68k/xm-hp300hpux.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT): + * config/m68k/xm-m68kv4.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT); + * config/m68k/xm-sun3os4.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT): + * config/pa/xm-hppah.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT): + * config/sparc/xm-sun4sol2.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT): + Remove obsolete defines. + + * config/alpha/alpha-linux.mh (MMALLOC_DISABLE): + * config/alpha/alpha-osf1.mh (MMALLOC_DISABLE): + * config/rs6000/rs6000.mh (MMALLOC_DISABLE): + * config/rs6000/aix4.mh (MMALLOC_DISABLE): + * config/powerpc/aix4.mh (MMALLOC_DISABLE): + * config/powerpc/aix.mh (MMALLOC_DISABLE): + * config/ns32k/ns32km3.mh (MMALLOC_DISABLE): + * config/mips/mipsm3.mh (MMALLOC_DISABLE): + * config/mips/decstation.mh (MMALLOC_DISABLE): + * config/m88k/cxux.mh (MMALLOC_DISABLE): + * config/i386/i386mk.mh (MMALLOC_DISABLE): + * config/i386/i386m3.mh (MMALLOC_DISABLE): + * config/i386/i386gnu.mh (MMALLOC_DISABLE): + Use MMALLOC_CFLAGS instead. + +Tue Jul 9 22:41:12 1996 Jeffrey A Law (law@cygnus.com) + + * h8300-tdep.c: Remove some outdated comments. + (h8300_skip_prologue): Rework to be more correct for the H8/300H. + Handle stm.l insns for the H8/S. + (examine_prologue): Likewise. + +Tue Jul 9 16:48:55 1996 Raymond Jou + + * ser-mac.c (mac_close): Change a typo SetSetBuf to SerSetBuf. + +Mon Jul 08 08:50:39 1996 Mark Alexander + + * mon960-rom.c (mon960_open): Add floating point detection to + prevent hang on non-FPU processors (PR 9775). + (mon960_cmds): Swap setmem.cmdw and setmem.cmdl to fix problem + setting breakpoints and improve loading speed. + +Sun Jul 7 14:57:34 1996 Fred Fish + + * coffread.c (record_minimal_symbol): Don't presave name string + on symbol_obstack before passing to prim_record_minimal_symbol. + It now handles saving the string itself. + * dbxread.c (read_dbx_dynamic_symtab): Ditto. + * mipsread.c (read_alphacoff_dynamic_symtab): Ditto. + * os9kread.c (record_minimal_symbol): Ditto. + * solib.c (solib_add_common_symbols): Ditto. + + * coffread.c (coff_symtab_read): Don't presave name string on + symbol_obstack before passing to prim_record_minimal_symbol_and_info. + It now handles saving the string itself. + * dbxread.c (record_minimal_symbol): Ditto. + * elfread.c (record_minimal_symbol_and_info): Ditto. + + * dstread.c (record_minimal_symbol): Remove static function that just + called prim_record_minimal_symbol with the same args (after change to + prim_record_minimal_symbol to do it's own name string saves). + * nlmread.c (record_minimal_symbol): Ditto. + * somread.c (record_minimal_symbol): Ditto. + + * hpread.c (hpread_read_enum_type): Save symbol name on symbol obstack. + (hpread_read_function_type): Ditto. + (hpread_process_one_debug_symbol): Ditto. + * mdebugread.c (parse_symbol): Ditto. + (new_symbol): Ditto. + * minsyms.c (prim_record_minimal_symbol_and_info): Ditto. + + * coffread.c (process_coff_symbol): Use obsavestring to save + SYMBOL_NAME, rather than obstack_copy0. + * dstread.c (create_new_symbol): Ditto + * symfile.c (obconcat): Ditto. + * stabsread.c (patch_block_stabs): Ditto. + * xcoffread.c (SYMNAME_ALLOC): Ditto. + + * symfile.c (obsavestring): Update comments + * solib.c (solib_add_common_symbols): Remove local var origname. + +Wed Jul 3 15:56:08 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure: Re-build with autoconf-2.10. + + * sparcl-tdep.c (_initialize_sparc_tdep) config/sparc/tm-sparc.h, + config/sparc/tm-sparclite.h: Initialize tm_print_insn from + TM_PRINT_INSN, which comes from the tm file. + +Tue Jul 02 21:41:20 1996 Mark Alexander + + * coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c, + os9kread.c: Replace identical sym_offsets functions with + default_symfile_offsets. + * somread.c (som_symfile_offsets): Use new SIZEOF_SECTION_OFFSETS + macro to allocate section_offsets. + * symfile.c (default_symfile_offsets): New function. + * symfile.h: Declare default_symfile_offsets. + * symtab.h: Define SIZEOF_SECTION_OFFSETS macro to + simplify allocation of section_offsets. + +Tue Jun 11 12:02:55 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in (INTERNAL_LDFLAGS): Add in flags from configure. + * configure configure.in: Only make sol-thread.o for native. + Also, switch to dlopened libthread_db.so.1. + * sol-thread.c: Switch to using dlopen to get the thread_db + library. + +Thu Jun 13 16:53:25 1996 Stu Grossman (grossman@critters.cygnus.com) + + * configure, configure.in: Change test for libthread_db to only + work for configs where build/host/target are the same. + +Tue Jul 2 15:04:20 1996 Michael Meissner + + * config/powerpc/{linux.mh,xm-linux.h}: New files, for Linux on + PowerPC. + + * configure.in (powerpc-*-linux): Add Linux, System V, and ELF + support. + * configure: Regenerate. + +Mon Jul 1 13:00:43 1996 Stan Shebs + + From Raymond Jou : + * mpw-make.sed: Add lines to whack out autoconf hook + @CONFIG_LDFLAGS@. + +Mon Jul 01 11:07:15 1996 Mark Alexander + + * remote-e7000.c (e7000_stop): New function. + +Fri Jun 28 06:34:19 1996 Dawn Perchik + + * configure, configure.in: Add target sparclet. + * monitor.h, monitor.c: Added monitor flags MO_NO_ECHO_ON_SETMEM + (don't expect echo on setmem command), MO_RUN_FIRST_TIME (if + command to start process running on target is different from one + to continue execution), MO_HEX_PREFIX (if addresses from monitor + have a "0x" prefix). + * monitor.c, parse.c, sparc-tdep.c: Don't require strings in the + registers array. This is to allow NULLs to be place holders in + the tm-*.h file so that only minor changes are needed when a new + processor is introduced (eg, one without floating point). + * sparc-tdep.c: Conditionally remove dependancies on floating + point. + * sparclet-rom.c, config/sparc/sparclet.mt, + config/sparc/tm-sparclet.h: New files for target sparclet. + * symfile.c (load_command): Add option for 2nd parameter; a load + offset added to the vma of each section. + +Fri Jun 28 05:39:19 1996 Dawn Perchik + + * main.c (main): Add option "l" for setting remote_timeout. + +Fri Jun 28 05:25:18 1996 Dawn Perchik + + * remote-e7000.c, remote.c, target.h, top.c: Add set option + "remote_timeout" for setting remote_timeout. Add set option + "use_hard_breakpoints" for setting hardware .vs. memory + breakpoints. + +Fri Jun 28 04:32:18 1996 Dawn Perchik + + * remote-e7000.c (e7000_parse_device): New function. + Add option "tcp_remote" to target command if using + tcp to connect to a remote host which is then connected + via serial port to the e7000 (for exampole, a port master). + (e7000_open): Change to call e7000_parse_device. + +Fri Jun 28 03:47:17 1996 Dawn Perchik + + * monitor.c (monitor_debug): Fix remotedebug buffering. + +Thu Jun 27 18:24:17 1996 Stan Shebs + + * config/i386/cygwin32.mh, config/powerpc/cygwin32.mh + (NATDEPFILES): Add a space. + +Wed Jun 26 06:05:39 1996 Wilfried Moser + + * gdbtypes.c (create_array_type): If TYPE_LENGTH (result_type) + is zero, set TYPE_FLAG_TARGET_STUB to force reevaluation of the type. + + * ch-exp.c (calculate_array_length): Function removed. + +Tue Jun 25 17:41:06 1996 Martin M. Hunt + + * remote-e7000.c (e7000_read_inferior_memory_large): New function. + (e7000_xfer_inferior_memory): Call it. + +Tue Jun 25 23:14:07 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * gdb/gdbserver/Makefile.in (docdir): Removed. + +Tue Jun 25 22:05:38 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir): + Use autoconf set values. + (docdir): Removed. + * configure.in (AC_PREREQ): autoconf 2.5 or higher. + * nlm/Makefile.in (bindir, libdir, datadir, mandir, infodir, + includedir): Use autoconf set values. + (docdir): Removed. + * nlm/configure.in (AC_PREREQ): autoconf 2.5 or higher. + * nlm/configure: Rebuilt. + * gdb/gdbserver/Makefile.in (datadir): Set to $(prefix)/share. + +Mon Jun 24 09:56:14 1996 Angela Marie Thomas (angela@cygnus.com) + + * stabsread.c (read_cfront_member_functions): add type + +Sun Jun 23 23:40:48 1996 Doug Evans + + * win32-nat.c: #include . + (unix_paths_to_dos_paths, dos_paths_to_unix_paths): Delete. + (child_create_inferior): Convert only env var PATH to win32 style. + (set_pathstyle_dos): Delete. + (_initialize_inftarg): Delete dos-path-style command. + +Thu Jun 20 13:42:23 1996 Doug Evans + + * configure.in: Revise sol-thread.o test. + * configure: Regenerated. + + * source.c (find_source_lines): Reassign size to result of read. + +Tue Jun 18 16:25:54 1996 Jeffrey A. Law + + * h8300-dep.c (gdb_print_insn_h8300): Handle the H8/S. + (h8300_command): Likewise. + (set_machine): Likewise. + (set_machine_hook): Likewise. + (_initialize_h8300m): Likewise. + + * config/h8300/tm-h8300.h (h8300smode): Declare. + +Sun Jun 16 15:21:51 1996 Jeffrey A. Law + + * somsolib.c (som_solib_create_inferior_hook): Handle tracking + of shl_load calls for hpux10. + +Thu Jun 13 11:16:10 1996 Tom Tromey + + * config.in: Regenerated. + * acconfig.h (HAVE_THREAD_DB_LIB): Added entry. + + * configure: Regenerated. + * aclocal.m4 (CY_AC_PATH_TCLH, CY_AC_PATH_TKH): Use odd names to + avoid name clashes with SunOS headers. + +Tue Jun 11 19:52:50 1996 Fred Fish + + From Michael Snyder : + * bcache.c (print_bcache_statistics): Avoid divide-by-zero + exception if one or more objfile has no symbols, such as when + a dynamic library has been stripped. + +Tue Jun 11 12:02:55 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in (INTERNAL_LDFLAGS): Add in flags from configure. + * configure configure.in: Only make sol-thread.o for native. + Also, switch to dlopened libthread_db.so.1. + * sol-thread.c: Switch to using dlopen to get the thread_db + library. + +Mon Jun 10 14:17:19 1996 Fred Fish + + * config/sparc/{xm-sun4sol2.h,xm-sun4os4.h} (MMAP_BASE_ADDRESS): + Change from 0xE0000000 to 0xC0000000. + +Thu Jun 6 17:10:32 1996 Michael Meissner + + * config/powerpc/xm-solaris.h: Initial version of support for + Solaris on PowerPC. + +Wed Jun 5 01:52:57 1996 James G. Smith + + * configure.in (configdirs): Force 4100 builds to use 4300 GDB + target. + * configure: Rebuild. + + * config/mips/vr4300el.mt (SIM_OBS): Include simulator in + little-endian builds. + +Mon Jun 3 11:48:29 1996 Jeffrey A Law (law@cygnus.com) + + * inftarg.c (child_thread_alive): Protect declaration with + #ifndef CHILD_THREAD_ALIVE. + + * source.c (find_source_lines): Check the time on the symtab's bfd if + it exists, else check the time on the exec_bfd. + +Thu May 30 09:43:17 1996 Mark Alexander + + * dsrec.c (make_srec): Fix calculation of address size + to allow addresses less than 0x100. + +Thu May 30 04:24:09 1996 Wilfried Moser + + * ch-exp.c (ch_lex): In case of LOC_TYPEDEF call calculate_array_length. + +Tue May 28 16:15:47 1996 Geoffrey Noer + + * remote-mips.c: cannot use EINVAL for breakpoint test since + its value varies for different hosts (e.g. go32's is 19, while + sunos is 22). Changed to hardcoded 22 since that is what the + mips boards return. + +Tue May 28 11:14:58 1996 Tom Tromey + + * configure: Regenerated. + * aclocal.m4 (CY_AC_PATH_TCLH): Don't use AC_TRY_RUN. + (CY_AC_PATH_TKH): Don't use AC_TRY_RUN. + +Sun May 26 16:56:35 1996 Miles Bader + + * solib.c (solib_absolute_prefix, solib_search_path): New variables. + (_initialize_solib): Add set/show commands for those variables. + (solib_map_sections): Implement searching using them. + +Sun May 26 14:14:49 1996 Fred Fish + + Changes from: David Mosberger-Tang + + * NEWS: Add Alpha Linux as a new native configuration. + + * mdebugread.c (parse_symbol): When we find a malloc() symbol with + return type VOID, assume no debugging info is available for that + object file and patch the return value into VOID *. Otherwise, + operations requiring an implicit call to malloc() will fail. + + * infrun.c (wait_for_inferior): The criterion to detect entering a + sigtramp handler is now: (a) the current pc is inside a sigtramp + handler, (b) the previous pc is not in a sigtramp handler, and (c) + the current stack pointer is "inner" than the old one. Condition + (c) is new to avoid mistaking a return from a signal handler into + sigtramp as a new sigtramp invocation. + + * dcache.c (struct dcache_block): Declare addr as CORE_ADDR. An + int may not be big enough to hold an address. + (dcache_hit): Ditto. + (dcache_peek_byte): Fix indentation. + + * configure.in (alpha-*-linux*): Add target. + * configure: Rebuild + + * config/alpha/tm-alpha.h (PROC_DESC_IS_DYN_SIGTRAMP): New macro. + (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (DYNAMIC_SIGTRAMP_OFFSET): Ditto. + (SIGCONTEXT_ADDR): Ditto. + (FRAME_PAST_SIGTRAMP_FRAME): Ditto. + + * config/alpha/alpha-linux.mh: New file. + * config/alpha/alpha-linux.mt: Ditto. + * config/alpha/nm-linux.h: Ditto. + * config/alpha/tm-alphalinux.h: Ditto. + * config/alpha/xm-alphalinux.h: Ditto. + * config/alpha/xm-alphaosf.h: Renamed from xm-alpha.h. + * config/alpha/alpha-osf1.mh (XM_FILE): Change from xm-alpha.h to + xm-alphaosf.h. + * config/alpha/alpha-osf2.mh: Ditto. + + * blockframe.c (find_pc_partial_function): Pass PC to + SIGTRAMP_START and SIGTRAMP_END macros for the benefit of systems + that detect sigtramp code via designated code sequences (as is the + case for Linux/Alpha, for example). + + * config/i386/tm-i386bsd.h: Change SIGTRAMP_START and SIGTRAMP_END + to ignore new PC argument. + * config/m68k/tm-hp300bsd.h: Ditto. + * config/vax/tm-vax.h: Ditto. + + * alpha-tdep.c (alpha_linux_sigtramp_offset): New function. + (alpha_osf_skip_sigtramp_frame): Ditto. + (push_sigtramp_desc): Ditto. + (alpha_find_saved_regs): Use SIGCONTEXT_ADDR macro to extract + sigcontext address from frame. + (alpha_saved_pc_after_call): When in sigtramp, use + alpha_frame_saved_pc() instead of read-register(). + (after_prologue): When inside a dynamically generated sigtramp + function, there is no prologue, so return address of first + instruction. + (alpha_in_prologue): Fix typo in comment. + (find_proc_desc): Use macro DYNAMIC_SIGTRAMP_OFFSET to determine + whether we're inside a dynamicaly generated sigtramp function. If + so, create and push and appropriate procedure descriptor. + (alpha_frame_chain): Use macro FRAME_PAST_SIGTRAMP_FRAME to obtain + the frame past a sigtramp frame (if the current frame is indeed a + sigtramp function). + (init_extra_frame_info): Don't read next frame register off of + stack-pointer when inside a dynamiccaly generated sigtramp. + (alpha_pop_frame): Also unlink and destroy procedure descriptors + created for dynamically generated sigtramp functions. + + * alpha-nat.c: When compiling under Linux, include and + instead of + +Tue Jul 2 13:58:10 1996 Miles Bader + + * gnu-nat.c (inf_validate_task_sc): + Give terminal to gdb while asking question. + (inf_resume): Don't validate the task suspend-count while execing. + +Thu Jun 13 11:04:52 1996 Miles Bader + + * gnu-nat.c (inf_validate_task_sc): Query user before clearing any + additional suspend count. + (S_proc_wait_reply, gnu_attach): Don't call inf_validate_task_sc. + (inf_resume): Call inf_validate_task_sc here. + (gnu_resume): Call inf_update_procs to ensure noticing new threads. + +Fri Jun 7 17:00:43 1996 Miles Bader + + * gnu-nat.c (gnu_create_inferior: attach_to_child): Return PID. + +Thu May 23 15:13:56 1996 Jeffrey A Law (law@cygnus.com) + + * h8300-tdep.c (IS_PUSH): Refine. + (IS_MOVE_FP, IS_MOV_SP_FP): Accept H8/300H varaints. + (IS_SUB4_SP, IS_SUBL_SP): New macros. + (h8300_skip_prologue): Handle H8/300H prologue code sequences. + (examine_prologue): Handle addresses from 0x010000 to 0xffffff + when in H8/300H mode. Get the return pointer's address correctly + for the H8/300H. Handle H8/300H prolouge code sequences. + + * symfile.c (generic_load): Print the starting address + of the file just loaded. + +Thu May 23 12:09:52 1996 Stan Shebs + + * mpw-make.sed: Edit @THREAD_DB_OBS@ out of makefile. + +Tue May 21 11:53:56 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * breakpoint.c (bpstat_do_actions): Avoid endless recursion + if a `source' command is contained in bs->commands. + + * infrun.c (wait_for_inferior): Update step_frame_address when + stepping into a new line. + + From schwab@issan.informatik.uni-dortmund.de (Andreas Schwab): + * breakpoint.c (breakpoint_1): Add shlib_disabled case to + bpenables array. + +Mon May 20 22:52:00 1996 Mark Alexander + + * dsrec.c (load_srec): Add WAITACK parameter, for machines + like EST visionICE that send back an ACK after each S-record. + * monitor.c (monitor_wait_srec_ack): New function. + (monitor_load): Pass monitor_wait_srec_ack to load_srec + if the monitor's MO_SREC_ACK flag is set. + * monitor.h: Define MO_SREC_ACK flag. + * remote-est.c (est_cmds): Add MO_SREC_ACK flag. + * sh3-rom.c (sh3_load): Accomodate change in load_srec prototype. + * srec.h: Add WAITACK parameter to load_srec prototype. + +Sun May 19 21:22:00 1996 Rob Savoye + + * config/sparc/sparclite.mt: Add the sparc simulator. + +Sun May 19 16:49:37 1996 Fred Fish + + * defs.h (read_command_lines, query_hook): Update prototypes. + (readline_begin_hook, readline_hook, readline_end_hook): Declare. + * breakpoint.c (commands_command): Build message in temporary buffer + and pass that, as well as tty control flag, to read_command_lines. + * top.c (readline_begin_hook, readline_hook, readline_end_hook): + Define here. + (command_loop): Check for non-NULL instream before looping. + (command_line_input): Use readline_hook when appropriate, to get + user input from a GUI window. + (read_next_line): Also build prompt if getting user input from a GUI. + (recurse_read_control_structure): Fix typo in comment. + (read_command_lines): Use passed in prompt and tty flag to decide how + to build message. Use readline_begin_hook when appropriate, to set + up a GUI interaction window. Just return head, whether NULL or not, + after using readline_end_hook to complete GUI interaction. + (define_command, document_command): Build message in a temporary + buffer and pass it to read_command_lines, along with tty flag. + + +Sat May 18 02:43:58 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * blockframe.c (frameless_look_for_prologue): + Add FUNCTION_START_OFFSET only if func_start is non-zero. + * minsyms.c (lookup_minimal_symbol_by_pc): Return NULL if + pc is not in a known section. + * stack.c (print_frame_info): Remove check for fi->pc in known + section, now handled by lookup_minimal_symbol_by_pc. + + +Fri May 17 13:31:04 1996 Stan Shebs + + * sh-stub.c: New file, was config/sh/stub.c. + + +Wed May 15 08:25:12 1996 Jeffrey A Law (law@cygnus.com) + + * top.c (read_next_line): Fix thinkos. From Donn Seeley. + + * coffread.c (coff_symtab_read): Handle C_LABEL symbols like + C_STAT symbols. + * h8300-tdep.c (h8300_pop_frame): Reset $sp and $pc correctly. + Flush cached frames just before exiting. + * remote-sim.c (gdbsim_resume): Complain if the program isn't + being run. + * config/h8300/tm-h8300.h (BELIEVE_PCC_PROMOTION): Define. + +Tue May 14 18:05:16 1996 Stu Grossman (grossman@critters.cygnus.com) + + * procfs.c (procfs_thread_alive procfs_stop): Make static. + (procfs_pid_to_str): New routine to print out thread id's in an + intelligible manner. + * sol-thread.c (sol_thread_fetch_registers): Re-order manner in + which supply_register is called to fix bug with writing + individual regs. + * config/sparc/tm-sun4sol2.h: Define default for + target_pid_to_str in case host lacks libthread_db. + +Mon May 13 23:53:30 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in config.in configure configure.in + config/sparc/nm-sun4sol2.h config/sparc/sun4sol2.mh + config/sparc/tm-sun4sol2.h: Use autoconf to config Solaris thread + and pthread support, since pre-2.5 systems don't come with + libthread_db.so.1. + + * procfs.c (info_proc): Use int instead of id_t. Old versions of + Irix don't seem to define this. + +Mon May 13 17:40:58 1996 Jeffrey A Law (law@cygnus.com) + + * top.c (execute_control_command, case while_control): Allow + a while command to be interrupted. + +Mon May 13 16:17:36 1996 Stu Grossman (grossman@critters.cygnus.com) + + * sol-thread.c: More cleanup, add comments. + (sol_thread_resume): Prevent people from trying to step + inactive threads. + (sol_thread_wait sol_thread_fetch_registers + sol_thread_store_registers): Remove unnecessary check for + sol_thread_active. These routines won't get called unless threads + are active. + +Mon May 13 11:29:37 1996 Stan Shebs + + SH3-E support from Allan Tajii : + * sh-tdep.c (sh_reg_names, sh3_reg_names): Add empty names for + float registers. + (sh3e_reg_names): New register name array. + (sh_processor_type_table): Add sh3e processor type. + * config/sh/tm-sh.h (REGISTER_VIRTUAL_TYPE): Fix test. + (REGISTER_NAMES, NUM_REGS, NUM_REALREGS, etc): Adjust for + full set of registers. + * remote-e7000.c (want_sh3, want_sh3_nopc): New globals. + (e7000_fetch_registers, e7000_wait): Use them. + * sh3-rom.c (sh3_regnames): Add float registers. + (sh3e_cmds, sh3e_ops): New globals. + (sh3e_open): New function. + (_initialize_sh3_rom): Rename from _initialize_sh3, set up + sh3e target vector. + +Fri May 10 15:53:38 1996 Stu Grossman (grossman@lisa.cygnus.com) + + * sol-thread.c: Cleanup. gcc -Wall fixes. Add prototypes. + Print out messages instead of codes for thread_db errors. Make + access macros for thread and lwp manipulation. Make cleanups to + fixup inferior_pid in case of errors. + +Thu May 9 19:06:02 1996 Fred Fish + + * aclocal.m4: Remove unused definition of AC_C_CROSS. + * configure.in: Add powerpcle-*-solaris* host and target config + so April 30th change does not get lost next time configure is + rebuilt. + +Thu May 9 14:13:08 1996 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in, breakpoint.c, corelow.c, fork-child.c, inflow.c, + infrun.c, mac-nat.c, procfs.c, remote.c, sol-thread.c, thread.c, + win32-nat.c, config/nm-lynx.h: Rename thread.h to gdbthread.h to + avoid conflict with Solaris /usr/include/thread.h. + +Thu May 9 12:33:32 1996 Rob Savoye + + * abug-rom.c: Config file for the older style ABug monitor that + runs on the mvme13x boards. + * config/m68k/monitor.mt: Add abug support for m68k cross + debugging. + +Wed May 8 20:33:24 1996 Fred Fish + + * infcmd.c (do_registers_info): Always print the raw floating + point value's bytes in big endian order, so the the leftmost bit + is the most significant. + * breakpoint.c (clear_momentary_breakpoints): Remove dead code + that is referenced nowhere else. + (set_breakpoint): Ditto. + (do_enable_breakpoint): Created from enable_once_breakpoint + with a couple of changes. + (enable_breakpoint): Call do_enable_breakpoint with an appropriate + bpdisp enum value to set disposition of breakpoint. + (enable_once_breakpoint): Ditto. + (enable_delete_breakpoint): Ditto. + * breakpoint.h (clear_momentary_breakpoints): Remove prototype. + * symtab.c (find_pc_line): Improve comments. + * xcoffread.c: Ditto. + +Tue May 7 18:37:06 1996 Stan Shebs + + * target.c (debug_to_xfer_memory): Insert line breaks when + dumping the memory block. + +Mon May 6 13:52:52 1996 Stu Grossman (grossman@critters.cygnus.com) + + * fork-child.c (fork_inferior), inferior.h: init_trace_fun now + returns a possibly modified pid. + * inftarg.c (ptrace_him): Now returns pid; + * m3-nat.c (m3_trace_him): Now returns pid; + * infcmd.c (run_command): Minor cleanup. + * infrun.c (wait_for_inferior): Add another check for one_stepped + near where we read the pc to avoid erroneously setting + random_signal for multi-threaded support. + * procfs.c: Add support for Solaris LWPs. Remove def of + LOSING_POLL. Many cleanups... Several workarounds for Solaris + lossage. System call entry and exit are now handled by + dynamically registered handlers. + * (syscallname): Don't barf when handed an unknown syscall + number. + * (info_proc_syscalls): Ditto. + * sol-thread.c: New file. Implements Solaris thread support. + * symfile.c (symbol_file_add): Add call to target_new_objfile to + notify target-dependent code about new symbol tables. + * (clear_symtab_users): Call target_new_objfile to notify it of + the removal of all symbol tables. + * target.c (push_target): Make sure that to_close is non-zero + before calling it. + * target.h (target_new_objfile): Provide default. + * config/alpha/nm-osf2.h: Define LOSING_POLL because this version + of OSF can't hack using poll with /proc. + * config/sparc/nm-sun4sol2.h (target_new_objfile): Define to be + sol-thread-new-objfile. + * config/sparc/sun4sol2.mh: Add sol-thread.o to NATDEFFILES, and + add libthread_db.so.1 to NAT_CLIBS. + * config/sparc/tm-sun4sol2.h: Define PIDGET, TIDGET, and + target_pid_to_str. + +Sat May 4 02:13:34 1996 N Srin Kumar + + * procfs.c (remove_fd): Fix copy of fds to fill hole left after + removal of the requested fd. + +Mon May 6 07:52:48 1996 Michael Meissner + + * rs6000-tdep.c (_initialize_rs6000_tdep): Don't do XCOFF specific + hooks under ELF. + + * config/powerpc/tm-ppc-eabi.h: Define ELF_OBJECT_FORMAT. + +Thu May 2 12:46:14 1996 Jeffrey A Law (law@cygnus.com) + + From Peter Schauer: + * breakpoint.h (enum bpdisp): Add del_at_next_stop. + * breakpoint.c (insert_breakpoints, watchpoint_check, + bpstat_stop_status): Avoid bad references to memory freed via + delete_breakpoint on watchpoints going out of scope. + Do not delete these watchpoints, disable them and change their + disposition to del_at_next_stop instead. + (breakpoint_auto_delete): Delete all breakpoints whose disposition + is del_at_next_stop. + (breakpoint_init_inferior): Use switch to avoid reference to + already deleted breakpoint. + +Wed May 1 17:29:18 1996 Fred Fish + + * Makefile.in (rs6000-nat.o): Depend on xcoffsolib.h. + * config/rs6000/rs6000.mh (NATDEPFILES): Move xcoffread.o ... + * config/rs6000/rs6000.mt (TDEPFILES): ... to here. + * xcoffsolib.c (xcoff_relocate_symtab_hook): Define and initialize. + (solib_info): Call xcoff_relocate_symtab via the hook. + (sharedlibrary_command): Ditto. + * xcoffread.c: Remove all FAKING_RS6000 comments and defines. + (xcoff_add_toc_to_loadinfo_hook): Define and initialize here. + (xcoff_init_loadinfo_hook): Define and initialize here. + (scan_xcoff_symtab): Call xcoff_add_toc_to_loadinfo via the hook. + (xcoff_initial_scan): Call xcoff_init_loadinfo via the hook. + * xcoffsolib.h (xcoff_relocate_symtab_hook): Declare extern func. + * rs6000-tdep.c (_initialize_rs6000_tdep): Add initializations + of xcoff_add_toc_to_loadinfo_hook and xcoff_init_loadinfo_hook. + * rs6000-nat.c (_initialize_core_rs6000): Add initialization + of xcoff_relocate_symtab_hook. + +Tue Apr 30 13:22:02 1996 Michael Meissner + + * configure (powerpcle-*-solaris*): Add Solaris support. + + * config/powerpc/{solaris.m[ht],tm-solaris.h}: New files for + Solaris support. + +Mon Apr 29 16:17:31 1996 Dawn Perchik + + * c-valprint.c (c_val_print): Fix printing for arrays defined + with 0 length. + +Sun Apr 28 15:08:05 1996 Stan Shebs + + Support for bi-endian remote breakpoints. + * remote.c (big_break_insn, little_break_insn): New globals. + (break_insn): Remove. + (remote_insert_breakpoint, remote_remove_breakpoint): Use own + code if REMOTE_BREAKPOINT defined, otherwise call memory + breakpoint functions. + * config/sh/tm-sh.h (REMOTE_BREAKPOINT): Remove. + (BIG_REMOTE_BREAKPOINT, LITTLE_REMOTE_BREAKPOINT): Define. + + * mon960-rom.c (mon960_cmds): Remove forward decl. + (mon960_load): Use current_monitor instead of mon960_cmds. + (mon960_regnames): Remove backslashes from line ends. + (_initialize_mon960): Fix documentation string. + +Sun Apr 28 12:10:35 1996 Fred Fish + + * symfile.h (psymbol_allocation_list): Expand comments which + describe the psymbol allocation list and how each field is + used. + +Sun Apr 28 03:44:30 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * breakpoint.c (delete_breakpoint): Fix bpt->val, bpt->exp + storage leaks. + (breakpoint_re_set_one): Fix b->exp, b->val, b->cond storage leaks. + + * infcmd.c (run_command), solib.c (locate_base): Check for + target_has_execution in addition to inferior_pid, a core file + from a threaded program is yielding a non-zero inferior_pid. + + * sparc-tdep.c (get_saved_register): Handle window registers + in a dummy frame correctly. + +Sat Apr 27 20:38:32 1996 Fred Fish + + * Makefile.in (CLIBS): Move $(MMALLOC) past all other libs, + so that anything that wants an allocation function not yet pulled + in, will get it from mmalloc rather than a system library. + * Makefile.in (INSTALLED_LIBS): Reorder to match order of CLIBS, + to avoid surprising results when used. + +Sat Apr 27 00:12:05 1996 Dawn Perchik (dawn@cygnus.com) + + * stabsread.c: Changes and bug fixes for cfront support. + Fix bug for class data members. + Fix parsing bug when no base classes exist. + Fix memory bug - allocate space for cplusplus specific info. + Add support for static data. + Add prototypes for static functions. + Enhance comments to show what each function expects to parse. + Cleanup code. + * stabsread.c(resolve_cont),dbxread.c(resolve_cont): Rename + function to resolve_cfront_continuation. + +Fri Apr 26 23:58:26 1996 Jeffrey A Law (law@cygnus.com) + + * infrun.c (wait_for_inferior): Call registers_changed when + restarting the inferior to get over a nullified instruction. + +Tue Apr 24 12:12:55 1996 Dawn Perchik (dawn@cygnus.com) + + * dbxread.c,stabsread.c,gdbtypes.c,partial-stab.h,valops.c: + Add new support for parsing cfront stabs. + +Wed Apr 24 00:32:55 1996 Jeffrey A Law (law@cygnus.com) + + * infrun.c (wait_for_inferior): Move "have_waited" label + outside of #ifdef conditionals. Don't trash the wait status + if we get a signal and the current instruction is nullified. + +Mon Apr 22 20:17:01 1996 Fred Fish + + * Makefile.in (VERSION): Bump version number to 4.16.1. + * NEWS: Update for 4.16 release. + +Mon Apr 22 16:32:29 1996 Stan Shebs + + * monitor.h: Clean up comment formatting. + (current_monitor): Remove decl. + (LOADTYPES, LOADPROTOS, INIT_CMD, etc): Remove definitions. + (push_monitor, SREC_SIZE): Remove. + * monitor.c: Expand old macro into current_monitor derefs + everywhere. + * remote-os9k.c (current_monitor): Remove definition. + +Mon Apr 22 14:54:45 1996 Mark Alexander + + * corefile.c (specify_exec_file_hook): Allow arbitrary number of + hooks. + (call_extra_exec_file_hooks): New function. + * h8300-tdep.c: Lint; add .h files to provide missing declarations, + remove unused variables. + (set_machine_hook): New function. + (_initialize_h8300m): Initialize it. + +Fri Apr 19 15:03:49 1996 Ian Lance Taylor + + * remote-mips.c (encoding): Don't specify size, to avoid bug in + SunOS native compiler. + +Thu Apr 18 18:46:57 1996 Stan Shebs + + * monitor.c: Use int rather than LONGEST for values, since + the formatting strings are not prepared to accept long longs. + +Wed Apr 17 20:17:27 1996 Doug Evans + + * arm-tdep.c (initialize_arm_tdep): Make apcs32 a `zinteger'. + +Tue Apr 16 17:38:23 1996 Stu Grossman (grossman@critters.cygnus.com) + + * corelow.c (add_to_thread_list): Make sure reg_sect is non-null + before de-referencing it. Prevents deref of NULL pointer if core + file lacks .reg section. + * defs.h: Rename floatformat_{to from}_long_double to + floatformat_{to from}_doublest. Get rid of FLOATFORMAT_{TO + FROM}... macros. + * findvar.c (extract_floating store_floating): Change all refs to + FLOATFORMAT_{FROM TO}... to floatformat_{from to}_doublest. + * utils.c: Change floatformat_{to from}_long_double to + floatformat_{to from}_doublest cuz the new routines will use + whatever size (double or long double) is appropriate. + * config/i960/tm-i960.h (REGISTER_CONVERT_TO_VIRTUAL + REGISTER_CONVERT_TO_RAW): Change FLOATFORMAT... macros to + floatformat... routine calls. + +Mon Apr 15 16:34:11 1996 Per Bothner + + * stabsread.c (read_type): Move handling of '@' from type + number handling to handling of types proper (as emitted by gcc!). + For typedefs, allocate the typedef type before reading its + definition, to properly handling recursive types. + +Mon Apr 15 11:19:26 1996 Jeffrey A Law (law@cygnus.com) + + * ch-exp.c (calculate_array_length): Fix prototype. + +Sat Apr 13 14:21:16 1996 Stu Grossman (grossman@critters.cygnus.com) + + * remote-nindy.c (nindy_open): Acquire more target state so that + user can attach to a previously running program. + * (nindy_fetch_registers nindy_store_registers): Get rid of fp + conversion code. That's all handled in {extract store}_floating + now. + * utils.c (floatformat_to_double): Don't bias exponent when + handling zero's, denorms or NaNs. + * config/i960/tm-i960.h (REGISTER_CONVERT_TO_VIRTUAL + REGISTER_CONVERT_TO_RAW): Change to using DOUBLST and + FLOATFORMAT_TO/FROM_DOUBLEST macros. + * config/i960/tm-nindy960.h: Undefine + REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW, and + REGISTER_CONVERTIBLE. These are no longer necessary now that all + the magic happens in extract/store_floating. + +Sat Apr 13 02:58:02 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * eval.c (evaluate_subexp_standard): Report error when attempting to + evaluate subscripts for types which cannot be subscripted. + + * valarith.c (value_x_binop, value_x_unop): Add noside parameter. + Return a zero value with the return type of the member function + if noside is EVAL_AVOID_SIDE_EFFECTS instead of calling the member + function. + * values.h (value_x_binop, value_x_unop): Update prototypes + accordingly. + * eval.c (evaluate_subexp_standard): Update all callers of + value_x_binop, value_x_unop accordingly. + + * valarith.c (value_neg, value_complement): Perform ANSI C/C++ + integral promotion on operands. + +Fri Apr 12 13:19:27 1996 Fred Fish + + * README: Update for 4.16 release. + * configure.in (AC_CHECK_FUNCS): Also check for sbrk. + * configure: Regenerate with autoconf. + * config.in: Regenerate with autoheader. + * main.c (main): Only use sbrk() when HAVE_SBRK is defined. + * top.c (command_loop): Ditto. + +Fri Apr 12 09:45:29 1996 Stu Grossman (grossman@critters.cygnus.com) + + * defs.h: Define TARGET_{FLOAT DOUBLE LONG_DOUBLE}_FORMAT + defaults for bi-endian targets. Replace function pointers for + floatformat routines with macros. No need for these to be runtime + selectable. + * findvar.c: Get rid of floatformat function pointers. Use + macros in extract_floating and store_floating. + * remote-nindy.c (nindy_fetch_registers nindy_store_registers): + Use floatformat macros. + +Thu Apr 11 21:28:02 1996 Fred Fish + + From: Miles Bader + * configure.in (AC_CHECK_HEADERS): check for endian.h. + Use AC_CHECK_TOOL to find AR & RANLIB. Add AC_PROG_AWK. + Add host & target cases for i[345]86-*-gnu*. + * config.in: Regenerate with autoheader. + * configure: Regenerate with autoconf. + * Makefile.in (AR, AWK): Set from corresponding autoconf substs. + (init.c): Don't scan mig-generated files. + * defs.h (endian.h): Include if HAVE_ENDIAN_H defined. + * config/nm-m3.h (ATTACH_NO_WAIT): Define. + * infcmd.c (attach_command): Use "#ifndef ATTACH_NO_WAIT" + rather than "#ifndef MACH". + +Thu Apr 11 18:49:42 1996 Stan Shebs + + * remote.c (remotewritesize): New GDB variable, controls size + of memory packets sent to the target. + +Thu Apr 11 13:47:52 1996 Stu Grossman (grossman@critters.cygnus.com) + + * dcache.c: Add prototypes. Make many functions static. + * (dcache_peek dcache_fetch dcache_poke): Make dcache_fetch and + dcache_poke call dcache_xfer_memory directly in order to fix + problems with turning off dcache. dcache_peek is now unnecessary, + so it goes away. + + * defs.h: Define new macros HOST_{FLOAT DOUBLE LONG_DOUBLE}_FORMAT + and TARGET_{FLOAT DOUBLE LONG_DOUBLE}_FORMAT to specify a pointer + to a struct floatformat. This allows for better handling of + targets whose floating point formats differ from the host by more + than just byte order. + * (floatformat_to_long_double floatformat_from_long_double): + Prototypes for new functions in utils.c. + * (floatformat_to_doublest floatformat_from_doublest): Prototypes + for pointers to floating point conversion functions. The actual + function uses either double or long double if the host supports it. + * findvar.c (floatformat_to_doublest floatformat_from_doublest): + Initialize to point at correct function depending on HAVE_LONG_DOUBLE. + * (extract_floating store_floating): Rewrite. Now, if host fp + format is the same as the target, we just do a copy. Otherwise, + we call floatformat_{to from}_doublest. + * remote-nindy.c (nindy_xfer_inferior_memory): Change param + `write' to `should_write'. + * utils.c (floatformat_to_long_double + floatformat_from_long_double): New routines that implement long + double versions of functions in libiberty/floatformat.c. + * config/i960/tm-i960.h (TARGET_LONG_DOUBLE_FORMAT): Define this for + i960 extended real (80 bit) numbers. + * nindy-share/nindy.c (ninMemGet ninMemPut): Return number of bytes + actually read or written. + +Wed Apr 10 02:56:06 1996 Wilfried Moser + + * ch-valprint.c (chill_val_print): Remove call to calculate_array_length. + (calculate_array_length): Move function from here ... + + * ch-exp.c (calculate_array_length): ... to here. + (parse_primval): If we have a symbol with an array type + and the length is 0, call calculate_array_length. + +Tue Apr 9 01:23:05 1996 Wilfried Moser + + * eval.c (evaluate_subexp_standard): In case of TYPE_CODE_SET: + Add some checks for powerset compatibility. + + * valops.c (value_slice): Use lowbound instead of lowerbound for + call to slice_range_type to get correct bounds. + +Mon Apr 8 12:53:56 1996 Fred Fish + + * Makefile.in (scm-exp.o, scm-lang.o, scm-valprint.o): Add targets and + dependencies. + * scm-lang.c (gdb_string.h): Include. + * objfiles.c (add_to_objfile_sections): Cast second arg of obstack_grow + call to correct type (char *). + * cp-valprint.c (cp_print_static_field): Ditto. + * somsolib.c (som_solib_create_inferior_hook): Add a declaration + for external find_unwind_entry function (from hppa-tdep.c). + * remote-pa.c (remote_write_bytes, remote_read_bytes): Change + type of second arg to "char *" to be type compatible with + dcache. + (remote_wait): Cast second arg to strtol to correct type. + * hppa-tdep.c (compare_unwind_entries): Change argument types to + "const void *" to be type compatible with qsort, and then + assign to local args prior to use. + +Mon Apr 8 15:35:52 1996 Jeffrey A Law (law@cygnus.com) + + * infptrace.c (kill_inferior): Remove call to "kill"; update + comments. + +Mon Apr 8 14:05:07 1996 Geoffrey Noer + + * remote-e7000.c: don't append :23 to target port if __WIN32__ + is defined (it's WinGDB). + +Sun Apr 7 22:34:29 1996 Fred Fish + + From: Miles Bader + * gnu-nat.c, gnu-nat.h, msg.defs, exc_request.defs, i386gnu-nat.c, + msg_reply.defs, notify.defs, process_reply.defs, reply_mig_hack.awk, + config/nm-gnu.h, config/i386/{i386gnu.mh, i386gnu.mt, nm-gnu.h, + m-i386gnu.h, xm-i386gnu.h}: New files for GNU hurd. + +Sun Apr 7 13:32:41 1996 Fred Fish + + * configure.in (case host): Add i386sco5 host. + * configure: Regenerate. + + From: Robert Lipe + Add support for SCO OpenServer 5 (a.k.a. 3.2v5*) This + target is an SVR3.2 with COFF, ELF, and shared libes, but + no /proc. + * config/i386/i386sco5.mh: New file. + * config/i386/nm-i386sco5.h: New file. + +Sat Apr 6 08:55:22 1996 Fred Fish + + * bcache.c (bcache): When size of chunk to cache is exactly equal to + BCACHE_MAXLENGTH, stash chunk as unique copy. + +Sat Apr 6 00:46:26 1996 Fred Fish + + * symfile.c (INLINE_ADD_PSYMBOL): Remove ifdef. + (add_psymbol_to_list): Add an arg for passing CORE_ADDR values and + use it, rather than calling add_psymbol_addr_to_list. + (add_psymbol_addr_to_list): Delete. + (add_psymbol_to_list): Make psymbol static to avoid random data in + gaps due to alignment of structure members. + * symfile.h (INLINE_ADD_PSYMBOL, ADD_PSYMBOL_TO_LIST, + ADD_PSYMBOL_ADDR_TO_LIST): Remove. Real world tests show no + performance improvements by inlining via complicated macros and + they just make gdb larger and harder to maintain. + * dwarfread.c (add_enum_psymbol): Replace ADD_PSYMBOL_TO_LIST + and/or ADD_PSYMBOL_ADDR_TO_LIST macro(s) with call to + add_psymbol_to_list with appropriate long or CORE_ADDR args. + (add_partial_symbol): Ditto. + * partial-stab.h: Ditto. + * os9kread.c (read_os9k_psymtab): Ditto + * mdebugread.c (parse_partial_symbols): Ditto. + (handle_psymbol_enumerators): Ditto. + (demangle.h): Include. + * hpread.c (hpread_build_psymtabs): Ditto. + (hpread_build_psymtabs): Ditto. + (demangle.h): Include + +Thu Apr 4 20:16:55 1996 Fred Fish + + * configure.in: Check for setpgid function. + * config.in: Regenerate with autoheader. + * configure: Regenerate with autoconf. + * inflow.c (_initialize_inflow): Only try to use _SC_JOB_CONTROL + if it is actually defined. + (gdb_setpgid): Use HAVE_SETPGID. + * ch-exp.c: Change include of to "gdb_string.h". + * c-exp.y, f-exp.y, m2-exp.y: Ditto. + * c-exp.y, serial.c: Include . + * config/m68k/nm-news.h: Add typedef for pid_t which is + apparently missing from . Enclose entire + file in NM_NEWS_H ifndef and define when included. + * config/mips/nm-news-mips.h: Ditto. + * config/m68k/tm-m68k.h (REGISTER_CONVERT_TO_VIRTUAL, + REGISTER_CONVERT_TO_RAW): Change name of temporary variable. + +Thu Apr 4 19:04:18 1996 Stan Shebs + + * arm-xdep.c: Move native-specific code to here from arm-tdep.c. + * arm-tdep.c (arm_apcs_32): New global. + (arm_addr_bits_remove, arm_saved_pc_after_call, + arm_push_dummy_frame, arm_pop_frame): New functions. + (arm_skip_prologue): Updated version from Richard Earnshaw. + (_initialize_arm_tdep): Add set/show "apcs32". + * config/arm/tm-arm.h (ADDR_BITS_REMOVE): Call + arm_addr_bits_remove. + (SAVED_PC_AFTER_CALL): Call arm_saved_pc_after_call. + (frame_find_saved_regs): Declare properly. + (PUSH_DUMMY_FRAME): Call arm_push_dummy_frame. + (POP_FRAME): Call arm_pop_frame, use ADDR_BITS_REMOVE instead of + explicit mask. + * config/arm/nm-arm.h: New file. + * config/arm/xm-arm.h (KERNEL_U_ADDR, FETCH_INFERIOR_REGISTERS): + Move definitions to nm-arm.h. + * config/arm/arm.mh (NAT_FILE): Define. + + * symfile.c (generic_load): Initialize data_count properly. + +Thu Apr 4 17:17:53 1996 Fred Fish + + * symmisc.c (print_objfile_statistics): Print memory used by + psymbol cache obstack. + +Thu Apr 4 15:43:07 1996 Stan Shebs + + * symfile.c (report_transfer_performance): New function. + (generic_load): Call it to report transfer rate. + * remote-e7000.c (e7000_load): Ditto. + +Mon Apr 1 16:31:00 1996 Stan Shebs + + * mpw-make.sed: Change references to config.h to be in objdir, + edit out rules to rebuild config.h. + +Mon Apr 1 08:32:23 1996 Fred Fish + + * hppa-tdep.c (hppa_pop_frame): Call clear_proceed_status before + proceeding. + +Sun Mar 31 16:15:43 1996 Fred Fish + + * hppah-nat.c (store_inferior_registers, store_inferior_registers, + fetch_register, child_xfer_memory): Use call_ptrace function supplied + by infptrace.c rather than calling ptrace directly. + +Sun Mar 31 15:39:00 1996 Stan Shebs + + * mon960-rom.c: Cleanups and elimination of unused code, + clarify documentation string. + (mon960_serial, mon960_ttyname): Remove. + * config/i960/tm-mon960.h (ADDITIONAL_OPTIONS, + ADDITIONAL_OPTION_CASES, ADDITIONAL_OPTION_HELP): Remove. + +Sat Mar 30 11:00:22 1996 Fred Fish + + * configure.in: Check whether printf family supports printing + long doubles or not and define PRINTF_HAS_LONG_DOUBLE if so. + * acconfig.h: Provide default undef for PRINTF_HAS_LONG_DOUBLE. + * configure: Regenerate. + * valprint.c (print_floating): Use PRINTF_HAS_LONG_DOUBLE. + * c-exp.y (parse_number): Use PRINTF_HAS_LONG_DOUBLE. + * configure.in: Fix have_gregset and have_fpregset autoconf + variable names so that they match the pattern required to + cache them. + +Fri Mar 29 21:39:56 1996 Fred Fish + + * core-aout.c (fetch_core_registers): Cast core_reg_size to int + before testing against reg_ptr. + * eval.c (evaluate_subexp_standard): Cast type of + TYPE_FN_FIELD_VOFFSET to int. + * findvar.c (extract_signed_integer, extract_unsigned_integer, + extract_long_unsigned_integer): Cast type of sizeof to int. + * values.c (unpack_field_as_long, modify_field): Ditto. + * valops.c (value_assign, call_function_by_hand): Ditto. + * infcmd.c (do_registers_info): Ditto. + * ser-tcp.c (tcp_open): Ditto. + * remote.c (putpkt): Ditto. + * dcache.c (dcache_peek): Ditto. + * dcache.c (dcache_poke): Ditto. + * m2-exp.y (yylex): Ditto. + * gnu-regex.c (re_match_2): Ditto. + * f-lang.c (ADD_BF_SYMNUM, saved_bf_list_end, tmp_bf_ptr): Ifdef + out unused macro definition and variables. + * inftarg.c (proc_wait): Move from main.c to here, and make static. + * valprint.c (val_print_string): Change bufsize from int to unsigned. + * main.c (wait.h): Include. + * top.c (command_line_input): Remove unused variable "c". + * f-typeprint.c (f_type_print_varspec_prefix): Add missing enum + value TYPE_CODE_TYPEDEF to switch statement. + (f_type_print_varspec_suffix): Add missing enum value + TYPE_CODE_TYPEDEF to switch statement. + * ch-exp.c (parse_primval): Add remaining enumeration values to + switch statement, with no specific action. + (ch_lex): Add LOC_UNRESOLVED in switch statement. + (pushback_token): Ifdef out, since code using it is ifdef'd out. + * stabsread.c (cleanup_undefined_types): Remove unused label + "badtype". + * objfiles.h (print_symbol_bcache_statistics): Add prototype. + * maint.c (objfiles.h): Include. + (maintenance_print_statistics): Remove unused variable "temp". + * minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove + unused variable "found_file_symbol". + * m2-exp.y (yylex): Add LOC_UNRESOLVED case to switch. + * language.c (lang_bool_type): Use existing function local type + variable rather than create block local variables. + * solib.c (disable_break): Enclose in ifndef SVR4_SHARED_LIBS. + * infptrace.c (wait.h, command.h): Include. + * ser-tcp.c (gdb_string.h): Include + * i386-tdep.c (codestream_seek): Change "place" to CORE_ADDR. + (i386_get_frame_setup): Change "pc" from int to CORE_ADDR. + * command.c (complete_on_enum): Make assignment used as truth value + explictly check against NULL. + (wait.h): Include. + * infrun.c (wait_for_inferior): Ifdef out prologue_pc since code + that uses it is ifdef'd out. + * parser-defs.h: Add prototype for write_dollar_variable. + * infrun.c: Add prototype for write_pc_pid. + * breakpoint.h: Add prototype for re_enable_breakpoints_in_shlibs. + * symmisc.c (bcache.h): Include. + * bcache.h: Add prototype for print_bcache_statistics. + * symfile.c: Include . + * printcmd.c (print_scalar_formatted): Change len to unsigned int. + * valarith.c (value_equal): Cast result of TYPE_LENGTH to int. + * valarith.c (value_binop): Change result_len, promoted_len1, + and promoted_len2 to unsigned int. + * valarith.c (value_subscripted_rvalue): Change elt_offs and + elt_size to unsigned int. + * valops.c (value_array): Change typelength to unsigned int. + (destructor_name_p): Change len to unsigned int. + * scm-lang.h (scm_parse): Add prototype for scm_unpack. + * symfile.c (decrement_reading_symtab): Change return type to void. + * valarith.c (value_subscript): Remove unused variable "word". + (value_subscript): Remove unused variable "tint". + * valops.c (auto_abandon): Ifdef out, since code using it is also + ifdef'd out. + * eval.c (init_array_element): Remove unused variable "val". + * Makefile.in (values.o): Depends on scm-lang.h. + (command.o): Depends upon wait_h. + (ser-tcp.o): Depends upon gdb_string.h. + (infptrace.o): Depends upon wait_h and command_h. + (maint.o): Depends on objfiles.h and symfile.h. + * values.c (allocate_repeat_value): Remove unused variable + "element_type". + (scm-lang.h): Include. + * breakpoint.c (create_longjmp_breakpoint): Enclose in + GET_LONGJMP_TARGET define, unused otherwise. + * config/i386/nm-linux.h: Add prototypes for i386_insert_watchpoint, + i386_remove_watchpoint and i386_stopped_by_watchpoint. + +Thu Mar 28 12:53:19 1996 Doug Evans + + * configure.in (sparc64-*-solaris2*): Delete. + Stick with sparc-*-solaris2*. + * configure: Regenerated. + +Thu Mar 28 06:51:26 1996 Fred Fish + + * valops.c (value_assign): Make copy of internal variable value + before returning it as a new value, since it is owned by the + internal variable and will be freed along with it. + +Wed Mar 27 08:36:17 1996 Jeffrey A Law (law@cygnus.com) + + * From Peter Schauer. + * breakpoint.c (breakpoint_re_set_one): Keep temporary + breakpoints bp_until, bp_finish, bp_watchpoint_cope, bp_call_dummy + and bp_step_resume in case breakpoint_re_set_one is called due + to a step over a dlopen call. + * infrun.c (wait_for_inferior): Always remove breakpoints from + inferior in BPSTAT_WHAT_CHECK_SHLIBS case. + +Tue Mar 26 13:15:32 1996 Fred Fish + + * config/mips/tm-mips.h (COERCE_FLOAT_TO_DOUBLE): Only prefer + non-prototyped case over prototyped case for C. + * config/pa/tm-hppa.h (COERCE_FLOAT_TO_DOUBLE): Ditto. + +Sat Mar 23 17:24:28 1996 Fred Fish + + * os9kread.c (os9k_process_one_symbol): Note nonportable + assumption that an int can hold a char *. + + * bcache.h (struct hashlink): Wrap data[] inside union with + double to force longest alignment. + (BCACHE_DATA): New macro to access data[]. + (BCACHE_ALIGNMENT): New macro to get offset to data[]. + * bcache.c (lookup_cache, bcache): Use BCACHE_DATA to get + address of cached data. Use BCACHE_ALIGNMENT to compute + amount of space to allocate for each hashlink struct. + +Sat Mar 23 12:14:02 1996 Fred Fish + + * ch-lang.c (evaluate_subexp_chill): Fix typo. + +Thu Mar 21 08:27:19 1996 Fred Fish + + * Makefile.in (VERSION): Bump version to 4.15.3 + +Thu Mar 21 10:56:41 1996 Ian Lance Taylor + + * config.in: Rename from config.h.in. + * configure.in: Call AC_CONFIG_HEADER with config.h:config.in. + Change CONFIG_HEADERS test in AC_OUTPUT accordingly. + * configure: Rebuild. + * Makefile.in (stamp-h): Depend upon config.in, not config.h.in. + Set CONFIG_HEADERS to config.h:config.in. + +Tue Mar 19 12:47:51 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * partial-stab.h (case N_ENDM): Finish current partial symbol + table for Solaris 2 cc. + +Tue Mar 19 10:39:15 1996 Jeffrey A Law (law@cygnus.com) + + * rs6000-nat.c (exec_one_dummy_insn): Don't clobber the + PC in the registers array. From Peter Schauer. + +Mon Mar 18 13:47:09 1996 Fred Fish + + * symfile.c (reread_symbols): Reinitialize bcache struct + members to zero using memset. Also use memset to reinit + global_psymbols and static_psymbols, rather than explicitly + resetting each structure member. + +Sat Mar 16 19:47:36 1996 Fred Fish + + * configure.in: Add fragment to create stamp-h. + + From Peter Schauer + * configure.in (AC_CHECK_HEADERS): Check for link.h. + * configure: Regenerate with autoconf. + * config.h.in: Regenerate with autoheader. + * config/i386/nm-linux.h: Include solib.h only if HAVE_LINK_H + is defined. + * solib.c: Exclude most of the code if HAVE_LINK_H is not defined. + * config/i386/linux.mh: Reinstate XM_CLIBS, it is needed for + older a.out based systems. + +Sat Mar 16 16:45:43 1996 Fred Fish + + * config.h.in: New file. + * acconfig.h: New file, for autoheader. + * configure.in (AC_CONFIG_HEADER): Add, generate config.h. + * configure: Regenerate. + * Makefile.in (defs_h): Add config.h + (distclean): Remove config.h and stamp-h during distclean. + (config.h, stamp-h): New targets to remake config.h when necessary. + * defs.h (config.h): Include before any other includes or defines. + * i386-tdep.c (gdb_string.h): Move include after include of defs.h. + * i386v4-nat.c (defs.h): Include before testing HAVE_SYS_PROCFS_H. + +Sat Mar 16 14:55:27 1996 Fred Fish + + From Peter Schauer + * Makefile.in (INSTALLED_LIBS): Make sure that @LIBS@ will not + result in an empty line, to work around a bug in native Ultrix 4.4 + and OSF/1-3.2C make. + +Sat Mar 16 13:33:17 1996 Fred Fish + + * configure.in: Add gdbserver to configdirs under linux. + * configure: Regenerate. + +Fri Mar 15 12:06:58 1996 J.T. Conklin + + * config/i386/nm-nbsd.h (FLOAT_INFO): Comment out. + * config/i386/tm-nbsd.h (NUM_REGS): Define. + +Thu Mar 14 10:31:18 1996 Jeffrey A Law (law@cygnus.com) + + * solib.c (solib_break_names): Add _r_debug_state for + vanilla SVR4 implementations. From Peter Schauer. + +Mon Mar 11 14:24:57 1996 Dawn Perchik + + * mon960-rom.c: New file; support mon960 rom monitor on i960. + * monitor.c (monitor_debug): Change remotedebug to buffer strings. + * monitor.c (monitor_open): Add test for flag MO_NO_ECHO_ON_OPEN before + epecting prompt and echo during open. + * monitor.c (monitor_stop): Add test for flag MO_SEND_BREAK_ON_OPEN to + determine if break should be sent as stop command. + * monitor.h: Add flags MO_NO_ECHO_ON_OPEN and MO_SEND_BREAK_ON_OPEN. + * i960-tdep.c (mon960_frame_chain_valid): New function for getting + stack frame on mon960. + * Makefile.in: Add mon960 files. + * configure.in: Changed i960-*-coff* and i960-*-elf* to target mon960; + added i960-nindy-coff* and i960-nindy-elf* for target nindy. + * configure: Regenerated. + * config/i960/mon960.mt, config/i960/tm-mon960.h: New files; + support mon960 rom monitor on i960. + +Mon Mar 11 11:02:47 1996 Steve Chamberlain + + With Michael Snyder: + * i386-tdep.c (skip_trampoline_code): Fix strncmp length. + * win32-nat.c (CHECK, DEBUG*, debug_*): New. + (handle_load_dll): Don't reload symbols. + (handle_exception): Use the DEBUG_* names. + (child_wait): Add DEBUG_* code. + (_initialize_inftarg): Add new commands to set debug_ names. + +Mon Mar 11 09:19:58 1996 Jeffrey A Law (law@cygnus.com) + + * From Peter Schauer: + * breakpoint.c (insert_breakpoints): Use ALL_BREAKPOINTS_SAFE. + (bpstat_stop_status): Likewise. + (remove_solib_event_breakpoints): Likewise. + (clear_momentary_breakpoints): Likewise. + (re_enable_breakpoints_in_shlibs): Don't reenable a breakpoint + if we still can't read the memory for that breakpoint. + (mention): Add bp_shlib_event case to keep gcc quiet. + +Fri Mar 8 12:08:12 1996 Jeffrey A Law (law@cygnus.com) + + * breakpoint.h (enum enable): New enum shlib_disabled for + shared library breakpoints that have been temporarily disabled. + * breakpoint.c: Handle temporarily disabled shared library + breakpoints like disabled breakpoints in most places. + (insert_breakpoints): Use shlib_disabled to indicate + that an unsettable breakpoint is only temporarily disabled. + (re_enable_breakpoints_in_shlibs): New function. + * corelow.c (solib_add_stub): After adding shared libraries, + try to reenable any temporarily disabled breakpoints. + * infcmd.c (attach_command): Likewise. + * infrun.c (wait_for_inferior): Likewise. + +Fri Mar 8 11:41:25 1996 Ian Lance Taylor + + * defs.h (extract_long_unsigned_integer): Declare. + * findvar.c (extract_long_unsigned_integer): New function. + * printcmd.c (print_scalar_formatted): Use it. + * valprint.c (val_print_type_code_int): Likewise. + +Thu Mar 7 17:40:50 1996 Stan Shebs + + * infcmd.c (do_registers_info): Ignore anonymous registers. + * sh-tdep.c (set processor): New command to set specific + processor type. + (sh_reg_names, sh3_reg_names): Arrays of register names for + SH and SH3 processors. + (sh_set_processor_type): New function. + * sh3-rom.c (sh3_open): Call it. + (sh3_regname): Add names of all the bank registers. + (sh3_supply_register): Clean up formatting. + * config/sh/tm-sh.h (NUM_REGS, NUM_REALREGS): Increase to include + bank registers. + (REGISTER_NAMES): Add names of bank registers. + (FP15_REGNUM): Define. + (REGISTER_VIRTUAL_TYPE): Use it. + * monitor.c: Clean up some comments. + +Thu Mar 7 12:09:51 1996 J.T. Conklin + + * i386b-nat.c: Revert part of Mar 5 change. FreeBSD collapsed the + s* and t* symbols too. + +Thu Mar 7 15:18:51 1996 James G. Smith + + * symfile.c (generic_load): Avoid division by zero. + +Wed Mar 6 17:57:59 1996 Jeffrey A Law (law@cygnus.com) + + * breakpoint.c (bfd_lookup_symbol): Provide for all SVR4 systems, + not just those with HANDLE_SVR4_EXEC_EMULATORS. + + From Peter Schauer: + * breakpoint.c (internal_breakpoint_number): Move to file scope. + (create_solib_event_breakpoint): Use an internal breakpoint number. + +Wed Mar 6 00:32:44 1996 Wilfried Moser + + * valarith.c (value_in): Change builtin_type_chill_bool to + LA_BOOL_TYPE. + +Tue Mar 5 23:48:36 1996 Wilfried Moser + + * ch-exp.c (parse_primval): Handle CARD, MAX, MIN. + (match_string_literal): Handle control sequence. + (match_character_literal): Deto. + + * ch-lang.c (chill_printchar): Change formating of nonprintable + characters from C'xx' to ^(num). + (chill_printstr): Deto. + (value_chill_card, value_chill_max_min): New functions to process + Chill's CARD, MAX, MIN. + (evaluate_subexp_chill): Process UNOP_CARD, UNOP_CHMAX, UNOP_CHMIN. + + * expression.h (exp_opcode): Add UNOP_CARD, UNOP_CHMAX, UNOP_CHMIN + for Chill's CARD, MAX, MIN. + + * valarith.c (value_in): Add processing of TYPE_CODE_RANGE + and change return type from builtin_type_int to + builtin_type_chill_bool. + +Tue Mar 5 18:54:04 1996 Stan Shebs + + * config/nm-nbsd.h (link_object, lo_name, etc): Move to here + from config/nm-nbsd.h. + * config/sparc/nm-nbsd.h (regs, fp_status, etc): Move to here + from config/sparc/tm-nbsd.h. + + * config/m68k/nm-hp300hpux.h (FIVE_ARG_PTRACE): Define here + instead of in config/m68k/xm-hp300hpux.h. + +Tue Mar 5 12:05:35 1996 J.T. Conklin + + * i386b-nat.c, m68knbsd-nat.c (fetch_core_registers): Provide + implementation for NetBSD systems. + +Mon Mar 4 23:44:16 1996 Per Bothner + + * valarith.c (binop_user_defined_p): Return 0 for BINOP_CONCAT. + (value_concat): Handle varying strings (add COERCE_VARYING_ARRAY). + + * ch-lang.c (evaluate_subexp_chill case MULTI_SUBSCRIPT): Error + if "function" is pointer to non-function. + +Mon Mar 4 17:47:03 1996 Stan Shebs + + * top.c (print_gdb_version): Update copyright year. + +Mon Mar 4 14:44:54 1996 Jeffrey A Law (law@cygnus.com) + + From Peter Schauer: + * infrun.c (wait_for_inferior): Remove breakpoints and + switch terminal settings before calling SOLIB_ADD. + * solib.c (enable_break, SVR4 variant): Don't map in symbols + for the dynamic linker, the namespace pollution causes real + problems. + +Sun Mar 3 17:18:57 1996 James G. Smith + + * remote-mips.c (common_breakpoint): Explicitly terminate the + returned buffer. + +Wed Feb 28 22:32:18 1996 Stan Shebs + + From Wilfried Moser : + * remote.c (remote_detach): Send a command 'D' to the target + when detaching, update the function's comments. + +Thu Jun 6 16:11:38 1996 Miles Bader + + * gnu-nat.c (thread_cmd_list): New declaration. + (parse_int_arg): New function. + +Wed Jun 5 17:28:04 1996 Miles Bader + + * gnu-nat.h (struct proc): Add DETACH_SC field. + * gnu-nat.c (make_proc): Set DETACH_SC. + (struct inf): Add DETACH_SC & DEFAULT_THREAD_DETACH_SC fields. + (make_inf): Set DETACH_SC & DEFAULT_THREAD_DETACH_SC fields. + (add_thread_commands): Add set/show for detach-suspend-count. + Add takeover-suspend-count cmd. + (inf_detach): Set suspend counts to the detach SC, not 0. + (set_thread_detach_sc_cmd, show_thread_detach_sc_cmd, + set_task_detach_sc_cmd, show_task_detach_sc_cmd, + set_thread_default_thread_detach_sc_cmd, + show_thread_default_thread_detach_sc_cmd): New functions. + (show_task_cmd): Also show detach-suspend-count values. + (thread_takeover_sc_cmd): New function. + +Fri May 31 16:49:24 1996 Miles Bader + + * gnu-nat.c (show_thread_run_cmd): Actually print state. + +Thu May 30 10:47:56 1996 Miles Bader + + * gnu-nat.c (inf_signal): Make unforwardable exceptions an error. + +Tue May 28 17:06:36 1996 Miles Bader + + * gnu-nat.c (inf_validate_stopped): proc_getprocinfo takes a + pointer to the flags now, not the flags themselves. + +Mon May 27 13:31:17 1996 Miles Bader + + * gnu-nat.c (gnu_wait): Print debugging msgs for pending execs. + (gnu_create_inferior): Check return from ptrace. + +Sun May 26 16:56:35 1996 Miles Bader + + * gnu-nat.h (struct proc): Add DEAD field. + * gnu-nat.c (make_proc): Initialize DEAD. + (inf_set_traced, inf_validate_task_sc, inf_validate_procs: Frob it. + (gnu_wait): Only abort for 0 threads if the task isn't dead. + +Sat May 25 17:06:05 1996 Miles Bader + + * gnu-nat.c (inf_signal): Pass SIGCODE when posting a signal. + +Wed May 22 18:44:28 1996 Miles Bader + + * gnu-nat.c (S_proc_wait_reply): Add SIGCODE argument. + (inf_set_traced): Only give no-signal-thread error message if + turning *on* tracing. + +Wed May 15 13:03:16 1996 Miles Bader + + * gnu-nat.c (inf_validate_procs): If INF has no threads, always + set inf->threads_up_to_date to 0. + (inf_signal): Pass in new SIGCODE argument to msg_sig_post_untraced. + (gnu_wait): Pass in new TIMEOUT arg to interrupt_operation. + (proc_update_sc): Cast thread state arg to thread_set_state. + (proc_get_state): Cast thread state arg to thread_get_state. + (inf_validate_task_sc): Cast task_basic_info arg to task_info. + * i386gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Call + inf_update_procs before we lookup the thread. + * config/i386/i386gnu.mh (MH_CFLAGS): New variable. + +Tue May 7 17:52:33 1996 Miles Bader + + * gnu-nat.c (gnu_kill_inferior): Use inf_set_task to clear the task. + +Mon May 6 19:06:49 1996 Miles Bader + + * gnu-nat.c (inf_set_traced): Use msg_set_init_int with + INIT_TRACEMASK instead of setting the exec flags. + +Fri May 3 19:10:57 1996 Miles Bader + + * gnu-nat.c (inf_validate_procs): Don't clear INF->task if we find + the task's died, so others have a chance at it. + (gnu_resume): When single-stepping a single thread, given an error + if there is no such thread. When single-stepping one but running + the others, just given a warning and still run all the threads. + (gnu_wait): If there seem to be no threads, look harder, and + signal an error if there really aren't any. + (gnu_attach): Reset thread numbering to 0. + + * i386gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Give + thread name in warning messages. + + * gnu-nat.c (active_inf): New function. + (show_sig_thread_cmd, show_stopped_cmd): Use it. + (info_port_rights, info_send_rights_cmd, info_port_sets_cmd, + info_recv_rights_cmd, info_port_rights_cmd, info_port_rights_cmd): + New functions. + (add_task_commands): Add new port-right info commands. + +Fri Apr 26 20:42:16 1996 Miles Bader + + * gnu-nat.c (gnu_wait): Instead of _hurd_intr_rpc_mach_msg, just + use mach_msg with MACH_RCV_INTERRUPT. + (set_noninvasive_cmd): New function. + (add_task_commands): Add command entry for `set noninvasive'. + +Mon Mar 4 14:12:02 1996 Miles Bader + + * gnu-nat.c (gnu_read_inferior): Use hurd_safe_memmove, not safe_bcopy. + (safe_bcopy): Function removed. + +Mon Dec 4 14:18:26 1995 Miles Bader + + * gnu-nat.c (proc_update_sc): Assert only threads can have state. + (make_proc): Initialize state_valid & state_changed fields. + +Tue Nov 28 17:51:21 1995 Miles Bader + + * reply_mig_hack.awk: New file. + +Tue Nov 14 14:31:03 1995 Miles Bader + + * breakpoint.c (breakpoint_1): Print breakpoint thread field. + + * lynx-nat.c (child_wait): Return TARGET_WAITKIND_SPURIOUS for new + threads. + +Mon Nov 13 18:30:53 1995 Miles Bader + + * target.c (debug_to_check_threads): New function. + + * inflow.c (terminal_init_inferior_with_pgrp): New function. + (terminal_init_inferior): Call terminal_init_inferior_with_pgrp. + * inferior.h (terminal_init_inferior_with_pgrp): New declaration, + but only if PROCESS_GROUP_TYPE is defined. + +Mon Nov 6 16:42:09 1995 Miles Bader + + * target.c (debug_to_thread_alive): Pass through the return value. + +Thu Nov 2 18:05:00 1995 Miles Bader + + * target.c (signals, target_signal_from_host, target_signal_to_host): + Add mach exceptions. + * target.h (enum target_signal): Add mach exceptions. + +Mon Oct 30 16:41:04 1995 Miles Bader + + * gnu-nat.c: New file: gnu native backend. + * i386gnu-nat.c: New file: i386-specific part of gnu native backend. + * gnu-nat.h: New file. + * config/nm-gnu.h: New file. + * config/tm-i386gnu.h: New file. + * config/xm-i386gnu.h: New file. + * config/i386/i386gnu.mh: New file. + * config/i386/i386gnu.mt: New file. + +Wed Feb 28 15:50:12 1996 Fred Fish + + * Makefile.in (VERSION): Bump version to 4.15.2 to establish + baseline for gdb 4.16 rerelease testing. + +Wed Feb 28 13:32:05 1996 Jeffrey A Law (law@cygnus.com) + + * somsolib.c (som_solib_create_inferior_hook): Before returning + call clear_symtab_users. + +Tue Feb 27 00:04:46 1996 Stu Grossman (grossman@critters.cygnus.com) + + * remote-e7000.c (e7000_open): Delete all breakpoints when + connecting to e7000. Change connect message to allow use of + monitor.exp in test suite. + * (e7000_load): Print transfer rate of download. + * symfile.c (generic_load): Print transfer rate of download. + +Sun Feb 25 13:58:33 1996 Stan Shebs + + * configure.in (mips*-*-vxworks*): New config. + * configure: Regenerated. + + * config/mips/vxmips.mt, config/mips/tm-vxmips.h: New files. + * remote-vxmips.c (vx_convert_to_virtual, vx_convert_from_virtual): + Remove, never used. + +Sat Feb 24 12:30:28 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * partial-stab.h (case N_FUN): Function symbols generated + by SPARCworks cc have a meaningless zero value, do not update + pst->textlow if the function symbol value is zero. + + * stabsread.c (define_symbol): Initialize SYMBOL_TYPE field + for function prototype declaration symbols. + +Fri Feb 23 22:33:04 1996 Stu Grossman (grossman@critters.cygnus.com) + + * remote-e7000.c (e7000_load): New routine to download via the + network. + * (e7000_wait): Don't backup PC when we hit a breakpoint. + Apparantly new sh2 pods get this right... + * (e7000_ops): Add call to e7000_load. + +Thu Feb 22 00:52:42 1996 J.T. Conklin + + * config/m68k/{nbsd.mh,nbsd.mt,nm-nbsd.h,tm-nbsd.h,xm-nbsd.h}, + m68knbsd-nat.c: New files, support for NetBSD/m68k. + + * configure.in (m68k-*-netbsd*): New config. + * configure: Regenerated. + +Wed Feb 21 19:00:21 1996 Fred Fish + + * standalone.c (open, _initialize_standalone): Fix obvious typos + reported by Martin Pool . + +Wed Feb 21 14:24:04 1996 Jeffrey A Law (law@cygnus.com) + + * solib.c (solib_create_inferior_hook): Fix thinko. + +Tue Feb 20 23:59:19 1996 Jeffrey A Law (law@cygnus.com) + + * solib.c (solib_break_names): Define for Solaris and Linux. + (enable_break): For SVR4 systems, first try to use the debugger + interfaces in the dynamic linker to track shared library events + as they happen, then fall back to BKPT_AT_SYMBOL code. Convert + BKPT_AT_SYMBOL code to use shared library event breakpoints. + (solib_create_inferior_hook): Simplify BKPT_AT_SYMBOL code, + it no longer needs to restart/wait on the inferior. + * symfile.c (find_lowest_section): No longer static. + * symfile.h (find_lowest_section): Corresponding changes. + +Tue Feb 20 18:54:08 1996 Fred Fish + + * valops.c (COERCE_FLOAT_TO_DOUBLE): Define default value. + (value_arg_coerce): Use COERCE_FLOAT_TO_DOUBLE. + * config/alpha/tm-alpha.h (COERCE_FLOAT_TO_DOUBLE): Define to 1. + * config/mips/tm-mips.h: Ditto. + * config/pa/tm-hppa.h: Ditto. + * config/rs6000/tm-rs6000.h: Ditto. + * config/sparc/tm-sparc.h: Ditto. + +Tue Feb 20 17:32:05 1996 J.T. Conklin + + * config/{i386,ns32k}/nbsd.mh (NATDEPFILES): Remove core-aout.o. + + * config/nm-nbsd.h (FETCH_INFERIOR_REGISTERS): Defined. + * config/xm-nbsd.h (CC_HAS_LONG_LONG, PRINTF_HAS_LONG_LONG): + #ifdef'd out definitions --- Causes serious gdb failures on + the i386. Need to investigate further before enabling. + + * i386b-nat.c (fetch_inferior_registers, store_inferior_registers, + fetch_core_registers): New functions. These functions are defined + if FETCH_INFERIOR_REGISTERS is set. Registers are fetched/stored + with ptrace PT_GETREGS/PT_SETREGS. + +Tue Feb 20 16:55:06 1996 Stu Grossman (grossman@critters.cygnus.com) + + * findvar.c (extract_floating store_floating): Replace `long + double' with `DOUBLEST'. + +Mon Feb 19 15:25:51 1996 J.T. Conklin + + * config/xm-nbsd.h (CC_HAS_LONG_LONG, PRINTF_HAS_LONG_LONG): + Define. + +Mon Feb 19 10:32:05 1996 Jeffrey A Law (law@cygnus.com) + + * symtab.h (looup_minimal_symbol_solib_trampoline): Declare. + + * breakpoint.h (remove_solib_event_breakpoints): Declare. + * breakpoint.c (remove_solib_event_breakpoints): New function. + * somsolib.c (solib_create_inferior_hook): Remove all solib event + breakpoints before inserting any new ones. Use a solib event + breakpoint for the breakpoint at "_start". + Remove extraneous "\n" from calls to warning. + + * breakpoint.c (breakpoint_1): Add missing "sigtramp" to bptypes + name array. + +Mon Feb 19 01:09:32 1996 Doug Evans + + * dwarfread.c (add_partial_symbol): Use ADD_PSYMBOL_ADDR_TO_LIST + for CORE_ADDR values. + (new_symbol): Use SYMBOL_VALUE_ADDRESS for CORE_ADDR values. + * symfile.h (add_psymbol_{,addr}to_list): Add prototypes. + +Sun Feb 18 14:37:13 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * mipsread.c (mipscoff_symfile_read): Unconditionally add + alpha coff dynamic symbols for all symbol files. Makes skipping + over the trampoline code work when stepping from a function in a + shared library into a function in a different shared library. + +Sun Feb 18 09:27:10 1996 Stu Grossman (grossman@cygnus.com) + + * config/sparc/tm-sparc.h: Define PS_FLAG_CARRY. Define + RETURN_VALUE_ON_STACK to return long doubles on the stack. + +Sat Feb 17 16:33:11 1996 Fred Fish + + * Makefile.in (ch-exp.o): Add dependencies. + (various): Add gdb_string.h to dependencies that need it. + +Sat Feb 17 08:57:50 1996 Fred Fish + + * symmisc.c (print_symbol_bcache_statistics): Update description for + printing byte cache statistics. + +Thu Feb 16 16:02:03 1996 Stu Grossman (grossman@cygnus.com) + + * Add native support for long double data type. + * c-exp.y (%union): Change dval to typed_val_float. Use DOUBLEST + to store actual data. Change types of INT and FLOAT tokens to + typed_val_int and typed_val_float respectively. Create new token + DOUBLE_KEYWORD to specify the string `double'. Make production + for FLOAT use type determined by parse_number. Add production for + "long double" data type. + * (parse_number): Use sscanf to parse numbers as float, double or + long double depending upon the type of typed_val_float.dval. Also + allow user to specify `f' or `l' suffix to explicitly specify + float or long double constants. Change typed_val to + typed_val_int. + * (yylex): Change typed_val to typed_val_int. Also, scan for + "double" keyword. + * coffread.c (decode_base_type): Add support for T_LNGDBL basic + type. + * configure, configure.in: Add check for long double support in + the host compiler. + * defs.h: Define DOUBLEST appropriatly depending on whether + HAVE_LONG_DOUBLE (from autoconf) is defined. Also, fix prototypes + for functions that handle this type. + * expression.h (union exp_element): doubleconst is now type + DOUBLEST. + * m2-exp.y f-exp.y (%union): dval becomes type DOUBLEST. + * findvar.c (extract_floating): Make return value be DOUBLEST. + Also, add support for numbers with size of long double. + * (store_floating): Arg `val' is now type DOUBLEST. Handle all + floating types. + * parser-defs.h parse.c (write_exp_elt_dblcst): Arg expelt is now + DOUBLEST. + * valarith.c (value_binop): Change temp variables v1, v2 and v to + type DOUBLEST. Coerce type of result to long double if either op + was of that type. + * valops.c (value_arg_coerce): If argument type is bigger than + double, coerce to long double. + * (call_function_by_hand): If REG_STRUCT_HAS_ADDR is defined, and + arg type is float and > 8 bytes, then use pointer-to-object + calling conventions. + * valprint.c (print_floating): Arg doub is now type DOUBLEST. + Use appropriate format and precision to print out floating point + values. + * value.h: Fixup prototypes for value_as_double, + value_from_double, and unpack_double to use DOUBLEST. + * values.c (record_latest_value): Remove check for invalid + floats. Allow history to store them so that people may examine + them in hex if they want. + * (value_as_double unpack_double): Change return value to DOUBLEST. + * (value_from_double): Arg `num' is now DOUBLEST. + * (using_struct_return): Use RETURN_VALUE_ON_STACK macro (target + specific) to expect certain types to always be returned on the stack. + +Fri Feb 16 14:00:54 1996 Fred Fish + + * bcache.c, bcache.h: New files to implement a byte cache. + * Makefile.in (SFILES): Add bcache.c. + (symtab_h): Add bcache.h. + (HFILES_NO_SRCDIR): add bcache.h + (COMMON_OBJS): Add bcache.o + (bcache.o): New target. + * dbxread.c (start_psymtab): Make global_syms & static_syms + type "partial_symbol **". + * hpread.c (hpread_start_symtab): Ditto. + * os9kread.c (os9k_start_psymtab): Ditto. + * stabsread.h (start_psymtab): Ditto. + * {symfile.c, symfile.h} (start_psymtab_common): Ditto. + * maint.c (maintenance_print_statistics): Call + print_symbol_bcache_statistics. + * objfiles.c (allocate_objfile): Initialize psymbol bcache malloc + and free pointers. + * solib.c (allocate_rt_common_objfile): Ditto. + * symfile.c (reread_symbols): Ditto. + (free_objfile): Free psymbol bcache when objfile is freed. + (objfile_relocate): Use new indirect psymbol pointers. + * objfiles.h (struct objfile): Add psymbol cache. + * symfile.c (compare_psymbols): Now passed pointers to pointers to + psymbols. + (reread_symbols): Free psymbol bcache when freeing other objfile + resources. + (add_psymbol_to_list, add_psymbol_addr_to_list): Initialize new + psymbol using the psymbol bcache. + (init_psymbol_list): Psymbol lists now contain pointers rather than + the actual psymbols. + * symfile.h (psymbol_allocation_list): Psymbol lists now dynamically + grown arrays of pointers. + (ADD_PSYMBOL_VT_TO_LIST): Initialize new symbol using the psymbol + bcache. + * symmisc.c (print_partial_symbols): Now takes pointer to pointer + to partial symbol. + (print_symbol_bcache_statistics): New function to print per objfile + bcache statistics. + (print_partial_symbol, print_partial_symbols, + maintenance_check_symtabs, extend_psymbol_list): + Account for change to pointer to pointer to partial symbol. + * symtab.c (find_pc_psymbol, lookup_partial_symbol, decode_line_2, + make_symbol_completion_list): + Account for change to pointer to pointer to partial symbol. + * symtab.h (bcache.h): Include. + * xcoffread.c (xcoff_start_psymtab): Make global_syms & static_syms + type "partial_symbol **". + +Fri Feb 16 10:02:34 1996 Fred Fish + + * dwarfread.c (free_utypes): New function. + (read_file_scope): Call free_utypes as cleanup, rather than just + freeing the utypes pointer. + +Thu Feb 15 21:40:52 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * demangle.c (is_cplus_marker): New function, checks if a + character is one of the commonly used C++ marker characters. + * defs.h (is_cplus_marker): Add prototype. + * c-typeprint.c (c_type_print_base), ch-lang.c (chill_demangle), + cp-valprint.c (cp_print_class_method), mdebugread.c (parse_symbol), + stabsread.c (define_symbol, read_member_functions, read_struct_fields), + symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P), + values.c (vb_match): Use is_cplus_marker instead of comparison + with CPLUS_MARKER. + +Thu Feb 15 18:08:13 1996 Fred Fish + + * symfile.h (INLINE_ADD_PSYMBOL): Default this to 0 and possibly + delete entirely someday. + +Thu Feb 15 15:25:34 1996 Stan Shebs + + * mpw-make.sed: Edit out makefile rebuild rule. + (host_alias, target_alias): Comment out instead of deleting. + (@LIBS@): Edit out references. + +Tue Feb 13 22:56:46 1996 Fred Fish + + * symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): + Use n_psyms in OBJSTAT, not psyms. + +Mon Feb 12 15:59:31 1996 Doug Evans + + * configure.in (sparclet-*-aout*): New config. + * configure: Regenerated. + +Mon Feb 12 14:17:52 1996 Fred Fish + + * somsolib.c (som_solib_add): Use xmalloc rather than bare + unchecked call to malloc. + * remote-mips.c (pmon_load_fast): ditto. + * remote-mm.c (mm_open): ditto. + * hpread.c (hpread_lookup_type): ditto. + * remote-adapt.c (adapt_open): ditto. + +Mon Feb 12 13:11:32 1996 Fred Fish + + * f-lang.c (allocate_saved_bf_node, allocate_saved_function_node, + allocate_saved_f77_common_node, allocate_common_entry_node, + add_common_block): Use xmalloc rather than malloc, some of which + were unchecked. + * gnu-regex.c: At same point as other gdb specific changes + #undef malloc and then #define it to xmalloc. + * ch-exp.c (growbuf_by_size): Use xmalloc/xrealloc rather than + bare unchecked calls to malloc/realloc. + * stabsread.c (dbx_lookup_type): Use xmalloc rather than bare + unchecked call to malloc. + +Wed Feb 7 11:31:26 1996 Stu Grossman (grossman@cygnus.com) + + * symtab.c (gdb_mangle_name): Change opname var to be const to + match return val of cplus_mangle_name. + * i960-tdep.c: Change arg types of next_insn to match callers. + +Wed Feb 7 07:34:24 1996 Fred Fish + + * config/i386/linux.mh (XM_CLIBS, GDBSERVER_LIBS): Remove. These + apparently aren't needed in any reasonably recent version of + linux. + +Tue Feb 6 21:37:03 1996 Per Bothner + + * stabsread.c (read_range_type): If !self-subrange and language + is Chill, assume a true range. If a true_range is a sub_subrange, + use builtin_type_int for index_type. + +Tue Feb 6 18:38:51 1996 J.T. Conklin + + * nindy-share/nindy.c (say): Use stdarg.h macros when compiling + with an ANSI compiler. + +Mon Feb 5 18:24:28 1996 Steve Chamberlain + + From Michael_Snyder@NeXT.COM (Michael Snyder): + * valops.c (value_arg_coerce): Coerce float to double, unless the + function prototype specifies float. + +Mon Feb 5 09:51:55 1996 Tom Tromey + + * language.c (set_language_command): Use languages table when + printing available languages. + +Sat Feb 3 12:22:05 1996 Fred Fish + + Fix problems reported by Hans Verkuil (hans@wyst.hobby.nl): + * command.c (add_cmd): Add missing initialization for enums member. + Reorder members to match structure declaration to make it easier to + tell when one is missing. + * exec.c (exec_file_command): Fix problem where filename in malloc'd + memory is referenced after being freed. + +Sat Feb 3 03:26:21 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * dwarfread.c (read_func_scope): Avoid GDB core dumps if + AT_name tag is missing. + + * procfs.c (procfs_stopped_by_watchpoint): Fix logic when + FLTWATCH and FLTKWATCH are defined. + + * remote.c (remote_read_bytes): Advance memaddr for transfers, + return number of bytes transferred for partial reads. + + * top.c (init_signals): Reset SIGTRAP to SIG_DFL. + +Fri Feb 2 13:40:50 1996 Steve Chamberlain + + * win32-nat.c (mappings): Add ppc registers. + (child_resume): Turn off step for ppc. + +Thu Feb 1 10:29:31 1996 Steve Chamberlain + + * config/powerpc/(cygwin32.mh, cygwin32.mt, tm-cygwin32.h, + xm-cygwin32.h): New. + * config/i386/(*win32*): Becomes *cygwin32*. + * configure.in (i[3456]86-*-win32*): Becomes i[3456]86-*-cygwin32. + (powerpcle-*-cygwin32): New. + * configure: Regenerate. + * win32-nat.c (child_create_inferior): Call CreateProcess + with the right program arg. + +Thu Feb 1 11:01:10 1996 Jeffrey A Law (law@cygnus.com) + + * config/pa/tm-hppa.h (SOFT_FLOAT): Provide a default definition. + +Wed Jan 31 19:01:28 1996 Fred Fish + + * serial.c: Change fputc/fputs/fprintf to _unfiltered forms. + +Wed Jan 31 18:36:27 1996 Stan Shebs + + * config/sparc/xm-sun4os4.h (HAVE_TERMIOS): Remove. + + * config/sparc/xm-sparc.h (HAVE_WAIT_STRUCT): Remove, never used. + + * config/i386/nm-i386mach.h (CHILD_PREPARE_TO_STORE): Move to + here from config/i386/xm-i386mach.h, fix name. + * config/i386/nm-sun386.h: Ditto, from config/i386/xm-sun386.h. + * config/i386/nm-ptx4.h (CHILD_PREPARE_TO_STORE): Move to + here from config/i386/xm-ptx4.h. + * config/i386/nm-ptx4.h: Ditto, from config/i386/xm-ptx.h. + * config/i386/nm-symmetry.h: Ditto, from config/i386/xm-symmetry.h. + * config/m68k/nm-sun3.h: Ditto, from config/m68k/xm-sun3.h. + * config/sparc/nm-nbsd.h: Ditto, from config/sparc/xm-nbsd.h. + * config/sparc/nm-sun4os4: Ditto, from config/sparc/xm-sparc.h. + + * config/sparc/nm-sun4sol2.h: New file, renamed from nm-sysv4.h. + (PRSVADDR_BROKEN): Move here from xm-sun4sol2.h. + * config/sparc/sun4sol2.mh (NAT_FILE): Update. + +Wed Jan 31 17:20:26 1996 Jeffrey A Law (law@cygnus.com) + + * config/pa/tm-hppa.h (EXTRACT_RETURN_VALUE): Handle software + floating point correctly. + (STORE_RETURN_VALUE): Likewise. + * config/pa/tm-pro.h (SOFT_FLOAT): define. + +Wed Jan 31 13:34:52 1996 Fred Fish + + * config/i386/xm-linux.h (MMAP_BASE_ADDRESS, MMAP_INCREMENT): + Define to what should be reasonable values. However, apparently + a bug in linux mmap prevents mapped symbol tables from working. + +Tue Jan 30 18:26:19 1996 Fred Fish + + * defs.h (errno.h>: Move #include closer to head of file to solve + obscure problem with systems that declare perror with const arg, in + both errno.h and stdio.h, and const is defined away by intervening + local include. + +Tue Jan 30 15:41:10 1996 Fred Fish + + From Jon Reeves : + * i386-stub.c (getpacket): Change fprintf stream from "gdb" to stderr. + (mem_fault_routine): Fix misplaced volatile type qualifier in decl. + +Mon Jan 29 19:05:58 1996 Fred Fish + + * Makefile.in (diststuff): Make all-doc; diststuff target does not + exist in doc/Makefile.in. + +Mon Jan 29 18:44:57 1996 Stan Shebs + + * config/m88k/xm-cxux.h (BP_HIT_COUNT): Remove, never used. + +Mon Jan 29 00:10:35 1996 Wilfried Moser + + * ch-valprint.c (calculate_array_length): New function to + determine the length of an array type. + (chill_val_print (case TYPE_CODE_ARRAY)): If the length of an + array type is zero, call calculate_array_length. + + * gdbtypes.c (get_discrete_bounds (case TYPE_CODE_ENUM)): The + values may not be sorted. Scan all entries and set the real lower + and upper bound. + +Sun Jan 28 15:50:42 1996 Fred Fish + + * config/xm-linux.h: Move include of solib.h and #define of + SVR4_SHARED_LIBS from here ... + * config/nm-linux.h: ...to here. + +Sat Jan 27 10:34:05 1996 Fred Fish + + * configure.in (AC_CHECK_HEADERS): Check for sys/procfs.h. + Also check for gregset_t and fpregset_t types. + * configure: Regenerate. + * core-regset.c (sys/procfs.h): Only include if HAVE_SYS_PROCFS_H + is defined. + (fetch_core_registers): Turn into stub unless both HAVE_GREGSET_T + and HAVE_FPREGSET_T are defined. These changes allow systems + like linux that are migrating to /proc support to use a single + configuration for both new and old versions. + + * config/i386/linux.mt: Note that this is now for both a.out and + ELF systems. + * config/i386/linux.mh (NATDEPFILES): Add solib.o, core-regset.o, + i386v4-nat.o + * config/i386/tm-linux.h (tm-sysv4.h): Include. + * config/i386/xm-linux.h (solib.h): Include + (SVR4_SHARED_LIBS): Define. + * i386v4-nat.c: Only compile if HAVE_SYS_PROCFS_H is defined. + (supply_gregset, fill_gregset): Compile if HAVE_GREGSET_T defined. + (supply_fpregset, fill_fpregset): Compile if HAVE_FPREGSET_T + defined. + +Fri Jan 26 13:48:14 1996 Stan Shebs + + * config/sparc/xm-sparc.h (NEW_SUN_CORE): Remove, never used. + * config/i386/xm-sun386.h: Ditto. + * config/m68k/xm-sun2.h, config/m68k/xm-sun3.h: Ditto. + +Thu Jan 25 16:05:53 1996 Tom Tromey + + * Makefile.in (INSTALLED_LIBS, CLIBS): Include @LIBS@. + +Thu Jan 25 09:22:15 1996 Steve Chamberlain + + From Greg McGary : + * dcache.c (dcache_peek, dcache_poke): Advance addr for + multi-byte I/O. + +Thu Jan 25 13:08:51 1996 Doug Evans (dje@cygnus.com) + + * infrun.c (normal_stop): Fix test for shared library event. + +Thu Jan 25 03:26:38 1996 Doug Evans + + * configure.in (sparc64-*-*): Add default host configuration. + (sparc64-*-solaris2*): Add target configuration. + (sparc64-*-solaris2* host): Link statically if GCC used. + * configure: Regenerated. + * sparc/sp64sol2.mt: New file. + +Wed Jan 24 22:31:37 1996 Doug Evans + + * Makefile.in (RUNTEST): srcdir renamed to rootsrc. + +Wed Jan 24 15:42:24 1996 Tom Tromey + + * Makefile.in (lint): Close backquotes. + +Wed Jan 24 13:19:10 1996 Fred Fish + + * NEWS: Make note of new record and replay feature for + remote debug sessions. + * serial.c (gdbcmd.h): Include. + (serial_logfile, serial_logfp, serial_reading, serial_writing): + Define here, for remote debug session logging. + (serial_log_command, serial_logchar, serial_write, serial_readchar): + New functions for remote debug session logging. + (serial_open): Open remote debug session log file when needed. + (serial_close): Close remote debug session log file when needed. + (_initialize_serial): Add set/show commands for name of remote + debug session log file. + * serial.h (serial_readchar): Declare + (SERIAL_READCHAR): Call serial_readchar(). + (SERIAL_WRITE): Call serial_write(). + (serial_close): Declare as extern. + (serial_logfile, serial_logfp): Declare. + * top.c (execute_command): Declare serial_logfp. Log user command + in remote debug session log if log file is open. + * remote-array.c (array_wait): #ifdef out echo to gdb_stdout. + (array_read_inferior_memory): Rewrite to fix memory overwrite bug. + * remote-array.c (SREC_SIZE): Remove, duplicates define in + monitor.h. + * remote-array.c (hexchars, hex2mem): Remove, unused. + * gdbserver/low-linux.c (store_inferior_registers): Remove + unnecessary extern declaration of registers[]. + * gdbserver/Makefile.in (all): Add gdbreplay. + * gdbserver/gdbreplay.c: New file. + * gdbserver/README: Give example of recording a remote + debug session with gdb and then replaying it with gdbreplay. + +Tue Jan 23 18:02:35 1996 Per Bothner + + * stabsread.c (rs6000_builtin_type): Make bool type unsigned. + (read_one_struct_field): Support boolean bitfields. + * c-valprint.c (c_val_print): Print booleans properly. + +Tue Jan 23 18:54:09 1996 Stan Shebs + + * remote-vxsparc.c (vx_convert_to_virtual, vx_convert_from_virtual): + Remove, never used. + * config/sparc/vxsparc.mt (TDEPFILES): Add remote-vxsparc.o. + +Tue Jan 23 14:36:05 1996 Per Bothner + + * ch-exp.c (parse_tuple): Error if invalid mode. + + * value.h (COERCE_ARRAY): Don't coerce enums. + (COERCE_ENUM): Don't COERCE_REF. + (COERCE_NUMBER): New macro (same as COERCE_ARRAY then COERCE_ENUM). + * valops.c (value_assign): Only do COERCE_ARRAY if internalvar (let + value_cast handle it otherwise); do *not* COERCE_ENUM either way. + * valarith.c: Use COERCE_NUMBER instead od COEREC_ARRAY. + Add COERCE_REF before COERCE_ENUM. + * values.c (value_as_long): Simplify. + + * valops.c (value_array): Create internalvar if !c_style_arrays. + + * language.c (lang_bool_type): Add Fortran support. + * eval.c (OP_BOOL): Use LA_BOOL_TYPE. + +Tue Jan 23 13:08:26 1996 Jeffrey A Law (law@cygnus.com) + + * symfile.c (auto_solib_add): Renamed from auto_solib_add_at_startup. + All references changed. + * breakpoint.c (bpstat_what): Add shlib_event to the class types. + Update state table. Reformat so that it's still readable. + When we hit the shlib_event breakpoint, set the calss of shlib_event. + (breakpoint_1): Add "shlib events" as a breakpoint type. + Print the shlib_event breakpoint like other breakpoints. + (create_solib_event_breakpoint): New function. + (breakpoint_re_set_one): Handle solib_event breakpoints. + * breakpoint.h (enum bytype): Add bp_shlib_event breakpoint type. + (enum bpstat_what_main_action): Add BPSTAT_WHAT_CHECK_SHLIBS + action. + (create_solib_event_breakpoint): Declare. + * infrun.c (wait_for_inferior): Handle CHECK_SHLIBS bpstat. + (normal_stop): Inform the user when the inferior stoped due + to a shared library event. + (_initialize_infrun): Add new set/show variable "stop-on-solib-events" + to control whether or not gdb continues the inferior or stops it when + a shared library event occurs. + * minsyms.c (lookup_minimal_symbol_solib_trampoline): New function. + * somsolib.c (TODO list): Update. + (som_solib_create_inferior_hook): Arrange for gdb to be notified + when significant shared library events occur. + * hppa-tdep.c (find_unwind_entry): No longer static. + +Tue Jan 23 09:00:48 1996 Doug Evans + + * printcmd.c (print_insn): Pass fprintf_unfiltered to + INIT_DISASSEMBLE_INFO. + +Mon Jan 22 16:59:40 1996 Stan Shebs + + * remote.c (remotebreak): New GDB variable. + (remote_break): New global. + (remote_interrupt): Send a break instead of ^C if remote_break. + * NEWS: Describe the new variable. + +Mon Jan 22 16:24:11 1996 Doug Evans + + * sparc-tdep.c (_initialize_sparc_tdep): Always use print_insn_sparc. + +Fri Jan 19 07:19:38 1996 Fred Fish + + * hp300ux-nat.c (getpagesize): Remove unused function + fetch_core_registers. + (hp300ux_core_fns): Remove, is unused. + (_initialize_core_hp300ux): Remove, is unused. + (gdbcore.h): Remove #include, no longer needed. + +Fri Jan 19 00:59:53 1996 Jeffrey A Law (law@cygnus.com) + + * rs6000-nat.c (exec_one_dummy_insn): Rework to avoid + ptrace bug in aix4.1.3 on the rs6000. + +Wed Jan 17 13:22:27 1996 Stan Shebs + + * remote-hms.c (hms_ops): Add value for to_thread_alive. + * remote-nindy.c (nindy_ops): Ditto. + * remote-udi.c (udi_ops): Ditto. + +Tue Jan 16 18:00:35 1996 James G. Smith + + * remote-mips.c (pmon_opn, pmon_wait, pmon_makeb64, pmon_zeroset, + pmon_checkset, pmon_make_fastrec, pmon_check_ack, + pmon_load_fast): New functions. Support for the PMON monitor world. + (common_open): New function to merge support for different monitors. + (mips_open): Use common_open(). + (mips_send_command): New function. + (mips_send_packet): Scan out-of-sequence packets. + (mips_enter_debug, mips_exit_debug): New functions. + (pmon_ops): New target definition structure. + +Tue Jan 16 11:22:58 1996 Stu Grossman (grossman@cygnus.com) + + * Makefile.in (CLIBS): Add LIBS to allow libraries to be + specified on the make command line (via make LIBS=xxx). + + +Fri Jan 12 21:41:58 1996 Jeffrey A Law (law@cygnus.com) + + * symtab.c (find_pc_symtab): Don't lose if OBJF_REORDERED + is set but there are no psymtabs. + +Fri Jan 12 15:56:12 1996 Steve Chamberlain + + * dsrec.c (load_srec): Remove unused variable. + * monitor.c (monitor_expect): Don't expect a ^C to echo. + * serial.c (serial_open): Add parallel interface. + * sh3-rom.c (parallel, parallel_in_use): New. + (sh3_load): If parallel_in_use, download though the + parallel port. + (sh3_open): Open parallel port if specified. + (sh3_close): New function. + (_inititalize_sh3): Add sh3_close hook and documentation. + * monitor.c (monitor_close): Export. + * monitor.h (monitor_close): Add prototype. + +Fri Jan 12 13:11:42 1996 Stan Shebs + + From Wilfried Moser : + * remote.c (remotetimeout): New GDB variable, use to set the + remote timeout for reading. + +Fri Jan 12 07:14:27 1996 Fred Fish + + * lynx-nat.c, irix4-nat.c, sparc-nat.c: Include gdbcore.h + to get "struct core_fns" defined. + * Makefile.in (lynx-nat.o, irix4-nat.o, sparc-nat.o): + Are dependent upon gdbcore_h. + +Thu Jan 11 23:13:24 1996 Per Bothner + + * symfile.c (decrement_reading_symtab): New function. + * symfile.c, symtab.h (currently_reading_symtab): New variable. + * symfile.c (psymtab_to_symtab): Adjust currently_reading_symtab. + * gdbtypes.c (check_typedef): Don't call lookup_symbol if + currently_reading_symtab (since that could infinitely recurse). + +Thu Jan 11 17:21:25 1996 Per Bothner + + * stabsread.c (read_struct_type): Trivial simplification. + + * stabsread.c (define-symbol): Use invisible references + for TYPE_CODE_SET and TYPE_CODE_BITSTRING too. + * valops.c (call_function_by_hand): Likewise. + * eval.c (evaluate_subexp_standard): When known, use the formal + parameter type as the expected type when evaluating arg expressions. + * ch-lang.c (evaluate_subexp_chill): Likewise (for MULTI_SUBSCRIPT). + +Thu Jan 11 10:08:14 1996 Tom Tromey + + * main.c (main): Disable window interface if --help or --version + specified. + +Wed Jan 10 16:08:49 1996 Brendan Kehoe + + * configure.in, configure: Recognize rs6000-*-aix4*. + * config/powerpc/xm-aix.h: Reduce to include "xm-aix4.h". + * config/rs6000/aix4.mh (XM_FILE): Point to xm-aix4.h. + * config/rs6000/xm-aix4.h: New file. + * config/xm-aix4.h: New file. + +Wed Jan 10 11:25:37 1996 Fred Fish + + From Wilfried Moser : + * gdbserver/low-linux.c: New file. + * remote.c (remote_read_bytes): Fix aborts on larger packets. + + * config/i386/linux.mh (GDBSERVER_DEPFILES, GDBSERVER_LIBS): + Define. + * stabsread.c (define_symbol): If register value is too large, + tell what it is and what max is. + +Tue Jan 9 09:33:53 1996 Jeffrey A Law (law@cygnus.com) + + * hpread.c (hpread_build_psymtabs): Finish Jan 4th + enum namespace -> enum_namespace change. + +Tue Jan 9 04:44:47 1996 Wilfried Moser + + * ch-exp.c (parse_primval): In case ARRAY, add missing + FORWARD_TOKEN (). + +Mon Jan 8 13:29:34 1996 Stan Shebs + + * remote-mips.c (mips_receive_header): Recognize \012 instead + of \n, but write \n when program sends a \012. + * ser-mac.c (mac_input_buffer): Increase size of buffer. + +Mon Jan 8 12:00:40 1996 Jeffrey A Law (law@cygnus.com) + + * infptrace.c (initialize_infptrace): Move function out of + #ifdef conditional; put code within the function inside an + #ifdef conditional. + + * buildsym.c (end_symtab): Remove sort_pending and sort_linevec + arguments. Sorting is now dependent on OBJF_REORDERED. All + callers/references changed. + * dbxread.c (read_ofile_symtab): Correctly determine value for + last_source_start_addr for reordered executables. + (process_one_symbol): Handle N_FUN with no name as an end of + function marker. + * partial-stab.h (case N_FN, N_TEXT): Don't assume CUR_SYMBOL_VALUE + is the high text address for a psymtab. + (case N_SO): Likewise. + (case N_FUN): Handle N_FUN with no name as an end of function + marker. + * minsyms.c (lookup_minimal_symbol_by_pc): Examine all symbols + at the same address rather than a random subset of them. + * coffread.c (coff_symfile_init): Set OBJF_REORDERED. + * elfread.c (elf_symfile_init): Similarly. + * somread.c (som_symfile_init): Similarly. + * xcoffread.c (xcoff_symfile_init): Similarly. + +Fri Jan 5 17:46:01 1996 Stu Grossman (grossman@cygnus.com) + + * stack.c (print_stack_frame print_frame_info) symmisc.c + (dump_symtab): Change RETURN_MASK_ERROR to RETURN_MASK_ALL so + that catch_errors doesn't get blindsided by QUIT and lose the + cleanup chain. This fixes a problem where ^C while in a + user-defined command sometimes leaves instream NULL and causes a + segfault in command_loop. + +Fri Jan 5 13:59:16 1996 Brendan Kehoe + + * configure.in, configure: Add `-ldl -lw' for Solaris linking. + +Fri Jan 5 12:02:00 1996 Steve Chamberlain + + * config/sh/sh.mt, config/powerpc/*.mt, config/pa/hppapro.mt, + config/m68k/monitor.mt, config/h8500/h8500.mt, config/h8300/h8300.mt: + srec.o renamed to dsrec.o. + +Thu Jan 4 16:04:54 1996 Stu Grossman (grossman@cygnus.com) + + * breakpoint.c (remove_breakpoint): Change error to warning so + that hardware watchpoint removal problems won't leave breakpoint + traps in the target. + * remote-e7000.c (e7000_insert_breakpoint, + e7000_remove_breakpoint): Use e7000 based breakpoints, not memory + breakpoints. + * (e7000_wait): Adjust PC back by two when we see a breakpoint to + compensate for e7000 maladjustment. + * sparcl-tdep.c (sparclite_check_watch_resources): Fix logic bug + which prevented hardware watchpoints from working. + +Thu Jan 4 10:44:17 1996 Fred Fish + + * infptrace.c (udot_info): New function. + (PT_*): Define each individually if that one is not defined. + * rs6000-nat.c (kernel_u_size): New function + Include for "struct user" + * alpha-nat.c (kernel_u_size): New function. + Include for "struct user" + * sparc-nat.c (kernel_u_size): New function. + Include for "struct user" + * i386b-nat.c (kernel_u_size): New function. + * i386v-nat.c (kernel_u_size): New function. + * config/i386/nm-fbsd.h (KERNEL_U_SIZE): Define. + (kernel_u_size): Declare. + * config/i386/nm-linux.h (KERNEL_U_SIZE): Define. + (kernel_u_size): Declare. + * config/sparc/nm-sun4os4.h (KERNEL_U_SIZE): Define. + (kernel_u_size): Declare. + * config/alpha/nm-osf2.h (KERNEL_U_SIZE): Define. + (kernel_u_size): Declare. + * config/rs6000/nm-rs6000.h (KERNEL_U_SIZE): Define. + (kernel_u_size): Declare. + +Thu Jan 4 11:00:01 1996 steve chamberlain + + * mdebugread.c (mylookup_symbol): enum namespace becomes + enum_namespace type. + * symfile.c (add_psymbol_to_list) + (add_psymbol_addr_to_list): Ditto. + * symtab.c (lookup_partial_symbol): Ditto. + (lookup_symbol): Ditto. + (lookup_block_symbol): Ditto. + * win32-nat.c (handle_load_dll): Use incoming dll base. + (child_wait): Catch DLL load errors. + (create_child_inferior): Translated between paths correctly. + +Wed Jan 3 23:13:53 1996 Fred Fish + + * i386v4-nat.c (supply_gregset, fill_gregset): Subtract NUM_FREGS + from NUM_REGS to get number of general registers that we care about. + * config/i386/tm-i386.h (REGISTER_BYTES): Define in terms + of number of general regs and number of floating point regs. + +Wed Jan 3 19:49:54 1996 steve chamberlain + + * config/i386/tm-win32.h (IN_SOLIB_CALL_TRAMPOLINE): New. + (SKIP_TRAMPOLINE_CODE): New. + * config/i386/xm-win32.h (CANT_FORK): Deleted. + (SLASH*) Changed to use unix style slash. + * symtab.h (namespace enum): becomes typedef to avoid namespace + collision in C++. + * infcmd.c (path_command): Use empty string if PATH name not set. + * i386-tdep.c (skip_trampoline_code): New function. + * srec.c: Renamed dsrec.c to avoid filename collision. + * Makefile.in: Cope with renaming. + +Wed Jan 3 13:09:04 1996 Fred Fish + + * symmisc.c (print_objfile_statistics): Print memory use statistics + for objfile psymbol, symbol, and type obstacks. + +Tue Jan 2 13:41:14 1996 Stan Shebs + + * config/mips/nm-irix5.h: Restore. + (TARGET_HAS_HARDWARE_WATCHPOINTS, etc): Define as for Irix 4; + from Lee Iverson . + * config/mips/irix5.mh (NAT_FILE): Use nm-irix5.h. + * config/mips/irix[345].mh (MUNCH_DEFINE): Remove. + +For older changes see ChangeLog-95 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/gdb/gdb/ChangeLog-97 b/contrib/gdb/gdb/ChangeLog-97 new file mode 100644 index 0000000..4f9a949 --- /dev/null +++ b/contrib/gdb/gdb/ChangeLog-97 @@ -0,0 +1,2855 @@ +Wed Dec 31 11:43:53 1997 Mark Alexander + + * dsrec.c (load_srec): Check remotedebug flag when printing + debug info. + +Wed Dec 31 10:33:15 1997 David Taylor + + * breakpoint.c (breakpoint_re_set): add _siglongjmp to list of + longjmp breakpoints. + +Mon Dec 29 21:25:34 1997 Mark Alexander + + * dve3900-rom.c: New file to support Densan DVE-R3900/20 board. + * monitor.c (monitor_debug): Move to utils.c, rename to puts_debug. + (monitor_write_memory, monitor_read_memory, monitor_insert_breakpoint, + monitor_remove_breakpoint): Remove useless address bits if current + monitor has MO_ADDR_BITS_REMOVE flag. + * monitor.h (MO_ADDR_BITS_REMOVE): Define. + * utils.c (puts_debug): Formerly monitor_debug from monitor.c; + move here and make public. Add better support for carriage returns. + * defs.h (puts_debug): Declare. + * dsrec.c (load_srec): Use puts_debug to print remotedebug information. + Output header record correctly. + (make_srec): Output a header record instead of a termination record + if sect is non-NULL (value is ignored), but abfd is NULL. + * config/mips/tm-tx39.h (DEFAULT_MIPS_TYPE): Remove definition. + (REGISTER_NAMES): Define to add R3900-specific registers. + * config/mips/tm-tx39l.h: Ditto. + * config/mips/tx39.mt (TDEPFILES): Add dve3900-rom.o and support files. + * config/mips/tx39l.mt: Ditto. + +Wed Dec 24 12:48:48 1997 Stan Shebs + + * dsrec.c: Cosmetic improvements. + (make-srec): Change indexing of format and code tables to + remove confusing empty entries. + +Mon Dec 22 21:51:53 1997 Mark Alexander + + * remote-mips.c (_initialize_remote_mips): Fix DDB doc string. + +Sun Dec 21 17:00:06 1997 David Taylor + + * d30v-tdep.c (d30v_frame_find_saved_regs): split most of + function off into d30v_frame_find_saved_regs_offsets; + (d30v_frame_find_saved_regs_offsets): new function. Got + backtrace working when calling from framefull (unoptimized) + routines (.e.g, main) into frameless (optimized) routines + (e.g., printf). + +Fri Dec 19 09:49:49 1997 David Taylor + + * d30v-tdep.c (d30v_frame_chain): test end_of_stack + (d30v_frame_find_saved_regs): set it. + * config/d30v/tm-d30v.h: improved FRAME_CHAIN_VALID + +Thu Dec 18 12:34:28 1997 Andrew Cagney + + From Gavin Koch : mips-tdep.c + * (mips_push_arguments): For big-endian shorts and char's store at + * the correct location. + +Thu Dec 18 00:26:46 1997 Andrew Cagney + + * mdebugread.c (parse_partial_symbols): Delete check that symbols + for file not already loaded. Did not work when an include file + was involved. + +Wed Dec 17 10:43:04 1997 Andrew Cagney + + * elfread.c (elf_symfile_read): Since the partial symbol table is + searched last in first, insert mdebug or XCOFF info into the + partial symbol table before any DWARF2 info. + +Thu Dec 18 00:00:48 1997 Andrew Cagney + + * symfile.c (init_psymbol_list): Handle init with zero elements. + + * elfread.c (elf_symfile_read): If `mainline', clear psymbol table + using init_psymbol_list 0. For build_psymtabs functions, pass + mainline==0 so that psymbol_list isn't re-initialized. + + * symfile.c (discard_psymtab): New function, correctly unlink an + empty psymtab from an object file. + * dbxread.c (end_psymtab): Call discard_psymtab. + * xcoffread.c (xcoff_end_psymtab): Ditto. + * hpread.c (hpread_end_psymtab): Ditto. + * os9kread.c (os9k_end_psymtab): Ditto. + +Wed Dec 17 10:47:05 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c (set_raw_tracepoint): initialize addr_string + to NULL; (trace_actions_command): call readline_begin_hook only + if from_tty is true. + +Tue Dec 16 20:05:48 1997 Mark Alexander + + * configure.tgt: Change little-endian tx39 target name to tx39l. + +Tue Dec 16 11:24:30 1997 Jeffrey A Law (law@cygnus.com) + + * remote-sim.c (gdbsim_open): Use "--architecture" instead of + ambigious short form. + +Tue Dec 16 10:29:16 1997 David Taylor + + * d30v-tdep.c (d30v_frame_chain): don't or in DMEM_START to + FP_REGNUM value before return; (prologue_find_regs): two sets + of offsets -- frame pointer and stack pointer, not just one that + tries to do double duty; (d30v_frame_find_saved_regs): stop once + we hit pc (in case we're stopped in the middle of the prologue) + and improve handling of frameless prologues; (d30v_push_arguments): + *ALL* arguments go on the stack until we run out of args registers, + force sp to be 8 byte aligned. + + * config/tm-d30v.h (EXTRACT_STRUCT_VALUE_ADDRESS): fix, it's r2, + not r0; (FRAME_CHAIN_VALID): handle use of external memory; + (STACK_ALIGN): define. + +Mon Dec 15 15:13:57 1997 Andrew Cagney + + * remote-sim.c (gdbsim_wait): When HAVE_SIGACTION and SA_RESTART + intall cntrl-c handler with SA_RESTART clear. On BSD systems this + stops read syscalls's being restarted. + + * configure.in (configdirs): Check for sigaction. + * configure: Re-generate. + +Mon Dec 15 11:38:52 1997 Andrew Cagney + + * dwarf2read.c: From change proposed by Gavin Koch. + (address_significant_size): New static variable. + (dwarf2_build_psymtabs_hard): Check consistency between + `address_size' and `address_significant_size'. + (read_address): MASK out all but the significant bits, as + determined by `address_significant_size', of any addresses. + (elf-bfd.h): Include. + (dwarf2_build_psymtabs_hard): Set `address_significant_size' + according to the arch_size of the elf object file. + +Thu Dec 11 13:40:46 1997 Andrew Cagney + + * dwarf2read.c (dwarf_decode_lines): Change type of address to + CORE_ADDR. + +Thu Dec 11 14:28:01 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c (trace_find_command): don't error if going + backwards thru the trace buffer in a loop. + * (struct tracepoint): delete unused field. + +Wed Dec 10 17:57:00 1997 David Taylor + + * d30v-tdep.c : don't bury lots of magic numbers in the code + instead use defines for the opcodes and opcode masks; update + to use actual d30v patterns; fix register sizes to be 4 bytes + not 2 bytes; improve prologue testing now that we have a C + compiler; fix stack frame handling enough to get backtraces + working; initial changes to push and pop frames (so that gdb + can call functions in the inferior). + + * config/d30v/tm-d30v.h: update DMEM_START, IMEM_START, and + STACK_START; change FR_REGNUM to 61 (was 11). Reformat comment + about DUMMY FRAMES so that it is readable. Fix SAVED_PC_AFTER_FRAME + macro. + +Wed Dec 10 17:41:07 1997 Jim Blandy + + * ch-valprint.c (chill_val_print): To avoid segfaults, don't print + a string whose dynamic length is longer than its static length. + +Wed Dec 10 15:54:00 1997 Andrew Cagney + + * dwarf2read.c (dwarf2_build_psymtabs_hard): Check + cu_header.length is within dwarf_info_buffer not + dwarf_abbrev_buffer. + +Mon Dec 8 14:28:49 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c (memrange_sortmerge): allow for memranges + that overlap. (collect_pseudocommand etc.) cleanup decls. + +Fri Dec 5 09:22:35 1997 Nick Clifton + + * config/v850/tm-v850.h (BREAKPOINT): Reverted back to old value... + +Thu Dec 4 09:30:22 1997 Nick Clifton + + * config/v850/tm-v850.h (BREAKPOINT): Changed to match new value. + +Wed Dec 3 12:44:15 1997 Keith Seitz + + * tracepoint.c: Add declaration for x_command. + + * printcmd.c (x_command): Remove static declaration. + +Wed Dec 3 12:00:42 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c (finish_tfind_command): call do_display so that + auto-displays are updated by tfind. Also, keep track of frame + and current-function so that tfind behaves like stepping (only + show the stack frame if we step into a new function or return). + +Wed Dec 3 14:14:58 1997 David Taylor + + * sol-thread.c: additional support for debugging threaded core + files on solaris; previously only kernel threads were found -- + user threads generated errors. + * corelow.c: don't register core_ops as a target if + coreops_suppress_target is true (set by sol-thread.c). + +Tue Dec 2 14:53:09 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c: make "tdump" command handle literal memranges. + +Tue Dec 2 11:34:48 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c: use "lookup_cmd" to parse actions commands + (thus allowing unambiguous prefixes and aliases). + +Tue Dec 2 10:15:57 1997 Nick Clifton + + * configure.tgt: Add support for Thumb target. + +Tue Dec 2 10:14:15 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c: move prototype of validate_actionline(), and + make it consistent with the function declaration. + +Thu Nov 27 09:07:18 1997 Michael Meissner + + * Makefile.in (tracepoint_h): New macro for tracepoint.h + includes. + (tracepoint.o): Add rule to build. + +Wed Nov 26 22:59:04 1997 Jeffrey A Law (law@cygnus.com) + + * remote-sim.c (gdbsim_cntrl_c): Lose ANSI prototype. + + * tracepoint.c (set_raw_tracepoint): fix typo + +Wed Nov 26 11:33:09 1997 Keith Seitz + + * tracepoint.c (set_raw_tracepoint): Make sure there's a trailing + slash on the directory name. + + * top.c (get_prompt): New function. + * top.h: Declare it. + +Wed Nov 26 09:59:47 1997 Andrew Cagney + + * dwarf2read.c (struct comp_unit_head): Change length and + abbrev_offset fields to unsigned int. + (dwarf2_build_psymtabs_hard): Verify length and offset read from + .debug_info section. + +Mon Nov 24 19:36:34 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c, tracepoint.h: new module, implements tracing, + which is a new functionality somewhat like breakpoints except + that a tracepoint stops the inferior only long enough to collect + and cache selected buffers and memory locations, then allows + the inferior to continue; the cached trace data can then be + examined later. + +Mon Nov 24 14:17:02 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * infcmd.c: export registers_info, for use by other modules. + * printcmd.c: export output_command, for use by other modules. + * stack.c: export locals_info and args_info, for use by other modules. + * remote.c: export getpkt, putpkt, and fromhex for external use. + Make fromhex case-insensative. New function "remote_console_output" + abstracts the acceptance of "O" packets from target. + Make all "remotedebug" output go to stdout, not stderr. + +Mon Nov 24 08:59:28 1997 Andrew Cagney + + * valprint.c (print_longest): When CC has long long but printf + doesn't, print decimal value as three parts. + + * config/i386/tm-fbsd.h: New file. + * config/i386/fbsd.mt (TM_FILE): Change to tm-fbsd.h. + + * config/i386/nm-fbsd.h (FLOAT_INFO): Move definition from here. + * config/i386/tm-fbsd.h (FLOAT_INFO): To here. + + * configure.in (PRINTF_HAS_LONG_LONG): Check full functionality of + %ll format specifier. + (SCANF_HAS_LONG_DOUBLE): Check the scanf family for support of + long double using %Lg. + * acconfig.h: Provide default undef for SCANF_HAS_LONG_DOUBLE. + * configure: Re-generate. + + * c-exp.y (parse_number): Use sscanf %Lg when host has + SCANF_HAS_LONG_DOUBLE not PRINTF_HAS_LONG_DOUBLE + +Sun Nov 23 17:12:58 1997 Andrew Cagney + + * printcmd.c (print_insn): Set the machine type if known. + + * i386-tdep.c (_initialize_i386_tdep): Delete "set + assembly-language" command. Replaced by generic "set + architecture". Set initial machine using bfd_lookup_arch. + +Fri Nov 21 19:43:23 1997 Jim Blandy + + * valops.c (call_function_by_hand): If the function has a + prototype, convert its arguments as if by assignment. Otherwise, + do the usual promotions. + * stabsread.c (define_symbol): Set the TYPE_FLAG_PROTOTYPED flag + on functions' types when we can; all C++ functions should get it, + and if the Sun-style prototype notation is in the stabs, we can + notice that. + +Fri Nov 21 12:20:16 1997 Ian Lance Taylor + + * aclocal.m4 (AM_CYGWIN32, AM_EXEEXT): Remove. They are already + defined by the inclusion of ../bfd/aclocal.m4. + * configure: Rebuild. + +Fri Nov 21 10:52:39 1997 Michael Meissner + + * Makefile.in (SHELL): Really do the change. + +Fri Nov 21 02:19:57 1997 Geoffrey Noer + + * Makefile.in: also revert SHELL change until configury + changes work + +Thu Nov 20 16:35:13 1997 Doug Evans + + * sparc-tdep.c (sparc_pc_adjust): Don't assume sizeof (long) == 4. + +Thu Nov 20 04:11:27 1997 Geoffrey Noer + + * aclocal.m4: add EXEEXT setting rule + * configure.in: call it + * configure: regenerate + * Makefile.in: pepper with EXEEXTs in appropriate places, + set SHELL = @SHELL@ for those lame hosts that don't have a /bin/sh + For some reason, EXEEXT isn't getting substututed in correctly + so for now, set EXEEXT to empty string + +Mon Nov 17 15:35:06 1997 Doug Evans + + * Makefile.in (remote-sim.o): Depend on $(INCLUDE_DIR)/callback.h. + +Fri Nov 14 13:04:34 1997 Jeffrey A Law (law@cygnus.com) + + * jv-exp.y (copy_exp, insert_exp): Avoid ANSI prototypes. + +Thu Nov 13 09:47:35 1997 Michael Meissner + + * d30v-tdep.c (d30v_print_flags): Function to print the d30v flags + in a human readable format. + (print_flags_command): Command wrapper to call d30v_print_flags. + (d30v_do_registers_info): When printing out all of the registers, + print out the flag values in a human readable fashion. + (_initialize_d30v_tdep): Add info flags command to print the + flags. + + * config/d30v/tm-d30v.h (PSW_*): Add macros for each of the PSW + bits that are defined. + +Wed Nov 12 14:58:39 1997 Jeff Holcomb + + * symfile.c (generic_load): Handle cancel from the + ui_load_progress_hook routine. + * dsrec.c (load_srec): Handle cancel from the + ui_load_progress_hook routine. + +Mon Nov 10 15:13:13 1997 Ian Lance Taylor + + * valprint.c (print_longest): The b, h, w, and g format specifiers + print unsigned values. + +Mon Nov 10 02:02:49 1997 Martin M. Hunt + + * top.c (quit_confirm): Change exit message. + +Tue Nov 4 16:52:50 1997 Geoffrey Noer + + * config/i386/cygwin32.mh: because cygwin.dll calls malloc/realloc + to allocate memory for environ space, gdb cannot use memory + checks -- set -DNO_MMCHECK + +Tue Nov 4 13:50:59 1997 Jim Blandy + + * jv-exp.y (ArrayAccess): Implement Name [ Expression ]; check the + code to see why this is not trivial. + (copy_exp, insert_exp): New functions. + +Fri Oct 24 17:24:00 1997 Dawn Perchik + + * dwarf2read.c (dwarf2_build_psymtabs_hard): Handle the case + where a compilation unit die has no children (DW_TAG_compile_unit + has DW_children_no). + (scan_partial_symbols): Add comment for nesting_level. + +Wed Oct 29 15:53:24 1997 David Taylor + + * solib.c (solib_break_names): add entry for Solaris 2.6 run + time linker. From Casper Dik via Peter Schauer. + +Tue Oct 28 17:31:47 1997 Martin M. Hunt + + * configure.in (configdir): Add -lcomdlg32 and -ladvapi32 + to WIN32LIBS. + + * configure: Rebuild + +Fri Oct 24 16:48:21 1997 David Taylor + + * sol-thread.c (sol_find_new_threads_callback, + sol_find_new_threads): New functions. + * config/sparc/nm-sun4sol2.h (FIND_NEW_THREADS): New macro, invoke + sol_find_new_threads. + * thread.c (info_threads_command): invoke FIND_NEW_THREADS if it + is defined. + +Thu Oct 23 16:16:04 1997 Jeff Law (law@fast.cs.utah.edu) + + * dbxread.c (process_one_symbol): Put back initialization + of a variable lost during last change. Don't perform + assignment inside conditionals. + * stabsread.c (symbol_reference_defined): Return -1 for error/not + found. All callers changed appropriately. + (define_symbol): Don't perform assignment inside conditionals. + +Wed Oct 22 13:04:52 1997 Jeffrey A Law (law@cygnus.com) + + * mdebugread.c (psymtab_to_symtab_1): Handle new live range stabs + entries. + + * dbxread.c: More comment cleanups. + * stabsread.c: Fix various violations of the GNU coding and + formatting standards. Update/add comments to make code clearer. + (resolve_reference): Delete unused function. + (ref_search_val): Remove function. It didn't belong in stabsread.c + (resolve_live_range): No longer returns a value. Do not add it + to the live range list until the entire range stab has been parsed. + (get_substring): Remove duplicate declaration. + (resolve_symbol_reference): Now static. Remove unnecessary code + to deal with cleanups. + (ref_add): Use xrealloc instea of realloc. + (process_reference): Reorganize slightly to make clearer. + * stabsread.h (resolve_symbol_reference): Remove declaration. + (resolve_reference): Likewise. + * symtab.c (find_active_alias): New function. + (lookup_block_symbol): Use find_active_alias. + * symtab.h (struct range_list): Fix dangling struct live_range + reference. + (ref_search_val): Remove decl. + + * symtab.h (struct range_list): Renamed from struct live_range. + (struct symbol): Remove struct live_range_info substruct. + Bring the alias list and range list fields up to the toplevel + as "aliases" and "ranges". + (SYMBOL_ALIASES, SYMBOL_RANGES): Corresponding changes. + (SYMBOL_RANGE_START, SYMBOL_RANGE_END, SYMBOL_RANGE_NEXT): Delete. + * stabsread.c: Corresponding changes. + + * dbxread.c: Fix various violations of the GNU coding and + formatting standards. Update/add comments to make code + clearer. + (process_later): Use xrealloc instead of realloc. + + * symtab.c: Include inferior.h. + +Tue Oct 21 14:15:26 1997 Per Bothner + + * ch-exp.c: Rename FIELD_NAME to DOT_FIELD_NAME (to avoid conflict). + +Fri Oct 17 13:22:02 1997 Stan Shebs + + * infcmd.c: Improve grammar of "set args" help. + +Thu Oct 16 15:03:58 1997 Michael Meissner + + * remote-sds.c (sds_load): Properly declare as static. + +Wed Oct 15 10:27:14 1997 Doug Evans + + * config/sparc/tm-sparc.h (FIX_CALL_DUMMY): Mask off displacement + to 30 bits in call insn to handle --enable-64-bit-bfd. + (STORE_STRUCT_RETURN): Change to handle --enable-64-bit-bfd. + +Tue Oct 14 22:13:27 1997 Dawn Perchik + + * stabsread.c: Make ref_map entries dynamically allocated. + +Thu Oct 9 12:37:57 1997 Frank Ch. Eigler + + * printcmd.c (print_address_symbolic, address_info): Mask + target-specific flag bits from PC, for more aesthetic disassembly. + * config/mips/tm-mips.h: Added PC masking for MIPS family + (especially the MIPS16). + +Sat Oct 4 18:45:44 1997 Mark Alexander + + * remote-mips.c (mips-initialize): Work around flakiness in + some versions of PMON after loading a program. + +Fri Oct 3 15:49:18 1997 Per Bothner + + * c-lang.h, cp-valprint.c (static_field_print): Make non-static. + * parse.c, parser-defs.h (length_of_subexp): Make non-static. + * jv-exp.y (FieldAccess): Handle dollar-VARIABLE as primary. + (ArrayAccess): Likewise. Also remove warnings. + (CastExpression): Implement (typename) UnaryExpression. + (push_qualified_expression_name): Fix small bug. + * jv-lang.c: Use TYPE_TAG_NAME, not TYPE_NAME for class names. + (_initialize_jave_language): Fix typo (jave -> java). + (java_language): Java does *not* have C-style arrays. + (java_class_from_object): Make more general (and complicated). + (java_link_class_type): Fix typo "super" -> "class". Handle arrays. + (java_emit_char, java_printchar): New function. + (evaluate_subexp_java case BINOP_SUBSCRIPT): Handle Java arrays. + * jv-valprint.c (java_value_print): Implement printing of Java arrays. + (java_print_value_fields): New function. + (java_val_print): Better printing of TYPE_CODE_CHAR, TYPE_CODE_STRUCT. + +Fri Oct 3 09:52:26 1997 Mark Alexander + + * config/mips/tm-mips.h (MAKE_MSYMBOL_SPECIAL): Force MIPS16 + addresses to be odd. + (MIPS_FPU_SINGLE_REGSIZE, MIPS_FPU_DOUBLE_REGSIZE): Define. + * mips-tdep.c (mips_extract_return_value): Doubles aren't + returned in FP0 if FP registers are single-precision only. + +Mon Sep 29 23:03:03 1997 Mark Alexander + + * mips-tdep.c (set_reg_offset): New function. + (mips16_heuristic_proc_desc): Calculate offsets of registers + saved by entry pseudo-op after rest of prologue has been read. + Use set_reg_offset to ignore all but the first save of a given + register. + (mips32_heuristic_proc_desc): Initialize frame adjustment value. + * remote-sim.c (gdbsim_store_register): Don't update registers + that have a null or empty name. + * findvar.c (read_register_bytes): Don't fetch registers + that have a null or empty name. + +Tue Sep 30 13:35:54 1997 Andrew Cagney + + * config/mips/tm-mips.h (NUM_REGS): Define conditionally. + (REGISTER_NAMES): Ditto. + +Fri Sep 26 21:08:22 1997 Keith Seitz + + * dsrec.c (load_srec): add ui_load_progress_hook to + display some feedback to user + + * symfile.c (generic_load): add ui_load_progress_hook to + display some feedback to user + +Fri Sep 26 17:32:22 1997 Jason Molenda (crash@pern.cygnus.com) + + * command.c (add_cmd, add_show_from_set): Insert new commands in + alphabetical order. + +Fri Sep 26 12:22:00 1997 Mark Alexander + + * config/mips-tm-mips.h (mips_extra_func_info): New frame_adjust + member for storing offset of MIPS16 frame pointer from SP. + * mips-tdep.c: Use RA_REGNUM instead of hardcoded 31 throughout. + (PROC_FRAME_ADJUST): Define. + (mips16_heuristic_proc_desc): Store frame pointer adjustment value. + (get_frame_pointer): Use frame pointer adjustment value when + calculating frame address. + * remote-sim.c (gdbsim_fetch_register): Don't fetch registers + that have a null or empty name. + +Fri Sep 26 12:40:51 1997 Jeffrey A Law (law@cygnus.com) + + * mips-tdep.c (_initialize_mips_tdep): Allow target files to + override default FPU type. + +Fri Sep 26 10:33:54 1997 Felix Lee + + * configure.tgt (v850-*-*): necmsg.lib instead of v850.lib. + +Wed Sep 24 14:02:09 1997 Andrew Cagney + + * config/v850/tm-v850.h (BREAKPOINT): Use 1 word DIVH insn with + RRRRR=0 for simulator breakpoint. Previous breakpoint insn was two + words. + +Thu Sep 18 15:07:46 1997 Andrew Cagney + + * ser-e7kpc.c (get_ds_base): Only use under Windows. + (windows.h): Include when any _WIN32 host. + +Wed Sep 24 18:12:47 1997 Stu Grossman + + * The following block of changes add support for debugging assembly + source files. + * breakpoint.c (resolve_sal_pc): Prevent crash when pc isn't + associated with a function. + * buildsym.c (record_line start_symtab end_symtab): Don't delete + symtabs which only have line numbers (but no other debug symbols). + * dbxread.c (read_dbx_symtab end_psymtab): Ditto. + + * remote-sim.c: New functions gdbsim_insert/remove_breakpoint. Use + intrinsic simulator breakpoints if available, otherwise do it the + hard way. + + * configure.tgt: Add d30v. + * d30v-tdep.c: New file. + * config/d30v/d30v.mt, config/d30v/tm-d30v.h: New files. + +Tue Sep 23 11:24:13 1997 Stan Shebs + + * Makefile.in (ALLCONFIG): Remove, inaccurate and never used. + +Tue Sep 23 00:08:18 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * mips-tdep.c (mips_push_arguments): Tweak alignment of register + value if the remaining length of a non-integral argument is smaller + than the register size for big-endian non-EABI mode. + + * rs6000-tdep.c (branch_dest): Handle return from signal + handler function via sigreturn kernel call. + +Mon Sep 22 15:32:06 1997 Dawn Perchik + + * stabsread.h, symtab.h, dbxread.c, symtab.c, stabsread.c: + Fix prototypes. Remove function scoped function declarations. + +Fri Sep 19 18:51:26 1997 Felix Lee + + * config/i386/windows.mh (XDEPFILES): need to list some files + explicitly, for odd reasons. + +Tue Sep 16 20:00:05 1997 Per Bothner + + * jv-exp.y (push_fieldnames): New, to handle EXP.FIELD1....FIELDN. + (push_expression_name): New, to handle expression names. + (push_qualified_expression_name): New, for qualified expression names. + (parse_number): Fix bugs in parsing of non-decimal integers. + * jv-lang.h, jv-lang.c (java_demangle_type_signature): New. + * jv-lang.c (type_from_class): Just use name with java_lookup_class. + (java_link_class_type): Add dummy "class" field. + (java_lookup_type): New. + (evaluate_subexp_java case STRUCTOP_STRUCT): Force to address. + * jv-typeprint.c (java_type_print_base): Don't print "class" field. + Use java_demangle_type_signature to print array class types. + * jv-valprint.c (java_value_print): Preliminary array support. + Print pointer as TYPE@HEXADDR, instead of (TYPE)0xHEXADDR. + (java_val_print): Move check for object type to java_value_print. + Check for null. Print pointer as @HEXADDR, not 0xHEXADDR. + + * valops.c (search_struct_field): Search basesclasses in + ascending, not descending order. Hack to avoid virtual baseclass + botch for Java interfaces. + +Tue Sep 16 19:56:23 1997 Per Bothner + + * util.c (run_cleanup_chain, make_run_cleanup, do_run_cleanups): + New cleanup clean for cleanups to be run when at each 'run' command. + * infcmd.c (run_command): Call do_run_cleanups. + + * solib.c (find_solib): Register cleanup to call clear_solib + on a new 'run' command. + (symbol_add_stub): First look for existing objfile with same name. + +Tue Sep 16 16:00:01 1997 Stan Shebs + + * remote-sds.c (sds_load): New function. + (sds_ops): Use it. + (sds_open): Don't set inferior_pid yet. + (sds_kill): Remove contents. + (sds_create_inferior): Rewrite to work more like monitor + interfaces. + (sds_restart): Remove, no longer used. + + * monitor.h (MO_SREC_ACK_PLUS, MO_SREC_ACK_ROTATE): New flags. + * monitor.c (monitor_wait_srec_ack): Add DINK32-specific ack code. + * dsrec.c (load_srec): Always write a header S-record. + * dink32-rom.c (dink32_regnames): Fix the names of float registers. + (dink32_cmds): Set to use S-record downloading with acks. + * remote-est.c (est_cmds): Add MO_SREC_ACK_PLUS flag. + +Tue Sep 16 10:08:27 1997 Andrew Cagney + + * config/v850/tm-v850.h (BREAKPOINT): Set to a truely illegal + instruction. + + * exec.c (exec_file_command): Call set_architecture_from_file. + +Mon Sep 15 13:01:22 1997 Mark Alexander + + * dbxread.c (MSYMBOL_SIZE): New macro. + (end_psymtab): Use MSYMBOL_SIZE to extract size from minimal symbol. + * elfread.c (elf_symtab_read): If ELF symbol is "special", + such as a MIPS16 function, mark minimal symbol as special too. + * mips-tdep.c (pc_is_mips16): New function to check whether + a function is MIPS16 by looking at the minimal symbol. Use + pc_is_mips16 throughout instead of IS_MIPS16_ADDR macro. + * config/mips/tm-mips.h (SYMBOL_IS_SPECIAL, MAKE_MSYMBOL_SPECIAL, + MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): New functions for setting/testing + "special" MIPS16 bit in ELF and minimal symbols. + * mdebugread.c (parse_partial_symbols): Don't construct a partial + symbol table for a file that already has one. + +Sat Sep 13 08:32:13 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * mdebugread.c (parse_symbol, handle_psymbol_enumerators): Handle + yet another variant of enumerator debugging info, used by DU 4.0 + native cc. + +Tue Sep 9 20:47:23 1997 Felix Lee + + * config/i386/windows.mh (XDEPFILES): reduce to libwingdb.a. + otherwise link command line is too long. + +Tue Sep 9 17:41:41 1997 Jeffrey A Law (law@cygnus.com) + + * symtab.c, dbxread.c, stabsread.c: Fix up ANSI-C isms. Fix + some formatting problems. + +Mon Sep 8 16:45:51 1997 Stu Grossman + + * ser-e7kpc.c: Don't include w32sut.h. We no longer use the UT + mechanism. Remove prototypes for dos_async_* functions. They don't + exist anymore. + +Mon Sep 8 12:48:50 1997 Ian Lance Taylor + + * top.c (quit_confirm, quit_force): New functions, broken out of + quit_command. + (quit_command): Just call quit_confirm and quit_force. + * top.h (quit_confirm, quit_force): Declare. + +Sun Sep 7 17:26:30 1997 Dawn Perchik + + * dbxread.c, buildsym.c, symtab.c, stabsread.c: Add support for + reading stabs extensions for live range information. + * stabsread.h, partial-stab.h: Add prototypes for new functions. + * symtab.h: Add structure for storing live range information. + +Wed Sep 3 16:39:39 1997 Andrew Cagney + + * top.c (set_arch): New function, update target_architecture. + + * defs.h, top.c (set_architecture_from_arch_mach): Replace + set_architecture, takes the arch and machine as arguments. + + * sh3-rom.c (sh3e_open): Update. + (sh3_open): Ditto. + +Tue Sep 2 12:00:46 1997 Andrew Cagney + + * remote-e7000.c (e7000_fetch_registers): Fix typo, stray paren. + (e7000_wait): Ditto. + +Mon Sep 1 11:21:03 1997 Andrew Cagney + + * top.c (init_main): Add ``set processor'' as an alias for ``set + architecture''. + +Sat Aug 30 13:44:48 1997 Bob Manson + + * config/sparc/sparclite.mt: Removed simulator references (erc32 + has been disabled). + +Thu Aug 28 10:20:04 1997 Andrew Cagney + + * remote-e7000.c (e7000_fetch_registers): Check + target_architecture instead of sh_processor_type. + (e7000_wait): Ditto. + + * config/sh/tm-sh.h (sh_set_processor_type): Delete prototype. + + * sh3-rom.c (sh3_open): Call set_architecture not + sh_set_processor_type. + (sh3e_open): Ditto. + + * sh-tdep.c (sh_show_processor_type_command): Delete. + (sh_set_processor_type_command): Delete. + (sh_target_architecture_hook): Rename from sh_set_processor_type, + use AP to determine architecture. + (sh_show_regs): Use bfd_mach_sh* types. + + * remote-sim.c (gdbsim_open): Pass --arch=XXX to simulator when + architecture was specified explicitly. + + * defs.h (target_architecture, target_architecture_auto, + set_architecture, set_architecture_from_file): Declare. + (target_architecture_hook): Allow targets to be notified of set + arch commands. + + * top.c (init_main): Add set/show/info architecture commands. + (set_architecture, show_architecture, info_architecture): New + functions, parse same. + (set_architecture_from_file): New function, determine arch from + BFD. + +Tue Aug 26 17:13:43 1997 Andrew Cagney + + * remote-sim.c (gdbsim_open): Only pass endianness to sim_open + when set explicitly. Prepend endianness arg so that it can be + overridden. + + * defs.h, top.c (target_byte_order_auto): Make global when + byteorder is selectable. + +Tue Aug 26 15:19:56 1997 Andrew Cagney + + * remote-sim.c (gdbsim_create_inferior): Pass exec_bfd into + sim_create_inferior. + (gdbsim_create_inferior): Pass -1 to proceed, sim_create_inferior + has already set the PC. + (gdbsim_create_inferior): Allow exec_file to be NULL, make "No + exec file" a warning. Ditto for "No program loaded". + +Mon Aug 25 17:08:01 1997 Geoffrey Noer + + * ocd.c: revert Sun change -- enable log file handling + +Mon Aug 25 12:21:46 1997 Andrew Cagney + + * remote-sim.c (gdbsim_open): Pass exec_bfd to sim_open call. + +Sun Aug 24 21:16:59 1997 Geoffrey Noer + + * ocd.c: comment out sections that create and flush wigglers.log + log file when using the wiggler. + +Thu Aug 21 16:18:08 1997 Geoffrey Noer + + * config/powerpc/ppc-eabi.mt: + * config/powerpc/ppc-sim.mt: + * config/powerpc/ppcle-eabi.mt: + * config/powerpc/ppcle-sim.mt: ser-ocd.c needs to be before + other ocd-related files in TDEPFILES + +Thu Aug 21 14:56:04 1997 Geoffrey Noer + + * ppc-bdm.c (bdm_ppc_wait): stop printfing ecr, der + * ocd.c: initialize remote_timeout + (ocd_wait): while looping, call ocd_do_command with OCD_AYT + (ocd_get_packet): remove find_packet goto. If there isn't + an 0x55 at the start, something is quite wrong so error out + instead of advancing in the packet and trying again. If checksum + is invalid, print error message instead of trying again. + * ser-ocd.c (ocd_readchar): error if we attempt to read past + the end of the from_wiggler_buffer. + + +Wed Aug 20 14:08:39 1997 Stan Shebs + + * dink32-rom.c: Don't use "mf" command to fill, is too picky + about alignment. + + +Tue Aug 19 08:41:36 1997 Fred Fish + + * objfiles.c (objfile_relocate): Add call to breakpoint_re_set + after relocations are complete. + * remote-vx.c (vx_add_symbols): Remove call to breakpoint_re_set, + this is now done in objfile_relocate. + +Mon Aug 18 17:29:54 1997 Ian Lance Taylor + + * win32-nat.c (handle_exception): Return a value indicating + whether the exception was handled. Don't handle random exceptions + the first time around, so that structured exception handling + works. + (child_wait): Check the return value of handle_exception. Set the + continue_status argument to ContinueDebugEvent accordingly. + +Mon Aug 18 11:14:15 1997 Nick Clifton + + * configure.tgt: Add support for v850ea target. + +Sun Aug 17 20:31:57 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * m32r-stub.c: fix typo + +Sun Aug 17 17:33:34 1997 Stan Shebs + + * remote-sds.c: Remove unused remnants of remote.c. + (tob64): Return the result length. + (sds_interrupt): Send a stop message. + (sds_wait): Add debug output for signal interpretation, flag + that signal was due to a trap. + (sds_fetch_registers): Fill the registers array correctly for + PowerPC. + (sds_store_registers): Get the right values from registers array. + (putmessage): Tweak length handling so checksum comes out right. + (sds_insert_breakpoint, sds_remove_breakpoint): Do correctly. + +Fri Aug 15 20:53:13 1997 Ian Lance Taylor + + * Makefile.in (init.c): Don't use xargs. + +Fri Aug 15 13:59:37 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * infrun.c (wait_for_inferior): Add the symbols for any + newly loaded objects upon a TARGET_WAITKIND_LOADED event. + + Rewrite code which determines the TOC address for calling functions + in the inferior under AIX. + * rs6000-nat.c (find_toc_address): New function to determine + the required TOC address from a function address. + (_initialize_core_rs6000): Set up find_toc_address_hook to point + to find_toc_address. + (xcoff_relocate_symtab, xcoff_relocate_core): Remove + add_text_to_loadinfo calls. + (exec_one_dummy_insn): Change pid and status to int to get rid of + compiler warnings. + (xcoff_relocate_symtab): Cast ldi to `int *' when passing it to + ptrace to get rid of compiler warnings. + * rs6000-tdep.c: Add definition for find_toc_address_hook. + (rs6000_fix_call_dummy): If find_toc_address_hook is non zero, + patch TOC address load code in the call dummy with the value + returned from find_toc_address_hook. + (struct loadinfo, loadinfo, loadinfolen, + loadinfotextindex, xcoff_init_loadinfo, free_loadinfo, + xcoff_add_toc_to_loadinfo, add_text_to_loadinfo, find_toc_address): + Remove. + (_initialize_rs6000_tdep): Remove initialization of + coff_add_toc_to_loadinfo_hook and xcoff_init_loadinfo_hook. + * xcoffread.c (coff_add_toc_to_loadinfo_hook, + xcoff_init_loadinfo_hook): Remove. + (struct coff_symfile_info): Add toc_offset field. + (scan_xcoff_symtab): Record toc_offset value in toc_offset field + instead of calling xcoff_add_toc_to_loadinfo_hook. + (get_toc_offset): New function to return the value of the + toc_offset field for an object file. + (xcoff_initial_scan): Remove call of xcoff_init_loadinfo_hook. + * xcoffsolib.h (add_text_to_loadinfo): Remove declaration. + * config/rs6000/tm-rs6000.h: Add declarations for + find_toc_address_hook and get_toc_offset. + +Wed Aug 13 19:31:28 1997 Stan Shebs + + * remote-sds.c: New file, interface to SDS-compatible monitors. + * Makefile.in (remote-sds.o): Add build rule. + * config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt + (TDEPFILES): Add remote-sds.o. + +Tue Aug 12 14:37:18 1997 Geoffrey Noer + + * ocd.c (ocd_wait): loop until we're in BDM mode instead of + assuming control has returned to GDB. + +Mon Aug 11 19:16:04 1997 Stan Shebs + + * dink32-rom.c: New file, support for DINK32 monitor. + * Makefile.in (dink32-rom.o): Add build rule. + * config/powerpc/ppc-eabi.mt, config/powerpc/ppc-sim.mt + (TDEPFILES): Add dink32-rom.o. + * monitor.h (MO_32_REGS_PAIRED, MO_SETREG_INTERACTIVE, + MO_SETMEM_INTERACTIVE, MO_GETMEM_16_BOUNDARY, + MO_CLR_BREAK_1_BASED): New monitor interface flags. + * monitor.c: Use them. + (monitor_store_register): Use setreg.term if defined. + (monitor_insert_breakpoint, monitor_remove_breakpoint): Notice + if set_break and clr_break fields are empty. + +Mon Aug 11 16:22:36 1997 Geoffrey Noer + + * ocd.c (ocd_insert_breakpoint, ocd_remove_breakpoint): Macro + BDM_BREAKPOINT already has braces around it, remove erroneous ones. + * ser-ocd.c (ocd_write): Conditionalize on _WIN32 instead of + __CYGWIN32__. + * config/powerpc/tm-ppc-eabi.h: Remove BDM_NUM_REGS, BDM_REGMAP + * ppc-bdm.c: move BDM_NUM_REGS, BDM_REGMAP here from tm.h file, + fill in doc fields of bdm_ppc_ops. + (bdm_ppc_fetch_registers): Don't ask for invalid registers such + as the MQ or floating point regs not present on ppc 8xx boards. + (bdm_ppc_store_registers): Don't write those same invalid registers. + * config/i386/cygwin32.mh: Stop including ocd.o ser-ocd.o. + * config/powerpc/ppc-eabi.mt: + * config/powerpc/ppcle-eabi.mt: + * config/powerpc/ppc-sim.mt: + * config/powerpc/ppcle-sim.mt: Include ser-ocd.o. + +Mon Aug 11 16:08:52 1997 Fred Fish + + * frame.h (enum lval_type): Conditionalize on __GNUC__ + instead of __STDC__. + +Sun Aug 10 19:08:26 1997 Jeffrey A Law (law@cygnus.com) + + * utils.c (error): Fix return type for !ANSI_PROTOTYPES. + +Sun Aug 10 16:49:09 1997 Geoffrey Noer + + * ocd.c: move ocd_write_bytes proto to ocd.h since it is used + by ppc-bdm.c, use OCD_LOG_FILE to help debugging, define + BDM_BREAKPOINT if not defined in tm.h + (ocd_error): add new error cases + (ocd_start_remote): send the OCD_INIT command before + OCD_AYT and OCD_GET_VERSION calls, 80 was correct speed after all + (ocd_write_bytes): no longer static + (ocd_insert_breakpoint): no longer static + (ocd_remove_breakpoint): new + * ocd.h: add protos for ocd_write_bytes, ocd_insert_breakpoint, + and ocd_remove_breakpoint + * ppc-bdm.c: change bdm_ppc_ops so we call ocd_insert_breakpoint + and ocd_remove_breakpoint instead of memory_insert_breakpoint + and memory_remove_breakpoint. + (bdm_ppc_open): after calling ocd_open, modify DER + register so interrupts will drop us into debugging mode, finally + disable the watchdog timer on the board so we don't leave BDM + mode unexpectedly. + +Sat Aug 9 01:50:14 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * values.c (value_primitive_field): Account for offset when + extracting the value of a bitfield. + From Paul Hilfinger . + +Fri Aug 8 21:35:44 1997 Mark Alexander + + * gdbserver/utils.c (error): Change prototype to match defs.h. + * gdbserver/low-sim.c: Change simulator calls to use new interface. + * remote.c (remote_write_bytes): Include '$' at start of packet + and checksum at end of packet in overhead calculation. + +Fri Aug 8 15:59:24 1997 Ian Lance Taylor + + * ser-ocd.c: If _WIN32, include . + (dll_do_command): New static variable if _WIN32. + (ocd_open): Set dll_do_command if _WIN32. + (ocd_write): Use dll_do_command rather than do_command. + * config/i386/cygwin32.mh (XDEPFILES): Remove libwigglers.a. + (BDM_DLLNAME, BDM_LIBNAME, BDM_DEFFILE): Don't define. + ($(BDM_LIBNAME)): Remove target. + * wigglers.def: Remove. + + * config/i386/cygwin32.mh ($(BDM_LIBNAME)): Rename target from + libwigglers.def. + (libwigglers.a): Remove target. + +Fri Aug 8 13:11:01 1997 Mike Meissner + + * config/powerpc/ppc{,le}-{eabi,sim}.mt (TDEPFILES): Make sure + ppc-bdm.o and ocd.o are used for all powerpc-eabi targets. + +Thu Aug 7 19:40:52 1997 Geoffrey Noer + + Changes to OCD support to support wiggler box as well as + target boxes: + * ocd.c: change speed in init command to 0 from 80, + add (temporary) logging commands to help debugging, + (ocd_open): if "target ocd wiggler lpt" then use special + ser-ocd.c serial interface which communicates with Wigglers.dll, + otherwise ("target ocd ") do as we did before + (ocd_get_packet): add OCD_LOG_FILE and OCD_SET_CONNECTION to + switch of known commands of len 0 + * ocd.h: add OCD_LOG_FILE + * serial.c (serial_open): do serial_interface_lookup on ocd + in the case of ocd + * ser-ocd.c: add buffer to contain responses from sending a + command to the Wigglers.dll. + (ocd_readchar): return curr char from buffer and increment ptr + (ocd_write): send buffer to Wigglers.dll, storing response in + return buffer and initializing curr location ptr to start of + buffer. + +Thu Aug 7 13:39:31 1997 Geoffrey Noer + + * ocd.h: add OCD_SET_CONNECTION + * ocd.c: rename "do_command" to "ocd_do_command" + +Thu Aug 7 13:09:17 1997 Geoffrey Noer + + Nomenclature change. BDM is a specific type of OCD + (On Chip Debugging). Wiggler is the parallel port box controlled + by Wigglers.dll. The faster target box from Macraigor Systems + is not a wiggler. + * ocd.c: + * ocd.h: + * ppc-bdm.c: + * ser-ocd.c: + Replace all instances of "wiggler_" with "ocd_" and change most other + instances of "wiggler" to "ocd" or "ocd device" depending on context. + * config/m68k/monitor.mt: remove remote-wiggler.o from TDEPFILES + until OCD with that target is supported again. + +Wed Aug 6 16:15:31 1997 Geoffrey Noer + + * Makefile.in: add DLLTOOL = @DLLTOOL@, pass on DLLTOOL to + sub makes, change clean rule to also remove *.a to remove + libwigglers.a, in dependencies: add ppc-bdm.o ocd.o ser-ocd.o and + remove remote-wiggler.o + * configure.in: add DLLTOOL support + * configure: regenerate + * wigglers.def: new file for imports for wigglers.dll + * ser-ocd.c: new file which is layer between ocd.c and either the + wigglers.dll or the target box, only stub so far + * config/powerpc/ppc-eabi.mt: add ppc-bdm.o to TDEPFILES + * config/powerpc/ppc-sim.mt: add ppc-bdm.o to TDEPFILES + * config/i386/cygwin32.mh: add ocd.o ser-ocd.o libwigglers.a + to XDEPFILES, add rules to build libwigglers.a + + checking in changes of Stu Grossman : + * remote-wiggler.c: delete + * ocd.c: new, was remote-wiggler.c + always include sys/types.h, include ocd.h, move WIGGLER + commands and many wiggler prototypes to ocd.h, make wiggler_desc + static, stop making local wiggler functions static, + define write_mem_command for wiggler_write_bytes + (wiggler_start_remote): stop hardcoding the target type, + instead set and use a target_type variable. + (wiggler_open): add new target_type and ops args + (wiggler_wait): now no longer takes pid and target_status as args, + stop trying to set target_status struct, remove BGND insn + checks + (read_bdm_registers): renamed to wiggler_read_bdm_registers + (wiggler_read_bdm_registers): numregs arg changed to reglen arg, + remove pktlen check, set reglen instead of numregs + (dump_all_bdm_regs): delete + (wiggler_fetch_registers): delete + (wiggler_prepare_to_store): now just an empty function + (wiggler_store_registers): delete + (wiggler_read_bdm_register): new + (wiggler_write_bdm_registers): new + (wiggler_write_bdm_register): new + (wiggler_write_bytes): use write_mem_command variable instead of + WIGGLER_WRITE_MEM + (get_packet): renamed to wiggler_get_packet, change refs throughout + (put_packet): renamed to wiggler_put_packet, change refs throughout + (wiggler_get_packet): add break to default case of switch, + change length of WIGGLER_GET_VERSION len to 10 from 4 to match + specs + (wiggler_mourn): unpush_target with current_ops, not &wiggler_ops + (flash_xfer_memory): delete + (noop_store_registers): new placeholder replacement for + target_store_registers() which prevents generic_load from trying to + set up the PC. + (bdm_update_flash_command): add store_registers_tmp variable, + make handling of wiggler_ops more generic -- define wiggler_ops + in a target-specific file instead (such as ppc-bdm.c in the case + of the ppc), use current_target to deal with registers again + making this file less target-specific. + (bdm_read_register_command): new + (_initialize_remote_wiggler): stop doing add_target (&wiggler_ops), + comment out add_cmd ("read-register", ...) + * ocd.h: new, contains common wiggler prototypes, command definitions + * ppc-bdm.c: file for ppc-specific OCD code, including target_ops + structure for ppc bdm + (bdm_ppc_open): new + (bdm_ppc_wait): new + (bdm_ppc_fetch_registers): new + (bdm_ppc_store_registers_: new + (_initialize_bdm_ppc): new + * config/powerpc/tm-ppc-eabi.h: add necessary CPU32 BDM defines + +Wed Aug 6 00:24:08 1997 Jeffrey A Law (law@cygnus.com) + + * hpread.c (hpread_read_struct_type): Use accessor macros rather + than directly mucking around with data structures. + +Tue Aug 5 13:37:14 1997 Per Bothner + + * gdbtypes.h: Re-interpret struct field. Suppport address of static. + Add a bunch of macros. + * coffread.c, dwarf2read.c, dwarfread.c, mdebugread.c, stabsread.c: + Update to use new macros. + * coffread.c, hpread.c, stabsread.c: Remove bugus TYPE_FIELD_VALUE. + * value.h, values.c (value_static_field): New function. + * cp-valprint.c, valops.c: Modify to use value_static_field. + + * jv-lang.c (get_java_utf8_name): Re-write so it works with + implied (missing) data field, as defined by cc1java. + (java_link_class_type): Type length and field offset (in interior) + now includes object header. Get static fields working. + * jv-lang.h (JAVA_OBJECT_SIZE): Update for change in Kaffe. + * jv-typeprint.c (java_type_print_derivation_info, + java_type_print_base): New functions, for better Java output. + * jv-valprint.c: Start to support Java-specific output. + +Sun Aug 3 08:18:09 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * c-valprint.c (c_val_print): Use extract_address to retrieve + the address of the virtual function. + From Peter Bloecher (Peter.Bloecher@eedn.ericsson.se). + + * eval.c (evaluate_subexp_standard), valarith.c (value_x_unop): + Handle C++ operator *. + +Fri Aug 1 15:21:44 1997 Ian Lance Taylor + + * configure.in: Check for cygwin32 environment. Define and + substitute WIN32LIBS and WIN32LDAPP. Always set configdir to + unix; setting it to win was for an old Tcl/Tk configuration + scheme. + * Makefile.in (TK_CFLAGS): Add @TK_BUILD_INCLUDES@. + (WIN32LDAPP, WIN32LIBS): Define. + (CLIBS): Add $(WIN32LIBS). + (gdb): Use $(WIN32LDAPP). + * configure: Rebuild. + +Thu Jul 31 15:40:19 1997 Per Bothner + + * symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC, SYMBOL_INIT_DEMANGLED_NAME, + SYMBOL_DEMANGLED_NAME): Add demangling support for Java. + * utils.c (fprintf_symbol_filtered): Handle language_java. + + * symtab.c (decode_line_1): Handle Java-style package.class.method. + +Wed Jul 30 14:04:18 1997 Per Bothner + + * java-*: Renamed to jv-*, to make fit within 14 characters. + * jv-lang.h (java_type_print): Added declaration. + * jv-typeprint.c: New file. Provides java_print_type. + * jv-lang.c (java_link_class_type): New function. + (java_language_defn): Replace c_print_type by java_print_type. + * Makefile.in: Update accordingly. + +Tue Jul 29 10:12:44 1997 Felix Lee + + * Makefile.in (init.c): except some mswin files do need to be + scanned. oh well. + +Mon Jul 28 14:04:39 1997 Felix Lee + + * Makefile.in (init.c): don't try to scan mswin for _initialize + funcs. (generates misleading error message because files have + .cpp suffix, not .c suffix) + +Mon Jul 28 13:27:21 1997 Felix Lee + + * ser-e7kpc.c: -> "mswin/w32sut.h" + +Mon Jul 28 02:54:31 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * xcoffread.c (coff_getfilename): Do not strip directory component + of filename. + +Fri Jul 25 15:16:15 1997 Felix Lee + + * mon960-rom.c: removed unused #includes; no ioctl.h in Windows. + * nindy-share/ttyflush.c: find sleep() for _MSC_VER. + * remote-array.c: #include for isascii(). + * utils.c (notice_quit,pollquit): cleanup. _WIN32 -> _MSC_VER. + +Fri Jul 25 16:48:18 1997 Jeffrey A Law (law@cygnus.com) + + * top.c (execute_command): Force cleanup of alloca areas. + * findvar.c (registers_changed): Likewise. + +Fri Jul 25 15:37:15 1997 Stu Grossman + + * v850ice.c: Include . Support new v850 DLL interface. + * Add defs for target status. + +Tue Jul 22 12:11:48 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * config/mips/tm-mips64.h: longs, long longs, and pointers + are all 64 bits on EABI mips targets. + +Thu Jul 17 11:38:46 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * partial-stab.h (case N_BINCL): detect missing partial symtab. + * dbxread.c: Add a complaint for N_BINCL without a corresponding + partial symtab. Remove earlier change of 5/27/97. + +Wed Jul 16 10:38:03 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * sol-thread.c (sol_thread_[store, fetch]_registers): if + inferior_pid is an LWP rather than a Solaris thread, let + procfs handle the request. + (rw_common, sol_thread_xfer_memory): procfs_xfer_memory will + only work if inferior_pid points to an LWP (rather than a + Solaris thread). Use procfs_first_available to find a good LWP. + (info_solthreads): added a maintenance command to list all + known Solaris threads and their attributes. + * mips-tdep.c (mips_do_registers_info): Completely changed the + output format to be neat and columnar. Added the helper funcs + do_fp_register_row and do_gp_register_row. Also small mods to + mips_print_register, which is still used to print a single reg. + +Mon Jul 14 18:02:53 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * procfs.c (wait_fd): Handle an fd that has "hung up" or + otherwise terminated (Solaris threads). + +Thu Jul 10 00:02:41 1997 Martin M. Hunt + + * defs.h (init_ui_hook): Change prototype to accept one arg. + * main.c (gdb_init): Change prototype to accept one arg. + * top.c (gdb_init): Accepts one argument which it uses to + call (*init_ui_hook). + +Fri Jul 4 14:49:33 1997 Ian Lance Taylor + + * source.c (OPEN_MODE, FDOPEN_MODE): Define; value depends upon + whether CRLF_SOURCE_FILES is defined. + (open_source_file): Use OPEN_MODE with open and openp. + (print_source_lines): Use FDOPEN_MODE with fdopen. If + CRLF_SOURCE_FILES is defined, ignore \r characters. + (forward_search_command): Use FDOPEN_MODE with fdopen. + (reverse_search_command): Likewise. + * config/i386/xm-cygwin32.h (CRLF_SOURCE_FILES): Define. + (LSEEK_NOT_LINEAR): Don't define. + +Thu Jul 3 17:41:46 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * mips-tdep.c (mips_extract_return_value): align 4-byte float + return values within the 8-byte FP register. + +Thu Jul 3 13:48:11 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * mips-tdep.c (mips_push_arguments): don't left-adjust 32-bit + integers in 64-bit register parameters before function calls. + +Mon Jun 30 17:54:51 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * mips-tdep.c (mips_push_arguments): special-case handling for + odd-sized struct parameters passed in registers / on stack. + +Mon Jun 30 15:30:38 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * mips-tdep.c (mips_push_arguments): tweak alignment of small + structs passed in registers for little-endian non-EABI mode. + +Mon Jun 30 13:05:39 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * breakpoint.c (frame_in_dummy): use generic dummy if available. + (check_duplicates, clear_command): compare sections only if + doing overlay debugging. + +Fri Jun 27 23:03:53 1997 Fred Fish + + * buildsym.h (struct subfile): Add debugformat member. + (record_debugformat): Declare global function. + * buildsym.c (start_subfile): Initialize debugformat member + to NULL. + (record_debugformat): New function to record the format. + (end_symtab): Copy format into symtab debugformat member. + (end_symtab): Free subfile debugformat member. + * symmisc.c (free_symtab): Free debugformat when freeing + symtab. + * symfile.c (allocate_symtab): Initialize the new debugformat + member for new symtabs. + * symtab.h (struct symtab): Add debugformat member. + * source.c (source_info): Print the debug format. + + * os9kread.c (os9k_process_one_symbol): Call record_debugformat + with "OS9". + * hpread.c (hpread_expand_symtab): Call record_debugformat + with "HP". + (hpread_process_one_debug_symbol): Ditto. + * dbxread.c (process_one_symbol): Call record_debugformat + with "stabs". + * coffread.c (coff_start_symtab): Call record_debugformat + with "COFF". + * xcoffread.c (read_xcoff_symtab): Call record_debugformat + with "XCOFF". + * dwarfread.c (read_file_scope): Call record_debugformat + with "DWARF 1". + * dwarf2read.c (read_file_scope): Call record_debugformat + with "DWARF 2". + * dstread.c (dst_end_symtab): Set debugformat to be + "Apollo DST". + * mdebugread.c (new_symtab): Set debugformat to be "ECOFF". + +Fri Jun 27 21:05:45 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * mips-tdep.c (mips_push_arguments): handle alignment of + integer and struct args on stack for mips64 big-endian. + +Fri Jun 27 19:19:12 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * config/mips/tm-mips.h (USE_STRUCT_CONVENTION): MIPS_EABI returns + structs in a register wherever possible. + * mips-tdep.c (mips_extract_return_value): handle structs. + (mips_store_return_value): handle values smaller than MIPS_REGSIZE + (including structs, if gdb ever allows it). + +Fri Jun 20 17:58:34 1997 Fred Fish + + * sh-tdep.c (sh_skip_prologue): Also recognize fmov insns. + (sh_frame_find_saved_regs): Recognize fmov insns and adjust + stack push count accordingly. + * sh-tdep.c (IS_FMOV, FPSCR_SZ): New defines + +Thu Jun 19 08:18:48 1997 Mark Alexander + + * utils.c (floatformat_from_doublest): Improve test for infinity. + +Wed Jun 18 13:47:52 1997 Fred Fish + + * dwarfread.c (isreg, optimized_out, offreg, basereg): Move + global variables into the struct dieinfo structure. + (locval): Pass pointer to a dieinfo struct rather than a + pointer to the raw location information. Change prototype. + Set isreg, optimized_out, offreg and basereg as appropriate. + (struct_type): Call locval with dieinfo struct pointer. + (new_symbol): Ditto. + (new_symbol): Call locval and save location before testing + the values of the new dieinfo struct flags, set by locval. + +Tue Jun 17 13:30:12 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * procfs.c (proc_set_exec_trap, procfs_init_inferior, procfs_wait, + unconditionally_kill_inferior): Undo Oct 26 1996 and Apr 26 1997 + changes to trace PRFS_STOPTERM and handle PR_DEAD. + These changes tried to work around a problem with an early DU 4.0 + release, but they trigger subtle timing dependent kernel bugs + in older OSF/1 releases. + +Tue Jun 17 06:52:47 1997 Fred Fish + + * dwarfread.c (new_symbol): Use SYMBOL_VALUE_ADDRESS, instead of + SYMBOL_VALUE, to set the value of LOC_STATIC symbols. + +Mon Jun 16 18:38:28 1997 Mark Alexander + + * infrun.c (wait_for_inferior): Mark registers as invalid when + stepping over an instruction that triggered a watchpoint. + * remote-mips.c: Numerous changes to support hardware breakpoints + and watchpoints on LSI MiniRISC and TinyRISC boards. + * mips-tdep.c: Move MIPS16-related macros to config/mips/tm-mips.h. + (mips_breakpoint_from_pc): Account for different breakpoint + instructions used by PMON and IDT monitor. + * config/mips/tm-embed.h: Enable hardware breakpoints on embedded + MIPS targets. + * config/mips/tm-mips.h: Define breakpoint instructions for + PMON and IDT monitor. Move MIPS16-related macros here from + mips-tdep.c. + +Fri Jun 13 13:44:47 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * config/mips/tm-tx39[l].h, tx39[l].mt: change r3900 target to tx39. + +Fri Jun 13 14:14:10 1997 Jeffrey A Law (law@cygnus.com) + + * mn10300-tdep.c (mn10300_analyze_prologue): Fix some comments. + Add missing return statements after finding an "add imm{16,32},sp" + instruction. + (mn10300_frame_chain): Add in size of our register save area to find + our caller's frame if our caller does not have a frame pointer. + +Fri Jun 13 12:55:49 1997 Doug Evans + + * symfile.c (generic_load): Check return code of target_write_memory. + +Fri Jun 13 10:28:09 1997 Fred Fish + + * config/i386/nm-linux.h: Enable prototypes that were #ifdef out. + * config/tm-sysv4.h (in_plt_section): Add prototype. + + * maint.c (maintenance_translate_address): Avoid assignment + inside if, per GNU coding standards. + * symfile.c (simple_read_overlay_table): Avoid assignments inside if, + per GNU coding standards. + + * monitor.c (parse_register_dump): Is really a void function. + Add prototype. + (monitor_read_memory): Remove unused variable "name". + (monitor_read_memory): Remove unused variable "regbuf". + (monitor_open): Remove unused variable "i". + (get_hex_word): Apparently unused, #if away for now. + (from_hex): Ditto. + + * i386v4-nat.c (supply_fpregset): Remove unused variable "regi". + (fill_fpregset): Remove unused variables "regi", "to", "from" and + "registers". + + * remote-e7000.c (ctype.h): Include. + (e7000_insert_breakpoint): #if away unused arg used by unused expr. + * frame.h (generic_get_saved_register): Add prototype. + (enum lval_type): Add partial forward decl. + * dsrec.c (make_srec): Remove unused variable "type_code". + * remote-sim.c (gdbsim_wait): Handle sim_running and sim_polling + cases by just ignoring them. + (command.h): Include. + + * java-exp.y (parse_number): Remove unused variable "unsigned_p". + * java-lang.c (gdbcore.h): Include for prototypes. + (type_from_class): Remove unused variable "ftype". + (type_from_class): Remove unused variable "name_length". + (evaluate_subexp_java): Add default case to handle remaining + enumerations. + * java-valprint.c (c-lang.h): Include for prototypes. + + * symfile.c (simple_read_overlay_region_table): #if away + unused function. + (simple_free_overlay_region_table): Ditto. + (overlay_is_mapped): Add default case to switch. + (simple_read_overlay_region_table): Ditto. + (simple_read_overlay_region_table): Add prototype. + + * symtab.c (fixup_symbol_section): Remove unused msym variable. + (fixup_psymbol_section): Ditto. + (find_pc_sect_symtab): Make distance a CORE_ADDR. + + * utils.c: Add comment about t_addr being either unsigned long or + unsigned long long. + (paddr): Change formats to match actual types args are cast to. + (preg): Ditto. + (paddr_nz): Ditto. + (preg_nz): Ditto. + + * defs.h (perror_with_name): Is a NORETURN function. + * utils.c (perror_with_name): Is a NORETURN function. + (error): Is NORETURN independently of ANSI_PROTOTYPES. + + * symtab.c (fixup_symbol_section): Remove prototype. + * symtab.h: (fixup_symbol_section): Add prototype. + * m32r-rom.c (report_transfer_performance): Add prototype. + * sparclet-rom.c: Ditto. + * dsrec.c: Ditto. + + * c-exp.y (parse_number): Cast args to float* or double* as + appropriate for conversion format. + * java-exp.y (parse_number): Ditto. + + * Makefile.in (c-exp.tab.c): Remove #line lines that refer + to nonexistant y.tab.c file. + (java-exp.tab.c): Ditto. + (f-exp.tab.c): Ditto. + (m2-exp.tab.c): Ditto. + + * sh-tdep.c (symfile.h): Include. + (gdb_string.h): Include. + (sh_fix_call_dummy): Ifdef away, currently unused. + * config/sh/tm-sh.h (pop_frame): Add prototype. + * config/sh/tm-sh.h (sh_set_processor_type): Add prototype. + +Sat Jun 7 02:34:19 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * eval.c (evaluate_subexp_for_sizeof): Handle dereferencing + of non-pointer values. + + * symtab.c (gdb_mangle_name): Improve mangling of nested types, + their physical names already include the class name. + + * valops.c (value_cast): Handle upcast of a class pointer. + + From Andreas Schwab (schwab@issan.informatik.uni-dortmund.de): + * corelow.c (get_core_registers): Make secname big enough. + +Fri Jun 6 14:43:23 1997 Keith Seitz + + * config/sh/tm-sh.h: add define for FPSCR_REGNUM + * sh-tdep.c (sh_show_regs): print out all registers for + the current processor + +Fri Jun 6 13:01:55 1997 Andrew Cagney + + * remote-sim.c (gdbsim_kill): Remove call to depreciated function + sim_kill. + +Thu Jun 5 11:39:03 1997 Ian Lance Taylor + + Fixes for recent correction to PE format: + * coffread.c (pe_file): New static variable. + (struct find_targ_sec_arg): Change resultp from pointer to int to + pointer to pointer to asection. + (find_targ_sec): Just store the section in args->resultp, not the + section offset value. + (cs_to_section): Compute the section offset value from the + section. + (cs_section_address): New static function. + (coff_symfile_read): Set pe_file. + (read_one_sym): When reading a PE file, adjust the symbol value to + include the section address if the symbol has an appropriate + storage class. + +Tue Jun 3 16:24:46 1997 Michael Snyder (msnyder@cleaver.cygnus.com) + + * configure.tgt: add mipsr3900-elf target + * config/mips/r3900.mt r3900l.mt tm-r3900.h tm-r3900l.h: ditto + +Tue May 27 10:34:11 1997 Michael Snyder + + * dbxread.c: Check malloc's return for null, prevent segv. + +Fri May 23 14:45:02 1997 Bob Manson + + * infcmd.c (jump_command): Don't try to dereference sfn if it's + NULL. + +Fri May 23 13:51:57 1997 Andrew Cagney + + * top.c (init_cmd_lists): Always initialize endianlist. + (init_main): Always define endian commands. + (set_endian_big): Issue warning if endian not selectable. + (set_endian_little): Ditto. + (set_endian_auto): Ditto. + +Thu May 22 11:53:21 1997 Andrew Cagney + + * remote-sim.c (simulator_command): Restrict access to the + simulator to periods when the simulator is open. + +Wed May 21 16:03:25 1997 Michael Snyder + + * procfs.c (init_procinfo): new function, abstracts some code + shared by create_procinfo and do_attach; + (procfs_set_inferior_syscall_traps): new function, abstracts + some code needed by procfs_init_inferior, do_attach, and + procfs_lwp_creation_handler; (procfs_first_available): new + function, find any LWP that's runnable; (procfs_thread_alive): + replace stub function with real implementation; + (procfs_lwp_creation_handler): fix bug starting new child + threads; (info_proc): bug fixes and enhancements for the + "INFO PROCESSES" command; (close_procinfo_file): call new + function "delete_thread" to cleanup GDB's thread database; + (proc_init_failed): add new argument "kill", to control whether + process is killed (so this function can be shared by + create_procinfo and do_attach); (procfs_exit_handler): handle + exit from an attached process, and cleanup procinfo handles + when the process exits; (procfs_resume, procfs_wait): cleanup + after a thread when it exits; (do_attach, do_detach): handle + attached processes with multiple threads; plus some general + improvements in the diagnostic output. + * sol-thread.c (sol_thread_alive): replace stub with real + implementation; (thread_to_lwp, lwp_to_thread): enhance to + handle threads that may have exited; (sol_thread_attach): add + startup setup stuff; (sol_thread_detach): add unpush_target + call; (sol_thread_mourn_inferior): add unpush_target call; + (sol_thread_wait, sol_thread_resume): enhance to deal with + thread exit cleanly; (sol_thread_new_objfile, + sol_thread_pid_to_str): detect unsuccessful startup and + don't crash; plus some general cleanup. + * thread.c (delete_thread): new function, allows targets to + notify gdb when a thread is no longer valid. + * infrun.c (wait_for_inferior): don't try to detect a new + thread on receiving a TARGET_EXITED event. + +Tue May 20 09:32:02 1997 Andrew Cagney + + * remote-sim.c (gdbsim_open): Pass callback struct. + (init_callbacks): Remove call to sim_set_callbacks. + +Thu May 15 07:56:50 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * config/rs6000/tm-rs6000.h (SIG_FRAME_LR_OFFSET): Define. + * rs6000-tdep.c (frameless_function_invocation): Mark frames + with a zero PC as frameless to improve backtraces from core dumps + caused by dereferencing a NULL function pointer. + (frameless_function_invocation, frame_saved_pc, rs6000_frame_chain): + Handle frameless functions interrupted by a signal. + + * sparc-tdep.c (sparc_init_extra_frame_info, sparc_frame_saved_pc): + Handle frameless functions interrupted by a signal. + +Wed May 14 08:58:55 1997 Jeffrey A Law (law@cygnus.com) + + * mn10200-tdep.c (mn10200_analyze_prologue): Update prologue comments + to reflect current reality. Gross attempt at handling out of + line prologues. + + * mn10200-tdep.c (mn10200_skip_prologue): Don't look at the debug + symbols to find the end of the prologue. + * mn10300-tdep.c (mn10300_skip_prologue): Likewise. + +Thu May 8 08:42:47 1997 Andrew Cagney + + * configure.in (AC_TYPE_SIGNAL): Add + * configure: Re-generate. + * remote-sim.c: Signal returns RETSIGTYPE. + +Wed May 7 20:05:07 1997 Andrew Cagney + + * target.h (target_stop): Drop argument so it can be tested for + NULL. + +Sat May 3 20:51:48 1997 Mark Alexander + + * utils.c (floatformat_from_doublest): Handle infinity properly. + +Thu May 1 11:44:46 1997 Michael Snyder + + * Finalize merge from Hurd folk. + Mon Oct 30 16:41:04 1995 Miles Bader + * thread.c (thread_apply_command, thread_apply_all_command, + thread_command): Make sure TP is alive. + (thread_alive): New function. + Tue Nov 14 14:31:03 1995 Miles Bader + * infrun.c (sig_print_info): Deal better with long signal names. + Wed Nov 22 15:23:35 1995 Miles Bader + * thread.c (thread_id_to_pid): New function. + Fri Dec 1 13:25:25 1995 Miles Bader + * gnu-nat.c: (set_thread_cmd_list, show_thread_cmd_list, + set_thread_default_cmd_list, show_thread_default_cmd_list): + New variables. (set_thread_cmd, show_thread_cmd, + set_thread_default_cmd, show_thread_default_cmd): New functions. + Fri Apr 18 15:20:16 1997 Miles Bader + * gnu-nat.c (inf_startup): remove TASK parameter. + (inf_set_task): replace with new function (inf_set_pid). + * gdbthread.h: Add extern decl for thread_cmd_list. + +Thu May 1 02:28:21 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * printcmd.c (disassemble_command): Adjust low function bound + by FUNCTION_START_OFFSET. + +Mon Apr 28 21:25:32 1997 Michael Snyder + + * Makefile.in: Add rule for gnu-nat.o and i386gnu-nat.o (Gnu Hurd) + * config/i386/i386gnu.mh: remove rules for [i386]gnu-nat.o, now + in Makefile.in (as for other targets); add NATDEPFILE corelow.o to + satisfy symbol dependancy in solib.c (core_ops). + * target.[ch] conditionalize Mach-specific signals so that they + won't show up in non-Mach gdb's! + * thread.c: change name of static function "thread_switch" to + "switch_to_thread", to avoid conflict with Mach global symbol; + move thread_cmd_list to global scope so targets can add their + own thread commands. + * infrun.c: sig_print_info: allow for long signal names. + * gnu-nat.[ch]: tidying up comments. + * gnu-nat.c: remove calls to prune_threads and renumber_threads; + gnu_wait must not return -1 when inferior exits; + attach_to_child will modify inferior_pid in a way that allows + fork_inferior to remain unchanged; remove extra arg from + startup_inferior; move Mach thread commands here from thread.c. + +Mon Apr 28 18:21:20 1997 Michael Snyder + + * symtab.c: decode_line_1, replace the assignment to + values.sals[0].pc which I accidentally left out on 4/3/97. + +Mon Apr 28 17:27:40 1997 Michael Snyder + + * c-exp.y: make parse_number reject "123DEADBEEF". + (fix by Bob Manson). + * java-exp.y: Ditto. + * top.c: change "to enable to enable" to "to enable" in a couple + of help strings. + +Mon Apr 28 09:01:59 1997 Mark Alexander + + * breakpoint.c (remove_breakpoint): Pass correct type to + target_remove_watchpoint. + * target.h: Improve comment for target_{remove,insert}_breakpoint. + +Sat Apr 26 03:38:02 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * alpha-tdep.c (heuristic_proc_desc): Increase search limit + for return address register, handle `ret' instruction. + + * corelow.c (get_core_registers): Initialize cf. + + * procfs.c: Minor changes to make pre-ANSI compilers happy. + (procfs_notice_signals): Copy traced signal set back to + pi->prrun.pr_trace. + (unconditionally_kill_inferior): If PR_DEAD is defined, + rerun inferior after killing it. + +Fri Apr 25 00:10:18 1997 Jeffrey A Law (law@cygnus.com) + + * config/mn10300/tm-mn10300.h (EXTRACT_STRUCT_VALUE_ADDRESS): The + structure value address is found in $a0 now. + * config/mn10200/tm-mn10200.h (EXTRACT_STRUCT_VALUE_ADDRESS): Likewise. + +Thu Apr 24 13:31:10 1997 Jeffrey A Law (law@cygnus.com) + + * config/mn10300/tm-mn10300.h (STORE_RETURN_VALUE): Pointers are + returned in $a0. + (EXTRACT_RETURN_VALUE): Likewise. + + * mn10300-tdep.c (mn10300_analyze_prologue): Check for a return + insn at "pc", not "fi->pc". + +Wed Apr 23 11:18:45 1997 Jeffrey A Law (law@cygnus.com) + + * config/mn10200/tm-mn10200.h (STORE_RETURN_VALUE): Pointers are + returned in $a0. + (EXTRACT_RETURN_VALUE): Likewise. + +Tue Apr 22 11:58:15 1997 Fred Fish + + * config/arm/tm-arm.h (TARGET_DOUBLE_FORMAT): Define to use + floatformat_ieee_double_littlebyte_bigword for little endian + target byte order. + * utils.c (floatformat_to_doublest): Create local preswapped + copy of input for floatformat_littlebyte_bigword formats. + (get_field, put_field): Treat floatformat_littlebyte_bigword + the same as floatformat_little. + (floatformat_from_doublest): Postswap output words for + the floatformat_littlebyte_bigwords format. + +Tue Apr 22 09:02:10 1997 Stu Grossman (grossman@critters.cygnus.com) + + * config/alpha/alpha-osf3.mh config/i386/{i386gnu linux}.mh + config/mips/{embed embed64 embedl embedl64 vr4300 vr4300el vr5000 + vr5000el}.mt config/powerpc/{aix aix4}.mh config/rs6000/{aix + aix4}.mh config/sh/sh.mt config/sparc/sp64sim.mt: + config/v850/v850.mt: + Remove -lm. That's now handled by configure. + + * Makefile.in (maintainer-clean): Add distclean to dependencies. + Remove duplicate rm's of files. + +Mon Apr 21 09:49:25 1997 Stu Grossman (grossman@critters.cygnus.com) + + * remote-pa.c: Remove. It's broken and no longer necessary. + + Sat Apr 19 11:56:10 1997 Per Bothner + + * java-exp.y: Combine TRUE and FALSE into BOOLEAN_LITERAL. + (Avoids name clash with broken AIX header files.) + +Sat Apr 19 01:49:37 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * serial.c (serial_log_command): Fix fputs_unfiltered calls. + + * config/powerpc/tm-ppc-aix4.h, config/rs6000/tm-rs6000-aix4.h + (DONT_RELOCATE_SYMFILE_OBJFILE): Removed. + * xcoffsolib.h (struct vmap): Add new members tvma, toffs and dvma, + remove tadj. + * exec.c (bfdsec_to_vmap): Initialize new vmap members, initialize + tstart and dstart with section VMA. + * rs6000-nat.c (vmap_symtab): Relocate relative to the VMA in the + object file. + (vmap_ldinfo, xcoff_relocate_core): Adjust tstart by section offset + of the text section, remove DONT_RELOCATE_SYMFILE_OBJFILE hack. + (vmap_exec): Relocate relative to the VMA in the object file, + relocate .bss section as well. + (xcoff_relocate_core): No longer adjust section addresses by VMA. + * rs6000-tdep.c (find_toc_address): Change type of tocbase + to CORE_ADDR. + * xcoffread.c (secnum_to_bfd_section): New routine to get + BFD section from CS section number. + (scan_xcoff_symtab): Make toc_offset section relative. + + * symtab.c (total_number_of_methods): Avoid core dump if + baseclass type is still undefined. + +Fri Apr 18 17:25:10 1997 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in (SUBDIRS): Add mswin so that make cleanup cleans up + that directory. + * defs.h utils.c (error warning): Make message be const. + * main.c (fputs_unfiltered): Only send gdb_stdout and gdb_stderr + to hook. Otherwise send it to fputs. + * monitor.c monitor.h (monitor_get_dev_name): New function. Does + the obvious. + * remote-e7000.c: Remove debugify stuff. Change printf, fprintf + to _filtered forms to make output appear in GUIs. Replace all + uses of SERIAL_READCHAR with readchar, which has better error + checking. + * (e7000_parse_device): Add prototype. + (readchar): Improve doc. Handle random serial errors. + (expect): Disable notice_quit code. It's busted. Remove + serial error handling (it's now handled in readchar). Remove + remote_debug echoing. That's handled in readchar as well. + (e7000_parse_device): Remove serial_flag arg. It's not + necessary. + (e7000_open): Split into two pieces. Second part is + e7000_start_remote, and is error protected. Now, when we connect + to the target, we setup the initial frame and registers so that + the user gets an immediate indication of where the target is. + (gch): Remove debug output. That's handled by readchar. + (e7000_read_inferior_memory): Handle errors better. + (_initialize_remote_e7000): Get rid of `' things from + command names. They show up when doing completion and confuse + things horribly. + * ser-e7kpc.c: Get rid of the DLL's since we can access the device + directly from Win32s and Win95. Get rid of debugify crud. + * serial.c: Remove debugify cruft. + * (serial_logchar serial_log_command serial_write serial_readchar + serial_send_break serial_close): Merge common functionality into + serial_logchar. Clean up rest of routines. + * sparclet-rom.c: Disembowel. Leave only download routine. + Download routine now switches to remote target automatically. + * top.c (disconnect): Only define if SIGHUP is defined. Cleans + up MSVC/Win32 problem. + * utils.c (gdb_flush): Don't call hook unless it's for gdb_stdout + or gdb_stderr. + * config/sh/tm-sh.h: Define TARGET_SH for WinGDB. + * config/sparc/tm-sparclet.h: Remove override for prompt. + +Fri Apr 18 13:38:19 1997 Doug Evans + + * remote-sim.c (gdbsim_open): Only pass -E to sim_open if + TARGET_BYTE ORDER_SELECTABLE. + +Fri Apr 18 16:52:41 1997 Andrew Cagney + + * remote-sim.c (init_callbacks): Initialize poll_quit and magic + fields of gdb_callback. + (gdbsim_stop): Add gdbsim_stop to list of supported client + operations. + (gdbsim_wait, gdbsim_resume): Move call to sim_resume into + sim_wait where gdb is in a position to handle a long running + function. + (gdbsim_cntrl_c): New function. Wrap the sim_resume call in a + SIGINT handler. + (gdb_os_poll_quit): New function. Check for a quit pending on the + console. + +Thu Apr 17 14:30:04 1997 Per Bothner + + * objfiles.c (allocate_objfile): Allow NULL bfd argument. + * defs.h (enum language): Add language_java. + * java-exp.y, java-lang.c, java-lang.h, java-valprint.c: New files. + * Makefile.in: Update for new files. + * symfile.c (deduce_language_from_filename): Recognize .java. + +Thu Apr 17 02:20:23 1997 Doug Evans + + * m32r-stub.c (stash_registers): Rewrite. + (restore_registers): Renamed to restore_and_return. + (cleanup_stash): New function. + (process_exception): New function. + (_catchException*): Rewrite. + + * remote-sim.c (gdbsim_load): Update call to sim_load. + (gdbsim_create_inferior): No longer pass start_address to + sim_create_inferior. + (gdbsim_open): Pass endian indicator as arg. + +Tue Apr 15 15:31:09 1997 Stan Shebs + + * remote.c (get_offsets): Don't use scanf for interpreting + response to qOffsets. + +Tue Apr 15 14:51:04 1997 Ian Lance Taylor + + * gdbserver/Makefile.in (INSTALL_XFORM): Remove. + (INSTALL_XFORM1): Remove. + (install-only): Use $(program_transform_name) directly, rather + than using $(INSTALL_XFORM) and $(INSTALL_XFORM1). + (uninstall): Transform name. + +Mon Apr 14 17:06:27 1997 Mark Alexander + + * remote-mips.c (mips_load): Ensure that PC gets updated + after a load on LSI target. + +Mon Apr 14 15:54:51 1997 Geoffrey Noer + + * procfs.c (notice_signals): fix typo + +Mon Apr 14 16:25:10 1997 Ian Lance Taylor + + * gdbserver/Makefile.in (INSTALL): Change install.sh to + install-sh. + +Mon Apr 14 11:55:27 1997 Geoffrey Noer + + * config/i386/cygwin32.mh: remove -lkernel32 from XM_CLIBS + since gcc automatically includes it + +Thu Apr 10 13:20:53 1997 Geoffrey Noer + + * procfs.c: Substantial (but incomplete) changes to support + sysv4.2mp procfs as implemented in UnixWare 2.1. The procinfo + struct now has substructs like struct flt_ctl instead of + just a fltset_t and has a ctl_fd, status_fd, as_fd, and + map_fd instead of a single fd. Non-sysv4.2mp procfs models + still have the structs and multiple fds, but don't use the + entire struct and the four fds all point to the same thing. + We use PROCFS_USE_READ_WRITE to decide whether to talk to + procfs with reads/writes or use ioctl instead. We use + HAVE_MULTIPLE_PROC_FDS to determine whether procfs really has + multiple fds or not. PROC_NAME_FMT is split out into + CTL_PROC_NAME_FMT, AS_PROC_NAME_FMT, MAP_PROC_NAME_FMT, + STATUS_PROC_NAME_FMT. + + (procfs_notice_signals): now a necessary wrapper around + (notice_signals): which are the new guts for noticing signals + (open_proc_file): gets a new flag arg used in sysv4.2mp to + determine whether or not to attempt to open the ctl_fd. + (procfs_read_status): new local function, reads procfs status + (procfs_write_pcwstop): new local function, writes a PCWSTOP + (procfs_write_pckill): new local function, writes a PCKILL + (unconditionally_kill_inferior): remove signo since we now + just call procfs_write_pckill(). + (procfs_xfer_memory): call lseek with SEEK_SET rather than 0 + (proc_iterate_over_mappings): the whole function is ifdefed + on UNIXWARE to keep things readable. + + Expanded the syscall_table to include new potential sysv4.2mp + members. Note that all ifdefs of UNIXWARE should be eliminated + if possible or renamed to describe what's being selected for a + bit better. Sysv4.2mp and IRIX both have SYS_sproc so the + IRIX specific code now also checks it's not UNIXWARE. + + * config/i386/tm-i386v42mp.h: also define HAVE_PSTATUS_T, + HAVE_NO_PRRUN_T, PROCFS_USE_READ_WRITE, and UNIXWARE + * config/mips/nm-irix4.h: set CTL_PROC_NAME_FMT et al to + "/debug/%d" as PROC_NAME_FMT used to be + +Wed Apr 9 11:36:14 1997 Jeffrey A Law (law@cygnus.com) + + * mn10300-tdep.c: Almost completely rewritten based on mn10200 + port. + * config/mn10300/tm-mn10300.h: Likewise. + +Tue Apr 8 10:45:24 1997 Stu Grossman (grossman@critters.cygnus.com) + + * config/pa/{hppabsd.mt hppahpux.mt hppaosf.mt}: Remove + remote-pa.o from TDEPFILES. Nobody uses it, and besides, it's a + lousy out-of-date clone of remote.c. + +Fri Apr 4 08:21:21 1997 Stu Grossman (grossman@critters.cygnus.com) + + * remote.c: Fix problems realized while showering. + * (hexnumlen): Add prototype. Use max, not min. + * (remote_write_bytes remote_read_bytes): Fix max packet size + calculations to properly account for packet overhead. Also handle + (probably rare) case where remote_register_buf_size isn't set. + + * remote.c: Fix doc for `C' and `S' commands to indicate full + address. + * (remote_ops extended_remote_ops remote_desc remote_write_size): + Make static. + * (remote_fetch_registers remote_write_bytes remote_read_bytes): + Record size of response to fetch registers command, use this to + limit size of memory read and write commands. + * (push_remote_target): New function to make it possible to have + another target switch to the remote target. + * target.h: Add prototype for push_remote_target. + * sh-tdep.c (sh_frame_find_saved_regs): Fix sign extension bugs + for hosts which default to unsigned chars (such as SGI's). + * (_initialize_sh_tdep): Don't set remote_write_size. It's now + handled automatically in remote.c. + +Thu Apr 3 15:10:30 1997 Michael Snyder + + * blockframe.c: blockvector_for_pc_sect(), block_for_pc_sect(), + find_pc_sect_function(), find_pc_sect_partial_function(): new + functions for debugging overlays; pc without section is ambiguous. + * breakpoint.[ch]: add section pointer to breakpoint struct; + add section argument to check_duplicates(); check section as well + as pc in [breakpoint_here_p(), breakpoint_inserted_here_p(), + breakpoint_thread_match(), bpstat_stop_status()]; + add section argument to describe_other_breakpoints(); + use INIT_SAL() macro to zero-out new sal structures; + make resolve_sal_pc() fix up the sal's section as well as its pc; + match on section + pc in clear_command() and delete_breakpoint(); + account for overlay sections in insert_breakpoints(), + remove_breakpoint() and breakpoint_re_set_one(); + all this to support overlays where a PC is not unique. + * exec.c: change xfer_memory() to handle overlay sections. + * findvar.c: change read_var_value() to handle overlay sections. + * frame.h: declaration for block_for_pc_sect() [blockframe.c]. + * infcmd.c: jump_command() warns against jumping into an overlay + that's not in memory. Also use INIT_SAL() to initialize sals. + * infrun.c: wait_for_inferior() sets a flag to invalidate cached + overlay state information; Also use INIT_SAL() to init sals. + * m32r-rom.c: modify load routines to use LMA instead of VMA. + * m32r-stub.c: mask exit value down to 8 bits; screen out any + memory read/writes in the range 600000 to a00000, and ff680000 + to ff800000 (hangs because nothing is mapped there); fix strcpy(). + * maint.c: maintenance command "translate-address" supports overlays. + * minsyms.c: lookup_minimal_symbol_by_pc_sect() supports overlays. + * objfiles.[ch]: add ovly_mapped field to the obj_section struct; + this constitutes gdb's internal overlay mapping table. Add macro + ALL_OBJSECTIONS() to loop thru the obj_structs and look at overlays. + Add function find_pc_sect_section(). + * printcmd.c: modify print_address_symbolic() with overlay smarts; + modify address_info() with overlay smarts; add function sym_info() + to support the INFO SYMBOL command (translate address to symbol(s)); + modify disassemble_command() to work on unmapped overlays. + * source.c: use INIT_SAL() to initialize sals. + * symfile.[ch]: change generic_load() to use section's LMA address + instead of VMA address, for overlay sections. + Add numerous functions for finding a PC's section / overlay, + translating between VMA and LMA address ranges, determining if an + overlay section is mapped, etc. Add several user commands for + overlay debugging. Add support for a "generic" form of automatically + reading overlay mapping info from the inferior (based on the default + (simple) overlay manager which Cygnus provides as an example). + * symtab.[ch]: add functions find_pc_sect_symtab(), + find_pc_sect_psymtab(), find_pc_sect_psymbol(), find_pc_sect_line() + for lookup; modify lookup_symbol and decode_line_1() to use them; + modify find_function_start_sal() to account for overlay sections; + add macro INIT_SAL() for initializing struct symtab_and_line. + * target.c: fix a comment in the declaration of target_ops. + +Thu Apr 3 10:31:12 1997 Mark Alexander + + * mips-tdep.c (mips_in_call_stub, mips_in_return_stub, + mips_skip_stub, mips_ignore_helper): New functions for dealing + with MIPS16 call/return thunks. + (mips_init_frame_pc_first): New function to implement + INIT_FRAME_PC_FIRST macro; includes code from old macro plus + new code to skip over MIPS16 thunks. + (mips_frame_chain): Skip over MIPS16 thunks. + * config/mips/tm-mips.h (mips_in_call_stub, mips_in_return_stub, + mips_skip_stub, mips_ignore_helper): Declare. + (IN_SOLIB_CALL_TRAMPOLINE, IN_SOLIB_RETURN_TRAMPOLINE, + SKIP_TRAMPOLINE_CODE, IGNORE_HELPER_CALL): New macros that invoke + the above functions. + (INIT_FRAME_PC_FIRST): Change to invoke mips_init_frame_pc. + (mips_init_frame_pc): Declare. + * infrun.c (wait_for_inferior): Use new IGNORE_HELPER_CALL macro + to decide if certain library function calls should be ignored. + +Wed Apr 2 14:16:51 1997 Doug Evans + + * remote-sim.c (gdbsim_open): Check return code from sim_open. + Update call to sim_open (new arg SIM_OPEN_DEBUG). + +Mon Mar 31 14:55:53 1997 Ian Lance Taylor + + * gdbinit.in: New file. + * .gdbinit: Remove. + * configure.in: Generate .gdbinit from gdbinit.in. + * configure: Rebuild. + +Sat Mar 29 13:57:20 1997 Fred Fish + + * COPYING: Install new version of file from FSF. + * copying.c (show_copying_command): Update FSF address. + +Fri Mar 28 18:33:41 1997 Ian Lance Taylor + + * Makefile.in (distclean): Remove .gdbinit. + +Fri Mar 28 15:38:04 1997 Mike Meissner + + * remote-sim.c (gdb_os_{,e}vprintf_filtered): Change stdarg type + to va_list from void *, since va_list might not be a pointer + type. + +Thu Mar 27 14:21:46 1997 Mark Alexander + + * remote-mips.c: Clean up comment and extraneous semicolon + for mips_monitor_prompt variable. + +Thu Mar 27 12:46:58 1997 Mark Alexander + + * remote-mips.c: Add `set monitor-prompt' command. + +Wed Mar 26 06:47:44 1997 Mark Alexander + + Fix from Peter Schauer: + * mdebugread.c (parse_procedure): Set address of procedure to + block start; this fixes problems with shared libraries introduced + by change of Mar 21. + +Mon Mar 24 19:43:16 1997 Geoffrey Noer + + * symtab.c (find_pc_symtab): change to support the case + where the objfile is reordered and contains both coff and + stabs debugging info (continue on if a psymtab isn't found). + +Sun Mar 23 16:19:20 1997 Mark Alexander + + Fixes from Peter Schauer: + * config/mips/tm-mips.h (REGISTER_CONVERT_TO_TYPE, + REGISTER_CONVERT_FROM_TYPE): Swap words if target, not host, + is big-endian and if registers are 32 bits. + * mips-tdep.c (mips_print_register, mips_extract_return_value, + mips_store_return_value): Fix floating-point word-order problems on + little-endian targets introduced by changes of Mar 21. + +Sun Mar 23 15:43:27 1997 Stan Shebs + + * remote.c (target_resume_hook, target_wait_loop_hook): New + globals. + (remote_resume, remote_wait): Use them. + * d10v-tdep.c: Set the above hooks. + (tracesource): New GDB variable, controls source display in + traces. + (display_trace): Find and display source line if requested. + (trace_info): Mention empty trace buffer if appropriate. + (tdisassemble_command): Robustify argument handling. + + * configure.host: Remove extra bogus Linux case. + +Sat Mar 22 16:41:35 1997 Fred Fish + + * remote-sim.c (simulator_command): Add comment about dealing with + NULL or empty args. + +Sat Mar 22 02:48:11 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * c-exp.y (yylex): Handle nested template parameter lists. + * symtab.c (decode_line_2): Fix test for valid choice number. + +Fri Mar 21 19:10:05 1997 Mark Alexander + + * mips-tdep.c (mips_push_arguments): On non-EABI architectures, + copy first two floating point arguments to general registers, so that + MIPS16 functions will receive the arguments correctly. + (mips_print_register): Print double registers correctly on + little-endian hosts. + (mips_extract_return_value): Return double values correctly + on little-endian hosts. + + * mdebugread.c (parse_procedure): Adjust address of procedure relative + to address in file descriptor record; this accounts for constant + strings that may precede functions in the text section. Remove + now-useless lowest_pdr_addr from argument list and all calls. + +Fri Mar 21 15:36:25 1997 Michael Meissner + + * configure.tgt (powerpc*-{eabi,linux,sysv,elf}*): Determine + whether the simulator will be built by whether the Makefile in the + simulator directory was built. + + * configure.in (--enable-sim-powerpc): Delete switch. + * configure: Regenerate. + +Thu Mar 20 20:52:04 1997 Jeffrey A Law (law@cygnus.com) + + * mn10200-tdep.c (mn10200_analyze_prologue): Look for save of "a1" + in the prologue too. + + * remote-sim.c (gdb_os_vprintf_filtered): Fix to work with non-ANSI + compilers. + (gdb_os_evprintf_filtered): Similarly. + +Wed Mar 19 16:13:22 1997 Geoffrey Noer + + New UnixWare 2.1 configuration + * config/i386/i386v42mp.mt: new + * config/i386/i386v42mp.mh: new + * config/i386/tm-i386v42mp.h: new + * config/i386/nm-i386v42mp.h: new + * configure.tgt: added new entries + * configure.host: added new entries + +Mon Mar 17 17:52:00 1997 J.T. Conklin + + * dsrec.c (load_srec): Print leading zeroes when printing section + addresses. + +Mon Mar 17 15:00:16 1997 Andrew Cagney + + * remote-sim.h: Delete - moved to ../include/remote-sim.h. + + * Makefile.in (remote_utils_h): Update path to remote-sim.h. + +Fri Mar 7 20:55:28 1997 Andrew Cagney + + * remote-sim.c (flush_stdout, write_stderr, flush_stderr, + vprintf_filtered, evprintf_filtered): Callbacks that accept + varargs. + +Sat Mar 15 00:50:46 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * breakpoint.c (insert_breakpoints, watchpoint_check, + bpstat_stop_status): Do not disable watchpoints going out of scope. + (insert_breakpoints): Make sure that the current frame is valid + before calling find_frame_addr_in_frame_chain. + + * top.c (setup_user_args): Handle quotes and backslashes. + (print_gdb_version): Update copyright year. + +Fri Mar 14 15:44:03 1997 Ian Lance Taylor + + * Makefile.in (elfread.o): Depend upon elf-bfd.h and elf/mips.h. + +Thu Mar 13 22:51:00 1997 Dawn Perchik + + * utils.c (pollquit, notice_quit): If _WIN32, limit test for + cntl-C to wingdb. + (initialize_utils): If _WIN32, don't call ScreenRows and ScreenCols + except under wingdb. (Contributed by Martin Hunt). + +Thu Mar 13 12:40:49 1997 Tom Tromey + + * configure: Regenerated. + * configure.in: Run AC_CONFIG_AUX_DIR before AC_CANONICAL_SYSTEM. + +Thu Mar 13 11:00:22 1997 Doug Evans + + * remote-sim.h (sim_state, SIM_DESC): New types. + (sim_open): Return a `descriptor' as result. + (*): New argument of descriptor result from sim_open. + * remote-sim.c (gdbsim_desc): Renamed from gdbsim_open_p. + (gdbsim_open): Record result of sim_open in gdbsim_desc. + Pass argv list to sim_open, argv[0] = pseudo program name. + (*): Pass gdbsim_desc to sim_foo fns. + +Wed Mar 12 14:40:06 1997 Tom Tromey + + * config.in: Regenerated. + + * acconfig.h (START_INFERIOR_TRAPS_EXPECTED, sys_quotactl, + HAVE_HPUX_THREAD_SUPPORT): Define. + +Tue Mar 11 07:25:27 1997 Mark Alexander + + First cut at supporting simulators in gdbserver: + + * configure, configure.in: Allow gdbserver to be configured + for cross-target environments. + * gdbserver/Makefile.in: Add simulator support. + * gdbserver/configure.in: Eliminate assumption that host == target. + Simplify using gdb/configure.tgt and gdb/configure.host. + Fix other minor configuration errors. + * gdbserver/low-sparc.c: Fix compile error. + * gdbserver/remote-utils.c: Eliminate assumption that registers + and addresses are four bytes. Fix minor compile errors and warnings. + * gdbserver/server.c: Rewrite numerous instances of identical code + for starting inferior processes to call new function start_inferior. + Eliminate assumption that registers and addresses are four bytes. + * gdbserver/server.h: Add missing prototypes to eliminate compiler + warnings. + * gdbserver/low-sim.c: New file to mate gdbserver with simulators. + * config/mips/vr5000.mt: Add Vr5000 simulator support to gdbserver. + * config/i386/linux.mh: Eliminate gdbserver support as a first step + in moving such support from host to target makefile fragments. + * config/i386/linux.mt: Move gdbserver support here from linux.mh. + +Mon Mar 10 12:27:47 1997 Michael Snyder + + * symtab.h (INIT_SAL): New macro to initialize symtab_and_line, + to insure consistant initialization of unused fields to zero. + * symtab.c: replace initializations of sals with new macro INIT_SAL. + * breakpoint.c: ditto. + * infrun.c: ditto. + * infcmd.c: ditto. + * source.c: add call to INIT_SAL macro. + +Sat Mar 8 00:16:37 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * sparc-tdep.c (isbranch): Always handle v9 branch instructions, + they might get used on 32 bit targets as well. + +Wed Mar 5 19:34:09 1997 Bob Manson + + * remote-mips.c (mips_exit_debug): Some IDT boards don't + send the full exit string. + +Wed Mar 5 12:59:27 1997 Jeffrey A Law (law@cygnus.com) + + * mn10200-tdep.c (mn10200_push_arguments): Handle new calling + conventions. + (mn10200_store_struct_return): Likewise. + +Tue Mar 4 10:31:02 1997 Mark Alexander + + * mips-tdep.c (mips_fetch_instruction): New function; replace + common code throughout with calls to it. + (mips_find_saved_regs): Examine MIPS16 entry instruction to determine + correct saved addresses of $s0 and $s1. + (mips_find_saved_regs, mips16_heuristic_proc_desc): Use MIPS_REGSIZE + instead of hardcoded 4. + (mips16_skip_prologue): Handle extended instructions correctly. + +Mon Mar 3 12:29:20 1997 Doug Evans + + * defs.h (LONGEST): Move #ifndef LONGEST to outside. + Try BFD_HOST_64_BIT if ! CC_HAS_LONG_LONG. + +Thu Feb 27 18:54:11 1997 Mark Alexander + + * mips-tdep.c (IS_MIPS16_ADDR, MAKE_MIPS16_ADDR, UNMAKE_MIPS16_ADDR): + New macros for testing, setting, and clearing bit 0 of addresses. + Change numerous bits of code where bit 0 was being manipulated + to use these macros. + +Thu Feb 27 14:12:41 1997 Mark Alexander + + * remote-mips.c: Put back the form feeds. + +Thu Feb 27 12:04:24 1997 Mark Alexander + + * remote-mips.c: Remove form feeds (^L) from source. + (mips_initialize): LSI PMON doesn't support 'set regsize' command. + (pmon_wait): Don't need to exit and re-enter debug mode on LSI + PMON after a continue; it causes target program misbehavior. + (mips_fetch_register): Don't fetch unsupported registers; this + cuts down on wasted serial traffic. + +Thu Feb 27 09:38:16 1997 Stu Grossman (grossman@critters.cygnus.com) + + * configure.in configure (HPUX/OSF thread support): Enable this + only when running GCC, since HP's thread header files use ANSI C + which is not supported by their default compiler. + + * configure.host (i[3456]86-*-windows): Disable long long + support for WinGDB. Add mswin to configdirs. + * configure.in configure: Move calls to configure.host and + configure.tgt to the top of configure.in to allow them to set + config variables before they are referenced. + +Tue Feb 25 20:21:52 1997 Stan Shebs + + * configure.tgt (mips*-*-lnews*): New target. + +Mon Feb 24 16:35:00 1997 Jeffrey A Law (law@cygnus.com) + + * mn10200-tdep.c (mn10200_analyze_prologue): Don't fix fi->frame + if we're not the innermost frame. Fix minor typos. + +Sat Feb 22 03:39:50 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * stabsread.c (read_type): Fix handling of template names + with template parameters containing `::'. + + * valops.c (search_struct_field, search_struct_method): + Pass correct valaddr parameter to baseclass_offset. + Prevent gdb crashes by making sure that the virtual base pointer + from an user object still points to accessible memory. + +Tue Feb 18 13:36:34 1997 Mark Alexander + + * maint.c: Eliminate -Wall warnings by including some header files. + +Tue Feb 18 13:06:30 1997 Mark Alexander + + * remote-sim.c (init_callbacks): Undo previous change. + +Tue Feb 18 11:13:00 1997 Dawn Perchik + + * maint.c: Fix dereference of pointer. + * remote-sim.c: Fix reference of structure member "last_error". + * debugify.c: Include config.h to get ANSI definitions. + +Sat Feb 15 17:43:46 1997 Stu Grossman (grossman@critters.cygnus.com) + + * remote-vx.c (vx_attach): Remove code added by kung. It made no + sense. + +Fri Feb 14 13:00:07 1997 Ian Lance Taylor + + * main.c (print_gdb_help): Make static to match declaration. + +Thu Feb 13 18:18:18 1997 Dawn Perchik + + * remote-e7000.c, ser-e7kpc.c, serial.c: Remove // comments. + +Wed Feb 12 15:58:00 1997 Dawn Perchik + + * debugify.c, debugify.h: Make safe for non-ansi compilers. + +Wed Feb 12 15:30:00 1997 Dawn Perchik + + * defs.h: Fix prototypes for new cleanup functions. + +Wed Feb 12 15:08:47 1997 Dawn Perchik + + * debugify.c, debugify.h: Fix for general gnu use. Remove C++ + comment, add PARAMS, add license info and fix indentation. + +Wed Feb 12 14:42:47 1997 Dawn Perchik + + * debugify.c, debugify.h: New files. Provide common macros + for writing debug info to a log file or stdio. + +Wed Feb 12 02:44:39 1997 Dawn Perchik + + * c-valprint.c (c_val_print): Fix printing for arrays defined + with 0 length. + +Tue Feb 11 22:24:39 1997 Dawn Perchik + + * defs.h: Fix cntl-C to read from the Windows message queue. + Add prototypes for make_final_cleanup (and the other cleanup + routines. + * remote-e7000.c: Fix sync code to timeout if unable to sync. + Change sync code to report status while trying to sync-up + with hardware. Add debugging output and document. + * ser-e7kpc.c: Swap order of len & offset to match implementation. + Add debugging output and document. + * serial.c: Add debugging output. + * top.c: Add call to do_final_cleanups. + Remove conditionals preventing Win32 from getting SIGQUIT. + * utils.c: (*_cleanup): Modify cleanup routines to accept a cleanup + chain as a parameter. Extract this generic code from the cleanup + routines into separate funtions (*_my_cleanup). Keep old + functionality by passing "cleanup_chain" to the new funtions. + Define the cleanup chain "final_cleanup_chain" to be a cleanup + chain which will be executed only when gdb exits. Add functions + (*_final_cleanup) to match the original (*_cleanup) functions. + (pollquit, quit, notice_quit): Fix to read cntl-C from the + Windows message queue. + +Tue Feb 11 15:36:31 1997 Doug Evans + + * m32r-rom.c: #include . + #ifdef out new load support if wingdb. + * m32r/tm-m32r.h (TARGET_M32R): Define, for wingdb. + +Tue Feb 11 12:28:09 1997 Jeffrey A Law (law@cygnus.com) + + + * config/mn10200/tm-mn10200.h (STORE_STRUCT_RETURN): Fix. + * mn10200-tdep.c (mn10200_store_struct_return): New function. + + * config/mn10200/tm-mn10200.h (EXTRACT_RETURN_VALUE): Fix case when + extracting a return value from a register pair. + + * mn10200-tdep.c (mn10200_push_arguments): Stack only needs to + be two byte aligned. Round argument sizes up to two byte boundary. + Write out args in two byte hunks. + (mn10200_push_return_address): Implement. + * config/mn10200/tm-mn10200.h (EXTRACT_RETURN_VALUE): Abort for + structures > 8 bytes (temporary). + (STORE_RETURN_VALUE): Likewise. + (CALL_DUMMY): No longer undefine. + (USE_STRUCT_CONVENTION): Use for args > 8 bytes. + (REG_STRUCT_HAS_ADDR): Define. + +Mon Feb 10 18:35:55 1997 Mark Alexander + + * mips-tdep.c (non_heuristic_proc_desc): New function. + (find_proc_desc): Move non-heuristic proc search code into separate + function. + (gdb_print_insn_mips): Use non-heuristic method to find procedure + descriptor, to avoid prologue examination when disassembling. + * remote-mips.c: Add support for new "lsi" target (LSI MiniRISC + aka MicroMeteor board). + (mips_exit_debug): Prevent protocol reinitialization if an error + occurs while exiting debug mode. + +Mon Feb 10 16:11:57 1997 Jeffrey A Law (law@cygnus.com) + + * mn10200-tdep.c: Remove lots of debugging printfs, update/improve + comments, formatting, etc. Plus other minor fixes for problems + I found during my first pass over the mn10200 port. + (mn10200_analyze_prologue): New function. + (mn10200_frame_chain, mn10200_init_extra_frame_info): Use it. + * config/mn10200/tm-mn10200.h: Lots of updates/improvements to + comments, formatting, etc. Minor fixes for problems I found during + my first pass over the mn10200 port. + (TARGET_*_BIT): Define appropriately for ints, long longs, doubles and + pointers. + (REGISTER_VIRTUAL_TYPE): Define as a long. + (EXTRACT_RETURN_VALUE): Rework to deal with long ints living + in register pairs. + (STORE_RETURN_VALUE): Similarly. + + * blockframe.c (generic_get_saved_regs): Remove unused variable + "addr". + * breakpoint.c (frame_in_dummy): Move struct breakpoint *b decl + inside #ifdef CALL_DUMMY. + (watch_command_1): Initialize target_resources_ok. + * command.c (do_setshow_command): Provide dummy initialization + for "match". + * valops.c (find_function_addr): Move function & prototype inside + #ifdef CALL_DUMMY. + (value_arg_coerce): Similarly. + (value_of_variable): Provide dummy initialization of "frame". + +Mon Feb 10 07:54:26 1997 Fred Fish + + * xcoffread.c (RECORD_MINIMAL_SYMBOL): Add NULL asection* parameter + to prim_record_minimal_symbol_and_info call that was missed in Jan 3 + change. + (scan_xcoff_symtab): Ditto. + +Sun Feb 09 09:23:26 1997 Mark Alexander + + * remote-mips.c (common_breakpoint): Prevent 64-bit addresses + from being sent to 32-bit targets by masking off upper bits. + * mips-tdep.c (heuristic_proc_start): Mask off upper 32 bits + of PC on 32-bit targets. + (mips16_heuristic_proc_desc): Recognize 'addiu s1,sp,n' as a + frame setup instruction. + (mips32_heuristic_proc_desc): Fix warning found by gcc -Wall. + (mips16_skip_prologue): Recognize 'addiu s1,sp,n' as a valid + prologue instruction. Fix warnings and bugs found by gcc -Wall. + * buildsym.c (finish_block): Improve handling of overlapping blocks; + fixes problem on MIPS16 printing function arguments. + +Sat Feb 8 01:14:43 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * dwarf2read.c (dwarf2_linkage_name): New function to get + the linkage name of a die from DW_AT_MIPS_linkage_name or + DW_AT_name. + (read_func_scope, dwarf2_add_field, dwarf2_add_member_fn, + new_symbol): Use it instead of accessing DW_AT_name. + (read_partial_die): Use DW_AT_MIPS_linkage name as name of the + partial die if present. + (dwarf2_add_member_fn): Make a copy of physname on the type obstack. + +Fri Feb 7 10:06:22 1997 Jeffrey A Law (law@cygnus.com) + + * blockframe.c (generic_frame_chain_valid): If the new frame + is not INNER_THAN the old frame, then it's not valid. + +Tue Feb 04 09:04:37 1997 Mark Alexander + + * mips-tdep.c (mips16_get_imm): Fix calculation of extended immediate. + (mips16_heuristic_proc_desc): Recognize jal(x) instruction. + +Mon Feb 03 17:57:58 1997 Mark Alexander + + * mips-tdep.c (mips16_decode_reg_save): Distinguish between + sd and sw instructions correctly. + (heuristic_proc_start): Add support for MIPS16. + (mips16_get_imm, mips16_heuristic_proc_desc, + mips32_heuristic_proc_desc): New helper functions for + heuristic_proc_desc. + (heuristic_proc_desc): Rewrite and reorganize to support MIPS16. + (mips_push_arguments): Don't align small arguments in EABI. + (mips32_skip_prologue): Attempt to shrink code size a little. + +Mon Feb 3 11:06:05 1997 Michael Snyder + + * m32r-stub.c: New -- remote protocol support for M32R cpu. + * m32r-rom.c: Several experiments with improved download time. + +Fri Jan 31 08:26:39 1997 Mark Alexander + + * mips-tdep.c (MIPS16_INSTLEN): Define. + (mips_find_saved_regs): Replace hardcoded 2's with MIPS16_INSTLEN. + (heuristic_proc_start): Recognize 'entry' pseudo-op as a start + of function on MIPS16. + (mips32_skip_prologue, mips16_skip_prologue): New helper functions + for mips_skip_prologue. + (mips_skip_prologue): Recognize both 16- and 32-bit prologues. + +Wed Jan 29 12:45:54 1997 Michael Meissner + + * config/powerpc/ppc{,le}-sim.mt (SIM): Remove the library + ../sim/common/libcommon.a. + +Tue Jan 28 15:54:13 1997 Michael Snyder + + * blockframe.c: fix a null pointer ref in generic_get_saved_register + +Tue Jan 28 15:39:50 1997 Geoffrey Noer + + * mn10200-tdep.c (mn10200_frame_chain): Get basic backtracing + working. + +Mon Jan 27 14:31:52 1997 Mark Alexander + +First set of changes for mips16: + * config/mips/tm-mips.h (MIPS16_BIG_BREAKPOINT, + MIPS16_LITTLE_BREAKPOINT, BREAKPOINT_FROM_PC): Define. + (ABOUT_TO_RETURN): Call new function mips_about_to_return. + (mips_breakpoint_from_pc, mips_about_to_return): Declare. + * mem-break.c (memory_breakpoint_from_pc): New function. + (memory_insert_breakpoint, memory_remove_breakpoint): Use + memory_breakpoint_from_pc to determine breakpoint contents and size. + * target.h (memory_breakpoint_from_pc): Declare. + * monitor.c (monitor_insert_breakpoint): Use memory_breakpoint_from_pc + to determine size of breakpoint instruction. + * mips-tdep.c (mips32_decode_reg_save, mips16_decode_reg_save): + New helper functions for mips_find_saved_regs. + (mips_find_saved_regs): Recognize mips16 prologues. + (mips_addr_bits_remove): Strip off upper 32 bits of address + when target CPU is 32 bits but CORE_ADDR is 64 bits. + (mips_step_skips_delay): No branch delay slot on mips16. + (gdb_print_insn_mips): Disassemble mips16 code. + (mips_breakpoint_from_pc, mips_about_to_return): New functions. + +Mon Jan 27 10:34:03 1997 Jeffrey A Law (law@cygnus.com) + + * tm-mn10200.h (NUM_REGS): Decrease to 12. + (REGISTER_NAMES): Elimination registers not found on the mn10200. + (PC_REGNUM, MDR_REGNUM, PSW_REGNUM): Corresponding changes. + (LIR_REGNUM, LAR_REGNUM): Delete. They don't exist on the mn10200. + +Sat Jan 25 00:07:59 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * dwarf2read.c: Replace integral tag, name and form fields in + internal structure definitions with the corresponding enumeration + types from dwarf2.h. Add default cases to switches on enumerations + where appropriate. + Make quoting of string arguments in complaint messages consistent. + Check for NULL returns from DW_STRING. + (struct partial_die_info): Add sibling and has_type fields, remove + unused value field. + (DW_*): Move access macro definitions near the definition of the + attribute structure. + (struct field_info): New structure to pass information about fields + and member functions between die processing routines. + (dwarf2_build_psymtabs_hard): Set cu_header_offset. + (scan_partial_symbols): Do not enter DW_TAG_subprogram dies into + the partial symbol table if the DW_AT_*_pc attributes are missing. + Add file scope base type definitions to the partial symbol table. + Skip over child dies if the die has a sibling attribute. + (add_partial_symbol): Enter global variables with type attributes + and without location descriptors into the partial symbol table. + Store value of DW_TAG_variable dies in the partial symbol table. + Do not enter global variables into the minimal symbol table. + Add base type definitions to the partial symbol table. + (psymtab_to_symtab_1): Use dwarf2_get_pc_bounds to determine highpc. + (process_die): Move check for DW_AT_low_pc to read_func_scope. + Add a typedef symbol for base type definitions to the symbol table. + Ignore DW_TAG_inlined_subroutine tags for now. + (read_file_scope): Use dwarf2_get_pc_bounds to determine pc bounds. + (read_func_scope, read_lexical_block_scope): Use dwarf2_get_pc_bounds + to determine pc bounds, ignore dies with invalid bounds. + (dwarf2_get_pc_bounds): New routine to extract and validate the + DW_AT_*_pc attributes of a die. + (dwarf2_add_field, dwarf2_attach_fields_to_type, skip_member_fn_name, + dwarf2_add_member_fn, dwarf2_attach_fn_fields_to_type): + New functions to handle fields and member functions. + (read_structure_scope): Rewritten to use them. + (read_array_type): Renamed from dwarf_read_array_type. + Default upper array bound to describe an array with unspecified + length. + Create array types in backwards order, as dwarf2 puts out the array + dimensions from left to right. + (read_subroutine_type): Handle DW_TAG_unspecified_parameters, + DW_AT_artificial and DW_AT_prototyped. + (read_base_type): Make an unsigned type for DW_ATE_boolean. + Pass objfile to dwarf_base_type. + (read_partial_die): Use read_attribute to read in the attributes. + Handle DW_AT_sibling and DW_AT_type. + Follow references when determining DW_AT_name and DW_AT_external + attributes of the die. + Validate DW_AT_*_pc attributes. + (read_full_die): Use read_attribute to read in the attributes. + (read_attribute): New function to read an attribute described + by an abbreviated attribute. + (new_symbol): Relocate symbol value for DW_TAG_label with baseaddr. + Do not set SYMBOL_VALUE_ADDRESS for DW_TAG_subprogram, + SYMBOL_BLOCK_VALUE for the symbol will be set later by finish_block. + Change symbol class for global variables with a zero valued location + descriptor to LOC_UNRESOLVED. + Handle DW_AT_const_value attributes for DW_TAG_variable, + DW_TAG_formal_parameter and DW_TAG_enumerator. + Build a typedef symbol for DW_TAG_base_type. + (dwarf2_const_value): New routine to copy a constant value from an + attribute to a symbol. + (dwarf_base_type): Use passed in objfile, not current_objfile + when calling dwarf2_fundamental_type. + (dump_die): Use DW_* accessor macros to access values of attributes. + (decode_locdesc): Handle DW_OP_plus_uconst. + +Wed Jan 22 01:31:16 1997 Geoffrey Noer + + * mn10200-tdep.c: New file. + * config/mn10200/tm-mn10200.h: New, REGISTER_SIZE is 24 bits not 32, + SP_REGNUM and FP_REGNUM are different, also no lar or lir. + * config/mn10200/mn10200.mt: New file. + * configure.tgt: add mn10200 entry. + +Tue Jan 21 18:32:23 1997 Stu Grossman (grossman@lisa.cygnus.com) + + * configure.in configure: Check if host has libdl if doing + Solaris threads. + +Tue Jan 21 17:03:26 1997 Geoffrey Noer + + * mn10300-tdep.c: Wrote/fixed implementations of + mn10300_frame_chain, mn10300_init_extra_frame_info, + mn10300_frame_saved_pc + * config/mn10300/tm-mn10300.h: Redefine INIT_EXTRA_FRAME_INFO + and INIT_FRAME_PC macros. + +Tue Jan 21 17:01:20 1997 Stu Grossman (grossman@lisa.cygnus.com) + + * configure.in configure: Check if host has libm. Make sure we + are using gcc when using the -export-dynamic option. Fixes a + problem with building under Solaris/SunPro cc. + +Mon Jan 20 13:52:13 1997 Mark Alexander + + * config/mips/{embed,embed64,embedl,embedl64}.mt: + Link in simulator on MIPS embedded targets. + +Sat Jan 18 02:31:29 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * blockframe.c (frameless_look_for_prologue): Mark frames + with a zero PC as frameless to improve backtraces from core dumps + caused by dereferencing a NULL function pointer. + +Thu Jan 16 14:10:41 1997 Geoffrey Noer + + * config/mn10300/tm-mn10300.h: fix BREAKPOINT definition. + +Tue Jan 14 16:01:06 1997 Geoffrey Noer + + * mn10300-tdep.c: made a lot more generic, ripping out code + from copied target (no more mn10300_scan_prologue, + init_extra_frame_info, and mn10300_fix_call_dummy calls) + * config/mn10300/tm-mn10300.h: undefine INIT_EXTRA_FRAME_INFO + and INIT_FRAME_PC macros + +Thu Jan 9 11:44:40 1997 Michael Snyder + + * sparc-tdep.c (sparc_frame_find_saved_regs): Don't use + FP_REGISTER_BYTES to compute offsets into the saved frame, + since it fails for SPARC targets configured without any + FP regs. Instead, use DUMMY_STACK_REG_BUF_SIZE. + +Mon Jan 6 11:15:14 1997 Stu Grossman (grossman@critters.cygnus.com) + + * symtab.c (fixup_symbol_section): Handle NULL symbols without + crashing. + +Fri Jan 3 12:08:16 1997 Stu Grossman (grossman@critters.cygnus.com) + + * Makefile.in configure configure.in: Remove ENABLE_CLIBS, + ENABLE_OBS, and THREAD_DB_OBS. These are consolidated into LIBS + and CONFIG_OBS. + * configure configure.in: Clean up test cases around thread support. + * configure.tgt (v850-*-*): Include v850ice.o and v850.lib if + host is Windows. + * c-valprint.c ch-valprint.c cp-valprint.c eval.c expprint.c + printcmd.c valops.c value.h values.c: Add bfd_section arg to + value_at and value_at_lazy. + * coffread.c dbxread.c elfread.c mdebugread.c minsyms.c symtab.h: + Add bfd_section arg to prim_record_minimal_symbol_and_info. + * corefile.c gdbcore.h printcmd.c valops.c: Use read_memory_section + instead of read_memory. It takes a bfd_section arg. + * coffread.c dbxread.c elfread.c gdb-stabs.h objfiles.h: Remove + unnecessary cast for assignment of struct dbx_symfile_info. + Struct objfile now uses a real pointer instead of PTR for this + element. + * dbxread.c (dbx_symfile_init): Stash bfd section pointers for + text, data and bss into dbx_symfile_info. + * exec.c (xfer_memory): Handle transfers for user-specified + sections. + * findvar.c (read_var_value locate_var_value): Copy bfd section + from the symbol to the value. + * gdb-stabs.h: Add section pointers for text, data and bss + sections. + * maint.c (translate address command): Add test code for overlay + address translation. + * printcmd.c (do_examine do_one_display): Now takes a bfd section + arg. + * (print_formatted x_command): Record current section along with + current address for repeated commands. + * sparc-nat.c (fetch_inferior_registers): Change + target_xfer_memory to target_{read write}_memory to allow changes + to target_xfer_memory interface for section info. + * symmisc.c (dump_msymbols print_symbol): Print section + assocaited with symbol. + * symtab.c (fixup_symbol_section): New routine to + add section info to symbols returned by lookup_symbol. + * symtab.h (struct general_symbol_info): Add bfd section to + symbols. + * target.c target.h (target_xfer_memory): Add bfd section to + args. + * (target_read_memory_section): New routine to read data from a + specific section. + * (target_memory_bfd_section): New global variable to pass bfd + section in to targets. + * valarith.c (value_add value_addr value_array): Preserve bfd + section when computing new value. + * value.h (struct value): Add bfd section to values. + * values.c (allocate_value value_copy): Initialize/preserve bfd + section. + * (unpack_double): Clean up _MSC_VER conditionals to remove + duplicate code. + * v850ice.c: New module to support communication with NEC's + PC-based ICE. + * config/v850/tm-v850.h (REGISTER_NAMES): Replace sp, gp, fp, and + ep names with rxx names. sp and fp are renamed via a different + mechanism. + +Fri Jan 3 14:20:05 1997 Geoffrey Noer + + * mn10300-tdep.c (mn10300_push_arguments): rewrote, + also removed code elsewhere that made use of RP_REGNUM. + * config/mn10300/tm-mn10300.h: ripped out RP_REGNUM, V0_REGNUM, + ARG0_REGNUM, ARGLAST_REGNUM (all not appropriate for mn10300 + arch.), redefined SAVED_PC_AFTER_CALL, EXTRACT_RETURN_VALUE, + EXTRACT_STRUCT_VALUE_ADDRESS, STORE_RETURN_VALUE. + +For older changes see ChangeLog-96 + +Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/gdb/gdb/ChangeLog-98 b/contrib/gdb/gdb/ChangeLog-98 new file mode 100644 index 0000000..bd19b49 --- /dev/null +++ b/contrib/gdb/gdb/ChangeLog-98 @@ -0,0 +1,7122 @@ +Thu Dec 31 15:26:13 1998 Stan Shebs + + * corelow.c (core_ops): Don't initialize statically. + (init_core_ops): New function, fills in core_ops. + (_initialize_corelow): Use it. + +Thu Dec 31 16:54:30 1998 David Taylor + + The following changes were made by + Elena Zannoni + Edith Epstein + David Taylor + + * config/pa/tm-hppa.h (INSTRUCTION_NULLIFIED): Change to read + nullify instruction bit from IPSW only when we are not in a system + call. + (STRCAT_REGISTER, pa_do_strcat_registers_info): Additional + parameter -- precision. + + * Makefile.in (BUILD_TUI): To build the tui, only when configured + with --enable-tui. + (YLWRAP): Use ylwrap to avoid problems on systems w/o bison. + (gdb$(EXEEXT)): Make it dependent on BUILD_TUI. + (all-tui): Remove dependency from phony target. + (c-exp.tab.c): Use ylwrap instead of bison. + (jv-exp.tab.c): Ditto. + (f-exp.tab.c): Ditto. + (m2-exp.tab.c): Ditto. + + * configure.in (ENABLE_CFLAGS): Define and export BUILD_TUI. + + * configure: Regenerated. + + * c-typeprint.c (c_type_print_base): Get to the method name by + skipping over all the namespaces, classes and '::'. + + * infcmd.c (run_command): Only call SOLIB_RESTART if it's + defined. + (detach_command): Ditto. + + * infptrace.c (call_ptrace): Add some debugging code. + + * infrun.c (follow_inferior_fork): Only define on HP. + (wait_for_inferior): Only call SOLIB_IN_DYNAMIC_LINKER if we have + shared libraries; restore test of IN_SOLIB_DYNSYM_RESOLVE_CODE + removed by HP. + + * Makefile.in (ALLDEPFILES): Add somread.c, hp-psymtab-read.c, + hp-symtab-read.c. + (SFILES): Remove the above files + (COMMON_OBS): Remove somread.o + (SFILES): Add the tui files to this, so they get + included in etags tables. + (all-tui): New rule, which does a recursive make in the tui + subdir. + (gdb$(EXEEXT)): Add tui-all to the list of + dependencies, and add tui/libtui.a to the link list. + (tui/libtui.a): When recursing, pass down + ${FLAGS_TO_PASS}. And don't echo the make command. This is + closer to what the other recursions do. + (HFILES_NO_SRCDIR) add hpread.h. + (COMMON_OBS): Add hp-psymtab-read.o, hp-symtab-read.o + Allow the TUI code to be conditionally enabled. + (TUI_TARGET, TUI_LIBRARY): New variables, whose values are set by + the configuration script. They're set to the empty string when + the TUI isn't enabled. + (gdb$(GDBEXT)): Use those, instead of referring to tui-all and + tui/libtui.a directly. + + * Makefile.in: Avoid spurious relinking. + (gdb$(EXEEXT)): Depend on the actual tui library, not on a + fictitious target. Since the fictitious target never existed, make + would always relink. + (tui/libtui.a): Renamed from all-tui. Always recurse to make sure + the library is up to date. + (TUI_TARGET): Variable removed; there's no need for it any more. + + * Makefile.in: Look for tui include files in the tui source dir. + + * Use automake's `aclocal' program to generate aclocal.m4, to allow + us to use automake macros in configure.in with impunity. + + * acconfig.h: Add an entry for the `TUI' symbol. + + * acinclude.m4: New file, containing the code from the old + aclocal.m4. Incorporate (by reference) ../bfd/acinclude.m4, not + ../bfd/aclocal.m4, since we only want bfd's local macros. + + * aclocal.m4: Now automagically generated. Just run aclocal! + + * annotate.c (annotate_catchpoint): New function. + + * annotate.h: Taking the new includes (symtab.h and gdbtypes.h). + not taking the ansic C build fix. + (annotate_catchpoint): Declare. + + * blockframe.c (blockvector_for_pc_sect): Check that the end of + the block is >= to the pc, not just >. + + * breakpoint.c (create_temp_exception_breakpoint): #If it out -- + nothing calls it. + (bpstat_stop_status): Don't call SOLIB_HAVE_LOAD_EVENT if it's not + defined; don't call SOLIB_HAVE_UNLOAD_EVENT if it's not defined. + (bpstat_get_triggered_catchpoints): If we don't have shared + library support, then don't call SOLIB_LOADED_LIBRARY_PATHNAME nor + SOLIB_UNLOADED_LIBRARY_PATHNAME. + (watch_command_1): Don't require a run before a watch command + unless we're on HP [it's an HP OS bug, not a generic limitation] + (catch_load_command_1): Don't define if no shared libraries. + (catch_command_1): Don't claim to support fork catchpoints unless + CHILD_INSERT_FORK_CATCHPOINT is defined, don't claim to support + vfork catchpoints unless CHILD_INSERT_VFORK_CATCHPOINT is defined, + don't clain to support shared library load catchpoints if shared + libraries aren't supported, and don't claim to support exec + catchpoints unless CHILD_INSERT_EXEC_CATCHPOINT is defined + + (bpstat_do_actions): If we just set cmd to NULL, don't then try to + set it to cmd->next as we'll SEGV. + (bpstat_do_actions): Simplify significantly. It's + now almost as simple as before the merge and it no longer has the + HP bug that breakpoint commands are executed repeatedly. + + (break_at_finish_command_1): Rewrite and make sure + selected_frame points to a frame before using it. Fix string + termination error. + (break_at_finish_at_depth_command_1): Ditto. + + (can_use_hw_watchpoints): New static variable. + (read_memory_nobpt): Test for breakpoint type bp_none. + (insert_breakpoints): Test for breakpoint type bp_catch_exec; + insure have a current frame before getting the frame address. + (remove_breakpoints): Check for breakpoints of types bp_none, + bp_catch_fork, bp_catch_vfork, and bp_catch_exec. + (bpstat_stop_status): Fix updates of b->hit_count. + (bpstat_have_active_hw_watchpoints): New function. + (create_exec_event_watchpoint): New function. + (watch_command_1): Use can_use_hw_watchpoints. + (catch_fork_command_1): Change name of function to call from + target_create_catch_(v)fork_hook to create_(v)fork_even_catchpoint. + (delete_breakpoint): Test for already deleted breakpoints; add + support for bp_catch_fork, bp_catch_vfork, and bp_catch_exec + breakpoints. + (_initialize_breakpoint): Add can-use-hw-watchpoints to list of + user settable debugger variables. + + (clear_command): When there is no argument + to the clear command, delete all breakpoints that are hit at + default line. This will include a breakpoint whose line number + does not correspond to the default line, but has been set at + the default address. + + (delete_breakpoint): Don't call bpstat_clear_actions, instead + clear things explicitly; if clearing breakpoint_at, then also + clear any associated actions so that bpstat_do_actions won't try + to execute them. + (_initialize_breakpoint): Fix function name for bx command. + + (tbreak_command): Remove static from declaration. + (maintenance_info_breakpoints): Ditto. + + (reattach_breakpoints): New funct definition, used with with + hardware watchpoints + (breakpoint_1): Change format and add entries to bptypes[] + (maintenance_info_breakpoints): Function is no longer static + + (_initialize_breakpoint): Removed a comment. + (exception_catchpoints_are_fragile, + exception_support_initialized): Define. + (breakpoint_here_p): Fixed syntax error in conditional + (disable_watchpoints_before_interactive_call_start): Fixed call to + check_duplicates. Need a section parameter. + (enable_watchpoints_after_interactive_call_stop): Fixed call to + check_duplicates. Need a section parameter. + (breakpoint_re_set_one): Fixed call to check_duplicates. Need a + section parameter. + (delete_command): Fixed syntax error in conditional + (breakpoint_re_set): Fixed some typos. + + (args_for_catchpoint_enable): New type for handling exceptions. + (current_exception_event): New variable for handling exceptions. + (insert_breakpoints): Check for additional breakpoint types -- + bp_catch_throw, bp_catch_catch, call_disabled. Also, do some + additional work to handle an exception catchpoint. + (remove_breakpoint): There are additional breakpoint types to + check for: Bp_catch_throw, bp_catch_catch, call_disabled. Also do + some additional work to remove the exception catchpoints + (breakpoint_init_inferior): New input parameter. If there are + exception catchpoints delete them. + (breakpoint_here_p): There are additional breakpoint enable + settings to check for: Shlib_disabled, call_disabled + (breakpoint_thread_match): There are additional breakpoint enable + settings to check for: Call_disabled + (ep_is_catchpoint): There are additional breakpoint types to check + for: Bp_catch_throw, bp_catch_catch + (ep_is_exception_catchpoint): New function + (bpstat_find_step_resume_breakpoint): New function + (bpstat_do_actions): Introduce a local copy of the bpstat + structure. + (print_it_normal): There are additional breakpoint types to check + for: Bp_catch_throw, bp_catch_catch Changeing the control + structure a bit (adding else ifs) Add code to print out info about + exceptions. + (bpstat_stop_status): There are additional breakpoint enable + settings to check for: Call_disabled. there are additional + breakpoint types to chack for: Bp_catch_catch and bp_catch_throw. + Check to see if stopped due to an exception. Minor fixes to the + catch_errors calls. Make sure to count all encountered + breakpoints. There was something funky going on previously with + the counting. + (bpstat_what): Add cases for new breakpoint types: + bp_catch_catch, bp_catch_throw. + (bpstat_get_triggered_catchpoints): Check for new breakpoint types + : Bp_catch_catch, bp _catch_throw. + (breakpoint_1): Account for new breakpoint types. + (describe_other_breakpoints): Account for new breakpoint enable + setting (call_disabled) + (check_duplicates): Account for new breakpoint enable setting + (call_disabled) + (disable_breakpoints_in_shlibs): New function + (disable_watchpoints_before_interactive_call_start): New function + (mention): Account for new breakpoint types. + (break_command_1): Some additional checking for a valid PC. + (watch_command_1): Some dditional checking to prevent a watch + before a run command. + (ep_parse_optional_filename): Simplified for loop. + (create_exception_catchpoint): New function + (cover_target_enable_exception_callback): New function + (handle_gnu_4_16_catch_command): This used to be thcatch_command_1 + function.e + (create_temp_exception_breakpoint): New function + (catch_command_1): Differs from gdb 4.16 and gdb 4.17. Is now + calling catch_exception_command_1 using the EX_EVENT_CATCH and + EX_EVENT_THROW values as parameters. + (clear_command): Additional comments + (delete_breakpoint): Handle exceptions. Check for additional + breakpoint enable settings: Shlib_disabled, call_disabled. + (delete_command): Hp folks are claiming that we should not delete + shlib_event breakpoints + (breakpoint_re_set_one): Moved call to check_duplicates. Add new + breakpoint types to switch statement. + (breakpoint_re_set_thread): New function + (enable_command): Account for new breakpoint types. + + (insertion_state_t): New enumerated type. + (remove_breakpoint): New param in funct prototype. + (insert_breakpoints): Check for bp_catch_fork and bp_catch_vfork. + (remove_breakpoints): Changed call to remove_breakpoint. + (detach_breakpoints): New function. + (remove_breakpoint): New parameter, is. Also changed the + way b->inserted is set. + (ep_is_catchpoint): New function. + (ep_is_shlib_catchpoint): New function. + (print_it_normal): Check for bp_catch_load, bp_catch_unload, + bp_catch_fork, bp_catch_vfork, bp_catch_exec. Also new code + to print out catchpoints properly. + (bpstat_stop_status): Check for bp_catch_fork, bp_catch_vfork, + and bp_catch_exec. Also, some code to check for catching a + shared library load/unload. + (bpstat_what): Added catch_shlib_event to class enumeration. + Defined new macro, shlr. Expanded the bpstat_what_main_action + table. Add cases for bp_catch_load, bp_catch_unload, + bp_catch_fork, bp_catch_vfork, and bp_catch_exec. + (bpstat_get_triggered_catchpoints): New function. + (breakpoint_1): Changes to bptypes definition. Also check for + bp_catch_load, bp_catch_unload, bp_catch_fork, bp_catch_vfork, + bp_catch_exec. Similar changes to the switch statement. + (set_raw_breakpoint): Initialize new breakpoint structure fields. + dll_pathname, triggered_dll_pathname, forked_inferior_pid, + exec_pathname. + (create_solib_load_unload_event_breakpoint): New function. + (create_solib_load_event_breakpoint): New function. + (create_solib_unload_event_breakpoint): New function. + (create_fork_vfork_event_catchpoint): New function. + (create_fork_event_catchpoint): New function. + (create_vfork_event_catchpoint): New function. + (mention): New cases for bp_catch_load, bp_catch_unload, + bp_catch_fork, bp_catch_vfork, bp_catch_exec. + (ep_skip_leading_whitespace): New function. + (ep_find_event_name_end): New function. + (ep_parse_optional_if_clause): New function. + (ep_parse_optional_filename): New function. + (catch_fork_kind): New enumerated type. + (catch_fork_command_1): New function. + (catch_exec_command_1): New function. + (catch_load_command_1): New function. + (catch_unload_command_1): New function. + (catch_throw_command_1): New function. + (catch_command_1): Now calls catch_throw_command_1. + (tcatch_command): New function. + (delete_breakpoint): Changed call to remove_breakpoint. + Also free the new fields in the breakpoint structure. + (breakpoint_re_set_one): Handle bp_catch_load, bp_catch_unload, + bp_catch_fork, bp_catch_vfork, bp_catch_exec. + (disable_command): Handle bp_catch_load, bp_catch_unload, + bp_catch_fork, bp_catch_vfork, bp_catch_exec. + (enable_command): Handle bp_catch_load, bp_catch_unload, + bp_catch_fork, bp_catch_vfork, bp_catch_exec. + (_initialize_breakpoint): Alter add_com call for catchpoints, + add add_com call for watchpoints. + + * breakpoint.h (enum bptype): New entries bp_catch_catch, + bp_catch_throw, and bp_none, bp_catch_load, bp_catch_unload, + bp_catch_fork, bp_catch_vfork,bp_catch_exec. Add declarations for + new functions bpstat_have_active_hw_watchpoints and + create_exec_event_catchpoint. + (tbreak_command): Add prototype. + (update_breakpoints_after_exec): Add prototype; update comments. + (reattach_breakpoints): New funct prototype declaration. + (enable): New enumerated value call_disabled. + (bpstat_find_step_resume_breakpoint): New funct decl. + (inf_context): New enumerated type. + (breakpoint_re_set_thread): New funct decl. + (breakpoint_init_inferior): New parameter. + (disable_watchpoints_before_interactive_call_start): New funct decl. + (enable_watchpoints_after_interactive_call_stop): New funct decl. + (disable_breakpoints_in_shlibs): New funct decl. + (struct breakpoint): New fields, dll_pathname,triggered_dll_pathname, + forked_inferior_pid,exec_pathname BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK. + (bpstat_get_triggered_catchpoints): New function. + (detach_breakpoints): New function. + (create_solib_load_event_breakpoint): New function. + (create_solib_unload_event_breakpoint) New function. + (create_fork_event_catchpoint): New function. + (create_vfork_event_catchpoint): New function. + (ep_is_catchpoint): New function. + (ep_is_shlib_catchpoint) New function. + (enum bpstat_what_main_action): New entry. + + * buildsym.c (finish_block): Get rid of processing_hp_compilation; + handle LOC_INDIRECT case. Set the BLOCK_GCC_COMPILED to the right + compiler. + (push_context): Add symbols for parameters to the context_stack. + (merge_symbol_lists): New function. Merges two symbol lists. + (struct context_stack): Add new field param. + + (processing_hp_compilation): New external var. + + * c-exp.y: Use external flag hp_som_som_object_present to decide + whether code was compiled by HP's compilers. Add two new C++ + tokens for true and false. + (yylex): Check for template name is done differently for the + HP/aCC compiler case; change some of the template processing code + for handling HP aCC templates. + + * c-lang.c (c_create_fundamental_type): Added case to handle + template args. Handle FT_BOOLEAN type. Set no sign flag for + FT_CHAR. + (cplus_builtin_types): New structure for c++ builtin types. + (cplus_language_defn): Use cplus_builtin_types instead of + c_builtin_types. + + * c-typeprint.c (c_type_print_base): Don't print 'privete' label + for a class if all members are private, similarly don't print + 'public' for a struct. Add support for sized enums (HP/aCC). get + rid of the 'static' keyword printed by the demangler for member + function, when printing the type of a class. 'static' will be + added by this function. If the demangled name is null, and the + method is not stubbed, get the signature by looking at the + information stored in the symbol structure. Remove printing of + 'const' and 'volatile' keywords for methods. This is now taken + care as part of the demangled member names. + (cp_type_print_method_args): New function. To print a C++ method + arguments and name to the output stream. + + (c_type_print_cv_qualifier): New function. Print out "const" and + "volatile" attributes. + (c_type_print_varspec_prefix): Print const or volatile qualifiers. + (c_type_print_args): Print 'void' for c++. + (c_type_print_varspec_suffix): Print 'void' for a no argument + function. + (c_type_print_base): Print const or volatile qualifiers. Do not + print 'unnamed union' if HP aCC compiler used. Distinguish + between struct and class based on the DECLARED_TYPE. Handle + HP/aCC compiler case for not printing vtable. Add Template + support. + + (cp_type_print_derivation_info): Print out 'protected' when + appropriate. This applies only to HP's compilers, not gcc. + + (c_val_print): Added parameter embedded_offset. Add + embedded_offset to valaddr in function calls; fix calls to + val_print and cp_print_value_fields. process TYPE_CODE_METHOD as + well. moved call to check_typedef out of conditional. added + embedded offset param to val_print call. + + (c_value_print): Add new parameter to call to val_print. + handle pointer to class case. Attempt to + determine the real type of the object to be printed. + ensure that const char *, const unsigned char * + come out without the type but the volatile variants + and the signed variants don't. + + * coff-solib.c (coff_solib_add): Add parameters to call + to symbol_file_add. + + * coff-solib.h: (Solib_REMOVE_INFERIOR_HOOK): New macro. defined + to 0. functionality not implemented for coff. + (SOLIB_CREATE_CATCH_LOAD_HOOK): New macro, generate error message + for coff. + (SOLIB_CREATE_CATCH_UNLOAD_HOOK): Ditto. + (SOLIB_HAVE_LOAD_EVENT): Ditto. + (SOLIB_LOADED_LIBRARY_PATHNAME): Ditto. + (SOLIB_HAVE_UNLOAD_EVENT): Ditto. + (SOLIB_UNLOADED_LIBRARY_PATHNAME): Ditto. + (SOLIB_IN_DYNAMIC_LINKER): Ditto. + (SOLIB_RESTART): Ditto. + + * command.c (find_cmd): New function. (lookup_cmd_1): Call it, + change parsing if tui_version or xdb_commands is set. + (_initialize_command): Install new alias if xdb_commands is set. + + * complaints.h: Add ifdef...endif pair at beginning and end of file. + + * config.in, configure: Regenerated. + + * config/pa/hppabsd.mh (NATDEPFILES): Added new files + hp-psymtab-read.o and hp-symtab-read.o. + * config/pa/hppahpux.mh (NATDEPFILES): Ditto. + + * config/pa/hppahpux.mh (TERMCAP): Use -lHcurses. + * config/pa/hppaosf.mh (NATDEPFILES): Ditto. + + * config/pa/hpux1020.mh (TERMCAP): Use -lHcurses. + (MH_CFLAGS): New flag, -D__HP_CURSES, this define + is used by HP's linker to find the correct curses library. + + * config/pa/hpux1020.mh: New file. + + * config/pa/hpux1020.mt: New file. + + * config/pa/hpux1100.mh (TERMCAP): Link against -lcurses, not + -lHcurses. The latter does not contain mvwaddstr, wscrl, or + wstbwlmkfzz. + + * config/pa/hpux1100.mh (TERMCAP): Use -lHcurses. + (MH_CFLAGS): New flag, -D__HP_CURSES, this define + is used by HP's linker to find the correct curses library. + + * config/pa/hpux1100.mh (TERMCAP): When hosting on hpux 11.00, use + -lHcurses rather than -lcurses. + + * config/pa/hpux1100.mh: New file. + + * config/pa/hpux1100.mt: New file. + + * config/pa/nm-hppah.h (CHILD_HAS_SYSCALL_EVENT): New macro + (CHILD_THREAD_ALIVE): New macro + (STOPPED_BY_WATCHPOINT): Add a condition to the macro, + ! stepped_after_stopped_by_watchpoint + (TARGET_ENABLE_HW_WATCHPOINTS): New macro + (hppa_enable_hw_watchpoints): New funct decl + (TARGET_DISABLE_HW_WATCHPOINTS): New macro + ( hppa_disable_hw_watchpoints): New funct decl + these are for HP's implementation of fast + watchpoints (via page protection). + (target_pid_to_str): New macro, calls hppa_pid_to_str + (target_tid_to_str): New macro, calls hppa_tid_to_str + + * config/pa/nm-hppah.h (CHILD_POST_WAIT): Delete; + (CHILD_CREATE_CATCH_FORK_HOOK): Replace with + CHILD_INSERT_FORK_CATCHPOINT and CHILD_REMOVE_FORK_CATCHPOINT. + (CHILD_CREATE_CATCH_VFORK_HOOK): Replace with + CHILD_INSERT_VFORK_CATCHPOINT and CHILD_REMOVE_VFORK_CATCHPOINT. + (CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC, + CHILD_INSERT_EXEC_CATCHPOINT, CHILD_REMOVE_EXEC_CATCHPOINT, + CHILD_HAS_EXECD, CHILD_REPORTED_EXEC_EVENTS_PER_EXEC_CALL, + CHILD_POST_ATTACH, TARGET_HAS_HARDWARE_WATCHPOINTS, + TARGET_CAN_USE_HARDWARE_WATCHPOINT, + TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT, + TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT, STOPPED_BY_WATCHPOINT, + HAVE_NONSTEPPABLE_WATCHPOINT, target_insert_watchpoint, + target_remote_watchpoint): New macros. + + * config/pa/nm-hppah.h (CHILD_XFER_MEMORY): Reinsert accidentally + deleted define. + + * config/pa/nm-hppah.h: + (PREPARE_TO_PROCEED): Defined macro to use + hppa_prepare_to_proceed. + (hppa_pid_to_str): Extern decl. + (hppa_tid_to_str): Extern decl. + (target_pid_or_tid_to_str): New macro definition. + (hppa_pid_or_tid_to_str): Extern decl. + (ENSURE_VFORKING_PARENT_REMAINS_STOPPED): New macro - for + handling events caused by a call to vfork. + (hppa_ensure_vforking_parent_remains_stopped): Extern decl. + (RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK): New macro - + for handling events caused by a call to vfork. + (hppa_resume_execd_vforking_child_to_get_parent_vfork): Extern decl. + + * config/pa/nm-hppah.h: Fix PREPARE_TO_PROCEED macro. + + * config/pa/nm-hppah.h: Fix for gcc compile on HPUX, change + PT_RDUAREA to PT_RUAREA. + + * config/pa/nm-hppah.h: Introduced an HPUXHPPA define. + A bit of a hack so that I can ifdef some code that + only works for the HP wildebeest debugger. + + * config/pa/nm-hppah.h: Lots of new CHILD_ defines; + process_event_kind enum. + + * config/pa/tm-hppa.h (BREAKPOINT32): New define. + (CALL_DUMMY_HAS_COMPLETED): New define. + + * config/pa/tm-hppa.h (STACK_ALIGN): New macro. + (NO_EXTRA_ALIGNMENT_NEEDED): New macro. + (PC_REQUIRES_RUN_BEFORE_USE): New macro. + (REGISTER_NAMES): Formatting in file changed. + (CR27_REGNUM): Base register for thread local storage. + (USE_STRUCT_CONVENTION): New macro used to decide whether + a function returning a value of type type will + put it on the stack or into registers (based on the + PA risc calling conventions). + (EXTRACT_RETURN_VALUE): Fixed calculation for extracting return value. + (VALUE_RETURNED_FROM_STACK): New macro. + (TARGET_READ_PC): Declared the function used in the definition. + (SKIP_TRAMPOLINE_CODE): Declared the function used in the definition. + (TARGET_WRITE_PC): Declared the function used in the definition. + (TARGET_READ_FP): Declared the function used in the definition. + + * config/pa/tm-hppa.h (STRCAT_REGISTER): Define macro for + future use. + (pa_do_strcat_registers_info): Moved function decl from + defs.h to this HPUX specific .h file. + + * config/pa/tm-hppa.h (USE_STRUCT_CONVENTION): Type_LENGTH returns + bytes, not bits; fix off by 8 error. + + * config/pa/tm-hppa.h: + New comment for obj_unwind_info definition + New typedef, obj_private_struct + + * config/pa/tm-hppa.h: Delete most target_ macros -- use default + versions instead; remove extraneous comma from proc_wait macro. + + * config/pa/tm-hppa.h: Get rid of macro HP_COMPILED_TARGET. + + * config/pa/tm-hppa.h: Removed redefinitions of + USE_STRUCT_CONVENTION and STACK_ALIGN macros. + + * config/pa/tm-hppa.h: Some new definitions + New macros: Arg0_REGNUM, ARG1_REGNUM, ARG2_REGNUM, ARG3_REGNUM. + target_pid_to_exec_file, target_acknowledge_forked_child, + target_create_catch_fork_hook, target_create_catch_vfork_hook, + target_has_forked, target_has_vforked, require_attach, + require_detach, proc_wait + New funct decls: Hppa_pid_to_exec_file, + hppa_acknowledge_forked_child, hppa_create_catch_fork_hook, + hppa_create_catch_vfork_hook, hppa_target_has_forked, + hppa_target_has_vforked, hppa_require_attach, + hppa_require_detach, process_wait + (unwind_table_entry): Added comments to describe struct fields. + + * config/pa/tm-hppah.h (somsolib.h): Include it. + + * config/pa/tm-hppah.h: + (CHILD_ENABLE_EXCEPTION_CALLBACK): New define + (CHILD_GET_CURRENT_EXCEPTION_EVENT): New define + + * configure.host (hppa-*-hpux10.20, hppa-*-hpux11.0*): New configs. + + * configure.in (AC_CHECK_HEADERS): Add check for term.h. + + * configure.in: Add an --enable-tui argument. + + * configure.in: Construct tui/Makefile from tui/Makefile.in. + + * configure.in: Use AM_PROG_CC_STDC. If we have the GUI, then we + need this to process libgui.h. + + * convex-tdep.c (decout): Change FILE to GDB_FILE. + + * corefile.c: Include objfiles.h, symfile.h. + (core_file_command): Attempt to determine the name of the symbol + file from the core file. + (read_memory_string): New function. + + * corefile.c (core_file_command): Temporary hack to make non-hpux + work. For, non-hpux, t->to_core_file_to_sym_file does not have a + reasonable value. No target_ops vector on the stack gives it a + non-zero value. fix later. + + * corelow.c (core_file_to_sym_file): Added new local variable, + failing command, and do some explicit type castings. + (core_ops): Add three new fields: to_has_syscall_event, + to_enable_exception_callback, to_get_current_exception_event. + Necessary since we still have oldstyle initialization in + this file + + * corelow.c: Include unistd.h + (core_file_to_sym_file): New function + (core_file_thread_alive): New function + (core_ops): Added new target ops vector fields. see below. And + yes we definitiely need to initialize them here, as long as + we're using static initialization. + + * cxux-nat.c (add_shared_symbol_files): Additonal params for calls + to symbol_file_add. + + * defs.h (gdb_file_isatty): New function decl. + + * defs.h (GDB_FILE): If TUI is defined, define a structure rather + than making this an alias for FILE. + (gdb_stdout, gdb_stderr): If TUI is defined, then define these + as pointers to variables of type GDB_FILE rather than making them + be aliases for stdout and stderr. + + * defs.h (TUIDO): Add definition conditionalized on definition + (or lack thereof) of TUI. + + * defs.h (command_class): Add two additional values. + (precision_type): New enum. + + * defs.h (gdb_fclose): Add declaration. + + * defs.h (store_address): Change prototype to match function. + + * defs.h (tui_version, xdb_commands, dbx_commands): Add decl's. + + * defs.h (gdb_file_deallocate): New function declaration + + * defs.h: + (streamtype): New enumerated type to distinguish between + output to a FILE and output to a buffer. + (tui_stream): New struct type, named GDB_FILE. Contains, + streamtype, FILE, buffer, and bufferlength fields. + (gdb_stdout): Of type GDB_FILE, will pass this around gdb + rather than stdout. + (gdb_stderr): Of type GDB_FILE, will pass this around gdb + rather than stderr. + (fputs_unfiltered_hook): Change stream parameter from FILE to + GDB_FILE + (flush_hook): Change stream parameter from FILE to GDB_FILE + (gdb_fclose): Fix declaration for gdb_fclose; parameter is now of + type GDB_FILE ** + (gdb_file_adjust_strbuf): New function declaration. function lives in + utils.c. + (gdb_file_init_astring): New function declaration. function lives + in utils.c + (gdb_file_get_strbuf): New function declaration. function lives + in utils.c + + * defs.h: Additional include files included when TUI is defined. + + * defs.h: Funct decl source_full_path_of. + + * demangle.c: Add HP_DEMANGLING_STYLE_STRING. + + * demangle.c: Added new demangling style, EDG_DEMANGLING_STYLE_STRING, + to the demanglers structure. This is for support of + Kuck & Assoc.'s changes for demangling. + + * eval.c (evaluate_subexp_standard): C++ member function changes. + + * eval.c (evaluate_subexp_standard): Verify TYPE_TARGET_TYPE is + non NULL before dereferencing it. + + * eval.c (evaluate_subexp_standard): With HP/aCC compiler it is not possible + to perform inferior calls via function pointers. + Resolve calls to overloaded functions using find_overload_match. + We cannot handle HP/aCC pointers to member functions. + Deal with HP/aCC pointers to members in various kind of expressions. + + * f-lang.c (f_printchar): Change FILE to GDB_FILE. + (f_printstr): Ditto. + (emit_char): Ditto. + + * f-lang.c (f_printstr): Change stdout to gdb_stdout. + + * f-typeprint.c (f_print_type): Change FILE to GDB_FILE. + (f_type_print_varspec_prefix): Ditto. + (f_type_print_args): Ditto. + (f_type_print_varspec_suffix): Ditto. + (print_equivalent_f77_float_type): Ditto. + (f_type_print_base): Ditto. + + * findvar.c (): Hp snapshot 3 changes. (extract_address): Coerce + return value from extract_unsigned_integer to CORE_ADDR. + (store_address): Change val from CORE_ADDR to LONGEST; changes to + support machines where CORE_ADDR and LONGEST are different sizes. + (get_saved_register): Coerce arg to store_address to LONGEST. + (read_relative_register_raw_bytes): Cast last arg to + store_address to LONGEST. (read_register): Cast return from + extract_address to a CORE_ADDR. (write_register_pid): Change val + from LONGEST to CORE_ADDR. (read_pc_pid): Save and restore + inferior_pid if necessary. (write_pc_pid): Ditto. + (read_var_value): Cast arg to store_address. + + * findvar.c (read_relative_register_raw_bytes_for_frame): New + function. + (read_relative_register_raw_bytes): Call it. + + * findvar.c (symbol_read_needs_frame): Handle LOC_THREAD_LOCAL_STATIC and + LOC_INDIRECT. + + * fork-child.c (fork_inferior): Chenge fifth parameter to be a + function returning void. + + * fork-child.c (fork_inferior): Delete unused variable f. + + * fork-child.c: + (Startup_WITH_SHELL): New macro -- interim fix for a bug + (breakup_args): New function -- breaks up an argument string into + an argument suitable for passing into execvp(). + (fork_inferior): Handling problems with starting up gdb with a shell. + -- again, this appears to be an interim fix. + + * fork-child.c: + (fork_inferior): Added a comment + (clone_and_follow_inferior): New function. + (startup_inferior): Minor formatting changes. + + * fork-child.c: + (fork_inferior): Hp change is problematic. The -f option has + different meanings for different shells. It is particularly + inappropriate for bourne shells. + + * fork-child.c: + (fork_inferior): Added new parameter, pre_trace_fun. + pre_trace_fun is a function pointer. For some targets, + like HPUX, this function gets called to prepare for forking + a child. + + * fork-child.c: + (fork_inferior): Fixed call to init_trace_fun + + * fork-child.c: + Moved definition of STARTUP_WITH_SHELL to inferior.h + Added a DEBUGGING macro. Currently set to 0. May remove + later. + breakup_args: Add DEBUGGING ifdefs. more sophisticated + parsing to break up args. + (fork_inferior): Rename kshell variable to shell. new local + variable, tryname. Make use of STARTUP_WITH_SHELL macro. + More error processing if starting up with a shell. + (startup_inferior): Distinguish between starting up with a shell + and not doing so. + + * gdbthread.h: + Declarations for load_infrun_state and save_infrun_state take + an additional parameter. + + * gdbthread.h: Note that sometime between gdb 4.16 and 4.17, + thread.h was renamed gdbthread.h + (load_infrun_state): Additional parameters + (store_infrun_state): Additional parameters + + * gdbthread.h: Include breakpoint.h + + * hp-psymtab-read.c (QUICK_LOOK_UP): Redefine to be 0. + (hpread_build_psymtabs): Deal with enums. + (hpread_start_psymtab): Include section offset. + (hpread_end_psymtab): Take care of offset. + + * hp-psymtab-read.c (TRUE): Define. + (FALSE): Define. + (file_exists): New function. Checks for existance of file. + (hpread_pxdb_needed): Rewrite. + (hpread_quick_traverse): Use correct demangling style. + Handle F77 case. + (hpread_get_header): Rewrite. + (hpread_get_textlow): Add support for DOC_FUNCTION. + (hpread_build_psymtabs): Make sure we do the right thing + for pxdb and F77. + + * hp-psymtab-read.c (hpread_pxdb_check): Change parenthesis positions. + + * hp-psymtab-read.c (hpread_quick_traverse): Compare CORE_ADDR + variable end_addr to 0 instaed of NULL to get rif of gcc warning. + + * hp-psymtab-read.c: + (Hpread_get_textlow): Added param to function + Defined convennience macros and some datatypes and variables for + processing the quick lookup-tables. Looks like the code existed + before, but has been munged. + (hpread_pxdb_needed): Major rearrangements of code. Additional local + variables. Also, more extensive checking for various scenarios: + debug info for optimized code vs. unoptimized code, pxdb has been + run vs. pxdb has not been run. + (VALID_FILE): New macro + (VALID_MODULE): New macro + (VALID_PROC): New macro + (VALID_CLASS): New macro + (FILE_START): New macro + (MODULE_START): New macro + (PROC_START): New macro + (FILE_END): New macro + (MODULE_END): New macro + (PROC_END): New macro + (FILE_ISYM): New macro + (MODULE_ISYM): New macro + (PROC_ISYM): New macro + (VALID_CURR_FILE): New macro + (VALID_CURR_MODULE): New macro + (VALID_CURR_PROC): New macro + (VALID_CURR_CLASS): New macro + (CURR_FILE_START): New macro + (CURR_MODULE_START): New macro + (CURR_PROC_END): New macro + (CURR_FILE_ISYM): New macro + (CURR_MODULE_ISYM): New macro + (CURR_PROC_ISYM): New macro + (TELL_OBJFILE): New macro + (pst_syms_struct): New typedef to keep track of the start/end symbol + table (LNTT) indices of psymtabs created so far. + (pst_syms_count): New variable + (pst_syms_size): New variable + (told_objfile): New variable + (init_pst_syms): New function. sets up psymtab symbol index stuff. + (clear_pst_syms): New function. clean up psymtab symbol index stuff. + (record_pst_syms): New function. add info about newest psymtab to symbol + index table. + (find_next_pst_start): New function. Find a suitable symbol table index. + (find_next_file_isym): New function + (find_next_proc_isym): New function + (find_next_module_isym): New function + (scan_procs): New function. Scan and record partial symbols for all + functions starting from specified index and in a specified code range. + (hpread_quick_traverse: Major rearrangement of code. The function + now uses all the nifty macros. There are some new local variables. + Check for EDG_DEMANGLING style. ifdef out some code for handling F77. + Previously, the function looped over all the modules in the table. + Now, the function loops over all the files, modules, and procedures. + With HP aCC and CTTI, it is possible for a compiled object to have a + file and no module. + (hpread_build_psymtabs): Added a section of code ifdefed by + QUICK_LOOK_UP. It check to see whether or not there are any globals + in the executable. Fix number of params to hpread_start_psymtab call. + Some changes to the way DNTT_TYPE_MODULE is handled. + (hpread_get_textlow): Change in signature, minor code changes. The + function finds the low address associated with a specified symbol. + In looking for the address for the symbol avoid going of the end of + the LNTT file. + + * hp-psymtab-read.c: Change TRUE to 1 and FALSE to 0. Do some + reformatting. + + * hp-psymtab-read.c: Include demangle.h + (trans_lang): New function to let gdb know the correct language. + (hpread_quick_traverse): Use ARM style demangling. + Demangle procedures names. + Use gdb language names instead of hp language names. + Add symbol to list using its demangled name. + + * hp-psymtab-read.c: New file. + (hpread_call_pxdb): New function. Call PXDB to process our file. + (hpread_pxdb_check): New function. Return TRUE if the file needs + pre-processing by PXDB and we have thus called PXDB to do this + processing and the file needs to be re-loaded. + (hpread_quick_traverse): New function. Traverse the quick look-up + tables, building a set of psymtabs. + (hpread_get_header): New function. Get appropriate header from obj + file, based on pxdb type + (hpread_symfile_init): No change from hpread.c + (hpread_build_psymtabs): If there are quick lookup tables, read those, + then scan the global section LNTT. Otherwise, just scan the whole LNTT. + Changed: Add a global function entry to the global partial symbol list. + Handle end of symbols, for QLT case. + In case of TAGDEF, if it is a class or a template, add the name to the + var_namespace, so that it is known as a type by gdb. + In case of CONSTANT, and it is global, add it to the globals. + (hpread_symfile_finish): No change from hpread.c + (hpread_get_lntt): Make it not static + (hpread_get_gntt): No change from hpread.c + (hpread_get_slt): Make it not static + (hpread_get_textlow): No change from hpread.c + (hpread_start_psymtab): No change from hpread.c + (hpread_end_psymtab): No change from hpread.c + + * hp-symtab-read.c (hpread_get_scope_start): Renamed. It was + hpread_get_depth. + (hpread_type_translate): Distinguish between signed and unsigned char + types. + (hpread_psymtab_to_symtab): Set flag for hp compilation. + (hpread_read_function_type): Append symbols for parameters to local + list as well as to the global list. Get the parameters types from the + local list instead of the global list. + (hpread_read_struct_type): Add new field num_fn_fields to next_fn_field + structure. Rewrite handling of templates + (hpread_type_lookup): Change handling of dntt_type_modifier. + (hpread_process_one_debug_symbol): Call hpread_get_scope_start instea + of hpread_get_depth. Handle enum as well. + (hpread_get_scope_depth): New function. Get nesting depth for a + DNTT entry. + + * hp-symtab-read.c (hpread_psymtab_to_symtab): Set + processing_gcc_compilation to 0. + + * hp-symtab-read.c (hpread_psymtab_to_symtab_1): Change stdout to + gdb_stdout; change fflush to gdb_flush. + (hpread_psymtab_to_symtab): Change fflush to gdb_flush. + + * hp-symtab-read.c (hpread_read_enum_type): Declare variable. + (hpread_read_struct_type): Eliminate references + to 'args' member of fn_field. + + * hp-symtab-read.c (hpread_read_struct_type): A static member + is now indicated by the bitsize field, not the bitpos. + Initialize physname to empty. + (fix_static_member_physnames): Use new macros to deal with + physnames. + + * hp-symtab-read.c (hpread_read_struct_type): Change references + to bitpos member of struct field to use the FIELD_BITPOS macro. + + * hp-symtab-read.c (hpread_read_struct_type): Comment out reference to + obsolete field fn_field.args. + Add struct complaint definitions for complaints. + (hpread_read_struct_type): Change call to complain. + (hpread_read_array_type): Change call to complain. + (hpread_type_lookup): Change call to complain. + (hpread_process_one_debug_symbol): Change calls to complain. + (hpread_type_translate): Change calls to complain. + + * hp-symtab-read.c (hpread_read_struct_type): Make sure bitvector + has been allocated before calling has_vtable. + + * hp-symtab-read.c (hpread_read_struct_type): Revert change, + just check for vtable without checking for bitvectors too. + + * hp-symtab-read.c: + (Hpread_expand_symtab): Change name of local variable from + at_end_of_module to at_module_boundary. + Also, if demangling style is already EDG, do not reset it + to the HP demangling style. + Change at_end_of_module param to hpread_process_one_debug_symbol + call to at_module_boundary. + No longer break out of loop when reach end of module. With CTTI, + the compiler can generate function symbols which are not in + any module. Typically they show up after the end of one + module and before the start of the next module. + (hpread_read_struct_type): Check that the debug info for + a TEMPLATE_ARG is correct. + (hpread_process_one_debug_symbol): Change name of at_end_of_module_p + param to at_module_boundary_p. + Also set *at_module_boundary_p = -1 if missing a module end and set + it to 1 when finished expanding the debug info. + Handle TLS variable. + + * hp-symtab-read.c: Include defs.h, symtab.h, gdbtypes.h, complaints.h. + (fixup_class): New static variable. + (fixup_method): New static variable. + (hpread_get_location): Rewrite. + (hpread_has_name): Add cases for DNTT_TYPE_DOC_FUNCTION and + DNTT_TYPE_DOC_MEMFUNC + (hpread_expand_symtab): Use HP demangling style. + Set hp_som_som_object_present to 1. + (hpread_type_translate): Error out if not immediate. Issue warning + if there is an unhandled type code. + (error_in_hpread_type_translate_complaint): Remove this structure. + (hpread_read_enum_type): Don't assume size of enum is always 4 bytes. + (hpread_read_function_type): Add new parameter to indicate a new block. + Do not add the parameters to the symbol list. + If the type was read in earlier, do not modify the type structure. + If we are creating a new block, set the local symbol list to be the + param list. + Need to mark this type as preprocessed. + (hpread_read_doc_function_type): New function. Read and internalize + a native DOC function debug symbol. + (hpread_read_struct_type): A method can be of type doc_function and + doc_memfunc too. + Handle case in which a method is read before its class. Deal with + incomplete method types. + Handle cases in which HP/aCC compiler creates operator names w/o + the 'operator' keyword. Rewrite the loop over the fileds. + (fix_static_member_physnames): New function. Adjust the physnames for + each static member. + (fixup_class_method_type): New function. Fix-up the type structure for a + class. + (hpread_read_array_type): Change complaint to warning. + (hpread_type_lookup): Add case for DNTT_TYPE_DOC_FUNCTION. + For structures/classes set static member to point to strings with full + names. + Change calls to hpread_read_function_type to pass extra parameter. + (hpread_record_lines): Handle case for SLT_NORMAL_OFFSET. + (class_of): New function. Given a function "f" which is a member of a class, + find the classname that it is a member of. + (hpread_process_one_debug_symbol): Deal with possible alias field from the + som record for the Function or Entry type. + Do the demangling ourselves if the gdb demangler failed. + Add support for DOC functions. + For function types, add parameters to local list. + (hpread_get_scope_depth): Make this function a no-op. + (hpread_adjust_bitoffsets): New function. Adjust the bitoffsets for all + fields of an anonymous union. + (hpread_get_next_skip_over_anon_unions): New function. Skip over anonymous + unions. + + * hp-symtab-read.c: Include demangle.h + (hpread_expand_symtab): Ensure we are using ARM-style demangling. + (hpread_process_one_debug_symbol): Set the mangled and demangled + names for functions. + Record the class name to generate the demangled names of member + functions. + + * hp-symtab-read.c: New file. + (hpread_get_depth): No change from hpread.c + (hpread_get_line): No change from hpread.c + (hpread_get_location): No change from hpread.c + (hpread_has_name): Make it not static. Return 1 for DNTT_TYPE_BLOCKDATA + and DNTT_TYPE_MEMFUNC. Return 0 for CLASS_SCOPE, REFERENCE,PTRMEM, + PTRMEMFUNC, CLASS, GENFIELD, VFUNC, MEMACCESS, INHERITANCE, + FRIEND_CLASS, FRIEND_FUNC, MODIFIER, OBJECT_ID, TEMPLATE, TEMPLATE_ARG, + FUNC_TEMPLATE, LINK. + (hpread_psymtab_to_symtab_1): No changes from hpread.c + (hpread_psymtab_to_symtab): Make it a static function + (hpread_expand_symtab): Modified + (hpread_type_translate): If not typep.dntti.immediate do not abort, + but complain and return. Same for default action. Handle more HP_TYPEs. + (hpread_lookup_type): Initially allocate a correct-size type-vector. + (hpread_alloc_type): Reset type_addr only if a type was allocated. + (hpread_read_enum_type): If this has already a type associated, return. + (hpread_read_function_type): Do different things depending on whether + function is a MEMFUNC, a TEMPLATE, a FUNCTION som record. + Do not use the LOC_REGPARM_ADDR symbol class. + (hpread_read_struct_type): Handle classes and templates too. Major + rewrite. + (hpread_get_nth_template_arg): New function. + (hpread_read_templ_arg_type): New function. + (hpread_read_set_type): No change from hpread.c + (hpread_read_array_type): Modified + (hpread_read_subrange_type): Add handling of more DNTT entries. + added support for templates, classes, references, virtual functions. + (hpread_type_lookup): Handle DNNT_TYPE_MODULE. + (hpread_record_lines): No changes from hpread.c + (hpread_process_one_debug_symbol): Handle WITH, COMMON, + CLASS_SCOPE. Expand TAGDEF case to handle classes and templates. + + * hppa-tdep.c (pa_do_strcat_registers_info): Has a new parameter, + precision, which is passed into the call to pa_strcat_fp_reg to + indicate whether to display the floating point registers using + single or double preceision. + (pa_strcat_registers): Introduce local variable, precision, and + pass it into call to pa_strcat_fp_reg. + (pa_strcat_fp_reg): Modified function. New parameter, precision, + used by function to decide whether to use single or double + precision. Also added the code to put a double precision value + into a buffer. + + * hppa-tdep.c: Add'l includes , + , declare pa_register_look_aside, define is_pa_2. + (rp_saved): Check for where to read the return pointer from. + (pa_do_registers_info): Handle is_pa_2. (pa_register_look_aside): + new function. (pa_print_registers): Handle is_pa_2. + (in_solib_call_trampoline): Handle a compiler/linker error. + (skip_trampoline_code): Changes to some masks used in examining + instructions. (inst_saves_fr): Test for FSTWS instruction. + (skip_prologue): Renamed to skip_prologue_hard_way. + (after_prologue): New function. (skip_prologue): New function. + + * hppa-tdep.c (after_prologue): If f is NULL, don't dereference + it. + + * hppa-tdep.c (after_prologue): If no debug info, return zero + telling caller that we need to find the end of the prologue via + the hard way (instruction examination). + + * hppa-tdep.c (find_unwind_entry): Avoid dereferencing a null + pointer. + + * hppa-tdep.c (hppa_pid_to_exec_file): Deleted -- no longer used. + + * hppa-tdep.c (hppa_prepare_to_proceeed): Add prototype. + (read_unwind_info): Purecov comments, bug fixes. + (find_unwind_entry): Purecov comments, bug fixes. + (find_stub_with_shl_get): Purecov comments. + (frame_chain): Additional parens. + (hppa_push_arguments): Changes to commented out version of routine. + (hppa_fix_call_dummy): Purecov comments, fix location of end.o. + (in_solib_call_trampoline): Purecov comments. + (in_solib_return_trampoline): Purecov comments. + (setup_d_pid_in_inferior): Fix location of end.o. + (initialize_hp_cxx_exception_support): Fix location of end.o. + (child_enable_exception_callback): Purecov comments. + + * hppa-tdep.c: + (Pa_do_strcat_registers_info): New routine. called by + tui/tuiRegs.c:_tuiRegisterFormat to place a register name + and value into a string buffer. Interface may change in + future. Checking this in so that we have something + functional for HP. + (pa_strcat_registers): New routine, called by + pa_do_strcat_registers_info. Does same thing as + pa_print_registers except it takes a stream parameter. + This routine should disappear in future. Checking in + so that we have something functional to give HP + (pa_strcat_fp_reg): New routine, called by + pa_do_strcat_registers_info and pa_strvat_registers + to place a floating point register name and value into + a buffer. This interface may change in future. + Checking in so that we have something functional to give HP. + + * hppa-tdep.c: (Pa_print_fp_reg): Change prototype to match def'n. + (pa_register_look_aside): Fix comment immediately before function. + + * hppa-tdep.c: Changes to better support stack unwinding, + reading and writing registers for HPUX. The HP folks had + an advantage ... access to a runtime architecture spec ;-}. + New includes: Ptrace.h + (internalize_unwinds): Initialize new fields in table. + (read_unwind_info): Entries in the table are now more complex + structures. References of the form ...->table[index].stub_type + are now ...->table[index].stub_unwind.stub_type. + (find_proc_framesize): Added a check for pc == 0. + (rp_saved): Entries in the table are now more complex + structures. References of the form ...->table[index].stub_type + are now ...->table[index].stub_unwind.stub_type. + (frameless_function_invocation): Stub_type becomes + stub_unwind.stub_type + (saved_pc_after_call): Stub_type becomes stub_unwind.stub_type + (hppa_frame_saved_pc): Stub_type becomes stub_unwind.stub_type + (frame_chain_valid): Stub_type becomes stub_unwind.stub_type + (hppa_call_dummy): Stub_type becomes stub_unwind.stub_type + (pa_print_fp_reg): Additional params to call val_print + (in_solib_call_trampoline): Stub_type becomes stub_unwind.stub_type + (in_solib_return_trampoline): Stub_type becomes stub_unwind.stub_typ + (skip_trampoline_code): Additional code to handle external + dyncalls. Also stub_type becomes stub_unwind.stub_type + (hppa_pid_to_exec_file): New funct. FOr HPUX 10.0 and beyond there + is an explicit ptrace request for getting the pathname associated + with a process id (pid). + + * hppa-tdep.c: Fix for gcc compile on HPUX + (hppa_pid_to_exec_file): Remove unwanted param from + call to call_ptrace. Note, hppa_pid_to_exec_file goes + away in subsequent hp snapshots. + + * hppa-tdep.c: Include bfd.h. + include dl.h + (args_for_find_stub): New structure. + (find_unwind_entry): Deal with null input pc value. + (rp_saved): Ditto. + For the import stub, return -24 always. + (hppa_frame_saved_pc): Save old pc value, to detect we are in a loop. + (init_extra_frame_info): Use TARGET_READ_FP. + (frame_chain): Include thread support. + If the caller's pc is zero, we loose and return, just like stack bottom. + Disable warning about being unable to find unwind info. + (hppa_push_arguments): Rewrite. + (hppa_value_returned_from_stack): New function. Handles returning a value + larger that 64 bits, stored on the stack. + (find_stub_with_shl_get): New function. To look up symbols in shlibs. + (cover_find_stub_with_shl_get): New function. Cover routine for + find_stub_with_shl_get to pass to catch_errors. + (hppa_fix_call_dummy): Comment out old stub mechanism. Rewrite using dyncall. + (target_read_fp): New function. + (pa_do_registers_info): Floating point registers start at FP4. + (pa_print_registers): Use FP4_REGNUM instead of 72. + (skip_trampoline_code): Do machine instruction matching for PA2.0. + (setup_d_pid_in_inferior): New function. Exception handling support. + (initialize_hp_cxx_exception_support): Ditto. + (child_enable_exception_callback): Ditto. + (child_get_current_exception_event): Ditto. + + * hppah-nat.c (child_post_wait, child_post_follow_vfork, + child_post_follow_inferior_by_clone): New functions. + + * hppah-nat.c (child_xfer_memory): Make sure the call to ptrace really + fails before we give up. + (hppa_pid_to_str): New function. Format a process id. + (hppa_tid_to_str): New function. Format a thread id. + + * hppah-nat.c (child_xfer_memory): Use xmalloc, not alloca. + (child_post_wait): Delete. + (child_post_follow_vfork): Delete decl of child_ops; delete + large chunks of function -- let it be handled by the normal + mechanism that notices and handles exec events, in resume(). + + * hppah-nat.c (require_notification_of_exec_events): New function; + just notify of exec events, not all events, and just the specified + pid, don't include it's children (10.20 version). + (child_acknowledge_created_inferior): Call new function + require_notification_of_exec_events instead of + require_notification_of_events. + + * hppah-nat.c [!GDB_NATIVE_HPUX_11]: Move HPUX 10.x-specific + support code here from infptrace.c. + + * hppah-nat.c: Removed #define ptrace call_ptrace + replaced all calls to ptrace with calls to call_ptrace + (parent_attach_all): Removed call to ptrace + + * hpread.c (hpread_psymtab_to_symtab_1): Change fflush to + gdb_flush; change stdout to gdb_stdout. + (hpread_psymtab_to_symtab): Change fflush to gdb_flush. + + * hpread.h: New file. Includes all includes, struct defs, defines + from hpread.c. + + * infcmd.c + (attach_command): New local variable, exec_file, added code to + determine exec_file from pid if exec_file is not already known, + call new target operation, target_post_attach -- a no-op unless + on HPUXHPPA + (detach_command): After detaching, do a SOLIB_RESTART + + * infcmd.c (objfiles.h): Fix typo on include line. + + * infcmd.c (run_command): Only call SOLIB_RESTART if it's + defined. + (detach_command): Ditto. + + * infcmd.c: + (run_stack_dummy): Add calls to + disable_watchpoints_before_interactive_call_start and + enable_watchpoints_after_interactive_call_stops + (finish_command): Alter code handling the evaluation and printing + of the target function's return value. + (attach_command): When given a pid, but no exec file, try to determine + the exec file from the process. If the process does not record a + full path name, try to qualify the filename against the source path. + (_initialize_infcmd): Add some verbiage about how to use the attach command + + * infcmd.c: + Include objfiles.h + (run_command): If program has already been started, and decide + to restart it, then kill the target, flush the caches, + call init_wait_for_inferior. Also purge old solib objfiles. + + * infcmd.c: Changed calls to val_print, using a new macro, + SOLIB_RESTART + (run_command): Calls SOLIB_RESTART + (do_registers_info): Changed calls to val_print + + * infcmd.c: Made the symfile.h include preceed the + objfiles.h include. The other ordering caused a + compile problem (incompletely defined types). + + * inferior.h (REQUIRE_DETACH): Fix default definition. + * inftarg.c (child_post_attach): Fix declaration, make static. + (proc_wait): Make globally visible. + (child_insert_fork_catchpoint, etc): Fix return type. + + * inferior.h (STARTUP_WITH_SHELL): New define. + (START_INFERIOR_TRAPS_EXPECTED): New define + + * inferior.h (fork_inferior): Change fifth parameter to be a function + returning void. + + * inferior.h (proc_wait): Declare. + + * inferior.h: + (Require_ATTACH): New macro + (REQUIRE_DETACH): New macro + (detach): Definition is now an extern + (clone_and_follow_inferior): New definition, it's also an extern + + * inferior.h: + (Require_attach): Default definition for require_attach funct + (require_detach): Default definition for require_detach funct + (pre_fork_inferior): New funct decl for function defined in + infptrace.c + (fork_inferior): New parameter in funct decl. + + * inferior.h: + New variable decls: Inferior_ignoring_startup_exec_events, + inferior_ignoring_leading_exec_events -- these variables + are used when processing an exec call. + (CALL_DUMMY_HAS_COMPLETED): New default macro -- for targets + where PC in call dummy implies that call dummy has + completed. Note, that on HPUX this inference does not hold. + + * infptrace.c + (require_notification_of_events): New function + (child_acknowledge_created_inferior): Previously named + hppa_acknowledge_forked_child. Also calling + require_notification_of_events and clearing some semaphore + variables + (child_post_startup_inferior): New function + (child_create_catch_fork_hook): Previously named + hppa_create_catch_fork_hook + (child_create_catch_vfork_hook): Previously named + hppa_create_catch_vfork_hook + (child_has_forked): Previously named hppa_target_has_forked + (child_has_vforked): Previously named hppa_target_has_vforked + (process_wait): Changed to call target_post_wait + (attach): Add call to require_notification_of_events + (child_pid_to_exec_file): New function + (hppa_require_attach): New local variable, pt_status + (hppa_get_process_events): New function + + * infptrace.c (call_ptrace): Simplify control flow. + (proc_wait): Move here from inftarg.c, add target_post_wait call. + + * infptrace.c (call_ptrace): Add some debugging code. + + * infptrace.c (child_pid_to_exec_file): Declare variable. + + * infptrace.c (kill_inferior): Clean up call to proc_wait. + + * infptrace.c: + (Call_ptrace): When the ptrace request is PT_SETTRC, + call ptrace and then call parent_attach_all. + + * infptrace.c: + (Child_has_syscall_event): New function. only applicable + (for now) on HPUX 10.30 and beyond via the ttrace call. + In infptrace.c there is a default operation. + With ttrace, it is possible to tell the kernel to + notify the debugger that the target program is about to make + or return from a syscall. + (child_thread_alive): New function. a default function. + ptrace doesn't support kernel threads. + (hppa_enable_page_protection_events): Defualt function + (hppa_disable_page_protection_events): Default function + + * infptrace.c (child_pid_to_exec_file): Fix number of params to + cal_ptrace call. + + * infptrace.c (hppa_pid_or_tid_to_str): New function. + (hppa_switched_threads): New function. + (hppa_ensure_vforking_parent_remains_stopped): New function. + (hppa_resume_execd_vforking_child_to_get_parent_vfork): New function. + + * infptrace.c: Most of the changes found in infptrace.c should + be moved to hppah-nat.c + (PT_VERSION): A new define + (startup_semaphore_t): A new struct type. it is used to + coordinate the parent and child processes after a fork and + before an exec on HPUX. + (call_ptrace): Changes to determine whether the ptrace + request is for starting the tracing of the target process. + (parent_attach_all): New funct. used on HPUX for coordinating + the parent and child processes after a fork and before and exec. + (hppa_acknowledge_forked_child): New funct. prabably belongs + in hppah-nat.c + (hppa_enable_catch_fork): New funct. probably belongs in + hppah-nat.c + (hppa_disable_catch_fork): New funct. probably belongs in + hppah-nat.c + (hppa_create_catch_fork_hook): New funct. probably belongs in + hppah-nat.c + (hppa_enable_catch_vfork): New funct. probably belongs in + hppah-nat.c + (hppa_disable_catch_vfork): New funct. probably belongs in + hppah-nat.c + (hppa_create_catch_vfork_hook): New funct. probably belongs to + hppah-nat.c + (hppa_target_has_forked): New funct. probably belongs in + hppah-nat.c + (hppa_target_has_vforked): New funct. probably belongs in + hppah-nat.c + (process_wait): New funct. also ifdefed for proc_wait. + (kill_inferior): Call proc_wait rather than wait. this is + pretty hacky. + (pre_fork_inferior): New function. used only by HPUX. + probably should be defined elsewhere. + + * infrun.c (follow_inferior_fork): Only define on HP. + (wait_for_inferior): Only call SOLIB_IN_DYNAMIC_LINKER if we have + shared libraries; restore test of IN_SOLIB_DYNSYM_RESOLVE_CODE + removed by HP. + + * infrun.c (normal_stop): Add a call to the TUIDO + macro just before the annotate_stopped label. This + updates the windows after each program stop. + + * infrun.c (normal_stop): Verify stop_command is non-zero before + dereferencing it (it won't be set if dbx_commands is set). + + * infrun.c (resume): Add #ifdef HPPAHPUX around HPUX-specific + code. + + * infrun.c (resume): Add missing semicolon. + + * infrun.c (wait_for_inferior): Fix syntax error. + + * infrun.c (follow_fork_mode_kind_names): Removed "both" option. + (follow_fork): Added parameters. additional code for handling + following of parent, following of child + (resume): Added code for deciding how to resume in presence of + fork. Additional params to follow_fork call. + + * infrun.c (follow_exec): Ifdef for HPUXHPPA for the moment, the + code in here assumes the existance of the child_ops target + vector. This is incorrect for Solaris. + + * infrun.c (resume): Fixed ifdefs, HPPAHPUX -> HPUXHPPA. + + * infrun.c (wait_for_inferior): Fixed a matching parens problem -- + matching curly brace inside ifdefed code which is not being + compiled. Change local validFlag to be an 'int' rather than a + 'bool' and fixed the corresponding assignment statements. + + * infrun.c: + Two new global variables: Inferior_ignoring_startup_exec_events and + inferior_ignoring_leading_exec_events. + New static variables: Parent_of_vfork_trap_expected_and_ignorable, + step_resume_breakpoint, through_sigtramp_breakpoint, pending_follow, + follow_vfork_when_exec + (follow_inferior_fork): Does what follow_fork did! + (follow_fork): Is now a wrapper function for follow_inferior_fork + (follow_vfork): Is now a wrapper function for follow_inferior_fork + (follow_exec): New function, handles an exec event. + (resume): Remove 3 local variables: Child_pid, has_forked, has_vforked. + move and expand code that tries to follow a fork (i.e. also check + for vfork and exec + (init_wait_for_inferior): Initialize the new structure, pending_follow + (delete_breakpoint_current_contents): When deleting all the breakpoints also + set the breakpoint struct pointer to NULL. + (wait_for_inferior): A number of changes. + The step_resume_breakpoint and through_sigtramp_breakpoint local + variables are now visible in entire module. + Changed name of variable from child_inferior_pid to saved_inferior_pid. + Added several cases to the event processing switch statement: + Target_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED, TARGET_WAITKIND_EXECD. + Also, for TARGET_WAITKIND_STOPPED, check to see if expecting a trap + from the parent of a vfork (ignorable) otherwise break as usual. + When determining the value of 'random_signal' (0 or 1), no longer check for + catchpoints. + When determining how to handle unexpected signals, must now take into + account fork, vfork, and exec. + Change call to PC_IN_CALL_DUMMY to a call to CALL_DUMMY_HAS_COMPLETED + At stop_stepping label, check to see if stopped for fork or + vfork event. + + * infrun.c: New code is related to threads and fork/vfork/exec. + New static variable: Thread_step_needed + Deleted static variable: Parent_of_vfork_trap_expected_and_ignorable + Altered the pending_follow and fork_event structs + (follow_inferior_fork): Before detaching from child and removing + all breakpoints form it -- but only if forking or following + vforks as soon as they happen. Also reset the solib inferior hook. + The same kind of logic applies to hitting step_resume_breakpoints + (calling breakpoint_re_set_thread) and to resetting and inserting + breakpoints. + (follow_exec): Forward decl + (follow_vfork): Check to see if gdb followed the child. If + the child exec'd before gdb saw the parent's vfork event + then call follow_exec. + (follow_exec): If the exec occured after a vfork, then follow + the vfork as well. Do it before following the exec. + Make sure to update breakpoints after and exec + (resume): New local variable, should_resume. + Change parameters in calls to follow_fork, follow_vfork, and + follow_exec. Some changes to the way various pending_follow.kind + situations are handled (there's TARGET_WAITKIND_FORKED, + TARGET_WAITKIND_VFORKED, ARGET_WAITKIND_EXECD. Some additional + conditions to check before deciding to resume the target (i.e. + should_resume=1, stepping?, thread_step_needed?i, regular + resume?) + (proceed): When proceeded at location that does not have a breakpoint + set thread_step_needed=0 to indicate that it is not necessary to + single step thread over breakpoint. SOme additional checks to see + if it is necessary to step thread over breakpoint. + (start_remote): Remove call to clear_proceed_status. + (init_wait_for_inferior): Initialize new fields in fork_event + structure and add a call to clear_proceed_status. + (wait_for_inferior): New local variable: New_thread_event. + Initialize thread_step_needed = 0. + Minor massaging of conditions for adding a new thread to the thread list. + No longer resuming execution after adding a new thread. Let user play with thread first. + Some changes in the way TARGET_WAITKIND_FORKED, ARGET_WAITKIND_VFORKED, + TARGET_WAITKIND_EXECD are handled -- this is all HPUX related. + Simplified TARGET_WAITKIND_STOPPED -- HP previously had some + more complicated code in here. + Moved the code to resume threads to after the large case statement that processes the events. + Additional processing for stop_signal=TARGET_SIGNAL_TRAP. + Cleanup code at process_event_stop_test label. + Set thread_step_needed when processing a BPSTAT_WHAT_SINGLE. + Minor massaging of fork/vfork/exec part of stop_stepping code. + (normal_stop): Minor changes. calling show_and_print_stack_frame. + (xdb_handle_command): New function + (_initialize_infrun): Handle xdb_commands. also handle dbx commands + + * infrun.c: Changes to support following forks, and handling + catchpoints. + (follow_fork_mode_kind_names): New array + (follow_fork): New function. implements the follow parent, + or child functionality. + (resume): Additions to check whether the target process + just forked and decide which process to follow. + (wait_for_inferior): Additional variables (child_inferior_pid, + stepping_through_solib_after_catch, + - stepping_through_solib_catchpoints. + - Altered CURRENTLY_STEPPING macro to check for stepping through + a shared library after hitting a catchpoint. + - Add parameters to save_infrun_state call + - Check for fork and vfork when deciding if event is a random + signal + - When considering stops due to breakpoints, check for + BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK + - Check for stop due to an explicit catchpoint + - When checking for single stepping event, also check for + stepping to get out of dynamic linker's hook after catching + a shlib event + (is_internal_shlib_eventpoint): New funct. check to see if + event type is bp_shlib_event. + (stopped_for_internal_shlib_event): New funct. check for shlib + events + (stopped_for_shlib_catchpoint): New funct. check for catchpoints. + (normal_stop): Additions to check for shlib event + (set_follow_fork_mode_command): New funct. handles the new follow + fork command. + (_initialize_infrun): Additions for follow-fork-mode command. + + * infrun.c: Ifdefing references to + switched_from_inferior_pid for HPUXHPPA. They don't seem + useful for Solaris (i.e. non-HPUX) + + * infrun.c: Included tuiData.h and tuiDataWin.h, ifdefed for TUI. + Included top.h. New static variables: Switched_from_inferior_pid, + number_of_threads_in_syscalls. + (follow_inferior_fork): If there is a step_resume breakpoint + explicitly reset the thread number. + (resume): For TARGET_WAITKIND_VFORKED, removed a check for getting + the vfork event to soon. + (init_wait_for_inferior): Added parameter to call to + breakpoint_init_inferior. Initialize number_of_threads_in_syscalls. + (wait_for_inferior): New local variables: Prev_sal, + enable_hw_watchpoints_after_wait, stepping_through_sigtramp, + stepped_after_stopped_by_watchpoint. Enable watchpoints after a wait. + Added cases for TARGET_WAITKIND_SYSCALL_ENTRY and + TARGET_WAITKIND_SYSCALL_RETURN. + Do additional processing if stop due to breakpoint, but breakpoint is + only valid for a thread other than the one currently running. Additional + parameters to save_infrun_state and load_infrun_state. Some additional + processing for BPSTAT_WHAT_STEP_RESUME. Some additional processing to + handle stepping over a function. + (normal_stop): Added notification of switching threads. ifdefing some + TUI changes and leaving out non-essential TUI changes. + (restore_selected_frame): Ifdefing some TUI changes + (restore_inferior_status): Ifdefing some TUI changes + + * infrun.c: Removed the TUI ifdefs and TUI code. Also removed + include for top.h. HP introduced this. I'm taking it out. + + * inftarg.c (child_detach_from_process): Declare. + (child_attach_to_process): Declare. + (child_stop): Make static to match declaration. + + * inftarg.c (ptrace_him): Change prototype back to return int. + + * inftarg.c (ptrace_me): Remove debug output, pass NULL to + fork_inferior if not HPUX. + + * inftarg.c: + (child_require_attach): New funct prototype and definition + (child_require_detach): New funct prototype and definition + (proc_wait): Funct prototype and definition are enclosed by + proc_wait ifndef + (child_attach_to_process): New function, does most of the + work that child_attach used to do and some additional + work to determine whether gdb is already attached to the + target how to react. + (child_attach): Altered. It's now a wrapper for + child_attach_to_process. + (child_require_attach): New function, called if should attach + even when gdb is already attached to target. + (child_detach_from_process): New function, does most of the + work that child_detach used to do and some additional work + to determine whether gdb is currently attached to the target. + (child_detach): Altered. It's now a wrapper for + child_detach_from_process. + (child_require_detach): New function, called if should try to + detach even when gdb is not attached to target. + (ptrace_him): Calls a new function, target_acknowledge_forked_child. + Currently, target_acknowledge_forked_child, is only defined to + do something for HPUX. + (child_create_inferior): Changed call to fork_inferior. + (child_ops): Added to_require_attach and to_require_detach fields + to the child_ops target ops vector. + + * inftarg.c: + Some hacks for ttrace work + (child_wait): Additional local variables, additional code in + while loop to check for: Process exited, process forked, + process vforked, process execd + (child_thread_alive): John B. seems to think that the kill + call is inapproapriate for HPUX. + (child_attach_to_process): Using strtol rather than atoi. + no longer check for case where there is no known exec file. + (child_post_attach): New function, a default, a no-op + (child_insert_fork_catchpoint): New function, a default, a no-op + (child_remove_fork_catchpoint): New function, a default, a no-op + (child_create_catch_fork_hook): Deleted + (child_create_catch_vfork_hook): Deleted + (child_insert_vfork_catchpoint): New function, a default, a no-op + (child_remove_vfork_catchpoint): New function, a default, a no-op + (child_can_follow_vfork_prior_to_exec ):new function, a default, + a no-op + (child_insert_exec_catchpoint): New function, a default, a no-op + (child_remove_exec_catchpoint): New function, a default, a no-op + (child_has_execd): New function, a default, returns 0 + (child_reported_exec_events_per_exec_call): New function, a + default, returns 1 + (child_has_exited): New function, a default. + (child_core_file_to_sym_file): New function, a default, returns NULL. + (child_ops): Initialize new target_ops vector fields to the + child* functions. + * infptrace.c: + (Call_ptrace): For HPUX, handle additional requests: Pt_CONTIN1, + PT_STEP1. + (require_notification_of_events): Add several signals to the + set of events requiring notification: Ptrace_SIGNAL, + PTRACE_EXEC, PTRACE_FORK, PTRACE_VFORK + (child_acknowledge_created_inferior): This function is only + defined if CHILD_ACKNOWLEDGE_CREATED_INFERIOR is defined. + (child_post_startup_inferior): Function is only defined if + CHILD_POST_STARTUP_INFERIOR is defiend. Also, now call + require_notification_of_events. + (child_create_catch_fork_hook): Deleted + (child_create_catch_vfork_hook): Deleted + (child_insert_fork_catchpoint): New function + (child_remove_fork_catchpoint): New function + (child_insert_vfork_catchpoint): New function + (child_remove_vfork_catchpoint): New function + (child_has_forked): Now enclosed by a CHILD_HAS_FORKED ifdef + (child_has_vforked): Now enclosed by CHILD_HAS_VFORKED ifdef + (child_can_follow_vfork_prior_to_exec): New function + (child_insert_exec_catchpoint): New function + (attach): Removed call to require_notification_of_events + (child_post_attach): New function, call to + require_notification_of_events moved here. + (child_pid_to_exec_file): New enclosed by CHILD_PID_TO_EXEC_FILE ifdef + introduced the concept of a saved_inferior_pid + (hppa_require_attach): Add some code to decide if gdb is already + attached to process. Can not figure this out via a ptrace call. + (hppa_insert_hw_watchpoint): New function + (hppa_remove_hw_watchpoint): New function + + * inftarg.c: + (child_attach_to_process): Change position in file + (child_detach_from_process): Change position in file + + * inftarg.c: + (child_attach_to_process): Changed parameter to child_wait call + + * inftarg.c: + (child_post_wait): New function declaration and definition + (ptrace_him): + - change return value to a void. + - change target_acknowledge_forked_child call to + target_acknowledge_created_inferior + - call target_post_startup_inferior rather than returning pid. + (child_attach_to_process): Change param name, fail_if_already_attached + -> after_fork. + Invert a couple of if-then-else statments. + Use REQUIRE_ATTACH macro + (child_attach): Change params in child_attach_to_process call + (child_require_attach): Change params in child_attach_to_process call + (child_detach_to_process): Change param name, + fail_if_already_attached -> after_fork. + Invert a couple of if-then-else statments. + Use REQUIRE_DETACH macro + (child_detach): Change params in child_detach_from_process call + (child_require_detach): Change params in child_detach_from_process + call + (child_post_startup_inferior): New function + (child_acknowledge_created_inferior): New function + (child_clone_and_follow_inferior): New function + (child_post_follow_inferior_by_clone): New function + (child_create_catch_fork_hook): New function + (child_create_catch_vfork_hook): New function + (child_has_forked): New function + (child_has_vforked): New function + (child_post_follow_vfork): New function + (child_stop): No longer a static function + (child_pid_to_exec_file): New function + + * inftarg.c: + (child_wait): Child_pid becomes related pid. return pid + rather than inferior_pid. Changes are in code handling fork + and vfork + + * inftarg.c: + Include gdb_stat.h and sys/unistd.h + (child_wait): New local variables. Check for live threads. + Check for syscall events + (child_thread_alive): No longer a static funct. + (ptrace_him): Remove some code inserted in snap3 + (child_create_inferior): Added a bunch of code to handle a + bad interaction between start-up-with-shell and the HP + catch-fork/catch-exec logic. I am ifdefing this for + HPUXHPPA for now. + (child_has_syscall_event): New default target_ops function + (child_enable_exception_callback): New default target_ops function + (child_get_current_exception_event): New default target_ops function + (child_ops): 3 new fields + + * inftarg.c: Remove HPUX_SNAP1 and HPUX_SNAP2 ifdefs + + * inftarg.c: Reverted previous change. + + * infttrace.c (hppa_remove_hw_watchpoint): Fix check for write + access hardware watchpoint. + + * infttrace.c (proc_wait): Rename from proc_wait. + + * infttrace.c (require_notification_of_exec_events): New function; + just notify of exec events, not all events, and just the specified + pid, don't include it's children. + (child_acknowledge_created_inferior): Call new function + require_notification_of_exec_events instead of + require_notification_of_events. + (child_post_startup_inferior): Call require_notification_of_events + + * infttrace.c: Changed all references to boolean to int. + Changed all references to TRUE and FALSE to 1 and 0. + + * irix5-nat.c (symbol_add_stub): Add params to call to + symbol_file_add. + + * jv-lang.c (get_dynamics_objfile): Add 2 more parameters to call + to allocate_objfile. + + * main.c (fputs_unfiltered): Changes to prevent cursor form + jumping around in the TUI. Altered where tuiTermUnsetup and + tuiTermSetup are called + + * main.c (fputs_unfiltered): Changed function so that it + checks to see if output is to a string buffer or to a + FILE stream and does the correct action (i.e. strcat or + fputs). Fixed params for fputs call. + + * main.c (fputs_unfiltered): Don't try to call the TUI's + CommandCharCount functions when the TUI isn't enabled. + + * main.c (fputs_unfiltered): Change FILE to GDB_FILE. + + * main.c (main): If the user gives the --version or --help flags, + disable the TUI. + + * main.c (tui_version, xdb_commands, dbx_commands): New variables. + (main): New command line arguments --tui, --xdb, --dbx; add call + to tyiCleanUp via tuiDo to main loop. + (fputs_unfiltered): Tui related changes. + + * main.c: Define 2 new global variables, gdb_stdout and gdb_stderr + of type GDB_FILE. + (main): Allocate space for and initialize gdb_stdout and gdb_stdin. + + * objfiles.c (find_pc_sect_section): Make end condition be less + than s->endaddr, not less than or equal to s->endaddr. + + * objfiles.c: + (allocate_objfile): 2 new parameters: User_loaded and is_solib. + When appropriate, record in the object file that it is user loaded. + The run command can use this information to purge object file + entries associated with the old inferior and keep user loaded + object files loaded via the add-symbol-file command. + (objfile_purge_solibs): New function. deletes all objectfile entries + that are not explicitly loaded by the user. + + * objfiles.c: + (objfile_relocate): Check for LOC_INDIRECT + (find_pc_sect_section): Change condition from + pc < s->endaddr to pc <= s->endaddr + + * objfiles.h: + New variables: User_loaded and is_solib + (OBJF_SHARED): New macro. used to distinguish objfile for + shared library from "vanilla" objfile. + (allocate_objfile): Add new parameters to function decl. + (objfile_purge_solibs): New function decl. + + * objfiles.h: Add some typedefs: Importentry, ExportEntry. + Add some new variables: Import_list, import_list_size, + export_list, export_list_size + + * osfsolib.c: + (symbol_add_stub): Added params to call to symbol_file_add + + * pa/hpux1020.mh (NATDEPFILES): Add corelow.o, symbol table and + solib files. + + * pa/hpux1100.mh (NAT_FILE): Use nm-hppah11.h. + (NATDEPFILES): Add symbol table and solib files. + + * pa/nm-hppah11.h: New file, HPUX11-only definitions. + + * pa/tm-hppa.h (proc_wait): Remove decl and macro. + + * parse.c (write_dollar_variable): Handle cases in which variables + besides the debugger ones start with $ and $$. + (parse_nested_classes_for_hpacc): New function. Parse a string that + is possibly a namespace / nested class specification. + (find_template_name_end): New function. + + * procfs.c: + (procfs_init_inferior): Return value is now a void. + + * procfs.c (procfs_ops): Initializing new target ops vector fields. see list below. + + * procfs.c: + (procfs_ops): Adding new target_ops vector fields and + removing a few. see list below + + * procfs.c: Added new fields to procfs_ops. + Necessary since we still have oldstyle initialization in + this file + + * pyr-tdep.c (pyr_do_registers_info): Change stdout to gdb_stdout. + (frame_locals_address): Change stderr to gdb_stderr. + (frame_args_addr): Ditto. + + * pyr-xdep.c (fetch_inferior_registers): Change stderr to + gdb_stderr. + + * serial.c (serial_close): Call gdb_fclose, not fclose on a + GDB_FILE. + + * serial.c (serial_logchar): Change chtype to ch_type. sigh. + + * solib.c (look_for_base): The parameter to file must be + of type FILE *. So cast exec_bfd -> iostream in the call + to fileno as a FILE *, not a GDB_FILE *. This will work because + exec_bfd -> iostream is declared and given a value in bdf and + bfd will continue to use FILE rather than GDB_FILE. + + * solib.c: + (solib_add): Remove references to exec_ops. + + * solib.c: + (solib_add): Update exec_ops.to_sections + + * solib.c: + (symbol_add_stub): Added params to call to symbol_file_add + + * solib.h: + (SOLIB_REMOVE_INFERIOR_HOOK): New macro. defined to 0. + functionality not implemented for this target. + + * solib.h: Added macro definitions. These macros generate + error messages for solaris?? + (SOLIB_CREATE_CATCH_LOAD_HOOK) + (SOLIB_CREATE_CATCH_UNLOAD_HOOK) + (SOLIB_HAVE_LOAD_EVENT) + (SOLIB_LOADED_LIBRARY_PATHNAME) + (SOLIB_HAVE_UNLOAD_EVENT) + (SOLIB_UNLOADED_LIBRARY_PATHNAME) + (SOLIB_IN_DYNAMIC_LINKER) + (SOLIB_RESTART) + + * somread.c (is_in_import_list): Ditto. + + * somread.c (som_symfile_read): Added some comments + + * somread.c (som_symfile_read): Read in import and export lists. + (som_symtab_read): Change test for dynamic executable. + (is_in_import_list): New function. Check if a given symbol name + is in the import list. + (init_import_symbols): New function. Read in and initialize the + som import list. + (init_export_symbols): New function. Read in and initialize the + som export list. + + * somread.c: + (som_symfile_read): Fix missing comment delimiters + + * somsolib.c (DLD_FLAGS_MAPPRIVATE): New macro. + Define bit of __dld_flags in HP-UX a.out files. + (DLD_FLAGS_HOOKVALID): Ditto. + (DLD_FLAGS_LISTVALID): Ditto. + (DLD_FLAGS_BOR_ENABLE): Ditto. + (som_solib_total_st_size): Cumulative size in bytes of the + symbol tables of all shared objects on the so_list_head list. + (som_solib_st_size_threshhold_exceeded): Threshold for adding symbols + for shlibs. + (som_solib_sizeof_symbol_table): New function. Computes size of + symbol table for a shlib. + (som_solib_load_symbols): New function. Load symbols from shlib. + (som_solib_add): Detect if __dld_list is not valid. + Record main program's symbol table size. + Load symbols if called from command line. + Keep threshold into account when loading shlib symbols. + (som_solib_create_inferior_hook): Use dld_flags macros. + (som_sharedlibrary_info_command): Let user know if symbols were + not loaded. + (som_solib_restart): Discard all the shlibs descriptors. + (_initialize_som_solib): Chenge help message for auto-solib-add + command. + Set threshold for symbol table to 50 megabytes. + + * somsolib.c (_initialize_som_solib): Added call to som_solib_restart. + (som_solib_restart): New function + (som_solib_in_dynamic_linker): New function + (som_solib_desire_dynamic_linker_symbols): New function + (som_solib_unloaded_library_pathname): New function + (som_solib_loaded_library_pathname): New function + (som_solib_library_pathname): New function + (som_solib_have_unload_event): New function + (som_solib_have_load_event): New function + (som_solib_create_catch_unload_hook): New function + (som_solib_create_catch_load_hook): New function + (som_solib_create_inferior_hook): Rewritten + dld_cache: New struct + addr_and_unwind_t: New struct + (find_unwind_entry) added prototype + + * somsolib.c (som_solib_create_inferior_hook): Introduce new local + msymbol2 and change some msymbol's to msymbol2's -- was clobbering + msymbol, passing a NULL to lookup_minimal_symbol_solib_trampoline, + and ultimately core dumping with a SEGV. + + * somsolib.c: + Include assert.h + (som_solib_mapped_entry): Additional comments for text_addr, + text_link_addr, text_end, and tsd_start_addr fields. Commenting + out 2 tsd fields, __data_start and __data_end. + (som_solib_add_solib_objfile): Add params to calls to symbol_file_add. + Add some code for distinguishing between a shared library and other + objfiles. This appears to be a prelude to thread local storage. + (som_solib_load_symbols): Changes to printf statement + enclosed by SOLIB_DEBUG ifdef. + (som_solib_add): Change comment to correctly specify path + to end.o -- /opt/langtools/lib/end.o. changes to printf statement + enclosed by SOLIB_DEBUG ifdef. + Removed several SOLIB_DEBUG ifdefs and the associated printfs. + Add code to find the start address for the object file's thread + local storage + (som_solib_create_inferior_hook): Fix warning messages use correct + path to end.o -- /opt/langtools/lib/end.o. Change control flow. + No longer user early returns from function is cases of error. + (reset_inferior_pid): New function + (som_solib_remove_inferior_hook): New function + (so_lib_thread_start_addr): New function. used for tsd. + + * somsolib.c: Removed references to ASSERT macro. + + * somsolib.c: Add debugging macro. + (struct som_solib_mapped_entry): Add new field tsd_start_addr. + (struct so_list): Added new field solib_addr. + (som_solib_add_solib_objfile): New function. + (som_solib_load_symbols): Rewritten. + (som_solib_add): Make sure we don't load the symbols in if the + threshold was exceeded. + (som_solib_get_solib_by_pc): New function. Return the address of + handle of the shared library. + (som_solib_restart): Disable breakpoints at restart. + (_initialize_som_solib): Set threshold to 100 megabytes. + + * somsolib.c: Add include of fcntl.h so that O_RDONLY is defined. + + * somsolib.h (DISABLE_UNSETTABLE_BREAK): New macro. + (PC_SOLIB): New macro. + + * somsolib.h: + (SOLIB_CREATE_CATCH_LOAD_HOOK): Define + (SOLIB_CREATE_CATCH_UNLOAD_HOOK): Define + (SOLIB_HAVE_LOAD_EVENT): Define + (SOLIB_LOADED_LIBRARY_PATHNAME): Define + (SOLIB_HAVE_UNLOAD_EVENT): Define + (SOLIB_UNLOADED_LIBRARY_PATHNAME): Define + (SOLIB_IN_DYNAMIC_LINKER): Define + (SOLIB_RESTART): Define + + * somsolib.h: + (SOLIB_REMOVE_INFERIOR_HOOK): New macro. defined to use + som_solib_remove_inferior_hook. + + * somsolib.h: + (som_solib_create_catch_load_hook) + (som_solib_create_catch_unload_hook) + (som_solib_have_load_event) + (som_solib_loaded_library_pathname) + (som_solib_have_unload_event) + (som_solib_unloaded_library_pathname) + (som_solib_in_dynamic_linker) + Fix prototypes to use type names, not parameter names. + + * source.c (find_source_lines): Make non static. + (open_source_file): Ditto. + (source_full_path_of): New function. + (print_source_lines): Rename to print_source_lines_base and make + static; formatting. + (print_source_lines): New function. + (forward_search_command): Tui changes. + (reverse_search_command): Tui changes. + (_initialize_source): Add xdb and dbx compatibility commands. + + * source.c (list_command): Handle case of odd number of source + lines to display. + + * source.c: + (source_full_path_of): New function. file was overlooked + in merge ;-/. + + * stack.c (func_command): Make high bound be <, not <=. + + * stack.c (_initialize_stack): For the backtrace command, delete + the help line about usage, since this has to be a valid help + message for the 'where' command too. + + * stack.c (current_frame_command): Add a check for the + existance of a stack. If there is no stack produce an + error message and exit. + + * stack.c (down_silently_base, up_silently_base, + args_plus_locals_info, print_frame_info_base, + print_stack_frame_base, print_stack_frame_base_stub): Declare. + (print_frame_local_vars): Add'l parameter. + (print_stack_frame_stub): New version created, old version renamed + to show_and_print_stack_frame_base_stub. + (print_stack_frame_base_stub, print_only_stack_frame_stub, + show_and_print_stack_frame, print_only_stack_frame, + stack_publish_stopped_with_no_frame, print_frame_info, + show_stack_frame, backtrace_full_command, args_plus_locals_info, + select_and_print_frame, select_and_maybe_print_frame, + current_frame_command, func_command): New functions. + (backtrace_command): New function, old renamed to + backtrace_command_1. + (print_block_frame_locals, print_frame_local_vars): Additional + parameter, number of tabs. + (up_silently_command): New function, old renamed to + up_silently_command_base. + (down_silently_command): New function, old renamed to + down_silently_base. + (_initialize_stack): Register new commands based on values of + xdb_commands and dbx_commands variables. + + * stack.c (func_command): Make high bound be <, not <=. + + * stack.c (parse_frame_specification): Fix prototype to match + function definition. + (show_and_print_stack_frame_stub): Fix name. + (select_and_print_frame): Change uncaught tuiDO call. + + * stack.c (up_silent_base): Rename from up_silently_command_base. + + * symfile.c (symbol_file_command): Only call SOLIB_RESTART if it's + defined. + + * symfile.c (add_psymbol_with_dem_name_to_list): New function. + Adds a symbol with a long value to a psymtab. Differs from + add_psymbol_to_list in taking both a mangled and a demangled name. + + * symfile.c (compare_psymbols): Call strcmp directly, instead of + using macro. + + * symfile.c (symbol_file_add): Reindent portions. + (symbol_file_command): Add call to tuiDo. + + * symfile.c (symbol_file_command): Only call SOLIB_RESTART if it's + defined. + + * symfile.c (symfile_bfd_open): Add code to call PXDB on hpux, if + the file has not already been processed by pxdb. + Added define USE_PXDB. + + * symfile.c (symfile_bfd_open): Change parenthesis positioning + around call to hpread_pxdb_check. + + * symfile.c (symfile_bfd_open): Make not static. + (RESET_HP_UX_GLOBALS): New macro. Resets globals when new symbol + file loaded. + (USE_PXDB): Not needed. Removed. + (symbol_file_add): Add HP specific code to deal with pxdb. + (symbol_file_command): Reset HP specific globals if new symbol file + loaded. + (symfile_bfd_open): Comment out checking for pxdb. + (reread_symbols): Reset HP specific globals. + + * symfile.c (symfile_bfd_open): Uncomment hpus specific code. + + * symfile.c: + (symbol_file_add): Add user_loaded and is_solib parameters. + fixed number of parameters in call to allocate_objfile + (symbol_file_command): Added call to SOLIB_RESTART macro. + fixed number of parameters in calls to symbol_file_add. + (add_symbol_file_command): Fixed number of parameters in calls to + symbol_file_add. + + * symfile.c: Added prototype for hpread_pxdb_check. + + * symfile.c: Changed HPUX_SNAP1 ifdef to HPUXHPPA. enclosed calls to + RESET_HP_UX_GLOBALS with an HPUXHPPA ifdef + + * symfile.h (symfile_bfd_open): Add protptype. + + * symfile.h: Add prototype for add_psymbol_with_dem_name_to_list. + + * symfile.h: Clarify purpose of auto_solib_add. + + * symmisc.c (maintenance_print_symbols): Call gdb_fclose, not + fclose on a GDB_FILE* during cleanup. + (maintenance_print_psymbols): Call gdb_fclose, not fclose on a + GDB_FILE* during cleanup. + (maintenance_print_msymbols): Call gdb_fclose, not fclose on a + GDB_FILE* during cleanup. + + * symmisc.c (maintenance_print_symbols): Gdb_fclose now takes a + GDB_FILE ** parameter. Fix the local GDB_FILE variables and the + call to make_cleanup. + (maintenance_print_psymbols): Ditto + (maintenance_print_msymbols): Ditto + + * symmisc.c (print_objfile_statistics): Close quotes in + output strings. + + * symmisc.c: + (Print_symbol): Add LOC_INDIRECT to switch statement + (print_partial_symbols): Add LOC_INDIRECT to switch statement + + * symtab.c (find_pc_sect_psymtab): High bounds should be <, not <=. + (find_pc_sect_symtab): Ditto. + + * symtab.c (hp_som_som_object_present): New flag to indicate HP + compiled code. + (find_pc_sect_psymtab): Change tests to make sure we are checking + the texthigh adress as well. + (lookup_transparent_type): New function. Look up a type name + in the struct_namespace. The type returned must not be opaque. + (find_pc_sect_symtab): Make sure we check the address 'pc' itself, + too. + (find_addr_symbol): Prepare to handle LOC_INDIRECT address class, but + leave it commented out. + (find_pc_sect_line): Return correct information if pc is in import + or export stub (trampoline). + (decode_line_1): Skip two chars, if they are '$$'. Like for HP's + $$dyncall. Handle cases in which varaible and function names can start + with $. + (overload_list_add_symbol): If cannot demangle name, use it as is. + Free string after use. + (make_symbol_overload_list): Initialize oload_name to NULL and + oload_name_len to 0. If demangle not successful, use name as it is. + Free string after use. + + * symtab.c (lookup_symbol): Changed call to find_pc_sect_symtab, + to the original find_pc_symtab, in HP added fragment. + + * symtab.c (lookup_symbol): Change HPUX_SNAP1 ifdef to a HPUXHPPA ifdef + + * symtab.c (lookup_symbol): Ifdef the searching of symbol in the + minimal symbol tables, for hpux we move this check at the end + of the function. + Before we error out if symbol is not found in the symtab, look + in the statics. + Before erroring out if static symbol not found look in the globals. + + * symtab.c (lookup_symbol): Return symbol as soon as found. + (decode_line_1): Check whether we have a conditional break. Temporarily + remove it from the line, to not confure perenthesis checking. + Handle namespaces. + (overload_list_add_symbol): New function. Overload + resolution support. + (make_symbol_overload_list): Ditto. + + * symtab.c: + (find_template_name_end): New prototype decl. + (lookup_symbol): When a global or static symbol shows up in the + psymtab table, but not the symtab table, tell the user that + the symbol may be an inlined function or a template function and + provide some guidance to the user about how to more fully + specify the symbol. + (lookup_transparent_type): When a global or static symbol shows up + in the psymtab table, but not the symtab table, tell the user that + the symbol may be an inlined function or a template function and + provide some guidance to the user about how to more fully + specify the symbol. + (decode_line_1): Handle template function specification when decoding a + line. May need to be ifdefed for HP's aCC? + (_initialize_symtab): Handle dbx commands. + + * symtab.h (address_class): Add new address calss for + LOC_THREAD_LOCAL_STATIC and LOC_INDIRECT. + (lookup_transparent_type): Add prototype. + (exception_event_kind): New enum for exception catchpoints. + (exception_event_record): New structure for exception catchpoints. + (CURRENT_EXCEPTION_KIND): New macro. + (CURRENT_EXCEPTION_CATCH_SAL): New macro. + (CURRENT_EXCEPTION_CATCH_LINE): New macro. + (CURRENT_EXCEPTION_CATCH_FILE): New macro. + (CURRENT_EXCEPTION_CATCH_PC): New macro. + (CURRENT_EXCEPTION_THROW_SAL): New macro. + (CURRENT_EXCEPTION_THROW_LINE): New macro. + (CURRENT_EXCEPTION_THROW_FILE) new macro.: + (Current_EXCEPTION_THROW_PC): New macro. + + * symtab.h(make_symbol_overload_list): Add prototype. + + * symtab.h: + (symbol_file_add): Add new params to function decl. + + * target.c (cleanup_target): Changed casting of default functions for + to_has_forked, to_has_vforked, to_pid_to_exec_file to get rid of + warnings. + + * target.c (cleanup_target): Changed the default functions for + to_pid_to_exec_file and to_core_file_to_sym_file + + * target.c (cleanup_target): Fixed PARAMS for to_has_syscall_event + + * target.c (cleanup_target): Syntax error, mismatched paranthesis. + + * target.c: + (Default_clone_and_follow_inferior): New funct prototype declaration + and function definition + (dummy_target): More target_ops vector changes for HPUX + new fields. ifdefed for HPUX_SNAP2. New fields are + to_post_wait, to_post_startup_inferior + to_acknowledge_created_inferior, to_clone_and_follow_inferior, + to_post_follow_inferior_by_clone, to_create_catch_fork_hook, + to_create_catch_vfork_hook, to_has_forked, to_has_vforked, + to_post_follow_vfork, to_pid_to_exec_file + (de_fault): Add new HPUX specific target_ops operations to + the de_fault macro + (INHERIT): Add new HPUX specific target_ops operations to the + INHERIT macro + (find_default_clone_and_follow_inferior): New funct definition + (debug_to_post_wait): New funct + (debug_to_post_startup_inferior): New funct + (debug_to_acknowledge_created_inferior): New funct + (debug_to_clone_and_follow_inferior): New funct + (debug_to_post_follow_inferior_by_clone): New funct + (debug_to_create_catch_fork_hook): New funct + (debug_to_create_catch_vfork_hook): New funct + (debug_to_has_forked): New funct + (debug_to_has_vforked): New funct + (debug_to_post_follow_vfork): New funct + (setup_target_debug): Initialize new target_ops vector fields. + + * target.c: + (Cleanup_target): Fixed the return type on a few of the + default function values. + + * target.c: + (Dummy_target): Add 3 new fields + (nosupport_runtime): New function, used in cleanup_target + (cleanup_target): Changes in the de_fault macro, both to + accomodate the new target_ops vector fields and to use + more accurate default functions. + (update_current_target): Add new target_ops vector fields to the + INHERIT macro + (generic_mourn_inferior): The call to breakpoint_init_inferior now takes a + parameter + (normal_pid_to_str): Adding a \0 to the end of buf. + (debug_to_has_syscall_event): New func + (debug_to_enable_exception_callback): New func + (debug_to_get_current_exception_event): New func + (setup_target_debug): Initialize the 3 new target_ops vector fields + + * target.c: + (Struct signals): Fix message associated with SIGRETRACT. + + * target.c: + (Dummy_target): Fix syntax error + (cleanup_target): Changed the default values for the new + target_ops vector fields. HP folks inappropriately set + most of them to noprocess(). They should be a mixture + of ignore() and return_zero(). + + * target.c: + (Dummy_target): Add new target_ops vector fields and their initializations + (cleanup_target): Added new new target_ops vector fields to the de_fault + macro definition. + (update_current_target): Added new new target_ops vector fields to the INHERIT + macro definition + (return_one): New function, used by the de_fault macro + (debug_to_post_attach): New function + (debug_to_wait): Added new cases: Target_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED, + TARGET_WAITKIND_EXECD + (debug_to_insert_fork_catchpoint): New function + (debug_to_remove_fork_catchpoint): New function + (debug_to_insert_vfork_catchpoint): New function + (debug_to_remove_vfork_catchpoint): New function + (debug_to_can_follow_vfork_prior_to_exec): New function + (debug_to_insert_exec_catchpoint): New function + (debug_to_remove_exec_catchpoint): New function + (debug_to_core_file_to_sym_file): New function + (setup_target_debug): Give new fields in current_target target_ops vector values. + + * target.c: Hp merge, 4/15/98 snapshot + There are new target_ops fields that pertain only + to HPUX. All the changes relate to this. First, + new fields are added to the dummy_target target_ops + vector: To_require_attach, to_require_detach. + + * target.c: Remove HPUX_SNAP1 and HPUX_SNAP2 ifdefs + + * thread.c (info_threads_command): Call print_only_stack_frame + instead of print_stack_frame. + (_initialize_thread): Make t an alias for thread only if + xdb_commands is not set. + + * thread.c (thread_command): If no arguments, don't generate an + error, instead tell the user which thread is current. + (info_threads_commands): Don't lose the users position within the + current thread -- remember it and then restore it. + + * thread.c: + (struct thread_info): Add stepping_through_sigtramp field + (add_thread): Initialize stepping_through_sigtramp field + (load_infrun_state): Add stepping_through_sigtramp param and + make sure it gets assigned a value. + (save_infrun_state): Add stepping_through_sigtramp param and + make sure that the value gets saved. + (info_threads_command): Ifdefing some local variables and + code for HPUXHPPA. HP folks want print the tid rather than pid? + Also, looks like the HP folks solved the same thread switching + problem that 4.17 solves. Taking 4.17. + (restore_current_thread): Print out the current frame after + switching threads. + (thread_apply_all_command): Ifdefing a print statement for + HPUXHPPA. The HP folks want to print out a tid rather than pid? + (thread_apply_command): Ifdefing a print statement for + HPUXHPPA. The HP folks want to print out a tid rather than pid? + (thread_command): Decided not to take HP change. + + * thread.c: Fixing gdb core dump problem causing many testsuite + failures. + (add_thread): Remove call to bpstat_clear, initialize + tp->stepping_through_solib_catchpoints = NULL; + + * thread.c: Changes for catchpoints, shared libaries, + (thread_info): Additional fields in the thread_info struct + for stepping_through_solib_after_catch and + stepping_through_solib_catchpoints. + (add_thread): Initialize the new thread_info fields. + (load_infrun_state): Additional parameters for handling + catchpoints and shared libraries. + (save_infrun_state): Additional parameters for handling + catchpoints and shared libraries. + + * top.c (command_loop): Initialize space_at_cmd_start to 0. + (set_prompt): New function. + (togglelist, stoplist): New command lists. + (command_loop): Tui changes -- paranoia to make sure + insert mode is off when not editing. + (quit_force): Clean up tui on exit. + (init_main): Make definition of info status command dependent upon + dbx mode not being set. + (fputs_unfiltered_hook): Changed stream parameter from FILE + to GDB_FILE + (flush_hook): Changed stream parameter from FILE to GDB_FILE + + * top.h (set_prompt): Declare. + + * typeprint.c (whatis_exp): Decide real runtime type. For the vtable + case. + + * utils.c (query): Changes to prevent cursor from jumping around in the + TUI. Call tuiBufferGetc explicitly, rather than passing it + into tuiDo. The tuiDo function does some additional work + that is inappropriate when handling queries. + (GDB_FILE_ISATTY): New macro that takes a GDB_FILE param and + determines whether or not it's using a tty. + (gdb_file_isatty); called by the GDB_FILE_ISATTY macro. Does + the actual work + (init_page_info): Call GDB_FILE_ISATTY rather than ISATTY + (print_spaces): Fix parameter to fputc. fix call to + gdb_file_adjust_strbuf. + (gdb_file_init_astring): Fix parameter to xmalloc + (gdb_file_deallocate): New function to deallocate + a GDB_FILE object and possibly a string buffer + (gdb_file_init_astring): Initialize buffer as the empty + string. Indent GNU style. + (gdb_fopen): Gdb_fopen is called if the GDB_FILE object is + actually afile rather than astring. The routine now allocates space + for a GDB_FILE object and initializes its fields in addition to + performing an fopen. + (gdb_flush): Fix the parameter passed into fflush. It's now + stream->ts_filestream. + (gdb_fclose): Pass in an object of type GDB_FILE **. Fix parameter + to fclose. It's now tmpstream->ts_filestream. Make sure to free + the GDB_FILE object and set the GDB_FILE * object to NULL. + (gdb_adjust_strbuf): New function. Determine if the current + ts_strbuf field contains sufficient space to concatenate a string + of length n on the end. If not, then reallocate the ts_strbuf. + (print_spaces): Check to see if the GDB_FILE is afile or + astring. If it is astring, then adjust the size of the ts_strbuf + field and concatenate the correct number of spaces onto the end of + the buffer. Otherwise continue to use fputc. + (gdb_file_get_strbuf): New function. return a ptr to the ts_strbuf + field in a GDB_FILE object. + (gdb_file_init_astring): New function to allocate space for and + initialize a GDB_FILE object when it is an astring. + (set_width): Declare it. + (pagination_enabled): Define it. + (query): Tui changes. + (init_page_info, set_width): New functions. + (set_width_command): Call set_width. + (_initialize_utils): Replace termcap stuff with call to + init_page_info; if xdb_commands set, define am and sm commands; + define pagination as a set/show command. + (vfprintf_maybe_filtered): Change FILE to GDB_FILE. + (fputs_maybe_filtered): Ditto. + (print_spaces): Ditto. + (gdb_printchar): Ditto. + (gdb_flush): Ditto. + (fputs_filtered): Ditto. + (vfprintf_filtered): Ditto. + (vfprintf_unfiltered): Ditto. + (fprintf_filtered): Ditto. + (fprintf_unfiltered): Ditto. + (fprintfi_filtered): Ditto. + (print_spaces_filtered): Ditto. + (fprintf_symbol_filtered): Ditto. + (gdb_fclose): New function. + + * valops.c (call_function_by_hand): Assign to param_type only + if function has parameters. + + * valops.c (call_function_by_hand): Ifdef the + HP_COMPILED_TARGET stuff. + (value_arg_coerce): Ditto. + + * valops.c (call_function_by_hand): Make sure param_type is + initialized to NULL. + + * valops.c (find_rt_vbase_offset): Add parameter to value_at. + (value_rtti_type): Ditto. + (value_full_object): Ditto. + + * valops.c (search_struct_field_aux): Fixed mismatching parenths + + * valops.c (search_struct_field_aux): Make sure TYPE_TAG_NAME + is not null before copying it. + + + * valops.c (search_struct_field_aux): Set found_class_name to null + if class has no name (anon unions case). Adjust base_addr + computation. + + * valops.c (value_arg_coerce): Change final arg to int. + + * valops.c (value_arg_coerce): Remove the conditional on HP + compiled target, for doing coercion of float to double. Removed + third parameter, using_gcc. + (call_function_by_hand): Do not use HP_COMPILED_TARGET, just + use the gcc_compiled variable. + + * valops.c (value_cast): Take case of the enclosing_type and + pointer_to_offset fields. + (value_at): Use VALUE_CONTENTS_ALL_RAW + (value_fetch_lazy): Ditto + (value_assign): Handle enclosing_type, embedded_offset and + pointed_to_offset fields. + (value_repeat): Use VALUE_CONTENTS_ALL_RAW and VALUE_ENCLOSING_TYPE. + (value_ind): Set enclosing_type and embedded_offset correctly, + for a pointer value being dereferenced. Target memory bytes + corresponding to the size of the enclosing type are retreived. + (value_addr): Handle enclosing_type and pointed_to_offset. + (value_push): Use VALUE_CONTENTS_ALL and VALUE_ENCLOSING_TYPE. + (value_arg_coerce): Coerce floats to doubles only if gcc was not + used to compile the target. + (call_function_by_hand): Handle pointers to functions as paramters. + (value_array): Use VALUE_CONTENTS_ALL and VALUE_ENCLOSING_TYPE. + (search_struct_method): Produce more informative error message. + (find_rt_vbase_offset): Deal with negative offsets. + (value_find_oload_method_list): New function. Return the list of + overloaded methods of a specified name. + (find_method_list): New function. Search through the methods of an + object (and its bases) to find a specified method. + (value_full_object): New function. Given a value, check its real + run-time type. + (value_rtti_target_type): New function. Given a pointer value V, find + the real (RTTI) type of the object it points to. + (value_rtti_type): New function. Find the real run-time type of a + value using RTTI. + + * valops.c: Include gdbcmd.h + Set global overload_resolution to 0. + (find_function_in_inferior): Modify error message. + (value_allocate_space_in_inferior): Modify error message. + (value_cast): Deal with HP/aCC peculiarities. + (value_of_variable): Use SYMBOL_SOURCE_NAME instead of SYMBOL_NAME. + (value_addr): Modify address value by adding the embedded offset. + (value_ind): Modify the address of the object by the pointed_to_offset. + (call_function_by_hand): Do not do any extra alignment if not needed. + Fetch the return value from the stack rather then from the register, + for the hppa architecture. + (search_struct_field): Rewritten. Now this function uses + search_struct_field_aux to do all the work. + (search_struct_field_aux): New function. This is the old + search_struct_field rewritten. + (find_rt_vbase_offset): Give error if virtual table pointer is not good. + (find_overload_match): New function. Find the best function that + matches on the argument types according to the overload resolution + rules. + (_initialize_valops): Add new set/show command for overload-resolution. + + * value.h (VALUE_POINTED_TO_OFFSET): New macro. + Add field pointed_to_offset to value structure. + Add prototypes for new functions in valops.c. + + * value.h (write_register_pid): Change prototype to match + function. + + * value.h: Hp merge, 4/15/98 snapshot + Added parameter to val_print func decl. + Added new macro, VALUE_EMBEDDED_OFFSET, and + new func decl, find_rt_vbase_offset, for C++ + support. + + * values.c (allocate_value): Allocate also for value_embedded_offset + and value_enclosing_type. + (value_copy): Copy value_embedded_offset and value_enclosing_type too. + Use all_raw in copying the value itself. + (value_primitive_field): Add handling of base subobjects. + + * values.c (value_copy): Copy the pointed_to_offset as well. + (allocate_value): Allocate the pointed_to_offset as well. + (value_virtual_fn_field): Rewrite. + + * values.c (value_primitive_field): Adjust embedded offset and + offset calculation. + + * values.c (value_static_field): Take into consideration that static + data members can be minimal symbols too. + + * values.c (value_virtual_fn_field): Fix call to value_at. + + * win32-nat.c (handle_load_dll): Added params to call to symbol_file_add. + + Other changes have to do with XDB compatability. Leave oout + for now. + + defs.h (vfprintf_filtered): Change FILE to GDB_FILE in decl. + (fprintf_filtered): Ditto. + (fprintfi_filtered): Ditto. + (vfprintf_unfiltered): Ditto. + (fprintf_unfiltered): Ditto. + + infcmd.c (_initialize_infcmd): If xdb_commands is set, make S an + alias for next and define R, lr, g. Define go. + + pyr-tdep.c (pyr_print_insn): Change FILE to GDB_FILE. + + + * breakpoint.c (create_temp_exception_breakpoint): #If it out -- + nothing calls it. + (bpstat_stop_status): Don't call SOLIB_HAVE_LOAD_EVENT if it's not + defined; don't call SOLIB_HAVE_UNLOAD_EVENT if it's not defined. + (bpstat_get_triggered_catchpoints): If we don't have shared + library support, then don't call SOLIB_LOADED_LIBRARY_PATHNAME nor + SOLIB_UNLOADED_LIBRARY_PATHNAME. + (watch_command_1): Don't require a run before a watch command + unless we're on HP [it's an HP OS bug, not a generic limitation] + (catch_load_command_1): Don't define if no shared libraries. + (catch_command_1): Don't claim to support fork catchpoints unless + CHILD_INSERT_FORK_CATCHPOINT is defined, don't claim to support + vfork catchpoints unless CHILD_INSERT_VFORK_CATCHPOINT is defined, + don't clain to support shared library load catchpoints if shared + libraries aren't supported, and don't claim to support exec + catchpoints unless CHILD_INSERT_EXEC_CATCHPOINT is defined + + There are new target_ops vector fields that pertain + only to HPUX. Added the to_require_attach and + to_require_detach fields to exec_ops. These new + fields are ifdef'ed for HPUX_SNAP1. + + * breakpoint.h: + Fix compile error in enum bptype. + + * coff-solib.h: + Fixed a number of macro definitions. SOLIB_LOADED_LIBRARY_PATHNAME, + SOLIB_HAVE_LOAD_EVENT, SOLIB_HAVE_UNLOAD_EVENT, + SOLIB_UNLOADED_LIBRARY_PATHNAME, SOLIB_IN_DYNAMIC_LINKER. These + macros are only meaningful (for now) for SOM. So, all + the macros were defined as error(...), but were used in + conditions. This caused the compile to crap out. I redefined + these (for now) to be 0. + + * procfs.c: + (procfs_create_inferior): Fix call to fork_inferior -- need another + parameter. + + * solib.h: + Fixed a number of macro definitions. SOLIB_LOADED_LIBRARY_PATHNAME, + SOLIB_HAVE_LOAD_EVENT, SOLIB_HAVE_UNLOAD_EVENT, + SOLIB_UNLOADED_LIBRARY_PATHNAME, SOLIB_IN_DYNAMIC_LINKER. These + macros are only meaningful (for now) for SOM. So, all + the macros were defined as error(...), but were used in + conditions. This caused the compile to crap out. I redefined + these (for now) to be 0. + + * valops.c: + (search_struct_field): Undeclared local variable, "assigned". + (find_rt_vbase_offset): Fixed call to value_at + + * value.h: Fix signature for find_rt_vbase_offset funct decl + (missing a param) + +Wed Dec 30 17:48:12 1998 Stan Shebs + + From J.T. Conklin : + * i386-stub.c: Fix error string in last change. + +1998-12-30 Jason Molenda (jsm@bugshack.cygnus.com) + + * utils.c: instead of "readline/readline.h". + + * configure.in (TERM_LIB): Search for the appropriate term library + on the host system. + * configure: Regenerated. + * Makefile.in (TERMCAP): Set based on autoconf check. + * config/*/*.mh: Don't override TERMCAP setting. + +Wed Dec 30 17:23:14 1998 Mark Alexander + + * value.c (value_virtual_fn_field): Handle the situation where + vtbl is a pointer to a structure instead of a pointer to an array. + +Mon Dec 28 17:43:36 1998 David Taylor + + The following changes were made by Jim Blandy , + Edith Epstein , Elena Zannoni + Stan Shebs , and David + Taylor , as part of the project to merge in + changes originally made by HP; HP did not create ChangeLog + entries. + + * c-lang.h (cp_print_value_fields): Update prototype; fixed + prototype decl for c_val_print function -- it needed an + embedded_offset param; fixed prototype of cp_print_value_fields. + Include value.h. + (C_LANG_H): Define. + + * c-valprint.c (c_val_print): Add new parameter embedded_offset. + Add embedded_offset to valaddr in function calls. fix calls to + val_print, and cp_print_value_fields. Attempt to determine the + real type of the object to be printed. fixed call to + cp_print_value_fields. process TYPE_CODE_METHOD as well. moved + call to check_typedef out of conditional. add embedded offset + param to val_print call. + + (c_value_print): Add new parameter to call to val_print. Handle + pointer to class case. Ensure that const char *, const unsigned + char * come out without the type but the volatile variants and the + signed variants don't. + + * ch-lang.h (chill_val_print): Add parameter to decl. + + * ch-valprint.c: The various print routines have an additional + parameter. Currently, the new parameter is only used when printing + C++ expressions. So, in ch-valprint.c, the new parameter is always + 0. Changes in calls to val_print, chill_val_print, c_val_print + Affected functions are chill_val_print_array_elements, + chill_val_print, chill_print_value_fields, chill_value_print. + + * cp-valprint.c add vtable pointers names for aCC (HP) compiler. + (cp_print_class_method): Print message for HP/aCC case. + (cp_print_class_member): Add comments. + (cp_print_value): Adjust address computations for virtual base + classes. add new parameter 'offset'. Find correct offset for + base class in HP/aCC case. Change call to cp_print_value_fields + to have extra par. + (cp_print_value_fields): Do not print also if the only field is + the vtable pointer. Print out vtable ptr, for HP/aCC compiled + case. do not print leading '=' in case of anonymous union, or + struct. add new parameter 'offset'. Do not print the vtable + pointer as a member, in the HP aCC case. Changed calls to + val_print to have extra parameter. + (cp_print_hpacc_virtual_table_entries): New function. Print vtable + entries, in HP/aCC compiled case. + (cp_print_static_field): Change call to cp_print_value_fields, and + val_print. + + * d30v-tdep.c (d30v_print_register): Add embedded_offset param + to val_print call. + + * defs.h: Additional include files included when TUI is defined. + (gdb_file_isatty): New function decl. + (GDB_FILE): If TUI is defined, define a structure rather + than making this an alias for FILE. + (gdb_stdout, gdb_stderr): If TUI is defined, then define these + as pointers to variables of type GDB_FILE rather than making them + be aliases for stdout and stderr. + (TUIDO): Add definition conditionalized on definition + (or lack thereof) of TUI. + (command_class): Add two additional values. + (precision_type): New enum. + (gdb_fclose): Add decl. + (store_address): Change prototype to match function. + (tui_version, xdb_commands, dbx_commands): Add decls. + (gdb_file_deallocate): New function decl + (pa_do_strcat_registers_info): New function decl. + (streamtype): New enumerated type to distinguish between output to + a FILE and output to a buffer. + (tui_stream): New struct type, named GDB_FILE. + (gdb_stdout): Of type GDB_FILE, will pass this around gdb rather + than stdout. + (gdb_stderr): Of type GDB_FILE, will pass this around gdb rather + than stderr. + (fputs_unfiltered_hook): Change stream parameter from FILE to + GDB_FILE. + (flush_hook): Change stream parameter from FILE to GDB_FILE. + (gdb_fclose): Fix decl for gdb_fclose; parameter is now of + type GDB_FILE **. + (gdb_file_adjust_strbuf): New function decl. function lives + in utils.c. + (gdb_file_init_astring): New function decl. function lives + in utils.c. + (gdb_file_get_strbuf): New function decl. function lives in + utils.c. + (source_full_path_of): Declare. + + * exec.c (_initialize_exec): Make definition of file command be + dependent upon dbx_commands not being set. + (exec_file_attach): New function. + (exec_file_command): Call it. + (exec_ops): Add new target vector fields. + + * f-lang.h (f_print_type): Change FILE to GDB_FILE in decl. + (f_val_print): Ditto. + (f_val_print): Add parameter to the function decl. + + * f-valprint.c (_initialize_f_valprint): If xdb_commands is set, + define lc command. + (f77_create_arrayprint_offset_tbl): Change FILE to GDB_FILE. + (f77_print_array): Ditto. + (f77_print_array_1): Ditto. + (f_val_print): Ditto. + (f_val_print): Add a parameter; this new parameter is currently + only non-zero when handling C++ expressions. In this file its + value is always 0. changed fflush to gdb_flush. + + * gnu-nat.c: (init_gnu_ops): Add new target vector fields. + (gnu_create_inferior): Add param to fork_inferior call. + + * hppa-tdep.c (after_prologue): If f is NULL, don't dereference + it. if no debug info, return zero telling caller that we need to + find the end of the prologue via the hard way (instruction + examination). + (find_unwind_entry): Avoid dereferencing a null + pointer. + (hppa_pid_to_exec_file): Deleted -- no longer used. + (hppa_prepare_to_proceeed): Add prototype. + (read_unwind_info): Purecov comments, bug fixes. + (find_unwind_entry): Purecov comments, bug fixes. + (find_stub_with_shl_get): Purecov comments. + (frame_chain): Additional parens. + (hppa_push_arguments): Changes to commented out version of routine. + (hppa_fix_call_dummy): Purecov comments, fix location of end.o. + (in_solib_call_trampoline): Purecov comments. + (in_solib_return_trampoline): Purecov comments. + (setup_d_pid_in_inferior): Fix location of end.o. + (initialize_hp_cxx_exception_support): Fix location of end.o. + (child_enable_exception_callback): Purecov comments. + (pa_do_strcat_registers_info): Has a new parameter, precision, + which is passed into the call to pa_strcat_fp_reg to indicate + whether to display the floating point registers using + single or double preceision. + (pa_strcat_registers): Introduce local variable, precision, and + pass it into call to pa_strcat_fp_reg. + (pa_strcat_fp_reg): Modified function. New parameter, precision, + used by function to decide whether to use single or double + precision. Also add the code to put a double precision value + into a buffer. + (pa_do_strcat_registers_info): New routine. called by + tui/tuiRegs.c:_tuiRegisterFormat to place a register name + and value into a string buffer. Interface may change in + future. Checking this in so that we have something + functional for HP. + (pa_strcat_registers): New routine, called by + pa_do_strcat_registers_info. Does same thing as + pa_print_registers except it takes a stream parameter. + This routine should disappear in future. Checking in + so that we have something functional to give HP + (pa_strcat_fp_reg): New routine, called by + pa_do_strcat_registers_info and pa_strvat_registers + to place a floating point register name and value into + a buffer. This interface may change in future. + Checking in so that we have something functional to give HP. + (pa_print_fp_reg): Change prototype to match def'n. + (pa_register_look_aside): Fix comment immediately before function. + Changes to better support stack unwinding, reading and writing + registers for HPUX. New includes ptrace.h, bfd.h, dl.h. + (internalize_unwinds): Initialize new fields in table. + (read_unwind_info): Entries in the table are now more complex + structures. References of the form ...->table[index].stub_type are + now ...->table[index].stub_unwind.stub_type. + (find_proc_framesize): Add a check for pc == 0. + (rp_saved): Entries in the table are now more complex + structures. References of the form ...->table[index].stub_type are + now ...->table[index].stub_unwind.stub_type. + (frameless_function_invocation): Stub_type becomes + stub_unwind.stub_type + (saved_pc_after_call): Stub_type becomes stub_unwind.stub_type + (hppa_frame_saved_pc): Stub_type becomes stub_unwind.stub_type + (frame_chain_valid): Stub_type becomes stub_unwind.stub_type + (hppa_call_dummy): Stub_type becomes stub_unwind.stub_type + (pa_print_fp_reg): Additional params to call val_print + (in_solib_call_trampoline): Stub_type becomes + stub_unwind.stub_type + (in_solib_return_trampoline): Stub_type becomes + stub_unwind.stub_typ + (skip_trampoline_code): Additional code to handle external + dyncalls. Also stub_type becomes stub_unwind.stub_type + (hppa_pid_to_exec_file): New funct. FOr HPUX 10.0 and beyond there + is an explicit ptrace request for getting the pathname associated + with a process id (pid). + (hppa_pid_to_exec_file): Remove unwanted param from call to + call_ptrace. + (args_for_find_stub): New structure. + (find_unwind_entry): Deal with null input pc value. + (rp_saved): Ditto. + For the import stub, return -24 always. + (hppa_frame_saved_pc): Save old pc value, to detect we are in a loop. + (init_extra_frame_info): Use TARGET_READ_FP. + (frame_chain): Include thread support. + If the caller's pc is zero, we lose and return, just like stack + bottom. + Disable warning about being unable to find unwind info. + (hppa_push_arguments): Rewrite. + (hppa_value_returned_from_stack): New function. Handles returning + a value larger than 64 bits, stored on the stack. + (find_stub_with_shl_get): New function. To look up symbols in shlibs. + (cover_find_stub_with_shl_get): New function. Cover routine for + find_stub_with_shl_get to pass to catch_errors. + (hppa_fix_call_dummy): Comment out old stub mechanism. + Rewrite using dyncall. + (target_read_fp): New function. + (pa_do_registers_info): Floating point registers start at FP4. + (pa_print_registers): Use FP4_REGNUM instead of 72. + (skip_trampoline_code): Do machine instruction matching for PA2.0. + (setup_d_pid_in_inferior): New function. Exception handling support. + (initialize_hp_cxx_exception_support): Ditto. + (child_enable_exception_callback): Ditto. + (child_get_current_exception_event): Ditto. + + * hpux-thread.c (hpux_thread_ops): Add new target vector fields. + + * infcmd.c: Include objfiles.h. + (attach_command): New local variable, exec_file, add code to + determine exec_file from pid if exec_file is not already known, + call new target operation, target_post_attach -- a no-op unless + on HPUXHPPA. + (detach_command): After detaching, do a SOLIB_RESTART. + (objfiles.h): Fix typo on include line. + (run_command): Only call SOLIB_RESTART if it's defined. + (detach_command): Ditto. + (run_command): If program has already been started, and decide + to restart it, the kill the target, flush the caches, + call init_wait_for_inferior. Also purge old solib objfiles. + (run_stack_dummy): Add calls to + disable_watchpoints_before_interactive_call_start and + enable_watchpoints_after_interactive_call_stops. + (finish_command): Alter code handling the evaluation and printing + of the target function's return value. + (attach_command): When given a pid, but no exec file, try to + determine the exec file from the process. If the process does not + record a full path name, try to qualify the filename against the + source path. + (_initialize_infcmd): Add some verbiage about how to use the + attach command. + (do_registers_info): Changed calls to val_print + made the symfile.h include preceed the + objfiles.h include. The other ordering caused a + compile problem (incompletely defined types). + + * inftarg.c (child_post_attach): Fix decl, make static. + (proc_wait): Make globally visible. + (child_insert_fork_catchpoint, etc): Fix return type. + (child_detach_from_process): Declare. + (child_attach_to_process): Declare. + (child_stop): Make static to match decl. + (ptrace_him): Change prototype back to return int. + (ptrace_me): Remove debug output, pass NULL to fork_inferior if + not HPUX. + (proc_wait): function prototype and definition are enclosed by + proc_wait ifndef + (child_attach_to_process): New function, does most of the work + that child_attach used to do and some additional work to determine + whether gdb is already attached to the target how to react. + (child_attach): Altered. It's now a wrapper for + child_attach_to_process. + (child_require_attach): New function, called if should attach even + when gdb is already attached to target. + (child_detach_from_process): New function, does most of the work + that child_detach used to do and some additional work to determine + whether gdb is currently attached to the target. + (child_detach): Altered. It's now a wrapper for + child_detach_from_process. + (child_require_detach): New function, called if should try to + detach even when gdb is not attached to target. + (ptrace_him): Calls a new function, + target_acknowledge_forked_child. Currently, + target_acknowledge_forked_child, is only defined to do something + for HPUX. + (child_create_inferior): Changed call to fork_inferior. + (child_ops): Add to_require_attach and to_require_detach fields + to the child_ops target ops vector. + Some hacks for ttrace work: + (child_wait): Additional local variables, additional code in + while loop to check for process exited, process forked, + process vforked, process execd. + (child_thread_alive): John B. seems to think that the kill + call is inapproapriate for HPUX. + (child_attach_to_process): Using strtol rather than atoi. + no longer check for case where there is no known exec file. + (child_post_attach): New function, a default, a no-op. + (child_insert_fork_catchpoint): New function, a default, a no-op. + (child_remove_fork_catchpoint): New function, a default, a no-op. + (child_insert_vfork_catchpoint): New function, a default, a no-op. + (child_remove_vfork_catchpoint): New function, a default, a no-op. + (child_can_follow_vfork_prior_to_exec ):new function, a default, + a no-op. + (child_insert_exec_catchpoint): New function, a default, a no-op. + (child_remove_exec_catchpoint): New function, a default, a no-op. + (child_has_execd): New function, a default, returns 0. + (child_reported_exec_events_per_exec_call): New function, a + default, returns 1. + (child_has_exited): New function, a default. + (child_core_file_to_sym_file): New function, a default, returns NULL. + (child_ops): Initialize new target vector fields. + + * jv-lang.h: (Java_val_print): Add embedded_offset param to func + decl. + + * jv-valprint.c: Changing calls to val_print to accomodate new param. + (java_value_print): Add embedded_offset param to val_print call + (java_print_value_fields): Add embedded_offset param to val_print + call. + (java_val_print): Add embedded_offset param. alter call to + c_val_print to accomodate embedded_offset param. + + * language.c (lang_bool_type): Return builtin_type_bool in c++ + case. + (unk_lang_val_print): Add embedded_offset param to + prototype decl and definition. + + * language.h (LA_VAL_PRINT macro, la_val_print function decl): + altered to accomodate the new parameter to the various print + functions. + + * m2-lang.h (m2_val_print): Add a parameter to the function decl. + + * m2-valprint.c (m2_val_print): Add a parameter. + This parameter is currently only used when evaluating C++ + expressions. So, it is always 0 in this file. + + * m3-nat.c (m3_create_inferior): Add param to fork_inferior call + (m3_pid_to_exec_file): New function + (m3_ops): Add new target vector fields. + + * mac-nat.c (init_child_ops): Add new target vector fields. + + * mips-tdep.c: Chnages to accomodate additional parameter + to val_print. + (mips_print_register): Alter calls to val_print + + * monitor.c (monitor_write): Change stderr to gdb_stderr. + (monitor_remove_breakpoint): Ditto. + (init_base_monitor_ops): Add new target vector fields. + + * ppc-bdm.c (init_bdm_ppc_ops): Add new target vector fields. + + * printcmd.c (do_examine): When saving a value_ptr, remove it from + the list of value_ptr's to be freed automatically; when discarding + a previously saved value_ptr, free it. + (print_formatted): Update comments; add new comments. + (printf_command, print_insn): Purecov comments. + (_initialize_printcmd): Add assign as a command if dbx_commands is + set; create va as an alias for disassemble if xdb_commands is set. + (address_info): New cases LOC_INDIRECT and + LOC_THREAD_LOCAL_STATIC. + (display_command): If tui_version and exp starts with a '$', then + don't display it unless tui_vSetLayoutTo fails. + (disassemble_command): Add tuiDo calls. + (print_scalar_formatted): For integers that are long long, check + the print format and print out in binary octal, decimal, or + hex. Call the new print_*_chars functions in valprint.c + (print_frame_args): Altered calls to val_print, to reflect + additional parameter to val_print (case LOC_BASEREG_ARG). + + * procfs.c: (Procfs_init_inferior): Return value is now a void. + (procfs_ops): Add new target vector fields. + (procfs_create_inferior): Fix call to fork_inferior -- need another + parameter. + + * remote-adapt.c (adapt_open): Change stderr to gdb_stderr. + (adpat_insert_breakpoint): Ditto. + (init_adapt_ops): Add new target vector fields. + + * remote-array.c (array_wait): Change fflush to gdb_flush and + stdout to gdb_stdout. + (init_array_ops): Add new target vector fields. + + * remote-bug.c (bug_load): Change fflush to gdb_flush; stdout to + gdb_stdout. + (bug_wait): Change stderr to gdb_stderr. + (bug_insert_breakpoint): Ditto. + (init_bug_ops): Add new target vector fields. + + * remote-e7000.c + (init_e7000_ops): Add new target vector fields. + * remote-eb.c (init_eb_ops): Ditto. + * remote-es.c (init_es1800_ops): Ditto. + (init_es1800_child_ops): Ditto. + * remote-es.c (init_es1800_ops): Ditto. + (init_es1800_child_ops): Ditto. + * remote-hms.c (init_hms_ops): Ditto. + * remote-hms.c (init_hms_ops): Ditto. + * remote-nindy.c (init_nindy_ops): Ditto. + * remote-nrom.c (init_nrom_ops): Ditto. + * remote-os9k.c (init_rombug_ops): Ditto. + * remote-rdp.c (init_remote_rdp_ops): Ditto. + * remote-sds.c (init_sds_ops): Ditto. + * remote-sim.c (init_gdbsim_ops): Ditto. + * remote-st.c (init_st2000_ops): Ditto. + * remote-udi.c (init_udi_ops): Ditto. + * remote-vx.c (init_vx_ops): Ditto. + (init_vx_run_ops): Ditto. + * remote-vx.c: (Init_vx_ops): Ditto. + (init_vx_run_ops): Ditto. + + * remote-mips.c (mips_getstring): Change stderr to gdb_stderr. + (pmon_insert_breakpoint): Ditto. + (pmon_remove_breakpoint): Ditto. + (check_lsi_error): Ditto. + (common_breakpoint): Ditto. + (pmon_makeb64): Ditto. + + * remote-mips.c (mips_xfer_memory): Change fflush to gdb_flush; + change stdout to gdb_stdout. + + * remote-mm.c (mm_open): Change stderr to gdb_stderr. + (init_mm_ops): Add new target vector fields. + (mm_load): Fixed params in commented out call to symbol_file_add. + + * remote-nindy.c (instream): Change decl to FILE. + + * remote-udi.c (udi_load): Fixed params in call to symbol_file_add. + + * remote-vx.c (vx_add_symbols): Fixed params in call to + symbol_file_add. + + * remote.c (init_remote_ops): Cosmetic change to match expected + test output. + + * rs6000-nat.c (add_vmap): Add params to call to allocate_objfile. + + * scm-lang.h: Add parameter to scm_val_print function decl. + + * scm-valprint.c (scm_scmval_print): Cast svalue to (int); new + parameter. This parameter is currently only used when evaluating + C++ expressions. So, it is always 0 in this file. + (c_val_print): Fixed prototype decl; it needed an embedded_offset + param. + + * sol-thread.c (sol_core_ops): Add new target vector fields. + (sol_thread_ops): Ditto. + + * somsolib.c (DLD_FLAGS_MAPPRIVATE): New macro. + Define bit of __dld_flags in HP-UX a.out files. + (DLD_FLAGS_HOOKVALID): Ditto. + (DLD_FLAGS_LISTVALID): Ditto. + (DLD_FLAGS_BOR_ENABLE): Ditto. + (som_solib_total_st_size): Cumulative size in bytes of the + symbol tables of all shared objects on the so_list_head list. + (som_solib_st_size_threshhold_exceeded): Threshold for adding symbols + for shlibs. + (som_solib_sizeof_symbol_table): New function. Computes size of + symbol table for a shlib. + (som_solib_load_symbols): New function. Load symbols from shlib. + (som_solib_add): Detect if __dld_list is not valid. + Record main program's symbol table size. + Load symbols if called from command line. + Keep threshold into account when loading shlib symbols. + (som_solib_create_inferior_hook): Use dld_flags macros. + (som_sharedlibrary_info_command): Let user know if symbols were + not loaded. + (som_solib_restart): Discard all the shlibs descriptors. + (_initialize_som_solib): Chenge help message for auto-solib-add + command. + Set threshold for symbol table to 50 megabytes. + (_initialize_som_solib): Add call to som_solib_restart. + (som_solib_restart): New function + (som_solib_in_dynamic_linker): New function + (som_solib_desire_dynamic_linker_symbols): New function + (som_solib_unloaded_library_pathname): New function + (som_solib_loaded_library_pathname): New function + (som_solib_library_pathname): New function + (som_solib_have_unload_event): New function + (som_solib_have_load_event): New function + (som_solib_create_catch_unload_hook): New function + (som_solib_create_catch_load_hook): New function + (som_solib_create_inferior_hook): Rewritten + dld_cache: New struct + addr_and_unwind_t: New struct + (find_unwind_entry) add prototype + Include assert.h, remove references to ASSERT macro, + add include of fcntl.h so that O_RDONLY is defined. + (som_solib_create_inferior_hook): Introduce new local + msymbol2 and change some msymbol's to msymbol2's -- was clobbering + msymbol, passing a NULL to lookup_minimal_symbol_solib_trampoline, + and ultimately core dumping with a SEGV. + (som_solib_mapped_entry): Additional comments for text_addr, + text_link_addr, text_end, and tsd_start_addr fields. Commenting + out 2 tsd fields, __data_start and __data_end. + (som_solib_add_solib_objfile): Add params to calls to symbol_file_add. + Add some code for distinguishing between a shared library and other + objfiles. This appears to be a prelude to thread local storage. + (som_solib_load_symbols): Changes to printf statement + enclosed by SOLIB_DEBUG ifdef. + (som_solib_add): Change comment to correctly specify path + to end.o -- /opt/langtools/lib/end.o. changes to printf statement + enclosed by SOLIB_DEBUG ifdef. + Removed several SOLIB_DEBUG ifdefs and the associated printfs. + Add code to find the start address for the object file's thread + local storage + (som_solib_create_inferior_hook): Fix warning messages use correct + path to end.o -- /opt/langtools/lib/end.o. Change control flow. + No longer user early returns from function is cases of error. + (reset_inferior_pid): New function + (som_solib_remove_inferior_hook): New function + (so_lib_thread_start_addr): New function. used for tsd. + (struct som_solib_mapped_entry): Add new field tsd_start_addr. + (struct so_list): Add new field solib_addr. + (som_solib_add_solib_objfile): New function. + (som_solib_load_symbols): Rewritten. + (som_solib_add): Make sure we don't load the symbols in if the + threshold was exceeded. + (som_solib_get_solib_by_pc): New function. Return the address of + handle of the shared library. + (som_solib_restart): Disable breakpoints at restart. + + * sparcl-tdep.c (init_sparclite_ops): Add new target vector fields. + + * target.c (cleanup_target): Changed casting of default functions + for to_has_forked, to_has_vforked, to_pid_to_exec_file to get rid + of warnings. Fixed PARAMS for to_has_syscall_event. Fixed the + return type on a few of the default function values. + (cleanup_target): Changes in the de_fault macro, both to + accomodate the new target_ops vector fields and to use + more accurate default functions. + (debug_to_open): Change stderr to gdb_stderr. + (debug_to_close): Ditto. + (debug_to_attach): Ditto. + (debug_to_post_attach): Ditto. + (debug_to_require_attach): Ditto. + (debug_to_detach): Ditto. + (debug_to_require_detach): Ditto. + (debug_to_resume): Ditto. + (debug_to_wait): Ditto. + (debug_to_post_wait): Ditto. + (debug_to_fetch_registers): Ditto. + (debug_to_store_registers): Ditto. + (debug_to_prepare_to_store): Ditto. + (debug_to_xfer_memory): Ditto. + (debug_to_files_info): Ditto. + (debug_to_insert_breakpoint): Ditto. + (debug_to_remove_breakpoint): Ditto. + (debug_to_terminal_init): Ditto. + (debug_to_terminal_inferior): Ditto. + (debug_to_terminal_ours_for_output): Ditto. + (debug_to_terminal_ours): Ditto. + (debug_to_terminal_info): Ditto. + (debug_to_kill): Ditto. + (debug_to_load): Ditto. + (debug_to_lookup_symbol): Ditto. + (debug_to_create_inferior): Ditto. + (debug_to_post_startup_inferior): Ditto. + (debug_to_acknowledge_created_inferior): Ditto. + (debug_to_clone_and_follow_inferior): Ditto. + (debug_to_post_follow_inferior_by_clone): Ditto. + (debug_to_insert_fork_catchpoint): Ditto. + (debug_to_remove_fork_catchpoint): Ditto. + (debug_to_insert_vfork_catchpoint): Ditto. + (debug_to_remove_vfork_catchpoint): Ditto. + (debug_to_has_forked): Ditto. + (debug_to_has_vforked): Ditto. + (debug_to_can_follow_vfork_prior_to_exec): Ditto. + (debug_to_post_follow_vfork): Ditto. + (debug_to_insert_exec_catchpoint): Ditto. + (debug_to_remove_exec_catchpoint): Ditto. + (debug_to_has_execd): Ditto. + (debug_to_reported_exec_events_per_exec_call): Ditto. + (debug_to_has_syscall_event): Ditto. + (debug_to_has_exited): Ditto. + (debug_to_mourn_inferior): Ditto. + (debug_to_can_run): Ditto. + (debug_to_notice_signals): Ditto. + (debug_to_thread_alive): Ditto. + (debug_to_stop): Ditto. + (debug_to_enable_exception_callback): Ditto. + (debug_to_get_current_exception_event): Ditto. + (debug_to_pid_to_exec_file): Ditto. + (debug_to_core_file_to_sym_file): Ditto. + (default_clone_and_follow_inferior): New function prototype + decl and function definition. + (dummy_target): Add new target_ops vector fields and their + initializations. More target_ops vector changes for HPUX new + fields. + (de_fault): Add new HPUX specific target_ops operations to the + de_fault macro + (INHERIT): Add new HPUX specific target_ops operations. + (debug_to_post_wait): New function. + (debug_to_post_startup_inferior): Ditto. + (debug_to_acknowledge_created_inferior): Ditto. + (debug_to_clone_and_follow_inferior): Ditto. + (debug_to_post_follow_inferior_by_clone): Ditto. + (debug_to_create_catch_fork_hook): Ditto. + (debug_to_create_catch_vfork_hook): Ditto. + (debug_to_has_forked): Ditto. + (debug_to_has_vforked): Ditto. + (debug_to_post_follow_vfork): Ditto. + (setup_target_debug): Initialize new target_ops vector fields. + (nosupport_runtime): New function, used in cleanup_target + (update_current_target): Add new new target_ops vector fields to + the INHERIT macro definition. + (generic_mourn_inferior): The call to breakpoint_init_inferior now + takes a parameter. + (normal_pid_to_str): Add a \0 to the end of buf. + (debug_to_has_syscall_event): New function. + (debug_to_enable_exception_callback): New function. + (debug_to_get_current_exception_event): New function. + (setup_target_debug): Initialize the 3 new target_ops vector fields + (struct signals): Fix message associated with SIGRETRACT. + (return_one): New function, used by the de_fault macro + (debug_to_post_attach): New function. + (debug_to_wait): Add new cases TARGET_WAITKIND_FORKED, + TARGET_WAITKIND_VFORKED, TARGET_WAITKIND_EXECD. + (debug_to_insert_fork_catchpoint): New function. + (debug_to_remove_fork_catchpoint): Ditto. + (debug_to_insert_vfork_catchpoint): Ditto. + (debug_to_remove_vfork_catchpoint): Ditto. + (debug_to_can_follow_vfork_prior_to_exec): Ditto. + (debug_to_insert_exec_catchpoint): Ditto. + (debug_to_remove_exec_catchpoint): Ditto. + (debug_to_core_file_to_sym_file): Ditto. + (setup_target_debug): Give new fields in current_target target_ops + vector values. + + * target.h: Include symtab.h. + (target_waitkind): New enumerated values + TARGET_WAITKIND_SYSCALL_ENTRY, TARGET_WAITKIND_SYSCALL_RETURN, + TARGET_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED, + TARGET_WAITKIND_EXECD. + (target_waitstatus): Add a syscall_id field to structure. + (child_has_syscall_event): New decl. + (child_thread_alive): New decl. + (target_ops): Add 3 new fields: To_has_syscall_event, + to_enable_exception_callback, to_get_current_exception_event + (target_enable_exception_callback): New macro. + (target_has_syscall_event): New macro. + (target_get_current_exception_event): New macro. + (TARGET_DISABLE_HW_WATCHPOINTS): New macro. + (TARGET_ENABLE_HW_WATCHPOINTS): New macro. + (PC_REQUIRES_RUN_BEFORE_USE): New macro. + (target_tid_to_str): New macro. + (target_waitstatus): Additional fields in struct to keep track + of child pid and pathname to execd file. + (target_ops): Add in the new target_ops function pointer fields. + New macros to go along with new target_ops fields. + In target_waitstatus.value, change name of child_pid field to + related_pid. + (target_pid_or_tid_to_str): Define default macro. + Add missing #endif after PC_REQUIRES_RUN_BEFORE_USE definition + (ENSURE_VFORKING_PARENT_REMAINS_STOPPED): Define default macro. + (RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK): Define default + macro. + There are new function decls for to_require_attach + and to_require_detach. There are also new macros, + target_require_attach and target_require_detach. There are + also new function decls for find_default_require_detach + and find_default_require_attach. + (target_ops): New fields to_post_wait, to_post_startup_inferior + to_acknowledge_created_inferior, to_clone_and_follow_inferior, + to_post_follow_inferior_by_clone, to_create_catch_fork_hook, + to_create_catch_vfork_hook, to_has_forked, to_has_vforked, + to_post_follow_vfork, to_pid_to_exec_file. + New function definitions child_pid_to_exec_file, child_post_wait, + child_post_startup_inferior, child_acknowledge_created_inferior, + child_clone_and_follow_inferior, + child_post_follow_inferior_by_clone, child_create_catch_fork_hook, + child_create_catch_vfork_hook, child_has_forked, + child_has_vforked, child_acknowledge_created_inferior, + child_post_follow_vfork. + New macros target_post_startup_inferior, + target_acknowledge_created_inferior, + target_clone_and_follow_inferior, + target_post_follow_inferior_by_clone, + target_create_catch_fork_hook, target_create_catch_vfork_hook, + target_pid_to_exec_file. + (find_default_clone_and_follow_inferior): New function prototype. + + + * v850ice.c (init_850ice_ops): Init new target vector fields. + + * valprint.c (print_binary_chars): Print out long long as + a binary number. + (print_octal_chars): Print out long long as an octal number + (print_decimal_chars): Print out long long as a decimal number + (strcat_longest): Define it. + * valprint.c: Hp merge, 4/15/98 snapshot + Add parameter to val_print. This is used for + evaluating C++ expressions. + + * value.h (VALUE_POINTED_TO_OFFSET): New macro. + Add field pointed_to_offset to value structure. + Add prototypes for new functions in valops.c. + (write_register_pid): Change prototype to match + function. + (val_print function decl): Additional parameter. + (VALUE_EMBEDDED_OFFSET): New macro. + (find_rt_vbase_offset): New function decl -- for C++ support. + +Wed Dec 23 15:03:42 1998 Per Bothner + + * Makefile.in (READLINE_CFLAGS): Search $(READLINE_SRC)/.. rather + than $(READLINE_SRC) so #include will work. + * top.c: #include instead of "history.h". + * tracepoint.c: Likewise. + * mac-xdep.c: Likewise. + +Wed Dec 23 12:32:00 1998 Andrew Cagney + + * defs.h (TARGET_FLOAT_FORMAT, TARGET_DOUBLE_FORMAT): Define using + TARGET_BYTE_ORDER and not target_byte_order. + +Tue Dec 22 10:51:33 1998 Elena Zannoni + + * config/i386/cygwin.mh (TERMCAP): define. + (from Chris Faylor, cgf@cygnus.com) + + * top.c: specify directory name for including readline.h + + * tracepoint.c: ditto. + + * utils.c: ditto. + +Mon Dec 21 13:30:34 1998 Mark Alexander + + * value.c (value_virtual_fn_field): Handle the situation where + vtbl is a pointer to a structure instead of a pointer to an array. + +Mon Dec 21 10:38:11 1998 Andrew Cagney + + * mips-tdep.c: (MIPS_DEFAULT_FPU_TYPE): Default to + MIPS_FPU_DOUBLE. + +1998-12-17 J.T. Conklin + + * blockframe.c (get_frame_saved_regs): If the saved_regs_addr ptr + is null, ensure that saved registers are copied from the local + variable that was used to obtain them. + +Sat Dec 19 09:55:09 1998 Stu Grossman + + * mips-tdep.c (mips32_heuristic_proc_desc): Clear temp_saved_regs + on restart. Fixes problem with backtracing through functions that + use virtual frame pointers. + +Fri Dec 18 14:23:34 1998 Andrew Cagney + + * mips-tdep.c (mips_push_arguments): Don't left-shift small + structs being passed in a register when an O64 target. + + * config/mips/tm-mips.h (enum mips_fpu_type, mips_fpu): Move to + mips-tdep.c. + + * mips-tdep.c (mips_fpu_string): Delete variable. + (mips_fpu_type_auto): New variable. + (mips_fpu_type): Rename mips_fpu. + (_initialize_mips_tdep): Delete initialization of mips_fpu et.al. + Rewrite ``set mipsfpu'' command set. + (set_mipsfpu_command, show_mipsfpu_command, + set_mipsfpu_single_command, set_mipsfpu_double_command, + set_mipsfpu_none_command, set_mipsfpu_auto_command): New + functions, handle commands. + (mips_push_arguments, mips_push_dummy_frame, mips_pop_frame, + mips_extract_return_value): Update. + +Thu Dec 17 02:15:40 1998 Andrew Cagney + + * configure.tgt (gdb_target): Identify mips64*vr4100*-*-elf* as + vr4100. + +Thu Dec 17 01:34:36 1998 Andrew Cagney + + * gdbtypes.c (build_gdbtypes): New function. + (_initialize_gdbtypes): Call. + +Wed Dec 16 11:47:00 1998 Andrew Cagney + + * gdbarch.c (show_architecture): Use TARGET_ARCHITECTURE. + * gdbarch.h, gdbarch.c: Fix typo's. Use struct's in preference to + types. + * gdbarch.h, gdbarch.c (gdbarch_debug): Add ``set archdebug'' to + command set. + +Tue Dec 15 23:46:40 1998 Andrew Cagney + + * config/mips/tm-*.h: (TARGET_BYTE_ORDER_DEFAULT, + TARGET_BYTE_ORDER_SELECTABLE_P): Replace TARGET_BYTE_ORDER and + TARGET_BYTE_ORDER_SELECTABLE. + +1998-12-14 Anthony Thompson (athompso@cambridge.arm.com) + + * remote-rdp.c (rdp_init): Don't discard first character on reset. + (translate_open_mode): Define table. + (exec_swi): Handle SWI_Clock. SWI_Open now handles stdin/stdout. + SWI_Write returns number of bytes not written. SWI_Read does the + same. SWI_Seek should return success/failure flag. Fix SWI_Flen. + +1998-12-14 J.T. Conklin + + * config/i386/nbsd.mh, config/m68k/nbsd.mh, config/ns32k/nbsd.mh + (XDEPFILES): Add ser-tcp.o. + +Mon Dec 14 14:46:13 1998 Andrew Cagney + + * monitor.c (monitor_expect, monitor_printf_noecho, + monitor_printf): Always compile EXTRA_RDEBUG code. + (RDEBUG): Ditto. + + From Michael Meissner : + * ppcbug-rom.c (init_ppc_cmds): Cleanup formatting. + +1998-12-08 Michael Meissner + + * monitor.c (monitor_printable_string): New function to convert a + string into a printable representation. + (monitor_error): Call error after converting string into printable + format. + (monitor_printf{,_noecho}): If EXTRA_RDEBUG is defined, convert + string into printable form before printing. + (monitor_expect): Ditto. + (monitor_read_memory{,_single}): Call monitor_error, not error. + (monitor_read_memory): Return immediately if length is 0. + + * ppcbug-rom.c (init_ppc_cmds): Fill in dump_registers field, + which is now required. + +Mon Dec 14 11:01:39 1998 Andrew Cagney + + * gdbarch.h, gdbarch.c: Consolidate the semi-dynamic target system + dependant GDB parameters. + (set_gdbarch_from_file): Combine set_architecture_from_file and + set_byte_order_from_file. + * top.c, defs.h, printcmd.c: Delete them from here. + * Makefile.in: Add gdbarch.[ch]. + * exec.c (exec_file_command): Call set_gdbarch_from_file. + +Sun Dec 13 09:52:51 1998 Andrew Cagney + + * defs.h (TARGET_PRINT_INSN_INFO, TARGET_PRINT_INSN): Define. + (TARGET_ARCHITECTURE, TARGET_ARCHITECTURE_AUTO): Define. + (TARGET_BYTE_ORDER_AUTO): Define. + (TARGET_BYTE_ORDER_SELECTABLE_P): Provide default. Replaces + TARGET_BYTE_ORDER_SELECTABLE. Handle compat issues. + (BITS_BIG_ENDIAN): Simplify. + (TARGET_FLOAT_FORMAT): Ditto. + (TARGET_DOUBLE_FORMAT): + + * remote-e7000.c, sh-tdep.c, printcmd.c, remote-sim.c, + remote-rdi.c, sparc-tdep.c: Update. + + * config/powerpc/tm-ppcle-eabi.h, config/rs6000/tm-rs6000.h, + config/powerpc/tm-ppc-eabi.h, config/mn10300/tm-mn10300.h: + Convert. + +Sat Dec 12 09:28:13 1998 Andrew Cagney + + * frame.h (struct frame_info): Add CORE_ADDR *saved_regs and + struct frame_extra_info *extra_info. + (frame_obstack_alloc, frame_saved_regs_zalloc): Prototype. + (SIZEOF_FRAME_SAVED_REGS): Provide default. + (FRAME_INIT_SAVED_REGS): Provide default. + (struct frame_saved_regs): Deprecate. + (EXTRA_FRAME_INFO): Deprecate. + + * blockframe.c (frame_obstack_alloc, frame_saved_regs_zalloc): New + function. + (generic_get_saved_register): Use FRAME_INIT_SAVED_REGS and + frame->saved_regs. + (frame_cache_obstack): Make static. + (get_frame_saved_regs): Deprecate. Copy the saved regs into the + frame buffer. + + * stack.c (frame_info): Rewrite using frame->saved_regs and + FRAME_INIT_SAVED_REGS. + * findvar.c (find_saved_register): Ditto. + + * config/mn10300/tm-mn10300.h (EXTRA_FRAME_INFO): Delete. + (FRAME_FIND_SAVED_REGS): Replace with FRAME_INIT_SAVED_REGS. No-op. + * mn10300-tdep.c: Update. + (analyze_dummy_frame): New function. + (struct frame_extra_info): Define. + (mn10300_init_extra_frame_info): Update. + + * config/rs6000/tm-rs6000.h: (EXTRA_FRAME_INFO): Delete. + (FRAME_FIND_SAVED_REGS): Replace with FRAME_INIT_SAVED_REGS. + (FRAME_ARGS_ADDRESS): Replace with function. + + * rs6000-tdep.c (frame_get_saved_regs): Rename from + frame_get_cache_fsr. + (rs6000_init_extra_frame_info): New function. + (rs6000_frame_init_saved_regs): Call frame_get_saved_regs. + (FUNCTION_START_OFFSET): Delete references, was ZERO. + (rs6000_frame_args_address): New function. + (frame_initial_stack_address): Update + + * config/mips/tm-mips.h (EXTRA_FRAME_INFO): Remove saved_regs. + (FRAME_INIT_SAVED_REGS): Rename FRAME_FIND_SAVED_REGS, update. + * mips-tdep.c (mips_find_saved_regs, read_next_frame_reg, + init_extra_frame_info, mips_pop_frame): Update. + * config/alpha/tm-alpha.h (FRAME_INIT_SAVED_REGS, + EXTRA_FRAME_INFO), alpha-tdep.c (alpha_find_saved_regs, + alpha_pop_frame, init_extra_frame_info): Ditto. + + * i960-tdep.c, m88k-tdep.c, h8300-tdep.c: Update. + * config/sparc/tm-sparc.h, config/a29k/tm-a29k.h: Define + FRAME_INIT_SAVED_REGS as no-op. + + * z8k-tdep.c (z8k_init_frame_saved_regs): Rename + get_frame_saved_regs. + (examine_frame, z8k_skip_prologue): Update. + * config/z8k/tm-z8k.h (FRAME_INIT_SAVED_REGS): Define. + +1998-12-11 Fernando Nasser + + From J.T. Conklin : + * i386-stub.c (handle_exception): Add support for 'P' command. + (NUMREGS): New macro. + +Fri Dec 11 09:07:05 1998 Andrew Cagney + + * i386b-nat.c: Include "expression.h". + + * symtab.h: Don't include "gnu-regex.h". + + * solib.c (solib_add_common_symbols): Cast parameters passed to + make_cleanup to use the new make_cleanup_func typedef. + + * inftarg.c: Include "wait.h" after, rather than before, . + "wait.h" was defining all WIF* macro's instead of filling in those + that missed. + +Fri Dec 11 09:52:04 1998 Andrew Cagney + + * mipsm3-nat.c, hppah-nat.c, infptrace.c, i386gnu-nat.c, + hppab-nat.c, core-aout.c, arm-xdep.c, alpha-nat.c, altos-xdep.c, + pyr-xdep.c, remote-st.c, remote-os9k.c, tahoe-tdep.c, pyr-tdep.c, + vax-tdep.c: Replace reg_name with REGISTER_NAME. + +Thu Dec 10 15:19:40 1998 David Taylor + + The following changes were made by Jim Blandy , + Edith Epstein , Elena Zannoni + Stan Shebs , and David + Taylor , as part of the project to merge in + changes originally made by HP; HP did not create ChangeLog + entries. + + * annotate.c (annotate_catchpoint): New function. + + * annotate.h (annotate_catchpoint): declare it; add new includes + (symtab.h and gdbtypes.h). + + * buildsym.h: add external var processing_hp_compilation. + + * coff-solib.h: + (SOLIB_REMOVE_INFERIOR_HOOK): new macro. defined to 0. + functionality not implemented for coff. + (SOLIB_CREATE_CATCH_LOAD_HOOK): New macro; generate error msg for coff. + (SOLIB_CREATE_CATCH_UNLOAD_HOOK): ditto. + (SOLIB_HAVE_LOAD_EVENT): ditto. + (SOLIB_LOADED_LIBRARY_PATHNAME): ditto. + (SOLIB_HAVE_UNLOAD_EVENT): ditto. + (SOLIB_UNLOADED_LIBRARY_PATHNAME): ditto. + (SOLIB_IN_DYNAMIC_LINKER): ditto. + (SOLIB_RESTART): ditto. + + * complaints.h: add ifdef...endif pair at beginning and end of file. + + * dstread.c (dst_symfile_read): the parameter to fileno + must be of type FILE *. So cast abfd->iostream in the + call to fileno must be cast as a FILE *, not a GDB_FILE *. + This will work because abfd->iostream is declared and + given a value in bdf and bfd will continue to use FILE + rather than GDB_FILE. + + * dwarf2read.c (dwarf_bool_name): change parameter from bool + to mybool. sigh. + + * expression.h: include symtab.h + + * frame.h (print_only_stack_frame, show_stack_frame, + show_frame_info): add prototypes. + + * gdbcmd.h (togglelist, stoplist): declare. + + * gdbcore.h (read_memory_string): declare it. + (exec_file_attach): add prototype. + + * inflow.c (terminal_is_ours): make non static. + + * minsyms.c: minor spacing change. + + * parser-defs.h (parse_nested_classes_for_hpacc): add prototype. + (find_template_name_end): add prototype. + + * scm-lang.c (scm_unpack): cast svalue to (int). + + * top.h: declare it. + + * valprint.h (print_binary_chars): new prototype definition. + (print_octal_chars): new prototype definition. + (print_decimal_chars): new prototype definition. + +Thu Dec 10 07:14:56 1998 Andrew Cagney + + * config/arm/tm-arm.h, arm-tdep.c: Replace REGISTER_NAMES with + REGISTER_NAME. + * mn10300-tdep.c, config/mn10300/tm-mn10300.h: Ditto. + * sh-tdep.c, config/sh/tm-sh.h: Ditto. + + * defs.h (REGISTER_NAME): Provide default for old targets. + * defs.h, infcmd.c: Rename reg_names to gdb_register_names. + + * tracepoint.c, target.c, parse.c, infcmd.c, remote-udi.c, + expprint.c, infcmd.c, printcmd.c, eval.c, stack.c, findvar.c, + remote-udi.c, config/alpha/tm-alpha.h, remote-sim.c, d30v-tdep.c, + config/mips/tm-mips.h, hppa-tdep.c: Use REGISTER_NAME. + +1998-12-08 James E Wilson + + * config/i960/mon960.mt (SIM_OBJS, SIM): Define. + +Tue Dec 8 16:49:24 1998 Stan Shebs + + * NEWS: Add mentions of newly-added configurations. + +1998-12-08 Philippe De Muyter + + * config/xm-aix4.h (SIGWINCH_HANDLER): Function `aix_resize_window' + must accept a signal number as parameter. + * config/rs6000/xm-rs6000.h (SIGWINCH_HANDLER): Ditto. + * utils.c (initialize_utils): Give a parameter to `SIGWINCH_HANDLER'. + + * inferior.h (register_valid): Variable's type is `SIGNED char', not + `char'. + * findvar.c (register_valid): Ditto. + + * defs.h (make_cleanup_func): Protect parameter list by `PARAMS'. + * gdbthread.h (unbind_target_thread_vector): Likewise. + +Tue Dec 8 15:09:44 1998 Edith Epstein + + Merged in m68k-linux patch from Andreas Schwab + + 1998-12-01 Andreas Schwab + + * Makefile.in, configure.host, configure.tgt: Add support for + m68k-linux. + * config/m68k/linux.mh: New file. + * config/m68k/linux.mt: New file. + * config/m68k/nm-linux.h: New file. + * config/m68k/tm-linux.h: New file. + * config/m68k/xm-linux.h: New file. + * gdb/m68klinux-nat.c: New file. + * gdbserver/low-linux.c: Add support for m68k-linux. + * gdb/config/m68k/tm-m68k.h (NUM_FREGS): New macro. + +1998-12-07 Jason Molenda (jsm@bugshack.cygnus.com) + + * config/i386/xm-cygwin.h: Remove REQUEST_QUIT definition. + * config/powerpc/xm-cygwin.h: Ditto. + +1998-12-07 Jim Blandy + + * rs6000-tdep.c (pop_frame): Correctly find the registers saved in + the stack frame. Their offset from the previous stack frame is in + fdata.gpr_offset and fdata.fpr_offset, not fdata.offset. + (gdb.base/return.exp) + * config/rs6000/tm-rs6000.h: Doc fixes. + +1998-12-03 Jason Molenda (jsm@bugshack.cygnus.com) + + * monitor.c (monitor_read_memory): Zero out pattern buffers + before calling re_search. + (parse_register_dump): Ditto. + +Thu Dec 3 10:37:22 EST 1998 Zdenek Radouch (radouch@cygnus.com) + + FR30 updates - still very preliminary. + * configure.tgt + * fr30-tdep.c + * config/fr30/tm-fr30.h + +Thu Dec 3 16:30:35 1998 Andrew Cagney + + * ax-gdb.c: Include target.h. + +Tue Dec 3 10:59:00 1998 Andrew Cagney + + * ax-gdb.c (_initialize_ax_gdb), i960-tdep.c (pop_frame), + monitor.c (flush_monitor_dcache, longlongendswap), remote-array.c + (hexword2ascii), w89k-rom.c (init_w89k_cmds), z8k-tdep.c + (init_frame_pc, extract_return_value): Make return type void. + * monitor.c (monitor_write_even_block): Make return type explicit. + (monotor_read_memory_block): Delete function. + * monitor.h: Update. + * remote.c (remote_get_threadlist, remote_update_threads), + remote-array.c (array_get_packet), remote-rdi.c (Fail): Always + return a value. + * m32r-tdep.c (m32r_fix_call_dummy): From Michael Snyder, void + function. + * jv-valprint.c (java_val_print): From Stu Grossman. Return 0 by + default. + +Wed Dec 2 15:11:38 1998 Michael Snyder + + * tracepoint.c: Move default definition of + TARGET_VIRTUAL_FRAME_POINTER from here to target.h. + * target.h: Add default definition of TARGET_VIRTUAL_FRAME_POINTER. + * ax-gdb.c (gen_frame_args_address, gen_frame_locals_address): + use TARGET_VIRTUAL_FRAME_POINTER to determine frame pointer. + (gen_trace_for_expr): new argument, address of tracepoint, + gets passed to new_agent_expr and added to struct agent_expr. + (is_nontrivial_conversion): call to new_agent_expr now requires + a dummy argument. (agent_command): use get_current_frame() to + get current PC scope; pass it to gen_trace_for_expr. + * ax-general.c (new_agent_expr): new argument, address of + tracepoint; store it in new field of struct agent_expr. + * ax.h (struct agent_expr): add new field for tracepoint address. + * ax-gdb.h: change prototypes to match above changes. + + * m32r-tdep.c (decode_prologue): If no branch or push fp is found, + but there's a stack adjust, then use that as the end of prologue. + (m32r_skip_prologue): don't skip past the first line if there is + line info. (m32r_virtual_frame_pointer): new function. + (m32r_fix_call_dummy): no return value needed. + +Tue Dec 1 10:59:00 1998 Andrew Cagney + + * ocd.c (remote_timeout), (BDM_BREAKPOINT), monitor.c (readchar), + remote.c: Cleanup closing of open comments. + +Mon Nov 30 16:04:03 1998 Doug Evans + + * config/fr30/tm-fr30.h (INNER_THAN): Add parameters. + +Mon Nov 30 11:18:48 1998 Andrew Cagney + + * frame.h (FRAME_CHAIN_VALID): Default to + default_frame_chain_valid. + * blockframe.c (default_frame_chain_valid): New function. + + * frame.h (FRAME_CHAIN_VALID_ALTERNATIVE): Delete references + * blockframe.c (alternate_frame_chain_valid): New function. + * config/mips/tm-mipsv4.h, config/m88k/tm-delta88v4.h, + config/m68k/tm-monitor.h, config/m68k/tm-m68kv4.h, + config/i386/tm-i386v4.h, config/i386/tm-i386nw.h, + config/h8300/tm-h8300.h: Update. + + * blockframe.c (nonnull_frame_chain_valid): New function. + * config/m68k/tm-os68k.h, config/m68k/tm-vx68.h, + config/m68k/tm-apollo68b.h, config/i960/tm-vx960.h, + config/arc/tm-arc.h: Update FRAME_CHAIN_VALID. + + * hppa-tdep.c (frame_chain_valid, hppa_frame_chain_valid), + remote-vx29k.c (get_fp_contents, vx29k_frame_chain_valid), + arm-tdep.c (frame_chain_valid, arm_frame_chain_valid): Rename + functions so that they are name space clean. + * config/pa/tm-hppa.h, config/a29k/tm-vx29k.h, + config/arm/tm-arm.h: Update FRAME_CHAIN_VALID. + + * gould-tdep.c (gould_frame_chain_valid), d30v-tdep.c + (d30v_frame_chain_valid), d10v-tdep.c (d10v_frame_chain_valid): + New functions. + * config/gould/tm-np1.h, config/gould/tm-pn.h, + config/d30v/tm-d30v.h, config/d10v/tm-d10v.h: Update + FRAME_CHAIN_VALID. + +Sun Nov 29 11:18:37 1998 Andrew Cagney + + * z8k-tdep.c (z8k_addr_bits_remove), w65-tdep.c + (w65_addr_bits_remove), h8500-tdep.c (h8500_addr_bits_remove), + m88k-tdep.c (m88k_addr_bits_remove): Function to clean up an + address. + * config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/m88k/tm-m88k.h, + config/h8500/tm-h8500.h: Define ADDR_BITS_REMOVE to call targets + corresponding function. + * z8k-tdep.c (saved_pc_after_call): Update. + +Sat Nov 28 12:24:31 1998 Andrew Cagney + + * config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/vax/tm-vax.h, + config/v850/tm-v850.h, config/tahoe/tm-tahoe.h, + config/sparc/tm-sparc.h, config/sh/tm-sh.h, + config/rs6000/tm-rs6000.h, config/pyr/tm-pyr.h, + config/pa/tm-hppa.h, config/ns32k/tm-umax.h, + config/ns32k/tm-merlin.h, config/none/tm-none.h, + config/mn10300/tm-mn10300.h, config/mn10200/tm-mn10200.h, + config/mips/tm-mips.h, config/m88k/tm-m88k.h, + config/m68k/tm-m68k.h, config/m32r/tm-m32r.h, + config/i960/tm-i960.h, config/i386/tm-i386.h, + config/h8500/tm-h8500.h, config/h8300/tm-h8300.h, + config/gould/tm-pn.h, config/gould/tm-np1.h, config/arm/tm-arm.h, + config/convex/tm-convex.h, config/d10v/tm-d10v.h, + config/alpha/tm-alpha.h, config/a29k/tm-a29k.h: Add parameters to + macro INNER_THAN. + + * valops.c (push_word, value_push, call_function_by_hand), + breakpoint.c (bpstat_stop_status), blockframe.c + (generic_push_dummy_frame, generic_frame_chain_valid), inferior.h + (PC_IN_CALL_DUMMY), infrun.c (wait_for_inferior): Update use of + INNER_THAN. + +Fri Nov 27 11:00:25 1998 Andrew Cagney + + * target.h (one_stepped): Move global from here. + * infrun.c (singlestep_breakpoints_inserted_p): To here. Rename. + Make static. + (wait_for_inferior): Update. + (resume): Update. Set variable after call to SOFTWARE_SINGLE_STEP. + + * target.h (NO_SINGLE_STEP): Replace with SOFTWARE_SINGLE_STEP_P + and SOFTWARE_SINGLE_STEP. + * config/sparc/tm-sparc.h, config/rs6000/tm-rs6000.h, + config/arc/tm-arc.h: Update. + * rs6000-tdep.c (rs6000_software_single_step), sparc-tdep.c + (sparc_software_single_step), arc-tdep.c (arc_single_step): New + functions. Replace function single_step. + + * config/mips/tm-mips.h (STEP_SKIPS_DELAY_P): Define. + * infrun.c (proceed): Cleanup. + +Thu Nov 26 11:19:15 1998 Andrew Cagney + + * config/alpha/tm-alpha.h (ABOUT_TO_RETURN): Replace macro. + * alpha-tdep.c (alpha_about_to_return): With new function. + (heuristic_proc_start): Update. + * config/mips/tm-mips.h (ABOUT_TO_RETURN), mips-tdep.c + (heuristic_proc_start, mips_about_to_return): Ditto. + * config/ns32k/tm-merlin.h (ABOUT_TO_RETURN), + config/ns32k/tm-umax.h (ABOUT_TO_RETURN), ns32k-tdep.c + (ns32k_about_to_return, ns32k_get_enter_addr): Ditto. + + * config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/vax/tm-vax.h, + config/tahoe/tm-tahoe.h, config/sparc/tm-sparc.h, + config/sh/tm-sh.h, config/rs6000/tm-rs6000.h, config/pyr/tm-pyr.h, + config/pa/tm-hppa.h, config/m88k/tm-m88k.h, config/m68k/tm-m68k.h, + config/i960/tm-i960.h, config/i386/tm-i386.h, + config/h8500/tm-h8500.h, config/h8300/tm-h8300.h, + config/gould/tm-pn.h, config/gould/tm-np1.h, + config/convex/tm-convex.h, config/arm/tm-arm.h, + config/arc/tm-arc.h, config/a29k/tm-a29k.h: Delete macro + ABOUT_TO_RETURN. + * config/w65/tm-w65.h (RTL, RTS): Delete macros. + * h8500-tdep.c (about_to_return): Delete function. + +Thu Nov 26 11:19:15 1998 Andrew Cagney + + * rs6000-tdep.c (rs6000_breakpoint_from_pc): Change big_breakpoint + and little_breakpoint to char[] from char*. + * remote-array.c (array_insert_breakpoint): Change bp_addr to + CORE_ADDR type. + +Wed Nov 25 00:13:06 1998 Andrew Cagney + + * vx-share/xdr_ld.c (xdr_ldtabl): Cast second arg to char** + instead of char*. + + * configure.tgt (v850): Only build v850ice when cygwin and gui. + * configure.in: Add parameter to --enable-build-warnings. + * configure: Re-build. + + * c-exp.y (parse_number): Rewrite shift to pacify GCC. + + * config/i960/tm-i960.h (BREAKPOINT): Delete definition - simply + wrong. + + * monitor.c (compile_pattern): Make val const char*. + (monitor_wait_cleanup): Make old_timeout void*, pointing at + old_timeout. + (monitor_wait): Update. + + * remote-udi.c, remote-sim.c, remote-e7000.c, hppa-tdep.c, + remote-mips.c, sparcl-tdep.c, xcoffread.c: Cast parameters passed + to make_cleanup to use the new make_cleanup_func typedef. + + * alpha-tdep.c (MASK): Use LONGEST to avoid arithmetic overflow. + + * config/a29k/tm-a29k.h (TRANSPARENT): Rename macro to + TRANSPARENT_FRAME. Avoid name-space clash. + * a29k-tdep.c (init_frame_info): Update. + +Wed Nov 25 20:37:00 1998 Andrew Cagney + + * rs6000-tdep.c (rs6000_breakpoint_from_pc): Change big_breakpoint + and little_breakpoint to char[] from char*. + * mem-break.c (memory_insert_breakpoint, + memory_remove_breakpoint): Pass address of bplen. + * remote-array.c (array_insert_breakpoint): Change bp_addr to + CORE_ADDR type. + +Tue Nov 24 15:46:33 1998 Michael Snyder + + * config/mn10300/tm-mn10300.h (TARGET_VIRTUAL_FRAME_POINTER): + new target macro. + * mn10300-tdep.c (mn10300_virtual_frame_pointer): new function. + * tracepoint.c (encode_actions): Use the new target macro to + determine the virtual frame pointer, for collecting locals/args. + (add_local_symbols, collect_symbol): add a register/offset pair of + arguments so that the virtual frame pointer can be passed in. + +1998-11-24 Felix Lee + + * procfs.c (procfs_wait): handle syscall events first. + + * procfs.c (GDB_GREGSET_TYPE, GDB_FPREGSET_TYPE): new macros. + * config/sparc/xm-sun4sol2.h: use them. + * core-sol2.c: don't #undef gregset_t and fpregset_t. + * sol-thread.c: ditto. + * sparc-tdep.c: ditto. + +Tue Nov 24 14:13:10 1998 Andrew Cagney + + * breakpoint.c (memory_breakpoint_size): Delete global. + (read_memory_nobpt): Determine real breakpoint address and size + using BREAKPOINT_FROM_PC. + + * defs.h (breakpoint_from_pc_fn): BREAKPOINT_FROM_PC function + template. + * target.h, mem-break.c (memory_breakpoint_from_pc): + Rewrite. Always define. Return NULL when memory breakpoints are + not supported. + (memory_insert_breakpoint, memory_remove_breakpoint): Call + BREAKPOINT_FROM_PC. + * target.h (BREAKPOINT_FROM_PC): Provide default. + * gdbint.texinfo (BREAKPOINT_FROM_PC): Document. + + * config/rs6000/tm-rs6000.h (BREAKPOINT): Delete macro. + (BREAKPOINT_FROM_PC): Define. + ({BIG,LITTLE}_BREAKPOINT): Move macros from here. + * rs6000-tdep.c: To here. + (rs6000_breakpoint_from_pc): New function. + + * config/mn10300/tm-mn10300.h (BREAKPOINT): Delete macro. + (BREAKPOINT_FROM_PC): Define, call. + * mn10300-tdep.c (mn10300_breakpoint_from_pc): New function. + + * config/mips/tm-mips.h ({BIG,LITTLE}_BREAKPOINT, + IDT_{BIG,LITTLE}_BREAKPOINT, PMON_{BIG,LITTLE}_BREAKPOINT, + MIPS16_{BIG,LITTLE}_BREAKPOINT): Move macros from here. + * mips-tdep.c: To here. + + * config/arm/tm-arm.h ({BIG,LITTLE}_BREAKPOINT): Delete macros. + ({ARM,THUMB}_{BE,LE}_BREAKPOINT): Move macros from here. + * arm-tdep.c: To here. + + * remote-array.c (memory_breakpoint_size): Delete variable. + (array_insert_breakpoint): Obtain breakpoint size using + BREAKPOINT_FROM_PC. + * remote-st.c (memory_breakpoint_size, st2000_insert_breakpoint): + Ditto. + * remote-os9k.c (memory_breakpoint_size, + rombug_insert_breakpoint): Ditto. + * remote-e7000.c (memory_breakpoint_size): Ditto. + +Mon Nov 23 11:38:40 1998 Michael Snyder + + * symfile.c (deduce_language_from_filename): rewrite so as to + work from a table of filename extensions, modifiable by the user. + (filename_language_table): new data structure. + (set_ext_lang_command): new function for new command, "set + extension-language". (info_extension_language_command): new + function for new command "info extension-languages". + (add_filename_language, init_filename_language_table): new + support functions for the above. + * language.c (language_enum): new function. Support for above. + +Mon Nov 23 10:47:54 1998 Andrew Cagney + + * config/sh/tm-sh.h, config/mn10200/tm-mn10200.h, + config/m32r/tm-m32r.h, config/arm/tm-arm.h, config/i960/tm-i960.h, + config/gould/tm-np1.h, config/d10v/tm-d10v.h, + config/v850/tm-v850.h, config/pa/tm-hppa.h, config/a29k/tm-a29k.h, + config/mn10300/tm-mn10300.h, config/mips/tm-mips.h + (USE_STRUCT_CONVENTION): Cleanup, define macro as function. + + * sh-tdep.c (sh_use_struct_convention), mn10200-tdep.c + (mn10200_use_struct_convention), i960-tdep.c + (i960_use_struct_convention), gould-tdep.c + (gould_use_struct_convention), d10v-tdep.c + (d10v_use_struct_convention), v850-tdep.c + (v850_use_struct_convention), hppa-tdep.c + (hpha_use_struct_convention), m32r-tdep.c + (m32r_use_struct_convention), arm-tdep.c + (arm_use_struct_convention), mn10300-tdep.c + (mn10300_use_struct_convention), a29k-tdep.c + (a29k_use_struct_convention), mips-tdep.c + (mips_use_struct_convention): New functions + + * value.h, values.c (generic_use_struct_convention): New function, + replace macro. + * values.c (USE_STRUCT_CONVENTION): Macro defaults to function + generic_use_struct_convention. + +Sat Nov 21 17:15:40 1998 Philippe De Muyter + + * breakpoint.c (bpstat_stop_status): Do not increment hit_count + of breakpoint if condition is not true. + + * coffread.c (coff_symtab_read): Discard C_LABEL's that are not + function entry points, to avoid getting them in the stack dump + instead of the actual function. + + * config/m68k/delta68.mh (NAT_FILE): Undo 1998-08-18 change; + without NAT_FILE definition, configure will assume that GDB cannot + run native. + * config/m68k/nm-delta68.h (KERNEL_U_SIZE): New macro. + * delta68-nat.c (kernel_u_size): New function. + +Fri Nov 20 10:13:03 1998 Andrew Cagney + + * buildsym.c (end_symtab): Cleanup PROCESS_LINENUMBER_HOOK. + +Thu Nov 19 15:21:04 1998 Geoffrey Noer + + * rdi-share/host.h: if compiling under Cygwin, make sure new + preprocessor define is defined. Define it if not. + * rdi-share/hostchan.h: ditto + * rdi-share/aclocal.m4: regenerate + * rdi-share/configure: regenerate + +Thu Nov 19 14:43:44 1998 Geoffrey Noer + + * configure.in: switch back to checking __CYGWIN32__ + * configure: regenerate + +Thu Nov 19 09:53:00 1998 Andrew Cagney + + * exec.c (exec_file_command): Cleanup. Replace #if + NEED_TEXT_START_END with if(). + * config/pa/nm-hppah.h (NEED_TEXT_START_END): Redefine to be 1. + * config/convex/tm-convex.h (NEED_TEXT_START_END): Ditto. + * config/gould/tm-np1.h (NEED_TEXT_START_END): Ditto. + * config/a29k/tm-a29k.h (NEED_TEXT_START_END): Ditto. + +Thu Nov 19 13:06:22 1998 Geoffrey Noer + + * main.c: Wait until more time has passed before calling + new cygwin_ funcs, revert back to the cygwin32_ ones for now. + * win32-nat.c: Ditto. + +Wed Nov 18 15:03:17 1998 Andrew Cagney + + * 29k-share/udi/udip2soc.c (UDIConnect): Replace sys_errlist with + strerror. + +Mon Nov 16 14:17:05 1998 Geoffrey Noer + + * defs.h: if compiling under Cygwin, define __CYGWIN__ if + __CYGWIN32__ is defined and __CYGWIN__ isn't for backwards + compatibility. + +Fri Nov 13 00:15:08 1998 Geoffrey Noer + + Changes to account for name change from cygwin32 to cygwin and + clean up Win32-related ifdefs. + + * configure.tgt: check for cygwin* instead of cygwin32. + New cygwin gdb_target variable loses the "32". + * configure.host: check for cygwin* instead of cygwin32. + New cygwin gdb_host variable loses the "32". + * configure.in: test __CYGWIN__ instead of __CYGWIN32__, + rename gdb_cv_os_cygwin32 variable to drop the "32". Call + AM_EXEEXT instead of AC_EXEEXT since that isn't in a released + autoconf yet. + * configure: regenerate. + + * main.c: drop "32" from cygwin_ funcs, include sys/cygwin.h where + cygwin path conv protos live, instead of adding a proto here for + them here. + * {main.c, ser-tcp.c, ser-unix.c, top.c}: check __CYGWIN__ + instead of __CYGWIN32__. + * source.c: thoughout, check _WIN32 instead of WIN32. + + * config/i386/cygwin32.mh: delete. + * config/i386/cygwin.mh: new file, was cygwin32.mh. + * config/i386/cygwin32.mt: delete. + * config/i386/cygwin.mt: new file, was cygwin32.mt. + * config/i386/tm-cygwin32.h: delete. + * config/i386/tm-cygwin.h: new file, was tm-cygwin32.h. + * config/i386/xm-cygwin32.h: delete. + * config/i386/xm-cygwin.h: new file, was xm-cygwin32.h. + * config/i386/xm-windows.h: #include xm-cygwin.h now. + * config/powerpc/cygwin32.mh: delete. + * config/powerpc/cygwin.mh: new file, was cygwin32.mh. + * config/powerpc/cygwin32.mt: delete. + * config/powerpc/cygwin.mt: new file, was cygwin32.mt. + * config/powerpc/tm-cygwin32.h: delete. + * config/powerpc/tm-cygwin.h: new file, was tm-cygwin32.h. + * config/powerpc/xm-cygwin32.h: delete. + * config/powerpc/xm-cygwin.h: new file, was xm-cygwin32.h. + + * rdi-share/aclocal.m4: regenerate with aclocal. + * rdi-share/configure: regenerate with autoconf. + * rdi-share/{host.h, hostchan.c, hostchan.h, serdrv.c, serpardr.c, + unixcomm.c}: check __CYGWIN__ instead of __CYGWIN32__. + +Thu Nov 12 17:19:43 1998 John Metzler + + * remote.c (remote_get_threadinfo): Support for remote + multithread debugging. + (remote_get_threadlist): get a partial list of threads + (remote_threadlist_iterator): Step through all the threads + (init_remote_threadtests): Optional builtin unit test commands. + + * thread.c (bind_target_thread_vector): Implementa a more dynamic + way of accessing target specific thread info functions than + FIND_NEW_THREADS. + (target_thread_info): Function to get extended thread information. + + * gdbthread.h: Export internal data structures corresponding to + external detailed thread info response. This is more like a 'ps' + command than what might be expected of host based threads. This + is for embedded systems. + +Wed Nov 11 15:47:00 1998 Michael Snyder + + * procfs.c (proc_set_exec_trap): don't set PR_ASYNC or PR_FORK + in the child process for UnixWare (causes processes forked by + the debuggee to hang). + +Mon Nov 9 12:00:36 1998 Dave Brolley + + * config/fr30/fr30.mt: New file. + * config/fr30/tm-fr30.h: New file. + +1998-11-05 Jim Wilson + + * remote-vx.c (net_read_registers, net_write_registers, + vx_xver_memory, vx_resume, vx_attach, vx_detach, vx_kill): + Change errno to errno_num. + * vx-share/xdr_ptrace.c (xdr_ptrace_return): Likewise. + * vx-share/xdr_ptrace.h (struct ptrace_return): Likewise. + +Thu Nov 5 08:41:33 1998 Christopher Faylor + + * top.c (gdb_readline): Allow CRLF line termination on systems + which define CRLF_SOURCE_FILES. + * win32-nat.c: 1) Add thread support, 2) fix ability to attach to + a running process, and 3) implement limited support for cygwin + signals. + (thread_rec): New function. + (child_add_thread): Ditto. + (child_init_thread_list): Ditto. + (child_delete_thread): Ditto. + (do_child_fetch_inferior_registers): Ditto. + (do_child_store_inferior_registers): Ditto. + (handle_output_debug_string): Ditto. + (child_fetch_inferior_registers): Use do_* function to perform + operation. + (child_store_inferior_registers): Ditto. + (child_continue): Ditto. + (child_thread_alive): Ditto. + (cygwin_pid_to_str): Ditto. + (handle_load_dll): Reorganize, add first attempt at reading + dll names from attached processes. Change info messages to provide + more information when dll is already loaded. + (handle_exception): Changes mandated by new thread-aware structures. + (child_wait): Track thread creation/destruction. Handle cygwin + signals. + (child_create_inferior): Ditto. + (child_resume): Ditto. + (child_kill_inferior): Ditto. Close child process handle to avoid a + handle leak. + (child_ops): Fill out child_ops fields that deal with threads. + * config/i386/tm-cygwin32.h: Declare function and macro needed + for converting a cygwin "pid" to a string. + * config/i386/xm-cygwin32.h: define HAVE_SIGSETMASK as 0 since + sigsetmask is not defined in cygwin. + +Thu Nov 5 08:38:18 1998 Christopher Faylor + + * win32-nat.c: Remove obsolete PPC conditionals. + +Wed Nov 4 18:44:31 1998 Dave Brolley + + * configure.tgt: Add fr30-*-elf*. + +1998-11-03 Jim Wilson + + * c-exp.y (parse_number): Check TARGET_LONG_LONG_BIT when setting + high_bit to avoid undefined negative shift. + +Mon Nov 2 15:26:33 1998 Geoffrey Noer + + * configure.in: Check cygwin* instead of cygwin32*. + * configure: regenerate + +Thu Oct 29 10:04:20 1998 Michael Snyder + + [Support for trace debugging: registers that were not collected.] + * remote.c (remote_fetch_registers): accept 'xxxx' in the register + packet, with the meaning "register value is not available". + Set register_valid to -1, which will connote "no value available". + * findvar.c (read_relative_register_raw_bytes): return failure if + register_valid == -1. (value_of_register): return failure if + register_valid == -1. (read_var_value): return error if + value_of_register fails for a register variable. + (value_from_register): return failure if register_valid == -1. + * eval.c (evaluate_subexp_standard): return error if + value_of_register fails for a register used in an expression. + * infcmd.c (do_registers_info): display "value not available" + for registers for which register_valid == -1. + + * tracepoint.c (set_raw_tracepoint): just save the filename as is + from the symbol table, rather than trying to prepend the dir name. + Also save the bfd section. (tracepoints_info): use the section + when looking up the function name. + * tracepoint.h: add section field to tracepoint struct. + +Wed Oct 28 08:01:38 1998 Mark Alexander + + * sparcl-tdep.c (send_resp, sparclite_serial_start, + sparclite_serial_write): Use remote_timeout instead of hardcoded + two second timeout. + (download): Fix adjustment of a.out load addresses. + +Wed Oct 28 12:32:58 1998 Andrew Cagney + + * configure.in (--enable-build-warnings): Finish rename from + --enable-warnings. + (enable-build-warnings): Add -Wpointer-arth, allow =* for + sim/common compatibility. + * configure: Re-generate. + +Wed Oct 21 08:44:30 1998 Andrew Cagney + + * 29k-share/udi/udip2soc.c: Replace sys_errlist with strerror(). + +Thu Oct 22 09:56:55 1998 Andrew Cagney + + * config/rs6000/aix4.mh (NATDEPFILES): Move xcoffread.o from here. + * config/rs6000/aix4.mt (TDEPFILES): To here. + +Wed Oct 21 10:02:31 1998 Andrew Cagney + + * rdi-share/unixcomm.c: Provide definitions of SERPORT and PARPORT + on BSD hosts. + +1998-10-19 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in (AM_EXEEXT): Use AC_EXEEXT instead. + * configure: Regenerated. + +Sat Oct 17 17:39:23 1998 Felix Lee + + * core-sol2.c: #include , for sol2.7 weirdness. + +Fri Oct 16 15:31:38 1998 Michael Snyder + + * m32r-tdep.c (decode_prologue): Return failure if we reach + the end of the function without finding the end of the prologue. + +1998-10-16 Jason Molenda (jsm@bugshack.cygnus.com) + + * command.c copying.c copying.awk core-aout.c core-regset.c + corelow.c dcache.c i386-tdep.c i386v4-nat.c i387-tdep.c + infcmd.c infptrace.c infrun.c remote.c solib.c symfile.c + symmisc.c valarith.c: Add prototypes. + + * defs.h: Add prototype for utils.c::do_run_cleanups. + + * gdbtypes.c: Add prototypes. + (make_pointer_type): Add braces to remove nested if-else ambiguity. + (make_reference_type): Ditto. + + * printcmd.c (printf_command): Initialize 'f' and 'string' at + function startup to suppress possibly-used-before-initialized warning. + + * remote-utils.c: Add prototypes. + (sr_pollchar): Add braces to remove nested if-else ambiguity. + + * ser-tcp.c: Add prototypes. + (wait_for): Add braces to remove nested if-else ambiguity. + (tcp_readchar): Ditto. + + * ser-unix.c: Add prototypes. + (get_tty_state): Don't define errno here. + (hardwire_readchar): Only define 't' if we are compiling in a Cygwin + environment. + + * symtab.c: Add prototypes. + (find_methods): Add braces to remove nested if-else ambiguity. + (search_symbols): Set 'i' to an initial value to suppress a + possibly-used-before-initialized warning. + + * valops.c: Add prototypes. + (value_cast): Set 'eltype2' to an initial value to suppress a + possibly-used-before-initialized warning. + (value_of_variable): Add braces to remove nested if-else ambiguity. + (value_of_this): Ditto. + + * valprint.c: Add prototypes. + (print_floating): Add braces to remove nested if-else ambiguity. + +Thu Oct 15 19:50:48 1998 Stan Shebs + + * tm-sp64.h (SETUP_ARBITRARY_FRAME, FRAME_SPECIFICATION_DYADIC): + Remove, nevermore used. + +Thu Oct 15 16:55:00 1998 Andrew Cagney + + * command.c: Include "wait.h" after, rather than before, . + "wait.h" was defining all WIF* macro's instead of filling in those + that missed. + +1998-10-14 Jason Molenda (jsm@bugshack.cygnus.com) + + * defs.h: Move _initialize_printcmd, _initialize_stack, + _initialize_blockframe out of here and in to their respective .c + files. + * blockframe.c: Move _initialize_blockframe prototype to here. + * printcmd.c: Move _initialize_printcmd prototype to here. + * stack.c: Move _initialize_stack prototype to here. + + * source.c, symtab.h: Move _initialize_source prototype to the .c + file. + * values.c, value.h: Move _initialize_values prototype to the .c file. + * gdbthread.h, thread.c: Move _initialize_thread prototype to the .c + file. + * breakpoint.c, breakpoint.h: Move _initialize_breakpoint prototype + to the .c file. + + * abug-rom.c alpha-nat.c alpha-tdep.c annotate.c ax-gdb.c bcache.c: + Standardize comments for the prototype section of these files. + + * configure.in: Look in libc for wctype before looking for it in libc. + +Tue Oct 13 18:56:51 1998 Felix Lee + + * sol-thread.c (ps_pstop, etc): simple test for proc_service.h + version didn't work for sol2.6; pushed it to autoconf. + * configure.in (gdb_cv_proc_service_is_old): new test. + * acconfig.h (PROC_SERVICE_IS_OLD): new define. + * configure, config.in: regenerate. + +1998-10-13 Jason Molenda (jsm@bugshack.cygnus.com) + + * blockframe.c (find_pc_sect_partial_function): Add braces to avoid + possible nested-if confusion. + * breakpoint.c (breakpoint_here_p): Ditto. + (breakpoint_inserted_here_p): Ditto. + (breakpoint_thread_match): Ditto. + + * gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined. + * gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability + prototypes. + + * symtab.h: Add prototype for _initialize_source. + * value.h: Add prototype for _initialize_value. + + * defs.h: Include sys/types.h or stddef.h to get size_t. + (make_cleanup): Add make_cleanup_func typedef and switch to using + a prototype for this function. + (mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't + using mmalloc. + + * ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c + dwarf2read.c dwarfread.c elfread.c eval.c exec.c infcmd.c infrun.c + mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c + symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c + valops.c: Cast parameters passed to make_cleanup to use the new + make_cleanup_func typedef. + +Tue Oct 13 00:51:48 1998 Felix Lee + + * sol-thread.c (ps_pstop, etc): different solaris versions have + slightly different prototypes in proc_service.h; compensate. + +1998-10-12 Jason Molenda (jsm@bugshack.cygnus.com) + + * Makefile.in (AWK): Unused; remove. + * configure.in: Remove unused autoconf checks for MINIX, memcpy, + poll, select, strings.h. + * config.in: Regenerated. + * configure: Regenerated. + +1998-10-12 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in: Check for sys/debugreg.h, asm/debugreg.h. + * i386v-nat.c: Include asm/debugreg.h, sys/debugreg.h if it is not + present. + +Sun Oct 11 12:08:07 1998 Peter Schauer + + * dwarf2read.c (dwarf2_build_psymtabs_hard): Do not adjust the + address range of a compilation unit without children. + + * mdebugread.c (parse_partial_symbols): Fix handling of stabs + continuations, use xmalloc and xrealloc. + +Fri Oct 9 18:14:43 1998 Mark Alexander + + * rs6000-tdep.c: Don't include tm.h twice. + +1998-10-08 Keith Seitz + + * main.c (main): Remove calls to {pre,post}_add_symbol_hooks. + There should be sufficient information/hooks now to eliminate + this hack. + + * exec.c (file_command): Add a new hook here to inform ui's + when the exec file has changed. Adding it here allows the + ui to be informed after symbol reading. + + * gdbcore.h: Add declaration of file_changed_hook. + +Thu Oct 8 08:40:42 1998 Mark Alexander + + * rs6000-tdep.c (get_saved_register): Define only if + USE_GENERIC_DUMMY_FRAMES is defined. + +1998-10-06 Jason Molenda (jsm@bugshack.cygnus.com) + + Eliminate a few warnings from the compiler. + * breakpoint.h: Add prototype. + * breakpoint.c (do_enable_breakpoint): cast mem_cnt, i to (void). + * configure.in: Check if strdup declaration is necessary. + * configure: Regenerated. + * defs.h: Add prototypes. + * gdb_string.h: Only define strdup if necessary. + * gdbthread.h: Add prototypes. + * printcmd.c: Add prototyptes. + (disassemble_command): Remove unused variable 'section'. + * symtab.c: Add prototypes. + * symtab.h: Include gnu-regex.h, add prototype. + * thread.c: Add prototype. + +Mon Oct 5 19:44:39 1998 Stan Shebs + + From David Purves : + * stabsread.c (rs6000_builtin_type): Create a complex float instead + of an error. + (read_sun_floating_type): Similarly. + (read_range_type): Create a complex float if self_subrange is + true. + +Fri Oct 2 19:42:31 1998 Stu Grossman + + * c-lang.c (emit_char c_printchar c_printstr), c-lang.h (c_printstr) + ch-lang.c (chill_printstr chill_printchar) c-valprint.c (c_val_print) + ch-valprint.c (chill_val_print) expprint.c (print_subexp) f-lang.c + (f_printstr f_printchar emit_char) f-valprint.c (f_val_print) + jv-lang.c (java_printchar java_emit_char) jv-valprint.c + (java_value_print java_val_print) language.c (unk_lang_printchar + unk_lang_printstr unk_lang_emit_char) language.h (struct + language_defn LA_PRINT_STRING LA_EMIT_CHAR) m2-lang.c (m2_printstr + m2_printchar emit_char) printcmd.c (print_formatted) scm-lang.c + (scm_printstr) valprint.c (val_print_string) value.h + (val_print_string): Add emit_char routines to language_desc struct + to allow finer control over language specific character output issues. + Add character width arg to printstr routines to allow handling of + wchar_t/Unicode strings. Fix c_printstr to handle wide characters. + Supply width argument to LA_PRINT_STRING and val_print_string. + + * jv-lang.c (java_object_type dynamics_objfile java_link_class_type + get_dynamics_objfile get_java_object_type) jv-lang.h + (get_java_object_type): Make lots of things static. + + * expprint.c (dump_prefix_expression dump_subexp): Move opcode name + printing to common routine (op_name). + * (dump_subexp): Add support for OP_SCOPE. + +Fri Oct 2 16:25:54 1998 Stan Shebs + + * configure.host (i[3456]86-*-windows): Remove, no longer used. + * mswin: Remove directory, no longer used. + +Fri Oct 2 18:52:20 1998 Fernando Nasser + + * sol-thread.c: Fixed prototypes and calls to supply_fpregset and + fill_fpregset + +1998-10-02 Keith Seitz + + * remote.c (remote_interrupt): Rewrite to use remote_stop. + (remote_interrupt_twice): Remove. remote_stop now handles it. + (remote_stop): New function which handles interrupting the + remote target so that CLUI and GUI use the same core functions + to achieve the same goal. + (remote_wait): Change to handle remote_stop properly. + [interrupted_already]: New static global to help remote_stop. + [remote_ops, extended_remote_ops]: Add remote_stop for to_stop member. + + * target.c: Rename static function "ignore" to "target_ignore" and + export it so that gdb can determin if some target vector member is + actually not defined. Replace all occurances of ignore. + + * target.h: Export target_ignore. + +Fri Oct 2 03:51:48 1998 Peter Schauer + + * target.c (target_xfer_memory): Handle requests with zero + transfer length right away. + + * values.c (unpack_double): Set up code, length and signedness of + type _after_ checking for typedef. + +Thu Oct 1 15:39:27 EDT 1998 Frank Ch. Eigler + + * breakpoint.c (bpstat_stop_status): Do not consider an + untripped watchpoint as a "hit". + +Thu Oct 1 20:52:39 1998 Andrew Cagney + + * exec.c (exec_file_command), convex-tdep.c (exec_file_command), + arm-xdep.c (exec_file_command), remote-rdp.c + (remote_rdp_create_inferior), remote-os9k.c + (rombug_create_inferior), remote-mm.c (mm_create_inferior), + remote-eb.c (eb_create_inferior), remote-es.c + (es1800_create_inferior), remote-rdi.c (arm_rdi_create_inferior), + remote-sim.c (gdbsim_create_inferior), remote-utils.c + (gr_create_inferior), remote-st.c (st2000_create_inferior), + remote-nindy.c (nindy_create_inferior), remote-hms.c + (hms_create_inferior), remote-e7000.c (e7000_create_inferior), + remote-array.c (array_create_inferior), remote-adapt.c + (adapt_create_inferior): Replace "exec" with "executable" in + messages. + +1998-09-25 Keith Seitz + + * rdi-share/unixcomm.c: If using cygwin32, also use the SERPORT and + PARPORT defines for win32. + (Unix_MatchValidSerialDevice): For cygwin32, valid serial port names + start with "com", not "/dev/tty". + (Unix_OpenSerial): Do not use O_NONBLOCK on cygwin32. + + * rdi-share/devsw.c (DevSW_Close): Free the device's state + (SwitcherState) so that the device may be reopened. + + * remote-rdi.c (mywritec): Send all output through gdb's *_unfiltered + functions, ignoring non-ASCII chars, so that non-tty UI's can snarf + the output from fputs_hook. + (mywrite): Ditto. + (arm_rdi_open): Set inferior_pid. + (arm_rdi_detach): Pop the target off the target stack so that + users can attach and detach multiple times. + (arm_rdi_close): Close the opened device and reset inferior_pid, too. + +1998-09-24 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in: Change --enable-warnings to --enable-build-warnings. + * configure: Updated. + +1998-09-24 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in (WARN_CFLAGS): Add -Wmissing-prototypes. + * configure: Regenerated. + +1998-09-24 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in: Add --enable-warnings. + Adjust whitespace of other --with and --enable options so that + configure --help lines up correctly. + * aclocal.m4: Ditto. + * Makefile.in (WARN_CFLAGS): Add. Set by configure. + * configure: Regenerated. + +Thu Sep 24 15:44:34 1998 Stan Shebs + + * remote-rdi.c: Fix formatting, remove some commented-out code. + (init_rdi_ops): Omit needless initializations. + +Wed Sep 23 18:21:03 1998 Andrew Cagney + + * remote.c (remote_address_masked): New function - mask address + according to REMOTE_ADDRESS_SIZE. + (remote_address_size): New global. + (hexnumstr): New function - convert arbitrary unsigned to hex. + (remote_write_bytes, remote_read_bytes): Use hexnumstr to + construct packet address. Mask address when necessary. + (_initialize_remote): Add "set remoteaddresssize" command, set + REMOTE_ADDRESS_SIZE variable. + + * NEWS: Update. + +Wed Sep 23 18:08:52 1998 Andrew Cagney + + * remote.c (_initialize_remote, packet_command, print_packet): + Pretty print code. + +Wed Sep 23 12:32:54 1998 + + * remote.c (packet_command): Test REMOTE_DESC to determine if + remote connection is open. + +Tue Sep 22 22:27:24 1998 Mark Alexander + + Patch from Dawn Perchik : + * rs6000-tdep.c (pop_frame): Handle generic dummy frames. + (push_arguments): Likewise. + (frame_saved_pc): Likewise. + (rs6000_frame_chain): Likewise. + (ppc_push_return_address): New function. + (get_saved_register): New function. + * config/powerpc/tm-ppc-eabi.h: Add generic dummy frame macros. + +Mon Sep 21 19:29:32 1998 Stu Grossman + + * defs.h utils.c (fputc_filtered): New function. Does the obvious... + * jv-lang.c (java_printchar): Fix output of chars > 0xff. Fold + java_emit_char into java_printchar. + * language.h (PRINT_LITERAL_FORM): Reformat for readability. + +Mon Sep 21 14:38:03 1998 Catherine Moore + + * config/arm/tm-arm.h (*_BREAKPOINT): Define both little endian + and big endian breakpoint patterns. + + * arm-tdep.c (arm_break_point_from_pc): Insert either big endian + or little endian breakpoints depending upon target byte order. + +Fri Sep 18 07:53:08 1998 Peter Schauer + + * sol-thread.c (sol_thread_notice_signals): Use PIDGET when + passing pid down to procfs_notice_signals. + +Wed Sep 16 14:57:14 1998 Stu Grossman + + * stabsread.c (resolve_symbol_reference): Return 1 on success, 0 on + failure. + * (define_symbol): Check return value from resolve_symbol_reference, + and drop symbol if it fails. + +Tue Sep 15 15:24:16 1998 Stu Grossman + + * stabsread.c: Make all complaints static. + * Fix formatting of live range splitting code. + * (resolve_symbol_reference define_symbol resolve_live_range): Change + errors to complaints so that bad live range symbols won't abort the + entire symbol table. Handle errors by aborting just the current + symbol. + * (ref_init): Goes away. Folded into ref_add(). + * (REF_MAP_SIZE): Put parens around parameter so that args like + `1 + 2' get handled correctly (yes, this was a real bug). + * (ref_add): Remove check for allocation failures. Not necessary + when using xrealloc(). Fix pointer arithmetic problem when clearing + memory. This and the previous patch prevent random SEGV's when there + are lots of live range symbols. + +Tue Sep 15 14:02:01 1998 Nick Clifton + + * remote-rdi.c: Prevent multiple attempts to close the remote + connection. + +Tue Sep 15 10:24:17 1998 Andrew Cagney + + * printcmd.c (examine_i_type): New static - type for instructions. + (do_examine): For "i" format, specify examine_i_type. + (do_examine): Call value_at_lazy instead of value_at so that + examine data is only fetched if it is used. + (x_command): If examine data was not fetched, set convenience + variable "__" to void. + (_initialize_printcmd): Initialize examine_i_type. + +Sun Sep 13 01:34:59 1998 Michael Snyder + + * blockframe.c (find_pc_sect_partial_function): use bfd section + of msymbol for end of section comparison. + +Fri Sep 11 14:02:49 1998 Michael Snyder + + * tracepoint.c: clean up several unused variables and such. + +Fri Sep 11 12:38:34 EDT 1998 Zdenek Radouch (radouch@cygnus.com) + + * arm-tdep.c (arm_push_arguments): fixed frame construction + +Thu Sep 10 20:51:23 1998 Michael Snyder + + * mn10300-tdep.c (mn10300_analyze_prologue): guard against NULL. + +Wed Sep 9 19:37:36 1998 Stan Shebs + + * dbxread.c (IGNORE_SYMBOL): Remove definition, is never used. + * os9kread.c: Remove comment mentioning IGNORE_SYMBOL. + +Wed Sep 9 11:39:05 1998 Ron Unrau + + * blockframe.c(find_pc_sect_partial_function): look for min syms in + the same section when trying to guess the end of a function. + * symfile.c(list_overlays_command): use print_address_numeric + * remote-sim.c: export simulator_command + +1998-09-08 Jason Molenda (jsm@bugshack.cygnus.com) + + * breakpoint.c (bpstat_stop_status): Declare a bp match if the + current fp matches the bp->fp OR if the current fp is less than + the bp->fp if we're looking at a bp_step_resume breakpoint. + +Tue Sep 8 19:42:58 1998 Stan Shebs + + * symtab.h (struct symtab): Remove EXTRA_SYMTAB_INFO hook, + not currently used. + * symfile.c (allocate_symtab): Deprecate use of + INIT_EXTRA_SYMTAB_INFO here. + +Fri Sep 4 15:33:25 1998 Stan Shebs + + * README: Update remote debugging and testsuite info. + +Thu Sep 3 13:50:20 1998 Mark Alexander + + * config/mn10300/tm-mn10300.h (FP_REGNUM): Redefine to be a + pseudo-register, not the same as a3. + (D2_REGNUM, D3_REGNUM, A2_REGNUM, A3_REGNUM): Define. + * mn10300-tdep.c (fix_frame_pointer): New function. + (set_movm_offsets): Use register number macros instead of + hard-coded constants. + (mn10300_analyze_prologue): Fix to handle redefinition of FP_REGNUM. + (mn10300_frame_chain): Fix to handle redefinition of FP_REGNUM; + use register number macros instead of hard-coded constants; + add missing parameter to call of mn10300_analyze_prologue. + (mn10300_frame_saved_pc): Use register number macros instead of + hard-coded constants. + +Tue Sep 1 12:04:57 EDT 1998 Zdenek Radouch (radouch@cygnus.com) + + Changes to support/fix ARM/ELF port. Use MAKE_MSYMBOL_SPECIAL for + both ELF and COFF; + * elfread.c (elf_symtab_read): use ELF specific macro + * coffread.c (coff_symtab_read): use COFF_MAKE_MSYMBOL_SPECIAL() + * arm-tdep.c: separate COFF and ELF thumb processing + disable --mapcs-float processing + * dwarf2read.c: Disabled building of minimal symbols + * config/arm/tm-arm.h: new macros for distinguishing arm/thumb + * config/mips/tm-mips.h: use ELF specific macro + +Mon Aug 31 15:42:10 1998 Tom Tromey + + * top.c (context_hook): Define. + +Tue Aug 25 13:21:58 1998 Michael Snyder + + * ax-gdb.c (gen_var_ref): Allow for typedef types. + (gen_cast, gen_bitfield_ref, gen_expr, gen_deref): ditto. + +Mon Aug 24 18:29:03 1998 Michael Snyder + + * tracepoint.c (collect_symbol): Handle register doubles that + are stored in two registers. + +Mon Aug 24 14:39:08 1998 Mark Alexander + + * sh-stub.c (undoSStep): Improve comment. + * sparc-tdep.c (sparc_extract_struct_value_address): Simplify to use + same method on both 32-bit and 64-bit machines. + * sparcl-tdep.c (sparclite_check_watch_resources): Simulator doesn't + support hardware breakpoints. + * config/sparc/tm-sparc.h (CALL_DUMMY): Improve comments. + +1998-08-20 Jason Molenda (jsm@bugshack.cygnus.com) + + * rdi-share/Makefile.am (INCLUDES): Fix typeo. + * rdi-share/Makefile.in: Regenerated. + +1998-08-19 Jason Molenda (jsm@bugshack.cygnus.com) + + * rdi-share/Makefile.am: Use just `INCLUDES' not `libname_INCLUDES'. + * rdi-share/Makefile.in: Regenerated. + +1998-08-19 Keith Seitz + + * v850ice.c (v850ice_stop): New function to stop the ICE. + (v850ice_load) Pass filename to ICE DLL. + (ice_stepi, ice_nexti, ice_cont): Do not directly call the gdb + commands -- let the GUI do it so that it can retain control + of the display. + +Wed Aug 19 15:53:52 1998 Anthony Green + + * i386v4-nat.c: Include sys/reg.h if present. + +Wed Aug 19 03:07:53 1998 Richard Henderson + + * config/alpha/alpha-linux (XDEPFILES): Build ser-tcp. + +1998-08-18 Fernando Nasser + + * symtab.c (decode_line_1): For minimal symbol, SKIP_PROLOG to + make sure we stop after the frame pointer is locaded and backtrace + prints an accurate stack. Complements changes made on Mon Jul 27 + 10:45:56 1998 + (decode_line_2): Replaced the whitespace after ">" in a prompt + which has been taken away by changes made on Sun Jul 19 02:11:45 + 1998 + +1998-08-18 Keith Seitz + + * stack.c: Define new hook, selected_frame_level_changed_hook, which + will be called whenever the selected stack level changes. + (select_frame): Call the selected_frame_level_changed_hook. + +Tue Aug 18 18:03:42 1998 Stan Shebs + + * remote-rdi.c (arm_rdi_open): Pass serial device name to + Adp_OpenDevice, and include it in error reports. + +1998-08-18 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in: Add more header files to AC_CHECK_HEADERS. + * configure: Regenerated. + + * command.c: Include wait.h or sys/wait.h if present. + * inftarg.c: Ditto. + * core-aout.c: Include ptrace.h or sys/ptrace.h if present, based + on autoconf test. + * infptrace.c: Ditto. + + * expprint.c: Include ctype.h for isprint prototype. + * i386aix-nat.c: Include sys/reg.h if autoconf says it is present. + * i386v-nat.c: Include ptrace.h, sys/ptrace.h, and sys/reg.h if + present, based on autoconf test. + + * utils.c: Include curses.h and term.h if present. + (puts_debug): Change 'carriage_return' local variable to return_p + to avoid name clash. + + * config/m68k/nm-apollo68b.h: Don't define PTRACE_IN_WRONG_PLACE, + determine it with autoconf. + * config/i386/nm-linux.h: Don't define NO_SYS_REG_H, determine it + with autoconf. + * config/i386/nm-i386sco.h: Don't define NO_PTRACE_H, determine it + with autoconf. + * config/i386/nm-i386v.h: Ditto. + * config/i386/nm-symmetry.h: Ditto. + * config/m88k/xm-cxux.h: Ditto. + * config/m88k/xm-dgux.h: Ditto. + + * config/m68k/delta68.mh (NAT_FILE): nm-delta68.h no longer necessary. + * config/m68k/nm-delta68.h: Removed. + +Fri Aug 14 11:14:03 1998 Jeffrey A Law (law@cygnus.com) + + * mn10300-tdep.c (set_movm_offsets): Change second argument to + be the actual args to movm itself. All callers changed. Only set + fi->fsr.regs[x] if reg X is saved by the movm instruction. + +Fri Aug 14 04:18:23 1998 Peter Schauer + + * sol-thread.c (lwp_to_thread): Fix error message for failing + td_ta_map_lwp2thr call. + (ps_lgetLDT): Mask off upper bits in GS register when comparing + with selector. + +Wed Aug 12 16:30:01 1998 Frank Ch. Eigler + + * remote-sim.c (simulator_command): Reset register cache after + simulator command. + +Wed Aug 12 09:00:26 1998 Stu Grossman + + * expprint.c (dump_prefix/postfix_expression): Don't try to print + type expressions. + +Tue Aug 11 11:33:25 1998 Stu Grossman + + * c-typeprint.c (c_print_type): Don't crash if varstring is null. + * expprint.c expression.h (dump_expression): Rename to + dump_prefix_expression. + * Print out the expression in normal form. Call print_longest + instead of trying to do it ourselves. + * (dump_postfix_expression): New function, prints out the expression + with indentation and better formatting and interpretation. + * parse.c (parse_exp_1): Put calls to dump expressions under ifdef + MAINTENANCE_CMDS and expressiondebug variable. + +Thu Aug 6 13:20:02 1998 Ron Unrau + + * infrun.c (wait_for_inferior): use stop_func_name instead of + stop_func_start to decide that no debug info exists. + +Thu Jul 30 13:53:50 1998 Mark Alexander + + * mips-tdep.c (mask_address_p): New variable. + (mips_addr_bits_remove): Test mask_address_p to decide whether + to mask off the upper 32 bits of addresses. + (_initialize_mips_tdep): Add command to set mask_address_p. + (mips_call_dummy_address): New function. + * config/mips/tm-mips.h (CALL_DUMMY_ADDRESS): Redefine to + call mips_call_dummy_address. + +1998-07-29 Fernando Nasser + + * symfile.c (add_symbol_file_command): Test for the from_tty + parameter and avoid query when not interactive. + +Mon Jul 27 16:11:42 1998 Michael Snyder + + * tracepoint.c (remote_set_transparent_ranges): new function. + Send the start and end addresses of all loadable read-only + sections down to the trace target, so that it can treat them + as "transparent" (ie. don't care if they were collected or not). + +Mon Jul 27 15:38:07 1998 Mark Alexander + + * mn10300-tdep.c (mn10300_analyze_prologue): Undo previous fix + for setting frame address in optimized code; made unnecessary + by compiler fixes. + +Mon Jul 27 10:45:56 1998 Martin M. Hunt + + * symtab.c (decode_line_1): For minimal symbol, call + find_pc_sect_line() to make sure the line number gets set + properly. + (print_symbol_info): Redeclare function void. + +1998-07-27 Jason Molenda (jsm@bugshack.cygnus.com) + + * config/d10v/tm-d10v.h (REGISTER_NAMES): sp -> r15. The + stack pointer et al are synthesized from the SP_REGNUM (etc) + defines and should not be mentioned in REGISTER_NAMES. + +Fri Jul 24 14:41:19 1998 Michael Snyder + + * tracepoint.c (encode_actions): Treat register names and simple + variable names as special cases and don't convert them to byte- + codes: these things can be collected far more efficiently + without invoking the bytecode interpreter. + +Fri Jul 24 13:32:46 1998 Mark Alexander + + * config/i386/tm-i386.h (STORE_STRUCT_RETURN): Make it + work on hosts of any endianness. + * config/i386/tm-i386v.h: Ditto. + +Fri Jul 24 07:41:12 1998 Mark Alexander + + * mn10300-tdep.c (set_movm_offsets): New helper function + for mn10300_analyze_prologue. + (mn10300_analyze_prologue): Simplify by factoring out common code. + Fix bugs in setting frame address for optimized code. + Use read_memory_nobpt instead of target_read_memory. + +Thu Jul 23 17:01:17 1998 Michael Snyder + + * tracepoint.c (collect_symbol): handle LOC_ARG case. + +Thu Jul 23 15:07:40 1998 Dawn Perchik + + * sparc-tdep.c (sparc_init_extra_frame_info): Recognize when we're + in a function prologue before the SAVE instruction. + (sparc_frame_saved_pc): Ditto. + * config/sparc/tm-sparc.h (EXTRA_FRAME_INFO): Add in_prologue flag. + +Thu Jul 23 14:58:09 1998 Dawn Perchik + + * i386-tdep.c (i386_get_frame_setup): Recognize function + prologues in code compiled with -fcheck-stack. + +Thu Jul 23 14:49:27 1998 Dawn Perchik + + * remote-mips.c (remote_mips_insert_hw_breakpoint, + remote_mips_remove_hw_breakpoint): New functions for hardware + breakpoints on LSI targets. + * config/mips/tm-embed.h (target_remove_hw_breakpoint, + target_insert_hw_breakpoint): Define to call + remote_mips_insert_hw_breakpoint and remote_mips_remove_hw_breakpoint, + respectively. + +1998-07-21 Fernando Nasser + + * source.c (print_source_lines): Print "No such file or directory" + just once. + (directory_command): same as above; resets if user issues dir. + +Sun Jul 19 02:11:45 1998 Martin M. Hunt + + * symtab.c (decode_line_2): Instead of printing a prompt + and calling command_line_input() without a prompt, just + call it with the proper args. This makes the GUI work too. + +Fri Jul 17 9:26:50 1998 Ron Unrau + + * blockframe.c (find_pc_sect_partial_function): allow for the possi- + bility of multiple symbols at the same address when finding high. + * breakpoint.c (resolve_sal_pc): if the function based section lookup + fails, try getting the section from the minimal symbol table. + * parse.c (write_exp_msymbol): use symbol_overlayed_address to get + the LMA of a minimal symbol if unmapped. + * symtab.c (find_line_symtab): change interface to return symtab + containing the best linetable found. + (decode_line_1): use find_line_symtab to set val.symtab. This should + improve support for source files with multiple symtabs. + +Wed Jul 15 11:51:33 1998 Keith Seitz + + * main.c (main): Fix violations of GNU coding standard. + + * breakpoint.c: Export delete_command. + + * infcmd.c: Export continue_command, stepi_command, and nexti_command. + + * Makefile.in: Add target for v850ice.o. + + * configure.tgt: Add cygwin32 dependencies for v850 ice. + +Wed Jul 15 10:58:29 1998 Nick Clifton + + * tracepoint.c (set_raw_tracepoint): Cope with symbols that do not + have an associated directory. + +Mon Jul 13 15:21:04 1998 Mark Alexander + + * utils.c (puts_debug): Display non-printable characters in hex + instead of octal. + +Thu Jul 9 16:16:47 1998 Jeffrey A Law (law@cygnus.com) + + * mn10300-tdep.c (mn10300_generic_register_names): New variable. + (set_machine_hook): New function. Copy the appropriate register + names into reg_names. + (_initialize_mn10300_tdep): Set up to call set_machine_hook. + * tm-mn10300 (NUM_REGS): Bump to 32. + (REGISTER_NAMES): Updated accordingly. + + +Tue Jul 7 7:40:13 1998 Ron Unrau + + * symtab.c (find_pc_sect_psymbol): allow case where textlow is 0 + +Thu Jul 2 15:57:58 1998 Frank Ch. Eigler + + * breakpoint.c (resolve_sal_pc): Accept absence of innermost + Lexical block for breakpoint resolution. + +Thu Jul 2 10:22:00 1998 Dawn Perchik + + * mdebugread.c (parse_partial_symbols): Go ahead and read the .mdebug + section, but just don't add a 2nd minimal symbol if this is an .mdebug + section in an ELF file. + +1998-07-01 Jim Blandy + + * Makefile.in (ax-general.o): Depend on $(defs_h) too. + (ax_h): Bother to define this. + +Mon Jun 29 19:01:18 1998 Jim Wilson + + * gnu-regex.c (re_comp): Add cast to char * before gettext calls. + +Sun Jun 28 11:35:48 1998 Peter Schauer + + Improve support for SunPro F77. + * dbxread.c (end_psymtab, process_one_symbol): Handle minimal + symbols with trailing underscore names. + * minsyms.c (find_stab_function_addr): Ditto. + * dbxread.c (process_one_symbol): Ignore N_ALIAS for now. + * partial-stab.h (case N_ALIAS): Ditto. + * stabsread.c (read_sun_builtin_type): Handle boolean types. + +Fri Jun 26 14:03:01 1998 Keith Seitz + + * symtab.h (enum namespace): Add new namespaces FUNCTIONS_NAMESPACE, + TYPES_NAMESPACE, METHODS_NAMESPACE, and VARIABLES_NAMESPACE used by + new search_symbols. + Add prototype for search_symbols and free_search_symbols. + + * symtab.c (list_symbols): Rewrite to use new search_symbols. + (file_matches): New helper function for search_symbols. + (free_search_symbols): New function which frees data returned from + search_symbols. + (print_symbol_info): New helper function which prints info about a + matched symbol to stdout. Extracted from old list_symbols. + (print_msymbol_info): New helper function which prints info about + a matched msymbol to stdout. Extracted from old list_symbols. + (symtab_symbol_info): Extracted from old list_symbols. + (variables_info): Use symtab_symbol_info. + (functions_info): Use symtab_symbol_info. + (types_info): Use symtab_symbol_info. + (rbreak_command): Rewrite to use new search_symbols. + +Thu Jun 25 22:38:32 1998 Frank Ch. Eigler + + * mips-tdep.c (mips_push_arguments): Use 128-bit stack frame + alignment for inferior calls. + +Wed Jun 24 23:17:12 1998 Mark Alexander + + * mn10200-tdep.c (mn10200_analyze_prologue): Fix calculation + of jsr target address. + +Tue Jun 23 19:37:46 1998 Mark Alexander + + * config/mn10200/tm-mn10200.h (SAVED_PC_AFTER_CALL): Don't + zero upper byte of address. + +Tue Jun 23 17:32:26 1998 Michael Snyder + + * rs6000-tdep.c (pop_dummy_frame): use memcpy. + (push_arguments): use memset. + (various other places): fix up indentation and long lines. + +Tue Jun 23 11:58:35 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * configure.in: s/lXext/-lXext/ for Jillian's change. + +Tue Jun 23 11:14:04 1998 Michael Snyder + + * source.c (find_source_lines): fix indentation. + + * config/mips/tm-irix5.h: Modify to work better on irix 6, by + making FP registers 8 bytes instead of 4. + REGISTER_BYTES: redefine. REGISTER_BYTE(): redefine. + REGISTER_VIRTUAL_TYPE: redefine. MIPS_LAST_ARG_REGNUM: redefine. + * irix5-nat.c (fetch_core_registers): read 8 bytes per FP register. + * mips-tdep.c (FP_REGISTER_DOUBLE): new macro to distinguish + targets with 8-byte FP registers (don't use TARGET_MIPS64). + (STACK_ARGSIZE): new macro, how much space is taken up on the + stack for each function argument (don't use TARGET_MIPS64). + (mips_push_arguments): modify logic to work better on Irix 6 + (n32 ABI). + +Tue Jun 23 12:29:53 1998 Jillian Ye + + * configure.in: Add -lXext to mips_extra_libs + * configure: Regenerated. + +Sun Jun 21 09:31:12 1998 Ron Unrau (runrau@cygnus.com) + + * symtab.c (find_line_pc): assumed that a PC of 0 is illegal. + Changed to pass PC as arg and return 1 if valid (0 otherwise). + * symtab.h: Change prototype to match. + * symtab.c (find_line_pc_range): Use new interface. + * breakpoint.c (resolve_sal_pc): Ditto. + +Wed Jun 17 15:50:00 1998 Ron Unrau (runrau@cygnus.com) + + * parse.c (target_map_name_to_register): Check target specific + aliases *first* so that it can over-ride architectural names + +Wed Jun 17 17:13:38 1998 Said Ziouani (saidz@park-street.cygnus.com) + + * remote-sds.c (sds_start_remote): Fix printf call. + +Tue Jun 16 16:32:08 1998 Mark Alexander + + * mn10200-tdep.c (mn10200_analyze_prologue): Fix null pointer + crash when in "start". + +Tue Jun 16 14:38:40 1998 Ron Unrau (runrau@cygnus.com) + + * dbxread.c: reset function_start_offset after a finishing N_FUN + is seen. + * remote-sim.c: allow TARGET_REDEFINE_DEFAULT_OPS to override + target vectors as needed. + +Sun Jun 14 08:46:25 1998 Ron Unrau (runrau@cygnus.com) + + * partial-stab.h: 'F' and 'f' type N_FUN psymbols should pass + CUR_SYMBOL_VALUE as CORE_ADDR instead of long + * buildsym.[ch]: export pending_blocks list + +Sat Jun 13 13:02:32 1998 Dawn Perchik (dawn@cygnus.com) + + * remote.c: Fix remote help string to match that of help.exp. + +Fri Jun 12 14:22:55 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * configure.in (LIBS): Add -lw to the list of libraries if needed. + +Thu Jun 11 15:05:10 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * btowc.c: Removed. + * configure.in: Don't see if we need to replace btowc(). + * Makefile.in: Don't include LIBOBJS. + * configure: Regenerated. + * gnu-regex.c (regex_compile): Only support i18n [:foo:] if + we have btowc(). + +Wed Jun 10 15:39:14 1998 Stu Grossman + + * c-exp.y: Fix problems with parsing "'foo.bar'::func". + Some languages allow symbols with dots. + + * gdbtypes.c (check_stub_method): Cosmetic. Use more descriptive + names for parameters. + + * jv-exp.y: Parser now accepts primitive types. + * (parse_number): Use correct ifdef for scanf long double support. + * jv-lang.c (java_array_type): Initial cut at array support. + + * language.c language.h (set_language): Now returns previous language. + + * symtab.c (find_methods): Make static. Cosmetic changes, including + indentation, and adding descriptive comments. Move local variable + defs into the block they are used in. + * Don't call check_stub_method any more. Use gdb_mangle_name to + generate the full method name. find_method doesn't need all the other + goobldegook that check_stub_method does. + * (gdb_mangle_name): Use more descriptive names for parameters. Fix + comment. + * (lookup_partial_symbol lookup_block_symbol): Check for java to + ensure we can find mangled names. + * (decode_line_1): Move local variable defs into the block they are + used in. (Improves code readability.) + +Wed Jun 10 18:04:35 1998 Frank Ch. Eigler + + * gdbtypes.c (get_discrete_bounds): Assign unsigned type flag for + all-positive enum. + (create_set_type): Ditto for all-positive set values. + * values.c (unpack_field_as_long): Check for typedef in struct + field unpacking. + +Wed Jun 10 14:06:05 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * configure.in: Add some tests for gnu-regex.c's benefit. + See if btowc() function is provided in C library. + * configure, config.in: Regenerated. + * Makefile.in (CLIBS, CDEPS): Add @LIBOBJS@ to build btowc.c + if necessary. + * btowc.c: New file. + + * gnu-regex.c: Reorder wchar.h and wctype.h includes for Solaris' + benefit. + Drop namespace preserving defines for now. + +Wed Jun 10 11:53:42 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * gnu-regex.c: Include "gnu-regex.h", not "regex.h". + +Wed Jun 10 11:34:07 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * gnu-regex.c, gnu-regex.h: Change LGPL license to GPL license + to stay consistent with the rest of GDB. + +Wed Jun 10 11:27:39 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * gnu-regex.c, gnu-regex.h: Update to current FSF (glibc) versions. + +Wed Jun 10 10:58:18 1998 Michael Snyder + + * printcmd.c (disassemble_command): move overlay mapping code + "up" into find_pc_partial_function. + * blockframe.c (find_pc_partial_function): adjust start address + and end address for overlays (mapped vs. unmapped addresses), + so that all callers of this function may benefit. + * m32r-tdep.c (m32r_skip_prologue): adjust indentation. + +Mon Jun 8 16:08:10 1998 Ron Unrau + + * objfiles.c (add_to_objfile_sections): All targets to define + TARGET_KEEP_SECTION to permit them to retain bfd sections that + GDB would otherwise have discarded. + +Fri Jun 5 13:56:19 1998 Doug Evans + + * dbxread.c (read_dbx_symtab): Don't lower texthigh for last psymtab. + +Thu Jun 4 18:35:04 1998 Stan Shebs + + * remote.c (init_extended_remote_ops): Make extended_remote_ops + by copying from remote_ops, move it and init_remote_ops to + usual place at end of file, remove "void" from arg lists. + +Thu Jun 4 17:51:06 1998 Mark Alexander + + * sparc-tdep.c (sparc_fix_call_dummy): Byte-swap the call dummy + on bi-endian machines. + (sparc_extract_return_value): Handle values smaller than int on + machines with little-endian data. + (sparc_target_architecture_hook): Set bi_endian flag. + +Thu Jun 4 12:14:48 1998 Michael Snyder + + * printcmd.c (disassemble_command): Fix off-by-one error for + disassembling functions in unmapped overlay sections. + +Thu Jun 4 10:15:03 1998 Elena Zannoni + + * remote.c: merged. + + - Jim Blandy + (print_packet, remote_packet_command): New functions. + (_initialize_remote): Register the remote-packet command. + - David Taylor + (_initialize_remote): remote-compare is now + compare-sections. + - Elena Zannoni + (remote_compare_command): added warning, issued in case + of mismatch only. + +Thu Jun 4 08:25:38 1998 Michael Snyder + + * remote.c (remote_compare_command): New function, new command. + Compare object file binary image with corresponding memory on + remote target. Report differences. + +Tue Jun 2 19:05:04 1998 Mark Alexander + + * sparc-tdep.c (sparc_target_architecture_hook): Set target + byte order only when it's selectable. + +Tue Jun 2 02:01:56 1998 Mark Alexander + + * sparc-tdep.c (sparc_target_architecture_hook): New function to + set endianness based on machine type. + (_initialize_sparc_tdep): Initialize target_architecture_hook. + (sparc_print_register_hook): Print PSR and FPSR in fancy format + on 32-bit machines. + * config/sparc/tm-sparc.h (PRINT_REGISTER_HOOK): Redefine to + call sparc_print_register_hook instead of using inline code. + * config/sparc/tm-sp64.h (PRINT_REGISTER_HOOK): Remove. + +Thu May 28 17:19:14 1998 Keith Seitz + + * main.c (main): Check for NULL from getenv on CYGWIN32. + +Thu May 28 09:41:44 1998 Nick Clifton + + * monitor.c (monitor_vsprintf): Handle %%. Patch courtesy of + Felix Lee (flee@cygnus.com) + +Thu May 28 00:27:35 1998 Peter Schauer + + * mips-tdep.c (mips_push_dummy_frame): Fix calculation of + PROC_REG_OFFSET and PROC_FREG_OFFSET. + +Mon Apr 27 14:37:49 1998 Andrew Cagney + + * config/v850/tm-v850.h (REGISTER_BYTE): FP_REGNUM and + FP_RAW_REGNUM use the same register location. + + * v850-tdep.c (v850_scan_prologue): Use FP_RAW_REGNUM instead of + FP_REGNUM. + (v850_frame_chain): Ditto. + + * config/v850/tm-v850.h (REGISTER_NAMES): Add "fp". + (NUM_REGS): Update. + (FP_REGNUM): Update. + (FP_RAW_REGNUM): Define. + +Wed May 27 14:22:31 1998 Keith Seitz + + * main.c (main): Convert the path returned from getenv to a posix + path on cygwin32 hosts. + +Mon May 25 13:31:27 1998 Keith Seitz + + * remote.c (remote_open_1): If an error occurs starting the remote, + pop the target AND return. + +Sat May 23 02:23:09 1998 Peter Schauer + + * dwarf2read.c (read_subroutine_type): Set TYPE_FLAG_PROTOTYPED + on C++ functions. + * valops.c (value_arg_coerce): Add new argument to indicate whether + the function has a prototype, handle integer and float promotions + accordingly. + (call_function_by_hand): Always call value_arg_coerce, pass down + prototype information. + +Fri May 22 10:56:36 1998 John Metzler + + * remote.c (_initialize_remote): Typo extended__remote + +Thu May 21 13:14:25 1998 John Metzler + + * gnu-nat.c (init_gnu_ops): Initialization of target ops by assignment. + (_initialize_gnu_nat): Call new init + * mac-nat.c (init_child_ops): Ditto. + (_initialize_mac_nat): Ditto. + * monitor.c (init_base_monitor_ops): Ditto. + (_initialize_remote_monitors): Ditto. + * ppc-bdm.c (init_bdm_ppc_ops): Ditto. + (_initialize_bdm_ppc): Ditto. + * remote-adapt.c (init_adapt_ops): Ditto. + (_initialize_remote_adapt): Ditto. + * remote-array.c (init_array_ops): Ditto. + (_initialize_array): Ditto. + * remote-bug (init_bug_ops): Ditto. + (_initialize_remote_bug): Ditto. + * remote-e7000.c (init_e7000_ops): Ditto. + (_initialize_remote_e7000): Ditto. + * remote-eb.c (init_eb_ops): Ditto. + (_initialize_remote_eb): Ditto. + * remote-es.c (init_es1800_ops): Ditto. + (init_es1800_child_ops): Ditto. + (_initialize_es1800): Ditto. + * remote-hms.c (init_hms_ops): Ditto. + (_initialize_remote_hms): Ditto. + * remote-mm.c (init_mm_ops): Ditto. + (_initialize_remote_mm): Ditto. + * remote-nindy.c (init_nindy_ops): Ditto. + (_initialize_nindy): Ditto. + * remote_nrom.c (init_nrom_ops): Ditto. + (_initialize_remote_nrom): Ditto. + * remote-os9k (init_rombug_ops): Ditto. + (_initialize_remote_os9k): Ditto. + * remote-rdi.c (init_rdi_ops): Ditto. + (_initialize_remote_rdi): Ditto. + * remote-rdp.c (init_remote_rdp_ops): Ditto. + (_initialize_remote_rdp): Ditto. + * remote-sds.c (init_sds_ops): Ditto. + (_initialize_remote_sds): Ditto. + * remote-sim.c (init_gdbsim_ops): Ditto. + (_initialize_remote_sim): Ditto. + * remote-st.c (init_st2000_ops): Ditto. + (_initialize_remote_st2000): Ditto. + * remote-udi.c (init_udi_ops): Ditto. + (_initialize_remote_udi): Ditto. + * remote-vx.c (init_vx_ops): Ditto. + (init_vx_run_ops): Ditto. + (_initialize_vx): Ditto. + * remote.c (init_remote_ops): Ditto. + (init_extended_remote_ops): Ditto. + (_initialize_remote): Ditto. + * sparcl-tdep.c (init_sparclite_ops): Ditto. + (_initialize_sparcl_tdep): Ditto. + * v850ice.c (init_850ice_ops): Ditto. + (_initialize_v850ice): Ditto. + * win32-nat.c (init_child_ops): Ditto. + (_initialize_inftarg): Ditto. + +1998-05-21 Jim Blandy + + * ax-gdb.c (const_var_ref): Don't handle function names. I don't + want to implement all the "usual unary conversion" rules for + constants. + (gen_usual_unary): Turn "function" values into "pointer to + function" values, in accordance with ANSI. + (gen_deref): Don't do the usual unary conversions here. Let the + caller do it. Note that dereferencing a function pointer yields + a function designator, which we call an rvalue, not an lvalue. + (gen_address_of): Handle functions specially. + (gen_struct_ref): Perform the usual unary conversions before + calling gen_deref. + (gen_expr): In case for the prefix '*' operator, call + gen_usual_unary manually. + +Wed May 20 15:29:41 1998 Gavin Koch + + * mips/tm-tx39.h (MIPS_DEFAULT_FPU_TYPE): Defined as MIPS_FPU_NONE. + * mips/tm-tx39l.h: Same. + +Wed May 20 10:12:11 1998 John Metzler + + * m32r-tdep.c (decode_prologue): Handle frames compiled with -Os. + Split out as separate function called by skip prologue and scan + prologue. new formula handles optimization in which the prologue + is interleaved with the body of the function. Also recognizes new + variations of prologue encoding. Use of frame pointer is + essential to debugging, -fno-omit-frame-pointer + (m32r_skip_prologue): Call decode prologue, ignore line info + (m32r_scan_prologue): Call decode prologue, ignore line info. + +Tue May 19 17:23:54 1998 John Metzler + + * w89k-rom.c (_initialize_w89k): Call new init function + (init_w89k_cmds): Convert to dynamic initialization of monitor_ops + data structure for forward compatability with additions to the + data structure. + * dbug-rom.c (_initialize_dbug_rom): ditto + (init_dbug_cmds): ditto + * m32r-rom.c (_initialize_m32r_rom): ditto + (init_m32r_cmds): ditto + +Tue May 19 14:54:11 1998 Michael Snyder + + * tracepoint.c (memrange_cmp): use const void * args to avoid + ANSI compiler warnings. + +1998-05-19 Jim Blandy + + * ax-gdb.c (gen_fetch, gen_var_ref, gen_deref, find_field, + gen_bitfield_ref, gen_expr): Call error, not abort. + * ax-general.c (read_const, generic_ext, ax_trace_quick, + ax_label, ax_const_d, ax_reg, ax_print): Same. + + * tracepoint.c: Remove the $(...) syntax for memranges. + (validate_actionline, encode_actions, trace_dump_command): Remove + clauses for the $(...) syntax. + (parse_and_eval_memrange): Function deleted. + (_initialize_tracepoint): Update function description. + + * ax-gdb.c (_initialize_ax_gdb): Make the "agent" command a + subcommand of "maintenance", as it should have been from the + beginning. #include "gdbcmd.h", to get the declaration for + maintenancelist. + * Makefile.in: Document that dependency. + +Tue May 19 12:00:58 1998 Elena Zannoni + + * tracepoint.c (get_tracepoint_by_number): new function, to access + traceframe_number for use of the GUI. + + * tracepoint.h: added prototype for get_traceframe_number. + +Mon May 18 13:34:27 1998 Keith Seitz + + * dbxread.c (process_one_symbol): If block addresses are relative to + function start addresses, reset function_start_address whenever a new + source file is seen. + +Mon May 18 13:04:27 1998 Michael Snyder + + * tracepoint.c (get_tracepoint_by_number): make sure to advance + arg pointer even if we fail to parse a useful number. Otherwise, + since this function is called in a loop, it may loop forever! + Also change strtol call to allow arbitrary radix. + (map_args_over_tracepoints (and other places)): add QUIT; call + to loop, to allow breakout using control-C. Not all loops were + analyzed to make sure they could terminate cleanly, but even + terminating with a messed-up tracepoint list would be better + than not terminating at all! + (tdump_command): check to see if we're connected to a trace- + capable target (currently only "remote") before doing anything + else. + +Sat May 16 22:21:48 1998 Frank Ch. Eigler + + * config/d30v/tm-d30v.h (INIT_FRAME_PC_FIRST): Fill in PC into + frame struct before extracting saved register offsets. + +Fri May 15 22:47:45 1998 Michael Snyder + + * tracepoint.c (encode_actions): fix typo in printf format string. + +1998-05-15 Jim Blandy + + Implement a few more tracing operators: ^ | & ~ ! + * ax-gdb.c (gen_integral_promotions, gen_logical_not, + gen_complement): New functions. + (gen_binop): New argument MAY_CARRY, indicating whether we need to + correct the upper bits of the value after performing the + operation. Callers changed. + (gen_expr): Handle BINOP_BITWISE_AND, BINOP_BITWISE_IOR, and + BINOP_BITWISE_XOR here as well, by calling gen_binop. Handle + UNOP_LOGICAL_NOT, UNOP_COMPLEMENT. + + * ax-gdb.c (gen_conversion): Reworked to avoid some unnecessary + sign extension. + + * ax-gdb.c (gen_usual_arithmetic): Renamed from gen_usual_binary, + to match the ANSI C standard better. Callers changed. + + * ax-gdb.c (gen_traced_pop): Add prototyped declaration. + +Fri May 15 18:18:38 1998 David Taylor + + * tracepoint.c (stringify_collections_list): return a collection + of strings rather than a single string. + (free_actions_list): new function. + (encode_actions): process collection of strings returned by + stringify_collections_list. + +1998-05-15 Jim Blandy + + * ax-gdb.c (gen_traced_pop): New function. + (gen_expr): Call it for comma operator. + (gen_trace_for_expr): Call it, instead of writing it out. + + Add facilities for sending arbitrary packets to the remote agent. + There are a bunch of improvements to make (make it generic; handle + 'O' replies properly), but I just want to get this onto the branch. + * remote.c (print_packet, remote_packet_command): New functions. + (_initialize_remote): Register the remote-packet command. + +Thu May 14 17:52:31 1998 Elena Zannoni + + * tracepoint.c: move actionline_type definition to tracepoint.h. + (validate_actionline): make non static. + + * tracepoint.h: move actioline_type definition from tracepoint.c. + (validate_actionline) moved prototype from tracepoint.c. + +Thu May 14 11:49:18 1998 David Taylor + + * tracepoint.c (validate_actionline): add additional error + checking, remove some dead code. + (encode_actions): additional cleanups. + (trace_find_command): remove some dead code. + (trace_find_pc_command): ditto. + (trace_find_tracepoint_command): ditto. + (trace_find_line_command): ditto. + (trace_find_range_command): ditto. + (trace_find_outside_command): ditto. + +Thu May 14 5:51:00 1998 Ron Unrau + + * symtab.c (decode_line_1): set section for "break *" + +Wed May 13 20:58:02 1998 Mark Alexander + + * corefile.c (reopen_exec_file): Reopen the exec file if + it has changed. + +Wed May 13 15:22:02 1998 Mark Alexander + + * sparc-tdep.c (fetch_instruction): New function. + (single_step, sparc_init_extra_frame_info, examine_prologue): + Use fetch_instruction instead of read_memory_integer + to ensure that instructions are always read as big-endian. + +Wed May 13 14:42:21 1998 Ian Lance Taylor + + * configure.in: Add AC_FUNC_ALLOCA. + * defs.h: Check HAVE_ALLOCA_H rather than sparc. Add _AIX pragma + alloca. + * configure: Rebuild. + * Makefile.in (jv-lang.o, jv-typeprint.o, jv-valprint.o): New + targets. + +Wed May 13 11:19:08 1998 Michael Snyder + + * tracepoint.c (trace_command): Remove old diagnostic code that was + preventing tracepoints from being defined with a full-path filename. + +Tue May 12 13:17:35 1998 Frank Ch. Eigler + + * stabsread.c (read_one_struct_field): Check for typedef in type + tree before clearing bitfield information. + +1998-05-11 Jim Blandy + + * ax-gdb.c (gen_binop): New function, based on gen_mul, to replace + gen_mul and gen_div, and handle `%' op as well. Correctly tests + type of arguments. + (gen_expr): Factor out common code in binary arithmetic operators. + Add support for `%'. + (gen_mul, gen_div): Removed. + +Thu May 7 14:49:38 1998 Bob Manson + + * config/sparc/tm-sp64.h (CALL_DUMMY): Store and retrieve + %o0-%o5 as 64-bit values; compensate for stack bias. + (USE_STRUCT_CONVENTION): We only pass pointers to structs + if they're larger than 32 bytes. + (REG_STRUCT_HAS_ADDR): Ditto. + + * sparc-tdep.c (sparc_init_extra_frame_info): Use read_sp() + instead of read_register. If the target is a sparc64 and the frame + pointer is odd, compensate for the stack bias. + (get_saved_register): Use read_sp(). + (DUMMY_STACK_REG_BUF_SIZE): Use FP_REGISTER_BYTES. + (sparc_push_dummy_frame): Use read_sp()/write_sp(). On sparc64, + save the PC, NPC, CCR, FSR, FPRS, Y and ASI registers. + (sparc_frame_find_saved_regs): Use read_sp(). Read the PC, NPC, + CCR, FSR, FPRS, Y and ASI registers from the frame, if it's a + dummy frame. + (sparc_pop_frame): Use write_sp(). If the target is a sparc64 and + the FP is odd, compensate for stack bias. + (sparc_store_return_value): Right-justify the return value before + writing it to %o0. + (sparc_fix_call_dummy): Don't NOP out part of the call dummy on + sparc64. + (sparc64_read_sp, sparc64_read_fp, sparc64_write_sp, + sparc64_write_fp, sp64_push_arguments, + sparc64_extract_return_value): New functions to support the + sparc64 ABI. + + * dwarfread.c (handle_producer): Set processing_gcc_compilation to + the right version number. + + * dwarf2read.c (read_file_scope): Assume we're processing + GCC2 output. + +Wed May 6 16:34:03 1998 Jeffrey A Law (law@cygnus.com) + + * somsolib.c: Include gdb_stat.h. + +Mon May 4 18:34:01 1998 David Taylor + + * ax-gdb.c (gen_mul): new function; (gen_div): new function; + (gen_expr): add support for * and / operators, call gen_mul and + gen_div as appropriate. + +Mon May 4 16:24:22 1998 Mark Alexander + + * defs.h (make_run_cleanup): Declare. + * solib.c (find_solib): Pass correct number of arguments to + make_run_cleanup. + +Mon May 4 07:08:25 1998 Michael Snyder + + * tracepoint.c (trace_actions_command): actions command must set + step_count to zero (in case previous actions have set it but the + new set does not). + +Sat May 2 09:35:07 1998 Stu Grossman + + * ocd.h: Add new flags, function codes, and processor types to + support new Wiggler capabilities. + * (ocd_write_bytes_size): New function to allow atomic writes of + memory in sizes larger than a byte. + + * ser-unix.c (baudtab): Add 57600, 115200, 230400, and 460800 baud. + +Fri May 1 19:51:32 1998 Frank Ch. Eigler + + * stabsread.c (read_one_struct_field): Do not override supplied + bitfield size for a range type value. + + * gdbtypes.c (create_range_type): For a range with positive + lower limit, declare range type as unsigned. + +Fri May 1 10:58:34 1998 John Metzler + + * monitor.c: Turn off debug + +Fri May 1 09:29:56 1998 Peter Schauer + + * breakpoint.c (delete_command): Skip internal breakpoints when + all breakpoints are requested. + + * stabsread.c (define_symbol): Record parameter types from Sunpro + function stabs in the TYPE_FIELDS of the function type. + +Thu Apr 30 15:59:54 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * Makefile.in (config-check-targets, config-check-hosts): Removed. + +1998-04-30 Paul Eggert + + * Makefile.in (maintainer-clean): + Don't get ahead of yourself and delete Makefile + before running `make'. + (local-maintainer-clean, do-maintainer-clean): New rules. + +Wed Apr 29 14:02:59 1998 David Taylor + + * ax-gdb.c (gen_add): when adding a pointer and an int, use + the size of the pointer, not the int (typo) to decide how + to extend the result. + +Wed Apr 29 10:20:40 1998 John Metzler + + * monitor.h: Defined additional hooks for dmpregs, configure_hooks + and wait_filter. These additions require that all ROM monitor + interfaces be recoded to initialize monitor ops using assignments + rather than static structure initialization. Added new bits to + flags MO_EXACT_DUMPADDR, MO_HAS_BLOCKWRITES. + + * monitor.c (RDEBUG): Conditional tracing throughout the file. + (fromhex): Now recognized upper cse hex digits + (monitor_printf_noecho): + (monitor_readchar): Tracing interferes with input timing. + (monitor_open): Register different memory write functions with + dcache_init if MO_HAS_BLOCKWRITES. + (flush_monior_dcache): Added as an additional utilty. + (monitor-resume): Call continue hook if one has been supplied. + (monitor_wait_filter): New function Factored out of monitor wait + and used if alternate wait-filter has not been provided. + (monitor_wait): call alternate wait filter if provided. Call + monitor_dump_regs, a new function factored out from inline code. + (monitor_dump_block): A new function used as a utility when + monitors must dump several blocks of registers using different + commands. + (monitor_dump_regs): Call alternate function if provided. Uses new + hook in monitor.h. + (monitor_write_memory): Engage previouly added hook + MO_FILL_USES_ADDR. + (monitor_write_even_block): new function supports writing long + blocks of 4byte words. + (longlongendswap): new internal function + (monitor_write_memory_longlongs): new function writes large blocks + using command to enter a long long. + (monitor_write-memory_block): new Function figures out which block + mod to use. + (monitor_read_memory): Can now handle dump formats in which the bytes + preceeding the requested data is not printed. + +Tue Apr 28 19:41:33 1998 Tom Tromey + + * tracepoint.c (memrange_cmp): Another typo fix; `memrbnge' -> + `memrange'. + + * tracepoint.c (memrange_cmp): Fixed typo in function intro. + +Tue Apr 28 17:41:20 1998 Philippe De Muyter + + * symfile.c (overlay_auto_command): Add forgotten parameter + definitions. + (overlay_manual_command, overlay_off_command): Likewise. + (overlay_load_command): Likewise. + * tracepoint.c (memrange_cmp): Parameters have type void *, not + struct memrange *. + +Tue Apr 28 11:08:25 1998 John Metzler + + * rom68k-rom.c (_initialize_rom68k): Fix unresolved init_rom_68kcmds. + +Mon Apr 27 14:32:21 1998 Mark Alexander + + * config/sparc/tm-sparc.h (CALL_DUMMY): Shorten it drastically, + make it work on the simulator. + (FIX_CALL_DUMMY): Convert to function call instead of inline code. + (sparc_fix_call_dummy): Declare. + * sparc-tdep.c (sparc_fix_call_dummy): New function, taken from + old FIX_CALL_DUMMY macro, with additional fixes for simulator. + (sparc_push_dummy_frame): Set registers differently on simulator + to prevent corrupted register window save areas. + +Mon Apr 27 13:46:40 1998 John Metzler + + * rom68k-rom.c (_initialize_rom68k, init_rom68k_cmds): + Convert all static initializations of monitor ops structures to + executable initializations in order that additions to the data + structure definition can me made without repeating this editing + exercise. + * abug-rom.c (_initialize_abug_rom, init_abug-cmds): Ditto. + * cpu32bug-rom.c (_initialize_cpu32bug_rom, init_cpu32bug_cmds): Ditto. + * mon960-rom.c (initialize_mon960, init_mon960_cmds): Ditto. + * op50-rom.c (initialize_op50n, init_op50n_cmds): Ditto. + * ppcbug-rom.c (_initialize_ppcbug_rom, init_ppc_cmds): Ditto. + * sh3-rom.c (_initialize_sh3_rom, init_sh3_cmds): Ditto. + * sparclet-rom.c (_initialize_sparclet, init_sparclet_cmds): Ditto. + * remote-est.c (_initialize_est, init_est_cmds): Ditto. + * remote-hms.c ( _initialize_remote_hms, init_hms_cmds): Ditto. + +Mon Apr 27 10:43:04 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * gdb_string.h (strdup): Don't specify arguments in prototype. + +Sun Apr 26 07:57:21 1998 Peter Schauer + + * rs6000-nat.c (vmap_ldinfo): Issue warning instead of error if + fstat on ldinfo_fd fails. Use objfile->obfd instead of vp->bfd + to check for reference to the same file. + + * target.c (target_read_string): Handle string transfers at the + end of a memory section gracefully. + +Fri Apr 24 17:18:56 1998 Geoffrey Noer + + * Makefile.in: enable EXEEXT setting + +Fri Apr 24 11:53:49 1998 David Taylor + + * tracepoint.c (add_local_symbols): change type of type from + char to int so that type shows up as 'A' or 'L' not 0. + +Thu Apr 23 16:37:20 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * README: Minor changes for 4.17 release. + +Thu Apr 23 15:44:39 1998 Per Bothner + + * symfile.c (deduce_language_from_filename): .class implies java. + +Thu Apr 23 12:52:21 1998 Philippe De Muyter + + * configure.in (strerror): Check if function must be declared. + * acconfig.h (NEED_DECLARATION_STRERROR): New define slot. + * gdb_string.h (strerror): Function declaration issued if + NEED_DECLARATION_STRERROR. + * configure, config.in: Files regenerated. + +Thu Apr 23 12:27:43 1998 Philippe De Muyter + + * symfile.c (simple_overlay_update_1): Do not prefix array address + by `&'. + * bcache.h (BCACHE_DATA_ALIGNMENT): Ditto. + * tracepoint.c (encode_actions): Ditto. + * language.c, complaints.c, utils.c (varargs.h): Do not include that + file here, it is already included indirectly by defs.h. + * dbxread.c (dbx_symfile_init, process_one_symbol): Cast xmalloc return + value to the appropriate pointer type. + * utils.c (floatformat_from_doublest): Ditto. + * tracepoint.c (read_actions, _initialize_tracepoint): Ditto. + (add_memrange): Likewise with xrealloc return value. + * stabsread.c (ref_add): Ditto. + * coffread.c (coff_symfile_init): Likewise for xmmalloc return value. + * elfread.c (elf_symfile_read): Ditto. + * os9kread.c (os9k_symfile_init): Ditto. + +Thu Apr 23 00:32:08 1998 Tom Tromey + + * config.in: Rebuilt. + * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_STPCPY, HAVE_GETTEXT, + HAVE_LC_MESSAGES): Define. + +Wed Apr 22 15:38:56 1998 Tom Tromey + + * configure: Rebuilt. + * configure.in: Call CY_GNU_GETTEXT. + * Makefile.in (top_builddir): New macro. + (INTL): Define to @INTLLIBS@. + (INTL_DEPS): New macro. + (CDEPS): Reference INTL_DEPS, not INTL. + +Wed Apr 22 12:58:23 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + Handle missing shared libraries during the examination of a core + dump gracefully. + * solib.c (find_solib): Use catch_errors around call to + solib_map_sections. Use warning instead of error if reading of + the shared library name fails. + (solib_map_sections): Change return and argument types to make + it callable from catch_errors. + (symbol_add_stub): Avoid GDB core dump if solib->abfd is NULL. + * irix5-nat.c, osfsolib.c (xfer_link_map_member, solib_map_sections, + symbol_add_stub): Ditto. + +Wed Apr 22 14:34:49 1998 Michael Meissner + + * Makefile.in (INTL*): Add support to link in the intl library, + and to add -I options to its source and object directories. + (INTERNAL_CFLAGS): Ditto. + (C{LIBS,DEPS}): Ditto. + +Tue Apr 21 11:20:54 1998 Frank Ch. Eigler + + * mips-tdep.c (gdb_print_insn_mips): Disassemble MIPS instructions + with subtarget-specific `mach', rather than fixed default. + * config/mips/tm-mips.h (TM_PRINT_INSN_MACH): New macro, default + disassembly `mach'. + +Mon Apr 20 15:35:03 1998 Philippe De Muyter + + * coffread.c (decode_base_type): Treat a long field with size greater + than TARGET_LONG_BIT as long long. + * values.c (value_from_longest): Print code value in error message. + +Mon Apr 20 15:32:21 1998 Mark Kettenis + + * gdb/gdb_string.h (strdup): Declare only if not defined as a + macro. + +Mon Apr 20 14:18:45 1998 J. Kean Johnston + + * procfs.c: Added replacement macros for LWP stuff. Fixed support + for UnixWare / SVR4.2MP targets and any targets which use + multi-file /proc entries. Fixed support for hardware watchpoints. + * solib.c: SCO needs some of the same code as SunOS. Change + preprocessor conditionals. + + * config/i386/i386sco5.mt: New file. + * config/i386/tm-i386sco5.h: New file. + * config/i386/i386sco5.mh (NATDEPFILES): add i386v-nat.o. + * config/i386/nm-i386v42mp.h + (TARGET_HAS_HARDWARE_WATCHPOINTS): define. + Add other macros for hardware assisted watchpoints. + * config/i386/nm-i386sco5.h: Correct attributions. + (TARGET_HAS_HARDWARE_WATCHPOINTS): define. + * config/i386/nm-linux.h (target_remote_watchpoint): Pass + 'type' through to i386_insert_watchpoint. + +Mon Apr 20 14:12:30 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * infrun.c (wait_for_inferior): Don't add signalled processes + as new threads. + * procfs.c (wait_fd): Note if LWP has exited. + (procfs_wait): use GETPID to get process ID. + +Sat Apr 18 15:21:04 1998 Stan Cox + + * configure.tgt: Added sparc86x support. + +Thu Apr 16 13:13:24 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * rdi-share/etherdrv.c (EthernetWrite): Use strerror to get + error string if in an ANSI C-ish environment. + +Wed Apr 15 18:59:48 1998 Mark Alexander + + * sparc-tdep.c (SPARC_HAS_FPU): Define. + (sparc_extract_return_value): New function, required to handle + machines without floating point. + (sparc_store_return_value): Ditto. + * config/sparc/tm-sparc.h (EXTRACT_RETURN_VALUE): Call + sparc_extract_return_value instead of using inline code. + (sparc_extract_return_value): Declare. + (STORE_RETURN_VALUE): Call sparc_store_return_value instead + of using inline code. + (sparc_store_return_value): Declare. + +Wed Apr 15 12:19:42 1998 Martin M. Hunt + + * solib.c (enable_break): Only call warning once + instead of three times. + +Tue Apr 14 16:52:59 1998 Mark Alexander + + * sparc-tdep.c (sparc_extract_struct_value_address): Make it + work correctly on little-endian hosts. + (sparc_push_arguments): New function. + (gdb_print_insn_sparc): New function. + (_initialize_sparc_tdep): Make gdb_print_insn_sparc the default + disassembler, so that SPARClite-specific instructions will + be recognized. + * sparcl-tdep.c (readchar): Print debugging information. + (debug_serial_write): New function, a replacement for SERIAL_WRITE + that prints debugging information. + * config/sparc/tm-sparc.h (PUSH_ARGUMENTS): Define. + (sparc_push_arguments): Declare. + +Tue Apr 14 15:43:49 1998 John Metzler + + * gdbcfgxref (xref_menu): Call new regex and wild card searches + Now you can type in a specific triple like mips64-vr4300-elf or + somthing like mips*.h + (triple_search, wildcardsearch): The new functions + +Mon Apr 13 16:28:07 1998 Elena Zannoni + + * utils.c (warning): added call to warning_hook + + * source.c (find_source_lines): modified to call warning in case + of source vs. executable time stamp mismatch. Simplified object + file check. Initialized mtime to 0. + + * defs.h: added warning_hook prototype + + * top.c: added warning_hook prototype. + +Mon Apr 13 09:54:08 1998 Keith Seitz + + * config/sparc/tm-sun4os4.h (IS_STATIC_TRANSFORM_NAME): Add missing + definition. + +Fri Apr 10 22:36:28 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + Update support for x86 Solaris 2. + * config/i386/tm-i386sol2.h, nm-i386sol2.h: New configuration + files for x86 Solaris 2. + * config/i386/i386sol2.mt, i386sol2.mh: Use them. + * config/sparc/tm-sun4sol2.h (PROCFS_GET_CARRY): New macro, extract + carry flag from a given regset. + (IS_STATIC_TRANSFORM_NAME): New macro, check if a symbol name + is a SunPro transformed name. + * i386-tdep.c (sunpro_static_transform_name): New function to + extract the source name from a SunPro transformed name. + * inferior.h (procfs_first_available, procfs_get_pid_fd): + Add prototypes. + * infrun.c (wait_for_inferior): Handle breakpoint hit in + signal handler without intervening stop in sigtramp. + * procfs.c (procfs_lwp_creation_handler): Use PROCFS_GET_CARRY + instead of direct access to the status register. + (procfs_get_pid_fd): New function, returns procfs fd for a given pid. + * sol-thread.c (ps_lgetLDT): New function, returns LDT for a given + lwpid. + (sol_find_new_threads): Handle failed libthread_db initialization + gracefully. + * stabsread.c (define_symbol): Use IS_STATIC_TRANSFORM_NAME + to check for a SunPro transformed symbol name. + +Fri Apr 10 10:35:35 1998 John Metzler + + * utils.c (fmthex): A formatting function for hexdumps + + * mips-tdep.c (unpack_mips16): Fixed instruction decoding, lots of + bit pattern interpretations. mips_fetch_instruction does not work + for 16 bit instructions. Some confusion remains about sign + extension in backward branches. + (mips32_relative_offset): Sign extension + (mips32_next_pc): Major debugging, bit pattern interpretation + (print_unpack): debugging printf + (fetch_mips_16): new funtion, key on PC low bit, not symbol table + (mips16_next_16): Initial major debugging of this function. Lots + of bit pattern mistakes. + (mips_next_pc): key on low bit of PC, not symbol table. + * symfile.c (generic_load): Added a download verification which + reads back the loaded code. Download chunk size is now a defined + macro. Fixed a bug in which downloading slips into loading one + byte at a time. Lower level functions in monitor.c can load long + sequences of bytes and make use of these fixups. Referencing + bfd-start_address directly was incorrectly getting zero for start. + +Thu Apr 9 19:20:32 1998 Ian Lance Taylor + + * mips-tdep.c (do_fp_register_row): Use alloca rather than arrays + with dynamic size. + +Wed Apr 8 19:21:42 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * top.c (print_gdb_version): Print 1998 now. + +Wed Apr 8 16:57:22 1998 Philippe De Muyter + + * source.c: Remove obsolete decl of strstr(). + +Wed Apr 8 16:47:33 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * solib.c (solib_create_inferior_hook): Remove Ulrich Drepper's + patch of March 23 1998. + * breakpoint.c (breakpoint_re_set_one): Remove Ulrich Drepper's + patch of March 23 1998. + +Sat Apr 4 10:05:00 1998 Dawn Perchik + + * mdebugread.c (parse_partial_symbols): If this is an .mdebug + section in an ELF file, override a symbol's ECOFF section with its + ELF section. Also, fix stabs continuation where a stabs string + continues for more than one continuation. + +Mon Apr 6 09:17:48 1998 Andrew Cagney + + * mips-tdep.c (mips_push_arguments): Specify dimention of valbuf + using MAX_REGISTER_RAW_SIZE. + +Sat Apr 4 10:05:00 1998 Dawn Perchik + + * infrun.c: Fix prototype of signals_info to match static funtion. + +Thu Apr 2 12:47:41 1998 Frank Ch. Eigler + + * sol-thread.c (sol_thread_store_registers): Save & restore new + value of single updated register to prevent accidental clobbering. + +Wed Apr 1 22:01:09 1998 Mark Alexander + + * config/sparc/tm-sparclite.h (TARGET_BYTE_ORDER_SELECTABLE): Define. + * config/sparc/sparclite.mt: Link in the erc32 simulator. + +Wed Apr 1 16:30:49 1998 Ian Dall + + * ns32k-tdep.c (flip_bytes, ns32k_localcount, + ns32k_get_enter_addr, sign_extend): Restore functions mysteriously + deleted. + + * ns32knbsd-nat.c: New (?) file to support fetching and storing + registers on NetBSD hosts. + + * nbsd.mh (NATDEPFILES): put ns32knbsd-nat.o instead of + ns32k-nat.o + + * ns32km3-nat.c (reg_offset): Get order of floating point + registers correct. Add extra 32382 register offsets. + (REG_ADDRESS): define to point at correct part of thread + state. Use calls to "warning" instead of "message". + + * tm-nbsd.h, tm-ns32km3.h (REGISTER_NAMES, NUM_REGS, + REGISTER_BYTES, REGISTER_BYTE): redefine allowing for 32382 + fpu registers. + +Wed Apr 1 13:43:07 1998 Philippe De Muyter + + * NEWS: m68k-motorola-sysv host support added. + * coffread.c (coff_start_symtab): Accept the filename as an argument, + set it here. Callers updated. + +Wed Apr 1 23:13:23 1998 Andrew Cagney + + * config/mips/tm-mips.h (REGISTER_VIRTUAL_TYPE): Handle 32 bit SR, + FSR and FIR registers. + (REGISTER_VIRTUAL_SIZE): Compute using REGISTER_VIRTUAL_TYPE. + (REGISTER_RAW_SIZE): Define using REGISTER_VIRTUAL_SIZE. + + * config/mips/tm-mips64.h: Ditto. + +Tue Mar 31 21:30:39 1998 Nick Clifton + + * arm-tdep.c (gdb_print_insn_arm): Attach a fake Thumb symbol + vector to the info structure when disassembling thumb + instructions. + + * coffread.c (coff_symtab_read, read_one_sym, + process_coff_symbol): Support Thumb symbol types. + + * dbxread.c (process_one_symbol): Call SMASH_TEXT_ADDRESS (if it + is defined) for function symbols. + +Tue Mar 31 16:39:28 1998 Michael Snyder + + * tracepoint.c (get_tracepoint_by_number): change warning to note. + (delete_trace_command): suppress y/n query if no tracepoints, or + if not from_tty. (trace_pass_command): reject junk at end of args. + (read_actions): an action list consisting only of "end" is discarded. + (validate_actionline (for collect command)): an argument beginning + with a dollar_sign but not recognized as a special argument is + parsed like any other expression -- if it isn't a register name, + it's rejected. Also reject an empty argument to while-stepping. + (trace_find_command): reject a negative frame number argument. + (_initialize_tracepoint): set $traceframe initially to -1. + +Mon Mar 30 16:42:12 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * rdi-share/Makefile.am, rdi-share/aclocal.m4, + rdi-share/configure: New files. + * rdi-share/configure.in: Rewritten to be an autoconf input file. + * rdi-share/Makefile.in, rdi-share/configure: Generated by + automake/autoconf. + * rdi-share/dbg_hif.h, etherdrv.c, hostchan.c: Use autoconf tests + to check environment. + +Sun Mar 29 15:17:16 1998 Keith Seitz + + * tracepoint.c (trace_start_command): Set trace_running_p. + (trace_stop_command): Clear trace_running_p. + +Sat Mar 28 15:19:48 1998 Stan Shebs + + * NEWS: Update for 4.17 release. + +Fri Mar 27 10:15:50 1998 David Taylor + + * tracepoint.c (parse_and_eval_memrange): Fix memory leaks. + (encode_actions): Use the new gen_trace_for_expr function + instead of expr_to_address_and_size; collect registers when + using expressions. (clear_collection_list): Fix memory leak. + +1998-03-26 Jim Blandy + + * ax-gdb.h (gen_trace_for_expr): Add prototype. + +Thu Mar 26 17:24:23 1998 David Taylor + + * tracepoint.c (validate_actionline): Fix memory leak. + (encode_actions): Fix memory leak. + +Thu Mar 26 16:16:55 1998 David Taylor + + * tracepoint.c (trace_mention): New function. + (trace_command): Call it. + +1998-03-26 Jim Blandy + + * ax-general.c (ax_reqs): New function. + * ax.h (enum agent_flaws, struct agent_reqs): New types. + (agent_reqs): New extern prototype. Well, actually, this was + there before, due to a premature checkin. + (struct aop_map): Add new `data_size' member. + * ax-general.c (aop_map): Supply its value. + * ax-gdb.c (agent_command): Call ax_reqs, for testing. + + * ax-general.c (ax_print): If we encounter an invalid or + incomplete opcode, don't abort; just print an error message. + + * ax-gdb.c: Generate trace bytecodes, as appropriate. + (trace_kludge): New variable. + (gen_fetch, gen_bitfield_ref): Emit trace bytecodes, if asked + nicely. + (expr_to_agent): Ask for no trace bytecodes. + (gen_trace_for_expr): New function. + (agent_command): Call it, and display the result appropriately --- + no struct axs_value, so no type or kind information. + + * ax-gdb.c: Use TARGET_CHAR_BIT throughout, not HOST_CHAR_BIT. + +Thu Mar 26 22:29:28 1998 Elena Zannoni + + * tracepoint.c (trace_status_command): Recognize a boolean return + value from the stub to indicate whether trace experiment is + running. Export this value as a global state variable. + (trace_running_p) for use by the GUI. (from Michael Snyder) + (trace_pass_command) added call to modify_tracepoint_hook. + + * tracepoint.h export trace_running_p. + +Thu Mar 26 13:08:01 1998 David Taylor + + * tracepoint.c (validate_actionline): do not error out if + exp->elts[0].opcode is not on short line -- let + expr_to_address_and_size handle it. + +1998-03-26 Jim Blandy + + * tracepoint.c: Include "ax.h", not "agentexpr.h". + + * tracepoint.c (encode_actions): Call expr_to_address_and_size, + not simply expr_to_agent. + + * ax-general.c: Comment out code in progress, so everyone else can + at least compile. + + * gdbtypes.c: Doc fix. + + * ax.h, ax-gdb.h, ax-general.c, ax-gdb.c: New files. + * Makefile.in (REMOTE_OBJS): Add ax-general.o and ax-gdb.o. + (SFILES): Add ax-general.c, ax-gdb.c. + (ax_h): New variable. + (ax-general.o, ax-gdb.o): New rules. + + +Tue Mar 24 16:22:40 1998 Stu Grossman + + * Makefile.in: Derive SHELL from configure. + * config/d10v/d10v.mt config/m32r/m32r.mt + config/mn10200/mn10200.mt config/mn10300/mn10300.mt + config/d30v/d30v.mt: Remove -lm from SIM. This prevents + dependency checking of -lm (under NT native builds). (It is + automatically added by configure if it exists.) + * doc/configure mswin/configure nlm/configure + testsuite/gdb.base/configure testsuite/gdb.c++/configure + testsuite/gdb.chill/configure testsuite/gdb.disasm/configure + testsuite/gdb.stabs/configure testsuite/gdb.threads/configure: + Regenerate with autoconf 2.12.1 to fix shell issues for NT native + builds. + +Mon Mar 23 18:10:57 1998 Ulrich Drepper (drepper@cygnus.com) + + * solib.c (solib_create_inferior_hook): Rewrite previous + change to check the type of file via BFD. + +Mon Mar 23 13:52:28 1998 Ulrich Drepper (drepper@cygnus.com) + + * breakpoint.c (breakpoint_re_set_one): Treat bp_shlib_events + like bp_breakpoints. + * solib.c (solib_create_inferior_hook): Relocate section addresses + if the alleged start address doesn't agree with the PC. + +Sat Mar 21 19:34:49 1998 Elena Zannoni + + merged changes from Foundry (list follows by file/author): + + - Tom Tromey + * Makefile.in (gdbres.o): New target. + (WINDRES): New define. + * configure: Rebuilt. + * configure.in (WINDRES): Define. + (CONFIG_OBS): Include gdbres.o on Windows. + * gdbtool.ico: New file. + * gdb.rc: New file. + + * ser-unix.c + - Keith Seitz + (wait_for): Don't reset the timeout_remaining for CYGWIN32, + since we now effectively poll the serial port. + Don't reset the current_timeout, either, since this member is used + by hardwire_readchar to track the timeout and call the ui_loop_hook. + (hardwire_readchar): Poll the serial port for Cygwin32. We timeout + every second, update the UI, and loop around doing this until we + have hit the real timeout or we get data or an error. This will + allow the UI to stay active while gdb is "blocked" talking to the + target. + - Martin M. Hunt + (wait_for): Do reset current_timeout because it is only used to + keep track of what the current timeout for the scb is. + + * top.c + - Martin M. Hunt + (quit_confirm): Change exit message again + for GUI. + (pc_changed_hook): Add prototype. + - Tom Tromey + (quit_confirm): Added missing `else'. + (quit_confirm): Special-case message if init_ui_hook is + set. + + * symtab.c + - Martin M. Hunt + (find_pc_sect_line): If no symbol information + is found, return correct pc anyway. + (find_methods): Comment out an apparently + bogus error message because it messes up Foundry. + + * serial.c + - Martin M. Hunt + (_initialize_serial): Add a description of + "set remotelogbase". + + * findvar.c + - Martin M. Hunt + (write_register_gen): Add call to + pc_changed_hook if the PC is being changed. + + * defs.h + - Martin M. Hunt + (pc_changed_hook): Define. + + * command.c + - Martin M. Hunt + (do_setshow_command): If no arguments are supplied, + don't dump core, instead print out an error message. + + * breakpoint.c + - Martin M. Hunt + Make set_raw_breakpoint, set_breakpoint_count, + and breakpoint_count non-static so they are accessible from + elsewhere. + (enable_breakpoint): Enable breakpoint + with same disposition instead of changing all breakpoints + to donttouch. + + * annotate.h + - Keith Seitz + Add declarations for annotation hooks. + + * annotate.c + - Keith Seitz + Add hooks: annotate_starting_hook, annotate_stopped_hook, + annotate_signalled_hook, annotate_exited_hook. + (annotate_starting): If hook exists, call it instead. + (annotate_stopped): If hook exists, call it instead. + (annotate_exited): If hook exists, call it instead. + (annotate_signalled): If hook exists, call it instead. + +Fri Mar 20 14:45:36 1998 Michael Snyder + + * gdbserver/Makefile.in: add dependency on XM_CLIBS. + * gdbserver/low-sim.c (registers) force into alignment. + (create_inferior): Fix typo on new_argv; add abfd arg to + sim_open, sim_create_inferior. Add reg_size arg to + sim_fetch_register, sim_store_register. Make simulator + take a single-step to get into a known running state. + * gdbserver/gdbreplay.c: include fcntl.h for def'n of F_SETFL. + * gdbserver/server.c: Add remote_debug variable to control + debug output. + * gdbserver/server.h: Add prototypes for enable/disable_async_io. + * gdbserver/remote-utils.c: add verbose debugging output controlled + by "remote_debug" variable. Add call to "disable_async_io()" + to avoid being killed by async SIGIO signals. + * config/m32r/m32r.mt: define GDBSERVER_(LIBS and DEPFILES), + so that gdbserver can be built with the m32r simulator. + +Fri Mar 20 09:04:06 1998 Andrew Cagney + + * gdbtypes.h (builtin_type_{,u}int{8,16,32,64}): New gdb builtin + types. + + * gdbtypes.c (_initialize_gdbtypes): Initialize new types. + + * mips-tdep.c (do_gp_register_row): Pad register value when GP + register is smaller than MIPS_REGSIZE. + + * findvar.c (value_of_register): When raw and virtual register + values identical, check that sizes are consistent. + +Thu Mar 19 11:32:15 1998 Michael Snyder (msnyder@cleaver.cygnus.com) + + * minsyms.c (compare_minimal_symbols): If addresses are identical, + then compare on names. Sorted list should have symbols with + identical addresses AND names adjacent, so dups can be discarded. + +Wed Mar 18 12:50:17 1998 Jeff Law (law@cygnus.com) + + * stabsread.c (define_symbol): Don't look for ',' as a LRS + indicator. + +Wed Mar 18 10:34:51 1998 Nick Clifton + + * rdi-share/etherdrv.c: Set sys_errlist[] as char * not const char *. + +Fri Mar 13 15:43:53 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * config/mips/xm-mips.h (CC_HAS_LONG_LONG): Undefine for Ultrix + when compiling with native cc, the compiler has broken long long + support. + +Fri Mar 13 15:37:02 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * config/m68k/xm-sun3os4.h: Remove malloc declarations, they + are handled via autoconf now. + * remote.c (remote_ops, extended_remote_ops): Replace static + forward declaration by moving the static definition to the top of + the file, for old K&R compilers. + * tracepoint.c (collect_symbol, trace_start_command): + Replace ANSI string concatenation with K&R compatible simple string. + +1998-03-11 Fred Fish + + * source.c (select_source_symtab): Don't reach error if we have + a current_source_symtab from reading in partial symbol table. + +Fri Mar 6 13:10:27 1998 Fred Fish + + * utils.c (quit): Call SERIAL_DRAIN_OUTPUT rather than + SERIAL_FLUSH_OUTPUT. + * serial.h (struct serial_ops): Add drain_output, pointer to + function that waits for output to drain. + (SERIAL_DRAIN_OUTPUT): Macro to wait for output to drain. + * ser-unix.c (hardwire_drain_output): New function and prototype. + + * ser-unix.c (hardwire_ops): Add entry for drain_output function. + * ser-tcp.c (tcp_ops): Ditto. + * ser-ocd.c (ocd_ops): Ditto. + * ser-mac.c (mac_ops): Ditto. + * ser-go32.c (dos_ops): Ditto. + * ser-e7kpc.c (e7000pc_ops): Ditto. + +Thu Mar 5 16:07:41 1998 Michael Snyder (msnyder@cleaver.cygnus.com) + + * sparcl-tdep.c: fix #endif comments + +Thu Mar 5 15:10:35 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * Makefile.in (BISON): Configure substitutes in @YACC@, not @BISON@. + +Thu Mar 5 14:42:41 1998 Keith Seitz + + * ocd.c (ocd_open): If we fail ocd_start_remote, make sure we + error () so that we abort out of bdm_ppc_open. + +Wed Mar 4 16:53:52 1998 Martin M. Hunt + + * serial.c (_initialize_serial): Add a description of + "set remotelogbase". + + * command.c (do_setshow_command): If no arguments are supplied, + don't dump core, instead print out an error message. + +Wed Mar 4 01:39:08 1998 Ron Unrau + + * elfread.c (elf_symtab_read): merge SYMBOL_IS_SPECIAL into + MAKE_MSYMBOL_SPECIAL + * config/mips/tm-mips.h: ditto + +Tue Mar 3 17:19:08 1998 John Metzler + + * dwarfread.c (read_tag_pointer_type): Pointer sizes now come from + TARGET_PTR_BIT rather from sizeof(char *) on host. + +Tue Mar 3 14:37:02 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * alpha-nat.c (fetch_osf_core_registers): Renamed from + fetch_aout_core_registers. + (alpha_osf_core_fns): Renamed from alpha_aout_core_fns, change + flavour to bfd_target_unknown_flavour for OSF core files. + +Mon Mar 2 17:44:13 1998 Michael Snyder (msnyder@cleaver.cygnus.com) + + * breakpoint.c (_initialize_breakpoint): Make "en" an alias + for "enable" (so that it doesn't conflict with "end"). + +Mon Mar 2 17:04:25 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * Makefile (VERSION): Bump to 4.17.1. + +Mon Mar 2 16:59:15 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * rdi-share/etherdrv.c (sys_errlist): Add correct decl for Linux. + +Mon Mar 2 16:51:44 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * Makefile.in (YYFILES): Remove in maintainer-clean, not distclean. + +Mon Mar 2 16:47:11 1998 Philippe De Muyter + + * Makefile.in (distclean): Add `rm $(YYFILES)'. + +Mon Mar 2 16:45:48 1998 Philippe De Muyter + + * coffread.c (coff_read_enum_type): Set TYPE_FLAG_UNSIGNED if enum + is unsigned. + +Sun Mar 2 15:16:13 1998 Richard Henderson + + * configure.host, configure.tgt: Add sparc-linux. + * sparc-nat.c: Include not for Linux. + * config/sparc/*linux*: New files. + +Mon Mar 2 12:12:41 1998 Anthony Thompson (athompso@cambridge.arm.com) + + * arm-tdep.c (gdb_print_insn_arm): Call print_insn_big_arm + if we're big endian; else call print_insn_little_arm. + +Mon Feb 24 11:24:57 1998 Richard Henderson + + * Makefile.in (BISON): Don't even pretend to use yacc. + (c-exp.tab.o): Use bison -o to use a unique intermediate file. + (f-exp.tab.o, m2-exp.tab.o): Likewise. + (jv-exp.tab.o): Likewise. + +Tue Feb 24 03:32:59 1998 Andrew Cagney + + * remote-sim.c (gdbsim_fetch_register): Don't abort when the + register size is wrong. + +Thu Feb 19 16:49:48 1998 John Metzler + + * target.c (debug_to_fetch_registers,debug_to_store_registers, + debug-to_insert_breakpoint,debug_to_remove_breakpoint): tracing + 64 bit targets crashed long long printfs. + +Tue Feb 17 16:36:22 1998 Michael Snyder (msnyder@cleaver.cygnus.com) + + * symfile.c (read_target_int_array): rename read_target_long_array + and force the sizeof an ovly_table element to sizeof(long), + instead of sizeof(int). + +Tue Feb 17 18:05:05 1998 Frank Ch. Eigler + + * remote-mips.c (mips_request): Use unsigned long during parsing + returned value from monitor, to prevent accidental sign extension. + +Tue Feb 17 14:28:33 1998 Peter Schauer + + * acconfig.h: FORCE_MMCHECK changed to MMCHECK_FORCE. + * configure.in: Ditto. + * configure: Regenerated. + +Tue Feb 17 14:07:34 1998 Peter Schauer + + * gdbtypes.c (check_typedef): Do not try to resolve the length of + a type which has TYPE_FLAG_TARGET_STUB set, if the target type has + set TYPE_FLAG_TARGET_STUB as well. + +Tue Feb 17 14:32:18 1998 Andrew Cagney + + * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): + Pass register size to sim_{fetch,store}_register. Check nr of + register bytes transfered is correct. + +Mon Feb 16 14:05:54 1998 Andrew Cagney + + * remote-d10v.c (remote_d10v_open): Call push_remote_target + instead of open_remote_target. + + * remote.c (remote_xfer_memory): Use REMOTE_TRANSLATE_XFER_ADDRESS + to translate addr/size when defined. + (open_remote_target): Delete. + + * target.h (open_remote_target): Delete. + + * config/d10v/tm-d10v.h (REMOTE_TRANSLATE_XFER_ADDRESS): Define. + +Mon Feb 16 14:05:54 1998 Andrew Cagney + + * d10v-tdep.c (d10v_extract_return_value): Wierd. GCC wants to + return odd sized register quantities with only half of the first + register used! + + * config/d10v/tm-d10v.h (USE_STRUCT_CONVENTION): Use stack when + size > 8. + +Mon Feb 16 14:05:54 1998 Andrew Cagney + + * config/d10v/tm-d10v.h (USE_STRUCT_CONVENTION): Define. True when + sizeof type > 1. + +Sun Feb 15 16:10:50 1998 Ron Unrau + + * parse.c (write_dollar_variable): call new function + target_map_name_to_register to allow targets to define their own + register name aliases. + * infcmd.c (registers_info): use target_map_name_to_register so that + "print $reg" and "info reg $reg" use the same register name aliases. + +Fri Feb 13 16:40:30 1998 Stan Shebs + + * config/i386/i386mk.mt (OBJFORMATS): Delete, no longer used. + * config/i386/xm-i386mk.h: Fix an include. + * config/pyr/tm-pyr.h (PC_INNER_THAN): Remove, never used. + +Thu Feb 12 16:12:07 1998 Frank Ch. Eigler + + * remote-mips.c (mips_enter_debug): Sleep before sending CR to + monitor. + (mips_exit_debug): Accept any whitespace / verbiage before monitor + prompt reappears. + +Thu Feb 12 18:25:42 1998 Andrew Cagney + + * d10v-tdep.c (show_regs): Avoid use of %llx when printing 8 byte + accumulators. + +Thu Feb 12 17:10:22 1998 Andrew Cagney + + * valops.c (value_at): For d10v, make read pointers with + read_target_unsigned_integer, keep addresses unsigned. + (value_fetch_lazy): Ditto. + +Thu Feb 12 12:14:02 1998 Andrew Cagney + + * remote-d10v.c: New file. Layer the d10v GDB->remote memory map + on top of the remote serial memory transfer functions. + + * config/d10v/d10v.mt (TDEPFILES): Add remote-d10v.o + + * Makefile.in (remote-d10v.o): Add dependencies. + + * remote.c (remote_open_1): Add arg extended_p, engage extended + protocol when extended_p. + (remote_open, extended_remote_open): Pass !extended_p / + extended_p to remote_open_1. + + * remote.c (open_remote_target), target.h: New function. + +Wed Feb 11 08:41:15 1998 Andrew Cagney + + * config/i386/fbsd.mh (XDEPFILES): Add ser-tcp.o. + +Tue Feb 10 17:50:37 1998 Keith Seitz + + * tracepoint.c (tracepoint_operation): Call the modify_tracepoint_hook + if it exists. + Remove static declaration of free_actions. + + * tracepoint.h: Add declaration of free_actions. + +Tue Feb 10 12:17:13 1998 Fred Fish + + * symtab.c (decode_line_1): Revert change that mistakenly + removed assignment of sals[0].pc field. + +Mon Feb 10 12:37:47 1998 Philippe De Muyter + + * m68k/tm-delta68.h (EXTRACT_RETURN_VALUE): Type argument for + `REGISTER_CONVERT_TO_VIRTUAL is `TYPE', not + `REGISTER_VIRTUAL_TYPE (FP0_REGNUM)'; + (STORE_RETURN_VALUE): Ditto, and offset for `write_register_bytes' + is `REGISTER_BYTE (FP0_REGNUM)', not `FP0_REGNUM'. + (FRAME_NUM_ARGS): New macro. + * m68k/tm-news.h (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): Ditto. + * delta68-nat.c (clear_insn_cache): New function, forgotten in previous + patch. + +Mon Feb 9 11:10:06 1998 Andrew Cagney + + * d10v-tdep.c: Replace references to IMEM_ADDR and DMEM_ADDR with + D10V_MAKE_[DI]ADDR and D10V_CONVERT_[ID]ADDR_TO_RAW macros. + + * config/d10v/tm-d10v.h (IMEM_START): Move to 0x01...... + (DMEM_START): Move to 0x00...... + (STACK_START): Move to 0x00..7ffe. + (D10V_MAKE_IADDR, D10V_MAKE_DADDR): Translate unconditionally. + + * d10v-tdep.c (d10v_xlate_addr): Delete function. + +Mon Feb 9 15:10:21 1998 Fred Fish + + * symtab.c (fixup_psymbol_section): Move forward declaration to + top of file with other such decls. Make it a static function. + * symtab.h: Minor formatting tweaks. + +Mon Feb 9 13:14:12 1998 Stan Shebs + + * config/a29k-udi.mt, config/i960/vxworks960.mt (REMOTE_OBS): + Remove redefinition. + * config/i960/tm-i960.h (BREAKPOINT): Define. + +Mon Feb 9 15:35:38 1998 Ian Lance Taylor + + * Makefile.in (init.c): Ignore errors when making init.c. Seems + necessary to work around bug in Solaris make. + +Sun Feb 6 02:44:28 1998 Philippe De Muyter + + * m68k/tm-delta68.h (CPLUS_MARKER): Macro deleted. + (EXTRACT_STRUCT_VALUE_ADDRESS): Macro defined. + (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): Macros modified + because floating-point values return via %fp0. + (CLEAR_INSN_CACHE): New macro. + * m68k/tm-m68k.h (REGISTER_CONVERT_TO_VIRTUAL): Macro fixed + to use DOUBLEST. + (REGISTER_CONVERT_TO_RAW): Ditto. + * infptrace.c (child_xfer_memory): If CLEAR_INSN_CACHE is defined, + call it after having written in child process's memory. + * inflow.c (PROCESS_GROUP_TYPE): Macro defined if HAVE_TERMIO. + (gdb_has_a_terminal, terminal_ours_1): Functions fixed for HAVE_TERMIO. + +Fri Feb 6 16:17:30 1998 Jeffrey A Law (law@cygnus.com) + + * config/mips/tm-mips64.h (TARGET_LONG_BIT): Allow final target to + override. + (TARGET_LONG_LONG_BIT): Likewise. + (TARGET_PTR_BIT): Likewise. + +Fri Feb 6 17:42:22 1998 Andrew Cagney + + * config/d10v/tm-d10v.h (D10V_CONVERT_IADDR_TO_RAW, + D10V_CONVERT_DADDR_TO_RAW): Define. + + * d10v-tdep.c (d10v_push_arguments): Re-write. Pass arguments in + registers, regardless of their size, when they fit. + +Thu Feb 5 13:16:36 1998 Andrew Cagney + + * d10v-tdep.c (d10v_extract_return_value): For function pointers + translate address to IMAP area. + + * config/d10v/tm-d10v.h (EXTRA_FRAME_INFO): Delete dummy from + struct. + (POP_FRAME): Point at generic_pop_current_frame. + + * d10v-tdep.c (d10v_pop_frame): Delete code handling dummy frames, + handled earlier. + (d10v_push_return_address): New function. + (d10v_pop_dummy_frame): Delete. + (d10v_fix_call_dummy): Delete. + (d10v_call_dummy_address): Delete. + + * d10v-tdep.c (d10v_init_extra_frame_info): Clear dummy and + frameless. + + * d10v-tdep.c (d10v_push_arguments): Keep stack word aligned. + + * config/d10v/tm-d10v.h (EXTRACT_STRUCT_VALUE_ADDRESS): Extract + address of structure from first ARG1_REGNUM. + + * d10v-tdep.c (d10v_push_arguments): Force 4 byte args into + even-odd register pair. Store 1 and 2 byte args in registers. + + * valops.c (value_fetch_lazy): Ensure that a D10V function pointer + is fetched in the correct byte order. + (value_at): Ditto. Also ensure data pointers are mapped to data + segment. + + * config/d10v/tm-d10v.h (D10V_DADDR_P, D10V_IADDR_P): + + * d10v-tdep.c: Replace 2 with REGISTER_RAW_SIZE. + (d10v_pop_frame): Replace R13 with LR_REGNUM. + (d10v_push_arguments): Replace R2 with ARG1_REGNUM. + (d10v_push_arguments): Replace 6 with ARGN_REGNUM. + (d10v_extract_return_value): Access return value with RET1_REGNUM. + + * config/d10v/tm-d10v.h (ARG1_REGNUM, ARGN_REGNUM, RET1_REGNUM): + Define. + (STORE_RETURN_VALUE): Specify return register using RET1_REGNUM. + (STORE_STRUCT_RETURN): Specify ARG1_REGNUM as the struct ptr + location. + +Thu Feb 5 13:16:36 1998 Andrew Cagney + + * blockframe.c (generic_pop_dummy_frame): Flush the frame, no + longer valid. + + * blockframe.c (generic_pop_current_frame), frames.h: New + function. + +Thu Feb 5 17:18:16 1998 Andrew Cagney + + * remote-sim.c (gdbsim_create_inferior): clear_proceed_status + before /re/starting the simulator. + +Thu Feb 5 15:55:31 1998 C. M. Heard (heard@vvnet.com) + + * top.c (do_nothing): Remove signal handler after signal is caught. + +Thu Feb 5 11:57:06 1998 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c (tracepoint_operation): call free_actions instead + of free. (free_actions): eliminate some memory leaks for actions. + (validate_actionline): pass string arg by reference, so we can + change the pointer. Change all memrange collection arguments to + canonical form (literal address and size), to enforce early + evaluation. Accept UNOP_MEMVAL (assembly variables) for + trace collection. (parse_and_eval_memrange): accept expressions + for the address and size fields of a memrange (and evaluate + them immediately). (several places): use -1 instead of zero + to distinguish an absolute memrange from a register-relative one. + (encode_actions): add handling for UNOP_MEMVAL (assembly variable). + +Wed Feb 4 17:40:21 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * Makefile.in (SFILES): add tracepoint.c. + (LINTFILES): add @CONFIG_SRCS@. + (SOURCES): Ditto. + * configure.in (CONFIG_SRCS): Mirror use of CONFIG_OBS. + * configure: Regenerated. + +Tue Feb 3 16:12:32 1998 Gordon W. Ross (gwr@mc.com) + + * infptrace.c (child_resume): Don't try to step if + NO_SINGLE_STEP is defined. + +Mon Feb 2 19:06:13 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * Makefile.in (VERSION): Bump to 4.16.2. + +Mon Feb 2 17:18:25 1998 Richard Henderson + + * alpha-nat.c (fetch_aout_core_registers): Rename from + fetch_core_registers. + (fetch_elf_core_registers): New function. + (supply_gregset): Use ALPHA_REGSET_BASE. + (supply_fpregset): Likewise. + (fill_fpregset): Likewise. + (alpha_aout_core_fns): Rename from alpha_core_fns. + (alpha_elf_core_fns): New. + * config/alpha/alpha-linux.mh (NATDEPFILES): solib.o not osfsolib.o. + Disable MMALLOC. + * config/alpha/nm-linux.h (SVR4_SHARED_LIBS): Define if ELF. + (TARGET_ELF64): Likewise. + (ALPHA_REGSET_BASE): New. + * config/alpha/nm-osf.h (ALPHA_REGSET_BASE): New. + * config/alpha/tm-alphalinux.h: Include tm-sysv4.h. + + * solib.c (elf_locate_base): Add TARGET_ELF64 support. + (info_sharedlibary_command): Likewise. + + * configure.host: Match alpha*. + * configure.tgt: Likewise. + +Fri Jan 30 15:11:38 1998 David Taylor + + Changes by + * infrun.c (IN_SOLIB_DYNSYM_RESOLVE_CODE): new macro for detecting + whether we are in the dynamic symbol resolution code + (wait_for_inferior): invoke it. + * solib.c (in_svr4_dynsym_resolve_code): new function + (enable_break): record start and end of the dynamic linker + text and plt sections for use in in_svr4_dynsym_resolve_code. + * solib.h (IN_SOLIB_DYNSYM_RESOLVE_CODE): add svr4 definition; + (in_svr4_dynsym_resolve_code): declare it. + * config/nm-gnu.h (solib.h): move inclusion to after definition + of SVR4_SHARED_LIBS. + * config/nm-sysv4.h (solib.h): ditto. + * config/i386/nm-i386sco5.h (solib.h): ditto. + * config/i386/nm-linux.h (solib.h): ditto. + * config/mips/nm-irix5.h (IN_SOLIB_DYNSYM_RESOLVE_CODE): undefine. + +Thu Jan 29 19:39:31 1998 Stan Shebs + + * coffread.c (coff_symtab_read) [SEM]: Remove code, macro can + never be defined. + * dbxread.c (process_one_symbol) [BLOCK_ADDRESS_ABSOLUTE]: + Remove, no longer needed. + * hppa-tdep.c (N_SET_MAGIC): Remove, no longer used. + * config/pa/xm-hppab.h (SEEK_SET, SEEK_CUR, SEEK_END): Ditto. + * config/mips/tm-mipsm3.h (NUMERIC_REG_NAMES): Ditto. + * config/mips/mipsm3.mt (TDEPFILES): Remove mipsread.o. + +Wed Jan 28 14:46:52 1998 Stan Shebs + + Suggested by Chris Walter : + * dwarfread.c (set_cu_language): Recognize Fortran. + * dwarf2read.c (set_cu_language): Ditto. + (read_array_type): Fix language test. + +Wed Jan 28 12:51:08 1998 Michael Snyder (msnyder@cleaver.cygnus.com) + + * blockframe.c (generic_frame_chain_valid): A frame pointer may + be valid if it is equal to the frame pointer of its caller (ie. + not necessarily strictly INNER_THAN). Allows frameless functions. + +Wed Jan 28 11:23:25 1998 Mark Alexander + + * monitor.c (monitor_vsprintf): New function to handle + printing of large addresses using %A format specifier. + (monitor_printf_noecho, monitor_printf): Use monitor_vsprintf + instead of vsprintf. + * dve3900-rom.c (_initialize_r3900_rom): Use %A instead of %Lx + to print addresses. + +Tue Jan 27 16:14:23 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * configure.in (CONFIG_LDFLAGS): Only add -export-dynamic + when using GNU ld. + +Mon Jan 26 19:07:46 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * config/alpha/tm-alphalinux.h (alpha_linux_sigtramp_offset): + Add closing parenthesis. From HJ Lu. + +Mon Jan 26 17:54:45 1998 Mark Alexander + + * dve3900-rom.c: Improve performance by using memory commands + that print less fluff. Minor cosmetic changes. + Eliminate compiler warnings. + +Sat Jan 24 23:44:43 1998 Martin M. Hunt + + * breakpoint.c (enable_breakpoint): Preserve breakpoint + disposition when enabling a breakpoint. + + * symtab.c (find_pc_sect_line): If no symbol information + is found, return correct pc anyway. + +Fri Jan 23 17:26:22 1998 Stan Shebs + + * configure.host (i[3456]86-*-osf1mk*, mips-*-mach3*, + ns32k-*-mach3*): Fix file names. + (i[3456]86-*-os9k, m88*-*-mach3*, w65-*-*): Remove config + recognition, no source files for these. + * configure.tgt (powerpc-*-aix4*): Remove config, now identical + to powerpc-*-aix*. + * config/powerpc/{aix4.mh,aix4.mt,tm-ppc-aix4.h}: Remove files, + no longer needed. + +Fri Jan 23 16:49:41 1998 Mark Alexander + + * monitor.c (monitor_write, monitor_readchar): New functions. + * monitor.h (monitor_write, monitor_readchar): Declare. + * dve3900-rom.c: Add support for fast loading on ethernet connections. + +Fri Jan 23 07:47:06 1998 Fred Fish + + * config/d10v/tm-d10v.h (CALL_DUMMY): Define as "{ 0 }". + (TARGET_READ_FP): Define to d10v_read_fp rather than d10v_read_sp. + (TARGET_WRITE_FP): Define to d10v_write_fp rather than d10v_write_sp. + (d10v_write_fp, d10v_read_fp): Add prototypes. + * symtab.c (decode_line_1): Remove assignment of sals[0].pc field. + * symfile.c (simple_overlay_update, simple_overlay_update_1): + Ignore the size of overlay sections. This check is redundant anyway. + * printcmd.c (print_frame_args): Ditto. + * valops.c (value_fetch_lazy): Ditto. + * values.c (unpack_long): Ditto. + * d10v-tdep.c (d10v_frame_chain, d10v_frame_find_saved_regs, + d10v_init_extra_frame_info): Fix some minor bugs so the finish command + works properly. + (show_regs): Change num1 and num2 types from "long long" to "LONGEST". + (d10v_read_fp, d10v_write_fp): New functions. + (d10v_push_arguments): Remove unneeded assigns to "val" and "contents". + (d10v_push_arguments): Fix for pointers and structs. + (d10v_extract_return_value): Fix for pointers and chars. + +Tue Jan 20 18:53:18 1998 Stan Shebs + + * configure.tgt (i386-*-mach*, m88*-*-mach3*): Remove config + recognition, no source files for these (note that the i386 Mach + config is for pre-Mach 3). + (mips*-*-mach3*, ns32k-*-mach3*): Fix file names. + * config/mips/mipsel64.mt: Remove, never referenced. + +Mon Jan 19 14:01:28 1998 Stan Shebs + + * top.c (print_gdb_version): Restore to original message. + +Mon Jan 19 13:34:40 1998 Ian Lance Taylor + + From cgf@bbc.com (Chris Faylor): + * win32-nat.c (child_mourn_inferior): Call ContinueDebugEvent to + let the child exit. + (child_kill_inferior): Respond to all debug events as the child is + terminating. + + * Makefile.in (all): Change gdb dependency to gdb$(EXEEXT). + (uninstall): Add $(EXEEXT) to file name to remove. + (gdb$(EXEEXT)): Rename target from plain gdb. + (gdb1$(EXEEXT)): Rename target from plain gdb1. + (clean, mostlyclean): Add $(EXEEXT) to binary names to remove. + +1998-01-16 Felix Lee + + * top.c (print_gdb_version): delete stutter. + +Thu Jan 15 12:29:13 1998 Nick Clifton + + * remote-rdi.c (arm_rdi_open): Patch from Tony.Thompson@arm.com + to prevent spurous error messages on non-ICE targets. + +Wed Jan 14 19:27:02 1998 Stan Shebs + + * config/mips/{r3900.mt,r3900l.mt,tm-r3900.h,tm-r3900l.h}: + Remove, no longer used. + +Wed Jan 14 18:11:26 1998 Michael Meissner + + Patch from Jim Wilson. + * d30v-tdep.c (d30v_frame_find_saved_regs_offsets): Properly + declare void function before use. + + * config/d30v/tm-d30v.h (CALL_DUMMY): Initialize as { 0 }, not {}. + +Tue Jan 13 16:38:48 1998 Fred Fish + + * configure.in (--with-mmalloc): Add new configure arg to use the + mmalloc package. Default is to not use it. + (START_INFERIOR_TRAPS_EXPECTED): Define to the integer 2, not + the string "2". + * acconfig.h (USE_MMALLOC, FORCE_MMCHECK): Add #undef. + * configure: Regenerated. + * config.in: Regenerated. + * Makefile.in (MMALLOC_DIR, MMALLOC_SRC): Remove. + (MMALLOC): Set using configure. + (MMALLOC_CFLAGS): Set using configure. + + * config/i386/tm-linux.h (sys_quotactl): Define to 1 rather + than just defining it. + * mpw-make.sed: Undefine USE_MMALLOC rather than defining NO_MMALLOC. + * utils.c (NO_MMALLOC): Use USE_MMALLOC instead. + * objfiles.c: ditto. + * defs.h: ditto. + + * config/sparc/sun4os4.mh (MMALLOC_CFLAGS): Remove. + * config/m68k/sun3os4.mh (MMALLOC_CFLAGS): Remove. + * config/i386/cygwin32.mh (MMALLOC_CFLAGS): Remove. + * config/alpha/alpha-osf3.mh (MMALLOC_CFLAGS): Remove. + * config/alpha/alpha-osf2.mh (MMALLOC_CFLAGS): Remove. + * gdbserver/Makefile.in (MMALLOC_*): Remove. + * config/rs6000/rs6000.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/rs6000/aix4.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/powerpc/aix4.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/powerpc/aix.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/ns32k/ns32km3.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/mips/mipsm3.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/mips/decstation.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/m88k/cxux.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/i386/xm-windows.h (NO_MMALLOC, NO_MMCHECK): Remove. + * config/i386/i386mk.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/i386/i386m3.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/i386/i386gnu.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/alpha/alpha-osf1.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + * config/alpha/alpha-linux.mh (MMALLOC, MMALLOC_CFLAGS): Remove. + +Mon Jan 12 11:46:51 1998 Michael Snyder (msnyder@cleaver.cygnus.com) + + * config/m68k/tm-m68k.h (REGISTER_VIRTUAL_TYPE): make A0 thru A7 + default to void pointer type (so that their default radix is hex). + + * symtab.c: move rbreak_command from no_class to class_breakpoint + so it will be listed under "help breakpoints". + +Sat Jan 10 14:58:04 1998 Stan Shebs + + * rdi-share/hostchan.c: Remove gettimeofday declaration. + +Thu Jan 8 11:03:59 1998 Nick Clifton + + * remote-rdp.c: Applied patches submitted by Tony.Thompson@arm.com + to implement the Angel remote debugging interface. + + * Makefile.in: Add build rules for remote-rdi.c and + rdi-share/libangsd.a. + + * configure.tgt: Updated from source on branch. + * config/arm/tm-arm.h: Updated from source on branch. + * arm-tdep.c: Updated from source on branch. + + * rdi-share: New directory, RDI library contributed by ARM. + +Mon Jan 5 20:21:59 1998 Mark Alexander + + * monitor.h (MO_PRINT_PROGRAM_OUTPUT): Define. + * monitor.c (monitor_wait): Echo program output. + * dve3900-rom.c (_initialize_r3900_rom): Remove MO_HANDLE_NL flag, + add MO_PRINT_PROGRAM_OUTPUT flag. + +Mon Jan 5 18:21:11 1998 David Taylor + + * top.h (HAVE_SIGSETJMP): define SIGJMP_BUF, SIGSETJMP, and + SIGLONGJMP appropriately based on whether HAVE_SIGSETJMP is + defined. + * top.c (return_to_top_level, catch_errors): use the new macros + * main.c (SET_TOP_LEVEL): ditto. + * config/xm-sysv4.h (HAVE_SIGSETJMP): Define. + +Fri Jan 2 18:48:58 1998 Mark Alexander + + * configure.in: Double up brackets in shell case pattern. + +Fri Jan 2 17:06:05 1998 Michael Snyder (msnyder@cleaver.cygnus.com) + + * tracepoint.c (finish_tfind_command): improved algorithm for + deciding when we've "stepped" into a new stack frame. + (map_args_over_tracepoints): loop over tracepoint list "safely", + since list elements may be deleted during loop. + (read_actions): add actions to history list. + +For older changes see ChangeLog-97 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/gdb/gdb/Makefile.in b/contrib/gdb/gdb/Makefile.in index 77ef7f2..2c6dfb5 100644 --- a/contrib/gdb/gdb/Makefile.in +++ b/contrib/gdb/gdb/Makefile.in @@ -1,4 +1,4 @@ -# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 +# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998 # Free Software Foundation, Inc. # This file is part of GDB. @@ -23,12 +23,12 @@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ target_alias = @target_alias@ program_transform_name = @program_transform_name@ -bindir = $(exec_prefix)/bin -libdir = $(exec_prefix)/lib +bindir = @bindir@ +libdir = @libdir@ tooldir = $(libdir)/$(target_alias) -datadir = $(prefix)/lib -mandir = $(prefix)/man +datadir = @datadir@ +mandir = @mandir@ man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 man3dir = $(mandir)/man3 @@ -38,11 +38,14 @@ man6dir = $(mandir)/man6 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 man9dir = $(mandir)/man9 -infodir = $(prefix)/info -includedir = $(prefix)/include -docdir = $(datadir)/doc +infodir = @infodir@ +includedir = @includedir@ -SHELL = /bin/sh +# This can be referenced by `INTLDEPS' as computed by CY_GNU_GETTEXT. +top_builddir = . + +SHELL = @SHELL@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -51,11 +54,20 @@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ AR_FLAGS = qv RANLIB = @RANLIB@ -AWK = @AWK@ +DLLTOOL = @DLLTOOL@ +WINDRES = @WINDRES@ + +# If the user configured GDB to include the TUI, the name of the tui +# library goes here. +TUI_LIBRARY = @TUI_LIBRARY@ + +# If the user configured GDB to include the TUI, the all-tui +# target goes here. +BUILD_TUI = @BUILD_TUI@ # Flags that describe where you can find the termcap library. # This can be overridden in the host Makefile fragment file. -TERMCAP = -ltermcap +TERMCAP = @TERM_LIB@ # If you are compiling with GCC, make sure that either 1) You have the # fixed include files where GCC can reach them, or 2) You use the @@ -70,6 +82,8 @@ VPATH = @srcdir@ YACC=@YACC@ +YLWRAP = $(srcdir)/../ylwrap + # where to find makeinfo, preferably one designed for texinfo-2 MAKEINFO=makeinfo @@ -87,17 +101,9 @@ INCLUDE_CFLAGS = -I$(INCLUDE_DIR) # Where is the "-liberty" library? Typically in ../libiberty. LIBIBERTY = ../libiberty/libiberty.a -# Where is the MMALLOC library? Typically in ../mmalloc. -# Note that mmalloc can still be used on systems without mmap(). -# To use your system malloc, comment out the following defines. -MMALLOC_DIR = ../mmalloc -MMALLOC_SRC = $(srcdir)/$(MMALLOC_DIR) -MMALLOC = $(MMALLOC_DIR)/libmmalloc.a -# To use your system malloc, uncomment MMALLOC_DISABLE. -#MMALLOC_DISABLE = -DNO_MMALLOC -# To use mmalloc but disable corruption checking, uncomment MMALLOC_CHECK -#MMALLOC_CHECK = -DNO_MMALLOC_CHECK -MMALLOC_CFLAGS = -I$(MMALLOC_SRC) $(MMALLOC_CHECK) $(MMALLOC_DISABLE) +# Configured by the --with-mmalloc option to configure. +MMALLOC = @MMALLOC@ +MMALLOC_CFLAGS = @MMALLOC_CFLAGS@ # Where is the BFD library? Typically in ../bfd. BFD_DIR = ../bfd @@ -109,7 +115,21 @@ BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) READLINE_DIR = ../readline READLINE = $(READLINE_DIR)/libreadline.a READLINE_SRC = $(srcdir)/$(READLINE_DIR) -READLINE_CFLAGS = -I$(READLINE_SRC) +READLINE_CFLAGS = -I$(READLINE_SRC)/.. + +WARN_CFLAGS = @WARN_CFLAGS@ + +# Where is the INTL library? Typically in ../intl. +INTL_DIR = ../intl +INTL = @INTLLIBS@ +INTL_DEPS = @INTLDEPS@ +INTL_SRC = $(srcdir)/$(INTL_DIR) +INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC) + +# Where is the TUI library? Typically in tui/. +TUI_DIR=tui +TUI_SRC = $(srcdir)/$(TUI_DIR) +TUI_CFLAGS= -I$(TUI_SRC) # Opcodes currently live in one of two places. Either they are in the # opcode library, typically ../opcodes, or they are in a header file @@ -128,8 +148,6 @@ SIM = ENABLE_CFLAGS= @ENABLE_CFLAGS@ -ENABLE_CLIBS= @ENABLE_CLIBS@ -ENABLE_OBS= @ENABLE_OBS@ # -I. for config files. # -I$(srcdir) for gdb internal headers and possibly for gnu-regex.h also. @@ -158,7 +176,8 @@ CXXFLAGS = -g -O # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. INTERNAL_CFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \ $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \ - $(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) $(ENABLE_CFLAGS) + $(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \ + $(INTL_CFLAGS) $(TUI_CFLAGS) $(ENABLE_CFLAGS) $(WARN_CFLAGS) # LDFLAGS is specifically reserved for setting from the command line # when running make. @@ -166,7 +185,8 @@ INTERNAL_CFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \ # Profiling options need to go here to work. # I think it's perfectly reasonable for a user to set -pg in CFLAGS # and have it work; that's why CFLAGS is here. -INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(LDFLAGS) +INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(LDFLAGS) @CONFIG_LDFLAGS@ @HLDFLAGS@ +HLDENV = @HLDENV@ # We are using our own version of REGEX now to be consistent across # machines. @@ -179,20 +199,23 @@ REGEX1 = gnu-regex.o # Libraries and corresponding dependencies for compiling gdb. # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs. # TERMCAP comes after readline, since readline depends on it. +# MMALLOC comes after anything else that might want an allocation function. +# LIBIBERTY appears twice on purpose. # If you have the Cygnus libraries installed, # you can use 'CLIBS=$(INSTALLED_LIBS)' 'CDEPS=' -INSTALLED_LIBS=-lbfd -lreadline $(TERMCAP) -lopcodes -lmmalloc -liberty \ - $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(ENABLE_CLIBS) @LIBS@ -CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCODES) $(MMALLOC) $(LIBIBERTY) \ - $(ENABLE_CLIBS) $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) \ - $(LIBIBERTY) @LIBS@ +INSTALLED_LIBS=-lbfd -lreadline -lopcodes -liberty \ + $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ + -lmmalloc -lintl -liberty +CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCODES) $(INTL) $(LIBIBERTY) \ + $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ + $(MMALLOC) $(LIBIBERTY) $(WIN32LIBS) CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ - $(OPCODES) $(MMALLOC) $(LIBIBERTY) + $(OPCODES) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) @CONFIG_DEPS@ ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) -VERSION = 4.16 +VERSION=4.18 DIST=gdb LINT=/usr/5bin/lint @@ -214,7 +237,7 @@ SER_HARDWIRE = ser-unix.o # The `remote' debugging target is supported for most architectures, # but not all (e.g. 960) -REMOTE_OBS = remote.o dcache.o remote-utils.o +REMOTE_OBS = remote.o dcache.o remote-utils.o tracepoint.o ax-general.o ax-gdb.o # This is remote-sim.o if a simulator is to be linked in. SIM_OBS = @@ -239,6 +262,7 @@ FLAGS_TO_PASS = \ "CHILL_LIB=$(CHILL_LIB)" \ "CXX=$(CXX)" \ "CXXFLAGS=$(CXXFLAGS)" \ + "DLLTOOL=$(DLLTOOL)" \ "RANLIB=$(RANLIB)" \ "MAKEINFO=$(MAKEINFO)" \ "INSTALL=$(INSTALL)" \ @@ -330,22 +354,30 @@ TARGET_FLAGS_TO_PASS = \ # Links made at configuration time should not be specified here, since # SFILES is used in building the distribution archive. -SFILES = bcache.c blockframe.c breakpoint.c buildsym.c callback.c c-exp.y \ - c-lang.c c-typeprint.c c-valprint.c ch-exp.c ch-lang.c \ - ch-typeprint.c ch-valprint.c coffread.c command.c complaints.c \ - corefile.c cp-valprint.c dbxread.c demangle.c dwarfread.c \ - elfread.c environ.c eval.c expprint.c \ - f-exp.y f-lang.c f-typeprint.c f-valprint.c findvar.c \ - gdbtypes.c infcmd.c inflow.c infrun.c language.c \ +SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ + buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \ + ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c coffread.c \ + command.c complaints.c corefile.c cp-valprint.c dbxread.c \ + demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \ + expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \ + findvar.c gdbarch.c gdbtypes.c infcmd.c inflow.c infrun.c language.c \ + jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \ m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \ mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \ - printcmd.c remote.c remote-nrom.c scm-exp.c scm-lang.c scm-valprint.c \ - source.c stabsread.c stack.c symfile.c symmisc.c \ - symtab.c target.c thread.c top.c \ - typeprint.c utils.c valarith.c valops.c \ - valprint.c values.c serial.c ser-unix.c mdebugread.c os9kread.c - -LINTFILES = $(SFILES) $(YYFILES) init.c + printcmd.c remote.c remote-nrom.c scm-exp.c scm-lang.c \ + scm-valprint.c source.c stabsread.c stack.c symfile.c \ + symmisc.c symtab.c target.c thread.c top.c tracepoint.c \ + typeprint.c utils.c valarith.c valops.c valprint.c values.c \ + serial.c ser-unix.c mdebugread.c os9kread.c \ + tui/tui.c tui/tui.h tui/tuiCommand.c tui/tuiCommand.h \ + tui/tuiData.c tui/tuiData.h tui/tuiDataWin.c tui/tuiDataWin.h \ + tui/tuiDisassem.c tui/tuiDisassem.h tui/tuiGeneralWin.c \ + tui/tuiGeneralWin.h tui/tuiIO.c tui/tuiIO.h tui/tuiLayout.c \ + tui/tuiLayout.h tui/tuiRegs.c tui/tuiRegs.h tui/tuiSource.c \ + tui/tuiSource.h tui/tuiSourceWin.c tui/tuiSourceWin.h \ + tui/tuiStack.c tui/tuiStack.h tui/tuiWin.c tui/tuiWin.h + +LINTFILES = $(SFILES) $(YYFILES) @CONFIG_SRCS@ init.c # "system" headers. Using these in dependencies is a rather personal # choice. (-rich, summer 1993) @@ -357,9 +389,11 @@ floatformat_h = $(INCLUDE_DIR)/floatformat.h bfd_h = $(BFD_DIR)/bfd.h wait_h = $(INCLUDE_DIR)/wait.h dis-asm_h = $(INCLUDE_DIR)/dis-asm.h +remote-sim_h = $(INCLUDE_DIR)/remote-sim.h dcache_h = dcache.h -remote_utils_h = $(dcache_h) serial.h target.h remote-utils.h remote-sim.h +remote_utils_h = $(dcache_h) serial.h target.h remote-utils.h $(remote-sim_h) + readline_headers = \ $(READLINE_SRC)/chardefs.h \ @@ -388,9 +422,11 @@ breakpoint_h = breakpoint.h $(frame_h) $(value_h) command_h = command.h gdbcmd_h = gdbcmd.h $(command_h) -defs_h = defs.h xm.h tm.h nm.h config.status config.h +defs_h = defs.h xm.h tm.h nm.h config.status config.h gdbarch.h inferior_h = inferior.h $(breakpoint_h) +tracepoint_h = tracepoint.h +ax_h = ax.h # Header files that need to have srcdir added. Note that in the cases # where we use a macro like $(gdbcmd_h), things are carefully arranged @@ -400,18 +436,20 @@ inferior_h = inferior.h $(breakpoint_h) HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \ dst.h environ.h $(gdbcmd_h) gdbcore.h \ - gdb-stabs.h $(inferior_h) language.h minimon.h monitor.h \ + gdb-stabs.h hpread.h $(inferior_h) language.h minimon.h monitor.h \ objfiles.h parser-defs.h partial-stab.h serial.h signals.h solib.h \ symfile.h stabsread.h target.h terminal.h typeprint.h xcoffsolib.h \ - c-lang.h ch-lang.h f-lang.h m2-lang.h \ + c-lang.h ch-lang.h f-lang.h \ + jv-lang.h \ + m2-lang.h \ complaints.h valprint.h \ 29k-share/udi/udiids.h 29k-share/udi_soc nindy-share/b.out.h \ nindy-share/block_io.h nindy-share/coff.h \ nindy-share/env.h nindy-share/stop.h \ vx-share/dbgRpcLib.h vx-share/ptrace.h vx-share/vxTypes.h \ vx-share/vxWorks.h vx-share/wait.h vx-share/xdr_ld.h \ - vx-share/xdr_ptrace.h vx-share/xdr_rdb.h thread.h \ - dcache.h remote-utils.h remote-sim.h top.h somsolib.h + vx-share/xdr_ptrace.h vx-share/xdr_rdb.h gdbthread.h \ + dcache.h remote-utils.h top.h somsolib.h # Header files that already have srcdir in them, or which are in objdir. @@ -432,9 +470,9 @@ POSSLIBS = gnu-regex.c gnu-regex.h # Makefile.in DEPFILES = $(TDEPFILES) $(XDEPFILES) $(SER_HARDWIRE) $(NATDEPFILES) \ - $(REMOTE_OBS) $(SIM_OBS) $(ENABLE_OBS) + $(REMOTE_OBS) $(SIM_OBS) @CONFIG_OBS@ -SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) +SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) @CONFIG_SRCS@ # Don't include YYFILES (*.tab.c) because we already include *.y in SFILES, # and it's more useful to see it in the .y file. TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \ @@ -444,16 +482,18 @@ TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR) COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \ source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \ symtab.o symfile.o symmisc.o infcmd.o infrun.o command.o \ - expprint.o environ.o gdbtypes.o copying.o $(DEPFILES) \ + expprint.o environ.o gdbarch.o gdbtypes.o copying.o $(DEPFILES) \ mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \ exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \ dbxread.o coffread.o elfread.o \ - dwarfread.o mipsread.o stabsread.o corefile.o \ - c-lang.o ch-exp.o ch-lang.o f-lang.o m2-lang.o \ + dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \ + c-lang.o ch-exp.o ch-lang.o f-lang.o \ + jv-lang.o jv-valprint.o jv-typeprint.o \ + m2-lang.o \ scm-exp.o scm-lang.o scm-valprint.o complaints.o typeprint.o \ c-typeprint.o ch-typeprint.o f-typeprint.o m2-typeprint.o \ c-valprint.o cp-valprint.o ch-valprint.o f-valprint.o m2-valprint.o \ - nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o callback.o + nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o OBS = $(COMMON_OBS) $(ANNOTATE_OBS) main.o @@ -465,11 +505,17 @@ NTSOBS = standalone.o NTSSTART = kdb-start.o -SUBDIRS = doc testsuite nlm +SUBDIRS = doc \ + testsuite \ + nlm # For now, shortcut the "configure GDB for fewer languages" stuff. -YYFILES = c-exp.tab.c f-exp.tab.c m2-exp.tab.c -YYOBJ = c-exp.tab.o f-exp.tab.o m2-exp.tab.o +YYFILES = c-exp.tab.c \ + jv-exp.tab.c \ + f-exp.tab.c m2-exp.tab.c +YYOBJ = c-exp.tab.o \ + jv-exp.tab.o \ + f-exp.tab.o m2-exp.tab.o # Things which need to be built when making a distribution. @@ -480,7 +526,7 @@ DISTSTUFF = $(YYFILES) .c.o: $(CC) -c $(INTERNAL_CFLAGS) $< -all: gdb +all: gdb$(EXEEXT) @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do installcheck: @@ -517,7 +563,7 @@ install-only: else \ true ; \ fi ; \ - $(INSTALL_PROGRAM) gdb $(bindir)/$$transformed_name ; \ + $(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \ $(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1 @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do @@ -529,7 +575,7 @@ uninstall: force else \ true ; \ fi ; \ - rm -f $(bindir)/$$transformed_name $(man1dir)/$$transformed_name.1 + rm -f $(bindir)/$$transformed_name$(EXEEXT) $(man1dir)/$$transformed_name.1 @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do # We do this by grepping through sources. If that turns out to be too slow, @@ -548,10 +594,12 @@ init.c: $(OBS) $(TSOBS) @rm -f init.c-tmp @echo '/* Do not modify this file. */' >init.c-tmp @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp - @echo 'void initialize_all_files () {' >>init.c-tmp - @for i in $(OBS) $(TSOBS); do \ - filename=`echo $$i | sed \ - -e '/^Onindy.o/d' \ + @echo '#include "ansidecl.h"' >>init.c-tmp + @echo 'extern void initialize_all_files PARAMS ((void));' >>init.c-tmp + @echo 'void initialize_all_files PARAMS ((void)) {' >>init.c-tmp + @-echo $(OBS) $(TSOBS) | \ + tr ' ' '\012' | \ + sed -e '/^Onindy.o/d' \ -e '/^nindy.o/d' \ -e '/ttyflush.o/d' \ -e '/xdr_ld.o/d' \ @@ -563,23 +611,20 @@ init.c: $(OBS) $(TSOBS) -e '/version.o/d' \ -e '/^[a-z0-9A-Z_]*_[SU].o/d' \ -e '/[a-z0-9A-Z_]*-exp.tab.o/d' \ - -e 's/\.o/.c/'` ; \ - case $$filename in \ - "") ;; \ - *) sed <$(srcdir)/$$filename >>init.c-tmp -n \ - -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (); \1 ();}/p' ; ;; \ - esac ; \ - done + -e 's/\.o/.c/' \ + -e 's|\([^ ][^ ]*\)|$(srcdir)/\1|g' | \ + while read f; do grep '^_initialize_[a-z_0-9A-Z]* *(' $$f 2>/dev/null; done | \ + sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 PARAMS ((void)); \1 ();}/' >>init.c-tmp @echo '}' >>init.c-tmp @mv init.c-tmp init.c .PRECIOUS: init.c # Removing the old gdb first works better if it is running, at least on SunOS. -gdb: $(OBS) $(TSOBS) $(ADD_DEPS) $(CDEPS) init.o - rm -f gdb - $(CC_LD) $(INTERNAL_LDFLAGS) -o gdb \ - init.o $(OBS) $(TSOBS) $(ADD_FILES) $(CLIBS) $(LOADLIBES) +gdb$(EXEEXT): $(OBS) $(BUILD_TUI) $(TSOBS) $(ADD_DEPS) $(CDEPS) init.o + rm -f gdb$(EXEEXT) + $(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -o gdb$(EXEEXT) \ + init.o $(OBS) $(TSOBS) $(TUI_LIBRARY) $(ADD_FILES) $(CLIBS) $(LOADLIBES) nlm: force rootme=`pwd`; export rootme; $(MAKE) $(TARGET_FLAGS_TO_PASS) DO=all DODIRS=nlm subdir_do @@ -602,16 +647,21 @@ libgdb-files: $(LIBGDBDEPS) Makefile.in saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c #setopt load_flags $(CFLAGS) $(BFD_CFLAGS) -DHOST_SYS=SUN4_SYS #load ./init.c $(SFILES) - #unload $(srcdir)/c-exp.y $(srcdir)/m2-exp.y + #unload $(srcdir)/c-exp.y + #unload $(srcdir)/jv-exp.y + #unload $(srcdir)/m2-exp.y #unload vx-share/*.h #unload nindy-share/[A-Z]* - #load c-exp.tab.c m2-exp.tab.c + #load c-exp.tab.c + #load jv-exp.tab.c + #load m2-exp.tab.c #load copying.c version.c #load ../opcodes/libopcodes.a #load ../libiberty/libiberty.a #load ../bfd/libbfd.a #load ../readline/libreadline.a #load ../mmalloc/libmmalloc.a + #load ../intl/libintl.a #load -ltermcap #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'` echo "Load .c corresponding to:" $(DEPFILES) @@ -628,25 +678,9 @@ stop-gdb: stop-gdb.o # gdb and put a copy in gdb1, and you can run it with "gdb gdb1". # Removing gdb1 before the copy is the right thing if gdb1 is open # in another process. -gdb1: gdb - rm -f gdb1 - cp gdb gdb1 - -### fixme - this can't be right. -# This checks the configure.in file versus the config/ directory. -config-check: config-check-hosts config-check-targets -config-check-hosts: - grep gdb_host= $(srcdir)/configure.in | \ - sed -e 's/.*gdb_host=//' -e 's/ ;;$$/.mh/' | sort -u >HOSTconf.o - (cd $(srcdir)/config; ls *.mh) >HOSTdir.o - diff -u HOSTconf.o HOSTdir.o - -### fixme - nor can this. -config-check-targets: - grep gdb_target= $(srcdir)/configure.in | \ - sed -e 's/.*gdb_target=//' -e 's/ ;;$$/.mh/' | sort -u >TARGconf.o - (cd $(srcdir)/config; ls *.mt) >TARGdir.o - diff -u HOSTconf.o HOSTdir.o +gdb1$(EXEEXT): gdb$(EXEEXT) + rm -f gdb1$(EXEEXT) + cp gdb$(EXEEXT) gdb1$(EXEEXT) # FIXME. These are not generated by "make depend" because they only are there # for some machines. @@ -666,6 +700,13 @@ kdb: $(NTSSTART) $(OBS) $(NTSOBS) $(ADD_DEPS) $(CDEPS) ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \ -lc $(CLIBS) +# Have the TUI library depend on a phony target, so we'll always +# recurse and make sure it's up to date. If it is, then the file will +# be unchanged, and we won't rebuild it. +# .PHONY: check-tui +all-tui: + @(cd tui; ${MAKE} ${FLAGS_TO_PASS} all) + # Put the proper machine-specific files first, so M-. on a machine # specific routine gets the one for the correct machine. (FIXME: those # files go in twice; we should be removing them from the main list). @@ -689,10 +730,10 @@ tags: TAGS clean mostlyclean: @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do - rm -f *.o $(ADD_FILES) *~ init.c-tmp + rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp rm -f init.c version.c - rm -f gdb core make.log libgdb-files - rm -f gdb[0-9] + rm -f gdb$(EXEEXT) core make.log libgdb-files + rm -f gdb[0-9]$(EXEEXT) # This used to depend on c-exp.tab.c m2-exp.tab.c TAGS # I believe this is wrong; the makefile standards for distclean just @@ -700,21 +741,27 @@ clean mostlyclean: # functionality described is if the distributed files are unmodified. distclean: clean @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(SUBDIRS)" subdir_do - rm -f nm.h tm.h xm.h config.status config.h stamp-h + rm -f nm.h tm.h xm.h config.status config.h stamp-h .gdbinit rm -f y.output yacc.acts yacc.tmp y.tab.h rm -f config.log config.cache rm -f Makefile -maintainer-clean realclean: clean +maintainer-clean: local-maintainer-clean do-maintainer-clean distclean +realclean: maintainer-clean + +local-maintainer-clean: @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - @$(MAKE) $(FLAGS_TO_PASS) DO=maintainer-clean "DODIRS=$(SUBDIRS)" subdir_do - rm -f c-exp.tab.c f-exp.tab.c m2-exp.tab.c + rm -f c-exp.tab.c \ + jv-exp.tab \ + f-exp.tab.c m2-exp.tab.c rm -f TAGS $(INFOFILES) + rm -f $(YYFILES) rm -f nm.h tm.h xm.h config.status - rm -f y.output yacc.acts yacc.tmp - rm -f config.log config.cache - rm -f Makefile + +do-maintainer-clean: + @$(MAKE) $(FLAGS_TO_PASS) DO=maintainer-clean "DODIRS=$(SUBDIRS)" \ + subdir_do diststuff: $(DISTSTUFF) cd doc; $(MAKE) $(MFLAGS) all-doc @@ -777,28 +824,44 @@ version.c: Makefile # Makefile.in, but that was a pretty big annoyance. c-exp.tab.o: c-exp.tab.c c-exp.tab.c: c-exp.y - $(YACC) $(YFLAGS) $(srcdir)/c-exp.y + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/c-exp.y y.tab.c c-exp.tmp -- $(YFLAGS) -sed -e '/extern.*malloc/d' \ -e '/extern.*realloc/d' \ -e '/extern.*free/d' \ -e '/include.*malloc.h/d' \ -e 's/malloc/xmalloc/g' \ -e 's/realloc/xrealloc/g' \ - < y.tab.c > c-exp.new - -rm y.tab.c + -e '/^#line.*y.tab.c/d' \ + < c-exp.tmp > c-exp.new + -rm c-exp.tmp mv c-exp.new ./c-exp.tab.c +jv-exp.tab.o: jv-exp.tab.c +jv-exp.tab.c: jv-exp.y + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/jv-exp.y y.tab.c jv-exp.tmp -- $(YFLAGS) + -sed -e '/extern.*malloc/d' \ + -e '/extern.*realloc/d' \ + -e '/extern.*free/d' \ + -e '/include.*malloc.h/d' \ + -e 's/malloc/xmalloc/g' \ + -e 's/realloc/xrealloc/g' \ + -e '/^#line.*y.tab.c/d' \ + < jv-exp.tmp > jv-exp.new + -rm jv-exp.tmp + mv jv-exp.new ./jv-exp.tab.c + f-exp.tab.o: f-exp.tab.c f-exp.tab.c: f-exp.y c-exp.tab.c - $(YACC) $(YFLAGS) $(srcdir)/f-exp.y + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/f-exp.y y.tab.c f-exp.tmp -- $(YFLAGS) -sed -e '/extern.*malloc/d' \ -e '/extern.*realloc/d' \ -e '/extern.*free/d' \ -e '/include.*malloc.h/d' \ -e 's/malloc/xmalloc/g' \ -e 's/realloc/xrealloc/g' \ - < y.tab.c > f-exp.new - -rm y.tab.c + -e '/^#line.*y.tab.c/d' \ + < f-exp.tmp > f-exp.new + -rm f-exp.tmp mv f-exp.new ./f-exp.tab.c # m2-exp.tab.c is generated in objdir from m2-exp.y if it doesn't exist @@ -807,19 +870,21 @@ f-exp.tab.c: f-exp.y c-exp.tab.c # else. m2-exp.tab.o: m2-exp.tab.c m2-exp.tab.c: m2-exp.y - $(YACC) $(YFLAGS) $(srcdir)/m2-exp.y + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/m2-exp.y y.tab.c m2-exp.tmp -- $(YFLAGS) -sed -e '/extern.*malloc/d' \ -e '/extern.*realloc/d' \ -e '/extern.*free/d' \ -e '/include.*malloc.h/d' \ -e 's/malloc/xmalloc/g' \ -e 's/realloc/xrealloc/g' \ - < y.tab.c > m2-exp.new - -rm y.tab.c + -e '/^#line.*y.tab.c/d' \ + < m2-exp.tmp > m2-exp.new + -rm m2-exp.tmp mv m2-exp.new ./m2-exp.tab.c # These files are updated atomically, so make never has to remove them .PRECIOUS: m2-exp.tab.c f-exp.tab.c c-exp.tab.c +.PRECIOUS: jv-exp.tab.c lint: $(LINTFILES) $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \ @@ -856,7 +921,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \ dcache.c delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \ go32-xdep.c gould-tdep.c gould-xdep.c h8300-tdep.c h8500-tdep.c \ hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c \ - hpread.c \ + hp-psymtab-read.c hp-symtab-read.c \ i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c \ i386aix-nat.c i386m3-nat.c i386v4-nat.c i386ly-tdep.c \ i387-tdep.c \ @@ -877,7 +942,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \ remote-st.c remote-utils.c dcache.c \ remote-udi.c remote-vx.c remote-vx29k.c \ rs6000-nat.c rs6000-tdep.c \ - ser-go32.c ser-tcp.c sh-tdep.c solib.c sparc-nat.c \ + ser-go32.c ser-ocd.c ser-tcp.c sh-tdep.c solib.c sparc-nat.c \ sparc-tdep.c sparcl-tdep.c sun3-nat.c sun386-nat.c \ symm-tdep.c symm-nat.c \ tahoe-tdep.c ultra3-nat.c ultra3-xdep.c umax-xdep.c \ @@ -886,73 +951,6 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \ win32-nat.c \ xcoffread.c xcoffsolib.c z8k-tdep.c -ALLCONFIG = config/a29k/a29k-kern.mt config/a29k/a29k-udi.mt config/a29k/vx29k.mt\ - config/a29k/a29k.mt config/a29k/ultra3.mh config/a29k/ultra3.mt \ - config/alpha/alpha-osf1.mh config/alpha/alpha-osf2.mh \ - config/alpha/alpha-osf1.mt config/alpha/alpha-nw.mt \ - config/arm/arm.mh config/arm/arm.mt config/convex/convex.mh \ - config/convex/convex.mt config/gould/np1.mh config/gould/np1.mt \ - config/gould/pn.mh config/gould/pn.mt config/h8300/h8300hms.mt \ - config/h8500/h8500hms.mt config/i386/go32.mh config/i386/i386aix.mh \ - config/i386/i386aix.mt config/i386/i386aout.mt config/i386/i386bsd.mh \ - config/i386/i386bsd.mt config/i386/i386lynx.mh \ - config/i386/i386lynx.mt config/i386/i386m3.mh config/i386/i386m3.mt \ - config/i386/i386mach.mh config/i386/i386mk.mh config/i386/i386mk.mt \ - config/i386/i386nw.mt config/i386/i386sco.mh \ - config/i386/i386sco4.mh \ - config/i386/i386sol2.mh config/i386/i386sol2.mt config/i386/i386v.mh \ - config/i386/i386v.mt config/i386/i386v32.mh config/i386/i386v4.mh \ - config/i386/i386v4.mt config/i386/linux.mh config/i386/linux.mt \ - config/i386/ncr3000.mh config/i386/ncr3000.mt config/i386/ptx.mh \ - config/i386/sun386.mh \ - config/i386/sun386.mt config/i386/symmetry.mh config/i386/symmetry.mt \ - config/i386/win32.mh config/i386/win32.mt \ - config/i960/mon960.mt \ - config/i960/nindy960.mt config/i960/vxworks960.mt config/m68k/3b1.mh \ - config/m68k/3b1.mt config/m68k/altos.mh config/m68k/altos.mt \ - config/m68k/amix.mh config/m68k/amix.mt config/m68k/apollo68b.mh \ - config/m68k/apollo68b.mt \ - config/m68k/apollo68v.mh \ - config/m68k/cisco.mt config/m68k/delta68.mh \ - config/m68k/delta68.mt config/m68k/dpx2.mh config/m68k/dpx2.mt \ - config/m68k/es1800.mt config/m68k/hp300bsd.mh \ - config/m68k/hp300bsd.mt config/m68k/hp300hpux.mh \ - config/m68k/hp300hpux.mt config/m68k/isi.mh config/m68k/isi.mt \ - config/m68k/m68klynx.mh config/m68k/m68klynx.mt \ - config/m68k/monitor.mt \ - config/m68k/news.mh config/m68k/news.mt config/m68k/news1000.mh \ - config/m68k/os68k.mt config/m68k/st2000.mt config/m68k/sun2os3.mh \ - config/m68k/sun2os3.mt config/m68k/sun2os4.mh config/m68k/sun2os4.mt \ - config/m68k/sun3os3.mh config/m68k/sun3os3.mt config/m68k/sun3os4.mh \ - config/m68k/sun3os4.mt config/m68k/vxworks68.mt config/m88k/delta88.mh \ - config/m88k/delta88.mt config/m88k/delta88v4.mh \ - config/m88k/delta88v4.mt config/m88k/m88k.mh config/m88k/m88k.mt \ - config/mips/bigmips.mt config/mips/bigmips64.mt \ - config/mips/decstation.mh \ - config/mips/decstation.mt config/mips/idt.mt config/mips/idtl.mt \ - config/mips/idt64.mt config/mips/idtl64.mt \ - config/mips/irix3.mh config/mips/irix3.mt config/mips/irix4.mh \ - config/mips/irix5.mh config/mips/irix5.mt \ - config/mips/littlemips.mh config/mips/littlemips.mt \ - config/mips/mipsel64.mt \ - config/mips/mipsm3.mh config/mips/mipsm3.mt \ - config/mips/mipsv4.mh config/mips/mipsv4.mt \ - config/mips/news-mips.mh config/mips/riscos.mh \ - config/none/none.mh config/none/none.mt config/ns32k/merlin.mh \ - config/ns32k/merlin.mt config/ns32k/ns32km3.mh config/ns32k/ns32km3.mt \ - config/ns32k/umax.mh config/ns32k/umax.mt \ - config/pa/hppabsd.mh config/pa/hppabsd.mt config/pa/hppahpux.mh \ - config/pa/hppahpux.mt config/pyr/pyramid.mh config/pyr/pyramid.mt \ - config/romp/rtbsd.mh config/rs6000/rs6000.mh config/rs6000/rs6000.mt \ - config/sh/sh.mt config/sparc/sparc-em.mt config/sparc/sparclite.mt \ - config/sparc/sparclynx.mh config/sparc/sparclynx.mt \ - config/sparc/sun4os4.mh config/sparc/sun4os4.mt \ - config/sparc/sun4sol2.mh config/sparc/sun4sol2.mt \ - config/sparc/vxsparc.mt config/tahoe/tahoe.mh config/tahoe/tahoe.mt \ - config/vax/vax.mt config/vax/vaxbsd.mh config/vax/vaxult.mh \ - config/vax/vaxult2.mh config/z8k/z8ksim.mt - - udip2soc.o: $(srcdir)/29k-share/udi/udip2soc.c $(udiheaders) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/29k-share/udi/udip2soc.c @@ -975,7 +973,8 @@ altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) annotate.o: annotate.c $(defs_h) annotate.h $(value_h) target.h $(gdbtypes_h) -arm-tdep.o: arm-tdep.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) +arm-tdep.o: arm-tdep.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \ + $(gdbcore_h) bcache.o: bcache.c bcache.h $(defs_h) @@ -983,13 +982,11 @@ blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \ objfiles.h symfile.h target.h breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) language.h target.h thread.h gdb_string.h + $(inferior_h) language.h target.h gdbthread.h gdb_string.h buildsym.o: buildsym.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ objfiles.h symfile.h $(symtab_h) gdb_string.h -callback.o: callback.c $(defs_h) callback.h - c-lang.o: c-lang.c c-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \ language.h parser-defs.h $(symtab_h) @@ -1054,12 +1051,12 @@ corefile.o: corefile.c $(dis-asm_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ $(inferior_h) target.h language.h gdb_string.h corelow.o: corelow.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ - target.h thread.h gdb_string.h + target.h gdbthread.h gdb_string.h cp-valprint.o: cp-valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ $(gdbtypes_h) $(symtab_h) $(value_h) gdb_string.h -dcache.o: dcache.c $(dcache_h) $(defs_h) $(gdbcmd_h) gdb_string.h +dcache.o: dcache.c $(dcache_h) $(defs_h) $(gdbcmd_h) gdb_string.h $(gdbcore_h) dbxread.o: dbxread.c $(breakpoint_h) buildsym.h $(command_h) \ complaints.h $(defs_h) $(expression_h) gdb-stabs.h $(gdbcore_h) \ @@ -1070,6 +1067,9 @@ delta68-nat.o: delta68-nat.c $(defs_h) demangle.o: demangle.c $(defs_h) $(gdbcmd_h) gdb_string.h +dink32-rom.o: dink32-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \ + $(inferior_h) target.h serial.h terminal.h + dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) gdb_string.h dstread.o: dstread.c gdb_string.h @@ -1078,8 +1078,13 @@ dwarfread.o: dwarfread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ $(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \ $(symtab_h) gdb_string.h +dwarf2read.o: dwarf2read.c $(bfd_h) buildsym.h $(defs_h) \ + $(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \ + $(symtab_h) gdb_string.h + elfread.o: elfread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ - gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h + gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h \ + $(BFD_SRC)/elf-bfd.h $(INCLUDE_DIR)/elf/mips.h environ.o: environ.c $(defs_h) environ.h $(gdbcore_h) gdb_string.h @@ -1097,19 +1102,27 @@ findvar.o: findvar.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \ gdb_string.h fork-child.o: fork-child.c $(wait_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) target.h terminal.h thread.h gdb_string.h + $(inferior_h) target.h terminal.h gdbthread.h gdb_string.h +tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(tracepoint_h) \ + $(gdbtypes_h) $(expression_h) $(gdbcmd_h) $(value_h) target.h \ + language.h gdb_string.h $(readline_headers) + +gdbarch.o: gdbarch.c $(defs_h) $(bfd_h) $(gdbcmd_h) gdbtypes.o: gdbtypes.c $(bfd_h) complaints.h $(defs_h) $(expression_h) \ $(gdbtypes_h) language.h objfiles.h symfile.h $(symtab_h) target.h \ $(value_h) gdb_string.h +gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \ + exc_request_U.h msg_U.h gnu-nat.h + go32-xdep.o: go32-xdep.c -gould-tdep.o: gould-tdep.c $(OP_INCLUDE)/np1.h $(defs_h) $(frame_h) \ - $(gdbcore_h) $(symtab_h) +# OBSOLETE gould-tdep.o: gould-tdep.c $(OP_INCLUDE)/np1.h $(defs_h) $(frame_h) \ +# OBSOLETE $(gdbcore_h) $(symtab_h) -gould-xdep.o: gould-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) +# OBSOLETE gould-xdep.o: gould-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) @@ -1123,8 +1136,11 @@ hppa-tdep.o: hppa-tdep.c $(wait_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ $(inferior_h) objfiles.h symfile.h target.h hppab-nat.o: hppab-nat.c $(bfd_h) $(defs_h) $(inferior_h) target.h + hppah-nat.o: hppah-nat.c $(bfd_h) $(defs_h) $(inferior_h) target.h +i386gnu-nat.o: gnu-nat.h + i386-tdep.o: i386-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \ gdb_string.h @@ -1135,7 +1151,7 @@ i386b-nat.o: i386b-nat.c $(defs_h) i386ly-nat.o: i386ly-nat.c $(defs_h) $(frame_h) $(inferior_h) target.h -i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(inferior_h) target.h +i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(inferior_h) target.h $(gdbcore_h) i386m3-nat.o: i386m3-nat.c $(defs_h) $(inferior_h) $(floatformat_h) target.h @@ -1150,19 +1166,19 @@ i387-tdep.o: i387-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \ $(inferior_h) language.h i960-tdep.o: i960-tdep.c $(floatformat_h) $(defs_h) $(expression_h) \ - $(frame_h) $(gdbtypes_h) $(symtab_h) $(value_h) + $(frame_h) $(gdbtypes_h) $(symtab_h) $(value_h) $(gdbcore_h) infcmd.o: infcmd.c $(defs_h) environ.h $(gdbcmd_h) $(gdbcore_h) \ $(inferior_h) target.h language.h gdb_string.h inflow.o: inflow.c $(bfd_h) $(command_h) $(defs_h) $(inferior_h) \ - signals.h target.h terminal.h thread.h gdb_string.h + signals.h target.h terminal.h gdbthread.h gdb_string.h infptrace.o: infptrace.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \ gdb_string.h $(wait_h) $(command_h) infrun.o: infrun.c $(wait_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) target.h thread.h gdb_string.h + $(inferior_h) target.h gdbthread.h gdb_string.h inftarg.o: inftarg.c $(wait_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ target.h terminal.h $(command_h) @@ -1174,6 +1190,18 @@ irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) target.h \ isi-xdep.o: isi-xdep.c +jv-lang.o: jv-lang.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) parser-defs.h language.h symfile.h objfiles.h \ + gdb_string.h $(value_h) c-lang.h jv-lang.h $(gdbcore_h) + +jv-typeprint.o: jv-typeprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(INCLUDE_DIR)/demangle.h jv-lang.h gdb_string.h \ + typeprint.h + +jv-valprint.o: jv-valprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(value_h) $(INCLUDE_DIR)/demangle.h valprint.h \ + language.h jv-lang.h c-lang.h + language.o: language.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \ $(gdbcmd_h) $(gdbtypes_h) language.h parser-defs.h $(symtab_h) \ target.h $(value_h) gdb_string.h @@ -1189,15 +1217,19 @@ m2-typeprint.o: m2-typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ $(value_h) gdb_string.h m2-valprint.o: m2-valprint.c $(defs_h) $(gdbtypes_h) $(symtab_h) \ - valprint.h + valprint.h m2-lang.h m3-nat.o: m3-nat.c $(defs_h) $(inferior_h) $(value_h) language.h target.h \ $(wait_h) $(gdbcmd_h) $(gdbcore_h) -m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) +m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \ + $(gdbcore_h) gdb_string.h m68kly-nat.o: m68kly-nat.c $(defs_h) $(frame_h) $(inferior_h) target.h +m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ + $(language_h) $(gdbcore_h) $(floatformat_h) target.h + m88k-nat.o: m88k-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) m88k-tdep.o: m88k-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) @@ -1218,7 +1250,7 @@ mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) os9kread.o: os9kread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \ $(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \ - objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h) \ + objfiles.h stabsread.h symfile.h $(symtab_h) \ target.h gdb_string.h mem-break.o: mem-break.c $(defs_h) @@ -1260,7 +1292,7 @@ ns32km3-nat.o: ns32km3-nat.c $(defs_h) $(inferior_h) ttyflush.o: nindy-share/ttyflush.c $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/ttyflush.c -nindy-tdep.o: nindy-tdep.c $(defs_h) $(frame_h) $(symtab_h) +nindy-tdep.o: nindy-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h) ns32k-tdep.o: ns32k-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h) @@ -1275,13 +1307,29 @@ somread.o: somread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ somsolib.o: somsolib.c $(defs_h) +hpux-thread.o: hpux-thread.c $(defs_h) gdbthread.h target.h inferior.h + $(CC) -c $(INTERNAL_CFLAGS) -I$(srcdir)/osf-share \ + -I$(srcdir)/osf-share/HP800 -I/usr/include/dce $(srcdir)/hpux-thread.c + +# FIXME!!! hpread.o: hpread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h +hp-psymtab-read.o: hp-psymtab-read.c hpread.h $(bfd_h) buildsym.h complaints.h \ + $(defs_h) gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h + +hp-symtab-read.o: hp-symtab-read.c hpread.h $(bfd_h) buildsym.h complaints.h \ + $(defs_h) gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h +# END FIXME!!! + parse.o: parse.c $(command_h) $(defs_h) $(expression_h) $(frame_h) \ $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ gdb_string.h +ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) gdb_string.h $(frame_h) \ + $(inferior_h) $(bfd_h) symfile.h target.h $(wait_h) $(gdbcmd_h) \ + objfiles.h gdb-stabs.h serial.h ocd.h + ppcbug-rom.o: ppcbug-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \ $(inferior_h) target.h serial.h terminal.h @@ -1301,11 +1349,25 @@ gnu-regex.o: gnu-regex.c gnu-regex.h $(defs_h) gdb_string.h remote-adapt.o: remote-adapt.c $(wait_h) $(defs_h) $(gdbcore_h) \ $(inferior_h) target.h terminal.h gdb_string.h -remote-arc.o: remote-arc.c gdb_string.h - remote-array.o: remote-array.c $(wait_h) $(defs_h) $(gdbcore_h) target.h \ gdb_string.h $(command_h) serial.h monitor.h $(remote_utils_h) +remote-rdi.o: remote-rdi.c $(wait_h) $(defs_h) $(gdbcore_h) \ + $(inferior_h) gdb_string.h + +rdi-share/libangsd.a: force + @dir=rdi-share; \ + if [ -f ./$${dir}/Makefile ] ; then \ + r=`pwd`; export r; \ + srcroot=`cd $(srcdir); pwd`; export srcroot; \ + (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \ + else \ + true; \ + fi + +remote-d10v.o: remote-d10v.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \ + $(inferior_h) $(remote_utils_h) symfile.h terminal.h gdb_string.h + remote-rdp.o: remote-rdp.c $(wait_h) $(defs_h) $(gdbcore_h) \ $(inferior_h) gdb_string.h @@ -1340,8 +1402,12 @@ remote-os9k.o: remote-os9k.c $(defs_h) $(gdbcore_h) $(wait_h) \ $(command_h) monitor.h $(remote_utils_h) $(symtab_h) symfile.h \ objfiles.h gdb-stabs.h gdb_string.h +remote-sds.o: remote-sds.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \ + $(inferior_h) $(remote_utils_h) symfile.h terminal.h gdb_string.h + remote-sim.o: remote-sim.c $(wait_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) target.h terminal.h gdb_string.h + $(inferior_h) target.h terminal.h gdb_string.h \ + $(INCLUDE_DIR)/callback.h remote-st.o: remote-st.c $(wait_h) $(defs_h) $(gdbcore_h) serial.h \ target.h gdb_string.h @@ -1360,6 +1426,10 @@ remote-vx29k.o: remote-vx29k.c $(wait_h) complaints.h $(defs_h) $(gdbcmd_h) \ vx-share/ptrace.h vx-share/xdr_ld.h vx-share/xdr_ptrace.h \ vx-share/xdr_rdb.h gdb_string.h +ocd.o: ocd.c ocd.h $(gdbcore_h) gdb_string.h $(frame_h) $(inferior_h) \ + $(bfd_h) symfile.h target.h $(wait_h) $(gdbcmd_h) objfiles.h \ + gdb-stabs.h $(dcache_h) serial.h + remote-utils.o: remote-utils.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ $(inferior_h) $(remote_utils_h) gdb_string.h @@ -1372,7 +1442,8 @@ remote-nrom.o: remote-nrom.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \ rom68k-rom.o: rom68k-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \ $(inferior_h) target.h serial.h terminal.h -rs6000-nat.o: rs6000-nat.c $(bfd_h) $(defs_h) $(inferior_h) target.h +rs6000-nat.o: rs6000-nat.c $(bfd_h) $(defs_h) $(inferior_h) target.h \ + xcoffsolib.h rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ target.h xcoffsolib.h @@ -1381,15 +1452,17 @@ scm-exp.o: $(defs_h) $(value_h) parser-defs.h language.h c-lang.h \ scm-lang.h scm-tags.h scm-lang.o: $(defs_h) $(value_h) parser-defs.h language.h c-lang.h \ - scm-lang.h scm-tags.h gdb_string.h + scm-lang.h scm-tags.h gdb_string.h $(gdbcore_h) scm-valprint.o: $(defs_h) $(value_h) parser-defs.h language.h \ - scm-lang.h valprint.h + scm-lang.h valprint.h $(gdbcore_h) ser-go32.o: ser-go32.c $(defs_h) serial.h ser-mac.o: ser-mac.c $(defs_h) serial.h signals.h +ser-ocd.o: ser-ocd.c $(defs_h) serial.h signals.h gdb_string.h + ser-tcp.o: ser-tcp.c $(defs_h) serial.h signals.h gdb_string.h ser-unix.o: ser-unix.c $(defs_h) serial.h @@ -1417,7 +1490,7 @@ sparc-nat.o: sparc-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(gdbcore_h) \ target.h sparc-tdep.o: sparc-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) objfiles.h symfile.h target.h + $(inferior_h) objfiles.h symfile.h target.h gdb_string.h sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) target.h @@ -1431,7 +1504,12 @@ stabsread.o: stabsread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \ stack.o: stack.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ language.h target.h gdb_string.h +ax-general.o: ax-general.c $(ax_h) $(defs_h) +ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) symfile.h $(gdbtypes_h) \ + $(value_h) $(expression_h) $(command_h) $(ax_h) $(gdbcmd_h) ax-gdb.h + sun3-nat.o: sun3-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) + sun386-nat.o: sun386-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) symfile.o: symfile.c $(breakpoint_h) complaints.h $(defs_h) \ @@ -1439,7 +1517,8 @@ symfile.o: symfile.c $(breakpoint_h) complaints.h $(defs_h) \ language.h objfiles.h symfile.h $(symtab_h) target.h \ gdb_string.h -symm-tdep.o: symm-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) +symm-tdep.o: symm-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) + symm-nat.o: symm-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) symmisc.o: symmisc.c $(bfd_h) $(breakpoint_h) $(command_h) $(defs_h) \ @@ -1457,7 +1536,7 @@ tahoe-tdep.o: tahoe-tdep.c $(OP_INCLUDE)/tahoe.h $(defs_h) \ target.o: target.c $(bfd_h) $(defs_h) $(gdbcmd_h) $(inferior_h) \ objfiles.h symfile.h target.h gdb_string.h -thread.o: thread.c $(defs_h) thread.h $(gdbcmd_h) +thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) top.o: top.c top.h $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \ $(defs_h) $(gdbcmd_h) $(inferior_h) language.h signals.h \ @@ -1468,7 +1547,9 @@ typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ $(value_h) gdb_string.h ultra3-nat.o: ultra3-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) + ultra3-xdep.o: ultra3-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) + umax-xdep.o: umax-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) utils.o: utils.c $(bfd_h) $(defs_h) $(expression_h) $(gdbcmd_h) \ @@ -1484,7 +1565,7 @@ valops.o: valops.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \ valprint.o: valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \ - $(value_h) gdb_string.h + $(value_h) gdb_string.h valprint.h values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdbtypes_h) $(symtab_h) target.h $(value_h) \ @@ -1492,7 +1573,7 @@ values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \ vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h) -w65-tdep.o : w65-tdep.c +w65-tdep.o : w65-tdep.c $(gdbcore_h) win32-nat.o: win32-nat.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \ gdb_string.h @@ -1518,12 +1599,16 @@ xcoffread.o: xcoffread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \ xcoffsolib.o: xcoffsolib.c $(bfd_h) $(defs_h) xcoffsolib.h z8k-tdep.o: z8k-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h) $(frame_h) \ - $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) + $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) $(gdbcore_h) c-exp.tab.o: c-exp.tab.c c-lang.h $(defs_h) $(expression_h) \ $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ $(bfd_h) objfiles.h symfile.h +jv-exp.tab.o: jv-exp.tab.c jv-lang.h $(defs_h) $(expression_h) \ + $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ + $(bfd_h) objfiles.h symfile.h + f-exp.tab.o: f-exp.tab.c f-lang.h $(defs_h) $(expression_h) \ language.h parser-defs.h $(value_h) $(bfd_h) objfiles.h symfile.h diff --git a/contrib/gdb/gdb/NEWS b/contrib/gdb/gdb/NEWS index 979a878..e6aaba3 100644 --- a/contrib/gdb/gdb/NEWS +++ b/contrib/gdb/gdb/NEWS @@ -1,6 +1,279 @@ What has changed in GDB? (Organized release by release) +*** Changes in GDB-4.18: + +* New native configurations + +HP-UX 10.20 hppa*-*-hpux10.20 +HP-UX 11.x hppa*-*-hpux11.0* +M68K Linux m68*-*-linux* + +* New targets + +Fujitsu FR30 fr30-*-elf* +Intel StrongARM strongarm-*-* +Mitsubishi D30V d30v-*-* + +* OBSOLETE configurations + +Gould PowerNode, NP1 np1-*-*, pn-*-* + +Configurations that have been declared obsolete will be commented out, +but the code will be left in place. If there is no activity to revive +these configurations before the next release of GDB, the sources will +be permanently REMOVED. + +* ANSI/ISO C + +As a compatibility experiment, GDB's source files buildsym.h and +buildsym.c have been converted to pure standard C, no longer +containing any K&R compatibility code. We believe that all systems in +use today either come with a standard C compiler, or have a GCC port +available. If this is not true, please report the affected +configuration to bug-gdb@gnu.org immediately. See the README file for +information about getting a standard C compiler if you don't have one +already. + +* Readline 2.2 + +GDB now uses readline 2.2. + +* set extension-language + +You can now control the mapping between filename extensions and source +languages by using the `set extension-language' command. For instance, +you can ask GDB to treat .c files as C++ by saying + set extension-language .c c++ +The command `info extensions' lists all of the recognized extensions +and their associated languages. + +* Setting processor type for PowerPC and RS/6000 + +When GDB is configured for a powerpc*-*-* or an rs6000*-*-* target, +you can use the `set processor' command to specify what variant of the +PowerPC family you are debugging. The command + + set processor NAME + +sets the PowerPC/RS6000 variant to NAME. GDB knows about the +following PowerPC and RS6000 variants: + + ppc-uisa PowerPC UISA - a PPC processor as viewed by user-level code + rs6000 IBM RS6000 ("POWER") architecture, user-level view + 403 IBM PowerPC 403 + 403GC IBM PowerPC 403GC + 505 Motorola PowerPC 505 + 860 Motorola PowerPC 860 or 850 + 601 Motorola PowerPC 601 + 602 Motorola PowerPC 602 + 603 Motorola/IBM PowerPC 603 or 603e + 604 Motorola PowerPC 604 or 604e + 750 Motorola/IBM PowerPC 750 or 750 + +At the moment, this command just tells GDB what to name the +special-purpose processor registers. Since almost all the affected +registers are inaccessible to user-level programs, this command is +only useful for remote debugging in its present form. + +* HP-UX support + +Thanks to a major code donation from Hewlett-Packard, GDB now has much +more extensive support for HP-UX. Added features include shared +library support, kernel threads and hardware watchpoints for 11.00, +support for HP's ANSI C and C++ compilers, and a compatibility mode +for xdb and dbx commands. + +* Catchpoints + +HP's donation includes the new concept of catchpoints, which is a +generalization of the old catch command. On HP-UX, it is now possible +to catch exec, fork, and vfork, as well as library loading. + +This means that the existing catch command has changed; its first +argument now specifies the type of catch to be set up. See the +output of "help catch" for a list of catchpoint types. + +* Debugging across forks + +On HP-UX, you can choose which process to debug when a fork() happens +in the inferior. + +* TUI + +HP has donated a curses-based terminal user interface (TUI). To get +it, build with --enable-tui. Although this can be enabled for any +configuration, at present it only works for native HP debugging. + +* GDB remote protocol additions + +A new protocol packet 'X' that writes binary data is now available. +Default behavior is to try 'X', then drop back to 'M' if the stub +fails to respond. The settable variable `remotebinarydownload' +allows explicit control over the use of 'X'. + +For 64-bit targets, the memory packets ('M' and 'm') can now contain a +full 64-bit address. The command + + set remoteaddresssize 32 + +can be used to revert to the old behaviour. For existing remote stubs +the change should not be noticed, as the additional address information +will be discarded. + +In order to assist in debugging stubs, you may use the maintenance +command `packet' to send any text string to the stub. For instance, + + maint packet heythere + +sends the packet "$heythere#". Note that it is very easy to +disrupt a debugging session by sending the wrong packet at the wrong +time. + +The compare-sections command allows you to compare section data on the +target to what is in the executable file without uploading or +downloading, by comparing CRC checksums. + +* Tracing can collect general expressions + +You may now collect general expressions at tracepoints. This requires +further additions to the target-side stub; see tracepoint.c and +doc/agentexpr.texi for further details. + +* mask-address variable for Mips + +For Mips targets, you may control the zeroing of the upper 32 bits of +a 64-bit address by entering `set mask-address on'. This is mainly +of interest to users of embedded R4xxx and R5xxx processors. + +* Higher serial baud rates + +GDB's serial code now allows you to specify baud rates 57600, 115200, +230400, and 460800 baud. (Note that your host system may not be able +to achieve all of these rates.) + +* i960 simulator + +The i960 configuration now includes an initial implementation of a +builtin simulator, contributed by Jim Wilson. + + +*** Changes in GDB-4.17: + +* New native configurations + +Alpha GNU/Linux alpha*-*-linux* +Unixware 2.x i[3456]86-unixware2* +Irix 6.x mips*-sgi-irix6* +PowerPC GNU/Linux powerpc-*-linux* +PowerPC Solaris powerpcle-*-solaris* +Sparc GNU/Linux sparc-*-linux* +Motorola sysV68 R3V7.1 m68k-motorola-sysv + +* New targets + +Argonaut Risc Chip (ARC) arc-*-* +Hitachi H8/300S h8300*-*-* +Matsushita MN10200 w/simulator mn10200-*-* +Matsushita MN10300 w/simulator mn10300-*-* +MIPS NEC VR4100 mips64*vr4100*{,el}-*-elf* +MIPS NEC VR5000 mips64*vr5000*{,el}-*-elf* +MIPS Toshiba TX39 mips64*tx39*{,el}-*-elf* +Mitsubishi D10V w/simulator d10v-*-* +Mitsubishi M32R/D w/simulator m32r-*-elf* +Tsqware Sparclet sparclet-*-* +NEC V850 w/simulator v850-*-* + +* New debugging protocols + +ARM with RDI protocol arm*-*-* +M68K with dBUG monitor m68*-*-{aout,coff,elf} +DDB and LSI variants of PMON protocol mips*-*-* +PowerPC with DINK32 monitor powerpc{,le}-*-eabi +PowerPC with SDS protocol powerpc{,le}-*-eabi +Macraigor OCD (Wiggler) devices powerpc{,le}-*-eabi + +* DWARF 2 + +All configurations can now understand and use the DWARF 2 debugging +format. The choice is automatic, if the symbol file contains DWARF 2 +information. + +* Java frontend + +GDB now includes basic Java language support. This support is +only useful with Java compilers that produce native machine code. + +* solib-absolute-prefix and solib-search-path + +For SunOS and SVR4 shared libraries, you may now set the prefix for +loading absolute shared library symbol files, and the search path for +locating non-absolute shared library symbol files. + +* Live range splitting + +GDB can now effectively debug code for which GCC has performed live +range splitting as part of its optimization. See gdb/doc/LRS for +more details on the expected format of the stabs information. + +* Hurd support + +GDB's support for the GNU Hurd, including thread debugging, has been +updated to work with current versions of the Hurd. + +* ARM Thumb support + +GDB's ARM target configuration now handles the ARM7T (Thumb) 16-bit +instruction set. ARM GDB automatically detects when Thumb +instructions are in use, and adjusts disassembly and backtracing +accordingly. + +* MIPS16 support + +GDB's MIPS target configurations now handle the MIP16 16-bit +instruction set. + +* Overlay support + +GDB now includes support for overlays; if an executable has been +linked such that multiple sections are based at the same address, GDB +will decide which section to use for symbolic info. You can choose to +control the decision manually, using overlay commands, or implement +additional target-side support and use "overlay load-target" to bring +in the overlay mapping. Do "help overlay" for more detail. + +* info symbol + +The command "info symbol
" displays information about +the symbol at the specified address. + +* Trace support + +The standard remote protocol now includes an extension that allows +asynchronous collection and display of trace data. This requires +extensive support in the target-side debugging stub. Tracing mode +includes a new interaction mode in GDB and new commands: see the +file tracepoint.c for more details. + +* MIPS simulator + +Configurations for embedded MIPS now include a simulator contributed +by Cygnus Solutions. The simulator supports the instruction sets +of most MIPS variants. + +* Sparc simulator + +Sparc configurations may now include the ERC32 simulator contributed +by the European Space Agency. The simulator is not built into +Sparc targets by default; configure with --enable-sim to include it. + +* set architecture + +For target configurations that may include multiple variants of a +basic architecture (such as MIPS and SH), you may now set the +architecture explicitly. "set arch" sets, "info arch" lists +the possible architectures. + *** Changes in GDB-4.16: * New native configurations diff --git a/contrib/gdb/gdb/README b/contrib/gdb/gdb/README index c58bcb7..fd791ce 100644 --- a/contrib/gdb/gdb/README +++ b/contrib/gdb/gdb/README @@ -1,9 +1,12 @@ - README for gdb-4.16 release - Updated 10-Apr-96 by Fred Fish + README for gdb-4.18 release + Updated 4 Apr 1999 by Jim Blandy This is GDB, the GNU source-level debugger. A summary of new features is in the file `NEWS'. +See the GDB home page at http://www.cygnus.com/gdb/ for up to date +release information, mailing list links and archives, etc. + Unpacking and Installation -- quick overview ========================== @@ -11,7 +14,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-4.16 directory. The idea is that a variety of GNU +underneath the gdb-4.18 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 or gas @@ -20,8 +23,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-4.16.tar.gz file, you'll find a directory -called `gdb-4.16', which contains: +When you unpack the gdb-4.18.tar.gz file, you'll find a directory +called `gdb-4.18', which contains: COPYING config.sub* libiberty/ opcodes/ COPYING.LIB configure* mmalloc/ readline/ @@ -33,7 +36,7 @@ called `gdb-4.16', which contains: To build GDB, you can just do: - cd gdb-4.16 + cd gdb-4.18 ./configure make cp gdb/gdb /usr/local/bin/gdb (or wherever you want) @@ -45,6 +48,11 @@ argument, e.g., sun4 or decstation. If you get compiler warnings during this stage, see the `Reporting Bugs' section below; there are a few known problems. +GDB requires an ANSI C compiler. If you do not have an ANSI C +compiler for your system, you may be able to download and install the +GNU CC compiler. It is available via anonymous FTP from ftp.gnu.org, +in /pub/gnu/gcc (as a URL, that's ftp://ftp.gnu.org/pub/gnu/gcc). + GDB can be used as a cross-debugger, running on a machine of one type while debugging a program running on a machine of another type. See below. @@ -52,22 +60,6 @@ while debugging a program running on a machine of another type. See below. More Documentation ****************** - The GDB 4 release includes an already-formatted reference card, -ready for printing with PostScript or Ghostscript, in the `gdb' -subdirectory of the main source directory. (In `gdb-4.16/gdb/refcard.ps'.) -If you can use PostScript or Ghostscript with your printer, you can -print the reference card immediately with `refcard.ps'. - - The release also includes the source for the reference card. You -can format it, using TeX, by typing: - - make refcard.dvi - - The GDB reference card is designed to print in landscape mode on US -"letter" size paper; that is, on a sheet 11 inches wide by 8.5 inches -high. You will need to specify this form of printing as an option to -your DVI output program. - All the documentation for GDB comes as part of the machine-readable distribution. The documentation is written in Texinfo format, which is a documentation system that uses a single source file to produce both @@ -76,27 +68,28 @@ formatting commands to create the on-line version of the 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' subdirectory. The main Info file is -`gdb-VERSION-NUMBER/gdb/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 -standalone `info' program, available as part of the GNU Texinfo -distribution. +this manual in the `gdb/doc' subdirectory. The main Info file is +`gdb-4.18/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 standalone `info' program, +available as part of the GNU Texinfo distribution. If you want to format these Info files yourself, you need one of the -Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'. +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-4.16', in the case of version 4.16), you can make +source directory (`gdb-4.18', in the case of version 4.18), you can make the Info file by typing: - cd gdb - make gdb.info + cd gdb/doc + make info - 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. + 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-4.18/texinfo'. TeX is a typesetting program; it does not print files directly, but produces output files called DVI files. To print a typeset document, @@ -110,11 +103,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-VERSION-NUMBER/texinfo' directory. +`gdb-4.18/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-4.16/gdb') and then type: +the main source directory (for example, to `gdb-4.18/gdb') and then type: make gdb.dvi @@ -130,58 +123,71 @@ 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 4.16 distribution is in the `gdb-4.16' + For example, the GDB version 4.18 distribution is in the `gdb-4.18' directory. That directory contains: -`gdb-4.16/{COPYING,COPYING.LIB}' +`gdb-4.18/{COPYING,COPYING.LIB}' Standard GNU license files. Please read them. -`gdb-4.16/bfd' +`gdb-4.18/bfd' source for the Binary File Descriptor library -`gdb-4.16/config*' +`gdb-4.18/config*' script for configuring GDB, along with other support files -`gdb-4.16/gdb' +`gdb-4.18/gdb' the source specific to GDB itself -`gdb-4.16/include' +`gdb-4.18/include' GNU include files -`gdb-4.16/libiberty' +`gdb-4.18/libiberty' source for the `-liberty' free software library -`gdb-4.16/mmalloc' +`gdb-4.18/mmalloc' source for the GNU memory-mapped malloc package -`gdb-4.16/opcodes' +`gdb-4.18/opcodes' source for the library of opcode tables and disassemblers -`gdb-4.16/readline' +`gdb-4.18/readline' source for the GNU command-line interface -'gdb-4.16/sim' - source for some simulators (z8000, H8/300, H8/500, etc) +`gdb-4.18/sim' + source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc) + +`gdb-4.18/intl' + source for the GNU gettext library, for internationalization. + This is slightly modified from the standalone gettext + distribution you can get from GNU. + +`gdb-4.18/texinfo' + The `texinfo.tex' file, which you need in order to make a printed + manual using TeX. + +`gdb-4.18/etc' + Coding standards, useful files for editing GDB, and other + miscellanea. + +`gdb-4.18/utils' + A grab bag of random utilities. + 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-4.16' directory. +is the `gdb-4.18' directory. First switch to the `gdb-VERSION-NUMBER' source directory if you are -not already in it; then run `configure'. Pass the identifier for the -platform on which GDB will run as an argument. +not already in it; then run `configure'. For example: - cd gdb-4.16 - ./configure HOST + cd gdb-4.18 + ./configure make -where HOST is an identifier such as `sun4' or `decstation', that -identifies the platform where GDB will run. - - Running `configure HOST' followed by `make' builds the `bfd', -`readline', `mmalloc', and `libiberty' libraries, then `gdb' itself. + Running `configure' followed by `make' builds the `bfd', +`readline', `mmalloc', and `libiberty' libraries, then `gdb' itself. The configured source files, and the binaries, are left in the corresponding source directories. @@ -189,11 +195,11 @@ corresponding source directories. does not recognize this automatically when you run a different shell, you may need to run `sh' on it explicitly: - sh configure HOST + sh configure If you run `configure' from a directory that contains source -directories for multiple libraries or programs, such as the `gdb-4.16' -source directory for version 4.16, `configure' creates configuration +directories for multiple libraries or programs, such as the `gdb-4.18' +source directory for version 4.18, `configure' creates configuration files for every directory level underneath (unless you tell it not to, with the `--norecursion' option). @@ -201,11 +207,11 @@ 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 4.16, type the following to configure only + For example, with version 4.18, type the following to configure only the `bfd' subdirectory: - cd gdb-4.16/bfd - ../configure HOST + cd gdb-4.18/bfd + ../configure You can install `gdb' anywhere; it has no hardwired paths. However, you should make sure that the shell on your path (named by the `SHELL' @@ -233,13 +239,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 4.16, you can build GDB in a separate + For example, with version 4.18, you can build GDB in a separate directory for a Sun 4 like this: - cd gdb-4.16 + cd gdb-4.18 mkdir ../gdb-sun4 cd ../gdb-sun4 - ../gdb-4.16/configure sun4 + ../gdb-4.18/configure sun4 make When `configure' builds a configuration using a remote source @@ -260,8 +266,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-4.16' (or in a separate configured directory configured with -`--srcdir=PATH/gdb-4.16'), you will build all the required libraries, +as `gdb-4.18' (or in a separate configured directory configured with +`--srcdir=PATH/gdb-4.18'), you will build all the required libraries, and then build GDB. When you have multiple hosts or targets configured in separate @@ -291,20 +297,20 @@ abbreviations to full names; you can read the script, if you wish, or you can use it to test your guesses on abbreviations--for example: % sh config.sub sun4 - sparc-sun-sunos411 + sparc-sun-sunos4.1.1 % sh config.sub sun3 - m68k-sun-sunos411 + m68k-sun-sunos4.1.1 % sh config.sub decstation - mips-dec-ultrix42 + mips-dec-ultrix4.2 % sh config.sub hp300bsd m68k-hp-bsd % sh config.sub i386v - i386-unknown-sysv + i386-pc-sysv % sh config.sub i786v Invalid configuration `i786v': machine `i786v' not recognized `config.sub' is also distributed in the GDB source directory -(`gdb-4.16', for version 4.16). +(`gdb-4.18', for version 4.18). `configure' options @@ -319,7 +325,10 @@ for a full explanation of `configure'. [--prefix=DIR] [--srcdir=PATH] [--norecursion] [--rm] - [--target=TARGET] HOST + [--enable-build-warnings] + [--target=TARGET] + [--host=HOST] + [HOST] You may introduce options with a single `-' rather than `--' if you prefer; but you may abbreviate option names if you use `--'. @@ -350,6 +359,17 @@ prefer; but you may abbreviate option names if you use `--'. `--rm' Remove the configuration that the other arguments specify. +`--enable-build-warnings' + When building the GDB sources, ask the compiler to warn about any + code which looks even vaguely suspicious. You should only using + this feature if you're compiling with GNU CC. It passes the + following flags: + -Wall + -Wpointer-arith + -Wstrict-prototypes + -Wmissing-prototypes + -Wmissing-declarations + `--target=TARGET' Configure GDB for cross-debugging programs running on the specified TARGET. Without this option, GDB is configured to debug programs @@ -358,12 +378,16 @@ prefer; but you may abbreviate option names if you use `--'. There is no convenient way to generate a list of all available targets. -`HOST ...' +`--host=HOST' Configure GDB to run on the specified HOST. There is no convenient way to generate a list of all available hosts. +`HOST ...' + Same as `--host=HOST'. If you omit this, GDB will guess; it's + quite accurate. + `configure' accepts other options, for compatibility with configuring other GNU tools recursively; but these are the only options that affect GDB or its supporting libraries. @@ -372,7 +396,8 @@ GDB or its supporting libraries. Languages other than C ======================= -See the GDB manual (doc/gdb.texinfo) for information on this. +See the GDB manual (gdb/doc/gdb.texinfo) for information on this. + Kernel debugging ================= @@ -391,26 +416,35 @@ remote stubs to be used with remote.c. They are designed to run standalone on an m68k, i386, or SPARC cpu and communicate properly with the remote.c stub over a serial line. -The file rem-multi.shar contains a general stub that can probably -run on various different flavors of unix to allow debugging over a -serial line from one machine to another. +The directory gdb/gdbserver/ contains `gdbserver', a program that +allows remote debugging for Unix applications. gdbserver is only +supported for some native configurations, including Sun 3, Sun 4, +and Linux. + +There are a number of remote interfaces for talking to existing ROM +monitors and other hardware: -Some working remote interfaces for talking to existing ROM monitors -are: remote-adapt.c AMD 29000 "Adapt" + remote-array.c Array Tech RAID controller + remote-bug.c Motorola BUG monitor + remote-d10v.c GDB protocol, talking to a d10v chip remote-e7000.c Hitachi E7000 ICE remote-eb.c AMD 29000 "EBMON" remote-es.c Ericsson 1800 monitor + remote-est.c EST emulator remote-hms.c Hitachi Micro Systems H8/300 monitor remote-mips.c MIPS remote debugging protocol remote-mm.c AMD 29000 "minimon" remote-nindy.c Intel 960 "Nindy" + remote-nrom.c NetROM ROM emulator remote-os9k.c PC running OS/9000 + remote-rdi.c ARM with Angel monitor + remote-rdp.c ARM with Demon monitor + remote-sds.c PowerPC SDS monitor remote-sim.c Generalized simulator protocol remote-st.c Tandem ST-2000 monitor remote-udi.c AMD 29000 using the AMD "Universal Debug Interface" remote-vx.c VxWorks realtime kernel - remote-z8k.c Zilog Z8000 simulator Remote-vx.c and the vx-share subdirectory contain a remote interface for the VxWorks realtime kernel, which communicates over TCP using the Sun @@ -429,9 +463,9 @@ Reporting Bugs =============== The correct address for reporting bugs found in gdb is -"bug-gdb@prep.ai.mit.edu". Please email all bugs, and all requests for +"bug-gdb@gnu.org". Please email all bugs, and all requests for help with GDB, to that address. Please include the GDB version number -(e.g., gdb-4.16), and how you configured it (e.g., "sun4" or "mach386 +(e.g., gdb-4.18), 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 GDB prints @@ -489,10 +523,8 @@ Known bugs: subsystem that is on the IDO CD, otherwise you will get complaints that certain files such as `/usr/include/syms.h' cannot be found. - * Unixware 2.x is not yet supported. - * Notes for BSD/386: - To compile gdb-4.16 on BSD/386, you must run the configure script and + To compile gdb-4.18 on BSD/386, you must run the configure script and its subscripts with bash. Here is an easy way to do this: bash -c 'CONFIG_SHELL=/bin/bash ./configure' @@ -514,17 +546,28 @@ the compiler actually outputs or the debugger actually understands. X Windows versus GDB ===================== -There is an "xxgdb", which seems to work for simple operations, -which was posted to comp.sources.x. +You should check out DDD, the Data Display Debugger. Here's the blurb +from the DDD web site, http://www.cs.tu-bs.de/softech/ddd: + + The Data Display Debugger (DDD) is a popular graphical user + interface for command-line debuggers such as GDB, DBX, JDB, WDB, + XDB, the Perl debugger, and the Python debugger. Besides ``usual'' + front-end features such as viewing source texts, DDD has become + famous through its interactive graphical data display, where data + structures are displayed as graphs. A simple mouse click + dereferences pointers or views structure contents, updated each + time the program stops. Using DDD, you can reason about your + application by watching its data, not just by viewing it execute + lines of source code. -For those interested in auto display of source and the availability of -an editor while debugging I suggest trying gdb-mode in GNU Emacs -(Try typing M-x gdb RETURN). Comments on this mode are welcome. +Emacs users will very likely enjoy the Grand Unified Debugger mode; +try typing `M-x gdb RET'. Those interested in experimenting with a new kind of gdb-mode should load gdb/gdba.el into GNU Emacs 19.25 or later. Comments on this mode are also welcome. + Writing Code for GDB ===================== @@ -532,9 +575,7 @@ There is a lot of information about writing code for GDB in the internals manual, distributed with GDB in gdb/doc/gdbint.texinfo. You can read it by hand, print it by using TeX and texinfo, or process it into an `info' file for use with Emacs' info mode or the standalone -`info' program. In particular, see the nodes Getting Started, -Debugging GDB, New Architectures, Coding Style, Clean Design, and -Submitting Patches. +`info' program. If you are pondering writing anything but a short patch, especially take note of the information about copyrights in the node Submitting @@ -549,24 +590,18 @@ GDB Testsuite There is a DejaGNU based testsuite available for testing your newly built GDB, or for regression testing GDBs with local modifications. -The testsuite is distributed separately from the base GDB distribution -for the convenience of people that wish to get either GDB or the testsuite -separately. - -The name of the testsuite is gdb-4.16-testsuite.tar.gz. You unpack it in the -same directory in which you unpacked the base GDB distribution, and it -will create and populate the directory gdb-4.16/gdb/testsuite. -Running the testsuite requires the prior installation of DejaGNU, which -is generally available via ftp. Once DejaGNU is installed, you can run -the tests in one of two ways: +Running the testsuite requires the prior installation of DejaGNU, +which is generally available via ftp; you'll need a pretty recent +release. Once DejaGNU is installed, you can run the tests in one of +two ways: - (1) cd gdb-4.16/gdb (assuming you also unpacked gdb) + (1) cd gdb-4.18/gdb (assuming you also unpacked gdb) make check or - (2) cd gdb-4.16/gdb/testsuite + (2) cd gdb-4.18/gdb/testsuite make site.exp (builds the site specific file) runtest -tool gdb GDB=../gdb (or GDB= as appropriate) diff --git a/contrib/gdb/gdb/TODO b/contrib/gdb/gdb/TODO index 06bd9ac..fcbcd16 100644 --- a/contrib/gdb/gdb/TODO +++ b/contrib/gdb/gdb/TODO @@ -9,6 +9,9 @@ General To Do List This list is probably not up to date, and opinions vary about the importance or even desirability of some of the items. +Add an "info bfd" command that displays supported object formats, +similarly to objdump -i. + START_INFERIOR_TRAPS_EXPECTED need never be defined to 2, since that is its default value. Clean this up. diff --git a/contrib/gdb/gdb/abug-rom.c b/contrib/gdb/gdb/abug-rom.c new file mode 100644 index 0000000..97ff0f8 --- /dev/null +++ b/contrib/gdb/gdb/abug-rom.c @@ -0,0 +1,169 @@ +/* Remote debugging interface for ABug Rom monitor for GDB, the GNU debugger. + Copyright 1995, 1996, 1998 Free Software Foundation, Inc. + + Written by Rob Savoye of Cygnus Support + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "gdbcore.h" +#include "target.h" +#include "monitor.h" +#include "serial.h" + +/* Prototypes for local functions. */ + +static void abug_open PARAMS ((char *args, int from_tty)); + +static void +abug_supply_register (regname, regnamelen, val, vallen) + char *regname; + int regnamelen; + char *val; + int vallen; +{ + int regno; + + if (regnamelen != 2) + return; + + switch (regname[0]) + { + case 'S': + if (regname[1] != 'R') + return; + regno = PS_REGNUM; + break; + case 'P': + if (regname[1] != 'C') + return; + regno = PC_REGNUM; + break; + case 'D': + if (regname[1] < '0' || regname[1] > '7') + return; + regno = regname[1] - '0' + D0_REGNUM; + break; + case 'A': + if (regname[1] < '0' || regname[1] > '7') + return; + regno = regname[1] - '0' + A0_REGNUM; + break; + default: + return; + } + + monitor_supply_register (regno, val); +} + +/* + * This array of registers needs to match the indexes used by GDB. The + * whole reason this exists is because the various ROM monitors use + * different names than GDB does, and don't support all the + * registers either. So, typing "info reg sp" becomes an "A7". + */ + +static char *abug_regnames[NUM_REGS] = +{ + "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", + "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", + "PC", +}; + +/* + * Define the monitor command strings. Since these are passed directly + * through to a printf style function, we need can include formatting + * strings. We also need a CR or LF on the end. + */ + +static struct target_ops abug_ops; + +static char *abug_inits[] = {"\r", NULL}; + +static struct monitor_ops abug_cmds ; + +static void +init_abug_cmds(void) +{ + abug_cmds.flags = MO_CLR_BREAK_USES_ADDR; + abug_cmds.init = abug_inits; /* Init strings */ + abug_cmds.cont = "g\r"; /* continue command */ + abug_cmds.step = "t\r"; /* single step */ + abug_cmds.stop = NULL; /* interrupt command */ + abug_cmds.set_break = "br %x\r"; /* set a breakpoint */ + abug_cmds.clr_break = "nobr %x\r"; /* clear a breakpoint */ + abug_cmds.clr_all_break = "nobr\r"; /* clear all breakpoints */ + abug_cmds.fill = "bf %x:%x %x;b\r"; /* fill (start count val) */ + abug_cmds.setmem.cmdb = "ms %x %02x\r"; /* setmem.cmdb (addr, value) */ + abug_cmds.setmem.cmdw = "ms %x %04x\r"; /* setmem.cmdw (addr, value) */ + abug_cmds.setmem.cmdl = "ms %x %08x\r"; /* setmem.cmdl (addr, value) */ + abug_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */ + abug_cmds.setmem.resp_delim = NULL; /* setreg.resp_delim */ + abug_cmds.setmem.term = NULL; /* setreg.term */ + abug_cmds.setmem.term_cmd = NULL; /* setreg.term_cmd */ + abug_cmds.getmem.cmdb = "md %x:%x;b\r"; /* getmem.cmdb (addr, len) */ + abug_cmds.getmem.cmdw = "md %x:%x;b\r"; /* getmem.cmdw (addr, len) */ + abug_cmds.getmem.cmdl = "md %x:%x;b\r"; /* getmem.cmdl (addr, len) */ + abug_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, len) */ + abug_cmds.getmem.resp_delim = " "; /* getmem.resp_delim */ + abug_cmds.getmem.term = NULL; /* getmem.term */ + abug_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */ + abug_cmds.setreg.cmd = "rm %s %x\r"; /* setreg.cmd (name, value) */ + abug_cmds.setreg.resp_delim = "="; /* setreg.resp_delim */ + abug_cmds.setreg.term = "? "; /* setreg.term */ + abug_cmds.setreg.term_cmd = ".\r" ; /* setreg.term_cmd */ + abug_cmds.getreg.cmd = "rm %s\r"; /* getreg.cmd (name) */ + abug_cmds.getreg.resp_delim = "="; /* getreg.resp_delim */ + abug_cmds.getreg.term = "? "; /* getreg.term */ + abug_cmds.getreg.term_cmd = ".\r" ; /* getreg.term_cmd */ + abug_cmds.dump_registers = "rd\r"; /* dump_registers */ + abug_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ + abug_cmds.supply_register = abug_supply_register; /* supply_register */ + abug_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ + abug_cmds.load = "lo 0\r"; /* download command */ + abug_cmds.loadresp = "\n"; /* load response */ + abug_cmds.prompt = "135Bug>"; /* monitor command prompt */ + abug_cmds.line_term = "\r"; /* end-of-line terminator */ + abug_cmds.cmd_end = NULL; /* optional command terminator */ + abug_cmds.target = &abug_ops; /* target operations */ + abug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */ + abug_cmds.regnames = abug_regnames; /* registers names */ + abug_cmds.magic = MONITOR_OPS_MAGIC ; /* magic */ +}; + +static void +abug_open(args, from_tty) + char *args; + int from_tty; +{ + monitor_open (args, &abug_cmds, from_tty); +} + +void +_initialize_abug_rom () +{ + init_abug_cmds() ; + init_monitor_ops (&abug_ops); + + abug_ops.to_shortname = "abug"; + abug_ops.to_longname = "ABug monitor"; + abug_ops.to_doc = "Debug via the ABug monitor.\n\ +Specify the serial device it is connected to (e.g. /dev/ttya)."; + abug_ops.to_open = abug_open; + + add_target (&abug_ops); +} diff --git a/contrib/gdb/gdb/acconfig.h b/contrib/gdb/gdb/acconfig.h index bb9b991..9ad5020 100644 --- a/contrib/gdb/gdb/acconfig.h +++ b/contrib/gdb/gdb/acconfig.h @@ -1,9 +1,95 @@ +/* Whether malloc must be declared even if is included. */ +#undef NEED_DECLARATION_MALLOC + +/* Whether realloc must be declared even if is included. */ +#undef NEED_DECLARATION_REALLOC + +/* Whether free must be declared even if is included. */ +#undef NEED_DECLARATION_FREE + +/* Whether strerror must be declared even if is included. */ +#undef NEED_DECLARATION_STRERROR +@TOP@ + +/* Define if pstatus_t type is available */ +#undef HAVE_PSTATUS_T + +/* Define if prrun_t type is available */ +#undef HAVE_PRRUN_T + /* Define if fpregset_t type is available. */ #undef HAVE_FPREGSET_T /* Define if gregset_t type is available. */ #undef HAVE_GREGSET_T +/* Define if ioctl argument PIOCSET is available. */ +#undef HAVE_PROCFS_PIOCSET + +/* /proc PID entries are directories containing the files + ctl as map status */ +#undef HAVE_MULTIPLE_PROC_FDS + +/* Define if the `long long' type works. */ +#undef CC_HAS_LONG_LONG + +/* Define if the "ll" format works to print long long ints. */ +#undef PRINTF_HAS_LONG_LONG + /* Define if the "%Lg" format works to print long doubles. */ #undef PRINTF_HAS_LONG_DOUBLE + +/* Define if the "%Lg" format works to scan long doubles. */ +#undef SCANF_HAS_LONG_DOUBLE + +/* Define if using Solaris thread debugging. */ +#undef HAVE_THREAD_DB_LIB + +/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */ +#undef START_INFERIOR_TRAPS_EXPECTED +#undef sys_quotactl + +/* Define if you have HPUX threads */ +#undef HAVE_HPUX_THREAD_SUPPORT + +/* Define if you want to use the memory mapped malloc package (mmalloc). */ +#undef USE_MMALLOC + +/* Define if the runtime uses a routine from mmalloc before gdb has a chance + to initialize mmalloc, and we want to force checking to be used anyway. + This may cause spurious memory corruption messages if the runtime tries + to explicitly deallocate that memory when gdb calls exit. */ +#undef MMCHECK_FORCE + +/* Define to 1 if NLS is requested. */ +#undef ENABLE_NLS + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +#undef HAVE_CATGETS + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT + +/* Define as 1 if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define if you want to use the full-screen terminal user interface. */ +#undef TUI + +/* Define if on solaris uses int instead of + size_t, and assorted other type changes. */ +#undef PROC_SERVICE_IS_OLD + +/* If you want to specify a default CPU variant, define this to be its + name, as a C string. */ +#undef TARGET_CPU_DEFAULT + +/* Set to true if the save_state_t structure is present */ +#define HAVE_STRUCT_SAVE_STATE_T 0 + +/* Set to true if the save_state_t structure has the ss_wide member */ +#define HAVE_STRUCT_MEMBER_SS_WIDE 0 diff --git a/contrib/gdb/gdb/acinclude.m4 b/contrib/gdb/gdb/acinclude.m4 new file mode 100644 index 0000000..43a0b0d --- /dev/null +++ b/contrib/gdb/gdb/acinclude.m4 @@ -0,0 +1,861 @@ +dnl written by Rob Savoye for Cygnus Support +dnl major rewriting for Tcl 7.5 by Don Libes + +dnl gdb/configure.in uses BFD_NEED_DECLARATION, so get its definition. +sinclude(../bfd/acinclude.m4) + +dnl This gets the standard macros, like the TCL, TK, etc ones. +sinclude(../config/acinclude.m4) + +dnl CYGNUS LOCAL: This gets the right posix flag for gcc +AC_DEFUN(CY_AC_TCL_LYNX_POSIX, +[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP]) +AC_MSG_CHECKING([if running LynxOS]) +AC_CACHE_VAL(ac_cv_os_lynx, +[AC_EGREP_CPP(yes, +[/* + * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__" + */ +#if defined(__Lynx__) || defined(Lynx) +yes +#endif +], ac_cv_os_lynx=yes, ac_cv_os_lynx=no)]) +# +if test "$ac_cv_os_lynx" = "yes" ; then + AC_MSG_RESULT(yes) + AC_DEFINE(LYNX) + AC_MSG_CHECKING([whether -mposix or -X is available]) + AC_CACHE_VAL(ac_cv_c_posix_flag, + [AC_TRY_COMPILE(,[ + /* + * This flag varies depending on how old the compiler is. + * -X is for the old "cc" and "gcc" (based on 1.42). + * -mposix is for the new gcc (at least 2.5.8). + */ + #if defined(__GNUC__) && __GNUC__ >= 2 + choke me + #endif + ], ac_cv_c_posix_flag=" -mposix", ac_cv_c_posix_flag=" -X")]) + CC="$CC $ac_cv_c_posix_flag" + AC_MSG_RESULT($ac_cv_c_posix_flag) + else + AC_MSG_RESULT(no) +fi +]) + +# +# Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This +# makes configure think it's cross compiling. If --target wasn't used, then +# we can't configure, so something is wrong. We don't use the cache +# here cause if somebody fixes their compiler install, we want this to work. +AC_DEFUN(CY_AC_C_WORKS, +[# If we cannot compile and link a trivial program, we can't expect anything to work +AC_MSG_CHECKING(whether the compiler ($CC) actually works) +AC_TRY_COMPILE(, [/* don't need anything here */], + c_compiles=yes, c_compiles=no) + +AC_TRY_LINK(, [/* don't need anything here */], + c_links=yes, c_links=no) + +if test x"${c_compiles}" = x"no" ; then + AC_MSG_ERROR(the native compiler is broken and won't compile.) +fi + +if test x"${c_links}" = x"no" ; then + AC_MSG_ERROR(the native compiler is broken and won't link.) +fi +AC_MSG_RESULT(yes) +]) + +AC_DEFUN(CY_AC_PATH_TCLH, [ +# +# Ok, lets find the tcl source trees so we can use the headers +# Warning: transition of version 9 to 10 will break this algorithm +# because 10 sorts before 9. We also look for just tcl. We have to +# be careful that we don't match stuff like tclX by accident. +# the alternative search directory is involked by --with-tclinclude +# + +no_tcl=true +AC_MSG_CHECKING(for Tcl private headers. dir=${configdir}) +AC_ARG_WITH(tclinclude, [ --with-tclinclude=DIR Directory where tcl private headers are], with_tclinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_tclh,[ +# first check to see if --with-tclinclude was specified +if test x"${with_tclinclude}" != x ; then + if test -f ${with_tclinclude}/tclInt.h ; then + ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)` + elif test -f ${with_tclinclude}/generic/tclInt.h ; then + ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)` + else + AC_MSG_ERROR([${with_tclinclude} directory doesn't contain private headers]) + fi +fi + +# next check if it came with Tcl configuration file +if test x"${ac_cv_c_tclconfig}" = x ; then + if test -f $ac_cv_c_tclconfig/../generic/tclInt.h ; then + ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/..; pwd)` + fi +fi + +# next check in private source directory +# +# since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_tclh}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[7-9]]* 2>/dev/null` \ + ${srcdir}/../../tcl \ + `ls -dr ${srcdir}/../../tcl[[7-9]]* 2>/dev/null` \ + ${srcdir}/../../../tcl \ + `ls -dr ${srcdir}/../../../tcl[[7-9]]* 2>/dev/null ` ; do + if test -f $i/generic/tclInt.h ; then + ac_cv_c_tclh=`(cd $i/generic; pwd)` + break + fi + done +fi +# finally check in a few common install locations +# +# since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_tclh}" = x ; then + for i in \ + `ls -dr /usr/local/src/tcl[[7-9]]* 2>/dev/null` \ + `ls -dr /usr/local/lib/tcl[[7-9]]* 2>/dev/null` \ + /usr/local/src/tcl \ + /usr/local/lib/tcl \ + ${prefix}/include ; do + if test -f $i/generic/tclInt.h ; then + ac_cv_c_tclh=`(cd $i/generic; pwd)` + break + fi + done +fi +# see if one is installed +if test x"${ac_cv_c_tclh}" = x ; then + AC_HEADER_CHECK(tclInt.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="") +fi +]) +if test x"${ac_cv_c_tclh}" = x ; then + TCLHDIR="# no Tcl private headers found" + AC_MSG_ERROR([Can't find Tcl private headers]) +fi +if test x"${ac_cv_c_tclh}" != x ; then + no_tcl="" + if test x"${ac_cv_c_tclh}" = x"installed" ; then + AC_MSG_RESULT([is installed]) + TCLHDIR="" + else + AC_MSG_RESULT([found in ${ac_cv_c_tclh}]) + # this hack is cause the TCLHDIR won't print if there is a "-I" in it. + TCLHDIR="-I${ac_cv_c_tclh}" + fi +fi + +AC_SUBST(TCLHDIR) +]) + + +AC_DEFUN(CY_AC_PATH_TCLCONFIG, [ +# +# Ok, lets find the tcl configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-tclconfig +# + +if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR Directory containing tcl configuration (tclConfig.sh)], + with_tclconfig=${withval}) + AC_MSG_CHECKING([for Tcl configuration]) + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + # First check to see if --with-tclconfig was specified. + if test x"${with_tclconfig}" != x ; then + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[[7-9]]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[[7-9]]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[[7-9]]* 2>/dev/null` ; do + if test -f "$i/${configdir}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[7-9]]* 2>/dev/null` ; do + if test -f "$i/${configdir}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_tclconfig}" = x ; then + TCLCONFIG="# no Tcl configs found" + AC_MSG_WARN(Can't find Tcl configuration definitions) + else + no_tcl= + TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh + AC_MSG_RESULT(found $TCLCONFIG) + fi +fi +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_TCLCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_TCLCONFIG, [ + . $TCLCONFIG + + AC_SUBST(TCL_VERSION) + AC_SUBST(TCL_MAJOR_VERSION) + AC_SUBST(TCL_MINOR_VERSION) + AC_SUBST(TCL_CC) + AC_SUBST(TCL_DEFS) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_LIB_FILE) + +dnl don't export, not used outside of configure +dnl AC_SUBST(TCL_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_EXEC_PREFIX) + + AC_SUBST(TCL_SHLIB_CFLAGS) + AC_SUBST(TCL_SHLIB_LD) +dnl don't export, not used outside of configure + AC_SUBST(TCL_SHLIB_LD_LIBS) + AC_SUBST(TCL_SHLIB_SUFFIX) +dnl not used, don't export to save symbols + AC_SUBST(TCL_DL_LIBS) + AC_SUBST(TCL_LD_FLAGS) +dnl don't export, not used outside of configure + AC_SUBST(TCL_LD_SEARCH_FLAGS) + AC_SUBST(TCL_COMPAT_OBJS) + AC_SUBST(TCL_RANLIB) + AC_SUBST(TCL_BUILD_LIB_SPEC) + AC_SUBST(TCL_LIB_SPEC) + AC_SUBST(TCL_LIB_VERSIONS_OK) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_SHARED_LIB_SUFFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX) +]) + +# Warning: Tk definitions are very similar to Tcl definitions but +# are not precisely the same. There are a couple of differences, +# so don't do changes to Tcl thinking you can cut and paste it do +# the Tk differences and later simply substitute "Tk" for "Tcl". +# Known differences: +# - Acceptable Tcl major version #s is 7-9 while Tk is 4-9 +# - Searching for Tcl includes looking for tclInt.h, Tk looks for tk.h +# - Computing major/minor versions is different because Tk depends on +# headers to Tcl, Tk, and X. +# - Symbols in tkConfig.sh are different than tclConfig.sh +# - Acceptable for Tk to be missing but not Tcl. + +AC_DEFUN(CY_AC_PATH_TKH, [ +# +# Ok, lets find the tk source trees so we can use the headers +# If the directory (presumably symlink) named "tk" exists, use that one +# in preference to any others. Same logic is used when choosing library +# and again with Tcl. The search order is the best place to look first, then in +# decreasing significance. The loop breaks if the trigger file is found. +# Note the gross little conversion here of srcdir by cd'ing to the found +# directory. This converts the path from a relative to an absolute, so +# recursive cache variables for the path will work right. We check all +# the possible paths in one loop rather than many seperate loops to speed +# things up. +# the alternative search directory is involked by --with-tkinclude +# +no_tk=true +AC_MSG_CHECKING(for Tk private headers) +AC_ARG_WITH(tkinclude, [ --with-tkinclude=DIR Directory where tk private headers are], with_tkinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_tkh,[ +# first check to see if --with-tkinclude was specified +if test x"${with_tkinclude}" != x ; then + if test -f ${with_tkinclude}/tk.h ; then + ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)` + elif test -f ${with_tkinclude}/generic/tk.h ; then + ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)` + else + AC_MSG_ERROR([${with_tkinclude} directory doesn't contain private headers]) + fi +fi + +# next check if it came with Tk configuration file +if test x"${ac_cv_c_tkconfig}" = x ; then + if test -f $ac_cv_c_tkconfig/../generic/tk.h ; then + ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/..; pwd)` + fi +fi + +# next check in private source directory +# +# since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_tkh}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[4-9]]* 2>/dev/null` \ + ${srcdir}/../../tk \ + `ls -dr ${srcdir}/../../tk[[4-9]]* 2>/dev/null` \ + ${srcdir}/../../../tk \ + `ls -dr ${srcdir}/../../../tk[[4-9]]* 2>/dev/null ` ; do + if test -f $i/generic/tk.h ; then + ac_cv_c_tkh=`(cd $i/generic; pwd)` + break + fi + done +fi +# finally check in a few common install locations +# +# since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_tkh}" = x ; then + for i in \ + `ls -dr /usr/local/src/tk[[4-9]]* 2>/dev/null` \ + `ls -dr /usr/local/lib/tk[[4-9]]* 2>/dev/null` \ + /usr/local/src/tk \ + /usr/local/lib/tk \ + ${prefix}/include ; do + if test -f $i/generic/tk.h ; then + ac_cv_c_tkh=`(cd $i/generic; pwd)` + break + fi + done +fi +# see if one is installed +if test x"${ac_cv_c_tkh}" = x ; then + AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed, ac_cv_c_tkh="") +fi +]) +if test x"${ac_cv_c_tkh}" != x ; then + no_tk="" + if test x"${ac_cv_c_tkh}" = x"installed" ; then + AC_MSG_RESULT([is installed]) + TKHDIR="" + else + AC_MSG_RESULT([found in ${ac_cv_c_tkh}]) + # this hack is cause the TKHDIR won't print if there is a "-I" in it. + TKHDIR="-I${ac_cv_c_tkh}" + fi +else + TKHDIR="# no Tk directory found" + AC_MSG_WARN([Can't find Tk private headers]) + no_tk=true +fi + +AC_SUBST(TKHDIR) +]) + + +AC_DEFUN(CY_AC_PATH_TKCONFIG, [ +# +# Ok, lets find the tk configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-tkconfig +# + +if test x"${no_tk}" = x ; then + # we reset no_tk in case something fails here + no_tk=true + AC_ARG_WITH(tkconfig, [ --with-tkconfig=DIR Directory containing tk configuration (tkConfig.sh)], + with_tkconfig=${withval}) + AC_MSG_CHECKING([for Tk configuration]) + AC_CACHE_VAL(ac_cv_c_tkconfig,[ + + # First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` + else + AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) + fi + fi + + # then check for a private Tk library + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ../tk \ + `ls -dr ../tk[[4-9]]* 2>/dev/null` \ + ../../tk \ + `ls -dr ../../tk[[4-9]]* 2>/dev/null` \ + ../../../tk \ + `ls -dr ../../../tk[[4-9]]* 2>/dev/null` ; do + if test -f "$i/${configdir}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[4-9]]* 2>/dev/null` ; do + if test -f "$i/${configdir}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_tkconfig}" = x ; then + TKCONFIG="# no Tk configs found" + AC_MSG_WARN(Can't find Tk configuration definitions) + else + no_tk= + TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh + AC_MSG_RESULT(found $TKCONFIG) + fi +fi + +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_TKCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_TKCONFIG, [ + if test -f "$TKCONFIG" ; then + . $TKCONFIG + fi + + AC_SUBST(TK_VERSION) +dnl not actually used, don't export to save symbols +dnl AC_SUBST(TK_MAJOR_VERSION) +dnl AC_SUBST(TK_MINOR_VERSION) + AC_SUBST(TK_DEFS) + +dnl not used, don't export to save symbols + dnl AC_SUBST(TK_LIB_FILE) + +dnl not used outside of configure +dnl AC_SUBST(TK_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(TK_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TK_EXEC_PREFIX) + + AC_SUBST(TK_BUILD_INCLUDES) + AC_SUBST(TK_XINCLUDES) + AC_SUBST(TK_XLIBSW) + AC_SUBST(TK_BUILD_LIB_SPEC) + AC_SUBST(TK_LIB_SPEC) +]) + +# check for Itcl headers. + +AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [ +# +# Ok, lets find the itcl configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-itclconfig +# + +if test x"${no_itcl}" = x ; then + # we reset no_itcl in case something fails here + no_itcl=true + AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)], + with_itclconfig=${withval}) + AC_MSG_CHECKING([for Itcl configuration]) + AC_CACHE_VAL(ac_cv_c_itclconfig,[ + + # First check to see if --with-itclconfig was specified. + if test x"${with_itclconfig}" != x ; then + if test -f "${with_itclconfig}/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd ${with_itclconfig}; pwd)` + else + AC_MSG_ERROR([${with_itclconfig} directory doesn't contain itclConfig.sh]) + fi + fi + + # then check for a private Itcl library + if test x"${ac_cv_c_itclconfig}" = x ; then + for i in \ + ../itcl/itcl \ + `ls -dr ../itcl[[4-9]]*/itcl 2>/dev/null` \ + ../../itcl \ + `ls -dr ../../itcl[[4-9]]*/itcl 2>/dev/null` \ + ../../../itcl \ + `ls -dr ../../../itcl[[4-9]]*/itcl 2>/dev/null` ; do + if test -f "$i/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_itclconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + if test -f "$i/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_itclconfig}" = x ; then + for i in \ + ${srcdir}/../itcl/itcl \ + `ls -dr ${srcdir}/../itcl[[4-9]]*/itcl 2>/dev/null` ; do + if test -f "$i/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_itclconfig}" = x ; then + ITCLCONFIG="# no Itcl configs found" + AC_MSG_WARN(Can't find Itcl configuration definitions) + else + no_itcl= + ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh + AC_MSG_RESULT(found $ITCLCONFIG) + fi +fi +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_ITCLCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_ITCLCONFIG, [ + if test -f "$ITCLCONFIG" ; then + . $ITCLCONFIG + fi + + AC_SUBST(ITCL_VERSION) +dnl not actually used, don't export to save symbols +dnl AC_SUBST(ITCL_MAJOR_VERSION) +dnl AC_SUBST(ITCL_MINOR_VERSION) + AC_SUBST(ITCL_DEFS) + +dnl not used, don't export to save symbols + dnl AC_SUBST(ITCL_LIB_FILE) + +dnl not used outside of configure +dnl AC_SUBST(ITCL_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(ITCL_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(ITCL_EXEC_PREFIX) + + AC_SUBST(ITCL_BUILD_INCLUDES) + AC_SUBST(ITCL_BUILD_LIB_SPEC) + AC_SUBST(ITCL_LIB_SPEC) +]) + +# check for Itcl headers. + +AC_DEFUN(CY_AC_PATH_ITCLH, [ +AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir}) +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 + ac_cv_c_itclh=`(cd $i/generic; pwd)` + break + fi + done +fi +if test x"${ac_cv_c_itclh}" = x ; then + ITCLHDIR="# no Itcl private headers found" + AC_MSG_ERROR([Can't find Itcl private headers]) +fi +if test x"${ac_cv_c_itclh}" != x ; then + ITCLHDIR="-I${ac_cv_c_itclh}" +fi +# should always be here +# ITCLLIB="../itcl/itcl/unix/libitcl.a" +AC_SUBST(ITCLHDIR) +#AC_SUBST(ITCLLIB) +]) + + +AC_DEFUN(CY_AC_PATH_ITKCONFIG, [ +# +# Ok, lets find the itk configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-itkconfig +# + +if test x"${no_itk}" = x ; then + # we reset no_itk in case something fails here + no_itk=true + AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)], + with_itkconfig=${withval}) + AC_MSG_CHECKING([for Itk configuration]) + AC_CACHE_VAL(ac_cv_c_itkconfig,[ + + # First check to see if --with-itkconfig was specified. + if test x"${with_itkconfig}" != x ; then + if test -f "${with_itkconfig}/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd ${with_itkconfig}; pwd)` + else + AC_MSG_ERROR([${with_itkconfig} directory doesn't contain itkConfig.sh]) + fi + fi + + # then check for a private Itk library + if test x"${ac_cv_c_itkconfig}" = x ; then + for i in \ + ../itcl/itk \ + `ls -dr ../itcl[[4-9]]*/itk 2>/dev/null` \ + ../../itk \ + `ls -dr ../../itcl[[4-9]]*/itk 2>/dev/null` \ + ../../../itk \ + `ls -dr ../../../itcl[[4-9]]*/itk 2>/dev/null` ; do + if test -f "$i/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_itkconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + if test -f "$i/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_itkconfig}" = x ; then + for i in \ + ${srcdir}/../itcl/itk \ + `ls -dr ${srcdir}/../itcl[[4-9]]*/itk 2>/dev/null` ; do + if test -f "$i/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_itkconfig}" = x ; then + ITKCONFIG="# no Itk configs found" + AC_MSG_WARN(Can't find Itk configuration definitions) + else + no_itk= + ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh + AC_MSG_RESULT(found $ITKCONFIG) + fi +fi + +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_ITKCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_ITKCONFIG, [ + if test -f "$ITKCONFIG" ; then + . $ITKCONFIG + fi + + AC_SUBST(ITK_VERSION) +dnl not actually used, don't export to save symbols +dnl AC_SUBST(ITK_MAJOR_VERSION) +dnl AC_SUBST(ITK_MINOR_VERSION) + AC_SUBST(ITK_DEFS) + +dnl not used, don't export to save symbols + dnl AC_SUBST(ITK_LIB_FILE) + +dnl not used outside of configure +dnl AC_SUBST(ITK_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(ITK_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(ITK_EXEC_PREFIX) + + AC_SUBST(ITK_BUILD_INCLUDES) + AC_SUBST(ITK_BUILD_LIB_SPEC) + AC_SUBST(ITK_LIB_SPEC) +]) + +AC_DEFUN(CY_AC_PATH_ITKH, [ +AC_MSG_CHECKING(for Itk private headers. srcdir=${srcdir}) +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 + ac_cv_c_itkh=`(cd $i/generic; pwd)` + break + fi + done +fi +if test x"${ac_cv_c_itkh}" = x ; then + ITKHDIR="# no Itk private headers found" + AC_MSG_ERROR([Can't find Itk private headers]) +fi +if test x"${ac_cv_c_itkh}" != x ; then + ITKHDIR="-I${ac_cv_c_itkh}" +fi +# should always be here +# ITKLIB="../itcl/itk/unix/libitk.a" +AC_SUBST(ITKHDIR) +#AC_SUBST(ITKLIB) +]) + +# check for Tix headers. + +AC_DEFUN(CY_AC_PATH_TIXH, [ +AC_MSG_CHECKING(for Tix private headers. srcdir=${srcdir}) +if test x"${ac_cv_c_tixh}" = x ; then + for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do + if test -f $i/generic/tix.h ; then + ac_cv_c_tixh=`(cd $i/generic; pwd)` + break + fi + done +fi +if test x"${ac_cv_c_tixh}" = x ; then + TIXHDIR="# no Tix private headers found" + AC_MSG_ERROR([Can't find Tix private headers]) +fi +if test x"${ac_cv_c_tixh}" != x ; then + TIXHDIR="-I${ac_cv_c_tixh}" +fi +AC_SUBST(TIXHDIR) +]) + +AC_DEFUN(CY_AC_PATH_TIXCONFIG, [ +# +# Ok, lets find the tix configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-itkconfig +# + +if test x"${no_tix}" = x ; then + # we reset no_tix in case something fails here + no_tix=true + AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)], + with_tixconfig=${withval}) + AC_MSG_CHECKING([for Tix configuration]) + AC_CACHE_VAL(ac_cv_c_tixconfig,[ + + # First check to see if --with-tixconfig was specified. + if test x"${with_tixconfig}" != x ; then + if test -f "${with_tixconfig}/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd ${with_tixconfig}; pwd)` + else + AC_MSG_ERROR([${with_tixconfig} directory doesn't contain tixConfig.sh]) + fi + fi + + # then check for a private Tix library + if test x"${ac_cv_c_tixconfig}" = x ; then + for i in \ + ../tix \ + `ls -dr ../tix 2>/dev/null` \ + ../../tix \ + `ls -dr ../../tix 2>/dev/null` \ + ../../../tix \ + `ls -dr ../../../tix 2>/dev/null` ; do + echo "**** Looking at $i - with ${configdir}" + if test -f "$i/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_tixconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + echo "**** Looking at $i" + if test -f "$i/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + echo "**** Other private locations" + if test x"${ac_cv_c_tixconfig}" = x ; then + for i in \ + ${srcdir}/../tix \ + `ls -dr ${srcdir}/../tix 2>/dev/null` ; do + echo "**** Looking at $i - with ${configdir}" + if test -f "$i/${configdir}/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd $i/${configdir}; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_tixconfig}" = x ; then + TIXCONFIG="# no Tix configs found" + AC_MSG_WARN(Can't find Tix configuration definitions) + else + no_tix= + TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh + AC_MSG_RESULT(found $TIXCONFIG) + fi +fi + +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_TIXCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_TIXCONFIG, [ + if test -f "$TIXCONFIG" ; then + . $TIXCONFIG + fi + + AC_SUBST(TIX_VERSION) +dnl not actually used, don't export to save symbols +dnl AC_SUBST(TIX_MAJOR_VERSION) +dnl AC_SUBST(TIX_MINOR_VERSION) +dnl AC_SUBST(TIX_DEFS) + +dnl not used, don't export to save symbols +dnl dnl AC_SUBST(TIX_LIB_FILE) + +dnl not used outside of configure +dnl AC_SUBST(TIX_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(TIX_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TIX_EXEC_PREFIX) + +dnl AC_SUBST(TIX_BUILD_INCLUDES) + AC_SUBST(TIX_BUILD_LIB_SPEC) +dnl AC_SUBST(TIX_LIB_SPEC) +]) diff --git a/contrib/gdb/gdb/aclocal.m4 b/contrib/gdb/gdb/aclocal.m4 index d23d084..4fd3658 100644 --- a/contrib/gdb/gdb/aclocal.m4 +++ b/contrib/gdb/gdb/aclocal.m4 @@ -1,14 +1,28 @@ -dnl This file is duplicated in four places: -dnl * gdb/aclocal.m4 -dnl * gdb/testsuite/aclocal.m4 -dnl * expect/aclocal.m4 -dnl * dejagnu/aclocal.m4 -dnl Consider modifying all copies in parallel. +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + dnl written by Rob Savoye for Cygnus Support +dnl major rewriting for Tcl 7.5 by Don Libes + +dnl gdb/configure.in uses BFD_NEED_DECLARATION, so get its definition. +sinclude(../bfd/acinclude.m4) + +dnl This gets the standard macros, like the TCL, TK, etc ones. +sinclude(../config/acinclude.m4) + dnl CYGNUS LOCAL: This gets the right posix flag for gcc AC_DEFUN(CY_AC_TCL_LYNX_POSIX, [AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP]) -AC_MSG_CHECKING([to see if this is LynxOS]) +AC_MSG_CHECKING([if running LynxOS]) AC_CACHE_VAL(ac_cv_os_lynx, [AC_EGREP_CPP(yes, [/* @@ -40,28 +54,31 @@ if test "$ac_cv_os_lynx" = "yes" ; then AC_MSG_RESULT(no) fi ]) + # # Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This # makes configure think it's cross compiling. If --target wasn't used, then -# we can't configure, so something is wrong. -AC_DEFUN(CY_AC_C_CROSS, -[# If we cannot run a trivial program, we must be cross compiling. -AC_MSG_CHECKING(whether cross-compiling) -AC_CACHE_VAL(ac_cv_c_cross,[ -AC_TRY_RUN([ - main(){return(0);}], - ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_c_cross=yes) -]) -if test x"${target}" = x"${host}" -a x"${ac_cv_c_cross}" = x"yes"; then - dnl this hack is cause the message is so long we don't call AC_MSG_ERROR - echo "configure: error: You need to specify --target to cross compile," 1>&2; - echo " or the native compiler is broken" 1>&2; - exit 1; -else - cross_compiling=$ac_cv_c_cross - AC_MSG_RESULT($ac_cv_c_cross) +# we can't configure, so something is wrong. We don't use the cache +# here cause if somebody fixes their compiler install, we want this to work. +AC_DEFUN(CY_AC_C_WORKS, +[# If we cannot compile and link a trivial program, we can't expect anything to work +AC_MSG_CHECKING(whether the compiler ($CC) actually works) +AC_TRY_COMPILE(, [/* don't need anything here */], + c_compiles=yes, c_compiles=no) + +AC_TRY_LINK(, [/* don't need anything here */], + c_links=yes, c_links=no) + +if test x"${c_compiles}" = x"no" ; then + AC_MSG_ERROR(the native compiler is broken and won't compile.) +fi + +if test x"${c_links}" = x"no" ; then + AC_MSG_ERROR(the native compiler is broken and won't link.) fi +AC_MSG_RESULT(yes) ]) + AC_DEFUN(CY_AC_PATH_TCLH, [ # # Ok, lets find the tcl source trees so we can use the headers @@ -70,36 +87,43 @@ AC_DEFUN(CY_AC_PATH_TCLH, [ # be careful that we don't match stuff like tclX by accident. # the alternative search directory is involked by --with-tclinclude # + no_tcl=true -AC_MSG_CHECKING(for Tcl private headers) -AC_ARG_WITH(tclinclude, [ --with-tclinclude directory where tcl private headers are], with_tclinclude=${withval}) +AC_MSG_CHECKING(for Tcl private headers. dir=${configdir}) +AC_ARG_WITH(tclinclude, [ --with-tclinclude=DIR Directory where tcl private headers are], with_tclinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tclh,[ # first check to see if --with-tclinclude was specified if test x"${with_tclinclude}" != x ; then if test -f ${with_tclinclude}/tclInt.h ; then ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)` + elif test -f ${with_tclinclude}/generic/tclInt.h ; then + ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)` else AC_MSG_ERROR([${with_tclinclude} directory doesn't contain private headers]) fi fi + +# next check if it came with Tcl configuration file +if test x"${ac_cv_c_tclconfig}" = x ; then + if test -f $ac_cv_c_tclconfig/../generic/tclInt.h ; then + ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/..; pwd)` + fi +fi + # next check in private source directory # # since ls returns lowest version numbers first, reverse its output if test x"${ac_cv_c_tclh}" = x ; then for i in \ ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[7-9]]* 2>/dev/null` \ ${srcdir}/../../tcl \ - `ls -dr ${srcdir}/../../tcl[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../../tcl[[7-9]]* 2>/dev/null` \ ${srcdir}/../../../tcl \ - `ls -dr ${srcdir}/../../../tcl[[0-9]]* 2>/dev/null ` ; do - if test -f $i/tclInt.h ; then - ac_cv_c_tclh=`(cd $i; pwd)` - break - fi - # Tcl 7.5 and greater puts headers in subdirectory. + `ls -dr ${srcdir}/../../../tcl[[7-9]]* 2>/dev/null ` ; do if test -f $i/generic/tclInt.h ; then - ac_cv_c_tclh=`(cd $i; pwd)`/generic + ac_cv_c_tclh=`(cd $i/generic; pwd)` + break fi done fi @@ -108,13 +132,13 @@ fi # since ls returns lowest version numbers first, reverse its output if test x"${ac_cv_c_tclh}" = x ; then for i in \ - `ls -dr /usr/local/src/tcl[[0-9]]* 2>/dev/null` \ - `ls -dr /usr/local/lib/tcl[[0-9]]* 2>/dev/null` \ + `ls -dr /usr/local/src/tcl[[7-9]]* 2>/dev/null` \ + `ls -dr /usr/local/lib/tcl[[7-9]]* 2>/dev/null` \ /usr/local/src/tcl \ /usr/local/lib/tcl \ ${prefix}/include ; do - if test -f $i/tclInt.h ; then - ac_cv_c_tclh=`(cd $i; pwd)` + if test -f $i/generic/tclInt.h ; then + ac_cv_c_tclh=`(cd $i/generic; pwd)` break fi done @@ -130,7 +154,7 @@ if test x"${ac_cv_c_tclh}" = x ; then fi if test x"${ac_cv_c_tclh}" != x ; then no_tcl="" - if test x"${ac_cv_c_tkh}" = x"installed" ; then + if test x"${ac_cv_c_tclh}" = x"installed" ; then AC_MSG_RESULT([is installed]) TCLHDIR="" else @@ -140,176 +164,138 @@ if test x"${ac_cv_c_tclh}" != x ; then fi fi -AC_MSG_CHECKING([Tcl version]) -rm -rf tclmajor tclminor -orig_includes="$CPPFLAGS" - -if test x"${TCLHDIR}" != x ; then - CPPFLAGS="$CPPFLAGS $TCLHDIR" -fi - -AC_TRY_RUN([ -#include -#include "tcl.h" -main() { - FILE *maj = fopen("tclmajor","w"); - FILE *min = fopen("tclminor","w"); - fprintf(maj,"%d",TCL_MAJOR_VERSION); - fprintf(min,"%d",TCL_MINOR_VERSION); - fclose(maj); - fclose(min); - return 0; -}], - tclmajor=`cat tclmajor` - tclminor=`cat tclminor` - tclversion=$tclmajor.$tclminor - AC_MSG_RESULT($tclversion) - rm -f tclmajor tclminor -, - AC_MSG_RESULT([can't happen]) -, - AC_MSG_ERROR([can't be cross compiled]) -) -CPPFLAGS="${orig_includes}" - -AC_PROVIDE([$0]) AC_SUBST(TCLHDIR) ]) -AC_DEFUN(CY_AC_PATH_TCLLIB, [ + + +AC_DEFUN(CY_AC_PATH_TCLCONFIG, [ # -# Ok, lets find the tcl library +# Ok, lets find the tcl configuration # First, look for one uninstalled. -# the alternative search directory is invoked by --with-tcllib +# the alternative search directory is invoked by --with-tclconfig # -if test $tclmajor -ge 7 -a $tclminor -ge 4 ; then - installedtcllibroot=tcl$tclversion -else - installedtcllibroot=tcl -fi - if test x"${no_tcl}" = x ; then - # we reset no_tcl incase something fails here + # we reset no_tcl in case something fails here no_tcl=true - AC_ARG_WITH(tcllib, [ --with-tcllib directory where the tcl library is], - with_tcllib=${withval}) - AC_MSG_CHECKING([for Tcl library]) - AC_CACHE_VAL(ac_cv_c_tcllib,[ - # First check to see if --with-tcllib was specified. - # This requires checking for both the installed and uninstalled name-styles - # since we have no idea if it's installed or not. - if test x"${with_tcllib}" != x ; then - if test -f "${with_tcllib}/lib$installedtcllibroot.so" ; then - ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.so - elif test -f "${with_tcllib}/libtcl.so" ; then - ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.so - # then look for a freshly built statically linked library - # if Makefile exists we assume its configured and libtcl will be built first. - elif test -f "${with_tcllib}/lib$installedtcllibroot.a" ; then - ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.a - elif test -f "${with_tcllib}/libtcl.a" ; then - ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.a + AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR Directory containing tcl configuration (tclConfig.sh)], + with_tclconfig=${withval}) + AC_MSG_CHECKING([for Tcl configuration]) + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + # First check to see if --with-tclconfig was specified. + if test x"${with_tclconfig}" != x ; then + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else - AC_MSG_ERROR([${with_tcllib} directory doesn't contain libraries]) + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi - # then check for a private Tcl library - # Since these are uninstalled, use the simple lib name root. - if test x"${ac_cv_c_tcllib}" = x ; then + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ - `ls -dr ../tcl[[0-9]]* 2>/dev/null` \ + `ls -dr ../tcl[[7-9]]* 2>/dev/null` \ ../../tcl \ - `ls -dr ../../tcl[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tcl[[7-9]]* 2>/dev/null` \ ../../../tcl \ - `ls -dr ../../../tcl[[0-9]]* 2>/dev/null` ; do - # Tcl 7.5 and greater puts library in subdir. Look there first. - if test -f "$i/unix/libtcl.so" ; then - ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so - break - elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then - ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a - break - # look for a freshly built dynamically linked library - elif test -f "$i/libtcl.so" ; then - ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so - break - - # then look for a freshly built statically linked library - # if Makefile exists we assume its configured and libtcl will be - # built first. - elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then - ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a + `ls -dr ../../../tcl[[7-9]]* 2>/dev/null` ; do + if test -f "$i/${configdir}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)` break fi done fi # check in a few common install locations - if test x"${ac_cv_c_tcllib}" = x ; then + if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do - # first look for a freshly built dynamically linked library - if test -f "$i/lib$installedtcllibroot.so" ; then - ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.so - break - # then look for a freshly built statically linked library - # if Makefile exists we assume its configured and libtcl will be built first. - elif test -f "$i/lib$installedtcllibroot.a" -o -f "$i/Makefile" ; then - ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.a + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations - if test x"${ac_cv_c_tcllib}" = x ; then + if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` ; do - # Tcl 7.5 and greater puts library in subdir. Look there first. - if test -f "$i/unix/libtcl.so" ; then - ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so - break - elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then - ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a - break - # look for a freshly built dynamically linked library - elif test -f "$i/libtcl.so" ; then - ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so - break - - # then look for a freshly built statically linked library - # if Makefile exists we assume its configured and libtcl will be - # built first. - elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then - ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a + `ls -dr ${srcdir}/../tcl[[7-9]]* 2>/dev/null` ; do + if test -f "$i/${configdir}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)` break fi done fi - - # see if one is conveniently installed with the compiler - if test x"${ac_cv_c_tcllib}" = x ; then - orig_libs="$LIBS" - LIBS="$LIBS -l$installedtcllibroot -lm" - AC_TRY_RUN([ - Tcl_AppInit() - { exit(0); }], ac_cv_c_tcllib="-l$installedtcllibroot", ac_cv_c_tcllib="" - , ac_cv_c_tclib="-l$installedtcllibroot") - LIBS="${orig_libs}" - fi ]) - if test x"${ac_cv_c_tcllib}" = x ; then - TCLLIB="# no Tcl library found" - AC_MSG_WARN(Can't find Tcl library) + if test x"${ac_cv_c_tclconfig}" = x ; then + TCLCONFIG="# no Tcl configs found" + AC_MSG_WARN(Can't find Tcl configuration definitions) else - TCLLIB=${ac_cv_c_tcllib} - AC_MSG_RESULT(found $TCLLIB) no_tcl= + TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh + AC_MSG_RESULT(found $TCLCONFIG) fi fi +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_TCLCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_TCLCONFIG, [ + . $TCLCONFIG + + AC_SUBST(TCL_VERSION) + AC_SUBST(TCL_MAJOR_VERSION) + AC_SUBST(TCL_MINOR_VERSION) + AC_SUBST(TCL_CC) + AC_SUBST(TCL_DEFS) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_LIB_FILE) + +dnl don't export, not used outside of configure +dnl AC_SUBST(TCL_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_EXEC_PREFIX) + + AC_SUBST(TCL_SHLIB_CFLAGS) + AC_SUBST(TCL_SHLIB_LD) +dnl don't export, not used outside of configure + AC_SUBST(TCL_SHLIB_LD_LIBS) + AC_SUBST(TCL_SHLIB_SUFFIX) +dnl not used, don't export to save symbols + AC_SUBST(TCL_DL_LIBS) + AC_SUBST(TCL_LD_FLAGS) +dnl don't export, not used outside of configure + AC_SUBST(TCL_LD_SEARCH_FLAGS) + AC_SUBST(TCL_COMPAT_OBJS) + AC_SUBST(TCL_RANLIB) + AC_SUBST(TCL_BUILD_LIB_SPEC) + AC_SUBST(TCL_LIB_SPEC) + AC_SUBST(TCL_LIB_VERSIONS_OK) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_SHARED_LIB_SUFFIX) -AC_PROVIDE([$0]) -AC_SUBST(TCLLIB) +dnl not used, don't export to save symbols +dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX) ]) + +# Warning: Tk definitions are very similar to Tcl definitions but +# are not precisely the same. There are a couple of differences, +# so don't do changes to Tcl thinking you can cut and paste it do +# the Tk differences and later simply substitute "Tk" for "Tcl". +# Known differences: +# - Acceptable Tcl major version #s is 7-9 while Tk is 4-9 +# - Searching for Tcl includes looking for tclInt.h, Tk looks for tk.h +# - Computing major/minor versions is different because Tk depends on +# headers to Tcl, Tk, and X. +# - Symbols in tkConfig.sh are different than tclConfig.sh +# - Acceptable for Tk to be missing but not Tcl. + AC_DEFUN(CY_AC_PATH_TKH, [ # # Ok, lets find the tk source trees so we can use the headers @@ -322,63 +308,66 @@ AC_DEFUN(CY_AC_PATH_TKH, [ # recursive cache variables for the path will work right. We check all # the possible paths in one loop rather than many seperate loops to speed # things up. -# the alternative search directory is invoked by --with-tkinclude +# the alternative search directory is involked by --with-tkinclude # -AC_MSG_CHECKING(for Tk private headers) -AC_ARG_WITH(tkinclude, [ --with-tkinclude directory where the tk private headers are], - with_tkinclude=${withval}) no_tk=true +AC_MSG_CHECKING(for Tk private headers) +AC_ARG_WITH(tkinclude, [ --with-tkinclude=DIR Directory where tk private headers are], with_tkinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tkh,[ # first check to see if --with-tkinclude was specified if test x"${with_tkinclude}" != x ; then if test -f ${with_tkinclude}/tk.h ; then ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)` + elif test -f ${with_tkinclude}/generic/tk.h ; then + ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)` else AC_MSG_ERROR([${with_tkinclude} directory doesn't contain private headers]) fi fi + +# next check if it came with Tk configuration file +if test x"${ac_cv_c_tkconfig}" = x ; then + if test -f $ac_cv_c_tkconfig/../generic/tk.h ; then + ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/..; pwd)` + fi +fi + # next check in private source directory # -# since ls returns lowest version numbers first, reverse the entire list -# and search for the worst fit, overwriting it with better fits as we find them +# since ls returns lowest version numbers first, reverse its output if test x"${ac_cv_c_tkh}" = x ; then for i in \ ${srcdir}/../tk \ - `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[4-9]]* 2>/dev/null` \ ${srcdir}/../../tk \ - `ls -dr ${srcdir}/../../tk[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../../tk[[4-9]]* 2>/dev/null` \ ${srcdir}/../../../tk \ - `ls -dr ${srcdir}/../../../tk[[0-9]]* 2>/dev/null ` ; do - if test -f $i/tk.h ; then - ac_cv_c_tkh=`(cd $i; pwd)` + `ls -dr ${srcdir}/../../../tk[[4-9]]* 2>/dev/null ` ; do + if test -f $i/generic/tk.h ; then + ac_cv_c_tkh=`(cd $i/generic; pwd)` break fi - # Tk 4.1 and greater puts this in a subdir. - if test -f $i/generic/tk.h; then - ac_cv_c_tkh=`(cd $i; pwd)`/generic - fi done fi # finally check in a few common install locations # -# since ls returns lowest version numbers first, reverse the entire list -# and search for the worst fit, overwriting it with better fits as we find them +# since ls returns lowest version numbers first, reverse its output if test x"${ac_cv_c_tkh}" = x ; then for i in \ - `ls -dr /usr/local/src/tk[[0-9]]* 2>/dev/null` \ - `ls -dr /usr/local/lib/tk[[0-9]]* 2>/dev/null` \ + `ls -dr /usr/local/src/tk[[4-9]]* 2>/dev/null` \ + `ls -dr /usr/local/lib/tk[[4-9]]* 2>/dev/null` \ /usr/local/src/tk \ /usr/local/lib/tk \ ${prefix}/include ; do - if test -f $i/tk.h ; then - ac_cv_c_tkh=`(cd $i; pwd)` + if test -f $i/generic/tk.h ; then + ac_cv_c_tkh=`(cd $i/generic; pwd)` break fi done fi # see if one is installed if test x"${ac_cv_c_tkh}" = x ; then - AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed) + AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed, ac_cv_c_tkh="") fi ]) if test x"${ac_cv_c_tkh}" != x ; then @@ -387,7 +376,7 @@ if test x"${ac_cv_c_tkh}" != x ; then AC_MSG_RESULT([is installed]) TKHDIR="" else - AC_MSG_RESULT([found in $ac_cv_c_tkh]) + AC_MSG_RESULT([found in ${ac_cv_c_tkh}]) # this hack is cause the TKHDIR won't print if there is a "-I" in it. TKHDIR="-I${ac_cv_c_tkh}" fi @@ -397,209 +386,922 @@ else no_tk=true fi -# if Tk is installed, extract the major/minor version -if test x"${no_tk}" = x ; then -AC_MSG_CHECKING([Tk version]) -rm -rf tkmajor tkminor -orig_includes="$CPPFLAGS" - -if test x"${TCLHDIR}" != x ; then - CPPFLAGS="$CPPFLAGS $TCLHDIR" -fi -if test x"${TKHDIR}" != x ; then - CPPFLAGS="$CPPFLAGS $TKHDIR" -fi -if test x"${x_includes}" != x -a x"${x_includes}" != xNONE ; then - CPPFLAGS="$CPPFLAGS -I$x_includes" -fi - -AC_TRY_RUN([ -#include -#include "tk.h" - main() { - FILE *maj = fopen("tkmajor","w"); - FILE *min = fopen("tkminor","w"); - fprintf(maj,"%d",TK_MAJOR_VERSION); - fprintf(min,"%d",TK_MINOR_VERSION); - fclose(maj); - fclose(min); - return 0; -}], - tkmajor=`cat tkmajor` - tkminor=`cat tkminor` - tkversion=$tkmajor.$tkminor - AC_MSG_RESULT($tkversion) - rm -f tkmajor tkminor -, - AC_MSG_ERROR([ -cannot compile a simple X program - suspect your xmkmf is -misconfigured and is incorrectly reporting the location of your X -include or libraries - report this to your system admin]) , - AC_MSG_ERROR([can't be cross compiled]) -) -CPPFLAGS="${orig_includes}" -fi - -AC_PROVIDE([$0]) AC_SUBST(TKHDIR) ]) -AC_DEFUN(CY_AC_PATH_TKLIB, [ -AC_REQUIRE([CY_AC_PATH_TCL]) + + +AC_DEFUN(CY_AC_PATH_TKCONFIG, [ # -# Ok, lets find the tk library -# First, look for the latest private (uninstalled) copy -# Notice that the destinations in backwards priority since the tests have -# no break. -# Then we look for either .a, .so, or Makefile. A Makefile is acceptable -# is it indicates the target has been configured and will (probably) -# soon be built. This allows an entire tree of Tcl software to be -# configured at once and then built. -# the alternative search directory is invoked by --with-tklib +# Ok, lets find the tk configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-tkconfig # if test x"${no_tk}" = x ; then - # reset no_tk incase something fails here - no_tk="true" - - if test $tkmajor -ge 4 ; then - installedtklibroot=tk$tkversion - else - installedtkllibroot=tk - fi + # we reset no_tk in case something fails here + no_tk=true + AC_ARG_WITH(tkconfig, [ --with-tkconfig=DIR Directory containing tk configuration (tkConfig.sh)], + with_tkconfig=${withval}) + AC_MSG_CHECKING([for Tk configuration]) + AC_CACHE_VAL(ac_cv_c_tkconfig,[ - AC_ARG_WITH(tklib, [ --with-tklib directory where the tk library is], - with_tklib=${withval}) - AC_MSG_CHECKING([for Tk library]) - AC_CACHE_VAL(ac_cv_c_tklib,[ - # first check to see if --with-tklib was specified - # This requires checking for both the installed and uninstalled name-styles - # since we have no idea if it's installed or not. - if test x"${with_tklib}" != x ; then - if test -f "${with_tklib}/lib$installedtklibroot.so" ; then - ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.so - no_tk="" - elif test -f "${with_tklib}/libtk.so" ; then - ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.so - no_tk="" - # then look for a freshly built statically linked library - # if Makefile exists we assume its configured and libtk will be built - elif test -f "${with_tklib}/lib$installedtklibroot.a" ; then - ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.a - no_tk="" - elif test -f "${with_tklib}/libtk.a" ; then - ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.a - no_tk="" + # First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else - AC_MSG_ERROR([${with_tklib} directory doesn't contain libraries]) + AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi + # then check for a private Tk library - # Since these are uninstalled, use the simple lib name root. - if test x"${ac_cv_c_tklib}" = x ; then + if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ - `ls -dr ../tk[[0-9]]* 2>/dev/null` \ + `ls -dr ../tk[[4-9]]* 2>/dev/null` \ ../../tk \ - `ls -dr ../../tk[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tk[[4-9]]* 2>/dev/null` \ ../../../tk \ - `ls -dr ../../../tk[[0-9]]* 2>/dev/null` ; do - # Tk 4.1 and greater puts things in subdirs. Check these first. - if test -f "$i/unix/libtk.so" ; then - ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so - no_tk= - break - elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then - ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.a - no_tk= - break - # look for a freshly built dynamically linked library - elif test -f "$i/libtk.so" ; then - ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so - no_tk= + `ls -dr ../../../tk[[4-9]]* 2>/dev/null` ; do + if test -f "$i/${configdir}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)` break - # then look for a freshly built statically linked library - # if Makefile exists we assume its configured and libtk will be built - elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then - ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a - no_tk="" - break fi done fi - # finally check in a few common install locations - if test x"${ac_cv_c_tklib}" = x ; then + # check in a few common install locations + if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do - # first look for a freshly built dynamically linked library - if test -f "$i/lib$installedtklibroot.so" ; then - ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.so - no_tk="" + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` break - # then look for a freshly built statically linked library - # if Makefile exists, we assume it's configured and libtcl will be built - elif test -f "$i/lib$installedtklibroot.a" -o -f "$i/Makefile" ; then - ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.a - no_tk="" - break fi done fi # check in a few other private locations - if test x"${ac_cv_c_tklib}" = x ; then + if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ - `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` ; do - # Tk 4.1 and greater puts things in subdirs. Check these first. - if test -f "$i/unix/libtk.so" ; then - ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so - no_tk= - break - elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then - ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtk.a - no_tk= - break - # look for a freshly built dynamically linked library - elif test -f "$i/libtk.so" ; then - ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so - no_tk="" + `ls -dr ${srcdir}/../tk[[4-9]]* 2>/dev/null` ; do + if test -f "$i/${configdir}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)` break - # then look for a freshly built statically linked library - # if Makefile exists, we assume it's configured and libtcl will be built - elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then - ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a - no_tk="" - break fi done fi - # see if one is conveniently installed with the compiler - if test x"${ac_cv_c_tklib}" = x ; then - AC_REQUIRE([AC_PATH_X]) - orig_libs="$LIBS" - LIBS="$LIBS -l$installedtklibroot $x_libraries $ac_cv_c_tcllib -lm" - AC_TRY_RUN([ - Tcl_AppInit() - { exit(0); }], ac_cv_c_tklib="-l$installedtklibroot", ac_cv_c_tklib="" - , ac_cv_c_tklib="-l$installedtklibroot") - LIBS="${orig_libs}" - fi ]) - if test x"${ac_cv_c_tklib}" = x ; then - TKLIB="# no Tk library found" - AC_MSG_WARN(Can't find Tk library) + if test x"${ac_cv_c_tkconfig}" = x ; then + TKCONFIG="# no Tk configs found" + AC_MSG_WARN(Can't find Tk configuration definitions) else - TKLIB=$ac_cv_c_tklib - AC_MSG_RESULT(found $TKLIB) no_tk= + TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh + AC_MSG_RESULT(found $TKCONFIG) fi fi -AC_PROVIDE([$0]) -AC_SUBST(TKLIB) + ]) -AC_DEFUN(CY_AC_PATH_TK, [ - CY_AC_PATH_TKH - CY_AC_PATH_TKLIB + +# Defined as a separate macro so we don't have to cache the values +# from PATH_TKCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_TKCONFIG, [ + if test -f "$TKCONFIG" ; then + . $TKCONFIG + fi + + AC_SUBST(TK_VERSION) +dnl not actually used, don't export to save symbols +dnl AC_SUBST(TK_MAJOR_VERSION) +dnl AC_SUBST(TK_MINOR_VERSION) + AC_SUBST(TK_DEFS) + +dnl not used, don't export to save symbols + dnl AC_SUBST(TK_LIB_FILE) + +dnl not used outside of configure +dnl AC_SUBST(TK_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(TK_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TK_EXEC_PREFIX) + + AC_SUBST(TK_BUILD_INCLUDES) + AC_SUBST(TK_XINCLUDES) + AC_SUBST(TK_XLIBSW) + AC_SUBST(TK_BUILD_LIB_SPEC) + AC_SUBST(TK_LIB_SPEC) +]) + +# check for Itcl headers. + +AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [ +# +# Ok, lets find the itcl configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-itclconfig +# + +if test x"${no_itcl}" = x ; then + # we reset no_itcl in case something fails here + no_itcl=true + AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)], + with_itclconfig=${withval}) + AC_MSG_CHECKING([for Itcl configuration]) + AC_CACHE_VAL(ac_cv_c_itclconfig,[ + + # First check to see if --with-itclconfig was specified. + if test x"${with_itclconfig}" != x ; then + if test -f "${with_itclconfig}/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd ${with_itclconfig}; pwd)` + else + AC_MSG_ERROR([${with_itclconfig} directory doesn't contain itclConfig.sh]) + fi + fi + + # then check for a private Itcl library + if test x"${ac_cv_c_itclconfig}" = x ; then + for i in \ + ../itcl/itcl \ + `ls -dr ../itcl[[4-9]]*/itcl 2>/dev/null` \ + ../../itcl \ + `ls -dr ../../itcl[[4-9]]*/itcl 2>/dev/null` \ + ../../../itcl \ + `ls -dr ../../../itcl[[4-9]]*/itcl 2>/dev/null` ; do + if test -f "$i/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_itclconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + if test -f "$i/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_itclconfig}" = x ; then + for i in \ + ${srcdir}/../itcl/itcl \ + `ls -dr ${srcdir}/../itcl[[4-9]]*/itcl 2>/dev/null` ; do + if test -f "$i/itclConfig.sh" ; then + ac_cv_c_itclconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_itclconfig}" = x ; then + ITCLCONFIG="# no Itcl configs found" + AC_MSG_WARN(Can't find Itcl configuration definitions) + else + no_itcl= + ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh + AC_MSG_RESULT(found $ITCLCONFIG) + fi +fi +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_ITCLCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_ITCLCONFIG, [ + if test -f "$ITCLCONFIG" ; then + . $ITCLCONFIG + fi + + AC_SUBST(ITCL_VERSION) +dnl not actually used, don't export to save symbols +dnl AC_SUBST(ITCL_MAJOR_VERSION) +dnl AC_SUBST(ITCL_MINOR_VERSION) + AC_SUBST(ITCL_DEFS) + +dnl not used, don't export to save symbols + dnl AC_SUBST(ITCL_LIB_FILE) + +dnl not used outside of configure +dnl AC_SUBST(ITCL_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(ITCL_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(ITCL_EXEC_PREFIX) + + AC_SUBST(ITCL_BUILD_INCLUDES) + AC_SUBST(ITCL_BUILD_LIB_SPEC) + AC_SUBST(ITCL_LIB_SPEC) ]) -AC_DEFUN(CY_AC_PATH_TCL, [ - CY_AC_PATH_TCLH - CY_AC_PATH_TCLLIB + +# check for Itcl headers. + +AC_DEFUN(CY_AC_PATH_ITCLH, [ +AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir}) +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 + ac_cv_c_itclh=`(cd $i/generic; pwd)` + break + fi + done +fi +if test x"${ac_cv_c_itclh}" = x ; then + ITCLHDIR="# no Itcl private headers found" + AC_MSG_ERROR([Can't find Itcl private headers]) +fi +if test x"${ac_cv_c_itclh}" != x ; then + ITCLHDIR="-I${ac_cv_c_itclh}" +fi +# should always be here +# ITCLLIB="../itcl/itcl/unix/libitcl.a" +AC_SUBST(ITCLHDIR) +#AC_SUBST(ITCLLIB) ]) + + +AC_DEFUN(CY_AC_PATH_ITKCONFIG, [ +# +# Ok, lets find the itk configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-itkconfig +# + +if test x"${no_itk}" = x ; then + # we reset no_itk in case something fails here + no_itk=true + AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)], + with_itkconfig=${withval}) + AC_MSG_CHECKING([for Itk configuration]) + AC_CACHE_VAL(ac_cv_c_itkconfig,[ + + # First check to see if --with-itkconfig was specified. + if test x"${with_itkconfig}" != x ; then + if test -f "${with_itkconfig}/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd ${with_itkconfig}; pwd)` + else + AC_MSG_ERROR([${with_itkconfig} directory doesn't contain itkConfig.sh]) + fi + fi + + # then check for a private Itk library + if test x"${ac_cv_c_itkconfig}" = x ; then + for i in \ + ../itcl/itk \ + `ls -dr ../itcl[[4-9]]*/itk 2>/dev/null` \ + ../../itk \ + `ls -dr ../../itcl[[4-9]]*/itk 2>/dev/null` \ + ../../../itk \ + `ls -dr ../../../itcl[[4-9]]*/itk 2>/dev/null` ; do + if test -f "$i/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_itkconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + if test -f "$i/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_itkconfig}" = x ; then + for i in \ + ${srcdir}/../itcl/itk \ + `ls -dr ${srcdir}/../itcl[[4-9]]*/itk 2>/dev/null` ; do + if test -f "$i/itkConfig.sh" ; then + ac_cv_c_itkconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_itkconfig}" = x ; then + ITKCONFIG="# no Itk configs found" + AC_MSG_WARN(Can't find Itk configuration definitions) + else + no_itk= + ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh + AC_MSG_RESULT(found $ITKCONFIG) + fi +fi + +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_ITKCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_ITKCONFIG, [ + if test -f "$ITKCONFIG" ; then + . $ITKCONFIG + fi + + AC_SUBST(ITK_VERSION) +dnl not actually used, don't export to save symbols +dnl AC_SUBST(ITK_MAJOR_VERSION) +dnl AC_SUBST(ITK_MINOR_VERSION) + AC_SUBST(ITK_DEFS) + +dnl not used, don't export to save symbols + dnl AC_SUBST(ITK_LIB_FILE) + +dnl not used outside of configure +dnl AC_SUBST(ITK_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(ITK_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(ITK_EXEC_PREFIX) + + AC_SUBST(ITK_BUILD_INCLUDES) + AC_SUBST(ITK_BUILD_LIB_SPEC) + AC_SUBST(ITK_LIB_SPEC) +]) + +AC_DEFUN(CY_AC_PATH_ITKH, [ +AC_MSG_CHECKING(for Itk private headers. srcdir=${srcdir}) +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 + ac_cv_c_itkh=`(cd $i/generic; pwd)` + break + fi + done +fi +if test x"${ac_cv_c_itkh}" = x ; then + ITKHDIR="# no Itk private headers found" + AC_MSG_ERROR([Can't find Itk private headers]) +fi +if test x"${ac_cv_c_itkh}" != x ; then + ITKHDIR="-I${ac_cv_c_itkh}" +fi +# should always be here +# ITKLIB="../itcl/itk/unix/libitk.a" +AC_SUBST(ITKHDIR) +#AC_SUBST(ITKLIB) +]) + +# check for Tix headers. + +AC_DEFUN(CY_AC_PATH_TIXH, [ +AC_MSG_CHECKING(for Tix private headers. srcdir=${srcdir}) +if test x"${ac_cv_c_tixh}" = x ; then + for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do + if test -f $i/generic/tix.h ; then + ac_cv_c_tixh=`(cd $i/generic; pwd)` + break + fi + done +fi +if test x"${ac_cv_c_tixh}" = x ; then + TIXHDIR="# no Tix private headers found" + AC_MSG_ERROR([Can't find Tix private headers]) +fi +if test x"${ac_cv_c_tixh}" != x ; then + TIXHDIR="-I${ac_cv_c_tixh}" +fi +AC_SUBST(TIXHDIR) +]) + +AC_DEFUN(CY_AC_PATH_TIXCONFIG, [ +# +# Ok, lets find the tix configuration +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-itkconfig +# + +if test x"${no_tix}" = x ; then + # we reset no_tix in case something fails here + no_tix=true + AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)], + with_tixconfig=${withval}) + AC_MSG_CHECKING([for Tix configuration]) + AC_CACHE_VAL(ac_cv_c_tixconfig,[ + + # First check to see if --with-tixconfig was specified. + if test x"${with_tixconfig}" != x ; then + if test -f "${with_tixconfig}/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd ${with_tixconfig}; pwd)` + else + AC_MSG_ERROR([${with_tixconfig} directory doesn't contain tixConfig.sh]) + fi + fi + + # then check for a private Tix library + if test x"${ac_cv_c_tixconfig}" = x ; then + for i in \ + ../tix \ + `ls -dr ../tix 2>/dev/null` \ + ../../tix \ + `ls -dr ../../tix 2>/dev/null` \ + ../../../tix \ + `ls -dr ../../../tix 2>/dev/null` ; do + echo "**** Looking at $i - with ${configdir}" + if test -f "$i/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_tixconfig}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + echo "**** Looking at $i" + if test -f "$i/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd $i; pwd)` + break + fi + done + fi + # check in a few other private locations + echo "**** Other private locations" + if test x"${ac_cv_c_tixconfig}" = x ; then + for i in \ + ${srcdir}/../tix \ + `ls -dr ${srcdir}/../tix 2>/dev/null` ; do + echo "**** Looking at $i - with ${configdir}" + if test -f "$i/${configdir}/tixConfig.sh" ; then + ac_cv_c_tixconfig=`(cd $i/${configdir}; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_tixconfig}" = x ; then + TIXCONFIG="# no Tix configs found" + AC_MSG_WARN(Can't find Tix configuration definitions) + else + no_tix= + TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh + AC_MSG_RESULT(found $TIXCONFIG) + fi +fi + +]) + +# Defined as a separate macro so we don't have to cache the values +# from PATH_TIXCONFIG (because this can also be cached). +AC_DEFUN(CY_AC_LOAD_TIXCONFIG, [ + if test -f "$TIXCONFIG" ; then + . $TIXCONFIG + fi + + AC_SUBST(TIX_VERSION) +dnl not actually used, don't export to save symbols +dnl AC_SUBST(TIX_MAJOR_VERSION) +dnl AC_SUBST(TIX_MINOR_VERSION) +dnl AC_SUBST(TIX_DEFS) + +dnl not used, don't export to save symbols +dnl dnl AC_SUBST(TIX_LIB_FILE) + +dnl not used outside of configure +dnl AC_SUBST(TIX_LIBS) +dnl not used, don't export to save symbols +dnl AC_SUBST(TIX_PREFIX) + +dnl not used, don't export to save symbols +dnl AC_SUBST(TIX_EXEC_PREFIX) + +dnl AC_SUBST(TIX_BUILD_INCLUDES) + AC_SUBST(TIX_BUILD_LIB_SPEC) +dnl AC_SUBST(TIX_LIB_SPEC) +]) + + +# serial 1 + +# @defmac AC_PROG_CC_STDC +# @maindex PROG_CC_STDC +# @ovindex CC +# If the C compiler in not in ANSI C mode by default, try to add an option +# to output variable @code{CC} to make it so. This macro tries various +# options that select ANSI C on some system or another. It considers the +# compiler to be in ANSI C mode if it handles function prototypes correctly. +# +# If you use this macro, you should check after calling it whether the C +# compiler has been set to accept ANSI C; if not, the shell variable +# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source +# code in ANSI C, you can make an un-ANSIfied copy of it by using the +# program @code{ansi2knr}, which comes with Ghostscript. +# @end defmac + +AC_DEFUN(AM_PROG_CC_STDC, +[AC_REQUIRE([AC_PROG_CC]) +AC_BEFORE([$0], [AC_C_INLINE]) +AC_BEFORE([$0], [AC_C_CONST]) +dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require +dnl a magic option to avoid problems with ANSI preprocessor commands +dnl like #elif. +dnl FIXME: can't do this because then AC_AIX won't work due to a +dnl circular dependency. +dnl AC_BEFORE([$0], [AC_PROG_CPP]) +AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) +AC_CACHE_VAL(am_cv_prog_cc_stdc, +[am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + AC_TRY_COMPILE( +[#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +], [ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +], +[am_cv_prog_cc_stdc="$ac_arg"; break]) +done +CC="$ac_save_CC" +]) +if test -z "$am_cv_prog_cc_stdc"; then + AC_MSG_RESULT([none needed]) +else + AC_MSG_RESULT($am_cv_prog_cc_stdc) +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac +]) + +# This file is derived from `gettext.m4'. The difference is that the +# included macros assume Cygnus-style source and build trees. + +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 3 + +AC_DEFUN(CY_WITH_NLS, + [AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) + + USE_INCLUDED_LIBINTL=no + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested]) + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If gettext or catgets are available (in this order) we + dnl use this. Else we have to fall back to GNU NLS library. + dnl catgets is only used if permitted by option --with-catgets. + nls_cv_header_intl= + nls_cv_header_libgt= + CATOBJEXT=NONE + + AC_CHECK_HEADER(libintl.h, + [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, + [AC_TRY_LINK([#include ], [return (int) gettext ("")], + gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) + + if test "$gt_cv_func_gettext_libc" != "yes"; then + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CACHE_CHECK([for gettext in libintl], + gt_cv_func_gettext_libintl, + [AC_TRY_LINK([], [return (int) gettext ("")], + gt_cv_func_gettext_libintl=yes, + gt_cv_func_gettext_libintl=no)])]) + fi + + if test "$gt_cv_func_gettext_libc" = "yes" \ + || test "$gt_cv_func_gettext_libintl" = "yes"; then + AC_DEFINE(HAVE_GETTEXT, 1, + [Define as 1 if you have gettext and don't want to use GNU gettext.]) + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + AC_CHECK_FUNCS(dcgettext) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + INSTOBJEXT=.mo + fi + fi + ]) + + dnl In the standard gettext, we would now check for catgets. + dnl However, we never want to use catgets for our releases. + + if test "$CATOBJEXT" = "NONE"; then + dnl Neither gettext nor catgets in included in the C library. + dnl Fall back on GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + INTLOBJS="\$(GETTOBJS)" + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_SUBST(MSGFMT) + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INSTOBJEXT=.mo + DATADIRNAME=share + INTLDEPS='$(top_builddir)/../intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=libintl.h + nls_cv_header_libgt=libgettext.h + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext programs is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + else + DATADIRNAME=share + nls_cv_header_intl=libintl.h + nls_cv_header_libgt=libgettext.h + fi + + # If this is used in GNU gettext we have to set USE_NLS to `yes' + # because some of the sources are only built for this goal. + if test "$PACKAGE" = gettext; then + USE_NLS=yes + USE_INCLUDED_LIBINTL=yes + fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLDEPS) + AC_SUBST(INTLLIBS) + AC_SUBST(INTLOBJS) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +AC_DEFUN(CY_GNU_GETTEXT, + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ +unistd.h values.h sys/param.h]) + AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ +__argz_count __argz_stringify __argz_next]) + + if test "${ac_cv_func_stpcpy+set}" != "set"; then + AC_CHECK_FUNCS(stpcpy) + fi + if test "${ac_cv_func_stpcpy}" = "yes"; then + AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function]) + fi + + AM_LC_MESSAGES + CY_WITH_NLS + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl The reference to in the installed file + dnl must be resolved because we cannot expect the users of this + dnl to define HAVE_LOCALE_H. + if test $ac_cv_header_locale_h = yes; then + INCLUDE_LOCALE_H="#include " + else + INCLUDE_LOCALE_H="\ +/* The system does not provide the header . Take care yourself. */" + fi + AC_SUBST(INCLUDE_LOCALE_H) + + dnl Determine which catalog format we have (if any is needed) + dnl For now we know about two different formats: + dnl Linux libc-5 and the normal X/Open format + if test -f $srcdir/po2tbl.sed.in; then + if test "$CATOBJEXT" = ".cat"; then + AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) + + dnl Transform the SED scripts while copying because some dumb SEDs + dnl cannot handle comments. + sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed + fi + dnl po2tbl.sed is always needed. + sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ + $srcdir/po2tbl.sed.in > po2tbl.sed + fi + + dnl In the intl/Makefile.in we have a special dependency which makes + dnl only sense for gettext. We comment this out for non-gettext + dnl packages. + if test "$PACKAGE" = "gettext"; then + GT_NO="#NO#" + GT_YES= + else + GT_NO= + GT_YES="#YES#" + fi + AC_SUBST(GT_NO) + AC_SUBST(GT_YES) + + MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" + AC_SUBST(MKINSTALLDIRS) + + dnl *** For now the libtool support in intl/Makefile is not for real. + l= + AC_SUBST(l) + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. But only do this if the po directory + dnl exists in srcdir. + if test -d $srcdir/po; then + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + fi + ]) + +# Search path for a program which passes the given test. +# Ulrich Drepper , 1996. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN(AM_PATH_PROG_WITH_TEST, +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# Check whether LC_MESSAGES is available in . +# Ulrich Drepper , 1995. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +AC_DEFUN(AM_LC_MESSAGES, + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your locale.h file contains LC_MESSAGES.]) + fi + fi]) + diff --git a/contrib/gdb/gdb/alpha-nat.c b/contrib/gdb/gdb/alpha-nat.c index b027116..59bd0d8 100644 --- a/contrib/gdb/gdb/alpha-nat.c +++ b/contrib/gdb/gdb/alpha-nat.c @@ -1,5 +1,5 @@ /* Low level Alpha interface, for GDB when running native. - Copyright 1993, 1995, 1996 Free Software Foundation, Inc. + Copyright 1993, 1995, 1996, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -22,9 +22,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdbcore.h" #include "target.h" #include -#include +#ifdef __linux__ +# include +# include +#else +# include +#endif #include +/* Prototypes for local functions. */ + +static void fetch_osf_core_registers PARAMS ((char *, + unsigned, int, CORE_ADDR)); +static void fetch_elf_core_registers PARAMS ((char *, + unsigned, int, CORE_ADDR)); + /* Size of elements in jmpbuf */ #define JB_ELEMENT_SIZE 8 @@ -74,11 +86,11 @@ get_longjmp_target (pc) */ static void -fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) +fetch_osf_core_registers (core_reg_sect, core_reg_size, which, reg_addr) char *core_reg_sect; unsigned core_reg_size; int which; - unsigned reg_addr; + CORE_ADDR reg_addr; { register int regno; register int addr; @@ -121,10 +133,42 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) } if (bad_reg >= 0) { - error ("Register %s not found in core file.", reg_names[bad_reg]); + error ("Register %s not found in core file.", REGISTER_NAME (bad_reg)); } } +static void +fetch_elf_core_registers (core_reg_sect, core_reg_size, which, reg_addr) + char *core_reg_sect; + unsigned core_reg_size; + int which; + CORE_ADDR reg_addr; +{ + if (core_reg_size < 32*8) + { + error ("Core file register section too small (%u bytes).", core_reg_size); + return; + } + + if (which == 2) + { + /* The FPU Registers. */ + memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 31*8); + memset (®isters[REGISTER_BYTE (FP0_REGNUM+31)], 0, 8); + memset (®ister_valid[FP0_REGNUM], 1, 32); + } + else + { + /* The General Registers. */ + memcpy (®isters[REGISTER_BYTE (V0_REGNUM)], core_reg_sect, 31*8); + memcpy (®isters[REGISTER_BYTE (PC_REGNUM)], core_reg_sect+31*8, 8); + memset (®isters[REGISTER_BYTE (ZERO_REGNUM)], 0, 8); + memset (®ister_valid[V0_REGNUM], 1, 32); + register_valid[PC_REGNUM] = 1; + } +} + + /* Map gdb internal register number to a ptrace ``address''. These ``addresses'' are defined in */ @@ -136,10 +180,10 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) /* Return the ptrace ``address'' of register REGNO. */ -unsigned int +CORE_ADDR register_addr (regno, blockend) int regno; - int blockend; + CORE_ADDR blockend; { return REGISTER_PTRACE_ADDR (regno); } @@ -150,7 +194,7 @@ kernel_u_size () return (sizeof (struct user)); } -#ifdef USE_PROC_FS +#if defined(USE_PROC_FS) || defined(HAVE_GREGSET_T) #include /* @@ -162,7 +206,7 @@ supply_gregset (gregsetp) gregset_t *gregsetp; { register int regi; - register long *regp = gregsetp->regs; + register long *regp = ALPHA_REGSET_BASE (gregsetp); static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; for (regi = 0; regi < 31; regi++) @@ -181,7 +225,7 @@ fill_gregset (gregsetp, regno) int regno; { int regi; - register long *regp = gregsetp->regs; + register long *regp = ALPHA_REGSET_BASE (gregsetp); for (regi = 0; regi < 31; regi++) if ((regno == -1) || (regno == regi)) @@ -201,7 +245,7 @@ supply_fpregset (fpregsetp) fpregset_t *fpregsetp; { register int regi; - register long *regp = fpregsetp->regs; + register long *regp = ALPHA_REGSET_BASE (fpregsetp); for (regi = 0; regi < 32; regi++) supply_register (regi + FP0_REGNUM, (char *)(regp + regi)); @@ -213,7 +257,7 @@ fill_fpregset (fpregsetp, regno) int regno; { int regi; - register long *regp = fpregsetp->regs; + register long *regp = ALPHA_REGSET_BASE (fpregsetp); for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++) { @@ -229,15 +273,25 @@ fill_fpregset (fpregsetp, regno) /* Register that we are able to handle alpha core file formats. */ -static struct core_fns alpha_core_fns = +static struct core_fns alpha_osf_core_fns = +{ + /* This really is bfd_target_unknown_flavour. */ + + bfd_target_unknown_flavour, + fetch_osf_core_registers, + NULL +}; + +static struct core_fns alpha_elf_core_fns = { - bfd_target_aout_flavour, - fetch_core_registers, + bfd_target_elf_flavour, + fetch_elf_core_registers, NULL }; void _initialize_core_alpha () { - add_core_fns (&alpha_core_fns); + add_core_fns (&alpha_osf_core_fns); + add_core_fns (&alpha_elf_core_fns); } diff --git a/contrib/gdb/gdb/alpha-tdep.c b/contrib/gdb/gdb/alpha-tdep.c index 7fbf642..0201016 100644 --- a/contrib/gdb/gdb/alpha-tdep.c +++ b/contrib/gdb/gdb/alpha-tdep.c @@ -1,5 +1,5 @@ /* Target-dependent code for the ALPHA architecture, for GDB, the GNU Debugger. - Copyright 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -31,11 +31,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* FIXME: Some of this code should perhaps be merged with mips-tdep.c. */ -/* FIXME: Put this declaration in frame.h. */ -extern struct obstack frame_cache_obstack; - +/* Prototypes for local functions. */ -/* Forward declarations. */ +static alpha_extra_func_info_t push_sigtramp_desc PARAMS ((CORE_ADDR low_addr)); static CORE_ADDR read_next_frame_reg PARAMS ((struct frame_info *, int)); @@ -132,6 +130,113 @@ struct linked_proc_info } *linked_proc_desc_table = NULL; +/* Under GNU/Linux, signal handler invocations can be identified by the + designated code sequence that is used to return from a signal + handler. In particular, the return address of a signal handler + points to the following sequence (the first instruction is quadword + aligned): + + bis $30,$30,$16 + addq $31,0x67,$0 + call_pal callsys + + Each instruction has a unique encoding, so we simply attempt to + match the instruction the pc is pointing to with any of the above + instructions. If there is a hit, we know the offset to the start + of the designated sequence and can then check whether we really are + executing in a designated sequence. If not, -1 is returned, + otherwise the offset from the start of the desingated sequence is + returned. + + There is a slight chance of false hits: code could jump into the + middle of the designated sequence, in which case there is no + guarantee that we are in the middle of a sigreturn syscall. Don't + think this will be a problem in praxis, though. +*/ + +long +alpha_linux_sigtramp_offset (CORE_ADDR pc) +{ + unsigned int i[3], w; + long off; + + if (read_memory_nobpt(pc, (char *) &w, 4) != 0) + return -1; + + off = -1; + switch (w) + { + case 0x47de0410: off = 0; break; /* bis $30,$30,$16 */ + case 0x43ecf400: off = 4; break; /* addq $31,0x67,$0 */ + case 0x00000083: off = 8; break; /* call_pal callsys */ + default: return -1; + } + pc -= off; + if (pc & 0x7) + { + /* designated sequence is not quadword aligned */ + return -1; + } + + if (read_memory_nobpt(pc, (char *) i, sizeof(i)) != 0) + return -1; + + if (i[0] == 0x47de0410 && i[1] == 0x43ecf400 && i[2] == 0x00000083) + return off; + + return -1; +} + + +/* Under OSF/1, the __sigtramp routine is frameless and has a frame + size of zero, but we are able to backtrace through it. */ +CORE_ADDR +alpha_osf_skip_sigtramp_frame (frame, pc) + struct frame_info *frame; + CORE_ADDR pc; +{ + char *name; + find_pc_partial_function (pc, &name, (CORE_ADDR *)NULL, (CORE_ADDR *)NULL); + if (IN_SIGTRAMP (pc, name)) + return frame->frame; + else + return 0; +} + + +/* Dynamically create a signal-handler caller procedure descriptor for + the signal-handler return code starting at address LOW_ADDR. The + descriptor is added to the linked_proc_desc_table. */ + +static alpha_extra_func_info_t +push_sigtramp_desc (low_addr) + CORE_ADDR low_addr; +{ + struct linked_proc_info *link; + alpha_extra_func_info_t proc_desc; + + link = (struct linked_proc_info *) + xmalloc (sizeof (struct linked_proc_info)); + link->next = linked_proc_desc_table; + linked_proc_desc_table = link; + + proc_desc = &link->info; + + proc_desc->numargs = 0; + PROC_LOW_ADDR (proc_desc) = low_addr; + PROC_HIGH_ADDR (proc_desc) = low_addr + 3 * 4; + PROC_DUMMY_FRAME (proc_desc) = 0; + PROC_FRAME_OFFSET (proc_desc) = 0x298; /* sizeof(struct sigcontext_struct) */ + PROC_FRAME_REG (proc_desc) = SP_REGNUM; + PROC_REG_MASK (proc_desc) = 0xffff; + PROC_FREG_MASK (proc_desc) = 0xffff; + PROC_PC_REG (proc_desc) = 26; + PROC_LOCALOFF (proc_desc) = 0; + SET_PROC_DESC_IS_DYN_SIGTRAMP (proc_desc); + return (proc_desc); +} + + /* Guaranteed to set frame->saved_regs to some values (it never leaves it NULL). */ @@ -145,9 +250,7 @@ alpha_find_saved_regs (frame) alpha_extra_func_info_t proc_desc; int returnreg; - frame->saved_regs = (struct frame_saved_regs *) - obstack_alloc (&frame_cache_obstack, sizeof(struct frame_saved_regs)); - memset (frame->saved_regs, 0, sizeof (struct frame_saved_regs)); + frame_saved_regs_zalloc (frame); /* If it is the frame for __sigtramp, the saved registers are located in a sigcontext structure somewhere on the stack. __sigtramp @@ -161,25 +264,20 @@ alpha_find_saved_regs (frame) #endif if (frame->signal_handler_caller) { - CORE_ADDR sigcontext_pointer_addr; CORE_ADDR sigcontext_addr; - if (frame->next) - sigcontext_pointer_addr = frame->next->frame; - else - sigcontext_pointer_addr = frame->frame; - sigcontext_addr = read_memory_integer(sigcontext_pointer_addr, 8); + sigcontext_addr = SIGCONTEXT_ADDR (frame); for (ireg = 0; ireg < 32; ireg++) { reg_position = sigcontext_addr + SIGFRAME_REGSAVE_OFF + ireg * 8; - frame->saved_regs->regs[ireg] = reg_position; + frame->saved_regs[ireg] = reg_position; } for (ireg = 0; ireg < 32; ireg++) { reg_position = sigcontext_addr + SIGFRAME_FPREGSAVE_OFF + ireg * 8; - frame->saved_regs->regs[FP0_REGNUM + ireg] = reg_position; + frame->saved_regs[FP0_REGNUM + ireg] = reg_position; } - frame->saved_regs->regs[PC_REGNUM] = sigcontext_addr + SIGFRAME_PC_OFF; + frame->saved_regs[PC_REGNUM] = sigcontext_addr + SIGFRAME_PC_OFF; return; } @@ -202,7 +300,7 @@ alpha_find_saved_regs (frame) register number. */ if (mask & (1 << returnreg)) { - frame->saved_regs->regs[returnreg] = reg_position; + frame->saved_regs[returnreg] = reg_position; reg_position += 8; mask &= ~(1 << returnreg); /* Clear bit for RA so we don't save again later. */ @@ -211,7 +309,7 @@ alpha_find_saved_regs (frame) for (ireg = 0; ireg <= 31 ; ++ireg) if (mask & (1 << ireg)) { - frame->saved_regs->regs[ireg] = reg_position; + frame->saved_regs[ireg] = reg_position; reg_position += 8; } @@ -224,11 +322,11 @@ alpha_find_saved_regs (frame) for (ireg = 0; ireg <= 31 ; ++ireg) if (mask & (1 << ireg)) { - frame->saved_regs->regs[FP0_REGNUM+ireg] = reg_position; + frame->saved_regs[FP0_REGNUM+ireg] = reg_position; reg_position += 8; } - frame->saved_regs->regs[PC_REGNUM] = frame->saved_regs->regs[returnreg]; + frame->saved_regs[PC_REGNUM] = frame->saved_regs[returnreg]; } static CORE_ADDR @@ -246,8 +344,8 @@ read_next_frame_reg(fi, regno) { if (fi->saved_regs == NULL) alpha_find_saved_regs (fi); - if (fi->saved_regs->regs[regno]) - return read_memory_integer(fi->saved_regs->regs[regno], 8); + if (fi->saved_regs[regno]) + return read_memory_integer(fi->saved_regs[regno], 8); } } return read_register(regno); @@ -285,13 +383,28 @@ alpha_saved_pc_after_call (frame) proc_desc = find_proc_desc (pc, frame->next); pcreg = proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM; - return read_register (pcreg); + if (frame->signal_handler_caller) + return alpha_frame_saved_pc (frame); + else + return read_register (pcreg); } static struct alpha_extra_func_info temp_proc_desc; static struct frame_saved_regs temp_saved_regs; +/* Nonzero if instruction at PC is a return instruction. "ret + $zero,($ra),1" on alpha. */ + +static int +alpha_about_to_return (pc) + CORE_ADDR pc; +{ + return read_memory_integer (pc, 4) == 0x6bfa8001; +} + + + /* This fencepost looks highly suspicious to me. Removing it also seems suspicious as it could affect remote debugging across serial lines. */ @@ -342,8 +455,8 @@ Otherwise, you told GDB there was a function where there isn't one, or\n\ return 0; } - else if (ABOUT_TO_RETURN(start_pc)) - break; + else if (alpha_about_to_return (start_pc)) + break; start_pc += 4; /* skip return */ return start_pc; @@ -382,7 +495,15 @@ heuristic_proc_desc(start_pc, limit_pc, next_frame) word = extract_unsigned_integer (buf, 4); if ((word & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ - frame_size += (-word) & 0xffff; + { + if (word & 0x8000) + frame_size += (-word) & 0xffff; + else + /* Exit loop if a positive stack adjustment is found, which + usually means that the stack cleanup code in the function + epilogue is reached. */ + break; + } else if ((word & 0xfc1f0000) == 0xb41e0000 /* stq reg,n($sp) */ && (word & 0xffff0000) != 0xb7fe0000) /* reg != $zero */ { @@ -404,14 +525,18 @@ heuristic_proc_desc(start_pc, limit_pc, next_frame) rearrange the register saves. So we recognize only a few registers (t7, t9, ra) within the procedure prologue as valid return address registers. + If we encounter a return instruction, we extract the + the return address register from it. FIXME: Rewriting GDB to access the procedure descriptors, e.g. via the minimal symbol table, might obviate this hack. */ if (pcreg == -1 - && cur_pc < (start_pc + 20) + && cur_pc < (start_pc + 80) && (reg == T7_REGNUM || reg == T9_REGNUM || reg == RA_REGNUM)) pcreg = reg; } + else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */ + pcreg = (word >> 16) & 0x1f; else if (word == 0x47de040f) /* bis sp,sp fp */ has_frame_reg = 1; } @@ -419,15 +544,13 @@ heuristic_proc_desc(start_pc, limit_pc, next_frame) { /* If we haven't found a valid return address register yet, keep searching in the procedure prologue. */ - while (cur_pc < (limit_pc + 20) && cur_pc < (start_pc + 20)) + while (cur_pc < (limit_pc + 80) && cur_pc < (start_pc + 80)) { char buf[4]; unsigned long word; - int status; - status = read_memory_nobpt (cur_pc, buf, 4); - if (status) - memory_error (status, cur_pc); + if (read_memory_nobpt (cur_pc, buf, 4)) + break; cur_pc += 4; word = extract_unsigned_integer (buf, 4); @@ -441,6 +564,11 @@ heuristic_proc_desc(start_pc, limit_pc, next_frame) break; } } + else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */ + { + pcreg = (word >> 16) & 0x1f; + break; + } } } @@ -471,6 +599,9 @@ after_prologue (pc, proc_desc) if (proc_desc) { + if (PROC_DESC_IS_DYN_SIGTRAMP (proc_desc)) + return PROC_LOW_ADDR (proc_desc); /* "prologue" is in kernel */ + /* If function is frameless, then we need to do it the hard way. I strongly suspect that frameless always means prologueless... */ if (PROC_FRAME_REG (proc_desc) == SP_REGNUM @@ -493,7 +624,7 @@ after_prologue (pc, proc_desc) } /* Return non-zero if we *might* be in a function prologue. Return zero if we - are definatly *not* in a function prologue. */ + are definitively *not* in a function prologue. */ static int alpha_in_prologue (pc, proc_desc) @@ -599,6 +730,8 @@ find_proc_desc (pc, next_frame) } else { + long offset; + /* Is linked_proc_desc_table really necessary? It only seems to be used by procedure call dummys. However, the procedures being called ought to have their own proc_descs, and even if they don't, @@ -610,7 +743,19 @@ find_proc_desc (pc, next_frame) && PROC_HIGH_ADDR(&link->info) > pc) return &link->info; - if (startaddr == 0) + /* If PC is inside a dynamically generated sigtramp handler, + create and push a procedure descriptor for that code: */ + offset = DYNAMIC_SIGTRAMP_OFFSET (pc); + if (offset >= 0) + return push_sigtramp_desc (pc - offset); + + /* If heuristic_fence_post is non-zero, determine the procedure + start address by examining the instructions. + This allows us to find the start address of static functions which + have no symbolic information, as startaddr would have been set to + the preceding global function start address by the + find_pc_partial_function call above. */ + if (startaddr == 0 || heuristic_fence_post != 0) startaddr = heuristic_proc_start (pc); proc_desc = @@ -650,17 +795,7 @@ alpha_frame_chain(frame) /* The previous frame from a sigtramp frame might be frameless and have frame size zero. */ && !frame->signal_handler_caller) - { - /* The alpha __sigtramp routine is frameless and has a frame size - of zero, but we are able to backtrace through it. */ - char *name; - find_pc_partial_function (saved_pc, &name, - (CORE_ADDR *)NULL, (CORE_ADDR *)NULL); - if (IN_SIGTRAMP (saved_pc, name)) - return frame->frame; - else - return 0; - } + return FRAME_PAST_SIGTRAMP_FRAME (frame, saved_pc); else return read_next_frame_reg(frame, PROC_FRAME_REG(proc_desc)) + PROC_FRAME_OFFSET(proc_desc); @@ -696,7 +831,8 @@ init_extra_frame_info (frame) /* This may not be quite right, if proc has a real frame register. Get the value of the frame relative sp, procedure might have been interrupted by a signal at it's very start. */ - else if (frame->pc == PROC_LOW_ADDR (proc_desc) && !PROC_DESC_IS_DUMMY (proc_desc)) + else if (frame->pc == PROC_LOW_ADDR (proc_desc) + && !PROC_DESC_IS_DYN_SIGTRAMP (proc_desc)) frame->frame = read_next_frame_reg (frame->next, SP_REGNUM); else frame->frame = read_next_frame_reg (frame->next, PROC_FRAME_REG (proc_desc)) @@ -713,12 +849,11 @@ init_extra_frame_info (frame) (CORE_ADDR *)NULL,(CORE_ADDR *)NULL); if (!IN_SIGTRAMP (frame->pc, name)) { - frame->saved_regs = (struct frame_saved_regs*) - obstack_alloc (&frame_cache_obstack, - sizeof (struct frame_saved_regs)); - *frame->saved_regs = temp_saved_regs; - frame->saved_regs->regs[PC_REGNUM] - = frame->saved_regs->regs[RA_REGNUM]; + frame->saved_regs = (CORE_ADDR*) + frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS); + memcpy (frame->saved_regs, temp_saved_regs.regs, SIZEOF_FRAME_SAVED_REGS); + frame->saved_regs[PC_REGNUM] + = frame->saved_regs[RA_REGNUM]; } } } @@ -878,7 +1013,7 @@ alpha_push_dummy_frame() */ /* MASK(i,j) == (1<= 0; ) if (PROC_REG_MASK(proc_desc) & (1 << regnum)) write_register (regnum, - read_memory_integer (frame->saved_regs->regs[regnum], + read_memory_integer (frame->saved_regs[regnum], 8)); for (regnum = 32; --regnum >= 0; ) if (PROC_FREG_MASK(proc_desc) & (1 << regnum)) write_register (regnum + FP0_REGNUM, - read_memory_integer (frame->saved_regs->regs[regnum + FP0_REGNUM], 8)); + read_memory_integer (frame->saved_regs[regnum + FP0_REGNUM], 8)); } write_register (SP_REGNUM, new_sp); flush_cached_frames (); - if (proc_desc && PROC_DESC_IS_DUMMY(proc_desc)) + if (proc_desc && (PROC_DESC_IS_DUMMY(proc_desc) + || PROC_DESC_IS_DYN_SIGTRAMP (proc_desc))) { struct linked_proc_info *pi_ptr, *prev_ptr; @@ -1129,7 +1265,7 @@ alpha_register_convert_to_virtual (regnum, valtype, raw_buffer, virtual_buffer) } else if (TYPE_CODE (valtype) == TYPE_CODE_INT && TYPE_LENGTH (valtype) <= 4) { - unsigned LONGEST l; + ULONGEST l; l = extract_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum)); l = ((l >> 32) & 0xc0000000) | ((l >> 29) & 0x3fffffff); store_unsigned_integer (virtual_buffer, TYPE_LENGTH (valtype), l); @@ -1158,7 +1294,7 @@ alpha_register_convert_to_raw (valtype, regnum, virtual_buffer, raw_buffer) } else if (TYPE_CODE (valtype) == TYPE_CODE_INT && TYPE_LENGTH (valtype) <= 4) { - unsigned LONGEST l; + ULONGEST l; if (TYPE_UNSIGNED (valtype)) l = extract_unsigned_integer (virtual_buffer, TYPE_LENGTH (valtype)); else diff --git a/contrib/gdb/gdb/annotate.c b/contrib/gdb/gdb/annotate.c index 282e171..ec3e424 100644 --- a/contrib/gdb/gdb/annotate.c +++ b/contrib/gdb/gdb/annotate.c @@ -1,5 +1,5 @@ /* Annotation routines for GDB. - Copyright 1986, 1989, 1990, 1991, 1992, 1995 Free Software Foundation, Inc. + Copyright 1986, 89, 90, 91, 92, 95, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -24,8 +24,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdbtypes.h" #include "breakpoint.h" + +/* Prototypes for local functions. */ + static void print_value_flags PARAMS ((struct type *)); +static void breakpoint_changed PARAMS ((struct breakpoint *)); + +void (*annotate_starting_hook) PARAMS ((void)); +void (*annotate_stopped_hook) PARAMS ((void)); +void (*annotate_signalled_hook) PARAMS ((void)); +void (*annotate_exited_hook) PARAMS ((void)); + static void print_value_flags (t) struct type *t; @@ -55,6 +65,14 @@ annotate_breakpoint (num) } void +annotate_catchpoint (num) + int num; +{ + if (annotation_level > 1) + printf_filtered ("\n\032\032catchpoint %d\n", num); +} + +void annotate_watchpoint (num) int num; { @@ -65,30 +83,49 @@ annotate_watchpoint (num) void annotate_starting () { - if (annotation_level > 1) + + if (annotate_starting_hook) + annotate_starting_hook (); + else { - printf_filtered ("\n\032\032starting\n"); + if (annotation_level > 1) + { + printf_filtered ("\n\032\032starting\n"); + } } } void annotate_stopped () { - if (annotation_level > 1) - printf_filtered ("\n\032\032stopped\n"); + if (annotate_stopped_hook) + annotate_stopped_hook (); + else + { + if (annotation_level > 1) + printf_filtered ("\n\032\032stopped\n"); + } } void annotate_exited (exitstatus) int exitstatus; { - if (annotation_level > 1) - printf_filtered ("\n\032\032exited %d\n", exitstatus); + if (annotate_exited_hook) + annotate_exited_hook (); + else + { + if (annotation_level > 1) + printf_filtered ("\n\032\032exited %d\n", exitstatus); + } } void annotate_signalled () { + if (annotate_signalled_hook) + annotate_signalled_hook (); + if (annotation_level > 1) printf_filtered ("\n\032\032signalled\n"); } diff --git a/contrib/gdb/gdb/annotate.h b/contrib/gdb/gdb/annotate.h index b91d140..59739db 100644 --- a/contrib/gdb/gdb/annotate.h +++ b/contrib/gdb/gdb/annotate.h @@ -17,9 +17,13 @@ You 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 "symtab.h" +#include "gdbtypes.h" + extern void breakpoints_changed PARAMS ((void)); extern void annotate_breakpoint PARAMS ((int)); +extern void annotate_catchpoint PARAMS ((int)); extern void annotate_watchpoint PARAMS ((int)); extern void annotate_starting PARAMS ((void)); extern void annotate_stopped PARAMS ((void)); @@ -93,3 +97,8 @@ extern void annotate_elt_rep PARAMS ((unsigned int)); extern void annotate_elt_rep_end PARAMS ((void)); extern void annotate_elt PARAMS ((void)); extern void annotate_array_section_end PARAMS ((void)); + +extern void (*annotate_starting_hook) PARAMS ((void)); +extern void (*annotate_stopped_hook) PARAMS ((void)); +extern void (*annotate_signalled_hook) PARAMS ((void)); +extern void (*annotate_exited_hook) PARAMS ((void)); diff --git a/contrib/gdb/gdb/arc-tdep.c b/contrib/gdb/gdb/arc-tdep.c new file mode 100644 index 0000000..9295770 --- /dev/null +++ b/contrib/gdb/gdb/arc-tdep.c @@ -0,0 +1,733 @@ +/* ARC target-dependent stuff. + Copyright (C) 1995, 1997 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 "frame.h" +#include "inferior.h" +#include "gdbcore.h" +#include "target.h" +#include "floatformat.h" +#include "symtab.h" +#include "gdbcmd.h" + +/* Current CPU, set with the "set cpu" command. */ +static int arc_bfd_mach_type; +char *arc_cpu_type; +char *tmp_arc_cpu_type; + +/* Table of cpu names. */ +struct { + char *name; + int value; +} arc_cpu_type_table[] = { + { "base", bfd_mach_arc_base }, + { NULL, 0 } +}; + +/* Used by simulator. */ +int display_pipeline_p; +int cpu_timer; +/* This one must have the same type as used in the emulator. + It's currently an enum so this should be ok for now. */ +int debug_pipeline_p; + +#define ARC_CALL_SAVED_REG(r) ((r) >= 16 && (r) < 24) + +#define OPMASK 0xf8000000 + +/* Instruction field accessor macros. + See the Programmer's Reference Manual. */ +#define X_OP(i) (((i) >> 27) & 0x1f) +#define X_A(i) (((i) >> 21) & 0x3f) +#define X_B(i) (((i) >> 15) & 0x3f) +#define X_C(i) (((i) >> 9) & 0x3f) +#define X_D(i) ((((i) & 0x1ff) ^ 0x100) - 0x100) +#define X_L(i) (((((i) >> 5) & 0x3ffffc) ^ 0x200000) - 0x200000) +#define X_N(i) (((i) >> 5) & 3) +#define X_Q(i) ((i) & 0x1f) + +/* Return non-zero if X is a short immediate data indicator. */ +#define SHIMM_P(x) ((x) == 61 || (x) == 63) + +/* Return non-zero if X is a "long" (32 bit) immediate data indicator. */ +#define LIMM_P(x) ((x) == 62) + +/* Build a simple instruction. */ +#define BUILD_INSN(op, a, b, c, d) \ + ((((op) & 31) << 27) \ + | (((a) & 63) << 21) \ + | (((b) & 63) << 15) \ + | (((c) & 63) << 9) \ + | ((d) & 511)) + +/* Codestream stuff. */ +static void codestream_read PARAMS ((unsigned int *, int)); +static void codestream_seek PARAMS ((CORE_ADDR)); +static unsigned int codestream_fill PARAMS ((int)); + +#define CODESTREAM_BUFSIZ 16 +static CORE_ADDR codestream_next_addr; +static CORE_ADDR codestream_addr; +static unsigned int codestream_buf[CODESTREAM_BUFSIZ]; +static int codestream_off; +static int codestream_cnt; + +#define codestream_tell() \ + (codestream_addr + codestream_off * sizeof (codestream_buf[0])) +#define codestream_peek() \ + (codestream_cnt == 0 \ + ? codestream_fill (1) \ + : codestream_buf[codestream_off]) +#define codestream_get() \ + (codestream_cnt-- == 0 \ + ? codestream_fill (0) \ + : codestream_buf[codestream_off++]) + +static unsigned int +codestream_fill (peek_flag) + int peek_flag; +{ + codestream_addr = codestream_next_addr; + codestream_next_addr += CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]); + codestream_off = 0; + codestream_cnt = CODESTREAM_BUFSIZ; + read_memory (codestream_addr, (char *) codestream_buf, + CODESTREAM_BUFSIZ * sizeof (codestream_buf[0])); + /* FIXME: check return code? */ + + /* Handle byte order differences. */ + if (HOST_BYTE_ORDER != TARGET_BYTE_ORDER) + { + register unsigned int i, j, n = sizeof (codestream_buf[0]); + register char tmp, *p; + for (i = 0, p = (char *) codestream_buf; i < CODESTREAM_BUFSIZ; + ++i, p += n) + for (j = 0; j < n / 2; ++j) + tmp = p[j], p[j] = p[n - 1 - j], p[n - 1 - j] = tmp; + } + + if (peek_flag) + return codestream_peek (); + else + return codestream_get (); +} + +static void +codestream_seek (place) + CORE_ADDR place; +{ + codestream_next_addr = place / CODESTREAM_BUFSIZ; + codestream_next_addr *= CODESTREAM_BUFSIZ; + codestream_cnt = 0; + codestream_fill (1); + while (codestream_tell () != place) + codestream_get (); +} + +/* This function is currently unused but leave in for now. */ + +static void +codestream_read (buf, count) + unsigned int *buf; + int count; +{ + unsigned int *p; + int i; + p = buf; + for (i = 0; i < count; i++) + *p++ = codestream_get (); +} + +/* Set up prologue scanning and return the first insn. */ + +static unsigned int +setup_prologue_scan (pc) + CORE_ADDR pc; +{ + unsigned int insn; + + codestream_seek (pc); + insn = codestream_get (); + + return insn; +} + +/* + * Find & return amount a local space allocated, and advance codestream to + * first register push (if any). + * If entry sequence doesn't make sense, return -1, and leave + * codestream pointer random. + */ + +static long +arc_get_frame_setup (pc) + CORE_ADDR pc; +{ + unsigned int insn; + /* Size of frame or -1 if unrecognizable prologue. */ + int frame_size = -1; + /* An initial "sub sp,sp,N" may or may not be for a stdarg fn. */ + int maybe_stdarg_decr = -1; + + insn = setup_prologue_scan (pc); + + /* The authority for what appears here is the home-grown ABI. + The most recent version is 1.2. */ + + /* First insn may be "sub sp,sp,N" if stdarg fn. */ + if ((insn & BUILD_INSN (-1, -1, -1, -1, 0)) + == BUILD_INSN (10, SP_REGNUM, SP_REGNUM, SHIMM_REGNUM, 0)) + { + maybe_stdarg_decr = X_D (insn); + insn = codestream_get (); + } + + if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st blink,[sp,4] */ + == BUILD_INSN (2, 0, SP_REGNUM, BLINK_REGNUM, 4)) + { + insn = codestream_get (); + /* Frame may not be necessary, even though blink is saved. + At least this is something we recognize. */ + frame_size = 0; + } + + if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st fp,[sp] */ + == BUILD_INSN (2, 0, SP_REGNUM, FP_REGNUM, 0)) + { + insn = codestream_get (); + if ((insn & BUILD_INSN (-1, -1, -1, -1, 0)) + != BUILD_INSN (12, FP_REGNUM, SP_REGNUM, SP_REGNUM, 0)) + return -1; + + /* Check for stack adjustment sub sp,sp,N. */ + insn = codestream_peek (); + if ((insn & BUILD_INSN (-1, -1, -1, 0, 0)) + == BUILD_INSN (10, SP_REGNUM, SP_REGNUM, 0, 0)) + { + if (LIMM_P (X_C (insn))) + frame_size = codestream_get (); + else if (SHIMM_P (X_C (insn))) + frame_size = X_D (insn); + else + return -1; + if (frame_size < 0) + return -1; + + codestream_get (); + + /* This sequence is used to get the address of the return + buffer for a function that returns a structure. */ + insn = codestream_peek (); + if (insn & OPMASK == 0x60000000) + codestream_get (); + } + /* Frameless fn. */ + else + { + frame_size = 0; + } + } + + /* If we found a "sub sp,sp,N" and nothing else, it may or may not be a + stdarg fn. The stdarg decrement is not treated as part of the frame size, + so we have a dilemma: what do we return? For now, if we get a + "sub sp,sp,N" and nothing else assume this isn't a stdarg fn. One way + to fix this completely would be to add a bit to the function descriptor + that says the function is a stdarg function. */ + + if (frame_size < 0 && maybe_stdarg_decr > 0) + return maybe_stdarg_decr; + return frame_size; +} + +/* Given a pc value, skip it forward past the function prologue by + disassembling instructions that appear to be a prologue. + + If FRAMELESS_P is set, we are only testing to see if the function + is frameless. If it is a frameless function, return PC unchanged. + This allows a quicker answer. */ + +CORE_ADDR +skip_prologue (pc, frameless_p) + CORE_ADDR pc; + int frameless_p; +{ + unsigned int insn; + int i, frame_size; + + if ((frame_size = arc_get_frame_setup (pc)) < 0) + return (pc); + + if (frameless_p) + return frame_size == 0 ? pc : codestream_tell (); + + /* Skip over register saves. */ + for (i = 0; i < 8; i++) + { + insn = codestream_peek (); + if ((insn & BUILD_INSN (-1, 0, -1, 0, 0)) + != BUILD_INSN (2, 0, SP_REGNUM, 0, 0)) + break; /* not st insn */ + if (! ARC_CALL_SAVED_REG (X_C (insn))) + break; + codestream_get (); + } + + return codestream_tell (); +} + +/* Return the return address for a frame. + This is used to implement FRAME_SAVED_PC. + This is taken from frameless_look_for_prologue. */ + +CORE_ADDR +arc_frame_saved_pc (frame) + struct frame_info *frame; +{ + CORE_ADDR func_start; + unsigned int insn; + + func_start = get_pc_function_start (frame->pc) + FUNCTION_START_OFFSET; + if (func_start == 0) + { + /* Best guess. */ + return ARC_PC_TO_REAL_ADDRESS (read_memory_integer (FRAME_FP (frame) + 4, 4)); + } + + /* The authority for what appears here is the home-grown ABI. + The most recent version is 1.2. */ + + insn = setup_prologue_scan (func_start); + + /* First insn may be "sub sp,sp,N" if stdarg fn. */ + if ((insn & BUILD_INSN (-1, -1, -1, -1, 0)) + == BUILD_INSN (10, SP_REGNUM, SP_REGNUM, SHIMM_REGNUM, 0)) + insn = codestream_get (); + + /* If the next insn is "st blink,[sp,4]" we can get blink from there. + Otherwise this is a leaf function and we can use blink. Note that + this still allows for the case where a leaf function saves/clobbers/ + restores blink. */ + + if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st blink,[sp,4] */ + != BUILD_INSN (2, 0, SP_REGNUM, BLINK_REGNUM, 4)) + return ARC_PC_TO_REAL_ADDRESS (read_register (BLINK_REGNUM)); + else + return ARC_PC_TO_REAL_ADDRESS (read_memory_integer (FRAME_FP (frame) + 4, 4)); +} + +/* + * Parse the first few instructions of the function to see + * what registers were stored. + * + * The startup sequence can be at the start of the function. + * 'st blink,[sp+4], st fp,[sp], mov fp,sp' + * + * Local space is allocated just below by sub sp,sp,nnn. + * Next, the registers used by this function are stored (as offsets from sp). + */ + +void +frame_find_saved_regs (fip, fsrp) + struct frame_info *fip; + struct frame_saved_regs *fsrp; +{ + long locals; + unsigned int insn; + CORE_ADDR dummy_bottom; + CORE_ADDR adr; + int i, regnum, offset; + + memset (fsrp, 0, sizeof *fsrp); + + /* If frame is the end of a dummy, compute where the beginning would be. */ + dummy_bottom = fip->frame - 4 - REGISTER_BYTES - CALL_DUMMY_LENGTH; + + /* Check if the PC is in the stack, in a dummy frame. */ + if (dummy_bottom <= fip->pc && fip->pc <= fip->frame) + { + /* all regs were saved by push_call_dummy () */ + adr = fip->frame; + for (i = 0; i < NUM_REGS; i++) + { + adr -= REGISTER_RAW_SIZE (i); + fsrp->regs[i] = adr; + } + return; + } + + locals = arc_get_frame_setup (get_pc_function_start (fip->pc)); + + if (locals >= 0) + { + /* Set `adr' to the value of `sp'. */ + adr = fip->frame - locals; + for (i = 0; i < 8; i++) + { + insn = codestream_get (); + if ((insn & BUILD_INSN (-1, 0, -1, 0, 0)) + != BUILD_INSN (2, 0, SP_REGNUM, 0, 0)) + break; + regnum = X_C (insn); + offset = X_D (insn); + fsrp->regs[regnum] = adr + offset; + } + } + + fsrp->regs[PC_REGNUM] = fip->frame + 4; + fsrp->regs[FP_REGNUM] = fip->frame; +} + +void +push_dummy_frame () +{ + CORE_ADDR sp = read_register (SP_REGNUM); + int regnum; + char regbuf[MAX_REGISTER_RAW_SIZE]; + + read_register_gen (PC_REGNUM, regbuf); + write_memory (sp+4, regbuf, REGISTER_SIZE); + read_register_gen (FP_REGNUM, regbuf); + write_memory (sp, regbuf, REGISTER_SIZE); + write_register (FP_REGNUM, sp); + for (regnum = 0; regnum < NUM_REGS; regnum++) + { + read_register_gen (regnum, regbuf); + sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum)); + } + sp += (2*REGISTER_SIZE); + write_register (SP_REGNUM, sp); +} + +void +pop_frame () +{ + struct frame_info *frame = get_current_frame (); + CORE_ADDR fp; + int regnum; + struct frame_saved_regs fsr; + char regbuf[MAX_REGISTER_RAW_SIZE]; + + fp = FRAME_FP (frame); + get_frame_saved_regs (frame, &fsr); + for (regnum = 0; regnum < NUM_REGS; regnum++) + { + CORE_ADDR adr; + adr = fsr.regs[regnum]; + if (adr) + { + read_memory (adr, regbuf, REGISTER_RAW_SIZE (regnum)); + write_register_bytes (REGISTER_BYTE (regnum), regbuf, + REGISTER_RAW_SIZE (regnum)); + } + } + write_register (FP_REGNUM, read_memory_integer (fp, 4)); + write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); + write_register (SP_REGNUM, fp + 8); + flush_cached_frames (); +} + +/* Simulate single-step. */ + +typedef enum +{ + NORMAL4, /* a normal 4 byte insn */ + NORMAL8, /* a normal 8 byte insn */ + BRANCH4, /* a 4 byte branch insn, including ones without delay slots */ + BRANCH8, /* an 8 byte branch insn, including ones with delay slots */ +} insn_type; + +/* Return the type of INSN and store in TARGET the destination address of a + branch if this is one. */ +/* ??? Need to verify all cases are properly handled. */ + +static insn_type +get_insn_type (insn, pc, target) + unsigned long insn; + CORE_ADDR pc, *target; +{ + unsigned long limm; + + switch (insn >> 27) + { + case 0 : case 1 : case 2 : /* load/store insns */ + if (LIMM_P (X_A (insn)) + || LIMM_P (X_B (insn)) + || LIMM_P (X_C (insn))) + return NORMAL8; + return NORMAL4; + case 4 : case 5 : case 6 : /* branch insns */ + *target = pc + 4 + X_L (insn); + /* ??? It isn't clear that this is always the right answer. + The problem occurs when the next insn is an 8 byte insn. If the + branch is conditional there's no worry as there shouldn't be an 8 + byte insn following. The programmer may be cheating if s/he knows + the branch will never be taken, but we don't deal with that. + Note that the programmer is also allowed to play games by putting + an insn with long immediate data in the delay slot and then duplicate + the long immediate data at the branch target. Ugh! */ + if (X_N (insn) == 0) + return BRANCH4; + return BRANCH8; + case 7 : /* jump insns */ + if (LIMM_P (X_B (insn))) + { + limm = read_memory_integer (pc + 4, 4); + *target = ARC_PC_TO_REAL_ADDRESS (limm); + return BRANCH8; + } + if (SHIMM_P (X_B (insn))) + *target = ARC_PC_TO_REAL_ADDRESS (X_D (insn)); + else + *target = ARC_PC_TO_REAL_ADDRESS (read_register (X_B (insn))); + if (X_Q (insn) == 0 && X_N (insn) == 0) + return BRANCH4; + return BRANCH8; + default : /* arithmetic insns, etc. */ + if (LIMM_P (X_A (insn)) + || LIMM_P (X_B (insn)) + || LIMM_P (X_C (insn))) + return NORMAL8; + return NORMAL4; + } +} + +/* single_step() is called just before we want to resume the inferior, if we + want to single-step it but there is no hardware or kernel single-step + support. We find all the possible targets of the coming instruction and + breakpoint them. + + single_step is also called just after the inferior stops. If we had + set up a simulated single-step, we undo our damage. */ + +void +arc_software_single_step (ignore, insert_breakpoints_p) + enum target_signal ignore; /* sig but we don't need it */ + int insert_breakpoints_p; +{ + static CORE_ADDR next_pc, target; + static int brktrg_p; + typedef char binsn_quantum[BREAKPOINT_MAX]; + static binsn_quantum break_mem[2]; + + if (insert_breakpoints_p) + { + insn_type type; + CORE_ADDR pc; + unsigned long insn; + + pc = read_register (PC_REGNUM); + insn = read_memory_integer (pc, 4); + type = get_insn_type (insn, pc, &target); + + /* Always set a breakpoint for the insn after the branch. */ + next_pc = pc + ((type == NORMAL8 || type == BRANCH8) ? 8 : 4); + target_insert_breakpoint (next_pc, break_mem[0]); + + brktrg_p = 0; + + if ((type == BRANCH4 || type == BRANCH8) + /* Watch out for branches to the following location. + We just stored a breakpoint there and another call to + target_insert_breakpoint will think the real insn is the + breakpoint we just stored there. */ + && target != next_pc) + { + brktrg_p = 1; + target_insert_breakpoint (target, break_mem[1]); + } + + } + else + { + /* Remove breakpoints. */ + target_remove_breakpoint (next_pc, break_mem[0]); + + if (brktrg_p) + target_remove_breakpoint (target, break_mem[1]); + + /* Fix the pc. */ + stop_pc -= DECR_PC_AFTER_BREAK; + write_pc (stop_pc); + } +} + +#ifdef GET_LONGJMP_TARGET +/* Figure out where the longjmp will land. Slurp the args out of the stack. + We expect the first arg to be a pointer to the jmp_buf structure from which + we extract the pc (JB_PC) that we will land at. The pc is copied into PC. + This routine returns true on success. */ + +int +get_longjmp_target(pc) + CORE_ADDR *pc; +{ + char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; + CORE_ADDR sp, jb_addr; + + sp = read_register (SP_REGNUM); + + if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */ + buf, + TARGET_PTR_BIT / TARGET_CHAR_BIT)) + return 0; + + jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + + if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf, + TARGET_PTR_BIT / TARGET_CHAR_BIT)) + return 0; + + *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + + return 1; +} +#endif /* GET_LONGJMP_TARGET */ + +/* Disassemble one instruction. */ + +static int +arc_print_insn (vma, info) + bfd_vma vma; + disassemble_info *info; +{ + static int current_mach; + static int current_endian; + static disassembler_ftype current_disasm; + + if (current_disasm == NULL + || arc_bfd_mach_type != current_mach + || TARGET_BYTE_ORDER != current_endian) + { + current_mach = arc_bfd_mach_type; + current_endian = TARGET_BYTE_ORDER; + current_disasm = arc_get_disassembler (current_mach, + current_endian == BIG_ENDIAN); + } + + return (*current_disasm) (vma, info); +} + +/* Command to set cpu type. */ + +void +arc_set_cpu_type_command (args, from_tty) + char *args; + int from_tty; +{ + int i; + + if (tmp_arc_cpu_type == NULL || *tmp_arc_cpu_type == '\0') + { + printf_unfiltered ("The known ARC cpu types are as follows:\n"); + for (i = 0; arc_cpu_type_table[i].name != NULL; ++i) + printf_unfiltered ("%s\n", arc_cpu_type_table[i].name); + + /* Restore the value. */ + tmp_arc_cpu_type = strsave (arc_cpu_type); + + return; + } + + if (!arc_set_cpu_type (tmp_arc_cpu_type)) + { + error ("Unknown cpu type `%s'.", tmp_arc_cpu_type); + /* Restore its value. */ + tmp_arc_cpu_type = strsave (arc_cpu_type); + } +} + +static void +arc_show_cpu_type_command (args, from_tty) + char *args; + int from_tty; +{ +} + +/* Modify the actual cpu type. + Result is a boolean indicating success. */ + +int +arc_set_cpu_type (str) + char *str; +{ + int i, j; + + if (str == NULL) + return 0; + + for (i = 0; arc_cpu_type_table[i].name != NULL; ++i) + { + if (strcasecmp (str, arc_cpu_type_table[i].name) == 0) + { + arc_cpu_type = str; + arc_bfd_mach_type = arc_cpu_type_table[i].value; + return 1; + } + } + + return 0; +} + +void +_initialize_arc_tdep () +{ + struct cmd_list_element *c; + + c = add_set_cmd ("cpu", class_support, var_string_noescape, + (char *) &tmp_arc_cpu_type, + "Set the type of ARC cpu in use.\n\ +This command has two purposes. In a multi-cpu system it lets one\n\ +change the cpu being debugged. It also gives one access to\n\ +cpu-type-specific registers and recognize cpu-type-specific instructions.\ +", + &setlist); + c->function.cfunc = arc_set_cpu_type_command; + c = add_show_from_set (c, &showlist); + c->function.cfunc = arc_show_cpu_type_command; + + /* We have to use strsave here because the `set' command frees it before + setting a new value. */ + tmp_arc_cpu_type = strsave (DEFAULT_ARC_CPU_TYPE); + arc_set_cpu_type (tmp_arc_cpu_type); + + c = add_set_cmd ("displaypipeline", class_support, var_zinteger, + (char *) &display_pipeline_p, + "Set pipeline display (simulator only).\n\ +When enabled, the state of the pipeline after each cycle is displayed.", + &setlist); + c = add_show_from_set (c, &showlist); + + c = add_set_cmd ("debugpipeline", class_support, var_zinteger, + (char *) &debug_pipeline_p, + "Set pipeline debug display (simulator only).\n\ +When enabled, debugging information about the pipeline is displayed.", + &setlist); + c = add_show_from_set (c, &showlist); + + c = add_set_cmd ("cputimer", class_support, var_zinteger, + (char *) &cpu_timer, + "Set maximum cycle count (simulator only).\n\ +Control will return to gdb if the timer expires.\n\ +A negative value disables the timer.", + &setlist); + c = add_show_from_set (c, &showlist); + + tm_print_insn = arc_print_insn; +} diff --git a/contrib/gdb/gdb/arm-tdep.c b/contrib/gdb/gdb/arm-tdep.c index 884e9d8..607dc8f 100644 --- a/contrib/gdb/gdb/arm-tdep.c +++ b/contrib/gdb/gdb/arm-tdep.c @@ -1,5 +1,6 @@ /* Target-dependent code for the Acorn Risc Machine, for GDB, the GNU Debugger. - Copyright 1988, 1989, 1991, 1992, 1993, 1995 Free Software Foundation, Inc. + Copyright (C) 1988, 1989, 1991, 1992, 1993, 1995, 1996, 1998, 1999 + Free Software Foundation, Inc. This file is part of GDB. @@ -20,539 +21,1099 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "defs.h" #include "frame.h" #include "inferior.h" - -#if 0 +#include "gdbcmd.h" #include "gdbcore.h" -#include -#include -#include -#include -#include -#include +#include "symfile.h" +#include "gdb_string.h" +#include "coff/internal.h" /* Internal format of COFF symbols in BFD */ + +/* + The following macros are actually wrong. Neither arm nor thumb can + or should set the lsb on addr. + The thumb addresses are mod 2, so (addr & 2) would be a good heuristic + to use when checking for thumb (see arm_pc_is_thumb() below). + Unfortunately, something else depends on these (incorrect) macros, so + fixing them actually breaks gdb. I didn't have time to investigate. Z.R. +*/ +/* Thumb function addresses are odd (bit 0 is set). Here are some + macros to test, set, or clear bit 0 of addresses. */ +#define IS_THUMB_ADDR(addr) ((addr) & 1) +#define MAKE_THUMB_ADDR(addr) ((addr) | 1) +#define UNMAKE_THUMB_ADDR(addr) ((addr) & ~1) + +/* Macros to round N up or down to the next A boundary; A must be + a power of two. */ +#define ROUND_DOWN(n,a) ((n) & ~((a) - 1)) +#define ROUND_UP(n,a) (((n) + (a) - 1) & ~((a) - 1)) + +/* Should call_function allocate stack space for a struct return? */ +/* The system C compiler uses a similar structure return convention to gcc */ +int +arm_use_struct_convention (gcc_p, type) + int gcc_p; + struct type *type; +{ + return (TYPE_LENGTH (type) > 4); +} -#define N_TXTADDR(hdr) 0x8000 -#define N_DATADDR(hdr) (hdr.a_text + 0x8000) +int +arm_frame_chain_valid (chain, thisframe) + CORE_ADDR chain; + struct frame_info *thisframe; +{ +#define LOWEST_PC 0x20 /* the first 0x20 bytes are the trap vectors. */ + return (chain != 0 && (FRAME_SAVED_PC (thisframe) >= LOWEST_PC)); +} -#include /* After a.out.h */ -#include -#include "gdb_stat.h" +/* Set to true if the 32-bit mode is in use. */ -#include -#endif +int arm_apcs_32 = 1; - -#if 0 -/* Work with core dump and executable files, for GDB. - This code would be in corefile.c if it weren't machine-dependent. */ +/* Flag set by arm_fix_call_dummy that tells whether the target function + is a Thumb function. This flag is checked by arm_push_arguments. + FIXME: Change the PUSH_ARGUMENTS macro (and its use in valops.c) to + pass the function address as an additional parameter. */ -/* Structure to describe the chain of shared libraries used - by the execfile. - e.g. prog shares Xt which shares X11 which shares c. */ +static int target_is_thumb; -struct shared_library { - struct exec_header header; - char name[SHLIBLEN]; - CORE_ADDR text_start; /* CORE_ADDR of 1st byte of text, this file */ - long data_offset; /* offset of data section in file */ - int chan; /* file descriptor for the file */ - struct shared_library *shares; /* library this one shares */ -}; -static struct shared_library *shlib = 0; +/* Flag set by arm_fix_call_dummy that tells whether the calling function + is a Thumb function. This flag is checked by arm_pc_is_thumb + and arm_call_dummy_breakpoint_offset. */ -/* Hook for `exec_file_command' command to call. */ +static int caller_is_thumb; -extern void (*exec_file_display_hook) (); - -static CORE_ADDR unshared_text_start; +/* Tell if the program counter value in MEMADDR is in a Thumb function. */ -/* extended header from exec file (for shared library info) */ +int +arm_pc_is_thumb (memaddr) + bfd_vma memaddr; +{ + struct minimal_symbol * sym; + CORE_ADDR sp; -static struct exec_header exec_header; + /* If bit 0 of the address is set, assume this is a Thumb address. */ + if (IS_THUMB_ADDR (memaddr)) + return 1; -void -exec_file_command (filename, from_tty) - char *filename; - int from_tty; -{ - int val; - - /* Eliminate all traces of old exec file. - Mark text segment as empty. */ - - if (execfile) - free (execfile); - execfile = 0; - data_start = 0; - data_end -= exec_data_start; - text_start = 0; - unshared_text_start = 0; - text_end = 0; - exec_data_start = 0; - exec_data_end = 0; - if (execchan >= 0) - close (execchan); - execchan = -1; - if (shlib) { - close_shared_library(shlib); - shlib = 0; - } - - /* Now open and digest the file the user requested, if any. */ - - if (filename) - { - filename = tilde_expand (filename); - make_cleanup (free, filename); - - execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, - &execfile); - if (execchan < 0) - perror_with_name (filename); + /* Thumb function have a "special" bit set in minimal symbols */ + sym = lookup_minimal_symbol_by_pc (memaddr); + if (sym) + { + return (MSYMBOL_IS_SPECIAL(sym)); + } + else + return 0; +} - { - struct stat st_exec; +/* Tell if the program counter value in MEMADDR is in a call dummy that + is being called from a Thumb function. */ -#ifdef HEADER_SEEK_FD - HEADER_SEEK_FD (execchan); -#endif - - val = myread (execchan, &exec_header, sizeof exec_header); - exec_aouthdr = exec_header.a_exec; +int +arm_pc_is_thumb_dummy (memaddr) + bfd_vma memaddr; +{ + CORE_ADDR sp = read_sp(); + + if (PC_IN_CALL_DUMMY (memaddr, sp, sp+64)) + return caller_is_thumb; + else + return 0; +} - if (val < 0) - perror_with_name (filename); +CORE_ADDR +arm_addr_bits_remove (val) + CORE_ADDR val; +{ + if (arm_pc_is_thumb (val)) + return (val & (arm_apcs_32 ? 0xfffffffe : 0x03fffffe)); + else + return (val & (arm_apcs_32 ? 0xfffffffc : 0x03fffffc)); +} - text_start = 0x8000; +CORE_ADDR +arm_saved_pc_after_call (frame) + struct frame_info *frame; +{ + return ADDR_BITS_REMOVE (read_register (LR_REGNUM)); +} - /* Look for shared library if needed */ - if (exec_header.a_exec.a_magic & MF_USES_SL) - shlib = open_shared_library(exec_header.a_shlibname, text_start); +/* A typical Thumb prologue looks like this: + push {r7, lr} + add sp, sp, #-28 + add r7, sp, #12 + Sometimes the latter instruction may be replaced by: + mov r7, sp +*/ - text_offset = N_TXTOFF (exec_aouthdr); - exec_data_offset = N_TXTOFF (exec_aouthdr) + exec_aouthdr.a_text; +static CORE_ADDR +thumb_skip_prologue (pc) + CORE_ADDR pc; +{ + CORE_ADDR current_pc; - if (shlib) { - unshared_text_start = shared_text_end(shlib) & ~0x7fff; - stack_start = shlib->header.a_exec.a_sldatabase; - stack_end = STACK_END_ADDR; - } else - unshared_text_start = 0x8000; - text_end = unshared_text_start + exec_aouthdr.a_text; + for (current_pc = pc; current_pc < pc + 20; current_pc += 2) + { + unsigned short insn = read_memory_unsigned_integer (current_pc, 2); + + if ( (insn & 0xfe00) != 0xb400 /* push {..., r7, lr} */ + && (insn & 0xff00) != 0xb000 /* add sp, #simm */ + && (insn & 0xff00) != 0xaf00 /* add r7, sp, #imm */ + && insn != 0x466f /* mov r7, sp */ + && (insn & 0xffc0) != 0x4640) /* mov r0-r7, r8-r15 */ + break; + } - exec_data_start = unshared_text_start + exec_aouthdr.a_text; - exec_data_end = exec_data_start + exec_aouthdr.a_data; + return current_pc; +} - data_start = exec_data_start; - data_end += exec_data_start; +/* APCS (ARM procedure call standard) defines the following prologue: - fstat (execchan, &st_exec); - exec_mtime = st_exec.st_mtime; - } + mov ip, sp + [stmfd sp!, {a1,a2,a3,a4}] + stmfd sp!, {...,fp,ip,lr,pc} + [stfe f7, [sp, #-12]!] + [stfe f6, [sp, #-12]!] + [stfe f5, [sp, #-12]!] + [stfe f4, [sp, #-12]!] + sub fp, ip, #nn // nn == 20 or 4 depending on second ins +*/ + +CORE_ADDR +arm_skip_prologue (pc) + CORE_ADDR pc; +{ + unsigned long inst; + CORE_ADDR skip_pc; + CORE_ADDR func_addr, func_end; + struct symtab_and_line sal; - validate_files (); + /* See what the symbol table says. */ + if (find_pc_partial_function (pc, NULL, & func_addr, & func_end)) + { + sal = find_pc_line (func_addr, 0); + if (sal.line != 0 && sal.end < func_end) + return sal.end; } - else if (from_tty) - printf ("No exec file now.\n"); - /* Tell display code (if any) about the changed file name. */ - if (exec_file_display_hook) - (*exec_file_display_hook) (filename); -} -#endif + /* Check if this is Thumb code. */ + if (arm_pc_is_thumb (pc)) + return thumb_skip_prologue (pc); -#if 0 -/* Read from the program's memory (except for inferior processes). - This function is misnamed, since it only reads, never writes; and - since it will use the core file and/or executable file as necessary. + /* Can't find the prologue end in the symbol table, try it the hard way + by disassembling the instructions. */ + skip_pc = pc; + inst = read_memory_integer (skip_pc, 4); + if (inst != 0xe1a0c00d) /* mov ip, sp */ + return pc; - It should be extended to write as well as read, FIXME, for patching files. + skip_pc += 4; + inst = read_memory_integer (skip_pc, 4); + if ((inst & 0xfffffff0) == 0xe92d0000) /* stmfd sp!,{a1,a2,a3,a4} */ + { + skip_pc += 4; + inst = read_memory_integer (skip_pc, 4); + } - Return 0 if address could be read, EIO if addresss out of bounds. */ + if ((inst & 0xfffff800) != 0xe92dd800) /* stmfd sp!,{...,fp,ip,lr,pc} */ + return pc; -int -xfer_core_file (memaddr, myaddr, len) - CORE_ADDR memaddr; - char *myaddr; - int len; + skip_pc += 4; + inst = read_memory_integer (skip_pc, 4); + + /* Any insns after this point may float into the code, if it makes + for better instruction scheduling, so we skip them only if + we find them, but still consdier the function to be frame-ful */ + + /* We may have either one sfmfd instruction here, or several stfe insns, + depending on the version of floating point code we support. */ + if ((inst & 0xffbf0fff) == 0xec2d0200) /* sfmfd fn, , [sp]! */ + { + skip_pc += 4; + inst = read_memory_integer (skip_pc, 4); + } + else + { + while ((inst & 0xffff8fff) == 0xed6d0103) /* stfe fn, [sp, #-12]! */ + { + skip_pc += 4; + inst = read_memory_integer (skip_pc, 4); + } + } + + if ((inst & 0xfffff000) == 0xe24cb000) /* sub fp, ip, #nn */ + skip_pc += 4; + + return skip_pc; +} + + + +/* Function: thumb_scan_prologue (helper function for arm_scan_prologue) + This function decodes a Thumb function prologue to determine: + 1) the size of the stack frame + 2) which registers are saved on it + 3) the offsets of saved regs + 4) the offset from the stack pointer to the frame pointer + This information is stored in the "extra" fields of the frame_info. + + A typical Thumb function prologue might look like this: + push {r7, lr} + sub sp, #28, + add r7, sp, #12 + Which would create this stack frame (offsets relative to FP) + old SP -> 24 stack parameters + 20 LR + 16 R7 + R7 -> 0 local variables (16 bytes) + SP -> -12 additional stack space (12 bytes) + The frame size would thus be 36 bytes, and the frame offset would be + 12 bytes. The frame register is R7. */ + +static void +thumb_scan_prologue (fi) + struct frame_info * fi; { - register int i; - register int val; - int xferchan; - char **xferfile; - int fileptr; - int returnval = 0; + CORE_ADDR prologue_start; + CORE_ADDR prologue_end; + CORE_ADDR current_pc; + int saved_reg[16]; /* which register has been copied to register n? */ + int i; - while (len > 0) + if (find_pc_partial_function (fi->pc, NULL, & prologue_start, & prologue_end)) { - xferfile = 0; - xferchan = 0; + struct symtab_and_line sal = find_pc_line (prologue_start, 0); - /* Determine which file the next bunch of addresses reside in, - and where in the file. Set the file's read/write pointer - to point at the proper place for the desired address - and set xferfile and xferchan for the correct file. + if (sal.line == 0) /* no line info, use current PC */ + prologue_end = fi->pc; + else if (sal.end < prologue_end) /* next line begins after fn end */ + prologue_end = sal.end; /* (probably means no prologue) */ + } + else + prologue_end = prologue_start + 40; /* We're in the boondocks: allow for */ + /* 16 pushes, an add, and "mv fp,sp" */ - If desired address is nonexistent, leave them zero. + prologue_end = min (prologue_end, fi->pc); - i is set to the number of bytes that can be handled - along with the next address. + /* Initialize the saved register map. When register H is copied to + register L, we will put H in saved_reg[L]. */ + for (i = 0; i < 16; i++) + saved_reg[i] = i; - We put the most likely tests first for efficiency. */ + /* Search the prologue looking for instructions that set up the + frame pointer, adjust the stack pointer, and save registers. */ - /* Note that if there is no core file - data_start and data_end are equal. */ - if (memaddr >= data_start && memaddr < data_end) - { - i = min (len, data_end - memaddr); - fileptr = memaddr - data_start + data_offset; - xferfile = &corefile; - xferchan = corechan; - } - /* Note that if there is no core file - stack_start and stack_end define the shared library data. */ - else if (memaddr >= stack_start && memaddr < stack_end) - { - if (corechan < 0) { - struct shared_library *lib; - for (lib = shlib; lib; lib = lib->shares) - if (memaddr >= lib->header.a_exec.a_sldatabase && - memaddr < lib->header.a_exec.a_sldatabase + - lib->header.a_exec.a_data) - break; - if (lib) { - i = min (len, lib->header.a_exec.a_sldatabase + - lib->header.a_exec.a_data - memaddr); - fileptr = lib->data_offset + memaddr - - lib->header.a_exec.a_sldatabase; - xferfile = execfile; - xferchan = lib->chan; - } - } else { - i = min (len, stack_end - memaddr); - fileptr = memaddr - stack_start + stack_offset; - xferfile = &corefile; - xferchan = corechan; - } - } - else if (corechan < 0 - && memaddr >= exec_data_start && memaddr < exec_data_end) + fi->framesize = 0; + for (current_pc = prologue_start; current_pc < prologue_end; current_pc += 2) + { + unsigned short insn; + int regno; + int offset; + + insn = read_memory_unsigned_integer (current_pc, 2); + + if ((insn & 0xfe00) == 0xb400) /* push { rlist } */ { - i = min (len, exec_data_end - memaddr); - fileptr = memaddr - exec_data_start + exec_data_offset; - xferfile = &execfile; - xferchan = execchan; + /* Bits 0-7 contain a mask for registers R0-R7. Bit 8 says + whether to save LR (R14). */ + int mask = (insn & 0xff) | ((insn & 0x100) << 6); + + /* Calculate offsets of saved R0-R7 and LR. */ + for (regno = LR_REGNUM; regno >= 0; regno--) + if (mask & (1 << regno)) + { + fi->framesize += 4; + fi->fsr.regs[saved_reg[regno]] = -(fi->framesize); + saved_reg[regno] = regno; /* reset saved register map */ + } } - else if (memaddr >= text_start && memaddr < text_end) + else if ((insn & 0xff00) == 0xb000) /* add sp, #simm */ { - struct shared_library *lib; - for (lib = shlib; lib; lib = lib->shares) - if (memaddr >= lib->text_start && - memaddr < lib->text_start + lib->header.a_exec.a_text) - break; - if (lib) { - i = min (len, lib->header.a_exec.a_text + - lib->text_start - memaddr); - fileptr = memaddr - lib->text_start + text_offset; - xferfile = &execfile; - xferchan = lib->chan; - } else { - i = min (len, text_end - memaddr); - fileptr = memaddr - unshared_text_start + text_offset; - xferfile = &execfile; - xferchan = execchan; - } + offset = (insn & 0x7f) << 2; /* get scaled offset */ + if (insn & 0x80) /* is it signed? */ + offset = -offset; + fi->framesize -= offset; } - else if (memaddr < text_start) + else if ((insn & 0xff00) == 0xaf00) /* add r7, sp, #imm */ { - i = min (len, text_start - memaddr); + fi->framereg = THUMB_FP_REGNUM; + fi->frameoffset = (insn & 0xff) << 2; /* get scaled offset */ } - else if (memaddr >= text_end - && memaddr < (corechan >= 0? data_start : exec_data_start)) + else if (insn == 0x466f) /* mov r7, sp */ { - i = min (len, data_start - memaddr); + fi->framereg = THUMB_FP_REGNUM; + fi->frameoffset = 0; + saved_reg[THUMB_FP_REGNUM] = SP_REGNUM; } - else if (corechan >= 0 - && memaddr >= data_end && memaddr < stack_start) + else if ((insn & 0xffc0) == 0x4640) /* mov r0-r7, r8-r15 */ { - i = min (len, stack_start - memaddr); + int lo_reg = insn & 7; /* dest. register (r0-r7) */ + int hi_reg = ((insn >> 3) & 7) + 8; /* source register (r8-15) */ + saved_reg[lo_reg] = hi_reg; /* remember hi reg was saved */ } - else if (corechan < 0 && memaddr >= exec_data_end) + else + break; /* anything else isn't prologue */ + } +} + +/* Function: check_prologue_cache + Check if prologue for this frame's PC has already been scanned. + If it has, copy the relevant information about that prologue and + return non-zero. Otherwise do not copy anything and return zero. + + The information saved in the cache includes: + * the frame register number; + * the size of the stack frame; + * the offsets of saved regs (relative to the old SP); and + * the offset from the stack pointer to the frame pointer + + The cache contains only one entry, since this is adequate + for the typical sequence of prologue scan requests we get. + When performing a backtrace, GDB will usually ask to scan + the same function twice in a row (once to get the frame chain, + and once to fill in the extra frame information). +*/ + +static struct frame_info prologue_cache; + +static int +check_prologue_cache (fi) + struct frame_info * fi; +{ + int i; + + if (fi->pc == prologue_cache.pc) + { + fi->framereg = prologue_cache.framereg; + fi->framesize = prologue_cache.framesize; + fi->frameoffset = prologue_cache.frameoffset; + for (i = 0; i <= NUM_REGS; i++) + fi->fsr.regs[i] = prologue_cache.fsr.regs[i]; + return 1; + } + else + return 0; +} + + +/* Function: save_prologue_cache + Copy the prologue information from fi to the prologue cache. +*/ + +static void +save_prologue_cache (fi) + struct frame_info * fi; +{ + int i; + + prologue_cache.pc = fi->pc; + prologue_cache.framereg = fi->framereg; + prologue_cache.framesize = fi->framesize; + prologue_cache.frameoffset = fi->frameoffset; + + for (i = 0; i <= NUM_REGS; i++) + prologue_cache.fsr.regs[i] = fi->fsr.regs[i]; +} + + +/* Function: arm_scan_prologue + This function decodes an ARM function prologue to determine: + 1) the size of the stack frame + 2) which registers are saved on it + 3) the offsets of saved regs + 4) the offset from the stack pointer to the frame pointer + This information is stored in the "extra" fields of the frame_info. + + A typical Arm function prologue might look like this: + mov ip, sp + stmfd sp!, {fp, ip, lr, pc} + sub fp, ip, #4 + sub sp, sp, #16 + Which would create this stack frame (offsets relative to FP): + IP -> 4 (caller's stack) + FP -> 0 PC (points to address of stmfd instruction + 12 in callee) + -4 LR (return address in caller) + -8 IP (copy of caller's SP) + -12 FP (caller's FP) + SP -> -28 Local variables + The frame size would thus be 32 bytes, and the frame offset would be + 28 bytes. */ + +static void +arm_scan_prologue (fi) + struct frame_info * fi; +{ + int regno, sp_offset, fp_offset; + CORE_ADDR prologue_start, prologue_end, current_pc; + + /* Check if this function is already in the cache of frame information. */ + if (check_prologue_cache (fi)) + return; + + /* Assume there is no frame until proven otherwise. */ + fi->framereg = SP_REGNUM; + fi->framesize = 0; + fi->frameoffset = 0; + + /* Check for Thumb prologue. */ + if (arm_pc_is_thumb (fi->pc)) + { + thumb_scan_prologue (fi); + save_prologue_cache (fi); + return; + } + + /* Find the function prologue. If we can't find the function in + the symbol table, peek in the stack frame to find the PC. */ + if (find_pc_partial_function (fi->pc, NULL, &prologue_start, &prologue_end)) + { + /* Assume the prologue is everything between the first instruction + in the function and the first source line. */ + struct symtab_and_line sal = find_pc_line (prologue_start, 0); + + if (sal.line == 0) /* no line info, use current PC */ + prologue_end = fi->pc; + else if (sal.end < prologue_end) /* next line begins after fn end */ + prologue_end = sal.end; /* (probably means no prologue) */ + } + else + { + /* Get address of the stmfd in the prologue of the callee; the saved + PC is the address of the stmfd + 12. */ + prologue_start = (read_memory_integer (fi->frame, 4) & 0x03fffffc) - 12; + prologue_end = prologue_start + 40; /* FIXME: should be big enough */ + } + + /* Now search the prologue looking for instructions that set up the + frame pointer, adjust the stack pointer, and save registers. */ + + sp_offset = fp_offset = 0; + for (current_pc = prologue_start; current_pc < prologue_end; current_pc += 4) + { + unsigned int insn = read_memory_unsigned_integer (current_pc, 4); + + if ((insn & 0xffff0000) == 0xe92d0000) /* stmfd sp!, {..., r7, lr} */ { - i = min (len, - memaddr); + int mask = insn & 0xffff; + + /* Calculate offsets of saved registers. */ + for (regno = PC_REGNUM; regno >= 0; regno--) + if (mask & (1 << regno)) + { + sp_offset -= 4; + fi->fsr.regs[regno] = sp_offset; + } } - else if (memaddr >= stack_end && stack_end != 0) + else if ((insn & 0xfffff000) == 0xe24cb000) /* sub fp, ip #n */ { - i = min (len, - memaddr); + unsigned imm = insn & 0xff; /* immediate value */ + unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */ + imm = (imm >> rot) | (imm << (32-rot)); + fp_offset = -imm; + fi->framereg = FP_REGNUM; } - else + else if ((insn & 0xfffff000) == 0xe24dd000) /* sub sp, sp #n */ { - /* Address did not classify into one of the known ranges. - This shouldn't happen; we catch the endpoints. */ - fatal ("Internal: Bad case logic in xfer_core_file."); + unsigned imm = insn & 0xff; /* immediate value */ + unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */ + imm = (imm >> rot) | (imm << (32-rot)); + sp_offset -= imm; } - - /* Now we know which file to use. - Set up its pointer and transfer the data. */ - if (xferfile) + else if ((insn & 0xffff7fff) == 0xed6d0103) /* stfe f?, [sp, -#c]! */ { - if (*xferfile == 0) - if (xferfile == &execfile) - error ("No program file to examine."); - else - error ("No core dump file or running program to examine."); - val = lseek (xferchan, fileptr, 0); - if (val < 0) - perror_with_name (*xferfile); - val = myread (xferchan, myaddr, i); - if (val < 0) - perror_with_name (*xferfile); + sp_offset -= 12; + regno = F0_REGNUM + ((insn >> 12) & 0x07); + fi->fsr.regs[regno] = sp_offset; } - /* If this address is for nonexistent memory, - read zeros if reading, or do nothing if writing. - Actually, we never right. */ + else if (insn == 0xe1a0c00d) /* mov ip, sp */ + continue; else - { - memset (myaddr, '\0', i); - returnval = EIO; - } - - memaddr += i; - myaddr += i; - len -= i; + break; /* not a recognized prologue instruction */ } - return returnval; + + /* The frame size is just the negative of the offset (from the original SP) + of the last thing thing we pushed on the stack. The frame offset is + [new FP] - [new SP]. */ + fi->framesize = -sp_offset; + fi->frameoffset = fp_offset - sp_offset; + + save_prologue_cache (fi); } + + +/* Function: find_callers_reg + Find REGNUM on the stack. Otherwise, it's in an active register. One thing + we might want to do here is to check REGNUM against the clobber mask, and + somehow flag it as invalid if it isn't saved on the stack somewhere. This + would provide a graceful failure mode when trying to get the value of + caller-saves registers for an inner frame. */ + +static CORE_ADDR +arm_find_callers_reg (fi, regnum) + struct frame_info * fi; + int regnum; +{ + for (; fi; fi = fi->next) + +#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */ + if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + return generic_read_register_dummy (fi->pc, fi->frame, regnum); + else #endif - -/* APCS (ARM procedure call standard) defines the following prologue: + if (fi->fsr.regs[regnum] != 0) + return read_memory_integer (fi->fsr.regs[regnum], + REGISTER_RAW_SIZE(regnum)); + return read_register (regnum); +} - mov ip, sp - [stmfd sp!, {a1,a2,a3,a4}] - stmfd sp!, {...,fp,ip,lr,pc} - [stfe f7, [sp, #-12]!] - [stfe f6, [sp, #-12]!] - [stfe f5, [sp, #-12]!] - [stfe f4, [sp, #-12]!] - sub fp, ip, #nn // nn == 20 or 4 depending on second ins + +/* Function: frame_chain + Given a GDB frame, determine the address of the calling function's frame. + This will be used to create a new GDB frame struct, and then + INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. + For ARM, we save the frame size when we initialize the frame_info. + + The original definition of this function was a macro in tm-arm.h: + { In the case of the ARM, the frame's nominal address is the FP value, + and 12 bytes before comes the saved previous FP value as a 4-byte word. } + + #define FRAME_CHAIN(thisframe) \ + ((thisframe)->pc >= LOWEST_PC ? \ + read_memory_integer ((thisframe)->frame - 12, 4) :\ + 0) */ CORE_ADDR -skip_prologue(pc) -CORE_ADDR pc; -{ - CORE_ADDR skip_pc = pc; -#if 0 - union insn_fmt op; - - op.ins = read_memory_integer(skip_pc, 4); - /* look for the "mov ip,sp" */ - if (op.generic.type != TYPE_ARITHMETIC || - op.arith.opcode != OPCODE_MOV || - op.arith.dest != SPTEMP || - op.arith.operand2 != SP) return pc; - skip_pc += 4; - /* skip the "stmfd sp!,{a1,a2,a3,a4}" if its there */ - op.ins = read_memory_integer(skip_pc, 4); - if (op.generic.type == TYPE_BLOCK_BRANCH && - op.generic.subtype == SUBTYPE_BLOCK && - op.block.mask == 0xf && - op.block.base == SP && - op.block.is_load == 0 && - op.block.writeback == 1 && - op.block.increment == 0 && - op.block.before == 1) skip_pc += 4; - /* skip the "stmfd sp!,{...,fp,ip,lr,pc} */ - op.ins = read_memory_integer(skip_pc, 4); - if (op.generic.type != TYPE_BLOCK_BRANCH || - op.generic.subtype != SUBTYPE_BLOCK || - /* the mask should look like 110110xxxxxx0000 */ - (op.block.mask & 0xd800) != 0xd800 || - op.block.base != SP || - op.block.is_load != 0 || - op.block.writeback != 1 || - op.block.increment != 0 || - op.block.before != 1) return pc; - skip_pc += 4; - /* check for "sub fp,ip,#nn" */ - op.ins = read_memory_integer(skip_pc, 4); - if (op.generic.type != TYPE_ARITHMETIC || - op.arith.opcode != OPCODE_SUB || - op.arith.dest != FP || - op.arith.operand1 != SPTEMP) return pc; +arm_frame_chain (fi) + struct frame_info * fi; +{ +#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */ + CORE_ADDR fn_start, callers_pc, fp; + + /* is this a dummy frame? */ + if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + return fi->frame; /* dummy frame same as caller's frame */ + + /* is caller-of-this a dummy frame? */ + callers_pc = FRAME_SAVED_PC(fi); /* find out who called us: */ + fp = arm_find_callers_reg (fi, FP_REGNUM); + if (PC_IN_CALL_DUMMY (callers_pc, fp, fp)) + return fp; /* dummy frame's frame may bear no relation to ours */ + + if (find_pc_partial_function (fi->pc, 0, &fn_start, 0)) + if (fn_start == entry_point_address ()) + return 0; /* in _start fn, don't chain further */ #endif - return skip_pc + 4; + CORE_ADDR caller_pc, fn_start; + struct frame_info caller_fi; + int framereg = fi->framereg; + + if (fi->pc < LOWEST_PC) + return 0; + + /* If the caller is the startup code, we're at the end of the chain. */ + caller_pc = FRAME_SAVED_PC (fi); + if (find_pc_partial_function (caller_pc, 0, &fn_start, 0)) + if (fn_start == entry_point_address ()) + return 0; + + /* If the caller is Thumb and the caller is ARM, or vice versa, + the frame register of the caller is different from ours. + So we must scan the prologue of the caller to determine its + frame register number. */ + if (arm_pc_is_thumb (caller_pc) != arm_pc_is_thumb (fi->pc)) + { + memset (& caller_fi, 0, sizeof (caller_fi)); + caller_fi.pc = caller_pc; + arm_scan_prologue (& caller_fi); + framereg = caller_fi.framereg; + } + + /* If the caller used a frame register, return its value. + Otherwise, return the caller's stack pointer. */ + if (framereg == FP_REGNUM || framereg == THUMB_FP_REGNUM) + return arm_find_callers_reg (fi, framereg); + else + return fi->frame + fi->framesize; } +/* Function: init_extra_frame_info + This function actually figures out the frame address for a given pc and + sp. This is tricky because we sometimes don't use an explicit + frame pointer, and the previous stack pointer isn't necessarily recorded + on the stack. The only reliable way to get this info is to + examine the prologue. */ + void -arm_frame_find_saved_regs (frame_info, saved_regs_addr) - struct frame_info *frame_info; - struct frame_saved_regs *saved_regs_addr; -{ - register int regnum; - register int frame; - register int next_addr; - register int return_data_save; - register int saved_register_mask; - - memset (saved_regs_addr, '\0', sizeof (*saved_regs_addr)); - frame = frame_info->frame; - return_data_save = read_memory_integer (frame, 4) & 0x03fffffc - 12; - saved_register_mask = read_memory_integer (return_data_save, 4); - next_addr = frame - 12; - for (regnum = 4; regnum < 10; regnum++) - if (saved_register_mask & (1 << regnum)) - { - next_addr -= 4; - saved_regs_addr->regs[regnum] = next_addr; - } - if (read_memory_integer (return_data_save + 4, 4) == 0xed6d7103) +arm_init_extra_frame_info (fi) + struct frame_info * fi; +{ + int reg; + + if (fi->next) + fi->pc = FRAME_SAVED_PC (fi->next); + + memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs); + +#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */ + if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { - next_addr -= 12; - saved_regs_addr->regs[F0_REGNUM + 7] = next_addr; + /* We need to setup fi->frame here because run_stack_dummy gets it wrong + by assuming it's always FP. */ + fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM); + fi->framesize = 0; + fi->frameoffset = 0; + return; } - if (read_memory_integer (return_data_save + 8, 4) == 0xed6d6103) + else +#endif { - next_addr -= 12; - saved_regs_addr->regs[F0_REGNUM + 6] = next_addr; + arm_scan_prologue (fi); + + if (!fi->next) /* this is the innermost frame? */ + fi->frame = read_register (fi->framereg); + else /* not the innermost frame */ + /* If we have an FP, the callee saved it. */ + if (fi->framereg == FP_REGNUM || fi->framereg == THUMB_FP_REGNUM) + if (fi->next->fsr.regs[fi->framereg] != 0) + fi->frame = read_memory_integer (fi->next->fsr.regs[fi->framereg], + 4); + + /* Calculate actual addresses of saved registers using offsets determined + by arm_scan_prologue. */ + for (reg = 0; reg < NUM_REGS; reg++) + if (fi->fsr.regs[reg] != 0) + fi->fsr.regs[reg] += fi->frame + fi->framesize - fi->frameoffset; } - if (read_memory_integer (return_data_save + 12, 4) == 0xed6d5103) +} + + +/* Function: frame_saved_pc + Find the caller of this frame. We do this by seeing if LR_REGNUM is saved + in the stack anywhere, otherwise we get it from the registers. + + The old definition of this function was a macro: + #define FRAME_SAVED_PC(FRAME) \ + ADDR_BITS_REMOVE (read_memory_integer ((FRAME)->frame - 4, 4)) +*/ + +CORE_ADDR +arm_frame_saved_pc (fi) + struct frame_info * fi; +{ +#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */ + if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM); + else +#endif { - next_addr -= 12; - saved_regs_addr->regs[F0_REGNUM + 5] = next_addr; + CORE_ADDR pc = arm_find_callers_reg (fi, LR_REGNUM); + return IS_THUMB_ADDR (pc) ? UNMAKE_THUMB_ADDR (pc) : pc; } - if (read_memory_integer(return_data_save + 16, 4) == 0xed6d4103) +} + + +/* Return the frame address. On ARM, it is R11; on Thumb it is R7. + Examine the Program Status Register to decide which state we're in. */ + +CORE_ADDR +arm_target_read_fp () +{ + if (read_register (PS_REGNUM) & 0x20) /* Bit 5 is Thumb state bit */ + return read_register (THUMB_FP_REGNUM); /* R7 if Thumb */ + else + return read_register (FP_REGNUM); /* R11 if ARM */ +} + + +/* Calculate the frame offsets of the saved registers (ARM version). */ +void +arm_frame_find_saved_regs (fi, regaddr) + struct frame_info *fi; + struct frame_saved_regs *regaddr; +{ + memcpy (regaddr, &fi->fsr, sizeof (struct frame_saved_regs)); +} + + +void +arm_push_dummy_frame () +{ + CORE_ADDR old_sp = read_register (SP_REGNUM); + CORE_ADDR sp = old_sp; + CORE_ADDR fp, prologue_start; + int regnum; + + /* Push the two dummy prologue instructions in reverse order, + so that they'll be in the correct low-to-high order in memory. */ + /* sub fp, ip, #4 */ + sp = push_word (sp, 0xe24cb004); + /* stmdb sp!, {r0-r10, fp, ip, lr, pc} */ + prologue_start = sp = push_word (sp, 0xe92ddfff); + + /* push a pointer to the dummy prologue + 12, because when + stm instruction stores the PC, it stores the address of the stm + instruction itself plus 12. */ + fp = sp = push_word (sp, prologue_start + 12); + sp = push_word (sp, read_register (PC_REGNUM)); /* FIXME: was PS_REGNUM */ + sp = push_word (sp, old_sp); + sp = push_word (sp, read_register (FP_REGNUM)); + + for (regnum = 10; regnum >= 0; regnum --) + sp = push_word (sp, read_register (regnum)); + + write_register (FP_REGNUM, fp); + write_register (THUMB_FP_REGNUM, fp); + write_register (SP_REGNUM, sp); +} + +/* Fix up the call dummy, based on whether the processor is currently + in Thumb or ARM mode, and whether the target function is Thumb + or ARM. There are three different situations requiring three + different dummies: + + * ARM calling ARM: uses the call dummy in tm-arm.h, which has already + been copied into the dummy parameter to this function. + * ARM calling Thumb: uses the call dummy in tm-arm.h, but with the + "mov pc,r4" instruction patched to be a "bx r4" instead. + * Thumb calling anything: uses the Thumb dummy defined below, which + works for calling both ARM and Thumb functions. + + All three call dummies expect to receive the target function address + in R4, with the low bit set if it's a Thumb function. +*/ + +void +arm_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p) + char * dummy; + CORE_ADDR pc; + CORE_ADDR fun; + int nargs; + value_ptr * args; + struct type * type; + int gcc_p; +{ + static short thumb_dummy[4] = + { + 0xf000, 0xf801, /* bl label */ + 0xdf18, /* swi 24 */ + 0x4720, /* label: bx r4 */ + }; + static unsigned long arm_bx_r4 = 0xe12fff14; /* bx r4 instruction */ + + /* Set flag indicating whether the current PC is in a Thumb function. */ + caller_is_thumb = arm_pc_is_thumb (read_pc()); + + /* If the target function is Thumb, set the low bit of the function address. + And if the CPU is currently in ARM mode, patch the second instruction + of call dummy to use a BX instruction to switch to Thumb mode. */ + target_is_thumb = arm_pc_is_thumb (fun); + if (target_is_thumb) { - next_addr -= 12; - saved_regs_addr->regs[F0_REGNUM + 4] = next_addr; + fun |= 1; + if (!caller_is_thumb) + store_unsigned_integer (dummy + 4, sizeof (arm_bx_r4), arm_bx_r4); + } + + /* If the CPU is currently in Thumb mode, use the Thumb call dummy + instead of the ARM one that's already been copied. This will + work for both Thumb and ARM target functions. */ + if (caller_is_thumb) + { + int i; + char *p = dummy; + int len = sizeof (thumb_dummy) / sizeof (thumb_dummy[0]); + + for (i = 0; i < len; i++) + { + store_unsigned_integer (p, sizeof (thumb_dummy[0]), thumb_dummy[i]); + p += sizeof (thumb_dummy[0]); + } } - saved_regs_addr->regs[SP_REGNUM] = next_addr; - saved_regs_addr->regs[PC_REGNUM] = frame - 4; - saved_regs_addr->regs[PS_REGNUM] = frame - 4; - saved_regs_addr->regs[FP_REGNUM] = frame - 12; + + /* Put the target address in r4; the call dummy will copy this to the PC. */ + write_register (4, fun); +} + + +/* Return the offset in the call dummy of the instruction that needs + to have a breakpoint placed on it. This is the offset of the 'swi 24' + instruction, which is no longer actually used, but simply acts + as a place-holder now. + + This implements the CALL_DUMMY_BREAK_OFFSET macro. +*/ + +int +arm_call_dummy_breakpoint_offset () +{ + if (caller_is_thumb) + return 4; + else + return 8; +} + + +CORE_ADDR +arm_push_arguments(nargs, args, sp, struct_return, struct_addr) + int nargs; + value_ptr * args; + CORE_ADDR sp; + int struct_return; + CORE_ADDR struct_addr; +{ + int argreg; + int float_argreg; + int argnum; + int stack_offset; + struct stack_arg { + char *val; + int len; + int offset; + }; + struct stack_arg *stack_args = + (struct stack_arg*)alloca (nargs * sizeof (struct stack_arg)); + int nstack_args = 0; + + + /* Initialize the integer and float register pointers. */ + argreg = A1_REGNUM; + float_argreg = F0_REGNUM; + + /* the struct_return pointer occupies the first parameter-passing reg */ + if (struct_return) + write_register (argreg++, struct_addr); + + /* The offset onto the stack at which we will start copying parameters + (after the registers are used up) begins at 16 in the old ABI. + This leaves room for the "home" area for register parameters. */ + stack_offset = REGISTER_SIZE * 4; + + /* Process args from left to right. Store as many as allowed in + registers, save the rest to be pushed on the stack */ + for(argnum = 0; argnum < nargs; argnum++) + { + char * val; + value_ptr arg = args[argnum]; + struct type * arg_type = check_typedef (VALUE_TYPE (arg)); + struct type * target_type = TYPE_TARGET_TYPE (arg_type); + int len = TYPE_LENGTH (arg_type); + enum type_code typecode = TYPE_CODE (arg_type); + CORE_ADDR regval; + int newarg; + + val = (char *) VALUE_CONTENTS (arg); + + /* If the argument is a pointer to a function, and it's a Thumb + function, set the low bit of the pointer. */ + if (typecode == TYPE_CODE_PTR + && target_type != NULL + && TYPE_CODE (target_type) == TYPE_CODE_FUNC) + { + regval = extract_address (val, len); + if (arm_pc_is_thumb (regval)) + store_address (val, len, MAKE_THUMB_ADDR (regval)); + } + +#define MAPCS_FLOAT 0 /* --mapcs-float not implemented by the compiler yet */ +#if MAPCS_FLOAT + /* Up to four floating point arguments can be passed in floating + point registers on ARM (not on Thumb). */ + if (typecode == TYPE_CODE_FLT + && float_argreg <= ARM_LAST_FP_ARG_REGNUM + && !target_is_thumb) + { + /* This is a floating point value that fits entirely + in a single register. */ + regval = extract_address (val, len); + write_register (float_argreg++, regval); + } + else +#endif + { + /* Copy the argument to general registers or the stack in + register-sized pieces. Large arguments are split between + registers and stack. */ + while (len > 0) + { + if (argreg <= ARM_LAST_ARG_REGNUM) + { + int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE; + regval = extract_address (val, partial_len); + + /* It's a simple argument being passed in a general + register. */ + write_register (argreg, regval); + argreg++; + len -= partial_len; + val += partial_len; + } + else + { + /* keep for later pushing */ + stack_args[nstack_args].val = val; + stack_args[nstack_args++].len = len; + break; + } + } + } + } + /* now do the real stack pushing, process args right to left */ + while(nstack_args--) + { + sp -= stack_args[nstack_args].len; + write_memory(sp, stack_args[nstack_args].val, + stack_args[nstack_args].len); + } + + /* Return adjusted stack pointer. */ + return sp; +} + +void +arm_pop_frame () +{ + struct frame_info *frame = get_current_frame(); + int regnum; + + for (regnum = 0; regnum < NUM_REGS; regnum++) + if (frame->fsr.regs[regnum] != 0) + write_register (regnum, + read_memory_integer (frame->fsr.regs[regnum], 4)); + + write_register (PC_REGNUM, FRAME_SAVED_PC (frame)); + write_register (SP_REGNUM, read_register (frame->framereg)); + + flush_cached_frames (); } static void -print_fpu_flags(flags) -int flags; +print_fpu_flags (flags) + int flags; { - if (flags & (1 << 0)) fputs("IVO ", stdout); - if (flags & (1 << 1)) fputs("DVZ ", stdout); - if (flags & (1 << 2)) fputs("OFL ", stdout); - if (flags & (1 << 3)) fputs("UFL ", stdout); - if (flags & (1 << 4)) fputs("INX ", stdout); - putchar('\n'); + if (flags & (1 << 0)) fputs ("IVO ", stdout); + if (flags & (1 << 1)) fputs ("DVZ ", stdout); + if (flags & (1 << 2)) fputs ("OFL ", stdout); + if (flags & (1 << 3)) fputs ("UFL ", stdout); + if (flags & (1 << 4)) fputs ("INX ", stdout); + putchar ('\n'); } void -arm_float_info() +arm_float_info () { - register unsigned long status = read_register(FPS_REGNUM); + register unsigned long status = read_register (FPS_REGNUM); int type; type = (status >> 24) & 127; - printf("%s FPU type %d\n", - (status & (1<<31)) ? "Hardware" : "Software", - type); - fputs("mask: ", stdout); - print_fpu_flags(status >> 16); - fputs("flags: ", stdout); - print_fpu_flags(status); + printf ("%s FPU type %d\n", + (status & (1<<31)) ? "Hardware" : "Software", + type); + fputs ("mask: ", stdout); + print_fpu_flags (status >> 16); + fputs ("flags: ", stdout); + print_fpu_flags (status); } +static char *original_register_names[] = +{ "a1", "a2", "a3", "a4", /* 0 1 2 3 */ + "v1", "v2", "v3", "v4", /* 4 5 6 7 */ + "v5", "v6", "sl", "fp", /* 8 9 10 11 */ + "ip", "sp", "lr", "pc", /* 12 13 14 15 */ + "f0", "f1", "f2", "f3", /* 16 17 18 19 */ + "f4", "f5", "f6", "f7", /* 20 21 22 23 */ + "fps","ps" } /* 24 25 */; + +/* These names are the ones which gcc emits, and + I find them less confusing. Toggle between them + using the `othernames' command. */ +static char *additional_register_names[] = +{ "r0", "r1", "r2", "r3", /* 0 1 2 3 */ + "r4", "r5", "r6", "r7", /* 4 5 6 7 */ + "r8", "r9", "sl", "fp", /* 8 9 10 11 */ + "ip", "sp", "lr", "pc", /* 12 13 14 15 */ + "f0", "f1", "f2", "f3", /* 16 17 18 19 */ + "f4", "f5", "f6", "f7", /* 20 21 22 23 */ + "fps","ps" } /* 24 25 */; + +char **arm_register_names = original_register_names; -static void arm_othernames() + +static void +arm_othernames () { static int toggle; - static char *original[] = ORIGINAL_REGISTER_NAMES; - static char *extra_crispy[] = ADDITIONAL_REGISTER_NAMES; - - memcpy (reg_names, toggle ? extra_crispy : original, sizeof(original)); + arm_register_names = (toggle + ? additional_register_names + : original_register_names); toggle = !toggle; } -void -_initialize_arm_tdep () -{ - tm_print_insn = print_insn_little_arm; - add_com ("othernames", class_obscure, arm_othernames); -} /* FIXME: Fill in with the 'right thing', see asm template in arm-convert.s */ void convert_from_extended (ptr, dbl) -void *ptr; -double *dbl; + void * ptr; + double * dbl; { *dbl = *(double*)ptr; } - void convert_to_extended (dbl, ptr) -void *ptr; -double *dbl; + void * ptr; + double * dbl; { *(double*)ptr = *dbl; } - -int -arm_nullified_insn (inst) - unsigned long inst; +static int +condition_true (cond, status_reg) + unsigned long cond; + unsigned long status_reg; { - unsigned long cond = inst & 0xf0000000; - unsigned long status_reg; - if (cond == INST_AL || cond == INST_NV) - return 0; - - status_reg = read_register (PS_REGNUM); + return 1; switch (cond) { case INST_EQ: - return ((status_reg & FLAG_Z) == 0); - case INST_NE: return ((status_reg & FLAG_Z) != 0); + case INST_NE: + return ((status_reg & FLAG_Z) == 0); case INST_CS: - return ((status_reg & FLAG_C) == 0); - case INST_CC: return ((status_reg & FLAG_C) != 0); + case INST_CC: + return ((status_reg & FLAG_C) == 0); case INST_MI: - return ((status_reg & FLAG_N) == 0); - case INST_PL: return ((status_reg & FLAG_N) != 0); + case INST_PL: + return ((status_reg & FLAG_N) == 0); case INST_VS: - return ((status_reg & FLAG_V) == 0); - case INST_VC: return ((status_reg & FLAG_V) != 0); + case INST_VC: + return ((status_reg & FLAG_V) == 0); case INST_HI: - return ((status_reg & (FLAG_C | FLAG_Z)) != FLAG_C); + return ((status_reg & (FLAG_C | FLAG_Z)) == FLAG_C); case INST_LS: - return (((status_reg & (FLAG_C | FLAG_Z)) ^ FLAG_C) == 0); + return ((status_reg & (FLAG_C | FLAG_Z)) != FLAG_C); case INST_GE: - return (((status_reg & FLAG_N) == 0) != ((status_reg & FLAG_V) == 0)); - case INST_LT: return (((status_reg & FLAG_N) == 0) == ((status_reg & FLAG_V) == 0)); + case INST_LT: + return (((status_reg & FLAG_N) == 0) != ((status_reg & FLAG_V) == 0)); case INST_GT: - return (((status_reg & FLAG_Z) != 0) || - (((status_reg & FLAG_N) == 0) != ((status_reg & FLAG_V) == 0))); - case INST_LE: return (((status_reg & FLAG_Z) == 0) && (((status_reg & FLAG_N) == 0) == ((status_reg & FLAG_V) == 0))); + case INST_LE: + return (((status_reg & FLAG_Z) != 0) || + (((status_reg & FLAG_N) == 0) != ((status_reg & FLAG_V) == 0))); } - return 0; + return 1; } - - -/* taken from remote-arm.c .. */ - #define submask(x) ((1L << ((x) + 1)) - 1) -#define bit(obj,st) (((obj) & (1L << (st))) >> st) -#define bits(obj,st,fn) \ - (((obj) & submask (fn) & ~ submask ((st) - 1)) >> (st)) +#define bit(obj,st) (((obj) >> (st)) & 1) +#define bits(obj,st,fn) (((obj) >> (st)) & submask ((fn) - (st))) #define sbits(obj,st,fn) \ ((long) (bits(obj,st,fn) | ((long) bit(obj,fn) * ~ submask (fn - st)))) #define BranchDest(addr,instr) \ @@ -560,10 +1121,11 @@ arm_nullified_insn (inst) #define ARM_PC_32 1 static unsigned long -shifted_reg_val (inst, carry, pc_val) +shifted_reg_val (inst, carry, pc_val, status_reg) unsigned long inst; int carry; unsigned long pc_val; + unsigned long status_reg; { unsigned long res, shift; int rm = bits (inst, 0, 3); @@ -578,7 +1140,7 @@ shifted_reg_val (inst, carry, pc_val) shift = bits (inst, 7, 11); res = (rm == 15 - ? ((pc_val | (ARM_PC_32 ? 0 : read_register (PS_REGNUM))) + ? ((pc_val | (ARM_PC_32 ? 0 : status_reg)) + (bit (inst, 4) ? 12 : 8)) : read_register (rm)); @@ -611,18 +1173,83 @@ shifted_reg_val (inst, carry, pc_val) } +/* Return number of 1-bits in VAL. */ + +static int +bitcount (val) + unsigned long val; +{ + int nbits; + for (nbits = 0; val != 0; nbits++) + val &= val - 1; /* delete rightmost 1-bit in val */ + return nbits; +} + + +static CORE_ADDR +thumb_get_next_pc (pc) + CORE_ADDR pc; +{ + unsigned long pc_val = ((unsigned long)pc) + 4; /* PC after prefetch */ + unsigned short inst1 = read_memory_integer (pc, 2); + CORE_ADDR nextpc = pc + 2; /* default is next instruction */ + unsigned long offset; + + if ((inst1 & 0xff00) == 0xbd00) /* pop {rlist, pc} */ + { + CORE_ADDR sp; + + /* Fetch the saved PC from the stack. It's stored above + all of the other registers. */ + offset = bitcount (bits (inst1, 0, 7)) * REGISTER_SIZE; + sp = read_register (SP_REGNUM); + nextpc = (CORE_ADDR) read_memory_integer (sp + offset, 4); + nextpc = ADDR_BITS_REMOVE (nextpc); + if (nextpc == pc) + error ("Infinite loop detected"); + } + else if ((inst1 & 0xf000) == 0xd000) /* conditional branch */ + { + unsigned long status = read_register (PS_REGNUM); + unsigned long cond = bits (inst1, 8, 11); + if (cond != 0x0f && condition_true (cond, status)) /* 0x0f = SWI */ + nextpc = pc_val + (sbits (inst1, 0, 7) << 1); + } + else if ((inst1 & 0xf800) == 0xe000) /* unconditional branch */ + { + nextpc = pc_val + (sbits (inst1, 0, 10) << 1); + } + else if ((inst1 & 0xf800) == 0xf000) /* long branch with link */ + { + unsigned short inst2 = read_memory_integer (pc + 2, 2); + offset = (sbits (inst1, 0, 10) << 12) + (bits (inst2, 0, 10) << 1); + nextpc = pc_val + offset; + } + + return nextpc; +} + + CORE_ADDR arm_get_next_pc (pc) CORE_ADDR pc; { - unsigned long pc_val = (unsigned long) pc; - unsigned long this_instr = read_memory_integer (pc, 4); - unsigned long status = read_register (PS_REGNUM); - CORE_ADDR nextpc = (CORE_ADDR) (pc_val + 4); /* Default case */ + unsigned long pc_val; + unsigned long this_instr; + unsigned long status; + CORE_ADDR nextpc; + + if (arm_pc_is_thumb (pc)) + return thumb_get_next_pc (pc); + + pc_val = (unsigned long) pc; + this_instr = read_memory_integer (pc, 4); + status = read_register (PS_REGNUM); + nextpc = (CORE_ADDR) (pc_val + 4); /* Default case */ - if (! arm_nullified_insn (this_instr)) + if (condition_true (bits (this_instr, 28, 31), status)) { - switch (bits(this_instr, 24, 27)) + switch (bits (this_instr, 24, 27)) { case 0x0: case 0x1: /* data processing */ case 0x2: case 0x3: @@ -631,7 +1258,7 @@ arm_get_next_pc (pc) unsigned long rn; int c; - if (bits(this_instr, 12, 15) != 15) + if (bits (this_instr, 12, 15) != 15) break; if (bits (this_instr, 22, 25) == 0 @@ -647,11 +1274,11 @@ arm_get_next_pc (pc) { unsigned long immval = bits (this_instr, 0, 7); unsigned long rotate = 2 * bits (this_instr, 8, 11); - operand2 = ((immval >> rotate) | (immval << (32-rotate)) - & 0xffffffff); + operand2 = ((immval >> rotate) | (immval << (32-rotate))) + & 0xffffffff; } else /* operand 2 is a shifted register */ - operand2 = shifted_reg_val (this_instr, c, pc_val); + operand2 = shifted_reg_val (this_instr, c, pc_val, status); switch (bits (this_instr, 21, 24)) { @@ -770,14 +1397,7 @@ arm_get_next_pc (pc) { /* up */ unsigned long reglist = bits (this_instr, 0, 14); - unsigned long regbit; - - for (; reglist != 0; reglist &= ~regbit) - { - regbit = reglist & (-reglist); - offset += 4; - } - + offset = bitcount (reglist) * 4; if (bit (this_instr, 24)) /* pre */ offset += 4; } @@ -824,3 +1444,183 @@ arm_get_next_pc (pc) return nextpc; } +#include "bfd-in2.h" +#include "libcoff.h" + +static int +gdb_print_insn_arm (memaddr, info) + bfd_vma memaddr; + disassemble_info * info; +{ + if (arm_pc_is_thumb (memaddr)) + { + static asymbol * asym; + static combined_entry_type ce; + static struct coff_symbol_struct csym; + static struct _bfd fake_bfd; + static bfd_target fake_target; + + if (csym.native == NULL) + { + /* Create a fake symbol vector containing a Thumb symbol. This is + solely so that the code in print_insn_little_arm() and + print_insn_big_arm() in opcodes/arm-dis.c will detect the presence + of a Thumb symbol and switch to decoding Thumb instructions. */ + + fake_target.flavour = bfd_target_coff_flavour; + fake_bfd.xvec = & fake_target; + ce.u.syment.n_sclass = C_THUMBEXTFUNC; + csym.native = & ce; + csym.symbol.the_bfd = & fake_bfd; + csym.symbol.name = "fake"; + asym = (asymbol *) & csym; + } + + memaddr = UNMAKE_THUMB_ADDR (memaddr); + info->symbols = & asym; + } + else + info->symbols = NULL; + + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + return print_insn_big_arm (memaddr, info); + else + return print_insn_little_arm (memaddr, info); +} + +/* Sequence of bytes for breakpoint instruction. */ +#define ARM_LE_BREAKPOINT {0xFE,0xDE,0xFF,0xE7} /* Recognized illegal opcodes */ +#define ARM_BE_BREAKPOINT {0xE7,0xFF,0xDE,0xFE} +#define THUMB_LE_BREAKPOINT {0xfe,0xdf} +#define THUMB_BE_BREAKPOINT {0xdf,0xfe} + +/* The following has been superseded by BREAKPOINT_FOR_PC, but + is defined merely to keep mem-break.c happy. */ +#define LITTLE_BREAKPOINT ARM_LE_BREAKPOINT +#define BIG_BREAKPOINT ARM_BE_BREAKPOINT + +/* This function implements the BREAKPOINT_FROM_PC macro. It uses the program + counter value to determine whether a 16- or 32-bit breakpoint should be + used. It returns a pointer to a string of bytes that encode a breakpoint + instruction, stores the length of the string to *lenptr, and adjusts pc + (if necessary) to point to the actual memory location where the + breakpoint should be inserted. */ + +unsigned char * +arm_breakpoint_from_pc (pcptr, lenptr) + CORE_ADDR * pcptr; + int * lenptr; +{ + if (arm_pc_is_thumb (*pcptr) || arm_pc_is_thumb_dummy (*pcptr)) + { + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + { + static char thumb_breakpoint[] = THUMB_BE_BREAKPOINT; + *pcptr = UNMAKE_THUMB_ADDR (*pcptr); + *lenptr = sizeof (thumb_breakpoint); + return thumb_breakpoint; + } + else + { + static char thumb_breakpoint[] = THUMB_LE_BREAKPOINT; + *pcptr = UNMAKE_THUMB_ADDR (*pcptr); + *lenptr = sizeof (thumb_breakpoint); + return thumb_breakpoint; + } + } + else + { + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + { + static char arm_breakpoint[] = ARM_BE_BREAKPOINT; + *lenptr = sizeof (arm_breakpoint); + return arm_breakpoint; + } + else + { + static char arm_breakpoint[] = ARM_LE_BREAKPOINT; + *lenptr = sizeof (arm_breakpoint); + return arm_breakpoint; + } + } +} +/* Return non-zero if the PC is inside a call thunk (aka stub or trampoline). + This implements the IN_SOLIB_CALL_TRAMPOLINE macro. */ + +int +arm_in_call_stub (pc, name) + CORE_ADDR pc; + char * name; +{ + CORE_ADDR start_addr; + + /* Find the starting address of the function containing the PC. If the + caller didn't give us a name, look it up at the same time. */ + if (find_pc_partial_function (pc, name ? NULL : &name, &start_addr, NULL) == 0) + return 0; + + return strncmp (name, "_call_via_r", 11) == 0; +} + + +/* If PC is in a Thumb call or return stub, return the address of the target + PC, which is in a register. The thunk functions are called _called_via_xx, + where x is the register name. The possible names are r0-r9, sl, fp, ip, + sp, and lr. */ + +CORE_ADDR +arm_skip_stub (pc) + CORE_ADDR pc; +{ + char * name; + CORE_ADDR start_addr; + + /* Find the starting address and name of the function containing the PC. */ + if (find_pc_partial_function (pc, &name, &start_addr, NULL) == 0) + return 0; + + /* Call thunks always start with "_call_via_". */ + if (strncmp (name, "_call_via_", 10) == 0) + { + /* Use the name suffix to determine which register contains + the target PC. */ + static char *table[15] = + { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "sl", "fp", "ip", "sp", "lr" + }; + int regno; + + for (regno = 0; regno <= 14; regno++) + if (strcmp (&name[10], table[regno]) == 0) + return read_register (regno); + } + return 0; /* not a stub */ +} + + +void +_initialize_arm_tdep () +{ + tm_print_insn = gdb_print_insn_arm; + + add_com ("othernames", class_obscure, arm_othernames, + "Switch to the other set of register names."); + + /* ??? Maybe this should be a boolean. */ + add_show_from_set (add_set_cmd ("apcs32", no_class, + var_zinteger, (char *)&arm_apcs_32, + "Set usage of ARM 32-bit mode.\n", &setlist), + & showlist); + +} + +/* Test whether the coff symbol specific value corresponds to a Thumb function */ +int +coff_sym_is_thumb(int val) +{ + return (val == C_THUMBEXT || + val == C_THUMBSTAT || + val == C_THUMBEXTFUNC || + val == C_THUMBSTATFUNC || + val == C_THUMBLABEL); +} diff --git a/contrib/gdb/gdb/arm-xdep.c b/contrib/gdb/gdb/arm-xdep.c index b855ac8..f0d806e 100644 --- a/contrib/gdb/gdb/arm-xdep.c +++ b/contrib/gdb/gdb/arm-xdep.c @@ -246,10 +246,10 @@ core_file_command (filename, from_tty) if (val < 0 || (val = myread (corechan, buf, sizeof buf)) < 0) { - char * buffer = (char *) alloca (strlen (reg_names[regno]) + char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) + 30); strcpy (buffer, "Reading register "); - strcat (buffer, reg_names[regno]); + strcat (buffer, REGISTER_NAME (regno)); perror_with_name (buffer); } @@ -274,3 +274,286 @@ core_file_command (filename, from_tty) else if (from_tty) printf ("No core file now.\n"); } + +#if 0 +/* Work with core dump and executable files, for GDB. + This code would be in corefile.c if it weren't machine-dependent. */ + +/* Structure to describe the chain of shared libraries used + by the execfile. + e.g. prog shares Xt which shares X11 which shares c. */ + +struct shared_library { + struct exec_header header; + char name[SHLIBLEN]; + CORE_ADDR text_start; /* CORE_ADDR of 1st byte of text, this file */ + long data_offset; /* offset of data section in file */ + int chan; /* file descriptor for the file */ + struct shared_library *shares; /* library this one shares */ +}; +static struct shared_library *shlib = 0; + +/* Hook for `exec_file_command' command to call. */ + +extern void (*exec_file_display_hook) (); + +static CORE_ADDR unshared_text_start; + +/* extended header from exec file (for shared library info) */ + +static struct exec_header exec_header; + +void +exec_file_command (filename, from_tty) + char *filename; + int from_tty; +{ + int val; + + /* Eliminate all traces of old exec file. + Mark text segment as empty. */ + + if (execfile) + free (execfile); + execfile = 0; + data_start = 0; + data_end -= exec_data_start; + text_start = 0; + unshared_text_start = 0; + text_end = 0; + exec_data_start = 0; + exec_data_end = 0; + if (execchan >= 0) + close (execchan); + execchan = -1; + if (shlib) { + close_shared_library(shlib); + shlib = 0; + } + + /* Now open and digest the file the user requested, if any. */ + + if (filename) + { + filename = tilde_expand (filename); + make_cleanup (free, filename); + + execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, + &execfile); + if (execchan < 0) + perror_with_name (filename); + + { + struct stat st_exec; + +#ifdef HEADER_SEEK_FD + HEADER_SEEK_FD (execchan); +#endif + + val = myread (execchan, &exec_header, sizeof exec_header); + exec_aouthdr = exec_header.a_exec; + + if (val < 0) + perror_with_name (filename); + + text_start = 0x8000; + + /* Look for shared library if needed */ + if (exec_header.a_exec.a_magic & MF_USES_SL) + shlib = open_shared_library(exec_header.a_shlibname, text_start); + + text_offset = N_TXTOFF (exec_aouthdr); + exec_data_offset = N_TXTOFF (exec_aouthdr) + exec_aouthdr.a_text; + + if (shlib) { + unshared_text_start = shared_text_end(shlib) & ~0x7fff; + stack_start = shlib->header.a_exec.a_sldatabase; + stack_end = STACK_END_ADDR; + } else + unshared_text_start = 0x8000; + text_end = unshared_text_start + exec_aouthdr.a_text; + + exec_data_start = unshared_text_start + exec_aouthdr.a_text; + exec_data_end = exec_data_start + exec_aouthdr.a_data; + + data_start = exec_data_start; + data_end += exec_data_start; + + fstat (execchan, &st_exec); + exec_mtime = st_exec.st_mtime; + } + + validate_files (); + } + else if (from_tty) + printf ("No executable file now.\n"); + + /* Tell display code (if any) about the changed file name. */ + if (exec_file_display_hook) + (*exec_file_display_hook) (filename); +} +#endif + +#if 0 +/* Read from the program's memory (except for inferior processes). + This function is misnamed, since it only reads, never writes; and + since it will use the core file and/or executable file as necessary. + + It should be extended to write as well as read, FIXME, for patching files. + + Return 0 if address could be read, EIO if addresss out of bounds. */ + +int +xfer_core_file (memaddr, myaddr, len) + CORE_ADDR memaddr; + char *myaddr; + int len; +{ + register int i; + register int val; + int xferchan; + char **xferfile; + int fileptr; + int returnval = 0; + + while (len > 0) + { + xferfile = 0; + xferchan = 0; + + /* Determine which file the next bunch of addresses reside in, + and where in the file. Set the file's read/write pointer + to point at the proper place for the desired address + and set xferfile and xferchan for the correct file. + + If desired address is nonexistent, leave them zero. + + i is set to the number of bytes that can be handled + along with the next address. + + We put the most likely tests first for efficiency. */ + + /* Note that if there is no core file + data_start and data_end are equal. */ + if (memaddr >= data_start && memaddr < data_end) + { + i = min (len, data_end - memaddr); + fileptr = memaddr - data_start + data_offset; + xferfile = &corefile; + xferchan = corechan; + } + /* Note that if there is no core file + stack_start and stack_end define the shared library data. */ + else if (memaddr >= stack_start && memaddr < stack_end) + { + if (corechan < 0) { + struct shared_library *lib; + for (lib = shlib; lib; lib = lib->shares) + if (memaddr >= lib->header.a_exec.a_sldatabase && + memaddr < lib->header.a_exec.a_sldatabase + + lib->header.a_exec.a_data) + break; + if (lib) { + i = min (len, lib->header.a_exec.a_sldatabase + + lib->header.a_exec.a_data - memaddr); + fileptr = lib->data_offset + memaddr - + lib->header.a_exec.a_sldatabase; + xferfile = execfile; + xferchan = lib->chan; + } + } else { + i = min (len, stack_end - memaddr); + fileptr = memaddr - stack_start + stack_offset; + xferfile = &corefile; + xferchan = corechan; + } + } + else if (corechan < 0 + && memaddr >= exec_data_start && memaddr < exec_data_end) + { + i = min (len, exec_data_end - memaddr); + fileptr = memaddr - exec_data_start + exec_data_offset; + xferfile = &execfile; + xferchan = execchan; + } + else if (memaddr >= text_start && memaddr < text_end) + { + struct shared_library *lib; + for (lib = shlib; lib; lib = lib->shares) + if (memaddr >= lib->text_start && + memaddr < lib->text_start + lib->header.a_exec.a_text) + break; + if (lib) { + i = min (len, lib->header.a_exec.a_text + + lib->text_start - memaddr); + fileptr = memaddr - lib->text_start + text_offset; + xferfile = &execfile; + xferchan = lib->chan; + } else { + i = min (len, text_end - memaddr); + fileptr = memaddr - unshared_text_start + text_offset; + xferfile = &execfile; + xferchan = execchan; + } + } + else if (memaddr < text_start) + { + i = min (len, text_start - memaddr); + } + else if (memaddr >= text_end + && memaddr < (corechan >= 0? data_start : exec_data_start)) + { + i = min (len, data_start - memaddr); + } + else if (corechan >= 0 + && memaddr >= data_end && memaddr < stack_start) + { + i = min (len, stack_start - memaddr); + } + else if (corechan < 0 && memaddr >= exec_data_end) + { + i = min (len, - memaddr); + } + else if (memaddr >= stack_end && stack_end != 0) + { + i = min (len, - memaddr); + } + else + { + /* Address did not classify into one of the known ranges. + This shouldn't happen; we catch the endpoints. */ + fatal ("Internal: Bad case logic in xfer_core_file."); + } + + /* Now we know which file to use. + Set up its pointer and transfer the data. */ + if (xferfile) + { + if (*xferfile == 0) + if (xferfile == &execfile) + error ("No program file to examine."); + else + error ("No core dump file or running program to examine."); + val = lseek (xferchan, fileptr, 0); + if (val < 0) + perror_with_name (*xferfile); + val = myread (xferchan, myaddr, i); + if (val < 0) + perror_with_name (*xferfile); + } + /* If this address is for nonexistent memory, + read zeros if reading, or do nothing if writing. + Actually, we never right. */ + else + { + memset (myaddr, '\0', i); + returnval = EIO; + } + + memaddr += i; + myaddr += i; + len -= i; + } + return returnval; +} +#endif diff --git a/contrib/gdb/gdb/ax-gdb.c b/contrib/gdb/gdb/ax-gdb.c new file mode 100644 index 0000000..55cc856 --- /dev/null +++ b/contrib/gdb/gdb/ax-gdb.c @@ -0,0 +1,1942 @@ +/* GDB-specific functions for operating on agent expressions + Copyright 1998 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. */ + +/* $Id: ax-gdb.c,v 1.8 1998/12/03 05:34:24 cagney Exp $ */ + +#include "defs.h" +#include "symtab.h" +#include "symfile.h" +#include "gdbtypes.h" +#include "value.h" +#include "expression.h" +#include "command.h" +#include "gdbcmd.h" +#include "frame.h" +#include "target.h" +#include "ax.h" +#include "ax-gdb.h" + +/* Probably the best way to read this file is to start with the types + and enums in ax-gdb.h, and then look at gen_expr, towards the + bottom; that's the main function that looks at the GDB expressions + and calls everything else to generate code. + + I'm beginning to wonder whether it wouldn't be nicer to internally + generate trees, with types, and then spit out the bytecode in + linear form afterwards; we could generate fewer `swap', `ext', and + `zero_ext' bytecodes that way; it would make good constant folding + easier, too. But at the moment, I think we should be willing to + pay for the simplicity of this code with less-than-optimal bytecode + strings. + + Remember, "GBD" stands for "Great Britain, Dammit!" So be careful. */ + + + +/* Prototypes for local functions. */ + +/* There's a standard order to the arguments of these functions: + union exp_element ** --- pointer into expression + struct agent_expr * --- agent expression buffer to generate code into + struct axs_value * --- describes value left on top of stack */ + +static struct value *const_var_ref PARAMS ((struct symbol *var)); +static struct value *const_expr PARAMS ((union exp_element **pc)); +static struct value *maybe_const_expr PARAMS ((union exp_element **pc)); + +static void gen_traced_pop PARAMS ((struct agent_expr *, struct axs_value *)); + +static void gen_sign_extend PARAMS ((struct agent_expr *, struct type *)); +static void gen_extend PARAMS ((struct agent_expr *, struct type *)); +static void gen_fetch PARAMS ((struct agent_expr *, struct type *)); +static void gen_left_shift PARAMS ((struct agent_expr *, int)); + + +static void gen_frame_args_address PARAMS ((struct agent_expr *)); +static void gen_frame_locals_address PARAMS ((struct agent_expr *)); +static void gen_offset PARAMS ((struct agent_expr *ax, int offset)); +static void gen_sym_offset PARAMS ((struct agent_expr *, struct symbol *)); +static void gen_var_ref PARAMS ((struct agent_expr *ax, + struct axs_value *value, + struct symbol *var)); + + +static void gen_int_literal PARAMS ((struct agent_expr *ax, + struct axs_value *value, + LONGEST k, struct type *type)); + + +static void require_rvalue PARAMS ((struct agent_expr *ax, + struct axs_value *value)); +static void gen_usual_unary PARAMS ((struct agent_expr *ax, + struct axs_value *value)); +static int type_wider_than PARAMS ((struct type *type1, + struct type *type2)); +static struct type *max_type PARAMS ((struct type *type1, + struct type *type2)); +static void gen_conversion PARAMS ((struct agent_expr *ax, + struct type *from, + struct type *to)); +static int is_nontrivial_conversion PARAMS ((struct type *from, + struct type *to)); +static void gen_usual_arithmetic PARAMS ((struct agent_expr *ax, + struct axs_value *value1, + struct axs_value *value2)); +static void gen_integral_promotions PARAMS ((struct agent_expr *ax, + struct axs_value *value)); +static void gen_cast PARAMS ((struct agent_expr *ax, + struct axs_value *value, + struct type *type)); +static void gen_scale PARAMS ((struct agent_expr *ax, + enum agent_op op, + struct type *type)); +static void gen_add PARAMS ((struct agent_expr *ax, + struct axs_value *value, + struct axs_value *value1, + struct axs_value *value2, + char *name)); +static void gen_sub PARAMS ((struct agent_expr *ax, + struct axs_value *value, + struct axs_value *value1, + struct axs_value *value2)); +static void gen_binop PARAMS ((struct agent_expr *ax, + struct axs_value *value, + struct axs_value *value1, + struct axs_value *value2, + enum agent_op op, + enum agent_op op_unsigned, + int may_carry, + char *name)); +static void gen_logical_not PARAMS ((struct agent_expr *ax, + struct axs_value *value)); +static void gen_complement PARAMS ((struct agent_expr *ax, + struct axs_value *value)); +static void gen_deref PARAMS ((struct agent_expr *, struct axs_value *)); +static void gen_address_of PARAMS ((struct agent_expr *, struct axs_value *)); +static int find_field PARAMS ((struct type *type, char *name)); +static void gen_bitfield_ref PARAMS ((struct agent_expr *ax, + struct axs_value *value, + struct type *type, + int start, int end)); +static void gen_struct_ref PARAMS ((struct agent_expr *ax, + struct axs_value *value, + char *field, + char *operator_name, + char *operand_name)); +static void gen_repeat PARAMS ((union exp_element **pc, + struct agent_expr *ax, + struct axs_value *value)); +static void gen_sizeof PARAMS ((union exp_element **pc, + struct agent_expr *ax, + struct axs_value *value)); +static void gen_expr PARAMS ((union exp_element **pc, + struct agent_expr *ax, + struct axs_value *value)); + +static void print_axs_value PARAMS ((GDB_FILE *f, struct axs_value *value)); +static void agent_command PARAMS ((char *exp, int from_tty)); + + +/* Detecting constant expressions. */ + +/* If the variable reference at *PC is a constant, return its value. + Otherwise, return zero. + + Hey, Wally! How can a variable reference be a constant? + + Well, Beav, this function really handles the OP_VAR_VALUE operator, + not specifically variable references. GDB uses OP_VAR_VALUE to + refer to any kind of symbolic reference: function names, enum + elements, and goto labels are all handled through the OP_VAR_VALUE + operator, even though they're constants. It makes sense given the + situation. + + Gee, Wally, don'cha wonder sometimes if data representations that + subvert commonly accepted definitions of terms in favor of heavily + context-specific interpretations are really just a tool of the + programming hegemony to preserve their power and exclude the + proletariat? */ + +static struct value * +const_var_ref (var) + struct symbol *var; +{ + struct type *type = SYMBOL_TYPE (var); + + switch (SYMBOL_CLASS (var)) + { + case LOC_CONST: + return value_from_longest (type, (LONGEST) SYMBOL_VALUE (var)); + + case LOC_LABEL: + return value_from_longest (type, (LONGEST) SYMBOL_VALUE_ADDRESS (var)); + + default: + return 0; + } +} + + +/* If the expression starting at *PC has a constant value, return it. + Otherwise, return zero. If we return a value, then *PC will be + advanced to the end of it. If we return zero, *PC could be + anywhere. */ +static struct value * +const_expr (pc) + union exp_element **pc; +{ + enum exp_opcode op = (*pc)->opcode; + struct value *v1; + + switch (op) + { + case OP_LONG: + { + struct type *type = (*pc)[1].type; + LONGEST k = (*pc)[2].longconst; + (*pc) += 4; + return value_from_longest (type, k); + } + + case OP_VAR_VALUE: + { + struct value *v = const_var_ref ((*pc)[2].symbol); + (*pc) += 4; + return v; + } + + /* We could add more operators in here. */ + + case UNOP_NEG: + (*pc)++; + v1 = const_expr (pc); + if (v1) + return value_neg (v1); + else + return 0; + + default: + return 0; + } +} + + +/* Like const_expr, but guarantee also that *PC is undisturbed if the + expression is not constant. */ +static struct value * +maybe_const_expr (pc) + union exp_element **pc; +{ + union exp_element *tentative_pc = *pc; + struct value *v = const_expr (&tentative_pc); + + /* If we got a value, then update the real PC. */ + if (v) + *pc = tentative_pc; + + return v; +} + + +/* Generating bytecode from GDB expressions: general assumptions */ + +/* Here are a few general assumptions made throughout the code; if you + want to make a change that contradicts one of these, then you'd + better scan things pretty thoroughly. + + - We assume that all values occupy one stack element. For example, + sometimes we'll swap to get at the left argument to a binary + operator. If we decide that void values should occupy no stack + elements, or that synthetic arrays (whose size is determined at + run time, created by the `@' operator) should occupy two stack + elements (address and length), then this will cause trouble. + + - We assume the stack elements are infinitely wide, and that we + don't have to worry what happens if the user requests an + operation that is wider than the actual interpreter's stack. + That is, it's up to the interpreter to handle directly all the + integer widths the user has access to. (Woe betide the language + with bignums!) + + - We don't support side effects. Thus, we don't have to worry about + GCC's generalized lvalues, function calls, etc. + + - We don't support floating point. Many places where we switch on + some type don't bother to include cases for floating point; there + may be even more subtle ways this assumption exists. For + example, the arguments to % must be integers. + + - We assume all subexpressions have a static, unchanging type. If + we tried to support convenience variables, this would be a + problem. + + - All values on the stack should always be fully zero- or + sign-extended. + + (I wasn't sure whether to choose this or its opposite --- that + only addresses are assumed extended --- but it turns out that + neither convention completely eliminates spurious extend + operations (if everything is always extended, then you have to + extend after add, because it could overflow; if nothing is + extended, then you end up producing extends whenever you change + sizes), and this is simpler.) */ + + +/* Generating bytecode from GDB expressions: the `trace' kludge */ + +/* The compiler in this file is a general-purpose mechanism for + translating GDB expressions into bytecode. One ought to be able to + find a million and one uses for it. + + However, at the moment it is HOPELESSLY BRAIN-DAMAGED for the sake + of expediency. Let he who is without sin cast the first stone. + + For the data tracing facility, we need to insert `trace' bytecodes + before each data fetch; this records all the memory that the + expression touches in the course of evaluation, so that memory will + be available when the user later tries to evaluate the expression + in GDB. + + This should be done (I think) in a post-processing pass, that walks + an arbitrary agent expression and inserts `trace' operations at the + appropriate points. But it's much faster to just hack them + directly into the code. And since we're in a crunch, that's what + I've done. + + Setting the flag trace_kludge to non-zero enables the code that + emits the trace bytecodes at the appropriate points. */ +static int trace_kludge; + +/* Trace the lvalue on the stack, if it needs it. In either case, pop + the value. Useful on the left side of a comma, and at the end of + an expression being used for tracing. */ +static void +gen_traced_pop (ax, value) + struct agent_expr *ax; + struct axs_value *value; +{ + if (trace_kludge) + switch (value->kind) + { + case axs_rvalue: + /* We don't trace rvalues, just the lvalues necessary to + produce them. So just dispose of this value. */ + ax_simple (ax, aop_pop); + break; + + case axs_lvalue_memory: + { + int length = TYPE_LENGTH (value->type); + + /* There's no point in trying to use a trace_quick bytecode + here, since "trace_quick SIZE pop" is three bytes, whereas + "const8 SIZE trace" is also three bytes, does the same + thing, and the simplest code which generates that will also + work correctly for objects with large sizes. */ + ax_const_l (ax, length); + ax_simple (ax, aop_trace); + } + break; + + case axs_lvalue_register: + /* We need to mention the register somewhere in the bytecode, + so ax_reqs will pick it up and add it to the mask of + registers used. */ + ax_reg (ax, value->u.reg); + ax_simple (ax, aop_pop); + break; + } + else + /* If we're not tracing, just pop the value. */ + ax_simple (ax, aop_pop); +} + + + +/* Generating bytecode from GDB expressions: helper functions */ + +/* Assume that the lower bits of the top of the stack is a value of + type TYPE, and the upper bits are zero. Sign-extend if necessary. */ +static void +gen_sign_extend (ax, type) + struct agent_expr *ax; + struct type *type; +{ + /* Do we need to sign-extend this? */ + if (! TYPE_UNSIGNED (type)) + ax_ext (ax, type->length * TARGET_CHAR_BIT); +} + + +/* Assume the lower bits of the top of the stack hold a value of type + TYPE, and the upper bits are garbage. Sign-extend or truncate as + needed. */ +static void +gen_extend (ax, type) + struct agent_expr *ax; + struct type *type; +{ + int bits = type->length * TARGET_CHAR_BIT; + /* I just had to. */ + ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, bits)); +} + + +/* Assume that the top of the stack contains a value of type "pointer + to TYPE"; generate code to fetch its value. Note that TYPE is the + target type, not the pointer type. */ +static void +gen_fetch (ax, type) + struct agent_expr *ax; + struct type *type; +{ + if (trace_kludge) + { + /* Record the area of memory we're about to fetch. */ + ax_trace_quick (ax, TYPE_LENGTH (type)); + } + + switch (type->code) + { + case TYPE_CODE_PTR: + case TYPE_CODE_ENUM: + case TYPE_CODE_INT: + case TYPE_CODE_CHAR: + /* It's a scalar value, so we know how to dereference it. How + many bytes long is it? */ + switch (type->length) + { + case 8 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref8 ); break; + case 16 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref16); break; + case 32 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref32); break; + case 64 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref64); break; + + /* Either our caller shouldn't have asked us to dereference + that pointer (other code's fault), or we're not + implementing something we should be (this code's fault). + In any case, it's a bug the user shouldn't see. */ + default: + error ("GDB bug: ax-gdb.c (gen_fetch): strange size"); + } + + gen_sign_extend (ax, type); + break; + + default: + /* Either our caller shouldn't have asked us to dereference that + pointer (other code's fault), or we're not implementing + something we should be (this code's fault). In any case, + it's a bug the user shouldn't see. */ + error ("GDB bug: ax-gdb.c (gen_fetch): bad type code"); + } +} + + +/* Generate code to left shift the top of the stack by DISTANCE bits, or + right shift it by -DISTANCE bits if DISTANCE < 0. This generates + unsigned (logical) right shifts. */ +static void +gen_left_shift (ax, distance) + struct agent_expr *ax; + int distance; +{ + if (distance > 0) + { + ax_const_l (ax, distance); + ax_simple (ax, aop_lsh); + } + else if (distance < 0) + { + ax_const_l (ax, -distance); + ax_simple (ax, aop_rsh_unsigned); + } +} + + + +/* Generating bytecode from GDB expressions: symbol references */ + +/* Generate code to push the base address of the argument portion of + the top stack frame. */ +static void +gen_frame_args_address (ax) + struct agent_expr *ax; +{ + long frame_reg, frame_offset; + + TARGET_VIRTUAL_FRAME_POINTER (ax->scope, &frame_reg, &frame_offset); + ax_reg (ax, frame_reg); + gen_offset (ax, frame_offset); +} + + +/* Generate code to push the base address of the locals portion of the + top stack frame. */ +static void +gen_frame_locals_address (ax) + struct agent_expr *ax; +{ + long frame_reg, frame_offset; + + TARGET_VIRTUAL_FRAME_POINTER (ax->scope, &frame_reg, &frame_offset); + ax_reg (ax, frame_reg); + gen_offset (ax, frame_offset); +} + + +/* Generate code to add OFFSET to the top of the stack. Try to + generate short and readable code. We use this for getting to + variables on the stack, and structure members. If we were + programming in ML, it would be clearer why these are the same + thing. */ +static void +gen_offset (ax, offset) + struct agent_expr *ax; + int offset; +{ + /* It would suffice to simply push the offset and add it, but this + makes it easier to read positive and negative offsets in the + bytecode. */ + if (offset > 0) + { + ax_const_l (ax, offset); + ax_simple (ax, aop_add); + } + else if (offset < 0) + { + ax_const_l (ax, -offset); + ax_simple (ax, aop_sub); + } +} + + +/* In many cases, a symbol's value is the offset from some other + address (stack frame, base register, etc.) Generate code to add + VAR's value to the top of the stack. */ +static void +gen_sym_offset (ax, var) + struct agent_expr *ax; + struct symbol *var; +{ + gen_offset (ax, SYMBOL_VALUE (var)); +} + + +/* Generate code for a variable reference to AX. The variable is the + symbol VAR. Set VALUE to describe the result. */ + +static void +gen_var_ref (ax, value, var) + struct agent_expr *ax; + struct axs_value *value; + struct symbol *var; +{ + /* Dereference any typedefs. */ + value->type = check_typedef (SYMBOL_TYPE (var)); + + /* I'm imitating the code in read_var_value. */ + switch (SYMBOL_CLASS (var)) + { + case LOC_CONST: /* A constant, like an enum value. */ + ax_const_l (ax, (LONGEST) SYMBOL_VALUE (var)); + value->kind = axs_rvalue; + break; + + case LOC_LABEL: /* A goto label, being used as a value. */ + ax_const_l (ax, (LONGEST) SYMBOL_VALUE_ADDRESS (var)); + value->kind = axs_rvalue; + break; + + case LOC_CONST_BYTES: + error ("GDB bug: ax-gdb.c (gen_var_ref): LOC_CONST_BYTES symbols are not supported"); + + /* Variable at a fixed location in memory. Easy. */ + case LOC_STATIC: + /* Push the address of the variable. */ + ax_const_l (ax, SYMBOL_VALUE_ADDRESS (var)); + value->kind = axs_lvalue_memory; + break; + + case LOC_ARG: /* var lives in argument area of frame */ + gen_frame_args_address (ax); + gen_sym_offset (ax, var); + value->kind = axs_lvalue_memory; + break; + + case LOC_REF_ARG: /* As above, but the frame slot really + holds the address of the variable. */ + gen_frame_args_address (ax); + gen_sym_offset (ax, var); + /* Don't assume any particular pointer size. */ + gen_fetch (ax, lookup_pointer_type (builtin_type_void)); + value->kind = axs_lvalue_memory; + break; + + case LOC_LOCAL: /* var lives in locals area of frame */ + case LOC_LOCAL_ARG: + gen_frame_locals_address (ax); + gen_sym_offset (ax, var); + value->kind = axs_lvalue_memory; + break; + + case LOC_BASEREG: /* relative to some base register */ + case LOC_BASEREG_ARG: + ax_reg (ax, SYMBOL_BASEREG (var)); + gen_sym_offset (ax, var); + value->kind = axs_lvalue_memory; + break; + + case LOC_TYPEDEF: + error ("Cannot compute value of typedef `%s'.", + SYMBOL_SOURCE_NAME (var)); + break; + + case LOC_BLOCK: + ax_const_l (ax, BLOCK_START (SYMBOL_BLOCK_VALUE (var))); + value->kind = axs_rvalue; + break; + + case LOC_REGISTER: + case LOC_REGPARM: + /* Don't generate any code at all; in the process of treating + this as an lvalue or rvalue, the caller will generate the + right code. */ + value->kind = axs_lvalue_register; + value->u.reg = SYMBOL_VALUE (var); + break; + + /* A lot like LOC_REF_ARG, but the pointer lives directly in a + register, not on the stack. Simpler than LOC_REGISTER and + LOC_REGPARM, because it's just like any other case where the + thing has a real address. */ + case LOC_REGPARM_ADDR: + ax_reg (ax, SYMBOL_VALUE (var)); + value->kind = axs_lvalue_memory; + break; + + case LOC_UNRESOLVED: + { + struct minimal_symbol *msym + = lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL); + if (! msym) + error ("Couldn't resolve symbol `%s'.", SYMBOL_SOURCE_NAME (var)); + + /* Push the address of the variable. */ + ax_const_l (ax, SYMBOL_VALUE_ADDRESS (msym)); + value->kind = axs_lvalue_memory; + } + break; + + case LOC_OPTIMIZED_OUT: + error ("The variable `%s' has been optimized out.", + SYMBOL_SOURCE_NAME (var)); + break; + + default: + error ("Cannot find value of botched symbol `%s'.", + SYMBOL_SOURCE_NAME (var)); + break; + } +} + + + +/* Generating bytecode from GDB expressions: literals */ + +static void +gen_int_literal (ax, value, k, type) + struct agent_expr *ax; + struct axs_value *value; + LONGEST k; + struct type *type; +{ + ax_const_l (ax, k); + value->kind = axs_rvalue; + value->type = type; +} + + + +/* Generating bytecode from GDB expressions: unary conversions, casts */ + +/* Take what's on the top of the stack (as described by VALUE), and + try to make an rvalue out of it. Signal an error if we can't do + that. */ +static void +require_rvalue (ax, value) + struct agent_expr *ax; + struct axs_value *value; +{ + switch (value->kind) + { + case axs_rvalue: + /* It's already an rvalue. */ + break; + + case axs_lvalue_memory: + /* The top of stack is the address of the object. Dereference. */ + gen_fetch (ax, value->type); + break; + + case axs_lvalue_register: + /* There's nothing on the stack, but value->u.reg is the + register number containing the value. + + When we add floating-point support, this is going to have to + change. What about SPARC register pairs, for example? */ + ax_reg (ax, value->u.reg); + gen_extend (ax, value->type); + break; + } + + value->kind = axs_rvalue; +} + + +/* Assume the top of the stack is described by VALUE, and perform the + usual unary conversions. This is motivated by ANSI 6.2.2, but of + course GDB expressions are not ANSI; they're the mishmash union of + a bunch of languages. Rah. + + NOTE! This function promises to produce an rvalue only when the + incoming value is of an appropriate type. In other words, the + consumer of the value this function produces may assume the value + is an rvalue only after checking its type. + + The immediate issue is that if the user tries to use a structure or + union as an operand of, say, the `+' operator, we don't want to try + to convert that structure to an rvalue; require_rvalue will bomb on + structs and unions. Rather, we want to simply pass the struct + lvalue through unchanged, and let `+' raise an error. */ + +static void +gen_usual_unary (ax, value) + struct agent_expr *ax; + struct axs_value *value; +{ + /* We don't have to generate any code for the usual integral + conversions, since values are always represented as full-width on + the stack. Should we tweak the type? */ + + /* Some types require special handling. */ + switch (value->type->code) + { + /* Functions get converted to a pointer to the function. */ + case TYPE_CODE_FUNC: + value->type = lookup_pointer_type (value->type); + value->kind = axs_rvalue; /* Should always be true, but just in case. */ + break; + + /* Arrays get converted to a pointer to their first element, and + are no longer an lvalue. */ + case TYPE_CODE_ARRAY: + { + struct type *elements = TYPE_TARGET_TYPE (value->type); + value->type = lookup_pointer_type (elements); + value->kind = axs_rvalue; + /* We don't need to generate any code; the address of the array + is also the address of its first element. */ + } + break; + + /* Don't try to convert structures and unions to rvalues. Let the + consumer signal an error. */ + case TYPE_CODE_STRUCT: + case TYPE_CODE_UNION: + return; + + /* If the value is an enum, call it an integer. */ + case TYPE_CODE_ENUM: + value->type = builtin_type_int; + break; + } + + /* If the value is an lvalue, dereference it. */ + require_rvalue (ax, value); +} + + +/* Return non-zero iff the type TYPE1 is considered "wider" than the + type TYPE2, according to the rules described in gen_usual_arithmetic. */ +static int +type_wider_than (type1, type2) + struct type *type1, *type2; +{ + return (TYPE_LENGTH (type1) > TYPE_LENGTH (type2) + || (TYPE_LENGTH (type1) == TYPE_LENGTH (type2) + && TYPE_UNSIGNED (type1) + && ! TYPE_UNSIGNED (type2))); +} + + +/* Return the "wider" of the two types TYPE1 and TYPE2. */ +static struct type * +max_type (type1, type2) + struct type *type1, *type2; +{ + return type_wider_than (type1, type2) ? type1 : type2; +} + + +/* Generate code to convert a scalar value of type FROM to type TO. */ +static void +gen_conversion (ax, from, to) + struct agent_expr *ax; + struct type *from, *to; +{ + /* Perhaps there is a more graceful way to state these rules. */ + + /* If we're converting to a narrower type, then we need to clear out + the upper bits. */ + if (TYPE_LENGTH (to) < TYPE_LENGTH (from)) + gen_extend (ax, from); + + /* If the two values have equal width, but different signednesses, + then we need to extend. */ + else if (TYPE_LENGTH (to) == TYPE_LENGTH (from)) + { + if (TYPE_UNSIGNED (from) != TYPE_UNSIGNED (to)) + gen_extend (ax, to); + } + + /* If we're converting to a wider type, and becoming unsigned, then + we need to zero out any possible sign bits. */ + else if (TYPE_LENGTH (to) > TYPE_LENGTH (from)) + { + if (TYPE_UNSIGNED (to)) + gen_extend (ax, to); + } +} + + +/* Return non-zero iff the type FROM will require any bytecodes to be + emitted to be converted to the type TO. */ +static int +is_nontrivial_conversion (from, to) + struct type *from, *to; +{ + struct agent_expr *ax = new_agent_expr (0); + int nontrivial; + + /* Actually generate the code, and see if anything came out. At the + moment, it would be trivial to replicate the code in + gen_conversion here, but in the future, when we're supporting + floating point and the like, it may not be. Doing things this + way allows this function to be independent of the logic in + gen_conversion. */ + gen_conversion (ax, from, to); + nontrivial = ax->len > 0; + free_agent_expr (ax); + return nontrivial; +} + + +/* Generate code to perform the "usual arithmetic conversions" (ANSI C + 6.2.1.5) for the two operands of an arithmetic operator. This + effectively finds a "least upper bound" type for the two arguments, + and promotes each argument to that type. *VALUE1 and *VALUE2 + describe the values as they are passed in, and as they are left. */ +static void +gen_usual_arithmetic (ax, value1, value2) + struct agent_expr *ax; + struct axs_value *value1, *value2; +{ + /* Do the usual binary conversions. */ + if (TYPE_CODE (value1->type) == TYPE_CODE_INT + && TYPE_CODE (value2->type) == TYPE_CODE_INT) + { + /* The ANSI integral promotions seem to work this way: Order the + integer types by size, and then by signedness: an n-bit + unsigned type is considered "wider" than an n-bit signed + type. Promote to the "wider" of the two types, and always + promote at least to int. */ + struct type *target = max_type (builtin_type_int, + max_type (value1->type, value2->type)); + + /* Deal with value2, on the top of the stack. */ + gen_conversion (ax, value2->type, target); + + /* Deal with value1, not on the top of the stack. Don't + generate the `swap' instructions if we're not actually going + to do anything. */ + if (is_nontrivial_conversion (value1->type, target)) + { + ax_simple (ax, aop_swap); + gen_conversion (ax, value1->type, target); + ax_simple (ax, aop_swap); + } + + value1->type = value2->type = target; + } +} + + +/* Generate code to perform the integral promotions (ANSI 6.2.1.1) on + the value on the top of the stack, as described by VALUE. Assume + the value has integral type. */ +static void +gen_integral_promotions (ax, value) + struct agent_expr *ax; + struct axs_value *value; +{ + if (! type_wider_than (value->type, builtin_type_int)) + { + gen_conversion (ax, value->type, builtin_type_int); + value->type = builtin_type_int; + } + else if (! type_wider_than (value->type, builtin_type_unsigned_int)) + { + gen_conversion (ax, value->type, builtin_type_unsigned_int); + value->type = builtin_type_unsigned_int; + } +} + + +/* Generate code for a cast to TYPE. */ +static void +gen_cast (ax, value, type) + struct agent_expr *ax; + struct axs_value *value; + struct type *type; +{ + /* GCC does allow casts to yield lvalues, so this should be fixed + before merging these changes into the trunk. */ + require_rvalue (ax, value); + /* Dereference typedefs. */ + type = check_typedef (type); + + switch (type->code) + { + case TYPE_CODE_PTR: + /* It's implementation-defined, and I'll bet this is what GCC + does. */ + break; + + case TYPE_CODE_ARRAY: + case TYPE_CODE_STRUCT: + case TYPE_CODE_UNION: + case TYPE_CODE_FUNC: + error ("Illegal type cast: intended type must be scalar."); + + case TYPE_CODE_ENUM: + /* We don't have to worry about the size of the value, because + all our integral values are fully sign-extended, and when + casting pointers we can do anything we like. Is there any + way for us to actually know what GCC actually does with a + cast like this? */ + value->type = type; + break; + + case TYPE_CODE_INT: + gen_conversion (ax, value->type, type); + break; + + case TYPE_CODE_VOID: + /* We could pop the value, and rely on everyone else to check + the type and notice that this value doesn't occupy a stack + slot. But for now, leave the value on the stack, and + preserve the "value == stack element" assumption. */ + break; + + default: + error ("Casts to requested type are not yet implemented."); + } + + value->type = type; +} + + + +/* Generating bytecode from GDB expressions: arithmetic */ + +/* Scale the integer on the top of the stack by the size of the target + of the pointer type TYPE. */ +static void +gen_scale (ax, op, type) + struct agent_expr *ax; + enum agent_op op; + struct type *type; +{ + struct type *element = TYPE_TARGET_TYPE (type); + + if (element->length != 1) + { + ax_const_l (ax, element->length); + ax_simple (ax, op); + } +} + + +/* Generate code for an addition; non-trivial because we deal with + pointer arithmetic. We set VALUE to describe the result value; we + assume VALUE1 and VALUE2 describe the two operands, and that + they've undergone the usual binary conversions. Used by both + BINOP_ADD and BINOP_SUBSCRIPT. NAME is used in error messages. */ +static void +gen_add (ax, value, value1, value2, name) + struct agent_expr *ax; + struct axs_value *value, *value1, *value2; + char *name; +{ + /* Is it INT+PTR? */ + if (value1->type->code == TYPE_CODE_INT + && value2->type->code == TYPE_CODE_PTR) + { + /* Swap the values and proceed normally. */ + ax_simple (ax, aop_swap); + gen_scale (ax, aop_mul, value2->type); + ax_simple (ax, aop_add); + gen_extend (ax, value2->type); /* Catch overflow. */ + value->type = value2->type; + } + + /* Is it PTR+INT? */ + else if (value1->type->code == TYPE_CODE_PTR + && value2->type->code == TYPE_CODE_INT) + { + gen_scale (ax, aop_mul, value1->type); + ax_simple (ax, aop_add); + gen_extend (ax, value1->type); /* Catch overflow. */ + value->type = value1->type; + } + + /* Must be number + number; the usual binary conversions will have + brought them both to the same width. */ + else if (value1->type->code == TYPE_CODE_INT + && value2->type->code == TYPE_CODE_INT) + { + ax_simple (ax, aop_add); + gen_extend (ax, value1->type); /* Catch overflow. */ + value->type = value1->type; + } + + else + error ("Illegal combination of types in %s.", name); + + value->kind = axs_rvalue; +} + + +/* Generate code for an addition; non-trivial because we have to deal + with pointer arithmetic. We set VALUE to describe the result + value; we assume VALUE1 and VALUE2 describe the two operands, and + that they've undergone the usual binary conversions. */ +static void +gen_sub (ax, value, value1, value2) + struct agent_expr *ax; + struct axs_value *value, *value1, *value2; +{ + struct type *element; + + if (value1->type->code == TYPE_CODE_PTR) + { + /* Is it PTR - INT? */ + if (value2->type->code == TYPE_CODE_INT) + { + gen_scale (ax, aop_mul, value1->type); + ax_simple (ax, aop_sub); + gen_extend (ax, value1->type); /* Catch overflow. */ + value->type = value1->type; + } + + /* Is it PTR - PTR? Strictly speaking, the types ought to + match, but this is what the normal GDB expression evaluator + tests for. */ + else if (value2->type->code == TYPE_CODE_PTR + && (TYPE_LENGTH (TYPE_TARGET_TYPE (value1->type)) + == TYPE_LENGTH (TYPE_TARGET_TYPE (value2->type)))) + { + ax_simple (ax, aop_sub); + gen_scale (ax, aop_div_unsigned, value1->type); + value->type = builtin_type_long; /* FIXME --- should be ptrdiff_t */ + } + else + error ("\ +First argument of `-' is a pointer, but second argument is neither\n\ +an integer nor a pointer of the same type."); + } + + /* Must be number + number. */ + else if (value1->type->code == TYPE_CODE_INT + && value2->type->code == TYPE_CODE_INT) + { + ax_simple (ax, aop_sub); + gen_extend (ax, value1->type); /* Catch overflow. */ + value->type = value1->type; + } + + else + error ("Illegal combination of types in subtraction."); + + value->kind = axs_rvalue; +} + +/* Generate code for a binary operator that doesn't do pointer magic. + We set VALUE to describe the result value; we assume VALUE1 and + VALUE2 describe the two operands, and that they've undergone the + usual binary conversions. MAY_CARRY should be non-zero iff the + result needs to be extended. NAME is the English name of the + operator, used in error messages */ +static void +gen_binop (ax, value, value1, value2, op, op_unsigned, may_carry, name) + struct agent_expr *ax; + struct axs_value *value, *value1, *value2; + enum agent_op op, op_unsigned; + int may_carry; + char *name; +{ + /* We only handle INT op INT. */ + if ((value1->type->code != TYPE_CODE_INT) + || (value2->type->code != TYPE_CODE_INT)) + error ("Illegal combination of types in %s.", name); + + ax_simple (ax, + TYPE_UNSIGNED (value1->type) ? op_unsigned : op); + if (may_carry) + gen_extend (ax, value1->type); /* catch overflow */ + value->type = value1->type; + value->kind = axs_rvalue; +} + + +static void +gen_logical_not (ax, value) + struct agent_expr *ax; + struct axs_value *value; +{ + if (TYPE_CODE (value->type) != TYPE_CODE_INT + && TYPE_CODE (value->type) != TYPE_CODE_PTR) + error ("Illegal type of operand to `!'."); + + gen_usual_unary (ax, value); + ax_simple (ax, aop_log_not); + value->type = builtin_type_int; +} + + +static void +gen_complement (ax, value) + struct agent_expr *ax; + struct axs_value *value; +{ + if (TYPE_CODE (value->type) != TYPE_CODE_INT) + error ("Illegal type of operand to `~'."); + + gen_usual_unary (ax, value); + gen_integral_promotions (ax, value); + ax_simple (ax, aop_bit_not); + gen_extend (ax, value->type); +} + + + +/* Generating bytecode from GDB expressions: * & . -> @ sizeof */ + +/* Dereference the value on the top of the stack. */ +static void +gen_deref (ax, value) + struct agent_expr *ax; + struct axs_value *value; +{ + /* The caller should check the type, because several operators use + this, and we don't know what error message to generate. */ + if (value->type->code != TYPE_CODE_PTR) + error ("GDB bug: ax-gdb.c (gen_deref): expected a pointer"); + + /* We've got an rvalue now, which is a pointer. We want to yield an + lvalue, whose address is exactly that pointer. So we don't + actually emit any code; we just change the type from "Pointer to + T" to "T", and mark the value as an lvalue in memory. Leave it + to the consumer to actually dereference it. */ + value->type = check_typedef (TYPE_TARGET_TYPE (value->type)); + value->kind = ((value->type->code == TYPE_CODE_FUNC) + ? axs_rvalue : axs_lvalue_memory); +} + + +/* Produce the address of the lvalue on the top of the stack. */ +static void +gen_address_of (ax, value) + struct agent_expr *ax; + struct axs_value *value; +{ + /* Special case for taking the address of a function. The ANSI + standard describes this as a special case, too, so this + arrangement is not without motivation. */ + if (value->type->code == TYPE_CODE_FUNC) + /* The value's already an rvalue on the stack, so we just need to + change the type. */ + value->type = lookup_pointer_type (value->type); + else + switch (value->kind) + { + case axs_rvalue: + error ("Operand of `&' is an rvalue, which has no address."); + + case axs_lvalue_register: + error ("Operand of `&' is in a register, and has no address."); + + case axs_lvalue_memory: + value->kind = axs_rvalue; + value->type = lookup_pointer_type (value->type); + break; + } +} + + +/* A lot of this stuff will have to change to support C++. But we're + not going to deal with that at the moment. */ + +/* Find the field in the structure type TYPE named NAME, and return + its index in TYPE's field array. */ +static int +find_field (type, name) + struct type *type; + char *name; +{ + int i; + + CHECK_TYPEDEF (type); + + /* Make sure this isn't C++. */ + if (TYPE_N_BASECLASSES (type) != 0) + error ("GDB bug: ax-gdb.c (find_field): derived classes supported"); + + for (i = 0; i < TYPE_NFIELDS (type); i++) + { + char *this_name = TYPE_FIELD_NAME (type, i); + + if (this_name && STREQ (name, this_name)) + return i; + + if (this_name[0] == '\0') + error ("GDB bug: ax-gdb.c (find_field): anonymous unions not supported"); + } + + error ("Couldn't find member named `%s' in struct/union `%s'", + name, type->tag_name); + + return 0; +} + + +/* Generate code to push the value of a bitfield of a structure whose + address is on the top of the stack. START and END give the + starting and one-past-ending *bit* numbers of the field within the + structure. */ +static void +gen_bitfield_ref (ax, value, type, start, end) + struct agent_expr *ax; + struct axs_value *value; + struct type *type; + int start, end; +{ + /* Note that ops[i] fetches 8 << i bits. */ + static enum agent_op ops[] + = { aop_ref8, aop_ref16, aop_ref32, aop_ref64 }; + static int num_ops = (sizeof (ops) / sizeof (ops[0])); + + /* We don't want to touch any byte that the bitfield doesn't + actually occupy; we shouldn't make any accesses we're not + explicitly permitted to. We rely here on the fact that the + bytecode `ref' operators work on unaligned addresses. + + It takes some fancy footwork to get the stack to work the way + we'd like. Say we're retrieving a bitfield that requires three + fetches. Initially, the stack just contains the address: + addr + For the first fetch, we duplicate the address + addr addr + then add the byte offset, do the fetch, and shift and mask as + needed, yielding a fragment of the value, properly aligned for + the final bitwise or: + addr frag1 + then we swap, and repeat the process: + frag1 addr --- address on top + frag1 addr addr --- duplicate it + frag1 addr frag2 --- get second fragment + frag1 frag2 addr --- swap again + frag1 frag2 frag3 --- get third fragment + Notice that, since the third fragment is the last one, we don't + bother duplicating the address this time. Now we have all the + fragments on the stack, and we can simply `or' them together, + yielding the final value of the bitfield. */ + + /* The first and one-after-last bits in the field, but rounded down + and up to byte boundaries. */ + int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; + int bound_end = (((end + TARGET_CHAR_BIT - 1) + / TARGET_CHAR_BIT) + * TARGET_CHAR_BIT); + + /* current bit offset within the structure */ + int offset; + + /* The index in ops of the opcode we're considering. */ + int op; + + /* The number of fragments we generated in the process. Probably + equal to the number of `one' bits in bytesize, but who cares? */ + int fragment_count; + + /* Dereference any typedefs. */ + type = check_typedef (type); + + /* Can we fetch the number of bits requested at all? */ + if ((end - start) > ((1 << num_ops) * 8)) + error ("GDB bug: ax-gdb.c (gen_bitfield_ref): bitfield too wide"); + + /* Note that we know here that we only need to try each opcode once. + That may not be true on machines with weird byte sizes. */ + offset = bound_start; + fragment_count = 0; + for (op = num_ops - 1; op >= 0; op--) + { + /* number of bits that ops[op] would fetch */ + int op_size = 8 << op; + + /* The stack at this point, from bottom to top, contains zero or + more fragments, then the address. */ + + /* Does this fetch fit within the bitfield? */ + if (offset + op_size <= bound_end) + { + /* Is this the last fragment? */ + int last_frag = (offset + op_size == bound_end); + + if (! last_frag) + ax_simple (ax, aop_dup); /* keep a copy of the address */ + + /* Add the offset. */ + gen_offset (ax, offset / TARGET_CHAR_BIT); + + if (trace_kludge) + { + /* Record the area of memory we're about to fetch. */ + ax_trace_quick (ax, op_size / TARGET_CHAR_BIT); + } + + /* Perform the fetch. */ + ax_simple (ax, ops[op]); + + /* Shift the bits we have to their proper position. + gen_left_shift will generate right shifts when the operand + is negative. + + A big-endian field diagram to ponder: + byte 0 byte 1 byte 2 byte 3 byte 4 byte 5 byte 6 byte 7 + +------++------++------++------++------++------++------++------+ + xxxxAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBCCCCCxxxxxxxxxxx + ^ ^ ^ ^ + bit number 16 32 48 53 + These are bit numbers as supplied by GDB. Note that the + bit numbers run from right to left once you've fetched the + value! + + A little-endian field diagram to ponder: + byte 7 byte 6 byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 + +------++------++------++------++------++------++------++------+ + xxxxxxxxxxxAAAAABBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCxxxx + ^ ^ ^ ^ ^ + bit number 48 32 16 4 0 + + In both cases, the most significant end is on the left + (i.e. normal numeric writing order), which means that you + don't go crazy thinking about `left' and `right' shifts. + + We don't have to worry about masking yet: + - If they contain garbage off the least significant end, then we + must be looking at the low end of the field, and the right + shift will wipe them out. + - If they contain garbage off the most significant end, then we + must be looking at the most significant end of the word, and + the sign/zero extension will wipe them out. + - If we're in the interior of the word, then there is no garbage + on either end, because the ref operators zero-extend. */ + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + gen_left_shift (ax, end - (offset + op_size)); + else + gen_left_shift (ax, offset - start); + + if (! last_frag) + /* Bring the copy of the address up to the top. */ + ax_simple (ax, aop_swap); + + offset += op_size; + fragment_count++; + } + } + + /* Generate enough bitwise `or' operations to combine all the + fragments we left on the stack. */ + while (fragment_count-- > 1) + ax_simple (ax, aop_bit_or); + + /* Sign- or zero-extend the value as appropriate. */ + ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, end - start)); + + /* This is *not* an lvalue. Ugh. */ + value->kind = axs_rvalue; + value->type = type; +} + + +/* Generate code to reference the member named FIELD of a structure or + union. The top of the stack, as described by VALUE, should have + type (pointer to a)* struct/union. OPERATOR_NAME is the name of + the operator being compiled, and OPERAND_NAME is the kind of thing + it operates on; we use them in error messages. */ +static void +gen_struct_ref (ax, value, field, operator_name, operand_name) + struct agent_expr *ax; + struct axs_value *value; + char *field; + char *operator_name; + char *operand_name; +{ + struct type *type; + int i; + + /* Follow pointers until we reach a non-pointer. These aren't the C + semantics, but they're what the normal GDB evaluator does, so we + should at least be consistent. */ + while (value->type->code == TYPE_CODE_PTR) + { + gen_usual_unary (ax, value); + gen_deref (ax, value); + } + type = value->type; + + /* This must yield a structure or a union. */ + if (TYPE_CODE (type) != TYPE_CODE_STRUCT + && TYPE_CODE (type) != TYPE_CODE_UNION) + error ("The left operand of `%s' is not a %s.", + operator_name, operand_name); + + /* And it must be in memory; we don't deal with structure rvalues, + or structures living in registers. */ + if (value->kind != axs_lvalue_memory) + error ("Structure does not live in memory."); + + i = find_field (type, field); + + /* Is this a bitfield? */ + if (TYPE_FIELD_PACKED (type, i)) + gen_bitfield_ref (ax, value, TYPE_FIELD_TYPE (type, i), + TYPE_FIELD_BITPOS (type, i), + (TYPE_FIELD_BITPOS (type, i) + + TYPE_FIELD_BITSIZE (type, i))); + else + { + gen_offset (ax, TYPE_FIELD_BITPOS (type, i) / TARGET_CHAR_BIT); + value->kind = axs_lvalue_memory; + value->type = TYPE_FIELD_TYPE (type, i); + } +} + + +/* Generate code for GDB's magical `repeat' operator. + LVALUE @ INT creates an array INT elements long, and whose elements + have the same type as LVALUE, located in memory so that LVALUE is + its first element. For example, argv[0]@argc gives you the array + of command-line arguments. + + Unfortunately, because we have to know the types before we actually + have a value for the expression, we can't implement this perfectly + without changing the type system, having values that occupy two + stack slots, doing weird things with sizeof, etc. So we require + the right operand to be a constant expression. */ +static void +gen_repeat (pc, ax, value) + union exp_element **pc; + struct agent_expr *ax; + struct axs_value *value; +{ + struct axs_value value1; + /* We don't want to turn this into an rvalue, so no conversions + here. */ + gen_expr (pc, ax, &value1); + if (value1.kind != axs_lvalue_memory) + error ("Left operand of `@' must be an object in memory."); + + /* Evaluate the length; it had better be a constant. */ + { + struct value *v = const_expr (pc); + int length; + + if (! v) + error ("Right operand of `@' must be a constant, in agent expressions."); + if (v->type->code != TYPE_CODE_INT) + error ("Right operand of `@' must be an integer."); + length = value_as_long (v); + if (length <= 0) + error ("Right operand of `@' must be positive."); + + /* The top of the stack is already the address of the object, so + all we need to do is frob the type of the lvalue. */ + { + /* FIXME-type-allocation: need a way to free this type when we are + done with it. */ + struct type *range + = create_range_type (0, builtin_type_int, 0, length - 1); + struct type *array = create_array_type (0, value1.type, range); + + value->kind = axs_lvalue_memory; + value->type = array; + } + } +} + + +/* Emit code for the `sizeof' operator. + *PC should point at the start of the operand expression; we advance it + to the first instruction after the operand. */ +static void +gen_sizeof (pc, ax, value) + union exp_element **pc; + struct agent_expr *ax; + struct axs_value *value; +{ + /* We don't care about the value of the operand expression; we only + care about its type. However, in the current arrangement, the + only way to find an expression's type is to generate code for it. + So we generate code for the operand, and then throw it away, + replacing it with code that simply pushes its size. */ + int start = ax->len; + gen_expr (pc, ax, value); + + /* Throw away the code we just generated. */ + ax->len = start; + + ax_const_l (ax, TYPE_LENGTH (value->type)); + value->kind = axs_rvalue; + value->type = builtin_type_int; +} + + +/* Generating bytecode from GDB expressions: general recursive thingy */ + +/* A gen_expr function written by a Gen-X'er guy. + Append code for the subexpression of EXPR starting at *POS_P to AX. */ +static void +gen_expr (pc, ax, value) + union exp_element **pc; + struct agent_expr *ax; + struct axs_value *value; +{ + /* Used to hold the descriptions of operand expressions. */ + struct axs_value value1, value2; + enum exp_opcode op = (*pc)[0].opcode; + + /* If we're looking at a constant expression, just push its value. */ + { + struct value *v = maybe_const_expr (pc); + + if (v) + { + ax_const_l (ax, value_as_long (v)); + value->kind = axs_rvalue; + value->type = check_typedef (VALUE_TYPE (v)); + return; + } + } + + /* Otherwise, go ahead and generate code for it. */ + switch (op) + { + /* Binary arithmetic operators. */ + case BINOP_ADD: + case BINOP_SUB: + case BINOP_MUL: + case BINOP_DIV: + case BINOP_REM: + case BINOP_SUBSCRIPT: + case BINOP_BITWISE_AND: + case BINOP_BITWISE_IOR: + case BINOP_BITWISE_XOR: + (*pc)++; + gen_expr (pc, ax, &value1); + gen_usual_unary (ax, &value1); + gen_expr (pc, ax, &value2); + gen_usual_unary (ax, &value2); + gen_usual_arithmetic (ax, &value1, &value2); + switch (op) + { + case BINOP_ADD: + gen_add (ax, value, &value1, &value2, "addition"); + break; + case BINOP_SUB: + gen_sub (ax, value, &value1, &value2); + break; + case BINOP_MUL: + gen_binop (ax, value, &value1, &value2, + aop_mul, aop_mul, 1, "multiplication"); + break; + case BINOP_DIV: + gen_binop (ax, value, &value1, &value2, + aop_div_signed, aop_div_unsigned, 1, "division"); + break; + case BINOP_REM: + gen_binop (ax, value, &value1, &value2, + aop_rem_signed, aop_rem_unsigned, 1, "remainder"); + break; + case BINOP_SUBSCRIPT: + gen_add (ax, value, &value1, &value2, "array subscripting"); + if (TYPE_CODE (value->type) != TYPE_CODE_PTR) + error ("Illegal combination of types in array subscripting."); + gen_deref (ax, value); + break; + case BINOP_BITWISE_AND: + gen_binop (ax, value, &value1, &value2, + aop_bit_and, aop_bit_and, 0, "bitwise and"); + break; + + case BINOP_BITWISE_IOR: + gen_binop (ax, value, &value1, &value2, + aop_bit_or, aop_bit_or, 0, "bitwise or"); + break; + + case BINOP_BITWISE_XOR: + gen_binop (ax, value, &value1, &value2, + aop_bit_xor, aop_bit_xor, 0, "bitwise exclusive-or"); + break; + + default: + /* We should only list operators in the outer case statement + that we actually handle in the inner case statement. */ + error ("GDB bug: ax-gdb.c (gen_expr): op case sets don't match"); + } + break; + + /* Note that we need to be a little subtle about generating code + for comma. In C, we can do some optimizations here because + we know the left operand is only being evaluated for effect. + However, if the tracing kludge is in effect, then we always + need to evaluate the left hand side fully, so that all the + variables it mentions get traced. */ + case BINOP_COMMA: + (*pc)++; + gen_expr (pc, ax, &value1); + /* Don't just dispose of the left operand. We might be tracing, + in which case we want to emit code to trace it if it's an + lvalue. */ + gen_traced_pop (ax, &value1); + gen_expr (pc, ax, value); + /* It's the consumer's responsibility to trace the right operand. */ + break; + + case OP_LONG: /* some integer constant */ + { + struct type *type = (*pc)[1].type; + LONGEST k = (*pc)[2].longconst; + (*pc) += 4; + gen_int_literal (ax, value, k, type); + } + break; + + case OP_VAR_VALUE: + gen_var_ref (ax, value, (*pc)[2].symbol); + (*pc) += 4; + break; + + case OP_REGISTER: + { + int reg = (int) (*pc)[1].longconst; + (*pc) += 3; + value->kind = axs_lvalue_register; + value->u.reg = reg; + value->type = REGISTER_VIRTUAL_TYPE (reg); + } + break; + + case OP_INTERNALVAR: + error ("GDB agent expressions cannot use convenience variables."); + + /* Weirdo operator: see comments for gen_repeat for details. */ + case BINOP_REPEAT: + /* Note that gen_repeat handles its own argument evaluation. */ + (*pc)++; + gen_repeat (pc, ax, value); + break; + + case UNOP_CAST: + { + struct type *type = (*pc)[1].type; + (*pc) += 3; + gen_expr (pc, ax, value); + gen_cast (ax, value, type); + } + break; + + case UNOP_MEMVAL: + { + struct type *type = check_typedef ((*pc)[1].type); + (*pc) += 3; + gen_expr (pc, ax, value); + /* I'm not sure I understand UNOP_MEMVAL entirely. I think + it's just a hack for dealing with minsyms; you take some + integer constant, pretend it's the address of an lvalue of + the given type, and dereference it. */ + if (value->kind != axs_rvalue) + /* This would be weird. */ + error ("GDB bug: ax-gdb.c (gen_expr): OP_MEMVAL operand isn't an rvalue???"); + value->type = type; + value->kind = axs_lvalue_memory; + } + break; + + case UNOP_NEG: + (*pc)++; + /* -FOO is equivalent to 0 - FOO. */ + gen_int_literal (ax, &value1, (LONGEST) 0, builtin_type_int); + gen_usual_unary (ax, &value1); /* shouldn't do much */ + gen_expr (pc, ax, &value2); + gen_usual_unary (ax, &value2); + gen_usual_arithmetic (ax, &value1, &value2); + gen_sub (ax, value, &value1, &value2); + break; + + case UNOP_LOGICAL_NOT: + (*pc)++; + gen_expr (pc, ax, value); + gen_logical_not (ax, value); + break; + + case UNOP_COMPLEMENT: + (*pc)++; + gen_expr (pc, ax, value); + gen_complement (ax, value); + break; + + case UNOP_IND: + (*pc)++; + gen_expr (pc, ax, value); + gen_usual_unary (ax, value); + if (TYPE_CODE (value->type) != TYPE_CODE_PTR) + error ("Argument of unary `*' is not a pointer."); + gen_deref (ax, value); + break; + + case UNOP_ADDR: + (*pc)++; + gen_expr (pc, ax, value); + gen_address_of (ax, value); + break; + + case UNOP_SIZEOF: + (*pc)++; + /* Notice that gen_sizeof handles its own operand, unlike most + of the other unary operator functions. This is because we + have to throw away the code we generate. */ + gen_sizeof (pc, ax, value); + break; + + case STRUCTOP_STRUCT: + case STRUCTOP_PTR: + { + int length = (*pc)[1].longconst; + char *name = &(*pc)[2].string; + + (*pc) += 4 + BYTES_TO_EXP_ELEM (length + 1); + gen_expr (pc, ax, value); + if (op == STRUCTOP_STRUCT) + gen_struct_ref (ax, value, name, ".", "structure or union"); + else if (op == STRUCTOP_PTR) + gen_struct_ref (ax, value, name, "->", + "pointer to a structure or union"); + else + /* If this `if' chain doesn't handle it, then the case list + shouldn't mention it, and we shouldn't be here. */ + error ("GDB bug: ax-gdb.c (gen_expr): unhandled struct case"); + } + break; + + case OP_TYPE: + error ("Attempt to use a type name as an expression."); + + default: + error ("Unsupported operator in expression."); + } +} + + + +#if 0 /* not used */ +/* Generating bytecode from GDB expressions: driver */ + +/* Given a GDB expression EXPR, produce a string of agent bytecode + which computes its value. Return the agent expression, and set + *VALUE to describe its type, and whether it's an lvalue or rvalue. */ +struct agent_expr * +expr_to_agent (expr, value) + struct expression *expr; + struct axs_value *value; +{ + struct cleanup *old_chain = 0; + struct agent_expr *ax = new_agent_expr (); + union exp_element *pc; + + old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax); + + pc = expr->elts; + trace_kludge = 0; + gen_expr (&pc, ax, value); + + /* We have successfully built the agent expr, so cancel the cleanup + request. If we add more cleanups that we always want done, this + will have to get more complicated. */ + discard_cleanups (old_chain); + return ax; +} + + +/* Given a GDB expression EXPR denoting an lvalue in memory, produce a + string of agent bytecode which will leave its address and size on + the top of stack. Return the agent expression. + + Not sure this function is useful at all. */ +struct agent_expr * +expr_to_address_and_size (expr) + struct expression *expr; +{ + struct axs_value value; + struct agent_expr *ax = expr_to_agent (expr, &value); + + /* Complain if the result is not a memory lvalue. */ + if (value.kind != axs_lvalue_memory) + { + free_agent_expr (ax); + error ("Expression does not denote an object in memory."); + } + + /* Push the object's size on the stack. */ + ax_const_l (ax, TYPE_LENGTH (value.type)); + + return ax; +} +#endif /* 0 */ + +/* Given a GDB expression EXPR, return bytecode to trace its value. + The result will use the `trace' and `trace_quick' bytecodes to + record the value of all memory touched by the expression. The + caller can then use the ax_reqs function to discover which + registers it relies upon. */ +struct agent_expr * +gen_trace_for_expr (scope, expr) + CORE_ADDR scope; + struct expression *expr; +{ + struct cleanup *old_chain = 0; + struct agent_expr *ax = new_agent_expr (scope); + union exp_element *pc; + struct axs_value value; + + old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax); + + pc = expr->elts; + trace_kludge = 1; + gen_expr (&pc, ax, &value); + + /* Make sure we record the final object, and get rid of it. */ + gen_traced_pop (ax, &value); + + /* Oh, and terminate. */ + ax_simple (ax, aop_end); + + /* We have successfully built the agent expr, so cancel the cleanup + request. If we add more cleanups that we always want done, this + will have to get more complicated. */ + discard_cleanups (old_chain); + return ax; +} + + + +/* The "agent" command, for testing: compile and disassemble an expression. */ + +static void +print_axs_value (f, value) + GDB_FILE *f; + struct axs_value *value; +{ + switch (value->kind) + { + case axs_rvalue: + fputs_filtered ("rvalue", f); + break; + + case axs_lvalue_memory: + fputs_filtered ("memory lvalue", f); + break; + + case axs_lvalue_register: + fprintf_filtered (f, "register %d lvalue", value->u.reg); + break; + } + + fputs_filtered (" : ", f); + type_print (value->type, "", f, -1); +} + + +static void +agent_command (exp, from_tty) + char *exp; + int from_tty; +{ + struct cleanup *old_chain = 0; + struct expression *expr; + struct agent_expr *agent; + struct agent_reqs reqs; + struct frame_info *fi = get_current_frame (); /* need current scope */ + + /* We don't deal with overlay debugging at the moment. We need to + think more carefully about this. If you copy this code into + another command, change the error message; the user shouldn't + have to know anything about agent expressions. */ + if (overlay_debugging) + error ("GDB can't do agent expression translation with overlays."); + + if (exp == 0) + error_no_arg ("expression to translate"); + + expr = parse_expression (exp); + old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr); + agent = gen_trace_for_expr (fi->pc, expr); + make_cleanup ((make_cleanup_func) free_agent_expr, agent); + ax_print (gdb_stdout, agent); + ax_reqs (agent, &reqs); + + do_cleanups (old_chain); + dont_repeat (); +} + + +/* Initialization code. */ + +void _initialize_ax_gdb PARAMS ((void)); +void +_initialize_ax_gdb () +{ + struct cmd_list_element *c; + + add_cmd ("agent", class_maintenance, agent_command, + "Translate an expression into remote agent bytecode.", + &maintenancelist); +} diff --git a/contrib/gdb/gdb/ax-gdb.h b/contrib/gdb/gdb/ax-gdb.h new file mode 100644 index 0000000..575b4bf --- /dev/null +++ b/contrib/gdb/gdb/ax-gdb.h @@ -0,0 +1,111 @@ +/* GDB-specific functions for operating on agent expressions + Copyright 1998 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. */ + +/* $Id: ax-gdb.h,v 1.3.20.1 1999/04/01 17:33:04 jimb Exp $ */ + +#ifndef AX_GDB_H +#define AX_GDB_H + + +/* Types and enums */ + +/* GDB stores expressions in the form of a flattened tree (struct + expression), so we just walk that tree and generate agent bytecodes + as we go along. + + GDB's normal evaluation uses struct value, which contains the + expression's value as well as its address or the register it came + from. The `+' operator uses the value, whereas the unary `&' + operator will use the address portion. The `=' operator will use + the address or register number of its left hand side. + + The issues are different when generating agent bytecode. Given a + variable reference expression, we should not necessarily generate + code to fetch its value, because the next operator may be `=' or + unary `&'. Instead, when we recurse on a subexpression, we + indicate whether we want that expression to produce an lvalue or an + rvalue. If we requested an lvalue, then the recursive call tells + us whether it generated code to compute an address on the stack, or + whether the lvalue lives in a register. + + The `axs' prefix here means `agent expression, static', because + this is all static analysis of the expression, i.e. analysis which + doesn't depend on the contents of memory and registers. */ + + +/* Different kinds of agent expression static values. */ +enum axs_lvalue_kind { + /* We generated code to compute the subexpression's value. + Constants and arithmetic operators yield this. */ + axs_rvalue, + + /* We generated code to yield the subexpression's value's address on + the top of the stack. If the caller needs an rvalue, it should + call require_rvalue to produce the rvalue from this address. */ + axs_lvalue_memory, + + /* We didn't generate any code, and the stack is undisturbed, + because the subexpression's value lives in a register; u.reg is + the register number. If the caller needs an rvalue, it should + call require_rvalue to produce the rvalue from this register + number. */ + axs_lvalue_register +}; + +/* Structure describing what we got from a subexpression. Think of + this as parallel to value.h's enum lval_type, except that we're + describing a value which will exist when the expression is + evaluated in the future, not a value we have in our hand. */ +struct axs_value { + enum axs_lvalue_kind kind; /* see above */ + + /* The type of the subexpression. Even if lvalue == axs_lvalue_memory, + this is the type of the value itself; the value on the stack is a + "pointer to" an object of this type. */ + struct type *type; + + union { + /* if kind == axs_lvalue_register, this is the register number */ + int reg; + } u; +}; + + +/* Translating GDB expressions into agent expressions. */ + +/* Given a GDB expression EXPR, translate it into the agent bytecode, + and return it. FLAGS are from enum expr_to_agent_flags. */ +extern struct agent_expr *expr_to_agent PARAMS ((struct expression *EXPR, + struct axs_value *VALUE)); + +/* Given a GDB expression EXPR denoting an lvalue in memory, produce a + string of agent bytecode which will leave its address and size on + the top of stack. Return the agent expression. */ +extern struct agent_expr *expr_to_address_and_size + PARAMS ((struct expression *EXPR)); + +/* Given a GDB expression EXPR, return bytecode to trace its value. + The result will use the `trace' and `trace_quick' bytecodes to + record the value of all memory touched by the expression, and leave + no values on the stack. The caller can then use the ax_reqs + function to discover which registers the expression uses. */ +extern struct agent_expr *gen_trace_for_expr PARAMS ((CORE_ADDR, + struct expression *)); + +#endif /* AX_GDB_H */ diff --git a/contrib/gdb/gdb/ax-general.c b/contrib/gdb/gdb/ax-general.c new file mode 100644 index 0000000..6f399a8 --- /dev/null +++ b/contrib/gdb/gdb/ax-general.c @@ -0,0 +1,552 @@ +/* Functions for manipulating expressions designed to be executed on the agent + Copyright 1998 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. */ + +/* $Id: ax-general.c,v 1.3 1998/12/02 23:22:58 msnyder Exp $ */ + +/* Despite what the above comment says about this file being part of + GDB, we would like to keep these functions free of GDB + dependencies, since we want to be able to use them in contexts + outside of GDB (test suites, the stub, etc.) */ + +#include "defs.h" +#include "ax.h" + + +/* Functions for building expressions. */ + +/* Allocate a new, empty agent expression. */ +struct agent_expr * +new_agent_expr (scope) + CORE_ADDR scope; +{ + struct agent_expr *x = xmalloc (sizeof (*x)); + x->len = 0; + x->size = 1; /* Change this to a larger value once + reallocation code is tested. */ + x->buf = xmalloc (x->size); + x->scope = scope; + + return x; +} + +/* Free a agent expression. */ +void +free_agent_expr (x) + struct agent_expr *x; +{ + free (x->buf); + free (x); +} + + +/* Make sure that X has room for at least N more bytes. This doesn't + affect the length, just the allocated size. */ +static void +grow_expr (x, n) + struct agent_expr *x; + int n; +{ + if (x->len + n > x->size) + { + x->size *= 2; + if (x->size < x->len + n) + x->size = x->len + n + 10; + x->buf = xrealloc (x->buf, x->size); + } +} + + +/* Append the low N bytes of VAL as an N-byte integer to the + expression X, in big-endian order. */ +static void +append_const (x, val, n) + struct agent_expr *x; + LONGEST val; + int n; +{ + int i; + + grow_expr (x, n); + for (i = n - 1; i >= 0; i--) + { + x->buf[x->len + i] = val & 0xff; + val >>= 8; + } + x->len += n; +} + + +/* Extract an N-byte big-endian unsigned integer from expression X at + offset O. */ +static LONGEST +read_const (x, o, n) + struct agent_expr *x; + int o, n; +{ + int i; + LONGEST accum = 0; + + /* Make sure we're not reading off the end of the expression. */ + if (o + n > x->len) + error ("GDB bug: ax-general.c (read_const): incomplete constant"); + + for (i = 0; i < n; i++) + accum = (accum << 8) | x->buf[o + i]; + + return accum; +} + + +/* Append a simple operator OP to EXPR. */ +void +ax_simple (x, op) + struct agent_expr *x; + enum agent_op op; +{ + grow_expr (x, 1); + x->buf[x->len++] = op; +} + + +/* Append a sign-extension or zero-extension instruction to EXPR, to + extend an N-bit value. */ +static void +generic_ext (x, op, n) + struct agent_expr *x; + enum agent_op op; + int n; +{ + /* N must fit in a byte. */ + if (n < 0 || n > 255) + error ("GDB bug: ax-general.c (generic_ext): bit count out of range"); + /* That had better be enough range. */ + if (sizeof (LONGEST) * 8 > 255) + error ("GDB bug: ax-general.c (generic_ext): opcode has inadequate range"); + + grow_expr (x, 2); + x->buf[x->len++] = op; + x->buf[x->len++] = n; +} + + +/* Append a sign-extension instruction to EXPR, to extend an N-bit value. */ +void +ax_ext (x, n) + struct agent_expr *x; + int n; +{ + generic_ext (x, aop_ext, n); +} + + +/* Append a zero-extension instruction to EXPR, to extend an N-bit value. */ +void +ax_zero_ext (x, n) + struct agent_expr *x; + int n; +{ + generic_ext (x, aop_zero_ext, n); +} + + +/* Append a trace_quick instruction to EXPR, to record N bytes. */ +void +ax_trace_quick (x, n) + struct agent_expr *x; + int n; +{ + /* N must fit in a byte. */ + if (n < 0 || n > 255) + error ("GDB bug: ax-general.c (ax_trace_quick): size out of range for trace_quick"); + + grow_expr (x, 2); + x->buf[x->len++] = aop_trace_quick; + x->buf[x->len++] = n; +} + + +/* Append a goto op to EXPR. OP is the actual op (must be aop_goto or + aop_if_goto). We assume we don't know the target offset yet, + because it's probably a forward branch, so we leave space in EXPR + for the target, and return the offset in EXPR of that space, so we + can backpatch it once we do know the target offset. Use ax_label + to do the backpatching. */ +int ax_goto (x, op) + struct agent_expr *x; + enum agent_op op; +{ + grow_expr (x, 3); + x->buf[x->len + 0] = op; + x->buf[x->len + 1] = 0xff; + x->buf[x->len + 2] = 0xff; + x->len += 3; + return x->len - 2; +} + +/* Suppose a given call to ax_goto returns some value PATCH. When you + know the offset TARGET that goto should jump to, call + ax_label (EXPR, PATCH, TARGET) + to patch TARGET into the ax_goto instruction. */ +void +ax_label (x, patch, target) + struct agent_expr *x; + int patch; + int target; +{ + /* Make sure the value is in range. Don't accept 0xffff as an + offset; that's our magic sentinel value for unpatched branches. */ + if (target < 0 || target >= 0xffff) + error ("GDB bug: ax-general.c (ax_label): label target out of range"); + + x->buf[patch] = (target >> 8) & 0xff; + x->buf[patch + 1] = target & 0xff; +} + + +/* Assemble code to push a constant on the stack. */ +void +ax_const_l (x, l) + struct agent_expr *x; + LONGEST l; +{ + static enum agent_op ops[] + = { aop_const8, aop_const16, aop_const32, aop_const64 }; + int size; + int op; + + /* How big is the number? 'op' keeps track of which opcode to use. + Notice that we don't really care whether the original number was + signed or unsigned; we always reproduce the value exactly, and + use the shortest representation. */ + for (op = 0, size = 8; size < 64; size *= 2, op++) + if (-((LONGEST) 1 << size) <= l && l < ((LONGEST) 1 << size)) + break; + + /* Emit the right opcode... */ + ax_simple (x, ops[op]); + + /* Emit the low SIZE bytes as an unsigned number. We know that + sign-extending this will yield l. */ + append_const (x, l, size / 8); + + /* Now, if it was negative, and not full-sized, sign-extend it. */ + if (l < 0 && size < 64) + ax_ext (x, size); +} + + +void +ax_const_d (x, d) + struct agent_expr *x; + LONGEST d; +{ + /* FIXME: floating-point support not present yet. */ + error ("GDB bug: ax-general.c (ax_const_d): floating point not supported yet"); +} + + +/* Assemble code to push the value of register number REG on the + stack. */ +void ax_reg (x, reg) + struct agent_expr *x; + int reg; +{ + /* Make sure the register number is in range. */ + if (reg < 0 || reg > 0xffff) + error ("GDB bug: ax-general.c (ax_reg): register number out of range"); + grow_expr (x, 3); + x->buf[x->len ] = aop_reg; + x->buf[x->len + 1] = (reg >> 8) & 0xff; + x->buf[x->len + 2] = (reg ) & 0xff; + x->len += 3; +} + + + +/* Functions for disassembling agent expressions, and otherwise + debugging the expression compiler. */ + +struct aop_map aop_map[] = { + { 0, 0, 0, 0, 0 }, + { "float", 0, 0, 0, 0 }, /* 0x01 */ + { "add", 0, 0, 2, 1 }, /* 0x02 */ + { "sub", 0, 0, 2, 1 }, /* 0x03 */ + { "mul", 0, 0, 2, 1 }, /* 0x04 */ + { "div_signed", 0, 0, 2, 1 }, /* 0x05 */ + { "div_unsigned", 0, 0, 2, 1 }, /* 0x06 */ + { "rem_signed", 0, 0, 2, 1 }, /* 0x07 */ + { "rem_unsigned", 0, 0, 2, 1 }, /* 0x08 */ + { "lsh", 0, 0, 2, 1 }, /* 0x09 */ + { "rsh_signed", 0, 0, 2, 1 }, /* 0x0a */ + { "rsh_unsigned", 0, 0, 2, 1 }, /* 0x0b */ + { "trace", 0, 0, 2, 0 }, /* 0x0c */ + { "trace_quick", 1, 0, 1, 1 }, /* 0x0d */ + { "log_not", 0, 0, 1, 1 }, /* 0x0e */ + { "bit_and", 0, 0, 2, 1 }, /* 0x0f */ + { "bit_or", 0, 0, 2, 1 }, /* 0x10 */ + { "bit_xor", 0, 0, 2, 1 }, /* 0x11 */ + { "bit_not", 0, 0, 1, 1 }, /* 0x12 */ + { "equal", 0, 0, 2, 1 }, /* 0x13 */ + { "less_signed", 0, 0, 2, 1 }, /* 0x14 */ + { "less_unsigned", 0, 0, 2, 1 }, /* 0x15 */ + { "ext", 1, 0, 1, 1 }, /* 0x16 */ + { "ref8", 0, 8, 1, 1 }, /* 0x17 */ + { "ref16", 0, 16, 1, 1 }, /* 0x18 */ + { "ref32", 0, 32, 1, 1 }, /* 0x19 */ + { "ref64", 0, 64, 1, 1 }, /* 0x1a */ + { "ref_float", 0, 0, 1, 1 }, /* 0x1b */ + { "ref_double", 0, 0, 1, 1 }, /* 0x1c */ + { "ref_long_double", 0, 0, 1, 1 }, /* 0x1d */ + { "l_to_d", 0, 0, 1, 1 }, /* 0x1e */ + { "d_to_l", 0, 0, 1, 1 }, /* 0x1f */ + { "if_goto", 2, 0, 1, 0 }, /* 0x20 */ + { "goto", 2, 0, 0, 0 }, /* 0x21 */ + { "const8", 1, 8, 0, 1 }, /* 0x22 */ + { "const16", 2, 16, 0, 1 }, /* 0x23 */ + { "const32", 4, 32, 0, 1 }, /* 0x24 */ + { "const64", 8, 64, 0, 1 }, /* 0x25 */ + { "reg", 2, 0, 0, 1 }, /* 0x26 */ + { "end", 0, 0, 0, 0 }, /* 0x27 */ + { "dup", 0, 0, 1, 2 }, /* 0x28 */ + { "pop", 0, 0, 1, 0 }, /* 0x29 */ + { "zero_ext", 1, 0, 1, 1 }, /* 0x2a */ + { "swap", 0, 0, 2, 2 }, /* 0x2b */ + { 0, 0, 0, 0, 0 }, /* 0x2c */ + { 0, 0, 0, 0, 0 }, /* 0x2d */ + { 0, 0, 0, 0, 0 }, /* 0x2e */ + { 0, 0, 0, 0, 0 }, /* 0x2f */ + { "trace16", 2, 0, 1, 1 }, /* 0x30 */ +}; + + +/* Disassemble the expression EXPR, writing to F. */ +void +ax_print (f, x) + GDB_FILE *f; + struct agent_expr *x; +{ + int i; + int is_float = 0; + + /* Check the size of the name array against the number of entries in + the enum, to catch additions that people didn't sync. */ + if ((sizeof (aop_map) / sizeof (aop_map[0])) + != aop_last) + error ("GDB bug: ax-general.c (ax_print): opcode map out of sync"); + + for (i = 0; i < x->len; ) + { + enum agent_op op = x->buf[i]; + + if (op >= (sizeof (aop_map) / sizeof (aop_map[0])) + || ! aop_map[op].name) + { + fprintf_filtered (f, "%3d \n", i, op); + i++; + continue; + } + if (i + 1 + aop_map[op].op_size > x->len) + { + fprintf_filtered (f, "%3d \n", + i, aop_map[op].name); + break; + } + + fprintf_filtered (f, "%3d %s", i, aop_map[op].name); + if (aop_map[op].op_size > 0) + { + fputs_filtered (" ", f); + + print_longest (f, 'd', 0, + read_const (x, i + 1, aop_map[op].op_size)); + } + fprintf_filtered (f, "\n"); + i += 1 + aop_map[op].op_size; + + is_float = (op == aop_float); + } +} + + +/* Given an agent expression AX, fill in an agent_reqs structure REQS + describing it. */ +void +ax_reqs (ax, reqs) + struct agent_expr *ax; + struct agent_reqs *reqs; +{ + int i; + int height; + + /* Bit vector for registers used. */ + int reg_mask_len = 1; + unsigned char *reg_mask = xmalloc (reg_mask_len * sizeof (reg_mask[0])); + + /* Jump target table. targets[i] is non-zero iff there is a jump to + offset i. */ + char *targets = (char *) alloca (ax->len * sizeof (targets[0])); + + /* Instruction boundary table. boundary[i] is non-zero iff an + instruction starts at offset i. */ + char *boundary = (char *) alloca (ax->len * sizeof (boundary[0])); + + /* Stack height record. iff either targets[i] or boundary[i] is + non-zero, heights[i] is the height the stack should have before + executing the bytecode at that point. */ + int *heights = (int *) alloca (ax->len * sizeof (heights[0])); + + /* Pointer to a description of the present op. */ + struct aop_map *op; + + memset (reg_mask, 0, reg_mask_len * sizeof (reg_mask[0])); + memset (targets, 0, ax->len * sizeof (targets[0])); + memset (boundary, 0, ax->len * sizeof (boundary[0])); + + reqs->max_height = reqs->min_height = height = 0; + reqs->flaw = agent_flaw_none; + reqs->max_data_size = 0; + + for (i = 0; i < ax->len; i += 1 + op->op_size) + { + if (ax->buf[i] > (sizeof (aop_map) / sizeof (aop_map[0]))) + { + reqs->flaw = agent_flaw_bad_instruction; + free (reg_mask); + return; + } + + op = &aop_map[ax->buf[i]]; + + if (! op->name) + { + reqs->flaw = agent_flaw_bad_instruction; + free (reg_mask); + return; + } + + if (i + 1 + op->op_size > ax->len) + { + reqs->flaw = agent_flaw_incomplete_instruction; + free (reg_mask); + return; + } + + /* If this instruction is a jump target, does the current stack + height match the stack height at the jump source? */ + if (targets[i] && (heights[i] != height)) + { + reqs->flaw = agent_flaw_height_mismatch; + free (reg_mask); + return; + } + + boundary[i] = 1; + heights[i] = height; + + height -= op->consumed; + if (height < reqs->min_height) + reqs->min_height = height; + height += op->produced; + if (height > reqs->max_height) + reqs->max_height = height; + + if (op->data_size > reqs->max_data_size) + reqs->max_data_size = op->data_size; + + /* For jump instructions, check that the target is a valid + offset. If it is, record the fact that that location is a + jump target, and record the height we expect there. */ + if (aop_goto == op - aop_map + || aop_if_goto == op - aop_map) + { + int target = read_const (ax, i + 1, 2); + if (target < 0 || target >= ax->len) + { + reqs->flaw = agent_flaw_bad_jump; + free (reg_mask); + return; + } + /* Have we already found other jumps to the same location? */ + else if (targets[target]) + { + if (heights[i] != height) + { + reqs->flaw = agent_flaw_height_mismatch; + free (reg_mask); + return; + } + } + else + { + targets[target] = 1; + heights[target] = height; + } + } + + /* For unconditional jumps with a successor, check that the + successor is a target, and pick up its stack height. */ + if (aop_goto == op - aop_map + && i + 3 < ax->len) + { + if (! targets[i + 3]) + { + reqs->flaw = agent_flaw_hole; + free (reg_mask); + return; + } + + height = heights[i + 3]; + } + + /* For reg instructions, record the register in the bit mask. */ + if (aop_reg == op - aop_map) + { + int reg = read_const (ax, i + 1, 2); + int byte = reg / 8; + + /* Grow the bit mask if necessary. */ + if (byte >= reg_mask_len) + { + /* It's not appropriate to double here. This isn't a + string buffer. */ + int new_len = byte + 1; + reg_mask = xrealloc (reg_mask, + new_len * sizeof (reg_mask[0])); + memset (reg_mask + reg_mask_len, 0, + (new_len - reg_mask_len) * sizeof (reg_mask[0])); + reg_mask_len = new_len; + } + + reg_mask[byte] |= 1 << (reg % 8); + } + } + + /* Check that all the targets are on boundaries. */ + for (i = 0; i < ax->len; i++) + if (targets[i] && !boundary[i]) + { + reqs->flaw = agent_flaw_bad_jump; + free (reg_mask); + return; + } + + reqs->final_height = height; + reqs->reg_mask_len = reg_mask_len; + reqs->reg_mask = reg_mask; +} diff --git a/contrib/gdb/gdb/ax.h b/contrib/gdb/gdb/ax.h new file mode 100644 index 0000000..fe23a31 --- /dev/null +++ b/contrib/gdb/gdb/ax.h @@ -0,0 +1,285 @@ +/* Definitions for expressions designed to be executed on the agent + Copyright 1998 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. */ + +/* $Id: ax.h,v 1.3.20.1 1999/04/01 17:33:04 jimb Exp $ */ + +#ifndef AGENTEXPR_H +#define AGENTEXPR_H + +/* It's sometimes useful to be able to debug programs that you can't + really stop for more than a fraction of a second. To this end, the + user can specify a tracepoint (like a breakpoint, but you don't + stop at it), and specify a bunch of expressions to record the + values of when that tracepoint is reached. As the program runs, + GDB collects the values. At any point (possibly while values are + still being collected), the user can display the collected values. + + This is used with remote debugging; we don't really support it on + native configurations. + + This means that expressions are being evaluated by the remote agent, + which doesn't have any access to the symbol table information, and + needs to be small and simple. + + The agent_expr routines and datatypes are a bytecode language + designed to be executed by the agent. Agent expressions work in + terms of fixed-width values, operators, memory references, and + register references. You can evaluate a agent expression just given + a bunch of memory and register values to sniff at; you don't need + any symbolic information like variable names, types, etc. + + GDB translates source expressions, whose meaning depends on + symbolic information, into agent bytecode expressions, whose meaning + is independent of symbolic information. This means the agent can + evaluate them on the fly without reference to data only available + to the host GDB. */ + + +/* Agent expression data structures. */ + +/* The type of an element of the agent expression stack. + The bytecode operation indicates which element we should access; + the value itself has no typing information. GDB generates all + bytecode streams, so we don't have to worry about type errors. */ + +union agent_val { + LONGEST l; + DOUBLEST d; +}; + +/* A buffer containing a agent expression. */ +struct agent_expr { + unsigned char *buf; + int len; /* number of characters used */ + int size; /* allocated size */ + CORE_ADDR scope; +}; + + + + +/* The actual values of the various bytecode operations. + + Other independent implementations of the agent bytecode engine will + rely on the exact values of these enums, and may not be recompiled + when we change this table. The numeric values should remain fixed + whenever possible. Thus, we assign them values explicitly here (to + allow gaps to form safely), and the disassembly table in + agentexpr.h behaves like an opcode map. If you want to see them + grouped logically, see doc/agentexpr.texi. */ + +enum agent_op { + aop_float = 0x01, + aop_add = 0x02, + aop_sub = 0x03, + aop_mul = 0x04, + aop_div_signed = 0x05, + aop_div_unsigned = 0x06, + aop_rem_signed = 0x07, + aop_rem_unsigned = 0x08, + aop_lsh = 0x09, + aop_rsh_signed = 0x0a, + aop_rsh_unsigned = 0x0b, + aop_trace = 0x0c, + aop_trace_quick = 0x0d, + aop_log_not = 0x0e, + aop_bit_and = 0x0f, + aop_bit_or = 0x10, + aop_bit_xor = 0x11, + aop_bit_not = 0x12, + aop_equal = 0x13, + aop_less_signed = 0x14, + aop_less_unsigned = 0x15, + aop_ext = 0x16, + aop_ref8 = 0x17, + aop_ref16 = 0x18, + aop_ref32 = 0x19, + aop_ref64 = 0x1a, + aop_ref_float = 0x1b, + aop_ref_double = 0x1c, + aop_ref_long_double = 0x1d, + aop_l_to_d = 0x1e, + aop_d_to_l = 0x1f, + aop_if_goto = 0x20, + aop_goto = 0x21, + aop_const8 = 0x22, + aop_const16 = 0x23, + aop_const32 = 0x24, + aop_const64 = 0x25, + aop_reg = 0x26, + aop_end = 0x27, + aop_dup = 0x28, + aop_pop = 0x29, + aop_zero_ext = 0x2a, + aop_swap = 0x2b, + aop_trace16 = 0x30, + aop_last +}; + + + +/* Functions for building expressions. */ + +/* Allocate a new, empty agent expression. */ +extern struct agent_expr *new_agent_expr PARAMS ((CORE_ADDR)); + +/* Free a agent expression. */ +extern void free_agent_expr PARAMS ((struct agent_expr *)); + +/* Append a simple operator OP to EXPR. */ +extern void ax_simple PARAMS ((struct agent_expr *EXPR, enum agent_op OP)); + +/* Append the floating-point prefix, for the next bytecode. */ +#define ax_float(EXPR) (ax_simple ((EXPR), aop_float)) + +/* Append a sign-extension instruction to EXPR, to extend an N-bit value. */ +extern void ax_ext PARAMS ((struct agent_expr *EXPR, int N)); + +/* Append a zero-extension instruction to EXPR, to extend an N-bit value. */ +extern void ax_zero_ext PARAMS ((struct agent_expr *EXPR, int N)); + +/* Append a trace_quick instruction to EXPR, to record N bytes. */ +extern void ax_trace_quick PARAMS ((struct agent_expr *EXPR, int N)); + +/* Append a goto op to EXPR. OP is the actual op (must be aop_goto or + aop_if_goto). We assume we don't know the target offset yet, + because it's probably a forward branch, so we leave space in EXPR + for the target, and return the offset in EXPR of that space, so we + can backpatch it once we do know the target offset. Use ax_label + to do the backpatching. */ +extern int ax_goto PARAMS ((struct agent_expr *EXPR, enum agent_op OP)); + +/* Suppose a given call to ax_goto returns some value PATCH. When you + know the offset TARGET that goto should jump to, call + ax_label (EXPR, PATCH, TARGET) + to patch TARGET into the ax_goto instruction. */ +extern void ax_label PARAMS ((struct agent_expr *EXPR, int patch, int target)); + +/* Assemble code to push a constant on the stack. */ +extern void ax_const_l PARAMS ((struct agent_expr *EXPR, LONGEST l)); +extern void ax_const_d PARAMS ((struct agent_expr *EXPR, LONGEST d)); + +/* Assemble code to push the value of register number REG on the + stack. */ +extern void ax_reg PARAMS ((struct agent_expr *EXPR, int REG)); + + +/* Functions for printing out expressions, and otherwise debugging + things. */ + +/* Disassemble the expression EXPR, writing to F. */ +extern void ax_print PARAMS ((GDB_FILE *f, struct agent_expr *EXPR)); + +/* An entry in the opcode map. */ +struct aop_map { + + /* The name of the opcode. Null means that this entry is not a + valid opcode --- a hole in the opcode space. */ + char *name; + + /* All opcodes take no operands from the bytecode stream, or take + unsigned integers of various sizes. If this is a positive number + n, then the opcode is followed by an n-byte operand, which should + be printed as an unsigned integer. If this is zero, then the + opcode takes no operands from the bytecode stream. + + If we get more complicated opcodes in the future, don't add other + magic values of this; that's a crock. Add an `enum encoding' + field to this, or something like that. */ + int op_size; + + /* The size of the data operated upon, in bits, for bytecodes that + care about that (ref and const). Zero for all others. */ + int data_size; + + /* Number of stack elements consumed, and number produced. */ + int consumed, produced; +}; + +/* Map of the bytecodes, indexed by bytecode number. */ +extern struct aop_map aop_map[]; + +/* Different kinds of flaws an agent expression might have, as + detected by agent_reqs. */ +enum agent_flaws { + agent_flaw_none = 0, /* code is good */ + + /* There is an invalid instruction in the stream. */ + agent_flaw_bad_instruction, + + /* There is an incomplete instruction at the end of the expression. */ + agent_flaw_incomplete_instruction, + + /* agent_reqs was unable to prove that every jump target is to a + valid offset. Valid offsets are within the bounds of the + expression, and to a valid instruction boundary. */ + agent_flaw_bad_jump, + + /* agent_reqs was unable to prove to its satisfaction that, for each + jump target location, the stack will have the same height whether + that location is reached via a jump or by straight execution. */ + agent_flaw_height_mismatch, + + /* agent_reqs was unable to prove that every instruction following + an unconditional jump was the target of some other jump. */ + agent_flaw_hole +}; + +/* Structure describing the requirements of a bytecode expression. */ +struct agent_reqs { + + /* If the following is not equal to agent_flaw_none, the rest of the + information in this structure is suspect. */ + enum agent_flaws flaw; + + /* Number of elements left on stack at end; may be negative if expr + only consumes elements. */ + int final_height; + + /* Maximum and minimum stack height, relative to initial height. */ + int max_height, min_height; + + /* Largest `ref' or `const' opcode used, in bits. Zero means the + expression has no such instructions. */ + int max_data_size; + + /* Bit vector of registers used. Register R is used iff + + reg_mask[R / 8] & (1 << (R % 8)) + + is non-zero. Note! You may not assume that this bitmask is long + enough to hold bits for all the registers of the machine; the + agent expression code has no idea how many registers the machine + has. However, the bitmask is reg_mask_len bytes long, so the + valid register numbers run from 0 to reg_mask_len * 8 - 1. + + We're assuming eight-bit bytes. So sue me. + + The caller should free reg_list when done. */ + int reg_mask_len; + unsigned char *reg_mask; +}; + + +/* Given an agent expression AX, fill in an agent_reqs structure REQS + describing it. */ +extern void ax_reqs PARAMS ((struct agent_expr *ax, + struct agent_reqs *reqs)); + +#endif /* AGENTEXPR_H */ diff --git a/contrib/gdb/gdb/bcache.c b/contrib/gdb/gdb/bcache.c index ae73c11..d28515b 100644 --- a/contrib/gdb/gdb/bcache.c +++ b/contrib/gdb/gdb/bcache.c @@ -1,6 +1,6 @@ /* Implement a cached obstack. Written by Fred Fish (fnf@cygnus.com) - Copyright 1995 Free Software Foundation, Inc. + Copyright 1995, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -23,6 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bcache.h" #include "gdb_string.h" /* For memcpy declaration */ +/* Prototypes for local functions. */ + +static unsigned int hash PARAMS ((void *, int)); + +static void *lookup_cache PARAMS ((void *, int, int, struct bcache *)); + /* FIXME: Incredibly simplistic hash generator. Probably way too expensive (consider long strings) and unlikely to have good distribution across hash values for typical input. */ @@ -173,16 +179,40 @@ print_bcache_statistics (bcachep, id) printf_filtered (" Cached '%s' statistics:\n", id); printf_filtered (" Cache hits: %d\n", bcachep -> cache_hits); printf_filtered (" Cache misses: %d\n", bcachep -> cache_misses); - printf_filtered (" Cache hit ratio: %d%%\n", ((bcachep -> cache_hits) * 100) / (bcachep -> cache_hits + bcachep -> cache_misses)); + printf_filtered (" Cache hit ratio: "); + if (bcachep -> cache_hits + bcachep -> cache_misses > 0) + { + printf_filtered ("%d%%\n", ((bcachep -> cache_hits) * 100) / + (bcachep -> cache_hits + bcachep -> cache_misses)); + } + else + { + printf_filtered ("(not applicable)\n"); + } printf_filtered (" Space used for caching: %d\n", bcachep -> cache_bytes); printf_filtered (" Space saved by cache hits: %d\n", bcachep -> cache_savings); printf_filtered (" Number of bcache overflows: %d\n", bcachep -> bcache_overflows); printf_filtered (" Number of index buckets used: %d\n", tcount); printf_filtered (" Number of hash table buckets used: %d\n", hcount); printf_filtered (" Number of chained items: %d\n", lcount); - printf_filtered (" Average hash table population: %d%%\n", - (hcount * 100) / (tcount * BCACHE_HASHSIZE)); - printf_filtered (" Average chain length %d\n", lcount / hcount); + printf_filtered (" Average hash table population: "); + if (tcount > 0) + { + printf_filtered ("%d%%\n", (hcount * 100) / (tcount * BCACHE_HASHSIZE)); + } + else + { + printf_filtered ("(not applicable)\n"); + } + printf_filtered (" Average chain length "); + if (hcount > 0) + { + printf_filtered ("%d\n", lcount / hcount); + } + else + { + printf_filtered ("(not applicable)\n"); + } printf_filtered (" Maximum chain length %d at %d:%d\n", lmax, lmaxt, lmaxh); } diff --git a/contrib/gdb/gdb/bcache.h b/contrib/gdb/gdb/bcache.h index 48b71e2..cf0c62e 100644 --- a/contrib/gdb/gdb/bcache.h +++ b/contrib/gdb/gdb/bcache.h @@ -47,7 +47,7 @@ struct hashlink { a hashlink struct to hold the next pointer and the data. */ #define BCACHE_DATA_ALIGNMENT \ - (((char *) &BCACHE_DATA((struct hashlink*) 0) - (char *) 0)) + (((char *) BCACHE_DATA((struct hashlink*) 0) - (char *) 0)) struct bcache { struct obstack cache; diff --git a/contrib/gdb/gdb/blockframe.c b/contrib/gdb/gdb/blockframe.c index d98f6a4..9366ca6 100644 --- a/contrib/gdb/gdb/blockframe.c +++ b/contrib/gdb/gdb/blockframe.c @@ -1,6 +1,6 @@ /* Get info from stack frames; convert between frames, blocks, functions and pc values. - Copyright 1986, 1987, 1988, 1989, 1991, 1994, 1995 + Copyright 1986, 87, 88, 89, 91, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -31,6 +31,47 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "inferior.h" /* for read_pc */ #include "annotate.h" +/* Prototypes for exported functions. */ + +void _initialize_blockframe PARAMS ((void)); + +/* A default FRAME_CHAIN_VALID, in the form that is suitable for most + targets. If FRAME_CHAIN_VALID returns zero it means that the given + frame is the outermost one and has no caller. */ + +int +default_frame_chain_valid (chain, thisframe) + CORE_ADDR chain; + struct frame_info *thisframe; +{ + return ((chain) != 0 + && !inside_main_func ((thisframe) -> pc) + && !inside_entry_func ((thisframe) -> pc)); +} + +/* Use the alternate method of avoiding running up off the end of the + frame chain or following frames back into the startup code. See + the comments in objfiles.h. */ + +int +alternate_frame_chain_valid (chain, thisframe) + CORE_ADDR chain; + struct frame_info *thisframe; +{ + return ((chain) != 0 + && !inside_entry_file (FRAME_SAVED_PC (thisframe))); +} + +/* A very simple method of determining a valid frame */ + +int +nonnull_frame_chain_valid (chain, thisframe) + CORE_ADDR chain; + struct frame_info *thisframe; +{ + return ((chain) != 0); +} + /* Is ADDR inside the startup file? Note that if your machine has a way to detect the bottom of the stack, there is no need to call this function from FRAME_CHAIN_VALID; the reason for @@ -50,7 +91,8 @@ inside_entry_file (addr) #if CALL_DUMMY_LOCATION == AT_ENTRY_POINT /* Do not stop backtracing if the pc is in the call dummy at the entry point. */ - if (PC_IN_CALL_DUMMY (addr, 0, 0)) +/* FIXME: Won't always work with zeros for the last two arguments */ + if (PC_IN_CALL_DUMMY (addr, 0, 0)) return 0; #endif return (addr >= symfile_objfile -> ei.entry_file_lowpc && @@ -69,7 +111,6 @@ int inside_main_func (pc) CORE_ADDR pc; { -struct symbol *mainsym; if (pc == 0) return 1; if (symfile_objfile == 0) @@ -82,13 +123,16 @@ struct symbol *mainsym; if (symfile_objfile -> ei.main_func_lowpc == INVALID_ENTRY_LOWPC && symfile_objfile -> ei.main_func_highpc == INVALID_ENTRY_HIGHPC) { + struct symbol *mainsym; + mainsym = lookup_symbol ("main", NULL, VAR_NAMESPACE, NULL, NULL); if (mainsym && SYMBOL_CLASS(mainsym) == LOC_BLOCK) { - symfile_objfile->ei.main_func_lowpc = BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym)); - symfile_objfile->ei.main_func_highpc = BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym)); + symfile_objfile->ei.main_func_lowpc = + BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym)); + symfile_objfile->ei.main_func_highpc = + BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym)); } - } return (symfile_objfile -> ei.main_func_lowpc <= pc && symfile_objfile -> ei.main_func_highpc > pc); @@ -113,6 +157,7 @@ CORE_ADDR pc; #if CALL_DUMMY_LOCATION == AT_ENTRY_POINT /* Do not stop backtracing if the pc is in the call dummy at the entry point. */ +/* FIXME: Won't always work with zeros for the last two arguments */ if (PC_IN_CALL_DUMMY (pc, 0, 0)) return 0; #endif @@ -128,7 +173,24 @@ static struct frame_info *current_frame; inferior is stopped. Control variables for the frame cache should be local to this module. */ -struct obstack frame_cache_obstack; +static struct obstack frame_cache_obstack; + +void * +frame_obstack_alloc (size) + unsigned long size; +{ + return obstack_alloc (&frame_cache_obstack, size); +} + +void +frame_saved_regs_zalloc (fi) + struct frame_info *fi; +{ + fi->saved_regs = (CORE_ADDR*) + frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS); + memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS); +} + /* Return the innermost (currently executing) stack frame. */ @@ -168,6 +230,7 @@ create_new_frame (addr, pc) sizeof (struct frame_info)); /* Arbitrary frame */ + fi->saved_regs = NULL; fi->next = NULL; fi->prev = NULL; fi->frame = addr; @@ -244,9 +307,10 @@ frameless_look_for_prologue (frame) struct frame_info *frame; { CORE_ADDR func_start, after_prologue; - func_start = (get_pc_function_start (frame->pc) + FUNCTION_START_OFFSET); + func_start = get_pc_function_start (frame->pc); if (func_start) { + func_start += FUNCTION_START_OFFSET; after_prologue = func_start; #ifdef SKIP_PROLOGUE_FRAMELESS_P /* This is faster, since only care whether there *is* a prologue, @@ -257,6 +321,12 @@ frameless_look_for_prologue (frame) #endif return after_prologue == func_start; } + else if (frame->pc == 0) + /* A frame with a zero PC is usually created by dereferencing a NULL + function pointer, normally causing an immediate core dump of the + inferior. Mark function as frameless, as the inferior has no chance + of setting up a stack frame. */ + return 1; else /* If we can't find the start of the function, we don't really know whether the function is frameless, but we should be able @@ -358,6 +428,7 @@ get_prev_frame_info (next_frame) obstack_alloc (&frame_cache_obstack, sizeof (struct frame_info)); + prev->saved_regs = NULL; if (next_frame) next_frame->prev = prev; prev->next = next_frame; @@ -449,7 +520,10 @@ get_frame_pc (frame) return frame->pc; } -#if defined (FRAME_FIND_SAVED_REGS) + +#ifdef FRAME_FIND_SAVED_REGS +/* XXX - deprecated. This is a compatibility function for targets + that do not yet implement FRAME_INIT_SAVED_REGS. */ /* Find the addresses in which registers are saved in FRAME. */ void @@ -457,7 +531,22 @@ get_frame_saved_regs (frame, saved_regs_addr) struct frame_info *frame; struct frame_saved_regs *saved_regs_addr; { - FRAME_FIND_SAVED_REGS (frame, *saved_regs_addr); + if (frame->saved_regs == NULL) + { + frame->saved_regs = (CORE_ADDR*) + frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS); + } + if (saved_regs_addr == NULL) + { + struct frame_saved_regs saved_regs; + FRAME_FIND_SAVED_REGS (frame, saved_regs); + memcpy (frame->saved_regs, &saved_regs, SIZEOF_FRAME_SAVED_REGS); + } + else + { + FRAME_FIND_SAVED_REGS (frame, *saved_regs_addr); + memcpy (frame->saved_regs, saved_regs_addr, SIZEOF_FRAME_SAVED_REGS); + } } #endif @@ -526,27 +615,32 @@ get_frame_function (frame) return block_function (bl); } + /* Return the blockvector immediately containing the innermost lexical block - containing the specified pc value, or 0 if there is none. + containing the specified pc value and section, or 0 if there is none. PINDEX is a pointer to the index value of the block. If PINDEX is NULL, we don't pass this information back to the caller. */ struct blockvector * -blockvector_for_pc (pc, pindex) +blockvector_for_pc_sect (pc, section, pindex, symtab) register CORE_ADDR pc; + struct sec *section; int *pindex; + struct symtab *symtab; + { register struct block *b; register int bot, top, half; - register struct symtab *s; struct blockvector *bl; - /* First search all symtabs for one whose file contains our pc */ - s = find_pc_symtab (pc); - if (s == 0) - return 0; + if (symtab == 0) /* if no symtab specified by caller */ + { + /* First search all symtabs for one whose file contains our pc */ + if ((symtab = find_pc_sect_symtab (pc, section)) == 0) + return 0; + } - bl = BLOCKVECTOR (s); + bl = BLOCKVECTOR (symtab); b = BLOCKVECTOR_BLOCK (bl, 0); /* Then search that symtab for the smallest block that wins. */ @@ -570,7 +664,7 @@ blockvector_for_pc (pc, pindex) while (bot >= 0) { b = BLOCKVECTOR_BLOCK (bl, bot); - if (BLOCK_END (b) > pc) + if (BLOCK_END (b) >= pc) { if (pindex) *pindex = bot; @@ -578,45 +672,80 @@ blockvector_for_pc (pc, pindex) } bot--; } - return 0; } -/* Return the innermost lexical block containing the specified pc value, - or 0 if there is none. */ +/* Return the blockvector immediately containing the innermost lexical block + containing the specified pc value, or 0 if there is none. + Backward compatibility, no section. */ + +struct blockvector * +blockvector_for_pc (pc, pindex) + register CORE_ADDR pc; + int *pindex; +{ + return blockvector_for_pc_sect (pc, find_pc_mapped_section (pc), + pindex, NULL); +} + +/* Return the innermost lexical block containing the specified pc value + in the specified section, or 0 if there is none. */ struct block * -block_for_pc (pc) +block_for_pc_sect (pc, section) register CORE_ADDR pc; + struct sec *section; { register struct blockvector *bl; int index; - bl = blockvector_for_pc (pc, &index); + bl = blockvector_for_pc_sect (pc, section, &index, NULL); if (bl) return BLOCKVECTOR_BLOCK (bl, index); return 0; } -/* Return the function containing pc value PC. +/* Return the innermost lexical block containing the specified pc value, + or 0 if there is none. Backward compatibility, no section. */ + +struct block * +block_for_pc (pc) + register CORE_ADDR pc; +{ + return block_for_pc_sect (pc, find_pc_mapped_section (pc)); +} + +/* Return the function containing pc value PC in section SECTION. Returns 0 if function is not known. */ struct symbol * -find_pc_function (pc) +find_pc_sect_function (pc, section) CORE_ADDR pc; + struct sec *section; { - register struct block *b = block_for_pc (pc); + register struct block *b = block_for_pc_sect (pc, section); if (b == 0) return 0; return block_function (b); } +/* Return the function containing pc value PC. + Returns 0 if function is not known. Backward compatibility, no section */ + +struct symbol * +find_pc_function (pc) + CORE_ADDR pc; +{ + return find_pc_sect_function (pc, find_pc_mapped_section (pc)); +} + /* These variables are used to cache the most recent result * of find_pc_partial_function. */ -static CORE_ADDR cache_pc_function_low = 0; -static CORE_ADDR cache_pc_function_high = 0; -static char *cache_pc_function_name = 0; +static CORE_ADDR cache_pc_function_low = 0; +static CORE_ADDR cache_pc_function_high = 0; +static char *cache_pc_function_name = 0; +static struct sec *cache_pc_function_section = NULL; /* Clear cache, e.g. when symbol table is discarded. */ @@ -626,50 +755,58 @@ clear_pc_function_cache() cache_pc_function_low = 0; cache_pc_function_high = 0; cache_pc_function_name = (char *)0; + cache_pc_function_section = NULL; } /* Finds the "function" (text symbol) that is smaller than PC but - greatest of all of the potential text symbols. Sets *NAME and/or - *ADDRESS conditionally if that pointer is non-null. If ENDADDR is - non-null, then set *ENDADDR to be the end of the function - (exclusive), but passing ENDADDR as non-null means that the - function might cause symbols to be read. This function either + greatest of all of the potential text symbols in SECTION. Sets + *NAME and/or *ADDRESS conditionally if that pointer is non-null. + If ENDADDR is non-null, then set *ENDADDR to be the end of the + function (exclusive), but passing ENDADDR as non-null means that + the function might cause symbols to be read. This function either succeeds or fails (not halfway succeeds). If it succeeds, it sets *NAME, *ADDRESS, and *ENDADDR to real information and returns 1. - If it fails, it sets *NAME, *ADDRESS, and *ENDADDR to zero - and returns 0. */ + If it fails, it sets *NAME, *ADDRESS, and *ENDADDR to zero and + returns 0. */ int -find_pc_partial_function (pc, name, address, endaddr) - CORE_ADDR pc; - char **name; +find_pc_sect_partial_function (pc, section, name, address, endaddr) + CORE_ADDR pc; + asection *section; + char **name; CORE_ADDR *address; CORE_ADDR *endaddr; { struct partial_symtab *pst; - struct symbol *f; + struct symbol *f; struct minimal_symbol *msymbol; struct partial_symbol *psb; - struct obj_section *sec; + struct obj_section *osect; + int i; + CORE_ADDR mapped_pc; + + mapped_pc = overlay_mapped_address (pc, section); - if (pc >= cache_pc_function_low && pc < cache_pc_function_high) + if (mapped_pc >= cache_pc_function_low && + mapped_pc < cache_pc_function_high && + section == cache_pc_function_section) goto return_cached_value; /* If sigtramp is in the u area, it counts as a function (especially important for step_1). */ #if defined SIGTRAMP_START - if (IN_SIGTRAMP (pc, (char *)NULL)) + if (IN_SIGTRAMP (mapped_pc, (char *)NULL)) { - cache_pc_function_low = SIGTRAMP_START; - cache_pc_function_high = SIGTRAMP_END; - cache_pc_function_name = ""; - + cache_pc_function_low = SIGTRAMP_START (mapped_pc); + cache_pc_function_high = SIGTRAMP_END (mapped_pc); + cache_pc_function_name = ""; + cache_pc_function_section = section; goto return_cached_value; } #endif - msymbol = lookup_minimal_symbol_by_pc (pc); - pst = find_pc_psymtab (pc); + msymbol = lookup_minimal_symbol_by_pc_section (mapped_pc, section); + pst = find_pc_sect_psymtab (mapped_pc, section); if (pst) { /* Need to read the symbols to get a good value for the end address. */ @@ -685,15 +822,16 @@ find_pc_partial_function (pc, name, address, endaddr) { /* Checking whether the msymbol has a larger value is for the "pathological" case mentioned in print_frame_info. */ - f = find_pc_function (pc); + f = find_pc_sect_function (mapped_pc, section); if (f != NULL && (msymbol == NULL || (BLOCK_START (SYMBOL_BLOCK_VALUE (f)) >= SYMBOL_VALUE_ADDRESS (msymbol)))) { - cache_pc_function_low = BLOCK_START (SYMBOL_BLOCK_VALUE (f)); - cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f)); - cache_pc_function_name = SYMBOL_NAME (f); + cache_pc_function_low = BLOCK_START (SYMBOL_BLOCK_VALUE (f)); + cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f)); + cache_pc_function_name = SYMBOL_NAME (f); + cache_pc_function_section = section; goto return_cached_value; } } @@ -702,7 +840,7 @@ find_pc_partial_function (pc, name, address, endaddr) /* Now that static symbols go in the minimal symbol table, perhaps we could just ignore the partial symbols. But at least for now we use the partial or minimal symbol, whichever is larger. */ - psb = find_pc_psymbol (pst, pc); + psb = find_pc_sect_psymbol (pst, mapped_pc, section); if (psb && (msymbol == NULL || @@ -725,9 +863,9 @@ find_pc_partial_function (pc, name, address, endaddr) of the text seg doesn't appear to be part of the last function in the text segment. */ - sec = find_pc_section (pc); + osect = find_pc_sect_section (mapped_pc, section); - if (!sec) + if (!osect) msymbol = NULL; /* Must be in the minimal symbol table. */ @@ -743,30 +881,79 @@ find_pc_partial_function (pc, name, address, endaddr) return 0; } - cache_pc_function_low = SYMBOL_VALUE_ADDRESS (msymbol); - cache_pc_function_name = SYMBOL_NAME (msymbol); + cache_pc_function_low = SYMBOL_VALUE_ADDRESS (msymbol); + cache_pc_function_name = SYMBOL_NAME (msymbol); + cache_pc_function_section = section; + + /* Use the lesser of the next minimal symbol in the same section, or + the end of the section, as the end of the function. */ + + /* Step over other symbols at this same address, and symbols in + other sections, to find the next symbol in this section with + a different address. */ - /* Use the lesser of the next minimal symbol, or the end of the section, as - the end of the function. */ + for (i=1; SYMBOL_NAME (msymbol+i) != NULL; i++) + { + if (SYMBOL_VALUE_ADDRESS (msymbol+i) != SYMBOL_VALUE_ADDRESS (msymbol) + && SYMBOL_BFD_SECTION (msymbol+i) == SYMBOL_BFD_SECTION (msymbol)) + break; + } - if (SYMBOL_NAME (msymbol + 1) != NULL - && SYMBOL_VALUE_ADDRESS (msymbol + 1) < sec->endaddr) - cache_pc_function_high = SYMBOL_VALUE_ADDRESS (msymbol + 1); + if (SYMBOL_NAME (msymbol + i) != NULL + && SYMBOL_VALUE_ADDRESS (msymbol + i) < osect->endaddr) + cache_pc_function_high = SYMBOL_VALUE_ADDRESS (msymbol + i); else /* We got the start address from the last msymbol in the objfile. So the end address is the end of the section. */ - cache_pc_function_high = sec->endaddr; + cache_pc_function_high = osect->endaddr; return_cached_value: + if (address) - *address = cache_pc_function_low; + { + if (pc_in_unmapped_range (pc, section)) + *address = overlay_unmapped_address (cache_pc_function_low, section); + else + *address = cache_pc_function_low; + } + if (name) *name = cache_pc_function_name; + if (endaddr) - *endaddr = cache_pc_function_high; + { + if (pc_in_unmapped_range (pc, section)) + { + /* Because the high address is actually beyond the end of + the function (and therefore possibly beyond the end of + the overlay), we must actually convert (high - 1) + and then add one to that. */ + + *endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1, + section); + } + else + *endaddr = cache_pc_function_high; + } + return 1; } +/* Backward compatibility, no section argument */ + +int +find_pc_partial_function (pc, name, address, endaddr) + CORE_ADDR pc; + char **name; + CORE_ADDR *address; + CORE_ADDR *endaddr; +{ + asection *section; + + section = find_pc_overlay (pc); + return find_pc_sect_partial_function (pc, section, name, address, endaddr); +} + /* Return the innermost stack frame executing inside of BLOCK, or NULL if there is no such frame. If BLOCK is NULL, just return NULL. */ @@ -847,6 +1034,266 @@ sigtramp_saved_pc (frame) } #endif /* SIGCONTEXT_PC_OFFSET */ +#ifdef USE_GENERIC_DUMMY_FRAMES + +/* + * GENERIC DUMMY FRAMES + * + * The following code serves to maintain the dummy stack frames for + * inferior function calls (ie. when gdb calls into the inferior via + * call_function_by_hand). This code saves the machine state before + * the call in host memory, so we must maintain an independant stack + * and keep it consistant etc. I am attempting to make this code + * generic enough to be used by many targets. + * + * The cheapest and most generic way to do CALL_DUMMY on a new target + * is probably to define CALL_DUMMY to be empty, CALL_DUMMY_LENGTH to + * zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember + * to define PUSH_RETURN_ADDRESS, because no call instruction will be + * being executed by the target. Also FRAME_CHAIN_VALID as + * generic_frame_chain_valid. */ + +static struct dummy_frame *dummy_frame_stack = NULL; + +/* Function: find_dummy_frame(pc, fp, sp) + Search the stack of dummy frames for one matching the given PC, FP and SP. + This is the work-horse for pc_in_call_dummy and read_register_dummy */ + +char * +generic_find_dummy_frame (pc, fp) + CORE_ADDR pc; + CORE_ADDR fp; +{ + struct dummy_frame * dummyframe; + + if (pc != entry_point_address ()) + return 0; + + for (dummyframe = dummy_frame_stack; dummyframe != NULL; + dummyframe = dummyframe->next) + if (fp == dummyframe->fp || fp == dummyframe->sp) + /* The frame in question lies between the saved fp and sp, inclusive */ + return dummyframe->regs; + + return 0; +} + +/* Function: pc_in_call_dummy (pc, fp) + Return true if this is a dummy frame created by gdb for an inferior call */ + +int +generic_pc_in_call_dummy (pc, fp) + CORE_ADDR pc; + CORE_ADDR fp; +{ + /* if find_dummy_frame succeeds, then PC is in a call dummy */ + return (generic_find_dummy_frame (pc, fp) != 0); +} + +/* Function: read_register_dummy + Find a saved register from before GDB calls a function in the inferior */ + +CORE_ADDR +generic_read_register_dummy (pc, fp, regno) + CORE_ADDR pc; + CORE_ADDR fp; + int regno; +{ + char *dummy_regs = generic_find_dummy_frame (pc, fp); + + if (dummy_regs) + return extract_address (&dummy_regs[REGISTER_BYTE (regno)], + REGISTER_RAW_SIZE(regno)); + else + return 0; +} + +/* Save all the registers on the dummy frame stack. Most ports save the + registers on the target stack. This results in lots of unnecessary memory + references, which are slow when debugging via a serial line. Instead, we + save all the registers internally, and never write them to the stack. The + registers get restored when the called function returns to the entry point, + where a breakpoint is laying in wait. */ + +void +generic_push_dummy_frame () +{ + struct dummy_frame *dummy_frame; + CORE_ADDR fp = (get_current_frame ())->frame; + + /* check to see if there are stale dummy frames, + perhaps left over from when a longjump took us out of a + function that was called by the debugger */ + + dummy_frame = dummy_frame_stack; + while (dummy_frame) + if (INNER_THAN (dummy_frame->fp, fp)) /* stale -- destroy! */ + { + dummy_frame_stack = dummy_frame->next; + free (dummy_frame); + dummy_frame = dummy_frame_stack; + } + else + dummy_frame = dummy_frame->next; + + dummy_frame = xmalloc (sizeof (struct dummy_frame)); + dummy_frame->pc = read_register (PC_REGNUM); + dummy_frame->sp = read_register (SP_REGNUM); + dummy_frame->fp = fp; + read_register_bytes (0, dummy_frame->regs, REGISTER_BYTES); + dummy_frame->next = dummy_frame_stack; + dummy_frame_stack = dummy_frame; +} + +/* Function: pop_frame + Restore the machine state from either the saved dummy stack or a + real stack frame. */ + +void +generic_pop_current_frame (pop) + void (*pop) PARAMS ((struct frame_info *frame)); +{ + struct frame_info *frame = get_current_frame (); + if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame)) + generic_pop_dummy_frame (); + else + pop (frame); +} + +/* Function: pop_dummy_frame + Restore the machine state from a saved dummy stack frame. */ + +void +generic_pop_dummy_frame () +{ + struct dummy_frame *dummy_frame = dummy_frame_stack; + + /* FIXME: what if the first frame isn't the right one, eg.. + because one call-by-hand function has done a longjmp into another one? */ + + if (!dummy_frame) + error ("Can't pop dummy frame!"); + dummy_frame_stack = dummy_frame->next; + write_register_bytes (0, dummy_frame->regs, REGISTER_BYTES); + flush_cached_frames (); + free (dummy_frame); +} + +/* Function: frame_chain_valid + Returns true for a user frame or a call_function_by_hand dummy frame, + and false for the CRT0 start-up frame. Purpose is to terminate backtrace */ + +int +generic_frame_chain_valid (fp, fi) + CORE_ADDR fp; + struct frame_info *fi; +{ + if (PC_IN_CALL_DUMMY(FRAME_SAVED_PC(fi), fp, fp)) + return 1; /* don't prune CALL_DUMMY frames */ + else /* fall back to default algorithm (see frame.h) */ + return (fp != 0 + && (INNER_THAN (fi->frame, fp) || fi->frame == fp) + && !inside_entry_file (FRAME_SAVED_PC(fi))); +} + +/* Function: get_saved_register + Find register number REGNUM relative to FRAME and put its (raw, + target format) contents in *RAW_BUFFER. + + Set *OPTIMIZED if the variable was optimized out (and thus can't be + fetched). Note that this is never set to anything other than zero + in this implementation. + + Set *LVAL to lval_memory, lval_register, or not_lval, depending on + whether the value was fetched from memory, from a register, or in a + strange and non-modifiable way (e.g. a frame pointer which was + calculated rather than fetched). We will use not_lval for values + fetched from generic dummy frames. + + Set *ADDRP to the address, either in memory on as a REGISTER_BYTE + offset into the registers array. If the value is stored in a dummy + frame, set *ADDRP to zero. + + To use this implementation, define a function called + "get_saved_register" in your target code, which simply passes all + of its arguments to this function. + + The argument RAW_BUFFER must point to aligned memory. */ + +void +generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) + char *raw_buffer; + int *optimized; + CORE_ADDR *addrp; + struct frame_info *frame; + int regnum; + enum lval_type *lval; +{ + if (!target_has_registers) + error ("No registers."); + + /* Normal systems don't optimize out things with register numbers. */ + if (optimized != NULL) + *optimized = 0; + + if (addrp) /* default assumption: not found in memory */ + *addrp = 0; + + /* Note: since the current frame's registers could only have been + saved by frames INTERIOR TO the current frame, we skip examining + the current frame itself: otherwise, we would be getting the + previous frame's registers which were saved by the current frame. */ + + while (frame && ((frame = frame->next) != NULL)) + { + if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + { + if (lval) /* found it in a CALL_DUMMY frame */ + *lval = not_lval; + if (raw_buffer) + memcpy (raw_buffer, + generic_find_dummy_frame (frame->pc, frame->frame) + + REGISTER_BYTE (regnum), + REGISTER_RAW_SIZE (regnum)); + return; + } + + FRAME_INIT_SAVED_REGS (frame); + if (frame->saved_regs != NULL + && frame->saved_regs[regnum] != 0) + { + if (lval) /* found it saved on the stack */ + *lval = lval_memory; + if (regnum == SP_REGNUM) + { + if (raw_buffer) /* SP register treated specially */ + store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), + frame->saved_regs[regnum]); + } + else + { + if (addrp) /* any other register */ + *addrp = frame->saved_regs[regnum]; + if (raw_buffer) + read_memory (frame->saved_regs[regnum], raw_buffer, + REGISTER_RAW_SIZE (regnum)); + } + return; + } + } + + /* If we get thru the loop to this point, it means the register was + not saved in any frame. Return the actual live-register value. */ + + if (lval) /* found it in a live register */ + *lval = lval_register; + if (addrp) + *addrp = REGISTER_BYTE (regnum); + if (raw_buffer) + read_register_gen (regnum, raw_buffer); +} +#endif /* USE_GENERIC_DUMMY_FRAMES */ + void _initialize_blockframe () { diff --git a/contrib/gdb/gdb/breakpoint.c b/contrib/gdb/gdb/breakpoint.c index 3930e7a..4b05949 100644 --- a/contrib/gdb/gdb/breakpoint.c +++ b/contrib/gdb/gdb/breakpoint.c @@ -1,5 +1,5 @@ /* Everything about breakpoints, for GDB. - Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 + Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. This file is part of GDB. @@ -30,14 +30,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "value.h" #include "command.h" #include "inferior.h" -#include "thread.h" +#include "gdbthread.h" #include "target.h" #include "language.h" #include "gdb_string.h" #include "demangle.h" #include "annotate.h" +#include "symfile.h" +#include "objfiles.h" -/* local function prototypes */ +/* Prototypes for local functions. */ static void catch_command_1 PARAMS ((char *, int, int)); @@ -66,11 +68,7 @@ map_breakpoint_numbers PARAMS ((char *, void (*)(struct breakpoint *))); static void ignore_command PARAMS ((char *, int)); -static int -breakpoint_re_set_one PARAMS ((char *)); - -static void -delete_command PARAMS ((char *, int)); +static int breakpoint_re_set_one PARAMS ((PTR)); static void clear_command PARAMS ((char *, int)); @@ -78,6 +76,9 @@ clear_command PARAMS ((char *, int)); static void catch_command PARAMS ((char *, int)); +static void +handle_gnu_4_16_catch_command PARAMS ((char *, int, int)); + static struct symtabs_and_lines get_catch_sals PARAMS ((int)); @@ -87,7 +88,7 @@ watch_command PARAMS ((char *, int)); static int can_use_hardware_watchpoint PARAMS ((struct value *)); -static void +void tbreak_command PARAMS ((char *, int)); static void @@ -96,14 +97,14 @@ break_command_1 PARAMS ((char *, int, int)); static void mention PARAMS ((struct breakpoint *)); -static struct breakpoint * +struct breakpoint * set_raw_breakpoint PARAMS ((struct symtab_and_line)); static void -check_duplicates PARAMS ((CORE_ADDR)); +check_duplicates PARAMS ((CORE_ADDR, asection *)); static void -describe_other_breakpoints PARAMS ((CORE_ADDR)); +describe_other_breakpoints PARAMS ((CORE_ADDR, asection *)); static void breakpoints_info PARAMS ((char *, int)); @@ -114,11 +115,10 @@ breakpoint_1 PARAMS ((int, int)); static bpstat bpstat_alloc PARAMS ((struct breakpoint *, bpstat)); -static int -breakpoint_cond_eval PARAMS ((char *)); +static int breakpoint_cond_eval PARAMS ((PTR)); static void -cleanup_executing_breakpoints PARAMS ((int)); +cleanup_executing_breakpoints PARAMS ((PTR)); static void commands_command PARAMS ((char *, int)); @@ -129,14 +129,83 @@ condition_command PARAMS ((char *, int)); static int get_number PARAMS ((char **)); -static void +void set_breakpoint_count PARAMS ((int)); +#if 0 +static struct breakpoint * +create_temp_exception_breakpoint PARAMS ((CORE_ADDR)); +#endif + +typedef enum { + mark_inserted, + mark_uninserted +} insertion_state_t; + static int -remove_breakpoint PARAMS ((struct breakpoint *)); +remove_breakpoint PARAMS ((struct breakpoint *, insertion_state_t)); + +static int print_it_normal PARAMS ((bpstat)); + +typedef struct { + enum exception_event_kind kind; + int enable; +} args_for_catchpoint_enable; + +static int watchpoint_check PARAMS ((PTR)); + +static int cover_target_enable_exception_callback PARAMS ((PTR)); + +static int print_it_done PARAMS ((bpstat)); + +static int print_it_noop PARAMS ((bpstat)); + +static void maintenance_info_breakpoints PARAMS ((char *, int)); + +#ifdef GET_LONGJMP_TARGET +static void create_longjmp_breakpoint PARAMS ((char *)); +#endif + +static int hw_breakpoint_used_count PARAMS ((void)); + +static int hw_watchpoint_used_count PARAMS ((enum bptype, int *)); + +static void hbreak_command PARAMS ((char *, int)); + +static void thbreak_command PARAMS ((char *, int)); + +static void watch_command_1 PARAMS ((char *, int, int)); + +static void rwatch_command PARAMS ((char *, int)); + +static void awatch_command PARAMS ((char *, int)); + +static void do_enable_breakpoint PARAMS ((struct breakpoint *, enum bpdisp)); + +/* Prototypes for exported functions. */ + +static void +awatch_command PARAMS ((char *, int)); + +static void +do_enable_breakpoint PARAMS ((struct breakpoint *, enum bpdisp)); + +/* If FALSE, gdb will not use hardware support for watchpoints, even + if such is available. */ +static int can_use_hw_watchpoints; + +void delete_command PARAMS ((char *, int)); + +void _initialize_breakpoint PARAMS ((void)); + +void set_breakpoint_count PARAMS ((int)); extern int addressprint; /* Print machine addresses? */ +#if defined (GET_LONGJMP_TARGET) || defined (SOLIB_ADD) +static int internal_breakpoint_number = -1; +#endif + /* Are we executing breakpoint commands? */ static int executing_breakpoint_commands; @@ -151,6 +220,16 @@ static int executing_breakpoint_commands; b? (tmp=b->next, 1): 0; \ b = tmp) +/* True if SHIFT_INST_REGS defined, false otherwise. */ + +int must_shift_inst_regs = +#if defined(SHIFT_INST_REGS) +1 +#else +0 +#endif +; + /* True if breakpoint hit counts should be displayed in breakpoint info. */ int show_breakpoint_hit_counts = 1; @@ -161,11 +240,75 @@ struct breakpoint *breakpoint_chain; /* Number of last breakpoint made. */ -static int breakpoint_count; +int breakpoint_count; + +/* Pointer to current exception event record */ +static struct exception_event_record * current_exception_event; + +/* Indicator of whether exception catchpoints should be nuked + between runs of a program */ +int exception_catchpoints_are_fragile = 0; + +/* Indicator of when exception catchpoints set-up should be + reinitialized -- e.g. when program is re-run */ +int exception_support_initialized = 0; + +/* This function returns a pointer to the string representation of the + pathname of the dynamically-linked library that has just been + loaded. + + This function must be used only when SOLIB_HAVE_LOAD_EVENT is TRUE, + or undefined results are guaranteed. + + This string's contents are only valid immediately after the + inferior has stopped in the dynamic linker hook, and becomes + invalid as soon as the inferior is continued. Clients should make + a copy of this string if they wish to continue the inferior and + then access the string. */ + +#ifndef SOLIB_LOADED_LIBRARY_PATHNAME +#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) "" +#endif + +/* This function returns a pointer to the string representation of the + pathname of the dynamically-linked library that has just been + unloaded. + + This function must be used only when SOLIB_HAVE_UNLOAD_EVENT is + TRUE, or undefined results are guaranteed. + + This string's contents are only valid immediately after the + inferior has stopped in the dynamic linker hook, and becomes + invalid as soon as the inferior is continued. Clients should make + a copy of this string if they wish to continue the inferior and + then access the string. */ + +#ifndef SOLIB_UNLOADED_LIBRARY_PATHNAME +#define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) "" +#endif + +/* This function is called by the "catch load" command. It allows the + debugger to be notified by the dynamic linker when a specified + library file (or any library file, if filename is NULL) is loaded. */ + +#ifndef SOLIB_CREATE_CATCH_LOAD_HOOK +#define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag,filename,cond_string) \ + error ("catch of library loads not yet implemented on this platform") +#endif + +/* This function is called by the "catch unload" command. It allows + the debugger to be notified by the dynamic linker when a specified + library file (or any library file, if filename is NULL) is + unloaded. */ + +#ifndef SOLIB_CREATE_CATCH_UNLOAD_HOOK +#define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename,cond_string) \ + error ("catch of library unloads not yet implemented on this platform") +#endif /* Set breakpoint count to NUM. */ -static void +void set_breakpoint_count (num) int num; { @@ -330,10 +473,9 @@ commands_command (arg, from_tty) ALL_BREAKPOINTS (b) if (b->number == bnum) { - if (from_tty && input_from_terminal_p ()) - printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\ -End with a line saying just \"end\".\n", bnum); - l = read_command_lines (); + char tmpbuf[128]; + sprintf (tmpbuf, "Type commands for when breakpoint %d is hit, one per line.", bnum); + l = read_command_lines (tmpbuf, from_tty); free_command_lines (&b->commands); b->commands = l; breakpoints_changed (); @@ -342,8 +484,6 @@ End with a line saying just \"end\".\n", bnum); error ("No breakpoint number %d.", bnum); } -extern int memory_breakpoint_size; /* from mem-break.c */ - /* Like target_read_memory() but if breakpoints are inserted, return the shadow contents instead of the breakpoints themselves. @@ -360,84 +500,96 @@ read_memory_nobpt (memaddr, myaddr, len) { int status; struct breakpoint *b; + CORE_ADDR bp_addr = 0; + int bp_size = 0; - if (memory_breakpoint_size < 0) - /* No breakpoints on this machine. FIXME: This should be - dependent on the debugging target. Probably want - target_insert_breakpoint to return a size, saying how many - bytes of the shadow contents are used, or perhaps have - something like target_xfer_shadow. */ + if (BREAKPOINT_FROM_PC (&bp_addr, &bp_size) == NULL) + /* No breakpoints on this machine. */ return target_read_memory (memaddr, myaddr, len); ALL_BREAKPOINTS (b) { + if (b->type == bp_none) + warning ("attempted to read through apparently deleted breakpoint #%d?\n", b->number); + + /* memory breakpoint? */ if (b->type == bp_watchpoint || b->type == bp_hardware_watchpoint || b->type == bp_read_watchpoint - || b->type == bp_access_watchpoint - || !b->inserted) + || b->type == bp_access_watchpoint) continue; - else if (b->address + memory_breakpoint_size <= memaddr) - /* The breakpoint is entirely before the chunk of memory - we are reading. */ + /* bp in memory? */ + if (!b->inserted) continue; - else if (b->address >= memaddr + len) - /* The breakpoint is entirely after the chunk of memory we + /* Addresses and length of the part of the breakpoint that + we need to copy. */ + /* XXXX The m68k, sh and h8300 have different local and remote + breakpoint values. BREAKPOINT_FROM_PC still manages to + correctly determine the breakpoints memory address and size + for these targets. */ + bp_addr = b->address; + bp_size = 0; + if (BREAKPOINT_FROM_PC (&bp_addr, &bp_size) == NULL) + continue; + if (bp_size == 0) + /* bp isn't valid */ + continue; + if (bp_addr + bp_size <= memaddr) + /* The breakpoint is entirely before the chunk of memory we are reading. */ continue; - else - { - /* Copy the breakpoint from the shadow contents, and recurse - for the things before and after. */ - - /* Addresses and length of the part of the breakpoint that - we need to copy. */ - CORE_ADDR membpt = b->address; - unsigned int bptlen = memory_breakpoint_size; - /* Offset within shadow_contents. */ - int bptoffset = 0; + if (bp_addr >= memaddr + len) + /* The breakpoint is entirely after the chunk of memory we are + reading. */ + continue; + /* Copy the breakpoint from the shadow contents, and recurse for + the things before and after. */ + { + /* Offset within shadow_contents. */ + int bptoffset = 0; - if (membpt < memaddr) - { - /* Only copy the second part of the breakpoint. */ - bptlen -= memaddr - membpt; - bptoffset = memaddr - membpt; - membpt = memaddr; - } - - if (membpt + bptlen > memaddr + len) - { - /* Only copy the first part of the breakpoint. */ - bptlen -= (membpt + bptlen) - (memaddr + len); - } - - memcpy (myaddr + membpt - memaddr, - b->shadow_contents + bptoffset, bptlen); - - if (membpt > memaddr) - { - /* Copy the section of memory before the breakpoint. */ - status = read_memory_nobpt (memaddr, myaddr, membpt - memaddr); - if (status != 0) - return status; - } - - if (membpt + bptlen < memaddr + len) - { - /* Copy the section of memory after the breakpoint. */ - status = read_memory_nobpt - (membpt + bptlen, - myaddr + membpt + bptlen - memaddr, - memaddr + len - (membpt + bptlen)); - if (status != 0) - return status; - } - return 0; - } + if (bp_addr < memaddr) + { + /* Only copy the second part of the breakpoint. */ + bp_size -= memaddr - bp_addr; + bptoffset = memaddr - bp_addr; + bp_addr = memaddr; + } + + if (bp_addr + bp_size > memaddr + len) + { + /* Only copy the first part of the breakpoint. */ + bp_size -= (bp_addr + bp_size) - (memaddr + len); + } + + memcpy (myaddr + bp_addr - memaddr, + b->shadow_contents + bptoffset, bp_size); + + if (bp_addr > memaddr) + { + /* Copy the section of memory before the breakpoint. */ + status = read_memory_nobpt (memaddr, myaddr, bp_addr - memaddr); + if (status != 0) + return status; + } + + if (bp_addr + bp_size < memaddr + len) + { + /* Copy the section of memory after the breakpoint. */ + status = read_memory_nobpt + (bp_addr + bp_size, + myaddr + bp_addr + bp_size - memaddr, + memaddr + len - (bp_addr + bp_size)); + if (status != 0) + return status; + } + return 0; + } } /* Nothing overlaps. Just call read_memory_noerr. */ return target_read_memory (memaddr, myaddr, len); } + /* insert_breakpoints is used when starting or continuing the program. remove_breakpoints is used when the program stops. @@ -451,138 +603,258 @@ insert_breakpoints () int val = 0; int disabled_breaks = 0; + static char message1[] = "Error inserting catchpoint %d:\n"; + static char message[sizeof (message1) + 30]; + + ALL_BREAKPOINTS_SAFE (b, temp) - if (b->type != bp_watchpoint - && b->type != bp_hardware_watchpoint - && b->type != bp_read_watchpoint - && b->type != bp_access_watchpoint - && b->enable != disabled - && b->enable != shlib_disabled - && ! b->inserted - && ! b->duplicate) - { - if (b->type == bp_hardware_breakpoint) - val = target_insert_hw_breakpoint(b->address, b->shadow_contents); - else - val = target_insert_breakpoint(b->address, b->shadow_contents); - if (val) - { - /* Can't set the breakpoint. */ + { + if (b->type != bp_watchpoint + && b->type != bp_hardware_watchpoint + && b->type != bp_read_watchpoint + && b->type != bp_access_watchpoint + && b->type != bp_catch_fork + && b->type != bp_catch_vfork + && b->type != bp_catch_exec + && b->type != bp_catch_throw + && b->type != bp_catch_catch + && b->enable != disabled + && b->enable != shlib_disabled + && b->enable != call_disabled + && ! b->inserted + && ! b->duplicate) + { + if (b->type == bp_hardware_breakpoint) + val = target_insert_hw_breakpoint(b->address, b->shadow_contents); + else + { + /* Check to see if breakpoint is in an overlay section; + if so, we should set the breakpoint at the LMA address. + Only if the section is currently mapped should we ALSO + set a break at the VMA address. */ + if (overlay_debugging && b->section && + section_is_overlay (b->section)) + { + CORE_ADDR addr; + + addr = overlay_unmapped_address (b->address, b->section); + val = target_insert_breakpoint (addr, b->shadow_contents); + /* This would be the time to check val, to see if the + breakpoint write to the load address succeeded. + However, this might be an ordinary occurrance, eg. if + the unmapped overlay is in ROM. */ + val = 0; /* in case unmapped address failed */ + if (section_is_mapped (b->section)) + val = target_insert_breakpoint (b->address, + b->shadow_contents); + } + else /* ordinary (non-overlay) address */ + val = target_insert_breakpoint(b->address, b->shadow_contents); + } + if (val) + { + /* Can't set the breakpoint. */ #if defined (DISABLE_UNSETTABLE_BREAK) - if (DISABLE_UNSETTABLE_BREAK (b->address)) + if (DISABLE_UNSETTABLE_BREAK (b->address)) + { + /* See also: disable_breakpoints_in_shlibs. */ + val = 0; + b->enable = shlib_disabled; + if (!disabled_breaks) + { + target_terminal_ours_for_output (); + fprintf_unfiltered (gdb_stderr, + "Cannot insert breakpoint %d:\n", b->number); + printf_filtered ("Temporarily disabling shared library breakpoints:\n"); + } + disabled_breaks = 1; + printf_filtered ("%d ", b->number); + } + else +#endif + { + target_terminal_ours_for_output (); + fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number); +#ifdef ONE_PROCESS_WRITETEXT + fprintf_unfiltered (gdb_stderr, + "The same program may be running in another process.\n"); +#endif + memory_error (val, b->address); /* which bombs us out */ + } + } + else + b->inserted = 1; + } + else if (ep_is_exception_catchpoint (b) + && b->enable != disabled + && b->enable != shlib_disabled + && b->enable != call_disabled + && ! b->inserted + && ! b->duplicate) + + { + /* If we get here, we must have a callback mechanism for exception + events -- with g++ style embedded label support, we insert + ordinary breakpoints and not catchpoints. */ + sprintf (message, message1, b->number); /* Format possible error message */ + + val = target_insert_breakpoint(b->address, b->shadow_contents); + if (val) + { + /* Couldn't set breakpoint for some reason */ + target_terminal_ours_for_output (); + fprintf_unfiltered (gdb_stderr, + "Cannot insert catchpoint %d; disabling it\n", b->number); + b->enable = disabled; + } + else + { + /* Bp set, now make sure callbacks are enabled */ + int val; + args_for_catchpoint_enable args; + args.kind = b->type == bp_catch_catch ? EX_EVENT_CATCH : EX_EVENT_THROW; + args.enable = 1; + val = catch_errors (cover_target_enable_exception_callback, + &args, + message, RETURN_MASK_ALL); + if (val != 0 && val != -1) { - val = 0; - b->enable = shlib_disabled; - if (!disabled_breaks) - { - target_terminal_ours_for_output (); - fprintf_unfiltered (gdb_stderr, - "Cannot insert breakpoint %d:\n", b->number); - printf_filtered ("Temporarily disabling shared library breakpoints:\n"); - } - disabled_breaks = 1; - printf_filtered ("%d ", b->number); + b->inserted = 1; } - else -#endif + /* Check if something went wrong; val == 0 can be ignored */ + if (val == -1) { + /* something went wrong */ target_terminal_ours_for_output (); - fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number); -#ifdef ONE_PROCESS_WRITETEXT - fprintf_unfiltered (gdb_stderr, - "The same program may be running in another process.\n"); -#endif - memory_error (val, b->address); /* which bombs us out */ + fprintf_unfiltered (gdb_stderr, "Cannot insert catchpoint %d; disabling it\n", b->number); + b->enable = disabled; } - } - else - b->inserted = 1; + } } - else if ((b->type == bp_hardware_watchpoint || - b->type == bp_read_watchpoint || - b->type == bp_access_watchpoint) - && b->enable == enabled - && ! b->inserted - && ! b->duplicate) - { - struct frame_info *saved_frame; - int saved_level, within_current_scope; - value_ptr mark = value_mark (); - value_ptr v; - - /* Save the current frame and level so we can restore it after - evaluating the watchpoint expression on its own frame. */ - saved_frame = selected_frame; - saved_level = selected_frame_level; - - /* Determine if the watchpoint is within scope. */ - if (b->exp_valid_block == NULL) - within_current_scope = 1; - else - { - struct frame_info *fi = - find_frame_addr_in_frame_chain (b->watchpoint_frame); - within_current_scope = (fi != NULL); - if (within_current_scope) - select_frame (fi, -1); - } + + else if ((b->type == bp_hardware_watchpoint || + b->type == bp_read_watchpoint || + b->type == bp_access_watchpoint) + && b->enable == enabled + && ! b->inserted + && ! b->duplicate) + { + struct frame_info *saved_frame; + int saved_level, within_current_scope; + value_ptr mark = value_mark (); + value_ptr v; + + /* Save the current frame and level so we can restore it after + evaluating the watchpoint expression on its own frame. */ + saved_frame = selected_frame; + saved_level = selected_frame_level; + + /* Determine if the watchpoint is within scope. */ + if (b->exp_valid_block == NULL) + within_current_scope = 1; + else + { + struct frame_info *fi; + + /* There might be no current frame at this moment if we are + resuming from a step over a breakpoint. + Set up current frame before trying to find the watchpoint + frame. */ + get_current_frame (); + fi = find_frame_addr_in_frame_chain (b->watchpoint_frame); + within_current_scope = (fi != NULL); + if (within_current_scope) + select_frame (fi, -1); + } - if (within_current_scope) - { - /* Evaluate the expression and cut the chain of values - produced off from the value chain. */ - v = evaluate_expression (b->exp); - value_release_to_mark (mark); + if (within_current_scope) + { + /* Evaluate the expression and cut the chain of values + produced off from the value chain. */ + v = evaluate_expression (b->exp); + value_release_to_mark (mark); - b->val_chain = v; - b->inserted = 1; + b->val_chain = v; + b->inserted = 1; - /* Look at each value on the value chain. */ - for ( ; v; v=v->next) - { - /* If it's a memory location, then we must watch it. */ - if (v->lval == lval_memory) - { - int addr, len, type; + /* Look at each value on the value chain. */ + for ( ; v; v=v->next) + { + /* If it's a memory location, then we must watch it. */ + if (v->lval == lval_memory) + { + int addr, len, type; - addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v); - len = TYPE_LENGTH (VALUE_TYPE (v)); - type = 0; - if (b->type == bp_read_watchpoint) - type = 1; - else if (b->type == bp_access_watchpoint) - type = 2; - - val = target_insert_watchpoint (addr, len, type); - if (val == -1) - { - b->inserted = 0; - break; - } - val = 0; - } - } - /* Failure to insert a watchpoint on any memory value in the - value chain brings us here. */ - if (!b->inserted) - warning ("Hardware watchpoint %d: Could not insert watchpoint\n", - b->number); - } - else - { - printf_filtered ("\ + addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v); + len = TYPE_LENGTH (VALUE_TYPE (v)); + type = 0; + if (b->type == bp_read_watchpoint) + type = 1; + else if (b->type == bp_access_watchpoint) + type = 2; + + val = target_insert_watchpoint (addr, len, type); + if (val == -1) + { + b->inserted = 0; + break; + } + val = 0; + } + } + /* Failure to insert a watchpoint on any memory value in the + value chain brings us here. */ + if (!b->inserted) + warning ("Hardware watchpoint %d: Could not insert watchpoint\n", + b->number); + } + else + { + printf_filtered ("\ Hardware watchpoint %d deleted because the program has left the block in\n\ which its expression is valid.\n", b->number); - if (b->related_breakpoint) - delete_breakpoint (b->related_breakpoint); - delete_breakpoint (b); - } + if (b->related_breakpoint) + b->related_breakpoint->disposition = del_at_next_stop; + b->disposition = del_at_next_stop; + } - /* Restore the frame and level. */ - select_frame (saved_frame, saved_level); - } + /* Restore the frame and level. */ + if ((saved_frame != selected_frame) || + (saved_level != selected_frame_level)) + select_and_print_frame (saved_frame, saved_level); + } + else if ((b->type == bp_catch_fork + || b->type == bp_catch_vfork + || b->type == bp_catch_exec) + && b->enable == enabled + && ! b->inserted + && ! b->duplicate) + { + val = -1; + switch (b->type) + { + case bp_catch_fork : + val = target_insert_fork_catchpoint (inferior_pid); + break; + case bp_catch_vfork : + val = target_insert_vfork_catchpoint (inferior_pid); + break; + case bp_catch_exec : + val = target_insert_exec_catchpoint (inferior_pid); + break; + } + if (val < 0) + { + target_terminal_ours_for_output (); + fprintf_unfiltered (gdb_stderr, "Cannot insert catchpoint %d:\n", b->number); + } + else + b->inserted = 1; + } + } if (disabled_breaks) printf_filtered ("\n"); + return val; } @@ -597,7 +869,7 @@ remove_breakpoints () { if (b->inserted) { - val = remove_breakpoint (b); + val = remove_breakpoint (b, mark_uninserted); if (val != 0) return val; } @@ -605,25 +877,220 @@ remove_breakpoints () return 0; } +int +reattach_breakpoints (pid) + int pid; +{ + register struct breakpoint *b; + int val; + int saved_inferior_pid = inferior_pid; + + inferior_pid = pid; /* Because remove_breakpoint will use this global. */ + ALL_BREAKPOINTS (b) + { + if (b->inserted) + { + remove_breakpoint (b, mark_inserted); + if (b->type == bp_hardware_breakpoint) + val = target_insert_hw_breakpoint(b->address, b->shadow_contents); + else + val = target_insert_breakpoint(b->address, b->shadow_contents); + if (val != 0) + { + inferior_pid = saved_inferior_pid; + return val; + } + } + } + inferior_pid = saved_inferior_pid; + return 0; +} + +void +update_breakpoints_after_exec () +{ + struct breakpoint * b; + struct breakpoint * temp; + + /* Doing this first prevents the badness of having delete_breakpoint() + write a breakpoint's current "shadow contents" to lift the bp. That + shadow is NOT valid after an exec()! */ + mark_breakpoints_out (); + + ALL_BREAKPOINTS_SAFE (b, temp) + { + /* Solib breakpoints must be explicitly reset after an exec(). */ + if (b->type == bp_shlib_event) + { + delete_breakpoint (b); + continue; + } + + /* Step-resume breakpoints are meaningless after an exec(). */ + if (b->type == bp_step_resume) + { + delete_breakpoint (b); + continue; + } + + /* Ditto the sigtramp handler breakpoints. */ + if (b->type == bp_through_sigtramp) + { + delete_breakpoint (b); + continue; + } + + /* Ditto the exception-handling catchpoints. */ + if ((b->type == bp_catch_catch) || (b->type == bp_catch_throw)) + { + delete_breakpoint (b); + continue; + } + + /* Don't delete an exec catchpoint, because else the inferior + won't stop when it ought! + + Similarly, we probably ought to keep vfork catchpoints, 'cause + on this target, we may not be able to stop when the vfork is seen, + but only when the subsequent exec is seen. (And because deleting + fork catchpoints here but not vfork catchpoints will seem mysterious + to users, keep those too.) + + ??rehrauer: Let's hope that merely clearing out this catchpoint's + target address field, if any, is sufficient to have it be reset + automagically. Certainly on HP-UX that's true. */ + if ((b->type == bp_catch_exec) || + (b->type == bp_catch_vfork) || + (b->type == bp_catch_fork)) + { + b->address = (CORE_ADDR) NULL; + continue; + } + + /* bp_finish is a special case. The only way we ought to be able + to see one of these when an exec() has happened, is if the user + caught a vfork, and then said "finish". Ordinarily a finish just + carries them to the call-site of the current callee, by setting + a temporary bp there and resuming. But in this case, the finish + will carry them entirely through the vfork & exec. + + We don't want to allow a bp_finish to remain inserted now. But + we can't safely delete it, 'cause finish_command has a handle to + the bp on a bpstat, and will later want to delete it. There's a + chance (and I've seen it happen) that if we delete the bp_finish + here, that its storage will get reused by the time finish_command + gets 'round to deleting the "use to be a bp_finish" breakpoint. + We really must allow finish_command to delete a bp_finish. + + In the absense of a general solution for the "how do we know it's + safe to delete something others may have handles to?" problem, what + we'll do here is just uninsert the bp_finish, and let finish_command + delete it. + + (We know the bp_finish is "doomed" in the sense that it's momentary, + and will be deleted as soon as finish_command sees the inferior stopped. + So it doesn't matter that the bp's address is probably bogus in the + new a.out, unlike e.g., the solib breakpoints.) */ + if (b->type == bp_finish) + { + continue; + } + + /* Without a symbolic address, we have little hope of the + pre-exec() address meaning the same thing in the post-exec() + a.out. */ + if (b->addr_string == NULL) + { + delete_breakpoint (b); + continue; + } + + /* If this breakpoint has survived the above battery of checks, then + it must have a symbolic address. Be sure that it gets reevaluated + to a target address, rather than reusing the old evaluation. */ + b->address = (CORE_ADDR) NULL; + } +} + +int +detach_breakpoints (pid) + int pid; +{ + register struct breakpoint *b; + int val; + int saved_inferior_pid = inferior_pid; + + if (pid == inferior_pid) + error ("Cannot detach breakpoints of inferior_pid"); + + inferior_pid = pid; /* Because remove_breakpoint will use this global. */ + ALL_BREAKPOINTS (b) + { + if (b->inserted) + { + val = remove_breakpoint (b, mark_inserted); + if (val != 0) + { + inferior_pid = saved_inferior_pid; + return val; + } + } + } + inferior_pid = saved_inferior_pid; + return 0; +} static int -remove_breakpoint (b) +remove_breakpoint (b, is) struct breakpoint *b; + insertion_state_t is; { int val; + if (b->type == bp_none) + warning ("attempted to remove apparently deleted breakpoint #%d?\n", b->number); + if (b->type != bp_watchpoint && b->type != bp_hardware_watchpoint && b->type != bp_read_watchpoint - && b->type != bp_access_watchpoint) + && b->type != bp_access_watchpoint + && b->type != bp_catch_fork + && b->type != bp_catch_vfork + && b->type != bp_catch_exec + && b->type != bp_catch_catch + && b->type != bp_catch_throw) + { if (b->type == bp_hardware_breakpoint) val = target_remove_hw_breakpoint(b->address, b->shadow_contents); else - val = target_remove_breakpoint(b->address, b->shadow_contents); + { + /* Check to see if breakpoint is in an overlay section; + if so, we should remove the breakpoint at the LMA address. + If that is not equal to the raw address, then we should + presumable remove the breakpoint there as well. */ + if (overlay_debugging && b->section && + section_is_overlay (b->section)) + { + CORE_ADDR addr; + + addr = overlay_unmapped_address (b->address, b->section); + val = target_remove_breakpoint (addr, b->shadow_contents); + /* This would be the time to check val, to see if the + shadow breakpoint write to the load address succeeded. + However, this might be an ordinary occurrance, eg. if + the unmapped overlay is in ROM. */ + val = 0; /* in case unmapped address failed */ + if (section_is_mapped (b->section)) + val = target_remove_breakpoint (b->address, + b->shadow_contents); + } + else /* ordinary (non-overlay) address */ + val = target_remove_breakpoint(b->address, b->shadow_contents); + } if (val) return val; - b->inserted = 0; + b->inserted = (is == mark_inserted); } else if ((b->type == bp_hardware_watchpoint || b->type == bp_read_watchpoint || @@ -633,7 +1100,7 @@ remove_breakpoint (b) { value_ptr v, n; - b->inserted = 0; + b->inserted = (is == mark_inserted); /* Walk down the saved value chain. */ for (v = b->val_chain; v; v = v->next) { @@ -641,18 +1108,24 @@ remove_breakpoint (b) at that address. */ if (v->lval == lval_memory) { - int addr, len; + int addr, len, type; addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v); len = TYPE_LENGTH (VALUE_TYPE (v)); - val = target_remove_watchpoint (addr, len, b->type); + type = 0; + if (b->type == bp_read_watchpoint) + type = 1; + else if (b->type == bp_access_watchpoint) + type = 2; + + val = target_remove_watchpoint (addr, len, type); if (val == -1) b->inserted = 1; val = 0; } } /* Failure to remove any of the hardware watchpoints comes here. */ - if (b->inserted) + if ((is == mark_uninserted) && (b->inserted)) warning ("Hardware watchpoint %d: Could not remove watchpoint\n", b->number); @@ -665,6 +1138,53 @@ remove_breakpoint (b) } b->val_chain = NULL; } + else if ((b->type == bp_catch_fork || + b->type == bp_catch_vfork || + b->type == bp_catch_exec) + && b->enable == enabled + && ! b->duplicate) + { + val = -1; + switch (b->type) + { + case bp_catch_fork: + val = target_remove_fork_catchpoint (inferior_pid); + break; + case bp_catch_vfork : + val = target_remove_vfork_catchpoint (inferior_pid); + break; + case bp_catch_exec : + val = target_remove_exec_catchpoint (inferior_pid); + break; + } + if (val) + return val; + b->inserted = (is == mark_inserted); + } + else if ((b->type == bp_catch_catch || + b->type == bp_catch_throw) + && b->enable == enabled + && ! b->duplicate) + { + + val = target_remove_breakpoint(b->address, b->shadow_contents); + if (val) + return val; + b->inserted = (is == mark_inserted); + } + else if (ep_is_exception_catchpoint (b) + && b->inserted /* sometimes previous insert doesn't happen */ + && b->enable == enabled + && ! b->duplicate) + { + + val = target_remove_breakpoint(b->address, b->shadow_contents); + if (val) + return val; + + b->inserted = (is == mark_inserted); + } + return 0; } @@ -680,33 +1200,71 @@ mark_breakpoints_out () } /* Clear the "inserted" flag in all breakpoints and delete any breakpoints - which should go away between runs of the program. */ + which should go away between runs of the program. + + Plus other such housekeeping that has to be done for breakpoints + between runs. + + Note: this function gets called at the end of a run (by generic_mourn_inferior) + and when a run begins (by init_wait_for_inferior). */ + + void -breakpoint_init_inferior () +breakpoint_init_inferior (context) + enum inf_context context; { register struct breakpoint *b, *temp; + static int warning_needed = 0; ALL_BREAKPOINTS_SAFE (b, temp) { b->inserted = 0; - /* If the call dummy breakpoint is at the entry point it will - cause problems when the inferior is rerun, so we better - get rid of it. */ - if (b->type == bp_call_dummy) - delete_breakpoint (b); + switch (b->type) + { + case bp_call_dummy: + case bp_watchpoint_scope: - /* Likewise for scope breakpoints. */ - if (b->type == bp_watchpoint_scope) - delete_breakpoint (b); + /* If the call dummy breakpoint is at the entry point it will + cause problems when the inferior is rerun, so we better + get rid of it. - /* Likewise for watchpoints on local expressions. */ - if ((b->type == bp_watchpoint || b->type == bp_hardware_watchpoint || - b->type == bp_read_watchpoint || b->type == bp_access_watchpoint) - && b->exp_valid_block != NULL) - delete_breakpoint (b); + Also get rid of scope breakpoints. */ + delete_breakpoint (b); + break; + + case bp_watchpoint: + case bp_hardware_watchpoint: + case bp_read_watchpoint: + case bp_access_watchpoint: + + /* Likewise for watchpoints on local expressions. */ + if (b->exp_valid_block != NULL) + delete_breakpoint (b); + break; + default: + /* Likewise for exception catchpoints in dynamic-linked + executables where required */ + if (ep_is_exception_catchpoint (b) && + exception_catchpoints_are_fragile) + { + warning_needed = 1; + delete_breakpoint (b); + } + break; + } } + + if (exception_catchpoints_are_fragile) + exception_support_initialized = 0; + + /* Don't issue the warning unless it's really needed... */ + if (warning_needed && (context != inf_exited)) + { + warning ("Exception catchpoints from last run were deleted, you must reinsert them explicitly"); + warning_needed = 0; + } } /* breakpoint_here_p (PC) returns 1 if an enabled breakpoint exists at PC. @@ -720,10 +1278,42 @@ breakpoint_here_p (pc) register struct breakpoint *b; ALL_BREAKPOINTS (b) - if (b->enable != disabled + if (b->enable == enabled && b->enable != shlib_disabled - && b->address == pc) - return 1; + && b->enable != call_disabled + && b->address == pc) /* bp is enabled and matches pc */ + { + if (overlay_debugging && + section_is_overlay (b->section) && + !section_is_mapped (b->section)) + continue; /* unmapped overlay -- can't be a match */ + else + return 1; + } + + return 0; +} + +/* breakpoint_inserted_here_p (PC) is just like breakpoint_here_p(), but it + only returns true if there is actually a breakpoint inserted at PC. */ + +int +breakpoint_inserted_here_p (pc) + CORE_ADDR pc; +{ + register struct breakpoint *b; + + ALL_BREAKPOINTS (b) + if (b->inserted + && b->address == pc) /* bp is inserted and matches pc */ + { + if (overlay_debugging && + section_is_overlay (b->section) && + !section_is_mapped (b->section)) + continue; /* unmapped overlay -- can't be a match */ + else + return 1; + } return 0; } @@ -737,12 +1327,15 @@ int frame_in_dummy (frame) struct frame_info *frame; { +#ifdef CALL_DUMMY +#ifdef USE_GENERIC_DUMMY_FRAMES + return generic_pc_in_call_dummy (frame->pc, frame->frame); +#else struct breakpoint *b; -#ifdef CALL_DUMMY ALL_BREAKPOINTS (b) { - static unsigned LONGEST dummy[] = CALL_DUMMY; + static ULONGEST dummy[] = CALL_DUMMY; if (b->type == bp_call_dummy && b->frame == frame->frame @@ -755,6 +1348,7 @@ frame_in_dummy (frame) && frame->pc <= b->address) return 1; } +#endif /* GENERIC_DUMMY_FRAMES */ #endif /* CALL_DUMMY */ return 0; } @@ -775,9 +1369,17 @@ breakpoint_thread_match (pc, pid) ALL_BREAKPOINTS (b) if (b->enable != disabled && b->enable != shlib_disabled + && b->enable != call_disabled && b->address == pc && (b->thread == -1 || b->thread == thread)) - return 1; + { + if (overlay_debugging && + section_is_overlay (b->section) && + !section_is_mapped (b->section)) + continue; /* unmapped overlay -- can't be a match */ + else + return 1; + } return 0; } @@ -786,6 +1388,44 @@ breakpoint_thread_match (pc, pid) /* bpstat stuff. External routines' interfaces are documented in breakpoint.h. */ +int +ep_is_catchpoint (ep) + struct breakpoint * ep; +{ + return + (ep->type == bp_catch_load) + || (ep->type == bp_catch_unload) + || (ep->type == bp_catch_fork) + || (ep->type == bp_catch_vfork) + || (ep->type == bp_catch_exec) + || (ep->type == bp_catch_catch) + || (ep->type == bp_catch_throw) + + + /* ??rehrauer: Add more kinds here, as are implemented... */ + ; +} + +int +ep_is_shlib_catchpoint (ep) + struct breakpoint * ep; +{ + return + (ep->type == bp_catch_load) + || (ep->type == bp_catch_unload) + ; +} + +int +ep_is_exception_catchpoint (ep) + struct breakpoint * ep; +{ + return + (ep->type == bp_catch_catch) + || (ep->type == bp_catch_throw) + ; +} + /* Clear a bpstat so that it says we are not at any breakpoint. Also free any storage that is part of a bpstat. */ @@ -854,6 +1494,32 @@ bpstat_find_breakpoint(bsp, breakpoint) return NULL; } +/* Find a step_resume breakpoint associated with this bpstat. + (If there are multiple step_resume bp's on the list, this function + will arbitrarily pick one.) + + It is an error to use this function if BPSTAT doesn't contain a + step_resume breakpoint. + + See wait_for_inferior's use of this function. */ +struct breakpoint * +bpstat_find_step_resume_breakpoint (bsp) + bpstat bsp; +{ + if (bsp == NULL) + error ("Internal error (bpstat_find_step_resume_breakpoint)"); + + for (; bsp != NULL; bsp = bsp->next) + { + if ((bsp->breakpoint_at != NULL) && + (bsp->breakpoint_at->type == bp_step_resume)) + return bsp->breakpoint_at; + } + + error ("Internal error (no step_resume breakpoint found)"); +} + + /* Return the breakpoint number of the first breakpoint we are stopped at. *BSP upon return is a bpstat which points to the remaining breakpoints stopped at (but which is not guaranteed to be good for @@ -900,7 +1566,7 @@ bpstat_clear_actions (bs) /* ARGSUSED */ static void cleanup_executing_breakpoints (ignore) - int ignore; + PTR ignore; { executing_breakpoint_commands = 0; } @@ -918,10 +1584,24 @@ bpstat_do_actions (bsp) struct cleanup *old_chain; struct command_line *cmd; + /* Avoid endless recursion if a `source' command is contained + in bs->commands. */ + if (executing_breakpoint_commands) + return; + executing_breakpoint_commands = 1; old_chain = make_cleanup (cleanup_executing_breakpoints, 0); top: + /* Note that (as of this writing), our callers all appear to + be passing us the address of global stop_bpstat. And, if + our calls to execute_control_command cause the inferior to + proceed, that global (and hence, *bsp) will change. + + We must be careful to not touch *bsp unless the inferior + has not proceeded. */ + + /* This pointer will iterate over the list of bpstat's. */ bs = *bsp; breakpoint_proceeded = 0; @@ -931,7 +1611,11 @@ top: while (cmd != NULL) { execute_control_command (cmd); - cmd = cmd->next; + + if (breakpoint_proceeded) + break; + else + cmd = cmd->next; } if (breakpoint_proceeded) /* The inferior is proceeded by the command; bomb out now. @@ -949,7 +1633,21 @@ top: /* This is the normal print_it function for a bpstat. In the future, much of this logic could (should?) be moved to bpstat_stop_status, - by having it set different print_it functions. */ + by having it set different print_it functions. + + Current scheme: When we stop, bpstat_print() is called. + It loops through the bpstat list of things causing this stop, + calling the print_it function for each one. The default + print_it function, used for breakpoints, is print_it_normal(). + (Also see print_it_noop() and print_it_done()). + + Return values from this routine (used by bpstat_print() to + decide what to do): + 1: Means we printed something, and we do *not* desire that + something to be followed by a location. + 0: Means we printed something, and we *do* desire that + something to be followed by a location. + -1: Means we printed nothing. */ static int print_it_normal (bs) @@ -959,14 +1657,113 @@ print_it_normal (bs) which has since been deleted. */ if (bs->breakpoint_at == NULL || (bs->breakpoint_at->type != bp_breakpoint + && bs->breakpoint_at->type != bp_catch_load + && bs->breakpoint_at->type != bp_catch_unload + && bs->breakpoint_at->type != bp_catch_fork + && bs->breakpoint_at->type != bp_catch_vfork + && bs->breakpoint_at->type != bp_catch_exec + && bs->breakpoint_at->type != bp_catch_catch + && bs->breakpoint_at->type != bp_catch_throw && bs->breakpoint_at->type != bp_hardware_breakpoint && bs->breakpoint_at->type != bp_watchpoint && bs->breakpoint_at->type != bp_read_watchpoint && bs->breakpoint_at->type != bp_access_watchpoint && bs->breakpoint_at->type != bp_hardware_watchpoint)) - return 0; + return -1; + + if (ep_is_shlib_catchpoint (bs->breakpoint_at)) + { + annotate_catchpoint (bs->breakpoint_at->number); + printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number); + if (bs->breakpoint_at->type == bp_catch_load) + printf_filtered ("loaded"); + else if (bs->breakpoint_at->type == bp_catch_unload) + printf_filtered ("unloaded"); + printf_filtered (" %s), ", bs->breakpoint_at->triggered_dll_pathname); + return 0; + } + else if (bs->breakpoint_at->type == bp_catch_fork || + bs->breakpoint_at->type == bp_catch_vfork) + { + annotate_catchpoint (bs->breakpoint_at->number); + printf_filtered ("\nCatchpoint %d (", bs->breakpoint_at->number); + if (bs->breakpoint_at->type == bp_catch_fork) + printf_filtered ("forked"); + else if (bs->breakpoint_at->type == bp_catch_vfork) + printf_filtered ("vforked"); + printf_filtered (" process %d), ", bs->breakpoint_at->forked_inferior_pid); + return 0; + } + else if (bs->breakpoint_at->type == bp_catch_exec) + { + annotate_catchpoint (bs->breakpoint_at->number); + printf_filtered ("\nCatchpoint %d (exec'd %s), ", + bs->breakpoint_at->number, + bs->breakpoint_at->exec_pathname); + return 0; + } + else if (bs->breakpoint_at->type == bp_catch_catch) + { + if (current_exception_event && (CURRENT_EXCEPTION_KIND == EX_EVENT_CATCH)) + { + annotate_catchpoint (bs->breakpoint_at->number); + printf_filtered ("\nCatchpoint %d (exception caught), ", bs->breakpoint_at->number); + printf_filtered ("throw location "); + if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE) + printf_filtered ("%s:%d", + CURRENT_EXCEPTION_THROW_FILE, + CURRENT_EXCEPTION_THROW_LINE); + else + printf_filtered ("unknown"); + + printf_filtered (", catch location "); + if (CURRENT_EXCEPTION_CATCH_PC && CURRENT_EXCEPTION_CATCH_LINE) + printf_filtered ("%s:%d", + CURRENT_EXCEPTION_CATCH_FILE, + CURRENT_EXCEPTION_CATCH_LINE); + else + printf_filtered ("unknown"); + + printf_filtered ("\n"); + return 1; /* don't bother to print location frame info */ + } + else + { + return -1; /* really throw, some other bpstat will handle it */ + } + } + else if (bs->breakpoint_at->type == bp_catch_throw) + { + if (current_exception_event && (CURRENT_EXCEPTION_KIND == EX_EVENT_THROW)) + { + annotate_catchpoint (bs->breakpoint_at->number); + printf_filtered ("\nCatchpoint %d (exception thrown), ", bs->breakpoint_at->number); + printf_filtered ("throw location "); + if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE) + printf_filtered ("%s:%d", + CURRENT_EXCEPTION_THROW_FILE, + CURRENT_EXCEPTION_THROW_LINE); + else + printf_filtered ("unknown"); + + printf_filtered (", catch location "); + if (CURRENT_EXCEPTION_CATCH_PC && CURRENT_EXCEPTION_CATCH_LINE) + printf_filtered ("%s:%d", + CURRENT_EXCEPTION_CATCH_FILE, + CURRENT_EXCEPTION_CATCH_LINE); + else + printf_filtered ("unknown"); + + printf_filtered ("\n"); + return 1; /* don't bother to print location frame info */ + } + else + { + return -1; /* really catch, some other bpstat willhandle it */ + } + } - if (bs->breakpoint_at->type == bp_breakpoint || + else if (bs->breakpoint_at->type == bp_breakpoint || bs->breakpoint_at->type == bp_hardware_breakpoint) { /* I think the user probably only wants to see one breakpoint @@ -1007,10 +1804,25 @@ print_it_normal (bs) return -1; } -/* Print a message indicating what happened. Returns nonzero to - say that only the source line should be printed after this (zero - return means print the frame as well as the source line). */ -/* Currently we always return zero. */ +/* Print a message indicating what happened. + This is called from normal_stop(). + The input to this routine is the head of the bpstat list - a list + of the eventpoints that caused this stop. + This routine calls the "print_it" routine(s) associated + with these eventpoints. This will print (for example) + the "Breakpoint n," part of the output. + The return value of this routine is one of: + + -1: Means we printed nothing + 0: Means we printed something, and expect subsequent + code to print the location. An example is + "Breakpoint 1, " which should be followed by + the location. + 1 : Means we printed something, but there is no need + to also print the location part of the message. + An example is the catch/throw messages, which + don't require a location appended to the end. */ + int bpstat_print (bs) bpstat bs; @@ -1018,7 +1830,7 @@ bpstat_print (bs) int val; if (bs == NULL) - return 0; + return -1; val = (*bs->print_it) (bs); if (val >= 0) @@ -1032,7 +1844,7 @@ bpstat_print (bs) return bpstat_print (bs->next); /* We reached the end of the chain without printing anything. */ - return 0; + return -1; } /* Evaluate the expression EXP and return 1 if value is zero. @@ -1042,7 +1854,7 @@ bpstat_print (bs) static int breakpoint_cond_eval (exp) - char *exp; + PTR exp; { value_ptr mark = value_mark (); int i = !value_true (evaluate_expression ((struct expression *)exp)); @@ -1085,7 +1897,7 @@ bpstat_alloc (b, cbs) static int watchpoint_check (p) - char *p; + PTR p; { bpstat bs = (bpstat) p; struct breakpoint *b; @@ -1151,8 +1963,8 @@ watchpoint_check (p) Watchpoint %d deleted because the program has left the block in\n\ which its expression is valid.\n", bs->breakpoint_at->number); if (b->related_breakpoint) - delete_breakpoint (b->related_breakpoint); - delete_breakpoint (b); + b->related_breakpoint->disposition = del_at_next_stop; + b->disposition = del_at_next_stop; return WP_DELETED; } @@ -1160,6 +1972,15 @@ which its expression is valid.\n", bs->breakpoint_at->number); /* This is used when everything which needs to be printed has already been printed. But we still want to print the frame. */ + +/* Background: When we stop, bpstat_print() is called. + It loops through the bpstat list of things causing this stop, + calling the print_it function for each one. The default + print_it function, used for breakpoints, is print_it_normal(). + Also see print_it_noop() and print_it_done() are the other + two possibilities. See comments in bpstat_print() and + in header of print_it_normal() for more detail. */ + static int print_it_done (bs) bpstat bs; @@ -1168,6 +1989,13 @@ print_it_done (bs) } /* This is used when nothing should be printed for this bpstat entry. */ +/* Background: When we stop, bpstat_print() is called. + It loops through the bpstat list of things causing this stop, + calling the print_it function for each one. The default + print_it function, used for breakpoints, is print_it_normal(). + Also see print_it_noop() and print_it_done() are the other + two possibilities. See comments in bpstat_print() and + in header of print_it_normal() for more detail. */ static int print_it_noop (bs) @@ -1194,9 +2022,7 @@ print_it_noop (bs) several reasons concurrently.) Each element of the chain has valid next, breakpoint_at, - commands, FIXME??? fields. - - */ + commands, FIXME??? fields. */ bpstat bpstat_stop_status (pc, not_a_breakpoint) @@ -1205,10 +2031,8 @@ bpstat_stop_status (pc, not_a_breakpoint) { register struct breakpoint *b, *temp; CORE_ADDR bp_addr; -#if DECR_PC_AFTER_BREAK != 0 || defined (SHIFT_INST_REGS) /* True if we've hit a breakpoint (as opposed to a watchpoint). */ int real_breakpoint = 0; -#endif /* Root of the chain of bpstat's */ struct bpstats root_bs[1]; /* Pointer to the last thing in the chain currently. */ @@ -1223,7 +2047,8 @@ bpstat_stop_status (pc, not_a_breakpoint) ALL_BREAKPOINTS_SAFE (b, temp) { if (b->enable == disabled - || b->enable == shlib_disabled) + || b->enable == shlib_disabled + || b->enable == call_disabled) continue; if (b->type != bp_watchpoint @@ -1231,11 +2056,19 @@ bpstat_stop_status (pc, not_a_breakpoint) && b->type != bp_read_watchpoint && b->type != bp_access_watchpoint && b->type != bp_hardware_breakpoint - && b->address != bp_addr) - continue; + && b->type != bp_catch_fork + && b->type != bp_catch_vfork + && b->type != bp_catch_exec + && b->type != bp_catch_catch + && b->type != bp_catch_throw) /* a non-watchpoint bp */ + if (b->address != bp_addr || /* address doesn't match or */ + (overlay_debugging && /* overlay doesn't match */ + section_is_overlay (b->section) && + !section_is_mapped (b->section))) + continue; if (b->type == bp_hardware_breakpoint - && b->address != (bp_addr - DECR_PC_AFTER_HW_BREAK)) + && b->address != (*pc - DECR_PC_AFTER_HW_BREAK)) continue; if (b->type != bp_watchpoint @@ -1245,20 +2078,55 @@ bpstat_stop_status (pc, not_a_breakpoint) && not_a_breakpoint) continue; - /* Come here if it's a watchpoint, or if the break address matches */ + /* Is this a catchpoint of a load or unload? If so, did we + get a load or unload of the specified library? If not, + ignore it. */ + if ((b->type == bp_catch_load) +#if defined(SOLIB_HAVE_LOAD_EVENT) + && (!SOLIB_HAVE_LOAD_EVENT(inferior_pid) + || ((b->dll_pathname != NULL) + && (strcmp (b->dll_pathname, SOLIB_LOADED_LIBRARY_PATHNAME(inferior_pid)) != 0))) +#endif + ) + continue; + + if ((b->type == bp_catch_unload) +#if defined(SOLIB_HAVE_UNLOAD_EVENT) + && (!SOLIB_HAVE_UNLOAD_EVENT(inferior_pid) + || ((b->dll_pathname != NULL) + && (strcmp (b->dll_pathname, SOLIB_UNLOADED_LIBRARY_PATHNAME(inferior_pid)) != 0))) +#endif + ) + continue; + + if ((b->type == bp_catch_fork) + && ! target_has_forked (inferior_pid, &b->forked_inferior_pid)) + continue; + + if ((b->type == bp_catch_vfork) + && ! target_has_vforked (inferior_pid, &b->forked_inferior_pid)) + continue; + + if ((b->type == bp_catch_exec) + && ! target_has_execd (inferior_pid, &b->exec_pathname)) + continue; - ++(b->hit_count); + if (ep_is_exception_catchpoint (b) && + !(current_exception_event = target_get_current_exception_event ())) + continue; + + /* Come here if it's a watchpoint, or if the break address matches */ bs = bpstat_alloc (b, bs); /* Alloc a bpstat to explain stop */ + /* Watchpoints may change this, if not found to have triggered. */ bs->stop = 1; bs->print = 1; sprintf (message, message1, b->number); if (b->type == bp_watchpoint || b->type == bp_hardware_watchpoint) { - switch (catch_errors (watchpoint_check, (char *) bs, message, - RETURN_MASK_ALL)) + switch (catch_errors (watchpoint_check, bs, message, RETURN_MASK_ALL)) { case WP_DELETED: /* We've already printed what needs to be printed. */ @@ -1267,11 +2135,14 @@ bpstat_stop_status (pc, not_a_breakpoint) break; case WP_VALUE_CHANGED: /* Stop. */ + ++(b->hit_count); break; case WP_VALUE_NOT_CHANGED: /* Don't stop. */ bs->print_it = print_it_noop; bs->stop = 0; + /* Don't consider this a hit. */ + --(b->hit_count); continue; default: /* Can't happen. */ @@ -1280,8 +2151,8 @@ bpstat_stop_status (pc, not_a_breakpoint) /* Error from catch_errors. */ printf_filtered ("Watchpoint %d deleted.\n", b->number); if (b->related_breakpoint) - delete_breakpoint (b->related_breakpoint); - delete_breakpoint (b); + b->related_breakpoint->disposition = del_at_next_stop; + b->disposition = del_at_next_stop; /* We've already printed what needs to be printed. */ bs->print_it = print_it_done; @@ -1309,8 +2180,7 @@ bpstat_stop_status (pc, not_a_breakpoint) } } if (found) - switch (catch_errors (watchpoint_check, (char *) bs, message, - RETURN_MASK_ALL)) + switch (catch_errors (watchpoint_check, bs, message, RETURN_MASK_ALL)) { case WP_DELETED: /* We've already printed what needs to be printed. */ @@ -1320,26 +2190,33 @@ bpstat_stop_status (pc, not_a_breakpoint) case WP_VALUE_CHANGED: case WP_VALUE_NOT_CHANGED: /* Stop. */ + ++(b->hit_count); break; default: /* Can't happen. */ case 0: /* Error from catch_errors. */ printf_filtered ("Watchpoint %d deleted.\n", b->number); - if (b->related_breakpoint) - delete_breakpoint (b->related_breakpoint); - delete_breakpoint (b); + if (b->related_breakpoint) + b->related_breakpoint->disposition = del_at_next_stop; + b->disposition = del_at_next_stop; /* We've already printed what needs to be printed. */ bs->print_it = print_it_done; break; } } -#if DECR_PC_AFTER_BREAK != 0 || defined (SHIFT_INST_REGS) - else - real_breakpoint = 1; -#endif + else + { + /* By definition, an encountered breakpoint is a triggered + breakpoint. */ + ++(b->hit_count); + + real_breakpoint = 1; + } - if (b->frame && b->frame != (get_current_frame ())->frame) + if (b->frame && b->frame != (get_current_frame ())->frame && + (b->type == bp_step_resume && + (INNER_THAN (get_current_frame ()->frame, b->frame)))) bs->stop = 0; else { @@ -1351,7 +2228,7 @@ bpstat_stop_status (pc, not_a_breakpoint) so that the conditions will have the right context. */ select_frame (get_current_frame (), 0); value_is_zero - = catch_errors (breakpoint_cond_eval, (char *)(b->cond), + = catch_errors (breakpoint_cond_eval, (b->cond), "Error in testing breakpoint condition:\n", RETURN_MASK_ALL); /* FIXME-someday, should give breakpoint # */ @@ -1360,6 +2237,8 @@ bpstat_stop_status (pc, not_a_breakpoint) if (b->cond && value_is_zero) { bs->stop = 0; + /* Don't consider this a hit. */ + --(b->hit_count); } else if (b->ignore_count > 0) { @@ -1374,7 +2253,9 @@ bpstat_stop_status (pc, not_a_breakpoint) bs->commands = b->commands; if (b->silent) bs->print = 0; - if (bs->commands && STREQ ("silent", bs->commands->line)) + if (bs->commands && + (STREQ ("silent", bs->commands->line) || + (xdb_commands && STREQ ("Q", bs->commands->line)))) { bs->commands = bs->commands->next; bs->print = 0; @@ -1388,20 +2269,30 @@ bpstat_stop_status (pc, not_a_breakpoint) bs->next = NULL; /* Terminate the chain */ bs = root_bs->next; /* Re-grab the head of the chain */ -#if DECR_PC_AFTER_BREAK != 0 || defined (SHIFT_INST_REGS) - if (bs) + + if (real_breakpoint && bs) { - if (real_breakpoint) + if (bs->breakpoint_at->type == bp_hardware_breakpoint) + { + if (DECR_PC_AFTER_HW_BREAK != 0) + { + *pc = *pc - DECR_PC_AFTER_HW_BREAK; + write_pc (*pc); + } + } + else { - *pc = bp_addr; + if (DECR_PC_AFTER_BREAK != 0 || must_shift_inst_regs) + { + *pc = bp_addr; #if defined (SHIFT_INST_REGS) - SHIFT_INST_REGS(); + SHIFT_INST_REGS(); #else /* No SHIFT_INST_REGS. */ - write_pc (bp_addr); + write_pc (bp_addr); #endif /* No SHIFT_INST_REGS. */ + } } } -#endif /* DECR_PC_AFTER_BREAK != 0. */ /* The value of a hardware watchpoint hasn't changed, but the intermediate memory locations we are watching may have. */ @@ -1456,6 +2347,9 @@ bpstat_what (bs) /* We hit the shared library event breakpoint. */ shlib_event, + /* We caught a shared library event. */ + catch_shlib_event, + /* This is just used to count how many enums there are. */ class_last }; @@ -1473,6 +2367,7 @@ bpstat_what (bs) #define sr BPSTAT_WHAT_STEP_RESUME #define ts BPSTAT_WHAT_THROUGH_SIGTRAMP #define shl BPSTAT_WHAT_CHECK_SHLIBS +#define shlr BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK /* "Can't happen." Might want to print an error message. abort() is not out of the question, but chances are GDB is just @@ -1497,20 +2392,22 @@ bpstat_what (bs) table[(int)class_last][(int)BPSTAT_WHAT_LAST] = { /* old action */ - /* kc ss sn sgl slr clr clrs sr ts shl - */ -/*no_effect*/ {kc, ss, sn, sgl, slr, clr, clrs, sr, ts, shl}, -/*wp_silent*/ {ss, ss, sn, ss, ss, ss, ss, sr, ts, shl}, -/*wp_noisy*/ {sn, sn, sn, sn, sn, sn, sn, sr, ts, shl}, -/*bp_nostop*/ {sgl, ss, sn, sgl, slr, clrs, clrs, sr, ts, shl}, -/*bp_silent*/ {ss, ss, sn, ss, ss, ss, ss, sr, ts, shl}, -/*bp_noisy*/ {sn, sn, sn, sn, sn, sn, sn, sr, ts, shl}, -/*long_jump*/ {slr, ss, sn, slr, err, err, err, sr, ts, shl}, -/*long_resume*/ {clr, ss, sn, clrs, err, err, err, sr, ts, shl}, -/*step_resume*/ {sr, sr, sr, sr, sr, sr, sr, sr, ts, shl}, -/*through_sig*/ {ts, ts, ts, ts, ts, ts, ts, ts, ts, shl}, -/*shlib*/ {shl, shl, shl, shl, shl, shl, shl, shl, ts, shl} - }; + /* kc ss sn sgl slr clr clrs sr ts shl shlr + */ +/*no_effect*/ {kc, ss, sn, sgl, slr, clr, clrs, sr, ts, shl, shlr}, +/*wp_silent*/ {ss, ss, sn, ss, ss, ss, ss, sr, ts, shl, shlr}, +/*wp_noisy*/ {sn, sn, sn, sn, sn, sn, sn, sr, ts, shl, shlr}, +/*bp_nostop*/ {sgl, ss, sn, sgl, slr, clrs, clrs, sr, ts, shl, shlr}, +/*bp_silent*/ {ss, ss, sn, ss, ss, ss, ss, sr, ts, shl, shlr}, +/*bp_noisy*/ {sn, sn, sn, sn, sn, sn, sn, sr, ts, shl, shlr}, +/*long_jump*/ {slr, ss, sn, slr, err, err, err, sr, ts, shl, shlr}, +/*long_resume*/ {clr, ss, sn, clrs, err, err, err, sr, ts, shl, shlr}, +/*step_resume*/ {sr, sr, sr, sr, sr, sr, sr, sr, ts, shl, shlr}, +/*through_sig*/ {ts, ts, ts, ts, ts, ts, ts, ts, ts, shl, shlr}, +/*shlib*/ {shl, shl, shl, shl, shl, shl, shl, shl, ts, shl, shlr}, +/*catch_shlib*/ {shlr, shlr, shlr, shlr, shlr, shlr, shlr, shlr, ts, shlr, shlr} + }; + #undef kc #undef ss #undef sn @@ -1522,6 +2419,7 @@ bpstat_what (bs) #undef sr #undef ts #undef shl +#undef shlr enum bpstat_what_main_action current_action = BPSTAT_WHAT_KEEP_CHECKING; struct bpstat_what retval; @@ -1535,6 +2433,9 @@ bpstat_what (bs) continue; switch (bs->breakpoint_at->type) { + case bp_none: + continue; + case bp_breakpoint: case bp_hardware_breakpoint: case bp_until: @@ -1589,6 +2490,43 @@ bpstat_what (bs) case bp_shlib_event: bs_class = shlib_event; break; + case bp_catch_load: + case bp_catch_unload: + /* Only if this catchpoint triggered should we cause the + step-out-of-dld behaviour. Otherwise, we ignore this + catchpoint. */ + if (bs->stop) + bs_class = catch_shlib_event; + else + bs_class = no_effect; + break; + case bp_catch_fork: + case bp_catch_vfork: + case bp_catch_exec: + if (bs->stop) + { + if (bs->print) + bs_class = bp_noisy; + else + bs_class = bp_silent; + } + else + /* There was a catchpoint, but we're not stopping. This requires + no further action. */ + bs_class = no_effect; + break; + case bp_catch_catch: + if (!bs->stop || CURRENT_EXCEPTION_KIND != EX_EVENT_CATCH) + bs_class = bp_nostop; + else if (bs->stop) + bs_class = bs->print ? bp_noisy : bp_silent; + break; + case bp_catch_throw: + if (!bs->stop || CURRENT_EXCEPTION_KIND != EX_EVENT_THROW) + bs_class = bp_nostop; + else if (bs->stop) + bs_class = bs->print ? bp_noisy : bp_silent; + break; case bp_call_dummy: /* Make sure the action is stop (silent or noisy), so infrun.c pops the dummy frame. */ @@ -1615,11 +2553,93 @@ bpstat_should_step () return 1; return 0; } + +/* Nonzero if there are enabled hardware watchpoints. */ +int +bpstat_have_active_hw_watchpoints () +{ + struct breakpoint *b; + ALL_BREAKPOINTS (b) + if ((b->enable == enabled) && + (b->inserted) && + ((b->type == bp_hardware_watchpoint) || + (b->type == bp_read_watchpoint) || + (b->type == bp_access_watchpoint))) + return 1; + return 0; +} + +/* Given a bpstat that records zero or more triggered eventpoints, this + function returns another bpstat which contains only the catchpoints + on that first list, if any. */ +void +bpstat_get_triggered_catchpoints (ep_list, cp_list) + bpstat ep_list; + bpstat * cp_list; +{ + struct bpstats root_bs[1]; + bpstat bs = root_bs; + struct breakpoint * ep; + char * dll_pathname; + + bpstat_clear (cp_list); + root_bs->next = NULL; + + for (; ep_list != NULL; ep_list = ep_list->next ) + { + /* Is this eventpoint a catchpoint? If not, ignore it. */ + ep = ep_list->breakpoint_at; + if (ep == NULL) + break; + if ((ep->type != bp_catch_load) && + (ep->type != bp_catch_unload) && + (ep->type != bp_catch_catch) && + (ep->type != bp_catch_throw)) /* pai: (temp) ADD fork/vfork here!! */ + continue; + + /* Yes; add it to the list. */ + bs = bpstat_alloc (ep, bs); + *bs = *ep_list; + bs->next = NULL; + bs = root_bs->next; + +#if defined(SOLIB_ADD) + /* Also, for each triggered catchpoint, tag it with the name of + the library that caused this trigger. (We copy the name now, + because it's only guaranteed to be available NOW, when the + catchpoint triggers. Clients who may wish to know the name + later must get it from the catchpoint itself.) */ + if (ep->triggered_dll_pathname != NULL) + free (ep->triggered_dll_pathname); + if (ep->type == bp_catch_load) + dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid); + else + dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid); +#else + dll_pathname = NULL; +#endif + if (dll_pathname) + { + ep->triggered_dll_pathname = (char *) xmalloc (strlen (dll_pathname) + 1); + strcpy (ep->triggered_dll_pathname, dll_pathname); + } + else + ep->triggered_dll_pathname = NULL; + } + + *cp_list = bs; +} + /* Print information on breakpoint number BNUM, or -1 if all. If WATCHPOINTS is zero, process only breakpoints; if WATCHPOINTS is nonzero, process only watchpoints. */ +typedef struct { + enum bptype type; + char * description; +} ep_type_description_t; + static void breakpoint_1 (bnum, allflag) int bnum; @@ -1630,16 +2650,35 @@ breakpoint_1 (bnum, allflag) register struct symbol *sym; CORE_ADDR last_addr = (CORE_ADDR)-1; int found_a_breakpoint = 0; - static char *bptypes[] = {"breakpoint", "hw breakpoint", - "until", "finish", "watchpoint", - "hw watchpoint", "read watchpoint", - "acc watchpoint", "longjmp", - "longjmp resume", "step resume", - "sigtramp", - "watchpoint scope", "call dummy", - "shlib events" }; - static char *bpdisps[] = {"del", "dis", "keep"}; - static char bpenables[] = "ny"; + static ep_type_description_t bptypes[] = + { + {bp_none, "?deleted?"}, + {bp_breakpoint, "breakpoint"}, + {bp_hardware_breakpoint, "hw breakpoint"}, + {bp_until, "until"}, + {bp_finish, "finish"}, + {bp_watchpoint, "watchpoint"}, + {bp_hardware_watchpoint, "hw watchpoint"}, + {bp_read_watchpoint, "read watchpoint"}, + {bp_access_watchpoint, "acc watchpoint"}, + {bp_longjmp, "longjmp"}, + {bp_longjmp_resume, "longjmp resume"}, + {bp_step_resume, "step resume"}, + {bp_through_sigtramp, "sigtramp"}, + {bp_watchpoint_scope, "watchpoint scope"}, + {bp_call_dummy, "call dummy"}, + {bp_shlib_event, "shlib events"}, + {bp_catch_load, "catch load"}, + {bp_catch_unload, "catch unload"}, + {bp_catch_fork, "catch fork"}, + {bp_catch_vfork, "catch vfork"}, + {bp_catch_exec, "catch exec"}, + {bp_catch_catch, "catch catch"}, + {bp_catch_throw, "catch throw"} + }; + + static char *bpdisps[] = {"del", "dstp", "dis", "keep"}; + static char bpenables[] = "nyn"; char wrap_indent[80]; ALL_BREAKPOINTS (b) @@ -1649,6 +2688,13 @@ breakpoint_1 (bnum, allflag) /* We only print out user settable breakpoints unless the allflag is set. */ if (!allflag && b->type != bp_breakpoint + && b->type != bp_catch_load + && b->type != bp_catch_unload + && b->type != bp_catch_fork + && b->type != bp_catch_vfork + && b->type != bp_catch_exec + && b->type != bp_catch_catch + && b->type != bp_catch_throw && b->type != bp_hardware_breakpoint && b->type != bp_watchpoint && b->type != bp_read_watchpoint @@ -1683,7 +2729,11 @@ breakpoint_1 (bnum, allflag) annotate_field (0); printf_filtered ("%-3d ", b->number); annotate_field (1); - printf_filtered ("%-14s ", bptypes[(int)b->type]); + if ((int)b->type > (sizeof(bptypes)/sizeof(bptypes[0]))) + error ("bptypes table does not describe type #%d.", (int)b->type); + if ((int)b->type != bptypes[(int)b->type].type) + error ("bptypes table does not describe type #%d?", (int)b->type); + printf_filtered ("%-14s ", bptypes[(int)b->type].description); annotate_field (2); printf_filtered ("%-4s ", bpdisps[(int)b->disposition]); annotate_field (3); @@ -1704,6 +2754,51 @@ breakpoint_1 (bnum, allflag) annotate_field (5); print_expression (b->exp, gdb_stdout); break; + + case bp_catch_load: + case bp_catch_unload: + /* Field 4, the address, is omitted (which makes the columns + not line up too nicely with the headers, but the effect + is relatively readable). */ + annotate_field (5); + if (b->dll_pathname == NULL) + printf_filtered (" "); + else + printf_filtered ("library \"%s\" ", b->dll_pathname); + break; + + case bp_catch_fork: + case bp_catch_vfork: + /* Field 4, the address, is omitted (which makes the columns + not line up too nicely with the headers, but the effect + is relatively readable). */ + annotate_field (5); + if (b->forked_inferior_pid != 0) + printf_filtered ("process %d ", b->forked_inferior_pid); + break; + + case bp_catch_exec: + /* Field 4, the address, is omitted (which makes the columns + not line up too nicely with the headers, but the effect + is relatively readable). */ + annotate_field (5); + if (b->exec_pathname != NULL) + printf_filtered ("program \"%s\" ", b->exec_pathname); + break; + case bp_catch_catch: + /* Field 4, the address, is omitted (which makes the columns + not line up too nicely with the headers, but the effect + is relatively readable). */ + annotate_field (5); + printf_filtered ("exception catch "); + break; + case bp_catch_throw: + /* Field 4, the address, is omitted (which makes the columns + not line up too nicely with the headers, but the effect + is relatively readable). */ + annotate_field (5); + printf_filtered ("exception throw "); + break; case bp_breakpoint: case bp_hardware_breakpoint: @@ -1732,7 +2827,7 @@ breakpoint_1 (bnum, allflag) last_addr = b->address; if (b->source_file) { - sym = find_pc_function (b->address); + sym = find_pc_sect_function (b->address, b->section); if (sym) { fputs_filtered ("in ", gdb_stdout); @@ -1748,6 +2843,9 @@ breakpoint_1 (bnum, allflag) break; } + if (b->thread != -1) + printf_filtered (" thread %d", b->thread ); + printf_filtered ("\n"); if (b->frame) @@ -1768,12 +2866,21 @@ breakpoint_1 (bnum, allflag) printf_filtered ("\n"); } - if (show_breakpoint_hit_counts && b->hit_count) + if (b->thread != -1) { /* FIXME should make an annotation for this */ + printf_filtered ("\tstop only in thread %d\n", b->thread); + } - printf_filtered ("\tbreakpoint already hit %d time%s\n", - b->hit_count, (b->hit_count == 1 ? "" : "s")); + if (show_breakpoint_hit_counts && b->hit_count) + { + /* FIXME should make an annotation for this */ + if (ep_is_catchpoint (b)) + printf_filtered ("\tcatchpoint"); + else + printf_filtered ("\tbreakpoint"); + printf_filtered (" already hit %d time%s\n", + b->hit_count, (b->hit_count == 1 ? "" : "s")); } if (b->ignore_count) @@ -1828,7 +2935,7 @@ breakpoints_info (bnum_exp, from_tty) #if MAINTENANCE_CMDS /* ARGSUSED */ -static void +void maintenance_info_breakpoints (bnum_exp, from_tty) char *bnum_exp; int from_tty; @@ -1846,29 +2953,34 @@ maintenance_info_breakpoints (bnum_exp, from_tty) /* Print a message describing any breakpoints set at PC. */ static void -describe_other_breakpoints (pc) - register CORE_ADDR pc; +describe_other_breakpoints (pc, section) + CORE_ADDR pc; + asection *section; { register int others = 0; register struct breakpoint *b; ALL_BREAKPOINTS (b) if (b->address == pc) - others++; + if (overlay_debugging == 0 || + b->section == section) + others++; if (others > 0) { printf_filtered ("Note: breakpoint%s ", (others > 1) ? "s" : ""); ALL_BREAKPOINTS (b) if (b->address == pc) - { - others--; - printf_filtered - ("%d%s%s ", - b->number, - ((b->enable == disabled || b->enable == shlib_disabled) - ? " (disabled)" : ""), - (others > 1) ? "," : ((others == 1) ? " and" : "")); - } + if (overlay_debugging == 0 || + b->section == section) + { + others--; + printf_filtered + ("%d%s%s ", + b->number, + ((b->enable == disabled || b->enable == shlib_disabled || b->enable == call_disabled) + ? " (disabled)" : ""), + (others > 1) ? "," : ((others == 1) ? " and" : "")); + } printf_filtered ("also set at pc "); print_address_numeric (pc, 1, gdb_stdout); printf_filtered (".\n"); @@ -1896,8 +3008,9 @@ set_default_breakpoint (valid, addr, symtab, line) This is so that the bpt instruction is only inserted once. */ static void -check_duplicates (address) +check_duplicates (address, section) CORE_ADDR address; + asection *section; { register struct breakpoint *b; register int count = 0; @@ -1908,7 +3021,9 @@ check_duplicates (address) ALL_BREAKPOINTS (b) if (b->enable != disabled && b->enable != shlib_disabled - && b->address == address) + && b->enable != call_disabled + && b->address == address + && (overlay_debugging == 0 || b->section == section)) { count++; b->duplicate = count > 1; @@ -1925,7 +3040,7 @@ check_duplicates (address) error(); otherwise it leaves a bogus breakpoint on the chain. Validate your arguments BEFORE calling this routine! */ -static struct breakpoint * +struct breakpoint * set_raw_breakpoint (sal) struct symtab_and_line sal; { @@ -1939,6 +3054,7 @@ set_raw_breakpoint (sal) else b->source_file = savestring (sal.symtab->filename, strlen (sal.symtab->filename)); + b->section = sal.section; b->language = current_language->la_language; b->input_radix = input_radix; b->thread = -1; @@ -1949,6 +3065,10 @@ set_raw_breakpoint (sal) b->ignore_count = 0; b->commands = NULL; b->frame = 0; + b->dll_pathname = NULL; + b->triggered_dll_pathname = NULL; + b->forked_inferior_pid = 0; + b->exec_pathname = NULL; /* Add this breakpoint to the end of the chain so that a list of breakpoints will come out in order @@ -1964,14 +3084,12 @@ set_raw_breakpoint (sal) b1->next = b; } - check_duplicates (sal.pc); + check_duplicates (sal.pc, sal.section); breakpoints_changed (); return b; } -static int internal_breakpoint_number = -1; - #ifdef GET_LONGJMP_TARGET static void @@ -1981,6 +3099,7 @@ create_longjmp_breakpoint (func_name) struct symtab_and_line sal; struct breakpoint *b; + INIT_SAL (&sal); /* initialize to zeroes */ if (func_name != NULL) { struct minimal_symbol *m; @@ -1991,12 +3110,7 @@ create_longjmp_breakpoint (func_name) else return; } - else - sal.pc = 0; - - sal.symtab = NULL; - sal.line = 0; - + sal.section = find_pc_overlay (sal.pc); b = set_raw_breakpoint (sal); if (!b) return; @@ -2016,80 +3130,302 @@ create_longjmp_breakpoint (func_name) set_longjmp_resume_breakpoint() to figure out where we are going. */ void -enable_longjmp_breakpoint() +enable_longjmp_breakpoint() +{ + register struct breakpoint *b; + + ALL_BREAKPOINTS (b) + if (b->type == bp_longjmp) + { + b->enable = enabled; + check_duplicates (b->address, b->section); + } +} + +void +disable_longjmp_breakpoint() +{ + register struct breakpoint *b; + + ALL_BREAKPOINTS (b) + if ( b->type == bp_longjmp + || b->type == bp_longjmp_resume) + { + b->enable = disabled; + check_duplicates (b->address, b->section); + } +} + +#ifdef SOLIB_ADD +void +remove_solib_event_breakpoints () +{ + register struct breakpoint *b, *temp; + + ALL_BREAKPOINTS_SAFE (b, temp) + if (b->type == bp_shlib_event) + delete_breakpoint (b); +} + +void +create_solib_event_breakpoint (address) + CORE_ADDR address; +{ + struct breakpoint *b; + struct symtab_and_line sal; + + INIT_SAL (&sal); /* initialize to zeroes */ + sal.pc = address; + sal.section = find_pc_overlay (sal.pc); + b = set_raw_breakpoint (sal); + b->number = internal_breakpoint_number--; + b->disposition = donttouch; + b->type = bp_shlib_event; +} + +void +disable_breakpoints_in_shlibs (silent) + int silent; +{ + struct breakpoint * b; + int disabled_shlib_breaks = 0; + + /* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK. */ + ALL_BREAKPOINTS (b) + { +#if defined (PC_SOLIB) + if (((b->type == bp_breakpoint) || + (b->type == bp_hardware_breakpoint)) && + (b->enable != shlib_disabled) && + (b->enable != call_disabled) && + ! b->duplicate && + PC_SOLIB (b->address)) + { + b->enable = shlib_disabled; + if (!silent) + { + if (!disabled_shlib_breaks) + { + target_terminal_ours_for_output (); + printf_filtered ("Temporarily disabling shared library breakpoints:\n"); + } + disabled_shlib_breaks = 1; + printf_filtered ("%d ", b->number); + } + } +#endif + } + if (disabled_shlib_breaks && !silent) + printf_filtered ("\n"); +} + +/* Try to reenable any breakpoints in shared libraries. */ +void +re_enable_breakpoints_in_shlibs () +{ + struct breakpoint *b; + + ALL_BREAKPOINTS (b) + if (b->enable == shlib_disabled) + { + char buf[1]; + + /* Do not reenable the breakpoint if the shared library + is still not mapped in. */ + if (target_read_memory (b->address, buf, 1) == 0) + b->enable = enabled; + } +} + +#endif + +static void +create_solib_load_unload_event_breakpoint (hookname, tempflag, dll_pathname, cond_string, bp_kind) + char * hookname; + int tempflag; + char * dll_pathname; + char * cond_string; + enum bptype bp_kind; +{ + struct breakpoint * b; + struct symtabs_and_lines sals; + struct symtab_and_line sal; + struct cleanup * old_chain; + struct cleanup * canonical_strings_chain = NULL; + int i; + char * addr_start = hookname; + char * addr_end = NULL; + char ** canonical = (char **) NULL; + int thread = -1; /* All threads. */ + + /* Set a breakpoint on the specified hook. */ + sals = decode_line_1 (&hookname, 1, (struct symtab *) NULL, 0, &canonical); + addr_end = hookname; + + if (sals.nelts == 0) + { + warning ("Unable to set a breakpoint on dynamic linker callback."); + warning ("Suggest linking with /opt/langtools/lib/end.o."); + warning ("GDB will be unable to track shl_load/shl_unload calls"); + return; + } + if (sals.nelts != 1) + { + warning ("Unable to set a unique breakpoint on dynamic linker callback."); + warning ("GDB will be unable to track shl_load/shl_unload calls"); + return; + } + + /* Make sure that all storage allocated in decode_line_1 gets freed in case + the following errors out. */ + old_chain = make_cleanup (free, sals.sals); + if (canonical != (char **)NULL) + { + make_cleanup (free, canonical); + canonical_strings_chain = make_cleanup (null_cleanup, 0); + if (canonical[0] != NULL) + make_cleanup (free, canonical[0]); + } + + resolve_sal_pc (&sals.sals[0]); + + /* Remove the canonical strings from the cleanup, they are needed below. */ + if (canonical != (char **)NULL) + discard_cleanups (canonical_strings_chain); + + b = set_raw_breakpoint (sals.sals[0]); + set_breakpoint_count (breakpoint_count + 1); + b->number = breakpoint_count; + b->cond = NULL; + b->cond_string = (cond_string == NULL) ? NULL : savestring (cond_string, strlen (cond_string)); + b->thread = thread; + + if (canonical != (char **)NULL && canonical[0] != NULL) + b->addr_string = canonical[0]; + else if (addr_start) + b->addr_string = savestring (addr_start, addr_end - addr_start); + + b->enable = enabled; + b->disposition = tempflag ? del : donttouch; + + if (dll_pathname == NULL) + b->dll_pathname = NULL; + else + { + b->dll_pathname = (char *) xmalloc (strlen (dll_pathname) + 1); + strcpy (b->dll_pathname, dll_pathname); + } + b->type = bp_kind; + + mention (b); + do_cleanups (old_chain); +} + +void +create_solib_load_event_breakpoint (hookname, tempflag, dll_pathname, cond_string) + char * hookname; + int tempflag; + char * dll_pathname; + char * cond_string; { - register struct breakpoint *b; - - ALL_BREAKPOINTS (b) - if (b->type == bp_longjmp) - { - b->enable = enabled; - check_duplicates (b->address); - } + create_solib_load_unload_event_breakpoint (hookname, + tempflag, + dll_pathname, + cond_string, + bp_catch_load); } void -disable_longjmp_breakpoint() +create_solib_unload_event_breakpoint (hookname, tempflag, dll_pathname, cond_string) + char * hookname; + int tempflag; + char * dll_pathname; + char * cond_string; { - register struct breakpoint *b; + create_solib_load_unload_event_breakpoint (hookname, + tempflag, + dll_pathname, + cond_string, + bp_catch_unload); +} - ALL_BREAKPOINTS (b) - if ( b->type == bp_longjmp - || b->type == bp_longjmp_resume) - { - b->enable = disabled; - check_duplicates (b->address); - } +static void +create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_kind) + int tempflag; + char * cond_string; + enum bptype bp_kind; +{ + struct symtab_and_line sal; + struct breakpoint * b; + int thread = -1; /* All threads. */ + + INIT_SAL(&sal); + sal.pc = 0; + sal.symtab = NULL; + sal.line = 0; + + b = set_raw_breakpoint (sal); + set_breakpoint_count (breakpoint_count + 1); + b->number = breakpoint_count; + b->cond = NULL; + b->cond_string = (cond_string == NULL) ? NULL : savestring (cond_string, strlen (cond_string)); + b->thread = thread; + b->addr_string = NULL; + b->enable = enabled; + b->disposition = tempflag ? del : donttouch; + b->forked_inferior_pid = 0; + + b->type = bp_kind; + + mention (b); } -#ifdef SOLIB_ADD void -remove_solib_event_breakpoints () +create_fork_event_catchpoint (tempflag, cond_string) + int tempflag; + char * cond_string; { - register struct breakpoint *b, *temp; - - ALL_BREAKPOINTS_SAFE (b, temp) - if (b->type == bp_shlib_event) - delete_breakpoint (b); + create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_catch_fork); +} + +void +create_vfork_event_catchpoint (tempflag, cond_string) + int tempflag; + char * cond_string; +{ + create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_catch_vfork); } void -create_solib_event_breakpoint (address) - CORE_ADDR address; +create_exec_event_catchpoint (tempflag, cond_string) + int tempflag; + char * cond_string; { - struct breakpoint *b; - struct symtab_and_line sal; + struct symtab_and_line sal; + struct breakpoint * b; + int thread = -1; /* All threads. */ - sal.pc = address; + INIT_SAL(&sal); + sal.pc = 0; sal.symtab = NULL; sal.line = 0; - b = set_raw_breakpoint (sal); - b->number = internal_breakpoint_number--; - b->disposition = donttouch; - b->type = bp_shlib_event; -} -/* Try to reenable any breakpoints in shared libraries. */ -void -re_enable_breakpoints_in_shlibs () -{ - struct breakpoint *b; + b = set_raw_breakpoint (sal); + set_breakpoint_count (breakpoint_count + 1); + b->number = breakpoint_count; + b->cond = NULL; + b->cond_string = (cond_string == NULL) ? NULL : savestring (cond_string, strlen (cond_string)); + b->thread = thread; + b->addr_string = NULL; + b->enable = enabled; + b->disposition = tempflag ? del : donttouch; - ALL_BREAKPOINTS (b) - if (b->enable == shlib_disabled) - { - char buf[1]; + b->type = bp_catch_exec; - /* Do not reenable the breakpoint if the shared library - is still not mapped in. */ - if (target_read_memory (b->address, buf, 1) == 0) - b->enable = enabled; - } + mention (b); } -#endif - -int +static int hw_breakpoint_used_count() { register struct breakpoint *b; @@ -2104,7 +3440,7 @@ hw_breakpoint_used_count() return i; } -int +static int hw_watchpoint_used_count(type, other_type_used) enum bptype type; int *other_type_used; @@ -2132,8 +3468,7 @@ hw_watchpoint_used_count(type, other_type_used) breakpoint at the target of the jmp_buf. FIXME - This ought to be done by setting a temporary breakpoint that gets - deleted automatically... -*/ + deleted automatically... */ void set_longjmp_resume_breakpoint(pc, frame) @@ -2151,11 +3486,52 @@ set_longjmp_resume_breakpoint(pc, frame) b->frame = frame->frame; else b->frame = 0; - check_duplicates (b->address); + check_duplicates (b->address, b->section); return; } } +void +disable_watchpoints_before_interactive_call_start () +{ + struct breakpoint * b; + + ALL_BREAKPOINTS (b) + { + if (((b->type == bp_watchpoint) + || (b->type == bp_hardware_watchpoint) + || (b->type == bp_read_watchpoint) + || (b->type == bp_access_watchpoint) + || ep_is_exception_catchpoint (b)) + && (b->enable == enabled)) + { + b->enable = call_disabled; + check_duplicates (b->address, b->section); + } + } +} + +void +enable_watchpoints_after_interactive_call_stop () +{ + struct breakpoint * b; + + ALL_BREAKPOINTS (b) + { + if (((b->type == bp_watchpoint) + || (b->type == bp_hardware_watchpoint) + || (b->type == bp_read_watchpoint) + || (b->type == bp_access_watchpoint) + || ep_is_exception_catchpoint (b)) + && (b->enable == call_disabled)) + { + b->enable = enabled; + check_duplicates (b->address, b->section); + } + } +} + + /* Set a breakpoint that will evaporate an end of command at address specified by SAL. Restrict it to frame FRAME if FRAME is nonzero. */ @@ -2182,19 +3558,6 @@ set_momentary_breakpoint (sal, frame, type) return b; } -#if 0 -void -clear_momentary_breakpoints () -{ - register struct breakpoint *b, *temp; - ALL_BREAKPOINTS_SAFE (b, temp) - if (b->disposition == delete) - { - delete_breakpoint (b); - break; - } -} -#endif /* Tell the user we have just set a breakpoint B. */ @@ -2214,6 +3577,9 @@ mention (b) switch (b->type) { + case bp_none: + printf_filtered ("(apparently deleted?) Eventpoint %d: ", b->number); + break; case bp_watchpoint: printf_filtered ("Watchpoint %d: ", b->number); print_expression (b->exp, gdb_stdout); @@ -2227,7 +3593,7 @@ mention (b) print_expression (b->exp, gdb_stdout); break; case bp_access_watchpoint: - printf_filtered ("Hardware access(read/write) watchpoint %d: ",b->number); + printf_filtered ("Hardware access (read/write) watchpoint %d: ",b->number); print_expression (b->exp, gdb_stdout); break; case bp_breakpoint: @@ -2238,6 +3604,30 @@ mention (b) printf_filtered ("Hardware assisted breakpoint %d", b->number); say_where = 1; break; + case bp_catch_load: + case bp_catch_unload: + printf_filtered ("Catchpoint %d (%s %s)", + b->number, + (b->type == bp_catch_load) ? "load" : "unload", + (b->dll_pathname != NULL) ? b->dll_pathname : ""); + break; + case bp_catch_fork: + case bp_catch_vfork: + printf_filtered ("Catchpoint %d (%s)", + b->number, + (b->type == bp_catch_fork) ? "fork" : "vfork"); + break; + case bp_catch_exec: + printf_filtered ("Catchpoint %d (exec)", + b->number); + break; + case bp_catch_catch: + case bp_catch_throw: + printf_filtered ("Catchpoint %d (%s)", + b->number, + (b->type == bp_catch_catch) ? "catch" : "throw"); + break; + case bp_until: case bp_finish: case bp_longjmp: @@ -2259,47 +3649,12 @@ mention (b) if (b->source_file) printf_filtered (": file %s, line %d.", b->source_file, b->line_number); + TUIDO(((TuiOpaqueFuncPtr)tui_vAllSetHasBreakAt, b, 1)); + TUIDO(((TuiOpaqueFuncPtr)tuiUpdateAllExecInfos)); } printf_filtered ("\n"); } -#if 0 -/* Nobody calls this currently. */ -/* Set a breakpoint from a symtab and line. - If TEMPFLAG is nonzero, it is a temporary breakpoint. - ADDR_STRING is a malloc'd string holding the name of where we are - setting the breakpoint. This is used later to re-set it after the - program is relinked and symbols are reloaded. - Print the same confirmation messages that the breakpoint command prints. */ - -void -set_breakpoint (s, line, tempflag, addr_string) - struct symtab *s; - int line; - int tempflag; - char *addr_string; -{ - register struct breakpoint *b; - struct symtab_and_line sal; - - sal.symtab = s; - sal.line = line; - sal.pc = 0; - resolve_sal_pc (&sal); /* Might error out */ - describe_other_breakpoints (sal.pc); - - b = set_raw_breakpoint (sal); - set_breakpoint_count (breakpoint_count + 1); - b->number = breakpoint_count; - b->type = bp_breakpoint; - b->cond = 0; - b->addr_string = addr_string; - b->enable = enabled; - b->disposition = tempflag ? delete : donttouch; - - mention (b); -} -#endif /* 0 */ /* Set a breakpoint according to ARG (function, linenum or *address) flag: first bit : 0 non-temporary, 1 temporary. @@ -2335,8 +3690,7 @@ break_command_1 (arg, flag, from_tty) sals.sals = NULL; sals.nelts = 0; - sal.line = sal.pc = sal.end = 0; - sal.symtab = 0; + INIT_SAL (&sal); /* initialize to zeroes */ /* If no arg given, or if first arg is 'if ', use the default breakpoint. */ @@ -2350,6 +3704,7 @@ break_command_1 (arg, flag, from_tty) sal.pc = default_breakpoint_address; sal.line = default_breakpoint_line; sal.symtab = default_breakpoint_symtab; + sal.section = find_pc_overlay (sal.pc); sals.sals[0] = sal; sals.nelts = 1; } @@ -2402,6 +3757,24 @@ break_command_1 (arg, flag, from_tty) int toklen; resolve_sal_pc (&sals.sals[i]); + + /* It's possible for the PC to be nonzero, but still an illegal + value on some targets. + + For example, on HP-UX if you start gdb, and before running the + inferior you try to set a breakpoint on a shared library function + "foo" where the inferior doesn't call "foo" directly but does + pass its address to another function call, then we do find a + minimal symbol for the "foo", but it's address is invalid. + (Appears to be an index into a table that the loader sets up + when the inferior is run.) + + Give the target a chance to bless sals.sals[i].pc before we + try to make a breakpoint for it. */ + if (PC_REQUIRES_RUN_BEFORE_USE(sals.sals[i].pc)) + { + error ("Cannot break on %s without a running program.", addr_start); + } tok = arg; @@ -2462,7 +3835,7 @@ break_command_1 (arg, flag, from_tty) sal = sals.sals[i]; if (from_tty) - describe_other_breakpoints (sal.pc); + describe_other_breakpoints (sal.pc, sal.section); b = set_raw_breakpoint (sal); set_breakpoint_count (breakpoint_count + 1); @@ -2482,7 +3855,6 @@ break_command_1 (arg, flag, from_tty) b->enable = enabled; b->disposition = tempflag ? del : donttouch; - mention (b); } @@ -2494,6 +3866,174 @@ break_command_1 (arg, flag, from_tty) do_cleanups (old_chain); } +static void +break_at_finish_at_depth_command_1 (arg, flag, from_tty) + char *arg; + int flag; + int from_tty; +{ + struct frame_info *frame; + CORE_ADDR low, high, selected_pc = 0; + char *extra_args, *level_arg, *addr_string; + int extra_args_len = 0, if_arg = 0; + + if (!arg || + (arg[0] == 'i' && arg[1] == 'f' && (arg[2] == ' ' || arg[2] == '\t'))) + { + + if (default_breakpoint_valid) + { + if (selected_frame) + { + selected_pc = selected_frame->pc; + if (arg) + if_arg = 1; + } + else + error ("No selected frame."); + } + else + error ("No default breakpoint address now."); + } + else + { + extra_args = strchr (arg, ' '); + if (extra_args) + { + extra_args++; + extra_args_len = strlen (extra_args); + level_arg = (char *) xmalloc (extra_args - arg); + strncpy (level_arg, arg, extra_args - arg - 1); + level_arg[extra_args - arg - 1] = '\0'; + } + else + { + level_arg = (char *) xmalloc (strlen (arg) + 1); + strcpy (level_arg, arg); + } + + frame = parse_frame_specification (level_arg); + if (frame) + selected_pc = frame->pc; + else + selected_pc = 0; + } + if (if_arg) + { + extra_args = arg; + extra_args_len = strlen (arg); + } + + if (selected_pc) + { + if (find_pc_partial_function(selected_pc, (char **)NULL, &low, &high)) + { + addr_string = (char *) xmalloc (26 + extra_args_len); + if (extra_args_len) + sprintf (addr_string, "*0x%x %s", high, extra_args); + else + sprintf (addr_string, "*0x%x", high); + break_command_1 (addr_string, flag, from_tty); + free (addr_string); + } + else + error ("No function contains the specified address"); + } + else + error ("Unable to set breakpoint at procedure exit"); +} + + +static void +break_at_finish_command_1 (arg, flag, from_tty) + char *arg; + int flag; + int from_tty; +{ + char *addr_string, *break_string, *beg_addr_string; + CORE_ADDR low, high; + struct symtabs_and_lines sals; + struct symtab_and_line sal; + struct cleanup *old_chain; + char *extra_args; + int extra_args_len = 0; + int i, if_arg = 0; + + if (!arg || + (arg[0] == 'i' && arg[1] == 'f' && (arg[2] == ' ' || arg[2] == '\t'))) + { + if (default_breakpoint_valid) + { + if (selected_frame) + { + addr_string = (char *) xmalloc (15); + sprintf (addr_string, "*0x%x", selected_frame->pc); + if (arg) + if_arg = 1; + } + else + error ("No selected frame."); + } + else + error ("No default breakpoint address now."); + } + else + { + addr_string = (char *) xmalloc (strlen (arg) + 1); + strcpy (addr_string, arg); + } + + if (if_arg) + { + extra_args = arg; + extra_args_len = strlen (arg); + } + else + if (arg) + { + /* get the stuff after the function name or address */ + extra_args = strchr (arg, ' '); + if (extra_args) + { + extra_args++; + extra_args_len = strlen (extra_args); + } + } + + sals.sals = NULL; + sals.nelts = 0; + + beg_addr_string = addr_string; + sals = decode_line_1 (&addr_string, 1, (struct symtab *)NULL, 0, + (char ***)NULL); + + free (beg_addr_string); + old_chain = make_cleanup (free, sals.sals); + for (i = 0; (i < sals.nelts); i++) + { + sal = sals.sals[i]; + if (find_pc_partial_function (sal.pc, (char **)NULL, &low, &high)) + { + break_string = (char *) xmalloc (extra_args_len + 26); + if (extra_args_len) + sprintf (break_string, "*0x%x %s", high, extra_args); + else + sprintf (break_string, "*0x%x", high); + break_command_1 (break_string, flag, from_tty); + free(break_string); + } + else + error ("No function contains the specified address"); + } + if (sals.nelts > 1) + { + printf_filtered ("Multiple breakpoints were set.\n"); + printf_filtered ("Use the \"delete\" command to delete unwanted breakpoints.\n"); + } + do_cleanups(old_chain); +} + + /* Helper function for break_command_1 and disassemble_command. */ void @@ -2502,25 +4042,73 @@ resolve_sal_pc (sal) { CORE_ADDR pc; - if (sal->pc == 0 && sal->symtab != 0) - { - pc = find_line_pc (sal->symtab, sal->line); - if (pc == 0) - error ("No line %d in file \"%s\".", - sal->line, sal->symtab->filename); - sal->pc = pc; - } + if (sal->pc == 0 && sal->symtab != NULL) + { + if (!find_line_pc (sal->symtab, sal->line, &pc)) + error ("No line %d in file \"%s\".", + sal->line, sal->symtab->filename); + sal->pc = pc; + } + + if (sal->section == 0 && sal->symtab != NULL) + { + struct blockvector *bv; + struct block *b; + struct symbol *sym; + int index; + + bv = blockvector_for_pc_sect (sal->pc, 0, &index, sal->symtab); + if (bv != NULL) + { + b = BLOCKVECTOR_BLOCK (bv, index); + sym = block_function (b); + if (sym != NULL) + { + fixup_symbol_section (sym, sal->symtab->objfile); + sal->section = SYMBOL_BFD_SECTION (sym); + } + else + { + /* It really is worthwhile to have the section, so we'll just + have to look harder. This case can be executed if we have + line numbers but no functions (as can happen in assembly + source). */ + + struct minimal_symbol *msym; + + msym = lookup_minimal_symbol_by_pc (sal->pc); + if (msym) + sal->section = SYMBOL_BFD_SECTION (msym); + } + } + } +} + +void +break_command (arg, from_tty) + char *arg; + int from_tty; +{ + break_command_1 (arg, 0, from_tty); +} + +void +break_at_finish_command (arg, from_tty) + char *arg; + int from_tty; +{ + break_at_finish_command_1 (arg, 0, from_tty); } void -break_command (arg, from_tty) +break_at_finish_at_depth_command (arg, from_tty) char *arg; int from_tty; { - break_command_1 (arg, 0, from_tty); + break_at_finish_at_depth_command_1 (arg, 0, from_tty); } -static void +void tbreak_command (arg, from_tty) char *arg; int from_tty; @@ -2528,6 +4116,14 @@ tbreak_command (arg, from_tty) break_command_1 (arg, BP_TEMPFLAG, from_tty); } +void +tbreak_at_finish_command (arg, from_tty) + char *arg; + int from_tty; +{ + break_at_finish_command_1 (arg, BP_TEMPFLAG, from_tty); +} + static void hbreak_command (arg, from_tty) char *arg; @@ -2544,9 +4140,87 @@ thbreak_command (arg, from_tty) break_command_1 (arg, (BP_TEMPFLAG | BP_HARDWAREFLAG), from_tty); } +static void +stop_command (arg, from_tty) + char *arg; + int from_tty; +{ + printf_filtered ("Specify the type of breakpoint to set.\n\ +Usage: stop in \n\ + stop at \n"); +} + +static void +stopin_command (arg, from_tty) + char *arg; + int from_tty; +{ + int badInput = 0; + + if (arg == (char *)NULL) + badInput = 1; + else if (*arg != '*') + { + char *argptr = arg; + int hasColon = 0; + + /* look for a ':'. If this is a line number specification, then say + it is bad, otherwise, it should be an address or function/method + name */ + while (*argptr && !hasColon) + { + hasColon = (*argptr == ':'); + argptr++; + } + + if (hasColon) + badInput = (*argptr != ':'); /* Not a class::method */ + else + badInput = isdigit(*arg); /* a simple line number */ + } + + if (badInput) + printf_filtered("Usage: stop in \n"); + else + break_command_1 (arg, 0, from_tty); +} + +static void +stopat_command (arg, from_tty) + char *arg; + int from_tty; +{ + int badInput = 0; + + if (arg == (char *)NULL || *arg == '*') /* no line number */ + badInput = 1; + else + { + char *argptr = arg; + int hasColon = 0; + + /* look for a ':'. If there is a '::' then get out, otherwise + it is probably a line number. */ + while (*argptr && !hasColon) + { + hasColon = (*argptr == ':'); + argptr++; + } + + if (hasColon) + badInput = (*argptr == ':'); /* we have class::method */ + else + badInput = !isdigit(*arg); /* not a line number */ + } + + if (badInput) + printf_filtered("Usage: stop at \n"); + else + break_command_1 (arg, 0, from_tty); +} + /* ARGSUSED */ -/* accessflag: 0: watch write, 1: watch read, 2: watch access(read or write) -*/ +/* accessflag: 0: watch write, 1: watch read, 2: watch access(read or write) */ static void watch_command_1 (arg, accessflag, from_tty) char *arg; @@ -2558,7 +4232,8 @@ watch_command_1 (arg, accessflag, from_tty) struct expression *exp; struct block *exp_valid_block; struct value *val, *mark; - struct frame_info *frame, *prev_frame; + struct frame_info *frame; + struct frame_info *prev_frame = NULL; char *exp_start = NULL; char *exp_end = NULL; char *tok, *end_tok; @@ -2566,13 +4241,11 @@ watch_command_1 (arg, accessflag, from_tty) char *cond_start = NULL; char *cond_end = NULL; struct expression *cond = NULL; - int i, other_type_used, target_resources_ok; + int i, other_type_used, target_resources_ok = 0; enum bptype bp_type; int mem_cnt = 0; - sal.pc = 0; - sal.symtab = NULL; - sal.line = 0; + INIT_SAL (&sal); /* initialize to zeroes */ /* Parse arguments. */ innermost_block = NULL; @@ -2620,6 +4293,28 @@ watch_command_1 (arg, accessflag, from_tty) if (target_resources_ok < 0 && bp_type != bp_hardware_watchpoint) error ("Target resources have been allocated for other types of watchpoints."); } + +#if defined(HPUXHPPA) + /* On HP-UX if you set a h/w + watchpoint before the "run" command, the inferior dies with a e.g., + SIGILL once you start it. I initially believed this was due to a + bad interaction between page protection traps and the initial + startup sequence by the dynamic linker. + + However, I tried avoiding that by having HP-UX's implementation of + TARGET_CAN_USE_HW_WATCHPOINT return FALSE if there was no inferior_pid + yet, which forced slow watches before a "run" or "attach", and it + still fails somewhere in the startup code. + + Until I figure out what's happening, I'm disallowing watches altogether + before the "run" or "attach" command. We'll tell the user they must + set watches after getting the program started. */ + if (! target_has_execution) + { + warning ("can't do that without a running program; try \"break main\", \"run\" first"); + return; + } +#endif /* HPUXHPPA */ /* Now set up the breakpoint. */ b = set_raw_breakpoint (sal); @@ -2655,15 +4350,15 @@ watch_command_1 (arg, accessflag, from_tty) expression. */ if (innermost_block) { - struct breakpoint *scope_breakpoint; - struct symtab_and_line scope_sal; - if (prev_frame) { - scope_sal.pc = get_frame_pc (prev_frame); - scope_sal.symtab = NULL; - scope_sal.line = 0; - + struct breakpoint *scope_breakpoint; + struct symtab_and_line scope_sal; + + INIT_SAL (&scope_sal); /* initialize to zeroes */ + scope_sal.pc = get_frame_pc (prev_frame); + scope_sal.section = find_pc_overlay (scope_sal.pc); + scope_breakpoint = set_raw_breakpoint (scope_sal); set_breakpoint_count (breakpoint_count + 1); scope_breakpoint->number = breakpoint_count; @@ -2693,11 +4388,20 @@ watch_command_1 (arg, accessflag, from_tty) in hardware. If the watchpoint can not be handled in hardware return zero. */ +#if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT) +#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_size) \ + ((byte_size) <= (REGISTER_SIZE)) +#endif + static int can_use_hardware_watchpoint (v) struct value *v; { int found_memory_cnt = 0; + + /* Did the user specifically forbid us to use hardware watchpoints? */ + if (! can_use_hw_watchpoints) + return 0; /* Make sure all the intermediate values are in memory. Also make sure we found at least one memory expression. Guards against watch 0x12345, @@ -2707,7 +4411,7 @@ can_use_hardware_watchpoint (v) { if (v->lval == lval_memory) { - if (TYPE_LENGTH (VALUE_TYPE (v)) <= REGISTER_SIZE) + if (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT (TYPE_LENGTH (VALUE_TYPE (v)))) found_memory_cnt++; } else if (v->lval != not_lval && v->modifiable == 0) @@ -2780,7 +4484,7 @@ until_break_command (arg, from_tty) breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until); - old_chain = make_cleanup(delete_breakpoint, breakpoint); + old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint); /* Keep within the current frame */ @@ -2789,7 +4493,7 @@ until_break_command (arg, from_tty) sal = find_pc_line (prev_frame->pc, 0); sal.pc = prev_frame->pc; breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until); - make_cleanup(delete_breakpoint, breakpoint); + make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint); } proceed (-1, TARGET_SIGNAL_DEFAULT, 0); @@ -2827,7 +4531,10 @@ struct sal_chain struct symtab_and_line sal; }; -#if 0 +/* Not really used -- invocation in handle_gnu_4_16_catch_command + had been commented out in the v.4.16 sources, and stays + disabled there now because "catch NAME" syntax isn't allowed. + pai/1997-07-11 */ /* This isn't used; I don't know what it was for. */ /* For each catch clause identified in ARGS, run FUNCTION with that clause as an argument. */ @@ -2871,8 +4578,8 @@ map_catch_names (args, function) #if 0 if (function (p)) { - struct sal_chain *next - = (struct sal_chain *)alloca (sizeof (struct sal_chain)); + struct sal_chain *next = (struct sal_chain *) + alloca (sizeof (struct sal_chain)); next->next = sal_chain; next->sal = get_catch_sal (p); sal_chain = next; @@ -2887,7 +4594,6 @@ map_catch_names (args, function) while (*p == ' ' || *p == '\t') p++; } } -#endif /* 0 */ /* This shares a lot of code with `print_frame_label_vars' from stack.c. */ @@ -3003,10 +4709,401 @@ get_catch_sals (this_level_only) return sals; } +static void +ep_skip_leading_whitespace (s) + char ** s; +{ + if ((s == NULL) || (*s == NULL)) + return; + while (isspace(**s)) + *s += 1; +} + +/* This function examines a string, and attempts to find a token + that might be an event name in the leading characters. If a + possible match is found, a pointer to the last character of + the token is returned. Else, NULL is returned. */ +static char * +ep_find_event_name_end (arg) + char * arg; +{ + char * s = arg; + char * event_name_end = NULL; + + /* If we could depend upon the presense of strrpbrk, we'd use that... */ + if (arg == NULL) + return NULL; + + /* We break out of the loop when we find a token delimiter. + Basically, we're looking for alphanumerics and underscores; + anything else delimites the token. */ + while (*s != '\0') + { + if (! isalnum(*s) && (*s != '_')) + break; + event_name_end = s; + s++; + } + + return event_name_end; +} + + +/* This function attempts to parse an optional "if " clause + from the arg string. If one is not found, it returns NULL. + + Else, it returns a pointer to the condition string. (It does not + attempt to evaluate the string against a particular block.) And, + it updates arg to point to the first character following the parsed + if clause in the arg string. */ +static char * +ep_parse_optional_if_clause (arg) + char ** arg; +{ + char * cond_string; + + if (((*arg)[0] != 'i') || ((*arg)[1] != 'f') || !isspace((*arg)[2])) + return NULL; + + /* Skip the "if" keyword. */ + (*arg) += 2; + + /* Skip any extra leading whitespace, and record the start of the + condition string. */ + ep_skip_leading_whitespace (arg); + cond_string = *arg; + + /* Assume that the condition occupies the remainder of the arg string. */ + (*arg) += strlen (cond_string); + + return cond_string; +} + +/* This function attempts to parse an optional filename from the arg + string. If one is not found, it returns NULL. + + Else, it returns a pointer to the parsed filename. (This function + makes no attempt to verify that a file of that name exists, or is + accessible.) And, it updates arg to point to the first character + following the parsed filename in the arg string. + + Note that clients needing to preserve the returned filename for + future access should copy it to their own buffers. */ +static char * +ep_parse_optional_filename (arg) + char ** arg; +{ + static char filename [1024]; + char * arg_p = *arg; + int i; + char c; + + if ((*arg_p == '\0') || isspace (*arg_p)) + return NULL; + + for (i=0; ; i++) + { + c = *arg_p; + if (isspace (c)) + c = '\0'; + filename[i] = c; + if (c == '\0') + break; + arg_p++; + } + *arg = arg_p; + + return filename; +} + +/* Commands to deal with catching events, such as signals, exceptions, + process start/exit, etc. */ + +typedef enum {catch_fork, catch_vfork} catch_fork_kind; + +static void +catch_fork_command_1 (fork_kind, arg, tempflag, from_tty) + catch_fork_kind fork_kind; + char * arg; + int tempflag; + int from_tty; +{ + char * cond_string = NULL; + + ep_skip_leading_whitespace (&arg); + + /* The allowed syntax is: + catch [v]fork + catch [v]fork if + + First, check if there's an if clause. */ + cond_string = ep_parse_optional_if_clause (&arg); + + if ((*arg != '\0') && !isspace (*arg)) + error ("Junk at end of arguments."); + + /* If this target supports it, create a fork or vfork catchpoint + and enable reporting of such events. */ + switch (fork_kind) { + case catch_fork : + create_fork_event_catchpoint (tempflag, cond_string); + break; + case catch_vfork : + create_vfork_event_catchpoint (tempflag, cond_string); + break; + default : + error ("unsupported or unknown fork kind; cannot catch it"); + break; + } +} + +static void +catch_exec_command_1 (arg, tempflag, from_tty) + char * arg; + int tempflag; + int from_tty; +{ + char * cond_string = NULL; + + ep_skip_leading_whitespace (&arg); + + /* The allowed syntax is: + catch exec + catch exec if + + First, check if there's an if clause. */ + cond_string = ep_parse_optional_if_clause (&arg); + + if ((*arg != '\0') && !isspace (*arg)) + error ("Junk at end of arguments."); + + /* If this target supports it, create an exec catchpoint + and enable reporting of such events. */ + create_exec_event_catchpoint (tempflag, cond_string); +} + +#if defined(SOLIB_ADD) +static void +catch_load_command_1 (arg, tempflag, from_tty) + char * arg; + int tempflag; + int from_tty; +{ + char * dll_pathname = NULL; + char * cond_string = NULL; + + ep_skip_leading_whitespace (&arg); + + /* The allowed syntax is: + catch load + catch load if + catch load + catch load if + + The user is not allowed to specify the after an + if clause. + + We'll ignore the pathological case of a file named "if". + + First, check if there's an if clause. If so, then there + cannot be a filename. */ + cond_string = ep_parse_optional_if_clause (&arg); + + /* If there was an if clause, then there cannot be a filename. + Else, there might be a filename and an if clause. */ + if (cond_string == NULL) + { + dll_pathname = ep_parse_optional_filename (&arg); + ep_skip_leading_whitespace (&arg); + cond_string = ep_parse_optional_if_clause (&arg); + } + + if ((*arg != '\0') && !isspace (*arg)) + error ("Junk at end of arguments."); + + /* Create a load breakpoint that only triggers when a load of + the specified dll (or any dll, if no pathname was specified) + occurs. */ + SOLIB_CREATE_CATCH_LOAD_HOOK (inferior_pid, tempflag, dll_pathname, cond_string); +} + +static void +catch_unload_command_1 (arg, tempflag, from_tty) + char * arg; + int tempflag; + int from_tty; +{ + char * dll_pathname = NULL; + char * cond_string = NULL; + + ep_skip_leading_whitespace (&arg); + + /* The allowed syntax is: + catch unload + catch unload if + catch unload + catch unload if + + The user is not allowed to specify the after an + if clause. + + We'll ignore the pathological case of a file named "if". + + First, check if there's an if clause. If so, then there + cannot be a filename. */ + cond_string = ep_parse_optional_if_clause (&arg); + + /* If there was an if clause, then there cannot be a filename. + Else, there might be a filename and an if clause. */ + if (cond_string == NULL) + { + dll_pathname = ep_parse_optional_filename (&arg); + ep_skip_leading_whitespace (&arg); + cond_string = ep_parse_optional_if_clause (&arg); + } + + if ((*arg != '\0') && !isspace (*arg)) + error ("Junk at end of arguments."); + + /* Create an unload breakpoint that only triggers when an unload of + the specified dll (or any dll, if no pathname was specified) + occurs. */ + SOLIB_CREATE_CATCH_UNLOAD_HOOK (inferior_pid, tempflag, dll_pathname, cond_string); +} +#endif /* SOLIB_ADD */ + /* Commands to deal with catching exceptions. */ +/* Set a breakpoint at the specified callback routine for an + exception event callback */ + static void -catch_command_1 (arg, tempflag, from_tty) +create_exception_catchpoint (tempflag, cond_string, ex_event, sal) + int tempflag; + char * cond_string; + enum exception_event_kind ex_event; + struct symtab_and_line * sal; +{ + struct breakpoint * b; + int i; + int thread = -1; /* All threads. */ + + if (!sal) /* no exception support? */ + return; + + b = set_raw_breakpoint (*sal); + set_breakpoint_count (breakpoint_count + 1); + b->number = breakpoint_count; + b->cond = NULL; + b->cond_string = (cond_string == NULL) ? NULL : savestring (cond_string, strlen (cond_string)); + b->thread = thread; + b->addr_string = NULL; + b->enable = enabled; + b->disposition = tempflag ? del : donttouch; + switch (ex_event) + { + case EX_EVENT_THROW: + b->type = bp_catch_throw; + break; + case EX_EVENT_CATCH: + b->type = bp_catch_catch; + break; + default: /* error condition */ + b->type = bp_none; + b->enable = disabled; + error ("Internal error -- invalid catchpoint kind"); + } + mention (b); +} + +/* Deal with "catch catch" and "catch throw" commands */ + +static void +catch_exception_command_1 (ex_event, arg, tempflag, from_tty) + enum exception_event_kind ex_event; + char * arg; + int tempflag; + int from_tty; +{ + char * cond_string = NULL; + struct symtab_and_line * sal = NULL; + + ep_skip_leading_whitespace (&arg); + + cond_string = ep_parse_optional_if_clause (&arg); + + if ((*arg != '\0') && !isspace (*arg)) + error ("Junk at end of arguments."); + + if ((ex_event != EX_EVENT_THROW) && + (ex_event != EX_EVENT_CATCH)) + error ("Unsupported or unknown exception event; cannot catch it"); + + /* See if we can find a callback routine */ + sal = target_enable_exception_callback (ex_event, 1); + + if (sal) + { + /* We have callbacks from the runtime system for exceptions. + Set a breakpoint on the sal found, if no errors */ + if (sal != (struct symtab_and_line *) -1) + create_exception_catchpoint (tempflag, cond_string, ex_event, sal); + else + return; /* something went wrong with setting up callbacks */ + } + else + { + /* No callbacks from runtime system for exceptions. + Try GNU C++ exception breakpoints using labels in debug info. */ + if (ex_event == EX_EVENT_CATCH) + { + handle_gnu_4_16_catch_command (arg, tempflag, from_tty); + } + else if (ex_event == EX_EVENT_THROW) + { + /* Set a breakpoint on __raise_exception () */ + + fprintf_filtered (gdb_stderr, "Unsupported with this platform/compiler combination.\n"); + fprintf_filtered (gdb_stderr, "Perhaps you can achieve the effect you want by setting\n"); + fprintf_filtered (gdb_stderr, "a breakpoint on __raise_exception().\n"); + } + } +} + +/* Cover routine to allow wrapping target_enable_exception_catchpoints + inside a catch_errors */ + +static int +cover_target_enable_exception_callback (arg) + PTR arg; +{ + args_for_catchpoint_enable *args = arg; + struct symtab_and_line *sal; + sal = target_enable_exception_callback (args->kind, args->enable); + if (sal == NULL) + return 0; + else if (sal == (struct symtab_and_line *) -1) + return -1; + else + return 1; /*is valid*/ +} + + + +/* This is the original v.4.16 and earlier version of the + catch_command_1() function. Now that other flavours of "catch" + have been introduced, and since exception handling can be handled + in other ways (through target ops) also, this is used only for the + GNU C++ exception handling system. + Note: Only the "catch" flavour of GDB 4.16 is handled here. The + "catch NAME" is now no longer allowed in catch_command_1(). Also, + there was no code in GDB 4.16 for "catch throw". + + Called from catch_exception_command_1 () */ + + +static void +handle_gnu_4_16_catch_command (arg, tempflag, from_tty) char *arg; int tempflag; int from_tty; @@ -3021,8 +5118,7 @@ catch_command_1 (arg, tempflag, from_tty) char *save_arg; int i; - sal.line = sal.pc = sal.end = 0; - sal.symtab = 0; + INIT_SAL (&sal); /* initialize to zeroes */ /* If no arg given, or if first arg is 'if ', all active catch clauses are breakpointed. */ @@ -3037,7 +5133,13 @@ catch_command_1 (arg, tempflag, from_tty) { /* Grab selected catch clauses. */ error ("catch NAME not implemented"); + #if 0 + /* Not sure why this code has been disabled. I'm leaving + it disabled. We can never come here now anyway + since we don't allow the "catch NAME" syntax. + pai/1997-07-11 */ + /* This isn't used; I don't know what it was for. */ sals = map_catch_names (arg, catch_breakpoint); #endif @@ -3068,12 +5170,18 @@ catch_command_1 (arg, tempflag, from_tty) sal = sals.sals[i]; if (from_tty) - describe_other_breakpoints (sal.pc); + describe_other_breakpoints (sal.pc, sal.section); b = set_raw_breakpoint (sal); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; - b->type = bp_breakpoint; + b->type = bp_breakpoint; /* Important -- this is an ordinary breakpoint. + For platforms with callback support for exceptions, + create_exception_catchpoint() will create special + bp types (bp_catch_catch and bp_catch_throw), and + there is code in insert_breakpoints() and elsewhere + that depends on that. */ + b->cond = cond; b->enable = enabled; b->disposition = tempflag ? del : donttouch; @@ -3089,11 +5197,161 @@ catch_command_1 (arg, tempflag, from_tty) free ((PTR)sals.sals); } +#if 0 +/* This creates a temporary internal breakpoint + just to placate infrun */ +static struct breakpoint * +create_temp_exception_breakpoint (pc) + CORE_ADDR pc; +{ + struct symtab_and_line sal; + struct breakpoint *b; + + INIT_SAL(&sal); + sal.pc = pc; + sal.symtab = NULL; + sal.line = 0; + + b = set_raw_breakpoint (sal); + if (!b) + error ("Internal error -- couldn't set temp exception breakpoint"); + + b->type = bp_breakpoint; + b->disposition = del; + b->enable = enabled; + b->silent = 1; + b->number = internal_breakpoint_number--; + return b; +} +#endif + +static void +catch_command_1 (arg, tempflag, from_tty) + char *arg; + int tempflag; + int from_tty; +{ + + /* The first argument may be an event name, such as "start" or "load". + If so, then handle it as such. If it doesn't match an event name, + then attempt to interpret it as an exception name. (This latter is + the v4.16-and-earlier GDB meaning of the "catch" command.) + + First, try to find the bounds of what might be an event name. */ + char * arg1_start = arg; + char * arg1_end; + int arg1_length; + + if (arg1_start == NULL) + { + /* Old behaviour was to use pre-v-4.16 syntax */ + /* catch_throw_command_1 (arg1_start, tempflag, from_tty); */ + /* return; */ + /* Now, this is not allowed */ + error ("Catch requires an event name."); + + } + arg1_end = ep_find_event_name_end (arg1_start); + if (arg1_end == NULL) + error ("catch requires an event"); + arg1_length = arg1_end + 1 - arg1_start; + + /* Try to match what we found against known event names. */ + if (strncmp (arg1_start, "signal", arg1_length) == 0) + { + error ("Catch of signal not yet implemented"); + } + else if (strncmp (arg1_start, "catch", arg1_length) == 0) + { + catch_exception_command_1 (EX_EVENT_CATCH, arg1_end+1, tempflag, from_tty); + } + else if (strncmp (arg1_start, "throw", arg1_length) == 0) + { + catch_exception_command_1 (EX_EVENT_THROW, arg1_end+1, tempflag, from_tty); + } + else if (strncmp (arg1_start, "thread_start", arg1_length) == 0) + { + error ("Catch of thread_start not yet implemented"); + } + else if (strncmp (arg1_start, "thread_exit", arg1_length) == 0) + { + error ("Catch of thread_exit not yet implemented"); + } + else if (strncmp (arg1_start, "thread_join", arg1_length) == 0) + { + error ("Catch of thread_join not yet implemented"); + } + else if (strncmp (arg1_start, "start", arg1_length) == 0) + { + error ("Catch of start not yet implemented"); + } + else if (strncmp (arg1_start, "exit", arg1_length) == 0) + { + error ("Catch of exit not yet implemented"); + } + else if (strncmp (arg1_start, "fork", arg1_length) == 0) + { +#if defined(CHILD_INSERT_FORK_CATCHPOINT) + catch_fork_command_1 (catch_fork, arg1_end+1, tempflag, from_tty); +#else + error ("Catch of fork not yet implemented"); +#endif + } + else if (strncmp (arg1_start, "vfork", arg1_length) == 0) + { +#if defined(CHILD_INSERT_VFORK_CATCHPOINT) + catch_fork_command_1 (catch_vfork, arg1_end+1, tempflag, from_tty); +#else + error ("Catch of vfork not yet implemented"); +#endif + } + else if (strncmp (arg1_start, "exec", arg1_length) == 0) + { +#if defined(CHILD_INSERT_EXEC_CATCHPOINT) + catch_exec_command_1 (arg1_end+1, tempflag, from_tty); +#else + error ("Catch of exec not yet implemented"); +#endif + } + else if (strncmp (arg1_start, "load", arg1_length) == 0) + { +#if defined(SOLIB_ADD) + catch_load_command_1 (arg1_end+1, tempflag, from_tty); +#else + error ("Catch of load not implemented"); +#endif + } + else if (strncmp (arg1_start, "unload", arg1_length) == 0) + { +#if defined(SOLIB_ADD) + catch_unload_command_1 (arg1_end+1, tempflag, from_tty); +#else + error ("Catch of load not implemented"); +#endif + } + else if (strncmp (arg1_start, "stop", arg1_length) == 0) + { + error ("Catch of stop not yet implemented"); + } + + /* This doesn't appear to be an event name */ + + else + { + /* Pre-v.4.16 behaviour was to treat the argument + as the name of an exception */ + /* catch_throw_command_1 (arg1_start, tempflag, from_tty); */ + /* Now this is not allowed */ + error ("Unknown event kind specified for catch"); + + } +} + /* Used by the gui, could be made a worker for other things. */ struct breakpoint * set_breakpoint_sal (sal) -struct symtab_and_line sal; + struct symtab_and_line sal; { struct breakpoint *b; b = set_raw_breakpoint (sal); @@ -3140,12 +5398,23 @@ catch_command (arg, from_tty) catch_command_1 (arg, 0, from_tty); } + +static void +tcatch_command (arg, from_tty) + char *arg; + int from_tty; +{ + catch_command_1 (arg, 1, from_tty); +} + + static void clear_command (arg, from_tty) char *arg; int from_tty; { register struct breakpoint *b, *b1; + int default_match; struct symtabs_and_lines sals; struct symtab_and_line sal; register struct breakpoint *found; @@ -3154,34 +5423,68 @@ clear_command (arg, from_tty) if (arg) { sals = decode_line_spec (arg, 1); + default_match = 0; } else { - sals.sals = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line)); + sals.sals = (struct symtab_and_line *) + xmalloc (sizeof (struct symtab_and_line)); + INIT_SAL (&sal); /* initialize to zeroes */ sal.line = default_breakpoint_line; sal.symtab = default_breakpoint_symtab; - sal.pc = 0; + sal.pc = default_breakpoint_address; if (sal.symtab == 0) error ("No source file specified."); sals.sals[0] = sal; sals.nelts = 1; + + default_match = 1; } + /* For each line spec given, delete bps which correspond + to it. We do this in two loops: the first loop looks at + the initial bp(s) in the chain which should be deleted, + the second goes down the rest of the chain looking ahead + one so it can take those bps off the chain without messing + up the chain. */ + + for (i = 0; i < sals.nelts; i++) { /* If exact pc given, clear bpts at that pc. - But if sal.pc is zero, clear all bpts on specified line. */ + If line given (pc == 0), clear all bpts on specified line. + If defaulting, clear all bpts on default line + or at default pc. + + defaulting sal.pc != 0 tests to do + + 0 1 pc + 1 1 pc _and_ line + 0 0 line + 1 0 */ + sal = sals.sals[i]; found = (struct breakpoint *) 0; + + while (breakpoint_chain - && (sal.pc - ? breakpoint_chain->address == sal.pc - : (breakpoint_chain->source_file != NULL - && sal.symtab != NULL - && STREQ (breakpoint_chain->source_file, - sal.symtab->filename) - && breakpoint_chain->line_number == sal.line))) + /* Why don't we check here that this is not + a watchpoint, etc., as we do below? + I can't make it fail, but don't know + what's stopping the failure: a watchpoint + of the same address as "sal.pc" should + wind up being deleted. */ + + && ( ((sal.pc && (breakpoint_chain->address == sal.pc)) && + (overlay_debugging == 0 || + breakpoint_chain->section == sal.section)) + || ((default_match || (0 == sal.pc)) + && breakpoint_chain->source_file != NULL + && sal.symtab != NULL + && STREQ (breakpoint_chain->source_file, sal.symtab->filename) + && breakpoint_chain->line_number == sal.line))) + { b1 = breakpoint_chain; breakpoint_chain = b1->next; @@ -3190,17 +5493,23 @@ clear_command (arg, from_tty) } ALL_BREAKPOINTS (b) - while (b->next - && b->next->type != bp_watchpoint - && b->next->type != bp_hardware_watchpoint - && b->next->type != bp_read_watchpoint - && b->next->type != bp_access_watchpoint - && (sal.pc - ? b->next->address == sal.pc - : (b->next->source_file != NULL - && sal.symtab != NULL - && STREQ (b->next->source_file, sal.symtab->filename) - && b->next->line_number == sal.line))) + + while (b->next + && b->next->type != bp_none + && b->next->type != bp_watchpoint + && b->next->type != bp_hardware_watchpoint + && b->next->type != bp_read_watchpoint + && b->next->type != bp_access_watchpoint + && ( ((sal.pc && (b->next->address == sal.pc)) && + (overlay_debugging == 0 || + b->next->section == sal.section)) + || ((default_match || (0 == sal.pc)) + && b->next->source_file != NULL + && sal.symtab != NULL + && STREQ (b->next->source_file, sal.symtab->filename) + && b->next->line_number == sal.line))) + + { b1 = b->next; b->next = b1->next; @@ -3231,17 +5540,26 @@ clear_command (arg, from_tty) free ((PTR)sals.sals); } -/* Delete breakpoint in BS if they are `delete' breakpoints. +/* Delete breakpoint in BS if they are `delete' breakpoints and + all breakpoints that are marked for deletion, whether hit or not. This is called after any breakpoint is hit, or after errors. */ void breakpoint_auto_delete (bs) bpstat bs; { + struct breakpoint *b, *temp; + for (; bs; bs = bs->next) if (bs->breakpoint_at && bs->breakpoint_at->disposition == del && bs->stop) delete_breakpoint (bs->breakpoint_at); + + ALL_BREAKPOINTS_SAFE (b, temp) + { + if (b->disposition == del_at_next_stop) + delete_breakpoint (b); + } } /* Delete a breakpoint and clean up all traces of it in the data structures. */ @@ -3253,15 +5571,55 @@ delete_breakpoint (bpt) register struct breakpoint *b; register bpstat bs; + if (bpt == NULL) + error ("Internal error (attempted to delete a NULL breakpoint)"); + + + /* Has this bp already been deleted? This can happen because multiple + lists can hold pointers to bp's. bpstat lists are especial culprits. + + One example of this happening is a watchpoint's scope bp. When the + scope bp triggers, we notice that the watchpoint is out of scope, and + delete it. We also delete its scope bp. But the scope bp is marked + "auto-deleting", and is already on a bpstat. That bpstat is then + checked for auto-deleting bp's, which are deleted. + + A real solution to this problem might involve reference counts in bp's, + and/or giving them pointers back to their referencing bpstat's, and + teaching delete_breakpoint to only free a bp's storage when no more + references were extent. A cheaper bandaid was chosen. */ + if (bpt->type == bp_none) + return; + if (delete_breakpoint_hook) delete_breakpoint_hook (bpt); if (bpt->inserted) - remove_breakpoint (bpt); + remove_breakpoint (bpt, mark_uninserted); if (breakpoint_chain == bpt) breakpoint_chain = bpt->next; + /* If we have callback-style exception catchpoints, don't go through + the adjustments to the C++ runtime library etc. if the inferior + isn't actually running. target_enable_exception_callback for a + null target ops vector gives an undesirable error message, so we + check here and avoid it. Since currently (1997-09-17) only HP-UX aCC's + exceptions are supported in this way, it's OK for now. FIXME */ + if (ep_is_exception_catchpoint (bpt) && target_has_execution) + { + static char message1[] = "Error in deleting catchpoint %d:\n"; + static char message[sizeof (message1) + 30]; + args_for_catchpoint_enable args; + + sprintf (message, message1, bpt->number); /* Format possible error msg */ + args.kind = bpt->type == bp_catch_catch ? EX_EVENT_CATCH : EX_EVENT_THROW; + args.enable = 0; + catch_errors (cover_target_enable_exception_callback, &args, + message, RETURN_MASK_ALL); + } + + ALL_BREAKPOINTS (b) if (b->next == bpt) { @@ -3269,19 +5627,44 @@ delete_breakpoint (bpt) break; } - check_duplicates (bpt->address); + /* Before turning off the visuals for the bp, check to see that + there are no other bps at the same address. */ + if (tui_version) + { + int clearIt; + + ALL_BREAKPOINTS (b) + { + clearIt = (b->address != bpt->address); + if (!clearIt) + break; + } + + if (clearIt) + { + TUIDO(((TuiOpaqueFuncPtr)tui_vAllSetHasBreakAt, bpt, 0)); + TUIDO(((TuiOpaqueFuncPtr)tuiUpdateAllExecInfos)); + } + } + + check_duplicates (bpt->address, bpt->section); /* If this breakpoint was inserted, and there is another breakpoint at the same address, we need to insert the other breakpoint. */ if (bpt->inserted && bpt->type != bp_hardware_watchpoint && bpt->type != bp_read_watchpoint - && bpt->type != bp_access_watchpoint) + && bpt->type != bp_access_watchpoint + && bpt->type != bp_catch_fork + && bpt->type != bp_catch_vfork + && bpt->type != bp_catch_exec) { ALL_BREAKPOINTS (b) if (b->address == bpt->address + && b->section == bpt->section && !b->duplicate && b->enable != disabled - && b->enable != shlib_disabled) + && b->enable != shlib_disabled + && b->enable != call_disabled) { int val; val = target_insert_breakpoint (b->address, b->shadow_contents); @@ -3303,35 +5686,77 @@ delete_breakpoint (bpt) free (bpt->cond_string); if (bpt->addr_string != NULL) free (bpt->addr_string); + if (bpt->exp != NULL) + free (bpt->exp); if (bpt->exp_string != NULL) free (bpt->exp_string); + if (bpt->val != NULL) + value_free (bpt->val); if (bpt->source_file != NULL) free (bpt->source_file); + if (bpt->dll_pathname != NULL) + free (bpt->dll_pathname); + if (bpt->triggered_dll_pathname != NULL) + free (bpt->triggered_dll_pathname); + if (bpt->exec_pathname != NULL) + free (bpt->exec_pathname); /* Be sure no bpstat's are pointing at it after it's been freed. */ /* FIXME, how can we find all bpstat's? We just check stop_bpstat for now. */ for (bs = stop_bpstat; bs; bs = bs->next) if (bs->breakpoint_at == bpt) - bs->breakpoint_at = NULL; + { + bs->breakpoint_at = NULL; + + /* we'd call bpstat_clear_actions, but that free's stuff and due + to the multiple pointers pointing to one item with no + reference counts found anywhere through out the bpstat's (how + do you spell fragile?), we don't want to free things twice -- + better a memory leak than a corrupt malloc pool! */ + bs->commands = NULL; + bs->old_val = NULL; + } + /* On the chance that someone will soon try again to delete this same + bp, we mark it as deleted before freeing its storage. */ + bpt->type = bp_none; + free ((PTR)bpt); } -static void +void delete_command (arg, from_tty) char *arg; int from_tty; { + struct breakpoint *b, *temp; if (arg == 0) { + int breaks_to_delete = 0; + + /* Delete all breakpoints if no argument. + Do not delete internal or call-dummy breakpoints, these + have to be deleted with an explicit breakpoint number argument. */ + ALL_BREAKPOINTS (b) + { + if (b->type != bp_call_dummy && + b->type != bp_shlib_event && + b->number >= 0) + breaks_to_delete = 1; + } + /* Ask user only if there are some breakpoints to delete. */ if (!from_tty - || (breakpoint_chain && query ("Delete all breakpoints? "))) + || (breaks_to_delete && query ("Delete all breakpoints? "))) { - /* No arg; clear all breakpoints. */ - while (breakpoint_chain) - delete_breakpoint (breakpoint_chain); + ALL_BREAKPOINTS_SAFE (b, temp) + { + if (b->type != bp_call_dummy && + b->type != bp_shlib_event && + b->number >= 0) + delete_breakpoint (b); + } } } else @@ -3344,7 +5769,7 @@ delete_command (arg, from_tty) static int breakpoint_re_set_one (bint) - char *bint; + PTR bint; { struct breakpoint *b = (struct breakpoint *)bint; /* get past catch_errs */ struct value *mark; @@ -3355,8 +5780,13 @@ breakpoint_re_set_one (bint) switch (b->type) { + case bp_none: + warning ("attempted to reset apparently deleted breakpoint #%d?\n", b->number); + return 0; case bp_breakpoint: case bp_hardware_breakpoint: + case bp_catch_load: + case bp_catch_unload: if (b->addr_string == NULL) { /* Anything without a string can't be re-set. */ @@ -3410,8 +5840,10 @@ breakpoint_re_set_one (bint) strlen (sals.sals[i].symtab->filename)); b->line_number = sals.sals[i].line; b->address = sals.sals[i].pc; - - check_duplicates (b->address); + + /* Used to check for duplicates here, but that can + cause trouble, as it doesn't check for disable + breakpoints. */ mention (b); @@ -3419,7 +5851,14 @@ breakpoint_re_set_one (bint) rather than once for every breakpoint. */ breakpoints_changed (); } + b->section = sals.sals[i].section; b->enable = save_enable; /* Restore it, this worked. */ + + + /* Now that this is re-enabled, check_duplicates + can be used. */ + check_duplicates (b->address, b->section); + } free ((PTR)sals.sals); break; @@ -3437,9 +5876,13 @@ breakpoint_re_set_one (bint) particular level, but that's going to be less stable than filenames or functionnames. */ /* So for now, just use a global context. */ + if (b->exp) + free ((PTR)b->exp); b->exp = parse_expression (b->exp_string); b->exp_valid_block = innermost_block; mark = value_mark (); + if (b->val) + value_free (b->val); b->val = evaluate_expression (b->exp); release_value (b->val); if (VALUE_LAZY (b->val)) @@ -3448,13 +5891,25 @@ breakpoint_re_set_one (bint) if (b->cond_string != NULL) { s = b->cond_string; + if (b->cond) + free ((PTR)b->cond); b->cond = parse_exp_1 (&s, (struct block *)0, 0); } if (b->enable == enabled) mention (b); value_free_to_mark (mark); break; - + case bp_catch_catch: + case bp_catch_throw: + break; + /* We needn't really do anything to reset these, since the mask + that requests them is unaffected by e.g., new libraries being + loaded. */ + case bp_catch_fork: + case bp_catch_vfork: + case bp_catch_exec: + break; + default: printf_filtered ("Deleting unknown breakpoint type %d\n", b->type); /* fall through */ @@ -3499,8 +5954,7 @@ breakpoint_re_set () ALL_BREAKPOINTS_SAFE (b, temp) { sprintf (message, message1, b->number); /* Format possible error msg */ - catch_errors (breakpoint_re_set_one, (char *) b, message, - RETURN_MASK_ALL); + catch_errors (breakpoint_re_set_one, b, message, RETURN_MASK_ALL); } set_language (save_language); input_radix = save_input_radix; @@ -3509,6 +5963,7 @@ breakpoint_re_set () create_longjmp_breakpoint ("longjmp"); create_longjmp_breakpoint ("_longjmp"); create_longjmp_breakpoint ("siglongjmp"); + create_longjmp_breakpoint ("_siglongjmp"); create_longjmp_breakpoint (NULL); #endif @@ -3524,6 +5979,21 @@ breakpoint_re_set () If from_tty is nonzero, it prints a message to that effect, which ends with a period (no newline). */ +/* Reset the thread number of this breakpoint: + + - If the breakpoint is for all threads, leave it as-is. + - Else, reset it to the current thread for inferior_pid. */ +void +breakpoint_re_set_thread (b) + struct breakpoint * b; +{ + if (b->thread != -1) + { + if (in_thread_list (inferior_pid)) + b->thread = pid_to_thread_id (inferior_pid); + } +} + void set_ignore_count (bptnum, count, from_tty) int bptnum, count, from_tty; @@ -3628,113 +6098,6 @@ map_breakpoint_numbers (args, function) } void -enable_breakpoint (bpt) - struct breakpoint *bpt; -{ - struct frame_info *save_selected_frame = NULL; - int save_selected_frame_level = -1; - int target_resources_ok, other_type_used; - struct value *mark; - - if (bpt->type == bp_hardware_breakpoint) - { - int i; - i = hw_breakpoint_used_count(); - target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT( - bp_hardware_breakpoint, i+1, 0); - if (target_resources_ok == 0) - error ("No hardware breakpoint support in the target."); - else if (target_resources_ok < 0) - error ("Hardware breakpoints used exceeds limit."); - } - bpt->enable = enabled; - check_duplicates (bpt->address); - - if (bpt->type == bp_watchpoint || bpt->type == bp_hardware_watchpoint || - bpt->type == bp_read_watchpoint || bpt->type == bp_access_watchpoint) - { - if (bpt->exp_valid_block != NULL) - { - struct frame_info *fr = - find_frame_addr_in_frame_chain (bpt->watchpoint_frame); - if (fr == NULL) - { - printf_filtered ("\ -Cannot enable watchpoint %d because the block in which its expression\n\ -is valid is not currently in scope.\n", bpt->number); - bpt->enable = disabled; - return; - } - - save_selected_frame = selected_frame; - save_selected_frame_level = selected_frame_level; - select_frame (fr, -1); - } - - value_free (bpt->val); - mark = value_mark (); - bpt->val = evaluate_expression (bpt->exp); - release_value (bpt->val); - if (VALUE_LAZY (bpt->val)) - value_fetch_lazy (bpt->val); - - if (bpt->type == bp_hardware_watchpoint || - bpt->type == bp_read_watchpoint || - bpt->type == bp_access_watchpoint) - { - int i = hw_watchpoint_used_count (bpt->type, &other_type_used); - int mem_cnt = can_use_hardware_watchpoint (bpt->val); - - target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT( - bpt->type, i + mem_cnt, other_type_used); - /* we can consider of type is bp_hardware_watchpoint, convert to - bp_watchpoint in the following condition */ - if (target_resources_ok < 0) - { - printf_filtered("\ -Cannot enable watchpoint %d because target watch resources\n\ -have been allocated for other watchpoints.\n", bpt->number); - bpt->enable = disabled; - value_free_to_mark (mark); - return; - } - } - - if (save_selected_frame_level >= 0) - select_frame (save_selected_frame, save_selected_frame_level); - value_free_to_mark (mark); - } - - if (modify_breakpoint_hook) - modify_breakpoint_hook (bpt); -} - -/* ARGSUSED */ -static void -enable_command (args, from_tty) - char *args; - int from_tty; -{ - struct breakpoint *bpt; - if (args == 0) - ALL_BREAKPOINTS (bpt) - switch (bpt->type) - { - case bp_breakpoint: - case bp_hardware_breakpoint: - case bp_watchpoint: - case bp_hardware_watchpoint: - case bp_read_watchpoint: - case bp_access_watchpoint: - enable_breakpoint (bpt); - default: - continue; - } - else - map_breakpoint_numbers (args, enable_breakpoint); -} - -void disable_breakpoint (bpt) struct breakpoint *bpt; { @@ -3746,7 +6109,7 @@ disable_breakpoint (bpt) bpt->enable = disabled; - check_duplicates (bpt->address); + check_duplicates (bpt->address, bpt->section); if (modify_breakpoint_hook) modify_breakpoint_hook (bpt); @@ -3763,7 +6126,17 @@ disable_command (args, from_tty) ALL_BREAKPOINTS (bpt) switch (bpt->type) { + case bp_none: + warning ("attempted to disable apparently deleted breakpoint #%d?\n", bpt->number); + continue; case bp_breakpoint: + case bp_catch_load: + case bp_catch_unload: + case bp_catch_fork: + case bp_catch_vfork: + case bp_catch_exec: + case bp_catch_catch: + case bp_catch_throw: case bp_hardware_breakpoint: case bp_watchpoint: case bp_hardware_watchpoint: @@ -3778,16 +6151,17 @@ disable_command (args, from_tty) } static void -enable_once_breakpoint (bpt) +do_enable_breakpoint (bpt, disposition) struct breakpoint *bpt; + enum bpdisp disposition; { struct frame_info *save_selected_frame = NULL; int save_selected_frame_level = -1; int target_resources_ok, other_type_used; struct value *mark; - if (bpt->type == bp_hardware_breakpoint) - { + if (bpt->type == bp_hardware_breakpoint) + { int i; i = hw_breakpoint_used_count(); target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT( @@ -3799,8 +6173,8 @@ enable_once_breakpoint (bpt) } bpt->enable = enabled; - bpt->disposition = disable; - check_duplicates (bpt->address); + bpt->disposition = disposition; + check_duplicates (bpt->address, bpt->section); breakpoints_changed (); if (bpt->type == bp_watchpoint || bpt->type == bp_hardware_watchpoint || @@ -3809,7 +6183,12 @@ enable_once_breakpoint (bpt) if (bpt->exp_valid_block != NULL) { struct frame_info *fr = - find_frame_addr_in_frame_chain (bpt->watchpoint_frame); + + /* Ensure that we have the current frame. Else, this + next query may pessimistically be answered as, "No, + not within current scope". */ + get_current_frame (); + fr = find_frame_addr_in_frame_chain (bpt->watchpoint_frame); if (fr == NULL) { printf_filtered ("\ @@ -3836,9 +6215,12 @@ is valid is not currently in scope.\n", bpt->number); bpt->type == bp_access_watchpoint) { int i = hw_watchpoint_used_count (bpt->type, &other_type_used); - int mem_cnt = can_use_hardware_watchpoint(bpt->val); + int mem_cnt = can_use_hardware_watchpoint (bpt->val); + + /* Hack around 'unused var' error for some targets here */ + (void) mem_cnt, i; target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT( - bpt->type, i+mem_cnt, other_type_used); + bpt->type, i + mem_cnt, other_type_used); /* we can consider of type is bp_hardware_watchpoint, convert to bp_watchpoint in the following condition */ if (target_resources_ok < 0) @@ -3846,15 +6228,71 @@ is valid is not currently in scope.\n", bpt->number); printf_filtered("\ Cannot enable watchpoint %d because target watch resources\n\ have been allocated for other watchpoints.\n", bpt->number); - bpt->enable = disabled; - value_free_to_mark (mark); + bpt->enable = disabled; + value_free_to_mark (mark); + return; } } if (save_selected_frame_level >= 0) - select_frame (save_selected_frame, save_selected_frame_level); + select_and_print_frame (save_selected_frame, save_selected_frame_level); value_free_to_mark (mark); } + if (modify_breakpoint_hook) + modify_breakpoint_hook (bpt); +} + +void +enable_breakpoint (bpt) + struct breakpoint *bpt; +{ + do_enable_breakpoint (bpt, bpt->disposition); +} + +/* The enable command enables the specified breakpoints (or all defined + breakpoints) so they once again become (or continue to be) effective + in stopping the inferior. */ + +/* ARGSUSED */ +static void +enable_command (args, from_tty) + char *args; + int from_tty; +{ + register struct breakpoint *bpt; + if (args == 0) + ALL_BREAKPOINTS (bpt) + switch (bpt->type) + { + case bp_none: + warning ("attempted to enable apparently deleted breakpoint #%d?\n", bpt->number); + continue; + case bp_breakpoint: + case bp_catch_load: + case bp_catch_unload: + case bp_catch_fork: + case bp_catch_vfork: + case bp_catch_exec: + case bp_catch_catch: + case bp_catch_throw: + case bp_hardware_breakpoint: + case bp_watchpoint: + case bp_hardware_watchpoint: + case bp_read_watchpoint: + case bp_access_watchpoint: + enable_breakpoint (bpt); + default: + continue; + } + else + map_breakpoint_numbers (args, enable_breakpoint); +} + +static void +enable_once_breakpoint (bpt) + struct breakpoint *bpt; +{ + do_enable_breakpoint (bpt, disable); } /* ARGSUSED */ @@ -3870,11 +6308,7 @@ static void enable_delete_breakpoint (bpt) struct breakpoint *bpt; { - bpt->enable = enabled; - bpt->disposition = del; - - check_duplicates (bpt->address); - breakpoints_changed (); + do_enable_breakpoint (bpt, del); } /* ARGSUSED */ @@ -3911,6 +6345,8 @@ decode_line_spec_1 (string, funfirstline) void _initialize_breakpoint () { + struct cmd_list_element *c; + breakpoint_chain = 0; /* Don't bother to call set_breakpoint_count. $bpnum isn't useful before a breakpoint is set. */ @@ -3919,6 +6355,8 @@ _initialize_breakpoint () add_com ("ignore", class_breakpoint, ignore_command, "Set ignore-count of breakpoint number N to COUNT.\n\ Usage is `ignore N COUNT'."); + if (xdb_commands) + add_com_alias("bc", "ignore", class_breakpoint, 1); add_com ("commands", class_breakpoint, commands_command, "Set commands to be executed when a breakpoint is hit.\n\ @@ -3939,6 +6377,9 @@ expression to be evaluated whenever breakpoint N is reached. "); Like \"break\" except the breakpoint is only temporary,\n\ so it will be deleted when hit. Equivalent to \"break\" followed\n\ by using \"enable delete\" on the breakpoint number."); + add_com("txbreak", class_breakpoint, tbreak_at_finish_command, + "Set temporary breakpoint at procedure exit. Either there should\n\ +be no argument or the argument must be a depth.\n"); add_com ("hbreak", class_breakpoint, hbreak_command, "Set a hardware assisted breakpoint. Args like \"break\" command.\n\ @@ -3957,6 +6398,15 @@ With no subcommand, breakpoints are enabled until you command otherwise.\n\ This is used to cancel the effect of the \"disable\" command.\n\ With a subcommand you can enable temporarily.", &enablelist, "enable ", 1, &cmdlist); + if (xdb_commands) + add_com("ab", class_breakpoint, enable_command, + "Enable some breakpoints.\n\ +Give breakpoint numbers (separated by spaces) as arguments.\n\ +With no subcommand, breakpoints are enabled until you command otherwise.\n\ +This is used to cancel the effect of the \"disable\" command.\n\ +With a subcommand you can enable temporarily."); + + add_com_alias ("en", "enable", class_breakpoint, 1); add_abbrev_prefix_cmd ("breakpoints", class_breakpoint, enable_command, "Enable some breakpoints.\n\ @@ -3993,6 +6443,12 @@ A disabled breakpoint is not forgotten, but has no effect until reenabled.", &disablelist, "disable ", 1, &cmdlist); add_com_alias ("dis", "disable", class_breakpoint, 1); add_com_alias ("disa", "disable", class_breakpoint, 1); + if (xdb_commands) + add_com("sb", class_breakpoint, disable_command, + "Disable some breakpoints.\n\ +Arguments are breakpoint numbers with spaces in between.\n\ +To disable all breakpoints, give no argument.\n\ +A disabled breakpoint is not forgotten, but has no effect until reenabled."); add_cmd ("breakpoints", class_alias, disable_command, "Disable some breakpoints.\n\ @@ -4011,6 +6467,11 @@ Also a prefix command for deletion of other GDB objects.\n\ The \"unset\" command is also an alias for \"delete\".", &deletelist, "delete ", 1, &cmdlist); add_com_alias ("d", "delete", class_breakpoint, 1); + if (xdb_commands) + add_com ("db", class_breakpoint, delete_command, + "Delete some breakpoints.\n\ +Arguments are breakpoint numbers with spaces in between.\n\ +To delete all breakpoints, give no argument.\n"); add_cmd ("breakpoints", class_alias, delete_command, "Delete some breakpoints or auto-display expressions.\n\ @@ -4047,6 +6508,56 @@ Do \"help breakpoints\" for info on other commands dealing with breakpoints.", N add_com_alias ("bre", "break", class_run, 1); add_com_alias ("brea", "break", class_run, 1); + add_com("xbreak", class_breakpoint, break_at_finish_command, + concat("Set breakpoint at procedure exit. \n\ +Argument may be function name, or \"*\" and an address.\n\ +If function is specified, break at end of code for that function.\n\ +If an address is specified, break at the end of the function that contains \n\ +that exact address.\n", +"With no arg, uses current execution address of selected stack frame.\n\ +This is useful for breaking on return to a stack frame.\n\ +\n\ +Multiple breakpoints at one place are permitted, and useful if conditional.\n\ +\n\ +Do \"help breakpoints\" for info on other commands dealing with breakpoints.", NULL)); + add_com_alias ("xb", "xbreak", class_breakpoint, 1); + add_com_alias ("xbr", "xbreak", class_breakpoint, 1); + add_com_alias ("xbre", "xbreak", class_breakpoint, 1); + add_com_alias ("xbrea", "xbreak", class_breakpoint, 1); + + if (xdb_commands) + { + add_com_alias ("ba", "break", class_breakpoint, 1); + add_com_alias ("bu", "ubreak", class_breakpoint, 1); + add_com ("bx", class_breakpoint, break_at_finish_at_depth_command, + "Set breakpoint at procedure exit. Either there should\n\ +be no argument or the argument must be a depth.\n"); + } + + if (dbx_commands) + { + add_abbrev_prefix_cmd("stop", class_breakpoint, stop_command, + "Break in function/address or break at a line in the current file.", + &stoplist, "stop ", 1, &cmdlist); + add_cmd("in", class_breakpoint, stopin_command, + "Break in function or address.\n", &stoplist); + add_cmd("at", class_breakpoint, stopat_command, + "Break at a line in the current file.\n", &stoplist); + add_com("status", class_info, breakpoints_info, + concat ("Status of user-settable breakpoints, or breakpoint number NUMBER.\n\ +The \"Type\" column indicates one of:\n\ +\tbreakpoint - normal breakpoint\n\ +\twatchpoint - watchpoint\n\ +The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\n\ +the disposition of the breakpoint after it gets hit. \"dis\" means that the\n\ +breakpoint will be disabled. The \"Address\" and \"What\" columns indicate the\n\ +address and file/line number respectively.\n\n", +"Convenience variable \"$_\" and default examine address for \"x\"\n\ +are set to the address of the last breakpoint listed.\n\n\ +Convenience variable \"$bpnum\" contains the number of the last\n\ +breakpoint set.", NULL)); + } + add_info ("breakpoints", breakpoints_info, concat ("Status of user-settable breakpoints, or breakpoint number NUMBER.\n\ The \"Type\" column indicates one of:\n\ @@ -4061,6 +6572,21 @@ are set to the address of the last breakpoint listed.\n\n\ Convenience variable \"$bpnum\" contains the number of the last\n\ breakpoint set.", NULL)); + if (xdb_commands) + add_com("lb", class_breakpoint, breakpoints_info, + concat ("Status of user-settable breakpoints, or breakpoint number NUMBER.\n\ +The \"Type\" column indicates one of:\n\ +\tbreakpoint - normal breakpoint\n\ +\twatchpoint - watchpoint\n\ +The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\n\ +the disposition of the breakpoint after it gets hit. \"dis\" means that the\n\ +breakpoint will be disabled. The \"Address\" and \"What\" columns indicate the\n\ +address and file/line number respectively.\n\n", +"Convenience variable \"$_\" and default examine address for \"x\"\n\ +are set to the address of the last breakpoint listed.\n\n\ +Convenience variable \"$bpnum\" contains the number of the last\n\ +breakpoint set.", NULL)); + #if MAINTENANCE_CMDS add_cmd ("breakpoints", class_maintenance, maintenance_info_breakpoints, @@ -4085,18 +6611,49 @@ breakpoint set.", NULL), #endif /* MAINTENANCE_CMDS */ add_com ("catch", class_breakpoint, catch_command, - "Set breakpoints to catch exceptions that are raised.\n\ -Argument may be a single exception to catch, multiple exceptions\n\ -to catch, or the default exception \"default\". If no arguments\n\ -are given, breakpoints are set at all exception handlers catch clauses\n\ -within the current scope.\n\ -\n\ -A condition specified for the catch applies to all breakpoints set\n\ -with this command\n\ + "Set catchpoints to catch events.\n\ +Raised signals may be caught:\n\ +\tcatch signal - all signals\n\ +\tcatch signal - a particular signal\n\ +Raised exceptions may be caught:\n\ +\tcatch throw - all exceptions, when thrown\n\ +\tcatch throw - a particular exception, when thrown\n\ +\tcatch catch - all exceptions, when caught\n\ +\tcatch catch - a particular exception, when caught\n\ +Thread or process events may be caught:\n\ +\tcatch thread_start - any threads, just after creation\n\ +\tcatch thread_exit - any threads, just before expiration\n\ +\tcatch thread_join - any threads, just after joins\n\ +Process events may be caught:\n\ +\tcatch start - any processes, just after creation\n\ +\tcatch exit - any processes, just before expiration\n\ +\tcatch fork - calls to fork()\n\ +\tcatch vfork - calls to vfork()\n\ +\tcatch exec - calls to exec()\n\ +Dynamically-linked library events may be caught:\n\ +\tcatch load - loads of any library\n\ +\tcatch load - loads of a particular library\n\ +\tcatch unload - unloads of any library\n\ +\tcatch unload - unloads of a particular library\n\ +The act of your program's execution stopping may also be caught:\n\ +\tcatch stop\n\n\ +C++ exceptions may be caught:\n\ +\tcatch throw - all exceptions, when thrown\n\ +\tcatch catch - all exceptions, when caught\n\ \n\ +Do \"help set follow-fork-mode\" for info on debugging your program\n\ +after a fork or vfork is caught.\n\n\ Do \"help breakpoints\" for info on other commands dealing with breakpoints."); + + add_com ("tcatch", class_breakpoint, tcatch_command, + "Set temporary catchpoints to catch events.\n\ +Args like \"catch\" command.\n\ +Like \"catch\" except the catchpoint is only temporary,\n\ +so it will be deleted when hit. Equivalent to \"catch\" followed\n\ +by using \"enable delete\" on the catchpoint number."); + +add_com ("watch", class_breakpoint, watch_command, - add_com ("watch", class_breakpoint, watch_command, "Set a watchpoint for an expression.\n\ A watchpoint stops execution of your program whenever the value of\n\ an expression changes."); @@ -4114,4 +6671,16 @@ an expression is either read or written."); add_info ("watchpoints", breakpoints_info, "Synonym for ``info breakpoints''."); + + c = add_set_cmd ("can-use-hw-watchpoints", class_support, var_zinteger, + (char *) &can_use_hw_watchpoints, + "Set debugger's willingness to use watchpoint hardware.\n\ +If zero, gdb will not use hardware for new watchpoints, even if\n\ +such is available. (However, any hardware watchpoints that were\n\ +created before setting this to nonzero, will continue to use watchpoint\n\ +hardware.)", + &setlist); + add_show_from_set (c, &showlist); + + can_use_hw_watchpoints = 1; } diff --git a/contrib/gdb/gdb/breakpoint.h b/contrib/gdb/gdb/breakpoint.h index 90970cd..e2febac 100644 --- a/contrib/gdb/gdb/breakpoint.h +++ b/contrib/gdb/gdb/breakpoint.h @@ -1,5 +1,5 @@ /* Data structures associated with breakpoints in GDB. - Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1992, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc. This file is part of GDB. @@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ possible like a single-step to wait_for_inferior). */ enum bptype { + bp_none = 0, /* Eventpoint has been deleted. */ bp_breakpoint, /* Normal breakpoint */ bp_hardware_breakpoint, /* Hardware assisted breakpoint */ bp_until, /* used by until command */ @@ -87,17 +88,55 @@ enum bptype { when these significant events occur. GDB can then re-examine the dynamic linker's data structures to discover any newly loaded dynamic libraries. */ - bp_shlib_event + bp_shlib_event, + + /* These breakpoints are used to implement the "catch load" command + on platforms whose dynamic linkers support such functionality. */ + bp_catch_load, + + /* These breakpoints are used to implement the "catch unload" command + on platforms whose dynamic linkers support such functionality. */ + bp_catch_unload, + + /* These are not really breakpoints, but are catchpoints that + implement the "catch fork", "catch vfork" and "catch exec" commands + on platforms whose kernel support such functionality. (I.e., + kernels which can raise an event when a fork or exec occurs, as + opposed to the debugger setting breakpoints on functions named + "fork" or "exec".) */ + bp_catch_fork, + bp_catch_vfork, + bp_catch_exec, + + /* These are catchpoints to implement "catch catch" and "catch throw" + commands for C++ exception handling. */ + bp_catch_catch, + bp_catch_throw + }; /* States of enablement of breakpoint. */ -enum enable { disabled, enabled, shlib_disabled}; +enum enable { + disabled, /* The eventpoint is inactive, and cannot trigger. */ + enabled, /* The eventpoint is active, and can trigger. */ + shlib_disabled, /* The eventpoint's address is within an unloaded solib. + The eventpoint will be automatically enabled & reset + when that solib is loaded. */ + call_disabled /* The eventpoint has been disabled while a call into + the inferior is "in flight", because some eventpoints + interfere with the implementation of a call on some + targets. The eventpoint will be automatically enabled + & reset when the call "lands" (either completes, or + stops at another eventpoint). */ +}; + /* Disposition of breakpoint. Ie: what to do after hitting it. */ enum bpdisp { del, /* Delete it */ + del_at_next_stop, /* Delete at next stop, whether hit or not */ disable, /* Disable it */ donttouch /* Leave it alone */ }; @@ -204,6 +243,24 @@ struct breakpoint aborting, so you can back up to just before the abort. */ int hit_count; + /* Filename of a dynamically-linked library (dll), used for bp_catch_load + and bp_catch_unload (malloc'd), or NULL if any library is significant. */ + char * dll_pathname; + + /* Filename of a dll whose state change (e.g., load or unload) + triggered this catchpoint. This field is only vaid immediately + after this catchpoint has triggered. */ + char * triggered_dll_pathname; + + /* Process id of a child process whose forking triggered this catchpoint. + This field is only vaid immediately after this catchpoint has triggered. */ + int forked_inferior_pid; + + /* Filename of a program whose exec triggered this catchpoint. This + field is only vaid immediately after this catchpoint has triggered. */ + char * exec_pathname; + + asection *section; }; /* The following stuff is an abstract data type "bpstat" ("breakpoint status"). @@ -274,6 +331,10 @@ enum bpstat_what_main_action { keep checking. */ BPSTAT_WHAT_CHECK_SHLIBS, + /* Check the dynamic linker's data structures for new libraries, then + resume out of the dynamic linker's callback, stop and print. */ + BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK, + /* This is just used to keep track of how many enums there are. */ BPSTAT_WHAT_LAST }; @@ -294,6 +355,18 @@ struct bpstat_what bpstat_what PARAMS ((bpstat)); /* Find the bpstat associated with a breakpoint. NULL otherwise. */ bpstat bpstat_find_breakpoint PARAMS ((bpstat, struct breakpoint *)); +/* Find a step_resume breakpoint associated with this bpstat. + (If there are multiple step_resume bp's on the list, this function + will arbitrarily pick one.) + + It is an error to use this function if BPSTAT doesn't contain a + step_resume breakpoint. + + See wait_for_inferior's use of this function. + */ +extern struct breakpoint * +bpstat_find_step_resume_breakpoint PARAMS ((bpstat)); + /* Nonzero if a signal that we got in wait() was due to circumstances explained by the BS. */ /* Currently that is true if we have hit a breakpoint, or if there is @@ -305,6 +378,9 @@ bpstat bpstat_find_breakpoint PARAMS ((bpstat, struct breakpoint *)); just to things like whether watchpoints are set. */ extern int bpstat_should_step PARAMS ((void)); +/* Nonzero if there are enabled hardware watchpoints. */ +extern int bpstat_have_active_hw_watchpoints PARAMS ((void)); + /* Print a message indicating what happened. Returns nonzero to say that only the source line should be printed after this (zero return means print the frame as well as the source line). */ @@ -325,6 +401,12 @@ extern void bpstat_do_actions PARAMS ((bpstat *)); /* Modify BS so that the actions will not be performed. */ extern void bpstat_clear_actions PARAMS ((bpstat)); +/* Given a bpstat that records zero or more triggered eventpoints, this + function returns another bpstat which contains only the catchpoints + on that first list, if any. + */ +extern void bpstat_get_triggered_catchpoints PARAMS ((bpstat, bpstat *)); + /* Implementation: */ struct bpstats { @@ -349,6 +431,14 @@ struct bpstats bpstat_print, or -1 if it can't deal with it. */ int (*print_it) PARAMS((bpstat bs)); }; + +enum inf_context +{ + inf_starting, + inf_running, + inf_exited +}; + /* Prototypes for breakpoint-related functions. */ @@ -358,6 +448,8 @@ struct frame_info; extern int breakpoint_here_p PARAMS ((CORE_ADDR)); +extern int breakpoint_inserted_here_p PARAMS ((CORE_ADDR)); + extern int frame_in_dummy PARAMS ((struct frame_info *)); extern int breakpoint_thread_match PARAMS ((CORE_ADDR, int)); @@ -366,7 +458,9 @@ extern void until_break_command PARAMS ((char *, int)); extern void breakpoint_re_set PARAMS ((void)); -extern void clear_momentary_breakpoints PARAMS ((void)); +extern void breakpoint_re_set_thread PARAMS ((struct breakpoint *)); + +extern int ep_is_exception_catchpoint PARAMS ((struct breakpoint *)); extern struct breakpoint *set_momentary_breakpoint PARAMS ((struct symtab_and_line, struct frame_info *, enum bptype)); @@ -377,7 +471,7 @@ extern void set_default_breakpoint PARAMS ((int, CORE_ADDR, struct symtab *, int extern void mark_breakpoints_out PARAMS ((void)); -extern void breakpoint_init_inferior PARAMS ((void)); +extern void breakpoint_init_inferior PARAMS ((enum inf_context)); extern void delete_breakpoint PARAMS ((struct breakpoint *)); @@ -387,16 +481,80 @@ extern void breakpoint_clear_ignore_counts PARAMS ((void)); extern void break_command PARAMS ((char *, int)); +extern void tbreak_command PARAMS ((char *, int)); + extern int insert_breakpoints PARAMS ((void)); extern int remove_breakpoints PARAMS ((void)); +/* This function can be used to physically insert eventpoints from the + specified traced inferior process, without modifying the breakpoint + package's state. This can be useful for those targets which support + following the processes of a fork() or vfork() system call, when both + of the resulting two processes are to be followed. */ +extern int reattach_breakpoints PARAMS ((int)); + +/* This function can be used to update the breakpoint package's state + after an exec() system call has been executed. + + This function causes the following: + + - All eventpoints are marked "not inserted". + - All eventpoints with a symbolic address are reset such that + the symbolic address must be reevaluated before the eventpoints + can be reinserted. + - The solib breakpoints are explicitly removed from the breakpoint + list. + - A step-resume breakpoint, if any, is explicitly removed from the + breakpoint list. + - All eventpoints without a symbolic address are removed from the + breakpoint list. */ +extern void update_breakpoints_after_exec PARAMS ((void)); + +/* This function can be used to physically remove hardware breakpoints + and watchpoints from the specified traced inferior process, without + modifying the breakpoint package's state. This can be useful for + those targets which support following the processes of a fork() or + vfork() system call, when one of the resulting two processes is to + be detached and allowed to run free. + + It is an error to use this function on the process whose id is + inferior_pid. */ +extern int detach_breakpoints PARAMS ((int)); + extern void enable_longjmp_breakpoint PARAMS ((void)); extern void disable_longjmp_breakpoint PARAMS ((void)); extern void set_longjmp_resume_breakpoint PARAMS ((CORE_ADDR, struct frame_info *)); +/* These functions respectively disable or reenable all currently + enabled watchpoints. When disabled, the watchpoints are marked + call_disabled. When reenabled, they are marked enabled. + + The intended client of these functions is infcmd.c\run_stack_dummy. + + The inferior must be stopped, and all breakpoints removed, when + these functions are used. + + The need for these functions is that on some targets (e.g., HP-UX), + gdb is unable to unwind through the dummy frame that is pushed as + part of the implementation of a call command. Watchpoints can + cause the inferior to stop in places where this frame is visible, + and that can cause execution control to become very confused. + + Note that if a user sets breakpoints in an interactively call + function, the call_disabled watchpoints will have been reenabled + when the first such breakpoint is reached. However, on targets + that are unable to unwind through the call dummy frame, watches + of stack-based storage may then be deleted, because gdb will + believe that their watched storage is out of scope. (Sigh.) */ +extern void +disable_watchpoints_before_interactive_call_start PARAMS ((void)); + +extern void +enable_watchpoints_after_interactive_call_stop PARAMS ((void)); + extern void clear_breakpoint_hit_counts PARAMS ((void)); @@ -419,6 +577,28 @@ extern void create_solib_event_breakpoint PARAMS ((CORE_ADDR)); extern void remove_solib_event_breakpoints PARAMS ((void)); +extern void disable_breakpoints_in_shlibs PARAMS ((int silent)); + extern void re_enable_breakpoints_in_shlibs PARAMS ((void)); +extern void create_solib_load_event_breakpoint PARAMS ((char *, int, char *, char *)); + +extern void create_solib_unload_event_breakpoint PARAMS ((char *, int, char *, char *)); + +extern void create_fork_event_catchpoint PARAMS ((int, char *)); + +extern void create_vfork_event_catchpoint PARAMS ((int, char *)); + +extern void create_exec_event_catchpoint PARAMS ((int, char *)); + +/* This function returns TRUE if ep is a catchpoint. */ +extern int ep_is_catchpoint PARAMS ((struct breakpoint *)); + +/* This function returns TRUE if ep is a catchpoint of a + shared library (aka dynamically-linked library) event, + such as a library load or unload. */ +extern int ep_is_shlib_catchpoint PARAMS ((struct breakpoint *)); + +extern struct breakpoint *set_breakpoint_sal PARAMS ((struct symtab_and_line)); + #endif /* !defined (BREAKPOINT_H) */ diff --git a/contrib/gdb/gdb/buildsym.c b/contrib/gdb/gdb/buildsym.c index 5a5847a..24b64be 100644 --- a/contrib/gdb/gdb/buildsym.c +++ b/contrib/gdb/gdb/buildsym.c @@ -1,6 +1,5 @@ /* Support routines for building symbol tables in GDB's internal format. - Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1995, 1996 - Free Software Foundation, Inc. + Copyright 1986-1999 Free Software Foundation, Inc. This file is part of GDB. @@ -36,53 +35,67 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdb_string.h" /* Ask buildsym.h to define the vars it normally declares `extern'. */ -#define EXTERN /**/ +#define EXTERN /**/ #include "buildsym.h" /* Our own declarations */ #undef EXTERN /* For cleanup_undefined_types and finish_global_stabs (somewhat questionable--see comment where we call them). */ + #include "stabsread.h" -static int -compare_line_numbers PARAMS ((const void *, const void *)); +/* List of free `struct pending' structures for reuse. */ -static struct blockvector * -make_blockvector PARAMS ((struct objfile *)); +static struct pending *free_pendings; +/* Non-zero if symtab has line number info. This prevents an + otherwise empty symtab from being tossed. */ + +static int have_line_numbers; + +static int compare_line_numbers (const void *ln1p, const void *ln2p); -/* Initial sizes of data structures. These are realloc'd larger if needed, - and realloc'd down to the size actually used, when completed. */ + +/* Initial sizes of data structures. These are realloc'd larger if + needed, and realloc'd down to the size actually used, when + completed. */ #define INITIAL_CONTEXT_STACK_SIZE 10 #define INITIAL_LINE_VECTOR_LENGTH 1000 - + /* Complaints about the symbols we have encountered. */ +struct complaint block_end_complaint = +{"block end address less than block start address in %s (patched it)", 0, 0}; + +struct complaint anon_block_end_complaint = +{"block end address 0x%lx less than block start address 0x%lx (patched it)", 0, 0}; + struct complaint innerblock_complaint = - {"inner block not inside outer block in %s", 0, 0}; +{"inner block not inside outer block in %s", 0, 0}; struct complaint innerblock_anon_complaint = - {"inner block not inside outer block", 0, 0}; - -struct complaint blockvector_complaint = - {"block at 0x%lx out of order", 0, 0}; +{"inner block (0x%lx-0x%lx) not inside outer block (0x%lx-0x%lx)", 0, 0}; +struct complaint blockvector_complaint = +{"block at 0x%lx out of order", 0, 0}; /* maintain the lists of symbols and blocks */ /* Add a symbol to one of the lists of symbols. */ void -add_symbol_to_list (symbol, listhead) - struct symbol *symbol; - struct pending **listhead; +add_symbol_to_list (struct symbol *symbol, struct pending **listhead) { register struct pending *link; - - /* We keep PENDINGSIZE symbols in each link of the list. - If we don't have a link with room in it, add a new link. */ + + /* If this is an alias for another symbol, don't add it. */ + if (symbol->ginfo.name && symbol->ginfo.name[0] == '#') + return; + + /* We keep PENDINGSIZE symbols in each link of the list. If we + don't have a link with room in it, add a new link. */ if (*listhead == NULL || (*listhead)->nsyms == PENDINGSIZE) { if (free_pendings) @@ -103,21 +116,18 @@ add_symbol_to_list (symbol, listhead) (*listhead)->symbol[(*listhead)->nsyms++] = symbol; } -/* Find a symbol named NAME on a LIST. NAME need not be '\0'-terminated; - LENGTH is the length of the name. */ +/* Find a symbol named NAME on a LIST. NAME need not be + '\0'-terminated; LENGTH is the length of the name. */ struct symbol * -find_symbol_in_list (list, name, length) - struct pending *list; - char *name; - int length; +find_symbol_in_list (struct pending *list, char *name, int length) { int j; char *pp; while (list != NULL) { - for (j = list->nsyms; --j >= 0; ) + for (j = list->nsyms; --j >= 0;) { pp = SYMBOL_NAME (list->symbol[j]); if (*pp == *name && strncmp (pp, name, length) == 0 && @@ -131,61 +141,67 @@ find_symbol_in_list (list, name, length) return (NULL); } -/* At end of reading syms, or in case of quit, - really free as many `struct pending's as we can easily find. */ +/* At end of reading syms, or in case of quit, really free as many + `struct pending's as we can easily find. */ /* ARGSUSED */ void -really_free_pendings (foo) - int foo; +really_free_pendings (int foo) { struct pending *next, *next1; -#if 0 - struct pending_block *bnext, *bnext1; -#endif for (next = free_pendings; next; next = next1) { next1 = next->next; - free ((PTR)next); + free ((void *) next); } free_pendings = NULL; -#if 0 /* Now we make the links in the symbol_obstack, so don't free them. */ - for (bnext = pending_blocks; bnext; bnext = bnext1) - { - bnext1 = bnext->next; - free ((PTR)bnext); - } -#endif - pending_blocks = NULL; + free_pending_blocks (); for (next = file_symbols; next != NULL; next = next1) { next1 = next->next; - free ((PTR)next); + free ((void *) next); } file_symbols = NULL; for (next = global_symbols; next != NULL; next = next1) { next1 = next->next; - free ((PTR)next); + free ((void *) next); } global_symbols = NULL; } -/* Take one of the lists of symbols and make a block from it. - Keep the order the symbols have in the list (reversed from the input file). - Put the block on the list of pending blocks. */ +/* This function is called to discard any pending blocks. */ + +void +free_pending_blocks (void) +{ +#if 0 /* Now we make the links in the + symbol_obstack, so don't free + them. */ + struct pending_block *bnext, *bnext1; + + for (bnext = pending_blocks; bnext; bnext = bnext1) + { + bnext1 = bnext->next; + free ((void *) bnext); + } +#endif + pending_blocks = NULL; +} + +/* Take one of the lists of symbols and make a block from it. Keep + the order the symbols have in the list (reversed from the input + file). Put the block on the list of pending blocks. */ void -finish_block (symbol, listhead, old_blocks, start, end, objfile) - struct symbol *symbol; - struct pending **listhead; - struct pending_block *old_blocks; - CORE_ADDR start, end; - struct objfile *objfile; +finish_block (struct symbol *symbol, struct pending **listhead, + struct pending_block *old_blocks, + CORE_ADDR start, CORE_ADDR end, + struct objfile *objfile) { register struct pending *next, *next1; register struct block *block; @@ -200,11 +216,11 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) next; i += next->nsyms, next = next->next) { - /*EMPTY*/; + /* EMPTY */ ; } - block = (struct block *) obstack_alloc (&objfile -> symbol_obstack, - (sizeof (struct block) + ((i - 1) * sizeof (struct symbol *)))); + block = (struct block *) obstack_alloc (&objfile->symbol_obstack, + (sizeof (struct block) + ((i - 1) * sizeof (struct symbol *)))); /* Copy the symbols into the block. */ @@ -219,8 +235,9 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) BLOCK_START (block) = start; BLOCK_END (block) = end; - /* Superblock filled in when containing block is made */ + /* Superblock filled in when containing block is made */ BLOCK_SUPERBLOCK (block) = NULL; + BLOCK_GCC_COMPILED (block) = processing_gcc_compilation; /* Put the block in as the value of the symbol that names it. */ @@ -233,8 +250,9 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) if (TYPE_NFIELDS (ftype) <= 0) { - /* No parameter type information is recorded with the function's - type. Set that from the type of the parameter symbols. */ + /* No parameter type information is recorded with the + function's type. Set that from the type of the + parameter symbols. */ int nparams = 0, iparams; struct symbol *sym; for (i = 0; i < BLOCK_NSYMS (block); i++) @@ -246,20 +264,21 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) case LOC_REF_ARG: case LOC_REGPARM: case LOC_REGPARM_ADDR: + case LOC_BASEREG_ARG: + case LOC_LOCAL_ARG: nparams++; break; case LOC_UNDEF: case LOC_CONST: case LOC_STATIC: + case LOC_INDIRECT: case LOC_REGISTER: case LOC_LOCAL: case LOC_TYPEDEF: case LOC_LABEL: case LOC_BLOCK: case LOC_CONST_BYTES: - case LOC_LOCAL_ARG: case LOC_BASEREG: - case LOC_BASEREG_ARG: case LOC_UNRESOLVED: case LOC_OPTIMIZED_OUT: default: @@ -271,7 +290,7 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) TYPE_NFIELDS (ftype) = nparams; TYPE_FIELDS (ftype) = (struct field *) TYPE_ALLOC (ftype, nparams * sizeof (struct field)); - + for (i = iparams = 0; iparams < nparams; i++) { sym = BLOCK_SYM (block, i); @@ -281,21 +300,22 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) case LOC_REF_ARG: case LOC_REGPARM: case LOC_REGPARM_ADDR: + case LOC_BASEREG_ARG: + case LOC_LOCAL_ARG: TYPE_FIELD_TYPE (ftype, iparams) = SYMBOL_TYPE (sym); iparams++; break; case LOC_UNDEF: case LOC_CONST: case LOC_STATIC: + case LOC_INDIRECT: case LOC_REGISTER: case LOC_LOCAL: case LOC_TYPEDEF: case LOC_LABEL: case LOC_BLOCK: case LOC_CONST_BYTES: - case LOC_LOCAL_ARG: case LOC_BASEREG: - case LOC_BASEREG_ARG: case LOC_UNRESOLVED: case LOC_OPTIMIZED_OUT: default: @@ -320,9 +340,27 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) } *listhead = NULL; - /* Install this block as the superblock - of all blocks made since the start of this scope - that don't have superblocks yet. */ +#if 1 + /* Check to be sure that the blocks have an end address that is + greater than starting address */ + + if (BLOCK_END (block) < BLOCK_START (block)) + { + if (symbol) + { + complain (&block_end_complaint, SYMBOL_SOURCE_NAME (symbol)); + } + else + { + complain (&anon_block_end_complaint, BLOCK_END (block), BLOCK_START (block)); + } + /* Better than nothing */ + BLOCK_END (block) = BLOCK_START (block); + } +#endif + + /* Install this block as the superblock of all blocks made since the + start of this scope that don't have superblocks yet. */ opblock = NULL; for (pblock = pending_blocks; pblock != old_blocks; pblock = pblock->next) @@ -330,11 +368,11 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) if (BLOCK_SUPERBLOCK (pblock->block) == NULL) { #if 1 - /* Check to be sure the blocks are nested as we receive them. - If the compiler/assembler/linker work, this just burns a small - amount of time. */ + /* Check to be sure the blocks are nested as we receive + them. If the compiler/assembler/linker work, this just + burns a small amount of time. */ if (BLOCK_START (pblock->block) < BLOCK_START (block) || - BLOCK_END (pblock->block) > BLOCK_END (block)) + BLOCK_END (pblock->block) > BLOCK_END (block)) { if (symbol) { @@ -343,10 +381,14 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) } else { - complain (&innerblock_anon_complaint); + complain (&innerblock_anon_complaint, BLOCK_START (pblock->block), + BLOCK_END (pblock->block), BLOCK_START (block), + BLOCK_END (block)); } - BLOCK_START (pblock->block) = BLOCK_START (block); - BLOCK_END (pblock->block) = BLOCK_END (block); + if (BLOCK_START (pblock->block) < BLOCK_START (block)) + BLOCK_START (pblock->block) = BLOCK_START (block); + if (BLOCK_END (pblock->block) > BLOCK_END (block)) + BLOCK_END (pblock->block) = BLOCK_END (block); } #endif BLOCK_SUPERBLOCK (pblock->block) = block; @@ -354,15 +396,24 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) opblock = pblock; } - /* Record this block on the list of all blocks in the file. - Put it after opblock, or at the beginning if opblock is 0. - This puts the block in the list after all its subblocks. */ + record_pending_block (objfile, block, opblock); +} + +/* Record BLOCK on the list of all blocks in the file. Put it after + OPBLOCK, or at the beginning if opblock is NULL. This puts the + block in the list after all its subblocks. + + Allocate the pending block struct in the symbol_obstack to save + time. This wastes a little space. FIXME: Is it worth it? */ + +void +record_pending_block (struct objfile *objfile, struct block *block, + struct pending_block *opblock) +{ + register struct pending_block *pblock; - /* Allocate in the symbol_obstack to save time. - It wastes a little space. */ pblock = (struct pending_block *) - obstack_alloc (&objfile -> symbol_obstack, - sizeof (struct pending_block)); + obstack_alloc (&objfile->symbol_obstack, sizeof (struct pending_block)); pblock->block = block; if (opblock) { @@ -376,9 +427,12 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) } } -static struct blockvector * -make_blockvector (objfile) - struct objfile *objfile; +/* Note that this is only used in this file and in dstread.c, which + should be fixed to not need direct access to this function. When + that is done, it can be made static again. */ + +struct blockvector * +make_blockvector (struct objfile *objfile) { register struct pending_block *next; register struct blockvector *blockvector; @@ -386,18 +440,20 @@ make_blockvector (objfile) /* Count the length of the list of blocks. */ - for (next = pending_blocks, i = 0; next; next = next->next, i++) {;} + for (next = pending_blocks, i = 0; next; next = next->next, i++) + {; + } blockvector = (struct blockvector *) - obstack_alloc (&objfile -> symbol_obstack, + obstack_alloc (&objfile->symbol_obstack, (sizeof (struct blockvector) + (i - 1) * sizeof (struct block *))); - /* Copy the blocks into the blockvector. - This is done in reverse order, which happens to put - the blocks into the proper order (ascending starting address). - finish_block has hair to insert each block into the list - after its subblocks in order to make sure this is true. */ + /* Copy the blocks into the blockvector. This is done in reverse + order, which happens to put the blocks into the proper order + (ascending starting address). finish_block has hair to insert + each block into the list after its subblocks in order to make + sure this is true. */ BLOCKVECTOR_NBLOCKS (blockvector) = i; for (next = pending_blocks; next; next = next->next) @@ -405,7 +461,8 @@ make_blockvector (objfile) BLOCKVECTOR_BLOCK (blockvector, --i) = next->block; } -#if 0 /* Now we make the links in the obstack, so don't free them. */ +#if 0 /* Now we make the links in the + obstack, so don't free them. */ /* Now free the links of the list, and empty the list. */ for (next = pending_blocks; next; next = next1) @@ -416,28 +473,29 @@ make_blockvector (objfile) #endif pending_blocks = NULL; -#if 1 /* FIXME, shut this off after a while to speed up symbol reading. */ - /* Some compilers output blocks in the wrong order, but we depend - on their being in the right order so we can binary search. - Check the order and moan about it. FIXME. */ +#if 1 /* FIXME, shut this off after a while + to speed up symbol reading. */ + /* Some compilers output blocks in the wrong order, but we depend on + their being in the right order so we can binary search. Check the + order and moan about it. FIXME. */ if (BLOCKVECTOR_NBLOCKS (blockvector) > 1) { for (i = 1; i < BLOCKVECTOR_NBLOCKS (blockvector); i++) { - if (BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i-1)) - > BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i))) + if (BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i - 1)) + > BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i))) { /* FIXME-32x64: loses if CORE_ADDR doesn't fit in a - long. Possible solutions include a version of - complain which takes a callback, a - sprintf_address_numeric to match - print_address_numeric, or a way to set up a GDB_FILE - * which causes sprintf rather than fprintf to be - called. */ - - complain (&blockvector_complaint, - (unsigned long) BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i))); + long. Possible solutions include a version of + complain which takes a callback, a + sprintf_address_numeric to match + print_address_numeric, or a way to set up a GDB_FILE + which causes sprintf rather than fprintf to be + called. */ + + complain (&blockvector_complaint, + (unsigned long) BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i))); } } } @@ -445,22 +503,19 @@ make_blockvector (objfile) return (blockvector); } - -/* Start recording information about source code that came from an included - (or otherwise merged-in) source file with a different name. NAME is - the name of the file (cannot be NULL), DIRNAME is the directory in which - it resides (or NULL if not known). */ +/* Start recording information about source code that came from an + included (or otherwise merged-in) source file with a different + name. NAME is the name of the file (cannot be NULL), DIRNAME is + the directory in which it resides (or NULL if not known). */ void -start_subfile (name, dirname) - char *name; - char *dirname; +start_subfile (char *name, char *dirname) { register struct subfile *subfile; - /* See if this subfile is already known as a subfile of the - current main source file. */ + /* See if this subfile is already known as a subfile of the current + main source file. */ for (subfile = subfiles; subfile; subfile = subfile->next) { @@ -471,9 +526,9 @@ start_subfile (name, dirname) } } - /* This subfile is not known. Add an entry for it. - Make an entry for this subfile in the list of all subfiles - of the current main source file. */ + /* This subfile is not known. Add an entry for it. Make an entry + for this subfile in the list of all subfiles of the current main + source file. */ subfile = (struct subfile *) xmalloc (sizeof (struct subfile)); subfile->next = subfiles; @@ -484,20 +539,20 @@ start_subfile (name, dirname) subfile->name = (name == NULL) ? NULL : savestring (name, strlen (name)); subfile->dirname = (dirname == NULL) ? NULL : savestring (dirname, strlen (dirname)); - + /* Initialize line-number recording for this subfile. */ subfile->line_vector = NULL; - /* Default the source language to whatever can be deduced from - the filename. If nothing can be deduced (such as for a C/C++ - include file with a ".h" extension), then inherit whatever - language the previous subfile had. This kludgery is necessary - because there is no standard way in some object formats to - record the source language. Also, when symtabs are allocated - we try to deduce a language then as well, but it is too late - for us to use that information while reading symbols, since - symtabs aren't allocated until after all the symbols have - been processed for a given source file. */ + /* Default the source language to whatever can be deduced from the + filename. If nothing can be deduced (such as for a C/C++ include + file with a ".h" extension), then inherit whatever language the + previous subfile had. This kludgery is necessary because there + is no standard way in some object formats to record the source + language. Also, when symtabs are allocated we try to deduce a + language then as well, but it is too late for us to use that + information while reading symbols, since symtabs aren't allocated + until after all the symbols have been processed for a given + source file. */ subfile->language = deduce_language_from_filename (subfile->name); if (subfile->language == language_unknown && @@ -506,15 +561,19 @@ start_subfile (name, dirname) subfile->language = subfile->next->language; } + /* Initialize the debug format string to NULL. We may supply it + later via a call to record_debugformat. */ + subfile->debugformat = NULL; + /* cfront output is a C program, so in most ways it looks like a C program. But to demangle we need to set the language to C++. We can distinguish cfront code by the fact that it has #line directives which specify a file name ending in .C. - - So if the filename of this subfile ends in .C, then change the language - of any pending subfiles from C to C++. We also accept any other C++ - suffixes accepted by deduce_language_from_filename (in particular, - some people use .cxx with cfront). */ + + So if the filename of this subfile ends in .C, then change the + language of any pending subfiles from C to C++. We also accept + any other C++ suffixes accepted by deduce_language_from_filename + (in particular, some people use .cxx with cfront). */ /* Likewise for f2c. */ if (subfile->name) @@ -538,40 +597,38 @@ start_subfile (name, dirname) } } -/* For stabs readers, the first N_SO symbol is assumed to be the source - file name, and the subfile struct is initialized using that assumption. - If another N_SO symbol is later seen, immediately following the first - one, then the first one is assumed to be the directory name and the - second one is really the source file name. +/* For stabs readers, the first N_SO symbol is assumed to be the + source file name, and the subfile struct is initialized using that + assumption. If another N_SO symbol is later seen, immediately + following the first one, then the first one is assumed to be the + directory name and the second one is really the source file name. - So we have to patch up the subfile struct by moving the old name value to - dirname and remembering the new name. Some sanity checking is performed - to ensure that the state of the subfile struct is reasonable and that the - old name we are assuming to be a directory name actually is (by checking - for a trailing '/'). */ + So we have to patch up the subfile struct by moving the old name + value to dirname and remembering the new name. Some sanity + checking is performed to ensure that the state of the subfile + struct is reasonable and that the old name we are assuming to be a + directory name actually is (by checking for a trailing '/'). */ void -patch_subfile_names (subfile, name) - struct subfile *subfile; - char *name; +patch_subfile_names (struct subfile *subfile, char *name) { if (subfile != NULL && subfile->dirname == NULL && subfile->name != NULL - && subfile->name[strlen(subfile->name)-1] == '/') + && subfile->name[strlen (subfile->name) - 1] == '/') { subfile->dirname = subfile->name; subfile->name = savestring (name, strlen (name)); last_source_file = name; /* Default the source language to whatever can be deduced from - the filename. If nothing can be deduced (such as for a C/C++ - include file with a ".h" extension), then inherit whatever - language the previous subfile had. This kludgery is necessary - because there is no standard way in some object formats to - record the source language. Also, when symtabs are allocated - we try to deduce a language then as well, but it is too late - for us to use that information while reading symbols, since - symtabs aren't allocated until after all the symbols have - been processed for a given source file. */ + the filename. If nothing can be deduced (such as for a C/C++ + include file with a ".h" extension), then inherit whatever + language the previous subfile had. This kludgery is + necessary because there is no standard way in some object + formats to record the source language. Also, when symtabs + are allocated we try to deduce a language then as well, but + it is too late for us to use that information while reading + symbols, since symtabs aren't allocated until after all the + symbols have been processed for a given source file. */ subfile->language = deduce_language_from_filename (subfile->name); if (subfile->language == language_unknown && @@ -581,18 +638,17 @@ patch_subfile_names (subfile, name) } } } - -/* Handle the N_BINCL and N_EINCL symbol types - that act like N_SOL for switching source files - (different subfiles, as we call them) within one object file, - but using a stack rather than in an arbitrary order. */ +/* Handle the N_BINCL and N_EINCL symbol types that act like N_SOL for + switching source files (different subfiles, as we call them) within + one object file, but using a stack rather than in an arbitrary + order. */ void -push_subfile () +push_subfile (void) { register struct subfile_stack *tem - = (struct subfile_stack *) xmalloc (sizeof (struct subfile_stack)); + = (struct subfile_stack *) xmalloc (sizeof (struct subfile_stack)); tem->next = subfile_stack; subfile_stack = tem; @@ -604,7 +660,7 @@ push_subfile () } char * -pop_subfile () +pop_subfile (void) { register char *name; register struct subfile_stack *link = subfile_stack; @@ -615,19 +671,15 @@ pop_subfile () } name = link->name; subfile_stack = link->next; - free ((PTR)link); + free ((void *) link); return (name); } - -/* Add a linetable entry for line number LINE and address PC to the line - vector for SUBFILE. */ +/* Add a linetable entry for line number LINE and address PC to the + line vector for SUBFILE. */ void -record_line (subfile, line, pc) - register struct subfile *subfile; - int line; - CORE_ADDR pc; +record_line (register struct subfile *subfile, int line, CORE_ADDR pc) { struct linetable_entry *e; /* Ignore the dummy line number in libg.o */ @@ -643,29 +695,30 @@ record_line (subfile, line, pc) subfile->line_vector_length = INITIAL_LINE_VECTOR_LENGTH; subfile->line_vector = (struct linetable *) xmalloc (sizeof (struct linetable) - + subfile->line_vector_length * sizeof (struct linetable_entry)); + + subfile->line_vector_length * sizeof (struct linetable_entry)); subfile->line_vector->nitems = 0; + have_line_numbers = 1; } if (subfile->line_vector->nitems + 1 >= subfile->line_vector_length) { subfile->line_vector_length *= 2; subfile->line_vector = (struct linetable *) - xrealloc ((char *) subfile->line_vector, (sizeof (struct linetable) - + subfile->line_vector_length * sizeof (struct linetable_entry))); + xrealloc ((char *) subfile->line_vector, + (sizeof (struct linetable) + + (subfile->line_vector_length + * sizeof (struct linetable_entry)))); } e = subfile->line_vector->item + subfile->line_vector->nitems++; - e->line = line; e->pc = pc; + e->line = line; + e->pc = pc; } - /* Needed in order to sort line tables from IBM xcoff files. Sigh! */ static int -compare_line_numbers (ln1p, ln2p) - const PTR ln1p; - const PTR ln2p; +compare_line_numbers (const void *ln1p, const void *ln2p) { struct linetable_entry *ln1 = (struct linetable_entry *) ln1p; struct linetable_entry *ln2 = (struct linetable_entry *) ln2p; @@ -682,18 +735,14 @@ compare_line_numbers (ln1p, ln2p) behavior (see comment at struct linetable in symtab.h). */ return ln1->line - ln2->line; } - -/* Start a new symtab for a new source file. - Called, for example, when a stabs symbol of type N_SO is seen, or when - a DWARF TAG_compile_unit DIE is seen. - It indicates the start of data for one original source file. */ +/* Start a new symtab for a new source file. Called, for example, + when a stabs symbol of type N_SO is seen, or when a DWARF + TAG_compile_unit DIE is seen. It indicates the start of data for + one original source file. */ void -start_symtab (name, dirname, start_addr) - char *name; - char *dirname; - CORE_ADDR start_addr; +start_symtab (char *name, char *dirname, CORE_ADDR start_addr) { last_source_file = name; @@ -701,9 +750,10 @@ start_symtab (name, dirname, start_addr) file_symbols = NULL; global_symbols = NULL; within_function = 0; + have_line_numbers = 0; - /* Context stack is initially empty. Allocate first one with room for - 10 levels; reuse it forever afterward. */ + /* Context stack is initially empty. Allocate first one with room + for 10 levels; reuse it forever afterward. */ if (context_stack == NULL) { context_stack_size = INITIAL_CONTEXT_STACK_SIZE; @@ -712,35 +762,33 @@ start_symtab (name, dirname, start_addr) } context_stack_depth = 0; - /* Initialize the list of sub source files with one entry - for this file (the top-level source file). */ + /* Initialize the list of sub source files with one entry for this + file (the top-level source file). */ subfiles = NULL; current_subfile = NULL; start_subfile (name, dirname); } -/* Finish the symbol definitions for one main source file, - close off all the lexical contexts for that file - (creating struct block's for them), then make the struct symtab - for that file and put it in the list of all such. +/* Finish the symbol definitions for one main source file, close off + all the lexical contexts for that file (creating struct block's for + them), then make the struct symtab for that file and put it in the + list of all such. - END_ADDR is the address of the end of the file's text. - SECTION is the section number (in objfile->section_offsets) of - the blockvector and linetable. + END_ADDR is the address of the end of the file's text. SECTION is + the section number (in objfile->section_offsets) of the blockvector + and linetable. - Note that it is possible for end_symtab() to return NULL. In particular, - for the DWARF case at least, it will return NULL when it finds a - compilation unit that has exactly one DIE, a TAG_compile_unit DIE. This - can happen when we link in an object file that was compiled from an empty - source file. Returning NULL is probably not the correct thing to do, - because then gdb will never know about this empty file (FIXME). */ + Note that it is possible for end_symtab() to return NULL. In + particular, for the DWARF case at least, it will return NULL when + it finds a compilation unit that has exactly one DIE, a + TAG_compile_unit DIE. This can happen when we link in an object + file that was compiled from an empty source file. Returning NULL + is probably not the correct thing to do, because then gdb will + never know about this empty file (FIXME). */ struct symtab * -end_symtab (end_addr, objfile, section) - CORE_ADDR end_addr; - struct objfile *objfile; - int section; +end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section) { register struct symtab *symtab = NULL; register struct blockvector *blockvector; @@ -748,25 +796,25 @@ end_symtab (end_addr, objfile, section) register struct context_stack *cstk; struct subfile *nextsub; - /* Finish the lexical context of the last function in the file; - pop the context stack. */ + /* Finish the lexical context of the last function in the file; pop + the context stack. */ if (context_stack_depth > 0) { - context_stack_depth--; - cstk = &context_stack[context_stack_depth]; + cstk = pop_context (); /* Make a block for the local symbols within. */ finish_block (cstk->name, &local_symbols, cstk->old_blocks, cstk->start_addr, end_addr, objfile); if (context_stack_depth > 0) { - /* This is said to happen with SCO. The old coffread.c code - simply emptied the context stack, so we do the same. FIXME: - Find out why it is happening. This is not believed to happen - in most cases (even for coffread.c); it used to be an abort(). */ + /* This is said to happen with SCO. The old coffread.c + code simply emptied the context stack, so we do the + same. FIXME: Find out why it is happening. This is not + believed to happen in most cases (even for coffread.c); + it used to be an abort(). */ static struct complaint msg = - {"Context stack not empty in end_symtab", 0, 0}; + {"Context stack not empty in end_symtab", 0, 0}; complain (&msg); context_stack_depth = 0; } @@ -776,13 +824,12 @@ end_symtab (end_addr, objfile, section) OBJF_REORDERED is true, then sort the pending blocks. */ if ((objfile->flags & OBJF_REORDERED) && pending_blocks) { - /* FIXME! Remove this horrid bubble sort and use qsort!!! - It'd be a whole lot easier if they weren't in a linked list!!! */ + /* FIXME! Remove this horrid bubble sort and use merge sort!!! */ int swapped; do { struct pending_block *pb, *pbnext; - + pb = pending_blocks; pbnext = pb->next; swapped = 0; @@ -790,8 +837,8 @@ end_symtab (end_addr, objfile, section) while (pbnext) { /* swap blocks if unordered! */ - - if (BLOCK_START(pb->block) < BLOCK_START(pbnext->block)) + + if (BLOCK_START (pb->block) < BLOCK_START (pbnext->block)) { struct block *tmp = pb->block; pb->block = pbnext->block; @@ -801,13 +848,14 @@ end_symtab (end_addr, objfile, section) pb = pbnext; pbnext = pbnext->next; } - } while (swapped); + } + while (swapped); } /* Cleanup any undefined types that have been left hanging around (this needs to be done before the finish_blocks so that file_symbols is still good). - + Both cleanup_undefined_types and finish_global_stabs are stabs specific, but harmless for other symbol readers, since on gdb startup or when finished reading stabs, the state is set so these @@ -819,14 +867,17 @@ end_symtab (end_addr, objfile, section) if (pending_blocks == NULL && file_symbols == NULL - && global_symbols == NULL) + && global_symbols == NULL + && have_line_numbers == 0) { - /* Ignore symtabs that have no functions with real debugging info */ + /* Ignore symtabs that have no functions with real debugging + info. */ blockvector = NULL; } else { - /* Define the STATIC_BLOCK & GLOBAL_BLOCK, and build the blockvector. */ + /* Define the STATIC_BLOCK & GLOBAL_BLOCK, and build the + blockvector. */ finish_block (0, &file_symbols, 0, last_source_start_addr, end_addr, objfile); finish_block (0, &global_symbols, 0, last_source_start_addr, end_addr, @@ -834,9 +885,10 @@ end_symtab (end_addr, objfile, section) blockvector = make_blockvector (objfile); } -#ifdef PROCESS_LINENUMBER_HOOK - PROCESS_LINENUMBER_HOOK (); /* Needed for xcoff. */ +#ifndef PROCESS_LINENUMBER_HOOK +#define PROCESS_LINENUMBER_HOOK() #endif + PROCESS_LINENUMBER_HOOK (); /* Needed for xcoff. */ /* Now create the symtab objects proper, one for each subfile. */ /* (The main file is the last one on the chain.) */ @@ -844,27 +896,28 @@ end_symtab (end_addr, objfile, section) for (subfile = subfiles; subfile; subfile = nextsub) { int linetablesize = 0; - /* If we have blocks of symbols, make a symtab. - Otherwise, just ignore this file and any line number info in it. */ symtab = NULL; + + /* If we have blocks of symbols, make a symtab. Otherwise, just + ignore this file and any line number info in it. */ if (blockvector) { if (subfile->line_vector) { linetablesize = sizeof (struct linetable) + - subfile->line_vector->nitems * sizeof (struct linetable_entry); + subfile->line_vector->nitems * sizeof (struct linetable_entry); #if 0 - /* I think this is artifact from before it went on the obstack. - I doubt we'll need the memory between now and when we - free it later in this function. */ + /* I think this is artifact from before it went on the + obstack. I doubt we'll need the memory between now + and when we free it later in this function. */ /* First, shrink the linetable to make more memory. */ subfile->line_vector = (struct linetable *) xrealloc ((char *) subfile->line_vector, linetablesize); #endif - /* Like the pending blocks, the line table may be scrambled - in reordered executables. Sort it if OBJF_REORDERED is - true. */ + /* Like the pending blocks, the line table may be + scrambled in reordered executables. Sort it if + OBJF_REORDERED is true. */ if (objfile->flags & OBJF_REORDERED) qsort (subfile->line_vector->item, subfile->line_vector->nitems, @@ -879,8 +932,8 @@ end_symtab (end_addr, objfile, section) if (subfile->line_vector) { /* Reallocate the line table on the symbol obstack */ - symtab->linetable = (struct linetable *) - obstack_alloc (&objfile -> symbol_obstack, linetablesize); + symtab->linetable = (struct linetable *) + obstack_alloc (&objfile->symbol_obstack, linetablesize); memcpy (symtab->linetable, subfile->line_vector, linetablesize); } else @@ -892,8 +945,8 @@ end_symtab (end_addr, objfile, section) { /* Reallocate the dirname on the symbol obstack */ symtab->dirname = (char *) - obstack_alloc (&objfile -> symbol_obstack, - strlen (subfile -> dirname) + 1); + obstack_alloc (&objfile->symbol_obstack, + strlen (subfile->dirname) + 1); strcpy (symtab->dirname, subfile->dirname); } else @@ -903,34 +956,47 @@ end_symtab (end_addr, objfile, section) symtab->free_code = free_linetable; symtab->free_ptr = NULL; - /* Use whatever language we have been using for this subfile, - not the one that was deduced in allocate_symtab from the - filename. We already did our own deducing when we created - the subfile, and we may have altered our opinion of what - language it is from things we found in the symbols. */ + /* Use whatever language we have been using for this + subfile, not the one that was deduced in allocate_symtab + from the filename. We already did our own deducing when + we created the subfile, and we may have altered our + opinion of what language it is from things we found in + the symbols. */ symtab->language = subfile->language; + /* Save the debug format string (if any) in the symtab */ + if (subfile->debugformat != NULL) + { + symtab->debugformat = obsavestring (subfile->debugformat, + strlen (subfile->debugformat), + &objfile->symbol_obstack); + } + /* All symtabs for the main file and the subfiles share a - blockvector, so we need to clear primary for everything but - the main file. */ + blockvector, so we need to clear primary for everything + but the main file. */ symtab->primary = 0; } if (subfile->name != NULL) { - free ((PTR) subfile->name); + free ((void *) subfile->name); } if (subfile->dirname != NULL) { - free ((PTR) subfile->dirname); + free ((void *) subfile->dirname); } if (subfile->line_vector != NULL) { - free ((PTR) subfile->line_vector); + free ((void *) subfile->line_vector); + } + if (subfile->debugformat != NULL) + { + free ((void *) subfile->debugformat); } nextsub = subfile->next; - free ((PTR)subfile); + free ((void *) subfile); } /* Set this for the main source file. */ @@ -942,17 +1008,15 @@ end_symtab (end_addr, objfile, section) last_source_file = NULL; current_subfile = NULL; - return (symtab); + return symtab; } - -/* Push a context block. Args are an identifying nesting level (checkable - when you pop it), and the starting PC address of this context. */ +/* Push a context block. Args are an identifying nesting level + (checkable when you pop it), and the starting PC address of this + context. */ struct context_stack * -push_context (desc, valu) - int desc; - CORE_ADDR valu; +push_context (int desc, CORE_ADDR valu) { register struct context_stack *new; @@ -961,27 +1025,27 @@ push_context (desc, valu) context_stack_size *= 2; context_stack = (struct context_stack *) xrealloc ((char *) context_stack, - (context_stack_size * sizeof (struct context_stack))); + (context_stack_size * sizeof (struct context_stack))); } new = &context_stack[context_stack_depth++]; new->depth = desc; new->locals = local_symbols; + new->params = param_symbols; new->old_blocks = pending_blocks; new->start_addr = valu; new->name = NULL; local_symbols = NULL; + param_symbols = NULL; - return (new); + return new; } - /* Compute a small integer hash code for the given name. */ int -hashname (name) - char *name; +hashname (char *name) { register char *p = name; register int total = p[0]; @@ -1006,11 +1070,45 @@ hashname (name) } return (total % HASHSIZE); } + + +void +record_debugformat (char *format) +{ + current_subfile->debugformat = savestring (format, strlen (format)); +} + +/* Merge the first symbol list SRCLIST into the second symbol list + TARGETLIST by repeated calls to add_symbol_to_list(). This + procedure "frees" each link of SRCLIST by adding it to the + free_pendings list. Caller must set SRCLIST to a null list after + calling this function. + + Void return. */ +void +merge_symbol_lists (struct pending **srclist, struct pending **targetlist) +{ + register int i; + + if (!srclist || !*srclist) + return; + + /* Merge in elements from current link. */ + for (i = 0; i < (*srclist)->nsyms; i++) + add_symbol_to_list ((*srclist)->symbol[i], targetlist); + + /* Recurse on next. */ + merge_symbol_lists (&(*srclist)->next, targetlist); + + /* "Free" the current link. */ + (*srclist)->next = free_pendings; + free_pendings = (*srclist); +} -/* Initialize anything that needs initializing when starting to read - a fresh piece of a symbol file, e.g. reading in the stuff corresponding - to a psymtab. */ +/* Initialize anything that needs initializing when starting to read a + fresh piece of a symbol file, e.g. reading in the stuff + corresponding to a psymtab. */ void buildsym_init () @@ -1030,10 +1128,3 @@ buildsym_new_init () { buildsym_init (); } - -/* Initializer for this module */ - -void -_initialize_buildsym () -{ -} diff --git a/contrib/gdb/gdb/buildsym.h b/contrib/gdb/gdb/buildsym.h index 58529c7..e3a34c9 100644 --- a/contrib/gdb/gdb/buildsym.h +++ b/contrib/gdb/gdb/buildsym.h @@ -1,5 +1,5 @@ /* Build symbol tables in GDB's internal format. - Copyright (C) 1986-1996 Free Software Foundation, Inc. + Copyright 1986-1993, 1996-1999 Free Software Foundation, Inc. This file is part of GDB. @@ -22,45 +22,47 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This module provides definitions used for creating and adding to the symbol table. These routines are called from various symbol- - file-reading routines. + file-reading routines. They originated in dbxread.c of gdb-4.2, and were split out to make xcoffread.c more maintainable by sharing code. - Variables declared in this file can be defined by #define-ing - the name EXTERN to null. It is used to declare variables that - are normally extern, but which get defined in a single module - using this technique. */ + Variables declared in this file can be defined by #define-ing the + name EXTERN to null. It is used to declare variables that are + normally extern, but which get defined in a single module using + this technique. */ #ifndef EXTERN #define EXTERN extern #endif -#define HASHSIZE 127 /* Size of things hashed via hashname() */ +#define HASHSIZE 127 /* Size of things hashed via + hashname() */ -/* Name of source file whose symbol data we are now processing. - This comes from a symbol of type N_SO. */ +/* Name of source file whose symbol data we are now processing. This + comes from a symbol of type N_SO. */ EXTERN char *last_source_file; -/* Core address of start of text of current source file. - This too comes from the N_SO symbol. */ +/* Core address of start of text of current source file. This too + comes from the N_SO symbol. */ EXTERN CORE_ADDR last_source_start_addr; -/* The list of sub-source-files within the current individual compilation. - Each file gets its own symtab with its own linetable and associated info, - but they all share one blockvector. */ +/* The list of sub-source-files within the current individual + compilation. Each file gets its own symtab with its own linetable + and associated info, but they all share one blockvector. */ struct subfile -{ - struct subfile *next; - char *name; - char *dirname; - struct linetable *line_vector; - int line_vector_length; - enum language language; -}; + { + struct subfile *next; + char *name; + char *dirname; + struct linetable *line_vector; + int line_vector_length; + enum language language; + char *debugformat; + }; EXTERN struct subfile *subfiles; @@ -79,65 +81,85 @@ EXTERN unsigned char processing_gcc_compilation; EXTERN unsigned char processing_acc_compilation; +/* elz: added this flag to know when a block is compiled with HP + compilers (cc, aCC). This is necessary because of the macro + COERCE_FLOAT_TO_DOUBLE defined in tm_hppa.h, which causes a + coercion of float to double to always occur in parameter passing + for a function called by gdb (see the function value_arg_coerce in + valops.c). This is necessary only if the target was compiled with + gcc, not with HP compilers or with g++ */ + +EXTERN unsigned char processing_hp_compilation; + /* Count symbols as they are processed, for error messages. */ EXTERN unsigned int symnum; -/* Record the symbols defined for each context in a list. - We don't create a struct block for the context until we - know how long to make it. */ +/* Record the symbols defined for each context in a list. We don't + create a struct block for the context until we know how long to + make it. */ #define PENDINGSIZE 100 struct pending -{ - struct pending *next; - int nsyms; - struct symbol *symbol[PENDINGSIZE]; -}; + { + struct pending *next; + int nsyms; + struct symbol *symbol[PENDINGSIZE]; + }; -/* List of free `struct pending' structures for reuse. */ +/* Here are the three lists that symbols are put on. */ -EXTERN struct pending *free_pendings; +/* static at top level, and types */ -/* Here are the three lists that symbols are put on. */ +EXTERN struct pending *file_symbols; + +/* global functions and variables */ -EXTERN struct pending *file_symbols; /* static at top level, and types */ +EXTERN struct pending *global_symbols; -EXTERN struct pending *global_symbols; /* global functions and variables */ +/* everything local to lexical context */ -EXTERN struct pending *local_symbols; /* everything local to lexic context */ +EXTERN struct pending *local_symbols; -/* Stack representing unclosed lexical contexts - (that will become blocks, eventually). */ +/* func params local to lexical context */ + +EXTERN struct pending *param_symbols; + +/* Stack representing unclosed lexical contexts (that will become + blocks, eventually). */ struct context_stack -{ - /* Outer locals at the time we entered */ + { + /* Outer locals at the time we entered */ + + struct pending *locals; - struct pending *locals; + /* Pending func params at the time we entered */ - /* Pointer into blocklist as of entry */ + struct pending *params; - struct pending_block *old_blocks; + /* Pointer into blocklist as of entry */ - /* Name of function, if any, defining context*/ + struct pending_block *old_blocks; - struct symbol *name; + /* Name of function, if any, defining context */ - /* PC where this context starts */ + struct symbol *name; - CORE_ADDR start_addr; + /* PC where this context starts */ - /* Temp slot for exception handling. */ + CORE_ADDR start_addr; - CORE_ADDR end_addr; + /* Temp slot for exception handling. */ - /* For error-checking matching push/pop */ + CORE_ADDR end_addr; - int depth; + /* For error-checking matching push/pop */ -}; + int depth; + + }; EXTERN struct context_stack *context_stack; @@ -149,14 +171,14 @@ EXTERN int context_stack_depth; EXTERN int context_stack_size; -/* Macro "function" for popping contexts from the stack. Pushing is done - by a real function, push_context. This returns a pointer to a struct - context_stack. */ +/* Macro "function" for popping contexts from the stack. Pushing is + done by a real function, push_context. This returns a pointer to a + struct context_stack. */ #define pop_context() (&context_stack[--context_stack_depth]); -/* Nonzero if within a function (so symbols should be local, - if nothing says specifically). */ +/* Nonzero if within a function (so symbols should be local, if + nothing says specifically). */ EXTERN int within_function; @@ -164,19 +186,24 @@ EXTERN int within_function; This is used at the end to make the blockvector. */ struct pending_block -{ - struct pending_block *next; - struct block *block; -}; + { + struct pending_block *next; + struct block *block; + }; -EXTERN struct pending_block *pending_blocks; +/* Pointer to the head of a linked list of symbol blocks which have + already been finalized (lexical contexts already closed) and which + are just waiting to be built into a blockvector when finalizing the + associated symtab. */ +EXTERN struct pending_block *pending_blocks; + struct subfile_stack -{ - struct subfile_stack *next; - char *name; -}; + { + struct subfile_stack *next; + char *name; + }; EXTERN struct subfile_stack *subfile_stack; @@ -184,14 +211,13 @@ EXTERN struct subfile_stack *subfile_stack; /* Function to invoke get the next symbol. Return the symbol name. */ -EXTERN char *(*next_symbol_text_func) PARAMS ((struct objfile *)); +EXTERN char *(*next_symbol_text_func) (struct objfile *); /* Vector of types defined so far, indexed by their type numbers. - Used for both stabs and coff. - (In newer sun systems, dbx uses a pair of numbers in parens, - as in "(SUBFILENUM,NUMWITHINSUBFILE)". Then these numbers must be - translated through the type_translations hash table to get - the index into the type vector.) */ + Used for both stabs and coff. (In newer sun systems, dbx uses a + pair of numbers in parens, as in "(SUBFILENUM,NUMWITHINSUBFILE)". + Then these numbers must be translated through the type_translations + hash table to get the index into the type vector.) */ EXTERN struct type **type_vector; @@ -199,61 +225,73 @@ EXTERN struct type **type_vector; EXTERN int type_vector_length; -/* Initial size of type vector. Is realloc'd larger if needed, - and realloc'd down to the size actually used, when completed. */ +/* Initial size of type vector. Is realloc'd larger if needed, and + realloc'd down to the size actually used, when completed. */ #define INITIAL_TYPE_VECTOR_LENGTH 160 -extern void -add_symbol_to_list PARAMS ((struct symbol *, struct pending **)); +extern void add_symbol_to_list (struct symbol *symbol, + struct pending **listhead); + +extern struct symbol *find_symbol_in_list (struct pending *list, + char *name, int length); + +extern void finish_block (struct symbol *symbol, + struct pending **listhead, + struct pending_block *old_blocks, + CORE_ADDR start, CORE_ADDR end, + struct objfile *objfile); + +extern void really_free_pendings (int foo); + +extern void start_subfile (char *name, char *dirname); + +extern void patch_subfile_names (struct subfile *subfile, char *name); + +extern void push_subfile (void); + +extern char *pop_subfile (void); + +extern struct symtab *end_symtab (CORE_ADDR end_addr, + struct objfile *objfile, int section); -extern struct symbol * -find_symbol_in_list PARAMS ((struct pending *, char *, int)); +/* Defined in stabsread.c. */ -extern void -finish_block PARAMS ((struct symbol *, struct pending **, - struct pending_block *, CORE_ADDR, CORE_ADDR, - struct objfile *)); +extern void scan_file_globals (struct objfile *objfile); -extern void -really_free_pendings PARAMS ((int foo)); +extern void buildsym_new_init (void); -extern void -start_subfile PARAMS ((char *, char *)); +extern void buildsym_init (void); -extern void -patch_subfile_names PARAMS ((struct subfile *subfile, char *name)); +extern struct context_stack *push_context (int desc, CORE_ADDR valu); -extern void -push_subfile PARAMS ((void)); +extern void record_line (struct subfile *subfile, int line, CORE_ADDR pc); -extern char * -pop_subfile PARAMS ((void)); +extern void start_symtab (char *name, char *dirname, CORE_ADDR start_addr); -extern struct symtab * -end_symtab PARAMS ((CORE_ADDR, struct objfile *, int)); +extern int hashname (char *name); -extern void -scan_file_globals PARAMS ((struct objfile *)); +extern void free_pending_blocks (void); -extern void -buildsym_new_init PARAMS ((void)); +/* FIXME: Note that this is used only in buildsym.c and dstread.c, + which should be fixed to not need direct access to + make_blockvector. */ -extern void -buildsym_init PARAMS ((void)); +extern struct blockvector *make_blockvector (struct objfile *objfile); -extern struct context_stack * -push_context PARAMS ((int, CORE_ADDR)); +/* FIXME: Note that this is used only in buildsym.c and dstread.c, + which should be fixed to not need direct access to + record_pending_block. */ -extern void -record_line PARAMS ((struct subfile *, int, CORE_ADDR)); +extern void record_pending_block (struct objfile *objfile, + struct block *block, + struct pending_block *opblock); -extern void -start_symtab PARAMS ((char *, char *, CORE_ADDR)); +extern void record_debugformat (char *format); -extern int -hashname PARAMS ((char *)); +extern void merge_symbol_lists (struct pending **srclist, + struct pending **targetlist); #undef EXTERN -#endif /* defined (BUILDSYM_H) */ +#endif /* defined (BUILDSYM_H) */ diff --git a/contrib/gdb/gdb/c-exp.tab.c b/contrib/gdb/gdb/c-exp.tab.c index 0c6249b..c9395fa 100644 --- a/contrib/gdb/gdb/c-exp.tab.c +++ b/contrib/gdb/gdb/c-exp.tab.c @@ -1,5 +1,6 @@ -/* A Bison parser, made from ./c-exp.y with Bison version GNU Bison version 1.24 +/* A Bison parser, made from c-exp.y + by GNU Bison version 1.25 */ #define YYBISON 1 /* Identify Bison output. */ @@ -29,22 +30,25 @@ #define VARIABLE 280 #define ASSIGN_MODIFY 281 #define THIS 282 -#define ABOVE_COMMA 283 -#define OROR 284 -#define ANDAND 285 -#define EQUAL 286 -#define NOTEQUAL 287 -#define LEQ 288 -#define GEQ 289 -#define LSH 290 -#define RSH 291 -#define UNARY 292 -#define INCREMENT 293 -#define DECREMENT 294 -#define ARROW 295 -#define BLOCKNAME 296 - -#line 38 "./c-exp.y" +#define TRUEKEYWORD 283 +#define FALSEKEYWORD 284 +#define ABOVE_COMMA 285 +#define OROR 286 +#define ANDAND 287 +#define EQUAL 288 +#define NOTEQUAL 289 +#define LEQ 290 +#define GEQ 291 +#define LSH 292 +#define RSH 293 +#define UNARY 294 +#define INCREMENT 295 +#define DECREMENT 296 +#define ARROW 297 +#define BLOCKNAME 298 +#define FILENAME 299 + +#line 38 "c-exp.y" #include "defs.h" @@ -59,6 +63,9 @@ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +/* Flag indicating we're dealing with HP-compiled objects */ +extern int hp_som_som_object_present; + /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple yacc generated parsers in gdb. Note that these are only the variables @@ -119,7 +126,7 @@ void yyerror PARAMS ((char *)); -#line 117 "./c-exp.y" +#line 120 "c-exp.y" typedef union { LONGEST lval; @@ -144,28 +151,11 @@ typedef union struct type **tvec; int *ivec; } YYSTYPE; -#line 142 "./c-exp.y" +#line 145 "c-exp.y" /* YYSTYPE gets defined by %union */ static int parse_number PARAMS ((char *, int, int, YYSTYPE *)); - -#ifndef YYLTYPE -typedef - struct yyltype - { - int timestamp; - int first_line; - int first_column; - int last_line; - int last_column; - char *text; - } - yyltype; - -#define YYLTYPE yyltype -#endif - #include #ifndef __cplusplus @@ -176,26 +166,26 @@ typedef -#define YYFINAL 211 +#define YYFINAL 214 #define YYFLAG -32768 -#define YYNTBASE 66 +#define YYNTBASE 69 -#define YYTRANSLATE(x) ((unsigned)(x) <= 296 ? yytranslate[x] : 88) +#define YYTRANSLATE(x) ((unsigned)(x) <= 299 ? yytranslate[x] : 91) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 59, 2, 2, 2, 50, 36, 2, 57, - 62, 48, 46, 28, 47, 55, 49, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 65, 2, 39, - 30, 40, 31, 45, 2, 2, 2, 2, 2, 2, + 2, 2, 62, 2, 2, 2, 52, 38, 2, 59, + 65, 50, 48, 30, 49, 57, 51, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 68, 2, 41, + 32, 42, 33, 47, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 56, 2, 61, 35, 2, 2, 2, 2, 2, 2, + 58, 2, 64, 37, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 63, 34, 64, 60, 2, 2, 2, 2, + 2, 2, 66, 36, 67, 63, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -211,8 +201,8 @@ static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 29, 32, 33, 37, 38, 41, 42, 43, - 44, 51, 52, 53, 54, 58 + 26, 27, 28, 29, 31, 34, 35, 39, 40, 43, + 44, 45, 46, 53, 54, 55, 56, 60, 61 }; #if YYDEBUG != 0 @@ -223,107 +213,114 @@ static const short yyprhs[] = { 0, 95, 100, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177, 181, 185, 191, 195, 199, 201, 203, 205, 207, - 209, 214, 216, 218, 220, 224, 228, 232, 237, 239, - 242, 244, 246, 249, 252, 255, 259, 263, 265, 268, - 270, 273, 275, 279, 282, 284, 287, 289, 292, 296, - 299, 303, 305, 309, 311, 313, 315, 317, 320, 324, - 327, 331, 335, 340, 343, 347, 349, 352, 355, 358, - 361, 364, 367, 369, 372, 374, 380, 383, 386, 388, - 390, 392, 394, 396, 400, 402, 404, 406, 408, 410 + 209, 214, 216, 218, 220, 222, 224, 226, 230, 234, + 238, 243, 245, 248, 250, 252, 255, 258, 261, 265, + 269, 271, 274, 276, 279, 281, 285, 288, 290, 293, + 295, 298, 302, 305, 309, 311, 315, 317, 319, 321, + 323, 326, 330, 333, 337, 341, 346, 349, 353, 355, + 358, 361, 364, 367, 370, 373, 375, 378, 380, 386, + 389, 392, 394, 396, 398, 400, 402, 406, 408, 410, + 412, 414, 416 }; -static const short yyrhs[] = { 68, - 0, 67, 0, 82, 0, 69, 0, 68, 28, 69, - 0, 48, 69, 0, 36, 69, 0, 47, 69, 0, - 59, 69, 0, 60, 69, 0, 52, 69, 0, 53, - 69, 0, 69, 52, 0, 69, 53, 0, 13, 69, - 0, 69, 54, 86, 0, 69, 54, 76, 0, 69, - 54, 48, 69, 0, 69, 55, 86, 0, 69, 55, - 76, 0, 69, 55, 48, 69, 0, 69, 56, 68, - 61, 0, 0, 69, 57, 70, 72, 62, 0, 63, - 0, 0, 69, 0, 72, 28, 69, 0, 64, 0, - 71, 72, 73, 0, 71, 82, 73, 69, 0, 57, - 82, 62, 69, 0, 57, 68, 62, 0, 69, 45, - 69, 0, 69, 48, 69, 0, 69, 49, 69, 0, - 69, 50, 69, 0, 69, 46, 69, 0, 69, 47, - 69, 0, 69, 43, 69, 0, 69, 44, 69, 0, - 69, 37, 69, 0, 69, 38, 69, 0, 69, 41, - 69, 0, 69, 42, 69, 0, 69, 39, 69, 0, - 69, 40, 69, 0, 69, 36, 69, 0, 69, 35, - 69, 0, 69, 34, 69, 0, 69, 33, 69, 0, - 69, 32, 69, 0, 69, 31, 69, 65, 69, 0, - 69, 30, 69, 0, 69, 26, 69, 0, 3, 0, - 8, 0, 4, 0, 75, 0, 25, 0, 13, 57, - 82, 62, 0, 5, 0, 27, 0, 58, 0, 74, - 15, 86, 0, 74, 15, 86, 0, 83, 15, 86, - 0, 83, 15, 60, 86, 0, 76, 0, 15, 86, - 0, 87, 0, 83, 0, 83, 22, 0, 83, 23, - 0, 83, 78, 0, 83, 22, 78, 0, 83, 23, - 78, 0, 48, 0, 48, 78, 0, 36, 0, 36, - 78, 0, 79, 0, 57, 78, 62, 0, 79, 80, - 0, 80, 0, 79, 81, 0, 81, 0, 56, 61, - 0, 56, 3, 61, 0, 57, 62, 0, 57, 85, - 62, 0, 77, 0, 83, 15, 48, 0, 7, 0, - 21, 0, 19, 0, 20, 0, 19, 21, 0, 14, - 19, 21, 0, 19, 19, 0, 19, 19, 21, 0, - 14, 19, 19, 0, 14, 19, 19, 21, 0, 20, - 21, 0, 14, 20, 21, 0, 24, 0, 19, 24, - 0, 9, 86, 0, 10, 86, 0, 11, 86, 0, - 12, 86, 0, 14, 84, 0, 14, 0, 18, 84, - 0, 18, 0, 16, 86, 39, 82, 40, 0, 22, - 83, 0, 23, 83, 0, 7, 0, 21, 0, 19, - 0, 20, 0, 82, 0, 85, 28, 82, 0, 6, - 0, 58, 0, 7, 0, 8, 0, 6, 0, 58, - 0 +static const short yyrhs[] = { 71, + 0, 70, 0, 85, 0, 72, 0, 71, 30, 72, + 0, 50, 72, 0, 38, 72, 0, 49, 72, 0, + 62, 72, 0, 63, 72, 0, 54, 72, 0, 55, + 72, 0, 72, 54, 0, 72, 55, 0, 13, 72, + 0, 72, 56, 89, 0, 72, 56, 79, 0, 72, + 56, 50, 72, 0, 72, 57, 89, 0, 72, 57, + 79, 0, 72, 57, 50, 72, 0, 72, 58, 71, + 64, 0, 0, 72, 59, 73, 75, 65, 0, 66, + 0, 0, 72, 0, 75, 30, 72, 0, 67, 0, + 74, 75, 76, 0, 74, 85, 76, 72, 0, 59, + 85, 65, 72, 0, 59, 71, 65, 0, 72, 47, + 72, 0, 72, 50, 72, 0, 72, 51, 72, 0, + 72, 52, 72, 0, 72, 48, 72, 0, 72, 49, + 72, 0, 72, 45, 72, 0, 72, 46, 72, 0, + 72, 39, 72, 0, 72, 40, 72, 0, 72, 43, + 72, 0, 72, 44, 72, 0, 72, 41, 72, 0, + 72, 42, 72, 0, 72, 38, 72, 0, 72, 37, + 72, 0, 72, 36, 72, 0, 72, 35, 72, 0, + 72, 34, 72, 0, 72, 33, 72, 68, 72, 0, + 72, 32, 72, 0, 72, 26, 72, 0, 3, 0, + 8, 0, 4, 0, 78, 0, 25, 0, 13, 59, + 85, 65, 0, 5, 0, 27, 0, 28, 0, 29, + 0, 60, 0, 61, 0, 77, 15, 89, 0, 77, + 15, 89, 0, 86, 15, 89, 0, 86, 15, 63, + 89, 0, 79, 0, 15, 89, 0, 90, 0, 86, + 0, 86, 22, 0, 86, 23, 0, 86, 81, 0, + 86, 22, 81, 0, 86, 23, 81, 0, 50, 0, + 50, 81, 0, 38, 0, 38, 81, 0, 82, 0, + 59, 81, 65, 0, 82, 83, 0, 83, 0, 82, + 84, 0, 84, 0, 58, 64, 0, 58, 3, 64, + 0, 59, 65, 0, 59, 88, 65, 0, 80, 0, + 86, 15, 50, 0, 7, 0, 21, 0, 19, 0, + 20, 0, 19, 21, 0, 14, 19, 21, 0, 19, + 19, 0, 19, 19, 21, 0, 14, 19, 19, 0, + 14, 19, 19, 21, 0, 20, 21, 0, 14, 20, + 21, 0, 24, 0, 19, 24, 0, 9, 89, 0, + 10, 89, 0, 11, 89, 0, 12, 89, 0, 14, + 87, 0, 14, 0, 18, 87, 0, 18, 0, 16, + 89, 41, 85, 42, 0, 22, 86, 0, 23, 86, + 0, 7, 0, 21, 0, 19, 0, 20, 0, 85, + 0, 88, 30, 85, 0, 6, 0, 60, 0, 7, + 0, 8, 0, 6, 0, 60, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, - 223, 224, 227, 234, 235, 240, 243, 246, 250, 254, - 258, 262, 266, 270, 274, 278, 284, 291, 295, 302, - 310, 314, 318, 322, 328, 332, 335, 339, 343, 346, - 353, 359, 365, 371, 375, 379, 383, 387, 391, 395, - 399, 403, 407, 411, 415, 419, 423, 427, 431, 435, - 439, 443, 447, 451, 455, 461, 468, 479, 486, 489, - 493, 501, 526, 533, 550, 561, 577, 590, 615, 616, - 650, 708, 714, 715, 716, 718, 720, 724, 726, 728, - 730, 732, 735, 737, 742, 749, 751, 755, 757, 761, - 763, 775, 776, 781, 783, 785, 787, 789, 791, 793, - 795, 797, 799, 801, 803, 805, 807, 809, 812, 815, - 818, 821, 823, 825, 827, 829, 836, 837, 840, 841, - 847, 853, 862, 867, 874, 875, 876, 877, 880, 881 + 230, 231, 234, 241, 242, 247, 250, 253, 257, 261, + 265, 269, 273, 277, 281, 285, 291, 299, 303, 309, + 317, 321, 325, 329, 335, 339, 342, 346, 350, 353, + 360, 366, 372, 378, 382, 386, 390, 394, 398, 402, + 406, 410, 414, 418, 422, 426, 430, 434, 438, 442, + 446, 450, 454, 458, 462, 468, 475, 486, 493, 496, + 500, 508, 533, 538, 545, 554, 562, 568, 579, 595, + 608, 632, 633, 667, 725, 731, 732, 733, 735, 737, + 741, 743, 745, 747, 749, 752, 754, 759, 766, 768, + 772, 774, 778, 780, 792, 793, 798, 800, 802, 804, + 806, 808, 810, 812, 814, 816, 818, 820, 822, 824, + 826, 829, 832, 835, 838, 840, 842, 844, 849, 856, + 857, 860, 861, 867, 873, 882, 887, 894, 895, 896, + 897, 900, 901 }; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) static const char * const yytname[] = { "$","error","$undefined.","INT","FLOAT", "STRING","NAME","TYPENAME","NAME_OR_INT","STRUCT","CLASS","UNION","ENUM","SIZEOF", "UNSIGNED","COLONCOLON","TEMPLATE","ERROR","SIGNED_KEYWORD","LONG","SHORT","INT_KEYWORD", "CONST_KEYWORD","VOLATILE_KEYWORD","DOUBLE_KEYWORD","VARIABLE","ASSIGN_MODIFY", -"THIS","','","ABOVE_COMMA","'='","'?'","OROR","ANDAND","'|'","'^'","'&'","EQUAL", -"NOTEQUAL","'<'","'>'","LEQ","GEQ","LSH","RSH","'@'","'+'","'-'","'*'","'/'", -"'%'","UNARY","INCREMENT","DECREMENT","ARROW","'.'","'['","'('","BLOCKNAME", -"'!'","'~'","']'","')'","'{'","'}'","':'","start","type_exp","exp1","exp","@1", -"lcurly","arglist","rcurly","block","variable","qualified_name","ptype","abs_decl", -"direct_abs_decl","array_mod","func_mod","type","typebase","typename","nonempty_typelist", -"name","name_not_typename","" +"THIS","TRUEKEYWORD","FALSEKEYWORD","','","ABOVE_COMMA","'='","'?'","OROR","ANDAND", +"'|'","'^'","'&'","EQUAL","NOTEQUAL","'<'","'>'","LEQ","GEQ","LSH","RSH","'@'", +"'+'","'-'","'*'","'/'","'%'","UNARY","INCREMENT","DECREMENT","ARROW","'.'", +"'['","'('","BLOCKNAME","FILENAME","'!'","'~'","']'","')'","'{'","'}'","':'", +"start","type_exp","exp1","exp","@1","lcurly","arglist","rcurly","block","variable", +"qualified_name","ptype","abs_decl","direct_abs_decl","array_mod","func_mod", +"type","typebase","typename","nonempty_typelist","name","name_not_typename", NULL }; #endif static const short yyr1[] = { 0, - 66, 66, 67, 68, 68, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 70, 69, 71, 72, 72, 72, 73, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 74, 74, 75, 76, 76, 75, 75, - 75, 77, 77, 77, 77, 77, 77, 78, 78, 78, - 78, 78, 79, 79, 79, 79, 79, 80, 80, 81, - 81, 82, 82, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, - 84, 84, 85, 85, 86, 86, 86, 86, 87, 87 + 69, 69, 70, 71, 71, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 73, 72, 74, 75, 75, 75, 76, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 77, 77, 77, 78, 79, + 79, 78, 78, 78, 80, 80, 80, 80, 80, 80, + 81, 81, 81, 81, 81, 82, 82, 82, 82, 82, + 83, 83, 84, 84, 85, 85, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 87, 87, 87, 87, 88, 88, 89, 89, 89, + 89, 90, 90 }; static const short yyr2[] = { 0, @@ -333,238 +330,235 @@ static const short yyr2[] = { 0, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 1, 1, 1, 1, 1, - 4, 1, 1, 1, 3, 3, 3, 4, 1, 2, - 1, 1, 2, 2, 2, 3, 3, 1, 2, 1, - 2, 1, 3, 2, 1, 2, 1, 2, 3, 2, - 3, 1, 3, 1, 1, 1, 1, 2, 3, 2, - 3, 3, 4, 2, 3, 1, 2, 2, 2, 2, - 2, 2, 1, 2, 1, 5, 2, 2, 1, 1, - 1, 1, 1, 3, 1, 1, 1, 1, 1, 1 + 4, 1, 1, 1, 1, 1, 1, 3, 3, 3, + 4, 1, 2, 1, 1, 2, 2, 2, 3, 3, + 1, 2, 1, 2, 1, 3, 2, 1, 2, 1, + 2, 3, 2, 3, 1, 3, 1, 1, 1, 1, + 2, 3, 2, 3, 3, 4, 2, 3, 1, 2, + 2, 2, 2, 2, 2, 1, 2, 1, 5, 2, + 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, + 1, 1, 1 }; static const short yydefact[] = { 0, - 56, 58, 62, 129, 94, 57, 0, 0, 0, 0, - 0, 113, 0, 0, 115, 96, 97, 95, 0, 0, - 106, 60, 63, 0, 0, 0, 0, 0, 0, 130, - 0, 0, 25, 2, 1, 4, 26, 0, 59, 69, - 92, 3, 72, 71, 125, 127, 128, 126, 108, 109, - 110, 111, 0, 15, 0, 119, 121, 122, 120, 112, - 70, 0, 121, 122, 114, 100, 98, 107, 104, 117, - 118, 7, 8, 6, 11, 12, 0, 0, 9, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 56, 58, 62, 132, 97, 57, 0, 0, 0, 0, + 0, 116, 0, 0, 118, 99, 100, 98, 0, 0, + 109, 60, 63, 64, 65, 0, 0, 0, 0, 0, + 0, 133, 67, 0, 0, 25, 2, 1, 4, 26, + 0, 59, 72, 95, 3, 75, 74, 128, 130, 131, + 129, 111, 112, 113, 114, 0, 15, 0, 122, 124, + 125, 123, 115, 73, 0, 124, 125, 117, 103, 101, + 110, 107, 120, 121, 7, 8, 6, 11, 12, 0, + 0, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 13, 14, 0, 0, 0, 23, 27, - 0, 0, 0, 0, 73, 74, 80, 78, 0, 0, - 75, 82, 85, 87, 0, 0, 102, 99, 105, 0, - 101, 33, 0, 5, 55, 54, 0, 52, 51, 50, - 49, 48, 42, 43, 46, 47, 44, 45, 40, 41, - 34, 38, 39, 35, 36, 37, 127, 0, 17, 16, - 0, 20, 19, 0, 26, 0, 29, 30, 0, 66, - 93, 0, 67, 76, 77, 81, 79, 0, 88, 90, - 0, 123, 72, 0, 0, 84, 86, 61, 103, 0, - 32, 0, 18, 21, 22, 0, 28, 31, 68, 89, - 83, 0, 0, 91, 116, 53, 24, 124, 0, 0, - 0 + 0, 0, 0, 0, 0, 0, 13, 14, 0, 0, + 0, 23, 27, 0, 0, 0, 0, 76, 77, 83, + 81, 0, 0, 78, 85, 88, 90, 0, 0, 105, + 102, 108, 0, 104, 33, 0, 5, 55, 54, 0, + 52, 51, 50, 49, 48, 42, 43, 46, 47, 44, + 45, 40, 41, 34, 38, 39, 35, 36, 37, 130, + 0, 17, 16, 0, 20, 19, 0, 26, 0, 29, + 30, 0, 69, 96, 0, 70, 79, 80, 84, 82, + 0, 91, 93, 0, 126, 75, 0, 0, 87, 89, + 61, 106, 0, 32, 0, 18, 21, 22, 0, 28, + 31, 71, 92, 86, 0, 0, 94, 119, 53, 24, + 127, 0, 0, 0 }; -static const short yydefgoto[] = { 209, - 34, 77, 36, 165, 37, 111, 168, 38, 39, 40, - 41, 121, 122, 123, 124, 182, 55, 60, 184, 173, - 44 +static const short yydefgoto[] = { 212, + 37, 80, 39, 168, 40, 114, 171, 41, 42, 43, + 44, 124, 125, 126, 127, 185, 58, 63, 187, 176, + 47 }; -static const short yypact[] = { 241, --32768,-32768,-32768,-32768,-32768,-32768, 5, 5, 5, 5, - 302, 24, 5, 5, 73, 66, 27,-32768, 212, 212, --32768,-32768,-32768, 241, 241, 241, 241, 241, 241, 32, - 241, 241,-32768,-32768, -1, 523, 241, 42,-32768,-32768, --32768,-32768, 3,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 241, 43, 52,-32768, 70, 50,-32768,-32768, --32768, 64,-32768,-32768,-32768, 60,-32768,-32768,-32768,-32768, --32768, 43, 43, 43, 43, 43, -7, 44, 43, 43, - 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, - 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, - 241, 241, 241,-32768,-32768, 439, 458, 241,-32768, 523, - -18, 41, 5, 8, 16, 16, 16, 16, 4, 382, --32768, -34,-32768,-32768, 45, 26, 83,-32768,-32768, 212, --32768,-32768, 241, 523, 523, 523, 487, 575, 599, 622, - 644, 665, 684, 684, 143, 143, 143, 143, 226, 226, - 69, 287, 287, 43, 43, 43, 94, 241,-32768,-32768, - 241,-32768,-32768, -11, 241, 241,-32768,-32768, 241, 95, --32768, 5,-32768,-32768,-32768,-32768,-32768, 67,-32768,-32768, - 49,-32768, 13, -4, 152,-32768,-32768, 363,-32768, 72, - 43, 241, 43, 43,-32768, 12, 523, 43,-32768,-32768, --32768, 65, 212,-32768,-32768, 550,-32768,-32768, 127, 129, --32768 +static const short yypact[] = { 205, +-32768,-32768,-32768,-32768,-32768,-32768, 46, 46, 46, 46, + 269, 57, 46, 46, 100, 134, -14,-32768, 228, 228, +-32768,-32768,-32768,-32768,-32768, 205, 205, 205, 205, 205, + 205, 21,-32768, 205, 205,-32768,-32768, -16, 504, 205, + 22,-32768,-32768,-32768,-32768, 107,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, 205, 14, 23,-32768, 7, + 24,-32768,-32768,-32768, 10,-32768,-32768,-32768, 34,-32768, +-32768,-32768,-32768,-32768, 14, 14, 14, 14, 14, -26, + -21, 14, 14, 205, 205, 205, 205, 205, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, + 205, 205, 205, 205, 205, 205,-32768,-32768, 419, 438, + 205,-32768, 504, -25, -2, 46, 53, 8, 8, 8, + 8, -1, 359,-32768, -41,-32768,-32768, 9, 42, 54, +-32768,-32768, 228,-32768,-32768, 205, 504, 504, 504, 467, + 556, 580, 603, 625, 646, 665, 665, 254, 254, 254, + 254, 124, 124, 356, 416, 416, 14, 14, 14, 89, + 205,-32768,-32768, 205,-32768,-32768, -17, 205, 205,-32768, +-32768, 205, 93,-32768, 46,-32768,-32768,-32768,-32768,-32768, + 45,-32768,-32768, 50,-32768, 146, -22, 128,-32768,-32768, + 333,-32768, 68, 14, 205, 14, 14,-32768, -3, 504, + 14,-32768,-32768,-32768, 67, 228,-32768,-32768, 531,-32768, +-32768, 125, 126,-32768 }; static const short yypgoto[] = {-32768, --32768, 6, 51,-32768,-32768, 14, 53,-32768,-32768, -65, --32768, 40,-32768, 47, 55, 1, 0, 163,-32768, -5, +-32768, 3, -5,-32768,-32768, -44, 12,-32768,-32768, -76, +-32768, 79,-32768, 11, 16, 1, 0, 113,-32768, 2, -32768 }; -#define YYLAST 741 - - -static const short yytable[] = { 43, - 42, 49, 50, 51, 52, 35, 178, 61, 62, 166, - 45, 46, 47, 45, 46, 47, 81, 114, 70, 71, - 81, 119, 185, 203, 115, 116, 81, 202, 43, 78, - 56, 45, 46, 47, 115, 116, 43, 112, 117, 166, - 159, 162, 57, 58, 59, 167, -64, 69, 117, 195, - 118, 117, 43, 125, 132, 171, 113, 204, 119, 120, - 118, 54, 48, 118, 179, 48, 126, 172, 119, 120, - 129, 119, 120, 207, 72, 73, 74, 75, 76, 56, - 131, 79, 80, 48, 66, 172, 67, 110, 127, 68, - 128, 63, 64, 59, 104, 105, 106, 107, 108, 109, - 160, 163, 130, 189, 167, 133, 188, 170, -94, -65, - 201, 205, 171, 164, 99, 100, 101, 102, 103, 183, - 104, 105, 106, 107, 108, 109, 210, 200, 211, 183, - 190, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 174, 175, 176, 177, 5, 181, - 7, 8, 9, 10, 169, 12, 199, 14, 186, 15, - 16, 17, 18, 19, 20, 21, 187, 65, 196, 0, - 0, 0, 0, 191, 183, 96, 97, 98, 99, 100, - 101, 102, 103, 0, 104, 105, 106, 107, 108, 109, - 0, 0, 183, 208, 0, 0, 0, 0, 193, 0, - 0, 194, 0, 180, 0, 110, 197, 0, 5, 198, - 7, 8, 9, 10, 0, 12, 0, 14, 0, 15, - 16, 17, 18, 19, 20, 21, 0, 0, 191, 0, - 0, 0, 206, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 0, 15, 16, - 17, 18, 19, 20, 21, 22, 0, 23, 0, 0, - 98, 99, 100, 101, 102, 103, 24, 104, 105, 106, - 107, 108, 109, 0, 0, 0, 0, 25, 26, 0, - 0, 0, 27, 28, 0, 0, 0, 29, 30, 31, - 32, 0, 0, 33, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 0, 15, - 16, 17, 18, 19, 20, 21, 22, 0, 23, 0, - 0, 0, 0, 0, 101, 102, 103, 24, 104, 105, - 106, 107, 108, 109, 0, 0, 0, 0, 25, 26, - 0, 0, 0, 27, 28, 0, 0, 0, 53, 30, - 31, 32, 0, 0, 33, 1, 2, 3, 4, 5, +#define YYLAST 724 + + +static const short yytable[] = { 46, + 45, 181, 38, 84, 169, 57, 72, 206, 52, 53, + 54, 55, 84, 84, 64, 65, 122, 188, 73, 74, + 75, 76, 77, 78, 79, 130, 169, 131, 82, 83, + 46, 81, 162, 165, 113, -66, 116, 129, 135, 46, + 115, 170, 207, 136, 132, 120, 198, 48, 49, 50, + 133, 48, 49, 50, 134, 46, 128, 121, 48, 49, + 50, 210, 182, 59, 170, 122, 123, 107, 108, 109, + 110, 111, 112, 191, 192, 60, 61, 62, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 51, 174, -97, 175, 51, 59, -68, 203, 208, + 163, 166, 51, 167, 204, 175, 174, 173, 66, 67, + 62, 117, 186, 199, 213, 214, 172, 68, 118, 119, + 194, 0, 186, 193, 5, 189, 7, 8, 9, 10, + 190, 12, 0, 14, 120, 15, 16, 17, 18, 19, + 20, 21, 69, 0, 70, 196, 121, 71, 197, 0, + 205, 0, 113, 200, 122, 123, 201, 118, 119, 0, + 101, 102, 103, 104, 105, 106, 202, 107, 108, 109, + 110, 111, 112, 120, 0, 194, 0, 186, 0, 209, + 0, 0, 183, 0, 0, 121, 177, 178, 179, 180, + 0, 184, 0, 122, 123, 186, 211, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 0, 15, 16, 17, 18, 19, 20, 21, 22, + 0, 23, 24, 25, 5, 0, 7, 8, 9, 10, + 0, 12, 26, 14, 0, 15, 16, 17, 18, 19, + 20, 21, 0, 27, 28, 0, 0, 0, 29, 30, + 0, 0, 0, 31, 32, 33, 34, 35, 0, 0, + 36, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 0, 15, 16, 17, 18, + 19, 20, 21, 22, 0, 23, 24, 25, 99, 100, + 101, 102, 103, 104, 105, 106, 26, 107, 108, 109, + 110, 111, 112, 0, 0, 0, 0, 27, 28, 0, + 0, 0, 29, 30, 0, 0, 0, 56, 32, 33, + 34, 35, 0, 0, 36, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, - 15, 16, 17, 18, 19, 20, 21, 22, 5, 23, - 7, 8, 9, 10, 0, 12, 0, 14, 0, 15, - 16, 17, 18, 19, 20, 21, 0, 0, 0, 0, - 0, 0, 0, 0, 27, 28, 0, 117, 0, 29, - 30, 31, 32, 0, 0, 33, 0, 0, 0, 118, - 0, 0, 0, 0, 0, 0, 0, 119, 120, 0, - 0, 0, 0, 180, 45, 157, 47, 7, 8, 9, + 15, 16, 17, 18, 19, 20, 21, 22, 0, 23, + 24, 25, 0, 0, 0, 5, 0, 7, 8, 9, + 10, 0, 12, 0, 14, 0, 15, 16, 17, 18, + 19, 20, 21, 0, 0, 0, 29, 30, 0, 0, + 0, 31, 32, 33, 34, 35, 120, 0, 36, 0, + 0, 0, 0, 102, 103, 104, 105, 106, 121, 107, + 108, 109, 110, 111, 112, 0, 122, 123, 0, 0, + 0, 0, 0, 183, 48, 160, 50, 7, 8, 9, 10, 0, 12, 0, 14, 0, 15, 16, 17, 18, - 19, 20, 21, 45, 157, 47, 7, 8, 9, 10, + 19, 20, 21, 48, 160, 50, 7, 8, 9, 10, 0, 12, 0, 14, 0, 15, 16, 17, 18, 19, - 20, 21, 0, 0, 0, 0, 158, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 161, 0, 0, 0, 0, - 0, 0, 82, 0, 0, 48, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 0, 104, 105, - 106, 107, 108, 109, 0, 0, 0, 0, 82, 0, - 0, 192, 83, 84, 85, 86, 87, 88, 89, 90, + 20, 21, 0, 0, 0, 104, 105, 106, 161, 107, + 108, 109, 110, 111, 112, 0, 0, 0, 51, 0, + 0, 0, 0, 0, 0, 0, 0, 164, 0, 0, + 0, 0, 85, 0, 0, 0, 0, 51, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 0, + 107, 108, 109, 110, 111, 112, 0, 0, 0, 85, + 0, 0, 0, 0, 195, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 0, 104, 105, 106, 107, 108, 109, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 101, 102, 103, 104, 105, 106, 0, 107, 108, 109, + 110, 111, 112, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 0, 104, 105, 106, 107, 108, 109, 86, 87, 88, + 104, 105, 106, 0, 107, 108, 109, 110, 111, 112, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 0, 104, 105, 106, 107, - 108, 109, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 0, - 104, 105, 106, 107, 108, 109, 88, 89, 90, 91, + 99, 100, 101, 102, 103, 104, 105, 106, 0, 107, + 108, 109, 110, 111, 112, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 0, 107, 108, 109, 110, 111, 112, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 0, 104, 105, 106, 107, 108, 109, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 0, 104, 105, 106, 107, 108, - 109, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 0, 104, 105, 106, 107, - 108, 109, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 0, 104, 105, 106, 107, 108, - 109 + 102, 103, 104, 105, 106, 0, 107, 108, 109, 110, + 111, 112, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 0, 107, 108, + 109, 110, 111, 112, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 0, 107, + 108, 109, 110, 111, 112, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 0, 107, 108, + 109, 110, 111, 112 }; static const short yycheck[] = { 0, - 0, 7, 8, 9, 10, 0, 3, 13, 14, 28, - 6, 7, 8, 6, 7, 8, 28, 15, 19, 20, - 28, 56, 57, 28, 22, 23, 28, 15, 29, 29, - 7, 6, 7, 8, 22, 23, 37, 37, 36, 28, - 106, 107, 19, 20, 21, 64, 15, 21, 36, 61, - 48, 36, 53, 53, 62, 48, 15, 62, 56, 57, - 48, 11, 58, 48, 61, 58, 15, 60, 56, 57, - 21, 56, 57, 62, 24, 25, 26, 27, 28, 7, - 21, 31, 32, 58, 19, 60, 21, 37, 19, 24, - 21, 19, 20, 21, 52, 53, 54, 55, 56, 57, - 106, 107, 39, 21, 64, 62, 62, 113, 15, 15, - 62, 40, 48, 108, 46, 47, 48, 49, 50, 120, - 52, 53, 54, 55, 56, 57, 0, 61, 0, 130, - 130, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 115, 116, 117, 118, 7, 120, - 9, 10, 11, 12, 112, 14, 172, 16, 122, 18, - 19, 20, 21, 22, 23, 24, 122, 15, 165, -1, - -1, -1, -1, 133, 185, 43, 44, 45, 46, 47, - 48, 49, 50, -1, 52, 53, 54, 55, 56, 57, - -1, -1, 203, 203, -1, -1, -1, -1, 158, -1, - -1, 161, -1, 62, -1, 165, 166, -1, 7, 169, - 9, 10, 11, 12, -1, 14, -1, 16, -1, 18, - 19, 20, 21, 22, 23, 24, -1, -1, 188, -1, - -1, -1, 192, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, -1, 18, 19, - 20, 21, 22, 23, 24, 25, -1, 27, -1, -1, - 45, 46, 47, 48, 49, 50, 36, 52, 53, 54, - 55, 56, 57, -1, -1, -1, -1, 47, 48, -1, - -1, -1, 52, 53, -1, -1, -1, 57, 58, 59, - 60, -1, -1, 63, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, -1, 18, - 19, 20, 21, 22, 23, 24, 25, -1, 27, -1, - -1, -1, -1, -1, 48, 49, 50, 36, 52, 53, - 54, 55, 56, 57, -1, -1, -1, -1, 47, 48, - -1, -1, -1, 52, 53, -1, -1, -1, 57, 58, - 59, 60, -1, -1, 63, 3, 4, 5, 6, 7, + 0, 3, 0, 30, 30, 11, 21, 30, 7, 8, + 9, 10, 30, 30, 13, 14, 58, 59, 19, 20, + 26, 27, 28, 29, 30, 19, 30, 21, 34, 35, + 31, 31, 109, 110, 40, 15, 15, 15, 65, 40, + 40, 67, 65, 65, 21, 38, 64, 6, 7, 8, + 41, 6, 7, 8, 21, 56, 56, 50, 6, 7, + 8, 65, 64, 7, 67, 58, 59, 54, 55, 56, + 57, 58, 59, 65, 21, 19, 20, 21, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 60, 50, 15, 63, 60, 7, 15, 64, 42, + 109, 110, 60, 111, 65, 63, 50, 116, 19, 20, + 21, 15, 123, 168, 0, 0, 115, 15, 22, 23, + 136, -1, 133, 133, 7, 125, 9, 10, 11, 12, + 125, 14, -1, 16, 38, 18, 19, 20, 21, 22, + 23, 24, 19, -1, 21, 161, 50, 24, 164, -1, + 15, -1, 168, 169, 58, 59, 172, 22, 23, -1, + 47, 48, 49, 50, 51, 52, 175, 54, 55, 56, + 57, 58, 59, 38, -1, 191, -1, 188, -1, 195, + -1, -1, 65, -1, -1, 50, 118, 119, 120, 121, + -1, 123, -1, 58, 59, 206, 206, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, -1, 18, 19, 20, 21, 22, 23, 24, 25, + -1, 27, 28, 29, 7, -1, 9, 10, 11, 12, + -1, 14, 38, 16, -1, 18, 19, 20, 21, 22, + 23, 24, -1, 49, 50, -1, -1, -1, 54, 55, + -1, -1, -1, 59, 60, 61, 62, 63, -1, -1, + 66, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, -1, 18, 19, 20, 21, + 22, 23, 24, 25, -1, 27, 28, 29, 45, 46, + 47, 48, 49, 50, 51, 52, 38, 54, 55, 56, + 57, 58, 59, -1, -1, -1, -1, 49, 50, -1, + -1, -1, 54, 55, -1, -1, -1, 59, 60, 61, + 62, 63, -1, -1, 66, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, - 18, 19, 20, 21, 22, 23, 24, 25, 7, 27, - 9, 10, 11, 12, -1, 14, -1, 16, -1, 18, - 19, 20, 21, 22, 23, 24, -1, -1, -1, -1, - -1, -1, -1, -1, 52, 53, -1, 36, -1, 57, - 58, 59, 60, -1, -1, 63, -1, -1, -1, 48, - -1, -1, -1, -1, -1, -1, -1, 56, 57, -1, - -1, -1, -1, 62, 6, 7, 8, 9, 10, 11, + 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, + 28, 29, -1, -1, -1, 7, -1, 9, 10, 11, + 12, -1, 14, -1, 16, -1, 18, 19, 20, 21, + 22, 23, 24, -1, -1, -1, 54, 55, -1, -1, + -1, 59, 60, 61, 62, 63, 38, -1, 66, -1, + -1, -1, -1, 48, 49, 50, 51, 52, 50, 54, + 55, 56, 57, 58, 59, -1, 58, 59, -1, -1, + -1, -1, -1, 65, 6, 7, 8, 9, 10, 11, 12, -1, 14, -1, 16, -1, 18, 19, 20, 21, 22, 23, 24, 6, 7, 8, 9, 10, 11, 12, -1, 14, -1, 16, -1, 18, 19, 20, 21, 22, - 23, 24, -1, -1, -1, -1, 48, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 58, -1, -1, -1, - -1, -1, -1, -1, -1, 48, -1, -1, -1, -1, - -1, -1, 26, -1, -1, 58, 30, 31, 32, 33, + 23, 24, -1, -1, -1, 50, 51, 52, 50, 54, + 55, 56, 57, 58, 59, -1, -1, -1, 60, -1, + -1, -1, -1, -1, -1, -1, -1, 50, -1, -1, + -1, -1, 26, -1, -1, -1, -1, 60, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, -1, 52, 53, - 54, 55, 56, 57, -1, -1, -1, -1, 26, -1, - -1, 65, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, -1, 52, 53, 54, 55, 56, 57, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - -1, 52, 53, 54, 55, 56, 57, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, -1, 52, 53, 54, 55, - 56, 57, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, -1, - 52, 53, 54, 55, 56, 57, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, -1, 52, 53, 54, 55, 56, 57, 36, + 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, + 54, 55, 56, 57, 58, 59, -1, -1, -1, 26, + -1, -1, -1, -1, 68, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, -1, 52, 53, 54, 55, 56, - 57, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, -1, 52, 53, 54, 55, - 56, 57, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, -1, 52, 53, 54, 55, 56, - 57 + 47, 48, 49, 50, 51, 52, -1, 54, 55, 56, + 57, 58, 59, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, -1, 54, 55, 56, 57, 58, 59, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, -1, 54, + 55, 56, 57, 58, 59, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, -1, 54, 55, 56, 57, 58, 59, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, -1, 54, 55, 56, 57, + 58, 59, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, + 56, 57, 58, 59, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, -1, 54, + 55, 56, 57, 58, 59, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, + 56, 57, 58, 59 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/unsupported/share/bison.simple" +#line 3 "/stone/jimb/main-98r2/share/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -717,16 +711,16 @@ int yyparse (void); #endif #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void -__yy_memcpy (from, to, count) - char *from; +__yy_memcpy (to, from, count) char *to; + char *from; int count; { register char *f = from; @@ -742,7 +736,7 @@ __yy_memcpy (from, to, count) /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void -__yy_memcpy (char *from, char *to, int count) +__yy_memcpy (char *to, char *from, int count) { register char *f = from; register char *t = to; @@ -755,7 +749,7 @@ __yy_memcpy (char *from, char *to, int count) #endif #endif -#line 192 "/usr/unsupported/share/bison.simple" +#line 196 "/stone/jimb/main-98r2/share/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. @@ -764,14 +758,20 @@ __yy_memcpy (char *from, char *to, int count) to the proper pointer type. */ #ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#else -#define YYPARSE_PARAM +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG #define YYPARSE_PARAM_DECL -#endif +#endif /* not YYPARSE_PARAM */ int -yyparse(YYPARSE_PARAM) +yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { register int yystate; @@ -888,12 +888,12 @@ yynewstate: if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); #ifdef YYLSP_NEEDED yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); #endif #endif /* no yyoverflow */ @@ -1054,63 +1054,63 @@ yyreduce: switch (yyn) { case 3: -#line 228 "./c-exp.y" +#line 235 "c-exp.y" { write_exp_elt_opcode(OP_TYPE); write_exp_elt_type(yyvsp[0].tval); write_exp_elt_opcode(OP_TYPE);; break;} case 5: -#line 236 "./c-exp.y" +#line 243 "c-exp.y" { write_exp_elt_opcode (BINOP_COMMA); ; break;} case 6: -#line 241 "./c-exp.y" +#line 248 "c-exp.y" { write_exp_elt_opcode (UNOP_IND); ; break;} case 7: -#line 244 "./c-exp.y" +#line 251 "c-exp.y" { write_exp_elt_opcode (UNOP_ADDR); ; break;} case 8: -#line 247 "./c-exp.y" +#line 254 "c-exp.y" { write_exp_elt_opcode (UNOP_NEG); ; break;} case 9: -#line 251 "./c-exp.y" +#line 258 "c-exp.y" { write_exp_elt_opcode (UNOP_LOGICAL_NOT); ; break;} case 10: -#line 255 "./c-exp.y" +#line 262 "c-exp.y" { write_exp_elt_opcode (UNOP_COMPLEMENT); ; break;} case 11: -#line 259 "./c-exp.y" +#line 266 "c-exp.y" { write_exp_elt_opcode (UNOP_PREINCREMENT); ; break;} case 12: -#line 263 "./c-exp.y" +#line 270 "c-exp.y" { write_exp_elt_opcode (UNOP_PREDECREMENT); ; break;} case 13: -#line 267 "./c-exp.y" +#line 274 "c-exp.y" { write_exp_elt_opcode (UNOP_POSTINCREMENT); ; break;} case 14: -#line 271 "./c-exp.y" +#line 278 "c-exp.y" { write_exp_elt_opcode (UNOP_POSTDECREMENT); ; break;} case 15: -#line 275 "./c-exp.y" +#line 282 "c-exp.y" { write_exp_elt_opcode (UNOP_SIZEOF); ; break;} case 16: -#line 279 "./c-exp.y" +#line 286 "c-exp.y" { write_exp_elt_opcode (STRUCTOP_PTR); write_exp_string (yyvsp[0].sval); write_exp_elt_opcode (STRUCTOP_PTR); ; break;} case 17: -#line 285 "./c-exp.y" +#line 292 "c-exp.y" { /* exp->type::name becomes exp->*(&type::name) */ /* Note: this doesn't work if name is a static member! FIXME */ @@ -1118,17 +1118,17 @@ case 17: write_exp_elt_opcode (STRUCTOP_MPTR); ; break;} case 18: -#line 292 "./c-exp.y" +#line 300 "c-exp.y" { write_exp_elt_opcode (STRUCTOP_MPTR); ; break;} case 19: -#line 296 "./c-exp.y" +#line 304 "c-exp.y" { write_exp_elt_opcode (STRUCTOP_STRUCT); write_exp_string (yyvsp[0].sval); write_exp_elt_opcode (STRUCTOP_STRUCT); ; break;} case 20: -#line 303 "./c-exp.y" +#line 310 "c-exp.y" { /* exp.type::name becomes exp.*(&type::name) */ /* Note: this doesn't work if name is a static member! FIXME */ @@ -1136,161 +1136,161 @@ case 20: write_exp_elt_opcode (STRUCTOP_MEMBER); ; break;} case 21: -#line 311 "./c-exp.y" +#line 318 "c-exp.y" { write_exp_elt_opcode (STRUCTOP_MEMBER); ; break;} case 22: -#line 315 "./c-exp.y" +#line 322 "c-exp.y" { write_exp_elt_opcode (BINOP_SUBSCRIPT); ; break;} case 23: -#line 321 "./c-exp.y" +#line 328 "c-exp.y" { start_arglist (); ; break;} case 24: -#line 323 "./c-exp.y" +#line 330 "c-exp.y" { write_exp_elt_opcode (OP_FUNCALL); write_exp_elt_longcst ((LONGEST) end_arglist ()); write_exp_elt_opcode (OP_FUNCALL); ; break;} case 25: -#line 329 "./c-exp.y" +#line 336 "c-exp.y" { start_arglist (); ; break;} case 27: -#line 336 "./c-exp.y" +#line 343 "c-exp.y" { arglist_len = 1; ; break;} case 28: -#line 340 "./c-exp.y" +#line 347 "c-exp.y" { arglist_len++; ; break;} case 29: -#line 344 "./c-exp.y" +#line 351 "c-exp.y" { yyval.lval = end_arglist () - 1; ; break;} case 30: -#line 347 "./c-exp.y" +#line 354 "c-exp.y" { write_exp_elt_opcode (OP_ARRAY); write_exp_elt_longcst ((LONGEST) 0); write_exp_elt_longcst ((LONGEST) yyvsp[0].lval); write_exp_elt_opcode (OP_ARRAY); ; break;} case 31: -#line 354 "./c-exp.y" +#line 361 "c-exp.y" { write_exp_elt_opcode (UNOP_MEMVAL); write_exp_elt_type (yyvsp[-2].tval); write_exp_elt_opcode (UNOP_MEMVAL); ; break;} case 32: -#line 360 "./c-exp.y" +#line 367 "c-exp.y" { write_exp_elt_opcode (UNOP_CAST); write_exp_elt_type (yyvsp[-2].tval); write_exp_elt_opcode (UNOP_CAST); ; break;} case 33: -#line 366 "./c-exp.y" +#line 373 "c-exp.y" { ; break;} case 34: -#line 372 "./c-exp.y" +#line 379 "c-exp.y" { write_exp_elt_opcode (BINOP_REPEAT); ; break;} case 35: -#line 376 "./c-exp.y" +#line 383 "c-exp.y" { write_exp_elt_opcode (BINOP_MUL); ; break;} case 36: -#line 380 "./c-exp.y" +#line 387 "c-exp.y" { write_exp_elt_opcode (BINOP_DIV); ; break;} case 37: -#line 384 "./c-exp.y" +#line 391 "c-exp.y" { write_exp_elt_opcode (BINOP_REM); ; break;} case 38: -#line 388 "./c-exp.y" +#line 395 "c-exp.y" { write_exp_elt_opcode (BINOP_ADD); ; break;} case 39: -#line 392 "./c-exp.y" +#line 399 "c-exp.y" { write_exp_elt_opcode (BINOP_SUB); ; break;} case 40: -#line 396 "./c-exp.y" +#line 403 "c-exp.y" { write_exp_elt_opcode (BINOP_LSH); ; break;} case 41: -#line 400 "./c-exp.y" +#line 407 "c-exp.y" { write_exp_elt_opcode (BINOP_RSH); ; break;} case 42: -#line 404 "./c-exp.y" +#line 411 "c-exp.y" { write_exp_elt_opcode (BINOP_EQUAL); ; break;} case 43: -#line 408 "./c-exp.y" +#line 415 "c-exp.y" { write_exp_elt_opcode (BINOP_NOTEQUAL); ; break;} case 44: -#line 412 "./c-exp.y" +#line 419 "c-exp.y" { write_exp_elt_opcode (BINOP_LEQ); ; break;} case 45: -#line 416 "./c-exp.y" +#line 423 "c-exp.y" { write_exp_elt_opcode (BINOP_GEQ); ; break;} case 46: -#line 420 "./c-exp.y" +#line 427 "c-exp.y" { write_exp_elt_opcode (BINOP_LESS); ; break;} case 47: -#line 424 "./c-exp.y" +#line 431 "c-exp.y" { write_exp_elt_opcode (BINOP_GTR); ; break;} case 48: -#line 428 "./c-exp.y" +#line 435 "c-exp.y" { write_exp_elt_opcode (BINOP_BITWISE_AND); ; break;} case 49: -#line 432 "./c-exp.y" +#line 439 "c-exp.y" { write_exp_elt_opcode (BINOP_BITWISE_XOR); ; break;} case 50: -#line 436 "./c-exp.y" +#line 443 "c-exp.y" { write_exp_elt_opcode (BINOP_BITWISE_IOR); ; break;} case 51: -#line 440 "./c-exp.y" +#line 447 "c-exp.y" { write_exp_elt_opcode (BINOP_LOGICAL_AND); ; break;} case 52: -#line 444 "./c-exp.y" +#line 451 "c-exp.y" { write_exp_elt_opcode (BINOP_LOGICAL_OR); ; break;} case 53: -#line 448 "./c-exp.y" +#line 455 "c-exp.y" { write_exp_elt_opcode (TERNOP_COND); ; break;} case 54: -#line 452 "./c-exp.y" +#line 459 "c-exp.y" { write_exp_elt_opcode (BINOP_ASSIGN); ; break;} case 55: -#line 456 "./c-exp.y" +#line 463 "c-exp.y" { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); write_exp_elt_opcode (yyvsp[-1].opcode); write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); ; break;} case 56: -#line 462 "./c-exp.y" +#line 469 "c-exp.y" { write_exp_elt_opcode (OP_LONG); write_exp_elt_type (yyvsp[0].typed_val_int.type); write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val_int.val)); write_exp_elt_opcode (OP_LONG); ; break;} case 57: -#line 469 "./c-exp.y" +#line 476 "c-exp.y" { YYSTYPE val; parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val); write_exp_elt_opcode (OP_LONG); @@ -1300,14 +1300,14 @@ case 57: ; break;} case 58: -#line 480 "./c-exp.y" +#line 487 "c-exp.y" { write_exp_elt_opcode (OP_DOUBLE); write_exp_elt_type (yyvsp[0].typed_val_float.type); write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval); write_exp_elt_opcode (OP_DOUBLE); ; break;} case 61: -#line 494 "./c-exp.y" +#line 501 "c-exp.y" { write_exp_elt_opcode (OP_LONG); write_exp_elt_type (builtin_type_int); CHECK_TYPEDEF (yyvsp[-1].tval); @@ -1315,7 +1315,7 @@ case 61: write_exp_elt_opcode (OP_LONG); ; break;} case 62: -#line 502 "./c-exp.y" +#line 509 "c-exp.y" { /* C strings are converted into array constants with an explicit null byte added at the end. Thus the array upper bound is the string length. @@ -1339,29 +1339,42 @@ case 62: write_exp_elt_opcode (OP_ARRAY); ; break;} case 63: -#line 527 "./c-exp.y" +#line 534 "c-exp.y" { write_exp_elt_opcode (OP_THIS); write_exp_elt_opcode (OP_THIS); ; break;} case 64: -#line 534 "./c-exp.y" +#line 539 "c-exp.y" +{ write_exp_elt_opcode (OP_LONG); + write_exp_elt_type (builtin_type_bool); + write_exp_elt_longcst ((LONGEST) 1); + write_exp_elt_opcode (OP_LONG); ; + break;} +case 65: +#line 546 "c-exp.y" +{ write_exp_elt_opcode (OP_LONG); + write_exp_elt_type (builtin_type_bool); + write_exp_elt_longcst ((LONGEST) 0); + write_exp_elt_opcode (OP_LONG); ; + break;} +case 66: +#line 555 "c-exp.y" { - if (yyvsp[0].ssym.sym != 0) - yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym); + if (yyvsp[0].ssym.sym) + yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym); else - { - struct symtab *tem = - lookup_symtab (copy_name (yyvsp[0].ssym.stoken)); - if (tem) - yyval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK); - else - error ("No file or function \"%s\".", - copy_name (yyvsp[0].ssym.stoken)); - } + error ("No file or function \"%s\".", + copy_name (yyvsp[0].ssym.stoken)); ; break;} -case 65: -#line 551 "./c-exp.y" +case 67: +#line 563 "c-exp.y" +{ + yyval.bval = yyvsp[0].bval; + ; + break;} +case 68: +#line 569 "c-exp.y" { struct symbol *tem = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval, VAR_NAMESPACE, (int *) NULL, @@ -1371,8 +1384,8 @@ case 65: copy_name (yyvsp[0].sval)); yyval.bval = SYMBOL_BLOCK_VALUE (tem); ; break;} -case 66: -#line 562 "./c-exp.y" +case 69: +#line 580 "c-exp.y" { struct symbol *sym; sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval, VAR_NAMESPACE, (int *) NULL, @@ -1387,8 +1400,8 @@ case 66: write_exp_elt_sym (sym); write_exp_elt_opcode (OP_VAR_VALUE); ; break;} -case 67: -#line 578 "./c-exp.y" +case 70: +#line 596 "c-exp.y" { struct type *type = yyvsp[-2].tval; if (TYPE_CODE (type) != TYPE_CODE_STRUCT @@ -1402,8 +1415,8 @@ case 67: write_exp_elt_opcode (OP_SCOPE); ; break;} -case 68: -#line 591 "./c-exp.y" +case 71: +#line 609 "c-exp.y" { struct type *type = yyvsp[-3].tval; struct stoken tmp_token; @@ -1412,23 +1425,22 @@ case 68: error ("`%s' is not defined as an aggregate type.", TYPE_NAME (type)); - if (!STREQ (type_name_no_tag (type), yyvsp[0].sval.ptr)) - error ("invalid destructor `%s::~%s'", - type_name_no_tag (type), yyvsp[0].sval.ptr); - tmp_token.ptr = (char*) alloca (yyvsp[0].sval.length + 2); tmp_token.length = yyvsp[0].sval.length + 1; tmp_token.ptr[0] = '~'; memcpy (tmp_token.ptr+1, yyvsp[0].sval.ptr, yyvsp[0].sval.length); tmp_token.ptr[tmp_token.length] = 0; + + /* Check for valid destructor name. */ + destructor_name_p (tmp_token.ptr, type); write_exp_elt_opcode (OP_SCOPE); write_exp_elt_type (type); write_exp_string (tmp_token); write_exp_elt_opcode (OP_SCOPE); ; break;} -case 70: -#line 617 "./c-exp.y" +case 73: +#line 634 "c-exp.y" { char *name = copy_name (yyvsp[0].sval); struct symbol *sym; @@ -1461,8 +1473,8 @@ case 70: error ("No symbol \"%s\" in current context.", name); ; break;} -case 71: -#line 651 "./c-exp.y" +case 74: +#line 668 "c-exp.y" { struct symbol *sym = yyvsp[0].ssym.sym; if (sym) @@ -1518,244 +1530,244 @@ case 71: } ; break;} -case 75: -#line 717 "./c-exp.y" +case 78: +#line 734 "c-exp.y" { yyval.tval = follow_types (yyvsp[-1].tval); ; break;} -case 76: -#line 719 "./c-exp.y" +case 79: +#line 736 "c-exp.y" { yyval.tval = follow_types (yyvsp[-2].tval); ; break;} -case 77: -#line 721 "./c-exp.y" +case 80: +#line 738 "c-exp.y" { yyval.tval = follow_types (yyvsp[-2].tval); ; break;} -case 78: -#line 725 "./c-exp.y" +case 81: +#line 742 "c-exp.y" { push_type (tp_pointer); yyval.voidval = 0; ; break;} -case 79: -#line 727 "./c-exp.y" +case 82: +#line 744 "c-exp.y" { push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; ; break;} -case 80: -#line 729 "./c-exp.y" +case 83: +#line 746 "c-exp.y" { push_type (tp_reference); yyval.voidval = 0; ; break;} -case 81: -#line 731 "./c-exp.y" +case 84: +#line 748 "c-exp.y" { push_type (tp_reference); yyval.voidval = yyvsp[0].voidval; ; break;} -case 83: -#line 736 "./c-exp.y" +case 86: +#line 753 "c-exp.y" { yyval.voidval = yyvsp[-1].voidval; ; break;} -case 84: -#line 738 "./c-exp.y" +case 87: +#line 755 "c-exp.y" { push_type_int (yyvsp[0].lval); push_type (tp_array); ; break;} -case 85: -#line 743 "./c-exp.y" +case 88: +#line 760 "c-exp.y" { push_type_int (yyvsp[0].lval); push_type (tp_array); yyval.voidval = 0; ; break;} -case 86: -#line 750 "./c-exp.y" +case 89: +#line 767 "c-exp.y" { push_type (tp_function); ; break;} -case 87: -#line 752 "./c-exp.y" +case 90: +#line 769 "c-exp.y" { push_type (tp_function); ; break;} -case 88: -#line 756 "./c-exp.y" +case 91: +#line 773 "c-exp.y" { yyval.lval = -1; ; break;} -case 89: -#line 758 "./c-exp.y" +case 92: +#line 775 "c-exp.y" { yyval.lval = yyvsp[-1].typed_val_int.val; ; break;} -case 90: -#line 762 "./c-exp.y" +case 93: +#line 779 "c-exp.y" { yyval.voidval = 0; ; break;} -case 91: -#line 764 "./c-exp.y" +case 94: +#line 781 "c-exp.y" { free ((PTR)yyvsp[-1].tvec); yyval.voidval = 0; ; break;} -case 93: -#line 777 "./c-exp.y" +case 96: +#line 794 "c-exp.y" { yyval.tval = lookup_member_type (builtin_type_int, yyvsp[-2].tval); ; break;} -case 94: -#line 782 "./c-exp.y" +case 97: +#line 799 "c-exp.y" { yyval.tval = yyvsp[0].tsym.type; ; break;} -case 95: -#line 784 "./c-exp.y" +case 98: +#line 801 "c-exp.y" { yyval.tval = builtin_type_int; ; break;} -case 96: -#line 786 "./c-exp.y" +case 99: +#line 803 "c-exp.y" { yyval.tval = builtin_type_long; ; break;} -case 97: -#line 788 "./c-exp.y" +case 100: +#line 805 "c-exp.y" { yyval.tval = builtin_type_short; ; break;} -case 98: -#line 790 "./c-exp.y" +case 101: +#line 807 "c-exp.y" { yyval.tval = builtin_type_long; ; break;} -case 99: -#line 792 "./c-exp.y" +case 102: +#line 809 "c-exp.y" { yyval.tval = builtin_type_unsigned_long; ; break;} -case 100: -#line 794 "./c-exp.y" +case 103: +#line 811 "c-exp.y" { yyval.tval = builtin_type_long_long; ; break;} -case 101: -#line 796 "./c-exp.y" +case 104: +#line 813 "c-exp.y" { yyval.tval = builtin_type_long_long; ; break;} -case 102: -#line 798 "./c-exp.y" +case 105: +#line 815 "c-exp.y" { yyval.tval = builtin_type_unsigned_long_long; ; break;} -case 103: -#line 800 "./c-exp.y" +case 106: +#line 817 "c-exp.y" { yyval.tval = builtin_type_unsigned_long_long; ; break;} -case 104: -#line 802 "./c-exp.y" +case 107: +#line 819 "c-exp.y" { yyval.tval = builtin_type_short; ; break;} -case 105: -#line 804 "./c-exp.y" +case 108: +#line 821 "c-exp.y" { yyval.tval = builtin_type_unsigned_short; ; break;} -case 106: -#line 806 "./c-exp.y" +case 109: +#line 823 "c-exp.y" { yyval.tval = builtin_type_double; ; break;} -case 107: -#line 808 "./c-exp.y" +case 110: +#line 825 "c-exp.y" { yyval.tval = builtin_type_long_double; ; break;} -case 108: -#line 810 "./c-exp.y" +case 111: +#line 827 "c-exp.y" { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval), expression_context_block); ; break;} -case 109: -#line 813 "./c-exp.y" +case 112: +#line 830 "c-exp.y" { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval), expression_context_block); ; break;} -case 110: -#line 816 "./c-exp.y" +case 113: +#line 833 "c-exp.y" { yyval.tval = lookup_union (copy_name (yyvsp[0].sval), expression_context_block); ; break;} -case 111: -#line 819 "./c-exp.y" +case 114: +#line 836 "c-exp.y" { yyval.tval = lookup_enum (copy_name (yyvsp[0].sval), expression_context_block); ; break;} -case 112: -#line 822 "./c-exp.y" +case 115: +#line 839 "c-exp.y" { yyval.tval = lookup_unsigned_typename (TYPE_NAME(yyvsp[0].tsym.type)); ; break;} -case 113: -#line 824 "./c-exp.y" +case 116: +#line 841 "c-exp.y" { yyval.tval = builtin_type_unsigned_int; ; break;} -case 114: -#line 826 "./c-exp.y" +case 117: +#line 843 "c-exp.y" { yyval.tval = lookup_signed_typename (TYPE_NAME(yyvsp[0].tsym.type)); ; break;} -case 115: -#line 828 "./c-exp.y" +case 118: +#line 845 "c-exp.y" { yyval.tval = builtin_type_int; ; break;} -case 116: -#line 830 "./c-exp.y" +case 119: +#line 850 "c-exp.y" { yyval.tval = lookup_template_type(copy_name(yyvsp[-3].sval), yyvsp[-1].tval, expression_context_block); ; break;} -case 117: -#line 836 "./c-exp.y" +case 120: +#line 856 "c-exp.y" { yyval.tval = yyvsp[0].tval; ; break;} -case 118: -#line 837 "./c-exp.y" +case 121: +#line 857 "c-exp.y" { yyval.tval = yyvsp[0].tval; ; break;} -case 120: -#line 842 "./c-exp.y" +case 123: +#line 862 "c-exp.y" { yyval.tsym.stoken.ptr = "int"; yyval.tsym.stoken.length = 3; yyval.tsym.type = builtin_type_int; ; break;} -case 121: -#line 848 "./c-exp.y" +case 124: +#line 868 "c-exp.y" { yyval.tsym.stoken.ptr = "long"; yyval.tsym.stoken.length = 4; yyval.tsym.type = builtin_type_long; ; break;} -case 122: -#line 854 "./c-exp.y" +case 125: +#line 874 "c-exp.y" { yyval.tsym.stoken.ptr = "short"; yyval.tsym.stoken.length = 5; yyval.tsym.type = builtin_type_short; ; break;} -case 123: -#line 863 "./c-exp.y" +case 126: +#line 883 "c-exp.y" { yyval.tvec = (struct type **) xmalloc (sizeof (struct type *) * 2); yyval.ivec[0] = 1; /* Number of types in vector */ yyval.tvec[1] = yyvsp[0].tval; ; break;} -case 124: -#line 868 "./c-exp.y" +case 127: +#line 888 "c-exp.y" { int len = sizeof (struct type *) * (++(yyvsp[-2].ivec[0]) + 1); yyval.tvec = (struct type **) xrealloc ((char *) yyvsp[-2].tvec, len); yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval; ; break;} -case 125: -#line 874 "./c-exp.y" +case 128: +#line 894 "c-exp.y" { yyval.sval = yyvsp[0].ssym.stoken; ; break;} -case 126: -#line 875 "./c-exp.y" +case 129: +#line 895 "c-exp.y" { yyval.sval = yyvsp[0].ssym.stoken; ; break;} -case 127: -#line 876 "./c-exp.y" +case 130: +#line 896 "c-exp.y" { yyval.sval = yyvsp[0].tsym.stoken; ; break;} -case 128: -#line 877 "./c-exp.y" +case 131: +#line 897 "c-exp.y" { yyval.sval = yyvsp[0].ssym.stoken; ; break;} } /* the action file gets copied in in place of this dollarsign */ -#line 487 "/usr/unsupported/share/bison.simple" +#line 498 "/stone/jimb/main-98r2/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; @@ -1951,7 +1963,7 @@ yyerrhandle: yystate = yyn; goto yynewstate; } -#line 891 "./c-exp.y" +#line 911 "c-exp.y" /* Take care of parsing a number (anything that starts with a digit). @@ -1971,7 +1983,7 @@ parse_number (p, len, parsed_float, putithere) here, and we do kind of silly things like cast to unsigned. */ register LONGEST n = 0; register LONGEST prevn = 0; - unsigned LONGEST un; + ULONGEST un; register int i = 0; register int c; @@ -1984,34 +1996,38 @@ parse_number (p, len, parsed_float, putithere) /* We have found a "L" or "U" suffix. */ int found_suffix = 0; - unsigned LONGEST high_bit; + ULONGEST high_bit; struct type *signed_type; struct type *unsigned_type; if (parsed_float) { - char c; - /* It's a float since it contains a point or an exponent. */ + char c; + int num = 0; /* number of tokens scanned by scanf */ + char saved_char = p[len]; + p[len] = 0; /* null-terminate the token */ if (sizeof (putithere->typed_val_float.dval) <= sizeof (float)) - sscanf (p, "%g", &putithere->typed_val_float.dval); + num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval,&c); else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) - sscanf (p, "%lg", &putithere->typed_val_float.dval); + num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval,&c); else { -#ifdef PRINTF_HAS_LONG_DOUBLE - sscanf (p, "%Lg", &putithere->typed_val_float.dval); +#ifdef SCANF_HAS_LONG_DOUBLE + num = sscanf (p, "%Lg%c", &putithere->typed_val_float.dval,&c); #else /* Scan it into a double, then assign it to the long double. This at least wins with values representable in the range of doubles. */ double temp; - sscanf (p, "%lg", &temp); + num = sscanf (p, "%lg%c", &temp,&c); putithere->typed_val_float.dval = temp; #endif } - + p[len] = saved_char; /* restore the input stream */ + if (num != 1) /* check scanf found ONLY a float ... */ + return ERROR; /* See if it has `f' or `l' suffix (float or long double). */ c = tolower (p[len - 1]); @@ -2107,7 +2123,7 @@ parse_number (p, len, parsed_float, putithere) on 0x123456789 when LONGEST is 32 bits. */ if (c != 'l' && c != 'u' && n != 0) { - if ((unsigned_p && (unsigned LONGEST) prevn >= (unsigned LONGEST) n)) + if ((unsigned_p && (ULONGEST) prevn >= (ULONGEST) n)) error ("Numeric constant too large."); } prevn = n; @@ -2125,11 +2141,11 @@ parse_number (p, len, parsed_float, putithere) the case where it is we just always shift the value more than once, with fewer bits each time. */ - un = (unsigned LONGEST)n >> 2; + un = (ULONGEST)n >> 2; if (long_p == 0 && (un >> (TARGET_INT_BIT - 2)) == 0) { - high_bit = ((unsigned LONGEST)1) << (TARGET_INT_BIT-1); + high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1); /* A large decimal (not hex or octal) constant (between INT_MAX and UINT_MAX) is a long or unsigned long, according to ANSI, @@ -2143,20 +2159,19 @@ parse_number (p, len, parsed_float, putithere) else if (long_p <= 1 && (un >> (TARGET_LONG_BIT - 2)) == 0) { - high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1); + high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1); unsigned_type = builtin_type_unsigned_long; signed_type = builtin_type_long; } else { - high_bit = (((unsigned LONGEST)1) - << (TARGET_LONG_LONG_BIT - 32 - 1) - << 16 - << 16); - if (high_bit == 0) + int shift; + if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT) /* A long long does not fit in a LONGEST. */ - high_bit = - (unsigned LONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1); + shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1); + else + shift = (TARGET_LONG_LONG_BIT - 1); + high_bit = (ULONGEST) 1 << shift; unsigned_type = builtin_type_unsigned_long_long; signed_type = builtin_type_long_long; } @@ -2228,9 +2243,15 @@ yylex () int tempbufindex; static char *tempbuf; static int tempbufsize; - + struct symbol * sym_class = NULL; + char * token_string = NULL; + int class_prefix = 0; + int unquoted_expr; + retry: + unquoted_expr = 1; + tokstart = lexptr; /* See if it is a special token of length 3. */ for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++) @@ -2282,6 +2303,7 @@ yylex () if (namelen > 2) { lexptr = tokstart + namelen; + unquoted_expr = 0; if (lexptr[-1] != '\'') error ("Unmatched single quote."); namelen -= 2; @@ -2466,15 +2488,45 @@ yylex () (c == '_' || c == '$' || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');) { - if (c == '<') - { - int i = namelen; - while (tokstart[++i] && tokstart[i] != '>'); - if (tokstart[i] == '>') - namelen = i; - } - c = tokstart[++namelen]; - } + /* Template parameter lists are part of the name. + FIXME: This mishandles `print $a<4&&$a>3'. */ + + if (c == '<') + { + if (hp_som_som_object_present) + { + /* Scan ahead to get rest of the template specification. Note + that we look ahead only when the '<' adjoins non-whitespace + characters; for comparison expressions, e.g. "a < b > c", + there must be spaces before the '<', etc. */ + + char * p = find_template_name_end (tokstart + namelen); + if (p) + namelen = p - tokstart; + break; + } + else + { + int i = namelen; + int nesting_level = 1; + while (tokstart[++i]) + { + if (tokstart[i] == '<') + nesting_level++; + else if (tokstart[i] == '>') + { + if (--nesting_level == 0) + break; + } + } + if (tokstart[i] == '>') + namelen = i; + else + break; + } + } + c = tokstart[++namelen]; + } /* The token "if" terminates the expression and is NOT removed from the input stream. */ @@ -2510,9 +2562,13 @@ yylex () return DOUBLE_KEYWORD; break; case 5: - if (current_language->la_language == language_cplus - && STREQN (tokstart, "class", 5)) - return CLASS; + if (current_language->la_language == language_cplus) + { + if (STREQN (tokstart, "false", 5)) + return FALSEKEYWORD; + if (STREQN (tokstart, "class", 5)) + return CLASS; + } if (STREQN (tokstart, "union", 5)) return UNION; if (STREQN (tokstart, "short", 5)) @@ -2525,17 +2581,22 @@ yylex () return ENUM; if (STREQN (tokstart, "long", 4)) return LONG; - if (current_language->la_language == language_cplus - && STREQN (tokstart, "this", 4)) - { - static const char this_name[] = - { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' }; - - if (lookup_symbol (this_name, expression_context_block, - VAR_NAMESPACE, (int *) NULL, - (struct symtab **) NULL)) - return THIS; - } + if (current_language->la_language == language_cplus) + { + if (STREQN (tokstart, "true", 4)) + return TRUEKEYWORD; + + if (STREQN (tokstart, "this", 4)) + { + static const char this_name[] = + { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' }; + + if (lookup_symbol (this_name, expression_context_block, + VAR_NAMESPACE, (int *) NULL, + (struct symtab **) NULL)) + return THIS; + } + } break; case 3: if (STREQN (tokstart, "int", 3)) @@ -2553,7 +2614,25 @@ yylex () write_dollar_variable (yylval.sval); return VARIABLE; } - + + /* Look ahead and see if we can consume more of the input + string to get a reasonable class/namespace spec or a + fully-qualified name. This is a kludge to get around the + HP aCC compiler's generation of symbol names with embedded + colons for namespace and nested classes. */ + if (unquoted_expr) + { + /* Only do it if not inside single quotes */ + sym_class = parse_nested_classes_for_hpacc (yylval.sval.ptr, yylval.sval.length, + &token_string, &class_prefix, &lexptr); + if (sym_class) + { + /* Replace the current token with the bigger one we found */ + yylval.sval.ptr = token_string; + yylval.sval.length = strlen (token_string); + } + } + /* Use token-type BLOCKNAME for symbols that happen to be defined as functions or symtabs. If this is not so, then ... Use token-type TYPENAME for symbols that happen to be defined @@ -2573,13 +2652,25 @@ yylex () /* Call lookup_symtab, not lookup_partial_symtab, in case there are no psymtabs (coff, xcoff, or some future change to blow away the psymtabs once once symbols are read). */ - if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) || - lookup_symtab (tmp)) + if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK) { yylval.ssym.sym = sym; yylval.ssym.is_a_field_of_this = is_a_field_of_this; return BLOCKNAME; } + else if (!sym) + { /* See if it's a file name. */ + struct symtab *symtab; + + symtab = lookup_symtab (tmp); + + if (symtab) + { + yylval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK); + return FILENAME; + } + } + if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF) { #if 1 diff --git a/contrib/gdb/gdb/c-exp.y b/contrib/gdb/gdb/c-exp.y index f1156e6..377f92a 100644 --- a/contrib/gdb/gdb/c-exp.y +++ b/contrib/gdb/gdb/c-exp.y @@ -1,5 +1,5 @@ /* YACC parser for C expressions, for GDB. - Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994 + Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1996, 1997 Free Software Foundation, Inc. This file is part of GDB. @@ -49,6 +49,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +/* Flag indicating we're dealing with HP-compiled objects */ +extern int hp_som_som_object_present; + /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple yacc generated parsers in gdb. Note that these are only the variables @@ -195,6 +198,9 @@ parse_number PARAMS ((char *, int, int, YYSTYPE *)); /* C++ */ %token THIS +%token TRUEKEYWORD +%token FALSEKEYWORD + %left ',' %left ABOVE_COMMA @@ -214,6 +220,7 @@ parse_number PARAMS ((char *, int, int, YYSTYPE *)); %right UNARY INCREMENT DECREMENT %right ARROW '.' '[' '(' %token BLOCKNAME +%token FILENAME %type block %left COLONCOLON @@ -288,6 +295,7 @@ exp : exp ARROW qualified_name write_exp_elt_opcode (UNOP_ADDR); write_exp_elt_opcode (STRUCTOP_MPTR); } ; + exp : exp ARROW '*' exp { write_exp_elt_opcode (STRUCTOP_MPTR); } ; @@ -298,7 +306,6 @@ exp : exp '.' name write_exp_elt_opcode (STRUCTOP_STRUCT); } ; - exp : exp '.' qualified_name { /* exp.type::name becomes exp.*(&type::name) */ /* Note: this doesn't work if name is a @@ -528,22 +535,33 @@ exp : THIS write_exp_elt_opcode (OP_THIS); } ; +exp : TRUEKEYWORD + { write_exp_elt_opcode (OP_LONG); + write_exp_elt_type (builtin_type_bool); + write_exp_elt_longcst ((LONGEST) 1); + write_exp_elt_opcode (OP_LONG); } + ; + +exp : FALSEKEYWORD + { write_exp_elt_opcode (OP_LONG); + write_exp_elt_type (builtin_type_bool); + write_exp_elt_longcst ((LONGEST) 0); + write_exp_elt_opcode (OP_LONG); } + ; + /* end of C++. */ block : BLOCKNAME { - if ($1.sym != 0) - $$ = SYMBOL_BLOCK_VALUE ($1.sym); + if ($1.sym) + $$ = SYMBOL_BLOCK_VALUE ($1.sym); else - { - struct symtab *tem = - lookup_symtab (copy_name ($1.stoken)); - if (tem) - $$ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK); - else - error ("No file or function \"%s\".", - copy_name ($1.stoken)); - } + error ("No file or function \"%s\".", + copy_name ($1.stoken)); + } + | FILENAME + { + $$ = $1; } ; @@ -596,15 +614,14 @@ qualified_name: typebase COLONCOLON name error ("`%s' is not defined as an aggregate type.", TYPE_NAME (type)); - if (!STREQ (type_name_no_tag (type), $4.ptr)) - error ("invalid destructor `%s::~%s'", - type_name_no_tag (type), $4.ptr); - tmp_token.ptr = (char*) alloca ($4.length + 2); tmp_token.length = $4.length + 1; tmp_token.ptr[0] = '~'; memcpy (tmp_token.ptr+1, $4.ptr, $4.length); tmp_token.ptr[tmp_token.length] = 0; + + /* Check for valid destructor name. */ + destructor_name_p (tmp_token.ptr, type); write_exp_elt_opcode (OP_SCOPE); write_exp_elt_type (type); write_exp_string (tmp_token); @@ -826,6 +843,9 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */ { $$ = lookup_signed_typename (TYPE_NAME($2.type)); } | SIGNED_KEYWORD { $$ = builtin_type_int; } + /* It appears that this rule for templates is never + reduced; template recognition happens by lookahead + in the token processing code in yylex. */ | TEMPLATE name '<' type '>' { $$ = lookup_template_type(copy_name($2), $4, expression_context_block); @@ -907,7 +927,7 @@ parse_number (p, len, parsed_float, putithere) here, and we do kind of silly things like cast to unsigned. */ register LONGEST n = 0; register LONGEST prevn = 0; - unsigned LONGEST un; + ULONGEST un; register int i = 0; register int c; @@ -920,34 +940,38 @@ parse_number (p, len, parsed_float, putithere) /* We have found a "L" or "U" suffix. */ int found_suffix = 0; - unsigned LONGEST high_bit; + ULONGEST high_bit; struct type *signed_type; struct type *unsigned_type; if (parsed_float) { - char c; - /* It's a float since it contains a point or an exponent. */ + char c; + int num = 0; /* number of tokens scanned by scanf */ + char saved_char = p[len]; + p[len] = 0; /* null-terminate the token */ if (sizeof (putithere->typed_val_float.dval) <= sizeof (float)) - sscanf (p, "%g", &putithere->typed_val_float.dval); + num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval,&c); else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) - sscanf (p, "%lg", &putithere->typed_val_float.dval); + num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval,&c); else { -#ifdef PRINTF_HAS_LONG_DOUBLE - sscanf (p, "%Lg", &putithere->typed_val_float.dval); +#ifdef SCANF_HAS_LONG_DOUBLE + num = sscanf (p, "%Lg%c", &putithere->typed_val_float.dval,&c); #else /* Scan it into a double, then assign it to the long double. This at least wins with values representable in the range of doubles. */ double temp; - sscanf (p, "%lg", &temp); + num = sscanf (p, "%lg%c", &temp,&c); putithere->typed_val_float.dval = temp; #endif } - + p[len] = saved_char; /* restore the input stream */ + if (num != 1) /* check scanf found ONLY a float ... */ + return ERROR; /* See if it has `f' or `l' suffix (float or long double). */ c = tolower (p[len - 1]); @@ -1043,7 +1067,7 @@ parse_number (p, len, parsed_float, putithere) on 0x123456789 when LONGEST is 32 bits. */ if (c != 'l' && c != 'u' && n != 0) { - if ((unsigned_p && (unsigned LONGEST) prevn >= (unsigned LONGEST) n)) + if ((unsigned_p && (ULONGEST) prevn >= (ULONGEST) n)) error ("Numeric constant too large."); } prevn = n; @@ -1061,11 +1085,11 @@ parse_number (p, len, parsed_float, putithere) the case where it is we just always shift the value more than once, with fewer bits each time. */ - un = (unsigned LONGEST)n >> 2; + un = (ULONGEST)n >> 2; if (long_p == 0 && (un >> (TARGET_INT_BIT - 2)) == 0) { - high_bit = ((unsigned LONGEST)1) << (TARGET_INT_BIT-1); + high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1); /* A large decimal (not hex or octal) constant (between INT_MAX and UINT_MAX) is a long or unsigned long, according to ANSI, @@ -1079,20 +1103,19 @@ parse_number (p, len, parsed_float, putithere) else if (long_p <= 1 && (un >> (TARGET_LONG_BIT - 2)) == 0) { - high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1); + high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1); unsigned_type = builtin_type_unsigned_long; signed_type = builtin_type_long; } else { - high_bit = (((unsigned LONGEST)1) - << (TARGET_LONG_LONG_BIT - 32 - 1) - << 16 - << 16); - if (high_bit == 0) + int shift; + if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT) /* A long long does not fit in a LONGEST. */ - high_bit = - (unsigned LONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1); + shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1); + else + shift = (TARGET_LONG_LONG_BIT - 1); + high_bit = (ULONGEST) 1 << shift; unsigned_type = builtin_type_unsigned_long_long; signed_type = builtin_type_long_long; } @@ -1164,9 +1187,15 @@ yylex () int tempbufindex; static char *tempbuf; static int tempbufsize; - + struct symbol * sym_class = NULL; + char * token_string = NULL; + int class_prefix = 0; + int unquoted_expr; + retry: + unquoted_expr = 1; + tokstart = lexptr; /* See if it is a special token of length 3. */ for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++) @@ -1218,6 +1247,7 @@ yylex () if (namelen > 2) { lexptr = tokstart + namelen; + unquoted_expr = 0; if (lexptr[-1] != '\'') error ("Unmatched single quote."); namelen -= 2; @@ -1402,15 +1432,45 @@ yylex () (c == '_' || c == '$' || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');) { - if (c == '<') - { - int i = namelen; - while (tokstart[++i] && tokstart[i] != '>'); - if (tokstart[i] == '>') - namelen = i; - } - c = tokstart[++namelen]; - } + /* Template parameter lists are part of the name. + FIXME: This mishandles `print $a<4&&$a>3'. */ + + if (c == '<') + { + if (hp_som_som_object_present) + { + /* Scan ahead to get rest of the template specification. Note + that we look ahead only when the '<' adjoins non-whitespace + characters; for comparison expressions, e.g. "a < b > c", + there must be spaces before the '<', etc. */ + + char * p = find_template_name_end (tokstart + namelen); + if (p) + namelen = p - tokstart; + break; + } + else + { + int i = namelen; + int nesting_level = 1; + while (tokstart[++i]) + { + if (tokstart[i] == '<') + nesting_level++; + else if (tokstart[i] == '>') + { + if (--nesting_level == 0) + break; + } + } + if (tokstart[i] == '>') + namelen = i; + else + break; + } + } + c = tokstart[++namelen]; + } /* The token "if" terminates the expression and is NOT removed from the input stream. */ @@ -1446,9 +1506,13 @@ yylex () return DOUBLE_KEYWORD; break; case 5: - if (current_language->la_language == language_cplus - && STREQN (tokstart, "class", 5)) - return CLASS; + if (current_language->la_language == language_cplus) + { + if (STREQN (tokstart, "false", 5)) + return FALSEKEYWORD; + if (STREQN (tokstart, "class", 5)) + return CLASS; + } if (STREQN (tokstart, "union", 5)) return UNION; if (STREQN (tokstart, "short", 5)) @@ -1461,17 +1525,22 @@ yylex () return ENUM; if (STREQN (tokstart, "long", 4)) return LONG; - if (current_language->la_language == language_cplus - && STREQN (tokstart, "this", 4)) - { - static const char this_name[] = - { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' }; - - if (lookup_symbol (this_name, expression_context_block, - VAR_NAMESPACE, (int *) NULL, - (struct symtab **) NULL)) - return THIS; - } + if (current_language->la_language == language_cplus) + { + if (STREQN (tokstart, "true", 4)) + return TRUEKEYWORD; + + if (STREQN (tokstart, "this", 4)) + { + static const char this_name[] = + { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' }; + + if (lookup_symbol (this_name, expression_context_block, + VAR_NAMESPACE, (int *) NULL, + (struct symtab **) NULL)) + return THIS; + } + } break; case 3: if (STREQN (tokstart, "int", 3)) @@ -1489,7 +1558,25 @@ yylex () write_dollar_variable (yylval.sval); return VARIABLE; } - + + /* Look ahead and see if we can consume more of the input + string to get a reasonable class/namespace spec or a + fully-qualified name. This is a kludge to get around the + HP aCC compiler's generation of symbol names with embedded + colons for namespace and nested classes. */ + if (unquoted_expr) + { + /* Only do it if not inside single quotes */ + sym_class = parse_nested_classes_for_hpacc (yylval.sval.ptr, yylval.sval.length, + &token_string, &class_prefix, &lexptr); + if (sym_class) + { + /* Replace the current token with the bigger one we found */ + yylval.sval.ptr = token_string; + yylval.sval.length = strlen (token_string); + } + } + /* Use token-type BLOCKNAME for symbols that happen to be defined as functions or symtabs. If this is not so, then ... Use token-type TYPENAME for symbols that happen to be defined @@ -1509,13 +1596,25 @@ yylex () /* Call lookup_symtab, not lookup_partial_symtab, in case there are no psymtabs (coff, xcoff, or some future change to blow away the psymtabs once once symbols are read). */ - if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) || - lookup_symtab (tmp)) + if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK) { yylval.ssym.sym = sym; yylval.ssym.is_a_field_of_this = is_a_field_of_this; return BLOCKNAME; } + else if (!sym) + { /* See if it's a file name. */ + struct symtab *symtab; + + symtab = lookup_symtab (tmp); + + if (symtab) + { + yylval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK); + return FILENAME; + } + } + if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF) { #if 1 diff --git a/contrib/gdb/gdb/c-lang.c b/contrib/gdb/gdb/c-lang.c index 66ee3e1..e7aa055 100644 --- a/contrib/gdb/gdb/c-lang.c +++ b/contrib/gdb/gdb/c-lang.c @@ -25,17 +25,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "language.h" #include "c-lang.h" +static void c_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter)); + /* Print the character C on STREAM as part of the contents of a literal string whose delimiter is QUOTER. Note that that format for printing characters and strings is language specific. */ static void -emit_char (c, stream, quoter) +c_emit_char (c, stream, quoter) register int c; GDB_FILE *stream; int quoter; { - c &= 0xFF; /* Avoid sign bit follies */ if (PRINT_LITERAL_FORM (c)) @@ -83,21 +84,23 @@ c_printchar (c, stream) int c; GDB_FILE *stream; { - fputs_filtered ("'", stream); - emit_char (c, stream, '\''); - fputs_filtered ("'", stream); + fputc_filtered ('\'', stream); + LA_EMIT_CHAR (c, stream, '\''); + fputc_filtered ('\'', stream); } /* Print the character string STRING, printing at most LENGTH characters. - Printing stops early if the number hits print_max; repeat counts - are printed as appropriate. Print ellipses at the end if we - had to stop before printing LENGTH characters, or if FORCE_ELLIPSES. */ + LENGTH is -1 if the string is nul terminated. Each character is WIDTH bytes + long. Printing stops early if the number hits print_max; repeat counts are + printed as appropriate. Print ellipses at the end if we had to stop before + printing LENGTH characters, or if FORCE_ELLIPSES. */ void -c_printstr (stream, string, length, force_ellipses) +c_printstr (stream, string, length, width, force_ellipses) GDB_FILE *stream; char *string; unsigned int length; + int width; int force_ellipses; { register unsigned int i; @@ -111,7 +114,9 @@ c_printstr (stream, string, length, force_ellipses) /* If the string was not truncated due to `set print elements', and the last byte of it is a null, we don't print that, in traditional C style. */ - if ((!force_ellipses) && length > 0 && string[length-1] == '\0') + if (!force_ellipses + && length > 0 + && extract_unsigned_integer (string + (length - 1) * width, width) == '\0') length--; if (length == 0) @@ -127,6 +132,7 @@ c_printstr (stream, string, length, force_ellipses) unsigned int rep1; /* Number of repetitions we have detected so far. */ unsigned int reps; + unsigned long current_char; QUIT; @@ -136,9 +142,13 @@ c_printstr (stream, string, length, force_ellipses) need_comma = 0; } + current_char = extract_unsigned_integer (string + i * width, width); + rep1 = i + 1; reps = 1; - while (rep1 < length && string[rep1] == string[i]) + while (rep1 < length + && extract_unsigned_integer (string + rep1 * width, width) + == current_char) { ++rep1; ++reps; @@ -154,7 +164,7 @@ c_printstr (stream, string, length, force_ellipses) fputs_filtered ("\", ", stream); in_quotes = 0; } - c_printchar (string[i], stream); + LA_PRINT_CHAR (current_char, stream); fprintf_filtered (stream, " ", reps); i = rep1 - 1; things_printed += repeat_count_threshold; @@ -170,7 +180,7 @@ c_printstr (stream, string, length, force_ellipses) fputs_filtered ("\"", stream); in_quotes = 1; } - emit_char (string[i], stream, '"'); + LA_EMIT_CHAR (current_char, stream, '"'); ++things_printed; } } @@ -235,10 +245,17 @@ c_create_fundamental_type (objfile, typeid) TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "void", objfile); break; + case FT_BOOLEAN: + type = init_type (TYPE_CODE_BOOL, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "bool", objfile); + + break; case FT_CHAR: type = init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "char", objfile); + TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN; break; case FT_SIGNED_CHAR: type = init_type (TYPE_CODE_INT, @@ -324,6 +341,12 @@ c_create_fundamental_type (objfile, typeid) type = init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, 0, "long double", objfile); + break; + case FT_TEMPLATE_ARG: + type = init_type (TYPE_CODE_TEMPLATE_ARG, + 0, + 0, "